@drjoshcsimmons/scl 0.1.14 → 0.2.1
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/LICENSE +1 -1
- package/dist/components/ui/accordion/accordion.d.ts +1 -1
- package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion/index.d.ts +1 -1
- package/dist/components/ui/accordion/index.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/index.d.ts +1 -1
- package/dist/components/ui/alert/index.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts +2 -2
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog/index.d.ts +1 -1
- package/dist/components/ui/alert-dialog/index.d.ts.map +1 -1
- package/dist/components/ui/avatar/avatar.d.ts +1 -1
- package/dist/components/ui/avatar/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar/index.d.ts +1 -1
- package/dist/components/ui/avatar/index.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/badge/index.d.ts +1 -1
- package/dist/components/ui/badge/index.d.ts.map +1 -1
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/button/index.d.ts +1 -1
- package/dist/components/ui/button/index.d.ts.map +1 -1
- package/dist/components/ui/card/card.d.ts.map +1 -1
- package/dist/components/ui/card/index.d.ts +1 -1
- package/dist/components/ui/card/index.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox/index.d.ts.map +1 -1
- package/dist/components/ui/collapsible/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible/index.d.ts +1 -1
- package/dist/components/ui/collapsible/index.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox/index.d.ts +1 -1
- package/dist/components/ui/combobox/index.d.ts.map +1 -1
- package/dist/components/ui/command/command.d.ts.map +1 -1
- package/dist/components/ui/command/index.d.ts +1 -1
- package/dist/components/ui/command/index.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/index.d.ts +1 -1
- package/dist/components/ui/dialog/index.d.ts.map +1 -1
- package/dist/components/ui/dithered-image/dithered-image.d.ts.map +1 -1
- package/dist/components/ui/dithered-image/index.d.ts +1 -1
- package/dist/components/ui/dithered-image/index.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/index.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -1
- package/dist/components/ui/form/form.d.ts +1 -1
- package/dist/components/ui/form/form.d.ts.map +1 -1
- package/dist/components/ui/form/index.d.ts +1 -1
- package/dist/components/ui/form/index.d.ts.map +1 -1
- package/dist/components/ui/input/index.d.ts.map +1 -1
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/label/index.d.ts.map +1 -1
- package/dist/components/ui/label/label.d.ts +1 -1
- package/dist/components/ui/label/label.d.ts.map +1 -1
- package/dist/components/ui/popover/index.d.ts +1 -1
- package/dist/components/ui/popover/index.d.ts.map +1 -1
- package/dist/components/ui/popover/popover.d.ts +1 -1
- package/dist/components/ui/popover/popover.d.ts.map +1 -1
- package/dist/components/ui/progress/index.d.ts.map +1 -1
- package/dist/components/ui/progress/progress.d.ts +1 -1
- package/dist/components/ui/progress/progress.d.ts.map +1 -1
- package/dist/components/ui/radio-group/index.d.ts.map +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/ui/scroll-area/index.d.ts.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.d.ts +1 -1
- package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/select/index.d.ts +1 -1
- package/dist/components/ui/select/index.d.ts.map +1 -1
- package/dist/components/ui/select/select.d.ts +1 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/separator/index.d.ts.map +1 -1
- package/dist/components/ui/separator/separator.d.ts +1 -1
- package/dist/components/ui/separator/separator.d.ts.map +1 -1
- package/dist/components/ui/sheet/index.d.ts +1 -1
- package/dist/components/ui/sheet/index.d.ts.map +1 -1
- package/dist/components/ui/sheet/sheet.d.ts +2 -2
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
- package/dist/components/ui/skeleton/index.d.ts.map +1 -1
- package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/ui/slider/index.d.ts.map +1 -1
- package/dist/components/ui/slider/slider.d.ts +1 -1
- package/dist/components/ui/slider/slider.d.ts.map +1 -1
- package/dist/components/ui/statusline/index.d.ts.map +1 -1
- package/dist/components/ui/statusline/statusline.d.ts.map +1 -1
- package/dist/components/ui/switch/index.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.d.ts +1 -1
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/table/index.d.ts +1 -1
- package/dist/components/ui/table/index.d.ts.map +1 -1
- package/dist/components/ui/table/table.d.ts +1 -1
- package/dist/components/ui/table/table.d.ts.map +1 -1
- package/dist/components/ui/tabs/index.d.ts +1 -1
- package/dist/components/ui/tabs/index.d.ts.map +1 -1
- package/dist/components/ui/tabs/tabs.d.ts +1 -1
- package/dist/components/ui/tabs/tabs.d.ts.map +1 -1
- package/dist/components/ui/terminal-textarea/index.d.ts.map +1 -1
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea/index.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/components/ui/toggle/index.d.ts.map +1 -1
- package/dist/components/ui/toggle/toggle.d.ts +1 -1
- package/dist/components/ui/toggle/toggle.d.ts.map +1 -1
- package/dist/components/ui/tooltip/index.d.ts +1 -1
- package/dist/components/ui/tooltip/index.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index10.js +42 -44
- package/dist/index100.js +4 -13
- package/dist/index101.js +30 -9
- package/dist/index102.js +13 -30
- package/dist/index103.js +649 -3
- package/dist/index104.js +30 -25
- package/dist/index105.js +3 -5
- package/dist/index106.js +44 -51
- package/dist/index107.js +30 -30
- package/dist/index108.js +55 -30
- package/dist/index109.js +29 -47
- package/dist/index11.js +5 -11
- package/dist/index110.js +44 -646
- package/dist/index113.js +47 -11
- package/dist/index114.js +42 -200
- package/dist/index115.js +12 -22
- package/dist/index116.js +194 -388
- package/dist/index117.js +21 -47
- package/dist/index118.js +392 -40
- package/dist/index119.js +6 -21
- package/dist/index12.js +2 -2
- package/dist/index120.js +48 -9
- package/dist/index121.js +15 -32
- package/dist/index122.js +3 -12
- package/dist/index123.js +38 -6
- package/dist/index124.js +18 -48
- package/dist/index126.js +3 -3
- package/dist/index127.js +3 -3
- package/dist/index129.js +1 -1
- package/dist/index13.js +2 -2
- package/dist/index130.js +1 -1
- package/dist/index131.js +2 -5
- package/dist/index132.js +2 -3
- package/dist/index133.js +5 -24
- package/dist/index134.js +3 -113
- package/dist/index135.js +23 -15
- package/dist/index136.js +107 -519
- package/dist/index137.js +14 -126
- package/dist/index138.js +516 -125
- package/dist/index139.js +128 -2
- package/dist/index14.js +4 -13
- package/dist/index140.js +134 -2
- package/dist/index141.js +65 -69
- package/dist/index142.js +68 -8
- package/dist/index143.js +9 -14
- package/dist/index144.js +14 -66
- package/dist/index145.js +65 -64
- package/dist/index15.js +43 -67
- package/dist/index16.js +3 -30
- package/dist/index17.js +75 -80
- package/dist/index18.js +11 -13
- package/dist/index19.js +4 -4
- package/dist/index20.js +5 -12
- package/dist/index21.js +15 -15
- package/dist/index22.js +21 -24
- package/dist/index23.js +7 -14
- package/dist/index24.js +11 -11
- package/dist/index25.js +66 -72
- package/dist/index26.js +15 -17
- package/dist/index27.js +57 -51
- package/dist/index28.js +2 -10
- package/dist/index29.js +9 -12
- package/dist/index3.js +18 -18
- package/dist/index30.js +27 -60
- package/dist/index31.js +15 -15
- package/dist/index32.js +24 -47
- package/dist/index33.js +16 -16
- package/dist/index34.js +1 -4
- package/dist/index36.js +11 -11
- package/dist/index37.js +21 -18
- package/dist/index38.js +99 -38
- package/dist/index39.js +37 -64
- package/dist/index4.js +24 -31
- package/dist/index40.js +10 -48
- package/dist/index41.js +48 -99
- package/dist/index42.js +65 -10
- package/dist/index45.js +237 -33
- package/dist/index46.js +11 -241
- package/dist/index47.js +33 -237
- package/dist/index48.js +241 -11
- package/dist/index49.js +16 -258
- package/dist/index5.js +13 -26
- package/dist/index50.js +125 -12
- package/dist/index51.js +25 -524
- package/dist/index52.js +71 -20
- package/dist/index53.js +206 -131
- package/dist/index54.js +11 -73
- package/dist/index55.js +54 -330
- package/dist/index56.js +249 -231
- package/dist/index57.js +225 -11
- package/dist/index58.js +9 -82
- package/dist/index59.js +11 -249
- package/dist/index6.js +66 -36
- package/dist/index60.js +130 -9
- package/dist/index61.js +21 -129
- package/dist/index62.js +860 -18
- package/dist/index63.js +9 -860
- package/dist/index64.js +82 -9
- package/dist/index65.js +256 -27
- package/dist/index66.js +12 -435
- package/dist/index67.js +244 -55
- package/dist/index68.js +7 -7
- package/dist/index69.js +511 -206
- package/dist/index7.js +5 -5
- package/dist/index70.js +5 -4
- package/dist/index71.js +435 -12
- package/dist/index72.js +318 -107
- package/dist/index73.js +3 -3
- package/dist/index74.js +1 -1
- package/dist/index75.js +156 -249
- package/dist/index76.js +66 -5
- package/dist/index77.js +44 -25
- package/dist/index78.js +23 -64
- package/dist/index79.js +5 -123
- package/dist/index8.js +5 -5
- package/dist/index80.js +50 -13
- package/dist/index81.js +32 -133
- package/dist/index82.js +1 -1
- package/dist/index83.js +7 -218
- package/dist/index84.js +124 -13
- package/dist/index85.js +13 -67
- package/dist/index86.js +133 -32
- package/dist/index87.js +216 -45
- package/dist/index88.js +14 -52
- package/dist/index89.js +66 -47
- package/dist/index9.js +19 -26
- package/dist/index90.js +48 -9
- package/dist/index91.js +49 -45
- package/dist/index92.js +9 -8
- package/dist/index93.js +29 -47
- package/dist/index94.js +9 -30
- package/dist/index95.js +8 -8
- package/dist/index96.js +24 -54
- package/dist/index97.js +5 -10
- package/dist/index98.js +55 -4
- package/dist/index99.js +11 -30
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/tokens/animations.d.ts.map +1 -1
- package/dist/tokens/colors.d.ts.map +1 -1
- package/dist/tokens/index.d.ts +3 -3
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/shadows.d.ts.map +1 -1
- package/dist/tokens/spacing.d.ts.map +1 -1
- package/dist/tokens/typography.d.ts.map +1 -1
- package/package.json +19 -9
package/dist/index75.js
CHANGED
|
@@ -1,256 +1,163 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import * as v from "react";
|
|
2
|
+
import { composeEventHandlers as g } from "./index79.js";
|
|
3
|
+
import { createContextScope as x } from "./index76.js";
|
|
4
|
+
import { createRovingFocusGroupScope as C, Root as E, Item as F } from "./index95.js";
|
|
5
|
+
import { Presence as w } from "./index89.js";
|
|
6
|
+
import { Primitive as b } from "./index81.js";
|
|
7
|
+
import { useDirection as D } from "./index83.js";
|
|
8
|
+
import { useControllableState as V } from "./index80.js";
|
|
9
|
+
import { useId as G } from "./index82.js";
|
|
10
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
11
|
+
var p = "Tabs", [L] = x(p, [
|
|
12
|
+
C
|
|
13
|
+
]), h = C(), [$, T] = L(p), I = v.forwardRef(
|
|
14
|
+
(e, r) => {
|
|
15
|
+
const {
|
|
16
|
+
__scopeTabs: s,
|
|
17
|
+
value: t,
|
|
18
|
+
onValueChange: n,
|
|
19
|
+
defaultValue: c,
|
|
20
|
+
orientation: o = "horizontal",
|
|
21
|
+
dir: d,
|
|
22
|
+
activationMode: f = "automatic",
|
|
23
|
+
...m
|
|
24
|
+
} = e, i = D(d), [a, u] = V({
|
|
25
|
+
prop: t,
|
|
26
|
+
onChange: n,
|
|
27
|
+
defaultProp: c ?? "",
|
|
28
|
+
caller: p
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ l(
|
|
31
|
+
$,
|
|
32
|
+
{
|
|
33
|
+
scope: s,
|
|
34
|
+
baseId: G(),
|
|
35
|
+
value: a,
|
|
36
|
+
onValueChange: u,
|
|
37
|
+
orientation: o,
|
|
38
|
+
dir: i,
|
|
39
|
+
activationMode: f,
|
|
40
|
+
children: /* @__PURE__ */ l(
|
|
41
|
+
b.div,
|
|
42
|
+
{
|
|
43
|
+
dir: i,
|
|
44
|
+
"data-orientation": o,
|
|
45
|
+
...m,
|
|
46
|
+
ref: r
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
);
|
|
40
51
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
);
|
|
53
|
+
I.displayName = p;
|
|
54
|
+
var R = "TabsList", _ = v.forwardRef(
|
|
55
|
+
(e, r) => {
|
|
56
|
+
const { __scopeTabs: s, loop: t = !0, ...n } = e, c = T(R, s), o = h(s);
|
|
57
|
+
return /* @__PURE__ */ l(
|
|
58
|
+
E,
|
|
59
|
+
{
|
|
60
|
+
asChild: !0,
|
|
61
|
+
...o,
|
|
62
|
+
orientation: c.orientation,
|
|
63
|
+
dir: c.dir,
|
|
64
|
+
loop: t,
|
|
65
|
+
children: /* @__PURE__ */ l(
|
|
66
|
+
b.div,
|
|
67
|
+
{
|
|
68
|
+
role: "tablist",
|
|
69
|
+
"aria-orientation": c.orientation,
|
|
70
|
+
...n,
|
|
71
|
+
ref: r
|
|
72
|
+
}
|
|
73
|
+
)
|
|
62
74
|
}
|
|
63
|
-
|
|
64
|
-
return r;
|
|
65
|
-
};
|
|
66
|
-
const q = typeof window < "u" ? u.useLayoutEffect : u.useEffect;
|
|
67
|
-
function te(e) {
|
|
68
|
-
const s = M(), { control: t = s.control, disabled: n, name: r, exact: a } = e || {}, [i, l] = u.useState(t._formState), c = u.useRef({
|
|
69
|
-
isDirty: !1,
|
|
70
|
-
isLoading: !1,
|
|
71
|
-
dirtyFields: !1,
|
|
72
|
-
touchedFields: !1,
|
|
73
|
-
validatingFields: !1,
|
|
74
|
-
isValidating: !1,
|
|
75
|
-
isValid: !1,
|
|
76
|
-
errors: !1
|
|
77
|
-
});
|
|
78
|
-
return q(() => t._subscribe({
|
|
79
|
-
name: r,
|
|
80
|
-
formState: c.current,
|
|
81
|
-
exact: a,
|
|
82
|
-
callback: (f) => {
|
|
83
|
-
!n && l({
|
|
84
|
-
...t._formState,
|
|
85
|
-
...f
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}), [r, n, a]), u.useEffect(() => {
|
|
89
|
-
c.current.isValid && t._setValid(!0);
|
|
90
|
-
}, [t]), u.useMemo(() => ee(i, t, c.current, !1), [i, t]);
|
|
91
|
-
}
|
|
92
|
-
var re = (e) => typeof e == "string", T = (e, s, t, n, r) => re(e) ? y(t, e, r) : Array.isArray(e) ? e.map((a) => y(t, a)) : t, U = (e) => w(e) || !H(e);
|
|
93
|
-
function S(e, s, t = /* @__PURE__ */ new WeakSet()) {
|
|
94
|
-
if (U(e) || U(s))
|
|
95
|
-
return Object.is(e, s);
|
|
96
|
-
if (k(e) && k(s))
|
|
97
|
-
return e.getTime() === s.getTime();
|
|
98
|
-
const n = Object.keys(e), r = Object.keys(s);
|
|
99
|
-
if (n.length !== r.length)
|
|
100
|
-
return !1;
|
|
101
|
-
if (t.has(e) || t.has(s))
|
|
102
|
-
return !0;
|
|
103
|
-
t.add(e), t.add(s);
|
|
104
|
-
for (const a of n) {
|
|
105
|
-
const i = e[a];
|
|
106
|
-
if (!r.includes(a))
|
|
107
|
-
return !1;
|
|
108
|
-
if (a !== "ref") {
|
|
109
|
-
const l = s[a];
|
|
110
|
-
if (k(i) && k(l) || p(i) && p(l) || Array.isArray(i) && Array.isArray(l) ? !S(i, l, t) : !Object.is(i, l))
|
|
111
|
-
return !1;
|
|
112
|
-
}
|
|
75
|
+
);
|
|
113
76
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
77
|
+
);
|
|
78
|
+
_.displayName = R;
|
|
79
|
+
var y = "TabsTrigger", A = v.forwardRef(
|
|
80
|
+
(e, r) => {
|
|
81
|
+
const { __scopeTabs: s, value: t, disabled: n = !1, ...c } = e, o = T(y, s), d = h(s), f = P(o.baseId, t), m = S(o.baseId, t), i = t === o.value;
|
|
82
|
+
return /* @__PURE__ */ l(
|
|
83
|
+
F,
|
|
84
|
+
{
|
|
85
|
+
asChild: !0,
|
|
86
|
+
...d,
|
|
87
|
+
focusable: !n,
|
|
88
|
+
active: i,
|
|
89
|
+
children: /* @__PURE__ */ l(
|
|
90
|
+
b.button,
|
|
91
|
+
{
|
|
92
|
+
type: "button",
|
|
93
|
+
role: "tab",
|
|
94
|
+
"aria-selected": i,
|
|
95
|
+
"aria-controls": m,
|
|
96
|
+
"data-state": i ? "active" : "inactive",
|
|
97
|
+
"data-disabled": n ? "" : void 0,
|
|
98
|
+
disabled: n,
|
|
99
|
+
id: f,
|
|
100
|
+
...c,
|
|
101
|
+
ref: r,
|
|
102
|
+
onMouseDown: g(e.onMouseDown, (a) => {
|
|
103
|
+
!n && a.button === 0 && a.ctrlKey === !1 ? o.onValueChange(t) : a.preventDefault();
|
|
104
|
+
}),
|
|
105
|
+
onKeyDown: g(e.onKeyDown, (a) => {
|
|
106
|
+
[" ", "Enter"].includes(a.key) && o.onValueChange(t);
|
|
107
|
+
}),
|
|
108
|
+
onFocus: g(e.onFocus, () => {
|
|
109
|
+
const a = o.activationMode !== "manual";
|
|
110
|
+
!i && !n && a && o.onValueChange(t);
|
|
111
|
+
})
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
A.displayName = y;
|
|
119
|
+
var M = "TabsContent", N = v.forwardRef(
|
|
120
|
+
(e, r) => {
|
|
121
|
+
const { __scopeTabs: s, value: t, forceMount: n, children: c, ...o } = e, d = T(M, s), f = P(d.baseId, t), m = S(d.baseId, t), i = t === d.value, a = v.useRef(i);
|
|
122
|
+
return v.useEffect(() => {
|
|
123
|
+
const u = requestAnimationFrame(() => a.current = !1);
|
|
124
|
+
return () => cancelAnimationFrame(u);
|
|
125
|
+
}, []), /* @__PURE__ */ l(w, { present: n || i, children: ({ present: u }) => /* @__PURE__ */ l(
|
|
126
|
+
b.div,
|
|
127
|
+
{
|
|
128
|
+
"data-state": i ? "active" : "inactive",
|
|
129
|
+
"data-orientation": d.orientation,
|
|
130
|
+
role: "tabpanel",
|
|
131
|
+
"aria-labelledby": f,
|
|
132
|
+
hidden: !u,
|
|
133
|
+
id: m,
|
|
134
|
+
tabIndex: 0,
|
|
135
|
+
...o,
|
|
136
|
+
ref: r,
|
|
137
|
+
style: {
|
|
138
|
+
...e.style,
|
|
139
|
+
animationDuration: a.current ? "0s" : void 0
|
|
140
|
+
},
|
|
141
|
+
children: u && c
|
|
142
|
+
}
|
|
143
|
+
) });
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
N.displayName = M;
|
|
147
|
+
function P(e, r) {
|
|
148
|
+
return `${e}-trigger-${r}`;
|
|
152
149
|
}
|
|
153
|
-
function
|
|
154
|
-
|
|
155
|
-
control: r,
|
|
156
|
-
name: t,
|
|
157
|
-
defaultValue: f,
|
|
158
|
-
exact: l
|
|
159
|
-
}), d = te({
|
|
160
|
-
control: r,
|
|
161
|
-
name: t,
|
|
162
|
-
exact: l
|
|
163
|
-
}), g = u.useRef(e), A = u.useRef(void 0), v = u.useRef(r.register(t, {
|
|
164
|
-
...e.rules,
|
|
165
|
-
value: V,
|
|
166
|
-
...P(e.disabled) ? { disabled: e.disabled } : {}
|
|
167
|
-
}));
|
|
168
|
-
g.current = e;
|
|
169
|
-
const C = u.useMemo(() => Object.defineProperties({}, {
|
|
170
|
-
invalid: {
|
|
171
|
-
enumerable: !0,
|
|
172
|
-
get: () => !!y(d.errors, t)
|
|
173
|
-
},
|
|
174
|
-
isDirty: {
|
|
175
|
-
enumerable: !0,
|
|
176
|
-
get: () => !!y(d.dirtyFields, t)
|
|
177
|
-
},
|
|
178
|
-
isTouched: {
|
|
179
|
-
enumerable: !0,
|
|
180
|
-
get: () => !!y(d.touchedFields, t)
|
|
181
|
-
},
|
|
182
|
-
isValidating: {
|
|
183
|
-
enumerable: !0,
|
|
184
|
-
get: () => !!y(d.validatingFields, t)
|
|
185
|
-
},
|
|
186
|
-
error: {
|
|
187
|
-
enumerable: !0,
|
|
188
|
-
get: () => y(d.errors, t)
|
|
189
|
-
}
|
|
190
|
-
}), [d, t]), b = u.useCallback((o) => v.current.onChange({
|
|
191
|
-
target: {
|
|
192
|
-
value: J(o),
|
|
193
|
-
name: t
|
|
194
|
-
},
|
|
195
|
-
type: I.CHANGE
|
|
196
|
-
}), [t]), h = u.useCallback(() => v.current.onBlur({
|
|
197
|
-
target: {
|
|
198
|
-
value: y(r._formValues, t),
|
|
199
|
-
name: t
|
|
200
|
-
},
|
|
201
|
-
type: I.BLUR
|
|
202
|
-
}), [t, r._formValues]), F = u.useCallback((o) => {
|
|
203
|
-
const m = y(r._fields, t);
|
|
204
|
-
m && m._f && o && (m._f.ref = {
|
|
205
|
-
focus: () => E(o.focus) && o.focus(),
|
|
206
|
-
select: () => E(o.select) && o.select(),
|
|
207
|
-
setCustomValidity: (_) => E(o.setCustomValidity) && o.setCustomValidity(_),
|
|
208
|
-
reportValidity: () => E(o.reportValidity) && o.reportValidity()
|
|
209
|
-
});
|
|
210
|
-
}, [r._fields, t]), O = u.useMemo(() => ({
|
|
211
|
-
name: t,
|
|
212
|
-
value: V,
|
|
213
|
-
...P(n) || d.disabled ? { disabled: d.disabled || n } : {},
|
|
214
|
-
onChange: b,
|
|
215
|
-
onBlur: h,
|
|
216
|
-
ref: F
|
|
217
|
-
}), [t, n, d.disabled, b, h, F, V]);
|
|
218
|
-
return u.useEffect(() => {
|
|
219
|
-
const o = r._options.shouldUnregister || a, m = A.current;
|
|
220
|
-
m && m !== t && !c && r.unregister(m), r.register(t, {
|
|
221
|
-
...g.current.rules,
|
|
222
|
-
...P(g.current.disabled) ? { disabled: g.current.disabled } : {}
|
|
223
|
-
});
|
|
224
|
-
const _ = (x, K) => {
|
|
225
|
-
const N = y(r._fields, x);
|
|
226
|
-
N && N._f && (N._f.mount = K);
|
|
227
|
-
};
|
|
228
|
-
if (_(t, !0), o) {
|
|
229
|
-
const x = W(y(r._options.defaultValues, t, g.current.defaultValue));
|
|
230
|
-
D(r._defaultValues, t, x), R(y(r._formValues, t)) && D(r._formValues, t, x);
|
|
231
|
-
}
|
|
232
|
-
return !c && r.register(t), A.current = t, () => {
|
|
233
|
-
(c ? o && !r._state.action : o) ? r.unregister(t) : _(t, !1);
|
|
234
|
-
};
|
|
235
|
-
}, [t, r, c, a]), u.useEffect(() => {
|
|
236
|
-
r._setDisabledField({
|
|
237
|
-
disabled: n,
|
|
238
|
-
name: t
|
|
239
|
-
});
|
|
240
|
-
}, [n, t, r]), u.useMemo(() => ({
|
|
241
|
-
field: O,
|
|
242
|
-
formState: d,
|
|
243
|
-
fieldState: C
|
|
244
|
-
}), [O, d, C]);
|
|
150
|
+
function S(e, r) {
|
|
151
|
+
return `${e}-content-${r}`;
|
|
245
152
|
}
|
|
246
|
-
|
|
153
|
+
var Q = I, U = _, W = A, X = N;
|
|
247
154
|
export {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
155
|
+
X as Content,
|
|
156
|
+
U as List,
|
|
157
|
+
Q as Root,
|
|
158
|
+
I as Tabs,
|
|
159
|
+
N as TabsContent,
|
|
160
|
+
_ as TabsList,
|
|
161
|
+
A as TabsTrigger,
|
|
162
|
+
W as Trigger
|
|
256
163
|
};
|
package/dist/index76.js
CHANGED
|
@@ -1,9 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
3
|
+
function w(e, c) {
|
|
4
|
+
const o = u.createContext(c), a = (r) => {
|
|
5
|
+
const { children: t, ...n } = r, s = u.useMemo(() => n, Object.values(n));
|
|
6
|
+
return /* @__PURE__ */ h(o.Provider, { value: s, children: t });
|
|
5
7
|
};
|
|
8
|
+
a.displayName = e + "Provider";
|
|
9
|
+
function i(r) {
|
|
10
|
+
const t = u.useContext(o);
|
|
11
|
+
if (t) return t;
|
|
12
|
+
if (c !== void 0) return c;
|
|
13
|
+
throw new Error(`\`${r}\` must be used within \`${e}\``);
|
|
14
|
+
}
|
|
15
|
+
return [a, i];
|
|
16
|
+
}
|
|
17
|
+
function _(e, c = []) {
|
|
18
|
+
let o = [];
|
|
19
|
+
function a(r, t) {
|
|
20
|
+
const n = u.createContext(t), s = o.length;
|
|
21
|
+
o = [...o, t];
|
|
22
|
+
const p = (d) => {
|
|
23
|
+
var S;
|
|
24
|
+
const { scope: x, children: C, ...m } = d, v = ((S = x == null ? void 0 : x[e]) == null ? void 0 : S[s]) || n, P = u.useMemo(() => m, Object.values(m));
|
|
25
|
+
return /* @__PURE__ */ h(v.Provider, { value: P, children: C });
|
|
26
|
+
};
|
|
27
|
+
p.displayName = r + "Provider";
|
|
28
|
+
function f(d, x) {
|
|
29
|
+
var v;
|
|
30
|
+
const C = ((v = x == null ? void 0 : x[e]) == null ? void 0 : v[s]) || n, m = u.useContext(C);
|
|
31
|
+
if (m) return m;
|
|
32
|
+
if (t !== void 0) return t;
|
|
33
|
+
throw new Error(`\`${d}\` must be used within \`${r}\``);
|
|
34
|
+
}
|
|
35
|
+
return [p, f];
|
|
36
|
+
}
|
|
37
|
+
const i = () => {
|
|
38
|
+
const r = o.map((t) => u.createContext(t));
|
|
39
|
+
return function(n) {
|
|
40
|
+
const s = (n == null ? void 0 : n[e]) || r;
|
|
41
|
+
return u.useMemo(
|
|
42
|
+
() => ({ [`__scope${e}`]: { ...n, [e]: s } }),
|
|
43
|
+
[n, s]
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
return i.scopeName = e, [a, l(i, ...c)];
|
|
48
|
+
}
|
|
49
|
+
function l(...e) {
|
|
50
|
+
const c = e[0];
|
|
51
|
+
if (e.length === 1) return c;
|
|
52
|
+
const o = () => {
|
|
53
|
+
const a = e.map((i) => ({
|
|
54
|
+
useScope: i(),
|
|
55
|
+
scopeName: i.scopeName
|
|
56
|
+
}));
|
|
57
|
+
return function(r) {
|
|
58
|
+
const t = a.reduce((n, { useScope: s, scopeName: p }) => {
|
|
59
|
+
const d = s(r)[`__scope${p}`];
|
|
60
|
+
return { ...n, ...d };
|
|
61
|
+
}, {});
|
|
62
|
+
return u.useMemo(() => ({ [`__scope${c.scopeName}`]: t }), [t]);
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
return o.scopeName = c.scopeName, o;
|
|
6
66
|
}
|
|
7
67
|
export {
|
|
8
|
-
|
|
68
|
+
w as createContext,
|
|
69
|
+
_ as createContextScope
|
|
9
70
|
};
|
package/dist/index77.js
CHANGED
|
@@ -1,29 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
-
if (u)
|
|
15
|
-
return () => {
|
|
16
|
-
for (let t = 0; t < c.length; t++) {
|
|
17
|
-
const e = c[t];
|
|
18
|
-
typeof e == "function" ? e() : l(n[t], null);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
1
|
+
import r from "react";
|
|
2
|
+
import { createContextScope as y } from "./index76.js";
|
|
3
|
+
import { useComposedRefs as M } from "./index78.js";
|
|
4
|
+
import { createSlot as x } from "./index113.js";
|
|
5
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
6
|
+
function g(s) {
|
|
7
|
+
const m = s + "CollectionProvider", [A, N] = y(m), [_, f] = A(
|
|
8
|
+
m,
|
|
9
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
10
|
+
), p = (c) => {
|
|
11
|
+
const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
|
|
12
|
+
return /* @__PURE__ */ u(_, { scope: e, itemMap: t, collectionRef: o, children: l });
|
|
21
13
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
p.displayName = m;
|
|
15
|
+
const a = s + "CollectionSlot", E = x(a), C = r.forwardRef(
|
|
16
|
+
(c, e) => {
|
|
17
|
+
const { scope: l, children: o } = c, t = f(a, l), n = M(e, t.collectionRef);
|
|
18
|
+
return /* @__PURE__ */ u(E, { ref: n, children: o });
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
C.displayName = a;
|
|
22
|
+
const d = s + "CollectionItemSlot", R = "data-radix-collection-item", T = x(d), I = r.forwardRef(
|
|
23
|
+
(c, e) => {
|
|
24
|
+
const { scope: l, children: o, ...t } = c, n = r.useRef(null), S = M(e, n), i = f(d, l);
|
|
25
|
+
return r.useEffect(() => (i.itemMap.set(n, { ref: n, ...t }), () => void i.itemMap.delete(n))), /* @__PURE__ */ u(T, { [R]: "", ref: S, children: o });
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
I.displayName = d;
|
|
29
|
+
function O(c) {
|
|
30
|
+
const e = f(s + "CollectionConsumer", c);
|
|
31
|
+
return r.useCallback(() => {
|
|
32
|
+
const o = e.collectionRef.current;
|
|
33
|
+
if (!o) return [];
|
|
34
|
+
const t = Array.from(o.querySelectorAll(`[${R}]`));
|
|
35
|
+
return Array.from(e.itemMap.values()).sort(
|
|
36
|
+
(i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
|
|
37
|
+
);
|
|
38
|
+
}, [e.collectionRef, e.itemMap]);
|
|
39
|
+
}
|
|
40
|
+
return [
|
|
41
|
+
{ Provider: p, Slot: C, ItemSlot: I },
|
|
42
|
+
O,
|
|
43
|
+
N
|
|
44
|
+
];
|
|
25
45
|
}
|
|
26
46
|
export {
|
|
27
|
-
|
|
28
|
-
s as useComposedRefs
|
|
47
|
+
g as createCollection
|
|
29
48
|
};
|
package/dist/index78.js
CHANGED
|
@@ -1,70 +1,29 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return /* @__PURE__ */ h(o.Provider, { value: s, children: t });
|
|
7
|
-
};
|
|
8
|
-
a.displayName = e + "Provider";
|
|
9
|
-
function i(r) {
|
|
10
|
-
const t = u.useContext(o);
|
|
11
|
-
if (t) return t;
|
|
12
|
-
if (c !== void 0) return c;
|
|
13
|
-
throw new Error(`\`${r}\` must be used within \`${e}\``);
|
|
14
|
-
}
|
|
15
|
-
return [a, i];
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
function l(n, o) {
|
|
3
|
+
if (typeof n == "function")
|
|
4
|
+
return n(o);
|
|
5
|
+
n != null && (n.current = o);
|
|
16
6
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (m) return m;
|
|
32
|
-
if (t !== void 0) return t;
|
|
33
|
-
throw new Error(`\`${d}\` must be used within \`${r}\``);
|
|
34
|
-
}
|
|
35
|
-
return [p, f];
|
|
36
|
-
}
|
|
37
|
-
const i = () => {
|
|
38
|
-
const r = o.map((t) => u.createContext(t));
|
|
39
|
-
return function(n) {
|
|
40
|
-
const s = (n == null ? void 0 : n[e]) || r;
|
|
41
|
-
return u.useMemo(
|
|
42
|
-
() => ({ [`__scope${e}`]: { ...n, [e]: s } }),
|
|
43
|
-
[n, s]
|
|
44
|
-
);
|
|
45
|
-
};
|
|
7
|
+
function i(...n) {
|
|
8
|
+
return (o) => {
|
|
9
|
+
let u = !1;
|
|
10
|
+
const c = n.map((t) => {
|
|
11
|
+
const e = l(t, o);
|
|
12
|
+
return !u && typeof e == "function" && (u = !0), e;
|
|
13
|
+
});
|
|
14
|
+
if (u)
|
|
15
|
+
return () => {
|
|
16
|
+
for (let t = 0; t < c.length; t++) {
|
|
17
|
+
const e = c[t];
|
|
18
|
+
typeof e == "function" ? e() : l(n[t], null);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
46
21
|
};
|
|
47
|
-
return i.scopeName = e, [a, l(i, ...c)];
|
|
48
22
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
if (e.length === 1) return c;
|
|
52
|
-
const o = () => {
|
|
53
|
-
const a = e.map((i) => ({
|
|
54
|
-
useScope: i(),
|
|
55
|
-
scopeName: i.scopeName
|
|
56
|
-
}));
|
|
57
|
-
return function(r) {
|
|
58
|
-
const t = a.reduce((n, { useScope: s, scopeName: p }) => {
|
|
59
|
-
const d = s(r)[`__scope${p}`];
|
|
60
|
-
return { ...n, ...d };
|
|
61
|
-
}, {});
|
|
62
|
-
return u.useMemo(() => ({ [`__scope${c.scopeName}`]: t }), [t]);
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
return o.scopeName = c.scopeName, o;
|
|
23
|
+
function s(...n) {
|
|
24
|
+
return f.useCallback(i(...n), n);
|
|
66
25
|
}
|
|
67
26
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
27
|
+
i as composeRefs,
|
|
28
|
+
s as useComposedRefs
|
|
70
29
|
};
|