@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/dialog.js
CHANGED
|
@@ -1,246 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
5
|
-
var lucideReact = require('lucide-react');
|
|
6
|
-
var clsx = require('clsx');
|
|
7
|
-
var tailwindMerge = require('tailwind-merge');
|
|
8
|
-
var reactSlot = require('@radix-ui/react-slot');
|
|
9
|
-
var classVarianceAuthority = require('class-variance-authority');
|
|
10
|
-
var React = require('react');
|
|
11
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
12
|
-
|
|
13
|
-
function _interopNamespace(e) {
|
|
14
|
-
if (e && e.__esModule) return e;
|
|
15
|
-
var n = Object.create(null);
|
|
16
|
-
if (e) {
|
|
17
|
-
Object.keys(e).forEach(function (k) {
|
|
18
|
-
if (k !== 'default') {
|
|
19
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () { return e[k]; }
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
n.default = e;
|
|
28
|
-
return Object.freeze(n);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
32
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
33
|
-
|
|
34
|
-
var __defProp = Object.defineProperty;
|
|
35
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
36
|
-
function cn(...inputs) {
|
|
37
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
38
|
-
}
|
|
39
|
-
__name(cn, "cn");
|
|
40
|
-
var buttonVariants = classVarianceAuthority.cva(
|
|
41
|
-
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
42
|
-
{
|
|
43
|
-
variants: {
|
|
44
|
-
variant: {
|
|
45
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
46
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
47
|
-
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
48
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
49
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
50
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
51
|
-
// Keep the additional Hanzo variants for backward compatibility
|
|
52
|
-
primary: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
53
|
-
linkFG: "text-primary underline-offset-4 hover:underline",
|
|
54
|
-
linkMuted: "text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"
|
|
55
|
-
},
|
|
56
|
-
size: {
|
|
57
|
-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
58
|
-
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
59
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
60
|
-
icon: "size-9",
|
|
61
|
-
"icon-sm": "size-8",
|
|
62
|
-
"icon-lg": "size-10"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
defaultVariants: {
|
|
66
|
-
variant: "default",
|
|
67
|
-
size: "default"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
var Button = React__namespace.forwardRef(
|
|
72
|
-
({ className, variant = "default", size = "default", asChild = false, isLoading = false, children, ...props }, ref) => {
|
|
73
|
-
const Comp = asChild ? reactSlot.Slot : "button";
|
|
74
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
75
|
-
Comp,
|
|
76
|
-
{
|
|
77
|
-
"data-slot": "button",
|
|
78
|
-
"data-variant": variant,
|
|
79
|
-
"data-size": size,
|
|
80
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
81
|
-
ref,
|
|
82
|
-
...props,
|
|
83
|
-
children: [
|
|
84
|
-
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
85
|
-
lucideReact.Loader2,
|
|
86
|
-
{
|
|
87
|
-
className: cn("h-4 w-4 animate-spin", size !== "icon" && size !== "icon-sm" && size !== "icon-lg" && "mr-2")
|
|
88
|
-
}
|
|
89
|
-
) : null,
|
|
90
|
-
isLoading && (size === "icon" || size === "icon-sm" || size === "icon-lg") ? null : children
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
);
|
|
96
|
-
Button.displayName = "Button";
|
|
97
|
-
function Dialog({ ...props }) {
|
|
98
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
|
|
99
|
-
}
|
|
100
|
-
__name(Dialog, "Dialog");
|
|
101
|
-
function DialogTrigger({
|
|
102
|
-
...props
|
|
103
|
-
}) {
|
|
104
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
105
|
-
}
|
|
106
|
-
__name(DialogTrigger, "DialogTrigger");
|
|
107
|
-
function DialogPortal({
|
|
108
|
-
...props
|
|
109
|
-
}) {
|
|
110
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
|
|
111
|
-
}
|
|
112
|
-
__name(DialogPortal, "DialogPortal");
|
|
113
|
-
function DialogClose({
|
|
114
|
-
...props
|
|
115
|
-
}) {
|
|
116
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { "data-slot": "dialog-close", ...props });
|
|
117
|
-
}
|
|
118
|
-
__name(DialogClose, "DialogClose");
|
|
119
|
-
function DialogOverlay({
|
|
120
|
-
className,
|
|
121
|
-
...props
|
|
122
|
-
}) {
|
|
123
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
124
|
-
DialogPrimitive__namespace.Overlay,
|
|
125
|
-
{
|
|
126
|
-
"data-slot": "dialog-overlay",
|
|
127
|
-
className: cn(
|
|
128
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 isolate z-50",
|
|
129
|
-
"bg-black/80",
|
|
130
|
-
className
|
|
131
|
-
),
|
|
132
|
-
...props
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
__name(DialogOverlay, "DialogOverlay");
|
|
137
|
-
function DialogContent({
|
|
138
|
-
className,
|
|
139
|
-
children,
|
|
140
|
-
showCloseButton = true,
|
|
141
|
-
...props
|
|
142
|
-
}) {
|
|
143
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
144
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
145
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
146
|
-
DialogPrimitive__namespace.Content,
|
|
147
|
-
{
|
|
148
|
-
"data-slot": "dialog-content",
|
|
149
|
-
className: cn(
|
|
150
|
-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200",
|
|
151
|
-
className
|
|
152
|
-
),
|
|
153
|
-
...props,
|
|
154
|
-
children: [
|
|
155
|
-
children,
|
|
156
|
-
showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { "data-slot": "dialog-close", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
157
|
-
Button,
|
|
158
|
-
{
|
|
159
|
-
variant: "ghost",
|
|
160
|
-
size: "icon-sm",
|
|
161
|
-
className: "absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none",
|
|
162
|
-
children: [
|
|
163
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-4" }),
|
|
164
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
165
|
-
]
|
|
166
|
-
}
|
|
167
|
-
) })
|
|
168
|
-
]
|
|
169
|
-
}
|
|
170
|
-
)
|
|
171
|
-
] });
|
|
172
|
-
}
|
|
173
|
-
__name(DialogContent, "DialogContent");
|
|
174
|
-
function DialogHeader({ className, ...props }) {
|
|
175
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
176
|
-
"div",
|
|
177
|
-
{
|
|
178
|
-
"data-slot": "dialog-header",
|
|
179
|
-
className: cn("flex flex-col gap-1.5 text-center sm:text-left", className),
|
|
180
|
-
...props
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
__name(DialogHeader, "DialogHeader");
|
|
185
|
-
function DialogFooter({
|
|
186
|
-
className,
|
|
187
|
-
showCloseButton = false,
|
|
188
|
-
children,
|
|
189
|
-
...props
|
|
190
|
-
}) {
|
|
191
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
192
|
-
"div",
|
|
193
|
-
{
|
|
194
|
-
"data-slot": "dialog-footer",
|
|
195
|
-
className: cn(
|
|
196
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
197
|
-
className
|
|
198
|
-
),
|
|
199
|
-
...props,
|
|
200
|
-
children: [
|
|
201
|
-
children,
|
|
202
|
-
showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", children: "Close" }) })
|
|
203
|
-
]
|
|
204
|
-
}
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
__name(DialogFooter, "DialogFooter");
|
|
208
|
-
function DialogTitle({
|
|
209
|
-
className,
|
|
210
|
-
...props
|
|
211
|
-
}) {
|
|
212
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
213
|
-
DialogPrimitive__namespace.Title,
|
|
214
|
-
{
|
|
215
|
-
"data-slot": "dialog-title",
|
|
216
|
-
className: cn("text-lg leading-none font-semibold tracking-tight", className),
|
|
217
|
-
...props
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
__name(DialogTitle, "DialogTitle");
|
|
222
|
-
function DialogDescription({
|
|
223
|
-
className,
|
|
224
|
-
...props
|
|
225
|
-
}) {
|
|
226
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
227
|
-
DialogPrimitive__namespace.Description,
|
|
228
|
-
{
|
|
229
|
-
"data-slot": "dialog-description",
|
|
230
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
231
|
-
...props
|
|
232
|
-
}
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
__name(DialogDescription, "DialogDescription");
|
|
236
|
-
|
|
237
|
-
exports.Dialog = Dialog;
|
|
238
|
-
exports.DialogClose = DialogClose;
|
|
239
|
-
exports.DialogContent = DialogContent;
|
|
240
|
-
exports.DialogDescription = DialogDescription;
|
|
241
|
-
exports.DialogFooter = DialogFooter;
|
|
242
|
-
exports.DialogHeader = DialogHeader;
|
|
243
|
-
exports.DialogOverlay = DialogOverlay;
|
|
244
|
-
exports.DialogPortal = DialogPortal;
|
|
245
|
-
exports.DialogTitle = DialogTitle;
|
|
246
|
-
exports.DialogTrigger = DialogTrigger;
|
|
2
|
+
'use strict';var e=require('@radix-ui/react-dialog'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),c=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);var c__namespace=/*#__PURE__*/_interopNamespace(c);var f=Object.defineProperty;var a=(t,o)=>f(t,"name",{value:o,configurable:true});function n(...t){return tailwindMerge.twMerge(clsx.clsx(t))}a(n,"cn");var y=classVarianceAuthority.cva('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline",primary:"bg-primary text-primary-foreground shadow hover:bg-primary/90",linkFG:"text-primary underline-offset-4 hover:underline",linkMuted:"text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),l=c__namespace.forwardRef(({className:t,variant:o="default",size:r="default",asChild:s=false,isLoading:g=false,children:u,...m},p)=>jsxRuntime.jsxs(s?reactSlot.Slot:"button",{"data-slot":"button","data-variant":o,"data-size":r,className:n(y({variant:o,size:r,className:t})),ref:p,...m,children:[g?jsxRuntime.jsx(lucideReact.Loader2,{className:n("h-4 w-4 animate-spin",r!=="icon"&&r!=="icon-sm"&&r!=="icon-lg"&&"mr-2")}):null,g&&(r==="icon"||r==="icon-sm"||r==="icon-lg")?null:u]}));l.displayName="Button";function X({...t}){return jsxRuntime.jsx(e__namespace.Root,{"data-slot":"dialog",...t})}a(X,"Dialog");function $({...t}){return jsxRuntime.jsx(e__namespace.Trigger,{"data-slot":"dialog-trigger",...t})}a($,"DialogTrigger");function k({...t}){return jsxRuntime.jsx(e__namespace.Portal,{"data-slot":"dialog-portal",...t})}a(k,"DialogPortal");function G({...t}){return jsxRuntime.jsx(e__namespace.Close,{"data-slot":"dialog-close",...t})}a(G,"DialogClose");function w({className:t,...o}){return jsxRuntime.jsx(e__namespace.Overlay,{"data-slot":"dialog-overlay",className:n("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 isolate z-50","bg-black/80",t),...o})}a(w,"DialogOverlay");function I({className:t,children:o,showCloseButton:r=true,...s}){return jsxRuntime.jsxs(k,{children:[jsxRuntime.jsx(w,{}),jsxRuntime.jsxs(e__namespace.Content,{"data-slot":"dialog-content",className:n("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200",t),...s,children:[o,r&&jsxRuntime.jsx(e__namespace.Close,{"data-slot":"dialog-close",asChild:true,children:jsxRuntime.jsxs(l,{variant:"ghost",size:"icon-sm",className:"absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none",children:[jsxRuntime.jsx(lucideReact.X,{className:"size-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}a(I,"DialogContent");function j({className:t,...o}){return jsxRuntime.jsx("div",{"data-slot":"dialog-header",className:n("flex flex-col gap-1.5 text-center sm:text-left",t),...o})}a(j,"DialogHeader");function q({className:t,showCloseButton:o=false,children:r,...s}){return jsxRuntime.jsxs("div",{"data-slot":"dialog-footer",className:n("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...s,children:[r,o&&jsxRuntime.jsx(e__namespace.Close,{asChild:true,children:jsxRuntime.jsx(l,{variant:"outline",children:"Close"})})]})}a(q,"DialogFooter");function J({className:t,...o}){return jsxRuntime.jsx(e__namespace.Title,{"data-slot":"dialog-title",className:n("text-lg leading-none font-semibold tracking-tight",t),...o})}a(J,"DialogTitle");function K({className:t,...o}){return jsxRuntime.jsx(e__namespace.Description,{"data-slot":"dialog-description",className:n("text-muted-foreground text-sm",t),...o})}a(K,"DialogDescription");exports.Dialog=X;exports.DialogClose=G;exports.DialogContent=I;exports.DialogDescription=K;exports.DialogFooter=q;exports.DialogHeader=j;exports.DialogOverlay=w;exports.DialogPortal=k;exports.DialogTitle=J;exports.DialogTrigger=$;
|
package/dist/dialog.mjs
CHANGED
|
@@ -1,214 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import { Loader2, X } from 'lucide-react';
|
|
4
|
-
import { clsx } from 'clsx';
|
|
5
|
-
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
-
import { cva } from 'class-variance-authority';
|
|
8
|
-
import * as React from 'react';
|
|
9
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
|
-
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
|
-
function cn(...inputs) {
|
|
14
|
-
return twMerge(clsx(inputs));
|
|
15
|
-
}
|
|
16
|
-
__name(cn, "cn");
|
|
17
|
-
var buttonVariants = cva(
|
|
18
|
-
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
19
|
-
{
|
|
20
|
-
variants: {
|
|
21
|
-
variant: {
|
|
22
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
23
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
24
|
-
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
25
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
26
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
27
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
28
|
-
// Keep the additional Hanzo variants for backward compatibility
|
|
29
|
-
primary: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
30
|
-
linkFG: "text-primary underline-offset-4 hover:underline",
|
|
31
|
-
linkMuted: "text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"
|
|
32
|
-
},
|
|
33
|
-
size: {
|
|
34
|
-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
35
|
-
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
36
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
37
|
-
icon: "size-9",
|
|
38
|
-
"icon-sm": "size-8",
|
|
39
|
-
"icon-lg": "size-10"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
defaultVariants: {
|
|
43
|
-
variant: "default",
|
|
44
|
-
size: "default"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
var Button = React.forwardRef(
|
|
49
|
-
({ className, variant = "default", size = "default", asChild = false, isLoading = false, children, ...props }, ref) => {
|
|
50
|
-
const Comp = asChild ? Slot : "button";
|
|
51
|
-
return /* @__PURE__ */ jsxs(
|
|
52
|
-
Comp,
|
|
53
|
-
{
|
|
54
|
-
"data-slot": "button",
|
|
55
|
-
"data-variant": variant,
|
|
56
|
-
"data-size": size,
|
|
57
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
58
|
-
ref,
|
|
59
|
-
...props,
|
|
60
|
-
children: [
|
|
61
|
-
isLoading ? /* @__PURE__ */ jsx(
|
|
62
|
-
Loader2,
|
|
63
|
-
{
|
|
64
|
-
className: cn("h-4 w-4 animate-spin", size !== "icon" && size !== "icon-sm" && size !== "icon-lg" && "mr-2")
|
|
65
|
-
}
|
|
66
|
-
) : null,
|
|
67
|
-
isLoading && (size === "icon" || size === "icon-sm" || size === "icon-lg") ? null : children
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
Button.displayName = "Button";
|
|
74
|
-
function Dialog({ ...props }) {
|
|
75
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
76
|
-
}
|
|
77
|
-
__name(Dialog, "Dialog");
|
|
78
|
-
function DialogTrigger({
|
|
79
|
-
...props
|
|
80
|
-
}) {
|
|
81
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
82
|
-
}
|
|
83
|
-
__name(DialogTrigger, "DialogTrigger");
|
|
84
|
-
function DialogPortal({
|
|
85
|
-
...props
|
|
86
|
-
}) {
|
|
87
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
88
|
-
}
|
|
89
|
-
__name(DialogPortal, "DialogPortal");
|
|
90
|
-
function DialogClose({
|
|
91
|
-
...props
|
|
92
|
-
}) {
|
|
93
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
94
|
-
}
|
|
95
|
-
__name(DialogClose, "DialogClose");
|
|
96
|
-
function DialogOverlay({
|
|
97
|
-
className,
|
|
98
|
-
...props
|
|
99
|
-
}) {
|
|
100
|
-
return /* @__PURE__ */ jsx(
|
|
101
|
-
DialogPrimitive.Overlay,
|
|
102
|
-
{
|
|
103
|
-
"data-slot": "dialog-overlay",
|
|
104
|
-
className: cn(
|
|
105
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 isolate z-50",
|
|
106
|
-
"bg-black/80",
|
|
107
|
-
className
|
|
108
|
-
),
|
|
109
|
-
...props
|
|
110
|
-
}
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
__name(DialogOverlay, "DialogOverlay");
|
|
114
|
-
function DialogContent({
|
|
115
|
-
className,
|
|
116
|
-
children,
|
|
117
|
-
showCloseButton = true,
|
|
118
|
-
...props
|
|
119
|
-
}) {
|
|
120
|
-
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
121
|
-
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
122
|
-
/* @__PURE__ */ jsxs(
|
|
123
|
-
DialogPrimitive.Content,
|
|
124
|
-
{
|
|
125
|
-
"data-slot": "dialog-content",
|
|
126
|
-
className: cn(
|
|
127
|
-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200",
|
|
128
|
-
className
|
|
129
|
-
),
|
|
130
|
-
...props,
|
|
131
|
-
children: [
|
|
132
|
-
children,
|
|
133
|
-
showCloseButton && /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", asChild: true, children: /* @__PURE__ */ jsxs(
|
|
134
|
-
Button,
|
|
135
|
-
{
|
|
136
|
-
variant: "ghost",
|
|
137
|
-
size: "icon-sm",
|
|
138
|
-
className: "absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none",
|
|
139
|
-
children: [
|
|
140
|
-
/* @__PURE__ */ jsx(X, { className: "size-4" }),
|
|
141
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
) })
|
|
145
|
-
]
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
] });
|
|
149
|
-
}
|
|
150
|
-
__name(DialogContent, "DialogContent");
|
|
151
|
-
function DialogHeader({ className, ...props }) {
|
|
152
|
-
return /* @__PURE__ */ jsx(
|
|
153
|
-
"div",
|
|
154
|
-
{
|
|
155
|
-
"data-slot": "dialog-header",
|
|
156
|
-
className: cn("flex flex-col gap-1.5 text-center sm:text-left", className),
|
|
157
|
-
...props
|
|
158
|
-
}
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
__name(DialogHeader, "DialogHeader");
|
|
162
|
-
function DialogFooter({
|
|
163
|
-
className,
|
|
164
|
-
showCloseButton = false,
|
|
165
|
-
children,
|
|
166
|
-
...props
|
|
167
|
-
}) {
|
|
168
|
-
return /* @__PURE__ */ jsxs(
|
|
169
|
-
"div",
|
|
170
|
-
{
|
|
171
|
-
"data-slot": "dialog-footer",
|
|
172
|
-
className: cn(
|
|
173
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
174
|
-
className
|
|
175
|
-
),
|
|
176
|
-
...props,
|
|
177
|
-
children: [
|
|
178
|
-
children,
|
|
179
|
-
showCloseButton && /* @__PURE__ */ jsx(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "outline", children: "Close" }) })
|
|
180
|
-
]
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
__name(DialogFooter, "DialogFooter");
|
|
185
|
-
function DialogTitle({
|
|
186
|
-
className,
|
|
187
|
-
...props
|
|
188
|
-
}) {
|
|
189
|
-
return /* @__PURE__ */ jsx(
|
|
190
|
-
DialogPrimitive.Title,
|
|
191
|
-
{
|
|
192
|
-
"data-slot": "dialog-title",
|
|
193
|
-
className: cn("text-lg leading-none font-semibold tracking-tight", className),
|
|
194
|
-
...props
|
|
195
|
-
}
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
__name(DialogTitle, "DialogTitle");
|
|
199
|
-
function DialogDescription({
|
|
200
|
-
className,
|
|
201
|
-
...props
|
|
202
|
-
}) {
|
|
203
|
-
return /* @__PURE__ */ jsx(
|
|
204
|
-
DialogPrimitive.Description,
|
|
205
|
-
{
|
|
206
|
-
"data-slot": "dialog-description",
|
|
207
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
208
|
-
...props
|
|
209
|
-
}
|
|
210
|
-
);
|
|
211
|
-
}
|
|
212
|
-
__name(DialogDescription, "DialogDescription");
|
|
213
|
-
|
|
214
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
2
|
+
import*as e from'@radix-ui/react-dialog';import {Loader2,X as X$1}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import*as c from'react';import {jsxs,jsx}from'react/jsx-runtime';var f=Object.defineProperty;var a=(t,o)=>f(t,"name",{value:o,configurable:true});function n(...t){return twMerge(clsx(t))}a(n,"cn");var y=cva('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline",primary:"bg-primary text-primary-foreground shadow hover:bg-primary/90",linkFG:"text-primary underline-offset-4 hover:underline",linkMuted:"text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),l=c.forwardRef(({className:t,variant:o="default",size:r="default",asChild:s=false,isLoading:g=false,children:u,...m},p)=>jsxs(s?Slot:"button",{"data-slot":"button","data-variant":o,"data-size":r,className:n(y({variant:o,size:r,className:t})),ref:p,...m,children:[g?jsx(Loader2,{className:n("h-4 w-4 animate-spin",r!=="icon"&&r!=="icon-sm"&&r!=="icon-lg"&&"mr-2")}):null,g&&(r==="icon"||r==="icon-sm"||r==="icon-lg")?null:u]}));l.displayName="Button";function X({...t}){return jsx(e.Root,{"data-slot":"dialog",...t})}a(X,"Dialog");function $({...t}){return jsx(e.Trigger,{"data-slot":"dialog-trigger",...t})}a($,"DialogTrigger");function k({...t}){return jsx(e.Portal,{"data-slot":"dialog-portal",...t})}a(k,"DialogPortal");function G({...t}){return jsx(e.Close,{"data-slot":"dialog-close",...t})}a(G,"DialogClose");function w({className:t,...o}){return jsx(e.Overlay,{"data-slot":"dialog-overlay",className:n("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 isolate z-50","bg-black/80",t),...o})}a(w,"DialogOverlay");function I({className:t,children:o,showCloseButton:r=true,...s}){return jsxs(k,{children:[jsx(w,{}),jsxs(e.Content,{"data-slot":"dialog-content",className:n("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200",t),...s,children:[o,r&&jsx(e.Close,{"data-slot":"dialog-close",asChild:true,children:jsxs(l,{variant:"ghost",size:"icon-sm",className:"absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none",children:[jsx(X$1,{className:"size-4"}),jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}a(I,"DialogContent");function j({className:t,...o}){return jsx("div",{"data-slot":"dialog-header",className:n("flex flex-col gap-1.5 text-center sm:text-left",t),...o})}a(j,"DialogHeader");function q({className:t,showCloseButton:o=false,children:r,...s}){return jsxs("div",{"data-slot":"dialog-footer",className:n("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...s,children:[r,o&&jsx(e.Close,{asChild:true,children:jsx(l,{variant:"outline",children:"Close"})})]})}a(q,"DialogFooter");function J({className:t,...o}){return jsx(e.Title,{"data-slot":"dialog-title",className:n("text-lg leading-none font-semibold tracking-tight",t),...o})}a(J,"DialogTitle");function K({className:t,...o}){return jsx(e.Description,{"data-slot":"dialog-description",className:n("text-muted-foreground text-sm",t),...o})}a(K,"DialogDescription");export{X as Dialog,G as DialogClose,I as DialogContent,K as DialogDescription,q as DialogFooter,j as DialogHeader,w as DialogOverlay,k as DialogPortal,J as DialogTitle,$ as DialogTrigger};
|
package/dist/dock/basic.js
CHANGED
|
@@ -1,174 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var framerMotion = require('framer-motion');
|
|
6
|
-
var clsx = require('clsx');
|
|
7
|
-
var tailwindMerge = require('tailwind-merge');
|
|
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
|
-
function cn(...inputs) {
|
|
33
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
34
|
-
}
|
|
35
|
-
__name(cn, "cn");
|
|
36
|
-
var DockContext = React__namespace.createContext({
|
|
37
|
-
magnification: 60,
|
|
38
|
-
distance: 140
|
|
39
|
-
});
|
|
40
|
-
var Dock = React__namespace.forwardRef(
|
|
41
|
-
({
|
|
42
|
-
className,
|
|
43
|
-
children,
|
|
44
|
-
position = "bottom",
|
|
45
|
-
magnification = 60,
|
|
46
|
-
distance = 140
|
|
47
|
-
}, ref) => {
|
|
48
|
-
const positionClasses = {
|
|
49
|
-
bottom: "bottom-0 left-1/2 -translate-x-1/2 flex-row",
|
|
50
|
-
left: "left-0 top-1/2 -translate-y-1/2 flex-col",
|
|
51
|
-
right: "right-0 top-1/2 -translate-y-1/2 flex-col"
|
|
52
|
-
};
|
|
53
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DockContext.Provider, { value: { magnification, distance }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
54
|
-
"div",
|
|
55
|
-
{
|
|
56
|
-
ref,
|
|
57
|
-
className: cn(
|
|
58
|
-
"fixed z-50 flex items-end gap-1 rounded-2xl border border-white/10 bg-black/10 p-2 backdrop-blur-xl",
|
|
59
|
-
"shadow-2xl shadow-black/20",
|
|
60
|
-
"before:absolute before:inset-0 before:rounded-2xl before:bg-gradient-to-b before:from-white/10 before:to-transparent before:opacity-50",
|
|
61
|
-
positionClasses[position],
|
|
62
|
-
className
|
|
63
|
-
),
|
|
64
|
-
children
|
|
65
|
-
}
|
|
66
|
-
) });
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
Dock.displayName = "Dock";
|
|
70
|
-
var DockItem = React__namespace.forwardRef(
|
|
71
|
-
({
|
|
72
|
-
className,
|
|
73
|
-
children,
|
|
74
|
-
onClick,
|
|
75
|
-
tooltip,
|
|
76
|
-
magnification: itemMagnification,
|
|
77
|
-
distance: itemDistance
|
|
78
|
-
}, ref) => {
|
|
79
|
-
const buttonRef = React__namespace.useRef(null);
|
|
80
|
-
const { magnification: contextMagnification, distance: contextDistance } = React__namespace.useContext(DockContext);
|
|
81
|
-
const magnification = itemMagnification ?? contextMagnification;
|
|
82
|
-
const distance = itemDistance ?? contextDistance;
|
|
83
|
-
const [isHovered, setIsHovered] = React__namespace.useState(false);
|
|
84
|
-
const mouseX = framerMotion.useMotionValue(Infinity);
|
|
85
|
-
const springConfig = { mass: 0.1, stiffness: 150, damping: 12 };
|
|
86
|
-
const size = framerMotion.useSpring(
|
|
87
|
-
framerMotion.useTransform(
|
|
88
|
-
mouseX,
|
|
89
|
-
[-distance, 0, distance],
|
|
90
|
-
[48, 48 + magnification, 48]
|
|
91
|
-
),
|
|
92
|
-
springConfig
|
|
93
|
-
);
|
|
94
|
-
const handleMouseMove = /* @__PURE__ */ __name((e) => {
|
|
95
|
-
if (!buttonRef.current) return;
|
|
96
|
-
const rect = buttonRef.current.getBoundingClientRect();
|
|
97
|
-
const centerX = rect.left + rect.width / 2;
|
|
98
|
-
mouseX.set(e.clientX - centerX);
|
|
99
|
-
}, "handleMouseMove");
|
|
100
|
-
const handleMouseLeave = /* @__PURE__ */ __name(() => {
|
|
101
|
-
mouseX.set(Infinity);
|
|
102
|
-
setIsHovered(false);
|
|
103
|
-
}, "handleMouseLeave");
|
|
104
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
105
|
-
framerMotion.motion.div,
|
|
106
|
-
{
|
|
107
|
-
className: "relative",
|
|
108
|
-
onMouseMove: handleMouseMove,
|
|
109
|
-
onMouseLeave: handleMouseLeave,
|
|
110
|
-
onMouseEnter: () => setIsHovered(true),
|
|
111
|
-
children: [
|
|
112
|
-
tooltip && isHovered && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
113
|
-
framerMotion.motion.div,
|
|
114
|
-
{
|
|
115
|
-
initial: { opacity: 0, y: 10, scale: 0.9 },
|
|
116
|
-
animate: { opacity: 1, y: 0, scale: 1 },
|
|
117
|
-
exit: { opacity: 0, y: 5, scale: 0.95 },
|
|
118
|
-
transition: { duration: 0.15 },
|
|
119
|
-
className: "absolute bottom-full left-1/2 mb-2 -translate-x-1/2 whitespace-nowrap rounded-lg bg-black/80 px-2 py-1 text-xs text-white backdrop-blur-md",
|
|
120
|
-
children: [
|
|
121
|
-
tooltip,
|
|
122
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute -bottom-1 left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 bg-black/80" })
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
),
|
|
126
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
127
|
-
framerMotion.motion.button,
|
|
128
|
-
{
|
|
129
|
-
ref: buttonRef,
|
|
130
|
-
style: {
|
|
131
|
-
width: size,
|
|
132
|
-
height: size
|
|
133
|
-
},
|
|
134
|
-
whileTap: { scale: 0.9 },
|
|
135
|
-
onClick,
|
|
136
|
-
className: cn(
|
|
137
|
-
"relative flex items-center justify-center rounded-xl bg-white/10 backdrop-blur-md transition-colors",
|
|
138
|
-
"hover:bg-white/20",
|
|
139
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",
|
|
140
|
-
className
|
|
141
|
-
),
|
|
142
|
-
children: [
|
|
143
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
144
|
-
framerMotion.motion.div,
|
|
145
|
-
{
|
|
146
|
-
style: {
|
|
147
|
-
width: size,
|
|
148
|
-
height: size
|
|
149
|
-
},
|
|
150
|
-
className: "flex items-center justify-center",
|
|
151
|
-
children
|
|
152
|
-
}
|
|
153
|
-
),
|
|
154
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
155
|
-
framerMotion.motion.div,
|
|
156
|
-
{
|
|
157
|
-
className: "absolute inset-0 rounded-xl",
|
|
158
|
-
style: {
|
|
159
|
-
background: "linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%)"
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
)
|
|
163
|
-
]
|
|
164
|
-
}
|
|
165
|
-
)
|
|
166
|
-
]
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
);
|
|
171
|
-
DockItem.displayName = "DockItem";
|
|
172
|
-
|
|
173
|
-
exports.Dock = Dock;
|
|
174
|
-
exports.DockItem = DockItem;
|
|
2
|
+
'use strict';var e=require('react'),framerMotion=require('framer-motion'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);var I=Object.defineProperty;var n=(t,o)=>I(t,"name",{value:o,configurable:true});function f(...t){return tailwindMerge.twMerge(clsx.clsx(t))}n(f,"cn");var h=e__namespace.createContext({magnification:60,distance:140}),S=e__namespace.forwardRef(({className:t,children:o,position:c="bottom",magnification:r=60,distance:l=140},m)=>{let g={bottom:"bottom-0 left-1/2 -translate-x-1/2 flex-row",left:"left-0 top-1/2 -translate-y-1/2 flex-col",right:"right-0 top-1/2 -translate-y-1/2 flex-col"};return jsxRuntime.jsx(h.Provider,{value:{magnification:r,distance:l},children:jsxRuntime.jsx("div",{ref:m,className:f("fixed z-50 flex items-end gap-1 rounded-2xl border border-white/10 bg-black/10 p-2 backdrop-blur-xl","shadow-2xl shadow-black/20","before:absolute before:inset-0 before:rounded-2xl before:bg-gradient-to-b before:from-white/10 before:to-transparent before:opacity-50",g[c],t),children:o})})});S.displayName="Dock";var U=e__namespace.forwardRef(({className:t,children:o,onClick:c,tooltip:r,magnification:l,distance:m},g)=>{let u=e__namespace.useRef(null),{magnification:y,distance:k}=e__namespace.useContext(h),w=l??y,p=m??k,[R,x]=e__namespace.useState(false),d=framerMotion.useMotionValue(1/0),D={mass:.1,stiffness:150,damping:12},s=framerMotion.useSpring(framerMotion.useTransform(d,[-p,0,p],[48,48+w,48]),D),M=n(C=>{if(!u.current)return;let v=u.current.getBoundingClientRect(),P=v.left+v.width/2;d.set(C.clientX-P);},"handleMouseMove"),N=n(()=>{d.set(1/0),x(false);},"handleMouseLeave");return jsxRuntime.jsxs(framerMotion.motion.div,{className:"relative",onMouseMove:M,onMouseLeave:N,onMouseEnter:()=>x(true),children:[r&&R&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:10,scale:.9},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:5,scale:.95},transition:{duration:.15},className:"absolute bottom-full left-1/2 mb-2 -translate-x-1/2 whitespace-nowrap rounded-lg bg-black/80 px-2 py-1 text-xs text-white backdrop-blur-md",children:[r,jsxRuntime.jsx("div",{className:"absolute -bottom-1 left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 bg-black/80"})]}),jsxRuntime.jsxs(framerMotion.motion.button,{ref:u,style:{width:s,height:s},whileTap:{scale:.9},onClick:c,className:f("relative flex items-center justify-center rounded-xl bg-white/10 backdrop-blur-md transition-colors","hover:bg-white/20","focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",t),children:[jsxRuntime.jsx(framerMotion.motion.div,{style:{width:s,height:s},className:"flex items-center justify-center",children:o}),jsxRuntime.jsx(framerMotion.motion.div,{className:"absolute inset-0 rounded-xl",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%)"}})]})]})});U.displayName="DockItem";exports.Dock=S;exports.DockItem=U;
|