@pismo/marola 0.0.1-alpha.32 → 0.0.1-alpha.5
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/README.md +2 -13
- package/dist/{Button-2b1peDFT.js → Button-D--uN90N.js} +26 -25
- package/dist/Dialog.module-BKWFakxu.js +15 -0
- package/dist/ListContext-Dj2Va7Iv.js +18 -0
- package/dist/Tabs.module-BKlNuSPH.js +66 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/PageHeader.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/main.css +1 -0
- package/dist/components/Button/Button.d.ts +2 -13
- package/dist/components/Button/Button.js +49 -60
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +1 -1
- package/dist/components/Dialog/CloseIconButton.js +124 -12
- package/dist/components/Dialog/Dialog.d.ts +3 -4
- package/dist/components/Dialog/Dialog.js +20098 -444
- package/dist/components/Dialog/{DialogTitle.d.ts → Title.d.ts} +3 -3
- package/dist/components/Dialog/Title.js +29 -0
- package/dist/components/IconButton/IconButton.d.ts +5 -21
- package/dist/components/IconButton/IconButton.js +76 -60
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +0 -2
- package/dist/components/PageHeader/PageHeader.d.ts +16 -56
- package/dist/components/PageHeader/PageHeader.js +65 -83
- package/dist/components/Pagination/Pagination.d.ts +6 -25
- package/dist/components/Pagination/Pagination.js +113 -131
- package/dist/components/SortTooltip/SortTooltip.d.ts +0 -28
- package/dist/components/SortTooltip/SortTooltip.js +1 -93
- package/dist/components/Table/Table.d.ts +0 -56
- package/dist/components/Table/Table.js +1 -137
- package/dist/components/Table/TableContext.d.ts +0 -19
- package/dist/components/Table/TableContext.js +1 -21
- package/dist/components/Tabs/Tab.d.ts +1 -6
- package/dist/components/Tabs/Tab.js +173 -113
- package/dist/components/Tabs/TabPanel.d.ts +1 -5
- package/dist/components/Tabs/TabPanel.js +16 -15
- package/dist/components/Tabs/Tabs.d.ts +2 -8
- package/dist/components/Tabs/Tabs.js +664 -242
- package/dist/components/Tooltip/Tooltip.d.ts +0 -33
- package/dist/components/Tooltip/Tooltip.js +1 -141
- package/dist/components/Typography/Typography.d.ts +6 -17
- package/dist/components/Typography/Typography.js +58 -58
- package/dist/{index-CH45lKw7.js → index-BvA1HyDs.js} +300 -322
- package/dist/main.d.ts +8 -27
- package/dist/main.js +28 -75
- package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +22 -0
- package/dist/types/helpers.d.ts +0 -8
- package/dist/useButton-abQpo0za.js +187 -0
- package/dist/useCompoundItem-wTwXbURC.js +41 -0
- package/package.json +9 -30
- package/dist/ClickAwayListener-BSW-Nd-y.js +0 -107
- package/dist/Dialog.module-DFEmFdYT.js +0 -30
- package/dist/Group-B3p31ftp.js +0 -26
- package/dist/Popup-B6ZSGIEI.js +0 -1248
- package/dist/Portal-DIeBsWdL.js +0 -73
- package/dist/SelectButton-C8JQKaf4.js +0 -61
- package/dist/Tabs.module-jkH1Qjn7.js +0 -22
- package/dist/Toggle-BCgIItCc.js +0 -142
- package/dist/assets/Advice.css +0 -1
- package/dist/assets/Checkbox.css +0 -1
- package/dist/assets/EllipsisTooltip.css +0 -1
- package/dist/assets/Group.css +0 -1
- package/dist/assets/Input.css +0 -1
- package/dist/assets/InputSearch.css +0 -1
- package/dist/assets/SelectButton.css +0 -1
- package/dist/assets/Skeleton.css +0 -1
- package/dist/assets/Snackbar.css +0 -1
- package/dist/assets/SortTooltip.css +0 -1
- package/dist/assets/Stepper.css +0 -1
- package/dist/assets/Table.css +0 -1
- package/dist/assets/TextDisplay.css +0 -1
- package/dist/assets/Toggle.css +0 -1
- package/dist/assets/Toggle2.css +0 -1
- package/dist/assets/Tooltip.css +0 -1
- package/dist/combineHooksSlotProps-DVjg9PRh.js +0 -80
- package/dist/components/Advice/Advice.d.ts +0 -30
- package/dist/components/Advice/Advice.js +0 -47
- package/dist/components/Advice/Advice.stories.d.ts +0 -18
- package/dist/components/Button/Button.stories.d.ts +0 -62
- package/dist/components/Checkbox/Checkbox.d.ts +0 -34
- package/dist/components/Checkbox/Checkbox.js +0 -71
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -31
- package/dist/components/Chip/Chip.d.ts +0 -39
- package/dist/components/Chip/Chip.js +0 -19
- package/dist/components/Chip/Chip.stories.d.ts +0 -42
- package/dist/components/Chip/chip.test.d.ts +0 -1
- package/dist/components/Dialog/Dialog.stories.d.ts +0 -343
- package/dist/components/Dialog/DialogTitle.js +0 -29
- package/dist/components/EllipsisTooltip/EllipsisTooltip.d.ts +0 -7
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +0 -23
- package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +0 -31
- package/dist/components/Icon/Icon.d.ts +0 -11
- package/dist/components/Icon/Icon.js +0 -127
- package/dist/components/Icon/Icon.stories.d.ts +0 -15
- package/dist/components/Icon/types.d.ts +0 -5
- package/dist/components/Icon/types.js +0 -1
- package/dist/components/IconButton/Icon.stories.d.ts +0 -15
- package/dist/components/Input/Input.d.ts +0 -44
- package/dist/components/Input/Input.js +0 -508
- package/dist/components/Input/Input.stories.d.ts +0 -43
- package/dist/components/InputSearch/InputSearch.d.ts +0 -9
- package/dist/components/InputSearch/InputSearch.js +0 -34
- package/dist/components/InputSearch/InputSearch.stories.d.ts +0 -39
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +0 -14
- package/dist/components/PageHeader/PageHeader.stories.d.ts +0 -14
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -17
- package/dist/components/Select/Select.d.ts +0 -26
- package/dist/components/Select/Select.js +0 -857
- package/dist/components/Select/Select.stories.d.ts +0 -22
- package/dist/components/Select/SelectButton.d.ts +0 -12
- package/dist/components/Select/SelectButton.js +0 -8
- package/dist/components/Skeleton/Skeleton.d.ts +0 -25
- package/dist/components/Skeleton/Skeleton.js +0 -23
- package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -14
- package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +0 -14
- package/dist/components/Skeleton/SkeletonTable.stories.d.ts +0 -16
- package/dist/components/Snackbar/Snackbar.d.ts +0 -27
- package/dist/components/Snackbar/Snackbar.js +0 -639
- package/dist/components/Snackbar/Snackbar.stories.d.ts +0 -319
- package/dist/components/Stepper/Stepper.d.ts +0 -26
- package/dist/components/Stepper/Stepper.js +0 -48
- package/dist/components/Stepper/Stepper.stories.d.ts +0 -16
- package/dist/components/Table/Table.stories.d.ts +0 -29
- package/dist/components/Table/_Table.TBody.stories.d.ts +0 -14
- package/dist/components/Table/_Table.THead.stories.d.ts +0 -14
- package/dist/components/Table/_Table.Td.stories.d.ts +0 -16
- package/dist/components/Table/_Table.Th.stories.d.ts +0 -15
- package/dist/components/Table/_Table.Tr.stories.d.ts +0 -15
- package/dist/components/Tabs/Tab.stories.d.ts +0 -15
- package/dist/components/Tabs/TabPanel.stories.d.ts +0 -14
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -14
- package/dist/components/TextDisplay/TextDisplay.d.ts +0 -23
- package/dist/components/TextDisplay/TextDisplay.js +0 -37
- package/dist/components/TextDisplay/TextDisplay.stories.d.ts +0 -13
- package/dist/components/TextDisplay/textDisplay.test.d.ts +0 -1
- package/dist/components/Toggle/Toggle.d.ts +0 -11
- package/dist/components/Toggle/Toggle.js +0 -266
- package/dist/components/Toggle/Toggle.stories.d.ts +0 -21
- package/dist/components/ToggleGroup/Group.d.ts +0 -18
- package/dist/components/ToggleGroup/Group.js +0 -7
- package/dist/components/ToggleGroup/Group.test.d.ts +0 -1
- package/dist/components/ToggleGroup/Toggle.d.ts +0 -15
- package/dist/components/ToggleGroup/Toggle.js +0 -17
- package/dist/components/ToggleGroup/Toggle.test.d.ts +0 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +0 -2
- package/dist/components/ToggleGroup/ToggleGroup.js +0 -6
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +0 -25
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -35
- package/dist/components/Typography/Typography.stories.d.ts +0 -32
- package/dist/components/Typography/typography.test.d.ts +0 -1
- package/dist/contexts/SnackbarProvider/SnackbarProvider.d.ts +0 -11
- package/dist/contexts/SnackbarProvider/SnackbarProvider.js +0 -50
- package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +0 -21
- package/dist/index-CjW42-M-.js +0 -19584
- package/dist/marola.css +0 -1
- package/dist/test-utils/assertStyles.d.ts +0 -1
- package/dist/test-utils/assertStyles.js +0 -11
- package/dist/useButton-DNk3wrQp.js +0 -105
- package/dist/useCompoundItem-D1iRfg8D.js +0 -84
- package/dist/useEventCallback-xTG9piMa.js +0 -45
- package/dist/useIsFocusVisible-BH4IAdcw.js +0 -69
- package/dist/useList-B0hog_3-.js +0 -436
- package/dist/useTimeout-DxF9kiZL.js +0 -36
- package/dist/utils/styleStrings.d.ts +0 -6
- package/dist/utils/styleStrings.js +0 -10
- package/dist/utils/styleStrings.test.d.ts +0 -1
|
@@ -1,133 +1,557 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { T as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { l as ee, m as te, u as oe } from "../../useList-B0hog_3-.js";
|
|
12
|
-
const k = "Tabs";
|
|
13
|
-
function se(s) {
|
|
14
|
-
return I(k, s);
|
|
1
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { forwardRef as xe, useState as Ve } from "react";
|
|
4
|
+
import { a as Q, C as Z, T as Te, u as Ie, s as Se } from "../../Tabs.module-BKlNuSPH.js";
|
|
5
|
+
import { a as b, _ as ee } from "../../objectWithoutPropertiesLoose-ClNcje2_.js";
|
|
6
|
+
import { f as Re, h as we, g as te, a as ne, u as oe, P as v, c as le, b as se } from "../../index-BvA1HyDs.js";
|
|
7
|
+
import { u as Pe } from "../../useControlled-CCMYYdCM.js";
|
|
8
|
+
import { a as S, L as ye } from "../../ListContext-Dj2Va7Iv.js";
|
|
9
|
+
function J(t, e, l = (n, o) => n === o) {
|
|
10
|
+
return t.length === e.length && t.every((n, o) => l(n, e[o]));
|
|
15
11
|
}
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
function De(t, e) {
|
|
13
|
+
return t === e;
|
|
14
|
+
}
|
|
15
|
+
const W = {}, Y = () => {
|
|
16
|
+
};
|
|
17
|
+
function q(t, e) {
|
|
18
|
+
const l = b({}, t);
|
|
19
|
+
return Object.keys(e).forEach((n) => {
|
|
20
|
+
e[n] !== void 0 && (l[n] = e[n]);
|
|
21
|
+
}), l;
|
|
22
|
+
}
|
|
23
|
+
function Ee(t) {
|
|
24
|
+
const {
|
|
25
|
+
nextState: e,
|
|
26
|
+
initialState: l,
|
|
27
|
+
stateComparers: n,
|
|
28
|
+
onStateChange: o,
|
|
29
|
+
controlledProps: a,
|
|
30
|
+
lastActionRef: s
|
|
31
|
+
} = t, u = i.useRef(l);
|
|
32
|
+
i.useEffect(() => {
|
|
33
|
+
if (s.current === null)
|
|
34
|
+
return;
|
|
35
|
+
const r = q(u.current, a);
|
|
36
|
+
Object.keys(e).forEach((d) => {
|
|
37
|
+
var m;
|
|
38
|
+
const g = (m = n[d]) != null ? m : De, h = e[d], f = r[d];
|
|
39
|
+
if (f == null && h != null || f != null && h == null || f != null && h != null && !g(h, f)) {
|
|
40
|
+
var c, C;
|
|
41
|
+
o == null || o((c = s.current.event) != null ? c : null, d, h, (C = s.current.type) != null ? C : "", e);
|
|
42
|
+
}
|
|
43
|
+
}), u.current = e, s.current = null;
|
|
44
|
+
}, [u, e, s, o, n, a]);
|
|
45
|
+
}
|
|
46
|
+
function Me(t) {
|
|
47
|
+
const e = i.useRef(null), {
|
|
48
|
+
reducer: l,
|
|
49
|
+
initialState: n,
|
|
50
|
+
controlledProps: o = W,
|
|
51
|
+
stateComparers: a = W,
|
|
52
|
+
onStateChange: s = Y,
|
|
53
|
+
actionContext: u,
|
|
54
|
+
componentName: r = ""
|
|
55
|
+
} = t, d = i.useRef(o);
|
|
56
|
+
process.env.NODE_ENV !== "production" && i.useEffect(() => {
|
|
57
|
+
Object.keys(o).forEach((c) => {
|
|
58
|
+
d.current[c] !== void 0 && o[c] === void 0 && console.error(`useControllableReducer: ${r ? `The ${r} component` : "A component"} is changing a controlled prop to be uncontrolled: ${c}`), d.current[c] === void 0 && o[c] !== void 0 && console.error(`useControllableReducer: ${r ? `The ${r} component` : "A component"} is changing an uncontrolled prop to be controlled: ${c}`);
|
|
59
|
+
});
|
|
60
|
+
}, [o, r]);
|
|
61
|
+
const m = i.useCallback((c, C) => {
|
|
62
|
+
e.current = C;
|
|
63
|
+
const V = q(c, o);
|
|
64
|
+
return l(V, C);
|
|
65
|
+
}, [o, l]), [g, h] = i.useReducer(m, n), f = i.useCallback((c) => {
|
|
66
|
+
h(b({}, c, {
|
|
67
|
+
context: u
|
|
68
|
+
}));
|
|
69
|
+
}, [u]);
|
|
70
|
+
return Ee({
|
|
71
|
+
nextState: g,
|
|
72
|
+
initialState: n,
|
|
73
|
+
stateComparers: a ?? W,
|
|
74
|
+
onStateChange: s ?? Y,
|
|
75
|
+
controlledProps: o,
|
|
76
|
+
lastActionRef: e
|
|
77
|
+
}), [q(g, o), f];
|
|
78
|
+
}
|
|
79
|
+
function Oe(t, e, l, n, o, a) {
|
|
80
|
+
if (l.length === 0 || !n && l.every((u, r) => o(u, r)))
|
|
81
|
+
return -1;
|
|
82
|
+
let s = t;
|
|
83
|
+
for (; ; ) {
|
|
84
|
+
if (!a && e === "next" && s === l.length || !a && e === "previous" && s === -1)
|
|
85
|
+
return -1;
|
|
86
|
+
if (n ? !1 : o(l[s], s))
|
|
87
|
+
s += e === "next" ? 1 : -1, a && (s = (s + l.length) % l.length);
|
|
88
|
+
else
|
|
89
|
+
return s;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function w(t, e, l) {
|
|
93
|
+
var n;
|
|
94
|
+
const {
|
|
95
|
+
items: o,
|
|
96
|
+
isItemDisabled: a,
|
|
97
|
+
disableListWrap: s,
|
|
98
|
+
disabledItemsFocusable: u,
|
|
99
|
+
itemComparer: r,
|
|
100
|
+
focusManagement: d
|
|
101
|
+
} = l, m = d === "DOM" ? 0 : -1, g = o.length - 1, h = t == null ? -1 : o.findIndex((T) => r(T, t));
|
|
102
|
+
let f, c, C = !s;
|
|
103
|
+
switch (e) {
|
|
104
|
+
case "reset":
|
|
105
|
+
if (m === -1)
|
|
106
|
+
return null;
|
|
107
|
+
f = 0, c = "next", C = !1;
|
|
108
|
+
break;
|
|
109
|
+
case "start":
|
|
110
|
+
f = 0, c = "next", C = !1;
|
|
111
|
+
break;
|
|
112
|
+
case "end":
|
|
113
|
+
f = g, c = "previous", C = !1;
|
|
114
|
+
break;
|
|
115
|
+
default: {
|
|
116
|
+
const T = h + e;
|
|
117
|
+
T < 0 ? !C && h !== -1 || Math.abs(e) > 1 ? (f = 0, c = "next") : (f = g, c = "previous") : T > g ? !C || Math.abs(e) > 1 ? (f = g, c = "previous") : (f = 0, c = "next") : (f = T, c = e >= 0 ? "next" : "previous");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const V = Oe(f, c, o, u, a, C);
|
|
121
|
+
return V === -1 && t !== null && !a(t, h) ? t : (n = o[V]) != null ? n : null;
|
|
122
|
+
}
|
|
123
|
+
function ke(t, e, l, n) {
|
|
124
|
+
return l === "none" ? [] : l === "single" ? n(e[0], t) ? e : [t] : e.some((o) => n(o, t)) ? e.filter((o) => !n(o, t)) : [...e, t];
|
|
125
|
+
}
|
|
126
|
+
function re(t, e, l) {
|
|
127
|
+
const {
|
|
128
|
+
itemComparer: n,
|
|
129
|
+
isItemDisabled: o,
|
|
130
|
+
selectionMode: a,
|
|
131
|
+
items: s
|
|
132
|
+
} = l, {
|
|
133
|
+
selectedValues: u
|
|
134
|
+
} = e, r = s.findIndex((m) => n(t, m));
|
|
135
|
+
if (o(t, r))
|
|
136
|
+
return e;
|
|
137
|
+
const d = ke(t, u, a, n);
|
|
138
|
+
return b({}, e, {
|
|
139
|
+
selectedValues: d,
|
|
140
|
+
highlightedValue: t
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function Le(t, e, l) {
|
|
144
|
+
const n = e.highlightedValue, {
|
|
145
|
+
orientation: o,
|
|
146
|
+
pageSize: a
|
|
147
|
+
} = l;
|
|
148
|
+
switch (t) {
|
|
149
|
+
case "Home":
|
|
150
|
+
return b({}, e, {
|
|
151
|
+
highlightedValue: w(n, "start", l)
|
|
152
|
+
});
|
|
153
|
+
case "End":
|
|
154
|
+
return b({}, e, {
|
|
155
|
+
highlightedValue: w(n, "end", l)
|
|
156
|
+
});
|
|
157
|
+
case "PageUp":
|
|
158
|
+
return b({}, e, {
|
|
159
|
+
highlightedValue: w(n, -a, l)
|
|
160
|
+
});
|
|
161
|
+
case "PageDown":
|
|
162
|
+
return b({}, e, {
|
|
163
|
+
highlightedValue: w(n, a, l)
|
|
164
|
+
});
|
|
165
|
+
case "ArrowUp":
|
|
166
|
+
if (o !== "vertical")
|
|
167
|
+
break;
|
|
168
|
+
return b({}, e, {
|
|
169
|
+
highlightedValue: w(n, -1, l)
|
|
170
|
+
});
|
|
171
|
+
case "ArrowDown":
|
|
172
|
+
if (o !== "vertical")
|
|
173
|
+
break;
|
|
174
|
+
return b({}, e, {
|
|
175
|
+
highlightedValue: w(n, 1, l)
|
|
176
|
+
});
|
|
177
|
+
case "ArrowLeft": {
|
|
178
|
+
if (o === "vertical")
|
|
179
|
+
break;
|
|
180
|
+
return b({}, e, {
|
|
181
|
+
highlightedValue: w(n, o === "horizontal-ltr" ? -1 : 1, l)
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
case "ArrowRight": {
|
|
185
|
+
if (o === "vertical")
|
|
186
|
+
break;
|
|
187
|
+
return b({}, e, {
|
|
188
|
+
highlightedValue: w(n, o === "horizontal-ltr" ? 1 : -1, l)
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
case "Enter":
|
|
192
|
+
case " ":
|
|
193
|
+
return e.highlightedValue === null ? e : re(e.highlightedValue, e, l);
|
|
194
|
+
}
|
|
195
|
+
return e;
|
|
196
|
+
}
|
|
197
|
+
function Ne(t, e) {
|
|
198
|
+
return e.focusManagement === "DOM" ? t : b({}, t, {
|
|
199
|
+
highlightedValue: null
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
function $e(t, e, l) {
|
|
203
|
+
var n;
|
|
204
|
+
const o = (n = l(t)) == null ? void 0 : n.trim().toLowerCase();
|
|
205
|
+
return !o || o.length === 0 ? !1 : o.indexOf(e) === 0;
|
|
206
|
+
}
|
|
207
|
+
function _e(t, e, l) {
|
|
208
|
+
const {
|
|
209
|
+
items: n,
|
|
210
|
+
isItemDisabled: o,
|
|
211
|
+
disabledItemsFocusable: a,
|
|
212
|
+
getItemAsString: s
|
|
213
|
+
} = l, u = e.length > 1;
|
|
214
|
+
let r = u ? t.highlightedValue : w(t.highlightedValue, 1, l);
|
|
215
|
+
for (let d = 0; d < n.length; d += 1) {
|
|
216
|
+
if (!r || !u && t.highlightedValue === r)
|
|
217
|
+
return t;
|
|
218
|
+
if ($e(r, e, s) && (!o(r, n.indexOf(r)) || a))
|
|
219
|
+
return b({}, t, {
|
|
220
|
+
highlightedValue: r
|
|
221
|
+
});
|
|
222
|
+
r = w(r, 1, l);
|
|
223
|
+
}
|
|
224
|
+
return t;
|
|
225
|
+
}
|
|
226
|
+
function Ae(t, e, l, n) {
|
|
227
|
+
var o;
|
|
228
|
+
const {
|
|
229
|
+
itemComparer: a,
|
|
230
|
+
focusManagement: s
|
|
231
|
+
} = n;
|
|
232
|
+
let u = null;
|
|
233
|
+
if (l.highlightedValue != null) {
|
|
234
|
+
var r;
|
|
235
|
+
u = (r = t.find((g) => a(g, l.highlightedValue))) != null ? r : null;
|
|
236
|
+
} else
|
|
237
|
+
s === "DOM" && e.length === 0 && (u = w(null, "reset", n));
|
|
238
|
+
const m = ((o = l.selectedValues) != null ? o : []).filter((g) => t.some((h) => a(h, g)));
|
|
239
|
+
return b({}, l, {
|
|
240
|
+
highlightedValue: u,
|
|
241
|
+
selectedValues: m
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
function Fe(t, e) {
|
|
245
|
+
return b({}, t, {
|
|
246
|
+
highlightedValue: w(null, "reset", e)
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
function He(t, e) {
|
|
250
|
+
return b({}, t, {
|
|
251
|
+
highlightedValue: w(null, "end", e)
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
function ze(t, e) {
|
|
255
|
+
return b({}, t, {
|
|
256
|
+
selectedValues: [],
|
|
257
|
+
highlightedValue: w(null, "reset", e)
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
function ae(t, e) {
|
|
261
|
+
const {
|
|
262
|
+
type: l,
|
|
263
|
+
context: n
|
|
264
|
+
} = e;
|
|
265
|
+
switch (l) {
|
|
266
|
+
case S.keyDown:
|
|
267
|
+
return Le(e.key, t, n);
|
|
268
|
+
case S.itemClick:
|
|
269
|
+
return re(e.item, t, n);
|
|
270
|
+
case S.blur:
|
|
271
|
+
return Ne(t, n);
|
|
272
|
+
case S.textNavigation:
|
|
273
|
+
return _e(t, e.searchString, n);
|
|
274
|
+
case S.itemsChange:
|
|
275
|
+
return Ae(e.items, e.previousItems, t, n);
|
|
276
|
+
case S.resetHighlight:
|
|
277
|
+
return Fe(t, n);
|
|
278
|
+
case S.highlightLast:
|
|
279
|
+
return He(t, n);
|
|
280
|
+
case S.clearSelection:
|
|
281
|
+
return ze(t, n);
|
|
282
|
+
default:
|
|
283
|
+
return t;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const Ue = 500;
|
|
287
|
+
function je(t) {
|
|
288
|
+
const e = i.useRef({
|
|
289
|
+
searchString: "",
|
|
290
|
+
lastTime: null
|
|
291
|
+
});
|
|
292
|
+
return i.useCallback((l) => {
|
|
293
|
+
if (l.key.length === 1 && l.key !== " ") {
|
|
294
|
+
const n = e.current, o = l.key.toLowerCase(), a = performance.now();
|
|
295
|
+
n.searchString.length > 0 && n.lastTime && a - n.lastTime > Ue ? n.searchString = o : (n.searchString.length !== 1 || o !== n.searchString) && (n.searchString += o), n.lastTime = a, t(n.searchString, l);
|
|
296
|
+
}
|
|
297
|
+
}, [t]);
|
|
298
|
+
}
|
|
299
|
+
const X = {}, Be = () => {
|
|
300
|
+
}, Ke = (t, e) => t === e, We = () => !1, qe = (t) => typeof t == "string" ? t : String(t), Ge = () => ({
|
|
301
|
+
highlightedValue: null,
|
|
302
|
+
selectedValues: []
|
|
303
|
+
});
|
|
304
|
+
function Je(t) {
|
|
305
|
+
const {
|
|
306
|
+
controlledProps: e = X,
|
|
307
|
+
disabledItemsFocusable: l = !1,
|
|
308
|
+
disableListWrap: n = !1,
|
|
309
|
+
focusManagement: o = "activeDescendant",
|
|
310
|
+
getInitialState: a = Ge,
|
|
311
|
+
getItemDomElement: s,
|
|
312
|
+
getItemId: u,
|
|
313
|
+
isItemDisabled: r = We,
|
|
314
|
+
rootRef: d,
|
|
315
|
+
onStateChange: m = Be,
|
|
316
|
+
items: g,
|
|
317
|
+
itemComparer: h = Ke,
|
|
318
|
+
getItemAsString: f = qe,
|
|
319
|
+
onChange: c,
|
|
320
|
+
onHighlightChange: C,
|
|
321
|
+
onItemsChange: V,
|
|
322
|
+
orientation: T = "vertical",
|
|
323
|
+
pageSize: $ = 5,
|
|
324
|
+
reducerActionContext: L = X,
|
|
325
|
+
selectionMode: O = "single",
|
|
326
|
+
stateReducer: _,
|
|
327
|
+
componentName: U = "useList"
|
|
328
|
+
} = t;
|
|
329
|
+
if (process.env.NODE_ENV !== "production") {
|
|
330
|
+
if (o === "DOM" && s == null)
|
|
331
|
+
throw new Error("useList: The `getItemDomElement` prop is required when using the `DOM` focus management.");
|
|
332
|
+
if (o === "activeDescendant" && u == null)
|
|
333
|
+
throw new Error("useList: The `getItemId` prop is required when using the `activeDescendant` focus management.");
|
|
334
|
+
}
|
|
335
|
+
const A = i.useRef(null), F = Re(d, A), k = i.useCallback((x, p, I) => {
|
|
336
|
+
if (C == null || C(x, p, I), o === "DOM" && p != null && (I === S.itemClick || I === S.keyDown || I === S.textNavigation)) {
|
|
337
|
+
var R;
|
|
338
|
+
s == null || (R = s(p)) == null || R.focus();
|
|
339
|
+
}
|
|
340
|
+
}, [s, C, o]), H = i.useMemo(() => ({
|
|
341
|
+
highlightedValue: h,
|
|
342
|
+
selectedValues: (x, p) => J(x, p, h)
|
|
343
|
+
}), [h]), P = i.useCallback((x, p, I, R, z) => {
|
|
344
|
+
switch (m == null || m(x, p, I, R, z), p) {
|
|
345
|
+
case "highlightedValue":
|
|
346
|
+
k(x, I, R);
|
|
347
|
+
break;
|
|
348
|
+
case "selectedValues":
|
|
349
|
+
c == null || c(x, I, R);
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
}, [k, c, m]), y = i.useMemo(() => ({
|
|
353
|
+
disabledItemsFocusable: l,
|
|
354
|
+
disableListWrap: n,
|
|
355
|
+
focusManagement: o,
|
|
356
|
+
isItemDisabled: r,
|
|
357
|
+
itemComparer: h,
|
|
358
|
+
items: g,
|
|
359
|
+
getItemAsString: f,
|
|
360
|
+
onHighlightChange: k,
|
|
361
|
+
orientation: T,
|
|
362
|
+
pageSize: $,
|
|
363
|
+
selectionMode: O,
|
|
364
|
+
stateComparers: H
|
|
365
|
+
}), [l, n, o, r, h, g, f, k, T, $, O, H]), D = a(), ge = _ ?? ae, fe = i.useMemo(() => b({}, L, y), [L, y]), [j, M] = Me({
|
|
366
|
+
reducer: ge,
|
|
367
|
+
actionContext: fe,
|
|
368
|
+
initialState: D,
|
|
369
|
+
controlledProps: e,
|
|
370
|
+
stateComparers: H,
|
|
371
|
+
onStateChange: P,
|
|
372
|
+
componentName: U
|
|
373
|
+
}), {
|
|
374
|
+
highlightedValue: N,
|
|
375
|
+
selectedValues: B
|
|
376
|
+
} = j, me = je((x, p) => M({
|
|
377
|
+
type: S.textNavigation,
|
|
378
|
+
event: p,
|
|
379
|
+
searchString: x
|
|
380
|
+
})), K = i.useRef([]);
|
|
381
|
+
i.useEffect(() => {
|
|
382
|
+
J(K.current, g, h) || (M({
|
|
383
|
+
type: S.itemsChange,
|
|
384
|
+
event: null,
|
|
385
|
+
items: g,
|
|
386
|
+
previousItems: K.current
|
|
387
|
+
}), K.current = g, V == null || V(g));
|
|
388
|
+
}, [g, h, M, V]);
|
|
389
|
+
const pe = (x) => (p) => {
|
|
390
|
+
var I;
|
|
391
|
+
if ((I = x.onKeyDown) == null || I.call(x, p), p.defaultMuiPrevented)
|
|
392
|
+
return;
|
|
393
|
+
const R = ["Home", "End", "PageUp", "PageDown"];
|
|
394
|
+
T === "vertical" ? R.push("ArrowUp", "ArrowDown") : R.push("ArrowLeft", "ArrowRight"), o === "activeDescendant" && R.push(" ", "Enter"), R.includes(p.key) && p.preventDefault(), M({
|
|
395
|
+
type: S.keyDown,
|
|
396
|
+
key: p.key,
|
|
397
|
+
event: p
|
|
398
|
+
}), me(p);
|
|
399
|
+
}, be = (x) => (p) => {
|
|
400
|
+
var I, R;
|
|
401
|
+
(I = x.onBlur) == null || I.call(x, p), !p.defaultMuiPrevented && ((R = A.current) != null && R.contains(p.relatedTarget) || M({
|
|
402
|
+
type: S.blur,
|
|
403
|
+
event: p
|
|
404
|
+
}));
|
|
405
|
+
}, Ce = (x = {}) => {
|
|
406
|
+
const p = we(x);
|
|
407
|
+
return b({}, x, {
|
|
408
|
+
"aria-activedescendant": o === "activeDescendant" && N != null ? u(N) : void 0,
|
|
409
|
+
tabIndex: o === "DOM" ? -1 : 0,
|
|
410
|
+
ref: F
|
|
411
|
+
}, p, {
|
|
412
|
+
onBlur: be(p),
|
|
413
|
+
onKeyDown: pe(p)
|
|
414
|
+
});
|
|
415
|
+
}, G = i.useCallback((x) => {
|
|
416
|
+
const p = (B ?? []).some((z) => z != null && h(x, z)), I = N != null && h(x, N);
|
|
417
|
+
return {
|
|
418
|
+
focusable: o === "DOM",
|
|
419
|
+
highlighted: I,
|
|
420
|
+
selected: p
|
|
421
|
+
};
|
|
422
|
+
}, [h, B, N, o]), ve = i.useMemo(() => ({
|
|
423
|
+
dispatch: M,
|
|
424
|
+
getItemState: G
|
|
425
|
+
}), [M, G]);
|
|
426
|
+
return i.useDebugValue({
|
|
427
|
+
state: j
|
|
428
|
+
}), {
|
|
429
|
+
contextValue: ve,
|
|
430
|
+
dispatch: M,
|
|
431
|
+
getRootProps: Ce,
|
|
432
|
+
rootRef: F,
|
|
433
|
+
state: j
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
const ie = "Tabs";
|
|
437
|
+
function Ye(t) {
|
|
438
|
+
return te(ie, t);
|
|
439
|
+
}
|
|
440
|
+
ne(ie, ["root", "horizontal", "vertical"]);
|
|
441
|
+
function Xe(t) {
|
|
18
442
|
const {
|
|
19
443
|
value: e,
|
|
20
|
-
defaultValue:
|
|
444
|
+
defaultValue: l,
|
|
21
445
|
onChange: n,
|
|
22
|
-
orientation:
|
|
23
|
-
direction:
|
|
24
|
-
selectionFollowsFocus:
|
|
25
|
-
} =
|
|
446
|
+
orientation: o = "horizontal",
|
|
447
|
+
direction: a = "ltr",
|
|
448
|
+
selectionFollowsFocus: s = !1
|
|
449
|
+
} = t, [u, r] = Pe({
|
|
26
450
|
controlled: e,
|
|
27
|
-
default:
|
|
451
|
+
default: l,
|
|
28
452
|
name: "Tabs",
|
|
29
453
|
state: "value"
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
}, [n,
|
|
454
|
+
}), d = i.useCallback((V, T) => {
|
|
455
|
+
r(T), n == null || n(V, T);
|
|
456
|
+
}, [n, r]), {
|
|
33
457
|
subitems: m,
|
|
34
458
|
contextValue: g
|
|
35
|
-
} =
|
|
36
|
-
}),
|
|
37
|
-
var
|
|
38
|
-
return (
|
|
39
|
-
}, [m]),
|
|
40
|
-
|
|
459
|
+
} = Q(), h = i.useRef(() => {
|
|
460
|
+
}), f = i.useCallback((V) => {
|
|
461
|
+
var T;
|
|
462
|
+
return (T = m.get(V)) == null ? void 0 : T.id;
|
|
463
|
+
}, [m]), c = i.useCallback((V) => h.current(V), []), C = i.useCallback((V) => {
|
|
464
|
+
h.current = V;
|
|
41
465
|
}, []);
|
|
42
466
|
return {
|
|
43
|
-
contextValue:
|
|
44
|
-
direction:
|
|
45
|
-
getTabId:
|
|
46
|
-
getTabPanelId:
|
|
47
|
-
onSelected:
|
|
48
|
-
orientation:
|
|
49
|
-
registerTabIdLookup:
|
|
50
|
-
selectionFollowsFocus:
|
|
51
|
-
value:
|
|
467
|
+
contextValue: b({
|
|
468
|
+
direction: a,
|
|
469
|
+
getTabId: c,
|
|
470
|
+
getTabPanelId: f,
|
|
471
|
+
onSelected: d,
|
|
472
|
+
orientation: o,
|
|
473
|
+
registerTabIdLookup: C,
|
|
474
|
+
selectionFollowsFocus: s,
|
|
475
|
+
value: u
|
|
52
476
|
}, g)
|
|
53
477
|
};
|
|
54
478
|
}
|
|
55
|
-
function
|
|
479
|
+
function Qe(t) {
|
|
56
480
|
const {
|
|
57
481
|
value: e,
|
|
58
|
-
children:
|
|
59
|
-
} =
|
|
482
|
+
children: l
|
|
483
|
+
} = t, {
|
|
60
484
|
direction: n,
|
|
61
|
-
getItemIndex:
|
|
62
|
-
onSelected:
|
|
63
|
-
orientation:
|
|
64
|
-
registerItem:
|
|
65
|
-
registerTabIdLookup:
|
|
66
|
-
selectionFollowsFocus:
|
|
485
|
+
getItemIndex: o,
|
|
486
|
+
onSelected: a,
|
|
487
|
+
orientation: s,
|
|
488
|
+
registerItem: u,
|
|
489
|
+
registerTabIdLookup: r,
|
|
490
|
+
selectionFollowsFocus: d,
|
|
67
491
|
totalSubitemCount: m,
|
|
68
492
|
value: g,
|
|
69
|
-
getTabId:
|
|
70
|
-
getTabPanelId:
|
|
71
|
-
} = e,
|
|
72
|
-
getItemIndex:
|
|
73
|
-
registerItem:
|
|
493
|
+
getTabId: h,
|
|
494
|
+
getTabPanelId: f
|
|
495
|
+
} = e, c = i.useMemo(() => ({
|
|
496
|
+
getItemIndex: o,
|
|
497
|
+
registerItem: u,
|
|
74
498
|
totalSubitemCount: m
|
|
75
|
-
}), [
|
|
499
|
+
}), [u, o, m]), C = i.useMemo(() => ({
|
|
76
500
|
direction: n,
|
|
77
|
-
getTabId:
|
|
78
|
-
getTabPanelId:
|
|
79
|
-
onSelected:
|
|
80
|
-
orientation:
|
|
81
|
-
registerTabIdLookup:
|
|
82
|
-
selectionFollowsFocus:
|
|
501
|
+
getTabId: h,
|
|
502
|
+
getTabPanelId: f,
|
|
503
|
+
onSelected: a,
|
|
504
|
+
orientation: s,
|
|
505
|
+
registerTabIdLookup: r,
|
|
506
|
+
selectionFollowsFocus: d,
|
|
83
507
|
value: g
|
|
84
|
-
}), [n,
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
value:
|
|
87
|
-
children: /* @__PURE__ */
|
|
88
|
-
value:
|
|
89
|
-
children:
|
|
508
|
+
}), [n, h, f, a, s, r, d, g]);
|
|
509
|
+
return /* @__PURE__ */ E(Z.Provider, {
|
|
510
|
+
value: c,
|
|
511
|
+
children: /* @__PURE__ */ E(Te.Provider, {
|
|
512
|
+
value: C,
|
|
513
|
+
children: l
|
|
90
514
|
})
|
|
91
515
|
});
|
|
92
516
|
}
|
|
93
|
-
const
|
|
517
|
+
const Ze = ["children", "value", "defaultValue", "orientation", "direction", "onChange", "selectionFollowsFocus", "slotProps", "slots"], et = (t) => {
|
|
94
518
|
const {
|
|
95
519
|
orientation: e
|
|
96
|
-
} =
|
|
97
|
-
return
|
|
520
|
+
} = t;
|
|
521
|
+
return le({
|
|
98
522
|
root: ["root", e]
|
|
99
|
-
},
|
|
100
|
-
},
|
|
523
|
+
}, se(Ye));
|
|
524
|
+
}, ue = /* @__PURE__ */ i.forwardRef(function(e, l) {
|
|
101
525
|
var n;
|
|
102
526
|
const {
|
|
103
|
-
children:
|
|
104
|
-
orientation:
|
|
105
|
-
direction:
|
|
106
|
-
slotProps:
|
|
107
|
-
slots:
|
|
108
|
-
} = e,
|
|
109
|
-
orientation:
|
|
110
|
-
direction:
|
|
527
|
+
children: o,
|
|
528
|
+
orientation: a = "horizontal",
|
|
529
|
+
direction: s = "ltr",
|
|
530
|
+
slotProps: u = {},
|
|
531
|
+
slots: r = {}
|
|
532
|
+
} = e, d = ee(e, Ze), m = b({}, e, {
|
|
533
|
+
orientation: a,
|
|
534
|
+
direction: s
|
|
111
535
|
}), {
|
|
112
536
|
contextValue: g
|
|
113
|
-
} =
|
|
114
|
-
elementType:
|
|
115
|
-
externalSlotProps:
|
|
116
|
-
externalForwardedProps:
|
|
537
|
+
} = Xe(m), h = et(m), f = (n = r.root) != null ? n : "div", c = oe({
|
|
538
|
+
elementType: f,
|
|
539
|
+
externalSlotProps: u.root,
|
|
540
|
+
externalForwardedProps: d,
|
|
117
541
|
additionalProps: {
|
|
118
|
-
ref:
|
|
542
|
+
ref: l
|
|
119
543
|
},
|
|
120
544
|
ownerState: m,
|
|
121
|
-
className:
|
|
545
|
+
className: h.root
|
|
122
546
|
});
|
|
123
|
-
return /* @__PURE__ */
|
|
124
|
-
children: /* @__PURE__ */
|
|
547
|
+
return /* @__PURE__ */ E(f, b({}, c, {
|
|
548
|
+
children: /* @__PURE__ */ E(Qe, {
|
|
125
549
|
value: g,
|
|
126
|
-
children:
|
|
550
|
+
children: o
|
|
127
551
|
})
|
|
128
552
|
}));
|
|
129
553
|
});
|
|
130
|
-
process.env.NODE_ENV !== "production" && (
|
|
554
|
+
process.env.NODE_ENV !== "production" && (ue.propTypes = {
|
|
131
555
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
132
556
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
133
557
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
@@ -135,231 +559,231 @@ process.env.NODE_ENV !== "production" && (w.propTypes = {
|
|
|
135
559
|
/**
|
|
136
560
|
* The content of the component.
|
|
137
561
|
*/
|
|
138
|
-
children:
|
|
562
|
+
children: v.node,
|
|
139
563
|
/**
|
|
140
564
|
* @ignore
|
|
141
565
|
*/
|
|
142
|
-
className:
|
|
566
|
+
className: v.string,
|
|
143
567
|
/**
|
|
144
568
|
* The default value. Use when the component is not controlled.
|
|
145
569
|
*/
|
|
146
|
-
defaultValue:
|
|
570
|
+
defaultValue: v.oneOfType([v.number, v.string]),
|
|
147
571
|
/**
|
|
148
572
|
* The direction of the text.
|
|
149
573
|
* @default 'ltr'
|
|
150
574
|
*/
|
|
151
|
-
direction:
|
|
575
|
+
direction: v.oneOf(["ltr", "rtl"]),
|
|
152
576
|
/**
|
|
153
577
|
* Callback invoked when new value is being set.
|
|
154
578
|
*/
|
|
155
|
-
onChange:
|
|
579
|
+
onChange: v.func,
|
|
156
580
|
/**
|
|
157
581
|
* The component orientation (layout flow direction).
|
|
158
582
|
* @default 'horizontal'
|
|
159
583
|
*/
|
|
160
|
-
orientation:
|
|
584
|
+
orientation: v.oneOf(["horizontal", "vertical"]),
|
|
161
585
|
/**
|
|
162
586
|
* If `true` the selected tab changes on focus. Otherwise it only
|
|
163
587
|
* changes on activation.
|
|
164
588
|
*/
|
|
165
|
-
selectionFollowsFocus:
|
|
589
|
+
selectionFollowsFocus: v.bool,
|
|
166
590
|
/**
|
|
167
591
|
* The props used for each slot inside the Tabs.
|
|
168
592
|
* @default {}
|
|
169
593
|
*/
|
|
170
|
-
slotProps:
|
|
171
|
-
root:
|
|
594
|
+
slotProps: v.shape({
|
|
595
|
+
root: v.oneOfType([v.func, v.object])
|
|
172
596
|
}),
|
|
173
597
|
/**
|
|
174
598
|
* The components used for each slot inside the Tabs.
|
|
175
599
|
* Either a string to use a HTML element or a component.
|
|
176
600
|
* @default {}
|
|
177
601
|
*/
|
|
178
|
-
slots:
|
|
179
|
-
root:
|
|
602
|
+
slots: v.shape({
|
|
603
|
+
root: v.elementType
|
|
180
604
|
}),
|
|
181
605
|
/**
|
|
182
606
|
* The value of the currently selected `Tab`.
|
|
183
607
|
* If you don't want any selected `Tab`, you can set this prop to `null`.
|
|
184
608
|
*/
|
|
185
|
-
value:
|
|
609
|
+
value: v.oneOfType([v.number, v.string])
|
|
186
610
|
});
|
|
187
|
-
const
|
|
188
|
-
function
|
|
189
|
-
return
|
|
611
|
+
const ce = "TabsList";
|
|
612
|
+
function tt(t) {
|
|
613
|
+
return te(ce, t);
|
|
190
614
|
}
|
|
191
|
-
|
|
192
|
-
const
|
|
615
|
+
ne(ce, ["root", "horizontal", "vertical"]);
|
|
616
|
+
const de = {
|
|
193
617
|
valueChange: "valueChange"
|
|
194
618
|
};
|
|
195
|
-
function
|
|
196
|
-
if (e.type ===
|
|
197
|
-
return
|
|
619
|
+
function nt(t, e) {
|
|
620
|
+
if (e.type === de.valueChange)
|
|
621
|
+
return b({}, t, {
|
|
198
622
|
highlightedValue: e.value
|
|
199
623
|
});
|
|
200
|
-
const
|
|
624
|
+
const l = ae(t, e), {
|
|
201
625
|
context: {
|
|
202
626
|
selectionFollowsFocus: n
|
|
203
627
|
}
|
|
204
628
|
} = e;
|
|
205
|
-
if (e.type ===
|
|
206
|
-
if (
|
|
207
|
-
return
|
|
208
|
-
highlightedValue:
|
|
629
|
+
if (e.type === S.itemsChange) {
|
|
630
|
+
if (l.selectedValues.length > 0)
|
|
631
|
+
return b({}, l, {
|
|
632
|
+
highlightedValue: l.selectedValues[0]
|
|
209
633
|
});
|
|
210
|
-
|
|
634
|
+
w(null, "reset", e.context);
|
|
211
635
|
}
|
|
212
|
-
return n &&
|
|
213
|
-
selectedValues: [
|
|
214
|
-
}) :
|
|
636
|
+
return n && l.highlightedValue != null ? b({}, l, {
|
|
637
|
+
selectedValues: [l.highlightedValue]
|
|
638
|
+
}) : l;
|
|
215
639
|
}
|
|
216
|
-
function
|
|
640
|
+
function ot(t) {
|
|
217
641
|
var e;
|
|
218
642
|
const {
|
|
219
|
-
rootRef:
|
|
220
|
-
} =
|
|
643
|
+
rootRef: l
|
|
644
|
+
} = t, {
|
|
221
645
|
direction: n = "ltr",
|
|
222
|
-
onSelected:
|
|
223
|
-
orientation:
|
|
224
|
-
value:
|
|
225
|
-
registerTabIdLookup:
|
|
226
|
-
selectionFollowsFocus:
|
|
227
|
-
} =
|
|
228
|
-
subitems:
|
|
646
|
+
onSelected: o,
|
|
647
|
+
orientation: a = "horizontal",
|
|
648
|
+
value: s,
|
|
649
|
+
registerTabIdLookup: u,
|
|
650
|
+
selectionFollowsFocus: r
|
|
651
|
+
} = Ie(), {
|
|
652
|
+
subitems: d,
|
|
229
653
|
contextValue: m
|
|
230
|
-
} =
|
|
231
|
-
var
|
|
232
|
-
return (
|
|
233
|
-
}, [
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
var
|
|
237
|
-
return
|
|
238
|
-
}, [
|
|
239
|
-
let
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
var
|
|
243
|
-
|
|
244
|
-
}, [
|
|
245
|
-
selectedValues: [
|
|
654
|
+
} = Q(), g = i.useCallback((P) => {
|
|
655
|
+
var y;
|
|
656
|
+
return (y = d.get(P)) == null ? void 0 : y.id;
|
|
657
|
+
}, [d]);
|
|
658
|
+
u(g);
|
|
659
|
+
const h = i.useMemo(() => Array.from(d.keys()), [d]), f = i.useCallback((P) => {
|
|
660
|
+
var y, D;
|
|
661
|
+
return P == null ? null : (y = (D = d.get(P)) == null ? void 0 : D.ref.current) != null ? y : null;
|
|
662
|
+
}, [d]), c = n === "rtl";
|
|
663
|
+
let C;
|
|
664
|
+
a === "vertical" ? C = "vertical" : C = c ? "horizontal-rtl" : "horizontal-ltr";
|
|
665
|
+
const V = i.useCallback((P, y) => {
|
|
666
|
+
var D;
|
|
667
|
+
o(P, (D = y[0]) != null ? D : null);
|
|
668
|
+
}, [o]), T = i.useMemo(() => s === void 0 ? {} : s != null ? {
|
|
669
|
+
selectedValues: [s]
|
|
246
670
|
} : {
|
|
247
671
|
selectedValues: []
|
|
248
|
-
}, [
|
|
249
|
-
var
|
|
250
|
-
return (
|
|
251
|
-
}, [
|
|
672
|
+
}, [s]), $ = i.useCallback((P) => {
|
|
673
|
+
var y, D;
|
|
674
|
+
return (y = (D = d.get(P)) == null ? void 0 : D.disabled) != null ? y : !1;
|
|
675
|
+
}, [d]), {
|
|
252
676
|
contextValue: L,
|
|
253
|
-
dispatch:
|
|
254
|
-
getRootProps:
|
|
677
|
+
dispatch: O,
|
|
678
|
+
getRootProps: _,
|
|
255
679
|
state: {
|
|
256
|
-
highlightedValue:
|
|
257
|
-
selectedValues:
|
|
680
|
+
highlightedValue: U,
|
|
681
|
+
selectedValues: A
|
|
258
682
|
},
|
|
259
|
-
rootRef:
|
|
260
|
-
} =
|
|
261
|
-
controlledProps:
|
|
262
|
-
disabledItemsFocusable: !
|
|
683
|
+
rootRef: F
|
|
684
|
+
} = Je({
|
|
685
|
+
controlledProps: T,
|
|
686
|
+
disabledItemsFocusable: !r,
|
|
263
687
|
focusManagement: "DOM",
|
|
264
|
-
getItemDomElement:
|
|
265
|
-
isItemDisabled:
|
|
266
|
-
items:
|
|
267
|
-
rootRef:
|
|
268
|
-
onChange:
|
|
269
|
-
orientation:
|
|
270
|
-
reducerActionContext:
|
|
271
|
-
selectionFollowsFocus:
|
|
272
|
-
}), [
|
|
688
|
+
getItemDomElement: f,
|
|
689
|
+
isItemDisabled: $,
|
|
690
|
+
items: h,
|
|
691
|
+
rootRef: l,
|
|
692
|
+
onChange: V,
|
|
693
|
+
orientation: C,
|
|
694
|
+
reducerActionContext: i.useMemo(() => ({
|
|
695
|
+
selectionFollowsFocus: r || !1
|
|
696
|
+
}), [r]),
|
|
273
697
|
selectionMode: "single",
|
|
274
|
-
stateReducer:
|
|
698
|
+
stateReducer: nt
|
|
275
699
|
});
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
type:
|
|
279
|
-
value:
|
|
700
|
+
i.useEffect(() => {
|
|
701
|
+
s !== void 0 && s != null && O({
|
|
702
|
+
type: de.valueChange,
|
|
703
|
+
value: s
|
|
280
704
|
});
|
|
281
|
-
}, [
|
|
282
|
-
const
|
|
283
|
-
"aria-orientation":
|
|
705
|
+
}, [O, s]);
|
|
706
|
+
const k = (P = {}) => b({}, P, _(P), {
|
|
707
|
+
"aria-orientation": a === "vertical" ? "vertical" : void 0,
|
|
284
708
|
role: "tablist"
|
|
285
709
|
});
|
|
286
710
|
return {
|
|
287
|
-
contextValue:
|
|
288
|
-
dispatch:
|
|
289
|
-
getRootProps:
|
|
290
|
-
highlightedValue:
|
|
291
|
-
isRtl:
|
|
292
|
-
orientation:
|
|
293
|
-
rootRef:
|
|
294
|
-
selectedValue: (e =
|
|
711
|
+
contextValue: i.useMemo(() => b({}, m, L), [m, L]),
|
|
712
|
+
dispatch: O,
|
|
713
|
+
getRootProps: k,
|
|
714
|
+
highlightedValue: U,
|
|
715
|
+
isRtl: c,
|
|
716
|
+
orientation: a,
|
|
717
|
+
rootRef: F,
|
|
718
|
+
selectedValue: (e = A[0]) != null ? e : null
|
|
295
719
|
};
|
|
296
720
|
}
|
|
297
|
-
function
|
|
721
|
+
function lt(t) {
|
|
298
722
|
const {
|
|
299
723
|
value: e,
|
|
300
|
-
children:
|
|
301
|
-
} =
|
|
724
|
+
children: l
|
|
725
|
+
} = t, {
|
|
302
726
|
dispatch: n,
|
|
303
|
-
getItemIndex:
|
|
304
|
-
getItemState:
|
|
305
|
-
registerItem:
|
|
306
|
-
totalSubitemCount:
|
|
307
|
-
} = e,
|
|
727
|
+
getItemIndex: o,
|
|
728
|
+
getItemState: a,
|
|
729
|
+
registerItem: s,
|
|
730
|
+
totalSubitemCount: u
|
|
731
|
+
} = e, r = i.useMemo(() => ({
|
|
308
732
|
dispatch: n,
|
|
309
|
-
getItemState:
|
|
310
|
-
getItemIndex:
|
|
311
|
-
}), [n,
|
|
312
|
-
getItemIndex:
|
|
313
|
-
registerItem:
|
|
314
|
-
totalSubitemCount:
|
|
315
|
-
}), [
|
|
316
|
-
return /* @__PURE__ */
|
|
317
|
-
value:
|
|
318
|
-
children: /* @__PURE__ */
|
|
319
|
-
value:
|
|
320
|
-
children:
|
|
733
|
+
getItemState: a,
|
|
734
|
+
getItemIndex: o
|
|
735
|
+
}), [n, o, a]), d = i.useMemo(() => ({
|
|
736
|
+
getItemIndex: o,
|
|
737
|
+
registerItem: s,
|
|
738
|
+
totalSubitemCount: u
|
|
739
|
+
}), [s, o, u]);
|
|
740
|
+
return /* @__PURE__ */ E(Z.Provider, {
|
|
741
|
+
value: d,
|
|
742
|
+
children: /* @__PURE__ */ E(ye.Provider, {
|
|
743
|
+
value: r,
|
|
744
|
+
children: l
|
|
321
745
|
})
|
|
322
746
|
});
|
|
323
747
|
}
|
|
324
|
-
const
|
|
748
|
+
const st = ["children", "slotProps", "slots"], rt = (t) => {
|
|
325
749
|
const {
|
|
326
750
|
orientation: e
|
|
327
|
-
} =
|
|
328
|
-
return
|
|
751
|
+
} = t;
|
|
752
|
+
return le({
|
|
329
753
|
root: ["root", e]
|
|
330
|
-
},
|
|
331
|
-
},
|
|
754
|
+
}, se(tt));
|
|
755
|
+
}, he = /* @__PURE__ */ i.forwardRef(function(e, l) {
|
|
332
756
|
var n;
|
|
333
757
|
const {
|
|
334
|
-
children:
|
|
335
|
-
slotProps:
|
|
336
|
-
slots:
|
|
337
|
-
} = e,
|
|
338
|
-
isRtl:
|
|
339
|
-
orientation:
|
|
758
|
+
children: o,
|
|
759
|
+
slotProps: a = {},
|
|
760
|
+
slots: s = {}
|
|
761
|
+
} = e, u = ee(e, st), {
|
|
762
|
+
isRtl: r,
|
|
763
|
+
orientation: d,
|
|
340
764
|
getRootProps: m,
|
|
341
765
|
contextValue: g
|
|
342
|
-
} =
|
|
343
|
-
rootRef:
|
|
344
|
-
}),
|
|
345
|
-
isRtl:
|
|
346
|
-
orientation:
|
|
347
|
-
}),
|
|
348
|
-
elementType:
|
|
766
|
+
} = ot({
|
|
767
|
+
rootRef: l
|
|
768
|
+
}), h = b({}, e, {
|
|
769
|
+
isRtl: r,
|
|
770
|
+
orientation: d
|
|
771
|
+
}), f = rt(h), c = (n = s.root) != null ? n : "div", C = oe({
|
|
772
|
+
elementType: c,
|
|
349
773
|
getSlotProps: m,
|
|
350
|
-
externalSlotProps:
|
|
351
|
-
externalForwardedProps:
|
|
352
|
-
ownerState:
|
|
353
|
-
className:
|
|
774
|
+
externalSlotProps: a.root,
|
|
775
|
+
externalForwardedProps: u,
|
|
776
|
+
ownerState: h,
|
|
777
|
+
className: f.root
|
|
354
778
|
});
|
|
355
|
-
return /* @__PURE__ */
|
|
779
|
+
return /* @__PURE__ */ E(lt, {
|
|
356
780
|
value: g,
|
|
357
|
-
children: /* @__PURE__ */
|
|
358
|
-
children:
|
|
781
|
+
children: /* @__PURE__ */ E(c, b({}, C, {
|
|
782
|
+
children: o
|
|
359
783
|
}))
|
|
360
784
|
});
|
|
361
785
|
});
|
|
362
|
-
process.env.NODE_ENV !== "production" && (
|
|
786
|
+
process.env.NODE_ENV !== "production" && (he.propTypes = {
|
|
363
787
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
364
788
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
365
789
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
@@ -367,35 +791,33 @@ process.env.NODE_ENV !== "production" && (A.propTypes = {
|
|
|
367
791
|
/**
|
|
368
792
|
* The content of the component.
|
|
369
793
|
*/
|
|
370
|
-
children:
|
|
794
|
+
children: v.node,
|
|
371
795
|
/**
|
|
372
796
|
* @ignore
|
|
373
797
|
*/
|
|
374
|
-
className:
|
|
798
|
+
className: v.string,
|
|
375
799
|
/**
|
|
376
800
|
* The props used for each slot inside the TabsList.
|
|
377
801
|
* @default {}
|
|
378
802
|
*/
|
|
379
|
-
slotProps:
|
|
380
|
-
root:
|
|
803
|
+
slotProps: v.shape({
|
|
804
|
+
root: v.oneOfType([v.func, v.object])
|
|
381
805
|
}),
|
|
382
806
|
/**
|
|
383
807
|
* The components used for each slot inside the TabsList.
|
|
384
808
|
* Either a string to use a HTML element or a component.
|
|
385
809
|
* @default {}
|
|
386
810
|
*/
|
|
387
|
-
slots:
|
|
388
|
-
root:
|
|
811
|
+
slots: v.shape({
|
|
812
|
+
root: v.elementType
|
|
389
813
|
})
|
|
390
814
|
});
|
|
391
|
-
const
|
|
392
|
-
const [
|
|
393
|
-
return /* @__PURE__ */
|
|
394
|
-
|
|
395
|
-
}, ref: n, children: /* @__PURE__ */
|
|
815
|
+
const ft = xe(({ children: t, onChange: e, dataTestId: l }, n) => {
|
|
816
|
+
const [o, a] = Ve("1");
|
|
817
|
+
return /* @__PURE__ */ E(ue, { "data-testid": l, value: o, onChange: (u, r) => {
|
|
818
|
+
a(r), e && e(r, u);
|
|
819
|
+
}, ref: n, children: /* @__PURE__ */ E(he, { className: Se.tabs, children: t }) });
|
|
396
820
|
});
|
|
397
821
|
export {
|
|
398
|
-
|
|
399
|
-
_e as TabPanel,
|
|
400
|
-
Ve as Tabs
|
|
822
|
+
ft as Tabs
|
|
401
823
|
};
|