@hanzo/ui 5.3.28 → 5.3.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/3d/button.js +298 -0
- package/dist/3d/button.mjs +273 -0
- package/dist/3d/card.js +234 -0
- package/dist/3d/card.mjs +207 -0
- package/dist/3d/carousel.js +371 -0
- package/dist/3d/carousel.mjs +344 -0
- package/dist/3d/grid.js +362 -0
- package/dist/3d/grid.mjs +337 -0
- package/dist/3d/index.js +1518 -0
- package/dist/3d/index.mjs +1472 -0
- package/dist/3d/marquee.js +352 -0
- package/dist/3d/marquee.mjs +327 -0
- package/dist/3d/pin.js +46 -0
- package/dist/3d/pin.mjs +24 -0
- package/dist/accordion.js +80 -0
- package/dist/accordion.mjs +55 -0
- package/dist/alert-dialog.js +220 -0
- package/dist/alert-dialog.mjs +187 -0
- package/dist/alert.js +68 -0
- package/dist/alert.mjs +64 -0
- package/dist/animation/animated-background.js +424 -0
- package/dist/animation/animated-background.mjs +418 -0
- package/dist/animation/animated-beam.js +119 -0
- package/dist/animation/animated-beam.mjs +97 -0
- package/dist/animation/animated-cursor.js +275 -0
- package/dist/animation/animated-cursor.mjs +270 -0
- package/dist/animation/animated-icon.js +357 -0
- package/dist/animation/animated-icon.mjs +351 -0
- package/dist/animation/animated-list.js +339 -0
- package/dist/animation/animated-list.mjs +333 -0
- package/dist/animation/animated-number.js +283 -0
- package/dist/animation/animated-number.mjs +277 -0
- package/dist/animation/animated-testimonials.js +97 -0
- package/dist/animation/animated-testimonials.mjs +75 -0
- package/dist/animation/animated-tooltip.js +67 -0
- package/dist/animation/animated-tooltip.mjs +45 -0
- package/dist/animation/apple-cards-carousel.js +308 -0
- package/dist/animation/apple-cards-carousel.mjs +285 -0
- package/dist/animation/apple-hello-effect.js +60 -0
- package/dist/animation/apple-hello-effect.mjs +38 -0
- package/dist/animation/index.js +1952 -0
- package/dist/animation/index.mjs +1921 -0
- package/dist/avatar.js +71 -0
- package/dist/avatar.mjs +47 -0
- package/dist/badge.js +66 -0
- package/dist/badge.mjs +40 -0
- package/dist/blocks/index.js +1665 -0
- package/dist/blocks/index.mjs +1626 -0
- package/dist/breadcrumb.js +107 -0
- package/dist/breadcrumb.mjs +99 -0
- package/dist/calendar.js +189 -0
- package/dist/calendar.mjs +164 -0
- package/dist/carousel.js +278 -0
- package/dist/carousel.mjs +249 -0
- package/dist/checkbox.js +60 -0
- package/dist/checkbox.mjs +35 -0
- package/dist/code/block.js +226 -0
- package/dist/code/block.mjs +203 -0
- package/dist/code/compare.js +446 -0
- package/dist/code/compare.mjs +423 -0
- package/dist/code/diff.js +430 -0
- package/dist/code/diff.mjs +407 -0
- package/dist/code/editor.js +243 -0
- package/dist/code/editor.mjs +218 -0
- package/dist/code/explorer.js +291 -0
- package/dist/code/explorer.mjs +268 -0
- package/dist/code/index.js +2551 -0
- package/dist/code/index.mjs +2510 -0
- package/dist/code/preview.js +400 -0
- package/dist/code/preview.mjs +377 -0
- package/dist/code/snippet.js +274 -0
- package/dist/code/snippet.mjs +250 -0
- package/dist/code/tabs.js +75 -0
- package/dist/code/tabs.mjs +53 -0
- package/dist/code/terminal.js +437 -0
- package/dist/code/terminal.mjs +414 -0
- package/dist/collapsible.js +33 -0
- package/dist/collapsible.mjs +9 -0
- package/dist/command.js +262 -0
- package/dist/command.mjs +232 -0
- package/dist/context-menu.js +207 -0
- package/dist/context-menu.mjs +171 -0
- package/dist/device/index.js +3 -0
- package/dist/device/index.mjs +2 -0
- package/dist/dialog.js +151 -0
- package/dist/dialog.mjs +121 -0
- package/dist/dock/basic.js +174 -0
- package/dist/dock/basic.mjs +151 -0
- package/dist/dock/index.js +628 -0
- package/dist/dock/index.mjs +601 -0
- package/dist/dock/limelight-nav.js +295 -0
- package/dist/dock/limelight-nav.mjs +274 -0
- package/dist/dock/macos.js +141 -0
- package/dist/dock/macos.mjs +118 -0
- package/dist/dock/menu.js +70 -0
- package/dist/dock/menu.mjs +48 -0
- package/dist/dock/message.js +144 -0
- package/dist/dock/message.mjs +122 -0
- package/dist/drawer.js +115 -0
- package/dist/drawer.mjs +103 -0
- package/dist/dropdown-menu.js +202 -0
- package/dist/dropdown-menu.mjs +166 -0
- package/dist/finance/AdvancedChart.js +48 -0
- package/dist/finance/AdvancedChart.mjs +46 -0
- package/dist/finance/CompanyProfile.js +48 -0
- package/dist/finance/CompanyProfile.mjs +46 -0
- package/dist/finance/CryptoScreener.js +45 -0
- package/dist/finance/CryptoScreener.mjs +43 -0
- package/dist/finance/Financials.js +52 -0
- package/dist/finance/Financials.mjs +50 -0
- package/dist/finance/ForexScreener.js +46 -0
- package/dist/finance/ForexScreener.mjs +44 -0
- package/dist/finance/MarketOverview.js +104 -0
- package/dist/finance/MarketOverview.mjs +102 -0
- package/dist/finance/NewsTimeline.js +44 -0
- package/dist/finance/NewsTimeline.mjs +42 -0
- package/dist/finance/OrderEntry.js +131 -0
- package/dist/finance/OrderEntry.mjs +129 -0
- package/dist/finance/OrdersHistory.js +64 -0
- package/dist/finance/OrdersHistory.mjs +62 -0
- package/dist/finance/PositionsList.js +80 -0
- package/dist/finance/PositionsList.mjs +78 -0
- package/dist/finance/StockScreener.js +46 -0
- package/dist/finance/StockScreener.mjs +44 -0
- package/dist/finance/SymbolInfo.js +46 -0
- package/dist/finance/SymbolInfo.mjs +44 -0
- package/dist/finance/TechnicalAnalysis.js +54 -0
- package/dist/finance/TechnicalAnalysis.mjs +52 -0
- package/dist/finance/TickerTape.js +56 -0
- package/dist/finance/TickerTape.mjs +54 -0
- package/dist/finance/TradingPanel.js +191 -0
- package/dist/finance/TradingPanel.mjs +189 -0
- package/dist/finance/index.js +930 -0
- package/dist/finance/index.mjs +914 -0
- package/dist/form/index.js +155 -0
- package/dist/form/index.mjs +125 -0
- package/dist/form.js +172 -0
- package/dist/form.mjs +142 -0
- package/dist/hover-card.js +58 -0
- package/dist/hover-card.mjs +34 -0
- package/dist/index.js +8467 -0
- package/dist/index.mjs +8087 -0
- package/dist/input-otp.js +79 -0
- package/dist/input-otp.mjs +54 -0
- package/dist/lib/utils.js +28 -0
- package/dist/lib/utils.mjs +24 -0
- package/dist/navigation/index.js +98 -0
- package/dist/navigation/index.mjs +79 -0
- package/dist/navigation-menu.js +149 -0
- package/dist/navigation-menu.mjs +116 -0
- package/dist/pattern/grid-pattern.js +333 -0
- package/dist/pattern/grid-pattern.mjs +310 -0
- package/dist/pattern/index.js +333 -0
- package/dist/pattern/index.mjs +310 -0
- package/dist/popover.js +63 -0
- package/dist/popover.mjs +37 -0
- package/dist/primitives/index.js +8467 -0
- package/dist/primitives/index.mjs +8087 -0
- package/dist/primitives-export.js +8467 -0
- package/dist/primitives-export.mjs +8087 -0
- package/dist/progress.js +62 -0
- package/dist/progress.mjs +37 -0
- package/dist/project/gantt.js +65 -0
- package/dist/project/gantt.mjs +43 -0
- package/dist/project/index.js +636 -0
- package/dist/project/index.mjs +611 -0
- package/dist/project/kanban.js +597 -0
- package/dist/project/kanban.mjs +572 -0
- package/dist/project/list.js +35 -0
- package/dist/project/list.mjs +12 -0
- package/dist/radio-group.js +68 -0
- package/dist/radio-group.mjs +45 -0
- package/dist/resizable.js +72 -0
- package/dist/resizable.mjs +48 -0
- package/dist/scroll-area.js +89 -0
- package/dist/scroll-area.mjs +66 -0
- package/dist/select.js +140 -0
- package/dist/select.mjs +111 -0
- package/dist/separator.js +59 -0
- package/dist/separator.mjs +34 -0
- package/dist/sheet.js +148 -0
- package/dist/sheet.mjs +117 -0
- package/dist/skeleton.js +32 -0
- package/dist/skeleton.mjs +27 -0
- package/dist/slider.js +99 -0
- package/dist/slider.mjs +73 -0
- package/dist/sonner.js +34 -0
- package/dist/sonner.mjs +29 -0
- package/dist/switch.js +62 -0
- package/dist/switch.mjs +37 -0
- package/dist/table.js +110 -0
- package/dist/table.mjs +101 -0
- package/dist/tabs.js +82 -0
- package/dist/tabs.mjs +57 -0
- package/dist/tailwind/index.js +2023 -0
- package/dist/tailwind/index.mjs +2011 -0
- package/dist/textarea.js +78 -0
- package/dist/textarea.mjs +56 -0
- package/dist/toggle-group.js +118 -0
- package/dist/toggle-group.mjs +93 -0
- package/dist/toggle.js +71 -0
- package/dist/toggle.mjs +48 -0
- package/dist/tooltip.js +67 -0
- package/dist/tooltip.mjs +40 -0
- package/dist/types/index.js +57 -0
- package/dist/types/index.mjs +51 -0
- package/dist/ui/announcement.js +129 -0
- package/dist/ui/announcement.mjs +107 -0
- package/dist/ui/avatar-group.js +88 -0
- package/dist/ui/avatar-group.mjs +65 -0
- package/dist/ui/banner.js +85 -0
- package/dist/ui/banner.mjs +62 -0
- package/dist/ui/cursor.js +78 -0
- package/dist/ui/cursor.mjs +56 -0
- package/dist/ui/index.js +475 -0
- package/dist/ui/index.mjs +442 -0
- package/dist/ui/marquee.js +74 -0
- package/dist/ui/marquee.mjs +52 -0
- package/dist/ui/pill.js +85 -0
- package/dist/ui/pill.mjs +62 -0
- package/dist/ui/spinner.js +28 -0
- package/dist/ui/spinner.mjs +26 -0
- package/dist/ui/tags.js +101 -0
- package/dist/ui/tags.mjs +79 -0
- package/dist/ui/ticker.js +73 -0
- package/dist/ui/ticker.mjs +51 -0
- package/dist/util/index.js +463 -0
- package/dist/util/index.mjs +404 -0
- package/package.json +1 -1
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
6
|
+
var framerMotion = require('framer-motion');
|
|
7
|
+
var utils = require('@hanzo/ui/lib/utils');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
12
|
+
var n = Object.create(null);
|
|
13
|
+
if (e) {
|
|
14
|
+
Object.keys(e).forEach(function (k) {
|
|
15
|
+
if (k !== 'default') {
|
|
16
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return e[k]; }
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
n.default = e;
|
|
25
|
+
return Object.freeze(n);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
29
|
+
|
|
30
|
+
var __defProp = Object.defineProperty;
|
|
31
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
32
|
+
var marquee3DVariants = classVarianceAuthority.cva(
|
|
33
|
+
[
|
|
34
|
+
"relative overflow-hidden whitespace-nowrap",
|
|
35
|
+
"transform-gpu will-change-transform",
|
|
36
|
+
"[perspective:1000px]"
|
|
37
|
+
],
|
|
38
|
+
{
|
|
39
|
+
variants: {
|
|
40
|
+
variant: {
|
|
41
|
+
default: [
|
|
42
|
+
"bg-background text-foreground",
|
|
43
|
+
"[&_.marquee-content]:text-current"
|
|
44
|
+
],
|
|
45
|
+
neon: [
|
|
46
|
+
"bg-black text-cyan-400",
|
|
47
|
+
"[&_.marquee-content]:text-cyan-400",
|
|
48
|
+
"[&_.marquee-content]:drop-shadow-[0_0_10px_currentColor]",
|
|
49
|
+
"[&_.marquee-content]:animate-pulse"
|
|
50
|
+
],
|
|
51
|
+
rainbow: [
|
|
52
|
+
"bg-black",
|
|
53
|
+
"[&_.marquee-content]:bg-gradient-to-r [&_.marquee-content]:from-red-500 [&_.marquee-content]:via-yellow-500 [&_.marquee-content]:via-green-500 [&_.marquee-content]:via-blue-500 [&_.marquee-content]:to-purple-500",
|
|
54
|
+
"[&_.marquee-content]:bg-clip-text [&_.marquee-content]:text-transparent"
|
|
55
|
+
],
|
|
56
|
+
metallic: [
|
|
57
|
+
"bg-slate-900",
|
|
58
|
+
"[&_.marquee-content]:bg-gradient-to-b [&_.marquee-content]:from-gray-200 [&_.marquee-content]:via-gray-400 [&_.marquee-content]:to-gray-600",
|
|
59
|
+
"[&_.marquee-content]:bg-clip-text [&_.marquee-content]:text-transparent"
|
|
60
|
+
],
|
|
61
|
+
fire: [
|
|
62
|
+
"bg-black",
|
|
63
|
+
"[&_.marquee-content]:bg-gradient-to-t [&_.marquee-content]:from-red-600 [&_.marquee-content]:via-orange-500 [&_.marquee-content]:to-yellow-400",
|
|
64
|
+
"[&_.marquee-content]:bg-clip-text [&_.marquee-content]:text-transparent",
|
|
65
|
+
"[&_.marquee-content]:drop-shadow-[0_0_20px_#ff6600]"
|
|
66
|
+
],
|
|
67
|
+
glass: [
|
|
68
|
+
"bg-white/10 backdrop-blur-sm",
|
|
69
|
+
"[&_.marquee-content]:text-white/90",
|
|
70
|
+
"[&_.marquee-content]:drop-shadow-[0_0_10px_rgba(255,255,255,0.3)]"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
size: {
|
|
74
|
+
sm: "h-8 text-sm [&_.marquee-content]:py-1",
|
|
75
|
+
default: "h-12 text-base [&_.marquee-content]:py-2",
|
|
76
|
+
lg: "h-16 text-lg [&_.marquee-content]:py-3",
|
|
77
|
+
xl: "h-20 text-xl [&_.marquee-content]:py-4",
|
|
78
|
+
"2xl": "h-24 text-2xl [&_.marquee-content]:py-5",
|
|
79
|
+
"3xl": "h-32 text-3xl [&_.marquee-content]:py-6"
|
|
80
|
+
},
|
|
81
|
+
direction: {
|
|
82
|
+
left: "",
|
|
83
|
+
right: "",
|
|
84
|
+
up: "flex-col",
|
|
85
|
+
down: "flex-col"
|
|
86
|
+
},
|
|
87
|
+
perspective: {
|
|
88
|
+
none: "[perspective:none]",
|
|
89
|
+
sm: "[perspective:500px]",
|
|
90
|
+
default: "[perspective:1000px]",
|
|
91
|
+
lg: "[perspective:1500px]",
|
|
92
|
+
xl: "[perspective:2000px]"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
defaultVariants: {
|
|
96
|
+
variant: "default",
|
|
97
|
+
size: "default",
|
|
98
|
+
direction: "left",
|
|
99
|
+
perspective: "default"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
var Marquee3D = React__namespace.forwardRef(
|
|
104
|
+
({
|
|
105
|
+
className,
|
|
106
|
+
variant,
|
|
107
|
+
size,
|
|
108
|
+
direction = "left",
|
|
109
|
+
perspective,
|
|
110
|
+
children,
|
|
111
|
+
speed = 50,
|
|
112
|
+
pauseOnHover = false,
|
|
113
|
+
reverse = false,
|
|
114
|
+
repeat = 5,
|
|
115
|
+
gap = 0,
|
|
116
|
+
rotateX = 0,
|
|
117
|
+
rotateY = 0,
|
|
118
|
+
rotateZ = 0,
|
|
119
|
+
autoFill = false,
|
|
120
|
+
gradient = false,
|
|
121
|
+
gradientColor = "#ffffff",
|
|
122
|
+
gradientWidth = 200,
|
|
123
|
+
style,
|
|
124
|
+
...props
|
|
125
|
+
}, ref) => {
|
|
126
|
+
const [containerWidth, setContainerWidth] = React__namespace.useState(0);
|
|
127
|
+
const [contentWidth, setContentWidth] = React__namespace.useState(0);
|
|
128
|
+
const containerRef = React__namespace.useRef(null);
|
|
129
|
+
const contentRef = React__namespace.useRef(null);
|
|
130
|
+
React__namespace.useEffect(() => {
|
|
131
|
+
const measureDimensions = /* @__PURE__ */ __name(() => {
|
|
132
|
+
if (containerRef.current && contentRef.current) {
|
|
133
|
+
const containerRect = containerRef.current.getBoundingClientRect();
|
|
134
|
+
const contentRect = contentRef.current.getBoundingClientRect();
|
|
135
|
+
if (direction === "left" || direction === "right") {
|
|
136
|
+
setContainerWidth(containerRect.width);
|
|
137
|
+
setContentWidth(contentRect.width);
|
|
138
|
+
} else {
|
|
139
|
+
setContainerWidth(containerRect.height);
|
|
140
|
+
setContentWidth(contentRect.height);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}, "measureDimensions");
|
|
144
|
+
measureDimensions();
|
|
145
|
+
window.addEventListener("resize", measureDimensions);
|
|
146
|
+
return () => window.removeEventListener("resize", measureDimensions);
|
|
147
|
+
}, [direction, children]);
|
|
148
|
+
const duration = React__namespace.useMemo(() => {
|
|
149
|
+
if (contentWidth === 0) return 20;
|
|
150
|
+
return contentWidth / speed;
|
|
151
|
+
}, [contentWidth, speed]);
|
|
152
|
+
const actualRepeat = React__namespace.useMemo(() => {
|
|
153
|
+
if (autoFill && containerWidth > 0 && contentWidth > 0) {
|
|
154
|
+
return Math.ceil(containerWidth / contentWidth) + 2;
|
|
155
|
+
}
|
|
156
|
+
return repeat;
|
|
157
|
+
}, [autoFill, containerWidth, contentWidth, repeat]);
|
|
158
|
+
const getAnimationProps = /* @__PURE__ */ __name(() => {
|
|
159
|
+
const distance = contentWidth + gap;
|
|
160
|
+
let animateProps = {};
|
|
161
|
+
if (direction === "left") {
|
|
162
|
+
animateProps = {
|
|
163
|
+
x: reverse ? [distance, -distance] : [-distance, distance]
|
|
164
|
+
};
|
|
165
|
+
} else if (direction === "right") {
|
|
166
|
+
animateProps = {
|
|
167
|
+
x: reverse ? [-distance, distance] : [distance, -distance]
|
|
168
|
+
};
|
|
169
|
+
} else if (direction === "up") {
|
|
170
|
+
animateProps = {
|
|
171
|
+
y: reverse ? [distance, -distance] : [-distance, distance]
|
|
172
|
+
};
|
|
173
|
+
} else if (direction === "down") {
|
|
174
|
+
animateProps = {
|
|
175
|
+
y: reverse ? [-distance, distance] : [distance, -distance]
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
animate: animateProps,
|
|
180
|
+
transition: {
|
|
181
|
+
duration,
|
|
182
|
+
ease: "linear",
|
|
183
|
+
repeat: Infinity
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}, "getAnimationProps");
|
|
187
|
+
const transform3D = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) rotateZ(${rotateZ}deg)`;
|
|
188
|
+
const gradientMask = gradient ? {
|
|
189
|
+
maskImage: `linear-gradient(to right, transparent, ${gradientColor} ${gradientWidth}px, ${gradientColor} calc(100% - ${gradientWidth}px), transparent)`,
|
|
190
|
+
WebkitMaskImage: `linear-gradient(to right, transparent, ${gradientColor} ${gradientWidth}px, ${gradientColor} calc(100% - ${gradientWidth}px), transparent)`
|
|
191
|
+
} : {};
|
|
192
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
ref: containerRef,
|
|
196
|
+
className: utils.cn(
|
|
197
|
+
marquee3DVariants({ variant, size, direction, perspective }),
|
|
198
|
+
"flex items-center",
|
|
199
|
+
direction === "up" || direction === "down" ? "flex-col" : "flex-row",
|
|
200
|
+
className
|
|
201
|
+
),
|
|
202
|
+
style: {
|
|
203
|
+
...style,
|
|
204
|
+
transform: transform3D,
|
|
205
|
+
...gradientMask
|
|
206
|
+
},
|
|
207
|
+
...props,
|
|
208
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
209
|
+
framerMotion.motion.div,
|
|
210
|
+
{
|
|
211
|
+
ref: contentRef,
|
|
212
|
+
className: utils.cn(
|
|
213
|
+
"marquee-content flex shrink-0 font-bold",
|
|
214
|
+
direction === "up" || direction === "down" ? "flex-col" : "flex-row",
|
|
215
|
+
pauseOnHover && "hover:[animation-play-state:paused]"
|
|
216
|
+
),
|
|
217
|
+
style: {
|
|
218
|
+
gap: `${gap}px`
|
|
219
|
+
},
|
|
220
|
+
...getAnimationProps(),
|
|
221
|
+
children: Array.from({ length: actualRepeat }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
|
|
222
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
223
|
+
"div",
|
|
224
|
+
{
|
|
225
|
+
className: utils.cn(
|
|
226
|
+
"flex shrink-0 items-center justify-center",
|
|
227
|
+
direction === "up" || direction === "down" ? "flex-col" : "flex-row"
|
|
228
|
+
),
|
|
229
|
+
style: {
|
|
230
|
+
transform: `rotateX(${rotateX}deg) rotateY(${rotateY}deg) rotateZ(${rotateZ}deg)`,
|
|
231
|
+
transformStyle: "preserve-3d"
|
|
232
|
+
},
|
|
233
|
+
children
|
|
234
|
+
}
|
|
235
|
+
),
|
|
236
|
+
index < actualRepeat - 1 && gap > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
237
|
+
"div",
|
|
238
|
+
{
|
|
239
|
+
style: {
|
|
240
|
+
width: direction === "up" || direction === "down" ? "100%" : `${gap}px`,
|
|
241
|
+
height: direction === "up" || direction === "down" ? `${gap}px` : "100%"
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
)
|
|
245
|
+
] }, index))
|
|
246
|
+
}
|
|
247
|
+
)
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
Marquee3D.displayName = "Marquee3D";
|
|
253
|
+
var Marquee3DPreset = {
|
|
254
|
+
Hero: React__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
255
|
+
Marquee3D,
|
|
256
|
+
{
|
|
257
|
+
ref,
|
|
258
|
+
variant: "rainbow",
|
|
259
|
+
size: "3xl",
|
|
260
|
+
speed: 30,
|
|
261
|
+
rotateX: -10,
|
|
262
|
+
gradient: true,
|
|
263
|
+
...props
|
|
264
|
+
}
|
|
265
|
+
)),
|
|
266
|
+
Neon: React__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
267
|
+
Marquee3D,
|
|
268
|
+
{
|
|
269
|
+
ref,
|
|
270
|
+
variant: "neon",
|
|
271
|
+
size: "xl",
|
|
272
|
+
speed: 40,
|
|
273
|
+
rotateY: 5,
|
|
274
|
+
pauseOnHover: true,
|
|
275
|
+
...props
|
|
276
|
+
}
|
|
277
|
+
)),
|
|
278
|
+
Metallic: React__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
279
|
+
Marquee3D,
|
|
280
|
+
{
|
|
281
|
+
ref,
|
|
282
|
+
variant: "metallic",
|
|
283
|
+
size: "lg",
|
|
284
|
+
speed: 35,
|
|
285
|
+
rotateX: -5,
|
|
286
|
+
rotateY: 2,
|
|
287
|
+
gradient: true,
|
|
288
|
+
gradientColor: "#c4c4c4",
|
|
289
|
+
...props
|
|
290
|
+
}
|
|
291
|
+
)),
|
|
292
|
+
Fire: React__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
293
|
+
Marquee3D,
|
|
294
|
+
{
|
|
295
|
+
ref,
|
|
296
|
+
variant: "fire",
|
|
297
|
+
size: "2xl",
|
|
298
|
+
speed: 60,
|
|
299
|
+
rotateZ: 1,
|
|
300
|
+
gradient: true,
|
|
301
|
+
gradientColor: "#ff6600",
|
|
302
|
+
...props
|
|
303
|
+
}
|
|
304
|
+
)),
|
|
305
|
+
Glass: React__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
306
|
+
Marquee3D,
|
|
307
|
+
{
|
|
308
|
+
ref,
|
|
309
|
+
variant: "glass",
|
|
310
|
+
size: "lg",
|
|
311
|
+
speed: 25,
|
|
312
|
+
rotateX: -8,
|
|
313
|
+
pauseOnHover: true,
|
|
314
|
+
gradient: true,
|
|
315
|
+
gradientColor: "rgba(255,255,255,0.9)",
|
|
316
|
+
...props
|
|
317
|
+
}
|
|
318
|
+
))
|
|
319
|
+
};
|
|
320
|
+
Marquee3DPreset.Hero.displayName = "Marquee3DPreset.Hero";
|
|
321
|
+
Marquee3DPreset.Neon.displayName = "Marquee3DPreset.Neon";
|
|
322
|
+
Marquee3DPreset.Metallic.displayName = "Marquee3DPreset.Metallic";
|
|
323
|
+
Marquee3DPreset.Fire.displayName = "Marquee3DPreset.Fire";
|
|
324
|
+
Marquee3DPreset.Glass.displayName = "Marquee3DPreset.Glass";
|
|
325
|
+
var Marquee3DFloating = React__namespace.forwardRef(({ children, floatIntensity = 10, floatSpeed = 3, ...props }, ref) => {
|
|
326
|
+
const text = typeof children === "string" ? children : "";
|
|
327
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Marquee3D, { ref, ...props, children: text ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex space-x-1", children: text.split("").map((char, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
328
|
+
framerMotion.motion.span,
|
|
329
|
+
{
|
|
330
|
+
className: "inline-block",
|
|
331
|
+
animate: {
|
|
332
|
+
y: [0, -floatIntensity, 0],
|
|
333
|
+
rotateX: [0, 5, 0],
|
|
334
|
+
rotateY: [0, 2, 0]
|
|
335
|
+
},
|
|
336
|
+
transition: {
|
|
337
|
+
duration: floatSpeed,
|
|
338
|
+
ease: "easeInOut",
|
|
339
|
+
repeat: Infinity,
|
|
340
|
+
delay: index * 0.1
|
|
341
|
+
},
|
|
342
|
+
children: char === " " ? "\xA0" : char
|
|
343
|
+
},
|
|
344
|
+
index
|
|
345
|
+
)) }) : children });
|
|
346
|
+
});
|
|
347
|
+
Marquee3DFloating.displayName = "Marquee3DFloating";
|
|
348
|
+
|
|
349
|
+
exports.Marquee3D = Marquee3D;
|
|
350
|
+
exports.Marquee3DFloating = Marquee3DFloating;
|
|
351
|
+
exports.Marquee3DPreset = Marquee3DPreset;
|
|
352
|
+
exports.marquee3DVariants = marquee3DVariants;
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { motion } from 'framer-motion';
|
|
5
|
+
import { cn } from '@hanzo/ui/lib/utils';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
+
var marquee3DVariants = cva(
|
|
11
|
+
[
|
|
12
|
+
"relative overflow-hidden whitespace-nowrap",
|
|
13
|
+
"transform-gpu will-change-transform",
|
|
14
|
+
"[perspective:1000px]"
|
|
15
|
+
],
|
|
16
|
+
{
|
|
17
|
+
variants: {
|
|
18
|
+
variant: {
|
|
19
|
+
default: [
|
|
20
|
+
"bg-background text-foreground",
|
|
21
|
+
"[&_.marquee-content]:text-current"
|
|
22
|
+
],
|
|
23
|
+
neon: [
|
|
24
|
+
"bg-black text-cyan-400",
|
|
25
|
+
"[&_.marquee-content]:text-cyan-400",
|
|
26
|
+
"[&_.marquee-content]:drop-shadow-[0_0_10px_currentColor]",
|
|
27
|
+
"[&_.marquee-content]:animate-pulse"
|
|
28
|
+
],
|
|
29
|
+
rainbow: [
|
|
30
|
+
"bg-black",
|
|
31
|
+
"[&_.marquee-content]:bg-gradient-to-r [&_.marquee-content]:from-red-500 [&_.marquee-content]:via-yellow-500 [&_.marquee-content]:via-green-500 [&_.marquee-content]:via-blue-500 [&_.marquee-content]:to-purple-500",
|
|
32
|
+
"[&_.marquee-content]:bg-clip-text [&_.marquee-content]:text-transparent"
|
|
33
|
+
],
|
|
34
|
+
metallic: [
|
|
35
|
+
"bg-slate-900",
|
|
36
|
+
"[&_.marquee-content]:bg-gradient-to-b [&_.marquee-content]:from-gray-200 [&_.marquee-content]:via-gray-400 [&_.marquee-content]:to-gray-600",
|
|
37
|
+
"[&_.marquee-content]:bg-clip-text [&_.marquee-content]:text-transparent"
|
|
38
|
+
],
|
|
39
|
+
fire: [
|
|
40
|
+
"bg-black",
|
|
41
|
+
"[&_.marquee-content]:bg-gradient-to-t [&_.marquee-content]:from-red-600 [&_.marquee-content]:via-orange-500 [&_.marquee-content]:to-yellow-400",
|
|
42
|
+
"[&_.marquee-content]:bg-clip-text [&_.marquee-content]:text-transparent",
|
|
43
|
+
"[&_.marquee-content]:drop-shadow-[0_0_20px_#ff6600]"
|
|
44
|
+
],
|
|
45
|
+
glass: [
|
|
46
|
+
"bg-white/10 backdrop-blur-sm",
|
|
47
|
+
"[&_.marquee-content]:text-white/90",
|
|
48
|
+
"[&_.marquee-content]:drop-shadow-[0_0_10px_rgba(255,255,255,0.3)]"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
size: {
|
|
52
|
+
sm: "h-8 text-sm [&_.marquee-content]:py-1",
|
|
53
|
+
default: "h-12 text-base [&_.marquee-content]:py-2",
|
|
54
|
+
lg: "h-16 text-lg [&_.marquee-content]:py-3",
|
|
55
|
+
xl: "h-20 text-xl [&_.marquee-content]:py-4",
|
|
56
|
+
"2xl": "h-24 text-2xl [&_.marquee-content]:py-5",
|
|
57
|
+
"3xl": "h-32 text-3xl [&_.marquee-content]:py-6"
|
|
58
|
+
},
|
|
59
|
+
direction: {
|
|
60
|
+
left: "",
|
|
61
|
+
right: "",
|
|
62
|
+
up: "flex-col",
|
|
63
|
+
down: "flex-col"
|
|
64
|
+
},
|
|
65
|
+
perspective: {
|
|
66
|
+
none: "[perspective:none]",
|
|
67
|
+
sm: "[perspective:500px]",
|
|
68
|
+
default: "[perspective:1000px]",
|
|
69
|
+
lg: "[perspective:1500px]",
|
|
70
|
+
xl: "[perspective:2000px]"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
defaultVariants: {
|
|
74
|
+
variant: "default",
|
|
75
|
+
size: "default",
|
|
76
|
+
direction: "left",
|
|
77
|
+
perspective: "default"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
var Marquee3D = React.forwardRef(
|
|
82
|
+
({
|
|
83
|
+
className,
|
|
84
|
+
variant,
|
|
85
|
+
size,
|
|
86
|
+
direction = "left",
|
|
87
|
+
perspective,
|
|
88
|
+
children,
|
|
89
|
+
speed = 50,
|
|
90
|
+
pauseOnHover = false,
|
|
91
|
+
reverse = false,
|
|
92
|
+
repeat = 5,
|
|
93
|
+
gap = 0,
|
|
94
|
+
rotateX = 0,
|
|
95
|
+
rotateY = 0,
|
|
96
|
+
rotateZ = 0,
|
|
97
|
+
autoFill = false,
|
|
98
|
+
gradient = false,
|
|
99
|
+
gradientColor = "#ffffff",
|
|
100
|
+
gradientWidth = 200,
|
|
101
|
+
style,
|
|
102
|
+
...props
|
|
103
|
+
}, ref) => {
|
|
104
|
+
const [containerWidth, setContainerWidth] = React.useState(0);
|
|
105
|
+
const [contentWidth, setContentWidth] = React.useState(0);
|
|
106
|
+
const containerRef = React.useRef(null);
|
|
107
|
+
const contentRef = React.useRef(null);
|
|
108
|
+
React.useEffect(() => {
|
|
109
|
+
const measureDimensions = /* @__PURE__ */ __name(() => {
|
|
110
|
+
if (containerRef.current && contentRef.current) {
|
|
111
|
+
const containerRect = containerRef.current.getBoundingClientRect();
|
|
112
|
+
const contentRect = contentRef.current.getBoundingClientRect();
|
|
113
|
+
if (direction === "left" || direction === "right") {
|
|
114
|
+
setContainerWidth(containerRect.width);
|
|
115
|
+
setContentWidth(contentRect.width);
|
|
116
|
+
} else {
|
|
117
|
+
setContainerWidth(containerRect.height);
|
|
118
|
+
setContentWidth(contentRect.height);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}, "measureDimensions");
|
|
122
|
+
measureDimensions();
|
|
123
|
+
window.addEventListener("resize", measureDimensions);
|
|
124
|
+
return () => window.removeEventListener("resize", measureDimensions);
|
|
125
|
+
}, [direction, children]);
|
|
126
|
+
const duration = React.useMemo(() => {
|
|
127
|
+
if (contentWidth === 0) return 20;
|
|
128
|
+
return contentWidth / speed;
|
|
129
|
+
}, [contentWidth, speed]);
|
|
130
|
+
const actualRepeat = React.useMemo(() => {
|
|
131
|
+
if (autoFill && containerWidth > 0 && contentWidth > 0) {
|
|
132
|
+
return Math.ceil(containerWidth / contentWidth) + 2;
|
|
133
|
+
}
|
|
134
|
+
return repeat;
|
|
135
|
+
}, [autoFill, containerWidth, contentWidth, repeat]);
|
|
136
|
+
const getAnimationProps = /* @__PURE__ */ __name(() => {
|
|
137
|
+
const distance = contentWidth + gap;
|
|
138
|
+
let animateProps = {};
|
|
139
|
+
if (direction === "left") {
|
|
140
|
+
animateProps = {
|
|
141
|
+
x: reverse ? [distance, -distance] : [-distance, distance]
|
|
142
|
+
};
|
|
143
|
+
} else if (direction === "right") {
|
|
144
|
+
animateProps = {
|
|
145
|
+
x: reverse ? [-distance, distance] : [distance, -distance]
|
|
146
|
+
};
|
|
147
|
+
} else if (direction === "up") {
|
|
148
|
+
animateProps = {
|
|
149
|
+
y: reverse ? [distance, -distance] : [-distance, distance]
|
|
150
|
+
};
|
|
151
|
+
} else if (direction === "down") {
|
|
152
|
+
animateProps = {
|
|
153
|
+
y: reverse ? [-distance, distance] : [distance, -distance]
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
animate: animateProps,
|
|
158
|
+
transition: {
|
|
159
|
+
duration,
|
|
160
|
+
ease: "linear",
|
|
161
|
+
repeat: Infinity
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}, "getAnimationProps");
|
|
165
|
+
const transform3D = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) rotateZ(${rotateZ}deg)`;
|
|
166
|
+
const gradientMask = gradient ? {
|
|
167
|
+
maskImage: `linear-gradient(to right, transparent, ${gradientColor} ${gradientWidth}px, ${gradientColor} calc(100% - ${gradientWidth}px), transparent)`,
|
|
168
|
+
WebkitMaskImage: `linear-gradient(to right, transparent, ${gradientColor} ${gradientWidth}px, ${gradientColor} calc(100% - ${gradientWidth}px), transparent)`
|
|
169
|
+
} : {};
|
|
170
|
+
return /* @__PURE__ */ jsx(
|
|
171
|
+
"div",
|
|
172
|
+
{
|
|
173
|
+
ref: containerRef,
|
|
174
|
+
className: cn(
|
|
175
|
+
marquee3DVariants({ variant, size, direction, perspective }),
|
|
176
|
+
"flex items-center",
|
|
177
|
+
direction === "up" || direction === "down" ? "flex-col" : "flex-row",
|
|
178
|
+
className
|
|
179
|
+
),
|
|
180
|
+
style: {
|
|
181
|
+
...style,
|
|
182
|
+
transform: transform3D,
|
|
183
|
+
...gradientMask
|
|
184
|
+
},
|
|
185
|
+
...props,
|
|
186
|
+
children: /* @__PURE__ */ jsx(
|
|
187
|
+
motion.div,
|
|
188
|
+
{
|
|
189
|
+
ref: contentRef,
|
|
190
|
+
className: cn(
|
|
191
|
+
"marquee-content flex shrink-0 font-bold",
|
|
192
|
+
direction === "up" || direction === "down" ? "flex-col" : "flex-row",
|
|
193
|
+
pauseOnHover && "hover:[animation-play-state:paused]"
|
|
194
|
+
),
|
|
195
|
+
style: {
|
|
196
|
+
gap: `${gap}px`
|
|
197
|
+
},
|
|
198
|
+
...getAnimationProps(),
|
|
199
|
+
children: Array.from({ length: actualRepeat }).map((_, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
200
|
+
/* @__PURE__ */ jsx(
|
|
201
|
+
"div",
|
|
202
|
+
{
|
|
203
|
+
className: cn(
|
|
204
|
+
"flex shrink-0 items-center justify-center",
|
|
205
|
+
direction === "up" || direction === "down" ? "flex-col" : "flex-row"
|
|
206
|
+
),
|
|
207
|
+
style: {
|
|
208
|
+
transform: `rotateX(${rotateX}deg) rotateY(${rotateY}deg) rotateZ(${rotateZ}deg)`,
|
|
209
|
+
transformStyle: "preserve-3d"
|
|
210
|
+
},
|
|
211
|
+
children
|
|
212
|
+
}
|
|
213
|
+
),
|
|
214
|
+
index < actualRepeat - 1 && gap > 0 && /* @__PURE__ */ jsx(
|
|
215
|
+
"div",
|
|
216
|
+
{
|
|
217
|
+
style: {
|
|
218
|
+
width: direction === "up" || direction === "down" ? "100%" : `${gap}px`,
|
|
219
|
+
height: direction === "up" || direction === "down" ? `${gap}px` : "100%"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
] }, index))
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
Marquee3D.displayName = "Marquee3D";
|
|
231
|
+
var Marquee3DPreset = {
|
|
232
|
+
Hero: React.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
233
|
+
Marquee3D,
|
|
234
|
+
{
|
|
235
|
+
ref,
|
|
236
|
+
variant: "rainbow",
|
|
237
|
+
size: "3xl",
|
|
238
|
+
speed: 30,
|
|
239
|
+
rotateX: -10,
|
|
240
|
+
gradient: true,
|
|
241
|
+
...props
|
|
242
|
+
}
|
|
243
|
+
)),
|
|
244
|
+
Neon: React.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
245
|
+
Marquee3D,
|
|
246
|
+
{
|
|
247
|
+
ref,
|
|
248
|
+
variant: "neon",
|
|
249
|
+
size: "xl",
|
|
250
|
+
speed: 40,
|
|
251
|
+
rotateY: 5,
|
|
252
|
+
pauseOnHover: true,
|
|
253
|
+
...props
|
|
254
|
+
}
|
|
255
|
+
)),
|
|
256
|
+
Metallic: React.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
257
|
+
Marquee3D,
|
|
258
|
+
{
|
|
259
|
+
ref,
|
|
260
|
+
variant: "metallic",
|
|
261
|
+
size: "lg",
|
|
262
|
+
speed: 35,
|
|
263
|
+
rotateX: -5,
|
|
264
|
+
rotateY: 2,
|
|
265
|
+
gradient: true,
|
|
266
|
+
gradientColor: "#c4c4c4",
|
|
267
|
+
...props
|
|
268
|
+
}
|
|
269
|
+
)),
|
|
270
|
+
Fire: React.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
271
|
+
Marquee3D,
|
|
272
|
+
{
|
|
273
|
+
ref,
|
|
274
|
+
variant: "fire",
|
|
275
|
+
size: "2xl",
|
|
276
|
+
speed: 60,
|
|
277
|
+
rotateZ: 1,
|
|
278
|
+
gradient: true,
|
|
279
|
+
gradientColor: "#ff6600",
|
|
280
|
+
...props
|
|
281
|
+
}
|
|
282
|
+
)),
|
|
283
|
+
Glass: React.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
284
|
+
Marquee3D,
|
|
285
|
+
{
|
|
286
|
+
ref,
|
|
287
|
+
variant: "glass",
|
|
288
|
+
size: "lg",
|
|
289
|
+
speed: 25,
|
|
290
|
+
rotateX: -8,
|
|
291
|
+
pauseOnHover: true,
|
|
292
|
+
gradient: true,
|
|
293
|
+
gradientColor: "rgba(255,255,255,0.9)",
|
|
294
|
+
...props
|
|
295
|
+
}
|
|
296
|
+
))
|
|
297
|
+
};
|
|
298
|
+
Marquee3DPreset.Hero.displayName = "Marquee3DPreset.Hero";
|
|
299
|
+
Marquee3DPreset.Neon.displayName = "Marquee3DPreset.Neon";
|
|
300
|
+
Marquee3DPreset.Metallic.displayName = "Marquee3DPreset.Metallic";
|
|
301
|
+
Marquee3DPreset.Fire.displayName = "Marquee3DPreset.Fire";
|
|
302
|
+
Marquee3DPreset.Glass.displayName = "Marquee3DPreset.Glass";
|
|
303
|
+
var Marquee3DFloating = React.forwardRef(({ children, floatIntensity = 10, floatSpeed = 3, ...props }, ref) => {
|
|
304
|
+
const text = typeof children === "string" ? children : "";
|
|
305
|
+
return /* @__PURE__ */ jsx(Marquee3D, { ref, ...props, children: text ? /* @__PURE__ */ jsx("div", { className: "flex space-x-1", children: text.split("").map((char, index) => /* @__PURE__ */ jsx(
|
|
306
|
+
motion.span,
|
|
307
|
+
{
|
|
308
|
+
className: "inline-block",
|
|
309
|
+
animate: {
|
|
310
|
+
y: [0, -floatIntensity, 0],
|
|
311
|
+
rotateX: [0, 5, 0],
|
|
312
|
+
rotateY: [0, 2, 0]
|
|
313
|
+
},
|
|
314
|
+
transition: {
|
|
315
|
+
duration: floatSpeed,
|
|
316
|
+
ease: "easeInOut",
|
|
317
|
+
repeat: Infinity,
|
|
318
|
+
delay: index * 0.1
|
|
319
|
+
},
|
|
320
|
+
children: char === " " ? "\xA0" : char
|
|
321
|
+
},
|
|
322
|
+
index
|
|
323
|
+
)) }) : children });
|
|
324
|
+
});
|
|
325
|
+
Marquee3DFloating.displayName = "Marquee3DFloating";
|
|
326
|
+
|
|
327
|
+
export { Marquee3D, Marquee3DFloating, Marquee3DPreset, marquee3DVariants };
|