@midas-ds/components 17.29.0 → 17.30.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 +16 -0
- package/accordion/index.js +1 -1
- package/badge/index.js +1 -1
- package/breadcrumbs/index.js +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-DlVM6IKH.js} +24 -24
- package/chunks/{badge-BfK6XrlL.js → badge-C4bXJmhn.js} +1 -1
- package/chunks/{breadcrumbs-DV0ZJc62.js → breadcrumbs-BGnyY3bO.js} +1 -1
- package/chunks/{button-CenXTGXL.js → button-dpe6hXmI.js} +2 -2
- package/chunks/calendar-BnT8aqrk.js +108 -0
- package/chunks/card-C0S9Kyi2.js +103 -0
- package/chunks/checkbox-B1RWLsu9.js +106 -0
- package/chunks/clear-button-DWtOkhCH.js +17 -0
- package/chunks/clsx-DAqHMl_k.js +7 -0
- package/chunks/color-scheme-switch-DVyIszaD.js +160 -0
- package/chunks/{combobox-DIou4Z-d.js → combobox-BLAVO2ax.js} +25 -25
- package/chunks/{date-field-BF2f9bSf.js → date-field-D5QLfSD_.js} +5 -5
- package/chunks/date-picker-BWSHiwIN.js +142 -0
- package/chunks/{drop-zone-DH3ZyHsr.js → drop-zone-DNhEbH4w.js} +1 -1
- package/chunks/{field-error-LtNtEKDp.js → field-error-BHoPnRe4.js} +2 -2
- package/chunks/file-list-Ntos8dkG.js +139 -0
- package/chunks/{grid-Cn_8RSvj.js → grid-BR68fpvW.js} +1 -1
- package/chunks/{heading-BEl_z-5T.js → heading-DcOjYrUM.js} +1 -1
- package/chunks/{info-banner-osR4e6nB.js → info-banner-DXjPEG69.js} +15 -15
- package/chunks/label-pGlER0ro.js +50 -0
- package/chunks/layout-Bue2Lkbc.js +378 -0
- package/chunks/link-B76JDA2N.js +44 -0
- package/chunks/link-button-BeXxC22w.js +44 -0
- package/chunks/{list-box-BN_MSiOD.js → list-box-BzBJX0nP.js} +3 -3
- package/chunks/{logo-DyZ2pXt7.js → logo-DSJ1bUJZ.js} +1 -1
- package/chunks/menu-DbQ98noD.js +48 -0
- package/chunks/modal-C8rs1jfL.js +66 -0
- package/chunks/{popover-DGcogqbS.js → popover-B82BcP5n.js} +1 -1
- package/chunks/{progress-bar-CknF4qAm.js → progress-bar-S6GNHQRZ.js} +2 -2
- package/chunks/{radio-BD1EuxSa.js → radio-uAtTm38S.js} +4 -4
- package/chunks/search-field-Bx3JApAJ.js +91 -0
- package/chunks/select-CuKVJ1x9.js +177 -0
- package/chunks/{skeleton-B_BPRPJy.js → skeleton-R_3dS7Ro.js} +1 -1
- package/chunks/spinner-CIjfJeGm.js +29 -0
- package/chunks/{stack-LF3ExhH9.js → stack-BAHKom_Q.js} +1 -1
- package/chunks/table-DDTeIVh8.js +84 -0
- package/chunks/{tabs-Co09VWvC.js → tabs-owuRVJ3N.js} +1 -1
- package/chunks/tag-BEawJnJm.js +78 -0
- package/chunks/{text-DwmZ-ew8.js → text-DnvD4Cjc.js} +1 -1
- package/chunks/textfield-G6u6RJD5.js +113 -0
- package/chunks/{time-field-CmjGBQph.js → time-field-Mm1iDLzS.js} +6 -6
- package/chunks/{toast-gJgjitZF.js → toast-DZuvVRD_.js} +21 -21
- package/chunks/{toggle-button-CIvsOXQf.js → toggle-button-DD_bXanH.js} +1 -1
- package/chunks/{tooltip-BkesIUIF.js → tooltip-1GBTeMrm.js} +1 -1
- 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/drop-zone/index.js +1 -1
- package/field-error/index.js +1 -1
- package/file-list/index.js +1 -1
- package/grid/index.js +1 -1
- package/heading/index.js +1 -1
- package/index.js +52 -50
- package/info-banner/index.js +1 -1
- package/label/index.js +1 -1
- package/layout/Layout.d.ts +1 -2
- package/layout/context/LayoutContext.d.ts +7 -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/logo/index.js +1 -1
- package/menu/index.js +1 -1
- package/modal/index.js +1 -1
- package/package.json +4 -2
- package/popover/index.js +1 -1
- 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/skeleton/index.js +1 -1
- package/spinner/index.js +1 -1
- package/stack/index.js +1 -1
- package/table/index.js +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.js +1 -1
- package/text/index.js +1 -1
- package/textfield/index.js +1 -1
- package/time-field/index.js +1 -1
- package/toast/index.js +1 -1
- package/toggle-button/index.js +1 -1
- package/tooltip/index.js +1 -1
- package/accordion/Accordion.stories.d.ts +0 -23
- package/accordion/AccordionItem.stories.d.ts +0 -25
- package/badge/Badge.stories.d.ts +0 -17
- package/breadcrumbs/Breadcrumbs.stories.d.ts +0 -25
- package/button/Button.stories.d.ts +0 -25
- package/button/ButtonGroup.stories.d.ts +0 -15
- package/calendar/Calendar.stories.d.ts +0 -17
- package/calendar/RangeCalendar.stories.d.ts +0 -15
- package/card/Card.stories.d.ts +0 -19
- package/checkbox/Checkbox.stories.d.ts +0 -30
- package/checkbox/CheckboxGroup.stories.d.ts +0 -31
- 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/clsx-Di52oYUU.js +0 -23
- 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-B4vG_egr.js +0 -161
- 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/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/textfield-BSvCsAyC.js +0 -112
- package/chunks/x-BJAOO5a5.js +0 -10
- package/color-scheme-switch/ColorSchemeSwitch.stories.d.ts +0 -7
- package/color-scheme-switch/ColorSchemeSwitchMenu.stories.d.ts +0 -8
- package/combobox/ComboBox.stories.d.ts +0 -43
- package/date-field/DateField.stories.d.ts +0 -15
- package/date-picker/DatePicker.stories.d.ts +0 -17
- package/date-picker/DateRangePicker.stories.d.ts +0 -39
- package/drop-zone/DropZone.stories.d.ts +0 -16
- package/file-list/FileList.stories.d.ts +0 -31
- package/grid/Grid.stories.d.ts +0 -28
- package/heading/Heading.stories.d.ts +0 -30
- package/info-banner/InfoBanner.stories.d.ts +0 -16
- package/label/Label.stories.d.ts +0 -10
- package/layout/Layout.stories.d.ts +0 -9
- package/link/Link.stories.d.ts +0 -14
- package/link-button/LinkButton.stories.d.ts +0 -13
- package/list-box/ListBox.stories.d.ts +0 -24
- package/logo/Logo.stories.d.ts +0 -7
- package/menu/Menu.stories.d.ts +0 -35
- package/modal/Modal.stories.d.ts +0 -15
- package/popover/Popover.stories.d.ts +0 -18
- package/progress-bar/ProgressBar.stories.d.ts +0 -18
- package/radio/Radio.stories.d.ts +0 -110
- package/radio/RadioGroup.stories.d.ts +0 -27
- package/search-field/SearchField.stories.d.ts +0 -34
- package/select/Select.stories.d.ts +0 -53
- package/skeleton/Skeleton.Form.stories.d.ts +0 -20
- package/skeleton/Skeleton.stories.d.ts +0 -10
- package/spinner/Spinner.stories.d.ts +0 -20
- package/stack/Stack.stories.d.ts +0 -24
- package/table/Table.stories.d.ts +0 -39
- package/tabs/Tabs.stories.d.ts +0 -31
- package/tag/Tag.stories.d.ts +0 -17
- package/text/Text.stories.d.ts +0 -10
- package/textfield/TextArea.stories.d.ts +0 -365
- package/textfield/TextField.stories.d.ts +0 -39
- package/time-field/TimeField.stories.d.ts +0 -37
- package/toast/Toast.stories.d.ts +0 -24
- package/tooltip/Tooltip.stories.d.ts +0 -26
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./clsx-DAqHMl_k.js";
|
|
3
|
+
import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
4
|
+
import { n } from "./button-dpe6hXmI.js";
|
|
5
|
+
import { t as r } from "./icons-UBHIX2oV.js";
|
|
6
|
+
import { n as i, t as a } from "./toggle-button-DD_bXanH.js";
|
|
7
|
+
import { a as o, o as s, r as c } from "./menu-DbQ98noD.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
|
-
import { t as e } from "./clsx-
|
|
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 {
|
|
2
|
+
import { t as e } from "./clsx-DAqHMl_k.js";
|
|
3
|
+
import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
4
|
+
import { n, t as r } from "./label-pGlER0ro.js";
|
|
5
|
+
import { t as i } from "./text-DnvD4Cjc.js";
|
|
6
|
+
import { t as a } from "./field-error-BHoPnRe4.js";
|
|
7
|
+
import { a as o, c as s, t as c } from "./list-box-BzBJX0nP.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
|
-
import { t as e } from "./clsx-
|
|
1
|
+
import { t as e } from "./clsx-DAqHMl_k.js";
|
|
2
2
|
import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
3
|
-
import { n, t as r } from "./label-
|
|
4
|
-
import { t as i } from "./text-
|
|
5
|
-
import { t as a } from "./field-error-
|
|
6
|
-
import { t as o } from "./clear-button-
|
|
3
|
+
import { n, t as r } from "./label-pGlER0ro.js";
|
|
4
|
+
import { t as i } from "./text-DnvD4Cjc.js";
|
|
5
|
+
import { t as a } from "./field-error-BHoPnRe4.js";
|
|
6
|
+
import { t as o } from "./clear-button-DWtOkhCH.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 { t as e } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
3
|
+
import { n as t } from "./button-dpe6hXmI.js";
|
|
4
|
+
import { n, t as r } from "./calendar-BnT8aqrk.js";
|
|
5
|
+
import { n as i, t as a } from "./label-pGlER0ro.js";
|
|
6
|
+
import { t as o } from "./text-DnvD4Cjc.js";
|
|
7
|
+
import { t as s } from "./field-error-BHoPnRe4.js";
|
|
8
|
+
import { t as c } from "./clear-button-DWtOkhCH.js";
|
|
9
|
+
import { n as l, r as u, t as d } from "./date-field-D5QLfSD_.js";
|
|
10
|
+
import * as f from "react";
|
|
11
|
+
import { clsx as p } from "clsx";
|
|
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: t, isDisabled: n, isReadOnly: r, size: i }) => {
|
|
34
|
+
let a = f.useContext(h), o = f.useContext(_), s = e(T), l = w(), u = o ?? a, d = D(u) ? !!u.value.start && u.value.end : !!u?.value;
|
|
35
|
+
return t && d && !r ? /* @__PURE__ */ b(c, {
|
|
36
|
+
onPress: () => {
|
|
37
|
+
u?.setValue(null), l?.focusFirst();
|
|
38
|
+
},
|
|
39
|
+
size: i,
|
|
40
|
+
isDisabled: n,
|
|
41
|
+
"aria-label": s.format("clear"),
|
|
42
|
+
className: p(E.iconButton, { [E.medium]: i === "medium" })
|
|
43
|
+
}) : null;
|
|
44
|
+
}, k = ({ children: n, isDisabled: r, isInvalid: i, isReadOnly: a, size: o = "large", isClearable: s = !1 }) => {
|
|
45
|
+
let c = e(T);
|
|
46
|
+
return /* @__PURE__ */ b(v, {
|
|
47
|
+
className: p(E.inputField, {
|
|
48
|
+
[E.medium]: o === "medium",
|
|
49
|
+
[E.readOnly]: a
|
|
50
|
+
}),
|
|
51
|
+
children: /* @__PURE__ */ x(C, { children: [n, /* @__PURE__ */ x("div", {
|
|
52
|
+
className: E.buttonGroup,
|
|
53
|
+
children: [/* @__PURE__ */ b(O, {
|
|
54
|
+
isClearable: s,
|
|
55
|
+
isDisabled: r,
|
|
56
|
+
isReadOnly: a,
|
|
57
|
+
size: o
|
|
58
|
+
}), /* @__PURE__ */ b(t, {
|
|
59
|
+
variant: "icon",
|
|
60
|
+
"aria-label": c.format("open-calendar"),
|
|
61
|
+
className: p(E.iconButton, {
|
|
62
|
+
[E.medium]: o === "medium",
|
|
63
|
+
[E.readOnly]: a
|
|
64
|
+
}),
|
|
65
|
+
"data-invalid": i || void 0,
|
|
66
|
+
size: o,
|
|
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 = f.forwardRef(({ className: e, description: t, errorMessage: r, errorPosition: c = "top", label: d, popover: f, isClearable: h = !1, isReadOnly: g, isDisabled: _, size: v, ...y }, S) => /* @__PURE__ */ x(m, {
|
|
78
|
+
className: p(E.datePicker, e),
|
|
79
|
+
isReadOnly: g,
|
|
80
|
+
isDisabled: _,
|
|
81
|
+
ref: S,
|
|
82
|
+
...y,
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ b(i, {
|
|
85
|
+
popover: f,
|
|
86
|
+
children: d && /* @__PURE__ */ b(a, { children: d })
|
|
87
|
+
}),
|
|
88
|
+
t && /* @__PURE__ */ b(o, {
|
|
89
|
+
slot: "description",
|
|
90
|
+
children: t
|
|
91
|
+
}),
|
|
92
|
+
c === "top" && /* @__PURE__ */ b(s, { children: r }),
|
|
93
|
+
/* @__PURE__ */ b(k, {
|
|
94
|
+
isClearable: h,
|
|
95
|
+
isReadOnly: g,
|
|
96
|
+
isDisabled: _,
|
|
97
|
+
size: v,
|
|
98
|
+
...y,
|
|
99
|
+
children: /* @__PURE__ */ b(l, { children: (e) => /* @__PURE__ */ b(u, { segment: e }) })
|
|
100
|
+
}),
|
|
101
|
+
c === "bottom" && /* @__PURE__ */ b(s, { children: r }),
|
|
102
|
+
/* @__PURE__ */ b(A, { children: /* @__PURE__ */ b(n, {}) })
|
|
103
|
+
]
|
|
104
|
+
})), M = ({ className: e, description: t, errorMessage: n, errorPosition: c = "top", label: f, popover: m, isClearable: h = !1, isReadOnly: _, isDisabled: v, size: y, ...S }) => /* @__PURE__ */ x(g, {
|
|
105
|
+
className: p(E.datePicker, e),
|
|
106
|
+
isReadOnly: _,
|
|
107
|
+
isDisabled: v,
|
|
108
|
+
...S,
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ b(i, {
|
|
111
|
+
popover: m,
|
|
112
|
+
children: f && /* @__PURE__ */ b(a, { children: f })
|
|
113
|
+
}),
|
|
114
|
+
t && /* @__PURE__ */ b(o, {
|
|
115
|
+
slot: "description",
|
|
116
|
+
children: t
|
|
117
|
+
}),
|
|
118
|
+
c === "top" && /* @__PURE__ */ b(s, { children: n }),
|
|
119
|
+
/* @__PURE__ */ x(k, {
|
|
120
|
+
isClearable: h,
|
|
121
|
+
isReadOnly: _,
|
|
122
|
+
isDisabled: v,
|
|
123
|
+
size: y,
|
|
124
|
+
...S,
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ b(l, {
|
|
127
|
+
slot: "start",
|
|
128
|
+
children: (e) => /* @__PURE__ */ b(u, { segment: e })
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ b(d, {}),
|
|
131
|
+
/* @__PURE__ */ b(l, {
|
|
132
|
+
slot: "end",
|
|
133
|
+
children: (e) => /* @__PURE__ */ b(u, { segment: e })
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
}),
|
|
137
|
+
c === "bottom" && /* @__PURE__ */ b(s, { children: n }),
|
|
138
|
+
/* @__PURE__ */ b(A, { children: /* @__PURE__ */ b(r, {}) })
|
|
139
|
+
]
|
|
140
|
+
});
|
|
141
|
+
//#endregion
|
|
142
|
+
export { j as n, M as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { t as e } from "./clsx-
|
|
2
|
+
import { t as e } from "./clsx-DAqHMl_k.js";
|
|
3
3
|
import { forwardRef as t } from "react";
|
|
4
4
|
import { DropZone as n, FieldErrorContext as r, composeRenderProps as i } from "react-aria-components";
|
|
5
5
|
import { jsx as a } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./clsx-
|
|
2
|
-
import { t } from "./text-
|
|
1
|
+
import { t as e } from "./clsx-DAqHMl_k.js";
|
|
2
|
+
import { t } from "./text-DnvD4Cjc.js";
|
|
3
3
|
import { forwardRef as n, useContext as r } from "react";
|
|
4
4
|
import { FieldError as i, FieldErrorContext as a } from "react-aria-components";
|
|
5
5
|
import { jsx as o } from "react/jsx-runtime";
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./clsx-DAqHMl_k.js";
|
|
3
|
+
import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
4
|
+
import { n } from "./button-dpe6hXmI.js";
|
|
5
|
+
import { t as r } from "./FeedbackStatusIcon-DvMDGBGL.js";
|
|
6
|
+
import { t as i } from "./field-error-BHoPnRe4.js";
|
|
7
|
+
import { t as a } from "./progress-bar-S6GNHQRZ.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
|
-
import { t as e } from "./clsx-
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import {
|
|
4
|
-
import { t as r } from "./
|
|
5
|
-
import { n as i } from "./button-CenXTGXL.js";
|
|
1
|
+
import { t as e } from "./clsx-DAqHMl_k.js";
|
|
2
|
+
import { t } from "./useLocalizedStringFormatter-CeyBc0x0.js";
|
|
3
|
+
import { n } from "./button-dpe6hXmI.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
|
]
|