@midas-ds/components 16.5.2 → 16.5.4

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,25 +1,25 @@
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";
4
- import { a as N, L as b } from "./Label-xWKvOuML.js";
5
- import { a as y, c as T } from "./clsx-AexbMWKp.js";
6
- import { T as B } from "./Text-TWzJxnto.js";
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
+ import { a as z, L as N } from "./Label-xWKvOuML.js";
5
+ import { a as b, c as y } from "./clsx-AexbMWKp.js";
6
+ import { T } from "./Text-TWzJxnto.js";
7
7
  import { F as g } from "./FieldError-Bra5aRT3.js";
8
- import _, { useContext as p } from "react";
9
- import { C as M } from "./Checkbox-BTAfwDxU.js";
10
- import { u as m } from "./useLocalizedStringFormatter-BHvsRxDk.js";
11
- import { useFocusManager as F } from "react-aria";
12
- import { X as L } from "./x-BXShoIAM.js";
13
- import { L as I } from "./ListBox-D5BBeZWL.js";
14
- import { P as G } from "./Popover-BcEtFiU1.js";
15
- import { a as j, T as k } from "./Tag-CZrQBEgv.js";
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 = {
18
- en: $,
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 = {
21
- select: P,
22
- triggerContainer: z,
8
+ import p, { useContext as f } from "react";
9
+ import { C as B } from "./Checkbox-BTAfwDxU.js";
10
+ import { u as d } from "./useLocalizedStringFormatter-BHvsRxDk.js";
11
+ import { useFocusManager as M } from "react-aria";
12
+ import { X as F } from "./x-BXShoIAM.js";
13
+ import { L } from "./ListBox-D5BBeZWL.js";
14
+ import { P as I } from "./Popover-BcEtFiU1.js";
15
+ import { a as G, T as j } from "./Tag-CZrQBEgv.js";
16
+ import { C as k } from "./chevron-down-DgT-uSF9.js";
17
+ import '../assets/Select.css';const R = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Selected items", selected: "selected" }, $ = { clearAll: "Rensa alla", selectAll: "Välj alla", selectedItems: "Valda objekt", selected: "valda" }, m = {
18
+ en: R,
19
+ sv: $
20
+ }, w = "_select_e81uz_1", P = "_triggerContainer_e81uz_7", E = "_trigger_e81uz_7", K = "_medium_e81uz_29", D = "_selectValue_e81uz_72", W = "_placeholder_e81uz_78", X = "_multiSelectValue_e81uz_88", q = "_selectValueTag_e81uz_112", H = "_clearButton_e81uz_126", J = "_truncate_e81uz_138", O = "_popover_e81uz_175", Q = "_selectAll_e81uz_201", U = "_tagGroup_e81uz_264", a = {
21
+ select: w,
22
+ triggerContainer: P,
23
23
  trigger: E,
24
24
  medium: K,
25
25
  selectValue: D,
@@ -32,11 +32,11 @@ 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), c = d(m), r = () => t?.setValue(
36
36
  t?.selectionManager.isSelectAll ? null : Array.from(t.collection.getKeys())
37
37
  );
38
38
  return /* @__PURE__ */ e(
39
- M,
39
+ B,
40
40
  {
41
41
  className: a.selectAll,
42
42
  isIndeterminate: !t?.selectionManager.isSelectAll && !t?.selectionManager.isEmpty,
@@ -48,13 +48,13 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
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 c = d(m), r = (l, o) => l.length === 1 ? o : `${l.length} ${c.format("selected")}`;
52
52
  return /* @__PURE__ */ e(
53
- v,
53
+ h,
54
54
  {
55
55
  className: a.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: o, selectedText: s }) => l ? /* @__PURE__ */ e(V, {}) : /* @__PURE__ */ i(
58
58
  "div",
59
59
  {
60
60
  className: a.selectValueTag,
@@ -70,11 +70,11 @@ 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 = () => {
73
+ const c = p.useContext(u), r = d(m), l = M(), o = () => {
74
74
  l?.focusFirst(), c?.setValue(null);
75
75
  };
76
76
  return /* @__PURE__ */ e(
77
- h,
77
+ _,
78
78
  {
79
79
  "aria-label": r.format("clearAll"),
80
80
  className: a.clearButton,
@@ -82,7 +82,7 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
82
82
  slot: null,
83
83
  isDisabled: t,
84
84
  children: /* @__PURE__ */ e(
85
- L,
85
+ F,
86
86
  {
87
87
  width: 20,
88
88
  height: 20
@@ -94,18 +94,18 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
94
94
  showTags: t,
95
95
  isDisabled: c
96
96
  }) => {
97
- const r = m(u), l = p(d), o = (s) => {
97
+ const r = d(m), l = f(u), o = (s) => {
98
98
  l?.selectionManager.toggleSelection(Array.from(s)[0]);
99
99
  };
100
100
  return !l?.selectedItems.length || !t ? null : /* @__PURE__ */ e(
101
- j,
101
+ G,
102
102
  {
103
103
  "aria-label": r.format("selectedItems"),
104
104
  className: a.tagGroup,
105
105
  onRemove: o,
106
106
  selectionBehavior: "toggle",
107
- children: /* @__PURE__ */ e(V, { items: l.selectedItems, children: (s) => /* @__PURE__ */ e(
108
- k,
107
+ children: /* @__PURE__ */ e(A, { items: l.selectedItems, children: (s) => /* @__PURE__ */ e(
108
+ j,
109
109
  {
110
110
  dismissable: !0,
111
111
  id: s.key,
@@ -122,11 +122,11 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
122
122
  selectionMode: c,
123
123
  size: r
124
124
  }) => {
125
- const l = p(d);
125
+ const l = f(u);
126
126
  return /* @__PURE__ */ i(
127
- h,
127
+ _,
128
128
  {
129
- className: y(
129
+ className: b(
130
130
  {
131
131
  [a.medium]: r === "medium"
132
132
  },
@@ -135,7 +135,7 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
135
135
  "data-invalid": !!l?.displayValidation.isInvalid || void 0,
136
136
  children: [
137
137
  /* @__PURE__ */ e(
138
- v,
138
+ h,
139
139
  {
140
140
  className: a.selectValue,
141
141
  "data-disabled": t || void 0,
@@ -147,32 +147,32 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
147
147
  {
148
148
  "aria-hidden": "true",
149
149
  style: { display: "flex" },
150
- children: /* @__PURE__ */ e(R, { size: 20 })
150
+ children: /* @__PURE__ */ e(k, { size: 20 })
151
151
  }
152
152
  )
153
153
  ]
154
154
  }
155
155
  );
156
156
  };
157
- function xe({
157
+ function ve({
158
158
  children: t,
159
159
  description: c,
160
160
  errorMessage: r,
161
161
  errorPosition: l = "top",
162
162
  items: o,
163
163
  label: s,
164
- popover: f,
165
- size: x = "large",
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: y(n.className, a.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 }),
174
+ /* @__PURE__ */ e(z, { popover: S, children: s && /* @__PURE__ */ e(N, { "data-disabled": n.isDisabled || void 0, children: s }) }),
175
+ c && /* @__PURE__ */ e(T, { slot: "description", children: c }),
176
176
  l === "top" && /* @__PURE__ */ e(g, { children: r }),
177
177
  /* @__PURE__ */ i(
178
178
  "div",
@@ -183,7 +183,7 @@ function xe({
183
183
  /* @__PURE__ */ e(
184
184
  le,
185
185
  {
186
- size: x,
186
+ size: v,
187
187
  ...n
188
188
  }
189
189
  ),
@@ -193,7 +193,7 @@ function xe({
193
193
  ),
194
194
  l === "bottom" && /* @__PURE__ */ e(g, { children: r }),
195
195
  /* @__PURE__ */ i(
196
- G,
196
+ I,
197
197
  {
198
198
  className: a.popover,
199
199
  offset: 0,
@@ -201,7 +201,7 @@ function xe({
201
201
  children: [
202
202
  n.isSelectableAll && /* @__PURE__ */ e(Y, {}),
203
203
  /* @__PURE__ */ e(
204
- I,
204
+ L,
205
205
  {
206
206
  escapeKeyBehavior: "none",
207
207
  items: o,
@@ -217,5 +217,5 @@ function xe({
217
217
  ) });
218
218
  }
219
219
  export {
220
- xe as S
220
+ ve as S
221
221
  };