@szum-tech/design-system 3.9.0 → 3.10.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/chunk-2WQJ36RD.cjs +78 -0
- package/dist/chunk-D4QID7AI.cjs +607 -0
- package/dist/chunk-DGWBE2Y3.cjs +205 -0
- package/dist/{chunk-XTNS5QH5.cjs → chunk-EG374TED.cjs} +52 -86
- package/dist/chunk-EUH466AL.cjs +179 -0
- package/dist/chunk-F7N6WQV6.cjs +53 -0
- package/dist/chunk-GYXQUTWZ.cjs +59 -0
- package/dist/chunk-IWF52DDE.js +55 -0
- package/dist/{chunk-PHPJ54IC.js → chunk-JLKQ6WKK.js} +48 -82
- package/dist/chunk-K5AURCK5.js +183 -0
- package/dist/chunk-OCOCENE6.js +42 -0
- package/dist/chunk-P4JIMFSL.js +51 -0
- package/dist/chunk-R65CJGEQ.js +48 -0
- package/dist/chunk-USIW3VT5.cjs +73 -0
- package/dist/chunk-WMGJCB7O.js +157 -0
- package/dist/chunk-YEFLGE3L.cjs +47 -0
- package/dist/chunk-YSYZKK24.js +575 -0
- package/dist/chunk-YUMKV5TH.js +56 -0
- package/dist/components/accordion/index.cjs +23 -0
- package/dist/components/accordion/index.d.cts +17 -0
- package/dist/components/accordion/index.d.ts +17 -0
- package/dist/components/accordion/index.js +2 -0
- package/dist/components/button/index.cjs +14 -7
- package/dist/components/button/index.js +13 -6
- package/dist/components/counting-number/index.cjs +11 -0
- package/dist/components/counting-number/index.d.cts +57 -0
- package/dist/components/counting-number/index.d.ts +57 -0
- package/dist/components/counting-number/index.js +2 -0
- package/dist/components/index.cjs +209 -106
- package/dist/components/index.d.cts +11 -2
- package/dist/components/index.d.ts +11 -2
- package/dist/components/index.js +13 -6
- package/dist/components/marquee/index.cjs +11 -0
- package/dist/components/marquee/index.d.cts +48 -0
- package/dist/components/marquee/index.d.ts +48 -0
- package/dist/components/marquee/index.js +2 -0
- package/dist/components/status/index.cjs +19 -0
- package/dist/components/status/index.d.cts +25 -0
- package/dist/components/status/index.d.ts +25 -0
- package/dist/components/status/index.js +2 -0
- package/dist/components/stepper/index.cjs +32 -25
- package/dist/components/stepper/index.d.cts +5 -4
- package/dist/components/stepper/index.d.ts +5 -4
- package/dist/components/stepper/index.js +13 -6
- package/dist/components/tabs/index.cjs +23 -0
- package/dist/components/tabs/index.d.cts +17 -0
- package/dist/components/tabs/index.d.ts +17 -0
- package/dist/components/tabs/index.js +2 -0
- package/dist/components/timeline/index.cjs +44 -0
- package/dist/components/timeline/index.d.cts +62 -0
- package/dist/components/timeline/index.d.ts +62 -0
- package/dist/components/timeline/index.js +3 -0
- package/dist/components/toaster/index.cjs +15 -8
- package/dist/components/toaster/index.js +13 -6
- package/dist/components/typing-text/index.cjs +11 -0
- package/dist/components/typing-text/index.d.cts +40 -0
- package/dist/components/typing-text/index.d.ts +40 -0
- package/dist/components/typing-text/index.js +2 -0
- package/dist/components/word-rotate/index.cjs +11 -0
- package/dist/components/word-rotate/index.d.cts +29 -0
- package/dist/components/word-rotate/index.d.ts +29 -0
- package/dist/components/word-rotate/index.js +2 -0
- package/dist/direction-CUOPDLCj.d.cts +7 -0
- package/dist/direction-CUOPDLCj.d.ts +7 -0
- package/package.json +35 -44
- package/tailwind/animation.css +23 -1
- package/tailwind/palette.css +2 -2
- package/dist/chunk-EW6TE3N5.cjs +0 -38
- package/dist/chunk-H5O5L6XT.js +0 -14
- package/dist/contexts/index.cjs +0 -18
- package/dist/contexts/index.d.cts +0 -11
- package/dist/contexts/index.d.ts +0 -11
- package/dist/contexts/index.js +0 -1
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
import { useLazyRef, useIsomorphicLayoutEffect } from './chunk-DFD2WUOU.js';
|
|
2
|
+
import { cn } from './chunk-ZD2QRAOX.js';
|
|
3
|
+
import * as React2 from 'react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
6
|
+
import { cva } from 'class-variance-authority';
|
|
7
|
+
|
|
8
|
+
var DirectionContext = React2.createContext(void 0);
|
|
9
|
+
function useDirection(localDir) {
|
|
10
|
+
const globalDir = React2.useContext(DirectionContext);
|
|
11
|
+
return localDir || globalDir || "ltr";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// src/components/timeline/timeline.constants.ts
|
|
15
|
+
var TIMELINE_ROOT_NAME = "Timeline";
|
|
16
|
+
var TIMELINE_ITEM_NAME = "TimelineItem";
|
|
17
|
+
var TIMELINE_CONTENT_NAME = "TimelineContent";
|
|
18
|
+
var TIMELINE_CONNECTOR_NAME = "TimelineConnector";
|
|
19
|
+
var TIMELINE_DOT_NAME = "TimelineDot";
|
|
20
|
+
|
|
21
|
+
// src/components/timeline/timeline.store.tsx
|
|
22
|
+
var TimelineStoreContext = React2.createContext(null);
|
|
23
|
+
function useTimelineStore(selector) {
|
|
24
|
+
const store = React2.useContext(TimelineStoreContext);
|
|
25
|
+
if (!store) {
|
|
26
|
+
throw new Error(`\`useTimelineStore\` must be used within \`${TIMELINE_ROOT_NAME}\``);
|
|
27
|
+
}
|
|
28
|
+
const getSnapshot = React2.useCallback(() => selector(store), [store, selector]);
|
|
29
|
+
return React2.useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
|
|
30
|
+
}
|
|
31
|
+
function useTimelineStoreContext(consumerName) {
|
|
32
|
+
const context = React2.useContext(TimelineStoreContext);
|
|
33
|
+
if (!context) {
|
|
34
|
+
throw new Error(`\`${consumerName}\` must be used within \`${TIMELINE_ROOT_NAME}\``);
|
|
35
|
+
}
|
|
36
|
+
return context;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// src/components/timeline/timeline.utils.ts
|
|
40
|
+
function getItemStatus(itemIndex, activeIndex) {
|
|
41
|
+
if (activeIndex === void 0) return "pending";
|
|
42
|
+
if (itemIndex < activeIndex) return "completed";
|
|
43
|
+
if (itemIndex === activeIndex) return "active";
|
|
44
|
+
return "pending";
|
|
45
|
+
}
|
|
46
|
+
function getSortedEntries(entries) {
|
|
47
|
+
return entries.sort((a, b) => {
|
|
48
|
+
const elementA = a[1].current;
|
|
49
|
+
const elementB = b[1].current;
|
|
50
|
+
if (!elementA || !elementB) return 0;
|
|
51
|
+
const position = elementA.compareDocumentPosition(elementB);
|
|
52
|
+
if (position & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
|
53
|
+
if (position & Node.DOCUMENT_POSITION_PRECEDING) return 1;
|
|
54
|
+
return 0;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
var TimelineContext = React2.createContext(null);
|
|
58
|
+
function useTimelineContext(consumerName) {
|
|
59
|
+
const context = React2.useContext(TimelineContext);
|
|
60
|
+
if (!context) {
|
|
61
|
+
throw new Error(`\`${consumerName}\` must be used within \`${TIMELINE_ROOT_NAME}\``);
|
|
62
|
+
}
|
|
63
|
+
return context;
|
|
64
|
+
}
|
|
65
|
+
var timelineVariants = cva(
|
|
66
|
+
"relative flex [--timeline-connector-thickness:0.125rem] [--timeline-dot-size:0.875rem]",
|
|
67
|
+
{
|
|
68
|
+
variants: {
|
|
69
|
+
orientation: {
|
|
70
|
+
vertical: "flex-col",
|
|
71
|
+
horizontal: "flex-row items-start"
|
|
72
|
+
},
|
|
73
|
+
variant: {
|
|
74
|
+
default: "",
|
|
75
|
+
alternate: ""
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
compoundVariants: [
|
|
79
|
+
{
|
|
80
|
+
orientation: "vertical",
|
|
81
|
+
variant: "default",
|
|
82
|
+
class: "gap-6"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
orientation: "horizontal",
|
|
86
|
+
variant: "default",
|
|
87
|
+
class: "gap-8"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
orientation: "vertical",
|
|
91
|
+
variant: "alternate",
|
|
92
|
+
class: "relative w-full gap-3"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
orientation: "horizontal",
|
|
96
|
+
variant: "alternate",
|
|
97
|
+
class: "items-center gap-4"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
defaultVariants: {
|
|
101
|
+
orientation: "vertical",
|
|
102
|
+
variant: "default"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
var timelineItemVariants = cva("relative flex", {
|
|
107
|
+
variants: {
|
|
108
|
+
orientation: {
|
|
109
|
+
vertical: "",
|
|
110
|
+
horizontal: ""
|
|
111
|
+
},
|
|
112
|
+
variant: {
|
|
113
|
+
default: "",
|
|
114
|
+
alternate: ""
|
|
115
|
+
},
|
|
116
|
+
isAlternateRight: {
|
|
117
|
+
true: "",
|
|
118
|
+
false: ""
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
compoundVariants: [
|
|
122
|
+
{
|
|
123
|
+
orientation: "vertical",
|
|
124
|
+
variant: "default",
|
|
125
|
+
class: "gap-3 pb-8 last:pb-0"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
orientation: "horizontal",
|
|
129
|
+
variant: "default",
|
|
130
|
+
class: "flex-col gap-3"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
orientation: "vertical",
|
|
134
|
+
variant: "alternate",
|
|
135
|
+
isAlternateRight: false,
|
|
136
|
+
class: "w-1/2 gap-3 pr-6 pb-12 last:pb-0"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
orientation: "vertical",
|
|
140
|
+
variant: "alternate",
|
|
141
|
+
isAlternateRight: true,
|
|
142
|
+
class: "ml-auto w-1/2 flex-row-reverse gap-3 pb-12 pl-6 last:pb-0"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
orientation: "horizontal",
|
|
146
|
+
variant: "alternate",
|
|
147
|
+
class: "grid min-w-0 grid-rows-[1fr_auto_1fr] gap-3"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
defaultVariants: {
|
|
151
|
+
orientation: "vertical",
|
|
152
|
+
variant: "default",
|
|
153
|
+
isAlternateRight: false
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
var timelineContentVariants = cva("flex-1", {
|
|
157
|
+
variants: {
|
|
158
|
+
orientation: {
|
|
159
|
+
vertical: "",
|
|
160
|
+
horizontal: ""
|
|
161
|
+
},
|
|
162
|
+
variant: {
|
|
163
|
+
default: "",
|
|
164
|
+
alternate: ""
|
|
165
|
+
},
|
|
166
|
+
isAlternateRight: {
|
|
167
|
+
true: "",
|
|
168
|
+
false: ""
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
compoundVariants: [
|
|
172
|
+
{
|
|
173
|
+
variant: "alternate",
|
|
174
|
+
orientation: "vertical",
|
|
175
|
+
isAlternateRight: false,
|
|
176
|
+
class: "text-right"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
variant: "alternate",
|
|
180
|
+
orientation: "horizontal",
|
|
181
|
+
isAlternateRight: false,
|
|
182
|
+
class: "row-start-3 pt-2"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
variant: "alternate",
|
|
186
|
+
orientation: "horizontal",
|
|
187
|
+
isAlternateRight: true,
|
|
188
|
+
class: "row-start-1 pb-2"
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
defaultVariants: {
|
|
192
|
+
orientation: "vertical",
|
|
193
|
+
variant: "default",
|
|
194
|
+
isAlternateRight: false
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
var timelineDotVariants = cva(
|
|
198
|
+
"relative z-10 flex size-(--timeline-dot-size) shrink-0 items-center justify-center rounded-full border-2 bg-background",
|
|
199
|
+
{
|
|
200
|
+
variants: {
|
|
201
|
+
status: {
|
|
202
|
+
completed: "border-primary",
|
|
203
|
+
active: "border-primary",
|
|
204
|
+
pending: "border-border"
|
|
205
|
+
},
|
|
206
|
+
orientation: {
|
|
207
|
+
vertical: "",
|
|
208
|
+
horizontal: ""
|
|
209
|
+
},
|
|
210
|
+
variant: {
|
|
211
|
+
default: "",
|
|
212
|
+
alternate: ""
|
|
213
|
+
},
|
|
214
|
+
isAlternateRight: {
|
|
215
|
+
true: "",
|
|
216
|
+
false: ""
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
compoundVariants: [
|
|
220
|
+
{
|
|
221
|
+
variant: "alternate",
|
|
222
|
+
orientation: "vertical",
|
|
223
|
+
isAlternateRight: false,
|
|
224
|
+
class: "absolute -right-[calc(var(--timeline-dot-size)/2-var(--timeline-connector-thickness)/2)] bg-background"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
variant: "alternate",
|
|
228
|
+
orientation: "vertical",
|
|
229
|
+
isAlternateRight: true,
|
|
230
|
+
class: "absolute -left-[calc(var(--timeline-dot-size)/2-var(--timeline-connector-thickness)/2)] bg-background"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
variant: "alternate",
|
|
234
|
+
orientation: "horizontal",
|
|
235
|
+
class: "row-start-2 bg-background"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
variant: "alternate",
|
|
239
|
+
status: "completed",
|
|
240
|
+
class: "bg-background"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
variant: "alternate",
|
|
244
|
+
status: "active",
|
|
245
|
+
class: "bg-background"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
defaultVariants: {
|
|
249
|
+
status: "pending",
|
|
250
|
+
orientation: "vertical",
|
|
251
|
+
variant: "default",
|
|
252
|
+
isAlternateRight: false
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
var timelineConnectorVariants = cva("absolute z-0", {
|
|
257
|
+
variants: {
|
|
258
|
+
isCompleted: {
|
|
259
|
+
true: "bg-primary",
|
|
260
|
+
false: "bg-border"
|
|
261
|
+
},
|
|
262
|
+
orientation: {
|
|
263
|
+
vertical: "",
|
|
264
|
+
horizontal: ""
|
|
265
|
+
},
|
|
266
|
+
variant: {
|
|
267
|
+
default: "",
|
|
268
|
+
alternate: ""
|
|
269
|
+
},
|
|
270
|
+
isAlternateRight: {
|
|
271
|
+
true: "",
|
|
272
|
+
false: ""
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
compoundVariants: [
|
|
276
|
+
{
|
|
277
|
+
orientation: "vertical",
|
|
278
|
+
variant: "default",
|
|
279
|
+
class: "start-[calc(var(--timeline-dot-size)/2-var(--timeline-connector-thickness)/2)] top-3 h-[calc(100%+0.5rem)] w-(--timeline-connector-thickness)"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
orientation: "horizontal",
|
|
283
|
+
variant: "default",
|
|
284
|
+
class: "start-3 top-[calc(var(--timeline-dot-size)/2-var(--timeline-connector-thickness)/2)] h-(--timeline-connector-thickness) w-[calc(100%+0.5rem)]"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
orientation: "vertical",
|
|
288
|
+
variant: "alternate",
|
|
289
|
+
isAlternateRight: false,
|
|
290
|
+
class: "top-2 -right-[calc(var(--timeline-connector-thickness)/2)] h-full w-(--timeline-connector-thickness)"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
orientation: "vertical",
|
|
294
|
+
variant: "alternate",
|
|
295
|
+
isAlternateRight: true,
|
|
296
|
+
class: "top-2 -left-[calc(var(--timeline-connector-thickness)/2)] h-full w-(--timeline-connector-thickness)"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
orientation: "horizontal",
|
|
300
|
+
variant: "alternate",
|
|
301
|
+
class: "top-[calc(var(--timeline-dot-size)/2-var(--timeline-connector-thickness)/2)] left-3 row-start-2 h-(--timeline-connector-thickness) w-[calc(100%+0.5rem)]"
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
defaultVariants: {
|
|
305
|
+
isCompleted: false,
|
|
306
|
+
orientation: "vertical",
|
|
307
|
+
variant: "default",
|
|
308
|
+
isAlternateRight: false
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
function Timeline({
|
|
312
|
+
orientation = "vertical",
|
|
313
|
+
variant = "default",
|
|
314
|
+
dir: dirProp,
|
|
315
|
+
activeIndex,
|
|
316
|
+
asChild = false,
|
|
317
|
+
className,
|
|
318
|
+
...props
|
|
319
|
+
}) {
|
|
320
|
+
const dir = useDirection(dirProp);
|
|
321
|
+
const listenersRef = useLazyRef(() => /* @__PURE__ */ new Set());
|
|
322
|
+
const stateRef = useLazyRef(() => ({
|
|
323
|
+
items: /* @__PURE__ */ new Map()
|
|
324
|
+
}));
|
|
325
|
+
const store = React2.useMemo(() => {
|
|
326
|
+
return {
|
|
327
|
+
subscribe: (cb) => {
|
|
328
|
+
listenersRef.current.add(cb);
|
|
329
|
+
return () => listenersRef.current.delete(cb);
|
|
330
|
+
},
|
|
331
|
+
getState: () => stateRef.current,
|
|
332
|
+
notify: () => {
|
|
333
|
+
for (const cb of listenersRef.current) {
|
|
334
|
+
cb();
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
onItemRegister: (id, ref) => {
|
|
338
|
+
stateRef.current.items.set(id, ref);
|
|
339
|
+
store.notify();
|
|
340
|
+
},
|
|
341
|
+
onItemUnregister: (id) => {
|
|
342
|
+
stateRef.current.items.delete(id);
|
|
343
|
+
store.notify();
|
|
344
|
+
},
|
|
345
|
+
getNextItemStatus: (id, activeIndex2) => {
|
|
346
|
+
const entries = Array.from(stateRef.current.items.entries());
|
|
347
|
+
const sortedEntries = getSortedEntries(entries);
|
|
348
|
+
const currentIndex = sortedEntries.findIndex(([key]) => key === id);
|
|
349
|
+
if (currentIndex === -1 || currentIndex === sortedEntries.length - 1) {
|
|
350
|
+
return void 0;
|
|
351
|
+
}
|
|
352
|
+
const nextItemIndex = currentIndex + 1;
|
|
353
|
+
return getItemStatus(nextItemIndex, activeIndex2);
|
|
354
|
+
},
|
|
355
|
+
getItemIndex: (id) => {
|
|
356
|
+
const entries = Array.from(stateRef.current.items.entries());
|
|
357
|
+
const sortedEntries = getSortedEntries(entries);
|
|
358
|
+
return sortedEntries.findIndex(([key]) => key === id);
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
}, [listenersRef, stateRef]);
|
|
362
|
+
const contextValue = React2.useMemo(
|
|
363
|
+
() => ({
|
|
364
|
+
dir,
|
|
365
|
+
orientation,
|
|
366
|
+
variant,
|
|
367
|
+
activeIndex
|
|
368
|
+
}),
|
|
369
|
+
[dir, orientation, variant, activeIndex]
|
|
370
|
+
);
|
|
371
|
+
const RootPrimitive = asChild ? Slot : "div";
|
|
372
|
+
return /* @__PURE__ */ jsx(TimelineStoreContext.Provider, { value: store, children: /* @__PURE__ */ jsx(TimelineContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
373
|
+
RootPrimitive,
|
|
374
|
+
{
|
|
375
|
+
role: "list",
|
|
376
|
+
"aria-orientation": orientation,
|
|
377
|
+
"data-slot": "timeline",
|
|
378
|
+
"data-orientation": orientation,
|
|
379
|
+
"data-variant": variant,
|
|
380
|
+
dir,
|
|
381
|
+
...props,
|
|
382
|
+
className: cn(timelineVariants({ orientation, variant, className }))
|
|
383
|
+
}
|
|
384
|
+
) }) });
|
|
385
|
+
}
|
|
386
|
+
function setRef(ref, value) {
|
|
387
|
+
if (typeof ref === "function") {
|
|
388
|
+
return ref(value);
|
|
389
|
+
} else if (ref !== null && ref !== void 0) {
|
|
390
|
+
ref.current = value;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
function composeRefs(...refs) {
|
|
394
|
+
return (node) => {
|
|
395
|
+
let hasCleanup = false;
|
|
396
|
+
const cleanups = refs.map((ref) => {
|
|
397
|
+
const cleanup = setRef(ref, node);
|
|
398
|
+
if (!hasCleanup && typeof cleanup == "function") {
|
|
399
|
+
hasCleanup = true;
|
|
400
|
+
}
|
|
401
|
+
return cleanup;
|
|
402
|
+
});
|
|
403
|
+
if (hasCleanup) {
|
|
404
|
+
return () => {
|
|
405
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
406
|
+
const cleanup = cleanups[i];
|
|
407
|
+
if (typeof cleanup == "function") {
|
|
408
|
+
cleanup();
|
|
409
|
+
} else {
|
|
410
|
+
setRef(refs[i], null);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
function useComposedRefs(...refs) {
|
|
418
|
+
return React2.useCallback(composeRefs(...refs), refs);
|
|
419
|
+
}
|
|
420
|
+
var TimelineItemContext = React2.createContext(null);
|
|
421
|
+
function useTimelineItemContext(consumerName) {
|
|
422
|
+
const context = React2.useContext(TimelineItemContext);
|
|
423
|
+
if (!context) {
|
|
424
|
+
throw new Error(`\`${consumerName}\` must be used within \`${TIMELINE_ITEM_NAME}\``);
|
|
425
|
+
}
|
|
426
|
+
return context;
|
|
427
|
+
}
|
|
428
|
+
function TimelineItem({ asChild = false, className, id, ref, ...props }) {
|
|
429
|
+
const { dir, orientation, variant, activeIndex } = useTimelineContext(TIMELINE_ITEM_NAME);
|
|
430
|
+
const store = useTimelineStoreContext(TIMELINE_ITEM_NAME);
|
|
431
|
+
const instanceId = React2.useId();
|
|
432
|
+
const itemId = id ?? instanceId;
|
|
433
|
+
const itemRef = React2.useRef(null);
|
|
434
|
+
const composedRef = useComposedRefs(ref, itemRef);
|
|
435
|
+
const itemIndex = useTimelineStore((state) => state.getItemIndex(itemId));
|
|
436
|
+
const status = React2.useMemo(
|
|
437
|
+
function() {
|
|
438
|
+
return itemIndex < 0 ? "pending" : getItemStatus(itemIndex, activeIndex);
|
|
439
|
+
},
|
|
440
|
+
[activeIndex, itemIndex]
|
|
441
|
+
);
|
|
442
|
+
useIsomorphicLayoutEffect(() => {
|
|
443
|
+
store.onItemRegister(itemId, itemRef);
|
|
444
|
+
return () => {
|
|
445
|
+
store.onItemUnregister(itemId);
|
|
446
|
+
};
|
|
447
|
+
}, [id, store]);
|
|
448
|
+
const isAlternateRight = variant === "alternate" && itemIndex % 2 === 1;
|
|
449
|
+
const itemContextValue = React2.useMemo(
|
|
450
|
+
() => ({ id: itemId, status, isAlternateRight }),
|
|
451
|
+
[itemId, status, isAlternateRight]
|
|
452
|
+
);
|
|
453
|
+
const ItemPrimitive = asChild ? Slot : "div";
|
|
454
|
+
return /* @__PURE__ */ jsx(TimelineItemContext.Provider, { value: itemContextValue, children: /* @__PURE__ */ jsx(
|
|
455
|
+
ItemPrimitive,
|
|
456
|
+
{
|
|
457
|
+
role: "listitem",
|
|
458
|
+
"aria-current": status === "active" ? "step" : void 0,
|
|
459
|
+
"data-slot": "timeline-item",
|
|
460
|
+
"data-status": status,
|
|
461
|
+
"data-orientation": orientation,
|
|
462
|
+
"data-alternate-right": isAlternateRight ? "" : void 0,
|
|
463
|
+
id: itemId,
|
|
464
|
+
dir,
|
|
465
|
+
...props,
|
|
466
|
+
ref: composedRef,
|
|
467
|
+
className: cn(
|
|
468
|
+
timelineItemVariants({
|
|
469
|
+
orientation,
|
|
470
|
+
variant,
|
|
471
|
+
isAlternateRight,
|
|
472
|
+
className
|
|
473
|
+
})
|
|
474
|
+
)
|
|
475
|
+
}
|
|
476
|
+
) });
|
|
477
|
+
}
|
|
478
|
+
function TimelineContent({ asChild = false, className, ...props }) {
|
|
479
|
+
const { variant, orientation } = useTimelineContext(TIMELINE_CONTENT_NAME);
|
|
480
|
+
const { status, isAlternateRight } = useTimelineItemContext(TIMELINE_CONTENT_NAME);
|
|
481
|
+
const ContentPrimitive = asChild ? Slot : "div";
|
|
482
|
+
return /* @__PURE__ */ jsx(
|
|
483
|
+
ContentPrimitive,
|
|
484
|
+
{
|
|
485
|
+
"data-slot": "timeline-content",
|
|
486
|
+
"data-status": status,
|
|
487
|
+
...props,
|
|
488
|
+
className: cn(
|
|
489
|
+
timelineContentVariants({
|
|
490
|
+
orientation,
|
|
491
|
+
variant,
|
|
492
|
+
isAlternateRight,
|
|
493
|
+
className
|
|
494
|
+
})
|
|
495
|
+
)
|
|
496
|
+
}
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
function TimelineDot({ asChild = false, className, ...props }) {
|
|
500
|
+
const { orientation, variant } = useTimelineContext(TIMELINE_DOT_NAME);
|
|
501
|
+
const { status, isAlternateRight } = useTimelineItemContext(TIMELINE_DOT_NAME);
|
|
502
|
+
const DotPrimitive = asChild ? Slot : "div";
|
|
503
|
+
return /* @__PURE__ */ jsx(
|
|
504
|
+
DotPrimitive,
|
|
505
|
+
{
|
|
506
|
+
"data-slot": "timeline-dot",
|
|
507
|
+
"data-status": status,
|
|
508
|
+
"data-orientation": orientation,
|
|
509
|
+
...props,
|
|
510
|
+
className: cn(
|
|
511
|
+
timelineDotVariants({
|
|
512
|
+
status,
|
|
513
|
+
orientation,
|
|
514
|
+
variant,
|
|
515
|
+
isAlternateRight,
|
|
516
|
+
className
|
|
517
|
+
})
|
|
518
|
+
)
|
|
519
|
+
}
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
function TimelineConnector({ asChild = false, forceMount, className, ...props }) {
|
|
523
|
+
const { orientation, variant, activeIndex } = useTimelineContext(TIMELINE_CONNECTOR_NAME);
|
|
524
|
+
const { id, status, isAlternateRight } = useTimelineItemContext(TIMELINE_CONNECTOR_NAME);
|
|
525
|
+
const nextItemStatus = useTimelineStore((state) => state.getNextItemStatus(id, activeIndex));
|
|
526
|
+
const isLastItem = nextItemStatus === void 0;
|
|
527
|
+
if (!forceMount && isLastItem) return null;
|
|
528
|
+
const isConnectorCompleted = nextItemStatus === "completed" || nextItemStatus === "active";
|
|
529
|
+
const ConnectorPrimitive = asChild ? Slot : "div";
|
|
530
|
+
return /* @__PURE__ */ jsx(
|
|
531
|
+
ConnectorPrimitive,
|
|
532
|
+
{
|
|
533
|
+
"aria-hidden": "true",
|
|
534
|
+
"data-slot": "timeline-connector",
|
|
535
|
+
"data-completed": isConnectorCompleted ? "" : void 0,
|
|
536
|
+
"data-status": status,
|
|
537
|
+
"data-orientation": orientation,
|
|
538
|
+
...props,
|
|
539
|
+
className: cn(
|
|
540
|
+
timelineConnectorVariants({
|
|
541
|
+
isCompleted: isConnectorCompleted,
|
|
542
|
+
orientation,
|
|
543
|
+
variant,
|
|
544
|
+
isAlternateRight,
|
|
545
|
+
className
|
|
546
|
+
})
|
|
547
|
+
)
|
|
548
|
+
}
|
|
549
|
+
);
|
|
550
|
+
}
|
|
551
|
+
function TimelineHeader({ asChild, className, ...props }) {
|
|
552
|
+
const HeaderPrimitive = asChild ? Slot : "div";
|
|
553
|
+
return /* @__PURE__ */ jsx(HeaderPrimitive, { "data-slot": "timeline-header", className: cn("flex flex-col gap-1", className), ...props });
|
|
554
|
+
}
|
|
555
|
+
function TimelineTitle({ asChild = false, className, ...props }) {
|
|
556
|
+
const TitlePrimitive = asChild ? Slot : "div";
|
|
557
|
+
return /* @__PURE__ */ jsx(TitlePrimitive, { "data-slot": "timeline-title", className: cn("leading-none font-semibold", className), ...props });
|
|
558
|
+
}
|
|
559
|
+
function TimelineDescription({ asChild = false, className, ...props }) {
|
|
560
|
+
const DescriptionPrimitive = asChild ? Slot : "div";
|
|
561
|
+
return /* @__PURE__ */ jsx(
|
|
562
|
+
DescriptionPrimitive,
|
|
563
|
+
{
|
|
564
|
+
"data-slot": "timeline-description",
|
|
565
|
+
...props,
|
|
566
|
+
className: cn("text-muted-foreground text-sm", className)
|
|
567
|
+
}
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
function TimelineTime({ asChild = false, className, ...props }) {
|
|
571
|
+
const TimePrimitive = asChild ? Slot : "time";
|
|
572
|
+
return /* @__PURE__ */ jsx(TimePrimitive, { "data-slot": "timeline-time", className: cn("text-muted-foreground text-xs", className), ...props });
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
export { Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineDot, TimelineHeader, TimelineItem, TimelineTime, TimelineTitle, useComposedRefs, useDirection };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn } from './chunk-ZD2QRAOX.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function Marquee({
|
|
6
|
+
className,
|
|
7
|
+
reverse = false,
|
|
8
|
+
pauseOnHover = false,
|
|
9
|
+
children,
|
|
10
|
+
vertical = false,
|
|
11
|
+
repeat = 4,
|
|
12
|
+
ariaLabel,
|
|
13
|
+
ariaLive = "off",
|
|
14
|
+
ariaRole = "region",
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
const marqueeRef = React.useRef(null);
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
...props,
|
|
22
|
+
ref: marqueeRef,
|
|
23
|
+
"data-slot": "marquee",
|
|
24
|
+
className: cn(
|
|
25
|
+
"group flex gap-(--gap) overflow-hidden p-2 [--duration:40s] [--gap:1rem]",
|
|
26
|
+
{
|
|
27
|
+
"flex-row": !vertical,
|
|
28
|
+
"flex-col": vertical
|
|
29
|
+
},
|
|
30
|
+
className
|
|
31
|
+
),
|
|
32
|
+
"aria-label": ariaLabel,
|
|
33
|
+
"aria-live": ariaLive,
|
|
34
|
+
role: ariaRole,
|
|
35
|
+
tabIndex: 0,
|
|
36
|
+
children: React.useMemo(
|
|
37
|
+
() => /* @__PURE__ */ jsx(Fragment, { children: Array.from({ length: repeat }, (_, i) => /* @__PURE__ */ jsx(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: cn(
|
|
41
|
+
"flex shrink-0 justify-around gap-(--gap)",
|
|
42
|
+
!vertical ? "animate-marquee flex-row" : "animate-marquee-vertical flex-col",
|
|
43
|
+
pauseOnHover && "group-hover:paused",
|
|
44
|
+
reverse && "direction-reverse"
|
|
45
|
+
),
|
|
46
|
+
children
|
|
47
|
+
},
|
|
48
|
+
i
|
|
49
|
+
)) }),
|
|
50
|
+
[repeat, children, vertical, pauseOnHover, reverse]
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { Marquee };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkF7N6WQV6_cjs = require('../../chunk-F7N6WQV6.cjs');
|
|
4
|
+
require('../../chunk-H2BWO3SI.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "Accordion", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkF7N6WQV6_cjs.Accordion; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "AccordionContent", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkF7N6WQV6_cjs.AccordionContent; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "AccordionItem", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunkF7N6WQV6_cjs.AccordionItem; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "AccordionTrigger", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunkF7N6WQV6_cjs.AccordionTrigger; }
|
|
23
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Accordion as Accordion$1 } from 'radix-ui';
|
|
4
|
+
|
|
5
|
+
type AccordionProps = React.ComponentProps<typeof Accordion$1.Root>;
|
|
6
|
+
declare function Accordion({ ...props }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
7
|
+
|
|
8
|
+
type AccordionContentProps = React.ComponentProps<typeof Accordion$1.Content>;
|
|
9
|
+
declare function AccordionContent({ className, children, ...props }: AccordionContentProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
|
|
11
|
+
type AccordionTriggerProps = React.ComponentProps<typeof Accordion$1.Trigger>;
|
|
12
|
+
declare function AccordionTrigger({ className, children, ...props }: AccordionTriggerProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
type AccordionItemProps = React.ComponentProps<typeof Accordion$1.Item>;
|
|
15
|
+
declare function AccordionItem({ className, ...props }: AccordionItemProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Accordion as Accordion$1 } from 'radix-ui';
|
|
4
|
+
|
|
5
|
+
type AccordionProps = React.ComponentProps<typeof Accordion$1.Root>;
|
|
6
|
+
declare function Accordion({ ...props }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
7
|
+
|
|
8
|
+
type AccordionContentProps = React.ComponentProps<typeof Accordion$1.Content>;
|
|
9
|
+
declare function AccordionContent({ className, children, ...props }: AccordionContentProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
|
|
11
|
+
type AccordionTriggerProps = React.ComponentProps<typeof Accordion$1.Trigger>;
|
|
12
|
+
declare function AccordionTrigger({ className, children, ...props }: AccordionTriggerProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
type AccordionItemProps = React.ComponentProps<typeof Accordion$1.Item>;
|
|
15
|
+
declare function AccordionItem({ className, ...props }: AccordionItemProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps };
|