@szum-tech/design-system 3.8.1 → 3.10.0
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-O3DHBQA5.cjs → chunk-3GNVQFCK.cjs} +1 -1
- package/dist/{chunk-SYKUS2RV.js → chunk-3MH6P44N.js} +2 -2
- package/dist/{chunk-3BLXG7ET.js → chunk-3RK5PCIC.js} +1 -1
- package/dist/{chunk-2Q2BIWBE.js → chunk-5MV54MWS.js} +1 -1
- package/dist/{chunk-YWG7TML6.cjs → chunk-6X26XC6P.cjs} +1 -1
- package/dist/chunk-A7SBXO2Y.cjs +40 -0
- package/dist/{chunk-ACJ3ES2B.js → chunk-BTSHACKG.js} +1 -1
- package/dist/{chunk-3DUJHGXE.cjs → chunk-CFJ44JVK.cjs} +1 -1
- package/dist/chunk-D4QID7AI.cjs +607 -0
- package/dist/chunk-DGWBE2Y3.cjs +205 -0
- package/dist/{chunk-Q5ONG5HB.cjs → chunk-DTYX7CYN.cjs} +2 -2
- package/dist/{chunk-3Z3GVXXN.cjs → chunk-EG374TED.cjs} +57 -89
- 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-SZ3LC2VO.js → chunk-JLKQ6WKK.js} +53 -85
- package/dist/chunk-K5AURCK5.js +183 -0
- package/dist/{chunk-XV3AQ6NS.js → chunk-KGGCA634.js} +1 -1
- package/dist/chunk-OCOCENE6.js +42 -0
- package/dist/chunk-R65CJGEQ.js +48 -0
- package/dist/chunk-TKZOB6C3.cjs +70 -0
- package/dist/{chunk-FKCWRNWB.js → chunk-U3QKV7I4.js} +1 -1
- package/dist/chunk-U7XZJQ4O.js +36 -0
- package/dist/{chunk-X55H6LRX.cjs → chunk-ULEEQ723.cjs} +1 -1
- package/dist/{chunk-BAWVLSRF.cjs → chunk-VK5EX3OG.cjs} +1 -1
- package/dist/{chunk-UW6GOD7J.js → chunk-VT5GDGZJ.js} +1 -1
- package/dist/chunk-WMGJCB7O.js +157 -0
- package/dist/chunk-YEFLGE3L.cjs +47 -0
- package/dist/chunk-YQ6J6VOI.js +48 -0
- package/dist/chunk-YSYZKK24.js +575 -0
- package/dist/chunk-YUMKV5TH.js +56 -0
- package/dist/{chunk-Z6CZAPVG.cjs → chunk-ZVF7J4EI.cjs} +1 -1
- 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/alert/index.cjs +4 -4
- package/dist/components/alert/index.js +1 -1
- package/dist/components/badge/index.cjs +4 -4
- package/dist/components/badge/index.js +1 -1
- package/dist/components/button/index.cjs +23 -16
- package/dist/components/button/index.js +22 -15
- package/dist/components/color-swatch/index.cjs +2 -2
- package/dist/components/color-swatch/index.js +1 -1
- package/dist/components/counting-number/index.cjs +11 -0
- package/dist/components/counting-number/index.d.cts +18 -0
- package/dist/components/counting-number/index.d.ts +18 -0
- package/dist/components/counting-number/index.js +2 -0
- package/dist/components/dialog/index.cjs +9 -9
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/field/index.cjs +11 -11
- package/dist/components/field/index.js +1 -1
- package/dist/components/header/index.cjs +2 -2
- package/dist/components/header/index.js +1 -1
- package/dist/components/index.cjs +251 -144
- package/dist/components/index.d.cts +12 -3
- package/dist/components/index.d.ts +12 -3
- package/dist/components/index.js +22 -15
- package/dist/components/item/index.cjs +11 -11
- package/dist/components/item/index.js +1 -1
- 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 +41 -34
- package/dist/components/stepper/index.d.cts +5 -4
- package/dist/components/stepper/index.d.ts +5 -4
- package/dist/components/stepper/index.js +22 -15
- 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 +24 -17
- package/dist/components/toaster/index.js +22 -15
- package/dist/components/tooltip/index.cjs +9 -4
- package/dist/components/tooltip/index.d.cts +8 -12
- package/dist/components/tooltip/index.d.ts +8 -12
- package/dist/components/tooltip/index.js +2 -1
- 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 +37 -49
- package/tailwind/animation.css +23 -1
- package/tailwind/global.css +5 -0
- package/tailwind/palette.css +2 -2
- package/dist/chunk-EW6TE3N5.cjs +0 -38
- package/dist/chunk-GR37JJQK.cjs +0 -43
- package/dist/chunk-H5O5L6XT.js +0 -14
- package/dist/chunk-HJJPEVIH.js +0 -40
- 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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { useDirection, useComposedRefs } from './chunk-YSYZKK24.js';
|
|
1
2
|
import { Spinner } from './chunk-P5IUC7HJ.js';
|
|
2
|
-
import { useDirection, Direction } from './chunk-H5O5L6XT.js';
|
|
3
3
|
import { useLazyRef, useIsomorphicLayoutEffect } from './chunk-DFD2WUOU.js';
|
|
4
4
|
import { cn } from './chunk-ZD2QRAOX.js';
|
|
5
|
-
import * as
|
|
5
|
+
import * as React5 from 'react';
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
import { OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon } from 'lucide-react';
|
|
@@ -36,9 +36,9 @@ var STEPPER_MAP_KEY_TO_FOCUS_INTENT = {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
// src/components/stepper/stepper.context.tsx
|
|
39
|
-
var StepperContext =
|
|
39
|
+
var StepperContext = React5.createContext(null);
|
|
40
40
|
function useStepperContext(consumerName) {
|
|
41
|
-
const context =
|
|
41
|
+
const context = React5.useContext(StepperContext);
|
|
42
42
|
if (!context) {
|
|
43
43
|
throw new Error(`\`${consumerName}\` must be used within \`${STEPPER_ROOT_NAME}\``);
|
|
44
44
|
}
|
|
@@ -128,9 +128,9 @@ function createStepperStore(listenersRef, stateRef, onValueChange, onValueComple
|
|
|
128
128
|
};
|
|
129
129
|
return store;
|
|
130
130
|
}
|
|
131
|
-
var StepperStoreContext =
|
|
131
|
+
var StepperStoreContext = React5.createContext(null);
|
|
132
132
|
function useStepperStoreContext(consumerName) {
|
|
133
|
-
const context =
|
|
133
|
+
const context = React5.useContext(StepperStoreContext);
|
|
134
134
|
if (!context) {
|
|
135
135
|
throw new Error(`\`${consumerName}\` must be used within \`${STEPPER_ROOT_NAME}\``);
|
|
136
136
|
}
|
|
@@ -138,8 +138,8 @@ function useStepperStoreContext(consumerName) {
|
|
|
138
138
|
}
|
|
139
139
|
function useStepperStore(selector) {
|
|
140
140
|
const store = useStepperStoreContext("useStore");
|
|
141
|
-
const getSnapshot =
|
|
142
|
-
return
|
|
141
|
+
const getSnapshot = React5.useCallback(() => selector(store.getState()), [selector, store]);
|
|
142
|
+
return React5.useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
|
|
143
143
|
}
|
|
144
144
|
function Stepper({
|
|
145
145
|
value,
|
|
@@ -161,14 +161,14 @@ function Stepper({
|
|
|
161
161
|
indicators = {},
|
|
162
162
|
...rootProps
|
|
163
163
|
}) {
|
|
164
|
-
const id =
|
|
164
|
+
const id = React5.useId();
|
|
165
165
|
const rootId = idProp ?? id;
|
|
166
166
|
const listenersRef = useLazyRef(() => /* @__PURE__ */ new Set());
|
|
167
167
|
const stateRef = useLazyRef(() => ({
|
|
168
168
|
steps: /* @__PURE__ */ new Map(),
|
|
169
169
|
value: value ?? defaultValue
|
|
170
170
|
}));
|
|
171
|
-
const store =
|
|
171
|
+
const store = React5.useMemo(
|
|
172
172
|
() => createStepperStore(listenersRef, stateRef, onValueChange, onValueComplete, onValueAdd, onValueRemove, onValidate),
|
|
173
173
|
[listenersRef, stateRef, onValueChange, onValueComplete, onValueAdd, onValueRemove, onValidate]
|
|
174
174
|
);
|
|
@@ -178,7 +178,7 @@ function Stepper({
|
|
|
178
178
|
}
|
|
179
179
|
}, [value]);
|
|
180
180
|
const dir = useDirection(dirProp);
|
|
181
|
-
const contextValue =
|
|
181
|
+
const contextValue = React5.useMemo(
|
|
182
182
|
() => ({
|
|
183
183
|
id: rootId,
|
|
184
184
|
dir,
|
|
@@ -230,48 +230,14 @@ var StepperDataState = {
|
|
|
230
230
|
ACTIVE: "active",
|
|
231
231
|
COMPLETED: "completed"
|
|
232
232
|
};
|
|
233
|
-
var StepperFocusContext =
|
|
233
|
+
var StepperFocusContext = React5.createContext(null);
|
|
234
234
|
function useStepperFocusContext(consumerName) {
|
|
235
|
-
const context =
|
|
235
|
+
const context = React5.useContext(StepperFocusContext);
|
|
236
236
|
if (!context) {
|
|
237
237
|
throw new Error(`\`${consumerName}\` must be used within \`FocusProvider\``);
|
|
238
238
|
}
|
|
239
239
|
return context;
|
|
240
240
|
}
|
|
241
|
-
function setRef(ref, value) {
|
|
242
|
-
if (typeof ref === "function") {
|
|
243
|
-
return ref(value);
|
|
244
|
-
} else if (ref !== null && ref !== void 0) {
|
|
245
|
-
ref.current = value;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
function composeRefs(...refs) {
|
|
249
|
-
return (node) => {
|
|
250
|
-
let hasCleanup = false;
|
|
251
|
-
const cleanups = refs.map((ref) => {
|
|
252
|
-
const cleanup = setRef(ref, node);
|
|
253
|
-
if (!hasCleanup && typeof cleanup == "function") {
|
|
254
|
-
hasCleanup = true;
|
|
255
|
-
}
|
|
256
|
-
return cleanup;
|
|
257
|
-
});
|
|
258
|
-
if (hasCleanup) {
|
|
259
|
-
return () => {
|
|
260
|
-
for (let i = 0; i < cleanups.length; i++) {
|
|
261
|
-
const cleanup = cleanups[i];
|
|
262
|
-
if (typeof cleanup == "function") {
|
|
263
|
-
cleanup();
|
|
264
|
-
} else {
|
|
265
|
-
setRef(refs[i], null);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
function useComposedRefs(...refs) {
|
|
273
|
-
return React6.useCallback(composeRefs(...refs), refs);
|
|
274
|
-
}
|
|
275
241
|
|
|
276
242
|
// src/components/stepper/stepper.utils.tsx
|
|
277
243
|
function focusFirst(candidates, preventScroll = false) {
|
|
@@ -308,7 +274,7 @@ function wrapArray(array, startIndex) {
|
|
|
308
274
|
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
309
275
|
}
|
|
310
276
|
function getDirectionAwareKey(key, dir) {
|
|
311
|
-
if (dir !==
|
|
277
|
+
if (dir !== "rtl") return key;
|
|
312
278
|
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
313
279
|
}
|
|
314
280
|
function getFocusIntent(event, dir, orientation) {
|
|
@@ -321,32 +287,32 @@ function StepperNav({ className, children, asChild, ref, ...listProps }) {
|
|
|
321
287
|
const context = useStepperContext(STEPPER_NAV_NAME);
|
|
322
288
|
const orientation = context.orientation;
|
|
323
289
|
const currentValue = useStepperStore((state) => state.value);
|
|
324
|
-
const [tabStopId, setTabStopId] =
|
|
325
|
-
const [isTabbingBackOut, setIsTabbingBackOut] =
|
|
326
|
-
const [focusableItemCount, setFocusableItemCount] =
|
|
327
|
-
const isClickFocusRef =
|
|
328
|
-
const itemsRef =
|
|
329
|
-
const listRef =
|
|
290
|
+
const [tabStopId, setTabStopId] = React5.useState(null);
|
|
291
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React5.useState(false);
|
|
292
|
+
const [focusableItemCount, setFocusableItemCount] = React5.useState(0);
|
|
293
|
+
const isClickFocusRef = React5.useRef(false);
|
|
294
|
+
const itemsRef = React5.useRef(/* @__PURE__ */ new Map());
|
|
295
|
+
const listRef = React5.useRef(null);
|
|
330
296
|
const composedRef = useComposedRefs(ref, listRef);
|
|
331
|
-
const onItemFocus =
|
|
297
|
+
const onItemFocus = React5.useCallback((tabStopId2) => {
|
|
332
298
|
setTabStopId(tabStopId2);
|
|
333
299
|
}, []);
|
|
334
|
-
const onItemShiftTab =
|
|
300
|
+
const onItemShiftTab = React5.useCallback(() => {
|
|
335
301
|
setIsTabbingBackOut(true);
|
|
336
302
|
}, []);
|
|
337
|
-
const onFocusableItemAdd =
|
|
303
|
+
const onFocusableItemAdd = React5.useCallback(() => {
|
|
338
304
|
setFocusableItemCount((prevCount) => prevCount + 1);
|
|
339
305
|
}, []);
|
|
340
|
-
const onFocusableItemRemove =
|
|
306
|
+
const onFocusableItemRemove = React5.useCallback(() => {
|
|
341
307
|
setFocusableItemCount((prevCount) => prevCount - 1);
|
|
342
308
|
}, []);
|
|
343
|
-
const onItemRegister =
|
|
309
|
+
const onItemRegister = React5.useCallback((item) => {
|
|
344
310
|
itemsRef.current.set(item.id, item);
|
|
345
311
|
}, []);
|
|
346
|
-
const onItemUnregister =
|
|
312
|
+
const onItemUnregister = React5.useCallback((id) => {
|
|
347
313
|
itemsRef.current.delete(id);
|
|
348
314
|
}, []);
|
|
349
|
-
const getItems =
|
|
315
|
+
const getItems = React5.useCallback(() => {
|
|
350
316
|
return Array.from(itemsRef.current.values()).filter((item) => item.ref.current).sort((a, b) => {
|
|
351
317
|
const elementA = a.ref.current;
|
|
352
318
|
const elementB = b.ref.current;
|
|
@@ -361,15 +327,16 @@ function StepperNav({ className, children, asChild, ref, ...listProps }) {
|
|
|
361
327
|
return 0;
|
|
362
328
|
});
|
|
363
329
|
}, []);
|
|
364
|
-
const onBlur =
|
|
330
|
+
const onBlur = React5.useCallback(
|
|
365
331
|
(event) => {
|
|
366
332
|
listProps.onBlur?.(event);
|
|
367
333
|
if (event.defaultPrevented) return;
|
|
368
334
|
setIsTabbingBackOut(false);
|
|
369
335
|
},
|
|
336
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
370
337
|
[listProps.onBlur]
|
|
371
338
|
);
|
|
372
|
-
const onFocus =
|
|
339
|
+
const onFocus = React5.useCallback(
|
|
373
340
|
(event) => {
|
|
374
341
|
listProps.onFocus?.(event);
|
|
375
342
|
if (event.defaultPrevented) return;
|
|
@@ -394,7 +361,7 @@ function StepperNav({ className, children, asChild, ref, ...listProps }) {
|
|
|
394
361
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
395
362
|
[listProps.onFocus, isTabbingBackOut, currentValue, tabStopId]
|
|
396
363
|
);
|
|
397
|
-
const onMouseDown =
|
|
364
|
+
const onMouseDown = React5.useCallback(
|
|
398
365
|
(event) => {
|
|
399
366
|
listProps.onMouseDown?.(event);
|
|
400
367
|
if (event.defaultPrevented) return;
|
|
@@ -403,7 +370,7 @@ function StepperNav({ className, children, asChild, ref, ...listProps }) {
|
|
|
403
370
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
404
371
|
[listProps.onMouseDown]
|
|
405
372
|
);
|
|
406
|
-
const focusContextValue =
|
|
373
|
+
const focusContextValue = React5.useMemo(
|
|
407
374
|
() => ({
|
|
408
375
|
tabStopId,
|
|
409
376
|
onItemFocus,
|
|
@@ -449,9 +416,9 @@ function StepperNav({ className, children, asChild, ref, ...listProps }) {
|
|
|
449
416
|
}
|
|
450
417
|
) });
|
|
451
418
|
}
|
|
452
|
-
var StepperItemContext =
|
|
419
|
+
var StepperItemContext = React5.createContext(null);
|
|
453
420
|
function useStepperItemContext(consumerName) {
|
|
454
|
-
const context =
|
|
421
|
+
const context = React5.useContext(StepperItemContext);
|
|
455
422
|
if (!context) {
|
|
456
423
|
throw new Error(`\`${consumerName}\` must be used within \`${STEPPER_ITEM_NAME}\``);
|
|
457
424
|
}
|
|
@@ -482,7 +449,7 @@ function StepperItem({
|
|
|
482
449
|
const stepState = useStepperStore((state) => state.steps.get(itemValue));
|
|
483
450
|
const steps = useStepperStore((state) => state.steps);
|
|
484
451
|
const dataState = getDataState(value, itemValue, stepState, steps);
|
|
485
|
-
const itemContextValue =
|
|
452
|
+
const itemContextValue = React5.useMemo(
|
|
486
453
|
() => ({
|
|
487
454
|
value: itemValue,
|
|
488
455
|
stepState
|
|
@@ -544,11 +511,11 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
|
|
|
544
511
|
const isActive = value === itemValue;
|
|
545
512
|
const isTabStop = focusContext.tabStopId === triggerId;
|
|
546
513
|
const dataState = getDataState(value, itemValue, stepState, steps);
|
|
547
|
-
const triggerRef =
|
|
514
|
+
const triggerRef = React5.useRef(null);
|
|
548
515
|
const composedRef = useComposedRefs(ref, triggerRef);
|
|
549
|
-
const isArrowKeyPressedRef =
|
|
550
|
-
const isMouseClickRef =
|
|
551
|
-
|
|
516
|
+
const isArrowKeyPressedRef = React5.useRef(false);
|
|
517
|
+
const isMouseClickRef = React5.useRef(false);
|
|
518
|
+
React5.useEffect(() => {
|
|
552
519
|
function onKeyDown2(event) {
|
|
553
520
|
if (STEPPER_ARROW_KEYS.includes(event.key)) {
|
|
554
521
|
isArrowKeyPressedRef.current = true;
|
|
@@ -582,7 +549,7 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
|
|
|
582
549
|
}
|
|
583
550
|
};
|
|
584
551
|
}, [focusContext, triggerId, itemValue, isTabStop, isDisabled]);
|
|
585
|
-
const onClick =
|
|
552
|
+
const onClick = React5.useCallback(
|
|
586
553
|
async (event) => {
|
|
587
554
|
triggerProps.onClick?.(event);
|
|
588
555
|
if (event.defaultPrevented) return;
|
|
@@ -596,7 +563,7 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
|
|
|
596
563
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
597
564
|
[isDisabled, context.nonInteractive, store, itemValue, value, steps, triggerProps.onClick]
|
|
598
565
|
);
|
|
599
|
-
const onFocus =
|
|
566
|
+
const onFocus = React5.useCallback(
|
|
600
567
|
async (event) => {
|
|
601
568
|
triggerProps.onFocus?.(event);
|
|
602
569
|
if (event.defaultPrevented) return;
|
|
@@ -624,7 +591,7 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
|
|
|
624
591
|
store
|
|
625
592
|
]
|
|
626
593
|
);
|
|
627
|
-
const onKeyDown =
|
|
594
|
+
const onKeyDown = React5.useCallback(
|
|
628
595
|
async (event) => {
|
|
629
596
|
triggerProps.onKeyDown?.(event);
|
|
630
597
|
if (event.defaultPrevented) return;
|
|
@@ -678,6 +645,7 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
|
|
|
678
645
|
queueMicrotask(() => focusFirst(candidateRefs));
|
|
679
646
|
}
|
|
680
647
|
},
|
|
648
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
681
649
|
[
|
|
682
650
|
focusContext,
|
|
683
651
|
context.nonInteractive,
|
|
@@ -693,7 +661,7 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
|
|
|
693
661
|
steps
|
|
694
662
|
]
|
|
695
663
|
);
|
|
696
|
-
const onMouseDown =
|
|
664
|
+
const onMouseDown = React5.useCallback(
|
|
697
665
|
(event) => {
|
|
698
666
|
triggerProps.onMouseDown?.(event);
|
|
699
667
|
if (event.defaultPrevented) {
|
|
@@ -854,7 +822,7 @@ function StepperNextTrigger({ asChild = false, onClick, disabled, ...props }) {
|
|
|
854
822
|
const stepKeys = Array.from(steps.keys());
|
|
855
823
|
const currentIndex = value ? stepKeys.indexOf(value) : -1;
|
|
856
824
|
const isDisabled = disabled || currentIndex >= stepKeys.length - 1;
|
|
857
|
-
const handleClick =
|
|
825
|
+
const handleClick = React5.useCallback(
|
|
858
826
|
async (event) => {
|
|
859
827
|
onClick?.(event);
|
|
860
828
|
if (event.defaultPrevented || isDisabled) {
|
|
@@ -887,7 +855,7 @@ function StepperPrevTrigger({ asChild = false, disabled, onClick, ...props }) {
|
|
|
887
855
|
const stepKeys = Array.from(steps.keys());
|
|
888
856
|
const currentIndex = value ? stepKeys.indexOf(value) : -1;
|
|
889
857
|
const isDisabled = disabled || currentIndex <= 0;
|
|
890
|
-
const handleClick =
|
|
858
|
+
const handleClick = React5.useCallback(
|
|
891
859
|
async (event) => {
|
|
892
860
|
onClick?.(event);
|
|
893
861
|
if (event.defaultPrevented || isDisabled) {
|
|
@@ -938,9 +906,9 @@ var Toaster = ({ theme = "system", ...props }) => {
|
|
|
938
906
|
};
|
|
939
907
|
var buttonVariants = cva(
|
|
940
908
|
[
|
|
941
|
-
"inline-flex shrink-0 items-center justify-center gap-2
|
|
909
|
+
"inline-flex shrink-0 items-center justify-center gap-2 rounded text-sm font-medium whitespace-nowrap transition-all outline-none",
|
|
942
910
|
"disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
943
|
-
"[&_svg:not([class*='size-'])]:size-4
|
|
911
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
944
912
|
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring",
|
|
945
913
|
"aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error"
|
|
946
914
|
],
|
|
@@ -949,7 +917,7 @@ var buttonVariants = cva(
|
|
|
949
917
|
variant: {
|
|
950
918
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
951
919
|
error: "bg-error hover:bg-error/90 focus-visible:ring-error/20 dark:focus-visible:ring-error/40 dark:bg-error/60 text-white",
|
|
952
|
-
outline: "bg-background
|
|
920
|
+
outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",
|
|
953
921
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
954
922
|
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
955
923
|
link: "text-primary underline-offset-4 hover:underline"
|
|
@@ -1034,15 +1002,15 @@ function ButtonContent({
|
|
|
1034
1002
|
const isEndLoading = loading && loadingPosition === "end";
|
|
1035
1003
|
const EndIcon = isEndLoading ? /* @__PURE__ */ jsx(Spinner, { "aria-label": "Loading" }) : endIcon || null;
|
|
1036
1004
|
const isCenterLoading = loading && loadingPosition === "center";
|
|
1037
|
-
return asChild &&
|
|
1005
|
+
return asChild && React5.isValidElement(children) ? React5.cloneElement(
|
|
1038
1006
|
children,
|
|
1039
1007
|
props,
|
|
1040
|
-
/* @__PURE__ */ jsxs(
|
|
1008
|
+
/* @__PURE__ */ jsxs(React5.Fragment, { children: [
|
|
1041
1009
|
StartIcon,
|
|
1042
|
-
isCenterLoading ? /* @__PURE__ */ jsx(Spinner, { "aria-label": "Loading" }) :
|
|
1010
|
+
isCenterLoading ? /* @__PURE__ */ jsx(Spinner, { "aria-label": "Loading" }) : React5.isValidElement(children) ? children.props?.children : null,
|
|
1043
1011
|
EndIcon
|
|
1044
1012
|
] })
|
|
1045
|
-
) : /* @__PURE__ */ jsxs(
|
|
1013
|
+
) : /* @__PURE__ */ jsxs(React5.Fragment, { children: [
|
|
1046
1014
|
StartIcon,
|
|
1047
1015
|
isCenterLoading ? /* @__PURE__ */ jsx(Spinner, { "aria-label": "Loading" }) : children,
|
|
1048
1016
|
EndIcon
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { cn } from './chunk-ZD2QRAOX.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useInView, motion } from 'motion/react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function WordRotate({
|
|
7
|
+
words,
|
|
8
|
+
duration = 1500,
|
|
9
|
+
animationStyle = "fade",
|
|
10
|
+
loop = true,
|
|
11
|
+
className,
|
|
12
|
+
containerClassName,
|
|
13
|
+
pauseDuration = 300,
|
|
14
|
+
startOnView = true,
|
|
15
|
+
once = false,
|
|
16
|
+
inViewMargin,
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
const ref = React.useRef(null);
|
|
20
|
+
const isInView = useInView(ref, { once, margin: inViewMargin });
|
|
21
|
+
const [hasAnimated, setHasAnimated] = React.useState(false);
|
|
22
|
+
const [currentWord, setCurrentWord] = React.useState(0);
|
|
23
|
+
const [show, setShow] = React.useState(true);
|
|
24
|
+
const variants = {
|
|
25
|
+
fade: {
|
|
26
|
+
initial: { opacity: 0 },
|
|
27
|
+
animate: {
|
|
28
|
+
opacity: 1,
|
|
29
|
+
transition: {
|
|
30
|
+
duration: 0.4,
|
|
31
|
+
ease: [0.4, 0, 0.2, 1]
|
|
32
|
+
// Custom cubic-bezier for smooth fade
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
exit: {
|
|
36
|
+
opacity: 0,
|
|
37
|
+
transition: {
|
|
38
|
+
duration: 0.3,
|
|
39
|
+
ease: [0.4, 0, 1, 1]
|
|
40
|
+
// Faster exit
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"slide-up": {
|
|
45
|
+
initial: { opacity: 0, y: 24 },
|
|
46
|
+
animate: {
|
|
47
|
+
opacity: 1,
|
|
48
|
+
y: 0,
|
|
49
|
+
transition: {
|
|
50
|
+
type: "spring",
|
|
51
|
+
stiffness: 300,
|
|
52
|
+
damping: 25,
|
|
53
|
+
mass: 0.8
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
exit: {
|
|
57
|
+
opacity: 0,
|
|
58
|
+
y: -24,
|
|
59
|
+
transition: {
|
|
60
|
+
duration: 0.25,
|
|
61
|
+
ease: [0.4, 0, 1, 1]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"slide-down": {
|
|
66
|
+
initial: { opacity: 0, y: -24 },
|
|
67
|
+
animate: {
|
|
68
|
+
opacity: 1,
|
|
69
|
+
y: 0,
|
|
70
|
+
transition: {
|
|
71
|
+
type: "spring",
|
|
72
|
+
stiffness: 300,
|
|
73
|
+
damping: 25,
|
|
74
|
+
mass: 0.8
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
exit: {
|
|
78
|
+
opacity: 0,
|
|
79
|
+
y: 24,
|
|
80
|
+
transition: {
|
|
81
|
+
duration: 0.25,
|
|
82
|
+
ease: [0.4, 0, 1, 1]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
scale: {
|
|
87
|
+
initial: { opacity: 0, scale: 0.8 },
|
|
88
|
+
animate: {
|
|
89
|
+
opacity: 1,
|
|
90
|
+
scale: 1,
|
|
91
|
+
transition: {
|
|
92
|
+
type: "spring",
|
|
93
|
+
stiffness: 400,
|
|
94
|
+
damping: 30,
|
|
95
|
+
mass: 0.6
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
exit: {
|
|
99
|
+
opacity: 0,
|
|
100
|
+
scale: 0.9,
|
|
101
|
+
transition: {
|
|
102
|
+
duration: 0.2,
|
|
103
|
+
ease: [0.4, 0, 1, 1]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
flip: {
|
|
108
|
+
initial: { opacity: 0, rotateX: 90 },
|
|
109
|
+
animate: {
|
|
110
|
+
opacity: 1,
|
|
111
|
+
rotateX: 0,
|
|
112
|
+
transition: {
|
|
113
|
+
type: "spring",
|
|
114
|
+
stiffness: 200,
|
|
115
|
+
damping: 20,
|
|
116
|
+
mass: 1
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
exit: {
|
|
120
|
+
opacity: 0,
|
|
121
|
+
rotateX: -90,
|
|
122
|
+
transition: {
|
|
123
|
+
duration: 0.3,
|
|
124
|
+
ease: [0.4, 0, 1, 1]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const shouldStart = !startOnView || isInView && (!once || !hasAnimated);
|
|
130
|
+
React.useEffect(() => {
|
|
131
|
+
if (!shouldStart) return;
|
|
132
|
+
if (words.length === 0) return;
|
|
133
|
+
let intervalId;
|
|
134
|
+
let timeoutId;
|
|
135
|
+
intervalId = setInterval(() => {
|
|
136
|
+
setShow(false);
|
|
137
|
+
timeoutId = setTimeout(() => {
|
|
138
|
+
setCurrentWord((prev) => {
|
|
139
|
+
const nextIndex = prev + 1;
|
|
140
|
+
if (!loop && nextIndex >= words.length) {
|
|
141
|
+
clearInterval(intervalId);
|
|
142
|
+
clearTimeout(timeoutId);
|
|
143
|
+
return prev;
|
|
144
|
+
}
|
|
145
|
+
return loop ? nextIndex % words.length : nextIndex;
|
|
146
|
+
});
|
|
147
|
+
setShow(true);
|
|
148
|
+
setHasAnimated(true);
|
|
149
|
+
}, pauseDuration);
|
|
150
|
+
}, duration + pauseDuration);
|
|
151
|
+
return () => {
|
|
152
|
+
clearInterval(intervalId);
|
|
153
|
+
clearTimeout(timeoutId);
|
|
154
|
+
};
|
|
155
|
+
}, [shouldStart, duration, pauseDuration, words.length, loop, once, hasAnimated]);
|
|
156
|
+
return /* @__PURE__ */ jsx(
|
|
157
|
+
motion.span,
|
|
158
|
+
{
|
|
159
|
+
ref,
|
|
160
|
+
"data-slot": "word-rotate",
|
|
161
|
+
className: cn("inline-block overflow-hidden align-bottom leading-none", containerClassName),
|
|
162
|
+
...props,
|
|
163
|
+
children: /* @__PURE__ */ jsx(
|
|
164
|
+
motion.span,
|
|
165
|
+
{
|
|
166
|
+
initial: "initial",
|
|
167
|
+
animate: show ? "animate" : "exit",
|
|
168
|
+
exit: "exit",
|
|
169
|
+
variants: variants[animationStyle],
|
|
170
|
+
transition: { duration: 0.5 },
|
|
171
|
+
style: {
|
|
172
|
+
perspective: animationStyle === "flip" ? 1e3 : void 0
|
|
173
|
+
},
|
|
174
|
+
className: cn("inline-block", className),
|
|
175
|
+
children: words[currentWord]
|
|
176
|
+
},
|
|
177
|
+
currentWord
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export { WordRotate };
|
|
@@ -5,7 +5,7 @@ import { cva } from 'class-variance-authority';
|
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
var itemVariants = cva(
|
|
8
|
-
"group/item [a]:hover:bg-accent/50
|
|
8
|
+
"group/item [a]:hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-ring/50 flex flex-wrap items-center rounded border border-transparent text-sm transition-colors duration-100 outline-none focus-visible:ring [a]:transition-colors",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { cn } from './chunk-ZD2QRAOX.js';
|
|
2
|
+
import { Tabs as Tabs$1 } from 'radix-ui';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function Tabs({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(Tabs$1.Root, { "data-slot": "tabs", className: cn("flex flex-col gap-2", className), ...props });
|
|
7
|
+
}
|
|
8
|
+
function TabsList({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
Tabs$1.List,
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "tabs-list",
|
|
13
|
+
className: cn(
|
|
14
|
+
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded p-0.75",
|
|
15
|
+
className
|
|
16
|
+
),
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function TabsTrigger({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
Tabs$1.Trigger,
|
|
24
|
+
{
|
|
25
|
+
"data-slot": "tabs-trigger",
|
|
26
|
+
className: cn(
|
|
27
|
+
"text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow]",
|
|
28
|
+
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:shadow-sm",
|
|
29
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] focus-visible:outline-1",
|
|
30
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
31
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
32
|
+
className
|
|
33
|
+
),
|
|
34
|
+
...props
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function TabsContent({ className, ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx(Tabs$1.Content, { "data-slot": "tabs-content", className: cn("flex-1 outline-none", className), ...props });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cn } from './chunk-ZD2QRAOX.js';
|
|
2
|
+
import { Accordion as Accordion$1 } from 'radix-ui';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
import { ChevronDownIcon } from 'lucide-react';
|
|
5
|
+
|
|
6
|
+
function Accordion({ ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Accordion$1.Root, { "data-slot": "accordion", ...props });
|
|
8
|
+
}
|
|
9
|
+
function AccordionContent({ className, children, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
Accordion$1.Content,
|
|
12
|
+
{
|
|
13
|
+
"data-slot": "accordion-content",
|
|
14
|
+
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
15
|
+
...props,
|
|
16
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("pt-0 pb-4", className), children })
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
function AccordionTrigger({ className, children, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(Accordion$1.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
22
|
+
Accordion$1.Trigger,
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "accordion-trigger",
|
|
25
|
+
className: cn(
|
|
26
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
27
|
+
className
|
|
28
|
+
),
|
|
29
|
+
...props,
|
|
30
|
+
children: [
|
|
31
|
+
children,
|
|
32
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
) });
|
|
36
|
+
}
|
|
37
|
+
function AccordionItem({ className, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
Accordion$1.Item,
|
|
40
|
+
{
|
|
41
|
+
"data-slot": "accordion-item",
|
|
42
|
+
className: cn("border-b last:border-b-0", className),
|
|
43
|
+
...props
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|