@midas-ds/components 16.0.0 → 16.2.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 +12 -0
- package/accordion/index.js +1 -1
- package/assets/AccordionItem.css +1 -1
- package/assets/Checkbox.css +1 -1
- package/assets/ComboBox.css +1 -1
- package/assets/Dialog.css +1 -1
- package/assets/Layout.css +1 -1
- package/assets/ListBox.css +1 -1
- package/assets/Popover.css +1 -1
- package/assets/ProgressBar.css +1 -1
- package/assets/Radio.css +1 -1
- package/assets/Select.css +1 -1
- package/assets/Select2.css +1 -1
- package/assets/Table.css +1 -1
- package/assets/Toast.css +1 -1
- package/assets/Tooltip.css +1 -1
- package/assets/default.css +1 -1
- package/checkbox/index.js +2 -2
- package/chunks/AccordionItem-BUUDZ7l6.js +128 -0
- package/chunks/{Checkbox-ClhO-AzB.js → Checkbox-CP6Nv9yx.js} +25 -25
- package/chunks/{CheckboxGroup-dofHjXkU.js → CheckboxGroup-C5kaqBcn.js} +2 -2
- package/chunks/ComboBox-N97lv5kN.js +108 -0
- package/chunks/{DateField-ltU-Jvra.js → DateField-DeuLPe1Y.js} +1 -1
- package/chunks/{DateRangePicker-CdoVIV-F.js → DateRangePicker-BqjLArNi.js} +1 -1
- package/chunks/Dialog-DC0cGNj5.js +66 -0
- package/chunks/{Label-DqmNWnmm.js → Label-Dup4lWaR.js} +1 -1
- package/chunks/{Layout-DtwVUZus.js → Layout-BFZSROTl.js} +95 -95
- package/chunks/{ListBox-D4tO_OrO.js → ListBox-D5BBeZWL.js} +12 -12
- package/chunks/{ListBoxLoadMoreItem-D9X8YnwD.js → ListBoxLoadMoreItem-CB67meAb.js} +1 -1
- package/chunks/{ListBoxSection-DKHba2X0.js → ListBoxSection-MZB_5DdD.js} +1 -1
- package/chunks/{Popover-D9tAN-g7.js → Popover-BcEtFiU1.js} +8 -8
- package/chunks/ProgressBar-CbwvcHvk.js +53 -0
- package/chunks/Radio-Dro99zCs.js +43 -0
- package/chunks/{Select-Bcu1yvbR.js → Select-D-LtFSZX.js} +42 -42
- package/chunks/{Select-DAlreRs2.js → Select-nL9iJMlf.js} +117 -117
- package/chunks/{Table-B1rlSIhS.js → Table-CgBjwlIi.js} +47 -47
- package/chunks/{TextArea-CEiOylOx.js → TextArea-CRvbqqVZ.js} +1 -1
- package/chunks/{Toast-DgQ6BTmK.js → Toast-DTwUGSJ8.js} +39 -39
- package/chunks/{Tooltip-uNMG_UU-.js → Tooltip-m032jGgF.js} +5 -5
- package/combobox/index.js +1 -1
- package/date-field/index.js +1 -1
- package/date-picker/index.js +1 -1
- package/index.js +21 -21
- package/label/index.js +1 -1
- package/layout/index.js +1 -1
- package/legacy-select/index.js +1 -1
- package/list-box/index.js +3 -3
- package/modal/index.js +1 -1
- package/package.json +2 -2
- package/popover/index.js +1 -1
- package/progress-bar/index.js +1 -1
- package/radio/index.js +1 -1
- package/select/index.js +1 -1
- package/table/index.js +1 -1
- package/textfield/index.js +1 -1
- package/toast/index.js +1 -1
- package/tooltip/index.js +1 -1
- package/chunks/AccordionItem-O3_wicV2.js +0 -128
- package/chunks/ComboBox-XQqP_jga.js +0 -108
- package/chunks/Dialog-x-HLOQFU.js +0 -66
- package/chunks/ProgressBar-DXBCKRe_.js +0 -53
- package/chunks/Radio-C1AFopLt.js +0 -43
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsxs as v, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as c from "react";
|
|
3
3
|
import f from "react";
|
|
4
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
|
|
5
|
+
import { useContextProps as g, CheckboxContext as G, useSlottedContext as y, FormContext as z } from "react-aria-components";
|
|
6
6
|
import { a as h } from "./clsx-AexbMWKp.js";
|
|
7
7
|
import { variables as m } from "@midas-ds/theme";
|
|
8
|
-
import { c as
|
|
9
|
-
import { C as
|
|
10
|
-
import { useToggleState as
|
|
11
|
-
import '../assets/Checkbox.css';const
|
|
12
|
-
checkboxInner:
|
|
13
|
-
checkbox:
|
|
14
|
-
checkboxGroup:
|
|
15
|
-
checkboxList:
|
|
16
|
-
}, b =
|
|
17
|
-
const { hoverProps:
|
|
8
|
+
import { c as w } from "./createLucideIcon-D4r5Phnh.js";
|
|
9
|
+
import { C as B } from "./check-BxlvVsvD.js";
|
|
10
|
+
import { useToggleState as F } from "@react-stately/toggle";
|
|
11
|
+
import '../assets/Checkbox.css';const L = [["path", { d: "M5 12h14", key: "1ays0h" }]], N = w("minus", L), S = f.createContext(null), D = "_checkboxInner_tzrii_1", H = "_checkbox_tzrii_1", O = "_checkboxGroup_tzrii_143", j = "_checkboxList_tzrii_154", x = {
|
|
12
|
+
checkboxInner: D,
|
|
13
|
+
checkbox: H,
|
|
14
|
+
checkboxGroup: O,
|
|
15
|
+
checkboxList: j
|
|
16
|
+
}, b = c.forwardRef((e, o) => {
|
|
17
|
+
const { hoverProps: i, isHovered: s } = e.hoverResult, { pressProps: n, isPressed: a } = e.pressResult, { isFocused: r, isFocusVisible: d, focusProps: l } = e.focusRingAria;
|
|
18
18
|
return /* @__PURE__ */ v(
|
|
19
19
|
"label",
|
|
20
20
|
{
|
|
21
21
|
ref: o,
|
|
22
|
-
...u(
|
|
22
|
+
...u(i, n, e.labelProps),
|
|
23
23
|
slot: e.slot || void 0,
|
|
24
24
|
className: h(x.checkbox, e.className),
|
|
25
25
|
"data-hovered": s || void 0,
|
|
@@ -34,13 +34,13 @@ import '../assets/Checkbox.css';const N = [["path", { d: "M5 12h14", key: "1ays0
|
|
|
34
34
|
"data-required": e.isRequired || void 0,
|
|
35
35
|
children: [
|
|
36
36
|
/* @__PURE__ */ t("div", { className: h(x.checkboxInner), children: e.isIndeterminate ? /* @__PURE__ */ t(
|
|
37
|
-
|
|
37
|
+
N,
|
|
38
38
|
{
|
|
39
39
|
size: 14,
|
|
40
40
|
color: m.iconOnColor
|
|
41
41
|
}
|
|
42
42
|
) : /* @__PURE__ */ t(
|
|
43
|
-
|
|
43
|
+
B,
|
|
44
44
|
{
|
|
45
45
|
size: 14,
|
|
46
46
|
color: m.iconOnColor
|
|
@@ -57,8 +57,8 @@ import '../assets/Checkbox.css';const N = [["path", { d: "M5 12h14", key: "1ays0
|
|
|
57
57
|
]
|
|
58
58
|
}
|
|
59
59
|
);
|
|
60
|
-
}),
|
|
61
|
-
const
|
|
60
|
+
}), q = c.forwardRef((e, o) => {
|
|
61
|
+
const i = C(
|
|
62
62
|
{
|
|
63
63
|
...e,
|
|
64
64
|
value: e.value || ""
|
|
@@ -70,29 +70,29 @@ import '../assets/Checkbox.css';const N = [["path", { d: "M5 12h14", key: "1ays0
|
|
|
70
70
|
b,
|
|
71
71
|
{
|
|
72
72
|
...e,
|
|
73
|
-
...
|
|
73
|
+
...i,
|
|
74
74
|
ref: o
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
}), A =
|
|
78
|
-
const
|
|
77
|
+
}), A = c.forwardRef((e, o) => {
|
|
78
|
+
const i = R(e, F(e), e.inputRef);
|
|
79
79
|
return /* @__PURE__ */ t(
|
|
80
80
|
b,
|
|
81
81
|
{
|
|
82
82
|
...e,
|
|
83
|
-
...
|
|
83
|
+
...i,
|
|
84
84
|
ref: o
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
|
-
}), X =
|
|
87
|
+
}), X = c.forwardRef(
|
|
88
88
|
(e, o) => {
|
|
89
89
|
[e, o] = g(e, o, G);
|
|
90
|
-
const
|
|
90
|
+
const i = y(z), s = e.validationBehavior ?? i?.validationBehavior ?? "native", n = c.useContext(S), a = c.useRef(null), r = _(e), d = I({
|
|
91
91
|
ref: o,
|
|
92
92
|
isDisabled: e.isDisabled
|
|
93
93
|
}), l = P();
|
|
94
94
|
return n ? /* @__PURE__ */ t(
|
|
95
|
-
|
|
95
|
+
q,
|
|
96
96
|
{
|
|
97
97
|
...e,
|
|
98
98
|
state: n,
|
|
@@ -117,6 +117,6 @@ import '../assets/Checkbox.css';const N = [["path", { d: "M5 12h14", key: "1ays0
|
|
|
117
117
|
);
|
|
118
118
|
export {
|
|
119
119
|
X as C,
|
|
120
|
-
|
|
120
|
+
S as a,
|
|
121
121
|
x as s
|
|
122
122
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as o, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import { useCheckboxGroup as C } from "react-aria";
|
|
3
3
|
import { useCheckboxGroupState as v } from "react-stately";
|
|
4
|
-
import { a as k, L as S } from "./Label-
|
|
4
|
+
import { a as k, L as S } from "./Label-Dup4lWaR.js";
|
|
5
5
|
import { T as y } from "./Text-TWzJxnto.js";
|
|
6
6
|
import * as r from "react";
|
|
7
|
-
import { C as d, s as u, a as g } from "./Checkbox-
|
|
7
|
+
import { C as d, s as u, a as g } from "./Checkbox-CP6Nv9yx.js";
|
|
8
8
|
import { FieldErrorContext as A } from "react-aria-components";
|
|
9
9
|
import { F as P } from "./FieldError-C0HRIcAx.js";
|
|
10
10
|
import { u as V } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import g from "react";
|
|
3
|
+
import { ComboBox as y, Input as B, Button as F, Collection as w } from "react-aria-components";
|
|
4
|
+
import { c as s } from "./clsx-AexbMWKp.js";
|
|
5
|
+
import { a as C, L as S } from "./Label-Dup4lWaR.js";
|
|
6
|
+
import { T as u } from "./Text-TWzJxnto.js";
|
|
7
|
+
import { F as h } from "./FieldError-C0HRIcAx.js";
|
|
8
|
+
import { L as v } from "./ListBox-D5BBeZWL.js";
|
|
9
|
+
import { a as R, L as N, b as E } from "./ListBoxSection-MZB_5DdD.js";
|
|
10
|
+
import { C as I } from "./chevron-down-DgT-uSF9.js";
|
|
11
|
+
import { u as T } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
|
|
12
|
+
import '../assets/ComboBox.css';const j = "_combobox_47hgd_1", O = "_inputField_47hgd_6", U = "_medium_47hgd_28", z = "_wrap_47hgd_74", D = "_button_47hgd_80", M = "_icon_47hgd_116", V = "_emptyState_47hgd_122", t = {
|
|
13
|
+
combobox: j,
|
|
14
|
+
inputField: O,
|
|
15
|
+
medium: U,
|
|
16
|
+
wrap: z,
|
|
17
|
+
button: D,
|
|
18
|
+
icon: M,
|
|
19
|
+
emptyState: V
|
|
20
|
+
}, W = { showList: "Show list", noResultsFound: "No results found" }, $ = { showList: "Visa lista", noResultsFound: "Inga träffar" }, k = {
|
|
21
|
+
en: W,
|
|
22
|
+
sv: $
|
|
23
|
+
};
|
|
24
|
+
function to({
|
|
25
|
+
label: e,
|
|
26
|
+
description: i,
|
|
27
|
+
errorMessage: r,
|
|
28
|
+
children: p,
|
|
29
|
+
items: f,
|
|
30
|
+
className: _,
|
|
31
|
+
errorPosition: a = "top",
|
|
32
|
+
size: m = "large",
|
|
33
|
+
popover: b,
|
|
34
|
+
...n
|
|
35
|
+
}) {
|
|
36
|
+
const d = g.useRef(null), c = T(k), x = (L) => {
|
|
37
|
+
L.currentTarget.value && d.current?.select();
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ l(
|
|
40
|
+
y,
|
|
41
|
+
{
|
|
42
|
+
className: s(t.combobox, _),
|
|
43
|
+
...n,
|
|
44
|
+
"data-readonly": n.isReadOnly || void 0,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ o(C, { popover: b, children: e && /* @__PURE__ */ o(S, { children: e }) }),
|
|
47
|
+
i && /* @__PURE__ */ o(u, { slot: "description", children: i }),
|
|
48
|
+
a === "top" && /* @__PURE__ */ o(h, { "data-testid": "fieldError", children: r }),
|
|
49
|
+
/* @__PURE__ */ l("div", { className: t.wrap, children: [
|
|
50
|
+
/* @__PURE__ */ o(
|
|
51
|
+
B,
|
|
52
|
+
{
|
|
53
|
+
className: s(t.inputField, {
|
|
54
|
+
[t.medium]: m === "medium"
|
|
55
|
+
}),
|
|
56
|
+
"data-readonly": n.isReadOnly || void 0,
|
|
57
|
+
onMouseUp: x,
|
|
58
|
+
ref: d
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ o(
|
|
62
|
+
F,
|
|
63
|
+
{
|
|
64
|
+
className: s(t.button, {
|
|
65
|
+
[t.medium]: m === "medium"
|
|
66
|
+
}),
|
|
67
|
+
"aria-label": c.format("showList"),
|
|
68
|
+
children: /* @__PURE__ */ o(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: t.icon,
|
|
72
|
+
"aria-hidden": "true",
|
|
73
|
+
children: /* @__PURE__ */ o(
|
|
74
|
+
I,
|
|
75
|
+
{
|
|
76
|
+
size: 20,
|
|
77
|
+
"aria-hidden": !0
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
] }),
|
|
85
|
+
a === "bottom" && /* @__PURE__ */ o(h, { "data-testid": "fieldError", children: r }),
|
|
86
|
+
/* @__PURE__ */ o(R, { children: /* @__PURE__ */ o(
|
|
87
|
+
v,
|
|
88
|
+
{
|
|
89
|
+
items: f,
|
|
90
|
+
renderEmptyState: () => /* @__PURE__ */ o(u, { className: t.emptyState, children: c.format("noResultsFound") }),
|
|
91
|
+
children: p
|
|
92
|
+
}
|
|
93
|
+
) })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function q(e) {
|
|
99
|
+
return /* @__PURE__ */ o(N, { ...e });
|
|
100
|
+
}
|
|
101
|
+
function eo(e) {
|
|
102
|
+
return /* @__PURE__ */ o(E, { ...e, children: /* @__PURE__ */ o(w, { items: e.children, children: (i) => /* @__PURE__ */ o(q, { children: i.name }, i.id) }) });
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
to as C,
|
|
106
|
+
q as a,
|
|
107
|
+
eo as b
|
|
108
|
+
};
|
|
@@ -3,7 +3,7 @@ import { DateField as u } from "react-aria-components";
|
|
|
3
3
|
import { c as m } from "./clsx-AexbMWKp.js";
|
|
4
4
|
import { a as _, D as f } from "./DateInputDivider-CkTB5q5k.js";
|
|
5
5
|
import { F as s } from "./FieldError-C0HRIcAx.js";
|
|
6
|
-
import { a as h, L as D } from "./Label-
|
|
6
|
+
import { a as h, L as D } from "./Label-Dup4lWaR.js";
|
|
7
7
|
import { T as b } from "./Text-TWzJxnto.js";
|
|
8
8
|
import '../assets/DateField.css';const x = "_dateField_y3sba_1", y = "_inputField_y3sba_7", L = "_medium_y3sba_37", i = {
|
|
9
9
|
dateField: x,
|
|
@@ -4,7 +4,7 @@ import { a as m } from "./clsx-AexbMWKp.js";
|
|
|
4
4
|
import { C as M, R as N } from "./RangeCalendar-CGk2btOp.js";
|
|
5
5
|
import { a as p, D as k, b as B } from "./DateInputDivider-CkTB5q5k.js";
|
|
6
6
|
import { F as h } from "./FieldError-C0HRIcAx.js";
|
|
7
|
-
import { a as u, L as y } from "./Label-
|
|
7
|
+
import { a as u, L as y } from "./Label-Dup4lWaR.js";
|
|
8
8
|
import { T as _ } from "./Text-TWzJxnto.js";
|
|
9
9
|
import { c as C } from "./createLucideIcon-D4r5Phnh.js";
|
|
10
10
|
import '../assets/DateRangePicker.css';const I = [
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as o, jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
import { ModalOverlay as n, Modal as c, Dialog as i } from "react-aria-components";
|
|
3
|
+
import { B as _ } from "./Button-wBgWrXj3.js";
|
|
4
|
+
import { H as y } from "./Heading-D8tNNJkt.js";
|
|
5
|
+
import { c as v } from "./clsx-AexbMWKp.js";
|
|
6
|
+
import { X as x } from "./x-BXShoIAM.js";
|
|
7
|
+
import { u as f } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
|
|
8
|
+
import '../assets/Dialog.css';const h = "_modal_nxs78_1", p = "_overlay_nxs78_24", g = "_modalHeader_nxs78_48", B = "_modalTitle_nxs78_59", H = "_modalBody_nxs78_65", a = {
|
|
9
|
+
modal: h,
|
|
10
|
+
overlay: p,
|
|
11
|
+
modalHeader: g,
|
|
12
|
+
modalTitle: B,
|
|
13
|
+
modalBody: H
|
|
14
|
+
}, M = { close: "Close" }, N = { close: "Stäng" }, T = {
|
|
15
|
+
en: M,
|
|
16
|
+
sv: N
|
|
17
|
+
}, F = ({
|
|
18
|
+
children: s,
|
|
19
|
+
title: l,
|
|
20
|
+
hideCloseButton: r = !1,
|
|
21
|
+
className: t,
|
|
22
|
+
...d
|
|
23
|
+
}) => {
|
|
24
|
+
const m = f(T);
|
|
25
|
+
return /* @__PURE__ */ o(
|
|
26
|
+
n,
|
|
27
|
+
{
|
|
28
|
+
...d,
|
|
29
|
+
className: v(a.overlay, t),
|
|
30
|
+
children: /* @__PURE__ */ o(c, { className: a.modal, children: /* @__PURE__ */ e(i, { children: [
|
|
31
|
+
/* @__PURE__ */ e("div", { className: a.modalHeader, children: [
|
|
32
|
+
/* @__PURE__ */ o("div", { className: a.modalTitle, children: l && /* @__PURE__ */ o(
|
|
33
|
+
y,
|
|
34
|
+
{
|
|
35
|
+
level: 3,
|
|
36
|
+
elementType: "h2",
|
|
37
|
+
slot: "title",
|
|
38
|
+
children: l
|
|
39
|
+
}
|
|
40
|
+
) }),
|
|
41
|
+
!r && /* @__PURE__ */ o(
|
|
42
|
+
_,
|
|
43
|
+
{
|
|
44
|
+
slot: "close",
|
|
45
|
+
variant: "tertiary",
|
|
46
|
+
icon: x,
|
|
47
|
+
iconPlacement: "right",
|
|
48
|
+
children: m.format("close")
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ o(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: a.modalBody,
|
|
56
|
+
tabIndex: -1,
|
|
57
|
+
children: s
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] }) })
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
F as M
|
|
66
|
+
};
|
|
@@ -3,7 +3,7 @@ import * as b from "react";
|
|
|
3
3
|
import s from "react";
|
|
4
4
|
import { c as f } from "./clsx-AexbMWKp.js";
|
|
5
5
|
import { DialogTrigger as v, Label as d } from "react-aria-components";
|
|
6
|
-
import { P as g } from "./Popover-
|
|
6
|
+
import { P as g } from "./Popover-BcEtFiU1.js";
|
|
7
7
|
import { B as u } from "./Button-wBgWrXj3.js";
|
|
8
8
|
import { I as P } from "./info-kdfED7Wh.js";
|
|
9
9
|
import { u as _ } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
|