@strapi/design-system 1.3.1-alpha.0 → 1.3.1
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/dist/Accordion/AccordionContent.cjs +1 -1
- package/dist/Accordion/AccordionContent.js +37 -17
- package/dist/Accordion/AccordionToggle.cjs +6 -6
- package/dist/Accordion/AccordionToggle.js +96 -75
- package/dist/Alert/Alert.cjs +12 -12
- package/dist/Alert/Alert.js +102 -83
- package/dist/Badge/Badge.cjs +1 -1
- package/dist/Badge/Badge.js +47 -25
- package/dist/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +42 -20
- package/dist/BaseCheckbox/BaseCheckbox.cjs +6 -6
- package/dist/BaseCheckbox/BaseCheckbox.js +55 -35
- package/dist/BaseLink/BaseLink.cjs +2 -2
- package/dist/BaseLink/BaseLink.js +43 -21
- package/dist/BaseRadio/BaseRadio.cjs +8 -8
- package/dist/BaseRadio/BaseRadio.js +51 -31
- package/dist/BaseRadio/RadioGroup.cjs +1 -1
- package/dist/BaseRadio/RadioGroup.js +44 -24
- package/dist/Box/BoxProps.cjs +1 -1
- package/dist/Box/BoxProps.js +19 -10
- package/dist/Breadcrumbs/Breadcrumbs.cjs +4 -4
- package/dist/Breadcrumbs/Breadcrumbs.js +50 -29
- package/dist/Button/Button.cjs +14 -14
- package/dist/Button/Button.js +73 -53
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +37 -17
- package/dist/Card/CardAsset.cjs +4 -4
- package/dist/Card/CardAsset.js +42 -19
- package/dist/Card/CardBadge.cjs +3 -3
- package/dist/Card/CardBadge.js +18 -9
- package/dist/Card/CardBody.cjs +1 -1
- package/dist/Card/CardBody.js +19 -8
- package/dist/Card/CardCheckbox.cjs +1 -1
- package/dist/Card/CardCheckbox.js +22 -12
- package/dist/Card/CardContent.cjs +2 -2
- package/dist/Card/CardContent.js +32 -11
- package/dist/Card/CardHeader.cjs +2 -2
- package/dist/Card/CardHeader.js +19 -9
- package/dist/Card/CardTimer.cjs +2 -2
- package/dist/Card/CardTimer.js +42 -20
- package/dist/Card/CardTitle.cjs +1 -1
- package/dist/Card/CardTitle.js +27 -16
- package/dist/CarouselInput/Carousel.cjs +6 -6
- package/dist/CarouselInput/Carousel.js +107 -77
- package/dist/CarouselInput/CarouselActions.cjs +1 -1
- package/dist/CarouselInput/CarouselActions.js +17 -7
- package/dist/CarouselInput/CarouselImage.cjs +3 -3
- package/dist/CarouselInput/CarouselImage.js +38 -26
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +83 -49
- package/dist/CarouselInput/CarouselSlide.cjs +2 -2
- package/dist/CarouselInput/CarouselSlide.js +42 -20
- package/dist/Checkbox/Checkbox.cjs +2 -2
- package/dist/Checkbox/Checkbox.js +63 -44
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +240 -190
- package/dist/Combobox/ComboboxOption.cjs +1 -1
- package/dist/Combobox/ComboboxOption.js +47 -25
- package/dist/Combobox/utils.cjs +1 -1
- package/dist/Combobox/utils.js +18 -18
- package/dist/DatePicker/DatePicker.cjs +1 -1
- package/dist/DatePicker/DatePicker.js +111 -80
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -1
- package/dist/DatePicker/DatePickerCalendar.js +1 -1
- package/dist/DatePicker/DatePickerTd.cjs +4 -4
- package/dist/DatePicker/DatePickerTd.js +42 -23
- package/dist/DatePicker/DatePickerTh.cjs +3 -3
- package/dist/DatePicker/DatePickerTh.js +44 -23
- package/dist/DatePicker/utils/getYears.cjs +1 -1
- package/dist/DatePicker/utils/getYears.js +7 -6
- package/dist/Dialog/Dialog.cjs +5 -5
- package/dist/Dialog/Dialog.js +58 -39
- package/dist/DismissibleLayer/DismissibleLayer.cjs +1 -1
- package/dist/DismissibleLayer/DismissibleLayer.js +29 -26
- package/dist/Divider/Divider.cjs +2 -2
- package/dist/Divider/Divider.js +38 -15
- package/dist/Field/Field.cjs +1 -1
- package/dist/Field/Field.js +38 -19
- package/dist/Field/FieldAction.cjs +2 -2
- package/dist/Field/FieldAction.js +35 -13
- package/dist/Field/FieldInput.cjs +6 -6
- package/dist/Field/FieldInput.js +66 -46
- package/dist/Field/FieldLabel.cjs +3 -3
- package/dist/Field/FieldLabel.js +45 -25
- package/dist/Flex/FlexProps.cjs +1 -1
- package/dist/Flex/FlexProps.js +19 -10
- package/dist/FocusTrap/FocusTrap.cjs +1 -1
- package/dist/FocusTrap/FocusTrap.js +52 -32
- package/dist/Grid/Grid.cjs +3 -3
- package/dist/Grid/Grid.js +42 -20
- package/dist/Grid/GridItem.cjs +2 -2
- package/dist/Grid/GridItem.js +41 -22
- package/dist/Icon/Icon.cjs +2 -2
- package/dist/Icon/Icon.js +27 -17
- package/dist/IconButton/IconButton.cjs +4 -4
- package/dist/IconButton/IconButton.js +67 -47
- package/dist/KeyboardNavigable/KeyboardNavigable.cjs +1 -1
- package/dist/KeyboardNavigable/KeyboardNavigable.js +58 -38
- package/dist/Layout/HeaderLayout.cjs +2 -2
- package/dist/Layout/HeaderLayout.js +96 -78
- package/dist/Link/Link.cjs +6 -6
- package/dist/Link/Link.js +54 -34
- package/dist/LinkButton/LinkButton.cjs +10 -10
- package/dist/LinkButton/LinkButton.js +69 -47
- package/dist/Loader/Loader.cjs +4 -4
- package/dist/Loader/Loader.js +47 -25
- package/dist/Main/Main.cjs +2 -2
- package/dist/Main/Main.js +35 -15
- package/dist/MainNav/MainNav.cjs +2 -2
- package/dist/MainNav/MainNav.js +39 -17
- package/dist/MainNav/NavCondense.cjs +3 -3
- package/dist/MainNav/NavCondense.js +40 -20
- package/dist/MainNav/NavLink.cjs +9 -9
- package/dist/MainNav/NavLink.js +72 -53
- package/dist/MainNav/NavSection.cjs +1 -1
- package/dist/MainNav/NavSection.js +67 -46
- package/dist/MainNav/NavSections.cjs +1 -1
- package/dist/MainNav/NavSections.js +40 -18
- package/dist/MainNav/NavUser.cjs +2 -2
- package/dist/MainNav/NavUser.js +51 -31
- package/dist/ModalLayout/ModalBody.cjs +2 -2
- package/dist/ModalLayout/ModalBody.js +19 -9
- package/dist/ModalLayout/ModalLayout.cjs +3 -3
- package/dist/ModalLayout/ModalLayout.js +52 -30
- package/dist/NumberInput/NumberInput.cjs +6 -6
- package/dist/NumberInput/NumberInput.js +154 -120
- package/dist/Pagination/components.cjs +7 -7
- package/dist/Pagination/components.js +88 -65
- package/dist/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +91 -65
- package/dist/Portal/Portal.cjs +1 -1
- package/dist/Portal/Portal.js +12 -11
- package/dist/ProgressBar/ProgressBar.cjs +2 -2
- package/dist/ProgressBar/ProgressBar.js +49 -27
- package/dist/Radio/Radio.cjs +2 -2
- package/dist/Radio/Radio.js +40 -19
- package/dist/RawTable/RawCell.cjs +1 -1
- package/dist/RawTable/RawCell.js +79 -59
- package/dist/RawTable/RawTable.cjs +1 -1
- package/dist/RawTable/RawTable.js +66 -46
- package/dist/RawTable/RawTbody.cjs +1 -1
- package/dist/RawTable/RawTbody.js +30 -11
- package/dist/RawTable/RawThead.cjs +1 -1
- package/dist/RawTable/RawThead.js +29 -10
- package/dist/RawTable/RawTr.cjs +1 -1
- package/dist/RawTable/RawTr.js +34 -14
- package/dist/Searchbar/SearchForm.cjs +1 -1
- package/dist/Searchbar/SearchForm.js +16 -5
- package/dist/Searchbar/Searchbar.cjs +7 -7
- package/dist/Searchbar/Searchbar.js +65 -45
- package/dist/Select/MultiSelectNested.cjs +1 -1
- package/dist/Select/MultiSelectNested.js +45 -23
- package/dist/Select/OptGroup.cjs +1 -1
- package/dist/Select/OptGroup.js +35 -15
- package/dist/Select/Option.cjs +7 -7
- package/dist/Select/Option.js +57 -37
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +183 -144
- package/dist/Select/SelectButton.cjs +2 -2
- package/dist/Select/SelectButton.js +53 -33
- package/dist/SimpleMenu/SimpleMenu.cjs +7 -7
- package/dist/SimpleMenu/SimpleMenu.js +145 -119
- package/dist/Stack/Stack.cjs +3 -3
- package/dist/Stack/Stack.js +50 -29
- package/dist/Status/Status.cjs +4 -4
- package/dist/Status/Status.js +50 -30
- package/dist/SubNav/SubNav.cjs +3 -3
- package/dist/SubNav/SubNav.js +37 -15
- package/dist/SubNav/SubNavHeader.cjs +2 -2
- package/dist/SubNav/SubNavHeader.js +40 -39
- package/dist/SubNav/SubNavLink.cjs +6 -6
- package/dist/SubNav/SubNavLink.js +62 -40
- package/dist/SubNav/SubNavSections.cjs +1 -1
- package/dist/SubNav/SubNavSections.js +39 -17
- package/dist/Switch/Switch.cjs +5 -5
- package/dist/Switch/Switch.js +57 -35
- package/dist/Table/Cell.cjs +3 -3
- package/dist/Table/Cell.js +40 -20
- package/dist/Table/TFooter.cjs +3 -3
- package/dist/Table/TFooter.js +50 -28
- package/dist/Table/Table.cjs +5 -5
- package/dist/Table/Table.js +56 -36
- package/dist/Table/Tbody.cjs +2 -2
- package/dist/Table/Tbody.js +17 -8
- package/dist/Table/Thead.cjs +2 -2
- package/dist/Table/Thead.js +17 -8
- package/dist/Table/Tr.cjs +2 -2
- package/dist/Table/Tr.js +17 -8
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +45 -26
- package/dist/Tabs/TabPanels.cjs +1 -1
- package/dist/Tabs/TabPanels.js +43 -24
- package/dist/Tabs/Tabs.cjs +2 -2
- package/dist/Tabs/Tabs.js +112 -94
- package/dist/Tag/Tag.cjs +4 -4
- package/dist/Tag/Tag.js +50 -27
- package/dist/TextButton/TextButton.cjs +6 -6
- package/dist/TextButton/TextButton.js +59 -39
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +69 -49
- package/dist/Textarea/Textarea.cjs +3 -3
- package/dist/Textarea/Textarea.js +63 -43
- package/dist/Textarea/TextareaInput.cjs +4 -4
- package/dist/Textarea/TextareaInput.js +49 -29
- package/dist/TimePicker/TimePicker.cjs +3 -3
- package/dist/TimePicker/TimePicker.js +89 -58
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +8 -8
- package/dist/ToggleCheckbox/ToggleCheckbox.js +75 -53
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +98 -66
- package/dist/Tooltip/Tooltip.cjs +2 -2
- package/dist/Tooltip/Tooltip.js +57 -38
- package/dist/Typography/TypographyProps.cjs +1 -1
- package/dist/Typography/TypographyProps.js +22 -13
- package/dist/helpers/getDefaultLocale.cjs +1 -1
- package/dist/helpers/getDefaultLocale.js +1 -1
- package/dist/helpers/handleResponsiveValues.cjs +5 -5
- package/dist/helpers/handleResponsiveValues.js +14 -14
- package/dist/themes/darkTheme/index.cjs +1 -1
- package/dist/themes/darkTheme/index.js +18 -8
- package/dist/themes/extendTheme.cjs +4 -4
- package/dist/themes/extendTheme.js +29 -18
- package/dist/themes/lightTheme/index.cjs +1 -1
- package/dist/themes/lightTheme/index.js +18 -8
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +43 -23
- package/dist/v2/Breadcrumbs/Crumb.cjs +1 -1
- package/dist/v2/Breadcrumbs/Crumb.js +44 -22
- package/dist/v2/Breadcrumbs/CrumbLink.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbLink.js +35 -14
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +41 -19
- package/dist/v2/Link/Link.cjs +5 -5
- package/dist/v2/Link/Link.js +64 -42
- package/dist/v2/LinkButton/LinkButton.cjs +10 -10
- package/dist/v2/LinkButton/LinkButton.js +75 -51
- package/dist/v2/MainNav/MainNav.cjs +2 -2
- package/dist/v2/MainNav/MainNav.js +39 -17
- package/dist/v2/MainNav/NavBrand.cjs +3 -3
- package/dist/v2/MainNav/NavBrand.js +78 -57
- package/dist/v2/MainNav/NavCondense.cjs +3 -3
- package/dist/v2/MainNav/NavCondense.js +40 -20
- package/dist/v2/MainNav/NavLink.cjs +9 -9
- package/dist/v2/MainNav/NavLink.js +77 -56
- package/dist/v2/MainNav/NavSection.cjs +1 -1
- package/dist/v2/MainNav/NavSection.js +67 -46
- package/dist/v2/MainNav/NavSections.cjs +1 -1
- package/dist/v2/MainNav/NavSections.js +40 -18
- package/dist/v2/MainNav/NavUser.cjs +2 -2
- package/dist/v2/MainNav/NavUser.js +51 -31
- package/dist/v2/Pagination/components.cjs +7 -7
- package/dist/v2/Pagination/components.js +89 -65
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +7 -7
- package/dist/v2/SimpleMenu/SimpleMenu.js +145 -119
- package/dist/v2/SubNav/SubNav.cjs +3 -3
- package/dist/v2/SubNav/SubNav.js +37 -15
- package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
- package/dist/v2/SubNav/SubNavHeader.js +40 -39
- package/dist/v2/SubNav/SubNavLink.cjs +6 -6
- package/dist/v2/SubNav/SubNavLink.js +65 -43
- package/dist/v2/SubNav/SubNavSections.cjs +1 -1
- package/dist/v2/SubNav/SubNavSections.js +39 -17
- package/package.json +5 -4
package/dist/Select/Select.js
CHANGED
|
@@ -1,179 +1,218 @@
|
|
|
1
|
-
|
|
1
|
+
var ie = Object.defineProperty;
|
|
2
|
+
var I = Object.getOwnPropertySymbols;
|
|
3
|
+
var q = Object.prototype.hasOwnProperty, z = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var P = (o, l, i) => l in o ? ie(o, l, { enumerable: !0, configurable: !0, writable: !0, value: i }) : o[l] = i, G = (o, l) => {
|
|
5
|
+
for (var i in l || (l = {}))
|
|
6
|
+
q.call(l, i) && P(o, i, l[i]);
|
|
7
|
+
if (I)
|
|
8
|
+
for (var i of I(l))
|
|
9
|
+
z.call(l, i) && P(o, i, l[i]);
|
|
10
|
+
return o;
|
|
11
|
+
};
|
|
12
|
+
var H = (o, l) => {
|
|
13
|
+
var i = {};
|
|
14
|
+
for (var a in o)
|
|
15
|
+
q.call(o, a) && l.indexOf(a) < 0 && (i[a] = o[a]);
|
|
16
|
+
if (o != null && I)
|
|
17
|
+
for (var a of I(o))
|
|
18
|
+
l.indexOf(a) < 0 && z.call(o, a) && (i[a] = o[a]);
|
|
19
|
+
return i;
|
|
20
|
+
};
|
|
21
|
+
import r, { useState as le, useRef as ae, Children as W, cloneElement as _ } from "react";
|
|
2
22
|
import e from "prop-types";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { sizes as
|
|
6
|
-
import { SelectButton as
|
|
7
|
-
import { Field as
|
|
8
|
-
import { FieldLabel as
|
|
23
|
+
import se from "@strapi/icons/CarretDown";
|
|
24
|
+
import pe from "@strapi/icons/Cross";
|
|
25
|
+
import { sizes as ce } from "../themes/sizes.js";
|
|
26
|
+
import { SelectButton as me } from "./SelectButton.js";
|
|
27
|
+
import { Field as de } from "../Field/Field.js";
|
|
28
|
+
import { FieldLabel as fe } from "../Field/FieldLabel.js";
|
|
9
29
|
import "../Field/FieldInput.js";
|
|
10
|
-
import { FieldHint as
|
|
11
|
-
import { FieldError as
|
|
30
|
+
import { FieldHint as ue } from "../Field/FieldHint.js";
|
|
31
|
+
import { FieldError as he } from "../Field/FieldError.js";
|
|
12
32
|
import "../Field/FieldContext.js";
|
|
13
33
|
import "../Field/FieldAction.js";
|
|
14
|
-
import { Popover as
|
|
15
|
-
import { Stack as
|
|
16
|
-
import { Typography as
|
|
17
|
-
import { Flex as
|
|
18
|
-
import { Box as
|
|
19
|
-
import { useId as
|
|
20
|
-
import { SelectList as
|
|
21
|
-
import { SelectButtonWrapper as
|
|
22
|
-
import { useButtonRef as
|
|
23
|
-
import { VisuallyHidden as
|
|
24
|
-
import { DownState as
|
|
25
|
-
import { escapeSelector as
|
|
26
|
-
import { SelectTags as
|
|
27
|
-
import
|
|
28
|
-
const
|
|
34
|
+
import { Popover as Ee } from "../Popover/Popover.js";
|
|
35
|
+
import { Stack as be } from "../Stack/Stack.js";
|
|
36
|
+
import { Typography as N } from "../Typography/Typography.js";
|
|
37
|
+
import { Flex as $ } from "../Flex/Flex.js";
|
|
38
|
+
import { Box as J } from "../Box/Box.js";
|
|
39
|
+
import { useId as ye } from "../helpers/useId.js";
|
|
40
|
+
import { SelectList as ge } from "./SelectList.js";
|
|
41
|
+
import { SelectButtonWrapper as ve, IconBox as Ie, CaretBox as Oe } from "./components.js";
|
|
42
|
+
import { useButtonRef as Ce } from "./hooks/useButtonRef.js";
|
|
43
|
+
import { VisuallyHidden as K } from "../VisuallyHidden/VisuallyHidden.js";
|
|
44
|
+
import { DownState as Se } from "./constants.js";
|
|
45
|
+
import { escapeSelector as Q } from "../helpers/escapeSelector.js";
|
|
46
|
+
import { SelectTags as xe } from "./SelectTags.js";
|
|
47
|
+
import Be from "styled-components";
|
|
48
|
+
const Te = Be($)`
|
|
29
49
|
width: 100%;
|
|
30
|
-
`,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
`, U = ($e) => {
|
|
51
|
+
var w = $e, {
|
|
52
|
+
label: o,
|
|
53
|
+
labelAction: l,
|
|
54
|
+
id: i,
|
|
55
|
+
children: a,
|
|
56
|
+
customizeContent: h,
|
|
57
|
+
placeholder: O,
|
|
58
|
+
onChange: C,
|
|
59
|
+
value: n,
|
|
60
|
+
hint: S,
|
|
61
|
+
error: u,
|
|
62
|
+
disabled: m,
|
|
63
|
+
clearLabel: X,
|
|
64
|
+
onClear: R,
|
|
65
|
+
onReachEnd: Y,
|
|
66
|
+
multi: p,
|
|
67
|
+
required: Z,
|
|
68
|
+
size: V,
|
|
69
|
+
startIcon: L,
|
|
70
|
+
withTags: E
|
|
71
|
+
} = w, ee = H(w, [
|
|
72
|
+
"label",
|
|
73
|
+
"labelAction",
|
|
74
|
+
"id",
|
|
75
|
+
"children",
|
|
76
|
+
"customizeContent",
|
|
77
|
+
"placeholder",
|
|
78
|
+
"onChange",
|
|
79
|
+
"value",
|
|
80
|
+
"hint",
|
|
81
|
+
"error",
|
|
82
|
+
"disabled",
|
|
83
|
+
"clearLabel",
|
|
84
|
+
"onClear",
|
|
85
|
+
"onReachEnd",
|
|
86
|
+
"multi",
|
|
87
|
+
"required",
|
|
88
|
+
"size",
|
|
89
|
+
"startIcon",
|
|
90
|
+
"withTags"
|
|
91
|
+
]);
|
|
92
|
+
const s = ye("select", i), [b, y] = le(void 0), D = Ce(b), F = ae(null), x = `${s}-label`, g = `${s}-content`, te = u ? `${s}-error` : S ? `${s}-hint` : void 0;
|
|
93
|
+
if (E && !p)
|
|
54
94
|
throw new Error('The "withTags" props can only be used when the "multi" prop is present');
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
t.preventDefault(), !
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return this.indexOf(
|
|
67
|
-
}, t) : [...
|
|
95
|
+
const re = () => {
|
|
96
|
+
y(void 0);
|
|
97
|
+
}, oe = () => {
|
|
98
|
+
m || (R(), D.current.focus());
|
|
99
|
+
}, M = (t) => {
|
|
100
|
+
t.preventDefault(), !m && (t.nativeEvent.which === 3 || t.nativeEvent.button === 2 || y(Se.Mouse));
|
|
101
|
+
}, B = (t, c = !0) => {
|
|
102
|
+
p ? C(n.includes(t) ? n.filter((f) => f !== t) : [...n, t]) : (C(t), c && y(void 0));
|
|
103
|
+
}, k = (t) => {
|
|
104
|
+
C(
|
|
105
|
+
n.includes(t[0]) ? n.filter(function(c) {
|
|
106
|
+
return this.indexOf(c) < 0;
|
|
107
|
+
}, t) : [...n, ...t]
|
|
68
108
|
);
|
|
69
109
|
};
|
|
70
|
-
let
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
return
|
|
74
|
-
id:
|
|
75
|
-
onClick: () =>
|
|
76
|
-
selected:
|
|
77
|
-
multi:
|
|
78
|
-
isChild:
|
|
110
|
+
let T, j = [];
|
|
111
|
+
const A = (t, c) => {
|
|
112
|
+
const f = `${s}-option-${t.props.value}`, v = p ? n.includes(t.props.value) : t.props.value === n;
|
|
113
|
+
return v && (E ? j.push({ label: t.props.children, value: t.props.value }) : T = t.props.children), _(t, {
|
|
114
|
+
id: Q(f),
|
|
115
|
+
onClick: () => B(t.props.value),
|
|
116
|
+
selected: v,
|
|
117
|
+
multi: p,
|
|
118
|
+
isChild: c
|
|
79
119
|
});
|
|
80
|
-
},
|
|
120
|
+
}, ne = W.toArray(a).map((t) => {
|
|
81
121
|
if (t.type.displayName === "OptGroup") {
|
|
82
|
-
const
|
|
83
|
-
return
|
|
84
|
-
id:
|
|
85
|
-
onClick: () =>
|
|
86
|
-
selected:
|
|
87
|
-
indeterminate:
|
|
88
|
-
multi:
|
|
89
|
-
children:
|
|
122
|
+
const c = `${s}-option-${t.props.label}`, f = t.props.children.every((d) => n.includes(d.props.value)), v = !f && t.props.children.some((d) => n.includes(d.props.value));
|
|
123
|
+
return _(t, {
|
|
124
|
+
id: Q(c),
|
|
125
|
+
onClick: () => k(t.props.children.map((d) => d.props.value)),
|
|
126
|
+
selected: f,
|
|
127
|
+
indeterminate: v,
|
|
128
|
+
multi: p,
|
|
129
|
+
children: W.toArray(t.props.children).map((d) => A(d, !0)),
|
|
90
130
|
value: t.props.label
|
|
91
131
|
});
|
|
92
132
|
} else
|
|
93
|
-
return
|
|
133
|
+
return A(t);
|
|
94
134
|
});
|
|
95
|
-
return /* @__PURE__ */ r.createElement(
|
|
96
|
-
hint:
|
|
97
|
-
error:
|
|
98
|
-
id:
|
|
99
|
-
}, /* @__PURE__ */ r.createElement(
|
|
100
|
-
spacing:
|
|
101
|
-
},
|
|
102
|
-
required:
|
|
135
|
+
return /* @__PURE__ */ r.createElement(de, {
|
|
136
|
+
hint: S,
|
|
137
|
+
error: u,
|
|
138
|
+
id: s
|
|
139
|
+
}, /* @__PURE__ */ r.createElement(be, {
|
|
140
|
+
spacing: o || S || u ? 1 : 0
|
|
141
|
+
}, o && /* @__PURE__ */ r.createElement(fe, {
|
|
142
|
+
required: Z,
|
|
103
143
|
as: "span",
|
|
104
|
-
id:
|
|
105
|
-
action:
|
|
106
|
-
},
|
|
107
|
-
size:
|
|
108
|
-
hasError: Boolean(
|
|
109
|
-
disabled:
|
|
110
|
-
ref:
|
|
111
|
-
}, /* @__PURE__ */ r.createElement(
|
|
112
|
-
ref:
|
|
113
|
-
labelledBy: `${
|
|
114
|
-
"aria-describedby":
|
|
115
|
-
expanded: Boolean(
|
|
116
|
-
onTrigger:
|
|
117
|
-
id:
|
|
118
|
-
hasError: Boolean(
|
|
119
|
-
disabled:
|
|
120
|
-
onMouseDown:
|
|
121
|
-
|
|
122
|
-
}), /* @__PURE__ */ r.createElement(ge, {
|
|
144
|
+
id: x,
|
|
145
|
+
action: l
|
|
146
|
+
}, o), /* @__PURE__ */ r.createElement(ve, {
|
|
147
|
+
size: V,
|
|
148
|
+
hasError: Boolean(u),
|
|
149
|
+
disabled: m,
|
|
150
|
+
ref: F
|
|
151
|
+
}, /* @__PURE__ */ r.createElement(me, G({
|
|
152
|
+
ref: D,
|
|
153
|
+
labelledBy: `${x} ${g}`,
|
|
154
|
+
"aria-describedby": te,
|
|
155
|
+
expanded: Boolean(b),
|
|
156
|
+
onTrigger: y,
|
|
157
|
+
id: s,
|
|
158
|
+
hasError: Boolean(u),
|
|
159
|
+
disabled: m,
|
|
160
|
+
onMouseDown: M
|
|
161
|
+
}, ee)), /* @__PURE__ */ r.createElement(Te, {
|
|
123
162
|
justifyContent: "space-between"
|
|
124
|
-
}, /* @__PURE__ */ r.createElement(
|
|
163
|
+
}, /* @__PURE__ */ r.createElement($, null, L && /* @__PURE__ */ r.createElement(J, {
|
|
125
164
|
paddingLeft: 3,
|
|
126
165
|
"aria-hidden": !0
|
|
127
|
-
},
|
|
128
|
-
tags:
|
|
129
|
-
onRemoveTag:
|
|
130
|
-
disabled:
|
|
131
|
-
}), /* @__PURE__ */ r.createElement(
|
|
166
|
+
}, L), E && /* @__PURE__ */ r.createElement(xe, {
|
|
167
|
+
tags: j,
|
|
168
|
+
onRemoveTag: B,
|
|
169
|
+
disabled: m
|
|
170
|
+
}), /* @__PURE__ */ r.createElement(J, {
|
|
132
171
|
paddingLeft: 4,
|
|
133
172
|
paddingRight: 4
|
|
134
|
-
},
|
|
173
|
+
}, E ? /* @__PURE__ */ r.createElement(r.Fragment, null, !n || n.length === 0 ? /* @__PURE__ */ r.createElement(N, {
|
|
135
174
|
ellipsis: !0,
|
|
136
|
-
id:
|
|
175
|
+
id: g,
|
|
137
176
|
textColor: "neutral600"
|
|
138
|
-
},
|
|
177
|
+
}, O) : null, /* @__PURE__ */ r.createElement(K, {
|
|
139
178
|
as: "span",
|
|
140
|
-
id:
|
|
141
|
-
},
|
|
179
|
+
id: g
|
|
180
|
+
}, h ? h(n) : T || O, n.join(", "))) : /* @__PURE__ */ r.createElement(N, {
|
|
142
181
|
ellipsis: !0,
|
|
143
|
-
id:
|
|
144
|
-
textColor:
|
|
145
|
-
},
|
|
182
|
+
id: g,
|
|
183
|
+
textColor: n ? "neutral800" : "neutral600"
|
|
184
|
+
}, h ? h(n) : T || O, p && /* @__PURE__ */ r.createElement(K, {
|
|
146
185
|
as: "span"
|
|
147
|
-
},
|
|
186
|
+
}, n.join(", "))))), /* @__PURE__ */ r.createElement($, null, (p && n && n.length || !p && n) && R && /* @__PURE__ */ r.createElement(Ie, {
|
|
148
187
|
as: "button",
|
|
149
188
|
type: "button",
|
|
150
|
-
onClick:
|
|
151
|
-
"aria-label":
|
|
152
|
-
"aria-disabled":
|
|
153
|
-
}, /* @__PURE__ */ r.createElement(
|
|
189
|
+
onClick: oe,
|
|
190
|
+
"aria-label": X,
|
|
191
|
+
"aria-disabled": m
|
|
192
|
+
}, /* @__PURE__ */ r.createElement(pe, null)), /* @__PURE__ */ r.createElement(Oe, {
|
|
154
193
|
paddingLeft: 3,
|
|
155
194
|
"aria-hidden": !0,
|
|
156
195
|
as: "button",
|
|
157
196
|
type: "button",
|
|
158
|
-
onMouseDown:
|
|
197
|
+
onMouseDown: M,
|
|
159
198
|
tabIndex: -1,
|
|
160
|
-
disabled:
|
|
161
|
-
}, /* @__PURE__ */ r.createElement(
|
|
162
|
-
source:
|
|
199
|
+
disabled: m
|
|
200
|
+
}, /* @__PURE__ */ r.createElement(se, null))))), /* @__PURE__ */ r.createElement(ue, null), /* @__PURE__ */ r.createElement(he, null)), b && /* @__PURE__ */ r.createElement(Ee, {
|
|
201
|
+
source: F,
|
|
163
202
|
spacing: 4,
|
|
164
203
|
fullWidth: !0,
|
|
165
|
-
intersectionId: `select-list-intersection-${
|
|
166
|
-
onReachEnd:
|
|
167
|
-
}, /* @__PURE__ */ r.createElement(
|
|
168
|
-
selectId:
|
|
169
|
-
labelledBy:
|
|
170
|
-
onEscape:
|
|
171
|
-
expanded:
|
|
172
|
-
onSelectItem: (t,
|
|
173
|
-
multi:
|
|
174
|
-
},
|
|
204
|
+
intersectionId: `select-list-intersection-${s}`,
|
|
205
|
+
onReachEnd: Y
|
|
206
|
+
}, /* @__PURE__ */ r.createElement(ge, {
|
|
207
|
+
selectId: s,
|
|
208
|
+
labelledBy: o ? x : void 0,
|
|
209
|
+
onEscape: re,
|
|
210
|
+
expanded: b,
|
|
211
|
+
onSelectItem: (t, c) => c ? k(t) : B(t, !1),
|
|
212
|
+
multi: p
|
|
213
|
+
}, ne)));
|
|
175
214
|
};
|
|
176
|
-
|
|
215
|
+
U.defaultProps = {
|
|
177
216
|
"aria-label": void 0,
|
|
178
217
|
children: [],
|
|
179
218
|
clearLabel: "Clear",
|
|
@@ -196,7 +235,7 @@ q.defaultProps = {
|
|
|
196
235
|
startIcon: void 0,
|
|
197
236
|
withTags: !1
|
|
198
237
|
};
|
|
199
|
-
|
|
238
|
+
U.propTypes = {
|
|
200
239
|
"aria-label": e.string,
|
|
201
240
|
children: e.oneOfType([e.arrayOf(e.node), e.node]),
|
|
202
241
|
clearLabel: e.string,
|
|
@@ -213,7 +252,7 @@ q.propTypes = {
|
|
|
213
252
|
onReachEnd: e.func,
|
|
214
253
|
placeholder: e.string,
|
|
215
254
|
required: e.bool,
|
|
216
|
-
size: e.oneOf(Object.keys(
|
|
255
|
+
size: e.oneOf(Object.keys(ce.input)),
|
|
217
256
|
startIcon: e.element,
|
|
218
257
|
value: e.oneOfType([
|
|
219
258
|
e.arrayOf(e.oneOfType([e.string, e.number])),
|
|
@@ -223,5 +262,5 @@ q.propTypes = {
|
|
|
223
262
|
withTags: e.bool
|
|
224
263
|
};
|
|
225
264
|
export {
|
|
226
|
-
|
|
265
|
+
U as Select
|
|
227
266
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";var k=Object.defineProperty;var s=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var i=(e,a,t)=>a in e?k(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,b=(e,a)=>{for(var t in a||(a={}))y.call(a,t)&&i(e,t,a[t]);if(s)for(var t of s(a))p.call(a,t)&&i(e,t,a[t]);return e};var f=(e,a)=>{var t={};for(var o in e)y.call(e,o)&&a.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&s)for(var o of s(e))a.indexOf(o)<0&&p.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("react"),q=require("prop-types"),D=require("styled-components"),r=require("../helpers/keyboardKeys.cjs"),K=require("./constants.cjs"),u=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},g=u(h),n=u(q),m=u(D),P=m.default.button`
|
|
2
2
|
position: absolute;
|
|
3
3
|
left: 0;
|
|
4
4
|
right: 0;
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
&[aria-disabled='true'] {
|
|
17
17
|
cursor: not-allowed;
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
19
|
+
`,d=h.forwardRef((R,_)=>{var c=R,{labelledBy:e,expanded:a,onTrigger:t,disabled:o}=c,S=f(c,["labelledBy","expanded","onTrigger","disabled"]);const w=l=>{if(!o)switch(l.key){case r.KeyboardKeys.DOWN:case r.KeyboardKeys.SPACE:case r.KeyboardKeys.ENTER:{l.preventDefault(),t(K.DownState.Keyboard);break}case r.KeyboardKeys.UP:{l.preventDefault(),t(K.UpState.Keyboard);break}}};return g.default.createElement(P,b({ref:_,"aria-labelledby":e,"aria-haspopup":"listbox","aria-expanded":a,onKeyDown:w,"aria-disabled":o,type:"button"},S))});d.displayName="SelectButton";d.defaultProps={expanded:!1,disabled:!1};d.propTypes={disabled:n.default.bool,expanded:n.default.bool,labelledBy:n.default.string.isRequired,onTrigger:n.default.func.isRequired};exports.SelectButton=d;
|
|
@@ -1,9 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
|
+
var r = Object.getOwnPropertySymbols;
|
|
3
|
+
var u = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var p = (e, o, t) => o in e ? w(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, c = (e, o) => {
|
|
5
|
+
for (var t in o || (o = {}))
|
|
6
|
+
u.call(o, t) && p(e, t, o[t]);
|
|
7
|
+
if (r)
|
|
8
|
+
for (var t of r(o))
|
|
9
|
+
b.call(o, t) && p(e, t, o[t]);
|
|
10
|
+
return e;
|
|
11
|
+
};
|
|
12
|
+
var f = (e, o) => {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var a in e)
|
|
15
|
+
u.call(e, a) && o.indexOf(a) < 0 && (t[a] = e[a]);
|
|
16
|
+
if (e != null && r)
|
|
17
|
+
for (var a of r(e))
|
|
18
|
+
o.indexOf(a) < 0 && b.call(e, a) && (t[a] = e[a]);
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
import S, { forwardRef as D } from "react";
|
|
22
|
+
import n from "prop-types";
|
|
23
|
+
import K from "styled-components";
|
|
24
|
+
import { KeyboardKeys as s } from "../helpers/keyboardKeys.js";
|
|
25
|
+
import { UpState as k, DownState as x } from "./constants.js";
|
|
26
|
+
const R = K.button`
|
|
7
27
|
position: absolute;
|
|
8
28
|
left: 0;
|
|
9
29
|
right: 0;
|
|
@@ -21,44 +41,44 @@ const m = c.button`
|
|
|
21
41
|
&[aria-disabled='true'] {
|
|
22
42
|
cursor: not-allowed;
|
|
23
43
|
}
|
|
24
|
-
`,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
case
|
|
30
|
-
case
|
|
31
|
-
|
|
44
|
+
`, l = D((B, m) => {
|
|
45
|
+
var i = B, { labelledBy: e, expanded: o, onTrigger: t, disabled: a } = i, y = f(i, ["labelledBy", "expanded", "onTrigger", "disabled"]);
|
|
46
|
+
const h = (d) => {
|
|
47
|
+
if (!a)
|
|
48
|
+
switch (d.key) {
|
|
49
|
+
case s.DOWN:
|
|
50
|
+
case s.SPACE:
|
|
51
|
+
case s.ENTER: {
|
|
52
|
+
d.preventDefault(), t(x.Keyboard);
|
|
32
53
|
break;
|
|
33
54
|
}
|
|
34
|
-
case
|
|
35
|
-
|
|
55
|
+
case s.UP: {
|
|
56
|
+
d.preventDefault(), t(k.Keyboard);
|
|
36
57
|
break;
|
|
37
58
|
}
|
|
38
59
|
}
|
|
39
60
|
};
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
ref:
|
|
42
|
-
"aria-labelledby":
|
|
61
|
+
return /* @__PURE__ */ S.createElement(R, c({
|
|
62
|
+
ref: m,
|
|
63
|
+
"aria-labelledby": e,
|
|
43
64
|
"aria-haspopup": "listbox",
|
|
44
|
-
"aria-expanded":
|
|
45
|
-
onKeyDown:
|
|
46
|
-
"aria-disabled":
|
|
47
|
-
type: "button"
|
|
48
|
-
|
|
49
|
-
});
|
|
65
|
+
"aria-expanded": o,
|
|
66
|
+
onKeyDown: h,
|
|
67
|
+
"aria-disabled": a,
|
|
68
|
+
type: "button"
|
|
69
|
+
}, y));
|
|
50
70
|
});
|
|
51
|
-
|
|
52
|
-
|
|
71
|
+
l.displayName = "SelectButton";
|
|
72
|
+
l.defaultProps = {
|
|
53
73
|
expanded: !1,
|
|
54
74
|
disabled: !1
|
|
55
75
|
};
|
|
56
|
-
|
|
57
|
-
disabled:
|
|
58
|
-
expanded:
|
|
59
|
-
labelledBy:
|
|
60
|
-
onTrigger:
|
|
76
|
+
l.propTypes = {
|
|
77
|
+
disabled: n.bool,
|
|
78
|
+
expanded: n.bool,
|
|
79
|
+
labelledBy: n.string.isRequired,
|
|
80
|
+
onTrigger: n.func.isRequired
|
|
61
81
|
};
|
|
62
82
|
export {
|
|
63
|
-
|
|
83
|
+
l as SelectButton
|
|
64
84
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";var G=Object.defineProperty;var T=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var w=(e,r,t)=>r in e?G(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,E=(e,r)=>{for(var t in r||(r={}))M.call(r,t)&&w(e,t,r[t]);if(T)for(var t of T(r))O.call(r,t)&&w(e,t,r[t]);return e};var k=(e,r)=>{var t={};for(var u in e)M.call(e,u)&&r.indexOf(u)<0&&(t[u]=e[u]);if(e!=null&&T)for(var u of T(e))r.indexOf(u)<0&&O.call(e,u)&&(t[u]=e[u]);return t};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),H=require("prop-types"),J=require("styled-components"),Q=require("@strapi/icons/CarretDown"),X=require("react-router-dom"),_=require("../Typography/Typography.cjs"),q=require("../Box/Box.cjs"),Y=require("../Flex/Flex.cjs"),j=require("../Button/Button.cjs"),F=require("../Popover/Popover.cjs"),A=require("./utils.cjs"),Z=require("../helpers/useId.cjs"),c=require("../helpers/keyboardKeys.cjs"),x=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},a=x(l),o=x(H),D=x(J),ee=x(Q),te=D.default.button`
|
|
2
2
|
border: none;
|
|
3
3
|
padding: 0;
|
|
4
4
|
background: transparent;
|
|
5
5
|
cursor: pointer;
|
|
6
|
-
${
|
|
7
|
-
`,
|
|
6
|
+
${A.getOptionStyle}
|
|
7
|
+
`,ne=D.default(X.NavLink)`
|
|
8
8
|
text-decoration: none;
|
|
9
|
-
${
|
|
10
|
-
`,
|
|
9
|
+
${A.getOptionStyle}
|
|
10
|
+
`,oe=D.default.span`
|
|
11
11
|
display: flex;
|
|
12
12
|
align-items: center;
|
|
13
13
|
svg {
|
|
14
14
|
height: 4px;
|
|
15
15
|
width: 6px;
|
|
16
16
|
}
|
|
17
|
-
`,
|
|
17
|
+
`,re=D.default(j.Button)`
|
|
18
18
|
padding: ${({theme:e})=>`${e.spaces[1]} ${e.spaces[3]}`};
|
|
19
|
-
`,
|
|
19
|
+
`,v=B=>{var K=B,{children:e,onClick:r,to:t,isFocused:u}=K,h=k(K,["children","onClick","to","isFocused"]);const d=l.useRef();l.useEffect(()=>{u&&d.current&&d.current.focus()},[u]);const P=E({tabIndex:u?0:-1,ref:d,role:"menuitem"},h),C=f=>{(f.key===c.KeyboardKeys.SPACE||f.key===c.KeyboardKeys.ENTER)&&r()};return t?a.default.createElement(ne,E({to:t},P),a.default.createElement(q.Box,{padding:2},a.default.createElement(_.Typography,null,e))):a.default.createElement(te,E({onKeyDown:C,onMouseDown:r,type:"button"},P),a.default.createElement(q.Box,{padding:2},a.default.createElement(_.Typography,null,e)))};v.defaultProps={onClick:()=>{},isFocused:!1,to:void 0};v.propTypes={as:o.default.elementType,children:o.default.node.isRequired,isFocused:o.default.bool,onClick:o.default.func,to:o.default.string};const g=C=>{var f=C,{label:e,children:r,id:t,as:u,onOpen:h=()=>{},onClose:B=()=>{},size:K,popoverPlacement:d}=f,P=k(f,["label","children","id","as","onOpen","onClose","size","popoverPlacement"]);const i=l.useRef(),R=Z.useId("simplemenu",t),p=l.useRef(!1),[y,m]=l.useState(!1),[I,S]=l.useState(0),b=l.Children.toArray(r),N=K==="S"?re:j.Button,$=u||N;l.useEffect(()=>{if(["string","number"].includes(typeof e)){const n=b.findIndex(s=>s.props.children===e);n!==-1&&S(n)}},[e]),l.useEffect(()=>{p!=null&&p.current?y&&typeof h=="function"?h():typeof B=="function"&&B():p.current=!0},[p,y]),l.useEffect(()=>{a.default.isValidElement(e)&&I==-1&&i.current.focus()},[e,I]);const L=n=>{y&&(n.key===c.KeyboardKeys.ESCAPE&&(n.stopPropagation(),m(!1),i.current.focus()),n.key===c.KeyboardKeys.DOWN&&S(s=>s===b.length-1?0:s+1),n.key===c.KeyboardKeys.UP&&S(s=>s===0?b.length-1:s-1))},V=n=>{(n.key===c.KeyboardKeys.ENTER||n.key===c.KeyboardKeys.SPACE)&&m(s=>!s)},W=n=>{n.preventDefault(),n.currentTarget.contains(n.relatedTarget)||m(!1)},z=n=>{n.preventDefault(),m(s=>!s)},U=b.map((n,s)=>a.default.createElement(Y.Flex,{as:"li",key:s,justifyContent:"center",role:"menuitem"},l.cloneElement(n,{onClick:()=>{n.props.onClick(),m(!1),i.current.focus()},isFocused:I===s})));return a.default.createElement("div",{onKeyDown:L},a.default.createElement($,E({label:a.default.isValidElement(e)?null:e,"aria-haspopup":!0,"aria-expanded":y,"aria-controls":R,onKeyDown:V,onMouseDown:z,ref:i,type:"button",variant:"ghost",endIcon:a.default.createElement(oe,null,a.default.createElement(ee.default,{"aria-hidden":!0}))},P),e),y&&a.default.createElement(F.Popover,{onBlur:W,placement:d,source:i,spacing:4},a.default.createElement(q.Box,{role:"menu",as:"ul",padding:1,id:R},U)))};g.defaultProps={as:void 0};g.displayName="SimpleMenu";g.defaultProps={popoverPlacement:"bottom-start",size:"M"};g.propTypes={as:o.default.any,children:o.default.oneOfType([o.default.arrayOf(o.default.node),o.default.node]).isRequired,id:o.default.string,label:o.default.oneOfType([o.default.string,o.default.number,o.default.element]).isRequired,onClose:o.default.func,onOpen:o.default.func,popoverPlacement:o.default.oneOf(F.POPOVER_PLACEMENTS),size:o.default.oneOf(["S","M"])};exports.MenuItem=v;exports.SimpleMenu=g;
|