@strapi/design-system 1.6.1 → 1.6.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/dist/Accordion/Accordion.cjs +5 -5
- package/dist/Accordion/Accordion.js +24 -22
- package/dist/Avatar/Avatar.cjs +5 -16
- package/dist/Avatar/Avatar.js +44 -48
- package/dist/BaseRadio/BaseRadio.cjs +2 -2
- package/dist/BaseRadio/BaseRadio.js +25 -23
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +1 -1
- package/dist/Card/CardHeader.cjs +1 -2
- package/dist/Card/CardHeader.js +1 -1
- package/dist/Card/CardTimer.cjs +1 -5
- package/dist/Card/CardTimer.js +14 -20
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +9 -9
- package/dist/Checkbox/Checkbox.cjs +2 -2
- package/dist/Checkbox/Checkbox.js +16 -16
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +139 -139
- package/dist/Combobox/ComboboxList.cjs +1 -1
- package/dist/Combobox/ComboboxList.js +5 -12
- package/dist/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +71 -71
- package/dist/Dialog/Dialog.cjs +4 -7
- package/dist/Dialog/Dialog.js +30 -29
- package/dist/Field/Field.cjs +1 -1
- package/dist/Field/Field.js +6 -6
- package/dist/Field/FieldHint.cjs +1 -1
- package/dist/Field/FieldHint.js +4 -4
- package/dist/JSONInput/JSONInput.cjs +1 -1
- package/dist/JSONInput/JSONInput.js +45 -42
- package/dist/JSONInput/JSONInputContainer.cjs +5 -2
- package/dist/JSONInput/JSONInputContainer.js +6 -3
- package/dist/Layout/HeaderLayout.cjs +3 -8
- package/dist/Layout/HeaderLayout.js +38 -38
- package/dist/Main/SkipToContent.cjs +1 -2
- package/dist/Main/SkipToContent.js +1 -1
- package/dist/MainNav/MainNav.cjs +1 -6
- package/dist/MainNav/MainNav.js +15 -15
- package/dist/MainNav/NavFooter.cjs +1 -3
- package/dist/MainNav/NavFooter.js +3 -4
- package/dist/ModalLayout/ModalLayout.cjs +3 -9
- package/dist/ModalLayout/ModalLayout.js +24 -23
- package/dist/NumberInput/NumberInput.cjs +1 -1
- package/dist/NumberInput/NumberInput.js +18 -18
- package/dist/Select/Option.cjs +3 -7
- package/dist/Select/Option.js +6 -6
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +57 -57
- package/dist/Select/SelectTags.cjs +1 -3
- package/dist/Select/SelectTags.js +4 -4
- package/dist/Select/SingleSelect.cjs +82 -0
- package/dist/Select/SingleSelect.js +285 -0
- package/dist/SimpleMenu/SimpleMenu.cjs +1 -1
- package/dist/SimpleMenu/SimpleMenu.js +10 -10
- package/dist/Stack/Stack.cjs +5 -5
- package/dist/Stack/Stack.js +7 -6
- package/dist/SubNav/SubNavHeader.cjs +1 -1
- package/dist/SubNav/SubNavHeader.js +15 -15
- package/dist/SubNav/SubNavLinkSection.cjs +2 -2
- package/dist/SubNav/SubNavLinkSection.js +6 -6
- package/dist/SubNav/SubNavSection.cjs +1 -1
- package/dist/SubNav/SubNavSection.js +12 -12
- package/dist/Table/Table.cjs +1 -3
- package/dist/Table/Table.js +2 -3
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +11 -11
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +18 -18
- package/dist/Textarea/Textarea.cjs +1 -1
- package/dist/Textarea/Textarea.js +1 -1
- package/dist/TimePicker/TimePicker.cjs +2 -2
- package/dist/TimePicker/TimePicker.js +1 -1
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +6 -6
- package/dist/ToggleCheckbox/ToggleCheckbox.js +45 -43
- package/dist/ToggleInput/ToggleInput.cjs +1 -1
- package/dist/ToggleInput/ToggleInput.js +10 -10
- package/dist/Tooltip/Tooltip.cjs +2 -3
- package/dist/Tooltip/Tooltip.js +18 -18
- package/dist/helpers/deprecations.cjs +1 -0
- package/dist/helpers/deprecations.js +13 -0
- package/dist/helpers/useId.cjs +1 -1
- package/dist/helpers/useId.js +11 -4
- package/dist/hooks/useIntersection.cjs +1 -0
- package/dist/hooks/useIntersection.js +23 -0
- package/dist/v2/MainNav/MainNav.cjs +1 -6
- package/dist/v2/MainNav/MainNav.js +15 -15
- package/dist/v2/MainNav/NavFooter.cjs +1 -3
- package/dist/v2/MainNav/NavFooter.js +3 -4
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +1 -1
- package/dist/v2/SimpleMenu/SimpleMenu.js +12 -12
- package/dist/v2/SubNav/SubNavHeader.cjs +1 -1
- package/dist/v2/SubNav/SubNavHeader.js +15 -15
- package/dist/v2/SubNav/SubNavLinkSection.cjs +4 -4
- package/dist/v2/SubNav/SubNavLinkSection.js +8 -8
- package/dist/v2/SubNav/SubNavSection.cjs +1 -1
- package/dist/v2/SubNav/SubNavSection.js +4 -4
- package/package.json +3 -4
- package/dist/helpers/genId.cjs +0 -1
- package/dist/helpers/genId.js +0 -5
package/dist/Select/Select.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import r, { useState as ee, useRef as te, Children as
|
|
1
|
+
import r, { useState as ee, useRef as te, Children as k, cloneElement as j } from "react";
|
|
2
2
|
import e from "prop-types";
|
|
3
3
|
import re from "styled-components";
|
|
4
4
|
import { Cross as oe, CarretDown as ne } from "@strapi/icons";
|
|
@@ -13,96 +13,96 @@ import "../Field/FieldContext.js";
|
|
|
13
13
|
import "../Field/FieldAction.js";
|
|
14
14
|
import { Popover as me } from "../Popover/Popover.js";
|
|
15
15
|
import { Stack as de } from "../Stack/Stack.js";
|
|
16
|
-
import { Typography as
|
|
16
|
+
import { Typography as A } from "../Typography/Typography.js";
|
|
17
17
|
import { Flex as C } from "../Flex/Flex.js";
|
|
18
|
-
import { Box as
|
|
18
|
+
import { Box as P } from "../Box/Box.js";
|
|
19
19
|
import { useId as fe } from "../helpers/useId.js";
|
|
20
20
|
import { SelectList as ue } from "./SelectList.js";
|
|
21
21
|
import { SelectButtonWrapper as he, IconBox as Ee, CaretBox as be } from "./components.js";
|
|
22
22
|
import { useButtonRef as ye } from "./hooks/useButtonRef.js";
|
|
23
|
-
import { VisuallyHidden as
|
|
23
|
+
import { VisuallyHidden as _ } from "../VisuallyHidden/VisuallyHidden.js";
|
|
24
24
|
import { DownState as ge } from "./constants.js";
|
|
25
|
-
import { escapeSelector as
|
|
25
|
+
import { escapeSelector as q } from "../helpers/escapeSelector.js";
|
|
26
26
|
import { SelectTags as ve } from "./SelectTags.js";
|
|
27
27
|
const Be = re(C)`
|
|
28
28
|
width: 100%;
|
|
29
|
-
`,
|
|
30
|
-
label:
|
|
31
|
-
labelAction:
|
|
32
|
-
id:
|
|
33
|
-
children:
|
|
34
|
-
customizeContent:
|
|
29
|
+
`, z = ({
|
|
30
|
+
label: d,
|
|
31
|
+
labelAction: G,
|
|
32
|
+
id: H,
|
|
33
|
+
children: W,
|
|
34
|
+
customizeContent: f,
|
|
35
35
|
placeholder: y,
|
|
36
36
|
onChange: g,
|
|
37
37
|
value: o,
|
|
38
38
|
hint: v,
|
|
39
|
-
error:
|
|
39
|
+
error: m,
|
|
40
40
|
disabled: s,
|
|
41
41
|
clearLabel: I,
|
|
42
42
|
onClear: S,
|
|
43
|
-
onReachEnd:
|
|
43
|
+
onReachEnd: N,
|
|
44
44
|
multi: i,
|
|
45
|
-
required:
|
|
46
|
-
selectButtonTitle:
|
|
47
|
-
size:
|
|
45
|
+
required: J,
|
|
46
|
+
selectButtonTitle: K,
|
|
47
|
+
size: Q,
|
|
48
48
|
startIcon: x,
|
|
49
49
|
withTags: u,
|
|
50
|
-
...
|
|
50
|
+
...U
|
|
51
51
|
}) => {
|
|
52
|
-
const n = fe(
|
|
52
|
+
const n = fe(H), [h, E] = ee(void 0), $ = ye(h), R = te(null), w = `${n}-label`, b = `${n}-content`, X = typeof m == "string";
|
|
53
53
|
let B;
|
|
54
|
-
if (
|
|
54
|
+
if (m ? B = `${n}-error` : v && (B = `${n}-hint`), u && !i)
|
|
55
55
|
throw new Error('The "withTags" props can only be used when the "multi" prop is present');
|
|
56
56
|
const Y = () => {
|
|
57
57
|
E(void 0);
|
|
58
58
|
}, Z = () => {
|
|
59
59
|
s || (S(), $.current.focus());
|
|
60
|
-
},
|
|
60
|
+
}, D = (t) => {
|
|
61
61
|
t.preventDefault(), !s && (t.nativeEvent.which === 3 || t.nativeEvent.button === 2 || E(ge.Mouse));
|
|
62
62
|
}, O = (t, l = !0) => {
|
|
63
63
|
i ? g(o.includes(t) ? o.filter((a) => a !== t) : [...o, t]) : (g(t), l && E(void 0));
|
|
64
|
-
},
|
|
64
|
+
}, L = (t) => {
|
|
65
65
|
g(
|
|
66
66
|
o.includes(t[0]) ? o.filter((l, a, c) => c.indexOf(l) < 0, t) : [...o, ...t]
|
|
67
67
|
);
|
|
68
68
|
};
|
|
69
|
-
let T,
|
|
70
|
-
const
|
|
69
|
+
let T, F = [];
|
|
70
|
+
const M = (t, l) => {
|
|
71
71
|
const a = `${n}-option-${t.props.value}`, c = i ? o.includes(t.props.value) : t.props.value === o;
|
|
72
|
-
return c && (u ?
|
|
73
|
-
id:
|
|
72
|
+
return c && (u ? F.push({ label: t.props.children, value: t.props.value }) : T = t.props.children), j(t, {
|
|
73
|
+
id: q(a),
|
|
74
74
|
onClick: () => O(t.props.value),
|
|
75
75
|
selected: c,
|
|
76
76
|
multi: i,
|
|
77
77
|
isChild: l
|
|
78
78
|
});
|
|
79
|
-
}, V =
|
|
79
|
+
}, V = k.toArray(W).map((t) => {
|
|
80
80
|
if (t.type.displayName === "OptGroup") {
|
|
81
81
|
const l = `${n}-option-${t.props.label}`, a = t.props.children.every((p) => o.includes(p.props.value)), c = !a && t.props.children.some((p) => o.includes(p.props.value));
|
|
82
|
-
return
|
|
83
|
-
id:
|
|
84
|
-
onClick: () =>
|
|
82
|
+
return j(t, {
|
|
83
|
+
id: q(l),
|
|
84
|
+
onClick: () => L(t.props.children.map((p) => p.props.value)),
|
|
85
85
|
selected: a,
|
|
86
86
|
indeterminate: c,
|
|
87
87
|
multi: i,
|
|
88
|
-
children:
|
|
88
|
+
children: k.toArray(t.props.children).map((p) => M(p, !0)),
|
|
89
89
|
value: t.props.label
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
return
|
|
92
|
+
return M(t);
|
|
93
93
|
});
|
|
94
94
|
return /* @__PURE__ */ r.createElement(se, {
|
|
95
95
|
hint: v,
|
|
96
|
-
error:
|
|
96
|
+
error: m,
|
|
97
97
|
id: n,
|
|
98
|
-
required:
|
|
98
|
+
required: J
|
|
99
99
|
}, /* @__PURE__ */ r.createElement(de, {
|
|
100
|
-
spacing:
|
|
101
|
-
},
|
|
102
|
-
action:
|
|
103
|
-
},
|
|
104
|
-
size:
|
|
105
|
-
hasError: Boolean(
|
|
100
|
+
spacing: d || v || X ? 1 : 0
|
|
101
|
+
}, d && /* @__PURE__ */ r.createElement(ae, {
|
|
102
|
+
action: G
|
|
103
|
+
}, d), /* @__PURE__ */ r.createElement(he, {
|
|
104
|
+
size: Q,
|
|
105
|
+
hasError: Boolean(m),
|
|
106
106
|
disabled: s,
|
|
107
107
|
ref: R
|
|
108
108
|
}, /* @__PURE__ */ r.createElement(le, {
|
|
@@ -112,34 +112,34 @@ const Be = re(C)`
|
|
|
112
112
|
expanded: Boolean(h),
|
|
113
113
|
onTrigger: E,
|
|
114
114
|
id: n,
|
|
115
|
-
hasError: Boolean(
|
|
115
|
+
hasError: Boolean(m),
|
|
116
116
|
disabled: s,
|
|
117
|
-
onMouseDown:
|
|
118
|
-
...
|
|
117
|
+
onMouseDown: D,
|
|
118
|
+
...U
|
|
119
119
|
}), /* @__PURE__ */ r.createElement(Be, {
|
|
120
120
|
justifyContent: "space-between"
|
|
121
|
-
}, /* @__PURE__ */ r.createElement(C, null, x && /* @__PURE__ */ r.createElement(
|
|
121
|
+
}, /* @__PURE__ */ r.createElement(C, null, x && /* @__PURE__ */ r.createElement(P, {
|
|
122
122
|
paddingLeft: 3,
|
|
123
123
|
"aria-hidden": !0
|
|
124
124
|
}, x), u && /* @__PURE__ */ r.createElement(ve, {
|
|
125
|
-
tags:
|
|
125
|
+
tags: F,
|
|
126
126
|
onRemoveTag: O,
|
|
127
127
|
disabled: s
|
|
128
|
-
}), /* @__PURE__ */ r.createElement(
|
|
128
|
+
}), /* @__PURE__ */ r.createElement(P, {
|
|
129
129
|
paddingLeft: 4,
|
|
130
130
|
paddingRight: 4
|
|
131
|
-
}, u ? /* @__PURE__ */ r.createElement(r.Fragment, null, !o || o.length === 0 ? /* @__PURE__ */ r.createElement(
|
|
131
|
+
}, u ? /* @__PURE__ */ r.createElement(r.Fragment, null, !o || o.length === 0 ? /* @__PURE__ */ r.createElement(A, {
|
|
132
132
|
ellipsis: !0,
|
|
133
133
|
id: b,
|
|
134
134
|
textColor: "neutral600"
|
|
135
|
-
}, y) : null, /* @__PURE__ */ r.createElement(
|
|
135
|
+
}, y) : null, /* @__PURE__ */ r.createElement(_, {
|
|
136
136
|
as: "span",
|
|
137
137
|
id: b
|
|
138
|
-
},
|
|
138
|
+
}, f ? f(o) : T || y, o.join(", "))) : /* @__PURE__ */ r.createElement(A, {
|
|
139
139
|
ellipsis: !0,
|
|
140
140
|
id: b,
|
|
141
141
|
textColor: o ? "neutral800" : "neutral600"
|
|
142
|
-
},
|
|
142
|
+
}, f ? f(o) : T || y, i && /* @__PURE__ */ r.createElement(_, {
|
|
143
143
|
as: "span"
|
|
144
144
|
}, o.join(", "))))), /* @__PURE__ */ r.createElement(C, null, (i && o && o.length || !i && o) && S && /* @__PURE__ */ r.createElement(Ee, {
|
|
145
145
|
as: "button",
|
|
@@ -153,26 +153,26 @@ const Be = re(C)`
|
|
|
153
153
|
"aria-hidden": !0,
|
|
154
154
|
as: "button",
|
|
155
155
|
type: "button",
|
|
156
|
-
onMouseDown:
|
|
156
|
+
onMouseDown: D,
|
|
157
157
|
tabIndex: -1,
|
|
158
158
|
disabled: s,
|
|
159
|
-
title:
|
|
159
|
+
title: K
|
|
160
160
|
}, /* @__PURE__ */ r.createElement(ne, null))))), /* @__PURE__ */ r.createElement(pe, null), /* @__PURE__ */ r.createElement(ce, null)), h && /* @__PURE__ */ r.createElement(me, {
|
|
161
161
|
source: R,
|
|
162
162
|
spacing: 4,
|
|
163
163
|
fullWidth: !0,
|
|
164
164
|
intersectionId: `select-list-intersection-${n}`,
|
|
165
|
-
onReachEnd:
|
|
165
|
+
onReachEnd: N
|
|
166
166
|
}, /* @__PURE__ */ r.createElement(ue, {
|
|
167
167
|
selectId: n,
|
|
168
|
-
labelledBy:
|
|
168
|
+
labelledBy: d ? w : void 0,
|
|
169
169
|
onEscape: Y,
|
|
170
170
|
expanded: h,
|
|
171
|
-
onSelectItem: (t, l) => l ?
|
|
171
|
+
onSelectItem: (t, l) => l ? L(t) : O(t, !1),
|
|
172
172
|
multi: i
|
|
173
173
|
}, V)));
|
|
174
174
|
};
|
|
175
|
-
|
|
175
|
+
z.defaultProps = {
|
|
176
176
|
"aria-label": void 0,
|
|
177
177
|
children: [],
|
|
178
178
|
clearLabel: "Clear",
|
|
@@ -196,7 +196,7 @@ G.defaultProps = {
|
|
|
196
196
|
startIcon: void 0,
|
|
197
197
|
withTags: !1
|
|
198
198
|
};
|
|
199
|
-
|
|
199
|
+
z.propTypes = {
|
|
200
200
|
"aria-label": e.string,
|
|
201
201
|
children: e.oneOfType([e.arrayOf(e.node), e.node]),
|
|
202
202
|
clearLabel: e.string,
|
|
@@ -224,5 +224,5 @@ G.propTypes = {
|
|
|
224
224
|
withTags: e.bool
|
|
225
225
|
};
|
|
226
226
|
export {
|
|
227
|
-
|
|
227
|
+
z as Select
|
|
228
228
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react"),d=require("prop-types"),i=require("styled-components"),f=require("@strapi/icons"),p=require("../Tag/Tag.cjs"),g=require("../Flex/Flex.cjs"),s=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},a=s(c),t=s(d),o=s(i),T=o.default.div`
|
|
2
2
|
margin-bottom: ${({theme:e})=>e.spaces[1]};
|
|
3
3
|
`,m=o.default(p.Tag)`
|
|
4
|
-
position: relative;
|
|
5
|
-
z-index: 1;
|
|
6
4
|
margin-left: ${({theme:e})=>e.spaces[1]};
|
|
7
5
|
margin-top: ${({theme:e})=>e.spaces[1]};
|
|
8
|
-
`,r=({tags:e,onRemoveTag:n,disabled:u})=>a.default.createElement(T,null,a.default.createElement(g.Flex,{wrap:"wrap"},e.map(l=>a.default.createElement(m,{icon:a.default.createElement(f.Cross,null),
|
|
6
|
+
`,r=({tags:e,onRemoveTag:n,disabled:u})=>a.default.createElement(T,null,a.default.createElement(g.Flex,{wrap:"wrap"},e.map(l=>a.default.createElement(m,{disabled:u,key:`tag-${l.value}`,icon:a.default.createElement(f.Cross,null),onClick:()=>n(l.value),position:"relative",tabIndex:-1,zIndex:1},l.label))));r.defaultProps={disabled:!1,tags:[]};r.propTypes={disabled:t.default.bool,onRemoveTag:t.default.func.isRequired,tags:t.default.arrayOf(t.default.shape({label:t.default.string,value:t.default.oneOfType([t.default.string,t.default.number])}))};exports.SelectTags=r;
|
|
@@ -7,18 +7,18 @@ import { Flex as i } from "../Flex/Flex.js";
|
|
|
7
7
|
const c = o.div`
|
|
8
8
|
margin-bottom: ${({ theme: r }) => r.spaces[1]};
|
|
9
9
|
`, f = o(m)`
|
|
10
|
-
position: relative;
|
|
11
|
-
z-index: 1;
|
|
12
10
|
margin-left: ${({ theme: r }) => r.spaces[1]};
|
|
13
11
|
margin-top: ${({ theme: r }) => r.spaces[1]};
|
|
14
12
|
`, l = ({ tags: r, onRemoveTag: s, disabled: p }) => /* @__PURE__ */ a.createElement(c, null, /* @__PURE__ */ a.createElement(i, {
|
|
15
13
|
wrap: "wrap"
|
|
16
14
|
}, r.map((t) => /* @__PURE__ */ a.createElement(f, {
|
|
17
|
-
icon: /* @__PURE__ */ a.createElement(n, null),
|
|
18
15
|
disabled: p,
|
|
16
|
+
key: `tag-${t.value}`,
|
|
17
|
+
icon: /* @__PURE__ */ a.createElement(n, null),
|
|
19
18
|
onClick: () => s(t.value),
|
|
19
|
+
position: "relative",
|
|
20
20
|
tabIndex: -1,
|
|
21
|
-
|
|
21
|
+
zIndex: 1
|
|
22
22
|
}, t.label))));
|
|
23
23
|
l.defaultProps = {
|
|
24
24
|
disabled: !1,
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),W=require("react"),U=require("@radix-ui/react-select"),w=require("@strapi/icons"),Y=require("styled-components"),G=require("../Field/Field.cjs"),J=require("../Field/FieldLabel.cjs");require("../Field/FieldInput.cjs");const Q=require("../Field/FieldHint.cjs"),X=require("../Field/FieldError.cjs");require("../Field/FieldContext.cjs");require("../Field/FieldAction.cjs");const Z=require("../Stack/Stack.cjs"),g=require("../Box/Box.cjs"),q=require("../Flex/Flex.cjs"),j=require("../Typography/Typography.cjs"),ee=require("../helpers/useId.cjs"),te=require("../hooks/useIntersection.cjs"),I=require("../themes/utils.cjs"),re=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function v(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,i.get?i:{enumerable:!0,get:()=>e[s]})}}return n.default=e,Object.freeze(n)}const h=v(W),o=v(U),c=re(Y),ne=[" ","Enter","ArrowUp","ArrowDown"],oe=({children:e,clearLabel:n="Clear",customizeContent:s=p=>p.toString(),disabled:i,error:b,hint:k,id:R,label:T,labelAction:O,onChange:$,onClear:a,onReachEnd:m,placeholder:_,required:y,selectButtonTitle:he,startIcon:S,size:B="M",value:f})=>{const p=h.useRef(null),x=h.useRef(null),d=h.useRef(null),[D,C]=h.useState(""),[E,P]=h.useState(!1),u=ee.useId(R),V=`${u}-hint`,M=`${u}-error`,N=r=>{$?$(typeof f=="number"?Number(r):r):C(r)},z=r=>{a&&!i&&(a(r),x.current.focus())},A=r=>{P(r)},H=r=>{d.current&&d.current===r.target.closest("div")&&r.preventDefault()},K=r=>{ne.includes(r.key)&&d.current&&d.current===r.target.closest("div")&&!i&&a&&(r.preventDefault(),a(r),x.current.focus())},F=`intersection-${u}`,L=r=>{m&&m(r)};te.useIntersection(p,L,{selectorToWatch:`#${F}`,skipWhen:!E});const l=typeof f<"u"?f.toString():D;return t.jsx(G.Field,{hint:k,error:b,id:u,required:y,children:t.jsxs(Z.Stack,{spacing:1,children:[t.jsx(J.FieldLabel,{action:O,children:T}),t.jsxs(o.Root,{onOpenChange:A,disabled:i,required:y,onValueChange:N,value:l,children:[t.jsxs(ie,{id:u,"aria-labelledby":`${V} ${M}`,"aria-disabled":i,$hasError:Boolean(b),$size:B,onPointerDown:H,onKeyDown:K,ref:x,children:[t.jsxs(q.Flex,{as:"span",gap:4,children:[S&&t.jsx(g.Box,{as:"span","aria-hidden":!0,children:S}),t.jsx(j.Typography,{ellipsis:!0,textColor:l?"neutral800":"neutral600",children:t.jsx(o.Value,{"aria-label":l,children:l?s(l):_})})]}),t.jsxs(q.Flex,{as:"span",gap:3,children:[l&&a?t.jsx(se,{hasRadius:!0,background:"transparent",role:"button",tabIndex:0,onClick:z,"aria-disabled":i,"aria-label":n,title:n,ref:d,children:t.jsx(w.Cross,{})}):null,t.jsx(le,{children:t.jsx(w.CarretDown,{})})]})]}),t.jsx(o.Portal,{children:t.jsx(ce,{position:"popper",sideOffset:4,children:t.jsxs(ae,{ref:p,children:[e,t.jsx(g.Box,{id:F,width:"100%",height:"1px"})]})})})]}),t.jsx(Q.FieldHint,{}),t.jsx(X.FieldError,{})]})})},se=c.default(g.Box)`
|
|
2
|
+
border: none;
|
|
3
|
+
|
|
4
|
+
svg {
|
|
5
|
+
height: ${11/16}rem;
|
|
6
|
+
width: ${11/16}rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
svg path {
|
|
10
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
11
|
+
}
|
|
12
|
+
`,ie=c.default(o.Trigger)`
|
|
13
|
+
position: relative;
|
|
14
|
+
border: 1px solid ${({theme:e,$hasError:n})=>n?e.colors.danger600:e.colors.neutral200};
|
|
15
|
+
padding-right: ${({theme:e})=>e.spaces[3]};
|
|
16
|
+
padding-left: ${({theme:e})=>e.spaces[3]};
|
|
17
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
18
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
min-height: ${({theme:e,$size:n})=>I.getThemeSize("input")({theme:e,size:n})};
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
gap: ${({theme:e})=>e.spaces[4]};
|
|
25
|
+
|
|
26
|
+
&[aria-disabled='true'] {
|
|
27
|
+
color: ${e=>e.theme.colors.neutral600};
|
|
28
|
+
background: ${e=>e.theme.colors.neutral150};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
32
|
+
&:focus-visible {
|
|
33
|
+
outline: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
${({theme:e,$hasError:n})=>I.inputFocusStyle()({theme:e,hasError:n})};
|
|
37
|
+
`,le=c.default(o.Icon)`
|
|
38
|
+
& > svg {
|
|
39
|
+
width: ${6/16}rem;
|
|
40
|
+
|
|
41
|
+
& > path {
|
|
42
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`,ce=c.default(o.Content)`
|
|
46
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
47
|
+
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
48
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
49
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
50
|
+
width: var(--radix-select-trigger-width);
|
|
51
|
+
/* This is from the design-system figma file. */
|
|
52
|
+
max-height: 15rem;
|
|
53
|
+
`,ae=c.default(o.Viewport)`
|
|
54
|
+
padding: ${({theme:e})=>e.spaces[1]};
|
|
55
|
+
`,de=({children:e,startIcon:n,value:s})=>t.jsxs(ue,{textValue:e.toString(),value:s.toString(),children:[n&&t.jsx(g.Box,{as:"span",paddingRight:2,"aria-hidden":!0,children:n}),t.jsx(j.Typography,{textColor:"neutral800",children:t.jsx(o.ItemText,{children:e})})]}),ue=c.default(o.Item)`
|
|
56
|
+
width: 100%;
|
|
57
|
+
border: none;
|
|
58
|
+
text-align: left;
|
|
59
|
+
outline-offset: -3px;
|
|
60
|
+
border-radius: ${e=>e.theme.borderRadius};
|
|
61
|
+
padding: ${e=>`${e.theme.spaces[2]} ${e.theme.spaces[4]}`};
|
|
62
|
+
padding-left: ${({theme:e})=>e.spaces[4]};
|
|
63
|
+
background-color: ${({theme:e})=>e.colors.neutral0};
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
|
|
67
|
+
&:focus-visible {
|
|
68
|
+
outline: none;
|
|
69
|
+
background-color: ${({theme:e})=>e.colors.primary100};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&:hover {
|
|
73
|
+
background-color: ${({theme:e})=>e.colors.primary100};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&[data-state='checked'] {
|
|
77
|
+
${j.Typography} {
|
|
78
|
+
font-weight: bold;
|
|
79
|
+
color: ${({theme:e})=>e.colors.primary600};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`;exports.SingleSelect=oe;exports.SingleSelectOption=de;
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import * as h from "react";
|
|
3
|
+
import * as n from "@radix-ui/react-select";
|
|
4
|
+
import { Cross as H, CarretDown as M } from "@strapi/icons";
|
|
5
|
+
import s from "styled-components";
|
|
6
|
+
import { Field as U } from "../Field/Field.js";
|
|
7
|
+
import { FieldLabel as Y } from "../Field/FieldLabel.js";
|
|
8
|
+
import "../Field/FieldInput.js";
|
|
9
|
+
import { FieldHint as _ } from "../Field/FieldHint.js";
|
|
10
|
+
import { FieldError as G } from "../Field/FieldError.js";
|
|
11
|
+
import "../Field/FieldContext.js";
|
|
12
|
+
import "../Field/FieldAction.js";
|
|
13
|
+
import { Stack as J } from "../Stack/Stack.js";
|
|
14
|
+
import { Box as m } from "../Box/Box.js";
|
|
15
|
+
import { Flex as I } from "../Flex/Flex.js";
|
|
16
|
+
import { Typography as b } from "../Typography/Typography.js";
|
|
17
|
+
import { useId as L } from "../helpers/useId.js";
|
|
18
|
+
import { useIntersection as Q } from "../hooks/useIntersection.js";
|
|
19
|
+
import { getThemeSize as X, inputFocusStyle as Z } from "../themes/utils.js";
|
|
20
|
+
const ee = [" ", "Enter", "ArrowUp", "ArrowDown"], Te = ({
|
|
21
|
+
children: e,
|
|
22
|
+
clearLabel: o = "Clear",
|
|
23
|
+
customizeContent: g = (p) => p.toString(),
|
|
24
|
+
disabled: a,
|
|
25
|
+
error: w,
|
|
26
|
+
hint: k,
|
|
27
|
+
id: T,
|
|
28
|
+
label: C,
|
|
29
|
+
labelAction: D,
|
|
30
|
+
onChange: x,
|
|
31
|
+
onClear: c,
|
|
32
|
+
onReachEnd: y,
|
|
33
|
+
placeholder: E,
|
|
34
|
+
required: S,
|
|
35
|
+
selectButtonTitle: se,
|
|
36
|
+
startIcon: v,
|
|
37
|
+
size: F = "M",
|
|
38
|
+
value: f
|
|
39
|
+
}) => {
|
|
40
|
+
const p = h.useRef(null), $ = h.useRef(null), d = h.useRef(null), [O, B] = h.useState(""), [V, N] = h.useState(!1), u = L(T), P = `${u}-hint`, j = `${u}-error`, z = (r) => {
|
|
41
|
+
x ? x(typeof f == "number" ? Number(r) : r) : B(r);
|
|
42
|
+
}, K = (r) => {
|
|
43
|
+
c && !a && (c(r), $.current.focus());
|
|
44
|
+
}, q = (r) => {
|
|
45
|
+
N(r);
|
|
46
|
+
}, A = (r) => {
|
|
47
|
+
d.current && d.current === r.target.closest("div") && r.preventDefault();
|
|
48
|
+
}, W = (r) => {
|
|
49
|
+
ee.includes(r.key) && d.current && d.current === r.target.closest("div") && !a && c && (r.preventDefault(), c(r), $.current.focus());
|
|
50
|
+
}, R = `intersection-${u}`;
|
|
51
|
+
Q(p, (r) => {
|
|
52
|
+
y && y(r);
|
|
53
|
+
}, {
|
|
54
|
+
selectorToWatch: `#${R}`,
|
|
55
|
+
skipWhen: !V
|
|
56
|
+
});
|
|
57
|
+
const l = typeof f < "u" ? f.toString() : O;
|
|
58
|
+
return t(U, {
|
|
59
|
+
hint: k,
|
|
60
|
+
error: w,
|
|
61
|
+
id: u,
|
|
62
|
+
required: S,
|
|
63
|
+
children: i(J, {
|
|
64
|
+
spacing: 1,
|
|
65
|
+
children: [t(Y, {
|
|
66
|
+
action: D,
|
|
67
|
+
children: C
|
|
68
|
+
}), i(n.Root, {
|
|
69
|
+
onOpenChange: q,
|
|
70
|
+
disabled: a,
|
|
71
|
+
required: S,
|
|
72
|
+
onValueChange: z,
|
|
73
|
+
value: l,
|
|
74
|
+
children: [i(te, {
|
|
75
|
+
id: u,
|
|
76
|
+
"aria-labelledby": `${P} ${j}`,
|
|
77
|
+
"aria-disabled": a,
|
|
78
|
+
$hasError: Boolean(w),
|
|
79
|
+
$size: F,
|
|
80
|
+
onPointerDown: A,
|
|
81
|
+
onKeyDown: W,
|
|
82
|
+
ref: $,
|
|
83
|
+
children: [i(I, {
|
|
84
|
+
as: "span",
|
|
85
|
+
gap: 4,
|
|
86
|
+
children: [v && t(m, {
|
|
87
|
+
as: "span",
|
|
88
|
+
"aria-hidden": !0,
|
|
89
|
+
children: v
|
|
90
|
+
}), t(b, {
|
|
91
|
+
ellipsis: !0,
|
|
92
|
+
textColor: l ? "neutral800" : "neutral600",
|
|
93
|
+
children: t(n.Value, {
|
|
94
|
+
"aria-label": l,
|
|
95
|
+
children: l ? g(l) : E
|
|
96
|
+
})
|
|
97
|
+
})]
|
|
98
|
+
}), i(I, {
|
|
99
|
+
as: "span",
|
|
100
|
+
gap: 3,
|
|
101
|
+
children: [l && c ? t(re, {
|
|
102
|
+
hasRadius: !0,
|
|
103
|
+
background: "transparent",
|
|
104
|
+
role: "button",
|
|
105
|
+
tabIndex: 0,
|
|
106
|
+
onClick: K,
|
|
107
|
+
"aria-disabled": a,
|
|
108
|
+
"aria-label": o,
|
|
109
|
+
title: o,
|
|
110
|
+
ref: d,
|
|
111
|
+
children: t(H, {})
|
|
112
|
+
}) : null, t(oe, {
|
|
113
|
+
children: t(M, {})
|
|
114
|
+
})]
|
|
115
|
+
})]
|
|
116
|
+
}), t(n.Portal, {
|
|
117
|
+
children: t(ne, {
|
|
118
|
+
position: "popper",
|
|
119
|
+
sideOffset: 4,
|
|
120
|
+
children: i(ie, {
|
|
121
|
+
ref: p,
|
|
122
|
+
children: [e, t(m, {
|
|
123
|
+
id: R,
|
|
124
|
+
width: "100%",
|
|
125
|
+
height: "1px"
|
|
126
|
+
})]
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
})]
|
|
130
|
+
}), t(_, {}), t(G, {})]
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
}, re = s(m)`
|
|
134
|
+
border: none;
|
|
135
|
+
|
|
136
|
+
svg {
|
|
137
|
+
height: ${11 / 16}rem;
|
|
138
|
+
width: ${11 / 16}rem;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
svg path {
|
|
142
|
+
fill: ${({
|
|
143
|
+
theme: e
|
|
144
|
+
}) => e.colors.neutral600};
|
|
145
|
+
}
|
|
146
|
+
`, te = s(n.Trigger)`
|
|
147
|
+
position: relative;
|
|
148
|
+
border: 1px solid ${({
|
|
149
|
+
theme: e,
|
|
150
|
+
$hasError: o
|
|
151
|
+
}) => o ? e.colors.danger600 : e.colors.neutral200};
|
|
152
|
+
padding-right: ${({
|
|
153
|
+
theme: e
|
|
154
|
+
}) => e.spaces[3]};
|
|
155
|
+
padding-left: ${({
|
|
156
|
+
theme: e
|
|
157
|
+
}) => e.spaces[3]};
|
|
158
|
+
border-radius: ${({
|
|
159
|
+
theme: e
|
|
160
|
+
}) => e.borderRadius};
|
|
161
|
+
background: ${({
|
|
162
|
+
theme: e
|
|
163
|
+
}) => e.colors.neutral0};
|
|
164
|
+
overflow: hidden;
|
|
165
|
+
min-height: ${({
|
|
166
|
+
theme: e,
|
|
167
|
+
$size: o
|
|
168
|
+
}) => X("input")({
|
|
169
|
+
theme: e,
|
|
170
|
+
size: o
|
|
171
|
+
})};
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
justify-content: space-between;
|
|
175
|
+
gap: ${({
|
|
176
|
+
theme: e
|
|
177
|
+
}) => e.spaces[4]};
|
|
178
|
+
|
|
179
|
+
&[aria-disabled='true'] {
|
|
180
|
+
color: ${(e) => e.theme.colors.neutral600};
|
|
181
|
+
background: ${(e) => e.theme.colors.neutral150};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
185
|
+
&:focus-visible {
|
|
186
|
+
outline: none;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
${({
|
|
190
|
+
theme: e,
|
|
191
|
+
$hasError: o
|
|
192
|
+
}) => Z()({
|
|
193
|
+
theme: e,
|
|
194
|
+
hasError: o
|
|
195
|
+
})};
|
|
196
|
+
`, oe = s(n.Icon)`
|
|
197
|
+
& > svg {
|
|
198
|
+
width: ${6 / 16}rem;
|
|
199
|
+
|
|
200
|
+
& > path {
|
|
201
|
+
fill: ${({
|
|
202
|
+
theme: e
|
|
203
|
+
}) => e.colors.neutral600};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
`, ne = s(n.Content)`
|
|
207
|
+
background: ${({
|
|
208
|
+
theme: e
|
|
209
|
+
}) => e.colors.neutral0};
|
|
210
|
+
box-shadow: ${({
|
|
211
|
+
theme: e
|
|
212
|
+
}) => e.shadows.filterShadow};
|
|
213
|
+
border: 1px solid ${({
|
|
214
|
+
theme: e
|
|
215
|
+
}) => e.colors.neutral150};
|
|
216
|
+
border-radius: ${({
|
|
217
|
+
theme: e
|
|
218
|
+
}) => e.borderRadius};
|
|
219
|
+
width: var(--radix-select-trigger-width);
|
|
220
|
+
/* This is from the design-system figma file. */
|
|
221
|
+
max-height: 15rem;
|
|
222
|
+
`, ie = s(n.Viewport)`
|
|
223
|
+
padding: ${({
|
|
224
|
+
theme: e
|
|
225
|
+
}) => e.spaces[1]};
|
|
226
|
+
`, Ce = ({
|
|
227
|
+
children: e,
|
|
228
|
+
startIcon: o,
|
|
229
|
+
value: g
|
|
230
|
+
}) => i(le, {
|
|
231
|
+
textValue: e.toString(),
|
|
232
|
+
value: g.toString(),
|
|
233
|
+
children: [o && t(m, {
|
|
234
|
+
as: "span",
|
|
235
|
+
paddingRight: 2,
|
|
236
|
+
"aria-hidden": !0,
|
|
237
|
+
children: o
|
|
238
|
+
}), t(b, {
|
|
239
|
+
textColor: "neutral800",
|
|
240
|
+
children: t(n.ItemText, {
|
|
241
|
+
children: e
|
|
242
|
+
})
|
|
243
|
+
})]
|
|
244
|
+
}), le = s(n.Item)`
|
|
245
|
+
width: 100%;
|
|
246
|
+
border: none;
|
|
247
|
+
text-align: left;
|
|
248
|
+
outline-offset: -3px;
|
|
249
|
+
border-radius: ${(e) => e.theme.borderRadius};
|
|
250
|
+
padding: ${(e) => `${e.theme.spaces[2]} ${e.theme.spaces[4]}`};
|
|
251
|
+
padding-left: ${({
|
|
252
|
+
theme: e
|
|
253
|
+
}) => e.spaces[4]};
|
|
254
|
+
background-color: ${({
|
|
255
|
+
theme: e
|
|
256
|
+
}) => e.colors.neutral0};
|
|
257
|
+
display: flex;
|
|
258
|
+
align-items: center;
|
|
259
|
+
|
|
260
|
+
&:focus-visible {
|
|
261
|
+
outline: none;
|
|
262
|
+
background-color: ${({
|
|
263
|
+
theme: e
|
|
264
|
+
}) => e.colors.primary100};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
&:hover {
|
|
268
|
+
background-color: ${({
|
|
269
|
+
theme: e
|
|
270
|
+
}) => e.colors.primary100};
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
&[data-state='checked'] {
|
|
274
|
+
${b} {
|
|
275
|
+
font-weight: bold;
|
|
276
|
+
color: ${({
|
|
277
|
+
theme: e
|
|
278
|
+
}) => e.colors.primary600};
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
`;
|
|
282
|
+
export {
|
|
283
|
+
Te as SingleSelect,
|
|
284
|
+
Ce as SingleSelectOption
|
|
285
|
+
};
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
}
|
|
33
33
|
`,ne=E.default(j.Button)`
|
|
34
34
|
padding: ${({theme:e})=>`${e.spaces[1]} ${e.spaces[3]}`};
|
|
35
|
-
`,I=({children:e,onClick:h,to:u,isFocused:l,href:c,...x})=>{const
|
|
35
|
+
`,I=({children:e,onClick:h,to:u,isFocused:l,href:c,...x})=>{const d=a.useRef();a.useEffect(()=>{l&&d.current&&d.current.focus()},[l]);const i={tabIndex:l?0:-1,ref:d,role:"menuitem",...x},f=v=>{(v.key===s.KeyboardKeys.SPACE||v.key===s.KeyboardKeys.ENTER)&&h()};return u&&!c?o.default.createElement(Z,{to:u,...i},o.default.createElement(b.Box,{padding:2},o.default.createElement(T.Typography,null,e))):c&&!u?o.default.createElement(ee,{isExternal:!0,href:c,...i},o.default.createElement(b.Box,{padding:2},o.default.createElement(T.Typography,null,e))):o.default.createElement(Y,{onKeyDown:f,onMouseDown:h,type:"button",...i},o.default.createElement(b.Box,{padding:2},o.default.createElement(T.Typography,null,e)))};I.defaultProps={as:void 0,href:void 0,isFocused:!1,onClick(){},to:void 0};I.propTypes={as:t.default.elementType,children:t.default.node.isRequired,href:t.default.string,isFocused:t.default.bool,onClick:t.default.func,to:t.default.string};const g=({label:e,children:h,id:u,as:l,onOpen:c=()=>{},onClose:x=()=>{},size:d,popoverPlacement:i,onReachEnd:f,...v})=>{const p=a.useRef(),K=X.useId(u),R=a.useRef(!1),[y,m]=a.useState(!1),[P,C]=a.useState(0),k=a.Children.toArray(h),L=d==="S"?ne:j.Button,_=l||L,O=!!f&&typeof f=="function";a.useEffect(()=>{if(["string","number"].includes(typeof e)){const n=k.findIndex(r=>r.props.children===e);n!==-1&&C(n)}},[e]);const S=M.useCallbackRef(c),D=M.useCallbackRef(x);a.useEffect(()=>{R?.current?y?S():D():R.current=!0},[R,D,S,y]),a.useEffect(()=>{o.default.isValidElement(e)&&P===-1&&p.current.focus()},[e,P]);const $=n=>{y&&(n.key===s.KeyboardKeys.ESCAPE&&(n.stopPropagation(),m(!1),p.current.focus()),n.key===s.KeyboardKeys.DOWN&&C(r=>r===k.length-1?0:r+1),n.key===s.KeyboardKeys.UP&&C(r=>r===0?k.length-1:r-1))},F=n=>{(n.key===s.KeyboardKeys.ENTER||n.key===s.KeyboardKeys.SPACE)&&m(r=>!r)},A=n=>{n.preventDefault(),n.currentTarget.contains(n.relatedTarget)||m(!1)},N=n=>{n.preventDefault(),m(r=>!r)},V=()=>{O&&f()},W=k.map((n,r)=>o.default.createElement(Q.Flex,{as:"li",key:r,justifyContent:"center",role:"menuitem"},a.cloneElement(n,{onClick(){n.props.onClick(),m(!1),p.current.focus()},isFocused:P===r})));return o.default.createElement("div",{onKeyDown:$},o.default.createElement(_,{label:o.default.isValidElement(e)?null:e,"aria-haspopup":!0,"aria-expanded":y,"aria-controls":K,onKeyDown:F,onMouseDown:N,ref:p,type:"button",variant:"ghost",endIcon:o.default.createElement(te,null,o.default.createElement(G.CarretDown,{"aria-hidden":!0})),...v},e),y&&o.default.createElement(w.Popover,{onBlur:A,placement:i,source:p,onReachEnd:V,intersectionId:O?`popover-${K}`:void 0,spacing:4},o.default.createElement(b.Box,{role:"menu",as:"ul",padding:1,id:K},W)))};g.defaultProps={as:void 0};g.displayName="SimpleMenu";g.defaultProps={id:void 0,onOpen:void 0,onClose:void 0,onReachEnd:void 0,popoverPlacement:"bottom-start",size:"M"};g.propTypes={as:t.default.any,children:t.default.oneOfType([t.default.arrayOf(t.default.node),t.default.node]).isRequired,id:t.default.string,label:t.default.oneOfType([t.default.string,t.default.number,t.default.element]).isRequired,onClose:t.default.func,onOpen:t.default.func,onReachEnd:t.default.func,popoverPlacement:t.default.oneOf(w.POPOVER_PLACEMENTS),size:t.default.oneOf(["S","M"])};exports.MenuItem=I;exports.SimpleMenu=g;
|