@midas-ds/components 17.29.0 → 17.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/accordion/index.js +1 -1
  3. package/button/Button.stories.d.ts +1 -1
  4. package/button/index.js +1 -1
  5. package/calendar/index.js +1 -1
  6. package/card/index.js +1 -1
  7. package/checkbox/index.js +1 -1
  8. package/chunks/FeedbackStatusIcon-DvMDGBGL.js +36 -0
  9. package/chunks/{accordion-DIVTJU3O.js → accordion-BzmYSOS3.js} +23 -23
  10. package/chunks/{button-CenXTGXL.js → button-C-WkFek9.js} +1 -1
  11. package/chunks/calendar-Bt1FLxqr.js +107 -0
  12. package/chunks/card-CdH2UMUW.js +103 -0
  13. package/chunks/checkbox-DiFQy3MS.js +106 -0
  14. package/chunks/clear-button-Bv0YGBNG.js +17 -0
  15. package/chunks/color-scheme-switch-0axiBsna.js +160 -0
  16. package/chunks/{combobox-DIou4Z-d.js → combobox-DkZbA3o4.js} +24 -24
  17. package/chunks/{date-field-BF2f9bSf.js → date-field-CPpWZqws.js} +2 -2
  18. package/chunks/date-picker-DQ7vCG5-.js +142 -0
  19. package/chunks/file-list-D8Zc1aYS.js +139 -0
  20. package/chunks/{info-banner-osR4e6nB.js → info-banner-BVKtmVKN.js} +14 -14
  21. package/chunks/label-Dw5p84T2.js +50 -0
  22. package/chunks/layout-CUAjEEuH.js +378 -0
  23. package/chunks/link-DHu1cTmz.js +44 -0
  24. package/chunks/link-button-DYg_0p4Y.js +44 -0
  25. package/chunks/{list-box-BN_MSiOD.js → list-box-DmEoMvX1.js} +1 -1
  26. package/chunks/menu-CP0Xvmx0.js +48 -0
  27. package/chunks/modal-B_uSoXZM.js +66 -0
  28. package/chunks/{progress-bar-CknF4qAm.js → progress-bar-BfFxpqUv.js} +1 -1
  29. package/chunks/{radio-BD1EuxSa.js → radio-_z6ObjYx.js} +1 -1
  30. package/chunks/search-field-Cp_HHDl4.js +91 -0
  31. package/chunks/select-Wy6NakdH.js +176 -0
  32. package/chunks/spinner-COGZlDJB.js +29 -0
  33. package/chunks/table-O_Y45Sb7.js +84 -0
  34. package/chunks/tag-RjuYlFZI.js +78 -0
  35. package/chunks/{textfield-BSvCsAyC.js → textfield-Bu0Hg2pJ.js} +2 -2
  36. package/chunks/{time-field-CmjGBQph.js → time-field-Cnp-dYhm.js} +3 -3
  37. package/chunks/{toast-gJgjitZF.js → toast-Dg3fVjSS.js} +20 -20
  38. package/clear-button/index.js +1 -1
  39. package/color-scheme-switch/index.js +1 -1
  40. package/combobox/index.js +1 -1
  41. package/date-field/index.js +1 -1
  42. package/date-picker/index.js +1 -1
  43. package/file-list/index.js +1 -1
  44. package/index.js +49 -48
  45. package/info-banner/index.js +1 -1
  46. package/label/index.js +1 -1
  47. package/layout/index.js +1 -1
  48. package/link/index.js +1 -1
  49. package/link-button/index.js +1 -1
  50. package/list-box/index.js +1 -1
  51. package/menu/index.js +1 -1
  52. package/modal/index.js +1 -1
  53. package/package.json +3 -2
  54. package/progress-bar/index.js +1 -1
  55. package/radio/index.js +1 -1
  56. package/search-field/index.js +1 -1
  57. package/select/index.js +1 -1
  58. package/spinner/index.js +1 -1
  59. package/table/index.js +1 -1
  60. package/tag/index.js +1 -1
  61. package/textfield/index.js +1 -1
  62. package/time-field/index.js +1 -1
  63. package/toast/index.js +1 -1
  64. package/chunks/FeedbackStatusIcon-DRI7WrSU.js +0 -54
  65. package/chunks/arrow-right-Db_H9KjE.js +0 -10
  66. package/chunks/calendar-Bl_obez5.js +0 -111
  67. package/chunks/card-zIYA-SQh.js +0 -103
  68. package/chunks/check-DV00NPU0.js +0 -7
  69. package/chunks/checkbox-Bqd8B58G.js +0 -110
  70. package/chunks/chevron-down-CP7nEDei.js +0 -7
  71. package/chunks/chevron-right-DwqboCdU.js +0 -7
  72. package/chunks/clear-button-D3I1X3yG.js +0 -17
  73. package/chunks/color-scheme-switch-DVZjdwc9.js +0 -203
  74. package/chunks/createLucideIcon-BgluSHFG.js +0 -39
  75. package/chunks/date-picker-DZivTUB_.js +0 -187
  76. package/chunks/file-list-B4vG_egr.js +0 -161
  77. package/chunks/info-jCyacVsy.js +0 -19
  78. package/chunks/label-LWlgvAwz.js +0 -50
  79. package/chunks/layout-Db5um0f7.js +0 -426
  80. package/chunks/link-BAgs4RwY.js +0 -59
  81. package/chunks/link-button-BuPMEGUj.js +0 -52
  82. package/chunks/menu-aT2IR0tO.js +0 -49
  83. package/chunks/modal-C-UsxdO0.js +0 -66
  84. package/chunks/search-field-GNTRFpzf.js +0 -100
  85. package/chunks/select-oLCNpryY.js +0 -177
  86. package/chunks/spinner-LdHPVms_.js +0 -32
  87. package/chunks/square-arrow-out-up-right-DkgXD7hj.js +0 -17
  88. package/chunks/table-CmNWoAYO.js +0 -150
  89. package/chunks/tag-BIcqtf7b.js +0 -78
  90. package/chunks/x-BJAOO5a5.js +0 -10
package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 17.30.0 (2026-10-09)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **components,layout,table-styles:** depend on lucide-react ([#1405](https://github.com/migrationsverket/midas/pull/1405))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated theme to 3.17.7
10
+
1
11
  ## 17.29.0 (2026-10-09)
2
12
 
3
13
  ### 🚀 Features
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../chunks/accordion-DIVTJU3O.js";
1
+ import { n as e, t } from "../chunks/accordion-BzmYSOS3.js";
2
2
  export { e as Accordion, t as AccordionItem };
@@ -17,7 +17,7 @@ export declare const PrimaryFullwidth: {
17
17
  export declare const Icon: {
18
18
  args: {
19
19
  children: undefined;
20
- icon: import('react').ForwardRefExoticComponent<Omit<import('lucide-react').LucideProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
20
+ icon: import('lucide-react').LucideIcon;
21
21
  variant: string;
22
22
  'aria-label': string;
23
23
  };
package/button/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../chunks/button-CenXTGXL.js";
1
+ import { n as e, t } from "../chunks/button-C-WkFek9.js";
2
2
  export { e as Button, t as ButtonGroup };
package/calendar/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../chunks/calendar-Bl_obez5.js";
1
+ import { n as e, t } from "../chunks/calendar-Bt1FLxqr.js";
2
2
  export { e as Calendar, t as RangeCalendar };
package/card/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../chunks/card-zIYA-SQh.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../chunks/card-CdH2UMUW.js";
2
2
  export { o as Card, n as CardActionArea, e as CardActions, i as CardBody, a as CardContent, c as CardHeader, s as CardImage, t as CardLink, r as CardTitle };
package/checkbox/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as e, n as t, r as n, t as r } from "../chunks/checkbox-Bqd8B58G.js";
1
+ import { i as e, n as t, r as n, t as r } from "../chunks/checkbox-DiFQy3MS.js";
2
2
  export { t as Checkbox, n as CheckboxButton, e as CheckboxField, r as CheckboxGroup };
@@ -0,0 +1,36 @@
1
+ import { t as e } from "./useLocalizedStringFormatter-CeyBc0x0.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ import { Check as n, Flag as r, Info as i, TriangleAlert as a } from "lucide-react";
4
+ var o = {
5
+ en: {
6
+ ok: "okay",
7
+ information: "information",
8
+ importantInformation: "important information",
9
+ warning: "warning"
10
+ },
11
+ sv: {
12
+ ok: "okej",
13
+ information: "information",
14
+ importantInformation: "viktig information",
15
+ warning: "varning"
16
+ }
17
+ }, s = {
18
+ success: n,
19
+ info: i,
20
+ important: r,
21
+ warning: a
22
+ }, c = {
23
+ success: "ok",
24
+ info: "information",
25
+ important: "importantInformation",
26
+ warning: "warning"
27
+ }, l = ({ status: n, "aria-label": r, size: i = 20, ...a }) => {
28
+ let l = e(o), u = s[n];
29
+ return /* @__PURE__ */ t(u, {
30
+ "aria-label": r || l.format(c[n]),
31
+ size: i,
32
+ ...a
33
+ });
34
+ };
35
+ //#endregion
36
+ export { l as t };
@@ -1,22 +1,22 @@
1
1
  'use client';
2
2
  import { t as e } from "./clsx-Di52oYUU.js";
3
- import { t } from "./chevron-down-CP7nEDei.js";
4
- import { t as n } from "./FeedbackStatusIcon-DRI7WrSU.js";
5
- import { n as r } from "./button-CenXTGXL.js";
6
- import { t as i } from "./heading-BEl_z-5T.js";
7
- import { createContext as a, useContext as o, useEffect as s } from "react";
8
- import { Disclosure as c, DisclosureGroup as l, DisclosurePanel as u, composeRenderProps as d } from "react-aria-components";
9
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
3
+ import { n as t } from "./button-C-WkFek9.js";
4
+ import { t as n } from "./heading-BEl_z-5T.js";
5
+ import { t as r } from "./FeedbackStatusIcon-DvMDGBGL.js";
6
+ import { createContext as i, useContext as a, useEffect as o } from "react";
7
+ import { Disclosure as s, DisclosureGroup as c, DisclosurePanel as l, composeRenderProps as u } from "react-aria-components";
8
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
9
+ import { ChevronDown as m } from "lucide-react";
10
10
  import '../assets/accordion.css';var h = {
11
11
  root: "_root_17bdp_1",
12
12
  contained: "_contained_17bdp_5",
13
13
  triggerButton: "_triggerButton_17bdp_12"
14
- }, g = a(void 0), _ = ({ children: t, className: n, isContained: r, size: i = "large", ...a }) => /* @__PURE__ */ p(g.Provider, {
14
+ }, g = i(void 0), _ = ({ children: t, className: n, isContained: r, size: i = "large", ...a }) => /* @__PURE__ */ f(g.Provider, {
15
15
  value: {
16
16
  isContained: r,
17
17
  size: i
18
18
  },
19
- children: /* @__PURE__ */ p(l, {
19
+ children: /* @__PURE__ */ f(c, {
20
20
  className: e(h.root, r ? h.contained : h.uncontained, n),
21
21
  ...a,
22
22
  children: t
@@ -40,45 +40,45 @@ import '../assets/accordion.css';var h = {
40
40
  content: "_content_1ghre_133",
41
41
  hasBackground: "_hasBackground_1ghre_138",
42
42
  header: "_header_1ghre_146"
43
- }, y = ({ title: a, children: l, className: h, headingLevel: _ = "h2", type: y, hasBackground: b = !0, size: x = "large", isContained: S, iconAriaLabel: C, ...w }) => {
44
- let T = o(g), E = S ?? T?.isContained ?? !1, D = typeof a == "object";
45
- return s(() => {
43
+ }, y = ({ title: i, children: c, className: h, headingLevel: _ = "h2", type: y, hasBackground: b = !0, size: x = "large", isContained: S, iconAriaLabel: C, ...w }) => {
44
+ let T = a(g), E = S ?? T?.isContained ?? !1, D = typeof i == "object";
45
+ return o(() => {
46
46
  y && !E && console.warn("AccordionItem: When 'type' is set, it is recommended to also set 'isContained' to true for visual consistency.");
47
- }, [y, E]), /* @__PURE__ */ p(c, {
47
+ }, [y, E]), /* @__PURE__ */ f(s, {
48
48
  ...w,
49
49
  className: e(v.item, y && E && v[y], (x === "medium" || T?.size === "medium") && v.medium, E && v.contained, h),
50
- children: d(l, (o) => /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
50
+ children: u(c, (a) => /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", {
51
51
  className: v.trigger,
52
- children: /* @__PURE__ */ m(r, {
52
+ children: /* @__PURE__ */ p(t, {
53
53
  className: v.triggerButton,
54
54
  slot: "trigger",
55
55
  variant: "icon",
56
56
  children: [
57
- /* @__PURE__ */ p(t, {
57
+ /* @__PURE__ */ f(m, {
58
58
  size: 20,
59
59
  className: v.chevronIcon
60
60
  }),
61
- /* @__PURE__ */ p("div", {
61
+ /* @__PURE__ */ f("div", {
62
62
  className: v.triggerMainContent,
63
- children: D ? a : /* @__PURE__ */ p(i, {
63
+ children: D ? i : /* @__PURE__ */ f(n, {
64
64
  level: 3,
65
65
  elementType: _,
66
66
  className: v.triggerText,
67
- children: a
67
+ children: i
68
68
  })
69
69
  }),
70
- y && E && /* @__PURE__ */ p(n, {
70
+ y && E && /* @__PURE__ */ f(r, {
71
71
  "aria-label": C,
72
72
  className: v.statusIcon,
73
73
  status: y
74
74
  })
75
75
  ]
76
76
  })
77
- }), /* @__PURE__ */ p(u, {
77
+ }), /* @__PURE__ */ f(l, {
78
78
  className: v.panel,
79
- children: /* @__PURE__ */ p("div", {
79
+ children: /* @__PURE__ */ f("div", {
80
80
  className: e(v.content, b && v.hasBackground),
81
- children: o
81
+ children: a
82
82
  })
83
83
  })] }))
84
84
  });
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { t as e } from "./clsx-Di52oYUU.js";
3
- import { t } from "./spinner-LdHPVms_.js";
3
+ import { t } from "./spinner-COGZlDJB.js";
4
4
  import { t as n } from "./Button.module-0C2ArlRs.js";
5
5
  import { forwardRef as r } from "react";
6
6
  import { Button as i, ButtonContext as a, composeRenderProps as o, useContextProps as s } from "react-aria-components";
@@ -0,0 +1,107 @@
1
+ import { n as e, t } from "./clsx-Di52oYUU.js";
2
+ import { n } from "./button-C-WkFek9.js";
3
+ import { t as r } from "./heading-BEl_z-5T.js";
4
+ import { t as i } from "./field-error-LtNtEKDp.js";
5
+ import { n as a } from "./select-Wy6NakdH.js";
6
+ import { a as o, c as s, o as c } from "./list-box-DmEoMvX1.js";
7
+ import * as l from "react";
8
+ import { Calendar as u, CalendarCell as d, CalendarGrid as f, CalendarMonthPicker as p, CalendarYearPicker as m, RangeCalendar as h, RangeCalendarContext as g, Select as _ } from "react-aria-components";
9
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
10
+ import { ChevronLeft as b, ChevronRight as x } from "lucide-react";
11
+ import '../assets/calendar.css';var S = {
12
+ container: "_container_mn6zv_1",
13
+ calendar: "_calendar_mn6zv_6",
14
+ day: "_day_mn6zv_28",
15
+ header: "_header_mn6zv_90",
16
+ pickers: "_pickers_mn6zv_130",
17
+ range: "_range_mn6zv_180"
18
+ }, C = ({ weekdayStyle: e = "short", isReadOnly: n }) => {
19
+ let r = !!l.useContext(g);
20
+ return /* @__PURE__ */ v(f, {
21
+ weekdayStyle: e,
22
+ children: (e) => /* @__PURE__ */ v(d, {
23
+ date: e,
24
+ className: t(S.day, r && S.range),
25
+ "data-readonly": n || void 0
26
+ })
27
+ });
28
+ }, w = ({ isDisabled: e, isReadOnly: t, items: n, ...r }) => /* @__PURE__ */ y(_, {
29
+ isDisabled: e,
30
+ "data-readonly": t || void 0,
31
+ ...r,
32
+ children: [/* @__PURE__ */ v(a, {
33
+ size: "small",
34
+ isDisabled: e
35
+ }), /* @__PURE__ */ v(o, { children: /* @__PURE__ */ v(s, {
36
+ items: n,
37
+ virtualized: !1,
38
+ size: "small",
39
+ children: (e) => /* @__PURE__ */ v(c, {
40
+ id: e.id,
41
+ textValue: e.formatted,
42
+ children: e.formatted
43
+ })
44
+ }) })]
45
+ }), T = ({ isDisabled: e, isReadOnly: t, showMonthYearPicker: i }) => {
46
+ let a = (n) => /* @__PURE__ */ v(w, {
47
+ ...n,
48
+ isDisabled: e,
49
+ isReadOnly: t
50
+ });
51
+ return /* @__PURE__ */ y("header", {
52
+ className: S.header,
53
+ children: [
54
+ /* @__PURE__ */ v(n, {
55
+ slot: "previous",
56
+ size: "medium",
57
+ "data-readonly": t || void 0,
58
+ children: /* @__PURE__ */ v(b, { size: 20 })
59
+ }),
60
+ i ? /* @__PURE__ */ y("div", {
61
+ className: S.pickers,
62
+ children: [/* @__PURE__ */ v(p, { children: a }), /* @__PURE__ */ v(m, { children: a })]
63
+ }) : /* @__PURE__ */ v(r, {
64
+ level: 3,
65
+ elementType: "h2",
66
+ "data-disabled": e || void 0
67
+ }),
68
+ /* @__PURE__ */ v(n, {
69
+ slot: "next",
70
+ size: "medium",
71
+ "data-readonly": t || void 0,
72
+ children: /* @__PURE__ */ v(x, { size: 20 })
73
+ })
74
+ ]
75
+ });
76
+ }, E = ({ className: t, errorMessage: n, showMonthYearPicker: r, ...a }) => /* @__PURE__ */ y("div", {
77
+ className: S.container,
78
+ children: [/* @__PURE__ */ y(u, {
79
+ className: e(S.calendar, t),
80
+ "data-readonly": a.isReadOnly || void 0,
81
+ ...a,
82
+ children: [/* @__PURE__ */ v(T, {
83
+ ...a,
84
+ showMonthYearPicker: r
85
+ }), /* @__PURE__ */ v(C, { ...a })]
86
+ }), /* @__PURE__ */ v(i, {
87
+ isInvalid: a.isInvalid,
88
+ children: n
89
+ })]
90
+ }), D = ({ className: t, errorMessage: n, showMonthYearPicker: r, commitBehavior: a, ...o }) => /* @__PURE__ */ y("div", {
91
+ className: S.container,
92
+ children: [/* @__PURE__ */ y(h, {
93
+ className: e(S.calendar, t),
94
+ "data-readonly": o.isReadOnly || void 0,
95
+ commitBehavior: a ?? (r ? "reset" : void 0),
96
+ ...o,
97
+ children: [/* @__PURE__ */ v(T, {
98
+ ...o,
99
+ showMonthYearPicker: r
100
+ }), /* @__PURE__ */ v(C, { ...o })]
101
+ }), /* @__PURE__ */ v(i, {
102
+ isInvalid: o.isInvalid,
103
+ children: n
104
+ })]
105
+ });
106
+ //#endregion
107
+ export { E as n, D as t };
@@ -0,0 +1,103 @@
1
+ import { t as e } from "./clsx-Di52oYUU.js";
2
+ import { t } from "./heading-BEl_z-5T.js";
3
+ import { t as n } from "./text-DwmZ-ew8.js";
4
+ import * as r from "react";
5
+ import { Button as i, Link as a } from "react-aria-components";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
+ import { ArrowRight as c } from "lucide-react";
8
+ import '../assets/card.css';var l = {
9
+ card: "_card_yandx_1",
10
+ horizontal: "_horizontal_yandx_26",
11
+ cardLink: "_cardLink_yandx_31",
12
+ cardContent: "_cardContent_yandx_42",
13
+ cardActions: "_cardActions_yandx_61",
14
+ deprecated: "_deprecated_yandx_75",
15
+ cardActionArea: "_cardActionArea_yandx_81",
16
+ cardImage: "_cardImage_yandx_114",
17
+ cardLinkIcon: "_cardLinkIcon_yandx_146"
18
+ }, u = r.createContext({
19
+ horizontal: void 0,
20
+ titleId: void 0
21
+ }), d = r.createContext(void 0), f = ({ horizontal: t, className: n, children: i, ...a }) => {
22
+ let s = `card-title-${r.useId()}`;
23
+ return /* @__PURE__ */ o(u.Provider, {
24
+ value: {
25
+ horizontal: t,
26
+ titleId: s
27
+ },
28
+ children: /* @__PURE__ */ o("div", {
29
+ ...a,
30
+ className: e(l.card, t && l.horizontal, n),
31
+ children: i
32
+ })
33
+ });
34
+ }, p = ({ children: t, ...n }) => {
35
+ let { horizontal: i } = r.useContext(u);
36
+ return /* @__PURE__ */ o(d.Provider, {
37
+ value: {},
38
+ children: /* @__PURE__ */ o("div", {
39
+ ...n,
40
+ className: e(l.cardContent, i && l.horizontal),
41
+ children: t
42
+ })
43
+ });
44
+ }, m = ({ elementType: n = "h2", children: i, className: a, ...s }) => {
45
+ let { horizontal: c, titleId: d } = r.useContext(u);
46
+ return /* @__PURE__ */ o(t, {
47
+ level: 3,
48
+ elementType: n,
49
+ className: e(a, l.cardTitle, c && l.horizontal),
50
+ id: d,
51
+ ...s,
52
+ children: i
53
+ });
54
+ }, h = ({ children: t, ...n }) => {
55
+ let { horizontal: i } = r.useContext(u), a = !!r.useContext(d);
56
+ return /* @__PURE__ */ o("div", {
57
+ ...n,
58
+ className: e(l.cardActions, i && l.horizontal, a && l.deprecated),
59
+ children: t
60
+ });
61
+ }, g = ({ children: t, className: n, ...a }) => {
62
+ let { titleId: s } = r.useContext(u);
63
+ return /* @__PURE__ */ o(i, {
64
+ ...a,
65
+ "aria-labelledby": s,
66
+ className: e(l.cardActionArea, n),
67
+ children: t
68
+ });
69
+ }, _ = ({ as: t = "img", className: n, ...r }) => /* @__PURE__ */ o(t, {
70
+ ...r,
71
+ "data-card-image": !0,
72
+ className: e(l.cardImage, n)
73
+ }), v = ({ children: t, as: n, ...r }) => /* @__PURE__ */ s(n || a, {
74
+ ...r,
75
+ className: e(l.cardLink, r.className),
76
+ children: [t, /* @__PURE__ */ o(c, {
77
+ className: l.cardLinkIcon,
78
+ size: 24
79
+ })]
80
+ }), y = { cardBody: "_cardBody_337uy_1" }, b = ({ className: t, ...n }) => /* @__PURE__ */ o("div", {
81
+ className: e(t, y.cardBody),
82
+ ...n
83
+ }), x = {
84
+ cardHeader: "_cardHeader_1625c_1",
85
+ textContainer: "_textContainer_1625c_14",
86
+ subHeading: "_subHeading_1625c_20"
87
+ }, S = ({ children: t, className: r, heading: i, headingLevel: a, subHeading: c, ...l }) => /* @__PURE__ */ s("div", {
88
+ className: e(r, x.cardHeader),
89
+ ...l,
90
+ children: [/* @__PURE__ */ s("div", {
91
+ className: x.textContainer,
92
+ children: [/* @__PURE__ */ o(m, {
93
+ elementType: a,
94
+ children: i
95
+ }), c && /* @__PURE__ */ o(n, {
96
+ slot: "description",
97
+ className: x.subHeading,
98
+ children: c
99
+ })]
100
+ }), t]
101
+ });
102
+ //#endregion
103
+ export { h as a, v as c, g as i, m as l, b as n, p as o, f as r, _ as s, S as t };
@@ -0,0 +1,106 @@
1
+ 'use client';
2
+ import { t as e } from "./clsx-Di52oYUU.js";
3
+ import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
4
+ import { n, t as r } from "./label-Dw5p84T2.js";
5
+ import { t as i } from "./text-DwmZ-ew8.js";
6
+ import { t as a } from "./field-error-LtNtEKDp.js";
7
+ import { t as o } from "./splitDataAttributes-_JTFOOIb.js";
8
+ import * as s from "react";
9
+ import { forwardRef as c, useContext as l } from "react";
10
+ import { CheckboxButton as u, CheckboxField as d, CheckboxGroup as f, CheckboxGroupStateContext as p, composeRenderProps as m } from "react-aria-components";
11
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
12
+ import { Check as v, Minus as y } from "lucide-react";
13
+ import { variables as b } from "@midas-ds/theme";
14
+ import '../assets/checkbox.css';var x = {
15
+ indicator: "_indicator_3jfn4_1",
16
+ checkboxButton: "_checkboxButton_3jfn4_27",
17
+ checkboxField: "_checkboxField_3jfn4_144",
18
+ checkboxGroup: "_checkboxGroup_3jfn4_155",
19
+ checkboxList: "_checkboxList_3jfn4_166"
20
+ }, S = ({ className: t, ...n }) => /* @__PURE__ */ g(d, {
21
+ className: e(x.checkboxField, t),
22
+ ...n
23
+ }), C = c(({ className: t, ...n }, r) => /* @__PURE__ */ g(u, {
24
+ className: e(x.checkboxButton, t),
25
+ ref: r,
26
+ ...n
27
+ })), w = c(({ className: e, description: t, errorMessage: n, errorPosition: r = "top", children: s, ...c }, l) => {
28
+ let [u, d] = o(c);
29
+ return /* @__PURE__ */ _(S, {
30
+ ...d,
31
+ children: [
32
+ t && /* @__PURE__ */ g(i, {
33
+ slot: "description",
34
+ children: t
35
+ }),
36
+ r === "top" && /* @__PURE__ */ g(a, { children: n }),
37
+ /* @__PURE__ */ g(C, {
38
+ ...u,
39
+ ref: l,
40
+ className: e,
41
+ children: ({ isIndeterminate: e }) => /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
42
+ className: x.indicator,
43
+ children: g(e ? y : v, {
44
+ size: 14,
45
+ color: b.iconOnColor
46
+ })
47
+ }), s] })
48
+ }),
49
+ r === "bottom" && /* @__PURE__ */ g(a, { children: n })
50
+ ]
51
+ });
52
+ });
53
+ w.displayName = "Checkbox";
54
+ //#endregion
55
+ //#region src/checkbox/useSelectAll.ts
56
+ var T = (e, t) => {
57
+ let n = t?.value ?? [], r = s.Children.toArray(e).filter((e) => s.isValidElement(e) && e.type === w), i = r.filter((e) => !e.props.isDisabled).map((e) => e.props.value || ""), a = r.filter((e) => e.props.isDisabled).map((e) => e.props.value || "").filter((e) => n.includes(e)), o = n.filter((e) => i.includes(e)).length, c = o === 0, l = o === i.length;
58
+ return {
59
+ allSelected: l,
60
+ someSelected: !c && !l,
61
+ checkboxValues: i,
62
+ disabledSelectedValues: a
63
+ };
64
+ }, E = {
65
+ en: { selectAll: "Select all" },
66
+ sv: { selectAll: "Välj alla" }
67
+ }, D = ({ checkboxes: e, label: n }) => {
68
+ let r = l(p), i = t(E), { allSelected: a, someSelected: o, checkboxValues: s, disabledSelectedValues: c } = T(e, r);
69
+ return /* @__PURE__ */ g(p.Provider, {
70
+ value: null,
71
+ children: /* @__PURE__ */ g(w, {
72
+ isSelected: a,
73
+ isIndeterminate: o,
74
+ isReadOnly: r?.isReadOnly,
75
+ isDisabled: r?.isDisabled,
76
+ onChange: (e) => {
77
+ r?.setValue(e ? [...s, ...c] : c);
78
+ },
79
+ children: n || i.format("selectAll")
80
+ })
81
+ });
82
+ }, O = ({ label: t, description: o, errorMessage: s, errorPosition: c = "top", popover: l, showSelectAll: u, selectAllLabel: d, className: p, children: v, ...y }) => /* @__PURE__ */ g(f, {
83
+ ...y,
84
+ className: e(x.checkboxGroup, p),
85
+ children: m(v, (e) => /* @__PURE__ */ _(h, { children: [
86
+ /* @__PURE__ */ g(n, {
87
+ popover: l,
88
+ children: t && /* @__PURE__ */ g(r, { children: t })
89
+ }),
90
+ o && /* @__PURE__ */ g(i, {
91
+ slot: "description",
92
+ children: o
93
+ }),
94
+ c === "top" && s && /* @__PURE__ */ g(a, { children: s }),
95
+ /* @__PURE__ */ _("div", {
96
+ className: x.checkboxList,
97
+ children: [u && /* @__PURE__ */ g(D, {
98
+ label: d,
99
+ checkboxes: e
100
+ }), e]
101
+ }),
102
+ c === "bottom" && s && /* @__PURE__ */ g(a, { children: s })
103
+ ] }))
104
+ });
105
+ //#endregion
106
+ export { S as i, w as n, C as r, O as t };
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import { n as e } from "./button-C-WkFek9.js";
3
+ import "react";
4
+ import { jsx as t } from "react/jsx-runtime";
5
+ import { X as n } from "lucide-react";
6
+ //#region src/clear-button/ClearButton.tsx
7
+ var r = (r) => /* @__PURE__ */ t(e, {
8
+ variant: "icon",
9
+ slot: null,
10
+ ...r,
11
+ children: /* @__PURE__ */ t(n, {
12
+ size: 20,
13
+ "aria-hidden": !0
14
+ })
15
+ });
16
+ //#endregion
17
+ export { r as t };