@midas-ds/components 16.5.2 → 16.5.3

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.
@@ -1,23 +1,23 @@
1
- import { jsx as e, jsxs as i, Fragment as S } from "react/jsx-runtime";
2
- import { SelectStateContext as d, SelectValue as v, Button as h, TagList as V, Select as A } from "react-aria-components";
3
- import { FocusScope as C } from "@react-aria/focus";
1
+ import { jsx as e, jsxs as i, Fragment as V } from "react/jsx-runtime";
2
+ import { SelectStateContext as u, SelectValue as h, Button as _, TagList as A, Select as C } from "react-aria-components";
3
+ import { FocusScope as x } from "@react-aria/focus";
4
4
  import { a as N, L as b } from "./Label-xWKvOuML.js";
5
5
  import { a as y, c as T } from "./clsx-AexbMWKp.js";
6
6
  import { T as B } from "./Text-TWzJxnto.js";
7
7
  import { F as g } from "./FieldError-Bra5aRT3.js";
8
- import _, { useContext as p } from "react";
8
+ import p, { useContext as f } from "react";
9
9
  import { C as M } from "./Checkbox-BTAfwDxU.js";
10
- import { u as m } from "./useLocalizedStringFormatter-BHvsRxDk.js";
10
+ import { u as d } from "./useLocalizedStringFormatter-BHvsRxDk.js";
11
11
  import { useFocusManager as F } from "react-aria";
12
12
  import { X as L } from "./x-BXShoIAM.js";
13
13
  import { L as I } from "./ListBox-D5BBeZWL.js";
14
14
  import { P as G } from "./Popover-BcEtFiU1.js";
15
15
  import { a as j, T as k } from "./Tag-CZrQBEgv.js";
16
16
  import { C as R } from "./chevron-down-DgT-uSF9.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 = {
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" }, m = {
18
18
  en: $,
19
19
  sv: w
20
- }, P = "_select_vdvx3_1", z = "_triggerContainer_vdvx3_7", E = "_trigger_vdvx3_7", K = "_medium_vdvx3_29", D = "_selectValue_vdvx3_72", W = "_placeholder_vdvx3_78", X = "_multiSelectValue_vdvx3_88", q = "_selectValueTag_vdvx3_112", H = "_clearButton_vdvx3_126", J = "_truncate_vdvx3_138", O = "_popover_vdvx3_175", Q = "_selectAll_vdvx3_201", U = "_tagGroup_vdvx3_264", a = {
20
+ }, P = "_select_1us8o_1", z = "_triggerContainer_1us8o_7", E = "_trigger_1us8o_7", K = "_medium_1us8o_29", D = "_selectValue_1us8o_72", W = "_placeholder_1us8o_78", X = "_multiSelectValue_1us8o_88", q = "_selectValueTag_1us8o_112", H = "_clearButton_1us8o_126", J = "_truncate_1us8o_138", O = "_popover_1us8o_175", Q = "_selectAll_1us8o_201", U = "_tagGroup_1us8o_264", s = {
21
21
  select: P,
22
22
  triggerContainer: z,
23
23
  trigger: E,
@@ -32,35 +32,35 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
32
32
  selectAll: Q,
33
33
  tagGroup: U
34
34
  }, Y = () => {
35
- const t = _.useContext(d), c = m(u), r = () => t?.setValue(
35
+ const t = p.useContext(u), o = d(m), c = () => t?.setValue(
36
36
  t?.selectionManager.isSelectAll ? null : Array.from(t.collection.getKeys())
37
37
  );
38
38
  return /* @__PURE__ */ e(
39
39
  M,
40
40
  {
41
- className: a.selectAll,
41
+ className: s.selectAll,
42
42
  isIndeterminate: !t?.selectionManager.isSelectAll && !t?.selectionManager.isEmpty,
43
43
  isSelected: t?.selectionManager.isSelectAll,
44
- onChange: r,
45
- children: c.format("selectAll")
44
+ onChange: c,
45
+ children: o.format("selectAll")
46
46
  }
47
47
  );
48
48
  }, Z = ({
49
49
  isDisabled: t
50
50
  }) => {
51
- const c = m(u), r = (l, o) => l.length === 1 ? o : `${l.length} ${c.format("selected")}`;
51
+ const o = d(m), c = (l, r) => l.length === 1 ? r : `${l.length} ${o.format("selected")}`;
52
52
  return /* @__PURE__ */ e(
53
- v,
53
+ h,
54
54
  {
55
- className: a.multiSelectValue,
55
+ className: s.multiSelectValue,
56
56
  "data-disabled": t || void 0,
57
- children: ({ isPlaceholder: l, selectedItems: o, selectedText: s }) => l ? /* @__PURE__ */ e(S, {}) : /* @__PURE__ */ i(
57
+ children: ({ isPlaceholder: l, selectedItems: r, selectedText: a }) => l ? /* @__PURE__ */ e(V, {}) : /* @__PURE__ */ i(
58
58
  "div",
59
59
  {
60
- className: a.selectValueTag,
60
+ className: s.selectValueTag,
61
61
  "data-disabled": t || void 0,
62
62
  children: [
63
- /* @__PURE__ */ e("span", { className: a.truncate, children: r(o, s) }),
63
+ /* @__PURE__ */ e("span", { className: s.truncate, children: c(r, a) }),
64
64
  /* @__PURE__ */ e(ee, { isDisabled: t })
65
65
  ]
66
66
  }
@@ -70,15 +70,15 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
70
70
  }, ee = ({
71
71
  isDisabled: t
72
72
  }) => {
73
- const c = _.useContext(d), r = m(u), l = F(), o = () => {
74
- l?.focusFirst(), c?.setValue(null);
73
+ const o = p.useContext(u), c = d(m), l = F(), r = () => {
74
+ l?.focusFirst(), o?.setValue(null);
75
75
  };
76
76
  return /* @__PURE__ */ e(
77
- h,
77
+ _,
78
78
  {
79
- "aria-label": r.format("clearAll"),
80
- className: a.clearButton,
81
- onPress: o,
79
+ "aria-label": c.format("clearAll"),
80
+ className: s.clearButton,
81
+ onPress: r,
82
82
  slot: null,
83
83
  isDisabled: t,
84
84
  children: /* @__PURE__ */ e(
@@ -92,54 +92,54 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
92
92
  );
93
93
  }, te = ({
94
94
  showTags: t,
95
- isDisabled: c
95
+ isDisabled: o
96
96
  }) => {
97
- const r = m(u), l = p(d), o = (s) => {
98
- l?.selectionManager.toggleSelection(Array.from(s)[0]);
97
+ const c = d(m), l = f(u), r = (a) => {
98
+ l?.selectionManager.toggleSelection(Array.from(a)[0]);
99
99
  };
100
100
  return !l?.selectedItems.length || !t ? null : /* @__PURE__ */ e(
101
101
  j,
102
102
  {
103
- "aria-label": r.format("selectedItems"),
104
- className: a.tagGroup,
105
- onRemove: o,
103
+ "aria-label": c.format("selectedItems"),
104
+ className: s.tagGroup,
105
+ onRemove: r,
106
106
  selectionBehavior: "toggle",
107
- children: /* @__PURE__ */ e(V, { items: l.selectedItems, children: (s) => /* @__PURE__ */ e(
107
+ children: /* @__PURE__ */ e(A, { items: l.selectedItems, children: (a) => /* @__PURE__ */ e(
108
108
  k,
109
109
  {
110
110
  dismissable: !0,
111
- id: s.key,
112
- isDisabled: c,
113
- textValue: s.textValue,
114
- children: s.textValue
111
+ id: a.key,
112
+ isDisabled: o,
113
+ textValue: a.textValue,
114
+ children: a.textValue
115
115
  },
116
- s.key
116
+ a.key
117
117
  ) })
118
118
  }
119
119
  );
120
120
  }, le = ({
121
121
  isDisabled: t,
122
- selectionMode: c,
123
- size: r
122
+ selectionMode: o,
123
+ size: c
124
124
  }) => {
125
- const l = p(d);
125
+ const l = f(u);
126
126
  return /* @__PURE__ */ i(
127
- h,
127
+ _,
128
128
  {
129
129
  className: y(
130
130
  {
131
- [a.medium]: r === "medium"
131
+ [s.medium]: c === "medium"
132
132
  },
133
- a.trigger
133
+ s.trigger
134
134
  ),
135
135
  "data-invalid": !!l?.displayValidation.isInvalid || void 0,
136
136
  children: [
137
137
  /* @__PURE__ */ e(
138
- v,
138
+ h,
139
139
  {
140
- className: a.selectValue,
140
+ className: s.selectValue,
141
141
  "data-disabled": t || void 0,
142
- children: ({ selectedText: o, defaultChildren: s }) => /* @__PURE__ */ e("div", { className: a.placeholder, children: /* @__PURE__ */ e("span", { className: a.truncate, children: c === "multiple" && o ? null : o || s }) })
142
+ children: ({ selectedText: r, defaultChildren: a }) => /* @__PURE__ */ e("div", { className: s.placeholder, children: /* @__PURE__ */ e("span", { className: s.truncate, children: o === "multiple" && r ? null : r || a }) })
143
143
  }
144
144
  ),
145
145
  /* @__PURE__ */ e(
@@ -154,36 +154,36 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
154
154
  }
155
155
  );
156
156
  };
157
- function xe({
157
+ function ve({
158
158
  children: t,
159
- description: c,
160
- errorMessage: r,
159
+ description: o,
160
+ errorMessage: c,
161
161
  errorPosition: l = "top",
162
- items: o,
163
- label: s,
164
- popover: f,
165
- size: x = "large",
162
+ items: r,
163
+ label: a,
164
+ popover: S,
165
+ size: v = "large",
166
166
  ...n
167
167
  }) {
168
- return /* @__PURE__ */ e(C, { children: /* @__PURE__ */ i(
169
- A,
168
+ return /* @__PURE__ */ e(x, { children: /* @__PURE__ */ i(
169
+ C,
170
170
  {
171
171
  ...n,
172
- className: T(n.className, a.select),
172
+ className: T(n.className, s.select),
173
173
  children: [
174
- /* @__PURE__ */ e(N, { popover: f, children: s && /* @__PURE__ */ e(b, { "data-disabled": n.isDisabled || void 0, children: s }) }),
175
- c && /* @__PURE__ */ e(B, { slot: "description", children: c }),
176
- l === "top" && /* @__PURE__ */ e(g, { children: r }),
174
+ /* @__PURE__ */ e(N, { popover: S, children: a && /* @__PURE__ */ e(b, { "data-disabled": n.isDisabled || void 0, children: a }) }),
175
+ o && /* @__PURE__ */ e(B, { slot: "description", children: o }),
176
+ l === "top" && /* @__PURE__ */ e(g, { children: c }),
177
177
  /* @__PURE__ */ i(
178
178
  "div",
179
179
  {
180
- className: a.triggerContainer,
180
+ className: s.triggerContainer,
181
181
  "data-disabled": n.isDisabled || void 0,
182
182
  children: [
183
183
  /* @__PURE__ */ e(
184
184
  le,
185
185
  {
186
- size: x,
186
+ size: v,
187
187
  ...n
188
188
  }
189
189
  ),
@@ -191,11 +191,11 @@ function xe({
191
191
  ]
192
192
  }
193
193
  ),
194
- l === "bottom" && /* @__PURE__ */ e(g, { children: r }),
194
+ l === "bottom" && /* @__PURE__ */ e(g, { children: c }),
195
195
  /* @__PURE__ */ i(
196
196
  G,
197
197
  {
198
- className: a.popover,
198
+ className: s.popover,
199
199
  offset: 0,
200
200
  hideArrow: !0,
201
201
  children: [
@@ -204,7 +204,7 @@ function xe({
204
204
  I,
205
205
  {
206
206
  escapeKeyBehavior: "none",
207
- items: o,
207
+ items: r,
208
208
  children: t
209
209
  }
210
210
  )
@@ -217,5 +217,5 @@ function xe({
217
217
  ) });
218
218
  }
219
219
  export {
220
- xe as S
220
+ ve as S
221
221
  };