@midas-ds/components 17.27.5 → 17.28.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## 17.28.1 (2026-10-08)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **components,radio,checkbox:** forward data-* attributes ([#1409](https://github.com/migrationsverket/midas/pull/1409))
6
+
7
+ ## 17.28.0 (2026-10-08)
8
+
9
+ ### 🚀 Features
10
+
11
+ - **components,stack:** add Stack component ([811b12f3cc2](https://github.com/migrationsverket/midas/commit/811b12f3cc2))
12
+
13
+ ### 🧪 Tests updated
14
+
15
+ - **components,stack:** add visual regression baselines ([5653f8c8e8b](https://github.com/migrationsverket/midas/commit/5653f8c8e8b))
16
+ - remove chromatic ([7c0e6fe5135](https://github.com/migrationsverket/midas/commit/7c0e6fe5135))
17
+
1
18
  ## 17.27.5 (2026-10-07)
2
19
 
3
20
  ### 🩹 Fixes
@@ -0,0 +1 @@
1
+ @layer midas{._stack_1g0ly_7{box-sizing:border-box;justify-content:flex-start;align-items:stretch;gap:var(--midas-stack-spacing,var(--midas-space-small));flex-direction:column;display:flex}._stack_1g0ly_7:is(ul,ol){margin:0;padding:0;list-style:none}._stack_1g0ly_7:is(fieldset){border:0;min-inline-size:0;margin:0;padding:0}._stack_1g0ly_7[data-direction=row]{flex-direction:row}._stack_1g0ly_7[data-direction=row-reverse]{flex-direction:row-reverse}._stack_1g0ly_7[data-direction=column-reverse]{flex-direction:column-reverse}._stack_1g0ly_7[data-align=start]{align-items:flex-start}._stack_1g0ly_7[data-align=center]{align-items:center}._stack_1g0ly_7[data-align=end]{align-items:flex-end}._stack_1g0ly_7[data-align=baseline]{align-items:baseline}._stack_1g0ly_7[data-justify=center]{justify-content:center}._stack_1g0ly_7[data-justify=end]{justify-content:flex-end}._stack_1g0ly_7[data-justify=between]{justify-content:space-between}._stack_1g0ly_7[data-justify=around]{justify-content:space-around}._stack_1g0ly_7[data-justify=evenly]{justify-content:space-evenly}._stack_1g0ly_7[data-wrap]{flex-wrap:wrap}._stack_1g0ly_7[data-spacing=xsmall]{--midas-stack-spacing:var(--midas-space-xsmall)}._stack_1g0ly_7[data-spacing=small]{--midas-stack-spacing:var(--midas-space-small)}._stack_1g0ly_7[data-spacing=medium]{--midas-stack-spacing:var(--midas-space-medium)}._stack_1g0ly_7[data-spacing=large]{--midas-stack-spacing:var(--midas-space-large)}._stack_1g0ly_7[data-spacing=xlarge]{--midas-stack-spacing:var(--midas-space-xlarge)}}
package/calendar/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../chunks/calendar-BZPktkdE.js";
1
+ import { n as e, t } from "../chunks/calendar-Bl_obez5.js";
2
2
  export { e as Calendar, t as RangeCalendar };
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-DcXA9GSd.js";
1
+ import { i as e, n as t, r as n, t as r } from "../chunks/checkbox-Bqd8B58G.js";
2
2
  export { t as Checkbox, n as CheckboxButton, e as CheckboxField, r as CheckboxGroup };
@@ -4,7 +4,7 @@ import { t as r } from "./chevron-right-DwqboCdU.js";
4
4
  import { n as i } from "./button-CenXTGXL.js";
5
5
  import { t as a } from "./heading-BEl_z-5T.js";
6
6
  import { t as o } from "./field-error-LtNtEKDp.js";
7
- import { n as s } from "./select-KQzDIamx.js";
7
+ import { n as s } from "./select-oLCNpryY.js";
8
8
  import { a as c, c as l, o as u } from "./list-box-BN_MSiOD.js";
9
9
  import * as d from "react";
10
10
  import { Calendar as f, CalendarCell as p, CalendarGrid as m, CalendarMonthPicker as h, CalendarYearPicker as g, RangeCalendar as _, RangeCalendarContext as v, Select as y } from "react-aria-components";
@@ -0,0 +1,110 @@
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 "./check-DV00NPU0.js";
5
+ import { t as r } from "./useLocalizedStringFormatter-CeyBc0x0.js";
6
+ import { n as i, t as a } from "./label-LWlgvAwz.js";
7
+ import { t as o } from "./text-DwmZ-ew8.js";
8
+ import { t as s } from "./field-error-LtNtEKDp.js";
9
+ import { t as c } from "./splitDataAttributes-_JTFOOIb.js";
10
+ import * as l from "react";
11
+ import { forwardRef as u, useContext as d } from "react";
12
+ import { CheckboxButton as f, CheckboxField as p, CheckboxGroup as m, CheckboxGroupStateContext as h, composeRenderProps as g } from "react-aria-components";
13
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
14
+ import { variables as b } from "@midas-ds/theme";
15
+ import '../assets/checkbox.css';var x = t("minus", [["path", {
16
+ d: "M5 12h14",
17
+ key: "1ays0h"
18
+ }]]), S = {
19
+ indicator: "_indicator_3jfn4_1",
20
+ checkboxButton: "_checkboxButton_3jfn4_27",
21
+ checkboxField: "_checkboxField_3jfn4_144",
22
+ checkboxGroup: "_checkboxGroup_3jfn4_155",
23
+ checkboxList: "_checkboxList_3jfn4_166"
24
+ }, C = ({ className: t, ...n }) => /* @__PURE__ */ v(p, {
25
+ className: e(S.checkboxField, t),
26
+ ...n
27
+ }), w = u(({ className: t, ...n }, r) => /* @__PURE__ */ v(f, {
28
+ className: e(S.checkboxButton, t),
29
+ ref: r,
30
+ ...n
31
+ })), T = u(({ className: e, description: t, errorMessage: r, errorPosition: i = "top", children: a, ...l }, u) => {
32
+ let [d, f] = c(l);
33
+ return /* @__PURE__ */ y(C, {
34
+ ...f,
35
+ children: [
36
+ t && /* @__PURE__ */ v(o, {
37
+ slot: "description",
38
+ children: t
39
+ }),
40
+ i === "top" && /* @__PURE__ */ v(s, { children: r }),
41
+ /* @__PURE__ */ v(w, {
42
+ ...d,
43
+ ref: u,
44
+ className: e,
45
+ children: ({ isIndeterminate: e }) => /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("div", {
46
+ className: S.indicator,
47
+ children: v(e ? x : n, {
48
+ size: 14,
49
+ color: b.iconOnColor
50
+ })
51
+ }), a] })
52
+ }),
53
+ i === "bottom" && /* @__PURE__ */ v(s, { children: r })
54
+ ]
55
+ });
56
+ });
57
+ T.displayName = "Checkbox";
58
+ //#endregion
59
+ //#region src/checkbox/useSelectAll.ts
60
+ var E = (e, t) => {
61
+ let n = t?.value ?? [], r = l.Children.toArray(e).filter((e) => l.isValidElement(e) && e.type === T), 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, s = o === 0, c = o === i.length;
62
+ return {
63
+ allSelected: c,
64
+ someSelected: !s && !c,
65
+ checkboxValues: i,
66
+ disabledSelectedValues: a
67
+ };
68
+ }, D = {
69
+ en: { selectAll: "Select all" },
70
+ sv: { selectAll: "Välj alla" }
71
+ }, O = ({ checkboxes: e, label: t }) => {
72
+ let n = d(h), i = r(D), { allSelected: a, someSelected: o, checkboxValues: s, disabledSelectedValues: c } = E(e, n);
73
+ return /* @__PURE__ */ v(h.Provider, {
74
+ value: null,
75
+ children: /* @__PURE__ */ v(T, {
76
+ isSelected: a,
77
+ isIndeterminate: o,
78
+ isReadOnly: n?.isReadOnly,
79
+ isDisabled: n?.isDisabled,
80
+ onChange: (e) => {
81
+ n?.setValue(e ? [...s, ...c] : c);
82
+ },
83
+ children: t || i.format("selectAll")
84
+ })
85
+ });
86
+ }, k = ({ label: t, description: n, errorMessage: r, errorPosition: c = "top", popover: l, showSelectAll: u, selectAllLabel: d, className: f, children: p, ...h }) => /* @__PURE__ */ v(m, {
87
+ ...h,
88
+ className: e(S.checkboxGroup, f),
89
+ children: g(p, (e) => /* @__PURE__ */ y(_, { children: [
90
+ /* @__PURE__ */ v(i, {
91
+ popover: l,
92
+ children: t && /* @__PURE__ */ v(a, { children: t })
93
+ }),
94
+ n && /* @__PURE__ */ v(o, {
95
+ slot: "description",
96
+ children: n
97
+ }),
98
+ c === "top" && r && /* @__PURE__ */ v(s, { children: r }),
99
+ /* @__PURE__ */ y("div", {
100
+ className: S.checkboxList,
101
+ children: [u && /* @__PURE__ */ v(O, {
102
+ label: d,
103
+ checkboxes: e
104
+ }), e]
105
+ }),
106
+ c === "bottom" && r && /* @__PURE__ */ v(s, { children: r })
107
+ ] }))
108
+ });
109
+ //#endregion
110
+ export { C as i, T as n, w as r, k as t };
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { n as e } from "./clsx-Di52oYUU.js";
3
3
  import { t } from "./createLucideIcon-BgluSHFG.js";
4
- import { n, t as r } from "./calendar-BZPktkdE.js";
4
+ import { n, t as r } from "./calendar-Bl_obez5.js";
5
5
  import { t as i } from "./useLocalizedStringFormatter-CeyBc0x0.js";
6
6
  import { n as a } from "./button-CenXTGXL.js";
7
7
  import { n as o, t as s } from "./label-LWlgvAwz.js";
@@ -0,0 +1,53 @@
1
+ import { t as e } from "./clsx-Di52oYUU.js";
2
+ import { n as t, t as n } from "./label-LWlgvAwz.js";
3
+ import { t as r } from "./text-DwmZ-ew8.js";
4
+ import { t as i } from "./field-error-LtNtEKDp.js";
5
+ import { t as a } from "./splitDataAttributes-_JTFOOIb.js";
6
+ import { Group as o, RadioButton as s, RadioField as c, RadioGroup as l, composeRenderProps as u } from "react-aria-components";
7
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
8
+ import '../assets/radio.css';//#region src/radio/RadioField.tsx
9
+ var m = (e) => /* @__PURE__ */ f(c, { ...e }), h = {
10
+ radioGroup: "_radioGroup_1l7aa_1",
11
+ wrap: "_wrap_1l7aa_12",
12
+ radioButton: "_radioButton_1l7aa_25"
13
+ }, g = ({ className: t, ...n }) => /* @__PURE__ */ f(s, {
14
+ className: e(h.radioButton, t),
15
+ ...n
16
+ }), _ = ({ children: e, className: t, ...n }) => {
17
+ let [r, i] = a(n);
18
+ return /* @__PURE__ */ f(m, {
19
+ ...i,
20
+ children: /* @__PURE__ */ f(g, {
21
+ ...r,
22
+ className: t,
23
+ children: e
24
+ })
25
+ });
26
+ }, v = ({ label: a, description: s, errorMessage: c, children: m, className: g, errorPosition: _ = "top", popover: v, ...y }) => /* @__PURE__ */ f(l, {
27
+ ...y,
28
+ className: e(h.radioGroup, g),
29
+ children: u(m, (e) => /* @__PURE__ */ p(d, { children: [
30
+ /* @__PURE__ */ f(t, {
31
+ popover: v,
32
+ children: a && /* @__PURE__ */ f(n, { children: a })
33
+ }),
34
+ s && /* @__PURE__ */ f(r, {
35
+ slot: "description",
36
+ children: s
37
+ }),
38
+ _ === "top" && /* @__PURE__ */ f(i, {
39
+ "data-testid": "fieldError",
40
+ children: c
41
+ }),
42
+ /* @__PURE__ */ f(o, {
43
+ className: h.wrap,
44
+ children: e
45
+ }),
46
+ _ === "bottom" && /* @__PURE__ */ f(i, {
47
+ "data-testid": "fieldError",
48
+ children: c
49
+ })
50
+ ] }))
51
+ });
52
+ //#endregion
53
+ export { m as i, _ as n, g as r, v as t };
@@ -1,6 +1,6 @@
1
1
  import { n as e, t } from "./clsx-Di52oYUU.js";
2
2
  import { t as n } from "./chevron-down-CP7nEDei.js";
3
- import { n as r } from "./checkbox-DcXA9GSd.js";
3
+ import { n as r } from "./checkbox-Bqd8B58G.js";
4
4
  import { t as i } from "./x-BJAOO5a5.js";
5
5
  import { t as a } from "./useLocalizedStringFormatter-CeyBc0x0.js";
6
6
  import { n as o, t as s } from "./label-LWlgvAwz.js";
@@ -0,0 +1,8 @@
1
+ //#region src/utils/splitDataAttributes.ts
2
+ function e(e) {
3
+ let t = {}, n = {};
4
+ for (let [r, i] of Object.entries(e)) r.startsWith("data-") ? t[r] = i : n[r] = i;
5
+ return [t, n];
6
+ }
7
+ //#endregion
8
+ export { e as t };
@@ -0,0 +1,22 @@
1
+ 'use client';
2
+ import { t as e } from "./clsx-Di52oYUU.js";
3
+ import * as t from "react";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ import '../assets/stack.css';var r = { stack: "_stack_1g0ly_7" }, i = t.forwardRef(({ children: t, elementType: i = "div", direction: a = "column", spacing: o = "small", alignItems: s = "stretch", justifyContent: c = "start", wrap: l = !1, className: u, role: d, ...f }, p) => {
6
+ let m = i, h = i === "ul" || i === "ol";
7
+ return /* @__PURE__ */ n(m, {
8
+ ...f,
9
+ ref: p,
10
+ role: d ?? (h ? "list" : void 0),
11
+ className: e(r.stack, u),
12
+ "data-direction": a,
13
+ "data-align": s,
14
+ "data-justify": c,
15
+ "data-wrap": l || void 0,
16
+ "data-spacing": o,
17
+ children: t
18
+ });
19
+ });
20
+ i.displayName = "Stack";
21
+ //#endregion
22
+ export { i as t };
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { t as e } from "./clsx-Di52oYUU.js";
3
3
  import { t } from "./createLucideIcon-BgluSHFG.js";
4
- import { n } from "./checkbox-DcXA9GSd.js";
4
+ import { n } from "./checkbox-Bqd8B58G.js";
5
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
6
  import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
7
7
  import '../assets/table.css';var h = t("arrow-down", [["path", {
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../chunks/date-picker-BomOO1LI.js";
1
+ import { n as e, t } from "../chunks/date-picker-DZivTUB_.js";
2
2
  export { e as DatePicker, t as DateRangePicker };
package/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export * from './search-field';
32
32
  export * from './select';
33
33
  export * from './skeleton';
34
34
  export * from './spinner';
35
+ export * from './stack';
35
36
  export * from './table';
36
37
  export * from './tabs';
37
38
  export * from './tag';
package/index.js CHANGED
@@ -4,12 +4,12 @@ import { n as e, t } from "./chunks/accordion-DIVTJU3O.js";
4
4
  import { t as n } from "./chunks/clsx-Di52oYUU.js";
5
5
  import { t as r } from "./chunks/spinner-LdHPVms_.js";
6
6
  import { n as i, t as a } from "./chunks/link-BAgs4RwY.js";
7
- import { a as o, i as s, n as c, o as l, r as u, t as d } from "./chunks/table-zT6eQ3ZZ.js";
7
+ import { a as o, i as s, n as c, o as l, r as u, t as d } from "./chunks/table-CmNWoAYO.js";
8
8
  import { t as f } from "./chunks/link-button-BuPMEGUj.js";
9
- import { n as p, t as m } from "./chunks/date-picker-BomOO1LI.js";
10
- import { n as h, t as g } from "./chunks/calendar-BZPktkdE.js";
9
+ import { n as p, t as m } from "./chunks/date-picker-DZivTUB_.js";
10
+ import { n as h, t as g } from "./chunks/calendar-Bl_obez5.js";
11
11
  import { a as _, i as v, n as y, r as b, t as x } from "./chunks/layout-Db5um0f7.js";
12
- import { i as S, n as C, r as w, t as T } from "./chunks/checkbox-DcXA9GSd.js";
12
+ import { i as S, n as C, r as w, t as T } from "./chunks/checkbox-Bqd8B58G.js";
13
13
  import { n as E, t as D } from "./chunks/color-scheme-switch-DVZjdwc9.js";
14
14
  import { t as O } from "./chunks/search-field-BvfOHvUI.js";
15
15
  import { n as k, t as A } from "./chunks/file-list-TmEuO1fJ.js";
@@ -23,7 +23,7 @@ import { t as B } from "./chunks/popover-DGcogqbS.js";
23
23
  import { n as V, r as H, t as U } from "./chunks/modal-C-UsxdO0.js";
24
24
  import { t as W } from "./chunks/text-DwmZ-ew8.js";
25
25
  import { t as G } from "./chunks/field-error-LtNtEKDp.js";
26
- import { n as K, t as q } from "./chunks/select-KQzDIamx.js";
26
+ import { n as K, t as q } from "./chunks/select-oLCNpryY.js";
27
27
  import { a as J, c as Y, i as X, n as Z, o as Q, r as $, s as ee, t as te } from "./chunks/list-box-BN_MSiOD.js";
28
28
  import { n as ne, r as re, t as ie } from "./chunks/tag-BIcqtf7b.js";
29
29
  import { a as ae, c as oe, i as se, l as ce, n as le, o as ue, r as de, s as fe, t as pe } from "./chunks/card-zIYA-SQh.js";
@@ -40,15 +40,16 @@ import { t as Ne } from "./chunks/info-banner-osR4e6nB.js";
40
40
  import { n as Pe, t as Fe } from "./chunks/tooltip-BkesIUIF.js";
41
41
  import { n as Ie, t as Le } from "./chunks/logo-DyZ2pXt7.js";
42
42
  import { t as Re } from "./chunks/progress-bar-7w_kWo2f.js";
43
- import { i as ze, n as Be, r as Ve, t as He } from "./chunks/radio-C-MUMGu7.js";
43
+ import { i as ze, n as Be, r as Ve, t as He } from "./chunks/radio-BD1EuxSa.js";
44
44
  import { t as Ue } from "./chunks/skeleton-B_BPRPJy.js";
45
- import { i as We, n as Ge, r as Ke, t as qe } from "./chunks/tabs-Co09VWvC.js";
46
- import { i as Je, n as Ye, r as Xe, t as Ze } from "./chunks/textfield-CXqzzOtw.js";
47
- import { t as Qe } from "./chunks/time-field-CmjGBQph.js";
48
- import { a as $e, i as et, n as tt, o as nt, r as rt, t as it } from "./chunks/toast-gJgjitZF.js";
45
+ import { t as We } from "./chunks/stack-LF3ExhH9.js";
46
+ import { i as Ge, n as Ke, r as qe, t as Je } from "./chunks/tabs-Co09VWvC.js";
47
+ import { i as Ye, n as Xe, r as Ze, t as Qe } from "./chunks/textfield-CXqzzOtw.js";
48
+ import { t as $e } from "./chunks/time-field-CmjGBQph.js";
49
+ import { a as et, i as tt, n as nt, o as rt, r as it, t as at } from "./chunks/toast-gJgjitZF.js";
49
50
  //#endregion
50
51
  //#region src/version.ts
51
- var at = {
52
+ var ot = {
52
53
  name: "@midas-ds/components",
53
54
  author: { name: "Migrationsverket" },
54
55
  keywords: [
@@ -60,7 +61,7 @@ var at = {
60
61
  description: "Midas Components",
61
62
  homepage: "https://designsystem.migrationsverket.se/",
62
63
  license: "CC0-1.0",
63
- version: "17.27.5",
64
+ version: "17.28.1",
64
65
  module: "./index.js",
65
66
  type: "module",
66
67
  main: "./index.js",
@@ -92,4 +93,4 @@ var at = {
92
93
  }
93
94
  }.version;
94
95
  //#endregion
95
- export { e as Accordion, t as AccordionItem, F as Badge, I as BadgeContainer, R as Breadcrumb, L as Breadcrumbs, M as Button, N as ButtonGroup, h as Calendar, de as Card, se as CardActionArea, ae as CardActions, le as CardBody, ue as CardContent, pe as CardHeader, fe as CardImage, oe as CardLink, ce as CardTitle, d as Cell, me as CharacterCounter, C as Checkbox, w as CheckboxButton, S as CheckboxField, T as CheckboxGroup, E as ColorSchemeSwitch, D as ColorSchemeSwitchMenu, c as Column, we as ComboBox, he as ContrastFilled, Te as DateField, Ee as DateInput, Oe as DateInputDivider, p as DatePicker, m as DateRangePicker, De as DateSegment, U as DialogTrigger, ke as DropZone, G as FieldError, k as FileList, A as FileListItem, Ae as FileTrigger, it as GlobalToastRegion, je as Grid, Me as GridItem, b as Header, P as Heading, Ne as InfoBanner, Xe as Input, z as Label, x as Layout, a as Link, f as LinkButton, Y as ListBox, ee as ListBoxButton, te as ListBoxEmptyState, Z as ListBoxHeader, Q as ListBoxItem, $ as ListBoxLoadMoreItem, J as ListBoxPopover, X as ListBoxSection, Le as Logo, Ie as LogoContext, ve as Menu, ye as MenuItem, Se as MenuPopover, be as MenuSection, xe as MenuTrigger, V as Modal, H as ModalOverlay, y as Navbar, B as Popover, Re as ProgressBar, Be as Radio, Ve as RadioButton, ze as RadioField, He as RadioGroup, g as RangeCalendar, i as RouterProvider, u as Row, O as SearchField, q as Select, K as SelectTrigger, Ce as Separator, v as Sidebar, _ as SidebarLink, Ue as Skeleton, r as Spinner, Ke as Tab, qe as TabList, Ge as TabPanel, s as Table, o as TableBody, l as TableHeader, We as Tabs, re as Tag, ie as TagGroup, ne as TagList, W as Text, Ze as TextArea, Ye as TextField, Je as TextFieldBase, Qe as TimeField, tt as Toast, rt as ToastProvider, et as ToastRegion, ge as ToggleButton, _e as ToggleButtonGroup, Fe as Tooltip, Pe as TooltipTrigger, at as VERSION, n as clsx, $e as toastQueue, j as useLocalizedStringFormatter, nt as useToastState };
96
+ export { e as Accordion, t as AccordionItem, F as Badge, I as BadgeContainer, R as Breadcrumb, L as Breadcrumbs, M as Button, N as ButtonGroup, h as Calendar, de as Card, se as CardActionArea, ae as CardActions, le as CardBody, ue as CardContent, pe as CardHeader, fe as CardImage, oe as CardLink, ce as CardTitle, d as Cell, me as CharacterCounter, C as Checkbox, w as CheckboxButton, S as CheckboxField, T as CheckboxGroup, E as ColorSchemeSwitch, D as ColorSchemeSwitchMenu, c as Column, we as ComboBox, he as ContrastFilled, Te as DateField, Ee as DateInput, Oe as DateInputDivider, p as DatePicker, m as DateRangePicker, De as DateSegment, U as DialogTrigger, ke as DropZone, G as FieldError, k as FileList, A as FileListItem, Ae as FileTrigger, at as GlobalToastRegion, je as Grid, Me as GridItem, b as Header, P as Heading, Ne as InfoBanner, Ze as Input, z as Label, x as Layout, a as Link, f as LinkButton, Y as ListBox, ee as ListBoxButton, te as ListBoxEmptyState, Z as ListBoxHeader, Q as ListBoxItem, $ as ListBoxLoadMoreItem, J as ListBoxPopover, X as ListBoxSection, Le as Logo, Ie as LogoContext, ve as Menu, ye as MenuItem, Se as MenuPopover, be as MenuSection, xe as MenuTrigger, V as Modal, H as ModalOverlay, y as Navbar, B as Popover, Re as ProgressBar, Be as Radio, Ve as RadioButton, ze as RadioField, He as RadioGroup, g as RangeCalendar, i as RouterProvider, u as Row, O as SearchField, q as Select, K as SelectTrigger, Ce as Separator, v as Sidebar, _ as SidebarLink, Ue as Skeleton, r as Spinner, We as Stack, qe as Tab, Je as TabList, Ke as TabPanel, s as Table, o as TableBody, l as TableHeader, Ge as Tabs, re as Tag, ie as TagGroup, ne as TagList, W as Text, Qe as TextArea, Xe as TextField, Ye as TextFieldBase, $e as TimeField, nt as Toast, it as ToastProvider, tt as ToastRegion, ge as ToggleButton, _e as ToggleButtonGroup, Fe as Tooltip, Pe as TooltipTrigger, ot as VERSION, n as clsx, et as toastQueue, j as useLocalizedStringFormatter, rt as useToastState };
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "description": "Midas Components",
15
15
  "homepage": "https://designsystem.migrationsverket.se/",
16
16
  "license": "CC0-1.0",
17
- "version": "17.27.5",
17
+ "version": "17.28.1",
18
18
  "module": "./index.js",
19
19
  "type": "module",
20
20
  "main": "./index.js",
package/radio/Radio.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { RadioFieldProps } from 'react-aria-components';
2
2
  export type RadioProps = RadioFieldProps;
3
- export declare const Radio: ({ children, className, ...rest }: RadioProps) => import('react').JSX.Element;
3
+ export declare const Radio: ({ children, className, ...props }: RadioProps) => import('react').JSX.Element;
@@ -7,7 +7,7 @@ declare const _default: {
7
7
  children: string;
8
8
  isDisabled: false;
9
9
  };
10
- component: ({ children, className, ...rest }: import('./Radio').RadioProps) => import('react').JSX.Element;
10
+ component: ({ children, className, ...props }: import('./Radio').RadioProps) => import('react').JSX.Element;
11
11
  decorators: (Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
12
12
  className?: import('react-aria-components').ClassNameOrFunction<import('react-aria-components').RadioFieldRenderProps> | undefined;
13
13
  inputRef?: import('react').Ref<HTMLInputElement | null> | undefined;
@@ -4,7 +4,7 @@ declare const _default: {
4
4
  title: string;
5
5
  component: import('react').FC<import('./RadioGroup').RadioGroupProps>;
6
6
  subcomponents: {
7
- Radio: ({ children, className, ...rest }: import('./Radio').RadioProps) => import('react').JSX.Element;
7
+ Radio: ({ children, className, ...props }: import('./Radio').RadioProps) => import('react').JSX.Element;
8
8
  };
9
9
  tags: string[];
10
10
  args: {
package/radio/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as e, n as t, r as n, t as r } from "../chunks/radio-C-MUMGu7.js";
1
+ import { i as e, n as t, r as n, t as r } from "../chunks/radio-BD1EuxSa.js";
2
2
  export { t as Radio, n as RadioButton, e as RadioField, r as RadioGroup };
package/select/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../chunks/select-KQzDIamx.js";
1
+ import { n as e, t } from "../chunks/select-oLCNpryY.js";
2
2
  export { t as Select, e as SelectTrigger };
@@ -0,0 +1,43 @@
1
+ import * as React from 'react';
2
+ /** The Midas semantic space tokens, `--midas-space-*` */
3
+ export type StackSpacing = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
4
+ export type StackElementType = 'div' | 'ul' | 'ol' | 'section' | 'nav' | 'fieldset' | 'form' | 'header' | 'footer' | 'aside' | 'article';
5
+ export interface StackProps extends React.HTMLAttributes<HTMLElement> {
6
+ children: React.ReactNode;
7
+ /**
8
+ * The HTML element to render, e.g. `ul` for a list of items
9
+ * @default 'div'
10
+ */
11
+ elementType?: StackElementType;
12
+ /** @default 'column' */
13
+ direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
14
+ /**
15
+ * Space between the items, from the Midas semantic space tokens
16
+ * @default 'small'
17
+ */
18
+ spacing?: StackSpacing;
19
+ /**
20
+ * How the items line up across the direction: horizontally in a column,
21
+ * vertically in a row. `stretch` makes them as wide as the Stack in a
22
+ * column and as tall as it in a row
23
+ * @default 'stretch'
24
+ */
25
+ alignItems?: 'start' | 'center' | 'end' | 'stretch' | 'baseline';
26
+ /**
27
+ * How the items are placed along the direction: vertically in a column,
28
+ * horizontally in a row. `between` puts the first and last item at the
29
+ * edges, `around` gives each item equal space on both sides and `evenly`
30
+ * makes every gap the same, edges included
31
+ * @default 'start'
32
+ */
33
+ justifyContent?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
34
+ /** Let the items wrap onto several lines */
35
+ wrap?: boolean;
36
+ }
37
+ /**
38
+ * Lays out its children in one direction, with spacing from the Midas space
39
+ * tokens.
40
+ *
41
+ * @see {@link https://designsystem.migrationsverket.se/components/stack}
42
+ */
43
+ export declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,24 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ import { Stack } from '.';
3
+ type Story = StoryObj<typeof Stack>;
4
+ declare const _default: {
5
+ title: string;
6
+ component: import('react').ForwardRefExoticComponent<import('./Stack').StackProps & import('react').RefAttributes<HTMLElement>>;
7
+ tags: string[];
8
+ args: {
9
+ children: import('react').JSX.Element[];
10
+ direction: "column";
11
+ alignItems: "stretch";
12
+ justifyContent: "start";
13
+ wrap: false;
14
+ };
15
+ };
16
+ export default _default;
17
+ export declare const Vertical: Story;
18
+ export declare const Horizontal: Story;
19
+ /** Every Midas semantic space token */
20
+ export declare const Spacing: Story;
21
+ /** A list keeps its list semantics, also without bullets */
22
+ export declare const AsList: Story;
23
+ export declare const Wrap: Story;
24
+ export declare const SpaceBetween: Story;
@@ -0,0 +1,2 @@
1
+ export { Stack } from './Stack';
2
+ export type { StackElementType, StackProps, StackSpacing } from './Stack';
package/stack/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../chunks/stack-LF3ExhH9.js";
2
+ export { e as Stack };
package/table/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "../chunks/table-zT6eQ3ZZ.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "../chunks/table-CmNWoAYO.js";
2
2
  export { a as Cell, n as Column, i as Row, t as Table, e as TableBody, r as TableHeader };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Splits `data-*` attributes (e.g. `data-testid`) off a component's props.
3
+ *
4
+ * For components that render a field wrapper around the element the user
5
+ * interacts with, like Radio and Checkbox: the data attributes belong on the
6
+ * interactive element, so tests that click by test id hit the label rather
7
+ * than the wrapper.
8
+ */
9
+ export declare function splitDataAttributes<T extends object>(props: T): readonly [Record<`data-${string}`, unknown>, T];
@@ -1,105 +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 "./check-DV00NPU0.js";
5
- import { t as r } from "./useLocalizedStringFormatter-CeyBc0x0.js";
6
- import { n as i, t as a } from "./label-LWlgvAwz.js";
7
- import { t as o } from "./text-DwmZ-ew8.js";
8
- import { t as s } from "./field-error-LtNtEKDp.js";
9
- import * as c from "react";
10
- import { forwardRef as l, useContext as u } from "react";
11
- import { CheckboxButton as d, CheckboxField as f, CheckboxGroup as p, CheckboxGroupStateContext as m, composeRenderProps as h } from "react-aria-components";
12
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
13
- import { variables as y } from "@midas-ds/theme";
14
- import '../assets/checkbox.css';var b = t("minus", [["path", {
15
- d: "M5 12h14",
16
- key: "1ays0h"
17
- }]]), x = {
18
- indicator: "_indicator_3jfn4_1",
19
- checkboxButton: "_checkboxButton_3jfn4_27",
20
- checkboxField: "_checkboxField_3jfn4_144",
21
- checkboxGroup: "_checkboxGroup_3jfn4_155",
22
- checkboxList: "_checkboxList_3jfn4_166"
23
- }, S = ({ className: t, ...n }) => /* @__PURE__ */ _(f, {
24
- className: e(x.checkboxField, t),
25
- ...n
26
- }), C = l(({ className: t, ...n }, r) => /* @__PURE__ */ _(d, {
27
- className: e(x.checkboxButton, t),
28
- ref: r,
29
- ...n
30
- })), w = l(({ className: e, description: t, errorMessage: r, errorPosition: i = "top", children: a, ...c }, l) => /* @__PURE__ */ v(S, {
31
- ...c,
32
- children: [
33
- t && /* @__PURE__ */ _(o, {
34
- slot: "description",
35
- children: t
36
- }),
37
- i === "top" && /* @__PURE__ */ _(s, { children: r }),
38
- /* @__PURE__ */ _(C, {
39
- ref: l,
40
- className: e,
41
- children: ({ isIndeterminate: e }) => /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
42
- className: x.indicator,
43
- children: _(e ? b : n, {
44
- size: 14,
45
- color: y.iconOnColor
46
- })
47
- }), a] })
48
- }),
49
- i === "bottom" && /* @__PURE__ */ _(s, { children: r })
50
- ]
51
- }));
52
- w.displayName = "Checkbox";
53
- //#endregion
54
- //#region src/checkbox/useSelectAll.ts
55
- var T = (e, t) => {
56
- let n = t?.value ?? [], r = c.Children.toArray(e).filter((e) => c.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, s = o === 0, l = o === i.length;
57
- return {
58
- allSelected: l,
59
- someSelected: !s && !l,
60
- checkboxValues: i,
61
- disabledSelectedValues: a
62
- };
63
- }, E = {
64
- en: { selectAll: "Select all" },
65
- sv: { selectAll: "Välj alla" }
66
- }, D = ({ checkboxes: e, label: t }) => {
67
- let n = u(m), i = r(E), { allSelected: a, someSelected: o, checkboxValues: s, disabledSelectedValues: c } = T(e, n);
68
- return /* @__PURE__ */ _(m.Provider, {
69
- value: null,
70
- children: /* @__PURE__ */ _(w, {
71
- isSelected: a,
72
- isIndeterminate: o,
73
- isReadOnly: n?.isReadOnly,
74
- isDisabled: n?.isDisabled,
75
- onChange: (e) => {
76
- n?.setValue(e ? [...s, ...c] : c);
77
- },
78
- children: t || i.format("selectAll")
79
- })
80
- });
81
- }, O = ({ label: t, description: n, errorMessage: r, errorPosition: c = "top", popover: l, showSelectAll: u, selectAllLabel: d, className: f, children: m, ...y }) => /* @__PURE__ */ _(p, {
82
- ...y,
83
- className: e(x.checkboxGroup, f),
84
- children: h(m, (e) => /* @__PURE__ */ v(g, { children: [
85
- /* @__PURE__ */ _(i, {
86
- popover: l,
87
- children: t && /* @__PURE__ */ _(a, { children: t })
88
- }),
89
- n && /* @__PURE__ */ _(o, {
90
- slot: "description",
91
- children: n
92
- }),
93
- c === "top" && r && /* @__PURE__ */ _(s, { children: r }),
94
- /* @__PURE__ */ v("div", {
95
- className: x.checkboxList,
96
- children: [u && /* @__PURE__ */ _(D, {
97
- label: d,
98
- checkboxes: e
99
- }), e]
100
- }),
101
- c === "bottom" && r && /* @__PURE__ */ _(s, { children: r })
102
- ] }))
103
- });
104
- //#endregion
105
- export { S as i, w as n, C as r, O as t };
@@ -1,48 +0,0 @@
1
- import { t as e } from "./clsx-Di52oYUU.js";
2
- import { n as t, t as n } from "./label-LWlgvAwz.js";
3
- import { t as r } from "./text-DwmZ-ew8.js";
4
- import { t as i } from "./field-error-LtNtEKDp.js";
5
- import { Group as a, RadioButton as o, RadioField as s, RadioGroup as c, composeRenderProps as l } from "react-aria-components";
6
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
7
- import '../assets/radio.css';//#region src/radio/RadioField.tsx
8
- var p = (e) => /* @__PURE__ */ d(s, { ...e }), m = {
9
- radioGroup: "_radioGroup_1l7aa_1",
10
- wrap: "_wrap_1l7aa_12",
11
- radioButton: "_radioButton_1l7aa_25"
12
- }, h = ({ className: t, ...n }) => /* @__PURE__ */ d(o, {
13
- className: e(m.radioButton, t),
14
- ...n
15
- }), g = ({ children: e, className: t, ...n }) => /* @__PURE__ */ d(p, {
16
- ...n,
17
- children: /* @__PURE__ */ d(h, {
18
- className: t,
19
- children: e
20
- })
21
- }), _ = ({ label: o, description: s, errorMessage: p, children: h, className: g, errorPosition: _ = "top", popover: v, ...y }) => /* @__PURE__ */ d(c, {
22
- ...y,
23
- className: e(m.radioGroup, g),
24
- children: l(h, (e) => /* @__PURE__ */ f(u, { children: [
25
- /* @__PURE__ */ d(t, {
26
- popover: v,
27
- children: o && /* @__PURE__ */ d(n, { children: o })
28
- }),
29
- s && /* @__PURE__ */ d(r, {
30
- slot: "description",
31
- children: s
32
- }),
33
- _ === "top" && /* @__PURE__ */ d(i, {
34
- "data-testid": "fieldError",
35
- children: p
36
- }),
37
- /* @__PURE__ */ d(a, {
38
- className: m.wrap,
39
- children: e
40
- }),
41
- _ === "bottom" && /* @__PURE__ */ d(i, {
42
- "data-testid": "fieldError",
43
- children: p
44
- })
45
- ] }))
46
- });
47
- //#endregion
48
- export { p as i, g as n, h as r, _ as t };