@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
@@ -1,100 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./clsx-Di52oYUU.js";
3
- import { t } from "./createLucideIcon-BgluSHFG.js";
4
- import { t as n } from "./x-BJAOO5a5.js";
5
- import { t as r } from "./useLocalizedStringFormatter-CeyBc0x0.js";
6
- import { n as i } from "./button-CenXTGXL.js";
7
- import { n as a, t as o } from "./label-LWlgvAwz.js";
8
- import { t as s } from "./text-DwmZ-ew8.js";
9
- import { t as c } from "./field-error-LtNtEKDp.js";
10
- import { t as l } from "./TextField.module-BLGiCC4q.js";
11
- import { FormContext as u, Input as d, SearchField as f, useSlottedContext as p } from "react-aria-components";
12
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
13
- import '../assets/search-field.css';var _ = t("search", [["path", {
14
- d: "m21 21-4.34-4.34",
15
- key: "14j7rj"
16
- }], ["circle", {
17
- cx: "11",
18
- cy: "11",
19
- r: "8",
20
- key: "4ej97u"
21
- }]]), v = {
22
- container: "_container_onquj_1",
23
- inner: "_inner_onquj_12",
24
- inputContainer: "_inputContainer_onquj_17",
25
- medium: "_medium_onquj_23",
26
- icon: "_icon_onquj_28",
27
- clear: "_clear_onquj_40",
28
- input: "_input_onquj_17"
29
- }, y = {
30
- en: { search: "Search" },
31
- sv: { search: "Sök" }
32
- };
33
- //#endregion
34
- //#region src/search-field/SearchField.tsx
35
- function b(e) {
36
- return !!e?.length;
37
- }
38
- var x = ({ errorPosition: t = "top", size: x = "large", showButton: S, className: C, errorMessage: w, placeholder: T, label: E, description: D, popover: O, validationBehavior: k, inputMode: A = "search", ...j }) => {
39
- let M = r(y), N = p(u), P = k ?? N?.validationBehavior ?? "aria", F = S !== !1, I = (e) => {
40
- e && !j.isInvalid && (j.validate && b(j.validate(e)) || j.onSubmit?.(e));
41
- };
42
- return /* @__PURE__ */ h(f, {
43
- ...j,
44
- inputMode: A,
45
- onSubmit: I,
46
- "aria-label": E ? j["aria-label"] : j["aria-label"] ?? T,
47
- className: e(v.container, C),
48
- validationBehavior: P,
49
- children: ({ state: r }) => /* @__PURE__ */ g(m, { children: [
50
- /* @__PURE__ */ h(a, {
51
- popover: O,
52
- children: E && /* @__PURE__ */ h(o, { children: E })
53
- }),
54
- D && /* @__PURE__ */ h(s, {
55
- slot: "description",
56
- children: D
57
- }),
58
- t === "top" && /* @__PURE__ */ h(c, { children: ({ validationErrors: e }) => w ?? e.join(" ") }),
59
- /* @__PURE__ */ g("div", {
60
- className: v.inner,
61
- children: [/* @__PURE__ */ g("div", {
62
- className: e(v.inputContainer, { [v.medium]: x === "medium" }),
63
- children: [
64
- /* @__PURE__ */ h(_, {
65
- size: 20,
66
- className: v.icon
67
- }),
68
- /* @__PURE__ */ h(d, {
69
- placeholder: T,
70
- className: e(l.input, v.input, { [v.medium]: x === "medium" }),
71
- onKeyDown: j.onSubmit ? void 0 : (e) => {
72
- e.key === "Enter" && r.value && !j.isInvalid && e.currentTarget.form?.requestSubmit();
73
- }
74
- }),
75
- r.value.length > 0 && /* @__PURE__ */ h(i, {
76
- variant: "icon",
77
- size: x,
78
- className: e(v.clear, { [v.medium]: x === "medium" }),
79
- children: /* @__PURE__ */ h(n, {
80
- size: 20,
81
- "aria-hidden": !0
82
- })
83
- })
84
- ]
85
- }), F && /* @__PURE__ */ h(i, {
86
- slot: null,
87
- excludeFromTabOrder: !0,
88
- size: x,
89
- isDisabled: j.isDisabled,
90
- type: "button",
91
- onPress: () => I(r.value),
92
- children: j.buttonText ?? M.format("search")
93
- })]
94
- }),
95
- t === "bottom" && /* @__PURE__ */ h(c, { children: ({ validationErrors: e }) => w ?? e.join(" ") })
96
- ] })
97
- });
98
- };
99
- //#endregion
100
- export { x as t };
@@ -1,177 +0,0 @@
1
- import { n as e, t } from "./clsx-Di52oYUU.js";
2
- import { t as n } from "./chevron-down-CP7nEDei.js";
3
- import { n as r } from "./checkbox-Bqd8B58G.js";
4
- import { t as i } from "./x-BJAOO5a5.js";
5
- import { t as a } from "./useLocalizedStringFormatter-CeyBc0x0.js";
6
- import { n as o, t as s } from "./label-LWlgvAwz.js";
7
- import { t as c } from "./popover-DGcogqbS.js";
8
- import { t as l } from "./text-DwmZ-ew8.js";
9
- import { t as u } from "./field-error-LtNtEKDp.js";
10
- import { c as d } from "./list-box-BN_MSiOD.js";
11
- import { n as f, r as p, t as m } from "./tag-BIcqtf7b.js";
12
- import h, { useContext as g } from "react";
13
- import { Button as _, Select as v, SelectStateContext as y, SelectValue as b } from "react-aria-components";
14
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
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 = h.useContext(y), t = a(E);
47
- return /* @__PURE__ */ S(r, {
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: t.format("selectAll")
57
- });
58
- }, k = ({ isDisabled: e }) => {
59
- let t = a(E), n = (e, n) => e.length === 1 ? n : `${e.length} ${t.format("selected")}`;
60
- return /* @__PURE__ */ S(b, {
61
- className: D.multiSelectValue,
62
- "data-disabled": e || void 0,
63
- children: ({ isPlaceholder: t, selectedItems: r, selectedText: i }) => t ? /* @__PURE__ */ S(x, {}) : /* @__PURE__ */ C("div", {
64
- className: D.selectValueTag,
65
- "data-disabled": e || void 0,
66
- children: [/* @__PURE__ */ S("span", {
67
- className: D.truncate,
68
- children: n(r, i)
69
- }), /* @__PURE__ */ S(A, { isDisabled: e })]
70
- })
71
- });
72
- }, A = ({ isDisabled: e }) => {
73
- let t = h.useContext(y), n = a(E), r = T();
74
- return /* @__PURE__ */ S(_, {
75
- "aria-label": n.format("clearAll"),
76
- className: D.clearButton,
77
- onPress: () => {
78
- r?.focusFirst(), t?.selectionManager.clearSelection();
79
- },
80
- slot: null,
81
- isDisabled: e,
82
- children: /* @__PURE__ */ S(i, {
83
- width: 20,
84
- height: 20
85
- })
86
- });
87
- }, j = ({ showTags: e, isDisabled: t }) => {
88
- let n = a(E), r = g(y);
89
- return !r?.selectedItems.length || !e ? null : /* @__PURE__ */ S(m, {
90
- "aria-label": n.format("selectedItems"),
91
- className: D.tagGroup,
92
- onRemove: (e) => {
93
- r?.selectionManager.toggleSelection(Array.from(e)[0]);
94
- },
95
- selectionBehavior: "toggle",
96
- children: /* @__PURE__ */ S(f, {
97
- items: r.selectedItems,
98
- children: (e) => /* @__PURE__ */ S(p, {
99
- isDismissable: !0,
100
- id: e.key,
101
- isDisabled: t,
102
- textValue: e.textValue,
103
- children: e.textValue
104
- }, e.key)
105
- })
106
- });
107
- }, M = ({ isDisabled: t, selectionMode: r, size: i }) => {
108
- let a = g(y);
109
- return /* @__PURE__ */ C(_, {
110
- className: e({
111
- [D.medium]: i === "medium",
112
- [D.small]: i === "small"
113
- }, D.trigger),
114
- "data-invalid": !!a?.displayValidation.isInvalid || void 0,
115
- children: [/* @__PURE__ */ S(b, {
116
- className: D.selectValue,
117
- "data-disabled": t || void 0,
118
- children: ({ selectedText: e, defaultChildren: t }) => /* @__PURE__ */ S("div", {
119
- className: D.placeholder,
120
- children: /* @__PURE__ */ S("span", {
121
- className: D.truncate,
122
- children: r === "multiple" && e ? null : e || t
123
- })
124
- })
125
- }), /* @__PURE__ */ S("span", {
126
- "aria-hidden": "true",
127
- className: D.icon,
128
- children: /* @__PURE__ */ S(n, { size: 20 })
129
- })]
130
- });
131
- };
132
- //#endregion
133
- //#region src/select/Select.tsx
134
- function N({ children: e, description: n, errorMessage: r, errorPosition: i = "top", items: a, label: f, popover: p, popoverProps: m, listBoxProps: h, size: g = "large", ..._ }) {
135
- return /* @__PURE__ */ S(w, { children: /* @__PURE__ */ C(v, {
136
- ..._,
137
- className: t(_.className, D.select),
138
- children: [
139
- /* @__PURE__ */ S(o, {
140
- popover: p,
141
- children: f && /* @__PURE__ */ S(s, {
142
- "data-disabled": _.isDisabled || void 0,
143
- children: f
144
- })
145
- }),
146
- n && /* @__PURE__ */ S(l, {
147
- slot: "description",
148
- children: n
149
- }),
150
- i === "top" && /* @__PURE__ */ S(u, { children: r }),
151
- /* @__PURE__ */ C("div", {
152
- className: D.triggerContainer,
153
- "data-disabled": _.isDisabled || void 0,
154
- children: [/* @__PURE__ */ S(M, {
155
- size: g,
156
- ..._
157
- }), _.selectionMode === "multiple" ? /* @__PURE__ */ S(k, { ..._ }) : null]
158
- }),
159
- i === "bottom" && /* @__PURE__ */ S(u, { children: r }),
160
- /* @__PURE__ */ C(c, {
161
- offset: 1,
162
- hideArrow: !0,
163
- ...m,
164
- className: t(m?.className, D.popover),
165
- children: [_.isSelectableAll && /* @__PURE__ */ S(O, {}), /* @__PURE__ */ S(d, {
166
- escapeKeyBehavior: "none",
167
- items: a,
168
- ...h,
169
- children: e
170
- })]
171
- }),
172
- /* @__PURE__ */ S(j, { ..._ })
173
- ]
174
- }) });
175
- }
176
- //#endregion
177
- export { M as n, N as t };
@@ -1,32 +0,0 @@
1
- import { t as e } from "./clsx-Di52oYUU.js";
2
- import { t } from "./createLucideIcon-BgluSHFG.js";
3
- import { t as n } from "./useLocalizedStringFormatter-CeyBc0x0.js";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
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 = t("loader-circle", [["path", {
12
- d: "M21 12a9 9 0 1 1-6.219-8.56",
13
- key: "13zald"
14
- }]]), c = {
15
- en: { loadingPleaseWait: "Loading, please wait..." },
16
- sv: { loadingPleaseWait: "Laddar, vänligen vänta..." }
17
- }, l = ({ small: t, color: l, className: u }) => {
18
- let d = n(c);
19
- return /* @__PURE__ */ i("div", {
20
- className: e(o.container, u),
21
- role: "status",
22
- children: [/* @__PURE__ */ r(s, {
23
- className: e(o.spinner, !t && o.large),
24
- size: t ? 20 : 96,
25
- strokeWidth: t ? 2 : 8,
26
- absoluteStrokeWidth: !0,
27
- color: l
28
- }), /* @__PURE__ */ r(a, { children: d.format("loadingPleaseWait") })]
29
- });
30
- };
31
- //#endregion
32
- export { l as t };
@@ -1,17 +0,0 @@
1
- import { t as e } from "./createLucideIcon-BgluSHFG.js";
2
- var t = e("square-arrow-out-up-right", [
3
- ["path", {
4
- d: "M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",
5
- key: "y09zxi"
6
- }],
7
- ["path", {
8
- d: "m21 3-9 9",
9
- key: "mpx6sq"
10
- }],
11
- ["path", {
12
- d: "M15 3h6v6",
13
- key: "1q9fwt"
14
- }]
15
- ]);
16
- //#endregion
17
- export { t };
@@ -1,150 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./clsx-Di52oYUU.js";
3
- import { t } from "./createLucideIcon-BgluSHFG.js";
4
- import { n } from "./checkbox-Bqd8B58G.js";
5
- import { Button as r, Cell as i, Collection as a, Column as o, Row as s, Table as c, TableBody as l, TableHeader as u, useTableOptions as d } from "react-aria-components";
6
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
7
- import '../assets/table.css';var h = t("arrow-down", [["path", {
8
- d: "M12 5v14",
9
- key: "s699le"
10
- }], ["path", {
11
- d: "m19 12-7 7-7-7",
12
- key: "1idqje"
13
- }]]), g = t("arrow-up-down", [
14
- ["path", {
15
- d: "m21 16-4 4-4-4",
16
- key: "f6ql7i"
17
- }],
18
- ["path", {
19
- d: "M17 20V4",
20
- key: "1ejh1v"
21
- }],
22
- ["path", {
23
- d: "m3 8 4-4 4 4",
24
- key: "11wl7u"
25
- }],
26
- ["path", {
27
- d: "M7 4v16",
28
- key: "1glfcx"
29
- }]
30
- ]), _ = t("arrow-up", [["path", {
31
- d: "m5 12 7-7 7 7",
32
- key: "hav0vg"
33
- }], ["path", {
34
- d: "M12 19V5",
35
- key: "x0mq9r"
36
- }]]), v = t("grip-vertical", [
37
- ["circle", {
38
- cx: "9",
39
- cy: "12",
40
- r: "1",
41
- key: "1vctgf"
42
- }],
43
- ["circle", {
44
- cx: "9",
45
- cy: "5",
46
- r: "1",
47
- key: "hp0tcf"
48
- }],
49
- ["circle", {
50
- cx: "9",
51
- cy: "19",
52
- r: "1",
53
- key: "fkjjf6"
54
- }],
55
- ["circle", {
56
- cx: "15",
57
- cy: "12",
58
- r: "1",
59
- key: "1tmaij"
60
- }],
61
- ["circle", {
62
- cx: "15",
63
- cy: "5",
64
- r: "1",
65
- key: "19l28e"
66
- }],
67
- ["circle", {
68
- cx: "15",
69
- cy: "19",
70
- r: "1",
71
- key: "f4zoj3"
72
- }]
73
- ]), y = {
74
- table: "_table_1lyes_1",
75
- tableHeader: "_tableHeader_1lyes_11",
76
- column: "_column_1lyes_12",
77
- sortIndicator: "_sortIndicator_1lyes_29",
78
- sortIconNeutral: "_sortIconNeutral_1lyes_37",
79
- selection: "_selection_1lyes_56",
80
- row: "_row_1lyes_62",
81
- cell: "_cell_1lyes_81",
82
- narrow: "_narrow_1lyes_98",
83
- medium: "_medium_1lyes_121",
84
- striped: "_striped_1lyes_132"
85
- }, b = ({ size: t = "large", striped: n = !1, className: r, ...i }) => /* @__PURE__ */ p(c, {
86
- className: e(y.table, r, {
87
- [y.medium]: t === "medium",
88
- [y.striped]: n
89
- }),
90
- ...i
91
- }), x = ({ columns: t, children: r, className: i }) => {
92
- let { selectionBehavior: o, selectionMode: s, allowsDragging: c } = d();
93
- return /* @__PURE__ */ m(u, {
94
- className: e(i, y.tableHeader),
95
- children: [
96
- c && /* @__PURE__ */ p(C, {}),
97
- o === "toggle" && /* @__PURE__ */ p(C, {
98
- width: 50,
99
- children: s === "multiple" && /* @__PURE__ */ p(n, {
100
- className: y.selection,
101
- slot: "selection"
102
- })
103
- }),
104
- /* @__PURE__ */ p(a, {
105
- items: t,
106
- children: r
107
- })
108
- ]
109
- });
110
- }, S = ({ id: t, columns: i, children: o, className: c, ...l }) => {
111
- let { selectionBehavior: u, allowsDragging: f } = d();
112
- return /* @__PURE__ */ m(s, {
113
- id: t,
114
- className: e(c, y.row),
115
- ...l,
116
- children: [
117
- f && /* @__PURE__ */ p(w, { children: /* @__PURE__ */ p(r, {
118
- slot: "drag",
119
- children: /* @__PURE__ */ p(v, { size: 20 })
120
- }) }),
121
- u === "toggle" && /* @__PURE__ */ p(w, { children: /* @__PURE__ */ p(n, {
122
- className: y.selection,
123
- slot: "selection"
124
- }) }),
125
- /* @__PURE__ */ p(a, {
126
- items: i,
127
- children: o
128
- })
129
- ]
130
- });
131
- }, C = ({ children: t, className: n, ...r }) => /* @__PURE__ */ p(o, {
132
- className: e(n, y.column),
133
- ...r,
134
- children: ({ allowsSorting: e, sortDirection: n }) => /* @__PURE__ */ m(f, { children: [t, e && /* @__PURE__ */ p("span", {
135
- "aria-hidden": "true",
136
- className: y.sortIndicator,
137
- children: n === "ascending" ? /* @__PURE__ */ p(_, { size: 16 }) : n === "descending" ? /* @__PURE__ */ p(h, { size: 16 }) : /* @__PURE__ */ p(g, {
138
- size: 16,
139
- className: y.sortIconNeutral
140
- })
141
- })] })
142
- }), w = ({ className: t, ...n }) => /* @__PURE__ */ p(i, {
143
- className: e(t, y.cell),
144
- ...n
145
- }), T = ({ className: t, ...n }) => /* @__PURE__ */ p(l, {
146
- className: e(t, y.tableBody),
147
- ...n
148
- });
149
- //#endregion
150
- export { T as a, b as i, C as n, x as o, S as r, w as t };
@@ -1,78 +0,0 @@
1
- import { t as e } from "./clsx-Di52oYUU.js";
2
- import { t } from "./x-BJAOO5a5.js";
3
- import { n } from "./button-CenXTGXL.js";
4
- import { Children as r, forwardRef as i, isValidElement as a } from "react";
5
- import { Tag as o, TagGroup as s, TagGroupContext as c, TagList as l, TagListContext as u, composeRenderProps as d, useContextProps as f } from "react-aria-components";
6
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
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: r, color: i, dismissable: a = !1, isDismissable: s, type: c, ...l }) => {
28
- let u = s || s === void 0 && a;
29
- return /* @__PURE__ */ m(o, {
30
- className: e(g.tag, u && g.dismissable, {
31
- [g.sky]: i === "sky",
32
- [g.blue]: i === "blue" || !i && c === "info",
33
- [g.mint]: i === "mint",
34
- [g.green]: i === "green" || !i && c === "success",
35
- [g.cream]: i === "cream",
36
- [g.yellow]: i === "yellow" || !i && c === "important",
37
- [g.teal]: i === "teal",
38
- [g.lagoon]: i === "lagoon",
39
- [g.lagoonblue]: i === "lagoonblue",
40
- [g.lavender]: i === "lavender",
41
- [g.purple]: i === "purple",
42
- [g.peach]: i === "peach",
43
- [g.orange]: i === "orange",
44
- [g.pippin]: i === "pippin",
45
- [g.red]: i === "red" || !i && c === "warning"
46
- }, r),
47
- ...l,
48
- textValue: l.textValue || (typeof l.children == "string" ? l.children : void 0),
49
- children: d(l.children, (e) => /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
50
- className: g.tagText,
51
- children: e
52
- }), u && /* @__PURE__ */ m(n, {
53
- variant: "icon",
54
- size: "medium",
55
- className: g.button,
56
- slot: "remove",
57
- children: /* @__PURE__ */ m(t, { size: 20 })
58
- })] }))
59
- });
60
- }, v = { tagList: "_tagList_17pz2_1" }, y = i((t, n) => {
61
- let [{ className: r, ...i }, a] = f(t, n, u);
62
- return /* @__PURE__ */ m(l, {
63
- className: e(r, v.tagList),
64
- ref: a,
65
- ...i
66
- });
67
- }), b = i((t, n) => {
68
- let [{ className: i, children: o, ...l }, u] = f(t, n, c), d = r.toArray(o).filter(a).find((e) => e.type === y);
69
- return !d && 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__ */ m(s, {
70
- className: e(i),
71
- ref: u,
72
- ...l,
73
- children: d ? o : /* @__PURE__ */ m(y, { children: o })
74
- });
75
- });
76
- b.displayName = "TagGroup";
77
- //#endregion
78
- export { y as n, _ as r, b as t };
@@ -1,112 +0,0 @@
1
- 'use client';
2
- import { n as e, t } from "./clsx-Di52oYUU.js";
3
- import { t as n } from "./useLocalizedStringFormatter-CeyBc0x0.js";
4
- import { n as r } from "./button-CenXTGXL.js";
5
- import { n as i, t as a } from "./label-LWlgvAwz.js";
6
- import { t as o } from "./text-DwmZ-ew8.js";
7
- import { t as s } from "./field-error-LtNtEKDp.js";
8
- import { t as c } from "./character-counter-CSoVSrxZ.js";
9
- import { t as l } from "./TextField.module-BLGiCC4q.js";
10
- import { forwardRef as u, useState as d } from "react";
11
- import { Input as f, InputContext as p, TextArea as m, TextField as h, TextFieldContext as g, useContextProps as _ } from "react-aria-components";
12
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
13
- //#region src/textfield/TextFieldBase.tsx
14
- var b = u((t, n) => {
15
- [t] = _(t, n, g);
16
- let { label: r, description: u, errorMessage: d, showCounter: f, errorPosition: p = "top", size: m = "large", popover: b, children: x } = t;
17
- return /* @__PURE__ */ y(h, {
18
- ...t,
19
- className: e(l.textField, { [l.medium]: m === "medium" }),
20
- children: [
21
- /* @__PURE__ */ v(i, {
22
- popover: b,
23
- children: r && /* @__PURE__ */ v(a, { children: r })
24
- }),
25
- u && /* @__PURE__ */ v(o, {
26
- slot: "description",
27
- children: u
28
- }),
29
- f && /* @__PURE__ */ v(c, { isLonely: !u }),
30
- p === "top" && /* @__PURE__ */ v(s, {
31
- "data-testid": "fieldError",
32
- children: d
33
- }),
34
- x,
35
- p === "bottom" && /* @__PURE__ */ v(s, {
36
- "data-testid": "fieldError",
37
- className: l.bottomError,
38
- children: d
39
- })
40
- ]
41
- });
42
- });
43
- b.displayName = "TextFieldBase";
44
- var x = {
45
- en: {
46
- hide: "Hide",
47
- show: "Show",
48
- showPassword: "Show password"
49
- },
50
- sv: {
51
- hide: "Dölj",
52
- show: "Visa",
53
- showPassword: "Visa lösenord"
54
- }
55
- }, S = ({ showPassword: e, onToggle: t }) => {
56
- let i = n(x);
57
- return /* @__PURE__ */ v(r, {
58
- "aria-label": i.format("showPassword"),
59
- "aria-pressed": e,
60
- variant: "tertiary",
61
- onPress: t,
62
- className: l.passwordButton,
63
- children: e ? i.format("hide") : i.format("show")
64
- });
65
- }, C = u(({ skipContext: e = !1, ...n }, r) => {
66
- let [i, a] = _(n, r, p), o = e ? r : a, s = e ? n : i, c = s.type === "password", [u, m] = d(!1);
67
- return /* @__PURE__ */ y("div", {
68
- className: l.wrap,
69
- children: [/* @__PURE__ */ v(f, {
70
- ...s,
71
- ref: o,
72
- type: c && u ? "text" : s.type,
73
- className: t(l.input, s.className)
74
- }), c && /* @__PURE__ */ v(S, {
75
- showPassword: u,
76
- onToggle: () => m((e) => !e)
77
- })]
78
- });
79
- });
80
- C.displayName = "Input";
81
- //#endregion
82
- //#region src/textfield/TextField.tsx
83
- var w = u(({ className: e, list: n, type: r, min: i, max: a, form: o, ...s }, c) => /* @__PURE__ */ v(b, {
84
- ...s,
85
- children: /* @__PURE__ */ v(C, {
86
- className: t(e),
87
- form: o,
88
- list: n,
89
- min: i,
90
- max: a,
91
- ref: c,
92
- type: r,
93
- skipContext: !0
94
- })
95
- }));
96
- w.displayName = "TextField";
97
- //#endregion
98
- //#region src/textfield/TextArea.tsx
99
- var T = u(({ className: e, cols: n, form: r, rows: i, wrap: a, ...o }, s) => /* @__PURE__ */ v(b, {
100
- ...o,
101
- children: /* @__PURE__ */ v(m, {
102
- className: t(l.textArea, e),
103
- cols: n,
104
- form: r,
105
- ref: s,
106
- rows: i,
107
- wrap: a
108
- })
109
- }));
110
- T.displayName = "TextArea";
111
- //#endregion
112
- export { b as i, w as n, C as r, T as t };
@@ -1,10 +0,0 @@
1
- import { t as e } from "./createLucideIcon-BgluSHFG.js";
2
- var t = e("x", [["path", {
3
- d: "M18 6 6 18",
4
- key: "1bl5f8"
5
- }], ["path", {
6
- d: "m6 6 12 12",
7
- key: "d8bk6v"
8
- }]]);
9
- //#endregion
10
- export { t };
@@ -1,7 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { ColorSchemeSwitch } from './ColorSchemeSwitch';
3
- declare const meta: Meta<typeof ColorSchemeSwitch>;
4
- export default meta;
5
- type Story = StoryObj<typeof ColorSchemeSwitch>;
6
- export declare const Primary: Story;
7
- export declare const WithCallback: Story;