@pismo/marola 2.1.64 → 2.1.65
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/dist/Button-CJaBSdv1.js +135 -0
- package/dist/ClassNameConfigurator-CVRWfyIa.js +847 -0
- package/dist/{ClickAwayListener-Z08peX_P.js → ClickAwayListener-BnYMO5Ki.js} +26 -33
- package/dist/Popup-D267EI4e.js +1338 -0
- package/dist/{Portal-DJapUCn6.js → Portal-BrGvxB96.js} +32 -36
- package/dist/RadioOption-DyRY8xlF.js +1094 -0
- package/dist/{Toggle-DcZTfLrC.js → Toggle-nnDfpqI1.js} +31 -31
- package/dist/assets/Checkbox.css +1 -1
- package/dist/assets/DropdownMenu.css +1 -1
- package/dist/assets/ToastCard.css +1 -1
- package/dist/assets/Toggle2.css +1 -1
- package/dist/combineHooksSlotProps-j-8UVeYo.js +86 -0
- package/dist/components/Alert/Alert.stories.d.ts +6 -6
- package/dist/components/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +311 -320
- package/dist/components/Autocomplete/Autocomplete.stories.d.ts +1 -1
- package/dist/components/Avatar/Avatar.stories.d.ts +4 -4
- package/dist/components/BankingCard/BankingCard.d.ts +0 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +56 -56
- package/dist/components/Checkbox/Checkbox.stories.d.ts +8 -8
- package/dist/components/Chip/Chip.js +3 -3
- package/dist/components/DatePicker/DatePicker.js +742 -639
- package/dist/components/DatePicker/DatePicker.stories.d.ts +8 -8
- package/dist/components/DatePicker/dateUtils.d.ts +2 -2
- package/dist/components/DatePicker/dateUtils.js +1 -1
- package/dist/components/DatePicker/keyboardNavigation.d.ts +1 -1
- package/dist/components/DatePicker/renderCalendarDays.js +1 -1
- package/dist/components/DatePicker/renderPeriodSelection.js +1 -1
- package/dist/components/Dialog/CloseIconButton.js +1 -1
- package/dist/components/Dialog/Dialog.js +372 -352
- package/dist/components/Dialog/Dialog.stories.d.ts +96 -135
- package/dist/components/DoubleAutocomplete/DoubleAutocomplete.d.ts +1 -1
- package/dist/components/DoubleAutocomplete/DoubleAutocomplete.js +2 -2
- package/dist/components/DoubleAutocomplete/DoubleAutocomplete.stories.d.ts +1 -1
- package/dist/components/DoubleInput/DoubleInput.stories.d.ts +1 -1
- package/dist/components/Draggable/Draggable.d.ts +0 -1
- package/dist/components/Draggable/Draggable.js +1 -1
- package/dist/components/Draggable/Draggable.stories.d.ts +2 -3
- package/dist/components/Draggable/useDraggable.js +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +3 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +39 -34
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +6 -4
- package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +4 -4
- package/dist/components/IconButton/IconButton.js +1 -1
- package/dist/components/Input/Input.js +335 -320
- package/dist/components/InputSearch/InputSearch.d.ts +31 -31
- package/dist/components/InputSearch/InputSearch.stories.d.ts +31 -31
- package/dist/components/Popover/Popover.d.ts +3 -3
- package/dist/components/Popover/Popover.js +2 -2
- package/dist/components/Popover/Popover.stories.d.ts +3 -3
- package/dist/components/Popover/PopoverBody.d.ts +0 -1
- package/dist/components/Popover/PopoverFooter.d.ts +0 -1
- package/dist/components/Popover/PopoverHeader.d.ts +0 -1
- package/dist/components/RadioButton/RadioButton.d.ts +0 -1
- package/dist/components/RadioButton/RadioButton.js +684 -769
- package/dist/components/RadioButton/RadioOption.d.ts +0 -1
- package/dist/components/RadioButton/RadioOption.js +3 -3
- package/dist/components/ResultContainer/ResultContainer.d.ts +0 -1
- package/dist/components/ResultContainer/ResultContainer.stories.d.ts +9 -9
- package/dist/components/ResultWithChips/ResultWithChips.js +1 -1
- package/dist/components/ResultWithChips/ResultWithChips.stories.d.ts +9 -9
- package/dist/components/RowItem/RowItem.js +2 -2
- package/dist/components/Select/Select.js +625 -591
- package/dist/components/Skeleton/Skeleton.d.ts +0 -1
- package/dist/components/Snackbar/Snackbar.js +295 -239
- package/dist/components/Snackbar/Snackbar.stories.d.ts +113 -113
- package/dist/components/StepperNavigator/StepperNavigator.d.ts +0 -1
- package/dist/components/Table/Table.stories.d.ts +5 -5
- package/dist/components/Tabs/Tab.js +107 -98
- package/dist/components/Tabs/TabPanel.js +58 -55
- package/dist/components/Tabs/Tabs.js +246 -231
- package/dist/components/ToastCard/ToastCard.js +31 -31
- package/dist/components/Toggle/Toggle.js +147 -137
- package/dist/components/Toggle/Toggle.stories.d.ts +5 -5
- package/dist/components/ToggleGroup/Toggle.d.ts +0 -1
- package/dist/components/ToggleGroup/Toggle.js +2 -2
- package/dist/components/ToggleGroup/ToggleGroup.js +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +266 -325
- package/dist/components/Tooltip/Tooltip.stories.d.ts +4 -4
- package/dist/components/TransactionRow/TransactionRow.stories.d.ts +21 -21
- package/dist/contexts/DraggableProvider/DraggableProvider.d.ts +0 -1
- package/dist/contexts/DraggableProvider/DraggableProvider.js +1 -1
- package/dist/contexts/SnackbarProvider/SnackbarProvider.js +1 -1
- package/dist/{dayjs.min-ClQKmc--.js → dayjs.min-BtgZiFZY.js} +14 -14
- package/dist/getReactElementRef-iorwYm2A.js +19 -0
- package/dist/{index-1UpBa69h.js → index-ew-96uBP.js} +2129 -2128
- package/dist/isFocusVisible-CPZqtjv2.js +12 -0
- package/dist/main.js +2 -2
- package/dist/{ownerDocument-By592Iy6.js → ownerDocument-CU-LCrtd.js} +1 -1
- package/dist/react-BTbo_5A3.js +526 -0
- package/dist/setRef-Bo0HEdBB.js +6 -0
- package/dist/useButton-C2E_LFJp.js +90 -0
- package/dist/useControlled-BYdyS7Pn.js +31 -0
- package/dist/useId-CK6Kn3Tn.js +21 -0
- package/dist/useList-BLW78Lq7.js +446 -0
- package/dist/utils/draggable.d.ts +2 -2
- package/package.json +1 -1
- package/dist/Button-BrEDdtHO.js +0 -130
- package/dist/Popup-Dffqo7wT.js +0 -1246
- package/dist/RadioOption-DYovqiwF.js +0 -720
- package/dist/combineHooksSlotProps-BhQ14uyD.js +0 -79
- package/dist/exactProp-SYjL19cU.js +0 -13
- package/dist/react-BvI-Sw9b.js +0 -509
- package/dist/useButton-CezPDte8.js +0 -105
- package/dist/useControlled-CCMYYdCM.js +0 -31
- package/dist/useId-BW-oWmul.js +0 -19
- package/dist/useIsFocusVisible-BH4IAdcw.js +0 -69
- package/dist/useList-nqLfZem8.js +0 -435
- package/dist/useSlotProps-CYHDC4TN.js +0 -834
- package/dist/useTimeout-DxF9kiZL.js +0 -36
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as V, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { c as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { Typography as
|
|
1
|
+
import { jsx as V, jsxs as Me, Fragment as He } from "react/jsx-runtime";
|
|
2
|
+
import * as y from "react";
|
|
3
|
+
import { useState as Ke, useEffect as Fe } from "react";
|
|
4
|
+
import { c as ce } from "../../clsx-OuTLNxxd.js";
|
|
5
|
+
import { Icon as We } from "../Icon/Icon.js";
|
|
6
|
+
import { Typography as ze } from "../Typography/Typography.js";
|
|
7
7
|
import "../Input/Input.js";
|
|
8
8
|
import "../Avatar/Avatar.js";
|
|
9
9
|
import "../Button/Button.js";
|
|
10
|
-
import "../../Toggle-
|
|
10
|
+
import "../../Toggle-nnDfpqI1.js";
|
|
11
11
|
import "../Dialog/Dialog.js";
|
|
12
12
|
import "../DatePicker/DatePicker.js";
|
|
13
|
-
import { r as
|
|
13
|
+
import { r as Be } from "../../index-ew-96uBP.js";
|
|
14
14
|
import "../Draggable/useDraggable.js";
|
|
15
15
|
import "../IconButton/IconButton.js";
|
|
16
16
|
import "../InputSearch/InputSearch.js";
|
|
@@ -21,903 +21,818 @@ import "../Tabs/Tabs.js";
|
|
|
21
21
|
import "../../Group-DJz1rK2n.js";
|
|
22
22
|
import "../../contexts/SnackbarProvider/SnackbarProvider.js";
|
|
23
23
|
import "../../utils/iconsList.js";
|
|
24
|
-
import { u as
|
|
25
|
-
import { R as
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
function Ge(e, t) {
|
|
29
|
-
if (e === t)
|
|
30
|
-
return !0;
|
|
31
|
-
if (!(e instanceof Object) || !(t instanceof Object))
|
|
32
|
-
return !1;
|
|
33
|
-
let o = 0, r = 0;
|
|
34
|
-
for (const n in e)
|
|
35
|
-
if (o += 1, !Le(e[n], t[n]) || !(n in t))
|
|
36
|
-
return !1;
|
|
37
|
-
for (const n in t)
|
|
38
|
-
r += 1;
|
|
39
|
-
return o === r;
|
|
40
|
-
}
|
|
41
|
-
function ze(e, t) {
|
|
42
|
-
const o = e.compareDocumentPosition(t);
|
|
43
|
-
return o & Node.DOCUMENT_POSITION_FOLLOWING || o & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : o & Node.DOCUMENT_POSITION_PRECEDING || o & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
|
|
44
|
-
}
|
|
45
|
-
function Fe(e, t) {
|
|
46
|
-
if (e.size !== t.size)
|
|
47
|
-
return !1;
|
|
48
|
-
for (const [o, r] of e.entries()) {
|
|
49
|
-
const n = t.get(o);
|
|
50
|
-
if ((r == null ? void 0 : r.index) !== (n == null ? void 0 : n.index) || n !== void 0 && !Ge(r, n))
|
|
51
|
-
return !1;
|
|
52
|
-
}
|
|
53
|
-
return !0;
|
|
54
|
-
}
|
|
55
|
-
function de(e) {
|
|
56
|
-
const {
|
|
57
|
-
children: t,
|
|
58
|
-
elementsRef: o,
|
|
59
|
-
labelsRef: r,
|
|
60
|
-
onMapChange: n
|
|
61
|
-
} = e, [u, l] = f.useState(() => /* @__PURE__ */ new Map()), g = f.useCallback((s, i) => {
|
|
62
|
-
l((c) => new Map(c).set(s, i ?? null));
|
|
63
|
-
}, []), a = f.useCallback((s) => {
|
|
64
|
-
l((i) => {
|
|
65
|
-
const c = new Map(i);
|
|
66
|
-
return c.delete(s), c;
|
|
67
|
-
});
|
|
68
|
-
}, []);
|
|
69
|
-
ne(() => {
|
|
70
|
-
const s = new Map(u);
|
|
71
|
-
Array.from(s.keys()).sort(ze).forEach((c, m) => {
|
|
72
|
-
const y = u.get(c) ?? {};
|
|
73
|
-
s.set(c, {
|
|
74
|
-
...y,
|
|
75
|
-
index: m
|
|
76
|
-
});
|
|
77
|
-
}), Fe(u, s) || (l(s), n == null || n(s));
|
|
78
|
-
}, [u, n]);
|
|
79
|
-
const p = f.useMemo(() => ({
|
|
80
|
-
register: g,
|
|
81
|
-
unregister: a,
|
|
82
|
-
map: u,
|
|
83
|
-
elementsRef: o,
|
|
84
|
-
labelsRef: r
|
|
85
|
-
}), [g, a, u, o, r]);
|
|
86
|
-
return /* @__PURE__ */ V(xe.Provider, {
|
|
87
|
-
value: p,
|
|
88
|
-
children: t
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
process.env.NODE_ENV !== "production" && (de.propTypes = {
|
|
92
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
93
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
94
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
95
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
96
|
-
/**
|
|
97
|
-
* @ignore
|
|
98
|
-
*/
|
|
99
|
-
children: d.node,
|
|
100
|
-
/**
|
|
101
|
-
* A ref to the list of HTML elements, ordered by their index.
|
|
102
|
-
* `useListNavigation`'s `listRef` prop.
|
|
103
|
-
*/
|
|
104
|
-
elementsRef: d.any,
|
|
105
|
-
/**
|
|
106
|
-
* A ref to the list of element labels, ordered by their index.
|
|
107
|
-
* `useTypeahead`'s `listRef` prop.
|
|
108
|
-
*/
|
|
109
|
-
labelsRef: d.shape({
|
|
110
|
-
current: d.arrayOf(d.string).isRequired
|
|
111
|
-
}),
|
|
112
|
-
/**
|
|
113
|
-
* @ignore
|
|
114
|
-
*/
|
|
115
|
-
onMapChange: d.func
|
|
116
|
-
});
|
|
117
|
-
const fe = /* @__PURE__ */ f.createContext(void 0);
|
|
118
|
-
process.env.NODE_ENV !== "production" && (fe.displayName = "DirectionContext");
|
|
119
|
-
function je(e = !0) {
|
|
120
|
-
const t = f.useContext(fe);
|
|
121
|
-
if (t === void 0 && !e)
|
|
122
|
-
throw new Error("Base UI: DirectionContext is missing.");
|
|
123
|
-
return (t == null ? void 0 : t.direction) ?? "ltr";
|
|
124
|
-
}
|
|
125
|
-
function Ue({
|
|
24
|
+
import { u as L, a as he, b as F, C as Ue, f as we, N as Oe, c as Ne, d as be, A as Ye, E as pe, e as Ge, g as $e, h as ve, i as je, j as Je, m as Xe, k as qe, l as Ze, v as Qe, s as j } from "../../RadioOption-DyRY8xlF.js";
|
|
25
|
+
import { R as ln } from "../../RadioOption-DyRY8xlF.js";
|
|
26
|
+
import { i as et, a as me, b as Ce } from "../../Popup-D267EI4e.js";
|
|
27
|
+
function tt({
|
|
126
28
|
controlled: e,
|
|
127
29
|
default: t,
|
|
128
|
-
name:
|
|
129
|
-
state:
|
|
30
|
+
name: i,
|
|
31
|
+
state: o = "value"
|
|
130
32
|
}) {
|
|
131
33
|
const {
|
|
132
|
-
current:
|
|
133
|
-
} =
|
|
34
|
+
current: l
|
|
35
|
+
} = y.useRef(e !== void 0), [n, u] = y.useState(t), m = l ? e : n;
|
|
134
36
|
if (process.env.NODE_ENV !== "production") {
|
|
135
|
-
|
|
136
|
-
|
|
37
|
+
y.useEffect(() => {
|
|
38
|
+
l !== (e !== void 0) && console.error([`Base UI: A component is changing the ${l ? "" : "un"}controlled ${o} state of ${i} to be ${l ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${i} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
|
|
137
39
|
`));
|
|
138
|
-
}, [
|
|
40
|
+
}, [o, i, e]);
|
|
139
41
|
const {
|
|
140
|
-
current:
|
|
141
|
-
} =
|
|
142
|
-
|
|
143
|
-
!
|
|
42
|
+
current: r
|
|
43
|
+
} = y.useRef(t);
|
|
44
|
+
y.useEffect(() => {
|
|
45
|
+
!l && JSON.stringify(r) !== JSON.stringify(t) && console.error([`Base UI: A component is changing the default ${o} state of an uncontrolled ${i} after being initialized. To suppress this warning opt to use a controlled ${i}.`].join(`
|
|
144
46
|
`));
|
|
145
47
|
}, [JSON.stringify(t)]);
|
|
146
48
|
}
|
|
147
|
-
const
|
|
148
|
-
|
|
49
|
+
const f = y.useCallback((r) => {
|
|
50
|
+
l || u(r);
|
|
149
51
|
}, []);
|
|
150
|
-
return [
|
|
52
|
+
return [m, f];
|
|
151
53
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
54
|
+
function nt(e) {
|
|
55
|
+
const {
|
|
56
|
+
children: t,
|
|
57
|
+
elementsRef: i,
|
|
58
|
+
labelsRef: o,
|
|
59
|
+
onMapChange: l
|
|
60
|
+
} = e, n = L(l), u = y.useRef(0), m = he(ot).current, f = he(rt).current, [r, a] = y.useState(0), s = y.useRef(r), p = L((c, E) => {
|
|
61
|
+
f.set(c, E ?? null), s.current += 1, a(s.current);
|
|
62
|
+
}), w = L((c) => {
|
|
63
|
+
f.delete(c), s.current += 1, a(s.current);
|
|
64
|
+
}), M = y.useMemo(() => {
|
|
65
|
+
const c = /* @__PURE__ */ new Map();
|
|
66
|
+
return Array.from(f.keys()).filter((d) => d.isConnected).sort(it).forEach((d, h) => {
|
|
67
|
+
const R = f.get(d) ?? {};
|
|
68
|
+
c.set(d, {
|
|
69
|
+
...R,
|
|
70
|
+
index: h
|
|
71
|
+
});
|
|
72
|
+
}), c;
|
|
73
|
+
}, [f, r]);
|
|
74
|
+
F(() => {
|
|
75
|
+
if (typeof MutationObserver != "function" || M.size === 0)
|
|
76
|
+
return;
|
|
77
|
+
const c = new MutationObserver((E) => {
|
|
78
|
+
const d = /* @__PURE__ */ new Set(), h = (R) => d.has(R) ? d.delete(R) : d.add(R);
|
|
79
|
+
E.forEach((R) => {
|
|
80
|
+
R.removedNodes.forEach(h), R.addedNodes.forEach(h);
|
|
81
|
+
}), d.size === 0 && (s.current += 1, a(s.current));
|
|
82
|
+
});
|
|
83
|
+
return M.forEach((E, d) => {
|
|
84
|
+
d.parentElement && c.observe(d.parentElement, {
|
|
85
|
+
childList: !0
|
|
86
|
+
});
|
|
87
|
+
}), () => {
|
|
88
|
+
c.disconnect();
|
|
89
|
+
};
|
|
90
|
+
}, [M]), F(() => {
|
|
91
|
+
s.current === r && (i.current.length !== M.size && (i.current.length = M.size), o && o.current.length !== M.size && (o.current.length = M.size), u.current = M.size), n(M);
|
|
92
|
+
}, [n, M, i, o, r]), F(() => () => {
|
|
93
|
+
i.current = [];
|
|
94
|
+
}, [i]), F(() => () => {
|
|
95
|
+
o && (o.current = []);
|
|
96
|
+
}, [o]);
|
|
97
|
+
const b = L((c) => (m.add(c), () => {
|
|
98
|
+
m.delete(c);
|
|
99
|
+
}));
|
|
100
|
+
F(() => {
|
|
101
|
+
m.forEach((c) => c(M));
|
|
102
|
+
}, [m, M]);
|
|
103
|
+
const S = y.useMemo(() => ({
|
|
104
|
+
register: p,
|
|
105
|
+
unregister: w,
|
|
106
|
+
subscribeMapChange: b,
|
|
107
|
+
elementsRef: i,
|
|
108
|
+
labelsRef: o,
|
|
109
|
+
nextIndexRef: u
|
|
110
|
+
}), [p, w, b, i, o, u]);
|
|
111
|
+
return /* @__PURE__ */ V(Ue.Provider, {
|
|
112
|
+
value: S,
|
|
113
|
+
children: t
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function rt() {
|
|
117
|
+
return /* @__PURE__ */ new Map();
|
|
118
|
+
}
|
|
119
|
+
function ot() {
|
|
120
|
+
return /* @__PURE__ */ new Set();
|
|
155
121
|
}
|
|
156
|
-
function
|
|
157
|
-
|
|
122
|
+
function it(e, t) {
|
|
123
|
+
const i = e.compareDocumentPosition(t);
|
|
124
|
+
return i & Node.DOCUMENT_POSITION_FOLLOWING || i & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING || i & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
|
|
158
125
|
}
|
|
159
|
-
|
|
160
|
-
|
|
126
|
+
const Se = /* @__PURE__ */ y.createContext(void 0);
|
|
127
|
+
process.env.NODE_ENV !== "production" && (Se.displayName = "DirectionContext");
|
|
128
|
+
function st() {
|
|
129
|
+
const e = y.useContext(Se);
|
|
130
|
+
return (e == null ? void 0 : e.direction) ?? "ltr";
|
|
161
131
|
}
|
|
162
|
-
|
|
163
|
-
|
|
132
|
+
function at(e) {
|
|
133
|
+
return e == null || e.hasAttribute("disabled") || e.getAttribute("aria-disabled") === "true";
|
|
134
|
+
}
|
|
135
|
+
const fe = "ArrowLeft", de = "ArrowRight", lt = "ArrowUp", ut = "ArrowDown";
|
|
136
|
+
function ct(e, t) {
|
|
137
|
+
var o;
|
|
138
|
+
if (!e || !t)
|
|
139
|
+
return !1;
|
|
140
|
+
const i = (o = t.getRootNode) == null ? void 0 : o.call(t);
|
|
141
|
+
if (e.contains(t))
|
|
142
|
+
return !0;
|
|
143
|
+
if (i && et(i)) {
|
|
144
|
+
let l = t;
|
|
145
|
+
for (; l; ) {
|
|
146
|
+
if (e === l)
|
|
147
|
+
return !0;
|
|
148
|
+
l = l.parentNode || l.host;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return !1;
|
|
152
|
+
}
|
|
153
|
+
function J(e) {
|
|
164
154
|
e.preventDefault(), e.stopPropagation();
|
|
165
155
|
}
|
|
166
|
-
function
|
|
167
|
-
return Math.floor(e / t) !==
|
|
156
|
+
function re(e, t, i) {
|
|
157
|
+
return Math.floor(e / t) !== i;
|
|
168
158
|
}
|
|
169
|
-
function
|
|
159
|
+
function ie(e, t) {
|
|
170
160
|
return t < 0 || t >= e.current.length;
|
|
171
161
|
}
|
|
172
|
-
function
|
|
173
|
-
return
|
|
162
|
+
function ft(e, t) {
|
|
163
|
+
return _(e, {
|
|
174
164
|
disabledIndices: t
|
|
175
165
|
});
|
|
176
166
|
}
|
|
177
|
-
function
|
|
178
|
-
return
|
|
167
|
+
function dt(e, t) {
|
|
168
|
+
return _(e, {
|
|
179
169
|
decrement: !0,
|
|
180
170
|
startingIndex: e.current.length,
|
|
181
171
|
disabledIndices: t
|
|
182
172
|
});
|
|
183
173
|
}
|
|
184
|
-
function
|
|
174
|
+
function _(e, {
|
|
185
175
|
startingIndex: t = -1,
|
|
186
|
-
decrement:
|
|
187
|
-
disabledIndices:
|
|
188
|
-
amount:
|
|
176
|
+
decrement: i = !1,
|
|
177
|
+
disabledIndices: o,
|
|
178
|
+
amount: l = 1
|
|
189
179
|
} = {}) {
|
|
190
|
-
|
|
191
|
-
let l = t;
|
|
180
|
+
let n = t;
|
|
192
181
|
do
|
|
193
|
-
|
|
194
|
-
while (
|
|
195
|
-
return
|
|
182
|
+
n += i ? -l : l;
|
|
183
|
+
while (n >= 0 && n <= e.current.length - 1 && Z(e, n, o));
|
|
184
|
+
return n;
|
|
196
185
|
}
|
|
197
|
-
function
|
|
186
|
+
function gt(e, {
|
|
198
187
|
event: t,
|
|
199
|
-
orientation:
|
|
200
|
-
|
|
188
|
+
orientation: i,
|
|
189
|
+
loopFocus: o,
|
|
190
|
+
rtl: l,
|
|
201
191
|
cols: n,
|
|
202
192
|
disabledIndices: u,
|
|
203
|
-
minIndex:
|
|
204
|
-
maxIndex:
|
|
205
|
-
prevIndex:
|
|
206
|
-
|
|
207
|
-
stopEvent: s = !1
|
|
193
|
+
minIndex: m,
|
|
194
|
+
maxIndex: f,
|
|
195
|
+
prevIndex: r,
|
|
196
|
+
stopEvent: a = !1
|
|
208
197
|
}) {
|
|
209
|
-
let
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
198
|
+
let s = r;
|
|
199
|
+
const p = [], w = {};
|
|
200
|
+
let M = !1;
|
|
201
|
+
{
|
|
202
|
+
let c = null, E = -1;
|
|
203
|
+
e.current.forEach((d, h) => {
|
|
204
|
+
if (d == null)
|
|
205
|
+
return;
|
|
206
|
+
const R = d.closest('[role="row"]');
|
|
207
|
+
R && (M = !0), (R !== c || E === -1) && (c = R, E += 1, p[E] = []), p[E].push(h), w[h] = E;
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
const b = M && p.length > 0 && p.some((c) => c.length !== n);
|
|
211
|
+
function S(c) {
|
|
212
|
+
if (!b || r === -1)
|
|
213
|
+
return;
|
|
214
|
+
const E = w[r];
|
|
215
|
+
if (E == null)
|
|
216
|
+
return;
|
|
217
|
+
const d = p[E].indexOf(r);
|
|
218
|
+
let h = c === "up" ? E - 1 : E + 1;
|
|
219
|
+
o && (h < 0 ? h = p.length - 1 : h >= p.length && (h = 0));
|
|
220
|
+
const R = /* @__PURE__ */ new Set();
|
|
221
|
+
for (; h >= 0 && h < p.length && !R.has(h); ) {
|
|
222
|
+
R.add(h);
|
|
223
|
+
const O = p[h];
|
|
224
|
+
if (O.length === 0) {
|
|
225
|
+
h = c === "up" ? h - 1 : h + 1;
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
const B = Math.min(d, O.length - 1);
|
|
229
|
+
for (let D = B; D >= 0; D -= 1) {
|
|
230
|
+
const g = O[D];
|
|
231
|
+
if (!Z(e, g, u))
|
|
232
|
+
return g;
|
|
233
|
+
}
|
|
234
|
+
h = c === "up" ? h - 1 : h + 1, o && (h < 0 ? h = p.length - 1 : h >= p.length && (h = 0));
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (t.key === lt) {
|
|
238
|
+
const c = S("up");
|
|
239
|
+
if (c !== void 0)
|
|
240
|
+
a && J(t), s = c;
|
|
241
|
+
else {
|
|
242
|
+
if (a && J(t), r === -1)
|
|
243
|
+
s = f;
|
|
244
|
+
else if (s = _(e, {
|
|
245
|
+
startingIndex: s,
|
|
246
|
+
amount: n,
|
|
247
|
+
decrement: !0,
|
|
248
|
+
disabledIndices: u
|
|
249
|
+
}), o && (r - n < m || s < 0)) {
|
|
250
|
+
const E = r % n, d = f % n, h = f - (d - E);
|
|
251
|
+
d === E ? s = f : s = d > E ? h : h - n;
|
|
252
|
+
}
|
|
253
|
+
ie(e, s) && (s = r);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (t.key === ut) {
|
|
257
|
+
const c = S("down");
|
|
258
|
+
c !== void 0 ? (a && J(t), s = c) : (a && J(t), r === -1 ? s = m : (s = _(e, {
|
|
259
|
+
startingIndex: r,
|
|
215
260
|
amount: n,
|
|
216
|
-
decrement: !0,
|
|
217
261
|
disabledIndices: u
|
|
218
|
-
}),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
262
|
+
}), o && r + n > f && (s = _(e, {
|
|
263
|
+
startingIndex: r % n - n,
|
|
264
|
+
amount: n,
|
|
265
|
+
disabledIndices: u
|
|
266
|
+
}))), ie(e, s) && (s = r));
|
|
223
267
|
}
|
|
224
|
-
if (
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}), r && a + n > g && (i = N(e, {
|
|
229
|
-
startingIndex: a % n - n,
|
|
230
|
-
amount: n,
|
|
231
|
-
disabledIndices: u
|
|
232
|
-
}))), W(e, i) && (i = a)), o === "both") {
|
|
233
|
-
const c = p ? v : x, m = p ? x : v, y = Math.floor(a / n);
|
|
234
|
-
t.key === c && (s && U(t), a % n !== n - 1 ? (i = N(e, {
|
|
235
|
-
startingIndex: a,
|
|
268
|
+
if (i === "both") {
|
|
269
|
+
const c = me(r / n);
|
|
270
|
+
t.key === (l ? fe : de) && (a && J(t), r % n !== n - 1 ? (s = _(e, {
|
|
271
|
+
startingIndex: r,
|
|
236
272
|
disabledIndices: u
|
|
237
|
-
}),
|
|
238
|
-
startingIndex:
|
|
273
|
+
}), o && re(s, n, c) && (s = _(e, {
|
|
274
|
+
startingIndex: r - r % n - 1,
|
|
239
275
|
disabledIndices: u
|
|
240
|
-
}))) :
|
|
241
|
-
startingIndex:
|
|
276
|
+
}))) : o && (s = _(e, {
|
|
277
|
+
startingIndex: r - r % n - 1,
|
|
242
278
|
disabledIndices: u
|
|
243
|
-
})),
|
|
244
|
-
startingIndex:
|
|
279
|
+
})), re(s, n, c) && (s = r)), t.key === (l ? de : fe) && (a && J(t), r % n !== 0 ? (s = _(e, {
|
|
280
|
+
startingIndex: r,
|
|
245
281
|
decrement: !0,
|
|
246
282
|
disabledIndices: u
|
|
247
|
-
}),
|
|
248
|
-
startingIndex:
|
|
283
|
+
}), o && re(s, n, c) && (s = _(e, {
|
|
284
|
+
startingIndex: r + (n - r % n),
|
|
249
285
|
decrement: !0,
|
|
250
286
|
disabledIndices: u
|
|
251
|
-
}))) :
|
|
252
|
-
startingIndex:
|
|
287
|
+
}))) : o && (s = _(e, {
|
|
288
|
+
startingIndex: r + (n - r % n),
|
|
253
289
|
decrement: !0,
|
|
254
290
|
disabledIndices: u
|
|
255
|
-
})),
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
startingIndex:
|
|
291
|
+
})), re(s, n, c) && (s = r));
|
|
292
|
+
const E = me(f / n) === c;
|
|
293
|
+
ie(e, s) && (o && E ? s = t.key === (l ? de : fe) ? f : _(e, {
|
|
294
|
+
startingIndex: r - r % n - 1,
|
|
259
295
|
disabledIndices: u
|
|
260
|
-
}) :
|
|
296
|
+
}) : s = r);
|
|
261
297
|
}
|
|
262
|
-
return
|
|
298
|
+
return s;
|
|
263
299
|
}
|
|
264
|
-
function
|
|
265
|
-
const
|
|
266
|
-
let
|
|
300
|
+
function ht(e, t, i) {
|
|
301
|
+
const o = [];
|
|
302
|
+
let l = 0;
|
|
267
303
|
return e.forEach(({
|
|
268
|
-
width:
|
|
269
|
-
height:
|
|
270
|
-
},
|
|
271
|
-
if (
|
|
272
|
-
throw new Error(`[
|
|
273
|
-
let
|
|
274
|
-
for (
|
|
275
|
-
const
|
|
276
|
-
for (let
|
|
277
|
-
for (let
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}),
|
|
304
|
+
width: n,
|
|
305
|
+
height: u
|
|
306
|
+
}, m) => {
|
|
307
|
+
if (n > t && process.env.NODE_ENV !== "production")
|
|
308
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `[Floating UI]: Invalid grid - item width at index ${m} is greater than grid columns` : we(29, m));
|
|
309
|
+
let f = !1;
|
|
310
|
+
for (i && (l = 0); !f; ) {
|
|
311
|
+
const r = [];
|
|
312
|
+
for (let a = 0; a < n; a += 1)
|
|
313
|
+
for (let s = 0; s < u; s += 1)
|
|
314
|
+
r.push(l + a + s * t);
|
|
315
|
+
l % t + n <= t && r.every((a) => o[a] == null) ? (r.forEach((a) => {
|
|
316
|
+
o[a] = m;
|
|
317
|
+
}), f = !0) : l += 1;
|
|
282
318
|
}
|
|
283
|
-
}), [...
|
|
319
|
+
}), [...o];
|
|
284
320
|
}
|
|
285
|
-
function
|
|
321
|
+
function pt(e, t, i, o, l) {
|
|
286
322
|
if (e === -1)
|
|
287
323
|
return -1;
|
|
288
|
-
const
|
|
289
|
-
switch (
|
|
324
|
+
const n = i.indexOf(e), u = t[e];
|
|
325
|
+
switch (l) {
|
|
290
326
|
case "tl":
|
|
291
|
-
return
|
|
327
|
+
return n;
|
|
292
328
|
case "tr":
|
|
293
|
-
return
|
|
329
|
+
return u ? n + u.width - 1 : n;
|
|
294
330
|
case "bl":
|
|
295
|
-
return
|
|
331
|
+
return u ? n + (u.height - 1) * o : n;
|
|
296
332
|
case "br":
|
|
297
|
-
return
|
|
333
|
+
return i.lastIndexOf(e);
|
|
298
334
|
default:
|
|
299
335
|
return -1;
|
|
300
336
|
}
|
|
301
337
|
}
|
|
302
|
-
function
|
|
303
|
-
return t.flatMap((
|
|
304
|
-
}
|
|
305
|
-
function
|
|
306
|
-
if (
|
|
307
|
-
return
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
338
|
+
function mt(e, t) {
|
|
339
|
+
return t.flatMap((i, o) => e.includes(i) ? [o] : []);
|
|
340
|
+
}
|
|
341
|
+
function Z(e, t, i) {
|
|
342
|
+
if (typeof i == "function")
|
|
343
|
+
return i(t);
|
|
344
|
+
if (i)
|
|
345
|
+
return i.includes(t);
|
|
346
|
+
const o = e.current[t];
|
|
347
|
+
return o ? o.hasAttribute("disabled") || o.getAttribute("aria-disabled") === "true" : !1;
|
|
348
|
+
}
|
|
349
|
+
const Q = "ArrowUp", X = "ArrowDown", se = "ArrowLeft", ee = "ArrowRight", ae = "Home", le = "End", Ie = /* @__PURE__ */ new Set([se, ee]), Rt = /* @__PURE__ */ new Set([se, ee, ae, le]), Te = /* @__PURE__ */ new Set([Q, X]), yt = /* @__PURE__ */ new Set([Q, X, ae, le]), Pe = /* @__PURE__ */ new Set([...Ie, ...Te]), Et = /* @__PURE__ */ new Set([...Pe, ae, le]), Ae = "Shift", Mt = "Control", wt = "Alt", Ot = "Meta", Nt = /* @__PURE__ */ new Set([Ae, Mt, wt, Ot]);
|
|
350
|
+
function bt(e) {
|
|
351
|
+
return Ce(e) && e.tagName === "INPUT";
|
|
352
|
+
}
|
|
353
|
+
function Re(e) {
|
|
354
|
+
return !!(bt(e) && e.selectionStart != null || Ce(e) && e.tagName === "TEXTAREA");
|
|
355
|
+
}
|
|
356
|
+
function ye(e, t, i, o) {
|
|
357
|
+
if (!e || !t || !t.scrollTo)
|
|
358
|
+
return;
|
|
359
|
+
let l = e.scrollLeft, n = e.scrollTop;
|
|
360
|
+
const u = e.clientWidth < e.scrollWidth, m = e.clientHeight < e.scrollHeight;
|
|
361
|
+
if (u && o !== "vertical") {
|
|
362
|
+
const f = Ee(e, t, "left"), r = oe(e), a = oe(t);
|
|
363
|
+
i === "ltr" && (f + t.offsetWidth + a.scrollMarginRight > e.scrollLeft + e.clientWidth - r.scrollPaddingRight ? l = f + t.offsetWidth + a.scrollMarginRight - e.clientWidth + r.scrollPaddingRight : f - a.scrollMarginLeft < e.scrollLeft + r.scrollPaddingLeft && (l = f - a.scrollMarginLeft - r.scrollPaddingLeft)), i === "rtl" && (f - a.scrollMarginRight < e.scrollLeft + r.scrollPaddingLeft ? l = f - a.scrollMarginLeft - r.scrollPaddingLeft : f + t.offsetWidth + a.scrollMarginRight > e.scrollLeft + e.clientWidth - r.scrollPaddingRight && (l = f + t.offsetWidth + a.scrollMarginRight - e.clientWidth + r.scrollPaddingRight));
|
|
315
364
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
function rt(e, t = "mui") {
|
|
320
|
-
const [o, r] = f.useState(e), n = e || o;
|
|
321
|
-
return f.useEffect(() => {
|
|
322
|
-
o == null && (se += 1, r(`${t}-${se}`));
|
|
323
|
-
}, [o, t]), n;
|
|
324
|
-
}
|
|
325
|
-
const it = {
|
|
326
|
-
...f
|
|
327
|
-
}, ue = it.useId;
|
|
328
|
-
function at(e, t) {
|
|
329
|
-
if (ue !== void 0) {
|
|
330
|
-
const o = ue();
|
|
331
|
-
return `${t}-${o}`;
|
|
365
|
+
if (m && o !== "horizontal") {
|
|
366
|
+
const f = Ee(e, t, "top"), r = oe(e), a = oe(t);
|
|
367
|
+
f - a.scrollMarginTop < e.scrollTop + r.scrollPaddingTop ? n = f - a.scrollMarginTop - r.scrollPaddingTop : f + t.offsetHeight + a.scrollMarginBottom > e.scrollTop + e.clientHeight - r.scrollPaddingBottom && (n = f + t.offsetHeight + a.scrollMarginBottom - e.clientHeight + r.scrollPaddingBottom);
|
|
332
368
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
function ut() {
|
|
339
|
-
return typeof window < "u";
|
|
369
|
+
e.scrollTo({
|
|
370
|
+
left: l,
|
|
371
|
+
top: n,
|
|
372
|
+
behavior: "auto"
|
|
373
|
+
});
|
|
340
374
|
}
|
|
341
|
-
function
|
|
342
|
-
|
|
343
|
-
|
|
375
|
+
function Ee(e, t, i) {
|
|
376
|
+
const o = i === "left" ? "offsetLeft" : "offsetTop";
|
|
377
|
+
let l = 0;
|
|
378
|
+
for (; t.offsetParent && (l += t[o], t.offsetParent !== e); )
|
|
379
|
+
t = t.offsetParent;
|
|
380
|
+
return l;
|
|
344
381
|
}
|
|
345
|
-
function
|
|
346
|
-
|
|
382
|
+
function oe(e) {
|
|
383
|
+
const t = getComputedStyle(e);
|
|
384
|
+
return {
|
|
385
|
+
scrollMarginTop: parseFloat(t.scrollMarginTop) || 0,
|
|
386
|
+
scrollMarginRight: parseFloat(t.scrollMarginRight) || 0,
|
|
387
|
+
scrollMarginBottom: parseFloat(t.scrollMarginBottom) || 0,
|
|
388
|
+
scrollMarginLeft: parseFloat(t.scrollMarginLeft) || 0,
|
|
389
|
+
scrollPaddingTop: parseFloat(t.scrollPaddingTop) || 0,
|
|
390
|
+
scrollPaddingRight: parseFloat(t.scrollPaddingRight) || 0,
|
|
391
|
+
scrollPaddingBottom: parseFloat(t.scrollPaddingBottom) || 0,
|
|
392
|
+
scrollPaddingLeft: parseFloat(t.scrollPaddingLeft) || 0
|
|
393
|
+
};
|
|
347
394
|
}
|
|
348
|
-
function
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
if (o && ct(o)) {
|
|
355
|
-
let r = t;
|
|
356
|
-
for (; r; ) {
|
|
357
|
-
if (e === r)
|
|
358
|
-
return !0;
|
|
359
|
-
r = r.parentNode || r.host;
|
|
395
|
+
function Ct(e, t) {
|
|
396
|
+
return {
|
|
397
|
+
...e,
|
|
398
|
+
state: {
|
|
399
|
+
...e.state,
|
|
400
|
+
valid: !t && e.state.valid
|
|
360
401
|
}
|
|
361
|
-
}
|
|
362
|
-
return !1;
|
|
402
|
+
};
|
|
363
403
|
}
|
|
364
|
-
const
|
|
404
|
+
const _e = /* @__PURE__ */ y.createContext({
|
|
365
405
|
formRef: {
|
|
366
406
|
current: {
|
|
367
407
|
fields: /* @__PURE__ */ new Map()
|
|
368
408
|
}
|
|
369
409
|
},
|
|
370
410
|
errors: {},
|
|
371
|
-
|
|
411
|
+
clearErrors: Oe,
|
|
412
|
+
validationMode: "onSubmit",
|
|
413
|
+
submitAttemptedRef: {
|
|
414
|
+
current: !1
|
|
372
415
|
}
|
|
373
416
|
});
|
|
374
|
-
process.env.NODE_ENV !== "production" && (
|
|
375
|
-
function
|
|
376
|
-
return
|
|
417
|
+
process.env.NODE_ENV !== "production" && (_e.displayName = "FormContext");
|
|
418
|
+
function Le() {
|
|
419
|
+
return y.useContext(_e);
|
|
377
420
|
}
|
|
378
|
-
function
|
|
379
|
-
return {
|
|
380
|
-
...e,
|
|
381
|
-
state: {
|
|
382
|
-
...e.state,
|
|
383
|
-
valid: !t && e.state.valid
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
const ft = Object.keys(_e);
|
|
388
|
-
function gt() {
|
|
389
|
-
const {
|
|
390
|
-
setValidityData: e,
|
|
391
|
-
validate: t,
|
|
392
|
-
messageIds: o,
|
|
393
|
-
validityData: r,
|
|
394
|
-
validationMode: n,
|
|
395
|
-
validationDebounceTime: u,
|
|
396
|
-
invalid: l,
|
|
397
|
-
markedDirtyRef: g,
|
|
398
|
-
controlId: a,
|
|
399
|
-
state: p
|
|
400
|
-
} = Y(), {
|
|
401
|
-
formRef: s
|
|
402
|
-
} = ye(), i = f.useRef(-1), c = f.useRef(null);
|
|
403
|
-
f.useEffect(() => () => {
|
|
404
|
-
window.clearTimeout(i.current);
|
|
405
|
-
}, []);
|
|
406
|
-
const m = oe(async (R) => {
|
|
407
|
-
const E = c.current;
|
|
408
|
-
if (!E)
|
|
409
|
-
return;
|
|
410
|
-
function O(S) {
|
|
411
|
-
return ft.reduce((T, b) => (T[b] = S.validity[b], !S.validity.customError && !g.current && (T[b] = b === "valid"), T), {});
|
|
412
|
-
}
|
|
413
|
-
window.clearTimeout(i.current);
|
|
414
|
-
const I = t(R);
|
|
415
|
-
let h = null;
|
|
416
|
-
typeof I == "object" && I !== null && "then" in I ? h = await I : h = I;
|
|
417
|
-
let M = "";
|
|
418
|
-
h !== null && (M = Array.isArray(h) ? h.join(`
|
|
419
|
-
`) : h), E.setCustomValidity(M);
|
|
420
|
-
const X = O(E);
|
|
421
|
-
let w = [];
|
|
422
|
-
Array.isArray(h) ? w = h : h ? w = [h] : E.validationMessage && (w = [E.validationMessage]);
|
|
423
|
-
const _ = {
|
|
424
|
-
value: R,
|
|
425
|
-
state: X,
|
|
426
|
-
error: Array.isArray(h) ? h[0] : h ?? E.validationMessage,
|
|
427
|
-
errors: w,
|
|
428
|
-
initialValue: r.initialValue
|
|
429
|
-
};
|
|
430
|
-
if (a) {
|
|
431
|
-
const S = s.current.fields.get(a);
|
|
432
|
-
S && s.current.fields.set(a, {
|
|
433
|
-
...S,
|
|
434
|
-
...Ce(_, l)
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
e(_);
|
|
438
|
-
}), y = f.useCallback((R = {}) => G(R, {
|
|
439
|
-
...o.length && {
|
|
440
|
-
"aria-describedby": o.join(" ")
|
|
441
|
-
},
|
|
442
|
-
...p.valid === !1 && {
|
|
443
|
-
"aria-invalid": !0
|
|
444
|
-
}
|
|
445
|
-
}), [o, p.valid]), C = f.useCallback((R = {}) => G(y(R), {
|
|
446
|
-
onChange(E) {
|
|
447
|
-
if (E.nativeEvent.defaultPrevented || l || n !== "onChange")
|
|
448
|
-
return;
|
|
449
|
-
const O = E.currentTarget;
|
|
450
|
-
if (O.value === "") {
|
|
451
|
-
m(O.value);
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
454
|
-
window.clearTimeout(i.current), u ? i.current = window.setTimeout(() => {
|
|
455
|
-
m(O.value);
|
|
456
|
-
}, u) : m(O.value);
|
|
457
|
-
}
|
|
458
|
-
}), [y, l, n, u, m]);
|
|
459
|
-
return f.useMemo(() => ({
|
|
460
|
-
getValidationProps: y,
|
|
461
|
-
getInputValidationProps: C,
|
|
462
|
-
inputRef: c,
|
|
463
|
-
commitValidation: m
|
|
464
|
-
}), [y, C, m]);
|
|
465
|
-
}
|
|
466
|
-
function ht(e) {
|
|
421
|
+
function St(e) {
|
|
467
422
|
const {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
423
|
+
enabled: t = !0,
|
|
424
|
+
value: i,
|
|
425
|
+
id: o,
|
|
426
|
+
name: l,
|
|
427
|
+
controlRef: n,
|
|
428
|
+
commit: u
|
|
429
|
+
} = e, {
|
|
430
|
+
formRef: m
|
|
431
|
+
} = Le(), {
|
|
432
|
+
invalid: f,
|
|
471
433
|
markedDirtyRef: r,
|
|
472
|
-
validityData:
|
|
473
|
-
setValidityData:
|
|
474
|
-
} =
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
let i = l;
|
|
483
|
-
i === void 0 && (i = (c = s.current) == null ? void 0 : c.call(s)), n.initialValue === null && i !== n.initialValue && u((m) => ({
|
|
484
|
-
...m,
|
|
485
|
-
initialValue: i
|
|
434
|
+
validityData: a,
|
|
435
|
+
setValidityData: s
|
|
436
|
+
} = Ne(), p = L(e.getValue);
|
|
437
|
+
F(() => {
|
|
438
|
+
if (!t)
|
|
439
|
+
return;
|
|
440
|
+
let w = i;
|
|
441
|
+
w === void 0 && (w = p()), a.initialValue === null && w !== null && s((M) => ({
|
|
442
|
+
...M,
|
|
443
|
+
initialValue: w
|
|
486
444
|
}));
|
|
487
|
-
}, [
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
445
|
+
}, [t, s, i, a.initialValue, p]), F(() => {
|
|
446
|
+
!t || !o || m.current.fields.set(o, {
|
|
447
|
+
getValue: p,
|
|
448
|
+
name: l,
|
|
449
|
+
controlRef: n,
|
|
450
|
+
validityData: Ct(a, f),
|
|
491
451
|
validate() {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
i === void 0 && (i = (c = s.current) == null ? void 0 : c.call(s)), r.current = !0, Te.flushSync(() => p(i));
|
|
452
|
+
let w = i;
|
|
453
|
+
w === void 0 && (w = p()), r.current = !0, Be.flushSync(() => u(w));
|
|
495
454
|
}
|
|
496
455
|
});
|
|
497
|
-
}, [
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
456
|
+
}, [u, n, t, m, p, o, f, r, l, a, i]), F(() => {
|
|
457
|
+
const w = m.current.fields;
|
|
458
|
+
return () => {
|
|
459
|
+
o && w.delete(o);
|
|
460
|
+
};
|
|
461
|
+
}, [m, o]);
|
|
462
|
+
}
|
|
463
|
+
function It(e, t) {
|
|
464
|
+
const i = y.useRef(e), o = L(t);
|
|
465
|
+
F(() => {
|
|
466
|
+
i.current !== e && o(i.current);
|
|
467
|
+
}, [e, o]), F(() => {
|
|
468
|
+
i.current = e;
|
|
469
|
+
}, [e]);
|
|
470
|
+
}
|
|
471
|
+
const xe = /* @__PURE__ */ y.createContext({
|
|
472
|
+
legendId: void 0,
|
|
473
|
+
setLegendId: () => {
|
|
474
|
+
},
|
|
475
|
+
disabled: void 0
|
|
476
|
+
});
|
|
477
|
+
process.env.NODE_ENV !== "production" && (xe.displayName = "FieldsetRootContext");
|
|
478
|
+
function Tt(e = !1) {
|
|
479
|
+
const t = y.useContext(xe);
|
|
480
|
+
if (!t && !e)
|
|
481
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>." : we(86));
|
|
482
|
+
return t;
|
|
483
|
+
}
|
|
484
|
+
const Pt = [];
|
|
485
|
+
function At(e) {
|
|
501
486
|
const {
|
|
502
487
|
itemSizes: t,
|
|
503
|
-
cols:
|
|
504
|
-
|
|
505
|
-
dense:
|
|
506
|
-
orientation:
|
|
507
|
-
direction:
|
|
508
|
-
highlightedIndex:
|
|
509
|
-
onHighlightedIndexChange:
|
|
510
|
-
rootRef:
|
|
511
|
-
enableHomeAndEndKeys:
|
|
512
|
-
stopEventPropagation:
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
488
|
+
cols: i = 1,
|
|
489
|
+
loopFocus: o = !0,
|
|
490
|
+
dense: l = !1,
|
|
491
|
+
orientation: n = "both",
|
|
492
|
+
direction: u,
|
|
493
|
+
highlightedIndex: m,
|
|
494
|
+
onHighlightedIndexChange: f,
|
|
495
|
+
rootRef: r,
|
|
496
|
+
enableHomeAndEndKeys: a = !1,
|
|
497
|
+
stopEventPropagation: s = !1,
|
|
498
|
+
disabledIndices: p,
|
|
499
|
+
modifierKeys: w = Pt
|
|
500
|
+
} = e, [M, b] = y.useState(0), S = i > 1, c = y.useRef(null), E = be(c, r), d = y.useRef([]), h = y.useRef(!1), R = m ?? M, O = L((g, T = !1) => {
|
|
501
|
+
if ((f ?? b)(g), T) {
|
|
502
|
+
const k = d.current[g];
|
|
503
|
+
ye(c.current, k, u, n);
|
|
504
|
+
}
|
|
505
|
+
}), B = L((g) => {
|
|
506
|
+
if (g.size === 0 || h.current)
|
|
507
|
+
return;
|
|
508
|
+
h.current = !0;
|
|
509
|
+
const T = Array.from(g.keys()), k = T.find((C) => C == null ? void 0 : C.hasAttribute(Ye)) ?? null, x = k ? T.indexOf(k) : -1;
|
|
510
|
+
x !== -1 && O(x), ye(c.current, k, u, n);
|
|
511
|
+
}), D = y.useMemo(() => ({
|
|
512
|
+
"aria-orientation": n === "both" ? void 0 : n,
|
|
513
|
+
ref: E,
|
|
514
|
+
onFocus(g) {
|
|
515
|
+
!c.current || !Re(g.target) || g.target.setSelectionRange(0, g.target.value.length ?? 0);
|
|
516
|
+
},
|
|
517
|
+
onKeyDown(g) {
|
|
518
|
+
const T = a ? Et : Pe;
|
|
519
|
+
if (!T.has(g.key) || _t(g, w) || !c.current)
|
|
522
520
|
return;
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
521
|
+
const x = u === "rtl", C = x ? se : ee, W = {
|
|
522
|
+
horizontal: C,
|
|
523
|
+
vertical: X,
|
|
524
|
+
both: C
|
|
525
|
+
}[n], z = x ? ee : se, N = {
|
|
526
|
+
horizontal: z,
|
|
527
|
+
vertical: Q,
|
|
528
|
+
both: z
|
|
529
|
+
}[n];
|
|
530
|
+
if (Re(g.target) && !at(g.target)) {
|
|
531
|
+
const P = g.target.selectionStart, H = g.target.selectionEnd, q = g.target.value ?? "";
|
|
532
|
+
if (P == null || g.shiftKey || P !== H || g.key !== N && P < q.length || g.key !== W && P > 0)
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
let I = R;
|
|
536
|
+
const U = ft(d, p), Y = dt(d, p);
|
|
537
|
+
if (S) {
|
|
538
|
+
const P = t || Array.from({
|
|
539
|
+
length: d.current.length
|
|
530
540
|
}, () => ({
|
|
531
541
|
width: 1,
|
|
532
542
|
height: 1
|
|
533
|
-
})),
|
|
534
|
-
|
|
535
|
-
current:
|
|
543
|
+
})), H = ht(P, i, l), q = H.findIndex((K) => K != null && !Z(d, K, p)), ne = H.reduce((K, $, ue) => $ != null && !Z(d, $, p) ? ue : K, -1);
|
|
544
|
+
I = H[gt({
|
|
545
|
+
current: H.map((K) => K ? d.current[K] : null)
|
|
536
546
|
}, {
|
|
537
|
-
event:
|
|
538
|
-
orientation:
|
|
539
|
-
|
|
540
|
-
cols:
|
|
547
|
+
event: g,
|
|
548
|
+
orientation: n,
|
|
549
|
+
loopFocus: o,
|
|
550
|
+
cols: i,
|
|
541
551
|
// treat undefined (empty grid spaces) as disabled indices so we
|
|
542
552
|
// don't end up in them
|
|
543
|
-
disabledIndices:
|
|
544
|
-
minIndex:
|
|
545
|
-
maxIndex:
|
|
546
|
-
prevIndex:
|
|
547
|
-
|
|
553
|
+
disabledIndices: mt([...p || d.current.map((K, $) => Z(d, $) ? $ : void 0), void 0], H),
|
|
554
|
+
minIndex: q,
|
|
555
|
+
maxIndex: ne,
|
|
556
|
+
prevIndex: pt(
|
|
557
|
+
R > Y ? U : R,
|
|
558
|
+
P,
|
|
548
559
|
H,
|
|
549
|
-
|
|
550
|
-
o,
|
|
560
|
+
i,
|
|
551
561
|
// use a corner matching the edge closest to the direction we're
|
|
552
562
|
// moving in so we don't end up in the same item. Prefer
|
|
553
563
|
// top/left over bottom/right.
|
|
554
564
|
// eslint-disable-next-line no-nested-ternary
|
|
555
|
-
|
|
565
|
+
g.key === X ? "bl" : g.key === ee ? "tr" : "tl"
|
|
556
566
|
),
|
|
557
|
-
rtl:
|
|
567
|
+
rtl: x
|
|
558
568
|
})];
|
|
559
569
|
}
|
|
560
|
-
const
|
|
561
|
-
horizontal: [
|
|
562
|
-
vertical: [
|
|
563
|
-
both: [
|
|
564
|
-
}[
|
|
565
|
-
horizontal: [
|
|
566
|
-
vertical: [
|
|
567
|
-
both: [
|
|
568
|
-
}[
|
|
569
|
-
horizontal:
|
|
570
|
-
vertical:
|
|
571
|
-
both:
|
|
572
|
-
}[
|
|
573
|
-
|
|
574
|
-
startingIndex:
|
|
575
|
-
decrement:
|
|
576
|
-
disabledIndices:
|
|
577
|
-
})),
|
|
578
|
-
var
|
|
579
|
-
(
|
|
570
|
+
const G = {
|
|
571
|
+
horizontal: [C],
|
|
572
|
+
vertical: [X],
|
|
573
|
+
both: [C, X]
|
|
574
|
+
}[n], v = {
|
|
575
|
+
horizontal: [z],
|
|
576
|
+
vertical: [Q],
|
|
577
|
+
both: [z, Q]
|
|
578
|
+
}[n], te = S ? T : {
|
|
579
|
+
horizontal: a ? Rt : Ie,
|
|
580
|
+
vertical: a ? yt : Te,
|
|
581
|
+
both: T
|
|
582
|
+
}[n];
|
|
583
|
+
a && (g.key === ae ? I = U : g.key === le && (I = Y)), I === R && (G.includes(g.key) || v.includes(g.key)) && (o && I === Y && G.includes(g.key) ? I = U : o && I === U && v.includes(g.key) ? I = Y : I = _(d, {
|
|
584
|
+
startingIndex: I,
|
|
585
|
+
decrement: v.includes(g.key),
|
|
586
|
+
disabledIndices: p
|
|
587
|
+
})), I !== R && !ie(d, I) && (s && g.stopPropagation(), te.has(g.key) && g.preventDefault(), O(I, !0), queueMicrotask(() => {
|
|
588
|
+
var P;
|
|
589
|
+
(P = d.current[I]) == null || P.focus();
|
|
580
590
|
}));
|
|
581
591
|
}
|
|
582
|
-
}), [
|
|
583
|
-
return
|
|
584
|
-
|
|
585
|
-
highlightedIndex:
|
|
586
|
-
onHighlightedIndexChange:
|
|
587
|
-
elementsRef:
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
592
|
+
}), [i, l, u, p, d, a, R, S, t, o, E, w, O, n, s]);
|
|
593
|
+
return y.useMemo(() => ({
|
|
594
|
+
props: D,
|
|
595
|
+
highlightedIndex: R,
|
|
596
|
+
onHighlightedIndexChange: O,
|
|
597
|
+
elementsRef: d,
|
|
598
|
+
disabledIndices: p,
|
|
599
|
+
onMapChange: B,
|
|
600
|
+
relayKeyboardEvent: D.onKeyDown
|
|
601
|
+
}), [D, R, O, d, p, B]);
|
|
602
|
+
}
|
|
603
|
+
function _t(e, t) {
|
|
604
|
+
for (const i of Nt.values())
|
|
605
|
+
if (!t.includes(i) && e.getModifierState(i))
|
|
606
|
+
return !0;
|
|
607
|
+
return !1;
|
|
608
|
+
}
|
|
609
|
+
function Lt(e) {
|
|
591
610
|
const {
|
|
592
611
|
render: t,
|
|
593
|
-
className:
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}),
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
612
|
+
className: i,
|
|
613
|
+
refs: o = pe,
|
|
614
|
+
props: l = pe,
|
|
615
|
+
state: n = Ge,
|
|
616
|
+
stateAttributesMapping: u,
|
|
617
|
+
highlightedIndex: m,
|
|
618
|
+
onHighlightedIndexChange: f,
|
|
619
|
+
orientation: r,
|
|
620
|
+
dense: a,
|
|
621
|
+
itemSizes: s,
|
|
622
|
+
loopFocus: p,
|
|
623
|
+
cols: w,
|
|
624
|
+
enableHomeAndEndKeys: M,
|
|
625
|
+
onMapChange: b,
|
|
626
|
+
stopEventPropagation: S = !0,
|
|
627
|
+
rootRef: c,
|
|
628
|
+
disabledIndices: E,
|
|
629
|
+
modifierKeys: d,
|
|
630
|
+
highlightItemOnHover: h = !1,
|
|
631
|
+
tag: R = "div",
|
|
632
|
+
...O
|
|
633
|
+
} = e, B = st(), {
|
|
634
|
+
props: D,
|
|
635
|
+
highlightedIndex: g,
|
|
636
|
+
onHighlightedIndexChange: T,
|
|
637
|
+
elementsRef: k,
|
|
638
|
+
onMapChange: x,
|
|
639
|
+
relayKeyboardEvent: C
|
|
640
|
+
} = At({
|
|
641
|
+
itemSizes: s,
|
|
642
|
+
cols: w,
|
|
643
|
+
loopFocus: p,
|
|
644
|
+
dense: a,
|
|
645
|
+
orientation: r,
|
|
646
|
+
highlightedIndex: m,
|
|
647
|
+
onHighlightedIndexChange: f,
|
|
648
|
+
rootRef: c,
|
|
649
|
+
stopEventPropagation: S,
|
|
650
|
+
enableHomeAndEndKeys: M,
|
|
651
|
+
direction: B,
|
|
652
|
+
disabledIndices: E,
|
|
653
|
+
modifierKeys: d
|
|
654
|
+
}), W = $e(R, e, {
|
|
655
|
+
state: n,
|
|
656
|
+
ref: o,
|
|
657
|
+
props: [D, ...l, O],
|
|
658
|
+
stateAttributesMapping: u
|
|
659
|
+
}), z = y.useMemo(() => ({
|
|
660
|
+
highlightedIndex: g,
|
|
661
|
+
onHighlightedIndexChange: T,
|
|
662
|
+
highlightItemOnHover: h,
|
|
663
|
+
relayKeyboardEvent: C
|
|
664
|
+
}), [g, T, h, C]);
|
|
665
|
+
return /* @__PURE__ */ V(ve.Provider, {
|
|
666
|
+
value: z,
|
|
667
|
+
children: /* @__PURE__ */ V(nt, {
|
|
668
|
+
elementsRef: k,
|
|
669
|
+
onMapChange: (N) => {
|
|
670
|
+
b == null || b(N), x(N);
|
|
671
|
+
},
|
|
672
|
+
children: W
|
|
642
673
|
})
|
|
643
674
|
});
|
|
644
675
|
}
|
|
645
|
-
|
|
646
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
647
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
648
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
649
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
650
|
-
/**
|
|
651
|
-
* @ignore
|
|
652
|
-
*/
|
|
653
|
-
children: d.node,
|
|
654
|
-
/**
|
|
655
|
-
* CSS class applied to the element, or a function that
|
|
656
|
-
* returns a class based on the component’s state.
|
|
657
|
-
*/
|
|
658
|
-
className: d.oneOfType([d.func, d.string]),
|
|
659
|
-
/**
|
|
660
|
-
* @ignore
|
|
661
|
-
*/
|
|
662
|
-
cols: d.number,
|
|
663
|
-
/**
|
|
664
|
-
* @ignore
|
|
665
|
-
*/
|
|
666
|
-
dense: d.bool,
|
|
667
|
-
/**
|
|
668
|
-
* @ignore
|
|
669
|
-
*/
|
|
670
|
-
direction: d.oneOf(["ltr", "rtl"]),
|
|
671
|
-
/**
|
|
672
|
-
* @ignore
|
|
673
|
-
*/
|
|
674
|
-
enableHomeAndEndKeys: d.bool,
|
|
675
|
-
/**
|
|
676
|
-
* @ignore
|
|
677
|
-
*/
|
|
678
|
-
highlightedIndex: d.number,
|
|
679
|
-
/**
|
|
680
|
-
* @ignore
|
|
681
|
-
*/
|
|
682
|
-
itemSizes: d.arrayOf(d.shape({
|
|
683
|
-
height: d.number.isRequired,
|
|
684
|
-
width: d.number.isRequired
|
|
685
|
-
})),
|
|
686
|
-
/**
|
|
687
|
-
* @ignore
|
|
688
|
-
*/
|
|
689
|
-
loop: d.bool,
|
|
690
|
-
/**
|
|
691
|
-
* @ignore
|
|
692
|
-
*/
|
|
693
|
-
onHighlightedIndexChange: d.func,
|
|
694
|
-
/**
|
|
695
|
-
* @ignore
|
|
696
|
-
*/
|
|
697
|
-
onMapChange: d.func,
|
|
698
|
-
/**
|
|
699
|
-
* @ignore
|
|
700
|
-
*/
|
|
701
|
-
orientation: d.oneOf(["both", "horizontal", "vertical"]),
|
|
702
|
-
/**
|
|
703
|
-
* Allows you to replace the component’s HTML element
|
|
704
|
-
* with a different tag, or compose it with another component.
|
|
705
|
-
*
|
|
706
|
-
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
707
|
-
*/
|
|
708
|
-
render: d.oneOfType([d.element, d.func]),
|
|
709
|
-
/**
|
|
710
|
-
* @ignore
|
|
711
|
-
*/
|
|
712
|
-
rootRef: ve,
|
|
713
|
-
/**
|
|
714
|
-
* @ignore
|
|
715
|
-
*/
|
|
716
|
-
stopEventPropagation: d.bool
|
|
717
|
-
});
|
|
718
|
-
function pt(e) {
|
|
676
|
+
const xt = [Ae], De = /* @__PURE__ */ y.forwardRef(function(t, i) {
|
|
719
677
|
const {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
readOnly:
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
678
|
+
render: o,
|
|
679
|
+
className: l,
|
|
680
|
+
disabled: n,
|
|
681
|
+
readOnly: u,
|
|
682
|
+
required: m,
|
|
683
|
+
onValueChange: f,
|
|
684
|
+
value: r,
|
|
685
|
+
defaultValue: a,
|
|
686
|
+
name: s,
|
|
687
|
+
inputRef: p,
|
|
688
|
+
id: w,
|
|
689
|
+
...M
|
|
690
|
+
} = t, {
|
|
691
|
+
setTouched: b,
|
|
692
|
+
setFocused: S,
|
|
693
|
+
shouldValidateOnChange: c,
|
|
694
|
+
validationMode: E,
|
|
695
|
+
name: d,
|
|
696
|
+
disabled: h,
|
|
697
|
+
state: R,
|
|
698
|
+
validation: O,
|
|
699
|
+
setDirty: B,
|
|
700
|
+
setFilled: D,
|
|
701
|
+
validityData: g
|
|
702
|
+
} = Ne(), {
|
|
703
|
+
labelId: T
|
|
704
|
+
} = je(), {
|
|
705
|
+
clearErrors: k
|
|
706
|
+
} = Le(), x = Tt(!0), C = h || n, W = d ?? s, z = Je(w), [N, I] = tt({
|
|
707
|
+
controlled: r,
|
|
708
|
+
default: a,
|
|
733
709
|
name: "RadioGroup",
|
|
734
710
|
state: "value"
|
|
711
|
+
}), U = L(f), Y = L((A, ge) => {
|
|
712
|
+
U(A, ge), !ge.isCanceled && I(A);
|
|
713
|
+
}), G = y.useRef(null), v = L((A) => {
|
|
714
|
+
G.current == null && A != null && (G.current = A);
|
|
735
715
|
});
|
|
736
|
-
|
|
737
|
-
id:
|
|
738
|
-
|
|
739
|
-
value:
|
|
740
|
-
controlRef:
|
|
716
|
+
St({
|
|
717
|
+
id: z,
|
|
718
|
+
commit: O.commit,
|
|
719
|
+
value: N,
|
|
720
|
+
controlRef: G,
|
|
721
|
+
name: W,
|
|
722
|
+
getValue: () => N ?? null
|
|
723
|
+
}), It(N, () => {
|
|
724
|
+
k(W), B(N !== g.initialValue), D(N != null), c() ? O.commit(N) : O.commit(N, !0);
|
|
741
725
|
});
|
|
742
|
-
const [
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
"
|
|
746
|
-
|
|
726
|
+
const [te, P] = y.useState(!1), H = L((A) => {
|
|
727
|
+
ct(A.currentTarget, A.relatedTarget) || (b(!0), S(!1), E === "onBlur" && O.commit(N));
|
|
728
|
+
}), q = L((A) => {
|
|
729
|
+
A.key.startsWith("Arrow") && (b(!0), P(!0), S(!0));
|
|
730
|
+
}), ne = y.useMemo(() => N == null ? "" : typeof N == "string" ? N : JSON.stringify(N), [N]), K = be(O.inputRef, p), $ = Xe({
|
|
731
|
+
value: ne,
|
|
732
|
+
ref: K,
|
|
733
|
+
id: z,
|
|
734
|
+
name: ne ? W : void 0,
|
|
735
|
+
disabled: C,
|
|
736
|
+
readOnly: u,
|
|
737
|
+
required: m,
|
|
738
|
+
"aria-labelledby": M["aria-labelledby"] ?? (x == null ? void 0 : x.legendId),
|
|
739
|
+
"aria-hidden": !0,
|
|
740
|
+
tabIndex: -1,
|
|
741
|
+
style: Qe,
|
|
742
|
+
onChange: Oe,
|
|
743
|
+
// suppress a Next.js error
|
|
747
744
|
onFocus() {
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
onBlur(h) {
|
|
751
|
-
dt(h.currentTarget, h.relatedTarget) || (g(!0), a(!1), p === "onBlur" && s.commitValidation(c));
|
|
752
|
-
},
|
|
753
|
-
onKeyDownCapture(h) {
|
|
754
|
-
h.key.startsWith("Arrow") && (g(!0), C(!0), a(!0));
|
|
745
|
+
var A;
|
|
746
|
+
(A = G.current) == null || A.focus();
|
|
755
747
|
}
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
value: E,
|
|
759
|
-
ref: s.inputRef,
|
|
760
|
-
id: i,
|
|
761
|
-
name: o,
|
|
762
|
-
disabled: t,
|
|
763
|
-
readOnly: n
|
|
764
|
-
}), [s, E, i, o, t, n]);
|
|
765
|
-
return f.useMemo(() => ({
|
|
766
|
-
getRootProps: R,
|
|
767
|
-
getInputProps: O,
|
|
768
|
-
checkedValue: c,
|
|
769
|
-
setCheckedValue: m,
|
|
770
|
-
touched: y,
|
|
771
|
-
setTouched: C,
|
|
772
|
-
fieldControlValidation: s
|
|
773
|
-
}), [R, O, c, m, y, s]);
|
|
774
|
-
}
|
|
775
|
-
const Re = /* @__PURE__ */ f.forwardRef(function(t, o) {
|
|
776
|
-
const {
|
|
777
|
-
render: r,
|
|
778
|
-
className: n,
|
|
779
|
-
disabled: u,
|
|
780
|
-
readOnly: l,
|
|
781
|
-
required: g,
|
|
782
|
-
onValueChange: a,
|
|
783
|
-
name: p,
|
|
784
|
-
...s
|
|
785
|
-
} = t, i = je(), c = pt(t), {
|
|
786
|
-
state: m,
|
|
787
|
-
disabled: y
|
|
788
|
-
} = Y(), C = y || u, R = oe(a ?? (() => {
|
|
789
|
-
})), E = f.useMemo(() => ({
|
|
790
|
-
...m,
|
|
748
|
+
}, O.getInputValidationProps), ue = y.useMemo(() => ({
|
|
749
|
+
...R,
|
|
791
750
|
disabled: C ?? !1,
|
|
792
|
-
required:
|
|
793
|
-
readOnly:
|
|
794
|
-
}), [
|
|
795
|
-
...
|
|
796
|
-
|
|
797
|
-
onValueChange: R,
|
|
751
|
+
required: m ?? !1,
|
|
752
|
+
readOnly: u ?? !1
|
|
753
|
+
}), [R, C, u, m]), Ve = y.useMemo(() => ({
|
|
754
|
+
...R,
|
|
755
|
+
checkedValue: N,
|
|
798
756
|
disabled: C,
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
757
|
+
validation: O,
|
|
758
|
+
name: W,
|
|
759
|
+
onValueChange: U,
|
|
760
|
+
readOnly: u,
|
|
761
|
+
registerControlRef: v,
|
|
762
|
+
required: m,
|
|
763
|
+
setCheckedValue: Y,
|
|
764
|
+
setTouched: P,
|
|
765
|
+
touched: te
|
|
766
|
+
}), [N, C, O, R, W, U, u, v, m, Y, P, te]), ke = {
|
|
767
|
+
role: "radiogroup",
|
|
768
|
+
"aria-required": m || void 0,
|
|
769
|
+
"aria-disabled": C || void 0,
|
|
770
|
+
"aria-readonly": u || void 0,
|
|
771
|
+
"aria-labelledby": T,
|
|
772
|
+
onFocus() {
|
|
773
|
+
S(!0);
|
|
774
|
+
},
|
|
775
|
+
onBlur: H,
|
|
776
|
+
onKeyDownCapture: q
|
|
777
|
+
};
|
|
778
|
+
return /* @__PURE__ */ Me(qe.Provider, {
|
|
779
|
+
value: Ve,
|
|
780
|
+
children: [/* @__PURE__ */ V(Lt, {
|
|
781
|
+
render: o,
|
|
782
|
+
className: l,
|
|
783
|
+
state: ue,
|
|
784
|
+
props: [ke, O.getValidationProps, M],
|
|
785
|
+
refs: [i],
|
|
786
|
+
stateAttributesMapping: Ze,
|
|
816
787
|
enableHomeAndEndKeys: !1,
|
|
817
|
-
|
|
788
|
+
modifierKeys: xt
|
|
818
789
|
}), /* @__PURE__ */ V("input", {
|
|
819
|
-
|
|
790
|
+
...$
|
|
820
791
|
})]
|
|
821
792
|
});
|
|
822
793
|
});
|
|
823
|
-
process.env.NODE_ENV !== "production" && (
|
|
824
|
-
|
|
825
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
826
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
827
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
828
|
-
/**
|
|
829
|
-
* @ignore
|
|
830
|
-
*/
|
|
831
|
-
children: d.node,
|
|
832
|
-
/**
|
|
833
|
-
* CSS class applied to the element, or a function that
|
|
834
|
-
* returns a class based on the component’s state.
|
|
835
|
-
*/
|
|
836
|
-
className: d.oneOfType([d.func, d.string]),
|
|
837
|
-
/**
|
|
838
|
-
* The uncontrolled value of the radio button that should be initially selected.
|
|
839
|
-
*
|
|
840
|
-
* To render a controlled radio group, use the `value` prop instead.
|
|
841
|
-
*/
|
|
842
|
-
defaultValue: d.any,
|
|
843
|
-
/**
|
|
844
|
-
* Whether the component should ignore user interaction.
|
|
845
|
-
* @default false
|
|
846
|
-
*/
|
|
847
|
-
disabled: d.bool,
|
|
848
|
-
/**
|
|
849
|
-
* Identifies the field when a form is submitted.
|
|
850
|
-
*/
|
|
851
|
-
name: d.string,
|
|
852
|
-
/**
|
|
853
|
-
* Callback fired when the value changes.
|
|
854
|
-
*/
|
|
855
|
-
onValueChange: d.func,
|
|
856
|
-
/**
|
|
857
|
-
* Whether the user should be unable to select a different radio button in the group.
|
|
858
|
-
* @default false
|
|
859
|
-
*/
|
|
860
|
-
readOnly: d.bool,
|
|
861
|
-
/**
|
|
862
|
-
* Allows you to replace the component’s HTML element
|
|
863
|
-
* with a different tag, or compose it with another component.
|
|
864
|
-
*
|
|
865
|
-
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
866
|
-
*/
|
|
867
|
-
render: d.oneOfType([d.element, d.func]),
|
|
868
|
-
/**
|
|
869
|
-
* Whether the user must choose a value before submitting a form.
|
|
870
|
-
* @default false
|
|
871
|
-
*/
|
|
872
|
-
required: d.bool,
|
|
873
|
-
/**
|
|
874
|
-
* The controlled value of the radio item that should be currently selected.
|
|
875
|
-
*
|
|
876
|
-
* To render an uncontrolled radio group, use the `defaultValue` prop instead.
|
|
877
|
-
*/
|
|
878
|
-
value: d.any
|
|
879
|
-
});
|
|
880
|
-
const zt = ({
|
|
794
|
+
process.env.NODE_ENV !== "production" && (De.displayName = "RadioGroup");
|
|
795
|
+
const on = ({
|
|
881
796
|
className: e,
|
|
882
797
|
name: t,
|
|
883
|
-
label:
|
|
884
|
-
disabled:
|
|
885
|
-
defaultValue:
|
|
886
|
-
checked:
|
|
887
|
-
"data-testid":
|
|
888
|
-
onChange:
|
|
889
|
-
children:
|
|
798
|
+
label: i,
|
|
799
|
+
disabled: o,
|
|
800
|
+
defaultValue: l,
|
|
801
|
+
checked: n,
|
|
802
|
+
"data-testid": u = "radio-button-group",
|
|
803
|
+
onChange: m,
|
|
804
|
+
children: f
|
|
890
805
|
}) => {
|
|
891
|
-
|
|
806
|
+
f || console.error(
|
|
892
807
|
"[Marola - Radio Button component]A new component version using RadioGroup is available. Please use that instead."
|
|
893
808
|
);
|
|
894
|
-
const [
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
}, [
|
|
898
|
-
const
|
|
899
|
-
if (
|
|
809
|
+
const [r, a] = Ke(n), s = ce(j["legacy-radio--input"], o && j["legacy-radio--input__disabled"]), p = ce(j["legacy-radio--label"], o && j["legacy-radio--label__disabled"]), w = ce(j["legacy-radio"], o && j["legacy-radio--disabled"], e);
|
|
810
|
+
Fe(() => {
|
|
811
|
+
a(n);
|
|
812
|
+
}, [n]);
|
|
813
|
+
const M = () => {
|
|
814
|
+
if (o)
|
|
900
815
|
return;
|
|
901
|
-
const
|
|
902
|
-
|
|
816
|
+
const b = !r;
|
|
817
|
+
a(b), m(b);
|
|
903
818
|
};
|
|
904
|
-
return
|
|
905
|
-
|
|
819
|
+
return f ? /* @__PURE__ */ V(He, { children: /* @__PURE__ */ V(
|
|
820
|
+
De,
|
|
906
821
|
{
|
|
907
|
-
"data-testid":
|
|
908
|
-
onValueChange:
|
|
822
|
+
"data-testid": u,
|
|
823
|
+
onValueChange: (b, S) => m(b, S.event),
|
|
909
824
|
name: t,
|
|
910
|
-
defaultValue:
|
|
825
|
+
defaultValue: l,
|
|
911
826
|
className: e,
|
|
912
|
-
children:
|
|
827
|
+
children: f
|
|
913
828
|
}
|
|
914
|
-
) }) : /* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */ V("input", { name: t, type: "radio", checked:
|
|
916
|
-
/* @__PURE__ */ V("span", { className:
|
|
917
|
-
/* @__PURE__ */ V(
|
|
829
|
+
) }) : /* @__PURE__ */ Me("div", { "data-testid": u, onClick: () => M(), className: w, children: [
|
|
830
|
+
/* @__PURE__ */ V("input", { name: t, type: "radio", checked: r, readOnly: !0 }),
|
|
831
|
+
/* @__PURE__ */ V("span", { className: s, children: r && /* @__PURE__ */ V(We, { icon: "circle", color: "var(--accent)", size: 8 }) }),
|
|
832
|
+
/* @__PURE__ */ V(ze, { className: p, variant: "base-lg", children: i })
|
|
918
833
|
] });
|
|
919
834
|
};
|
|
920
835
|
export {
|
|
921
|
-
|
|
922
|
-
|
|
836
|
+
on as RadioButton,
|
|
837
|
+
ln as RadioOption
|
|
923
838
|
};
|