baseui 10.2.1 → 10.6.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.
- package/button/styled-components.js +1 -1
- package/button/styled-components.js.flow +4 -1
- package/data-table/data-table.js +13 -3
- package/data-table/data-table.js.flow +20 -4
- package/data-table/types.js.flow +2 -1
- package/datepicker/calendar-header.js +227 -95
- package/datepicker/calendar-header.js.flow +270 -139
- package/datepicker/constants.js +4 -2
- package/datepicker/constants.js.flow +2 -0
- package/datepicker/day.js +1 -0
- package/datepicker/day.js.flow +1 -0
- package/datepicker/index.d.ts +1 -0
- package/datepicker/types.js.flow +1 -0
- package/datepicker/utils/calendar-header-helpers.js +51 -0
- package/datepicker/utils/calendar-header-helpers.js.flow +53 -0
- package/dnd-list/index.js.flow +2 -1
- package/drawer/close-icon.js +3 -2
- package/drawer/close-icon.js.flow +2 -2
- package/drawer/drawer.js +5 -2
- package/drawer/drawer.js.flow +2 -2
- package/es/button/styled-components.js +1 -1
- package/es/data-table/data-table.js +13 -3
- package/es/datepicker/calendar-header.js +184 -84
- package/es/datepicker/constants.js +2 -1
- package/es/datepicker/day.js +1 -0
- package/es/datepicker/utils/calendar-header-helpers.js +34 -0
- package/es/dnd-list/index.js +2 -1
- package/es/drawer/close-icon.js +3 -2
- package/es/drawer/drawer.js +5 -2
- package/es/list/list-heading.js +17 -6
- package/es/map-marker/constants.js +69 -0
- package/es/map-marker/fixed-marker.js +98 -0
- package/es/map-marker/floating-marker.js +65 -0
- package/es/map-marker/index.js +9 -0
- package/es/map-marker/pin-head.js +108 -0
- package/es/map-marker/styled-components.js +156 -0
- package/es/map-marker/types.js +8 -0
- package/es/popover/stateful-container.js +4 -0
- package/es/rating/emoticon-rating.js +3 -1
- package/es/rating/star-rating.js +3 -1
- package/es/select/select-component.js +20 -6
- package/es/select/styled-components.js +34 -4
- package/es/snackbar/snackbar-context.js +16 -4
- package/es/spinner/styled-components.js +1 -1
- package/es/table-semantic/styled-components.js +6 -4
- package/es/table-semantic/table-builder.js +3 -0
- package/es/themes/dark-theme/color-component-tokens.js +1 -1
- package/es/themes/dark-theme/color-semantic-tokens.js +8 -7
- package/es/themes/light-theme/color-component-tokens.js +9 -9
- package/es/themes/light-theme/color-semantic-tokens.js +3 -2
- package/es/tokens/colors.js +2 -2
- package/es/tooltip/styled-components.js +8 -0
- package/esm/button/styled-components.js +1 -1
- package/esm/data-table/data-table.js +13 -3
- package/esm/datepicker/calendar-header.js +226 -95
- package/esm/datepicker/constants.js +2 -1
- package/esm/datepicker/day.js +1 -0
- package/esm/datepicker/utils/calendar-header-helpers.js +45 -0
- package/esm/dnd-list/index.js +2 -1
- package/esm/drawer/close-icon.js +3 -2
- package/esm/drawer/drawer.js +5 -2
- package/esm/list/list-heading.js +17 -6
- package/esm/map-marker/constants.js +62 -0
- package/esm/map-marker/fixed-marker.js +137 -0
- package/esm/map-marker/floating-marker.js +94 -0
- package/esm/map-marker/index.js +9 -0
- package/esm/map-marker/pin-head.js +144 -0
- package/esm/map-marker/styled-components.js +168 -0
- package/esm/map-marker/types.js +8 -0
- package/esm/popover/stateful-container.js +4 -0
- package/esm/rating/emoticon-rating.js +2 -2
- package/esm/rating/star-rating.js +2 -2
- package/esm/select/select-component.js +19 -6
- package/esm/select/styled-components.js +28 -4
- package/esm/snackbar/snackbar-context.js +16 -4
- package/esm/spinner/styled-components.js +1 -1
- package/esm/table-semantic/styled-components.js +6 -4
- package/esm/table-semantic/table-builder.js +3 -0
- package/esm/themes/dark-theme/color-component-tokens.js +1 -1
- package/esm/themes/dark-theme/color-semantic-tokens.js +8 -7
- package/esm/themes/light-theme/color-component-tokens.js +9 -9
- package/esm/themes/light-theme/color-semantic-tokens.js +3 -2
- package/esm/tokens/colors.js +2 -2
- package/esm/tooltip/styled-components.js +8 -0
- package/index.d.ts +1 -0
- package/link/index.d.ts +1 -0
- package/list/index.d.ts +36 -0
- package/list/list-heading.js +24 -7
- package/list/list-heading.js.flow +17 -8
- package/map-marker/constants.js +82 -0
- package/map-marker/constants.js.flow +74 -0
- package/map-marker/fixed-marker.js +152 -0
- package/map-marker/fixed-marker.js.flow +137 -0
- package/map-marker/floating-marker.js +109 -0
- package/map-marker/floating-marker.js.flow +102 -0
- package/map-marker/index.d.ts +104 -0
- package/map-marker/index.js +55 -0
- package/map-marker/index.js.flow +23 -0
- package/map-marker/package.json +4 -0
- package/map-marker/pin-head.js +159 -0
- package/map-marker/pin-head.js.flow +155 -0
- package/map-marker/styled-components.js +184 -0
- package/map-marker/styled-components.js.flow +177 -0
- package/map-marker/types.js +11 -0
- package/map-marker/types.js.flow +114 -0
- package/menu/index.d.ts +7 -0
- package/menu/types.js.flow +12 -0
- package/package.json +3 -2
- package/popover/stateful-container.js +4 -0
- package/popover/stateful-container.js.flow +3 -0
- package/rating/emoticon-rating.js +2 -2
- package/rating/emoticon-rating.js.flow +4 -1
- package/rating/star-rating.js +2 -2
- package/rating/star-rating.js.flow +4 -1
- package/select/select-component.js +19 -6
- package/select/select-component.js.flow +19 -6
- package/select/styled-components.js +28 -4
- package/select/styled-components.js.flow +30 -2
- package/select/types.js.flow +9 -0
- package/snackbar/snackbar-context.js +15 -4
- package/snackbar/snackbar-context.js.flow +15 -3
- package/spinner/styled-components.js +1 -1
- package/spinner/styled-components.js.flow +1 -1
- package/table-semantic/index.d.ts +1 -0
- package/table-semantic/styled-components.js +6 -4
- package/table-semantic/styled-components.js.flow +6 -4
- package/table-semantic/table-builder.js +3 -0
- package/table-semantic/table-builder.js.flow +3 -0
- package/theme.ts +2 -0
- package/themes/dark-theme/color-component-tokens.js +1 -1
- package/themes/dark-theme/color-component-tokens.js.flow +1 -1
- package/themes/dark-theme/color-semantic-tokens.js +8 -7
- package/themes/dark-theme/color-semantic-tokens.js.flow +7 -6
- package/themes/light-theme/color-component-tokens.js +9 -9
- package/themes/light-theme/color-component-tokens.js.flow +9 -9
- package/themes/light-theme/color-semantic-tokens.js +3 -2
- package/themes/light-theme/color-semantic-tokens.js.flow +2 -1
- package/themes/types.js.flow +1 -0
- package/tokens/colors.js +2 -2
- package/tokens/colors.js.flow +2 -2
- package/tooltip/styled-components.js +8 -0
- package/tooltip/styled-components.js.flow +8 -0
|
@@ -159,7 +159,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
159
159
|
isPseudoFocused: false
|
|
160
160
|
});
|
|
161
161
|
|
|
162
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
162
|
+
_defineProperty(_assertThisInitialized(_this), "isItMounted", false);
|
|
163
163
|
|
|
164
164
|
_defineProperty(_assertThisInitialized(_this), "handleTouchOutside", function (event) {
|
|
165
165
|
if (containsNode(_this.dropdown.current, event.target)) return;
|
|
@@ -307,7 +307,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
307
307
|
_this.props.onBlur(event);
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
if (_this.
|
|
310
|
+
if (_this.isItMounted) {
|
|
311
311
|
_this.setState({
|
|
312
312
|
isFocused: false,
|
|
313
313
|
isOpen: false,
|
|
@@ -661,7 +661,14 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
661
661
|
this.focus();
|
|
662
662
|
}
|
|
663
663
|
|
|
664
|
-
this.
|
|
664
|
+
this.isItMounted = true;
|
|
665
|
+
|
|
666
|
+
if (this.props.methodsRef) {
|
|
667
|
+
var methodsRef = this.props.methodsRef;
|
|
668
|
+
methodsRef.current = {
|
|
669
|
+
setDropdownOpen: this.handleDropdownOpen.bind(this)
|
|
670
|
+
};
|
|
671
|
+
}
|
|
665
672
|
}
|
|
666
673
|
}, {
|
|
667
674
|
key: "componentDidUpdate",
|
|
@@ -690,13 +697,20 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
690
697
|
document.removeEventListener('click', this.handleClickOutside);
|
|
691
698
|
}
|
|
692
699
|
|
|
693
|
-
this.
|
|
700
|
+
this.isItMounted = false;
|
|
694
701
|
}
|
|
695
702
|
}, {
|
|
696
703
|
key: "focus",
|
|
697
704
|
value: function focus() {
|
|
698
705
|
if (!this.input) return;
|
|
699
706
|
this.input.focus();
|
|
707
|
+
}
|
|
708
|
+
}, {
|
|
709
|
+
key: "handleDropdownOpen",
|
|
710
|
+
value: function handleDropdownOpen(nextOpenState) {
|
|
711
|
+
this.setState({
|
|
712
|
+
isOpen: nextOpenState
|
|
713
|
+
});
|
|
700
714
|
} // Handle touch outside on mobile to dismiss menu, ensures that the
|
|
701
715
|
// touch target is not within the anchor DOM node.
|
|
702
716
|
|
|
@@ -912,7 +926,6 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
912
926
|
|
|
913
927
|
var ariaLabel = this.props.multi ? 'Clear all' : 'Clear value';
|
|
914
928
|
return /*#__PURE__*/React.createElement(ClearIcon, _extends({
|
|
915
|
-
size: 16,
|
|
916
929
|
title: ariaLabel,
|
|
917
930
|
"aria-label": ariaLabel,
|
|
918
931
|
onClick: this.clearValue,
|
|
@@ -992,7 +1005,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
992
1005
|
value: function filterOptions(excludeOptions) {
|
|
993
1006
|
var _this5 = this;
|
|
994
1007
|
|
|
995
|
-
var filterValue = this.state.inputValue; // apply filter function
|
|
1008
|
+
var filterValue = this.state.inputValue.trim(); // apply filter function
|
|
996
1009
|
|
|
997
1010
|
if (this.props.filterOptions) {
|
|
998
1011
|
this.options = this.props.filterOptions(this.options, filterValue, excludeOptions, {
|
|
@@ -326,25 +326,49 @@ function getSvgStyles(_ref4) {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
export var StyledSelectArrow = styled('svg', function (props) {
|
|
329
|
+
var _sizes;
|
|
330
|
+
|
|
329
331
|
var $theme = props.$theme,
|
|
330
|
-
$disabled = props.$disabled
|
|
332
|
+
$disabled = props.$disabled,
|
|
333
|
+
$size = props.$size;
|
|
331
334
|
var colors = $theme.colors;
|
|
335
|
+
var sizes = (_sizes = {}, _defineProperty(_sizes, SIZE.mini, 16), _defineProperty(_sizes, SIZE.compact, 16), _defineProperty(_sizes, SIZE.default, 20), _defineProperty(_sizes, SIZE.large, 24), _sizes);
|
|
336
|
+
var size = sizes[SIZE.default];
|
|
337
|
+
|
|
338
|
+
if ($size) {
|
|
339
|
+
size = sizes[$size];
|
|
340
|
+
}
|
|
341
|
+
|
|
332
342
|
return _objectSpread(_objectSpread({}, getSvgStyles({
|
|
333
343
|
$theme: $theme
|
|
334
344
|
})), {}, {
|
|
335
345
|
color: $disabled ? colors.inputTextDisabled : colors.contentPrimary,
|
|
336
|
-
cursor: $disabled ? 'not-allowed' : 'pointer'
|
|
346
|
+
cursor: $disabled ? 'not-allowed' : 'pointer',
|
|
347
|
+
height: "".concat(size, "px"),
|
|
348
|
+
width: "".concat(size, "px")
|
|
337
349
|
});
|
|
338
350
|
});
|
|
339
351
|
StyledSelectArrow.displayName = "StyledSelectArrow";
|
|
340
352
|
export var StyledClearIcon = styled('svg', function (props) {
|
|
341
|
-
var
|
|
353
|
+
var _sizes2;
|
|
354
|
+
|
|
355
|
+
var $theme = props.$theme,
|
|
356
|
+
$size = props.$size;
|
|
342
357
|
var colors = $theme.colors;
|
|
358
|
+
var sizes = (_sizes2 = {}, _defineProperty(_sizes2, SIZE.mini, 15), _defineProperty(_sizes2, SIZE.compact, 15), _defineProperty(_sizes2, SIZE.default, 18), _defineProperty(_sizes2, SIZE.large, 22), _sizes2);
|
|
359
|
+
var size = sizes[SIZE.default];
|
|
360
|
+
|
|
361
|
+
if ($size) {
|
|
362
|
+
size = sizes[$size];
|
|
363
|
+
}
|
|
364
|
+
|
|
343
365
|
return _objectSpread(_objectSpread({}, getSvgStyles({
|
|
344
366
|
$theme: $theme
|
|
345
367
|
})), {}, {
|
|
346
368
|
color: colors.contentPrimary,
|
|
347
|
-
cursor: 'pointer'
|
|
369
|
+
cursor: 'pointer',
|
|
370
|
+
height: "".concat(size, "px"),
|
|
371
|
+
width: "".concat(size, "px")
|
|
348
372
|
});
|
|
349
373
|
});
|
|
350
374
|
StyledClearIcon.displayName = "StyledClearIcon";
|
|
@@ -61,6 +61,15 @@ export function useSnackbar() {
|
|
|
61
61
|
dequeue: context.dequeue
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
+
|
|
65
|
+
function usePrevious(value) {
|
|
66
|
+
var ref = React.useRef();
|
|
67
|
+
React.useEffect(function () {
|
|
68
|
+
ref.current = value;
|
|
69
|
+
});
|
|
70
|
+
return ref.current;
|
|
71
|
+
}
|
|
72
|
+
|
|
64
73
|
export default function SnackbarProvider(_ref) {
|
|
65
74
|
var children = _ref.children,
|
|
66
75
|
_ref$overrides = _ref.overrides,
|
|
@@ -95,10 +104,6 @@ export default function SnackbarProvider(_ref) {
|
|
|
95
104
|
function enqueue(elementProps) {
|
|
96
105
|
var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultDuration;
|
|
97
106
|
setSnackbars(function (prev) {
|
|
98
|
-
if (prev.length === 0) {
|
|
99
|
-
enter(duration);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
107
|
return [].concat(_toConsumableArray(prev), [{
|
|
103
108
|
elementProps: elementProps,
|
|
104
109
|
duration: duration
|
|
@@ -106,6 +111,13 @@ export default function SnackbarProvider(_ref) {
|
|
|
106
111
|
});
|
|
107
112
|
}
|
|
108
113
|
|
|
114
|
+
var prevSnackbars = usePrevious(snackbars) || [];
|
|
115
|
+
React.useEffect(function () {
|
|
116
|
+
if (prevSnackbars.length === 0 && snackbars.length >= 1) {
|
|
117
|
+
enter(snackbars[0].duration);
|
|
118
|
+
}
|
|
119
|
+
}, [snackbars, prevSnackbars]);
|
|
120
|
+
|
|
109
121
|
function dequeue() {
|
|
110
122
|
setContainerHeight(0);
|
|
111
123
|
setSnackbars(function (prev) {
|
|
@@ -52,7 +52,7 @@ export var StyledActivePath = styled('path', function (props) {
|
|
|
52
52
|
}); // TODO(v11): Replace Spinner with SpinnerNext
|
|
53
53
|
|
|
54
54
|
StyledActivePath.displayName = "StyledActivePath";
|
|
55
|
-
export var StyledSpinnerNext = styled('
|
|
55
|
+
export var StyledSpinnerNext = styled('i', function (_ref) {
|
|
56
56
|
var $theme = _ref.$theme,
|
|
57
57
|
_ref$$size = _ref.$size,
|
|
58
58
|
$size = _ref$$size === void 0 ? SIZE.medium : _ref$$size;
|
|
@@ -70,7 +70,8 @@ export var StyledTableHeadCell = styled('th', function (_ref5) {
|
|
|
70
70
|
|
|
71
71
|
var $theme = _ref5.$theme,
|
|
72
72
|
$size = _ref5.$size,
|
|
73
|
-
$divider = _ref5.$divider
|
|
73
|
+
$divider = _ref5.$divider,
|
|
74
|
+
$isNumeric = _ref5.$isNumeric;
|
|
74
75
|
var borderDir = $theme.direction === 'rtl' ? 'Left' : 'Right';
|
|
75
76
|
var borderVertical = $divider === DIVIDER.grid || $divider === DIVIDER.vertical;
|
|
76
77
|
var padding = sizeToCellPadding($theme, $size);
|
|
@@ -83,7 +84,7 @@ export var StyledTableHeadCell = styled('th', function (_ref5) {
|
|
|
83
84
|
paddingLeft: padding,
|
|
84
85
|
backgroundColor: $theme.colors.tableHeadBackgroundColor,
|
|
85
86
|
color: $theme.colors.contentPrimary,
|
|
86
|
-
textAlign: $theme.direction === 'rtl' ? 'right' : 'left',
|
|
87
|
+
textAlign: $theme.direction === 'rtl' || $isNumeric ? 'right' : 'left',
|
|
87
88
|
verticalAlign: 'top',
|
|
88
89
|
whiteSpace: 'nowrap',
|
|
89
90
|
zIndex: 1
|
|
@@ -164,14 +165,15 @@ export var StyledTableBodyCell = styled('td', function (_ref12) {
|
|
|
164
165
|
$size = _ref12.$size,
|
|
165
166
|
$divider = _ref12.$divider,
|
|
166
167
|
$isNumeric = _ref12.$isNumeric,
|
|
167
|
-
$isLastRow = _ref12.$isLastRow
|
|
168
|
+
$isLastRow = _ref12.$isLastRow,
|
|
169
|
+
$isSortable = _ref12.$isSortable;
|
|
168
170
|
var borderDir = $theme.direction === 'rtl' ? 'Left' : 'Right';
|
|
169
171
|
var borderVertical = $divider === DIVIDER.vertical || $divider === DIVIDER.grid;
|
|
170
172
|
var borderHorizontal = $divider === undefined || $divider === DIVIDER.horizontal || $divider === DIVIDER.grid;
|
|
171
173
|
var padding = sizeToCellPadding($theme, $size);
|
|
172
174
|
return _objectSpread(_objectSpread({}, $theme.typography.font200), {}, {
|
|
173
175
|
paddingTop: padding,
|
|
174
|
-
paddingRight: padding,
|
|
176
|
+
paddingRight: !$isSortable ? padding : $theme.sizing.scale1000,
|
|
175
177
|
paddingBottom: padding,
|
|
176
178
|
paddingLeft: padding,
|
|
177
179
|
color: $theme.colors.contentPrimary,
|
|
@@ -200,6 +200,7 @@ var TableBuilder = /*#__PURE__*/function (_React$Component) {
|
|
|
200
200
|
$col: col,
|
|
201
201
|
$colIndex: colIndex,
|
|
202
202
|
$divider: divider,
|
|
203
|
+
$isNumeric: col.numeric,
|
|
203
204
|
$size: size
|
|
204
205
|
}, tableHeadCellProps, colTableHeadCellProps), col.header);
|
|
205
206
|
}
|
|
@@ -242,6 +243,7 @@ var TableBuilder = /*#__PURE__*/function (_React$Component) {
|
|
|
242
243
|
$col: col,
|
|
243
244
|
$colIndex: colIndex,
|
|
244
245
|
$divider: divider,
|
|
246
|
+
$isNumeric: col.numeric,
|
|
245
247
|
role: "button",
|
|
246
248
|
tabIndex: "0",
|
|
247
249
|
"aria-label": "".concat(col.tableHeadAriaLabel || col.header, ", ").concat(sortLabel),
|
|
@@ -275,6 +277,7 @@ var TableBuilder = /*#__PURE__*/function (_React$Component) {
|
|
|
275
277
|
$rowIndex: rowIndex,
|
|
276
278
|
$isNumeric: col.numeric,
|
|
277
279
|
$isLastRow: rowIndex === lastRowindex,
|
|
280
|
+
$isSortable: col.sortable,
|
|
278
281
|
$size: size
|
|
279
282
|
}, tableBodyCellProps, colTableBodyCellProps), col.children(row, rowIndex));
|
|
280
283
|
}
|
|
@@ -93,7 +93,7 @@ export default (function () {
|
|
|
93
93
|
linkActive: themePrimitives.primary300,
|
|
94
94
|
// List
|
|
95
95
|
listHeaderFill: themePrimitives.mono600,
|
|
96
|
-
listBodyFill: themePrimitives.
|
|
96
|
+
listBodyFill: themePrimitives.mono800,
|
|
97
97
|
listIconFill: themePrimitives.mono100,
|
|
98
98
|
listBorder: themePrimitives.mono500,
|
|
99
99
|
// ProgressSteps
|
|
@@ -23,12 +23,12 @@ export default (function () {
|
|
|
23
23
|
backgroundInversePrimary: foundation.primaryA,
|
|
24
24
|
backgroundInverseSecondary: colors.gray300,
|
|
25
25
|
// Content
|
|
26
|
-
contentPrimary:
|
|
27
|
-
contentSecondary: colors.
|
|
28
|
-
contentTertiary: colors.
|
|
29
|
-
contentInversePrimary:
|
|
30
|
-
contentInverseSecondary: colors.
|
|
31
|
-
contentInverseTertiary: colors.
|
|
26
|
+
contentPrimary: colors.white,
|
|
27
|
+
contentSecondary: colors.gray300,
|
|
28
|
+
contentTertiary: colors.gray400,
|
|
29
|
+
contentInversePrimary: colors.black,
|
|
30
|
+
contentInverseSecondary: colors.gray700,
|
|
31
|
+
contentInverseTertiary: colors.gray600,
|
|
32
32
|
// Border
|
|
33
33
|
borderOpaque: colors.gray700,
|
|
34
34
|
borderTransparent: hexToRgba(foundation.primaryA, '0.08'),
|
|
@@ -75,7 +75,8 @@ export default (function () {
|
|
|
75
75
|
rewardsTier1: colors.blue400,
|
|
76
76
|
rewardsTier2: colors.yellow400,
|
|
77
77
|
rewardsTier3: colors.platinum400,
|
|
78
|
-
rewardsTier4: colors.gray200
|
|
78
|
+
rewardsTier4: colors.gray200,
|
|
79
|
+
membership: colors.yellow600
|
|
79
80
|
};
|
|
80
81
|
return _objectSpread(_objectSpread({}, core), coreExtensions);
|
|
81
82
|
});
|
|
@@ -22,32 +22,32 @@ export default (function () {
|
|
|
22
22
|
buttonPrimaryActive: themePrimitives.primary600,
|
|
23
23
|
buttonPrimarySelectedFill: themePrimitives.primary600,
|
|
24
24
|
buttonPrimarySelectedText: themePrimitives.white,
|
|
25
|
-
buttonPrimarySpinnerForeground: themePrimitives.
|
|
26
|
-
buttonPrimarySpinnerBackground: themePrimitives.
|
|
25
|
+
buttonPrimarySpinnerForeground: themePrimitives.accent,
|
|
26
|
+
buttonPrimarySpinnerBackground: themePrimitives.primaryB,
|
|
27
27
|
buttonSecondaryFill: themePrimitives.primary100,
|
|
28
28
|
buttonSecondaryText: themePrimitives.primary,
|
|
29
29
|
buttonSecondaryHover: themePrimitives.primary200,
|
|
30
30
|
buttonSecondaryActive: themePrimitives.primary300,
|
|
31
31
|
buttonSecondarySelectedFill: themePrimitives.primary300,
|
|
32
32
|
buttonSecondarySelectedText: themePrimitives.primary,
|
|
33
|
-
buttonSecondarySpinnerForeground: themePrimitives.
|
|
34
|
-
buttonSecondarySpinnerBackground: themePrimitives.
|
|
33
|
+
buttonSecondarySpinnerForeground: themePrimitives.accent,
|
|
34
|
+
buttonSecondarySpinnerBackground: themePrimitives.primaryB,
|
|
35
35
|
buttonTertiaryFill: 'transparent',
|
|
36
36
|
buttonTertiaryText: themePrimitives.primary,
|
|
37
37
|
buttonTertiaryHover: themePrimitives.primary50,
|
|
38
38
|
buttonTertiaryActive: themePrimitives.primary100,
|
|
39
39
|
buttonTertiarySelectedFill: themePrimitives.primary100,
|
|
40
40
|
buttonTertiarySelectedText: themePrimitives.primary,
|
|
41
|
-
buttonTertiarySpinnerForeground: themePrimitives.
|
|
42
|
-
buttonTertiarySpinnerBackground: themePrimitives.
|
|
41
|
+
buttonTertiarySpinnerForeground: themePrimitives.accent,
|
|
42
|
+
buttonTertiarySpinnerBackground: themePrimitives.primary100,
|
|
43
43
|
buttonMinimalFill: 'transparent',
|
|
44
44
|
buttonMinimalText: themePrimitives.primary,
|
|
45
45
|
buttonMinimalHover: themePrimitives.primary50,
|
|
46
46
|
buttonMinimalActive: themePrimitives.primary100,
|
|
47
47
|
buttonMinimalSelectedFill: themePrimitives.primary100,
|
|
48
48
|
buttonMinimalSelectedText: themePrimitives.primary,
|
|
49
|
-
buttonMinimalSpinnerForeground: themePrimitives.
|
|
50
|
-
buttonMinimalSpinnerBackground: themePrimitives.
|
|
49
|
+
buttonMinimalSpinnerForeground: themePrimitives.accent,
|
|
50
|
+
buttonMinimalSpinnerBackground: themePrimitives.primary100,
|
|
51
51
|
buttonDisabledFill: themePrimitives.mono200,
|
|
52
52
|
buttonDisabledText: themePrimitives.mono600,
|
|
53
53
|
buttonDisabledSpinnerForeground: themePrimitives.mono600,
|
|
@@ -93,7 +93,7 @@ export default (function () {
|
|
|
93
93
|
linkActive: themePrimitives.primary500,
|
|
94
94
|
// List
|
|
95
95
|
listHeaderFill: themePrimitives.white,
|
|
96
|
-
listBodyFill: themePrimitives.
|
|
96
|
+
listBodyFill: themePrimitives.white,
|
|
97
97
|
listIconFill: themePrimitives.mono500,
|
|
98
98
|
listBorder: themePrimitives.mono500,
|
|
99
99
|
// ProgressSteps
|
|
@@ -58,7 +58,7 @@ export default (function () {
|
|
|
58
58
|
contentOnColor: colors.white,
|
|
59
59
|
contentOnColorInverse: colors.black,
|
|
60
60
|
contentNegative: foundation.negative,
|
|
61
|
-
contentWarning: colors.
|
|
61
|
+
contentWarning: colors.yellow600,
|
|
62
62
|
contentPositive: colors.green400,
|
|
63
63
|
// Border
|
|
64
64
|
borderStateDisabled: colors.gray50,
|
|
@@ -75,7 +75,8 @@ export default (function () {
|
|
|
75
75
|
rewardsTier1: colors.blue400,
|
|
76
76
|
rewardsTier2: colors.yellow400,
|
|
77
77
|
rewardsTier3: colors.platinum400,
|
|
78
|
-
rewardsTier4: colors.black
|
|
78
|
+
rewardsTier4: colors.black,
|
|
79
|
+
membership: colors.yellow600
|
|
79
80
|
};
|
|
80
81
|
return _objectSpread(_objectSpread({}, core), coreExtensions);
|
|
81
82
|
});
|
package/esm/tokens/colors.js
CHANGED
|
@@ -11,7 +11,7 @@ var colors = {
|
|
|
11
11
|
gray200: '#E2E2E2',
|
|
12
12
|
gray300: '#CBCBCB',
|
|
13
13
|
gray400: '#AFAFAF',
|
|
14
|
-
gray500: '#
|
|
14
|
+
gray500: '#6B6B6B',
|
|
15
15
|
gray600: '#545454',
|
|
16
16
|
gray700: '#333333',
|
|
17
17
|
gray800: '#1F1F1F',
|
|
@@ -48,7 +48,7 @@ var colors = {
|
|
|
48
48
|
yellow300: '#FFCF70',
|
|
49
49
|
yellow400: '#FFC043',
|
|
50
50
|
yellow500: '#BC8B2C',
|
|
51
|
-
yellow600: '#
|
|
51
|
+
yellow600: '#996F00',
|
|
52
52
|
yellow700: '#674D1B',
|
|
53
53
|
green50: '#E6F2ED',
|
|
54
54
|
green100: '#ADDEC9',
|
|
@@ -28,6 +28,10 @@ import { getEndPosition } from '../popover/utils.js';
|
|
|
28
28
|
export var Body = styled('div', function (props) {
|
|
29
29
|
return _objectSpread(_objectSpread({}, getBodyStyles(props)), {}, {
|
|
30
30
|
backgroundColor: props.$theme.colors.tooltipBackground,
|
|
31
|
+
borderTopLeftRadius: props.$theme.borders.radius300,
|
|
32
|
+
borderTopRightRadius: props.$theme.borders.radius300,
|
|
33
|
+
borderBottomRightRadius: props.$theme.borders.radius300,
|
|
34
|
+
borderBottomLeftRadius: props.$theme.borders.radius300,
|
|
31
35
|
boxShadow: props.$theme.lighting.shadow400,
|
|
32
36
|
color: props.$theme.colors.tooltipText,
|
|
33
37
|
// Reset transition property to opacity only, and static transform
|
|
@@ -39,6 +43,10 @@ Body.displayName = "Body";
|
|
|
39
43
|
export var Inner = styled('div', function (props) {
|
|
40
44
|
return _objectSpread(_objectSpread(_objectSpread({}, getInnerStyles(props)), {}, {
|
|
41
45
|
backgroundColor: props.$theme.colors.tooltipBackground,
|
|
46
|
+
borderTopLeftRadius: props.$theme.borders.radius300,
|
|
47
|
+
borderTopRightRadius: props.$theme.borders.radius300,
|
|
48
|
+
borderBottomRightRadius: props.$theme.borders.radius300,
|
|
49
|
+
borderBottomLeftRadius: props.$theme.borders.radius300,
|
|
42
50
|
paddingTop: props.$theme.sizing.scale300,
|
|
43
51
|
paddingBottom: props.$theme.sizing.scale300,
|
|
44
52
|
paddingLeft: props.$theme.sizing.scale600,
|
package/index.d.ts
CHANGED
package/link/index.d.ts
CHANGED
package/list/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {HeaderNavigationOverrides} from 'baseui/header-navigation';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import {StyletronComponent} from 'styletron-react';
|
|
3
4
|
import {Override} from '../overrides';
|
|
@@ -84,3 +85,38 @@ export const StyledEndEnhancerContainer: StyletronComponent<{}>;
|
|
|
84
85
|
export const StyledArtworkContainer: StyletronComponent<
|
|
85
86
|
StyledArtworkContainerPropsT
|
|
86
87
|
>;
|
|
88
|
+
|
|
89
|
+
export interface HeadingPropsT {
|
|
90
|
+
heading: React.ReactNode;
|
|
91
|
+
subHeading?: React.ReactNode;
|
|
92
|
+
endEnhancer?: React.ReactNode;
|
|
93
|
+
endEnhancerDescription?: React.ReactNode;
|
|
94
|
+
overrides?: HeaderNavigationOverrides;
|
|
95
|
+
maxLines?: number;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface StyledHeadingEndEnhancerContainerPropsT {
|
|
99
|
+
$isText: boolean;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export type StyledHeadingHeadingPropsT = {
|
|
103
|
+
$maxLines: 1 | 2;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const ListHeading: React.ForwardRefExoticComponent<
|
|
107
|
+
HeadingPropsT & React.RefAttributes<HTMLLIElement>
|
|
108
|
+
>;
|
|
109
|
+
|
|
110
|
+
export const StyledHeadingRoot: StyletronComponent<{}>;
|
|
111
|
+
export const StyledHeadingContent: StyletronComponent<{}>;
|
|
112
|
+
export const StyledHeadingContentRow: StyletronComponent<{}>;
|
|
113
|
+
export const StyledHeadingMainHeading: StyletronComponent<
|
|
114
|
+
StyledHeadingHeadingPropsT
|
|
115
|
+
>;
|
|
116
|
+
export const StyledHeadingSubHeading: StyletronComponent<
|
|
117
|
+
StyledHeadingHeadingPropsT
|
|
118
|
+
>;
|
|
119
|
+
export const StyledHeadingEndEnhancerContainer: StyletronComponent<
|
|
120
|
+
StyledHeadingEndEnhancerContainerPropsT
|
|
121
|
+
>;
|
|
122
|
+
export const StyledHeadingEndEnhancerDescriptionContainer: StyletronComponent<{}>;
|
package/list/list-heading.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -7,12 +9,16 @@ exports.default = void 0;
|
|
|
7
9
|
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
9
11
|
|
|
10
|
-
var
|
|
12
|
+
var ReactIs = _interopRequireWildcard(require("react-is"));
|
|
11
13
|
|
|
12
14
|
var _overrides = require("../helpers/overrides.js");
|
|
13
15
|
|
|
14
16
|
var _styledComponents = require("./styled-components.js");
|
|
15
17
|
|
|
18
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
16
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
23
|
|
|
18
24
|
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); }
|
|
@@ -47,7 +53,7 @@ function RenderNode(props) {
|
|
|
47
53
|
return Component;
|
|
48
54
|
}
|
|
49
55
|
|
|
50
|
-
if (
|
|
56
|
+
if (ReactIs.isValidElementType(Component)) {
|
|
51
57
|
// $FlowFixMe
|
|
52
58
|
return /*#__PURE__*/_react.default.createElement(Component, restProps);
|
|
53
59
|
} // $FlowFixMe
|
|
@@ -56,9 +62,14 @@ function RenderNode(props) {
|
|
|
56
62
|
return Component;
|
|
57
63
|
}
|
|
58
64
|
|
|
65
|
+
function isMaxLinesValid(maxLines) {
|
|
66
|
+
return maxLines === 1 || maxLines === 2;
|
|
67
|
+
}
|
|
68
|
+
|
|
59
69
|
var ListHeading = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
60
70
|
var _props$overrides = props.overrides,
|
|
61
|
-
overrides = _props$overrides === void 0 ? {} : _props$overrides
|
|
71
|
+
overrides = _props$overrides === void 0 ? {} : _props$overrides,
|
|
72
|
+
maxLines = props.maxLines;
|
|
62
73
|
var EndEnhancer = props.endEnhancer;
|
|
63
74
|
var EndEnhancerDescription = props.endEnhancerDescription;
|
|
64
75
|
var SubHeading = props.subHeading;
|
|
@@ -95,15 +106,21 @@ var ListHeading = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
95
106
|
|
|
96
107
|
var isEndEnhancerString = typeof EndEnhancer === 'string';
|
|
97
108
|
|
|
98
|
-
if (
|
|
99
|
-
|
|
109
|
+
if (process.env.NODE_ENV !== "production") {
|
|
110
|
+
if (isEndEnhancerString && EndEnhancerDescription) {
|
|
111
|
+
console.warn('endEnhancerDescription will not be rendered if endEnhancer is not a string');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (maxLines && !isMaxLinesValid(maxLines)) {
|
|
115
|
+
console.warn('maxLines must be 1 or 2.');
|
|
116
|
+
}
|
|
100
117
|
}
|
|
101
118
|
|
|
102
119
|
return /*#__PURE__*/_react.default.createElement(Root // eslint-disable-next-line flowtype/no-weak-types
|
|
103
120
|
, _extends({
|
|
104
121
|
ref: ref
|
|
105
122
|
}, rootProps), /*#__PURE__*/_react.default.createElement(Content, contentProps, /*#__PURE__*/_react.default.createElement(_styledComponents.StyledHeadingContentRow, null, /*#__PURE__*/_react.default.createElement(HeadingContainer, _extends({
|
|
106
|
-
$maxLines:
|
|
123
|
+
$maxLines: isMaxLinesValid(maxLines) ? maxLines : 1
|
|
107
124
|
}, headingContainerProps), /*#__PURE__*/_react.default.createElement(RenderNode, {
|
|
108
125
|
component: props.heading
|
|
109
126
|
})), EndEnhancer && /*#__PURE__*/_react.default.createElement(EndEnhancerContainer, _extends({
|
|
@@ -111,7 +128,7 @@ var ListHeading = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
111
128
|
}, endEnhancerContainerProps), /*#__PURE__*/_react.default.createElement(RenderNode, {
|
|
112
129
|
component: EndEnhancer
|
|
113
130
|
}))), (SubHeading || EndEnhancerDescription) && /*#__PURE__*/_react.default.createElement(_styledComponents.StyledHeadingContentRow, null, /*#__PURE__*/_react.default.createElement(SubHeadingContainer, _extends({
|
|
114
|
-
$maxLines:
|
|
131
|
+
$maxLines: isMaxLinesValid(maxLines) ? maxLines : 1
|
|
115
132
|
}, subHeadingContainerProps), /*#__PURE__*/_react.default.createElement(RenderNode, {
|
|
116
133
|
component: SubHeading
|
|
117
134
|
})), EndEnhancerDescription && isEndEnhancerString && /*#__PURE__*/_react.default.createElement(EndEnhancerDescriptionContainer, endEnhancerDescriptionContainerProps, /*#__PURE__*/_react.default.createElement(RenderNode, {
|
|
@@ -7,7 +7,7 @@ LICENSE file in the root directory of this source tree.
|
|
|
7
7
|
// @flow
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import ReactIs from 'react-is';
|
|
10
|
+
import * as ReactIs from 'react-is';
|
|
11
11
|
|
|
12
12
|
import {getOverrides} from '../helpers/overrides.js';
|
|
13
13
|
|
|
@@ -39,9 +39,13 @@ function RenderNode(props) {
|
|
|
39
39
|
return Component;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
function isMaxLinesValid(maxLines) {
|
|
43
|
+
return maxLines === 1 || maxLines === 2;
|
|
44
|
+
}
|
|
45
|
+
|
|
42
46
|
const ListHeading = React.forwardRef<HeadingPropsT, HTMLLIElement>(
|
|
43
47
|
(props: HeadingPropsT, ref) => {
|
|
44
|
-
const {overrides = {}} = props;
|
|
48
|
+
const {overrides = {}, maxLines} = props;
|
|
45
49
|
const EndEnhancer = props.endEnhancer;
|
|
46
50
|
const EndEnhancerDescription = props.endEnhancerDescription;
|
|
47
51
|
const SubHeading = props.subHeading;
|
|
@@ -73,10 +77,15 @@ const ListHeading = React.forwardRef<HeadingPropsT, HTMLLIElement>(
|
|
|
73
77
|
|
|
74
78
|
const isEndEnhancerString = typeof EndEnhancer === 'string';
|
|
75
79
|
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
if (__DEV__) {
|
|
81
|
+
if (isEndEnhancerString && EndEnhancerDescription) {
|
|
82
|
+
console.warn(
|
|
83
|
+
'endEnhancerDescription will not be rendered if endEnhancer is not a string',
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
if (maxLines && !isMaxLinesValid(maxLines)) {
|
|
87
|
+
console.warn('maxLines must be 1 or 2.');
|
|
88
|
+
}
|
|
80
89
|
}
|
|
81
90
|
|
|
82
91
|
return (
|
|
@@ -89,7 +98,7 @@ const ListHeading = React.forwardRef<HeadingPropsT, HTMLLIElement>(
|
|
|
89
98
|
{/* ----- Top Row -------------------------- */}
|
|
90
99
|
<StyledHeadingContentRow>
|
|
91
100
|
<HeadingContainer
|
|
92
|
-
$maxLines={
|
|
101
|
+
$maxLines={isMaxLinesValid(maxLines) ? maxLines : 1}
|
|
93
102
|
{...headingContainerProps}
|
|
94
103
|
>
|
|
95
104
|
<RenderNode component={props.heading} />
|
|
@@ -109,7 +118,7 @@ const ListHeading = React.forwardRef<HeadingPropsT, HTMLLIElement>(
|
|
|
109
118
|
{(SubHeading || EndEnhancerDescription) && (
|
|
110
119
|
<StyledHeadingContentRow>
|
|
111
120
|
<SubHeadingContainer
|
|
112
|
-
$maxLines={
|
|
121
|
+
$maxLines={isMaxLinesValid(maxLines) ? maxLines : 1}
|
|
113
122
|
{...subHeadingContainerProps}
|
|
114
123
|
>
|
|
115
124
|
<RenderNode component={SubHeading} />
|