baseui 11.0.1 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/a11y/index.d.ts +1 -1
  2. package/accordion/index.d.ts +25 -28
  3. package/app-nav-bar/app-nav-bar.js +33 -40
  4. package/app-nav-bar/app-nav-bar.js.flow +46 -62
  5. package/app-nav-bar/index.d.ts +9 -8
  6. package/app-nav-bar/styled-components.js +49 -29
  7. package/app-nav-bar/styled-components.js.flow +25 -8
  8. package/app-nav-bar/types.js.flow +2 -0
  9. package/aspect-ratio-box/index.d.ts +2 -4
  10. package/avatar/index.d.ts +6 -12
  11. package/badge/badge.js +109 -0
  12. package/badge/badge.js.flow +91 -0
  13. package/badge/constants.js +54 -0
  14. package/badge/constants.js.flow +52 -0
  15. package/badge/hint-dot.js +96 -0
  16. package/badge/hint-dot.js.flow +68 -0
  17. package/badge/index.d.ts +97 -0
  18. package/badge/index.js +80 -0
  19. package/badge/index.js.flow +20 -0
  20. package/badge/notification-circle.js +103 -0
  21. package/badge/notification-circle.js.flow +81 -0
  22. package/badge/package.json +4 -0
  23. package/badge/styled-components.js +242 -0
  24. package/badge/styled-components.js.flow +325 -0
  25. package/badge/types.js +11 -0
  26. package/badge/types.js.flow +59 -0
  27. package/badge/utils.js +33 -0
  28. package/badge/utils.js.flow +23 -0
  29. package/banner/banner.js +283 -0
  30. package/banner/banner.js.flow +253 -0
  31. package/banner/constants.js +35 -0
  32. package/banner/constants.js.flow +33 -0
  33. package/banner/index.d.ts +75 -0
  34. package/banner/index.js +44 -0
  35. package/banner/index.js.flow +16 -0
  36. package/banner/package.json +4 -0
  37. package/banner/styled-components.js +131 -0
  38. package/banner/styled-components.js.flow +119 -0
  39. package/banner/types.js +11 -0
  40. package/banner/types.js.flow +66 -0
  41. package/block/index.d.ts +4 -4
  42. package/breadcrumbs/breadcrumbs.js +5 -1
  43. package/breadcrumbs/breadcrumbs.js.flow +2 -2
  44. package/breadcrumbs/index.d.ts +5 -5
  45. package/button/button.js +2 -1
  46. package/button/button.js.flow +1 -0
  47. package/button/index.d.ts +19 -29
  48. package/button-group/index.d.ts +18 -24
  49. package/card/index.d.ts +16 -14
  50. package/checkbox/index.d.ts +17 -21
  51. package/combobox/index.d.ts +7 -11
  52. package/data-table/index.d.ts +7 -10
  53. package/datepicker/calendar.js +16 -11
  54. package/datepicker/calendar.js.flow +12 -9
  55. package/datepicker/datepicker.js +58 -58
  56. package/datepicker/datepicker.js.flow +51 -34
  57. package/datepicker/index.d.ts +42 -63
  58. package/datepicker/stateful-calendar.js +6 -1
  59. package/datepicker/stateful-calendar.js.flow +8 -1
  60. package/datepicker/stateful-container.js +23 -2
  61. package/datepicker/stateful-container.js.flow +17 -4
  62. package/datepicker/stateful-datepicker.js +6 -1
  63. package/datepicker/stateful-datepicker.js.flow +7 -1
  64. package/datepicker/types.js.flow +21 -43
  65. package/datepicker/utils/date-helpers.js +1 -1
  66. package/datepicker/utils/date-helpers.js.flow +1 -1
  67. package/dnd-list/index.d.ts +22 -35
  68. package/drawer/index.d.ts +22 -27
  69. package/es/app-nav-bar/app-nav-bar.js +9 -19
  70. package/es/app-nav-bar/styled-components.js +32 -13
  71. package/es/badge/badge.js +70 -0
  72. package/es/badge/constants.js +42 -0
  73. package/es/badge/hint-dot.js +55 -0
  74. package/es/badge/index.js +11 -0
  75. package/es/badge/notification-circle.js +65 -0
  76. package/es/badge/styled-components.js +296 -0
  77. package/es/badge/types.js +8 -0
  78. package/es/badge/utils.js +17 -0
  79. package/es/banner/banner.js +213 -0
  80. package/es/banner/constants.js +24 -0
  81. package/es/banner/index.js +9 -0
  82. package/es/banner/styled-components.js +122 -0
  83. package/es/banner/types.js +8 -0
  84. package/es/breadcrumbs/breadcrumbs.js +5 -1
  85. package/es/button/button.js +1 -0
  86. package/es/datepicker/calendar.js +15 -10
  87. package/es/datepicker/datepicker.js +52 -52
  88. package/es/datepicker/stateful-calendar.js +6 -1
  89. package/es/datepicker/stateful-container.js +22 -2
  90. package/es/datepicker/stateful-datepicker.js +6 -1
  91. package/es/datepicker/utils/date-helpers.js +1 -1
  92. package/es/helper/helper-steps.js +3 -1
  93. package/es/input/base-input.js +18 -11
  94. package/es/input/input.js +15 -10
  95. package/es/input/masked-input.js +5 -2
  96. package/es/input/utils.js +4 -2
  97. package/es/locale/tr_TR.js +115 -0
  98. package/es/notification/notification.js +16 -1
  99. package/es/payment-card/custom-cards.config.js +22 -0
  100. package/es/payment-card/icons/uatp.js +52 -0
  101. package/es/payment-card/payment-card.js +8 -3
  102. package/es/popover/popover.js +2 -1
  103. package/es/popover/stateful-container.js +2 -0
  104. package/es/popover/styled-components.js +2 -1
  105. package/es/progress-steps/numbered-step.js +2 -2
  106. package/es/select/select-component.js +48 -23
  107. package/es/select/utils/default-filter-options.js +1 -1
  108. package/es/snackbar/snackbar-context.js +1 -1
  109. package/es/table-semantic/styled-components.js +14 -0
  110. package/es/table-semantic/table-builder.js +12 -5
  111. package/es/textarea/textarea.js +15 -9
  112. package/es/themes/dark-theme/color-component-tokens.js +8 -0
  113. package/es/themes/light-theme/color-component-tokens.js +8 -0
  114. package/es/tree-view/tree-label.js +9 -1
  115. package/esm/app-nav-bar/app-nav-bar.js +32 -38
  116. package/esm/app-nav-bar/styled-components.js +46 -28
  117. package/esm/badge/badge.js +97 -0
  118. package/esm/badge/constants.js +42 -0
  119. package/esm/badge/hint-dot.js +83 -0
  120. package/esm/badge/index.js +11 -0
  121. package/esm/badge/notification-circle.js +91 -0
  122. package/esm/badge/styled-components.js +235 -0
  123. package/esm/badge/types.js +8 -0
  124. package/esm/badge/utils.js +17 -0
  125. package/esm/banner/banner.js +271 -0
  126. package/esm/banner/constants.js +24 -0
  127. package/esm/banner/index.js +9 -0
  128. package/esm/banner/styled-components.js +113 -0
  129. package/esm/banner/types.js +8 -0
  130. package/esm/breadcrumbs/breadcrumbs.js +5 -1
  131. package/esm/button/button.js +2 -1
  132. package/esm/datepicker/calendar.js +16 -11
  133. package/esm/datepicker/datepicker.js +58 -58
  134. package/esm/datepicker/stateful-calendar.js +6 -1
  135. package/esm/datepicker/stateful-container.js +23 -2
  136. package/esm/datepicker/stateful-datepicker.js +6 -1
  137. package/esm/datepicker/utils/date-helpers.js +1 -1
  138. package/esm/helper/helper-steps.js +3 -1
  139. package/esm/input/base-input.js +18 -11
  140. package/esm/input/input.js +15 -10
  141. package/esm/input/masked-input.js +6 -3
  142. package/esm/input/utils.js +4 -2
  143. package/esm/locale/tr_TR.js +115 -0
  144. package/esm/notification/notification.js +17 -1
  145. package/esm/payment-card/custom-cards.config.js +22 -0
  146. package/esm/payment-card/icons/uatp.js +53 -0
  147. package/esm/payment-card/payment-card.js +9 -7
  148. package/esm/popover/popover.js +2 -1
  149. package/esm/popover/stateful-container.js +2 -0
  150. package/esm/popover/styled-components.js +3 -2
  151. package/esm/progress-steps/numbered-step.js +2 -2
  152. package/esm/select/select-component.js +85 -59
  153. package/esm/select/utils/default-filter-options.js +1 -1
  154. package/esm/snackbar/snackbar-context.js +1 -1
  155. package/esm/table-semantic/styled-components.js +31 -18
  156. package/esm/table-semantic/table-builder.js +34 -23
  157. package/esm/textarea/textarea.js +15 -9
  158. package/esm/themes/dark-theme/color-component-tokens.js +8 -0
  159. package/esm/themes/light-theme/color-component-tokens.js +8 -0
  160. package/esm/tree-view/tree-label.js +10 -2
  161. package/file-uploader/index.d.ts +11 -11
  162. package/flex-grid/index.d.ts +3 -3
  163. package/form-control/index.d.ts +7 -19
  164. package/header-navigation/index.d.ts +8 -9
  165. package/heading/index.d.ts +3 -4
  166. package/helper/helper-steps.js +19 -13
  167. package/helper/helper-steps.js.flow +3 -1
  168. package/helper/index.d.ts +7 -7
  169. package/helpers/base-provider.d.ts +16 -0
  170. package/helpers/overrides.d.ts +23 -0
  171. package/icon/index.d.ts +32 -32
  172. package/index.d.ts +34 -114
  173. package/input/base-input.js +18 -11
  174. package/input/base-input.js.flow +18 -6
  175. package/input/index.d.ts +29 -32
  176. package/input/input.js +15 -10
  177. package/input/input.js.flow +10 -5
  178. package/input/masked-input.js +6 -3
  179. package/input/masked-input.js.flow +3 -0
  180. package/input/types.js.flow +4 -0
  181. package/input/utils.js +4 -2
  182. package/input/utils.js.flow +2 -1
  183. package/layer/index.d.ts +6 -11
  184. package/layout-grid/index.d.ts +25 -7
  185. package/link/index.d.ts +2 -2
  186. package/list/index.d.ts +26 -31
  187. package/{locale.ts → locale/index.d.ts} +8 -0
  188. package/locale/tr_TR.js +123 -0
  189. package/locale/tr_TR.js.flow +124 -0
  190. package/map-marker/index.d.ts +41 -47
  191. package/menu/index.d.ts +27 -37
  192. package/modal/index.d.ts +28 -38
  193. package/notification/index.d.ts +2 -3
  194. package/notification/notification.js +18 -1
  195. package/notification/notification.js.flow +15 -1
  196. package/overrides.ts +2 -22
  197. package/package.json +26 -17
  198. package/pagination/index.d.ts +22 -26
  199. package/payment-card/custom-cards.config.js +30 -0
  200. package/payment-card/custom-cards.config.js.flow +29 -0
  201. package/payment-card/icons/uatp.js +67 -0
  202. package/payment-card/icons/uatp.js.flow +62 -0
  203. package/payment-card/index.d.ts +8 -8
  204. package/payment-card/payment-card.js +12 -7
  205. package/payment-card/payment-card.js.flow +12 -0
  206. package/phone-input/index.d.ts +261 -269
  207. package/pin-code/index.d.ts +11 -18
  208. package/popover/index.d.ts +39 -55
  209. package/popover/popover.js +2 -1
  210. package/popover/popover.js.flow +2 -1
  211. package/popover/stateful-container.js +2 -0
  212. package/popover/stateful-container.js.flow +2 -0
  213. package/popover/styled-components.js +3 -2
  214. package/popover/styled-components.js.flow +2 -1
  215. package/popover/types.js.flow +1 -0
  216. package/progress-bar/index.d.ts +11 -12
  217. package/progress-steps/index.d.ts +16 -16
  218. package/progress-steps/numbered-step.js.flow +2 -2
  219. package/radio/index.d.ts +12 -15
  220. package/rating/index.d.ts +9 -12
  221. package/select/index.d.ts +34 -36
  222. package/select/select-component.js +82 -56
  223. package/select/select-component.js.flow +46 -34
  224. package/select/types.js.flow +1 -0
  225. package/select/utils/default-filter-options.js +1 -1
  226. package/select/utils/default-filter-options.js.flow +1 -1
  227. package/side-navigation/index.d.ts +11 -13
  228. package/skeleton/index.d.ts +1 -1
  229. package/slider/index.d.ts +17 -26
  230. package/snackbar/index.d.ts +8 -8
  231. package/snackbar/snackbar-context.js +1 -1
  232. package/snackbar/snackbar-context.js.flow +1 -1
  233. package/spinner/index.d.ts +4 -3
  234. package/styles/index.d.ts +82 -2
  235. package/table/index.d.ts +16 -16
  236. package/table-grid/index.d.ts +6 -8
  237. package/table-semantic/index.d.ts +26 -32
  238. package/table-semantic/styled-components.js +33 -19
  239. package/table-semantic/styled-components.js.flow +12 -0
  240. package/table-semantic/table-builder.js +38 -22
  241. package/table-semantic/table-builder.js.flow +32 -17
  242. package/table-semantic/types.js.flow +1 -0
  243. package/tabs/index.d.ts +20 -23
  244. package/tabs-motion/index.d.ts +23 -23
  245. package/tag/index.d.ts +14 -18
  246. package/tag/types.js.flow +1 -1
  247. package/textarea/index.d.ts +11 -14
  248. package/textarea/textarea.js +15 -9
  249. package/textarea/textarea.js.flow +11 -5
  250. package/textarea/types.js.flow +1 -0
  251. package/theme.ts +36 -777
  252. package/themes/dark-theme/color-component-tokens.js +8 -0
  253. package/themes/dark-theme/color-component-tokens.js.flow +9 -0
  254. package/themes/index.d.ts +765 -0
  255. package/themes/light-theme/color-component-tokens.js +8 -0
  256. package/themes/light-theme/color-component-tokens.js.flow +9 -0
  257. package/themes/types.js.flow +9 -0
  258. package/timepicker/index.d.ts +5 -8
  259. package/timezonepicker/index.d.ts +5 -8
  260. package/toast/index.d.ts +26 -40
  261. package/tokens/index.d.ts +1 -1
  262. package/tooltip/index.d.ts +7 -9
  263. package/tree-view/index.d.ts +15 -19
  264. package/tree-view/tree-label.js +10 -2
  265. package/tree-view/tree-label.js.flow +4 -4
  266. package/typography/index.d.ts +37 -37
@@ -1,12 +1,11 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {Override} from '../overrides';
2
+ import { Override } from '../overrides';
4
3
 
5
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
4
+ import { SIZE, InputProps, InputOverrides, STATE_CHANGE_TYPE } from '../input';
6
5
 
7
- import {SIZE, InputProps, InputOverrides, STATE_CHANGE_TYPE} from '../input';
6
+ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
8
7
 
9
- export {SIZE};
8
+ export { SIZE };
10
9
 
11
10
  export type PinCodeOverrides = InputOverrides & {
12
11
  Root?: Override<any>;
@@ -18,10 +17,7 @@ export type PinCodeProps = Omit<InputProps, 'onChange' | 'value'> & {
18
17
  values: string[];
19
18
  manageFocus?: boolean;
20
19
  mask?: boolean | string;
21
- onChange: (args: {
22
- values: string[];
23
- event: React.FormEvent<HTMLInputElement>;
24
- }) => void;
20
+ onChange: (args: { values: string[]; event: React.FormEvent<HTMLInputElement> }) => void;
25
21
  };
26
22
 
27
23
  export type State = {
@@ -32,19 +28,16 @@ export interface StatefulContainerProps {
32
28
  children?: React.ReactNode;
33
29
  initialState?: State;
34
30
  stateReducer?: (
35
- type: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
31
+ type: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
36
32
  nextState: State,
37
- currentState: State,
33
+ currentState: State
38
34
  ) => State;
39
- onChange?: (args: {
40
- values: string[];
41
- event: React.FormEvent<HTMLInputElement>;
42
- }) => void;
35
+ onChange?: (args: { values: string[]; event: React.FormEvent<HTMLInputElement> }) => void;
43
36
  }
44
37
 
45
38
  export type StatefulPinCodeProps = Partial<PinCodeProps> &
46
- StatefulContainerProps & {children?: never; overrides?: PinCodeOverrides};
39
+ StatefulContainerProps & { children?: never; overrides?: PinCodeOverrides };
47
40
 
48
- export const StatefulPinCode: React.FC<StatefulPinCodeProps>;
49
- export const StatefulContainer: React.FC<StatefulContainerProps>;
41
+ export declare const StatefulPinCode: React.FC<StatefulPinCodeProps>;
42
+ export declare const StatefulContainer: React.FC<StatefulContainerProps>;
50
43
  export class PinCode extends React.Component<PinCodeProps> {}
@@ -1,14 +1,14 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {Override} from '../overrides';
4
- import {NormalizedOffsets, PopperDataObject, TetherPlacement} from '../layer';
2
+ import { StyletronComponent } from 'styletron-react';
3
+ import { Override } from '../overrides';
4
+ import { NormalizedOffsets, PopperDataObject, TetherPlacement } from '../layer';
5
5
 
6
- export interface ACCESSIBILITY_TYPE {
6
+ export declare const ACCESSIBILITY_TYPE: {
7
7
  none: 'none';
8
8
  menu: 'menu';
9
9
  tooltip: 'tooltip';
10
- }
11
- export interface PLACEMENT {
10
+ };
11
+ export declare const PLACEMENT: {
12
12
  auto: 'auto';
13
13
  topLeft: 'topLeft';
14
14
  top: 'top';
@@ -22,27 +22,28 @@ export interface PLACEMENT {
22
22
  leftBottom: 'leftBottom';
23
23
  left: 'left';
24
24
  leftTop: 'leftTop';
25
- }
26
- export interface TRIGGER_TYPE {
25
+ };
26
+ export declare const TRIGGER_TYPE: {
27
27
  click: 'click';
28
28
  hover: 'hover';
29
- }
30
- export interface STATE_CHANGE_TYPE {
29
+ };
30
+ export declare const STATE_CHANGE_TYPE: {
31
31
  open: 'open';
32
32
  close: 'close';
33
- }
34
- export type ANIMATE_IN_TIME = 20;
35
- export type ANIMATE_OUT_TIME = 0;
33
+ };
34
+
35
+ export const ANIMATE_IN_TIME = 20;
36
+ export const ANIMATE_OUT_TIME = 0;
36
37
 
37
38
  export type StateReducer = (
38
- stateChangeType: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
39
+ stateChangeType: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
39
40
  nextState: State,
40
- currentState: State,
41
+ currentState: State
41
42
  ) => State;
42
43
 
43
44
  export type StatefulPopoverProps = BasePopoverProps & {
44
45
  children?: React.ReactNode;
45
- content?: React.ReactNode | ((args: {close: () => void}) => React.ReactNode);
46
+ content?: React.ReactNode | ((args: { close: () => void }) => React.ReactNode);
46
47
  dismissOnClickOutside?: boolean;
47
48
  dismissOnEsc?: boolean;
48
49
  initialState?: State;
@@ -50,18 +51,15 @@ export type StatefulPopoverProps = BasePopoverProps & {
50
51
  onOpen?: () => any;
51
52
  stateReducer?: StateReducer;
52
53
  };
53
- export const StatefulPopover: React.FC<StatefulPopoverProps>;
54
+ export declare const StatefulPopover: React.FC<StatefulPopoverProps>;
54
55
 
55
56
  export type StatefulPopoverContainerProps = StatefulPopoverProps & {
56
- children: (props: PopoverProps & {children: never}) => React.ReactNode;
57
+ children: (props: PopoverProps & { children: never }) => React.ReactNode;
57
58
  };
58
59
  export interface State {
59
60
  isOpen: boolean;
60
61
  }
61
- export class StatefulContainer extends React.Component<
62
- StatefulPopoverContainerProps,
63
- State
64
- > {
62
+ export class StatefulContainer extends React.Component<StatefulPopoverContainerProps, State> {
65
63
  onBlur(): void;
66
64
  onClick(): void;
67
65
  onClickOutside(): void;
@@ -73,8 +71,8 @@ export class StatefulContainer extends React.Component<
73
71
  open(): void;
74
72
  close(): void;
75
73
  internalSetState(
76
- type: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
77
- changes: State,
74
+ type: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
75
+ changes: State
78
76
  ): void;
79
77
  }
80
78
 
@@ -93,11 +91,11 @@ export interface PopoverOverrides {
93
91
  Inner?: Override<SharedStylePropsArg>;
94
92
  }
95
93
  export interface BasePopoverProps {
96
- accessibilityType?: ACCESSIBILITY_TYPE[keyof ACCESSIBILITY_TYPE];
94
+ accessibilityType?: typeof ACCESSIBILITY_TYPE[keyof typeof ACCESSIBILITY_TYPE];
97
95
  focusLock?: boolean;
98
96
  autoFocus?: boolean;
99
97
  focusOptions?: FocusOptions;
100
- returnFocus?: boolean | FocusOptions | ((returnTo: Element) => (boolean | FocusOptions));
98
+ returnFocus?: boolean | FocusOptions | ((returnTo: Element) => boolean | FocusOptions);
101
99
  'data-baseweb'?: string;
102
100
  id?: string;
103
101
  ignoreBoundary?: boolean;
@@ -106,7 +104,7 @@ export interface BasePopoverProps {
106
104
  overrides?: PopoverOverrides;
107
105
  placement?: TetherPlacement[keyof TetherPlacement];
108
106
  showArrow?: boolean;
109
- triggerType?: TRIGGER_TYPE[keyof TRIGGER_TYPE];
107
+ triggerType?: typeof TRIGGER_TYPE[keyof typeof TRIGGER_TYPE];
110
108
  mountNode?: HTMLElement;
111
109
  animateOutTime?: number;
112
110
  popperOptions?: any;
@@ -138,18 +136,13 @@ export interface PopoverPrivateState {
138
136
  isLayerMounted: boolean;
139
137
  isMounted: boolean;
140
138
  }
141
- export class Popover extends React.Component<
142
- PopoverProps,
143
- PopoverPrivateState
144
- > {
139
+ export class Popover extends React.Component<PopoverProps, PopoverPrivateState> {
145
140
  init(prevProps: PopoverProps, prevState: PopoverPrivateState): void;
146
- getDefaultState(
147
- props: PopoverProps,
148
- ): {
141
+ getDefaultState(props: PopoverProps): {
149
142
  isAnimating: false;
150
- arrowOffset: {left: 0; top: 0};
151
- popoverOffset: {left: 0; top: 0};
152
- placement: PLACEMENT[keyof PLACEMENT];
143
+ arrowOffset: { left: 0; top: 0 };
144
+ popoverOffset: { left: 0; top: 0 };
145
+ placement: typeof PLACEMENT[keyof typeof PLACEMENT];
153
146
  isMounted: false;
154
147
  isLayerMounted: false;
155
148
  };
@@ -162,10 +155,7 @@ export class Popover extends React.Component<
162
155
  onPopoverMouseEnter(): void;
163
156
  onPopoverMouseLeave(): void;
164
157
  onKeyPress(evt: KeyboardEvent): void;
165
- onPopperUpdate(
166
- normalizedOffsets: NormalizedOffsets,
167
- data: PopperDataObject,
168
- ): void;
158
+ onPopperUpdate(normalizedOffsets: NormalizedOffsets, data: PopperDataObject): void;
169
159
  triggerOnMouseLeaveWithDelay(): void;
170
160
  triggerOnMouseLeave(): void;
171
161
  triggerOnMouseEnterWithDelay(): void;
@@ -181,23 +171,17 @@ export class Popover extends React.Component<
181
171
  getPopoverIdAttr(): string | null;
182
172
  getAnchorProps(): object;
183
173
  getPopoverBodyProps(): object;
184
- getSharedProps(): SharedStylePropsArg & {children?: React.ReactNode};
174
+ getSharedProps(): SharedStylePropsArg & { children?: React.ReactNode };
185
175
  getAnchorFromChildren(): React.ReactNode;
186
176
  renderAnchor(): React.ReactNode;
187
177
  renderPopover(): React.ReactNode;
188
178
  }
189
179
 
190
- export const StyledArrow: StyletronComponent<any>;
191
- export const StyledBody: StyletronComponent<any>;
192
- export const StyledInner: StyletronComponent<any>;
193
- export const StyledPadding: StyletronComponent<any>;
180
+ export declare const StyledArrow: StyletronComponent<any>;
181
+ export declare const StyledBody: StyletronComponent<any>;
182
+ export declare const StyledInner: StyletronComponent<any>;
183
+ export declare const StyledPadding: StyletronComponent<any>;
194
184
 
195
- export const ACCESSIBILITY_TYPE: ACCESSIBILITY_TYPE;
196
- export const PLACEMENT: PLACEMENT;
197
- export const TRIGGER_TYPE: TRIGGER_TYPE;
198
- export const STATE_CHANGE_TYPE: STATE_CHANGE_TYPE;
199
- export const POPOVER_MARGIN: 8;
200
- export const ARROW_SIZE: 6;
201
- export const ANIMATE_IN_TIME: ANIMATE_IN_TIME;
202
- export const ANIMATE_OUT_TIME: ANIMATE_OUT_TIME;
203
- export const ARROW_WIDTH: number;
185
+ export declare const POPOVER_MARGIN: 8;
186
+ export declare const ARROW_SIZE: 6;
187
+ export declare const ARROW_WIDTH: number;
@@ -413,6 +413,7 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
413
413
  $popoverOffset: popoverOffset,
414
414
  $placement: placement,
415
415
  $isAnimating: isAnimating,
416
+ $animationDuration: this.props.animateOutTime || _constants.ANIMATE_OUT_TIME,
416
417
  $isOpen: isOpen,
417
418
  $popoverMargin: popoverMargin,
418
419
  $isHoverTrigger: this.isHoverTrigger()
@@ -488,7 +489,7 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
488
489
  value: function render() {
489
490
  var _this4 = this;
490
491
 
491
- var mountedAndOpen = this.state.isMounted && this.props.isOpen;
492
+ var mountedAndOpen = this.state.isMounted && (this.props.isOpen || this.state.isAnimating);
492
493
  var rendered = [this.renderAnchor()];
493
494
  var renderedContent = mountedAndOpen || this.props.renderAll ? this.renderContent() : null;
494
495
  var defaultPopperOptions = {
@@ -345,6 +345,7 @@ class PopoverInner extends React.Component<PopoverPropsT, PopoverPrivateStateT>
345
345
  $popoverOffset: popoverOffset,
346
346
  $placement: placement,
347
347
  $isAnimating: isAnimating,
348
+ $animationDuration: this.props.animateOutTime || ANIMATE_OUT_TIME,
348
349
  $isOpen: isOpen,
349
350
  $popoverMargin: popoverMargin,
350
351
  $isHoverTrigger: this.isHoverTrigger(),
@@ -420,7 +421,7 @@ class PopoverInner extends React.Component<PopoverPropsT, PopoverPrivateStateT>
420
421
  }
421
422
 
422
423
  render() {
423
- const mountedAndOpen = this.state.isMounted && this.props.isOpen;
424
+ const mountedAndOpen = this.state.isMounted && (this.props.isOpen || this.state.isAnimating);
424
425
  const rendered = [this.renderAnchor()];
425
426
  const renderedContent = mountedAndOpen || this.props.renderAll ? this.renderContent() : null;
426
427
 
@@ -193,6 +193,7 @@ var StatefulContainer = /*#__PURE__*/function (_React$Component) {
193
193
  var _this$props = this.props,
194
194
  accessibilityType = _this$props.accessibilityType,
195
195
  autoFocus = _this$props.autoFocus,
196
+ animateOutTime = _this$props.animateOutTime,
196
197
  dismissOnClickOutside = _this$props.dismissOnClickOutside,
197
198
  dismissOnEsc = _this$props.dismissOnEsc,
198
199
  focusLock = _this$props.focusLock,
@@ -216,6 +217,7 @@ var StatefulContainer = /*#__PURE__*/function (_React$Component) {
216
217
  focusOptions = _this$props.focusOptions;
217
218
  var popoverProps = {
218
219
  accessibilityType: accessibilityType,
220
+ animateOutTime: animateOutTime,
219
221
  autoFocus: autoFocus,
220
222
  content: this.renderContent,
221
223
  focusLock: focusLock,
@@ -148,6 +148,7 @@ class StatefulContainer extends React.Component<StatefulPopoverContainerPropsT,
148
148
  const {
149
149
  accessibilityType,
150
150
  autoFocus,
151
+ animateOutTime,
151
152
  dismissOnClickOutside,
152
153
  dismissOnEsc,
153
154
  focusLock,
@@ -173,6 +174,7 @@ class StatefulContainer extends React.Component<StatefulPopoverContainerPropsT,
173
174
 
174
175
  const popoverProps: PopoverPropsWithoutChildrenT = {
175
176
  accessibilityType,
177
+ animateOutTime,
176
178
  autoFocus,
177
179
  content: this.renderContent,
178
180
  focusLock,
@@ -24,7 +24,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
24
24
  * Main popover container element that gets positioned next to the anchor
25
25
  */
26
26
  function getBodyStyles(props) {
27
- var $isOpen = props.$isOpen,
27
+ var $animationDuration = props.$animationDuration,
28
+ $isOpen = props.$isOpen,
28
29
  $isAnimating = props.$isAnimating,
29
30
  $placement = props.$placement,
30
31
  $popoverOffset = props.$popoverOffset,
@@ -43,7 +44,7 @@ function getBodyStyles(props) {
43
44
  borderBottomLeftRadius: $theme.borders.popoverBorderRadius,
44
45
  boxShadow: $theme.lighting.shadow600,
45
46
  transitionProperty: 'opacity,transform',
46
- transitionDuration: $isAnimating ? '0.1s' : '0s',
47
+ transitionDuration: $isAnimating ? $isOpen ? '0.1s' : "".concat($animationDuration, "ms") : '0s',
47
48
  transitionTimingFunction: $isOpen ? $theme.animation.easeOutCurve : $theme.animation.easeInCurve,
48
49
  opacity: $isAnimating && $isOpen ? 1 : 0,
49
50
  transform: $isAnimating && $isOpen ? (0, _utils.getEndPosition)($popoverOffset) : (0, _utils.getStartPosition)($popoverOffset, $placement, $showArrow ? _constants.ARROW_SIZE : 0, $popoverMargin)
@@ -21,6 +21,7 @@ import type { ThemeT } from '../styles/types.js';
21
21
  */
22
22
  export function getBodyStyles(props: BodyStylePropsArgT & { $theme: ThemeT }) {
23
23
  const {
24
+ $animationDuration,
24
25
  $isOpen,
25
26
  $isAnimating,
26
27
  $placement,
@@ -42,7 +43,7 @@ export function getBodyStyles(props: BodyStylePropsArgT & { $theme: ThemeT }) {
42
43
  borderBottomLeftRadius: $theme.borders.popoverBorderRadius,
43
44
  boxShadow: $theme.lighting.shadow600,
44
45
  transitionProperty: 'opacity,transform',
45
- transitionDuration: $isAnimating ? '0.1s' : '0s',
46
+ transitionDuration: $isAnimating ? ($isOpen ? '0.1s' : `${$animationDuration}ms`) : '0s',
46
47
  transitionTimingFunction: $isOpen
47
48
  ? $theme.animation.easeOutCurve
48
49
  : $theme.animation.easeInCurve,
@@ -175,6 +175,7 @@ export type ArrowStylePropsArgT = {
175
175
  };
176
176
 
177
177
  export type BodyStylePropsArgT = {
178
+ $animationDuration: number,
178
179
  $isAnimating: boolean,
179
180
  $isHoverTrigger: boolean,
180
181
  $isOpen: boolean,
@@ -2,11 +2,11 @@ import * as React from 'react';
2
2
  import { StyletronComponent } from 'styletron-react';
3
3
  import { Override } from '../overrides';
4
4
 
5
- export interface SIZE {
5
+ export declare const SIZE: {
6
6
  small: 'small';
7
7
  medium: 'medium';
8
8
  large: 'large';
9
- }
9
+ };
10
10
  export interface ProgressBarOverrides {
11
11
  Root?: Override<any>;
12
12
  BarContainer?: Override<any>;
@@ -22,7 +22,7 @@ export interface ProgressBarProps {
22
22
  getProgressLabel?: (value: number, successValue: number) => React.ReactNode;
23
23
  infinite?: boolean;
24
24
  overrides?: ProgressBarOverrides;
25
- size?: keyof SIZE;
25
+ size?: typeof SIZE[keyof typeof SIZE];
26
26
  showLabel?: boolean;
27
27
  steps?: number;
28
28
  successValue?: number;
@@ -42,17 +42,16 @@ export interface ProgressBarRoundedOverrides {
42
42
 
43
43
  export interface ProgressBarRoundedProps {
44
44
  progress?: number;
45
- size?: SIZE[keyof SIZE];
45
+ size?: typeof SIZE[keyof typeof SIZE];
46
46
  animate?: boolean;
47
47
  inline?: boolean;
48
48
  overrides?: ProgressBarRoundedOverrides;
49
49
  }
50
- export const ProgressBarRounded: React.FC<ProgressBarRoundedProps>;
50
+ export declare const ProgressBarRounded: React.FC<ProgressBarRoundedProps>;
51
51
 
52
- export const SIZE: SIZE;
53
- export const StyledRoot: StyletronComponent<any>;
54
- export const StyledBarContainer: StyletronComponent<any>;
55
- export const StyledBar: StyletronComponent<any>;
56
- export const StyledBarProgress: StyletronComponent<any>;
57
- export const StyledInfiniteBar: StyletronComponent<any>;
58
- export const StyledLabel: StyletronComponent<any>;
52
+ export declare const StyledRoot: StyletronComponent<any>;
53
+ export declare const StyledBarContainer: StyletronComponent<any>;
54
+ export declare const StyledBar: StyletronComponent<any>;
55
+ export declare const StyledBarProgress: StyletronComponent<any>;
56
+ export declare const StyledInfiniteBar: StyletronComponent<any>;
57
+ export declare const StyledLabel: StyletronComponent<any>;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {Override} from '../overrides';
2
+ import { StyletronComponent } from 'styletron-react';
3
+ import { Override } from '../overrides';
4
4
 
5
5
  export interface ProgressStepsOverrides {
6
6
  Root?: Override<any>;
@@ -10,7 +10,7 @@ export interface ProgressStepsProps {
10
10
  children?: React.ReactNode;
11
11
  current?: number;
12
12
  }
13
- export const ProgressSteps: React.FC<ProgressStepsProps>;
13
+ export declare const ProgressSteps: React.FC<ProgressStepsProps>;
14
14
 
15
15
  export interface StepOverrides {
16
16
  Root?: Override<any>;
@@ -30,7 +30,7 @@ export interface StepProps {
30
30
  overrides?: StepOverrides;
31
31
  children?: React.ReactNode;
32
32
  }
33
- export const Step: React.FC<StepProps>;
33
+ export declare const Step: React.FC<StepProps>;
34
34
 
35
35
  export interface NumberedStepOverrides {
36
36
  Root?: Override<any>;
@@ -51,21 +51,21 @@ export interface NumberedStepProps {
51
51
  children?: React.ReactNode;
52
52
  step?: React.ReactNode;
53
53
  }
54
- export const NumberedStep: React.FC<NumberedStepProps>;
54
+ export declare const NumberedStep: React.FC<NumberedStepProps>;
55
55
 
56
56
  export interface StyleProps {
57
57
  $isActive?: boolean;
58
58
  $isCompleted?: boolean;
59
59
  $disabled?: boolean;
60
60
  }
61
- export const StyledProgressSteps: StyletronComponent<StyleProps>;
62
- export const StyledStep: StyletronComponent<StyleProps>;
63
- export const StyledIcon: StyletronComponent<StyleProps>;
64
- export const StyledInnerIcon: StyletronComponent<StyleProps>;
65
- export const StyledContent: StyletronComponent<StyleProps>;
66
- export const StyledContentTitle: StyletronComponent<StyleProps>;
67
- export const StyledContentTail: StyletronComponent<StyleProps>;
68
- export const StyledContentDescription: StyletronComponent<StyleProps>;
69
- export const StyledNumberStep: StyletronComponent<StyleProps>;
70
- export const StyledNumberIcon: StyletronComponent<StyleProps>;
71
- export const StyledNumberContentTail: StyletronComponent<StyleProps>;
61
+ export declare const StyledProgressSteps: StyletronComponent<StyleProps>;
62
+ export declare const StyledStep: StyletronComponent<StyleProps>;
63
+ export declare const StyledIcon: StyletronComponent<StyleProps>;
64
+ export declare const StyledInnerIcon: StyletronComponent<StyleProps>;
65
+ export declare const StyledContent: StyletronComponent<StyleProps>;
66
+ export declare const StyledContentTitle: StyletronComponent<StyleProps>;
67
+ export declare const StyledContentTail: StyletronComponent<StyleProps>;
68
+ export declare const StyledContentDescription: StyletronComponent<StyleProps>;
69
+ export declare const StyledNumberStep: StyletronComponent<StyleProps>;
70
+ export declare const StyledNumberIcon: StyletronComponent<StyleProps>;
71
+ export declare const StyledNumberContentTail: StyletronComponent<StyleProps>;
@@ -17,7 +17,7 @@ import {
17
17
  StyledNumberContentTail,
18
18
  StyledContentDescription,
19
19
  } from './styled-components.js';
20
- import StyledCheckIcon from '../icon/check.js';
20
+ import Check from '../icon/check.js';
21
21
 
22
22
  import type { NumberedStepPropsT } from './types.js';
23
23
 
@@ -39,7 +39,7 @@ function NumberedStep({
39
39
  overrides.Description,
40
40
  StyledContentDescription
41
41
  );
42
- const [CheckIcon, checkIconProps] = getOverrides(overrides.Icon, StyledCheckIcon);
42
+ const [CheckIcon, checkIconProps] = getOverrides(overrides.Icon, Check);
43
43
 
44
44
  const sharedProps = {
45
45
  $isCompleted: isCompleted,
package/radio/index.d.ts CHANGED
@@ -2,14 +2,14 @@ import * as React from 'react';
2
2
  import { StyletronComponent } from 'styletron-react';
3
3
  import { Override } from '../overrides';
4
4
 
5
- export interface STATE_TYPE {
5
+ export declare const STATE_TYPE: {
6
6
  change: 'CHANGE';
7
- }
7
+ };
8
8
 
9
- export interface ALIGN {
9
+ export declare const ALIGN: {
10
10
  vertical: 'vertical';
11
11
  horizontal: 'horizontal';
12
- }
12
+ };
13
13
 
14
14
  export type StateReducer = (
15
15
  stateType: string,
@@ -46,7 +46,7 @@ export interface StatefulRadioGroupProps {
46
46
  align?: 'horizontal' | 'vertical';
47
47
  }
48
48
 
49
- export const StatefulRadioGroup: React.FC<StatefulRadioGroupProps>;
49
+ export declare const StatefulRadioGroup: React.FC<StatefulRadioGroupProps>;
50
50
 
51
51
  export interface RadioGroupProps {
52
52
  'aria-describedby'?: string;
@@ -125,13 +125,10 @@ export class Radio extends React.Component<RadioProps, RadioState> {
125
125
  onBlur(event: React.FocusEvent<HTMLInputElement>): void;
126
126
  }
127
127
 
128
- export const StyledRoot: StyletronComponent<any>;
129
- export const StyledLabel: StyletronComponent<any>;
130
- export const StyledInput: StyletronComponent<any>;
131
- export const StyledDescription: StyletronComponent<any>;
132
- export const StyledRadioMarkInner: StyletronComponent<any>;
133
- export const StyledRadioMarkOuter: StyletronComponent<any>;
134
- export const StyledRadioGroupRoot: StyletronComponent<any>;
135
-
136
- export const STATE_TYPE: STATE_TYPE;
137
- export const ALIGN: ALIGN;
128
+ export declare const StyledRoot: StyletronComponent<any>;
129
+ export declare const StyledLabel: StyletronComponent<any>;
130
+ export declare const StyledInput: StyletronComponent<any>;
131
+ export declare const StyledDescription: StyletronComponent<any>;
132
+ export declare const StyledRadioMarkInner: StyletronComponent<any>;
133
+ export declare const StyledRadioMarkOuter: StyletronComponent<any>;
134
+ export declare const StyledRadioGroupRoot: StyletronComponent<any>;
package/rating/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {Override} from '../overrides';
4
- import {Theme} from '../theme';
2
+ import { StyletronComponent } from 'styletron-react';
3
+ import { Override } from '../overrides';
4
+ import { Theme } from '../theme';
5
5
 
6
6
  export interface RatingState {
7
7
  previewIndex?: number;
@@ -16,7 +16,7 @@ export interface StarRatingProps {
16
16
  value?: number;
17
17
  numItems?: number;
18
18
  readOnly?: boolean;
19
- onChange?: (args: {value: number}) => any;
19
+ onChange?: (args: { value: number }) => any;
20
20
  size?: number;
21
21
  }
22
22
 
@@ -24,7 +24,7 @@ export interface EmoticonRatingProps {
24
24
  overrides?: RatingOverrides;
25
25
  value?: number;
26
26
  readOnly?: boolean;
27
- onChange?: (args: {value: number}) => any;
27
+ onChange?: (args: { value: number }) => any;
28
28
  size?: number;
29
29
  }
30
30
  export class StarRating extends React.Component<StarRatingProps, RatingState> {
@@ -33,10 +33,7 @@ export class StarRating extends React.Component<StarRatingProps, RatingState> {
33
33
  renderRatingContents(): React.ReactNode[];
34
34
  }
35
35
 
36
- export class EmoticonRating extends React.Component<
37
- EmoticonRatingProps,
38
- RatingState
39
- > {
36
+ export class EmoticonRating extends React.Component<EmoticonRatingProps, RatingState> {
40
37
  selectItem(value: number): void;
41
38
  updatePreview(previewIndex?: number): void;
42
39
  renderRatingContents(): React.ReactNode[];
@@ -51,6 +48,6 @@ export interface StyledRatingItemProps {
51
48
  $isSelected: boolean;
52
49
  $index: number;
53
50
  }
54
- export const StyledRoot: StyletronComponent<StyledRootProps>;
55
- export const StyledStar: StyletronComponent<StyledRatingItemProps>;
56
- export const StyledEmoticon: StyletronComponent<StyledRatingItemProps>;
51
+ export declare const StyledRoot: StyletronComponent<StyledRootProps>;
52
+ export declare const StyledStar: StyletronComponent<StyledRatingItemProps>;
53
+ export declare const StyledEmoticon: StyletronComponent<StyledRatingItemProps>;