@midas-ds/components 15.4.0 → 15.5.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 +16 -0
- package/accordion/AccordionItem.d.ts +5 -0
- package/accordion/index.js +1 -1
- package/badge/index.js +1 -1
- package/breadcrumbs/index.js +1 -1
- package/button/index.js +2 -2
- package/calendar/index.js +1 -1
- package/card/index.js +1 -1
- package/character-counter/index.js +1 -1
- package/checkbox/index.js +2 -2
- package/chunks/AccordionItem-BDkCTxFM.js +132 -0
- package/chunks/{BadgeContainer-BJAC-kV0.js → BadgeContainer-CKVsfTlF.js} +1 -1
- package/chunks/Breadcrumbs-By2bMbQd.js +28 -0
- package/chunks/Button-DbQwg49l.js +46 -0
- package/chunks/{ButtonGroup-B6mr4JGY.js → ButtonGroup-Dr6HOBo2.js} +1 -1
- package/chunks/Card-ia98VoKL.js +130 -0
- package/chunks/CharacterCounter-DeuE2det.js +21 -0
- package/chunks/Checkbox-ClhO-AzB.js +122 -0
- package/chunks/CheckboxGroup-CIFMaanI.js +84 -0
- package/chunks/{ColorSchemeSwitch-Cd6VSXql.js → ColorSchemeSwitch-DugvPh6T.js} +17 -17
- package/chunks/ComboBox-D86agoIk.js +108 -0
- package/chunks/DateField-CdJdPIuj.js +46 -0
- package/chunks/DateInputDivider-CkTB5q5k.js +36 -0
- package/chunks/DateRangePicker-p0l1tSMb.js +117 -0
- package/chunks/Dialog-BndmKdiv.js +66 -0
- package/chunks/Dropdown-CWP2clB2.js +79 -0
- package/chunks/FeedbackStatusIcon-COWuMusk.js +56 -0
- package/chunks/FieldError-C0HRIcAx.js +23 -0
- package/chunks/FileUpload-h1PxqQmb.js +16 -0
- package/chunks/{Grid-DeB7TdcZ.js → Grid-B-WgMwON.js} +2 -2
- package/chunks/{GridItem-B_3FFhPs.js → GridItem-5t1Z14sM.js} +1 -1
- package/chunks/Heading-D8tNNJkt.js +38 -0
- package/chunks/InfoBanner-tXWNVxpu.js +72 -0
- package/chunks/Label-B7taTXkd.js +73 -0
- package/chunks/{Layout-InD0Hl7F.js → Layout-DPRkHK4y.js} +70 -70
- package/chunks/Link-yTNUNv3C.js +54 -0
- package/chunks/LinkButton-3nAekUJ4.js +63 -0
- package/chunks/{ListBox-CKDglhFH.js → ListBox-D4tO_OrO.js} +18 -18
- package/chunks/ListBoxLoadMoreItem-BKptRAtt.js +41 -0
- package/chunks/ListBoxSection-DKHba2X0.js +49 -0
- package/chunks/{Logo-D80UDT1x.js → Logo-InDSslpO.js} +2 -2
- package/chunks/Popover-BAdqdN6C.js +38 -0
- package/chunks/ProgressBar-B2W7BTjA.js +53 -0
- package/chunks/Radio-BzuxVV_g.js +43 -0
- package/chunks/RangeCalendar-CuXHsT-k.js +99 -0
- package/chunks/{SearchField-Dr3DAs9W.js → SearchField-CLrAjcdA.js} +39 -39
- package/chunks/{Select-fDRXxmLm.js → Select-C-0lWpoz.js} +48 -46
- package/chunks/Select-CzfIyTE7.js +576 -0
- package/chunks/Separator-BcnQEA9f.js +76 -0
- package/chunks/{Skeleton-Bcg_xgAx.js → Skeleton-DqIHQLQl.js} +1 -1
- package/chunks/Spinner-CL9evrHm.js +49 -0
- package/chunks/TabList-D2XV5ixe.js +81 -0
- package/chunks/Table-B1rlSIhS.js +139 -0
- package/chunks/Tag-CEfQksg8.js +53 -0
- package/chunks/{Text-WP6RbnnK.js → Text-TWzJxnto.js} +9 -9
- package/chunks/TextArea-34YgkUEE.js +124 -0
- package/chunks/{Toast-CP_V12b3.js → Toast-CCA9sCnB.js} +46 -45
- package/chunks/ToggleButtonGroup-CXKTrLbb.js +29 -0
- package/chunks/Tooltip-CtstfI8u.js +46 -0
- package/chunks/clsx-AexbMWKp.js +24 -0
- package/chunks/useLocalizedStringFormatter-ZgRJmvHC.js +25 -0
- package/color-scheme-switch/index.js +1 -1
- package/combobox/index.js +1 -1
- package/common/FeedbackStatusIcon.d.ts +6 -0
- package/common/intl/translations.json.d.ts +17 -0
- package/date-field/index.js +2 -2
- package/date-picker/index.js +1 -1
- package/dropdown/index.js +1 -1
- package/field-error/index.js +1 -1
- package/file-upload/index.js +1 -1
- package/grid/index.js +2 -2
- package/heading/index.js +1 -1
- package/index.js +68 -68
- package/info-banner/index.js +1 -1
- package/label/index.js +1 -1
- package/layout/index.js +1 -1
- package/legacy-select/index.js +1 -1
- package/link/index.js +3 -3
- package/link-button/index.js +3 -3
- package/list-box/index.js +3 -3
- package/logo/index.js +1 -1
- package/menu/index.js +5 -5
- package/modal/index.js +2 -2
- package/package.json +2 -3
- 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/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/toast/Toast.d.ts +1 -1
- package/toast/index.js +1 -1
- package/toggle-button/index.js +1 -1
- package/tooltip/index.js +1 -1
- package/chunks/AccordionItem-BCoomT4-.js +0 -132
- package/chunks/Breadcrumbs-CnuqEeOL.js +0 -28
- package/chunks/Button-CHs1wv7n.js +0 -46
- package/chunks/Card-D58EJCcV.js +0 -130
- package/chunks/CharacterCounter-CzCvDmNP.js +0 -21
- package/chunks/Checkbox-CogzFDe3.js +0 -119
- package/chunks/CheckboxGroup-BLx25gqn.js +0 -83
- package/chunks/ComboBox-8YAwADqL.js +0 -108
- package/chunks/DateField-CpbYROK1.js +0 -46
- package/chunks/DateInputDivider-C43xP4is.js +0 -36
- package/chunks/DateRangePicker-CICkmtXG.js +0 -116
- package/chunks/Dialog-DBn9L3SP.js +0 -66
- package/chunks/Dropdown-Cctv2Qpv.js +0 -79
- package/chunks/FieldError-CZKAYQ-n.js +0 -23
- package/chunks/FileUpload-DILt4rAn.js +0 -16
- package/chunks/Heading-DIw3iLMN.js +0 -38
- package/chunks/InfoBanner-Bw3rjGtB.js +0 -72
- package/chunks/Label-CKe9pgXT.js +0 -73
- package/chunks/Link-C3w5O2wT.js +0 -54
- package/chunks/LinkButton-D6X0Dvoz.js +0 -63
- package/chunks/ListBoxLoadMoreItem-y9pCuqRe.js +0 -41
- package/chunks/ListBoxSection-CvtRigQb.js +0 -49
- package/chunks/Popover-DktRiuCr.js +0 -38
- package/chunks/ProgressBar-Bjxi5TgY.js +0 -53
- package/chunks/Radio-DqFFcFra.js +0 -43
- package/chunks/RangeCalendar-CIxwICEf.js +0 -99
- package/chunks/Select-BSqv5Qi-.js +0 -566
- package/chunks/Separator-Cw1vlSYO.js +0 -76
- package/chunks/Spinner-B2EAm49Z.js +0 -48
- package/chunks/TabList-BIBQcX2n.js +0 -81
- package/chunks/Table-Cy-R3Ma8.js +0 -139
- package/chunks/Tag-BZnq1_yZ.js +0 -53
- package/chunks/TextArea-3fPkKmNx.js +0 -124
- package/chunks/ToggleButtonGroup-CgNeypuW.js +0 -29
- package/chunks/Tooltip-C53p0sfk.js +0 -46
- package/chunks/clsx-CuNqTHjr.js +0 -11
- package/chunks/icon-map-Ckc-nEUA.js +0 -31
- package/chunks/internationalized-C9snpc7V.js +0 -1955
- package/chunks/react-aria-components-mIKW9wOa.js +0 -22645
- package/chunks/react-stately-DRNKkAB0.js +0 -2586
- package/chunks/useLocalizedStringFormatter-CPwiI7nv.js +0 -25
- package/chunks/variables-BkqZ2WGF.js +0 -5
- package/common/icon-map.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 15.5.0 (2025-12-11)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **components, accordion:** add an aria-label to the status icon ([e2f126366e](https://github.com/migrationsverket/midas/commit/e2f126366e))
|
|
6
|
+
|
|
7
|
+
### 🏭 Refactoring
|
|
8
|
+
|
|
9
|
+
- **components:** create a common component for status icons ([be6b2480f7](https://github.com/migrationsverket/midas/commit/be6b2480f7))
|
|
10
|
+
|
|
11
|
+
## 15.4.1 (2025-12-10)
|
|
12
|
+
|
|
13
|
+
### 🩹 Fixes
|
|
14
|
+
|
|
15
|
+
- **components:** externalize dependecies ([5e95894058](https://github.com/migrationsverket/midas/commit/5e95894058))
|
|
16
|
+
|
|
1
17
|
## 15.4.0 (2025-12-08)
|
|
2
18
|
|
|
3
19
|
### 🚀 Features
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DisclosureProps } from 'react-aria-components';
|
|
2
2
|
import { HeadingProps } from '../heading';
|
|
3
3
|
import { FeedbackStatus, Size } from '../common/types';
|
|
4
|
+
import { FeedbackStatusIconProps } from '../common/FeedbackStatusIcon';
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
interface MidasAccordionItem extends Omit<DisclosureProps, 'children'> {
|
|
6
7
|
/** The text displayed in the collapsed state. If a ReactNode is provided, a heading will not be automatically added, and you must provide one yourself. */
|
|
@@ -20,6 +21,10 @@ interface MidasAccordionItem extends Omit<DisclosureProps, 'children'> {
|
|
|
20
21
|
* @default 'large'
|
|
21
22
|
**/
|
|
22
23
|
size?: Size;
|
|
24
|
+
/**
|
|
25
|
+
* Change the aria-label of the status icon shown when defining the `type`
|
|
26
|
+
*/
|
|
27
|
+
iconAriaLabel?: FeedbackStatusIconProps['aria-label'];
|
|
23
28
|
}
|
|
24
29
|
export declare const AccordionItem: React.FC<MidasAccordionItem>;
|
|
25
30
|
export {};
|
package/accordion/index.js
CHANGED
package/badge/index.js
CHANGED
package/breadcrumbs/index.js
CHANGED
package/button/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as r } from "../chunks/Button-
|
|
2
|
-
import { B as p } from "../chunks/ButtonGroup-
|
|
1
|
+
import { B as r } from "../chunks/Button-DbQwg49l.js";
|
|
2
|
+
import { B as p } from "../chunks/ButtonGroup-Dr6HOBo2.js";
|
|
3
3
|
export {
|
|
4
4
|
r as Button,
|
|
5
5
|
p as ButtonGroup
|
package/calendar/index.js
CHANGED
package/card/index.js
CHANGED
package/checkbox/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as e } from "../chunks/Checkbox-
|
|
2
|
-
import { C } from "../chunks/CheckboxGroup-
|
|
1
|
+
import { C as e } from "../chunks/Checkbox-ClhO-AzB.js";
|
|
2
|
+
import { C } from "../chunks/CheckboxGroup-CIFMaanI.js";
|
|
3
3
|
export {
|
|
4
4
|
e as Checkbox,
|
|
5
5
|
C as CheckboxGroup
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { c as d } from "./clsx-AexbMWKp.js";
|
|
3
|
+
import { DisclosureGroup as v, Disclosure as x, DisclosurePanel as I } from "react-aria-components";
|
|
4
|
+
import { createContext as N, useContext as B, useEffect as b } from "react";
|
|
5
|
+
import { B as k } from "./Button-DbQwg49l.js";
|
|
6
|
+
import { H as w } from "./Heading-D8tNNJkt.js";
|
|
7
|
+
import { F as A } from "./FeedbackStatusIcon-COWuMusk.js";
|
|
8
|
+
import { C as T } from "./chevron-down-DgT-uSF9.js";
|
|
9
|
+
import '../assets/AccordionItem.css';const D = "_root_17bdp_1", M = "_contained_17bdp_5", _ = {
|
|
10
|
+
root: D,
|
|
11
|
+
contained: M
|
|
12
|
+
}, u = N(void 0), ne = ({
|
|
13
|
+
variant: o,
|
|
14
|
+
children: c,
|
|
15
|
+
className: r,
|
|
16
|
+
isContained: i,
|
|
17
|
+
size: n = "large",
|
|
18
|
+
...a
|
|
19
|
+
}) => {
|
|
20
|
+
const s = i || o === "contained";
|
|
21
|
+
return /* @__PURE__ */ t(u.Provider, { value: { isContained: s, size: n }, children: /* @__PURE__ */ t(
|
|
22
|
+
v,
|
|
23
|
+
{
|
|
24
|
+
className: d(
|
|
25
|
+
_.root,
|
|
26
|
+
s ? _.contained : _.uncontained,
|
|
27
|
+
r
|
|
28
|
+
),
|
|
29
|
+
...a,
|
|
30
|
+
children: c
|
|
31
|
+
}
|
|
32
|
+
) });
|
|
33
|
+
}, j = "_item_1em4f_1", z = "_contained_1em4f_18", F = "_medium_1em4f_28", H = "_success_1em4f_33", P = "_warning_1em4f_39", S = "_info_1em4f_45", y = "_important_1em4f_51", E = "_triggerButton_1em4f_62", G = "_triggerText_1em4f_66", R = "_trigger_1em4f_62", W = "_triggerMainContent_1em4f_77", $ = "_chevronIcon_1em4f_94", q = "_statusIcon_1em4f_100", J = "_panel_1em4f_122", K = "_content_1em4f_130", L = "_hasBackground_1em4f_135", O = "_header_1em4f_139", e = {
|
|
34
|
+
item: j,
|
|
35
|
+
contained: z,
|
|
36
|
+
medium: F,
|
|
37
|
+
success: H,
|
|
38
|
+
warning: P,
|
|
39
|
+
info: S,
|
|
40
|
+
important: y,
|
|
41
|
+
triggerButton: E,
|
|
42
|
+
triggerText: G,
|
|
43
|
+
trigger: R,
|
|
44
|
+
triggerMainContent: W,
|
|
45
|
+
" ": "_ _1em4f_1",
|
|
46
|
+
chevronIcon: $,
|
|
47
|
+
statusIcon: q,
|
|
48
|
+
panel: J,
|
|
49
|
+
content: K,
|
|
50
|
+
hasBackground: L,
|
|
51
|
+
header: O
|
|
52
|
+
}, oe = ({
|
|
53
|
+
title: o,
|
|
54
|
+
children: c,
|
|
55
|
+
className: r,
|
|
56
|
+
headingLevel: i = "h2",
|
|
57
|
+
type: n,
|
|
58
|
+
hasBackground: a = !0,
|
|
59
|
+
size: s = "large",
|
|
60
|
+
isContained: f,
|
|
61
|
+
iconAriaLabel: h,
|
|
62
|
+
...p
|
|
63
|
+
}) => {
|
|
64
|
+
const g = B(u), m = f ?? g?.isContained ?? !1, C = typeof o == "object";
|
|
65
|
+
return b(() => {
|
|
66
|
+
n && !m && console.warn(
|
|
67
|
+
"AccordionItem: When 'type' is set, it is recommended to also set 'isContained' to true for visual consistency."
|
|
68
|
+
);
|
|
69
|
+
}, [n, m]), /* @__PURE__ */ l(
|
|
70
|
+
x,
|
|
71
|
+
{
|
|
72
|
+
...p,
|
|
73
|
+
className: d(
|
|
74
|
+
e.item,
|
|
75
|
+
n && e[n],
|
|
76
|
+
(s === "medium" || g?.size === "medium") && e.medium,
|
|
77
|
+
m && e.contained,
|
|
78
|
+
r
|
|
79
|
+
),
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ t("div", { className: e.trigger, children: /* @__PURE__ */ l(
|
|
82
|
+
k,
|
|
83
|
+
{
|
|
84
|
+
className: e.triggerButton,
|
|
85
|
+
slot: "trigger",
|
|
86
|
+
variant: "icon",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ t(
|
|
89
|
+
T,
|
|
90
|
+
{
|
|
91
|
+
size: 20,
|
|
92
|
+
className: e.chevronIcon
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ t("div", { className: e.triggerMainContent, children: C ? o : /* @__PURE__ */ t(
|
|
96
|
+
w,
|
|
97
|
+
{
|
|
98
|
+
level: 3,
|
|
99
|
+
elementType: i,
|
|
100
|
+
className: e.triggerText,
|
|
101
|
+
children: o
|
|
102
|
+
}
|
|
103
|
+
) }),
|
|
104
|
+
n && /* @__PURE__ */ t(
|
|
105
|
+
A,
|
|
106
|
+
{
|
|
107
|
+
"aria-label": h,
|
|
108
|
+
className: e.statusIcon,
|
|
109
|
+
status: n
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
) }),
|
|
115
|
+
/* @__PURE__ */ t(I, { className: e.panel, children: /* @__PURE__ */ t(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
className: d(
|
|
119
|
+
e.content,
|
|
120
|
+
a && e.hasBackground
|
|
121
|
+
),
|
|
122
|
+
children: c
|
|
123
|
+
}
|
|
124
|
+
) })
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
export {
|
|
130
|
+
oe as A,
|
|
131
|
+
ne as a
|
|
132
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
|
-
import { c as t } from "./clsx-
|
|
3
|
+
import { c as t } from "./clsx-AexbMWKp.js";
|
|
4
4
|
import '../assets/BadgeContainer.css';const d = "_badge_6i93e_1", c = "_hasChildren_6i93e_10", C = "_badgeContainer_6i93e_19", s = {
|
|
5
5
|
badge: d,
|
|
6
6
|
hasChildren: c,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Breadcrumbs as t, Breadcrumb as i } from "react-aria-components";
|
|
3
|
+
import { c as d } from "./clsx-AexbMWKp.js";
|
|
4
|
+
import { L as p } from "./Link-yTNUNv3C.js";
|
|
5
|
+
import '../assets/Breadcrumbs.css';const l = "_container_1k7pu_1", u = {
|
|
6
|
+
container: l
|
|
7
|
+
}, h = ({
|
|
8
|
+
items: c,
|
|
9
|
+
className: a,
|
|
10
|
+
...s
|
|
11
|
+
}) => /* @__PURE__ */ r(
|
|
12
|
+
t,
|
|
13
|
+
{
|
|
14
|
+
className: d(u.container, a),
|
|
15
|
+
...s,
|
|
16
|
+
children: c.map(({ title: o, href: e, isDisabled: n }, m) => /* @__PURE__ */ r(i, { children: /* @__PURE__ */ r(
|
|
17
|
+
p,
|
|
18
|
+
{
|
|
19
|
+
href: e,
|
|
20
|
+
isDisabled: n,
|
|
21
|
+
children: o
|
|
22
|
+
}
|
|
23
|
+
) }, o.toLocaleLowerCase() + m))
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
export {
|
|
27
|
+
h as B
|
|
28
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as l } from "react/jsx-runtime";
|
|
2
|
+
import { B as r } from "./Button.module-Cm0H98vy.js";
|
|
3
|
+
import { Button as u } from "react-aria-components";
|
|
4
|
+
import { c as p } from "./clsx-AexbMWKp.js";
|
|
5
|
+
import { S as g } from "./Spinner-CL9evrHm.js";
|
|
6
|
+
const S = ({
|
|
7
|
+
variant: i = "primary",
|
|
8
|
+
fullwidth: o,
|
|
9
|
+
className: m,
|
|
10
|
+
iconPlacement: s,
|
|
11
|
+
size: d = "large",
|
|
12
|
+
icon: n,
|
|
13
|
+
iconSize: a,
|
|
14
|
+
...t
|
|
15
|
+
}) => /* @__PURE__ */ e(
|
|
16
|
+
u,
|
|
17
|
+
{
|
|
18
|
+
className: p(
|
|
19
|
+
r.button,
|
|
20
|
+
i === "primary" && r.primary,
|
|
21
|
+
i === "secondary" && r.secondary,
|
|
22
|
+
i === "tertiary" && r.tertiary,
|
|
23
|
+
i === "danger" && r.danger,
|
|
24
|
+
i === "icon" && r.iconBtn,
|
|
25
|
+
o && r.fullwidth,
|
|
26
|
+
d === "medium" && r.medium,
|
|
27
|
+
s === "right" && r.iconRight,
|
|
28
|
+
m
|
|
29
|
+
),
|
|
30
|
+
...t,
|
|
31
|
+
children: /* @__PURE__ */ c(l, { children: [
|
|
32
|
+
n && !t.isPending && /* @__PURE__ */ e(
|
|
33
|
+
n,
|
|
34
|
+
{
|
|
35
|
+
"aria-hidden": !0,
|
|
36
|
+
size: a ?? 20
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
t.isPending && /* @__PURE__ */ e(g, { small: !0 }),
|
|
40
|
+
t.children
|
|
41
|
+
] })
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
export {
|
|
45
|
+
S as B
|
|
46
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "./clsx-AexbMWKp.js";
|
|
3
|
+
import * as i from "react";
|
|
4
|
+
import { H as m } from "./Heading-D8tNNJkt.js";
|
|
5
|
+
import { Button as _, Link as C } from "react-aria-components";
|
|
6
|
+
import { A as x } from "./arrow-right-DNeP8Eqv.js";
|
|
7
|
+
import '../assets/Card.css';const A = "_card_1x9yi_1", h = "_horizontal_1x9yi_11", u = "_cardLink_1x9yi_16", I = "_cardContent_1x9yi_21", z = "_cardActions_1x9yi_40", k = "_cardActionArea_1x9yi_50", p = "_cardImage_1x9yi_83", y = "_cardLinkIcon_1x9yi_115", n = {
|
|
8
|
+
card: A,
|
|
9
|
+
horizontal: h,
|
|
10
|
+
cardLink: u,
|
|
11
|
+
cardContent: I,
|
|
12
|
+
cardActions: z,
|
|
13
|
+
cardActionArea: k,
|
|
14
|
+
cardImage: p,
|
|
15
|
+
cardLinkIcon: y
|
|
16
|
+
}, e = i.createContext({
|
|
17
|
+
horizontal: void 0,
|
|
18
|
+
titleId: void 0
|
|
19
|
+
}), j = ({
|
|
20
|
+
horizontal: a,
|
|
21
|
+
className: o,
|
|
22
|
+
children: t,
|
|
23
|
+
...s
|
|
24
|
+
}) => {
|
|
25
|
+
const d = `card-title-${i.useId()}`;
|
|
26
|
+
return /* @__PURE__ */ r(e.Provider, { value: { horizontal: a, titleId: d }, children: /* @__PURE__ */ r(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
...s,
|
|
30
|
+
className: c(
|
|
31
|
+
n.card,
|
|
32
|
+
a && n.horizontal,
|
|
33
|
+
o
|
|
34
|
+
),
|
|
35
|
+
children: t
|
|
36
|
+
}
|
|
37
|
+
) });
|
|
38
|
+
}, H = ({
|
|
39
|
+
children: a,
|
|
40
|
+
...o
|
|
41
|
+
}) => {
|
|
42
|
+
const { horizontal: t } = i.useContext(e);
|
|
43
|
+
return /* @__PURE__ */ r(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
...o,
|
|
47
|
+
className: c(n.cardContent, t && n.horizontal),
|
|
48
|
+
children: a
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}, R = ({
|
|
52
|
+
elementType: a = "h2",
|
|
53
|
+
children: o
|
|
54
|
+
}) => {
|
|
55
|
+
const { horizontal: t, titleId: s } = i.useContext(e);
|
|
56
|
+
return /* @__PURE__ */ r(
|
|
57
|
+
m,
|
|
58
|
+
{
|
|
59
|
+
level: t ? 5 : 3,
|
|
60
|
+
elementType: a,
|
|
61
|
+
isExpressive: t,
|
|
62
|
+
className: c(n.cardTitle, t && n.horizontal),
|
|
63
|
+
id: s,
|
|
64
|
+
children: o
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}, T = ({
|
|
68
|
+
children: a,
|
|
69
|
+
...o
|
|
70
|
+
}) => {
|
|
71
|
+
const { horizontal: t } = i.useContext(e);
|
|
72
|
+
return /* @__PURE__ */ r(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
...o,
|
|
76
|
+
className: c(n.cardActions, t && n.horizontal),
|
|
77
|
+
children: a
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}, w = ({ children: a, className: o, ...t }) => {
|
|
81
|
+
const { titleId: s } = i.useContext(e);
|
|
82
|
+
return /* @__PURE__ */ r(
|
|
83
|
+
_,
|
|
84
|
+
{
|
|
85
|
+
...t,
|
|
86
|
+
"aria-labelledby": s,
|
|
87
|
+
className: c(n.cardActionArea, o),
|
|
88
|
+
children: a
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}, B = ({
|
|
92
|
+
as: a = "img",
|
|
93
|
+
className: o,
|
|
94
|
+
...t
|
|
95
|
+
}) => /* @__PURE__ */ r(
|
|
96
|
+
a,
|
|
97
|
+
{
|
|
98
|
+
...t,
|
|
99
|
+
className: c(n.cardImage, o)
|
|
100
|
+
}
|
|
101
|
+
), E = ({
|
|
102
|
+
children: a,
|
|
103
|
+
as: o,
|
|
104
|
+
...t
|
|
105
|
+
}) => /* @__PURE__ */ l(
|
|
106
|
+
o || C,
|
|
107
|
+
{
|
|
108
|
+
...t,
|
|
109
|
+
className: c(n.cardLink, t.className),
|
|
110
|
+
children: [
|
|
111
|
+
a,
|
|
112
|
+
/* @__PURE__ */ r(
|
|
113
|
+
x,
|
|
114
|
+
{
|
|
115
|
+
className: n.cardLinkIcon,
|
|
116
|
+
size: 24
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
export {
|
|
123
|
+
j as C,
|
|
124
|
+
H as a,
|
|
125
|
+
R as b,
|
|
126
|
+
T as c,
|
|
127
|
+
w as d,
|
|
128
|
+
B as e,
|
|
129
|
+
E as f
|
|
130
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { useContextProps as d, InputContext as h } from "react-aria-components";
|
|
4
|
+
import '../assets/CharacterCounter.css';const m = "_characterCounter_1f0mh_1", u = {
|
|
5
|
+
characterCounter: m
|
|
6
|
+
}, f = i.forwardRef((t, a) => {
|
|
7
|
+
[t] = d(t, a, h);
|
|
8
|
+
const { maxLength: e, value: n, isLonely: c } = t, { length: r } = n?.toString() ?? "", o = e !== void 0;
|
|
9
|
+
return /* @__PURE__ */ s(
|
|
10
|
+
"span",
|
|
11
|
+
{
|
|
12
|
+
className: u.characterCounter,
|
|
13
|
+
"data-exceeded": o && r > e || void 0,
|
|
14
|
+
"data-lonely": c || void 0,
|
|
15
|
+
children: o ? `${r} / ${e}` : r
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
f as C
|
|
21
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { jsxs as v, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import f from "react";
|
|
4
|
+
import { mergeProps as u, VisuallyHidden as k, useCheckboxGroupItem as C, useCheckbox as R, useHover as _, usePress as I, useFocusRing as P } from "react-aria";
|
|
5
|
+
import { useContextProps as g, CheckboxContext as G, useSlottedContext as y, FormContext as w } from "react-aria-components";
|
|
6
|
+
import { a as h } from "./clsx-AexbMWKp.js";
|
|
7
|
+
import { variables as m } from "@midas-ds/theme";
|
|
8
|
+
import { c as B } from "./createLucideIcon-D4r5Phnh.js";
|
|
9
|
+
import { C as F } from "./check-BxlvVsvD.js";
|
|
10
|
+
import { useToggleState as L } from "@react-stately/toggle";
|
|
11
|
+
import '../assets/Checkbox.css';const N = [["path", { d: "M5 12h14", key: "1ays0h" }]], S = B("minus", N), D = f.createContext(null), H = "_checkboxInner_19c98_1", O = "_checkbox_19c98_1", j = "_checkboxGroup_19c98_143", q = "_checkboxList_19c98_154", x = {
|
|
12
|
+
checkboxInner: H,
|
|
13
|
+
checkbox: O,
|
|
14
|
+
checkboxGroup: j,
|
|
15
|
+
checkboxList: q
|
|
16
|
+
}, b = i.forwardRef((e, o) => {
|
|
17
|
+
const { hoverProps: c, isHovered: s } = e.hoverResult, { pressProps: n, isPressed: a } = e.pressResult, { isFocused: r, isFocusVisible: d, focusProps: l } = e.focusRingAria;
|
|
18
|
+
return /* @__PURE__ */ v(
|
|
19
|
+
"label",
|
|
20
|
+
{
|
|
21
|
+
ref: o,
|
|
22
|
+
...u(c, n, e.labelProps),
|
|
23
|
+
slot: e.slot || void 0,
|
|
24
|
+
className: h(x.checkbox, e.className),
|
|
25
|
+
"data-hovered": s || void 0,
|
|
26
|
+
"data-selected": e.isSelected || void 0,
|
|
27
|
+
"data-indeterminate": e.isIndeterminate || void 0,
|
|
28
|
+
"data-pressed": a || void 0,
|
|
29
|
+
"data-disabled": e.isDisabled || void 0,
|
|
30
|
+
"data-readonly": e.isReadOnly || void 0,
|
|
31
|
+
"data-invalid": e.isInvalid || void 0,
|
|
32
|
+
"data-focused": r || void 0,
|
|
33
|
+
"data-focus-visible": d || void 0,
|
|
34
|
+
"data-required": e.isRequired || void 0,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ t("div", { className: h(x.checkboxInner), children: e.isIndeterminate ? /* @__PURE__ */ t(
|
|
37
|
+
S,
|
|
38
|
+
{
|
|
39
|
+
size: 14,
|
|
40
|
+
color: m.iconOnColor
|
|
41
|
+
}
|
|
42
|
+
) : /* @__PURE__ */ t(
|
|
43
|
+
F,
|
|
44
|
+
{
|
|
45
|
+
size: 14,
|
|
46
|
+
color: m.iconOnColor
|
|
47
|
+
}
|
|
48
|
+
) }),
|
|
49
|
+
/* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(
|
|
50
|
+
"input",
|
|
51
|
+
{
|
|
52
|
+
...u(e.inputProps, l),
|
|
53
|
+
ref: e.inputRef
|
|
54
|
+
}
|
|
55
|
+
) }),
|
|
56
|
+
e.children
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}), z = i.forwardRef((e, o) => {
|
|
61
|
+
const c = C(
|
|
62
|
+
{
|
|
63
|
+
...e,
|
|
64
|
+
value: e.value || ""
|
|
65
|
+
},
|
|
66
|
+
e.state,
|
|
67
|
+
e.inputRef
|
|
68
|
+
);
|
|
69
|
+
return /* @__PURE__ */ t(
|
|
70
|
+
b,
|
|
71
|
+
{
|
|
72
|
+
...e,
|
|
73
|
+
...c,
|
|
74
|
+
ref: o
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}), A = i.forwardRef((e, o) => {
|
|
78
|
+
const c = R(e, L(e), e.inputRef);
|
|
79
|
+
return /* @__PURE__ */ t(
|
|
80
|
+
b,
|
|
81
|
+
{
|
|
82
|
+
...e,
|
|
83
|
+
...c,
|
|
84
|
+
ref: o
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}), X = i.forwardRef(
|
|
88
|
+
(e, o) => {
|
|
89
|
+
[e, o] = g(e, o, G);
|
|
90
|
+
const c = y(w), s = e.validationBehavior ?? c?.validationBehavior ?? "native", n = i.useContext(D), a = i.useRef(null), r = _(e), d = I({
|
|
91
|
+
ref: o,
|
|
92
|
+
isDisabled: e.isDisabled
|
|
93
|
+
}), l = P();
|
|
94
|
+
return n ? /* @__PURE__ */ t(
|
|
95
|
+
z,
|
|
96
|
+
{
|
|
97
|
+
...e,
|
|
98
|
+
state: n,
|
|
99
|
+
inputRef: a,
|
|
100
|
+
hoverResult: r,
|
|
101
|
+
pressResult: d,
|
|
102
|
+
focusRingAria: l,
|
|
103
|
+
validationBehavior: s
|
|
104
|
+
}
|
|
105
|
+
) : /* @__PURE__ */ t(
|
|
106
|
+
A,
|
|
107
|
+
{
|
|
108
|
+
...e,
|
|
109
|
+
inputRef: a,
|
|
110
|
+
hoverResult: r,
|
|
111
|
+
pressResult: d,
|
|
112
|
+
focusRingAria: l,
|
|
113
|
+
validationBehavior: s
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
export {
|
|
119
|
+
X as C,
|
|
120
|
+
D as a,
|
|
121
|
+
x as s
|
|
122
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as o, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { useCheckboxGroup as C } from "react-aria";
|
|
3
|
+
import { useCheckboxGroupState as v } from "react-stately";
|
|
4
|
+
import { a as k, L as S } from "./Label-B7taTXkd.js";
|
|
5
|
+
import { T as y } from "./Text-TWzJxnto.js";
|
|
6
|
+
import * as r from "react";
|
|
7
|
+
import { C as d, s as u, a as g } from "./Checkbox-ClhO-AzB.js";
|
|
8
|
+
import { FieldErrorContext as A } from "react-aria-components";
|
|
9
|
+
import { F as P } from "./FieldError-C0HRIcAx.js";
|
|
10
|
+
import { u as V } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
|
|
11
|
+
const F = (e, { value: t }) => {
|
|
12
|
+
const a = r.Children.toArray(e).filter(
|
|
13
|
+
(l) => r.isValidElement(l) && l.type === d
|
|
14
|
+
), c = r.Children.count(a), n = r.Children.toArray(e).filter((l) => r.isValidElement(l)).filter((l) => !!l && l.type === d).map((l) => l.props.value), s = t.length === 0, i = t.length === c;
|
|
15
|
+
return {
|
|
16
|
+
allSelected: i,
|
|
17
|
+
someSelected: !s && !i,
|
|
18
|
+
checkboxValues: n
|
|
19
|
+
};
|
|
20
|
+
}, b = ({ state: e, errorMessage: t }) => /* @__PURE__ */ o(A.Provider, { value: e.displayValidation, children: /* @__PURE__ */ o(P, { children: t }) }), G = { selectAll: "Select all" }, L = { selectAll: "Välj alla" }, E = {
|
|
21
|
+
en: G,
|
|
22
|
+
sv: L
|
|
23
|
+
};
|
|
24
|
+
function W(e) {
|
|
25
|
+
const t = v(e), a = V(E), { groupProps: c, labelProps: n, descriptionProps: s } = C(
|
|
26
|
+
e,
|
|
27
|
+
t
|
|
28
|
+
), { allSelected: i, someSelected: m, checkboxValues: l } = F(
|
|
29
|
+
e.children,
|
|
30
|
+
t
|
|
31
|
+
), x = (f) => {
|
|
32
|
+
t.setValue(f ? l : []);
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ h(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
...c,
|
|
38
|
+
className: u.checkboxGroup,
|
|
39
|
+
"data-readonly": e.isReadOnly || void 0,
|
|
40
|
+
"data-disabled": e.isDisabled || void 0,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ o(k, { popover: e.popover, children: e.label && /* @__PURE__ */ o(S, { ...n, children: e.label }) }),
|
|
43
|
+
e.description && /* @__PURE__ */ o(
|
|
44
|
+
y,
|
|
45
|
+
{
|
|
46
|
+
slot: "description",
|
|
47
|
+
...s,
|
|
48
|
+
children: e.description
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
e.errorPosition === "top" && /* @__PURE__ */ o(
|
|
52
|
+
b,
|
|
53
|
+
{
|
|
54
|
+
...e,
|
|
55
|
+
state: t
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ h("div", { className: u.checkboxList, children: [
|
|
59
|
+
e.showSelectAll && /* @__PURE__ */ o(
|
|
60
|
+
d,
|
|
61
|
+
{
|
|
62
|
+
isSelected: i,
|
|
63
|
+
isIndeterminate: m,
|
|
64
|
+
isReadOnly: e.isReadOnly,
|
|
65
|
+
onChange: x,
|
|
66
|
+
children: e.selectAllLabel || a.format("selectAll")
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ o(g.Provider, { value: t, children: e.children })
|
|
70
|
+
] }),
|
|
71
|
+
e.errorPosition === "bottom" && /* @__PURE__ */ o(
|
|
72
|
+
b,
|
|
73
|
+
{
|
|
74
|
+
...e,
|
|
75
|
+
state: t
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
W as C
|
|
84
|
+
};
|