@stfrigerio/sito-template 0.1.44 → 0.1.48

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 (191) hide show
  1. package/dist/components/organisms/charts/SunburstChart/SunburstChart.d.ts.map +1 -1
  2. package/dist/index.esm.js +113 -147
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.js +113 -147
  5. package/dist/index.js.map +1 -1
  6. package/dist/styles.css +1 -1
  7. package/dist/styles.css.map +1 -1
  8. package/package.json +2 -2
  9. package/storybook-static/assets/{ASCIIText.stories-BSKNvcoU.js → ASCIIText.stories-DpBtrb9i.js} +1 -1
  10. package/storybook-static/assets/{AllAtoms.stories-BheGtT2x.js → AllAtoms.stories-C2hvLJ8w.js} +1 -1
  11. package/storybook-static/assets/{AnimatedContent.stories-DHs1c0dV.js → AnimatedContent.stories-Di9Q7t9j.js} +1 -1
  12. package/storybook-static/assets/{AnimatedList.stories-DIfbjb22.js → AnimatedList.stories-BGyYB85Y.js} +1 -1
  13. package/storybook-static/assets/{Antigravity.stories-BsyCq_d_.js → Antigravity.stories-Do1dnEK_.js} +1 -1
  14. package/storybook-static/assets/{ArrayInput.stories-Vhl_2MiN.js → ArrayInput.stories-CNtTKUF0.js} +1 -1
  15. package/storybook-static/assets/{Aurora.stories-C7vxHFyZ.js → Aurora.stories-DHuVs0Nh.js} +1 -1
  16. package/storybook-static/assets/{Beams.stories-WmoAQdE2.js → Beams.stories-C0fr646Y.js} +1 -1
  17. package/storybook-static/assets/{BlobCursor.stories-Do76vl4q.js → BlobCursor.stories-CQmLI7VF.js} +1 -1
  18. package/storybook-static/assets/{BlurText.stories-CIsxOJyQ.js → BlurText.stories-Bqhf_75C.js} +1 -1
  19. package/storybook-static/assets/{BooleansHeatmap.stories-DIdVIPVH.js → BooleansHeatmap.stories-CSTfHU8X.js} +1 -1
  20. package/storybook-static/assets/{BorderGlow.stories-B88w6QLt.js → BorderGlow.stories-DllLrSOi.js} +1 -1
  21. package/storybook-static/assets/{BubbleMenu.stories-CjsSE6cs.js → BubbleMenu.stories-By8eacsb.js} +1 -1
  22. package/storybook-static/assets/{Button-C_YZ5gR4.js → Button-2CSvbnXB.js} +1 -1
  23. package/storybook-static/assets/{Button.stories-Mw6nstnk.js → Button.stories-CMFODsAR.js} +1 -1
  24. package/storybook-static/assets/Calendar-gAaU5NXk.css +1 -0
  25. package/storybook-static/assets/{Calendar.stories-Dxshyi2I.js → Calendar.stories-BPwP3WUJ.js} +6 -6
  26. package/storybook-static/assets/{Card-C1evZ1rT.js → Card-DZVLYsdd.js} +1 -1
  27. package/storybook-static/assets/{Card.stories-Cd8o0lJL.js → Card.stories-DisHmL7k.js} +1 -1
  28. package/storybook-static/assets/{CardNav.stories-CVCNllVh.js → CardNav.stories-e50-9J_A.js} +1 -1
  29. package/storybook-static/assets/{Carousel.stories-DXvKLxeO.js → Carousel.stories-B-rI6jNr.js} +1 -1
  30. package/storybook-static/assets/{Checkbox-tM16vTif.js → Checkbox-D7FUqeuB.js} +1 -1
  31. package/storybook-static/assets/{Checkbox.stories-dhEm8gbi.js → Checkbox.stories-CyIVTBxZ.js} +1 -1
  32. package/storybook-static/assets/{ChromaGrid.stories-_N6hSynZ.js → ChromaGrid.stories-S1cYuc5_.js} +1 -1
  33. package/storybook-static/assets/{CircularGallery.stories-c7BEdmTm.js → CircularGallery.stories-DRrEcX-Y.js} +1 -1
  34. package/storybook-static/assets/{CircularText.stories-BCoG12vU.js → CircularText.stories-CHoRy-lV.js} +1 -1
  35. package/storybook-static/assets/{ClickSpark.stories-BOypb8hM.js → ClickSpark.stories-DbPNmGUE.js} +1 -1
  36. package/storybook-static/assets/{Color-AVL7NMMY-iZX0v-MX.js → Color-AVL7NMMY-C-H2x7hU.js} +1 -1
  37. package/storybook-static/assets/{ColorBends.stories-DJVplB1e.js → ColorBends.stories-BVGGr3v3.js} +1 -1
  38. package/storybook-static/assets/{CountUp.stories-CZoxCmOS.js → CountUp.stories-Ofg9f0h2.js} +1 -1
  39. package/storybook-static/assets/{Counter.stories-CD2CN6Rs.js → Counter.stories-CsO7AtIx.js} +1 -1
  40. package/storybook-static/assets/{Crosshair.stories-pKH0CRjB.js → Crosshair.stories-kyfwqcvB.js} +1 -1
  41. package/storybook-static/assets/{Cubes.stories-CG6EoDFk.js → Cubes.stories-hA-HjWNO.js} +1 -1
  42. package/storybook-static/assets/{CurvedLoop.stories-2_6LGDBt.js → CurvedLoop.stories-CHdhTRmN.js} +1 -1
  43. package/storybook-static/assets/{DarkVeil.stories-NPy-IAdE.js → DarkVeil.stories-B68s8uCO.js} +1 -1
  44. package/storybook-static/assets/{DateInput-bEXupMbC.js → DateInput-DYaAr-pD.js} +1 -1
  45. package/storybook-static/assets/{DateInput.stories-Di9xlwl-.js → DateInput.stories-D8DGjdAu.js} +1 -1
  46. package/storybook-static/assets/{DecayCard.stories-C_nLJJYv.js → DecayCard.stories-RASuy9DU.js} +1 -1
  47. package/storybook-static/assets/{DecryptedText.stories-B3nmn_C5.js → DecryptedText.stories-BYt96S4h.js} +1 -1
  48. package/storybook-static/assets/{Dither.stories-DYFkOPEa.js → Dither.stories-BoRhWSS3.js} +1 -1
  49. package/storybook-static/assets/{Dock.stories-D5xKRTwB.js → Dock.stories-HG_pJS3N.js} +1 -1
  50. package/storybook-static/assets/{DocsRenderer-PQXLIZUC-qnjLy5zI.js → DocsRenderer-PQXLIZUC-DhsqOTVk.js} +4 -4
  51. package/storybook-static/assets/{EditFAB.stories-D7WePUUN.js → EditFAB.stories-CTGHZ2-N.js} +1 -1
  52. package/storybook-static/assets/{EvilEye.stories-Cov9VutU.js → EvilEye.stories-CIq_GN_B.js} +1 -1
  53. package/storybook-static/assets/{FadeContent.stories-mHhk3715.js → FadeContent.stories-D4XSUqNs.js} +1 -1
  54. package/storybook-static/assets/{FaultyTerminal.stories-DjKOHL4-.js → FaultyTerminal.stories-D47h3D9_.js} +1 -1
  55. package/storybook-static/assets/{Fbo-CDZq1mNj.js → Fbo-DJ3Mfipf.js} +1 -1
  56. package/storybook-static/assets/{FloatingLines.stories-B_dxBmBz.js → FloatingLines.stories-DwrsyJ8S.js} +1 -1
  57. package/storybook-static/assets/{FlowingMenu.stories-DdUqXTFx.js → FlowingMenu.stories-BQGeeDYk.js} +1 -1
  58. package/storybook-static/assets/{FluidGlass.stories-C6FrnI3D.js → FluidGlass.stories-BNEe11fE.js} +1 -1
  59. package/storybook-static/assets/{Folder.stories-Zb5rwe3k.js → Folder.stories-C34siiUF.js} +1 -1
  60. package/storybook-static/assets/{FuzzyText.stories-CoZEjZrD.js → FuzzyText.stories-DoRGPHuR.js} +1 -1
  61. package/storybook-static/assets/{Galaxy.stories-D8hfMx7x.js → Galaxy.stories-CoORoc2P.js} +1 -1
  62. package/storybook-static/assets/{GhostCursor.stories-DmAEHIj2.js → GhostCursor.stories-qUL8J6dR.js} +1 -1
  63. package/storybook-static/assets/{GlareHover.stories-C2pGThOS.js → GlareHover.stories-CCdco059.js} +1 -1
  64. package/storybook-static/assets/{GlassSurface.stories-Dt29DAS0.js → GlassSurface.stories-DZY8JTI_.js} +1 -1
  65. package/storybook-static/assets/{GlitchText.stories-sqo6Y5iu.js → GlitchText.stories-BOc2qtp8.js} +1 -1
  66. package/storybook-static/assets/{GooeyNav.stories-DxgFxo-U.js → GooeyNav.stories-AdVJ0HTE.js} +1 -1
  67. package/storybook-static/assets/{GradientBlinds.stories-BO3udAca.js → GradientBlinds.stories-CPMa1wbI.js} +1 -1
  68. package/storybook-static/assets/{GradientText.stories-DwqimEmN.js → GradientText.stories-DiQ4BiOA.js} +1 -1
  69. package/storybook-static/assets/{Grainient.stories-DrGFYn0A.js → Grainient.stories-6AktjTpR.js} +1 -1
  70. package/storybook-static/assets/{GridMotion.stories-Rbww9MSf.js → GridMotion.stories-CpUxov1L.js} +1 -1
  71. package/storybook-static/assets/{ImageSlideshow.stories-BOxjGf7e.js → ImageSlideshow.stories-BB_WEc_C.js} +1 -1
  72. package/storybook-static/assets/{Iridescence.stories-CTQo8feH.js → Iridescence.stories-DVY4Ad82.js} +1 -1
  73. package/storybook-static/assets/{LaserFlow.stories-DsHyOCT6.js → LaserFlow.stories-BIwcrTST.js} +1 -1
  74. package/storybook-static/assets/{LetterGlitch.stories-DYnbcxa2.js → LetterGlitch.stories-CYLP01fr.js} +1 -1
  75. package/storybook-static/assets/{LightPillar.stories-C0oLGh9j.js → LightPillar.stories-Op3-RL2H.js} +1 -1
  76. package/storybook-static/assets/{LightRays.stories-y4A3LO7i.js → LightRays.stories-BWfITZGs.js} +1 -1
  77. package/storybook-static/assets/{Lightning.stories-Bjuvt9ng.js → Lightning.stories-z3EqNFWs.js} +1 -1
  78. package/storybook-static/assets/{LineWaves.stories-DXHfmcAY.js → LineWaves.stories-CN-U2RZb.js} +1 -1
  79. package/storybook-static/assets/{LiquidChrome.stories-BIJKsALp.js → LiquidChrome.stories-CQunDA00.js} +1 -1
  80. package/storybook-static/assets/{LiquidEther.stories-Zn4y8_Dj.js → LiquidEther.stories-Dx5E22qa.js} +1 -1
  81. package/storybook-static/assets/{LoadingSpinner-T2OjcR-z.js → LoadingSpinner-xoFPGq9a.js} +1 -1
  82. package/storybook-static/assets/{LoadingSpinner.stories-YZPlVrIL.js → LoadingSpinner.stories-BXcLzSiN.js} +1 -1
  83. package/storybook-static/assets/{MagicRings.stories-B17cxZu8.js → MagicRings.stories-ChpUpgBm.js} +1 -1
  84. package/storybook-static/assets/{Magnet.stories-C6geVwXu.js → Magnet.stories-CUAsnJjx.js} +1 -1
  85. package/storybook-static/assets/{MagnetLines.stories-uCo-0xpG.js → MagnetLines.stories-BtKFg9_t.js} +1 -1
  86. package/storybook-static/assets/{Masonry.stories-BsaHuUl3.js → Masonry.stories-BfT7aonk.js} +1 -1
  87. package/storybook-static/assets/{MetaBalls.stories-CfS9YAYf.js → MetaBalls.stories-Bpx6y2Mq.js} +1 -1
  88. package/storybook-static/assets/{MetallicPaint.stories-CPnRKq8Y.js → MetallicPaint.stories-i_KuUoJ7.js} +1 -1
  89. package/storybook-static/assets/{MoodChart.stories-Bhzx-Mki.js → MoodChart.stories-BUrwIpbe.js} +1 -1
  90. package/storybook-static/assets/{MotionConfigContext-4uS6JRtS.js → MotionConfigContext-BdSKNtzx.js} +1 -1
  91. package/storybook-static/assets/{Navbar.stories-CTJisFgI.js → Navbar.stories-B5n2URGj.js} +1 -1
  92. package/storybook-static/assets/{Noise.stories-CV2ieqjl.js → Noise.stories-BiOgX5JV.js} +1 -1
  93. package/storybook-static/assets/{NumberStepper-0N2zZmLM.js → NumberStepper-DvLaVPaJ.js} +1 -1
  94. package/storybook-static/assets/{NumberStepper.stories-DO0SaXet.js → NumberStepper.stories-Tp2dyXJp.js} +1 -1
  95. package/storybook-static/assets/{Orb.stories-BO2G-id7.js → Orb.stories-B4ymfobF.js} +1 -1
  96. package/storybook-static/assets/{OrbitImages.stories-Dd0Un1zc.js → OrbitImages.stories-BOOJ2sLz.js} +1 -1
  97. package/storybook-static/assets/{PieChart.stories-YSBHUrlk.js → PieChart.stories-eN4T-LQ5.js} +1 -1
  98. package/storybook-static/assets/{PixelBlast.stories-DLOdQdBC.js → PixelBlast.stories-CKyxO1s-.js} +1 -1
  99. package/storybook-static/assets/{PixelCard.stories-DL1EW33U.js → PixelCard.stories-DNkvTz5j.js} +1 -1
  100. package/storybook-static/assets/{PixelSnow.stories-40ms3GpO.js → PixelSnow.stories-DDwr-w1I.js} +1 -1
  101. package/storybook-static/assets/{PixelTransition.stories-Ce0j1LoP.js → PixelTransition.stories-nLfk3vHv.js} +1 -1
  102. package/storybook-static/assets/{Plasma.stories-C-qYly6i.js → Plasma.stories-CiQrlhdr.js} +1 -1
  103. package/storybook-static/assets/{Prism.stories-BzLhe_ek.js → Prism.stories-DiUQJHSM.js} +1 -1
  104. package/storybook-static/assets/{PrismaticBurst.stories-DODqjw3j.js → PrismaticBurst.stories-CE1GpHYN.js} +1 -1
  105. package/storybook-static/assets/{ProfileCard.stories-DUyZIJ8A.js → ProfileCard.stories-CLCPDEvl.js} +1 -1
  106. package/storybook-static/assets/{QuantifiableHabitsChart.stories-DvgzevZP.js → QuantifiableHabitsChart.stories-qCi1Hwlz.js} +1 -1
  107. package/storybook-static/assets/{Radar.stories-2RPf1QSy.js → Radar.stories-DKY5fGUM.js} +1 -1
  108. package/storybook-static/assets/{Ribbons.stories-RmoPiIi9.js → Ribbons.stories-fdt7Dly3.js} +1 -1
  109. package/storybook-static/assets/{RippleGrid.stories-Otw1g2CJ.js → RippleGrid.stories-n5CU7uPT.js} +1 -1
  110. package/storybook-static/assets/{RotatingText.stories-NgYC0KMN.js → RotatingText.stories-D345b2IH.js} +1 -1
  111. package/storybook-static/assets/{ScrollFloat.stories-BFBCdW8h.js → ScrollFloat.stories-vqa9uxYG.js} +1 -1
  112. package/storybook-static/assets/{ScrollReveal.stories-JKNxxGAh.js → ScrollReveal.stories-dYbCWXJL.js} +1 -1
  113. package/storybook-static/assets/{ScrollVelocity.stories-C8kmHqS4.js → ScrollVelocity.stories-BNKZ-bfJ.js} +1 -1
  114. package/storybook-static/assets/{SearchBar.stories-C7Ba5BXp.js → SearchBar.stories-CXEYCYtx.js} +1 -1
  115. package/storybook-static/assets/{SearchableDropdown-C_6nW_fM.js → SearchableDropdown-BTWjVlVv.js} +1 -1
  116. package/storybook-static/assets/{SearchableDropdown.stories-Cr7zD259.js → SearchableDropdown.stories-BBXXroOM.js} +1 -1
  117. package/storybook-static/assets/{SelectInput-Cq1kd98Q.js → SelectInput-BhKBu2cI.js} +1 -1
  118. package/storybook-static/assets/{SelectInput.stories-BdpLeHVn.js → SelectInput.stories-W6PuLg-G.js} +1 -1
  119. package/storybook-static/assets/{ShapeBlur.stories-lRfZvgfc.js → ShapeBlur.stories-wsyTNDdI.js} +1 -1
  120. package/storybook-static/assets/{ShapeGrid.stories-CfjM9fjH.js → ShapeGrid.stories-BP0HTLmc.js} +1 -1
  121. package/storybook-static/assets/{ShinyText.stories-DKdXfhML.js → ShinyText.stories-2ZQhiBft.js} +1 -1
  122. package/storybook-static/assets/{Silk.stories-CjTLyn1c.js → Silk.stories-C973tELu.js} +1 -1
  123. package/storybook-static/assets/{SleepChart.stories-DJ12EHQj.js → SleepChart.stories-C-nic0Hg.js} +1 -1
  124. package/storybook-static/assets/{Slider-CjC8kTvA.js → Slider-Cj4NY5N0.js} +1 -1
  125. package/storybook-static/assets/{Slider.stories-8dOh6zEz.js → Slider.stories-DLEYO7pQ.js} +1 -1
  126. package/storybook-static/assets/{SoftAurora.stories-OVy3Uj5H.js → SoftAurora.stories-BwKGvWh1.js} +1 -1
  127. package/storybook-static/assets/{SoundDemo.stories-BMnOeJoJ.js → SoundDemo.stories-BBGMylUU.js} +1 -1
  128. package/storybook-static/assets/{SplashCursor.stories-D-l4tdFh.js → SplashCursor.stories-Nh-ONQGd.js} +1 -1
  129. package/storybook-static/assets/{SpotlightCard.stories-CGzh2DPl.js → SpotlightCard.stories-C7FUbVoM.js} +1 -1
  130. package/storybook-static/assets/{Stack.stories-CGsiQ3oD.js → Stack.stories-eXwEbGTy.js} +1 -1
  131. package/storybook-static/assets/{StaggeredMenu.stories-Bq5nvfqE.js → StaggeredMenu.stories-tgVDfUr0.js} +1 -1
  132. package/storybook-static/assets/{StarBorder.stories-CAGKcU-0.js → StarBorder.stories-D36zbc2N.js} +1 -1
  133. package/storybook-static/assets/SunburstChart-Cvr1OzgE.css +1 -0
  134. package/storybook-static/assets/SunburstChart.stories-CgCbkhG8.js +285 -0
  135. package/storybook-static/assets/{Table.stories-DNxjy4mw.js → Table.stories-BdABrDyr.js} +1 -1
  136. package/storybook-static/assets/Tabs-CLXu7F99.css +1 -0
  137. package/storybook-static/assets/{Tabs.stories-CujhnpzV.js → Tabs.stories-BwzAz5v_.js} +6 -6
  138. package/storybook-static/assets/{TargetCursor.stories-CjS6RpDB.js → TargetCursor.stories-D1M0ZV-S.js} +1 -1
  139. package/storybook-static/assets/{TextArea-DHBnvidn.js → TextArea-CMvPbRqQ.js} +1 -1
  140. package/storybook-static/assets/{TextArea.stories-CCC4mZkh.js → TextArea.stories-DmAuD1fB.js} +1 -1
  141. package/storybook-static/assets/{TextCursor.stories-DbbUKuuf.js → TextCursor.stories-CJmFUz8s.js} +1 -1
  142. package/storybook-static/assets/{TextInput-BRLXZRi0.js → TextInput-7QROD9Bu.js} +1 -1
  143. package/storybook-static/assets/{TextInput.stories-DzmoEdX3.js → TextInput.stories-Cwf2_Ika.js} +1 -1
  144. package/storybook-static/assets/{TextPressure.stories-BjGjNHuq.js → TextPressure.stories-CB8UIoN_.js} +1 -1
  145. package/storybook-static/assets/{TextType.stories-BCEjz-Zi.js → TextType.stories-D4ZEW3Fz.js} +1 -1
  146. package/storybook-static/assets/{ThemeSwitcher.stories-0T7fY3d_.js → ThemeSwitcher.stories-DHgVmIcC.js} +1 -1
  147. package/storybook-static/assets/{Threads.stories-DDlSfgD5.js → Threads.stories-P32yG4P8.js} +1 -1
  148. package/storybook-static/assets/{TimeInput.stories-CjV4ksEX.js → TimeInput.stories-Dkkdpsta.js} +1 -1
  149. package/storybook-static/assets/{Toggle-C26yCxt_.js → Toggle-DLu7xVQv.js} +1 -1
  150. package/storybook-static/assets/{Toggle.stories-D5LQoJpm.js → Toggle.stories-BSS4Epfw.js} +1 -1
  151. package/storybook-static/assets/{ToggleButton-DKVqKQxZ.js → ToggleButton-Cq7dxxuH.js} +1 -1
  152. package/storybook-static/assets/{ToggleButton.stories-BfAEDMOR.js → ToggleButton.stories-BZvOkwfy.js} +1 -1
  153. package/storybook-static/assets/{TrueFocus.stories-DA9Ysraz.js → TrueFocus.stories-BMRj967B.js} +1 -1
  154. package/storybook-static/assets/{VariableProximity.stories-CN-Q4WDX.js → VariableProximity.stories-B6-tbs3n.js} +1 -1
  155. package/storybook-static/assets/{Waves.stories-W2IDhrZm.js → Waves.stories-CAJon3iL.js} +1 -1
  156. package/storybook-static/assets/{check-Bh0K2zJt.js → check-D8bWZLP6.js} +1 -1
  157. package/storybook-static/assets/{chevron-down-B26xHSrx.js → chevron-down-BZPtZoHS.js} +1 -1
  158. package/storybook-static/assets/{chevron-right-4NIYYZ8p.js → chevron-right-B4kqmwjo.js} +1 -1
  159. package/storybook-static/assets/client-er7qZ0kF.js +1 -0
  160. package/storybook-static/assets/{createLucideIcon-wa-8tr0c.js → createLucideIcon-Eaeny9Zi.js} +1 -1
  161. package/storybook-static/assets/{folder-OUDa6Ti7.js → folder-DNcKa6s5.js} +1 -1
  162. package/storybook-static/assets/{iconBase-fo9b9WAM.js → iconBase-CstVDnta.js} +1 -1
  163. package/storybook-static/assets/{iframe-2N7rjfXm.js → iframe-CvT6MryR.js} +4 -4
  164. package/storybook-static/assets/{index-IKMS7NhW.js → index-2ZuXCVEx.js} +1 -1
  165. package/storybook-static/assets/{index-DaJY9FlE.js → index-Cb6YhhUk.js} +1 -1
  166. package/storybook-static/assets/{index-BXmXrRij.js → index-KuyQzDCw.js} +1 -1
  167. package/storybook-static/assets/{layout-grid-DMX9O4XB.js → layout-grid-nUVet5Tw.js} +1 -1
  168. package/storybook-static/assets/{proxy-qiKixXs8.js → proxy-0exJiild.js} +1 -1
  169. package/storybook-static/assets/{react-18-DajuY7cH.js → react-18-KOo_VULj.js} +1 -1
  170. package/storybook-static/assets/{react-three-fiber.esm-pSSy_32K.js → react-three-fiber.esm-BbD9yVT_.js} +1 -1
  171. package/storybook-static/assets/{search-DBjUUDRM.js → search-Cfa-rwoK.js} +1 -1
  172. package/storybook-static/assets/{sun-WV9AmUvz.js → sun-BwQ2hAsY.js} +1 -1
  173. package/storybook-static/assets/{use-animation-frame-DNrI5vnP.js → use-animation-frame-BOMew7B2.js} +1 -1
  174. package/storybook-static/assets/{use-in-view-Dn2glBsV.js → use-in-view-BP3CscI2.js} +1 -1
  175. package/storybook-static/assets/{use-motion-value-w2f8nz4L.js → use-motion-value-DfJqnIZb.js} +1 -1
  176. package/storybook-static/assets/{use-spring-CDOZMwuR.js → use-spring-SHZiaDU4.js} +1 -1
  177. package/storybook-static/assets/{use-transform-DZyAm4Sp.js → use-transform-CATrWDJd.js} +1 -1
  178. package/storybook-static/assets/{useSound-BBLJ5Rjg.js → useSound-DyOR6GVH.js} +1 -1
  179. package/storybook-static/assets/{users-0pBe6bxm.js → users-CoCnAJkL.js} +1 -1
  180. package/storybook-static/assets/{x-k5o8Jl5E.js → x-D_m9a61B.js} +1 -1
  181. package/storybook-static/iframe.html +1 -1
  182. package/storybook-static/project.json +1 -1
  183. package/storybook-static/sb-addons/chromatic-com-storybook-4/manager-bundle.js +1 -1
  184. package/storybook-static/sb-addons/docs-2/manager-bundle.js +2 -2
  185. package/storybook-static/sb-addons/links-3/manager-bundle.js +1 -1
  186. package/storybook-static/sb-addons/storybook-5/manager-bundle.js +1 -1
  187. package/storybook-static/assets/Calendar-zTw0ddxb.css +0 -1
  188. package/storybook-static/assets/SunburstChart-ChXvU9py.css +0 -1
  189. package/storybook-static/assets/SunburstChart.stories-ceDZ0sGS.js +0 -285
  190. package/storybook-static/assets/Tabs-BfJ7skOE.css +0 -1
  191. package/storybook-static/assets/client-CyPtLppF.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as z,j as Ee}from"./iframe-2N7rjfXm.js";import{E as re,R as le,b as ie,a as me}from"./index-DcRHiSf7.js";import{W as we,d as ne,n as Re,S as Ce,a as Pe,i as qe,a9 as Te,q as be,M as Ae,f as ze,G as M,a2 as Me,z as se}from"./three.module--_vTUKhS.js";import"./preload-helper-C1FmrZbK.js";const Fe={"pixel-blast-container":"_pixel-blast-container_a95g7_1"},ke=()=>{const l=document.createElement("canvas");l.width=64,l.height=64;const i=l.getContext("2d");if(!i)throw new Error("2D context not available");i.fillStyle="black",i.fillRect(0,0,l.width,l.height);const T=new Me(l);T.minFilter=se,T.magFilter=se,T.generateMipmaps=!1;const E=[];let w=null;const m=64;let R=.1*64;const F=1/m,k=()=>{i.fillStyle="black",i.fillRect(0,0,l.width,l.height)},I=a=>{const n={x:a.x*64,y:(1-a.y)*64};let c=1;const C=v=>Math.sin(v*Math.PI/2),g=v=>-v*(v-2);a.age<m*.3?c=C(a.age/(m*.3)):c=g(1-(a.age-m*.3)/(m*.7))||0,c*=a.force;const h=`${(a.vx+1)/2*255}, ${(a.vy+1)/2*255}, ${c*255}`,p=64*5;i.shadowOffsetX=p,i.shadowOffsetY=p,i.shadowBlur=R,i.shadowColor=`rgba(${h},${.22*c})`,i.beginPath(),i.fillStyle="rgba(255,0,0,1)",i.arc(n.x-p,n.y-p,R,0,Math.PI*2),i.fill()};return{canvas:l,texture:T,addTouch:a=>{let n=0,c=0,C=0;if(w){const g=a.x-w.x,h=a.y-w.y;if(g===0&&h===0)return;const p=g*g+h*h,v=Math.sqrt(p);c=g/(v||1),C=h/(v||1),n=Math.min(p*1e4,1)}w={x:a.x,y:a.y},E.push({x:a.x,y:a.y,age:0,force:n,vx:c,vy:C})},update:()=>{k();for(let a=E.length-1;a>=0;a--){const n=E[a],c=n.force*F*(1-n.age/m);n.x+=n.vx*c,n.y+=n.vy*c,n.age++,n.age>m&&E.splice(a,1)}for(let a=0;a<E.length;a++)I(E[a]);T.needsUpdate=!0},set radiusScale(a){R=.1*64*a},get radiusScale(){return R/(.1*64)},size:64}},Ie=(b,l)=>{const i=`
1
+ import{r as z,j as Ee}from"./iframe-CvT6MryR.js";import{E as re,R as le,b as ie,a as me}from"./index-DcRHiSf7.js";import{W as we,d as ne,n as Re,S as Ce,a as Pe,i as qe,a9 as Te,q as be,M as Ae,f as ze,G as M,a2 as Me,z as se}from"./three.module--_vTUKhS.js";import"./preload-helper-C1FmrZbK.js";const Fe={"pixel-blast-container":"_pixel-blast-container_a95g7_1"},ke=()=>{const l=document.createElement("canvas");l.width=64,l.height=64;const i=l.getContext("2d");if(!i)throw new Error("2D context not available");i.fillStyle="black",i.fillRect(0,0,l.width,l.height);const T=new Me(l);T.minFilter=se,T.magFilter=se,T.generateMipmaps=!1;const E=[];let w=null;const m=64;let R=.1*64;const F=1/m,k=()=>{i.fillStyle="black",i.fillRect(0,0,l.width,l.height)},I=a=>{const n={x:a.x*64,y:(1-a.y)*64};let c=1;const C=v=>Math.sin(v*Math.PI/2),g=v=>-v*(v-2);a.age<m*.3?c=C(a.age/(m*.3)):c=g(1-(a.age-m*.3)/(m*.7))||0,c*=a.force;const h=`${(a.vx+1)/2*255}, ${(a.vy+1)/2*255}, ${c*255}`,p=64*5;i.shadowOffsetX=p,i.shadowOffsetY=p,i.shadowBlur=R,i.shadowColor=`rgba(${h},${.22*c})`,i.beginPath(),i.fillStyle="rgba(255,0,0,1)",i.arc(n.x-p,n.y-p,R,0,Math.PI*2),i.fill()};return{canvas:l,texture:T,addTouch:a=>{let n=0,c=0,C=0;if(w){const g=a.x-w.x,h=a.y-w.y;if(g===0&&h===0)return;const p=g*g+h*h,v=Math.sqrt(p);c=g/(v||1),C=h/(v||1),n=Math.min(p*1e4,1)}w={x:a.x,y:a.y},E.push({x:a.x,y:a.y,age:0,force:n,vx:c,vy:C})},update:()=>{k();for(let a=E.length-1;a>=0;a--){const n=E[a],c=n.force*F*(1-n.age/m);n.x+=n.vx*c,n.y+=n.vy*c,n.age++,n.age>m&&E.splice(a,1)}for(let a=0;a<E.length;a++)I(E[a]);T.needsUpdate=!0},set radiusScale(a){R=.1*64*a},get radiusScale(){return R/(.1*64)},size:64}},Ie=(b,l)=>{const i=`
2
2
  uniform sampler2D uTexture;
3
3
  uniform float uStrength;
4
4
  uniform float uTime;
@@ -1,4 +1,4 @@
1
- import{r as l,j as V}from"./iframe-2N7rjfXm.js";import"./preload-helper-C1FmrZbK.js";const q={"pixel-canvas":"_pixel-canvas_wo94u_1","pixel-card":"_pixel-card_wo94u_7"};class J{constructor(t,u,p,x,i,y,n){this.width=t.width,this.height=t.height,this.ctx=u,this.x=p,this.y=x,this.color=i,this.speed=this.getRandomValue(.1,.9)*y,this.size=0,this.sizeStep=Math.random()*.4,this.minSize=.5,this.maxSizeInteger=2,this.maxSize=this.getRandomValue(this.minSize,this.maxSizeInteger),this.delay=n,this.counter=0,this.counterStep=Math.random()*4+(this.width+this.height)*.01,this.isIdle=!1,this.isReverse=!1,this.isShimmer=!1}getRandomValue(t,u){return Math.random()*(u-t)+t}draw(){const t=this.maxSizeInteger*.5-this.size*.5;this.ctx.fillStyle=this.color,this.ctx.fillRect(this.x+t,this.y+t,this.size,this.size)}appear(){if(this.isIdle=!1,this.counter<=this.delay){this.counter+=this.counterStep;return}this.size>=this.maxSize&&(this.isShimmer=!0),this.isShimmer?this.shimmer():this.size+=this.sizeStep,this.draw()}disappear(){if(this.isShimmer=!1,this.counter=0,this.size<=0){this.isIdle=!0;return}else this.size-=.1;this.draw()}shimmer(){this.size>=this.maxSize?this.isReverse=!0:this.size<=this.minSize&&(this.isReverse=!1),this.isReverse?this.size-=this.speed:this.size+=this.speed}}function K(m,t){const i=parseInt(m,10);return i<=0||t?0:i>=100?100*.001:i*.001}const T={default:{activeColor:null,gap:5,speed:35,colors:"#f8fafc,#f1f5f9,#cbd5e1",noFocus:!1},blue:{activeColor:"#e0f2fe",gap:10,speed:25,colors:"#e0f2fe,#7dd3fc,#0ea5e9",noFocus:!1},yellow:{activeColor:"#fef08a",gap:3,speed:20,colors:"#fef08a,#fde047,#eab308",noFocus:!1},pink:{activeColor:"#fecdd3",gap:6,speed:80,colors:"#fecdd3,#fda4af,#e11d48",noFocus:!0}};function O({variant:m="default",gap:t,speed:u,colors:p,noFocus:x,className:i="",children:y}){const n=l.useRef(null),s=l.useRef(null),I=l.useRef([]),h=l.useRef(null),F=l.useRef(performance.now()),M=l.useRef(window.matchMedia("(prefers-reduced-motion: reduce)").matches).current,g=T[m]||T.default,C=t??g.gap,A=u??g.speed,_=p??g.colors,v=x??g.noFocus,b=()=>{if(!n.current||!s.current)return;const e=n.current.getBoundingClientRect(),a=Math.floor(e.width),o=Math.floor(e.height),z=s.current.getContext("2d");s.current.width=a,s.current.height=o,s.current.style.width=`${a}px`,s.current.style.height=`${o}px`;const d=_.split(","),f=[];for(let c=0;c<a;c+=parseInt(C,10))for(let r=0;r<o;r+=parseInt(C,10)){const S=d[Math.floor(Math.random()*d.length)],E=c-a/2,N=r-o/2,G=Math.sqrt(E*E+N*N),L=M?0:G;f.push(new J(s.current,z,c,r,S,K(A,M),L))}I.current=f},P=e=>{var c;h.current=requestAnimationFrame(()=>P(e));const a=performance.now(),o=a-F.current,z=1e3/60;if(o<z)return;F.current=a-o%z;const d=(c=s.current)==null?void 0:c.getContext("2d");if(!d||!s.current)return;d.clearRect(0,0,s.current.width,s.current.height);let f=!0;for(let r=0;r<I.current.length;r++){const S=I.current[r];S[e](),S.isIdle||(f=!1)}f&&cancelAnimationFrame(h.current)},R=e=>{cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>P(e))},D=()=>R("appear"),H=()=>R("disappear"),W=e=>{e.currentTarget.contains(e.relatedTarget)||R("appear")},k=e=>{e.currentTarget.contains(e.relatedTarget)||R("disappear")};return l.useEffect(()=>{b();const e=new ResizeObserver(()=>{b()});return n.current&&e.observe(n.current),()=>{e.disconnect(),cancelAnimationFrame(h.current)}},[C,A,_,v]),V.jsxs("div",{ref:n,className:`${q["pixel-card"]} ${i}`,onMouseEnter:D,onMouseLeave:H,onFocus:v?void 0:W,onBlur:v?void 0:k,tabIndex:v?-1:0,children:[V.jsx("canvas",{className:`${q["pixel-canvas"]}`,ref:s}),y]})}O.__docgenInfo={description:"",methods:[],displayName:"PixelCard",props:{variant:{defaultValue:{value:"'default'",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1}}};const X={title:"ReactBits/Components/PixelCard",component:O,parameters:{layout:"fullscreen"},tags:["autodocs"]},w={args:{variant:"default",children:"Hello World"}};var $,j,B;w.parameters={...w.parameters,docs:{...($=w.parameters)==null?void 0:$.docs,source:{originalSource:`{
1
+ import{r as l,j as V}from"./iframe-CvT6MryR.js";import"./preload-helper-C1FmrZbK.js";const q={"pixel-canvas":"_pixel-canvas_wo94u_1","pixel-card":"_pixel-card_wo94u_7"};class J{constructor(t,u,p,x,i,y,n){this.width=t.width,this.height=t.height,this.ctx=u,this.x=p,this.y=x,this.color=i,this.speed=this.getRandomValue(.1,.9)*y,this.size=0,this.sizeStep=Math.random()*.4,this.minSize=.5,this.maxSizeInteger=2,this.maxSize=this.getRandomValue(this.minSize,this.maxSizeInteger),this.delay=n,this.counter=0,this.counterStep=Math.random()*4+(this.width+this.height)*.01,this.isIdle=!1,this.isReverse=!1,this.isShimmer=!1}getRandomValue(t,u){return Math.random()*(u-t)+t}draw(){const t=this.maxSizeInteger*.5-this.size*.5;this.ctx.fillStyle=this.color,this.ctx.fillRect(this.x+t,this.y+t,this.size,this.size)}appear(){if(this.isIdle=!1,this.counter<=this.delay){this.counter+=this.counterStep;return}this.size>=this.maxSize&&(this.isShimmer=!0),this.isShimmer?this.shimmer():this.size+=this.sizeStep,this.draw()}disappear(){if(this.isShimmer=!1,this.counter=0,this.size<=0){this.isIdle=!0;return}else this.size-=.1;this.draw()}shimmer(){this.size>=this.maxSize?this.isReverse=!0:this.size<=this.minSize&&(this.isReverse=!1),this.isReverse?this.size-=this.speed:this.size+=this.speed}}function K(m,t){const i=parseInt(m,10);return i<=0||t?0:i>=100?100*.001:i*.001}const T={default:{activeColor:null,gap:5,speed:35,colors:"#f8fafc,#f1f5f9,#cbd5e1",noFocus:!1},blue:{activeColor:"#e0f2fe",gap:10,speed:25,colors:"#e0f2fe,#7dd3fc,#0ea5e9",noFocus:!1},yellow:{activeColor:"#fef08a",gap:3,speed:20,colors:"#fef08a,#fde047,#eab308",noFocus:!1},pink:{activeColor:"#fecdd3",gap:6,speed:80,colors:"#fecdd3,#fda4af,#e11d48",noFocus:!0}};function O({variant:m="default",gap:t,speed:u,colors:p,noFocus:x,className:i="",children:y}){const n=l.useRef(null),s=l.useRef(null),I=l.useRef([]),h=l.useRef(null),F=l.useRef(performance.now()),M=l.useRef(window.matchMedia("(prefers-reduced-motion: reduce)").matches).current,g=T[m]||T.default,C=t??g.gap,A=u??g.speed,_=p??g.colors,v=x??g.noFocus,b=()=>{if(!n.current||!s.current)return;const e=n.current.getBoundingClientRect(),a=Math.floor(e.width),o=Math.floor(e.height),z=s.current.getContext("2d");s.current.width=a,s.current.height=o,s.current.style.width=`${a}px`,s.current.style.height=`${o}px`;const d=_.split(","),f=[];for(let c=0;c<a;c+=parseInt(C,10))for(let r=0;r<o;r+=parseInt(C,10)){const S=d[Math.floor(Math.random()*d.length)],E=c-a/2,N=r-o/2,G=Math.sqrt(E*E+N*N),L=M?0:G;f.push(new J(s.current,z,c,r,S,K(A,M),L))}I.current=f},P=e=>{var c;h.current=requestAnimationFrame(()=>P(e));const a=performance.now(),o=a-F.current,z=1e3/60;if(o<z)return;F.current=a-o%z;const d=(c=s.current)==null?void 0:c.getContext("2d");if(!d||!s.current)return;d.clearRect(0,0,s.current.width,s.current.height);let f=!0;for(let r=0;r<I.current.length;r++){const S=I.current[r];S[e](),S.isIdle||(f=!1)}f&&cancelAnimationFrame(h.current)},R=e=>{cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>P(e))},D=()=>R("appear"),H=()=>R("disappear"),W=e=>{e.currentTarget.contains(e.relatedTarget)||R("appear")},k=e=>{e.currentTarget.contains(e.relatedTarget)||R("disappear")};return l.useEffect(()=>{b();const e=new ResizeObserver(()=>{b()});return n.current&&e.observe(n.current),()=>{e.disconnect(),cancelAnimationFrame(h.current)}},[C,A,_,v]),V.jsxs("div",{ref:n,className:`${q["pixel-card"]} ${i}`,onMouseEnter:D,onMouseLeave:H,onFocus:v?void 0:W,onBlur:v?void 0:k,tabIndex:v?-1:0,children:[V.jsx("canvas",{className:`${q["pixel-canvas"]}`,ref:s}),y]})}O.__docgenInfo={description:"",methods:[],displayName:"PixelCard",props:{variant:{defaultValue:{value:"'default'",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1}}};const X={title:"ReactBits/Components/PixelCard",component:O,parameters:{layout:"fullscreen"},tags:["autodocs"]},w={args:{variant:"default",children:"Hello World"}};var $,j,B;w.parameters={...w.parameters,docs:{...($=w.parameters)==null?void 0:$.docs,source:{originalSource:`{
2
2
  args: {
3
3
  variant: 'default',
4
4
  children: 'Hello World'
@@ -1,4 +1,4 @@
1
- import{r as t,j as B}from"./iframe-2N7rjfXm.js";import{n as K,e as O,S as T,a as U,W as X,i as G,d as H,q as W,M as Y}from"./three.module--_vTUKhS.js";import"./preload-helper-C1FmrZbK.js";const J={"pixel-snow-container":"_pixel-snow-container_udm6i_1"},L=`
1
+ import{r as t,j as B}from"./iframe-CvT6MryR.js";import{n as K,e as O,S as T,a as U,W as X,i as G,d as H,q as W,M as Y}from"./three.module--_vTUKhS.js";import"./preload-helper-C1FmrZbK.js";const J={"pixel-snow-container":"_pixel-snow-container_udm6i_1"},L=`
2
2
  void main() {
3
3
  gl_Position = vec4(position, 1.0);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{r,j as l}from"./iframe-2N7rjfXm.js";import{g as d}from"./index-C8pce-KX.js";import"./preload-helper-C1FmrZbK.js";const c={"pixelated-image-card":"_pixelated-image-card_12og9_1","pixelated-image-card__default":"_pixelated-image-card__default_12og9_12","pixelated-image-card__active":"_pixelated-image-card__active_12og9_13","pixelated-image-card__pixels":"_pixelated-image-card__pixels_12og9_14","pixelated-image-card__pixel":"_pixelated-image-card__pixel_12og9_14"};function E({firstContent:b,secondContent:F,gridSize:u=7,pixelColor:_="currentColor",animationStepDuration:m=.3,once:v=!1,aspectRatio:$="100%",className:q="",style:S={}}){const T=r.useRef(null),x=r.useRef(null),h=r.useRef(null),g=r.useRef(null),[i,I]=r.useState(!1),o="ontouchstart"in window||navigator.maxTouchPoints>0||window.matchMedia("(pointer: coarse)").matches;r.useEffect(()=>{const t=x.current;if(t){t.innerHTML="";for(let n=0;n<u;n++)for(let a=0;a<u;a++){const e=document.createElement("div");e.classList.add(c["pixelated-image-card__pixel"]),e.setAttribute("data-pixel",""),e.style.backgroundColor=_;const s=100/u;e.style.width=`${s}%`,e.style.height=`${s}%`,e.style.left=`${a*s}%`,e.style.top=`${n*s}%`,t.appendChild(e)}}},[u,_]);const f=t=>{I(t);const n=x.current,a=h.current;if(!n||!a)return;const e=n.querySelectorAll("[data-pixel]");if(!e.length)return;d.killTweensOf(e),g.current&&g.current.kill(),d.set(e,{display:"none"});const s=e.length,R=m/s;d.to(e,{display:"block",duration:0,stagger:{each:R,from:"random"}}),g.current=d.delayedCall(m,()=>{a.style.display=t?"block":"none",a.style.pointerEvents=t?"none":""}),d.to(e,{display:"none",duration:0,delay:m,stagger:{each:R,from:"random"}})},y=()=>{i||f(!0)},C=()=>{i&&!v&&f(!1)},V=()=>{i?i&&!v&&f(!1):f(!0)};return l.jsxs("div",{ref:T,className:`${c["pixelated-image-card"]} ${q}`,style:S,onMouseEnter:o?void 0:y,onMouseLeave:o?void 0:C,onClick:o?V:void 0,onFocus:o?void 0:y,onBlur:o?void 0:C,tabIndex:0,children:[l.jsx("div",{style:{paddingTop:$}}),l.jsx("div",{className:`${c["pixelated-image-card__default"]}`,"aria-hidden":i,children:b}),l.jsx("div",{className:`${c["pixelated-image-card__active"]}`,ref:h,"aria-hidden":!i,children:F}),l.jsx("div",{className:`${c["pixelated-image-card__pixels"]}`,ref:x})]})}E.__docgenInfo={description:"",methods:[],displayName:"PixelTransition",props:{gridSize:{defaultValue:{value:"7",computed:!1},required:!1},pixelColor:{defaultValue:{value:"'currentColor'",computed:!1},required:!1},animationStepDuration:{defaultValue:{value:"0.3",computed:!1},required:!1},once:{defaultValue:{value:"false",computed:!1},required:!1},aspectRatio:{defaultValue:{value:"'100%'",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1}}};const A={title:"ReactBits/Animations/PixelTransition",component:E,parameters:{layout:"fullscreen"},tags:["autodocs"]},p={args:{firstContent:l.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"#1a1a2e",color:"#fff",fontSize:"2rem"},children:"Hover me"}),secondContent:l.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"#5227FF",color:"#fff",fontSize:"2rem"},children:"Revealed!"}),gridSize:7,pixelColor:"#5227FF",aspectRatio:"100%"}};var j,k,w;p.parameters={...p.parameters,docs:{...(j=p.parameters)==null?void 0:j.docs,source:{originalSource:`{
1
+ import{r,j as l}from"./iframe-CvT6MryR.js";import{g as d}from"./index-C8pce-KX.js";import"./preload-helper-C1FmrZbK.js";const c={"pixelated-image-card":"_pixelated-image-card_12og9_1","pixelated-image-card__default":"_pixelated-image-card__default_12og9_12","pixelated-image-card__active":"_pixelated-image-card__active_12og9_13","pixelated-image-card__pixels":"_pixelated-image-card__pixels_12og9_14","pixelated-image-card__pixel":"_pixelated-image-card__pixel_12og9_14"};function E({firstContent:b,secondContent:F,gridSize:u=7,pixelColor:_="currentColor",animationStepDuration:m=.3,once:v=!1,aspectRatio:$="100%",className:q="",style:S={}}){const T=r.useRef(null),x=r.useRef(null),h=r.useRef(null),g=r.useRef(null),[i,I]=r.useState(!1),o="ontouchstart"in window||navigator.maxTouchPoints>0||window.matchMedia("(pointer: coarse)").matches;r.useEffect(()=>{const t=x.current;if(t){t.innerHTML="";for(let n=0;n<u;n++)for(let a=0;a<u;a++){const e=document.createElement("div");e.classList.add(c["pixelated-image-card__pixel"]),e.setAttribute("data-pixel",""),e.style.backgroundColor=_;const s=100/u;e.style.width=`${s}%`,e.style.height=`${s}%`,e.style.left=`${a*s}%`,e.style.top=`${n*s}%`,t.appendChild(e)}}},[u,_]);const f=t=>{I(t);const n=x.current,a=h.current;if(!n||!a)return;const e=n.querySelectorAll("[data-pixel]");if(!e.length)return;d.killTweensOf(e),g.current&&g.current.kill(),d.set(e,{display:"none"});const s=e.length,R=m/s;d.to(e,{display:"block",duration:0,stagger:{each:R,from:"random"}}),g.current=d.delayedCall(m,()=>{a.style.display=t?"block":"none",a.style.pointerEvents=t?"none":""}),d.to(e,{display:"none",duration:0,delay:m,stagger:{each:R,from:"random"}})},y=()=>{i||f(!0)},C=()=>{i&&!v&&f(!1)},V=()=>{i?i&&!v&&f(!1):f(!0)};return l.jsxs("div",{ref:T,className:`${c["pixelated-image-card"]} ${q}`,style:S,onMouseEnter:o?void 0:y,onMouseLeave:o?void 0:C,onClick:o?V:void 0,onFocus:o?void 0:y,onBlur:o?void 0:C,tabIndex:0,children:[l.jsx("div",{style:{paddingTop:$}}),l.jsx("div",{className:`${c["pixelated-image-card__default"]}`,"aria-hidden":i,children:b}),l.jsx("div",{className:`${c["pixelated-image-card__active"]}`,ref:h,"aria-hidden":!i,children:F}),l.jsx("div",{className:`${c["pixelated-image-card__pixels"]}`,ref:x})]})}E.__docgenInfo={description:"",methods:[],displayName:"PixelTransition",props:{gridSize:{defaultValue:{value:"7",computed:!1},required:!1},pixelColor:{defaultValue:{value:"'currentColor'",computed:!1},required:!1},animationStepDuration:{defaultValue:{value:"0.3",computed:!1},required:!1},once:{defaultValue:{value:"false",computed:!1},required:!1},aspectRatio:{defaultValue:{value:"'100%'",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1}}};const A={title:"ReactBits/Animations/PixelTransition",component:E,parameters:{layout:"fullscreen"},tags:["autodocs"]},p={args:{firstContent:l.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"#1a1a2e",color:"#fff",fontSize:"2rem"},children:"Hover me"}),secondContent:l.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"#5227FF",color:"#fff",fontSize:"2rem"},children:"Revealed!"}),gridSize:7,pixelColor:"#5227FF",aspectRatio:"100%"}};var j,k,w;p.parameters={...p.parameters,docs:{...(j=p.parameters)==null?void 0:j.docs,source:{originalSource:`{
2
2
  args: {
3
3
  firstContent: <div style={{
4
4
  width: '100%',
@@ -1,4 +1,4 @@
1
- import{r as y,j as U}from"./iframe-2N7rjfXm.js";import{R as E,P as Q,M as j}from"./Mesh-CwXV3WjE.js";import{T as k}from"./Triangle-64ffRKNB.js";import"./preload-helper-C1FmrZbK.js";const L={"plasma-container":"_plasma-container_4c6hx_1"},N=n=>{const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return o?[parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255]:[1,.5,.2]},$=`#version 300 es
1
+ import{r as y,j as U}from"./iframe-CvT6MryR.js";import{R as E,P as Q,M as j}from"./Mesh-CwXV3WjE.js";import{T as k}from"./Triangle-64ffRKNB.js";import"./preload-helper-C1FmrZbK.js";const L={"plasma-container":"_plasma-container_4c6hx_1"},N=n=>{const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return o?[parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255]:[1,.5,.2]},$=`#version 300 es
2
2
  precision highp float;
3
3
  in vec2 position;
4
4
  in vec2 uv;
@@ -1,4 +1,4 @@
1
- import{r as le,j as Ne}from"./iframe-2N7rjfXm.js";import{R as Ye,P as je,M as De}from"./Mesh-CwXV3WjE.js";import{T as Ge}from"./Triangle-64ffRKNB.js";import"./preload-helper-C1FmrZbK.js";const Xe={"prism-container":"_prism-container_sjqpx_1"},ce=({height:T=3.5,baseWidth:z=5.5,animationType:h="rotate",glow:W=1,offset:s={x:0,y:0},noise:U=.5,transparent:E=!0,scale:N=3.6,hueShift:Y=0,colorFrequency:j=1,hoverStrength:D=2,inertia:G=.05,bloom:X=1,suspendWhenOffscreen:P=!1,timeScale:Z=.5})=>{const k=le.useRef(null);return le.useEffect(()=>{const r=k.current;if(!r)return;const b=Math.max(.001,T),H=Math.max(.001,z)*.5,fe=Math.max(0,W),Q=Math.max(0,U),me=(s==null?void 0:s.x)??0,de=(s==null?void 0:s.y)??0,ve=E?1.5:1,I=Math.max(.001,N),he=Y||0,pe=Math.max(0,j||1),xe=Math.max(0,X||1),we=1,Me=1,Se=1,R=Math.max(0,Z||1),$=Math.max(0,D||1),J=Math.max(0,Math.min(1,G||.12)),_=Math.min(2,window.devicePixelRatio||1),A=new Ye({dpr:_,alpha:E,antialias:!1}),a=A.gl;a.disable(a.DEPTH_TEST),a.disable(a.CULL_FACE),a.disable(a.BLEND),Object.assign(a.canvas.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block"}),r.appendChild(a.canvas);const ge=`
1
+ import{r as le,j as Ne}from"./iframe-CvT6MryR.js";import{R as Ye,P as je,M as De}from"./Mesh-CwXV3WjE.js";import{T as Ge}from"./Triangle-64ffRKNB.js";import"./preload-helper-C1FmrZbK.js";const Xe={"prism-container":"_prism-container_sjqpx_1"},ce=({height:T=3.5,baseWidth:z=5.5,animationType:h="rotate",glow:W=1,offset:s={x:0,y:0},noise:U=.5,transparent:E=!0,scale:N=3.6,hueShift:Y=0,colorFrequency:j=1,hoverStrength:D=2,inertia:G=.05,bloom:X=1,suspendWhenOffscreen:P=!1,timeScale:Z=.5})=>{const k=le.useRef(null);return le.useEffect(()=>{const r=k.current;if(!r)return;const b=Math.max(.001,T),H=Math.max(.001,z)*.5,fe=Math.max(0,W),Q=Math.max(0,U),me=(s==null?void 0:s.x)??0,de=(s==null?void 0:s.y)??0,ve=E?1.5:1,I=Math.max(.001,N),he=Y||0,pe=Math.max(0,j||1),xe=Math.max(0,X||1),we=1,Me=1,Se=1,R=Math.max(0,Z||1),$=Math.max(0,D||1),J=Math.max(0,Math.min(1,G||.12)),_=Math.min(2,window.devicePixelRatio||1),A=new Ye({dpr:_,alpha:E,antialias:!1}),a=A.gl;a.disable(a.DEPTH_TEST),a.disable(a.CULL_FACE),a.disable(a.BLEND),Object.assign(a.canvas.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block"}),r.appendChild(a.canvas);const ge=`
2
2
  attribute vec2 position;
3
3
  void main() {
4
4
  gl_Position = vec4(position, 0.0, 1.0);
@@ -1,4 +1,4 @@
1
- import{r as n,j as te}from"./iframe-2N7rjfXm.js";import{R as re,P as ae,M as ne}from"./Mesh-CwXV3WjE.js";import{T as oe}from"./Texture-BkQWYNP2.js";import{T as se}from"./Triangle-64ffRKNB.js";import"./preload-helper-C1FmrZbK.js";const ue={"prismatic-burst-container":"_prismatic-burst-container_u2n5x_1"},ce=`#version 300 es
1
+ import{r as n,j as te}from"./iframe-CvT6MryR.js";import{R as re,P as ae,M as ne}from"./Mesh-CwXV3WjE.js";import{T as oe}from"./Texture-BkQWYNP2.js";import{T as se}from"./Triangle-64ffRKNB.js";import"./preload-helper-C1FmrZbK.js";const ue={"prismatic-burst-container":"_prismatic-burst-container_u2n5x_1"},ce=`#version 300 es
2
2
  in vec2 position;
3
3
  in vec2 uv;
4
4
  out vec2 vUv;
@@ -1,4 +1,4 @@
1
- import{R as ve,r as o,j as r}from"./iframe-2N7rjfXm.js";import"./preload-helper-C1FmrZbK.js";const he="_active_uxwt3_56",_e="_entering_uxwt3_84",xe="_avatar_uxwt3_252",n={"pc-behind":"_pc-behind_uxwt3_40",active:he,"pc-card":"_pc-card_uxwt3_33","pc-card-shell":"_pc-card-shell_uxwt3_84",entering:_e,"pc-inside":"_pc-inside_uxwt3_100","pc-shine":"_pc-shine_uxwt3_108","pc-glare":"_pc-glare_uxwt3_232","pc-avatar-content":"_pc-avatar-content_uxwt3_245",avatar:xe,"pc-user-info":"_pc-user-info_uxwt3_274","pc-user-details":"_pc-user-details_uxwt3_293","pc-mini-avatar":"_pc-mini-avatar_uxwt3_299","pc-user-text":"_pc-user-text_uxwt3_315","pc-handle":"_pc-handle_uxwt3_322","pc-status":"_pc-status_uxwt3_329","pc-contact-btn":"_pc-contact-btn_uxwt3_335","pc-content":"_pc-content_uxwt3_353","pc-details":"_pc-details_uxwt3_367"},ge="linear-gradient(145deg,#60496e8c 0%,#71C4FF44 100%)",L={INITIAL_DURATION:1200,INITIAL_X_OFFSET:70,INITIAL_Y_OFFSET:60,DEVICE_BETA_OFFSET:20,ENTER_TRANSITION_MS:180},$=(p,d=0,v=100)=>Math.min(Math.max(p,d),v),C=(p,d=3)=>parseFloat(p.toFixed(d)),z=(p,d,v,x,O)=>C(x+(O-x)*(p-d)/(v-d)),Z=({avatarUrl:p="<Placeholder for avatar URL>",iconUrl:d="<Placeholder for icon URL>",grainUrl:v="<Placeholder for grain URL>",innerGradient:x,behindGlowEnabled:O=!0,behindGlowColor:S,behindGlowSize:U,className:ee="",enableTilt:A=!0,enableMobileTilt:V=!1,mobileTiltSensitivity:q=5,miniAvatarUrl:te,name:y="Javi A. Torres",title:ne="Software Engineer",handle:ae="javicodes",status:re="Online",contactText:se="Contact",showUserInfo:ce=!0,onContactClick:F})=>{const M=o.useRef(null),m=o.useRef(null),g=o.useRef(null),h=o.useRef(null),s=o.useMemo(()=>{if(!A)return null;let e=null,t=!1,a=0,c=0,i=0,u=0,f=0;const E=.14,T=.6;let j=0;const H=(l,_)=>{const w=m.current,I=M.current;if(!w||!I)return;const J=w.clientWidth||1,oe=w.clientHeight||1,N=$(100/J*l),b=$(100/oe*_),ue=N-50,de=b-50,pe={"--pointer-x":`${N}%`,"--pointer-y":`${b}%`,"--background-x":`${z(N,0,100,35,65)}%`,"--background-y":`${z(b,0,100,35,65)}%`,"--pointer-from-center":`${$(Math.hypot(b-50,N-50)/50,0,1)}`,"--pointer-from-top":`${b/100}`,"--pointer-from-left":`${N/100}`,"--rotate-x":`${C(-(ue/5))}deg`,"--rotate-y":`${C(de/4)}deg`};for(const[fe,me]of Object.entries(pe))I.style.setProperty(fe,me)},W=l=>{if(!t)return;a===0&&(a=l);const _=(l-a)/1e3;a=l;const w=l<j?T:E,I=1-Math.exp(-_/w);c+=(u-c)*I,i+=(f-i)*I,H(c,i),Math.abs(u-c)>.05||Math.abs(f-i)>.05||document.hasFocus()?e=requestAnimationFrame(W):(t=!1,a=0,e&&(cancelAnimationFrame(e),e=null))},B=()=>{t||(t=!0,a=0,e=requestAnimationFrame(W))};return{setImmediate(l,_){c=l,i=_,H(c,i)},setTarget(l,_){u=l,f=_,B()},toCenter(){const l=m.current;l&&this.setTarget(l.clientWidth/2,l.clientHeight/2)},beginInitial(l){j=performance.now()+l,B()},getCurrent(){return{x:c,y:i,tx:u,ty:f}},cancel(){e&&cancelAnimationFrame(e),e=null,t=!1,a=0}}},[A]),P=(e,t)=>{const a=t.getBoundingClientRect();return{x:e.clientX-a.left,y:e.clientY-a.top}},D=o.useCallback(e=>{const t=m.current;if(!t||!s)return;const{x:a,y:c}=P(e,t);s.setTarget(a,c)},[s]),k=o.useCallback(e=>{const t=m.current;if(!t||!s)return;t.classList.add(n.active),t.classList.add(n.entering),g.current&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{t.classList.remove(n.entering)},L.ENTER_TRANSITION_MS);const{x:a,y:c}=P(e,t);s.setTarget(a,c)},[s]),X=o.useCallback(()=>{const e=m.current;if(!e||!s)return;s.toCenter();const t=()=>{const{x:a,y:c,tx:i,ty:u}=s.getCurrent();Math.hypot(i-a,u-c)<.6?(e.classList.remove(n.active),h.current=null):h.current=requestAnimationFrame(t)};h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(t)},[s]),Y=o.useCallback(e=>{const t=m.current;if(!t||!s)return;const{beta:a,gamma:c}=e;if(a==null||c==null)return;const i=t.clientWidth/2,u=t.clientHeight/2,f=$(i+c*q,0,t.clientWidth),E=$(u+(a-L.DEVICE_BETA_OFFSET)*q,0,t.clientHeight);s.setTarget(f,E)},[s,q]);o.useEffect(()=>{if(!A||!s)return;const e=m.current;if(!e)return;const t=D,a=k,c=X,i=Y;e.addEventListener("pointerenter",a),e.addEventListener("pointermove",t),e.addEventListener("pointerleave",c);const u=()=>{if(!V||location.protocol!=="https:")return;const T=window.DeviceMotionEvent;T&&typeof T.requestPermission=="function"?T.requestPermission().then(j=>{j==="granted"&&window.addEventListener("deviceorientation",i)}).catch(console.error):window.addEventListener("deviceorientation",i)};e.addEventListener("click",u);const f=(e.clientWidth||0)-L.INITIAL_X_OFFSET,E=L.INITIAL_Y_OFFSET;return s.setImmediate(f,E),s.toCenter(),s.beginInitial(L.INITIAL_DURATION),()=>{e.removeEventListener("pointerenter",a),e.removeEventListener("pointermove",t),e.removeEventListener("pointerleave",c),e.removeEventListener("click",u),window.removeEventListener("deviceorientation",i),g.current&&window.clearTimeout(g.current),h.current&&cancelAnimationFrame(h.current),s.cancel(),e.classList.remove(n.entering)}},[A,V,s,D,k,X,Y]);const le=o.useMemo(()=>({"--icon":d?`url(${d})`:"none","--grain":v?`url(${v})`:"none","--inner-gradient":x??ge,"--behind-glow-color":S??"rgba(125, 190, 255, 0.67)","--behind-glow-size":U??"50%"}),[d,v,x,S,U]),ie=o.useCallback(()=>{F==null||F()},[F]);return r.jsxs("div",{ref:M,className:`pc-card-wrapper ${ee}`.trim(),style:le,children:[O&&r.jsx("div",{className:`${n["pc-behind"]}`}),r.jsx("div",{ref:m,className:`${n["pc-card-shell"]}`,children:r.jsx("section",{className:`${n["pc-card"]}`,children:r.jsxs("div",{className:`${n["pc-inside"]}`,children:[r.jsx("div",{className:`${n["pc-shine"]}`}),r.jsx("div",{className:`${n["pc-glare"]}`}),r.jsxs("div",{className:`${n["pc-content"]} ${n["pc-avatar-content"]}`,children:[r.jsx("img",{className:`${n.avatar}`,src:p,alt:`${y||"User"} avatar`,loading:"lazy",onError:e=>{const t=e.target;t.style.display="none"}}),ce&&r.jsxs("div",{className:`${n["pc-user-info"]}`,children:[r.jsxs("div",{className:`${n["pc-user-details"]}`,children:[r.jsx("div",{className:`${n["pc-mini-avatar"]}`,children:r.jsx("img",{src:te||p,alt:`${y||"User"} mini avatar`,loading:"lazy",onError:e=>{const t=e.target;t.style.opacity="0.5",t.src=p}})}),r.jsxs("div",{className:`${n["pc-user-text"]}`,children:[r.jsxs("div",{className:`${n["pc-handle"]}`,children:["@",ae]}),r.jsx("div",{className:`${n["pc-status"]}`,children:re})]})]}),r.jsx("button",{className:`${n["pc-contact-btn"]}`,onClick:ie,style:{pointerEvents:"auto"},type:"button","aria-label":`Contact ${y||"user"}`,children:se})]})]}),r.jsx("div",{className:`${n["pc-content"]}`,children:r.jsxs("div",{className:`${n["pc-details"]}`,children:[r.jsx("h3",{children:y}),r.jsx("p",{children:ne})]})})]})})})]})},Ee=ve.memo(Z);Z.__docgenInfo={description:"",methods:[],displayName:"ProfileCardComponent",props:{avatarUrl:{defaultValue:{value:"'<Placeholder for avatar URL>'",computed:!1},required:!1},iconUrl:{defaultValue:{value:"'<Placeholder for icon URL>'",computed:!1},required:!1},grainUrl:{defaultValue:{value:"'<Placeholder for grain URL>'",computed:!1},required:!1},behindGlowEnabled:{defaultValue:{value:"true",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},enableTilt:{defaultValue:{value:"true",computed:!1},required:!1},enableMobileTilt:{defaultValue:{value:"false",computed:!1},required:!1},mobileTiltSensitivity:{defaultValue:{value:"5",computed:!1},required:!1},name:{defaultValue:{value:"'Javi A. Torres'",computed:!1},required:!1},title:{defaultValue:{value:"'Software Engineer'",computed:!1},required:!1},handle:{defaultValue:{value:"'javicodes'",computed:!1},required:!1},status:{defaultValue:{value:"'Online'",computed:!1},required:!1},contactText:{defaultValue:{value:"'Contact'",computed:!1},required:!1},showUserInfo:{defaultValue:{value:"true",computed:!1},required:!1}}};const Ie={title:"ReactBits/Components/ProfileCard",component:Ee,parameters:{layout:"fullscreen"},tags:["autodocs"]},R={args:{avatarUrl:"https://i.pravatar.cc/300?img=12",behindGlowEnabled:!0,enableTilt:!0,enableMobileTilt:!1,mobileTiltSensitivity:5,name:"Javi A. Torres",title:"Software Engineer",handle:"javicodes",status:"Online",contactText:"Contact",showUserInfo:!0}};var G,K,Q;R.parameters={...R.parameters,docs:{...(G=R.parameters)==null?void 0:G.docs,source:{originalSource:`{
1
+ import{R as ve,r as o,j as r}from"./iframe-CvT6MryR.js";import"./preload-helper-C1FmrZbK.js";const he="_active_uxwt3_56",_e="_entering_uxwt3_84",xe="_avatar_uxwt3_252",n={"pc-behind":"_pc-behind_uxwt3_40",active:he,"pc-card":"_pc-card_uxwt3_33","pc-card-shell":"_pc-card-shell_uxwt3_84",entering:_e,"pc-inside":"_pc-inside_uxwt3_100","pc-shine":"_pc-shine_uxwt3_108","pc-glare":"_pc-glare_uxwt3_232","pc-avatar-content":"_pc-avatar-content_uxwt3_245",avatar:xe,"pc-user-info":"_pc-user-info_uxwt3_274","pc-user-details":"_pc-user-details_uxwt3_293","pc-mini-avatar":"_pc-mini-avatar_uxwt3_299","pc-user-text":"_pc-user-text_uxwt3_315","pc-handle":"_pc-handle_uxwt3_322","pc-status":"_pc-status_uxwt3_329","pc-contact-btn":"_pc-contact-btn_uxwt3_335","pc-content":"_pc-content_uxwt3_353","pc-details":"_pc-details_uxwt3_367"},ge="linear-gradient(145deg,#60496e8c 0%,#71C4FF44 100%)",L={INITIAL_DURATION:1200,INITIAL_X_OFFSET:70,INITIAL_Y_OFFSET:60,DEVICE_BETA_OFFSET:20,ENTER_TRANSITION_MS:180},$=(p,d=0,v=100)=>Math.min(Math.max(p,d),v),C=(p,d=3)=>parseFloat(p.toFixed(d)),z=(p,d,v,x,O)=>C(x+(O-x)*(p-d)/(v-d)),Z=({avatarUrl:p="<Placeholder for avatar URL>",iconUrl:d="<Placeholder for icon URL>",grainUrl:v="<Placeholder for grain URL>",innerGradient:x,behindGlowEnabled:O=!0,behindGlowColor:S,behindGlowSize:U,className:ee="",enableTilt:A=!0,enableMobileTilt:V=!1,mobileTiltSensitivity:q=5,miniAvatarUrl:te,name:y="Javi A. Torres",title:ne="Software Engineer",handle:ae="javicodes",status:re="Online",contactText:se="Contact",showUserInfo:ce=!0,onContactClick:F})=>{const M=o.useRef(null),m=o.useRef(null),g=o.useRef(null),h=o.useRef(null),s=o.useMemo(()=>{if(!A)return null;let e=null,t=!1,a=0,c=0,i=0,u=0,f=0;const E=.14,T=.6;let j=0;const H=(l,_)=>{const w=m.current,I=M.current;if(!w||!I)return;const J=w.clientWidth||1,oe=w.clientHeight||1,N=$(100/J*l),b=$(100/oe*_),ue=N-50,de=b-50,pe={"--pointer-x":`${N}%`,"--pointer-y":`${b}%`,"--background-x":`${z(N,0,100,35,65)}%`,"--background-y":`${z(b,0,100,35,65)}%`,"--pointer-from-center":`${$(Math.hypot(b-50,N-50)/50,0,1)}`,"--pointer-from-top":`${b/100}`,"--pointer-from-left":`${N/100}`,"--rotate-x":`${C(-(ue/5))}deg`,"--rotate-y":`${C(de/4)}deg`};for(const[fe,me]of Object.entries(pe))I.style.setProperty(fe,me)},W=l=>{if(!t)return;a===0&&(a=l);const _=(l-a)/1e3;a=l;const w=l<j?T:E,I=1-Math.exp(-_/w);c+=(u-c)*I,i+=(f-i)*I,H(c,i),Math.abs(u-c)>.05||Math.abs(f-i)>.05||document.hasFocus()?e=requestAnimationFrame(W):(t=!1,a=0,e&&(cancelAnimationFrame(e),e=null))},B=()=>{t||(t=!0,a=0,e=requestAnimationFrame(W))};return{setImmediate(l,_){c=l,i=_,H(c,i)},setTarget(l,_){u=l,f=_,B()},toCenter(){const l=m.current;l&&this.setTarget(l.clientWidth/2,l.clientHeight/2)},beginInitial(l){j=performance.now()+l,B()},getCurrent(){return{x:c,y:i,tx:u,ty:f}},cancel(){e&&cancelAnimationFrame(e),e=null,t=!1,a=0}}},[A]),P=(e,t)=>{const a=t.getBoundingClientRect();return{x:e.clientX-a.left,y:e.clientY-a.top}},D=o.useCallback(e=>{const t=m.current;if(!t||!s)return;const{x:a,y:c}=P(e,t);s.setTarget(a,c)},[s]),k=o.useCallback(e=>{const t=m.current;if(!t||!s)return;t.classList.add(n.active),t.classList.add(n.entering),g.current&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{t.classList.remove(n.entering)},L.ENTER_TRANSITION_MS);const{x:a,y:c}=P(e,t);s.setTarget(a,c)},[s]),X=o.useCallback(()=>{const e=m.current;if(!e||!s)return;s.toCenter();const t=()=>{const{x:a,y:c,tx:i,ty:u}=s.getCurrent();Math.hypot(i-a,u-c)<.6?(e.classList.remove(n.active),h.current=null):h.current=requestAnimationFrame(t)};h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(t)},[s]),Y=o.useCallback(e=>{const t=m.current;if(!t||!s)return;const{beta:a,gamma:c}=e;if(a==null||c==null)return;const i=t.clientWidth/2,u=t.clientHeight/2,f=$(i+c*q,0,t.clientWidth),E=$(u+(a-L.DEVICE_BETA_OFFSET)*q,0,t.clientHeight);s.setTarget(f,E)},[s,q]);o.useEffect(()=>{if(!A||!s)return;const e=m.current;if(!e)return;const t=D,a=k,c=X,i=Y;e.addEventListener("pointerenter",a),e.addEventListener("pointermove",t),e.addEventListener("pointerleave",c);const u=()=>{if(!V||location.protocol!=="https:")return;const T=window.DeviceMotionEvent;T&&typeof T.requestPermission=="function"?T.requestPermission().then(j=>{j==="granted"&&window.addEventListener("deviceorientation",i)}).catch(console.error):window.addEventListener("deviceorientation",i)};e.addEventListener("click",u);const f=(e.clientWidth||0)-L.INITIAL_X_OFFSET,E=L.INITIAL_Y_OFFSET;return s.setImmediate(f,E),s.toCenter(),s.beginInitial(L.INITIAL_DURATION),()=>{e.removeEventListener("pointerenter",a),e.removeEventListener("pointermove",t),e.removeEventListener("pointerleave",c),e.removeEventListener("click",u),window.removeEventListener("deviceorientation",i),g.current&&window.clearTimeout(g.current),h.current&&cancelAnimationFrame(h.current),s.cancel(),e.classList.remove(n.entering)}},[A,V,s,D,k,X,Y]);const le=o.useMemo(()=>({"--icon":d?`url(${d})`:"none","--grain":v?`url(${v})`:"none","--inner-gradient":x??ge,"--behind-glow-color":S??"rgba(125, 190, 255, 0.67)","--behind-glow-size":U??"50%"}),[d,v,x,S,U]),ie=o.useCallback(()=>{F==null||F()},[F]);return r.jsxs("div",{ref:M,className:`pc-card-wrapper ${ee}`.trim(),style:le,children:[O&&r.jsx("div",{className:`${n["pc-behind"]}`}),r.jsx("div",{ref:m,className:`${n["pc-card-shell"]}`,children:r.jsx("section",{className:`${n["pc-card"]}`,children:r.jsxs("div",{className:`${n["pc-inside"]}`,children:[r.jsx("div",{className:`${n["pc-shine"]}`}),r.jsx("div",{className:`${n["pc-glare"]}`}),r.jsxs("div",{className:`${n["pc-content"]} ${n["pc-avatar-content"]}`,children:[r.jsx("img",{className:`${n.avatar}`,src:p,alt:`${y||"User"} avatar`,loading:"lazy",onError:e=>{const t=e.target;t.style.display="none"}}),ce&&r.jsxs("div",{className:`${n["pc-user-info"]}`,children:[r.jsxs("div",{className:`${n["pc-user-details"]}`,children:[r.jsx("div",{className:`${n["pc-mini-avatar"]}`,children:r.jsx("img",{src:te||p,alt:`${y||"User"} mini avatar`,loading:"lazy",onError:e=>{const t=e.target;t.style.opacity="0.5",t.src=p}})}),r.jsxs("div",{className:`${n["pc-user-text"]}`,children:[r.jsxs("div",{className:`${n["pc-handle"]}`,children:["@",ae]}),r.jsx("div",{className:`${n["pc-status"]}`,children:re})]})]}),r.jsx("button",{className:`${n["pc-contact-btn"]}`,onClick:ie,style:{pointerEvents:"auto"},type:"button","aria-label":`Contact ${y||"user"}`,children:se})]})]}),r.jsx("div",{className:`${n["pc-content"]}`,children:r.jsxs("div",{className:`${n["pc-details"]}`,children:[r.jsx("h3",{children:y}),r.jsx("p",{children:ne})]})})]})})})]})},Ee=ve.memo(Z);Z.__docgenInfo={description:"",methods:[],displayName:"ProfileCardComponent",props:{avatarUrl:{defaultValue:{value:"'<Placeholder for avatar URL>'",computed:!1},required:!1},iconUrl:{defaultValue:{value:"'<Placeholder for icon URL>'",computed:!1},required:!1},grainUrl:{defaultValue:{value:"'<Placeholder for grain URL>'",computed:!1},required:!1},behindGlowEnabled:{defaultValue:{value:"true",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},enableTilt:{defaultValue:{value:"true",computed:!1},required:!1},enableMobileTilt:{defaultValue:{value:"false",computed:!1},required:!1},mobileTiltSensitivity:{defaultValue:{value:"5",computed:!1},required:!1},name:{defaultValue:{value:"'Javi A. Torres'",computed:!1},required:!1},title:{defaultValue:{value:"'Software Engineer'",computed:!1},required:!1},handle:{defaultValue:{value:"'javicodes'",computed:!1},required:!1},status:{defaultValue:{value:"'Online'",computed:!1},required:!1},contactText:{defaultValue:{value:"'Contact'",computed:!1},required:!1},showUserInfo:{defaultValue:{value:"true",computed:!1},required:!1}}};const Ie={title:"ReactBits/Components/ProfileCard",component:Ee,parameters:{layout:"fullscreen"},tags:["autodocs"]},R={args:{avatarUrl:"https://i.pravatar.cc/300?img=12",behindGlowEnabled:!0,enableTilt:!0,enableMobileTilt:!1,mobileTiltSensitivity:5,name:"Javi A. Torres",title:"Software Engineer",handle:"javicodes",status:"Online",contactText:"Contact",showUserInfo:!0}};var G,K,Q;R.parameters={...R.parameters,docs:{...(G=R.parameters)==null?void 0:G.docs,source:{originalSource:`{
2
2
  args: {
3
3
  avatarUrl: 'https://i.pravatar.cc/300?img=12',
4
4
  behindGlowEnabled: true,
@@ -1,4 +1,4 @@
1
- import{r as u,j as r}from"./iframe-2N7rjfXm.js";import{s as z}from"./transform-BKmuZieF.js";import{t as be,e as Me,l as Se,m as Te}from"./monotone-DHdPkfDP.js";import{l as je}from"./linear-dkJHgUri.js";import{t as Q}from"./defaultLocale-DJ2q5QjE.js";import{a as ke,b as De}from"./axis-D3QohQNI.js";import"./preload-helper-C1FmrZbK.js";import"./array-BKyUJesY.js";import"./path-CbwjOpE9.js";const Ee="_container_1dsyv_1",Ce="_controls_1dsyv_10",qe="_viewToggle_1dsyv_18",Le="_viewButton_1dsyv_27",$e="_active_1dsyv_48",Ne="_viewIcon_1dsyv_54",Ae="_viewLabel_1dsyv_59",Ve="_aggregationToggle_1dsyv_69",Ie="_aggregationButton_1dsyv_78",Fe="_aggregationIcon_1dsyv_105",We="_aggregationLabel_1dsyv_110",Be="_legend_1dsyv_120",Re="_compactLegend_1dsyv_132",He="_legendItem_1dsyv_137",Oe="_legendEmoji_1dsyv_142",Ye="_legendLabel_1dsyv_146",ze="_inactive_1dsyv_187",Qe="_legendColor_1dsyv_196",Ue="_chart_1dsyv_233",Pe="_gridLine_1dsyv_238",Ge="_line_1dsyv_244",Ke="_xAxis_1dsyv_251",Xe="_yAxis_1dsyv_252",Je="_dataPoint_1dsyv_271",Ze="_tooltip_1dsyv_281",et="_visible_1dsyv_302",tt="_tooltipHeader_1dsyv_307",at="_tooltipEmoji_1dsyv_318",nt="_tooltipDot_1dsyv_323",rt="_tooltipInfo_1dsyv_330",ot="_tooltipDate_1dsyv_336",st="_tooltipValue_1dsyv_342",t={container:Ee,controls:Ce,viewToggle:qe,viewButton:Le,active:$e,viewIcon:Ne,viewLabel:Ae,aggregationToggle:Ve,aggregationButton:Ie,aggregationIcon:Fe,aggregationLabel:We,legend:Be,compactLegend:Re,legendItem:He,legendEmoji:Oe,legendLabel:Ye,inactive:ze,legendColor:Qe,chart:Ue,gridLine:Pe,line:Ge,xAxis:Ke,yAxis:Xe,dataPoint:Je,tooltip:Ze,visible:et,tooltipHeader:tt,tooltipEmoji:at,tooltipDot:nt,tooltipInfo:rt,tooltipDate:ot,tooltipValue:st},lt={Exercise:"#6BCB77",Meditation:"#4D96FF",Reading:"#FFB319",Water:"#00D9FF",Steps:"#FF6B6B",Sleep:"#9B59B6",Calories:"#FF9F1C",Study:"#C774E8"},ge=({data:n,width:v=800,height:_=400,defaultViewType:M="daily",periodType:b="month",habitColors:U={},habitEmojis:P={},onDataPointClick:W,hideControls:me=!1,compactLegend:pe=!1})=>{const D=u.useRef(null),he=u.useRef(null),[g,ye]=u.useState(M),[E,G]=u.useState([]),[S,K]=u.useState(null),[h,C]=u.useState(null),[q,X]=u.useState("average"),y=u.useMemo(()=>({top:20,right:20,bottom:50,left:50}),[]),B=v-y.left-y.right,R=_-y.top-y.bottom,T=u.useMemo(()=>Object.keys(n).filter(e=>e!=="dates"),[n]);u.useEffect(()=>{G(T)},[T]),u.useEffect(()=>{const e=()=>{C(null)};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[]);const fe=u.useMemo(()=>{switch(b){case"week":return["daily"];case"month":return["daily","weekly"];case"quarter":return["weekly","monthly"];case"year":return["daily","weekly","monthly","quarterly"];case"allTime":return["monthly","quarterly"];default:return["daily"]}},[b]),j=u.useCallback(e=>U[e]||lt[e]||`hsl(${Math.abs(e.split("").reduce((o,s)=>o+s.charCodeAt(0),0))%360}, 70%, 50%)`,[U]),f=u.useMemo(()=>{if(g==="daily"||!n.dates.length)return n;const e={dates:[]},o=new Map;return n.dates.forEach((s,m)=>{const w=new Date(s);let l;switch(g){case"weekly":{const c=new Date(w),p=c.getDay(),L=c.getDate()-p+(p===0?-6:1);c.setDate(L),l=c.toISOString().split("T")[0];break}case"monthly":l=`${w.getFullYear()}-${String(w.getMonth()+1).padStart(2,"0")}-01`;break;case"quarterly":{const p=(Math.floor(w.getMonth()/3)+1-1)*3;l=new Date(w.getFullYear(),p,1).toISOString().split("T")[0];break}default:l=s}o.has(l)||o.set(l,[]),o.get(l).push(m)}),e.dates=Array.from(o.keys()).sort(),T.forEach(s=>{e[s]=e.dates.map(m=>{const l=o.get(m).map(c=>n[s][c]).filter(c=>typeof c=="number"&&!isNaN(c));return l.length===0?0:Math.round(q==="sum"?l.reduce((c,p)=>c+p,0):l.reduce((c,p)=>c+p,0)/l.length)})}),e},[n,g,T,q]),ve=e=>{G(o=>o.includes(e)?o.filter(s=>s!==e):[...o,e])};u.useEffect(()=>{if(!D.current||f.dates.length===0)return;const e=z(D.current);e.selectAll("*").remove(),e.append("rect").attr("width",v).attr("height",_).attr("fill","transparent").style("pointer-events","all").on("mouseleave",()=>{C(null)});const o=e.append("g").attr("transform",`translate(${y.left},${y.top})`),s=f.dates.map(a=>new Date(a)),m=be().domain(Me(s)).range([0,B]),w=Math.max(...E.flatMap(a=>f[a].filter(d=>typeof d=="number"))),l=je().domain([0,w*1.1]).range([R,0]);o.selectAll(".grid-line-y").data(l.ticks(5)).enter().append("line").attr("class",t.gridLine).attr("x1",0).attr("y1",a=>l(a)).attr("x2",B).attr("y2",a=>l(a));const c=Se().x(a=>m(a[0])).y(a=>l(a[1])).curve(Te);E.forEach(a=>{const d=s.map((i,x)=>[i,f[a][x]]).filter(i=>typeof i[1]=="number");o.append("path").datum(d).attr("class",t.line).attr("d",c).attr("stroke",j(a)).attr("opacity",S&&S!==a?.3:1),o.selectAll(`.hover-circle-${a}`).data(d).enter().append("circle").attr("cx",i=>m(i[0])).attr("cy",i=>l(i[1])).attr("r",10).attr("fill","transparent").style("cursor","pointer").on("mouseenter",function(i,x){var Z;const[k,$]=x,Y=(Z=D.current)==null?void 0:Z.getBoundingClientRect();Y&&C({habit:a,date:k.toISOString().split("T")[0],value:$,x:m(k)+y.left+Y.left,y:l($)+y.top+Y.top}),z(o.node()).selectAll(`.circle-${a}-${s.indexOf(k)}`).attr("r",6)}).on("mouseleave",function(i,x){C(null),z(o.node()).selectAll('[class*="circle-'+a+'"]').attr("r",4)}).on("click",function(i,x){const[k,$]=x;W&&W(a,k.toISOString().split("T")[0],$)}),o.selectAll(`.circle-${a}`).data(d).enter().append("circle").attr("class",(i,x)=>`${t.dataPoint} circle-${a}-${x}`).attr("cx",i=>m(i[0])).attr("cy",i=>l(i[1])).attr("r",4).attr("fill",j(a)).attr("opacity",S&&S!==a?.3:1).style("pointer-events","none")});const p=a=>{const d=new Date(a);d.setHours(0,0,0,0),d.setDate(d.getDate()+3-(d.getDay()+6)%7);const i=new Date(d.getFullYear(),0,4);return 1+Math.round(((d.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},L=(()=>{switch(g){case"daily":return Q("%Y-%m-%d");case"weekly":return a=>{const d=p(a);return`${a.getFullYear()}-W${d.toString().padStart(2,"0")}`};case"monthly":return Q("%Y-%m");case"quarterly":return a=>{const d=Math.floor(a.getMonth()/3)+1;return`${a.getFullYear()}-Q${d}`};default:return Q("%Y-%m-%d")}})(),J=(()=>{switch(g){case"daily":return Math.min(10,f.dates.length);case"weekly":return Math.min(12,f.dates.length);case"monthly":return Math.min(12,f.dates.length);case"quarterly":return f.dates.length;default:return}})(),O=ke(m).tickFormat(a=>L(a));g==="quarterly"?O.tickValues(s):J&&O.ticks(J);const xe=o.append("g").attr("class",t.xAxis).attr("transform",`translate(0,${R})`).call(O);(g==="daily"||g==="weekly")&&xe.selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(-45)"),o.append("g").attr("class",t.yAxis).call(De(l))},[f,E,B,R,y,S,W,j,_,g,v]);const _e=(e,o)=>{const s=new Date(e);switch(o){case"daily":return s.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});case"weekly":return new Date(s).setDate(s.getDate()+6),`Week of ${s.toLocaleDateString("en-US",{month:"short",day:"numeric"})}`;case"monthly":return s.toLocaleDateString("en-US",{month:"long",year:"numeric"});case"quarterly":return`Q${Math.floor(s.getMonth()/3)+1} ${s.getFullYear()}`;default:return e}},H={daily:{icon:"📅",label:"Daily"},weekly:{icon:"📆",label:"Weekly"},monthly:{icon:"🗓️",label:"Monthly"},quarterly:{icon:"📊",label:"Quarterly"}},we=g!=="daily";return r.jsxs("div",{className:t.container,children:[!me&&r.jsxs("div",{className:t.controls,children:[r.jsx("div",{className:t.viewToggle,children:fe.map(e=>r.jsxs("button",{className:`${t.viewButton} ${g===e?t.active:""}`,onClick:()=>ye(e),title:H[e].label,children:[r.jsx("span",{className:t.viewIcon,children:H[e].icon}),r.jsx("span",{className:t.viewLabel,children:H[e].label})]},e))}),we&&r.jsxs("div",{className:t.aggregationToggle,children:[r.jsxs("button",{className:`${t.aggregationButton} ${q==="average"?t.active:""}`,onClick:()=>X("average"),title:"Show average values for each period",children:[r.jsx("span",{className:t.aggregationIcon,children:"📊"}),r.jsx("span",{className:t.aggregationLabel,children:"Average"})]}),r.jsxs("button",{className:`${t.aggregationButton} ${q==="sum"?t.active:""}`,onClick:()=>X("sum"),title:"Show total values for each period",children:[r.jsx("span",{className:t.aggregationIcon,children:"➕"}),r.jsx("span",{className:t.aggregationLabel,children:"Sum"})]})]})]}),r.jsx("div",{className:`${t.legend}${pe?` ${t.compactLegend}`:""}`,children:T.map(e=>r.jsxs("button",{className:`${t.legendItem} ${E.includes(e)?"":t.inactive}`,onClick:()=>ve(e),onMouseEnter:()=>K(e),onMouseLeave:()=>K(null),children:[r.jsx("span",{className:t.legendEmoji,children:P[e]||"📊"}),r.jsx("span",{className:t.legendColor,style:{backgroundColor:j(e)}}),r.jsx("span",{className:t.legendLabel,children:e})]},e))}),r.jsx("svg",{ref:D,width:v,height:_,className:t.chart}),h&&r.jsxs("div",{ref:he,className:`${t.tooltip} ${h?t.visible:""}`,style:{left:`${h.x}px`,top:`${h.y-80}px`},children:[r.jsxs("div",{className:t.tooltipHeader,children:[r.jsx("span",{className:t.tooltipEmoji,children:P[h.habit]||"📊"}),r.jsx("span",{className:t.tooltipDot,style:{backgroundColor:j(h.habit)}}),r.jsx("span",{children:h.habit})]}),r.jsxs("div",{className:t.tooltipInfo,children:[r.jsx("div",{className:t.tooltipDate,children:_e(h.date,g)}),r.jsxs("div",{className:t.tooltipValue,children:[r.jsx("strong",{children:Math.round(h.value*10)/10}),r.jsx("span",{style:{fontSize:"12px",fontWeight:"normal",opacity:.6},children:"units"})]})]})]})]})};ge.__docgenInfo={description:"",methods:[],displayName:"QuantifiableHabitsChart",props:{data:{required:!0,tsType:{name:"ChartData"},description:""},width:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"800",computed:!1}},height:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"400",computed:!1}},defaultViewType:{required:!1,tsType:{name:"union",raw:"'daily' | 'weekly' | 'monthly' | 'quarterly'",elements:[{name:"literal",value:"'daily'"},{name:"literal",value:"'weekly'"},{name:"literal",value:"'monthly'"},{name:"literal",value:"'quarterly'"}]},description:"",defaultValue:{value:"'daily'",computed:!1}},periodType:{required:!1,tsType:{name:"union",raw:"'week' | 'month' | 'quarter' | 'year' | 'allTime'",elements:[{name:"literal",value:"'week'"},{name:"literal",value:"'month'"},{name:"literal",value:"'quarter'"},{name:"literal",value:"'year'"},{name:"literal",value:"'allTime'"}]},description:"",defaultValue:{value:"'month'",computed:!1}},habitColors:{required:!1,tsType:{name:"signature",type:"object",raw:"{ [key: string]: string }",signature:{properties:[{key:{name:"string"},value:{name:"string",required:!0}}]}},description:"",defaultValue:{value:"{}",computed:!1}},habitEmojis:{required:!1,tsType:{name:"signature",type:"object",raw:"{ [key: string]: string }",signature:{properties:[{key:{name:"string"},value:{name:"string",required:!0}}]}},description:"",defaultValue:{value:"{}",computed:!1}},onDataPointClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(habit: string, date: string, value: number) => void",signature:{arguments:[{type:{name:"string"},name:"habit"},{type:{name:"string"},name:"date"},{type:{name:"number"},name:"value"}],return:{name:"void"}}},description:""},hideControls:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},compactLegend:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}}}};const ft={title:"Organisms/Charts/QuantifiableHabitsChart",component:ge,parameters:{layout:"centered"},argTypes:{width:{control:{type:"number",min:400,max:1200,step:50}},height:{control:{type:"number",min:200,max:600,step:50}},defaultViewType:{control:{type:"select"},options:["daily","weekly","monthly","quarterly"]},periodType:{control:{type:"select"},options:["week","month","quarter","year","allTime"]}}},F=n=>{const v=[],_=new Date;for(let M=n-1;M>=0;M--){const b=new Date(_);b.setDate(b.getDate()-M),v.push(b.toISOString().split("T")[0])}return v},N={args:{data:(()=>{const n=F(30);return{dates:n,Exercise:n.map(()=>Math.floor(Math.random()*60)+20),Reading:n.map(()=>Math.floor(Math.random()*120)+30),Water:n.map(()=>Math.floor(Math.random()*8)+2),Steps:n.map(()=>Math.floor(Math.random()*15e3)+5e3)}})(),width:900,height:400,defaultViewType:"daily",periodType:"month",habitColors:{Exercise:"#10b981",Reading:"#8b5cf6",Water:"#3b82f6",Steps:"#f59e0b"},habitEmojis:{Exercise:"🏃",Reading:"📚",Water:"💧",Steps:"👟"}}},A={args:{data:(()=>{const n=F(90);return{dates:n,Meditation:n.map(()=>Math.floor(Math.random()*30)+10),Study:n.map(()=>Math.floor(Math.random()*180)+60),Sleep:n.map(()=>Math.floor(Math.random()*3)+6)}})(),width:900,height:400,defaultViewType:"weekly",periodType:"quarter",habitColors:{Meditation:"#a78bfa",Study:"#34d399",Sleep:"#60a5fa"},habitEmojis:{Meditation:"🧘",Study:"📖",Sleep:"😴"}}},V={args:{data:(()=>{const n=F(365);return{dates:n,Coding:n.map(()=>Math.floor(Math.random()*240)+120),Exercise:n.map(()=>Math.floor(Math.random()*90)+30),Learning:n.map(()=>Math.floor(Math.random()*120)+60),Socializing:n.map(()=>Math.floor(Math.random()*180)+60)}})(),width:1e3,height:450,defaultViewType:"monthly",periodType:"year",habitColors:{Coding:"#7c3aed",Exercise:"#10b981",Learning:"#f59e0b",Socializing:"#ec4899"},habitEmojis:{Coding:"💻",Exercise:"💪",Learning:"🎓",Socializing:"👥"}}},I={args:{data:(()=>{const n=F(30);return{dates:n,Weight:n.map((v,_)=>70+Math.sin(_/5)*2+Math.random())}})(),width:800,height:300,defaultViewType:"daily",periodType:"month",habitColors:{Weight:"#3b82f6"},habitEmojis:{Weight:"⚖️"}}};var ee,te,ae;N.parameters={...N.parameters,docs:{...(ee=N.parameters)==null?void 0:ee.docs,source:{originalSource:`{
1
+ import{r as u,j as r}from"./iframe-CvT6MryR.js";import{s as z}from"./transform-BKmuZieF.js";import{t as be,e as Me,l as Se,m as Te}from"./monotone-DHdPkfDP.js";import{l as je}from"./linear-dkJHgUri.js";import{t as Q}from"./defaultLocale-DJ2q5QjE.js";import{a as ke,b as De}from"./axis-D3QohQNI.js";import"./preload-helper-C1FmrZbK.js";import"./array-BKyUJesY.js";import"./path-CbwjOpE9.js";const Ee="_container_1dsyv_1",Ce="_controls_1dsyv_10",qe="_viewToggle_1dsyv_18",Le="_viewButton_1dsyv_27",$e="_active_1dsyv_48",Ne="_viewIcon_1dsyv_54",Ae="_viewLabel_1dsyv_59",Ve="_aggregationToggle_1dsyv_69",Ie="_aggregationButton_1dsyv_78",Fe="_aggregationIcon_1dsyv_105",We="_aggregationLabel_1dsyv_110",Be="_legend_1dsyv_120",Re="_compactLegend_1dsyv_132",He="_legendItem_1dsyv_137",Oe="_legendEmoji_1dsyv_142",Ye="_legendLabel_1dsyv_146",ze="_inactive_1dsyv_187",Qe="_legendColor_1dsyv_196",Ue="_chart_1dsyv_233",Pe="_gridLine_1dsyv_238",Ge="_line_1dsyv_244",Ke="_xAxis_1dsyv_251",Xe="_yAxis_1dsyv_252",Je="_dataPoint_1dsyv_271",Ze="_tooltip_1dsyv_281",et="_visible_1dsyv_302",tt="_tooltipHeader_1dsyv_307",at="_tooltipEmoji_1dsyv_318",nt="_tooltipDot_1dsyv_323",rt="_tooltipInfo_1dsyv_330",ot="_tooltipDate_1dsyv_336",st="_tooltipValue_1dsyv_342",t={container:Ee,controls:Ce,viewToggle:qe,viewButton:Le,active:$e,viewIcon:Ne,viewLabel:Ae,aggregationToggle:Ve,aggregationButton:Ie,aggregationIcon:Fe,aggregationLabel:We,legend:Be,compactLegend:Re,legendItem:He,legendEmoji:Oe,legendLabel:Ye,inactive:ze,legendColor:Qe,chart:Ue,gridLine:Pe,line:Ge,xAxis:Ke,yAxis:Xe,dataPoint:Je,tooltip:Ze,visible:et,tooltipHeader:tt,tooltipEmoji:at,tooltipDot:nt,tooltipInfo:rt,tooltipDate:ot,tooltipValue:st},lt={Exercise:"#6BCB77",Meditation:"#4D96FF",Reading:"#FFB319",Water:"#00D9FF",Steps:"#FF6B6B",Sleep:"#9B59B6",Calories:"#FF9F1C",Study:"#C774E8"},ge=({data:n,width:v=800,height:_=400,defaultViewType:M="daily",periodType:b="month",habitColors:U={},habitEmojis:P={},onDataPointClick:W,hideControls:me=!1,compactLegend:pe=!1})=>{const D=u.useRef(null),he=u.useRef(null),[g,ye]=u.useState(M),[E,G]=u.useState([]),[S,K]=u.useState(null),[h,C]=u.useState(null),[q,X]=u.useState("average"),y=u.useMemo(()=>({top:20,right:20,bottom:50,left:50}),[]),B=v-y.left-y.right,R=_-y.top-y.bottom,T=u.useMemo(()=>Object.keys(n).filter(e=>e!=="dates"),[n]);u.useEffect(()=>{G(T)},[T]),u.useEffect(()=>{const e=()=>{C(null)};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[]);const fe=u.useMemo(()=>{switch(b){case"week":return["daily"];case"month":return["daily","weekly"];case"quarter":return["weekly","monthly"];case"year":return["daily","weekly","monthly","quarterly"];case"allTime":return["monthly","quarterly"];default:return["daily"]}},[b]),j=u.useCallback(e=>U[e]||lt[e]||`hsl(${Math.abs(e.split("").reduce((o,s)=>o+s.charCodeAt(0),0))%360}, 70%, 50%)`,[U]),f=u.useMemo(()=>{if(g==="daily"||!n.dates.length)return n;const e={dates:[]},o=new Map;return n.dates.forEach((s,m)=>{const w=new Date(s);let l;switch(g){case"weekly":{const c=new Date(w),p=c.getDay(),L=c.getDate()-p+(p===0?-6:1);c.setDate(L),l=c.toISOString().split("T")[0];break}case"monthly":l=`${w.getFullYear()}-${String(w.getMonth()+1).padStart(2,"0")}-01`;break;case"quarterly":{const p=(Math.floor(w.getMonth()/3)+1-1)*3;l=new Date(w.getFullYear(),p,1).toISOString().split("T")[0];break}default:l=s}o.has(l)||o.set(l,[]),o.get(l).push(m)}),e.dates=Array.from(o.keys()).sort(),T.forEach(s=>{e[s]=e.dates.map(m=>{const l=o.get(m).map(c=>n[s][c]).filter(c=>typeof c=="number"&&!isNaN(c));return l.length===0?0:Math.round(q==="sum"?l.reduce((c,p)=>c+p,0):l.reduce((c,p)=>c+p,0)/l.length)})}),e},[n,g,T,q]),ve=e=>{G(o=>o.includes(e)?o.filter(s=>s!==e):[...o,e])};u.useEffect(()=>{if(!D.current||f.dates.length===0)return;const e=z(D.current);e.selectAll("*").remove(),e.append("rect").attr("width",v).attr("height",_).attr("fill","transparent").style("pointer-events","all").on("mouseleave",()=>{C(null)});const o=e.append("g").attr("transform",`translate(${y.left},${y.top})`),s=f.dates.map(a=>new Date(a)),m=be().domain(Me(s)).range([0,B]),w=Math.max(...E.flatMap(a=>f[a].filter(d=>typeof d=="number"))),l=je().domain([0,w*1.1]).range([R,0]);o.selectAll(".grid-line-y").data(l.ticks(5)).enter().append("line").attr("class",t.gridLine).attr("x1",0).attr("y1",a=>l(a)).attr("x2",B).attr("y2",a=>l(a));const c=Se().x(a=>m(a[0])).y(a=>l(a[1])).curve(Te);E.forEach(a=>{const d=s.map((i,x)=>[i,f[a][x]]).filter(i=>typeof i[1]=="number");o.append("path").datum(d).attr("class",t.line).attr("d",c).attr("stroke",j(a)).attr("opacity",S&&S!==a?.3:1),o.selectAll(`.hover-circle-${a}`).data(d).enter().append("circle").attr("cx",i=>m(i[0])).attr("cy",i=>l(i[1])).attr("r",10).attr("fill","transparent").style("cursor","pointer").on("mouseenter",function(i,x){var Z;const[k,$]=x,Y=(Z=D.current)==null?void 0:Z.getBoundingClientRect();Y&&C({habit:a,date:k.toISOString().split("T")[0],value:$,x:m(k)+y.left+Y.left,y:l($)+y.top+Y.top}),z(o.node()).selectAll(`.circle-${a}-${s.indexOf(k)}`).attr("r",6)}).on("mouseleave",function(i,x){C(null),z(o.node()).selectAll('[class*="circle-'+a+'"]').attr("r",4)}).on("click",function(i,x){const[k,$]=x;W&&W(a,k.toISOString().split("T")[0],$)}),o.selectAll(`.circle-${a}`).data(d).enter().append("circle").attr("class",(i,x)=>`${t.dataPoint} circle-${a}-${x}`).attr("cx",i=>m(i[0])).attr("cy",i=>l(i[1])).attr("r",4).attr("fill",j(a)).attr("opacity",S&&S!==a?.3:1).style("pointer-events","none")});const p=a=>{const d=new Date(a);d.setHours(0,0,0,0),d.setDate(d.getDate()+3-(d.getDay()+6)%7);const i=new Date(d.getFullYear(),0,4);return 1+Math.round(((d.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},L=(()=>{switch(g){case"daily":return Q("%Y-%m-%d");case"weekly":return a=>{const d=p(a);return`${a.getFullYear()}-W${d.toString().padStart(2,"0")}`};case"monthly":return Q("%Y-%m");case"quarterly":return a=>{const d=Math.floor(a.getMonth()/3)+1;return`${a.getFullYear()}-Q${d}`};default:return Q("%Y-%m-%d")}})(),J=(()=>{switch(g){case"daily":return Math.min(10,f.dates.length);case"weekly":return Math.min(12,f.dates.length);case"monthly":return Math.min(12,f.dates.length);case"quarterly":return f.dates.length;default:return}})(),O=ke(m).tickFormat(a=>L(a));g==="quarterly"?O.tickValues(s):J&&O.ticks(J);const xe=o.append("g").attr("class",t.xAxis).attr("transform",`translate(0,${R})`).call(O);(g==="daily"||g==="weekly")&&xe.selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(-45)"),o.append("g").attr("class",t.yAxis).call(De(l))},[f,E,B,R,y,S,W,j,_,g,v]);const _e=(e,o)=>{const s=new Date(e);switch(o){case"daily":return s.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});case"weekly":return new Date(s).setDate(s.getDate()+6),`Week of ${s.toLocaleDateString("en-US",{month:"short",day:"numeric"})}`;case"monthly":return s.toLocaleDateString("en-US",{month:"long",year:"numeric"});case"quarterly":return`Q${Math.floor(s.getMonth()/3)+1} ${s.getFullYear()}`;default:return e}},H={daily:{icon:"📅",label:"Daily"},weekly:{icon:"📆",label:"Weekly"},monthly:{icon:"🗓️",label:"Monthly"},quarterly:{icon:"📊",label:"Quarterly"}},we=g!=="daily";return r.jsxs("div",{className:t.container,children:[!me&&r.jsxs("div",{className:t.controls,children:[r.jsx("div",{className:t.viewToggle,children:fe.map(e=>r.jsxs("button",{className:`${t.viewButton} ${g===e?t.active:""}`,onClick:()=>ye(e),title:H[e].label,children:[r.jsx("span",{className:t.viewIcon,children:H[e].icon}),r.jsx("span",{className:t.viewLabel,children:H[e].label})]},e))}),we&&r.jsxs("div",{className:t.aggregationToggle,children:[r.jsxs("button",{className:`${t.aggregationButton} ${q==="average"?t.active:""}`,onClick:()=>X("average"),title:"Show average values for each period",children:[r.jsx("span",{className:t.aggregationIcon,children:"📊"}),r.jsx("span",{className:t.aggregationLabel,children:"Average"})]}),r.jsxs("button",{className:`${t.aggregationButton} ${q==="sum"?t.active:""}`,onClick:()=>X("sum"),title:"Show total values for each period",children:[r.jsx("span",{className:t.aggregationIcon,children:"➕"}),r.jsx("span",{className:t.aggregationLabel,children:"Sum"})]})]})]}),r.jsx("div",{className:`${t.legend}${pe?` ${t.compactLegend}`:""}`,children:T.map(e=>r.jsxs("button",{className:`${t.legendItem} ${E.includes(e)?"":t.inactive}`,onClick:()=>ve(e),onMouseEnter:()=>K(e),onMouseLeave:()=>K(null),children:[r.jsx("span",{className:t.legendEmoji,children:P[e]||"📊"}),r.jsx("span",{className:t.legendColor,style:{backgroundColor:j(e)}}),r.jsx("span",{className:t.legendLabel,children:e})]},e))}),r.jsx("svg",{ref:D,width:v,height:_,className:t.chart}),h&&r.jsxs("div",{ref:he,className:`${t.tooltip} ${h?t.visible:""}`,style:{left:`${h.x}px`,top:`${h.y-80}px`},children:[r.jsxs("div",{className:t.tooltipHeader,children:[r.jsx("span",{className:t.tooltipEmoji,children:P[h.habit]||"📊"}),r.jsx("span",{className:t.tooltipDot,style:{backgroundColor:j(h.habit)}}),r.jsx("span",{children:h.habit})]}),r.jsxs("div",{className:t.tooltipInfo,children:[r.jsx("div",{className:t.tooltipDate,children:_e(h.date,g)}),r.jsxs("div",{className:t.tooltipValue,children:[r.jsx("strong",{children:Math.round(h.value*10)/10}),r.jsx("span",{style:{fontSize:"12px",fontWeight:"normal",opacity:.6},children:"units"})]})]})]})]})};ge.__docgenInfo={description:"",methods:[],displayName:"QuantifiableHabitsChart",props:{data:{required:!0,tsType:{name:"ChartData"},description:""},width:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"800",computed:!1}},height:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"400",computed:!1}},defaultViewType:{required:!1,tsType:{name:"union",raw:"'daily' | 'weekly' | 'monthly' | 'quarterly'",elements:[{name:"literal",value:"'daily'"},{name:"literal",value:"'weekly'"},{name:"literal",value:"'monthly'"},{name:"literal",value:"'quarterly'"}]},description:"",defaultValue:{value:"'daily'",computed:!1}},periodType:{required:!1,tsType:{name:"union",raw:"'week' | 'month' | 'quarter' | 'year' | 'allTime'",elements:[{name:"literal",value:"'week'"},{name:"literal",value:"'month'"},{name:"literal",value:"'quarter'"},{name:"literal",value:"'year'"},{name:"literal",value:"'allTime'"}]},description:"",defaultValue:{value:"'month'",computed:!1}},habitColors:{required:!1,tsType:{name:"signature",type:"object",raw:"{ [key: string]: string }",signature:{properties:[{key:{name:"string"},value:{name:"string",required:!0}}]}},description:"",defaultValue:{value:"{}",computed:!1}},habitEmojis:{required:!1,tsType:{name:"signature",type:"object",raw:"{ [key: string]: string }",signature:{properties:[{key:{name:"string"},value:{name:"string",required:!0}}]}},description:"",defaultValue:{value:"{}",computed:!1}},onDataPointClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(habit: string, date: string, value: number) => void",signature:{arguments:[{type:{name:"string"},name:"habit"},{type:{name:"string"},name:"date"},{type:{name:"number"},name:"value"}],return:{name:"void"}}},description:""},hideControls:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},compactLegend:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}}}};const ft={title:"Organisms/Charts/QuantifiableHabitsChart",component:ge,parameters:{layout:"centered"},argTypes:{width:{control:{type:"number",min:400,max:1200,step:50}},height:{control:{type:"number",min:200,max:600,step:50}},defaultViewType:{control:{type:"select"},options:["daily","weekly","monthly","quarterly"]},periodType:{control:{type:"select"},options:["week","month","quarter","year","allTime"]}}},F=n=>{const v=[],_=new Date;for(let M=n-1;M>=0;M--){const b=new Date(_);b.setDate(b.getDate()-M),v.push(b.toISOString().split("T")[0])}return v},N={args:{data:(()=>{const n=F(30);return{dates:n,Exercise:n.map(()=>Math.floor(Math.random()*60)+20),Reading:n.map(()=>Math.floor(Math.random()*120)+30),Water:n.map(()=>Math.floor(Math.random()*8)+2),Steps:n.map(()=>Math.floor(Math.random()*15e3)+5e3)}})(),width:900,height:400,defaultViewType:"daily",periodType:"month",habitColors:{Exercise:"#10b981",Reading:"#8b5cf6",Water:"#3b82f6",Steps:"#f59e0b"},habitEmojis:{Exercise:"🏃",Reading:"📚",Water:"💧",Steps:"👟"}}},A={args:{data:(()=>{const n=F(90);return{dates:n,Meditation:n.map(()=>Math.floor(Math.random()*30)+10),Study:n.map(()=>Math.floor(Math.random()*180)+60),Sleep:n.map(()=>Math.floor(Math.random()*3)+6)}})(),width:900,height:400,defaultViewType:"weekly",periodType:"quarter",habitColors:{Meditation:"#a78bfa",Study:"#34d399",Sleep:"#60a5fa"},habitEmojis:{Meditation:"🧘",Study:"📖",Sleep:"😴"}}},V={args:{data:(()=>{const n=F(365);return{dates:n,Coding:n.map(()=>Math.floor(Math.random()*240)+120),Exercise:n.map(()=>Math.floor(Math.random()*90)+30),Learning:n.map(()=>Math.floor(Math.random()*120)+60),Socializing:n.map(()=>Math.floor(Math.random()*180)+60)}})(),width:1e3,height:450,defaultViewType:"monthly",periodType:"year",habitColors:{Coding:"#7c3aed",Exercise:"#10b981",Learning:"#f59e0b",Socializing:"#ec4899"},habitEmojis:{Coding:"💻",Exercise:"💪",Learning:"🎓",Socializing:"👥"}}},I={args:{data:(()=>{const n=F(30);return{dates:n,Weight:n.map((v,_)=>70+Math.sin(_/5)*2+Math.random())}})(),width:800,height:300,defaultViewType:"daily",periodType:"month",habitColors:{Weight:"#3b82f6"},habitEmojis:{Weight:"⚖️"}}};var ee,te,ae;N.parameters={...N.parameters,docs:{...(ee=N.parameters)==null?void 0:ee.docs,source:{originalSource:`{
2
2
  args: {
3
3
  data: (() => {
4
4
  const dates = generateDateRange(30);
@@ -1,4 +1,4 @@
1
- import{r as y,j as W}from"./iframe-2N7rjfXm.js";import{R as D,P as G,M as U}from"./Mesh-CwXV3WjE.js";import{T as z}from"./Triangle-64ffRKNB.js";import"./preload-helper-C1FmrZbK.js";const j={"radar-container":"_radar-container_51ksp_1"};function L(n){const u=n.replace("#","");return[parseInt(u.slice(0,2),16)/255,parseInt(u.slice(2,4),16)/255,parseInt(u.slice(4,6),16)/255]}const N=`
1
+ import{r as y,j as W}from"./iframe-CvT6MryR.js";import{R as D,P as G,M as U}from"./Mesh-CwXV3WjE.js";import{T as z}from"./Triangle-64ffRKNB.js";import"./preload-helper-C1FmrZbK.js";const j={"radar-container":"_radar-container_51ksp_1"};function L(n){const u=n.replace("#","");return[parseInt(u.slice(0,2),16)/255,parseInt(u.slice(2,4),16)/255,parseInt(u.slice(4,6),16)/255]}const N=`
2
2
  attribute vec2 uv;
3
3
  attribute vec2 position;
4
4
  varying vec2 vUv;
@@ -1,4 +1,4 @@
1
- import{r as D,j as X}from"./iframe-2N7rjfXm.js";import{G as Y,P as $,M as J,V as m,R as K,T as Q}from"./Mesh-CwXV3WjE.js";import{V as Z}from"./Vec2-Cf1C3GIc.js";import{C as j}from"./Color-YRkaOI4u.js";import"./preload-helper-C1FmrZbK.js";const v=new m;class ee{constructor(o,{points:t,vertex:w=te,fragment:E=oe,uniforms:r={},attributes:R={}}){this.gl=o,this.points=t,this.count=t.length,this.position=new Float32Array(this.count*3*2),this.prev=new Float32Array(this.count*3*2),this.next=new Float32Array(this.count*3*2);const h=new Float32Array(this.count*1*2),y=new Float32Array(this.count*2*2),p=new Uint16Array((this.count-1)*3*2);for(let u=0;u<this.count;u++){h.set([-1,1],u*2);const n=u/(this.count-1);if(y.set([0,n,1,n],u*4),u===this.count-1)continue;const i=u*2;p.set([i+0,i+1,i+2],(i+0)*3),p.set([i+2,i+1,i+3],(i+1)*3)}const A=this.geometry=new Y(o,Object.assign(R,{position:{size:3,data:this.position},prev:{size:3,data:this.prev},next:{size:3,data:this.next},side:{size:1,data:h},uv:{size:2,data:y},index:{size:1,data:p}}));this.updateGeometry(),r.uResolution||(this.resolution=r.uResolution={value:new Z}),r.uDPR||(this.dpr=r.uDPR={value:1}),r.uThickness||(this.thickness=r.uThickness={value:1}),r.uColor||(this.color=r.uColor={value:new j("#000")}),r.uMiter||(this.miter=r.uMiter={value:1}),this.resize();const l=this.program=new $(o,{vertex:w,fragment:E,uniforms:r});this.mesh=new J(o,{geometry:A,program:l})}updateGeometry(){this.points.forEach((o,t)=>{o.toArray(this.position,t*3*2),o.toArray(this.position,t*3*2+3),t?(o.toArray(this.next,(t-1)*3*2),o.toArray(this.next,(t-1)*3*2+3)):(v.copy(o).sub(this.points[t+1]).add(o),v.toArray(this.prev,t*3*2),v.toArray(this.prev,t*3*2+3)),t===this.points.length-1?(v.copy(o).sub(this.points[t-1]).add(o),v.toArray(this.next,t*3*2),v.toArray(this.next,t*3*2+3)):(o.toArray(this.prev,(t+1)*3*2),o.toArray(this.prev,(t+1)*3*2+3))}),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.prev.needsUpdate=!0,this.geometry.attributes.next.needsUpdate=!0}resize(){this.resolution&&this.resolution.value.set(this.gl.canvas.width,this.gl.canvas.height),this.dpr&&(this.dpr.value=this.gl.renderer.dpr)}}const te=`
1
+ import{r as D,j as X}from"./iframe-CvT6MryR.js";import{G as Y,P as $,M as J,V as m,R as K,T as Q}from"./Mesh-CwXV3WjE.js";import{V as Z}from"./Vec2-Cf1C3GIc.js";import{C as j}from"./Color-YRkaOI4u.js";import"./preload-helper-C1FmrZbK.js";const v=new m;class ee{constructor(o,{points:t,vertex:w=te,fragment:E=oe,uniforms:r={},attributes:R={}}){this.gl=o,this.points=t,this.count=t.length,this.position=new Float32Array(this.count*3*2),this.prev=new Float32Array(this.count*3*2),this.next=new Float32Array(this.count*3*2);const h=new Float32Array(this.count*1*2),y=new Float32Array(this.count*2*2),p=new Uint16Array((this.count-1)*3*2);for(let u=0;u<this.count;u++){h.set([-1,1],u*2);const n=u/(this.count-1);if(y.set([0,n,1,n],u*4),u===this.count-1)continue;const i=u*2;p.set([i+0,i+1,i+2],(i+0)*3),p.set([i+2,i+1,i+3],(i+1)*3)}const A=this.geometry=new Y(o,Object.assign(R,{position:{size:3,data:this.position},prev:{size:3,data:this.prev},next:{size:3,data:this.next},side:{size:1,data:h},uv:{size:2,data:y},index:{size:1,data:p}}));this.updateGeometry(),r.uResolution||(this.resolution=r.uResolution={value:new Z}),r.uDPR||(this.dpr=r.uDPR={value:1}),r.uThickness||(this.thickness=r.uThickness={value:1}),r.uColor||(this.color=r.uColor={value:new j("#000")}),r.uMiter||(this.miter=r.uMiter={value:1}),this.resize();const l=this.program=new $(o,{vertex:w,fragment:E,uniforms:r});this.mesh=new J(o,{geometry:A,program:l})}updateGeometry(){this.points.forEach((o,t)=>{o.toArray(this.position,t*3*2),o.toArray(this.position,t*3*2+3),t?(o.toArray(this.next,(t-1)*3*2),o.toArray(this.next,(t-1)*3*2+3)):(v.copy(o).sub(this.points[t+1]).add(o),v.toArray(this.prev,t*3*2),v.toArray(this.prev,t*3*2+3)),t===this.points.length-1?(v.copy(o).sub(this.points[t-1]).add(o),v.toArray(this.next,t*3*2),v.toArray(this.next,t*3*2+3)):(o.toArray(this.prev,(t+1)*3*2),o.toArray(this.prev,(t+1)*3*2+3))}),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.prev.needsUpdate=!0,this.geometry.attributes.next.needsUpdate=!0}resize(){this.resolution&&this.resolution.value.set(this.gl.canvas.width,this.gl.canvas.height),this.dpr&&(this.dpr.value=this.gl.renderer.dpr)}}const te=`
2
2
  precision highp float;
3
3
 
4
4
  attribute vec3 position;
@@ -1,4 +1,4 @@
1
- import{r as u,j as N}from"./iframe-2N7rjfXm.js";import{R as G,P as j,M as H}from"./Mesh-CwXV3WjE.js";import{T as $}from"./Triangle-64ffRKNB.js";import"./preload-helper-C1FmrZbK.js";const O={"ripple-grid-container":"_ripple-grid-container_1783h_1"},P=({enableRainbow:d=!1,gridColor:v="#ffffff",rippleIntensity:m=.05,gridSize:p=10,gridThickness:g=15,fadeDistance:h=1.5,vignetteStrength:R=2,glowIntensity:y=.1,opacity:x=1,gridRotation:I=0,mouseInteraction:i=!0,mouseInteractionRadius:w=1})=>{const r=u.useRef(null),l=u.useRef({x:.5,y:.5}),T=u.useRef({x:.5,y:.5}),b=u.useRef(0),n=u.useRef(null);return u.useEffect(()=>{if(!r.current)return;const E=o=>{const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);return t?[parseInt(t[1],16)/255,parseInt(t[2],16)/255,parseInt(t[3],16)/255]:[1,1,1]},c=new G({dpr:Math.min(window.devicePixelRatio,2),alpha:!0}),e=c.gl;e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.canvas.style.width="100%",e.canvas.style.height="100%",r.current.appendChild(e.canvas);const z=`
1
+ import{r as u,j as N}from"./iframe-CvT6MryR.js";import{R as G,P as j,M as H}from"./Mesh-CwXV3WjE.js";import{T as $}from"./Triangle-64ffRKNB.js";import"./preload-helper-C1FmrZbK.js";const O={"ripple-grid-container":"_ripple-grid-container_1783h_1"},P=({enableRainbow:d=!1,gridColor:v="#ffffff",rippleIntensity:m=.05,gridSize:p=10,gridThickness:g=15,fadeDistance:h=1.5,vignetteStrength:R=2,glowIntensity:y=.1,opacity:x=1,gridRotation:I=0,mouseInteraction:i=!0,mouseInteractionRadius:w=1})=>{const r=u.useRef(null),l=u.useRef({x:.5,y:.5}),T=u.useRef({x:.5,y:.5}),b=u.useRef(0),n=u.useRef(null);return u.useEffect(()=>{if(!r.current)return;const E=o=>{const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);return t?[parseInt(t[1],16)/255,parseInt(t[2],16)/255,parseInt(t[3],16)/255]:[1,1,1]},c=new G({dpr:Math.min(window.devicePixelRatio,2),alpha:!0}),e=c.gl;e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.canvas.style.width="100%",e.canvas.style.height="100%",r.current.appendChild(e.canvas);const z=`
2
2
  attribute vec2 position;
3
3
  varying vec2 vUv;
4
4
  void main() {
@@ -1,4 +1,4 @@
1
- import{r as s,j as l}from"./iframe-2N7rjfXm.js";import{m as C}from"./proxy-qiKixXs8.js";import{A as Q}from"./index-IKMS7NhW.js";import"./preload-helper-C1FmrZbK.js";import"./MotionConfigContext-4uS6JRtS.js";const i={"text-rotate":"_text-rotate_1n8cd_1","text-rotate-sr-only":"_text-rotate-sr-only_1n8cd_8","text-rotate-word":"_text-rotate-word_1n8cd_20","text-rotate-lines":"_text-rotate-lines_1n8cd_24","text-rotate-element":"_text-rotate-element_1n8cd_30","text-rotate-space":"_text-rotate-space_1n8cd_34"};function h(...y){return y.filter(Boolean).join(" ")}const v=s.forwardRef((y,D)=>{const{texts:o,transition:N={type:"spring",damping:25,stiffness:300},initial:w={y:"100%",opacity:0},animate:A={y:0,opacity:1},exit:E={y:"-120%",opacity:0},animatePresenceMode:F="wait",animatePresenceInitial:H=!1,rotationInterval:j=2e3,staggerDuration:m=0,staggerFrom:u="first",loop:d=!0,auto:M=!0,splitBy:p="characters",onNext:_,mainClassName:P,splitLevelClassName:L,elementLevelClassName:W,...$}=y,[e,q]=s.useState(0),z=t=>{if(typeof Intl<"u"&&Intl.Segmenter){const a=new Intl.Segmenter("en",{granularity:"grapheme"});return Array.from(a.segment(t),r=>r.segment)}return Array.from(t)},G=s.useMemo(()=>{const t=o[e];if(p==="characters"){const a=t.split(" ");return a.map((r,n)=>({characters:z(r),needsSpace:n!==a.length-1}))}return p==="words"?t.split(" ").map((a,r,n)=>({characters:[a],needsSpace:r!==n.length-1})):p==="lines"?t.split(`
1
+ import{r as s,j as l}from"./iframe-CvT6MryR.js";import{m as C}from"./proxy-0exJiild.js";import{A as Q}from"./index-2ZuXCVEx.js";import"./preload-helper-C1FmrZbK.js";import"./MotionConfigContext-BdSKNtzx.js";const i={"text-rotate":"_text-rotate_1n8cd_1","text-rotate-sr-only":"_text-rotate-sr-only_1n8cd_8","text-rotate-word":"_text-rotate-word_1n8cd_20","text-rotate-lines":"_text-rotate-lines_1n8cd_24","text-rotate-element":"_text-rotate-element_1n8cd_30","text-rotate-space":"_text-rotate-space_1n8cd_34"};function h(...y){return y.filter(Boolean).join(" ")}const v=s.forwardRef((y,D)=>{const{texts:o,transition:N={type:"spring",damping:25,stiffness:300},initial:w={y:"100%",opacity:0},animate:A={y:0,opacity:1},exit:E={y:"-120%",opacity:0},animatePresenceMode:F="wait",animatePresenceInitial:H=!1,rotationInterval:j=2e3,staggerDuration:m=0,staggerFrom:u="first",loop:d=!0,auto:M=!0,splitBy:p="characters",onNext:_,mainClassName:P,splitLevelClassName:L,elementLevelClassName:W,...$}=y,[e,q]=s.useState(0),z=t=>{if(typeof Intl<"u"&&Intl.Segmenter){const a=new Intl.Segmenter("en",{granularity:"grapheme"});return Array.from(a.segment(t),r=>r.segment)}return Array.from(t)},G=s.useMemo(()=>{const t=o[e];if(p==="characters"){const a=t.split(" ");return a.map((r,n)=>({characters:z(r),needsSpace:n!==a.length-1}))}return p==="words"?t.split(" ").map((a,r,n)=>({characters:[a],needsSpace:r!==n.length-1})):p==="lines"?t.split(`
2
2
  `).map((a,r,n)=>({characters:[a],needsSpace:r!==n.length-1})):t.split(p).map((a,r,n)=>({characters:[a],needsSpace:r!==n.length-1}))},[o,e,p]),J=s.useCallback((t,a)=>{const r=a;if(u==="first")return t*m;if(u==="last")return(r-1-t)*m;if(u==="center"){const n=Math.floor(r/2);return Math.abs(n-t)*m}if(u==="random"){const n=Math.floor(Math.random()*r);return Math.abs(n-t)*m}return Math.abs(u-t)*m},[u,m]),c=s.useCallback(t=>{q(t),_&&_(t)},[_]),g=s.useCallback(()=>{const t=e===o.length-1?d?0:e:e+1;t!==e&&c(t)},[e,o.length,d,c]),S=s.useCallback(()=>{const t=e===0?d?o.length-1:e:e-1;t!==e&&c(t)},[e,o.length,d,c]),R=s.useCallback(t=>{const a=Math.max(0,Math.min(t,o.length-1));a!==e&&c(a)},[o.length,e,c]),T=s.useCallback(()=>{e!==0&&c(0)},[e,c]);return s.useImperativeHandle(D,()=>({next:g,previous:S,jumpTo:R,reset:T}),[g,S,R,T]),s.useEffect(()=>{if(!M)return;const t=setInterval(g,j);return()=>clearInterval(t)},[g,j,M]),l.jsxs(C.span,{className:h(i["text-rotate"],P),...$,layout:!0,transition:N,children:[l.jsx("span",{className:`${i["text-rotate-sr-only"]}`,children:o[e]}),l.jsx(Q,{mode:F,initial:H,children:l.jsx(C.span,{className:h(p==="lines"?i["text-rotate-lines"]:i["text-rotate"]),layout:!0,"aria-hidden":"true",children:G.map((t,a,r)=>{const n=r.slice(0,a).reduce((I,x)=>I+x.characters.length,0);return l.jsxs("span",{className:h(i["text-rotate-word"],L),children:[t.characters.map((I,x)=>l.jsx(C.span,{initial:w,animate:A,exit:E,transition:{...N,delay:J(n+x,r.reduce((K,O)=>K+O.characters.length,0))},className:h(i["text-rotate-element"],W),children:I},x)),t.needsSpace&&l.jsx("span",{className:`${i["text-rotate-space"]}`,children:" "})]},a)})},e)})]})});v.displayName="RotatingText";v.__docgenInfo={description:"",methods:[],displayName:"RotatingText"};const tt={title:"ReactBits/TextAnimations/RotatingText",component:v,parameters:{layout:"fullscreen"},tags:["autodocs"]},f={args:{texts:["Hello","World","React","Bits"],rotationInterval:2e3,loop:!0,auto:!0,splitBy:"characters",staggerDuration:0,staggerFrom:"first"}};var b,B,k;f.parameters={...f.parameters,docs:{...(b=f.parameters)==null?void 0:b.docs,source:{originalSource:`{
3
3
  args: {
4
4
  texts: ['Hello', 'World', 'React', 'Bits'],
@@ -1,4 +1,4 @@
1
- import{r as s,j as c}from"./iframe-2N7rjfXm.js";import{g as _}from"./index-C8pce-KX.js";import{S as q}from"./ScrollTrigger-D1XJUMov.js";import"./preload-helper-C1FmrZbK.js";const v="_char_46mmt_13",n={"scroll-float":"_scroll-float_46mmt_1","scroll-float-text":"_scroll-float-text_46mmt_5",char:v};_.registerPlugin(q);const h=({children:o,scrollContainerRef:e,containerClassName:S="",textClassName:y="",animationDuration:u=1,ease:m="back.inOut(2)",scrollStart:i="center bottom+=50%",scrollEnd:d="bottom bottom-=40%",stagger:f=.03})=>{const p=s.useRef(null),N=s.useMemo(()=>(typeof o=="string"?o:"").split("").map((a,l)=>c.jsx("span",{className:`${n.char}`,children:a===" "?" ":a},l)),[o]);return s.useEffect(()=>{const t=p.current;if(!t)return;const a=e&&e.current?e.current:window,l=t.querySelectorAll(".char");_.fromTo(l,{willChange:"opacity, transform",opacity:0,yPercent:120,scaleY:2.3,scaleX:.7,transformOrigin:"50% 0%"},{duration:u,ease:m,opacity:1,yPercent:0,scaleY:1,scaleX:1,stagger:f,scrollTrigger:{trigger:t,scroller:a,start:i,end:d,scrub:!0}})},[e,u,m,i,d,f]),c.jsx("h2",{ref:p,className:`${n["scroll-float"]} ${S}`,children:c.jsx("span",{className:`${n["scroll-float-text"]} ${y}`,children:N})})};h.__docgenInfo={description:"",methods:[],displayName:"ScrollFloat",props:{containerClassName:{defaultValue:{value:"''",computed:!1},required:!1},textClassName:{defaultValue:{value:"''",computed:!1},required:!1},animationDuration:{defaultValue:{value:"1",computed:!1},required:!1},ease:{defaultValue:{value:"'back.inOut(2)'",computed:!1},required:!1},scrollStart:{defaultValue:{value:"'center bottom+=50%'",computed:!1},required:!1},scrollEnd:{defaultValue:{value:"'bottom bottom-=40%'",computed:!1},required:!1},stagger:{defaultValue:{value:"0.03",computed:!1},required:!1}}};const C={title:"ReactBits/TextAnimations/ScrollFloat",component:h,parameters:{layout:"fullscreen"},tags:["autodocs"]},r={args:{children:"Hello World",containerClassName:"",textClassName:"",animationDuration:1,ease:"back.inOut(2)",scrollStart:"center bottom+=50%",scrollEnd:"bottom bottom-=40%",stagger:.03}};var g,x,b;r.parameters={...r.parameters,docs:{...(g=r.parameters)==null?void 0:g.docs,source:{originalSource:`{
1
+ import{r as s,j as c}from"./iframe-CvT6MryR.js";import{g as _}from"./index-C8pce-KX.js";import{S as q}from"./ScrollTrigger-D1XJUMov.js";import"./preload-helper-C1FmrZbK.js";const v="_char_46mmt_13",n={"scroll-float":"_scroll-float_46mmt_1","scroll-float-text":"_scroll-float-text_46mmt_5",char:v};_.registerPlugin(q);const h=({children:o,scrollContainerRef:e,containerClassName:S="",textClassName:y="",animationDuration:u=1,ease:m="back.inOut(2)",scrollStart:i="center bottom+=50%",scrollEnd:d="bottom bottom-=40%",stagger:f=.03})=>{const p=s.useRef(null),N=s.useMemo(()=>(typeof o=="string"?o:"").split("").map((a,l)=>c.jsx("span",{className:`${n.char}`,children:a===" "?" ":a},l)),[o]);return s.useEffect(()=>{const t=p.current;if(!t)return;const a=e&&e.current?e.current:window,l=t.querySelectorAll(".char");_.fromTo(l,{willChange:"opacity, transform",opacity:0,yPercent:120,scaleY:2.3,scaleX:.7,transformOrigin:"50% 0%"},{duration:u,ease:m,opacity:1,yPercent:0,scaleY:1,scaleX:1,stagger:f,scrollTrigger:{trigger:t,scroller:a,start:i,end:d,scrub:!0}})},[e,u,m,i,d,f]),c.jsx("h2",{ref:p,className:`${n["scroll-float"]} ${S}`,children:c.jsx("span",{className:`${n["scroll-float-text"]} ${y}`,children:N})})};h.__docgenInfo={description:"",methods:[],displayName:"ScrollFloat",props:{containerClassName:{defaultValue:{value:"''",computed:!1},required:!1},textClassName:{defaultValue:{value:"''",computed:!1},required:!1},animationDuration:{defaultValue:{value:"1",computed:!1},required:!1},ease:{defaultValue:{value:"'back.inOut(2)'",computed:!1},required:!1},scrollStart:{defaultValue:{value:"'center bottom+=50%'",computed:!1},required:!1},scrollEnd:{defaultValue:{value:"'bottom bottom-=40%'",computed:!1},required:!1},stagger:{defaultValue:{value:"0.03",computed:!1},required:!1}}};const C={title:"ReactBits/TextAnimations/ScrollFloat",component:h,parameters:{layout:"fullscreen"},tags:["autodocs"]},r={args:{children:"Hello World",containerClassName:"",textClassName:"",animationDuration:1,ease:"back.inOut(2)",scrollStart:"center bottom+=50%",scrollEnd:"bottom bottom-=40%",stagger:.03}};var g,x,b;r.parameters={...r.parameters,docs:{...(g=r.parameters)==null?void 0:g.docs,source:{originalSource:`{
2
2
  args: {
3
3
  children: 'Hello World',
4
4
  containerClassName: '',
@@ -1,4 +1,4 @@
1
- import{r as n,j as c}from"./iframe-2N7rjfXm.js";import{g as l}from"./index-C8pce-KX.js";import{S as _}from"./ScrollTrigger-D1XJUMov.js";import"./preload-helper-C1FmrZbK.js";const T="_word_1yrz7_11",m={"scroll-reveal":"_scroll-reveal_1yrz7_1","scroll-reveal-text":"_scroll-reveal-text_1yrz7_5",word:T};l.registerPlugin(_);const h=({children:s,scrollContainerRef:r,enableBlur:i=!0,baseOpacity:d=.1,baseRotation:f=3,blurStrength:p=4,containerClassName:S="",textClassName:N="",rotationEnd:g="bottom bottom",wordAnimationEnd:u="bottom bottom"})=>{const b=n.useRef(null),q=n.useMemo(()=>(typeof s=="string"?s:"").split(/(\s+)/).map((t,o)=>t.match(/^\s+$/)?t:c.jsx("span",{className:`${m.word}`,children:t},o)),[s]);return n.useEffect(()=>{const e=b.current;if(!e)return;const t=r&&r.current?r.current:window;l.fromTo(e,{transformOrigin:"0% 50%",rotate:f},{ease:"none",rotate:0,scrollTrigger:{trigger:e,scroller:t,start:"top bottom",end:g,scrub:!0}});const o=e.querySelectorAll(".word");return l.fromTo(o,{opacity:d,willChange:"opacity"},{ease:"none",opacity:1,stagger:.05,scrollTrigger:{trigger:e,scroller:t,start:"top bottom-=20%",end:u,scrub:!0}}),i&&l.fromTo(o,{filter:`blur(${p}px)`},{ease:"none",filter:"blur(0px)",stagger:.05,scrollTrigger:{trigger:e,scroller:t,start:"top bottom-=20%",end:u,scrub:!0}}),()=>{_.getAll().forEach(E=>E.kill())}},[r,i,f,d,g,u,p]),c.jsx("h2",{ref:b,className:`${m["scroll-reveal"]} ${S}`,children:c.jsx("p",{className:`${m["scroll-reveal-text"]} ${N}`,children:q})})};h.__docgenInfo={description:"",methods:[],displayName:"ScrollReveal",props:{enableBlur:{defaultValue:{value:"true",computed:!1},required:!1},baseOpacity:{defaultValue:{value:"0.1",computed:!1},required:!1},baseRotation:{defaultValue:{value:"3",computed:!1},required:!1},blurStrength:{defaultValue:{value:"4",computed:!1},required:!1},containerClassName:{defaultValue:{value:"''",computed:!1},required:!1},textClassName:{defaultValue:{value:"''",computed:!1},required:!1},rotationEnd:{defaultValue:{value:"'bottom bottom'",computed:!1},required:!1},wordAnimationEnd:{defaultValue:{value:"'bottom bottom'",computed:!1},required:!1}}};const j={title:"ReactBits/TextAnimations/ScrollReveal",component:h,parameters:{layout:"fullscreen"},tags:["autodocs"]},a={args:{children:"Hello World",enableBlur:!0,baseOpacity:.1,baseRotation:3,blurStrength:4,containerClassName:"",textClassName:"",rotationEnd:"bottom bottom",wordAnimationEnd:"bottom bottom"}};var x,v,y;a.parameters={...a.parameters,docs:{...(x=a.parameters)==null?void 0:x.docs,source:{originalSource:`{
1
+ import{r as n,j as c}from"./iframe-CvT6MryR.js";import{g as l}from"./index-C8pce-KX.js";import{S as _}from"./ScrollTrigger-D1XJUMov.js";import"./preload-helper-C1FmrZbK.js";const T="_word_1yrz7_11",m={"scroll-reveal":"_scroll-reveal_1yrz7_1","scroll-reveal-text":"_scroll-reveal-text_1yrz7_5",word:T};l.registerPlugin(_);const h=({children:s,scrollContainerRef:r,enableBlur:i=!0,baseOpacity:d=.1,baseRotation:f=3,blurStrength:p=4,containerClassName:S="",textClassName:N="",rotationEnd:g="bottom bottom",wordAnimationEnd:u="bottom bottom"})=>{const b=n.useRef(null),q=n.useMemo(()=>(typeof s=="string"?s:"").split(/(\s+)/).map((t,o)=>t.match(/^\s+$/)?t:c.jsx("span",{className:`${m.word}`,children:t},o)),[s]);return n.useEffect(()=>{const e=b.current;if(!e)return;const t=r&&r.current?r.current:window;l.fromTo(e,{transformOrigin:"0% 50%",rotate:f},{ease:"none",rotate:0,scrollTrigger:{trigger:e,scroller:t,start:"top bottom",end:g,scrub:!0}});const o=e.querySelectorAll(".word");return l.fromTo(o,{opacity:d,willChange:"opacity"},{ease:"none",opacity:1,stagger:.05,scrollTrigger:{trigger:e,scroller:t,start:"top bottom-=20%",end:u,scrub:!0}}),i&&l.fromTo(o,{filter:`blur(${p}px)`},{ease:"none",filter:"blur(0px)",stagger:.05,scrollTrigger:{trigger:e,scroller:t,start:"top bottom-=20%",end:u,scrub:!0}}),()=>{_.getAll().forEach(E=>E.kill())}},[r,i,f,d,g,u,p]),c.jsx("h2",{ref:b,className:`${m["scroll-reveal"]} ${S}`,children:c.jsx("p",{className:`${m["scroll-reveal-text"]} ${N}`,children:q})})};h.__docgenInfo={description:"",methods:[],displayName:"ScrollReveal",props:{enableBlur:{defaultValue:{value:"true",computed:!1},required:!1},baseOpacity:{defaultValue:{value:"0.1",computed:!1},required:!1},baseRotation:{defaultValue:{value:"3",computed:!1},required:!1},blurStrength:{defaultValue:{value:"4",computed:!1},required:!1},containerClassName:{defaultValue:{value:"''",computed:!1},required:!1},textClassName:{defaultValue:{value:"''",computed:!1},required:!1},rotationEnd:{defaultValue:{value:"'bottom bottom'",computed:!1},required:!1},wordAnimationEnd:{defaultValue:{value:"'bottom bottom'",computed:!1},required:!1}}};const j={title:"ReactBits/TextAnimations/ScrollReveal",component:h,parameters:{layout:"fullscreen"},tags:["autodocs"]},a={args:{children:"Hello World",enableBlur:!0,baseOpacity:.1,baseRotation:3,blurStrength:4,containerClassName:"",textClassName:"",rotationEnd:"bottom bottom",wordAnimationEnd:"bottom bottom"}};var x,v,y;a.parameters={...a.parameters,docs:{...(x=a.parameters)==null?void 0:x.docs,source:{originalSource:`{
2
2
  args: {
3
3
  children: 'Hello World',
4
4
  enableBlur: true,
@@ -1,4 +1,4 @@
1
- import{r as p,j as v}from"./iframe-2N7rjfXm.js";import{u as re}from"./use-motion-value-w2f8nz4L.js";import{h as ne,j as le,i as Te,r as Ce,m as Oe}from"./proxy-qiKixXs8.js";import{f as h,I as k,N as Ne,a3 as Pe,a1 as He,Z as Be,j as Ae,c as oe,R as ke,U as Re,o as W,u as be,a as q}from"./MotionConfigContext-4uS6JRtS.js";import{u as ze}from"./use-spring-CDOZMwuR.js";import{u as D}from"./use-transform-DZyAm4Sp.js";import{u as je}from"./use-animation-frame-DNrI5vnP.js";import"./preload-helper-C1FmrZbK.js";function ce(e,t){let s;const r=()=>{const{currentTime:n}=t,o=(n===null?0:n.value)/100;s!==o&&e(o),s=o};return h.preUpdate(r,!0),()=>k(r)}function Ie(e,t,s){p.useInsertionEffect(()=>e.on(t,s),[e,t,s])}function O(e){return typeof window>"u"?!1:e?ne():le()}const _e=50,F=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),qe=()=>({time:0,x:F(),y:F()}),De={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function $(e,t,s,r){const n=s[t],{length:l,position:o}=De[t],c=n.current,a=s.time;n.current=Math.abs(e[`scroll${o}`]),n.scrollLength=e[`scroll${l}`]-e[`client${l}`],n.offset.length=0,n.offset[0]=0,n.offset[1]=n.scrollLength,n.progress=Ne(0,n.scrollLength,n.current);const i=r-a;n.velocity=i>_e?0:Pe(n.current-c,i)}function Fe(e,t,s){$(e,"x",t,s),$(e,"y",t,s),t.time=s}function $e(e,t){const s={x:0,y:0};let r=e;for(;r&&r!==t;)if(Te(r))s.x+=r.offsetLeft,s.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const n=r.getBoundingClientRect();r=r.parentElement;const l=r.getBoundingClientRect();s.x+=n.left-l.left,s.y+=n.top-l.top}else if(r instanceof SVGGraphicsElement){const{x:n,y:l}=r.getBBox();s.x+=n,s.y+=l;let o=null,c=r.parentNode;for(;!o;)c.tagName==="svg"&&(o=c),c=r.parentNode;r=o}else break;return s}const R={start:0,center:.5,end:1};function X(e,t,s=0){let r=0;if(e in R&&(e=R[e]),typeof e=="string"){const n=parseFloat(e);e.endsWith("px")?r=n:e.endsWith("%")?e=n/100:e.endsWith("vw")?r=n/100*document.documentElement.clientWidth:e.endsWith("vh")?r=n/100*document.documentElement.clientHeight:e=n}return typeof e=="number"&&(r=t*e),s+r}const Xe=[0,0];function Ye(e,t,s,r){let n=Array.isArray(e)?e:Xe,l=0,o=0;return typeof e=="number"?n=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?n=e.split(" "):n=[e,R[e]?e:"0"]),l=X(n[0],s,r),o=X(n[1],t),l-o}const E={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Me={x:0,y:0};function Ue(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function Ge(e,t,s){const{offset:r=E.All}=s,{target:n=e,axis:l="y"}=s,o=l==="y"?"height":"width",c=n!==e?$e(n,e):Me,a=n===e?{width:e.scrollWidth,height:e.scrollHeight}:Ue(n),i={width:e.clientWidth,height:e.clientHeight};t[l].offset.length=0;let u=!t[l].interpolate;const m=r.length;for(let f=0;f<m;f++){const g=Ye(r[f],i[o],a[o],c[l]);!u&&g!==t[l].interpolatorOffsets[f]&&(u=!0),t[l].offset[f]=g}u&&(t[l].interpolate=He(t[l].offset,Be(r),{clamp:!1}),t[l].interpolatorOffsets=[...t[l].offset]),t[l].progress=Ae(0,1,t[l].interpolate(t[l].current))}function Ke(e,t=e,s){if(s.x.targetOffset=0,s.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)s.x.targetOffset+=r.offsetLeft,s.y.targetOffset+=r.offsetTop,r=r.offsetParent}s.x.targetLength=t===e?t.scrollWidth:t.clientWidth,s.y.targetLength=t===e?t.scrollHeight:t.clientHeight,s.x.containerLength=e.clientWidth,s.y.containerLength=e.clientHeight}function Je(e,t,s,r={}){return{measure:n=>{Ke(e,r.target,s),Fe(e,s,n),(r.offset||r.target)&&Ge(e,s,r)},notify:()=>t(s)}}const x=new WeakMap,Y=new WeakMap,A=new WeakMap,M=new WeakMap,L=new WeakMap,U=e=>e===document.scrollingElement?window:e;function ie(e,{container:t=document.scrollingElement,trackContentSize:s=!1,...r}={}){if(!t)return oe;let n=A.get(t);n||(n=new Set,A.set(t,n));const l=qe(),o=Je(t,e,l,r);if(n.add(o),!x.has(t)){const a=()=>{for(const f of n)f.measure(ke.timestamp);h.preUpdate(i)},i=()=>{for(const f of n)f.notify()},u=()=>h.read(a);x.set(t,u);const m=U(t);window.addEventListener("resize",u),t!==document.documentElement&&Y.set(t,Ce(t,u)),m.addEventListener("scroll",u),u()}if(s&&!L.has(t)){const a=x.get(t),i={width:t.scrollWidth,height:t.scrollHeight};M.set(t,i);const u=()=>{const f=t.scrollWidth,g=t.scrollHeight;(i.width!==f||i.height!==g)&&(a(),i.width=f,i.height=g)},m=h.read(u,!0);L.set(t,m)}const c=x.get(t);return h.read(c,!1,!0),()=>{var m;k(c);const a=A.get(t);if(!a||(a.delete(o),a.size))return;const i=x.get(t);x.delete(t),i&&(U(t).removeEventListener("scroll",i),(m=Y.get(t))==null||m(),window.removeEventListener("resize",i));const u=L.get(t);u&&(k(u),L.delete(t)),M.delete(t)}}const Ze=[[E.Enter,"entry"],[E.Exit,"exit"],[E.Any,"cover"],[E.All,"contain"]],G={start:0,end:1};function Qe(e){const t=e.trim().split(/\s+/);if(t.length!==2)return;const s=G[t[0]],r=G[t[1]];if(!(s===void 0||r===void 0))return[s,r]}function et(e){if(e.length!==2)return;const t=[];for(const s of e)if(Array.isArray(s))t.push(s);else if(typeof s=="string"){const r=Qe(s);if(!r)return;t.push(r)}else return;return t}function tt(e,t){const s=et(e);if(!s)return!1;for(let r=0;r<2;r++){const n=s[r],l=t[r];if(n[0]!==l[0]||n[1]!==l[1])return!1}return!0}function b(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,s]of Ze)if(tt(e,t))return{rangeStart:`${s} 0%`,rangeEnd:`${s} 100%`}}const K=new Map;function J(e){const t={value:0},s=ie(r=>{t.value=r[e.axis].progress*100},e);return{currentTime:t,cancel:s}}function ae({source:e,container:t,...s}){const{axis:r}=s;e&&(t=e);let n=K.get(t);n||(n=new Map,K.set(t,n));const l=s.target??"self";let o=n.get(l);o||(o={},n.set(l,o));const c=r+(s.offset??[]).join(",");return o[c]||(s.target&&O(s.target)?b(s.offset)?o[c]=new ViewTimeline({subject:s.target,axis:r}):o[c]=J({container:t,...s}):O()?o[c]=new ScrollTimeline({source:t,axis:r}):o[c]=J({container:t,...s})),o[c]}function st(e,t){const s=ae(t),r=t.target?b(t.offset):void 0,n=t.target?O(t.target)&&!!r:O();return e.attachTimeline({timeline:n?s:void 0,...r&&n&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:l=>(l.pause(),ce(o=>{l.time=l.iterationDuration*o},s))})}function rt(e){return e.length===2}function nt(e,t){return rt(e)?ie(s=>{e(s[t.axis].progress,s)},t):ce(e,ae(t))}function ue(e,{axis:t="y",container:s=document.scrollingElement,...r}={}){if(!s)return oe;const n={axis:t,container:s,...r};return typeof e=="function"?nt(e,n):st(e,n)}const lt=()=>({scrollX:W(0),scrollY:W(0),scrollXProgress:W(0),scrollYProgress:W(0)}),T=e=>e?!e.current:!1;function Z(e,t,s,r){return{factory:n=>ue(n,{...t,axis:e,container:(s==null?void 0:s.current)||void 0,target:(r==null?void 0:r.current)||void 0}),times:[0,1],keyframes:[0,1],ease:n=>n,duration:1}}function ot(e,t){return typeof window>"u"?!1:e?ne()&&!!b(t):le()}function ct({container:e,target:t,...s}={}){const r=Re(lt);ot(t,s.offset)&&(r.scrollXProgress.accelerate=Z("x",s,e,t),r.scrollYProgress.accelerate=Z("y",s,e,t));const n=p.useRef(null),l=p.useRef(!1),o=p.useCallback(()=>(n.current=ue((c,{x:a,y:i})=>{r.scrollX.set(a.current),r.scrollXProgress.set(a.progress),r.scrollY.set(i.current),r.scrollYProgress.set(i.progress)},{...s,container:(e==null?void 0:e.current)||void 0,target:(t==null?void 0:t.current)||void 0}),()=>{var c;(c=n.current)==null||c.call(n)}),[e,t,JSON.stringify(s.offset)]);return be(()=>{if(l.current=!1,T(e)||T(t)){l.current=!0;return}else return o()},[o]),p.useEffect(()=>{if(l.current)return q(!T(e)),q(!T(t)),o()},[o]),r}function it(e){const t=re(e.getVelocity()),s=()=>{const r=e.getVelocity();t.set(r),r&&h.update(s)};return Ie(e,"change",()=>{h.update(s,!1,!0)}),t}const at="_parallax_1s8d6_1",ut="_scroller_1s8d6_6",Q={parallax:at,scroller:ut};function ft(e){const[t,s]=p.useState(0);return p.useLayoutEffect(()=>{function r(){e.current&&s(e.current.offsetWidth)}return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[e]),t}const fe=({scrollContainerRef:e,texts:t=[],velocity:s=100,className:r="",damping:n=50,stiffness:l=400,numCopies:o=6,velocityMapping:c={input:[0,1e3],output:[0,5]},parallaxClassName:a=Q.parallax,scrollerClassName:i=Q.scroller,parallaxStyle:u,scrollerStyle:m})=>{function f({children:g,baseVelocity:S=s,scrollContainerRef:z,className:de="",damping:me,stiffness:ge,numCopies:pe,velocityMapping:y,parallaxClassName:he,scrollerClassName:ye,parallaxStyle:xe,scrollerStyle:we}){const N=re(0),ve=z?{container:z}:{},{scrollY:Ee}=ct(ve),Se=it(Ee),Ve=ze(Se,{damping:me??50,stiffness:ge??400}),P=D(Ve,(y==null?void 0:y.input)||[0,1e3],(y==null?void 0:y.output)||[0,5],{clamp:!1}),j=p.useRef(null),I=ft(j);function We(d,H,w){const B=H-d;return((w-d)%B+B)%B+d}const Le=D(N,d=>I===0?"0px":`${We(-I,0,d)}px`),V=p.useRef(1);je((d,H)=>{let w=V.current*S*(H/1e3);P.get()<0?V.current=-1:P.get()>0&&(V.current=1),w+=V.current*w*P.get(),N.set(N.get()+w)});const _=[];for(let d=0;d<pe;d++)_.push(v.jsxs("span",{className:de,ref:d===0?j:null,children:[g," "]},d));return v.jsx("div",{className:he,style:xe,children:v.jsx(Oe.div,{className:ye,style:{x:Le,...we},children:_})})}return v.jsx("section",{children:t.map((g,S)=>v.jsx(f,{className:r,baseVelocity:S%2!==0?-s:s,scrollContainerRef:e,damping:n,stiffness:l,numCopies:o,velocityMapping:c,parallaxClassName:a,scrollerClassName:i,parallaxStyle:u,scrollerStyle:m,children:g},S))})};fe.__docgenInfo={description:"",methods:[],displayName:"ScrollVelocity",props:{texts:{defaultValue:{value:"[]",computed:!1},required:!1},velocity:{defaultValue:{value:"100",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},damping:{defaultValue:{value:"50",computed:!1},required:!1},stiffness:{defaultValue:{value:"400",computed:!1},required:!1},numCopies:{defaultValue:{value:"6",computed:!1},required:!1},velocityMapping:{defaultValue:{value:"{ input: [0, 1000], output: [0, 5] }",computed:!1},required:!1},parallaxClassName:{defaultValue:{value:"styles['parallax']",computed:!0},required:!1},scrollerClassName:{defaultValue:{value:"styles['scroller']",computed:!0},required:!1}}};const Et={title:"ReactBits/TextAnimations/ScrollVelocity",component:fe,parameters:{layout:"fullscreen"},tags:["autodocs"]},C={args:{texts:["React Bits","Scroll Velocity"],velocity:100,damping:50,stiffness:400,numCopies:6}};var ee,te,se;C.parameters={...C.parameters,docs:{...(ee=C.parameters)==null?void 0:ee.docs,source:{originalSource:`{
1
+ import{r as p,j as v}from"./iframe-CvT6MryR.js";import{u as re}from"./use-motion-value-DfJqnIZb.js";import{h as ne,j as le,i as Te,r as Ce,m as Oe}from"./proxy-0exJiild.js";import{f as h,I as k,N as Ne,a3 as Pe,a1 as He,Z as Be,j as Ae,c as oe,R as ke,U as Re,o as W,u as be,a as q}from"./MotionConfigContext-BdSKNtzx.js";import{u as ze}from"./use-spring-SHZiaDU4.js";import{u as D}from"./use-transform-CATrWDJd.js";import{u as je}from"./use-animation-frame-BOMew7B2.js";import"./preload-helper-C1FmrZbK.js";function ce(e,t){let s;const r=()=>{const{currentTime:n}=t,o=(n===null?0:n.value)/100;s!==o&&e(o),s=o};return h.preUpdate(r,!0),()=>k(r)}function Ie(e,t,s){p.useInsertionEffect(()=>e.on(t,s),[e,t,s])}function O(e){return typeof window>"u"?!1:e?ne():le()}const _e=50,F=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),qe=()=>({time:0,x:F(),y:F()}),De={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function $(e,t,s,r){const n=s[t],{length:l,position:o}=De[t],c=n.current,a=s.time;n.current=Math.abs(e[`scroll${o}`]),n.scrollLength=e[`scroll${l}`]-e[`client${l}`],n.offset.length=0,n.offset[0]=0,n.offset[1]=n.scrollLength,n.progress=Ne(0,n.scrollLength,n.current);const i=r-a;n.velocity=i>_e?0:Pe(n.current-c,i)}function Fe(e,t,s){$(e,"x",t,s),$(e,"y",t,s),t.time=s}function $e(e,t){const s={x:0,y:0};let r=e;for(;r&&r!==t;)if(Te(r))s.x+=r.offsetLeft,s.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const n=r.getBoundingClientRect();r=r.parentElement;const l=r.getBoundingClientRect();s.x+=n.left-l.left,s.y+=n.top-l.top}else if(r instanceof SVGGraphicsElement){const{x:n,y:l}=r.getBBox();s.x+=n,s.y+=l;let o=null,c=r.parentNode;for(;!o;)c.tagName==="svg"&&(o=c),c=r.parentNode;r=o}else break;return s}const R={start:0,center:.5,end:1};function X(e,t,s=0){let r=0;if(e in R&&(e=R[e]),typeof e=="string"){const n=parseFloat(e);e.endsWith("px")?r=n:e.endsWith("%")?e=n/100:e.endsWith("vw")?r=n/100*document.documentElement.clientWidth:e.endsWith("vh")?r=n/100*document.documentElement.clientHeight:e=n}return typeof e=="number"&&(r=t*e),s+r}const Xe=[0,0];function Ye(e,t,s,r){let n=Array.isArray(e)?e:Xe,l=0,o=0;return typeof e=="number"?n=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?n=e.split(" "):n=[e,R[e]?e:"0"]),l=X(n[0],s,r),o=X(n[1],t),l-o}const E={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Me={x:0,y:0};function Ue(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function Ge(e,t,s){const{offset:r=E.All}=s,{target:n=e,axis:l="y"}=s,o=l==="y"?"height":"width",c=n!==e?$e(n,e):Me,a=n===e?{width:e.scrollWidth,height:e.scrollHeight}:Ue(n),i={width:e.clientWidth,height:e.clientHeight};t[l].offset.length=0;let u=!t[l].interpolate;const m=r.length;for(let f=0;f<m;f++){const g=Ye(r[f],i[o],a[o],c[l]);!u&&g!==t[l].interpolatorOffsets[f]&&(u=!0),t[l].offset[f]=g}u&&(t[l].interpolate=He(t[l].offset,Be(r),{clamp:!1}),t[l].interpolatorOffsets=[...t[l].offset]),t[l].progress=Ae(0,1,t[l].interpolate(t[l].current))}function Ke(e,t=e,s){if(s.x.targetOffset=0,s.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)s.x.targetOffset+=r.offsetLeft,s.y.targetOffset+=r.offsetTop,r=r.offsetParent}s.x.targetLength=t===e?t.scrollWidth:t.clientWidth,s.y.targetLength=t===e?t.scrollHeight:t.clientHeight,s.x.containerLength=e.clientWidth,s.y.containerLength=e.clientHeight}function Je(e,t,s,r={}){return{measure:n=>{Ke(e,r.target,s),Fe(e,s,n),(r.offset||r.target)&&Ge(e,s,r)},notify:()=>t(s)}}const x=new WeakMap,Y=new WeakMap,A=new WeakMap,M=new WeakMap,L=new WeakMap,U=e=>e===document.scrollingElement?window:e;function ie(e,{container:t=document.scrollingElement,trackContentSize:s=!1,...r}={}){if(!t)return oe;let n=A.get(t);n||(n=new Set,A.set(t,n));const l=qe(),o=Je(t,e,l,r);if(n.add(o),!x.has(t)){const a=()=>{for(const f of n)f.measure(ke.timestamp);h.preUpdate(i)},i=()=>{for(const f of n)f.notify()},u=()=>h.read(a);x.set(t,u);const m=U(t);window.addEventListener("resize",u),t!==document.documentElement&&Y.set(t,Ce(t,u)),m.addEventListener("scroll",u),u()}if(s&&!L.has(t)){const a=x.get(t),i={width:t.scrollWidth,height:t.scrollHeight};M.set(t,i);const u=()=>{const f=t.scrollWidth,g=t.scrollHeight;(i.width!==f||i.height!==g)&&(a(),i.width=f,i.height=g)},m=h.read(u,!0);L.set(t,m)}const c=x.get(t);return h.read(c,!1,!0),()=>{var m;k(c);const a=A.get(t);if(!a||(a.delete(o),a.size))return;const i=x.get(t);x.delete(t),i&&(U(t).removeEventListener("scroll",i),(m=Y.get(t))==null||m(),window.removeEventListener("resize",i));const u=L.get(t);u&&(k(u),L.delete(t)),M.delete(t)}}const Ze=[[E.Enter,"entry"],[E.Exit,"exit"],[E.Any,"cover"],[E.All,"contain"]],G={start:0,end:1};function Qe(e){const t=e.trim().split(/\s+/);if(t.length!==2)return;const s=G[t[0]],r=G[t[1]];if(!(s===void 0||r===void 0))return[s,r]}function et(e){if(e.length!==2)return;const t=[];for(const s of e)if(Array.isArray(s))t.push(s);else if(typeof s=="string"){const r=Qe(s);if(!r)return;t.push(r)}else return;return t}function tt(e,t){const s=et(e);if(!s)return!1;for(let r=0;r<2;r++){const n=s[r],l=t[r];if(n[0]!==l[0]||n[1]!==l[1])return!1}return!0}function b(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,s]of Ze)if(tt(e,t))return{rangeStart:`${s} 0%`,rangeEnd:`${s} 100%`}}const K=new Map;function J(e){const t={value:0},s=ie(r=>{t.value=r[e.axis].progress*100},e);return{currentTime:t,cancel:s}}function ae({source:e,container:t,...s}){const{axis:r}=s;e&&(t=e);let n=K.get(t);n||(n=new Map,K.set(t,n));const l=s.target??"self";let o=n.get(l);o||(o={},n.set(l,o));const c=r+(s.offset??[]).join(",");return o[c]||(s.target&&O(s.target)?b(s.offset)?o[c]=new ViewTimeline({subject:s.target,axis:r}):o[c]=J({container:t,...s}):O()?o[c]=new ScrollTimeline({source:t,axis:r}):o[c]=J({container:t,...s})),o[c]}function st(e,t){const s=ae(t),r=t.target?b(t.offset):void 0,n=t.target?O(t.target)&&!!r:O();return e.attachTimeline({timeline:n?s:void 0,...r&&n&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:l=>(l.pause(),ce(o=>{l.time=l.iterationDuration*o},s))})}function rt(e){return e.length===2}function nt(e,t){return rt(e)?ie(s=>{e(s[t.axis].progress,s)},t):ce(e,ae(t))}function ue(e,{axis:t="y",container:s=document.scrollingElement,...r}={}){if(!s)return oe;const n={axis:t,container:s,...r};return typeof e=="function"?nt(e,n):st(e,n)}const lt=()=>({scrollX:W(0),scrollY:W(0),scrollXProgress:W(0),scrollYProgress:W(0)}),T=e=>e?!e.current:!1;function Z(e,t,s,r){return{factory:n=>ue(n,{...t,axis:e,container:(s==null?void 0:s.current)||void 0,target:(r==null?void 0:r.current)||void 0}),times:[0,1],keyframes:[0,1],ease:n=>n,duration:1}}function ot(e,t){return typeof window>"u"?!1:e?ne()&&!!b(t):le()}function ct({container:e,target:t,...s}={}){const r=Re(lt);ot(t,s.offset)&&(r.scrollXProgress.accelerate=Z("x",s,e,t),r.scrollYProgress.accelerate=Z("y",s,e,t));const n=p.useRef(null),l=p.useRef(!1),o=p.useCallback(()=>(n.current=ue((c,{x:a,y:i})=>{r.scrollX.set(a.current),r.scrollXProgress.set(a.progress),r.scrollY.set(i.current),r.scrollYProgress.set(i.progress)},{...s,container:(e==null?void 0:e.current)||void 0,target:(t==null?void 0:t.current)||void 0}),()=>{var c;(c=n.current)==null||c.call(n)}),[e,t,JSON.stringify(s.offset)]);return be(()=>{if(l.current=!1,T(e)||T(t)){l.current=!0;return}else return o()},[o]),p.useEffect(()=>{if(l.current)return q(!T(e)),q(!T(t)),o()},[o]),r}function it(e){const t=re(e.getVelocity()),s=()=>{const r=e.getVelocity();t.set(r),r&&h.update(s)};return Ie(e,"change",()=>{h.update(s,!1,!0)}),t}const at="_parallax_1s8d6_1",ut="_scroller_1s8d6_6",Q={parallax:at,scroller:ut};function ft(e){const[t,s]=p.useState(0);return p.useLayoutEffect(()=>{function r(){e.current&&s(e.current.offsetWidth)}return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[e]),t}const fe=({scrollContainerRef:e,texts:t=[],velocity:s=100,className:r="",damping:n=50,stiffness:l=400,numCopies:o=6,velocityMapping:c={input:[0,1e3],output:[0,5]},parallaxClassName:a=Q.parallax,scrollerClassName:i=Q.scroller,parallaxStyle:u,scrollerStyle:m})=>{function f({children:g,baseVelocity:S=s,scrollContainerRef:z,className:de="",damping:me,stiffness:ge,numCopies:pe,velocityMapping:y,parallaxClassName:he,scrollerClassName:ye,parallaxStyle:xe,scrollerStyle:we}){const N=re(0),ve=z?{container:z}:{},{scrollY:Ee}=ct(ve),Se=it(Ee),Ve=ze(Se,{damping:me??50,stiffness:ge??400}),P=D(Ve,(y==null?void 0:y.input)||[0,1e3],(y==null?void 0:y.output)||[0,5],{clamp:!1}),j=p.useRef(null),I=ft(j);function We(d,H,w){const B=H-d;return((w-d)%B+B)%B+d}const Le=D(N,d=>I===0?"0px":`${We(-I,0,d)}px`),V=p.useRef(1);je((d,H)=>{let w=V.current*S*(H/1e3);P.get()<0?V.current=-1:P.get()>0&&(V.current=1),w+=V.current*w*P.get(),N.set(N.get()+w)});const _=[];for(let d=0;d<pe;d++)_.push(v.jsxs("span",{className:de,ref:d===0?j:null,children:[g," "]},d));return v.jsx("div",{className:he,style:xe,children:v.jsx(Oe.div,{className:ye,style:{x:Le,...we},children:_})})}return v.jsx("section",{children:t.map((g,S)=>v.jsx(f,{className:r,baseVelocity:S%2!==0?-s:s,scrollContainerRef:e,damping:n,stiffness:l,numCopies:o,velocityMapping:c,parallaxClassName:a,scrollerClassName:i,parallaxStyle:u,scrollerStyle:m,children:g},S))})};fe.__docgenInfo={description:"",methods:[],displayName:"ScrollVelocity",props:{texts:{defaultValue:{value:"[]",computed:!1},required:!1},velocity:{defaultValue:{value:"100",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},damping:{defaultValue:{value:"50",computed:!1},required:!1},stiffness:{defaultValue:{value:"400",computed:!1},required:!1},numCopies:{defaultValue:{value:"6",computed:!1},required:!1},velocityMapping:{defaultValue:{value:"{ input: [0, 1000], output: [0, 5] }",computed:!1},required:!1},parallaxClassName:{defaultValue:{value:"styles['parallax']",computed:!0},required:!1},scrollerClassName:{defaultValue:{value:"styles['scroller']",computed:!0},required:!1}}};const Et={title:"ReactBits/TextAnimations/ScrollVelocity",component:fe,parameters:{layout:"fullscreen"},tags:["autodocs"]},C={args:{texts:["React Bits","Scroll Velocity"],velocity:100,damping:50,stiffness:400,numCopies:6}};var ee,te,se;C.parameters={...C.parameters,docs:{...(ee=C.parameters)==null?void 0:ee.docs,source:{originalSource:`{
2
2
  args: {
3
3
  texts: ['React Bits', 'Scroll Velocity'],
4
4
  velocity: 100,
@@ -1,4 +1,4 @@
1
- import{r as c,j as r}from"./iframe-2N7rjfXm.js";import{S as Ne}from"./search-DBjUUDRM.js";import{F as Ee}from"./folder-OUDa6Ti7.js";import{U as Pe}from"./users-0pBe6bxm.js";import{c as B}from"./createLucideIcon-wa-8tr0c.js";import{m as G}from"./proxy-qiKixXs8.js";import{X as ze}from"./x-k5o8Jl5E.js";import{A as Xe}from"./index-IKMS7NhW.js";import"./preload-helper-C1FmrZbK.js";import"./MotionConfigContext-4uS6JRtS.js";/**
1
+ import{r as c,j as r}from"./iframe-CvT6MryR.js";import{S as Ne}from"./search-Cfa-rwoK.js";import{F as Ee}from"./folder-DNcKa6s5.js";import{U as Pe}from"./users-CoCnAJkL.js";import{c as B}from"./createLucideIcon-Eaeny9Zi.js";import{m as G}from"./proxy-0exJiild.js";import{X as ze}from"./x-D_m9a61B.js";import{A as Xe}from"./index-2ZuXCVEx.js";import"./preload-helper-C1FmrZbK.js";import"./MotionConfigContext-BdSKNtzx.js";/**
2
2
  * @license lucide-react v0.539.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r,j as n}from"./iframe-2N7rjfXm.js";import{m as p}from"./proxy-qiKixXs8.js";import{C as V}from"./chevron-down-B26xHSrx.js";import{A as R}from"./index-IKMS7NhW.js";import{S as A}from"./search-DBjUUDRM.js";import{C as T}from"./check-Bh0K2zJt.js";const q="_searchableDropdown_13fbr_1",M="_dropdownTrigger_13fbr_17",$="_open_13fbr_45",L="_dropdownValue_13fbr_52",F="_placeholder_13fbr_61",K="_dropdownArrow_13fbr_67",H="_dropdownMenu_13fbr_83",P="_dropdownSearch_13fbr_101",z="_searchInput_13fbr_111",B="_searchIcon_13fbr_136",U="_dropdownOptions_13fbr_152",W="_dropdownOption_13fbr_152",G="_selected_13fbr_221",J="_highlighted_13fbr_243",Q="_checkIcon_13fbr_256",X="_dropdownNoResults_13fbr_276",Y="_loading_13fbr_390",o={searchableDropdown:q,dropdownTrigger:M,open:$,dropdownValue:L,placeholder:F,dropdownArrow:K,dropdownMenu:H,dropdownSearch:P,searchInput:z,searchIcon:B,dropdownOptions:U,dropdownOption:W,selected:G,highlighted:J,checkIcon:Q,dropdownNoResults:X,loading:Y};function Z({label:C,value:m,onChange:k,options:w,placeholder:N="Select...",allowEmpty:j=!0,disabled:u=!1,loading:g=!1,error:D=!1}){const[t,i]=r.useState(!1),[_,d]=r.useState(""),[c,l]=r.useState(-1),h=r.useRef(null),f=r.useRef(null),b=w.find(e=>e.value===m),y=b?b.label:"",v=w.filter(e=>e.label.toLowerCase().includes(_.toLowerCase())),s=j?[{label:"(none)",value:""},...v]:v;r.useEffect(()=>{function e(a){h.current&&!h.current.contains(a.target)&&(i(!1),d(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),r.useEffect(()=>{t&&f.current&&f.current.focus()},[t]);const x=e=>{k(e),i(!1),d(""),l(-1)},I=e=>{if(t)switch(e.key){case"ArrowDown":e.preventDefault(),l(a=>a<s.length-1?a+1:0);break;case"ArrowUp":e.preventDefault(),l(a=>a>0?a-1:s.length-1);break;case"Enter":e.preventDefault(),c>=0&&c<s.length&&x(s[c].value);break;case"Escape":e.preventDefault(),i(!1),d(""),l(-1);break}},O=()=>{const e=[o.dropdownTrigger];return t&&e.push(o.open),g&&e.push(o.loading),D&&e.push(o.error),e.join(" ")};return n.jsxs("div",{className:o.searchableDropdown,ref:h,onKeyDown:I,children:[n.jsx("label",{children:C}),n.jsxs(p.button,{type:"button",className:O(),onClick:()=>!u&&!g&&i(!t),whileTap:{scale:u?1:.98},style:{willChange:"transform"},disabled:u,children:[n.jsx("span",{className:`${o.dropdownValue} ${y?"":o.placeholder}`,children:y||N}),n.jsx(V,{className:o.dropdownArrow})]}),n.jsx(R,{children:t&&n.jsxs(p.div,{className:o.dropdownMenu,initial:{opacity:0,y:-10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{duration:.2,ease:"easeOut"},children:[n.jsxs("div",{className:o.dropdownSearch,children:[n.jsx(A,{className:o.searchIcon}),n.jsx("input",{ref:f,type:"text",className:o.searchInput,placeholder:"Cerca...",value:_,onChange:e=>d(e.target.value),onClick:e=>e.stopPropagation()})]}),n.jsxs("div",{className:o.dropdownOptions,children:[s.map((e,a)=>{const S=m===e.value,E=c===a;return n.jsxs(p.button,{type:"button",className:`${o.dropdownOption} ${S?o.selected:""} ${E?o.highlighted:""}`,onClick:()=>x(e.value),onMouseEnter:()=>l(a),initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:a*.02},whileTap:{scale:.98},style:{willChange:"transform"},children:[n.jsx("span",{children:e.label}),S&&n.jsx(T,{className:o.checkIcon})]},`${e.value}-${a}`)}),s.length===0&&n.jsx(p.div,{className:o.dropdownNoResults,initial:{opacity:0},animate:{opacity:1},children:"No results found"})]})]})})]})}Z.__docgenInfo={description:`SearchableDropdown component - Modern filterable dropdown with animations
1
+ import{r,j as n}from"./iframe-CvT6MryR.js";import{m as p}from"./proxy-0exJiild.js";import{C as V}from"./chevron-down-BZPtZoHS.js";import{A as R}from"./index-2ZuXCVEx.js";import{S as A}from"./search-Cfa-rwoK.js";import{C as T}from"./check-D8bWZLP6.js";const q="_searchableDropdown_13fbr_1",M="_dropdownTrigger_13fbr_17",$="_open_13fbr_45",L="_dropdownValue_13fbr_52",F="_placeholder_13fbr_61",K="_dropdownArrow_13fbr_67",H="_dropdownMenu_13fbr_83",P="_dropdownSearch_13fbr_101",z="_searchInput_13fbr_111",B="_searchIcon_13fbr_136",U="_dropdownOptions_13fbr_152",W="_dropdownOption_13fbr_152",G="_selected_13fbr_221",J="_highlighted_13fbr_243",Q="_checkIcon_13fbr_256",X="_dropdownNoResults_13fbr_276",Y="_loading_13fbr_390",o={searchableDropdown:q,dropdownTrigger:M,open:$,dropdownValue:L,placeholder:F,dropdownArrow:K,dropdownMenu:H,dropdownSearch:P,searchInput:z,searchIcon:B,dropdownOptions:U,dropdownOption:W,selected:G,highlighted:J,checkIcon:Q,dropdownNoResults:X,loading:Y};function Z({label:C,value:m,onChange:k,options:w,placeholder:N="Select...",allowEmpty:j=!0,disabled:u=!1,loading:g=!1,error:D=!1}){const[t,i]=r.useState(!1),[_,d]=r.useState(""),[c,l]=r.useState(-1),h=r.useRef(null),f=r.useRef(null),b=w.find(e=>e.value===m),y=b?b.label:"",v=w.filter(e=>e.label.toLowerCase().includes(_.toLowerCase())),s=j?[{label:"(none)",value:""},...v]:v;r.useEffect(()=>{function e(a){h.current&&!h.current.contains(a.target)&&(i(!1),d(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),r.useEffect(()=>{t&&f.current&&f.current.focus()},[t]);const x=e=>{k(e),i(!1),d(""),l(-1)},I=e=>{if(t)switch(e.key){case"ArrowDown":e.preventDefault(),l(a=>a<s.length-1?a+1:0);break;case"ArrowUp":e.preventDefault(),l(a=>a>0?a-1:s.length-1);break;case"Enter":e.preventDefault(),c>=0&&c<s.length&&x(s[c].value);break;case"Escape":e.preventDefault(),i(!1),d(""),l(-1);break}},O=()=>{const e=[o.dropdownTrigger];return t&&e.push(o.open),g&&e.push(o.loading),D&&e.push(o.error),e.join(" ")};return n.jsxs("div",{className:o.searchableDropdown,ref:h,onKeyDown:I,children:[n.jsx("label",{children:C}),n.jsxs(p.button,{type:"button",className:O(),onClick:()=>!u&&!g&&i(!t),whileTap:{scale:u?1:.98},style:{willChange:"transform"},disabled:u,children:[n.jsx("span",{className:`${o.dropdownValue} ${y?"":o.placeholder}`,children:y||N}),n.jsx(V,{className:o.dropdownArrow})]}),n.jsx(R,{children:t&&n.jsxs(p.div,{className:o.dropdownMenu,initial:{opacity:0,y:-10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{duration:.2,ease:"easeOut"},children:[n.jsxs("div",{className:o.dropdownSearch,children:[n.jsx(A,{className:o.searchIcon}),n.jsx("input",{ref:f,type:"text",className:o.searchInput,placeholder:"Cerca...",value:_,onChange:e=>d(e.target.value),onClick:e=>e.stopPropagation()})]}),n.jsxs("div",{className:o.dropdownOptions,children:[s.map((e,a)=>{const S=m===e.value,E=c===a;return n.jsxs(p.button,{type:"button",className:`${o.dropdownOption} ${S?o.selected:""} ${E?o.highlighted:""}`,onClick:()=>x(e.value),onMouseEnter:()=>l(a),initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:a*.02},whileTap:{scale:.98},style:{willChange:"transform"},children:[n.jsx("span",{children:e.label}),S&&n.jsx(T,{className:o.checkIcon})]},`${e.value}-${a}`)}),s.length===0&&n.jsx(p.div,{className:o.dropdownNoResults,initial:{opacity:0},animate:{opacity:1},children:"No results found"})]})]})})]})}Z.__docgenInfo={description:`SearchableDropdown component - Modern filterable dropdown with animations
2
2
 
3
3
  @component
4
4
  @description
@@ -1,4 +1,4 @@
1
- import{j as e,r as C}from"./iframe-2N7rjfXm.js";import{S as r}from"./SearchableDropdown-C_6nW_fM.js";import{U as q}from"./users-0pBe6bxm.js";import{S as Q}from"./search-DBjUUDRM.js";import"./preload-helper-C1FmrZbK.js";import"./proxy-qiKixXs8.js";import"./MotionConfigContext-4uS6JRtS.js";import"./chevron-down-B26xHSrx.js";import"./createLucideIcon-wa-8tr0c.js";import"./index-IKMS7NhW.js";import"./check-Bh0K2zJt.js";const ie={title:"Atoms/SearchableDropdown",component:r,parameters:{layout:"centered",docs:{description:{component:"A dropdown component with built-in search functionality and smooth animations."}}},tags:["autodocs"],argTypes:{label:{control:"text",description:"Label for the dropdown"},value:{control:"text",description:"Currently selected value"},placeholder:{control:"text",description:"Placeholder text when no option is selected"},allowEmpty:{control:"boolean",description:"Whether to allow empty/no selection"},onChange:{action:"changed"}}},t=[{label:"United States",value:"us"},{label:"United Kingdom",value:"uk"},{label:"Canada",value:"ca"},{label:"Germany",value:"de"},{label:"France",value:"fr"},{label:"Italy",value:"it"},{label:"Spain",value:"es"},{label:"Japan",value:"jp"},{label:"Australia",value:"au"},{label:"Brazil",value:"br"}],u=[{label:"New York",value:"ny"},{label:"Los Angeles",value:"la"},{label:"Chicago",value:"chi"},{label:"Houston",value:"hou"},{label:"Phoenix",value:"phx"},{label:"Philadelphia",value:"phi"},{label:"San Antonio",value:"sa"},{label:"San Diego",value:"sd"},{label:"Dallas",value:"dal"},{label:"San Jose",value:"sj"}],s=[{label:"React",value:"react"},{label:"Vue.js",value:"vue"},{label:"Angular",value:"angular"},{label:"Svelte",value:"svelte"},{label:"TypeScript",value:"typescript"},{label:"JavaScript",value:"javascript"},{label:"Node.js",value:"nodejs"},{label:"Python",value:"python"},{label:"Java",value:"java"},{label:"C#",value:"csharp"},{label:"Go",value:"go"},{label:"Rust",value:"rust"}],y={args:{label:"Select Country",value:"",options:t,placeholder:"Choose a country",allowEmpty:!0,onChange:()=>{}}},m={args:{label:"Selected Country",value:"us",options:t,placeholder:"Choose a country",allowEmpty:!0,onChange:()=>{}}},g={args:{label:"Technology Stack",value:"react",options:s,placeholder:"Select technology",allowEmpty:!1,onChange:()=>{}}},b={args:{label:"Choose City",value:"",options:u,placeholder:"Search for a city",allowEmpty:!0,onChange:()=>{}}},v={args:{label:"Country",value:"",options:t,placeholder:"Search countries...",allowEmpty:!0,onChange:()=>{}},render:()=>{var p,c;const[l,d]=C.useState(""),[n,i]=C.useState("react");return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",width:"300px"},children:[e.jsx(r,{label:"Country",value:l,onChange:d,options:t,placeholder:"Search countries...",allowEmpty:!0}),e.jsx(r,{label:"Technology",value:n,onChange:i,options:s,placeholder:"Search technologies...",allowEmpty:!1}),e.jsxs("div",{style:{marginTop:"1rem",padding:"1rem",background:"#f5f5f5",borderRadius:"4px"},children:[e.jsx("p",{style:{margin:0,fontSize:"0.875rem"},children:e.jsx("strong",{children:"Selected Values:"})}),e.jsxs("ul",{style:{margin:"0.5rem 0 0",paddingLeft:"1.5rem",fontSize:"0.875rem"},children:[e.jsxs("li",{children:["Country: ",l?(p=t.find(o=>o.value===l))==null?void 0:p.label:"None"]}),e.jsxs("li",{children:["Technology: ",(c=s.find(o=>o.value===n))==null?void 0:c.label]})]})]})]})},parameters:{controls:{disable:!0}}},f={args:{label:"Country",value:"",options:t,placeholder:"Search for your country",allowEmpty:!1,onChange:()=>{}},render:()=>{var i,p,c;const[l,d]=C.useState({country:"",city:"",skills:""}),n=(o,h)=>{d(a=>({...a,[o]:h}))};return e.jsxs("div",{style:{padding:"1.5rem",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"8px",maxWidth:"400px"},children:[e.jsxs("h3",{style:{marginTop:0,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(q,{})," User Profile"]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[e.jsx(r,{label:"Country",value:l.country,onChange:o=>n("country",o),options:t,placeholder:"Search for your country",allowEmpty:!1}),e.jsx(r,{label:"City",value:l.city,onChange:o=>n("city",o),options:u,placeholder:"Search for your city",allowEmpty:!0}),e.jsx(r,{label:"Primary Skill",value:l.skills,onChange:o=>n("skills",o),options:s,placeholder:"Search technologies",allowEmpty:!0})]}),e.jsxs("div",{style:{marginTop:"1rem",padding:"0.75rem",background:"#f8f9fa",borderRadius:"4px",fontSize:"0.875rem"},children:[e.jsx("strong",{children:"Profile Summary:"}),e.jsx("br",{}),"🌍 Country: ",l.country?(i=t.find(o=>o.value===l.country))==null?void 0:i.label:"Not specified",e.jsx("br",{}),"📍 City: ",l.city?(p=u.find(o=>o.value===l.city))==null?void 0:p.label:"Not specified",e.jsx("br",{}),"💻 Skills: ",l.skills?(c=s.find(o=>o.value===l.skills))==null?void 0:c.label:"Not specified"]})]})},parameters:{controls:{disable:!0}}},x={args:{label:"Location",value:"",options:u,placeholder:"Search locations...",allowEmpty:!0,onChange:()=>{}},render:()=>{var c,o,h;const[l,d]=C.useState({location:"",technology:"",experience:""}),n=[{label:"Entry Level (0-2 years)",value:"entry"},{label:"Mid Level (3-5 years)",value:"mid"},{label:"Senior Level (6-10 years)",value:"senior"},{label:"Lead/Principal (10+ years)",value:"lead"}],i=(a,K)=>{d(Y=>({...Y,[a]:K}))},p=()=>{d({location:"",technology:"",experience:""})};return e.jsxs("div",{style:{padding:"1.5rem",background:"#f8f9fa",border:"1px solid #dee2e6",borderRadius:"8px",maxWidth:"500px"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},children:[e.jsxs("h3",{style:{margin:0,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(Q,{})," Job Search Filters"]}),e.jsx("button",{onClick:p,style:{padding:"0.25rem 0.75rem",fontSize:"0.75rem",backgroundColor:"transparent",border:"1px solid #6c757d",borderRadius:"4px",cursor:"pointer"},children:"Clear All"})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[e.jsx(r,{label:"Location",value:l.location,onChange:a=>i("location",a),options:u,placeholder:"Search locations...",allowEmpty:!0}),e.jsx(r,{label:"Technology",value:l.technology,onChange:a=>i("technology",a),options:s,placeholder:"Search technologies...",allowEmpty:!0}),e.jsx(r,{label:"Experience Level",value:l.experience,onChange:a=>i("experience",a),options:n,placeholder:"Select experience level...",allowEmpty:!0})]}),e.jsxs("div",{style:{marginTop:"1rem",padding:"0.75rem",background:"#fff",borderRadius:"4px",fontSize:"0.875rem"},children:[e.jsx("strong",{children:"Active Filters:"}),e.jsx("br",{}),!l.location&&!l.technology&&!l.experience?e.jsx("em",{children:"No filters applied"}):e.jsxs("ul",{style:{margin:"0.5rem 0 0",paddingLeft:"1.5rem"},children:[l.location&&e.jsxs("li",{children:["📍 ",(c=u.find(a=>a.value===l.location))==null?void 0:c.label]}),l.technology&&e.jsxs("li",{children:["💻 ",(o=s.find(a=>a.value===l.technology))==null?void 0:o.label]}),l.experience&&e.jsxs("li",{children:["🎯 ",(h=n.find(a=>a.value===l.experience))==null?void 0:h.label]})]})]})]})},parameters:{controls:{disable:!0}}},S={args:{label:"With Empty Option",value:"",options:t.slice(0,5),placeholder:"Choose...",allowEmpty:!0,onChange:()=>{}},render:()=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",width:"300px"},children:[e.jsx(r,{label:"With Empty Option",value:"",onChange:()=>{},options:t.slice(0,5),placeholder:"Choose...",allowEmpty:!0}),e.jsx(r,{label:"No Empty Option",value:"react",onChange:()=>{},options:s.slice(0,5),placeholder:"Choose...",allowEmpty:!1}),e.jsx(r,{label:"Pre-selected",value:"us",onChange:()=>{},options:t.slice(0,5),placeholder:"Choose...",allowEmpty:!0}),e.jsx(r,{label:"Long Options List",value:"",onChange:()=>{},options:s,placeholder:"Search technologies...",allowEmpty:!0})]}),parameters:{controls:{disable:!0}}};var w,E,j;y.parameters={...y.parameters,docs:{...(w=y.parameters)==null?void 0:w.docs,source:{originalSource:`{
1
+ import{j as e,r as C}from"./iframe-CvT6MryR.js";import{S as r}from"./SearchableDropdown-BTWjVlVv.js";import{U as q}from"./users-CoCnAJkL.js";import{S as Q}from"./search-Cfa-rwoK.js";import"./preload-helper-C1FmrZbK.js";import"./proxy-0exJiild.js";import"./MotionConfigContext-BdSKNtzx.js";import"./chevron-down-BZPtZoHS.js";import"./createLucideIcon-Eaeny9Zi.js";import"./index-2ZuXCVEx.js";import"./check-D8bWZLP6.js";const ie={title:"Atoms/SearchableDropdown",component:r,parameters:{layout:"centered",docs:{description:{component:"A dropdown component with built-in search functionality and smooth animations."}}},tags:["autodocs"],argTypes:{label:{control:"text",description:"Label for the dropdown"},value:{control:"text",description:"Currently selected value"},placeholder:{control:"text",description:"Placeholder text when no option is selected"},allowEmpty:{control:"boolean",description:"Whether to allow empty/no selection"},onChange:{action:"changed"}}},t=[{label:"United States",value:"us"},{label:"United Kingdom",value:"uk"},{label:"Canada",value:"ca"},{label:"Germany",value:"de"},{label:"France",value:"fr"},{label:"Italy",value:"it"},{label:"Spain",value:"es"},{label:"Japan",value:"jp"},{label:"Australia",value:"au"},{label:"Brazil",value:"br"}],u=[{label:"New York",value:"ny"},{label:"Los Angeles",value:"la"},{label:"Chicago",value:"chi"},{label:"Houston",value:"hou"},{label:"Phoenix",value:"phx"},{label:"Philadelphia",value:"phi"},{label:"San Antonio",value:"sa"},{label:"San Diego",value:"sd"},{label:"Dallas",value:"dal"},{label:"San Jose",value:"sj"}],s=[{label:"React",value:"react"},{label:"Vue.js",value:"vue"},{label:"Angular",value:"angular"},{label:"Svelte",value:"svelte"},{label:"TypeScript",value:"typescript"},{label:"JavaScript",value:"javascript"},{label:"Node.js",value:"nodejs"},{label:"Python",value:"python"},{label:"Java",value:"java"},{label:"C#",value:"csharp"},{label:"Go",value:"go"},{label:"Rust",value:"rust"}],y={args:{label:"Select Country",value:"",options:t,placeholder:"Choose a country",allowEmpty:!0,onChange:()=>{}}},m={args:{label:"Selected Country",value:"us",options:t,placeholder:"Choose a country",allowEmpty:!0,onChange:()=>{}}},g={args:{label:"Technology Stack",value:"react",options:s,placeholder:"Select technology",allowEmpty:!1,onChange:()=>{}}},b={args:{label:"Choose City",value:"",options:u,placeholder:"Search for a city",allowEmpty:!0,onChange:()=>{}}},v={args:{label:"Country",value:"",options:t,placeholder:"Search countries...",allowEmpty:!0,onChange:()=>{}},render:()=>{var p,c;const[l,d]=C.useState(""),[n,i]=C.useState("react");return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",width:"300px"},children:[e.jsx(r,{label:"Country",value:l,onChange:d,options:t,placeholder:"Search countries...",allowEmpty:!0}),e.jsx(r,{label:"Technology",value:n,onChange:i,options:s,placeholder:"Search technologies...",allowEmpty:!1}),e.jsxs("div",{style:{marginTop:"1rem",padding:"1rem",background:"#f5f5f5",borderRadius:"4px"},children:[e.jsx("p",{style:{margin:0,fontSize:"0.875rem"},children:e.jsx("strong",{children:"Selected Values:"})}),e.jsxs("ul",{style:{margin:"0.5rem 0 0",paddingLeft:"1.5rem",fontSize:"0.875rem"},children:[e.jsxs("li",{children:["Country: ",l?(p=t.find(o=>o.value===l))==null?void 0:p.label:"None"]}),e.jsxs("li",{children:["Technology: ",(c=s.find(o=>o.value===n))==null?void 0:c.label]})]})]})]})},parameters:{controls:{disable:!0}}},f={args:{label:"Country",value:"",options:t,placeholder:"Search for your country",allowEmpty:!1,onChange:()=>{}},render:()=>{var i,p,c;const[l,d]=C.useState({country:"",city:"",skills:""}),n=(o,h)=>{d(a=>({...a,[o]:h}))};return e.jsxs("div",{style:{padding:"1.5rem",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"8px",maxWidth:"400px"},children:[e.jsxs("h3",{style:{marginTop:0,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(q,{})," User Profile"]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[e.jsx(r,{label:"Country",value:l.country,onChange:o=>n("country",o),options:t,placeholder:"Search for your country",allowEmpty:!1}),e.jsx(r,{label:"City",value:l.city,onChange:o=>n("city",o),options:u,placeholder:"Search for your city",allowEmpty:!0}),e.jsx(r,{label:"Primary Skill",value:l.skills,onChange:o=>n("skills",o),options:s,placeholder:"Search technologies",allowEmpty:!0})]}),e.jsxs("div",{style:{marginTop:"1rem",padding:"0.75rem",background:"#f8f9fa",borderRadius:"4px",fontSize:"0.875rem"},children:[e.jsx("strong",{children:"Profile Summary:"}),e.jsx("br",{}),"🌍 Country: ",l.country?(i=t.find(o=>o.value===l.country))==null?void 0:i.label:"Not specified",e.jsx("br",{}),"📍 City: ",l.city?(p=u.find(o=>o.value===l.city))==null?void 0:p.label:"Not specified",e.jsx("br",{}),"💻 Skills: ",l.skills?(c=s.find(o=>o.value===l.skills))==null?void 0:c.label:"Not specified"]})]})},parameters:{controls:{disable:!0}}},x={args:{label:"Location",value:"",options:u,placeholder:"Search locations...",allowEmpty:!0,onChange:()=>{}},render:()=>{var c,o,h;const[l,d]=C.useState({location:"",technology:"",experience:""}),n=[{label:"Entry Level (0-2 years)",value:"entry"},{label:"Mid Level (3-5 years)",value:"mid"},{label:"Senior Level (6-10 years)",value:"senior"},{label:"Lead/Principal (10+ years)",value:"lead"}],i=(a,K)=>{d(Y=>({...Y,[a]:K}))},p=()=>{d({location:"",technology:"",experience:""})};return e.jsxs("div",{style:{padding:"1.5rem",background:"#f8f9fa",border:"1px solid #dee2e6",borderRadius:"8px",maxWidth:"500px"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},children:[e.jsxs("h3",{style:{margin:0,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(Q,{})," Job Search Filters"]}),e.jsx("button",{onClick:p,style:{padding:"0.25rem 0.75rem",fontSize:"0.75rem",backgroundColor:"transparent",border:"1px solid #6c757d",borderRadius:"4px",cursor:"pointer"},children:"Clear All"})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[e.jsx(r,{label:"Location",value:l.location,onChange:a=>i("location",a),options:u,placeholder:"Search locations...",allowEmpty:!0}),e.jsx(r,{label:"Technology",value:l.technology,onChange:a=>i("technology",a),options:s,placeholder:"Search technologies...",allowEmpty:!0}),e.jsx(r,{label:"Experience Level",value:l.experience,onChange:a=>i("experience",a),options:n,placeholder:"Select experience level...",allowEmpty:!0})]}),e.jsxs("div",{style:{marginTop:"1rem",padding:"0.75rem",background:"#fff",borderRadius:"4px",fontSize:"0.875rem"},children:[e.jsx("strong",{children:"Active Filters:"}),e.jsx("br",{}),!l.location&&!l.technology&&!l.experience?e.jsx("em",{children:"No filters applied"}):e.jsxs("ul",{style:{margin:"0.5rem 0 0",paddingLeft:"1.5rem"},children:[l.location&&e.jsxs("li",{children:["📍 ",(c=u.find(a=>a.value===l.location))==null?void 0:c.label]}),l.technology&&e.jsxs("li",{children:["💻 ",(o=s.find(a=>a.value===l.technology))==null?void 0:o.label]}),l.experience&&e.jsxs("li",{children:["🎯 ",(h=n.find(a=>a.value===l.experience))==null?void 0:h.label]})]})]})]})},parameters:{controls:{disable:!0}}},S={args:{label:"With Empty Option",value:"",options:t.slice(0,5),placeholder:"Choose...",allowEmpty:!0,onChange:()=>{}},render:()=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",width:"300px"},children:[e.jsx(r,{label:"With Empty Option",value:"",onChange:()=>{},options:t.slice(0,5),placeholder:"Choose...",allowEmpty:!0}),e.jsx(r,{label:"No Empty Option",value:"react",onChange:()=>{},options:s.slice(0,5),placeholder:"Choose...",allowEmpty:!1}),e.jsx(r,{label:"Pre-selected",value:"us",onChange:()=>{},options:t.slice(0,5),placeholder:"Choose...",allowEmpty:!0}),e.jsx(r,{label:"Long Options List",value:"",onChange:()=>{},options:s,placeholder:"Search technologies...",allowEmpty:!0})]}),parameters:{controls:{disable:!0}}};var w,E,j;y.parameters={...y.parameters,docs:{...(w=y.parameters)==null?void 0:w.docs,source:{originalSource:`{
2
2
  args: {
3
3
  label: 'Select Country',
4
4
  value: '',
@@ -1,4 +1,4 @@
1
- import{j as s}from"./iframe-2N7rjfXm.js";import{u as g}from"./useSound-BBLJ5Rjg.js";import{C as I}from"./chevron-down-B26xHSrx.js";const S="_selectInput_evuah_1",x="_selectWrapper_evuah_16",j="_selectIcon_evuah_68",C="_error_evuah_134",V="_success_evuah_163",q="_loading_evuah_190",l={selectInput:S,selectWrapper:x,selectIcon:j,error:C,success:V,loading:q};function w({label:r,value:c,onChange:u,options:i,placeholder:p="Select...",disabled:d=!1,error:f=!1,success:v=!1,loading:a=!1,required:t=!1,soundConfig:h,className:n}){const{handlers:m,playSound:_}=g(h),b=()=>{const e=[l.selectInput];return f&&e.push(l.error),v&&e.push(l.success),a&&e.push(l.loading),e.join(" ")};return s.jsxs("div",{className:`${b()}${n?` ${n}`:""}`,children:[s.jsxs("label",{children:[r,t&&s.jsx("span",{style:{color:"var(--color-error)"},children:" *"})]}),s.jsxs("div",{className:l.selectWrapper,children:[s.jsxs("select",{value:c,onChange:e=>{_("click"),u(e.target.value)},disabled:d||a,required:t,...m,children:[s.jsx("option",{value:"",children:p}),i.map(e=>{const o=typeof e=="string"?e:e.value,y=typeof e=="string"?e:e.label;return s.jsx("option",{value:o,children:y},o)})]}),s.jsx(I,{className:l.selectIcon})]})]})}w.__docgenInfo={description:`SelectInput component - Styled dropdown selector with flexible option format
1
+ import{j as s}from"./iframe-CvT6MryR.js";import{u as g}from"./useSound-DyOR6GVH.js";import{C as I}from"./chevron-down-BZPtZoHS.js";const S="_selectInput_evuah_1",x="_selectWrapper_evuah_16",j="_selectIcon_evuah_68",C="_error_evuah_134",V="_success_evuah_163",q="_loading_evuah_190",l={selectInput:S,selectWrapper:x,selectIcon:j,error:C,success:V,loading:q};function w({label:r,value:c,onChange:u,options:i,placeholder:p="Select...",disabled:d=!1,error:f=!1,success:v=!1,loading:a=!1,required:t=!1,soundConfig:h,className:n}){const{handlers:m,playSound:_}=g(h),b=()=>{const e=[l.selectInput];return f&&e.push(l.error),v&&e.push(l.success),a&&e.push(l.loading),e.join(" ")};return s.jsxs("div",{className:`${b()}${n?` ${n}`:""}`,children:[s.jsxs("label",{children:[r,t&&s.jsx("span",{style:{color:"var(--color-error)"},children:" *"})]}),s.jsxs("div",{className:l.selectWrapper,children:[s.jsxs("select",{value:c,onChange:e=>{_("click"),u(e.target.value)},disabled:d||a,required:t,...m,children:[s.jsx("option",{value:"",children:p}),i.map(e=>{const o=typeof e=="string"?e:e.value,y=typeof e=="string"?e:e.label;return s.jsx("option",{value:o,children:y},o)})]}),s.jsx(I,{className:l.selectIcon})]})]})}w.__docgenInfo={description:`SelectInput component - Styled dropdown selector with flexible option format
2
2
 
3
3
  @component
4
4
  @description
@@ -1,4 +1,4 @@
1
- import{r as w,j as o}from"./iframe-2N7rjfXm.js";import{S as l}from"./SelectInput-Cq1kd98Q.js";import"./preload-helper-C1FmrZbK.js";import"./useSound-BBLJ5Rjg.js";import"./chevron-down-B26xHSrx.js";import"./createLucideIcon-wa-8tr0c.js";const H={title:"Atoms/SelectInput",component:l,parameters:{layout:"centered",docs:{description:{component:"A simple dropdown select component with customizable options."}}},tags:["autodocs"],argTypes:{label:{control:"text",description:"Label for the select input"},value:{control:"text",description:"Currently selected value"},placeholder:{control:"text",description:"Placeholder text when no value is selected"},onChange:{action:"changed"}}},P=["Option 1","Option 2","Option 3","Option 4"],p=[{label:"United States",value:"us"},{label:"United Kingdom",value:"uk"},{label:"Canada",value:"ca"},{label:"Australia",value:"au"},{label:"Germany",value:"de"},{label:"France",value:"fr"},{label:"Italy",value:"it"},{label:"Spain",value:"es"}],r={args:{label:"Select an option",value:"",onChange:()=>{},options:P,placeholder:"Choose..."}},n={args:{label:"Choose your favorite",value:"Option 2",onChange:()=>{},options:P}},s={args:{label:"Country",value:"uk",onChange:()=>{},options:p,placeholder:"Select a country"}},i={args:{label:"Priority",value:"",onChange:()=>{},options:["Low","Medium","High","Critical"]}},c={args:{label:"Interactive Select",value:"",onChange:()=>{},options:p,placeholder:"Choose a country"},render:()=>{var a;const[e,t]=w.useState("");return o.jsxs("div",{children:[o.jsx(l,{label:"Select your country",value:e,onChange:t,options:p,placeholder:"Choose a country"}),e&&o.jsxs("p",{style:{marginTop:"1rem",fontSize:"0.875rem",color:"#666"},children:["Selected: ",((a=p.find(k=>k.value===e))==null?void 0:a.label)||e]})]})}},u={args:{label:"Form Example",value:"",onChange:()=>{},options:["Option 1","Option 2"]},render:()=>{const[e,t]=w.useState({title:"",category:"",priority:"",assignee:""});return o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",padding:"1.5rem",background:"#f9f9f9",borderRadius:"8px",minWidth:"300px"},children:[o.jsx("h3",{style:{marginTop:0},children:"Create Task"}),o.jsx(l,{label:"Title",value:e.title,onChange:a=>t({...e,title:a}),options:["Mr","Mrs","Ms","Dr","Prof"],placeholder:"Select title"}),o.jsx(l,{label:"Category",value:e.category,onChange:a=>t({...e,category:a}),options:[{label:"Bug",value:"bug"},{label:"Feature",value:"feature"},{label:"Documentation",value:"docs"},{label:"Testing",value:"test"}],placeholder:"Select category"}),o.jsx(l,{label:"Priority",value:e.priority,onChange:a=>t({...e,priority:a}),options:["Low","Medium","High","Critical"],placeholder:"Select priority"}),o.jsx(l,{label:"Assignee",value:e.assignee,onChange:a=>t({...e,assignee:a}),options:[{label:"John Doe",value:"john"},{label:"Jane Smith",value:"jane"},{label:"Bob Johnson",value:"bob"},{label:"Alice Brown",value:"alice"}],placeholder:"Select assignee"})]})},parameters:{controls:{disable:!0}}};var d,m,g;r.parameters={...r.parameters,docs:{...(d=r.parameters)==null?void 0:d.docs,source:{originalSource:`{
1
+ import{r as w,j as o}from"./iframe-CvT6MryR.js";import{S as l}from"./SelectInput-BhKBu2cI.js";import"./preload-helper-C1FmrZbK.js";import"./useSound-DyOR6GVH.js";import"./chevron-down-BZPtZoHS.js";import"./createLucideIcon-Eaeny9Zi.js";const H={title:"Atoms/SelectInput",component:l,parameters:{layout:"centered",docs:{description:{component:"A simple dropdown select component with customizable options."}}},tags:["autodocs"],argTypes:{label:{control:"text",description:"Label for the select input"},value:{control:"text",description:"Currently selected value"},placeholder:{control:"text",description:"Placeholder text when no value is selected"},onChange:{action:"changed"}}},P=["Option 1","Option 2","Option 3","Option 4"],p=[{label:"United States",value:"us"},{label:"United Kingdom",value:"uk"},{label:"Canada",value:"ca"},{label:"Australia",value:"au"},{label:"Germany",value:"de"},{label:"France",value:"fr"},{label:"Italy",value:"it"},{label:"Spain",value:"es"}],r={args:{label:"Select an option",value:"",onChange:()=>{},options:P,placeholder:"Choose..."}},n={args:{label:"Choose your favorite",value:"Option 2",onChange:()=>{},options:P}},s={args:{label:"Country",value:"uk",onChange:()=>{},options:p,placeholder:"Select a country"}},i={args:{label:"Priority",value:"",onChange:()=>{},options:["Low","Medium","High","Critical"]}},c={args:{label:"Interactive Select",value:"",onChange:()=>{},options:p,placeholder:"Choose a country"},render:()=>{var a;const[e,t]=w.useState("");return o.jsxs("div",{children:[o.jsx(l,{label:"Select your country",value:e,onChange:t,options:p,placeholder:"Choose a country"}),e&&o.jsxs("p",{style:{marginTop:"1rem",fontSize:"0.875rem",color:"#666"},children:["Selected: ",((a=p.find(k=>k.value===e))==null?void 0:a.label)||e]})]})}},u={args:{label:"Form Example",value:"",onChange:()=>{},options:["Option 1","Option 2"]},render:()=>{const[e,t]=w.useState({title:"",category:"",priority:"",assignee:""});return o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",padding:"1.5rem",background:"#f9f9f9",borderRadius:"8px",minWidth:"300px"},children:[o.jsx("h3",{style:{marginTop:0},children:"Create Task"}),o.jsx(l,{label:"Title",value:e.title,onChange:a=>t({...e,title:a}),options:["Mr","Mrs","Ms","Dr","Prof"],placeholder:"Select title"}),o.jsx(l,{label:"Category",value:e.category,onChange:a=>t({...e,category:a}),options:[{label:"Bug",value:"bug"},{label:"Feature",value:"feature"},{label:"Documentation",value:"docs"},{label:"Testing",value:"test"}],placeholder:"Select category"}),o.jsx(l,{label:"Priority",value:e.priority,onChange:a=>t({...e,priority:a}),options:["Low","Medium","High","Critical"],placeholder:"Select priority"}),o.jsx(l,{label:"Assignee",value:e.assignee,onChange:a=>t({...e,assignee:a}),options:[{label:"John Doe",value:"john"},{label:"Jane Smith",value:"jane"},{label:"Bob Johnson",value:"bob"},{label:"Alice Brown",value:"alice"}],placeholder:"Select assignee"})]})},parameters:{controls:{disable:!0}}};var d,m,g;r.parameters={...r.parameters,docs:{...(d=r.parameters)==null?void 0:d.docs,source:{originalSource:`{
2
2
  args: {
3
3
  label: 'Select an option',
4
4
  value: '',
@@ -1,4 +1,4 @@
1
- import{r as M,j}from"./iframe-2N7rjfXm.js";import{d as m,S as B,a as D,W as N,q as T,i as k,M as G,r as H}from"./three.module--_vTUKhS.js";import"./preload-helper-C1FmrZbK.js";const U=`
1
+ import{r as M,j}from"./iframe-CvT6MryR.js";import{d as m,S as B,a as D,W as N,q as T,i as k,M as G,r as H}from"./three.module--_vTUKhS.js";import"./preload-helper-C1FmrZbK.js";const U=`
2
2
  varying vec2 v_texcoord;
3
3
  void main() {
4
4
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
@@ -1,4 +1,4 @@
1
- import{r as v,j as q}from"./iframe-2N7rjfXm.js";import"./preload-helper-C1FmrZbK.js";const z={"shapegrid-canvas":"_shapegrid-canvas_ilyut_1"},J=({direction:P="right",speed:L=1,borderColor:k="#999",squareSize:t=40,hoverFillColor:b="#222",shape:X="square",hoverTrailAmount:y=0,className:Q=""})=>{const _=v.useRef(null),j=v.useRef(null),U=v.useRef(),Z=v.useRef(),r=v.useRef({x:0,y:0}),o=v.useRef(null),p=v.useRef([]),M=v.useRef(new Map);return v.useEffect(()=>{const s=_.current,n=s.getContext("2d"),Y=X==="hexagon",E=X==="triangle",w=t*1.5,m=t*Math.sqrt(3),V=()=>{s.width=s.offsetWidth,s.height=s.offsetHeight,U.current=Math.ceil(s.width/t)+1,Z.current=Math.ceil(s.height/t)+1};window.addEventListener("resize",V),V();const C=(l,e,c)=>{n.beginPath();for(let u=0;u<6;u++){const h=Math.PI/3*u,d=l+c*Math.cos(h),f=e+c*Math.sin(h);u===0?n.moveTo(d,f):n.lineTo(d,f)}n.closePath()},G=(l,e,c)=>{n.beginPath(),n.arc(l,e,c/2,0,Math.PI*2),n.closePath()},O=(l,e,c,u)=>{n.beginPath(),u?(n.moveTo(l,e+c/2),n.lineTo(l+c/2,e-c/2),n.lineTo(l-c/2,e-c/2)):(n.moveTo(l,e-c/2),n.lineTo(l+c/2,e+c/2),n.lineTo(l-c/2,e+c/2)),n.closePath()},A=()=>{if(n.clearRect(0,0,s.width,s.height),Y){const e=Math.floor(r.current.x/w),c=(r.current.x%w+w)%w,u=(r.current.y%m+m)%m,h=Math.ceil(s.width/w)+3,d=Math.ceil(s.height/m)+3;for(let f=-2;f<h;f++)for(let g=-2;g<d;g++){const i=f*w+c,a=g*m+((f+e)%2!==0?m/2:0)+u,x=`${f},${g}`,R=M.current.get(x);R&&(n.globalAlpha=R,C(i,a,t),n.fillStyle=b,n.fill(),n.globalAlpha=1),C(i,a,t),n.strokeStyle=k,n.stroke()}}else if(E){const e=t/2,c=Math.floor(r.current.x/e),u=Math.floor(r.current.y/t),h=(r.current.x%e+e)%e,d=(r.current.y%t+t)%t,f=Math.ceil(s.width/e)+4,g=Math.ceil(s.height/t)+4;for(let i=-2;i<f;i++)for(let a=-2;a<g;a++){const x=i*e+h,R=a*t+t/2+d,I=((i+c+a+u)%2+2)%2!==0,S=`${i},${a}`,N=M.current.get(S);N&&(n.globalAlpha=N,O(x,R,t,I),n.fillStyle=b,n.fill(),n.globalAlpha=1),O(x,R,t,I),n.strokeStyle=k,n.stroke()}}else if(X==="circle"){const e=(r.current.x%t+t)%t,c=(r.current.y%t+t)%t,u=Math.ceil(s.width/t)+3,h=Math.ceil(s.height/t)+3;for(let d=-2;d<u;d++)for(let f=-2;f<h;f++){const g=d*t+t/2+e,i=f*t+t/2+c,a=`${d},${f}`,x=M.current.get(a);x&&(n.globalAlpha=x,G(g,i,t),n.fillStyle=b,n.fill(),n.globalAlpha=1),G(g,i,t),n.strokeStyle=k,n.stroke()}}else{const e=(r.current.x%t+t)%t,c=(r.current.y%t+t)%t,u=Math.ceil(s.width/t)+3,h=Math.ceil(s.height/t)+3;for(let d=-2;d<u;d++)for(let f=-2;f<h;f++){const g=d*t+e,i=f*t+c,a=`${d},${f}`,x=M.current.get(a);x&&(n.globalAlpha=x,n.fillStyle=b,n.fillRect(g,i,t,t),n.globalAlpha=1),n.strokeStyle=k,n.strokeRect(g,i,t,t)}}const l=n.createRadialGradient(s.width/2,s.height/2,0,s.width/2,s.height/2,Math.sqrt(s.width**2+s.height**2)/2);l.addColorStop(0,"rgba(0, 0, 0, 0)"),n.fillStyle=l,n.fillRect(0,0,s.width,s.height)},H=()=>{const l=Math.max(L,.1),e=Y?w*2:t,c=Y?m:E?t*2:t;switch(P){case"right":r.current.x=(r.current.x-l+e)%e;break;case"left":r.current.x=(r.current.x+l+e)%e;break;case"up":r.current.y=(r.current.y+l+c)%c;break;case"down":r.current.y=(r.current.y-l+c)%c;break;case"diagonal":r.current.x=(r.current.x-l+e)%e,r.current.y=(r.current.y-l+c)%c;break}T(),A(),j.current=requestAnimationFrame(H)},T=()=>{const l=new Map;if(o.current&&l.set(`${o.current.x},${o.current.y}`,1),y>0)for(let e=0;e<p.current.length;e++){const c=p.current[e],u=`${c.x},${c.y}`;l.has(u)||l.set(u,(p.current.length-e)/(p.current.length+1))}for(const[e]of l)M.current.has(e)||M.current.set(e,0);for(const[e,c]of M.current){const u=l.get(e)||0,h=c+(u-c)*.15;h<.005?M.current.delete(e):M.current.set(e,h)}},K=l=>{const e=s.getBoundingClientRect(),c=l.clientX-e.left,u=l.clientY-e.top;if(Y){const h=Math.floor(r.current.x/w),d=(r.current.x%w+w)%w,f=(r.current.y%m+m)%m,g=c-d,i=u-f,a=Math.round(g/w),x=(a+h)%2!==0?m/2:0,R=Math.round((i-x)/m);(!o.current||o.current.x!==a||o.current.y!==R)&&(o.current&&y>0&&(p.current.unshift({...o.current}),p.current.length>y&&(p.current.length=y)),o.current={x:a,y:R})}else if(E){const h=t/2,d=(r.current.x%h+h)%h,f=(r.current.y%t+t)%t,g=c-d,i=u-f,a=Math.round(g/h),x=Math.floor(i/t);(!o.current||o.current.x!==a||o.current.y!==x)&&(o.current&&y>0&&(p.current.unshift({...o.current}),p.current.length>y&&(p.current.length=y)),o.current={x:a,y:x})}else if(X==="circle"){const h=(r.current.x%t+t)%t,d=(r.current.y%t+t)%t,f=c-h,g=u-d,i=Math.round(f/t),a=Math.round(g/t);(!o.current||o.current.x!==i||o.current.y!==a)&&(o.current&&y>0&&(p.current.unshift({...o.current}),p.current.length>y&&(p.current.length=y)),o.current={x:i,y:a})}else{const h=(r.current.x%t+t)%t,d=(r.current.y%t+t)%t,f=c-h,g=u-d,i=Math.floor(f/t),a=Math.floor(g/t);(!o.current||o.current.x!==i||o.current.y!==a)&&(o.current&&y>0&&(p.current.unshift({...o.current}),p.current.length>y&&(p.current.length=y)),o.current={x:i,y:a})}},B=()=>{o.current&&y>0&&(p.current.unshift({...o.current}),p.current.length>y&&(p.current.length=y)),o.current=null};return s.addEventListener("mousemove",K),s.addEventListener("mouseleave",B),j.current=requestAnimationFrame(H),()=>{window.removeEventListener("resize",V),cancelAnimationFrame(j.current),s.removeEventListener("mousemove",K),s.removeEventListener("mouseleave",B)}},[P,L,k,b,t,X,y]),q.jsx("canvas",{ref:_,className:`${z["shapegrid-canvas"]} ${Q}`})};J.__docgenInfo={description:"",methods:[],displayName:"ShapeGrid",props:{direction:{defaultValue:{value:"'right'",computed:!1},required:!1},speed:{defaultValue:{value:"1",computed:!1},required:!1},borderColor:{defaultValue:{value:"'#999'",computed:!1},required:!1},squareSize:{defaultValue:{value:"40",computed:!1},required:!1},hoverFillColor:{defaultValue:{value:"'#222'",computed:!1},required:!1},shape:{defaultValue:{value:"'square'",computed:!1},required:!1},hoverTrailAmount:{defaultValue:{value:"0",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1}}};const nt={title:"ReactBits/Backgrounds/ShapeGrid",component:J,parameters:{layout:"fullscreen"},tags:["autodocs"]},$={args:{direction:"right",speed:1,borderColor:"#999",squareSize:40,hoverFillColor:"#222",shape:"square",hoverTrailAmount:0}};var W,D,F;$.parameters={...$.parameters,docs:{...(W=$.parameters)==null?void 0:W.docs,source:{originalSource:`{
1
+ import{r as v,j as q}from"./iframe-CvT6MryR.js";import"./preload-helper-C1FmrZbK.js";const z={"shapegrid-canvas":"_shapegrid-canvas_ilyut_1"},J=({direction:P="right",speed:L=1,borderColor:k="#999",squareSize:t=40,hoverFillColor:b="#222",shape:X="square",hoverTrailAmount:y=0,className:Q=""})=>{const _=v.useRef(null),j=v.useRef(null),U=v.useRef(),Z=v.useRef(),r=v.useRef({x:0,y:0}),o=v.useRef(null),p=v.useRef([]),M=v.useRef(new Map);return v.useEffect(()=>{const s=_.current,n=s.getContext("2d"),Y=X==="hexagon",E=X==="triangle",w=t*1.5,m=t*Math.sqrt(3),V=()=>{s.width=s.offsetWidth,s.height=s.offsetHeight,U.current=Math.ceil(s.width/t)+1,Z.current=Math.ceil(s.height/t)+1};window.addEventListener("resize",V),V();const C=(l,e,c)=>{n.beginPath();for(let u=0;u<6;u++){const h=Math.PI/3*u,d=l+c*Math.cos(h),f=e+c*Math.sin(h);u===0?n.moveTo(d,f):n.lineTo(d,f)}n.closePath()},G=(l,e,c)=>{n.beginPath(),n.arc(l,e,c/2,0,Math.PI*2),n.closePath()},O=(l,e,c,u)=>{n.beginPath(),u?(n.moveTo(l,e+c/2),n.lineTo(l+c/2,e-c/2),n.lineTo(l-c/2,e-c/2)):(n.moveTo(l,e-c/2),n.lineTo(l+c/2,e+c/2),n.lineTo(l-c/2,e+c/2)),n.closePath()},A=()=>{if(n.clearRect(0,0,s.width,s.height),Y){const e=Math.floor(r.current.x/w),c=(r.current.x%w+w)%w,u=(r.current.y%m+m)%m,h=Math.ceil(s.width/w)+3,d=Math.ceil(s.height/m)+3;for(let f=-2;f<h;f++)for(let g=-2;g<d;g++){const i=f*w+c,a=g*m+((f+e)%2!==0?m/2:0)+u,x=`${f},${g}`,R=M.current.get(x);R&&(n.globalAlpha=R,C(i,a,t),n.fillStyle=b,n.fill(),n.globalAlpha=1),C(i,a,t),n.strokeStyle=k,n.stroke()}}else if(E){const e=t/2,c=Math.floor(r.current.x/e),u=Math.floor(r.current.y/t),h=(r.current.x%e+e)%e,d=(r.current.y%t+t)%t,f=Math.ceil(s.width/e)+4,g=Math.ceil(s.height/t)+4;for(let i=-2;i<f;i++)for(let a=-2;a<g;a++){const x=i*e+h,R=a*t+t/2+d,I=((i+c+a+u)%2+2)%2!==0,S=`${i},${a}`,N=M.current.get(S);N&&(n.globalAlpha=N,O(x,R,t,I),n.fillStyle=b,n.fill(),n.globalAlpha=1),O(x,R,t,I),n.strokeStyle=k,n.stroke()}}else if(X==="circle"){const e=(r.current.x%t+t)%t,c=(r.current.y%t+t)%t,u=Math.ceil(s.width/t)+3,h=Math.ceil(s.height/t)+3;for(let d=-2;d<u;d++)for(let f=-2;f<h;f++){const g=d*t+t/2+e,i=f*t+t/2+c,a=`${d},${f}`,x=M.current.get(a);x&&(n.globalAlpha=x,G(g,i,t),n.fillStyle=b,n.fill(),n.globalAlpha=1),G(g,i,t),n.strokeStyle=k,n.stroke()}}else{const e=(r.current.x%t+t)%t,c=(r.current.y%t+t)%t,u=Math.ceil(s.width/t)+3,h=Math.ceil(s.height/t)+3;for(let d=-2;d<u;d++)for(let f=-2;f<h;f++){const g=d*t+e,i=f*t+c,a=`${d},${f}`,x=M.current.get(a);x&&(n.globalAlpha=x,n.fillStyle=b,n.fillRect(g,i,t,t),n.globalAlpha=1),n.strokeStyle=k,n.strokeRect(g,i,t,t)}}const l=n.createRadialGradient(s.width/2,s.height/2,0,s.width/2,s.height/2,Math.sqrt(s.width**2+s.height**2)/2);l.addColorStop(0,"rgba(0, 0, 0, 0)"),n.fillStyle=l,n.fillRect(0,0,s.width,s.height)},H=()=>{const l=Math.max(L,.1),e=Y?w*2:t,c=Y?m:E?t*2:t;switch(P){case"right":r.current.x=(r.current.x-l+e)%e;break;case"left":r.current.x=(r.current.x+l+e)%e;break;case"up":r.current.y=(r.current.y+l+c)%c;break;case"down":r.current.y=(r.current.y-l+c)%c;break;case"diagonal":r.current.x=(r.current.x-l+e)%e,r.current.y=(r.current.y-l+c)%c;break}T(),A(),j.current=requestAnimationFrame(H)},T=()=>{const l=new Map;if(o.current&&l.set(`${o.current.x},${o.current.y}`,1),y>0)for(let e=0;e<p.current.length;e++){const c=p.current[e],u=`${c.x},${c.y}`;l.has(u)||l.set(u,(p.current.length-e)/(p.current.length+1))}for(const[e]of l)M.current.has(e)||M.current.set(e,0);for(const[e,c]of M.current){const u=l.get(e)||0,h=c+(u-c)*.15;h<.005?M.current.delete(e):M.current.set(e,h)}},K=l=>{const e=s.getBoundingClientRect(),c=l.clientX-e.left,u=l.clientY-e.top;if(Y){const h=Math.floor(r.current.x/w),d=(r.current.x%w+w)%w,f=(r.current.y%m+m)%m,g=c-d,i=u-f,a=Math.round(g/w),x=(a+h)%2!==0?m/2:0,R=Math.round((i-x)/m);(!o.current||o.current.x!==a||o.current.y!==R)&&(o.current&&y>0&&(p.current.unshift({...o.current}),p.current.length>y&&(p.current.length=y)),o.current={x:a,y:R})}else if(E){const h=t/2,d=(r.current.x%h+h)%h,f=(r.current.y%t+t)%t,g=c-d,i=u-f,a=Math.round(g/h),x=Math.floor(i/t);(!o.current||o.current.x!==a||o.current.y!==x)&&(o.current&&y>0&&(p.current.unshift({...o.current}),p.current.length>y&&(p.current.length=y)),o.current={x:a,y:x})}else if(X==="circle"){const h=(r.current.x%t+t)%t,d=(r.current.y%t+t)%t,f=c-h,g=u-d,i=Math.round(f/t),a=Math.round(g/t);(!o.current||o.current.x!==i||o.current.y!==a)&&(o.current&&y>0&&(p.current.unshift({...o.current}),p.current.length>y&&(p.current.length=y)),o.current={x:i,y:a})}else{const h=(r.current.x%t+t)%t,d=(r.current.y%t+t)%t,f=c-h,g=u-d,i=Math.floor(f/t),a=Math.floor(g/t);(!o.current||o.current.x!==i||o.current.y!==a)&&(o.current&&y>0&&(p.current.unshift({...o.current}),p.current.length>y&&(p.current.length=y)),o.current={x:i,y:a})}},B=()=>{o.current&&y>0&&(p.current.unshift({...o.current}),p.current.length>y&&(p.current.length=y)),o.current=null};return s.addEventListener("mousemove",K),s.addEventListener("mouseleave",B),j.current=requestAnimationFrame(H),()=>{window.removeEventListener("resize",V),cancelAnimationFrame(j.current),s.removeEventListener("mousemove",K),s.removeEventListener("mouseleave",B)}},[P,L,k,b,t,X,y]),q.jsx("canvas",{ref:_,className:`${z["shapegrid-canvas"]} ${Q}`})};J.__docgenInfo={description:"",methods:[],displayName:"ShapeGrid",props:{direction:{defaultValue:{value:"'right'",computed:!1},required:!1},speed:{defaultValue:{value:"1",computed:!1},required:!1},borderColor:{defaultValue:{value:"'#999'",computed:!1},required:!1},squareSize:{defaultValue:{value:"40",computed:!1},required:!1},hoverFillColor:{defaultValue:{value:"'#222'",computed:!1},required:!1},shape:{defaultValue:{value:"'square'",computed:!1},required:!1},hoverTrailAmount:{defaultValue:{value:"0",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1}}};const nt={title:"ReactBits/Backgrounds/ShapeGrid",component:J,parameters:{layout:"fullscreen"},tags:["autodocs"]},$={args:{direction:"right",speed:1,borderColor:"#999",squareSize:40,hoverFillColor:"#222",shape:"square",hoverTrailAmount:0}};var W,D,F;$.parameters={...$.parameters,docs:{...(W=$.parameters)==null?void 0:W.docs,source:{originalSource:`{
2
2
  args: {
3
3
  direction: 'right',
4
4
  speed: 1,