@midas-ds/components 17.15.3 → 17.15.5
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.stories.d.ts +1 -0
- package/accordion/index.js +2 -5
- package/assets/Button.css +1 -1
- package/assets/TextField.css +1 -1
- package/assets/accordion.css +1 -0
- package/assets/badge.css +1 -0
- package/assets/breadcrumbs.css +1 -0
- package/assets/button2.css +1 -0
- package/assets/calendar.css +1 -0
- package/assets/card.css +1 -0
- package/assets/checkbox.css +1 -0
- package/assets/{ColorSchemeSwitch.css → color-scheme-switch.css} +1 -1
- package/assets/combobox.css +1 -0
- package/assets/date-field.css +1 -0
- package/assets/date-picker.css +1 -0
- package/assets/default.css +1 -1
- package/assets/field-error.css +1 -0
- package/assets/file-list.css +1 -0
- package/assets/{FileUpload.css → file-upload.css} +1 -1
- package/assets/grid.css +1 -0
- package/assets/info-banner.css +1 -0
- package/assets/label.css +1 -0
- package/assets/layout.css +1 -0
- package/assets/link-button.css +1 -0
- package/assets/link.css +1 -0
- package/assets/list-box.css +1 -0
- package/assets/logo.css +1 -0
- package/assets/menu.css +1 -0
- package/assets/modal.css +1 -0
- package/assets/popover.css +1 -0
- package/assets/progress-bar.css +1 -0
- package/assets/radio.css +1 -0
- package/assets/search-field.css +1 -0
- package/assets/select.css +1 -0
- package/assets/skeleton.css +1 -0
- package/assets/spinner.css +1 -0
- package/assets/table.css +1 -0
- package/assets/tabs.css +1 -0
- package/assets/{TagGroup.css → tag.css} +1 -1
- package/assets/{Text.css → text.css} +1 -1
- package/assets/time-field.css +1 -0
- package/assets/toast.css +1 -0
- package/assets/toggle-button.css +1 -0
- package/assets/tooltip.css +1 -0
- package/badge/index.js +2 -5
- package/breadcrumbs/index.js +2 -5
- package/button/index.js +2 -6
- package/calendar/index.js +2 -5
- package/card/index.js +2 -12
- package/character-counter/index.js +2 -4
- package/checkbox/index.js +2 -6
- package/chunks/Button.module-0C2ArlRs.js +13 -0
- package/chunks/FeedbackStatusIcon-A1trvSCf.js +54 -0
- package/chunks/TextField.module-CrR3Krxn.js +12 -0
- package/chunks/accordion-KEgnlzYi.js +87 -0
- package/chunks/arrow-right-7yeXXFNV.js +10 -0
- package/chunks/badge-DrCn-5SX.js +22 -0
- package/chunks/breadcrumbs-XTH3axtt.js +23 -0
- package/chunks/button-CFjf-bDe.js +34 -0
- package/chunks/calendar-C0rlcHfr.js +74 -0
- package/chunks/card-CF8iwdg3.js +103 -0
- package/chunks/character-counter-CSoVSrxZ.js +16 -0
- package/chunks/check-BiPE7lAA.js +7 -0
- package/chunks/checkbox-B_41DFjp.js +174 -0
- package/chunks/chevron-down-Buf0eTzo.js +7 -0
- package/chunks/chevron-right-DJ7qKNKG.js +7 -0
- package/chunks/clear-button-Cb4MTvBR.js +17 -0
- package/chunks/clsx-BtlV5Vo3.js +21 -0
- package/chunks/color-scheme-switch-Ce4vL8Yz.js +122 -0
- package/chunks/combobox-BLGIYxNy.js +90 -0
- package/chunks/createLucideIcon-DhIhuN5D.js +39 -0
- package/chunks/date-field-Cy0HGw6v.js +73 -0
- package/chunks/date-picker-ByfWqOZh.js +191 -0
- package/chunks/field-error-DYp2kgFr.js +19 -0
- package/chunks/file-list-DYOuch5G.js +68 -0
- package/chunks/file-upload-CZRTVw5O.js +11 -0
- package/chunks/grid-CUYMbO7c.js +225 -0
- package/chunks/heading-595zCrRS.js +28 -0
- package/chunks/info-Bm2gRija.js +19 -0
- package/chunks/info-banner-hHq0Atii.js +59 -0
- package/chunks/label-uwnwLD3z.js +49 -0
- package/chunks/layout-BzK7P4Xn.js +426 -0
- package/chunks/link-Q46Ny2Po.js +40 -0
- package/chunks/link-button-Cm2B0s4X.js +39 -0
- package/chunks/list-box-Dm2itiZD.js +75 -0
- package/chunks/logo-D7tz-4hp.js +93 -0
- package/chunks/menu-CB6VDQ-u.js +49 -0
- package/chunks/modal-Dr0ythpF.js +66 -0
- package/chunks/popover-DxnYz_IT.js +27 -0
- package/chunks/progress-bar-Dppkp0cT.js +40 -0
- package/chunks/radio-PBrD5BO4.js +43 -0
- package/chunks/search-field-B5RciSq0.js +90 -0
- package/chunks/select-BZ0greL0.js +171 -0
- package/chunks/skeleton-OqKFBcmO.js +36 -0
- package/chunks/spinner-C3WiZYld.js +32 -0
- package/chunks/square-arrow-out-up-right-Bobm4VNc.js +17 -0
- package/chunks/table-BZ7VvZaq.js +150 -0
- package/chunks/tabs-eshGdQJJ.js +52 -0
- package/chunks/tag-CELJrUEQ.js +78 -0
- package/chunks/text-mAeDlv5N.js +23 -0
- package/chunks/textfield-CZSw2R67.js +112 -0
- package/chunks/time-field-DaQfnJQF.js +60 -0
- package/chunks/toast-AYzfHBcQ.js +91 -0
- package/chunks/toggle-button-DlPo9GJW.js +17 -0
- package/chunks/tooltip-BE_r_CBm.js +33 -0
- package/chunks/useLocalizedStringFormatter-bRLuRzVD.js +19 -0
- package/chunks/x-Bs_QW3q8.js +10 -0
- package/clear-button/index.js +2 -4
- package/color-scheme-switch/index.js +2 -4
- package/combobox/index.js +2 -4
- package/date-field/index.js +2 -9
- package/date-picker/index.js +2 -5
- package/field-error/index.js +2 -4
- package/file-list/index.js +2 -5
- package/file-upload/index.js +2 -5
- package/grid/index.js +2 -6
- package/heading/index.js +2 -4
- package/index.js +91 -165
- package/info-banner/index.js +2 -4
- package/label/index.js +2 -4
- package/layout/index.js +2 -8
- package/link/index.js +2 -6
- package/link-button/index.js +2 -6
- package/list-box/index.js +2 -13
- package/logo/index.js +2 -5
- package/menu/index.js +2 -10
- package/modal/index.js +2 -7
- package/package.json +1 -1
- package/popover/index.js +2 -4
- package/progress-bar/index.js +2 -4
- package/radio/index.js +2 -5
- package/search-field/index.js +2 -4
- package/select/index.js +2 -4
- package/skeleton/index.js +2 -4
- package/spinner/index.js +2 -4
- package/table/index.js +2 -9
- package/tabs/index.js +2 -7
- package/tag/index.js +2 -6
- package/text/index.js +2 -4
- package/textfield/index.js +2 -7
- package/time-field/index.js +2 -4
- package/toast/index.js +2 -10
- package/toggle-button/index.js +2 -5
- package/tooltip/index.js +2 -5
- package/assets/AccordionItem.css +0 -1
- package/assets/BadgeContainer.css +0 -1
- package/assets/Breadcrumb.css +0 -1
- package/assets/ButtonGroup.css +0 -1
- package/assets/CardHeader.css +0 -1
- package/assets/Checkbox.css +0 -1
- package/assets/ComboBox.css +0 -1
- package/assets/DateField.css +0 -1
- package/assets/DateInput.css +0 -1
- package/assets/DateRangePicker.css +0 -1
- package/assets/FieldError.css +0 -1
- package/assets/FileListItem.css +0 -1
- package/assets/GridItem.css +0 -1
- package/assets/InfoBanner.css +0 -1
- package/assets/Label.css +0 -1
- package/assets/Layout.css +0 -1
- package/assets/Link.css +0 -1
- package/assets/LinkButton.css +0 -1
- package/assets/ListBox.css +0 -1
- package/assets/ListBoxEmptyState.css +0 -1
- package/assets/Logo.css +0 -1
- package/assets/Modal.css +0 -1
- package/assets/Popover.css +0 -1
- package/assets/ProgressBar.css +0 -1
- package/assets/Radio.css +0 -1
- package/assets/RangeCalendar.css +0 -1
- package/assets/SearchField.css +0 -1
- package/assets/Select.css +0 -1
- package/assets/Separator.css +0 -1
- package/assets/Skeleton.css +0 -1
- package/assets/Spinner.css +0 -1
- package/assets/TabList.css +0 -1
- package/assets/Table.css +0 -1
- package/assets/TimeField.css +0 -1
- package/assets/Toast.css +0 -1
- package/assets/ToggleButtonGroup.css +0 -1
- package/assets/Tooltip.css +0 -1
- package/chunks/AccordionItem-DHhQDd6o.js +0 -129
- package/chunks/BadgeContainer-DyQDrY6S.js +0 -38
- package/chunks/Breadcrumb-Bs836gOn.js +0 -37
- package/chunks/Button-GCROAMSl.js +0 -56
- package/chunks/Button.module-byTN5rhp.js +0 -14
- package/chunks/ButtonGroup-Dr6HOBo2.js +0 -22
- package/chunks/CardHeader-BnwDMzW9.js +0 -184
- package/chunks/CharacterCounter-Dgnv-orm.js +0 -22
- package/chunks/Checkbox-CyamRrFD.js +0 -146
- package/chunks/CheckboxGroup-CmjQm14M.js +0 -84
- package/chunks/ClearButton-DkC8PIMi.js +0 -22
- package/chunks/ColorSchemeSwitch-CjXb7w5A.js +0 -118
- package/chunks/ComboBox-BCfucCKv.js +0 -102
- package/chunks/DateField-CpvZGNHu.js +0 -89
- package/chunks/DateInput-NzWcnB4y.js +0 -29
- package/chunks/DateInputDivider-BHAwPkIR.js +0 -13
- package/chunks/DateRangePicker-BBLNlQ2y.js +0 -202
- package/chunks/FeedbackStatusIcon-X9Bjgeta.js +0 -56
- package/chunks/FieldError-krpMBtie.js +0 -24
- package/chunks/FileListItem-CKF9HPjw.js +0 -69
- package/chunks/FileUpload-D6oyWcDA.js +0 -17
- package/chunks/Grid-C7aRFvmS.js +0 -24
- package/chunks/GridItem-DenBLGXB.js +0 -237
- package/chunks/Heading-nfcRc2QF.js +0 -38
- package/chunks/InfoBanner-CWLvkP6D.js +0 -76
- package/chunks/Label-Cqo7Xz2v.js +0 -67
- package/chunks/Layout-D-nVSBJY.js +0 -493
- package/chunks/Link-CSIZehbN.js +0 -59
- package/chunks/LinkButton-Dzp8ZAPs.js +0 -68
- package/chunks/ListBox-CJhp9Hsb.js +0 -60
- package/chunks/ListBoxEmptyState-BxWWr2D9.js +0 -30
- package/chunks/ListBoxHeader-Cl56gGEe.js +0 -63
- package/chunks/Logo-DDykn5b2.js +0 -150
- package/chunks/Modal-yigospxi.js +0 -78
- package/chunks/Popover-CjEPHe4A.js +0 -34
- package/chunks/ProgressBar-BrWLkY8H.js +0 -53
- package/chunks/Radio-CFolRKKY.js +0 -44
- package/chunks/RangeCalendar-DxLInTav.js +0 -99
- package/chunks/SearchField-BXIDm898.js +0 -121
- package/chunks/Select-BQ109AJG.js +0 -231
- package/chunks/Separator-CDRwpeHz.js +0 -76
- package/chunks/Skeleton-ClvqZoDy.js +0 -88
- package/chunks/Spinner-CfKMn18u.js +0 -43
- package/chunks/TabList-CJSnr6O0.js +0 -87
- package/chunks/Table-CDdv7GeG.js +0 -140
- package/chunks/TagGroup-C-pkXtVn.js +0 -119
- package/chunks/Text-D0r_W4lH.js +0 -36
- package/chunks/TextArea-CNP1Y3jR.js +0 -135
- package/chunks/TextField.module-BDIbEV87.js +0 -12
- package/chunks/TimeField-B3IdCqTf.js +0 -88
- package/chunks/Toast-BFq_0Ue4.js +0 -158
- package/chunks/ToggleButtonGroup-DRnEEi5-.js +0 -29
- package/chunks/Tooltip-BYEaNkZG.js +0 -44
- package/chunks/arrow-right-BVcFGZmy.js +0 -8
- package/chunks/check-Bt2UikoU.js +0 -5
- package/chunks/chevron-down-BBFYYzZq.js +0 -5
- package/chunks/chevron-right-DvXGOiS_.js +0 -5
- package/chunks/clsx-AexbMWKp.js +0 -24
- package/chunks/createLucideIcon-CP-mMPfa.js +0 -75
- package/chunks/info-N5jWZg2A.js +0 -9
- package/chunks/square-arrow-out-up-right-x_I6wdNi.js +0 -9
- package/chunks/useLocalizedStringFormatter-BHvsRxDk.js +0 -25
- package/chunks/x-B9bYxG31.js +0 -8
- /package/assets/{CharacterCounter.css → character-counter.css} +0 -0
- /package/assets/{Heading.css → heading.css} +0 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { n as e } from "./clsx-BtlV5Vo3.js";
|
|
2
|
+
import { t } from "./createLucideIcon-DhIhuN5D.js";
|
|
3
|
+
import { t as n } from "./check-BiPE7lAA.js";
|
|
4
|
+
import { t as r } from "./useLocalizedStringFormatter-bRLuRzVD.js";
|
|
5
|
+
import { t as i } from "./text-mAeDlv5N.js";
|
|
6
|
+
import { t as a } from "./field-error-DYp2kgFr.js";
|
|
7
|
+
import { n as o, t as s } from "./label-uwnwLD3z.js";
|
|
8
|
+
import * as c from "react";
|
|
9
|
+
import l, { forwardRef as u, useContext as d, useRef as f } from "react";
|
|
10
|
+
import { CheckboxContext as p, FieldErrorContext as m, FormContext as h, useContextProps as g, useSlottedContext as _ } from "react-aria-components";
|
|
11
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
12
|
+
import { VisuallyHidden as b, mergeProps as x, useCheckbox as S, useCheckboxGroup as C, useCheckboxGroupItem as w, useFocusRing as T, useHover as E, usePress as D } from "react-aria";
|
|
13
|
+
import { variables as O } from "@midas-ds/theme";
|
|
14
|
+
import { useToggleState as k } from "@react-stately/toggle";
|
|
15
|
+
import { useCheckboxGroupState as A } from "react-stately";
|
|
16
|
+
import '../assets/checkbox.css';var j = t("minus", [["path", {
|
|
17
|
+
d: "M5 12h14",
|
|
18
|
+
key: "1ays0h"
|
|
19
|
+
}]]), M = l.createContext(null), N = {
|
|
20
|
+
checkboxInner: "_checkboxInner_v5u0z_1",
|
|
21
|
+
checkbox: "_checkbox_v5u0z_1",
|
|
22
|
+
checkboxGroup: "_checkboxGroup_v5u0z_144",
|
|
23
|
+
checkboxList: "_checkboxList_v5u0z_155"
|
|
24
|
+
}, P = u(({ hoverResult: t, pressResult: r, focusRingAria: i, labelProps: a, slot: o, className: s, isSelected: c, isIndeterminate: l, isDisabled: u, isInvalid: d, isReadOnly: f, isRequired: p, inputProps: m, inputRef: h, children: g }, _) => {
|
|
25
|
+
let { hoverProps: S, isHovered: C } = t, { pressProps: w, isPressed: T } = r, { isFocused: E, isFocusVisible: D, focusProps: k } = i;
|
|
26
|
+
return /* @__PURE__ */ y("label", {
|
|
27
|
+
ref: _,
|
|
28
|
+
...x(S, w, a),
|
|
29
|
+
slot: o || void 0,
|
|
30
|
+
className: e(N.checkbox, s),
|
|
31
|
+
"data-hovered": C || void 0,
|
|
32
|
+
"data-selected": c || void 0,
|
|
33
|
+
"data-indeterminate": l || void 0,
|
|
34
|
+
"data-pressed": T || void 0,
|
|
35
|
+
"data-disabled": u || void 0,
|
|
36
|
+
"data-readonly": f || void 0,
|
|
37
|
+
"data-invalid": d || void 0,
|
|
38
|
+
"data-focused": E || void 0,
|
|
39
|
+
"data-focus-visible": D || void 0,
|
|
40
|
+
"data-required": p || void 0,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ v("div", {
|
|
43
|
+
className: e(N.checkboxInner),
|
|
44
|
+
children: v(l ? j : n, {
|
|
45
|
+
size: 14,
|
|
46
|
+
color: O.iconOnColor
|
|
47
|
+
})
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ v(b, { children: /* @__PURE__ */ v("input", {
|
|
50
|
+
...x(m, k),
|
|
51
|
+
ref: h
|
|
52
|
+
}) }),
|
|
53
|
+
g
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
P.displayName = "CheckboxInner";
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region packages/components/src/checkbox/CheckboxGroupItem.tsx
|
|
60
|
+
var F = u((e, t) => {
|
|
61
|
+
let n = w({
|
|
62
|
+
...e,
|
|
63
|
+
value: e.value || ""
|
|
64
|
+
}, e.state, e.inputRef);
|
|
65
|
+
return /* @__PURE__ */ v(P, {
|
|
66
|
+
...e,
|
|
67
|
+
...n,
|
|
68
|
+
ref: t
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
F.displayName = "CheckBoxGroupItem";
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region packages/components/src/checkbox/SingleCheckbox.tsx
|
|
74
|
+
var I = u((e, t) => {
|
|
75
|
+
let n = S(e, k(e), e.inputRef);
|
|
76
|
+
return /* @__PURE__ */ v(P, {
|
|
77
|
+
...e,
|
|
78
|
+
...n,
|
|
79
|
+
ref: t
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
I.displayName = "SingleCheckbox";
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region packages/components/src/checkbox/Checkbox.tsx
|
|
85
|
+
var L = u((e, t) => {
|
|
86
|
+
[e, t] = g(e, t, p);
|
|
87
|
+
let n = _(h), r = e.validationBehavior ?? n?.validationBehavior ?? "native", i = d(M), a = f(null), o = E(e), s = D({
|
|
88
|
+
ref: t,
|
|
89
|
+
isDisabled: e.isDisabled
|
|
90
|
+
}), c = T();
|
|
91
|
+
return i ? /* @__PURE__ */ v(F, {
|
|
92
|
+
...e,
|
|
93
|
+
state: i,
|
|
94
|
+
inputRef: a,
|
|
95
|
+
hoverResult: o,
|
|
96
|
+
pressResult: s,
|
|
97
|
+
focusRingAria: c,
|
|
98
|
+
validationBehavior: r
|
|
99
|
+
}) : /* @__PURE__ */ v(I, {
|
|
100
|
+
...e,
|
|
101
|
+
inputRef: a,
|
|
102
|
+
hoverResult: o,
|
|
103
|
+
pressResult: s,
|
|
104
|
+
focusRingAria: c,
|
|
105
|
+
validationBehavior: r
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
L.displayName = "Checkbox";
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region packages/components/src/checkbox/useSelectAll.ts
|
|
111
|
+
var R = (e, { value: t }) => {
|
|
112
|
+
let n = c.Children.toArray(e).filter((e) => c.isValidElement(e) && e.type === L), r = c.Children.count(n), i = c.Children.toArray(e).filter((e) => c.isValidElement(e)).filter((e) => !!e && e.type === L).map((e) => e.props.value || ""), a = t.length === 0, o = t.length === r;
|
|
113
|
+
return {
|
|
114
|
+
allSelected: o,
|
|
115
|
+
someSelected: !a && !o,
|
|
116
|
+
checkboxValues: i
|
|
117
|
+
};
|
|
118
|
+
}, z = ({ state: e, errorMessage: t }) => /* @__PURE__ */ v(m.Provider, {
|
|
119
|
+
value: e.displayValidation,
|
|
120
|
+
children: /* @__PURE__ */ v(a, { children: t })
|
|
121
|
+
}), B = {
|
|
122
|
+
en: { selectAll: "Select all" },
|
|
123
|
+
sv: { selectAll: "Välj alla" }
|
|
124
|
+
};
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region packages/components/src/checkbox/CheckboxGroup.tsx
|
|
127
|
+
function V(e) {
|
|
128
|
+
let t = A(e), n = r(B), { groupProps: a, labelProps: c, descriptionProps: l } = C(e, t), { allSelected: u, someSelected: d, checkboxValues: f } = R(e.children, t), p = (e) => {
|
|
129
|
+
t.setValue(e ? f : []);
|
|
130
|
+
};
|
|
131
|
+
return /* @__PURE__ */ y("div", {
|
|
132
|
+
...a,
|
|
133
|
+
className: N.checkboxGroup,
|
|
134
|
+
"data-readonly": e.isReadOnly || void 0,
|
|
135
|
+
"data-disabled": e.isDisabled || void 0,
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ v(o, {
|
|
138
|
+
popover: e.popover,
|
|
139
|
+
children: e.label && /* @__PURE__ */ v(s, {
|
|
140
|
+
...c,
|
|
141
|
+
children: e.label
|
|
142
|
+
})
|
|
143
|
+
}),
|
|
144
|
+
e.description && /* @__PURE__ */ v(i, {
|
|
145
|
+
slot: "description",
|
|
146
|
+
...l,
|
|
147
|
+
children: e.description
|
|
148
|
+
}),
|
|
149
|
+
e.errorPosition === "top" && /* @__PURE__ */ v(z, {
|
|
150
|
+
...e,
|
|
151
|
+
state: t
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ y("div", {
|
|
154
|
+
className: N.checkboxList,
|
|
155
|
+
children: [e.showSelectAll && /* @__PURE__ */ v(L, {
|
|
156
|
+
isSelected: u,
|
|
157
|
+
isIndeterminate: d,
|
|
158
|
+
isReadOnly: e.isReadOnly,
|
|
159
|
+
onChange: p,
|
|
160
|
+
children: e.selectAllLabel || n.format("selectAll")
|
|
161
|
+
}), /* @__PURE__ */ v(M.Provider, {
|
|
162
|
+
value: t,
|
|
163
|
+
children: e.children
|
|
164
|
+
})]
|
|
165
|
+
}),
|
|
166
|
+
e.errorPosition === "bottom" && /* @__PURE__ */ v(z, {
|
|
167
|
+
...e,
|
|
168
|
+
state: t
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
//#endregion
|
|
174
|
+
export { L as n, V as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./x-Bs_QW3q8.js";
|
|
3
|
+
import { n as t } from "./button-CFjf-bDe.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
+
//#region packages/components/src/clear-button/ClearButton.tsx
|
|
7
|
+
var r = (r) => /* @__PURE__ */ n(t, {
|
|
8
|
+
variant: "icon",
|
|
9
|
+
slot: null,
|
|
10
|
+
...r,
|
|
11
|
+
children: /* @__PURE__ */ n(e, {
|
|
12
|
+
size: 20,
|
|
13
|
+
"aria-hidden": !0
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region node_modules/clsx/dist/clsx.mjs
|
|
2
|
+
function e(t) {
|
|
3
|
+
var n, r, i = "";
|
|
4
|
+
if (typeof t == "string" || typeof t == "number") i += t;
|
|
5
|
+
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
6
|
+
var a = t.length;
|
|
7
|
+
for (n = 0; n < a; n++) t[n] && (r = e(t[n])) && (i && (i += " "), i += r);
|
|
8
|
+
} else for (r in t) t[r] && (i && (i += " "), i += r);
|
|
9
|
+
return i;
|
|
10
|
+
}
|
|
11
|
+
function t() {
|
|
12
|
+
for (var t, n, r = 0, i = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (n = e(t)) && (i && (i += " "), i += n);
|
|
13
|
+
return i;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region packages/components/src/utils/clsx.ts
|
|
17
|
+
function n(...e) {
|
|
18
|
+
return e.some((e) => typeof e == "function") ? (n) => t(e.map((e) => typeof e == "function" ? e(n) : e)) : t(e);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { t as n, n as t };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./createLucideIcon-DhIhuN5D.js";
|
|
3
|
+
import { t } from "./useLocalizedStringFormatter-bRLuRzVD.js";
|
|
4
|
+
import { n, t as r } from "./toggle-button-DlPo9GJW.js";
|
|
5
|
+
import * as i from "react";
|
|
6
|
+
import { SelectionIndicator as a } from "react-aria-components";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
import { VisuallyHidden as c } from "react-aria";
|
|
9
|
+
import '../assets/color-scheme-switch.css';var l = e("laptop", [["path", {
|
|
10
|
+
d: "M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",
|
|
11
|
+
key: "1pdavp"
|
|
12
|
+
}], ["path", {
|
|
13
|
+
d: "M20.054 15.987H3.946",
|
|
14
|
+
key: "14rxg9"
|
|
15
|
+
}]]), u = e("moon", [["path", {
|
|
16
|
+
d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",
|
|
17
|
+
key: "kfwtm"
|
|
18
|
+
}]]), d = e("sun", [
|
|
19
|
+
["circle", {
|
|
20
|
+
cx: "12",
|
|
21
|
+
cy: "12",
|
|
22
|
+
r: "4",
|
|
23
|
+
key: "4exip2"
|
|
24
|
+
}],
|
|
25
|
+
["path", {
|
|
26
|
+
d: "M12 2v2",
|
|
27
|
+
key: "tus03m"
|
|
28
|
+
}],
|
|
29
|
+
["path", {
|
|
30
|
+
d: "M12 20v2",
|
|
31
|
+
key: "1lh1kg"
|
|
32
|
+
}],
|
|
33
|
+
["path", {
|
|
34
|
+
d: "m4.93 4.93 1.41 1.41",
|
|
35
|
+
key: "149t6j"
|
|
36
|
+
}],
|
|
37
|
+
["path", {
|
|
38
|
+
d: "m17.66 17.66 1.41 1.41",
|
|
39
|
+
key: "ptbguv"
|
|
40
|
+
}],
|
|
41
|
+
["path", {
|
|
42
|
+
d: "M2 12h2",
|
|
43
|
+
key: "1t8f8n"
|
|
44
|
+
}],
|
|
45
|
+
["path", {
|
|
46
|
+
d: "M20 12h2",
|
|
47
|
+
key: "1q8mjw"
|
|
48
|
+
}],
|
|
49
|
+
["path", {
|
|
50
|
+
d: "m6.34 17.66-1.41 1.41",
|
|
51
|
+
key: "1m8zz5"
|
|
52
|
+
}],
|
|
53
|
+
["path", {
|
|
54
|
+
d: "m19.07 4.93-1.41 1.41",
|
|
55
|
+
key: "1shlcs"
|
|
56
|
+
}]
|
|
57
|
+
]), f = {
|
|
58
|
+
button: "_button_1r8vq_1",
|
|
59
|
+
selectionIndicator: "_selectionIndicator_1r8vq_14"
|
|
60
|
+
}, p = {
|
|
61
|
+
en: {
|
|
62
|
+
darkMode: "Dark Mode",
|
|
63
|
+
lightMode: "Light Mode",
|
|
64
|
+
system: "System Setting"
|
|
65
|
+
},
|
|
66
|
+
sv: {
|
|
67
|
+
darkMode: "Mörkt läge",
|
|
68
|
+
lightMode: "Ljust läge",
|
|
69
|
+
system: "Systeminställning"
|
|
70
|
+
}
|
|
71
|
+
}, m = ({ selector: e = ":root", defaultScheme: m = "light dark", scheme: h, onSchemeChange: g, defaultValue: _, className: v }) => {
|
|
72
|
+
let [y, b] = i.useState(_ ?? /* @__PURE__ */ new Set([h ?? m])), x = h ? /* @__PURE__ */ new Set([h]) : y;
|
|
73
|
+
i.useEffect(() => {
|
|
74
|
+
let t = document.querySelector(e);
|
|
75
|
+
if (t) {
|
|
76
|
+
let e = Array.from(x).join(" ");
|
|
77
|
+
t.style.removeProperty("color-scheme"), e === "light dark" ? delete t.dataset.colorScheme : t.dataset.colorScheme = e;
|
|
78
|
+
} else console.warn(`No element found for selector: "${e}"`);
|
|
79
|
+
}, [x, e]);
|
|
80
|
+
let S = t(p);
|
|
81
|
+
return /* @__PURE__ */ s(r, {
|
|
82
|
+
selectionMode: "single",
|
|
83
|
+
selectedKeys: x,
|
|
84
|
+
onSelectionChange: (e) => {
|
|
85
|
+
let t = Array.from(e)[0];
|
|
86
|
+
b(e), g?.(t);
|
|
87
|
+
},
|
|
88
|
+
disallowEmptySelection: !0,
|
|
89
|
+
className: v,
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ s(n, {
|
|
92
|
+
id: "light dark",
|
|
93
|
+
className: f.button,
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ o(l, {}),
|
|
96
|
+
/* @__PURE__ */ o(c, { children: S.format("system") }),
|
|
97
|
+
/* @__PURE__ */ o(a, { className: f.selectionIndicator })
|
|
98
|
+
]
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ s(n, {
|
|
101
|
+
id: "light",
|
|
102
|
+
className: f.button,
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ o(d, {}),
|
|
105
|
+
/* @__PURE__ */ o(c, { children: S.format("lightMode") }),
|
|
106
|
+
/* @__PURE__ */ o(a, { className: f.selectionIndicator })
|
|
107
|
+
]
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ s(n, {
|
|
110
|
+
id: "dark",
|
|
111
|
+
className: f.button,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ o(u, {}),
|
|
114
|
+
/* @__PURE__ */ o(c, { children: S.format("darkMode") }),
|
|
115
|
+
/* @__PURE__ */ o(a, { className: f.selectionIndicator })
|
|
116
|
+
]
|
|
117
|
+
})
|
|
118
|
+
]
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
//#endregion
|
|
122
|
+
export { m as t };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./clsx-BtlV5Vo3.js";
|
|
3
|
+
import { t } from "./chevron-down-Buf0eTzo.js";
|
|
4
|
+
import { t as n } from "./useLocalizedStringFormatter-bRLuRzVD.js";
|
|
5
|
+
import { t as r } from "./text-mAeDlv5N.js";
|
|
6
|
+
import { t as i } from "./field-error-DYp2kgFr.js";
|
|
7
|
+
import { n as a, t as o } from "./label-uwnwLD3z.js";
|
|
8
|
+
import { a as s, c, t as l } from "./list-box-Dm2itiZD.js";
|
|
9
|
+
import { useRef as u } from "react";
|
|
10
|
+
import { Button as d, ComboBox as f, Input as p } from "react-aria-components";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
import '../assets/combobox.css';var g = {
|
|
13
|
+
combobox: "_combobox_1uann_1",
|
|
14
|
+
inputField: "_inputField_1uann_6",
|
|
15
|
+
medium: "_medium_1uann_28",
|
|
16
|
+
text: "_text_1uann_75",
|
|
17
|
+
wrap: "_wrap_1uann_80",
|
|
18
|
+
button: "_button_1uann_85",
|
|
19
|
+
icon: "_icon_1uann_122"
|
|
20
|
+
}, _ = {
|
|
21
|
+
en: {
|
|
22
|
+
showList: "Show list",
|
|
23
|
+
noResultsFound: "No results found"
|
|
24
|
+
},
|
|
25
|
+
sv: {
|
|
26
|
+
showList: "Visa lista",
|
|
27
|
+
noResultsFound: "Inga träffar"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region packages/components/src/combobox/ComboBox.tsx
|
|
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 = u(null), A = n(_), j = (e) => {
|
|
34
|
+
e.currentTarget.value && k.current?.select();
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ h(f, {
|
|
37
|
+
className: e(g.combobox, C),
|
|
38
|
+
...O,
|
|
39
|
+
"data-readonly": O.isReadOnly || void 0,
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ m(a, {
|
|
42
|
+
popover: E,
|
|
43
|
+
children: v && /* @__PURE__ */ m(o, { children: v })
|
|
44
|
+
}),
|
|
45
|
+
y && /* @__PURE__ */ m(r, {
|
|
46
|
+
slot: "description",
|
|
47
|
+
children: y
|
|
48
|
+
}),
|
|
49
|
+
w === "top" && /* @__PURE__ */ m(i, {
|
|
50
|
+
"data-testid": "fieldError",
|
|
51
|
+
children: b
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ h("div", {
|
|
54
|
+
className: g.wrap,
|
|
55
|
+
children: [/* @__PURE__ */ m(p, {
|
|
56
|
+
className: e(g.inputField, { [g.medium]: T === "medium" }),
|
|
57
|
+
"data-readonly": O.isReadOnly || void 0,
|
|
58
|
+
onPointerUp: j,
|
|
59
|
+
ref: k
|
|
60
|
+
}), /* @__PURE__ */ m(d, {
|
|
61
|
+
className: e(g.button, { [g.medium]: T === "medium" }),
|
|
62
|
+
"aria-label": A.format("showList"),
|
|
63
|
+
children: /* @__PURE__ */ m("div", {
|
|
64
|
+
className: g.icon,
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
children: /* @__PURE__ */ m(t, {
|
|
67
|
+
size: 20,
|
|
68
|
+
"aria-hidden": !0
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
})]
|
|
72
|
+
}),
|
|
73
|
+
w === "bottom" && /* @__PURE__ */ m(i, {
|
|
74
|
+
"data-testid": "fieldError",
|
|
75
|
+
children: b
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ m(s, {
|
|
78
|
+
offset: 4,
|
|
79
|
+
children: /* @__PURE__ */ m(c, {
|
|
80
|
+
items: S,
|
|
81
|
+
renderEmptyState: () => /* @__PURE__ */ m(l, { children: A.format("noResultsFound") }),
|
|
82
|
+
...D,
|
|
83
|
+
children: x
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { v as t };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createElement as e, forwardRef as t } from "react";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
|
|
3
|
+
var n = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), r = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), i = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), a = (e) => {
|
|
4
|
+
let t = i(e);
|
|
5
|
+
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
6
|
+
}, o = {
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
width: 24,
|
|
9
|
+
height: 24,
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "none",
|
|
12
|
+
stroke: "currentColor",
|
|
13
|
+
strokeWidth: 2,
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round"
|
|
16
|
+
}, s = (e) => {
|
|
17
|
+
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
18
|
+
return !1;
|
|
19
|
+
}, c = t(({ color: t = "currentColor", size: r = 24, strokeWidth: i = 2, absoluteStrokeWidth: a, className: c = "", children: l, iconNode: u, ...d }, f) => e("svg", {
|
|
20
|
+
ref: f,
|
|
21
|
+
...o,
|
|
22
|
+
width: r,
|
|
23
|
+
height: r,
|
|
24
|
+
stroke: t,
|
|
25
|
+
strokeWidth: a ? Number(i) * 24 / Number(r) : i,
|
|
26
|
+
className: n("lucide", c),
|
|
27
|
+
...!l && !s(d) && { "aria-hidden": "true" },
|
|
28
|
+
...d
|
|
29
|
+
}, [...u.map(([t, n]) => e(t, n)), ...Array.isArray(l) ? l : [l]])), l = (i, o) => {
|
|
30
|
+
let s = t(({ className: t, ...s }, l) => e(c, {
|
|
31
|
+
ref: l,
|
|
32
|
+
iconNode: o,
|
|
33
|
+
className: n(`lucide-${r(a(i))}`, `lucide-${i}`, t),
|
|
34
|
+
...s
|
|
35
|
+
}));
|
|
36
|
+
return s.displayName = a(i), s;
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { l as t };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { t as e } from "./clsx-BtlV5Vo3.js";
|
|
2
|
+
import { t } from "./useLocalizedStringFormatter-bRLuRzVD.js";
|
|
3
|
+
import { t as n } from "./text-mAeDlv5N.js";
|
|
4
|
+
import { t as r } from "./field-error-DYp2kgFr.js";
|
|
5
|
+
import { n as i, t as a } from "./label-uwnwLD3z.js";
|
|
6
|
+
import { t as o } from "./clear-button-Cb4MTvBR.js";
|
|
7
|
+
import * as s from "react";
|
|
8
|
+
import { DateField as c, DateFieldStateContext as l, DateInput as u, DateSegment as d } from "react-aria-components";
|
|
9
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
+
import { FocusScope as m, useFocusManager as h } from "@react-aria/focus";
|
|
11
|
+
import '../assets/date-field.css';var g = {
|
|
12
|
+
en: { clear: "Clear date" },
|
|
13
|
+
sv: { clear: "Rensa datum" }
|
|
14
|
+
}, _ = {
|
|
15
|
+
dateField: "_dateField_1ejwm_1",
|
|
16
|
+
inputField: "_inputField_1ejwm_7",
|
|
17
|
+
medium: "_medium_1ejwm_38",
|
|
18
|
+
clearButton: "_clearButton_1ejwm_47"
|
|
19
|
+
}, v = ({ isClearable: n, size: r, isDisabled: i, isReadOnly: a }) => {
|
|
20
|
+
let c = t(g), u = s.useContext(l), d = h();
|
|
21
|
+
return n && u?.value != null && !a ? /* @__PURE__ */ f(o, {
|
|
22
|
+
onPress: () => {
|
|
23
|
+
u?.setValue(null), d?.focusFirst();
|
|
24
|
+
},
|
|
25
|
+
size: r,
|
|
26
|
+
isDisabled: i,
|
|
27
|
+
"aria-label": c.format("clear"),
|
|
28
|
+
className: e(_.clearButton, { [_.medium]: r === "medium" })
|
|
29
|
+
}) : null;
|
|
30
|
+
}, y = s.forwardRef(({ className: t, description: o, errorMessage: s, errorPosition: l = "top", label: u, size: d = "large", popover: h, isClearable: g = !1, isReadOnly: y, isDisabled: b, ...S }, w) => /* @__PURE__ */ p(c, {
|
|
31
|
+
...S,
|
|
32
|
+
ref: w,
|
|
33
|
+
isReadOnly: y,
|
|
34
|
+
isDisabled: b,
|
|
35
|
+
className: e(_.dateField, t),
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ f(i, {
|
|
38
|
+
popover: h,
|
|
39
|
+
children: u && /* @__PURE__ */ f(a, { children: u })
|
|
40
|
+
}),
|
|
41
|
+
o && /* @__PURE__ */ f(n, {
|
|
42
|
+
slot: "description",
|
|
43
|
+
children: o
|
|
44
|
+
}),
|
|
45
|
+
l === "top" && /* @__PURE__ */ f(r, { children: s }),
|
|
46
|
+
/* @__PURE__ */ f("div", {
|
|
47
|
+
className: e(_.inputField, { [_.medium]: d === "medium" }),
|
|
48
|
+
"data-testid": "date-field_input-field",
|
|
49
|
+
children: /* @__PURE__ */ p(m, { children: [/* @__PURE__ */ f(C, { children: (e) => /* @__PURE__ */ f(x, { segment: e }) }), /* @__PURE__ */ f(v, {
|
|
50
|
+
isClearable: g,
|
|
51
|
+
size: d,
|
|
52
|
+
isDisabled: b,
|
|
53
|
+
isReadOnly: y
|
|
54
|
+
})] })
|
|
55
|
+
}),
|
|
56
|
+
l === "bottom" && /* @__PURE__ */ f(r, { children: s })
|
|
57
|
+
]
|
|
58
|
+
})), b = { dateSegment: "_dateSegment_15g5c_1" }, x = ({ className: t, ...n }) => /* @__PURE__ */ f(d, {
|
|
59
|
+
className: e(b.dateSegment, t),
|
|
60
|
+
...n
|
|
61
|
+
}), S = {
|
|
62
|
+
dateInput: "_dateInput_14x1f_1",
|
|
63
|
+
divider: "_divider_14x1f_21"
|
|
64
|
+
}, C = ({ className: t, ...n }) => /* @__PURE__ */ f(u, {
|
|
65
|
+
className: e(S.dateInput, t),
|
|
66
|
+
...n
|
|
67
|
+
}), w = () => /* @__PURE__ */ f("span", {
|
|
68
|
+
"aria-hidden": "true",
|
|
69
|
+
className: S.divider,
|
|
70
|
+
children: "-"
|
|
71
|
+
});
|
|
72
|
+
//#endregion
|
|
73
|
+
export { y as i, C as n, x as r, w as t };
|