@drjoshcsimmons/scl 0.3.1 → 0.4.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/dist/components/ui/accordion/accordion.d.ts +1 -0
- package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +5 -1
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/button/button.d.ts +7 -0
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/input/input.d.ts +6 -1
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/skeleton/skeleton.d.ts +5 -2
- package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts +6 -1
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/globals.css +45 -0
- package/dist/hooks/use-font-loaded.d.ts +2 -0
- package/dist/hooks/use-font-loaded.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +116 -114
- package/dist/index10.js +33 -28
- package/dist/index100.js +3 -5
- package/dist/index101.js +2 -2
- package/dist/index102.js +5 -54
- package/dist/index103.js +25 -30
- package/dist/index104.js +47 -29
- package/dist/index105.js +30 -4
- package/dist/index106.js +45 -216
- package/dist/index107.js +7 -46
- package/dist/index108.js +178 -27
- package/dist/index109.js +51 -44
- package/dist/index11.js +28 -5
- package/dist/index110.js +30 -9
- package/dist/index111.js +30 -6
- package/dist/index112.js +6 -48
- package/dist/index114.js +200 -42
- package/dist/index115.js +20 -204
- package/dist/index116.js +399 -21
- package/dist/index117.js +40 -392
- package/dist/index118.js +48 -2
- package/dist/index119.js +23 -51
- package/dist/index12.js +5 -79
- package/dist/index120.js +29 -65
- package/dist/index121.js +5 -25
- package/dist/index122.js +2 -29
- package/dist/index123.js +53 -5
- package/dist/index124.js +65 -2
- package/dist/index125.js +2 -2
- package/dist/index126.js +2 -5
- package/dist/index127.js +5 -3
- package/dist/index128.js +3 -24
- package/dist/index129.js +22 -111
- package/dist/index13.js +75 -12
- package/dist/index130.js +111 -14
- package/dist/index131.js +14 -523
- package/dist/index132.js +511 -114
- package/dist/index133.js +111 -117
- package/dist/index134.js +130 -61
- package/dist/index135.js +65 -69
- package/dist/index136.js +68 -8
- package/dist/index137.js +9 -14
- package/dist/index138.js +14 -66
- package/dist/index139.js +66 -4
- package/dist/index14.js +17 -14
- package/dist/index140.js +3 -22
- package/dist/index141.js +23 -13
- package/dist/index142.js +20 -25
- package/dist/index143.js +12 -4
- package/dist/index144.js +25 -20
- package/dist/index145.js +7 -0
- package/dist/index15.js +12 -17
- package/dist/index16.js +18 -31
- package/dist/index17.js +32 -25
- package/dist/index18.js +19 -31
- package/dist/index19.js +28 -129
- package/dist/index20.js +136 -18
- package/dist/index21.js +19 -11
- package/dist/index22.js +11 -20
- package/dist/index23.js +23 -15
- package/dist/index24.js +15 -31
- package/dist/index25.js +31 -35
- package/dist/index26.js +35 -15
- package/dist/index27.js +15 -13
- package/dist/index28.js +11 -20
- package/dist/index29.js +23 -99
- package/dist/index3.js +10 -22
- package/dist/index30.js +99 -38
- package/dist/index31.js +38 -10
- package/dist/index32.js +10 -48
- package/dist/index33.js +47 -64
- package/dist/index34.js +66 -236
- package/dist/{index63.js → index38.js} +14 -14
- package/dist/index4.js +22 -53
- package/dist/index40.js +239 -0
- package/dist/{index59.js → index42.js} +1 -1
- package/dist/index45.js +507 -236
- package/dist/index47.js +860 -18
- package/dist/index5.js +52 -24
- package/dist/index50.js +91 -197
- package/dist/{index65.js → index53.js} +8 -8
- package/dist/index55.js +221 -822
- package/dist/{index67.js → index58.js} +6 -6
- package/dist/index6.js +24 -34
- package/dist/index61.js +310 -504
- package/dist/{index43.js → index64.js} +7 -7
- package/dist/{index57.js → index66.js} +2 -2
- package/dist/{index52.js → index68.js} +3 -3
- package/dist/index7.js +34 -6
- package/dist/index70.js +238 -0
- package/dist/{index69.js → index72.js} +7 -7
- package/dist/{index36.js → index74.js} +1 -1
- package/dist/index76.js +20 -0
- package/dist/index8.js +6 -21
- package/dist/index81.js +1 -1
- package/dist/index82.js +1 -1
- package/dist/index83.js +7 -30
- package/dist/index84.js +25 -5
- package/dist/index86.js +114 -170
- package/dist/index87.js +13 -67
- package/dist/index88.js +133 -32
- package/dist/index89.js +10 -7
- package/dist/index9.js +27 -32
- package/dist/index90.js +215 -48
- package/dist/index91.js +14 -11
- package/dist/index92.js +64 -120
- package/dist/index93.js +32 -133
- package/dist/index94.js +48 -14
- package/dist/index95.js +50 -13
- package/dist/index96.js +50 -9
- package/dist/index97.js +9 -50
- package/dist/index98.js +29 -47
- package/dist/index99.js +7 -24
- package/dist/tokens/index.d.ts +9 -8
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/spacing.d.ts +11 -8
- package/dist/tokens/spacing.d.ts.map +1 -1
- package/dist/tokens/typography.d.ts +1 -0
- package/dist/tokens/typography.d.ts.map +1 -1
- package/package.json +4 -5
- package/dist/index71.js +0 -338
- package/dist/index73.js +0 -132
- package/dist/index77.js +0 -29
- /package/dist/{index41.js → index35.js} +0 -0
package/dist/index34.js
CHANGED
|
@@ -1,239 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
const e = {
|
|
2
|
+
fontFamily: {
|
|
3
|
+
terminal: ["BigBlueTerm437", "monospace"],
|
|
4
|
+
sans: [
|
|
5
|
+
"ui-sans-serif",
|
|
6
|
+
"system-ui",
|
|
7
|
+
"sans-serif",
|
|
8
|
+
'"Apple Color Emoji"',
|
|
9
|
+
'"Segoe UI Emoji"',
|
|
10
|
+
'"Segoe UI Symbol"',
|
|
11
|
+
'"Noto Color Emoji"'
|
|
12
|
+
],
|
|
13
|
+
mono: [
|
|
14
|
+
"ui-monospace",
|
|
15
|
+
"SFMono-Regular",
|
|
16
|
+
"Menlo",
|
|
17
|
+
"Monaco",
|
|
18
|
+
"Consolas",
|
|
19
|
+
'"Liberation Mono"',
|
|
20
|
+
'"Courier New"',
|
|
21
|
+
"monospace"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
fontSize: {
|
|
25
|
+
xs: ["0.75rem", { lineHeight: "1rem" }],
|
|
26
|
+
sm: ["0.875rem", { lineHeight: "1.25rem" }],
|
|
27
|
+
base: ["1rem", { lineHeight: "1.5rem" }],
|
|
28
|
+
lg: ["1.125rem", { lineHeight: "1.75rem" }],
|
|
29
|
+
xl: ["1.25rem", { lineHeight: "1.75rem" }],
|
|
30
|
+
"2xl": ["1.5rem", { lineHeight: "2rem" }],
|
|
31
|
+
"3xl": ["1.875rem", { lineHeight: "2.25rem" }],
|
|
32
|
+
"4xl": ["2.25rem", { lineHeight: "2.5rem" }],
|
|
33
|
+
"5xl": ["3rem", { lineHeight: "1" }],
|
|
34
|
+
"6xl": ["3.75rem", { lineHeight: "1" }],
|
|
35
|
+
"7xl": ["4.5rem", { lineHeight: "1" }],
|
|
36
|
+
"8xl": ["6rem", { lineHeight: "1" }],
|
|
37
|
+
"9xl": ["8rem", { lineHeight: "1" }]
|
|
38
|
+
},
|
|
39
|
+
fontWeight: {
|
|
40
|
+
thin: "100",
|
|
41
|
+
extralight: "200",
|
|
42
|
+
light: "300",
|
|
43
|
+
normal: "400",
|
|
44
|
+
medium: "500",
|
|
45
|
+
semibold: "600",
|
|
46
|
+
bold: "700",
|
|
47
|
+
extrabold: "800",
|
|
48
|
+
black: "900"
|
|
49
|
+
},
|
|
50
|
+
letterSpacing: {
|
|
51
|
+
tighter: "-0.05em",
|
|
52
|
+
tight: "-0.025em",
|
|
53
|
+
normal: "0em",
|
|
54
|
+
wide: "0.025em",
|
|
55
|
+
wider: "0.05em",
|
|
56
|
+
widest: "0.1em"
|
|
57
|
+
},
|
|
58
|
+
lineHeight: {
|
|
59
|
+
none: "1",
|
|
60
|
+
tight: "1.25",
|
|
61
|
+
snug: "1.375",
|
|
62
|
+
normal: "1.5",
|
|
63
|
+
relaxed: "1.625",
|
|
64
|
+
loose: "2"
|
|
19
65
|
}
|
|
20
|
-
|
|
21
|
-
K.displayName = d;
|
|
22
|
-
var [L, se] = b(d), [z, de] = b(
|
|
23
|
-
d,
|
|
24
|
-
{ collapsible: !1 }
|
|
25
|
-
), pe = s.forwardRef(
|
|
26
|
-
(o, c) => {
|
|
27
|
-
const {
|
|
28
|
-
value: e,
|
|
29
|
-
defaultValue: t,
|
|
30
|
-
onValueChange: i = () => {
|
|
31
|
-
},
|
|
32
|
-
collapsible: r = !1,
|
|
33
|
-
...l
|
|
34
|
-
} = o, [a, p] = M({
|
|
35
|
-
prop: e,
|
|
36
|
-
defaultProp: t ?? "",
|
|
37
|
-
onChange: i,
|
|
38
|
-
caller: d
|
|
39
|
-
});
|
|
40
|
-
return /* @__PURE__ */ n(
|
|
41
|
-
L,
|
|
42
|
-
{
|
|
43
|
-
scope: o.__scopeAccordion,
|
|
44
|
-
value: s.useMemo(() => a ? [a] : [], [a]),
|
|
45
|
-
onItemOpen: p,
|
|
46
|
-
onItemClose: s.useCallback(() => r && p(""), [r, p]),
|
|
47
|
-
children: /* @__PURE__ */ n(z, { scope: o.__scopeAccordion, collapsible: r, children: /* @__PURE__ */ n(G, { ...l, ref: c }) })
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
), fe = s.forwardRef((o, c) => {
|
|
52
|
-
const {
|
|
53
|
-
value: e,
|
|
54
|
-
defaultValue: t,
|
|
55
|
-
onValueChange: i = () => {
|
|
56
|
-
},
|
|
57
|
-
...r
|
|
58
|
-
} = o, [l, a] = M({
|
|
59
|
-
prop: e,
|
|
60
|
-
defaultProp: t ?? [],
|
|
61
|
-
onChange: i,
|
|
62
|
-
caller: d
|
|
63
|
-
}), p = s.useCallback(
|
|
64
|
-
(v) => a((u = []) => [...u, v]),
|
|
65
|
-
[a]
|
|
66
|
-
), m = s.useCallback(
|
|
67
|
-
(v) => a((u = []) => u.filter((h) => h !== v)),
|
|
68
|
-
[a]
|
|
69
|
-
);
|
|
70
|
-
return /* @__PURE__ */ n(
|
|
71
|
-
L,
|
|
72
|
-
{
|
|
73
|
-
scope: o.__scopeAccordion,
|
|
74
|
-
value: l,
|
|
75
|
-
onItemOpen: p,
|
|
76
|
-
onItemClose: m,
|
|
77
|
-
children: /* @__PURE__ */ n(z, { scope: o.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ n(G, { ...r, ref: c }) })
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
}), [ue, I] = b(d), G = s.forwardRef(
|
|
81
|
-
(o, c) => {
|
|
82
|
-
const { __scopeAccordion: e, disabled: t, dir: i, orientation: r = "vertical", ...l } = o, a = s.useRef(null), p = $(a, c), m = ae(e), u = ce(i) === "ltr", h = ee(o.onKeyDown, (C) => {
|
|
83
|
-
var O;
|
|
84
|
-
if (!ie.includes(C.key)) return;
|
|
85
|
-
const Q = C.target, x = m().filter((N) => {
|
|
86
|
-
var T;
|
|
87
|
-
return !((T = N.ref.current) != null && T.disabled);
|
|
88
|
-
}), A = x.findIndex((N) => N.ref.current === Q), D = x.length;
|
|
89
|
-
if (A === -1) return;
|
|
90
|
-
C.preventDefault();
|
|
91
|
-
let f = A;
|
|
92
|
-
const _ = 0, w = D - 1, R = () => {
|
|
93
|
-
f = A + 1, f > w && (f = _);
|
|
94
|
-
}, P = () => {
|
|
95
|
-
f = A - 1, f < _ && (f = w);
|
|
96
|
-
};
|
|
97
|
-
switch (C.key) {
|
|
98
|
-
case "Home":
|
|
99
|
-
f = _;
|
|
100
|
-
break;
|
|
101
|
-
case "End":
|
|
102
|
-
f = w;
|
|
103
|
-
break;
|
|
104
|
-
case "ArrowRight":
|
|
105
|
-
r === "horizontal" && (u ? R() : P());
|
|
106
|
-
break;
|
|
107
|
-
case "ArrowDown":
|
|
108
|
-
r === "vertical" && R();
|
|
109
|
-
break;
|
|
110
|
-
case "ArrowLeft":
|
|
111
|
-
r === "horizontal" && (u ? P() : R());
|
|
112
|
-
break;
|
|
113
|
-
case "ArrowUp":
|
|
114
|
-
r === "vertical" && P();
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
const W = f % D;
|
|
118
|
-
(O = x[W].ref.current) == null || O.focus();
|
|
119
|
-
});
|
|
120
|
-
return /* @__PURE__ */ n(
|
|
121
|
-
ue,
|
|
122
|
-
{
|
|
123
|
-
scope: e,
|
|
124
|
-
disabled: t,
|
|
125
|
-
direction: i,
|
|
126
|
-
orientation: r,
|
|
127
|
-
children: /* @__PURE__ */ n(E.Slot, { scope: e, children: /* @__PURE__ */ n(
|
|
128
|
-
V.div,
|
|
129
|
-
{
|
|
130
|
-
...l,
|
|
131
|
-
"data-orientation": r,
|
|
132
|
-
ref: p,
|
|
133
|
-
onKeyDown: t ? void 0 : h
|
|
134
|
-
}
|
|
135
|
-
) })
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
), g = "AccordionItem", [me, k] = b(g), U = s.forwardRef(
|
|
140
|
-
(o, c) => {
|
|
141
|
-
const { __scopeAccordion: e, value: t, ...i } = o, r = I(g, e), l = se(g, e), a = S(e), p = ne(), m = t && l.value.includes(t) || !1, v = r.disabled || o.disabled;
|
|
142
|
-
return /* @__PURE__ */ n(
|
|
143
|
-
me,
|
|
144
|
-
{
|
|
145
|
-
scope: e,
|
|
146
|
-
open: m,
|
|
147
|
-
disabled: v,
|
|
148
|
-
triggerId: p,
|
|
149
|
-
children: /* @__PURE__ */ n(
|
|
150
|
-
re,
|
|
151
|
-
{
|
|
152
|
-
"data-orientation": r.orientation,
|
|
153
|
-
"data-state": J(m),
|
|
154
|
-
...a,
|
|
155
|
-
...i,
|
|
156
|
-
ref: c,
|
|
157
|
-
disabled: v,
|
|
158
|
-
open: m,
|
|
159
|
-
onOpenChange: (u) => {
|
|
160
|
-
u ? l.onItemOpen(t) : l.onItemClose(t);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
U.displayName = g;
|
|
169
|
-
var j = "AccordionHeader", Y = s.forwardRef(
|
|
170
|
-
(o, c) => {
|
|
171
|
-
const { __scopeAccordion: e, ...t } = o, i = I(d, e), r = k(j, e);
|
|
172
|
-
return /* @__PURE__ */ n(
|
|
173
|
-
V.h3,
|
|
174
|
-
{
|
|
175
|
-
"data-orientation": i.orientation,
|
|
176
|
-
"data-state": J(r.open),
|
|
177
|
-
"data-disabled": r.disabled ? "" : void 0,
|
|
178
|
-
...t,
|
|
179
|
-
ref: c
|
|
180
|
-
}
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
Y.displayName = j;
|
|
185
|
-
var y = "AccordionTrigger", q = s.forwardRef(
|
|
186
|
-
(o, c) => {
|
|
187
|
-
const { __scopeAccordion: e, ...t } = o, i = I(d, e), r = k(y, e), l = de(y, e), a = S(e);
|
|
188
|
-
return /* @__PURE__ */ n(E.ItemSlot, { scope: e, children: /* @__PURE__ */ n(
|
|
189
|
-
te,
|
|
190
|
-
{
|
|
191
|
-
"aria-disabled": r.open && !l.collapsible || void 0,
|
|
192
|
-
"data-orientation": i.orientation,
|
|
193
|
-
id: r.triggerId,
|
|
194
|
-
...a,
|
|
195
|
-
...t,
|
|
196
|
-
ref: c
|
|
197
|
-
}
|
|
198
|
-
) });
|
|
199
|
-
}
|
|
200
|
-
);
|
|
201
|
-
q.displayName = y;
|
|
202
|
-
var B = "AccordionContent", F = s.forwardRef(
|
|
203
|
-
(o, c) => {
|
|
204
|
-
const { __scopeAccordion: e, ...t } = o, i = I(d, e), r = k(B, e), l = S(e);
|
|
205
|
-
return /* @__PURE__ */ n(
|
|
206
|
-
oe,
|
|
207
|
-
{
|
|
208
|
-
role: "region",
|
|
209
|
-
"aria-labelledby": r.triggerId,
|
|
210
|
-
"data-orientation": i.orientation,
|
|
211
|
-
...l,
|
|
212
|
-
...t,
|
|
213
|
-
ref: c,
|
|
214
|
-
style: {
|
|
215
|
-
"--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
|
|
216
|
-
"--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
|
|
217
|
-
...o.style
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
);
|
|
223
|
-
F.displayName = B;
|
|
224
|
-
function J(o) {
|
|
225
|
-
return o ? "open" : "closed";
|
|
226
|
-
}
|
|
227
|
-
var Pe = K, Ne = U, ye = Y, Ee = q, Se = F;
|
|
66
|
+
};
|
|
228
67
|
export {
|
|
229
|
-
|
|
230
|
-
F as AccordionContent,
|
|
231
|
-
Y as AccordionHeader,
|
|
232
|
-
U as AccordionItem,
|
|
233
|
-
q as AccordionTrigger,
|
|
234
|
-
Se as Content,
|
|
235
|
-
ye as Header,
|
|
236
|
-
Ne as Item,
|
|
237
|
-
Pe as Root,
|
|
238
|
-
Ee as Trigger
|
|
68
|
+
e as typography
|
|
239
69
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as i from "react";
|
|
2
|
-
import { composeEventHandlers as P } from "./
|
|
3
|
-
import { useComposedRefs as O } from "./
|
|
2
|
+
import { composeEventHandlers as P } from "./index83.js";
|
|
3
|
+
import { useComposedRefs as O } from "./index84.js";
|
|
4
4
|
import { createContextScope as G } from "./index85.js";
|
|
5
|
-
import { DismissableLayer as H } from "./
|
|
6
|
-
import { useFocusGuards as K } from "./
|
|
7
|
-
import { FocusScope as $ } from "./
|
|
8
|
-
import { useId as j } from "./
|
|
9
|
-
import { createPopperScope as _, Root as U, Anchor as x, Content as V, Arrow as W } from "./
|
|
10
|
-
import { Portal as Z } from "./
|
|
11
|
-
import { Presence as w } from "./
|
|
12
|
-
import { Primitive as E } from "./
|
|
13
|
-
import { createSlot as q } from "./
|
|
14
|
-
import { useControllableState as z } from "./
|
|
15
|
-
import { hideOthers as B } from "./
|
|
16
|
-
import J from "./
|
|
5
|
+
import { DismissableLayer as H } from "./index86.js";
|
|
6
|
+
import { useFocusGuards as K } from "./index87.js";
|
|
7
|
+
import { FocusScope as $ } from "./index88.js";
|
|
8
|
+
import { useId as j } from "./index89.js";
|
|
9
|
+
import { createPopperScope as _, Root as U, Anchor as x, Content as V, Arrow as W } from "./index90.js";
|
|
10
|
+
import { Portal as Z } from "./index91.js";
|
|
11
|
+
import { Presence as w } from "./index92.js";
|
|
12
|
+
import { Primitive as E } from "./index93.js";
|
|
13
|
+
import { createSlot as q } from "./index94.js";
|
|
14
|
+
import { useControllableState as z } from "./index95.js";
|
|
15
|
+
import { hideOthers as B } from "./index96.js";
|
|
16
|
+
import J from "./index97.js";
|
|
17
17
|
import { jsx as p } from "react/jsx-runtime";
|
|
18
18
|
var C = "Popover", [b] = G(C, [
|
|
19
19
|
_
|
package/dist/index4.js
CHANGED
|
@@ -1,55 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"aria-hidden": "true",
|
|
16
|
-
children: /* @__PURE__ */ o("polyline", { points: "6 9 12 15 18 9" })
|
|
17
|
-
}
|
|
18
|
-
), g = i.forwardRef(({ className: r, ...c }, e) => /* @__PURE__ */ o(
|
|
19
|
-
m,
|
|
20
|
-
{
|
|
21
|
-
ref: e,
|
|
22
|
-
className: n("scl-accordion-item", r),
|
|
23
|
-
...c
|
|
24
|
-
}
|
|
25
|
-
));
|
|
26
|
-
g.displayName = "AccordionItem";
|
|
27
|
-
const N = i.forwardRef(({ className: r, children: c, ...e }, a) => /* @__PURE__ */ o(p, { className: "scl-accordion-header", children: /* @__PURE__ */ d(
|
|
28
|
-
t,
|
|
29
|
-
{
|
|
30
|
-
ref: a,
|
|
31
|
-
className: n("scl-accordion-trigger", r),
|
|
32
|
-
...e,
|
|
33
|
-
children: [
|
|
34
|
-
c,
|
|
35
|
-
/* @__PURE__ */ o(f, {})
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
) }));
|
|
39
|
-
N.displayName = t.displayName;
|
|
40
|
-
const h = i.forwardRef(({ className: r, children: c, ...e }, a) => /* @__PURE__ */ o(
|
|
41
|
-
s,
|
|
42
|
-
{
|
|
43
|
-
ref: a,
|
|
44
|
-
className: "scl-accordion-content",
|
|
45
|
-
...e,
|
|
46
|
-
children: /* @__PURE__ */ o("div", { className: n("scl-accordion-content__inner", r), children: c })
|
|
47
|
-
}
|
|
48
|
-
));
|
|
49
|
-
h.displayName = s.displayName;
|
|
1
|
+
import { animations as o } from "./index30.js";
|
|
2
|
+
import { colors as r } from "./index31.js";
|
|
3
|
+
import { palette as g } from "./index31.js";
|
|
4
|
+
import { shadows as m } from "./index32.js";
|
|
5
|
+
import { borderRadius as t, spacing as p } from "./index33.js";
|
|
6
|
+
import { typography as i } from "./index34.js";
|
|
7
|
+
const c = {
|
|
8
|
+
colors: r,
|
|
9
|
+
typography: i,
|
|
10
|
+
spacing: p,
|
|
11
|
+
borderRadius: t,
|
|
12
|
+
animations: o,
|
|
13
|
+
shadows: m
|
|
14
|
+
};
|
|
50
15
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
16
|
+
o as animations,
|
|
17
|
+
t as borderRadius,
|
|
18
|
+
r as colors,
|
|
19
|
+
g as palette,
|
|
20
|
+
m as shadows,
|
|
21
|
+
p as spacing,
|
|
22
|
+
c as theme,
|
|
23
|
+
i as typography
|
|
55
24
|
};
|
package/dist/index40.js
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import s from "react";
|
|
2
|
+
import { createContextScope as X } from "./index85.js";
|
|
3
|
+
import { createCollection as Z } from "./index101.js";
|
|
4
|
+
import { useComposedRefs as $ } from "./index84.js";
|
|
5
|
+
import { composeEventHandlers as ee } from "./index83.js";
|
|
6
|
+
import { useControllableState as M } from "./index95.js";
|
|
7
|
+
import { Primitive as V } from "./index93.js";
|
|
8
|
+
import { createCollapsibleScope as H, Content as oe, Root as re, Trigger as te } from "./index58.js";
|
|
9
|
+
import { useId as ne } from "./index89.js";
|
|
10
|
+
import { useDirection as ce } from "./index99.js";
|
|
11
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
12
|
+
var d = "Accordion", ie = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [E, ae, le] = Z(d), [b] = X(d, [
|
|
13
|
+
le,
|
|
14
|
+
H
|
|
15
|
+
]), S = H(), K = s.forwardRef(
|
|
16
|
+
(o, c) => {
|
|
17
|
+
const { type: e, ...t } = o, i = t, r = t;
|
|
18
|
+
return /* @__PURE__ */ n(E.Provider, { scope: o.__scopeAccordion, children: e === "multiple" ? /* @__PURE__ */ n(fe, { ...r, ref: c }) : /* @__PURE__ */ n(pe, { ...i, ref: c }) });
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
K.displayName = d;
|
|
22
|
+
var [L, se] = b(d), [z, de] = b(
|
|
23
|
+
d,
|
|
24
|
+
{ collapsible: !1 }
|
|
25
|
+
), pe = s.forwardRef(
|
|
26
|
+
(o, c) => {
|
|
27
|
+
const {
|
|
28
|
+
value: e,
|
|
29
|
+
defaultValue: t,
|
|
30
|
+
onValueChange: i = () => {
|
|
31
|
+
},
|
|
32
|
+
collapsible: r = !1,
|
|
33
|
+
...l
|
|
34
|
+
} = o, [a, p] = M({
|
|
35
|
+
prop: e,
|
|
36
|
+
defaultProp: t ?? "",
|
|
37
|
+
onChange: i,
|
|
38
|
+
caller: d
|
|
39
|
+
});
|
|
40
|
+
return /* @__PURE__ */ n(
|
|
41
|
+
L,
|
|
42
|
+
{
|
|
43
|
+
scope: o.__scopeAccordion,
|
|
44
|
+
value: s.useMemo(() => a ? [a] : [], [a]),
|
|
45
|
+
onItemOpen: p,
|
|
46
|
+
onItemClose: s.useCallback(() => r && p(""), [r, p]),
|
|
47
|
+
children: /* @__PURE__ */ n(z, { scope: o.__scopeAccordion, collapsible: r, children: /* @__PURE__ */ n(G, { ...l, ref: c }) })
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
), fe = s.forwardRef((o, c) => {
|
|
52
|
+
const {
|
|
53
|
+
value: e,
|
|
54
|
+
defaultValue: t,
|
|
55
|
+
onValueChange: i = () => {
|
|
56
|
+
},
|
|
57
|
+
...r
|
|
58
|
+
} = o, [l, a] = M({
|
|
59
|
+
prop: e,
|
|
60
|
+
defaultProp: t ?? [],
|
|
61
|
+
onChange: i,
|
|
62
|
+
caller: d
|
|
63
|
+
}), p = s.useCallback(
|
|
64
|
+
(v) => a((u = []) => [...u, v]),
|
|
65
|
+
[a]
|
|
66
|
+
), m = s.useCallback(
|
|
67
|
+
(v) => a((u = []) => u.filter((h) => h !== v)),
|
|
68
|
+
[a]
|
|
69
|
+
);
|
|
70
|
+
return /* @__PURE__ */ n(
|
|
71
|
+
L,
|
|
72
|
+
{
|
|
73
|
+
scope: o.__scopeAccordion,
|
|
74
|
+
value: l,
|
|
75
|
+
onItemOpen: p,
|
|
76
|
+
onItemClose: m,
|
|
77
|
+
children: /* @__PURE__ */ n(z, { scope: o.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ n(G, { ...r, ref: c }) })
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}), [ue, I] = b(d), G = s.forwardRef(
|
|
81
|
+
(o, c) => {
|
|
82
|
+
const { __scopeAccordion: e, disabled: t, dir: i, orientation: r = "vertical", ...l } = o, a = s.useRef(null), p = $(a, c), m = ae(e), u = ce(i) === "ltr", h = ee(o.onKeyDown, (C) => {
|
|
83
|
+
var O;
|
|
84
|
+
if (!ie.includes(C.key)) return;
|
|
85
|
+
const Q = C.target, x = m().filter((N) => {
|
|
86
|
+
var T;
|
|
87
|
+
return !((T = N.ref.current) != null && T.disabled);
|
|
88
|
+
}), A = x.findIndex((N) => N.ref.current === Q), D = x.length;
|
|
89
|
+
if (A === -1) return;
|
|
90
|
+
C.preventDefault();
|
|
91
|
+
let f = A;
|
|
92
|
+
const _ = 0, w = D - 1, R = () => {
|
|
93
|
+
f = A + 1, f > w && (f = _);
|
|
94
|
+
}, P = () => {
|
|
95
|
+
f = A - 1, f < _ && (f = w);
|
|
96
|
+
};
|
|
97
|
+
switch (C.key) {
|
|
98
|
+
case "Home":
|
|
99
|
+
f = _;
|
|
100
|
+
break;
|
|
101
|
+
case "End":
|
|
102
|
+
f = w;
|
|
103
|
+
break;
|
|
104
|
+
case "ArrowRight":
|
|
105
|
+
r === "horizontal" && (u ? R() : P());
|
|
106
|
+
break;
|
|
107
|
+
case "ArrowDown":
|
|
108
|
+
r === "vertical" && R();
|
|
109
|
+
break;
|
|
110
|
+
case "ArrowLeft":
|
|
111
|
+
r === "horizontal" && (u ? P() : R());
|
|
112
|
+
break;
|
|
113
|
+
case "ArrowUp":
|
|
114
|
+
r === "vertical" && P();
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
const W = f % D;
|
|
118
|
+
(O = x[W].ref.current) == null || O.focus();
|
|
119
|
+
});
|
|
120
|
+
return /* @__PURE__ */ n(
|
|
121
|
+
ue,
|
|
122
|
+
{
|
|
123
|
+
scope: e,
|
|
124
|
+
disabled: t,
|
|
125
|
+
direction: i,
|
|
126
|
+
orientation: r,
|
|
127
|
+
children: /* @__PURE__ */ n(E.Slot, { scope: e, children: /* @__PURE__ */ n(
|
|
128
|
+
V.div,
|
|
129
|
+
{
|
|
130
|
+
...l,
|
|
131
|
+
"data-orientation": r,
|
|
132
|
+
ref: p,
|
|
133
|
+
onKeyDown: t ? void 0 : h
|
|
134
|
+
}
|
|
135
|
+
) })
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
), g = "AccordionItem", [me, k] = b(g), U = s.forwardRef(
|
|
140
|
+
(o, c) => {
|
|
141
|
+
const { __scopeAccordion: e, value: t, ...i } = o, r = I(g, e), l = se(g, e), a = S(e), p = ne(), m = t && l.value.includes(t) || !1, v = r.disabled || o.disabled;
|
|
142
|
+
return /* @__PURE__ */ n(
|
|
143
|
+
me,
|
|
144
|
+
{
|
|
145
|
+
scope: e,
|
|
146
|
+
open: m,
|
|
147
|
+
disabled: v,
|
|
148
|
+
triggerId: p,
|
|
149
|
+
children: /* @__PURE__ */ n(
|
|
150
|
+
re,
|
|
151
|
+
{
|
|
152
|
+
"data-orientation": r.orientation,
|
|
153
|
+
"data-state": J(m),
|
|
154
|
+
...a,
|
|
155
|
+
...i,
|
|
156
|
+
ref: c,
|
|
157
|
+
disabled: v,
|
|
158
|
+
open: m,
|
|
159
|
+
onOpenChange: (u) => {
|
|
160
|
+
u ? l.onItemOpen(t) : l.onItemClose(t);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
U.displayName = g;
|
|
169
|
+
var j = "AccordionHeader", Y = s.forwardRef(
|
|
170
|
+
(o, c) => {
|
|
171
|
+
const { __scopeAccordion: e, ...t } = o, i = I(d, e), r = k(j, e);
|
|
172
|
+
return /* @__PURE__ */ n(
|
|
173
|
+
V.h3,
|
|
174
|
+
{
|
|
175
|
+
"data-orientation": i.orientation,
|
|
176
|
+
"data-state": J(r.open),
|
|
177
|
+
"data-disabled": r.disabled ? "" : void 0,
|
|
178
|
+
...t,
|
|
179
|
+
ref: c
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
Y.displayName = j;
|
|
185
|
+
var y = "AccordionTrigger", q = s.forwardRef(
|
|
186
|
+
(o, c) => {
|
|
187
|
+
const { __scopeAccordion: e, ...t } = o, i = I(d, e), r = k(y, e), l = de(y, e), a = S(e);
|
|
188
|
+
return /* @__PURE__ */ n(E.ItemSlot, { scope: e, children: /* @__PURE__ */ n(
|
|
189
|
+
te,
|
|
190
|
+
{
|
|
191
|
+
"aria-disabled": r.open && !l.collapsible || void 0,
|
|
192
|
+
"data-orientation": i.orientation,
|
|
193
|
+
id: r.triggerId,
|
|
194
|
+
...a,
|
|
195
|
+
...t,
|
|
196
|
+
ref: c
|
|
197
|
+
}
|
|
198
|
+
) });
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
q.displayName = y;
|
|
202
|
+
var B = "AccordionContent", F = s.forwardRef(
|
|
203
|
+
(o, c) => {
|
|
204
|
+
const { __scopeAccordion: e, ...t } = o, i = I(d, e), r = k(B, e), l = S(e);
|
|
205
|
+
return /* @__PURE__ */ n(
|
|
206
|
+
oe,
|
|
207
|
+
{
|
|
208
|
+
role: "region",
|
|
209
|
+
"aria-labelledby": r.triggerId,
|
|
210
|
+
"data-orientation": i.orientation,
|
|
211
|
+
...l,
|
|
212
|
+
...t,
|
|
213
|
+
ref: c,
|
|
214
|
+
style: {
|
|
215
|
+
"--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
|
|
216
|
+
"--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
|
|
217
|
+
...o.style
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
F.displayName = B;
|
|
224
|
+
function J(o) {
|
|
225
|
+
return o ? "open" : "closed";
|
|
226
|
+
}
|
|
227
|
+
var Pe = K, Ne = U, ye = Y, Ee = q, Se = F;
|
|
228
|
+
export {
|
|
229
|
+
K as Accordion,
|
|
230
|
+
F as AccordionContent,
|
|
231
|
+
Y as AccordionHeader,
|
|
232
|
+
U as AccordionItem,
|
|
233
|
+
q as AccordionTrigger,
|
|
234
|
+
Se as Content,
|
|
235
|
+
ye as Header,
|
|
236
|
+
Ne as Item,
|
|
237
|
+
Pe as Root,
|
|
238
|
+
Ee as Trigger
|
|
239
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as p from "react";
|
|
2
|
-
import { Primitive as v } from "./
|
|
2
|
+
import { Primitive as v } from "./index98.js";
|
|
3
3
|
import { jsx as m } from "react/jsx-runtime";
|
|
4
4
|
var d = "Separator", a = "horizontal", l = ["horizontal", "vertical"], i = p.forwardRef((r, n) => {
|
|
5
5
|
const { decorative: e, orientation: t = a, ...s } = r, o = f(t) ? t : a, c = e ? { role: "none" } : { "aria-orientation": o === "vertical" ? o : void 0, role: "separator" };
|