kineto 0.1.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/LICENSE +21 -0
- package/README.md +279 -0
- package/base.css +46 -0
- package/dist/accordion.d.ts +13 -0
- package/dist/accordion.js +161 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert.d.ts +20 -0
- package/dist/alert.js +137 -0
- package/dist/alert.js.map +1 -0
- package/dist/animated-number.d.ts +16 -0
- package/dist/animated-number.js +40 -0
- package/dist/animated-number.js.map +1 -0
- package/dist/area-chart.d.ts +16 -0
- package/dist/area-chart.js +138 -0
- package/dist/area-chart.js.map +1 -0
- package/dist/aspect-ratio.d.ts +6 -0
- package/dist/aspect-ratio.js +9 -0
- package/dist/aspect-ratio.js.map +1 -0
- package/dist/avatar.d.ts +18 -0
- package/dist/avatar.js +202 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge.d.ts +14 -0
- package/dist/badge.js +54 -0
- package/dist/badge.js.map +1 -0
- package/dist/bar-chart.d.ts +19 -0
- package/dist/bar-chart.js +139 -0
- package/dist/bar-chart.js.map +1 -0
- package/dist/bento-grid.d.ts +24 -0
- package/dist/bento-grid.js +129 -0
- package/dist/bento-grid.js.map +1 -0
- package/dist/breadcrumbs.d.ts +13 -0
- package/dist/breadcrumbs.js +50 -0
- package/dist/breadcrumbs.js.map +1 -0
- package/dist/button-group.d.ts +9 -0
- package/dist/button-group.js +29 -0
- package/dist/button-group.js.map +1 -0
- package/dist/button.d.ts +16 -0
- package/dist/button.js +131 -0
- package/dist/button.js.map +1 -0
- package/dist/calendar.d.ts +11 -0
- package/dist/calendar.js +185 -0
- package/dist/calendar.js.map +1 -0
- package/dist/card.d.ts +15 -0
- package/dist/card.js +131 -0
- package/dist/card.js.map +1 -0
- package/dist/carousel.d.ts +14 -0
- package/dist/carousel.js +143 -0
- package/dist/carousel.js.map +1 -0
- package/dist/chart-tooltip.d.ts +18 -0
- package/dist/chart-tooltip.js +30 -0
- package/dist/chart-tooltip.js.map +1 -0
- package/dist/checkbox.d.ts +6 -0
- package/dist/checkbox.js +88 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/cn.d.ts +10 -0
- package/dist/cn.js +10 -0
- package/dist/cn.js.map +1 -0
- package/dist/code-block.d.ts +25 -0
- package/dist/code-block.js +155 -0
- package/dist/code-block.js.map +1 -0
- package/dist/collapsible.d.ts +12 -0
- package/dist/collapsible.js +125 -0
- package/dist/collapsible.js.map +1 -0
- package/dist/color-picker.d.ts +12 -0
- package/dist/color-picker.js +180 -0
- package/dist/color-picker.js.map +1 -0
- package/dist/command.d.ts +88 -0
- package/dist/command.js +277 -0
- package/dist/command.js.map +1 -0
- package/dist/confetti.d.ts +25 -0
- package/dist/confetti.js +109 -0
- package/dist/confetti.js.map +1 -0
- package/dist/container.d.ts +19 -0
- package/dist/container.js +41 -0
- package/dist/container.js.map +1 -0
- package/dist/content-divider.d.ts +7 -0
- package/dist/content-divider.js +35 -0
- package/dist/content-divider.js.map +1 -0
- package/dist/context-menu.d.ts +30 -0
- package/dist/context-menu.js +213 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/copy-button.d.ts +17 -0
- package/dist/copy-button.js +107 -0
- package/dist/copy-button.js.map +1 -0
- package/dist/dashboard-showcase.d.ts +7 -0
- package/dist/dashboard-showcase.js +2560 -0
- package/dist/dashboard-showcase.js.map +1 -0
- package/dist/data-table.d.ts +130 -0
- package/dist/data-table.js +1620 -0
- package/dist/data-table.js.map +1 -0
- package/dist/date-picker.d.ts +12 -0
- package/dist/date-picker.js +261 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/dialog.d.ts +23 -0
- package/dist/dialog.js +188 -0
- package/dist/dialog.js.map +1 -0
- package/dist/dock.d.ts +17 -0
- package/dist/dock.js +77 -0
- package/dist/dock.js.map +1 -0
- package/dist/donut-chart.d.ts +18 -0
- package/dist/donut-chart.js +92 -0
- package/dist/donut-chart.js.map +1 -0
- package/dist/drawer.d.ts +26 -0
- package/dist/drawer.js +166 -0
- package/dist/drawer.js.map +1 -0
- package/dist/dropdown-menu.d.ts +22 -0
- package/dist/dropdown-menu.js +163 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/empty-state.d.ts +13 -0
- package/dist/empty-state.js +149 -0
- package/dist/empty-state.js.map +1 -0
- package/dist/featured-icon.d.ts +16 -0
- package/dist/featured-icon.js +56 -0
- package/dist/featured-icon.js.map +1 -0
- package/dist/file-uploader.d.ts +11 -0
- package/dist/file-uploader.js +212 -0
- package/dist/file-uploader.js.map +1 -0
- package/dist/flex.d.ts +30 -0
- package/dist/flex.js +89 -0
- package/dist/flex.js.map +1 -0
- package/dist/form.d.ts +28 -0
- package/dist/form.js +139 -0
- package/dist/form.js.map +1 -0
- package/dist/format-time.d.ts +18 -0
- package/dist/format-time.js +54 -0
- package/dist/format-time.js.map +1 -0
- package/dist/gap.d.ts +9 -0
- package/dist/gap.js +34 -0
- package/dist/gap.js.map +1 -0
- package/dist/gradient-border.d.ts +15 -0
- package/dist/gradient-border.js +79 -0
- package/dist/gradient-border.js.map +1 -0
- package/dist/gradient-text.d.ts +12 -0
- package/dist/gradient-text.js +43 -0
- package/dist/gradient-text.js.map +1 -0
- package/dist/grid.d.ts +25 -0
- package/dist/grid.js +77 -0
- package/dist/grid.js.map +1 -0
- package/dist/hover-card.d.ts +8 -0
- package/dist/hover-card.js +93 -0
- package/dist/hover-card.js.map +1 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.js +93 -0
- package/dist/inline-edit.d.ts +20 -0
- package/dist/inline-edit.js +107 -0
- package/dist/inline-edit.js.map +1 -0
- package/dist/input.d.ts +6 -0
- package/dist/input.js +31 -0
- package/dist/input.js.map +1 -0
- package/dist/kbd.d.ts +16 -0
- package/dist/kbd.js +35 -0
- package/dist/kbd.js.map +1 -0
- package/dist/label.d.ts +6 -0
- package/dist/label.js +31 -0
- package/dist/label.js.map +1 -0
- package/dist/line-chart.d.ts +17 -0
- package/dist/line-chart.js +120 -0
- package/dist/line-chart.js.map +1 -0
- package/dist/logo-cloud.d.ts +14 -0
- package/dist/logo-cloud.js +106 -0
- package/dist/logo-cloud.js.map +1 -0
- package/dist/masonry.d.ts +15 -0
- package/dist/masonry.js +63 -0
- package/dist/masonry.js.map +1 -0
- package/dist/menubar.d.ts +31 -0
- package/dist/menubar.js +250 -0
- package/dist/menubar.js.map +1 -0
- package/dist/motion-presets.d.ts +70 -0
- package/dist/motion-presets.js +71 -0
- package/dist/motion-presets.js.map +1 -0
- package/dist/navigation-menu.d.ts +15 -0
- package/dist/navigation-menu.js +181 -0
- package/dist/navigation-menu.js.map +1 -0
- package/dist/notification-center.d.ts +35 -0
- package/dist/notification-center.js +384 -0
- package/dist/notification-center.js.map +1 -0
- package/dist/page-header.d.ts +13 -0
- package/dist/page-header.js +37 -0
- package/dist/page-header.js.map +1 -0
- package/dist/pagination.d.ts +13 -0
- package/dist/pagination.js +103 -0
- package/dist/pagination.js.map +1 -0
- package/dist/popover.d.ts +9 -0
- package/dist/popover.js +93 -0
- package/dist/popover.js.map +1 -0
- package/dist/progress-steps.d.ts +17 -0
- package/dist/progress-steps.js +158 -0
- package/dist/progress-steps.js.map +1 -0
- package/dist/progress.d.ts +13 -0
- package/dist/progress.js +98 -0
- package/dist/progress.js.map +1 -0
- package/dist/radio-group.d.ts +7 -0
- package/dist/radio-group.js +94 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/rating.d.ts +18 -0
- package/dist/rating.js +122 -0
- package/dist/rating.js.map +1 -0
- package/dist/relative-time.d.ts +19 -0
- package/dist/relative-time.js +187 -0
- package/dist/relative-time.js.map +1 -0
- package/dist/resizable.d.ts +27 -0
- package/dist/resizable.js +50 -0
- package/dist/resizable.js.map +1 -0
- package/dist/scroll-area.d.ts +20 -0
- package/dist/scroll-area.js +94 -0
- package/dist/scroll-area.js.map +1 -0
- package/dist/segmented-control.d.ts +16 -0
- package/dist/segmented-control.js +139 -0
- package/dist/segmented-control.js.map +1 -0
- package/dist/select.d.ts +13 -0
- package/dist/select.js +153 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.d.ts +6 -0
- package/dist/separator.js +36 -0
- package/dist/separator.js.map +1 -0
- package/dist/sidebar.d.ts +24 -0
- package/dist/sidebar.js +150 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/skeleton.d.ts +6 -0
- package/dist/skeleton.js +42 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/slider.d.ts +6 -0
- package/dist/slider.js +44 -0
- package/dist/slider.js.map +1 -0
- package/dist/social-button.d.ts +14 -0
- package/dist/social-button.js +203 -0
- package/dist/social-button.js.map +1 -0
- package/dist/spacer.d.ts +19 -0
- package/dist/spacer.js +52 -0
- package/dist/spacer.js.map +1 -0
- package/dist/spinner.d.ts +15 -0
- package/dist/spinner.js +48 -0
- package/dist/spinner.js.map +1 -0
- package/dist/stack.d.ts +27 -0
- package/dist/stack.js +77 -0
- package/dist/stack.js.map +1 -0
- package/dist/stat-card.d.ts +26 -0
- package/dist/stat-card.js +198 -0
- package/dist/stat-card.js.map +1 -0
- package/dist/status-dot.d.ts +26 -0
- package/dist/status-dot.js +68 -0
- package/dist/status-dot.js.map +1 -0
- package/dist/switch.d.ts +6 -0
- package/dist/switch.js +108 -0
- package/dist/switch.js.map +1 -0
- package/dist/tabs.d.ts +13 -0
- package/dist/tabs.js +167 -0
- package/dist/tabs.js.map +1 -0
- package/dist/tag.d.ts +16 -0
- package/dist/tag.js +53 -0
- package/dist/tag.js.map +1 -0
- package/dist/textarea.d.ts +6 -0
- package/dist/textarea.js +30 -0
- package/dist/textarea.js.map +1 -0
- package/dist/theme-switcher.d.ts +16 -0
- package/dist/theme-switcher.js +170 -0
- package/dist/theme-switcher.js.map +1 -0
- package/dist/toast.d.ts +20 -0
- package/dist/toast.js +162 -0
- package/dist/toast.js.map +1 -0
- package/dist/tooltip.d.ts +14 -0
- package/dist/tooltip.js +98 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/tree-view.d.ts +16 -0
- package/dist/tree-view.js +123 -0
- package/dist/tree-view.js.map +1 -0
- package/dist/truncate.d.ts +16 -0
- package/dist/truncate.js +151 -0
- package/dist/truncate.js.map +1 -0
- package/dist/use-reduced-motion.d.ts +15 -0
- package/dist/use-reduced-motion.js +11 -0
- package/dist/use-reduced-motion.js.map +1 -0
- package/dist/verification-code-input.d.ts +12 -0
- package/dist/verification-code-input.js +90 -0
- package/dist/verification-code-input.js.map +1 -0
- package/package.json +131 -0
- package/theme.css +343 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/application/logo-cloud.tsx
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { motion } from "motion/react";
|
|
6
|
+
|
|
7
|
+
// src/lib/cn.ts
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { twMerge } from "tailwind-merge";
|
|
10
|
+
function cn(...inputs) {
|
|
11
|
+
return twMerge(clsx(inputs));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// src/lib/motion-presets.ts
|
|
15
|
+
var spring = {
|
|
16
|
+
/** Quick, decisive — buttons, indicators, dropdowns. */
|
|
17
|
+
snappy: { type: "spring", stiffness: 420, damping: 32, mass: 0.8 },
|
|
18
|
+
/** Calm and weighty — dialogs, cards, larger surfaces. */
|
|
19
|
+
soft: { type: "spring", stiffness: 180, damping: 26 },
|
|
20
|
+
/** Playful overshoot — badges, toggles, delight moments. Use sparingly. */
|
|
21
|
+
bouncy: { type: "spring", stiffness: 480, damping: 18, mass: 0.9 }
|
|
22
|
+
};
|
|
23
|
+
var tween = {
|
|
24
|
+
/** The signature easing — an expressive ease-out for orchestrated reveals. */
|
|
25
|
+
smooth: { type: "tween", duration: 0.45, ease: [0.22, 1, 0.36, 1] },
|
|
26
|
+
/** Faster variant for small elements. */
|
|
27
|
+
quick: { type: "tween", duration: 0.28, ease: [0.22, 1, 0.36, 1] },
|
|
28
|
+
/** Longer, settled curve for drawing charts, count-ups, and progress fills. */
|
|
29
|
+
draw: { type: "tween", duration: 1.1, ease: [0.16, 1, 0.3, 1] }
|
|
30
|
+
};
|
|
31
|
+
var fadeUp = {
|
|
32
|
+
hidden: { opacity: 0, y: 18 },
|
|
33
|
+
visible: { opacity: 1, y: 0, transition: tween.smooth }
|
|
34
|
+
};
|
|
35
|
+
var fadeIn = {
|
|
36
|
+
hidden: { opacity: 0 },
|
|
37
|
+
visible: { opacity: 1, transition: tween.smooth }
|
|
38
|
+
};
|
|
39
|
+
var scaleIn = {
|
|
40
|
+
hidden: { opacity: 0, scale: 0.96 },
|
|
41
|
+
visible: { opacity: 1, scale: 1, transition: spring.soft }
|
|
42
|
+
};
|
|
43
|
+
var slideInLeft = {
|
|
44
|
+
hidden: { opacity: 0, x: -28 },
|
|
45
|
+
visible: { opacity: 1, x: 0, transition: tween.smooth }
|
|
46
|
+
};
|
|
47
|
+
var slideInRight = {
|
|
48
|
+
hidden: { opacity: 0, x: 28 },
|
|
49
|
+
visible: { opacity: 1, x: 0, transition: tween.smooth }
|
|
50
|
+
};
|
|
51
|
+
var blurIn = {
|
|
52
|
+
hidden: { opacity: 0, filter: "blur(12px)" },
|
|
53
|
+
visible: { opacity: 1, filter: "blur(0px)", transition: tween.smooth }
|
|
54
|
+
};
|
|
55
|
+
var staggerContainer = (stagger = 0.08, delay = 0) => ({
|
|
56
|
+
hidden: {},
|
|
57
|
+
visible: {
|
|
58
|
+
transition: { staggerChildren: stagger, delayChildren: delay }
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
var viewportOnce = { once: true, margin: "-15%" };
|
|
62
|
+
|
|
63
|
+
// src/components/application/logo-cloud.tsx
|
|
64
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
65
|
+
var LogoCloud = React.forwardRef(
|
|
66
|
+
({ className, title, logos, ...props }, ref) => /* @__PURE__ */ jsx("section", { ref, className: cn("py-12", className), ...props, children: /* @__PURE__ */ jsx("div", { className: "container", children: /* @__PURE__ */ jsxs(
|
|
67
|
+
motion.div,
|
|
68
|
+
{
|
|
69
|
+
variants: staggerContainer(0.06),
|
|
70
|
+
initial: "hidden",
|
|
71
|
+
whileInView: "visible",
|
|
72
|
+
viewport: viewportOnce,
|
|
73
|
+
className: "flex flex-col items-center gap-8",
|
|
74
|
+
children: [
|
|
75
|
+
title ? /* @__PURE__ */ jsx(
|
|
76
|
+
motion.p,
|
|
77
|
+
{
|
|
78
|
+
variants: fadeIn,
|
|
79
|
+
className: "text-center text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground",
|
|
80
|
+
children: title
|
|
81
|
+
}
|
|
82
|
+
) : null,
|
|
83
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center justify-center gap-x-10 gap-y-6", children: logos.map((logo, i) => {
|
|
84
|
+
const Icon = logo.icon;
|
|
85
|
+
return /* @__PURE__ */ jsxs(
|
|
86
|
+
motion.div,
|
|
87
|
+
{
|
|
88
|
+
variants: fadeUp,
|
|
89
|
+
className: "flex items-center gap-2 text-muted-foreground/70 grayscale transition-[color,filter] duration-300 ease-out hover:text-foreground hover:grayscale-0",
|
|
90
|
+
children: [
|
|
91
|
+
Icon ? /* @__PURE__ */ jsx(Icon, { className: "size-5" }) : null,
|
|
92
|
+
/* @__PURE__ */ jsx("span", { className: "font-display text-lg font-semibold tracking-tight", children: logo.name })
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
i
|
|
96
|
+
);
|
|
97
|
+
}) })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
) }) })
|
|
101
|
+
);
|
|
102
|
+
LogoCloud.displayName = "LogoCloud";
|
|
103
|
+
export {
|
|
104
|
+
LogoCloud
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=logo-cloud.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/application/logo-cloud.tsx","../src/lib/cn.ts","../src/lib/motion-presets.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\nimport { type LucideIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/cn\";\nimport { fadeIn, fadeUp, staggerContainer, viewportOnce } from \"@/lib/motion-presets\";\n\nexport interface LogoCloudItem {\n name: string;\n icon?: LucideIcon;\n}\n\nexport interface LogoCloudProps extends React.HTMLAttributes<HTMLElement> {\n title?: string;\n logos: LogoCloudItem[];\n}\n\nexport const LogoCloud = React.forwardRef<HTMLElement, LogoCloudProps>(\n ({ className, title, logos, ...props }, ref) => (\n <section ref={ref} className={cn(\"py-12\", className)} {...props}>\n <div className=\"container\">\n <motion.div\n variants={staggerContainer(0.06)}\n initial=\"hidden\"\n whileInView=\"visible\"\n viewport={viewportOnce}\n className=\"flex flex-col items-center gap-8\"\n >\n {title ? (\n <motion.p\n variants={fadeIn}\n className=\"text-center text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground\"\n >\n {title}\n </motion.p>\n ) : null}\n <div className=\"flex flex-wrap items-center justify-center gap-x-10 gap-y-6\">\n {logos.map((logo, i) => {\n const Icon = logo.icon;\n return (\n <motion.div\n key={i}\n variants={fadeUp}\n className=\"flex items-center gap-2 text-muted-foreground/70 grayscale transition-[color,filter] duration-300 ease-out hover:text-foreground hover:grayscale-0\"\n >\n {Icon ? <Icon className=\"size-5\" /> : null}\n <span className=\"font-display text-lg font-semibold tracking-tight\">\n {logo.name}\n </span>\n </motion.div>\n );\n })}\n </div>\n </motion.div>\n </div>\n </section>\n )\n);\nLogoCloud.displayName = \"LogoCloud\";\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind-aware conflict resolution.\n * Every Kineto component accepts `className` and merges it through `cn()`,\n * so consumer overrides always win over the component's defaults.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import type { Transition, Variants, Target } from \"motion/react\";\n\n/* -------------------------------------------------------------------------------------------------\n * Transition tokens\n * The named physics every component references. Tune these in one place and the whole\n * library re-tunes. Prefer springs for anything interactive; reserve tweens for orchestrated\n * entrances where you want a precise, repeatable curve.\n * ----------------------------------------------------------------------------------------------- */\n\nexport const spring = {\n /** Quick, decisive — buttons, indicators, dropdowns. */\n snappy: { type: \"spring\", stiffness: 420, damping: 32, mass: 0.8 },\n /** Calm and weighty — dialogs, cards, larger surfaces. */\n soft: { type: \"spring\", stiffness: 180, damping: 26 },\n /** Playful overshoot — badges, toggles, delight moments. Use sparingly. */\n bouncy: { type: \"spring\", stiffness: 480, damping: 18, mass: 0.9 },\n} satisfies Record<string, Transition>;\n\nexport const tween = {\n /** The signature easing — an expressive ease-out for orchestrated reveals. */\n smooth: { type: \"tween\", duration: 0.45, ease: [0.22, 1, 0.36, 1] },\n /** Faster variant for small elements. */\n quick: { type: \"tween\", duration: 0.28, ease: [0.22, 1, 0.36, 1] },\n /** Longer, settled curve for drawing charts, count-ups, and progress fills. */\n draw: { type: \"tween\", duration: 1.1, ease: [0.16, 1, 0.3, 1] },\n} satisfies Record<string, Transition>;\n\n/* -------------------------------------------------------------------------------------------------\n * Reveal variants\n * Named hidden→visible pairs. Pair with `initial=\"hidden\"` + `animate=\"visible\"`, or with\n * `whileInView=\"visible\"` for scroll-triggered sections (see `viewportOnce`).\n * ----------------------------------------------------------------------------------------------- */\n\nexport const fadeUp: Variants = {\n hidden: { opacity: 0, y: 18 },\n visible: { opacity: 1, y: 0, transition: tween.smooth },\n};\n\nexport const fadeIn: Variants = {\n hidden: { opacity: 0 },\n visible: { opacity: 1, transition: tween.smooth },\n};\n\nexport const scaleIn: Variants = {\n hidden: { opacity: 0, scale: 0.96 },\n visible: { opacity: 1, scale: 1, transition: spring.soft },\n};\n\nexport const slideInLeft: Variants = {\n hidden: { opacity: 0, x: -28 },\n visible: { opacity: 1, x: 0, transition: tween.smooth },\n};\n\nexport const slideInRight: Variants = {\n hidden: { opacity: 0, x: 28 },\n visible: { opacity: 1, x: 0, transition: tween.smooth },\n};\n\nexport const blurIn: Variants = {\n hidden: { opacity: 0, filter: \"blur(12px)\" },\n visible: { opacity: 1, filter: \"blur(0px)\", transition: tween.smooth },\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Stagger helpers\n * Wrap a list/grid in a container using `staggerContainer()` and give each child `staggerItem`\n * (or any reveal variant). One wrapper orchestrates the whole sequence.\n * ----------------------------------------------------------------------------------------------- */\n\nexport const staggerContainer = (stagger = 0.08, delay = 0): Variants => ({\n hidden: {},\n visible: {\n transition: { staggerChildren: stagger, delayChildren: delay },\n },\n});\n\n/** The default child for a stagger container. Aliased to `fadeUp` so sequences feel cohesive. */\nexport const staggerItem: Variants = fadeUp;\n\n/* -------------------------------------------------------------------------------------------------\n * Interaction presets\n * Standardized tap/hover targets. Note: controls (buttons, selects, anything that can act as a\n * trigger/anchor) should NOT shift on hover — moving a trigger while its popover/tooltip animates\n * in reads as two competing motions. Use color + press feedback there instead. A very subtle\n * scale-up is reserved for non-anchored content surfaces (cards/tiles) via `cardHover`.\n * Spread into `whileHover` / `whileTap`.\n * ----------------------------------------------------------------------------------------------- */\n\nexport const interaction = {\n /** Press feedback for buttons and clickable chips. */\n tap: { scale: 0.97 } satisfies Target,\n /** Very subtle scale-up for non-anchored content surfaces (cards/tiles) — never for triggers.\n * A gentle swell reads calmer than a positional lift and doesn't nudge neighbouring content. */\n cardHover: { scale: 1.02 } satisfies Target,\n} as const;\n\n/* -------------------------------------------------------------------------------------------------\n * Viewport config\n * The shared `whileInView` viewport so every scroll reveal triggers at the same threshold,\n * exactly once.\n * ----------------------------------------------------------------------------------------------- */\n\nexport const viewportOnce = { once: true, margin: \"-15%\" } as const;\n"],"mappings":";;;AAEA,YAAY,WAAW;AACvB,SAAS,cAAc;;;ACHvB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAOjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACDO,IAAM,SAAS;AAAA;AAAA,EAEpB,QAAQ,EAAE,MAAM,UAA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'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { Gap } from './gap.js';
|
|
5
|
+
|
|
6
|
+
declare const masonryVariants: (props?: ({
|
|
7
|
+
columns?: 1 | 2 | 4 | 3 | 5 | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
interface MasonryProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof masonryVariants> {
|
|
10
|
+
/** Space between items (column gap + matching row gap), from the shared scale. */
|
|
11
|
+
gap?: Gap;
|
|
12
|
+
}
|
|
13
|
+
declare const Masonry: React.ForwardRefExoticComponent<MasonryProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
|
|
15
|
+
export { Masonry, type MasonryProps, masonryVariants };
|
package/dist/masonry.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// src/components/ui/masonry.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
// src/lib/cn.ts
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { twMerge } from "tailwind-merge";
|
|
8
|
+
function cn(...inputs) {
|
|
9
|
+
return twMerge(clsx(inputs));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// src/lib/gap.ts
|
|
13
|
+
var gapClass = {
|
|
14
|
+
none: "gap-0",
|
|
15
|
+
xs: "gap-1",
|
|
16
|
+
sm: "gap-2",
|
|
17
|
+
md: "gap-4",
|
|
18
|
+
lg: "gap-6",
|
|
19
|
+
xl: "gap-8",
|
|
20
|
+
"2xl": "gap-12"
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// src/components/ui/masonry.tsx
|
|
24
|
+
import { jsx } from "react/jsx-runtime";
|
|
25
|
+
var masonryVariants = cva("w-full [&>*]:break-inside-avoid", {
|
|
26
|
+
variants: {
|
|
27
|
+
columns: {
|
|
28
|
+
1: "columns-1",
|
|
29
|
+
2: "columns-2",
|
|
30
|
+
3: "columns-3",
|
|
31
|
+
4: "columns-4",
|
|
32
|
+
5: "columns-5"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
columns: 3
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
var itemGapClass = {
|
|
40
|
+
none: "[&>*]:mb-0",
|
|
41
|
+
xs: "[&>*]:mb-1",
|
|
42
|
+
sm: "[&>*]:mb-2",
|
|
43
|
+
md: "[&>*]:mb-4",
|
|
44
|
+
lg: "[&>*]:mb-6",
|
|
45
|
+
xl: "[&>*]:mb-8",
|
|
46
|
+
"2xl": "[&>*]:mb-12"
|
|
47
|
+
};
|
|
48
|
+
var Masonry = React.forwardRef(
|
|
49
|
+
({ className, columns, gap = "md", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
ref,
|
|
53
|
+
className: cn(masonryVariants({ columns }), gapClass[gap], itemGapClass[gap], className),
|
|
54
|
+
...props
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
Masonry.displayName = "Masonry";
|
|
59
|
+
export {
|
|
60
|
+
Masonry,
|
|
61
|
+
masonryVariants
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=masonry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/masonry.tsx","../src/lib/cn.ts","../src/lib/gap.ts"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/cn\";\nimport { gapClass, type Gap } from \"@/lib/gap\";\n\n/* Variable-height masonry via CSS multi-columns — the organic cousin of the fixed-cell BentoGrid.\n * Direct children are kept whole (`break-inside-avoid`) and spaced by the same `gap` scale as the\n * other layout primitives, so items of any height tile without gaps. (CSS columns fill top-to-bottom\n * per column; for strict left-to-right reading order, prefer a Grid.) */\n\nconst masonryVariants = cva(\"w-full [&>*]:break-inside-avoid\", {\n variants: {\n columns: {\n 1: \"columns-1\",\n 2: \"columns-2\",\n 3: \"columns-3\",\n 4: \"columns-4\",\n 5: \"columns-5\",\n },\n },\n defaultVariants: {\n columns: 3,\n },\n});\n\n/** Bottom margin per child that matches the chosen column gap, so vertical rhythm equals horizontal. */\nconst itemGapClass: Record<Gap, string> = {\n none: \"[&>*]:mb-0\",\n xs: \"[&>*]:mb-1\",\n sm: \"[&>*]:mb-2\",\n md: \"[&>*]:mb-4\",\n lg: \"[&>*]:mb-6\",\n xl: \"[&>*]:mb-8\",\n \"2xl\": \"[&>*]:mb-12\",\n};\n\nexport interface MasonryProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof masonryVariants> {\n /** Space between items (column gap + matching row gap), from the shared scale. */\n gap?: Gap;\n}\n\nconst Masonry = React.forwardRef<HTMLDivElement, MasonryProps>(\n ({ className, columns, gap = \"md\", ...props }, ref) => (\n <div\n ref={ref}\n className={cn(masonryVariants({ columns }), gapClass[gap], itemGapClass[gap], className)}\n {...props}\n />\n )\n);\nMasonry.displayName = \"Masonry\";\n\nexport { Masonry, masonryVariants };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind-aware conflict resolution.\n * Every Kineto component accepts `className` and merges it through `cn()`,\n * so consumer overrides always win over the component's defaults.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","/* -------------------------------------------------------------------------------------------------\n * kineto — the one spacing scale\n *\n * Every layout primitive (Stack, Flex, Grid) takes its `gap` from this single token set, and Spacer\n * sizes from the same steps. Codifying the scale here is the whole point: people compose with\n * `gap=\"md\"` instead of hand-writing one-off `mt-[14px]` margins, so spacing stays consistent.\n *\n * Steps map onto Tailwind's 4px base: xs=4 · sm=8 · md=16 · lg=24 · xl=32 · 2xl=48. The class\n * strings are written out in full (not interpolated) so Tailwind's scanner can see them.\n * ----------------------------------------------------------------------------------------------- */\n\nexport type Gap = \"none\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\n\n/** `gap-*` utility per step — shared by Stack / Flex / Grid. */\nexport const gapClass: Record<Gap, string> = {\n none: \"gap-0\",\n xs: \"gap-1\",\n sm: \"gap-2\",\n md: \"gap-4\",\n lg: \"gap-6\",\n xl: \"gap-8\",\n \"2xl\": \"gap-12\",\n};\n\n/** Horizontal Spacer size (`w-*`) per step. */\nexport const spacerXClass: Record<Gap, string> = {\n none: \"w-0\",\n xs: \"w-1\",\n sm: \"w-2\",\n md: \"w-4\",\n lg: \"w-6\",\n xl: \"w-8\",\n \"2xl\": \"w-12\",\n};\n\n/** Vertical Spacer size (`h-*`) per step. */\nexport const spacerYClass: Record<Gap, string> = {\n none: \"h-0\",\n xs: \"h-1\",\n sm: \"h-2\",\n md: \"h-4\",\n lg: \"h-6\",\n xl: \"h-8\",\n \"2xl\": \"h-12\",\n};\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,WAA8B;;;ACDvC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAOjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACIO,IAAM,WAAgC;AAAA,EAC3C,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AACT;;;AFwBI;AAnCJ,IAAM,kBAAkB,IAAI,mCAAmC;AAAA,EAC7D,UAAU;AAAA,IACR,SAAS;AAAA,MACP,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,SAAS;AAAA,EACX;AACF,CAAC;AAGD,IAAM,eAAoC;AAAA,EACxC,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AACT;AASA,IAAM,UAAgB;AAAA,EACpB,CAAC,EAAE,WAAW,SAAS,MAAM,MAAM,GAAG,MAAM,GAAG,QAC7C;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,gBAAgB,EAAE,QAAQ,CAAC,GAAG,SAAS,GAAG,GAAG,aAAa,GAAG,GAAG,SAAS;AAAA,MACtF,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,QAAQ,cAAc;","names":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
4
|
+
|
|
5
|
+
declare const MenubarMenu: typeof MenubarPrimitive.Menu;
|
|
6
|
+
declare const MenubarGroup: typeof MenubarPrimitive.Group;
|
|
7
|
+
declare const MenubarPortal: typeof MenubarPrimitive.Portal;
|
|
8
|
+
declare const MenubarSub: typeof MenubarPrimitive.Sub;
|
|
9
|
+
declare const MenubarRadioGroup: typeof MenubarPrimitive.RadioGroup;
|
|
10
|
+
declare const Menubar: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const MenubarTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
declare const MenubarSubTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
13
|
+
inset?: boolean;
|
|
14
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const MenubarSubContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const MenubarContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const MenubarItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
18
|
+
inset?: boolean;
|
|
19
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const MenubarCheckboxItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
declare const MenubarRadioItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const MenubarLabel: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
23
|
+
inset?: boolean;
|
|
24
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const MenubarSeparator: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
declare const MenubarShortcut: {
|
|
27
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger };
|
package/dist/menubar.js
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/ui/menubar.tsx
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
6
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
7
|
+
import { motion } from "motion/react";
|
|
8
|
+
|
|
9
|
+
// src/lib/cn.ts
|
|
10
|
+
import { clsx } from "clsx";
|
|
11
|
+
import { twMerge } from "tailwind-merge";
|
|
12
|
+
function cn(...inputs) {
|
|
13
|
+
return twMerge(clsx(inputs));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// src/lib/motion-presets.ts
|
|
17
|
+
var spring = {
|
|
18
|
+
/** Quick, decisive — buttons, indicators, dropdowns. */
|
|
19
|
+
snappy: { type: "spring", stiffness: 420, damping: 32, mass: 0.8 },
|
|
20
|
+
/** Calm and weighty — dialogs, cards, larger surfaces. */
|
|
21
|
+
soft: { type: "spring", stiffness: 180, damping: 26 },
|
|
22
|
+
/** Playful overshoot — badges, toggles, delight moments. Use sparingly. */
|
|
23
|
+
bouncy: { type: "spring", stiffness: 480, damping: 18, mass: 0.9 }
|
|
24
|
+
};
|
|
25
|
+
var tween = {
|
|
26
|
+
/** The signature easing — an expressive ease-out for orchestrated reveals. */
|
|
27
|
+
smooth: { type: "tween", duration: 0.45, ease: [0.22, 1, 0.36, 1] },
|
|
28
|
+
/** Faster variant for small elements. */
|
|
29
|
+
quick: { type: "tween", duration: 0.28, ease: [0.22, 1, 0.36, 1] },
|
|
30
|
+
/** Longer, settled curve for drawing charts, count-ups, and progress fills. */
|
|
31
|
+
draw: { type: "tween", duration: 1.1, ease: [0.16, 1, 0.3, 1] }
|
|
32
|
+
};
|
|
33
|
+
var fadeUp = {
|
|
34
|
+
hidden: { opacity: 0, y: 18 },
|
|
35
|
+
visible: { opacity: 1, y: 0, transition: tween.smooth }
|
|
36
|
+
};
|
|
37
|
+
var fadeIn = {
|
|
38
|
+
hidden: { opacity: 0 },
|
|
39
|
+
visible: { opacity: 1, transition: tween.smooth }
|
|
40
|
+
};
|
|
41
|
+
var scaleIn = {
|
|
42
|
+
hidden: { opacity: 0, scale: 0.96 },
|
|
43
|
+
visible: { opacity: 1, scale: 1, transition: spring.soft }
|
|
44
|
+
};
|
|
45
|
+
var slideInLeft = {
|
|
46
|
+
hidden: { opacity: 0, x: -28 },
|
|
47
|
+
visible: { opacity: 1, x: 0, transition: tween.smooth }
|
|
48
|
+
};
|
|
49
|
+
var slideInRight = {
|
|
50
|
+
hidden: { opacity: 0, x: 28 },
|
|
51
|
+
visible: { opacity: 1, x: 0, transition: tween.smooth }
|
|
52
|
+
};
|
|
53
|
+
var blurIn = {
|
|
54
|
+
hidden: { opacity: 0, filter: "blur(12px)" },
|
|
55
|
+
visible: { opacity: 1, filter: "blur(0px)", transition: tween.smooth }
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// src/components/ui/menubar.tsx
|
|
59
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
60
|
+
var MenubarMenu = MenubarPrimitive.Menu;
|
|
61
|
+
var MenubarGroup = MenubarPrimitive.Group;
|
|
62
|
+
var MenubarPortal = MenubarPrimitive.Portal;
|
|
63
|
+
var MenubarSub = MenubarPrimitive.Sub;
|
|
64
|
+
var MenubarRadioGroup = MenubarPrimitive.RadioGroup;
|
|
65
|
+
var Menubar = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
66
|
+
MenubarPrimitive.Root,
|
|
67
|
+
{
|
|
68
|
+
ref,
|
|
69
|
+
className: cn(
|
|
70
|
+
"flex h-10 items-center gap-1 rounded-lg border border-border bg-card p-1 shadow-xs",
|
|
71
|
+
className
|
|
72
|
+
),
|
|
73
|
+
...props
|
|
74
|
+
}
|
|
75
|
+
));
|
|
76
|
+
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
77
|
+
var MenubarTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
78
|
+
MenubarPrimitive.Trigger,
|
|
79
|
+
{
|
|
80
|
+
ref,
|
|
81
|
+
className: cn(
|
|
82
|
+
"flex cursor-pointer select-none items-center rounded-md px-3 py-1.5 text-sm font-medium outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
83
|
+
className
|
|
84
|
+
),
|
|
85
|
+
...props
|
|
86
|
+
}
|
|
87
|
+
));
|
|
88
|
+
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
89
|
+
var MenubarSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
90
|
+
MenubarPrimitive.SubTrigger,
|
|
91
|
+
{
|
|
92
|
+
ref,
|
|
93
|
+
className: cn(
|
|
94
|
+
"flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:opacity-70",
|
|
95
|
+
inset && "pl-8",
|
|
96
|
+
className
|
|
97
|
+
),
|
|
98
|
+
...props,
|
|
99
|
+
children: [
|
|
100
|
+
children,
|
|
101
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto size-4" })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
));
|
|
105
|
+
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
106
|
+
var MenubarSubContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(MenubarPrimitive.SubContent, { ref, className: "z-50", ...props, children: /* @__PURE__ */ jsx(
|
|
107
|
+
motion.div,
|
|
108
|
+
{
|
|
109
|
+
initial: { opacity: 0, scale: 0.97 },
|
|
110
|
+
animate: { opacity: 1, scale: 1 },
|
|
111
|
+
transition: tween.quick,
|
|
112
|
+
style: {
|
|
113
|
+
transformOrigin: "var(--radix-menubar-content-transform-origin)"
|
|
114
|
+
},
|
|
115
|
+
className: cn(
|
|
116
|
+
"min-w-[10rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-lift",
|
|
117
|
+
className
|
|
118
|
+
),
|
|
119
|
+
children
|
|
120
|
+
}
|
|
121
|
+
) }));
|
|
122
|
+
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
123
|
+
var MenubarContent = React.forwardRef(
|
|
124
|
+
({ className, align = "start", alignOffset = -4, sideOffset = 8, children, ...props }, ref) => /* @__PURE__ */ jsx(MenubarPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
125
|
+
MenubarPrimitive.Content,
|
|
126
|
+
{
|
|
127
|
+
ref,
|
|
128
|
+
align,
|
|
129
|
+
alignOffset,
|
|
130
|
+
sideOffset,
|
|
131
|
+
className: "z-50",
|
|
132
|
+
...props,
|
|
133
|
+
children: /* @__PURE__ */ jsx(
|
|
134
|
+
motion.div,
|
|
135
|
+
{
|
|
136
|
+
initial: { opacity: 0, scale: 0.97 },
|
|
137
|
+
animate: { opacity: 1, scale: 1 },
|
|
138
|
+
transition: tween.quick,
|
|
139
|
+
style: {
|
|
140
|
+
transformOrigin: "var(--radix-menubar-content-transform-origin)"
|
|
141
|
+
},
|
|
142
|
+
className: cn(
|
|
143
|
+
"min-w-[12rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-lift",
|
|
144
|
+
className
|
|
145
|
+
),
|
|
146
|
+
children
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
) })
|
|
151
|
+
);
|
|
152
|
+
MenubarContent.displayName = MenubarPrimitive.Content.displayName;
|
|
153
|
+
var MenubarItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
154
|
+
MenubarPrimitive.Item,
|
|
155
|
+
{
|
|
156
|
+
ref,
|
|
157
|
+
className: cn(
|
|
158
|
+
"relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:opacity-70",
|
|
159
|
+
inset && "pl-8",
|
|
160
|
+
className
|
|
161
|
+
),
|
|
162
|
+
...props
|
|
163
|
+
}
|
|
164
|
+
));
|
|
165
|
+
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
166
|
+
var MenubarCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
167
|
+
MenubarPrimitive.CheckboxItem,
|
|
168
|
+
{
|
|
169
|
+
ref,
|
|
170
|
+
checked,
|
|
171
|
+
className: cn(
|
|
172
|
+
"relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
173
|
+
className
|
|
174
|
+
),
|
|
175
|
+
...props,
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "size-4 text-primary" }) }) }),
|
|
178
|
+
children
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
));
|
|
182
|
+
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
183
|
+
var MenubarRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
184
|
+
MenubarPrimitive.RadioItem,
|
|
185
|
+
{
|
|
186
|
+
ref,
|
|
187
|
+
className: cn(
|
|
188
|
+
"relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
189
|
+
className
|
|
190
|
+
),
|
|
191
|
+
...props,
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "size-2 fill-current text-primary" }) }) }),
|
|
194
|
+
children
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
));
|
|
198
|
+
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
199
|
+
var MenubarLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
200
|
+
MenubarPrimitive.Label,
|
|
201
|
+
{
|
|
202
|
+
ref,
|
|
203
|
+
className: cn(
|
|
204
|
+
"px-2 py-1.5 text-xs font-medium text-muted-foreground",
|
|
205
|
+
inset && "pl-8",
|
|
206
|
+
className
|
|
207
|
+
),
|
|
208
|
+
...props
|
|
209
|
+
}
|
|
210
|
+
));
|
|
211
|
+
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
212
|
+
var MenubarSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
213
|
+
MenubarPrimitive.Separator,
|
|
214
|
+
{
|
|
215
|
+
ref,
|
|
216
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
217
|
+
...props
|
|
218
|
+
}
|
|
219
|
+
));
|
|
220
|
+
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
221
|
+
var MenubarShortcut = ({
|
|
222
|
+
className,
|
|
223
|
+
...props
|
|
224
|
+
}) => /* @__PURE__ */ jsx(
|
|
225
|
+
"span",
|
|
226
|
+
{
|
|
227
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className),
|
|
228
|
+
...props
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
MenubarShortcut.displayName = "MenubarShortcut";
|
|
232
|
+
export {
|
|
233
|
+
Menubar,
|
|
234
|
+
MenubarCheckboxItem,
|
|
235
|
+
MenubarContent,
|
|
236
|
+
MenubarGroup,
|
|
237
|
+
MenubarItem,
|
|
238
|
+
MenubarLabel,
|
|
239
|
+
MenubarMenu,
|
|
240
|
+
MenubarPortal,
|
|
241
|
+
MenubarRadioGroup,
|
|
242
|
+
MenubarRadioItem,
|
|
243
|
+
MenubarSeparator,
|
|
244
|
+
MenubarShortcut,
|
|
245
|
+
MenubarSub,
|
|
246
|
+
MenubarSubContent,
|
|
247
|
+
MenubarSubTrigger,
|
|
248
|
+
MenubarTrigger
|
|
249
|
+
};
|
|
250
|
+
//# sourceMappingURL=menubar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/menubar.tsx","../src/lib/cn.ts","../src/lib/motion-presets.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport { motion } from \"motion/react\";\n\nimport { cn } from \"@/lib/cn\";\nimport { tween } from \"@/lib/motion-presets\";\n\nconst MenubarMenu: typeof MenubarPrimitive.Menu = MenubarPrimitive.Menu;\nconst MenubarGroup: typeof MenubarPrimitive.Group = MenubarPrimitive.Group;\nconst MenubarPortal: typeof MenubarPrimitive.Portal = MenubarPrimitive.Portal;\nconst MenubarSub: typeof MenubarPrimitive.Sub = MenubarPrimitive.Sub;\nconst MenubarRadioGroup: typeof MenubarPrimitive.RadioGroup =\n MenubarPrimitive.RadioGroup;\n\nconst Menubar = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Root\n ref={ref}\n className={cn(\n \"flex h-10 items-center gap-1 rounded-lg border border-border bg-card p-1 shadow-xs\",\n className\n )}\n {...props}\n />\n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\nconst MenubarTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex cursor-pointer select-none items-center rounded-md px-3 py-1.5 text-sm font-medium outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n className\n )}\n {...props}\n />\n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <MenubarPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:opacity-70\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto size-4\" />\n </MenubarPrimitive.SubTrigger>\n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\nconst MenubarSubContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.SubContent ref={ref} className=\"z-50\" {...props}>\n <motion.div\n initial={{ opacity: 0, scale: 0.97 }}\n animate={{ opacity: 1, scale: 1 }}\n transition={tween.quick}\n style={{\n transformOrigin: \"var(--radix-menubar-content-transform-origin)\",\n }}\n className={cn(\n \"min-w-[10rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-lift\",\n className\n )}\n >\n {children}\n </motion.div>\n </MenubarPrimitive.SubContent>\n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\nconst MenubarContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(\n (\n { className, align = \"start\", alignOffset = -4, sideOffset = 8, children, ...props },\n ref\n ) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={ref}\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className=\"z-50\"\n {...props}\n >\n <motion.div\n initial={{ opacity: 0, scale: 0.97 }}\n animate={{ opacity: 1, scale: 1 }}\n transition={tween.quick}\n style={{\n transformOrigin: \"var(--radix-menubar-content-transform-origin)\",\n }}\n className={cn(\n \"min-w-[12rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-lift\",\n className\n )}\n >\n {children}\n </motion.div>\n </MenubarPrimitive.Content>\n </MenubarPrimitive.Portal>\n )\n);\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\nconst MenubarItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:opacity-70\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <MenubarPrimitive.CheckboxItem\n ref={ref}\n checked={checked}\n className={cn(\n \"relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-4 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <Check className=\"size-4 text-primary\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\nconst MenubarRadioItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-4 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <Circle className=\"size-2 fill-current text-primary\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\nconst MenubarLabel = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-xs font-medium text-muted-foreground\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\nconst MenubarSeparator = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\nconst MenubarShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n);\nMenubarShortcut.displayName = \"MenubarShortcut\";\n\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n MenubarLabel,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarPortal,\n MenubarGroup,\n MenubarSub,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarShortcut,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind-aware conflict resolution.\n * Every Kineto component accepts `className` and merges it through `cn()`,\n * so consumer overrides always win over the component's defaults.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import type { Transition, Variants, Target } from \"motion/react\";\n\n/* -------------------------------------------------------------------------------------------------\n * Transition tokens\n * The named physics every component references. Tune these in one place and the whole\n * library re-tunes. Prefer springs for anything interactive; reserve tweens for orchestrated\n * entrances where you want a precise, repeatable curve.\n * ----------------------------------------------------------------------------------------------- */\n\nexport const spring = {\n /** Quick, decisive — buttons, indicators, dropdowns. */\n snappy: { type: \"spring\", stiffness: 420, damping: 32, mass: 0.8 },\n /** Calm and weighty — dialogs, cards, larger surfaces. */\n soft: { type: \"spring\", stiffness: 180, damping: 26 },\n /** Playful overshoot — badges, toggles, delight moments. Use sparingly. */\n bouncy: { type: \"spring\", stiffness: 480, damping: 18, mass: 0.9 },\n} satisfies Record<string, Transition>;\n\nexport const tween = {\n /** The signature easing — an expressive ease-out for orchestrated reveals. */\n smooth: { type: \"tween\", duration: 0.45, ease: [0.22, 1, 0.36, 1] },\n /** Faster variant for small elements. */\n quick: { type: \"tween\", duration: 0.28, ease: [0.22, 1, 0.36, 1] },\n /** Longer, settled curve for drawing charts, count-ups, and progress fills. */\n draw: { type: \"tween\", duration: 1.1, ease: [0.16, 1, 0.3, 1] },\n} satisfies Record<string, Transition>;\n\n/* -------------------------------------------------------------------------------------------------\n * Reveal variants\n * Named hidden→visible pairs. Pair with `initial=\"hidden\"` + `animate=\"visible\"`, or with\n * `whileInView=\"visible\"` for scroll-triggered sections (see `viewportOnce`).\n * ----------------------------------------------------------------------------------------------- */\n\nexport const fadeUp: Variants = {\n hidden: { opacity: 0, y: 18 },\n visible: { opacity: 1, y: 0, transition: tween.smooth },\n};\n\nexport const fadeIn: Variants = {\n hidden: { opacity: 0 },\n visible: { opacity: 1, transition: tween.smooth },\n};\n\nexport const scaleIn: Variants = {\n hidden: { opacity: 0, scale: 0.96 },\n visible: { opacity: 1, scale: 1, transition: spring.soft },\n};\n\nexport const slideInLeft: Variants = {\n hidden: { opacity: 0, x: -28 },\n visible: { opacity: 1, x: 0, transition: tween.smooth },\n};\n\nexport const slideInRight: Variants = {\n hidden: { opacity: 0, x: 28 },\n visible: { opacity: 1, x: 0, transition: tween.smooth },\n};\n\nexport const blurIn: Variants = {\n hidden: { opacity: 0, filter: \"blur(12px)\" },\n visible: { opacity: 1, filter: \"blur(0px)\", transition: tween.smooth },\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Stagger helpers\n * Wrap a list/grid in a container using `staggerContainer()` and give each child `staggerItem`\n * (or any reveal variant). One wrapper orchestrates the whole sequence.\n * ----------------------------------------------------------------------------------------------- */\n\nexport const staggerContainer = (stagger = 0.08, delay = 0): Variants => ({\n hidden: {},\n visible: {\n transition: { staggerChildren: stagger, delayChildren: delay },\n },\n});\n\n/** The default child for a stagger container. Aliased to `fadeUp` so sequences feel cohesive. */\nexport const staggerItem: Variants = fadeUp;\n\n/* -------------------------------------------------------------------------------------------------\n * Interaction presets\n * Standardized tap/hover targets. Note: controls (buttons, selects, anything that can act as a\n * trigger/anchor) should NOT shift on hover — moving a trigger while its popover/tooltip animates\n * in reads as two competing motions. Use color + press feedback there instead. A very subtle\n * scale-up is reserved for non-anchored content surfaces (cards/tiles) via `cardHover`.\n * Spread into `whileHover` / `whileTap`.\n * ----------------------------------------------------------------------------------------------- */\n\nexport const interaction = {\n /** Press feedback for buttons and clickable chips. */\n tap: { scale: 0.97 } satisfies Target,\n /** Very subtle scale-up for non-anchored content surfaces (cards/tiles) — never for triggers.\n * A gentle swell reads calmer than a positional lift and doesn't nudge neighbouring content. */\n cardHover: { scale: 1.02 } satisfies Target,\n} as const;\n\n/* -------------------------------------------------------------------------------------------------\n * Viewport config\n * The shared `whileInView` viewport so every scroll reveal triggers at the same threshold,\n * exactly once.\n * ----------------------------------------------------------------------------------------------- */\n\nexport const viewportOnce = { once: true, margin: \"-15%\" } as const;\n"],"mappings":";;;AAEA,YAAY,WAAW;AACvB,YAAY,sBAAsB;AAClC,SAAS,OAAO,cAAc,cAAc;AAC5C,SAAS,cAAc;;;ACLvB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAOjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACDO,IAAM,SAAS;AAAA;AAAA,EAEpB,QAAQ,EAAE,MAAM,UAAU,WAAW,KAAK,SAAS,IAAI,MAAM,IAAI;AAAA;AAAA,EAEjE,MAAM,EAAE,MAAM,UAAU,WAAW,KAAK,SAAS,GAAG;AAAA;AAAA,EAEpD,QAAQ,EAAE,MAAM,UAAU,WAAW,KAAK,SAAS,IAAI,M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,iBAG7B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QACpC;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,0BAAC,UAAK,WAAU,2DACd,8BAAkB,gCAAjB,EACC,8BAAC,UAAO,WAAU,oCAAmC,GACvD,GACF;AAAA,MACC;AAAA;AAAA;AACH,CACD;AACD,iBAAiB,cAA+B,2BAAU;AAE1D,IAAM,eAAqB,iBAKzB,CAAC,EAAE,WAAW,OAAO,GAAG,MAAM,GAAG,QACjC;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,SAAS;AAAA,MACT;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,aAAa,cAA+B,uBAAM;AAElD,IAAM,mBAAyB,iBAG7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,6BAA6B,SAAS;AAAA,IACnD,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAA+B,2BAAU;AAE1D,IAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA;AAAA,IACC,WAAW,GAAG,yDAAyD,SAAS;AAAA,IAC/E,GAAG;AAAA;AACN;AAEF,gBAAgB,cAAc;","names":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Variants } from 'motion/react';
|
|
2
|
+
|
|
3
|
+
declare const spring: {
|
|
4
|
+
/** Quick, decisive — buttons, indicators, dropdowns. */
|
|
5
|
+
snappy: {
|
|
6
|
+
type: "spring";
|
|
7
|
+
stiffness: number;
|
|
8
|
+
damping: number;
|
|
9
|
+
mass: number;
|
|
10
|
+
};
|
|
11
|
+
/** Calm and weighty — dialogs, cards, larger surfaces. */
|
|
12
|
+
soft: {
|
|
13
|
+
type: "spring";
|
|
14
|
+
stiffness: number;
|
|
15
|
+
damping: number;
|
|
16
|
+
};
|
|
17
|
+
/** Playful overshoot — badges, toggles, delight moments. Use sparingly. */
|
|
18
|
+
bouncy: {
|
|
19
|
+
type: "spring";
|
|
20
|
+
stiffness: number;
|
|
21
|
+
damping: number;
|
|
22
|
+
mass: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
declare const tween: {
|
|
26
|
+
/** The signature easing — an expressive ease-out for orchestrated reveals. */
|
|
27
|
+
smooth: {
|
|
28
|
+
type: "tween";
|
|
29
|
+
duration: number;
|
|
30
|
+
ease: [number, number, number, number];
|
|
31
|
+
};
|
|
32
|
+
/** Faster variant for small elements. */
|
|
33
|
+
quick: {
|
|
34
|
+
type: "tween";
|
|
35
|
+
duration: number;
|
|
36
|
+
ease: [number, number, number, number];
|
|
37
|
+
};
|
|
38
|
+
/** Longer, settled curve for drawing charts, count-ups, and progress fills. */
|
|
39
|
+
draw: {
|
|
40
|
+
type: "tween";
|
|
41
|
+
duration: number;
|
|
42
|
+
ease: [number, number, number, number];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
declare const fadeUp: Variants;
|
|
46
|
+
declare const fadeIn: Variants;
|
|
47
|
+
declare const scaleIn: Variants;
|
|
48
|
+
declare const slideInLeft: Variants;
|
|
49
|
+
declare const slideInRight: Variants;
|
|
50
|
+
declare const blurIn: Variants;
|
|
51
|
+
declare const staggerContainer: (stagger?: number, delay?: number) => Variants;
|
|
52
|
+
/** The default child for a stagger container. Aliased to `fadeUp` so sequences feel cohesive. */
|
|
53
|
+
declare const staggerItem: Variants;
|
|
54
|
+
declare const interaction: {
|
|
55
|
+
/** Press feedback for buttons and clickable chips. */
|
|
56
|
+
readonly tap: {
|
|
57
|
+
scale: number;
|
|
58
|
+
};
|
|
59
|
+
/** Very subtle scale-up for non-anchored content surfaces (cards/tiles) — never for triggers.
|
|
60
|
+
* A gentle swell reads calmer than a positional lift and doesn't nudge neighbouring content. */
|
|
61
|
+
readonly cardHover: {
|
|
62
|
+
scale: number;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
declare const viewportOnce: {
|
|
66
|
+
readonly once: true;
|
|
67
|
+
readonly margin: "-15%";
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { blurIn, fadeIn, fadeUp, interaction, scaleIn, slideInLeft, slideInRight, spring, staggerContainer, staggerItem, tween, viewportOnce };
|