1 | import * as React from 'react';
|
2 | import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@kalamazoo/analytics-next';
|
3 | import { InterpolationWithTheme } from '@emotion/core';
|
4 | export declare type ButtonAppearances = 'default' | 'danger' | 'link' | 'primary' | 'subtle' | 'subtle-link' | 'warning';
|
5 | declare type HtmlAttributes = Pick<React.AllHTMLAttributes<HTMLElement>, Exclude<keyof React.AllHTMLAttributes<HTMLElement>, keyof OnlyButtonProps | 'css'>> & {
|
6 | css?: InterpolationWithTheme<any>;
|
7 | };
|
8 | export declare type OnlyButtonProps = {
|
9 |
|
10 | appearance?: ButtonAppearances;
|
11 |
|
12 | autoFocus?: boolean;
|
13 |
|
14 | className?: string;
|
15 |
|
16 | component?: React.ElementType<any>;
|
17 |
|
18 | consumerRef?: React.Ref<HTMLElement>;
|
19 |
|
20 | href?: string;
|
21 |
|
22 | iconAfter?: React.ReactChild;
|
23 |
|
24 | iconBefore?: React.ReactChild;
|
25 |
|
26 | isDisabled?: boolean;
|
27 | |
28 |
|
29 |
|
30 |
|
31 |
|
32 | isLoading?: boolean;
|
33 |
|
34 | isSelected?: boolean;
|
35 |
|
36 | onBlur?: React.FocusEventHandler<HTMLElement>;
|
37 |
|
38 | onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
39 | onMouseDown?: React.MouseEventHandler<HTMLElement>;
|
40 | onMouseEnter?: React.MouseEventHandler<HTMLElement>;
|
41 | onMouseLeave?: React.MouseEventHandler<HTMLElement>;
|
42 | onMouseUp?: React.MouseEventHandler<HTMLElement>;
|
43 |
|
44 | onFocus?: React.FocusEventHandler<HTMLElement>;
|
45 |
|
46 | spacing?: Spacing;
|
47 |
|
48 | target?: string;
|
49 |
|
50 | shouldFitContainer?: boolean;
|
51 |
|
52 | theme?: (current: (props: ThemeProps) => ThemeTokens, props: ThemeProps) => ThemeTokens;
|
53 | children?: React.ReactNode;
|
54 |
|
55 | testId?: string;
|
56 | };
|
57 | export interface ButtonProps extends HtmlAttributes, OnlyButtonProps, WithAnalyticsEventsProps {
|
58 | }
|
59 | export declare type Spacing = 'compact' | 'default' | 'none';
|
60 | export declare type ThemeMode = 'dark' | 'light';
|
61 | export declare type ThemeTokens = {
|
62 | buttonStyles: Object;
|
63 | spinnerStyles: Object;
|
64 | };
|
65 | export interface ThemeProps extends Partial<ButtonProps> {
|
66 | state: string;
|
67 | iconIsOnlyChild?: boolean;
|
68 | mode?: ThemeMode;
|
69 | }
|
70 | export declare type ThemeFallbacks = {
|
71 | [index: string]: {
|
72 | [index: string]: string;
|
73 | };
|
74 | };
|
75 | export declare type AppearanceStates = {
|
76 | default: {
|
77 | light: string;
|
78 | dark?: string;
|
79 | };
|
80 | hover?: {
|
81 | light: string;
|
82 | dark?: string;
|
83 | };
|
84 | active?: {
|
85 | light: string;
|
86 | dark?: string;
|
87 | };
|
88 | disabled?: {
|
89 | light: string;
|
90 | dark?: string;
|
91 | };
|
92 | selected?: {
|
93 | light: string;
|
94 | dark?: string;
|
95 | };
|
96 | focusSelected?: {
|
97 | light: string;
|
98 | dark?: string;
|
99 | };
|
100 | };
|
101 | export {};
|