@midas-ds/components 14.1.0 → 15.1.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/AccordionItem-8UtB6O1X.js +347 -0
- package/AccordionItem-DKE794Si.cjs +1 -0
- package/{Button-CGe3Nyos.js → Button-BbfVT9Yl.js} +2 -2
- package/{Button-CF97piBl.js → Button-DdXFHfXw.js} +1 -1
- package/CHANGELOG.md +29 -0
- package/{Card-DJ8E5Rzd.js → Card-CdqGFff2.js} +1 -1
- package/{CheckboxGroup-B1b-6bKq.js → CheckboxGroup-CtJJqk_q.js} +3 -3
- package/{CheckboxGroup-BfZyy5yU.cjs → CheckboxGroup-thvsvOqD.cjs} +1 -1
- package/{ColorSchemeSwitch-BOooU0iy.cjs → ColorSchemeSwitch-Ckna0otR.cjs} +1 -1
- package/{ColorSchemeSwitch-KjnsdbDr.js → ColorSchemeSwitch-aF2UxI20.js} +1 -1
- package/{ComboBox-D1ZSZ6m-.js → ComboBox-BDX4BYWJ.js} +51 -44
- package/ComboBox-DFPrJUoV.cjs +1 -0
- package/{DateField-BogEOseq.cjs → DateField-B92Cqf9K.cjs} +1 -1
- package/{DateField-lsr_1fw4.js → DateField-BPRWrVcu.js} +3 -3
- package/{DateInputDivider-CYqm6PZP.cjs → DateInputDivider-CCrXjsUB.cjs} +1 -1
- package/{DateInputDivider-CRv3YuXd.js → DateInputDivider-DOHpVaNE.js} +5 -5
- package/{DateRangePicker-CgNXWOT6.cjs → DateRangePicker-COSTCOt8.cjs} +1 -1
- package/{DateRangePicker-5k1swaEt.js → DateRangePicker-Cmt9NC35.js} +8 -8
- package/{Dialog-B1N4Ndyx.js → Dialog-CPuJA2fm.js} +3 -3
- package/{Dialog-BUAp30Wc.js → Dialog-D4Py85wi.js} +4 -4
- package/{Dialog-BgSxz1JW.cjs → Dialog-DtOf0vWx.cjs} +1 -1
- package/{Dialog-PrnV8KTh.cjs → Dialog-DycTLpdr.cjs} +1 -1
- package/{Dropdown-DaARa89l.js → Dropdown-B4lwe0Hn.js} +2 -2
- package/{Dropdown-DBFLb8Tl.cjs → Dropdown-_g9l5k07.cjs} +1 -1
- package/{FieldError-l3xULRa0.js → FieldError-CIxlNQCM.js} +11 -11
- package/{FieldError-Cimgm8qD.cjs → FieldError-JWxR_EqN.cjs} +1 -1
- package/{FileUpload-DHmsupSe.cjs → FileUpload-C0TjNkuh.cjs} +2 -2
- package/{FileUpload-CN0HNJ_Y.js → FileUpload-DLBP3VPp.js} +260 -534
- package/{InfoBanner-BW3vy9mc.js → InfoBanner-D7Ta-7PI.js} +1 -1
- package/{Label-CNTODOFg.cjs → Label-DpY2SZdQ.cjs} +1 -1
- package/{Label-BGMXsSFb.js → Label-FfEnd4ai.js} +4 -4
- package/{Layout-JL9l-y7w.js → Layout-Hd1e_MEA.js} +1 -1
- package/{ListBox-mOCZvKD4.js → ListBox-5GK4ZRj1.js} +13 -13
- package/{ListBox-TGCxrXIJ.cjs → ListBox-FD30iELk.cjs} +1 -1
- package/{ListBoxSection-D_kTkvgG.js → ListBox-LJ3VgZMr.js} +209 -244
- package/ListBox-u6ZXp5Yi.cjs +1 -0
- package/{ListBoxLoadMoreItem-CLdTe6-z.js → ListBoxLoadMoreItem-B4GFbdYf.js} +2 -2
- package/ListBoxLoadMoreItem-DMUOzVtt.cjs +1 -0
- package/ListBoxSection-CBlpg0AG.cjs +1 -0
- package/ListBoxSection-DjGs1ndn.js +51 -0
- package/{ListKeyboardDelegate-CLRlDto7.cjs → ListKeyboardDelegate-8zuIfwQ7.cjs} +1 -1
- package/{ListKeyboardDelegate-BHnZMUhW.js → ListKeyboardDelegate-BBmpJ-2O.js} +1 -1
- package/Popover-CS8Yyfrq.js +39 -0
- package/Popover-DpB0XDBp.cjs +1 -0
- package/{ProgressBar-BGemuJIq.cjs → ProgressBar-BZqAQTV3.cjs} +1 -1
- package/{ProgressBar-DhRmckYM.js → ProgressBar-BpsvPCKk.js} +12 -12
- package/{Radio-D3RGVrEd.cjs → Radio-B3FBTn4F.cjs} +1 -1
- package/{Radio-Bp_31Z59.js → Radio-LevFYAg4.js} +5 -5
- package/{RangeCalendar-ChfmP_ql.cjs → RangeCalendar-CH0CyBui.cjs} +1 -1
- package/{RangeCalendar-9C96gMvy.js → RangeCalendar-DT_KVd80.js} +3 -3
- package/{SearchField-JaDXLq5W.cjs → SearchField-BX7P7BgV.cjs} +1 -1
- package/{SearchField-DrEdzWAy.js → SearchField-C-TFzcJF.js} +3 -3
- package/Select-C-ykeY_T.js +773 -0
- package/{Select-CpPE78Ke.js → Select-CiCng7ZP.js} +20 -18
- package/Select-D4wi-0Jw.cjs +1 -0
- package/Select-JIDW2mN8.cjs +1 -0
- package/{SelectionIndicator-ant6jeC1.js → SelectionIndicator-C2E23-zO.js} +83 -78
- package/SelectionIndicator-ClG0GpJu.cjs +1 -0
- package/{SelectionManager-uFYC4wpu.cjs → SelectionManager-CNJmHeCF.cjs} +1 -1
- package/{SelectionManager-C469yQeD.js → SelectionManager-DoNLJm8c.js} +1 -1
- package/{Separator-BWAnBMVN.js → Separator-CQfDz_zr.js} +8 -8
- package/{Separator-DbhmtwDa.cjs → Separator-CSyYDGNE.cjs} +1 -1
- package/{Separator-J0pLW4BN.cjs → Separator-DCi4bnBr.cjs} +1 -1
- package/{Separator-B6l5qSpR.js → Separator-DLr4kUJD.js} +2 -2
- package/{TabList-DmkxO7MM.js → TabList-BBmBumm6.js} +4 -4
- package/{TabList-C0tRVI6Q.cjs → TabList-DVzXuGXA.cjs} +1 -1
- package/{Table-BLqjyYKk.cjs → Table-B1nxmW14.cjs} +1 -1
- package/{Table-CyWZO9uf.js → Table-DxqKDp7N.js} +6 -6
- package/{Tag-FDHGu_WP.cjs → Tag-BL-_PONN.cjs} +1 -1
- package/{Tag-DJqYiBLR.js → Tag-DX1X_NZE.js} +52 -52
- package/{TextArea-CZxwvBcS.cjs → TextArea-Bjf8CBp0.cjs} +1 -1
- package/{TextArea-CrY7P18c.js → TextArea-CJPBvogq.js} +4 -4
- package/{TextField-DsN-kBfh.cjs → TextField-DtD9-arA.cjs} +1 -1
- package/{TextField-BWea-IT-.js → TextField-DyR61bjZ.js} +3 -3
- package/{Toast-Di3h8A14.js → Toast-B99bLWnh.js} +1 -1
- package/{ToggleButtonGroup-Bh4hP6Lk.js → ToggleButtonGroup-CFRutAZ4.js} +1 -1
- package/{ToggleButtonGroup-D7r34GCt.cjs → ToggleButtonGroup-dnvnzkaD.cjs} +1 -1
- package/accordion/Accordion.d.ts +5 -0
- package/accordion/AccordionContext.d.ts +2 -3
- package/accordion/AccordionItem.d.ts +5 -1
- package/accordion/index.cjs +1 -1
- package/accordion/index.js +1 -1
- package/assets/AccordionItem.css +1 -1
- package/assets/FieldError.css +1 -1
- package/assets/ListBox.css +1 -0
- package/assets/Popover.css +1 -1
- package/assets/Select.css +1 -1
- package/assets/Select2.css +1 -0
- package/assets/Tag.css +1 -1
- package/button/index.js +1 -1
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +1 -1
- package/card/index.js +1 -1
- package/checkbox/index.cjs +1 -1
- package/checkbox/index.js +1 -1
- package/color-scheme-switch/index.cjs +1 -1
- package/color-scheme-switch/index.js +1 -1
- package/combobox/index.cjs +1 -1
- package/combobox/index.js +1 -1
- package/date-field/index.cjs +1 -1
- package/date-field/index.js +2 -2
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +1 -1
- package/dropdown/index.cjs +1 -1
- package/dropdown/index.js +1 -1
- package/field-error/index.cjs +1 -1
- package/field-error/index.js +1 -1
- package/file-upload/index.cjs +1 -1
- package/file-upload/index.js +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +1 -0
- package/index.js +95 -91
- package/info-banner/index.js +1 -1
- package/intlStrings-Cd44R5hT.js +278 -0
- package/intlStrings-ClBuC6xN.cjs +1 -0
- package/label/index.cjs +1 -1
- package/label/index.js +1 -1
- package/layout/index.js +1 -1
- package/legacy-select/Select.d.ts +8 -0
- package/legacy-select/SelectTrigger.d.ts +10 -0
- package/legacy-select/index.cjs +1 -0
- package/legacy-select/index.d.ts +2 -0
- package/legacy-select/index.js +4 -0
- package/legacy-select/intl/translations.json.d.ts +17 -0
- package/{select → legacy-select}/types.d.ts +1 -1
- package/{select → legacy-select}/useMultiSelect.d.ts +2 -1
- package/list-box/ListBox.d.ts +1 -2
- package/list-box/ListBoxHeader.d.ts +3 -0
- package/list-box/ListBoxItem.d.ts +9 -3
- package/list-box/ListBoxSection.d.ts +1 -1
- package/list-box/index.cjs +1 -1
- package/list-box/index.d.ts +1 -0
- package/list-box/index.js +9 -7
- package/menu/index.cjs +1 -1
- package/menu/index.js +2 -2
- package/modal/index.cjs +1 -1
- package/modal/index.js +2 -2
- package/package.json +1 -1
- package/popover/Popover.d.ts +2 -1
- package/popover/index.cjs +1 -1
- package/popover/index.js +1 -1
- package/progress-bar/index.cjs +1 -1
- package/progress-bar/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/search-field/index.cjs +1 -1
- package/search-field/index.js +1 -1
- package/select/Select.d.ts +33 -4
- package/select/SelectAll.d.ts +1 -0
- package/select/SelectTags.d.ts +4 -0
- package/select/SelectTrigger.d.ts +4 -8
- package/select/SelectValueTag.d.ts +5 -0
- package/select/index.cjs +1 -1
- package/select/index.d.ts +1 -2
- package/select/index.js +1 -1
- package/select/intl/translations.json.d.ts +2 -2
- package/table/index.cjs +1 -1
- package/table/index.js +1 -1
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/textfield/index.cjs +1 -1
- package/textfield/index.js +1 -1
- package/toast/index.js +1 -1
- package/toggle-button/index.cjs +1 -1
- package/toggle-button/index.js +1 -1
- package/{useField-BhJ9dM2g.js → useField-Bx76iuoW.js} +1 -1
- package/{useFilter-BdUU-HQZ.js → useFilter-Dn4vTT3G.js} +1 -1
- package/{useFilter-R2IPvbS8.cjs → useFilter-eOgdlVLd.cjs} +1 -1
- package/{useHasTabbableChild-CIZGg_iG.cjs → useHasTabbableChild-BJ_VejL5.cjs} +1 -1
- package/{useHasTabbableChild-CnpSoDuJ.js → useHasTabbableChild-DpISgPsS.js} +1 -1
- package/{useHighlightSelectionDescription-DPiqOr_Z.js → useHighlightSelectionDescription-Zvo5KTxM.js} +1 -1
- package/{useListState-PZF3ahpk.js → useListState-CP7AKhOX.js} +1 -1
- package/{useListState-DBawAMhF.cjs → useListState-DZFWpD-x.cjs} +1 -1
- package/{useSingleSelectListState-BLRBEJC7.js → useSingleSelectListState-GSY0f4qW.js} +1 -1
- package/{useSingleSelectListState-CNETmoj5.cjs → useSingleSelectListState-JCvbhUVI.cjs} +1 -1
- package/{useTextField-B8pM0p6X.js → useTextField-I3QVGvyX.js} +1 -1
- package/AccordionItem-CAi-XFOc.js +0 -343
- package/AccordionItem-tWS22wDv.cjs +0 -1
- package/ComboBox-Dztk_jtC.cjs +0 -1
- package/ListBoxLoadMoreItem-UX0jFQN4.cjs +0 -1
- package/ListBoxSection-BNBHosou.cjs +0 -1
- package/Popover-CZFi2YGz.js +0 -38
- package/Popover-uYTWBGHa.cjs +0 -1
- package/Select-BCUH-Z7q.cjs +0 -1
- package/SelectionIndicator-BiSN1toV.cjs +0 -1
- package/assets/ListBoxSection.css +0 -1
- /package/{select → legacy-select}/HiddenMultiSelect.d.ts +0 -0
- /package/{select → legacy-select}/MultiSelectValueTag.d.ts +0 -0
- /package/{select → legacy-select}/SelectFieldError.d.ts +0 -0
- /package/{select → legacy-select}/SelectListBox.d.ts +0 -0
- /package/{select → legacy-select}/useMultiSelectListState.d.ts +0 -0
- /package/{select → legacy-select}/useMultiSelectState.d.ts +0 -0
- /package/{select → legacy-select}/utils.d.ts +0 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { jsx as f, jsxs as I } from "react/jsx-runtime";
|
|
2
|
+
import { c as y } from "./clsx-jbLnTBqA.js";
|
|
3
|
+
import { i as j } from "./icon-map-uS87FT_Q.js";
|
|
4
|
+
import b, { useRef as A, useCallback as h, useEffect as P, useMemo as K, forwardRef as v, createContext as m, useContext as w } from "react";
|
|
5
|
+
import { e as N } from "./Button-BbfVT9Yl.js";
|
|
6
|
+
import { $ as G, a as C, f as S, g as q, h as O } from "./utils-D2iKpxcZ.js";
|
|
7
|
+
import { c as E, $ as J, a as B } from "./mergeProps-Ct8m5-xW.js";
|
|
8
|
+
import { $ as D } from "./filterDOMProps-wsa9OcNI.js";
|
|
9
|
+
import { $ as M } from "./useControlledState-u436Wbp1.js";
|
|
10
|
+
import { flushSync as L } from "react-dom";
|
|
11
|
+
import { $ as Q } from "./useEvent-smuTnX4G.js";
|
|
12
|
+
import { $ as U } from "./SSRProvider-D8lZ0o6A.js";
|
|
13
|
+
import { $ as R } from "./useFocusRing-CcxI7nbg.js";
|
|
14
|
+
import { B as X } from "./Button-DdXFHfXw.js";
|
|
15
|
+
import { H as Y } from "./Heading-CCoGfKQ8.js";
|
|
16
|
+
import { C as Z } from "./chevron-down-DmZMdOiC.js";
|
|
17
|
+
import './assets/AccordionItem.css';const ee = "_root_17bdp_1", te = "_contained_17bdp_5", _ = {
|
|
18
|
+
root: ee,
|
|
19
|
+
contained: te
|
|
20
|
+
};
|
|
21
|
+
function ne(i, e, a) {
|
|
22
|
+
let { isDisabled: n } = i, s = E(), d = E(), r = U(), c = A(null), u = h(() => {
|
|
23
|
+
c.current = requestAnimationFrame(() => {
|
|
24
|
+
a.current && a.current.setAttribute("hidden", "until-found");
|
|
25
|
+
}), L(() => {
|
|
26
|
+
e.toggle();
|
|
27
|
+
});
|
|
28
|
+
}, [
|
|
29
|
+
a,
|
|
30
|
+
e
|
|
31
|
+
]);
|
|
32
|
+
Q(a, "beforematch", u);
|
|
33
|
+
let o = A(null);
|
|
34
|
+
return J(() => {
|
|
35
|
+
if (c.current && cancelAnimationFrame(c.current), a.current && !n && !r) {
|
|
36
|
+
let t = a.current;
|
|
37
|
+
o.current == null || typeof t.getAnimations != "function" ? e.isExpanded ? (t.removeAttribute("hidden"), t.style.setProperty("--disclosure-panel-width", "auto"), t.style.setProperty("--disclosure-panel-height", "auto")) : (t.setAttribute("hidden", "until-found"), t.style.setProperty("--disclosure-panel-width", "0px"), t.style.setProperty("--disclosure-panel-height", "0px")) : e.isExpanded !== o.current && (e.isExpanded ? (t.removeAttribute("hidden"), t.style.setProperty("--disclosure-panel-width", t.scrollWidth + "px"), t.style.setProperty("--disclosure-panel-height", t.scrollHeight + "px"), Promise.all(t.getAnimations().map((p) => p.finished)).then(() => {
|
|
38
|
+
t.style.setProperty("--disclosure-panel-width", "auto"), t.style.setProperty("--disclosure-panel-height", "auto");
|
|
39
|
+
}).catch(() => {
|
|
40
|
+
})) : (t.style.setProperty("--disclosure-panel-width", t.scrollWidth + "px"), t.style.setProperty("--disclosure-panel-height", t.scrollHeight + "px"), window.getComputedStyle(t).height, t.style.setProperty("--disclosure-panel-width", "0px"), t.style.setProperty("--disclosure-panel-height", "0px"), Promise.all(t.getAnimations().map((p) => p.finished)).then(() => t.setAttribute("hidden", "until-found")).catch(() => {
|
|
41
|
+
}))), o.current = e.isExpanded;
|
|
42
|
+
}
|
|
43
|
+
}, [
|
|
44
|
+
n,
|
|
45
|
+
a,
|
|
46
|
+
e.isExpanded,
|
|
47
|
+
r
|
|
48
|
+
]), P(() => () => {
|
|
49
|
+
c.current && cancelAnimationFrame(c.current);
|
|
50
|
+
}, []), {
|
|
51
|
+
buttonProps: {
|
|
52
|
+
id: s,
|
|
53
|
+
"aria-expanded": e.isExpanded,
|
|
54
|
+
"aria-controls": d,
|
|
55
|
+
onPress: (t) => {
|
|
56
|
+
!n && t.pointerType !== "keyboard" && e.toggle();
|
|
57
|
+
},
|
|
58
|
+
isDisabled: n,
|
|
59
|
+
onPressStart(t) {
|
|
60
|
+
t.pointerType === "keyboard" && !n && e.toggle();
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
panelProps: {
|
|
64
|
+
id: d,
|
|
65
|
+
// This can be overridden at the panel element level.
|
|
66
|
+
role: "group",
|
|
67
|
+
"aria-labelledby": s,
|
|
68
|
+
"aria-hidden": !e.isExpanded,
|
|
69
|
+
hidden: r || n ? n || !e.isExpanded : void 0
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function ae(i) {
|
|
74
|
+
let [e, a] = M(i.isExpanded, i.defaultExpanded || !1, i.onExpandedChange);
|
|
75
|
+
const n = h(() => {
|
|
76
|
+
a(!0);
|
|
77
|
+
}, [
|
|
78
|
+
a
|
|
79
|
+
]), s = h(() => {
|
|
80
|
+
a(!1);
|
|
81
|
+
}, [
|
|
82
|
+
a
|
|
83
|
+
]), d = h(() => {
|
|
84
|
+
a(!e);
|
|
85
|
+
}, [
|
|
86
|
+
a,
|
|
87
|
+
e
|
|
88
|
+
]);
|
|
89
|
+
return {
|
|
90
|
+
isExpanded: e,
|
|
91
|
+
setExpanded: a,
|
|
92
|
+
expand: n,
|
|
93
|
+
collapse: s,
|
|
94
|
+
toggle: d
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function se(i) {
|
|
98
|
+
let { allowsMultipleExpanded: e = !1, isDisabled: a = !1 } = i, [n, s] = M(K(() => i.expandedKeys ? new Set(i.expandedKeys) : void 0, [
|
|
99
|
+
i.expandedKeys
|
|
100
|
+
]), K(() => i.defaultExpandedKeys ? new Set(i.defaultExpandedKeys) : /* @__PURE__ */ new Set(), [
|
|
101
|
+
i.defaultExpandedKeys
|
|
102
|
+
]), i.onExpandedChange);
|
|
103
|
+
return P(() => {
|
|
104
|
+
if (!e && n.size > 1) {
|
|
105
|
+
let d = n.values().next().value;
|
|
106
|
+
d != null && s(/* @__PURE__ */ new Set([
|
|
107
|
+
d
|
|
108
|
+
]));
|
|
109
|
+
}
|
|
110
|
+
}), {
|
|
111
|
+
allowsMultipleExpanded: e,
|
|
112
|
+
isDisabled: a,
|
|
113
|
+
expandedKeys: n,
|
|
114
|
+
setExpandedKeys: s,
|
|
115
|
+
toggleKey(d) {
|
|
116
|
+
let r;
|
|
117
|
+
e ? (r = new Set(n), r.has(d) ? r.delete(d) : r.add(d)) : r = new Set(n.has(d) ? [] : [
|
|
118
|
+
d
|
|
119
|
+
]), s(r);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const F = /* @__PURE__ */ m(null), ie = /* @__PURE__ */ v(function(e, a) {
|
|
124
|
+
let n = se(e), s = C({
|
|
125
|
+
...e,
|
|
126
|
+
defaultClassName: "react-aria-DisclosureGroup",
|
|
127
|
+
values: {
|
|
128
|
+
isDisabled: n.isDisabled,
|
|
129
|
+
state: n
|
|
130
|
+
}
|
|
131
|
+
}), d = D(e, {
|
|
132
|
+
global: !0
|
|
133
|
+
});
|
|
134
|
+
return /* @__PURE__ */ b.createElement("div", {
|
|
135
|
+
...d,
|
|
136
|
+
...s,
|
|
137
|
+
ref: a,
|
|
138
|
+
"data-disabled": e.isDisabled || void 0
|
|
139
|
+
}, /* @__PURE__ */ b.createElement(F.Provider, {
|
|
140
|
+
value: n
|
|
141
|
+
}, s.children));
|
|
142
|
+
}), de = /* @__PURE__ */ m(null), re = /* @__PURE__ */ m(null), W = /* @__PURE__ */ m(null), oe = /* @__PURE__ */ v(function(e, a) {
|
|
143
|
+
[e, a] = G(e, a, de);
|
|
144
|
+
let n = w(F), { id: s, ...d } = e, r = E();
|
|
145
|
+
s || (s = r);
|
|
146
|
+
let c = n ? n.expandedKeys.has(s) : e.isExpanded, u = ae({
|
|
147
|
+
...e,
|
|
148
|
+
isExpanded: c,
|
|
149
|
+
onExpandedChange(H) {
|
|
150
|
+
var $;
|
|
151
|
+
n && n.toggleKey(s), ($ = e.onExpandedChange) === null || $ === void 0 || $.call(e, H);
|
|
152
|
+
}
|
|
153
|
+
}), o = b.useRef(null), t = e.isDisabled || (n == null ? void 0 : n.isDisabled) || !1, { buttonProps: p, panelProps: g } = ne({
|
|
154
|
+
...e,
|
|
155
|
+
isExpanded: c,
|
|
156
|
+
isDisabled: t
|
|
157
|
+
}, u, o), { isFocusVisible: x, focusProps: V } = R({
|
|
158
|
+
within: !0
|
|
159
|
+
}), k = C({
|
|
160
|
+
...e,
|
|
161
|
+
id: void 0,
|
|
162
|
+
defaultClassName: "react-aria-Disclosure",
|
|
163
|
+
values: {
|
|
164
|
+
isExpanded: u.isExpanded,
|
|
165
|
+
isDisabled: t,
|
|
166
|
+
isFocusVisibleWithin: x,
|
|
167
|
+
state: u
|
|
168
|
+
}
|
|
169
|
+
}), z = D(d, {
|
|
170
|
+
global: !0
|
|
171
|
+
});
|
|
172
|
+
return /* @__PURE__ */ b.createElement(S, {
|
|
173
|
+
values: [
|
|
174
|
+
[
|
|
175
|
+
N,
|
|
176
|
+
{
|
|
177
|
+
slots: {
|
|
178
|
+
[q]: {},
|
|
179
|
+
trigger: p
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
[
|
|
184
|
+
W,
|
|
185
|
+
{
|
|
186
|
+
panelProps: g,
|
|
187
|
+
panelRef: o
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
[
|
|
191
|
+
re,
|
|
192
|
+
u
|
|
193
|
+
]
|
|
194
|
+
]
|
|
195
|
+
}, /* @__PURE__ */ b.createElement("div", {
|
|
196
|
+
...B(z, k, V),
|
|
197
|
+
ref: a,
|
|
198
|
+
"data-expanded": u.isExpanded || void 0,
|
|
199
|
+
"data-disabled": t || void 0,
|
|
200
|
+
"data-focus-visible-within": x || void 0
|
|
201
|
+
}, k.children));
|
|
202
|
+
}), le = /* @__PURE__ */ v(function(e, a) {
|
|
203
|
+
let { role: n = "group" } = e, { panelProps: s, panelRef: d } = w(W), { isFocusVisible: r, focusProps: c } = R({
|
|
204
|
+
within: !0
|
|
205
|
+
}), u = C({
|
|
206
|
+
...e,
|
|
207
|
+
defaultClassName: "react-aria-DisclosurePanel",
|
|
208
|
+
values: {
|
|
209
|
+
isFocusVisibleWithin: r
|
|
210
|
+
}
|
|
211
|
+
}), o = D(e, {
|
|
212
|
+
global: !0
|
|
213
|
+
});
|
|
214
|
+
return /* @__PURE__ */ b.createElement("div", {
|
|
215
|
+
...B(o, u, s, c),
|
|
216
|
+
ref: O(a, d),
|
|
217
|
+
role: n,
|
|
218
|
+
"data-focus-visible-within": r || void 0
|
|
219
|
+
}, /* @__PURE__ */ b.createElement(S, {
|
|
220
|
+
values: [
|
|
221
|
+
[
|
|
222
|
+
N,
|
|
223
|
+
null
|
|
224
|
+
]
|
|
225
|
+
]
|
|
226
|
+
}, e.children));
|
|
227
|
+
}), T = m(void 0), je = ({
|
|
228
|
+
variant: i,
|
|
229
|
+
children: e,
|
|
230
|
+
className: a,
|
|
231
|
+
isContained: n,
|
|
232
|
+
size: s = "large",
|
|
233
|
+
...d
|
|
234
|
+
}) => {
|
|
235
|
+
const r = n || i === "contained";
|
|
236
|
+
return /* @__PURE__ */ f(T.Provider, { value: { isContained: r, size: s }, children: /* @__PURE__ */ f(
|
|
237
|
+
ie,
|
|
238
|
+
{
|
|
239
|
+
className: y(
|
|
240
|
+
_.root,
|
|
241
|
+
r ? _.contained : _.uncontained,
|
|
242
|
+
a
|
|
243
|
+
),
|
|
244
|
+
...d,
|
|
245
|
+
children: e
|
|
246
|
+
}
|
|
247
|
+
) });
|
|
248
|
+
}, ce = "_item_bbrk2_1", ue = "_contained_bbrk2_18", fe = "_medium_bbrk2_28", pe = "_success_bbrk2_33", be = "_warning_bbrk2_39", me = "_info_bbrk2_45", ge = "_important_bbrk2_51", xe = "_triggerButton_bbrk2_62", he = "_triggerText_bbrk2_66", $e = "_trigger_bbrk2_62", _e = "_triggerMainContent_bbrk2_79", ye = "_chevronIcon_bbrk2_96", Ee = "_statusIcon_bbrk2_102", Pe = "_panel_bbrk2_120", ve = "_content_bbrk2_128", we = "_hasBackground_bbrk2_133", Ce = "_header_bbrk2_137", l = {
|
|
249
|
+
item: ce,
|
|
250
|
+
contained: ue,
|
|
251
|
+
medium: fe,
|
|
252
|
+
success: pe,
|
|
253
|
+
warning: be,
|
|
254
|
+
info: me,
|
|
255
|
+
important: ge,
|
|
256
|
+
triggerButton: xe,
|
|
257
|
+
triggerText: he,
|
|
258
|
+
trigger: $e,
|
|
259
|
+
triggerMainContent: _e,
|
|
260
|
+
" ": "_ _bbrk2_1",
|
|
261
|
+
chevronIcon: ye,
|
|
262
|
+
statusIcon: Ee,
|
|
263
|
+
panel: Pe,
|
|
264
|
+
content: ve,
|
|
265
|
+
hasBackground: we,
|
|
266
|
+
header: Ce
|
|
267
|
+
}, Ge = ({
|
|
268
|
+
title: i,
|
|
269
|
+
children: e,
|
|
270
|
+
className: a,
|
|
271
|
+
headingLevel: n = "h2",
|
|
272
|
+
type: s,
|
|
273
|
+
hasBackground: d = !0,
|
|
274
|
+
size: r = "large",
|
|
275
|
+
isContained: c,
|
|
276
|
+
...u
|
|
277
|
+
}) => {
|
|
278
|
+
const o = w(T), t = c ?? (o == null ? void 0 : o.isContained) ?? !1, p = typeof i == "object";
|
|
279
|
+
P(() => {
|
|
280
|
+
s && !t && console.warn(
|
|
281
|
+
"AccordionItem: When 'type' is set, it is recommended to also set 'isContained' to true for visual consistency."
|
|
282
|
+
);
|
|
283
|
+
}, [s, t]);
|
|
284
|
+
const g = s ? j[s] : null, x = g ? /* @__PURE__ */ f(
|
|
285
|
+
g,
|
|
286
|
+
{
|
|
287
|
+
size: 20,
|
|
288
|
+
className: l.statusIcon
|
|
289
|
+
}
|
|
290
|
+
) : null;
|
|
291
|
+
return /* @__PURE__ */ I(
|
|
292
|
+
oe,
|
|
293
|
+
{
|
|
294
|
+
...u,
|
|
295
|
+
className: y(
|
|
296
|
+
l.item,
|
|
297
|
+
s && l[s],
|
|
298
|
+
(r === "medium" || (o == null ? void 0 : o.size) === "medium") && l.medium,
|
|
299
|
+
t && l.contained,
|
|
300
|
+
a
|
|
301
|
+
),
|
|
302
|
+
children: [
|
|
303
|
+
/* @__PURE__ */ f("div", { className: l.trigger, children: /* @__PURE__ */ I(
|
|
304
|
+
X,
|
|
305
|
+
{
|
|
306
|
+
className: l.triggerButton,
|
|
307
|
+
slot: "trigger",
|
|
308
|
+
variant: "icon",
|
|
309
|
+
children: [
|
|
310
|
+
/* @__PURE__ */ f(
|
|
311
|
+
Z,
|
|
312
|
+
{
|
|
313
|
+
size: 20,
|
|
314
|
+
className: l.chevronIcon
|
|
315
|
+
}
|
|
316
|
+
),
|
|
317
|
+
/* @__PURE__ */ f("div", { className: l.triggerMainContent, children: p ? i : /* @__PURE__ */ f(
|
|
318
|
+
Y,
|
|
319
|
+
{
|
|
320
|
+
level: 3,
|
|
321
|
+
elementType: n,
|
|
322
|
+
className: l.triggerText,
|
|
323
|
+
children: i
|
|
324
|
+
}
|
|
325
|
+
) }),
|
|
326
|
+
x
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
) }),
|
|
330
|
+
/* @__PURE__ */ f(le, { className: l.panel, children: /* @__PURE__ */ f(
|
|
331
|
+
"div",
|
|
332
|
+
{
|
|
333
|
+
className: y(
|
|
334
|
+
l.content,
|
|
335
|
+
d && l.hasBackground
|
|
336
|
+
),
|
|
337
|
+
children: e
|
|
338
|
+
}
|
|
339
|
+
) })
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
);
|
|
343
|
+
};
|
|
344
|
+
export {
|
|
345
|
+
Ge as A,
|
|
346
|
+
je as a
|
|
347
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('./assets/AccordionItem.css');const b=require("react/jsx-runtime"),E=require("./clsx-DKOfLqne.cjs"),S=require("./icon-map-9XcghDra.cjs"),d=require("react"),v=require("./Button-1sEX8jKn.cjs"),p=require("./utils-CtICjCYt.cjs"),$=require("./mergeProps-Du5A8xi8.cjs"),y=require("./filterDOMProps-RRlKPKX0.cjs"),C=require("./useControlledState-D0L6S_5r.cjs"),K=require("react-dom"),M=require("./useEvent-C125NAue.cjs"),N=require("./SSRProvider-DZRLwxPS.cjs"),w=require("./useFocusRing-C-XVcAE5.cjs"),j=require("./Button-BEWKXjlP.cjs"),B=require("./Heading-x7y3xadc.cjs"),F=require("./chevron-down-5hFlg_lR.cjs"),W="_root_17bdp_1",T="_contained_17bdp_5",_={root:W,contained:T};function V(r,e,s){let{isDisabled:n}=r,a=$.$bdb11010cef70236$export$f680877a34711e37(),i=$.$bdb11010cef70236$export$f680877a34711e37(),o=N.$b5e257d569688ac6$export$535bd6ca7f90a273(),u=d.useRef(null),f=d.useCallback(()=>{u.current=requestAnimationFrame(()=>{s.current&&s.current.setAttribute("hidden","until-found")}),K.flushSync(()=>{e.toggle()})},[s,e]);M.$e9faafb641e167db$export$90fc3a17d93f704c(s,"beforematch",f);let c=d.useRef(null);return $.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{if(u.current&&cancelAnimationFrame(u.current),s.current&&!n&&!o){let t=s.current;c.current==null||typeof t.getAnimations!="function"?e.isExpanded?(t.removeAttribute("hidden"),t.style.setProperty("--disclosure-panel-width","auto"),t.style.setProperty("--disclosure-panel-height","auto")):(t.setAttribute("hidden","until-found"),t.style.setProperty("--disclosure-panel-width","0px"),t.style.setProperty("--disclosure-panel-height","0px")):e.isExpanded!==c.current&&(e.isExpanded?(t.removeAttribute("hidden"),t.style.setProperty("--disclosure-panel-width",t.scrollWidth+"px"),t.style.setProperty("--disclosure-panel-height",t.scrollHeight+"px"),Promise.all(t.getAnimations().map(x=>x.finished)).then(()=>{t.style.setProperty("--disclosure-panel-width","auto"),t.style.setProperty("--disclosure-panel-height","auto")}).catch(()=>{})):(t.style.setProperty("--disclosure-panel-width",t.scrollWidth+"px"),t.style.setProperty("--disclosure-panel-height",t.scrollHeight+"px"),window.getComputedStyle(t).height,t.style.setProperty("--disclosure-panel-width","0px"),t.style.setProperty("--disclosure-panel-height","0px"),Promise.all(t.getAnimations().map(x=>x.finished)).then(()=>t.setAttribute("hidden","until-found")).catch(()=>{}))),c.current=e.isExpanded}},[n,s,e.isExpanded,o]),d.useEffect(()=>()=>{u.current&&cancelAnimationFrame(u.current)},[]),{buttonProps:{id:a,"aria-expanded":e.isExpanded,"aria-controls":i,onPress:t=>{!n&&t.pointerType!=="keyboard"&&e.toggle()},isDisabled:n,onPressStart(t){t.pointerType==="keyboard"&&!n&&e.toggle()}},panelProps:{id:i,role:"group","aria-labelledby":a,"aria-hidden":!e.isExpanded,hidden:o||n?n||!e.isExpanded:void 0}}}function z(r){let[e,s]=C.$458b0a5536c1a7cf$export$40bfa8c7b0832715(r.isExpanded,r.defaultExpanded||!1,r.onExpandedChange);const n=d.useCallback(()=>{s(!0)},[s]),a=d.useCallback(()=>{s(!1)},[s]),i=d.useCallback(()=>{s(!e)},[s,e]);return{isExpanded:e,setExpanded:s,expand:n,collapse:a,toggle:i}}function H(r){let{allowsMultipleExpanded:e=!1,isDisabled:s=!1}=r,[n,a]=C.$458b0a5536c1a7cf$export$40bfa8c7b0832715(d.useMemo(()=>r.expandedKeys?new Set(r.expandedKeys):void 0,[r.expandedKeys]),d.useMemo(()=>r.defaultExpandedKeys?new Set(r.defaultExpandedKeys):new Set,[r.defaultExpandedKeys]),r.onExpandedChange);return d.useEffect(()=>{if(!e&&n.size>1){let i=n.values().next().value;i!=null&&a(new Set([i]))}}),{allowsMultipleExpanded:e,isDisabled:s,expandedKeys:n,setExpandedKeys:a,toggleKey(i){let o;e?(o=new Set(n),o.has(i)?o.delete(i):o.add(i)):o=new Set(n.has(i)?[]:[i]),a(o)}}}const k=d.createContext(null),O=d.forwardRef(function(e,s){let n=H(e),a=p.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,defaultClassName:"react-aria-DisclosureGroup",values:{isDisabled:n.isDisabled,state:n}}),i=y.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{global:!0});return d.createElement("div",{...i,...a,ref:s,"data-disabled":e.isDisabled||void 0},d.createElement(k.Provider,{value:n},a.children))}),G=d.createContext(null),J=d.createContext(null),D=d.createContext(null),L=d.forwardRef(function(e,s){[e,s]=p.$64fa3d84918910a7$export$29f1550f4b0d4415(e,s,G);let n=d.useContext(k),{id:a,...i}=e,o=$.$bdb11010cef70236$export$f680877a34711e37();a||(a=o);let u=n?n.expandedKeys.has(a):e.isExpanded,f=z({...e,isExpanded:u,onExpandedChange(q){var m;n&&n.toggleKey(a),(m=e.onExpandedChange)===null||m===void 0||m.call(e,q)}}),c=d.useRef(null),t=e.isDisabled||(n==null?void 0:n.isDisabled)||!1,{buttonProps:x,panelProps:g}=V({...e,isExpanded:u,isDisabled:t},f,c),{isFocusVisible:h,focusProps:I}=w.$f7dceffc5ad7768b$export$4e328f61c538687f({within:!0}),P=p.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,id:void 0,defaultClassName:"react-aria-Disclosure",values:{isExpanded:f.isExpanded,isDisabled:t,isFocusVisibleWithin:h,state:f}}),R=y.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(i,{global:!0});return d.createElement(p.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[v.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{slots:{[p.$64fa3d84918910a7$export$c62b8e45d58ddad9]:{},trigger:x}}],[D,{panelProps:g,panelRef:c}],[J,f]]},d.createElement("div",{...$.$3ef42575df84b30b$export$9d1611c77c2fe928(R,P,I),ref:s,"data-expanded":f.isExpanded||void 0,"data-disabled":t||void 0,"data-focus-visible-within":h||void 0},P.children))}),Q=d.forwardRef(function(e,s){let{role:n="group"}=e,{panelProps:a,panelRef:i}=d.useContext(D),{isFocusVisible:o,focusProps:u}=w.$f7dceffc5ad7768b$export$4e328f61c538687f({within:!0}),f=p.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,defaultClassName:"react-aria-DisclosurePanel",values:{isFocusVisibleWithin:o}}),c=y.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{global:!0});return d.createElement("div",{...$.$3ef42575df84b30b$export$9d1611c77c2fe928(c,f,a,u),ref:p.$5dc95899b306f630$export$c9058316764c140e(s,i),role:n,"data-focus-visible-within":o||void 0},d.createElement(p.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[v.$d2b4bc8c273e7be6$export$24d547caef80ccd1,null]]},e.children))}),A=d.createContext(void 0),U=({variant:r,children:e,className:s,isContained:n,size:a="large",...i})=>{const o=n||r==="contained";return b.jsx(A.Provider,{value:{isContained:o,size:a},children:b.jsx(O,{className:E.clsx(_.root,o?_.contained:_.uncontained,s),...i,children:e})})},X="_item_bbrk2_1",Y="_contained_bbrk2_18",Z="_medium_bbrk2_28",ee="_success_bbrk2_33",te="_warning_bbrk2_39",ne="_info_bbrk2_45",se="_important_bbrk2_51",de="_triggerButton_bbrk2_62",ae="_triggerText_bbrk2_66",re="_trigger_bbrk2_62",ie="_triggerMainContent_bbrk2_79",oe="_chevronIcon_bbrk2_96",ce="_statusIcon_bbrk2_102",le="_panel_bbrk2_120",ue="_content_bbrk2_128",fe="_hasBackground_bbrk2_133",be="_header_bbrk2_137",l={item:X,contained:Y,medium:Z,success:ee,warning:te,info:ne,important:se,triggerButton:de,triggerText:ae,trigger:re,triggerMainContent:ie," ":"_ _bbrk2_1",chevronIcon:oe,statusIcon:ce,panel:le,content:ue,hasBackground:fe,header:be},pe=({title:r,children:e,className:s,headingLevel:n="h2",type:a,hasBackground:i=!0,size:o="large",isContained:u,...f})=>{const c=d.useContext(A),t=u??(c==null?void 0:c.isContained)??!1,x=typeof r=="object";d.useEffect(()=>{a&&!t&&console.warn("AccordionItem: When 'type' is set, it is recommended to also set 'isContained' to true for visual consistency.")},[a,t]);const g=a?S.iconMap[a]:null,h=g?b.jsx(g,{size:20,className:l.statusIcon}):null;return b.jsxs(L,{...f,className:E.clsx(l.item,a&&l[a],(o==="medium"||(c==null?void 0:c.size)==="medium")&&l.medium,t&&l.contained,s),children:[b.jsx("div",{className:l.trigger,children:b.jsxs(j.Button,{className:l.triggerButton,slot:"trigger",variant:"icon",children:[b.jsx(F.ChevronDown,{size:20,className:l.chevronIcon}),b.jsx("div",{className:l.triggerMainContent,children:x?r:b.jsx(B.Heading,{level:3,elementType:n,className:l.triggerText,children:r})}),h]})}),b.jsx(Q,{className:l.panel,children:b.jsx("div",{className:E.clsx(l.content,i&&l.hasBackground),children:e})})]})};exports.Accordion=U;exports.AccordionItem=pe;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o, jsxs as a, Fragment as l } from "react/jsx-runtime";
|
|
2
2
|
import { B as r } from "./Button.module-Cm0H98vy.js";
|
|
3
|
-
import { $ as p } from "./Button-
|
|
3
|
+
import { $ as p } from "./Button-BbfVT9Yl.js";
|
|
4
4
|
import { c as u } from "./clsx-jbLnTBqA.js";
|
|
5
5
|
const b = ({
|
|
6
6
|
variant: e = "primary",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
## 15.1.0 (2025-10-30)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **accordion:** add size prop ([#896](https://github.com/migrationsverket/midas/pull/896))
|
|
6
|
+
|
|
7
|
+
# 15.0.0 (2025-10-28)
|
|
8
|
+
|
|
9
|
+
### 🚀 Features
|
|
10
|
+
|
|
11
|
+
- ⚠️ **select:** replace custom select with new RAC based select
|
|
12
|
+
- **select:** use midas popover
|
|
13
|
+
- **select:** update type imports
|
|
14
|
+
- **select:** add sections
|
|
15
|
+
- **select:** boilerplate for RAC select implementation
|
|
16
|
+
|
|
17
|
+
### 🩹 Fixes
|
|
18
|
+
|
|
19
|
+
- **select:** adjust selectAll styling
|
|
20
|
+
- **list-box:** adjust section header styling
|
|
21
|
+
- **list-box:** loosen type definitions
|
|
22
|
+
- **list-box:** adjust vertical padding
|
|
23
|
+
- **tag:** add visible keyboard focus for all tags
|
|
24
|
+
- **field-error:** remove margin from aria hidden siblings
|
|
25
|
+
|
|
26
|
+
### ⚠️ Breaking Changes
|
|
27
|
+
|
|
28
|
+
- ⚠️ **select:** replace custom select with new RAC based select
|
|
29
|
+
|
|
1
30
|
## 14.1.0 (2025-10-27)
|
|
2
31
|
|
|
3
32
|
### 🚀 Features
|
|
@@ -2,7 +2,7 @@ import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as n } from "./clsx-jbLnTBqA.js";
|
|
3
3
|
import * as e from "react";
|
|
4
4
|
import { H as m } from "./Heading-CCoGfKQ8.js";
|
|
5
|
-
import { $ as _ } from "./Button-
|
|
5
|
+
import { $ as _ } from "./Button-BbfVT9Yl.js";
|
|
6
6
|
import { $ as C } from "./Link-l-nMP-Zd.js";
|
|
7
7
|
import { A as x } from "./arrow-right-uemUGIg8.js";
|
|
8
8
|
import './assets/Card.css';const A = "_card_1x9yi_1", h = "_horizontal_1x9yi_11", I = "_cardLink_1x9yi_16", p = "_cardContent_1x9yi_21", u = "_cardActions_1x9yi_40", f = "_cardActionArea_1x9yi_50", z = "_cardImage_1x9yi_83", $ = "_cardLinkIcon_1x9yi_115", r = {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as s, jsxs as g } from "react/jsx-runtime";
|
|
2
|
-
import { a as P, L as V } from "./Label-
|
|
2
|
+
import { a as P, L as V } from "./Label-FfEnd4ai.js";
|
|
3
3
|
import { T as S } from "./Text-BBFWBNAH.js";
|
|
4
4
|
import * as m from "react";
|
|
5
5
|
import { useState as C, useRef as y } from "react";
|
|
6
6
|
import { $ as p, C as v, s as D, a as I } from "./Checkbox-CdN1D5pD.js";
|
|
7
|
-
import { $ as R, F as k } from "./FieldError-
|
|
7
|
+
import { $ as R, F as k } from "./FieldError-CIxlNQCM.js";
|
|
8
8
|
import { $ as F, c as A } from "./useFormValidation-By7G-T7y.js";
|
|
9
9
|
import { $ as E } from "./useControlledState-u436Wbp1.js";
|
|
10
10
|
import { a as M } from "./mergeProps-Ct8m5-xW.js";
|
|
11
11
|
import { $ as O } from "./filterDOMProps-wsa9OcNI.js";
|
|
12
|
-
import { $ as W } from "./useField-
|
|
12
|
+
import { $ as W } from "./useField-Bx76iuoW.js";
|
|
13
13
|
import { $ as B } from "./useFocusWithin-DhXBuB2O.js";
|
|
14
14
|
import { u as L } from "./useLocalizedStringFormatter-aOhh7wdl.js";
|
|
15
15
|
function G(e, a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("react/jsx-runtime"),m=require("./Label-
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),m=require("./Label-DpY2SZdQ.cjs"),C=require("./Text-D5OSv6Uv.cjs"),$=require("react"),h=require("./Checkbox-BgrLxY6P.cjs"),g=require("./FieldError-JWxR_EqN.cjs"),P=require("./useFormValidation-DV2Ioblb.cjs"),y=require("./useControlledState-D0L6S_5r.cjs"),j=require("./mergeProps-Du5A8xi8.cjs"),q=require("./filterDOMProps-RRlKPKX0.cjs"),k=require("./useField-DvszkIMx.cjs"),D=require("./useFocusWithin-GBjoTL5o.cjs"),F=require("./useLocalizedStringFormatter-BSac43NO.cjs");function O(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const v=O($);function R(e,t){let{isDisabled:a,name:n,form:u,validationBehavior:c="aria"}=e,{isInvalid:r,validationErrors:d,validationDetails:l}=t.displayValidation,{labelProps:f,fieldProps:x,descriptionProps:i,errorMessageProps:o}=k.$2baaea4c71418dea$export$294aa081a6c6f55d({...e,labelElementType:"span",isInvalid:r,errorMessage:e.errorMessage||d});h.$1ae600c947479353$export$ec98120685d4f57d.set(t,{name:n,form:u,descriptionId:i.id,errorMessageId:o.id,validationBehavior:c});let b=q.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{labelable:!0}),{focusWithinProps:S}=D.$9ab94262bd0047c7$export$420e68273165f4ec({onBlurWithin:e.onBlur,onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange});return{groupProps:j.$3ef42575df84b30b$export$9d1611c77c2fe928(b,{role:"group","aria-disabled":a||void 0,...x,...S}),labelProps:f,descriptionProps:i,errorMessageProps:o,isInvalid:r,validationErrors:d,validationDetails:l}}function I(e={}){let[t,a]=y.$458b0a5536c1a7cf$export$40bfa8c7b0832715(e.value,e.defaultValue||[],e.onChange),[n]=$.useState(t),u=!!e.isRequired&&t.length===0,c=$.useRef(new Map),r=P.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...e,value:t}),d=r.displayValidation.isInvalid;var l,f;return{...r,value:t,defaultValue:(l=e.defaultValue)!==null&&l!==void 0?l:n,setValue(i){e.isReadOnly||e.isDisabled||a(i)},isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isSelected(i){return t.includes(i)},addValue(i){e.isReadOnly||e.isDisabled||t.includes(i)||(t=t.concat(i),a(t))},removeValue(i){e.isReadOnly||e.isDisabled||t.includes(i)&&a(t.filter(o=>o!==i))},toggleValue(i){e.isReadOnly||e.isDisabled||(t.includes(i)?a(t.filter(o=>o!==i)):a(t.concat(i)))},setInvalid(i,o){let b=new Map(c.current);o.isInvalid?b.set(i,o):b.delete(i),c.current=b,r.updateValidation(P.$e5be200c675c3b3a$export$75ee7c75d68f5b0e(...b.values()))},validationState:(f=e.validationState)!==null&&f!==void 0?f:d?"invalid":null,isInvalid:d,isRequired:u}}const M=(e,{value:t})=>{const a=v.Children.toArray(e).filter(l=>v.isValidElement(l)&&l.type===h.Checkbox),n=v.Children.count(a),u=v.Children.toArray(e).filter(l=>v.isValidElement(l)).filter(l=>!!l&&l.type===h.Checkbox).map(l=>l.props.value),c=t.length===0,r=t.length===n;return{allSelected:r,someSelected:!c&&!r,checkboxValues:u}},V=({state:e,errorMessage:t})=>s.jsx(g.$ee014567cb39d3f0$export$ff05c3ac10437e03.Provider,{value:e.displayValidation,children:s.jsx(g.FieldError,{children:t})}),E={selectAll:"Select all"},A={selectAll:"Välj alla"},W={en:E,sv:A};function _(e){const t=I(e),a=F.useLocalizedStringFormatter(W),{groupProps:n,labelProps:u,descriptionProps:c}=R(e,t),{allSelected:r,someSelected:d,checkboxValues:l}=M(e.children,t),f=x=>{t.setValue(x?l:[])};return s.jsxs("div",{...n,className:h.styles.checkboxGroup,children:[s.jsx(m.LabelWrapper,{popover:e.popover,children:e.label&&s.jsx(m.Label,{...u,children:e.label})}),e.description&&s.jsx(C.Text,{slot:"description",...c,children:e.description}),e.errorPosition==="top"&&s.jsx(V,{...e,state:t}),e.showSelectAll&&s.jsx(h.Checkbox,{isSelected:r,isIndeterminate:d,onChange:f,children:e.selectAllLabel||a.format("selectAll")}),s.jsx(h.CheckboxGroupContext.Provider,{value:t,children:e.children}),e.errorPosition==="bottom"&&s.jsx(V,{...e,state:t})]})}exports.CheckboxGroup=_;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";require('./assets/ColorSchemeSwitch.css');const e=require("react/jsx-runtime"),m=require("react"),s=require("./ToggleButtonGroup-
|
|
1
|
+
"use strict";require('./assets/ColorSchemeSwitch.css');const e=require("react/jsx-runtime"),m=require("react"),s=require("./ToggleButtonGroup-dnvnzkaD.cjs"),i=require("./createLucideIcon-CTVXwe6i.cjs"),a=require("./VisuallyHidden-BMelU6B0.cjs"),g=require("./useLocalizedStringFormatter-BSac43NO.cjs");function p(t){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(c,o,n.get?n:{enumerable:!0,get:()=>t[o]})}}return c.default=t,Object.freeze(c)}const u=p(m);/**
|
|
2
2
|
* @license lucide-react v0.525.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
|
-
import { a as y, T as a } from "./ToggleButtonGroup-
|
|
3
|
+
import { a as y, T as a } from "./ToggleButtonGroup-CFRutAZ4.js";
|
|
4
4
|
import { c as d } from "./createLucideIcon-XRdN60yz.js";
|
|
5
5
|
import { $ as r } from "./VisuallyHidden-DuW70K-5.js";
|
|
6
6
|
import { u as g } from "./useLocalizedStringFormatter-aOhh7wdl.js";
|