bynana-ui 1.7.0 → 1.9.0

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 (65) hide show
  1. package/dist/ai-text-loading/index.js +2 -0
  2. package/dist/ai-text-loading/index.js.map +1 -0
  3. package/dist/ai-text-loading/index.mjs +2 -0
  4. package/dist/ai-text-loading/index.mjs.map +1 -0
  5. package/dist/ai-voice/index.js +3 -0
  6. package/dist/ai-voice/index.js.map +1 -0
  7. package/dist/ai-voice/index.mjs +3 -0
  8. package/dist/ai-voice/index.mjs.map +1 -0
  9. package/dist/background-paths/index.js +2 -0
  10. package/dist/background-paths/index.js.map +1 -0
  11. package/dist/background-paths/index.mjs +2 -0
  12. package/dist/background-paths/index.mjs.map +1 -0
  13. package/dist/floating-paths/index.js +2 -0
  14. package/dist/floating-paths/index.js.map +1 -0
  15. package/dist/floating-paths/index.mjs +2 -0
  16. package/dist/floating-paths/index.mjs.map +1 -0
  17. package/dist/folder/index.js +2 -0
  18. package/dist/folder/index.js.map +1 -0
  19. package/dist/folder/index.mjs +2 -0
  20. package/dist/folder/index.mjs.map +1 -0
  21. package/dist/glare-hover/index.js +32 -0
  22. package/dist/glare-hover/index.js.map +1 -0
  23. package/dist/glare-hover/index.mjs +32 -0
  24. package/dist/glare-hover/index.mjs.map +1 -0
  25. package/dist/index.js +44 -14
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +44 -14
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/logo-loop/index.js +2 -0
  30. package/dist/logo-loop/index.js.map +1 -0
  31. package/dist/logo-loop/index.mjs +2 -0
  32. package/dist/logo-loop/index.mjs.map +1 -0
  33. package/dist/magnet/index.js +2 -0
  34. package/dist/magnet/index.js.map +1 -0
  35. package/dist/magnet/index.mjs +2 -0
  36. package/dist/magnet/index.mjs.map +1 -0
  37. package/dist/magnet-lines/index.js +2 -0
  38. package/dist/magnet-lines/index.js.map +1 -0
  39. package/dist/magnet-lines/index.mjs +2 -0
  40. package/dist/magnet-lines/index.mjs.map +1 -0
  41. package/dist/team-selector/index.js +3 -0
  42. package/dist/team-selector/index.js.map +1 -0
  43. package/dist/team-selector/index.mjs +3 -0
  44. package/dist/team-selector/index.mjs.map +1 -0
  45. package/dist/testimonials-stars/index.js +3 -0
  46. package/dist/testimonials-stars/index.js.map +1 -0
  47. package/dist/testimonials-stars/index.mjs +3 -0
  48. package/dist/testimonials-stars/index.mjs.map +1 -0
  49. package/dist/text-type/index.js +2 -0
  50. package/dist/text-type/index.js.map +1 -0
  51. package/dist/text-type/index.mjs +2 -0
  52. package/dist/text-type/index.mjs.map +1 -0
  53. package/dist/tooltip-interactive/index.js +2 -0
  54. package/dist/tooltip-interactive/index.js.map +1 -0
  55. package/dist/tooltip-interactive/index.mjs +2 -0
  56. package/dist/tooltip-interactive/index.mjs.map +1 -0
  57. package/dist/tooltip-magnetic/index.js +2 -0
  58. package/dist/tooltip-magnetic/index.js.map +1 -0
  59. package/dist/tooltip-magnetic/index.mjs +2 -0
  60. package/dist/tooltip-magnetic/index.mjs.map +1 -0
  61. package/dist/tooltip-rich/index.js +2 -0
  62. package/dist/tooltip-rich/index.js.map +1 -0
  63. package/dist/tooltip-rich/index.mjs +2 -0
  64. package/dist/tooltip-rich/index.mjs.map +1 -0
  65. package/package.json +17 -2
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/tooltip-magnetic/index.tsx"],"names":["cn","inputs","twMerge","clsx","TooltipMagnetic","content","children","offset","springConfig","className","isVisible","setIsVisible","useState","containerRef","useRef","mouseX","useMotionValue","mouseY","springX","useSpring","springY","handleMouseMove","useCallback","event","rect","centerX","centerY","deltaX","deltaY","distance","maxDistance","magneticStrength","handleMouseEnter","handleMouseLeave","jsxs","jsx","AnimatePresence","motion","tooltip_magnetic_default"],"mappings":"4OAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,sBAAQC,SAAAA,CAAKF,CAA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,KAAA,CAAO,CAAC,CAAA,CAAG,GAAA,CAAK,CAAC,CAAA,CAAG,OAAA,CAAS,CAAC,EAAA,CAAK,EAAA,CAAK,EAAG,CAAE,CAAA,CACxD,WAAY,CAAE,QAAA,CAAU,EAAG,MAAA,CAAQ,CAAA,CAAA,CAAA,CAAU,KAAM,WAAY,CAAA,CACjE,EACAF,cAAAA,CAACE,mBAAAA,CAAO,IAAP,CACC,OAAA,CAAS,CAAE,KAAA,CAAO,CAAE,EACpB,OAAA,CAAS,CAAE,MAAO,CAAE,CAAA,CACpB,WAAY,CAAE,KAAA,CAAO,GAAK,IAAA,CAAM,QAAA,CAAU,UAAW,GAAI,CAAA,CACzD,UAAU,mKAAA,CACZ,CAAA,CACAF,eAACE,mBAAAA,CAAO,GAAA,CAAP,CACC,SAAA,CAAU,6DAAA,CACV,QAAS,CAAE,KAAA,CAAO,CAAC,CAAA,CAAG,GAAA,CAAK,CAAC,CAAA,CAAG,OAAA,CAAS,CAAC,EAAA,CAAK,EAAA,CAAK,EAAG,CAAE,CAAA,CACxD,WAAY,CAAE,QAAA,CAAU,IAAK,MAAA,CAAQ,CAAA,CAAA,CAAA,CAAU,KAAM,WAAY,CAAA,CACnE,GACF,CAAA,CACF,CAAA,CAEJ,GACF,CAEJ,KAEOC,CAAAA,CAAQlC","file":"index.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}\r\n","\"use client\";\r\n\r\nimport { useState, useRef, useCallback } from \"react\";\r\nimport { motion, AnimatePresence, useSpring, useMotionValue } from \"framer-motion\";\r\nimport { cn } from \"../utils/cn\";\r\n\r\nexport interface TooltipMagneticProps {\r\n content: string;\r\n children: React.ReactNode;\r\n offset?: number;\r\n springConfig?: { stiffness: number; damping: number };\r\n className?: string;\r\n}\r\n\r\nexport function TooltipMagnetic({\r\n content,\r\n children,\r\n offset = 20,\r\n springConfig = { stiffness: 300, damping: 30 },\r\n className,\r\n}: TooltipMagneticProps) {\r\n const [isVisible, setIsVisible] = useState(false);\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n\r\n const mouseX = useMotionValue(0);\r\n const mouseY = useMotionValue(0);\r\n\r\n const springX = useSpring(mouseX, springConfig);\r\n const springY = useSpring(mouseY, springConfig);\r\n\r\n const handleMouseMove = useCallback(\r\n (event: React.MouseEvent) => {\r\n if (!containerRef.current) return;\r\n\r\n const rect = containerRef.current.getBoundingClientRect();\r\n const centerX = rect.left + rect.width / 2;\r\n const centerY = rect.top + rect.height / 2;\r\n\r\n const deltaX = event.clientX - centerX;\r\n const deltaY = event.clientY - centerY;\r\n\r\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\r\n const maxDistance = Math.max(rect.width, rect.height);\r\n\r\n const normalizedDistance = Math.min(distance / maxDistance, 1);\r\n const magneticStrength = 1 - normalizedDistance;\r\n\r\n mouseX.set(deltaX * magneticStrength * 0.5);\r\n mouseY.set(deltaY * magneticStrength * 0.5);\r\n },\r\n [mouseX, mouseY]\r\n );\r\n\r\n const handleMouseEnter = () => setIsVisible(true);\r\n const handleMouseLeave = () => {\r\n setIsVisible(false);\r\n mouseX.set(0);\r\n mouseY.set(0);\r\n };\r\n\r\n return (\r\n <div\r\n ref={containerRef}\r\n className={cn(\"relative inline-block\", className)}\r\n onMouseMove={handleMouseMove}\r\n onMouseEnter={handleMouseEnter}\r\n onMouseLeave={handleMouseLeave}\r\n >\r\n {children}\r\n\r\n <AnimatePresence>\r\n {isVisible && (\r\n <motion.div\r\n style={{ x: springX, y: springY }}\r\n initial={{ opacity: 0, scale: 0.8 }}\r\n animate={{ opacity: 1, scale: 1 }}\r\n exit={{ opacity: 0, scale: 0.8 }}\r\n transition={{ type: \"spring\", stiffness: 400, damping: 25 }}\r\n className=\"absolute z-50 pointer-events-none\"\r\n >\r\n <motion.div\r\n className=\"relative px-4 py-2 text-sm text-zinc-900 dark:text-zinc-100 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl shadow-xl backdrop-blur-sm whitespace-nowrap\"\r\n style={{ translateX: \"-50%\", translateY: `calc(-100% - ${offset}px)` }}\r\n whileHover={{ scale: 1.05 }}\r\n >\r\n {content}\r\n <motion.div\r\n className=\"absolute inset-0 bg-gradient-to-r from-blue-500/20 to-purple-500/20 rounded-xl -z-10 blur-sm\"\r\n animate={{ scale: [1, 1.1, 1], opacity: [0.5, 0.8, 0.5] }}\r\n transition={{ duration: 2, repeat: Infinity, ease: \"easeInOut\" }}\r\n />\r\n <motion.div\r\n initial={{ scale: 0 }}\r\n animate={{ scale: 1 }}\r\n transition={{ delay: 0.1, type: \"spring\", stiffness: 400 }}\r\n className=\"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-4 border-l-transparent border-r-transparent border-b-transparent border-t-white dark:border-t-zinc-900\"\r\n />\r\n <motion.div\r\n className=\"absolute inset-0 rounded-xl border border-blue-500/30 -z-10\"\r\n animate={{ scale: [1, 1.2, 1], opacity: [0.3, 0.6, 0.3] }}\r\n transition={{ duration: 1.5, repeat: Infinity, ease: \"easeInOut\" }}\r\n />\r\n </motion.div>\r\n </motion.div>\r\n )}\r\n </AnimatePresence>\r\n </div>\r\n );\r\n}\r\n\r\nexport default TooltipMagnetic;\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {useState,useRef,useCallback}from'react';import {useMotionValue,useSpring,AnimatePresence,motion}from'framer-motion';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';function m(...i){return twMerge(clsx(i))}function L({content:i,children:h,offset:v=20,springConfig:l={stiffness:300,damping:30},className:x}){let[M,d]=useState(false),o=useRef(null),s=useMotionValue(0),a=useMotionValue(0),y=useSpring(s,l),z=useSpring(a,l),w=useCallback(u=>{if(!o.current)return;let e=o.current.getBoundingClientRect(),R=e.left+e.width/2,X=e.top+e.height/2,r=u.clientX-R,c=u.clientY-X,Y=Math.sqrt(r*r+c*c),I=Math.max(e.width,e.height),p=1-Math.min(Y/I,1);s.set(r*p*.5),a.set(c*p*.5);},[s,a]),N=()=>d(true),k=()=>{d(false),s.set(0),a.set(0);};return jsxs("div",{ref:o,className:m("relative inline-block",x),onMouseMove:w,onMouseEnter:N,onMouseLeave:k,children:[h,jsx(AnimatePresence,{children:M&&jsx(motion.div,{style:{x:y,y:z},initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:"spring",stiffness:400,damping:25},className:"absolute z-50 pointer-events-none",children:jsxs(motion.div,{className:"relative px-4 py-2 text-sm text-zinc-900 dark:text-zinc-100 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl shadow-xl backdrop-blur-sm whitespace-nowrap",style:{translateX:"-50%",translateY:`calc(-100% - ${v}px)`},whileHover:{scale:1.05},children:[i,jsx(motion.div,{className:"absolute inset-0 bg-gradient-to-r from-blue-500/20 to-purple-500/20 rounded-xl -z-10 blur-sm",animate:{scale:[1,1.1,1],opacity:[.5,.8,.5]},transition:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsx(motion.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,type:"spring",stiffness:400},className:"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-4 border-l-transparent border-r-transparent border-b-transparent border-t-white dark:border-t-zinc-900"}),jsx(motion.div,{className:"absolute inset-0 rounded-xl border border-blue-500/30 -z-10",animate:{scale:[1,1.2,1],opacity:[.3,.6,.3]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"}})]})})})]})}var F=L;export{L as TooltipMagnetic,F as default};//# sourceMappingURL=index.mjs.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/tooltip-magnetic/index.tsx"],"names":["cn","inputs","twMerge","clsx","TooltipMagnetic","content","children","offset","springConfig","className","isVisible","setIsVisible","useState","containerRef","useRef","mouseX","useMotionValue","mouseY","springX","useSpring","springY","handleMouseMove","useCallback","event","rect","centerX","centerY","deltaX","deltaY","distance","maxDistance","magneticStrength","handleMouseEnter","handleMouseLeave","jsxs","jsx","AnimatePresence","motion","tooltip_magnetic_default"],"mappings":"kOAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,QAAQC,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCSO,SAASG,CAAAA,CAAgB,CAC9B,OAAA,CAAAC,CAAAA,CACA,SAAAC,CAAAA,CACA,MAAA,CAAAC,EAAS,EAAA,CACT,YAAA,CAAAC,EAAe,CAAE,SAAA,CAAW,IAAK,OAAA,CAAS,EAAG,EAC7C,SAAA,CAAAC,CACF,EAAyB,CACvB,GAAM,CAACC,CAAAA,CAAWC,CAAY,EAAIC,QAAAA,CAAS,KAAK,EAC1CC,CAAAA,CAAeC,MAAAA,CAAuB,IAAI,CAAA,CAE1CC,CAAAA,CAASC,eAAe,CAAC,CAAA,CACzBC,EAASD,cAAAA,CAAe,CAAC,EAEzBE,CAAAA,CAAUC,SAAAA,CAAUJ,EAAQP,CAAY,CAAA,CACxCY,EAAUD,SAAAA,CAAUF,CAAAA,CAAQT,CAAY,CAAA,CAExCa,EAAkBC,WAAAA,CACrBC,CAAAA,EAA4B,CAC3B,GAAI,CAACV,EAAa,OAAA,CAAS,OAE3B,IAAMW,CAAAA,CAAOX,CAAAA,CAAa,QAAQ,qBAAA,EAAsB,CAClDY,EAAUD,CAAAA,CAAK,IAAA,CAAOA,EAAK,KAAA,CAAQ,CAAA,CACnCE,EAAUF,CAAAA,CAAK,GAAA,CAAMA,EAAK,MAAA,CAAS,CAAA,CAEnCG,EAASJ,CAAAA,CAAM,OAAA,CAAUE,EACzBG,CAAAA,CAASL,CAAAA,CAAM,QAAUG,CAAAA,CAEzBG,CAAAA,CAAW,KAAK,IAAA,CAAKF,CAAAA,CAASA,EAASC,CAAAA,CAASA,CAAM,EACtDE,CAAAA,CAAc,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ACV,KAAA,CAAO,CAAE,WAAY,MAAA,CAAQ,UAAA,CAAY,gBAAgB9B,CAAM,CAAA,GAAA,CAAM,EACrE,UAAA,CAAY,CAAE,MAAO,IAAK,CAAA,CAEzB,UAAAF,CAAAA,CACD8B,GAAAA,CAACE,MAAAA,CAAO,GAAA,CAAP,CACC,SAAA,CAAU,8FAAA,CACV,QAAS,CAAE,KAAA,CAAO,CAAC,CAAA,CAAG,GAAA,CAAK,CAAC,CAAA,CAAG,OAAA,CAAS,CAAC,EAAA,CAAK,EAAA,CAAK,EAAG,CAAE,CAAA,CACxD,WAAY,CAAE,QAAA,CAAU,EAAG,MAAA,CAAQ,CAAA,CAAA,CAAA,CAAU,KAAM,WAAY,CAAA,CACjE,EACAF,GAAAA,CAACE,MAAAA,CAAO,IAAP,CACC,OAAA,CAAS,CAAE,KAAA,CAAO,CAAE,EACpB,OAAA,CAAS,CAAE,MAAO,CAAE,CAAA,CACpB,WAAY,CAAE,KAAA,CAAO,GAAK,IAAA,CAAM,QAAA,CAAU,UAAW,GAAI,CAAA,CACzD,UAAU,mKAAA,CACZ,CAAA,CACAF,IAACE,MAAAA,CAAO,GAAA,CAAP,CACC,SAAA,CAAU,6DAAA,CACV,QAAS,CAAE,KAAA,CAAO,CAAC,CAAA,CAAG,GAAA,CAAK,CAAC,CAAA,CAAG,OAAA,CAAS,CAAC,EAAA,CAAK,EAAA,CAAK,EAAG,CAAE,CAAA,CACxD,WAAY,CAAE,QAAA,CAAU,IAAK,MAAA,CAAQ,CAAA,CAAA,CAAA,CAAU,KAAM,WAAY,CAAA,CACnE,GACF,CAAA,CACF,CAAA,CAEJ,GACF,CAEJ,KAEOC,CAAAA,CAAQlC","file":"index.mjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}\r\n","\"use client\";\r\n\r\nimport { useState, useRef, useCallback } from \"react\";\r\nimport { motion, AnimatePresence, useSpring, useMotionValue } from \"framer-motion\";\r\nimport { cn } from \"../utils/cn\";\r\n\r\nexport interface TooltipMagneticProps {\r\n content: string;\r\n children: React.ReactNode;\r\n offset?: number;\r\n springConfig?: { stiffness: number; damping: number };\r\n className?: string;\r\n}\r\n\r\nexport function TooltipMagnetic({\r\n content,\r\n children,\r\n offset = 20,\r\n springConfig = { stiffness: 300, damping: 30 },\r\n className,\r\n}: TooltipMagneticProps) {\r\n const [isVisible, setIsVisible] = useState(false);\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n\r\n const mouseX = useMotionValue(0);\r\n const mouseY = useMotionValue(0);\r\n\r\n const springX = useSpring(mouseX, springConfig);\r\n const springY = useSpring(mouseY, springConfig);\r\n\r\n const handleMouseMove = useCallback(\r\n (event: React.MouseEvent) => {\r\n if (!containerRef.current) return;\r\n\r\n const rect = containerRef.current.getBoundingClientRect();\r\n const centerX = rect.left + rect.width / 2;\r\n const centerY = rect.top + rect.height / 2;\r\n\r\n const deltaX = event.clientX - centerX;\r\n const deltaY = event.clientY - centerY;\r\n\r\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\r\n const maxDistance = Math.max(rect.width, rect.height);\r\n\r\n const normalizedDistance = Math.min(distance / maxDistance, 1);\r\n const magneticStrength = 1 - normalizedDistance;\r\n\r\n mouseX.set(deltaX * magneticStrength * 0.5);\r\n mouseY.set(deltaY * magneticStrength * 0.5);\r\n },\r\n [mouseX, mouseY]\r\n );\r\n\r\n const handleMouseEnter = () => setIsVisible(true);\r\n const handleMouseLeave = () => {\r\n setIsVisible(false);\r\n mouseX.set(0);\r\n mouseY.set(0);\r\n };\r\n\r\n return (\r\n <div\r\n ref={containerRef}\r\n className={cn(\"relative inline-block\", className)}\r\n onMouseMove={handleMouseMove}\r\n onMouseEnter={handleMouseEnter}\r\n onMouseLeave={handleMouseLeave}\r\n >\r\n {children}\r\n\r\n <AnimatePresence>\r\n {isVisible && (\r\n <motion.div\r\n style={{ x: springX, y: springY }}\r\n initial={{ opacity: 0, scale: 0.8 }}\r\n animate={{ opacity: 1, scale: 1 }}\r\n exit={{ opacity: 0, scale: 0.8 }}\r\n transition={{ type: \"spring\", stiffness: 400, damping: 25 }}\r\n className=\"absolute z-50 pointer-events-none\"\r\n >\r\n <motion.div\r\n className=\"relative px-4 py-2 text-sm text-zinc-900 dark:text-zinc-100 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl shadow-xl backdrop-blur-sm whitespace-nowrap\"\r\n style={{ translateX: \"-50%\", translateY: `calc(-100% - ${offset}px)` }}\r\n whileHover={{ scale: 1.05 }}\r\n >\r\n {content}\r\n <motion.div\r\n className=\"absolute inset-0 bg-gradient-to-r from-blue-500/20 to-purple-500/20 rounded-xl -z-10 blur-sm\"\r\n animate={{ scale: [1, 1.1, 1], opacity: [0.5, 0.8, 0.5] }}\r\n transition={{ duration: 2, repeat: Infinity, ease: \"easeInOut\" }}\r\n />\r\n <motion.div\r\n initial={{ scale: 0 }}\r\n animate={{ scale: 1 }}\r\n transition={{ delay: 0.1, type: \"spring\", stiffness: 400 }}\r\n className=\"absolute top-full left-1/2 -translate-x-1/2 w-0 h-0 border-4 border-l-transparent border-r-transparent border-b-transparent border-t-white dark:border-t-zinc-900\"\r\n />\r\n <motion.div\r\n className=\"absolute inset-0 rounded-xl border border-blue-500/30 -z-10\"\r\n animate={{ scale: [1, 1.2, 1], opacity: [0.3, 0.6, 0.3] }}\r\n transition={{ duration: 1.5, repeat: Infinity, ease: \"easeInOut\" }}\r\n />\r\n </motion.div>\r\n </motion.div>\r\n )}\r\n </AnimatePresence>\r\n </div>\r\n );\r\n}\r\n\r\nexport default TooltipMagnetic;\r\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var react=require('react'),framerMotion=require('framer-motion'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function o(...a){return tailwindMerge.twMerge(clsx.clsx(a))}function w({title:a,content:d,icon:i,children:c,position:t="top",delay:p=300,maxWidth:b="max-w-xs",className:m}){let[u,l]=react.useState(false),s=react.useRef(void 0),f=()=>{s.current=setTimeout(()=>l(true),p);},y=()=>{s.current&&clearTimeout(s.current),l(false);},x=()=>{switch(t){case "top":return "bottom-full left-1/2 -translate-x-1/2 mb-3";case "bottom":return "top-full left-1/2 -translate-x-1/2 mt-3";case "left":return "right-full top-1/2 -translate-y-1/2 mr-3";case "right":return "left-full top-1/2 -translate-y-1/2 ml-3";default:return "bottom-full left-1/2 -translate-x-1/2 mb-3"}};return jsxRuntime.jsxs("div",{className:o("relative inline-block",m),onMouseEnter:f,onMouseLeave:y,children:[c,jsxRuntime.jsx(framerMotion.AnimatePresence,{children:u&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:t==="top"?10:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:t==="top"?10:-10},transition:{type:"spring",stiffness:300,damping:25},className:o("absolute z-50 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl shadow-xl backdrop-blur-sm",b,x()),children:[jsxRuntime.jsxs("div",{className:"p-4 space-y-2",children:[(a||i)&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},transition:{delay:.1},className:"flex items-center gap-2",children:[i&&jsxRuntime.jsx("div",{className:"text-blue-500",children:i}),a&&jsxRuntime.jsx("h3",{className:"font-semibold text-zinc-900 dark:text-zinc-100 text-sm",children:a})]}),jsxRuntime.jsx(framerMotion.motion.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.15},className:"text-sm text-zinc-600 dark:text-zinc-400 leading-relaxed",children:d})]}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:"absolute inset-0 bg-gradient-to-br from-blue-500/5 to-purple-500/5 rounded-xl pointer-events-none"}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,type:"spring",stiffness:400},className:o("absolute w-0 h-0 border-8",t==="top"&&"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent border-t-white dark:border-t-zinc-900",t==="bottom"&&"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent border-b-white dark:border-b-zinc-900",t==="left"&&"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent border-l-white dark:border-l-zinc-900",t==="right"&&"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent border-r-white dark:border-r-zinc-900")}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.05,duration:.4},className:"absolute inset-0 rounded-xl border border-blue-500/20 pointer-events-none"})]})})]})}var M=w;exports.TooltipRich=w;exports.default=M;//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/tooltip-rich/index.tsx"],"names":["cn","inputs","twMerge","clsx","TooltipRich","title","content","icon","children","position","delay","maxWidth","className","isVisible","setIsVisible","useState","timeoutRef","useRef","showTooltip","hideTooltip","getPositionClasses","jsxs","jsx","AnimatePresence","motion","tooltip_rich_default"],"mappings":"4OAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAAsB,CAC1C,OAAOC,qBAAAA,CAAQC,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCYO,SAASG,CAAAA,CAAY,CAC1B,KAAA,CAAAC,CAAAA,CACA,QAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,EACA,QAAA,CAAAC,CAAAA,CAAW,MACX,KAAA,CAAAC,CAAAA,CAAQ,IACR,QAAA,CAAAC,CAAAA,CAAW,WACX,SAAA,CAAAC,CACF,EAAqB,CACnB,GAAM,CA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D,SAAA,CAAWxB,CAAAA,CACT,4BACAS,CAAAA,GAAa,KAAA,EAAS,yIAAA,CACtBA,CAAAA,GAAa,UAAY,4IAAA,CACzBA,CAAAA,GAAa,QAAU,yIAAA,CACvBA,CAAAA,GAAa,SAAW,0IAC1B,CAAA,CACF,EACAa,cAAAA,CAACE,mBAAAA,CAAO,IAAP,CAAW,OAAA,CAAS,CAAE,OAAA,CAAS,CAAA,CAAG,MAAO,EAAI,CAAA,CAAG,QAAS,CAAE,OAAA,CAAS,EAAG,KAAA,CAAO,CAAE,EAAG,UAAA,CAAY,CAAE,MAAO,GAAA,CAAM,QAAA,CAAU,EAAI,CAAA,CAAG,SAAA,CAAU,4EAA4E,CAAA,CAAA,CACxN,CAAA,CAEJ,GACF,CAEJ,KAEOC,CAAAA,CAAQrB","file":"index.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}\r\n","\"use client\";\r\n\r\nimport { useState, useRef } from \"react\";\r\nimport { motion, AnimatePresence } from \"framer-motion\";\r\nimport { cn } from \"../utils/cn\";\r\n\r\nexport interface TooltipRichProps {\r\n title?: string;\r\n content: string;\r\n icon?: React.ReactNode;\r\n children: React.ReactNode;\r\n position?: \"top\" | \"bottom\" | \"left\" | \"right\";\r\n delay?: number;\r\n maxWidth?: string;\r\n className?: string;\r\n}\r\n\r\nexport function TooltipRich({\r\n title,\r\n content,\r\n icon,\r\n children,\r\n position = \"top\",\r\n delay = 300,\r\n maxWidth = \"max-w-xs\",\r\n className,\r\n}: TooltipRichProps) {\r\n const [isVisible, setIsVisible] = useState(false);\r\n const timeoutRef = useRef<NodeJS.Timeout>(undefined);\r\n\r\n const showTooltip = () => {\r\n timeoutRef.current = setTimeout(() => setIsVisible(true), delay);\r\n };\r\n\r\n const hideTooltip = () => {\r\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\r\n setIsVisible(false);\r\n };\r\n\r\n const getPositionClasses = () => {\r\n switch (position) {\r\n case \"top\": return \"bottom-full left-1/2 -translate-x-1/2 mb-3\";\r\n case \"bottom\": return \"top-full left-1/2 -translate-x-1/2 mt-3\";\r\n case \"left\": return \"right-full top-1/2 -translate-y-1/2 mr-3\";\r\n case \"right\": return \"left-full top-1/2 -translate-y-1/2 ml-3\";\r\n default: return \"bottom-full left-1/2 -translate-x-1/2 mb-3\";\r\n }\r\n };\r\n\r\n return (\r\n <div className={cn(\"relative inline-block\", className)} onMouseEnter={showTooltip} onMouseLeave={hideTooltip}>\r\n {children}\r\n <AnimatePresence>\r\n {isVisible && (\r\n <motion.div\r\n initial={{ opacity: 0, scale: 0.95, y: position === \"top\" ? 10 : -10 }}\r\n animate={{ opacity: 1, scale: 1, y: 0 }}\r\n exit={{ opacity: 0, scale: 0.95, y: position === \"top\" ? 10 : -10 }}\r\n transition={{ type: \"spring\", stiffness: 300, damping: 25 }}\r\n\r\n className={cn(\"absolute z-50 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl shadow-xl backdrop-blur-sm\", maxWidth, getPositionClasses())}\r\n >\r\n <div className=\"p-4 space-y-2\">\r\n {(title || icon) && (\r\n <motion.div initial={{ opacity: 0, y: -5 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: 0.1 }} className=\"flex items-center gap-2\">\r\n {icon && <div className=\"text-blue-500\">{icon}</div>}\r\n {title && <h3 className=\"font-semibold text-zinc-900 dark:text-zinc-100 text-sm\">{title}</h3>}\r\n </motion.div>\r\n )}\r\n <motion.p initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ delay: 0.15 }} className=\"text-sm text-zinc-600 dark:text-zinc-400 leading-relaxed\">\r\n {content}\r\n </motion.p>\r\n </div>\r\n <motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ delay: 0.2 }} className=\"absolute inset-0 bg-gradient-to-br from-blue-500/5 to-purple-500/5 rounded-xl pointer-events-none\" />\r\n <motion.div\r\n initial={{ scale: 0 }}\r\n animate={{ scale: 1 }}\r\n transition={{ delay: 0.1, type: \"spring\", stiffness: 400 }}\r\n className={cn(\r\n \"absolute w-0 h-0 border-8\",\r\n position === \"top\" && \"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent border-t-white dark:border-t-zinc-900\",\r\n position === \"bottom\" && \"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent border-b-white dark:border-b-zinc-900\",\r\n position === \"left\" && \"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent border-l-white dark:border-l-zinc-900\",\r\n position === \"right\" && \"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent border-r-white dark:border-r-zinc-900\"\r\n )}\r\n />\r\n <motion.div initial={{ opacity: 0, scale: 0.8 }} animate={{ opacity: 1, scale: 1 }} transition={{ delay: 0.05, duration: 0.4 }} className=\"absolute inset-0 rounded-xl border border-blue-500/20 pointer-events-none\" />\r\n </motion.div>\r\n )}\r\n </AnimatePresence>\r\n </div>\r\n );\r\n}\r\n\r\nexport default TooltipRich;\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {useState,useRef}from'react';import {AnimatePresence,motion}from'framer-motion';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';function o(...a){return twMerge(clsx(a))}function w({title:a,content:d,icon:i,children:c,position:t="top",delay:p=300,maxWidth:b="max-w-xs",className:m}){let[u,l]=useState(false),s=useRef(void 0),f=()=>{s.current=setTimeout(()=>l(true),p);},y=()=>{s.current&&clearTimeout(s.current),l(false);},x=()=>{switch(t){case "top":return "bottom-full left-1/2 -translate-x-1/2 mb-3";case "bottom":return "top-full left-1/2 -translate-x-1/2 mt-3";case "left":return "right-full top-1/2 -translate-y-1/2 mr-3";case "right":return "left-full top-1/2 -translate-y-1/2 ml-3";default:return "bottom-full left-1/2 -translate-x-1/2 mb-3"}};return jsxs("div",{className:o("relative inline-block",m),onMouseEnter:f,onMouseLeave:y,children:[c,jsx(AnimatePresence,{children:u&&jsxs(motion.div,{initial:{opacity:0,scale:.95,y:t==="top"?10:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:t==="top"?10:-10},transition:{type:"spring",stiffness:300,damping:25},className:o("absolute z-50 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl shadow-xl backdrop-blur-sm",b,x()),children:[jsxs("div",{className:"p-4 space-y-2",children:[(a||i)&&jsxs(motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},transition:{delay:.1},className:"flex items-center gap-2",children:[i&&jsx("div",{className:"text-blue-500",children:i}),a&&jsx("h3",{className:"font-semibold text-zinc-900 dark:text-zinc-100 text-sm",children:a})]}),jsx(motion.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.15},className:"text-sm text-zinc-600 dark:text-zinc-400 leading-relaxed",children:d})]}),jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:"absolute inset-0 bg-gradient-to-br from-blue-500/5 to-purple-500/5 rounded-xl pointer-events-none"}),jsx(motion.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,type:"spring",stiffness:400},className:o("absolute w-0 h-0 border-8",t==="top"&&"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent border-t-white dark:border-t-zinc-900",t==="bottom"&&"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent border-b-white dark:border-b-zinc-900",t==="left"&&"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent border-l-white dark:border-l-zinc-900",t==="right"&&"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent border-r-white dark:border-r-zinc-900")}),jsx(motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.05,duration:.4},className:"absolute inset-0 rounded-xl border border-blue-500/20 pointer-events-none"})]})})]})}var M=w;export{w as TooltipRich,M as default};//# sourceMappingURL=index.mjs.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/tooltip-rich/index.tsx"],"names":["cn","inputs","twMerge","clsx","TooltipRich","title","content","icon","children","position","delay","maxWidth","className","isVisible","setIsVisible","useState","timeoutRef","useRef","showTooltip","hideTooltip","getPositionClasses","jsxs","jsx","AnimatePresence","motion","tooltip_rich_default"],"mappings":"6LAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAAsB,CAC1C,OAAOC,OAAAA,CAAQC,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCYO,SAASG,CAAAA,CAAY,CAC1B,KAAA,CAAAC,CAAAA,CACA,QAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,EACA,QAAA,CAAAC,CAAAA,CAAW,MACX,KAAA,CAAAC,CAAAA,CAAQ,IACR,QAAA,CAAAC,CAAAA,CAAW,WACX,SAAA,CAAAC,CACF,EAAqB,CACnB,GAAM,CAACC,CAAAA,CAAWC,CAAY,EAAIC,QAAAA,CAAS,KAAK,EAC1CC,CAAAA,CAAaC,MAAAA,CAAuB,MAAS,CAAA,CAE7CC,CAAAA,CAAc,IAAM,CACxBF,CAAAA,CAAW,QAAU,UAAA,CAAW,IAAMF,EAAa,IAAI,CAAA,CAAGJ,CAAK,EACjE,CAAA,CAEMS,EAAc,IAAM,CACpBH,EAAW,OAAA,EAAS,YAAA,CAAaA,CAAAA,CAAW,OAAO,EACvDF,CAAAA,CAAa,KAAK,EACpB,CAAA,CAEMM,CAAAA,CAAqB,IAAM,CAC/B,OAAQX,GACN,KAAK,MAAO,OAAO,4CAAA,CACnB,KAAK,QAAA,CAAU,OAAO,0CACtB,KAAK,MAAA,CAAQ,OAAO,0CAAA,CACpB,KAAK,OAAA,CAAS,OAAO,0CACrB,QAAS,OAAO,4CAClB,CACF,C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r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}\r\n","\"use client\";\r\n\r\nimport { useState, useRef } from \"react\";\r\nimport { motion, AnimatePresence } from \"framer-motion\";\r\nimport { cn } from \"../utils/cn\";\r\n\r\nexport interface TooltipRichProps {\r\n title?: string;\r\n content: string;\r\n icon?: React.ReactNode;\r\n children: React.ReactNode;\r\n position?: \"top\" | \"bottom\" | \"left\" | \"right\";\r\n delay?: number;\r\n maxWidth?: string;\r\n className?: string;\r\n}\r\n\r\nexport function TooltipRich({\r\n title,\r\n content,\r\n icon,\r\n children,\r\n position = \"top\",\r\n delay = 300,\r\n maxWidth = \"max-w-xs\",\r\n className,\r\n}: TooltipRichProps) {\r\n const [isVisible, setIsVisible] = useState(false);\r\n const timeoutRef = useRef<NodeJS.Timeout>(undefined);\r\n\r\n const showTooltip = () => {\r\n timeoutRef.current = setTimeout(() => setIsVisible(true), delay);\r\n };\r\n\r\n const hideTooltip = () => {\r\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\r\n setIsVisible(false);\r\n };\r\n\r\n const getPositionClasses = () => {\r\n switch (position) {\r\n case \"top\": return \"bottom-full left-1/2 -translate-x-1/2 mb-3\";\r\n case \"bottom\": return \"top-full left-1/2 -translate-x-1/2 mt-3\";\r\n case \"left\": return \"right-full top-1/2 -translate-y-1/2 mr-3\";\r\n case \"right\": return \"left-full top-1/2 -translate-y-1/2 ml-3\";\r\n default: return \"bottom-full left-1/2 -translate-x-1/2 mb-3\";\r\n }\r\n };\r\n\r\n return (\r\n <div className={cn(\"relative inline-block\", className)} onMouseEnter={showTooltip} onMouseLeave={hideTooltip}>\r\n {children}\r\n <AnimatePresence>\r\n {isVisible && (\r\n <motion.div\r\n initial={{ opacity: 0, scale: 0.95, y: position === \"top\" ? 10 : -10 }}\r\n animate={{ opacity: 1, scale: 1, y: 0 }}\r\n exit={{ opacity: 0, scale: 0.95, y: position === \"top\" ? 10 : -10 }}\r\n transition={{ type: \"spring\", stiffness: 300, damping: 25 }}\r\n\r\n className={cn(\"absolute z-50 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl shadow-xl backdrop-blur-sm\", maxWidth, getPositionClasses())}\r\n >\r\n <div className=\"p-4 space-y-2\">\r\n {(title || icon) && (\r\n <motion.div initial={{ opacity: 0, y: -5 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: 0.1 }} className=\"flex items-center gap-2\">\r\n {icon && <div className=\"text-blue-500\">{icon}</div>}\r\n {title && <h3 className=\"font-semibold text-zinc-900 dark:text-zinc-100 text-sm\">{title}</h3>}\r\n </motion.div>\r\n )}\r\n <motion.p initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ delay: 0.15 }} className=\"text-sm text-zinc-600 dark:text-zinc-400 leading-relaxed\">\r\n {content}\r\n </motion.p>\r\n </div>\r\n <motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ delay: 0.2 }} className=\"absolute inset-0 bg-gradient-to-br from-blue-500/5 to-purple-500/5 rounded-xl pointer-events-none\" />\r\n <motion.div\r\n initial={{ scale: 0 }}\r\n animate={{ scale: 1 }}\r\n transition={{ delay: 0.1, type: \"spring\", stiffness: 400 }}\r\n className={cn(\r\n \"absolute w-0 h-0 border-8\",\r\n position === \"top\" && \"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent border-t-white dark:border-t-zinc-900\",\r\n position === \"bottom\" && \"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent border-b-white dark:border-b-zinc-900\",\r\n position === \"left\" && \"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent border-l-white dark:border-l-zinc-900\",\r\n position === \"right\" && \"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent border-r-white dark:border-r-zinc-900\"\r\n )}\r\n />\r\n <motion.div initial={{ opacity: 0, scale: 0.8 }} animate={{ opacity: 1, scale: 1 }} transition={{ delay: 0.05, duration: 0.4 }} className=\"absolute inset-0 rounded-xl border border-blue-500/20 pointer-events-none\" />\r\n </motion.div>\r\n )}\r\n </AnimatePresence>\r\n </div>\r\n );\r\n}\r\n\r\nexport default TooltipRich;\r\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bynana-ui",
3
- "version": "1.7.0",
4
- "description": "150+ Beautiful React UI components built with Tailwind CSS and Framer Motion",
3
+ "version": "1.9.0",
4
+ "description": "170+ Beautiful React UI components built with Tailwind CSS and Framer Motion",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
@@ -168,6 +168,21 @@
168
168
  "./scroll-reveal": { "import": "./dist/scroll-reveal/index.mjs", "require": "./dist/scroll-reveal/index.js", "types": "./dist/scroll-reveal/index.d.ts" },
169
169
  "./scroll-float": { "import": "./dist/scroll-float/index.mjs", "require": "./dist/scroll-float/index.js", "types": "./dist/scroll-float/index.d.ts" },
170
170
  "./scroll-stack": { "import": "./dist/scroll-stack/index.mjs", "require": "./dist/scroll-stack/index.js", "types": "./dist/scroll-stack/index.d.ts" },
171
+ "./magnet": { "import": "./dist/magnet/index.mjs", "require": "./dist/magnet/index.js", "types": "./dist/magnet/index.d.ts" },
172
+ "./text-type": { "import": "./dist/text-type/index.mjs", "require": "./dist/text-type/index.js", "types": "./dist/text-type/index.d.ts" },
173
+ "./ai-voice": { "import": "./dist/ai-voice/index.mjs", "require": "./dist/ai-voice/index.js", "types": "./dist/ai-voice/index.d.ts" },
174
+ "./folder": { "import": "./dist/folder/index.mjs", "require": "./dist/folder/index.js", "types": "./dist/folder/index.d.ts" },
175
+ "./testimonials-stars": { "import": "./dist/testimonials-stars/index.mjs", "require": "./dist/testimonials-stars/index.js", "types": "./dist/testimonials-stars/index.d.ts" },
176
+ "./logo-loop": { "import": "./dist/logo-loop/index.mjs", "require": "./dist/logo-loop/index.js", "types": "./dist/logo-loop/index.d.ts" },
177
+ "./floating-paths": { "import": "./dist/floating-paths/index.mjs", "require": "./dist/floating-paths/index.js", "types": "./dist/floating-paths/index.d.ts" },
178
+ "./background-paths": { "import": "./dist/background-paths/index.mjs", "require": "./dist/background-paths/index.js", "types": "./dist/background-paths/index.d.ts" },
179
+ "./team-selector": { "import": "./dist/team-selector/index.mjs", "require": "./dist/team-selector/index.js", "types": "./dist/team-selector/index.d.ts" },
180
+ "./ai-text-loading": { "import": "./dist/ai-text-loading/index.mjs", "require": "./dist/ai-text-loading/index.js", "types": "./dist/ai-text-loading/index.d.ts" },
181
+ "./tooltip-interactive": { "import": "./dist/tooltip-interactive/index.mjs", "require": "./dist/tooltip-interactive/index.js", "types": "./dist/tooltip-interactive/index.d.ts" },
182
+ "./tooltip-magnetic": { "import": "./dist/tooltip-magnetic/index.mjs", "require": "./dist/tooltip-magnetic/index.js", "types": "./dist/tooltip-magnetic/index.d.ts" },
183
+ "./tooltip-rich": { "import": "./dist/tooltip-rich/index.mjs", "require": "./dist/tooltip-rich/index.js", "types": "./dist/tooltip-rich/index.d.ts" },
184
+ "./magnet-lines": { "import": "./dist/magnet-lines/index.mjs", "require": "./dist/magnet-lines/index.js", "types": "./dist/magnet-lines/index.d.ts" },
185
+ "./glare-hover": { "import": "./dist/glare-hover/index.mjs", "require": "./dist/glare-hover/index.js", "types": "./dist/glare-hover/index.d.ts" },
171
186
  "./styles.css": "./dist/styles.css"
172
187
  },
173
188
  "files": ["dist", "README.md"],