@midas-ds/components 1.1.0 → 1.3.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/CHANGELOG.md +63 -1
- package/accordion/AccordionItem.d.ts +2 -2
- package/index.cjs +138 -0
- package/index.css +1 -0
- package/index.d.ts +0 -2
- package/index.js +27094 -105
- package/package.json +22 -4
- package/table/Table.d.ts +3 -4
- package/textfield/TextField.d.ts +15 -4
- package/theme.cjs +1 -0
- package/theme.js +20 -0
- package/tokens-BskyMDHv.cjs +1 -0
- package/Breadcrumbs.css +0 -1
- package/Button-DL6nqUco.js +0 -182
- package/Button.css +0 -1
- package/ButtonGroup.css +0 -1
- package/Card.css +0 -1
- package/Checkbox-q0dugR2t.js +0 -402
- package/Checkbox.css +0 -1
- package/Collection-KMFfVuzU.js +0 -510
- package/ComboBox.css +0 -1
- package/DatePicker.css +0 -1
- package/Dialog-D6Bqrpn-.js +0 -1952
- package/Disclosure-dAZYXyTH.js +0 -225
- package/Disclosure.css +0 -1
- package/DragAndDrop-B0T3WgjL.js +0 -40
- package/Dropdown.css +0 -1
- package/FileUpload.css +0 -1
- package/Flex.css +0 -1
- package/Flex.module-CpoxBzQX.js +0 -37
- package/FocusScope-B7CkxXNC.js +0 -513
- package/Form-BWBjJC6v.js +0 -238
- package/Grid.css +0 -1
- package/Grid.module-Ia0e9Dix.js +0 -36
- package/Group-D7_8007y.js +0 -42
- package/Heading-RCRHv6hd.js +0 -15
- package/Hidden-CVlUgUJM.js +0 -37
- package/InfoBanner.css +0 -1
- package/Layout.css +0 -1
- package/Link-BnQvB-hH.js +0 -75
- package/Link.css +0 -1
- package/LinkButton.css +0 -1
- package/ListBox-DBBiqvcR.js +0 -474
- package/ListKeyboardDelegate-gCXy-Xnn.js +0 -172
- package/Logo.css +0 -1
- package/Modal.css +0 -1
- package/MultiSelect.css +0 -1
- package/PressResponder-B4g56kDz.js +0 -31
- package/RSPContexts-BW2SEIqe.js +0 -11
- package/Radio.css +0 -1
- package/SearchField.css +0 -1
- package/Select.css +0 -1
- package/SelectionManager-BfXUE1qg.js +0 -1031
- package/Separator-BBX9m2O2.js +0 -49
- package/Spinner.css +0 -1
- package/Table.css +0 -1
- package/Tabs.css +0 -1
- package/Tag-DWt0koFj.js +0 -728
- package/Tag.css +0 -1
- package/Text-BCF0xvqL.js +0 -15
- package/TextArea.css +0 -1
- package/TextField-CX4eOQf6.js +0 -225
- package/TextField.css +0 -1
- package/TextField.module-DdICj682.js +0 -143
- package/Toast.css +0 -1
- package/VisuallyHidden-Dhr5caPC.js +0 -39
- package/chevron-down-Cd1bkzXT.js +0 -13
- package/chevron-right-DBMc9VMi.js +0 -23
- package/clsx-OuTLNxxd.js +0 -16
- package/context-BpJLnOuu.js +0 -80
- package/createLucideIcon-DeWljiyi.js +0 -79
- package/index-B-jHjTDC.js +0 -120
- package/index-BPdc9gJ8.js +0 -3122
- package/index-KSgQWWiy.js +0 -26984
- package/index10.js +0 -4
- package/index11.js +0 -5
- package/index12.js +0 -4
- package/index13.js +0 -4
- package/index14.js +0 -4
- package/index15.js +0 -6
- package/index16.js +0 -6
- package/index17.js +0 -6
- package/index18.js +0 -4
- package/index19.js +0 -6
- package/index2.js +0 -8
- package/index20.js +0 -6
- package/index21.js +0 -4
- package/index22.js +0 -5
- package/index23.js +0 -5
- package/index24.js +0 -5
- package/index25.js +0 -6
- package/index26.js +0 -6
- package/index27.js +0 -6
- package/index28.js +0 -4
- package/index29.js +0 -6
- package/index3.js +0 -6
- package/index30.js +0 -21
- package/index31.js +0 -22
- package/index32.js +0 -14
- package/index33.js +0 -11
- package/index34.js +0 -31
- package/index35.js +0 -8
- package/index36.js +0 -9
- package/index37.js +0 -19
- package/index38.js +0 -9
- package/index39.js +0 -9
- package/index4.js +0 -4
- package/index40.js +0 -23
- package/index41.js +0 -63
- package/index42.js +0 -53
- package/index43.js +0 -18
- package/index44.js +0 -27
- package/index45.js +0 -18
- package/index46.js +0 -21
- package/index47.js +0 -49
- package/index48.js +0 -5
- package/index49.js +0 -25
- package/index5.js +0 -5
- package/index50.js +0 -18
- package/index51.js +0 -9
- package/index52.js +0 -25
- package/index53.js +0 -18
- package/index54.js +0 -11
- package/index55.js +0 -12
- package/index56.js +0 -15
- package/index57.js +0 -9
- package/index58.js +0 -9
- package/index59.js +0 -19
- package/index6.js +0 -4
- package/index60.js +0 -22
- package/index61.js +0 -61
- package/index62.js +0 -15
- package/index63.js +0 -11
- package/index64.js +0 -53
- package/index65.js +0 -85
- package/index66.js +0 -74
- package/index67.js +0 -24
- package/index68.js +0 -69
- package/index69.js +0 -80
- package/index7.js +0 -9
- package/index70.js +0 -140
- package/index71.js +0 -70
- package/index72.js +0 -42
- package/index73.js +0 -82
- package/index74.js +0 -71
- package/index75.js +0 -104
- package/index76.js +0 -275
- package/index77.js +0 -723
- package/index78.js +0 -489
- package/index79.js +0 -314
- package/index8.js +0 -4
- package/index80.js +0 -389
- package/index81.js +0 -252
- package/index82.js +0 -1364
- package/index83.js +0 -1009
- package/index84.js +0 -386
- package/index85.js +0 -2101
- package/index86.js +0 -2368
- package/index87.js +0 -6831
- package/index88.js +0 -17
- package/index89.js +0 -14
- package/index9.js +0 -5
- package/index90.js +0 -6
- package/index91.js +0 -9
- package/intlStrings-Cd44R5hT.js +0 -278
- package/react.esm-sMU8Z7rL.js +0 -11060
- package/triangle-alert-1OYl9KWz.js +0 -56
- package/useControlledState-Kv9K2AYu.js +0 -30
- package/useDescription-B7stiK3j.js +0 -32
- package/useEvent-Xk5kn5Ns.js +0 -21
- package/useField-DMzJIIN4.js +0 -67
- package/useFilter-Bt9dbV1U.js +0 -35
- package/useFocusRing-9PXyKy2A.js +0 -1297
- package/useFocusable-CcEBZe40.js +0 -59
- package/useGridSelectionCheckbox-DYgEnElE.js +0 -22
- package/useHasTabbableChild-D6DwR81L.js +0 -34
- package/useHighlightSelectionDescription-WYAbP4No.js +0 -552
- package/useLabels-9zaZ9oa0.js +0 -17
- package/useListState-BfTeKTk5.js +0 -119
- package/useLocalizedStringFormatter-BlCbn-hX.js +0 -96
- package/useSingleSelectListState-DPkaL0la.js +0 -34
- package/useUpdateEffect-Dtz-i14F.js +0 -12
- package/x-JK7i-TQC.js +0 -14
package/index79.js
DELETED
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
import { jsx as I } from "react/jsx-runtime";
|
|
2
|
-
import { $ as L } from "./Group-D7_8007y.js";
|
|
3
|
-
import { n as w, e as y, o as F, f as E, k as G, a as _, y as N, z as T, d as S, B as W, i as A, F as H, A as j, c as K, b as z } from "./useFocusRing-9PXyKy2A.js";
|
|
4
|
-
import { d as U, e as J, c as Q, $ as X, a as Y } from "./Form-BWBjJC6v.js";
|
|
5
|
-
import { b as Z, $ as ee } from "./useField-DMzJIIN4.js";
|
|
6
|
-
import { $ as ae } from "./Text-BCF0xvqL.js";
|
|
7
|
-
import V, { useMemo as ie, useState as de, forwardRef as M, createContext as q } from "react";
|
|
8
|
-
import { $ as re } from "./useControlledState-Kv9K2AYu.js";
|
|
9
|
-
import { $ as le } from "./FocusScope-B7CkxXNC.js";
|
|
10
|
-
import { $ as se } from "./context-BpJLnOuu.js";
|
|
11
|
-
import { $ as ne } from "./useFocusable-CcEBZe40.js";
|
|
12
|
-
import { a as te } from "./VisuallyHidden-Dhr5caPC.js";
|
|
13
|
-
import { I as oe } from "./TextField-CX4eOQf6.js";
|
|
14
|
-
import './Radio.css';const C = /* @__PURE__ */ new WeakMap();
|
|
15
|
-
function ce(a, e, d) {
|
|
16
|
-
let { value: r, children: s, "aria-label": l, "aria-labelledby": n } = a;
|
|
17
|
-
const i = a.isDisabled || e.isDisabled;
|
|
18
|
-
let u = s != null, f = l != null || n != null;
|
|
19
|
-
!u && !f && console.warn("If you do not provide children, you must specify an aria-label for accessibility");
|
|
20
|
-
let t = e.selectedValue === r, v = (B) => {
|
|
21
|
-
B.stopPropagation(), e.setSelectedValue(r);
|
|
22
|
-
}, { pressProps: m, isPressed: x } = w({
|
|
23
|
-
isDisabled: i
|
|
24
|
-
}), { pressProps: P, isPressed: $ } = w({
|
|
25
|
-
isDisabled: i,
|
|
26
|
-
onPress() {
|
|
27
|
-
e.setSelectedValue(r);
|
|
28
|
-
}
|
|
29
|
-
}), { focusableProps: D } = ne(y(a, {
|
|
30
|
-
onFocus: () => e.setLastFocusedValue(r)
|
|
31
|
-
}), d), R = y(m, D), g = F(a, {
|
|
32
|
-
labelable: !0
|
|
33
|
-
}), p = -1;
|
|
34
|
-
e.selectedValue != null ? e.selectedValue === r && (p = 0) : (e.lastFocusedValue === r || e.lastFocusedValue == null) && (p = 0), i && (p = void 0);
|
|
35
|
-
let { name: b, descriptionId: o, errorMessageId: h, validationBehavior: c } = C.get(e);
|
|
36
|
-
return U(d, e.selectedValue, e.setSelectedValue), J({
|
|
37
|
-
validationBehavior: c
|
|
38
|
-
}, e, d), {
|
|
39
|
-
labelProps: y(P, {
|
|
40
|
-
onClick: (B) => B.preventDefault()
|
|
41
|
-
}),
|
|
42
|
-
inputProps: y(g, {
|
|
43
|
-
...R,
|
|
44
|
-
type: "radio",
|
|
45
|
-
name: b,
|
|
46
|
-
tabIndex: p,
|
|
47
|
-
disabled: i,
|
|
48
|
-
required: e.isRequired && c === "native",
|
|
49
|
-
checked: t,
|
|
50
|
-
value: r,
|
|
51
|
-
onChange: v,
|
|
52
|
-
"aria-describedby": [
|
|
53
|
-
a["aria-describedby"],
|
|
54
|
-
e.isInvalid ? h : null,
|
|
55
|
-
o
|
|
56
|
-
].filter(Boolean).join(" ") || void 0
|
|
57
|
-
}),
|
|
58
|
-
isDisabled: i,
|
|
59
|
-
isSelected: t,
|
|
60
|
-
isPressed: x || $
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
function fe(a, e) {
|
|
64
|
-
let { name: d, isReadOnly: r, isRequired: s, isDisabled: l, orientation: n = "vertical", validationBehavior: i = "aria" } = a, { direction: u } = se(), { isInvalid: f, validationErrors: t, validationDetails: v } = e.displayValidation, { labelProps: m, fieldProps: x, descriptionProps: P, errorMessageProps: $ } = Z({
|
|
65
|
-
...a,
|
|
66
|
-
// Radio group is not an HTML input element so it
|
|
67
|
-
// shouldn't be labeled by a <label> element.
|
|
68
|
-
labelElementType: "span",
|
|
69
|
-
isInvalid: e.isInvalid,
|
|
70
|
-
errorMessage: a.errorMessage || t
|
|
71
|
-
}), D = F(a, {
|
|
72
|
-
labelable: !0
|
|
73
|
-
}), { focusWithinProps: R } = E({
|
|
74
|
-
onBlurWithin(b) {
|
|
75
|
-
var o;
|
|
76
|
-
(o = a.onBlur) === null || o === void 0 || o.call(a, b), e.selectedValue || e.setLastFocusedValue(null);
|
|
77
|
-
},
|
|
78
|
-
onFocusWithin: a.onFocus,
|
|
79
|
-
onFocusWithinChange: a.onFocusChange
|
|
80
|
-
}), g = (b) => {
|
|
81
|
-
let o;
|
|
82
|
-
switch (b.key) {
|
|
83
|
-
case "ArrowRight":
|
|
84
|
-
u === "rtl" && n !== "vertical" ? o = "prev" : o = "next";
|
|
85
|
-
break;
|
|
86
|
-
case "ArrowLeft":
|
|
87
|
-
u === "rtl" && n !== "vertical" ? o = "next" : o = "prev";
|
|
88
|
-
break;
|
|
89
|
-
case "ArrowDown":
|
|
90
|
-
o = "next";
|
|
91
|
-
break;
|
|
92
|
-
case "ArrowUp":
|
|
93
|
-
o = "prev";
|
|
94
|
-
break;
|
|
95
|
-
default:
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
b.preventDefault();
|
|
99
|
-
let h = le(b.currentTarget, {
|
|
100
|
-
from: b.target
|
|
101
|
-
}), c;
|
|
102
|
-
o === "next" ? (c = h.nextNode(), c || (h.currentNode = b.currentTarget, c = h.firstChild())) : (c = h.previousNode(), c || (h.currentNode = b.currentTarget, c = h.lastChild())), c && (c.focus(), e.setSelectedValue(c.value));
|
|
103
|
-
}, p = G(d);
|
|
104
|
-
return C.set(e, {
|
|
105
|
-
name: p,
|
|
106
|
-
descriptionId: P.id,
|
|
107
|
-
errorMessageId: $.id,
|
|
108
|
-
validationBehavior: i
|
|
109
|
-
}), {
|
|
110
|
-
radioGroupProps: y(D, {
|
|
111
|
-
// https://www.w3.org/TR/wai-aria-1.2/#radiogroup
|
|
112
|
-
role: "radiogroup",
|
|
113
|
-
onKeyDown: g,
|
|
114
|
-
"aria-invalid": e.isInvalid || void 0,
|
|
115
|
-
"aria-errormessage": a["aria-errormessage"],
|
|
116
|
-
"aria-readonly": r || void 0,
|
|
117
|
-
"aria-required": s || void 0,
|
|
118
|
-
"aria-disabled": l || void 0,
|
|
119
|
-
"aria-orientation": n,
|
|
120
|
-
...x,
|
|
121
|
-
...R
|
|
122
|
-
}),
|
|
123
|
-
labelProps: m,
|
|
124
|
-
descriptionProps: P,
|
|
125
|
-
errorMessageProps: $,
|
|
126
|
-
isInvalid: f,
|
|
127
|
-
validationErrors: t,
|
|
128
|
-
validationDetails: v
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
let ue = Math.round(Math.random() * 1e10), be = 0;
|
|
132
|
-
function $e(a) {
|
|
133
|
-
let e = ie(() => a.name || `radio-group-${ue}-${++be}`, [
|
|
134
|
-
a.name
|
|
135
|
-
]);
|
|
136
|
-
var d;
|
|
137
|
-
let [r, s] = re(a.value, (d = a.defaultValue) !== null && d !== void 0 ? d : null, a.onChange), [l, n] = de(null), i = Q({
|
|
138
|
-
...a,
|
|
139
|
-
value: r
|
|
140
|
-
}), u = (t) => {
|
|
141
|
-
!a.isReadOnly && !a.isDisabled && (s(t), i.commitValidation());
|
|
142
|
-
}, f = i.displayValidation.isInvalid;
|
|
143
|
-
return {
|
|
144
|
-
...i,
|
|
145
|
-
name: e,
|
|
146
|
-
selectedValue: r,
|
|
147
|
-
setSelectedValue: u,
|
|
148
|
-
lastFocusedValue: l,
|
|
149
|
-
setLastFocusedValue: n,
|
|
150
|
-
isDisabled: a.isDisabled || !1,
|
|
151
|
-
isReadOnly: a.isReadOnly || !1,
|
|
152
|
-
isRequired: a.isRequired || !1,
|
|
153
|
-
validationState: a.validationState || (f ? "invalid" : null),
|
|
154
|
-
isInvalid: f
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
const pe = /* @__PURE__ */ q(null), ve = /* @__PURE__ */ q(null), O = /* @__PURE__ */ q(null), me = /* @__PURE__ */ M(function(e, d) {
|
|
158
|
-
[e, d] = _(e, d, pe);
|
|
159
|
-
let { validationBehavior: r } = N(X) || {};
|
|
160
|
-
var s, l;
|
|
161
|
-
let n = (l = (s = e.validationBehavior) !== null && s !== void 0 ? s : r) !== null && l !== void 0 ? l : "native", i = $e({
|
|
162
|
-
...e,
|
|
163
|
-
validationBehavior: n
|
|
164
|
-
}), [u, f] = T(), { radioGroupProps: t, labelProps: v, descriptionProps: m, errorMessageProps: x, ...P } = fe({
|
|
165
|
-
...e,
|
|
166
|
-
label: f,
|
|
167
|
-
validationBehavior: n
|
|
168
|
-
}, i), $ = S({
|
|
169
|
-
...e,
|
|
170
|
-
values: {
|
|
171
|
-
orientation: e.orientation || "vertical",
|
|
172
|
-
isDisabled: i.isDisabled,
|
|
173
|
-
isReadOnly: i.isReadOnly,
|
|
174
|
-
isRequired: i.isRequired,
|
|
175
|
-
isInvalid: i.isInvalid,
|
|
176
|
-
state: i
|
|
177
|
-
},
|
|
178
|
-
defaultClassName: "react-aria-RadioGroup"
|
|
179
|
-
});
|
|
180
|
-
return /* @__PURE__ */ V.createElement("div", {
|
|
181
|
-
...t,
|
|
182
|
-
...$,
|
|
183
|
-
ref: d,
|
|
184
|
-
slot: e.slot || void 0,
|
|
185
|
-
"data-orientation": e.orientation || "vertical",
|
|
186
|
-
"data-invalid": i.isInvalid || void 0,
|
|
187
|
-
"data-disabled": i.isDisabled || void 0,
|
|
188
|
-
"data-readonly": i.isReadOnly || void 0,
|
|
189
|
-
"data-required": i.isRequired || void 0
|
|
190
|
-
}, /* @__PURE__ */ V.createElement(W, {
|
|
191
|
-
values: [
|
|
192
|
-
[
|
|
193
|
-
O,
|
|
194
|
-
i
|
|
195
|
-
],
|
|
196
|
-
[
|
|
197
|
-
ee,
|
|
198
|
-
{
|
|
199
|
-
...v,
|
|
200
|
-
ref: u,
|
|
201
|
-
elementType: "span"
|
|
202
|
-
}
|
|
203
|
-
],
|
|
204
|
-
[
|
|
205
|
-
ae,
|
|
206
|
-
{
|
|
207
|
-
slots: {
|
|
208
|
-
description: m,
|
|
209
|
-
errorMessage: x
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
],
|
|
213
|
-
[
|
|
214
|
-
Y,
|
|
215
|
-
P
|
|
216
|
-
]
|
|
217
|
-
]
|
|
218
|
-
}, $.children));
|
|
219
|
-
}), xe = /* @__PURE__ */ M(function(e, d) {
|
|
220
|
-
let { inputRef: r = null, ...s } = e;
|
|
221
|
-
[e, d] = _(s, d, ve);
|
|
222
|
-
let l = V.useContext(O), n = A(H(r, e.inputRef !== void 0 ? e.inputRef : null)), { labelProps: i, inputProps: u, isSelected: f, isDisabled: t, isPressed: v } = ce({
|
|
223
|
-
...j(e),
|
|
224
|
-
// ReactNode type doesn't allow function children.
|
|
225
|
-
children: typeof e.children == "function" ? !0 : e.children
|
|
226
|
-
}, l, n), { isFocused: m, isFocusVisible: x, focusProps: P } = K(), $ = t || l.isReadOnly, { hoverProps: D, isHovered: R } = z({
|
|
227
|
-
...e,
|
|
228
|
-
isDisabled: $
|
|
229
|
-
}), g = S({
|
|
230
|
-
...e,
|
|
231
|
-
defaultClassName: "react-aria-Radio",
|
|
232
|
-
values: {
|
|
233
|
-
isSelected: f,
|
|
234
|
-
isPressed: v,
|
|
235
|
-
isHovered: R,
|
|
236
|
-
isFocused: m,
|
|
237
|
-
isFocusVisible: x,
|
|
238
|
-
isDisabled: t,
|
|
239
|
-
isReadOnly: l.isReadOnly,
|
|
240
|
-
isInvalid: l.isInvalid,
|
|
241
|
-
isRequired: l.isRequired
|
|
242
|
-
}
|
|
243
|
-
}), p = F(e);
|
|
244
|
-
return delete p.id, /* @__PURE__ */ V.createElement("label", {
|
|
245
|
-
...y(p, i, D, g),
|
|
246
|
-
ref: d,
|
|
247
|
-
"data-selected": f || void 0,
|
|
248
|
-
"data-pressed": v || void 0,
|
|
249
|
-
"data-hovered": R || void 0,
|
|
250
|
-
"data-focused": m || void 0,
|
|
251
|
-
"data-focus-visible": x || void 0,
|
|
252
|
-
"data-disabled": t || void 0,
|
|
253
|
-
"data-readonly": l.isReadOnly || void 0,
|
|
254
|
-
"data-invalid": l.isInvalid || void 0,
|
|
255
|
-
"data-required": l.isRequired || void 0
|
|
256
|
-
}, /* @__PURE__ */ V.createElement(te, {
|
|
257
|
-
elementType: "span"
|
|
258
|
-
}, /* @__PURE__ */ V.createElement("input", {
|
|
259
|
-
...y(u, P),
|
|
260
|
-
ref: n
|
|
261
|
-
})), g.children);
|
|
262
|
-
}), Pe = '"../theme/tokens.css"', he = '"Inter", sans-serif', ye = "undefined", Re = "#1f1f1f", ge = "#000000", Ve = "#143c50", De = "#bfbfbf", Ie = "#b3b3b3", Be = "#ffdfdf", ke = "#e62323", Fe = "undefined", qe = "#1f1f1f", we = "undefined", _e = "(max-width: 767px)", Se = "0 0 0 2px #ffffff, 0 0 0 4px #000000", Me = "(min-width: 768px)", Ce = "#b3b3b3", Oe = "_radioGroup_1vn0q_4", Le = "_wrap_1vn0q_17", Ee = "_radio_1vn0q_4", k = {
|
|
263
|
-
tokens: Pe,
|
|
264
|
-
display: he,
|
|
265
|
-
inputLabel: ye,
|
|
266
|
-
inputText: Re,
|
|
267
|
-
black: ge,
|
|
268
|
-
blue150: Ve,
|
|
269
|
-
gray50: De,
|
|
270
|
-
gray60: Ie,
|
|
271
|
-
signalRed10: Be,
|
|
272
|
-
signalRed100: ke,
|
|
273
|
-
medium: Fe,
|
|
274
|
-
gray150: qe,
|
|
275
|
-
regular: we,
|
|
276
|
-
smBreakpoint: _e,
|
|
277
|
-
focus: Se,
|
|
278
|
-
mdBreakpoint: Me,
|
|
279
|
-
borderSecondary: Ce,
|
|
280
|
-
radioGroup: Oe,
|
|
281
|
-
wrap: Le,
|
|
282
|
-
radio: Ee
|
|
283
|
-
}, Ye = ({
|
|
284
|
-
label: a,
|
|
285
|
-
description: e,
|
|
286
|
-
errorMessage: d,
|
|
287
|
-
children: r,
|
|
288
|
-
...s
|
|
289
|
-
}) => /* @__PURE__ */ I(
|
|
290
|
-
me,
|
|
291
|
-
{
|
|
292
|
-
...s,
|
|
293
|
-
className: k.radioGroup,
|
|
294
|
-
children: /* @__PURE__ */ I(
|
|
295
|
-
oe,
|
|
296
|
-
{
|
|
297
|
-
label: a,
|
|
298
|
-
description: e,
|
|
299
|
-
errorMessage: d,
|
|
300
|
-
children: /* @__PURE__ */ I(L, { className: k.wrap, children: r })
|
|
301
|
-
}
|
|
302
|
-
)
|
|
303
|
-
}
|
|
304
|
-
), Ze = (a) => /* @__PURE__ */ I(
|
|
305
|
-
xe,
|
|
306
|
-
{
|
|
307
|
-
className: k.radio,
|
|
308
|
-
...a
|
|
309
|
-
}
|
|
310
|
-
);
|
|
311
|
-
export {
|
|
312
|
-
Ze as Radio,
|
|
313
|
-
Ye as RadioGroup
|
|
314
|
-
};
|
package/index8.js
DELETED
package/index80.js
DELETED
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
import { jsxs as B, jsx as F } from "react/jsx-runtime";
|
|
2
|
-
import * as S from "react";
|
|
3
|
-
import f, { useMemo as w, useRef as H, useEffect as O, forwardRef as M, useContext as p, createContext as T } from "react";
|
|
4
|
-
import { $ as z, a as _, b as N, f as q, c as W, d as j } from "./Collection-KMFfVuzU.js";
|
|
5
|
-
import { o as g, q as U, e as m, k as G, a as J, c as E, d as K, B as R, y as Q, i as C, b as X } from "./useFocusRing-9PXyKy2A.js";
|
|
6
|
-
import { $ as Y } from "./Hidden-CVlUgUJM.js";
|
|
7
|
-
import { $ as Z } from "./useSingleSelectListState-DPkaL0la.js";
|
|
8
|
-
import { $ as k } from "./useLabels-9zaZ9oa0.js";
|
|
9
|
-
import { $ as ee } from "./context-BpJLnOuu.js";
|
|
10
|
-
import { d as te, e as ie } from "./SelectionManager-BfXUE1qg.js";
|
|
11
|
-
import { $ as ae } from "./useHasTabbableChild-D6DwR81L.js";
|
|
12
|
-
import './Tabs.css';const V = /* @__PURE__ */ new WeakMap();
|
|
13
|
-
function P(t, e, i) {
|
|
14
|
-
return t ? (typeof e == "string" && (e = e.replace(/\s+/g, "")), `${V.get(t)}-${i}-${e}`) : "";
|
|
15
|
-
}
|
|
16
|
-
function ne(t, e, i) {
|
|
17
|
-
let { key: a, isDisabled: n, shouldSelectOnPressUp: l } = t, { selectionManager: s, selectedKey: r } = e, d = a === r, o = n || e.isDisabled || e.selectionManager.isDisabled(a), { itemProps: c, isPressed: u } = te({
|
|
18
|
-
selectionManager: s,
|
|
19
|
-
key: a,
|
|
20
|
-
ref: i,
|
|
21
|
-
isDisabled: o,
|
|
22
|
-
shouldSelectOnPressUp: l,
|
|
23
|
-
linkBehavior: "selection"
|
|
24
|
-
}), $ = P(e, a, "tab"), y = P(e, a, "tabpanel"), { tabIndex: D } = c, b = e.collection.getItem(a), L = g(b == null ? void 0 : b.props, {
|
|
25
|
-
labelable: !0
|
|
26
|
-
});
|
|
27
|
-
delete L.id;
|
|
28
|
-
let A = U(b == null ? void 0 : b.props);
|
|
29
|
-
return {
|
|
30
|
-
tabProps: m(L, A, c, {
|
|
31
|
-
id: $,
|
|
32
|
-
"aria-selected": d,
|
|
33
|
-
"aria-disabled": o || void 0,
|
|
34
|
-
"aria-controls": d ? y : void 0,
|
|
35
|
-
tabIndex: o ? void 0 : D,
|
|
36
|
-
role: "tab"
|
|
37
|
-
}),
|
|
38
|
-
isSelected: d,
|
|
39
|
-
isDisabled: o,
|
|
40
|
-
isPressed: u
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function se(t, e, i) {
|
|
44
|
-
let a = ae(i) ? void 0 : 0;
|
|
45
|
-
var n;
|
|
46
|
-
const l = P(e, (n = t.id) !== null && n !== void 0 ? n : e == null ? void 0 : e.selectedKey, "tabpanel"), s = k({
|
|
47
|
-
...t,
|
|
48
|
-
id: l,
|
|
49
|
-
"aria-labelledby": P(e, e == null ? void 0 : e.selectedKey, "tab")
|
|
50
|
-
});
|
|
51
|
-
return {
|
|
52
|
-
tabPanelProps: m(s, {
|
|
53
|
-
tabIndex: a,
|
|
54
|
-
role: "tabpanel",
|
|
55
|
-
"aria-describedby": t["aria-describedby"],
|
|
56
|
-
"aria-details": t["aria-details"]
|
|
57
|
-
})
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
class de {
|
|
61
|
-
getKeyLeftOf(e) {
|
|
62
|
-
return this.flipDirection ? this.getNextKey(e) : this.getPreviousKey(e);
|
|
63
|
-
}
|
|
64
|
-
getKeyRightOf(e) {
|
|
65
|
-
return this.flipDirection ? this.getPreviousKey(e) : this.getNextKey(e);
|
|
66
|
-
}
|
|
67
|
-
isDisabled(e) {
|
|
68
|
-
var i, a;
|
|
69
|
-
return this.disabledKeys.has(e) || !!(!((a = this.collection.getItem(e)) === null || a === void 0 || (i = a.props) === null || i === void 0) && i.isDisabled);
|
|
70
|
-
}
|
|
71
|
-
getFirstKey() {
|
|
72
|
-
let e = this.collection.getFirstKey();
|
|
73
|
-
return e != null && this.isDisabled(e) && (e = this.getNextKey(e)), e;
|
|
74
|
-
}
|
|
75
|
-
getLastKey() {
|
|
76
|
-
let e = this.collection.getLastKey();
|
|
77
|
-
return e != null && this.isDisabled(e) && (e = this.getPreviousKey(e)), e;
|
|
78
|
-
}
|
|
79
|
-
getKeyAbove(e) {
|
|
80
|
-
return this.tabDirection ? null : this.getPreviousKey(e);
|
|
81
|
-
}
|
|
82
|
-
getKeyBelow(e) {
|
|
83
|
-
return this.tabDirection ? null : this.getNextKey(e);
|
|
84
|
-
}
|
|
85
|
-
getNextKey(e) {
|
|
86
|
-
do
|
|
87
|
-
e = this.collection.getKeyAfter(e), e == null && (e = this.collection.getFirstKey());
|
|
88
|
-
while (this.isDisabled(e));
|
|
89
|
-
return e;
|
|
90
|
-
}
|
|
91
|
-
getPreviousKey(e) {
|
|
92
|
-
do
|
|
93
|
-
e = this.collection.getKeyBefore(e), e == null && (e = this.collection.getLastKey());
|
|
94
|
-
while (this.isDisabled(e));
|
|
95
|
-
return e;
|
|
96
|
-
}
|
|
97
|
-
constructor(e, i, a, n = /* @__PURE__ */ new Set()) {
|
|
98
|
-
this.collection = e, this.flipDirection = i === "rtl" && a === "horizontal", this.disabledKeys = n, this.tabDirection = a === "horizontal";
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
function le(t, e, i) {
|
|
102
|
-
let { orientation: a = "horizontal", keyboardActivation: n = "automatic" } = t, { collection: l, selectionManager: s, disabledKeys: r } = e, { direction: d } = ee(), o = w(() => new de(l, d, a, r), [
|
|
103
|
-
l,
|
|
104
|
-
r,
|
|
105
|
-
a,
|
|
106
|
-
d
|
|
107
|
-
]), { collectionProps: c } = ie({
|
|
108
|
-
ref: i,
|
|
109
|
-
selectionManager: s,
|
|
110
|
-
keyboardDelegate: o,
|
|
111
|
-
selectOnFocus: n === "automatic",
|
|
112
|
-
disallowEmptySelection: !0,
|
|
113
|
-
scrollRef: i,
|
|
114
|
-
linkBehavior: "selection"
|
|
115
|
-
}), u = G();
|
|
116
|
-
V.set(e, u);
|
|
117
|
-
let $ = k({
|
|
118
|
-
...t,
|
|
119
|
-
id: u
|
|
120
|
-
});
|
|
121
|
-
return {
|
|
122
|
-
tabListProps: {
|
|
123
|
-
...m(c, $),
|
|
124
|
-
role: "tablist",
|
|
125
|
-
"aria-orientation": a,
|
|
126
|
-
tabIndex: void 0
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
function re(t) {
|
|
131
|
-
var e, i;
|
|
132
|
-
let a = Z({
|
|
133
|
-
...t,
|
|
134
|
-
suppressTextValueWarning: !0,
|
|
135
|
-
defaultSelectedKey: (i = (e = t.defaultSelectedKey) !== null && e !== void 0 ? e : I(t.collection, t.disabledKeys ? new Set(t.disabledKeys) : /* @__PURE__ */ new Set())) !== null && i !== void 0 ? i : void 0
|
|
136
|
-
}), { selectionManager: n, collection: l, selectedKey: s } = a, r = H(s);
|
|
137
|
-
return O(() => {
|
|
138
|
-
let d = s;
|
|
139
|
-
(n.isEmpty || d == null || !l.getItem(d)) && (d = I(l, a.disabledKeys), d != null && n.setSelectedKeys([
|
|
140
|
-
d
|
|
141
|
-
])), (d != null && n.focusedKey == null || !n.isFocused && d !== r.current) && n.setFocusedKey(d), r.current = d;
|
|
142
|
-
}), {
|
|
143
|
-
...a,
|
|
144
|
-
isDisabled: t.isDisabled || !1
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
function I(t, e) {
|
|
148
|
-
let i = null;
|
|
149
|
-
if (t) {
|
|
150
|
-
var a, n, l, s;
|
|
151
|
-
for (i = t.getFirstKey(); i != null && (e.has(i) || !((n = t.getItem(i)) === null || n === void 0 || (a = n.props) === null || a === void 0) && a.isDisabled) && i !== t.getLastKey(); ) i = t.getKeyAfter(i);
|
|
152
|
-
i != null && (e.has(i) || !((s = t.getItem(i)) === null || s === void 0 || (l = s.props) === null || l === void 0) && l.isDisabled) && i === t.getLastKey() && (i = t.getFirstKey());
|
|
153
|
-
}
|
|
154
|
-
return i;
|
|
155
|
-
}
|
|
156
|
-
const v = /* @__PURE__ */ T(null), h = /* @__PURE__ */ T(null), oe = /* @__PURE__ */ M(function(e, i) {
|
|
157
|
-
[e, i] = J(e, i, v);
|
|
158
|
-
let { children: a, orientation: n = "horizontal" } = e;
|
|
159
|
-
return a = w(() => typeof a == "function" ? a({
|
|
160
|
-
orientation: n,
|
|
161
|
-
defaultChildren: null
|
|
162
|
-
}) : a, [
|
|
163
|
-
a,
|
|
164
|
-
n
|
|
165
|
-
]), /* @__PURE__ */ f.createElement(z, {
|
|
166
|
-
content: a
|
|
167
|
-
}, (l) => /* @__PURE__ */ f.createElement(ce, {
|
|
168
|
-
props: e,
|
|
169
|
-
collection: l,
|
|
170
|
-
tabsRef: i
|
|
171
|
-
}));
|
|
172
|
-
});
|
|
173
|
-
function ce({ props: t, tabsRef: e, collection: i }) {
|
|
174
|
-
let { orientation: a = "horizontal" } = t, n = re({
|
|
175
|
-
...t,
|
|
176
|
-
collection: i,
|
|
177
|
-
children: void 0
|
|
178
|
-
}), { focusProps: l, isFocused: s, isFocusVisible: r } = E({
|
|
179
|
-
within: !0
|
|
180
|
-
}), d = w(() => ({
|
|
181
|
-
orientation: a,
|
|
182
|
-
isFocusWithin: s,
|
|
183
|
-
isFocusVisible: r
|
|
184
|
-
}), [
|
|
185
|
-
a,
|
|
186
|
-
s,
|
|
187
|
-
r
|
|
188
|
-
]), o = K({
|
|
189
|
-
...t,
|
|
190
|
-
defaultClassName: "react-aria-Tabs",
|
|
191
|
-
values: d
|
|
192
|
-
});
|
|
193
|
-
return /* @__PURE__ */ f.createElement("div", {
|
|
194
|
-
...g(t),
|
|
195
|
-
...l,
|
|
196
|
-
...o,
|
|
197
|
-
ref: e,
|
|
198
|
-
slot: t.slot || void 0,
|
|
199
|
-
"data-focused": s || void 0,
|
|
200
|
-
"data-orientation": a,
|
|
201
|
-
"data-focus-visible": r || void 0,
|
|
202
|
-
"data-disabled": n.isDisabled || void 0
|
|
203
|
-
}, /* @__PURE__ */ f.createElement(R, {
|
|
204
|
-
values: [
|
|
205
|
-
[
|
|
206
|
-
v,
|
|
207
|
-
t
|
|
208
|
-
],
|
|
209
|
-
[
|
|
210
|
-
h,
|
|
211
|
-
n
|
|
212
|
-
]
|
|
213
|
-
]
|
|
214
|
-
}, o.children));
|
|
215
|
-
}
|
|
216
|
-
const fe = /* @__PURE__ */ M(function(e, i) {
|
|
217
|
-
return p(h) ? /* @__PURE__ */ f.createElement(ue, {
|
|
218
|
-
props: e,
|
|
219
|
-
forwardedRef: i
|
|
220
|
-
}) : /* @__PURE__ */ f.createElement(_, e);
|
|
221
|
-
});
|
|
222
|
-
function ue({ props: t, forwardedRef: e }) {
|
|
223
|
-
let i = p(h), { CollectionRoot: a } = p(N), { orientation: n = "horizontal", keyboardActivation: l = "automatic" } = Q(v), s = C(e), { tabListProps: r } = le({
|
|
224
|
-
...t,
|
|
225
|
-
orientation: n,
|
|
226
|
-
keyboardActivation: l
|
|
227
|
-
}, i, s), d = K({
|
|
228
|
-
...t,
|
|
229
|
-
children: null,
|
|
230
|
-
defaultClassName: "react-aria-TabList",
|
|
231
|
-
values: {
|
|
232
|
-
orientation: n,
|
|
233
|
-
state: i
|
|
234
|
-
}
|
|
235
|
-
}), o = g(t);
|
|
236
|
-
return delete o.id, /* @__PURE__ */ f.createElement("div", {
|
|
237
|
-
...o,
|
|
238
|
-
...r,
|
|
239
|
-
ref: s,
|
|
240
|
-
...d,
|
|
241
|
-
"data-orientation": n || void 0
|
|
242
|
-
}, /* @__PURE__ */ f.createElement(a, {
|
|
243
|
-
collection: i.collection,
|
|
244
|
-
persistedKeys: q(i.selectionManager.focusedKey)
|
|
245
|
-
}));
|
|
246
|
-
}
|
|
247
|
-
const be = /* @__PURE__ */ W("item", (t, e, i) => {
|
|
248
|
-
let a = p(h), n = C(e), { tabProps: l, isSelected: s, isDisabled: r, isPressed: d } = ne({
|
|
249
|
-
key: i.key,
|
|
250
|
-
...t
|
|
251
|
-
}, a, n), { focusProps: o, isFocused: c, isFocusVisible: u } = E(), { hoverProps: $, isHovered: y } = X({
|
|
252
|
-
isDisabled: r,
|
|
253
|
-
onHoverStart: t.onHoverStart,
|
|
254
|
-
onHoverEnd: t.onHoverEnd,
|
|
255
|
-
onHoverChange: t.onHoverChange
|
|
256
|
-
}), D = K({
|
|
257
|
-
...t,
|
|
258
|
-
id: void 0,
|
|
259
|
-
defaultClassName: "react-aria-Tab",
|
|
260
|
-
values: {
|
|
261
|
-
isSelected: s,
|
|
262
|
-
isDisabled: r,
|
|
263
|
-
isFocused: c,
|
|
264
|
-
isFocusVisible: u,
|
|
265
|
-
isPressed: d,
|
|
266
|
-
isHovered: y
|
|
267
|
-
}
|
|
268
|
-
}), b = i.props.href ? "a" : "div";
|
|
269
|
-
return /* @__PURE__ */ f.createElement(b, {
|
|
270
|
-
...m(l, o, $, D),
|
|
271
|
-
ref: n,
|
|
272
|
-
"data-selected": s || void 0,
|
|
273
|
-
"data-disabled": r || void 0,
|
|
274
|
-
"data-focused": c || void 0,
|
|
275
|
-
"data-focus-visible": u || void 0,
|
|
276
|
-
"data-pressed": d || void 0,
|
|
277
|
-
"data-hovered": y || void 0
|
|
278
|
-
});
|
|
279
|
-
}), $e = /* @__PURE__ */ Y(function(e, i) {
|
|
280
|
-
const a = p(h);
|
|
281
|
-
let n = C(i), { tabPanelProps: l } = se(e, a, n), { focusProps: s, isFocused: r, isFocusVisible: d } = E(), o = a.selectedKey === e.id, c = K({
|
|
282
|
-
...e,
|
|
283
|
-
defaultClassName: "react-aria-TabPanel",
|
|
284
|
-
values: {
|
|
285
|
-
isFocused: r,
|
|
286
|
-
isFocusVisible: d,
|
|
287
|
-
isInert: !o,
|
|
288
|
-
state: a
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
if (!o && !e.shouldForceMount) return null;
|
|
292
|
-
let u = g(e);
|
|
293
|
-
delete u.id;
|
|
294
|
-
let $ = o ? m(u, l, s, c) : c;
|
|
295
|
-
return /* @__PURE__ */ f.createElement("div", {
|
|
296
|
-
...$,
|
|
297
|
-
ref: n,
|
|
298
|
-
"data-focused": r || void 0,
|
|
299
|
-
"data-focus-visible": d || void 0,
|
|
300
|
-
// @ts-ignore
|
|
301
|
-
inert: o ? void 0 : "true",
|
|
302
|
-
"data-inert": o ? void 0 : "true"
|
|
303
|
-
}, /* @__PURE__ */ f.createElement(R, {
|
|
304
|
-
values: [
|
|
305
|
-
[
|
|
306
|
-
v,
|
|
307
|
-
null
|
|
308
|
-
],
|
|
309
|
-
[
|
|
310
|
-
h,
|
|
311
|
-
null
|
|
312
|
-
]
|
|
313
|
-
]
|
|
314
|
-
}, /* @__PURE__ */ f.createElement(N.Provider, {
|
|
315
|
-
value: j
|
|
316
|
-
}, c.children)));
|
|
317
|
-
}), he = '"../theme/tokens.css"', pe = '"Inter", sans-serif', me = "#bfbfbf", ye = "600", xe = "#25607f", Pe = "0 0 0 2px #ffffff, 0 0 0 4px #000000", ge = "(max-width: 767px)", Ke = "_container_a0kqi_4", ve = "_list_a0kqi_8", De = "_listItem_a0kqi_14", Fe = "_panel_a0kqi_42", x = {
|
|
318
|
-
tokens: he,
|
|
319
|
-
display: pe,
|
|
320
|
-
gray50: me,
|
|
321
|
-
semiBoldWeight: ye,
|
|
322
|
-
blue130: xe,
|
|
323
|
-
focus: Pe,
|
|
324
|
-
smBreakpoint: ge,
|
|
325
|
-
container: Ke,
|
|
326
|
-
list: ve,
|
|
327
|
-
listItem: De,
|
|
328
|
-
panel: Fe
|
|
329
|
-
}, ke = ({
|
|
330
|
-
tabs: t,
|
|
331
|
-
label: e,
|
|
332
|
-
defaultSelected: i,
|
|
333
|
-
children: a
|
|
334
|
-
}) => {
|
|
335
|
-
const n = S.Children.toArray(a);
|
|
336
|
-
if (n.length !== t.length)
|
|
337
|
-
throw new Error(
|
|
338
|
-
`The number of children must match the number of tabs. Children: ${n.length} Tabs: ${t.length}`
|
|
339
|
-
);
|
|
340
|
-
const l = n.reduce(
|
|
341
|
-
(s, r, d) => {
|
|
342
|
-
var o;
|
|
343
|
-
if (S.isValidElement(r)) {
|
|
344
|
-
const c = (o = t[d]) == null ? void 0 : o.toLowerCase();
|
|
345
|
-
c && (s[c] = S.cloneElement(r, { id: c }));
|
|
346
|
-
}
|
|
347
|
-
return s;
|
|
348
|
-
},
|
|
349
|
-
{}
|
|
350
|
-
);
|
|
351
|
-
return /* @__PURE__ */ B(
|
|
352
|
-
oe,
|
|
353
|
-
{
|
|
354
|
-
orientation: "vertical",
|
|
355
|
-
defaultSelectedKey: i && i.toLowerCase(),
|
|
356
|
-
className: x.container,
|
|
357
|
-
children: [
|
|
358
|
-
/* @__PURE__ */ F(
|
|
359
|
-
fe,
|
|
360
|
-
{
|
|
361
|
-
"aria-label": e,
|
|
362
|
-
className: x.list,
|
|
363
|
-
children: t.map((s) => /* @__PURE__ */ F(
|
|
364
|
-
be,
|
|
365
|
-
{
|
|
366
|
-
id: s.toLowerCase(),
|
|
367
|
-
className: x.listItem,
|
|
368
|
-
children: s
|
|
369
|
-
},
|
|
370
|
-
s
|
|
371
|
-
))
|
|
372
|
-
}
|
|
373
|
-
),
|
|
374
|
-
t.map((s) => /* @__PURE__ */ F(
|
|
375
|
-
$e,
|
|
376
|
-
{
|
|
377
|
-
id: s.toLowerCase(),
|
|
378
|
-
className: x.panel,
|
|
379
|
-
children: l[s.toLowerCase()]
|
|
380
|
-
},
|
|
381
|
-
s
|
|
382
|
-
))
|
|
383
|
-
]
|
|
384
|
-
}
|
|
385
|
-
);
|
|
386
|
-
};
|
|
387
|
-
export {
|
|
388
|
-
ke as Tabs
|
|
389
|
-
};
|