@midas-ds/components 17.29.0 → 17.30.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 (171) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/accordion/index.js +1 -1
  3. package/badge/index.js +1 -1
  4. package/breadcrumbs/index.js +1 -1
  5. package/button/index.js +1 -1
  6. package/calendar/index.js +1 -1
  7. package/card/index.js +1 -1
  8. package/checkbox/index.js +1 -1
  9. package/chunks/FeedbackStatusIcon-DvMDGBGL.js +36 -0
  10. package/chunks/{accordion-DIVTJU3O.js → accordion-DlVM6IKH.js} +24 -24
  11. package/chunks/{badge-BfK6XrlL.js → badge-C4bXJmhn.js} +1 -1
  12. package/chunks/{breadcrumbs-DV0ZJc62.js → breadcrumbs-BGnyY3bO.js} +1 -1
  13. package/chunks/{button-CenXTGXL.js → button-dpe6hXmI.js} +2 -2
  14. package/chunks/calendar-BnT8aqrk.js +108 -0
  15. package/chunks/card-C0S9Kyi2.js +103 -0
  16. package/chunks/checkbox-B1RWLsu9.js +106 -0
  17. package/chunks/clear-button-DWtOkhCH.js +17 -0
  18. package/chunks/clsx-DAqHMl_k.js +7 -0
  19. package/chunks/color-scheme-switch-DVyIszaD.js +160 -0
  20. package/chunks/{combobox-DIou4Z-d.js → combobox-BLAVO2ax.js} +25 -25
  21. package/chunks/{date-field-BF2f9bSf.js → date-field-D5QLfSD_.js} +5 -5
  22. package/chunks/date-picker-BWSHiwIN.js +142 -0
  23. package/chunks/{drop-zone-DH3ZyHsr.js → drop-zone-DNhEbH4w.js} +1 -1
  24. package/chunks/{field-error-LtNtEKDp.js → field-error-BHoPnRe4.js} +2 -2
  25. package/chunks/file-list-Ntos8dkG.js +139 -0
  26. package/chunks/{grid-Cn_8RSvj.js → grid-BR68fpvW.js} +1 -1
  27. package/chunks/{heading-BEl_z-5T.js → heading-DcOjYrUM.js} +1 -1
  28. package/chunks/{info-banner-osR4e6nB.js → info-banner-DXjPEG69.js} +15 -15
  29. package/chunks/label-pGlER0ro.js +50 -0
  30. package/chunks/layout-Bue2Lkbc.js +378 -0
  31. package/chunks/link-B76JDA2N.js +44 -0
  32. package/chunks/link-button-BeXxC22w.js +44 -0
  33. package/chunks/{list-box-BN_MSiOD.js → list-box-BzBJX0nP.js} +3 -3
  34. package/chunks/{logo-DyZ2pXt7.js → logo-DSJ1bUJZ.js} +1 -1
  35. package/chunks/menu-DbQ98noD.js +48 -0
  36. package/chunks/modal-C8rs1jfL.js +66 -0
  37. package/chunks/{popover-DGcogqbS.js → popover-B82BcP5n.js} +1 -1
  38. package/chunks/{progress-bar-CknF4qAm.js → progress-bar-S6GNHQRZ.js} +2 -2
  39. package/chunks/{radio-BD1EuxSa.js → radio-uAtTm38S.js} +4 -4
  40. package/chunks/search-field-Bx3JApAJ.js +91 -0
  41. package/chunks/select-CuKVJ1x9.js +177 -0
  42. package/chunks/{skeleton-B_BPRPJy.js → skeleton-R_3dS7Ro.js} +1 -1
  43. package/chunks/spinner-CIjfJeGm.js +29 -0
  44. package/chunks/{stack-LF3ExhH9.js → stack-BAHKom_Q.js} +1 -1
  45. package/chunks/table-DDTeIVh8.js +84 -0
  46. package/chunks/{tabs-Co09VWvC.js → tabs-owuRVJ3N.js} +1 -1
  47. package/chunks/tag-BEawJnJm.js +78 -0
  48. package/chunks/{text-DwmZ-ew8.js → text-DnvD4Cjc.js} +1 -1
  49. package/chunks/textfield-G6u6RJD5.js +113 -0
  50. package/chunks/{time-field-CmjGBQph.js → time-field-Mm1iDLzS.js} +6 -6
  51. package/chunks/{toast-gJgjitZF.js → toast-DZuvVRD_.js} +21 -21
  52. package/chunks/{toggle-button-CIvsOXQf.js → toggle-button-DD_bXanH.js} +1 -1
  53. package/chunks/{tooltip-BkesIUIF.js → tooltip-1GBTeMrm.js} +1 -1
  54. package/clear-button/index.js +1 -1
  55. package/color-scheme-switch/index.js +1 -1
  56. package/combobox/index.js +1 -1
  57. package/date-field/index.js +1 -1
  58. package/date-picker/index.js +1 -1
  59. package/drop-zone/index.js +1 -1
  60. package/field-error/index.js +1 -1
  61. package/file-list/index.js +1 -1
  62. package/grid/index.js +1 -1
  63. package/heading/index.js +1 -1
  64. package/index.js +52 -50
  65. package/info-banner/index.js +1 -1
  66. package/label/index.js +1 -1
  67. package/layout/Layout.d.ts +1 -2
  68. package/layout/context/LayoutContext.d.ts +7 -1
  69. package/layout/index.js +1 -1
  70. package/link/index.js +1 -1
  71. package/link-button/index.js +1 -1
  72. package/list-box/index.js +1 -1
  73. package/logo/index.js +1 -1
  74. package/menu/index.js +1 -1
  75. package/modal/index.js +1 -1
  76. package/package.json +4 -2
  77. package/popover/index.js +1 -1
  78. package/progress-bar/index.js +1 -1
  79. package/radio/index.js +1 -1
  80. package/search-field/index.js +1 -1
  81. package/select/index.js +1 -1
  82. package/skeleton/index.js +1 -1
  83. package/spinner/index.js +1 -1
  84. package/stack/index.js +1 -1
  85. package/table/index.js +1 -1
  86. package/tabs/index.js +1 -1
  87. package/tag/index.js +1 -1
  88. package/text/index.js +1 -1
  89. package/textfield/index.js +1 -1
  90. package/time-field/index.js +1 -1
  91. package/toast/index.js +1 -1
  92. package/toggle-button/index.js +1 -1
  93. package/tooltip/index.js +1 -1
  94. package/accordion/Accordion.stories.d.ts +0 -23
  95. package/accordion/AccordionItem.stories.d.ts +0 -25
  96. package/badge/Badge.stories.d.ts +0 -17
  97. package/breadcrumbs/Breadcrumbs.stories.d.ts +0 -25
  98. package/button/Button.stories.d.ts +0 -25
  99. package/button/ButtonGroup.stories.d.ts +0 -15
  100. package/calendar/Calendar.stories.d.ts +0 -17
  101. package/calendar/RangeCalendar.stories.d.ts +0 -15
  102. package/card/Card.stories.d.ts +0 -19
  103. package/checkbox/Checkbox.stories.d.ts +0 -30
  104. package/checkbox/CheckboxGroup.stories.d.ts +0 -31
  105. package/chunks/FeedbackStatusIcon-DRI7WrSU.js +0 -54
  106. package/chunks/arrow-right-Db_H9KjE.js +0 -10
  107. package/chunks/calendar-Bl_obez5.js +0 -111
  108. package/chunks/card-zIYA-SQh.js +0 -103
  109. package/chunks/check-DV00NPU0.js +0 -7
  110. package/chunks/checkbox-Bqd8B58G.js +0 -110
  111. package/chunks/chevron-down-CP7nEDei.js +0 -7
  112. package/chunks/chevron-right-DwqboCdU.js +0 -7
  113. package/chunks/clear-button-D3I1X3yG.js +0 -17
  114. package/chunks/clsx-Di52oYUU.js +0 -23
  115. package/chunks/color-scheme-switch-DVZjdwc9.js +0 -203
  116. package/chunks/createLucideIcon-BgluSHFG.js +0 -39
  117. package/chunks/date-picker-DZivTUB_.js +0 -187
  118. package/chunks/file-list-B4vG_egr.js +0 -161
  119. package/chunks/info-jCyacVsy.js +0 -19
  120. package/chunks/label-LWlgvAwz.js +0 -50
  121. package/chunks/layout-Db5um0f7.js +0 -426
  122. package/chunks/link-BAgs4RwY.js +0 -59
  123. package/chunks/link-button-BuPMEGUj.js +0 -52
  124. package/chunks/menu-aT2IR0tO.js +0 -49
  125. package/chunks/modal-C-UsxdO0.js +0 -66
  126. package/chunks/search-field-GNTRFpzf.js +0 -100
  127. package/chunks/select-oLCNpryY.js +0 -177
  128. package/chunks/spinner-LdHPVms_.js +0 -32
  129. package/chunks/square-arrow-out-up-right-DkgXD7hj.js +0 -17
  130. package/chunks/table-CmNWoAYO.js +0 -150
  131. package/chunks/tag-BIcqtf7b.js +0 -78
  132. package/chunks/textfield-BSvCsAyC.js +0 -112
  133. package/chunks/x-BJAOO5a5.js +0 -10
  134. package/color-scheme-switch/ColorSchemeSwitch.stories.d.ts +0 -7
  135. package/color-scheme-switch/ColorSchemeSwitchMenu.stories.d.ts +0 -8
  136. package/combobox/ComboBox.stories.d.ts +0 -43
  137. package/date-field/DateField.stories.d.ts +0 -15
  138. package/date-picker/DatePicker.stories.d.ts +0 -17
  139. package/date-picker/DateRangePicker.stories.d.ts +0 -39
  140. package/drop-zone/DropZone.stories.d.ts +0 -16
  141. package/file-list/FileList.stories.d.ts +0 -31
  142. package/grid/Grid.stories.d.ts +0 -28
  143. package/heading/Heading.stories.d.ts +0 -30
  144. package/info-banner/InfoBanner.stories.d.ts +0 -16
  145. package/label/Label.stories.d.ts +0 -10
  146. package/layout/Layout.stories.d.ts +0 -9
  147. package/link/Link.stories.d.ts +0 -14
  148. package/link-button/LinkButton.stories.d.ts +0 -13
  149. package/list-box/ListBox.stories.d.ts +0 -24
  150. package/logo/Logo.stories.d.ts +0 -7
  151. package/menu/Menu.stories.d.ts +0 -35
  152. package/modal/Modal.stories.d.ts +0 -15
  153. package/popover/Popover.stories.d.ts +0 -18
  154. package/progress-bar/ProgressBar.stories.d.ts +0 -18
  155. package/radio/Radio.stories.d.ts +0 -110
  156. package/radio/RadioGroup.stories.d.ts +0 -27
  157. package/search-field/SearchField.stories.d.ts +0 -34
  158. package/select/Select.stories.d.ts +0 -53
  159. package/skeleton/Skeleton.Form.stories.d.ts +0 -20
  160. package/skeleton/Skeleton.stories.d.ts +0 -10
  161. package/spinner/Spinner.stories.d.ts +0 -20
  162. package/stack/Stack.stories.d.ts +0 -24
  163. package/table/Table.stories.d.ts +0 -39
  164. package/tabs/Tabs.stories.d.ts +0 -31
  165. package/tag/Tag.stories.d.ts +0 -17
  166. package/text/Text.stories.d.ts +0 -10
  167. package/textfield/TextArea.stories.d.ts +0 -365
  168. package/textfield/TextField.stories.d.ts +0 -39
  169. package/time-field/TimeField.stories.d.ts +0 -37
  170. package/toast/Toast.stories.d.ts +0 -24
  171. package/tooltip/Tooltip.stories.d.ts +0 -26
@@ -0,0 +1,91 @@
1
+ 'use client';
2
+ import { t as e } from "./clsx-DAqHMl_k.js";
3
+ import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
4
+ import { n } from "./button-dpe6hXmI.js";
5
+ import { n as r, t as i } from "./label-pGlER0ro.js";
6
+ import { t as a } from "./text-DnvD4Cjc.js";
7
+ import { t as o } from "./field-error-BHoPnRe4.js";
8
+ import { t as s } from "./TextField.module-BLGiCC4q.js";
9
+ import { FormContext as c, Input as l, SearchField as u, useSlottedContext as d } from "react-aria-components";
10
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
11
+ import { Search as h, X as g } from "lucide-react";
12
+ import '../assets/search-field.css';var _ = {
13
+ container: "_container_onquj_1",
14
+ inner: "_inner_onquj_12",
15
+ inputContainer: "_inputContainer_onquj_17",
16
+ medium: "_medium_onquj_23",
17
+ icon: "_icon_onquj_28",
18
+ clear: "_clear_onquj_40",
19
+ input: "_input_onquj_17"
20
+ }, v = {
21
+ en: { search: "Search" },
22
+ sv: { search: "Sök" }
23
+ };
24
+ //#endregion
25
+ //#region src/search-field/SearchField.tsx
26
+ function y(e) {
27
+ return !!e?.length;
28
+ }
29
+ var b = ({ errorPosition: b = "top", size: x = "large", showButton: S, className: C, errorMessage: w, placeholder: T, label: E, description: D, popover: O, validationBehavior: k, inputMode: A = "search", ...j }) => {
30
+ let M = t(v), N = d(c), P = k ?? N?.validationBehavior ?? "aria", F = S !== !1, I = (e) => {
31
+ e && !j.isInvalid && (j.validate && y(j.validate(e)) || j.onSubmit?.(e));
32
+ };
33
+ return /* @__PURE__ */ p(u, {
34
+ ...j,
35
+ inputMode: A,
36
+ onSubmit: I,
37
+ "aria-label": E ? j["aria-label"] : j["aria-label"] ?? T,
38
+ className: e(_.container, C),
39
+ validationBehavior: P,
40
+ children: ({ state: t }) => /* @__PURE__ */ m(f, { children: [
41
+ /* @__PURE__ */ p(r, {
42
+ popover: O,
43
+ children: E && /* @__PURE__ */ p(i, { children: E })
44
+ }),
45
+ D && /* @__PURE__ */ p(a, {
46
+ slot: "description",
47
+ children: D
48
+ }),
49
+ b === "top" && /* @__PURE__ */ p(o, { children: ({ validationErrors: e }) => w ?? e.join(" ") }),
50
+ /* @__PURE__ */ m("div", {
51
+ className: _.inner,
52
+ children: [/* @__PURE__ */ m("div", {
53
+ className: e(_.inputContainer, { [_.medium]: x === "medium" }),
54
+ children: [
55
+ /* @__PURE__ */ p(h, {
56
+ size: 20,
57
+ className: _.icon
58
+ }),
59
+ /* @__PURE__ */ p(l, {
60
+ placeholder: T,
61
+ className: e(s.input, _.input, { [_.medium]: x === "medium" }),
62
+ onKeyDown: j.onSubmit ? void 0 : (e) => {
63
+ e.key === "Enter" && t.value && !j.isInvalid && e.currentTarget.form?.requestSubmit();
64
+ }
65
+ }),
66
+ t.value.length > 0 && /* @__PURE__ */ p(n, {
67
+ variant: "icon",
68
+ size: x,
69
+ className: e(_.clear, { [_.medium]: x === "medium" }),
70
+ children: /* @__PURE__ */ p(g, {
71
+ size: 20,
72
+ "aria-hidden": !0
73
+ })
74
+ })
75
+ ]
76
+ }), F && /* @__PURE__ */ p(n, {
77
+ slot: null,
78
+ excludeFromTabOrder: !0,
79
+ size: x,
80
+ isDisabled: j.isDisabled,
81
+ type: "button",
82
+ onPress: () => I(t.value),
83
+ children: j.buttonText ?? M.format("search")
84
+ })]
85
+ }),
86
+ b === "bottom" && /* @__PURE__ */ p(o, { children: ({ validationErrors: e }) => w ?? e.join(" ") })
87
+ ] })
88
+ });
89
+ };
90
+ //#endregion
91
+ export { b as t };
@@ -0,0 +1,177 @@
1
+ import { t as e } from "./clsx-DAqHMl_k.js";
2
+ import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
3
+ import { n, t as r } from "./label-pGlER0ro.js";
4
+ import { t as i } from "./popover-B82BcP5n.js";
5
+ import { t as a } from "./text-DnvD4Cjc.js";
6
+ import { t as o } from "./field-error-BHoPnRe4.js";
7
+ import { n as s } from "./checkbox-B1RWLsu9.js";
8
+ import { c } from "./list-box-BzBJX0nP.js";
9
+ import { n as l, r as u, t as d } from "./tag-BEawJnJm.js";
10
+ import f, { useContext as p } from "react";
11
+ import m from "clsx";
12
+ import { Button as h, Select as g, SelectStateContext as _, SelectValue as v } from "react-aria-components";
13
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
14
+ import { ChevronDown as S, X as C } from "lucide-react";
15
+ import { FocusScope as w, useFocusManager as T } from "react-aria";
16
+ import '../assets/select.css';var E = {
17
+ en: {
18
+ clearAll: "Clear all",
19
+ selectAll: "Select all",
20
+ selectedItems: "Selected items",
21
+ selected: "selected"
22
+ },
23
+ sv: {
24
+ clearAll: "Rensa alla",
25
+ selectAll: "Välj alla",
26
+ selectedItems: "Valda objekt",
27
+ selected: "valda"
28
+ }
29
+ }, D = {
30
+ select: "_select_140qh_1",
31
+ triggerContainer: "_triggerContainer_140qh_7",
32
+ trigger: "_trigger_140qh_7",
33
+ medium: "_medium_140qh_30",
34
+ small: "_small_140qh_37",
35
+ selectValue: "_selectValue_140qh_60",
36
+ icon: "_icon_140qh_110",
37
+ placeholder: "_placeholder_140qh_122",
38
+ multiSelectValue: "_multiSelectValue_140qh_132",
39
+ selectValueTag: "_selectValueTag_140qh_156",
40
+ clearButton: "_clearButton_140qh_170",
41
+ truncate: "_truncate_140qh_185",
42
+ popover: "_popover_140qh_222",
43
+ selectAll: "_selectAll_140qh_250",
44
+ tagGroup: "_tagGroup_140qh_316"
45
+ }, O = () => {
46
+ let e = f.useContext(_), n = t(E);
47
+ return /* @__PURE__ */ b(s, {
48
+ className: D.selectAll,
49
+ isIndeterminate: !e?.selectionManager.isSelectAll && !e?.selectionManager.isEmpty,
50
+ isSelected: e?.selectionManager.isSelectAll,
51
+ onChange: () => {
52
+ if (!e) return;
53
+ let t = Array.from(e.collection.getKeys()).filter((t) => e.collection.getItem(t)?.type === "item" && e.selectionManager.canSelectItem(t)), n = Array.from(e.selectionManager.selectedKeys).filter((t) => !e.selectionManager.canSelectItem(t));
54
+ e.setValue(e.selectionManager.isSelectAll ? n : [...t, ...n]), e.commitValidation();
55
+ },
56
+ children: n.format("selectAll")
57
+ });
58
+ }, k = ({ isDisabled: e }) => {
59
+ let n = t(E), r = (e, t) => e.length === 1 ? t : `${e.length} ${n.format("selected")}`;
60
+ return /* @__PURE__ */ b(v, {
61
+ className: D.multiSelectValue,
62
+ "data-disabled": e || void 0,
63
+ children: ({ isPlaceholder: t, selectedItems: n, selectedText: i }) => t ? /* @__PURE__ */ b(y, {}) : /* @__PURE__ */ x("div", {
64
+ className: D.selectValueTag,
65
+ "data-disabled": e || void 0,
66
+ children: [/* @__PURE__ */ b("span", {
67
+ className: D.truncate,
68
+ children: r(n, i)
69
+ }), /* @__PURE__ */ b(A, { isDisabled: e })]
70
+ })
71
+ });
72
+ }, A = ({ isDisabled: e }) => {
73
+ let n = f.useContext(_), r = t(E), i = T();
74
+ return /* @__PURE__ */ b(h, {
75
+ "aria-label": r.format("clearAll"),
76
+ className: D.clearButton,
77
+ onPress: () => {
78
+ i?.focusFirst(), n?.selectionManager.clearSelection();
79
+ },
80
+ slot: null,
81
+ isDisabled: e,
82
+ children: /* @__PURE__ */ b(C, {
83
+ width: 20,
84
+ height: 20
85
+ })
86
+ });
87
+ }, j = ({ showTags: e, isDisabled: n }) => {
88
+ let r = t(E), i = p(_);
89
+ return !i?.selectedItems.length || !e ? null : /* @__PURE__ */ b(d, {
90
+ "aria-label": r.format("selectedItems"),
91
+ className: D.tagGroup,
92
+ onRemove: (e) => {
93
+ i?.selectionManager.toggleSelection(Array.from(e)[0]);
94
+ },
95
+ selectionBehavior: "toggle",
96
+ children: /* @__PURE__ */ b(l, {
97
+ items: i.selectedItems,
98
+ children: (e) => /* @__PURE__ */ b(u, {
99
+ isDismissable: !0,
100
+ id: e.key,
101
+ isDisabled: n,
102
+ textValue: e.textValue,
103
+ children: e.textValue
104
+ }, e.key)
105
+ })
106
+ });
107
+ }, M = ({ isDisabled: e, selectionMode: t, size: n }) => {
108
+ let r = p(_);
109
+ return /* @__PURE__ */ x(h, {
110
+ className: m({
111
+ [D.medium]: n === "medium",
112
+ [D.small]: n === "small"
113
+ }, D.trigger),
114
+ "data-invalid": !!r?.displayValidation.isInvalid || void 0,
115
+ children: [/* @__PURE__ */ b(v, {
116
+ className: D.selectValue,
117
+ "data-disabled": e || void 0,
118
+ children: ({ selectedText: e, defaultChildren: n }) => /* @__PURE__ */ b("div", {
119
+ className: D.placeholder,
120
+ children: /* @__PURE__ */ b("span", {
121
+ className: D.truncate,
122
+ children: t === "multiple" && e ? null : e || n
123
+ })
124
+ })
125
+ }), /* @__PURE__ */ b("span", {
126
+ "aria-hidden": "true",
127
+ className: D.icon,
128
+ children: /* @__PURE__ */ b(S, { size: 20 })
129
+ })]
130
+ });
131
+ };
132
+ //#endregion
133
+ //#region src/select/Select.tsx
134
+ function N({ children: t, description: s, errorMessage: l, errorPosition: u = "top", items: d, label: f, popover: p, popoverProps: m, listBoxProps: h, size: _ = "large", ...v }) {
135
+ return /* @__PURE__ */ b(w, { children: /* @__PURE__ */ x(g, {
136
+ ...v,
137
+ className: e(v.className, D.select),
138
+ children: [
139
+ /* @__PURE__ */ b(n, {
140
+ popover: p,
141
+ children: f && /* @__PURE__ */ b(r, {
142
+ "data-disabled": v.isDisabled || void 0,
143
+ children: f
144
+ })
145
+ }),
146
+ s && /* @__PURE__ */ b(a, {
147
+ slot: "description",
148
+ children: s
149
+ }),
150
+ u === "top" && /* @__PURE__ */ b(o, { children: l }),
151
+ /* @__PURE__ */ x("div", {
152
+ className: D.triggerContainer,
153
+ "data-disabled": v.isDisabled || void 0,
154
+ children: [/* @__PURE__ */ b(M, {
155
+ size: _,
156
+ ...v
157
+ }), v.selectionMode === "multiple" ? /* @__PURE__ */ b(k, { ...v }) : null]
158
+ }),
159
+ u === "bottom" && /* @__PURE__ */ b(o, { children: l }),
160
+ /* @__PURE__ */ x(i, {
161
+ offset: 1,
162
+ hideArrow: !0,
163
+ ...m,
164
+ className: e(m?.className, D.popover),
165
+ children: [v.isSelectableAll && /* @__PURE__ */ b(O, {}), /* @__PURE__ */ b(c, {
166
+ escapeKeyBehavior: "none",
167
+ items: d,
168
+ ...h,
169
+ children: t
170
+ })]
171
+ }),
172
+ /* @__PURE__ */ b(j, { ...v })
173
+ ]
174
+ }) });
175
+ }
176
+ //#endregion
177
+ export { M as n, N as t };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./clsx-Di52oYUU.js";
1
+ import { t as e } from "./clsx-DAqHMl_k.js";
2
2
  import "react";
3
3
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
4
  import '../assets/skeleton.css';var r = {
@@ -0,0 +1,29 @@
1
+ import { t as e } from "./clsx-DAqHMl_k.js";
2
+ import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import { LoaderCircle as i } from "lucide-react";
5
+ import { VisuallyHidden as a } from "react-aria";
6
+ import '../assets/spinner.css';var o = {
7
+ container: "_container_1qexx_1",
8
+ spinner: "_spinner_1qexx_5",
9
+ rotating: "_rotating_1qexx_1",
10
+ large: "_large_1qexx_18"
11
+ }, s = {
12
+ en: { loadingPleaseWait: "Loading, please wait..." },
13
+ sv: { loadingPleaseWait: "Laddar, vänligen vänta..." }
14
+ }, c = ({ small: c, color: l, className: u }) => {
15
+ let d = t(s);
16
+ return /* @__PURE__ */ r("div", {
17
+ className: e(o.container, u),
18
+ role: "status",
19
+ children: [/* @__PURE__ */ n(i, {
20
+ className: e(o.spinner, !c && o.large),
21
+ size: c ? 20 : 96,
22
+ strokeWidth: c ? 2 : 8,
23
+ absoluteStrokeWidth: !0,
24
+ color: l
25
+ }), /* @__PURE__ */ n(a, { children: d.format("loadingPleaseWait") })]
26
+ });
27
+ };
28
+ //#endregion
29
+ export { c as t };
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { t as e } from "./clsx-Di52oYUU.js";
2
+ import { t as e } from "./clsx-DAqHMl_k.js";
3
3
  import * as t from "react";
4
4
  import { jsx as n } from "react/jsx-runtime";
5
5
  import '../assets/stack.css';var r = { stack: "_stack_1g0ly_7" }, i = t.forwardRef(({ children: t, elementType: i = "div", direction: a = "column", spacing: o = "small", alignItems: s = "stretch", justifyContent: c = "start", wrap: l = !1, className: u, role: d, ...f }, p) => {
@@ -0,0 +1,84 @@
1
+ 'use client';
2
+ import { t as e } from "./clsx-DAqHMl_k.js";
3
+ import { n as t } from "./checkbox-B1RWLsu9.js";
4
+ import { Button as n, Cell as r, Collection as i, Column as a, Row as o, Table as s, TableBody as c, TableHeader as l, useTableOptions as u } from "react-aria-components";
5
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
6
+ import { ArrowDown as m, ArrowUp as h, ArrowUpDown as g, GripVertical as _ } from "lucide-react";
7
+ import '../assets/table.css';var v = {
8
+ table: "_table_1lyes_1",
9
+ tableHeader: "_tableHeader_1lyes_11",
10
+ column: "_column_1lyes_12",
11
+ sortIndicator: "_sortIndicator_1lyes_29",
12
+ sortIconNeutral: "_sortIconNeutral_1lyes_37",
13
+ selection: "_selection_1lyes_56",
14
+ row: "_row_1lyes_62",
15
+ cell: "_cell_1lyes_81",
16
+ narrow: "_narrow_1lyes_98",
17
+ medium: "_medium_1lyes_121",
18
+ striped: "_striped_1lyes_132"
19
+ }, y = ({ size: t = "large", striped: n = !1, className: r, ...i }) => /* @__PURE__ */ f(s, {
20
+ className: e(v.table, r, {
21
+ [v.medium]: t === "medium",
22
+ [v.striped]: n
23
+ }),
24
+ ...i
25
+ }), b = ({ columns: n, children: r, className: a }) => {
26
+ let { selectionBehavior: o, selectionMode: s, allowsDragging: c } = u();
27
+ return /* @__PURE__ */ p(l, {
28
+ className: e(a, v.tableHeader),
29
+ children: [
30
+ c && /* @__PURE__ */ f(S, {}),
31
+ o === "toggle" && /* @__PURE__ */ f(S, {
32
+ width: 50,
33
+ children: s === "multiple" && /* @__PURE__ */ f(t, {
34
+ className: v.selection,
35
+ slot: "selection"
36
+ })
37
+ }),
38
+ /* @__PURE__ */ f(i, {
39
+ items: n,
40
+ children: r
41
+ })
42
+ ]
43
+ });
44
+ }, x = ({ id: r, columns: a, children: s, className: c, ...l }) => {
45
+ let { selectionBehavior: d, allowsDragging: m } = u();
46
+ return /* @__PURE__ */ p(o, {
47
+ id: r,
48
+ className: e(c, v.row),
49
+ ...l,
50
+ children: [
51
+ m && /* @__PURE__ */ f(C, { children: /* @__PURE__ */ f(n, {
52
+ slot: "drag",
53
+ children: /* @__PURE__ */ f(_, { size: 20 })
54
+ }) }),
55
+ d === "toggle" && /* @__PURE__ */ f(C, { children: /* @__PURE__ */ f(t, {
56
+ className: v.selection,
57
+ slot: "selection"
58
+ }) }),
59
+ /* @__PURE__ */ f(i, {
60
+ items: a,
61
+ children: s
62
+ })
63
+ ]
64
+ });
65
+ }, S = ({ children: t, className: n, ...r }) => /* @__PURE__ */ f(a, {
66
+ className: e(n, v.column),
67
+ ...r,
68
+ children: ({ allowsSorting: e, sortDirection: n }) => /* @__PURE__ */ p(d, { children: [t, e && /* @__PURE__ */ f("span", {
69
+ "aria-hidden": "true",
70
+ className: v.sortIndicator,
71
+ children: n === "ascending" ? /* @__PURE__ */ f(h, { size: 16 }) : n === "descending" ? /* @__PURE__ */ f(m, { size: 16 }) : /* @__PURE__ */ f(g, {
72
+ size: 16,
73
+ className: v.sortIconNeutral
74
+ })
75
+ })] })
76
+ }), C = ({ className: t, ...n }) => /* @__PURE__ */ f(r, {
77
+ className: e(t, v.cell),
78
+ ...n
79
+ }), w = ({ className: t, ...n }) => /* @__PURE__ */ f(c, {
80
+ className: e(t, v.tableBody),
81
+ ...n
82
+ });
83
+ //#endregion
84
+ export { w as a, y as i, S as n, b as o, x as r, C as t };
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { t as e } from "./clsx-Di52oYUU.js";
2
+ import { t as e } from "./clsx-DAqHMl_k.js";
3
3
  import * as t from "react";
4
4
  import { createContext as n } from "react";
5
5
  import { DialogContext as r, SelectionIndicator as i, Tab as a, TabList as o, TabPanel as s, Tabs as c, composeRenderProps as l } from "react-aria-components";
@@ -0,0 +1,78 @@
1
+ import { t as e } from "./clsx-DAqHMl_k.js";
2
+ import { n as t } from "./button-dpe6hXmI.js";
3
+ import { Children as n, forwardRef as r, isValidElement as i } from "react";
4
+ import { Tag as a, TagGroup as o, TagGroupContext as s, TagList as c, TagListContext as l, composeRenderProps as u, useContextProps as d } from "react-aria-components";
5
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
6
+ import { X as h } from "lucide-react";
7
+ import '../assets/tag.css';var g = {
8
+ button: "_button_14ocl_1",
9
+ tag: "_tag_14ocl_8",
10
+ sky: "_sky_14ocl_21",
11
+ blue: "_blue_14ocl_22",
12
+ mint: "_mint_14ocl_27",
13
+ green: "_green_14ocl_28",
14
+ cream: "_cream_14ocl_33",
15
+ yellow: "_yellow_14ocl_34",
16
+ teal: "_teal_14ocl_39",
17
+ lagoon: "_lagoon_14ocl_44",
18
+ lagoonblue: "_lagoonblue_14ocl_45",
19
+ lavender: "_lavender_14ocl_50",
20
+ purple: "_purple_14ocl_51",
21
+ peach: "_peach_14ocl_56",
22
+ orange: "_orange_14ocl_57",
23
+ pippin: "_pippin_14ocl_62",
24
+ red: "_red_14ocl_63",
25
+ tagText: "_tagText_14ocl_90",
26
+ dismissable: "_dismissable_14ocl_104"
27
+ }, _ = ({ className: n, color: r, dismissable: i = !1, isDismissable: o, type: s, ...c }) => {
28
+ let l = o || o === void 0 && i;
29
+ return /* @__PURE__ */ p(a, {
30
+ className: e(g.tag, l && g.dismissable, {
31
+ [g.sky]: r === "sky",
32
+ [g.blue]: r === "blue" || !r && s === "info",
33
+ [g.mint]: r === "mint",
34
+ [g.green]: r === "green" || !r && s === "success",
35
+ [g.cream]: r === "cream",
36
+ [g.yellow]: r === "yellow" || !r && s === "important",
37
+ [g.teal]: r === "teal",
38
+ [g.lagoon]: r === "lagoon",
39
+ [g.lagoonblue]: r === "lagoonblue",
40
+ [g.lavender]: r === "lavender",
41
+ [g.purple]: r === "purple",
42
+ [g.peach]: r === "peach",
43
+ [g.orange]: r === "orange",
44
+ [g.pippin]: r === "pippin",
45
+ [g.red]: r === "red" || !r && s === "warning"
46
+ }, n),
47
+ ...c,
48
+ textValue: c.textValue || (typeof c.children == "string" ? c.children : void 0),
49
+ children: u(c.children, (e) => /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
50
+ className: g.tagText,
51
+ children: e
52
+ }), l && /* @__PURE__ */ p(t, {
53
+ variant: "icon",
54
+ size: "medium",
55
+ className: g.button,
56
+ slot: "remove",
57
+ children: /* @__PURE__ */ p(h, { size: 20 })
58
+ })] }))
59
+ });
60
+ }, v = { tagList: "_tagList_17pz2_1" }, y = r((t, n) => {
61
+ let [{ className: r, ...i }, a] = d(t, n, l);
62
+ return /* @__PURE__ */ p(c, {
63
+ className: e(r, v.tagList),
64
+ ref: a,
65
+ ...i
66
+ });
67
+ }), b = r((t, r) => {
68
+ let [{ className: a, children: c, ...l }, u] = d(t, r, s), f = n.toArray(c).filter(i).find((e) => e.type === y);
69
+ return !f && process.env.NODE_ENV === "development" && console.warn("Using a TagGroup without providing a TagList component is deprecated since v17.0.0, see: https://designsystem.migrationsverket.se/components/tag/"), /* @__PURE__ */ p(o, {
70
+ className: e(a),
71
+ ref: u,
72
+ ...l,
73
+ children: f ? c : /* @__PURE__ */ p(y, { children: c })
74
+ });
75
+ });
76
+ b.displayName = "TagGroup";
77
+ //#endregion
78
+ export { y as n, _ as r, b as t };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./clsx-Di52oYUU.js";
1
+ import { t as e } from "./clsx-DAqHMl_k.js";
2
2
  import "react";
3
3
  import { Text as t } from "react-aria-components";
4
4
  import { jsx as n } from "react/jsx-runtime";
@@ -0,0 +1,113 @@
1
+ 'use client';
2
+ import { t as e } from "./clsx-DAqHMl_k.js";
3
+ import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
4
+ import { n } from "./button-dpe6hXmI.js";
5
+ import { n as r, t as i } from "./label-pGlER0ro.js";
6
+ import { t as a } from "./text-DnvD4Cjc.js";
7
+ import { t as o } from "./field-error-BHoPnRe4.js";
8
+ import { t as s } from "./character-counter-CSoVSrxZ.js";
9
+ import { t as c } from "./TextField.module-BLGiCC4q.js";
10
+ import { forwardRef as l, useState as u } from "react";
11
+ import { clsx as d } from "clsx";
12
+ import { Input as f, InputContext as p, TextArea as m, TextField as h, TextFieldContext as g, useContextProps as _ } from "react-aria-components";
13
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
14
+ //#region src/textfield/TextFieldBase.tsx
15
+ var b = l((e, t) => {
16
+ [e] = _(e, t, g);
17
+ let { label: n, description: l, errorMessage: u, showCounter: f, errorPosition: p = "top", size: m = "large", popover: b, children: x } = e;
18
+ return /* @__PURE__ */ y(h, {
19
+ ...e,
20
+ className: d(c.textField, { [c.medium]: m === "medium" }),
21
+ children: [
22
+ /* @__PURE__ */ v(r, {
23
+ popover: b,
24
+ children: n && /* @__PURE__ */ v(i, { children: n })
25
+ }),
26
+ l && /* @__PURE__ */ v(a, {
27
+ slot: "description",
28
+ children: l
29
+ }),
30
+ f && /* @__PURE__ */ v(s, { isLonely: !l }),
31
+ p === "top" && /* @__PURE__ */ v(o, {
32
+ "data-testid": "fieldError",
33
+ children: u
34
+ }),
35
+ x,
36
+ p === "bottom" && /* @__PURE__ */ v(o, {
37
+ "data-testid": "fieldError",
38
+ className: c.bottomError,
39
+ children: u
40
+ })
41
+ ]
42
+ });
43
+ });
44
+ b.displayName = "TextFieldBase";
45
+ var x = {
46
+ en: {
47
+ hide: "Hide",
48
+ show: "Show",
49
+ showPassword: "Show password"
50
+ },
51
+ sv: {
52
+ hide: "Dölj",
53
+ show: "Visa",
54
+ showPassword: "Visa lösenord"
55
+ }
56
+ }, S = ({ showPassword: e, onToggle: r }) => {
57
+ let i = t(x);
58
+ return /* @__PURE__ */ v(n, {
59
+ "aria-label": i.format("showPassword"),
60
+ "aria-pressed": e,
61
+ variant: "tertiary",
62
+ onPress: r,
63
+ className: c.passwordButton,
64
+ children: e ? i.format("hide") : i.format("show")
65
+ });
66
+ }, C = l(({ skipContext: t = !1, ...n }, r) => {
67
+ let [i, a] = _(n, r, p), o = t ? r : a, s = t ? n : i, l = s.type === "password", [d, m] = u(!1);
68
+ return /* @__PURE__ */ y("div", {
69
+ className: c.wrap,
70
+ children: [/* @__PURE__ */ v(f, {
71
+ ...s,
72
+ ref: o,
73
+ type: l && d ? "text" : s.type,
74
+ className: e(c.input, s.className)
75
+ }), l && /* @__PURE__ */ v(S, {
76
+ showPassword: d,
77
+ onToggle: () => m((e) => !e)
78
+ })]
79
+ });
80
+ });
81
+ C.displayName = "Input";
82
+ //#endregion
83
+ //#region src/textfield/TextField.tsx
84
+ var w = l(({ className: t, list: n, type: r, min: i, max: a, form: o, ...s }, c) => /* @__PURE__ */ v(b, {
85
+ ...s,
86
+ children: /* @__PURE__ */ v(C, {
87
+ className: e(t),
88
+ form: o,
89
+ list: n,
90
+ min: i,
91
+ max: a,
92
+ ref: c,
93
+ type: r,
94
+ skipContext: !0
95
+ })
96
+ }));
97
+ w.displayName = "TextField";
98
+ //#endregion
99
+ //#region src/textfield/TextArea.tsx
100
+ var T = l(({ className: t, cols: n, form: r, rows: i, wrap: a, ...o }, s) => /* @__PURE__ */ v(b, {
101
+ ...o,
102
+ children: /* @__PURE__ */ v(m, {
103
+ className: e(c.textArea, t),
104
+ cols: n,
105
+ form: r,
106
+ ref: s,
107
+ rows: i,
108
+ wrap: a
109
+ })
110
+ }));
111
+ T.displayName = "TextArea";
112
+ //#endregion
113
+ export { b as i, w as n, C as r, T as t };
@@ -1,10 +1,10 @@
1
- import { t as e } from "./clsx-Di52oYUU.js";
1
+ import { t as e } from "./clsx-DAqHMl_k.js";
2
2
  import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
3
- import { n, t as r } from "./label-LWlgvAwz.js";
4
- import { t as i } from "./text-DwmZ-ew8.js";
5
- import { t as a } from "./field-error-LtNtEKDp.js";
6
- import { t as o } from "./clear-button-D3I1X3yG.js";
7
- import { n as s, r as c } from "./date-field-BF2f9bSf.js";
3
+ import { n, t as r } from "./label-pGlER0ro.js";
4
+ import { t as i } from "./text-DnvD4Cjc.js";
5
+ import { t as a } from "./field-error-BHoPnRe4.js";
6
+ import { t as o } from "./clear-button-DWtOkhCH.js";
7
+ import { n as s, r as c } from "./date-field-D5QLfSD_.js";
8
8
  import * as l from "react";
9
9
  import { TimeField as u, TimeFieldStateContext as d } from "react-aria-components";
10
10
  import { jsx as f, jsxs as p } from "react/jsx-runtime";