@midas-ds/components 16.8.6 → 17.0.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/accordion/Accordion.d.ts +0 -4
  3. package/accordion/AccordionContext.d.ts +2 -2
  4. package/accordion/index.d.ts +0 -1
  5. package/assets/DateRangePicker.css +1 -1
  6. package/assets/Text.css +1 -1
  7. package/breadcrumbs/Breadcrumbs.d.ts +0 -6
  8. package/breadcrumbs/index.js +1 -1
  9. package/calendar/index.js +1 -1
  10. package/checkbox/index.js +1 -1
  11. package/chunks/Breadcrumb-CHldDcyz.js +37 -0
  12. package/chunks/{CheckboxGroup-DSXCj_ho.js → CheckboxGroup-DooCBqUG.js} +2 -2
  13. package/chunks/ComboBox-XaJDIr5h.js +101 -0
  14. package/chunks/{DateField-zdUv4ooW.js → DateField-6CclHfL2.js} +2 -2
  15. package/chunks/{DateRangePicker-D6lnN0ox.js → DateRangePicker-BoL-sn9u.js} +54 -54
  16. package/chunks/{FieldError-C_3uLAGY.js → FieldError-BMTrvSof.js} +1 -1
  17. package/chunks/ListBoxHeader-CL9bFH22.js +63 -0
  18. package/chunks/ListBoxPopover-DOmhA5xx.js +20 -0
  19. package/chunks/{Radio-Bp-JwJid.js → Radio-CAIyBgBp.js} +2 -2
  20. package/chunks/{RangeCalendar-h9wkh43W.js → RangeCalendar-DIMxoHhy.js} +1 -1
  21. package/chunks/{SearchField-Dcs9LjKo.js → SearchField-aUMEFhOO.js} +1 -1
  22. package/chunks/{Select-w2o-VyrP.js → Select-CzmgPK8V.js} +2 -2
  23. package/chunks/Text-BuXvuoqM.js +36 -0
  24. package/chunks/{TextArea-Bb7H-w23.js → TextArea-B3Z4fA1e.js} +2 -2
  25. package/combobox/ComboBox.d.ts +1 -11
  26. package/combobox/index.d.ts +1 -1
  27. package/combobox/index.js +2 -4
  28. package/date-field/index.js +1 -1
  29. package/date-picker/index.js +1 -1
  30. package/field-error/index.js +1 -1
  31. package/index.d.ts +0 -1
  32. package/index.js +125 -129
  33. package/list-box/ListBoxSection.d.ts +3 -11
  34. package/list-box/index.d.ts +0 -1
  35. package/list-box/index.js +8 -8
  36. package/menu/Menu.d.ts +0 -7
  37. package/package.json +1 -1
  38. package/radio/index.js +1 -1
  39. package/search-field/index.js +1 -1
  40. package/select/index.js +1 -1
  41. package/text/Text.d.ts +0 -8
  42. package/text/Text.stories.d.ts +0 -2
  43. package/text/index.js +1 -1
  44. package/textfield/TextArea.stories.d.ts +4 -4
  45. package/textfield/index.js +1 -1
  46. package/tooltip/Tooltip.d.ts +1 -5
  47. package/tooltip/Tooltip.stories.d.ts +2 -2
  48. package/tooltip/index.d.ts +0 -1
  49. package/assets/Select2.css +0 -1
  50. package/chunks/Breadcrumb-W7qQSxd-.js +0 -70
  51. package/chunks/ComboBox-B7T13rzp.js +0 -109
  52. package/chunks/ListBoxLoadMoreItem-ufPaJaNS.js +0 -41
  53. package/chunks/ListBoxSection-C4y3K7T5.js +0 -49
  54. package/chunks/Select-BYz3DdXs.js +0 -576
  55. package/chunks/Text-Bxww8mmL.js +0 -39
  56. package/legacy-select/HiddenMultiSelect.d.ts +0 -48
  57. package/legacy-select/LegacySelect.stories.d.ts +0 -27
  58. package/legacy-select/MultiSelectValueTag.d.ts +0 -11
  59. package/legacy-select/Select.d.ts +0 -8
  60. package/legacy-select/SelectFieldError.d.ts +0 -8
  61. package/legacy-select/SelectListBox.d.ts +0 -8
  62. package/legacy-select/SelectTrigger.d.ts +0 -10
  63. package/legacy-select/index.d.ts +0 -2
  64. package/legacy-select/index.js +0 -4
  65. package/legacy-select/intl/translations.json.d.ts +0 -17
  66. package/legacy-select/types.d.ts +0 -179
  67. package/legacy-select/useMultiSelect.d.ts +0 -5
  68. package/legacy-select/useMultiSelectListState.d.ts +0 -3
  69. package/legacy-select/useMultiSelectState.d.ts +0 -3
  70. package/list-box/types.d.ts +0 -29
@@ -1,576 +0,0 @@
1
- import { jsx as n, jsxs as h } from "react/jsx-runtime";
2
- import * as w from "react";
3
- import { useMemo as z, useState as V, useCallback as I, useEffect as M, useRef as D } from "react";
4
- import { c as B } from "./clsx-AexbMWKp.js";
5
- import { filterDOMProps as L, mergeProps as x, useId as O, chain as q, useFormReset as N, useObjectRef as R } from "@react-aria/utils";
6
- import { Section as E, Item as C } from "@react-stately/collections";
7
- import { Collection as j, FieldErrorContext as G, TextField as H, TagList as $ } from "react-aria-components";
8
- import { L as W } from "./ListBox-D5BBeZWL.js";
9
- import { c as U, a as X, b as J } from "./ListBoxSection-C4y3K7T5.js";
10
- import { useCollator as Q, useField as Y, useButton as Z } from "react-aria";
11
- import { setInteractionModality as ee } from "@react-aria/interactions";
12
- import { useMenuTrigger as te } from "@react-aria/menu";
13
- import { ListKeyboardDelegate as le, useTypeSelect as oe } from "@react-aria/selection";
14
- import { useMenuTriggerState as ne } from "@react-stately/menu";
15
- import { useFormValidationState as ie } from "@react-stately/form";
16
- import { useListState as re } from "@react-stately/list";
17
- import { a as se, T as ae } from "./Tag-C7VZ0T0o.js";
18
- import { useFormValidation as ce } from "@react-aria/form";
19
- import { useVisuallyHidden as de } from "@react-aria/visually-hidden";
20
- import { a as ue, L as ge } from "./Label-6GZmmff9.js";
21
- import { T as me } from "./Text-Bxww8mmL.js";
22
- import { C as fe } from "./Checkbox-CRLj7_Ox.js";
23
- import { X as pe } from "./x-B9bYxG31.js";
24
- import { u as T } from "./useLocalizedStringFormatter-BHvsRxDk.js";
25
- import { C as ye } from "./chevron-down-BBFYYzZq.js";
26
- import { F as he } from "./FieldError-C_3uLAGY.js";
27
- import '../assets/Select2.css';const A = ({ item: e }) => /* @__PURE__ */ n(
28
- X,
29
- {
30
- ...e.value,
31
- textValue: e.textValue,
32
- "aria-label": e.textValue,
33
- children: e.rendered
34
- }
35
- ), be = ({ section: e, state: t }) => /* @__PURE__ */ n(U, { ...e.value, children: t.collection.getChildren ? /* @__PURE__ */ n(j, { items: t.collection.getChildren(e.key), children: (s) => /* @__PURE__ */ n(A, { item: s }) }) : null }), Se = ({
36
- state: e,
37
- ...t
38
- }) => /* @__PURE__ */ n(
39
- W,
40
- {
41
- ...t,
42
- ...e,
43
- escapeKeyBehavior: "none",
44
- onSelectionChange: e.setSelectedKeys,
45
- items: e.collection,
46
- children: (s) => s.type === "section" ? /* @__PURE__ */ n(
47
- be,
48
- {
49
- state: e,
50
- section: s
51
- }
52
- ) : /* @__PURE__ */ n(A, { item: s })
53
- }
54
- );
55
- function ve(e, t, s) {
56
- const { disallowEmptySelection: r, isDisabled: l } = e, i = Q({ usage: "search", sensitivity: "base" }), o = z(
57
- () => new le(
58
- t.collection,
59
- t.disabledKeys,
60
- null,
61
- i
62
- ),
63
- [t.collection, t.disabledKeys, i]
64
- ), { menuTriggerProps: a, menuProps: d } = te(
65
- {
66
- isDisabled: l,
67
- type: "listbox"
68
- },
69
- t,
70
- s
71
- ), u = (m) => {
72
- const { selectedKeys: v, selectionMode: k } = t, P = v.values().next().value;
73
- if (k === "single")
74
- switch (m.key) {
75
- case "ArrowLeft": {
76
- m.preventDefault();
77
- const S = v.size > 0 ? o.getKeyAbove(P) : o.getFirstKey();
78
- S && t.setSelectedKeys([S]);
79
- break;
80
- }
81
- case "ArrowRight": {
82
- m.preventDefault();
83
- const S = v.size > 0 ? o.getKeyBelow(P) : o.getFirstKey();
84
- S && t.setSelectedKeys([S]);
85
- break;
86
- }
87
- }
88
- }, { typeSelectProps: c } = oe({
89
- keyboardDelegate: o,
90
- selectionManager: t.selectionManager,
91
- onTypeSelect(m) {
92
- t.setSelectedKeys([m]);
93
- }
94
- }), { labelProps: b, fieldProps: p } = Y({
95
- ...e,
96
- labelElementType: "span"
97
- });
98
- c.onKeyDown = c.onKeyDownCapture, delete c.onKeyDownCapture;
99
- const g = L(e, { labelable: !0 }), y = x(c, a, p), K = O();
100
- return {
101
- labelProps: {
102
- ...b,
103
- onClick: () => {
104
- e.isDisabled || (s.current?.focus(), ee("keyboard"));
105
- }
106
- },
107
- triggerProps: x(g, {
108
- ...y,
109
- onKeyDown: q(
110
- y.onKeyDown,
111
- u,
112
- e.onKeyDown
113
- ),
114
- onKeyUp: e.onKeyUp,
115
- "aria-labelledby": [
116
- y["aria-labelledby"],
117
- y["aria-label"] && !y["aria-labelledby"] ? y.id : null,
118
- K
119
- ].filter(Boolean).join(" "),
120
- onFocus(m) {
121
- t.isFocused || (e.onFocus && e.onFocus(m), t.setFocused(!0));
122
- },
123
- onBlur(m) {
124
- t.isOpen || (e.onBlur && e.onBlur(m), t.setFocused(!1));
125
- }
126
- }),
127
- valueProps: {
128
- id: K
129
- },
130
- menuProps: {
131
- ...d,
132
- disallowEmptySelection: r,
133
- autoFocus: t.focusStrategy || !0,
134
- shouldSelectOnPressUp: !0,
135
- shouldFocusOnHover: !0,
136
- onBlur: (m) => {
137
- m.currentTarget.contains(m.relatedTarget) || (e.onBlur && e.onBlur(m), t.setFocused(!1));
138
- },
139
- "aria-labelledby": [
140
- p["aria-labelledby"],
141
- y["aria-label"] && !p["aria-labelledby"] ? y.id : null
142
- ].filter(Boolean).join(" ")
143
- }
144
- };
145
- }
146
- function Ke(e) {
147
- const {
148
- collection: t,
149
- disabledKeys: s,
150
- selectionManager: r,
151
- selectionManager: { setSelectedKeys: l, selectedKeys: i, selectionMode: o }
152
- } = re(e), a = [], d = i.size !== 0 ? Array.from(i).map((u) => {
153
- const c = t.getItem(u);
154
- return c || a.push(u), c;
155
- }).filter(Boolean) : null;
156
- return a.length && console.warn(
157
- `Select: Keys "${a.join(
158
- ", "
159
- )}" passed to "selectedKeys" are not present in the collection.`
160
- ), {
161
- collection: t,
162
- disabledKeys: s,
163
- selectionManager: r,
164
- selectionMode: o,
165
- selectedKeys: i,
166
- setSelectedKeys: l.bind(r),
167
- selectedItems: d
168
- };
169
- }
170
- function Pe(e) {
171
- const [t, s] = V(!1), r = ne(e), l = e.selectionMode === "single", i = Ke({
172
- ...e,
173
- onSelectionChange: (c) => {
174
- e.onSelectionChange && e.onSelectionChange(c), l && r.close();
175
- }
176
- }), o = ie({
177
- ...e,
178
- validationBehavior: "native",
179
- value: i.selectedKeys
180
- }), a = i.collection.size === 0, d = !!i.selectedKeys.size, u = I(() => {
181
- o.resetValidation(), o.commitValidation();
182
- }, [o]);
183
- return M(() => {
184
- l && d && u();
185
- }, [d, l, u]), {
186
- ...i,
187
- ...r,
188
- close() {
189
- r.close(), d && u();
190
- },
191
- open() {
192
- a || r.open();
193
- },
194
- toggle(c) {
195
- a || r.toggle(c);
196
- },
197
- isFocused: t,
198
- setFocused: s,
199
- ...o
200
- };
201
- }
202
- function xe(e, t = {}) {
203
- const [s, r] = V({ width: 0, height: 0 }), l = t.delay === void 0 ? 500 : t.delay, i = !!t.includePadding;
204
- return M(() => {
205
- if (!e) return;
206
- const o = new ResizeObserver(
207
- Ce(([a]) => {
208
- const { inlineSize: d, blockSize: u } = i ? a.borderBoxSize[0] : a.contentBoxSize[0];
209
- r({ width: d, height: u });
210
- }, l)
211
- );
212
- return o.observe(e), () => {
213
- o.disconnect();
214
- };
215
- }, [l, e, i]), s;
216
- }
217
- function Ce(e, t) {
218
- let s;
219
- return (r, l) => {
220
- clearTimeout(s), s = setTimeout(() => {
221
- e(r, l);
222
- }, t);
223
- };
224
- }
225
- function _e({
226
- autoComplete: e,
227
- name: t,
228
- isDisabled: s,
229
- isRequired: r,
230
- selectRef: l
231
- }, i, o) {
232
- const { visuallyHiddenProps: a } = de();
233
- return N(l, i.selectedKeys, i.setSelectedKeys), ce(
234
- {
235
- validationBehavior: "native",
236
- focus: () => o.current?.focus()
237
- },
238
- i,
239
- l
240
- ), {
241
- containerProps: {
242
- ...a,
243
- "aria-hidden": !0,
244
- // @ts-expect-error - data-a11y-ignore is not a standard attribute
245
- "data-react-aria-prevent-focus": !0,
246
- "data-a11y-ignore": "aria-hidden-focus"
247
- },
248
- inputProps: {
249
- style: { display: "none" }
250
- },
251
- selectProps: {
252
- tabIndex: -1,
253
- autoComplete: e,
254
- disabled: s,
255
- required: r,
256
- name: t,
257
- value: Array.from(i.selectedKeys).map((d) => d.toString()),
258
- onChange: (d) => i.setSelectedKeys(d.target.value),
259
- multiple: !0
260
- }
261
- };
262
- }
263
- function we(e) {
264
- const { state: t, triggerRef: s, name: r, isDisabled: l } = e, i = `${e.label}-hidden`, o = D(null), { containerProps: a, selectProps: d } = _e(
265
- { ...e, selectRef: o },
266
- t,
267
- s
268
- );
269
- return t.collection.size <= 300 ? /* @__PURE__ */ n(
270
- "div",
271
- {
272
- ...a,
273
- "data-testid": "hidden-select-container",
274
- children: /* @__PURE__ */ h("label", { children: [
275
- i,
276
- /* @__PURE__ */ h(
277
- "select",
278
- {
279
- ...d,
280
- ref: o,
281
- children: [
282
- /* @__PURE__ */ n("option", {}),
283
- [...t.collection.getKeys()].map((u) => {
284
- const c = t.collection.getItem(u);
285
- return c && c.type === "item" ? /* @__PURE__ */ n(
286
- "option",
287
- {
288
- value: c.key,
289
- children: c.textValue
290
- },
291
- c.key
292
- ) : null;
293
- })
294
- ]
295
- }
296
- )
297
- ] })
298
- }
299
- ) : r ? /* @__PURE__ */ n(
300
- "input",
301
- {
302
- type: "hidden",
303
- autoComplete: d.autoComplete,
304
- name: r,
305
- disabled: l,
306
- value: Array.from(t.selectedKeys).map((u) => u.toString()) ?? [""]
307
- }
308
- ) : null;
309
- }
310
- const Ve = "_wrapper_odqg7_1", Me = "_trigger_odqg7_12", Be = "_medium_odqg7_26", Te = "_icon_odqg7_62", Ae = "_tagGroup_odqg7_68", Fe = "_triggerContainer_odqg7_89", ke = "_selectValueTag_odqg7_95", ze = "_clearButton_odqg7_111", Ie = "_truncate_odqg7_123", De = "_selectAll_odqg7_166", f = {
311
- wrapper: Ve,
312
- trigger: Me,
313
- medium: Be,
314
- icon: Te,
315
- tagGroup: Ae,
316
- triggerContainer: Fe,
317
- selectValueTag: ke,
318
- clearButton: ze,
319
- truncate: Ie,
320
- selectAll: De
321
- }, Le = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Selected items", chosen: "chosen" }, Oe = { clearAll: "Rensa alla", selectAll: "Välj alla", selectedItems: "Valda objekt", chosen: "valda" }, F = {
322
- en: Le,
323
- sv: Oe
324
- }, qe = ({
325
- state: { selectedItems: e },
326
- isDisabled: t,
327
- parentWidth: s,
328
- onClear: r,
329
- triggerRef: l,
330
- isClearable: i
331
- }) => {
332
- const o = T(F);
333
- return /* @__PURE__ */ h(
334
- "div",
335
- {
336
- className: f.selectValueTag,
337
- "data-disabled": t || void 0,
338
- children: [
339
- /* @__PURE__ */ n(
340
- "span",
341
- {
342
- className: f.truncate,
343
- style: { maxWidth: s - 92 },
344
- children: e?.length && e.length > 1 ? `${e.length} ${o.format("chosen")}` : e?.[0].textValue
345
- }
346
- ),
347
- i && /* @__PURE__ */ n(
348
- "button",
349
- {
350
- disabled: t,
351
- "aria-label": o.format("clearAll"),
352
- className: f.clearButton,
353
- onClick: () => {
354
- r(), l?.current?.focus();
355
- },
356
- children: /* @__PURE__ */ n(
357
- pe,
358
- {
359
- width: 20,
360
- height: 20
361
- }
362
- )
363
- }
364
- )
365
- ]
366
- }
367
- );
368
- }, Ne = ({
369
- autoFocus: e,
370
- excludeFromTabOrder: t,
371
- isDisabled: s,
372
- size: r = "large",
373
- isOpen: l,
374
- isInvalid: i,
375
- selectionMode: o,
376
- state: { selectedItems: a },
377
- placeholder: d,
378
- children: u,
379
- triggerRef: c,
380
- ...b
381
- }) => {
382
- const { buttonProps: p } = Z(
383
- { autoFocus: e, excludeFromTabOrder: t, isDisabled: s, ...b },
384
- c
385
- ), g = o === "multiple";
386
- return /* @__PURE__ */ h(
387
- "div",
388
- {
389
- className: f.triggerContainer,
390
- "data-disabled": s || void 0,
391
- children: [
392
- /* @__PURE__ */ h(
393
- "button",
394
- {
395
- ...p,
396
- autoFocus: e,
397
- className: B(f.trigger, {
398
- [f.medium]: r === "medium"
399
- }),
400
- "data-disabled": s || void 0,
401
- "data-invalid": i || void 0,
402
- "data-open": l || void 0,
403
- ref: c,
404
- type: "button",
405
- children: [
406
- g && !a ? /* @__PURE__ */ n("span", { children: d }) : null,
407
- g ? null : /* @__PURE__ */ n("span", { children: a ? a[0].textValue : d }),
408
- /* @__PURE__ */ n(
409
- "div",
410
- {
411
- className: f.icon,
412
- "aria-hidden": "true",
413
- children: /* @__PURE__ */ n(ye, { size: 20 })
414
- }
415
- )
416
- ]
417
- }
418
- ),
419
- u
420
- ]
421
- }
422
- );
423
- }, _ = ({
424
- state: e,
425
- errorMessage: t
426
- }) => /* @__PURE__ */ n(G.Provider, { value: { ...e.displayValidation }, children: /* @__PURE__ */ n(he, { children: t }) }), Re = w.forwardRef(
427
- ({ isClearable: e = !0, popover: t, ...s }, r) => {
428
- const l = {
429
- selectionMode: "single",
430
- errorPosition: "top",
431
- disallowEmptySelection: !e,
432
- isClearable: e,
433
- size: "large",
434
- popover: t,
435
- ...s
436
- }, i = R(r), o = Pe(l), a = T(F), { labelProps: d, triggerProps: u, valueProps: c, menuProps: b } = ve(
437
- l,
438
- o,
439
- i
440
- ), { width: p } = xe(i.current, {
441
- includePadding: !0
442
- });
443
- return /* @__PURE__ */ h(
444
- H,
445
- {
446
- ...l,
447
- className: B(f.wrapper, l.className),
448
- children: [
449
- /* @__PURE__ */ n(
450
- we,
451
- {
452
- ...l,
453
- state: o,
454
- triggerRef: i
455
- }
456
- ),
457
- /* @__PURE__ */ n(ue, { popover: t, children: l.label && /* @__PURE__ */ n(
458
- ge,
459
- {
460
- ...d,
461
- "data-disabled": l.isDisabled || void 0,
462
- children: l.label
463
- }
464
- ) }),
465
- l.description && /* @__PURE__ */ n(me, { slot: "description", children: l.description }),
466
- l.errorPosition === "top" && /* @__PURE__ */ n(
467
- _,
468
- {
469
- ...l,
470
- state: o
471
- }
472
- ),
473
- /* @__PURE__ */ n(
474
- Ne,
475
- {
476
- ...l,
477
- ...u,
478
- isInvalid: o.displayValidation.isInvalid,
479
- triggerRef: i,
480
- state: o,
481
- children: l.selectionMode === "multiple" && o.selectedItems ? /* @__PURE__ */ n("span", { ...c, children: /* @__PURE__ */ n(
482
- qe,
483
- {
484
- ...l,
485
- state: o,
486
- parentWidth: p,
487
- onClear: () => o.selectionManager.clearSelection(),
488
- triggerRef: i
489
- }
490
- ) }) : null
491
- }
492
- ),
493
- l.errorPosition === "bottom" && /* @__PURE__ */ n(
494
- _,
495
- {
496
- ...l,
497
- state: o
498
- }
499
- ),
500
- /* @__PURE__ */ h(
501
- J,
502
- {
503
- isOpen: o.isOpen,
504
- onOpenChange: (g) => {
505
- g || o.close();
506
- },
507
- triggerRef: i,
508
- style: { width: p },
509
- children: [
510
- l.isSelectableAll && /* @__PURE__ */ n(
511
- fe,
512
- {
513
- isSelected: o.selectionManager.isSelectAll,
514
- isIndeterminate: !o.selectionManager.isSelectAll && !o.selectionManager.isEmpty,
515
- className: f.selectAll,
516
- onChange: () => o.selectionManager.toggleSelectAll(),
517
- children: a.format("selectAll")
518
- }
519
- ),
520
- /* @__PURE__ */ n(
521
- Se,
522
- {
523
- ...b,
524
- state: o
525
- }
526
- )
527
- ]
528
- }
529
- ),
530
- l.showTags && !!o.selectedItems && /* @__PURE__ */ n(
531
- se,
532
- {
533
- "aria-label": a.format("selectedItems"),
534
- selectionBehavior: "toggle",
535
- onRemove: (g) => o.selectionManager.toggleSelection(Array.from(g)[0]),
536
- className: f.tagGroup,
537
- children: /* @__PURE__ */ n($, { items: o.selectedItems, children: (g) => /* @__PURE__ */ n(
538
- ae,
539
- {
540
- textValue: g.textValue,
541
- id: g.key,
542
- dismissable: !0,
543
- isDisabled: l.isDisabled,
544
- children: g.textValue
545
- },
546
- g.key
547
- ) })
548
- }
549
- )
550
- ]
551
- }
552
- );
553
- }
554
- ), Ee = w.forwardRef(
555
- ({ options: e, ...t }, s) => /* @__PURE__ */ n(
556
- Re,
557
- {
558
- ...t,
559
- items: e,
560
- ref: s,
561
- children: (r) => r.children ? /* @__PURE__ */ n(
562
- E,
563
- {
564
- items: r.children,
565
- title: r.name,
566
- children: (l) => /* @__PURE__ */ n(C, { textValue: l.textValue, children: l.name })
567
- },
568
- String(r.name)
569
- ) : /* @__PURE__ */ n(C, { textValue: r.textValue, children: r.name })
570
- }
571
- )
572
- );
573
- Ee.displayName = "Select";
574
- export {
575
- Ee as S
576
- };
@@ -1,39 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { c as _ } from "./clsx-AexbMWKp.js";
3
- import { Text as b } from "react-aria-components";
4
- import '../assets/Text.css';const m = "_body_fvsa7_1", p = "_description_fvsa7_5", f = "_bold_fvsa7_42", y = "_italic_fvsa7_46", s = {
5
- body: m,
6
- "body-01": "_body-01_fvsa7_2",
7
- "body-02": "_body-02_fvsa7_3",
8
- "body-small": "_body-small_fvsa7_4",
9
- description: p,
10
- "description-small": "_description-small_fvsa7_6",
11
- bold: f,
12
- italic: y
13
- }, a = "span", N = ({
14
- children: d,
15
- className: c,
16
- size: t,
17
- variant: i,
18
- isExpressive: r = !1,
19
- elementType: o = a,
20
- ...l
21
- }) => {
22
- const e = {
23
- className: _(
24
- i === "body-01" ? s["body-01"] : i === "body-02" ? s["body-02"] : l.slot === "description" ? t === "small" ? s["description-small"] : s.description : t === "small" ? s["body-small"] : s.body,
25
- {
26
- [s.bold]: ["b", "strong"].includes(o),
27
- [s.italic]: ["i", "em"].includes(o)
28
- },
29
- c
30
- ),
31
- elementType: o || a,
32
- ...r && { "data-expressive": !0 },
33
- ...l
34
- };
35
- return /* @__PURE__ */ n(b, { ...e, children: d });
36
- };
37
- export {
38
- N as T
39
- };
@@ -1,48 +0,0 @@
1
- import { FocusableElement } from '@react-types/shared';
2
- import { default as React, ReactNode, RefObject } from 'react';
3
- import { MultiSelectState } from './types';
4
- import { ListBoxOption } from '../list-box';
5
- export interface AriaHiddenMultiSelectProps {
6
- /**
7
- * Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).
8
- */
9
- autoComplete?: string;
10
- /** The text label for the select. */
11
- label?: ReactNode;
12
- /** HTML form input name. */
13
- name?: string;
14
- /** Sets the disabled state of the select and input. */
15
- isDisabled?: boolean;
16
- /** Sets the required state of the select and input. */
17
- isRequired?: boolean;
18
- }
19
- export interface HiddenMultiSelectProps<T extends ListBoxOption> extends AriaHiddenMultiSelectProps {
20
- /** State for the select. */
21
- state: MultiSelectState<T>;
22
- /** A ref to the trigger element. */
23
- triggerRef: RefObject<FocusableElement | null>;
24
- }
25
- interface AriaHiddenMultiSelectOptions extends AriaHiddenMultiSelectProps {
26
- /** A ref to the hidden `<select>` element. */
27
- selectRef?: RefObject<HTMLSelectElement | null>;
28
- }
29
- interface HiddenMultiSelectAria {
30
- /** Props for the container element. */
31
- containerProps: React.HTMLAttributes<FocusableElement>;
32
- /** Props for the hidden input element. */
33
- inputProps: React.InputHTMLAttributes<HTMLInputElement>;
34
- /** Props for the hidden select element. */
35
- selectProps: React.SelectHTMLAttributes<HTMLSelectElement>;
36
- }
37
- /**
38
- * Provides the behavior and accessibility implementation for a hidden `<select>` element, which
39
- * can be used in combination with `useSelect` to support browser form autofill, mobile form
40
- * navigation, and native HTML form submission.
41
- */
42
- export declare function useHiddenMultiSelect<T extends ListBoxOption>({ autoComplete, name, isDisabled, isRequired, selectRef, }: AriaHiddenMultiSelectOptions, state: MultiSelectState<T>, triggerRef: RefObject<FocusableElement | null>): HiddenMultiSelectAria;
43
- /**
44
- * Renders a hidden native `<select>` element, which can be used to support browser
45
- * form autofill, mobile form navigation, and native form submission.
46
- */
47
- export declare function HiddenMultiSelect<T extends ListBoxOption>(props: HiddenMultiSelectProps<T>): import("react/jsx-runtime").JSX.Element | null;
48
- export {};
@@ -1,27 +0,0 @@
1
- import { StoryObj } from '@storybook/react-vite';
2
- import { LegacySelect } from '.';
3
- type Story = StoryObj<typeof LegacySelect>;
4
- declare const _default: {
5
- component: import('react').ForwardRefExoticComponent<Omit<import('./types').SelectProps, "children" | "items"> & {
6
- options: import('..').ListBoxOption[];
7
- } & import('react').RefAttributes<HTMLButtonElement>>;
8
- title: string;
9
- tags: string[];
10
- args: {
11
- description: string;
12
- isDisabled: false;
13
- isSelectableAll: false;
14
- label: string;
15
- options: {
16
- id: import('react-aria').Key;
17
- name: string;
18
- }[];
19
- placeholder: string;
20
- selectionMode: "single";
21
- showTags: false;
22
- errorPosition: "top";
23
- size: "large";
24
- };
25
- };
26
- export default _default;
27
- export declare const Primary: Story;
@@ -1,11 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { MultiSelectState, SelectProps } from './types';
3
- import { ListBoxOption } from '../list-box';
4
- interface MultiSelectValueTagProps extends SelectProps {
5
- state: MultiSelectState<ListBoxOption>;
6
- parentWidth: number;
7
- onClear: () => void;
8
- triggerRef: RefObject<HTMLButtonElement | null>;
9
- }
10
- export declare const MultiSelectValueTag: ({ state: { selectedItems: items }, isDisabled, parentWidth, onClear, triggerRef, isClearable, }: MultiSelectValueTagProps) => import("react/jsx-runtime").JSX.Element;
11
- export {};