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