@midas-ds/components 1.0.2 → 1.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/Button-DL6nqUco.js +182 -0
- package/CHANGELOG.md +15 -0
- package/Checkbox-q0dugR2t.js +402 -0
- package/{Collection-B3xUVWPF.js → Collection-KMFfVuzU.js} +179 -152
- package/Dialog-D6Bqrpn-.js +1952 -0
- package/Disclosure-dAZYXyTH.js +225 -0
- package/Disclosure.css +1 -0
- package/DragAndDrop-B0T3WgjL.js +40 -0
- package/FocusScope-B7CkxXNC.js +513 -0
- package/{Form-DXLoQL91.js → Form-BWBjJC6v.js} +79 -81
- package/Group-D7_8007y.js +42 -0
- package/Heading-RCRHv6hd.js +15 -0
- package/{Hidden-BQWDvze4.js → Hidden-CVlUgUJM.js} +1 -1
- package/Link-BnQvB-hH.js +75 -0
- package/ListBox-DBBiqvcR.js +474 -0
- package/ListKeyboardDelegate-gCXy-Xnn.js +172 -0
- package/PressResponder-B4g56kDz.js +31 -0
- package/README.md +21 -3
- package/{RSPContexts-EOiWkKOf.js → RSPContexts-BW2SEIqe.js} +2 -2
- package/SelectionManager-BfXUE1qg.js +1031 -0
- package/Separator-BBX9m2O2.js +49 -0
- package/Tag-DWt0koFj.js +728 -0
- package/Text-BCF0xvqL.js +15 -0
- package/TextField-CX4eOQf6.js +225 -0
- package/TextField.module-DdICj682.js +143 -0
- package/{VisuallyHidden-B_XzVvlX.js → VisuallyHidden-Dhr5caPC.js} +1 -1
- package/accordion/Accordion.d.ts +8 -8
- package/accordion/AccordionItem.d.ts +11 -3
- package/accordion/index.d.ts +0 -3
- package/{context-ScOIq_Gu.js → context-BpJLnOuu.js} +11 -11
- package/global.css +1 -0
- package/index-B-jHjTDC.js +120 -0
- package/{index-CorR1LBD.js → index-BPdc9gJ8.js} +3 -3
- package/{index-Dl1Q-tbj.js → index-KSgQWWiy.js} +5315 -5315
- package/index.d.ts +1 -0
- package/index.js +105 -112
- package/index10.js +1 -1
- package/index11.js +1 -1
- package/index12.js +1 -1
- package/index13.js +1 -1
- package/index14.js +1 -1
- package/index15.js +2 -2
- package/index16.js +2 -2
- package/index17.js +1 -1
- package/index18.js +1 -1
- package/index19.js +2 -2
- package/index2.js +1 -1
- package/index20.js +2 -2
- package/index21.js +1 -1
- package/index22.js +1 -1
- package/index23.js +1 -1
- package/index24.js +1 -1
- package/index25.js +2 -2
- package/index26.js +2 -2
- package/index27.js +2 -2
- package/index28.js +1 -1
- package/index29.js +2 -8
- package/index3.js +2 -4
- package/index30.js +17 -16
- package/index31.js +3 -3
- package/index32.js +3 -3
- package/index33.js +2 -2
- package/index34.js +3 -3
- package/index35.js +1 -1
- package/index36.js +2 -2
- package/index37.js +2 -2
- package/index38.js +2 -2
- package/index39.js +2 -2
- package/index4.js +1 -1
- package/index40.js +19 -12
- package/index41.js +61 -14
- package/index42.js +44 -22
- package/index43.js +13 -11
- package/index44.js +25 -4
- package/index45.js +16 -51
- package/index46.js +19 -16
- package/index47.js +49 -27
- package/index48.js +5 -18
- package/index49.js +25 -21
- package/index5.js +1 -1
- package/index50.js +16 -47
- package/index51.js +7 -3
- package/index52.js +18 -18
- package/index53.js +16 -16
- package/index54.js +6 -4
- package/index55.js +8 -21
- package/index56.js +13 -16
- package/index57.js +6 -8
- package/index58.js +6 -9
- package/index59.js +17 -13
- package/index6.js +1 -1
- package/index60.js +20 -7
- package/index61.js +59 -7
- package/index62.js +13 -17
- package/index63.js +9 -20
- package/index64.js +40 -48
- package/index65.js +85 -15
- package/index66.js +74 -11
- package/index67.js +23 -62
- package/index68.js +64 -80
- package/index69.js +68 -62
- package/index7.js +1 -1
- package/index70.js +138 -22
- package/index71.js +66 -65
- package/index72.js +40 -78
- package/index73.js +75 -133
- package/index74.js +69 -68
- package/index75.js +96 -34
- package/index76.js +258 -65
- package/index77.js +715 -63
- package/index78.js +478 -93
- package/index79.js +303 -263
- package/index8.js +1 -1
- package/index80.js +343 -678
- package/index81.js +242 -481
- package/index82.js +1329 -282
- package/index83.js +968 -350
- package/index84.js +343 -211
- package/index85.js +2025 -1288
- package/index86.js +2313 -954
- package/index87.js +6782 -339
- package/index88.js +15 -2103
- package/index89.js +12 -2369
- package/index9.js +1 -1
- package/index90.js +4 -6832
- package/index91.js +7 -15
- package/link/Link.d.ts +2 -2
- package/link-button/LinkButton.d.ts +1 -1
- package/package.json +7 -1
- package/{react.esm-D8HpDGKP.js → react.esm-sMU8Z7rL.js} +1872 -1872
- package/textfield/index.d.ts +0 -2
- package/useControlledState-Kv9K2AYu.js +30 -0
- package/{useDescription-D4_zk_sA.js → useDescription-B7stiK3j.js} +1 -1
- package/useEvent-Xk5kn5Ns.js +21 -0
- package/useField-DMzJIIN4.js +67 -0
- package/{useFilter-BnJDBCkt.js → useFilter-Bt9dbV1U.js} +1 -1
- package/useFocusRing-9PXyKy2A.js +1297 -0
- package/{useFocusable-C-N9wcwm.js → useFocusable-CcEBZe40.js} +11 -8
- package/{useGridSelectionCheckbox-i1rsjlC-.js → useGridSelectionCheckbox-DYgEnElE.js} +3 -3
- package/useHasTabbableChild-D6DwR81L.js +34 -0
- package/{useHighlightSelectionDescription-JVx2MW_e.js → useHighlightSelectionDescription-WYAbP4No.js} +19 -19
- package/useLabels-9zaZ9oa0.js +17 -0
- package/useListState-BfTeKTk5.js +119 -0
- package/{useLocalizedStringFormatter-DVCAZqcL.js → useLocalizedStringFormatter-BlCbn-hX.js} +29 -29
- package/{useSingleSelectListState-CmX9_L5H.js → useSingleSelectListState-DPkaL0la.js} +5 -5
- package/Button-CCevm2s3.js +0 -183
- package/Checkbox-CllWDBxF.js +0 -405
- package/Dialog-CLTyYwkS.js +0 -1889
- package/DragAndDrop-OTN7La7U.js +0 -42
- package/FocusScope-BR0SJ-cZ.js +0 -512
- package/Group-DPMuN3h8.js +0 -44
- package/Label-C18A_4Z5.js +0 -69
- package/Link-BU1h3K2a.js +0 -77
- package/ListBox-D21tdwTs.js +0 -463
- package/ListKeyboardDelegate-DxMjfMsI.js +0 -172
- package/PressResponder-DP8ZDNGy.js +0 -31
- package/SelectionManager-D4WtKtey.js +0 -988
- package/Separator-DLUHK9vv.js +0 -48
- package/Tag-CEd6WWSc.js +0 -725
- package/Text-DGLaY3HR.js +0 -17
- package/TextField-C_hq9WeT.js +0 -226
- package/TextField.module-Cwq1FAm7.js +0 -141
- package/accordion/AccordionContent.d.ts +0 -3
- package/accordion/AccordionTagContext.d.ts +0 -3
- package/accordion/AccordionTrigger.d.ts +0 -3
- package/index-CEg5vZQH.js +0 -132
- package/index-CgfokhRq.js +0 -674
- package/index.css +0 -1
- package/index92.js +0 -14
- package/index93.js +0 -6
- package/index94.js +0 -9
- package/useControlledState-S_TYcV_c.js +0 -45
- package/useFocusRing-D97-G3fT.js +0 -1324
- package/useHasTabbableChild-DeuCnGGv.js +0 -34
- package/useListState-DSOTbsL3.js +0 -119
package/index78.js
CHANGED
|
@@ -1,104 +1,489 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { c as
|
|
5
|
-
import {
|
|
6
|
-
import { $ as
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
icon: o,
|
|
49
|
-
iconPlacement: s,
|
|
50
|
-
className: i,
|
|
51
|
-
as: f,
|
|
52
|
-
...c
|
|
53
|
-
}) => {
|
|
54
|
-
const d = f || p, l = () => o ? /* @__PURE__ */ n(
|
|
55
|
-
o,
|
|
56
|
-
{
|
|
57
|
-
size: 20,
|
|
58
|
-
className: t.icon
|
|
1
|
+
import { jsxs as T, jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import b, { useMemo as M, useRef as E, useState as w, forwardRef as z, useCallback as J, createContext as q, useContext as Q } from "react";
|
|
3
|
+
import { a as X, $ as Y } from "./Button-DL6nqUco.js";
|
|
4
|
+
import { a as Z, $ as ee, b as ae, c as te } from "./ListBox-DBBiqvcR.js";
|
|
5
|
+
import { e as le, f as ne, g as ie, h as oe, i as de, a as se } from "./Dialog-D6Bqrpn-.js";
|
|
6
|
+
import { o as V, e as N, k as re, K as ce, I as fe, a as W, y as j, c as ue, z as be, A as $e, d as H, B as me } from "./useFocusRing-9PXyKy2A.js";
|
|
7
|
+
import { d as pe, e as ve, c as ye, $ as ge, a as xe } from "./Form-BWBjJC6v.js";
|
|
8
|
+
import { $ as he } from "./intlStrings-Cd44R5hT.js";
|
|
9
|
+
import { b as Pe, $ as De } from "./useField-DMzJIIN4.js";
|
|
10
|
+
import { $ as U } from "./Text-BCF0xvqL.js";
|
|
11
|
+
import { $ as Re } from "./Collection-KMFfVuzU.js";
|
|
12
|
+
import { $ as Se } from "./useSingleSelectListState-DPkaL0la.js";
|
|
13
|
+
import { $ as Ie, a as Be } from "./ListKeyboardDelegate-gCXy-Xnn.js";
|
|
14
|
+
import { g as Ce } from "./SelectionManager-BfXUE1qg.js";
|
|
15
|
+
import { $ as Fe } from "./VisuallyHidden-Dhr5caPC.js";
|
|
16
|
+
import { $ as ke } from "./useLocalizedStringFormatter-BlCbn-hX.js";
|
|
17
|
+
import { I as Ke } from "./TextField-CX4eOQf6.js";
|
|
18
|
+
import { C as _e } from "./chevron-down-Cd1bkzXT.js";
|
|
19
|
+
import './Select.css';const A = /* @__PURE__ */ new WeakMap();
|
|
20
|
+
function Ee(e, a, d) {
|
|
21
|
+
let { keyboardDelegate: i, isDisabled: l, isRequired: o, name: r, validationBehavior: t = "aria" } = e, n = Ie({
|
|
22
|
+
usage: "search",
|
|
23
|
+
sensitivity: "base"
|
|
24
|
+
}), c = M(() => i || new Be(a.collection, a.disabledKeys, d, n), [
|
|
25
|
+
i,
|
|
26
|
+
a.collection,
|
|
27
|
+
a.disabledKeys,
|
|
28
|
+
n
|
|
29
|
+
]), { menuTriggerProps: s, menuProps: f } = le({
|
|
30
|
+
isDisabled: l,
|
|
31
|
+
type: "listbox"
|
|
32
|
+
}, a, d), p = (u) => {
|
|
33
|
+
switch (u.key) {
|
|
34
|
+
case "ArrowLeft": {
|
|
35
|
+
var x, h;
|
|
36
|
+
u.preventDefault();
|
|
37
|
+
let R = a.selectedKey != null ? (x = c.getKeyAbove) === null || x === void 0 ? void 0 : x.call(c, a.selectedKey) : (h = c.getFirstKey) === null || h === void 0 ? void 0 : h.call(c);
|
|
38
|
+
R && a.setSelectedKey(R);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
case "ArrowRight": {
|
|
42
|
+
var K, _;
|
|
43
|
+
u.preventDefault();
|
|
44
|
+
let R = a.selectedKey != null ? (K = c.getKeyBelow) === null || K === void 0 ? void 0 : K.call(c, a.selectedKey) : (_ = c.getFirstKey) === null || _ === void 0 ? void 0 : _.call(c);
|
|
45
|
+
R && a.setSelectedKey(R);
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
59
48
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
49
|
+
}, { typeSelectProps: m } = Ce({
|
|
50
|
+
keyboardDelegate: c,
|
|
51
|
+
selectionManager: a.selectionManager,
|
|
52
|
+
onTypeSelect(u) {
|
|
53
|
+
a.setSelectedKey(u);
|
|
65
54
|
}
|
|
66
|
-
) :
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
55
|
+
}), { isInvalid: y, validationErrors: P, validationDetails: B } = a.displayValidation, { labelProps: C, fieldProps: D, descriptionProps: g, errorMessageProps: F } = Pe({
|
|
56
|
+
...e,
|
|
57
|
+
labelElementType: "span",
|
|
58
|
+
isInvalid: y,
|
|
59
|
+
errorMessage: e.errorMessage || P
|
|
60
|
+
});
|
|
61
|
+
m.onKeyDown = m.onKeyDownCapture, delete m.onKeyDownCapture;
|
|
62
|
+
let k = V(e, {
|
|
63
|
+
labelable: !0
|
|
64
|
+
}), $ = N(m, s, D), I = re();
|
|
65
|
+
return A.set(a, {
|
|
66
|
+
isDisabled: l,
|
|
67
|
+
isRequired: o,
|
|
68
|
+
name: r,
|
|
69
|
+
validationBehavior: t
|
|
70
|
+
}), {
|
|
71
|
+
labelProps: {
|
|
72
|
+
...C,
|
|
73
|
+
onClick: () => {
|
|
74
|
+
if (!e.isDisabled) {
|
|
75
|
+
var u;
|
|
76
|
+
(u = d.current) === null || u === void 0 || u.focus(), ce("keyboard");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
triggerProps: N(k, {
|
|
81
|
+
...$,
|
|
82
|
+
isDisabled: l,
|
|
83
|
+
onKeyDown: fe($.onKeyDown, p, e.onKeyDown),
|
|
84
|
+
onKeyUp: e.onKeyUp,
|
|
85
|
+
"aria-labelledby": [
|
|
86
|
+
I,
|
|
87
|
+
$["aria-labelledby"],
|
|
88
|
+
$["aria-label"] && !$["aria-labelledby"] ? $.id : null
|
|
89
|
+
].filter(Boolean).join(" "),
|
|
90
|
+
onFocus(u) {
|
|
91
|
+
a.isFocused || (e.onFocus && e.onFocus(u), e.onFocusChange && e.onFocusChange(!0), a.setFocused(!0));
|
|
92
|
+
},
|
|
93
|
+
onBlur(u) {
|
|
94
|
+
a.isOpen || (e.onBlur && e.onBlur(u), e.onFocusChange && e.onFocusChange(!1), a.setFocused(!1));
|
|
95
|
+
}
|
|
96
|
+
}),
|
|
97
|
+
valueProps: {
|
|
98
|
+
id: I
|
|
99
|
+
},
|
|
100
|
+
menuProps: {
|
|
101
|
+
...f,
|
|
102
|
+
autoFocus: a.focusStrategy || !0,
|
|
103
|
+
shouldSelectOnPressUp: !0,
|
|
104
|
+
shouldFocusOnHover: !0,
|
|
105
|
+
disallowEmptySelection: !0,
|
|
106
|
+
linkBehavior: "selection",
|
|
107
|
+
onBlur: (u) => {
|
|
108
|
+
u.currentTarget.contains(u.relatedTarget) || (e.onBlur && e.onBlur(u), e.onFocusChange && e.onFocusChange(!1), a.setFocused(!1));
|
|
109
|
+
},
|
|
110
|
+
"aria-labelledby": [
|
|
111
|
+
D["aria-labelledby"],
|
|
112
|
+
$["aria-label"] && !D["aria-labelledby"] ? $.id : null
|
|
113
|
+
].filter(Boolean).join(" ")
|
|
114
|
+
},
|
|
115
|
+
descriptionProps: g,
|
|
116
|
+
errorMessageProps: F,
|
|
117
|
+
isInvalid: y,
|
|
118
|
+
validationErrors: P,
|
|
119
|
+
validationDetails: B
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function we(e, a, d) {
|
|
123
|
+
let i = A.get(a) || {}, { autoComplete: l, name: o = i.name, isDisabled: r = i.isDisabled } = e, { validationBehavior: t, isRequired: n } = i, { visuallyHiddenProps: c } = Fe();
|
|
124
|
+
pe(e.selectRef, a.selectedKey, a.setSelectedKey), ve({
|
|
125
|
+
validationBehavior: t,
|
|
126
|
+
focus: () => {
|
|
127
|
+
var f;
|
|
128
|
+
return (f = d.current) === null || f === void 0 ? void 0 : f.focus();
|
|
71
129
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
130
|
+
}, a, e.selectRef);
|
|
131
|
+
var s;
|
|
132
|
+
return {
|
|
133
|
+
containerProps: {
|
|
134
|
+
...c,
|
|
135
|
+
"aria-hidden": !0,
|
|
136
|
+
// @ts-ignore
|
|
137
|
+
"data-react-aria-prevent-focus": !0,
|
|
138
|
+
// @ts-ignore
|
|
139
|
+
"data-a11y-ignore": "aria-hidden-focus"
|
|
140
|
+
},
|
|
141
|
+
inputProps: {
|
|
142
|
+
style: {
|
|
143
|
+
display: "none"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
selectProps: {
|
|
147
|
+
tabIndex: -1,
|
|
148
|
+
autoComplete: l,
|
|
149
|
+
disabled: r,
|
|
150
|
+
required: t === "native" && n,
|
|
151
|
+
name: o,
|
|
152
|
+
value: (s = a.selectedKey) !== null && s !== void 0 ? s : "",
|
|
153
|
+
onChange: (f) => a.setSelectedKey(f.target.value)
|
|
77
154
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function Me(e) {
|
|
158
|
+
let { state: a, triggerRef: d, label: i, name: l, isDisabled: o } = e, r = E(null), { containerProps: t, selectProps: n } = we({
|
|
159
|
+
...e,
|
|
160
|
+
selectRef: r
|
|
161
|
+
}, a, d);
|
|
162
|
+
var c;
|
|
163
|
+
return a.collection.size <= 300 ? /* @__PURE__ */ b.createElement("div", {
|
|
164
|
+
...t,
|
|
165
|
+
"data-testid": "hidden-select-container"
|
|
166
|
+
}, /* @__PURE__ */ b.createElement("label", null, i, /* @__PURE__ */ b.createElement("select", {
|
|
167
|
+
...n,
|
|
168
|
+
ref: r
|
|
169
|
+
}, /* @__PURE__ */ b.createElement("option", null), [
|
|
170
|
+
...a.collection.getKeys()
|
|
171
|
+
].map((s) => {
|
|
172
|
+
let f = a.collection.getItem(s);
|
|
173
|
+
if (f && f.type === "item") return /* @__PURE__ */ b.createElement("option", {
|
|
174
|
+
key: f.key,
|
|
175
|
+
value: f.key
|
|
176
|
+
}, f.textValue);
|
|
177
|
+
})))) : l ? /* @__PURE__ */ b.createElement("input", {
|
|
178
|
+
type: "hidden",
|
|
179
|
+
autoComplete: n.autoComplete,
|
|
180
|
+
name: l,
|
|
181
|
+
disabled: o,
|
|
182
|
+
value: (c = a.selectedKey) !== null && c !== void 0 ? c : ""
|
|
183
|
+
}) : null;
|
|
184
|
+
}
|
|
185
|
+
function qe(e) {
|
|
186
|
+
let a = ne(e), [d, i] = w(null), l = Se({
|
|
187
|
+
...e,
|
|
188
|
+
onSelectionChange: (n) => {
|
|
189
|
+
e.onSelectionChange != null && e.onSelectionChange(n), a.close(), o.commitValidation();
|
|
190
|
+
}
|
|
191
|
+
}), o = ye({
|
|
192
|
+
...e,
|
|
193
|
+
value: l.selectedKey
|
|
194
|
+
}), [r, t] = w(!1);
|
|
195
|
+
return {
|
|
196
|
+
...o,
|
|
197
|
+
...l,
|
|
198
|
+
...a,
|
|
199
|
+
focusStrategy: d,
|
|
200
|
+
open(n = null) {
|
|
201
|
+
l.collection.size !== 0 && (i(n), a.open());
|
|
202
|
+
},
|
|
203
|
+
toggle(n = null) {
|
|
204
|
+
l.collection.size !== 0 && (i(n), a.toggle());
|
|
205
|
+
},
|
|
206
|
+
isFocused: r,
|
|
207
|
+
setFocused: t
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function Ve(e) {
|
|
211
|
+
return e && e.__esModule ? e.default : e;
|
|
212
|
+
}
|
|
213
|
+
const O = /* @__PURE__ */ q(null), L = /* @__PURE__ */ q(null), Oe = /* @__PURE__ */ z(function(a, d) {
|
|
214
|
+
[a, d] = W(a, d, O);
|
|
215
|
+
let { children: i, isDisabled: l = !1, isInvalid: o = !1, isRequired: r = !1 } = a, t = M(() => typeof i == "function" ? i({
|
|
216
|
+
isOpen: !1,
|
|
217
|
+
isDisabled: l,
|
|
218
|
+
isInvalid: o,
|
|
219
|
+
isRequired: r,
|
|
220
|
+
isFocused: !1,
|
|
221
|
+
isFocusVisible: !1,
|
|
222
|
+
defaultChildren: null
|
|
223
|
+
}) : i, [
|
|
224
|
+
i,
|
|
225
|
+
l,
|
|
226
|
+
o,
|
|
227
|
+
r
|
|
228
|
+
]);
|
|
229
|
+
return /* @__PURE__ */ b.createElement(Re, {
|
|
230
|
+
content: t
|
|
231
|
+
}, (n) => /* @__PURE__ */ b.createElement(Te, {
|
|
232
|
+
props: a,
|
|
233
|
+
collection: n,
|
|
234
|
+
selectRef: d
|
|
235
|
+
}));
|
|
236
|
+
});
|
|
237
|
+
function Te({ props: e, selectRef: a, collection: d }) {
|
|
238
|
+
let { validationBehavior: i } = j(ge) || {};
|
|
239
|
+
var l, o;
|
|
240
|
+
let r = (o = (l = e.validationBehavior) !== null && l !== void 0 ? l : i) !== null && o !== void 0 ? o : "native", t = qe({
|
|
241
|
+
...e,
|
|
242
|
+
collection: d,
|
|
243
|
+
children: void 0,
|
|
244
|
+
validationBehavior: r
|
|
245
|
+
}), { isFocusVisible: n, focusProps: c } = ue({
|
|
246
|
+
within: !0
|
|
247
|
+
}), s = E(null), [f, p] = be(), { labelProps: m, triggerProps: y, valueProps: P, menuProps: B, descriptionProps: C, errorMessageProps: D, ...g } = Ee({
|
|
248
|
+
...$e(e),
|
|
249
|
+
label: p,
|
|
250
|
+
validationBehavior: r
|
|
251
|
+
}, t, s), [F, k] = w(null), $ = J(() => {
|
|
252
|
+
s.current && k(s.current.offsetWidth + "px");
|
|
253
|
+
}, [
|
|
254
|
+
s
|
|
255
|
+
]);
|
|
256
|
+
ie({
|
|
257
|
+
ref: s,
|
|
258
|
+
onResize: $
|
|
259
|
+
});
|
|
260
|
+
let I = M(() => ({
|
|
261
|
+
isOpen: t.isOpen,
|
|
262
|
+
isFocused: t.isFocused,
|
|
263
|
+
isFocusVisible: n,
|
|
264
|
+
isDisabled: e.isDisabled || !1,
|
|
265
|
+
isInvalid: g.isInvalid || !1,
|
|
266
|
+
isRequired: e.isRequired || !1
|
|
267
|
+
}), [
|
|
268
|
+
t.isOpen,
|
|
269
|
+
t.isFocused,
|
|
270
|
+
n,
|
|
271
|
+
e.isDisabled,
|
|
272
|
+
g.isInvalid,
|
|
273
|
+
e.isRequired
|
|
274
|
+
]), u = H({
|
|
275
|
+
...e,
|
|
276
|
+
values: I,
|
|
277
|
+
defaultClassName: "react-aria-Select"
|
|
278
|
+
}), x = V(e);
|
|
279
|
+
delete x.id;
|
|
280
|
+
let h = E(null);
|
|
281
|
+
return /* @__PURE__ */ b.createElement(me, {
|
|
282
|
+
values: [
|
|
283
|
+
[
|
|
284
|
+
O,
|
|
285
|
+
e
|
|
286
|
+
],
|
|
287
|
+
[
|
|
288
|
+
L,
|
|
289
|
+
t
|
|
290
|
+
],
|
|
291
|
+
[
|
|
292
|
+
G,
|
|
293
|
+
P
|
|
294
|
+
],
|
|
295
|
+
[
|
|
296
|
+
De,
|
|
297
|
+
{
|
|
298
|
+
...m,
|
|
299
|
+
ref: f,
|
|
300
|
+
elementType: "span"
|
|
301
|
+
}
|
|
302
|
+
],
|
|
303
|
+
[
|
|
304
|
+
X,
|
|
305
|
+
{
|
|
306
|
+
...y,
|
|
307
|
+
ref: s,
|
|
308
|
+
isPressed: t.isOpen
|
|
309
|
+
}
|
|
310
|
+
],
|
|
311
|
+
[
|
|
312
|
+
oe,
|
|
313
|
+
t
|
|
314
|
+
],
|
|
315
|
+
[
|
|
316
|
+
de,
|
|
317
|
+
{
|
|
318
|
+
trigger: "Select",
|
|
319
|
+
triggerRef: s,
|
|
320
|
+
scrollRef: h,
|
|
321
|
+
placement: "bottom start",
|
|
322
|
+
style: {
|
|
323
|
+
"--trigger-width": F
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
],
|
|
327
|
+
[
|
|
328
|
+
Z,
|
|
329
|
+
{
|
|
330
|
+
...B,
|
|
331
|
+
ref: h
|
|
332
|
+
}
|
|
333
|
+
],
|
|
334
|
+
[
|
|
335
|
+
ee,
|
|
336
|
+
t
|
|
337
|
+
],
|
|
338
|
+
[
|
|
339
|
+
U,
|
|
340
|
+
{
|
|
341
|
+
slots: {
|
|
342
|
+
description: C,
|
|
343
|
+
errorMessage: D
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
],
|
|
347
|
+
[
|
|
348
|
+
xe,
|
|
349
|
+
g
|
|
350
|
+
]
|
|
351
|
+
]
|
|
352
|
+
}, /* @__PURE__ */ b.createElement("div", {
|
|
353
|
+
...x,
|
|
354
|
+
...u,
|
|
355
|
+
...c,
|
|
356
|
+
ref: a,
|
|
357
|
+
slot: e.slot || void 0,
|
|
358
|
+
"data-focused": t.isFocused || void 0,
|
|
359
|
+
"data-focus-visible": n || void 0,
|
|
360
|
+
"data-open": t.isOpen || void 0,
|
|
361
|
+
"data-disabled": e.isDisabled || void 0,
|
|
362
|
+
"data-invalid": g.isInvalid || void 0,
|
|
363
|
+
"data-required": e.isRequired || void 0
|
|
364
|
+
}), /* @__PURE__ */ b.createElement(Me, {
|
|
365
|
+
autoComplete: e.autoComplete,
|
|
366
|
+
state: t,
|
|
367
|
+
triggerRef: s,
|
|
368
|
+
label: p,
|
|
369
|
+
name: e.name,
|
|
370
|
+
isDisabled: e.isDisabled
|
|
371
|
+
}));
|
|
372
|
+
}
|
|
373
|
+
const G = /* @__PURE__ */ q(null), Ne = /* @__PURE__ */ z(function(a, d) {
|
|
374
|
+
var i, l;
|
|
375
|
+
[a, d] = W(a, d, G);
|
|
376
|
+
let o = Q(L), { placeholder: r } = j(O), t = o.selectedKey != null ? o.collection.getItem(o.selectedKey) : null, n = t == null ? void 0 : t.props.children;
|
|
377
|
+
typeof n == "function" && (n = n({
|
|
378
|
+
isHovered: !1,
|
|
379
|
+
isPressed: !1,
|
|
380
|
+
isSelected: !1,
|
|
381
|
+
isFocused: !1,
|
|
382
|
+
isFocusVisible: !1,
|
|
383
|
+
isDisabled: !1,
|
|
384
|
+
selectionMode: "single",
|
|
385
|
+
selectionBehavior: "toggle"
|
|
386
|
+
}));
|
|
387
|
+
let c = ke(Ve(he), "react-aria-components");
|
|
388
|
+
var s, f, p;
|
|
389
|
+
let m = H({
|
|
390
|
+
...a,
|
|
391
|
+
defaultChildren: (s = n ?? r) !== null && s !== void 0 ? s : c.format("selectPlaceholder"),
|
|
392
|
+
defaultClassName: "react-aria-SelectValue",
|
|
393
|
+
values: {
|
|
394
|
+
selectedItem: (f = (i = o.selectedItem) === null || i === void 0 ? void 0 : i.value) !== null && f !== void 0 ? f : null,
|
|
395
|
+
selectedText: (p = (l = o.selectedItem) === null || l === void 0 ? void 0 : l.textValue) !== null && p !== void 0 ? p : null,
|
|
396
|
+
isPlaceholder: !t
|
|
397
|
+
}
|
|
398
|
+
}), y = V(a);
|
|
399
|
+
return /* @__PURE__ */ b.createElement("span", {
|
|
400
|
+
ref: d,
|
|
401
|
+
...y,
|
|
402
|
+
...m,
|
|
403
|
+
"data-placeholder": !t || void 0
|
|
404
|
+
}, /* @__PURE__ */ b.createElement(U.Provider, {
|
|
405
|
+
value: void 0
|
|
406
|
+
}, m.children));
|
|
407
|
+
}), ze = '"../theme/tokens.css"', We = '"Inter", sans-serif', je = "#000000", He = "#b31b1b", Ue = "(max-width: 767px)", Ae = "#bfbfbf", Le = "#e6e6e6", Ge = "0 0 0 2px #ffffff, 0 0 0 4px #000000", Je = "#f2f2f2", Qe = "_button_1n8ts_4", Xe = "_select_1n8ts_41", Ye = "_popover_1n8ts_57", Ze = "_listBoxItem_1n8ts_65", ea = "_icon_1n8ts_87", S = {
|
|
408
|
+
tokens: ze,
|
|
409
|
+
display: We,
|
|
410
|
+
black: je,
|
|
411
|
+
signalRed130: He,
|
|
412
|
+
smBreakpoint: Ue,
|
|
413
|
+
gray50: Ae,
|
|
414
|
+
gray20: Le,
|
|
415
|
+
focus: Ge,
|
|
416
|
+
backgroundSecondary: Je,
|
|
417
|
+
button: Qe,
|
|
418
|
+
select: Xe,
|
|
419
|
+
popover: Ye,
|
|
420
|
+
listBoxItem: Ze,
|
|
421
|
+
icon: ea
|
|
422
|
+
};
|
|
423
|
+
function ga({
|
|
424
|
+
label: e,
|
|
425
|
+
description: a,
|
|
426
|
+
errorMessage: d,
|
|
427
|
+
children: i,
|
|
428
|
+
items: l,
|
|
429
|
+
...o
|
|
430
|
+
}) {
|
|
431
|
+
const r = b.useRef(null);
|
|
432
|
+
return /* @__PURE__ */ T(
|
|
433
|
+
Oe,
|
|
81
434
|
{
|
|
82
|
-
className:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
e === "secondary" && t.secondary,
|
|
86
|
-
e === "tertiary" && t.tertiary,
|
|
87
|
-
e === "danger" && t.danger,
|
|
88
|
-
e === "icon" && t.iconBtn,
|
|
89
|
-
r && t.fullwidth,
|
|
90
|
-
s === "left" && t.iconLeft,
|
|
91
|
-
i
|
|
92
|
-
),
|
|
93
|
-
...c,
|
|
435
|
+
className: S.select,
|
|
436
|
+
ref: r,
|
|
437
|
+
...o,
|
|
94
438
|
children: [
|
|
95
|
-
|
|
96
|
-
|
|
439
|
+
/* @__PURE__ */ v(
|
|
440
|
+
Ke,
|
|
441
|
+
{
|
|
442
|
+
label: e,
|
|
443
|
+
description: a,
|
|
444
|
+
errorMessage: d,
|
|
445
|
+
children: /* @__PURE__ */ T(Y, { className: S.button, children: [
|
|
446
|
+
/* @__PURE__ */ v(Ne, {}),
|
|
447
|
+
/* @__PURE__ */ v(
|
|
448
|
+
"div",
|
|
449
|
+
{
|
|
450
|
+
className: S.icon,
|
|
451
|
+
"aria-hidden": "true",
|
|
452
|
+
children: /* @__PURE__ */ v(
|
|
453
|
+
_e,
|
|
454
|
+
{
|
|
455
|
+
size: 20,
|
|
456
|
+
"aria-hidden": !0
|
|
457
|
+
}
|
|
458
|
+
)
|
|
459
|
+
}
|
|
460
|
+
)
|
|
461
|
+
] })
|
|
462
|
+
}
|
|
463
|
+
),
|
|
464
|
+
/* @__PURE__ */ v(
|
|
465
|
+
se,
|
|
466
|
+
{
|
|
467
|
+
className: S.popover,
|
|
468
|
+
offset: 0,
|
|
469
|
+
UNSTABLE_portalContainer: r.current || void 0,
|
|
470
|
+
children: /* @__PURE__ */ v(ae, { items: l, children: i })
|
|
471
|
+
}
|
|
472
|
+
)
|
|
97
473
|
]
|
|
98
474
|
}
|
|
99
475
|
);
|
|
100
|
-
}
|
|
476
|
+
}
|
|
477
|
+
function xa(e) {
|
|
478
|
+
return /* @__PURE__ */ v(
|
|
479
|
+
te,
|
|
480
|
+
{
|
|
481
|
+
className: S.listBoxItem,
|
|
482
|
+
...e
|
|
483
|
+
}
|
|
484
|
+
);
|
|
485
|
+
}
|
|
101
486
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
487
|
+
xa as Item,
|
|
488
|
+
ga as Select
|
|
104
489
|
};
|