baseui 10.0.0 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/app-nav-bar/index.d.ts +24 -0
  2. package/app-nav-bar/mobile-menu.js +5 -3
  3. package/app-nav-bar/mobile-menu.js.flow +3 -2
  4. package/app-nav-bar/user-menu.js +5 -3
  5. package/app-nav-bar/user-menu.js.flow +3 -2
  6. package/block/index.d.ts +7 -0
  7. package/combobox/combobox.js +4 -9
  8. package/combobox/combobox.js.flow +4 -3
  9. package/combobox/index.d.ts +1 -1
  10. package/data-table/filter-menu.js +5 -3
  11. package/data-table/filter-menu.js.flow +3 -2
  12. package/data-table/header-cell.js +1 -1
  13. package/data-table/header-cell.js.flow +1 -1
  14. package/datepicker/calendar.js +6 -1
  15. package/datepicker/calendar.js.flow +4 -0
  16. package/datepicker/datepicker.js +1 -1
  17. package/datepicker/datepicker.js.flow +5 -2
  18. package/datepicker/index.d.ts +9 -1
  19. package/datepicker/month.js +2 -1
  20. package/datepicker/month.js.flow +8 -1
  21. package/datepicker/types.js.flow +13 -6
  22. package/es/app-nav-bar/mobile-menu.js +5 -5
  23. package/es/app-nav-bar/user-menu.js +5 -5
  24. package/es/combobox/combobox.js +4 -3
  25. package/es/data-table/filter-menu.js +3 -2
  26. package/es/data-table/header-cell.js +1 -1
  27. package/es/datepicker/calendar.js +6 -1
  28. package/es/datepicker/datepicker.js +1 -1
  29. package/es/datepicker/month.js +2 -1
  30. package/es/form-control/form-control.js +6 -14
  31. package/es/helper/helper.js +10 -6
  32. package/es/helpers/base-provider.js +4 -1
  33. package/es/input/input.js +9 -5
  34. package/es/layer/layer.js +5 -1
  35. package/es/layout-grid/grid.js +16 -10
  36. package/es/layout-grid/styled-components.js +24 -12
  37. package/es/list/index.js +1 -0
  38. package/es/list/list-heading.js +77 -0
  39. package/es/list/list-item.js +1 -1
  40. package/es/list/menu-adapter.js +4 -2
  41. package/es/list/styled-components.js +101 -4
  42. package/es/menu/stateful-container.js +41 -27
  43. package/es/phone-input/base-country-picker.js +2 -0
  44. package/es/popover/popover.js +21 -10
  45. package/es/select/select-component.js +34 -22
  46. package/es/table-semantic/styled-components.js +8 -10
  47. package/es/table-semantic/table-builder.js +3 -2
  48. package/es/table-semantic/table.js +1 -0
  49. package/es/tag/index.js +1 -1
  50. package/es/tag/styled-components.js +2 -4
  51. package/es/tag/tag.js +16 -16
  52. package/es/textarea/textarea.js +1 -2
  53. package/es/themes/dark-theme/color-semantic-tokens.js +18 -8
  54. package/es/themes/light-theme/color-semantic-tokens.js +14 -4
  55. package/es/tokens/colors.js +3 -3
  56. package/es/tree-view/tree-view.js +0 -2
  57. package/esm/app-nav-bar/mobile-menu.js +5 -3
  58. package/esm/app-nav-bar/user-menu.js +5 -3
  59. package/esm/combobox/combobox.js +4 -7
  60. package/esm/data-table/filter-menu.js +4 -3
  61. package/esm/data-table/header-cell.js +1 -1
  62. package/esm/datepicker/calendar.js +6 -1
  63. package/esm/datepicker/datepicker.js +1 -1
  64. package/esm/datepicker/month.js +2 -1
  65. package/esm/form-control/form-control.js +21 -33
  66. package/esm/helper/helper.js +10 -6
  67. package/esm/helpers/base-provider.js +4 -1
  68. package/esm/input/input.js +9 -5
  69. package/esm/layer/layer.js +5 -1
  70. package/esm/layout-grid/grid.js +20 -10
  71. package/esm/layout-grid/styled-components.js +52 -35
  72. package/esm/list/index.js +1 -0
  73. package/esm/list/list-heading.js +116 -0
  74. package/esm/list/list-item.js +1 -1
  75. package/esm/list/menu-adapter.js +4 -2
  76. package/esm/list/styled-components.js +99 -3
  77. package/esm/menu/stateful-container.js +56 -40
  78. package/esm/phone-input/base-country-picker.js +2 -0
  79. package/esm/popover/popover.js +25 -16
  80. package/esm/select/select-component.js +87 -79
  81. package/esm/table-semantic/styled-components.js +8 -10
  82. package/esm/table-semantic/table-builder.js +3 -2
  83. package/esm/table-semantic/table.js +1 -0
  84. package/esm/tag/index.js +1 -1
  85. package/esm/tag/styled-components.js +2 -4
  86. package/esm/tag/tag.js +18 -16
  87. package/esm/textarea/textarea.js +1 -2
  88. package/esm/themes/dark-theme/color-semantic-tokens.js +18 -8
  89. package/esm/themes/light-theme/color-semantic-tokens.js +14 -4
  90. package/esm/tokens/colors.js +3 -3
  91. package/esm/tree-view/tree-view.js +0 -2
  92. package/form-control/form-control.js +21 -35
  93. package/form-control/form-control.js.flow +37 -35
  94. package/helper/helper.js +10 -6
  95. package/helper/helper.js.flow +1 -0
  96. package/helpers/base-provider.js +5 -1
  97. package/helpers/base-provider.js.flow +4 -1
  98. package/index.d.ts +1 -0
  99. package/input/input.js +9 -5
  100. package/input/input.js.flow +9 -5
  101. package/layer/layer.js +5 -1
  102. package/layer/layer.js.flow +3 -1
  103. package/layer/types.js.flow +4 -0
  104. package/layout-grid/grid.js +19 -9
  105. package/layout-grid/grid.js.flow +52 -26
  106. package/layout-grid/index.d.ts +1 -0
  107. package/layout-grid/styled-components.js +54 -36
  108. package/layout-grid/styled-components.js.flow +48 -24
  109. package/layout-grid/types.js.flow +12 -0
  110. package/list/index.js +9 -0
  111. package/list/index.js.flow +1 -0
  112. package/list/list-heading.js +124 -0
  113. package/list/list-heading.js.flow +138 -0
  114. package/list/list-item.js +1 -1
  115. package/list/list-item.js.flow +1 -1
  116. package/list/menu-adapter.js +5 -2
  117. package/list/menu-adapter.js.flow +21 -11
  118. package/list/styled-components.js +108 -5
  119. package/list/styled-components.js.flow +103 -2
  120. package/list/types.js.flow +22 -0
  121. package/menu/stateful-container.js +57 -42
  122. package/menu/stateful-container.js.flow +38 -26
  123. package/package.json +1 -1
  124. package/phone-input/base-country-picker.js +2 -0
  125. package/phone-input/base-country-picker.js.flow +2 -0
  126. package/popover/popover.js +26 -17
  127. package/popover/popover.js.flow +19 -7
  128. package/select/select-component.js +87 -79
  129. package/select/select-component.js.flow +119 -103
  130. package/snackbar/index.d.ts +3 -3
  131. package/snackbar/types.js.flow +1 -1
  132. package/table-semantic/index.d.ts +1 -0
  133. package/table-semantic/styled-components.js +8 -10
  134. package/table-semantic/styled-components.js.flow +20 -20
  135. package/table-semantic/table-builder.js +3 -2
  136. package/table-semantic/table-builder.js.flow +3 -2
  137. package/table-semantic/table.js +1 -0
  138. package/table-semantic/table.js.flow +1 -0
  139. package/tag/index.d.ts +0 -1
  140. package/tag/index.js +0 -6
  141. package/tag/index.js.flow +0 -1
  142. package/tag/styled-components.js +3 -6
  143. package/tag/styled-components.js.flow +0 -2
  144. package/tag/tag.js +19 -14
  145. package/tag/tag.js.flow +13 -19
  146. package/textarea/textarea.js +1 -2
  147. package/textarea/textarea.js.flow +0 -1
  148. package/theme.ts +12 -0
  149. package/themes/dark-theme/color-semantic-tokens.js +18 -8
  150. package/themes/dark-theme/color-semantic-tokens.js.flow +18 -7
  151. package/themes/light-theme/color-semantic-tokens.js +14 -4
  152. package/themes/light-theme/color-semantic-tokens.js.flow +14 -3
  153. package/themes/types.js.flow +11 -0
  154. package/toast/index.d.ts +1 -0
  155. package/tokens/colors.js +3 -3
  156. package/tokens/colors.js.flow +3 -3
  157. package/tree-view/tree-view.js +0 -2
  158. package/tree-view/tree-view.js.flow +0 -1
  159. package/es/utils/get-bui-id.js +0 -33
  160. package/esm/utils/get-bui-id.js +0 -33
  161. package/utils/get-bui-id.js +0 -41
  162. package/utils/get-bui-id.js.flow +0 -39
@@ -58,7 +58,7 @@ export const StyledTable = styled<StyledTablePropsT>(
58
58
  'table',
59
59
  ({$theme, $width}) => {
60
60
  return {
61
- borderCollapse: 'collapse',
61
+ borderSpacing: '0',
62
62
  boxSizing: 'border-box',
63
63
  minWidth: '100%',
64
64
  width: $width || null,
@@ -197,24 +197,8 @@ type StyledTableBodyRowPropsT = {
197
197
 
198
198
  export const StyledTableBodyRow = styled<StyledTableBodyRowPropsT>(
199
199
  'tr',
200
- ({$theme, $divider}) => {
201
- const borderHorizontal =
202
- $divider === undefined ||
203
- $divider === DIVIDER.horizontal ||
204
- $divider === DIVIDER.grid;
205
-
200
+ ({$theme}) => {
206
201
  return {
207
- ':not(:last-child)': {
208
- borderBottomColor: borderHorizontal
209
- ? $theme.borders.border300.borderColor
210
- : null,
211
- borderBottomStyle: borderHorizontal
212
- ? $theme.borders.border300.borderStyle
213
- : null,
214
- borderBottomWidth: borderHorizontal
215
- ? $theme.borders.border300.borderWidth
216
- : null,
217
- },
218
202
  ':hover': {
219
203
  backgroundColor: $theme.colors.tableStripedBackground,
220
204
  },
@@ -230,14 +214,19 @@ type StyledTableBodyCellPropsT = {
230
214
  $rowIndex?: ?number,
231
215
  $size?: SizeT,
232
216
  $isNumeric?: ?boolean,
217
+ $isLastRow?: ?boolean,
233
218
  };
234
219
 
235
220
  export const StyledTableBodyCell = styled<StyledTableBodyCellPropsT>(
236
221
  'td',
237
- ({$theme, $size, $divider, $isNumeric}) => {
222
+ ({$theme, $size, $divider, $isNumeric, $isLastRow}) => {
238
223
  const borderDir: string = $theme.direction === 'rtl' ? 'Left' : 'Right';
239
224
  const borderVertical =
240
225
  $divider === DIVIDER.vertical || $divider === DIVIDER.grid;
226
+ const borderHorizontal =
227
+ $divider === undefined ||
228
+ $divider === DIVIDER.horizontal ||
229
+ $divider === DIVIDER.grid;
241
230
  const padding = sizeToCellPadding($theme, $size);
242
231
 
243
232
  return {
@@ -249,7 +238,18 @@ export const StyledTableBodyCell = styled<StyledTableBodyCellPropsT>(
249
238
  color: $theme.colors.contentPrimary,
250
239
  textAlign: $isNumeric ? 'right' : null,
251
240
  verticalAlign: 'top',
252
-
241
+ borderBottomColor:
242
+ !$isLastRow && borderHorizontal
243
+ ? $theme.borders.border300.borderColor
244
+ : null,
245
+ borderBottomStyle:
246
+ !$isLastRow && borderHorizontal
247
+ ? $theme.borders.border300.borderStyle
248
+ : null,
249
+ borderBottomWidth:
250
+ !$isLastRow && borderHorizontal
251
+ ? $theme.borders.border300.borderWidth
252
+ : null,
253
253
  ':not(:last-child)': {
254
254
  [`border${borderDir}Color`]: borderVertical
255
255
  ? $theme.borders.border300.borderColor
@@ -266,7 +266,7 @@ var TableBuilder = /*#__PURE__*/function (_React$Component) {
266
266
  }, tableHeadCellSortableProps, colTableHeadCellSortableProps), col.header, sortIcon);
267
267
  }
268
268
 
269
- function renderCell(col, colIndex, row, rowIndex) {
269
+ function renderCell(col, colIndex, row, rowIndex, lastRowindex) {
270
270
  var colOverrides = col.overrides || {};
271
271
 
272
272
  var _getOverrides33 = (0, _overrides.getOverrides)(colOverrides.TableBodyCell, TableBodyCell),
@@ -282,6 +282,7 @@ var TableBuilder = /*#__PURE__*/function (_React$Component) {
282
282
  $row: row,
283
283
  $rowIndex: rowIndex,
284
284
  $isNumeric: col.numeric,
285
+ $isLastRow: rowIndex === lastRowindex,
285
286
  $size: size
286
287
  }, tableBodyCellProps, colTableBodyCellProps), col.children(row, rowIndex));
287
288
  }
@@ -309,7 +310,7 @@ var TableBuilder = /*#__PURE__*/function (_React$Component) {
309
310
  $row: row,
310
311
  $rowIndex: rowIndex
311
312
  }, tableBodyRowProps), columns.map(function (col, colIndex) {
312
- return renderCell(col, colIndex, row, rowIndex);
313
+ return renderCell(col, colIndex, row, rowIndex, data.length - 1);
313
314
  }));
314
315
  }))));
315
316
  }
@@ -231,7 +231,7 @@ export default class TableBuilder<T> extends React.Component<
231
231
  );
232
232
  }
233
233
 
234
- function renderCell(col, colIndex, row, rowIndex) {
234
+ function renderCell(col, colIndex, row, rowIndex, lastRowindex) {
235
235
  const colOverrides = col.overrides || {};
236
236
 
237
237
  const [ColTableBodyCell, colTableBodyCellProps] = getOverrides(
@@ -248,6 +248,7 @@ export default class TableBuilder<T> extends React.Component<
248
248
  $row={row}
249
249
  $rowIndex={rowIndex}
250
250
  $isNumeric={col.numeric}
251
+ $isLastRow={rowIndex === lastRowindex}
251
252
  $size={size}
252
253
  {...tableBodyCellProps}
253
254
  {...colTableBodyCellProps}
@@ -313,7 +314,7 @@ export default class TableBuilder<T> extends React.Component<
313
314
  {...tableBodyRowProps}
314
315
  >
315
316
  {columns.map((col, colIndex) =>
316
- renderCell(col, colIndex, row, rowIndex),
317
+ renderCell(col, colIndex, row, rowIndex, data.length - 1),
317
318
  )}
318
319
  </TableBodyRow>
319
320
  ))}
@@ -167,6 +167,7 @@ var Table = /*#__PURE__*/function (_React$Component) {
167
167
  $divider: divider,
168
168
  $row: row,
169
169
  $rowIndex: rowIndex,
170
+ $isLastRow: rowIndex === data.length - 1,
170
171
  $size: size
171
172
  }, tableBodyCellProps), row[colIndex]);
172
173
  }));
@@ -155,6 +155,7 @@ export default class Table extends React.Component<TablePropsT> {
155
155
  $divider={divider}
156
156
  $row={row}
157
157
  $rowIndex={rowIndex}
158
+ $isLastRow={rowIndex === data.length - 1}
158
159
  $size={size}
159
160
  {...tableBodyCellProps}
160
161
  >
package/tag/index.d.ts CHANGED
@@ -67,7 +67,6 @@ export class Tag extends React.Component<TagProps> {
67
67
 
68
68
  export const StyledRoot: StyletronComponent<any>;
69
69
  export const StyledAction: StyletronComponent<any>;
70
- export const StyledActionIcon: StyletronComponent<any>;
71
70
  export const StyledText: StyletronComponent<any>;
72
71
 
73
72
  export const KIND: KIND;
package/tag/index.js CHANGED
@@ -21,12 +21,6 @@ Object.defineProperty(exports, "StyledAction", {
21
21
  return _styledComponents.Action;
22
22
  }
23
23
  });
24
- Object.defineProperty(exports, "StyledActionIcon", {
25
- enumerable: true,
26
- get: function get() {
27
- return _styledComponents.ActionIcon;
28
- }
29
- });
30
24
  Object.defineProperty(exports, "StyledText", {
31
25
  enumerable: true,
32
26
  get: function get() {
package/tag/index.js.flow CHANGED
@@ -10,7 +10,6 @@ export {default as Tag} from './tag.js';
10
10
  export {
11
11
  Root as StyledRoot,
12
12
  Action as StyledAction,
13
- ActionIcon as StyledActionIcon,
14
13
  Text as StyledText,
15
14
  } from './styled-components.js';
16
15
  export {KIND, VARIANT, SIZE} from './constants.js';
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.customOnRamp = customOnRamp;
7
- exports.Root = exports.Text = exports.StartEnhancerContainer = exports.ActionIcon = exports.Action = void 0;
7
+ exports.Root = exports.Text = exports.StartEnhancerContainer = exports.Action = void 0;
8
8
 
9
9
  var _tint = _interopRequireDefault(require("polished/lib/color/tint.js"));
10
10
 
@@ -288,13 +288,10 @@ var Action = (0, _index.styled)('span', function (props) {
288
288
  return _ref = {
289
289
  alignItems: 'center'
290
290
  }, _defineProperty(_ref, bottomRadiusDir, $theme.borders.useRoundedCorners ? $theme.borders.radius400 : 0), _defineProperty(_ref, topRadiusDir, $theme.borders.useRoundedCorners ? $theme.borders.radius400 : 0), _defineProperty(_ref, "cursor", $disabled ? 'not-allowed' : 'pointer'), _defineProperty(_ref, "display", 'flex'), _defineProperty(_ref, marginDir, (_SIZE$small$SIZE$medi = {}, _defineProperty(_SIZE$small$SIZE$medi, _constants.SIZE.small, '8px'), _defineProperty(_SIZE$small$SIZE$medi, _constants.SIZE.medium, '12px'), _defineProperty(_SIZE$small$SIZE$medi, _constants.SIZE.large, '16px'), _SIZE$small$SIZE$medi)[$size]), _defineProperty(_ref, "outline", 'none'), _defineProperty(_ref, "transitionProperty", 'all'), _defineProperty(_ref, "transitionDuration", 'background-color'), _defineProperty(_ref, "transitionTimingFunction", $theme.animation.easeOutCurve), _ref;
291
- });
291
+ }); // $FlowFixMe https://github.com/facebook/flow/issues/7745
292
+
292
293
  exports.Action = Action;
293
294
  Action.displayName = "Action";
294
- var ActionIcon = (0, _index.styled)('svg', {}); // $FlowFixMe https://github.com/facebook/flow/issues/7745
295
-
296
- exports.ActionIcon = ActionIcon;
297
- ActionIcon.displayName = "ActionIcon";
298
295
  var StartEnhancerContainer = (0, _index.styled)('div', function (_ref2) {
299
296
  var $theme = _ref2.$theme,
300
297
  _ref2$$size = _ref2.$size,
@@ -290,8 +290,6 @@ export const Action = styled<SharedPropsArgT>('span', props => {
290
290
  }: {});
291
291
  });
292
292
 
293
- export const ActionIcon = styled('svg', {});
294
-
295
293
  // $FlowFixMe https://github.com/facebook/flow/issues/7745
296
294
  export const StartEnhancerContainer = styled<SharedPropsArgT>(
297
295
  'div',
package/tag/tag.js CHANGED
@@ -17,14 +17,16 @@ var _constants = require("./constants.js");
17
17
 
18
18
  var _utils = require("./utils.js");
19
19
 
20
+ var _delete = _interopRequireDefault(require("../icon/delete.js"));
21
+
20
22
  var _focusVisible = require("../utils/focusVisible.js");
21
23
 
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+
22
26
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
23
27
 
24
28
  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; }
25
29
 
26
- 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); }
27
-
28
30
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
31
 
30
32
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -39,6 +41,16 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
39
41
 
40
42
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
43
 
44
+ 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); }
45
+
46
+ // Previously, Tag used a hardcoded SVG as its 'close' icon. Replacing it with
47
+ // Delete requires modifying Delete's viewbox to prevent visual regressions.
48
+ var ModifiedViewBoxDeleteIcon = function ModifiedViewBoxDeleteIcon(props) {
49
+ return /*#__PURE__*/React.createElement(_delete.default, _extends({
50
+ viewBox: "5 5 13.186 13.186"
51
+ }, props));
52
+ };
53
+
42
54
  var Tag = /*#__PURE__*/React.forwardRef(function (props, ref) {
43
55
  var _SIZE$small$SIZE$medi;
44
56
 
@@ -119,7 +131,7 @@ var Tag = /*#__PURE__*/React.forwardRef(function (props, ref) {
119
131
  Action = _getOverrides4[0],
120
132
  actionProps = _getOverrides4[1];
121
133
 
122
- var _getOverrides5 = (0, _overrides.getOverrides)(overrides.ActionIcon, _styledComponents.ActionIcon),
134
+ var _getOverrides5 = (0, _overrides.getOverrides)(overrides.ActionIcon, ModifiedViewBoxDeleteIcon),
123
135
  _getOverrides6 = _slicedToArray(_getOverrides5, 2),
124
136
  ActionIcon = _getOverrides6[0],
125
137
  actionIconProps = _getOverrides6[1];
@@ -160,7 +172,7 @@ var Tag = /*#__PURE__*/React.forwardRef(function (props, ref) {
160
172
  };
161
173
  var titleText = title || (0, _utils.getTextFromChildren)(children);
162
174
  var isButton = (clickable || closeable) && !disabled;
163
- var actionSize = (_SIZE$small$SIZE$medi = {}, _defineProperty(_SIZE$small$SIZE$medi, _constants.SIZE.small, '12'), _defineProperty(_SIZE$small$SIZE$medi, _constants.SIZE.medium, '16'), _defineProperty(_SIZE$small$SIZE$medi, _constants.SIZE.large, '20'), _SIZE$small$SIZE$medi)[size]; // Capitalize for JSX
175
+ var actionSize = (_SIZE$small$SIZE$medi = {}, _defineProperty(_SIZE$small$SIZE$medi, _constants.SIZE.small, 12), _defineProperty(_SIZE$small$SIZE$medi, _constants.SIZE.medium, 16), _defineProperty(_SIZE$small$SIZE$medi, _constants.SIZE.large, 20), _SIZE$small$SIZE$medi)[size]; // Capitalize for JSX
164
176
 
165
177
  var StartEnhancer = startEnhancer;
166
178
  return /*#__PURE__*/React.createElement(Root // eslint-disable-next-line flowtype/no-weak-types
@@ -174,21 +186,14 @@ var Tag = /*#__PURE__*/React.forwardRef(function (props, ref) {
174
186
  }, rootHandlers, sharedProps, rootProps, {
175
187
  onFocus: (0, _focusVisible.forkFocus)(rootProps, handleFocus),
176
188
  onBlur: (0, _focusVisible.forkBlur)(rootProps, handleBlur)
177
- }), StartEnhancer && /*#__PURE__*/React.createElement(StartEnhancerContainer, startEnhancerContainerProps, /*#__PURE__*/React.createElement(StartEnhancer, null)), /*#__PURE__*/React.createElement(Text, _extends({
189
+ }), StartEnhancer && StartEnhancer !== 0 && /*#__PURE__*/React.createElement(StartEnhancerContainer, startEnhancerContainerProps, /*#__PURE__*/React.createElement(StartEnhancer, null)), /*#__PURE__*/React.createElement(Text, _extends({
178
190
  title: titleText
179
191
  }, textProps), children), closeable ? /*#__PURE__*/React.createElement(Action, _extends({
180
192
  "aria-hidden": true,
181
193
  role: "presentation"
182
194
  }, actionHandlers, sharedProps, actionProps), /*#__PURE__*/React.createElement(ActionIcon, _extends({
183
- width: actionSize,
184
- height: actionSize,
185
- viewBox: "0 0 24 24",
186
- fill: "none",
187
- xmlns: "http://www.w3.org/2000/svg"
188
- }, actionIconProps), /*#__PURE__*/React.createElement("path", {
189
- fill: "currentColor",
190
- d: "M21.0999 5.09998L18.8999 2.90002L11.9999 9.90002L5.09985 2.90002L2.8999 5.09998L9.8999 12L2.8999 18.9L5.09985 21.1L11.9999 14.1L18.8999 21.1L21.0999 18.9L14.0999 12L21.0999 5.09998Z"
191
- }))) : null);
195
+ size: actionSize
196
+ }, actionIconProps))) : null);
192
197
  });
193
198
  Tag.displayName = 'Tag';
194
199
  var _default = Tag;
package/tag/tag.js.flow CHANGED
@@ -10,15 +10,21 @@ import {getOverrides} from '../helpers/overrides.js';
10
10
  import {
11
11
  Action as StyledAction,
12
12
  Root as StyledRoot,
13
- ActionIcon as StyledActionIcon,
14
13
  StartEnhancerContainer as StyledStartEnhancerContainer,
15
14
  Text as StyledText,
16
15
  } from './styled-components.js';
17
16
  import {KIND, VARIANT, SIZE} from './constants.js';
18
17
  import {getTextFromChildren} from './utils.js';
19
18
  import type {PropsT, SharedPropsArgT} from './types.js';
19
+ import DeleteIcon from '../icon/delete.js';
20
20
  import {isFocusVisible, forkFocus, forkBlur} from '../utils/focusVisible.js';
21
21
 
22
+ // Previously, Tag used a hardcoded SVG as its 'close' icon. Replacing it with
23
+ // Delete requires modifying Delete's viewbox to prevent visual regressions.
24
+ const ModifiedViewBoxDeleteIcon = props => (
25
+ <DeleteIcon viewBox="5 5 13.186 13.186" {...props} />
26
+ );
27
+
22
28
  const Tag = React.forwardRef<PropsT, HTMLSpanElement>((props, ref) => {
23
29
  const {
24
30
  children,
@@ -73,7 +79,7 @@ const Tag = React.forwardRef<PropsT, HTMLSpanElement>((props, ref) => {
73
79
  const [Action, actionProps] = getOverrides(overrides.Action, StyledAction);
74
80
  const [ActionIcon, actionIconProps] = getOverrides(
75
81
  overrides.ActionIcon,
76
- StyledActionIcon,
82
+ ModifiedViewBoxDeleteIcon,
77
83
  );
78
84
  const [StartEnhancerContainer, startEnhancerContainerProps] = getOverrides(
79
85
  overrides.StartEnhancerContainer,
@@ -111,9 +117,9 @@ const Tag = React.forwardRef<PropsT, HTMLSpanElement>((props, ref) => {
111
117
  const titleText = title || getTextFromChildren(children);
112
118
  const isButton = (clickable || closeable) && !disabled;
113
119
  const actionSize = {
114
- [SIZE.small]: '12',
115
- [SIZE.medium]: '16',
116
- [SIZE.large]: '20',
120
+ [SIZE.small]: 12,
121
+ [SIZE.medium]: 16,
122
+ [SIZE.large]: 20,
117
123
  }[size];
118
124
 
119
125
  // Capitalize for JSX
@@ -140,7 +146,7 @@ const Tag = React.forwardRef<PropsT, HTMLSpanElement>((props, ref) => {
140
146
  onFocus={forkFocus(rootProps, handleFocus)}
141
147
  onBlur={forkBlur(rootProps, handleBlur)}
142
148
  >
143
- {StartEnhancer && (
149
+ {StartEnhancer && StartEnhancer !== 0 && (
144
150
  <StartEnhancerContainer {...startEnhancerContainerProps}>
145
151
  <StartEnhancer />
146
152
  </StartEnhancerContainer>
@@ -157,19 +163,7 @@ const Tag = React.forwardRef<PropsT, HTMLSpanElement>((props, ref) => {
157
163
  {...sharedProps}
158
164
  {...actionProps}
159
165
  >
160
- <ActionIcon
161
- width={actionSize}
162
- height={actionSize}
163
- viewBox="0 0 24 24"
164
- fill="none"
165
- xmlns="http://www.w3.org/2000/svg"
166
- {...actionIconProps}
167
- >
168
- <path
169
- fill="currentColor"
170
- d="M21.0999 5.09998L18.8999 2.90002L11.9999 9.90002L5.09985 2.90002L2.8999 5.09998L9.8999 12L2.8999 18.9L5.09985 21.1L11.9999 14.1L18.8999 21.1L21.0999 18.9L14.0999 12L21.0999 5.09998Z"
171
- />
172
- </ActionIcon>
166
+ <ActionIcon size={actionSize} {...actionIconProps} />
173
167
  </Action>
174
168
  ) : null}
175
169
  </Root>
@@ -147,8 +147,7 @@ _defineProperty(Textarea, "defaultProps", {
147
147
  placeholder: '',
148
148
  required: false,
149
149
  rows: 3,
150
- size: _index.SIZE.default,
151
- value: ''
150
+ size: _index.SIZE.default
152
151
  });
153
152
 
154
153
  var _default = Textarea;
@@ -32,7 +32,6 @@ class Textarea extends React.Component<TextareaPropsT, {isFocused: boolean}> {
32
32
  required: false,
33
33
  rows: 3,
34
34
  size: SIZE.default,
35
- value: '',
36
35
  };
37
36
 
38
37
  state = {
package/theme.ts CHANGED
@@ -186,6 +186,17 @@ export interface Colors {
186
186
  borderWarning: string;
187
187
  borderPositive: string;
188
188
 
189
+ // Programs
190
+ safety: string;
191
+ eatsGreen400: string;
192
+ freightBlue400: string;
193
+ jumpRed400: string;
194
+ rewardsTier1: string;
195
+ rewardsTier2: string;
196
+ rewardsTier3: string;
197
+ rewardsTier4: string;
198
+ membership: string;
199
+
189
200
  /* ---- End of Semantic Colors ---- */
190
201
 
191
202
  /* ---- Deprecated Semantic Colors ---- */
@@ -274,6 +285,7 @@ export interface Colors {
274
285
  calendarDayForegroundPseudoSelected: string;
275
286
  calendarDayBackgroundPseudoSelectedHighlighted: string;
276
287
  calendarDayForegroundPseudoSelectedHighlighted: string;
288
+ calendarDayBackgroundSelected: string;
277
289
  calendarDayForegroundSelected: string;
278
290
  calendarDayBackgroundSelectedHighlighted: string;
279
291
  calendarDayForegroundSelectedHighlighted: string;
@@ -29,12 +29,12 @@ var _default = function _default() {
29
29
  backgroundInversePrimary: foundation.primaryA,
30
30
  backgroundInverseSecondary: _colors.default.gray300,
31
31
  // Content
32
- contentPrimary: foundation.primaryA,
33
- contentSecondary: _colors.default.gray400,
34
- contentTertiary: _colors.default.gray500,
35
- contentInversePrimary: foundation.primaryB,
36
- contentInverseSecondary: _colors.default.gray600,
37
- contentInverseTertiary: _colors.default.gray500,
32
+ contentPrimary: _colors.default.white,
33
+ contentSecondary: _colors.default.gray300,
34
+ contentTertiary: _colors.default.gray400,
35
+ contentInversePrimary: _colors.default.black,
36
+ contentInverseSecondary: _colors.default.gray700,
37
+ contentInverseTertiary: _colors.default.gray600,
38
38
  // Border
39
39
  borderOpaque: _colors.default.gray700,
40
40
  borderTransparent: (0, _util.hexToRgb)(foundation.primaryA, '0.08'),
@@ -51,7 +51,7 @@ var _default = function _default() {
51
51
  backgroundAccent: foundation.accent,
52
52
  backgroundNegative: foundation.negative,
53
53
  backgroundWarning: foundation.warning,
54
- backgroundPositive: foundation.positive,
54
+ backgroundPositive: _colors.default.green500,
55
55
  backgroundLightAccent: _colors.default.blue700,
56
56
  backgroundLightPositive: _colors.default.green700,
57
57
  backgroundLightNegative: _colors.default.red700,
@@ -72,7 +72,17 @@ var _default = function _default() {
72
72
  borderAccentLight: _colors.default.blue500,
73
73
  borderNegative: _colors.default.red500,
74
74
  borderWarning: _colors.default.yellow500,
75
- borderPositive: _colors.default.green500
75
+ borderPositive: _colors.default.green500,
76
+ // Programs
77
+ safety: _colors.default.blue400,
78
+ eatsGreen400: _colors.default.green400,
79
+ freightBlue400: _colors.default.cobalt400,
80
+ jumpRed400: _colors.default.red400,
81
+ rewardsTier1: _colors.default.blue400,
82
+ rewardsTier2: _colors.default.yellow400,
83
+ rewardsTier3: _colors.default.platinum400,
84
+ rewardsTier4: _colors.default.gray200,
85
+ membership: _colors.default.yellow600
76
86
  };
77
87
  return _objectSpread(_objectSpread({}, core), coreExtensions);
78
88
  };
@@ -28,12 +28,12 @@ export default (
28
28
  backgroundInverseSecondary: colors.gray300,
29
29
 
30
30
  // Content
31
- contentPrimary: foundation.primaryA,
32
- contentSecondary: colors.gray400,
33
- contentTertiary: colors.gray500,
34
- contentInversePrimary: foundation.primaryB,
35
- contentInverseSecondary: colors.gray600,
36
- contentInverseTertiary: colors.gray500,
31
+ contentPrimary: colors.white,
32
+ contentSecondary: colors.gray300,
33
+ contentTertiary: colors.gray400,
34
+ contentInversePrimary: colors.black,
35
+ contentInverseSecondary: colors.gray700,
36
+ contentInverseTertiary: colors.gray600,
37
37
 
38
38
  // Border
39
39
  borderOpaque: colors.gray700,
@@ -52,7 +52,7 @@ export default (
52
52
  backgroundAccent: foundation.accent,
53
53
  backgroundNegative: foundation.negative,
54
54
  backgroundWarning: foundation.warning,
55
- backgroundPositive: foundation.positive,
55
+ backgroundPositive: colors.green500,
56
56
  backgroundLightAccent: colors.blue700,
57
57
  backgroundLightPositive: colors.green700,
58
58
  backgroundLightNegative: colors.red700,
@@ -76,6 +76,17 @@ export default (
76
76
  borderNegative: colors.red500,
77
77
  borderWarning: colors.yellow500,
78
78
  borderPositive: colors.green500,
79
+
80
+ // Programs
81
+ safety: colors.blue400,
82
+ eatsGreen400: colors.green400,
83
+ freightBlue400: colors.cobalt400,
84
+ jumpRed400: colors.red400,
85
+ rewardsTier1: colors.blue400,
86
+ rewardsTier2: colors.yellow400,
87
+ rewardsTier3: colors.platinum400,
88
+ rewardsTier4: colors.gray200,
89
+ membership: colors.yellow600,
79
90
  };
80
91
 
81
92
  return {
@@ -51,7 +51,7 @@ var _default = function _default() {
51
51
  backgroundAccent: foundation.accent,
52
52
  backgroundNegative: foundation.negative,
53
53
  backgroundWarning: foundation.warning,
54
- backgroundPositive: foundation.positive,
54
+ backgroundPositive: _colors.default.green400,
55
55
  backgroundLightAccent: _colors.default.blue50,
56
56
  backgroundLightNegative: _colors.default.red50,
57
57
  backgroundLightWarning: _colors.default.yellow50,
@@ -64,15 +64,25 @@ var _default = function _default() {
64
64
  contentOnColor: _colors.default.white,
65
65
  contentOnColorInverse: _colors.default.black,
66
66
  contentNegative: foundation.negative,
67
- contentWarning: _colors.default.yellow700,
68
- contentPositive: foundation.positive,
67
+ contentWarning: _colors.default.yellow600,
68
+ contentPositive: _colors.default.green400,
69
69
  // Border
70
70
  borderStateDisabled: _colors.default.gray50,
71
71
  borderAccent: _colors.default.blue400,
72
72
  borderAccentLight: _colors.default.blue200,
73
73
  borderNegative: _colors.default.red200,
74
74
  borderWarning: _colors.default.yellow200,
75
- borderPositive: _colors.default.green200
75
+ borderPositive: _colors.default.green200,
76
+ // Programs
77
+ safety: _colors.default.blue400,
78
+ eatsGreen400: _colors.default.green400,
79
+ freightBlue400: _colors.default.cobalt400,
80
+ jumpRed400: _colors.default.red400,
81
+ rewardsTier1: _colors.default.blue400,
82
+ rewardsTier2: _colors.default.yellow400,
83
+ rewardsTier3: _colors.default.platinum400,
84
+ rewardsTier4: _colors.default.black,
85
+ membership: _colors.default.yellow600
76
86
  };
77
87
  return _objectSpread(_objectSpread({}, core), coreExtensions);
78
88
  };
@@ -52,7 +52,7 @@ export default (
52
52
  backgroundAccent: foundation.accent,
53
53
  backgroundNegative: foundation.negative,
54
54
  backgroundWarning: foundation.warning,
55
- backgroundPositive: foundation.positive,
55
+ backgroundPositive: colors.green400,
56
56
  backgroundLightAccent: colors.blue50,
57
57
  backgroundLightNegative: colors.red50,
58
58
  backgroundLightWarning: colors.yellow50,
@@ -66,8 +66,8 @@ export default (
66
66
  contentOnColor: colors.white,
67
67
  contentOnColorInverse: colors.black,
68
68
  contentNegative: foundation.negative,
69
- contentWarning: colors.yellow700,
70
- contentPositive: foundation.positive,
69
+ contentWarning: colors.yellow600,
70
+ contentPositive: colors.green400,
71
71
 
72
72
  // Border
73
73
  borderStateDisabled: colors.gray50,
@@ -76,6 +76,17 @@ export default (
76
76
  borderNegative: colors.red200,
77
77
  borderWarning: colors.yellow200,
78
78
  borderPositive: colors.green200,
79
+
80
+ // Programs
81
+ safety: colors.blue400,
82
+ eatsGreen400: colors.green400,
83
+ freightBlue400: colors.cobalt400,
84
+ jumpRed400: colors.red400,
85
+ rewardsTier1: colors.blue400,
86
+ rewardsTier2: colors.yellow400,
87
+ rewardsTier3: colors.platinum400,
88
+ rewardsTier4: colors.black,
89
+ membership: colors.yellow600,
79
90
  };
80
91
  return {
81
92
  ...core,
@@ -156,6 +156,17 @@ export type CoreExtensionSemanticColorTokensT = {|
156
156
  borderNegative: string,
157
157
  borderWarning: string,
158
158
  borderPositive: string,
159
+
160
+ // Programs
161
+ safety: string,
162
+ eatsGreen400: string,
163
+ freightBlue400: string,
164
+ jumpRed400: string,
165
+ rewardsTier1: string,
166
+ rewardsTier2: string,
167
+ rewardsTier3: string,
168
+ rewardsTier4: string,
169
+ membership: string,
159
170
  |};
160
171
 
161
172
  export type SemanticColorTokensT = {|
package/toast/index.d.ts CHANGED
@@ -54,6 +54,7 @@ export interface ToasterOverrides {
54
54
  Root?: Override<ToasterSharedStylePropsArg>;
55
55
  ToastBody?: Override<SharedStylePropsArg>;
56
56
  ToastCloseIcon?: Override<SharedStylePropsArg>;
57
+ ToastInnerContainer?: Override<SharedStylePropsArg>;
57
58
  }
58
59
  export interface ToasterProps {
59
60
  overrides?: ToasterOverrides;
package/tokens/colors.js CHANGED
@@ -18,7 +18,7 @@ var colors = {
18
18
  gray200: '#E2E2E2',
19
19
  gray300: '#CBCBCB',
20
20
  gray400: '#AFAFAF',
21
- gray500: '#757575',
21
+ gray500: '#6B6B6B',
22
22
  gray600: '#545454',
23
23
  gray700: '#333333',
24
24
  gray800: '#1F1F1F',
@@ -55,13 +55,13 @@ var colors = {
55
55
  yellow300: '#FFCF70',
56
56
  yellow400: '#FFC043',
57
57
  yellow500: '#BC8B2C',
58
- yellow600: '#997328',
58
+ yellow600: '#996F00',
59
59
  yellow700: '#674D1B',
60
60
  green50: '#E6F2ED',
61
61
  green100: '#ADDEC9',
62
62
  green200: '#66D19E',
63
63
  green300: '#06C167',
64
- green400: '#05944F',
64
+ green400: '#048848',
65
65
  green500: '#03703C',
66
66
  green600: '#03582F',
67
67
  green700: '#10462D',