@midas-ds/components 17.28.2 → 17.30.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 +29 -0
- package/accordion/index.js +1 -1
- package/assets/file-list.css +1 -1
- package/assets/progress-bar.css +1 -1
- package/button/Button.stories.d.ts +1 -1
- package/button/index.js +1 -1
- package/calendar/index.js +1 -1
- package/card/index.js +1 -1
- package/checkbox/index.js +1 -1
- package/chunks/FeedbackStatusIcon-DvMDGBGL.js +36 -0
- package/chunks/{accordion-DIVTJU3O.js → accordion-BzmYSOS3.js} +23 -23
- package/chunks/{button-CenXTGXL.js → button-C-WkFek9.js} +1 -1
- package/chunks/calendar-Bt1FLxqr.js +107 -0
- package/chunks/card-CdH2UMUW.js +103 -0
- package/chunks/checkbox-DiFQy3MS.js +106 -0
- package/chunks/clear-button-Bv0YGBNG.js +17 -0
- package/chunks/color-scheme-switch-0axiBsna.js +160 -0
- package/chunks/{combobox-DIou4Z-d.js → combobox-DkZbA3o4.js} +24 -24
- package/chunks/{date-field-BF2f9bSf.js → date-field-CPpWZqws.js} +2 -2
- package/chunks/date-picker-DQ7vCG5-.js +142 -0
- package/chunks/file-list-D8Zc1aYS.js +139 -0
- package/chunks/{info-banner-osR4e6nB.js → info-banner-BVKtmVKN.js} +14 -14
- package/chunks/label-Dw5p84T2.js +50 -0
- package/chunks/layout-CUAjEEuH.js +378 -0
- package/chunks/link-DHu1cTmz.js +44 -0
- package/chunks/link-button-DYg_0p4Y.js +44 -0
- package/chunks/{list-box-BN_MSiOD.js → list-box-DmEoMvX1.js} +1 -1
- package/chunks/menu-CP0Xvmx0.js +48 -0
- package/chunks/modal-B_uSoXZM.js +66 -0
- package/chunks/progress-bar-BfFxpqUv.js +65 -0
- package/chunks/{radio-BD1EuxSa.js → radio-_z6ObjYx.js} +1 -1
- package/chunks/search-field-Cp_HHDl4.js +91 -0
- package/chunks/select-Wy6NakdH.js +176 -0
- package/chunks/spinner-COGZlDJB.js +29 -0
- package/chunks/table-O_Y45Sb7.js +84 -0
- package/chunks/tag-RjuYlFZI.js +78 -0
- package/chunks/{textfield-BSvCsAyC.js → textfield-Bu0Hg2pJ.js} +2 -2
- package/chunks/{time-field-CmjGBQph.js → time-field-Cnp-dYhm.js} +3 -3
- package/chunks/{toast-gJgjitZF.js → toast-Dg3fVjSS.js} +20 -20
- package/clear-button/index.js +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/file-list/FileList.stories.d.ts +15 -3
- package/file-list/FileListItem.d.ts +21 -1
- package/file-list/index.js +1 -1
- package/file-list/intl/translations.json.d.ts +10 -2
- package/index.js +49 -48
- package/info-banner/index.js +1 -1
- package/label/index.js +1 -1
- package/layout/index.js +1 -1
- package/link/index.js +1 -1
- package/link-button/index.js +1 -1
- package/list-box/index.js +1 -1
- package/menu/index.js +1 -1
- package/modal/index.js +1 -1
- package/package.json +3 -2
- package/progress-bar/ProgressBar.d.ts +11 -0
- package/progress-bar/ProgressBar.stories.d.ts +3 -0
- package/progress-bar/index.js +1 -1
- package/radio/index.js +1 -1
- package/search-field/index.js +1 -1
- package/select/index.js +1 -1
- package/spinner/index.js +1 -1
- package/table/index.js +1 -1
- package/tag/index.js +1 -1
- package/textfield/index.js +1 -1
- package/time-field/index.js +1 -1
- package/toast/index.js +1 -1
- package/chunks/FeedbackStatusIcon-DRI7WrSU.js +0 -54
- package/chunks/arrow-right-Db_H9KjE.js +0 -10
- package/chunks/calendar-Bl_obez5.js +0 -111
- package/chunks/card-zIYA-SQh.js +0 -103
- package/chunks/check-DV00NPU0.js +0 -7
- package/chunks/checkbox-Bqd8B58G.js +0 -110
- package/chunks/chevron-down-CP7nEDei.js +0 -7
- package/chunks/chevron-right-DwqboCdU.js +0 -7
- package/chunks/clear-button-D3I1X3yG.js +0 -17
- package/chunks/color-scheme-switch-DVZjdwc9.js +0 -203
- package/chunks/createLucideIcon-BgluSHFG.js +0 -39
- package/chunks/date-picker-DZivTUB_.js +0 -187
- package/chunks/file-list-TmEuO1fJ.js +0 -68
- package/chunks/info-jCyacVsy.js +0 -19
- package/chunks/label-LWlgvAwz.js +0 -50
- package/chunks/layout-Db5um0f7.js +0 -426
- package/chunks/link-BAgs4RwY.js +0 -59
- package/chunks/link-button-BuPMEGUj.js +0 -52
- package/chunks/menu-aT2IR0tO.js +0 -49
- package/chunks/modal-C-UsxdO0.js +0 -66
- package/chunks/progress-bar-7w_kWo2f.js +0 -40
- package/chunks/search-field-GNTRFpzf.js +0 -100
- package/chunks/select-oLCNpryY.js +0 -177
- package/chunks/spinner-LdHPVms_.js +0 -32
- package/chunks/square-arrow-out-up-right-DkgXD7hj.js +0 -17
- package/chunks/table-CmNWoAYO.js +0 -150
- package/chunks/tag-BIcqtf7b.js +0 -78
- package/chunks/x-BJAOO5a5.js +0 -10
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./clsx-Di52oYUU.js";
|
|
3
|
+
import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
4
|
+
import { n } from "./button-C-WkFek9.js";
|
|
5
|
+
import { t as r } from "./icons-UBHIX2oV.js";
|
|
6
|
+
import { n as i, t as a } from "./toggle-button-CIvsOXQf.js";
|
|
7
|
+
import { a as o, o as s, r as c } from "./menu-CP0Xvmx0.js";
|
|
8
|
+
import * as l from "react";
|
|
9
|
+
import { useEffect as u, useState as d } from "react";
|
|
10
|
+
import { MenuItem as f, SelectionIndicator as p } from "react-aria-components";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
import { ChevronDown as g, Moon as _, Sun as v } from "lucide-react";
|
|
13
|
+
import { VisuallyHidden as y } from "react-aria";
|
|
14
|
+
import '../assets/color-scheme-switch.css';var b = {
|
|
15
|
+
button: "_button_1r8vq_1",
|
|
16
|
+
selectionIndicator: "_selectionIndicator_1r8vq_14"
|
|
17
|
+
}, x = {
|
|
18
|
+
en: {
|
|
19
|
+
colorScheme: "Color scheme",
|
|
20
|
+
darkMode: "Dark mode",
|
|
21
|
+
lightMode: "Light mode",
|
|
22
|
+
system: "Follows system",
|
|
23
|
+
triggerDarkMode: "Color scheme: Dark mode",
|
|
24
|
+
triggerLightMode: "Color scheme: Light mode",
|
|
25
|
+
triggerSystem: "Color scheme: Follows system"
|
|
26
|
+
},
|
|
27
|
+
sv: {
|
|
28
|
+
colorScheme: "Färgschema",
|
|
29
|
+
darkMode: "Mörkt läge",
|
|
30
|
+
lightMode: "Ljust läge",
|
|
31
|
+
system: "Följer systemet",
|
|
32
|
+
triggerDarkMode: "Färgschema: Mörkt läge",
|
|
33
|
+
triggerLightMode: "Färgschema: Ljust läge",
|
|
34
|
+
triggerSystem: "Färgschema: Följer systemet"
|
|
35
|
+
}
|
|
36
|
+
}, S = ({ selector: e = ":root", defaultScheme: t = "light dark", scheme: n, onSchemeChange: r }) => {
|
|
37
|
+
let [i, a] = d(n ?? t), o = n ?? i;
|
|
38
|
+
return u(() => {
|
|
39
|
+
let t = document.querySelector(e);
|
|
40
|
+
if (!t) {
|
|
41
|
+
console.warn(`No element found for selector: "${e}"`);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
o === "light dark" ? delete t.dataset.colorScheme : t.dataset.colorScheme = o;
|
|
45
|
+
}, [o, e]), {
|
|
46
|
+
resolved: o,
|
|
47
|
+
onChange: (e) => {
|
|
48
|
+
a(e), r?.(e);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}, C = ({ selector: e = ":root", defaultScheme: n = "light dark", scheme: o, onSchemeChange: s, defaultValue: c, className: l }) => {
|
|
52
|
+
let { resolved: u, onChange: d } = S({
|
|
53
|
+
selector: e,
|
|
54
|
+
defaultScheme: c ? Array.from(c)[0] : n,
|
|
55
|
+
scheme: o,
|
|
56
|
+
onSchemeChange: s
|
|
57
|
+
}), f = t(x);
|
|
58
|
+
return /* @__PURE__ */ h(a, {
|
|
59
|
+
selectionMode: "single",
|
|
60
|
+
selectedKeys: /* @__PURE__ */ new Set([u]),
|
|
61
|
+
onSelectionChange: (e) => {
|
|
62
|
+
d(Array.from(e)[0]);
|
|
63
|
+
},
|
|
64
|
+
disallowEmptySelection: !0,
|
|
65
|
+
"aria-label": f.format("colorScheme"),
|
|
66
|
+
className: l,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ h(i, {
|
|
69
|
+
id: "light",
|
|
70
|
+
className: b.button,
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ m(v, {}),
|
|
73
|
+
/* @__PURE__ */ m(y, { children: f.format("lightMode") }),
|
|
74
|
+
/* @__PURE__ */ m(p, { className: b.selectionIndicator })
|
|
75
|
+
]
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ h(i, {
|
|
78
|
+
id: "dark",
|
|
79
|
+
className: b.button,
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ m(_, {}),
|
|
82
|
+
/* @__PURE__ */ m(y, { children: f.format("darkMode") }),
|
|
83
|
+
/* @__PURE__ */ m(p, { className: b.selectionIndicator })
|
|
84
|
+
]
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ h(i, {
|
|
87
|
+
id: "light dark",
|
|
88
|
+
className: b.button,
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ m(r, {}),
|
|
91
|
+
/* @__PURE__ */ m(y, { children: f.format("system") }),
|
|
92
|
+
/* @__PURE__ */ m(p, { className: b.selectionIndicator })
|
|
93
|
+
]
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
});
|
|
97
|
+
}, w = {
|
|
98
|
+
trigger: "_trigger_y8ah9_1",
|
|
99
|
+
chevron: "_chevron_y8ah9_6",
|
|
100
|
+
menu: "_menu_y8ah9_17",
|
|
101
|
+
menuItem: "_menuItem_y8ah9_21"
|
|
102
|
+
}, T = {
|
|
103
|
+
light: v,
|
|
104
|
+
"light dark": r,
|
|
105
|
+
dark: _
|
|
106
|
+
}, E = (e) => e === "light" ? "triggerLightMode" : e === "dark" ? "triggerDarkMode" : "triggerSystem", D = ({ selector: i = ":root", defaultScheme: a = "light dark", scheme: u, onSchemeChange: d, className: p }) => {
|
|
107
|
+
let { resolved: b, onChange: C } = S({
|
|
108
|
+
selector: i,
|
|
109
|
+
defaultScheme: a,
|
|
110
|
+
scheme: u,
|
|
111
|
+
onSchemeChange: d
|
|
112
|
+
}), D = T[b];
|
|
113
|
+
l.useEffect(() => {
|
|
114
|
+
let e = document.querySelector(i);
|
|
115
|
+
if (!e) {
|
|
116
|
+
console.warn(`No element found for selector: "${i}"`);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
b === "light dark" ? delete e.dataset.colorScheme : e.dataset.colorScheme = b;
|
|
120
|
+
}, [b, i]);
|
|
121
|
+
let O = t(x);
|
|
122
|
+
return /* @__PURE__ */ h(s, { children: [/* @__PURE__ */ h(n, {
|
|
123
|
+
variant: "icon",
|
|
124
|
+
size: "medium",
|
|
125
|
+
className: e(w.trigger, p),
|
|
126
|
+
"aria-label": O.format(E(b)),
|
|
127
|
+
children: [/* @__PURE__ */ m(D, { size: 20 }), /* @__PURE__ */ m(g, {
|
|
128
|
+
size: 20,
|
|
129
|
+
className: w.chevron
|
|
130
|
+
})]
|
|
131
|
+
}), /* @__PURE__ */ m(c, {
|
|
132
|
+
placement: "bottom start",
|
|
133
|
+
children: /* @__PURE__ */ h(o, {
|
|
134
|
+
onAction: (e) => C(e),
|
|
135
|
+
className: w.menu,
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ h(f, {
|
|
138
|
+
id: "light",
|
|
139
|
+
textValue: O.format("lightMode"),
|
|
140
|
+
className: w.menuItem,
|
|
141
|
+
children: [/* @__PURE__ */ m(v, { size: 20 }), /* @__PURE__ */ m(y, { children: O.format("lightMode") })]
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ h(f, {
|
|
144
|
+
id: "dark",
|
|
145
|
+
textValue: O.format("darkMode"),
|
|
146
|
+
className: w.menuItem,
|
|
147
|
+
children: [/* @__PURE__ */ m(_, { size: 20 }), /* @__PURE__ */ m(y, { children: O.format("darkMode") })]
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ h(f, {
|
|
150
|
+
id: "light dark",
|
|
151
|
+
textValue: O.format("system"),
|
|
152
|
+
className: w.menuItem,
|
|
153
|
+
children: [/* @__PURE__ */ m(r, { size: 20 }), /* @__PURE__ */ m(y, { children: O.format("system") })]
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
})
|
|
157
|
+
})] });
|
|
158
|
+
};
|
|
159
|
+
//#endregion
|
|
160
|
+
export { C as n, D as t };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { t as e } from "./clsx-Di52oYUU.js";
|
|
3
|
-
import { t } from "./
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import { t as a } from "./
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
4
|
+
import { n, t as r } from "./label-Dw5p84T2.js";
|
|
5
|
+
import { t as i } from "./text-DwmZ-ew8.js";
|
|
6
|
+
import { t as a } from "./field-error-LtNtEKDp.js";
|
|
7
|
+
import { a as o, c as s, t as c } from "./list-box-DmEoMvX1.js";
|
|
8
|
+
import { useRef as l } from "react";
|
|
9
|
+
import { Button as u, ComboBox as d, Input as f } from "react-aria-components";
|
|
10
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
11
|
+
import { ChevronDown as h } from "lucide-react";
|
|
12
12
|
import '../assets/combobox.css';var g = {
|
|
13
13
|
combobox: "_combobox_h0woh_1",
|
|
14
14
|
inputField: "_inputField_h0woh_6",
|
|
@@ -30,55 +30,55 @@ import '../assets/combobox.css';var g = {
|
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/combobox/ComboBox.tsx
|
|
32
32
|
function v({ label: v, description: y, errorMessage: b, children: x, items: S, className: C, errorPosition: w = "top", size: T = "large", popover: E, listBoxProps: D, ...O }) {
|
|
33
|
-
let k =
|
|
33
|
+
let k = l(null), A = t(_), j = (e) => {
|
|
34
34
|
e.currentTarget.value && k.current?.select();
|
|
35
35
|
};
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ m(d, {
|
|
37
37
|
className: e(g.combobox, C),
|
|
38
38
|
...O,
|
|
39
39
|
"data-readonly": O.isReadOnly || void 0,
|
|
40
40
|
children: [
|
|
41
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ p(n, {
|
|
42
42
|
popover: E,
|
|
43
|
-
children: v && /* @__PURE__ */
|
|
43
|
+
children: v && /* @__PURE__ */ p(r, { children: v })
|
|
44
44
|
}),
|
|
45
|
-
y && /* @__PURE__ */
|
|
45
|
+
y && /* @__PURE__ */ p(i, {
|
|
46
46
|
slot: "description",
|
|
47
47
|
children: y
|
|
48
48
|
}),
|
|
49
|
-
w === "top" && /* @__PURE__ */
|
|
49
|
+
w === "top" && /* @__PURE__ */ p(a, {
|
|
50
50
|
"data-testid": "fieldError",
|
|
51
51
|
children: b
|
|
52
52
|
}),
|
|
53
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ m("div", {
|
|
54
54
|
className: g.wrap,
|
|
55
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ p(f, {
|
|
56
56
|
className: e(g.inputField, { [g.medium]: T === "medium" }),
|
|
57
57
|
"data-readonly": O.isReadOnly || void 0,
|
|
58
58
|
onPointerUp: j,
|
|
59
59
|
ref: k
|
|
60
|
-
}), /* @__PURE__ */
|
|
60
|
+
}), /* @__PURE__ */ p(u, {
|
|
61
61
|
className: e(g.button, { [g.medium]: T === "medium" }),
|
|
62
62
|
"aria-label": A.format("showList"),
|
|
63
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ p("div", {
|
|
64
64
|
className: g.icon,
|
|
65
65
|
"aria-hidden": "true",
|
|
66
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ p(h, {
|
|
67
67
|
size: 20,
|
|
68
68
|
"aria-hidden": !0
|
|
69
69
|
})
|
|
70
70
|
})
|
|
71
71
|
})]
|
|
72
72
|
}),
|
|
73
|
-
w === "bottom" && /* @__PURE__ */
|
|
73
|
+
w === "bottom" && /* @__PURE__ */ p(a, {
|
|
74
74
|
"data-testid": "fieldError",
|
|
75
75
|
children: b
|
|
76
76
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ p(o, {
|
|
78
78
|
offset: 4,
|
|
79
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ p(s, {
|
|
80
80
|
items: S,
|
|
81
|
-
renderEmptyState: () => /* @__PURE__ */
|
|
81
|
+
renderEmptyState: () => /* @__PURE__ */ p(c, { children: A.format("noResultsFound") }),
|
|
82
82
|
...D,
|
|
83
83
|
children: x
|
|
84
84
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as e } from "./clsx-Di52oYUU.js";
|
|
2
2
|
import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
3
|
-
import { n, t as r } from "./label-
|
|
3
|
+
import { n, t as r } from "./label-Dw5p84T2.js";
|
|
4
4
|
import { t as i } from "./text-DwmZ-ew8.js";
|
|
5
5
|
import { t as a } from "./field-error-LtNtEKDp.js";
|
|
6
|
-
import { t as o } from "./clear-button-
|
|
6
|
+
import { t as o } from "./clear-button-Bv0YGBNG.js";
|
|
7
7
|
import * as s from "react";
|
|
8
8
|
import { DateField as c, DateFieldStateContext as l, DateInput as u, DateSegment as d } from "react-aria-components";
|
|
9
9
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { n as e } from "./clsx-Di52oYUU.js";
|
|
3
|
+
import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
4
|
+
import { n } from "./button-C-WkFek9.js";
|
|
5
|
+
import { n as r, t as i } from "./calendar-Bt1FLxqr.js";
|
|
6
|
+
import { n as a, t as o } from "./label-Dw5p84T2.js";
|
|
7
|
+
import { t as s } from "./text-DwmZ-ew8.js";
|
|
8
|
+
import { t as c } from "./field-error-LtNtEKDp.js";
|
|
9
|
+
import { t as l } from "./clear-button-Bv0YGBNG.js";
|
|
10
|
+
import { n as u, r as d, t as f } from "./date-field-CPpWZqws.js";
|
|
11
|
+
import * as p from "react";
|
|
12
|
+
import { DatePicker as m, DatePickerStateContext as h, DateRangePicker as g, DateRangePickerStateContext as _, Group as v, Popover as y } from "react-aria-components";
|
|
13
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
14
|
+
import { CalendarDays as S } from "lucide-react";
|
|
15
|
+
import { FocusScope as C, useFocusManager as w } from "react-aria";
|
|
16
|
+
import '../assets/date-picker.css';var T = {
|
|
17
|
+
en: {
|
|
18
|
+
clear: "Clear date",
|
|
19
|
+
"open-calendar": "Open calendar"
|
|
20
|
+
},
|
|
21
|
+
sv: {
|
|
22
|
+
clear: "Rensa datum",
|
|
23
|
+
"open-calendar": "Öppna kalender"
|
|
24
|
+
}
|
|
25
|
+
}, E = {
|
|
26
|
+
datePicker: "_datePicker_14wog_1",
|
|
27
|
+
inputField: "_inputField_14wog_8",
|
|
28
|
+
medium: "_medium_14wog_24",
|
|
29
|
+
readOnly: "_readOnly_14wog_47",
|
|
30
|
+
buttonGroup: "_buttonGroup_14wog_52",
|
|
31
|
+
iconButton: "_iconButton_14wog_58",
|
|
32
|
+
popover: "_popover_14wog_81 _dropdownAnimation_1ljkv_4"
|
|
33
|
+
}, D = (e) => !!e && !!e.value && Object.prototype.hasOwnProperty.call(e.value, "start"), O = ({ isClearable: n, isDisabled: r, isReadOnly: i, size: a }) => {
|
|
34
|
+
let o = p.useContext(h), s = p.useContext(_), c = t(T), u = w(), d = s ?? o, f = D(d) ? !!d.value.start && d.value.end : !!d?.value;
|
|
35
|
+
return n && f && !i ? /* @__PURE__ */ b(l, {
|
|
36
|
+
onPress: () => {
|
|
37
|
+
d?.setValue(null), u?.focusFirst();
|
|
38
|
+
},
|
|
39
|
+
size: a,
|
|
40
|
+
isDisabled: r,
|
|
41
|
+
"aria-label": c.format("clear"),
|
|
42
|
+
className: e(E.iconButton, { [E.medium]: a === "medium" })
|
|
43
|
+
}) : null;
|
|
44
|
+
}, k = ({ children: r, isDisabled: i, isInvalid: a, isReadOnly: o, size: s = "large", isClearable: c = !1 }) => {
|
|
45
|
+
let l = t(T);
|
|
46
|
+
return /* @__PURE__ */ b(v, {
|
|
47
|
+
className: e(E.inputField, {
|
|
48
|
+
[E.medium]: s === "medium",
|
|
49
|
+
[E.readOnly]: o
|
|
50
|
+
}),
|
|
51
|
+
children: /* @__PURE__ */ x(C, { children: [r, /* @__PURE__ */ x("div", {
|
|
52
|
+
className: E.buttonGroup,
|
|
53
|
+
children: [/* @__PURE__ */ b(O, {
|
|
54
|
+
isClearable: c,
|
|
55
|
+
isDisabled: i,
|
|
56
|
+
isReadOnly: o,
|
|
57
|
+
size: s
|
|
58
|
+
}), /* @__PURE__ */ b(n, {
|
|
59
|
+
variant: "icon",
|
|
60
|
+
"aria-label": l.format("open-calendar"),
|
|
61
|
+
className: e(E.iconButton, {
|
|
62
|
+
[E.medium]: s === "medium",
|
|
63
|
+
[E.readOnly]: o
|
|
64
|
+
}),
|
|
65
|
+
"data-invalid": a || void 0,
|
|
66
|
+
size: s,
|
|
67
|
+
children: /* @__PURE__ */ b(S, {
|
|
68
|
+
"aria-hidden": !0,
|
|
69
|
+
size: 20
|
|
70
|
+
})
|
|
71
|
+
})]
|
|
72
|
+
})] })
|
|
73
|
+
});
|
|
74
|
+
}, A = ({ children: e }) => /* @__PURE__ */ b(y, {
|
|
75
|
+
className: E.popover,
|
|
76
|
+
children: e
|
|
77
|
+
}), j = p.forwardRef(({ className: t, description: n, errorMessage: i, errorPosition: l = "top", label: f, popover: p, isClearable: h = !1, isReadOnly: g, isDisabled: _, size: v, ...y }, S) => /* @__PURE__ */ x(m, {
|
|
78
|
+
className: e(E.datePicker, t),
|
|
79
|
+
isReadOnly: g,
|
|
80
|
+
isDisabled: _,
|
|
81
|
+
ref: S,
|
|
82
|
+
...y,
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ b(a, {
|
|
85
|
+
popover: p,
|
|
86
|
+
children: f && /* @__PURE__ */ b(o, { children: f })
|
|
87
|
+
}),
|
|
88
|
+
n && /* @__PURE__ */ b(s, {
|
|
89
|
+
slot: "description",
|
|
90
|
+
children: n
|
|
91
|
+
}),
|
|
92
|
+
l === "top" && /* @__PURE__ */ b(c, { children: i }),
|
|
93
|
+
/* @__PURE__ */ b(k, {
|
|
94
|
+
isClearable: h,
|
|
95
|
+
isReadOnly: g,
|
|
96
|
+
isDisabled: _,
|
|
97
|
+
size: v,
|
|
98
|
+
...y,
|
|
99
|
+
children: /* @__PURE__ */ b(u, { children: (e) => /* @__PURE__ */ b(d, { segment: e }) })
|
|
100
|
+
}),
|
|
101
|
+
l === "bottom" && /* @__PURE__ */ b(c, { children: i }),
|
|
102
|
+
/* @__PURE__ */ b(A, { children: /* @__PURE__ */ b(r, {}) })
|
|
103
|
+
]
|
|
104
|
+
})), M = ({ className: t, description: n, errorMessage: r, errorPosition: l = "top", label: p, popover: m, isClearable: h = !1, isReadOnly: _, isDisabled: v, size: y, ...S }) => /* @__PURE__ */ x(g, {
|
|
105
|
+
className: e(E.datePicker, t),
|
|
106
|
+
isReadOnly: _,
|
|
107
|
+
isDisabled: v,
|
|
108
|
+
...S,
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ b(a, {
|
|
111
|
+
popover: m,
|
|
112
|
+
children: p && /* @__PURE__ */ b(o, { children: p })
|
|
113
|
+
}),
|
|
114
|
+
n && /* @__PURE__ */ b(s, {
|
|
115
|
+
slot: "description",
|
|
116
|
+
children: n
|
|
117
|
+
}),
|
|
118
|
+
l === "top" && /* @__PURE__ */ b(c, { children: r }),
|
|
119
|
+
/* @__PURE__ */ x(k, {
|
|
120
|
+
isClearable: h,
|
|
121
|
+
isReadOnly: _,
|
|
122
|
+
isDisabled: v,
|
|
123
|
+
size: y,
|
|
124
|
+
...S,
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ b(u, {
|
|
127
|
+
slot: "start",
|
|
128
|
+
children: (e) => /* @__PURE__ */ b(d, { segment: e })
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ b(f, {}),
|
|
131
|
+
/* @__PURE__ */ b(u, {
|
|
132
|
+
slot: "end",
|
|
133
|
+
children: (e) => /* @__PURE__ */ b(d, { segment: e })
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
}),
|
|
137
|
+
l === "bottom" && /* @__PURE__ */ b(c, { children: r }),
|
|
138
|
+
/* @__PURE__ */ b(A, { children: /* @__PURE__ */ b(i, {}) })
|
|
139
|
+
]
|
|
140
|
+
});
|
|
141
|
+
//#endregion
|
|
142
|
+
export { j as n, M as t };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./clsx-Di52oYUU.js";
|
|
3
|
+
import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
4
|
+
import { n } from "./button-C-WkFek9.js";
|
|
5
|
+
import { t as r } from "./FeedbackStatusIcon-DvMDGBGL.js";
|
|
6
|
+
import { t as i } from "./field-error-LtNtEKDp.js";
|
|
7
|
+
import { t as a } from "./progress-bar-BfFxpqUv.js";
|
|
8
|
+
import { useEffect as o, useId as s, useRef as c } from "react";
|
|
9
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
+
import { Trash2 as f, X as p } from "lucide-react";
|
|
11
|
+
import { FocusScope as m, VisuallyHidden as h, useFocusManager as g } from "react-aria";
|
|
12
|
+
import '../assets/file-list.css';var _ = {
|
|
13
|
+
fileList: "_fileList_mb5n3_1",
|
|
14
|
+
fileListItem: "_fileListItem_mb5n3_18",
|
|
15
|
+
row: "_row_mb5n3_25",
|
|
16
|
+
iconSlot: "_iconSlot_mb5n3_46",
|
|
17
|
+
progressIcon: "_progressIcon_mb5n3_70",
|
|
18
|
+
ring: "_ring_mb5n3_82",
|
|
19
|
+
successRing: "_successRing_mb5n3_1",
|
|
20
|
+
checkmark: "_checkmark_mb5n3_106",
|
|
21
|
+
successCheckmark: "_successCheckmark_mb5n3_1",
|
|
22
|
+
successIcon: "_successIcon_mb5n3_121",
|
|
23
|
+
errorReveal: "_errorReveal_mb5n3_163",
|
|
24
|
+
fileInfo: "_fileInfo_mb5n3_169",
|
|
25
|
+
fileName: "_fileName_mb5n3_177",
|
|
26
|
+
fileSize: "_fileSize_mb5n3_186",
|
|
27
|
+
deleteButton: "_deleteButton_mb5n3_192"
|
|
28
|
+
}, v = ({ className: t, children: n, ...r }) => {
|
|
29
|
+
let i = c(null);
|
|
30
|
+
return /* @__PURE__ */ u(m, { children: /* @__PURE__ */ d("ul", {
|
|
31
|
+
...r,
|
|
32
|
+
ref: i,
|
|
33
|
+
tabIndex: -1,
|
|
34
|
+
className: e(_.fileList, t),
|
|
35
|
+
children: [/* @__PURE__ */ u(y, { containerRef: i }), n]
|
|
36
|
+
}) });
|
|
37
|
+
}, y = ({ containerRef: e }) => {
|
|
38
|
+
let t = g(), n = c(t);
|
|
39
|
+
return o(() => {
|
|
40
|
+
n.current = t;
|
|
41
|
+
}), o(() => {
|
|
42
|
+
let t = e.current;
|
|
43
|
+
if (!t) return;
|
|
44
|
+
let r = new MutationObserver((e) => {
|
|
45
|
+
e.some((e) => e.removedNodes.length > 0) && document.activeElement === document.body && (n.current?.focusFirst({ tabbable: !0 }) || t.focus());
|
|
46
|
+
});
|
|
47
|
+
return r.observe(t, { childList: !0 }), () => r.disconnect();
|
|
48
|
+
}, [e]), null;
|
|
49
|
+
}, b = {
|
|
50
|
+
en: {
|
|
51
|
+
removeFile: "Remove",
|
|
52
|
+
cancelUpload: "Cancel",
|
|
53
|
+
uploading: "Uploading",
|
|
54
|
+
uploadComplete: "Upload complete",
|
|
55
|
+
uploadFailed: "Upload failed"
|
|
56
|
+
},
|
|
57
|
+
sv: {
|
|
58
|
+
removeFile: "Ta bort",
|
|
59
|
+
cancelUpload: "Avbryt",
|
|
60
|
+
uploading: "Laddar upp",
|
|
61
|
+
uploadComplete: "Uppladdning klar",
|
|
62
|
+
uploadFailed: "Uppladdning misslyckades"
|
|
63
|
+
}
|
|
64
|
+
}, x = ({ fileName: o, fileSize: c, status: m = "idle", progress: g, errorMessage: v, onCancel: y, onDelete: x, className: S }) => {
|
|
65
|
+
let C = t(b), w = m === "uploading", T = m === "success", E = m === "error", D = E && !!v, O = s(), k = s(), A = T ? C.format("uploadComplete") : E ? C.format("uploadFailed") : void 0, j = [A && k, D && O].filter(Boolean).join(" ") || void 0, M = w ? y ?? x : x;
|
|
66
|
+
return /* @__PURE__ */ d("li", {
|
|
67
|
+
className: e(_.fileListItem, S),
|
|
68
|
+
"data-status": m,
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ d("div", {
|
|
71
|
+
className: _.row,
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ d("span", {
|
|
74
|
+
className: _.iconSlot,
|
|
75
|
+
children: [
|
|
76
|
+
w && /* @__PURE__ */ u(a, {
|
|
77
|
+
shape: "circular",
|
|
78
|
+
small: !0,
|
|
79
|
+
value: g,
|
|
80
|
+
isIndeterminate: g === void 0,
|
|
81
|
+
"aria-label": `${C.format("uploading")} ${o}`,
|
|
82
|
+
className: _.progressIcon
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ u("span", {
|
|
85
|
+
className: _.ring,
|
|
86
|
+
"aria-hidden": !0
|
|
87
|
+
}),
|
|
88
|
+
T && /* @__PURE__ */ u(r, {
|
|
89
|
+
status: "success",
|
|
90
|
+
"aria-hidden": !0,
|
|
91
|
+
size: 16,
|
|
92
|
+
className: e(_.checkmark, _.successIcon)
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
}),
|
|
96
|
+
A && /* @__PURE__ */ u(h, {
|
|
97
|
+
id: k,
|
|
98
|
+
children: A
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ d("span", {
|
|
101
|
+
className: _.fileInfo,
|
|
102
|
+
children: [/* @__PURE__ */ u("span", {
|
|
103
|
+
className: _.fileName,
|
|
104
|
+
children: o
|
|
105
|
+
}), c && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(h, { children: ", " }), /* @__PURE__ */ u("span", {
|
|
106
|
+
className: _.fileSize,
|
|
107
|
+
children: c
|
|
108
|
+
})] })]
|
|
109
|
+
}),
|
|
110
|
+
M && /* @__PURE__ */ u(n, {
|
|
111
|
+
variant: "icon",
|
|
112
|
+
onPress: M,
|
|
113
|
+
"aria-label": `${C.format(w ? "cancelUpload" : "removeFile")} ${o}`,
|
|
114
|
+
"aria-describedby": j,
|
|
115
|
+
className: _.deleteButton,
|
|
116
|
+
children: u(w ? p : f, {
|
|
117
|
+
size: 20,
|
|
118
|
+
"aria-hidden": !0
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ u("div", {
|
|
124
|
+
id: O,
|
|
125
|
+
className: _.errorReveal,
|
|
126
|
+
children: v && /* @__PURE__ */ u(i, {
|
|
127
|
+
isInvalid: !0,
|
|
128
|
+
children: v
|
|
129
|
+
})
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ d(h, {
|
|
132
|
+
role: "status",
|
|
133
|
+
children: [T && `${C.format("uploadComplete")}: ${o}`, D && `${o}: ${v}`]
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
//#endregion
|
|
139
|
+
export { v as n, x as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as e } from "./clsx-Di52oYUU.js";
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import {
|
|
4
|
-
import { t as r } from "./
|
|
5
|
-
import { n as i } from "./button-CenXTGXL.js";
|
|
2
|
+
import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
3
|
+
import { n } from "./button-C-WkFek9.js";
|
|
4
|
+
import { t as r } from "./FeedbackStatusIcon-DvMDGBGL.js";
|
|
6
5
|
import "react";
|
|
7
|
-
import { jsx as
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
import { X as o } from "lucide-react";
|
|
8
8
|
import { useControlledState as s } from "@react-stately/utils";
|
|
9
9
|
import '../assets/info-banner.css';var c = {
|
|
10
10
|
infoBanner: "_infoBanner_7d8d1_1",
|
|
@@ -21,35 +21,35 @@ import '../assets/info-banner.css';var c = {
|
|
|
21
21
|
en: { close: "Close" },
|
|
22
22
|
sv: { close: "Stäng" }
|
|
23
23
|
}, u = ({ title: u, message: d, type: f, children: p, isDismissable: m = !1, defaultOpen: h = !0, isOpen: g, onOpenChange: _, ...v }) => {
|
|
24
|
-
let [y, b] = s(g, h, _), x =
|
|
24
|
+
let [y, b] = s(g, h, _), x = t(l), S = () => {
|
|
25
25
|
b(!1);
|
|
26
26
|
};
|
|
27
|
-
return y ? /* @__PURE__ */
|
|
27
|
+
return y ? /* @__PURE__ */ a("aside", {
|
|
28
28
|
...v,
|
|
29
29
|
className: e(c.infoBanner, c[f], v.className),
|
|
30
30
|
children: [
|
|
31
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ i(r, {
|
|
32
32
|
"aria-hidden": !0,
|
|
33
33
|
className: c.icon,
|
|
34
34
|
status: f
|
|
35
35
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ a("div", {
|
|
37
37
|
className: c.content,
|
|
38
|
-
children: [u && /* @__PURE__ */
|
|
38
|
+
children: [u && /* @__PURE__ */ i("strong", {
|
|
39
39
|
className: c.heading,
|
|
40
40
|
children: u
|
|
41
|
-
}), /* @__PURE__ */
|
|
41
|
+
}), /* @__PURE__ */ a("div", {
|
|
42
42
|
className: c.text,
|
|
43
43
|
children: [d, p]
|
|
44
44
|
})]
|
|
45
45
|
}),
|
|
46
|
-
m && /* @__PURE__ */
|
|
46
|
+
m && /* @__PURE__ */ i("div", {
|
|
47
47
|
className: c.dismissable,
|
|
48
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ i(n, {
|
|
49
49
|
variant: "icon",
|
|
50
50
|
"aria-label": x.format("close"),
|
|
51
51
|
onPress: S,
|
|
52
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ i(o, { size: 20 })
|
|
53
53
|
})
|
|
54
54
|
})
|
|
55
55
|
]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { t as e } from "./clsx-Di52oYUU.js";
|
|
2
|
+
import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
3
|
+
import { n } from "./button-C-WkFek9.js";
|
|
4
|
+
import { t as r } from "./popover-DGcogqbS.js";
|
|
5
|
+
import { t as i } from "./modal-B_uSoXZM.js";
|
|
6
|
+
import * as a from "react";
|
|
7
|
+
import o, { useContext as s } from "react";
|
|
8
|
+
import { Label as c } from "react-aria-components";
|
|
9
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
import { Info as d } from "lucide-react";
|
|
11
|
+
import '../assets/label.css';var f = { labelBase: "_labelBase_f5wtf_1" }, p = {
|
|
12
|
+
labelPopover: "_labelPopover_15nnd_1",
|
|
13
|
+
labelPopoverTrigger: "_labelPopoverTrigger_15nnd_7"
|
|
14
|
+
}, m = {
|
|
15
|
+
en: { moreInfo: "More info" },
|
|
16
|
+
sv: { moreInfo: "Mer information" }
|
|
17
|
+
}, h = ({ children: e, "aria-label": a }) => {
|
|
18
|
+
let o = s(g), c = t(m);
|
|
19
|
+
return /* @__PURE__ */ u(i, { children: [/* @__PURE__ */ l(n, {
|
|
20
|
+
"aria-label": a || c.format("moreInfo"),
|
|
21
|
+
className: p.labelPopoverTrigger,
|
|
22
|
+
id: o?.popoverId,
|
|
23
|
+
size: "medium",
|
|
24
|
+
slot: null,
|
|
25
|
+
variant: "icon",
|
|
26
|
+
children: /* @__PURE__ */ l(d, { size: 20 })
|
|
27
|
+
}), /* @__PURE__ */ l(r, { children: e })] });
|
|
28
|
+
}, g = o.createContext(void 0), _ = ({ children: e, popover: t }) => {
|
|
29
|
+
let n = o.useId();
|
|
30
|
+
return t ? /* @__PURE__ */ l(g.Provider, {
|
|
31
|
+
value: { popoverId: n },
|
|
32
|
+
children: /* @__PURE__ */ u("div", {
|
|
33
|
+
className: p.labelPopover,
|
|
34
|
+
children: [e, /* @__PURE__ */ l(h, { ...t })]
|
|
35
|
+
})
|
|
36
|
+
}) : e;
|
|
37
|
+
}, v = "label", y = ({ children: t, className: n, elementType: r = v, ...i }) => {
|
|
38
|
+
let o = {
|
|
39
|
+
className: e(f.labelBase, n),
|
|
40
|
+
elementType: r || v,
|
|
41
|
+
...i
|
|
42
|
+
}, s = a.useContext(g);
|
|
43
|
+
return /* @__PURE__ */ l(c, {
|
|
44
|
+
...o,
|
|
45
|
+
"aria-describedby": s?.popoverId,
|
|
46
|
+
children: t
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { _ as n, y as t };
|