@waveso/ui 0.0.8 → 0.0.10

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.
@@ -0,0 +1,148 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { ReactElement } from 'react';
4
+ import { Transition } from 'motion/react';
5
+
6
+ type Direction = "up" | "down" | "left" | "right";
7
+ interface AnimateOnViewProps {
8
+ children: ReactElement;
9
+ /** Delay in seconds before animation starts. Default: 0 */
10
+ delay?: number;
11
+ /** Direction to animate from. Default: 'down' */
12
+ from?: Direction;
13
+ /** Distance in px. Default: 20 */
14
+ distance?: number;
15
+ /** Also scale in (0.85 → 1). Default: false */
16
+ scale?: boolean;
17
+ /** Blur in from a given amount in px. Default: false */
18
+ blur?: boolean | number;
19
+ /** Rotate in from a given angle in degrees. Default: 0 */
20
+ rotate?: number;
21
+ /** 3D flip entrance along the axis matching `from`. Default: false */
22
+ flip?: boolean;
23
+ /** Spring easing with overshoot. Default: false */
24
+ spring?: boolean;
25
+ /** Trigger once or every time it enters view. Default: true */
26
+ once?: boolean;
27
+ /** Custom transition override */
28
+ transition?: Transition;
29
+ }
30
+ interface AnimateInProps {
31
+ children: ReactElement;
32
+ /** Delay in seconds before animation starts. Default: 0 */
33
+ delay?: number;
34
+ /** Direction to animate from. Default: 'down' */
35
+ from?: Direction;
36
+ /** Distance in px. Default: 20 */
37
+ distance?: number;
38
+ /** Also scale in (0.85 → 1). Default: false */
39
+ scale?: boolean;
40
+ /** Blur in from a given amount in px. Default: false */
41
+ blur?: boolean | number;
42
+ /** Rotate in from a given angle in degrees. Default: 0 */
43
+ rotate?: number;
44
+ /** 3D flip entrance along the axis matching `from`. Default: false */
45
+ flip?: boolean;
46
+ /** Spring easing with overshoot. Default: false */
47
+ spring?: boolean;
48
+ /** Custom transition override */
49
+ transition?: Transition;
50
+ }
51
+ interface StaggerProps {
52
+ children: ReactElement[];
53
+ /** Delay increment between each child in seconds. Default: 0.08 */
54
+ interval?: number;
55
+ /** Base delay before the first child animates in seconds. Default: 0 */
56
+ baseDelay?: number;
57
+ }
58
+ interface PulseProps {
59
+ children: ReactElement;
60
+ /** Min scale factor. Default: 0.97 */
61
+ min?: number;
62
+ /** Max scale factor. Default: 1.03 */
63
+ max?: number;
64
+ /** Animation duration in seconds. Default: 2 */
65
+ duration?: number;
66
+ /** Also pulse opacity between these bounds [min, max]. Off by default. */
67
+ opacity?: [number, number];
68
+ /** Pause animation. Default: false */
69
+ paused?: boolean;
70
+ }
71
+ interface FloatProps {
72
+ children: ReactElement;
73
+ /** Vertical float distance in px. Default: 6 */
74
+ distance?: number;
75
+ /** Animation duration in seconds. Default: 3 */
76
+ duration?: number;
77
+ /** Also rotate slightly while floating (degrees). Default: 0 */
78
+ rotate?: number;
79
+ /** Pause animation. Default: false */
80
+ paused?: boolean;
81
+ }
82
+ /**
83
+ * Animates a child element when it scrolls into view.
84
+ *
85
+ * Zero DOM overhead — applies styles directly to the child via cloneElement.
86
+ * Renders children unchanged on server to avoid hydration mismatch.
87
+ *
88
+ * @example
89
+ * ```tsx
90
+ * <AnimateOnView from="up" blur scale>
91
+ * <Card>Hello</Card>
92
+ * </AnimateOnView>
93
+ * ```
94
+ */
95
+ declare function AnimateOnView({ children, delay, from, distance, scale, blur, rotate, flip, spring, once, transition, }: AnimateOnViewProps): ReactElement<unknown, string | React.JSXElementConstructor<any>>;
96
+ /**
97
+ * Animates a child element immediately on mount.
98
+ *
99
+ * Zero DOM overhead — applies styles directly to the child via cloneElement.
100
+ * Uses a two-phase approach: hidden → visible with requestAnimationFrame.
101
+ *
102
+ * @example
103
+ * ```tsx
104
+ * <AnimateIn from="up" blur spring>
105
+ * <h1>Welcome</h1>
106
+ * </AnimateIn>
107
+ * ```
108
+ */
109
+ declare function AnimateIn({ children, delay, from, distance, scale, blur, rotate, flip, spring, transition, }: AnimateInProps): ReactElement<unknown, string | React.JSXElementConstructor<any>>;
110
+ /**
111
+ * Auto-staggers delay on child AnimateIn/AnimateOnView elements.
112
+ * Eliminates manual `delay={i * 0.08}` math.
113
+ *
114
+ * @example
115
+ * ```tsx
116
+ * <Stagger interval={0.1}>
117
+ * <AnimateIn from="up"><Card>One</Card></AnimateIn>
118
+ * <AnimateIn from="up"><Card>Two</Card></AnimateIn>
119
+ * </Stagger>
120
+ * ```
121
+ */
122
+ declare function Stagger({ children, interval, baseDelay, }: StaggerProps): react_jsx_runtime.JSX.Element;
123
+ /**
124
+ * Continuous, subtle scale pulse. Great for live indicators and CTAs.
125
+ * Zero DOM overhead — injects a scoped keyframe via `<style>`.
126
+ *
127
+ * @example
128
+ * ```tsx
129
+ * <Pulse>
130
+ * <span className="size-3 rounded-full bg-green-500" />
131
+ * </Pulse>
132
+ * ```
133
+ */
134
+ declare function Pulse({ children, min, max, duration, opacity, paused, }: PulseProps): react_jsx_runtime.JSX.Element;
135
+ /**
136
+ * Gentle continuous up/down float. Perfect for decorative elements.
137
+ * Zero DOM overhead — injects a scoped keyframe via `<style>`.
138
+ *
139
+ * @example
140
+ * ```tsx
141
+ * <Float distance={10} duration={4}>
142
+ * <Card>Floating</Card>
143
+ * </Float>
144
+ * ```
145
+ */
146
+ declare function Float({ children, distance, duration, rotate, paused, }: FloatProps): react_jsx_runtime.JSX.Element;
147
+
148
+ export { AnimateIn, type AnimateInProps, AnimateOnView, type AnimateOnViewProps, type Direction, Float, type FloatProps, Pulse, type PulseProps, Stagger, type StaggerProps };
@@ -0,0 +1,244 @@
1
+ import { useRef, useState, useEffect, isValidElement, cloneElement, Children, useId } from 'react';
2
+ import { useInView } from 'motion/react';
3
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
4
+
5
+ var DIRECTION_MAP = {
6
+ up: { prop: "translateY", value: -1 },
7
+ down: { prop: "translateY", value: 1 },
8
+ left: { prop: "translateX", value: -1 },
9
+ right: { prop: "translateX", value: 1 }
10
+ };
11
+ var FLIP_MAP = {
12
+ up: "rotateX(90deg)",
13
+ down: "rotateX(-90deg)",
14
+ left: "rotateY(-90deg)",
15
+ right: "rotateY(90deg)"
16
+ };
17
+ var SPRING_EASE = "cubic-bezier(0.34, 1.56, 0.64, 1)";
18
+ function buildStyles(opts) {
19
+ const { from, distance, doScale, blur, rotate, flip } = opts;
20
+ const dir = DIRECTION_MAP[from];
21
+ const hiddenParts = [];
22
+ if (flip) hiddenParts.push("perspective(800px)");
23
+ hiddenParts.push(`${dir.prop}(${dir.value * distance}px)`);
24
+ if (doScale) hiddenParts.push("scale(0.85)");
25
+ if (rotate) hiddenParts.push(`rotate(${rotate}deg)`);
26
+ if (flip) hiddenParts.push(FLIP_MAP[from]);
27
+ const visibleParts = [];
28
+ if (flip) visibleParts.push("perspective(800px)");
29
+ visibleParts.push("translateX(0) translateY(0)");
30
+ if (doScale) visibleParts.push("scale(1)");
31
+ if (rotate) visibleParts.push("rotate(0deg)");
32
+ if (flip) visibleParts.push(from === "up" || from === "down" ? "rotateX(0deg)" : "rotateY(0deg)");
33
+ const blurPx = blur === true ? 10 : typeof blur === "number" ? blur : 0;
34
+ const hidden = {
35
+ opacity: "0",
36
+ transform: hiddenParts.join(" ")
37
+ };
38
+ const visible = {
39
+ opacity: "1",
40
+ transform: visibleParts.join(" ")
41
+ };
42
+ if (blurPx > 0) {
43
+ hidden.filter = `blur(${blurPx}px)`;
44
+ visible.filter = "blur(0px)";
45
+ }
46
+ return { hidden, visible, hasFilter: blurPx > 0 };
47
+ }
48
+ function mergeRefs(...refs) {
49
+ return (el) => {
50
+ refs.forEach((ref) => {
51
+ if (typeof ref === "function") ref(el);
52
+ else if (ref && typeof ref === "object") {
53
+ ref.current = el;
54
+ }
55
+ });
56
+ };
57
+ }
58
+ function getTransitionParams(transition, useSpring) {
59
+ const duration = transition?.duration ?? 0.5;
60
+ const ease = useSpring ? SPRING_EASE : transition?.ease ?? "ease-out";
61
+ return { duration, ease };
62
+ }
63
+ function buildTransitionStr(duration, ease, delay, hasFilter) {
64
+ const parts = [
65
+ `opacity ${duration}s ${ease} ${delay}s`,
66
+ `transform ${duration}s ${ease} ${delay}s`
67
+ ];
68
+ if (hasFilter) parts.push(`filter ${duration}s ${ease} ${delay}s`);
69
+ return parts.join(", ");
70
+ }
71
+ function AnimateOnView({
72
+ children,
73
+ delay = 0,
74
+ from = "down",
75
+ distance = 20,
76
+ scale = false,
77
+ blur = false,
78
+ rotate = 0,
79
+ flip = false,
80
+ spring = false,
81
+ once = true,
82
+ transition
83
+ }) {
84
+ const ref = useRef(null);
85
+ const [hydrated, setHydrated] = useState(false);
86
+ const isInView = useInView(ref, { once, margin: "-50px" });
87
+ useEffect(() => {
88
+ setHydrated(true);
89
+ }, []);
90
+ if (!isValidElement(children)) return children;
91
+ const childProps = children.props;
92
+ const existingStyle = childProps.style ?? {};
93
+ const existingRef = childProps.ref;
94
+ if (!hydrated) {
95
+ return cloneElement(children, {
96
+ ref: mergeRefs(ref, existingRef)
97
+ });
98
+ }
99
+ const styles = buildStyles({ from, distance, doScale: scale, blur, rotate, flip });
100
+ const { duration, ease } = getTransitionParams(transition, spring);
101
+ const currentStyle = isInView ? styles.visible : styles.hidden;
102
+ const transitionStr = buildTransitionStr(duration, ease, delay, styles.hasFilter);
103
+ return cloneElement(children, {
104
+ ref: mergeRefs(ref, existingRef),
105
+ style: {
106
+ ...existingStyle,
107
+ ...currentStyle,
108
+ ...isInView ? { transition: transitionStr } : {},
109
+ willChange: "opacity, transform"
110
+ }
111
+ });
112
+ }
113
+ function AnimateIn({
114
+ children,
115
+ delay = 0,
116
+ from = "down",
117
+ distance = 20,
118
+ scale = false,
119
+ blur = false,
120
+ rotate = 0,
121
+ flip = false,
122
+ spring = false,
123
+ transition
124
+ }) {
125
+ const ref = useRef(null);
126
+ const [phase, setPhase] = useState("server");
127
+ useEffect(() => {
128
+ setPhase("hidden");
129
+ requestAnimationFrame(() => {
130
+ requestAnimationFrame(() => setPhase("visible"));
131
+ });
132
+ }, []);
133
+ if (!isValidElement(children)) return children;
134
+ const childProps = children.props;
135
+ const existingStyle = childProps.style ?? {};
136
+ const existingRef = childProps.ref;
137
+ if (phase === "server") {
138
+ return cloneElement(children, {
139
+ ref: mergeRefs(ref, existingRef)
140
+ });
141
+ }
142
+ const styles = buildStyles({ from, distance, doScale: scale, blur, rotate, flip });
143
+ const { duration, ease } = getTransitionParams(transition, spring);
144
+ const currentStyle = phase === "visible" ? styles.visible : styles.hidden;
145
+ const transitionStr = buildTransitionStr(duration, ease, delay, styles.hasFilter);
146
+ return cloneElement(children, {
147
+ ref: mergeRefs(ref, existingRef),
148
+ style: {
149
+ ...existingStyle,
150
+ ...currentStyle,
151
+ ...phase === "visible" ? { transition: transitionStr } : {},
152
+ willChange: "opacity, transform"
153
+ }
154
+ });
155
+ }
156
+ function Stagger({
157
+ children,
158
+ interval = 0.08,
159
+ baseDelay = 0
160
+ }) {
161
+ return /* @__PURE__ */ jsx(Fragment, { children: Children.map(children, (child, index) => {
162
+ if (!isValidElement(child)) return child;
163
+ return cloneElement(child, {
164
+ delay: baseDelay + index * interval
165
+ });
166
+ }) });
167
+ }
168
+ function Pulse({
169
+ children,
170
+ min = 0.97,
171
+ max = 1.03,
172
+ duration = 2,
173
+ opacity,
174
+ paused = false
175
+ }) {
176
+ const id = useId().replace(/:/g, "");
177
+ const [hydrated, setHydrated] = useState(false);
178
+ useEffect(() => {
179
+ setHydrated(true);
180
+ }, []);
181
+ if (!isValidElement(children)) return children;
182
+ if (!hydrated) return children;
183
+ const name = `pulse-${id}`;
184
+ const opacityFrom = opacity?.[0] ?? 1;
185
+ const opacityTo = opacity?.[1] ?? 1;
186
+ const keyframes = `@keyframes ${name} {
187
+ 0%, 100% { transform: scale(${min}); opacity: ${opacityFrom}; }
188
+ 50% { transform: scale(${max}); opacity: ${opacityTo}; }
189
+ }`;
190
+ const childProps = children.props;
191
+ const existingStyle = childProps.style ?? {};
192
+ const existingRef = childProps.ref;
193
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
194
+ /* @__PURE__ */ jsx("style", { children: keyframes }),
195
+ cloneElement(children, {
196
+ ref: existingRef ? mergeRefs(existingRef) : void 0,
197
+ style: {
198
+ ...existingStyle,
199
+ animation: `${name} ${duration}s ease-in-out infinite`,
200
+ animationPlayState: paused ? "paused" : "running"
201
+ }
202
+ })
203
+ ] });
204
+ }
205
+ function Float({
206
+ children,
207
+ distance = 6,
208
+ duration = 3,
209
+ rotate = 0,
210
+ paused = false
211
+ }) {
212
+ const id = useId().replace(/:/g, "");
213
+ const [hydrated, setHydrated] = useState(false);
214
+ useEffect(() => {
215
+ setHydrated(true);
216
+ }, []);
217
+ if (!isValidElement(children)) return children;
218
+ if (!hydrated) return children;
219
+ const name = `float-${id}`;
220
+ const rotA = rotate ? ` rotate(${-rotate}deg)` : "";
221
+ const rotB = rotate ? ` rotate(${rotate}deg)` : "";
222
+ const keyframes = `@keyframes ${name} {
223
+ 0%, 100% { transform: translateY(0px)${rotA}; }
224
+ 50% { transform: translateY(${-distance}px)${rotB}; }
225
+ }`;
226
+ const childProps = children.props;
227
+ const existingStyle = childProps.style ?? {};
228
+ const existingRef = childProps.ref;
229
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
230
+ /* @__PURE__ */ jsx("style", { children: keyframes }),
231
+ cloneElement(children, {
232
+ ...existingRef ? { ref: existingRef } : {},
233
+ style: {
234
+ ...existingStyle,
235
+ animation: `${name} ${duration}s ease-in-out infinite`,
236
+ animationPlayState: paused ? "paused" : "running"
237
+ }
238
+ })
239
+ ] });
240
+ }
241
+
242
+ export { AnimateIn, AnimateOnView, Float, Pulse, Stagger };
243
+ //# sourceMappingURL=animate.js.map
244
+ //# sourceMappingURL=animate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/animate.tsx"],"names":[],"mappings":";;;;AA0GA,IAAM,aAAA,GAAgB;AAAA,EACpB,EAAA,EAAI,EAAE,IAAA,EAAM,YAAA,EAAc,OAAO,EAAA,EAAG;AAAA,EACpC,IAAA,EAAM,EAAE,IAAA,EAAM,YAAA,EA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AAQ,CAAA,sBAAA,CAAA;AAAA,QAC9B,kBAAA,EAAoB,SAAS,QAAA,GAAW;AAAA;AAC1C,KAC0B;AAAA,GAAA,EAC9B,CAAA;AAEJ","file":"animate.js","sourcesContent":["\"use client\"\n\nimport {\n Children,\n type CSSProperties,\n type ReactElement,\n type Ref,\n cloneElement,\n isValidElement,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\"\nimport { useInView, type Transition } from \"motion/react\"\n\n// ── Types ────────────────────────────────────────────────────────────\n\ntype Direction = \"up\" | \"down\" | \"left\" | \"right\"\n\ninterface AnimateOnViewProps {\n children: ReactElement\n /** Delay in seconds before animation starts. Default: 0 */\n delay?: number\n /** Direction to animate from. Default: 'down' */\n from?: Direction\n /** Distance in px. Default: 20 */\n distance?: number\n /** Also scale in (0.85 → 1). Default: false */\n scale?: boolean\n /** Blur in from a given amount in px. Default: false */\n blur?: boolean | number\n /** Rotate in from a given angle in degrees. Default: 0 */\n rotate?: number\n /** 3D flip entrance along the axis matching `from`. Default: false */\n flip?: boolean\n /** Spring easing with overshoot. Default: false */\n spring?: boolean\n /** Trigger once or every time it enters view. Default: true */\n once?: boolean\n /** Custom transition override */\n transition?: Transition\n}\n\ninterface AnimateInProps {\n children: ReactElement\n /** Delay in seconds before animation starts. Default: 0 */\n delay?: number\n /** Direction to animate from. Default: 'down' */\n from?: Direction\n /** Distance in px. Default: 20 */\n distance?: number\n /** Also scale in (0.85 → 1). Default: false */\n scale?: boolean\n /** Blur in from a given amount in px. Default: false */\n blur?: boolean | number\n /** Rotate in from a given angle in degrees. Default: 0 */\n rotate?: number\n /** 3D flip entrance along the axis matching `from`. Default: false */\n flip?: boolean\n /** Spring easing with overshoot. Default: false */\n spring?: boolean\n /** Custom transition override */\n transition?: Transition\n}\n\ninterface StaggerProps {\n children: ReactElement[]\n /** Delay increment between each child in seconds. Default: 0.08 */\n interval?: number\n /** Base delay before the first child animates in seconds. Default: 0 */\n baseDelay?: number\n}\n\ninterface PulseProps {\n children: ReactElement\n /** Min scale factor. Default: 0.97 */\n min?: number\n /** Max scale factor. Default: 1.03 */\n max?: number\n /** Animation duration in seconds. Default: 2 */\n duration?: number\n /** Also pulse opacity between these bounds [min, max]. Off by default. */\n opacity?: [number, number]\n /** Pause animation. Default: false */\n paused?: boolean\n}\n\ninterface FloatProps {\n children: ReactElement\n /** Vertical float distance in px. Default: 6 */\n distance?: number\n /** Animation duration in seconds. Default: 3 */\n duration?: number\n /** Also rotate slightly while floating (degrees). Default: 0 */\n rotate?: number\n /** Pause animation. Default: false */\n paused?: boolean\n}\n\n// ── Internals ────────────────────────────────────────────────────────\n\n/**\n * Direction map: `from` means where the element COMES FROM.\n * `from=\"left\"` = starts to the left, slides right into place.\n */\nconst DIRECTION_MAP = {\n up: { prop: \"translateY\", value: -1 },\n down: { prop: \"translateY\", value: 1 },\n left: { prop: \"translateX\", value: -1 },\n right: { prop: \"translateX\", value: 1 },\n} as const\n\n/** Flip axis: vertical directions flip around X, horizontal around Y */\nconst FLIP_MAP = {\n up: \"rotateX(90deg)\",\n down: \"rotateX(-90deg)\",\n left: \"rotateY(-90deg)\",\n right: \"rotateY(90deg)\",\n} as const\n\n/** CSS cubic-bezier that overshoots then settles — feels like a spring */\nconst SPRING_EASE = \"cubic-bezier(0.34, 1.56, 0.64, 1)\"\n\ninterface BuildStylesOptions {\n from: Direction\n distance: number\n doScale: boolean\n blur: boolean | number\n rotate: number\n flip: boolean\n}\n\nfunction buildStyles(opts: BuildStylesOptions) {\n const { from, distance, doScale, blur, rotate, flip } = opts\n const dir = DIRECTION_MAP[from]\n\n const hiddenParts: string[] = []\n if (flip) hiddenParts.push(\"perspective(800px)\")\n hiddenParts.push(`${dir.prop}(${dir.value * distance}px)`)\n if (doScale) hiddenParts.push(\"scale(0.85)\")\n if (rotate) hiddenParts.push(`rotate(${rotate}deg)`)\n if (flip) hiddenParts.push(FLIP_MAP[from])\n\n const visibleParts: string[] = []\n if (flip) visibleParts.push(\"perspective(800px)\")\n visibleParts.push(\"translateX(0) translateY(0)\")\n if (doScale) visibleParts.push(\"scale(1)\")\n if (rotate) visibleParts.push(\"rotate(0deg)\")\n if (flip) visibleParts.push(from === \"up\" || from === \"down\" ? \"rotateX(0deg)\" : \"rotateY(0deg)\")\n\n const blurPx = blur === true ? 10 : typeof blur === \"number\" ? blur : 0\n\n const hidden: CSSProperties = {\n opacity: \"0\",\n transform: hiddenParts.join(\" \"),\n }\n\n const visible: CSSProperties = {\n opacity: \"1\",\n transform: visibleParts.join(\" \"),\n }\n\n if (blurPx > 0) {\n hidden.filter = `blur(${blurPx}px)`\n visible.filter = \"blur(0px)\"\n }\n\n return { hidden, visible, hasFilter: blurPx > 0 }\n}\n\nfunction mergeRefs<T>(...refs: (Ref<T> | undefined)[]) {\n return (el: T | null) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") ref(el)\n else if (ref && typeof ref === \"object\") {\n ;(ref as { current: T | null }).current = el\n }\n })\n }\n}\n\nfunction getTransitionParams(transition?: Transition, useSpring?: boolean) {\n const duration =\n (transition as Record<string, number>)?.duration ?? 0.5\n const ease =\n useSpring ? SPRING_EASE : ((transition as Record<string, string>)?.ease ?? \"ease-out\")\n return { duration, ease }\n}\n\nfunction buildTransitionStr(\n duration: number,\n ease: string,\n delay: number,\n hasFilter: boolean,\n) {\n const parts = [\n `opacity ${duration}s ${ease} ${delay}s`,\n `transform ${duration}s ${ease} ${delay}s`,\n ]\n if (hasFilter) parts.push(`filter ${duration}s ${ease} ${delay}s`)\n return parts.join(\", \")\n}\n\n// ── AnimateOnView ────────────────────────────────────────────────────\n\n/**\n * Animates a child element when it scrolls into view.\n *\n * Zero DOM overhead — applies styles directly to the child via cloneElement.\n * Renders children unchanged on server to avoid hydration mismatch.\n *\n * @example\n * ```tsx\n * <AnimateOnView from=\"up\" blur scale>\n * <Card>Hello</Card>\n * </AnimateOnView>\n * ```\n */\nfunction AnimateOnView({\n children,\n delay = 0,\n from = \"down\",\n distance = 20,\n scale = false,\n blur = false,\n rotate = 0,\n flip = false,\n spring = false,\n once = true,\n transition,\n}: AnimateOnViewProps) {\n const ref = useRef<HTMLElement>(null)\n const [hydrated, setHydrated] = useState(false)\n const isInView = useInView(ref, { once, margin: \"-50px\" })\n\n useEffect(() => {\n setHydrated(true)\n }, [])\n\n if (!isValidElement(children)) return children\n\n const childProps = children.props as Record<string, unknown>\n const existingStyle = (childProps.style ?? {}) as CSSProperties\n const existingRef = (childProps as { ref?: Ref<HTMLElement> }).ref\n\n if (!hydrated) {\n return cloneElement(children, {\n ref: mergeRefs(ref, existingRef),\n } as Record<string, unknown>)\n }\n\n const styles = buildStyles({ from, distance, doScale: scale, blur, rotate, flip })\n const { duration, ease } = getTransitionParams(transition, spring)\n const currentStyle = isInView ? styles.visible : styles.hidden\n const transitionStr = buildTransitionStr(duration, ease, delay, styles.hasFilter)\n\n return cloneElement(children, {\n ref: mergeRefs(ref, existingRef),\n style: {\n ...existingStyle,\n ...currentStyle,\n ...(isInView ? { transition: transitionStr } : {}),\n willChange: \"opacity, transform\",\n },\n } as Record<string, unknown>)\n}\n\n// ── AnimateIn ────────────────────────────────────────────────────────\n\n/**\n * Animates a child element immediately on mount.\n *\n * Zero DOM overhead — applies styles directly to the child via cloneElement.\n * Uses a two-phase approach: hidden → visible with requestAnimationFrame.\n *\n * @example\n * ```tsx\n * <AnimateIn from=\"up\" blur spring>\n * <h1>Welcome</h1>\n * </AnimateIn>\n * ```\n */\nfunction AnimateIn({\n children,\n delay = 0,\n from = \"down\",\n distance = 20,\n scale = false,\n blur = false,\n rotate = 0,\n flip = false,\n spring = false,\n transition,\n}: AnimateInProps) {\n const ref = useRef<HTMLElement>(null)\n const [phase, setPhase] = useState<\"server\" | \"hidden\" | \"visible\">(\"server\")\n\n useEffect(() => {\n setPhase(\"hidden\")\n requestAnimationFrame(() => {\n requestAnimationFrame(() => setPhase(\"visible\"))\n })\n }, [])\n\n if (!isValidElement(children)) return children\n\n const childProps = children.props as Record<string, unknown>\n const existingStyle = (childProps.style ?? {}) as CSSProperties\n const existingRef = (childProps as { ref?: Ref<HTMLElement> }).ref\n\n if (phase === \"server\") {\n return cloneElement(children, {\n ref: mergeRefs(ref, existingRef),\n } as Record<string, unknown>)\n }\n\n const styles = buildStyles({ from, distance, doScale: scale, blur, rotate, flip })\n const { duration, ease } = getTransitionParams(transition, spring)\n const currentStyle = phase === \"visible\" ? styles.visible : styles.hidden\n const transitionStr = buildTransitionStr(duration, ease, delay, styles.hasFilter)\n\n return cloneElement(children, {\n ref: mergeRefs(ref, existingRef),\n style: {\n ...existingStyle,\n ...currentStyle,\n ...(phase === \"visible\" ? { transition: transitionStr } : {}),\n willChange: \"opacity, transform\",\n },\n } as Record<string, unknown>)\n}\n\n// ── Stagger ──────────────────────────────────────────────────────────\n\n/**\n * Auto-staggers delay on child AnimateIn/AnimateOnView elements.\n * Eliminates manual `delay={i * 0.08}` math.\n *\n * @example\n * ```tsx\n * <Stagger interval={0.1}>\n * <AnimateIn from=\"up\"><Card>One</Card></AnimateIn>\n * <AnimateIn from=\"up\"><Card>Two</Card></AnimateIn>\n * </Stagger>\n * ```\n */\nfunction Stagger({\n children,\n interval = 0.08,\n baseDelay = 0,\n}: StaggerProps) {\n return (\n <>\n {Children.map(children, (child, index) => {\n if (!isValidElement(child)) return child\n return cloneElement(child as ReactElement<{ delay?: number }>, {\n delay: baseDelay + index * interval,\n })\n })}\n </>\n )\n}\n\n// ── Pulse ────────────────────────────────────────────────────────────\n\n/**\n * Continuous, subtle scale pulse. Great for live indicators and CTAs.\n * Zero DOM overhead — injects a scoped keyframe via `<style>`.\n *\n * @example\n * ```tsx\n * <Pulse>\n * <span className=\"size-3 rounded-full bg-green-500\" />\n * </Pulse>\n * ```\n */\nfunction Pulse({\n children,\n min = 0.97,\n max = 1.03,\n duration = 2,\n opacity,\n paused = false,\n}: PulseProps) {\n const id = useId().replace(/:/g, \"\")\n const [hydrated, setHydrated] = useState(false)\n\n useEffect(() => {\n setHydrated(true)\n }, [])\n\n if (!isValidElement(children)) return children\n if (!hydrated) return children\n\n const name = `pulse-${id}`\n const opacityFrom = opacity?.[0] ?? 1\n const opacityTo = opacity?.[1] ?? 1\n\n const keyframes = `@keyframes ${name} {\n 0%, 100% { transform: scale(${min}); opacity: ${opacityFrom}; }\n 50% { transform: scale(${max}); opacity: ${opacityTo}; }\n}`\n\n const childProps = children.props as Record<string, unknown>\n const existingStyle = (childProps.style ?? {}) as CSSProperties\n const existingRef = (childProps as { ref?: Ref<HTMLElement> }).ref\n\n return (\n <>\n <style>{keyframes}</style>\n {cloneElement(children, {\n ref: existingRef ? mergeRefs(existingRef) : undefined,\n style: {\n ...existingStyle,\n animation: `${name} ${duration}s ease-in-out infinite`,\n animationPlayState: paused ? \"paused\" : \"running\",\n },\n } as Record<string, unknown>)}\n </>\n )\n}\n\n// ── Float ────────────────────────────────────────────────────────────\n\n/**\n * Gentle continuous up/down float. Perfect for decorative elements.\n * Zero DOM overhead — injects a scoped keyframe via `<style>`.\n *\n * @example\n * ```tsx\n * <Float distance={10} duration={4}>\n * <Card>Floating</Card>\n * </Float>\n * ```\n */\nfunction Float({\n children,\n distance = 6,\n duration = 3,\n rotate = 0,\n paused = false,\n}: FloatProps) {\n const id = useId().replace(/:/g, \"\")\n const [hydrated, setHydrated] = useState(false)\n\n useEffect(() => {\n setHydrated(true)\n }, [])\n\n if (!isValidElement(children)) return children\n if (!hydrated) return children\n\n const name = `float-${id}`\n const rotA = rotate ? ` rotate(${-rotate}deg)` : \"\"\n const rotB = rotate ? ` rotate(${rotate}deg)` : \"\"\n\n const keyframes = `@keyframes ${name} {\n 0%, 100% { transform: translateY(0px)${rotA}; }\n 50% { transform: translateY(${-distance}px)${rotB}; }\n}`\n\n const childProps = children.props as Record<string, unknown>\n const existingStyle = (childProps.style ?? {}) as CSSProperties\n const existingRef = (childProps as { ref?: Ref<HTMLElement> }).ref\n\n return (\n <>\n <style>{keyframes}</style>\n {cloneElement(children, {\n ...(existingRef ? { ref: existingRef } : {}),\n style: {\n ...existingStyle,\n animation: `${name} ${duration}s ease-in-out infinite`,\n animationPlayState: paused ? \"paused\" : \"running\",\n },\n } as Record<string, unknown>)}\n </>\n )\n}\n\n// ── Exports ──────────────────────────────────────────────────────────\n\nexport { AnimateOnView, AnimateIn, Stagger, Pulse, Float }\nexport type {\n AnimateOnViewProps,\n AnimateInProps,\n StaggerProps,\n PulseProps,\n FloatProps,\n Direction,\n}\n"]}
package/dist/badge.d.ts CHANGED
@@ -4,7 +4,7 @@ import { useRender } from '@base-ui/react/use-render';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const badgeVariants: (props?: ({
7
- variant?: "link" | "default" | "solid" | "outline" | "secondary" | "ghost" | "success" | "destructive" | "warning" | null | undefined;
7
+ variant?: "default" | "destructive" | "link" | "solid" | "outline" | "secondary" | "ghost" | "success" | "warning" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  type BadgeProps = useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>;
10
10
  declare function Badge({ className, variant, render, ...props }: BadgeProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
package/dist/button.d.ts CHANGED
@@ -5,8 +5,8 @@ import { Button as Button$1 } from '@base-ui/react/button';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
 
7
7
  declare const buttonVariants: (props?: ({
8
- variant?: "link" | "default" | "solid" | "outline" | "secondary" | "ghost" | "success" | "destructive" | null | undefined;
9
- size?: "default" | "sm" | "lg" | "xs" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
8
+ variant?: "default" | "destructive" | "link" | "solid" | "outline" | "secondary" | "ghost" | "success" | null | undefined;
9
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  type ButtonProps = React.ComponentProps<typeof Button$1> & VariantProps<typeof buttonVariants>;
12
12
  declare function Button({ className, variant, size, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
@@ -1,5 +1,5 @@
1
- import { Button } from './chunk-OUFYQLVN.js';
2
1
  import { CloseIcon } from './chunk-DIGOLJIR.js';
2
+ import { Button } from './chunk-OUFYQLVN.js';
3
3
  import { cn } from './chunk-76UQO56T.js';
4
4
  import { Drawer as Drawer$1 } from '@base-ui/react/drawer';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -139,5 +139,5 @@ function DrawerDescription({
139
139
  }
140
140
 
141
141
  export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
142
- //# sourceMappingURL=chunk-MO4KRZFJ.js.map
143
- //# sourceMappingURL=chunk-MO4KRZFJ.js.map
142
+ //# sourceMappingURL=chunk-BKTJYX4M.js.map
143
+ //# sourceMappingURL=chunk-BKTJYX4M.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/drawer.tsx"],"names":["DrawerPrimitive"],"mappings":";;;;;;AAwBA,SAAS,MAAA,CAAO,EAAE,GAAG,KAAA,EAAM,EAAgB;AACzC,EAAA,2BAAQA,QAAA,CAAgB,IAAA,EAAhB,EAAqB,WAAA,EAAU,QAAA,EAAU,GAAG,KAAA,EAAO,CAAA;AAC7D;AAEA,SAAS,aAAA,CAAc,EAAE,GAAG,KAAA,EAAM,EAAuB;AACvD,EAAA,2BAAQA,QAAA,CAAgB,OAAA,EAAhB,EAAwB,WAAA,EAAU,gBAAA,EAAkB,GAAG,KAAA,EAAO,CAAA;AACxE;AAEA,SAAS,YAAA,CAAa,EAAE,GAAG,KAAA,EAAM,EAAsB;AACrD,EAAA,2BAAQA,QAAA,CAAgB,MAAA,EAAhB,EAAuB,WAAA,EAAU,eAAA,EAAiB,GAAG,KAAA,EAAO,CAAA;AACtE;AAEA,SAAS,WAAA,CAAY,EAAE,GAAG,KAAA,EAAM,EAAqB;AACnD,EAAA,2BAAQA,QAAA,C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,GAAA;AAAA,IAACA,QAAA,CAAgB,WAAA;AAAA,IAAhB;AAAA,MACC,WAAA,EAAU,oBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ","file":"chunk-MO4KRZFJ.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"./lib/utils\"\nimport { Button } from \"./button\"\nimport { CloseIcon } from \"./lib/internal-icons\"\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>\ntype DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>\ntype DrawerPortalProps = React.ComponentProps<typeof DrawerPrimitive.Portal>\ntype DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>\ntype DrawerOverlayProps = React.ComponentProps<typeof DrawerPrimitive.Backdrop>\ntype DrawerPopupProps = React.ComponentProps<typeof DrawerPrimitive.Popup>\ntype DrawerTitleProps = React.ComponentProps<typeof DrawerPrimitive.Title>\ntype DrawerDescriptionProps = React.ComponentProps<typeof DrawerPrimitive.Description>\ntype DrawerHeaderProps = React.ComponentProps<\"div\">\ntype DrawerFooterProps = React.ComponentProps<\"div\">\n\ntype DrawerContentProps = DrawerPopupProps & {\n showCloseButton?: boolean\n}\n\nfunction Drawer({ ...props }: DrawerProps) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />\n}\n\nfunction DrawerTrigger({ ...props }: DrawerTriggerProps) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({ ...props }: DrawerPortalProps) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose({ ...props }: DrawerCloseProps) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({ className, ...props }: DrawerOverlayProps) {\n return (\n <DrawerPrimitive.Backdrop\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/10 transition-opacity duration-300 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 supports-backdrop-filter:backdrop-blur-xs\",\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({\n className,\n children,\n showCloseButton = false,\n ...props\n}: DrawerContentProps) {\n return (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Popup\n data-slot=\"drawer-content\"\n className={cn(\n // Base layout & appearance\n \"group/drawer-content bg-background fixed z-50 flex flex-col overflow-y-auto text-sm shadow-lg outline-none\",\n // Transition — animate translate, disable during swipe\n \"transition-[translate] duration-300 ease-out data-[swiping]:duration-0\",\n // Bottom drawer (swipeDirection=\"down\")\n \"data-[swipe-direction=down]:inset-x-0 data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:mt-24 data-[swipe-direction=down]:max-h-[80vh] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=down]:border-t\",\n // Top drawer (swipeDirection=\"up\")\n \"data-[swipe-direction=up]:inset-x-0 data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:mb-24 data-[swipe-direction=up]:max-h-[80vh] data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=up]:border-b\",\n // Left drawer (swipeDirection=\"left\")\n \"data-[swipe-direction=left]:inset-y-0 data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:w-3/4 data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=left]:border-r data-[swipe-direction=left]:sm:max-w-sm\",\n // Right drawer (swipeDirection=\"right\")\n \"data-[swipe-direction=right]:inset-y-0 data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:w-3/4 data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=right]:border-l data-[swipe-direction=right]:sm:max-w-sm\",\n // Enter/exit slide — bottom\n \"data-[swipe-direction=down]:data-[starting-style]:translate-y-full data-[swipe-direction=down]:data-[ending-style]:translate-y-full\",\n // Enter/exit slide — top\n \"data-[swipe-direction=up]:data-[starting-style]:-translate-y-full data-[swipe-direction=up]:data-[ending-style]:-translate-y-full\",\n // Enter/exit slide — left\n \"data-[swipe-direction=left]:data-[starting-style]:-translate-x-full data-[swipe-direction=left]:data-[ending-style]:-translate-x-full\",\n // Enter/exit slide — right\n \"data-[swipe-direction=right]:data-[starting-style]:translate-x-full data-[swipe-direction=right]:data-[ending-style]:translate-x-full\",\n className,\n )}\n {...props}\n >\n {/* Drag handle — visible only for bottom drawers */}\n <div className=\"bg-muted mx-auto mt-4 hidden h-1 w-[100px] shrink-0 rounded-full group-data-[swipe-direction=down]/drawer-content:block\" />\n {children}\n {showCloseButton && (\n <DrawerPrimitive.Close\n data-slot=\"drawer-close\"\n render={\n <Button\n variant=\"ghost\"\n className=\"absolute top-2 right-2\"\n size=\"icon-sm\"\n />\n }\n >\n <CloseIcon />\n <span className=\"sr-only\">Close</span>\n </DrawerPrimitive.Close>\n )}\n </DrawerPrimitive.Popup>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[swipe-direction=down]/drawer-content:text-center group-data-[swipe-direction=up]/drawer-content:text-center md:text-left\",\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerTitleProps) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"text-foreground text-base font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerDescriptionProps) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n"]}
1
+ {"version":3,"sources":["../src/drawer.tsx"],"names":["DrawerPrimitive"],"mappings":";;;;;;AAwBA,SAAS,MAAA,CAAO,EAAE,GAAG,KAAA,EAAM,EAAgB;AACzC,EAAA,2BAAQA,QAAA,CAAgB,IAAA,EAAhB,EAAqB,WAAA,EAAU,QAAA,EAAU,GAAG,KAAA,EAAO,CAAA;AAC7D;AAEA,SAAS,aAAA,CAAc,EAAE,GAAG,KAAA,EAAM,EAAuB;AACvD,EAAA,2BAAQA,QAAA,CAAgB,OAAA,EAAhB,EAAwB,WAAA,EAAU,gBAAA,EAAkB,GAAG,KAAA,EAAO,CAAA;AACxE;AAEA,SAAS,YAAA,CAAa,EAAE,GAAG,KAAA,EAAM,EAAsB;AACrD,EAAA,2BAAQA,QAAA,CAAgB,MAAA,EAAhB,EAAuB,WAAA,EAAU,eAAA,EAAiB,GAAG,KAAA,EAAO,CAAA;AACtE;AAEA,SAAS,WAAA,CAAY,EAAE,GAAG,KAAA,EAAM,EAAqB;AACnD,EAAA,2BAAQA,QAAA,CAAgB,KAAA,EAAhB,EAAsB,WAAA,EAAU,cAAA,EAAgB,GAAG,KAAA,EAAO,CAAA;AACpE;AAEA,SAAS,aAAA,CAAc,EAAE,SAAA,EAAW,GAAG,OAAM,EAAuB;AAClE,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAgB,QAAA;AAAA,IAAhB;AAAA,MACC,WAAA,EAAU,gBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,wKAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,aAAA,CAAc;AAAA,EACrB,SAAA;AAAA,EACA,QAAA;AAA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AG,OAAM,EAAsB;AAChE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,eAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,gKAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAAsB;AAChE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,eAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,iCAAA,EAAmC,SAAS,CAAA;AAAA,MACzD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqB;AAC9D,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAgB,KAAA;AAAA,IAAhB;AAAA,MACC,WAAA,EAAU,cAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,uCAAA,EAAyC,SAAS,CAAA;AAAA,MAC/D,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,iBAAA,CAAkB;AAAA,EACzB,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA2B;AACzB,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAgB,WAAA;AAAA,IAAhB;AAAA,MACC,WAAA,EAAU,oBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ","file":"chunk-BKTJYX4M.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"./lib/utils\"\nimport { Button } from \"./button\"\nimport { CloseIcon } from \"./lib/internal-icons\"\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>\ntype DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>\ntype DrawerPortalProps = React.ComponentProps<typeof DrawerPrimitive.Portal>\ntype DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>\ntype DrawerOverlayProps = React.ComponentProps<typeof DrawerPrimitive.Backdrop>\ntype DrawerPopupProps = React.ComponentProps<typeof DrawerPrimitive.Popup>\ntype DrawerTitleProps = React.ComponentProps<typeof DrawerPrimitive.Title>\ntype DrawerDescriptionProps = React.ComponentProps<typeof DrawerPrimitive.Description>\ntype DrawerHeaderProps = React.ComponentProps<\"div\">\ntype DrawerFooterProps = React.ComponentProps<\"div\">\n\ntype DrawerContentProps = DrawerPopupProps & {\n showCloseButton?: boolean\n}\n\nfunction Drawer({ ...props }: DrawerProps) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />\n}\n\nfunction DrawerTrigger({ ...props }: DrawerTriggerProps) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({ ...props }: DrawerPortalProps) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose({ ...props }: DrawerCloseProps) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({ className, ...props }: DrawerOverlayProps) {\n return (\n <DrawerPrimitive.Backdrop\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/10 transition-opacity duration-300 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 supports-backdrop-filter:backdrop-blur-xs\",\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({\n className,\n children,\n showCloseButton = false,\n ...props\n}: DrawerContentProps) {\n return (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Popup\n data-slot=\"drawer-content\"\n className={cn(\n // Base layout & appearance\n \"group/drawer-content bg-background fixed z-50 flex flex-col overflow-y-auto text-sm shadow-lg outline-none\",\n // Transition — animate translate, disable during swipe\n \"transition-[translate] duration-300 ease-out data-[swiping]:duration-0\",\n // Bottom drawer (swipeDirection=\"down\")\n \"data-[swipe-direction=down]:inset-x-0 data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:mt-24 data-[swipe-direction=down]:max-h-[80vh] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=down]:border-t\",\n // Top drawer (swipeDirection=\"up\")\n \"data-[swipe-direction=up]:inset-x-0 data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:mb-24 data-[swipe-direction=up]:max-h-[80vh] data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=up]:border-b\",\n // Left drawer (swipeDirection=\"left\")\n \"data-[swipe-direction=left]:inset-y-0 data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:w-3/4 data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=left]:border-r data-[swipe-direction=left]:sm:max-w-sm\",\n // Right drawer (swipeDirection=\"right\")\n \"data-[swipe-direction=right]:inset-y-0 data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:w-3/4 data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=right]:border-l data-[swipe-direction=right]:sm:max-w-sm\",\n // Enter/exit slide — bottom\n \"data-[swipe-direction=down]:data-[starting-style]:translate-y-full data-[swipe-direction=down]:data-[ending-style]:translate-y-full\",\n // Enter/exit slide — top\n \"data-[swipe-direction=up]:data-[starting-style]:-translate-y-full data-[swipe-direction=up]:data-[ending-style]:-translate-y-full\",\n // Enter/exit slide — left\n \"data-[swipe-direction=left]:data-[starting-style]:-translate-x-full data-[swipe-direction=left]:data-[ending-style]:-translate-x-full\",\n // Enter/exit slide — right\n \"data-[swipe-direction=right]:data-[starting-style]:translate-x-full data-[swipe-direction=right]:data-[ending-style]:translate-x-full\",\n className,\n )}\n {...props}\n >\n {/* Drag handle — visible only for bottom drawers */}\n <div className=\"bg-muted mx-auto mt-4 hidden h-1 w-[100px] shrink-0 rounded-full group-data-[swipe-direction=down]/drawer-content:block\" />\n {children}\n {showCloseButton && (\n <DrawerPrimitive.Close\n data-slot=\"drawer-close\"\n render={\n <Button\n variant=\"ghost\"\n className=\"absolute top-2 right-2\"\n size=\"icon-sm\"\n />\n }\n >\n <CloseIcon />\n <span className=\"sr-only\">Close</span>\n </DrawerPrimitive.Close>\n )}\n </DrawerPrimitive.Popup>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[swipe-direction=down]/drawer-content:text-center group-data-[swipe-direction=up]/drawer-content:text-center md:text-left\",\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerTitleProps) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"text-foreground text-base font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerDescriptionProps) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n"]}
package/dist/combobox.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { InputGroupButton, InputGroup, InputGroupInput, InputGroupAddon } from './chunk-IQ7YQ5XA.js';
2
2
  import './chunk-QRW37LRP.js';
3
3
  import './chunk-QFSEK4M6.js';
4
- import { Button } from './chunk-OUFYQLVN.js';
5
4
  import { ChevronDownIcon, CloseIcon, CheckIcon } from './chunk-DIGOLJIR.js';
5
+ import { Button } from './chunk-OUFYQLVN.js';
6
6
  import { cn } from './chunk-76UQO56T.js';
7
7
  import * as React from 'react';
8
8
  import { Combobox as Combobox$1 } from '@base-ui/react/combobox';
@@ -0,0 +1,73 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactElement } from 'react';
3
+
4
+ interface CountProps {
5
+ /** Target number or Date to count to */
6
+ to: number | Date;
7
+ /** Starting number. Default: 0. Ignored when `to` is a Date. */
8
+ from?: number;
9
+ /** Animation duration in milliseconds. Default: 900. Ignored when `to` is a Date. */
10
+ duration?: number;
11
+ /** Delay before starting in seconds. Default: 0 */
12
+ delay?: number;
13
+ /**
14
+ * Format the value for display.
15
+ * - For numbers: receives the current interpolated number.
16
+ * - For dates: receives remaining milliseconds.
17
+ * Default: toLocaleString() for numbers, dd:hh:mm:ss for dates.
18
+ */
19
+ format?: (value: number) => string;
20
+ /** Prefix string (e.g., "$"). Default: '' */
21
+ prefix?: string;
22
+ /** Suffix string (e.g., "%", "+"). Default: '' */
23
+ suffix?: string;
24
+ /** Element to render into. Receives the formatted value as children. */
25
+ children: ReactElement;
26
+ /** Trigger once. Default: true */
27
+ once?: boolean;
28
+ /** Easing function. Default: easeOut. Ignored when `to` is a Date. */
29
+ easing?: (t: number) => number;
30
+ /** Called when the count finishes (reaches target or date passes). */
31
+ onComplete?: () => void;
32
+ }
33
+ /** @deprecated Use `Count` instead. `CountUp` is an alias kept for backwards compatibility. */
34
+ type CountUpProps = CountProps;
35
+ /** Cubic ease-out: fast start, smooth deceleration */
36
+ declare function easeOut(t: number): number;
37
+ /**
38
+ * Animated number counter. Counts up, counts down, or live-counts to a date.
39
+ *
40
+ * Direction is automatic — if `from < to` it counts up, if `from > to` it
41
+ * counts down. When `to` is a Date, it becomes a live countdown that ticks
42
+ * every second.
43
+ *
44
+ * Zero wrapper — injects the formatted value as children via cloneElement.
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * // Count up
49
+ * <Count to={1234}>
50
+ * <span className="text-4xl font-bold tabular-nums" />
51
+ * </Count>
52
+ *
53
+ * // Count down
54
+ * <Count from={100} to={0} onComplete={() => alert("Done!")}>
55
+ * <span className="text-4xl font-bold tabular-nums" />
56
+ * </Count>
57
+ *
58
+ * // Live countdown to a date
59
+ * <Count to={new Date("2026-04-01T00:00:00")}>
60
+ * <span className="text-2xl font-mono tabular-nums" />
61
+ * </Count>
62
+ *
63
+ * // Custom date format
64
+ * <Count to={launchDate} format={(ms) => `${Math.ceil(ms / 86400000)} days left`}>
65
+ * <span className="text-xl" />
66
+ * </Count>
67
+ * ```
68
+ */
69
+ declare function Count({ to, from: start, duration, delay, format, prefix, suffix, children, once, easing, onComplete, }: CountProps): react_jsx_runtime.JSX.Element;
70
+ /** @deprecated Use `Count` instead */
71
+ declare const CountUp: typeof Count;
72
+
73
+ export { Count, type CountProps, CountUp, type CountUpProps, easeOut };