baseui 10.3.0 → 10.7.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/app-nav-bar/user-menu.js +1 -0
- package/app-nav-bar/user-menu.js.flow +1 -0
- package/button/styled-components.js +1 -1
- package/button/styled-components.js.flow +4 -1
- package/card/styled-components.js +0 -1
- package/card/styled-components.js.flow +0 -1
- package/combobox/combobox.js +5 -1
- package/combobox/combobox.js.flow +4 -0
- package/combobox/index.d.ts +6 -3
- package/data-table/column-datetime.js +2 -0
- package/data-table/column-datetime.js.flow +2 -0
- 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 +255 -109
- package/datepicker/calendar-header.js.flow +282 -145
- package/datepicker/calendar.js +6 -1
- package/datepicker/calendar.js.flow +5 -1
- package/datepicker/constants.js +9 -2
- package/datepicker/constants.js.flow +7 -0
- package/datepicker/datepicker.js +135 -73
- package/datepicker/datepicker.js.flow +161 -62
- package/datepicker/day.js +2 -0
- package/datepicker/day.js.flow +2 -0
- package/datepicker/index.d.ts +8 -0
- package/datepicker/month.js +4 -0
- package/datepicker/month.js.flow +3 -0
- package/datepicker/styled-components.js +116 -56
- package/datepicker/styled-components.js.flow +101 -36
- package/datepicker/types.js.flow +18 -1
- package/datepicker/utils/calendar-header-helpers.js +51 -0
- package/datepicker/utils/calendar-header-helpers.js.flow +53 -0
- package/datepicker/utils/date-helpers.js +1 -1
- package/datepicker/utils/date-helpers.js.flow +1 -1
- package/datepicker/week.js +1 -0
- package/datepicker/week.js.flow +1 -0
- package/dnd-list/index.js.flow +2 -1
- package/dnd-list/list.js +1 -2
- package/dnd-list/list.js.flow +1 -1
- package/dnd-list/styled-components.js +1 -1
- package/dnd-list/styled-components.js.flow +1 -0
- 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/app-nav-bar/user-menu.js +1 -0
- package/es/button/styled-components.js +1 -1
- package/es/card/styled-components.js +0 -1
- package/es/combobox/combobox.js +5 -1
- package/es/data-table/column-datetime.js +2 -0
- package/es/data-table/data-table.js +13 -3
- package/es/datepicker/calendar-header.js +204 -93
- package/es/datepicker/calendar.js +7 -2
- package/es/datepicker/constants.js +6 -1
- package/es/datepicker/datepicker.js +70 -42
- package/es/datepicker/day.js +2 -0
- package/es/datepicker/month.js +3 -0
- package/es/datepicker/styled-components.js +98 -37
- package/es/datepicker/types.js +1 -1
- package/es/datepicker/utils/calendar-header-helpers.js +34 -0
- package/es/datepicker/utils/date-helpers.js +1 -1
- package/es/datepicker/week.js +1 -0
- package/es/dnd-list/index.js +2 -1
- package/es/dnd-list/list.js +1 -2
- package/es/dnd-list/styled-components.js +1 -0
- package/es/drawer/close-icon.js +3 -2
- package/es/drawer/drawer.js +5 -2
- package/es/helper/helper.js +1 -0
- package/es/layer/layer.js +8 -0
- 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/menu/maybe-child-menu.js +1 -0
- package/es/popover/popover.js +6 -5
- package/es/popover/stateful-container.js +8 -2
- package/es/rating/emoticon-rating.js +3 -1
- package/es/rating/star-rating.js +3 -1
- package/es/select/select-component.js +20 -5
- 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/light-theme/color-component-tokens.js +9 -9
- package/es/themes/shared/lighting.js +5 -1
- package/es/timepicker/timepicker.js +16 -11
- package/es/tooltip/styled-components.js +8 -0
- package/es/tooltip/tooltip.js +1 -0
- package/esm/app-nav-bar/user-menu.js +1 -0
- package/esm/button/styled-components.js +1 -1
- package/esm/card/styled-components.js +0 -1
- package/esm/combobox/combobox.js +5 -1
- package/esm/data-table/column-datetime.js +2 -0
- package/esm/data-table/data-table.js +13 -3
- package/esm/datepicker/calendar-header.js +255 -110
- package/esm/datepicker/calendar.js +7 -2
- package/esm/datepicker/constants.js +6 -1
- package/esm/datepicker/datepicker.js +136 -74
- package/esm/datepicker/day.js +2 -0
- package/esm/datepicker/month.js +3 -0
- package/esm/datepicker/styled-components.js +112 -55
- package/esm/datepicker/types.js +1 -1
- package/esm/datepicker/utils/calendar-header-helpers.js +45 -0
- package/esm/datepicker/utils/date-helpers.js +1 -1
- package/esm/datepicker/week.js +1 -0
- package/esm/dnd-list/index.js +2 -1
- package/esm/dnd-list/list.js +1 -2
- package/esm/dnd-list/styled-components.js +1 -1
- package/esm/drawer/close-icon.js +3 -2
- package/esm/drawer/drawer.js +5 -2
- package/esm/helper/helper.js +1 -0
- package/esm/layer/layer.js +8 -0
- 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/menu/maybe-child-menu.js +1 -0
- package/esm/popover/popover.js +6 -5
- package/esm/popover/stateful-container.js +8 -2
- package/esm/rating/emoticon-rating.js +2 -2
- package/esm/rating/star-rating.js +2 -2
- package/esm/select/select-component.js +19 -5
- 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/light-theme/color-component-tokens.js +9 -9
- package/esm/themes/shared/lighting.js +5 -1
- package/esm/timepicker/timepicker.js +17 -11
- package/esm/tooltip/styled-components.js +8 -0
- package/esm/tooltip/tooltip.js +1 -0
- package/helper/helper.js +1 -0
- package/helper/helper.js.flow +1 -0
- package/layer/layer.js +8 -0
- package/layer/layer.js.flow +9 -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 +105 -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/maybe-child-menu.js +1 -0
- package/menu/maybe-child-menu.js.flow +1 -0
- package/menu/types.js.flow +12 -0
- package/modal/index.d.ts +1 -1
- package/modal/types.js.flow +4 -1
- package/package.json +5 -3
- package/popover/index.d.ts +2 -1
- package/popover/popover.js +6 -5
- package/popover/popover.js.flow +11 -4
- package/popover/stateful-container.js +8 -2
- package/popover/stateful-container.js.flow +5 -0
- package/popover/types.js.flow +6 -1
- 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 -5
- package/select/select-component.js.flow +19 -5
- package/select/styled-components.js +28 -4
- package/select/styled-components.js.flow +30 -2
- package/select/types.js.flow +9 -0
- package/snackbar/index.d.ts +21 -16
- 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/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/themes/dark-theme/color-component-tokens.js +1 -1
- package/themes/dark-theme/color-component-tokens.js.flow +1 -1
- package/themes/light-theme/color-component-tokens.js +9 -9
- package/themes/light-theme/color-component-tokens.js.flow +9 -9
- package/themes/shared/lighting.js +5 -1
- package/themes/shared/lighting.js.flow +4 -0
- package/themes/types.js.flow +4 -0
- package/timepicker/index.d.ts +1 -0
- package/timepicker/timepicker.js +17 -11
- package/timepicker/timepicker.js.flow +31 -12
- package/timepicker/types.js.flow +10 -0
- package/tooltip/styled-components.js +8 -0
- package/tooltip/styled-components.js.flow +8 -0
- package/tooltip/tooltip.js +1 -0
- package/tooltip/tooltip.js.flow +6 -1
|
@@ -105,7 +105,7 @@ class Select extends React.Component {
|
|
|
105
105
|
isPseudoFocused: false
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
_defineProperty(this, "
|
|
108
|
+
_defineProperty(this, "isItMounted", false);
|
|
109
109
|
|
|
110
110
|
_defineProperty(this, "handleTouchOutside", event => {
|
|
111
111
|
if (containsNode(this.dropdown.current, event.target)) return;
|
|
@@ -238,7 +238,7 @@ class Select extends React.Component {
|
|
|
238
238
|
this.props.onBlur(event);
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
if (this.
|
|
241
|
+
if (this.isItMounted) {
|
|
242
242
|
this.setState({
|
|
243
243
|
isFocused: false,
|
|
244
244
|
isOpen: false,
|
|
@@ -565,7 +565,16 @@ class Select extends React.Component {
|
|
|
565
565
|
this.focus();
|
|
566
566
|
}
|
|
567
567
|
|
|
568
|
-
this.
|
|
568
|
+
this.isItMounted = true;
|
|
569
|
+
|
|
570
|
+
if (this.props.methodsRef) {
|
|
571
|
+
const {
|
|
572
|
+
methodsRef
|
|
573
|
+
} = this.props;
|
|
574
|
+
methodsRef.current = {
|
|
575
|
+
setDropdownOpen: this.handleDropdownOpen.bind(this)
|
|
576
|
+
};
|
|
577
|
+
}
|
|
569
578
|
}
|
|
570
579
|
|
|
571
580
|
componentDidUpdate(prevProps, prevState) {
|
|
@@ -592,12 +601,18 @@ class Select extends React.Component {
|
|
|
592
601
|
document.removeEventListener('click', this.handleClickOutside);
|
|
593
602
|
}
|
|
594
603
|
|
|
595
|
-
this.
|
|
604
|
+
this.isItMounted = false;
|
|
596
605
|
}
|
|
597
606
|
|
|
598
607
|
focus() {
|
|
599
608
|
if (!this.input) return;
|
|
600
609
|
this.input.focus();
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
handleDropdownOpen(nextOpenState) {
|
|
613
|
+
this.setState({
|
|
614
|
+
isOpen: nextOpenState
|
|
615
|
+
});
|
|
601
616
|
} // Handle touch outside on mobile to dismiss menu, ensures that the
|
|
602
617
|
// touch target is not within the anchor DOM node.
|
|
603
618
|
|
|
@@ -782,7 +797,6 @@ class Select extends React.Component {
|
|
|
782
797
|
const [ClearIcon, clearIconProps] = getOverrides(overrides.ClearIcon, DeleteAlt);
|
|
783
798
|
const ariaLabel = this.props.multi ? 'Clear all' : 'Clear value';
|
|
784
799
|
return /*#__PURE__*/React.createElement(ClearIcon, _extends({
|
|
785
|
-
size: 16,
|
|
786
800
|
title: ariaLabel,
|
|
787
801
|
"aria-label": ariaLabel,
|
|
788
802
|
onClick: this.clearValue,
|
|
@@ -956,6 +970,7 @@ class Select extends React.Component {
|
|
|
956
970
|
if (!ref) return;
|
|
957
971
|
this.anchor = ref.anchorRef;
|
|
958
972
|
},
|
|
973
|
+
autoFocus: false,
|
|
959
974
|
focusLock: false,
|
|
960
975
|
mountNode: this.props.mountNode,
|
|
961
976
|
onEsc: () => this.closeMenu(),
|
|
@@ -375,31 +375,61 @@ function getSvgStyles({
|
|
|
375
375
|
export const StyledSelectArrow = styled('svg', props => {
|
|
376
376
|
const {
|
|
377
377
|
$theme,
|
|
378
|
-
$disabled
|
|
378
|
+
$disabled,
|
|
379
|
+
$size
|
|
379
380
|
} = props;
|
|
380
381
|
const {
|
|
381
382
|
colors
|
|
382
383
|
} = $theme;
|
|
384
|
+
const sizes = {
|
|
385
|
+
[SIZE.mini]: 16,
|
|
386
|
+
[SIZE.compact]: 16,
|
|
387
|
+
[SIZE.default]: 20,
|
|
388
|
+
[SIZE.large]: 24
|
|
389
|
+
};
|
|
390
|
+
let size = sizes[SIZE.default];
|
|
391
|
+
|
|
392
|
+
if ($size) {
|
|
393
|
+
size = sizes[$size];
|
|
394
|
+
}
|
|
395
|
+
|
|
383
396
|
return { ...getSvgStyles({
|
|
384
397
|
$theme
|
|
385
398
|
}),
|
|
386
399
|
color: $disabled ? colors.inputTextDisabled : colors.contentPrimary,
|
|
387
|
-
cursor: $disabled ? 'not-allowed' : 'pointer'
|
|
400
|
+
cursor: $disabled ? 'not-allowed' : 'pointer',
|
|
401
|
+
height: `${size}px`,
|
|
402
|
+
width: `${size}px`
|
|
388
403
|
};
|
|
389
404
|
});
|
|
390
405
|
StyledSelectArrow.displayName = "StyledSelectArrow";
|
|
391
406
|
export const StyledClearIcon = styled('svg', props => {
|
|
392
407
|
const {
|
|
393
|
-
$theme
|
|
408
|
+
$theme,
|
|
409
|
+
$size
|
|
394
410
|
} = props;
|
|
395
411
|
const {
|
|
396
412
|
colors
|
|
397
413
|
} = $theme;
|
|
414
|
+
const sizes = {
|
|
415
|
+
[SIZE.mini]: 15,
|
|
416
|
+
[SIZE.compact]: 15,
|
|
417
|
+
[SIZE.default]: 18,
|
|
418
|
+
[SIZE.large]: 22
|
|
419
|
+
};
|
|
420
|
+
let size = sizes[SIZE.default];
|
|
421
|
+
|
|
422
|
+
if ($size) {
|
|
423
|
+
size = sizes[$size];
|
|
424
|
+
}
|
|
425
|
+
|
|
398
426
|
return { ...getSvgStyles({
|
|
399
427
|
$theme
|
|
400
428
|
}),
|
|
401
429
|
color: colors.contentPrimary,
|
|
402
|
-
cursor: 'pointer'
|
|
430
|
+
cursor: 'pointer',
|
|
431
|
+
height: `${size}px`,
|
|
432
|
+
width: `${size}px`
|
|
403
433
|
};
|
|
404
434
|
});
|
|
405
435
|
StyledClearIcon.displayName = "StyledClearIcon";
|
|
@@ -31,6 +31,15 @@ export function useSnackbar() {
|
|
|
31
31
|
dequeue: context.dequeue
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
function usePrevious(value) {
|
|
36
|
+
const ref = React.useRef();
|
|
37
|
+
React.useEffect(() => {
|
|
38
|
+
ref.current = value;
|
|
39
|
+
});
|
|
40
|
+
return ref.current;
|
|
41
|
+
}
|
|
42
|
+
|
|
34
43
|
export default function SnackbarProvider({
|
|
35
44
|
children,
|
|
36
45
|
overrides = {},
|
|
@@ -46,10 +55,6 @@ export default function SnackbarProvider({
|
|
|
46
55
|
|
|
47
56
|
function enqueue(elementProps, duration = defaultDuration) {
|
|
48
57
|
setSnackbars(prev => {
|
|
49
|
-
if (prev.length === 0) {
|
|
50
|
-
enter(duration);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
58
|
return [...prev, {
|
|
54
59
|
elementProps,
|
|
55
60
|
duration
|
|
@@ -57,6 +62,13 @@ export default function SnackbarProvider({
|
|
|
57
62
|
});
|
|
58
63
|
}
|
|
59
64
|
|
|
65
|
+
const prevSnackbars = usePrevious(snackbars) || [];
|
|
66
|
+
React.useEffect(() => {
|
|
67
|
+
if (prevSnackbars.length === 0 && snackbars.length >= 1) {
|
|
68
|
+
enter(snackbars[0].duration);
|
|
69
|
+
}
|
|
70
|
+
}, [snackbars, prevSnackbars]);
|
|
71
|
+
|
|
60
72
|
function dequeue() {
|
|
61
73
|
setContainerHeight(0);
|
|
62
74
|
setSnackbars(prev => {
|
|
@@ -44,7 +44,7 @@ export const StyledActivePath = styled('path', props => ({
|
|
|
44
44
|
})); // TODO(v11): Replace Spinner with SpinnerNext
|
|
45
45
|
|
|
46
46
|
StyledActivePath.displayName = "StyledActivePath";
|
|
47
|
-
export const StyledSpinnerNext = styled('
|
|
47
|
+
export const StyledSpinnerNext = styled('i', ({
|
|
48
48
|
$theme,
|
|
49
49
|
$size = SIZE.medium
|
|
50
50
|
}) => {
|
|
@@ -67,7 +67,8 @@ StyledTableHeadRow.displayName = "StyledTableHeadRow";
|
|
|
67
67
|
export const StyledTableHeadCell = styled('th', ({
|
|
68
68
|
$theme,
|
|
69
69
|
$size,
|
|
70
|
-
$divider
|
|
70
|
+
$divider,
|
|
71
|
+
$isNumeric
|
|
71
72
|
}) => {
|
|
72
73
|
const borderDir = $theme.direction === 'rtl' ? 'Left' : 'Right';
|
|
73
74
|
const borderVertical = $divider === DIVIDER.grid || $divider === DIVIDER.vertical;
|
|
@@ -81,7 +82,7 @@ export const StyledTableHeadCell = styled('th', ({
|
|
|
81
82
|
paddingLeft: padding,
|
|
82
83
|
backgroundColor: $theme.colors.tableHeadBackgroundColor,
|
|
83
84
|
color: $theme.colors.contentPrimary,
|
|
84
|
-
textAlign: $theme.direction === 'rtl' ? 'right' : 'left',
|
|
85
|
+
textAlign: $theme.direction === 'rtl' || $isNumeric ? 'right' : 'left',
|
|
85
86
|
verticalAlign: 'top',
|
|
86
87
|
whiteSpace: 'nowrap',
|
|
87
88
|
zIndex: 1,
|
|
@@ -170,7 +171,8 @@ export const StyledTableBodyCell = styled('td', ({
|
|
|
170
171
|
$size,
|
|
171
172
|
$divider,
|
|
172
173
|
$isNumeric,
|
|
173
|
-
$isLastRow
|
|
174
|
+
$isLastRow,
|
|
175
|
+
$isSortable
|
|
174
176
|
}) => {
|
|
175
177
|
const borderDir = $theme.direction === 'rtl' ? 'Left' : 'Right';
|
|
176
178
|
const borderVertical = $divider === DIVIDER.vertical || $divider === DIVIDER.grid;
|
|
@@ -178,7 +180,7 @@ export const StyledTableBodyCell = styled('td', ({
|
|
|
178
180
|
const padding = sizeToCellPadding($theme, $size);
|
|
179
181
|
return { ...$theme.typography.font200,
|
|
180
182
|
paddingTop: padding,
|
|
181
|
-
paddingRight: padding,
|
|
183
|
+
paddingRight: !$isSortable ? padding : $theme.sizing.scale1000,
|
|
182
184
|
paddingBottom: padding,
|
|
183
185
|
paddingLeft: padding,
|
|
184
186
|
color: $theme.colors.contentPrimary,
|
|
@@ -79,6 +79,7 @@ export default class TableBuilder extends React.Component {
|
|
|
79
79
|
$col: col,
|
|
80
80
|
$colIndex: colIndex,
|
|
81
81
|
$divider: divider,
|
|
82
|
+
$isNumeric: col.numeric,
|
|
82
83
|
$size: size
|
|
83
84
|
}, tableHeadCellProps, colTableHeadCellProps), col.header);
|
|
84
85
|
}
|
|
@@ -117,6 +118,7 @@ export default class TableBuilder extends React.Component {
|
|
|
117
118
|
$col: col,
|
|
118
119
|
$colIndex: colIndex,
|
|
119
120
|
$divider: divider,
|
|
121
|
+
$isNumeric: col.numeric,
|
|
120
122
|
role: "button",
|
|
121
123
|
tabIndex: "0",
|
|
122
124
|
"aria-label": `${col.tableHeadAriaLabel || col.header}, ${sortLabel}`,
|
|
@@ -143,6 +145,7 @@ export default class TableBuilder extends React.Component {
|
|
|
143
145
|
$rowIndex: rowIndex,
|
|
144
146
|
$isNumeric: col.numeric,
|
|
145
147
|
$isLastRow: rowIndex === lastRowindex,
|
|
148
|
+
$isSortable: col.sortable,
|
|
146
149
|
$size: size
|
|
147
150
|
}, tableBodyCellProps, colTableBodyCellProps), col.children(row, rowIndex));
|
|
148
151
|
}
|
|
@@ -91,7 +91,7 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
91
91
|
linkActive: themePrimitives.primary300,
|
|
92
92
|
// List
|
|
93
93
|
listHeaderFill: themePrimitives.mono600,
|
|
94
|
-
listBodyFill: themePrimitives.
|
|
94
|
+
listBodyFill: themePrimitives.mono800,
|
|
95
95
|
listIconFill: themePrimitives.mono100,
|
|
96
96
|
listBorder: themePrimitives.mono500,
|
|
97
97
|
// ProgressSteps
|
|
@@ -20,32 +20,32 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
20
20
|
buttonPrimaryActive: themePrimitives.primary600,
|
|
21
21
|
buttonPrimarySelectedFill: themePrimitives.primary600,
|
|
22
22
|
buttonPrimarySelectedText: themePrimitives.white,
|
|
23
|
-
buttonPrimarySpinnerForeground: themePrimitives.
|
|
24
|
-
buttonPrimarySpinnerBackground: themePrimitives.
|
|
23
|
+
buttonPrimarySpinnerForeground: themePrimitives.accent,
|
|
24
|
+
buttonPrimarySpinnerBackground: themePrimitives.primaryB,
|
|
25
25
|
buttonSecondaryFill: themePrimitives.primary100,
|
|
26
26
|
buttonSecondaryText: themePrimitives.primary,
|
|
27
27
|
buttonSecondaryHover: themePrimitives.primary200,
|
|
28
28
|
buttonSecondaryActive: themePrimitives.primary300,
|
|
29
29
|
buttonSecondarySelectedFill: themePrimitives.primary300,
|
|
30
30
|
buttonSecondarySelectedText: themePrimitives.primary,
|
|
31
|
-
buttonSecondarySpinnerForeground: themePrimitives.
|
|
32
|
-
buttonSecondarySpinnerBackground: themePrimitives.
|
|
31
|
+
buttonSecondarySpinnerForeground: themePrimitives.accent,
|
|
32
|
+
buttonSecondarySpinnerBackground: themePrimitives.primaryB,
|
|
33
33
|
buttonTertiaryFill: 'transparent',
|
|
34
34
|
buttonTertiaryText: themePrimitives.primary,
|
|
35
35
|
buttonTertiaryHover: themePrimitives.primary50,
|
|
36
36
|
buttonTertiaryActive: themePrimitives.primary100,
|
|
37
37
|
buttonTertiarySelectedFill: themePrimitives.primary100,
|
|
38
38
|
buttonTertiarySelectedText: themePrimitives.primary,
|
|
39
|
-
buttonTertiarySpinnerForeground: themePrimitives.
|
|
40
|
-
buttonTertiarySpinnerBackground: themePrimitives.
|
|
39
|
+
buttonTertiarySpinnerForeground: themePrimitives.accent,
|
|
40
|
+
buttonTertiarySpinnerBackground: themePrimitives.primary100,
|
|
41
41
|
buttonMinimalFill: 'transparent',
|
|
42
42
|
buttonMinimalText: themePrimitives.primary,
|
|
43
43
|
buttonMinimalHover: themePrimitives.primary50,
|
|
44
44
|
buttonMinimalActive: themePrimitives.primary100,
|
|
45
45
|
buttonMinimalSelectedFill: themePrimitives.primary100,
|
|
46
46
|
buttonMinimalSelectedText: themePrimitives.primary,
|
|
47
|
-
buttonMinimalSpinnerForeground: themePrimitives.
|
|
48
|
-
buttonMinimalSpinnerBackground: themePrimitives.
|
|
47
|
+
buttonMinimalSpinnerForeground: themePrimitives.accent,
|
|
48
|
+
buttonMinimalSpinnerBackground: themePrimitives.primary100,
|
|
49
49
|
buttonDisabledFill: themePrimitives.mono200,
|
|
50
50
|
buttonDisabledText: themePrimitives.mono600,
|
|
51
51
|
buttonDisabledSpinnerForeground: themePrimitives.mono600,
|
|
@@ -91,7 +91,7 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
91
91
|
linkActive: themePrimitives.primary500,
|
|
92
92
|
// List
|
|
93
93
|
listHeaderFill: themePrimitives.white,
|
|
94
|
-
listBodyFill: themePrimitives.
|
|
94
|
+
listBodyFill: themePrimitives.white,
|
|
95
95
|
listIconFill: themePrimitives.mono500,
|
|
96
96
|
listBorder: themePrimitives.mono500,
|
|
97
97
|
// ProgressSteps
|
|
@@ -15,6 +15,10 @@ const lighting = {
|
|
|
15
15
|
overlay300: 'inset 0 0 0 1000px hsla(0, 0%, 0%, 0.12)',
|
|
16
16
|
overlay400: 'inset 0 0 0 1000px hsla(0, 0%, 0%, 0.16)',
|
|
17
17
|
overlay500: 'inset 0 0 0 1000px hsla(0, 0%, 0%, 0.2)',
|
|
18
|
-
overlay600: 'inset 0 0 0 1000px hsla(0, 0%, 0%, 0.24)'
|
|
18
|
+
overlay600: 'inset 0 0 0 1000px hsla(0, 0%, 0%, 0.24)',
|
|
19
|
+
shallowAbove: '0px -4px 16px rgba(0, 0, 0, 0.12)',
|
|
20
|
+
shallowBelow: '0px 4px 16px rgba(0, 0, 0, 0.12)',
|
|
21
|
+
deepAbove: '0px -16px 48px rgba(0, 0, 0, 0.22)',
|
|
22
|
+
deepBelow: '0px 16px 48px rgba(0, 0, 0, 0.22)'
|
|
19
23
|
};
|
|
20
24
|
export default lighting;
|
|
@@ -152,24 +152,28 @@ class TimePicker extends React.Component {
|
|
|
152
152
|
_defineProperty(this, "getTimeWindowInSeconds", step => {
|
|
153
153
|
let {
|
|
154
154
|
minTime: min,
|
|
155
|
-
maxTime: max
|
|
155
|
+
maxTime: max,
|
|
156
|
+
ignoreMinMaxDateComponent
|
|
156
157
|
} = this.props;
|
|
157
|
-
|
|
158
|
+
const dayStart = this.setTime(this.props.value, 0, 0, 0);
|
|
159
|
+
const dayEnd = this.setTime(this.props.value, 24, 0, 0);
|
|
158
160
|
|
|
159
|
-
if (!min) {
|
|
160
|
-
min =
|
|
161
|
+
if (!min || this.props.adapter.isBefore(min, dayStart) && !ignoreMinMaxDateComponent) {
|
|
162
|
+
min = dayStart;
|
|
163
|
+
} else {
|
|
164
|
+
min = this.setTime(this.props.value, this.props.adapter.getHours(min), this.props.adapter.getMinutes(min), this.props.adapter.getSeconds(min));
|
|
161
165
|
}
|
|
162
166
|
|
|
163
|
-
if (!max) {
|
|
164
|
-
max =
|
|
167
|
+
if (!max || this.props.adapter.isAfter(max, dayEnd) && !ignoreMinMaxDateComponent) {
|
|
168
|
+
max = dayEnd;
|
|
165
169
|
} else {
|
|
166
|
-
// maxTime (if provided) should be inclusive, so add an extra
|
|
167
|
-
|
|
170
|
+
max = this.setTime(this.props.value, this.props.adapter.getHours(max), this.props.adapter.getMinutes(max), // maxTime (if provided) should be inclusive, so add an extra second here
|
|
171
|
+
this.props.adapter.getSeconds(max) + 1);
|
|
168
172
|
}
|
|
169
173
|
|
|
170
174
|
const minDate = this.props.adapter.toJsDate(min);
|
|
171
175
|
const maxDate = this.props.adapter.toJsDate(max);
|
|
172
|
-
const midnightDate = this.props.adapter.toJsDate(
|
|
176
|
+
const midnightDate = this.props.adapter.toJsDate(dayStart);
|
|
173
177
|
return {
|
|
174
178
|
start: (minDate - midnightDate) / 1000,
|
|
175
179
|
end: (maxDate - midnightDate) / 1000
|
|
@@ -248,7 +252,7 @@ class TimePicker extends React.Component {
|
|
|
248
252
|
steps: steps,
|
|
249
253
|
value: this.props.nullable ? undefined : {
|
|
250
254
|
id: closestStep,
|
|
251
|
-
label: this.secondsToLabel(closestStep,
|
|
255
|
+
label: this.secondsToLabel(closestStep, this.props.format)
|
|
252
256
|
}
|
|
253
257
|
});
|
|
254
258
|
|
|
@@ -337,7 +341,8 @@ _defineProperty(TimePicker, "defaultProps", {
|
|
|
337
341
|
format: '12',
|
|
338
342
|
step: 900,
|
|
339
343
|
creatable: false,
|
|
340
|
-
adapter: dateFnsAdapter
|
|
344
|
+
adapter: dateFnsAdapter,
|
|
345
|
+
ignoreMinMaxDateComponent: false
|
|
341
346
|
});
|
|
342
347
|
|
|
343
348
|
export default TimePicker;
|
|
@@ -21,6 +21,10 @@ import { getEndPosition } from '../popover/utils.js';
|
|
|
21
21
|
*/
|
|
22
22
|
export const Body = styled('div', props => ({ ...getBodyStyles(props),
|
|
23
23
|
backgroundColor: props.$theme.colors.tooltipBackground,
|
|
24
|
+
borderTopLeftRadius: props.$theme.borders.radius300,
|
|
25
|
+
borderTopRightRadius: props.$theme.borders.radius300,
|
|
26
|
+
borderBottomRightRadius: props.$theme.borders.radius300,
|
|
27
|
+
borderBottomLeftRadius: props.$theme.borders.radius300,
|
|
24
28
|
boxShadow: props.$theme.lighting.shadow400,
|
|
25
29
|
color: props.$theme.colors.tooltipText,
|
|
26
30
|
// Reset transition property to opacity only, and static transform
|
|
@@ -30,6 +34,10 @@ export const Body = styled('div', props => ({ ...getBodyStyles(props),
|
|
|
30
34
|
Body.displayName = "Body";
|
|
31
35
|
export const Inner = styled('div', props => ({ ...getInnerStyles(props),
|
|
32
36
|
backgroundColor: props.$theme.colors.tooltipBackground,
|
|
37
|
+
borderTopLeftRadius: props.$theme.borders.radius300,
|
|
38
|
+
borderTopRightRadius: props.$theme.borders.radius300,
|
|
39
|
+
borderBottomRightRadius: props.$theme.borders.radius300,
|
|
40
|
+
borderBottomLeftRadius: props.$theme.borders.radius300,
|
|
33
41
|
paddingTop: props.$theme.sizing.scale300,
|
|
34
42
|
paddingBottom: props.$theme.sizing.scale300,
|
|
35
43
|
paddingLeft: props.$theme.sizing.scale600,
|
package/es/tooltip/tooltip.js
CHANGED
|
@@ -45,7 +45,7 @@ export var BaseButton = styled('button', function (_ref) {
|
|
|
45
45
|
cursor: 'pointer',
|
|
46
46
|
':disabled': {
|
|
47
47
|
cursor: 'not-allowed',
|
|
48
|
-
backgroundColor: $theme.colors.buttonDisabledFill,
|
|
48
|
+
backgroundColor: $kind === KIND.minimal || $kind === KIND.tertiary ? 'transparent' : $theme.colors.buttonDisabledFill,
|
|
49
49
|
color: $theme.colors.buttonDisabledText
|
|
50
50
|
},
|
|
51
51
|
marginLeft: 0,
|
|
@@ -90,7 +90,6 @@ export var Title = styled('h1', function (_ref7) {
|
|
|
90
90
|
var $theme = _ref7.$theme;
|
|
91
91
|
return _objectSpread(_objectSpread({}, $theme.typography.HeadingSmall), {}, {
|
|
92
92
|
color: $theme.colors.contentPrimary,
|
|
93
|
-
fontWeight: 500,
|
|
94
93
|
marginLeft: 0,
|
|
95
94
|
marginTop: 0,
|
|
96
95
|
marginRight: 0,
|
package/esm/combobox/combobox.js
CHANGED
|
@@ -292,7 +292,11 @@ function Combobox(props) {
|
|
|
292
292
|
return /*#__PURE__*/React.createElement(Root // eslint-disable-next-line flowtype/no-weak-types
|
|
293
293
|
, _extends({
|
|
294
294
|
ref: rootRef
|
|
295
|
-
}, rootProps), /*#__PURE__*/React.createElement(OverriddenPopover,
|
|
295
|
+
}, rootProps), /*#__PURE__*/React.createElement(OverriddenPopover // React-focus-lock used in Popover used to skip non-tabbable elements (`tabIndex=-1`) elements for focus, we had ListBox with tabIndex to disable focus on
|
|
296
|
+
// the ListBox, but we can just disable autoFocus (as ListBox / ListItem should not be focusable) (and input is also not autoFocused).
|
|
297
|
+
// Select Component does the same thing
|
|
298
|
+
, _extends({
|
|
299
|
+
autoFocus: false,
|
|
296
300
|
isOpen: isOpen,
|
|
297
301
|
overrides: popoverOverrides,
|
|
298
302
|
placement: PLACEMENT.bottomLeft,
|
|
@@ -55,6 +55,7 @@ import { COLUMNS, DATETIME_OPERATIONS } from './constants.js';
|
|
|
55
55
|
import FilterShell from './filter-shell.js';
|
|
56
56
|
import { LocaleContext } from '../locale/index.js';
|
|
57
57
|
var DATE_FORMAT = 'MM-dd-yyyy';
|
|
58
|
+
var MASK = '99-99-9999 - 99-99-9999';
|
|
58
59
|
var TIME_FORMAT = 'HH:mm ss:SS';
|
|
59
60
|
var FORMAT_STRING = "".concat(DATE_FORMAT, " ").concat(TIME_FORMAT);
|
|
60
61
|
|
|
@@ -430,6 +431,7 @@ function DatetimeFilter(props) {
|
|
|
430
431
|
}
|
|
431
432
|
},
|
|
432
433
|
formatString: DATE_FORMAT,
|
|
434
|
+
mask: MASK,
|
|
433
435
|
placeholder: "MM-DD-YYYY - MM-DD-YYYY",
|
|
434
436
|
minDate: datesSorted[0],
|
|
435
437
|
maxDate: datesSorted[datesSorted.length - 1],
|
|
@@ -426,11 +426,12 @@ var InnerTableElement = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
426
426
|
viewState = EMPTY;
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
+
var highlightedRow = ctx.rows[ctx.rowHighlightIndex - 1];
|
|
429
430
|
return /*#__PURE__*/React.createElement("div", {
|
|
430
431
|
ref: ref,
|
|
431
432
|
"data-baseweb": "data-table",
|
|
432
433
|
style: props.style
|
|
433
|
-
}, /*#__PURE__*/React.createElement(Headers, null), viewState === LOADING && /*#__PURE__*/React.createElement(LoadingOrEmptyMessage, null, ctx.loadingMessage), viewState === EMPTY && /*#__PURE__*/React.createElement(LoadingOrEmptyMessage, null, ctx.emptyMessage), viewState === RENDERING && props.children, ctx.rowActions && Boolean(ctx.rowActions.length) && ctx.rowHighlightIndex > 0 && Boolean(
|
|
434
|
+
}, /*#__PURE__*/React.createElement(Headers, null), viewState === LOADING && /*#__PURE__*/React.createElement(LoadingOrEmptyMessage, null, ctx.loadingMessage), viewState === EMPTY && /*#__PURE__*/React.createElement(LoadingOrEmptyMessage, null, ctx.emptyMessage), viewState === RENDERING && props.children, ctx.rowActions && Boolean(ctx.rowActions.length) && ctx.rowHighlightIndex > 0 && Boolean(highlightedRow) && !ctx.isScrollingX && /*#__PURE__*/React.createElement("div", {
|
|
434
435
|
style: {
|
|
435
436
|
alignItems: 'center',
|
|
436
437
|
backgroundColor: theme.colors.backgroundTertiary,
|
|
@@ -444,7 +445,12 @@ var InnerTableElement = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
444
445
|
left: theme.direction === 'rtl' ? 0 : 'initial',
|
|
445
446
|
top: (ctx.rowHighlightIndex - 1) * ctx.rowHeight + HEADER_ROW_HEIGHT
|
|
446
447
|
}
|
|
447
|
-
}, ctx.rowActions.map(function (rowAction) {
|
|
448
|
+
}, (typeof ctx.rowActions === 'function' ? ctx.rowActions(highlightedRow) : ctx.rowActions).map(function (rowAction) {
|
|
449
|
+
if (rowAction.renderButton) {
|
|
450
|
+
var RowActionButton = rowAction.renderButton;
|
|
451
|
+
return /*#__PURE__*/React.createElement(RowActionButton, null);
|
|
452
|
+
}
|
|
453
|
+
|
|
448
454
|
var RowActionIcon = rowAction.renderIcon;
|
|
449
455
|
return /*#__PURE__*/React.createElement(Button, {
|
|
450
456
|
alt: rowAction.label,
|
|
@@ -461,7 +467,11 @@ var InnerTableElement = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
461
467
|
overrides: {
|
|
462
468
|
BaseButton: {
|
|
463
469
|
style: {
|
|
464
|
-
marginLeft: theme.sizing.scale300
|
|
470
|
+
marginLeft: theme.sizing.scale300,
|
|
471
|
+
paddingTop: theme.sizing.scale100,
|
|
472
|
+
paddingRight: theme.sizing.scale100,
|
|
473
|
+
paddingBottom: theme.sizing.scale100,
|
|
474
|
+
paddingLeft: theme.sizing.scale100
|
|
465
475
|
}
|
|
466
476
|
}
|
|
467
477
|
}
|