@midas-ds/components 1.0.2

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 (243) hide show
  1. package/Breadcrumbs.css +1 -0
  2. package/Button-CCevm2s3.js +183 -0
  3. package/Button.css +1 -0
  4. package/ButtonGroup.css +1 -0
  5. package/CHANGELOG.md +76 -0
  6. package/Card.css +1 -0
  7. package/Checkbox-CllWDBxF.js +405 -0
  8. package/Checkbox.css +1 -0
  9. package/Collection-B3xUVWPF.js +483 -0
  10. package/ComboBox.css +1 -0
  11. package/DatePicker.css +1 -0
  12. package/Dialog-CLTyYwkS.js +1889 -0
  13. package/DragAndDrop-OTN7La7U.js +42 -0
  14. package/Dropdown.css +1 -0
  15. package/FileUpload.css +1 -0
  16. package/Flex.css +1 -0
  17. package/Flex.module-CpoxBzQX.js +37 -0
  18. package/FocusScope-BR0SJ-cZ.js +512 -0
  19. package/Form-DXLoQL91.js +240 -0
  20. package/Grid.css +1 -0
  21. package/Grid.module-Ia0e9Dix.js +36 -0
  22. package/Group-DPMuN3h8.js +44 -0
  23. package/Hidden-BQWDvze4.js +37 -0
  24. package/InfoBanner.css +1 -0
  25. package/Label-C18A_4Z5.js +69 -0
  26. package/Layout.css +1 -0
  27. package/Link-BU1h3K2a.js +77 -0
  28. package/Link.css +1 -0
  29. package/LinkButton.css +1 -0
  30. package/ListBox-D21tdwTs.js +463 -0
  31. package/ListKeyboardDelegate-DxMjfMsI.js +172 -0
  32. package/Logo.css +1 -0
  33. package/Modal.css +1 -0
  34. package/MultiSelect.css +1 -0
  35. package/PressResponder-DP8ZDNGy.js +31 -0
  36. package/README.md +7 -0
  37. package/RSPContexts-EOiWkKOf.js +11 -0
  38. package/Radio.css +1 -0
  39. package/SearchField.css +1 -0
  40. package/Select.css +1 -0
  41. package/SelectionManager-D4WtKtey.js +988 -0
  42. package/Separator-DLUHK9vv.js +48 -0
  43. package/Spinner.css +1 -0
  44. package/Table.css +1 -0
  45. package/Tabs.css +1 -0
  46. package/Tag-CEd6WWSc.js +725 -0
  47. package/Tag.css +1 -0
  48. package/Text-DGLaY3HR.js +17 -0
  49. package/TextArea.css +1 -0
  50. package/TextField-C_hq9WeT.js +226 -0
  51. package/TextField.css +1 -0
  52. package/TextField.module-Cwq1FAm7.js +141 -0
  53. package/Toast.css +1 -0
  54. package/VisuallyHidden-B_XzVvlX.js +39 -0
  55. package/accordion/Accordion.d.ts +13 -0
  56. package/accordion/AccordionContent.d.ts +3 -0
  57. package/accordion/AccordionItem.d.ts +3 -0
  58. package/accordion/AccordionTagContext.d.ts +3 -0
  59. package/accordion/AccordionTrigger.d.ts +3 -0
  60. package/accordion/index.d.ts +5 -0
  61. package/breadcrumbs/Breadcrumbs.d.ts +9 -0
  62. package/breadcrumbs/index.d.ts +1 -0
  63. package/button/Button.d.ts +41 -0
  64. package/button/ButtonGroup.d.ts +12 -0
  65. package/button/index.d.ts +2 -0
  66. package/card/Card.d.ts +34 -0
  67. package/card/index.d.ts +1 -0
  68. package/checkbox/Checkbox.d.ts +2 -0
  69. package/checkbox/CheckboxGroup.d.ts +10 -0
  70. package/checkbox/index.d.ts +2 -0
  71. package/chevron-down-Cd1bkzXT.js +13 -0
  72. package/chevron-right-DBMc9VMi.js +23 -0
  73. package/clsx-OuTLNxxd.js +16 -0
  74. package/combobox/ComboBox.d.ts +12 -0
  75. package/combobox/index.d.ts +1 -0
  76. package/context-ScOIq_Gu.js +80 -0
  77. package/createLucideIcon-DeWljiyi.js +79 -0
  78. package/date-picker/DatePicker.d.ts +14 -0
  79. package/date-picker/index.d.ts +2 -0
  80. package/dropdown/Dropdown.d.ts +8 -0
  81. package/dropdown/index.d.ts +1 -0
  82. package/file-upload/FileUpload.d.ts +11 -0
  83. package/file-upload/index.d.ts +1 -0
  84. package/flex/Flex.d.ts +17 -0
  85. package/flex/FlexItem.d.ts +15 -0
  86. package/flex/index.d.ts +2 -0
  87. package/grid/Grid.d.ts +16 -0
  88. package/grid/GridItem.d.ts +7 -0
  89. package/grid/index.d.ts +2 -0
  90. package/index-CEg5vZQH.js +132 -0
  91. package/index-CgfokhRq.js +674 -0
  92. package/index-CorR1LBD.js +3122 -0
  93. package/index-Dl1Q-tbj.js +26984 -0
  94. package/index.css +1 -0
  95. package/index.d.ts +29 -0
  96. package/index.js +114 -0
  97. package/index10.js +4 -0
  98. package/index11.js +5 -0
  99. package/index12.js +4 -0
  100. package/index13.js +4 -0
  101. package/index14.js +4 -0
  102. package/index15.js +6 -0
  103. package/index16.js +6 -0
  104. package/index17.js +6 -0
  105. package/index18.js +4 -0
  106. package/index19.js +6 -0
  107. package/index2.js +8 -0
  108. package/index20.js +6 -0
  109. package/index21.js +4 -0
  110. package/index22.js +5 -0
  111. package/index23.js +5 -0
  112. package/index24.js +5 -0
  113. package/index25.js +6 -0
  114. package/index26.js +6 -0
  115. package/index27.js +6 -0
  116. package/index28.js +4 -0
  117. package/index29.js +12 -0
  118. package/index3.js +8 -0
  119. package/index30.js +20 -0
  120. package/index31.js +22 -0
  121. package/index32.js +14 -0
  122. package/index33.js +11 -0
  123. package/index34.js +31 -0
  124. package/index35.js +8 -0
  125. package/index36.js +9 -0
  126. package/index37.js +19 -0
  127. package/index38.js +9 -0
  128. package/index39.js +9 -0
  129. package/index4.js +4 -0
  130. package/index40.js +16 -0
  131. package/index41.js +16 -0
  132. package/index42.js +31 -0
  133. package/index43.js +16 -0
  134. package/index44.js +6 -0
  135. package/index45.js +53 -0
  136. package/index46.js +18 -0
  137. package/index47.js +27 -0
  138. package/index48.js +18 -0
  139. package/index49.js +21 -0
  140. package/index5.js +5 -0
  141. package/index50.js +49 -0
  142. package/index51.js +5 -0
  143. package/index52.js +25 -0
  144. package/index53.js +18 -0
  145. package/index54.js +9 -0
  146. package/index55.js +25 -0
  147. package/index56.js +18 -0
  148. package/index57.js +11 -0
  149. package/index58.js +12 -0
  150. package/index59.js +15 -0
  151. package/index6.js +4 -0
  152. package/index60.js +9 -0
  153. package/index61.js +9 -0
  154. package/index62.js +19 -0
  155. package/index63.js +22 -0
  156. package/index64.js +61 -0
  157. package/index65.js +15 -0
  158. package/index66.js +11 -0
  159. package/index67.js +63 -0
  160. package/index68.js +85 -0
  161. package/index69.js +74 -0
  162. package/index7.js +9 -0
  163. package/index70.js +24 -0
  164. package/index71.js +69 -0
  165. package/index72.js +80 -0
  166. package/index73.js +140 -0
  167. package/index74.js +70 -0
  168. package/index75.js +42 -0
  169. package/index76.js +82 -0
  170. package/index77.js +71 -0
  171. package/index78.js +104 -0
  172. package/index79.js +274 -0
  173. package/index8.js +4 -0
  174. package/index80.js +724 -0
  175. package/index81.js +491 -0
  176. package/index82.js +317 -0
  177. package/index83.js +391 -0
  178. package/index84.js +254 -0
  179. package/index85.js +1364 -0
  180. package/index86.js +1009 -0
  181. package/index87.js +388 -0
  182. package/index88.js +2105 -0
  183. package/index89.js +2371 -0
  184. package/index9.js +5 -0
  185. package/index90.js +6834 -0
  186. package/index91.js +17 -0
  187. package/index92.js +14 -0
  188. package/index93.js +6 -0
  189. package/index94.js +9 -0
  190. package/info-banner/InfoBanner.d.ts +21 -0
  191. package/info-banner/index.d.ts +1 -0
  192. package/intlStrings-Cd44R5hT.js +278 -0
  193. package/layout/Layout.d.ts +51 -0
  194. package/layout/index.d.ts +1 -0
  195. package/link/Link.d.ts +13 -0
  196. package/link/index.d.ts +1 -0
  197. package/link-button/LinkButton.d.ts +18 -0
  198. package/link-button/index.d.ts +1 -0
  199. package/logo/Logo.d.ts +16 -0
  200. package/logo/index.d.ts +1 -0
  201. package/modal/Modal.d.ts +13 -0
  202. package/modal/index.d.ts +1 -0
  203. package/multi-select/MultiSelect.d.ts +28 -0
  204. package/multi-select/index.d.ts +1 -0
  205. package/package.json +29 -0
  206. package/radio/Radio.d.ts +20 -0
  207. package/radio/index.d.ts +1 -0
  208. package/react.esm-D8HpDGKP.js +11060 -0
  209. package/search-field/SearchField.d.ts +13 -0
  210. package/search-field/index.d.ts +1 -0
  211. package/select/Select.d.ts +11 -0
  212. package/select/index.d.ts +1 -0
  213. package/spinner/Spinner.d.ts +11 -0
  214. package/spinner/index.d.ts +1 -0
  215. package/table/Table.d.ts +12 -0
  216. package/table/index.d.ts +1 -0
  217. package/tabs/Tabs.d.ts +12 -0
  218. package/tabs/index.d.ts +1 -0
  219. package/tag/Tag.d.ts +11 -0
  220. package/tag/index.d.ts +1 -0
  221. package/textarea/TextArea.d.ts +20 -0
  222. package/textarea/index.d.ts +1 -0
  223. package/textfield/TextField.d.ts +16 -0
  224. package/textfield/index.d.ts +3 -0
  225. package/theme/index.d.ts +138 -0
  226. package/theme/tokens.d.ts +135 -0
  227. package/toast/Toast.d.ts +25 -0
  228. package/toast/index.d.ts +1 -0
  229. package/tokens-CjXmpXTi.js +160 -0
  230. package/triangle-alert-1OYl9KWz.js +56 -0
  231. package/useControlledState-S_TYcV_c.js +45 -0
  232. package/useDescription-D4_zk_sA.js +32 -0
  233. package/useFilter-BnJDBCkt.js +35 -0
  234. package/useFocusRing-D97-G3fT.js +1324 -0
  235. package/useFocusable-C-N9wcwm.js +56 -0
  236. package/useGridSelectionCheckbox-i1rsjlC-.js +22 -0
  237. package/useHasTabbableChild-DeuCnGGv.js +34 -0
  238. package/useHighlightSelectionDescription-JVx2MW_e.js +552 -0
  239. package/useListState-DSOTbsL3.js +119 -0
  240. package/useLocalizedStringFormatter-DVCAZqcL.js +96 -0
  241. package/useSingleSelectListState-CmX9_L5H.js +34 -0
  242. package/useUpdateEffect-Dtz-i14F.js +12 -0
  243. package/x-JK7i-TQC.js +14 -0
package/Tag.css ADDED
@@ -0,0 +1 @@
1
+ ._button_m4kn4_4{min-height:unset;padding:.25rem!important;border-radius:1.5rem}._button_m4kn4_4[data-pressed]{background-color:#d9d9d9}._tag_m4kn4_14{display:inline-flex;align-items:center;border-radius:1.25rem;background-color:#f2f2f2;font-size:.875rem;font-family:Inter,sans-serif}._tag_m4kn4_14[data-disabled]{color:#bfbfbf;pointer-events:none;background-color:#f2f2f2;border-color:#bfbfbf}._tag_m4kn4_14[data-focused],._tag_m4kn4_14[data-focus-visible]{outline:none}._tag_m4kn4_14._dismissable_m4kn4_34[data-focus-visible]{outline-offset:2px;outline:2px solid #000000}._tagText_m4kn4_42{line-height:1.15;padding:.25rem .75rem .25rem .5rem}._tagList_m4kn4_47{display:flex;flex-wrap:wrap;gap:.25rem}
@@ -0,0 +1,17 @@
1
+ import { a as r } from "./useFocusRing-D97-G3fT.js";
2
+ import o, { forwardRef as $, createContext as f } from "react";
3
+ const n = /* @__PURE__ */ f({});
4
+ function m(e, t) {
5
+ [e, t] = r(e, t, n);
6
+ let { elementType: a = "span", ...c } = e;
7
+ return /* @__PURE__ */ o.createElement(a, {
8
+ className: "react-aria-Text",
9
+ ...c,
10
+ ref: t
11
+ });
12
+ }
13
+ const s = /* @__PURE__ */ $(m);
14
+ export {
15
+ n as $,
16
+ s as a
17
+ };
package/TextArea.css ADDED
@@ -0,0 +1 @@
1
+ ._textArea_1tbo6_4{all:unset;display:flex!important;grid-area:Input;border-bottom:1px solid #000000;align-items:center;justify-content:center;font-size:1rem;padding:1rem 1rem 1.25rem;background-color:#f2f2f2;box-sizing:border-box;word-wrap:break-word;width:100%}._textArea_1tbo6_4:hover{background-color:#e6e6e6}._textArea_1tbo6_4[data-focused],._textArea_1tbo6_4[data-focus-visible]{box-shadow:0 0 0 2px #fff,0 0 0 4px #000}._textArea_1tbo6_4[data-invalid]{border:none;box-shadow:inset 0 0 0 3px #e62323}._textArea_1tbo6_4[data-disabled]{pointer-events:none;background-color:#f2f2f2;border:none;opacity:.7}._count_1tbo6_40{font-size:.875rem;color:#1f1f1f;text-align:right;grid-area:Count;align-self:flex-end}._countExceeded_1tbo6_48{color:#e62323}
@@ -0,0 +1,226 @@
1
+ import { jsx as r, jsxs as u, Fragment as I } from "react/jsx-runtime";
2
+ import $, { forwardRef as E, createContext as w, useRef as B, useState as S, useCallback as D } from "react";
3
+ import { c as V, d as k, e as O } from "./Form-DXLoQL91.js";
4
+ import { $ as _, a as q, T as i, b as A } from "./TextField.module-Cwq1FAm7.js";
5
+ import { a as j, b as C } from "./Label-C18A_4Z5.js";
6
+ import { $ as W, a as T } from "./Text-DGLaY3HR.js";
7
+ import { a as N, b as L, c as z, d as y, e as G, u as J, v as K, w as M, n as Q, x as U } from "./useFocusRing-D97-G3fT.js";
8
+ import { Button as X } from "./index69.js";
9
+ import { c as Y } from "./clsx-OuTLNxxd.js";
10
+ const H = /* @__PURE__ */ w({});
11
+ let Z = (e) => {
12
+ let { onHoverStart: t, onHoverChange: a, onHoverEnd: d, ...s } = e;
13
+ return s;
14
+ };
15
+ function ee(e, t) {
16
+ [e, t] = N(e, t, H);
17
+ let { hoverProps: a, isHovered: d } = L(e), { isFocused: s, isFocusVisible: n, focusProps: c } = z({
18
+ isTextInput: !0,
19
+ autoFocus: e.autoFocus
20
+ }), o = !!e["aria-invalid"] && e["aria-invalid"] !== "false", f = y({
21
+ ...e,
22
+ values: {
23
+ isHovered: d,
24
+ isFocused: s,
25
+ isFocusVisible: n,
26
+ isDisabled: e.disabled || !1,
27
+ isInvalid: o
28
+ },
29
+ defaultClassName: "react-aria-TextArea"
30
+ });
31
+ return /* @__PURE__ */ $.createElement("textarea", {
32
+ ...G(Z(e), c, a),
33
+ ...f,
34
+ ref: t,
35
+ "data-focused": s || void 0,
36
+ "data-disabled": e.disabled || void 0,
37
+ "data-hovered": d || void 0,
38
+ "data-focus-visible": n || void 0,
39
+ "data-invalid": o || void 0
40
+ });
41
+ }
42
+ const pe = /* @__PURE__ */ E(ee), te = /* @__PURE__ */ w(null);
43
+ function ae(e, t) {
44
+ [e, t] = N(e, t, te);
45
+ let { validationBehavior: a } = J(V) || {};
46
+ var d, s;
47
+ let n = (s = (d = e.validationBehavior) !== null && d !== void 0 ? d : a) !== null && s !== void 0 ? s : "native", c = B(null), [o, f] = K(), [p, b] = S("input"), { labelProps: x, inputProps: v, descriptionProps: l, errorMessageProps: m, ...h } = _({
48
+ ...M(e),
49
+ inputElementType: p,
50
+ label: f,
51
+ validationBehavior: n
52
+ }, c), g = D((P) => {
53
+ c.current = P, P && b(P instanceof HTMLTextAreaElement ? "textarea" : "input");
54
+ }, []), F = y({
55
+ ...e,
56
+ values: {
57
+ isDisabled: e.isDisabled || !1,
58
+ isInvalid: h.isInvalid,
59
+ isReadOnly: e.isReadOnly || !1,
60
+ isRequired: e.isRequired || !1
61
+ },
62
+ defaultClassName: "react-aria-TextField"
63
+ }), R = Q(e);
64
+ return delete R.id, /* @__PURE__ */ $.createElement("div", {
65
+ ...R,
66
+ ...F,
67
+ ref: t,
68
+ slot: e.slot || void 0,
69
+ "data-disabled": e.isDisabled || void 0,
70
+ "data-invalid": h.isInvalid || void 0,
71
+ "data-readonly": e.isReadOnly || void 0,
72
+ "data-required": e.isRequired || void 0
73
+ }, /* @__PURE__ */ $.createElement(U, {
74
+ values: [
75
+ [
76
+ j,
77
+ {
78
+ ...x,
79
+ ref: o
80
+ }
81
+ ],
82
+ [
83
+ q,
84
+ {
85
+ ...v,
86
+ ref: g
87
+ }
88
+ ],
89
+ [
90
+ H,
91
+ {
92
+ ...v,
93
+ ref: g
94
+ }
95
+ ],
96
+ [
97
+ W,
98
+ {
99
+ slots: {
100
+ description: l,
101
+ errorMessage: m
102
+ }
103
+ }
104
+ ],
105
+ [
106
+ k,
107
+ h
108
+ ]
109
+ ]
110
+ }, F.children));
111
+ }
112
+ const de = /* @__PURE__ */ E(ae), xe = ({
113
+ label: e,
114
+ description: t,
115
+ errorMessage: a,
116
+ validationType: d,
117
+ validate: s,
118
+ maxCharacters: n,
119
+ showCounter: c,
120
+ ...o
121
+ }) => {
122
+ const [f, p] = $.useState(""), b = (l) => {
123
+ const m = l.target.value;
124
+ p(m);
125
+ }, x = (l) => d === "ssn" ? se.test(l) ? null : "Felaktigt personnummer" : d instanceof RegExp ? new RegExp(d).test(l) ? null : a == null ? void 0 : a.toString() : n ? n && l.length > n ? `Du har angett ${l.length - n} tecken för mycket. Fältet är begränsat till ${n} tecken.` : null : s ? s(l) : !0, v = () => n ? /* @__PURE__ */ u(
126
+ "span",
127
+ {
128
+ className: Y(
129
+ i.count,
130
+ f.length > n && i.countExceeded
131
+ ),
132
+ children: [
133
+ f.length,
134
+ " / ",
135
+ n
136
+ ]
137
+ }
138
+ ) : c ? /* @__PURE__ */ r("span", { className: i.count, children: f.length }) : null;
139
+ return /* @__PURE__ */ r(
140
+ de,
141
+ {
142
+ className: i.inputField,
143
+ validate: x,
144
+ ...o,
145
+ children: /* @__PURE__ */ u(
146
+ ie,
147
+ {
148
+ label: e,
149
+ description: t,
150
+ errorMessage: a,
151
+ children: [
152
+ /* @__PURE__ */ r(v, {}),
153
+ /* @__PURE__ */ u("div", { className: i.wrap, children: [
154
+ /* @__PURE__ */ r(
155
+ A,
156
+ {
157
+ type: o.type,
158
+ className: i.input,
159
+ onChange: b,
160
+ onBlur: b
161
+ }
162
+ ),
163
+ /* @__PURE__ */ r(
164
+ ne,
165
+ {
166
+ type: o.type,
167
+ input: f
168
+ }
169
+ )
170
+ ] })
171
+ ]
172
+ }
173
+ )
174
+ }
175
+ );
176
+ }, ne = ({
177
+ type: e,
178
+ input: t
179
+ }) => {
180
+ const [a, d] = $.useState(!1);
181
+ return e === "password" ? /* @__PURE__ */ u(I, { children: [
182
+ a && /* @__PURE__ */ r(
183
+ T,
184
+ {
185
+ slot: "description",
186
+ className: i.passwordText,
187
+ children: t
188
+ }
189
+ ),
190
+ /* @__PURE__ */ r(
191
+ X,
192
+ {
193
+ variant: "tertiary",
194
+ onPress: () => d(!a),
195
+ className: i.passwordButton,
196
+ children: a ? "Dölj" : "Visa"
197
+ }
198
+ )
199
+ ] }) : null;
200
+ }, ie = ({
201
+ label: e,
202
+ description: t,
203
+ errorMessage: a,
204
+ children: d
205
+ }) => /* @__PURE__ */ u("div", { className: i.inputWrapper, children: [
206
+ e && /* @__PURE__ */ r(C, { className: i.label, children: e }),
207
+ t && /* @__PURE__ */ r(
208
+ T,
209
+ {
210
+ slot: "description",
211
+ className: i.text,
212
+ children: t
213
+ }
214
+ ),
215
+ /* @__PURE__ */ r(O, { className: i.fieldError, children: a }),
216
+ d
217
+ ] }), se = new RegExp(
218
+ "^(?:(?:19|20)?\\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\\d|3[01])(?:[-+ ]?\\d{4})?|\\d{4}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\\d|3[01])(?:[-+ ]?\\d{4}))$"
219
+ );
220
+ export {
221
+ de as $,
222
+ ie as I,
223
+ xe as T,
224
+ pe as a,
225
+ se as s
226
+ };
package/TextField.css ADDED
@@ -0,0 +1 @@
1
+ ._inputField_1kepw_4{height:100%}._inputField_1kepw_4[data-disabled]{color:#bfbfbf}._inputWrapper_1kepw_12{font-family:Inter,sans-serif;display:grid;grid-auto-columns:1fr;grid-auto-rows:1fr 1fr;grid-template-columns:1fr auto;grid-template-rows:min-content min-content min-content min-content;gap:.25rem .5rem;grid-template-areas:"Label Count" "Desc Count" "Error Error" "Input Input";height:100%;width:100%;align-content:flex-end}._label_1kepw_30{grid-area:Label;font-size:1rem;font-weight:500}._text_1kepw_36{grid-area:Desc;font-size:.875rem;font-weight:400}._fieldError_1kepw_42{color:#e62323;grid-area:Error;font-size:.875rem;display:flex;align-items:center;column-gap:.5rem;margin:.25rem 0;line-height:1.28}._fieldError_1kepw_42:before{content:"";background-color:#e62323;display:block;width:1rem;height:1rem;mask:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtdHJpYW5nbGUtYWxlcnQiPjxwYXRoIGQ9Im0yMS43MyAxOC04LTE0YTIgMiAwIDAgMC0zLjQ4IDBsLTggMTRBMiAyIDAgMCAwIDQgMjFoMTZhMiAyIDAgMCAwIDEuNzMtMyIvPjxwYXRoIGQ9Ik0xMiA5djQiLz48cGF0aCBkPSJNMTIgMTdoLjAxIi8+PC9zdmc+);-webkit-mask-size:1rem 1rem;mask-size:1rem 1rem;flex:0 0 auto;align-self:flex-start;margin:2px}._passwordText_1kepw_66{background-color:#f2f2f2;position:absolute;display:flex;align-items:center;z-index:2;top:0;left:1rem;width:calc(100% - 1rem);height:46px;pointer-events:none}._count_1kepw_79{font-size:.875rem;color:#1f1f1f;text-align:right;grid-area:Count;align-self:flex-end}._countExceeded_1kepw_87{color:#e62323}._input_1kepw_4{all:unset;grid-area:Input;border-bottom:1px solid #000000;min-height:48px;font-size:1rem;padding-left:1rem;line-height:1;background-color:#f2f2f2;border-radius:0;box-sizing:border-box;width:100%}._input_1kepw_4:hover{background-color:#e6e6e6}._input_1kepw_4:hover+._passwordText_1kepw_66{background-color:#e6e6e6}._input_1kepw_4[data-focused],._input_1kepw_4[data-focus-visible]{box-shadow:0 0 0 2px #fff,0 0 0 4px #000}._input_1kepw_4[data-invalid]{border:none;box-shadow:inset 0 0 0 3px #e62323}._input_1kepw_4[data-disabled]{pointer-events:none;background-color:#f2f2f2;border:none;opacity:.7}._wrap_1kepw_130{grid-area:Input;position:relative}._passwordButton_1kepw_135{background:transparent!important;border-color:transparent!important;position:absolute;width:max-content;right:0;top:0;box-sizing:border-box;cursor:pointer;z-index:3}
@@ -0,0 +1,141 @@
1
+ import y, { useEffect as w, createContext as C } from "react";
2
+ import { n as E, r as k, e as $, a as I, b as F, c as T, d as H } from "./useFocusRing-D97-G3fT.js";
3
+ import { $ as R, a as M, b as S } from "./Form-DXLoQL91.js";
4
+ import { $ as B } from "./useControlledState-S_TYcV_c.js";
5
+ import { $ as V } from "./Label-C18A_4Z5.js";
6
+ import { $ as W } from "./useFocusable-C-N9wcwm.js";
7
+ import { $ as D } from "./Hidden-BQWDvze4.js";
8
+ import './TextField.css';function xe(e, a) {
9
+ let { inputElementType: d = "input", isDisabled: n = !1, isRequired: t = !1, isReadOnly: r = !1, type: l = "text", validationBehavior: o = "aria" } = e, [i, u] = B(e.value, e.defaultValue || "", e.onChange), { focusableProps: b } = W(e, a), f = R({
10
+ ...e,
11
+ value: i
12
+ }), { isInvalid: c, validationErrors: p, validationDetails: v } = f.displayValidation, { labelProps: m, fieldProps: x, descriptionProps: _, errorMessageProps: g } = V({
13
+ ...e,
14
+ isInvalid: c,
15
+ errorMessage: e.errorMessage || p
16
+ }), P = E(e, {
17
+ labelable: !0
18
+ });
19
+ const h = {
20
+ type: l,
21
+ pattern: e.pattern
22
+ };
23
+ return M(a, i, u), S(e, f, a), w(() => {
24
+ if (a.current instanceof k(a.current).HTMLTextAreaElement) {
25
+ let s = a.current;
26
+ Object.defineProperty(s, "defaultValue", {
27
+ get: () => s.value,
28
+ set: () => {
29
+ },
30
+ configurable: !0
31
+ });
32
+ }
33
+ }, [
34
+ a
35
+ ]), {
36
+ labelProps: m,
37
+ inputProps: $(P, d === "input" ? h : void 0, {
38
+ disabled: n,
39
+ readOnly: r,
40
+ required: t && o === "native",
41
+ "aria-required": t && o === "aria" || void 0,
42
+ "aria-invalid": c || void 0,
43
+ "aria-errormessage": e["aria-errormessage"],
44
+ "aria-activedescendant": e["aria-activedescendant"],
45
+ "aria-autocomplete": e["aria-autocomplete"],
46
+ "aria-haspopup": e["aria-haspopup"],
47
+ value: i,
48
+ onChange: (s) => u(s.target.value),
49
+ autoComplete: e.autoComplete,
50
+ autoCapitalize: e.autoCapitalize,
51
+ maxLength: e.maxLength,
52
+ minLength: e.minLength,
53
+ name: e.name,
54
+ placeholder: e.placeholder,
55
+ inputMode: e.inputMode,
56
+ // Clipboard events
57
+ onCopy: e.onCopy,
58
+ onCut: e.onCut,
59
+ onPaste: e.onPaste,
60
+ // Composition events
61
+ onCompositionEnd: e.onCompositionEnd,
62
+ onCompositionStart: e.onCompositionStart,
63
+ onCompositionUpdate: e.onCompositionUpdate,
64
+ // Selection events
65
+ onSelect: e.onSelect,
66
+ // Input events
67
+ onBeforeInput: e.onBeforeInput,
68
+ onInput: e.onInput,
69
+ ...b,
70
+ ...x
71
+ }),
72
+ descriptionProps: _,
73
+ errorMessageProps: g,
74
+ isInvalid: c,
75
+ validationErrors: p,
76
+ validationDetails: v
77
+ };
78
+ }
79
+ const L = /* @__PURE__ */ C({});
80
+ let O = (e) => {
81
+ let { onHoverStart: a, onHoverChange: d, onHoverEnd: n, ...t } = e;
82
+ return t;
83
+ };
84
+ function q(e, a) {
85
+ [e, a] = I(e, a, L);
86
+ let { hoverProps: d, isHovered: n } = F(e), { isFocused: t, isFocusVisible: r, focusProps: l } = T({
87
+ isTextInput: !0,
88
+ autoFocus: e.autoFocus
89
+ }), o = !!e["aria-invalid"] && e["aria-invalid"] !== "false", i = H({
90
+ ...e,
91
+ values: {
92
+ isHovered: n,
93
+ isFocused: t,
94
+ isFocusVisible: r,
95
+ isDisabled: e.disabled || !1,
96
+ isInvalid: o
97
+ },
98
+ defaultClassName: "react-aria-Input"
99
+ });
100
+ return /* @__PURE__ */ y.createElement("input", {
101
+ ...$(O(e), l, d),
102
+ ...i,
103
+ ref: a,
104
+ "data-focused": t || void 0,
105
+ "data-disabled": e.disabled || void 0,
106
+ "data-hovered": n || void 0,
107
+ "data-focus-visible": r || void 0,
108
+ "data-invalid": o || void 0
109
+ });
110
+ }
111
+ const _e = /* @__PURE__ */ D(q), z = '"../theme/tokens.css"', U = '"Inter", sans-serif', j = "#ffdfdf", A = "#f2f2f2", N = "#e6e6e6", G = "#bfbfbf", J = "#000000", K = "#e62323", Q = "500", X = "400", Y = "#1f1f1f", Z = "0 0 0 2px #ffffff, 0 0 0 4px #000000", ee = "_inputField_1kepw_4", ae = "_inputWrapper_1kepw_12", te = "_label_1kepw_30", ne = "_text_1kepw_36", oe = "_fieldError_1kepw_42", ie = "_passwordText_1kepw_66", de = "_count_1kepw_79", re = "_countExceeded_1kepw_87", se = "_input_1kepw_4", le = "_wrap_1kepw_130", ce = "_passwordButton_1kepw_135", ge = {
112
+ tokens: z,
113
+ display: U,
114
+ signalRed10: j,
115
+ gray10: A,
116
+ gray20: N,
117
+ gray50: G,
118
+ black: J,
119
+ signalRed100: K,
120
+ mediumWeight: Q,
121
+ regularWeight: X,
122
+ inputText: Y,
123
+ focus: Z,
124
+ inputField: ee,
125
+ inputWrapper: ae,
126
+ label: te,
127
+ text: ne,
128
+ fieldError: oe,
129
+ passwordText: ie,
130
+ count: de,
131
+ countExceeded: re,
132
+ input: se,
133
+ wrap: le,
134
+ passwordButton: ce
135
+ };
136
+ export {
137
+ xe as $,
138
+ ge as T,
139
+ L as a,
140
+ _e as b
141
+ };
package/Toast.css ADDED
@@ -0,0 +1 @@
1
+ @keyframes _slideInEnd_i4o11_1{0%{transform:translate(calc(100% + 1rem));opacity:0}to{transform:translate(0);opacity:1}}@keyframes _slideOutEnd_i4o11_1{0%{transform:translate(0);opacity:1}to{transform:translate(calc(100% + 1rem));opacity:0}}@keyframes _slideInTop_i4o11_1{0%{transform:translateY(calc(-100% + 1rem));opacity:0}to{transform:translateY(1rem);opacity:1}}@keyframes _slideOutTop_i4o11_1{0%{transform:translateY(1rem);opacity:1}to{transform:translateY(calc(-100% + 1rem));opacity:0}}._toastRegion_i4o11_52{position:fixed;left:50%;top:calc(92px + 1rem);transform:translate(-50%);display:flex;flex-direction:column;gap:8px;border:none;width:calc(100% - 2rem);z-index:1001}._toastRegion_i4o11_52:focus-visible{outline:none}@media (min-width: 768px){._toastRegion_i4o11_52{width:unset;left:unset;transform:unset;top:calc(80px + 1rem);right:1rem}}._toast_i4o11_52{font-family:Inter,sans-serif;display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;background:#fff;color:#1f1f1f;padding-left:calc(1rem - 3px);border-left:3px solid transparent;width:calc(100% - 1rem);font-size:.875rem}._toast_i4o11_52[data-focus-visible],._toast_i4o11_52:focus-visible{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #000}._toast_i4o11_52._success_i4o11_96{--bg: #d5f2d9;--border: #008d3c;background:var(--bg);border-left-color:var(--border)}._toast_i4o11_52._info_i4o11_104{--bg: #eaf2f6;--border: #0066cc;background:var(--bg);border-left-color:var(--border)}._toast_i4o11_52._important_i4o11_112{--bg: #fff8e1;--border: #f1c21b;background:var(--bg);border-left-color:var(--border)}._toast_i4o11_52._warning_i4o11_120{--bg: #ffdfdf;--border: #e62323;background:var(--bg);border-left-color:var(--border)}._toast_i4o11_52 ._icon_i4o11_128{color:var(--border);flex:0 0 auto}@media (min-width: 768px){._toast_i4o11_52{width:18rem}}._toastContent_i4o11_138{padding:.875rem 0;display:flex;align-items:flex-start;gap:1rem}._toastMessage_i4o11_145{padding:.125rem 0 0;margin:0;line-height:1.2}._toast_i4o11_52[data-animation=entering]{animation-name:_slideInTop_i4o11_1;animation-duration:.5s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-direction:normal;animation-fill-mode:both}@media (min-width: 768px){._toast_i4o11_52[data-animation=entering]{animation-name:_slideInEnd_i4o11_1}}._toast_i4o11_52[data-animation=exiting]{animation-name:_slideOutTop_i4o11_1;animation-duration:.5s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-direction:normal;animation-fill-mode:both}@media (min-width: 768px){._toast_i4o11_52[data-animation=exiting]{animation-name:_slideOutEnd_i4o11_1}}
@@ -0,0 +1,39 @@
1
+ import { f as n, e as d } from "./useFocusRing-D97-G3fT.js";
2
+ import u, { useState as f, useMemo as p } from "react";
3
+ const a = {
4
+ border: 0,
5
+ clip: "rect(0 0 0 0)",
6
+ clipPath: "inset(50%)",
7
+ height: "1px",
8
+ margin: "-1px",
9
+ overflow: "hidden",
10
+ padding: 0,
11
+ position: "absolute",
12
+ width: "1px",
13
+ whiteSpace: "nowrap"
14
+ };
15
+ function $(t = {}) {
16
+ let { style: e, isFocusable: s } = t, [i, r] = f(!1), { focusWithinProps: l } = n({
17
+ isDisabled: !s,
18
+ onFocusWithinChange: (c) => r(c)
19
+ }), o = p(() => i ? e : e ? {
20
+ ...a,
21
+ ...e
22
+ } : a, [
23
+ i
24
+ ]);
25
+ return {
26
+ visuallyHiddenProps: {
27
+ ...l,
28
+ style: o
29
+ }
30
+ };
31
+ }
32
+ function y(t) {
33
+ let { children: e, elementType: s = "div", isFocusable: i, style: r, ...l } = t, { visuallyHiddenProps: o } = $(t);
34
+ return /* @__PURE__ */ u.createElement(s, d(l, o), e);
35
+ }
36
+ export {
37
+ $,
38
+ y as a
39
+ };
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { TextElementTag } from './AccordionTagContext';
3
+ import * as RadixAccordion from '@radix-ui/react-accordion';
4
+ type AccordionRootCombined = RadixAccordion.AccordionSingleProps | RadixAccordion.AccordionMultipleProps;
5
+ interface AccordionProps {
6
+ /** Pick a heading tag to be rendered as the title in each accordion */
7
+ headingTag?: TextElementTag;
8
+ }
9
+ /**
10
+ * Accordions are used primarily to reduce the direct amount of information on a page and to sort it clearly.
11
+ */
12
+ export declare const Accordion: React.ForwardRefExoticComponent<(AccordionRootCombined & AccordionProps) & React.RefAttributes<HTMLDivElement>>;
13
+ export {};
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ import * as RadixAccordion from '@radix-ui/react-accordion';
3
+ export declare const AccordionContent: React.ForwardRefExoticComponent<RadixAccordion.AccordionContentProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ import * as RadixAccordion from '@radix-ui/react-accordion';
3
+ export declare const AccordionItem: React.ForwardRefExoticComponent<RadixAccordion.AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,3 @@
1
+ export type TextElementTag = keyof Pick<JSX.IntrinsicElements, 'p' | 'span' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'strong' | 'em'>;
2
+ export declare const AccordionTagContext: import('react').Context<"p" | "span" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "strong" | "em">;
3
+ export declare const useAccordionTag: () => "p" | "span" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "strong" | "em";
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ import * as RadixAccordion from '@radix-ui/react-accordion';
3
+ export declare const AccordionTrigger: React.ForwardRefExoticComponent<RadixAccordion.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,5 @@
1
+ export { Accordion } from './Accordion';
2
+ export { AccordionItem } from './AccordionItem';
3
+ export { AccordionTrigger } from './AccordionTrigger';
4
+ export { AccordionContent } from './AccordionContent';
5
+ export { AccordionTagContext } from './AccordionTagContext';
@@ -0,0 +1,9 @@
1
+ export interface BreadcrumbProps {
2
+ items: MidasBreadcrumb[];
3
+ }
4
+ export interface MidasBreadcrumb {
5
+ href: string;
6
+ title: string;
7
+ isDisabled?: boolean;
8
+ }
9
+ export declare const Breadcrumbs: React.FC<BreadcrumbProps>;
@@ -0,0 +1 @@
1
+ export { Breadcrumbs } from './Breadcrumbs';
@@ -0,0 +1,41 @@
1
+ import { ButtonProps, ButtonRenderProps } from 'react-aria-components';
2
+ import { LucideIcon } from 'lucide-react';
3
+ import * as React from 'react';
4
+ export interface MidasButtonProps {
5
+ /**
6
+ * Primary button is used as a positive action in a flow. Always use one primary button and never a seconday button on it's own. When using just an icon you must pass an aria-label
7
+ *
8
+ * @default 'primary'
9
+ * */
10
+ variant?: 'primary' | 'secondary' | 'tertiary' | 'danger' | 'icon';
11
+ /**
12
+ * Adds width: 100%; for the button to span entire width of parent
13
+ *
14
+ * @default false
15
+ */
16
+ fullwidth?: boolean;
17
+ /** Choose between different button sizes */
18
+ size?: 'small';
19
+ /** Add an icon from lucide-react
20
+ *
21
+ * @see {@link https://lucide.dev/icons/}
22
+ */
23
+ icon?: LucideIcon;
24
+ /** Adjust icon size */
25
+ iconSize?: number;
26
+ /** Display your icon on the left och right side of the button text */
27
+ iconPlacement?: 'left' | 'right';
28
+ children?: React.ReactNode | ((values: ButtonRenderProps & {
29
+ defaultChildren: React.ReactNode | undefined;
30
+ }) => React.ReactNode) | string;
31
+ }
32
+ type MidasButton = MidasButtonProps & ButtonProps;
33
+ /**
34
+ * Button to perform various actions.
35
+ *
36
+ * @interface MidasButton
37
+ *
38
+ * @see {@link https://designsystem.migrationsverket.se/components/button}
39
+ */
40
+ export declare const Button: React.FC<MidasButton>;
41
+ export {};
@@ -0,0 +1,12 @@
1
+ export interface MidasButtonGroupProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ /** Set a descriptive lable for screen readers */
3
+ 'aria-label': string;
4
+ }
5
+ /**
6
+ * Group several buttons together.
7
+ *
8
+ * @interface MidasButtonGroupProps
9
+ *
10
+ * @see {@link https://designsystem.migrationsverket.se/components/button}
11
+ */
12
+ export declare const ButtonGroup: React.FC<MidasButtonGroupProps>;
@@ -0,0 +1,2 @@
1
+ export { Button } from './Button';
2
+ export { ButtonGroup } from './ButtonGroup';
package/card/Card.d.ts ADDED
@@ -0,0 +1,34 @@
1
+ import { Link, LinkProps, RouterProvider } from '../link/Link';
2
+ import * as React from 'react';
3
+ export interface CardProps<C extends React.ElementType = typeof Link> extends React.HTMLAttributes<HTMLDivElement> {
4
+ /** Optional image displayed at the top of card */
5
+ image?: {
6
+ source: string;
7
+ description: string;
8
+ };
9
+ /** Sets background to predetermined color
10
+ * @default false
11
+ * */
12
+ background?: boolean;
13
+ /** Header as h1 for the component rendered below image if there is one */
14
+ title: string;
15
+ /** Content as p element for the component */
16
+ content: string;
17
+ /** Props for when card element is clicked */
18
+ link: LinkProps<C>;
19
+ /** Adjust the tag to be used for the header
20
+ * @default 'h1'
21
+ */
22
+ headingTag?: React.ElementType;
23
+ /** Custom image component to be used instead of the default img tag */
24
+ customImageComponent?: React.ReactElement;
25
+ /** Custom link component to be used instead of the default a tag. For example your client side router link. */
26
+ customLinkComponent?: React.ElementType;
27
+ }
28
+ /**
29
+ * This component renders a card with optional image, title, content.
30
+ *
31
+ * @see {@link https://designsystem.migrationsverket.se/components/card/}
32
+ */
33
+ export declare const Card: React.FC<CardProps>;
34
+ export { RouterProvider };
@@ -0,0 +1 @@
1
+ export * from './Card';
@@ -0,0 +1,2 @@
1
+ import { CheckboxProps } from 'react-aria-components';
2
+ export declare const Checkbox: ({ children, ...props }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { CheckboxGroupProps as AriaCheckboxGroupProps, ValidationResult } from 'react-aria-components';
3
+ export interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'children'> {
4
+ children?: React.ReactNode;
5
+ label?: string;
6
+ description?: string;
7
+ showSelectAll?: boolean;
8
+ errorMessage?: string | ((validation: ValidationResult) => string);
9
+ }
10
+ export declare const CheckboxGroup: ({ label, description, errorMessage, showSelectAll, children, ...props }: CheckboxGroupProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Checkbox } from './Checkbox';
2
+ export { CheckboxGroup } from './CheckboxGroup';
@@ -0,0 +1,13 @@
1
+ import { c as o } from "./createLucideIcon-DeWljiyi.js";
2
+ /**
3
+ * @license lucide-react v0.453.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ const n = o("ChevronDown", [
9
+ ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
10
+ ]);
11
+ export {
12
+ n as C
13
+ };
@@ -0,0 +1,23 @@
1
+ import { c as e } from "./createLucideIcon-DeWljiyi.js";
2
+ /**
3
+ * @license lucide-react v0.453.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ const h = e("ChevronLeft", [
9
+ ["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
10
+ ]);
11
+ /**
12
+ * @license lucide-react v0.453.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */
17
+ const o = e("ChevronRight", [
18
+ ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
19
+ ]);
20
+ export {
21
+ h as C,
22
+ o as a
23
+ };