baseui 11.0.3 → 11.1.2

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 (240) 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 +83 -29
  7. package/app-nav-bar/styled-components.js.flow +59 -9
  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/utils/date-helpers.js +1 -1
  55. package/datepicker/utils/date-helpers.js.flow +1 -1
  56. package/dnd-list/index.d.ts +22 -35
  57. package/drawer/index.d.ts +22 -27
  58. package/es/app-nav-bar/app-nav-bar.js +9 -19
  59. package/es/app-nav-bar/styled-components.js +64 -13
  60. package/es/badge/badge.js +70 -0
  61. package/es/badge/constants.js +42 -0
  62. package/es/badge/hint-dot.js +55 -0
  63. package/es/badge/index.js +11 -0
  64. package/es/badge/notification-circle.js +65 -0
  65. package/es/badge/styled-components.js +296 -0
  66. package/es/badge/types.js +8 -0
  67. package/es/badge/utils.js +17 -0
  68. package/es/banner/banner.js +213 -0
  69. package/es/banner/constants.js +24 -0
  70. package/es/banner/index.js +9 -0
  71. package/es/banner/styled-components.js +122 -0
  72. package/es/banner/types.js +8 -0
  73. package/es/breadcrumbs/breadcrumbs.js +5 -1
  74. package/es/button/button.js +1 -0
  75. package/es/datepicker/utils/date-helpers.js +1 -1
  76. package/es/file-uploader/file-uploader.js +8 -5
  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 +38 -21
  92. package/es/table-semantic/styled-components.js +14 -0
  93. package/es/table-semantic/table-builder.js +12 -5
  94. package/es/textarea/textarea.js +15 -9
  95. package/es/themes/dark-theme/color-component-tokens.js +8 -0
  96. package/es/themes/light-theme/color-component-tokens.js +8 -0
  97. package/es/tree-view/tree-label.js +9 -1
  98. package/esm/app-nav-bar/app-nav-bar.js +32 -38
  99. package/esm/app-nav-bar/styled-components.js +79 -28
  100. package/esm/badge/badge.js +97 -0
  101. package/esm/badge/constants.js +42 -0
  102. package/esm/badge/hint-dot.js +83 -0
  103. package/esm/badge/index.js +11 -0
  104. package/esm/badge/notification-circle.js +91 -0
  105. package/esm/badge/styled-components.js +235 -0
  106. package/esm/badge/types.js +8 -0
  107. package/esm/badge/utils.js +17 -0
  108. package/esm/banner/banner.js +271 -0
  109. package/esm/banner/constants.js +24 -0
  110. package/esm/banner/index.js +9 -0
  111. package/esm/banner/styled-components.js +113 -0
  112. package/esm/banner/types.js +8 -0
  113. package/esm/breadcrumbs/breadcrumbs.js +5 -1
  114. package/esm/button/button.js +2 -1
  115. package/esm/datepicker/utils/date-helpers.js +1 -1
  116. package/esm/file-uploader/file-uploader.js +23 -8
  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 +75 -57
  132. package/esm/table-semantic/styled-components.js +31 -18
  133. package/esm/table-semantic/table-builder.js +34 -23
  134. package/esm/textarea/textarea.js +15 -9
  135. package/esm/themes/dark-theme/color-component-tokens.js +8 -0
  136. package/esm/themes/light-theme/color-component-tokens.js +8 -0
  137. package/esm/tree-view/tree-label.js +10 -2
  138. package/file-uploader/file-uploader.js +23 -8
  139. package/file-uploader/file-uploader.js.flow +18 -5
  140. package/file-uploader/index.d.ts +11 -11
  141. package/file-uploader/types.js.flow +3 -0
  142. package/flex-grid/index.d.ts +3 -3
  143. package/form-control/index.d.ts +7 -19
  144. package/header-navigation/index.d.ts +8 -9
  145. package/heading/index.d.ts +3 -4
  146. package/helper/helper-steps.js +19 -13
  147. package/helper/helper-steps.js.flow +3 -1
  148. package/helper/index.d.ts +7 -7
  149. package/helpers/base-provider.d.ts +16 -0
  150. package/helpers/overrides.d.ts +23 -0
  151. package/icon/index.d.ts +32 -32
  152. package/index.d.ts +34 -99
  153. package/input/base-input.js +18 -11
  154. package/input/base-input.js.flow +18 -6
  155. package/input/index.d.ts +29 -32
  156. package/input/input.js +15 -10
  157. package/input/input.js.flow +10 -5
  158. package/input/masked-input.js +6 -3
  159. package/input/masked-input.js.flow +3 -0
  160. package/input/types.js.flow +4 -0
  161. package/input/utils.js +4 -2
  162. package/input/utils.js.flow +2 -1
  163. package/layer/index.d.ts +6 -11
  164. package/layout-grid/index.d.ts +25 -7
  165. package/link/index.d.ts +2 -2
  166. package/list/index.d.ts +26 -31
  167. package/{locale.ts → locale/index.d.ts} +8 -0
  168. package/locale/tr_TR.js +123 -0
  169. package/locale/tr_TR.js.flow +124 -0
  170. package/map-marker/index.d.ts +41 -47
  171. package/menu/index.d.ts +27 -37
  172. package/modal/index.d.ts +28 -38
  173. package/notification/index.d.ts +2 -3
  174. package/notification/notification.js +18 -1
  175. package/notification/notification.js.flow +15 -1
  176. package/overrides.ts +2 -22
  177. package/package.json +26 -17
  178. package/pagination/index.d.ts +22 -26
  179. package/payment-card/custom-cards.config.js +30 -0
  180. package/payment-card/custom-cards.config.js.flow +29 -0
  181. package/payment-card/icons/uatp.js +67 -0
  182. package/payment-card/icons/uatp.js.flow +62 -0
  183. package/payment-card/index.d.ts +8 -8
  184. package/payment-card/payment-card.js +12 -7
  185. package/payment-card/payment-card.js.flow +12 -0
  186. package/phone-input/index.d.ts +261 -269
  187. package/pin-code/index.d.ts +11 -18
  188. package/popover/index.d.ts +39 -55
  189. package/popover/popover.js +2 -1
  190. package/popover/popover.js.flow +2 -1
  191. package/popover/stateful-container.js +2 -0
  192. package/popover/stateful-container.js.flow +2 -0
  193. package/popover/styled-components.js +3 -2
  194. package/popover/styled-components.js.flow +2 -1
  195. package/popover/types.js.flow +1 -0
  196. package/progress-bar/index.d.ts +11 -12
  197. package/progress-steps/index.d.ts +16 -16
  198. package/progress-steps/numbered-step.js.flow +2 -2
  199. package/radio/index.d.ts +12 -15
  200. package/rating/index.d.ts +9 -12
  201. package/select/index.d.ts +33 -36
  202. package/select/select-component.js +72 -54
  203. package/select/select-component.js.flow +35 -30
  204. package/side-navigation/index.d.ts +11 -13
  205. package/skeleton/index.d.ts +1 -1
  206. package/slider/index.d.ts +17 -26
  207. package/snackbar/index.d.ts +8 -8
  208. package/spinner/index.d.ts +2 -2
  209. package/styles/index.d.ts +82 -2
  210. package/table/index.d.ts +16 -16
  211. package/table-grid/index.d.ts +6 -8
  212. package/table-semantic/index.d.ts +26 -32
  213. package/table-semantic/styled-components.js +33 -19
  214. package/table-semantic/styled-components.js.flow +12 -0
  215. package/table-semantic/table-builder.js +38 -22
  216. package/table-semantic/table-builder.js.flow +32 -17
  217. package/table-semantic/types.js.flow +1 -0
  218. package/tabs/index.d.ts +20 -23
  219. package/tabs-motion/index.d.ts +23 -23
  220. package/tag/index.d.ts +14 -18
  221. package/textarea/index.d.ts +11 -14
  222. package/textarea/textarea.js +15 -9
  223. package/textarea/textarea.js.flow +11 -5
  224. package/textarea/types.js.flow +1 -0
  225. package/theme.ts +36 -777
  226. package/themes/dark-theme/color-component-tokens.js +8 -0
  227. package/themes/dark-theme/color-component-tokens.js.flow +9 -0
  228. package/themes/index.d.ts +765 -0
  229. package/themes/light-theme/color-component-tokens.js +8 -0
  230. package/themes/light-theme/color-component-tokens.js.flow +9 -0
  231. package/themes/types.js.flow +9 -0
  232. package/timepicker/index.d.ts +5 -8
  233. package/timezonepicker/index.d.ts +5 -8
  234. package/toast/index.d.ts +26 -40
  235. package/tokens/index.d.ts +1 -1
  236. package/tooltip/index.d.ts +7 -9
  237. package/tree-view/index.d.ts +15 -19
  238. package/tree-view/tree-label.js +10 -2
  239. package/tree-view/tree-label.js.flow +4 -4
  240. package/typography/index.d.ts +37 -37
package/menu/index.d.ts CHANGED
@@ -1,8 +1,8 @@
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 KEY_STRINGS {
5
+ export declare const KEY_STRINGS: {
6
6
  ArrowUp: 'ArrowUp';
7
7
  ArrowDown: 'ArrowDown';
8
8
  ArrowLeft: 'ArrowLeft';
@@ -11,8 +11,8 @@ export interface KEY_STRINGS {
11
11
  Space: ' ';
12
12
  Escape: 'Escape';
13
13
  Backspace: 'Backspace';
14
- }
15
- export interface STATE_CHANGE_TYPES {
14
+ };
15
+ export declare const STATE_CHANGE_TYPES: {
16
16
  click: 'click';
17
17
  moveUp: 'moveUp';
18
18
  moveDown: 'moveDown';
@@ -21,12 +21,12 @@ export interface STATE_CHANGE_TYPES {
21
21
  reset: 'reset';
22
22
  character: 'character';
23
23
  enter: 'enter';
24
- }
24
+ };
25
25
 
26
- export interface OPTION_LIST_SIZE {
26
+ export declare const OPTION_LIST_SIZE: {
27
27
  default: 'default';
28
28
  compact: 'compact';
29
- }
29
+ };
30
30
 
31
31
  export interface MenuOverrides {
32
32
  EmptyState?: Override<any>;
@@ -48,7 +48,7 @@ export interface MenuOverrides {
48
48
  }
49
49
 
50
50
  export interface MenuProps extends BaseMenuPropsT {
51
- size?: keyof OPTION_LIST_SIZE;
51
+ size?: typeof OPTION_LIST_SIZE[keyof typeof OPTION_LIST_SIZE];
52
52
  overrides?: MenuOverrides;
53
53
  }
54
54
 
@@ -77,15 +77,12 @@ export type OnItemSelect = (args: {
77
77
  }) => any;
78
78
 
79
79
  export type StateReducer = (
80
- changeType: STATE_CHANGE_TYPES[keyof STATE_CHANGE_TYPES],
80
+ changeType: typeof STATE_CHANGE_TYPES[keyof typeof STATE_CHANGE_TYPES],
81
81
  changes: StatefulContainerState,
82
- currentState: StatefulContainerState,
82
+ currentState: StatefulContainerState
83
83
  ) => StatefulContainerState;
84
84
 
85
- export type GetRequiredItemProps = (
86
- item: any,
87
- index: number,
88
- ) => RenderItemProps;
85
+ export type GetRequiredItemProps = (item: any, index: number) => RenderItemProps;
89
86
 
90
87
  export type RenderProps = StatefulContainerState & {
91
88
  items: ItemsT;
@@ -126,7 +123,7 @@ export interface OptionListProps extends BaseMenuPropsT {
126
123
  getChildMenu?: (item: any) => React.ReactNode;
127
124
  onMouseDown?: (event: MouseEvent) => any;
128
125
  onMouseEnter?: (event: MouseEvent) => any;
129
- size?: OPTION_LIST_SIZE[keyof OPTION_LIST_SIZE];
126
+ size?: typeof OPTION_LIST_SIZE[keyof typeof OPTION_LIST_SIZE];
130
127
  overrides?: {
131
128
  ListItem?: Override<any>;
132
129
  ChildMenuPopover?: Override<any>;
@@ -141,7 +138,7 @@ export interface OptionListProps extends BaseMenuPropsT {
141
138
  id?: string;
142
139
  role?: string;
143
140
  }
144
- export const OptionList: React.FC<OptionListProps>;
141
+ export declare const OptionList: React.FC<OptionListProps>;
145
142
 
146
143
  export interface OptionProfileProps extends BaseMenuPropsT {
147
144
  item: any;
@@ -165,7 +162,7 @@ export interface OptionProfileProps extends BaseMenuPropsT {
165
162
  };
166
163
  $isHighlighted?: boolean;
167
164
  }
168
- export const OptionProfile: React.FC<OptionProfileProps>;
165
+ export declare const OptionProfile: React.FC<OptionProfileProps>;
169
166
 
170
167
  export interface SharedStatelessProps {
171
168
  activedescendantId?: string;
@@ -185,7 +182,7 @@ export interface SharedStatelessProps {
185
182
  }
186
183
 
187
184
  export type StatelessMenuProps = SharedStatelessProps & MenuProps;
188
- export const Menu: React.FC<StatelessMenuProps>;
185
+ export declare const Menu: React.FC<StatelessMenuProps>;
189
186
 
190
187
  export interface NestedMenuProps {
191
188
  children: React.ReactNode;
@@ -193,10 +190,7 @@ export interface NestedMenuProps {
193
190
  export interface NestedMenuState {
194
191
  menus: Array<React.Ref<HTMLElement>>;
195
192
  }
196
- export class NestedMenus extends React.Component<
197
- NestedMenuProps,
198
- NestedMenuState
199
- > {
193
+ export class NestedMenus extends React.Component<NestedMenuProps, NestedMenuState> {
200
194
  addMenuToNesting(ref: React.Ref<HTMLElement>): void;
201
195
  removeMenuFromNesting(ref: React.Ref<HTMLElement>): void;
202
196
  findMenuIndexByRef(ref: React.Ref<HTMLElement>): number;
@@ -206,17 +200,13 @@ export class NestedMenus extends React.Component<
206
200
  isNestedMenuVisible(ref: React.Ref<HTMLElement>): boolean;
207
201
  }
208
202
 
209
- export const StyledEmptyState: StyletronComponent<any>;
210
- export const StyledList: StyletronComponent<any>;
211
- export const StyledListItem: StyletronComponent<any>;
212
- export const StyledListItemProfile: StyletronComponent<any>;
213
- export const StyledProfileImgContainer: StyletronComponent<any>;
214
- export const StyledProfileImg: StyletronComponent<any>;
215
- export const StyledProfileLabelsContainer: StyletronComponent<any>;
216
- export const StyledProfileTitle: StyletronComponent<any>;
217
- export const StyledProfileSubtitle: StyletronComponent<any>;
218
- export const StyledProfileBody: StyletronComponent<any>;
219
-
220
- export const KEY_STRINGS: KEY_STRINGS;
221
- export const STATE_CHANGE_TYPES: STATE_CHANGE_TYPES;
222
- export const OPTION_LIST_SIZE: OPTION_LIST_SIZE;
203
+ export declare const StyledEmptyState: StyletronComponent<any>;
204
+ export declare const StyledList: StyletronComponent<any>;
205
+ export declare const StyledListItem: StyletronComponent<any>;
206
+ export declare const StyledListItemProfile: StyletronComponent<any>;
207
+ export declare const StyledProfileImgContainer: StyletronComponent<any>;
208
+ export declare const StyledProfileImg: StyletronComponent<any>;
209
+ export declare const StyledProfileLabelsContainer: StyletronComponent<any>;
210
+ export declare const StyledProfileTitle: StyletronComponent<any>;
211
+ export declare const StyledProfileSubtitle: StyletronComponent<any>;
212
+ export declare const StyledProfileBody: StyletronComponent<any>;
package/modal/index.d.ts CHANGED
@@ -1,36 +1,36 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {ButtonProps} from '../button';
4
- import {Override} from '../overrides';
2
+ import { StyletronComponent } from 'styletron-react';
3
+ import { ButtonProps } from '../button';
4
+ import { Override } from '../overrides';
5
5
 
6
- export interface SIZE {
6
+ export declare const SIZE: {
7
7
  default: 'default';
8
8
  full: 'full';
9
9
  auto: 'auto';
10
- }
10
+ };
11
11
 
12
- export interface SIZE_WIDTHS {
12
+ export declare const SIZE_WIDTHS: {
13
13
  default: '500px';
14
14
  full: '100%';
15
15
  auto: 'auto';
16
- }
17
- export interface ROLE {
16
+ };
17
+ export declare const ROLE: {
18
18
  dialog: 'dialog';
19
19
  alertdialog: 'alertdialog';
20
- }
21
- export interface CLOSE_SOURCE {
20
+ };
21
+ export declare const CLOSE_SOURCE: {
22
22
  closeButton: 'closeButton';
23
23
  backdrop: 'backdrop';
24
24
  escape: 'escape';
25
- }
25
+ };
26
26
 
27
27
  export interface SharedStylePropsArg {
28
28
  children?: React.ReactNode;
29
29
  $animate?: boolean;
30
30
  $isVisible?: boolean;
31
31
  $isOpen?: boolean;
32
- $size?: SIZE[keyof SIZE];
33
- $role?: ROLE[keyof ROLE];
32
+ $size?: typeof SIZE[keyof typeof SIZE];
33
+ $role?: typeof ROLE[keyof typeof ROLE];
34
34
  $closeable?: boolean;
35
35
  }
36
36
 
@@ -44,18 +44,15 @@ export interface ModalProps {
44
44
  animate?: boolean;
45
45
  autoFocus?: boolean;
46
46
  focusLock?: boolean;
47
- returnFocus?:
48
- | boolean
49
- | FocusOptions
50
- | ((returnTo: Element) => boolean | FocusOptions);
47
+ returnFocus?: boolean | FocusOptions | ((returnTo: Element) => boolean | FocusOptions);
51
48
  children?: React.ReactNode;
52
49
  closeable?: boolean;
53
50
  isOpen?: boolean;
54
51
  mountNode?: HTMLElement;
55
- onClose?: (args: {closeSource?: CLOSE_SOURCE[keyof CLOSE_SOURCE]}) => any;
52
+ onClose?: (args: { closeSource?: typeof CLOSE_SOURCE[keyof typeof CLOSE_SOURCE] }) => any;
56
53
  overrides?: ModalOverrides;
57
- role?: ROLE[keyof ROLE];
58
- size?: SIZE[keyof SIZE];
54
+ role?: typeof ROLE[keyof typeof ROLE];
55
+ size?: typeof SIZE[keyof typeof SIZE];
59
56
  }
60
57
  export interface ModalState {
61
58
  isVisible: boolean;
@@ -72,33 +69,26 @@ export class Modal extends React.Component<ModalProps, ModalState> {
72
69
  clearTimers(): void;
73
70
  didOpen(): void;
74
71
  didClose(): void;
75
- triggerClose(source: CLOSE_SOURCE[keyof CLOSE_SOURCE]): void;
72
+ triggerClose(source: typeof CLOSE_SOURCE[keyof typeof CLOSE_SOURCE]): void;
76
73
  captureLastFocus(): void;
77
74
  restoreLastFocus(): void;
78
75
  autoFocus(): void;
79
76
  animateOutComplete(): void;
80
- getSharedProps(): SharedStylePropsArg & {children: React.ReactNode};
77
+ getSharedProps(): SharedStylePropsArg & { children: React.ReactNode };
81
78
  getMountNode(): HTMLElement;
82
79
  getChildren(): React.ReactNode;
83
80
  getRef(component: string): React.Ref<any>;
84
81
  renderModal(): React.ReactNode;
85
82
  }
86
83
 
87
- export class ModalButton extends React.Component<
88
- ButtonProps & {autoFocus?: boolean}
89
- > {}
90
-
91
- export class FocusOnce extends React.Component<{children: React.ReactNode}> {}
84
+ export class ModalButton extends React.Component<ButtonProps & { autoFocus?: boolean }> {}
92
85
 
93
- export const StyledRoot: StyletronComponent<any>;
94
- export const StyledDialog: StyletronComponent<any>;
95
- export const StyledDialogContainer: StyletronComponent<any>;
96
- export const StyledClose: StyletronComponent<any>;
97
- export const ModalHeader: StyletronComponent<any>;
98
- export const ModalBody: StyletronComponent<any>;
99
- export const ModalFooter: StyletronComponent<any>;
86
+ export class FocusOnce extends React.Component<{ children: React.ReactNode }> {}
100
87
 
101
- export const SIZE: SIZE;
102
- export const SIZE_WIDTHS: SIZE_WIDTHS;
103
- export const ROLE: ROLE;
104
- export const CLOSE_SOURCE: CLOSE_SOURCE;
88
+ export declare const StyledRoot: StyletronComponent<any>;
89
+ export declare const StyledDialog: StyletronComponent<any>;
90
+ export declare const StyledDialogContainer: StyletronComponent<any>;
91
+ export declare const StyledClose: StyletronComponent<any>;
92
+ export declare const ModalHeader: StyletronComponent<any>;
93
+ export declare const ModalBody: StyletronComponent<any>;
94
+ export declare const ModalFooter: StyletronComponent<any>;
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {KIND, ToastProps} from '../toast';
2
+ import { KIND, ToastProps } from '../toast';
4
3
 
5
4
  export class Notification extends React.Component<ToastProps> {}
6
- export {KIND};
5
+ export { KIND };
@@ -11,6 +11,8 @@ var React = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _index = require("../toast/index.js");
13
13
 
14
+ var _overrides = require("../helpers/overrides.js");
15
+
14
16
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
15
17
 
16
18
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -53,9 +55,24 @@ var Notification = /*#__PURE__*/function (_React$Component) {
53
55
  _createClass(Notification, [{
54
56
  key: "render",
55
57
  value: function render() {
58
+ var overrides = (0, _overrides.mergeOverrides)({
59
+ Body: {
60
+ style: function style(_ref) {
61
+ var $theme = _ref.$theme;
62
+ return {
63
+ marginTop: $theme.sizing.scale600,
64
+ marginRight: $theme.sizing.scale600,
65
+ marginBottom: $theme.sizing.scale600,
66
+ marginLeft: $theme.sizing.scale600
67
+ };
68
+ }
69
+ }
70
+ }, this.props.overrides);
56
71
  return /*#__PURE__*/React.createElement(_index.Toast, _extends({
57
72
  "data-baseweb": "notification"
58
- }, this.props));
73
+ }, this.props, {
74
+ overrides: overrides
75
+ }));
59
76
  }
60
77
  }]);
61
78
 
@@ -9,6 +9,7 @@ import * as React from 'react';
9
9
 
10
10
  import { Toast, TYPE } from '../toast/index.js';
11
11
  import type { ToastPropsT, ToastPropsShapeT } from '../toast/types.js';
12
+ import { mergeOverrides } from '../helpers/overrides.js';
12
13
 
13
14
  export default class Notification extends React.Component<ToastPropsT> {
14
15
  static defaultProps: ToastPropsShapeT = {
@@ -17,7 +18,20 @@ export default class Notification extends React.Component<ToastPropsT> {
17
18
  };
18
19
 
19
20
  render() {
20
- return <Toast data-baseweb="notification" {...this.props} />;
21
+ const overrides = mergeOverrides(
22
+ {
23
+ Body: {
24
+ style: ({ $theme }) => ({
25
+ marginTop: $theme.sizing.scale600,
26
+ marginRight: $theme.sizing.scale600,
27
+ marginBottom: $theme.sizing.scale600,
28
+ marginLeft: $theme.sizing.scale600,
29
+ }),
30
+ },
31
+ },
32
+ this.props.overrides
33
+ );
34
+ return <Toast data-baseweb="notification" {...this.props} overrides={overrides} />;
21
35
  }
22
36
  }
23
37
 
package/overrides.ts CHANGED
@@ -1,23 +1,3 @@
1
- import * as React from 'react';
2
- import {StyleObject} from 'styletron-react';
3
- import {Theme} from './theme';
1
+ import type { Override, Overrides } from './helpers/overrides';
4
2
 
5
- type StyleOverride<T> =
6
- | StyleObject
7
- | ((props: {$theme: Theme} & React.PropsWithChildren<T>) => StyleObject);
8
-
9
- type ComponentOverride<T> =
10
- | React.ComponentType<T>
11
- | React.RefForwardingComponent<T>;
12
-
13
- interface OverrideObject<T> {
14
- component?: ComponentOverride<T>;
15
- props?: any;
16
- style?: StyleOverride<T>;
17
- }
18
-
19
- export type Override<T> = OverrideObject<T> | React.ComponentType<T>;
20
-
21
- export interface Overrides<T> {
22
- [key: string]: Override<T>;
23
- }
3
+ export type { Override, Overrides };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baseui",
3
- "version": "11.0.3",
3
+ "version": "11.1.2",
4
4
  "description": "A React Component library implementing the Base design language",
5
5
  "keywords": [
6
6
  "react",
@@ -24,23 +24,23 @@
24
24
  "build:copy-files": "shx cp README.md dist/README.md",
25
25
  "build:copy-flow-files": "node ./scripts/flow-copy-src.js",
26
26
  "build:copy-ts-files": "node ./scripts/ts-copy.js",
27
- "build:package-json": "shx cp package.json dist/package.json && node ./scripts/build-package-json.js",
27
+ "build:package-json": "shx cp package.json dist/package.json && shx cp .npmrc dist/.npmrc && node ./scripts/build-package-json.js",
28
28
  "build:cjs": "cross-env NODE_ENV=production BABEL_ENV=cjs babel ./src --out-dir ./dist --ignore **.test.js,**/__tests__/**,**/e2e.js,**/template-component/**,**/test/**",
29
29
  "build:esm": "cross-env NODE_ENV=production BABEL_ENV=esm babel ./src --out-dir ./dist/esm --ignore **.test.js,**/__tests__/**,**/e2e.js,**/template-component/**,**/test/**",
30
30
  "build:es": "cross-env NODE_ENV=production BABEL_ENV=es babel ./src --out-dir ./dist/es --ignore **.test.js,**/__tests__/**,**/e2e.js,**/template-component/**,**/test/**",
31
31
  "build": "yarn build:cjs && yarn build:esm && yarn build:es && yarn build:copy-files && yarn build:copy-flow-files && yarn build:copy-ts-files && yarn build:package-json",
32
- "build:docs-and-ladle": "yarn documentation:build && yarn ladle build --base-url /ladle/ && mv build public/ladle",
32
+ "build:docs-and-ladle": "yarn documentation:build && yarn ladle build && mv build public/ladle",
33
33
  "build:documentation-site-files": "node ./scripts/build-documentation-site-files.js",
34
34
  "unit-test": "yarn jest --coverage",
35
- "e2e:build": "yarn ladle build --out build-ladle",
35
+ "e2e:build": "yarn ladle build --outDir build-ladle",
36
36
  "e2e:serve": "static-server build-ladle --port 8080",
37
- "e2e:test": "jest --runInBand -c jest.e2e.config.js",
38
- "e2e:test:ci": "PUPPETEER_TARGET_URL=http://e2e-server:8080 jest -c jest.e2e.config.js",
39
- "vrt": "jest -c jest.vrt.config.js",
37
+ "e2e:test": "playwright test",
38
+ "e2e:test:ci": "PUPPETEER_TARGET_URL=http://e2e-server:8080 yarn e2e:test",
39
+ "vrt": "playwright test --config playwright-vrt.config.js",
40
40
  "vrt:docker:run": "docker-compose run e2e-test bash -c 'PUPPETEER_TARGET_URL=http://e2e-server:8080 yarn vrt'",
41
- "vrt:docker:update": "docker-compose run e2e-test bash -c 'PUPPETEER_TARGET_URL=http://e2e-server:8080 yarn vrt -u'",
41
+ "vrt:docker:update": "docker-compose run e2e-test bash -c 'PUPPETEER_TARGET_URL=http://e2e-server:8080 yarn vrt --update'",
42
42
  "vrt:ci": "PUPPETEER_TARGET_URL=http://e2e-server:8080 node ./vrt/ci.js",
43
- "vrt:reset": "shx rm -rf vrt/__image_snapshots__",
43
+ "vrt:reset": "shx rm -rf vrt/tests.vrt.js-snapshots",
44
44
  "icon:generate": "node ./src/icon/build-icons.js",
45
45
  "thumbs:generate": "svgr --template ./documentation-site/components/thumbs/template.js --replace-attr-values \"#F6F6F6={props.colors[0]}\" --replace-attr-values \"#E2E2E2={props.colors[1]}\" --replace-attr-values \"#CBCBCB={props.colors[2]}\" -d ./documentation-site/components/thumbs/components ./documentation-site/components/thumbs/svg",
46
46
  "install": "node -e \"console.log('If you are using Webpack, please make sure to update to version ^4.32.0, as this Base Web version depends on a webpack fix delivered in that version. If you are using Fusion.js make sure to upgrade fusion-cli to ^2.4.2 as it has the Webpack upgrade.')\"",
@@ -55,12 +55,13 @@
55
55
  "next:dev": "next dev documentation-site",
56
56
  "next:build": "NODE_OPTIONS=--max_old_space_size=4096 next build documentation-site",
57
57
  "next:export": "next export documentation-site -o public",
58
- "tsc": "tsc --skipLibCheck",
58
+ "tsc": "tsc",
59
59
  "validate:examples": "node ./scripts/validate-examples.js"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@babel/cli": "^7.6.0",
63
63
  "@babel/core": "^7.8.4",
64
+ "@babel/generator": "^7.17.3",
64
65
  "@babel/helper-builder-react-jsx": "^7.12.13",
65
66
  "@babel/parser": "^7.7.3",
66
67
  "@babel/plugin-external-helpers": "^7.2.0",
@@ -76,15 +77,18 @@
76
77
  "@babel/preset-flow": "^7.0.0",
77
78
  "@babel/preset-react": "^7.0.0",
78
79
  "@babel/preset-typescript": "^7.13.0",
80
+ "@babel/template": "^7.16.7",
79
81
  "@babel/traverse": "^7.7.0",
80
82
  "@babel/types": "^7.7.1",
81
83
  "@commitlint/cli": "^8.0.0",
82
84
  "@commitlint/config-conventional": "^8.0.0",
83
85
  "@date-io/luxon": "^2.7.0",
84
86
  "@date-io/moment": "^2.7.0",
85
- "@ladle/react": "^0.10.2",
87
+ "@dubstep/core": "^3.5.3",
88
+ "@ladle/react": "^1.0.1",
86
89
  "@mdx-js/tag": "^0.20.0",
87
90
  "@octokit/rest": "^16.33.1",
91
+ "@playwright/test": "^1.22.2",
88
92
  "@svgr/cli": "^4.3.2",
89
93
  "@testing-library/jest-dom": "^5.16.3",
90
94
  "@testing-library/react": "^12.1.4",
@@ -105,9 +109,12 @@
105
109
  "@types/react-dom": "^16.8.4",
106
110
  "@types/react-virtualized": "^9.21.3",
107
111
  "@types/react-window": "^1.8.1",
108
- "@types/styletron-engine-atomic": "^1.1.0",
109
- "@types/styletron-react": "^5.0.1",
110
- "@types/styletron-standard": "^2.0.0",
112
+ "@types/styletron-engine-atomic": "^1.1.1",
113
+ "@types/styletron-react": "^5.0.3",
114
+ "@types/styletron-standard": "^2.0.2",
115
+ "@types/webpack": "^4.41.32",
116
+ "@typescript-eslint/eslint-plugin": "^5.26.0",
117
+ "@typescript-eslint/parser": "^5.26.0",
111
118
  "@zeit/next-css": "^1.0.1",
112
119
  "@zeit/next-mdx": "^1.2.0",
113
120
  "axe-core": "^4.2.2",
@@ -139,6 +146,7 @@
139
146
  "extract-react-types": "^0.26.0",
140
147
  "extract-react-types-loader": "^0.3.13",
141
148
  "flow-bin": "0.131.0",
149
+ "flow-remove-types": "^2.179.0",
142
150
  "globby": "^10.0.1",
143
151
  "husky": "^3.0.0",
144
152
  "isomorphic-fetch": "^2.2.1",
@@ -148,7 +156,6 @@
148
156
  "jest-environment-jsdom-global": "1.2.1",
149
157
  "jest-image-snapshot": "^2.11.0",
150
158
  "jest-matcher-utils": "^26.6.1",
151
- "jest-puppeteer": "^5.0.4",
152
159
  "jscodeshift": "^0.6.4",
153
160
  "just-omit": "^1.1.0",
154
161
  "just-pick": "^2.1.0",
@@ -162,11 +169,11 @@
162
169
  "node-fetch": "^2.6.1",
163
170
  "now": "16.5.2",
164
171
  "npm-run-all": "^4.1.5",
172
+ "playwright": "^1.22.2",
165
173
  "prettier": "^2.5.1",
166
174
  "pretty-proptypes": "^1.0.5",
167
175
  "pretty-quick": "^1.4.1",
168
176
  "prism-react-renderer": "^1.0.1",
169
- "puppeteer": "^9.1.1",
170
177
  "query-string": "^6.14.0",
171
178
  "raw-loader": "^3.1.0",
172
179
  "react": "^17.0.2",
@@ -177,10 +184,12 @@
177
184
  "react-icons": "^3.8.0",
178
185
  "react-map-gl": "^5.3.19",
179
186
  "react-markdown": "^4.0.3",
187
+ "react-simple-code-editor": "^0.10.0",
180
188
  "react-twitter-embed": "^2.0.8",
181
189
  "react-view": "^2.3.3",
182
190
  "react-vis": "^1.11.6",
183
191
  "remove-flow-types-loader": "^1.1.0",
192
+ "rollup-pluginutils": "^2.8.2",
184
193
  "semver": "^6.2.0",
185
194
  "shx": "^0.3.2",
186
195
  "static-server": "^2.2.1",
@@ -189,7 +198,7 @@
189
198
  "styletron-standard": "^3.0.3",
190
199
  "tar": "^5.0.0",
191
200
  "tsconfig-paths": "^3.9.0",
192
- "typescript": "^3.8.0",
201
+ "typescript": "^4.7.2",
193
202
  "universal-cookie": "^4.0.2",
194
203
  "webpack": "^4.17.1",
195
204
  "webpack-bundle-analyzer": "^3.5.0",
@@ -1,14 +1,14 @@
1
1
  import * as React from 'react';
2
- import {StyletronComponent} from 'styletron-react';
3
- import {Override} from '../overrides';
4
- import {Locale} from '../locale';
5
- import {SIZE} from '../input';
2
+ import { StyletronComponent } from 'styletron-react';
3
+ import { Override } from '../overrides';
4
+ import { Locale } from '../locale';
5
+ import { SIZE } from '../input';
6
6
 
7
- export {SIZE};
7
+ export { SIZE };
8
8
 
9
- export interface STATE_CHANGE_TYPE {
9
+ export declare const STATE_CHANGE_TYPE: {
10
10
  change: 'change';
11
- }
11
+ };
12
12
 
13
13
  export interface Labels {
14
14
  prevButton?: string;
@@ -21,9 +21,9 @@ export interface State {
21
21
  }
22
22
 
23
23
  export type StateReducer = (
24
- changeType: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
24
+ changeType: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
25
25
  changes: State,
26
- currentState: State,
26
+ currentState: State
27
27
  ) => State;
28
28
 
29
29
  export interface PaginationOverrides {
@@ -36,9 +36,9 @@ export interface PaginationOverrides {
36
36
  }
37
37
 
38
38
  export interface Callbacks {
39
- onPrevClick?: (args: {event: any}) => any;
40
- onNextClick?: (args: {event: any}) => any;
41
- onPageChange?: (args: {nextPage: number; prevPage: number}) => any;
39
+ onPrevClick?: (args: { event: any }) => any;
40
+ onNextClick?: (args: { event: any }) => any;
41
+ onPageChange?: (args: { nextPage: number; prevPage: number }) => any;
42
42
  }
43
43
 
44
44
  export interface PaginationProps extends Callbacks {
@@ -46,7 +46,7 @@ export interface PaginationProps extends Callbacks {
46
46
  currentPage: number;
47
47
  labels?: Labels;
48
48
  overrides?: PaginationOverrides;
49
- size?: SIZE[keyof SIZE];
49
+ size?: typeof SIZE[keyof typeof SIZE];
50
50
  }
51
51
 
52
52
  export interface PageOption {
@@ -55,7 +55,7 @@ export interface PageOption {
55
55
 
56
56
  export class Pagination extends React.PureComponent<PaginationProps> {
57
57
  getMenuOptions(numPages: number): [];
58
- onMenuItemSelect(data: {value: ReadonlyArray<PageOption>}): void;
58
+ onMenuItemSelect(data: { value: ReadonlyArray<PageOption> }): void;
59
59
  onPrevClick(event: React.SyntheticEvent<any>): void;
60
60
  onNextClick(event: React.SyntheticEvent<any>): void;
61
61
  constructAriaWayfinderLabel(locale: Locale, prefix: string): string;
@@ -69,7 +69,7 @@ export interface StatefulPaginationProps extends Callbacks {
69
69
  overrides?: PaginationOverrides;
70
70
  }
71
71
 
72
- export const StatefulPagination: React.FC<StatefulPaginationProps>;
72
+ export declare const StatefulPagination: React.FC<StatefulPaginationProps>;
73
73
 
74
74
  export interface StatefulContainerProps {
75
75
  children: React.ReactNode;
@@ -79,18 +79,14 @@ export interface StatefulContainerProps {
79
79
  onPageChange?: Callbacks['onPageChange'];
80
80
  }
81
81
 
82
- export class StatefulContainer extends React.Component<
83
- StatefulContainerProps,
84
- State
85
- > {
82
+ export class StatefulContainer extends React.Component<StatefulContainerProps, State> {
86
83
  internalSetState(
87
- changeType: STATE_CHANGE_TYPE[keyof STATE_CHANGE_TYPE],
88
- changes: State,
84
+ changeType: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE],
85
+ changes: State
89
86
  ): void;
90
- onPageChange(args: {nextPage: number}): void;
87
+ onPageChange(args: { nextPage: number }): void;
91
88
  }
92
89
 
93
- export const StyledRoot: StyletronComponent<any>;
94
- export const StyledMaxLabel: StyletronComponent<any>;
95
- export const StyledDropdownContainer: StyletronComponent<any>;
96
- export const STATE_CHANGE_TYPE: STATE_CHANGE_TYPE;
90
+ export declare const StyledRoot: StyletronComponent<any>;
91
+ export declare const StyledMaxLabel: StyletronComponent<any>;
92
+ export declare const StyledDropdownContainer: StyletronComponent<any>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CUSTOM_CARDS_CONFIGURATION = void 0;
7
+
8
+ /*
9
+ Copyright (c) Uber Technologies, Inc.
10
+
11
+ This source code is licensed under the MIT license found in the
12
+ LICENSE file in the root directory of this source tree.
13
+ */
14
+
15
+ /*
16
+ This file should be used for adding new card type configuration
17
+ */
18
+ var UATP_CARD_TYPE_CONFIG = {
19
+ niceType: 'Uatp',
20
+ type: 'uatp',
21
+ patterns: [[1001, 1999]],
22
+ gaps: [4, 9],
23
+ lengths: [15],
24
+ code: {
25
+ name: 'CVV',
26
+ size: 0
27
+ }
28
+ };
29
+ var CUSTOM_CARDS_CONFIGURATION = [UATP_CARD_TYPE_CONFIG];
30
+ exports.CUSTOM_CARDS_CONFIGURATION = CUSTOM_CARDS_CONFIGURATION;
@@ -0,0 +1,29 @@
1
+ /*
2
+ Copyright (c) Uber Technologies, Inc.
3
+
4
+ This source code is licensed under the MIT license found in the
5
+ LICENSE file in the root directory of this source tree.
6
+ */
7
+ //@flow
8
+
9
+ /*
10
+ This file should be used for adding new card type configuration
11
+ */
12
+
13
+ const UATP_CARD_TYPE_CONFIG = {
14
+ niceType: 'Uatp',
15
+ type: 'uatp',
16
+ patterns: [[1001, 1999]],
17
+ gaps: [4, 9],
18
+ lengths: [15],
19
+ code: {
20
+ name: 'CVV',
21
+ size: 0,
22
+ },
23
+ };
24
+
25
+ export const CUSTOM_CARDS_CONFIGURATION = [UATP_CARD_TYPE_CONFIG];
26
+
27
+ declare var __DEV__: boolean;
28
+ declare var __NODE__: boolean;
29
+ declare var __BROWSER__: boolean;