grommet 2.46.1 → 2.47.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/components/Accordion/index.d.ts +7 -1
- package/components/AccordionPanel/index.d.ts +4 -1
- package/components/Anchor/index.d.ts +7 -1
- package/components/Avatar/Avatar.js +4 -3
- package/components/Avatar/index.d.ts +9 -1
- package/components/Avatar/propTypes.js +2 -1
- package/components/Box/StyledBox.js +9 -1
- package/components/Box/index.d.ts +9 -2
- package/components/Button/index.d.ts +14 -2
- package/components/Calendar/Calendar.js +43 -32
- package/components/Calendar/StyledCalendar.js +86 -32
- package/components/Calendar/index.d.ts +15 -2
- package/components/Calendar/propTypes.js +1 -0
- package/components/Cards/index.d.ts +7 -1
- package/components/Carousel/index.d.ts +4 -1
- package/components/Chart/index.d.ts +7 -1
- package/components/CheckBox/index.d.ts +7 -1
- package/components/CheckBoxGroup/index.d.ts +15 -2
- package/components/Clock/index.d.ts +14 -2
- package/components/Collapsible/index.d.ts +4 -1
- package/components/Data/index.d.ts +4 -1
- package/components/DataFilter/index.d.ts +4 -1
- package/components/DataFilters/index.d.ts +4 -1
- package/components/DataTable/Body.js +13 -7
- package/components/DataTable/DataTable.js +6 -1
- package/components/DataTable/index.d.ts +11 -2
- package/components/DataTable/propTypes.js +5 -1
- package/components/DataTable/stories/rowDetails.stories.js +174 -66
- package/components/DataTable/stories/typescript/OnSelect.stories.tsx +3 -3
- package/components/DataTableGroupBy/index.d.ts +4 -1
- package/components/DataView/index.d.ts +4 -1
- package/components/DateInput/index.d.ts +4 -1
- package/components/Diagram/index.d.ts +4 -1
- package/components/Distribution/index.d.ts +4 -1
- package/components/Drop/StyledDrop.js +3 -1
- package/components/Drop/index.d.ts +6 -2
- package/components/DropButton/index.d.ts +8 -1
- package/components/FileInput/index.d.ts +8 -2
- package/components/Form/index.d.ts +7 -1
- package/components/FormField/index.d.ts +4 -1
- package/components/Grid/index.d.ts +4 -1
- package/components/Grommet/index.d.ts +18 -1
- package/components/Grommet/propTypes.js +11 -0
- package/components/Header/stories/typescript/Ref.stories.tsx +1 -1
- package/components/Heading/index.d.ts +7 -7
- package/components/Image/index.d.ts +4 -1
- package/components/InfiniteScroll/index.d.ts +2 -2
- package/components/Layer/index.d.ts +4 -1
- package/components/List/index.d.ts +9 -3
- package/components/Markdown/index.d.ts +5 -1
- package/components/MaskedInput/MaskedInput.js +49 -4
- package/components/MaskedInput/index.d.ts +7 -1
- package/components/MaskedInput/stories/CustomBox.stories.js +1 -0
- package/components/MaskedInput/stories/Date.stories.js +1 -0
- package/components/MaskedInput/stories/DateRange.stories.js +1 -0
- package/components/MaskedInput/stories/DateTimeDrop.stories.js +1 -0
- package/components/MaskedInput/stories/Filtered.stories.js +1 -0
- package/components/MaskedInput/stories/SizeUnits.stories.js +1 -0
- package/components/MaskedInput/stories/Time.stories.js +1 -0
- package/components/NameValueList/index.d.ts +8 -1
- package/components/Notification/index.d.ts +1 -0
- package/components/PageHeader/index.d.ts +5 -1
- package/components/Pagination/PaginationStep.js +4 -0
- package/components/Pagination/index.d.ts +5 -0
- package/components/Pagination/propTypes.js +6 -1
- package/components/Paragraph/index.d.ts +7 -1
- package/components/RadioButton/index.d.ts +7 -1
- package/components/RadioButtonGroup/index.d.ts +7 -1
- package/components/RangeInput/index.d.ts +7 -1
- package/components/RangeSelector/index.d.ts +15 -2
- package/components/RoutedAnchor/index.d.ts +3 -2
- package/components/RoutedButton/index.d.ts +3 -2
- package/components/Select/Select.js +2 -4
- package/components/Select/index.d.ts +7 -1
- package/components/Select/utils.js +12 -3
- package/components/SelectMultiple/SelectMultiple.js +5 -10
- package/components/SelectMultiple/SelectMultipleContainer.js +2 -4
- package/components/SelectMultiple/SelectMultipleValue.js +1 -2
- package/components/SelectMultiple/index.d.ts +7 -1
- package/components/Sidebar/index.d.ts +4 -1
- package/components/Stack/index.d.ts +4 -1
- package/components/Tab/index.d.ts +7 -1
- package/components/Table/index.d.ts +4 -1
- package/components/TableBody/index.d.ts +4 -1
- package/components/TableCell/index.d.ts +10 -3
- package/components/TableFooter/index.d.ts +4 -1
- package/components/TableHeader/index.d.ts +4 -1
- package/components/TableRow/index.d.ts +4 -1
- package/components/Tabs/index.d.ts +4 -1
- package/components/Tag/Tag.js +15 -1
- package/components/Tag/index.d.ts +6 -0
- package/components/Tag/propTypes.js +6 -0
- package/components/Text/Text.js +3 -2
- package/components/Text/index.d.ts +7 -1
- package/components/TextArea/index.d.ts +7 -1
- package/components/TextInput/TextInput.js +6 -2
- package/components/TextInput/index.d.ts +6 -3
- package/components/TextInput/stories/CustomThemed/CustomSuggestions.stories.tsx +2 -1
- package/components/TextInput/stories/CustomThemed/Themed.stories.js +1 -0
- package/components/TextInput/stories/OnSelect.stories.js +1 -0
- package/components/TextInput/stories/WithTags.stories.js +1 -0
- package/components/Tip/Tip.js +16 -1
- package/components/ToggleGroup/index.d.ts +7 -1
- package/components/Toolbar/index.d.ts +5 -2
- package/components/Video/index.d.ts +7 -1
- package/components/WorldMap/index.d.ts +7 -1
- package/es6/components/Accordion/index.d.ts +7 -1
- package/es6/components/AccordionPanel/index.d.ts +4 -1
- package/es6/components/Anchor/index.d.ts +7 -1
- package/es6/components/Avatar/Avatar.js +4 -3
- package/es6/components/Avatar/index.d.ts +9 -1
- package/es6/components/Avatar/propTypes.js +2 -1
- package/es6/components/Box/StyledBox.js +8 -1
- package/es6/components/Box/index.d.ts +9 -2
- package/es6/components/Button/index.d.ts +14 -2
- package/es6/components/Calendar/Calendar.js +44 -32
- package/es6/components/Calendar/StyledCalendar.js +86 -32
- package/es6/components/Calendar/index.d.ts +15 -2
- package/es6/components/Calendar/propTypes.js +1 -0
- package/es6/components/Cards/index.d.ts +7 -1
- package/es6/components/Carousel/index.d.ts +4 -1
- package/es6/components/Chart/index.d.ts +7 -1
- package/es6/components/CheckBox/index.d.ts +7 -1
- package/es6/components/CheckBoxGroup/index.d.ts +15 -2
- package/es6/components/Clock/index.d.ts +14 -2
- package/es6/components/Collapsible/index.d.ts +4 -1
- package/es6/components/Data/index.d.ts +4 -1
- package/es6/components/DataFilter/index.d.ts +4 -1
- package/es6/components/DataFilters/index.d.ts +4 -1
- package/es6/components/DataTable/Body.js +13 -7
- package/es6/components/DataTable/DataTable.js +6 -1
- package/es6/components/DataTable/index.d.ts +11 -2
- package/es6/components/DataTable/propTypes.js +5 -1
- package/es6/components/DataTable/stories/rowDetails.stories.js +172 -66
- package/es6/components/DataTable/stories/typescript/OnSelect.stories.tsx +3 -3
- package/es6/components/DataTableGroupBy/index.d.ts +4 -1
- package/es6/components/DataView/index.d.ts +4 -1
- package/es6/components/DateInput/index.d.ts +4 -1
- package/es6/components/Diagram/index.d.ts +4 -1
- package/es6/components/Distribution/index.d.ts +4 -1
- package/es6/components/Drop/StyledDrop.js +3 -1
- package/es6/components/Drop/index.d.ts +6 -2
- package/es6/components/DropButton/index.d.ts +8 -1
- package/es6/components/FileInput/index.d.ts +8 -2
- package/es6/components/Form/index.d.ts +7 -1
- package/es6/components/FormField/index.d.ts +4 -1
- package/es6/components/Grid/index.d.ts +4 -1
- package/es6/components/Grommet/index.d.ts +18 -1
- package/es6/components/Grommet/propTypes.js +11 -0
- package/es6/components/Header/stories/typescript/Ref.stories.tsx +1 -1
- package/es6/components/Heading/index.d.ts +7 -7
- package/es6/components/Image/index.d.ts +4 -1
- package/es6/components/InfiniteScroll/index.d.ts +2 -2
- package/es6/components/Layer/index.d.ts +4 -1
- package/es6/components/List/index.d.ts +9 -3
- package/es6/components/Markdown/index.d.ts +5 -1
- package/es6/components/MaskedInput/MaskedInput.js +49 -4
- package/es6/components/MaskedInput/index.d.ts +7 -1
- package/es6/components/MaskedInput/stories/CustomBox.stories.js +1 -0
- package/es6/components/MaskedInput/stories/Date.stories.js +1 -0
- package/es6/components/MaskedInput/stories/DateRange.stories.js +1 -0
- package/es6/components/MaskedInput/stories/DateTimeDrop.stories.js +1 -0
- package/es6/components/MaskedInput/stories/Filtered.stories.js +1 -0
- package/es6/components/MaskedInput/stories/SizeUnits.stories.js +1 -0
- package/es6/components/MaskedInput/stories/Time.stories.js +1 -0
- package/es6/components/NameValueList/index.d.ts +8 -1
- package/es6/components/Notification/index.d.ts +1 -0
- package/es6/components/PageHeader/index.d.ts +5 -1
- package/es6/components/Pagination/PaginationStep.js +4 -0
- package/es6/components/Pagination/index.d.ts +5 -0
- package/es6/components/Pagination/propTypes.js +6 -1
- package/es6/components/Paragraph/index.d.ts +7 -1
- package/es6/components/RadioButton/index.d.ts +7 -1
- package/es6/components/RadioButtonGroup/index.d.ts +7 -1
- package/es6/components/RangeInput/index.d.ts +7 -1
- package/es6/components/RangeSelector/index.d.ts +15 -2
- package/es6/components/RoutedAnchor/index.d.ts +3 -2
- package/es6/components/RoutedButton/index.d.ts +3 -2
- package/es6/components/Select/Select.js +3 -5
- package/es6/components/Select/index.d.ts +7 -1
- package/es6/components/Select/utils.js +9 -2
- package/es6/components/SelectMultiple/SelectMultiple.js +6 -11
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +3 -5
- package/es6/components/SelectMultiple/SelectMultipleValue.js +2 -3
- package/es6/components/SelectMultiple/index.d.ts +7 -1
- package/es6/components/Sidebar/index.d.ts +4 -1
- package/es6/components/Stack/index.d.ts +4 -1
- package/es6/components/Tab/index.d.ts +7 -1
- package/es6/components/Table/index.d.ts +4 -1
- package/es6/components/TableBody/index.d.ts +4 -1
- package/es6/components/TableCell/index.d.ts +10 -3
- package/es6/components/TableFooter/index.d.ts +4 -1
- package/es6/components/TableHeader/index.d.ts +4 -1
- package/es6/components/TableRow/index.d.ts +4 -1
- package/es6/components/Tabs/index.d.ts +4 -1
- package/es6/components/Tag/Tag.js +16 -2
- package/es6/components/Tag/index.d.ts +6 -0
- package/es6/components/Tag/propTypes.js +6 -0
- package/es6/components/Text/Text.js +3 -2
- package/es6/components/Text/index.d.ts +7 -1
- package/es6/components/TextArea/index.d.ts +7 -1
- package/es6/components/TextInput/TextInput.js +6 -2
- package/es6/components/TextInput/index.d.ts +6 -3
- package/es6/components/TextInput/stories/CustomThemed/CustomSuggestions.stories.tsx +2 -1
- package/es6/components/TextInput/stories/CustomThemed/Themed.stories.js +1 -0
- package/es6/components/TextInput/stories/OnSelect.stories.js +1 -0
- package/es6/components/TextInput/stories/WithTags.stories.js +1 -0
- package/es6/components/Tip/Tip.js +17 -1
- package/es6/components/ToggleGroup/index.d.ts +7 -1
- package/es6/components/Toolbar/index.d.ts +5 -2
- package/es6/components/Video/index.d.ts +7 -1
- package/es6/components/WorldMap/index.d.ts +7 -1
- package/es6/languages/default.json +6 -0
- package/es6/utils/mixins.js +2 -1
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +6 -0
- package/package.json +9 -9
- package/utils/mixins.js +2 -1
- package/components/Drop/stories/TrapFocus.stories.js +0 -86
- package/es6/components/Drop/stories/TrapFocus.stories.js +0 -82
|
@@ -229,6 +229,9 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
229
229
|
});
|
|
230
230
|
inputRef.current.dispatchEvent(event);
|
|
231
231
|
}, [inputRef]);
|
|
232
|
+
var _useState6 = useState(),
|
|
233
|
+
mouseMovedSinceLastKey = _useState6[0],
|
|
234
|
+
setMouseMovedSinceLastKey = _useState6[1];
|
|
232
235
|
|
|
233
236
|
// This could be due to a paste or as the user is typing.
|
|
234
237
|
var onChangeInput = useCallback(function (event) {
|
|
@@ -287,6 +290,7 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
287
290
|
if (item && item.options) {
|
|
288
291
|
event.preventDefault();
|
|
289
292
|
var index = Math.min(activeOptionIndex + 1, item.options.length - 1);
|
|
293
|
+
setMouseMovedSinceLastKey(false);
|
|
290
294
|
setActiveOptionIndex(index);
|
|
291
295
|
}
|
|
292
296
|
}, [activeMaskIndex, activeOptionIndex, mask]);
|
|
@@ -294,6 +298,7 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
294
298
|
if (activeMaskIndex >= 0 && mask[activeMaskIndex].options) {
|
|
295
299
|
event.preventDefault();
|
|
296
300
|
var index = Math.max(activeOptionIndex - 1, 0);
|
|
301
|
+
setMouseMovedSinceLastKey(false);
|
|
297
302
|
setActiveOptionIndex(index);
|
|
298
303
|
}
|
|
299
304
|
}, [activeMaskIndex, activeOptionIndex, mask]);
|
|
@@ -322,8 +327,41 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
322
327
|
}).join('');
|
|
323
328
|
};
|
|
324
329
|
var maskedInputIcon = useSizedIcon(icon, rest.size, theme);
|
|
330
|
+
|
|
331
|
+
/*
|
|
332
|
+
If the masked input has a list of options, add the WAI-ARIA 1.2
|
|
333
|
+
combobox role and states.
|
|
334
|
+
*/
|
|
335
|
+
var comboboxProps = {};
|
|
336
|
+
var activeOptionID;
|
|
337
|
+
var options = useMemo(function () {
|
|
338
|
+
var _mask$find, _mask$activeMaskIndex;
|
|
339
|
+
var res;
|
|
340
|
+
if (!activeMaskIndex)
|
|
341
|
+
// ensures that comboboxProps gets set on input initially
|
|
342
|
+
res = (_mask$find = mask.find(function (item) {
|
|
343
|
+
var _item$options;
|
|
344
|
+
return (item == null || (_item$options = item.options) == null ? void 0 : _item$options.length) > 0;
|
|
345
|
+
})) == null ? void 0 : _mask$find.options;else res = (_mask$activeMaskIndex = mask[activeMaskIndex]) == null ? void 0 : _mask$activeMaskIndex.options;
|
|
346
|
+
return res;
|
|
347
|
+
}, [mask, activeMaskIndex]);
|
|
348
|
+
if (id && (options == null ? void 0 : options.length) > 0) {
|
|
349
|
+
if (showDrop && options) {
|
|
350
|
+
activeOptionID = "listbox-option-" + activeOptionIndex + "__" + id;
|
|
351
|
+
}
|
|
352
|
+
comboboxProps = {
|
|
353
|
+
'aria-activedescendant': activeOptionID,
|
|
354
|
+
'aria-autocomplete': 'list',
|
|
355
|
+
'aria-expanded': showDrop ? 'true' : 'false',
|
|
356
|
+
'aria-controls': showDrop ? "listbox__" + id : undefined,
|
|
357
|
+
role: 'combobox'
|
|
358
|
+
};
|
|
359
|
+
}
|
|
325
360
|
return /*#__PURE__*/React.createElement(StyledMaskedInputContainer, _extends({
|
|
326
|
-
plain: plain
|
|
361
|
+
plain: plain,
|
|
362
|
+
onMouseMove: function onMouseMove() {
|
|
363
|
+
return setMouseMovedSinceLastKey(true);
|
|
364
|
+
}
|
|
327
365
|
}, passThemeFlag), maskedInputIcon && /*#__PURE__*/React.createElement(StyledIcon, {
|
|
328
366
|
reverse: reverse,
|
|
329
367
|
theme: theme
|
|
@@ -353,7 +391,7 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
353
391
|
reverse: reverse,
|
|
354
392
|
focus: focus,
|
|
355
393
|
textAlign: textAlign
|
|
356
|
-
}, rest, {
|
|
394
|
+
}, comboboxProps, rest, {
|
|
357
395
|
value: value,
|
|
358
396
|
theme: theme,
|
|
359
397
|
onFocus: function onFocus(event) {
|
|
@@ -386,7 +424,12 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
386
424
|
}, dropProps), /*#__PURE__*/React.createElement(ContainerBox, _extends({
|
|
387
425
|
ref: dropRef,
|
|
388
426
|
overflow: "auto",
|
|
389
|
-
|
|
427
|
+
id: id ? "listbox__" + id : undefined,
|
|
428
|
+
role: "listbox",
|
|
429
|
+
dropHeight: dropHeight,
|
|
430
|
+
onMouseOver: function onMouseOver() {
|
|
431
|
+
return setMouseMovedSinceLastKey(true);
|
|
432
|
+
}
|
|
390
433
|
}, passThemeFlag), mask[activeMaskIndex].options.map(function (option, index) {
|
|
391
434
|
// Determine whether the label is done as a child or
|
|
392
435
|
// as an option Button kind property.
|
|
@@ -402,6 +445,7 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
402
445
|
key: option,
|
|
403
446
|
flex: false
|
|
404
447
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
448
|
+
id: id ? "listbox-option-" + index + "__" + id : undefined,
|
|
405
449
|
tabIndex: "-1",
|
|
406
450
|
onClick: onOption(option),
|
|
407
451
|
onMouseOver: function onMouseOver() {
|
|
@@ -413,7 +457,8 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
413
457
|
align: "start",
|
|
414
458
|
kind: !child ? 'option' : undefined,
|
|
415
459
|
hoverIndicator: !child ? undefined : 'background',
|
|
416
|
-
label: !child ? option : undefined
|
|
460
|
+
label: !child ? option : undefined,
|
|
461
|
+
keyboard: !mouseMovedSinceLastKey
|
|
417
462
|
}, child));
|
|
418
463
|
}))));
|
|
419
464
|
});
|
|
@@ -28,7 +28,13 @@ export interface MaskedInputProps {
|
|
|
28
28
|
|
|
29
29
|
export interface MaskedInputExtendedProps
|
|
30
30
|
extends MaskedInputProps,
|
|
31
|
-
Omit<
|
|
31
|
+
Omit<
|
|
32
|
+
React.DetailedHTMLProps<
|
|
33
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
34
|
+
HTMLInputElement
|
|
35
|
+
>,
|
|
36
|
+
keyof MaskedInputProps
|
|
37
|
+
> {}
|
|
32
38
|
|
|
33
39
|
// Keep type alias for backwards compatibility.
|
|
34
40
|
export type MaskedInputType = MaskedInputExtendedProps;
|
|
@@ -16,6 +16,7 @@ export var SizeUnitsMaskedInput = function SizeUnitsMaskedInput() {
|
|
|
16
16
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
17
17
|
width: "medium"
|
|
18
18
|
}, /*#__PURE__*/React.createElement(MaskedInput, {
|
|
19
|
+
id: "grommet-size-units",
|
|
19
20
|
mask: [{
|
|
20
21
|
length: [1, 4],
|
|
21
22
|
options: [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AlignType, WidthType } from '../../utils';
|
|
3
3
|
import { GridProps } from '../Grid';
|
|
4
|
+
|
|
4
5
|
export interface NameValueListProps {
|
|
5
6
|
align?: AlignType;
|
|
6
7
|
children?: React.ReactNode;
|
|
@@ -20,7 +21,13 @@ export interface NameValueListProps {
|
|
|
20
21
|
export interface NameValueListExtendedProps
|
|
21
22
|
extends NameValueListProps,
|
|
22
23
|
GridProps,
|
|
23
|
-
Omit<
|
|
24
|
+
Omit<
|
|
25
|
+
React.DetailedHTMLProps<
|
|
26
|
+
React.HTMLAttributes<HTMLDListElement>,
|
|
27
|
+
HTMLDListElement
|
|
28
|
+
>,
|
|
29
|
+
keyof NameValueListProps
|
|
30
|
+
> {}
|
|
24
31
|
|
|
25
32
|
declare const NameValueList: React.FC<NameValueListExtendedProps>;
|
|
26
33
|
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
import { BoxProps } from '../Box/index';
|
|
9
9
|
|
|
10
10
|
import { GridProps } from '../Grid';
|
|
11
|
+
|
|
11
12
|
export interface PageHeaderProps {
|
|
12
13
|
a11yTitle?: A11yTitleType;
|
|
13
14
|
alignSelf?: AlignSelfType;
|
|
@@ -23,7 +24,10 @@ export interface PageHeaderProps {
|
|
|
23
24
|
title?: string | JSX.Element;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
type divProps = Omit<
|
|
27
|
+
type divProps = Omit<
|
|
28
|
+
React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
29
|
+
'onClick' | 'title'
|
|
30
|
+
>;
|
|
27
31
|
|
|
28
32
|
export interface PageHeaderExtendedProps
|
|
29
33
|
extends BoxProps,
|
|
@@ -28,6 +28,10 @@ export var PaginationStep = function PaginationStep(_ref) {
|
|
|
28
28
|
})), /*#__PURE__*/React.createElement(Select, {
|
|
29
29
|
options: options,
|
|
30
30
|
value: step,
|
|
31
|
+
"aria-label": formatMessage({
|
|
32
|
+
id: 'pagination.stepLabel',
|
|
33
|
+
messages: messages
|
|
34
|
+
}),
|
|
31
35
|
valueLabel: /*#__PURE__*/React.createElement(Box, _extends({}, theme.global.input, {
|
|
32
36
|
pad: theme.global.input.padding
|
|
33
37
|
}), /*#__PURE__*/React.createElement(Text, theme.global.input.font, step)),
|
|
@@ -21,6 +21,11 @@ export interface PaginationProps extends BoxProps {
|
|
|
21
21
|
step?: number;
|
|
22
22
|
stepOptions?: boolean | (string | boolean | number | JSX.Element | object)[];
|
|
23
23
|
summary?: boolean;
|
|
24
|
+
messages?: {
|
|
25
|
+
stepLabel?: string;
|
|
26
|
+
summary?: string;
|
|
27
|
+
summaryNoItems?: string;
|
|
28
|
+
};
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
declare const Pagination: React.FC<PaginationProps>;
|
|
@@ -12,7 +12,12 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
12
12
|
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
13
13
|
step: PropTypes.number,
|
|
14
14
|
stepOptions: PropTypes.oneOfType([PropTypes.bool, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool, PropTypes.element, PropTypes.object]))]),
|
|
15
|
-
summary: PropTypes.bool
|
|
15
|
+
summary: PropTypes.bool,
|
|
16
|
+
messages: PropTypes.shape({
|
|
17
|
+
stepLabel: PropTypes.string,
|
|
18
|
+
summary: PropTypes.string,
|
|
19
|
+
summaryNoItems: PropType.string
|
|
20
|
+
})
|
|
16
21
|
});
|
|
17
22
|
}
|
|
18
23
|
export var PaginationPropTypes = PropType;
|
|
@@ -24,7 +24,13 @@ export interface ParagraphProps {
|
|
|
24
24
|
|
|
25
25
|
export interface ParagraphExtendedProps
|
|
26
26
|
extends ParagraphProps,
|
|
27
|
-
Omit<
|
|
27
|
+
Omit<
|
|
28
|
+
React.DetailedHTMLProps<
|
|
29
|
+
React.HTMLAttributes<HTMLParagraphElement>,
|
|
30
|
+
HTMLParagraphElement
|
|
31
|
+
>,
|
|
32
|
+
'color'
|
|
33
|
+
> {}
|
|
28
34
|
|
|
29
35
|
declare const Paragraph: React.FC<ParagraphExtendedProps>;
|
|
30
36
|
|
|
@@ -13,7 +13,13 @@ export interface RadioButtonProps {
|
|
|
13
13
|
|
|
14
14
|
export interface RadioButtonExtendedProps
|
|
15
15
|
extends RadioButtonProps,
|
|
16
|
-
Omit<
|
|
16
|
+
Omit<
|
|
17
|
+
React.DetailedHTMLProps<
|
|
18
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
19
|
+
HTMLInputElement
|
|
20
|
+
>,
|
|
21
|
+
'name' | 'children'
|
|
22
|
+
> {}
|
|
17
23
|
|
|
18
24
|
declare const RadioButton: React.FC<RadioButtonExtendedProps>;
|
|
19
25
|
|
|
@@ -23,7 +23,13 @@ export interface RadioButtonGroupProps {
|
|
|
23
23
|
export interface RadioButtonGroupExtendedProps
|
|
24
24
|
extends RadioButtonGroupProps,
|
|
25
25
|
BoxProps,
|
|
26
|
-
Omit<
|
|
26
|
+
Omit<
|
|
27
|
+
React.DetailedHTMLProps<
|
|
28
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
29
|
+
HTMLDivElement
|
|
30
|
+
>,
|
|
31
|
+
'children' | 'onClick' | 'onChange'
|
|
32
|
+
> {}
|
|
27
33
|
|
|
28
34
|
declare const RadioButtonGroup: React.FC<RadioButtonGroupExtendedProps>;
|
|
29
35
|
|
|
@@ -20,7 +20,13 @@ export interface RangeInputProps {
|
|
|
20
20
|
|
|
21
21
|
export interface RangeInputExtendedProps
|
|
22
22
|
extends RangeInputProps,
|
|
23
|
-
Omit<
|
|
23
|
+
Omit<
|
|
24
|
+
React.DetailedHTMLProps<
|
|
25
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
26
|
+
HTMLInputElement
|
|
27
|
+
>,
|
|
28
|
+
'color' | 'step' | 'value'
|
|
29
|
+
> {}
|
|
24
30
|
|
|
25
31
|
declare const RangeInput: React.FC<RangeInputExtendedProps>;
|
|
26
32
|
|
|
@@ -28,10 +28,23 @@ export interface RangeSelectorProps {
|
|
|
28
28
|
|
|
29
29
|
export interface RangeSelectorExtendedProps
|
|
30
30
|
extends RangeSelectorProps,
|
|
31
|
-
Omit<
|
|
31
|
+
Omit<
|
|
32
|
+
React.DetailedHTMLProps<
|
|
33
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
34
|
+
HTMLDivElement
|
|
35
|
+
>,
|
|
36
|
+
'color' | 'onChange'
|
|
37
|
+
> {}
|
|
32
38
|
|
|
33
39
|
declare const RangeSelector: React.FC<
|
|
34
|
-
RangeSelectorProps &
|
|
40
|
+
RangeSelectorProps &
|
|
41
|
+
Omit<
|
|
42
|
+
React.DetailedHTMLProps<
|
|
43
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
44
|
+
HTMLDivElement
|
|
45
|
+
>,
|
|
46
|
+
'color'
|
|
47
|
+
>
|
|
35
48
|
>;
|
|
36
49
|
|
|
37
50
|
export { RangeSelector };
|
|
@@ -7,7 +7,8 @@ export interface RoutedAnchorProps {
|
|
|
7
7
|
path: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
declare const RoutedAnchor: React.ComponentClass<
|
|
11
|
-
Omit<AnchorProps, 'href'
|
|
10
|
+
declare const RoutedAnchor: React.ComponentClass<
|
|
11
|
+
RoutedAnchorProps & Omit<AnchorProps, 'href'>
|
|
12
|
+
>;
|
|
12
13
|
|
|
13
14
|
export { RoutedAnchor };
|
|
@@ -6,7 +6,8 @@ export interface RoutedButtonProps {
|
|
|
6
6
|
method?: 'push' | 'replace';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
declare const RoutedButton: React.ComponentClass<
|
|
10
|
-
ButtonProps
|
|
9
|
+
declare const RoutedButton: React.ComponentClass<
|
|
10
|
+
RoutedButtonProps & ButtonProps
|
|
11
|
+
>;
|
|
11
12
|
|
|
12
13
|
export { RoutedButton };
|
|
@@ -8,7 +8,7 @@ import { Keyboard } from '../Keyboard';
|
|
|
8
8
|
import { FormContext } from '../Form/FormContext';
|
|
9
9
|
import { SelectContainer } from './SelectContainer';
|
|
10
10
|
import { HiddenInput, StyledSelectDropButton } from './StyledSelect';
|
|
11
|
-
import { applyKey, getNormalizedValue, changeEvent, getSelectIcon, getDisplayLabelKey, getIconColor, formatValueForA11y } from './utils';
|
|
11
|
+
import { applyKey, getNormalizedValue, changeEvent, getSelectIcon, getDisplayLabelKey, getIconColor, formatValueForA11y, inertTrueValue } from './utils';
|
|
12
12
|
import { DefaultSelectTextInput } from './DefaultSelectTextInput';
|
|
13
13
|
import { MessageContext } from '../../contexts/MessageContext';
|
|
14
14
|
import { SelectPropTypes } from './propTypes';
|
|
@@ -325,8 +325,7 @@ var Select = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
325
325
|
type: "text",
|
|
326
326
|
name: name,
|
|
327
327
|
id: id ? id + "__input" : undefined,
|
|
328
|
-
inert:
|
|
329
|
-
,
|
|
328
|
+
inert: inertTrueValue,
|
|
330
329
|
value: inputValue,
|
|
331
330
|
ref: inputRef,
|
|
332
331
|
readOnly: true
|
|
@@ -334,8 +333,7 @@ var Select = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
334
333
|
a11yTitle: (ariaLabel || a11yTitle) && "" + (ariaLabel || a11yTitle) + (value && typeof value === 'string' ? ", " + value : ''),
|
|
335
334
|
disabled: disabled,
|
|
336
335
|
id: id,
|
|
337
|
-
inert:
|
|
338
|
-
,
|
|
336
|
+
inert: inertTrueValue,
|
|
339
337
|
name: name,
|
|
340
338
|
ref: inputRef,
|
|
341
339
|
placeholder: placeholder,
|
|
@@ -63,7 +63,13 @@ export interface SelectProps extends BasicSelectProps {
|
|
|
63
63
|
// value, name, id, onChange, placeholder
|
|
64
64
|
export interface SelectExtendedProps
|
|
65
65
|
extends SelectProps,
|
|
66
|
-
Omit<
|
|
66
|
+
Omit<
|
|
67
|
+
React.DetailedHTMLProps<
|
|
68
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
69
|
+
HTMLInputElement
|
|
70
|
+
>,
|
|
71
|
+
keyof SelectProps | 'readOnly'
|
|
72
|
+
> {}
|
|
67
73
|
|
|
68
74
|
declare const Select: React.FC<SelectExtendedProps>;
|
|
69
75
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, isValidElement } from 'react';
|
|
1
|
+
import React, { useCallback, isValidElement } from 'react';
|
|
2
2
|
import { normalizeColor } from '../../utils';
|
|
3
3
|
var _applyKey = function applyKey(option, key) {
|
|
4
4
|
if (/*#__PURE__*/isValidElement(option)) return option;
|
|
@@ -105,4 +105,11 @@ var _formatValueForA11y = function formatValueForA11y(value, labelKey) {
|
|
|
105
105
|
}
|
|
106
106
|
return _applyKey(value, labelKey);
|
|
107
107
|
};
|
|
108
|
-
|
|
108
|
+
|
|
109
|
+
// In react 18 and below the inert attribute is not supported
|
|
110
|
+
// so we use an empty string instead of true. In react 19 and above
|
|
111
|
+
// inert is supported so we should use true. The use function is
|
|
112
|
+
// used to determine the react version because it is only available
|
|
113
|
+
// in react 19 and above.
|
|
114
|
+
export { _formatValueForA11y as formatValueForA11y };
|
|
115
|
+
export var inertTrueValue = React.use ? true : '';
|
|
@@ -11,7 +11,7 @@ import { FormContext } from '../Form/FormContext';
|
|
|
11
11
|
import { SelectMultipleValue } from './SelectMultipleValue';
|
|
12
12
|
import { SelectMultipleContainer } from './SelectMultipleContainer';
|
|
13
13
|
import { HiddenInput, SelectTextInput, StyledSelectDropButton } from '../Select/StyledSelect';
|
|
14
|
-
import { applyKey, getNormalizedValue, changeEvent, getSelectIcon, getIconColor, getDisplayLabelKey, arrayIncludes } from '../Select/utils';
|
|
14
|
+
import { applyKey, getNormalizedValue, changeEvent, getSelectIcon, getIconColor, getDisplayLabelKey, arrayIncludes, inertTrueValue } from '../Select/utils';
|
|
15
15
|
import { DefaultSelectTextInput } from '../Select/DefaultSelectTextInput';
|
|
16
16
|
import { MessageContext } from '../../contexts/MessageContext';
|
|
17
17
|
import { SelectMultiplePropTypes } from './propTypes';
|
|
@@ -402,8 +402,7 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
402
402
|
defaultCursor: disabled === true || undefined,
|
|
403
403
|
focusIndicator: false,
|
|
404
404
|
id: id ? id + "__input" : undefined,
|
|
405
|
-
inert:
|
|
406
|
-
,
|
|
405
|
+
inert: inertTrueValue,
|
|
407
406
|
name: name,
|
|
408
407
|
width: "100%"
|
|
409
408
|
}, rest, {
|
|
@@ -426,8 +425,7 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
426
425
|
type: "text",
|
|
427
426
|
name: name,
|
|
428
427
|
id: id ? id + "__input" : undefined,
|
|
429
|
-
inert:
|
|
430
|
-
,
|
|
428
|
+
inert: inertTrueValue,
|
|
431
429
|
value: inputValue,
|
|
432
430
|
ref: inputRef,
|
|
433
431
|
readOnly: true
|
|
@@ -437,8 +435,7 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
437
435
|
a11yTitle: ariaLabel || a11yTitle,
|
|
438
436
|
disabled: disabled,
|
|
439
437
|
id: id,
|
|
440
|
-
inert:
|
|
441
|
-
,
|
|
438
|
+
inert: inertTrueValue,
|
|
442
439
|
name: name,
|
|
443
440
|
ref: inputRef,
|
|
444
441
|
placeholder: placeholder || 'Select',
|
|
@@ -465,8 +462,7 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
465
462
|
type: "text",
|
|
466
463
|
name: name,
|
|
467
464
|
id: id ? id + "__input" : undefined,
|
|
468
|
-
inert:
|
|
469
|
-
,
|
|
465
|
+
inert: inertTrueValue,
|
|
470
466
|
value: inputValue,
|
|
471
467
|
ref: inputRef,
|
|
472
468
|
readOnly: true
|
|
@@ -474,8 +470,7 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
474
470
|
a11yTitle: ariaLabel || a11yTitle,
|
|
475
471
|
disabled: disabled,
|
|
476
472
|
id: id,
|
|
477
|
-
inert:
|
|
478
|
-
,
|
|
473
|
+
inert: inertTrueValue,
|
|
479
474
|
name: name,
|
|
480
475
|
ref: inputRef,
|
|
481
476
|
placeholder: placeholder,
|
|
@@ -10,7 +10,7 @@ import { Text } from '../Text';
|
|
|
10
10
|
import { TextInput } from '../TextInput';
|
|
11
11
|
import { SelectionSummary } from './SelectionSummary';
|
|
12
12
|
import { StyledContainer, OptionsContainer, SelectOption } from '../Select/StyledSelect';
|
|
13
|
-
import { applyKey, getOptionLabel, getOptionValue, useDisabled, getOptionIndex, arrayIncludes } from '../Select/utils';
|
|
13
|
+
import { applyKey, getOptionLabel, getOptionValue, useDisabled, getOptionIndex, arrayIncludes, inertTrueValue } from '../Select/utils';
|
|
14
14
|
import { EmptySearchOption } from '../Select/EmptySearchOption';
|
|
15
15
|
import { MessageContext } from '../../contexts/MessageContext';
|
|
16
16
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
@@ -366,8 +366,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
366
366
|
tabIndex: "-1",
|
|
367
367
|
checked: optionSelected,
|
|
368
368
|
disabled: optionDisabled,
|
|
369
|
-
inert:
|
|
370
|
-
,
|
|
369
|
+
inert: inertTrueValue,
|
|
371
370
|
containerProps: {
|
|
372
371
|
// in Firefox when we have inert set, the checkbox
|
|
373
372
|
// click event gets swallowed by the checkbox.
|
|
@@ -401,8 +400,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
401
400
|
tabIndex: "-1",
|
|
402
401
|
checked: optionSelected,
|
|
403
402
|
disabled: optionDisabled,
|
|
404
|
-
inert:
|
|
405
|
-
,
|
|
403
|
+
inert: inertTrueValue,
|
|
406
404
|
containerProps: {
|
|
407
405
|
// in Firefox when we have inert set, the checkbox
|
|
408
406
|
// click event gets swallowed by the checkbox.
|
|
@@ -3,7 +3,7 @@ import { Box } from '../Box';
|
|
|
3
3
|
import { Button } from '../Button';
|
|
4
4
|
import { CheckBox } from '../CheckBox';
|
|
5
5
|
import { SelectOption } from '../Select/StyledSelect';
|
|
6
|
-
import { applyKey, getOptionLabel, useDisabled, arrayIncludes, getOptionIndex } from '../Select/utils';
|
|
6
|
+
import { applyKey, getOptionLabel, useDisabled, arrayIncludes, getOptionIndex, inertTrueValue } from '../Select/utils';
|
|
7
7
|
import { MessageContext } from '../../contexts/MessageContext';
|
|
8
8
|
var SelectMultipleValue = function SelectMultipleValue(_ref) {
|
|
9
9
|
var allOptions = _ref.allOptions,
|
|
@@ -101,8 +101,7 @@ var SelectMultipleValue = function SelectMultipleValue(_ref) {
|
|
|
101
101
|
pad: "xsmall",
|
|
102
102
|
tabIndex: "-1",
|
|
103
103
|
checked: optionSelected,
|
|
104
|
-
inert:
|
|
105
|
-
,
|
|
104
|
+
inert: inertTrueValue,
|
|
106
105
|
containerProps: {
|
|
107
106
|
// in Firefox when we have inert set, the checkbox
|
|
108
107
|
// click event gets swallowed by the checkbox.
|
|
@@ -31,7 +31,13 @@ export interface SelectMultipleProps extends BasicSelectProps {
|
|
|
31
31
|
// value, name, id, onChange, placeholder
|
|
32
32
|
export interface SelectMultipleExtendedProps
|
|
33
33
|
extends SelectMultipleProps,
|
|
34
|
-
Omit<
|
|
34
|
+
Omit<
|
|
35
|
+
React.DetailedHTMLProps<
|
|
36
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
37
|
+
HTMLInputElement
|
|
38
|
+
>,
|
|
39
|
+
keyof SelectMultipleProps
|
|
40
|
+
> {}
|
|
35
41
|
|
|
36
42
|
declare const SelectMultiple: React.FC<SelectMultipleExtendedProps>;
|
|
37
43
|
|
|
@@ -6,7 +6,10 @@ export interface SidebarProps {
|
|
|
6
6
|
header?: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
type divProps = Omit<
|
|
9
|
+
type divProps = Omit<
|
|
10
|
+
React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
11
|
+
'onClick'
|
|
12
|
+
>;
|
|
10
13
|
|
|
11
14
|
export interface SidebarExtendedProps
|
|
12
15
|
extends BoxProps,
|
|
@@ -27,7 +27,10 @@ export interface StackProps {
|
|
|
27
27
|
margin?: MarginType;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
type divProps =
|
|
30
|
+
type divProps = React.DetailedHTMLProps<
|
|
31
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
32
|
+
HTMLDivElement
|
|
33
|
+
>;
|
|
31
34
|
|
|
32
35
|
export interface StackExtendedProps extends StackProps, divProps {}
|
|
33
36
|
|
|
@@ -12,7 +12,13 @@ export interface TabProps {
|
|
|
12
12
|
|
|
13
13
|
export interface TabExtendedProps
|
|
14
14
|
extends TabProps,
|
|
15
|
-
Omit<
|
|
15
|
+
Omit<
|
|
16
|
+
React.DetailedHTMLProps<
|
|
17
|
+
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
18
|
+
HTMLButtonElement
|
|
19
|
+
>,
|
|
20
|
+
'title'
|
|
21
|
+
> {}
|
|
16
22
|
|
|
17
23
|
declare const Tab: React.FC<TabExtendedProps>;
|
|
18
24
|
|
|
@@ -14,7 +14,10 @@ export interface TableProps {
|
|
|
14
14
|
margin?: MarginType;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
type htmlTableProps =
|
|
17
|
+
type htmlTableProps = React.DetailedHTMLProps<
|
|
18
|
+
React.HTMLAttributes<HTMLTableElement>,
|
|
19
|
+
HTMLTableElement
|
|
20
|
+
>;
|
|
18
21
|
|
|
19
22
|
export interface TableExtendedProps extends TableProps, htmlTableProps {}
|
|
20
23
|
|
|
@@ -2,7 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
export interface TableBodyProps {}
|
|
4
4
|
|
|
5
|
-
type htmlTableBodyProps =
|
|
5
|
+
type htmlTableBodyProps = React.DetailedHTMLProps<
|
|
6
|
+
React.HTMLAttributes<HTMLTableSectionElement>,
|
|
7
|
+
HTMLTableSectionElement
|
|
8
|
+
>;
|
|
6
9
|
|
|
7
10
|
export interface TableBodyExtendedProps
|
|
8
11
|
extends TableBodyProps,
|