@midas-ds/components 17.6.6 → 17.7.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 +21 -0
- package/assets/TagGroup.css +1 -1
- package/assets/default.css +1 -1
- package/checkbox/index.js +1 -1
- package/chunks/{CheckboxGroup-DGVV0X_Z.js → CheckboxGroup-C5JLzeJv.js} +1 -1
- package/chunks/{ColorSchemeSwitch-DkY8VTVR.js → ColorSchemeSwitch-D52V0sr3.js} +44 -43
- package/chunks/{ComboBox-Dx4GD2oe.js → ComboBox-I4tZIYpb.js} +1 -1
- package/chunks/{DateField-h3l0qG7u.js → DateField-cAJ_r2cj.js} +1 -1
- package/chunks/{DateRangePicker-X6gmcMdv.js → DateRangePicker-BGoKQCZf.js} +1 -1
- package/chunks/Label-Bhnpbs10.js +74 -0
- package/chunks/{Layout-CmKsh0kv.js → Layout-SqGyudO8.js} +1 -1
- package/chunks/{Logo-CCxPAmgw.js → Logo-DDykn5b2.js} +50 -43
- package/chunks/{ProgressBar-acc8946-.js → ProgressBar-BGBPAJCv.js} +1 -1
- package/chunks/{Radio-DjivEe-_.js → Radio-DebU3D38.js} +1 -1
- package/chunks/{Select-DZepyl5C.js → Select-BkLLrCh-.js} +71 -71
- package/chunks/TagGroup-CkjoxLIy.js +97 -0
- package/chunks/{TextArea-CBRE_gsN.js → TextArea-BL0NbUHd.js} +1 -1
- package/color-scheme-switch/ColorSchemeSwitch.d.ts +1 -1
- package/color-scheme-switch/index.js +1 -1
- package/combobox/index.js +1 -1
- package/date-field/index.js +1 -1
- package/date-picker/index.js +1 -1
- package/index.js +101 -100
- package/label/index.js +1 -1
- package/layout/index.js +1 -1
- package/logo/LogoContext.d.ts +3 -0
- package/logo/index.d.ts +1 -0
- package/logo/index.js +3 -2
- package/package.json +1 -1
- package/progress-bar/index.js +1 -1
- package/radio/index.js +1 -1
- package/select/index.js +1 -1
- package/tag/Tag.stories.d.ts +1 -0
- package/tag/index.js +1 -1
- package/textfield/index.js +1 -1
- package/chunks/Label-s4J9sYdy.js +0 -73
- package/chunks/TagGroup-BscTXQ_E.js +0 -97
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import { SelectStateContext as d, SelectValue as
|
|
3
|
-
import { FocusScope as
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as
|
|
1
|
+
import { jsx as e, Fragment as C, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { SelectStateContext as d, SelectValue as f, Button as p, TagList as N, Select as x } from "react-aria-components";
|
|
3
|
+
import { FocusScope as b } from "@react-aria/focus";
|
|
4
|
+
import { a as T, L as y } from "./Label-Bhnpbs10.js";
|
|
5
|
+
import { a as B, c as g } from "./clsx-AexbMWKp.js";
|
|
6
6
|
import { T as M } from "./Text-D0r_W4lH.js";
|
|
7
|
-
import { F as
|
|
8
|
-
import
|
|
7
|
+
import { F as _ } from "./FieldError-krpMBtie.js";
|
|
8
|
+
import S, { useContext as V } from "react";
|
|
9
9
|
import { C as F } from "./Checkbox-sAkQe7Q9.js";
|
|
10
10
|
import { u as m } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
11
11
|
import { useFocusManager as L } from "react-aria";
|
|
12
12
|
import { X as I } from "./x-B9bYxG31.js";
|
|
13
13
|
import { L as G } from "./ListBox-CDlOUvzJ.js";
|
|
14
14
|
import { P as j } from "./Popover-CaP4LFhg.js";
|
|
15
|
-
import { a as k, T as R } from "./TagGroup-
|
|
15
|
+
import { a as k, T as R } from "./TagGroup-CkjoxLIy.js";
|
|
16
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" },
|
|
17
|
+
import '../assets/Select.css';const w = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Selected items", selected: "selected" }, z = { clearAll: "Rensa alla", selectAll: "Välj alla", selectedItems: "Valda objekt", selected: "valda" }, u = {
|
|
18
18
|
en: w,
|
|
19
|
-
sv:
|
|
20
|
-
},
|
|
21
|
-
select:
|
|
22
|
-
triggerContainer:
|
|
23
|
-
trigger:
|
|
24
|
-
medium:
|
|
19
|
+
sv: z
|
|
20
|
+
}, D = "_select_1h0s2_1", E = "_triggerContainer_1h0s2_7", K = "_trigger_1h0s2_7", P = "_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", a = {
|
|
21
|
+
select: D,
|
|
22
|
+
triggerContainer: E,
|
|
23
|
+
trigger: K,
|
|
24
|
+
medium: P,
|
|
25
25
|
icon: W,
|
|
26
26
|
selectValue: X,
|
|
27
27
|
placeholder: q,
|
|
@@ -33,7 +33,7 @@ import '../assets/Select.css';const w = { clearAll: "Clear all", selectAll: "Sel
|
|
|
33
33
|
selectAll: Y,
|
|
34
34
|
tagGroup: Z
|
|
35
35
|
}, ee = () => {
|
|
36
|
-
const t =
|
|
36
|
+
const t = S.useContext(d), c = m(u), r = () => {
|
|
37
37
|
t?.setValue(
|
|
38
38
|
t?.selectionManager.isSelectAll ? null : Array.from(t.collection.getKeys())
|
|
39
39
|
), t?.commitValidation();
|
|
@@ -41,7 +41,7 @@ import '../assets/Select.css';const w = { clearAll: "Clear all", selectAll: "Sel
|
|
|
41
41
|
return /* @__PURE__ */ e(
|
|
42
42
|
F,
|
|
43
43
|
{
|
|
44
|
-
className:
|
|
44
|
+
className: a.selectAll,
|
|
45
45
|
isIndeterminate: !t?.selectionManager.isSelectAll && !t?.selectionManager.isEmpty,
|
|
46
46
|
isSelected: t?.selectionManager.isSelectAll,
|
|
47
47
|
onChange: r,
|
|
@@ -51,19 +51,19 @@ import '../assets/Select.css';const w = { clearAll: "Clear all", selectAll: "Sel
|
|
|
51
51
|
}, te = ({
|
|
52
52
|
isDisabled: t
|
|
53
53
|
}) => {
|
|
54
|
-
const c = m(u), r = (l,
|
|
54
|
+
const c = m(u), r = (l, n) => l.length === 1 ? n : `${l.length} ${c.format("selected")}`;
|
|
55
55
|
return /* @__PURE__ */ e(
|
|
56
|
-
|
|
56
|
+
f,
|
|
57
57
|
{
|
|
58
|
-
className:
|
|
58
|
+
className: a.multiSelectValue,
|
|
59
59
|
"data-disabled": t || void 0,
|
|
60
|
-
children: ({ isPlaceholder: l, selectedItems:
|
|
60
|
+
children: ({ isPlaceholder: l, selectedItems: n, selectedText: s }) => l ? /* @__PURE__ */ e(C, {}) : /* @__PURE__ */ i(
|
|
61
61
|
"div",
|
|
62
62
|
{
|
|
63
|
-
className:
|
|
63
|
+
className: a.selectValueTag,
|
|
64
64
|
"data-disabled": t || void 0,
|
|
65
65
|
children: [
|
|
66
|
-
/* @__PURE__ */ e("span", { className:
|
|
66
|
+
/* @__PURE__ */ e("span", { className: a.truncate, children: r(n, s) }),
|
|
67
67
|
/* @__PURE__ */ e(le, { isDisabled: t })
|
|
68
68
|
]
|
|
69
69
|
}
|
|
@@ -73,15 +73,15 @@ import '../assets/Select.css';const w = { clearAll: "Clear all", selectAll: "Sel
|
|
|
73
73
|
}, le = ({
|
|
74
74
|
isDisabled: t
|
|
75
75
|
}) => {
|
|
76
|
-
const c =
|
|
76
|
+
const c = S.useContext(d), r = m(u), l = L(), n = () => {
|
|
77
77
|
l?.focusFirst(), c?.setValue(null);
|
|
78
78
|
};
|
|
79
79
|
return /* @__PURE__ */ e(
|
|
80
|
-
|
|
80
|
+
p,
|
|
81
81
|
{
|
|
82
82
|
"aria-label": r.format("clearAll"),
|
|
83
|
-
className:
|
|
84
|
-
onPress:
|
|
83
|
+
className: a.clearButton,
|
|
84
|
+
onPress: n,
|
|
85
85
|
slot: null,
|
|
86
86
|
isDisabled: t,
|
|
87
87
|
children: /* @__PURE__ */ e(
|
|
@@ -93,63 +93,63 @@ import '../assets/Select.css';const w = { clearAll: "Clear all", selectAll: "Sel
|
|
|
93
93
|
)
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
|
-
},
|
|
96
|
+
}, ae = ({
|
|
97
97
|
showTags: t,
|
|
98
98
|
isDisabled: c
|
|
99
99
|
}) => {
|
|
100
|
-
const r = m(u), l =
|
|
101
|
-
l?.selectionManager.toggleSelection(Array.from(
|
|
100
|
+
const r = m(u), l = V(d), n = (s) => {
|
|
101
|
+
l?.selectionManager.toggleSelection(Array.from(s)[0]);
|
|
102
102
|
};
|
|
103
103
|
return !l?.selectedItems.length || !t ? null : /* @__PURE__ */ e(
|
|
104
104
|
k,
|
|
105
105
|
{
|
|
106
106
|
"aria-label": r.format("selectedItems"),
|
|
107
|
-
className:
|
|
108
|
-
onRemove:
|
|
107
|
+
className: a.tagGroup,
|
|
108
|
+
onRemove: n,
|
|
109
109
|
selectionBehavior: "toggle",
|
|
110
|
-
children: /* @__PURE__ */ e(
|
|
110
|
+
children: /* @__PURE__ */ e(N, { items: l.selectedItems, children: (s) => /* @__PURE__ */ e(
|
|
111
111
|
R,
|
|
112
112
|
{
|
|
113
113
|
isDismissable: !0,
|
|
114
|
-
id:
|
|
114
|
+
id: s.key,
|
|
115
115
|
isDisabled: c,
|
|
116
|
-
textValue:
|
|
117
|
-
children:
|
|
116
|
+
textValue: s.textValue,
|
|
117
|
+
children: s.textValue
|
|
118
118
|
},
|
|
119
|
-
|
|
119
|
+
s.key
|
|
120
120
|
) })
|
|
121
121
|
}
|
|
122
122
|
);
|
|
123
|
-
},
|
|
123
|
+
}, se = ({
|
|
124
124
|
isDisabled: t,
|
|
125
125
|
selectionMode: c,
|
|
126
126
|
size: r
|
|
127
127
|
}) => {
|
|
128
|
-
const l =
|
|
128
|
+
const l = V(d);
|
|
129
129
|
return /* @__PURE__ */ i(
|
|
130
|
-
|
|
130
|
+
p,
|
|
131
131
|
{
|
|
132
|
-
className:
|
|
132
|
+
className: B(
|
|
133
133
|
{
|
|
134
|
-
[
|
|
134
|
+
[a.medium]: r === "medium"
|
|
135
135
|
},
|
|
136
|
-
|
|
136
|
+
a.trigger
|
|
137
137
|
),
|
|
138
138
|
"data-invalid": !!l?.displayValidation.isInvalid || void 0,
|
|
139
139
|
children: [
|
|
140
140
|
/* @__PURE__ */ e(
|
|
141
|
-
|
|
141
|
+
f,
|
|
142
142
|
{
|
|
143
|
-
className:
|
|
143
|
+
className: a.selectValue,
|
|
144
144
|
"data-disabled": t || void 0,
|
|
145
|
-
children: ({ selectedText:
|
|
145
|
+
children: ({ selectedText: n, defaultChildren: s }) => /* @__PURE__ */ e("div", { className: a.placeholder, children: /* @__PURE__ */ e("span", { className: a.truncate, children: c === "multiple" && n ? null : n || s }) })
|
|
146
146
|
}
|
|
147
147
|
),
|
|
148
148
|
/* @__PURE__ */ e(
|
|
149
149
|
"span",
|
|
150
150
|
{
|
|
151
151
|
"aria-hidden": "true",
|
|
152
|
-
className:
|
|
152
|
+
className: a.icon,
|
|
153
153
|
children: /* @__PURE__ */ e($, { size: 20 })
|
|
154
154
|
}
|
|
155
155
|
)
|
|
@@ -162,61 +162,61 @@ function Ae({
|
|
|
162
162
|
description: c,
|
|
163
163
|
errorMessage: r,
|
|
164
164
|
errorPosition: l = "top",
|
|
165
|
-
items:
|
|
166
|
-
label:
|
|
167
|
-
popover:
|
|
168
|
-
popoverProps:
|
|
169
|
-
size:
|
|
170
|
-
...
|
|
165
|
+
items: n,
|
|
166
|
+
label: s,
|
|
167
|
+
popover: v,
|
|
168
|
+
popoverProps: h,
|
|
169
|
+
size: A = "large",
|
|
170
|
+
...o
|
|
171
171
|
}) {
|
|
172
|
-
return /* @__PURE__ */ e(
|
|
173
|
-
|
|
172
|
+
return /* @__PURE__ */ e(b, { children: /* @__PURE__ */ i(
|
|
173
|
+
x,
|
|
174
174
|
{
|
|
175
|
-
...
|
|
176
|
-
className:
|
|
175
|
+
...o,
|
|
176
|
+
className: g(o.className, a.select),
|
|
177
177
|
children: [
|
|
178
|
-
/* @__PURE__ */ e(
|
|
178
|
+
/* @__PURE__ */ e(T, { popover: v, children: s && /* @__PURE__ */ e(y, { "data-disabled": o.isDisabled || void 0, children: s }) }),
|
|
179
179
|
c && /* @__PURE__ */ e(M, { slot: "description", children: c }),
|
|
180
|
-
l === "top" && /* @__PURE__ */ e(
|
|
180
|
+
l === "top" && /* @__PURE__ */ e(_, { children: r }),
|
|
181
181
|
/* @__PURE__ */ i(
|
|
182
182
|
"div",
|
|
183
183
|
{
|
|
184
|
-
className:
|
|
185
|
-
"data-disabled":
|
|
184
|
+
className: a.triggerContainer,
|
|
185
|
+
"data-disabled": o.isDisabled || void 0,
|
|
186
186
|
children: [
|
|
187
187
|
/* @__PURE__ */ e(
|
|
188
|
-
|
|
188
|
+
se,
|
|
189
189
|
{
|
|
190
|
-
size:
|
|
191
|
-
...
|
|
190
|
+
size: A,
|
|
191
|
+
...o
|
|
192
192
|
}
|
|
193
193
|
),
|
|
194
|
-
|
|
194
|
+
o.selectionMode === "multiple" ? /* @__PURE__ */ e(te, { ...o }) : null
|
|
195
195
|
]
|
|
196
196
|
}
|
|
197
197
|
),
|
|
198
|
-
l === "bottom" && /* @__PURE__ */ e(
|
|
198
|
+
l === "bottom" && /* @__PURE__ */ e(_, { children: r }),
|
|
199
199
|
/* @__PURE__ */ i(
|
|
200
200
|
j,
|
|
201
201
|
{
|
|
202
|
-
className: s.popover,
|
|
203
202
|
offset: 0,
|
|
204
203
|
hideArrow: !0,
|
|
205
|
-
...
|
|
204
|
+
...h,
|
|
205
|
+
className: g(h?.className, a.popover),
|
|
206
206
|
children: [
|
|
207
|
-
|
|
207
|
+
o.isSelectableAll && /* @__PURE__ */ e(ee, {}),
|
|
208
208
|
/* @__PURE__ */ e(
|
|
209
209
|
G,
|
|
210
210
|
{
|
|
211
211
|
escapeKeyBehavior: "none",
|
|
212
|
-
items:
|
|
212
|
+
items: n,
|
|
213
213
|
children: t
|
|
214
214
|
}
|
|
215
215
|
)
|
|
216
216
|
]
|
|
217
217
|
}
|
|
218
218
|
),
|
|
219
|
-
/* @__PURE__ */ e(
|
|
219
|
+
/* @__PURE__ */ e(ae, { ...o })
|
|
220
220
|
]
|
|
221
221
|
}
|
|
222
222
|
) });
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as i, jsxs as u, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import { Tag as f, composeRenderProps as p, useContextProps as d, TagListContext as b, TagList as x, TagGroupContext as h, TagGroup as L } from "react-aria-components";
|
|
3
|
+
import { B as j } from "./Button-BhIvfqOc.js";
|
|
4
|
+
import { c } from "./clsx-AexbMWKp.js";
|
|
5
|
+
import { X as v } from "./x-B9bYxG31.js";
|
|
6
|
+
import { forwardRef as _, Children as y, isValidElement as N } from "react";
|
|
7
|
+
import '../assets/TagGroup.css';const w = "_button_13asj_1", G = "_green_13asj_14", C = "_red_13asj_15", R = "_blue_13asj_16", V = "_yellow_13asj_17", $ = "_tag_13asj_29", z = "_tagText_13asj_83", E = "_dismissable_13asj_96", a = {
|
|
8
|
+
button: w,
|
|
9
|
+
green: G,
|
|
10
|
+
red: C,
|
|
11
|
+
blue: R,
|
|
12
|
+
yellow: V,
|
|
13
|
+
tag: $,
|
|
14
|
+
tagText: z,
|
|
15
|
+
dismissable: E
|
|
16
|
+
}, q = ({
|
|
17
|
+
className: r,
|
|
18
|
+
color: e,
|
|
19
|
+
dismissable: o = !1,
|
|
20
|
+
isDismissable: s,
|
|
21
|
+
type: t,
|
|
22
|
+
...n
|
|
23
|
+
}) => {
|
|
24
|
+
const g = s || typeof s > "u" && o;
|
|
25
|
+
return /* @__PURE__ */ i(
|
|
26
|
+
f,
|
|
27
|
+
{
|
|
28
|
+
className: c(
|
|
29
|
+
a.tag,
|
|
30
|
+
g && a.dismissable,
|
|
31
|
+
{
|
|
32
|
+
[a.green]: e ? e === "green" : t === "success",
|
|
33
|
+
[a.blue]: e ? e === "blue" : t === "info",
|
|
34
|
+
[a.yellow]: e ? e === "yellow" : t === "important",
|
|
35
|
+
[a.red]: e ? e === "red" : t === "warning"
|
|
36
|
+
},
|
|
37
|
+
r
|
|
38
|
+
),
|
|
39
|
+
...n,
|
|
40
|
+
textValue: n.textValue || (typeof n.children == "string" ? n.children : void 0),
|
|
41
|
+
children: p(n.children, (l) => /* @__PURE__ */ u(T, { children: [
|
|
42
|
+
/* @__PURE__ */ i("div", { className: a.tagText, children: l }),
|
|
43
|
+
g && /* @__PURE__ */ i(
|
|
44
|
+
j,
|
|
45
|
+
{
|
|
46
|
+
variant: "icon",
|
|
47
|
+
size: "medium",
|
|
48
|
+
className: a.button,
|
|
49
|
+
slot: "remove",
|
|
50
|
+
children: /* @__PURE__ */ i(v, { size: 20 })
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] }))
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}, B = "_tagList_17pz2_1", P = {
|
|
57
|
+
tagList: B
|
|
58
|
+
}, k = (r, e) => {
|
|
59
|
+
const [{ className: o, ...s }, t] = d(
|
|
60
|
+
r,
|
|
61
|
+
e,
|
|
62
|
+
b
|
|
63
|
+
);
|
|
64
|
+
return /* @__PURE__ */ i(
|
|
65
|
+
x,
|
|
66
|
+
{
|
|
67
|
+
className: c(o, P.tagList),
|
|
68
|
+
ref: t,
|
|
69
|
+
...s
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}, m = _(k), A = _(
|
|
73
|
+
(r, e) => {
|
|
74
|
+
const [{ className: o, children: s, ...t }, n] = d(
|
|
75
|
+
r,
|
|
76
|
+
e,
|
|
77
|
+
h
|
|
78
|
+
), g = y.toArray(s).filter(N).find((l) => l.type === m);
|
|
79
|
+
return !g && process.env.NODE_ENV === "development" && console.warn(
|
|
80
|
+
"Using a TagGroup without providing a TagList component is deprecated since v17.0.0, see: https://designsystem.migrationsverket.se/components/tag/"
|
|
81
|
+
), /* @__PURE__ */ i(
|
|
82
|
+
L,
|
|
83
|
+
{
|
|
84
|
+
className: c(o),
|
|
85
|
+
ref: n,
|
|
86
|
+
...t,
|
|
87
|
+
children: g ? s : /* @__PURE__ */ i(m, { children: s })
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
A.displayName = "TagGroup";
|
|
93
|
+
export {
|
|
94
|
+
q as T,
|
|
95
|
+
A as a,
|
|
96
|
+
m as b
|
|
97
|
+
};
|
|
@@ -9,7 +9,7 @@ import { u as B } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
|
9
9
|
import { T as L } from "./Text-D0r_W4lH.js";
|
|
10
10
|
import { F as f } from "./FieldError-krpMBtie.js";
|
|
11
11
|
import { C as S } from "./CharacterCounter-Dgnv-orm.js";
|
|
12
|
-
import { a as v, L as E } from "./Label-
|
|
12
|
+
import { a as v, L as E } from "./Label-Bhnpbs10.js";
|
|
13
13
|
const x = c(
|
|
14
14
|
(e, o) => {
|
|
15
15
|
[e] = u(e, o, y);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface ColorSchemeSwitchProps {
|
|
3
3
|
/** Choose what element that should be affected by the scheme switch.
|
|
4
|
-
* @default
|
|
4
|
+
* @default :root
|
|
5
5
|
*/
|
|
6
6
|
selector?: string;
|
|
7
7
|
/** Set the default value for the color scheme. Default is "light dark" meaning follow system settings
|
package/combobox/index.js
CHANGED
package/date-field/index.js
CHANGED
package/date-picker/index.js
CHANGED