@midas-ds/components 15.4.0 → 15.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/accordion/AccordionItem.d.ts +5 -0
  3. package/accordion/index.js +1 -1
  4. package/badge/index.js +1 -1
  5. package/breadcrumbs/index.js +1 -1
  6. package/button/index.js +2 -2
  7. package/calendar/index.js +1 -1
  8. package/card/index.js +1 -1
  9. package/character-counter/index.js +1 -1
  10. package/checkbox/index.js +2 -2
  11. package/chunks/AccordionItem-BDkCTxFM.js +132 -0
  12. package/chunks/{BadgeContainer-BJAC-kV0.js → BadgeContainer-CKVsfTlF.js} +1 -1
  13. package/chunks/Breadcrumbs-By2bMbQd.js +28 -0
  14. package/chunks/Button-DbQwg49l.js +46 -0
  15. package/chunks/{ButtonGroup-B6mr4JGY.js → ButtonGroup-Dr6HOBo2.js} +1 -1
  16. package/chunks/Card-ia98VoKL.js +130 -0
  17. package/chunks/CharacterCounter-DeuE2det.js +21 -0
  18. package/chunks/Checkbox-ClhO-AzB.js +122 -0
  19. package/chunks/CheckboxGroup-CIFMaanI.js +84 -0
  20. package/chunks/{ColorSchemeSwitch-Cd6VSXql.js → ColorSchemeSwitch-DugvPh6T.js} +17 -17
  21. package/chunks/ComboBox-D86agoIk.js +108 -0
  22. package/chunks/DateField-CdJdPIuj.js +46 -0
  23. package/chunks/DateInputDivider-CkTB5q5k.js +36 -0
  24. package/chunks/DateRangePicker-p0l1tSMb.js +117 -0
  25. package/chunks/Dialog-BndmKdiv.js +66 -0
  26. package/chunks/Dropdown-CWP2clB2.js +79 -0
  27. package/chunks/FeedbackStatusIcon-COWuMusk.js +56 -0
  28. package/chunks/FieldError-C0HRIcAx.js +23 -0
  29. package/chunks/FileUpload-h1PxqQmb.js +16 -0
  30. package/chunks/{Grid-DeB7TdcZ.js → Grid-B-WgMwON.js} +2 -2
  31. package/chunks/{GridItem-B_3FFhPs.js → GridItem-5t1Z14sM.js} +1 -1
  32. package/chunks/Heading-D8tNNJkt.js +38 -0
  33. package/chunks/InfoBanner-tXWNVxpu.js +72 -0
  34. package/chunks/Label-B7taTXkd.js +73 -0
  35. package/chunks/{Layout-InD0Hl7F.js → Layout-DPRkHK4y.js} +70 -70
  36. package/chunks/Link-yTNUNv3C.js +54 -0
  37. package/chunks/LinkButton-3nAekUJ4.js +63 -0
  38. package/chunks/{ListBox-CKDglhFH.js → ListBox-D4tO_OrO.js} +18 -18
  39. package/chunks/ListBoxLoadMoreItem-BKptRAtt.js +41 -0
  40. package/chunks/ListBoxSection-DKHba2X0.js +49 -0
  41. package/chunks/{Logo-D80UDT1x.js → Logo-InDSslpO.js} +2 -2
  42. package/chunks/Popover-BAdqdN6C.js +38 -0
  43. package/chunks/ProgressBar-B2W7BTjA.js +53 -0
  44. package/chunks/Radio-BzuxVV_g.js +43 -0
  45. package/chunks/RangeCalendar-CuXHsT-k.js +99 -0
  46. package/chunks/{SearchField-Dr3DAs9W.js → SearchField-CLrAjcdA.js} +39 -39
  47. package/chunks/{Select-fDRXxmLm.js → Select-C-0lWpoz.js} +48 -46
  48. package/chunks/Select-CzfIyTE7.js +576 -0
  49. package/chunks/Separator-BcnQEA9f.js +76 -0
  50. package/chunks/{Skeleton-Bcg_xgAx.js → Skeleton-DqIHQLQl.js} +1 -1
  51. package/chunks/Spinner-CL9evrHm.js +49 -0
  52. package/chunks/TabList-D2XV5ixe.js +81 -0
  53. package/chunks/Table-B1rlSIhS.js +139 -0
  54. package/chunks/Tag-CEfQksg8.js +53 -0
  55. package/chunks/{Text-WP6RbnnK.js → Text-TWzJxnto.js} +9 -9
  56. package/chunks/TextArea-34YgkUEE.js +124 -0
  57. package/chunks/{Toast-CP_V12b3.js → Toast-CCA9sCnB.js} +46 -45
  58. package/chunks/ToggleButtonGroup-CXKTrLbb.js +29 -0
  59. package/chunks/Tooltip-CtstfI8u.js +46 -0
  60. package/chunks/clsx-AexbMWKp.js +24 -0
  61. package/chunks/useLocalizedStringFormatter-ZgRJmvHC.js +25 -0
  62. package/color-scheme-switch/index.js +1 -1
  63. package/combobox/index.js +1 -1
  64. package/common/FeedbackStatusIcon.d.ts +6 -0
  65. package/common/intl/translations.json.d.ts +17 -0
  66. package/date-field/index.js +2 -2
  67. package/date-picker/index.js +1 -1
  68. package/dropdown/index.js +1 -1
  69. package/field-error/index.js +1 -1
  70. package/file-upload/index.js +1 -1
  71. package/grid/index.js +2 -2
  72. package/heading/index.js +1 -1
  73. package/index.js +68 -68
  74. package/info-banner/index.js +1 -1
  75. package/label/index.js +1 -1
  76. package/layout/index.js +1 -1
  77. package/legacy-select/index.js +1 -1
  78. package/link/index.js +3 -3
  79. package/link-button/index.js +3 -3
  80. package/list-box/index.js +3 -3
  81. package/logo/index.js +1 -1
  82. package/menu/index.js +5 -5
  83. package/modal/index.js +2 -2
  84. package/package.json +2 -3
  85. package/popover/index.js +1 -1
  86. package/progress-bar/index.js +1 -1
  87. package/radio/index.js +1 -1
  88. package/search-field/index.js +1 -1
  89. package/select/index.js +1 -1
  90. package/skeleton/index.js +1 -1
  91. package/spinner/index.js +1 -1
  92. package/table/index.js +1 -1
  93. package/tabs/index.js +1 -1
  94. package/tag/index.js +1 -1
  95. package/text/index.js +1 -1
  96. package/textfield/index.js +1 -1
  97. package/toast/Toast.d.ts +1 -1
  98. package/toast/index.js +1 -1
  99. package/toggle-button/index.js +1 -1
  100. package/tooltip/index.js +1 -1
  101. package/chunks/AccordionItem-BCoomT4-.js +0 -132
  102. package/chunks/Breadcrumbs-CnuqEeOL.js +0 -28
  103. package/chunks/Button-CHs1wv7n.js +0 -46
  104. package/chunks/Card-D58EJCcV.js +0 -130
  105. package/chunks/CharacterCounter-CzCvDmNP.js +0 -21
  106. package/chunks/Checkbox-CogzFDe3.js +0 -119
  107. package/chunks/CheckboxGroup-BLx25gqn.js +0 -83
  108. package/chunks/ComboBox-8YAwADqL.js +0 -108
  109. package/chunks/DateField-CpbYROK1.js +0 -46
  110. package/chunks/DateInputDivider-C43xP4is.js +0 -36
  111. package/chunks/DateRangePicker-CICkmtXG.js +0 -116
  112. package/chunks/Dialog-DBn9L3SP.js +0 -66
  113. package/chunks/Dropdown-Cctv2Qpv.js +0 -79
  114. package/chunks/FieldError-CZKAYQ-n.js +0 -23
  115. package/chunks/FileUpload-DILt4rAn.js +0 -16
  116. package/chunks/Heading-DIw3iLMN.js +0 -38
  117. package/chunks/InfoBanner-Bw3rjGtB.js +0 -72
  118. package/chunks/Label-CKe9pgXT.js +0 -73
  119. package/chunks/Link-C3w5O2wT.js +0 -54
  120. package/chunks/LinkButton-D6X0Dvoz.js +0 -63
  121. package/chunks/ListBoxLoadMoreItem-y9pCuqRe.js +0 -41
  122. package/chunks/ListBoxSection-CvtRigQb.js +0 -49
  123. package/chunks/Popover-DktRiuCr.js +0 -38
  124. package/chunks/ProgressBar-Bjxi5TgY.js +0 -53
  125. package/chunks/Radio-DqFFcFra.js +0 -43
  126. package/chunks/RangeCalendar-CIxwICEf.js +0 -99
  127. package/chunks/Select-BSqv5Qi-.js +0 -566
  128. package/chunks/Separator-Cw1vlSYO.js +0 -76
  129. package/chunks/Spinner-B2EAm49Z.js +0 -48
  130. package/chunks/TabList-BIBQcX2n.js +0 -81
  131. package/chunks/Table-Cy-R3Ma8.js +0 -139
  132. package/chunks/Tag-BZnq1_yZ.js +0 -53
  133. package/chunks/TextArea-3fPkKmNx.js +0 -124
  134. package/chunks/ToggleButtonGroup-CgNeypuW.js +0 -29
  135. package/chunks/Tooltip-C53p0sfk.js +0 -46
  136. package/chunks/clsx-CuNqTHjr.js +0 -11
  137. package/chunks/icon-map-Ckc-nEUA.js +0 -31
  138. package/chunks/internationalized-C9snpc7V.js +0 -1955
  139. package/chunks/react-aria-components-mIKW9wOa.js +0 -22645
  140. package/chunks/react-stately-DRNKkAB0.js +0 -2586
  141. package/chunks/useLocalizedStringFormatter-CPwiI7nv.js +0 -25
  142. package/chunks/variables-BkqZ2WGF.js +0 -5
  143. package/common/icon-map.d.ts +0 -6
@@ -0,0 +1,576 @@
1
+ import { jsx as n, jsxs as h } from "react/jsx-runtime";
2
+ import * as _ from "react";
3
+ import { useMemo as z, useState as V, useCallback as I, useEffect as M, useRef as L } from "react";
4
+ import { c as B } from "./clsx-AexbMWKp.js";
5
+ import { filterDOMProps as D, mergeProps as P, useId as O, chain as N, useFormReset as R, useObjectRef as E } from "@react-aria/utils";
6
+ import { Section as j, Item as x } from "@react-stately/collections";
7
+ import { Collection as G, FieldErrorContext as H, TextField as $, TagList as W } from "react-aria-components";
8
+ import { L as U } from "./ListBox-D4tO_OrO.js";
9
+ import { b as q, L as X, a as J } from "./ListBoxSection-DKHba2X0.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-CEfQksg8.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 me } from "./Label-B7taTXkd.js";
21
+ import { T as ge } from "./Text-TWzJxnto.js";
22
+ import { C as fe } from "./Checkbox-ClhO-AzB.js";
23
+ import { X as pe } from "./x-BXShoIAM.js";
24
+ import { u as T } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
25
+ import { C as ye } from "./chevron-down-DgT-uSF9.js";
26
+ import { F as he } from "./FieldError-C0HRIcAx.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(q, { ...e.value, children: t.collection.getChildren ? /* @__PURE__ */ n(G, { items: t.collection.getChildren(e.key), children: (s) => /* @__PURE__ */ n(A, { item: s }) }) : null }), Se = ({
36
+ state: e,
37
+ ...t
38
+ }) => /* @__PURE__ */ n(
39
+ U,
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 = (g) => {
72
+ const { selectedKeys: v, selectionMode: k } = t, K = v.values().next().value;
73
+ if (k === "single")
74
+ switch (g.key) {
75
+ case "ArrowLeft": {
76
+ g.preventDefault();
77
+ const S = v.size > 0 ? o.getKeyAbove(K) : o.getFirstKey();
78
+ S && t.setSelectedKeys([S]);
79
+ break;
80
+ }
81
+ case "ArrowRight": {
82
+ g.preventDefault();
83
+ const S = v.size > 0 ? o.getKeyBelow(K) : o.getFirstKey();
84
+ S && t.setSelectedKeys([S]);
85
+ break;
86
+ }
87
+ }
88
+ }, { typeSelectProps: c } = oe({
89
+ keyboardDelegate: o,
90
+ selectionManager: t.selectionManager,
91
+ onTypeSelect(g) {
92
+ t.setSelectedKeys([g]);
93
+ }
94
+ }), { labelProps: b, fieldProps: p } = Y({
95
+ ...e,
96
+ labelElementType: "span"
97
+ });
98
+ c.onKeyDown = c.onKeyDownCapture, delete c.onKeyDownCapture;
99
+ const m = D(e, { labelable: !0 }), y = P(c, a, p), w = O();
100
+ return {
101
+ labelProps: {
102
+ ...b,
103
+ onClick: () => {
104
+ e.isDisabled || (s.current?.focus(), ee("keyboard"));
105
+ }
106
+ },
107
+ triggerProps: P(m, {
108
+ ...y,
109
+ onKeyDown: N(
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
+ w
119
+ ].filter(Boolean).join(" "),
120
+ onFocus(g) {
121
+ t.isFocused || (e.onFocus && e.onFocus(g), t.setFocused(!0));
122
+ },
123
+ onBlur(g) {
124
+ t.isOpen || (e.onBlur && e.onBlur(g), t.setFocused(!1));
125
+ }
126
+ }),
127
+ valueProps: {
128
+ id: w
129
+ },
130
+ menuProps: {
131
+ ...d,
132
+ disallowEmptySelection: r,
133
+ autoFocus: t.focusStrategy || !0,
134
+ shouldSelectOnPressUp: !0,
135
+ shouldFocusOnHover: !0,
136
+ onBlur: (g) => {
137
+ g.currentTarget.contains(g.relatedTarget) || (e.onBlur && e.onBlur(g), 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 we(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 Ke(e) {
171
+ const [t, s] = V(!1), r = ne(e), l = e.selectionMode === "single", i = we({
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 Pe(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
+ xe(([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 xe(e, t) {
218
+ let s;
219
+ return (r, l) => {
220
+ clearTimeout(s), s = setTimeout(() => {
221
+ e(r, l);
222
+ }, t);
223
+ };
224
+ }
225
+ function Ce({
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 R(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 _e(e) {
264
+ const { state: t, triggerRef: s, name: r, isDisabled: l } = e, i = `${e.label}-hidden`, o = L(null), { containerProps: a, selectProps: d } = Ce(
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_1rw0v_7", Me = "_trigger_1rw0v_18", Be = "_medium_1rw0v_32", Te = "_icon_1rw0v_68", Ae = "_tagGroup_1rw0v_74", Fe = "_triggerContainer_1rw0v_95", ke = "_selectValueTag_1rw0v_101", ze = "_clearButton_1rw0v_117", Ie = "_truncate_1rw0v_129", Le = "_selectAll_1rw0v_172", 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: Le
321
+ }, De = { 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: De,
323
+ sv: Oe
324
+ }, Ne = ({
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
+ }, Re = ({
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
+ ), m = 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
+ m && !a ? /* @__PURE__ */ n("span", { children: d }) : null,
407
+ m ? 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
+ }, C = ({
424
+ state: e,
425
+ errorMessage: t
426
+ }) => /* @__PURE__ */ n(H.Provider, { value: { ...e.displayValidation }, children: /* @__PURE__ */ n(he, { children: t }) }), Ee = _.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 = E(r), o = Ke(l), a = T(F), { labelProps: d, triggerProps: u, valueProps: c, menuProps: b } = ve(
437
+ l,
438
+ o,
439
+ i
440
+ ), { width: p } = Pe(i.current, {
441
+ includePadding: !0
442
+ });
443
+ return /* @__PURE__ */ h(
444
+ $,
445
+ {
446
+ ...l,
447
+ className: B(f.wrapper, l.className),
448
+ children: [
449
+ /* @__PURE__ */ n(
450
+ _e,
451
+ {
452
+ ...l,
453
+ state: o,
454
+ triggerRef: i
455
+ }
456
+ ),
457
+ /* @__PURE__ */ n(ue, { popover: t, children: l.label && /* @__PURE__ */ n(
458
+ me,
459
+ {
460
+ ...d,
461
+ "data-disabled": l.isDisabled || void 0,
462
+ children: l.label
463
+ }
464
+ ) }),
465
+ l.description && /* @__PURE__ */ n(ge, { slot: "description", children: l.description }),
466
+ l.errorPosition === "top" && /* @__PURE__ */ n(
467
+ C,
468
+ {
469
+ ...l,
470
+ state: o
471
+ }
472
+ ),
473
+ /* @__PURE__ */ n(
474
+ Re,
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
+ Ne,
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
+ C,
495
+ {
496
+ ...l,
497
+ state: o
498
+ }
499
+ ),
500
+ /* @__PURE__ */ h(
501
+ J,
502
+ {
503
+ isOpen: o.isOpen,
504
+ onOpenChange: (m) => {
505
+ m || 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: (m) => o.selectionManager.toggleSelection(Array.from(m)[0]),
536
+ className: f.tagGroup,
537
+ children: /* @__PURE__ */ n(W, { items: o.selectedItems, children: (m) => /* @__PURE__ */ n(
538
+ ae,
539
+ {
540
+ textValue: m.textValue,
541
+ id: m.key,
542
+ dismissable: !0,
543
+ isDisabled: l.isDisabled,
544
+ children: m.textValue
545
+ },
546
+ m.key
547
+ ) })
548
+ }
549
+ )
550
+ ]
551
+ }
552
+ );
553
+ }
554
+ ), je = _.forwardRef(
555
+ ({ options: e, ...t }, s) => /* @__PURE__ */ n(
556
+ Ee,
557
+ {
558
+ ...t,
559
+ items: e,
560
+ ref: s,
561
+ children: (r) => r.children ? /* @__PURE__ */ n(
562
+ j,
563
+ {
564
+ items: r.children,
565
+ title: r.name,
566
+ children: (l) => /* @__PURE__ */ n(x, { textValue: l.textValue, children: l.name })
567
+ },
568
+ r.name
569
+ ) : /* @__PURE__ */ n(x, { textValue: r.textValue, children: r.name })
570
+ }
571
+ )
572
+ );
573
+ je.displayName = "Select";
574
+ export {
575
+ je as S
576
+ };
@@ -0,0 +1,76 @@
1
+ import { jsx as t, jsxs as r, Fragment as i } from "react/jsx-runtime";
2
+ import { Menu as _, MenuItem as l, Popover as d, MenuSection as k, Separator as M } from "react-aria-components";
3
+ import { c as m } from "./clsx-AexbMWKp.js";
4
+ import { C as h } from "./check-BxlvVsvD.js";
5
+ import { C as S } from "./chevron-right-GpyqdYK4.js";
6
+ import '../assets/Separator.css';const f = "_menu_1ku97_1", p = "_menuSection_1ku97_17", v = "_medium_1ku97_29", C = "_menuItem_1ku97_35", N = "_mainContent_1ku97_105", I = "_checkMark_1ku97_116", x = "_separator_1ku97_126", P = "_menuPopover_1ku97_149", o = {
7
+ menu: f,
8
+ menuSection: p,
9
+ medium: v,
10
+ menuItem: C,
11
+ mainContent: N,
12
+ checkMark: I,
13
+ separator: x,
14
+ menuPopover: P
15
+ }, z = ({
16
+ className: e,
17
+ size: n = "large",
18
+ ...a
19
+ }) => /* @__PURE__ */ t(
20
+ _,
21
+ {
22
+ className: m(e, o.menu, n === "medium" && o.medium),
23
+ ...a
24
+ }
25
+ ), V = (e) => /* @__PURE__ */ t(
26
+ l,
27
+ {
28
+ ...e,
29
+ textValue: e.textValue || (typeof e.children == "string" ? e.children : void 0),
30
+ className: m(o.menuItem, e.className),
31
+ children: (n) => {
32
+ const { children: a } = e, { selectionMode: s, isSelected: c, hasSubmenu: u } = n;
33
+ return /* @__PURE__ */ r(i, { children: [
34
+ s !== "none" && /* @__PURE__ */ t(
35
+ h,
36
+ {
37
+ size: 16,
38
+ className: o.checkMark,
39
+ "data-selected": c || void 0
40
+ }
41
+ ),
42
+ /* @__PURE__ */ t("div", { className: o.mainContent, children: typeof a == "function" ? a(n) : a }),
43
+ u && /* @__PURE__ */ t(S, { size: 20 })
44
+ ] });
45
+ }
46
+ }
47
+ ), F = ({ className: e, ...n }) => /* @__PURE__ */ t(
48
+ d,
49
+ {
50
+ className: m(e, o.menuPopover),
51
+ offset: 4,
52
+ ...n
53
+ }
54
+ ), R = ({
55
+ className: e,
56
+ ...n
57
+ }) => /* @__PURE__ */ t(
58
+ k,
59
+ {
60
+ className: m(e, o.menuSection),
61
+ ...n
62
+ }
63
+ ), q = ({ className: e, ...n }) => /* @__PURE__ */ t(
64
+ M,
65
+ {
66
+ className: m(e, o.separator),
67
+ ...n
68
+ }
69
+ );
70
+ export {
71
+ z as M,
72
+ q as S,
73
+ V as a,
74
+ F as b,
75
+ R as c
76
+ };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as f, jsx as c } from "react/jsx-runtime";
2
- import { c as r } from "./clsx-CuNqTHjr.js";
2
+ import { c as r } from "./clsx-AexbMWKp.js";
3
3
  import '../assets/Skeleton.css';const w = "_skeleton_wia11_11", p = "_circle_wia11_25", u = "_wave_wia11_30", v = "_onLayer01_wia11_54", d = "_form_wia11_58", k = "_formLabel_wia11_64", L = "_formDescription_wia11_70", y = "_formInput_wia11_76", b = "_medium_wia11_81", o = {
4
4
  skeleton: w,
5
5
  circle: p,
@@ -0,0 +1,49 @@
1
+ import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
+ import { c as n } from "./clsx-AexbMWKp.js";
3
+ import { VisuallyHidden as d } from "react-aria";
4
+ import { u as l } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
5
+ import { c as _ } from "./createLucideIcon-D4r5Phnh.js";
6
+ import '../assets/Spinner.css';const m = "_container_vf3ec_1", p = "_spinner_vf3ec_5", g = "_large_vf3ec_18", f = "_dark_vf3ec_23", e = {
7
+ container: m,
8
+ spinner: p,
9
+ large: g,
10
+ dark: f
11
+ };
12
+ const u = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], v = _("loader-circle", u), k = { loadingPleaseWait: "Loading, please wait..." }, h = { loadingPleaseWait: "Laddar, vänligen vänta..." }, L = {
13
+ en: k,
14
+ sv: h
15
+ }, N = ({
16
+ small: a,
17
+ isOnColor: s = !1,
18
+ color: t,
19
+ className: o
20
+ }) => {
21
+ const i = l(L);
22
+ return /* @__PURE__ */ c(
23
+ "div",
24
+ {
25
+ className: n(e.container, o),
26
+ role: "status",
27
+ children: [
28
+ /* @__PURE__ */ r(
29
+ v,
30
+ {
31
+ className: n(
32
+ e.spinner,
33
+ !a && e.large,
34
+ s && e.dark
35
+ ),
36
+ size: a ? 20 : 96,
37
+ strokeWidth: a ? 2 : 8,
38
+ absoluteStrokeWidth: !0,
39
+ color: t
40
+ }
41
+ ),
42
+ /* @__PURE__ */ r(d, { children: i.format("loadingPleaseWait") })
43
+ ]
44
+ }
45
+ );
46
+ };
47
+ export {
48
+ N as S
49
+ };