baseui 11.0.2 → 11.1.1

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 (241) 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/index.d.ts +42 -63
  54. package/datepicker/types.js.flow +2 -2
  55. package/datepicker/utils/date-helpers.js +1 -1
  56. package/datepicker/utils/date-helpers.js.flow +1 -1
  57. package/dnd-list/index.d.ts +22 -35
  58. package/drawer/index.d.ts +22 -27
  59. package/es/app-nav-bar/app-nav-bar.js +9 -19
  60. package/es/app-nav-bar/styled-components.js +32 -13
  61. package/es/badge/badge.js +70 -0
  62. package/es/badge/constants.js +42 -0
  63. package/es/badge/hint-dot.js +55 -0
  64. package/es/badge/index.js +11 -0
  65. package/es/badge/notification-circle.js +65 -0
  66. package/es/badge/styled-components.js +296 -0
  67. package/es/badge/types.js +8 -0
  68. package/es/badge/utils.js +17 -0
  69. package/es/banner/banner.js +213 -0
  70. package/es/banner/constants.js +24 -0
  71. package/es/banner/index.js +9 -0
  72. package/es/banner/styled-components.js +122 -0
  73. package/es/banner/types.js +8 -0
  74. package/es/breadcrumbs/breadcrumbs.js +5 -1
  75. package/es/button/button.js +1 -0
  76. package/es/datepicker/utils/date-helpers.js +1 -1
  77. package/es/helper/helper-steps.js +3 -1
  78. package/es/input/base-input.js +18 -11
  79. package/es/input/input.js +15 -10
  80. package/es/input/masked-input.js +5 -2
  81. package/es/input/utils.js +4 -2
  82. package/es/locale/tr_TR.js +115 -0
  83. package/es/notification/notification.js +16 -1
  84. package/es/payment-card/custom-cards.config.js +22 -0
  85. package/es/payment-card/icons/uatp.js +52 -0
  86. package/es/payment-card/payment-card.js +8 -3
  87. package/es/popover/popover.js +2 -1
  88. package/es/popover/stateful-container.js +2 -0
  89. package/es/popover/styled-components.js +2 -1
  90. package/es/progress-steps/numbered-step.js +2 -2
  91. package/es/select/select-component.js +44 -21
  92. package/es/select/utils/default-filter-options.js +1 -1
  93. package/es/table-semantic/styled-components.js +14 -0
  94. package/es/table-semantic/table-builder.js +12 -5
  95. package/es/textarea/textarea.js +15 -9
  96. package/es/themes/dark-theme/color-component-tokens.js +8 -0
  97. package/es/themes/light-theme/color-component-tokens.js +8 -0
  98. package/es/tree-view/tree-label.js +9 -1
  99. package/esm/app-nav-bar/app-nav-bar.js +32 -38
  100. package/esm/app-nav-bar/styled-components.js +46 -28
  101. package/esm/badge/badge.js +97 -0
  102. package/esm/badge/constants.js +42 -0
  103. package/esm/badge/hint-dot.js +83 -0
  104. package/esm/badge/index.js +11 -0
  105. package/esm/badge/notification-circle.js +91 -0
  106. package/esm/badge/styled-components.js +235 -0
  107. package/esm/badge/types.js +8 -0
  108. package/esm/badge/utils.js +17 -0
  109. package/esm/banner/banner.js +271 -0
  110. package/esm/banner/constants.js +24 -0
  111. package/esm/banner/index.js +9 -0
  112. package/esm/banner/styled-components.js +113 -0
  113. package/esm/banner/types.js +8 -0
  114. package/esm/breadcrumbs/breadcrumbs.js +5 -1
  115. package/esm/button/button.js +2 -1
  116. package/esm/datepicker/utils/date-helpers.js +1 -1
  117. package/esm/helper/helper-steps.js +3 -1
  118. package/esm/input/base-input.js +18 -11
  119. package/esm/input/input.js +15 -10
  120. package/esm/input/masked-input.js +6 -3
  121. package/esm/input/utils.js +4 -2
  122. package/esm/locale/tr_TR.js +115 -0
  123. package/esm/notification/notification.js +17 -1
  124. package/esm/payment-card/custom-cards.config.js +22 -0
  125. package/esm/payment-card/icons/uatp.js +53 -0
  126. package/esm/payment-card/payment-card.js +9 -7
  127. package/esm/popover/popover.js +2 -1
  128. package/esm/popover/stateful-container.js +2 -0
  129. package/esm/popover/styled-components.js +3 -2
  130. package/esm/progress-steps/numbered-step.js +2 -2
  131. package/esm/select/select-component.js +81 -57
  132. package/esm/select/utils/default-filter-options.js +1 -1
  133. package/esm/table-semantic/styled-components.js +31 -18
  134. package/esm/table-semantic/table-builder.js +34 -23
  135. package/esm/textarea/textarea.js +15 -9
  136. package/esm/themes/dark-theme/color-component-tokens.js +8 -0
  137. package/esm/themes/light-theme/color-component-tokens.js +8 -0
  138. package/esm/tree-view/tree-label.js +10 -2
  139. package/file-uploader/index.d.ts +11 -11
  140. package/flex-grid/index.d.ts +3 -3
  141. package/form-control/index.d.ts +7 -19
  142. package/header-navigation/index.d.ts +8 -9
  143. package/heading/index.d.ts +3 -4
  144. package/helper/helper-steps.js +19 -13
  145. package/helper/helper-steps.js.flow +3 -1
  146. package/helper/index.d.ts +7 -7
  147. package/helpers/base-provider.d.ts +16 -0
  148. package/helpers/overrides.d.ts +23 -0
  149. package/icon/index.d.ts +32 -32
  150. package/index.d.ts +34 -114
  151. package/input/base-input.js +18 -11
  152. package/input/base-input.js.flow +18 -6
  153. package/input/index.d.ts +29 -32
  154. package/input/input.js +15 -10
  155. package/input/input.js.flow +10 -5
  156. package/input/masked-input.js +6 -3
  157. package/input/masked-input.js.flow +3 -0
  158. package/input/types.js.flow +4 -0
  159. package/input/utils.js +4 -2
  160. package/input/utils.js.flow +2 -1
  161. package/layer/index.d.ts +6 -11
  162. package/layout-grid/index.d.ts +25 -7
  163. package/link/index.d.ts +2 -2
  164. package/list/index.d.ts +26 -31
  165. package/{locale.ts → locale/index.d.ts} +8 -0
  166. package/locale/tr_TR.js +123 -0
  167. package/locale/tr_TR.js.flow +124 -0
  168. package/map-marker/index.d.ts +41 -47
  169. package/menu/index.d.ts +27 -37
  170. package/modal/index.d.ts +28 -38
  171. package/notification/index.d.ts +2 -3
  172. package/notification/notification.js +18 -1
  173. package/notification/notification.js.flow +15 -1
  174. package/overrides.ts +2 -22
  175. package/package.json +26 -17
  176. package/pagination/index.d.ts +22 -26
  177. package/payment-card/custom-cards.config.js +30 -0
  178. package/payment-card/custom-cards.config.js.flow +29 -0
  179. package/payment-card/icons/uatp.js +67 -0
  180. package/payment-card/icons/uatp.js.flow +62 -0
  181. package/payment-card/index.d.ts +8 -8
  182. package/payment-card/payment-card.js +12 -7
  183. package/payment-card/payment-card.js.flow +12 -0
  184. package/phone-input/index.d.ts +261 -269
  185. package/pin-code/index.d.ts +11 -18
  186. package/popover/index.d.ts +39 -55
  187. package/popover/popover.js +2 -1
  188. package/popover/popover.js.flow +2 -1
  189. package/popover/stateful-container.js +2 -0
  190. package/popover/stateful-container.js.flow +2 -0
  191. package/popover/styled-components.js +3 -2
  192. package/popover/styled-components.js.flow +2 -1
  193. package/popover/types.js.flow +1 -0
  194. package/progress-bar/index.d.ts +11 -12
  195. package/progress-steps/index.d.ts +16 -16
  196. package/progress-steps/numbered-step.js.flow +2 -2
  197. package/radio/index.d.ts +12 -15
  198. package/rating/index.d.ts +9 -12
  199. package/select/index.d.ts +34 -36
  200. package/select/select-component.js +78 -54
  201. package/select/select-component.js.flow +42 -32
  202. package/select/types.js.flow +1 -0
  203. package/select/utils/default-filter-options.js +1 -1
  204. package/select/utils/default-filter-options.js.flow +1 -1
  205. package/side-navigation/index.d.ts +11 -13
  206. package/skeleton/index.d.ts +1 -1
  207. package/slider/index.d.ts +17 -26
  208. package/snackbar/index.d.ts +8 -8
  209. package/spinner/index.d.ts +4 -3
  210. package/styles/index.d.ts +82 -2
  211. package/table/index.d.ts +16 -16
  212. package/table-grid/index.d.ts +6 -8
  213. package/table-semantic/index.d.ts +26 -32
  214. package/table-semantic/styled-components.js +33 -19
  215. package/table-semantic/styled-components.js.flow +12 -0
  216. package/table-semantic/table-builder.js +38 -22
  217. package/table-semantic/table-builder.js.flow +32 -17
  218. package/table-semantic/types.js.flow +1 -0
  219. package/tabs/index.d.ts +20 -23
  220. package/tabs-motion/index.d.ts +23 -23
  221. package/tag/index.d.ts +14 -18
  222. package/textarea/index.d.ts +11 -14
  223. package/textarea/textarea.js +15 -9
  224. package/textarea/textarea.js.flow +11 -5
  225. package/textarea/types.js.flow +1 -0
  226. package/theme.ts +36 -777
  227. package/themes/dark-theme/color-component-tokens.js +8 -0
  228. package/themes/dark-theme/color-component-tokens.js.flow +9 -0
  229. package/themes/index.d.ts +765 -0
  230. package/themes/light-theme/color-component-tokens.js +8 -0
  231. package/themes/light-theme/color-component-tokens.js.flow +9 -0
  232. package/themes/types.js.flow +9 -0
  233. package/timepicker/index.d.ts +5 -8
  234. package/timezonepicker/index.d.ts +5 -8
  235. package/toast/index.d.ts +26 -40
  236. package/tokens/index.d.ts +1 -1
  237. package/tooltip/index.d.ts +7 -9
  238. package/tree-view/index.d.ts +15 -19
  239. package/tree-view/tree-label.js +10 -2
  240. package/tree-view/tree-label.js.flow +4 -4
  241. package/typography/index.d.ts +37 -37
package/card/index.d.ts CHANGED
@@ -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 CardOverrides {
6
6
  Action?: Override<any>;
@@ -14,20 +14,22 @@ export interface CardOverrides {
14
14
  export interface CardProps {
15
15
  readonly action?: React.ReactNode;
16
16
  readonly children?: React.ReactNode;
17
- readonly hasThumbnail?: (props: {readonly thumbnail?: string}) => boolean;
18
- readonly headerImage?: string | React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
17
+ readonly hasThumbnail?: (props: { readonly thumbnail?: string }) => boolean;
18
+ readonly headerImage?:
19
+ | string
20
+ | React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
19
21
  readonly overrides?: CardOverrides;
20
22
  readonly thumbnail?: string;
21
23
  readonly title?: React.ReactNode;
22
24
  }
23
- export const Card: React.FC<CardProps>;
24
- export type hasThumbnail = (props: {readonly thumbnail?: string}) => boolean;
25
+ export declare const Card: React.FC<CardProps>;
26
+ export type hasThumbnail = (props: { readonly thumbnail?: string }) => boolean;
25
27
 
26
- export const StyledAction: StyletronComponent<any>;
27
- export const StyledBody: StyletronComponent<any>;
28
- export const StyledContents: StyletronComponent<any>;
29
- export const StyledHeaderImage: StyletronComponent<any>;
30
- export const StyledThumbnail: StyletronComponent<any>;
31
- export const StyledTitle: StyletronComponent<any>;
32
- export const StyledRoot: StyletronComponent<any>;
33
- export const StyledWrapper: StyletronComponent<any>;
28
+ export declare const StyledAction: StyletronComponent<any>;
29
+ export declare const StyledBody: StyletronComponent<any>;
30
+ export declare const StyledContents: StyletronComponent<any>;
31
+ export declare const StyledHeaderImage: StyletronComponent<any>;
32
+ export declare const StyledThumbnail: StyletronComponent<any>;
33
+ export declare const StyledTitle: StyletronComponent<any>;
34
+ export declare const StyledRoot: StyletronComponent<any>;
35
+ export declare const StyledWrapper: StyletronComponent<any>;
@@ -2,34 +2,34 @@ 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
- }
8
- export interface STYLE_TYPE {
7
+ };
8
+ export declare const STYLE_TYPE: {
9
9
  default: 'default';
10
10
  toggle: 'toggle';
11
11
  toggle_round: 'toggle';
12
- }
12
+ };
13
13
 
14
- export interface LABEL_PLACEMENT {
14
+ export declare const LABEL_PLACEMENT: {
15
15
  top: 'top';
16
16
  right: 'right';
17
17
  bottom: 'bottom';
18
18
  left: 'left';
19
- }
19
+ };
20
20
 
21
21
  type initialState = {
22
22
  checked?: boolean;
23
23
  isIndeterminate?: boolean;
24
24
  };
25
25
 
26
- export const StyledRoot: StyletronComponent<any>;
27
- export const StyledCheckmark: StyletronComponent<any>;
28
- export const StyledLabel: StyletronComponent<any>;
29
- export const StyledInput: StyletronComponent<any>;
30
- export const StyledToggle: StyletronComponent<any>;
31
- export const StyledToggleInner: StyletronComponent<any>;
32
- export const StyledToggleTrack: StyletronComponent<any>;
26
+ export declare const StyledRoot: StyletronComponent<any>;
27
+ export declare const StyledCheckmark: StyletronComponent<any>;
28
+ export declare const StyledLabel: StyletronComponent<any>;
29
+ export declare const StyledInput: StyletronComponent<any>;
30
+ export declare const StyledToggle: StyletronComponent<any>;
31
+ export declare const StyledToggleInner: StyletronComponent<any>;
32
+ export declare const StyledToggleTrack: StyletronComponent<any>;
33
33
 
34
34
  export type StateReducer = (
35
35
  stateType: string,
@@ -51,7 +51,7 @@ export interface StatefulContainerProps {
51
51
  autoFocus?: boolean;
52
52
  }
53
53
 
54
- export const StatefulContainer: React.FC<StatefulContainerProps>;
54
+ export declare const StatefulContainer: React.FC<StatefulContainerProps>;
55
55
 
56
56
  export interface StatefulCheckboxProps {
57
57
  overrides?: CheckboxOverrides;
@@ -64,7 +64,7 @@ export interface StatefulCheckboxProps {
64
64
  children?: React.ReactNode;
65
65
  initialState?: initialState;
66
66
  autoFocus?: boolean;
67
- checkmarkType?: STYLE_TYPE[keyof STYLE_TYPE];
67
+ checkmarkType?: typeof STYLE_TYPE[keyof typeof STYLE_TYPE];
68
68
  onChange?: React.FormEventHandler<HTMLInputElement>;
69
69
  onMouseEnter?: React.MouseEventHandler<HTMLInputElement>;
70
70
  onMouseLeave?: React.MouseEventHandler<HTMLInputElement>;
@@ -72,7 +72,7 @@ export interface StatefulCheckboxProps {
72
72
  onBlur?: React.FocusEventHandler<HTMLInputElement>;
73
73
  }
74
74
 
75
- export const StatefulCheckbox: React.FC<StatefulCheckboxProps>;
75
+ export declare const StatefulCheckbox: React.FC<StatefulCheckboxProps>;
76
76
 
77
77
  export interface CheckboxOverrides {
78
78
  Checkmark?: Override<any>;
@@ -101,7 +101,7 @@ export interface CheckboxProps {
101
101
  value?: string;
102
102
  isIndeterminate?: boolean;
103
103
  labelPlacement?: 'top' | 'right' | 'bottom' | 'left';
104
- checkmarkType?: STYLE_TYPE[keyof STYLE_TYPE];
104
+ checkmarkType?: typeof STYLE_TYPE[keyof typeof STYLE_TYPE];
105
105
  title?: string;
106
106
  ariaLabel?: string;
107
107
  'aria-label'?: string;
@@ -128,7 +128,3 @@ export class Checkbox extends React.Component<CheckboxProps, CheckboxState> {
128
128
  onFocus(event: React.FocusEvent<HTMLInputElement>): void;
129
129
  onBlur(event: React.FocusEvent<HTMLInputElement>): void;
130
130
  }
131
-
132
- export const STATE_TYPE: STATE_TYPE;
133
- export const STYLE_TYPE: STYLE_TYPE;
134
- export const LABEL_PLACEMENT: LABEL_PLACEMENT;
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
- import {Override} from '../overrides';
2
+ import { Override } from '../overrides';
3
3
 
4
- export interface SIZE {
4
+ export declare const SIZE: {
5
5
  compact: 'compact';
6
6
  default: 'default';
7
7
  large: 'large';
8
8
  mini: 'mini';
9
- }
9
+ };
10
10
 
11
11
  export interface ComboboxOverrides {
12
12
  Root?: Override<any>;
@@ -20,10 +20,7 @@ export interface ComboboxOverrides {
20
20
  export type PropsT<OptionT = any> = {
21
21
  autocomplete?: boolean;
22
22
  disabled?: boolean;
23
- mapOptionToNode?: (option: {
24
- isSelected: boolean;
25
- option: OptionT;
26
- }) => React.ReactNode;
23
+ mapOptionToNode?: (option: { isSelected: boolean; option: OptionT }) => React.ReactNode;
27
24
  mapOptionToString: (option: OptionT) => string;
28
25
  id?: string;
29
26
  name?: string;
@@ -31,12 +28,11 @@ export type PropsT<OptionT = any> = {
31
28
  onBlur?: (event: React.FocusEvent<HTMLInputElement>) => any;
32
29
  onChange?: (value: string, option: OptionT | null) => any;
33
30
  onFocus?: (event: React.FocusEvent<HTMLInputElement>) => any;
34
- onSubmit?: (params: {closeListbox: () => void; value: string}) => any;
31
+ onSubmit?: (params: { closeListbox: () => void; value: string }) => any;
35
32
  options: OptionT[];
36
33
  overrides?: ComboboxOverrides;
37
- size?: SIZE[keyof SIZE];
34
+ size?: typeof SIZE[keyof typeof SIZE];
38
35
  value: string;
39
36
  };
40
37
 
41
- export const Combobox: React.FC<PropsT>;
42
- export const SIZE: SIZE;
38
+ export declare const Combobox: React.FC<PropsT>;
@@ -10,7 +10,7 @@ export function CustomColumn<ValueT, FilterParamsT>(options: any): any;
10
10
  export function NumericalColumn(options: any): any;
11
11
  export function StringColumn(options: any): any;
12
12
 
13
- export interface COLUMNS {
13
+ export declare const COLUMNS: {
14
14
  ANCHOR: 'ANCHOR';
15
15
  CATEGORICAL: 'CATEGORICAL';
16
16
  DATETIME: 'DATETIME';
@@ -18,23 +18,20 @@ export interface COLUMNS {
18
18
  BOOLEAN: 'BOOLEAN';
19
19
  STRING: 'STRING';
20
20
  CUSTOM: 'CUSTOM';
21
- }
22
- export const COLUMNS: COLUMNS;
21
+ };
23
22
 
24
- export interface NUMERICAL_FORMATS {
23
+ export declare const NUMERICAL_FORMATS: {
25
24
  DEFAULT: 'DEFAULT';
26
25
  ACCOUNTING: 'ACCOUNTING';
27
26
  PERCENTAGE: 'PERCENTAGE';
28
- }
29
- export const NUMERICAL_FORMATS: NUMERICAL_FORMATS;
27
+ };
30
28
 
31
- export interface SORT_DIRECTIONS {
29
+ export declare const SORT_DIRECTIONS: {
32
30
  ASC: 'ASC';
33
31
  DESC: 'DESC';
34
- }
35
- export const SORT_DIRECTIONS: SORT_DIRECTIONS;
32
+ };
36
33
 
37
- export type SortDirectionsT = SORT_DIRECTIONS['ASC'] | SORT_DIRECTIONS['DESC'] | null;
34
+ export type SortDirectionsT = typeof SORT_DIRECTIONS[keyof typeof SORT_DIRECTIONS] | null;
38
35
  export type ColumnT = any;
39
36
  export type RowT = {
40
37
  id: number | string;
@@ -1,12 +1,9 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {Option} from '../select';
4
- import {SIZE} from '../input';
5
- import {Override} from '../overrides';
6
- import {Locale} from '../locale';
7
- import {any} from 'prop-types';
2
+ import { Option } from '../select';
3
+ import { SIZE } from '../input';
4
+ import { Override } from '../overrides';
8
5
 
9
- export interface STATE_CHANGE_TYPE {
6
+ export declare const STATE_CHANGE_TYPE: {
10
7
  change: 'change';
11
8
  moveUp: 'moveUp';
12
9
  moveDown: 'moveDown';
@@ -14,18 +11,18 @@ export interface STATE_CHANGE_TYPE {
14
11
  moveRight: 'moveRight';
15
12
  mouseOver: 'mouseOver';
16
13
  mouseLeave: 'mouseLeave';
17
- }
14
+ };
18
15
 
19
- export interface ORIENTATION {
16
+ export declare const ORIENTATION: {
20
17
  horizontal: 'horizontal';
21
18
  vertical: 'vertical';
22
- }
19
+ };
23
20
 
24
- export type onChange = (args: {date: Date | Date[]}) => any;
21
+ export type onChange = (args: { date: Date | Date[] }) => any;
25
22
  export type StateReducer = (
26
- stateType: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
23
+ stateType: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
27
24
  nextState: ContainerState,
28
- currentState: ContainerState,
25
+ currentState: ContainerState
29
26
  ) => ContainerState;
30
27
 
31
28
  export interface ContainerState {
@@ -42,10 +39,10 @@ export class StatefulContainer extends React.Component<
42
39
  StatefulContainerProps<CalendarProps | DatepickerProps>,
43
40
  ContainerState
44
41
  > {
45
- onChange(data: {date: Date | Date[]}): void;
42
+ onChange(data: { date: Date | Date[] }): void;
46
43
  internalSetState(
47
- type: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
48
- changes: ContainerState,
44
+ type: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
45
+ changes: ContainerState
49
46
  ): void;
50
47
  }
51
48
 
@@ -70,14 +67,14 @@ export interface CalendarProps {
70
67
  maxDate?: Date;
71
68
  minDate?: Date;
72
69
  monthsShown?: number;
73
- onDayClick?: (args: {date: Date; event: Event}) => any;
74
- onDayMouseOver?: (args: {date: Date; event: Event}) => any;
75
- onDayMouseLeave?: (args: {date: Date; event: Event}) => any;
76
- onMonthChange?: (args: {date: Date}) => any;
77
- onYearChange?: (args: {date: Date}) => any;
70
+ onDayClick?: (args: { date: Date; event: Event }) => any;
71
+ onDayMouseOver?: (args: { date: Date; event: Event }) => any;
72
+ onDayMouseLeave?: (args: { date: Date; event: Event }) => any;
73
+ onMonthChange?: (args: { date: Date }) => any;
74
+ onYearChange?: (args: { date: Date }) => any;
78
75
  onChange?: onChange;
79
76
  onQuickSelectChange?: (option?: QuickSelectOption) => any;
80
- orientation?: ORIENTATION[keyof ORIENTATION];
77
+ orientation?: typeof ORIENTATION[keyof typeof ORIENTATION];
81
78
  overrides?: DatepickerOverrides<SharedStylePropsT>;
82
79
  peekNextMonth?: boolean;
83
80
  timeSelectStart?: boolean;
@@ -97,28 +94,25 @@ export class Calendar extends React.Component<CalendarProps, CalendarState> {
97
94
  getDateInView(): Date;
98
95
  handleMonthChange(date: Date): void;
99
96
  handleYearChange(date: Date): void;
100
- changeMonth({date}: {date: Date}): void;
101
- changeYear({date}: {date: Date}): void;
97
+ changeMonth({ date }: { date: Date }): void;
98
+ changeYear({ date }: { date: Date }): void;
102
99
  renderCalendarHeader(date: Date, order: number): React.ReactNode;
103
100
  onKeyDown(event: KeyboardEvent): void;
104
101
  handleArrowKey(key: string): void;
105
102
  focusCalendar(): void;
106
103
  blurCalendar(): void;
107
104
  handleTabbing(event: KeyboardEvent): void;
108
- onDayMouseOver(data: {event: Event; date: Date}): void;
109
- onDayMouseLeave(data: {event: Event; date: Date}): void;
110
- handleDateChange(data: {date: Date | Date[]}): void;
105
+ onDayMouseOver(data: { event: Event; date: Date }): void;
106
+ onDayMouseLeave(data: { event: Event; date: Date }): void;
107
+ handleDateChange(data: { date: Date | Date[] }): void;
111
108
  handleTimeChange(time: Date, index: number): void;
112
109
  setHighlightedDate(date: Date): void;
113
110
  renderMonths(): React.ReactNode[];
114
- renderTimeSelect(
115
- value: Date,
116
- onChange: (...args: any) => any,
117
- ): React.ReactNode;
111
+ renderTimeSelect(value: Date, onChange: (...args: any) => any): React.ReactNode;
118
112
  renderQuickSelect(): React.ReactNode;
119
113
  }
120
114
 
121
- export const StatefulCalendar: React.FC<StatefulDatepickerProps<CalendarProps>>;
115
+ export declare const StatefulCalendar: React.FC<StatefulDatepickerProps<CalendarProps>>;
122
116
 
123
117
  export interface DatepickerOverrides<T> {
124
118
  Root?: Override<T>;
@@ -158,7 +152,7 @@ export type DatepickerProps = CalendarProps & {
158
152
  'aria-describedby'?: string;
159
153
  disabled?: boolean;
160
154
  clearable?: boolean;
161
- size?: SIZE[keyof SIZE];
155
+ size?: typeof SIZE[keyof typeof SIZE];
162
156
  error?: boolean;
163
157
  positive?: boolean;
164
158
  placeholder?: string;
@@ -181,18 +175,12 @@ export interface DatepickerState {
181
175
  lastActiveElm?: HTMLElement;
182
176
  }
183
177
 
184
- declare function formatDate(
185
- date: Date | Date[],
186
- formatString: string,
187
- ): string | string[];
178
+ declare function formatDate(date: Date | Date[], formatString: string): string | string[];
188
179
 
189
- export {formatDate};
180
+ export { formatDate };
190
181
 
191
- export class Datepicker extends React.Component<
192
- DatepickerProps,
193
- DatepickerState
194
- > {
195
- onChange(data: {date: Date | Date[]}): void;
182
+ export class Datepicker extends React.Component<DatepickerProps, DatepickerState> {
183
+ onChange(data: { date: Date | Date[] }): void;
196
184
  formatDate(date: Date | Date[], formatString: string): string | string[];
197
185
  formatDisplayValue(date: Date | Date[]): string;
198
186
  open(): void;
@@ -202,15 +190,13 @@ export class Datepicker extends React.Component<
202
190
  handleKeyDown(event: KeyboardEvent): void;
203
191
  focusCalendar(): void;
204
192
  }
205
- export {Datepicker as DatePicker};
193
+ export { Datepicker as DatePicker };
206
194
 
207
195
  export type StatefulDatepickerProps<T> = T &
208
- StatefulContainerProps<T> & {children?: (args: T) => React.ReactNode};
209
- export const StatefulDatepicker: React.FC<
210
- StatefulDatepickerProps<DatepickerProps>
211
- >;
196
+ StatefulContainerProps<T> & { children?: (args: T) => React.ReactNode };
197
+ export declare const StatefulDatepicker: React.FC<StatefulDatepickerProps<DatepickerProps>>;
212
198
 
213
- export {StatefulDatepicker as StatefulDatePicker};
199
+ export { StatefulDatepicker as StatefulDatePicker };
214
200
 
215
201
  export interface TimezonePickerProps {
216
202
  date?: Date;
@@ -218,30 +204,23 @@ export interface TimezonePickerProps {
218
204
  positive?: boolean;
219
205
  error?: boolean;
220
206
  mapLabels?: (args: Option) => React.ReactNode;
221
- onChange?: (value: {id: string; label: string; offset: number}) => any;
222
- overrides?: {Select?: Override<any>};
207
+ onChange?: (value: { id: string; label: string; offset: number }) => any;
208
+ overrides?: { Select?: Override<any> };
223
209
  value?: string;
224
210
  }
225
211
  export interface TimezonePickerState {
226
212
  timezones: Option[];
227
213
  value?: string;
228
214
  }
229
- export class TimezonePicker extends React.Component<
230
- TimezonePickerProps,
231
- TimezonePickerState
232
- > {
215
+ export class TimezonePicker extends React.Component<TimezonePickerProps, TimezonePickerState> {
233
216
  buildTimezones(compareDate: Date): string[];
234
217
  }
235
218
 
236
- export const DISPLAY_FORMAT: 'L';
237
- export const ISO_FORMAT: 'YYYY-MM-DD';
238
- export const ISO_MONTH_FORMAT: 'YYYY-MM';
239
-
240
- export const STATE_CHANGE_TYPE: STATE_CHANGE_TYPE;
241
-
242
- export const ORIENTATION: ORIENTATION;
219
+ export declare const DISPLAY_FORMAT: 'L';
220
+ export declare const ISO_FORMAT: 'YYYY-MM-DD';
221
+ export declare const ISO_MONTH_FORMAT: 'YYYY-MM';
243
222
 
244
- export const WEEKDAYS: [0, 1, 2, 3, 4, 5, 6];
223
+ export declare const WEEKDAYS: [0, 1, 2, 3, 4, 5, 6];
245
224
 
246
225
  export type SharedStylePropsT = {
247
226
  $date: Date;
@@ -241,7 +241,7 @@ export type DatepickerPropsT<T = Date> = {
241
241
  /** Where to mount the popover */
242
242
  mountNode?: HTMLElement,
243
243
  /** When single picker, fn is always called. When range picker, fn is called when start and end date are selected. */
244
- onChange?: ({ +date: ?T | Array<T> }) => mixed,
244
+ onChange?: ({ date: ?T | Array<T> }) => mixed,
245
245
  /** Called when calendar is closed */
246
246
  onClose?: () => mixed,
247
247
  /** Called when calendar is opened */
@@ -320,7 +320,7 @@ export type StatefulContainerPropsT<PropsT, T = Date> = {
320
320
  /** A state change handler. */
321
321
  stateReducer: StateReducerT<T>,
322
322
  /** When single picker, fn is called when date/time is selected. When range picker, fn is called when both start and end are selected. */
323
- onChange?: ({ +date: ?T | Array<T> }) => mixed,
323
+ onChange?: ({ date: ?T | Array<T> }) => mixed,
324
324
  /** When single picker, fn is called when date/time is selected. When range picker, fn is called when either start or end date changes. */
325
325
  onRangeChange?: ({ +date: ?T | Array<?T> }) => mixed,
326
326
  adapter?: DateIOAdapter<T>,
@@ -93,7 +93,7 @@ var DateHelpers = function DateHelpers(_adapter) {
93
93
  var UtilsClass = adapter.constructor;
94
94
  var className = adapter.constructor.name; // This ensures that if the adapter class isn't
95
95
  // supported it just falls back the default formats
96
- // NOTE: in e2e tests puppeteer seems to add
96
+ // NOTE: in e2e tests playwright seems to add
97
97
  // a JSHandle wrapping class to all objects
98
98
  // so className always resolves to JSHandle:e
99
99
  // and if falls back to the default
@@ -68,7 +68,7 @@ class DateHelpers<T> {
68
68
  // This ensures that if the adapter class isn't
69
69
  // supported it just falls back the default formats
70
70
 
71
- // NOTE: in e2e tests puppeteer seems to add
71
+ // NOTE: in e2e tests playwright seems to add
72
72
  // a JSHandle wrapping class to all objects
73
73
  // so className always resolves to JSHandle:e
74
74
  // and if falls back to the default
@@ -1,21 +1,18 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {Override} from '../overrides';
4
- import {
5
- arrayMove as arrayMoveT,
6
- arrayRemove as arrayRemoveT,
7
- } from 'react-movable';
2
+ import { StyletronComponent } from 'styletron-react';
3
+ import { Override } from '../overrides';
4
+ import { arrayMove as arrayMoveT, arrayRemove as arrayRemoveT } from 'react-movable';
8
5
 
9
6
  // export {arrayMove, arrayRemove} from 'react-movable';
10
7
 
11
- export interface STATE_CHANGE_TYPE {
8
+ export declare const STATE_CHANGE_TYPE: {
12
9
  change: 'change';
13
- }
10
+ };
14
11
 
15
12
  export type StateReducer = (
16
- stateChangeType: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
13
+ stateChangeType: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
17
14
  nextState: State,
18
- currentState: State,
15
+ currentState: State
19
16
  ) => State;
20
17
 
21
18
  export interface StatefulListProps {
@@ -23,17 +20,11 @@ export interface StatefulListProps {
23
20
  stateReducer?: StateReducer;
24
21
  removable?: boolean;
25
22
  removableByMove?: boolean;
26
- onChange?: (
27
- params: {
28
- newState: React.ReactNode[];
29
- oldIndex: number;
30
- newIndex: number;
31
- },
32
- ) => any;
23
+ onChange?: (params: { newState: React.ReactNode[]; oldIndex: number; newIndex: number }) => any;
33
24
  overrides?: ListOverrides;
34
25
  }
35
26
 
36
- export const StatefulList: React.FC<StatefulListProps>;
27
+ export declare const StatefulList: React.FC<StatefulListProps>;
37
28
 
38
29
  export interface State {
39
30
  items: React.ReactNode[];
@@ -43,14 +34,11 @@ export type StatefulComponentContainerProps = StatefulListProps & {
43
34
  children: React.ReactNode;
44
35
  };
45
36
 
46
- export class StatefulListContainer extends React.Component<
47
- StatefulComponentContainerProps,
48
- State
49
- > {
50
- onChange({oldIndex, newIndex}: {oldIndex: number; newIndex: number}): void;
37
+ export class StatefulListContainer extends React.Component<StatefulComponentContainerProps, State> {
38
+ onChange({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }): void;
51
39
  internalSetState(
52
- type: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
53
- changes: State,
40
+ type: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
41
+ changes: State
54
42
  ): void;
55
43
  }
56
44
 
@@ -75,19 +63,18 @@ export interface ListProps {
75
63
  removable?: boolean;
76
64
  removableByMove?: boolean;
77
65
  items?: React.ReactNode[];
78
- onChange?: (args: {oldIndex: number; newIndex: number}) => any;
66
+ onChange?: (args: { oldIndex: number; newIndex: number }) => any;
79
67
  overrides?: ListOverrides;
80
68
  }
81
69
 
82
70
  export class List extends React.Component<ListProps> {}
83
71
 
84
- export const StyledRoot: StyletronComponent<any>;
85
- export const StyledList: StyletronComponent<any>;
86
- export const StyledItem: StyletronComponent<any>;
87
- export const StyledDragHandle: StyletronComponent<any>;
88
- export const StyledCloseHandle: StyletronComponent<any>;
89
- export const StyledLabel: StyletronComponent<any>;
72
+ export declare const StyledRoot: StyletronComponent<any>;
73
+ export declare const StyledList: StyletronComponent<any>;
74
+ export declare const StyledItem: StyletronComponent<any>;
75
+ export declare const StyledDragHandle: StyletronComponent<any>;
76
+ export declare const StyledCloseHandle: StyletronComponent<any>;
77
+ export declare const StyledLabel: StyletronComponent<any>;
90
78
 
91
- export const STATE_CHANGE_TYPE: STATE_CHANGE_TYPE;
92
- export const arrayMove: typeof arrayMoveT;
93
- export const arrayRemove: typeof arrayRemoveT;
79
+ export declare const arrayMove: typeof arrayMoveT;
80
+ export declare const arrayRemove: typeof arrayRemoveT;
package/drawer/index.d.ts CHANGED
@@ -1,40 +1,40 @@
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
- export interface SIZE {
5
+ export declare const SIZE: {
6
6
  default: 'default';
7
7
  full: 'full';
8
8
  auto: 'auto';
9
- }
9
+ };
10
10
 
11
- export interface SIZE_DIMENSIONS {
11
+ export declare const SIZE_DIMENSIONS: {
12
12
  default: '500px';
13
13
  full: '100%';
14
14
  auto: 'auto';
15
- }
15
+ };
16
16
 
17
- export interface ANCHOR {
17
+ export declare const ANCHOR: {
18
18
  left: 'left';
19
19
  right: 'right';
20
20
  top: 'top';
21
21
  bottom: 'bottom';
22
- }
22
+ };
23
23
 
24
- export interface CLOSE_SOURCE {
24
+ export declare const CLOSE_SOURCE: {
25
25
  closeButton: 'closeButton';
26
26
  backdrop: 'backdrop';
27
27
  escape: 'escape';
28
- }
28
+ };
29
29
 
30
30
  export interface SharedStylePropsArg {
31
31
  children?: React.ReactNode;
32
32
  $animating?: boolean;
33
33
  $isVisible?: boolean;
34
34
  $isOpen?: boolean;
35
- $size?: SIZE[keyof SIZE];
35
+ $size?: typeof SIZE[keyof typeof SIZE];
36
36
  $closeable?: boolean;
37
- $anchor?: ANCHOR[keyof ANCHOR];
37
+ $anchor?: typeof ANCHOR[keyof typeof ANCHOR];
38
38
  }
39
39
 
40
40
  export interface DrawerOverrides {
@@ -53,10 +53,10 @@ export interface DrawerProps {
53
53
  renderAll?: boolean;
54
54
  isOpen?: boolean;
55
55
  mountNode?: HTMLElement;
56
- onClose?: (args: {closeSource?: CLOSE_SOURCE[keyof CLOSE_SOURCE]}) => any;
56
+ onClose?: (args: { closeSource?: typeof CLOSE_SOURCE[keyof typeof CLOSE_SOURCE] }) => any;
57
57
  overrides?: DrawerOverrides;
58
- size?: SIZE[keyof SIZE] | string;
59
- anchor?: ANCHOR[keyof ANCHOR] | string;
58
+ size?: typeof SIZE[keyof typeof SIZE] | string;
59
+ anchor?: typeof ANCHOR[keyof typeof ANCHOR] | string;
60
60
  showBackdrop?: boolean;
61
61
  onBackdropClick?: (event: React.MouseEvent<HTMLElement>) => any;
62
62
  onEscapeKeyDown?: (event: React.KeyboardEvent<HTMLElement>) => any;
@@ -76,21 +76,16 @@ export class Drawer extends React.Component<DrawerProps, DrawerState> {
76
76
  clearTimers(): void;
77
77
  didOpen(): void;
78
78
  didClose(): void;
79
- triggerClose(source: CLOSE_SOURCE[keyof CLOSE_SOURCE]): void;
79
+ triggerClose(source: typeof CLOSE_SOURCE[keyof typeof CLOSE_SOURCE]): void;
80
80
  animateOutComplete(): void;
81
- getSharedProps(): SharedStylePropsArg & {children: React.ReactNode};
81
+ getSharedProps(): SharedStylePropsArg & { children: React.ReactNode };
82
82
  getChildren(): React.ReactNode;
83
83
  getRef(component: string): React.Ref<any>;
84
84
  renderDrawer(): React.ReactNode;
85
85
  }
86
86
 
87
- export const StyledRoot: StyletronComponent<any>;
88
- export const StyledBackdrop: StyletronComponent<any>;
89
- export const StyledDrawerContainer: StyletronComponent<any>;
90
- export const StyledDrawerBody: StyletronComponent<any>;
91
- export const StyledClose: StyletronComponent<any>;
92
-
93
- export const SIZE: SIZE;
94
- export const ANCHOR: ANCHOR;
95
- export const SIZE_DIMENSIONS: SIZE_DIMENSIONS;
96
- export const CLOSE_SOURCE: CLOSE_SOURCE;
87
+ export declare const StyledRoot: StyletronComponent<any>;
88
+ export declare const StyledBackdrop: StyletronComponent<any>;
89
+ export declare const StyledDrawerContainer: StyletronComponent<any>;
90
+ export declare const StyledDrawerBody: StyletronComponent<any>;
91
+ export declare const StyledClose: StyletronComponent<any>;