@midas-ds/components 1.0.2
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/Breadcrumbs.css +1 -0
- package/Button-CCevm2s3.js +183 -0
- package/Button.css +1 -0
- package/ButtonGroup.css +1 -0
- package/CHANGELOG.md +76 -0
- package/Card.css +1 -0
- package/Checkbox-CllWDBxF.js +405 -0
- package/Checkbox.css +1 -0
- package/Collection-B3xUVWPF.js +483 -0
- package/ComboBox.css +1 -0
- package/DatePicker.css +1 -0
- package/Dialog-CLTyYwkS.js +1889 -0
- package/DragAndDrop-OTN7La7U.js +42 -0
- package/Dropdown.css +1 -0
- package/FileUpload.css +1 -0
- package/Flex.css +1 -0
- package/Flex.module-CpoxBzQX.js +37 -0
- package/FocusScope-BR0SJ-cZ.js +512 -0
- package/Form-DXLoQL91.js +240 -0
- package/Grid.css +1 -0
- package/Grid.module-Ia0e9Dix.js +36 -0
- package/Group-DPMuN3h8.js +44 -0
- package/Hidden-BQWDvze4.js +37 -0
- package/InfoBanner.css +1 -0
- package/Label-C18A_4Z5.js +69 -0
- package/Layout.css +1 -0
- package/Link-BU1h3K2a.js +77 -0
- package/Link.css +1 -0
- package/LinkButton.css +1 -0
- package/ListBox-D21tdwTs.js +463 -0
- package/ListKeyboardDelegate-DxMjfMsI.js +172 -0
- package/Logo.css +1 -0
- package/Modal.css +1 -0
- package/MultiSelect.css +1 -0
- package/PressResponder-DP8ZDNGy.js +31 -0
- package/README.md +7 -0
- package/RSPContexts-EOiWkKOf.js +11 -0
- package/Radio.css +1 -0
- package/SearchField.css +1 -0
- package/Select.css +1 -0
- package/SelectionManager-D4WtKtey.js +988 -0
- package/Separator-DLUHK9vv.js +48 -0
- package/Spinner.css +1 -0
- package/Table.css +1 -0
- package/Tabs.css +1 -0
- package/Tag-CEd6WWSc.js +725 -0
- package/Tag.css +1 -0
- package/Text-DGLaY3HR.js +17 -0
- package/TextArea.css +1 -0
- package/TextField-C_hq9WeT.js +226 -0
- package/TextField.css +1 -0
- package/TextField.module-Cwq1FAm7.js +141 -0
- package/Toast.css +1 -0
- package/VisuallyHidden-B_XzVvlX.js +39 -0
- package/accordion/Accordion.d.ts +13 -0
- package/accordion/AccordionContent.d.ts +3 -0
- package/accordion/AccordionItem.d.ts +3 -0
- package/accordion/AccordionTagContext.d.ts +3 -0
- package/accordion/AccordionTrigger.d.ts +3 -0
- package/accordion/index.d.ts +5 -0
- package/breadcrumbs/Breadcrumbs.d.ts +9 -0
- package/breadcrumbs/index.d.ts +1 -0
- package/button/Button.d.ts +41 -0
- package/button/ButtonGroup.d.ts +12 -0
- package/button/index.d.ts +2 -0
- package/card/Card.d.ts +34 -0
- package/card/index.d.ts +1 -0
- package/checkbox/Checkbox.d.ts +2 -0
- package/checkbox/CheckboxGroup.d.ts +10 -0
- package/checkbox/index.d.ts +2 -0
- package/chevron-down-Cd1bkzXT.js +13 -0
- package/chevron-right-DBMc9VMi.js +23 -0
- package/clsx-OuTLNxxd.js +16 -0
- package/combobox/ComboBox.d.ts +12 -0
- package/combobox/index.d.ts +1 -0
- package/context-ScOIq_Gu.js +80 -0
- package/createLucideIcon-DeWljiyi.js +79 -0
- package/date-picker/DatePicker.d.ts +14 -0
- package/date-picker/index.d.ts +2 -0
- package/dropdown/Dropdown.d.ts +8 -0
- package/dropdown/index.d.ts +1 -0
- package/file-upload/FileUpload.d.ts +11 -0
- package/file-upload/index.d.ts +1 -0
- package/flex/Flex.d.ts +17 -0
- package/flex/FlexItem.d.ts +15 -0
- package/flex/index.d.ts +2 -0
- package/grid/Grid.d.ts +16 -0
- package/grid/GridItem.d.ts +7 -0
- package/grid/index.d.ts +2 -0
- package/index-CEg5vZQH.js +132 -0
- package/index-CgfokhRq.js +674 -0
- package/index-CorR1LBD.js +3122 -0
- package/index-Dl1Q-tbj.js +26984 -0
- package/index.css +1 -0
- package/index.d.ts +29 -0
- package/index.js +114 -0
- package/index10.js +4 -0
- package/index11.js +5 -0
- package/index12.js +4 -0
- package/index13.js +4 -0
- package/index14.js +4 -0
- package/index15.js +6 -0
- package/index16.js +6 -0
- package/index17.js +6 -0
- package/index18.js +4 -0
- package/index19.js +6 -0
- package/index2.js +8 -0
- package/index20.js +6 -0
- package/index21.js +4 -0
- package/index22.js +5 -0
- package/index23.js +5 -0
- package/index24.js +5 -0
- package/index25.js +6 -0
- package/index26.js +6 -0
- package/index27.js +6 -0
- package/index28.js +4 -0
- package/index29.js +12 -0
- package/index3.js +8 -0
- package/index30.js +20 -0
- package/index31.js +22 -0
- package/index32.js +14 -0
- package/index33.js +11 -0
- package/index34.js +31 -0
- package/index35.js +8 -0
- package/index36.js +9 -0
- package/index37.js +19 -0
- package/index38.js +9 -0
- package/index39.js +9 -0
- package/index4.js +4 -0
- package/index40.js +16 -0
- package/index41.js +16 -0
- package/index42.js +31 -0
- package/index43.js +16 -0
- package/index44.js +6 -0
- package/index45.js +53 -0
- package/index46.js +18 -0
- package/index47.js +27 -0
- package/index48.js +18 -0
- package/index49.js +21 -0
- package/index5.js +5 -0
- package/index50.js +49 -0
- package/index51.js +5 -0
- package/index52.js +25 -0
- package/index53.js +18 -0
- package/index54.js +9 -0
- package/index55.js +25 -0
- package/index56.js +18 -0
- package/index57.js +11 -0
- package/index58.js +12 -0
- package/index59.js +15 -0
- package/index6.js +4 -0
- package/index60.js +9 -0
- package/index61.js +9 -0
- package/index62.js +19 -0
- package/index63.js +22 -0
- package/index64.js +61 -0
- package/index65.js +15 -0
- package/index66.js +11 -0
- package/index67.js +63 -0
- package/index68.js +85 -0
- package/index69.js +74 -0
- package/index7.js +9 -0
- package/index70.js +24 -0
- package/index71.js +69 -0
- package/index72.js +80 -0
- package/index73.js +140 -0
- package/index74.js +70 -0
- package/index75.js +42 -0
- package/index76.js +82 -0
- package/index77.js +71 -0
- package/index78.js +104 -0
- package/index79.js +274 -0
- package/index8.js +4 -0
- package/index80.js +724 -0
- package/index81.js +491 -0
- package/index82.js +317 -0
- package/index83.js +391 -0
- package/index84.js +254 -0
- package/index85.js +1364 -0
- package/index86.js +1009 -0
- package/index87.js +388 -0
- package/index88.js +2105 -0
- package/index89.js +2371 -0
- package/index9.js +5 -0
- package/index90.js +6834 -0
- package/index91.js +17 -0
- package/index92.js +14 -0
- package/index93.js +6 -0
- package/index94.js +9 -0
- package/info-banner/InfoBanner.d.ts +21 -0
- package/info-banner/index.d.ts +1 -0
- package/intlStrings-Cd44R5hT.js +278 -0
- package/layout/Layout.d.ts +51 -0
- package/layout/index.d.ts +1 -0
- package/link/Link.d.ts +13 -0
- package/link/index.d.ts +1 -0
- package/link-button/LinkButton.d.ts +18 -0
- package/link-button/index.d.ts +1 -0
- package/logo/Logo.d.ts +16 -0
- package/logo/index.d.ts +1 -0
- package/modal/Modal.d.ts +13 -0
- package/modal/index.d.ts +1 -0
- package/multi-select/MultiSelect.d.ts +28 -0
- package/multi-select/index.d.ts +1 -0
- package/package.json +29 -0
- package/radio/Radio.d.ts +20 -0
- package/radio/index.d.ts +1 -0
- package/react.esm-D8HpDGKP.js +11060 -0
- package/search-field/SearchField.d.ts +13 -0
- package/search-field/index.d.ts +1 -0
- package/select/Select.d.ts +11 -0
- package/select/index.d.ts +1 -0
- package/spinner/Spinner.d.ts +11 -0
- package/spinner/index.d.ts +1 -0
- package/table/Table.d.ts +12 -0
- package/table/index.d.ts +1 -0
- package/tabs/Tabs.d.ts +12 -0
- package/tabs/index.d.ts +1 -0
- package/tag/Tag.d.ts +11 -0
- package/tag/index.d.ts +1 -0
- package/textarea/TextArea.d.ts +20 -0
- package/textarea/index.d.ts +1 -0
- package/textfield/TextField.d.ts +16 -0
- package/textfield/index.d.ts +3 -0
- package/theme/index.d.ts +138 -0
- package/theme/tokens.d.ts +135 -0
- package/toast/Toast.d.ts +25 -0
- package/toast/index.d.ts +1 -0
- package/tokens-CjXmpXTi.js +160 -0
- package/triangle-alert-1OYl9KWz.js +56 -0
- package/useControlledState-S_TYcV_c.js +45 -0
- package/useDescription-D4_zk_sA.js +32 -0
- package/useFilter-BnJDBCkt.js +35 -0
- package/useFocusRing-D97-G3fT.js +1324 -0
- package/useFocusable-C-N9wcwm.js +56 -0
- package/useGridSelectionCheckbox-i1rsjlC-.js +22 -0
- package/useHasTabbableChild-DeuCnGGv.js +34 -0
- package/useHighlightSelectionDescription-JVx2MW_e.js +552 -0
- package/useListState-DSOTbsL3.js +119 -0
- package/useLocalizedStringFormatter-DVCAZqcL.js +96 -0
- package/useSingleSelectListState-CmX9_L5H.js +34 -0
- package/useUpdateEffect-Dtz-i14F.js +12 -0
- package/x-JK7i-TQC.js +14 -0
package/index81.js
ADDED
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
import { jsxs as T, jsx as p } 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-CCevm2s3.js";
|
|
4
|
+
import { a as Z, $ as ee, b as ae, c as te } from "./ListBox-D21tdwTs.js";
|
|
5
|
+
import { e as le, f as ie, g as oe, h as se, i as re, a as ne } from "./Dialog-CLTyYwkS.js";
|
|
6
|
+
import { n as V, e as N, k as de, G as ce, D as fe, a as W, u as j, c as ue, v as be, w as $e, d as H, x as ve } from "./useFocusRing-D97-G3fT.js";
|
|
7
|
+
import { a as me, b as pe, $ as ye, c as ge, d as xe } from "./Form-DXLoQL91.js";
|
|
8
|
+
import { $ as he } from "./intlStrings-Cd44R5hT.js";
|
|
9
|
+
import { $ as Pe, a as De } from "./Label-C18A_4Z5.js";
|
|
10
|
+
import { $ as U } from "./Text-DGLaY3HR.js";
|
|
11
|
+
import { c as Re } from "./Collection-B3xUVWPF.js";
|
|
12
|
+
import { $ as Se } from "./useSingleSelectListState-CmX9_L5H.js";
|
|
13
|
+
import { $ as Ie, a as Be } from "./ListKeyboardDelegate-DxMjfMsI.js";
|
|
14
|
+
import { g as Fe } from "./SelectionManager-D4WtKtey.js";
|
|
15
|
+
import { $ as Ce } from "./VisuallyHidden-B_XzVvlX.js";
|
|
16
|
+
import { $ as ke } from "./useLocalizedStringFormatter-DVCAZqcL.js";
|
|
17
|
+
import { I as Ke } from "./TextField-C_hq9WeT.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, i) {
|
|
21
|
+
let { keyboardDelegate: o, isDisabled: l, isRequired: d, name: s, validationBehavior: t = "aria" } = e, c = Ie({
|
|
22
|
+
usage: "search",
|
|
23
|
+
sensitivity: "base"
|
|
24
|
+
}), r = M(() => o || new Be(a.collection, a.disabledKeys, i, c), [
|
|
25
|
+
o,
|
|
26
|
+
a.collection,
|
|
27
|
+
a.disabledKeys,
|
|
28
|
+
c
|
|
29
|
+
]), { menuTriggerProps: n, menuProps: f } = le({
|
|
30
|
+
isDisabled: l,
|
|
31
|
+
type: "listbox"
|
|
32
|
+
}, a, i), m = (u) => {
|
|
33
|
+
switch (u.key) {
|
|
34
|
+
case "ArrowLeft": {
|
|
35
|
+
var g, x;
|
|
36
|
+
u.preventDefault();
|
|
37
|
+
let D = a.selectedKey != null ? (g = r.getKeyAbove) === null || g === void 0 ? void 0 : g.call(r, a.selectedKey) : (x = r.getFirstKey) === null || x === void 0 ? void 0 : x.call(r);
|
|
38
|
+
D && a.setSelectedKey(D);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
case "ArrowRight": {
|
|
42
|
+
var K, _;
|
|
43
|
+
u.preventDefault();
|
|
44
|
+
let D = a.selectedKey != null ? (K = r.getKeyBelow) === null || K === void 0 ? void 0 : K.call(r, a.selectedKey) : (_ = r.getFirstKey) === null || _ === void 0 ? void 0 : _.call(r);
|
|
45
|
+
D && a.setSelectedKey(D);
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, { typeSelectProps: v } = Fe({
|
|
50
|
+
keyboardDelegate: r,
|
|
51
|
+
selectionManager: a.selectionManager,
|
|
52
|
+
onTypeSelect(u) {
|
|
53
|
+
a.setSelectedKey(u);
|
|
54
|
+
}
|
|
55
|
+
}), { isInvalid: h, validationErrors: S, validationDetails: B } = a.displayValidation, { labelProps: F, fieldProps: P, descriptionProps: y, errorMessageProps: C } = Pe({
|
|
56
|
+
...e,
|
|
57
|
+
labelElementType: "span",
|
|
58
|
+
isInvalid: h,
|
|
59
|
+
errorMessage: e.errorMessage || S
|
|
60
|
+
});
|
|
61
|
+
v.onKeyDown = v.onKeyDownCapture, delete v.onKeyDownCapture;
|
|
62
|
+
let k = V(e, {
|
|
63
|
+
labelable: !0
|
|
64
|
+
}), $ = N(v, n, P), I = de();
|
|
65
|
+
return A.set(a, {
|
|
66
|
+
isDisabled: l,
|
|
67
|
+
isRequired: d,
|
|
68
|
+
name: s,
|
|
69
|
+
validationBehavior: t
|
|
70
|
+
}), {
|
|
71
|
+
labelProps: {
|
|
72
|
+
...F,
|
|
73
|
+
onClick: () => {
|
|
74
|
+
if (!e.isDisabled) {
|
|
75
|
+
var u;
|
|
76
|
+
(u = i.current) === null || u === void 0 || u.focus(), ce("keyboard");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
triggerProps: N(k, {
|
|
81
|
+
...$,
|
|
82
|
+
isDisabled: l,
|
|
83
|
+
onKeyDown: fe($.onKeyDown, m, 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
|
+
P["aria-labelledby"],
|
|
112
|
+
$["aria-label"] && !P["aria-labelledby"] ? $.id : null
|
|
113
|
+
].filter(Boolean).join(" ")
|
|
114
|
+
},
|
|
115
|
+
descriptionProps: y,
|
|
116
|
+
errorMessageProps: C,
|
|
117
|
+
isInvalid: h,
|
|
118
|
+
validationErrors: S,
|
|
119
|
+
validationDetails: B
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function we(e, a, i) {
|
|
123
|
+
let o = A.get(a) || {}, { autoComplete: l, name: d = o.name, isDisabled: s = o.isDisabled } = e, { validationBehavior: t, isRequired: c } = o, { visuallyHiddenProps: r } = Ce();
|
|
124
|
+
me(e.selectRef, a.selectedKey, a.setSelectedKey), pe({
|
|
125
|
+
validationBehavior: t,
|
|
126
|
+
focus: () => {
|
|
127
|
+
var f;
|
|
128
|
+
return (f = i.current) === null || f === void 0 ? void 0 : f.focus();
|
|
129
|
+
}
|
|
130
|
+
}, a, e.selectRef);
|
|
131
|
+
var n;
|
|
132
|
+
return {
|
|
133
|
+
containerProps: {
|
|
134
|
+
...r,
|
|
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: s,
|
|
150
|
+
required: t === "native" && c,
|
|
151
|
+
name: d,
|
|
152
|
+
value: (n = a.selectedKey) !== null && n !== void 0 ? n : "",
|
|
153
|
+
onChange: (f) => a.setSelectedKey(f.target.value)
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function Me(e) {
|
|
158
|
+
let { state: a, triggerRef: i, label: o, name: l, isDisabled: d } = e, s = E(null), { containerProps: t, selectProps: c } = we({
|
|
159
|
+
...e,
|
|
160
|
+
selectRef: s
|
|
161
|
+
}, a, i);
|
|
162
|
+
var r;
|
|
163
|
+
return a.collection.size <= 300 ? /* @__PURE__ */ b.createElement("div", {
|
|
164
|
+
...t,
|
|
165
|
+
"data-testid": "hidden-select-container"
|
|
166
|
+
}, /* @__PURE__ */ b.createElement("label", null, o, /* @__PURE__ */ b.createElement("select", {
|
|
167
|
+
...c,
|
|
168
|
+
ref: s
|
|
169
|
+
}, /* @__PURE__ */ b.createElement("option", null), [
|
|
170
|
+
...a.collection.getKeys()
|
|
171
|
+
].map((n) => {
|
|
172
|
+
let f = a.collection.getItem(n);
|
|
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: c.autoComplete,
|
|
180
|
+
name: l,
|
|
181
|
+
disabled: d,
|
|
182
|
+
value: (r = a.selectedKey) !== null && r !== void 0 ? r : ""
|
|
183
|
+
}) : null;
|
|
184
|
+
}
|
|
185
|
+
function qe(e) {
|
|
186
|
+
let a = ie(e), [i, o] = w(null), l = Se({
|
|
187
|
+
...e,
|
|
188
|
+
onSelectionChange: (c) => {
|
|
189
|
+
e.onSelectionChange != null && e.onSelectionChange(c), a.close(), d.commitValidation();
|
|
190
|
+
}
|
|
191
|
+
}), d = ye({
|
|
192
|
+
...e,
|
|
193
|
+
value: l.selectedKey
|
|
194
|
+
}), [s, t] = w(!1);
|
|
195
|
+
return {
|
|
196
|
+
...d,
|
|
197
|
+
...l,
|
|
198
|
+
...a,
|
|
199
|
+
focusStrategy: i,
|
|
200
|
+
open(c = null) {
|
|
201
|
+
l.collection.size !== 0 && (o(c), a.open());
|
|
202
|
+
},
|
|
203
|
+
toggle(c = null) {
|
|
204
|
+
l.collection.size !== 0 && (o(c), a.toggle());
|
|
205
|
+
},
|
|
206
|
+
isFocused: s,
|
|
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);
|
|
214
|
+
function Oe(e, a) {
|
|
215
|
+
[e, a] = W(e, a, O);
|
|
216
|
+
let { children: i, isDisabled: o = !1, isInvalid: l = !1, isRequired: d = !1 } = e, s = M(() => typeof i == "function" ? i({
|
|
217
|
+
isOpen: !1,
|
|
218
|
+
isDisabled: o,
|
|
219
|
+
isInvalid: l,
|
|
220
|
+
isRequired: d,
|
|
221
|
+
isFocused: !1,
|
|
222
|
+
isFocusVisible: !1,
|
|
223
|
+
defaultChildren: null
|
|
224
|
+
}) : i, [
|
|
225
|
+
i,
|
|
226
|
+
o,
|
|
227
|
+
l,
|
|
228
|
+
d
|
|
229
|
+
]);
|
|
230
|
+
return /* @__PURE__ */ b.createElement(Re, {
|
|
231
|
+
content: s
|
|
232
|
+
}, (t) => /* @__PURE__ */ b.createElement(Te, {
|
|
233
|
+
props: e,
|
|
234
|
+
collection: t,
|
|
235
|
+
selectRef: a
|
|
236
|
+
}));
|
|
237
|
+
}
|
|
238
|
+
function Te({ props: e, selectRef: a, collection: i }) {
|
|
239
|
+
let { validationBehavior: o } = j(ge) || {};
|
|
240
|
+
var l, d;
|
|
241
|
+
let s = (d = (l = e.validationBehavior) !== null && l !== void 0 ? l : o) !== null && d !== void 0 ? d : "native", t = qe({
|
|
242
|
+
...e,
|
|
243
|
+
collection: i,
|
|
244
|
+
children: void 0,
|
|
245
|
+
validationBehavior: s
|
|
246
|
+
}), { isFocusVisible: c, focusProps: r } = ue({
|
|
247
|
+
within: !0
|
|
248
|
+
}), n = E(null), [f, m] = be(), { labelProps: v, triggerProps: h, valueProps: S, menuProps: B, descriptionProps: F, errorMessageProps: P, ...y } = Ee({
|
|
249
|
+
...$e(e),
|
|
250
|
+
label: m,
|
|
251
|
+
validationBehavior: s
|
|
252
|
+
}, t, n), [C, k] = w(null), $ = J(() => {
|
|
253
|
+
n.current && k(n.current.offsetWidth + "px");
|
|
254
|
+
}, [
|
|
255
|
+
n
|
|
256
|
+
]);
|
|
257
|
+
oe({
|
|
258
|
+
ref: n,
|
|
259
|
+
onResize: $
|
|
260
|
+
});
|
|
261
|
+
let I = M(() => ({
|
|
262
|
+
isOpen: t.isOpen,
|
|
263
|
+
isFocused: t.isFocused,
|
|
264
|
+
isFocusVisible: c,
|
|
265
|
+
isDisabled: e.isDisabled || !1,
|
|
266
|
+
isInvalid: y.isInvalid || !1,
|
|
267
|
+
isRequired: e.isRequired || !1
|
|
268
|
+
}), [
|
|
269
|
+
t.isOpen,
|
|
270
|
+
t.isFocused,
|
|
271
|
+
c,
|
|
272
|
+
e.isDisabled,
|
|
273
|
+
y.isInvalid,
|
|
274
|
+
e.isRequired
|
|
275
|
+
]), u = H({
|
|
276
|
+
...e,
|
|
277
|
+
values: I,
|
|
278
|
+
defaultClassName: "react-aria-Select"
|
|
279
|
+
}), g = V(e);
|
|
280
|
+
delete g.id;
|
|
281
|
+
let x = E(null);
|
|
282
|
+
return /* @__PURE__ */ b.createElement(ve, {
|
|
283
|
+
values: [
|
|
284
|
+
[
|
|
285
|
+
O,
|
|
286
|
+
e
|
|
287
|
+
],
|
|
288
|
+
[
|
|
289
|
+
L,
|
|
290
|
+
t
|
|
291
|
+
],
|
|
292
|
+
[
|
|
293
|
+
G,
|
|
294
|
+
S
|
|
295
|
+
],
|
|
296
|
+
[
|
|
297
|
+
De,
|
|
298
|
+
{
|
|
299
|
+
...v,
|
|
300
|
+
ref: f,
|
|
301
|
+
elementType: "span"
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
[
|
|
305
|
+
X,
|
|
306
|
+
{
|
|
307
|
+
...h,
|
|
308
|
+
ref: n,
|
|
309
|
+
isPressed: t.isOpen
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
[
|
|
313
|
+
se,
|
|
314
|
+
t
|
|
315
|
+
],
|
|
316
|
+
[
|
|
317
|
+
re,
|
|
318
|
+
{
|
|
319
|
+
trigger: "Select",
|
|
320
|
+
triggerRef: n,
|
|
321
|
+
scrollRef: x,
|
|
322
|
+
placement: "bottom start",
|
|
323
|
+
style: {
|
|
324
|
+
"--trigger-width": C
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
],
|
|
328
|
+
[
|
|
329
|
+
Z,
|
|
330
|
+
{
|
|
331
|
+
...B,
|
|
332
|
+
ref: x
|
|
333
|
+
}
|
|
334
|
+
],
|
|
335
|
+
[
|
|
336
|
+
ee,
|
|
337
|
+
t
|
|
338
|
+
],
|
|
339
|
+
[
|
|
340
|
+
U,
|
|
341
|
+
{
|
|
342
|
+
slots: {
|
|
343
|
+
description: F,
|
|
344
|
+
errorMessage: P
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
[
|
|
349
|
+
xe,
|
|
350
|
+
y
|
|
351
|
+
]
|
|
352
|
+
]
|
|
353
|
+
}, /* @__PURE__ */ b.createElement("div", {
|
|
354
|
+
...g,
|
|
355
|
+
...u,
|
|
356
|
+
...r,
|
|
357
|
+
ref: a,
|
|
358
|
+
slot: e.slot || void 0,
|
|
359
|
+
"data-focused": t.isFocused || void 0,
|
|
360
|
+
"data-focus-visible": c || void 0,
|
|
361
|
+
"data-open": t.isOpen || void 0,
|
|
362
|
+
"data-disabled": e.isDisabled || void 0,
|
|
363
|
+
"data-invalid": y.isInvalid || void 0,
|
|
364
|
+
"data-required": e.isRequired || void 0
|
|
365
|
+
}), /* @__PURE__ */ b.createElement(Me, {
|
|
366
|
+
state: t,
|
|
367
|
+
triggerRef: n,
|
|
368
|
+
label: m,
|
|
369
|
+
name: e.name,
|
|
370
|
+
isDisabled: e.isDisabled
|
|
371
|
+
}));
|
|
372
|
+
}
|
|
373
|
+
const Ne = /* @__PURE__ */ z(Oe), G = /* @__PURE__ */ q(null);
|
|
374
|
+
function ze(e, a) {
|
|
375
|
+
var i, o;
|
|
376
|
+
[e, a] = W(e, a, G);
|
|
377
|
+
let l = Q(L), { placeholder: d } = j(O), s = l.selectedKey != null ? l.collection.getItem(l.selectedKey) : null, t = s == null ? void 0 : s.props.children;
|
|
378
|
+
typeof t == "function" && (t = t({
|
|
379
|
+
isHovered: !1,
|
|
380
|
+
isPressed: !1,
|
|
381
|
+
isSelected: !1,
|
|
382
|
+
isFocused: !1,
|
|
383
|
+
isFocusVisible: !1,
|
|
384
|
+
isDisabled: !1,
|
|
385
|
+
selectionMode: "single",
|
|
386
|
+
selectionBehavior: "toggle"
|
|
387
|
+
}));
|
|
388
|
+
let c = ke(Ve(he), "react-aria-components");
|
|
389
|
+
var r, n, f;
|
|
390
|
+
let m = H({
|
|
391
|
+
...e,
|
|
392
|
+
defaultChildren: (r = t ?? d) !== null && r !== void 0 ? r : c.format("selectPlaceholder"),
|
|
393
|
+
defaultClassName: "react-aria-SelectValue",
|
|
394
|
+
values: {
|
|
395
|
+
selectedItem: (n = (i = l.selectedItem) === null || i === void 0 ? void 0 : i.value) !== null && n !== void 0 ? n : null,
|
|
396
|
+
selectedText: (f = (o = l.selectedItem) === null || o === void 0 ? void 0 : o.textValue) !== null && f !== void 0 ? f : null,
|
|
397
|
+
isPlaceholder: !s
|
|
398
|
+
}
|
|
399
|
+
}), v = V(e);
|
|
400
|
+
return /* @__PURE__ */ b.createElement("span", {
|
|
401
|
+
ref: a,
|
|
402
|
+
...v,
|
|
403
|
+
...m,
|
|
404
|
+
"data-placeholder": !s || void 0
|
|
405
|
+
}, /* @__PURE__ */ b.createElement(U.Provider, {
|
|
406
|
+
value: void 0
|
|
407
|
+
}, m.children));
|
|
408
|
+
}
|
|
409
|
+
const We = /* @__PURE__ */ z(ze), je = '"../theme/tokens.css"', He = '"Inter", sans-serif', Ue = "#000000", Ae = "#b31b1b", Le = "(max-width: 767px)", Ge = "#bfbfbf", Je = "#e6e6e6", Qe = "0 0 0 2px #ffffff, 0 0 0 4px #000000", Xe = "#f2f2f2", Ye = "_button_1n8ts_4", Ze = "_select_1n8ts_41", ea = "_popover_1n8ts_57", aa = "_listBoxItem_1n8ts_65", ta = "_icon_1n8ts_87", R = {
|
|
410
|
+
tokens: je,
|
|
411
|
+
display: He,
|
|
412
|
+
black: Ue,
|
|
413
|
+
signalRed130: Ae,
|
|
414
|
+
smBreakpoint: Le,
|
|
415
|
+
gray50: Ge,
|
|
416
|
+
gray20: Je,
|
|
417
|
+
focus: Qe,
|
|
418
|
+
backgroundSecondary: Xe,
|
|
419
|
+
button: Ye,
|
|
420
|
+
select: Ze,
|
|
421
|
+
popover: ea,
|
|
422
|
+
listBoxItem: aa,
|
|
423
|
+
icon: ta
|
|
424
|
+
};
|
|
425
|
+
function ha({
|
|
426
|
+
label: e,
|
|
427
|
+
description: a,
|
|
428
|
+
errorMessage: i,
|
|
429
|
+
children: o,
|
|
430
|
+
items: l,
|
|
431
|
+
...d
|
|
432
|
+
}) {
|
|
433
|
+
const s = b.useRef(null);
|
|
434
|
+
return /* @__PURE__ */ T(
|
|
435
|
+
Ne,
|
|
436
|
+
{
|
|
437
|
+
className: R.select,
|
|
438
|
+
ref: s,
|
|
439
|
+
...d,
|
|
440
|
+
children: [
|
|
441
|
+
/* @__PURE__ */ p(
|
|
442
|
+
Ke,
|
|
443
|
+
{
|
|
444
|
+
label: e,
|
|
445
|
+
description: a,
|
|
446
|
+
errorMessage: i,
|
|
447
|
+
children: /* @__PURE__ */ T(Y, { className: R.button, children: [
|
|
448
|
+
/* @__PURE__ */ p(We, {}),
|
|
449
|
+
/* @__PURE__ */ p(
|
|
450
|
+
"div",
|
|
451
|
+
{
|
|
452
|
+
className: R.icon,
|
|
453
|
+
"aria-hidden": "true",
|
|
454
|
+
children: /* @__PURE__ */ p(
|
|
455
|
+
_e,
|
|
456
|
+
{
|
|
457
|
+
size: 20,
|
|
458
|
+
"aria-hidden": !0
|
|
459
|
+
}
|
|
460
|
+
)
|
|
461
|
+
}
|
|
462
|
+
)
|
|
463
|
+
] })
|
|
464
|
+
}
|
|
465
|
+
),
|
|
466
|
+
/* @__PURE__ */ p(
|
|
467
|
+
ne,
|
|
468
|
+
{
|
|
469
|
+
className: R.popover,
|
|
470
|
+
offset: 0,
|
|
471
|
+
UNSTABLE_portalContainer: s.current || void 0,
|
|
472
|
+
children: /* @__PURE__ */ p(ae, { items: l, children: o })
|
|
473
|
+
}
|
|
474
|
+
)
|
|
475
|
+
]
|
|
476
|
+
}
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
function Pa(e) {
|
|
480
|
+
return /* @__PURE__ */ p(
|
|
481
|
+
te,
|
|
482
|
+
{
|
|
483
|
+
className: R.listBoxItem,
|
|
484
|
+
...e
|
|
485
|
+
}
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
export {
|
|
489
|
+
Pa as Item,
|
|
490
|
+
ha as Select
|
|
491
|
+
};
|