baseui 0.0.0-alpha-55228a8 → 0.0.0-alpha-5f4bc37
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/card/styled-components.js +0 -1
- package/card/styled-components.js.flow +0 -1
- package/combobox/combobox.js +11 -4
- package/combobox/combobox.js.flow +8 -2
- package/combobox/index.d.ts +6 -3
- package/combobox/types.js.flow +2 -0
- package/data-table/column-datetime.js +3 -1
- package/data-table/column-datetime.js.flow +3 -1
- package/datepicker/calendar-header.js +255 -109
- package/datepicker/calendar-header.js.flow +282 -145
- package/datepicker/calendar.js +18 -7
- package/datepicker/calendar.js.flow +28 -13
- package/datepicker/constants.js +9 -2
- package/datepicker/constants.js.flow +7 -0
- package/datepicker/datepicker.js +149 -76
- package/datepicker/datepicker.js.flow +185 -71
- package/datepicker/day.js +59 -30
- package/datepicker/day.js.flow +104 -51
- package/datepicker/index.d.ts +7 -0
- package/datepicker/month.js +4 -0
- package/datepicker/month.js.flow +3 -0
- package/datepicker/stateful-container.js.flow +2 -1
- package/datepicker/styled-components.js +117 -57
- package/datepicker/styled-components.js.flow +105 -37
- package/datepicker/types.js.flow +28 -10
- 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/card/styled-components.js +0 -1
- package/es/combobox/combobox.js +11 -4
- package/es/data-table/column-datetime.js +3 -1
- package/es/datepicker/calendar-header.js +204 -93
- package/es/datepicker/calendar.js +19 -8
- package/es/datepicker/constants.js +6 -1
- package/es/datepicker/datepicker.js +84 -46
- package/es/datepicker/day.js +52 -30
- package/es/datepicker/month.js +3 -0
- package/es/datepicker/styled-components.js +99 -38
- 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 -2
- package/es/menu/nested-menus.js +49 -3
- package/es/menu/stateful-container.js +13 -12
- package/es/popover/popover.js +8 -5
- package/es/popover/stateful-container.js +5 -3
- package/es/progress-bar/progressbar.js +10 -3
- package/es/rating/emoticon-rating.js +3 -1
- package/es/rating/star-rating.js +3 -1
- package/es/select/select-component.js +7 -14
- package/es/snackbar/snackbar-context.js +16 -4
- package/es/spinner/styled-components.js +34 -16
- package/es/themes/dark-theme/color-component-tokens.js +16 -11
- package/es/themes/light-theme/color-component-tokens.js +24 -19
- package/es/themes/shared/lighting.js +5 -1
- package/es/timepicker/timepicker.js +16 -11
- package/es/toast/styled-components.js +18 -7
- package/es/tooltip/tooltip.js +1 -0
- package/esm/app-nav-bar/user-menu.js +1 -0
- package/esm/card/styled-components.js +0 -1
- package/esm/combobox/combobox.js +11 -4
- package/esm/data-table/column-datetime.js +3 -1
- package/esm/datepicker/calendar-header.js +255 -110
- package/esm/datepicker/calendar.js +19 -8
- package/esm/datepicker/constants.js +6 -1
- package/esm/datepicker/datepicker.js +150 -77
- package/esm/datepicker/day.js +59 -30
- package/esm/datepicker/month.js +3 -0
- package/esm/datepicker/styled-components.js +113 -56
- 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 -2
- package/esm/menu/nested-menus.js +66 -5
- package/esm/menu/stateful-container.js +15 -13
- package/esm/popover/popover.js +8 -5
- package/esm/popover/stateful-container.js +5 -3
- package/esm/progress-bar/progressbar.js +16 -3
- package/esm/rating/emoticon-rating.js +2 -2
- package/esm/rating/star-rating.js +2 -2
- package/esm/select/select-component.js +7 -15
- package/esm/snackbar/snackbar-context.js +16 -4
- package/esm/spinner/styled-components.js +35 -16
- package/esm/themes/dark-theme/color-component-tokens.js +16 -11
- package/esm/themes/light-theme/color-component-tokens.js +24 -19
- package/esm/themes/shared/lighting.js +5 -1
- package/esm/timepicker/timepicker.js +17 -11
- package/esm/toast/styled-components.js +13 -5
- 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 +9 -4
- package/menu/maybe-child-menu.js +1 -2
- package/menu/maybe-child-menu.js.flow +1 -2
- package/menu/nested-menus.js +66 -5
- package/menu/nested-menus.js.flow +50 -5
- package/menu/stateful-container.js +15 -13
- package/menu/stateful-container.js.flow +19 -13
- package/menu/types.js.flow +7 -1
- 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 +8 -5
- package/popover/popover.js.flow +22 -11
- package/popover/stateful-container.js +5 -3
- package/popover/stateful-container.js.flow +3 -4
- package/popover/types.js.flow +6 -1
- package/progress-bar/progressbar.js +16 -3
- package/progress-bar/progressbar.js.flow +16 -2
- 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 +7 -15
- package/select/select-component.js.flow +10 -11
- 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 +35 -16
- package/spinner/styled-components.js.flow +37 -19
- package/spinner/types.js.flow +10 -0
- package/themes/dark-theme/color-component-tokens.js +16 -11
- package/themes/dark-theme/color-component-tokens.js.flow +16 -11
- package/themes/light-theme/color-component-tokens.js +24 -19
- package/themes/light-theme/color-component-tokens.js.flow +24 -19
- package/themes/shared/lighting.js +5 -1
- package/themes/shared/lighting.js.flow +4 -0
- package/themes/types.js.flow +9 -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/toast/styled-components.js +13 -5
- package/toast/styled-components.js.flow +17 -7
- package/tooltip/tooltip.js +1 -0
- package/tooltip/tooltip.js.flow +6 -1
package/app-nav-bar/user-menu.js
CHANGED
|
@@ -98,7 +98,6 @@ var Title = (0, _index.styled)('h1', function (_ref7) {
|
|
|
98
98
|
var $theme = _ref7.$theme;
|
|
99
99
|
return _objectSpread(_objectSpread({}, $theme.typography.HeadingSmall), {}, {
|
|
100
100
|
color: $theme.colors.contentPrimary,
|
|
101
|
-
fontWeight: 500,
|
|
102
101
|
marginLeft: 0,
|
|
103
102
|
marginTop: 0,
|
|
104
103
|
marginRight: 0,
|
|
@@ -72,7 +72,6 @@ export const Thumbnail = styled<{}>('img', ({$theme}) => ({
|
|
|
72
72
|
export const Title = styled<{}>('h1', ({$theme}) => ({
|
|
73
73
|
...$theme.typography.HeadingSmall,
|
|
74
74
|
color: $theme.colors.contentPrimary,
|
|
75
|
-
fontWeight: 500,
|
|
76
75
|
marginLeft: 0,
|
|
77
76
|
marginTop: 0,
|
|
78
77
|
marginRight: 0,
|
package/combobox/combobox.js
CHANGED
|
@@ -60,6 +60,7 @@ function Combobox(props) {
|
|
|
60
60
|
onChange = props.onChange,
|
|
61
61
|
onFocus = props.onFocus,
|
|
62
62
|
onSubmit = props.onSubmit,
|
|
63
|
+
listBoxLabel = props.listBoxLabel,
|
|
63
64
|
mapOptionToNode = props.mapOptionToNode,
|
|
64
65
|
mapOptionToString = props.mapOptionToString,
|
|
65
66
|
id = props.id,
|
|
@@ -306,7 +307,11 @@ function Combobox(props) {
|
|
|
306
307
|
return /*#__PURE__*/React.createElement(Root // eslint-disable-next-line flowtype/no-weak-types
|
|
307
308
|
, _extends({
|
|
308
309
|
ref: rootRef
|
|
309
|
-
}, rootProps), /*#__PURE__*/React.createElement(OverriddenPopover,
|
|
310
|
+
}, 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
|
|
311
|
+
// the ListBox, but we can just disable autoFocus (as ListBox / ListItem should not be focusable) (and input is also not autoFocused).
|
|
312
|
+
// Select Component does the same thing
|
|
313
|
+
, _extends({
|
|
314
|
+
autoFocus: false,
|
|
310
315
|
isOpen: isOpen,
|
|
311
316
|
overrides: popoverOverrides,
|
|
312
317
|
placement: _index2.PLACEMENT.bottomLeft,
|
|
@@ -318,6 +323,7 @@ function Combobox(props) {
|
|
|
318
323
|
,
|
|
319
324
|
ref: listboxRef,
|
|
320
325
|
role: "listbox",
|
|
326
|
+
"aria-label": listBoxLabel,
|
|
321
327
|
$width: listboxWidth
|
|
322
328
|
}, listBoxProps), options.map(function (option, index) {
|
|
323
329
|
var isSelected = selectionIndex === index;
|
|
@@ -356,9 +362,8 @@ function Combobox(props) {
|
|
|
356
362
|
role: "combobox"
|
|
357
363
|
}, inputContainerProps), /*#__PURE__*/React.createElement(OverriddenInput, _extends({
|
|
358
364
|
inputRef: handleInputRef,
|
|
359
|
-
"aria-activedescendant": selectionIndex >= 0 ? activeDescendantId : undefined,
|
|
365
|
+
"aria-activedescendant": isOpen && selectionIndex >= 0 ? activeDescendantId : undefined,
|
|
360
366
|
"aria-autocomplete": "list",
|
|
361
|
-
"aria-controls": listboxId,
|
|
362
367
|
disabled: disabled,
|
|
363
368
|
error: error,
|
|
364
369
|
name: name,
|
|
@@ -371,7 +376,9 @@ function Combobox(props) {
|
|
|
371
376
|
positive: positive,
|
|
372
377
|
size: size,
|
|
373
378
|
value: tempValue ? tempValue : value
|
|
374
|
-
},
|
|
379
|
+
}, isOpen ? {
|
|
380
|
+
'aria-controls': listboxId
|
|
381
|
+
} : {}, restInputProps)))));
|
|
375
382
|
}
|
|
376
383
|
|
|
377
384
|
var _default = Combobox;
|
|
@@ -38,6 +38,7 @@ function Combobox<OptionT>(props: PropsT<OptionT>) {
|
|
|
38
38
|
onChange,
|
|
39
39
|
onFocus,
|
|
40
40
|
onSubmit,
|
|
41
|
+
listBoxLabel,
|
|
41
42
|
mapOptionToNode,
|
|
42
43
|
mapOptionToString,
|
|
43
44
|
id,
|
|
@@ -258,6 +259,10 @@ function Combobox<OptionT>(props: PropsT<OptionT>) {
|
|
|
258
259
|
{...rootProps}
|
|
259
260
|
>
|
|
260
261
|
<OverriddenPopover
|
|
262
|
+
// 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
|
|
263
|
+
// the ListBox, but we can just disable autoFocus (as ListBox / ListItem should not be focusable) (and input is also not autoFocused).
|
|
264
|
+
// Select Component does the same thing
|
|
265
|
+
autoFocus={false}
|
|
261
266
|
isOpen={isOpen}
|
|
262
267
|
overrides={popoverOverrides}
|
|
263
268
|
placement={PLACEMENT.bottomLeft}
|
|
@@ -270,6 +275,7 @@ function Combobox<OptionT>(props: PropsT<OptionT>) {
|
|
|
270
275
|
// eslint-disable-next-line flowtype/no-weak-types
|
|
271
276
|
ref={(listboxRef: any)}
|
|
272
277
|
role="listbox"
|
|
278
|
+
aria-label={listBoxLabel}
|
|
273
279
|
$width={listboxWidth}
|
|
274
280
|
{...listBoxProps}
|
|
275
281
|
>
|
|
@@ -318,10 +324,9 @@ function Combobox<OptionT>(props: PropsT<OptionT>) {
|
|
|
318
324
|
<OverriddenInput
|
|
319
325
|
inputRef={handleInputRef}
|
|
320
326
|
aria-activedescendant={
|
|
321
|
-
selectionIndex >= 0 ? activeDescendantId : undefined
|
|
327
|
+
isOpen && selectionIndex >= 0 ? activeDescendantId : undefined
|
|
322
328
|
}
|
|
323
329
|
aria-autocomplete="list"
|
|
324
|
-
aria-controls={listboxId}
|
|
325
330
|
disabled={disabled}
|
|
326
331
|
error={error}
|
|
327
332
|
name={name}
|
|
@@ -334,6 +339,7 @@ function Combobox<OptionT>(props: PropsT<OptionT>) {
|
|
|
334
339
|
positive={positive}
|
|
335
340
|
size={size}
|
|
336
341
|
value={tempValue ? tempValue : value}
|
|
342
|
+
{...(isOpen ? {'aria-controls': listboxId} : {})}
|
|
337
343
|
{...restInputProps}
|
|
338
344
|
/>
|
|
339
345
|
</InputContainer>
|
package/combobox/index.d.ts
CHANGED
|
@@ -17,11 +17,14 @@ export interface ComboboxOverrides {
|
|
|
17
17
|
ListItem?: Override<any>;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export type PropsT<OptionT =
|
|
20
|
+
export type PropsT<OptionT = any> = {
|
|
21
21
|
autocomplete?: boolean;
|
|
22
22
|
disabled?: boolean;
|
|
23
|
-
mapOptionToNode?: (
|
|
24
|
-
|
|
23
|
+
mapOptionToNode?: (option: {
|
|
24
|
+
isSelected: boolean;
|
|
25
|
+
option: OptionT;
|
|
26
|
+
}) => React.ReactNode;
|
|
27
|
+
mapOptionToString: (option: OptionT) => string;
|
|
25
28
|
id?: string;
|
|
26
29
|
name?: string;
|
|
27
30
|
inputRef?: React.Ref<HTMLInputElement>;
|
package/combobox/types.js.flow
CHANGED
|
@@ -18,6 +18,8 @@ export type PropsT<OptionT = mixed> = {|
|
|
|
18
18
|
disabled?: boolean,
|
|
19
19
|
// Proxies value through to Input component.
|
|
20
20
|
error?: boolean,
|
|
21
|
+
// Label used for the listbox/popup with options
|
|
22
|
+
listBoxLabel?: string,
|
|
21
23
|
// Used to render a custom node besides the default.
|
|
22
24
|
mapOptionToNode?: React.AbstractComponent<{|
|
|
23
25
|
isSelected: boolean,
|
|
@@ -86,6 +86,7 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
86
86
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
87
87
|
|
|
88
88
|
var DATE_FORMAT = 'MM-dd-yyyy';
|
|
89
|
+
var MASK = '99-99-9999 - 99-99-9999';
|
|
89
90
|
var TIME_FORMAT = 'HH:mm ss:SS';
|
|
90
91
|
var FORMAT_STRING = "".concat(DATE_FORMAT, " ").concat(TIME_FORMAT);
|
|
91
92
|
|
|
@@ -455,12 +456,13 @@ function DatetimeFilter(props) {
|
|
|
455
456
|
if (Array.isArray(date)) {
|
|
456
457
|
if (!date.length) return;
|
|
457
458
|
var nextDates = date.map(function (d, i) {
|
|
458
|
-
return (0, _index13.applyDateToTime)(rangeDates[i], d);
|
|
459
|
+
return d ? (0, _index13.applyDateToTime)(rangeDates[i], d) : null;
|
|
459
460
|
});
|
|
460
461
|
setRangeDates(nextDates);
|
|
461
462
|
}
|
|
462
463
|
},
|
|
463
464
|
formatString: DATE_FORMAT,
|
|
465
|
+
mask: MASK,
|
|
464
466
|
placeholder: "MM-DD-YYYY - MM-DD-YYYY",
|
|
465
467
|
minDate: datesSorted[0],
|
|
466
468
|
maxDate: datesSorted[datesSorted.length - 1],
|
|
@@ -68,6 +68,7 @@ type FilterParametersT = {|
|
|
|
68
68
|
type DatetimeColumnT = ColumnT<Date, FilterParametersT>;
|
|
69
69
|
|
|
70
70
|
const DATE_FORMAT = 'MM-dd-yyyy';
|
|
71
|
+
const MASK = '99-99-9999 - 99-99-9999';
|
|
71
72
|
const TIME_FORMAT = 'HH:mm ss:SS';
|
|
72
73
|
const FORMAT_STRING = `${DATE_FORMAT} ${TIME_FORMAT}`;
|
|
73
74
|
|
|
@@ -409,12 +410,13 @@ function DatetimeFilter(props) {
|
|
|
409
410
|
if (Array.isArray(date)) {
|
|
410
411
|
if (!date.length) return;
|
|
411
412
|
const nextDates = date.map((d, i) =>
|
|
412
|
-
applyDateToTime(rangeDates[i], d),
|
|
413
|
+
d ? applyDateToTime(rangeDates[i], d) : null,
|
|
413
414
|
);
|
|
414
415
|
setRangeDates(nextDates);
|
|
415
416
|
}
|
|
416
417
|
}}
|
|
417
418
|
formatString={DATE_FORMAT}
|
|
419
|
+
mask={MASK}
|
|
418
420
|
placeholder="MM-DD-YYYY - MM-DD-YYYY"
|
|
419
421
|
minDate={datesSorted[0]}
|
|
420
422
|
maxDate={datesSorted[datesSorted.length - 1]}
|