@midas-ds/components 12.1.0 → 13.0.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-Bq8nUKg4.cjs +1 -0
- package/{AccordionItem-C9dBt-tQ.js → AccordionItem-D2Y0gJZB.js} +109 -109
- package/{Breadcrumbs-DUcHHI_2.cjs → Breadcrumbs-BQLxFZVm.cjs} +1 -1
- package/{Breadcrumbs-BAHJMPsu.js → Breadcrumbs-C6B4fyk3.js} +1 -1
- package/{Button-DYcmg49Z.js → Button-CUMHt7MG.js} +1 -1
- package/{Button-DrL5Jv-s.cjs → Button-D_tRdPW9.cjs} +1 -1
- package/Button.module-BT9wZenr.cjs +1 -0
- package/Button.module-CGIVvzVm.js +14 -0
- package/{ButtonGroup-WZZDPu9Z.js → ButtonGroup-DC8925jD.js} +1 -1
- package/{ButtonGroup-ClYTgaRc.cjs → ButtonGroup-zx-9mxbJ.cjs} +1 -1
- package/CHANGELOG.md +59 -0
- package/Card-D2UbrhDW.js +131 -0
- package/Card-UolcSL5O.cjs +1 -0
- package/{Checkbox-BtM2rFh9.js → Checkbox-DTuryJdM.js} +14 -14
- package/{Checkbox-CvdIG43J.cjs → Checkbox-dtZfsSfx.cjs} +1 -1
- package/{CheckboxGroup-CjcDYBRk.js → CheckboxGroup-BmCK0XG9.js} +2 -2
- package/{CheckboxGroup-C94as9Xt.cjs → CheckboxGroup-DbmYdQEv.cjs} +1 -1
- package/{ColorSchemeSwitch-C4PMYeD5.js → ColorSchemeSwitch-CgZfgCG4.js} +1 -1
- package/{ColorSchemeSwitch-CKcoGZM1.cjs → ColorSchemeSwitch-D5juAHPc.cjs} +1 -1
- package/{ComboBox-BWXJZyOR.js → ComboBox-Cl6jBB-8.js} +85 -85
- package/{ComboBox-B2EmfOyr.cjs → ComboBox-CvD0t2T2.cjs} +1 -1
- package/{DateField-CcQJYDLD.js → DateField-D2IqGDL5.js} +2 -2
- package/{DateField-IpCiF81R.cjs → DateField-DJAQH95Q.cjs} +1 -1
- package/{DateInputDivider-Cf5GZHlM.cjs → DateInputDivider-BnSo_Aox.cjs} +1 -1
- package/{DateInputDivider-CXkUdlzc.js → DateInputDivider-LxS0Kw1H.js} +2 -2
- package/{DateRangePicker-B2BJO1KC.js → DateRangePicker-CNPXbRqx.js} +4 -4
- package/{DateRangePicker-Dfwe9RhJ.cjs → DateRangePicker-CljQy8oD.cjs} +2 -2
- package/{Dialog-P3frHOdq.js → Dialog-COpVrq8B.js} +21 -21
- package/{Dialog-DgJobm71.cjs → Dialog-doGnVsJJ.cjs} +1 -1
- package/{Dropdown-DJ2vWAqk.cjs → Dropdown-C_W6Sizy.cjs} +1 -1
- package/{Dropdown-CIvWpN3v.js → Dropdown-DbeUiGYo.js} +1 -1
- package/{Grid-s8ovKDi8.js → Grid-BmX6arAO.js} +1 -1
- package/{Grid-WbEkSCGh.cjs → Grid-Bn1bCTH8.cjs} +1 -1
- package/GridItem-BtO9kCX9.js +237 -0
- package/GridItem-luVsL9lu.cjs +1 -0
- package/InfoBanner-C82hcpzj.cjs +1 -0
- package/InfoBanner-Dz_0wVSa.js +83 -0
- package/{Label-BG7G0iyG.js → Label-C5TNJ0Ku.js} +1 -1
- package/{Label-C00qz3kQ.cjs → Label-Dp85Vue3.cjs} +1 -1
- package/{Layout-CG-Qxr_1.js → Layout-B-A-s7B0.js} +156 -156
- package/Layout-DlE30BHE.cjs +16 -0
- package/Link-ePZ3nrAW.cjs +6 -0
- package/{Link-BtxKZ0h3.js → Link-lO-Ke97K.js} +20 -20
- package/{LinkButton-D3EnZ65v.js → LinkButton-CJyZh3BS.js} +26 -26
- package/LinkButton-Cw73pOM2.cjs +6 -0
- package/{ListBoxLoadMoreItem-Ceo73a2q.cjs → ListBoxLoadMoreItem-3jGpi90m.cjs} +1 -1
- package/{ListBoxLoadMoreItem-W11V-Lef.js → ListBoxLoadMoreItem-CIFJ3liN.js} +2 -2
- package/{ListBoxSection-BCPv9H50.js → ListBoxSection-BBY8-t3_.js} +11 -11
- package/{ListBoxSection-Dx75ZinL.cjs → ListBoxSection-BeDwnVZx.cjs} +1 -1
- package/{ProgressBar-CdXHEJh6.js → ProgressBar-BYb9d2kC.js} +1 -1
- package/{ProgressBar-CjuHokVZ.cjs → ProgressBar-CgbE08QT.cjs} +1 -1
- package/{Radio-Bll-7H8O.cjs → Radio-BagVPvJX.cjs} +1 -1
- package/{Radio-DoWx2AE1.js → Radio-C98ly9yx.js} +14 -14
- package/{RangeCalendar-D7eFVAPP.js → RangeCalendar-Bi9jc61A.js} +61 -61
- package/{RangeCalendar-A4WQIG7P.cjs → RangeCalendar-KcJooXYf.cjs} +2 -2
- package/{SearchField-BbrUZpQm.cjs → SearchField-BA-X9dzb.cjs} +2 -2
- package/{SearchField-F2FKgYds.js → SearchField-BevjTbcW.js} +46 -46
- package/{Select-Dpi3LhbI.js → Select-BECa8IyZ.js} +112 -112
- package/Select-xBp51JSl.cjs +1 -0
- package/Skeleton-Iovq135_.js +35 -0
- package/Skeleton-MaBUPqhT.cjs +1 -0
- package/{Spinner-DTKb_LAA.js → Spinner-BZ7i01Kt.js} +13 -13
- package/Spinner-DxWDMW6e.cjs +6 -0
- package/TabList-3fErCDyP.cjs +1 -0
- package/{TabList-D9tl2s85.js → TabList-CXaxruLg.js} +54 -54
- package/{Table-CkN3y69S.js → Table-BzJktg2G.js} +2 -2
- package/{Table-C6k3PiiC.cjs → Table-Dyqa6_rE.cjs} +2 -2
- package/{Tag-BUJ20HHw.js → Tag-BYUPXbhG.js} +1 -1
- package/{Tag-7dHEMQum.cjs → Tag-BweDKw1v.cjs} +1 -1
- package/{TextArea-BCikUXaD.cjs → TextArea-BTmzOUZd.cjs} +1 -1
- package/{TextArea-h5_oBQH1.js → TextArea-CSNrZCEO.js} +22 -23
- package/TextField.module-CH39P8ZE.js +13 -0
- package/TextField.module-gJ-ruFra.cjs +1 -0
- package/{Toast-BBkWczCk.js → Toast-B74PMVL9.js} +170 -172
- package/{Toast-DclaxvZM.cjs → Toast-Cs0CEbRr.cjs} +1 -1
- package/{ToggleButtonGroup-BGG64PK1.js → ToggleButtonGroup-CwHPu7w5.js} +1 -1
- package/{ToggleButtonGroup-Da330GRT.cjs → ToggleButtonGroup-DY9S3USc.cjs} +1 -1
- package/accordion/index.cjs +1 -1
- package/accordion/index.js +1 -1
- package/assets/AccordionItem.css +1 -1
- package/assets/Button.css +1 -1
- package/assets/ButtonGroup.css +1 -1
- package/assets/Card.css +1 -1
- package/assets/Checkbox.css +1 -1
- package/assets/ComboBox.css +1 -1
- package/assets/DateInputDivider.css +1 -1
- package/assets/DateRangePicker.css +1 -1
- package/assets/Dialog.css +1 -1
- package/assets/GridItem.css +1 -1
- package/assets/InfoBanner.css +1 -1
- package/assets/Layout.css +1 -1
- package/assets/Link.css +1 -1
- package/assets/LinkButton.css +1 -1
- package/assets/ListBoxSection.css +1 -1
- package/assets/Radio.css +1 -1
- package/assets/RangeCalendar.css +1 -1
- package/assets/SearchField.css +1 -1
- package/assets/Select.css +1 -1
- package/assets/Skeleton.css +1 -1
- package/assets/Spinner.css +1 -1
- package/assets/TabList.css +1 -1
- package/assets/Table.css +1 -1
- package/assets/TextField.css +1 -1
- package/assets/Toast.css +1 -1
- package/assets/default.css +1 -0
- package/breadcrumbs/index.cjs +1 -1
- package/breadcrumbs/index.js +1 -1
- package/button/index.cjs +1 -1
- package/button/index.js +2 -2
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +1 -1
- package/card/index.cjs +1 -1
- package/card/index.js +1 -1
- package/checkbox/index.cjs +1 -1
- package/checkbox/index.js +2 -2
- 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/grid/index.cjs +1 -1
- package/grid/index.js +2 -2
- package/index.cjs +1 -1
- package/index.js +143 -144
- package/info-banner/index.cjs +1 -1
- package/info-banner/index.js +1 -1
- package/label/index.cjs +1 -1
- package/label/index.js +1 -1
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/link/index.cjs +1 -1
- package/link/index.js +1 -1
- package/link-button/index.cjs +1 -1
- package/link-button/index.js +1 -1
- package/list-box/index.cjs +1 -1
- package/list-box/index.js +2 -2
- package/modal/index.cjs +1 -1
- package/modal/index.js +1 -1
- package/package.json +4 -14
- 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/index.cjs +1 -1
- package/select/index.js +1 -1
- package/skeleton/index.cjs +1 -1
- package/skeleton/index.js +1 -1
- package/spinner/index.cjs +1 -1
- package/spinner/index.js +1 -1
- 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/TextArea.d.ts +2 -7
- package/textfield/TextField.d.ts +2 -6
- package/textfield/index.cjs +1 -1
- package/textfield/index.js +1 -1
- package/toast/index.cjs +1 -1
- package/toast/index.js +1 -1
- package/toggle-button/index.cjs +1 -1
- package/toggle-button/index.js +1 -1
- package/variables-B3KEYyhW.cjs +1 -0
- package/variables-DzXcMW2k.js +5 -0
- package/AccordionItem-SOfjXh3V.cjs +0 -1
- package/Button.module-BNLcvARn.cjs +0 -1
- package/Button.module-Bax2YU6N.js +0 -14
- package/Card-BDDyGAMA.js +0 -131
- package/Card-mj5lCIR4.cjs +0 -1
- package/GridItem-CIVF1fRW.cjs +0 -1
- package/GridItem-D3FZyyO-.js +0 -243
- package/InfoBanner-CqjnTYaa.cjs +0 -1
- package/InfoBanner-CrA8MS3v.js +0 -83
- package/Layout-Bta_Cpq_.cjs +0 -16
- package/Link-Bx6avHVl.cjs +0 -6
- package/LinkButton-BvXu6vAH.cjs +0 -6
- package/Select-BnbDXwgD.cjs +0 -1
- package/Skeleton-BpYj25p8.js +0 -37
- package/Skeleton-DMOxEwnd.cjs +0 -1
- package/Spinner-D1UBuLy4.cjs +0 -6
- package/TabList-D4WwgQY3.cjs +0 -1
- package/TextField.module-C9Zm9unF.js +0 -13
- package/TextField.module-GTQtNO0r.cjs +0 -1
- package/assets/global.css +0 -1
- package/assets/theme.css +0 -1
- package/assets/variables.css +0 -1
- package/theme/generated-object.d.ts +0 -384
- package/theme/generated-tokens.d.ts +0 -334
- package/theme/index.cjs +0 -1
- package/theme/index.d.ts +0 -267
- package/theme/index.js +0 -4039
- package/theme/tokens.d.ts +0 -290
- package/tokens-B3FfJ-rY.cjs +0 -1
- package/tokens-B9ooUP4g.js +0 -327
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as n, jsxs as g, Fragment as F } from "react/jsx-runtime";
|
|
2
|
+
import * as V from "react";
|
|
3
|
+
import v, { useMemo as D, useState as E, useCallback as L, useEffect as O, useRef as z } from "react";
|
|
4
4
|
import { c as P } from "./clsx-OuTLNxxd.js";
|
|
5
|
-
import { b as
|
|
6
|
-
import { a as R, $ as G, T as W } from "./Tag-
|
|
5
|
+
import { b as j } from "./utils-Cpcjg55U.js";
|
|
6
|
+
import { a as R, $ as G, T as W } from "./Tag-BYUPXbhG.js";
|
|
7
7
|
import { $ as H } from "./TextField-_UY8CXtW.js";
|
|
8
8
|
import { c as U } from "./Collection-B0_WAieZ.js";
|
|
9
|
-
import { C as k } from "./Checkbox-
|
|
10
|
-
import { L as q, c as X, a as J, b as Q } from "./ListBoxSection-
|
|
9
|
+
import { C as k } from "./Checkbox-DTuryJdM.js";
|
|
10
|
+
import { L as q, c as X, a as J, b as Q } from "./ListBoxSection-BBY8-t3_.js";
|
|
11
11
|
import { C as Y } from "./check-B5h1DvDs.js";
|
|
12
12
|
import { g as Z } from "./useHover-D6bNIkU0.js";
|
|
13
13
|
import { p as ee, q as te } from "./Dialog-B8swxl24.js";
|
|
14
14
|
import { $ as le, c as ae } from "./ListKeyboardDelegate-CVxkAn5D.js";
|
|
15
|
-
import { g as
|
|
16
|
-
import { a as
|
|
15
|
+
import { g as ne } from "./SelectionManager-Bq-Gw1UT.js";
|
|
16
|
+
import { a as w, c as oe, e as ie } from "./mergeProps-BSsN7Bgk.js";
|
|
17
17
|
import { $ as re } from "./filterDOMProps-wsa9OcNI.js";
|
|
18
18
|
import { $ as ce } from "./useField-BMegM8fA.js";
|
|
19
19
|
import { $ as se, a as de, b as ue } from "./useFormValidation-L0UHvOsP.js";
|
|
20
20
|
import { $ as fe } from "./useListState-pixYqSLl.js";
|
|
21
21
|
import { u as me } from "./useObserveElement-BdI4zgd7.js";
|
|
22
22
|
import { a as pe } from "./VisuallyHidden-CGEtjAP7.js";
|
|
23
|
-
import { a as be, L as he } from "./Label-
|
|
23
|
+
import { a as be, L as he } from "./Label-C5TNJ0Ku.js";
|
|
24
24
|
import { T as ge } from "./Text-CmlsaWMA.js";
|
|
25
25
|
import { X as ye } from "./x-C2xUHAEl.js";
|
|
26
26
|
import { u as B } from "./useLocalizedStringFormatter-N0AyjzbM.js";
|
|
27
27
|
import { $ as $e } from "./useButton-D6iUB8cN.js";
|
|
28
|
-
import { C as
|
|
29
|
-
import { $ as
|
|
28
|
+
import { C as xe } from "./chevron-down-DmZMdOiC.js";
|
|
29
|
+
import { $ as ve, F as Se } from "./FieldError-DdvFyIf4.js";
|
|
30
30
|
import './assets/Select.css';function I(e) {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
33
|
I.getCollectionNode = function* (t, o) {
|
|
34
|
-
let { childItems: r, title: a, children:
|
|
34
|
+
let { childItems: r, title: a, children: i } = t, l = t.title || t.children, s = t.textValue || (typeof l == "string" ? l : "") || t["aria-label"] || "";
|
|
35
35
|
!s && !(o != null && o.suppressTextValueWarning) && process.env.NODE_ENV !== "production" && console.warn("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop."), yield {
|
|
36
36
|
type: "item",
|
|
37
37
|
props: t,
|
|
@@ -46,7 +46,7 @@ I.getCollectionNode = function* (t, o) {
|
|
|
46
46
|
};
|
|
47
47
|
else if (a) {
|
|
48
48
|
let c = [];
|
|
49
|
-
|
|
49
|
+
v.Children.forEach(i, (u) => {
|
|
50
50
|
c.push({
|
|
51
51
|
type: "item",
|
|
52
52
|
element: u
|
|
@@ -57,9 +57,9 @@ I.getCollectionNode = function* (t, o) {
|
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
function Ce(e) {
|
|
60
|
-
return e.hasChildItems != null ? e.hasChildItems : !!(e.childItems || e.title &&
|
|
60
|
+
return e.hasChildItems != null ? e.hasChildItems : !!(e.childItems || e.title && v.Children.count(e.children) > 0);
|
|
61
61
|
}
|
|
62
|
-
let
|
|
62
|
+
let _ = I;
|
|
63
63
|
function N(e) {
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
@@ -74,28 +74,28 @@ N.getCollectionNode = function* (t) {
|
|
|
74
74
|
*childNodes() {
|
|
75
75
|
if (typeof o == "function") {
|
|
76
76
|
if (!a) throw new Error("props.children was a function but props.items is missing");
|
|
77
|
-
for (let
|
|
77
|
+
for (let i of a) yield {
|
|
78
78
|
type: "item",
|
|
79
|
-
value:
|
|
79
|
+
value: i,
|
|
80
80
|
renderer: o
|
|
81
81
|
};
|
|
82
82
|
} else {
|
|
83
|
-
let
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
let i = [];
|
|
84
|
+
v.Children.forEach(o, (l) => {
|
|
85
|
+
i.push({
|
|
86
86
|
type: "item",
|
|
87
87
|
element: l
|
|
88
88
|
});
|
|
89
|
-
}), yield*
|
|
89
|
+
}), yield* i;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
|
-
let
|
|
95
|
-
const
|
|
96
|
-
wrapper:
|
|
97
|
-
trigger:
|
|
98
|
-
medium:
|
|
94
|
+
let we = N;
|
|
95
|
+
const _e = "_wrapper_c5n5w_7", Ke = "_trigger_c5n5w_18", Ve = "_medium_c5n5w_32", Pe = "_icon_c5n5w_68", ke = "_tagGroup_c5n5w_74", Be = "_listBoxItemCheckmark_c5n5w_90", Ie = "_triggerContainer_c5n5w_95", Ne = "_selectValueTag_c5n5w_101", Ae = "_clearButton_c5n5w_117", Me = "_truncate_c5n5w_129", Te = "_checkboxContainer_c5n5w_166", Fe = "_selectAll_c5n5w_172", p = {
|
|
96
|
+
wrapper: _e,
|
|
97
|
+
trigger: Ke,
|
|
98
|
+
medium: Ve,
|
|
99
99
|
icon: Pe,
|
|
100
100
|
tagGroup: ke,
|
|
101
101
|
listBoxItemCheckmark: Be,
|
|
@@ -103,21 +103,21 @@ const Ke = "_wrapper_1ijiv_10", Ve = "_trigger_1ijiv_21", we = "_medium_1ijiv_35
|
|
|
103
103
|
selectValueTag: Ne,
|
|
104
104
|
clearButton: Ae,
|
|
105
105
|
truncate: Me,
|
|
106
|
-
checkboxContainer:
|
|
107
|
-
selectAll:
|
|
108
|
-
}, A = ({ item: e }) => /* @__PURE__ */
|
|
106
|
+
checkboxContainer: Te,
|
|
107
|
+
selectAll: Fe
|
|
108
|
+
}, A = ({ item: e }) => /* @__PURE__ */ n(
|
|
109
109
|
J,
|
|
110
110
|
{
|
|
111
111
|
...e.value,
|
|
112
112
|
textValue: e.textValue,
|
|
113
113
|
"aria-label": e.textValue,
|
|
114
|
-
children: ({ isDisabled: t, isSelected: o, selectionMode: r }) => /* @__PURE__ */ g(
|
|
115
|
-
r === "multiple" ? /* @__PURE__ */
|
|
114
|
+
children: ({ isDisabled: t, isSelected: o, selectionMode: r }) => /* @__PURE__ */ g(F, { children: [
|
|
115
|
+
r === "multiple" ? /* @__PURE__ */ n(
|
|
116
116
|
"div",
|
|
117
117
|
{
|
|
118
118
|
className: p.checkboxContainer,
|
|
119
119
|
"aria-hidden": !0,
|
|
120
|
-
children: /* @__PURE__ */
|
|
120
|
+
children: /* @__PURE__ */ n(
|
|
121
121
|
k,
|
|
122
122
|
{
|
|
123
123
|
isDisabled: t,
|
|
@@ -130,7 +130,7 @@ const Ke = "_wrapper_1ijiv_10", Ve = "_trigger_1ijiv_21", we = "_medium_1ijiv_35
|
|
|
130
130
|
}
|
|
131
131
|
) : null,
|
|
132
132
|
e.rendered,
|
|
133
|
-
o && r === "single" ? /* @__PURE__ */
|
|
133
|
+
o && r === "single" ? /* @__PURE__ */ n(
|
|
134
134
|
Y,
|
|
135
135
|
{
|
|
136
136
|
size: 20,
|
|
@@ -139,10 +139,10 @@ const Ke = "_wrapper_1ijiv_10", Ve = "_trigger_1ijiv_21", we = "_medium_1ijiv_35
|
|
|
139
139
|
) : null
|
|
140
140
|
] })
|
|
141
141
|
}
|
|
142
|
-
),
|
|
142
|
+
), De = ({ section: e, state: t }) => /* @__PURE__ */ n(X, { ...e.value, children: t.collection.getChildren ? /* @__PURE__ */ n(U, { items: t.collection.getChildren(e.key), children: (o) => /* @__PURE__ */ n(A, { item: o }) }) : null }), Ee = ({
|
|
143
143
|
state: e,
|
|
144
144
|
...t
|
|
145
|
-
}) => /* @__PURE__ */
|
|
145
|
+
}) => /* @__PURE__ */ n(
|
|
146
146
|
q,
|
|
147
147
|
{
|
|
148
148
|
...t,
|
|
@@ -150,24 +150,24 @@ const Ke = "_wrapper_1ijiv_10", Ve = "_trigger_1ijiv_21", we = "_medium_1ijiv_35
|
|
|
150
150
|
escapeKeyBehavior: "none",
|
|
151
151
|
onSelectionChange: e.setSelectedKeys,
|
|
152
152
|
items: e.collection,
|
|
153
|
-
children: (o) => o.type === "section" ? /* @__PURE__ */
|
|
154
|
-
|
|
153
|
+
children: (o) => o.type === "section" ? /* @__PURE__ */ n(
|
|
154
|
+
De,
|
|
155
155
|
{
|
|
156
156
|
state: e,
|
|
157
157
|
section: o
|
|
158
158
|
}
|
|
159
|
-
) : /* @__PURE__ */
|
|
159
|
+
) : /* @__PURE__ */ n(A, { item: o })
|
|
160
160
|
}
|
|
161
161
|
);
|
|
162
|
-
function
|
|
163
|
-
const { disallowEmptySelection: r, isDisabled: a } = e,
|
|
162
|
+
function Le(e, t, o) {
|
|
163
|
+
const { disallowEmptySelection: r, isDisabled: a } = e, i = le({ usage: "search", sensitivity: "base" }), l = D(
|
|
164
164
|
() => new ae(
|
|
165
165
|
t.collection,
|
|
166
166
|
t.disabledKeys,
|
|
167
167
|
null,
|
|
168
|
-
|
|
168
|
+
i
|
|
169
169
|
),
|
|
170
|
-
[t.collection, t.disabledKeys,
|
|
170
|
+
[t.collection, t.disabledKeys, i]
|
|
171
171
|
), { menuTriggerProps: s, menuProps: c } = ee(
|
|
172
172
|
{
|
|
173
173
|
isDisabled: a,
|
|
@@ -176,23 +176,23 @@ function Ee(e, t, o) {
|
|
|
176
176
|
t,
|
|
177
177
|
o
|
|
178
178
|
), u = (f) => {
|
|
179
|
-
const { selectedKeys:
|
|
180
|
-
if (
|
|
179
|
+
const { selectedKeys: x, selectionMode: T } = t, C = x.values().next().value;
|
|
180
|
+
if (T === "single")
|
|
181
181
|
switch (f.key) {
|
|
182
182
|
case "ArrowLeft": {
|
|
183
183
|
f.preventDefault();
|
|
184
|
-
const $ =
|
|
184
|
+
const $ = x.size > 0 ? l.getKeyAbove(C) : l.getFirstKey();
|
|
185
185
|
$ && t.setSelectedKeys([$]);
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
188
188
|
case "ArrowRight": {
|
|
189
189
|
f.preventDefault();
|
|
190
|
-
const $ =
|
|
190
|
+
const $ = x.size > 0 ? l.getKeyBelow(C) : l.getFirstKey();
|
|
191
191
|
$ && t.setSelectedKeys([$]);
|
|
192
192
|
break;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
}, { typeSelectProps: d } =
|
|
195
|
+
}, { typeSelectProps: d } = ne({
|
|
196
196
|
keyboardDelegate: l,
|
|
197
197
|
selectionManager: t.selectionManager,
|
|
198
198
|
onTypeSelect(f) {
|
|
@@ -203,7 +203,7 @@ function Ee(e, t, o) {
|
|
|
203
203
|
labelElementType: "span"
|
|
204
204
|
});
|
|
205
205
|
d.onKeyDown = d.onKeyDownCapture, delete d.onKeyDownCapture;
|
|
206
|
-
const m = re(e, { labelable: !0 }), h =
|
|
206
|
+
const m = re(e, { labelable: !0 }), h = w(d, s, b), S = oe();
|
|
207
207
|
return {
|
|
208
208
|
labelProps: {
|
|
209
209
|
...y,
|
|
@@ -212,9 +212,9 @@ function Ee(e, t, o) {
|
|
|
212
212
|
e.isDisabled || ((f = o.current) == null || f.focus(), Z("keyboard"));
|
|
213
213
|
}
|
|
214
214
|
},
|
|
215
|
-
triggerProps:
|
|
215
|
+
triggerProps: w(m, {
|
|
216
216
|
...h,
|
|
217
|
-
onKeyDown:
|
|
217
|
+
onKeyDown: ie(
|
|
218
218
|
h.onKeyDown,
|
|
219
219
|
u,
|
|
220
220
|
e.onKeyDown
|
|
@@ -251,13 +251,13 @@ function Ee(e, t, o) {
|
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function Oe(e) {
|
|
255
255
|
const {
|
|
256
256
|
collection: t,
|
|
257
257
|
disabledKeys: o,
|
|
258
258
|
selectionManager: r,
|
|
259
|
-
selectionManager: { setSelectedKeys: a, selectedKeys:
|
|
260
|
-
} = fe(e), s = [], c =
|
|
259
|
+
selectionManager: { setSelectedKeys: a, selectedKeys: i, selectionMode: l }
|
|
260
|
+
} = fe(e), s = [], c = i.size !== 0 ? Array.from(i).map((u) => {
|
|
261
261
|
const d = t.getItem(u);
|
|
262
262
|
return d || s.push(u), d;
|
|
263
263
|
}).filter(Boolean) : null;
|
|
@@ -270,13 +270,13 @@ function Le(e) {
|
|
|
270
270
|
disabledKeys: o,
|
|
271
271
|
selectionManager: r,
|
|
272
272
|
selectionMode: l,
|
|
273
|
-
selectedKeys:
|
|
273
|
+
selectedKeys: i,
|
|
274
274
|
setSelectedKeys: a.bind(r),
|
|
275
275
|
selectedItems: c
|
|
276
276
|
};
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
const [t, o] =
|
|
278
|
+
function ze(e) {
|
|
279
|
+
const [t, o] = E(!1), r = te(e), a = e.selectionMode === "single", i = Oe({
|
|
280
280
|
...e,
|
|
281
281
|
onSelectionChange: (d) => {
|
|
282
282
|
e.onSelectionChange && e.onSelectionChange(d), a && r.close();
|
|
@@ -284,14 +284,14 @@ function Oe(e) {
|
|
|
284
284
|
}), l = se({
|
|
285
285
|
...e,
|
|
286
286
|
validationBehavior: "native",
|
|
287
|
-
value:
|
|
288
|
-
}), s =
|
|
287
|
+
value: i.selectedKeys
|
|
288
|
+
}), s = i.collection.size === 0, c = !!i.selectedKeys.size, u = L(() => {
|
|
289
289
|
l.resetValidation(), l.commitValidation();
|
|
290
290
|
}, [l]);
|
|
291
|
-
return
|
|
291
|
+
return O(() => {
|
|
292
292
|
a && c && u();
|
|
293
293
|
}, [c, a, u]), {
|
|
294
|
-
...
|
|
294
|
+
...i,
|
|
295
295
|
...r,
|
|
296
296
|
close() {
|
|
297
297
|
r.close(), c && u();
|
|
@@ -307,15 +307,15 @@ function Oe(e) {
|
|
|
307
307
|
...l
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function je({
|
|
311
311
|
autoComplete: e,
|
|
312
312
|
name: t,
|
|
313
313
|
isDisabled: o,
|
|
314
314
|
isRequired: r,
|
|
315
315
|
selectRef: a
|
|
316
|
-
},
|
|
316
|
+
}, i, l) {
|
|
317
317
|
const { visuallyHiddenProps: s } = pe();
|
|
318
|
-
return de(a,
|
|
318
|
+
return de(a, i.selectedKeys, i.setSelectedKeys), ue(
|
|
319
319
|
{
|
|
320
320
|
validationBehavior: "native",
|
|
321
321
|
focus: () => {
|
|
@@ -323,7 +323,7 @@ function ze({
|
|
|
323
323
|
return (c = l.current) == null ? void 0 : c.focus();
|
|
324
324
|
}
|
|
325
325
|
},
|
|
326
|
-
|
|
326
|
+
i,
|
|
327
327
|
a
|
|
328
328
|
), {
|
|
329
329
|
containerProps: {
|
|
@@ -342,35 +342,35 @@ function ze({
|
|
|
342
342
|
disabled: o,
|
|
343
343
|
required: r,
|
|
344
344
|
name: t,
|
|
345
|
-
value: Array.from(
|
|
346
|
-
onChange: (c) =>
|
|
345
|
+
value: Array.from(i.selectedKeys).map((c) => c.toString()),
|
|
346
|
+
onChange: (c) => i.setSelectedKeys(c.target.value),
|
|
347
347
|
multiple: !0
|
|
348
348
|
}
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
351
|
function Re(e) {
|
|
352
|
-
const { state: t, triggerRef: o, name: r, isDisabled: a } = e,
|
|
352
|
+
const { state: t, triggerRef: o, name: r, isDisabled: a } = e, i = `${e.label}-hidden`, l = z(null), { containerProps: s, selectProps: c } = je(
|
|
353
353
|
{ ...e, selectRef: l },
|
|
354
354
|
t,
|
|
355
355
|
o
|
|
356
356
|
);
|
|
357
|
-
return t.collection.size <= 300 ? /* @__PURE__ */
|
|
357
|
+
return t.collection.size <= 300 ? /* @__PURE__ */ n(
|
|
358
358
|
"div",
|
|
359
359
|
{
|
|
360
360
|
...s,
|
|
361
361
|
"data-testid": "hidden-select-container",
|
|
362
362
|
children: /* @__PURE__ */ g("label", { children: [
|
|
363
|
-
|
|
363
|
+
i,
|
|
364
364
|
/* @__PURE__ */ g(
|
|
365
365
|
"select",
|
|
366
366
|
{
|
|
367
367
|
...c,
|
|
368
368
|
ref: l,
|
|
369
369
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ n("option", {}),
|
|
371
371
|
[...t.collection.getKeys()].map((u) => {
|
|
372
372
|
const d = t.collection.getItem(u);
|
|
373
|
-
return d && d.type === "item" ? /* @__PURE__ */
|
|
373
|
+
return d && d.type === "item" ? /* @__PURE__ */ n(
|
|
374
374
|
"option",
|
|
375
375
|
{
|
|
376
376
|
value: d.key,
|
|
@@ -384,7 +384,7 @@ function Re(e) {
|
|
|
384
384
|
)
|
|
385
385
|
] })
|
|
386
386
|
}
|
|
387
|
-
) : r ? /* @__PURE__ */
|
|
387
|
+
) : r ? /* @__PURE__ */ n(
|
|
388
388
|
"input",
|
|
389
389
|
{
|
|
390
390
|
type: "hidden",
|
|
@@ -404,7 +404,7 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
404
404
|
parentWidth: o,
|
|
405
405
|
onClear: r,
|
|
406
406
|
triggerRef: a,
|
|
407
|
-
isClearable:
|
|
407
|
+
isClearable: i
|
|
408
408
|
}) => {
|
|
409
409
|
const l = B(M);
|
|
410
410
|
return /* @__PURE__ */ g(
|
|
@@ -413,7 +413,7 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
413
413
|
className: p.selectValueTag,
|
|
414
414
|
"data-disabled": t || void 0,
|
|
415
415
|
children: [
|
|
416
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ n(
|
|
417
417
|
"span",
|
|
418
418
|
{
|
|
419
419
|
className: p.truncate,
|
|
@@ -421,7 +421,7 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
421
421
|
children: e != null && e.length && e.length > 1 ? `${e.length} ${l.format("chosen")}` : e == null ? void 0 : e[0].textValue
|
|
422
422
|
}
|
|
423
423
|
),
|
|
424
|
-
|
|
424
|
+
i && /* @__PURE__ */ n(
|
|
425
425
|
"button",
|
|
426
426
|
{
|
|
427
427
|
disabled: t,
|
|
@@ -431,7 +431,7 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
431
431
|
var s;
|
|
432
432
|
r(), (s = a == null ? void 0 : a.current) == null || s.focus();
|
|
433
433
|
},
|
|
434
|
-
children: /* @__PURE__ */
|
|
434
|
+
children: /* @__PURE__ */ n(
|
|
435
435
|
ye,
|
|
436
436
|
{
|
|
437
437
|
width: 20,
|
|
@@ -449,7 +449,7 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
449
449
|
isDisabled: o,
|
|
450
450
|
size: r = "large",
|
|
451
451
|
isOpen: a,
|
|
452
|
-
isInvalid:
|
|
452
|
+
isInvalid: i,
|
|
453
453
|
selectionMode: l,
|
|
454
454
|
state: { selectedItems: s },
|
|
455
455
|
placeholder: c,
|
|
@@ -476,19 +476,19 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
476
476
|
[p.medium]: r === "medium"
|
|
477
477
|
}),
|
|
478
478
|
"data-disabled": o || void 0,
|
|
479
|
-
"data-invalid":
|
|
479
|
+
"data-invalid": i || void 0,
|
|
480
480
|
"data-open": a || void 0,
|
|
481
481
|
ref: d,
|
|
482
482
|
type: "button",
|
|
483
483
|
children: [
|
|
484
|
-
m && !s ? /* @__PURE__ */
|
|
485
|
-
m ? null : /* @__PURE__ */
|
|
486
|
-
/* @__PURE__ */
|
|
484
|
+
m && !s ? /* @__PURE__ */ n("span", { children: c }) : null,
|
|
485
|
+
m ? null : /* @__PURE__ */ n("span", { children: s ? s[0].textValue : c }),
|
|
486
|
+
/* @__PURE__ */ n(
|
|
487
487
|
"div",
|
|
488
488
|
{
|
|
489
489
|
className: p.icon,
|
|
490
490
|
"aria-hidden": "true",
|
|
491
|
-
children: /* @__PURE__ */
|
|
491
|
+
children: /* @__PURE__ */ n(xe, { size: 20 })
|
|
492
492
|
}
|
|
493
493
|
)
|
|
494
494
|
]
|
|
@@ -498,10 +498,10 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
498
498
|
]
|
|
499
499
|
}
|
|
500
500
|
);
|
|
501
|
-
},
|
|
501
|
+
}, K = ({
|
|
502
502
|
state: e,
|
|
503
503
|
errorMessage: t
|
|
504
|
-
}) => /* @__PURE__ */
|
|
504
|
+
}) => /* @__PURE__ */ n(ve.Provider, { value: { ...e.displayValidation }, children: /* @__PURE__ */ n(Se, { children: t }) }), qe = V.forwardRef(
|
|
505
505
|
({ isClearable: e = !0, popover: t, ...o }, r) => {
|
|
506
506
|
const a = {
|
|
507
507
|
selectionMode: "single",
|
|
@@ -511,11 +511,11 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
511
511
|
size: "large",
|
|
512
512
|
popover: t,
|
|
513
513
|
...o
|
|
514
|
-
},
|
|
514
|
+
}, i = j(r), l = ze(a), s = B(M), { labelProps: c, triggerProps: u, valueProps: d, menuProps: y } = Le(
|
|
515
515
|
a,
|
|
516
516
|
l,
|
|
517
|
-
|
|
518
|
-
), { width: b } = me(
|
|
517
|
+
i
|
|
518
|
+
), { width: b } = me(i.current, {
|
|
519
519
|
includePadding: !0
|
|
520
520
|
});
|
|
521
521
|
return /* @__PURE__ */ g(
|
|
@@ -524,15 +524,15 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
524
524
|
...a,
|
|
525
525
|
className: P(p.wrapper, a.className),
|
|
526
526
|
children: [
|
|
527
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ n(
|
|
528
528
|
Re,
|
|
529
529
|
{
|
|
530
530
|
...a,
|
|
531
531
|
state: l,
|
|
532
|
-
triggerRef:
|
|
532
|
+
triggerRef: i
|
|
533
533
|
}
|
|
534
534
|
),
|
|
535
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ n(be, { popover: t, children: a.label && /* @__PURE__ */ n(
|
|
536
536
|
he,
|
|
537
537
|
{
|
|
538
538
|
...c,
|
|
@@ -540,36 +540,36 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
540
540
|
children: a.label
|
|
541
541
|
}
|
|
542
542
|
) }),
|
|
543
|
-
a.description && /* @__PURE__ */
|
|
544
|
-
a.errorPosition === "top" && /* @__PURE__ */
|
|
545
|
-
|
|
543
|
+
a.description && /* @__PURE__ */ n(ge, { slot: "description", children: a.description }),
|
|
544
|
+
a.errorPosition === "top" && /* @__PURE__ */ n(
|
|
545
|
+
K,
|
|
546
546
|
{
|
|
547
547
|
...a,
|
|
548
548
|
state: l
|
|
549
549
|
}
|
|
550
550
|
),
|
|
551
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ n(
|
|
552
552
|
Ue,
|
|
553
553
|
{
|
|
554
554
|
...a,
|
|
555
555
|
...u,
|
|
556
556
|
isInvalid: l.displayValidation.isInvalid,
|
|
557
|
-
triggerRef:
|
|
557
|
+
triggerRef: i,
|
|
558
558
|
state: l,
|
|
559
|
-
children: a.selectionMode === "multiple" && l.selectedItems ? /* @__PURE__ */
|
|
559
|
+
children: a.selectionMode === "multiple" && l.selectedItems ? /* @__PURE__ */ n("span", { ...d, children: /* @__PURE__ */ n(
|
|
560
560
|
He,
|
|
561
561
|
{
|
|
562
562
|
...a,
|
|
563
563
|
state: l,
|
|
564
564
|
parentWidth: b,
|
|
565
565
|
onClear: () => l.selectionManager.clearSelection(),
|
|
566
|
-
triggerRef:
|
|
566
|
+
triggerRef: i
|
|
567
567
|
}
|
|
568
568
|
) }) : null
|
|
569
569
|
}
|
|
570
570
|
),
|
|
571
|
-
a.errorPosition === "bottom" && /* @__PURE__ */
|
|
572
|
-
|
|
571
|
+
a.errorPosition === "bottom" && /* @__PURE__ */ n(
|
|
572
|
+
K,
|
|
573
573
|
{
|
|
574
574
|
...a,
|
|
575
575
|
state: l
|
|
@@ -582,10 +582,10 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
582
582
|
onOpenChange: (m) => {
|
|
583
583
|
m || l.close();
|
|
584
584
|
},
|
|
585
|
-
triggerRef:
|
|
585
|
+
triggerRef: i,
|
|
586
586
|
style: { width: b },
|
|
587
587
|
children: [
|
|
588
|
-
a.isSelectableAll && /* @__PURE__ */
|
|
588
|
+
a.isSelectableAll && /* @__PURE__ */ n(
|
|
589
589
|
k,
|
|
590
590
|
{
|
|
591
591
|
isSelected: l.selectionManager.isSelectAll,
|
|
@@ -595,8 +595,8 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
595
595
|
children: s.format("selectAll")
|
|
596
596
|
}
|
|
597
597
|
),
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
|
|
598
|
+
/* @__PURE__ */ n(
|
|
599
|
+
Ee,
|
|
600
600
|
{
|
|
601
601
|
...y,
|
|
602
602
|
state: l
|
|
@@ -605,14 +605,14 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
605
605
|
]
|
|
606
606
|
}
|
|
607
607
|
),
|
|
608
|
-
a.showTags && !!l.selectedItems && /* @__PURE__ */
|
|
608
|
+
a.showTags && !!l.selectedItems && /* @__PURE__ */ n(
|
|
609
609
|
R,
|
|
610
610
|
{
|
|
611
611
|
"aria-label": s.format("selectedItems"),
|
|
612
612
|
selectionBehavior: "toggle",
|
|
613
613
|
onRemove: (m) => l.selectionManager.toggleSelection(Array.from(m)[0]),
|
|
614
614
|
className: p.tagGroup,
|
|
615
|
-
children: /* @__PURE__ */
|
|
615
|
+
children: /* @__PURE__ */ n(G, { items: l.selectedItems, children: (m) => /* @__PURE__ */ n(
|
|
616
616
|
W,
|
|
617
617
|
{
|
|
618
618
|
textValue: m.textValue,
|
|
@@ -629,22 +629,22 @@ const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Sel
|
|
|
629
629
|
}
|
|
630
630
|
);
|
|
631
631
|
}
|
|
632
|
-
), Xe =
|
|
633
|
-
({ options: e, ...t }, o) => /* @__PURE__ */
|
|
632
|
+
), Xe = V.forwardRef(
|
|
633
|
+
({ options: e, ...t }, o) => /* @__PURE__ */ n(
|
|
634
634
|
qe,
|
|
635
635
|
{
|
|
636
636
|
...t,
|
|
637
637
|
items: e,
|
|
638
638
|
ref: o,
|
|
639
|
-
children: (r) => r.children ? /* @__PURE__ */
|
|
640
|
-
|
|
639
|
+
children: (r) => r.children ? /* @__PURE__ */ n(
|
|
640
|
+
we,
|
|
641
641
|
{
|
|
642
642
|
items: r.children,
|
|
643
643
|
title: r.name,
|
|
644
|
-
children: (a) => /* @__PURE__ */
|
|
644
|
+
children: (a) => /* @__PURE__ */ n(_, { textValue: a.textValue, children: a.name })
|
|
645
645
|
},
|
|
646
646
|
r.name
|
|
647
|
-
) : /* @__PURE__ */
|
|
647
|
+
) : /* @__PURE__ */ n(_, { textValue: r.textValue, children: r.name })
|
|
648
648
|
}
|
|
649
649
|
)
|
|
650
650
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('./assets/Select.css');const l=require("react/jsx-runtime"),g=require("react"),B=require("./clsx-C11secjj.cjs"),z=require("./utils-CMHKYKlz.cjs"),j=require("./Tag-BweDKw1v.cjs"),R=require("./TextField-Bm5916AD.cjs"),H=require("./Collection-BvWp2xBd.cjs"),I=require("./Checkbox-dtZfsSfx.cjs"),S=require("./ListBoxSection-BeDwnVZx.cjs"),G=require("./check-B0aKTFe5.cjs"),W=require("./useHover-DGAmG7jt.cjs"),M=require("./Dialog-DR6nEqMT.cjs"),K=require("./ListKeyboardDelegate-C_X1wLkh.cjs"),U=require("./SelectionManager-BtbHoHpA.cjs"),$=require("./mergeProps-JhcJ7uJL.cjs"),X=require("./filterDOMProps-RRlKPKX0.cjs"),J=require("./useField-DyeD7MLj.cjs"),C=require("./useFormValidation-BQIRxgbU.cjs"),Q=require("./useListState-D2IEg6_e.cjs"),Y=require("./useObserveElement-MhzEsCkX.cjs"),Z=require("./VisuallyHidden-EjrqodVh.cjs"),P=require("./Label-Dp85Vue3.cjs"),ee=require("./Text-BAFsaON-.cjs"),te=require("./x-rV-nu490.cjs"),N=require("./useLocalizedStringFormatter-BO2iZEL0.cjs"),le=require("./useButton-R8-i3HLC.cjs"),ne=require("./chevron-down-5hFlg_lR.cjs"),V=require("./FieldError-Cornph2A.cjs");function ie(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const F=ie(g);function A(e){return null}A.getCollectionNode=function*(t,r){let{childItems:c,title:i,children:o}=t,n=t.title||t.children,a=t.textValue||(typeof n=="string"?n:"")||t["aria-label"]||"";!a&&!(r!=null&&r.suppressTextValueWarning)&&process.env.NODE_ENV!=="production"&&console.warn("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop."),yield{type:"item",props:t,rendered:n,textValue:a,"aria-label":t["aria-label"],hasChildNodes:re(t),*childNodes(){if(c)for(let s of c)yield{type:"item",value:s};else if(i){let s=[];g.Children.forEach(o,u=>{s.push({type:"item",element:u})}),yield*s}}}};function re(e){return e.hasChildItems!=null?e.hasChildItems:!!(e.childItems||e.title&&g.Children.count(e.children)>0)}let k=A;function D(e){return null}D.getCollectionNode=function*(t){let{children:r,title:c,items:i}=t;yield{type:"section",props:t,hasChildNodes:!0,rendered:c,"aria-label":t["aria-label"],*childNodes(){if(typeof r=="function"){if(!i)throw new Error("props.children was a function but props.items is missing");for(let o of i)yield{type:"item",value:o,renderer:r}}else{let o=[];g.Children.forEach(r,n=>{o.push({type:"item",element:n})}),yield*o}}}};let ce=D;const oe="_wrapper_c5n5w_7",se="_trigger_c5n5w_18",ae="_medium_c5n5w_32",de="_icon_c5n5w_68",ue="_tagGroup_c5n5w_74",fe="_listBoxItemCheckmark_c5n5w_90",be="_triggerContainer_c5n5w_95",he="_selectValueTag_c5n5w_101",ge="_clearButton_c5n5w_117",xe="_truncate_c5n5w_129",me="_checkboxContainer_c5n5w_166",ye="_selectAll_c5n5w_172",h={wrapper:oe,trigger:se,medium:ae,icon:de,tagGroup:ue,listBoxItemCheckmark:fe,triggerContainer:be,selectValueTag:he,clearButton:ge,truncate:xe,checkboxContainer:me,selectAll:ye},T=({item:e})=>l.jsx(S.ListBoxItem,{...e.value,textValue:e.textValue,"aria-label":e.textValue,children:({isDisabled:t,isSelected:r,selectionMode:c})=>l.jsxs(l.Fragment,{children:[c==="multiple"?l.jsx("div",{className:h.checkboxContainer,"aria-hidden":!0,children:l.jsx(I.Checkbox,{isDisabled:t,isSelected:r,isReadOnly:!0,excludeFromTabOrder:!0,"aria-label":e.textValue})}):null,e.rendered,r&&c==="single"?l.jsx(G.Check,{size:20,className:h.listBoxItemCheckmark}):null]})}),pe=({section:e,state:t})=>l.jsx(S.ListBoxSection,{...e.value,children:t.collection.getChildren?l.jsx(H.$e1995378a142960e$export$fb8073518f34e6ec,{items:t.collection.getChildren(e.key),children:r=>l.jsx(T,{item:r})}):null}),$e=({state:e,...t})=>l.jsx(S.ListBox,{...t,...e,escapeKeyBehavior:"none",onSelectionChange:e.setSelectedKeys,items:e.collection,children:r=>r.type==="section"?l.jsx(pe,{state:e,section:r}):l.jsx(T,{item:r})});function Se(e,t,r){const{disallowEmptySelection:c,isDisabled:i}=e,o=K.$325a3faab7a68acd$export$a16aca283550c30d({usage:"search",sensitivity:"base"}),n=g.useMemo(()=>new K.$2a25aae57d74318e$export$a05409b8bb224a5a(t.collection,t.disabledKeys,null,o),[t.collection,t.disabledKeys,o]),{menuTriggerProps:a,menuProps:s}=M.$168583247155ddda$export$dc9c12ed27dd1b49({isDisabled:i,type:"listbox"},t,r),u=f=>{const{selectedKeys:v,selectionMode:E}=t,_=v.values().next().value;if(E==="single")switch(f.key){case"ArrowLeft":{f.preventDefault();const p=v.size>0?n.getKeyAbove(_):n.getFirstKey();p&&t.setSelectedKeys([p]);break}case"ArrowRight":{f.preventDefault();const p=v.size>0?n.getKeyBelow(_):n.getFirstKey();p&&t.setSelectedKeys([p]);break}}},{typeSelectProps:d}=U.$fb3050f43d946246$export$e32c88dfddc6e1d8({keyboardDelegate:n,selectionManager:t.selectionManager,onTypeSelect(f){t.setSelectedKeys([f])}}),{labelProps:y,fieldProps:x}=J.$2baaea4c71418dea$export$294aa081a6c6f55d({...e,labelElementType:"span"});d.onKeyDown=d.onKeyDownCapture,delete d.onKeyDownCapture;const b=X.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{labelable:!0}),m=$.$3ef42575df84b30b$export$9d1611c77c2fe928(d,a,x),w=$.$bdb11010cef70236$export$f680877a34711e37();return{labelProps:{...y,onClick:()=>{var f;e.isDisabled||((f=r.current)==null||f.focus(),W.$507fabe10e71c6fb$export$8397ddfc504fdb9a("keyboard"))}},triggerProps:$.$3ef42575df84b30b$export$9d1611c77c2fe928(b,{...m,onKeyDown:$.$ff5963eb1fccf552$export$e08e3b67e392101e(m.onKeyDown,u,e.onKeyDown),onKeyUp:e.onKeyUp,"aria-labelledby":[m["aria-labelledby"],m["aria-label"]&&!m["aria-labelledby"]?m.id:null,w].filter(Boolean).join(" "),onFocus(f){t.isFocused||(e.onFocus&&e.onFocus(f),t.setFocused(!0))},onBlur(f){t.isOpen||(e.onBlur&&e.onBlur(f),t.setFocused(!1))}}),valueProps:{id:w},menuProps:{...s,disallowEmptySelection:c,autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,onBlur:f=>{f.currentTarget.contains(f.relatedTarget)||(e.onBlur&&e.onBlur(f),t.setFocused(!1))},"aria-labelledby":[x["aria-labelledby"],m["aria-label"]&&!x["aria-labelledby"]?m.id:null].filter(Boolean).join(" ")}}}function ve(e){const{collection:t,disabledKeys:r,selectionManager:c,selectionManager:{setSelectedKeys:i,selectedKeys:o,selectionMode:n}}=Q.$e72dd72e1c76a225$export$2f645645f7bca764(e),a=[],s=o.size!==0?Array.from(o).map(u=>{const d=t.getItem(u);return d||a.push(u),d}).filter(Boolean):null;return a.length&&console.warn(`Select: Keys "${a.join(", ")}" passed to "selectedKeys" are not present in the collection.`),{collection:t,disabledKeys:r,selectionManager:c,selectionMode:n,selectedKeys:o,setSelectedKeys:i.bind(c),selectedItems:s}}function je(e){const[t,r]=g.useState(!1),c=M.$a28c903ee9ad8dc5$export$79fefeb1c2091ac3(e),i=e.selectionMode==="single",o=ve({...e,onSelectionChange:d=>{e.onSelectionChange&&e.onSelectionChange(d),i&&c.close()}}),n=C.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...e,validationBehavior:"native",value:o.selectedKeys}),a=o.collection.size===0,s=!!o.selectedKeys.size,u=g.useCallback(()=>{n.resetValidation(),n.commitValidation()},[n]);return g.useEffect(()=>{i&&s&&u()},[s,i,u]),{...o,...c,close(){c.close(),s&&u()},open(){a||c.open()},toggle(d){a||c.toggle(d)},isFocused:t,setFocused:r,...n}}function Ce({autoComplete:e,name:t,isDisabled:r,isRequired:c,selectRef:i},o,n){const{visuallyHiddenProps:a}=Z.$5c3e21d68f1c4674$export$a966af930f325cab();return C.$99facab73266f662$export$5add1d006293d136(i,o.selectedKeys,o.setSelectedKeys),C.$e93e671b31057976$export$b8473d3665f3a75a({validationBehavior:"native",focus:()=>{var s;return(s=n.current)==null?void 0:s.focus()}},o,i),{containerProps:{...a,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{tabIndex:-1,autoComplete:e,disabled:r,required:c,name:t,value:Array.from(o.selectedKeys).map(s=>s.toString()),onChange:s=>o.setSelectedKeys(s.target.value),multiple:!0}}}function we(e){const{state:t,triggerRef:r,name:c,isDisabled:i}=e,o=`${e.label}-hidden`,n=g.useRef(null),{containerProps:a,selectProps:s}=Ce({...e,selectRef:n},t,r);return t.collection.size<=300?l.jsx("div",{...a,"data-testid":"hidden-select-container",children:l.jsxs("label",{children:[o,l.jsxs("select",{...s,ref:n,children:[l.jsx("option",{}),[...t.collection.getKeys()].map(u=>{const d=t.collection.getItem(u);return d&&d.type==="item"?l.jsx("option",{value:d.key,children:d.textValue},d.key):null})]})]})}):c?l.jsx("input",{type:"hidden",autoComplete:s.autoComplete,name:c,disabled:i,value:Array.from(t.selectedKeys).map(u=>u.toString())??[""]}):null}const _e={clearAll:"Clear all",selectAll:"Select all",selectedItems:"Selected items",chosen:"chosen"},Ke={clearAll:"Rensa alla",selectAll:"Välj alla",selectedItems:"Valda objekt",chosen:"valda"},O={en:_e,sv:Ke},Pe=({state:{selectedItems:e},isDisabled:t,parentWidth:r,onClear:c,triggerRef:i,isClearable:o})=>{const n=N.useLocalizedStringFormatter(O);return l.jsxs("div",{className:h.selectValueTag,"data-disabled":t||void 0,children:[l.jsx("span",{className:h.truncate,style:{maxWidth:r-92},children:e!=null&&e.length&&e.length>1?`${e.length} ${n.format("chosen")}`:e==null?void 0:e[0].textValue}),o&&l.jsx("button",{disabled:t,"aria-label":n.format("clearAll"),className:h.clearButton,onClick:()=>{var a;c(),(a=i==null?void 0:i.current)==null||a.focus()},children:l.jsx(te.X,{width:20,height:20})})]})},Ve=({autoFocus:e,excludeFromTabOrder:t,isDisabled:r,size:c="large",isOpen:i,isInvalid:o,selectionMode:n,state:{selectedItems:a},placeholder:s,children:u,triggerRef:d,...y})=>{const{buttonProps:x}=le.$701a24aa0da5b062$export$ea18c227d4417cc3({autoFocus:e,excludeFromTabOrder:t,isDisabled:r,...y},d),b=n==="multiple";return l.jsxs("div",{className:h.triggerContainer,"data-disabled":r||void 0,children:[l.jsxs("button",{...x,autoFocus:e,className:B.clsx(h.trigger,{[h.medium]:c==="medium"}),"data-disabled":r||void 0,"data-invalid":o||void 0,"data-open":i||void 0,ref:d,type:"button",children:[b&&!a?l.jsx("span",{children:s}):null,b?null:l.jsx("span",{children:a?a[0].textValue:s}),l.jsx("div",{className:h.icon,"aria-hidden":"true",children:l.jsx(ne.ChevronDown,{size:20})})]}),u]})},q=({state:e,errorMessage:t})=>l.jsx(V.$ee014567cb39d3f0$export$ff05c3ac10437e03.Provider,{value:{...e.displayValidation},children:l.jsx(V.FieldError,{children:t})}),ke=F.forwardRef(({isClearable:e=!0,popover:t,...r},c)=>{const i={selectionMode:"single",errorPosition:"top",disallowEmptySelection:!e,isClearable:e,size:"large",popover:t,...r},o=z.$df56164dff5785e2$export$4338b53315abf666(c),n=je(i),a=N.useLocalizedStringFormatter(O),{labelProps:s,triggerProps:u,valueProps:d,menuProps:y}=Se(i,n,o),{width:x}=Y.useObserveElement(o.current,{includePadding:!0});return l.jsxs(R.$bcdf0525bf22703d$export$2c73285ae9390cec,{...i,className:B.clsx(h.wrapper,i.className),children:[l.jsx(we,{...i,state:n,triggerRef:o}),l.jsx(P.LabelWrapper,{popover:t,children:i.label&&l.jsx(P.Label,{...s,"data-disabled":i.isDisabled||void 0,children:i.label})}),i.description&&l.jsx(ee.Text,{slot:"description",children:i.description}),i.errorPosition==="top"&&l.jsx(q,{...i,state:n}),l.jsx(Ve,{...i,...u,isInvalid:n.displayValidation.isInvalid,triggerRef:o,state:n,children:i.selectionMode==="multiple"&&n.selectedItems?l.jsx("span",{...d,children:l.jsx(Pe,{...i,state:n,parentWidth:x,onClear:()=>n.selectionManager.clearSelection(),triggerRef:o})}):null}),i.errorPosition==="bottom"&&l.jsx(q,{...i,state:n}),l.jsxs(S.ListBoxPopover,{isOpen:n.isOpen,onOpenChange:b=>{b||n.close()},triggerRef:o,style:{width:x},children:[i.isSelectableAll&&l.jsx(I.Checkbox,{isSelected:n.selectionManager.isSelectAll,isIndeterminate:!n.selectionManager.isSelectAll&&!n.selectionManager.isEmpty,className:h.selectAll,onChange:()=>n.selectionManager.toggleSelectAll(),children:a.format("selectAll")}),l.jsx($e,{...y,state:n})]}),i.showTags&&!!n.selectedItems&&l.jsx(j.TagGroup,{"aria-label":a.format("selectedItems"),selectionBehavior:"toggle",onRemove:b=>n.selectionManager.toggleSelection(Array.from(b)[0]),className:h.tagGroup,children:l.jsx(j.$eaf9e70818b436db$export$f9fef0f55402315b,{items:n.selectedItems,children:b=>l.jsx(j.Tag,{textValue:b.textValue,id:b.key,dismissable:!0,isDisabled:i.isDisabled,children:b.textValue},b.key)})})]})}),L=F.forwardRef(({options:e,...t},r)=>l.jsx(ke,{...t,items:e,ref:r,children:c=>c.children?l.jsx(ce,{items:c.children,title:c.name,children:i=>l.jsx(k,{textValue:i.textValue,children:i.name})},c.name):l.jsx(k,{textValue:c.textValue,children:c.name})}));L.displayName="Select";exports.Select=L;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { c as _ } from "./clsx-OuTLNxxd.js";
|
|
3
|
+
import './assets/Skeleton.css';const w = "_skeleton_toauz_11", u = "_circle_toauz_21", y = "_wave_toauz_26", k = "_onLayer01_toauz_50", e = {
|
|
4
|
+
skeleton: w,
|
|
5
|
+
circle: u,
|
|
6
|
+
wave: y,
|
|
7
|
+
onLayer01: k
|
|
8
|
+
}, z = ({
|
|
9
|
+
variant: o = "rectangle",
|
|
10
|
+
width: s,
|
|
11
|
+
height: t,
|
|
12
|
+
isAnimated: c = !0,
|
|
13
|
+
className: n,
|
|
14
|
+
style: l,
|
|
15
|
+
isOnLayer01: r,
|
|
16
|
+
...a
|
|
17
|
+
}) => (o === "circle" && t !== void 0 && console.warn(
|
|
18
|
+
"Height is not allowed when using circle, control size with width"
|
|
19
|
+
), /* @__PURE__ */ i(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: _(
|
|
23
|
+
e.skeleton,
|
|
24
|
+
e[o],
|
|
25
|
+
c && e.wave,
|
|
26
|
+
r && e.onLayer01,
|
|
27
|
+
n
|
|
28
|
+
),
|
|
29
|
+
style: { width: s, height: t, ...l },
|
|
30
|
+
...a
|
|
31
|
+
}
|
|
32
|
+
));
|
|
33
|
+
export {
|
|
34
|
+
z as S
|
|
35
|
+
};
|