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
@@ -0,0 +1,271 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+
5
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
+
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+
9
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10
+
11
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
12
+
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+
15
+ /*
16
+ Copyright (c) Uber Technologies, Inc.
17
+
18
+ This source code is licensed under the MIT license found in the
19
+ LICENSE file in the root directory of this source tree.
20
+ */
21
+ import * as React from 'react';
22
+ import { Button, SIZE as BUTTON_SIZE, SHAPE as BUTTON_SHAPE } from '../button/index.js';
23
+ import { getOverrides } from '../helpers/overrides.js';
24
+ import { useStyletron } from '../styles/index.js';
25
+ import { ACTION_POSITION, ARTWORK_TYPE, HIERARCHY, KIND } from './constants.js';
26
+ import { StyledRoot, StyledLeadingContent, StyledMessageContent, StyledTitle, StyledMessage, StyledBelowContent, StyledTrailingContent, StyledTrailingButtonContainer, StyledTrailingIconButton } from './styled-components.js';
27
+
28
+ function low(theme, kind) {
29
+ switch (kind) {
30
+ case KIND.negative:
31
+ return {
32
+ actionBackgroundColor: theme.colors.bannerActionLowNegative,
33
+ backgroundColor: theme.colors.backgroundLightNegative,
34
+ color: theme.colors.contentPrimary
35
+ };
36
+
37
+ case KIND.positive:
38
+ return {
39
+ actionBackgroundColor: theme.colors.bannerActionLowPositive,
40
+ backgroundColor: theme.colors.backgroundLightPositive,
41
+ color: theme.colors.contentPrimary
42
+ };
43
+
44
+ case KIND.warning:
45
+ return {
46
+ actionBackgroundColor: theme.colors.bannerActionLowWarning,
47
+ backgroundColor: theme.colors.backgroundLightWarning,
48
+ color: theme.colors.contentPrimary
49
+ };
50
+
51
+ case KIND.info:
52
+ default:
53
+ return {
54
+ actionBackgroundColor: theme.colors.bannerActionLowInfo,
55
+ backgroundColor: theme.colors.backgroundLightAccent,
56
+ color: theme.colors.contentPrimary
57
+ };
58
+ }
59
+ }
60
+
61
+ function high(theme, kind) {
62
+ switch (kind) {
63
+ case KIND.negative:
64
+ return {
65
+ actionBackgroundColor: theme.colors.bannerActionHighNegative,
66
+ backgroundColor: theme.colors.backgroundNegative,
67
+ color: theme.colors.contentOnColor
68
+ };
69
+
70
+ case KIND.positive:
71
+ return {
72
+ actionBackgroundColor: theme.colors.bannerActionHighPositive,
73
+ backgroundColor: theme.colors.backgroundPositive,
74
+ color: theme.colors.contentOnColor
75
+ };
76
+
77
+ case KIND.warning:
78
+ return {
79
+ actionBackgroundColor: theme.colors.bannerActionHighWarning,
80
+ backgroundColor: theme.colors.backgroundWarning,
81
+ color: theme.colors.contentPrimary
82
+ };
83
+
84
+ case KIND.info:
85
+ default:
86
+ return {
87
+ actionBackgroundColor: theme.colors.bannerActionHighInfo,
88
+ backgroundColor: theme.colors.backgroundAccent,
89
+ color: theme.colors.contentOnColor
90
+ };
91
+ }
92
+ }
93
+
94
+ function Leading(_ref) {
95
+ var artwork = _ref.artwork;
96
+
97
+ var _useStyletron = useStyletron(),
98
+ _useStyletron2 = _slicedToArray(_useStyletron, 2),
99
+ theme = _useStyletron2[1];
100
+
101
+ if (!artwork) {
102
+ return null;
103
+ }
104
+
105
+ var size = artwork.type === ARTWORK_TYPE.badge ? theme.sizing.scale1000 : theme.sizing.scale800;
106
+ return artwork.icon({
107
+ size: size
108
+ });
109
+ }
110
+
111
+ function Below(_ref2) {
112
+ var action = _ref2.action,
113
+ backgroundColor = _ref2.backgroundColor,
114
+ color = _ref2.color;
115
+
116
+ if (!action || action.position !== ACTION_POSITION.below) {
117
+ return null;
118
+ }
119
+
120
+ if (process.env.NODE_ENV !== "production") {
121
+ if (action.icon) {
122
+ console.error('Banner ACTION_POSITION.below must not have an icon.');
123
+ return null;
124
+ }
125
+ }
126
+
127
+ if (action.label) {
128
+ return /*#__PURE__*/React.createElement(Button, {
129
+ colors: {
130
+ backgroundColor: backgroundColor,
131
+ color: color
132
+ },
133
+ onClick: action.onClick,
134
+ size: BUTTON_SIZE.compact,
135
+ shape: BUTTON_SHAPE.pill
136
+ }, action.label);
137
+ }
138
+
139
+ return null;
140
+ }
141
+
142
+ function Trailing(_ref3) {
143
+ var action = _ref3.action,
144
+ backgroundColor = _ref3.backgroundColor,
145
+ color = _ref3.color,
146
+ overrides = _ref3.overrides,
147
+ nested = _ref3.nested;
148
+
149
+ var _useStyletron3 = useStyletron(),
150
+ _useStyletron4 = _slicedToArray(_useStyletron3, 2),
151
+ theme = _useStyletron4[1];
152
+
153
+ if (!action || action.position && action.position !== ACTION_POSITION.trailing) {
154
+ return null;
155
+ }
156
+
157
+ var _getOverrides = getOverrides(overrides.TrailingIconButton, StyledTrailingIconButton),
158
+ _getOverrides2 = _slicedToArray(_getOverrides, 2),
159
+ TrailingIconButton = _getOverrides2[0],
160
+ trailingIconButtonProps = _getOverrides2[1];
161
+
162
+ if (action.icon) {
163
+ return /*#__PURE__*/React.createElement(TrailingIconButton, _extends({
164
+ "aria-label": action.label,
165
+ onClick: action.onClick,
166
+ $nested: nested
167
+ }, trailingIconButtonProps), action.icon({
168
+ size: theme.sizing.scale650
169
+ }));
170
+ }
171
+
172
+ var _getOverrides3 = getOverrides(overrides.TrailingButtonContainer, StyledTrailingButtonContainer),
173
+ _getOverrides4 = _slicedToArray(_getOverrides3, 2),
174
+ TrailingButtonContainer = _getOverrides4[0],
175
+ trailingButtonContainerProps = _getOverrides4[1];
176
+
177
+ if (action.label) {
178
+ return /*#__PURE__*/React.createElement(TrailingButtonContainer, trailingButtonContainerProps, /*#__PURE__*/React.createElement(Button, {
179
+ colors: {
180
+ backgroundColor: backgroundColor,
181
+ color: color
182
+ },
183
+ onClick: action.onClick,
184
+ size: BUTTON_SIZE.compact,
185
+ shape: BUTTON_SHAPE.pill
186
+ }, action.label));
187
+ }
188
+
189
+ return null;
190
+ }
191
+
192
+ export function Banner(_ref4) {
193
+ var action = _ref4.action,
194
+ artwork = _ref4.artwork,
195
+ children = _ref4.children,
196
+ _ref4$hierarchy = _ref4.hierarchy,
197
+ hierarchy = _ref4$hierarchy === void 0 ? HIERARCHY.low : _ref4$hierarchy,
198
+ _ref4$kind = _ref4.kind,
199
+ kind = _ref4$kind === void 0 ? KIND.info : _ref4$kind,
200
+ _ref4$overrides = _ref4.overrides,
201
+ overrides = _ref4$overrides === void 0 ? {} : _ref4$overrides,
202
+ _ref4$nested = _ref4.nested,
203
+ nested = _ref4$nested === void 0 ? false : _ref4$nested,
204
+ title = _ref4.title;
205
+
206
+ var _useStyletron5 = useStyletron(),
207
+ _useStyletron6 = _slicedToArray(_useStyletron5, 2),
208
+ theme = _useStyletron6[1];
209
+
210
+ var styles = hierarchy === HIERARCHY.high ? high(theme, kind) : low(theme, kind);
211
+ var actionPosition = action && action.position ? action.position : ACTION_POSITION.trailing;
212
+
213
+ var _getOverrides5 = getOverrides(overrides.Root, StyledRoot),
214
+ _getOverrides6 = _slicedToArray(_getOverrides5, 2),
215
+ Root = _getOverrides6[0],
216
+ rootProps = _getOverrides6[1];
217
+
218
+ var _getOverrides7 = getOverrides(overrides.LeadingContent, StyledLeadingContent),
219
+ _getOverrides8 = _slicedToArray(_getOverrides7, 2),
220
+ LeadingContent = _getOverrides8[0],
221
+ leadingContentProps = _getOverrides8[1];
222
+
223
+ var _getOverrides9 = getOverrides(overrides.MessageContent, StyledMessageContent),
224
+ _getOverrides10 = _slicedToArray(_getOverrides9, 2),
225
+ MessageContent = _getOverrides10[0],
226
+ messageContentProps = _getOverrides10[1];
227
+
228
+ var _getOverrides11 = getOverrides(overrides.TrailingContent, StyledTrailingContent),
229
+ _getOverrides12 = _slicedToArray(_getOverrides11, 2),
230
+ TrailingContent = _getOverrides12[0],
231
+ trailingContentProps = _getOverrides12[1];
232
+
233
+ var _getOverrides13 = getOverrides(overrides.BelowContent, StyledBelowContent),
234
+ _getOverrides14 = _slicedToArray(_getOverrides13, 2),
235
+ BelowContent = _getOverrides14[0],
236
+ belowContentProps = _getOverrides14[1];
237
+
238
+ var _getOverrides15 = getOverrides(overrides.Title, StyledTitle),
239
+ _getOverrides16 = _slicedToArray(_getOverrides15, 2),
240
+ Title = _getOverrides16[0],
241
+ titleProps = _getOverrides16[1];
242
+
243
+ var _getOverrides17 = getOverrides(overrides.Message, StyledMessage),
244
+ _getOverrides18 = _slicedToArray(_getOverrides17, 2),
245
+ Message = _getOverrides18[0],
246
+ messageProps = _getOverrides18[1];
247
+
248
+ return /*#__PURE__*/React.createElement(Root, _extends({
249
+ $backgroundColor: styles.backgroundColor,
250
+ $color: styles.color,
251
+ $nested: nested
252
+ }, rootProps), /*#__PURE__*/React.createElement(LeadingContent, _extends({
253
+ $includesArtwork: Boolean(artwork)
254
+ }, leadingContentProps), /*#__PURE__*/React.createElement(Leading, {
255
+ artwork: artwork
256
+ })), /*#__PURE__*/React.createElement(MessageContent, _extends({
257
+ $actionPosition: actionPosition
258
+ }, messageContentProps), Boolean(title) && /*#__PURE__*/React.createElement(Title, titleProps, title), Boolean(children) && /*#__PURE__*/React.createElement(Message, messageProps, children)), /*#__PURE__*/React.createElement(TrailingContent, trailingContentProps, /*#__PURE__*/React.createElement(Trailing, {
259
+ action: action,
260
+ backgroundColor: styles.actionBackgroundColor,
261
+ color: styles.color,
262
+ overrides: overrides,
263
+ nested: nested
264
+ })), /*#__PURE__*/React.createElement(BelowContent, _extends({
265
+ $actionPosition: actionPosition
266
+ }, belowContentProps), /*#__PURE__*/React.createElement(Below, {
267
+ action: action,
268
+ backgroundColor: styles.actionBackgroundColor,
269
+ color: styles.color
270
+ })));
271
+ }
@@ -0,0 +1,24 @@
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
+ export var ACTION_POSITION = Object.freeze({
8
+ below: 'below',
9
+ trailing: 'trailing'
10
+ });
11
+ export var ARTWORK_TYPE = Object.freeze({
12
+ icon: 'icon',
13
+ badge: 'badge'
14
+ });
15
+ export var HIERARCHY = Object.freeze({
16
+ low: 'low',
17
+ high: 'high'
18
+ });
19
+ export var KIND = Object.freeze({
20
+ info: 'info',
21
+ negative: 'negative',
22
+ positive: 'positive',
23
+ warning: 'warning'
24
+ });
@@ -0,0 +1,9 @@
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
+ export { Banner } from './banner.js';
8
+ export * from './constants.js';
9
+ export * from './styled-components.js';
@@ -0,0 +1,113 @@
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
+ import { styled } from '../styles/index.js';
8
+ import { ACTION_POSITION } from './constants.js';
9
+ export var StyledRoot = styled('div', function (_ref) {
10
+ var $theme = _ref.$theme,
11
+ $backgroundColor = _ref.$backgroundColor,
12
+ $color = _ref.$color,
13
+ $nested = _ref.$nested;
14
+ var radius = $nested ? $theme.borders.radius300 : $theme.borders.radius400;
15
+ return {
16
+ backgroundColor: $backgroundColor,
17
+ borderStartStartRadius: radius,
18
+ borderStartEndRadius: radius,
19
+ borderEndStartRadius: radius,
20
+ borderEndEndRadius: radius,
21
+ color: $color,
22
+ display: 'grid',
23
+ gridColumnGap: $theme.sizing.scale600,
24
+ gridTemplateColumns: 'min-content auto min-content',
25
+ gridTemplateRows: 'auto min-content',
26
+ margin: $theme.sizing.scale600
27
+ };
28
+ });
29
+ StyledRoot.displayName = "StyledRoot";
30
+ export var StyledLeadingContent = styled('div', function (_ref2) {
31
+ var $theme = _ref2.$theme,
32
+ $includesArtwork = _ref2.$includesArtwork;
33
+ return {
34
+ alignItems: 'center',
35
+ display: 'flex',
36
+ paddingInlineStart: $includesArtwork ? $theme.sizing.scale600 : null
37
+ };
38
+ });
39
+ StyledLeadingContent.displayName = "StyledLeadingContent";
40
+ export var StyledMessageContent = styled('div', function (_ref3) {
41
+ var $theme = _ref3.$theme,
42
+ $actionPosition = _ref3.$actionPosition;
43
+ return {
44
+ display: 'flex',
45
+ flexDirection: 'column',
46
+ justifyContent: 'center',
47
+ paddingBlockStart: $theme.sizing.scale600,
48
+ paddingBlockEnd: $actionPosition === ACTION_POSITION.trailing ? $theme.sizing.scale600 : null
49
+ };
50
+ });
51
+ StyledMessageContent.displayName = "StyledMessageContent";
52
+ export var StyledTrailingContent = styled('div', function (_ref4) {
53
+ var $theme = _ref4.$theme;
54
+ return {
55
+ display: 'flex',
56
+ gridRowEnd: 'span 2',
57
+ marginInlineStart: 'auto'
58
+ };
59
+ });
60
+ StyledTrailingContent.displayName = "StyledTrailingContent";
61
+ export var StyledBelowContent = styled('div', function (_ref5) {
62
+ var $theme = _ref5.$theme,
63
+ $actionPosition = _ref5.$actionPosition;
64
+ return {
65
+ gridColumnStart: 2,
66
+ paddingBlockStart: $actionPosition === ACTION_POSITION.below ? $theme.sizing.scale300 : null,
67
+ paddingBlockEnd: $actionPosition === ACTION_POSITION.below ? $theme.sizing.scale600 : null
68
+ };
69
+ });
70
+ StyledBelowContent.displayName = "StyledBelowContent";
71
+ export var StyledTitle = styled('div', function (_ref6) {
72
+ var $theme = _ref6.$theme;
73
+ return $theme.typography.LabelMedium;
74
+ });
75
+ StyledTitle.displayName = "StyledTitle";
76
+ export var StyledMessage = styled('div', function (_ref7) {
77
+ var $theme = _ref7.$theme;
78
+ return $theme.typography.ParagraphMedium;
79
+ });
80
+ StyledMessage.displayName = "StyledMessage";
81
+ export var StyledTrailingButtonContainer = styled('div', function (_ref8) {
82
+ var $theme = _ref8.$theme;
83
+ return {
84
+ display: 'flex',
85
+ alignItems: 'center',
86
+ paddingInlineEnd: $theme.sizing.scale600
87
+ };
88
+ });
89
+ StyledTrailingButtonContainer.displayName = "StyledTrailingButtonContainer";
90
+ export var StyledTrailingIconButton = styled('button', function (_ref9) {
91
+ var $theme = _ref9.$theme,
92
+ $nested = _ref9.$nested;
93
+ var radius = $nested ? $theme.borders.radius300 : $theme.borders.radius400;
94
+ return {
95
+ alignItems: 'center',
96
+ background: 'none',
97
+ border: 'none',
98
+ borderStartEndRadius: radius,
99
+ borderEndEndRadius: radius,
100
+ color: 'inherit',
101
+ cursor: 'pointer',
102
+ display: 'flex',
103
+ paddingInlineStart: $theme.sizing.scale600,
104
+ paddingInlineEnd: $theme.sizing.scale600,
105
+ ':hover': {
106
+ boxShadow: 'inset 999px 999px 0px rgba(0, 0, 0, 0.04)'
107
+ },
108
+ ':active': {
109
+ boxShadow: 'inset 999px 999px 0px rgba(0, 0, 0, 0.08)'
110
+ }
111
+ };
112
+ });
113
+ StyledTrailingIconButton.displayName = "StyledTrailingIconButton";
@@ -0,0 +1,8 @@
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
+ import * as React from 'react';
8
+ import { ACTION_POSITION, ARTWORK_TYPE, HIERARCHY, KIND } from './constants.js';
@@ -76,7 +76,11 @@ export function Breadcrumbs(props) {
76
76
  }, baseListItemProps), child, (showTrailingSeparator || index !== childrenArray.length - 1) && /*#__PURE__*/React.createElement(Separator, _extends({}, baseSeparatorProps, {
77
77
  key: "separator-".concat(index)
78
78
  }), /*#__PURE__*/React.createElement(ThemeContext.Consumer, null, function (theme) {
79
- return theme.direction === 'rtl' ? /*#__PURE__*/React.createElement(Left, baseIconProps) : /*#__PURE__*/React.createElement(Right, baseIconProps);
79
+ return theme.direction === 'rtl' ? /*#__PURE__*/React.createElement(Left, _extends({
80
+ size: 16
81
+ }, baseIconProps)) : /*#__PURE__*/React.createElement(Right, _extends({
82
+ size: 16
83
+ }, baseIconProps));
80
84
  }))));
81
85
  });
82
86
  return /*#__PURE__*/React.createElement(LocaleContext.Consumer, null, function (locale) {
@@ -131,7 +131,8 @@ var Button = /*#__PURE__*/function (_React$Component) {
131
131
  endEnhancer = _this$props2.endEnhancer,
132
132
  children = _this$props2.children,
133
133
  forwardedRef = _this$props2.forwardedRef,
134
- restProps = _objectWithoutProperties(_this$props2, ["overrides", "size", "kind", "shape", "isLoading", "isSelected", "startEnhancer", "endEnhancer", "children", "forwardedRef"]); // Get overrides
134
+ colors = _this$props2.colors,
135
+ restProps = _objectWithoutProperties(_this$props2, ["overrides", "size", "kind", "shape", "isLoading", "isSelected", "startEnhancer", "endEnhancer", "children", "forwardedRef", "colors"]); // Get overrides
135
136
 
136
137
 
137
138
  var _getOverrides = getOverrides( // adding both (1) BaseButton and (2) Root
@@ -86,7 +86,7 @@ var DateHelpers = function DateHelpers(_adapter) {
86
86
  var UtilsClass = adapter.constructor;
87
87
  var className = adapter.constructor.name; // This ensures that if the adapter class isn't
88
88
  // supported it just falls back the default formats
89
- // NOTE: in e2e tests puppeteer seems to add
89
+ // NOTE: in e2e tests playwright seems to add
90
90
  // a JSHandle wrapping class to all objects
91
91
  // so className always resolves to JSHandle:e
92
92
  // and if falls back to the default
@@ -17,7 +17,9 @@ This source code is licensed under the MIT license found in the
17
17
  LICENSE file in the root directory of this source tree.
18
18
  */
19
19
  import * as React from 'react';
20
- import { ArrowLeft, ArrowRight, Check } from '../icon/index.js';
20
+ import ArrowLeft from '../icon/arrow-left.js';
21
+ import ArrowRight from '../icon/arrow-right.js';
22
+ import Check from '../icon/check.js';
21
23
  import { Button, KIND, SHAPE } from '../button/index.js';
22
24
  import { useStyletron } from '../styles/index.js';
23
25
  export function HelperSteps(_ref) {
@@ -85,7 +85,7 @@ var BaseInput = /*#__PURE__*/function (_React$Component) {
85
85
  });
86
86
 
87
87
  _defineProperty(_assertThisInitialized(_this), "onInputKeyDown", function (e) {
88
- if (_this.props.clearOnEscape && e.key === 'Escape' && _this.inputRef.current) {
88
+ if (_this.props.clearOnEscape && e.key === 'Escape' && _this.inputRef.current && !_this.props.readOnly) {
89
89
  _this.clearValue(); // prevent event from closing modal or doing something unexpected
90
90
 
91
91
 
@@ -100,19 +100,23 @@ var BaseInput = /*#__PURE__*/function (_React$Component) {
100
100
  });
101
101
 
102
102
  _defineProperty(_assertThisInitialized(_this), "onFocus", function (e) {
103
- _this.setState({
104
- isFocused: true
105
- });
103
+ if (!_this.props.readOnly) {
104
+ _this.setState({
105
+ isFocused: true
106
+ });
106
107
 
107
- _this.props.onFocus(e);
108
+ _this.props.onFocus(e);
109
+ }
108
110
  });
109
111
 
110
112
  _defineProperty(_assertThisInitialized(_this), "onBlur", function (e) {
111
- _this.setState({
112
- isFocused: false
113
- });
113
+ if (!_this.props.readOnly) {
114
+ _this.setState({
115
+ isFocused: false
116
+ });
114
117
 
115
- _this.props.onBlur(e);
118
+ _this.props.onBlur(e);
119
+ }
116
120
  });
117
121
 
118
122
  _defineProperty(_assertThisInitialized(_this), "handleFocusForMaskToggle", function (event) {
@@ -267,10 +271,11 @@ var BaseInput = /*#__PURE__*/function (_React$Component) {
267
271
  clearable = _this$props2.clearable,
268
272
  value = _this$props2.value,
269
273
  disabled = _this$props2.disabled,
274
+ readOnly = _this$props2.readOnly,
270
275
  _this$props2$override = _this$props2.overrides,
271
276
  overrides = _this$props2$override === void 0 ? {} : _this$props2$override;
272
277
 
273
- if (disabled || !clearable || value == null || typeof value === 'string' && value.length === 0) {
278
+ if (disabled || readOnly || !clearable || value == null || typeof value === 'string' && value.length === 0) {
274
279
  return null;
275
280
  }
276
281
 
@@ -360,6 +365,7 @@ var BaseInput = /*#__PURE__*/function (_React$Component) {
360
365
  "aria-required": this.props.required,
361
366
  autoComplete: autoComplete,
362
367
  disabled: this.props.disabled,
368
+ readOnly: this.props.readOnly,
363
369
  id: this.props.id,
364
370
  inputMode: this.props.inputMode,
365
371
  maxLength: this.props.maxLength,
@@ -419,7 +425,8 @@ _defineProperty(BaseInput, "defaultProps", {
419
425
  required: false,
420
426
  role: null,
421
427
  size: SIZE.default,
422
- type: 'text'
428
+ type: 'text',
429
+ readOnly: false
423
430
  });
424
431
 
425
432
  export default BaseInput;
@@ -70,23 +70,27 @@ var Input = /*#__PURE__*/function (_React$Component) {
70
70
  _this = _super.call.apply(_super, [this].concat(args));
71
71
 
72
72
  _defineProperty(_assertThisInitialized(_this), "state", {
73
- isFocused: _this.props.autoFocus || false
73
+ isFocused: _this.props.autoFocus && !_this.props.readOnly || false
74
74
  });
75
75
 
76
76
  _defineProperty(_assertThisInitialized(_this), "onFocus", function (e) {
77
- _this.setState({
78
- isFocused: true
79
- });
77
+ if (!_this.props.readOnly) {
78
+ _this.setState({
79
+ isFocused: true
80
+ });
80
81
 
81
- _this.props.onFocus(e);
82
+ _this.props.onFocus(e);
83
+ }
82
84
  });
83
85
 
84
86
  _defineProperty(_assertThisInitialized(_this), "onBlur", function (e) {
85
- _this.setState({
86
- isFocused: false
87
- });
87
+ if (!_this.props.readOnly) {
88
+ _this.setState({
89
+ isFocused: false
90
+ });
88
91
 
89
- _this.props.onBlur(e);
92
+ _this.props.onBlur(e);
93
+ }
90
94
  });
91
95
 
92
96
  return _this;
@@ -163,7 +167,8 @@ _defineProperty(Input, "defaultProps", {
163
167
  startEnhancer: null,
164
168
  endEnhancer: null,
165
169
  clearable: false,
166
- type: 'text'
170
+ type: 'text',
171
+ readOnly: false
167
172
  });
168
173
 
169
174
  function getAdjoinedProp(startEnhancer, endEnhancer) {
@@ -32,14 +32,16 @@ var MaskOverride = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
32
32
  onBlur = _ref.onBlur,
33
33
  value = _ref.value,
34
34
  disabled = _ref.disabled,
35
- restProps = _objectWithoutProperties(_ref, ["startEnhancer", "endEnhancer", "error", "positive", "onChange", "onFocus", "onBlur", "value", "disabled"]);
35
+ readOnly = _ref.readOnly,
36
+ restProps = _objectWithoutProperties(_ref, ["startEnhancer", "endEnhancer", "error", "positive", "onChange", "onFocus", "onBlur", "value", "disabled", "readOnly"]);
36
37
 
37
38
  return /*#__PURE__*/React.createElement(InputMask, _extends({
38
39
  onChange: onChange,
39
40
  onFocus: onFocus,
40
41
  onBlur: onBlur,
41
42
  value: value,
42
- disabled: disabled
43
+ disabled: disabled,
44
+ readOnly: readOnly
43
45
  }, restProps), function (props) {
44
46
  return /*#__PURE__*/React.createElement(StyledInput, _extends({
45
47
  ref: ref,
@@ -47,7 +49,8 @@ var MaskOverride = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
47
49
  onFocus: onFocus,
48
50
  onBlur: onBlur,
49
51
  value: value,
50
- disabled: disabled
52
+ disabled: disabled,
53
+ readOnly: readOnly
51
54
  }, props));
52
55
  });
53
56
  });
@@ -10,7 +10,8 @@ export function getSharedProps(props, state) {
10
10
  positive = props.positive,
11
11
  adjoined = props.adjoined,
12
12
  size = props.size,
13
- required = props.required;
13
+ required = props.required,
14
+ readOnly = props.readOnly;
14
15
  var isFocused = state.isFocused;
15
16
  return {
16
17
  $isFocused: isFocused,
@@ -19,6 +20,7 @@ export function getSharedProps(props, state) {
19
20
  $positive: positive,
20
21
  $adjoined: adjoined,
21
22
  $size: size,
22
- $required: required
23
+ $required: required,
24
+ $isReadOnly: readOnly
23
25
  };
24
26
  }