bynana-ui 1.6.2 → 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 (161) hide show
  1. package/dist/action-search-bar/index.js +17 -0
  2. package/dist/action-search-bar/index.js.map +1 -0
  3. package/dist/action-search-bar/index.mjs +17 -0
  4. package/dist/action-search-bar/index.mjs.map +1 -0
  5. package/dist/ai-bar/index.js +19 -0
  6. package/dist/ai-bar/index.js.map +1 -0
  7. package/dist/ai-bar/index.mjs +19 -0
  8. package/dist/ai-bar/index.mjs.map +1 -0
  9. package/dist/ai-loading/index.js +2 -0
  10. package/dist/ai-loading/index.js.map +1 -0
  11. package/dist/ai-loading/index.mjs +2 -0
  12. package/dist/ai-loading/index.mjs.map +1 -0
  13. package/dist/ai-prompt/index.js +17 -0
  14. package/dist/ai-prompt/index.js.map +1 -0
  15. package/dist/ai-prompt/index.mjs +17 -0
  16. package/dist/ai-prompt/index.mjs.map +1 -0
  17. package/dist/ai-text-loading/index.js +2 -0
  18. package/dist/ai-text-loading/index.js.map +1 -0
  19. package/dist/ai-text-loading/index.mjs +2 -0
  20. package/dist/ai-text-loading/index.mjs.map +1 -0
  21. package/dist/ai-voice/index.js +3 -0
  22. package/dist/ai-voice/index.js.map +1 -0
  23. package/dist/ai-voice/index.mjs +3 -0
  24. package/dist/ai-voice/index.mjs.map +1 -0
  25. package/dist/aurora/index.js +2 -0
  26. package/dist/aurora/index.js.map +1 -0
  27. package/dist/aurora/index.mjs +2 -0
  28. package/dist/aurora/index.mjs.map +1 -0
  29. package/dist/background-paths/index.js +2 -0
  30. package/dist/background-paths/index.js.map +1 -0
  31. package/dist/background-paths/index.mjs +2 -0
  32. package/dist/background-paths/index.mjs.map +1 -0
  33. package/dist/elastic-search/index.js +17 -0
  34. package/dist/elastic-search/index.js.map +1 -0
  35. package/dist/elastic-search/index.mjs +17 -0
  36. package/dist/elastic-search/index.mjs.map +1 -0
  37. package/dist/faqs-accordion/index.js +16 -0
  38. package/dist/faqs-accordion/index.js.map +1 -0
  39. package/dist/faqs-accordion/index.mjs +16 -0
  40. package/dist/faqs-accordion/index.mjs.map +1 -0
  41. package/dist/faqs-grid/index.js +2 -0
  42. package/dist/faqs-grid/index.js.map +1 -0
  43. package/dist/faqs-grid/index.mjs +2 -0
  44. package/dist/faqs-grid/index.mjs.map +1 -0
  45. package/dist/floating-paths/index.js +2 -0
  46. package/dist/floating-paths/index.js.map +1 -0
  47. package/dist/floating-paths/index.mjs +2 -0
  48. package/dist/floating-paths/index.mjs.map +1 -0
  49. package/dist/folder/index.js +2 -0
  50. package/dist/folder/index.js.map +1 -0
  51. package/dist/folder/index.mjs +2 -0
  52. package/dist/folder/index.mjs.map +1 -0
  53. package/dist/footer-complex/index.js +2 -0
  54. package/dist/footer-complex/index.js.map +1 -0
  55. package/dist/footer-complex/index.mjs +2 -0
  56. package/dist/footer-complex/index.mjs.map +1 -0
  57. package/dist/footer-simple/index.js +2 -0
  58. package/dist/footer-simple/index.js.map +1 -0
  59. package/dist/footer-simple/index.mjs +2 -0
  60. package/dist/footer-simple/index.mjs.map +1 -0
  61. package/dist/glare-hover/index.js +32 -0
  62. package/dist/glare-hover/index.js.map +1 -0
  63. package/dist/glare-hover/index.mjs +32 -0
  64. package/dist/glare-hover/index.mjs.map +1 -0
  65. package/dist/hero-grid/index.js +16 -0
  66. package/dist/hero-grid/index.js.map +1 -0
  67. package/dist/hero-grid/index.mjs +16 -0
  68. package/dist/hero-grid/index.mjs.map +1 -0
  69. package/dist/hero-showcase/index.js +17 -0
  70. package/dist/hero-showcase/index.js.map +1 -0
  71. package/dist/hero-showcase/index.mjs +17 -0
  72. package/dist/hero-showcase/index.mjs.map +1 -0
  73. package/dist/index.js +85 -13
  74. package/dist/index.js.map +1 -1
  75. package/dist/index.mjs +85 -13
  76. package/dist/index.mjs.map +1 -1
  77. package/dist/job-listing/index.js +19 -0
  78. package/dist/job-listing/index.js.map +1 -0
  79. package/dist/job-listing/index.mjs +19 -0
  80. package/dist/job-listing/index.mjs.map +1 -0
  81. package/dist/logo-cloud/index.js +14 -0
  82. package/dist/logo-cloud/index.js.map +1 -0
  83. package/dist/logo-cloud/index.mjs +14 -0
  84. package/dist/logo-cloud/index.mjs.map +1 -0
  85. package/dist/logo-loop/index.js +2 -0
  86. package/dist/logo-loop/index.js.map +1 -0
  87. package/dist/logo-loop/index.mjs +2 -0
  88. package/dist/logo-loop/index.mjs.map +1 -0
  89. package/dist/magnet/index.js +2 -0
  90. package/dist/magnet/index.js.map +1 -0
  91. package/dist/magnet/index.mjs +2 -0
  92. package/dist/magnet/index.mjs.map +1 -0
  93. package/dist/magnet-lines/index.js +2 -0
  94. package/dist/magnet-lines/index.js.map +1 -0
  95. package/dist/magnet-lines/index.mjs +2 -0
  96. package/dist/magnet-lines/index.mjs.map +1 -0
  97. package/dist/pricing-modern/index.js +16 -0
  98. package/dist/pricing-modern/index.js.map +1 -0
  99. package/dist/pricing-modern/index.mjs +16 -0
  100. package/dist/pricing-modern/index.mjs.map +1 -0
  101. package/dist/scroll-float/index.js +2 -0
  102. package/dist/scroll-float/index.js.map +1 -0
  103. package/dist/scroll-float/index.mjs +2 -0
  104. package/dist/scroll-float/index.mjs.map +1 -0
  105. package/dist/scroll-reveal/index.js +2 -0
  106. package/dist/scroll-reveal/index.js.map +1 -0
  107. package/dist/scroll-reveal/index.mjs +2 -0
  108. package/dist/scroll-reveal/index.mjs.map +1 -0
  109. package/dist/scroll-stack/index.js +2 -0
  110. package/dist/scroll-stack/index.js.map +1 -0
  111. package/dist/scroll-stack/index.mjs +2 -0
  112. package/dist/scroll-stack/index.mjs.map +1 -0
  113. package/dist/squares/index.js +2 -0
  114. package/dist/squares/index.js.map +1 -0
  115. package/dist/squares/index.mjs +2 -0
  116. package/dist/squares/index.mjs.map +1 -0
  117. package/dist/team-carousel/index.js +17 -0
  118. package/dist/team-carousel/index.js.map +1 -0
  119. package/dist/team-carousel/index.mjs +17 -0
  120. package/dist/team-carousel/index.mjs.map +1 -0
  121. package/dist/team-selector/index.js +3 -0
  122. package/dist/team-selector/index.js.map +1 -0
  123. package/dist/team-selector/index.mjs +3 -0
  124. package/dist/team-selector/index.mjs.map +1 -0
  125. package/dist/testimonials-grid/index.js +17 -0
  126. package/dist/testimonials-grid/index.js.map +1 -0
  127. package/dist/testimonials-grid/index.mjs +17 -0
  128. package/dist/testimonials-grid/index.mjs.map +1 -0
  129. package/dist/testimonials-simple/index.js +3 -0
  130. package/dist/testimonials-simple/index.js.map +1 -0
  131. package/dist/testimonials-simple/index.mjs +3 -0
  132. package/dist/testimonials-simple/index.mjs.map +1 -0
  133. package/dist/testimonials-stars/index.js +3 -0
  134. package/dist/testimonials-stars/index.js.map +1 -0
  135. package/dist/testimonials-stars/index.mjs +3 -0
  136. package/dist/testimonials-stars/index.mjs.map +1 -0
  137. package/dist/text-type/index.js +2 -0
  138. package/dist/text-type/index.js.map +1 -0
  139. package/dist/text-type/index.mjs +2 -0
  140. package/dist/text-type/index.mjs.map +1 -0
  141. package/dist/threads/index.js +2 -0
  142. package/dist/threads/index.js.map +1 -0
  143. package/dist/threads/index.mjs +2 -0
  144. package/dist/threads/index.mjs.map +1 -0
  145. package/dist/tooltip-interactive/index.js +2 -0
  146. package/dist/tooltip-interactive/index.js.map +1 -0
  147. package/dist/tooltip-interactive/index.mjs +2 -0
  148. package/dist/tooltip-interactive/index.mjs.map +1 -0
  149. package/dist/tooltip-magnetic/index.js +2 -0
  150. package/dist/tooltip-magnetic/index.js.map +1 -0
  151. package/dist/tooltip-magnetic/index.mjs +2 -0
  152. package/dist/tooltip-magnetic/index.mjs.map +1 -0
  153. package/dist/tooltip-rich/index.js +2 -0
  154. package/dist/tooltip-rich/index.js.map +1 -0
  155. package/dist/tooltip-rich/index.mjs +2 -0
  156. package/dist/tooltip-rich/index.mjs.map +1 -0
  157. package/dist/waves/index.js +2 -0
  158. package/dist/waves/index.js.map +1 -0
  159. package/dist/waves/index.mjs +2 -0
  160. package/dist/waves/index.mjs.map +1 -0
  161. package/package.json +41 -2
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../node_modules/shared/src/utils.ts","../../../../node_modules/lucide-react/src/defaultAttributes.ts","../../../../node_modules/lucide-react/src/Icon.ts","../../../../node_modules/lucide-react/src/createLucideIcon.ts","../../../../node_modules/lucide-react/src/icons/chevron-left.ts","../../../../node_modules/lucide-react/src/icons/chevron-right.ts","../../src/testimonials-grid/index.tsx"],"names":["toKebabCase","string","toCamelCase","match","p1","p2","toPascalCase","camelCase","mergeClasses","classes","className","index","array","hasA11yProp","props","prop","defaultAttributes","Icon","forwardRef","color","size","strokeWidth","absoluteStrokeWidth","children","iconNode","rest","ref","createElement","tag","attrs","createLucideIcon","iconName","Component","__iconNode","ChevronLeft","ChevronRight","TestimonialsGrid","title","description","testimonials","autoplay","active","setActive","useState","handleNext","useCallback","prev","handlePrev","useEffect","interval","jsx","jsxs","testimonial","testimonials_grid_default"],"mappings":"qHAQO,IAAMA,CAAAA,CAAeC,CAAAA,EAC1BA,CAAAA,CAAO,OAAA,CAAQ,qBAAsB,OAAO,CAAA,CAAE,WAAA,EAAA,CAQnCC,CAAAA,CAAiCD,CAAAA,EAC5CA,CAAAA,CAAO,OAAA,CAAQ,wBAAyB,CAACE,CAAAA,CAAOC,CAAAA,CAAIC,CAAAA,GAClDA,CAAAA,CAAKA,CAAAA,CAAG,WAAA,EAAA,CAAgBD,EAAG,WAAA,EAC7B,CAAA,CAQWE,CAAAA,CAAkCL,CAAAA,EAAgC,CAC7E,IAAMM,CAAAA,CAAYL,EAAYD,CAAM,CAAA,CAEpC,OAAQM,CAAAA,CAAU,MAAA,CAAO,CAAC,CAAA,CAAE,WAAA,GAAgBA,CAAAA,CAAU,KAAA,CAAM,CAAC,CAC/D,CAAA,CAQaC,CAAAA,CAAe,CAAA,GAA2CC,CAAAA,GACrEA,EACG,MAAA,CAAO,CAACC,CAAAA,CAAWC,CAAAA,CAAOC,IAEvB,CAAA,CAAQF,CAAAA,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A,CAAAD,IAAC,GAAA,CAAA,CAAE,SAAA,CAAU,cAAA,CAAgB,QAAA,CAAAE,CAAAA,CAAY,OAAA,CAAQ,CAAA,CACjDD,IAAAA,CAAC,OAAI,SAAA,CAAU,yBAAA,CACb,QAAA,CAAA,CAAAD,GAAAA,CAAC,OACC,GAAA,CAAKE,CAAAA,CAAY,MAAA,CACjB,GAAA,CAAKA,EAAY,IAAA,CACjB,SAAA,CAAU,yCAAA,CACZ,CAAA,CACAD,IAAAA,CAAC,KAAA,CAAA,CACC,QAAA,CAAA,CAAAD,GAAAA,CAAC,OAAI,SAAA,CAAU,eAAA,CAAiB,QAAA,CAAAE,CAAAA,CAAY,IAAA,CAAK,CAAA,CACjDF,GAAAA,CAAC,MAAA,CAAA,CAAK,UAAU,+BAAA,CAAiC,QAAA,CAAAE,CAAAA,CAAY,IAAA,CAAK,CAAA,CAAA,CACpE,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAlBKA,EAAY,IAmBnB,CACD,CAAA,CACH,CAAA,CAAA,CACF,GACF,CAAA,CACF,CAAA,CACF,CAEJ,KAEOC,CAAAA,CAAQjB","file":"index.mjs","sourcesContent":["import { CamelToPascal } from './utility-types';\n\n/**\n * Converts string to kebab case\n *\n * @param {string} string\n * @returns {string} A kebabized string\n */\nexport const toKebabCase = (string: string) =>\n string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Converts string to camel case\n *\n * @param {string} string\n * @returns {string} A camelized string\n */\nexport const toCamelCase = <T extends string>(string: T) =>\n string.replace(/^([A-Z])|[\\s-_]+(\\w)/g, (match, p1, p2) =>\n p2 ? p2.toUpperCase() : p1.toLowerCase(),\n );\n\n/**\n * Converts string to pascal case\n *\n * @param {string} string\n * @returns {string} A pascalized string\n */\nexport const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {\n const camelCase = toCamelCase(string);\n\n return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;\n};\n\n/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = <ClassType = string | undefined | null>(...classes: ClassType[]) =>\n classes\n .filter((className, index, array) => {\n return (\n Boolean(className) &&\n (className as string).trim() !== '' &&\n array.indexOf(className) === index\n );\n })\n .join(' ')\n .trim();\n\n/**\n * Is empty string\n *\n * @param {unknown} value\n * @returns {boolean} Whether the value is an empty string\n */\nexport const isEmptyString = (value: unknown): boolean => value === '';\n\n/**\n * Check if a component has an accessibility prop\n *\n * @param {object} props\n * @returns {boolean} Whether the component has an accessibility prop\n */\nexport const hasA11yProp = (props: Record<string, any>) => {\n for (const prop in props) {\n if (prop.startsWith('aria-') || prop === 'role' || prop === 'title') {\n return true;\n }\n }\n};\n","export default {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n};\n","import { createElement, forwardRef } from 'react';\nimport defaultAttributes from './defaultAttributes';\nimport { IconNode, LucideProps } from './types';\nimport { mergeClasses, hasA11yProp } from '@lucide/shared';\n\ninterface IconComponentProps extends LucideProps {\n iconNode: IconNode;\n}\n\n/**\n * Lucide icon component\n *\n * @component Icon\n * @param {object} props\n * @param {string} props.color - The color of the icon\n * @param {number} props.size - The size of the icon\n * @param {number} props.strokeWidth - The stroke width of the icon\n * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width\n * @param {string} props.className - The class name of the icon\n * @param {IconNode} props.children - The children of the icon\n * @param {IconNode} props.iconNode - The icon node of the icon\n *\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst Icon = forwardRef<SVGSVGElement, IconComponentProps>(\n (\n {\n color = 'currentColor',\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = '',\n children,\n iconNode,\n ...rest\n },\n ref,\n ) =>\n createElement(\n 'svg',\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? (Number(strokeWidth) * 24) / Number(size) : strokeWidth,\n className: mergeClasses('lucide', className),\n ...(!children && !hasA11yProp(rest) && { 'aria-hidden': 'true' }),\n ...rest,\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n ),\n);\n\nexport default Icon;\n","import { createElement, forwardRef } from 'react';\nimport { mergeClasses, toKebabCase, toPascalCase } from '@lucide/shared';\nimport { IconNode, LucideProps } from './types';\nimport Icon from './Icon';\n\n/**\n * Create a Lucide icon component\n * @param {string} iconName\n * @param {array} iconNode\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst createLucideIcon = (iconName: string, iconNode: IconNode) => {\n const Component = forwardRef<SVGSVGElement, LucideProps>(({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(\n `lucide-${toKebabCase(toPascalCase(iconName))}`,\n `lucide-${iconName}`,\n className,\n ),\n ...props,\n }),\n );\n\n Component.displayName = toPascalCase(iconName);\n\n return Component;\n};\n\nexport default createLucideIcon;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [['path', { d: 'm15 18-6-6 6-6', key: '1wnfg3' }]];\n\n/**\n * @component @name ChevronLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTUgMTgtNi02IDYtNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/chevron-left\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChevronLeft = createLucideIcon('chevron-left', __iconNode);\n\nexport default ChevronLeft;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [['path', { d: 'm9 18 6-6-6-6', key: 'mthhwq' }]];\n\n/**\n * @component @name ChevronRight\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtOSAxOCA2LTYtNi02IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/chevron-right\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChevronRight = createLucideIcon('chevron-right', __iconNode);\n\nexport default ChevronRight;\n","\"use client\";\r\n\r\nimport { useCallback, useEffect, useState } from \"react\";\r\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\r\n\r\ninterface Testimonial {\r\n content: string;\r\n avatar: string;\r\n name: string;\r\n role: string;\r\n}\r\n\r\ninterface TestimonialsGridProps {\r\n title?: string;\r\n description?: string;\r\n testimonials?: Testimonial[];\r\n autoplay?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function TestimonialsGrid({\r\n title = \"What Developers Say\",\r\n description = \"See what developers are saying about their experience.\",\r\n testimonials = [\r\n {\r\n content: \"This has revolutionized how we build user interfaces.\",\r\n avatar: \"https://i.pravatar.cc/150?img=1\",\r\n name: \"Eduardo Calvo\",\r\n role: \"CEO & Founder\",\r\n },\r\n {\r\n content: \"The design system is incredibly well thought out.\",\r\n avatar: \"https://i.pravatar.cc/150?img=2\",\r\n name: \"Drew Cano\",\r\n role: \"Head of Design\",\r\n },\r\n {\r\n content: \"Best UI library I've used. Excellent TypeScript support.\",\r\n avatar: \"https://i.pravatar.cc/150?img=3\",\r\n name: \"Marcus Johnson\",\r\n role: \"Lead Developer\",\r\n },\r\n ],\r\n autoplay = false,\r\n className = \"\",\r\n}: TestimonialsGridProps) {\r\n const [active, setActive] = useState(0);\r\n\r\n const handleNext = useCallback(() => {\r\n setActive((prev) => (prev + 1) % testimonials.length);\r\n }, [testimonials.length]);\r\n\r\n const handlePrev = () => {\r\n setActive((prev) => (prev - 1 + testimonials.length) % testimonials.length);\r\n };\r\n\r\n useEffect(() => {\r\n if (autoplay) {\r\n const interval = setInterval(handleNext, 5000);\r\n return () => clearInterval(interval);\r\n }\r\n }, [autoplay, handleNext]);\r\n\r\n return (\r\n <div className={`py-24 ${className}`}>\r\n <div className=\"container mx-auto max-w-6xl px-6\">\r\n <div className=\"grid grid-cols-1 gap-8 lg:grid-cols-2 lg:gap-12\">\r\n <div className=\"flex flex-col justify-center\">\r\n <h2 className=\"mb-4 text-4xl font-semibold\">{title}</h2>\r\n <p className=\"text-muted-foreground text-lg\">{description}</p>\r\n </div>\r\n\r\n <div className=\"relative flex flex-col items-end\">\r\n <div className=\"mb-4 flex gap-2\">\r\n <button\r\n onClick={handlePrev}\r\n className=\"flex h-8 w-8 items-center justify-center rounded-full border hover:bg-accent\"\r\n >\r\n <ChevronLeft className=\"h-5 w-5\" />\r\n </button>\r\n <button\r\n onClick={handleNext}\r\n className=\"flex h-8 w-8 items-center justify-center rounded-full border hover:bg-accent\"\r\n >\r\n <ChevronRight className=\"h-5 w-5\" />\r\n </button>\r\n </div>\r\n\r\n <div className=\"relative h-full w-full max-w-md\">\r\n {testimonials.map((testimonial, index) => (\r\n <div\r\n key={testimonial.name}\r\n className={`absolute inset-0 transition-all duration-400 ${\r\n index === active ? \"opacity-100 scale-100 z-10\" : \"opacity-0 scale-95 z-0\"\r\n }`}\r\n >\r\n <div className=\"rounded-2xl border px-6 py-6 shadow-lg\">\r\n <p className=\"mb-6 text-lg\">{testimonial.content}</p>\r\n <div className=\"flex items-center gap-3\">\r\n <img\r\n src={testimonial.avatar}\r\n alt={testimonial.name}\r\n className=\"size-8 rounded-full border object-cover\"\r\n />\r\n <div>\r\n <div className=\"font-semibold\">{testimonial.name}</div>\r\n <span className=\"text-muted-foreground text-sm\">{testimonial.role}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default TestimonialsGrid;\r\n"]}
@@ -0,0 +1,3 @@
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var react=require('react'),jsxRuntime=require('react/jsx-runtime');function v({testimonials:e=[{quote:"This has revolutionized how we build user interfaces. The animations are buttery smooth.",avatar:"https://i.pravatar.cc/150?img=1",name:"Eduardo Calvo",role:"CEO & Founder"},{quote:"The design system is incredibly well thought out. Every component feels intentional.",avatar:"https://i.pravatar.cc/150?img=2",name:"Drew Cano",role:"Head of Design"},{quote:"Best UI library I've used. The TypeScript support is excellent.",avatar:"https://i.pravatar.cc/150?img=3",name:"Marcus Johnson",role:"Lead Developer"}],duration:l=5e3,className:n=""}){let[t,m]=react.useState(0),i=react.useRef(null);return react.useEffect(()=>(i.current=setTimeout(()=>{m(o=>(o+1)%e.length);},l),()=>{i.current&&clearTimeout(i.current);}),[t,e.length,l]),jsxRuntime.jsx("div",{className:`flex flex-col items-center justify-center py-16 ${n}`,children:jsxRuntime.jsxs("div",{className:"flex w-full max-w-5xl flex-col items-center justify-center px-4",children:[jsxRuntime.jsxs("blockquote",{className:"mb-8 text-center text-2xl leading-tight font-semibold md:text-4xl transition-all duration-500",children:['"',e[t].quote,'"']}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx("img",{src:e[t].avatar,alt:e[t].name,className:"h-12 w-12 rounded-full border object-cover"}),jsxRuntime.jsx("div",{className:"border-l mx-4 h-8"}),jsxRuntime.jsxs("div",{className:"text-left",children:[jsxRuntime.jsx("div",{className:"text-lg font-medium italic",children:e[t].name}),jsxRuntime.jsx("div",{className:"text-muted-foreground text-base",children:e[t].role})]})]}),jsxRuntime.jsx("div",{className:"mx-auto mt-8 flex gap-3",children:e.map((o,s)=>jsxRuntime.jsx("span",{className:`block h-3 rounded-full transition-all duration-400 ${s===t?"w-12 bg-primary":"w-3 bg-muted"}`},s))})]})})}var p=v;
2
+ exports.TestimonialsSimple=v;exports.default=p;//# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/testimonials-simple/index.tsx"],"names":["TestimonialsSimple","testimonials","duration","className","index","setIndex","useState","timeoutRef","useRef","useEffect","prev","jsx","jsxs","_","i","testimonials_simple_default"],"mappings":"yIAiBO,SAASA,EAAmB,CACjC,YAAA,CAAAC,EAAe,CACb,CACE,KAAA,CAAO,0FAAA,CACP,MAAA,CAAQ,iCAAA,CACR,KAAM,eAAA,CACN,IAAA,CAAM,eACR,CAAA,CACA,CACE,MAAO,sFAAA,CACP,MAAA,CAAQ,iCAAA,CACR,IAAA,CAAM,WAAA,CACN,IAAA,CAAM,gBACR,CAAA,CACA,CACE,MAAO,iEAAA,CACP,MAAA,CAAQ,kCACR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AA,CAAC,OAAI,SAAA,CAAU,4BAAA,CAA8B,SAAAV,CAAAA,CAAaG,CAAK,CAAA,CAAE,IAAA,CAAK,CAAA,CACtEO,cAAAA,CAAC,OAAI,SAAA,CAAU,iCAAA,CAAmC,SAAAV,CAAAA,CAAaG,CAAK,EAAE,IAAA,CAAK,CAAA,CAAA,CAC7E,CAAA,CAAA,CACF,CAAA,CAEAO,cAAAA,CAAC,KAAA,CAAA,CAAI,UAAU,yBAAA,CACZ,QAAA,CAAAV,EAAa,GAAA,CAAI,CAACY,EAAGC,CAAAA,GACpBH,cAAAA,CAAC,MAAA,CAAA,CAEC,SAAA,CAAW,CAAA,mDAAA,EACTG,CAAAA,GAAMV,EAAQ,iBAAA,CAAoB,cACpC,CAAA,CAAA,CAAA,CAHKU,CAIP,CACD,CAAA,CACH,GACF,CAAA,CACF,CAEJ,CAEA,IAAOC,CAAAA,CAAQf","file":"index.js","sourcesContent":["\"use client\";\r\n\r\nimport { useEffect, useRef, useState } from \"react\";\r\n\r\ninterface Testimonial {\r\n quote: string;\r\n avatar: string;\r\n name: string;\r\n role: string;\r\n}\r\n\r\ninterface TestimonialsSimpleProps {\r\n testimonials?: Testimonial[];\r\n duration?: number;\r\n className?: string;\r\n}\r\n\r\nexport function TestimonialsSimple({\r\n testimonials = [\r\n {\r\n quote: \"This has revolutionized how we build user interfaces. The animations are buttery smooth.\",\r\n avatar: \"https://i.pravatar.cc/150?img=1\",\r\n name: \"Eduardo Calvo\",\r\n role: \"CEO & Founder\",\r\n },\r\n {\r\n quote: \"The design system is incredibly well thought out. Every component feels intentional.\",\r\n avatar: \"https://i.pravatar.cc/150?img=2\",\r\n name: \"Drew Cano\",\r\n role: \"Head of Design\",\r\n },\r\n {\r\n quote: \"Best UI library I've used. The TypeScript support is excellent.\",\r\n avatar: \"https://i.pravatar.cc/150?img=3\",\r\n name: \"Marcus Johnson\",\r\n role: \"Lead Developer\",\r\n },\r\n ],\r\n duration = 5000,\r\n className = \"\",\r\n}: TestimonialsSimpleProps) {\r\n const [index, setIndex] = useState(0);\r\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\r\n\r\n useEffect(() => {\r\n timeoutRef.current = setTimeout(() => {\r\n setIndex((prev) => (prev + 1) % testimonials.length);\r\n }, duration);\r\n return () => {\r\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\r\n };\r\n }, [index, testimonials.length, duration]);\r\n\r\n return (\r\n <div className={`flex flex-col items-center justify-center py-16 ${className}`}>\r\n <div className=\"flex w-full max-w-5xl flex-col items-center justify-center px-4\">\r\n <blockquote className=\"mb-8 text-center text-2xl leading-tight font-semibold md:text-4xl transition-all duration-500\">\r\n \"{testimonials[index].quote}\"\r\n </blockquote>\r\n\r\n <div className=\"flex items-center gap-4\">\r\n <img\r\n src={testimonials[index].avatar}\r\n alt={testimonials[index].name}\r\n className=\"h-12 w-12 rounded-full border object-cover\"\r\n />\r\n <div className=\"border-l mx-4 h-8\" />\r\n <div className=\"text-left\">\r\n <div className=\"text-lg font-medium italic\">{testimonials[index].name}</div>\r\n <div className=\"text-muted-foreground text-base\">{testimonials[index].role}</div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"mx-auto mt-8 flex gap-3\">\r\n {testimonials.map((_, i) => (\r\n <span\r\n key={i}\r\n className={`block h-3 rounded-full transition-all duration-400 ${\r\n i === index ? \"w-12 bg-primary\" : \"w-3 bg-muted\"\r\n }`}\r\n />\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default TestimonialsSimple;\r\n"]}
@@ -0,0 +1,3 @@
1
+ import {useState,useRef,useEffect}from'react';import {jsx,jsxs}from'react/jsx-runtime';function v({testimonials:e=[{quote:"This has revolutionized how we build user interfaces. The animations are buttery smooth.",avatar:"https://i.pravatar.cc/150?img=1",name:"Eduardo Calvo",role:"CEO & Founder"},{quote:"The design system is incredibly well thought out. Every component feels intentional.",avatar:"https://i.pravatar.cc/150?img=2",name:"Drew Cano",role:"Head of Design"},{quote:"Best UI library I've used. The TypeScript support is excellent.",avatar:"https://i.pravatar.cc/150?img=3",name:"Marcus Johnson",role:"Lead Developer"}],duration:l=5e3,className:n=""}){let[t,m]=useState(0),i=useRef(null);return useEffect(()=>(i.current=setTimeout(()=>{m(o=>(o+1)%e.length);},l),()=>{i.current&&clearTimeout(i.current);}),[t,e.length,l]),jsx("div",{className:`flex flex-col items-center justify-center py-16 ${n}`,children:jsxs("div",{className:"flex w-full max-w-5xl flex-col items-center justify-center px-4",children:[jsxs("blockquote",{className:"mb-8 text-center text-2xl leading-tight font-semibold md:text-4xl transition-all duration-500",children:['"',e[t].quote,'"']}),jsxs("div",{className:"flex items-center gap-4",children:[jsx("img",{src:e[t].avatar,alt:e[t].name,className:"h-12 w-12 rounded-full border object-cover"}),jsx("div",{className:"border-l mx-4 h-8"}),jsxs("div",{className:"text-left",children:[jsx("div",{className:"text-lg font-medium italic",children:e[t].name}),jsx("div",{className:"text-muted-foreground text-base",children:e[t].role})]})]}),jsx("div",{className:"mx-auto mt-8 flex gap-3",children:e.map((o,s)=>jsx("span",{className:`block h-3 rounded-full transition-all duration-400 ${s===t?"w-12 bg-primary":"w-3 bg-muted"}`},s))})]})})}var p=v;
2
+ export{v as TestimonialsSimple,p as default};//# sourceMappingURL=index.mjs.map
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/testimonials-simple/index.tsx"],"names":["TestimonialsSimple","testimonials","duration","className","index","setIndex","useState","timeoutRef","useRef","useEffect","prev","jsx","jsxs","_","i","testimonials_simple_default"],"mappings":"uFAiBO,SAASA,EAAmB,CACjC,YAAA,CAAAC,EAAe,CACb,CACE,KAAA,CAAO,0FAAA,CACP,MAAA,CAAQ,iCAAA,CACR,KAAM,eAAA,CACN,IAAA,CAAM,eACR,CAAA,CACA,CACE,MAAO,sFAAA,CACP,MAAA,CAAQ,iCAAA,CACR,IAAA,CAAM,WAAA,CACN,IAAA,CAAM,gBACR,CAAA,CACA,CACE,M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CAAU,YACb,QAAA,CAAA,CAAAD,GAAAA,CAAC,OAAI,SAAA,CAAU,4BAAA,CAA8B,SAAAV,CAAAA,CAAaG,CAAK,CAAA,CAAE,IAAA,CAAK,CAAA,CACtEO,GAAAA,CAAC,OAAI,SAAA,CAAU,iCAAA,CAAmC,SAAAV,CAAAA,CAAaG,CAAK,EAAE,IAAA,CAAK,CAAA,CAAA,CAC7E,CAAA,CAAA,CACF,CAAA,CAEAO,GAAAA,CAAC,KAAA,CAAA,CAAI,UAAU,yBAAA,CACZ,QAAA,CAAAV,EAAa,GAAA,CAAI,CAACY,EAAGC,CAAAA,GACpBH,GAAAA,CAAC,MAAA,CAAA,CAEC,SAAA,CAAW,CAAA,mDAAA,EACTG,CAAAA,GAAMV,EAAQ,iBAAA,CAAoB,cACpC,CAAA,CAAA,CAAA,CAHKU,CAIP,CACD,CAAA,CACH,GACF,CAAA,CACF,CAEJ,CAEA,IAAOC,CAAAA,CAAQf","file":"index.mjs","sourcesContent":["\"use client\";\r\n\r\nimport { useEffect, useRef, useState } from \"react\";\r\n\r\ninterface Testimonial {\r\n quote: string;\r\n avatar: string;\r\n name: string;\r\n role: string;\r\n}\r\n\r\ninterface TestimonialsSimpleProps {\r\n testimonials?: Testimonial[];\r\n duration?: number;\r\n className?: string;\r\n}\r\n\r\nexport function TestimonialsSimple({\r\n testimonials = [\r\n {\r\n quote: \"This has revolutionized how we build user interfaces. The animations are buttery smooth.\",\r\n avatar: \"https://i.pravatar.cc/150?img=1\",\r\n name: \"Eduardo Calvo\",\r\n role: \"CEO & Founder\",\r\n },\r\n {\r\n quote: \"The design system is incredibly well thought out. Every component feels intentional.\",\r\n avatar: \"https://i.pravatar.cc/150?img=2\",\r\n name: \"Drew Cano\",\r\n role: \"Head of Design\",\r\n },\r\n {\r\n quote: \"Best UI library I've used. The TypeScript support is excellent.\",\r\n avatar: \"https://i.pravatar.cc/150?img=3\",\r\n name: \"Marcus Johnson\",\r\n role: \"Lead Developer\",\r\n },\r\n ],\r\n duration = 5000,\r\n className = \"\",\r\n}: TestimonialsSimpleProps) {\r\n const [index, setIndex] = useState(0);\r\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\r\n\r\n useEffect(() => {\r\n timeoutRef.current = setTimeout(() => {\r\n setIndex((prev) => (prev + 1) % testimonials.length);\r\n }, duration);\r\n return () => {\r\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\r\n };\r\n }, [index, testimonials.length, duration]);\r\n\r\n return (\r\n <div className={`flex flex-col items-center justify-center py-16 ${className}`}>\r\n <div className=\"flex w-full max-w-5xl flex-col items-center justify-center px-4\">\r\n <blockquote className=\"mb-8 text-center text-2xl leading-tight font-semibold md:text-4xl transition-all duration-500\">\r\n \"{testimonials[index].quote}\"\r\n </blockquote>\r\n\r\n <div className=\"flex items-center gap-4\">\r\n <img\r\n src={testimonials[index].avatar}\r\n alt={testimonials[index].name}\r\n className=\"h-12 w-12 rounded-full border object-cover\"\r\n />\r\n <div className=\"border-l mx-4 h-8\" />\r\n <div className=\"text-left\">\r\n <div className=\"text-lg font-medium italic\">{testimonials[index].name}</div>\r\n <div className=\"text-muted-foreground text-base\">{testimonials[index].role}</div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"mx-auto mt-8 flex gap-3\">\r\n {testimonials.map((_, i) => (\r\n <span\r\n key={i}\r\n className={`block h-3 rounded-full transition-all duration-400 ${\r\n i === index ? \"w-12 bg-primary\" : \"w-3 bg-muted\"\r\n }`}\r\n />\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default TestimonialsSimple;\r\n"]}
@@ -0,0 +1,3 @@
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function n(...a){return tailwindMerge.twMerge(clsx.clsx(a))}var m=({filled:a,className:s})=>jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:a?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:jsxRuntime.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})}),p=[{content:"This UI library has revolutionized how we build user interfaces. The animations are buttery smooth and the developer experience is incredible.",avatar:"https://i.pravatar.cc/150?img=1",name:"Eduardo Calvo",role:"CEO & Founder",stars:5},{content:"The design system is incredibly well thought out. Every component feels intentional and polished.",avatar:"https://i.pravatar.cc/150?img=2",name:"Drew Cano",role:"Head of Design",stars:5},{content:"Best UI library I've used. The TypeScript support is excellent and the components are highly customizable.",avatar:"https://i.pravatar.cc/150?img=3",name:"Marcus Johnson",role:"Lead Developer",stars:5},{content:"Our users love the smooth interactions. It's made our product feel premium and professional.",avatar:"https://i.pravatar.cc/150?img=4",name:"Emily Rodriguez",role:"Product Manager",stars:4}];function u({className:a="",title:s="Developer Reviews",description:o="See what the community is saying. Real feedback from developers building amazing user experiences.",testimonials:l=p}){return jsxRuntime.jsx("div",{className:n("min-h-[400px] w-full py-24",a),children:jsxRuntime.jsxs("div",{className:"container mx-auto w-full max-w-5xl px-6",children:[jsxRuntime.jsxs("div",{className:"mb-12",children:[jsxRuntime.jsx("h2",{className:"text-zinc-900 dark:text-zinc-100 text-4xl font-semibold",children:s}),jsxRuntime.jsx("p",{className:"text-zinc-600 dark:text-zinc-500 my-4 text-lg text-balance",children:o})]}),jsxRuntime.jsx("div",{className:"grid gap-6 lg:grid-cols-2",children:l.map(r=>jsxRuntime.jsxs("div",{className:"group hover:bg-zinc-50 dark:hover:bg-zinc-950 hover:border-zinc-400 dark:hover:border-zinc-700 rounded-2xl border border-zinc-300 dark:border-zinc-800 bg-white dark:bg-zinc-950 px-4 py-3 duration-200 transition-all hover:-translate-y-1",children:[jsxRuntime.jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((v,i)=>jsxRuntime.jsx(m,{filled:i<(r.stars||0),className:n("size-4 transition-colors duration-200",i<(r.stars||0)?"fill-pink-400 stroke-pink-400":"fill-zinc-300 dark:fill-zinc-700 stroke-zinc-400 dark:stroke-zinc-600")},`${r.name}-star-${i}`))}),jsxRuntime.jsx("p",{className:"text-zinc-900 dark:text-zinc-100 my-4",children:r.content}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("img",{src:r.avatar,alt:r.name,className:"size-6 rounded-full border border-zinc-300 dark:border-zinc-700 object-cover"}),jsxRuntime.jsx("div",{className:"text-zinc-900 dark:text-zinc-100 text-sm font-medium",children:r.name}),jsxRuntime.jsx("span",{"aria-hidden":true,className:"bg-zinc-400 dark:bg-zinc-600 size-1 rounded-full"}),jsxRuntime.jsx("span",{className:"text-zinc-500 text-sm",children:r.role})]})]},r.name))})]})})}var z=u;
2
+ exports.TestimonialsStars=u;exports.default=z;//# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/testimonials-stars/index.tsx"],"names":["cn","inputs","twMerge","clsx","StarIcon","filled","className","jsx","defaultTestimonials","TestimonialsStars","title","description","testimonials","jsxs","testimonial","_","testimonials_stars_default"],"mappings":"+KAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAAsB,CAC1C,OAAOC,sBAAQC,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCDA,IAAMG,CAAAA,CAAW,CAAC,CAAE,MAAA,CAAAC,CAAAA,CAAQ,SAAA,CAAAC,CAAU,CAAA,GACpCC,cAAAA,CAAC,KAAA,CAAA,CACC,KAAA,CAAM,4BAAA,CACN,KAAA,CAAM,IAAA,CACN,MAAA,CAAO,IAAA,CACP,OAAA,CAAQ,WAAA,CACR,IAAA,CAAMF,CAAAA,CAAS,cAAA,CAAiB,MAAA,CAChC,MAAA,CAAO,eACP,WAAA,CAAY,GAAA,CACZ,aAAA,CA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,EACAA,cAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,uBAAA,CAAyB,QAAA,CAAAO,CAAAA,CAAY,IAAA,CAAK,CAAA,CAAA,CAC5D,IApCKA,CAAAA,CAAY,IAqCnB,CACD,CAAA,CACH,CAAA,CAAA,CACF,CAAA,CACF,CAEJ,KAEOE,CAAAA,CAAQP","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 { cn } from \"../utils/cn\";\r\n\r\nconst StarIcon = ({ filled, className }: { filled: boolean; className?: string }) => (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"24\"\r\n height=\"24\"\r\n viewBox=\"0 0 24 24\"\r\n fill={filled ? \"currentColor\" : \"none\"}\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n className={className}\r\n >\r\n <polygon points=\"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2\" />\r\n </svg>\r\n);\r\n\r\nexport interface TestimonialItem {\r\n content: string;\r\n avatar: string;\r\n name: string;\r\n role: string;\r\n stars?: number;\r\n}\r\n\r\ninterface TestimonialsStarsProps {\r\n className?: string;\r\n title?: string;\r\n description?: string;\r\n testimonials?: TestimonialItem[];\r\n}\r\n\r\nconst defaultTestimonials: TestimonialItem[] = [\r\n {\r\n content:\r\n \"This UI library has revolutionized how we build user interfaces. The animations are buttery smooth and the developer experience is incredible.\",\r\n avatar: \"https://i.pravatar.cc/150?img=1\",\r\n name: \"Eduardo Calvo\",\r\n role: \"CEO & Founder\",\r\n stars: 5,\r\n },\r\n {\r\n content:\r\n \"The design system is incredibly well thought out. Every component feels intentional and polished.\",\r\n avatar: \"https://i.pravatar.cc/150?img=2\",\r\n name: \"Drew Cano\",\r\n role: \"Head of Design\",\r\n stars: 5,\r\n },\r\n {\r\n content:\r\n \"Best UI library I've used. The TypeScript support is excellent and the components are highly customizable.\",\r\n avatar: \"https://i.pravatar.cc/150?img=3\",\r\n name: \"Marcus Johnson\",\r\n role: \"Lead Developer\",\r\n stars: 5,\r\n },\r\n {\r\n content:\r\n \"Our users love the smooth interactions. It's made our product feel premium and professional.\",\r\n avatar: \"https://i.pravatar.cc/150?img=4\",\r\n name: \"Emily Rodriguez\",\r\n role: \"Product Manager\",\r\n stars: 4,\r\n },\r\n];\r\n\r\nexport function TestimonialsStars({\r\n className = \"\",\r\n title = \"Developer Reviews\",\r\n description = \"See what the community is saying. Real feedback from developers building amazing user experiences.\",\r\n testimonials = defaultTestimonials,\r\n}: TestimonialsStarsProps) {\r\n return (\r\n <div className={cn(\"min-h-[400px] w-full py-24\", className)}>\r\n <div className=\"container mx-auto w-full max-w-5xl px-6\">\r\n <div className=\"mb-12\">\r\n <h2 className=\"text-zinc-900 dark:text-zinc-100 text-4xl font-semibold\">\r\n {title}\r\n </h2>\r\n <p className=\"text-zinc-600 dark:text-zinc-500 my-4 text-lg text-balance\">\r\n {description}\r\n </p>\r\n </div>\r\n\r\n <div className=\"grid gap-6 lg:grid-cols-2\">\r\n {testimonials.map((testimonial) => (\r\n <div\r\n key={testimonial.name}\r\n className=\"group hover:bg-zinc-50 dark:hover:bg-zinc-950 hover:border-zinc-400 dark:hover:border-zinc-700 rounded-2xl border border-zinc-300 dark:border-zinc-800 bg-white dark:bg-zinc-950 px-4 py-3 duration-200 transition-all hover:-translate-y-1\"\r\n >\r\n <div className=\"flex gap-1\">\r\n {Array.from({ length: 5 }).map((_, i) => (\r\n <StarIcon\r\n key={`${testimonial.name}-star-${i}`}\r\n filled={i < (testimonial.stars || 0)}\r\n className={cn(\r\n \"size-4 transition-colors duration-200\",\r\n i < (testimonial.stars || 0)\r\n ? \"fill-pink-400 stroke-pink-400\"\r\n : \"fill-zinc-300 dark:fill-zinc-700 stroke-zinc-400 dark:stroke-zinc-600\"\r\n )}\r\n />\r\n ))}\r\n </div>\r\n\r\n <p className=\"text-zinc-900 dark:text-zinc-100 my-4\">\r\n {testimonial.content}\r\n </p>\r\n\r\n <div className=\"flex items-center gap-2\">\r\n <img\r\n src={testimonial.avatar}\r\n alt={testimonial.name}\r\n className=\"size-6 rounded-full border border-zinc-300 dark:border-zinc-700 object-cover\"\r\n />\r\n <div className=\"text-zinc-900 dark:text-zinc-100 text-sm font-medium\">\r\n {testimonial.name}\r\n </div>\r\n <span\r\n aria-hidden\r\n className=\"bg-zinc-400 dark:bg-zinc-600 size-1 rounded-full\"\r\n />\r\n <span className=\"text-zinc-500 text-sm\">{testimonial.role}</span>\r\n </div>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default TestimonialsStars;\r\n"]}
@@ -0,0 +1,3 @@
1
+ import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs}from'react/jsx-runtime';function n(...a){return twMerge(clsx(a))}var m=({filled:a,className:s})=>jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:a?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})}),p=[{content:"This UI library has revolutionized how we build user interfaces. The animations are buttery smooth and the developer experience is incredible.",avatar:"https://i.pravatar.cc/150?img=1",name:"Eduardo Calvo",role:"CEO & Founder",stars:5},{content:"The design system is incredibly well thought out. Every component feels intentional and polished.",avatar:"https://i.pravatar.cc/150?img=2",name:"Drew Cano",role:"Head of Design",stars:5},{content:"Best UI library I've used. The TypeScript support is excellent and the components are highly customizable.",avatar:"https://i.pravatar.cc/150?img=3",name:"Marcus Johnson",role:"Lead Developer",stars:5},{content:"Our users love the smooth interactions. It's made our product feel premium and professional.",avatar:"https://i.pravatar.cc/150?img=4",name:"Emily Rodriguez",role:"Product Manager",stars:4}];function u({className:a="",title:s="Developer Reviews",description:o="See what the community is saying. Real feedback from developers building amazing user experiences.",testimonials:l=p}){return jsx("div",{className:n("min-h-[400px] w-full py-24",a),children:jsxs("div",{className:"container mx-auto w-full max-w-5xl px-6",children:[jsxs("div",{className:"mb-12",children:[jsx("h2",{className:"text-zinc-900 dark:text-zinc-100 text-4xl font-semibold",children:s}),jsx("p",{className:"text-zinc-600 dark:text-zinc-500 my-4 text-lg text-balance",children:o})]}),jsx("div",{className:"grid gap-6 lg:grid-cols-2",children:l.map(r=>jsxs("div",{className:"group hover:bg-zinc-50 dark:hover:bg-zinc-950 hover:border-zinc-400 dark:hover:border-zinc-700 rounded-2xl border border-zinc-300 dark:border-zinc-800 bg-white dark:bg-zinc-950 px-4 py-3 duration-200 transition-all hover:-translate-y-1",children:[jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((v,i)=>jsx(m,{filled:i<(r.stars||0),className:n("size-4 transition-colors duration-200",i<(r.stars||0)?"fill-pink-400 stroke-pink-400":"fill-zinc-300 dark:fill-zinc-700 stroke-zinc-400 dark:stroke-zinc-600")},`${r.name}-star-${i}`))}),jsx("p",{className:"text-zinc-900 dark:text-zinc-100 my-4",children:r.content}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("img",{src:r.avatar,alt:r.name,className:"size-6 rounded-full border border-zinc-300 dark:border-zinc-700 object-cover"}),jsx("div",{className:"text-zinc-900 dark:text-zinc-100 text-sm font-medium",children:r.name}),jsx("span",{"aria-hidden":true,className:"bg-zinc-400 dark:bg-zinc-600 size-1 rounded-full"}),jsx("span",{className:"text-zinc-500 text-sm",children:r.role})]})]},r.name))})]})})}var z=u;
2
+ export{u as TestimonialsStars,z as default};//# sourceMappingURL=index.mjs.map
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/testimonials-stars/index.tsx"],"names":["cn","inputs","twMerge","clsx","StarIcon","filled","className","jsx","defaultTestimonials","TestimonialsStars","title","description","testimonials","jsxs","testimonial","_","testimonials_stars_default"],"mappings":"sGAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAAsB,CAC1C,OAAOC,QAAQC,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCDA,IAAMG,CAAAA,CAAW,CAAC,CAAE,MAAA,CAAAC,CAAAA,CAAQ,SAAA,CAAAC,CAAU,CAAA,GACpCC,GAAAA,CAAC,KAAA,CAAA,CACC,KAAA,CAAM,4BAAA,CACN,KAAA,CAAM,IAAA,CACN,MAAA,CAAO,IAAA,CACP,OAAA,CAAQ,WAAA,CACR,IAAA,CAAMF,CAAAA,CAAS,cAAA,CAAiB,MAAA,CAChC,MAAA,CAAO,eACP,WAAA,CAAY,GAAA,CACZ,aAAA,CAAc,OAAA,CACd,cAAA,CAAe,OAAA,CACf,SAAA,CAAWC,CAAAA,CAEX,SAAAC,GAAAA,CAAC,SAAA,CAAA,CAAQ,MAAA,CAAO,gGAAA,CAAiG,CAAA,CACnH,CAAA,CAkBIC,CAAAA,CAAyC,CAC7C,CACE,OAAA,CACE,gJAAA,CACF,MAAA,CAAQ,iCAAA,CACR,IAAA,CAAM,eAAA,CACN,IAAA,CAAM,eAAA,CACN,KAAA,CAAO,CACT,CAAA,CACA,CACE,OAAA,CACE,mGAAA,CACF,MAAA,CAAQ,iCAAA,CACR,KAAM,WAAA,CACN,IAAA,CAAM,gBAAA,CACN,KAAA,CAAO,CACT,CAAA,CACA,CACE,OAAA,CACE,6GACF,MAAA,CAAQ,iCAAA,CACR,IAAA,CAAM,gBAAA,CACN,IAAA,CAAM,gBAAA,CACN,KAAA,CAAO,CACT,EACA,CACE,OAAA,CACE,8FAAA,CACF,MAAA,CAAQ,iCAAA,CACR,IAAA,CAAM,iBAAA,CACN,IAAA,CAAM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ACN,CAAA,CAAA,CAPK,CAAA,EAAGA,CAAAA,CAAY,IAAI,CAAA,MAAA,EAAS,CAAC,CAAA,CAQpC,CACD,CAAA,CACH,CAAA,CAEAP,GAAAA,CAAC,GAAA,CAAA,CAAE,UAAU,uCAAA,CACV,QAAA,CAAAO,CAAAA,CAAY,OAAA,CACf,CAAA,CAEAD,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,0BACb,QAAA,CAAA,CAAAN,GAAAA,CAAC,KAAA,CAAA,CACC,GAAA,CAAKO,CAAAA,CAAY,MAAA,CACjB,GAAA,CAAKA,CAAAA,CAAY,KACjB,SAAA,CAAU,8EAAA,CACZ,CAAA,CACAP,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,sDAAA,CACZ,QAAA,CAAAO,EAAY,IAAA,CACf,CAAA,CACAP,GAAAA,CAAC,MAAA,CAAA,CACC,aAAA,CAAW,IAAA,CACX,SAAA,CAAU,kDAAA,CACZ,EACAA,GAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,uBAAA,CAAyB,QAAA,CAAAO,CAAAA,CAAY,IAAA,CAAK,CAAA,CAAA,CAC5D,IApCKA,CAAAA,CAAY,IAqCnB,CACD,CAAA,CACH,CAAA,CAAA,CACF,CAAA,CACF,CAEJ,KAEOE,CAAAA,CAAQP","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 { cn } from \"../utils/cn\";\r\n\r\nconst StarIcon = ({ filled, className }: { filled: boolean; className?: string }) => (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"24\"\r\n height=\"24\"\r\n viewBox=\"0 0 24 24\"\r\n fill={filled ? \"currentColor\" : \"none\"}\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n className={className}\r\n >\r\n <polygon points=\"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2\" />\r\n </svg>\r\n);\r\n\r\nexport interface TestimonialItem {\r\n content: string;\r\n avatar: string;\r\n name: string;\r\n role: string;\r\n stars?: number;\r\n}\r\n\r\ninterface TestimonialsStarsProps {\r\n className?: string;\r\n title?: string;\r\n description?: string;\r\n testimonials?: TestimonialItem[];\r\n}\r\n\r\nconst defaultTestimonials: TestimonialItem[] = [\r\n {\r\n content:\r\n \"This UI library has revolutionized how we build user interfaces. The animations are buttery smooth and the developer experience is incredible.\",\r\n avatar: \"https://i.pravatar.cc/150?img=1\",\r\n name: \"Eduardo Calvo\",\r\n role: \"CEO & Founder\",\r\n stars: 5,\r\n },\r\n {\r\n content:\r\n \"The design system is incredibly well thought out. Every component feels intentional and polished.\",\r\n avatar: \"https://i.pravatar.cc/150?img=2\",\r\n name: \"Drew Cano\",\r\n role: \"Head of Design\",\r\n stars: 5,\r\n },\r\n {\r\n content:\r\n \"Best UI library I've used. The TypeScript support is excellent and the components are highly customizable.\",\r\n avatar: \"https://i.pravatar.cc/150?img=3\",\r\n name: \"Marcus Johnson\",\r\n role: \"Lead Developer\",\r\n stars: 5,\r\n },\r\n {\r\n content:\r\n \"Our users love the smooth interactions. It's made our product feel premium and professional.\",\r\n avatar: \"https://i.pravatar.cc/150?img=4\",\r\n name: \"Emily Rodriguez\",\r\n role: \"Product Manager\",\r\n stars: 4,\r\n },\r\n];\r\n\r\nexport function TestimonialsStars({\r\n className = \"\",\r\n title = \"Developer Reviews\",\r\n description = \"See what the community is saying. Real feedback from developers building amazing user experiences.\",\r\n testimonials = defaultTestimonials,\r\n}: TestimonialsStarsProps) {\r\n return (\r\n <div className={cn(\"min-h-[400px] w-full py-24\", className)}>\r\n <div className=\"container mx-auto w-full max-w-5xl px-6\">\r\n <div className=\"mb-12\">\r\n <h2 className=\"text-zinc-900 dark:text-zinc-100 text-4xl font-semibold\">\r\n {title}\r\n </h2>\r\n <p className=\"text-zinc-600 dark:text-zinc-500 my-4 text-lg text-balance\">\r\n {description}\r\n </p>\r\n </div>\r\n\r\n <div className=\"grid gap-6 lg:grid-cols-2\">\r\n {testimonials.map((testimonial) => (\r\n <div\r\n key={testimonial.name}\r\n className=\"group hover:bg-zinc-50 dark:hover:bg-zinc-950 hover:border-zinc-400 dark:hover:border-zinc-700 rounded-2xl border border-zinc-300 dark:border-zinc-800 bg-white dark:bg-zinc-950 px-4 py-3 duration-200 transition-all hover:-translate-y-1\"\r\n >\r\n <div className=\"flex gap-1\">\r\n {Array.from({ length: 5 }).map((_, i) => (\r\n <StarIcon\r\n key={`${testimonial.name}-star-${i}`}\r\n filled={i < (testimonial.stars || 0)}\r\n className={cn(\r\n \"size-4 transition-colors duration-200\",\r\n i < (testimonial.stars || 0)\r\n ? \"fill-pink-400 stroke-pink-400\"\r\n : \"fill-zinc-300 dark:fill-zinc-700 stroke-zinc-400 dark:stroke-zinc-600\"\r\n )}\r\n />\r\n ))}\r\n </div>\r\n\r\n <p className=\"text-zinc-900 dark:text-zinc-100 my-4\">\r\n {testimonial.content}\r\n </p>\r\n\r\n <div className=\"flex items-center gap-2\">\r\n <img\r\n src={testimonial.avatar}\r\n alt={testimonial.name}\r\n className=\"size-6 rounded-full border border-zinc-300 dark:border-zinc-700 object-cover\"\r\n />\r\n <div className=\"text-zinc-900 dark:text-zinc-100 text-sm font-medium\">\r\n {testimonial.name}\r\n </div>\r\n <span\r\n aria-hidden\r\n className=\"bg-zinc-400 dark:bg-zinc-600 size-1 rounded-full\"\r\n />\r\n <span className=\"text-zinc-500 text-sm\">{testimonial.role}</span>\r\n </div>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default TestimonialsStars;\r\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var react=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function h(...o){return tailwindMerge.twMerge(clsx.clsx(o))}function _({text:o,as:P="div",typingSpeed:c=50,initialDelay:C=0,pauseDuration:T=2e3,deletingSpeed:I=30,loop:E=true,className:k="",showCursor:g=true,hideCursorWhileTyping:w=false,cursorCharacter:J="|",cursorClassName:W="",cursorBlinkDuration:v=.5,textColors:p=[],variableSpeed:l,onSentenceComplete:x,startOnVisible:b=false,reverseMode:M=false,...j}){let[a,N]=react.useState(""),[u,R]=react.useState(0),[m,A]=react.useState(false),[r,q]=react.useState(0),[V,z]=react.useState(!b),[B,F]=react.useState(true),d=react.useRef(null),n=react.useMemo(()=>Array.isArray(o)?o:[o],[o]),H=react.useCallback(()=>{if(!l)return c;let{min:e,max:t}=l;return Math.random()*(t-e)+e},[l,c]),G=()=>{if(p.length!==0)return p[r%p.length]};react.useEffect(()=>{if(!b||!d.current)return;let e=new IntersectionObserver(t=>{t.forEach(f=>{f.isIntersecting&&z(true);});},{threshold:.1});return e.observe(d.current),()=>e.disconnect()},[b]),react.useEffect(()=>{if(g){let e=setInterval(()=>{F(t=>!t);},v*1e3);return ()=>clearInterval(e)}},[g,v]),react.useEffect(()=>{if(!V)return;let e,t=n[r],f=M?t.split("").reverse().join(""):t,L=()=>{if(m)if(a===""){if(A(false),r===n.length-1&&!E)return;x&&x(n[r],r),q(s=>(s+1)%n.length),R(0),e=setTimeout(()=>{},T);}else e=setTimeout(()=>{N(s=>s.slice(0,-1));},I);else u<f.length?e=setTimeout(()=>{N(s=>s+f[u]),R(s=>s+1);},l?H():c):n.length>1&&(e=setTimeout(()=>{A(true);},T));};return u===0&&!m&&a===""?e=setTimeout(L,C):L(),()=>clearTimeout(e)},[u,a,m,c,I,T,n,r,E,C,V,M,l,x,H]);let K=w&&(u<n[r].length||m);return react.createElement(P,{ref:d,className:h("inline-flex",k),...j},jsxRuntime.jsx("span",{style:{color:G()||"inherit"},children:a}),g&&jsxRuntime.jsx("span",{className:h("transition-opacity",W,K&&"opacity-0",!B&&"opacity-0"),children:J}))}var se=_;exports.TextType=_;exports.default=se;//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/text-type/index.tsx"],"names":["cn","inputs","twMerge","clsx","TextType","text","Component","typingSpeed","initialDelay","pauseDuration","deletingSpeed","loop","className","showCursor","hideCursorWhileTyping","cursorCharacter","cursorClassName","cursorBlinkDuration","textColors","variableSpeed","onSentenceComplete","startOnVisible","reverseMode","props","displayedText","setDisplayedText","useState","currentCharIndex","setCurrentCharIndex","isDeleting","setIsDeleting","currentTextIndex","setCurrentTextIndex","isVisible","setIsVisible","cursorVisible","setCursorVisible","containerRef","useRef","textArray","useMemo","getRandomSpeed","useCallback","min","max","getCurrentTextColor","useEffect","observer","entries","entry","interval","prev","timeout","currentText","processedText","executeTypingAnimation","shouldHideCursor","createElement","jsx","text_type_default"],"mappings":"sMAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAAsB,CAC1C,OAAOC,qBAAAA,CAAQC,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CC6BO,SAASG,CAAAA,CAAS,CACvB,IAAA,CAAAC,CAAAA,CACA,EAAA,CAAIC,CAAAA,CAAY,KAAA,CAChB,WAAA,CAAAC,CAAAA,CAAc,EAAA,CACd,YAAA,CAAAC,CAAAA,CAAe,CAAA,CACf,aAAA,CAAAC,CAAAA,CAAgB,GAAA,CAChB,aAAA,CAAAC,CAAAA,CAAgB,EAAA,CAChB,IAAA,CAAAC,CAAAA,CAAO,IAAA,CACP,SAAA,CAAAC,CAAAA,CAAY,GACZ,UAAA,CAAAC,CAAAA,CAAa,IAAA,CACb,qBAAA,CAAAC,CAAAA,CAAwB,KAAA,CACxB,eAAA,CAAAC,CAAAA,CAAkB,GAAA,CAClB,eAAA,CAAAC,CAAAA,CAAkB,EAAA,CACl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DzB,CAAAA,CACAH,CAAAA,CACAK,CAAAA,CACAtB,CAAAA,CACAG,CAAAA,CACAD,CAAAA,CACA8B,CAAAA,CACAR,CAAAA,CACApB,CAAAA,CACAH,CAAAA,CACAyB,EACAX,CAAAA,CACAH,CAAAA,CACAC,CAAAA,CACAqB,CACF,CAAC,CAAA,CAED,IAAMe,CAAAA,CACJ1C,CAAAA,GACCa,CAAAA,CAAmBY,CAAAA,CAAUR,CAAgB,CAAA,CAAE,MAAA,EAAUF,CAAAA,CAAAA,CAE5D,OAAO4B,mBAAAA,CACLnD,CAAAA,CACA,CACE,GAAA,CAAK+B,CAAAA,CACL,SAAA,CAAWrC,CAAAA,CAAG,aAAA,CAAeY,CAAS,CAAA,CACtC,GAAGW,CACL,CAAA,CACAmC,cAAAA,CAAC,MAAA,CAAA,CAAK,KAAA,CAAO,CAAE,KAAA,CAAOb,CAAAA,EAAoB,EAAK,SAAU,CAAA,CACtD,QAAA,CAAArB,CAAAA,CACH,CAAA,CACAX,CAAAA,EACE6C,cAAAA,CAAC,MAAA,CAAA,CACC,SAAA,CAAW1D,CAAAA,CACT,oBAAA,CACAgB,CAAAA,CACAwC,CAAAA,EAAoB,WAAA,CACpB,CAACrB,CAAAA,EAAiB,WACpB,CAAA,CAEC,QAAA,CAAApB,CAAAA,CACH,CAEJ,CACF,CAEA,IAAO4C,EAAAA,CAAQvD","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 {\r\n ElementType,\r\n useEffect,\r\n useRef,\r\n useState,\r\n createElement,\r\n useMemo,\r\n useCallback,\r\n} from \"react\";\r\nimport { cn } from \"../utils/cn\";\r\n\r\ninterface TextTypeProps {\r\n className?: string;\r\n showCursor?: boolean;\r\n hideCursorWhileTyping?: boolean;\r\n cursorCharacter?: string | React.ReactNode;\r\n cursorBlinkDuration?: number;\r\n cursorClassName?: string;\r\n text: string | string[];\r\n as?: ElementType;\r\n typingSpeed?: number;\r\n initialDelay?: number;\r\n pauseDuration?: number;\r\n deletingSpeed?: number;\r\n loop?: boolean;\r\n textColors?: string[];\r\n variableSpeed?: { min: number; max: number };\r\n onSentenceComplete?: (sentence: string, index: number) => void;\r\n startOnVisible?: boolean;\r\n reverseMode?: boolean;\r\n}\r\n\r\nexport function TextType({\r\n text,\r\n as: Component = \"div\",\r\n typingSpeed = 50,\r\n initialDelay = 0,\r\n pauseDuration = 2000,\r\n deletingSpeed = 30,\r\n loop = true,\r\n className = \"\",\r\n showCursor = true,\r\n hideCursorWhileTyping = false,\r\n cursorCharacter = \"|\",\r\n cursorClassName = \"\",\r\n cursorBlinkDuration = 0.5,\r\n textColors = [],\r\n variableSpeed,\r\n onSentenceComplete,\r\n startOnVisible = false,\r\n reverseMode = false,\r\n ...props\r\n}: TextTypeProps & React.HTMLAttributes<HTMLElement>) {\r\n const [displayedText, setDisplayedText] = useState(\"\");\r\n const [currentCharIndex, setCurrentCharIndex] = useState(0);\r\n const [isDeleting, setIsDeleting] = useState(false);\r\n const [currentTextIndex, setCurrentTextIndex] = useState(0);\r\n const [isVisible, setIsVisible] = useState(!startOnVisible);\r\n const [cursorVisible, setCursorVisible] = useState(true);\r\n const containerRef = useRef<HTMLElement>(null);\r\n\r\n const textArray = useMemo(\r\n () => (Array.isArray(text) ? text : [text]),\r\n [text]\r\n );\r\n\r\n const getRandomSpeed = useCallback(() => {\r\n if (!variableSpeed) return typingSpeed;\r\n const { min, max } = variableSpeed;\r\n return Math.random() * (max - min) + min;\r\n }, [variableSpeed, typingSpeed]);\r\n\r\n const getCurrentTextColor = () => {\r\n if (textColors.length === 0) return;\r\n return textColors[currentTextIndex % textColors.length];\r\n };\r\n\r\n useEffect(() => {\r\n if (!startOnVisible || !containerRef.current) return;\r\n\r\n const observer = new IntersectionObserver(\r\n (entries) => {\r\n entries.forEach((entry) => {\r\n if (entry.isIntersecting) {\r\n setIsVisible(true);\r\n }\r\n });\r\n },\r\n { threshold: 0.1 }\r\n );\r\n\r\n observer.observe(containerRef.current);\r\n return () => observer.disconnect();\r\n }, [startOnVisible]);\r\n\r\n useEffect(() => {\r\n if (showCursor) {\r\n const interval = setInterval(() => {\r\n setCursorVisible((prev) => !prev);\r\n }, cursorBlinkDuration * 1000);\r\n return () => clearInterval(interval);\r\n }\r\n }, [showCursor, cursorBlinkDuration]);\r\n\r\n useEffect(() => {\r\n if (!isVisible) return;\r\n\r\n let timeout: NodeJS.Timeout;\r\n\r\n const currentText = textArray[currentTextIndex];\r\n const processedText = reverseMode\r\n ? currentText.split(\"\").reverse().join(\"\")\r\n : currentText;\r\n\r\n const executeTypingAnimation = () => {\r\n if (isDeleting) {\r\n if (displayedText === \"\") {\r\n setIsDeleting(false);\r\n if (currentTextIndex === textArray.length - 1 && !loop) {\r\n return;\r\n }\r\n\r\n if (onSentenceComplete) {\r\n onSentenceComplete(textArray[currentTextIndex], currentTextIndex);\r\n }\r\n\r\n setCurrentTextIndex((prev) => (prev + 1) % textArray.length);\r\n setCurrentCharIndex(0);\r\n timeout = setTimeout(() => {}, pauseDuration);\r\n } else {\r\n timeout = setTimeout(() => {\r\n setDisplayedText((prev) => prev.slice(0, -1));\r\n }, deletingSpeed);\r\n }\r\n } else {\r\n if (currentCharIndex < processedText.length) {\r\n timeout = setTimeout(\r\n () => {\r\n setDisplayedText((prev) => prev + processedText[currentCharIndex]);\r\n setCurrentCharIndex((prev) => prev + 1);\r\n },\r\n variableSpeed ? getRandomSpeed() : typingSpeed\r\n );\r\n } else if (textArray.length > 1) {\r\n timeout = setTimeout(() => {\r\n setIsDeleting(true);\r\n }, pauseDuration);\r\n }\r\n }\r\n };\r\n\r\n if (currentCharIndex === 0 && !isDeleting && displayedText === \"\") {\r\n timeout = setTimeout(executeTypingAnimation, initialDelay);\r\n } else {\r\n executeTypingAnimation();\r\n }\r\n\r\n return () => clearTimeout(timeout);\r\n }, [\r\n currentCharIndex,\r\n displayedText,\r\n isDeleting,\r\n typingSpeed,\r\n deletingSpeed,\r\n pauseDuration,\r\n textArray,\r\n currentTextIndex,\r\n loop,\r\n initialDelay,\r\n isVisible,\r\n reverseMode,\r\n variableSpeed,\r\n onSentenceComplete,\r\n getRandomSpeed,\r\n ]);\r\n\r\n const shouldHideCursor =\r\n hideCursorWhileTyping &&\r\n (currentCharIndex < textArray[currentTextIndex].length || isDeleting);\r\n\r\n return createElement(\r\n Component,\r\n {\r\n ref: containerRef,\r\n className: cn(\"inline-flex\", className),\r\n ...props,\r\n },\r\n <span style={{ color: getCurrentTextColor() || \"inherit\" }}>\r\n {displayedText}\r\n </span>,\r\n showCursor && (\r\n <span\r\n className={cn(\r\n \"transition-opacity\",\r\n cursorClassName,\r\n shouldHideCursor && \"opacity-0\",\r\n !cursorVisible && \"opacity-0\"\r\n )}\r\n >\r\n {cursorCharacter}\r\n </span>\r\n )\r\n );\r\n}\r\n\r\nexport default TextType;\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {useState,useRef,useMemo,useCallback,useEffect,createElement}from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx}from'react/jsx-runtime';function h(...o){return twMerge(clsx(o))}function _({text:o,as:P="div",typingSpeed:c=50,initialDelay:C=0,pauseDuration:T=2e3,deletingSpeed:I=30,loop:E=true,className:k="",showCursor:g=true,hideCursorWhileTyping:w=false,cursorCharacter:J="|",cursorClassName:W="",cursorBlinkDuration:v=.5,textColors:p=[],variableSpeed:l,onSentenceComplete:x,startOnVisible:b=false,reverseMode:M=false,...j}){let[a,N]=useState(""),[u,R]=useState(0),[m,A]=useState(false),[r,q]=useState(0),[V,z]=useState(!b),[B,F]=useState(true),d=useRef(null),n=useMemo(()=>Array.isArray(o)?o:[o],[o]),H=useCallback(()=>{if(!l)return c;let{min:e,max:t}=l;return Math.random()*(t-e)+e},[l,c]),G=()=>{if(p.length!==0)return p[r%p.length]};useEffect(()=>{if(!b||!d.current)return;let e=new IntersectionObserver(t=>{t.forEach(f=>{f.isIntersecting&&z(true);});},{threshold:.1});return e.observe(d.current),()=>e.disconnect()},[b]),useEffect(()=>{if(g){let e=setInterval(()=>{F(t=>!t);},v*1e3);return ()=>clearInterval(e)}},[g,v]),useEffect(()=>{if(!V)return;let e,t=n[r],f=M?t.split("").reverse().join(""):t,L=()=>{if(m)if(a===""){if(A(false),r===n.length-1&&!E)return;x&&x(n[r],r),q(s=>(s+1)%n.length),R(0),e=setTimeout(()=>{},T);}else e=setTimeout(()=>{N(s=>s.slice(0,-1));},I);else u<f.length?e=setTimeout(()=>{N(s=>s+f[u]),R(s=>s+1);},l?H():c):n.length>1&&(e=setTimeout(()=>{A(true);},T));};return u===0&&!m&&a===""?e=setTimeout(L,C):L(),()=>clearTimeout(e)},[u,a,m,c,I,T,n,r,E,C,V,M,l,x,H]);let K=w&&(u<n[r].length||m);return createElement(P,{ref:d,className:h("inline-flex",k),...j},jsx("span",{style:{color:G()||"inherit"},children:a}),g&&jsx("span",{className:h("transition-opacity",W,K&&"opacity-0",!B&&"opacity-0"),children:J}))}var se=_;export{_ as TextType,se as default};//# sourceMappingURL=index.mjs.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/text-type/index.tsx"],"names":["cn","inputs","twMerge","clsx","TextType","text","Component","typingSpeed","initialDelay","pauseDuration","deletingSpeed","loop","className","showCursor","hideCursorWhileTyping","cursorCharacter","cursorClassName","cursorBlinkDuration","textColors","variableSpeed","onSentenceComplete","startOnVisible","reverseMode","props","displayedText","setDisplayedText","useState","currentCharIndex","setCurrentCharIndex","isDeleting","setIsDeleting","currentTextIndex","setCurrentTextIndex","isVisible","setIsVisible","cursorVisible","setCursorVisible","containerRef","useRef","textArray","useMemo","getRandomSpeed","useCallback","min","max","getCurrentTextColor","useEffect","observer","entries","entry","interval","prev","timeout","currentText","processedText","executeTypingAnimation","shouldHideCursor","createElement","js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E6C,GAAAA,CAAC,MAAA,CAAA,CACC,SAAA,CAAW1D,CAAAA,CACT,oBAAA,CACAgB,CAAAA,CACAwC,CAAAA,EAAoB,WAAA,CACpB,CAACrB,CAAAA,EAAiB,WACpB,CAAA,CAEC,QAAA,CAAApB,CAAAA,CACH,CAEJ,CACF,CAEA,IAAO4C,EAAAA,CAAQvD","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 {\r\n ElementType,\r\n useEffect,\r\n useRef,\r\n useState,\r\n createElement,\r\n useMemo,\r\n useCallback,\r\n} from \"react\";\r\nimport { cn } from \"../utils/cn\";\r\n\r\ninterface TextTypeProps {\r\n className?: string;\r\n showCursor?: boolean;\r\n hideCursorWhileTyping?: boolean;\r\n cursorCharacter?: string | React.ReactNode;\r\n cursorBlinkDuration?: number;\r\n cursorClassName?: string;\r\n text: string | string[];\r\n as?: ElementType;\r\n typingSpeed?: number;\r\n initialDelay?: number;\r\n pauseDuration?: number;\r\n deletingSpeed?: number;\r\n loop?: boolean;\r\n textColors?: string[];\r\n variableSpeed?: { min: number; max: number };\r\n onSentenceComplete?: (sentence: string, index: number) => void;\r\n startOnVisible?: boolean;\r\n reverseMode?: boolean;\r\n}\r\n\r\nexport function TextType({\r\n text,\r\n as: Component = \"div\",\r\n typingSpeed = 50,\r\n initialDelay = 0,\r\n pauseDuration = 2000,\r\n deletingSpeed = 30,\r\n loop = true,\r\n className = \"\",\r\n showCursor = true,\r\n hideCursorWhileTyping = false,\r\n cursorCharacter = \"|\",\r\n cursorClassName = \"\",\r\n cursorBlinkDuration = 0.5,\r\n textColors = [],\r\n variableSpeed,\r\n onSentenceComplete,\r\n startOnVisible = false,\r\n reverseMode = false,\r\n ...props\r\n}: TextTypeProps & React.HTMLAttributes<HTMLElement>) {\r\n const [displayedText, setDisplayedText] = useState(\"\");\r\n const [currentCharIndex, setCurrentCharIndex] = useState(0);\r\n const [isDeleting, setIsDeleting] = useState(false);\r\n const [currentTextIndex, setCurrentTextIndex] = useState(0);\r\n const [isVisible, setIsVisible] = useState(!startOnVisible);\r\n const [cursorVisible, setCursorVisible] = useState(true);\r\n const containerRef = useRef<HTMLElement>(null);\r\n\r\n const textArray = useMemo(\r\n () => (Array.isArray(text) ? text : [text]),\r\n [text]\r\n );\r\n\r\n const getRandomSpeed = useCallback(() => {\r\n if (!variableSpeed) return typingSpeed;\r\n const { min, max } = variableSpeed;\r\n return Math.random() * (max - min) + min;\r\n }, [variableSpeed, typingSpeed]);\r\n\r\n const getCurrentTextColor = () => {\r\n if (textColors.length === 0) return;\r\n return textColors[currentTextIndex % textColors.length];\r\n };\r\n\r\n useEffect(() => {\r\n if (!startOnVisible || !containerRef.current) return;\r\n\r\n const observer = new IntersectionObserver(\r\n (entries) => {\r\n entries.forEach((entry) => {\r\n if (entry.isIntersecting) {\r\n setIsVisible(true);\r\n }\r\n });\r\n },\r\n { threshold: 0.1 }\r\n );\r\n\r\n observer.observe(containerRef.current);\r\n return () => observer.disconnect();\r\n }, [startOnVisible]);\r\n\r\n useEffect(() => {\r\n if (showCursor) {\r\n const interval = setInterval(() => {\r\n setCursorVisible((prev) => !prev);\r\n }, cursorBlinkDuration * 1000);\r\n return () => clearInterval(interval);\r\n }\r\n }, [showCursor, cursorBlinkDuration]);\r\n\r\n useEffect(() => {\r\n if (!isVisible) return;\r\n\r\n let timeout: NodeJS.Timeout;\r\n\r\n const currentText = textArray[currentTextIndex];\r\n const processedText = reverseMode\r\n ? currentText.split(\"\").reverse().join(\"\")\r\n : currentText;\r\n\r\n const executeTypingAnimation = () => {\r\n if (isDeleting) {\r\n if (displayedText === \"\") {\r\n setIsDeleting(false);\r\n if (currentTextIndex === textArray.length - 1 && !loop) {\r\n return;\r\n }\r\n\r\n if (onSentenceComplete) {\r\n onSentenceComplete(textArray[currentTextIndex], currentTextIndex);\r\n }\r\n\r\n setCurrentTextIndex((prev) => (prev + 1) % textArray.length);\r\n setCurrentCharIndex(0);\r\n timeout = setTimeout(() => {}, pauseDuration);\r\n } else {\r\n timeout = setTimeout(() => {\r\n setDisplayedText((prev) => prev.slice(0, -1));\r\n }, deletingSpeed);\r\n }\r\n } else {\r\n if (currentCharIndex < processedText.length) {\r\n timeout = setTimeout(\r\n () => {\r\n setDisplayedText((prev) => prev + processedText[currentCharIndex]);\r\n setCurrentCharIndex((prev) => prev + 1);\r\n },\r\n variableSpeed ? getRandomSpeed() : typingSpeed\r\n );\r\n } else if (textArray.length > 1) {\r\n timeout = setTimeout(() => {\r\n setIsDeleting(true);\r\n }, pauseDuration);\r\n }\r\n }\r\n };\r\n\r\n if (currentCharIndex === 0 && !isDeleting && displayedText === \"\") {\r\n timeout = setTimeout(executeTypingAnimation, initialDelay);\r\n } else {\r\n executeTypingAnimation();\r\n }\r\n\r\n return () => clearTimeout(timeout);\r\n }, [\r\n currentCharIndex,\r\n displayedText,\r\n isDeleting,\r\n typingSpeed,\r\n deletingSpeed,\r\n pauseDuration,\r\n textArray,\r\n currentTextIndex,\r\n loop,\r\n initialDelay,\r\n isVisible,\r\n reverseMode,\r\n variableSpeed,\r\n onSentenceComplete,\r\n getRandomSpeed,\r\n ]);\r\n\r\n const shouldHideCursor =\r\n hideCursorWhileTyping &&\r\n (currentCharIndex < textArray[currentTextIndex].length || isDeleting);\r\n\r\n return createElement(\r\n Component,\r\n {\r\n ref: containerRef,\r\n className: cn(\"inline-flex\", className),\r\n ...props,\r\n },\r\n <span style={{ color: getCurrentTextColor() || \"inherit\" }}>\r\n {displayedText}\r\n </span>,\r\n showCursor && (\r\n <span\r\n className={cn(\r\n \"transition-opacity\",\r\n cursorClassName,\r\n shouldHideCursor && \"opacity-0\",\r\n !cursorVisible && \"opacity-0\"\r\n )}\r\n >\r\n {cursorCharacter}\r\n </span>\r\n )\r\n );\r\n}\r\n\r\nexport default TextType;\r\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var react=require('react'),jsxRuntime=require('react/jsx-runtime');function y({lineCount:s=50,lineColor:o="rgba(255, 255, 255, 0.1)",lineWidth:f=1,speed:c=.5,amplitude:u=100,className:g=""}){let h=react.useRef(null),a=react.useRef(null);return react.useEffect(()=>{let e=h.current;if(!e)return;let t=e.getContext("2d");if(!t)return;let i=()=>{e.width=e.offsetWidth,e.height=e.offsetHeight;};window.addEventListener("resize",i),i();let m=[];for(let n=0;n<s;n++)m.push({y:e.height/s*n,offset:Math.random()*Math.PI*2,speed:.5+Math.random()*c});let l=0,d=()=>{!t||!e||(t.clearRect(0,0,e.width,e.height),t.strokeStyle=o,t.lineWidth=f,m.forEach(n=>{t.beginPath();for(let r=0;r<=e.width;r+=5){let p=Math.sin(r*.01+l*n.speed+n.offset)*u,b=n.y+p;r===0?t.moveTo(r,b):t.lineTo(r,b);}t.stroke();}),l+=.01,a.current=requestAnimationFrame(d));};return d(),()=>{window.removeEventListener("resize",i),a.current&&cancelAnimationFrame(a.current);}},[s,o,f,c,u]),jsxRuntime.jsx("canvas",{ref:h,className:`w-full h-full ${g}`})}var M=y;exports.Threads=y;exports.default=M;//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/threads/index.tsx"],"names":["Threads","lineCount","lineColor","lineWidth","speed","amplitude","className","canvasRef","useRef","animationIdRef","useEffect","canvas","ctx","resizeCanvas","lines","i","time","animate","line","x","wave","y","jsx","threads_default"],"mappings":"yIAaO,SAASA,CAAAA,CAAQ,CACtB,SAAA,CAAAC,CAAAA,CAAY,GACZ,SAAA,CAAAC,CAAAA,CAAY,0BAAA,CACZ,SAAA,CAAAC,CAAAA,CAAY,CAAA,CACZ,KAAA,CAAAC,CAAAA,CAAQ,EAAA,CACR,SAAA,CAAAC,CAAAA,CAAY,GAAA,CACZ,SAAA,CAAAC,CAAAA,CAAY,E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A,EAAS,CACtBN,CAAAA,CAAI,SAAA,EAAU,CAEd,IAAA,IAASO,EAAI,CAAA,CAAGA,CAAAA,EAAKR,CAAAA,CAAO,KAAA,CAAOQ,CAAAA,EAAK,CAAA,CAAG,CACzC,IAAMC,CAAAA,CAAO,IAAA,CAAK,GAAA,CAAID,CAAAA,CAAI,GAAA,CAAOH,CAAAA,CAAOE,EAAK,KAAA,CAAQA,CAAAA,CAAK,MAAM,CAAA,CAAIb,CAAAA,CAC9DgB,CAAAA,CAAIH,CAAAA,CAAK,CAAA,CAAIE,CAAAA,CAEfD,CAAAA,GAAM,CAAA,CACRP,CAAAA,CAAI,MAAA,CAAOO,CAAAA,CAAGE,CAAC,CAAA,CAEfT,CAAAA,CAAI,MAAA,CAAOO,CAAAA,CAAGE,CAAC,EAEnB,CAEAT,CAAAA,CAAI,MAAA,GACN,CAAC,CAAA,CAEDI,CAAAA,EAAQ,GAAA,CACRP,EAAe,OAAA,CAAU,qBAAA,CAAsBQ,CAAO,CAAA,EACxD,CAAA,CAEA,OAAAA,CAAAA,EAAQ,CAED,IAAM,CACX,MAAA,CAAO,mBAAA,CAAoB,QAAA,CAAUJ,CAAY,EAC7CJ,CAAAA,CAAe,OAAA,EACjB,oBAAA,CAAqBA,CAAAA,CAAe,OAAO,EAE/C,CACF,CAAA,CAAG,CAACR,CAAAA,CAAWC,CAAAA,CAAWC,CAAAA,CAAWC,CAAAA,CAAOC,CAAS,CAAC,CAAA,CAE/CiB,cAAAA,CAAC,QAAA,CAAA,CAAO,GAAA,CAAKf,CAAAA,CAAW,SAAA,CAAW,CAAA,cAAA,EAAiBD,CAAS,CAAA,CAAA,CAAI,CAC1E,CAEA,IAAOiB,CAAAA,CAAQvB","file":"index.js","sourcesContent":["\"use client\";\r\n\r\nimport { useEffect, useRef } from \"react\";\r\n\r\ninterface ThreadsProps {\r\n lineCount?: number;\r\n lineColor?: string;\r\n lineWidth?: number;\r\n speed?: number;\r\n amplitude?: number;\r\n className?: string;\r\n}\r\n\r\nexport function Threads({\r\n lineCount = 50,\r\n lineColor = \"rgba(255, 255, 255, 0.1)\",\r\n lineWidth = 1,\r\n speed = 0.5,\r\n amplitude = 100,\r\n className = \"\",\r\n}: ThreadsProps) {\r\n const canvasRef = useRef<HTMLCanvasElement>(null);\r\n const animationIdRef = useRef<number | null>(null);\r\n\r\n useEffect(() => {\r\n const canvas = canvasRef.current;\r\n if (!canvas) return;\r\n\r\n const ctx = canvas.getContext(\"2d\");\r\n if (!ctx) return;\r\n\r\n const resizeCanvas = () => {\r\n canvas.width = canvas.offsetWidth;\r\n canvas.height = canvas.offsetHeight;\r\n };\r\n\r\n window.addEventListener(\"resize\", resizeCanvas);\r\n resizeCanvas();\r\n\r\n const lines: Array<{ y: number; offset: number; speed: number }> = [];\r\n\r\n for (let i = 0; i < lineCount; i++) {\r\n lines.push({\r\n y: (canvas.height / lineCount) * i,\r\n offset: Math.random() * Math.PI * 2,\r\n speed: 0.5 + Math.random() * speed,\r\n });\r\n }\r\n\r\n let time = 0;\r\n\r\n const animate = () => {\r\n if (!ctx || !canvas) return;\r\n\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n ctx.strokeStyle = lineColor;\r\n ctx.lineWidth = lineWidth;\r\n\r\n lines.forEach((line) => {\r\n ctx.beginPath();\r\n\r\n for (let x = 0; x <= canvas.width; x += 5) {\r\n const wave = Math.sin(x * 0.01 + time * line.speed + line.offset) * amplitude;\r\n const y = line.y + wave;\r\n\r\n if (x === 0) {\r\n ctx.moveTo(x, y);\r\n } else {\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n\r\n ctx.stroke();\r\n });\r\n\r\n time += 0.01;\r\n animationIdRef.current = requestAnimationFrame(animate);\r\n };\r\n\r\n animate();\r\n\r\n return () => {\r\n window.removeEventListener(\"resize\", resizeCanvas);\r\n if (animationIdRef.current) {\r\n cancelAnimationFrame(animationIdRef.current);\r\n }\r\n };\r\n }, [lineCount, lineColor, lineWidth, speed, amplitude]);\r\n\r\n return <canvas ref={canvasRef} className={`w-full h-full ${className}`} />;\r\n}\r\n\r\nexport default Threads;\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {useRef,useEffect}from'react';import {jsx}from'react/jsx-runtime';function y({lineCount:s=50,lineColor:o="rgba(255, 255, 255, 0.1)",lineWidth:f=1,speed:c=.5,amplitude:u=100,className:g=""}){let h=useRef(null),a=useRef(null);return useEffect(()=>{let e=h.current;if(!e)return;let t=e.getContext("2d");if(!t)return;let i=()=>{e.width=e.offsetWidth,e.height=e.offsetHeight;};window.addEventListener("resize",i),i();let m=[];for(let n=0;n<s;n++)m.push({y:e.height/s*n,offset:Math.random()*Math.PI*2,speed:.5+Math.random()*c});let l=0,d=()=>{!t||!e||(t.clearRect(0,0,e.width,e.height),t.strokeStyle=o,t.lineWidth=f,m.forEach(n=>{t.beginPath();for(let r=0;r<=e.width;r+=5){let p=Math.sin(r*.01+l*n.speed+n.offset)*u,b=n.y+p;r===0?t.moveTo(r,b):t.lineTo(r,b);}t.stroke();}),l+=.01,a.current=requestAnimationFrame(d));};return d(),()=>{window.removeEventListener("resize",i),a.current&&cancelAnimationFrame(a.current);}},[s,o,f,c,u]),jsx("canvas",{ref:h,className:`w-full h-full ${g}`})}var M=y;export{y as Threads,M as default};//# sourceMappingURL=index.mjs.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/threads/index.tsx"],"names":["Threads","lineCount","lineColor","lineWidth","speed","amplitude","className","canvasRef","useRef","animationIdRef","useEffect","canvas","ctx","resizeCanvas","lines","i","time","animate","line","x","wave","y","jsx","threads_default"],"mappings":"yEAaO,SAASA,CAAAA,CAAQ,CACtB,SAAA,CAAAC,CAAAA,CAAY,GACZ,SAAA,CAAAC,CAAAA,CAAY,0BAAA,CACZ,SAAA,CAAAC,CAAAA,CAAY,CAAA,CACZ,KAAA,CAAAC,CAAAA,CAAQ,EAAA,CACR,SAAA,CAAAC,CAAAA,CAAY,GAAA,CACZ,S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AA,CAAM,OAAA,CAASI,CAAAA,EAAS,CACtBN,CAAAA,CAAI,SAAA,EAAU,CAEd,IAAA,IAASO,EAAI,CAAA,CAAGA,CAAAA,EAAKR,CAAAA,CAAO,KAAA,CAAOQ,CAAAA,EAAK,CAAA,CAAG,CACzC,IAAMC,CAAAA,CAAO,IAAA,CAAK,GAAA,CAAID,CAAAA,CAAI,GAAA,CAAOH,CAAAA,CAAOE,EAAK,KAAA,CAAQA,CAAAA,CAAK,MAAM,CAAA,CAAIb,CAAAA,CAC9DgB,CAAAA,CAAIH,CAAAA,CAAK,CAAA,CAAIE,CAAAA,CAEfD,CAAAA,GAAM,CAAA,CACRP,CAAAA,CAAI,MAAA,CAAOO,CAAAA,CAAGE,CAAC,CAAA,CAEfT,CAAAA,CAAI,MAAA,CAAOO,CAAAA,CAAGE,CAAC,EAEnB,CAEAT,CAAAA,CAAI,MAAA,GACN,CAAC,CAAA,CAEDI,CAAAA,EAAQ,GAAA,CACRP,EAAe,OAAA,CAAU,qBAAA,CAAsBQ,CAAO,CAAA,EACxD,CAAA,CAEA,OAAAA,CAAAA,EAAQ,CAED,IAAM,CACX,MAAA,CAAO,mBAAA,CAAoB,QAAA,CAAUJ,CAAY,EAC7CJ,CAAAA,CAAe,OAAA,EACjB,oBAAA,CAAqBA,CAAAA,CAAe,OAAO,EAE/C,CACF,CAAA,CAAG,CAACR,CAAAA,CAAWC,CAAAA,CAAWC,CAAAA,CAAWC,CAAAA,CAAOC,CAAS,CAAC,CAAA,CAE/CiB,GAAAA,CAAC,QAAA,CAAA,CAAO,GAAA,CAAKf,CAAAA,CAAW,SAAA,CAAW,CAAA,cAAA,EAAiBD,CAAS,CAAA,CAAA,CAAI,CAC1E,CAEA,IAAOiB,CAAAA,CAAQvB","file":"index.mjs","sourcesContent":["\"use client\";\r\n\r\nimport { useEffect, useRef } from \"react\";\r\n\r\ninterface ThreadsProps {\r\n lineCount?: number;\r\n lineColor?: string;\r\n lineWidth?: number;\r\n speed?: number;\r\n amplitude?: number;\r\n className?: string;\r\n}\r\n\r\nexport function Threads({\r\n lineCount = 50,\r\n lineColor = \"rgba(255, 255, 255, 0.1)\",\r\n lineWidth = 1,\r\n speed = 0.5,\r\n amplitude = 100,\r\n className = \"\",\r\n}: ThreadsProps) {\r\n const canvasRef = useRef<HTMLCanvasElement>(null);\r\n const animationIdRef = useRef<number | null>(null);\r\n\r\n useEffect(() => {\r\n const canvas = canvasRef.current;\r\n if (!canvas) return;\r\n\r\n const ctx = canvas.getContext(\"2d\");\r\n if (!ctx) return;\r\n\r\n const resizeCanvas = () => {\r\n canvas.width = canvas.offsetWidth;\r\n canvas.height = canvas.offsetHeight;\r\n };\r\n\r\n window.addEventListener(\"resize\", resizeCanvas);\r\n resizeCanvas();\r\n\r\n const lines: Array<{ y: number; offset: number; speed: number }> = [];\r\n\r\n for (let i = 0; i < lineCount; i++) {\r\n lines.push({\r\n y: (canvas.height / lineCount) * i,\r\n offset: Math.random() * Math.PI * 2,\r\n speed: 0.5 + Math.random() * speed,\r\n });\r\n }\r\n\r\n let time = 0;\r\n\r\n const animate = () => {\r\n if (!ctx || !canvas) return;\r\n\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n ctx.strokeStyle = lineColor;\r\n ctx.lineWidth = lineWidth;\r\n\r\n lines.forEach((line) => {\r\n ctx.beginPath();\r\n\r\n for (let x = 0; x <= canvas.width; x += 5) {\r\n const wave = Math.sin(x * 0.01 + time * line.speed + line.offset) * amplitude;\r\n const y = line.y + wave;\r\n\r\n if (x === 0) {\r\n ctx.moveTo(x, y);\r\n } else {\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n\r\n ctx.stroke();\r\n });\r\n\r\n time += 0.01;\r\n animationIdRef.current = requestAnimationFrame(animate);\r\n };\r\n\r\n animate();\r\n\r\n return () => {\r\n window.removeEventListener(\"resize\", resizeCanvas);\r\n if (animationIdRef.current) {\r\n cancelAnimationFrame(animationIdRef.current);\r\n }\r\n };\r\n }, [lineCount, lineColor, lineWidth, speed, amplitude]);\r\n\r\n return <canvas ref={canvasRef} className={`w-full h-full ${className}`} />;\r\n}\r\n\r\nexport default Threads;\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 r(...i){return tailwindMerge.twMerge(clsx.clsx(i))}function R({title:i,content:k,actions:m=[],children:g,position:a="top",trigger:o="hover",persistent:c=false,className:z}){let[f,n]=react.useState(false),[y,p]=react.useState(false),l=react.useRef(void 0),d=react.useRef(null),N=()=>{l.current&&clearTimeout(l.current),n(true);},v=()=>{c&&y||(l.current=setTimeout(()=>n(false),100));},w=()=>{o==="click"&&n(!f);},b=()=>n(false);react.useEffect(()=>{let t=u=>{d.current&&!d.current.contains(u.target)&&o==="click"&&n(false);};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[o]);let C=()=>{switch(a){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"}},T=o==="hover"?{onMouseEnter:N,onMouseLeave:v}:{onClick:w};return jsxRuntime.jsxs("div",{className:r("relative inline-block",z),...T,children:[g,jsxRuntime.jsx(framerMotion.AnimatePresence,{children:f&&jsxRuntime.jsx(framerMotion.motion.div,{ref:d,initial:{opacity:0,scale:.95,y:a==="top"?10:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:a==="top"?10:-10},transition:{type:"spring",stiffness:300,damping:25},onMouseEnter:()=>p(true),onMouseLeave:()=>{p(false),o==="hover"&&v();},className:r("absolute z-50 w-80 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl shadow-xl backdrop-blur-sm",C()),children:jsxRuntime.jsxs("div",{className:"p-4 space-y-3",children:[jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 space-y-1",children:[i&&jsxRuntime.jsx("h3",{className:"font-semibold text-zinc-900 dark:text-zinc-100 text-sm",children:i}),jsxRuntime.jsx("p",{className:"text-sm text-zinc-600 dark:text-zinc-400 leading-relaxed",children:k})]}),(o==="click"||c)&&jsxRuntime.jsx("button",{onClick:b,className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200 transition-colors p-1 rounded-md hover:bg-zinc-100 dark:hover:bg-zinc-800",children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),m.length>0&&jsxRuntime.jsx("div",{className:"flex gap-2 pt-2 border-t border-zinc-200 dark:border-zinc-800",children:m.map((t,u)=>jsxRuntime.jsx("button",{onClick:()=>{t.onClick(),c||b();},className:r("text-xs h-8 px-3 rounded-md font-medium transition-colors",t.variant==="destructive"?"bg-red-500 text-white hover:bg-red-600":t.variant==="secondary"?"bg-zinc-100 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 hover:bg-zinc-200 dark:hover:bg-zinc-700":"bg-zinc-900 dark:bg-white text-white dark:text-zinc-900 hover:bg-zinc-800 dark:hover:bg-zinc-100"),children:t.label},u))})]})})})]})}var D=R;exports.TooltipInteractive=R;exports.default=D;//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/tooltip-interactive/index.tsx"],"names":["cn","inputs","twMerge","clsx","TooltipInteractive","title","content","actions","children","position","trigger","persistent","className","isVisible","setIsVisible","useState","isHovered","setIsHovered","timeoutRef","useRef","tooltipRef","showTooltip","hideTooltip","handleClick","handleClose","useEffect","handleClickOutside","event","getPositionClasses","triggerProps","jsxs","jsx","AnimatePresence","motion","action","index","tooltip_interactive_default"],"mappings":"4OAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAAsB,CAC1C,OAAOC,qBAAAA,CAAQC,UAAKF,CAAM,CAAC,CAC7B,CCkBO,SAASG,CAAAA,CAAmB,CACjC,KAAA,CAAAC,CAAAA,CACA,QAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CAAU,EAAC,CACX,QAAA,CAAAC,EACA,QAAA,CAAAC,CAAAA,CAAW,MACX,OAAA,CAAAC,CAAAA,CAAU,QACV,UAAA,CAAAC,CAAAA,CAAa,KAAA,CACb,SAAA,CAAAC,CACF,CAAA,CAA4B,CAC1B,GAAM,CAACC,EAAWC,CAAY,CAAA,CAAIC,eAAS,KAAK,CAAA,CAC1C,CAACC,CAAAA,CAAWC,CAAY,CAAA,CAAIF,eAAS,KAAK,CAAA,CAC1CG,EAAaC,YAAAA,CAAuB,MAAS,EAC7CC,CAAAA,CAAaD,YAAAA,CAAuB,IAAI,CAAA,CAExCE,CAAAA,CAAc,IAAM,CACpBH,CAAAA,CAAW,OAAA,EAAS,aAAaA,CAAAA,CAAW,OAAO,EACvDJ,CAAAA,CAAa,IAAI,EACnB,CAAA,CAEMQ,CAAAA,CAAc,IAAM,CACpBX,CAAAA,EAAcK,CAAAA,GAClBE,EAAW,OAAA,CAAU,UAAA,CAAW,IAAMJ,CAAAA,CAAa,KAAK,CAAA,CAAG,GAAG,CAAA,EAChE,CAAA,CAEMS,EAAc,IAAM,CACpBb,IAAY,OAAA,EAASI,CAAAA,CAAa,CAACD,CAAS,EAClD,CAAA,CAEMW,CAAAA,CAAc,IAAMV,CAAAA,CAAa,KAAK,CAAA,CAE5CW,eAAAA,CAAU,IAAM,CACd,IAAMC,EAAsBC,CAAAA,EAAsB,CAC5CP,CAAAA,CAAW,OAAA,EAAW,CAACA,CAAAA,CAAW,QAAQ,QAAA,CAAS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,eAAC,QAAA,CAAA,CAAmB,OAAA,CAAS,IAAM,CAAEG,CAAAA,CAAO,SAAQ,CAAQvB,CAAAA,EAAYa,CAAAA,GAAe,CAAA,CACrF,SAAA,CAAWxB,EAAG,2DAAA,CACZkC,CAAAA,CAAO,UAAY,aAAA,CAAgB,wCAAA,CACnCA,EAAO,OAAA,GAAY,WAAA,CAAc,wGAAA,CACjC,kGACF,CAAA,CACA,QAAA,CAAAA,EAAO,KAAA,CAAA,CANIC,CAME,CAChB,CAAA,CACH,CAAA,CAAA,CAEJ,CAAA,CACF,EAEJ,CAAA,CAAA,CACF,CAEJ,CAEA,IAAOC,CAAAA,CAAQhC","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, useEffect } from \"react\";\r\nimport { motion, AnimatePresence } from \"framer-motion\";\r\nimport { cn } from \"../utils/cn\";\r\n\r\ninterface TooltipAction {\r\n label: string;\r\n onClick: () => void;\r\n variant?: \"default\" | \"secondary\" | \"destructive\";\r\n}\r\n\r\nexport interface TooltipInteractiveProps {\r\n title?: string;\r\n content: string;\r\n actions?: TooltipAction[];\r\n children: React.ReactNode;\r\n position?: \"top\" | \"bottom\" | \"left\" | \"right\";\r\n trigger?: \"hover\" | \"click\";\r\n persistent?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function TooltipInteractive({\r\n title,\r\n content,\r\n actions = [],\r\n children,\r\n position = \"top\",\r\n trigger = \"hover\",\r\n persistent = false,\r\n className,\r\n}: TooltipInteractiveProps) {\r\n const [isVisible, setIsVisible] = useState(false);\r\n const [isHovered, setIsHovered] = useState(false);\r\n const timeoutRef = useRef<NodeJS.Timeout>(undefined);\r\n const tooltipRef = useRef<HTMLDivElement>(null);\r\n\r\n const showTooltip = () => {\r\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\r\n setIsVisible(true);\r\n };\r\n\r\n const hideTooltip = () => {\r\n if (persistent && isHovered) return;\r\n timeoutRef.current = setTimeout(() => setIsVisible(false), 100);\r\n };\r\n\r\n const handleClick = () => {\r\n if (trigger === \"click\") setIsVisible(!isVisible);\r\n };\r\n\r\n const handleClose = () => setIsVisible(false);\r\n\r\n useEffect(() => {\r\n const handleClickOutside = (event: MouseEvent) => {\r\n if (tooltipRef.current && !tooltipRef.current.contains(event.target as Node)) {\r\n if (trigger === \"click\") setIsVisible(false);\r\n }\r\n };\r\n document.addEventListener(\"mousedown\", handleClickOutside);\r\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\r\n }, [trigger]);\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 const triggerProps = trigger === \"hover\"\r\n ? { onMouseEnter: showTooltip, onMouseLeave: hideTooltip }\r\n : { onClick: handleClick };\r\n\r\n return (\r\n <div className={cn(\"relative inline-block\", className)} {...triggerProps}>\r\n {children}\r\n <AnimatePresence>\r\n {isVisible && (\r\n <motion.div\r\n ref={tooltipRef}\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 onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => { setIsHovered(false); if (trigger === \"hover\") hideTooltip(); }}\r\n className={cn(\"absolute z-50 w-80 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl shadow-xl backdrop-blur-sm\", getPositionClasses())}\r\n >\r\n <div className=\"p-4 space-y-3\">\r\n <div className=\"flex items-start justify-between gap-2\">\r\n <div className=\"flex-1 space-y-1\">\r\n {title && <h3 className=\"font-semibold text-zinc-900 dark:text-zinc-100 text-sm\">{title}</h3>}\r\n <p className=\"text-sm text-zinc-600 dark:text-zinc-400 leading-relaxed\">{content}</p>\r\n </div>\r\n {(trigger === \"click\" || persistent) && (\r\n <button onClick={handleClose} className=\"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200 transition-colors p-1 rounded-md hover:bg-zinc-100 dark:hover:bg-zinc-800\">\r\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" /></svg>\r\n </button>\r\n )}\r\n </div>\r\n {actions.length > 0 && (\r\n <div className=\"flex gap-2 pt-2 border-t border-zinc-200 dark:border-zinc-800\">\r\n {actions.map((action, index) => (\r\n <button key={index} onClick={() => { action.onClick(); if (!persistent) handleClose(); }}\r\n className={cn(\"text-xs h-8 px-3 rounded-md font-medium transition-colors\",\r\n action.variant === \"destructive\" ? \"bg-red-500 text-white hover:bg-red-600\" :\r\n action.variant === \"secondary\" ? \"bg-zinc-100 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 hover:bg-zinc-200 dark:hover:bg-zinc-700\" :\r\n \"bg-zinc-900 dark:bg-white text-white dark:text-zinc-900 hover:bg-zinc-800 dark:hover:bg-zinc-100\"\r\n )}\r\n >{action.label}</button>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </motion.div>\r\n )}\r\n </AnimatePresence>\r\n </div>\r\n );\r\n}\r\n\r\nexport default TooltipInteractive;\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {useState,useRef,useEffect}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 r(...i){return twMerge(clsx(i))}function R({title:i,content:k,actions:m=[],children:g,position:a="top",trigger:o="hover",persistent:c=false,className:z}){let[f,n]=useState(false),[y,p]=useState(false),l=useRef(void 0),d=useRef(null),N=()=>{l.current&&clearTimeout(l.current),n(true);},v=()=>{c&&y||(l.current=setTimeout(()=>n(false),100));},w=()=>{o==="click"&&n(!f);},b=()=>n(false);useEffect(()=>{let t=u=>{d.current&&!d.current.contains(u.target)&&o==="click"&&n(false);};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[o]);let C=()=>{switch(a){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"}},T=o==="hover"?{onMouseEnter:N,onMouseLeave:v}:{onClick:w};return jsxs("div",{className:r("relative inline-block",z),...T,children:[g,jsx(AnimatePresence,{children:f&&jsx(motion.div,{ref:d,initial:{opacity:0,scale:.95,y:a==="top"?10:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:a==="top"?10:-10},transition:{type:"spring",stiffness:300,damping:25},onMouseEnter:()=>p(true),onMouseLeave:()=>{p(false),o==="hover"&&v();},className:r("absolute z-50 w-80 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl shadow-xl backdrop-blur-sm",C()),children:jsxs("div",{className:"p-4 space-y-3",children:[jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxs("div",{className:"flex-1 space-y-1",children:[i&&jsx("h3",{className:"font-semibold text-zinc-900 dark:text-zinc-100 text-sm",children:i}),jsx("p",{className:"text-sm text-zinc-600 dark:text-zinc-400 leading-relaxed",children:k})]}),(o==="click"||c)&&jsx("button",{onClick:b,className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200 transition-colors p-1 rounded-md hover:bg-zinc-100 dark:hover:bg-zinc-800",children:jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),m.length>0&&jsx("div",{className:"flex gap-2 pt-2 border-t border-zinc-200 dark:border-zinc-800",children:m.map((t,u)=>jsx("button",{onClick:()=>{t.onClick(),c||b();},className:r("text-xs h-8 px-3 rounded-md font-medium transition-colors",t.variant==="destructive"?"bg-red-500 text-white hover:bg-red-600":t.variant==="secondary"?"bg-zinc-100 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 hover:bg-zinc-200 dark:hover:bg-zinc-700":"bg-zinc-900 dark:bg-white text-white dark:text-zinc-900 hover:bg-zinc-800 dark:hover:bg-zinc-100"),children:t.label},u))})]})})})]})}var D=R;export{R as TooltipInteractive,D as default};//# sourceMappingURL=index.mjs.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/tooltip-interactive/index.tsx"],"names":["cn","inputs","twMerge","clsx","TooltipInteractive","title","content","actions","children","position","trigger","persistent","className","isVisible","setIsVisible","useState","isHovered","setIsHovered","timeoutRef","useRef","tooltipRef","showTooltip","hideTooltip","handleClick","handleClose","useEffect","handleClickOutside","event","getPositionClasses","triggerProps","jsxs","jsx","AnimatePresence","motion","action","index","tooltip_interactive_default"],"mappings":"uMAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAAsB,CAC1C,OAAOC,OAAAA,CAAQC,KAAKF,CAAM,CAAC,CAC7B,CCkBO,SAASG,CAAAA,CAAmB,CACjC,KAAA,CAAAC,CAAAA,CACA,QAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CAAU,EAAC,CACX,QAAA,CAAAC,EACA,QAAA,CAAAC,CAAAA,CAA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,CAAA,CACF,CAEJ,CAEA,IAAOC,CAAAA,CAAQhC","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, useEffect } from \"react\";\r\nimport { motion, AnimatePresence } from \"framer-motion\";\r\nimport { cn } from \"../utils/cn\";\r\n\r\ninterface TooltipAction {\r\n label: string;\r\n onClick: () => void;\r\n variant?: \"default\" | \"secondary\" | \"destructive\";\r\n}\r\n\r\nexport interface TooltipInteractiveProps {\r\n title?: string;\r\n content: string;\r\n actions?: TooltipAction[];\r\n children: React.ReactNode;\r\n position?: \"top\" | \"bottom\" | \"left\" | \"right\";\r\n trigger?: \"hover\" | \"click\";\r\n persistent?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function TooltipInteractive({\r\n title,\r\n content,\r\n actions = [],\r\n children,\r\n position = \"top\",\r\n trigger = \"hover\",\r\n persistent = false,\r\n className,\r\n}: TooltipInteractiveProps) {\r\n const [isVisible, setIsVisible] = useState(false);\r\n const [isHovered, setIsHovered] = useState(false);\r\n const timeoutRef = useRef<NodeJS.Timeout>(undefined);\r\n const tooltipRef = useRef<HTMLDivElement>(null);\r\n\r\n const showTooltip = () => {\r\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\r\n setIsVisible(true);\r\n };\r\n\r\n const hideTooltip = () => {\r\n if (persistent && isHovered) return;\r\n timeoutRef.current = setTimeout(() => setIsVisible(false), 100);\r\n };\r\n\r\n const handleClick = () => {\r\n if (trigger === \"click\") setIsVisible(!isVisible);\r\n };\r\n\r\n const handleClose = () => setIsVisible(false);\r\n\r\n useEffect(() => {\r\n const handleClickOutside = (event: MouseEvent) => {\r\n if (tooltipRef.current && !tooltipRef.current.contains(event.target as Node)) {\r\n if (trigger === \"click\") setIsVisible(false);\r\n }\r\n };\r\n document.addEventListener(\"mousedown\", handleClickOutside);\r\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\r\n }, [trigger]);\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 const triggerProps = trigger === \"hover\"\r\n ? { onMouseEnter: showTooltip, onMouseLeave: hideTooltip }\r\n : { onClick: handleClick };\r\n\r\n return (\r\n <div className={cn(\"relative inline-block\", className)} {...triggerProps}>\r\n {children}\r\n <AnimatePresence>\r\n {isVisible && (\r\n <motion.div\r\n ref={tooltipRef}\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 onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => { setIsHovered(false); if (trigger === \"hover\") hideTooltip(); }}\r\n className={cn(\"absolute z-50 w-80 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl shadow-xl backdrop-blur-sm\", getPositionClasses())}\r\n >\r\n <div className=\"p-4 space-y-3\">\r\n <div className=\"flex items-start justify-between gap-2\">\r\n <div className=\"flex-1 space-y-1\">\r\n {title && <h3 className=\"font-semibold text-zinc-900 dark:text-zinc-100 text-sm\">{title}</h3>}\r\n <p className=\"text-sm text-zinc-600 dark:text-zinc-400 leading-relaxed\">{content}</p>\r\n </div>\r\n {(trigger === \"click\" || persistent) && (\r\n <button onClick={handleClose} className=\"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200 transition-colors p-1 rounded-md hover:bg-zinc-100 dark:hover:bg-zinc-800\">\r\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" /></svg>\r\n </button>\r\n )}\r\n </div>\r\n {actions.length > 0 && (\r\n <div className=\"flex gap-2 pt-2 border-t border-zinc-200 dark:border-zinc-800\">\r\n {actions.map((action, index) => (\r\n <button key={index} onClick={() => { action.onClick(); if (!persistent) handleClose(); }}\r\n className={cn(\"text-xs h-8 px-3 rounded-md font-medium transition-colors\",\r\n action.variant === \"destructive\" ? \"bg-red-500 text-white hover:bg-red-600\" :\r\n action.variant === \"secondary\" ? \"bg-zinc-100 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 hover:bg-zinc-200 dark:hover:bg-zinc-700\" :\r\n \"bg-zinc-900 dark:bg-white text-white dark:text-zinc-900 hover:bg-zinc-800 dark:hover:bg-zinc-100\"\r\n )}\r\n >{action.label}</button>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </motion.div>\r\n )}\r\n </AnimatePresence>\r\n </div>\r\n );\r\n}\r\n\r\nexport default TooltipInteractive;\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 m(...i){return tailwindMerge.twMerge(clsx.clsx(i))}function L({content:i,children:h,offset:v=20,springConfig:l={stiffness:300,damping:30},className:x}){let[M,d]=react.useState(false),o=react.useRef(null),s=framerMotion.useMotionValue(0),a=framerMotion.useMotionValue(0),y=framerMotion.useSpring(s,l),z=framerMotion.useSpring(a,l),w=react.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 jsxRuntime.jsxs("div",{ref:o,className:m("relative inline-block",x),onMouseMove:w,onMouseEnter:N,onMouseLeave:k,children:[h,jsxRuntime.jsx(framerMotion.AnimatePresence,{children:M&&jsxRuntime.jsx(framerMotion.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:jsxRuntime.jsxs(framerMotion.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,jsxRuntime.jsx(framerMotion.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"}}),jsxRuntime.jsx(framerMotion.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"}),jsxRuntime.jsx(framerMotion.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;exports.TooltipMagnetic=L;exports.default=F;//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.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":"4OAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,sBAAQC,SAAAA,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,cAAAA,CAAS,KAAK,EAC1CC,CAAAA,CAAeC,YAAAA,CAAuB,IAAI,CAAA,CAE1CC,CAAAA,CAASC,4BAAe,CAAC,CAAA,CACzBC,EAASD,2BAAAA,CAAe,CAAC,EAEzBE,CAAAA,CAAUC,sBAAAA,CAAUJ,EAAQP,CAAY,CAAA,CACxCY,EAAUD,sBAAAA,CAAUF,CAAAA,CAAQT,CAAY,CAAA,CAExCa,EAAkBC,iBAAAA,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,CAA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erge } 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,CAAA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,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":"4O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,OAAA,CAAS,CAAE,QAAS,CAAE,CAAA,CAAG,QAAS,CAAE,OAAA,CAAS,CAAE,CAAA,CAAG,UAAA,CAAY,CAAE,KAAA,CAAO,EAAI,EAAG,SAAA,CAAU,mGAAA,CAAoG,EACxMF,cAAAA,CAACE,mBAAAA,CAAO,IAAP,CACC,OAAA,CAAS,CAAE,KAAA,CAAO,CAAE,CAAA,CACpB,OAAA,CAAS,CAAE,KAAA,CAAO,CAAE,EACpB,UAAA,CAAY,CAAE,MAAO,EAAA,CAAK,IAAA,CAAM,SAAU,SAAA,CAAW,GAAI,EACzD,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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,EACAa,GAAAA,CAACE,MAAAA,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.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 } 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
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var react=require('react'),jsxRuntime=require('react/jsx-runtime');function W({lineColor:h="black",backgroundColor:P="transparent",waveSpeedX:d=.0125,waveSpeedY:v=.005,waveAmpX:b=32,waveAmpY:w=16,xGap:s=10,yGap:o=32,friction:y=.925,tension:z=.005,maxCursorMove:N=100,style:S={},className:k=""}){let g=react.useRef(null),C=react.useRef(null),i=react.useRef(null);return react.useEffect(()=>{let e=C.current,M=g.current;if(!e||!M)return;let t=e.getContext("2d");if(!t)return;let c=0,a=()=>{let n=M.getBoundingClientRect();e.width=n.width,e.height=n.height;},p=()=>{if(!t||!e)return;t.clearRect(0,0,e.width,e.height),t.strokeStyle=h,t.lineWidth=1;let n=Math.ceil(e.width/s),L=Math.ceil(e.height/o);for(let l=0;l<=n;l++){t.beginPath();for(let r=0;r<=L;r++){let u=l*s,m=r*o,R=Math.sin(m*.01+c*d)*b,x=Math.cos(u*.01+c*v)*w;r===0?t.moveTo(u+R,m+x):t.lineTo(u+R,m+x);}t.stroke();}c+=1,i.current=requestAnimationFrame(p);};return a(),window.addEventListener("resize",a),p(),()=>{window.removeEventListener("resize",a),i.current!==null&&cancelAnimationFrame(i.current);}},[h,d,v,b,w,s,o]),jsxRuntime.jsx("div",{ref:g,className:`absolute inset-0 overflow-hidden ${k}`,style:{backgroundColor:P,...S},children:jsxRuntime.jsx("canvas",{ref:C,className:"w-full h-full"})})}var H=W;exports.Waves=W;exports.default=H;//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/waves/index.tsx"],"names":["Waves","lineColor","backgroundColor","waveSpeedX","waveSpeedY","waveAmpX","waveAmpY","xGap","yGap","friction","tension","maxCursorMove","style","className","containerRef","useRef","canvasRef","frameIdRef","useEffect","canvas","container","ctx","time","resize","rect","draw","cols","rows","i","j","x","y","waveX","waveY","jsx","waves_default"],"mappings":"yIAoBO,SAASA,CAAAA,CAAM,CACpB,SAAA,CAAAC,CAAAA,CAAY,QACZ,eAAA,CAAAC,CAAAA,CAAkB,aAAA,CAClB,UAAA,CAAAC,CAAAA,CAAa,KAAA,CACb,UAAA,CAAAC,CAAAA,CAAa,KACb,QAAA,CAAAC,CAAAA,CAAW,EAAA,CACX,QAAA,CAAAC,CAAAA,CAAW,EAAA,CACX,IAAA,CAAAC,CAAAA,CAAO,GACP,IAAA,CAAAC,CAAAA,CAAO,EAAA,CACP,QAAA,CAAAC,CAAAA,CAAW,IAAA,CACX,OAAA,CAAAC,CAAAA,CAAU,KACV,aAAA,CAAAC,CAAAA,CAAgB,GAAA,CAChB,KAAA,CAAAC,CAAAA,CAAQ,EAAC,CACT,SAAA,CAAAC,EAAY,EACd,CAAA,CAAe,CACb,IAAMC,CAAAA,CAAeC,YAAAA,CAAuB,IAAI,CAAA,CAC1CC,EAAYD,YAAAA,CAA0B,IAAI,CAAA,CAC1CE,CAAAA,CAAaF,YAAAA,CAAsB,IAAI,CAAA,CAE7C,OAAAG,gBAAU,IAAM,CACd,IAAMC,CAAAA,CAAS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ineColor?: string;\r\n backgroundColor?: string;\r\n waveSpeedX?: number;\r\n waveSpeedY?: number;\r\n waveAmpX?: number;\r\n waveAmpY?: number;\r\n xGap?: number;\r\n yGap?: number;\r\n friction?: number;\r\n tension?: number;\r\n maxCursorMove?: number;\r\n style?: CSSProperties;\r\n className?: string;\r\n}\r\n\r\nexport function Waves({\r\n lineColor = \"black\",\r\n backgroundColor = \"transparent\",\r\n waveSpeedX = 0.0125,\r\n waveSpeedY = 0.005,\r\n waveAmpX = 32,\r\n waveAmpY = 16,\r\n xGap = 10,\r\n yGap = 32,\r\n friction = 0.925,\r\n tension = 0.005,\r\n maxCursorMove = 100,\r\n style = {},\r\n className = \"\",\r\n}: WavesProps) {\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const canvasRef = useRef<HTMLCanvasElement>(null);\r\n const frameIdRef = useRef<number | null>(null);\r\n\r\n useEffect(() => {\r\n const canvas = canvasRef.current;\r\n const container = containerRef.current;\r\n if (!canvas || !container) return;\r\n\r\n const ctx = canvas.getContext(\"2d\");\r\n if (!ctx) return;\r\n\r\n let time = 0;\r\n\r\n const resize = () => {\r\n const rect = container.getBoundingClientRect();\r\n canvas.width = rect.width;\r\n canvas.height = rect.height;\r\n };\r\n\r\n const draw = () => {\r\n if (!ctx || !canvas) return;\r\n\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n ctx.strokeStyle = lineColor;\r\n ctx.lineWidth = 1;\r\n\r\n const cols = Math.ceil(canvas.width / xGap);\r\n const rows = Math.ceil(canvas.height / yGap);\r\n\r\n for (let i = 0; i <= cols; i++) {\r\n ctx.beginPath();\r\n for (let j = 0; j <= rows; j++) {\r\n const x = i * xGap;\r\n const y = j * yGap;\r\n const waveX = Math.sin(y * 0.01 + time * waveSpeedX) * waveAmpX;\r\n const waveY = Math.cos(x * 0.01 + time * waveSpeedY) * waveAmpY;\r\n\r\n if (j === 0) {\r\n ctx.moveTo(x + waveX, y + waveY);\r\n } else {\r\n ctx.lineTo(x + waveX, y + waveY);\r\n }\r\n }\r\n ctx.stroke();\r\n }\r\n\r\n time += 1;\r\n frameIdRef.current = requestAnimationFrame(draw);\r\n };\r\n\r\n resize();\r\n window.addEventListener(\"resize\", resize);\r\n draw();\r\n\r\n return () => {\r\n window.removeEventListener(\"resize\", resize);\r\n if (frameIdRef.current !== null) {\r\n cancelAnimationFrame(frameIdRef.current);\r\n }\r\n };\r\n }, [lineColor, waveSpeedX, waveSpeedY, waveAmpX, waveAmpY, xGap, yGap]);\r\n\r\n return (\r\n <div\r\n ref={containerRef}\r\n className={`absolute inset-0 overflow-hidden ${className}`}\r\n style={{ backgroundColor, ...style }}\r\n >\r\n <canvas ref={canvasRef} className=\"w-full h-full\" />\r\n </div>\r\n );\r\n}\r\n\r\nexport default Waves;\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {useRef,useEffect}from'react';import {jsx}from'react/jsx-runtime';function W({lineColor:h="black",backgroundColor:P="transparent",waveSpeedX:d=.0125,waveSpeedY:v=.005,waveAmpX:b=32,waveAmpY:w=16,xGap:s=10,yGap:o=32,friction:y=.925,tension:z=.005,maxCursorMove:N=100,style:S={},className:k=""}){let g=useRef(null),C=useRef(null),i=useRef(null);return useEffect(()=>{let e=C.current,M=g.current;if(!e||!M)return;let t=e.getContext("2d");if(!t)return;let c=0,a=()=>{let n=M.getBoundingClientRect();e.width=n.width,e.height=n.height;},p=()=>{if(!t||!e)return;t.clearRect(0,0,e.width,e.height),t.strokeStyle=h,t.lineWidth=1;let n=Math.ceil(e.width/s),L=Math.ceil(e.height/o);for(let l=0;l<=n;l++){t.beginPath();for(let r=0;r<=L;r++){let u=l*s,m=r*o,R=Math.sin(m*.01+c*d)*b,x=Math.cos(u*.01+c*v)*w;r===0?t.moveTo(u+R,m+x):t.lineTo(u+R,m+x);}t.stroke();}c+=1,i.current=requestAnimationFrame(p);};return a(),window.addEventListener("resize",a),p(),()=>{window.removeEventListener("resize",a),i.current!==null&&cancelAnimationFrame(i.current);}},[h,d,v,b,w,s,o]),jsx("div",{ref:g,className:`absolute inset-0 overflow-hidden ${k}`,style:{backgroundColor:P,...S},children:jsx("canvas",{ref:C,className:"w-full h-full"})})}var H=W;export{W as Waves,H as default};//# sourceMappingURL=index.mjs.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/waves/index.tsx"],"names":["Waves","lineColor","backgroundColor","waveSpeedX","waveSpeedY","waveAmpX","waveAmpY","xGap","yGap","friction","tension","maxCursorMove","style","className","containerRef","useRef","canvasRef","frameIdRef","useEffect","canvas","container","ctx","time","resize","rect","draw","cols","rows","i","j","x","y","waveX","waveY","jsx","waves_default"],"mappings":"yEAoBO,SAASA,CAAAA,CAAM,CACpB,SAAA,CAAAC,CAAAA,CAAY,QACZ,eAAA,CAAAC,CAAAA,CAAkB,aAAA,CAClB,UAAA,CAAAC,CAAAA,CAAa,KAAA,CACb,UAAA,CAAAC,CAAAA,CAAa,KACb,QAAA,CAAAC,CAAAA,CAAW,EAAA,CACX,QAAA,CAAAC,CAAAA,CAAW,EAAA,CACX,IAAA,CAAAC,CAAAA,CAAO,GACP,IAAA,CAAAC,CAAAA,CAAO,EAAA,CACP,QAAA,CAAAC,CAAAA,CAAW,IAAA,CACX,OAAA,CAAAC,CAAAA,CAAU,KACV,aAAA,CAAAC,CAAAA,CAAgB,GAAA,CAChB,KAAA,CAAAC,CAAAA,CAAQ,EAAC,CACT,SAAA,CAAAC,EAAY,EACd,CAAA,CAAe,CACb,IAAMC,CAAAA,CAAeC,MAAAA,CAAuB,IAAI,CAAA,CAC1CC,EAAYD,MAAAA,CAA0B,IAAI,CAAA,CAC1CE,CAAAA,CAAaF,MAAAA,CAAsB,IAAI,CAAA,CAE7C,OAAAG,UAAU,IAAM,CACd,IAAMC,CAAAA,CAASH,CAAAA,CAAU,OAAA,CACnBI,CAAAA,CAAYN,CAAAA,CAAa,QAC/B,GAAI,CAACK,CAAAA,EAAU,CAACC,CAAAA,CAAW,OAE3B,IA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AAA,GAAM,CAAA,CACRR,CAAAA,CAAI,MAAA,CAAOS,CAAAA,CAAIE,CAAAA,CAAOD,CAAAA,CAAIE,CAAK,EAE/BZ,CAAAA,CAAI,MAAA,CAAOS,CAAAA,CAAIE,CAAAA,CAAOD,CAAAA,CAAIE,CAAK,EAEnC,CACAZ,EAAI,MAAA,GACN,CAEAC,CAAAA,EAAQ,CAAA,CACRL,CAAAA,CAAW,OAAA,CAAU,qBAAA,CAAsBQ,CAAI,EACjD,CAAA,CAEA,OAAAF,CAAAA,EAAO,CACP,MAAA,CAAO,gBAAA,CAAiB,QAAA,CAAUA,CAAM,CAAA,CACxCE,CAAAA,EAAK,CAEE,IAAM,CACX,MAAA,CAAO,mBAAA,CAAoB,QAAA,CAAUF,CAAM,CAAA,CACvCN,CAAAA,CAAW,OAAA,GAAY,IAAA,EACzB,oBAAA,CAAqBA,CAAAA,CAAW,OAAO,EAE3C,CACF,CAAA,CAAG,CAAChB,CAAAA,CAAWE,CAAAA,CAAYC,CAAAA,CAAYC,CAAAA,CAAUC,CAAAA,CAAUC,CAAAA,CAAMC,CAAI,CAAC,CAAA,CAGpE0B,GAAAA,CAAC,KAAA,CAAA,CACC,GAAA,CAAKpB,CAAAA,CACL,SAAA,CAAW,CAAA,iCAAA,EAAoCD,CAAS,CAAA,CAAA,CACxD,KAAA,CAAO,CAAE,eAAA,CAAAX,CAAAA,CAAiB,GAAGU,CAAM,CAAA,CAEnC,SAAAsB,GAAAA,CAAC,QAAA,CAAA,CAAO,GAAA,CAAKlB,CAAAA,CAAW,UAAU,eAAA,CAAgB,CAAA,CACpD,CAEJ,KAEOmB,CAAAA,CAAQnC","file":"index.mjs","sourcesContent":["\"use client\";\r\n\r\nimport { useRef, useEffect, CSSProperties } from \"react\";\r\n\r\ninterface WavesProps {\r\n lineColor?: string;\r\n backgroundColor?: string;\r\n waveSpeedX?: number;\r\n waveSpeedY?: number;\r\n waveAmpX?: number;\r\n waveAmpY?: number;\r\n xGap?: number;\r\n yGap?: number;\r\n friction?: number;\r\n tension?: number;\r\n maxCursorMove?: number;\r\n style?: CSSProperties;\r\n className?: string;\r\n}\r\n\r\nexport function Waves({\r\n lineColor = \"black\",\r\n backgroundColor = \"transparent\",\r\n waveSpeedX = 0.0125,\r\n waveSpeedY = 0.005,\r\n waveAmpX = 32,\r\n waveAmpY = 16,\r\n xGap = 10,\r\n yGap = 32,\r\n friction = 0.925,\r\n tension = 0.005,\r\n maxCursorMove = 100,\r\n style = {},\r\n className = \"\",\r\n}: WavesProps) {\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const canvasRef = useRef<HTMLCanvasElement>(null);\r\n const frameIdRef = useRef<number | null>(null);\r\n\r\n useEffect(() => {\r\n const canvas = canvasRef.current;\r\n const container = containerRef.current;\r\n if (!canvas || !container) return;\r\n\r\n const ctx = canvas.getContext(\"2d\");\r\n if (!ctx) return;\r\n\r\n let time = 0;\r\n\r\n const resize = () => {\r\n const rect = container.getBoundingClientRect();\r\n canvas.width = rect.width;\r\n canvas.height = rect.height;\r\n };\r\n\r\n const draw = () => {\r\n if (!ctx || !canvas) return;\r\n\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n ctx.strokeStyle = lineColor;\r\n ctx.lineWidth = 1;\r\n\r\n const cols = Math.ceil(canvas.width / xGap);\r\n const rows = Math.ceil(canvas.height / yGap);\r\n\r\n for (let i = 0; i <= cols; i++) {\r\n ctx.beginPath();\r\n for (let j = 0; j <= rows; j++) {\r\n const x = i * xGap;\r\n const y = j * yGap;\r\n const waveX = Math.sin(y * 0.01 + time * waveSpeedX) * waveAmpX;\r\n const waveY = Math.cos(x * 0.01 + time * waveSpeedY) * waveAmpY;\r\n\r\n if (j === 0) {\r\n ctx.moveTo(x + waveX, y + waveY);\r\n } else {\r\n ctx.lineTo(x + waveX, y + waveY);\r\n }\r\n }\r\n ctx.stroke();\r\n }\r\n\r\n time += 1;\r\n frameIdRef.current = requestAnimationFrame(draw);\r\n };\r\n\r\n resize();\r\n window.addEventListener(\"resize\", resize);\r\n draw();\r\n\r\n return () => {\r\n window.removeEventListener(\"resize\", resize);\r\n if (frameIdRef.current !== null) {\r\n cancelAnimationFrame(frameIdRef.current);\r\n }\r\n };\r\n }, [lineColor, waveSpeedX, waveSpeedY, waveAmpX, waveAmpY, xGap, yGap]);\r\n\r\n return (\r\n <div\r\n ref={containerRef}\r\n className={`absolute inset-0 overflow-hidden ${className}`}\r\n style={{ backgroundColor, ...style }}\r\n >\r\n <canvas ref={canvasRef} className=\"w-full h-full\" />\r\n </div>\r\n );\r\n}\r\n\r\nexport default Waves;\r\n"]}