@hanzo/ui 5.3.19 → 5.3.22

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.
Files changed (229) hide show
  1. package/dist/3d/button.js +298 -1
  2. package/dist/3d/button.mjs +273 -1
  3. package/dist/3d/card.js +234 -1
  4. package/dist/3d/card.mjs +207 -1
  5. package/dist/3d/carousel.js +371 -1
  6. package/dist/3d/carousel.mjs +344 -1
  7. package/dist/3d/grid.js +362 -1
  8. package/dist/3d/grid.mjs +337 -1
  9. package/dist/3d/index.js +1518 -1
  10. package/dist/3d/index.mjs +1472 -1
  11. package/dist/3d/marquee.js +352 -1
  12. package/dist/3d/marquee.mjs +327 -1
  13. package/dist/3d/pin.js +46 -1
  14. package/dist/3d/pin.mjs +24 -1
  15. package/dist/accordion.js +80 -1
  16. package/dist/accordion.mjs +55 -1
  17. package/dist/alert-dialog.js +220 -1
  18. package/dist/alert-dialog.mjs +187 -1
  19. package/dist/alert.js +68 -1
  20. package/dist/alert.mjs +64 -1
  21. package/dist/animation/animated-background.js +424 -1
  22. package/dist/animation/animated-background.mjs +418 -1
  23. package/dist/animation/animated-beam.js +119 -1
  24. package/dist/animation/animated-beam.mjs +97 -1
  25. package/dist/animation/animated-cursor.js +275 -1
  26. package/dist/animation/animated-cursor.mjs +270 -1
  27. package/dist/animation/animated-icon.js +357 -2
  28. package/dist/animation/animated-icon.mjs +351 -2
  29. package/dist/animation/animated-list.js +339 -1
  30. package/dist/animation/animated-list.mjs +333 -1
  31. package/dist/animation/animated-number.js +283 -1
  32. package/dist/animation/animated-number.mjs +277 -1
  33. package/dist/animation/animated-testimonials.js +97 -1
  34. package/dist/animation/animated-testimonials.mjs +75 -1
  35. package/dist/animation/animated-tooltip.js +67 -1
  36. package/dist/animation/animated-tooltip.mjs +45 -1
  37. package/dist/animation/apple-cards-carousel.js +308 -1
  38. package/dist/animation/apple-cards-carousel.mjs +285 -1
  39. package/dist/animation/apple-hello-effect.js +60 -1
  40. package/dist/animation/apple-hello-effect.mjs +38 -1
  41. package/dist/animation/index.js +1952 -2
  42. package/dist/animation/index.mjs +1921 -2
  43. package/dist/avatar.js +71 -1
  44. package/dist/avatar.mjs +47 -1
  45. package/dist/badge.js +66 -1
  46. package/dist/badge.mjs +40 -1
  47. package/dist/blocks/index.js +1665 -2
  48. package/dist/blocks/index.mjs +1626 -2
  49. package/dist/breadcrumb.js +107 -1
  50. package/dist/breadcrumb.mjs +99 -1
  51. package/dist/calendar.js +189 -1
  52. package/dist/calendar.mjs +164 -1
  53. package/dist/carousel.js +278 -1
  54. package/dist/carousel.mjs +249 -1
  55. package/dist/checkbox.js +60 -1
  56. package/dist/checkbox.mjs +35 -1
  57. package/dist/code/block.js +226 -2
  58. package/dist/code/block.mjs +203 -2
  59. package/dist/code/compare.js +445 -5
  60. package/dist/code/compare.mjs +422 -5
  61. package/dist/code/diff.js +430 -12
  62. package/dist/code/diff.mjs +406 -11
  63. package/dist/code/editor.js +243 -1
  64. package/dist/code/editor.mjs +218 -1
  65. package/dist/code/explorer.js +291 -1
  66. package/dist/code/explorer.mjs +268 -1
  67. package/dist/code/index.js +2515 -26
  68. package/dist/code/index.mjs +2472 -24
  69. package/dist/code/preview.js +364 -6
  70. package/dist/code/preview.mjs +341 -6
  71. package/dist/code/snippet.js +274 -2
  72. package/dist/code/snippet.mjs +250 -2
  73. package/dist/code/tabs.js +75 -1
  74. package/dist/code/tabs.mjs +53 -1
  75. package/dist/code/terminal.js +437 -3
  76. package/dist/code/terminal.mjs +414 -3
  77. package/dist/collapsible.js +33 -1
  78. package/dist/collapsible.mjs +9 -1
  79. package/dist/command.js +262 -1
  80. package/dist/command.mjs +232 -1
  81. package/dist/context-menu.js +207 -1
  82. package/dist/context-menu.mjs +171 -1
  83. package/dist/device/index.js +3 -1
  84. package/dist/device/index.mjs +2 -0
  85. package/dist/dialog.js +151 -1
  86. package/dist/dialog.mjs +121 -1
  87. package/dist/dock/basic.js +174 -1
  88. package/dist/dock/basic.mjs +151 -1
  89. package/dist/dock/index.js +628 -1
  90. package/dist/dock/index.mjs +601 -1
  91. package/dist/dock/limelight-nav.js +295 -1
  92. package/dist/dock/limelight-nav.mjs +274 -1
  93. package/dist/dock/macos.js +141 -1
  94. package/dist/dock/macos.mjs +118 -1
  95. package/dist/dock/menu.js +70 -1
  96. package/dist/dock/menu.mjs +48 -1
  97. package/dist/dock/message.js +144 -1
  98. package/dist/dock/message.mjs +122 -1
  99. package/dist/drawer.js +115 -1
  100. package/dist/drawer.mjs +103 -1
  101. package/dist/dropdown-menu.js +202 -1
  102. package/dist/dropdown-menu.mjs +166 -1
  103. package/dist/finance/AdvancedChart.js +48 -2
  104. package/dist/finance/AdvancedChart.mjs +46 -2
  105. package/dist/finance/CompanyProfile.js +48 -2
  106. package/dist/finance/CompanyProfile.mjs +46 -2
  107. package/dist/finance/CryptoScreener.js +45 -2
  108. package/dist/finance/CryptoScreener.mjs +43 -2
  109. package/dist/finance/Financials.js +52 -2
  110. package/dist/finance/Financials.mjs +50 -2
  111. package/dist/finance/ForexScreener.js +46 -2
  112. package/dist/finance/ForexScreener.mjs +44 -2
  113. package/dist/finance/MarketOverview.js +104 -2
  114. package/dist/finance/MarketOverview.mjs +102 -2
  115. package/dist/finance/NewsTimeline.js +44 -2
  116. package/dist/finance/NewsTimeline.mjs +42 -2
  117. package/dist/finance/OrderEntry.js +131 -1
  118. package/dist/finance/OrderEntry.mjs +129 -1
  119. package/dist/finance/OrdersHistory.js +64 -1
  120. package/dist/finance/OrdersHistory.mjs +62 -1
  121. package/dist/finance/PositionsList.js +80 -1
  122. package/dist/finance/PositionsList.mjs +78 -1
  123. package/dist/finance/StockScreener.js +46 -2
  124. package/dist/finance/StockScreener.mjs +44 -2
  125. package/dist/finance/SymbolInfo.js +46 -2
  126. package/dist/finance/SymbolInfo.mjs +44 -2
  127. package/dist/finance/TechnicalAnalysis.js +54 -2
  128. package/dist/finance/TechnicalAnalysis.mjs +52 -2
  129. package/dist/finance/TickerTape.js +56 -2
  130. package/dist/finance/TickerTape.mjs +54 -2
  131. package/dist/finance/TradingPanel.js +191 -1
  132. package/dist/finance/TradingPanel.mjs +189 -1
  133. package/dist/finance/index.js +930 -2
  134. package/dist/finance/index.mjs +914 -2
  135. package/dist/form/index.js +155 -1
  136. package/dist/form/index.mjs +125 -1
  137. package/dist/form.js +172 -1
  138. package/dist/form.mjs +142 -1
  139. package/dist/hover-card.js +58 -1
  140. package/dist/hover-card.mjs +34 -1
  141. package/dist/index.js +8467 -192
  142. package/dist/index.mjs +8087 -192
  143. package/dist/input-otp.js +79 -1
  144. package/dist/input-otp.mjs +54 -1
  145. package/dist/lib/utils.js +28 -1
  146. package/dist/lib/utils.mjs +24 -1
  147. package/dist/navigation/index.js +98 -1
  148. package/dist/navigation/index.mjs +79 -1
  149. package/dist/navigation-menu.js +149 -1
  150. package/dist/navigation-menu.mjs +116 -1
  151. package/dist/pattern/grid-pattern.js +326 -3
  152. package/dist/pattern/grid-pattern.mjs +303 -3
  153. package/dist/pattern/index.js +326 -3
  154. package/dist/pattern/index.mjs +303 -3
  155. package/dist/popover.js +63 -1
  156. package/dist/popover.mjs +37 -1
  157. package/dist/primitives/index.js +8467 -192
  158. package/dist/primitives/index.mjs +8087 -192
  159. package/dist/primitives-export.js +8467 -192
  160. package/dist/primitives-export.mjs +8087 -192
  161. package/dist/progress.js +62 -1
  162. package/dist/progress.mjs +37 -1
  163. package/dist/project/gantt.js +65 -1
  164. package/dist/project/gantt.mjs +43 -1
  165. package/dist/project/index.js +636 -1
  166. package/dist/project/index.mjs +611 -1
  167. package/dist/project/kanban.js +597 -1
  168. package/dist/project/kanban.mjs +572 -1
  169. package/dist/project/list.js +35 -1
  170. package/dist/project/list.mjs +12 -1
  171. package/dist/radio-group.js +68 -1
  172. package/dist/radio-group.mjs +45 -1
  173. package/dist/resizable.js +72 -1
  174. package/dist/resizable.mjs +48 -1
  175. package/dist/scroll-area.js +89 -1
  176. package/dist/scroll-area.mjs +66 -1
  177. package/dist/select.js +140 -1
  178. package/dist/select.mjs +111 -1
  179. package/dist/separator.js +59 -1
  180. package/dist/separator.mjs +34 -1
  181. package/dist/sheet.js +148 -1
  182. package/dist/sheet.mjs +117 -1
  183. package/dist/skeleton.js +32 -1
  184. package/dist/skeleton.mjs +27 -1
  185. package/dist/slider.js +99 -1
  186. package/dist/slider.mjs +73 -1
  187. package/dist/sonner.js +34 -1
  188. package/dist/sonner.mjs +29 -1
  189. package/dist/switch.js +62 -1
  190. package/dist/switch.mjs +37 -1
  191. package/dist/table.js +110 -1
  192. package/dist/table.mjs +101 -1
  193. package/dist/tabs.js +82 -1
  194. package/dist/tabs.mjs +57 -1
  195. package/dist/tailwind/index.js +2023 -1
  196. package/dist/tailwind/index.mjs +2011 -1
  197. package/dist/textarea.js +78 -1
  198. package/dist/textarea.mjs +56 -1
  199. package/dist/toggle-group.js +118 -1
  200. package/dist/toggle-group.mjs +93 -1
  201. package/dist/toggle.js +71 -1
  202. package/dist/toggle.mjs +48 -1
  203. package/dist/tooltip.js +67 -1
  204. package/dist/tooltip.mjs +40 -1
  205. package/dist/types/index.js +57 -1
  206. package/dist/types/index.mjs +51 -1
  207. package/dist/ui/announcement.js +129 -1
  208. package/dist/ui/announcement.mjs +107 -1
  209. package/dist/ui/avatar-group.js +88 -1
  210. package/dist/ui/avatar-group.mjs +65 -1
  211. package/dist/ui/banner.js +85 -1
  212. package/dist/ui/banner.mjs +62 -1
  213. package/dist/ui/cursor.js +78 -1
  214. package/dist/ui/cursor.mjs +56 -1
  215. package/dist/ui/index.js +475 -1
  216. package/dist/ui/index.mjs +442 -1
  217. package/dist/ui/marquee.js +74 -1
  218. package/dist/ui/marquee.mjs +52 -1
  219. package/dist/ui/pill.js +85 -1
  220. package/dist/ui/pill.mjs +62 -1
  221. package/dist/ui/spinner.js +28 -1
  222. package/dist/ui/spinner.mjs +26 -1
  223. package/dist/ui/tags.js +101 -1
  224. package/dist/ui/tags.mjs +79 -1
  225. package/dist/ui/ticker.js +73 -1
  226. package/dist/ui/ticker.mjs +51 -1
  227. package/dist/util/index.js +457 -1
  228. package/dist/util/index.mjs +399 -1
  229. package/package.json +1 -1
package/dist/dialog.mjs CHANGED
@@ -1 +1,121 @@
1
- import*as e from'@radix-ui/react-dialog';import {X}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs}from'react/jsx-runtime';var d=Object.defineProperty;var i=(t,a)=>d(t,"name",{value:a,configurable:true});function o(...t){return twMerge(clsx(t))}i(o,"cn");var R=e.Root,L=e.Trigger,f=e.Portal,n=i(({className:t,...a})=>jsx(e.Overlay,{className:o("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 z-50","bg-bg-dark/90",t),...a}),"DialogOverlay");n.displayName=e.Overlay.displayName;var D=i(({className:t,children:a,showCloseButton:r=false,...m})=>jsxs(f,{children:[jsx(n,{}),jsxs(e.Content,{className:o("bg-bg-default 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 border-divider fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:rounded-lg md:w-full",t),...m,children:[a,jsxs(e.Close,{className:o("ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-text-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",!r&&"hidden"),children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]}),"DialogContent");D.displayName=e.Content.displayName;var u=i(({className:t,...a})=>jsx("div",{className:o("flex flex-col space-y-1.5 text-center sm:text-left",t),...a}),"DialogHeader");u.displayName="DialogHeader";var v=i(({className:t,...a})=>jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a}),"DialogFooter");v.displayName="DialogFooter";var y=i(({className:t,...a})=>jsx(e.Title,{className:o("text-lg leading-none font-semibold tracking-tight",t),...a}),"DialogTitle");y.displayName=e.Title.displayName;var P=i(({className:t,...a})=>jsx(e.Description,{className:o("text-text-secondary text-sm",t),...a}),"DialogDescription");P.displayName=e.Description.displayName;export{R as Dialog,D as DialogContent,P as DialogDescription,v as DialogFooter,u as DialogHeader,n as DialogOverlay,f as DialogPortal,y as DialogTitle,L as DialogTrigger};
1
+ "use client";
2
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
3
+ import { X } from 'lucide-react';
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 Dialog = DialogPrimitive.Root;
15
+ var DialogTrigger = DialogPrimitive.Trigger;
16
+ var DialogPortal = DialogPrimitive.Portal;
17
+ var DialogOverlay = /* @__PURE__ */ __name(({
18
+ className,
19
+ ...props
20
+ }) => /* @__PURE__ */ jsx(
21
+ DialogPrimitive.Overlay,
22
+ {
23
+ className: cn(
24
+ "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 z-50",
25
+ "bg-bg-dark/90",
26
+ className
27
+ ),
28
+ ...props
29
+ }
30
+ ), "DialogOverlay");
31
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
32
+ var DialogContent = /* @__PURE__ */ __name(({
33
+ className,
34
+ children,
35
+ showCloseButton = false,
36
+ ...props
37
+ }) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
38
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
39
+ /* @__PURE__ */ jsxs(
40
+ DialogPrimitive.Content,
41
+ {
42
+ className: cn(
43
+ "bg-bg-default 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 border-divider fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:rounded-lg md:w-full",
44
+ className
45
+ ),
46
+ ...props,
47
+ children: [
48
+ children,
49
+ /* @__PURE__ */ jsxs(
50
+ DialogPrimitive.Close,
51
+ {
52
+ className: cn(
53
+ "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-text-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",
54
+ !showCloseButton && "hidden"
55
+ ),
56
+ children: [
57
+ /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
58
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
59
+ ]
60
+ }
61
+ )
62
+ ]
63
+ }
64
+ )
65
+ ] }), "DialogContent");
66
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
67
+ var DialogHeader = /* @__PURE__ */ __name(({
68
+ className,
69
+ ...props
70
+ }) => /* @__PURE__ */ jsx(
71
+ "div",
72
+ {
73
+ className: cn(
74
+ "flex flex-col space-y-1.5 text-center sm:text-left",
75
+ className
76
+ ),
77
+ ...props
78
+ }
79
+ ), "DialogHeader");
80
+ DialogHeader.displayName = "DialogHeader";
81
+ var DialogFooter = /* @__PURE__ */ __name(({
82
+ className,
83
+ ...props
84
+ }) => /* @__PURE__ */ jsx(
85
+ "div",
86
+ {
87
+ className: cn(
88
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
89
+ className
90
+ ),
91
+ ...props
92
+ }
93
+ ), "DialogFooter");
94
+ DialogFooter.displayName = "DialogFooter";
95
+ var DialogTitle = /* @__PURE__ */ __name(({
96
+ className,
97
+ ...props
98
+ }) => /* @__PURE__ */ jsx(
99
+ DialogPrimitive.Title,
100
+ {
101
+ className: cn(
102
+ "text-lg leading-none font-semibold tracking-tight",
103
+ className
104
+ ),
105
+ ...props
106
+ }
107
+ ), "DialogTitle");
108
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
109
+ var DialogDescription = /* @__PURE__ */ __name(({
110
+ className,
111
+ ...props
112
+ }) => /* @__PURE__ */ jsx(
113
+ DialogPrimitive.Description,
114
+ {
115
+ className: cn("text-text-secondary text-sm", className),
116
+ ...props
117
+ }
118
+ ), "DialogDescription");
119
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
120
+
121
+ export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -1 +1,174 @@
1
- '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;
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;
@@ -1 +1,151 @@
1
- import*as e from'react';import {useMotionValue,useSpring,useTransform,motion}from'framer-motion';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs}from'react/jsx-runtime';var I=Object.defineProperty;var n=(t,o)=>I(t,"name",{value:o,configurable:true});function f(...t){return twMerge(clsx(t))}n(f,"cn");var h=e.createContext({magnification:60,distance:140}),S=e.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 jsx(h.Provider,{value:{magnification:r,distance:l},children: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.forwardRef(({className:t,children:o,onClick:c,tooltip:r,magnification:l,distance:m},g)=>{let u=e.useRef(null),{magnification:y,distance:k}=e.useContext(h),w=l??y,p=m??k,[R,x]=e.useState(false),d=useMotionValue(1/0),D={mass:.1,stiffness:150,damping:12},s=useSpring(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 jsxs(motion.div,{className:"relative",onMouseMove:M,onMouseLeave:N,onMouseEnter:()=>x(true),children:[r&&R&&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: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:[jsx(motion.div,{style:{width:s,height:s},className:"flex items-center justify-center",children:o}),jsx(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";export{S as Dock,U as DockItem};
1
+ "use client";
2
+ import * as React from 'react';
3
+ import { useMotionValue, useSpring, useTransform, motion } 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
+ });
18
+ var Dock = React.forwardRef(
19
+ ({
20
+ className,
21
+ children,
22
+ position = "bottom",
23
+ magnification = 60,
24
+ distance = 140
25
+ }, ref) => {
26
+ const positionClasses = {
27
+ bottom: "bottom-0 left-1/2 -translate-x-1/2 flex-row",
28
+ left: "left-0 top-1/2 -translate-y-1/2 flex-col",
29
+ right: "right-0 top-1/2 -translate-y-1/2 flex-col"
30
+ };
31
+ return /* @__PURE__ */ jsx(DockContext.Provider, { value: { magnification, distance }, children: /* @__PURE__ */ jsx(
32
+ "div",
33
+ {
34
+ ref,
35
+ className: cn(
36
+ "fixed z-50 flex items-end gap-1 rounded-2xl border border-white/10 bg-black/10 p-2 backdrop-blur-xl",
37
+ "shadow-2xl shadow-black/20",
38
+ "before:absolute before:inset-0 before:rounded-2xl before:bg-gradient-to-b before:from-white/10 before:to-transparent before:opacity-50",
39
+ positionClasses[position],
40
+ className
41
+ ),
42
+ children
43
+ }
44
+ ) });
45
+ }
46
+ );
47
+ Dock.displayName = "Dock";
48
+ var DockItem = React.forwardRef(
49
+ ({
50
+ className,
51
+ children,
52
+ onClick,
53
+ tooltip,
54
+ magnification: itemMagnification,
55
+ distance: itemDistance
56
+ }, ref) => {
57
+ const buttonRef = React.useRef(null);
58
+ const { magnification: contextMagnification, distance: contextDistance } = React.useContext(DockContext);
59
+ const magnification = itemMagnification ?? contextMagnification;
60
+ const distance = itemDistance ?? contextDistance;
61
+ const [isHovered, setIsHovered] = React.useState(false);
62
+ const mouseX = useMotionValue(Infinity);
63
+ const springConfig = { mass: 0.1, stiffness: 150, damping: 12 };
64
+ const size = useSpring(
65
+ useTransform(
66
+ mouseX,
67
+ [-distance, 0, distance],
68
+ [48, 48 + magnification, 48]
69
+ ),
70
+ springConfig
71
+ );
72
+ const handleMouseMove = /* @__PURE__ */ __name((e) => {
73
+ if (!buttonRef.current) return;
74
+ const rect = buttonRef.current.getBoundingClientRect();
75
+ const centerX = rect.left + rect.width / 2;
76
+ mouseX.set(e.clientX - centerX);
77
+ }, "handleMouseMove");
78
+ const handleMouseLeave = /* @__PURE__ */ __name(() => {
79
+ mouseX.set(Infinity);
80
+ setIsHovered(false);
81
+ }, "handleMouseLeave");
82
+ return /* @__PURE__ */ jsxs(
83
+ motion.div,
84
+ {
85
+ className: "relative",
86
+ onMouseMove: handleMouseMove,
87
+ onMouseLeave: handleMouseLeave,
88
+ onMouseEnter: () => setIsHovered(true),
89
+ children: [
90
+ tooltip && isHovered && /* @__PURE__ */ jsxs(
91
+ motion.div,
92
+ {
93
+ initial: { opacity: 0, y: 10, scale: 0.9 },
94
+ animate: { opacity: 1, y: 0, scale: 1 },
95
+ exit: { opacity: 0, y: 5, scale: 0.95 },
96
+ transition: { duration: 0.15 },
97
+ 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",
98
+ children: [
99
+ tooltip,
100
+ /* @__PURE__ */ jsx("div", { className: "absolute -bottom-1 left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 bg-black/80" })
101
+ ]
102
+ }
103
+ ),
104
+ /* @__PURE__ */ jsxs(
105
+ motion.button,
106
+ {
107
+ ref: buttonRef,
108
+ style: {
109
+ width: size,
110
+ height: size
111
+ },
112
+ whileTap: { scale: 0.9 },
113
+ onClick,
114
+ className: cn(
115
+ "relative flex items-center justify-center rounded-xl bg-white/10 backdrop-blur-md transition-colors",
116
+ "hover:bg-white/20",
117
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",
118
+ className
119
+ ),
120
+ children: [
121
+ /* @__PURE__ */ jsx(
122
+ motion.div,
123
+ {
124
+ style: {
125
+ width: size,
126
+ height: size
127
+ },
128
+ className: "flex items-center justify-center",
129
+ children
130
+ }
131
+ ),
132
+ /* @__PURE__ */ jsx(
133
+ motion.div,
134
+ {
135
+ className: "absolute inset-0 rounded-xl",
136
+ style: {
137
+ background: "linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%)"
138
+ }
139
+ }
140
+ )
141
+ ]
142
+ }
143
+ )
144
+ ]
145
+ }
146
+ );
147
+ }
148
+ );
149
+ DockItem.displayName = "DockItem";
150
+
151
+ export { Dock, DockItem };