@hanzo/ui 5.3.35 → 5.3.36
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/bin/create-registry.js +0 -0
- package/bin/npx-registry-mcp.js +0 -0
- package/bin/registry-mcp-wrapper.sh +0 -0
- package/bin/registry-mcp.js +0 -0
- package/bin/start-mcp-server.sh +0 -0
- package/bin/test-mcp.sh +0 -0
- package/dist/3d/button.js +1 -297
- package/dist/3d/button.mjs +1 -272
- package/dist/3d/card.js +1 -233
- package/dist/3d/card.mjs +1 -206
- package/dist/3d/carousel.js +1 -370
- package/dist/3d/carousel.mjs +1 -343
- package/dist/3d/grid.js +1 -361
- package/dist/3d/grid.mjs +1 -336
- package/dist/3d/index.js +1 -1517
- package/dist/3d/index.mjs +1 -1471
- package/dist/3d/marquee.js +1 -351
- package/dist/3d/marquee.mjs +1 -326
- package/dist/3d/pin.js +1 -45
- package/dist/3d/pin.mjs +1 -23
- package/dist/accordion.js +1 -79
- package/dist/accordion.mjs +1 -54
- package/dist/alert-dialog.js +1 -224
- package/dist/alert-dialog.mjs +1 -191
- package/dist/alert.js +1 -97
- package/dist/alert.mjs +1 -91
- package/dist/animation/animated-background.js +1 -423
- package/dist/animation/animated-background.mjs +1 -417
- package/dist/animation/animated-beam.js +1 -118
- package/dist/animation/animated-beam.mjs +1 -96
- package/dist/animation/animated-cursor.js +1 -274
- package/dist/animation/animated-cursor.mjs +1 -269
- package/dist/animation/animated-icon.js +2 -356
- package/dist/animation/animated-icon.mjs +2 -350
- package/dist/animation/animated-list.js +1 -338
- package/dist/animation/animated-list.mjs +1 -332
- package/dist/animation/animated-number.js +1 -282
- package/dist/animation/animated-number.mjs +1 -276
- package/dist/animation/animated-testimonials.js +1 -96
- package/dist/animation/animated-testimonials.mjs +1 -74
- package/dist/animation/animated-tooltip.js +1 -66
- package/dist/animation/animated-tooltip.mjs +1 -44
- package/dist/animation/apple-cards-carousel.js +1 -307
- package/dist/animation/apple-cards-carousel.mjs +1 -284
- package/dist/animation/apple-hello-effect.js +1 -59
- package/dist/animation/apple-hello-effect.mjs +1 -37
- package/dist/animation/index.js +2 -1951
- package/dist/animation/index.mjs +2 -1920
- package/dist/avatar.js +1 -70
- package/dist/avatar.mjs +1 -46
- package/dist/badge.js +1 -60
- package/dist/badge.mjs +1 -54
- package/dist/blocks/index.js +2 -1684
- package/dist/blocks/index.mjs +2 -1645
- package/dist/breadcrumb.js +1 -106
- package/dist/breadcrumb.mjs +1 -98
- package/dist/calendar-ext/index.js +1 -207
- package/dist/calendar-ext/index.mjs +1 -169
- package/dist/calendar.js +1 -193
- package/dist/calendar.mjs +1 -168
- package/dist/carousel.js +1 -282
- package/dist/carousel.mjs +1 -253
- package/dist/charts/index.js +6 -5840
- package/dist/charts/index.mjs +6 -5749
- package/dist/checkbox.js +1 -59
- package/dist/checkbox.mjs +1 -34
- package/dist/code/block.js +2 -225
- package/dist/code/block.mjs +2 -202
- package/dist/code/compare.js +5 -444
- package/dist/code/compare.mjs +5 -421
- package/dist/code/diff.js +12 -429
- package/dist/code/diff.mjs +11 -405
- package/dist/code/editor.js +1 -242
- package/dist/code/editor.mjs +1 -217
- package/dist/code/explorer.js +1 -290
- package/dist/code/explorer.mjs +1 -267
- package/dist/code/index.js +26 -2514
- package/dist/code/index.mjs +24 -2471
- package/dist/code/preview.js +6 -363
- package/dist/code/preview.mjs +6 -340
- package/dist/code/snippet.js +2 -273
- package/dist/code/snippet.mjs +2 -249
- package/dist/code/tabs.js +1 -74
- package/dist/code/tabs.mjs +1 -52
- package/dist/code/terminal.js +3 -436
- package/dist/code/terminal.mjs +3 -413
- package/dist/collapsible.js +1 -32
- package/dist/collapsible.mjs +1 -8
- package/dist/command.js +1 -282
- package/dist/command.mjs +1 -251
- package/dist/context-menu.js +1 -206
- package/dist/context-menu.mjs +1 -170
- package/dist/desktop/hooks.js +1 -223
- package/dist/desktop/hooks.mjs +1 -198
- package/dist/desktop/index.js +1 -685
- package/dist/desktop/index.mjs +1 -657
- package/dist/desktop/spotlight.js +1 -260
- package/dist/desktop/spotlight.mjs +1 -235
- package/dist/desktop/window.js +1 -273
- package/dist/desktop/window.mjs +1 -247
- package/dist/device/index.js +1 -2
- package/dist/device/index.mjs +0 -1
- package/dist/dialog.js +1 -245
- package/dist/dialog.mjs +1 -213
- package/dist/dock/basic.js +1 -173
- package/dist/dock/basic.mjs +1 -150
- package/dist/dock/index.js +1 -647
- package/dist/dock/index.mjs +1 -620
- package/dist/dock/limelight-nav.js +1 -314
- package/dist/dock/limelight-nav.mjs +1 -293
- package/dist/dock/macos.js +1 -140
- package/dist/dock/macos.mjs +1 -117
- package/dist/dock/menu.js +1 -69
- package/dist/dock/menu.mjs +1 -47
- package/dist/dock/message.js +1 -148
- package/dist/dock/message.mjs +1 -126
- package/dist/drawer.js +1 -114
- package/dist/drawer.mjs +1 -102
- package/dist/dropdown-menu.js +1 -201
- package/dist/dropdown-menu.mjs +1 -165
- package/dist/finance/AdvancedChart.js +2 -47
- package/dist/finance/AdvancedChart.mjs +2 -45
- package/dist/finance/CompanyProfile.js +2 -47
- package/dist/finance/CompanyProfile.mjs +2 -45
- package/dist/finance/CryptoScreener.js +2 -44
- package/dist/finance/CryptoScreener.mjs +2 -42
- package/dist/finance/Financials.js +2 -51
- package/dist/finance/Financials.mjs +2 -49
- package/dist/finance/ForexScreener.js +2 -45
- package/dist/finance/ForexScreener.mjs +2 -43
- package/dist/finance/MarketOverview.js +2 -103
- package/dist/finance/MarketOverview.mjs +2 -101
- package/dist/finance/NewsTimeline.js +2 -43
- package/dist/finance/NewsTimeline.mjs +2 -41
- package/dist/finance/OrderEntry.js +1 -130
- package/dist/finance/OrderEntry.mjs +1 -128
- package/dist/finance/OrdersHistory.js +1 -63
- package/dist/finance/OrdersHistory.mjs +1 -61
- package/dist/finance/PositionsList.js +1 -79
- package/dist/finance/PositionsList.mjs +1 -77
- package/dist/finance/StockScreener.js +2 -45
- package/dist/finance/StockScreener.mjs +2 -43
- package/dist/finance/SymbolInfo.js +2 -45
- package/dist/finance/SymbolInfo.mjs +2 -43
- package/dist/finance/TechnicalAnalysis.js +2 -53
- package/dist/finance/TechnicalAnalysis.mjs +2 -51
- package/dist/finance/TickerTape.js +2 -55
- package/dist/finance/TickerTape.mjs +2 -53
- package/dist/finance/TradingPanel.js +1 -190
- package/dist/finance/TradingPanel.mjs +1 -188
- package/dist/finance/index.js +2 -929
- package/dist/finance/index.mjs +2 -913
- package/dist/form/index.js +1 -153
- package/dist/form/index.mjs +1 -123
- package/dist/form.js +1 -171
- package/dist/form.mjs +1 -141
- package/dist/hover-card.js +1 -57
- package/dist/hover-card.mjs +1 -33
- package/dist/index.js +192 -9618
- package/dist/index.mjs +192 -9202
- package/dist/input-otp.js +1 -78
- package/dist/input-otp.mjs +1 -53
- package/dist/kanban/index.js +1 -593
- package/dist/kanban/index.mjs +1 -571
- package/dist/lib/utils.js +1 -28
- package/dist/lib/utils.mjs +1 -24
- package/dist/mermaid/index.js +1 -280
- package/dist/mermaid/index.mjs +1 -253
- package/dist/navigation/index.js +1 -97
- package/dist/navigation/index.mjs +1 -78
- package/dist/navigation-menu.js +1 -148
- package/dist/navigation-menu.mjs +1 -115
- package/dist/pattern/grid-pattern.js +3 -325
- package/dist/pattern/grid-pattern.mjs +3 -302
- package/dist/pattern/index.js +3 -325
- package/dist/pattern/index.mjs +3 -302
- package/dist/popover.js +1 -62
- package/dist/popover.mjs +1 -36
- package/dist/progress.js +1 -61
- package/dist/progress.mjs +1 -36
- package/dist/project/gantt.js +1 -64
- package/dist/project/gantt.mjs +1 -42
- package/dist/project/index.js +1 -635
- package/dist/project/index.mjs +1 -610
- package/dist/project/kanban.js +1 -596
- package/dist/project/kanban.mjs +1 -571
- package/dist/project/list.js +1 -34
- package/dist/project/list.mjs +1 -11
- package/dist/radio-group.js +1 -67
- package/dist/radio-group.mjs +1 -44
- package/dist/resizable.js +1 -71
- package/dist/resizable.mjs +1 -47
- package/dist/scroll-area.js +1 -88
- package/dist/scroll-area.mjs +1 -65
- package/dist/select.js +1 -139
- package/dist/select.mjs +1 -110
- package/dist/separator.js +1 -58
- package/dist/separator.mjs +1 -33
- package/dist/sheet.js +1 -147
- package/dist/sheet.mjs +1 -116
- package/dist/skeleton.js +1 -31
- package/dist/skeleton.mjs +1 -26
- package/dist/slider.js +1 -98
- package/dist/slider.mjs +1 -72
- package/dist/sonner.js +1 -33
- package/dist/sonner.mjs +1 -28
- package/dist/spline/index.js +1 -210
- package/dist/spline/index.mjs +1 -201
- package/dist/spline/media-stack.js +1 -192
- package/dist/spline/media-stack.mjs +1 -184
- package/dist/spline/player.js +1 -36
- package/dist/spline/player.mjs +1 -30
- package/dist/switch.js +1 -61
- package/dist/switch.mjs +1 -36
- package/dist/table.js +1 -109
- package/dist/table.mjs +1 -100
- package/dist/tabs.js +1 -127
- package/dist/tabs.mjs +1 -101
- package/dist/tailwind/index.mjs +1 -2011
- package/dist/textarea.js +1 -77
- package/dist/textarea.mjs +1 -55
- package/dist/toggle-group.js +1 -117
- package/dist/toggle-group.mjs +1 -92
- package/dist/toggle.js +1 -70
- package/dist/toggle.mjs +1 -47
- package/dist/tooltip.js +1 -66
- package/dist/tooltip.mjs +1 -39
- package/dist/types/index.mjs +1 -51
- package/dist/ui/announcement.js +1 -133
- package/dist/ui/announcement.mjs +1 -111
- package/dist/ui/avatar-group.js +1 -87
- package/dist/ui/avatar-group.mjs +1 -64
- package/dist/ui/banner.js +1 -84
- package/dist/ui/banner.mjs +1 -61
- package/dist/ui/cursor.js +1 -77
- package/dist/ui/cursor.mjs +1 -55
- package/dist/ui/index.js +1 -494
- package/dist/ui/index.mjs +1 -461
- package/dist/ui/marquee.js +1 -73
- package/dist/ui/marquee.mjs +1 -51
- package/dist/ui/pill.js +1 -84
- package/dist/ui/pill.mjs +1 -61
- package/dist/ui/spinner.js +1 -27
- package/dist/ui/spinner.mjs +1 -25
- package/dist/ui/tags.js +1 -116
- package/dist/ui/tags.mjs +1 -94
- package/dist/ui/ticker.js +1 -72
- package/dist/ui/ticker.mjs +1 -50
- package/dist/util/index.mjs +1 -404
- package/package.json +28 -27
- package/dist/primitives/index.js +0 -9619
- package/dist/primitives/index.mjs +0 -9203
- package/dist/primitives-export.js +0 -9619
- package/dist/primitives-export.mjs +0 -9203
package/dist/slider.mjs
CHANGED
|
@@ -1,73 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { clsx } from 'clsx';
|
|
5
|
-
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
var __defProp = Object.defineProperty;
|
|
9
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
-
function cn(...inputs) {
|
|
11
|
-
return twMerge(clsx(inputs));
|
|
12
|
-
}
|
|
13
|
-
__name(cn, "cn");
|
|
14
|
-
function Slider({
|
|
15
|
-
className,
|
|
16
|
-
defaultValue,
|
|
17
|
-
value,
|
|
18
|
-
min = 0,
|
|
19
|
-
max = 100,
|
|
20
|
-
...props
|
|
21
|
-
}) {
|
|
22
|
-
const _values = React.useMemo(
|
|
23
|
-
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
24
|
-
[value, defaultValue, min, max]
|
|
25
|
-
);
|
|
26
|
-
return /* @__PURE__ */ jsxs(
|
|
27
|
-
SliderPrimitive.Root,
|
|
28
|
-
{
|
|
29
|
-
"data-slot": "slider",
|
|
30
|
-
defaultValue,
|
|
31
|
-
value,
|
|
32
|
-
min,
|
|
33
|
-
max,
|
|
34
|
-
className: cn(
|
|
35
|
-
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
36
|
-
className
|
|
37
|
-
),
|
|
38
|
-
...props,
|
|
39
|
-
children: [
|
|
40
|
-
/* @__PURE__ */ jsx(
|
|
41
|
-
SliderPrimitive.Track,
|
|
42
|
-
{
|
|
43
|
-
"data-slot": "slider-track",
|
|
44
|
-
className: cn(
|
|
45
|
-
"bg-bg-quaternary relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
46
|
-
),
|
|
47
|
-
children: /* @__PURE__ */ jsx(
|
|
48
|
-
SliderPrimitive.Range,
|
|
49
|
-
{
|
|
50
|
-
"data-slot": "slider-range",
|
|
51
|
-
className: cn(
|
|
52
|
-
"bg-brand absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx(
|
|
59
|
-
SliderPrimitive.Thumb,
|
|
60
|
-
{
|
|
61
|
-
"data-slot": "slider-thumb",
|
|
62
|
-
className: "border-brand-500 bg-brand ring-brand/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
63
|
-
},
|
|
64
|
-
index
|
|
65
|
-
))
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
__name(Slider, "Slider");
|
|
71
|
-
var slider_default = Slider;
|
|
72
|
-
|
|
73
|
-
export { Slider, slider_default as default };
|
|
2
|
+
import*as t from'@radix-ui/react-slider';import*as d from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';var f=Object.defineProperty;var a=(e,r)=>f(e,"name",{value:r,configurable:true});function o(...e){return twMerge(clsx(e))}a(o,"cn");function h({className:e,defaultValue:r,value:i,min:n=0,max:l=100,...c}){let m=d.useMemo(()=>Array.isArray(i)?i:Array.isArray(r)?r:[n,l],[i,r,n,l]);return jsxs(t.Root,{"data-slot":"slider",defaultValue:r,value:i,min:n,max:l,className:o("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...c,children:[jsx(t.Track,{"data-slot":"slider-track",className:o("bg-bg-quaternary relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:jsx(t.Range,{"data-slot":"slider-range",className:o("bg-brand absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:m.length},(p,u)=>jsx(t.Thumb,{"data-slot":"slider-thumb",className:"border-brand-500 bg-brand ring-brand/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},u))]})}a(h,"Slider");var k=h;export{h as Slider,k as default};
|
package/dist/sonner.js
CHANGED
|
@@ -1,34 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var nextThemes = require('next-themes');
|
|
5
|
-
var sonner = require('sonner');
|
|
6
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
|
|
8
|
-
var __defProp = Object.defineProperty;
|
|
9
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
-
var Toaster = /* @__PURE__ */ __name(({ ...props }) => {
|
|
11
|
-
const { theme = "system" } = nextThemes.useTheme();
|
|
12
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13
|
-
sonner.Toaster,
|
|
14
|
-
{
|
|
15
|
-
theme,
|
|
16
|
-
className: "toaster group",
|
|
17
|
-
toastOptions: {
|
|
18
|
-
classNames: {
|
|
19
|
-
toast: "group toast group-[.toaster]:bg-level-2 group-[.toaster]:text-foreground group-[.toaster]:border-muted-3 group-[.toaster]:shadow-lg",
|
|
20
|
-
description: "group-[.toast]:text-foreground",
|
|
21
|
-
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-fg",
|
|
22
|
-
cancelButton: "group-[.toast]:bg-transparent group-[.toast]:text-foreground"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
...props
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
}, "Toaster");
|
|
29
|
-
|
|
30
|
-
Object.defineProperty(exports, "toast", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () { return sonner.toast; }
|
|
33
|
-
});
|
|
34
|
-
exports.Toaster = Toaster;
|
|
2
|
+
'use strict';var nextThemes=require('next-themes'),sonner=require('sonner'),jsxRuntime=require('react/jsx-runtime');var e=Object.defineProperty;var r=(t,o)=>e(t,"name",{value:o,configurable:true});var i=r(({...t})=>{let{theme:o="system"}=nextThemes.useTheme();return jsxRuntime.jsx(sonner.Toaster,{theme:o,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-level-2 group-[.toaster]:text-foreground group-[.toaster]:border-muted-3 group-[.toaster]:shadow-lg",description:"group-[.toast]:text-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-fg",cancelButton:"group-[.toast]:bg-transparent group-[.toast]:text-foreground"}},...t})},"Toaster");Object.defineProperty(exports,"toast",{enumerable:true,get:function(){return sonner.toast}});exports.Toaster=i;
|
package/dist/sonner.mjs
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { Toaster as Toaster$1 } from 'sonner';
|
|
4
|
-
export { toast } from 'sonner';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
var Toaster = /* @__PURE__ */ __name(({ ...props }) => {
|
|
10
|
-
const { theme = "system" } = useTheme();
|
|
11
|
-
return /* @__PURE__ */ jsx(
|
|
12
|
-
Toaster$1,
|
|
13
|
-
{
|
|
14
|
-
theme,
|
|
15
|
-
className: "toaster group",
|
|
16
|
-
toastOptions: {
|
|
17
|
-
classNames: {
|
|
18
|
-
toast: "group toast group-[.toaster]:bg-level-2 group-[.toaster]:text-foreground group-[.toaster]:border-muted-3 group-[.toaster]:shadow-lg",
|
|
19
|
-
description: "group-[.toast]:text-foreground",
|
|
20
|
-
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-fg",
|
|
21
|
-
cancelButton: "group-[.toast]:bg-transparent group-[.toast]:text-foreground"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
...props
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
}, "Toaster");
|
|
28
|
-
|
|
29
|
-
export { Toaster };
|
|
2
|
+
import {useTheme}from'next-themes';import {Toaster}from'sonner';export{toast}from'sonner';import {jsx}from'react/jsx-runtime';var e=Object.defineProperty;var r=(t,o)=>e(t,"name",{value:o,configurable:true});var i=r(({...t})=>{let{theme:o="system"}=useTheme();return jsx(Toaster,{theme:o,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-level-2 group-[.toaster]:text-foreground group-[.toaster]:border-muted-3 group-[.toaster]:shadow-lg",description:"group-[.toast]:text-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-fg",cancelButton:"group-[.toast]:bg-transparent group-[.toast]:text-foreground"}},...t})},"Toaster");export{i as Toaster};
|
package/dist/spline/index.js
CHANGED
|
@@ -1,211 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var Spline = require('@splinetool/react-spline');
|
|
5
|
-
var clsx = require('clsx');
|
|
6
|
-
var tailwindMerge = require('tailwind-merge');
|
|
7
|
-
var NextImage = require('next/image');
|
|
8
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
var React = require('react');
|
|
10
|
-
|
|
11
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
|
|
13
|
-
var Spline__default = /*#__PURE__*/_interopDefault(Spline);
|
|
14
|
-
var NextImage__default = /*#__PURE__*/_interopDefault(NextImage);
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
16
|
-
|
|
17
|
-
var __defProp = Object.defineProperty;
|
|
18
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
19
|
-
|
|
20
|
-
// util/spread-to-transform.ts
|
|
21
|
-
function spreadToTransform(t) {
|
|
22
|
-
let transformStrings = [];
|
|
23
|
-
const scaleVal = "scale" in t ? t.scale : void 0;
|
|
24
|
-
if (scaleVal) {
|
|
25
|
-
if (typeof scaleVal === "number") {
|
|
26
|
-
transformStrings.push(`scale(${scaleVal})`);
|
|
27
|
-
} else if (Array.isArray(scaleVal) && scaleVal.length == 2 && typeof scaleVal[0] === "number") {
|
|
28
|
-
transformStrings.push(`scale(${scaleVal[0]}, ${scaleVal[1]})`);
|
|
29
|
-
} else {
|
|
30
|
-
throw new Error("parsing MediaTransform: Unrecognized value for 'scale'!");
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return transformStrings.length > 0 ? { transform: transformStrings.join(" ") } : {};
|
|
34
|
-
}
|
|
35
|
-
__name(spreadToTransform, "spreadToTransform");
|
|
36
|
-
var spread_to_transform_default = spreadToTransform;
|
|
37
|
-
function cn(...inputs) {
|
|
38
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
39
|
-
}
|
|
40
|
-
__name(cn, "cn");
|
|
41
|
-
|
|
42
|
-
// util/index.ts
|
|
43
|
-
function constrain(value, minOrConstrainTo, max) {
|
|
44
|
-
if (typeof value === "number" && typeof minOrConstrainTo === "number" && typeof max === "number") {
|
|
45
|
-
return Math.min(Math.max(value, minOrConstrainTo), max);
|
|
46
|
-
}
|
|
47
|
-
if (typeof value === "object" && typeof minOrConstrainTo === "object") {
|
|
48
|
-
const dim = value;
|
|
49
|
-
const constrainTo = minOrConstrainTo;
|
|
50
|
-
const aspectRatio = dim.w / dim.h;
|
|
51
|
-
const constrainAspectRatio = constrainTo.w / constrainTo.h;
|
|
52
|
-
if (aspectRatio > constrainAspectRatio) {
|
|
53
|
-
return {
|
|
54
|
-
w: constrainTo.w,
|
|
55
|
-
h: constrainTo.w / aspectRatio
|
|
56
|
-
};
|
|
57
|
-
} else {
|
|
58
|
-
return {
|
|
59
|
-
w: constrainTo.h * aspectRatio,
|
|
60
|
-
h: constrainTo.h
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
throw new Error("Invalid parameters for constrain function");
|
|
65
|
-
}
|
|
66
|
-
__name(constrain, "constrain");
|
|
67
|
-
var Image = /* @__PURE__ */ __name(({
|
|
68
|
-
def,
|
|
69
|
-
constrainTo,
|
|
70
|
-
transform = {},
|
|
71
|
-
fullWidth = false,
|
|
72
|
-
className = "",
|
|
73
|
-
preload = false
|
|
74
|
-
}) => {
|
|
75
|
-
const {
|
|
76
|
-
src,
|
|
77
|
-
alt: _alt,
|
|
78
|
-
dim,
|
|
79
|
-
sizes,
|
|
80
|
-
svgFillClass: _svgFillClass
|
|
81
|
-
} = def;
|
|
82
|
-
const toSpread = {};
|
|
83
|
-
if (fullWidth) {
|
|
84
|
-
toSpread.style = {
|
|
85
|
-
width: "100%",
|
|
86
|
-
height: "auto",
|
|
87
|
-
...spread_to_transform_default(transform)
|
|
88
|
-
};
|
|
89
|
-
if (constrainTo) {
|
|
90
|
-
toSpread.style.maxWidth = constrainTo.w;
|
|
91
|
-
toSpread.style.maxHeight = constrainTo.h;
|
|
92
|
-
}
|
|
93
|
-
} else {
|
|
94
|
-
const resolved = constrainTo ? constrain(dim, constrainTo) : dim;
|
|
95
|
-
toSpread.width = resolved.w;
|
|
96
|
-
toSpread.height = resolved.h;
|
|
97
|
-
toSpread.style = { ...spread_to_transform_default(transform) };
|
|
98
|
-
}
|
|
99
|
-
if (sizes) {
|
|
100
|
-
toSpread.sizes = sizes;
|
|
101
|
-
}
|
|
102
|
-
let alt;
|
|
103
|
-
if (_alt) {
|
|
104
|
-
alt = _alt;
|
|
105
|
-
} else {
|
|
106
|
-
const tokens = src.split("/");
|
|
107
|
-
alt = tokens.length > 0 ? tokens[tokens.length - 1] : src;
|
|
108
|
-
}
|
|
109
|
-
const svgFillClass = _svgFillClass ?? "";
|
|
110
|
-
return fullWidth ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative flex flex-col items-center justify-center w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
111
|
-
NextImage__default.default,
|
|
112
|
-
{
|
|
113
|
-
src,
|
|
114
|
-
alt,
|
|
115
|
-
...toSpread,
|
|
116
|
-
priority: preload,
|
|
117
|
-
loading: preload ? "eager" : "lazy",
|
|
118
|
-
className: cn(svgFillClass, className)
|
|
119
|
-
}
|
|
120
|
-
) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
121
|
-
NextImage__default.default,
|
|
122
|
-
{
|
|
123
|
-
src,
|
|
124
|
-
alt,
|
|
125
|
-
...toSpread,
|
|
126
|
-
priority: preload,
|
|
127
|
-
loading: preload ? "eager" : "lazy",
|
|
128
|
-
className: cn(svgFillClass, className)
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
}, "Image");
|
|
132
|
-
var image_default = Image;
|
|
133
|
-
var VideoPlayer = React__default.default.forwardRef(
|
|
134
|
-
({
|
|
135
|
-
sources,
|
|
136
|
-
...rest
|
|
137
|
-
}, ref) => {
|
|
138
|
-
return /* @__PURE__ */ jsxRuntime.jsx("video", { ref, ...rest, children: sources.map((source, index) => /* @__PURE__ */ jsxRuntime.jsx("source", { src: source }, index)) });
|
|
139
|
-
}
|
|
140
|
-
);
|
|
141
|
-
var video_player_default = VideoPlayer;
|
|
142
|
-
var MediaStack = /* @__PURE__ */ __name(({
|
|
143
|
-
media,
|
|
144
|
-
constrainTo: cnst = { w: 250, h: 250 },
|
|
145
|
-
clx = ""
|
|
146
|
-
}) => {
|
|
147
|
-
const { img, video, animation, mediaTransform } = media;
|
|
148
|
-
const transform = mediaTransform ?? {};
|
|
149
|
-
if (animation) {
|
|
150
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
151
|
-
Spline__default.default,
|
|
152
|
-
{
|
|
153
|
-
scene: animation,
|
|
154
|
-
className: cn(clx, "pointer-events-none"),
|
|
155
|
-
"data-vaul-no-drag": true,
|
|
156
|
-
style: {
|
|
157
|
-
width: 6 / 5 * (typeof cnst.h === "number" ? cnst.h : parseInt(cnst.h)),
|
|
158
|
-
height: cnst.h,
|
|
159
|
-
...spread_to_transform_default(transform)
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
if (video) {
|
|
165
|
-
const dim = constrain(video.dim.md, cnst);
|
|
166
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
167
|
-
video_player_default,
|
|
168
|
-
{
|
|
169
|
-
className: clx,
|
|
170
|
-
sources: video.sources,
|
|
171
|
-
width: dim.w,
|
|
172
|
-
height: dim.h,
|
|
173
|
-
style: {
|
|
174
|
-
minHeight: dim.h,
|
|
175
|
-
...spread_to_transform_default(transform)
|
|
176
|
-
},
|
|
177
|
-
...video.videoProps
|
|
178
|
-
}
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
return img ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
182
|
-
image_default,
|
|
183
|
-
{
|
|
184
|
-
def: img,
|
|
185
|
-
constrainTo: cnst,
|
|
186
|
-
className: clx,
|
|
187
|
-
transform
|
|
188
|
-
}
|
|
189
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: cnst.w, height: cnst.h }, className: cn("bg-level-2", clx) });
|
|
190
|
-
}, "MediaStack");
|
|
191
|
-
var media_stack_default = MediaStack;
|
|
192
|
-
var SplinePlayer = /* @__PURE__ */ __name(({
|
|
193
|
-
scene,
|
|
194
|
-
className,
|
|
195
|
-
style,
|
|
196
|
-
onLoad
|
|
197
|
-
}) => {
|
|
198
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
199
|
-
Spline__default.default,
|
|
200
|
-
{
|
|
201
|
-
scene,
|
|
202
|
-
className: cn("pointer-events-none", className),
|
|
203
|
-
style,
|
|
204
|
-
onLoad
|
|
205
|
-
}
|
|
206
|
-
);
|
|
207
|
-
}, "SplinePlayer");
|
|
208
|
-
var player_default = SplinePlayer;
|
|
209
|
-
|
|
210
|
-
exports.MediaStack = media_stack_default;
|
|
211
|
-
exports.SplinePlayer = player_default;
|
|
2
|
+
'use strict';var L=require('@splinetool/react-spline'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),w=require('next/image'),jsxRuntime=require('react/jsx-runtime'),V=require('react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var L__default=/*#__PURE__*/_interopDefault(L);var w__default=/*#__PURE__*/_interopDefault(w);var V__default=/*#__PURE__*/_interopDefault(V);var M=Object.defineProperty;var s=(t,e)=>M(t,"name",{value:e,configurable:true});function N(t){let e=[],r="scale"in t?t.scale:void 0;if(r)if(typeof r=="number")e.push(`scale(${r})`);else if(Array.isArray(r)&&r.length==2&&typeof r[0]=="number")e.push(`scale(${r[0]}, ${r[1]})`);else throw new Error("parsing MediaTransform: Unrecognized value for 'scale'!");return e.length>0?{transform:e.join(" ")}:{}}s(N,"spreadToTransform");var p=N;function m(...t){return tailwindMerge.twMerge(clsx.clsx(t))}s(m,"cn");function h(t,e,r){if(typeof t=="number"&&typeof e=="number"&&typeof r=="number")return Math.min(Math.max(t,e),r);if(typeof t=="object"&&typeof e=="object"){let n=t,o=e,i=n.w/n.h,f=o.w/o.h;return i>f?{w:o.w,h:o.w/i}:{w:o.h*i,h:o.h}}throw new Error("Invalid parameters for constrain function")}s(h,"constrain");var C=s(({def:t,constrainTo:e,transform:r={},fullWidth:n=false,className:o="",preload:i=false})=>{let{src:f,alt:l,dim:c,sizes:b,svgFillClass:S}=t,a={};if(n)a.style={width:"100%",height:"auto",...p(r)},e&&(a.style.maxWidth=e.w,a.style.maxHeight=e.h);else {let u=e?h(c,e):c;a.width=u.w,a.height=u.h,a.style={...p(r)};}b&&(a.sizes=b);let d;if(l)d=l;else {let u=f.split("/");d=u.length>0?u[u.length-1]:f;}let x=S??"";return n?jsxRuntime.jsx("div",{className:"relative flex flex-col items-center justify-center w-full",children:jsxRuntime.jsx(w__default.default,{src:f,alt:d,...a,priority:i,loading:i?"eager":"lazy",className:m(x,o)})}):jsxRuntime.jsx(w__default.default,{src:f,alt:d,...a,priority:i,loading:i?"eager":"lazy",className:m(x,o)})},"Image"),v=C;var I=V__default.default.forwardRef(({sources:t,...e},r)=>jsxRuntime.jsx("video",{ref:r,...e,children:t.map((n,o)=>jsxRuntime.jsx("source",{src:n},o))})),P=I;var k=s(({media:t,constrainTo:e={w:250,h:250},clx:r=""})=>{let{img:n,video:o,animation:i,mediaTransform:f}=t,l=f??{};if(i)return jsxRuntime.jsx(L__default.default,{scene:i,className:m(r,"pointer-events-none"),"data-vaul-no-drag":true,style:{width:6/5*(typeof e.h=="number"?e.h:parseInt(e.h)),height:e.h,...p(l)}});if(o){let c=h(o.dim.md,e);return jsxRuntime.jsx(P,{className:r,sources:o.sources,width:c.w,height:c.h,style:{minHeight:c.h,...p(l)},...o.videoProps})}return n?jsxRuntime.jsx(v,{def:n,constrainTo:e,className:r,transform:l}):jsxRuntime.jsx("div",{style:{width:e.w,height:e.h},className:m("bg-level-2",r)})},"MediaStack"),A=k;var $=s(({scene:t,className:e,style:r,onLoad:n})=>jsxRuntime.jsx(L__default.default,{scene:t,className:m("pointer-events-none",e),style:r,onLoad:n}),"SplinePlayer"),z=$;exports.MediaStack=A;exports.SplinePlayer=z;
|
package/dist/spline/index.mjs
CHANGED
|
@@ -1,202 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import NextImage from 'next/image';
|
|
6
|
-
import { jsx } from 'react/jsx-runtime';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
var __defProp = Object.defineProperty;
|
|
10
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
11
|
-
|
|
12
|
-
// util/spread-to-transform.ts
|
|
13
|
-
function spreadToTransform(t) {
|
|
14
|
-
let transformStrings = [];
|
|
15
|
-
const scaleVal = "scale" in t ? t.scale : void 0;
|
|
16
|
-
if (scaleVal) {
|
|
17
|
-
if (typeof scaleVal === "number") {
|
|
18
|
-
transformStrings.push(`scale(${scaleVal})`);
|
|
19
|
-
} else if (Array.isArray(scaleVal) && scaleVal.length == 2 && typeof scaleVal[0] === "number") {
|
|
20
|
-
transformStrings.push(`scale(${scaleVal[0]}, ${scaleVal[1]})`);
|
|
21
|
-
} else {
|
|
22
|
-
throw new Error("parsing MediaTransform: Unrecognized value for 'scale'!");
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return transformStrings.length > 0 ? { transform: transformStrings.join(" ") } : {};
|
|
26
|
-
}
|
|
27
|
-
__name(spreadToTransform, "spreadToTransform");
|
|
28
|
-
var spread_to_transform_default = spreadToTransform;
|
|
29
|
-
function cn(...inputs) {
|
|
30
|
-
return twMerge(clsx(inputs));
|
|
31
|
-
}
|
|
32
|
-
__name(cn, "cn");
|
|
33
|
-
|
|
34
|
-
// util/index.ts
|
|
35
|
-
function constrain(value, minOrConstrainTo, max) {
|
|
36
|
-
if (typeof value === "number" && typeof minOrConstrainTo === "number" && typeof max === "number") {
|
|
37
|
-
return Math.min(Math.max(value, minOrConstrainTo), max);
|
|
38
|
-
}
|
|
39
|
-
if (typeof value === "object" && typeof minOrConstrainTo === "object") {
|
|
40
|
-
const dim = value;
|
|
41
|
-
const constrainTo = minOrConstrainTo;
|
|
42
|
-
const aspectRatio = dim.w / dim.h;
|
|
43
|
-
const constrainAspectRatio = constrainTo.w / constrainTo.h;
|
|
44
|
-
if (aspectRatio > constrainAspectRatio) {
|
|
45
|
-
return {
|
|
46
|
-
w: constrainTo.w,
|
|
47
|
-
h: constrainTo.w / aspectRatio
|
|
48
|
-
};
|
|
49
|
-
} else {
|
|
50
|
-
return {
|
|
51
|
-
w: constrainTo.h * aspectRatio,
|
|
52
|
-
h: constrainTo.h
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
throw new Error("Invalid parameters for constrain function");
|
|
57
|
-
}
|
|
58
|
-
__name(constrain, "constrain");
|
|
59
|
-
var Image = /* @__PURE__ */ __name(({
|
|
60
|
-
def,
|
|
61
|
-
constrainTo,
|
|
62
|
-
transform = {},
|
|
63
|
-
fullWidth = false,
|
|
64
|
-
className = "",
|
|
65
|
-
preload = false
|
|
66
|
-
}) => {
|
|
67
|
-
const {
|
|
68
|
-
src,
|
|
69
|
-
alt: _alt,
|
|
70
|
-
dim,
|
|
71
|
-
sizes,
|
|
72
|
-
svgFillClass: _svgFillClass
|
|
73
|
-
} = def;
|
|
74
|
-
const toSpread = {};
|
|
75
|
-
if (fullWidth) {
|
|
76
|
-
toSpread.style = {
|
|
77
|
-
width: "100%",
|
|
78
|
-
height: "auto",
|
|
79
|
-
...spread_to_transform_default(transform)
|
|
80
|
-
};
|
|
81
|
-
if (constrainTo) {
|
|
82
|
-
toSpread.style.maxWidth = constrainTo.w;
|
|
83
|
-
toSpread.style.maxHeight = constrainTo.h;
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
const resolved = constrainTo ? constrain(dim, constrainTo) : dim;
|
|
87
|
-
toSpread.width = resolved.w;
|
|
88
|
-
toSpread.height = resolved.h;
|
|
89
|
-
toSpread.style = { ...spread_to_transform_default(transform) };
|
|
90
|
-
}
|
|
91
|
-
if (sizes) {
|
|
92
|
-
toSpread.sizes = sizes;
|
|
93
|
-
}
|
|
94
|
-
let alt;
|
|
95
|
-
if (_alt) {
|
|
96
|
-
alt = _alt;
|
|
97
|
-
} else {
|
|
98
|
-
const tokens = src.split("/");
|
|
99
|
-
alt = tokens.length > 0 ? tokens[tokens.length - 1] : src;
|
|
100
|
-
}
|
|
101
|
-
const svgFillClass = _svgFillClass ?? "";
|
|
102
|
-
return fullWidth ? /* @__PURE__ */ jsx("div", { className: "relative flex flex-col items-center justify-center w-full", children: /* @__PURE__ */ jsx(
|
|
103
|
-
NextImage,
|
|
104
|
-
{
|
|
105
|
-
src,
|
|
106
|
-
alt,
|
|
107
|
-
...toSpread,
|
|
108
|
-
priority: preload,
|
|
109
|
-
loading: preload ? "eager" : "lazy",
|
|
110
|
-
className: cn(svgFillClass, className)
|
|
111
|
-
}
|
|
112
|
-
) }) : /* @__PURE__ */ jsx(
|
|
113
|
-
NextImage,
|
|
114
|
-
{
|
|
115
|
-
src,
|
|
116
|
-
alt,
|
|
117
|
-
...toSpread,
|
|
118
|
-
priority: preload,
|
|
119
|
-
loading: preload ? "eager" : "lazy",
|
|
120
|
-
className: cn(svgFillClass, className)
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
}, "Image");
|
|
124
|
-
var image_default = Image;
|
|
125
|
-
var VideoPlayer = React.forwardRef(
|
|
126
|
-
({
|
|
127
|
-
sources,
|
|
128
|
-
...rest
|
|
129
|
-
}, ref) => {
|
|
130
|
-
return /* @__PURE__ */ jsx("video", { ref, ...rest, children: sources.map((source, index) => /* @__PURE__ */ jsx("source", { src: source }, index)) });
|
|
131
|
-
}
|
|
132
|
-
);
|
|
133
|
-
var video_player_default = VideoPlayer;
|
|
134
|
-
var MediaStack = /* @__PURE__ */ __name(({
|
|
135
|
-
media,
|
|
136
|
-
constrainTo: cnst = { w: 250, h: 250 },
|
|
137
|
-
clx = ""
|
|
138
|
-
}) => {
|
|
139
|
-
const { img, video, animation, mediaTransform } = media;
|
|
140
|
-
const transform = mediaTransform ?? {};
|
|
141
|
-
if (animation) {
|
|
142
|
-
return /* @__PURE__ */ jsx(
|
|
143
|
-
Spline,
|
|
144
|
-
{
|
|
145
|
-
scene: animation,
|
|
146
|
-
className: cn(clx, "pointer-events-none"),
|
|
147
|
-
"data-vaul-no-drag": true,
|
|
148
|
-
style: {
|
|
149
|
-
width: 6 / 5 * (typeof cnst.h === "number" ? cnst.h : parseInt(cnst.h)),
|
|
150
|
-
height: cnst.h,
|
|
151
|
-
...spread_to_transform_default(transform)
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
if (video) {
|
|
157
|
-
const dim = constrain(video.dim.md, cnst);
|
|
158
|
-
return /* @__PURE__ */ jsx(
|
|
159
|
-
video_player_default,
|
|
160
|
-
{
|
|
161
|
-
className: clx,
|
|
162
|
-
sources: video.sources,
|
|
163
|
-
width: dim.w,
|
|
164
|
-
height: dim.h,
|
|
165
|
-
style: {
|
|
166
|
-
minHeight: dim.h,
|
|
167
|
-
...spread_to_transform_default(transform)
|
|
168
|
-
},
|
|
169
|
-
...video.videoProps
|
|
170
|
-
}
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
return img ? /* @__PURE__ */ jsx(
|
|
174
|
-
image_default,
|
|
175
|
-
{
|
|
176
|
-
def: img,
|
|
177
|
-
constrainTo: cnst,
|
|
178
|
-
className: clx,
|
|
179
|
-
transform
|
|
180
|
-
}
|
|
181
|
-
) : /* @__PURE__ */ jsx("div", { style: { width: cnst.w, height: cnst.h }, className: cn("bg-level-2", clx) });
|
|
182
|
-
}, "MediaStack");
|
|
183
|
-
var media_stack_default = MediaStack;
|
|
184
|
-
var SplinePlayer = /* @__PURE__ */ __name(({
|
|
185
|
-
scene,
|
|
186
|
-
className,
|
|
187
|
-
style,
|
|
188
|
-
onLoad
|
|
189
|
-
}) => {
|
|
190
|
-
return /* @__PURE__ */ jsx(
|
|
191
|
-
Spline,
|
|
192
|
-
{
|
|
193
|
-
scene,
|
|
194
|
-
className: cn("pointer-events-none", className),
|
|
195
|
-
style,
|
|
196
|
-
onLoad
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
}, "SplinePlayer");
|
|
200
|
-
var player_default = SplinePlayer;
|
|
201
|
-
|
|
202
|
-
export { media_stack_default as MediaStack, player_default as SplinePlayer };
|
|
2
|
+
import L from'@splinetool/react-spline';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import w from'next/image';import {jsx}from'react/jsx-runtime';import V from'react';var M=Object.defineProperty;var s=(t,e)=>M(t,"name",{value:e,configurable:true});function N(t){let e=[],r="scale"in t?t.scale:void 0;if(r)if(typeof r=="number")e.push(`scale(${r})`);else if(Array.isArray(r)&&r.length==2&&typeof r[0]=="number")e.push(`scale(${r[0]}, ${r[1]})`);else throw new Error("parsing MediaTransform: Unrecognized value for 'scale'!");return e.length>0?{transform:e.join(" ")}:{}}s(N,"spreadToTransform");var p=N;function m(...t){return twMerge(clsx(t))}s(m,"cn");function h(t,e,r){if(typeof t=="number"&&typeof e=="number"&&typeof r=="number")return Math.min(Math.max(t,e),r);if(typeof t=="object"&&typeof e=="object"){let n=t,o=e,i=n.w/n.h,f=o.w/o.h;return i>f?{w:o.w,h:o.w/i}:{w:o.h*i,h:o.h}}throw new Error("Invalid parameters for constrain function")}s(h,"constrain");var C=s(({def:t,constrainTo:e,transform:r={},fullWidth:n=false,className:o="",preload:i=false})=>{let{src:f,alt:l,dim:c,sizes:b,svgFillClass:S}=t,a={};if(n)a.style={width:"100%",height:"auto",...p(r)},e&&(a.style.maxWidth=e.w,a.style.maxHeight=e.h);else {let u=e?h(c,e):c;a.width=u.w,a.height=u.h,a.style={...p(r)};}b&&(a.sizes=b);let d;if(l)d=l;else {let u=f.split("/");d=u.length>0?u[u.length-1]:f;}let x=S??"";return n?jsx("div",{className:"relative flex flex-col items-center justify-center w-full",children:jsx(w,{src:f,alt:d,...a,priority:i,loading:i?"eager":"lazy",className:m(x,o)})}):jsx(w,{src:f,alt:d,...a,priority:i,loading:i?"eager":"lazy",className:m(x,o)})},"Image"),v=C;var I=V.forwardRef(({sources:t,...e},r)=>jsx("video",{ref:r,...e,children:t.map((n,o)=>jsx("source",{src:n},o))})),P=I;var k=s(({media:t,constrainTo:e={w:250,h:250},clx:r=""})=>{let{img:n,video:o,animation:i,mediaTransform:f}=t,l=f??{};if(i)return jsx(L,{scene:i,className:m(r,"pointer-events-none"),"data-vaul-no-drag":true,style:{width:6/5*(typeof e.h=="number"?e.h:parseInt(e.h)),height:e.h,...p(l)}});if(o){let c=h(o.dim.md,e);return jsx(P,{className:r,sources:o.sources,width:c.w,height:c.h,style:{minHeight:c.h,...p(l)},...o.videoProps})}return n?jsx(v,{def:n,constrainTo:e,className:r,transform:l}):jsx("div",{style:{width:e.w,height:e.h},className:m("bg-level-2",r)})},"MediaStack"),A=k;var $=s(({scene:t,className:e,style:r,onLoad:n})=>jsx(L,{scene:t,className:m("pointer-events-none",e),style:r,onLoad:n}),"SplinePlayer"),z=$;export{A as MediaStack,z as SplinePlayer};
|