baseui 10.5.0 → 10.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/drawer.js +2 -1
- package/drawer/drawer.js.flow +1 -1
- 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/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/drawer.js +2 -1
- package/es/helper/helper.js +1 -0
- package/es/layer/layer.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 +5 -5
- package/es/select/styled-components.js +34 -4
- package/es/snackbar/snackbar-context.js +16 -4
- 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/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/drawer.js +2 -1
- package/esm/helper/helper.js +1 -0
- package/esm/layer/layer.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 +5 -5
- package/esm/select/styled-components.js +28 -4
- package/esm/snackbar/snackbar-context.js +16 -4
- 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/map-marker/index.d.ts +6 -5
- 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 +4 -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 +5 -5
- package/select/select-component.js.flow +5 -5
- package/select/styled-components.js +28 -4
- package/select/styled-components.js.flow +30 -2
- package/snackbar/index.d.ts +21 -16
- package/snackbar/snackbar-context.js +15 -4
- package/snackbar/snackbar-context.js.flow +15 -3
- 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
package/es/popover/popover.js
CHANGED
|
@@ -13,7 +13,7 @@ LICENSE file in the root directory of this source tree.
|
|
|
13
13
|
|
|
14
14
|
/* eslint-disable cup/no-undef */
|
|
15
15
|
import * as React from 'react';
|
|
16
|
-
import FocusLock from 'react-focus-lock';
|
|
16
|
+
import FocusLock, { MoveFocusInside } from 'react-focus-lock';
|
|
17
17
|
import { getOverride, getOverrideProps } from '../helpers/overrides.js';
|
|
18
18
|
import { ACCESSIBILITY_TYPE, PLACEMENT, TRIGGER_TYPE, ANIMATE_OUT_TIME, ANIMATE_IN_TIME, POPOVER_MARGIN } from './constants.js';
|
|
19
19
|
import { Layer, TetherBehavior } from '../layer/index.js';
|
|
@@ -156,7 +156,7 @@ class PopoverInner extends React.Component {
|
|
|
156
156
|
componentDidUpdate(prevProps, prevState) {
|
|
157
157
|
this.init(prevProps, prevState);
|
|
158
158
|
|
|
159
|
-
if (this.props.autoFocus &&
|
|
159
|
+
if (this.props.autoFocus && !this.state.autoFocusAfterPositioning && this.popperRef.current !== null && this.popperRef.current.getBoundingClientRect().top > 0) {
|
|
160
160
|
this.setState({
|
|
161
161
|
autoFocusAfterPositioning: true
|
|
162
162
|
});
|
|
@@ -451,9 +451,10 @@ class PopoverInner extends React.Component {
|
|
|
451
451
|
disabled: !this.props.focusLock,
|
|
452
452
|
noFocusGuards: false // see popover-focus-loop.scenario.js for why hover cannot return focus
|
|
453
453
|
,
|
|
454
|
-
returnFocus: this.
|
|
455
|
-
autoFocus: this.state.autoFocusAfterPositioning
|
|
456
|
-
|
|
454
|
+
returnFocus: !this.isHoverTrigger() && this.props.returnFocus,
|
|
455
|
+
autoFocus: this.state.autoFocusAfterPositioning,
|
|
456
|
+
focusOptions: this.props.focusOptions
|
|
457
|
+
}, !this.props.focusLock && this.state.autoFocusAfterPositioning ? /*#__PURE__*/React.createElement(MoveFocusInside, null, this.renderPopover(renderedContent)) : this.renderPopover(renderedContent)))));
|
|
457
458
|
} else {
|
|
458
459
|
rendered.push( /*#__PURE__*/React.createElement(Hidden, {
|
|
459
460
|
key: "hidden-layer"
|
|
@@ -25,6 +25,10 @@ class StatefulContainer extends React.Component {
|
|
|
25
25
|
this.props.onBlur(e);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
if (this.props.focusLock || this.props.autoFocus) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
this.close();
|
|
29
33
|
});
|
|
30
34
|
|
|
@@ -158,7 +162,8 @@ class StatefulContainer extends React.Component {
|
|
|
158
162
|
returnFocus,
|
|
159
163
|
showArrow,
|
|
160
164
|
triggerType,
|
|
161
|
-
popoverMargin
|
|
165
|
+
popoverMargin,
|
|
166
|
+
focusOptions
|
|
162
167
|
} = this.props;
|
|
163
168
|
const popoverProps = {
|
|
164
169
|
accessibilityType,
|
|
@@ -182,7 +187,8 @@ class StatefulContainer extends React.Component {
|
|
|
182
187
|
returnFocus,
|
|
183
188
|
showArrow,
|
|
184
189
|
triggerType,
|
|
185
|
-
popoverMargin
|
|
190
|
+
popoverMargin,
|
|
191
|
+
focusOptions
|
|
186
192
|
};
|
|
187
193
|
|
|
188
194
|
if (dismissOnClickOutside) {
|
|
@@ -144,7 +144,9 @@ class EmoticonRating extends React.Component {
|
|
|
144
144
|
return /*#__PURE__*/React.createElement(Root, _extends({
|
|
145
145
|
"data-baseweb": "emoticon-rating",
|
|
146
146
|
role: "radiogroup",
|
|
147
|
-
onBlur:
|
|
147
|
+
onBlur: e => {
|
|
148
|
+
if (!e.currentTarget.contains(e.relatedTarget)) this.updatePreview(undefined);
|
|
149
|
+
},
|
|
148
150
|
onMouseLeave: () => this.updatePreview(undefined)
|
|
149
151
|
}, rootProps), this.renderRatingContents());
|
|
150
152
|
}
|
package/es/rating/star-rating.js
CHANGED
|
@@ -147,7 +147,9 @@ class StarRating extends React.Component {
|
|
|
147
147
|
return /*#__PURE__*/React.createElement(Root, _extends({
|
|
148
148
|
"data-baseweb": "star-rating",
|
|
149
149
|
role: "radiogroup",
|
|
150
|
-
onBlur:
|
|
150
|
+
onBlur: e => {
|
|
151
|
+
if (!e.currentTarget.contains(e.relatedTarget)) this.updatePreview(undefined);
|
|
152
|
+
},
|
|
151
153
|
onMouseLeave: () => this.updatePreview(undefined)
|
|
152
154
|
}, rootProps), this.renderRatingContents());
|
|
153
155
|
}
|
|
@@ -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,7 @@ class Select extends React.Component {
|
|
|
565
565
|
this.focus();
|
|
566
566
|
}
|
|
567
567
|
|
|
568
|
-
this.
|
|
568
|
+
this.isItMounted = true;
|
|
569
569
|
|
|
570
570
|
if (this.props.methodsRef) {
|
|
571
571
|
const {
|
|
@@ -601,7 +601,7 @@ class Select extends React.Component {
|
|
|
601
601
|
document.removeEventListener('click', this.handleClickOutside);
|
|
602
602
|
}
|
|
603
603
|
|
|
604
|
-
this.
|
|
604
|
+
this.isItMounted = false;
|
|
605
605
|
}
|
|
606
606
|
|
|
607
607
|
focus() {
|
|
@@ -797,7 +797,6 @@ class Select extends React.Component {
|
|
|
797
797
|
const [ClearIcon, clearIconProps] = getOverrides(overrides.ClearIcon, DeleteAlt);
|
|
798
798
|
const ariaLabel = this.props.multi ? 'Clear all' : 'Clear value';
|
|
799
799
|
return /*#__PURE__*/React.createElement(ClearIcon, _extends({
|
|
800
|
-
size: 16,
|
|
801
800
|
title: ariaLabel,
|
|
802
801
|
"aria-label": ariaLabel,
|
|
803
802
|
onClick: this.clearValue,
|
|
@@ -971,6 +970,7 @@ class Select extends React.Component {
|
|
|
971
970
|
if (!ref) return;
|
|
972
971
|
this.anchor = ref.anchorRef;
|
|
973
972
|
},
|
|
973
|
+
autoFocus: false,
|
|
974
974
|
focusLock: false,
|
|
975
975
|
mountNode: this.props.mountNode,
|
|
976
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 => {
|
|
@@ -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],
|