@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/dock/macos.js
CHANGED
|
@@ -1,141 +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
|
-
mouseX: null
|
|
40
|
-
});
|
|
41
|
-
var Dock = React__namespace.forwardRef(
|
|
42
|
-
({ className, children, magnification = 60, distance = 140 }, ref) => {
|
|
43
|
-
const mouseX = framerMotion.useMotionValue(Infinity);
|
|
44
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DockContext.Provider, { value: { magnification, distance, mouseX }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
45
|
-
framerMotion.motion.div,
|
|
46
|
-
{
|
|
47
|
-
ref,
|
|
48
|
-
onMouseMove: (e) => mouseX.set(e.pageX),
|
|
49
|
-
onMouseLeave: () => mouseX.set(Infinity),
|
|
50
|
-
className: cn(
|
|
51
|
-
"mx-auto flex h-16 items-end gap-2 rounded-2xl border border-white/10 bg-black/10 px-3 pb-2 backdrop-blur-xl",
|
|
52
|
-
"shadow-2xl shadow-black/20",
|
|
53
|
-
"before:absolute before:inset-0 before:rounded-2xl before:bg-gradient-to-b before:from-white/10 before:to-transparent before:opacity-50",
|
|
54
|
-
className
|
|
55
|
-
),
|
|
56
|
-
children
|
|
57
|
-
}
|
|
58
|
-
) });
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
Dock.displayName = "Dock";
|
|
62
|
-
var DockItem = React__namespace.forwardRef(
|
|
63
|
-
({ className, children, onClick, tooltip }, ref) => {
|
|
64
|
-
const buttonRef = React__namespace.useRef(null);
|
|
65
|
-
const { magnification, distance, mouseX } = React__namespace.useContext(DockContext);
|
|
66
|
-
const [isHovered, setIsHovered] = React__namespace.useState(false);
|
|
67
|
-
const distanceCalc = framerMotion.useTransform(mouseX, (val) => {
|
|
68
|
-
const bounds = buttonRef.current?.getBoundingClientRect() ?? {
|
|
69
|
-
x: 0,
|
|
70
|
-
width: 0
|
|
71
|
-
};
|
|
72
|
-
return val - bounds.x - bounds.width / 2;
|
|
73
|
-
});
|
|
74
|
-
const widthSync = framerMotion.useTransform(
|
|
75
|
-
distanceCalc,
|
|
76
|
-
[-distance, 0, distance],
|
|
77
|
-
[48, 48 + magnification, 48]
|
|
78
|
-
);
|
|
79
|
-
const width = framerMotion.useSpring(widthSync, {
|
|
80
|
-
mass: 0.1,
|
|
81
|
-
stiffness: 150,
|
|
82
|
-
damping: 12
|
|
83
|
-
});
|
|
84
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
85
|
-
framerMotion.motion.div,
|
|
86
|
-
{
|
|
87
|
-
className: "relative",
|
|
88
|
-
onMouseEnter: () => setIsHovered(true),
|
|
89
|
-
onMouseLeave: () => setIsHovered(false),
|
|
90
|
-
children: [
|
|
91
|
-
tooltip && isHovered && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
92
|
-
framerMotion.motion.div,
|
|
93
|
-
{
|
|
94
|
-
initial: { opacity: 0, y: 10, scale: 0.9 },
|
|
95
|
-
animate: { opacity: 1, y: 0, scale: 1 },
|
|
96
|
-
exit: { opacity: 0, y: 5, scale: 0.95 },
|
|
97
|
-
transition: { duration: 0.15 },
|
|
98
|
-
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",
|
|
99
|
-
children: [
|
|
100
|
-
tooltip,
|
|
101
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute -bottom-1 left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 bg-black/80" })
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
|
-
),
|
|
105
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
106
|
-
framerMotion.motion.button,
|
|
107
|
-
{
|
|
108
|
-
ref: buttonRef,
|
|
109
|
-
style: { width },
|
|
110
|
-
whileTap: { scale: 0.95 },
|
|
111
|
-
onClick,
|
|
112
|
-
className: cn(
|
|
113
|
-
"aspect-square w-12 rounded-xl bg-white/10 backdrop-blur-md transition-colors",
|
|
114
|
-
"hover:bg-white/20",
|
|
115
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",
|
|
116
|
-
"relative overflow-hidden",
|
|
117
|
-
className
|
|
118
|
-
),
|
|
119
|
-
children: [
|
|
120
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full items-center justify-center", children }),
|
|
121
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
122
|
-
"div",
|
|
123
|
-
{
|
|
124
|
-
className: "pointer-events-none absolute inset-0 rounded-xl",
|
|
125
|
-
style: {
|
|
126
|
-
background: "linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%)"
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
)
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
DockItem.displayName = "DockItem";
|
|
139
|
-
|
|
140
|
-
exports.Dock = Dock;
|
|
141
|
-
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 D=Object.defineProperty;var p=(t,n)=>D(t,"name",{value:n,configurable:true});function l(...t){return tailwindMerge.twMerge(clsx.clsx(t))}p(l,"cn");var v=e__namespace.createContext({magnification:60,distance:140,mouseX:null}),I=e__namespace.forwardRef(({className:t,children:n,magnification:s=60,distance:r=140},d)=>{let o=framerMotion.useMotionValue(1/0);return jsxRuntime.jsx(v.Provider,{value:{magnification:s,distance:r,mouseX:o},children:jsxRuntime.jsx(framerMotion.motion.div,{ref:d,onMouseMove:c=>o.set(c.pageX),onMouseLeave:()=>o.set(1/0),className:l("mx-auto flex h-16 items-end gap-2 rounded-2xl border border-white/10 bg-black/10 px-3 pb-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",t),children:n})})});I.displayName="Dock";var L=e__namespace.forwardRef(({className:t,children:n,onClick:s,tooltip:r},d)=>{let o=e__namespace.useRef(null),{magnification:c,distance:m,mouseX:x}=e__namespace.useContext(v),[w,f]=e__namespace.useState(false),h=framerMotion.useTransform(x,R=>{let b=o.current?.getBoundingClientRect()??{x:0,width:0};return R-b.x-b.width/2}),k=framerMotion.useTransform(h,[-m,0,m],[48,48+c,48]),y=framerMotion.useSpring(k,{mass:.1,stiffness:150,damping:12});return jsxRuntime.jsxs(framerMotion.motion.div,{className:"relative",onMouseEnter:()=>f(true),onMouseLeave:()=>f(false),children:[r&&w&&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:o,style:{width:y},whileTap:{scale:.95},onClick:s,className:l("aspect-square w-12 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","relative overflow-hidden",t),children:[jsxRuntime.jsx("div",{className:"flex h-full w-full items-center justify-center",children:n}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-xl",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%)"}})]})]})});L.displayName="DockItem";exports.Dock=I;exports.DockItem=L;
|
package/dist/dock/macos.mjs
CHANGED
|
@@ -1,118 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import { useMotionValue, motion, useTransform, useSpring } from 'framer-motion';
|
|
4
|
-
import { clsx } from 'clsx';
|
|
5
|
-
import { twMerge } from 'tailwind-merge';
|
|
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
|
-
function cn(...inputs) {
|
|
11
|
-
return twMerge(clsx(inputs));
|
|
12
|
-
}
|
|
13
|
-
__name(cn, "cn");
|
|
14
|
-
var DockContext = React.createContext({
|
|
15
|
-
magnification: 60,
|
|
16
|
-
distance: 140,
|
|
17
|
-
mouseX: null
|
|
18
|
-
});
|
|
19
|
-
var Dock = React.forwardRef(
|
|
20
|
-
({ className, children, magnification = 60, distance = 140 }, ref) => {
|
|
21
|
-
const mouseX = useMotionValue(Infinity);
|
|
22
|
-
return /* @__PURE__ */ jsx(DockContext.Provider, { value: { magnification, distance, mouseX }, children: /* @__PURE__ */ jsx(
|
|
23
|
-
motion.div,
|
|
24
|
-
{
|
|
25
|
-
ref,
|
|
26
|
-
onMouseMove: (e) => mouseX.set(e.pageX),
|
|
27
|
-
onMouseLeave: () => mouseX.set(Infinity),
|
|
28
|
-
className: cn(
|
|
29
|
-
"mx-auto flex h-16 items-end gap-2 rounded-2xl border border-white/10 bg-black/10 px-3 pb-2 backdrop-blur-xl",
|
|
30
|
-
"shadow-2xl shadow-black/20",
|
|
31
|
-
"before:absolute before:inset-0 before:rounded-2xl before:bg-gradient-to-b before:from-white/10 before:to-transparent before:opacity-50",
|
|
32
|
-
className
|
|
33
|
-
),
|
|
34
|
-
children
|
|
35
|
-
}
|
|
36
|
-
) });
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
Dock.displayName = "Dock";
|
|
40
|
-
var DockItem = React.forwardRef(
|
|
41
|
-
({ className, children, onClick, tooltip }, ref) => {
|
|
42
|
-
const buttonRef = React.useRef(null);
|
|
43
|
-
const { magnification, distance, mouseX } = React.useContext(DockContext);
|
|
44
|
-
const [isHovered, setIsHovered] = React.useState(false);
|
|
45
|
-
const distanceCalc = useTransform(mouseX, (val) => {
|
|
46
|
-
const bounds = buttonRef.current?.getBoundingClientRect() ?? {
|
|
47
|
-
x: 0,
|
|
48
|
-
width: 0
|
|
49
|
-
};
|
|
50
|
-
return val - bounds.x - bounds.width / 2;
|
|
51
|
-
});
|
|
52
|
-
const widthSync = useTransform(
|
|
53
|
-
distanceCalc,
|
|
54
|
-
[-distance, 0, distance],
|
|
55
|
-
[48, 48 + magnification, 48]
|
|
56
|
-
);
|
|
57
|
-
const width = useSpring(widthSync, {
|
|
58
|
-
mass: 0.1,
|
|
59
|
-
stiffness: 150,
|
|
60
|
-
damping: 12
|
|
61
|
-
});
|
|
62
|
-
return /* @__PURE__ */ jsxs(
|
|
63
|
-
motion.div,
|
|
64
|
-
{
|
|
65
|
-
className: "relative",
|
|
66
|
-
onMouseEnter: () => setIsHovered(true),
|
|
67
|
-
onMouseLeave: () => setIsHovered(false),
|
|
68
|
-
children: [
|
|
69
|
-
tooltip && isHovered && /* @__PURE__ */ jsxs(
|
|
70
|
-
motion.div,
|
|
71
|
-
{
|
|
72
|
-
initial: { opacity: 0, y: 10, scale: 0.9 },
|
|
73
|
-
animate: { opacity: 1, y: 0, scale: 1 },
|
|
74
|
-
exit: { opacity: 0, y: 5, scale: 0.95 },
|
|
75
|
-
transition: { duration: 0.15 },
|
|
76
|
-
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",
|
|
77
|
-
children: [
|
|
78
|
-
tooltip,
|
|
79
|
-
/* @__PURE__ */ jsx("div", { className: "absolute -bottom-1 left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 bg-black/80" })
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
),
|
|
83
|
-
/* @__PURE__ */ jsxs(
|
|
84
|
-
motion.button,
|
|
85
|
-
{
|
|
86
|
-
ref: buttonRef,
|
|
87
|
-
style: { width },
|
|
88
|
-
whileTap: { scale: 0.95 },
|
|
89
|
-
onClick,
|
|
90
|
-
className: cn(
|
|
91
|
-
"aspect-square w-12 rounded-xl bg-white/10 backdrop-blur-md transition-colors",
|
|
92
|
-
"hover:bg-white/20",
|
|
93
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",
|
|
94
|
-
"relative overflow-hidden",
|
|
95
|
-
className
|
|
96
|
-
),
|
|
97
|
-
children: [
|
|
98
|
-
/* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center", children }),
|
|
99
|
-
/* @__PURE__ */ jsx(
|
|
100
|
-
"div",
|
|
101
|
-
{
|
|
102
|
-
className: "pointer-events-none absolute inset-0 rounded-xl",
|
|
103
|
-
style: {
|
|
104
|
-
background: "linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%)"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
)
|
|
108
|
-
]
|
|
109
|
-
}
|
|
110
|
-
)
|
|
111
|
-
]
|
|
112
|
-
}
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
DockItem.displayName = "DockItem";
|
|
117
|
-
|
|
118
|
-
export { Dock, DockItem };
|
|
2
|
+
import*as e from'react';import {useMotionValue,motion,useTransform,useSpring}from'framer-motion';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs}from'react/jsx-runtime';var D=Object.defineProperty;var p=(t,n)=>D(t,"name",{value:n,configurable:true});function l(...t){return twMerge(clsx(t))}p(l,"cn");var v=e.createContext({magnification:60,distance:140,mouseX:null}),I=e.forwardRef(({className:t,children:n,magnification:s=60,distance:r=140},d)=>{let o=useMotionValue(1/0);return jsx(v.Provider,{value:{magnification:s,distance:r,mouseX:o},children:jsx(motion.div,{ref:d,onMouseMove:c=>o.set(c.pageX),onMouseLeave:()=>o.set(1/0),className:l("mx-auto flex h-16 items-end gap-2 rounded-2xl border border-white/10 bg-black/10 px-3 pb-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",t),children:n})})});I.displayName="Dock";var L=e.forwardRef(({className:t,children:n,onClick:s,tooltip:r},d)=>{let o=e.useRef(null),{magnification:c,distance:m,mouseX:x}=e.useContext(v),[w,f]=e.useState(false),h=useTransform(x,R=>{let b=o.current?.getBoundingClientRect()??{x:0,width:0};return R-b.x-b.width/2}),k=useTransform(h,[-m,0,m],[48,48+c,48]),y=useSpring(k,{mass:.1,stiffness:150,damping:12});return jsxs(motion.div,{className:"relative",onMouseEnter:()=>f(true),onMouseLeave:()=>f(false),children:[r&&w&&jsxs(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,jsx("div",{className:"absolute -bottom-1 left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 bg-black/80"})]}),jsxs(motion.button,{ref:o,style:{width:y},whileTap:{scale:.95},onClick:s,className:l("aspect-square w-12 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","relative overflow-hidden",t),children:[jsx("div",{className:"flex h-full w-full items-center justify-center",children:n}),jsx("div",{className:"pointer-events-none absolute inset-0 rounded-xl",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%)"}})]})]})});L.displayName="DockItem";export{I as Dock,L as DockItem};
|
package/dist/dock/menu.js
CHANGED
|
@@ -1,70 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var clsx = require('clsx');
|
|
6
|
-
var tailwindMerge = require('tailwind-merge');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
|
|
9
|
-
function _interopNamespace(e) {
|
|
10
|
-
if (e && e.__esModule) return e;
|
|
11
|
-
var n = Object.create(null);
|
|
12
|
-
if (e) {
|
|
13
|
-
Object.keys(e).forEach(function (k) {
|
|
14
|
-
if (k !== 'default') {
|
|
15
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return e[k]; }
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
n.default = e;
|
|
24
|
-
return Object.freeze(n);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
|
-
|
|
29
|
-
var __defProp = Object.defineProperty;
|
|
30
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
31
|
-
function cn(...inputs) {
|
|
32
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
33
|
-
}
|
|
34
|
-
__name(cn, "cn");
|
|
35
|
-
var MenuDock = React__namespace.forwardRef(
|
|
36
|
-
({ className, items, orientation = "horizontal", ...props }, ref) => {
|
|
37
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
-
"div",
|
|
39
|
-
{
|
|
40
|
-
ref,
|
|
41
|
-
className: cn(
|
|
42
|
-
"flex gap-2 rounded-full border bg-background/95 p-2 shadow-lg backdrop-blur",
|
|
43
|
-
orientation === "vertical" ? "flex-col" : "flex-row",
|
|
44
|
-
className
|
|
45
|
-
),
|
|
46
|
-
...props,
|
|
47
|
-
children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
48
|
-
"button",
|
|
49
|
-
{
|
|
50
|
-
onClick: item.onClick,
|
|
51
|
-
className: cn(
|
|
52
|
-
"group relative flex items-center justify-center rounded-full p-3 transition-colors hover:bg-accent",
|
|
53
|
-
item.active && "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
54
|
-
),
|
|
55
|
-
title: item.label,
|
|
56
|
-
children: [
|
|
57
|
-
item.icon,
|
|
58
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: item.label }),
|
|
59
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -top-8 left-1/2 -translate-x-1/2 whitespace-nowrap rounded bg-popover px-2 py-1 text-xs text-popover-foreground opacity-0 transition-opacity group-hover:opacity-100", children: item.label })
|
|
60
|
-
]
|
|
61
|
-
},
|
|
62
|
-
index
|
|
63
|
-
))
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
MenuDock.displayName = "MenuDock";
|
|
69
|
-
|
|
70
|
-
exports.MenuDock = MenuDock;
|
|
2
|
+
'use strict';var l=require('react'),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 l__namespace=/*#__PURE__*/_interopNamespace(l);var u=Object.defineProperty;var a=(o,t)=>u(o,"name",{value:t,configurable:true});function r(...o){return tailwindMerge.twMerge(clsx.clsx(o))}a(r,"cn");var m=l__namespace.forwardRef(({className:o,items:t,orientation:c="horizontal",...i},s)=>jsxRuntime.jsx("div",{ref:s,className:r("flex gap-2 rounded-full border bg-background/95 p-2 shadow-lg backdrop-blur",c==="vertical"?"flex-col":"flex-row",o),...i,children:t.map((e,p)=>jsxRuntime.jsxs("button",{onClick:e.onClick,className:r("group relative flex items-center justify-center rounded-full p-3 transition-colors hover:bg-accent",e.active&&"bg-primary text-primary-foreground hover:bg-primary/90"),title:e.label,children:[e.icon,jsxRuntime.jsx("span",{className:"sr-only",children:e.label}),jsxRuntime.jsx("span",{className:"absolute -top-8 left-1/2 -translate-x-1/2 whitespace-nowrap rounded bg-popover px-2 py-1 text-xs text-popover-foreground opacity-0 transition-opacity group-hover:opacity-100",children:e.label})]},p))}));m.displayName="MenuDock";exports.MenuDock=m;
|
package/dist/dock/menu.mjs
CHANGED
|
@@ -1,48 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
function cn(...inputs) {
|
|
10
|
-
return twMerge(clsx(inputs));
|
|
11
|
-
}
|
|
12
|
-
__name(cn, "cn");
|
|
13
|
-
var MenuDock = React.forwardRef(
|
|
14
|
-
({ className, items, orientation = "horizontal", ...props }, ref) => {
|
|
15
|
-
return /* @__PURE__ */ jsx(
|
|
16
|
-
"div",
|
|
17
|
-
{
|
|
18
|
-
ref,
|
|
19
|
-
className: cn(
|
|
20
|
-
"flex gap-2 rounded-full border bg-background/95 p-2 shadow-lg backdrop-blur",
|
|
21
|
-
orientation === "vertical" ? "flex-col" : "flex-row",
|
|
22
|
-
className
|
|
23
|
-
),
|
|
24
|
-
...props,
|
|
25
|
-
children: items.map((item, index) => /* @__PURE__ */ jsxs(
|
|
26
|
-
"button",
|
|
27
|
-
{
|
|
28
|
-
onClick: item.onClick,
|
|
29
|
-
className: cn(
|
|
30
|
-
"group relative flex items-center justify-center rounded-full p-3 transition-colors hover:bg-accent",
|
|
31
|
-
item.active && "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
32
|
-
),
|
|
33
|
-
title: item.label,
|
|
34
|
-
children: [
|
|
35
|
-
item.icon,
|
|
36
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: item.label }),
|
|
37
|
-
/* @__PURE__ */ jsx("span", { className: "absolute -top-8 left-1/2 -translate-x-1/2 whitespace-nowrap rounded bg-popover px-2 py-1 text-xs text-popover-foreground opacity-0 transition-opacity group-hover:opacity-100", children: item.label })
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
index
|
|
41
|
-
))
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
MenuDock.displayName = "MenuDock";
|
|
47
|
-
|
|
48
|
-
export { MenuDock };
|
|
2
|
+
import*as l from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs}from'react/jsx-runtime';var u=Object.defineProperty;var a=(o,t)=>u(o,"name",{value:t,configurable:true});function r(...o){return twMerge(clsx(o))}a(r,"cn");var m=l.forwardRef(({className:o,items:t,orientation:c="horizontal",...i},s)=>jsx("div",{ref:s,className:r("flex gap-2 rounded-full border bg-background/95 p-2 shadow-lg backdrop-blur",c==="vertical"?"flex-col":"flex-row",o),...i,children:t.map((e,p)=>jsxs("button",{onClick:e.onClick,className:r("group relative flex items-center justify-center rounded-full p-3 transition-colors hover:bg-accent",e.active&&"bg-primary text-primary-foreground hover:bg-primary/90"),title:e.label,children:[e.icon,jsx("span",{className:"sr-only",children:e.label}),jsx("span",{className:"absolute -top-8 left-1/2 -translate-x-1/2 whitespace-nowrap rounded bg-popover px-2 py-1 text-xs text-popover-foreground opacity-0 transition-opacity group-hover:opacity-100",children:e.label})]},p))}));m.displayName="MenuDock";export{m as MenuDock};
|
package/dist/dock/message.js
CHANGED
|
@@ -1,149 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var React = require('react');
|
|
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 jsxRuntime = require('react/jsx-runtime');
|
|
11
|
-
|
|
12
|
-
function _interopNamespace(e) {
|
|
13
|
-
if (e && e.__esModule) return e;
|
|
14
|
-
var n = Object.create(null);
|
|
15
|
-
if (e) {
|
|
16
|
-
Object.keys(e).forEach(function (k) {
|
|
17
|
-
if (k !== 'default') {
|
|
18
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () { return e[k]; }
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
n.default = e;
|
|
27
|
-
return Object.freeze(n);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
31
|
-
|
|
32
|
-
var __defProp = Object.defineProperty;
|
|
33
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
34
|
-
function cn(...inputs) {
|
|
35
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
36
|
-
}
|
|
37
|
-
__name(cn, "cn");
|
|
38
|
-
var buttonVariants = classVarianceAuthority.cva(
|
|
39
|
-
'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',
|
|
40
|
-
{
|
|
41
|
-
variants: {
|
|
42
|
-
variant: {
|
|
43
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
44
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
45
|
-
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",
|
|
46
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
47
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
48
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
49
|
-
// Keep the additional Hanzo variants for backward compatibility
|
|
50
|
-
primary: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
51
|
-
linkFG: "text-primary underline-offset-4 hover:underline",
|
|
52
|
-
linkMuted: "text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"
|
|
53
|
-
},
|
|
54
|
-
size: {
|
|
55
|
-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
56
|
-
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
57
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
58
|
-
icon: "size-9",
|
|
59
|
-
"icon-sm": "size-8",
|
|
60
|
-
"icon-lg": "size-10"
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
defaultVariants: {
|
|
64
|
-
variant: "default",
|
|
65
|
-
size: "default"
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
var Button = React__namespace.forwardRef(
|
|
70
|
-
({ className, variant = "default", size = "default", asChild = false, isLoading = false, children, ...props }, ref) => {
|
|
71
|
-
const Comp = asChild ? reactSlot.Slot : "button";
|
|
72
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
73
|
-
Comp,
|
|
74
|
-
{
|
|
75
|
-
"data-slot": "button",
|
|
76
|
-
"data-variant": variant,
|
|
77
|
-
"data-size": size,
|
|
78
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
79
|
-
ref,
|
|
80
|
-
...props,
|
|
81
|
-
children: [
|
|
82
|
-
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
83
|
-
lucideReact.Loader2,
|
|
84
|
-
{
|
|
85
|
-
className: cn("h-4 w-4 animate-spin", size !== "icon" && size !== "icon-sm" && size !== "icon-lg" && "mr-2")
|
|
86
|
-
}
|
|
87
|
-
) : null,
|
|
88
|
-
isLoading && (size === "icon" || size === "icon-sm" || size === "icon-lg") ? null : children
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
Button.displayName = "Button";
|
|
95
|
-
var MessageDock = React__namespace.forwardRef(
|
|
96
|
-
({ className, messages, onClose, position = "bottom-right", ...props }, ref) => {
|
|
97
|
-
const positionClasses = {
|
|
98
|
-
top: "top-4 left-1/2 -translate-x-1/2",
|
|
99
|
-
bottom: "bottom-4 left-1/2 -translate-x-1/2",
|
|
100
|
-
"top-right": "top-4 right-4",
|
|
101
|
-
"bottom-right": "bottom-4 right-4"
|
|
102
|
-
};
|
|
103
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
104
|
-
"div",
|
|
105
|
-
{
|
|
106
|
-
ref,
|
|
107
|
-
className: cn(
|
|
108
|
-
"fixed z-50 flex flex-col gap-2",
|
|
109
|
-
positionClasses[position],
|
|
110
|
-
className
|
|
111
|
-
),
|
|
112
|
-
...props,
|
|
113
|
-
children: messages.map((message) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
114
|
-
"div",
|
|
115
|
-
{
|
|
116
|
-
className: cn(
|
|
117
|
-
"min-w-[300px] rounded-lg border p-4 shadow-lg",
|
|
118
|
-
message.type === "success" && "border-green-500 bg-green-50 dark:bg-green-950",
|
|
119
|
-
message.type === "warning" && "border-yellow-500 bg-yellow-50 dark:bg-yellow-950",
|
|
120
|
-
message.type === "error" && "border-red-500 bg-red-50 dark:bg-red-950",
|
|
121
|
-
message.type === "info" && "border-blue-500 bg-blue-50 dark:bg-blue-950",
|
|
122
|
-
!message.type && "bg-background"
|
|
123
|
-
),
|
|
124
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
125
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
126
|
-
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium", children: message.title }),
|
|
127
|
-
message.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: message.description })
|
|
128
|
-
] }),
|
|
129
|
-
onClose && /* @__PURE__ */ jsxRuntime.jsx(
|
|
130
|
-
Button,
|
|
131
|
-
{
|
|
132
|
-
variant: "ghost",
|
|
133
|
-
size: "icon",
|
|
134
|
-
className: "h-6 w-6",
|
|
135
|
-
onClick: () => onClose(message.id),
|
|
136
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
137
|
-
}
|
|
138
|
-
)
|
|
139
|
-
] })
|
|
140
|
-
},
|
|
141
|
-
message.id
|
|
142
|
-
))
|
|
143
|
-
}
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
);
|
|
147
|
-
MessageDock.displayName = "MessageDock";
|
|
148
|
-
|
|
149
|
-
exports.MessageDock = MessageDock;
|
|
2
|
+
'use strict';var p=require('react'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),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 p__namespace=/*#__PURE__*/_interopNamespace(p);var f=Object.defineProperty;var u=(r,o)=>f(r,"name",{value:o,configurable:true});function n(...r){return tailwindMerge.twMerge(clsx.clsx(r))}u(n,"cn");var k=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=p__namespace.forwardRef(({className:r,variant:o="default",size:t="default",asChild:s=false,isLoading:a=false,children:d,...c},e)=>jsxRuntime.jsxs(s?reactSlot.Slot:"button",{"data-slot":"button","data-variant":o,"data-size":t,className:n(k({variant:o,size:t,className:r})),ref:e,...c,children:[a?jsxRuntime.jsx(lucideReact.Loader2,{className:n("h-4 w-4 animate-spin",t!=="icon"&&t!=="icon-sm"&&t!=="icon-lg"&&"mr-2")}):null,a&&(t==="icon"||t==="icon-sm"||t==="icon-lg")?null:d]}));l.displayName="Button";var B=p__namespace.forwardRef(({className:r,messages:o,onClose:t,position:s="bottom-right",...a},d)=>jsxRuntime.jsx("div",{ref:d,className:n("fixed z-50 flex flex-col gap-2",{top:"top-4 left-1/2 -translate-x-1/2",bottom:"bottom-4 left-1/2 -translate-x-1/2","top-right":"top-4 right-4","bottom-right":"bottom-4 right-4"}[s],r),...a,children:o.map(e=>jsxRuntime.jsx("div",{className:n("min-w-[300px] rounded-lg border p-4 shadow-lg",e.type==="success"&&"border-green-500 bg-green-50 dark:bg-green-950",e.type==="warning"&&"border-yellow-500 bg-yellow-50 dark:bg-yellow-950",e.type==="error"&&"border-red-500 bg-red-50 dark:bg-red-950",e.type==="info"&&"border-blue-500 bg-blue-50 dark:bg-blue-950",!e.type&&"bg-background"),children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h4",{className:"font-medium",children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e.description})]}),t&&jsxRuntime.jsx(l,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>t(e.id),children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})},e.id))}));B.displayName="MessageDock";exports.MessageDock=B;
|