@strapi/design-system 1.6.6 → 1.7.0-alpha.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/README.md +55 -0
- package/dist/BaseButton/BaseButton.cjs +1 -1
- package/dist/BaseButton/BaseButton.js +1 -1
- package/dist/BaseLink/BaseLink.cjs +1 -3
- package/dist/BaseLink/BaseLink.js +14 -14
- package/dist/Combobox/Combobox.cjs +104 -1
- package/dist/Combobox/Combobox.js +348 -278
- package/dist/Combobox/ComboboxList.cjs +1 -1
- package/dist/Combobox/ComboboxList.js +7 -6
- package/dist/Combobox/ComboboxOption.cjs +1 -1
- package/dist/Combobox/ComboboxOption.js +3 -29
- package/dist/DatePicker/DatePicker.cjs +6 -2
- package/dist/DatePicker/DatePicker.js +55 -49
- package/dist/DateTimePicker/parseDate.cjs +1 -0
- package/dist/DateTimePicker/parseDate.js +8 -0
- package/dist/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +31 -31
- package/dist/Select/MultiSelect.cjs +30 -0
- package/dist/Select/MultiSelect.js +239 -0
- package/dist/Select/MultiSelectNested.cjs +3 -1
- package/dist/Select/MultiSelectNested.js +25 -12
- package/dist/Select/OptGroup.cjs +1 -1
- package/dist/Select/OptGroup.js +3 -22
- package/dist/Select/Option.cjs +1 -45
- package/dist/Select/Option.js +12 -100
- package/dist/Select/Select.cjs +1 -3
- package/dist/Select/Select.js +9 -207
- package/dist/Select/SelectList.cjs +1 -1
- package/dist/Select/SelectList.js +98 -80
- package/dist/Select/SelectParts.cjs +79 -0
- package/dist/Select/SelectParts.js +221 -0
- package/dist/Select/SingleSelect.cjs +1 -0
- package/dist/Select/SingleSelect.js +129 -0
- package/dist/Select/index.cjs +1 -1
- package/dist/Select/index.js +15 -10
- package/dist/TimePicker/TimePicker.cjs +2 -2
- package/dist/TimePicker/TimePicker.js +42 -40
- package/dist/helpers/objects.cjs +1 -1
- package/dist/helpers/objects.js +6 -22
- package/dist/hooks/useComposeRefs.cjs +1 -0
- package/dist/hooks/useComposeRefs.js +14 -0
- package/dist/hooks/useIntersection.cjs +1 -1
- package/dist/hooks/useIntersection.js +7 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +143 -138
- package/dist/themes/extendTheme.cjs +4 -4
- package/dist/themes/extendTheme.js +21 -13
- package/dist/themes/utils.cjs +6 -6
- package/dist/themes/utils.js +7 -6
- package/dist/v2/Link/Link.cjs +13 -11
- package/dist/v2/Link/Link.js +52 -37
- package/dist/v2/SimpleMenu/Menu.cjs +65 -0
- package/dist/v2/SimpleMenu/Menu.js +229 -0
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +1 -33
- package/dist/v2/SimpleMenu/SimpleMenu.js +37 -176
- package/dist/v2/SimpleMenu/index.cjs +1 -1
- package/dist/v2/SimpleMenu/index.js +5 -3
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.js +53 -51
- package/package.json +6 -19
- package/dist/Combobox/components.cjs +0 -53
- package/dist/Combobox/components.js +0 -64
- package/dist/Combobox/utils.cjs +0 -1
- package/dist/Combobox/utils.js +0 -78
- package/dist/Select/SelectButton.cjs +0 -19
- package/dist/Select/SelectButton.js +0 -69
- package/dist/Select/SelectTags.cjs +0 -6
- package/dist/Select/SelectTags.js +0 -38
- package/dist/Select/components.cjs +0 -39
- package/dist/Select/components.js +0 -48
- package/dist/Select/constants.cjs +0 -1
- package/dist/Select/constants.js +0 -8
- package/dist/Select/hooks/useButtonRef.cjs +0 -1
- package/dist/Select/hooks/useButtonRef.js +0 -13
- package/dist/Select/hooks/useListRef.cjs +0 -1
- package/dist/Select/hooks/useListRef.js +0 -18
- package/dist/Select/utils.cjs +0 -1
- package/dist/Select/utils.js +0 -17
- package/dist/helpers/arrays.cjs +0 -1
- package/dist/helpers/arrays.js +0 -6
- package/dist/v2/SimpleMenu/utils.cjs +0 -12
- package/dist/v2/SimpleMenu/utils.js +0 -15
|
@@ -1,287 +1,357 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { FieldLabel as Se } from "../Field/FieldLabel.js";
|
|
1
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { Cross as re, CarretDown as oe } from "@strapi/icons";
|
|
4
|
+
import { Combobox as t } from "@strapi/ui-primitives";
|
|
5
|
+
import l from "styled-components";
|
|
6
|
+
import { Box as B } from "../Box/Box.js";
|
|
7
|
+
import { Field as te } from "../Field/Field.js";
|
|
8
|
+
import { FieldLabel as ne } from "../Field/FieldLabel.js";
|
|
10
9
|
import "../Field/FieldInput.js";
|
|
11
|
-
import { FieldHint as
|
|
12
|
-
import { FieldError as
|
|
10
|
+
import { FieldHint as le } from "../Field/FieldHint.js";
|
|
11
|
+
import { FieldError as ie } from "../Field/FieldError.js";
|
|
13
12
|
import "../Field/FieldContext.js";
|
|
14
13
|
import "../Field/FieldAction.js";
|
|
15
|
-
import { Flex as
|
|
16
|
-
import {
|
|
17
|
-
import { useId as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
14
|
+
import { Flex as $ } from "../Flex/Flex.js";
|
|
15
|
+
import { useControllableState as ae } from "../hooks/useControllableState.js";
|
|
16
|
+
import { useId as se } from "../hooks/useId.js";
|
|
17
|
+
import { useIntersection as de } from "../hooks/useIntersection.js";
|
|
18
|
+
import { Loader as ce } from "../Loader/Loader.js";
|
|
19
|
+
import "../themes/lightTheme/index.js";
|
|
20
|
+
import "../themes/darkTheme/index.js";
|
|
21
|
+
import "lodash";
|
|
22
|
+
import { inputFocusStyle as ue } from "../themes/utils.js";
|
|
23
|
+
import { Typography as p } from "../Typography/Typography.js";
|
|
24
|
+
const he = ({
|
|
25
|
+
children: e,
|
|
26
|
+
clearLabel: n = "clear",
|
|
27
|
+
creatable: s = !1,
|
|
28
|
+
createMessage: m = (b) => `Create "${b}"`,
|
|
29
|
+
disabled: d = !1,
|
|
30
|
+
error: c,
|
|
31
|
+
hasMoreItems: O = !1,
|
|
32
|
+
hint: j,
|
|
33
|
+
id: E,
|
|
34
|
+
label: P,
|
|
35
|
+
labelAction: q,
|
|
36
|
+
loading: f = !1,
|
|
37
|
+
loadingMessage: D = "Loading content...",
|
|
38
|
+
noOptionsMessage: H = () => "No results found",
|
|
39
|
+
onChange: C,
|
|
40
|
+
onClear: g,
|
|
41
|
+
onCreateOption: w,
|
|
42
|
+
onInputChange: I,
|
|
43
|
+
onLoadMore: v,
|
|
44
|
+
placeholder: N = "Select or enter a value",
|
|
45
|
+
required: V = !1,
|
|
46
|
+
defaultTextValue: W,
|
|
47
|
+
textValue: z,
|
|
48
|
+
value: L
|
|
47
49
|
}) => {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
50
|
+
const [b, U] = a.useState(!1), [i, y] = ae({
|
|
51
|
+
prop: z,
|
|
52
|
+
defaultProp: W
|
|
53
|
+
}), [A, R] = a.useState(""), k = a.useRef(null), T = a.useRef(null), G = a.useRef(null), u = se(E), J = (o) => {
|
|
54
|
+
g && !d && (y(""), R(""), g(o), T.current.focus());
|
|
55
|
+
}, K = (o) => {
|
|
56
|
+
U(o);
|
|
57
|
+
}, Q = (o) => {
|
|
58
|
+
y(o);
|
|
59
|
+
}, X = (o) => {
|
|
60
|
+
R(o);
|
|
61
|
+
}, Y = (o) => {
|
|
62
|
+
I && I(o);
|
|
63
|
+
}, Z = (o) => {
|
|
64
|
+
C && C(o);
|
|
65
|
+
}, F = `intersection-${u}`, _ = (o) => {
|
|
66
|
+
v && O && !f && v(o);
|
|
67
|
+
}, S = () => {
|
|
68
|
+
w && i && w(i);
|
|
69
|
+
};
|
|
70
|
+
de(k, _, {
|
|
71
|
+
selectorToWatch: `#${F}`,
|
|
72
|
+
skipWhen: !b
|
|
73
|
+
});
|
|
74
|
+
const M = `${u}-hint`, ee = `${u}-error`;
|
|
75
|
+
return r(te, {
|
|
76
|
+
hint: j,
|
|
77
|
+
error: c,
|
|
78
|
+
id: u,
|
|
79
|
+
required: V,
|
|
80
|
+
children: h($, {
|
|
81
|
+
direction: "column",
|
|
82
|
+
alignItems: "stretch",
|
|
83
|
+
gap: 1,
|
|
84
|
+
children: [r(ne, {
|
|
85
|
+
action: q,
|
|
86
|
+
children: P
|
|
87
|
+
}), h(t.Root, {
|
|
88
|
+
autocomplete: s ? "list" : "both",
|
|
89
|
+
onOpenChange: K,
|
|
90
|
+
onTextValueChange: Q,
|
|
91
|
+
textValue: i,
|
|
92
|
+
allowCustomValue: !0,
|
|
93
|
+
disabled: d,
|
|
94
|
+
required: V,
|
|
95
|
+
value: L,
|
|
96
|
+
onValueChange: Z,
|
|
97
|
+
filterValue: A,
|
|
98
|
+
onFilterValueChange: X,
|
|
99
|
+
children: [h(me, {
|
|
100
|
+
$hasError: Boolean(c),
|
|
101
|
+
children: [r(fe, {
|
|
102
|
+
placeholder: N,
|
|
103
|
+
id: u,
|
|
104
|
+
"aria-invalid": Boolean(c),
|
|
105
|
+
"aria-labelledby": `${M} ${ee}`,
|
|
106
|
+
onChange: Y,
|
|
107
|
+
ref: T
|
|
108
|
+
}), h($, {
|
|
109
|
+
as: "span",
|
|
110
|
+
gap: 3,
|
|
111
|
+
children: [i && g ? r(pe, {
|
|
112
|
+
as: "button",
|
|
113
|
+
hasRadius: !0,
|
|
114
|
+
background: "transparent",
|
|
115
|
+
type: "button",
|
|
116
|
+
onClick: J,
|
|
117
|
+
"aria-disabled": d,
|
|
118
|
+
"aria-label": n,
|
|
119
|
+
title: n,
|
|
120
|
+
ref: G,
|
|
121
|
+
children: r(re, {})
|
|
122
|
+
}) : null, r(ge, {
|
|
123
|
+
children: r(oe, {})
|
|
124
|
+
})]
|
|
125
|
+
})]
|
|
126
|
+
}), r(t.Portal, {
|
|
127
|
+
children: r(be, {
|
|
128
|
+
sideOffset: 4,
|
|
129
|
+
children: h($e, {
|
|
130
|
+
ref: k,
|
|
131
|
+
children: [e, s ? r(t.CreateItem, {
|
|
132
|
+
onPointerUp: S,
|
|
133
|
+
onClick: S,
|
|
134
|
+
asChild: !0,
|
|
135
|
+
children: r(x, {
|
|
136
|
+
children: r(p, {
|
|
137
|
+
children: m(i ?? "")
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
}) : null, !s && !f ? r(t.NoValueFound, {
|
|
141
|
+
asChild: !0,
|
|
142
|
+
children: r(x, {
|
|
143
|
+
$hasHover: !1,
|
|
144
|
+
children: r(p, {
|
|
145
|
+
children: H(i ?? "")
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
}) : null, f ? r($, {
|
|
149
|
+
justifyContent: "center",
|
|
150
|
+
alignItems: "center",
|
|
151
|
+
paddingTop: 2,
|
|
152
|
+
paddingBottom: 2,
|
|
153
|
+
children: r(ce, {
|
|
154
|
+
small: !0,
|
|
155
|
+
children: D
|
|
156
|
+
})
|
|
157
|
+
}) : null, r(B, {
|
|
158
|
+
id: F,
|
|
159
|
+
width: "100%",
|
|
160
|
+
height: "1px"
|
|
161
|
+
})]
|
|
162
|
+
})
|
|
163
|
+
})
|
|
164
|
+
})]
|
|
165
|
+
}), r(le, {}), r(ie, {})]
|
|
166
|
+
})
|
|
167
|
+
});
|
|
168
|
+
}, ze = (e) => r(he, {
|
|
169
|
+
...e,
|
|
170
|
+
creatable: !0
|
|
171
|
+
}), pe = l(B)`
|
|
172
|
+
border: none;
|
|
173
|
+
|
|
174
|
+
svg {
|
|
175
|
+
height: ${11 / 16}rem;
|
|
176
|
+
width: ${11 / 16}rem;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
svg path {
|
|
180
|
+
fill: ${({
|
|
181
|
+
theme: e
|
|
182
|
+
}) => e.colors.neutral600};
|
|
183
|
+
}
|
|
184
|
+
`, me = l(t.Trigger)`
|
|
185
|
+
position: relative;
|
|
186
|
+
border: 1px solid ${({
|
|
187
|
+
theme: e,
|
|
188
|
+
$hasError: n
|
|
189
|
+
}) => n ? e.colors.danger600 : e.colors.neutral200};
|
|
190
|
+
padding-right: ${({
|
|
191
|
+
theme: e
|
|
192
|
+
}) => e.spaces[3]};
|
|
193
|
+
padding-left: ${({
|
|
194
|
+
theme: e
|
|
195
|
+
}) => e.spaces[3]};
|
|
196
|
+
border-radius: ${({
|
|
197
|
+
theme: e
|
|
198
|
+
}) => e.borderRadius};
|
|
199
|
+
background: ${({
|
|
200
|
+
theme: e
|
|
201
|
+
}) => e.colors.neutral0};
|
|
202
|
+
overflow: hidden;
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
justify-content: space-between;
|
|
206
|
+
gap: ${({
|
|
207
|
+
theme: e
|
|
208
|
+
}) => e.spaces[4]};
|
|
209
|
+
|
|
210
|
+
&[data-disabled] {
|
|
211
|
+
color: ${({
|
|
212
|
+
theme: e
|
|
213
|
+
}) => e.colors.neutral600};
|
|
214
|
+
background: ${({
|
|
215
|
+
theme: e
|
|
216
|
+
}) => e.colors.neutral150};
|
|
217
|
+
cursor: not-allowed;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
221
|
+
&:focus-visible {
|
|
222
|
+
outline: none;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
${({
|
|
226
|
+
theme: e,
|
|
227
|
+
$hasError: n
|
|
228
|
+
}) => ue()({
|
|
229
|
+
theme: e,
|
|
230
|
+
hasError: n
|
|
231
|
+
})};
|
|
232
|
+
`, fe = l(t.TextInput)`
|
|
233
|
+
width: 100%;
|
|
234
|
+
font-size: ${14 / 16}rem;
|
|
235
|
+
color: ${({
|
|
236
|
+
theme: e
|
|
237
|
+
}) => e.colors.neutral800};
|
|
238
|
+
min-height: ${40 / 16}rem;
|
|
239
|
+
border: none;
|
|
240
|
+
background-color: transparent;
|
|
241
|
+
|
|
242
|
+
&:focus-visible {
|
|
243
|
+
outline: none;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
&[aria-disabled='true'] {
|
|
247
|
+
cursor: inherit;
|
|
248
|
+
}
|
|
249
|
+
`, ge = l(t.Icon)`
|
|
250
|
+
& > svg {
|
|
251
|
+
width: ${6 / 16}rem;
|
|
252
|
+
|
|
253
|
+
& > path {
|
|
254
|
+
fill: ${({
|
|
255
|
+
theme: e
|
|
256
|
+
}) => e.colors.neutral600};
|
|
106
257
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
&[aria-disabled='true'] {
|
|
261
|
+
cursor: inherit;
|
|
262
|
+
}
|
|
263
|
+
`, be = l(t.Content)`
|
|
264
|
+
background: ${({
|
|
265
|
+
theme: e
|
|
266
|
+
}) => e.colors.neutral0};
|
|
267
|
+
box-shadow: ${({
|
|
268
|
+
theme: e
|
|
269
|
+
}) => e.shadows.filterShadow};
|
|
270
|
+
border: 1px solid ${({
|
|
271
|
+
theme: e
|
|
272
|
+
}) => e.colors.neutral150};
|
|
273
|
+
border-radius: ${({
|
|
274
|
+
theme: e
|
|
275
|
+
}) => e.borderRadius};
|
|
276
|
+
width: var(--radix-combobox-trigger-width);
|
|
277
|
+
/* This is from the design-system figma file. */
|
|
278
|
+
max-height: 15rem;
|
|
279
|
+
`, $e = l(t.Viewport)`
|
|
280
|
+
padding: ${({
|
|
281
|
+
theme: e
|
|
282
|
+
}) => e.spaces[1]};
|
|
283
|
+
`, Le = a.forwardRef(({
|
|
284
|
+
children: e,
|
|
285
|
+
value: n,
|
|
286
|
+
disabled: s,
|
|
287
|
+
textValue: m,
|
|
288
|
+
...d
|
|
289
|
+
}, c) => r(t.ComboboxItem, {
|
|
290
|
+
asChild: !0,
|
|
291
|
+
value: n,
|
|
292
|
+
disabled: s,
|
|
293
|
+
textValue: m,
|
|
294
|
+
children: r(x, {
|
|
295
|
+
ref: c,
|
|
296
|
+
...d,
|
|
297
|
+
children: r(t.ItemText, {
|
|
298
|
+
asChild: !0,
|
|
299
|
+
children: r(p, {
|
|
300
|
+
children: e
|
|
301
|
+
})
|
|
302
|
+
})
|
|
303
|
+
})
|
|
304
|
+
})), x = l.div`
|
|
305
|
+
width: 100%;
|
|
306
|
+
border: none;
|
|
307
|
+
text-align: left;
|
|
308
|
+
outline-offset: -3px;
|
|
309
|
+
padding: ${({
|
|
310
|
+
theme: e
|
|
311
|
+
}) => e.spaces[2]} ${({
|
|
312
|
+
theme: e
|
|
313
|
+
}) => e.spaces[4]};
|
|
314
|
+
background-color: ${({
|
|
315
|
+
theme: e
|
|
316
|
+
}) => e.colors.neutral0};
|
|
317
|
+
border-radius: ${({
|
|
318
|
+
theme: e
|
|
319
|
+
}) => e.borderRadius};
|
|
320
|
+
|
|
321
|
+
&[data-selected] {
|
|
322
|
+
background-color: ${({
|
|
323
|
+
theme: e
|
|
324
|
+
}) => e.colors.primary100};
|
|
325
|
+
|
|
326
|
+
${p} {
|
|
327
|
+
color: ${({
|
|
328
|
+
theme: e
|
|
329
|
+
}) => e.colors.primary600};
|
|
330
|
+
font-weight: bold;
|
|
119
331
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}), Ce = () => {
|
|
138
|
-
x.current.focus(), S && S(), H();
|
|
139
|
-
}, he = () => {
|
|
140
|
-
x.current.focus(), f(!0);
|
|
141
|
-
}, Ee = () => {
|
|
142
|
-
const t = l.findIndex((n) => n.props?.children === r);
|
|
143
|
-
return r && t === -1;
|
|
144
|
-
}, ve = (t) => {
|
|
145
|
-
t.preventDefault(), f(t, !0);
|
|
146
|
-
};
|
|
147
|
-
let D;
|
|
148
|
-
return O ? D = `${a}-error` : $ && (D = `${a}-hint`), /* @__PURE__ */ o.createElement(Fe, { hint: $, error: O, id: a, required: A }, /* @__PURE__ */ o.createElement(_e, { "aria-live": "polite", "aria-atomic": "false", "aria-relevant": "additions text" }, d), /* @__PURE__ */ o.createElement(B, { direction: "column", alignItems: "stretch", gap: E || $ || O ? 1 : 0 }, E && /* @__PURE__ */ o.createElement(Se, { action: Y }, E), /* @__PURE__ */ o.createElement(Me, { ref: K, $disabled: c, hasError: O }, /* @__PURE__ */ o.createElement($e, { wrap: "wrap" }, !r && d && /* @__PURE__ */ o.createElement(we, { id: `${a}-selected-value` }, /* @__PURE__ */ o.createElement(z, null, ae())), /* @__PURE__ */ o.createElement(
|
|
149
|
-
Le,
|
|
150
|
-
{
|
|
151
|
-
"aria-activedescendant": de,
|
|
152
|
-
"aria-autocomplete": "list",
|
|
153
|
-
"aria-controls": `${a}-listbox`,
|
|
154
|
-
"aria-disabled": c,
|
|
155
|
-
"aria-expanded": u,
|
|
156
|
-
"aria-haspopup": "listbox",
|
|
157
|
-
"aria-describedby": D,
|
|
158
|
-
autoComplete: "off",
|
|
159
|
-
autoCorrect: "off",
|
|
160
|
-
id: a,
|
|
161
|
-
onBlur: c ? void 0 : me,
|
|
162
|
-
onClick: c ? void 0 : ve,
|
|
163
|
-
onInput: c ? void 0 : fe,
|
|
164
|
-
onKeyDown: c ? void 0 : ue,
|
|
165
|
-
placeholder: d ? "" : ne,
|
|
166
|
-
readOnly: c,
|
|
167
|
-
ref: x,
|
|
168
|
-
required: A,
|
|
169
|
-
role: "combobox",
|
|
170
|
-
spellCheck: "off",
|
|
171
|
-
type: "text",
|
|
172
|
-
value: r
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
&:hover,
|
|
335
|
+
&[data-highlighted] {
|
|
336
|
+
outline: none;
|
|
337
|
+
background-color: ${({
|
|
338
|
+
theme: e,
|
|
339
|
+
$hasHover: n = !0
|
|
340
|
+
}) => n ? e.colors.primary100 : e.colors.neutral0};
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
&[data-highlighted] {
|
|
344
|
+
${p} {
|
|
345
|
+
color: ${({
|
|
346
|
+
theme: e
|
|
347
|
+
}) => e.colors.primary600};
|
|
348
|
+
font-weight: bold;
|
|
173
349
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
{
|
|
177
|
-
id: `${a}-clear`,
|
|
178
|
-
"aria-label": G,
|
|
179
|
-
disabled: c,
|
|
180
|
-
paddingLeft: 3,
|
|
181
|
-
as: "button",
|
|
182
|
-
onClick: Ce,
|
|
183
|
-
type: "button"
|
|
184
|
-
},
|
|
185
|
-
/* @__PURE__ */ o.createElement(Ie, null)
|
|
186
|
-
), /* @__PURE__ */ o.createElement(
|
|
187
|
-
Ue,
|
|
188
|
-
{
|
|
189
|
-
disabled: c,
|
|
190
|
-
paddingLeft: 3,
|
|
191
|
-
"aria-hidden": !0,
|
|
192
|
-
as: "button",
|
|
193
|
-
onClick: he,
|
|
194
|
-
tabIndex: -1,
|
|
195
|
-
type: "button"
|
|
196
|
-
},
|
|
197
|
-
/* @__PURE__ */ o.createElement(Oe, null)
|
|
198
|
-
))), /* @__PURE__ */ o.createElement(Te, null), /* @__PURE__ */ o.createElement(Ae, null)), u && /* @__PURE__ */ o.createElement(
|
|
199
|
-
Ne,
|
|
200
|
-
{
|
|
201
|
-
id: `${a}-popover`,
|
|
202
|
-
source: K,
|
|
203
|
-
spacing: 4,
|
|
204
|
-
fullWidth: !0,
|
|
205
|
-
intersectionId: `${a}-listbox-popover-intersection`,
|
|
206
|
-
onReachEnd: Q && !w ? oe : void 0
|
|
207
|
-
},
|
|
208
|
-
/* @__PURE__ */ o.createElement(
|
|
209
|
-
"div",
|
|
210
|
-
{
|
|
211
|
-
role: "listbox",
|
|
212
|
-
ref: ce,
|
|
213
|
-
id: `${a}-listbox`,
|
|
214
|
-
"aria-labelledby": E ? pe : void 0
|
|
215
|
-
},
|
|
216
|
-
(Boolean(l.length) || h) && /* @__PURE__ */ o.createElement(o.Fragment, null, ge, Ee() && h && /* @__PURE__ */ o.createElement(
|
|
217
|
-
ke,
|
|
218
|
-
{
|
|
219
|
-
isSelected: i === l.length,
|
|
220
|
-
ref: (t) => {
|
|
221
|
-
i === l.length && (v.current = t);
|
|
222
|
-
},
|
|
223
|
-
onMouseDown: U,
|
|
224
|
-
onClick: () => L(),
|
|
225
|
-
taindex: 0
|
|
226
|
-
},
|
|
227
|
-
J(r)
|
|
228
|
-
)),
|
|
229
|
-
!l.length && !h && !w && /* @__PURE__ */ o.createElement(Be, { paddingLeft: 4, paddingRight: 4, paddingTop: 2, paddingBottom: 2, ref: v }, /* @__PURE__ */ o.createElement(z, { textColor: "neutral800" }, ee(r))),
|
|
230
|
-
w && /* @__PURE__ */ o.createElement(B, { justifyContent: "center", alignItems: "center", paddingTop: 2, paddingBottom: 2 }, /* @__PURE__ */ o.createElement(Ke, { small: !0 }, Z))
|
|
231
|
-
)
|
|
232
|
-
));
|
|
233
|
-
}, W = (s) => /* @__PURE__ */ o.createElement(I, { ...s, creatable: !0 });
|
|
234
|
-
I.defaultProps = {
|
|
235
|
-
"aria-label": void 0,
|
|
236
|
-
clearLabel: "clear",
|
|
237
|
-
creatable: !1,
|
|
238
|
-
createMessage: (s) => `Create "${s}"`,
|
|
239
|
-
disabled: !1,
|
|
240
|
-
error: void 0,
|
|
241
|
-
hasMoreItems: !1,
|
|
242
|
-
hint: void 0,
|
|
243
|
-
id: void 0,
|
|
244
|
-
label: void 0,
|
|
245
|
-
loading: !1,
|
|
246
|
-
loadingMessage: "Loading content...",
|
|
247
|
-
noOptionsMessage: () => "No results found",
|
|
248
|
-
onClear: void 0,
|
|
249
|
-
onCreateOption: void 0,
|
|
250
|
-
onInputChange: void 0,
|
|
251
|
-
onLoadMore: void 0,
|
|
252
|
-
placeholder: "Select or enter a value",
|
|
253
|
-
value: void 0
|
|
254
|
-
};
|
|
255
|
-
W.defaultProps = I.defaultProps;
|
|
256
|
-
I.propTypes = {
|
|
257
|
-
"aria-label": e.string,
|
|
258
|
-
children: e.oneOfType([e.arrayOf(e.node), e.node]),
|
|
259
|
-
clearLabel: e.string,
|
|
260
|
-
creatable: e.bool,
|
|
261
|
-
createMessage: e.func,
|
|
262
|
-
disabled: e.bool,
|
|
263
|
-
error: e.string,
|
|
264
|
-
hasMoreItems: e.bool,
|
|
265
|
-
id: e.string,
|
|
266
|
-
hint: e.oneOfType([e.string, e.node, e.arrayOf(e.node)]),
|
|
267
|
-
label: e.string,
|
|
268
|
-
labelAction: e.element,
|
|
269
|
-
loading: e.bool,
|
|
270
|
-
loadingMessage: e.string,
|
|
271
|
-
noOptionsMessage: e.func,
|
|
272
|
-
onChange: e.func.isRequired,
|
|
273
|
-
onClear: e.func,
|
|
274
|
-
onCreateOption: e.func,
|
|
275
|
-
onInputChange: e.func,
|
|
276
|
-
onLoadMore: e.func,
|
|
277
|
-
placeholder: e.string,
|
|
278
|
-
value: e.string
|
|
279
|
-
};
|
|
280
|
-
W.propTypes = {
|
|
281
|
-
...I.propTypes,
|
|
282
|
-
onCreateOption: e.func.isRequired
|
|
283
|
-
};
|
|
350
|
+
}
|
|
351
|
+
`;
|
|
284
352
|
export {
|
|
285
|
-
|
|
286
|
-
|
|
353
|
+
he as Combobox,
|
|
354
|
+
ze as CreatableCombobox,
|
|
355
|
+
Le as Option,
|
|
356
|
+
x as OptionBox
|
|
287
357
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),o=({options:t})=>e.jsx(e.Fragment,{children:t});exports.ComboboxList=o;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import r from "
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as r, Fragment as t } from "react/jsx-runtime";
|
|
2
|
+
const m = ({
|
|
3
|
+
options: o
|
|
4
|
+
}) => r(t, {
|
|
5
|
+
children: o
|
|
6
|
+
});
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
+
m as ComboboxList
|
|
8
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./Combobox.cjs"),e=o.Option;exports.ComboboxOption=e;
|