@midas-ds/components 17.5.4 → 17.6.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## 17.6.0 (2026-03-05)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **components,select:** add popoverProps passthrough ([1be0c77656](https://github.com/migrationsverket/midas/commit/1be0c77656))
6
+
7
+ ## 17.5.5 (2026-03-04)
8
+
9
+ ### 🩹 Fixes
10
+
11
+ - **components,select:** call commitValidation in SelectAll to clear invalid state after selection ([06be0e034f](https://github.com/migrationsverket/midas/commit/06be0e034f))
12
+
13
+ ### 🔧 Maintenance
14
+
15
+ - **components,select:** remove unused getByText destructure ([caddd4498d](https://github.com/migrationsverket/midas/commit/caddd4498d))
16
+
1
17
  ## 17.5.4 (2026-03-02)
2
18
 
3
19
  ### 🧱 Updated Dependencies
@@ -1,43 +1,45 @@
1
- import { jsx as e, Fragment as V, jsxs as i } from "react/jsx-runtime";
2
- import { SelectStateContext as d, SelectValue as g, Button as _, TagList as A, Select as C } from "react-aria-components";
3
- import { FocusScope as N } from "@react-aria/focus";
4
- import { a as x, L as b } from "./Label-s4J9sYdy.js";
5
- import { a as T, c as y } from "./clsx-AexbMWKp.js";
6
- import { T as B } from "./Text-D0r_W4lH.js";
1
+ import { jsx as e, Fragment as A, jsxs as i } from "react/jsx-runtime";
2
+ import { SelectStateContext as d, SelectValue as g, Button as _, TagList as C, Select as N } from "react-aria-components";
3
+ import { FocusScope as x } from "@react-aria/focus";
4
+ import { a as b, L as T } from "./Label-s4J9sYdy.js";
5
+ import { a as y, c as B } from "./clsx-AexbMWKp.js";
6
+ import { T as M } from "./Text-D0r_W4lH.js";
7
7
  import { F as h } from "./FieldError-krpMBtie.js";
8
8
  import p, { useContext as f } from "react";
9
- import { C as M } from "./Checkbox-sAkQe7Q9.js";
9
+ import { C as F } from "./Checkbox-sAkQe7Q9.js";
10
10
  import { u as m } from "./useLocalizedStringFormatter-BHvsRxDk.js";
11
- import { useFocusManager as F } from "react-aria";
12
- import { X as L } from "./x-B9bYxG31.js";
13
- import { L as I } from "./ListBox-CDlOUvzJ.js";
14
- import { P as G } from "./Popover-CaP4LFhg.js";
15
- import { a as j, T as k } from "./TagGroup-BscTXQ_E.js";
16
- import { C as R } from "./chevron-down-BBFYYzZq.js";
17
- import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Selected items", selected: "selected" }, w = { clearAll: "Rensa alla", selectAll: "Välj alla", selectedItems: "Valda objekt", selected: "valda" }, u = {
18
- en: $,
19
- sv: w
20
- }, P = "_select_1h0s2_1", z = "_triggerContainer_1h0s2_7", D = "_trigger_1h0s2_7", E = "_medium_1h0s2_29", K = "_icon_1h0s2_66", W = "_selectValue_1h0s2_72", X = "_placeholder_1h0s2_78", q = "_multiSelectValue_1h0s2_88", H = "_selectValueTag_1h0s2_112", J = "_clearButton_1h0s2_126", O = "_truncate_1h0s2_138", Q = "_popover_1h0s2_175", U = "_selectAll_1h0s2_201", Y = "_tagGroup_1h0s2_269", s = {
21
- select: P,
22
- triggerContainer: z,
23
- trigger: D,
24
- medium: E,
25
- icon: K,
26
- selectValue: W,
27
- placeholder: X,
28
- multiSelectValue: q,
29
- selectValueTag: H,
30
- clearButton: J,
31
- truncate: O,
32
- popover: Q,
33
- selectAll: U,
34
- tagGroup: Y
35
- }, Z = () => {
36
- const t = p.useContext(d), c = m(u), r = () => t?.setValue(
37
- t?.selectionManager.isSelectAll ? null : Array.from(t.collection.getKeys())
38
- );
11
+ import { useFocusManager as L } from "react-aria";
12
+ import { X as I } from "./x-B9bYxG31.js";
13
+ import { L as G } from "./ListBox-CDlOUvzJ.js";
14
+ import { P as j } from "./Popover-CaP4LFhg.js";
15
+ import { a as k, T as R } from "./TagGroup-BscTXQ_E.js";
16
+ import { C as $ } from "./chevron-down-BBFYYzZq.js";
17
+ import '../assets/Select.css';const w = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Selected items", selected: "selected" }, P = { clearAll: "Rensa alla", selectAll: "Välj alla", selectedItems: "Valda objekt", selected: "valda" }, u = {
18
+ en: w,
19
+ sv: P
20
+ }, z = "_select_1h0s2_1", D = "_triggerContainer_1h0s2_7", E = "_trigger_1h0s2_7", K = "_medium_1h0s2_29", W = "_icon_1h0s2_66", X = "_selectValue_1h0s2_72", q = "_placeholder_1h0s2_78", H = "_multiSelectValue_1h0s2_88", J = "_selectValueTag_1h0s2_112", O = "_clearButton_1h0s2_126", Q = "_truncate_1h0s2_138", U = "_popover_1h0s2_175", Y = "_selectAll_1h0s2_201", Z = "_tagGroup_1h0s2_269", s = {
21
+ select: z,
22
+ triggerContainer: D,
23
+ trigger: E,
24
+ medium: K,
25
+ icon: W,
26
+ selectValue: X,
27
+ placeholder: q,
28
+ multiSelectValue: H,
29
+ selectValueTag: J,
30
+ clearButton: O,
31
+ truncate: Q,
32
+ popover: U,
33
+ selectAll: Y,
34
+ tagGroup: Z
35
+ }, ee = () => {
36
+ const t = p.useContext(d), c = m(u), r = () => {
37
+ t?.setValue(
38
+ t?.selectionManager.isSelectAll ? null : Array.from(t.collection.getKeys())
39
+ ), t?.commitValidation();
40
+ };
39
41
  return /* @__PURE__ */ e(
40
- M,
42
+ F,
41
43
  {
42
44
  className: s.selectAll,
43
45
  isIndeterminate: !t?.selectionManager.isSelectAll && !t?.selectionManager.isEmpty,
@@ -46,7 +48,7 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
46
48
  children: c.format("selectAll")
47
49
  }
48
50
  );
49
- }, ee = ({
51
+ }, te = ({
50
52
  isDisabled: t
51
53
  }) => {
52
54
  const c = m(u), r = (l, o) => l.length === 1 ? o : `${l.length} ${c.format("selected")}`;
@@ -55,23 +57,23 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
55
57
  {
56
58
  className: s.multiSelectValue,
57
59
  "data-disabled": t || void 0,
58
- children: ({ isPlaceholder: l, selectedItems: o, selectedText: a }) => l ? /* @__PURE__ */ e(V, {}) : /* @__PURE__ */ i(
60
+ children: ({ isPlaceholder: l, selectedItems: o, selectedText: a }) => l ? /* @__PURE__ */ e(A, {}) : /* @__PURE__ */ i(
59
61
  "div",
60
62
  {
61
63
  className: s.selectValueTag,
62
64
  "data-disabled": t || void 0,
63
65
  children: [
64
66
  /* @__PURE__ */ e("span", { className: s.truncate, children: r(o, a) }),
65
- /* @__PURE__ */ e(te, { isDisabled: t })
67
+ /* @__PURE__ */ e(le, { isDisabled: t })
66
68
  ]
67
69
  }
68
70
  )
69
71
  }
70
72
  );
71
- }, te = ({
73
+ }, le = ({
72
74
  isDisabled: t
73
75
  }) => {
74
- const c = p.useContext(d), r = m(u), l = F(), o = () => {
76
+ const c = p.useContext(d), r = m(u), l = L(), o = () => {
75
77
  l?.focusFirst(), c?.setValue(null);
76
78
  };
77
79
  return /* @__PURE__ */ e(
@@ -83,7 +85,7 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
83
85
  slot: null,
84
86
  isDisabled: t,
85
87
  children: /* @__PURE__ */ e(
86
- L,
88
+ I,
87
89
  {
88
90
  width: 20,
89
91
  height: 20
@@ -91,7 +93,7 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
91
93
  )
92
94
  }
93
95
  );
94
- }, le = ({
96
+ }, se = ({
95
97
  showTags: t,
96
98
  isDisabled: c
97
99
  }) => {
@@ -99,14 +101,14 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
99
101
  l?.selectionManager.toggleSelection(Array.from(a)[0]);
100
102
  };
101
103
  return !l?.selectedItems.length || !t ? null : /* @__PURE__ */ e(
102
- j,
104
+ k,
103
105
  {
104
106
  "aria-label": r.format("selectedItems"),
105
107
  className: s.tagGroup,
106
108
  onRemove: o,
107
109
  selectionBehavior: "toggle",
108
- children: /* @__PURE__ */ e(A, { items: l.selectedItems, children: (a) => /* @__PURE__ */ e(
109
- k,
110
+ children: /* @__PURE__ */ e(C, { items: l.selectedItems, children: (a) => /* @__PURE__ */ e(
111
+ R,
110
112
  {
111
113
  isDismissable: !0,
112
114
  id: a.key,
@@ -118,7 +120,7 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
118
120
  ) })
119
121
  }
120
122
  );
121
- }, se = ({
123
+ }, ae = ({
122
124
  isDisabled: t,
123
125
  selectionMode: c,
124
126
  size: r
@@ -127,7 +129,7 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
127
129
  return /* @__PURE__ */ i(
128
130
  _,
129
131
  {
130
- className: T(
132
+ className: y(
131
133
  {
132
134
  [s.medium]: r === "medium"
133
135
  },
@@ -148,14 +150,14 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
148
150
  {
149
151
  "aria-hidden": "true",
150
152
  className: s.icon,
151
- children: /* @__PURE__ */ e(R, { size: 20 })
153
+ children: /* @__PURE__ */ e($, { size: 20 })
152
154
  }
153
155
  )
154
156
  ]
155
157
  }
156
158
  );
157
159
  };
158
- function Ve({
160
+ function Ae({
159
161
  children: t,
160
162
  description: c,
161
163
  errorMessage: r,
@@ -163,17 +165,18 @@ function Ve({
163
165
  items: o,
164
166
  label: a,
165
167
  popover: S,
166
- size: v = "large",
168
+ popoverProps: v,
169
+ size: V = "large",
167
170
  ...n
168
171
  }) {
169
- return /* @__PURE__ */ e(N, { children: /* @__PURE__ */ i(
170
- C,
172
+ return /* @__PURE__ */ e(x, { children: /* @__PURE__ */ i(
173
+ N,
171
174
  {
172
175
  ...n,
173
- className: y(n.className, s.select),
176
+ className: B(n.className, s.select),
174
177
  children: [
175
- /* @__PURE__ */ e(x, { popover: S, children: a && /* @__PURE__ */ e(b, { "data-disabled": n.isDisabled || void 0, children: a }) }),
176
- c && /* @__PURE__ */ e(B, { slot: "description", children: c }),
178
+ /* @__PURE__ */ e(b, { popover: S, children: a && /* @__PURE__ */ e(T, { "data-disabled": n.isDisabled || void 0, children: a }) }),
179
+ c && /* @__PURE__ */ e(M, { slot: "description", children: c }),
177
180
  l === "top" && /* @__PURE__ */ e(h, { children: r }),
178
181
  /* @__PURE__ */ i(
179
182
  "div",
@@ -182,27 +185,28 @@ function Ve({
182
185
  "data-disabled": n.isDisabled || void 0,
183
186
  children: [
184
187
  /* @__PURE__ */ e(
185
- se,
188
+ ae,
186
189
  {
187
- size: v,
190
+ size: V,
188
191
  ...n
189
192
  }
190
193
  ),
191
- n.selectionMode === "multiple" ? /* @__PURE__ */ e(ee, { ...n }) : null
194
+ n.selectionMode === "multiple" ? /* @__PURE__ */ e(te, { ...n }) : null
192
195
  ]
193
196
  }
194
197
  ),
195
198
  l === "bottom" && /* @__PURE__ */ e(h, { children: r }),
196
199
  /* @__PURE__ */ i(
197
- G,
200
+ j,
198
201
  {
199
202
  className: s.popover,
200
203
  offset: 0,
201
204
  hideArrow: !0,
205
+ ...v,
202
206
  children: [
203
- n.isSelectableAll && /* @__PURE__ */ e(Z, {}),
207
+ n.isSelectableAll && /* @__PURE__ */ e(ee, {}),
204
208
  /* @__PURE__ */ e(
205
- I,
209
+ G,
206
210
  {
207
211
  escapeKeyBehavior: "none",
208
212
  items: o,
@@ -212,11 +216,11 @@ function Ve({
212
216
  ]
213
217
  }
214
218
  ),
215
- /* @__PURE__ */ e(le, { ...n })
219
+ /* @__PURE__ */ e(se, { ...n })
216
220
  ]
217
221
  }
218
222
  ) });
219
223
  }
220
224
  export {
221
- Ve as S
225
+ Ae as S
222
226
  };
package/index.js CHANGED
@@ -30,7 +30,7 @@ import { P as Io } from "./chunks/Popover-CaP4LFhg.js";
30
30
  import { P as Go } from "./chunks/ProgressBar-acc8946-.js";
31
31
  import { R as ko, a as vo } from "./chunks/Radio-DjivEe-_.js";
32
32
  import { S as Mo } from "./chunks/SearchField-1DYv0w4b.js";
33
- import { S as ho } from "./chunks/Select-CV0H13h-.js";
33
+ import { S as ho } from "./chunks/Select-DZepyl5C.js";
34
34
  import { S as yo } from "./chunks/Skeleton-D6mxKxuu.js";
35
35
  import { S as No } from "./chunks/Spinner-CfKMn18u.js";
36
36
  import { C as zo, a as Oo, R as Qo, T as Vo, b as Zo, c as jo } from "./chunks/Table-Bg-AKi7d.js";
@@ -49,7 +49,7 @@ import { c as Na } from "./chunks/clsx-AexbMWKp.js";
49
49
  import { DialogTrigger as za, MenuTrigger as Oa, RouterProvider as Qa } from "react-aria-components";
50
50
  import { u as Za } from "./chunks/useLocalizedStringFormatter-BHvsRxDk.js";
51
51
  import { useToastState as qa } from "react-stately";
52
- const o = "17.5.4", a = {
52
+ const o = "17.6.0", a = {
53
53
  version: o
54
54
  }, r = a.version;
55
55
  export {
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.5.4",
17
+ "version": "17.6.0",
18
18
  "module": "./index.js",
19
19
  "type": "module",
20
20
  "main": "./index.js",
@@ -1,6 +1,7 @@
1
1
  import { SelectProps, ValidationResult } from 'react-aria-components';
2
2
  import { InfoPopoverProps } from '../label';
3
3
  import { Size } from '../common/types';
4
+ import { Popover } from '../popover';
4
5
  import * as React from 'react';
5
6
  export type SelectionMode = 'single' | 'multiple';
6
7
  export interface MidasSelectProps<T extends object, M extends SelectionMode = 'single'> extends Omit<SelectProps<T, M>, 'children'> {
@@ -30,5 +31,9 @@ export interface MidasSelectProps<T extends object, M extends SelectionMode = 's
30
31
  * @default 'large'
31
32
  */
32
33
  size?: Size;
34
+ /**
35
+ * Props passed to the internal Popover element.
36
+ */
37
+ popoverProps?: Omit<React.ComponentProps<typeof Popover>, 'children'>;
33
38
  }
34
- export declare function Select<T extends object, M extends SelectionMode = 'single'>({ children, description, errorMessage, errorPosition, items, label, popover, size, ...props }: MidasSelectProps<T, M>): import("react/jsx-runtime").JSX.Element;
39
+ export declare function Select<T extends object, M extends SelectionMode = 'single'>({ children, description, errorMessage, errorPosition, items, label, popover, popoverProps, size, ...props }: MidasSelectProps<T, M>): import("react/jsx-runtime").JSX.Element;
@@ -42,5 +42,6 @@ export declare const SelectAllEnabled: Story<Item, 'multiple'>;
42
42
  export declare const DS872: Story;
43
43
  export declare const StaticSections: Story;
44
44
  export declare const DynamicSections: Story<Section>;
45
+ export declare const RequiredMultipleSelectAll: Story<Item, 'multiple'>;
45
46
  export declare const RequiredSingleSelect: Story;
46
47
  export declare const LongWords: Story;
package/select/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as r } from "../chunks/Select-CV0H13h-.js";
1
+ import { S as r } from "../chunks/Select-DZepyl5C.js";
2
2
  export {
3
3
  r as Select
4
4
  };