@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,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 };
|
|
@@ -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,51 @@
|
|
|
1
|
+
import { cn } from './chunk-ZD2QRAOX.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useInView, useMotionValue, animate, motion } from 'motion/react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function CountingNumber({
|
|
7
|
+
from = 0,
|
|
8
|
+
to = 100,
|
|
9
|
+
duration = 2,
|
|
10
|
+
delay = 0,
|
|
11
|
+
className,
|
|
12
|
+
startOnView = true,
|
|
13
|
+
once = false,
|
|
14
|
+
inViewMargin,
|
|
15
|
+
onComplete,
|
|
16
|
+
format,
|
|
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 [display, setDisplay] = React.useState(from);
|
|
23
|
+
const motionValue = useMotionValue(from);
|
|
24
|
+
const shouldStart = !startOnView || isInView && (!once || !hasAnimated);
|
|
25
|
+
React.useEffect(
|
|
26
|
+
function() {
|
|
27
|
+
if (!shouldStart) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
setHasAnimated(true);
|
|
31
|
+
const timeout = setTimeout(function() {
|
|
32
|
+
const controls = animate(motionValue, to, {
|
|
33
|
+
duration,
|
|
34
|
+
onUpdate: (v) => setDisplay(v),
|
|
35
|
+
onComplete
|
|
36
|
+
});
|
|
37
|
+
return function() {
|
|
38
|
+
controls.stop();
|
|
39
|
+
};
|
|
40
|
+
}, delay);
|
|
41
|
+
return function() {
|
|
42
|
+
clearTimeout(timeout);
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
|
+
[shouldStart, from, to, duration, delay]
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ jsx(motion.span, { ref, "data-slot": "counting-number", className: cn("inline-block", className), ...props, children: format ? format(display) : Math.round(display) });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { CountingNumber };
|
|
@@ -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 };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkH2BWO3SI_cjs = require('./chunk-H2BWO3SI.cjs');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var react = require('motion/react');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
+
|
|
28
|
+
function CountingNumber({
|
|
29
|
+
from = 0,
|
|
30
|
+
to = 100,
|
|
31
|
+
duration = 2,
|
|
32
|
+
delay = 0,
|
|
33
|
+
className,
|
|
34
|
+
startOnView = true,
|
|
35
|
+
once = false,
|
|
36
|
+
inViewMargin,
|
|
37
|
+
onComplete,
|
|
38
|
+
format,
|
|
39
|
+
...props
|
|
40
|
+
}) {
|
|
41
|
+
const ref = React__namespace.useRef(null);
|
|
42
|
+
const isInView = react.useInView(ref, { once, margin: inViewMargin });
|
|
43
|
+
const [hasAnimated, setHasAnimated] = React__namespace.useState(false);
|
|
44
|
+
const [display, setDisplay] = React__namespace.useState(from);
|
|
45
|
+
const motionValue = react.useMotionValue(from);
|
|
46
|
+
const shouldStart = !startOnView || isInView && (!once || !hasAnimated);
|
|
47
|
+
React__namespace.useEffect(
|
|
48
|
+
function() {
|
|
49
|
+
if (!shouldStart) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
setHasAnimated(true);
|
|
53
|
+
const timeout = setTimeout(function() {
|
|
54
|
+
const controls = react.animate(motionValue, to, {
|
|
55
|
+
duration,
|
|
56
|
+
onUpdate: (v) => setDisplay(v),
|
|
57
|
+
onComplete
|
|
58
|
+
});
|
|
59
|
+
return function() {
|
|
60
|
+
controls.stop();
|
|
61
|
+
};
|
|
62
|
+
}, delay);
|
|
63
|
+
return function() {
|
|
64
|
+
clearTimeout(timeout);
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68
|
+
[shouldStart, from, to, duration, delay]
|
|
69
|
+
);
|
|
70
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.motion.span, { ref, "data-slot": "counting-number", className: chunkH2BWO3SI_cjs.cn("inline-block", className), ...props, children: format ? format(display) : Math.round(display) });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
exports.CountingNumber = CountingNumber;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { cn } from './chunk-ZD2QRAOX.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useInView, motion } from 'motion/react';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var cursorVariants = {
|
|
7
|
+
blinking: {
|
|
8
|
+
opacity: [0, 0, 1, 1],
|
|
9
|
+
transition: {
|
|
10
|
+
duration: 1,
|
|
11
|
+
repeat: Infinity,
|
|
12
|
+
repeatDelay: 0,
|
|
13
|
+
ease: "linear",
|
|
14
|
+
times: [0, 0.5, 0.5, 1]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var animationVariants = {
|
|
19
|
+
fadeIn: {
|
|
20
|
+
hidden: { opacity: 0, y: 10 },
|
|
21
|
+
show: { opacity: 1, y: 0 },
|
|
22
|
+
exit: { opacity: 0 }
|
|
23
|
+
},
|
|
24
|
+
blurIn: {
|
|
25
|
+
hidden: { opacity: 0, filter: "blur(4px)" },
|
|
26
|
+
show: { opacity: 1, filter: "blur(0px)" },
|
|
27
|
+
exit: { opacity: 0, filter: "blur(4px)" }
|
|
28
|
+
},
|
|
29
|
+
blurInUp: {
|
|
30
|
+
hidden: { opacity: 0, y: 20, filter: "blur(4px)" },
|
|
31
|
+
show: { opacity: 1, y: 0, filter: "blur(0px)" },
|
|
32
|
+
exit: { opacity: 0, y: -20, filter: "blur(4px)" }
|
|
33
|
+
},
|
|
34
|
+
blurInDown: {
|
|
35
|
+
hidden: { opacity: 0, y: -20, filter: "blur(4px)" },
|
|
36
|
+
show: { opacity: 1, y: 0, filter: "blur(0px)" },
|
|
37
|
+
exit: { opacity: 0, y: 20, filter: "blur(4px)" }
|
|
38
|
+
},
|
|
39
|
+
slideUp: {
|
|
40
|
+
hidden: { opacity: 0, y: 20 },
|
|
41
|
+
show: { opacity: 1, y: 0 },
|
|
42
|
+
exit: { opacity: 0, y: -20 }
|
|
43
|
+
},
|
|
44
|
+
slideDown: {
|
|
45
|
+
hidden: { opacity: 0, y: -20 },
|
|
46
|
+
show: { opacity: 1, y: 0 },
|
|
47
|
+
exit: { opacity: 0, y: 20 }
|
|
48
|
+
},
|
|
49
|
+
slideLeft: {
|
|
50
|
+
hidden: { opacity: 0, x: 20 },
|
|
51
|
+
show: { opacity: 1, x: 0 },
|
|
52
|
+
exit: { opacity: 0, x: -20 }
|
|
53
|
+
},
|
|
54
|
+
slideRight: {
|
|
55
|
+
hidden: { opacity: 0, x: -20 },
|
|
56
|
+
show: { opacity: 1, x: 0 },
|
|
57
|
+
exit: { opacity: 0, x: 20 }
|
|
58
|
+
},
|
|
59
|
+
scaleUp: {
|
|
60
|
+
hidden: { opacity: 0, scale: 0.8 },
|
|
61
|
+
show: { opacity: 1, scale: 1 },
|
|
62
|
+
exit: { opacity: 0, scale: 1.2 }
|
|
63
|
+
},
|
|
64
|
+
scaleDown: {
|
|
65
|
+
hidden: { opacity: 0, scale: 1.2 },
|
|
66
|
+
show: { opacity: 1, scale: 1 },
|
|
67
|
+
exit: { opacity: 0, scale: 0.8 }
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
function TypingText({
|
|
71
|
+
text,
|
|
72
|
+
texts,
|
|
73
|
+
speed = 100,
|
|
74
|
+
delay = 0,
|
|
75
|
+
showCursor = true,
|
|
76
|
+
cursorClassName = "",
|
|
77
|
+
cursor = "|",
|
|
78
|
+
loop = false,
|
|
79
|
+
pauseDuration = 2e3,
|
|
80
|
+
className,
|
|
81
|
+
onComplete,
|
|
82
|
+
startOnView = true,
|
|
83
|
+
once = false,
|
|
84
|
+
animation = "fadeIn",
|
|
85
|
+
inViewMargin,
|
|
86
|
+
...props
|
|
87
|
+
}) {
|
|
88
|
+
const ref = React.useRef(null);
|
|
89
|
+
const isInView = useInView(ref, { once, margin: inViewMargin });
|
|
90
|
+
const [hasAnimated, setHasAnimated] = React.useState(false);
|
|
91
|
+
const [displayText, setDisplayText] = React.useState("");
|
|
92
|
+
const [currentIndex, setCurrentIndex] = React.useState(0);
|
|
93
|
+
const [isTyping, setIsTyping] = React.useState(false);
|
|
94
|
+
const [currentTextIndex, setCurrentTextIndex] = React.useState(0);
|
|
95
|
+
const shouldStart = !startOnView || isInView && (!once || !hasAnimated);
|
|
96
|
+
const textArray = texts && texts.length > 0 ? texts : [text];
|
|
97
|
+
const currentText = textArray[currentTextIndex] ?? "";
|
|
98
|
+
React.useEffect(() => {
|
|
99
|
+
if (!shouldStart) return;
|
|
100
|
+
const timeout = setTimeout(() => {
|
|
101
|
+
setIsTyping(true);
|
|
102
|
+
setHasAnimated(true);
|
|
103
|
+
}, delay);
|
|
104
|
+
return () => clearTimeout(timeout);
|
|
105
|
+
}, [delay, shouldStart]);
|
|
106
|
+
React.useEffect(() => {
|
|
107
|
+
if (!isTyping) return;
|
|
108
|
+
if (currentIndex < currentText.length) {
|
|
109
|
+
const timeout = setTimeout(() => {
|
|
110
|
+
setDisplayText(currentText.slice(0, currentIndex + 1));
|
|
111
|
+
setCurrentIndex(currentIndex + 1);
|
|
112
|
+
}, speed);
|
|
113
|
+
return () => clearTimeout(timeout);
|
|
114
|
+
} else {
|
|
115
|
+
onComplete?.();
|
|
116
|
+
if (loop && texts && texts.length > 1) {
|
|
117
|
+
const timeout = setTimeout(() => {
|
|
118
|
+
setDisplayText("");
|
|
119
|
+
setCurrentIndex(0);
|
|
120
|
+
setCurrentTextIndex((prev) => (prev + 1) % texts.length);
|
|
121
|
+
}, pauseDuration);
|
|
122
|
+
return () => clearTimeout(timeout);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}, [currentIndex, currentText, isTyping, speed, loop, texts, pauseDuration, onComplete]);
|
|
126
|
+
const selectedVariants = animationVariants[animation];
|
|
127
|
+
const MotionComponent = motion.span;
|
|
128
|
+
return /* @__PURE__ */ jsx(
|
|
129
|
+
MotionComponent,
|
|
130
|
+
{
|
|
131
|
+
ref,
|
|
132
|
+
variants: selectedVariants,
|
|
133
|
+
initial: "hidden",
|
|
134
|
+
whileInView: startOnView ? "show" : void 0,
|
|
135
|
+
animate: startOnView ? void 0 : "show",
|
|
136
|
+
exit: "exit",
|
|
137
|
+
className: cn("whitespace-pre-wrap", className),
|
|
138
|
+
viewport: { once },
|
|
139
|
+
"data-slot": "typing-text",
|
|
140
|
+
...props,
|
|
141
|
+
children: /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center" }, children: [
|
|
142
|
+
displayText,
|
|
143
|
+
showCursor && /* @__PURE__ */ jsx(
|
|
144
|
+
motion.span,
|
|
145
|
+
{
|
|
146
|
+
variants: cursorVariants,
|
|
147
|
+
animate: "blinking",
|
|
148
|
+
className: cn("text-foreground ms-1 inline-block w-px font-normal select-none", cursorClassName),
|
|
149
|
+
children: cursor
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
] })
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export { TypingText };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkH2BWO3SI_cjs = require('./chunk-H2BWO3SI.cjs');
|
|
4
|
+
var radixUi = require('radix-ui');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function Tabs({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Tabs.Root, { "data-slot": "tabs", className: chunkH2BWO3SI_cjs.cn("flex flex-col gap-2", className), ...props });
|
|
9
|
+
}
|
|
10
|
+
function TabsList({ className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12
|
+
radixUi.Tabs.List,
|
|
13
|
+
{
|
|
14
|
+
"data-slot": "tabs-list",
|
|
15
|
+
className: chunkH2BWO3SI_cjs.cn(
|
|
16
|
+
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded p-0.75",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
...props
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
function TabsTrigger({ className, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
|
+
radixUi.Tabs.Trigger,
|
|
26
|
+
{
|
|
27
|
+
"data-slot": "tabs-trigger",
|
|
28
|
+
className: chunkH2BWO3SI_cjs.cn(
|
|
29
|
+
"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]",
|
|
30
|
+
"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",
|
|
31
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] focus-visible:outline-1",
|
|
32
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
33
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
...props
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
function TabsContent({ className, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Tabs.Content, { "data-slot": "tabs-content", className: chunkH2BWO3SI_cjs.cn("flex-1 outline-none", className), ...props });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
exports.Tabs = Tabs;
|
|
45
|
+
exports.TabsContent = TabsContent;
|
|
46
|
+
exports.TabsList = TabsList;
|
|
47
|
+
exports.TabsTrigger = TabsTrigger;
|