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
|
@@ -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) {
|
|
@@ -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
|
|
@@ -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
|
|
@@ -15,6 +15,10 @@ var 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;
|
|
@@ -206,26 +206,31 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
206
206
|
_defineProperty(_assertThisInitialized(_this), "getTimeWindowInSeconds", function (step) {
|
|
207
207
|
var _this$props = _this.props,
|
|
208
208
|
min = _this$props.minTime,
|
|
209
|
-
max = _this$props.maxTime
|
|
209
|
+
max = _this$props.maxTime,
|
|
210
|
+
ignoreMinMaxDateComponent = _this$props.ignoreMinMaxDateComponent;
|
|
210
211
|
|
|
211
|
-
var
|
|
212
|
+
var dayStart = _this.setTime(_this.props.value, 0, 0, 0);
|
|
212
213
|
|
|
213
|
-
|
|
214
|
-
|
|
214
|
+
var dayEnd = _this.setTime(_this.props.value, 24, 0, 0);
|
|
215
|
+
|
|
216
|
+
if (!min || _this.props.adapter.isBefore(min, dayStart) && !ignoreMinMaxDateComponent) {
|
|
217
|
+
min = dayStart;
|
|
218
|
+
} else {
|
|
219
|
+
min = _this.setTime(_this.props.value, _this.props.adapter.getHours(min), _this.props.adapter.getMinutes(min), _this.props.adapter.getSeconds(min));
|
|
215
220
|
}
|
|
216
221
|
|
|
217
|
-
if (!max) {
|
|
218
|
-
max =
|
|
222
|
+
if (!max || _this.props.adapter.isAfter(max, dayEnd) && !ignoreMinMaxDateComponent) {
|
|
223
|
+
max = dayEnd;
|
|
219
224
|
} else {
|
|
220
|
-
// maxTime (if provided) should be inclusive, so add an extra
|
|
221
|
-
|
|
225
|
+
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
|
|
226
|
+
_this.props.adapter.getSeconds(max) + 1);
|
|
222
227
|
}
|
|
223
228
|
|
|
224
229
|
var minDate = _this.props.adapter.toJsDate(min);
|
|
225
230
|
|
|
226
231
|
var maxDate = _this.props.adapter.toJsDate(max);
|
|
227
232
|
|
|
228
|
-
var midnightDate = _this.props.adapter.toJsDate(
|
|
233
|
+
var midnightDate = _this.props.adapter.toJsDate(dayStart);
|
|
229
234
|
|
|
230
235
|
return {
|
|
231
236
|
start: (minDate - midnightDate) / 1000,
|
|
@@ -312,7 +317,7 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
312
317
|
steps: steps,
|
|
313
318
|
value: this.props.nullable ? undefined : {
|
|
314
319
|
id: closestStep,
|
|
315
|
-
label: this.secondsToLabel(closestStep,
|
|
320
|
+
label: this.secondsToLabel(closestStep, this.props.format)
|
|
316
321
|
}
|
|
317
322
|
});
|
|
318
323
|
|
|
@@ -414,7 +419,8 @@ _defineProperty(TimePicker, "defaultProps", {
|
|
|
414
419
|
format: '12',
|
|
415
420
|
step: 900,
|
|
416
421
|
creatable: false,
|
|
417
|
-
adapter: dateFnsAdapter
|
|
422
|
+
adapter: dateFnsAdapter,
|
|
423
|
+
ignoreMinMaxDateComponent: false
|
|
418
424
|
});
|
|
419
425
|
|
|
420
426
|
export default TimePicker;
|
|
@@ -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/esm/tooltip/tooltip.js
CHANGED
|
@@ -62,6 +62,7 @@ var Tooltip = /*#__PURE__*/function (_React$Component) {
|
|
|
62
62
|
Inner: StyledInner
|
|
63
63
|
}, this.props.overrides);
|
|
64
64
|
return /*#__PURE__*/React.createElement(Popover, _extends({
|
|
65
|
+
autoFocus: false,
|
|
65
66
|
"data-baseweb": "tooltip"
|
|
66
67
|
}, this.props, {
|
|
67
68
|
overrides: overrides
|
package/helper/helper.js
CHANGED
package/helper/helper.js.flow
CHANGED
package/layer/layer.js
CHANGED
|
@@ -141,6 +141,14 @@ var LayerComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
141
141
|
if (host && host !== prevProps.host && prevProps.host === null) {
|
|
142
142
|
this.addContainer(host);
|
|
143
143
|
}
|
|
144
|
+
|
|
145
|
+
if (prevProps.isHoverLayer != this.props.isHoverLayer) {
|
|
146
|
+
if (this.props.isHoverLayer) {
|
|
147
|
+
this.context.removeDocClickHandler(this.onDocumentClick);
|
|
148
|
+
} else {
|
|
149
|
+
this.context.addDocClickHandler(this.onDocumentClick);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
144
152
|
}
|
|
145
153
|
}, {
|
|
146
154
|
key: "componentWillUnmount",
|
package/layer/layer.js.flow
CHANGED
|
@@ -61,9 +61,18 @@ class LayerComponent extends React.Component<
|
|
|
61
61
|
if (mountNode) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
+
|
|
64
65
|
if (host && host !== prevProps.host && prevProps.host === null) {
|
|
65
66
|
this.addContainer(host);
|
|
66
67
|
}
|
|
68
|
+
|
|
69
|
+
if (prevProps.isHoverLayer != this.props.isHoverLayer) {
|
|
70
|
+
if (this.props.isHoverLayer) {
|
|
71
|
+
this.context.removeDocClickHandler(this.onDocumentClick);
|
|
72
|
+
} else {
|
|
73
|
+
this.context.addDocClickHandler(this.onDocumentClick);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
67
76
|
}
|
|
68
77
|
|
|
69
78
|
componentWillUnmount() {
|
package/link/index.d.ts
CHANGED
package/map-marker/index.d.ts
CHANGED
|
@@ -40,11 +40,12 @@ export interface FLOATING_MARKER_ANCHOR_TYPES {
|
|
|
40
40
|
square: 'square';
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export type NeedleSizeT =
|
|
44
|
-
export type PinHeadT =
|
|
45
|
-
export type PinHeadSizeT =
|
|
46
|
-
export type AnchorPositionsT =
|
|
47
|
-
export type FloatingMarkerSizeT =
|
|
43
|
+
export type NeedleSizeT = NEEDLE_SIZES[keyof NEEDLE_SIZES];
|
|
44
|
+
export type PinHeadT = PINHEAD_TYPES[keyof PINHEAD_TYPES];
|
|
45
|
+
export type PinHeadSizeT = PINHEAD_SIZES_SHAPES[keyof PINHEAD_SIZES_SHAPES];
|
|
46
|
+
export type AnchorPositionsT = FLOATING_MARKER_ANCHOR_POSITIONS[keyof FLOATING_MARKER_ANCHOR_POSITIONS];
|
|
47
|
+
export type FloatingMarkerSizeT = FLOATING_MARKER_SIZES[keyof FLOATING_MARKER_SIZES];
|
|
48
|
+
export type FloatingMarkerAnchorTypeT = FLOATING_MARKER_ANCHOR_TYPES[keyof FLOATING_MARKER_ANCHOR_TYPES];
|
|
48
49
|
|
|
49
50
|
export type FixedMarkerOverridesT = {
|
|
50
51
|
Root?: Override<any>;
|
package/menu/index.d.ts
CHANGED
|
@@ -123,6 +123,7 @@ export interface OptionListProps extends BaseMenuPropsT {
|
|
|
123
123
|
item: any;
|
|
124
124
|
getItemLabel: (item: any) => React.ReactNode;
|
|
125
125
|
getChildMenu?: (item: any) => React.ReactNode;
|
|
126
|
+
onMouseDown?: (event: MouseEvent) => any;
|
|
126
127
|
onMouseEnter?: (event: MouseEvent) => any;
|
|
127
128
|
size?: OPTION_LIST_SIZE[keyof OPTION_LIST_SIZE];
|
|
128
129
|
overrides?: {
|
|
@@ -133,6 +134,12 @@ export interface OptionListProps extends BaseMenuPropsT {
|
|
|
133
134
|
resetMenu?: () => void;
|
|
134
135
|
$isHighlighted?: boolean;
|
|
135
136
|
$isFocused?: boolean;
|
|
137
|
+
renderAll?: boolean;
|
|
138
|
+
$disabled?: boolean;
|
|
139
|
+
'aria-disabled'?: boolean;
|
|
140
|
+
'aria-selected'?: boolean;
|
|
141
|
+
id?: string;
|
|
142
|
+
role?: string;
|
|
136
143
|
}
|
|
137
144
|
export const OptionList: React.FC<OptionListProps>;
|
|
138
145
|
|
package/menu/maybe-child-menu.js
CHANGED
|
@@ -55,6 +55,7 @@ function MaybeChildMenu(props) {
|
|
|
55
55
|
return /*#__PURE__*/React.createElement(_nestedMenus.NestedMenuContext.Consumer, null, function (ctx) {
|
|
56
56
|
return /*#__PURE__*/React.createElement(PopoverOverride, _extends({
|
|
57
57
|
focusLock: false,
|
|
58
|
+
autoFocus: false,
|
|
58
59
|
isOpen: props.isOpen,
|
|
59
60
|
renderAll: props.renderAll,
|
|
60
61
|
content: ChildMenu,
|
package/menu/types.js.flow
CHANGED
|
@@ -234,6 +234,8 @@ export type OptionListPropsT = {
|
|
|
234
234
|
getChildMenu?: (item: ItemT) => React.Node,
|
|
235
235
|
onClick?: (event: MouseEvent) => mixed,
|
|
236
236
|
/** Callback used to change highlighted index in stateful menu. */
|
|
237
|
+
onMouseDown?: (event: MouseEvent) => mixed,
|
|
238
|
+
/** Callback used to change highlighted index in stateful menu. */
|
|
237
239
|
onMouseEnter?: (event: MouseEvent) => mixed,
|
|
238
240
|
/** Renders UI in defined scale. */
|
|
239
241
|
size?: $Keys<typeof OPTION_LIST_SIZE>,
|
|
@@ -251,6 +253,16 @@ export type OptionListPropsT = {
|
|
|
251
253
|
$isFocused?: boolean,
|
|
252
254
|
/** Renders all menu content for SEO purposes regardless of menu state */
|
|
253
255
|
renderAll?: boolean,
|
|
256
|
+
/** Is the item disabled */
|
|
257
|
+
$disabled?: boolean,
|
|
258
|
+
/** Is the item disabled */
|
|
259
|
+
'aria-disabled'?: boolean,
|
|
260
|
+
/** Is the item selected */
|
|
261
|
+
'aria-selected'?: boolean,
|
|
262
|
+
/** Id of the item */
|
|
263
|
+
id?: string,
|
|
264
|
+
/** Accessibility role of the item */
|
|
265
|
+
role?: string,
|
|
254
266
|
};
|
|
255
267
|
|
|
256
268
|
export type OptionProfilePropsT = {
|
package/modal/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export interface ModalProps {
|
|
|
47
47
|
autofocus?: boolean;
|
|
48
48
|
autoFocus?: boolean;
|
|
49
49
|
focusLock?: boolean;
|
|
50
|
-
returnFocus?: boolean | FocusOptions;
|
|
50
|
+
returnFocus?: boolean | FocusOptions | ((returnTo: Element) => boolean | FocusOptions);
|
|
51
51
|
children?: React.ReactNode;
|
|
52
52
|
closeable?: boolean;
|
|
53
53
|
isOpen?: boolean;
|
package/modal/types.js.flow
CHANGED
|
@@ -48,7 +48,10 @@ export type ModalPropsT = {
|
|
|
48
48
|
* Optionally, can pass focus options instead of `true` to control the focus
|
|
49
49
|
* more precisely (ie. `{ preventScroll: true }`)
|
|
50
50
|
*/
|
|
51
|
-
returnFocus?:
|
|
51
|
+
returnFocus?:
|
|
52
|
+
| boolean
|
|
53
|
+
| FocusOptions
|
|
54
|
+
| ((returnTo: Element) => boolean | FocusOptions),
|
|
52
55
|
/** Modal content. The children-as-function API may be preferable
|
|
53
56
|
* for performance reasons (wont render until opened) */
|
|
54
57
|
children?: React.Node | (() => React.Node),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "baseui",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.7.2",
|
|
4
4
|
"description": "A React Component library implementing the Base design language",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@commitlint/config-conventional": "^8.0.0",
|
|
82
82
|
"@date-io/luxon": "^2.7.0",
|
|
83
83
|
"@date-io/moment": "^2.7.0",
|
|
84
|
-
"@ladle/react": "^0.
|
|
84
|
+
"@ladle/react": "^0.3.0",
|
|
85
85
|
"@mdx-js/tag": "^0.20.0",
|
|
86
86
|
"@octokit/rest": "^16.33.1",
|
|
87
87
|
"@svgr/cli": "^4.3.2",
|
|
@@ -197,10 +197,11 @@
|
|
|
197
197
|
"glob": "^7.1.6",
|
|
198
198
|
"just-extend": "^4.0.2",
|
|
199
199
|
"memoize-one": "^5.1.1",
|
|
200
|
+
"mockdate": "^3.0.5",
|
|
200
201
|
"polished": "^3.2.0",
|
|
201
202
|
"popper.js": "^1.16.0",
|
|
202
203
|
"react-dropzone": "^9.0.0",
|
|
203
|
-
"react-focus-lock": "^2.
|
|
204
|
+
"react-focus-lock": "^2.7.1",
|
|
204
205
|
"react-input-mask": "^2.0.4",
|
|
205
206
|
"react-is": "^16.8.6",
|
|
206
207
|
"react-movable": "^2.5.4",
|
package/popover/index.d.ts
CHANGED
|
@@ -96,7 +96,8 @@ export interface BasePopoverProps {
|
|
|
96
96
|
accessibilityType?: ACCESSIBILITY_TYPE[keyof ACCESSIBILITY_TYPE];
|
|
97
97
|
focusLock?: boolean;
|
|
98
98
|
autoFocus?: boolean;
|
|
99
|
-
|
|
99
|
+
focusOptions?: FocusOptions;
|
|
100
|
+
returnFocus?: boolean | FocusOptions | ((returnTo: Element) => (boolean | FocusOptions));
|
|
100
101
|
'data-baseweb'?: string;
|
|
101
102
|
id?: string;
|
|
102
103
|
ignoreBoundary?: boolean;
|
package/popover/popover.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
-
var _reactFocusLock =
|
|
10
|
+
var _reactFocusLock = _interopRequireWildcard(require("react-focus-lock"));
|
|
11
11
|
|
|
12
12
|
var _overrides = require("../helpers/overrides.js");
|
|
13
13
|
|
|
@@ -213,7 +213,7 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
|
|
|
213
213
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
214
214
|
this.init(prevProps, prevState);
|
|
215
215
|
|
|
216
|
-
if (this.props.autoFocus &&
|
|
216
|
+
if (this.props.autoFocus && !this.state.autoFocusAfterPositioning && this.popperRef.current !== null && this.popperRef.current.getBoundingClientRect().top > 0) {
|
|
217
217
|
this.setState({
|
|
218
218
|
autoFocusAfterPositioning: true
|
|
219
219
|
});
|
|
@@ -529,9 +529,10 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
|
|
|
529
529
|
disabled: !this.props.focusLock,
|
|
530
530
|
noFocusGuards: false // see popover-focus-loop.scenario.js for why hover cannot return focus
|
|
531
531
|
,
|
|
532
|
-
returnFocus: this.
|
|
533
|
-
autoFocus: this.state.autoFocusAfterPositioning
|
|
534
|
-
|
|
532
|
+
returnFocus: !this.isHoverTrigger() && this.props.returnFocus,
|
|
533
|
+
autoFocus: this.state.autoFocusAfterPositioning,
|
|
534
|
+
focusOptions: this.props.focusOptions
|
|
535
|
+
}, !this.props.focusLock && this.state.autoFocusAfterPositioning ? /*#__PURE__*/React.createElement(_reactFocusLock.MoveFocusInside, null, this.renderPopover(renderedContent)) : this.renderPopover(renderedContent)))));
|
|
535
536
|
} else {
|
|
536
537
|
rendered.push( /*#__PURE__*/React.createElement(_styledComponents.Hidden, {
|
|
537
538
|
key: "hidden-layer"
|
package/popover/popover.js.flow
CHANGED
|
@@ -8,7 +8,7 @@ LICENSE file in the root directory of this source tree.
|
|
|
8
8
|
/* eslint-disable react/no-find-dom-node */
|
|
9
9
|
/* eslint-disable cup/no-undef */
|
|
10
10
|
import * as React from 'react';
|
|
11
|
-
import FocusLock from 'react-focus-lock';
|
|
11
|
+
import FocusLock, {MoveFocusInside} from 'react-focus-lock';
|
|
12
12
|
|
|
13
13
|
import {getOverride, getOverrideProps} from '../helpers/overrides.js';
|
|
14
14
|
import {
|
|
@@ -73,7 +73,6 @@ class PopoverInner extends React.Component<
|
|
|
73
73
|
this.init(prevProps, prevState);
|
|
74
74
|
if (
|
|
75
75
|
this.props.autoFocus &&
|
|
76
|
-
this.props.focusLock &&
|
|
77
76
|
!this.state.autoFocusAfterPositioning &&
|
|
78
77
|
this.popperRef.current !== null &&
|
|
79
78
|
this.popperRef.current.getBoundingClientRect().top > 0
|
|
@@ -475,10 +474,18 @@ class PopoverInner extends React.Component<
|
|
|
475
474
|
disabled={!this.props.focusLock}
|
|
476
475
|
noFocusGuards={false}
|
|
477
476
|
// see popover-focus-loop.scenario.js for why hover cannot return focus
|
|
478
|
-
returnFocus={this.
|
|
477
|
+
returnFocus={!this.isHoverTrigger() && this.props.returnFocus}
|
|
479
478
|
autoFocus={this.state.autoFocusAfterPositioning}
|
|
479
|
+
focusOptions={this.props.focusOptions}
|
|
480
480
|
>
|
|
481
|
-
{this.
|
|
481
|
+
{!this.props.focusLock &&
|
|
482
|
+
this.state.autoFocusAfterPositioning ? (
|
|
483
|
+
<MoveFocusInside>
|
|
484
|
+
{this.renderPopover(renderedContent)}
|
|
485
|
+
</MoveFocusInside>
|
|
486
|
+
) : (
|
|
487
|
+
this.renderPopover(renderedContent)
|
|
488
|
+
)}
|
|
482
489
|
</FocusLock>
|
|
483
490
|
</TetherBehavior>
|
|
484
491
|
</Layer>,
|
|
@@ -70,6 +70,10 @@ var StatefulContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
70
70
|
_this.props.onBlur(e);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
if (_this.props.focusLock || _this.props.autoFocus) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
73
77
|
_this.close();
|
|
74
78
|
});
|
|
75
79
|
|
|
@@ -208,7 +212,8 @@ var StatefulContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
208
212
|
returnFocus = _this$props.returnFocus,
|
|
209
213
|
showArrow = _this$props.showArrow,
|
|
210
214
|
triggerType = _this$props.triggerType,
|
|
211
|
-
popoverMargin = _this$props.popoverMargin
|
|
215
|
+
popoverMargin = _this$props.popoverMargin,
|
|
216
|
+
focusOptions = _this$props.focusOptions;
|
|
212
217
|
var popoverProps = {
|
|
213
218
|
accessibilityType: accessibilityType,
|
|
214
219
|
autoFocus: autoFocus,
|
|
@@ -231,7 +236,8 @@ var StatefulContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
231
236
|
returnFocus: returnFocus,
|
|
232
237
|
showArrow: showArrow,
|
|
233
238
|
triggerType: triggerType,
|
|
234
|
-
popoverMargin: popoverMargin
|
|
239
|
+
popoverMargin: popoverMargin,
|
|
240
|
+
focusOptions: focusOptions
|
|
235
241
|
};
|
|
236
242
|
|
|
237
243
|
if (dismissOnClickOutside) {
|