@stfrigerio/sito-template 0.1.76 → 0.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
- package/storybook-static/assets/{ASCIIText.stories-jyeGS_ve.js → ASCIIText.stories-CAN16AEY.js} +1 -1
- package/storybook-static/assets/{AllAtoms.stories-CemMq1qd.js → AllAtoms.stories-DRGVjxhg.js} +1 -1
- package/storybook-static/assets/{AnimatedContent.stories-DffuqOCI.js → AnimatedContent.stories-C2U9Faty.js} +1 -1
- package/storybook-static/assets/{AnimatedList.stories-DuwFQFkj.js → AnimatedList.stories-Dp1Ya8b0.js} +1 -1
- package/storybook-static/assets/{Antigravity.stories-DcbmxH5R.js → Antigravity.stories-C2Bde5L9.js} +1 -1
- package/storybook-static/assets/{ArrayInput.stories-DvZKodHx.js → ArrayInput.stories-BTiKcCDH.js} +1 -1
- package/storybook-static/assets/{Aurora.stories-BQOm4LDu.js → Aurora.stories-BwEDe4qb.js} +1 -1
- package/storybook-static/assets/{Beams.stories-CzdaOr3E.js → Beams.stories-nIxKNrpc.js} +1 -1
- package/storybook-static/assets/{BlobCursor.stories-DKhEEylD.js → BlobCursor.stories-CyVhuFRR.js} +1 -1
- package/storybook-static/assets/{BlurText.stories-BXn21RBW.js → BlurText.stories-D5vEHUr3.js} +1 -1
- package/storybook-static/assets/{BooleansHeatmap.stories-wo9Pvb36.js → BooleansHeatmap.stories-DCAgsGDe.js} +1 -1
- package/storybook-static/assets/{BorderGlow.stories-BVoYeD5v.js → BorderGlow.stories-nELrDs05.js} +1 -1
- package/storybook-static/assets/{BubbleMenu.stories-dqsJINuc.js → BubbleMenu.stories-DwVh3hon.js} +1 -1
- package/storybook-static/assets/{Button-C8DVgvIi.js → Button-CzEsoYbA.js} +1 -1
- package/storybook-static/assets/{Button.stories-X7b76nlX.js → Button.stories-g0uRxSKm.js} +1 -1
- package/storybook-static/assets/{Calendar.stories-D0Uw8SPv.js → Calendar.stories-CReDFTFG.js} +1 -1
- package/storybook-static/assets/{Card-C1CU1aJ4.js → Card-BC1JBcMp.js} +1 -1
- package/storybook-static/assets/{Card.stories-pOZ_I_3_.js → Card.stories-DMXKDrjL.js} +1 -1
- package/storybook-static/assets/{CardNav.stories-OkPJO-Ni.js → CardNav.stories-DFnuL51i.js} +1 -1
- package/storybook-static/assets/{Carousel.stories-D3jZVWZF.js → Carousel.stories-Bf7l7zA0.js} +1 -1
- package/storybook-static/assets/{Checkbox-CjfwEqdP.js → Checkbox-CZHrsOdB.js} +1 -1
- package/storybook-static/assets/{Checkbox.stories-BklK9_jk.js → Checkbox.stories-Dv7gxTEr.js} +1 -1
- package/storybook-static/assets/{ChromaGrid.stories-Byrw6uQA.js → ChromaGrid.stories-CMfVxkkr.js} +1 -1
- package/storybook-static/assets/{CircularGallery.stories-fLTqpbyo.js → CircularGallery.stories-CuHeDn6H.js} +1 -1
- package/storybook-static/assets/{CircularText.stories-BA-dJIzs.js → CircularText.stories-D3qEBi7V.js} +1 -1
- package/storybook-static/assets/{ClickSpark.stories-DoEJmAGn.js → ClickSpark.stories-hRHKlgyZ.js} +1 -1
- package/storybook-static/assets/{ColorBends.stories-DlI5eNgp.js → ColorBends.stories-a0p7haNt.js} +1 -1
- package/storybook-static/assets/{CountUp.stories-DC06me0h.js → CountUp.stories-CkenhDLf.js} +1 -1
- package/storybook-static/assets/{Counter.stories-B0_x7SnO.js → Counter.stories-BIDGgLqS.js} +1 -1
- package/storybook-static/assets/{Crosshair.stories-MQfVFGQ7.js → Crosshair.stories-Bwfjmhbz.js} +1 -1
- package/storybook-static/assets/{Cubes.stories-CB5LyVAa.js → Cubes.stories-DHm5SLpR.js} +1 -1
- package/storybook-static/assets/{CurvedLoop.stories-pad6C9il.js → CurvedLoop.stories-CJ5c-bCz.js} +1 -1
- package/storybook-static/assets/{DarkVeil.stories-CjoNpRrA.js → DarkVeil.stories-BQqwTv41.js} +1 -1
- package/storybook-static/assets/{DateInput-BOP5MJAA.js → DateInput-CIJZfbN4.js} +1 -1
- package/storybook-static/assets/{DateInput.stories-DpytWXTi.js → DateInput.stories-DFMuh4Wf.js} +1 -1
- package/storybook-static/assets/{DecayCard.stories-Ci8mCDU2.js → DecayCard.stories-BR1hXUEk.js} +1 -1
- package/storybook-static/assets/{DecryptedText.stories-_OcmqlGZ.js → DecryptedText.stories-I0Zns_UO.js} +1 -1
- package/storybook-static/assets/{Dither.stories-CoakUTGz.js → Dither.stories-BY9eSI-i.js} +1 -1
- package/storybook-static/assets/{Dock.stories-RZsDkvOK.js → Dock.stories-BGtbSGdN.js} +1 -1
- package/storybook-static/assets/{EditFAB.stories-BYgIa7Ft.js → EditFAB.stories-BD4vmfXF.js} +1 -1
- package/storybook-static/assets/{EvilEye.stories-C9-B_l7O.js → EvilEye.stories-ByTTfAJM.js} +1 -1
- package/storybook-static/assets/{FadeContent.stories-BSUfS-Pa.js → FadeContent.stories-Cap8qc5H.js} +1 -1
- package/storybook-static/assets/{FaultyTerminal.stories-BaztxBZy.js → FaultyTerminal.stories-BOCyN79M.js} +1 -1
- package/storybook-static/assets/{Fbo-BckR5Q0w.js → Fbo-C2hv63gy.js} +1 -1
- package/storybook-static/assets/{FloatingLines.stories-B48w4g-P.js → FloatingLines.stories-G3s09BJl.js} +1 -1
- package/storybook-static/assets/{FlowingMenu.stories-CGiY3eRk.js → FlowingMenu.stories-CVY2MRto.js} +1 -1
- package/storybook-static/assets/{FluidGlass.stories-CHa9ViPX.js → FluidGlass.stories-BenQvmzA.js} +1 -1
- package/storybook-static/assets/{Folder.stories-BolWKAzo.js → Folder.stories-DVrewKHX.js} +1 -1
- package/storybook-static/assets/{FuzzyText.stories-CSRaTOLX.js → FuzzyText.stories-B5SQlD8u.js} +1 -1
- package/storybook-static/assets/{Galaxy.stories-CIg8QFfb.js → Galaxy.stories-BgC2gENi.js} +1 -1
- package/storybook-static/assets/{GhostCursor.stories-BQpjOfNR.js → GhostCursor.stories-D2IeZnFc.js} +1 -1
- package/storybook-static/assets/{GlareHover.stories-Di_VEr2R.js → GlareHover.stories-DTFMcE4T.js} +1 -1
- package/storybook-static/assets/{GlassSurface.stories-DAkIcgOf.js → GlassSurface.stories-aa36tQOs.js} +1 -1
- package/storybook-static/assets/{GlitchText.stories-BxcuVmW5.js → GlitchText.stories-DrVJa_iG.js} +1 -1
- package/storybook-static/assets/{GooeyNav.stories-CTW-U7xs.js → GooeyNav.stories-CK-i5TYG.js} +1 -1
- package/storybook-static/assets/{GradientBlinds.stories-fBqlT4g6.js → GradientBlinds.stories-Z5YmW-kF.js} +1 -1
- package/storybook-static/assets/{GradientText.stories-BZerGqdF.js → GradientText.stories-0Yw6cjx7.js} +1 -1
- package/storybook-static/assets/{Grainient.stories-CzqvhFb3.js → Grainient.stories-JZylDRjp.js} +1 -1
- package/storybook-static/assets/{GridMotion.stories-CfjnoneJ.js → GridMotion.stories-CMqBnFoX.js} +1 -1
- package/storybook-static/assets/{ImageSlideshow.stories-DQvn07Dy.js → ImageSlideshow.stories-CUMjObLi.js} +1 -1
- package/storybook-static/assets/{Iridescence.stories-DZ0dT4zy.js → Iridescence.stories-BiJ23RkZ.js} +1 -1
- package/storybook-static/assets/{LaserFlow.stories-CZg0PMHs.js → LaserFlow.stories-DyVGQfLI.js} +1 -1
- package/storybook-static/assets/{LetterGlitch.stories-BNqR58lP.js → LetterGlitch.stories-Dg5UyDmn.js} +1 -1
- package/storybook-static/assets/{LightPillar.stories-DkmTFDSR.js → LightPillar.stories-CeRBWebc.js} +1 -1
- package/storybook-static/assets/{LightRays.stories-CYtKgl66.js → LightRays.stories-U36Z_7VB.js} +1 -1
- package/storybook-static/assets/{Lightning.stories-CI_IBNog.js → Lightning.stories-isM2FE_A.js} +1 -1
- package/storybook-static/assets/{LineWaves.stories-19E6lLvu.js → LineWaves.stories-Bu4iHjAe.js} +1 -1
- package/storybook-static/assets/{LiquidChrome.stories-Ik5wMITA.js → LiquidChrome.stories-DiXhJV1-.js} +1 -1
- package/storybook-static/assets/{LiquidEther.stories-cRVhMCnV.js → LiquidEther.stories-DYbFymig.js} +1 -1
- package/storybook-static/assets/{LoadingSpinner-B3jiWJ5i.js → LoadingSpinner-DbnnzL33.js} +1 -1
- package/storybook-static/assets/{LoadingSpinner.stories-7o51GOVb.js → LoadingSpinner.stories-COkS9D4a.js} +1 -1
- package/storybook-static/assets/{MagicRings.stories-BdhXUzZR.js → MagicRings.stories-D2_dxXz3.js} +1 -1
- package/storybook-static/assets/{Magnet.stories-BP_O9O9B.js → Magnet.stories-CXMp90QP.js} +1 -1
- package/storybook-static/assets/{MagnetLines.stories-DO5Vf2eN.js → MagnetLines.stories-DBb0fXSr.js} +1 -1
- package/storybook-static/assets/{Masonry.stories-CbvsjL9N.js → Masonry.stories-Bft2Irkr.js} +1 -1
- package/storybook-static/assets/{MetaBalls.stories-mzBfHDeT.js → MetaBalls.stories-z3baaVT0.js} +1 -1
- package/storybook-static/assets/{MetallicPaint.stories-DwrE7et4.js → MetallicPaint.stories-CcMqTJds.js} +1 -1
- package/storybook-static/assets/{MoodChart.stories-BW4k1gRH.js → MoodChart.stories-BR7FmD6u.js} +1 -1
- package/storybook-static/assets/{MotionConfigContext-C6KIXCCK.js → MotionConfigContext-CFyliiaM.js} +1 -1
- package/storybook-static/assets/{Navbar.stories-MCOlCO7j.js → Navbar.stories-BgpPNytt.js} +1 -1
- package/storybook-static/assets/{Noise.stories-BX29bXzI.js → Noise.stories-fbyosJec.js} +1 -1
- package/storybook-static/assets/{NumberStepper-CGuZE3IG.js → NumberStepper-8cni0D0d.js} +1 -1
- package/storybook-static/assets/{NumberStepper.stories-CM1-xjqx.js → NumberStepper.stories-C0PYKy7p.js} +1 -1
- package/storybook-static/assets/{Orb.stories-C1U1NFn1.js → Orb.stories-DTjKIRbB.js} +1 -1
- package/storybook-static/assets/{OrbitImages.stories-_U1a6MJ2.js → OrbitImages.stories-BWJkD3sE.js} +1 -1
- package/storybook-static/assets/{PieChart.stories-U46uc40e.js → PieChart.stories-C_Vy5CDv.js} +1 -1
- package/storybook-static/assets/{PixelBlast.stories--1zBJff-.js → PixelBlast.stories-D7MArtMI.js} +1 -1
- package/storybook-static/assets/{PixelCard.stories-CKIsLyL5.js → PixelCard.stories-DcDl8RHc.js} +1 -1
- package/storybook-static/assets/{PixelSnow.stories-CR4xLE4U.js → PixelSnow.stories-Bw5QOROR.js} +1 -1
- package/storybook-static/assets/{PixelTransition.stories-Dd9P0Ope.js → PixelTransition.stories-DstxQxN0.js} +1 -1
- package/storybook-static/assets/{Plasma.stories-M-hYDX27.js → Plasma.stories-BZExPMRR.js} +1 -1
- package/storybook-static/assets/{Prism.stories-DwfbD3cn.js → Prism.stories-C4g9fQvm.js} +1 -1
- package/storybook-static/assets/{PrismaticBurst.stories-CvPmYAX_.js → PrismaticBurst.stories-Dj18a10c.js} +1 -1
- package/storybook-static/assets/{ProfileCard.stories-DP2eHRdZ.js → ProfileCard.stories-CR3_Bja7.js} +1 -1
- package/storybook-static/assets/{QuantifiableHabitsChart.stories-RglnD2R_.js → QuantifiableHabitsChart.stories-Cy3rQowQ.js} +1 -1
- package/storybook-static/assets/{Radar.stories-D-LhC9r4.js → Radar.stories-j4rdU9TF.js} +1 -1
- package/storybook-static/assets/{Ribbons.stories-CJuxGieY.js → Ribbons.stories-lB4uNezs.js} +1 -1
- package/storybook-static/assets/{RippleGrid.stories-D_3EPPTM.js → RippleGrid.stories-DqEVml_y.js} +1 -1
- package/storybook-static/assets/{RotatingText.stories-DYP0oyH6.js → RotatingText.stories-Cej8-VcB.js} +1 -1
- package/storybook-static/assets/{ScrollFloat.stories-Dzwz8uzu.js → ScrollFloat.stories-CQ5Fsjxi.js} +1 -1
- package/storybook-static/assets/{ScrollReveal.stories-C_EqHFb_.js → ScrollReveal.stories-Cy8EVZkw.js} +1 -1
- package/storybook-static/assets/{ScrollVelocity.stories-YdJitu_P.js → ScrollVelocity.stories-DjQBi2C8.js} +1 -1
- package/storybook-static/assets/{SearchBar.stories-BJbLKP2g.js → SearchBar.stories-B893-BA0.js} +1 -1
- package/storybook-static/assets/{SearchableDropdown-fnf6ZW_h.js → SearchableDropdown-DA44b3_Q.js} +1 -1
- package/storybook-static/assets/{SearchableDropdown.stories-CJ8_zZjz.js → SearchableDropdown.stories-IcQsEwL-.js} +1 -1
- package/storybook-static/assets/SelectInput-BU8RV4V4.css +1 -0
- package/storybook-static/assets/{SelectInput-DXau1Dph.js → SelectInput-zadEZpDI.js} +1 -1
- package/storybook-static/assets/{SelectInput.stories-DuPwC-pM.js → SelectInput.stories-BXN5Qngu.js} +1 -1
- package/storybook-static/assets/{ShapeBlur.stories-BzSypzdO.js → ShapeBlur.stories-DanNCmFJ.js} +1 -1
- package/storybook-static/assets/{ShapeGrid.stories-CDkUZpth.js → ShapeGrid.stories-bj6mmNeF.js} +1 -1
- package/storybook-static/assets/{ShinyText.stories-CGKy0Lsc.js → ShinyText.stories-DZCLKCXK.js} +1 -1
- package/storybook-static/assets/{Silk.stories-CChDBqxY.js → Silk.stories-Cb9mE2Hj.js} +1 -1
- package/storybook-static/assets/{SleepChart.stories-WRltn-Jx.js → SleepChart.stories-BsnisMa9.js} +1 -1
- package/storybook-static/assets/{Slider-BeoCTJYT.js → Slider-D_4YKC2Y.js} +1 -1
- package/storybook-static/assets/{Slider.stories-DVeQHWs3.js → Slider.stories-8Hdg_mMo.js} +1 -1
- package/storybook-static/assets/{SoftAurora.stories-DrO_ij-V.js → SoftAurora.stories-kKJ2b_Ur.js} +1 -1
- package/storybook-static/assets/{SoundDemo.stories-f1ehfLPn.js → SoundDemo.stories-DfpiNWa7.js} +1 -1
- package/storybook-static/assets/{SplashCursor.stories-BECToVQy.js → SplashCursor.stories-DEK6Z0xq.js} +1 -1
- package/storybook-static/assets/{SpotlightCard.stories-Ck8nALce.js → SpotlightCard.stories-BlItI_g6.js} +1 -1
- package/storybook-static/assets/{Stack.stories-BdN1_7tM.js → Stack.stories-okh30gCA.js} +1 -1
- package/storybook-static/assets/{StaggeredMenu.stories-CTDmplGV.js → StaggeredMenu.stories-DbW10UGC.js} +1 -1
- package/storybook-static/assets/{StarBorder.stories-Bwpc59IM.js → StarBorder.stories-lB-mSYuP.js} +1 -1
- package/storybook-static/assets/{SunburstChart.stories-CNOZJwAZ.js → SunburstChart.stories-CUQO5n-z.js} +1 -1
- package/storybook-static/assets/{Table.stories-Cd6TvRiK.js → Table.stories-CI2Lq6v3.js} +1 -1
- package/storybook-static/assets/{Tabs.stories-BoVk_o27.js → Tabs.stories-ID_jWavD.js} +1 -1
- package/storybook-static/assets/{TargetCursor.stories-DdklJLjf.js → TargetCursor.stories-B98zAoY0.js} +1 -1
- package/storybook-static/assets/{TextArea-BoTwFvlF.js → TextArea-C9Aq9zxZ.js} +1 -1
- package/storybook-static/assets/{TextArea.stories-4mPBw5bl.js → TextArea.stories-C_VBUKyL.js} +1 -1
- package/storybook-static/assets/{TextCursor.stories-Dbz8i54O.js → TextCursor.stories-CX8nKLLU.js} +1 -1
- package/storybook-static/assets/{TextInput-DTyHhomU.js → TextInput-BoxLFzTk.js} +1 -1
- package/storybook-static/assets/{TextInput.stories-CjQMs9vK.js → TextInput.stories-BzWh4NqX.js} +1 -1
- package/storybook-static/assets/{TextPressure.stories-Da2afCXS.js → TextPressure.stories-0LcC3gwS.js} +1 -1
- package/storybook-static/assets/{TextType.stories-DP8FaemU.js → TextType.stories-vQijf7Fh.js} +1 -1
- package/storybook-static/assets/{ThemeSwitcher.stories-BOdoMWBr.js → ThemeSwitcher.stories-htv9l1m1.js} +1 -1
- package/storybook-static/assets/{Threads.stories-Bsyw4BNf.js → Threads.stories-d29kyOOr.js} +1 -1
- package/storybook-static/assets/{TimeInput.stories-3qbOV7Ls.js → TimeInput.stories-igCFdI2N.js} +1 -1
- package/storybook-static/assets/{Toggle-Bwvgtrvs.js → Toggle-DjamEjzj.js} +1 -1
- package/storybook-static/assets/{Toggle.stories-BZa844c0.js → Toggle.stories-BF1yeXWA.js} +1 -1
- package/storybook-static/assets/{ToggleButton-BINAb7TQ.js → ToggleButton-BUoy14By.js} +1 -1
- package/storybook-static/assets/{ToggleButton.stories-GWQ4L4ac.js → ToggleButton.stories-SWs4TTv0.js} +1 -1
- package/storybook-static/assets/{TrueFocus.stories-CiK6TsZ_.js → TrueFocus.stories-8DtWKBV2.js} +1 -1
- package/storybook-static/assets/{VariableProximity.stories-DE-_f9_v.js → VariableProximity.stories-BSbzaWRj.js} +1 -1
- package/storybook-static/assets/{Waves.stories-Bah9ng0K.js → Waves.stories-rUGOxeuC.js} +1 -1
- package/storybook-static/assets/{check-bvk6C-TA.js → check-Dq_aEYsO.js} +1 -1
- package/storybook-static/assets/{chevron-down-Dnj3nVPe.js → chevron-down-ve2JpfhS.js} +1 -1
- package/storybook-static/assets/{chevron-right-FoZPyhXE.js → chevron-right-BBDTkyhE.js} +1 -1
- package/storybook-static/assets/client-ukgowvey.js +1 -0
- package/storybook-static/assets/{createLucideIcon-DvNKQIkb.js → createLucideIcon-BM4zhNrq.js} +1 -1
- package/storybook-static/assets/{download-BEyY_c4w.js → download-jjjb1SND.js} +1 -1
- package/storybook-static/assets/{folder-Dr-EdDO1.js → folder-B8Xf_S6e.js} +1 -1
- package/storybook-static/assets/{iconBase-daIQ2k2U.js → iconBase-DqqHGLu2.js} +1 -1
- package/storybook-static/assets/{iframe-BmJYCQaV.js → iframe-gZo2MXmI.js} +3 -3
- package/storybook-static/assets/{index-CCV231j6.js → index-BBC3qpWH.js} +1 -1
- package/storybook-static/assets/{index-GkLzrRJX.js → index-CnBOj3gc.js} +1 -1
- package/storybook-static/assets/{index-8y2D1xIF.js → index-MVch72cm.js} +1 -1
- package/storybook-static/assets/{proxy-MAU_yIzM.js → proxy-kI6f2DWO.js} +1 -1
- package/storybook-static/assets/{react-18-DCqWj-iG.js → react-18-BrpFS0dN.js} +1 -1
- package/storybook-static/assets/{react-three-fiber.esm-J8Ycqtkj.js → react-three-fiber.esm-IUdAdhlX.js} +1 -1
- package/storybook-static/assets/{search-T1_DPJWy.js → search-C4-LKbEC.js} +1 -1
- package/storybook-static/assets/{settings-D0WRQxad.js → settings-DTq0tcCA.js} +1 -1
- package/storybook-static/assets/{sun-D1G2h9I4.js → sun-DPttwspc.js} +1 -1
- package/storybook-static/assets/{trash-2-B7B7imFa.js → trash-2-BtZ70InV.js} +1 -1
- package/storybook-static/assets/{use-animation-frame-C3OkOmFg.js → use-animation-frame-n9NDjnpE.js} +1 -1
- package/storybook-static/assets/{use-in-view-BUiyIXbb.js → use-in-view-BdoFJdsB.js} +1 -1
- package/storybook-static/assets/{use-motion-value-D1yqdG0l.js → use-motion-value-B7WuPdBk.js} +1 -1
- package/storybook-static/assets/{use-spring-BwMrSe4y.js → use-spring-CiIl7xIy.js} +1 -1
- package/storybook-static/assets/{use-transform-CTCcIVjx.js → use-transform-fbMCilo3.js} +1 -1
- package/storybook-static/assets/{useSound-C72L733V.js → useSound-D0jddJxs.js} +1 -1
- package/storybook-static/assets/{users-DMXSY-kZ.js → users-B9Qro682.js} +1 -1
- package/storybook-static/assets/{x-DzTJWbpQ.js → x-BBEombe_.js} +1 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/assets/SelectInput-BTPptV1H.css +0 -1
- package/storybook-static/assets/client-Dyko2a81.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as le,j as Ne}from"./iframe-
|
|
1
|
+
import{r as le,j as Ne}from"./iframe-gZo2MXmI.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-
|
|
1
|
+
import{r as n,j as te}from"./iframe-gZo2MXmI.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;
|
package/storybook-static/assets/{ProfileCard.stories-DP2eHRdZ.js → ProfileCard.stories-CR3_Bja7.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as ve,r as o,j as r}from"./iframe-
|
|
1
|
+
import{R as ve,r as o,j as r}from"./iframe-gZo2MXmI.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"}},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 d,j as r}from"./iframe-BmJYCQaV.js";import{s as Y}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_cn90n_1",Ce="_controls_cn90n_19",qe="_viewToggle_cn90n_27",Le="_viewButton_cn90n_36",$e="_active_cn90n_57",Ne="_viewIcon_cn90n_63",Ae="_viewLabel_cn90n_68",Ve="_aggregationToggle_cn90n_78",Ie="_aggregationButton_cn90n_87",We="_aggregationIcon_cn90n_114",Be="_aggregationLabel_cn90n_119",Re="_legend_cn90n_129",Fe="_compactLegend_cn90n_140",He="_legendItem_cn90n_145",Oe="_legendEmoji_cn90n_150",ze="_legendLabel_cn90n_154",Ye="_inactive_cn90n_178",Qe="_legendColor_cn90n_188",Ue="_chart_cn90n_227",Pe="_gridLine_cn90n_235",Ge="_line_cn90n_241",Ke="_xAxis_cn90n_248",Xe="_yAxis_cn90n_249",Je="_dataPoint_cn90n_268",Ze="_tooltip_cn90n_278",et="_visible_cn90n_299",tt="_tooltipHeader_cn90n_304",at="_tooltipEmoji_cn90n_315",nt="_tooltipDot_cn90n_320",rt="_tooltipInfo_cn90n_327",ot="_tooltipDate_cn90n_333",st="_tooltipValue_cn90n_339",t={container:Ee,controls:Ce,viewToggle:qe,viewButton:Le,active:$e,viewIcon:Ne,viewLabel:Ae,aggregationToggle:Ve,aggregationButton:Ie,aggregationIcon:We,aggregationLabel:Be,legend:Re,compactLegend:Fe,legendItem:He,legendEmoji:Oe,legendLabel:ze,inactive:Ye,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},it={Exercise:"#6BCB77",Meditation:"#4D96FF",Reading:"#FFB319",Water:"#00D9FF",Steps:"#FF6B6B",Sleep:"#9B59B6",Calories:"#FF9F1C",Study:"#C774E8"},me=({data:n,width:_=800,height:v=400,defaultViewType:M="daily",periodType:b="month",habitColors:U={},habitEmojis:P={},onDataPointClick:B,hideControls:ge=!1,compactLegend:pe=!1})=>{const D=d.useRef(null),he=d.useRef(null),[m,ye]=d.useState(M),[E,G]=d.useState([]),[S,K]=d.useState(null),[h,C]=d.useState(null),[q,X]=d.useState("average"),y=d.useMemo(()=>({top:20,right:20,bottom:50,left:50}),[]),R=_-y.left-y.right,F=v-y.top-y.bottom,T=d.useMemo(()=>Object.keys(n).filter(e=>e!=="dates"),[n]);d.useEffect(()=>{G(T)},[T]),d.useEffect(()=>{const e=()=>{C(null)};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[]);const fe=d.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=d.useCallback(e=>U[e]||it[e]||`hsl(${Math.abs(e.split("").reduce((o,s)=>o+s.charCodeAt(0),0))%360}, 70%, 50%)`,[U]),f=d.useMemo(()=>{if(m==="daily"||!n.dates.length)return n;const e={dates:[]},o=new Map;return n.dates.forEach((s,g)=>{const w=new Date(s);let i;switch(m){case"weekly":{const c=new Date(w),p=c.getDay(),L=c.getDate()-p+(p===0?-6:1);c.setDate(L),i=c.toISOString().split("T")[0];break}case"monthly":i=`${w.getFullYear()}-${String(w.getMonth()+1).padStart(2,"0")}-01`;break;case"quarterly":{const p=(Math.floor(w.getMonth()/3)+1-1)*3;i=new Date(w.getFullYear(),p,1).toISOString().split("T")[0];break}default:i=s}o.has(i)||o.set(i,[]),o.get(i).push(g)}),e.dates=Array.from(o.keys()).sort(),T.forEach(s=>{e[s]=e.dates.map(g=>{const i=o.get(g).map(c=>n[s][c]).filter(c=>typeof c=="number"&&!isNaN(c));return i.length===0?0:Math.round(q==="sum"?i.reduce((c,p)=>c+p,0):i.reduce((c,p)=>c+p,0)/i.length)})}),e},[n,m,T,q]),_e=e=>{G(o=>o.includes(e)?o.filter(s=>s!==e):[...o,e])};d.useEffect(()=>{if(!D.current||f.dates.length===0)return;const e=Y(D.current);e.selectAll("*").remove(),e.append("rect").attr("width",_).attr("height",v).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)),g=be().domain(Me(s)).range([0,R]),w=Math.max(...E.flatMap(a=>f[a].filter(u=>typeof u=="number"))),i=je().domain([0,w*1.1]).range([F,0]);o.selectAll(".grid-line-y").data(i.ticks(5)).enter().append("line").attr("class",t.gridLine).attr("x1",0).attr("y1",a=>i(a)).attr("x2",R).attr("y2",a=>i(a));const c=Se().x(a=>g(a[0])).y(a=>i(a[1])).curve(Te);E.forEach(a=>{const u=s.map((l,x)=>[l,f[a][x]]).filter(l=>typeof l[1]=="number");o.append("path").datum(u).attr("class",t.line).attr("d",c).attr("stroke",j(a)).attr("opacity",S&&S!==a?.3:1),o.selectAll(`.hover-circle-${a}`).data(u).enter().append("circle").attr("cx",l=>g(l[0])).attr("cy",l=>i(l[1])).attr("r",10).attr("fill","transparent").style("cursor","pointer").on("mouseenter",function(l,x){var Z;const[k,$]=x,z=(Z=D.current)==null?void 0:Z.getBoundingClientRect();z&&C({habit:a,date:k.toISOString().split("T")[0],value:$,x:g(k)+y.left+z.left,y:i($)+y.top+z.top}),Y(o.node()).selectAll(`.circle-${a}-${s.indexOf(k)}`).attr("r",6)}).on("mouseleave",function(l,x){C(null),Y(o.node()).selectAll('[class*="circle-'+a+'"]').attr("r",4)}).on("click",function(l,x){const[k,$]=x;B&&B(a,k.toISOString().split("T")[0],$)}),o.selectAll(`.circle-${a}`).data(u).enter().append("circle").attr("class",(l,x)=>`${t.dataPoint} circle-${a}-${x}`).attr("cx",l=>g(l[0])).attr("cy",l=>i(l[1])).attr("r",4).attr("fill",j(a)).attr("opacity",S&&S!==a?.3:1).style("pointer-events","none")});const p=a=>{const u=new Date(a);u.setHours(0,0,0,0),u.setDate(u.getDate()+3-(u.getDay()+6)%7);const l=new Date(u.getFullYear(),0,4);return 1+Math.round(((u.getTime()-l.getTime())/864e5-3+(l.getDay()+6)%7)/7)},L=(()=>{switch(m){case"daily":return Q("%m-%d");case"weekly":return a=>`W${p(a).toString().padStart(2,"0")}`;case"monthly":return Q("%b");case"quarterly":return a=>`Q${Math.floor(a.getMonth()/3)+1}`;default:return Q("%m-%d")}})(),J=(()=>{switch(m){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(g).tickFormat(a=>L(a));m==="quarterly"?O.tickValues(s):J&&O.ticks(J);const xe=o.append("g").attr("class",t.xAxis).attr("transform",`translate(0,${F})`).call(O);(m==="daily"||m==="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(i))},[f,E,R,F,y,S,B,j,v,m,_]);const ve=(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=m!=="daily";return r.jsxs("div",{className:t.container,children:[!ge&&r.jsxs("div",{className:t.controls,children:[r.jsx("div",{className:t.viewToggle,children:fe.map(e=>r.jsxs("button",{className:`${t.viewButton} ${m===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:()=>_e(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,viewBox:`0 0 ${_} ${v}`,preserveAspectRatio:"xMidYMid meet",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:ve(h.date,m)}),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"})]})]})]})]})};me.__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:me,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"]}}},W=n=>{const _=[],v=new Date;for(let M=n-1;M>=0;M--){const b=new Date(v);b.setDate(b.getDate()-M),_.push(b.toISOString().split("T")[0])}return _},N={args:{data:(()=>{const n=W(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=W(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=W(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=W(30);return{dates:n,Weight:n.map((_,v)=>70+Math.sin(v/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 d,j as r}from"./iframe-gZo2MXmI.js";import{s as Y}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_cn90n_1",Ce="_controls_cn90n_19",qe="_viewToggle_cn90n_27",Le="_viewButton_cn90n_36",$e="_active_cn90n_57",Ne="_viewIcon_cn90n_63",Ae="_viewLabel_cn90n_68",Ve="_aggregationToggle_cn90n_78",Ie="_aggregationButton_cn90n_87",We="_aggregationIcon_cn90n_114",Be="_aggregationLabel_cn90n_119",Re="_legend_cn90n_129",Fe="_compactLegend_cn90n_140",He="_legendItem_cn90n_145",Oe="_legendEmoji_cn90n_150",ze="_legendLabel_cn90n_154",Ye="_inactive_cn90n_178",Qe="_legendColor_cn90n_188",Ue="_chart_cn90n_227",Pe="_gridLine_cn90n_235",Ge="_line_cn90n_241",Ke="_xAxis_cn90n_248",Xe="_yAxis_cn90n_249",Je="_dataPoint_cn90n_268",Ze="_tooltip_cn90n_278",et="_visible_cn90n_299",tt="_tooltipHeader_cn90n_304",at="_tooltipEmoji_cn90n_315",nt="_tooltipDot_cn90n_320",rt="_tooltipInfo_cn90n_327",ot="_tooltipDate_cn90n_333",st="_tooltipValue_cn90n_339",t={container:Ee,controls:Ce,viewToggle:qe,viewButton:Le,active:$e,viewIcon:Ne,viewLabel:Ae,aggregationToggle:Ve,aggregationButton:Ie,aggregationIcon:We,aggregationLabel:Be,legend:Re,compactLegend:Fe,legendItem:He,legendEmoji:Oe,legendLabel:ze,inactive:Ye,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},it={Exercise:"#6BCB77",Meditation:"#4D96FF",Reading:"#FFB319",Water:"#00D9FF",Steps:"#FF6B6B",Sleep:"#9B59B6",Calories:"#FF9F1C",Study:"#C774E8"},me=({data:n,width:_=800,height:v=400,defaultViewType:M="daily",periodType:b="month",habitColors:U={},habitEmojis:P={},onDataPointClick:B,hideControls:ge=!1,compactLegend:pe=!1})=>{const D=d.useRef(null),he=d.useRef(null),[m,ye]=d.useState(M),[E,G]=d.useState([]),[S,K]=d.useState(null),[h,C]=d.useState(null),[q,X]=d.useState("average"),y=d.useMemo(()=>({top:20,right:20,bottom:50,left:50}),[]),R=_-y.left-y.right,F=v-y.top-y.bottom,T=d.useMemo(()=>Object.keys(n).filter(e=>e!=="dates"),[n]);d.useEffect(()=>{G(T)},[T]),d.useEffect(()=>{const e=()=>{C(null)};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[]);const fe=d.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=d.useCallback(e=>U[e]||it[e]||`hsl(${Math.abs(e.split("").reduce((o,s)=>o+s.charCodeAt(0),0))%360}, 70%, 50%)`,[U]),f=d.useMemo(()=>{if(m==="daily"||!n.dates.length)return n;const e={dates:[]},o=new Map;return n.dates.forEach((s,g)=>{const w=new Date(s);let i;switch(m){case"weekly":{const c=new Date(w),p=c.getDay(),L=c.getDate()-p+(p===0?-6:1);c.setDate(L),i=c.toISOString().split("T")[0];break}case"monthly":i=`${w.getFullYear()}-${String(w.getMonth()+1).padStart(2,"0")}-01`;break;case"quarterly":{const p=(Math.floor(w.getMonth()/3)+1-1)*3;i=new Date(w.getFullYear(),p,1).toISOString().split("T")[0];break}default:i=s}o.has(i)||o.set(i,[]),o.get(i).push(g)}),e.dates=Array.from(o.keys()).sort(),T.forEach(s=>{e[s]=e.dates.map(g=>{const i=o.get(g).map(c=>n[s][c]).filter(c=>typeof c=="number"&&!isNaN(c));return i.length===0?0:Math.round(q==="sum"?i.reduce((c,p)=>c+p,0):i.reduce((c,p)=>c+p,0)/i.length)})}),e},[n,m,T,q]),_e=e=>{G(o=>o.includes(e)?o.filter(s=>s!==e):[...o,e])};d.useEffect(()=>{if(!D.current||f.dates.length===0)return;const e=Y(D.current);e.selectAll("*").remove(),e.append("rect").attr("width",_).attr("height",v).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)),g=be().domain(Me(s)).range([0,R]),w=Math.max(...E.flatMap(a=>f[a].filter(u=>typeof u=="number"))),i=je().domain([0,w*1.1]).range([F,0]);o.selectAll(".grid-line-y").data(i.ticks(5)).enter().append("line").attr("class",t.gridLine).attr("x1",0).attr("y1",a=>i(a)).attr("x2",R).attr("y2",a=>i(a));const c=Se().x(a=>g(a[0])).y(a=>i(a[1])).curve(Te);E.forEach(a=>{const u=s.map((l,x)=>[l,f[a][x]]).filter(l=>typeof l[1]=="number");o.append("path").datum(u).attr("class",t.line).attr("d",c).attr("stroke",j(a)).attr("opacity",S&&S!==a?.3:1),o.selectAll(`.hover-circle-${a}`).data(u).enter().append("circle").attr("cx",l=>g(l[0])).attr("cy",l=>i(l[1])).attr("r",10).attr("fill","transparent").style("cursor","pointer").on("mouseenter",function(l,x){var Z;const[k,$]=x,z=(Z=D.current)==null?void 0:Z.getBoundingClientRect();z&&C({habit:a,date:k.toISOString().split("T")[0],value:$,x:g(k)+y.left+z.left,y:i($)+y.top+z.top}),Y(o.node()).selectAll(`.circle-${a}-${s.indexOf(k)}`).attr("r",6)}).on("mouseleave",function(l,x){C(null),Y(o.node()).selectAll('[class*="circle-'+a+'"]').attr("r",4)}).on("click",function(l,x){const[k,$]=x;B&&B(a,k.toISOString().split("T")[0],$)}),o.selectAll(`.circle-${a}`).data(u).enter().append("circle").attr("class",(l,x)=>`${t.dataPoint} circle-${a}-${x}`).attr("cx",l=>g(l[0])).attr("cy",l=>i(l[1])).attr("r",4).attr("fill",j(a)).attr("opacity",S&&S!==a?.3:1).style("pointer-events","none")});const p=a=>{const u=new Date(a);u.setHours(0,0,0,0),u.setDate(u.getDate()+3-(u.getDay()+6)%7);const l=new Date(u.getFullYear(),0,4);return 1+Math.round(((u.getTime()-l.getTime())/864e5-3+(l.getDay()+6)%7)/7)},L=(()=>{switch(m){case"daily":return Q("%m-%d");case"weekly":return a=>`W${p(a).toString().padStart(2,"0")}`;case"monthly":return Q("%b");case"quarterly":return a=>`Q${Math.floor(a.getMonth()/3)+1}`;default:return Q("%m-%d")}})(),J=(()=>{switch(m){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(g).tickFormat(a=>L(a));m==="quarterly"?O.tickValues(s):J&&O.ticks(J);const xe=o.append("g").attr("class",t.xAxis).attr("transform",`translate(0,${F})`).call(O);(m==="daily"||m==="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(i))},[f,E,R,F,y,S,B,j,v,m,_]);const ve=(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=m!=="daily";return r.jsxs("div",{className:t.container,children:[!ge&&r.jsxs("div",{className:t.controls,children:[r.jsx("div",{className:t.viewToggle,children:fe.map(e=>r.jsxs("button",{className:`${t.viewButton} ${m===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:()=>_e(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,viewBox:`0 0 ${_} ${v}`,preserveAspectRatio:"xMidYMid meet",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:ve(h.date,m)}),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"})]})]})]})]})};me.__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:me,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"]}}},W=n=>{const _=[],v=new Date;for(let M=n-1;M>=0;M--){const b=new Date(v);b.setDate(b.getDate()-M),_.push(b.toISOString().split("T")[0])}return _},N={args:{data:(()=>{const n=W(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=W(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=W(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=W(30);return{dates:n,Weight:n.map((_,v)=>70+Math.sin(v/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-
|
|
1
|
+
import{r as y,j as W}from"./iframe-gZo2MXmI.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 o=n.replace("#","");return[parseInt(o.slice(0,2),16)/255,parseInt(o.slice(2,4),16)/255,parseInt(o.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-
|
|
1
|
+
import{r as D,j as X}from"./iframe-gZo2MXmI.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 l=0;l<this.count;l++){h.set([-1,1],l*2);const n=l/(this.count-1);if(y.set([0,n,1,n],l*4),l===this.count-1)continue;const s=l*2;p.set([s+0,s+1,s+2],(s+0)*3),p.set([s+2,s+1,s+3],(s+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 u=this.program=new $(o,{vertex:w,fragment:E,uniforms:r});this.mesh=new J(o,{geometry:A,program:u})}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;
|
package/storybook-static/assets/{RippleGrid.stories-D_3EPPTM.js → RippleGrid.stories-DqEVml_y.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,j as N}from"./iframe-
|
|
1
|
+
import{r as u,j as N}from"./iframe-gZo2MXmI.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 c}from"./iframe-
|
|
1
|
+
import{r as s,j as c}from"./iframe-gZo2MXmI.js";import{m as C}from"./proxy-kI6f2DWO.js";import{A as Q}from"./index-CnBOj3gc.js";import"./preload-helper-C1FmrZbK.js";import"./MotionConfigContext-CFyliiaM.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]),l=s.useCallback(t=>{q(t),_&&_(t)},[_]),x=s.useCallback(()=>{const t=e===o.length-1?d?0:e:e+1;t!==e&&l(t)},[e,o.length,d,l]),S=s.useCallback(()=>{const t=e===0?d?o.length-1:e:e-1;t!==e&&l(t)},[e,o.length,d,l]),R=s.useCallback(t=>{const a=Math.max(0,Math.min(t,o.length-1));a!==e&&l(a)},[o.length,e,l]),T=s.useCallback(()=>{e!==0&&l(0)},[e,l]);return s.useImperativeHandle(D,()=>({next:x,previous:S,jumpTo:R,reset:T}),[x,S,R,T]),s.useEffect(()=>{if(!M)return;const t=setInterval(x,j);return()=>clearInterval(t)},[x,j,M]),c.jsxs(C.span,{className:h(i["text-rotate"],P),...$,layout:!0,transition:N,children:[c.jsx("span",{className:`${i["text-rotate-sr-only"]}`,children:o[e]}),c.jsx(Q,{mode:F,initial:H,children:c.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,g)=>I+g.characters.length,0);return c.jsxs("span",{className:h(i["text-rotate-word"],L),children:[t.characters.map((I,g)=>c.jsx(C.span,{initial:w,animate:A,exit:E,transition:{...N,delay:J(n+g,r.reduce((K,O)=>K+O.characters.length,0))},className:h(i["text-rotate-element"],W),children:I},g)),t.needsSpace&&c.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"}},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'],
|
package/storybook-static/assets/{ScrollFloat.stories-Dzwz8uzu.js → ScrollFloat.stories-CQ5Fsjxi.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as s,j as c}from"./iframe-
|
|
1
|
+
import{r as s,j as c}from"./iframe-gZo2MXmI.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:l,scrollContainerRef:e,containerClassName:S="",textClassName:y="",animationDuration:u=1,ease:m="back.inOut(2)",scrollStart:i="center bottom+=50%",scrollEnd:f="bottom bottom-=40%",stagger:d=.03})=>{const p=s.useRef(null),N=s.useMemo(()=>(typeof l=="string"?l:"").split("").map((a,o)=>c.jsx("span",{className:`${n.char}`,children:a===" "?" ":a},o)),[l]);return s.useEffect(()=>{const t=p.current;if(!t)return;const a=e&&e.current?e.current:window,o=t.querySelectorAll(".char");_.fromTo(o,{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:d,scrollTrigger:{trigger:t,scroller:a,start:i,end:f,scrub:!0}})},[e,u,m,i,f,d]),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"}},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 u,j as c}from"./iframe-
|
|
1
|
+
import{r as u,j as c}from"./iframe-gZo2MXmI.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:b="bottom bottom",wordAnimationEnd:n="bottom bottom"})=>{const g=u.useRef(null),q=u.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 u.useEffect(()=>{const e=g.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:b,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:n,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:n,scrub:!0}}),()=>{_.getAll().forEach(E=>E.kill())}},[r,i,f,d,b,n,p]),c.jsx("h2",{ref:g,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"}},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 g,j as v}from"./iframe-BmJYCQaV.js";import{u as re}from"./use-motion-value-D1yqdG0l.js";import{h as ne,j as le,i as Te,r as Ce,m as Oe}from"./proxy-MAU_yIzM.js";import{f as h,I as k,N as Ne,a3 as Pe,Y as He,$ 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-C6KIXCCK.js";import{u as ze}from"./use-spring-BwMrSe4y.js";import{u as D}from"./use-transform-CTCcIVjx.js";import{u as je}from"./use-animation-frame-C3OkOmFg.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){g.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 Y(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 Ye=[0,0];function Xe(e,t,s,r){let n=Array.isArray(e)?e:Ye,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=Y(n[0],s,r),o=Y(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 p=Xe(r[f],i[o],a[o],c[l]);!u&&p!==t[l].interpolatorOffsets[f]&&(u=!0),t[l].offset[f]=p}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,X=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&&X.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,p=t.scrollHeight;(i.width!==f||i.height!==p)&&(a(),i.width=f,i.height=p)},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=X.get(t))==null||m(),window.removeEventListener("resize",i));const u=L.get(t);u&&(k(u),L.delete(t)),M.delete(t)}}const Qe=[[E.Enter,"entry"],[E.Exit,"exit"],[E.Any,"cover"],[E.All,"contain"]],G={start:0,end:1};function Ze(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=Ze(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 Qe)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 Q(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=Q("x",s,e,t),r.scrollYProgress.accelerate=Q("y",s,e,t));const n=g.useRef(null),l=g.useRef(!1),o=g.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]),g.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",Z={parallax:at,scroller:ut};function ft(e){const[t,s]=g.useState(0);return g.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=Z.parallax,scrollerClassName:i=Z.scroller,parallaxStyle:u,scrollerStyle:m})=>{function f({children:p,baseVelocity:S=s,scrollContainerRef:z,className:de="",damping:me,stiffness:pe,numCopies:ge,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:pe??400}),P=D(Ve,(y==null?void 0:y.input)||[0,1e3],(y==null?void 0:y.output)||[0,5],{clamp:!1}),j=g.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=g.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<ge;d++)_.push(v.jsxs("span",{className:de,ref:d===0?j:null,children:[p," "]},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((p,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:p},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"}},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 g,j as v}from"./iframe-gZo2MXmI.js";import{u as re}from"./use-motion-value-B7WuPdBk.js";import{h as ne,j as le,i as Te,r as Ce,m as Oe}from"./proxy-kI6f2DWO.js";import{f as h,I as k,N as Ne,a3 as Pe,Y as He,$ 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-CFyliiaM.js";import{u as ze}from"./use-spring-CiIl7xIy.js";import{u as D}from"./use-transform-fbMCilo3.js";import{u as je}from"./use-animation-frame-n9NDjnpE.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){g.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 Y(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 Ye=[0,0];function Xe(e,t,s,r){let n=Array.isArray(e)?e:Ye,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=Y(n[0],s,r),o=Y(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 p=Xe(r[f],i[o],a[o],c[l]);!u&&p!==t[l].interpolatorOffsets[f]&&(u=!0),t[l].offset[f]=p}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,X=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&&X.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,p=t.scrollHeight;(i.width!==f||i.height!==p)&&(a(),i.width=f,i.height=p)},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=X.get(t))==null||m(),window.removeEventListener("resize",i));const u=L.get(t);u&&(k(u),L.delete(t)),M.delete(t)}}const Qe=[[E.Enter,"entry"],[E.Exit,"exit"],[E.Any,"cover"],[E.All,"contain"]],G={start:0,end:1};function Ze(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=Ze(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 Qe)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 Q(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=Q("x",s,e,t),r.scrollYProgress.accelerate=Q("y",s,e,t));const n=g.useRef(null),l=g.useRef(!1),o=g.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]),g.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",Z={parallax:at,scroller:ut};function ft(e){const[t,s]=g.useState(0);return g.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=Z.parallax,scrollerClassName:i=Z.scroller,parallaxStyle:u,scrollerStyle:m})=>{function f({children:p,baseVelocity:S=s,scrollContainerRef:z,className:de="",damping:me,stiffness:pe,numCopies:ge,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:pe??400}),P=D(Ve,(y==null?void 0:y.input)||[0,1e3],(y==null?void 0:y.output)||[0,5],{clamp:!1}),j=g.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=g.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<ge;d++)_.push(v.jsxs("span",{className:de,ref:d===0?j:null,children:[p," "]},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((p,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:p},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"}},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,
|
package/storybook-static/assets/{SearchBar.stories-BJbLKP2g.js → SearchBar.stories-B893-BA0.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o,j as t}from"./iframe-
|
|
1
|
+
import{r as o,j as t}from"./iframe-gZo2MXmI.js";import{S as ee}from"./search-C4-LKbEC.js";import{F as te}from"./folder-B8Xf_S6e.js";import{U as se}from"./users-B9Qro682.js";import{c as P}from"./createLucideIcon-BM4zhNrq.js";import{m as $}from"./proxy-kI6f2DWO.js";import{X as ye}from"./x-BBEombe_.js";import{A as fe}from"./index-CnBOj3gc.js";import"./preload-helper-C1FmrZbK.js";import"./MotionConfigContext-CFyliiaM.js";/**
|
|
2
2
|
* @license lucide-react v0.539.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/storybook-static/assets/{SearchableDropdown-fnf6ZW_h.js → SearchableDropdown-DA44b3_Q.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r,j as n}from"./iframe-
|
|
1
|
+
import{r,j as n}from"./iframe-gZo2MXmI.js";import{m as p}from"./proxy-kI6f2DWO.js";import{C as V}from"./chevron-down-ve2JpfhS.js";import{A as R}from"./index-CnBOj3gc.js";import{S as A}from"./search-C4-LKbEC.js";import{C as T}from"./check-Dq_aEYsO.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}from"./iframe-
|
|
1
|
+
import{j as e}from"./iframe-gZo2MXmI.js";import{S as a}from"./SearchableDropdown-DA44b3_Q.js";import"./preload-helper-C1FmrZbK.js";import"./proxy-kI6f2DWO.js";import"./MotionConfigContext-CFyliiaM.js";import"./chevron-down-ve2JpfhS.js";import"./createLucideIcon-BM4zhNrq.js";import"./index-CnBOj3gc.js";import"./search-C4-LKbEC.js";import"./check-Dq_aEYsO.js";const j={title:"Atoms/SearchableDropdown",component:a,parameters:{layout:"centered",docs:{description:{component:"A dropdown component with built-in search functionality and smooth animations."}}},tags:["autodocs"],argTypes:{label:{control:"text"},value:{control:"text"},placeholder:{control:"text"},allowEmpty:{control:"boolean"},onChange:{action:"changed"}}},n=[{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"}],r=[{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"}],l={args:{label:"Select Country",value:"",options:n,placeholder:"Choose a country",allowEmpty:!0,onChange:()=>{}}},o={args:{label:"Technology Stack",value:"",options:r,placeholder:"Search technologies...",allowEmpty:!0,onChange:()=>{}}},t={args:{label:"With Empty Option",value:"",options:n.slice(0,5),placeholder:"Choose...",allowEmpty:!0,onChange:()=>{}},render:()=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",width:"300px"},children:[e.jsx(a,{label:"With Empty Option",value:"",onChange:()=>{},options:n.slice(0,5),placeholder:"Choose...",allowEmpty:!0}),e.jsx(a,{label:"No Empty Option",value:"react",onChange:()=>{},options:r.slice(0,5),placeholder:"Choose...",allowEmpty:!1}),e.jsx(a,{label:"Pre-selected",value:"us",onChange:()=>{},options:n.slice(0,5),placeholder:"Choose...",allowEmpty:!0}),e.jsx(a,{label:"Long Options List",value:"",onChange:()=>{},options:r,placeholder:"Search technologies...",allowEmpty:!0})]}),parameters:{controls:{disable:!0}}};var s,p,c;l.parameters={...l.parameters,docs:{...(s=l.parameters)==null?void 0:s.docs,source:{originalSource:`{
|
|
2
2
|
args: {
|
|
3
3
|
label: 'Select Country',
|
|
4
4
|
value: '',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._selectInput_qebnx_1{margin-bottom:var(--spacing-lg);position:relative}._selectInput_qebnx_1 label{display:block;font-size:var(--font-size-sm);font-weight:var(--font-weight-semibold);color:var(--color-text);margin-bottom:var(--spacing-sm);letter-spacing:var(--letter-spacing-wide);transition:color var(--transition-base)}._selectWrapper_qebnx_16{position:relative;width:100%}._selectInput_qebnx_1 select{width:100%;padding:var(--spacing-sm) var(--spacing-md);padding-right:48px;border:2px solid var(--color-border);border-radius:var(--radius-lg);background:linear-gradient(135deg,var(--color-background),var(--color-background-secondary));font-size:var(--font-size-base);font-weight:var(--font-weight-medium);color:var(--color-text);display:block;appearance:none;-webkit-appearance:none;-moz-appearance:none;cursor:pointer;transition:all var(--transition-base);min-height:44px;outline:none}._selectInput_qebnx_1 select:hover:not(:focus):not(:disabled){border-color:var(--color-border-hover);background:var(--color-background);box-shadow:var(--shadow-sm);transform:translateY(-1px)}._selectInput_qebnx_1 select:focus{border-color:var(--color-primary);background:var(--color-background);box-shadow:0 0 0 3px #7c3aed1a;transform:translateY(-2px)}._selectInput_qebnx_1 select:disabled{background:var(--color-background-tertiary);border-color:var(--color-border);color:var(--color-text-tertiary);cursor:not-allowed;opacity:.6;transform:none}._selectIcon_qebnx_68{position:absolute;right:var(--spacing-md);top:50%;transform:translateY(-50%);pointer-events:none;color:var(--color-primary);width:20px;height:20px;transition:color var(--transition-base)}._selectInput_qebnx_1 select:hover:not(:disabled)~._selectIcon_qebnx_68{color:var(--color-primary-hover)}._selectInput_qebnx_1 select:focus~._selectIcon_qebnx_68{color:var(--color-primary-hover)}._selectWrapper_qebnx_16:before{content:"";position:absolute;right:8px;top:50%;transform:translateY(-50%);width:32px;height:32px;background:linear-gradient(135deg,#7c3aed0d,#7c3aed1a);border-radius:var(--radius-md);pointer-events:none;opacity:0;transition:opacity var(--transition-base)}._selectInput_qebnx_1 select:focus~:before{opacity:1}._selectInput_qebnx_1 select option{padding:var(--spacing-sm);background:var(--color-background);color:var(--color-text);font-weight:var(--font-weight-normal)}._selectInput_qebnx_1 select option:checked{background:linear-gradient(135deg,var(--color-primary-lighter),var(--color-primary-light));color:var(--color-text)}._selectInput_qebnx_1 select option[value=""]{color:var(--color-text-secondary);font-style:italic}._error_qebnx_134 select{border-color:var(--color-error);background:linear-gradient(135deg,var(--color-error-bg),var(--color-background));animation:_shake_qebnx_1 .3s cubic-bezier(.36,.07,.19,.97) both}._error_qebnx_134 label{color:var(--color-error)}._error_qebnx_134 select:focus{box-shadow:0 0 0 3px #f43f5e26}._error_qebnx_134 ._selectIcon_qebnx_68{color:var(--color-error)}@keyframes _shake_qebnx_1{10%,90%{transform:translate(-1px)}20%,80%{transform:translate(2px)}30%,50%,70%{transform:translate(-3px)}40%,60%{transform:translate(3px)}}._success_qebnx_163 select{border-color:var(--color-success)}._success_qebnx_163:after{content:"✓";position:absolute;right:52px;top:50%;transform:translateY(-50%);color:var(--color-success);font-weight:700;animation:_checkIn_qebnx_1 .3s ease-out}@keyframes _checkIn_qebnx_1{0%{opacity:0;transform:translateY(-50%) scale(0)}to{opacity:1;transform:translateY(-50%) scale(1)}}._loading_qebnx_190 select{position:relative;overflow:hidden}._loading_qebnx_190:after{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(124,58,237,.1),transparent);animation:_shimmer_qebnx_1 2s infinite;pointer-events:none}@keyframes _shimmer_qebnx_1{to{left:100%}}[data-theme=dark] ._selectInput_qebnx_1 select{background:linear-gradient(135deg,var(--color-background-secondary),var(--color-background-tertiary));border-color:var(--color-border)}[data-theme=dark] ._selectInput_qebnx_1 select:hover:not(:disabled){background:var(--color-background-secondary);border-color:var(--color-border-hover)}[data-theme=dark] ._selectInput_qebnx_1 select:focus{background:var(--color-background-secondary);border-color:var(--color-primary-light);box-shadow:0 0 0 3px #a78bfa1a}[data-theme=dark] ._selectIcon_qebnx_68{color:var(--color-primary-light)}[data-theme=dark] ._selectWrapper_qebnx_16:before{background:linear-gradient(135deg,#a78bfa0d,#a78bfa1a)}[data-theme=dark] ._selectInput_qebnx_1 select option{background:var(--color-background-secondary)}[data-theme=dark] ._selectInput_qebnx_1 select option:checked{background:var(--color-primary)}@media (max-width: 768px){._selectInput_qebnx_1{margin-bottom:var(--spacing-md)}._selectInput_qebnx_1 label{font-size:var(--font-size-base);margin-bottom:var(--spacing-xs)}._selectInput_qebnx_1 select{min-height:48px;padding:var(--spacing-sm) var(--spacing-md);padding-right:52px;font-size:16px;line-height:1.5}._selectIcon_qebnx_68{right:var(--spacing-md);width:24px;height:24px}._selectWrapper_qebnx_16:before{width:36px;height:36px;right:10px}._selectInput_qebnx_1 select:active:not(:disabled){transform:translateY(0);background:var(--color-background-tertiary)}}@-moz-document url-prefix(){._selectInput_qebnx_1 select{padding-top:calc(var(--spacing-sm) + 1px);padding-bottom:calc(var(--spacing-sm) + 1px)}}@media (prefers-contrast: high){._selectInput_qebnx_1 select{border-width:3px}._selectInput_qebnx_1 select:focus{outline:2px solid var(--color-primary);outline-offset:2px}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./iframe-
|
|
1
|
+
import{j as s}from"./iframe-gZo2MXmI.js";import{u as y}from"./useSound-D0jddJxs.js";import{C as g}from"./chevron-down-ve2JpfhS.js";const I="_selectInput_qebnx_1",S="_selectWrapper_qebnx_16",j="_selectIcon_qebnx_68",q="_error_qebnx_134",C="_success_qebnx_163",V="_loading_qebnx_190",l={selectInput:I,selectWrapper:S,selectIcon:j,error:q,success:C,loading:V};function w({label:r,value:c,onChange:u,options:i,placeholder:p="Select...",disabled:d=!1,error:f=!1,success:m=!1,loading:a=!1,required:t=!1,soundConfig:v,className:n}){const{handlers:h,playSound:b}=y(v),x=()=>{const e=[l.selectInput];return f&&e.push(l.error),m&&e.push(l.success),a&&e.push(l.loading),e.join(" ")};return s.jsxs("div",{className:`${x()}${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=>{b("click"),u(e.target.value)},disabled:d||a,required:t,...h,children:[s.jsx("option",{value:"",children:p}),i.map(e=>{const o=typeof e=="string"?e:e.value,_=typeof e=="string"?e:e.label;return s.jsx("option",{value:o,children:_},o)})]}),s.jsx(g,{className:l.selectIcon})]})]})}w.__docgenInfo={description:`SelectInput component - Styled dropdown selector with flexible option format
|
|
2
2
|
|
|
3
3
|
@component
|
|
4
4
|
@description
|
package/storybook-static/assets/{SelectInput.stories-DuPwC-pM.js → SelectInput.stories-BXN5Qngu.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as h,j as o}from"./iframe-
|
|
1
|
+
import{r as h,j as o}from"./iframe-gZo2MXmI.js";import{S as t}from"./SelectInput-zadEZpDI.js";import"./preload-helper-C1FmrZbK.js";import"./useSound-D0jddJxs.js";import"./chevron-down-ve2JpfhS.js";import"./createLucideIcon-BM4zhNrq.js";const F={title:"Atoms/SelectInput",component:t,parameters:{layout:"centered",docs:{description:{component:"A simple dropdown select component with customizable options."}}},tags:["autodocs"],argTypes:{label:{control:"text"},value:{control:"text"},placeholder:{control:"text"},onChange:{action:"changed"}}},y=["Option 1","Option 2","Option 3","Option 4"],S=[{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:y,placeholder:"Choose..."}},n={args:{label:"Country",value:"uk",onChange:()=>{},options:S,placeholder:"Select a country"}},s={args:{label:"Form Example",value:"",onChange:()=>{},options:["Option 1","Option 2"]},render:()=>{const[e,l]=h.useState({title:"",category:"",priority:"",assignee:""});return o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",padding:"1.5rem",background:"var(--color-background-secondary)",borderRadius:"var(--radius-md)",minWidth:"300px"},children:[o.jsx("h3",{style:{marginTop:0},children:"Create Task"}),o.jsx(t,{label:"Title",value:e.title,onChange:a=>l({...e,title:a}),options:["Mr","Mrs","Ms","Dr","Prof"],placeholder:"Select title"}),o.jsx(t,{label:"Category",value:e.category,onChange:a=>l({...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(t,{label:"Priority",value:e.priority,onChange:a=>l({...e,priority:a}),options:["Low","Medium","High","Critical"],placeholder:"Select priority"}),o.jsx(t,{label:"Assignee",value:e.assignee,onChange:a=>l({...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 i,c,u;r.parameters={...r.parameters,docs:{...(i=r.parameters)==null?void 0:i.docs,source:{originalSource:`{
|
|
2
2
|
args: {
|
|
3
3
|
label: 'Select an option',
|
|
4
4
|
value: '',
|
package/storybook-static/assets/{ShapeBlur.stories-BzSypzdO.js → ShapeBlur.stories-DanNCmFJ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as M,j}from"./iframe-
|
|
1
|
+
import{r as M,j}from"./iframe-gZo2MXmI.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);
|
package/storybook-static/assets/{ShapeGrid.stories-CDkUZpth.js → ShapeGrid.stories-bj6mmNeF.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as v,j as q}from"./iframe-
|
|
1
|
+
import{r as v,j as q}from"./iframe-gZo2MXmI.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"}},$={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,
|
package/storybook-static/assets/{ShinyText.stories-CGKy0Lsc.js → ShinyText.stories-DZCLKCXK.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r,j as N}from"./iframe-
|
|
1
|
+
import{r,j as N}from"./iframe-gZo2MXmI.js";import{u as P}from"./use-motion-value-B7WuPdBk.js";import{u as z}from"./use-animation-frame-n9NDjnpE.js";import{u as A}from"./use-transform-fbMCilo3.js";import{m as B}from"./proxy-kI6f2DWO.js";import"./preload-helper-C1FmrZbK.js";import"./MotionConfigContext-CFyliiaM.js";const F={"shiny-text":"_shiny-text_183zx_1"},T=({text:V,disabled:q=!1,speed:k=2,className:C="",color:u="#b5b5b5",shineColor:$="#ffffff",spread:R=120,yoyo:S=!1,pauseOnHover:f=!1,direction:m="left",delay:_=0})=>{const[D,y]=r.useState(!1),e=P(0),c=r.useRef(0),n=r.useRef(null),a=r.useRef(m==="left"?1:-1),t=k*1e3,b=_*1e3;z(o=>{if(q||D){n.current=null;return}if(n.current===null){n.current=o;return}const I=o-n.current;if(n.current=o,c.current+=I,S){const l=t+b,i=l*2,s=c.current%i;if(s<t){const p=s/t*100;e.set(a.current===1?p:100-p)}else if(s<l)e.set(a.current===1?100:0);else if(s<l+t){const x=100-(s-l)/t*100;e.set(a.current===1?x:100-x)}else e.set(a.current===1?0:100)}else{const l=t+b,i=c.current%l;if(i<t){const s=i/t*100;e.set(a.current===1?s:100-s)}else e.set(a.current===1?100:0)}}),r.useEffect(()=>{a.current=m==="left"?1:-1,c.current=0,e.set(0)},[m]);const E=A(e,o=>`${150-o*2}% center`),M=r.useCallback(()=>{f&&y(!0)},[f]),W=r.useCallback(()=>{f&&y(!1)},[f]),j={backgroundImage:`linear-gradient(${R}deg, ${u} 0%, ${u} 35%, ${$} 50%, ${u} 65%, ${u} 100%)`,backgroundSize:"200% auto",WebkitBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent"};return N.jsx(B.span,{className:`${F["shiny-text"]} ${C}`,style:{...j,backgroundPosition:E},onMouseEnter:M,onMouseLeave:W,children:V})};T.__docgenInfo={description:"",methods:[],displayName:"ShinyText",props:{disabled:{defaultValue:{value:"false",computed:!1},required:!1},speed:{defaultValue:{value:"2",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},color:{defaultValue:{value:"'#b5b5b5'",computed:!1},required:!1},shineColor:{defaultValue:{value:"'#ffffff'",computed:!1},required:!1},spread:{defaultValue:{value:"120",computed:!1},required:!1},yoyo:{defaultValue:{value:"false",computed:!1},required:!1},pauseOnHover:{defaultValue:{value:"false",computed:!1},required:!1},direction:{defaultValue:{value:"'left'",computed:!1},required:!1},delay:{defaultValue:{value:"0",computed:!1},required:!1}}};const Q={title:"ReactBits/TextAnimations/ShinyText",component:T,parameters:{layout:"fullscreen"}},d={args:{text:"Hello World",disabled:!1,speed:2,color:"#b5b5b5",shineColor:"#ffffff",spread:120,yoyo:!1,pauseOnHover:!1,direction:"left",delay:0}};var g,v,h;d.parameters={...d.parameters,docs:{...(g=d.parameters)==null?void 0:g.docs,source:{originalSource:`{
|
|
2
2
|
args: {
|
|
3
3
|
text: 'Hello World',
|
|
4
4
|
disabled: false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as n,j as a}from"./iframe-
|
|
1
|
+
import{r as n,j as a}from"./iframe-gZo2MXmI.js";import{C as p,u as x,a as y}from"./react-three-fiber.esm-IUdAdhlX.js";import{n as g}from"./three.module--_vTUKhS.js";import"./preload-helper-C1FmrZbK.js";const S=e=>(e=e.replace("#",""),[parseInt(e.slice(0,2),16)/255,parseInt(e.slice(2,4),16)/255,parseInt(e.slice(4,6),16)/255]),C=`
|
|
2
2
|
varying vec2 vUv;
|
|
3
3
|
varying vec3 vPosition;
|
|
4
4
|
|
package/storybook-static/assets/{SleepChart.stories-WRltn-Jx.js → SleepChart.stories-BsnisMa9.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as b,j as i}from"./iframe-BmJYCQaV.js";import{s as v,a as ut}from"./transform-BKmuZieF.js";import{i as it,l as ht}from"./linear-dkJHgUri.js";import{a as mt,b as ft}from"./axis-D3QohQNI.js";import"./preload-helper-C1FmrZbK.js";class V extends Map{constructor(t,r=wt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[a,n]of t)this.set(a,n)}get(t){return super.get(W(this,t))}has(t){return super.has(W(this,t))}set(t,r){return super.set(gt(this,t),r)}delete(t){return super.delete(Mt(this,t))}}function W({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):r}function gt({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):(e.set(a,r),r)}function Mt({_intern:e,_key:t},r){const a=t(r);return e.has(a)&&(r=e.get(a),e.delete(a)),r}function wt(e){return e!==null&&typeof e=="object"?e.valueOf():e}function E(e,t,r){e=+e,t=+t,r=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+r;for(var a=-1,n=Math.max(0,Math.ceil((t-e)/r))|0,s=new Array(n);++a<n;)s[a]=e+a*r;return s}var O=1.70158;(function e(t){t=+t;function r(a){return(a=+a)*a*(t*(a-1)+a)}return r.overshoot=e,r})(O);var P=function e(t){t=+t;function r(a){return--a*a*((a+1)*t+a)+1}return r.overshoot=e,r}(O);(function e(t){t=+t;function r(a){return((a*=2)<1?a*a*((t+1)*a-t):(a-=2)*a*((t+1)*a+t)+2)/2}return r.overshoot=e,r})(O);const q=Symbol("implicit");function lt(){var e=new V,t=[],r=[],a=q;function n(s){let p=e.get(s);if(p===void 0){if(a!==q)return a;e.set(s,p=t.push(s)-1)}return r[p%r.length]}return n.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new V;for(const p of s)e.has(p)||e.set(p,t.push(p)-1);return n},n.range=function(s){return arguments.length?(r=Array.from(s),n):r.slice()},n.unknown=function(s){return arguments.length?(a=s,n):a},n.copy=function(){return lt(t,r).unknown(a)},it.apply(n,arguments),n}function dt(){var e=lt().unknown(void 0),t=e.domain,r=e.range,a=0,n=1,s,p,h=!1,M=0,w=0,g=.5;delete e.unknown;function m(){var l=t().length,k=n<a,x=k?n:a,T=k?a:n;s=(T-x)/Math.max(1,l-M+w*2),h&&(s=Math.floor(s)),x+=(T-x-s*(l-M))*g,p=s*(1-M),h&&(x=Math.round(x),p=Math.round(p));var y=E(l).map(function($){return x+s*$});return r(k?y.reverse():y)}return e.domain=function(l){return arguments.length?(t(l),m()):t()},e.range=function(l){return arguments.length?([a,n]=l,a=+a,n=+n,m()):[a,n]},e.rangeRound=function(l){return[a,n]=l,a=+a,n=+n,h=!0,m()},e.bandwidth=function(){return p},e.step=function(){return s},e.round=function(l){return arguments.length?(h=!!l,m()):h},e.padding=function(l){return arguments.length?(M=Math.min(1,w=+l),m()):M},e.paddingInner=function(l){return arguments.length?(M=Math.min(1,l),m()):M},e.paddingOuter=function(l){return arguments.length?(w=+l,m()):w},e.align=function(l){return arguments.length?(g=Math.max(0,Math.min(1,l)),m()):g},e.copy=function(){return dt(t(),[a,n]).round(h).paddingInner(M).paddingOuter(w).align(g)},it.apply(m(),arguments)}const xt="_container_wk2zd_1",_t="_header_wk2zd_7",kt="_title_wk2zd_14",yt="_legend_wk2zd_20",St="_legendItem_wk2zd_25",bt="_sleepDot_wk2zd_33",vt="_wakeDot_wk2zd_42",$t="_chart_wk2zd_51",Dt="_gridLine_wk2zd_55",jt="_sleepBar_wk2zd_60",At="_xAxis_wk2zd_70",zt="_yAxis_wk2zd_71",Nt="_tooltip_wk2zd_96",Ht="_visible_wk2zd_117",It="_tooltipHeader_wk2zd_122",Tt="_tooltipEmoji_wk2zd_133",Rt="_tooltipInfo_wk2zd_138",Et="_tooltipRow_wk2zd_144",Ot="_tooltipLabel_wk2zd_152",Bt="_tooltipValue_wk2zd_158",Lt="_tooltipDuration_wk2zd_163",c={container:xt,header:_t,title:kt,legend:yt,legendItem:St,sleepDot:bt,wakeDot:vt,chart:$t,gridLine:Dt,sleepBar:jt,xAxis:At,yAxis:zt,tooltip:Nt,visible:Ht,tooltipHeader:It,tooltipEmoji:Tt,tooltipInfo:Rt,tooltipRow:Et,tooltipLabel:Ot,tooltipValue:Bt,tooltipDuration:Lt},G=e=>{const[t,r]=e.split(":").map(Number);return t+r/60},C=e=>{const t=Math.floor(e%24),r=t===0?12:t>12?t-12:t,a=t>=12?"PM":"AM",n=Math.round(e%1*60);return`${Math.floor(r)}:${n.toString().padStart(2,"0")} ${a}`},ct=({sleepData:e,width:t=800,height:r=400,onDateClick:a})=>{const n=b.useRef(null),[s,p]=b.useState(null),h=b.useMemo(()=>({top:30,right:30,bottom:50,left:80}),[]),M=t-h.left-h.right,w=r-h.top-h.bottom;return b.useEffect(()=>{const g=()=>{p(null)};return window.addEventListener("scroll",g,!0),()=>{window.removeEventListener("scroll",g,!0)}},[]),b.useEffect(()=>{if(!n.current||e.length===0)return;const g=v(n.current);g.selectAll("*").remove(),g.append("rect").attr("width",t).attr("height",r).attr("fill","transparent").style("pointer-events","all").on("mouseleave",()=>{p(null)});const m=g.append("g").attr("transform",`translate(${h.left},${h.top})`),l=ht().domain([18,42]).range([0,M]),k=e.map(o=>o.date),x=dt().domain(k).range([0,w]).paddingInner(.2).paddingOuter(.1);m.selectAll(".grid-line-x").data(E(18,43,1)).enter().append("line").attr("class",c.gridLine).attr("x1",o=>l(o)).attr("y1",0).attr("x2",o=>l(o)).attr("y2",w).style("stroke",o=>{const d=o%24;return"var(--color-border)"}).style("stroke-opacity",o=>{const d=o%24;return d===0||d===12?.3:d%3===0?.15:.05}).style("stroke-width",o=>{const d=o%24;return d===0||d===12?2:1}),e.forEach(o=>{const d=x(o.date);if(d===void 0)return;const S=x.bandwidth(),D=m.append("g").attr("class",c.sleepBar).style("cursor","pointer").on("click",()=>a==null?void 0:a(o.date));let u=null,f=null;o.sleep_time&&(u=G(o.sleep_time),u<18&&(u+=24)),o.wake_hour&&(f=G(o.wake_hour),u!==null?(f<u||u>=18&&f<18)&&(f+=24):f<12&&(f+=24)),u!==null&&f!==null&&D.append("rect").attr("x",l(u)).attr("y",d).attr("width",0).attr("height",S).attr("rx",S/2).attr("fill","url(#sleepGradient)").attr("opacity",0).attr("stroke","rgba(255,255,255,0.3)").attr("stroke-width",1).style("filter","drop-shadow(0 2px 8px rgba(155, 89, 182, 0.3))").transition().duration(800).delay(Math.random()*200).ease(ut).attr("width",Math.max(0,l(f)-l(u))).attr("opacity",.85),u!==null&&D.append("circle").attr("cx",l(u)).attr("cy",d+S/2).attr("r",0).attr("fill","#9B59B6").attr("stroke","#ffffff").attr("stroke-width",2).style("filter","drop-shadow(0 3px 6px rgba(155, 89, 182, 0.4))").style("transition","all 0.3s ease").transition().duration(400).delay(300+Math.random()*100).ease(P).attr("r",6),f!==null&&D.append("circle").attr("cx",l(f)).attr("cy",d+S/2).attr("r",0).attr("fill","#3498DB").attr("stroke","#ffffff").attr("stroke-width",2).style("filter","drop-shadow(0 3px 6px rgba(52, 152, 219, 0.4))").style("transition","all 0.3s ease").transition().duration(400).delay(500+Math.random()*100).ease(P).attr("r",6),D.on("mouseenter",function(_){var B;if(v(this).select("rect").transition().duration(200).attr("opacity",1).style("filter","drop-shadow(0 4px 12px rgba(155, 89, 182, 0.5)) brightness(1.1)"),v(this).selectAll("circle").transition().duration(200).attr("r",8),(B=n.current)==null?void 0:B.getBoundingClientRect()){const L=u!==null&&f!==null?f-u:null;p({date:o.date,sleepTime:u!==null?C(u):null,wakeTime:f!==null?C(f):null,duration:L!==null?Math.round(L*100)/100:null,x:_.pageX,y:_.pageY-80})}}).on("mouseleave",function(){v(this).select("rect").transition().duration(200).attr("opacity",.85).style("filter","drop-shadow(0 2px 8px rgba(155, 89, 182, 0.3))"),v(this).selectAll("circle").transition().duration(200).attr("r",6),p(null)}).on("mousemove",function(_){p(R=>R?{...R,x:_.pageX,y:_.pageY-80}:null)})});const y=g.append("defs").append("linearGradient").attr("id","sleepGradient").attr("x1","0%").attr("x2","100%");y.append("stop").attr("offset","0%").attr("stop-color","#9B59B6").attr("stop-opacity",1),y.append("stop").attr("offset","50%").attr("stop-color","#7B68A6").attr("stop-opacity",1),y.append("stop").attr("offset","100%").attr("stop-color","#3498DB").attr("stop-opacity",1);const $=E(18,43,3).map(o=>({value:o,label:o===24?"12 AM":o===36?"12 PM":o%24===0?"12 AM":o%24<12?`${o%24} AM`:o%24===12?"12 PM":`${o%24-12} PM`}));m.append("g").attr("class",c.xAxis).attr("transform",`translate(0,${w})`).call(mt(l).tickValues($.map(o=>o.value)).tickFormat(o=>{const d=$.find(S=>S.value===o);return d?d.label:""}).tickSizeOuter(0)).selectAll("text").style("font-weight",o=>{const d=o%24;return d===0||d===12?"600":"400"});const pt=k.filter((o,d)=>d%Math.ceil(k.length/10)===0);m.append("g").attr("class",c.yAxis).call(ft(x).tickValues(pt).tickFormat(o=>{const d=new Date(o);return`${(d.getMonth()+1).toString().padStart(2,"0")}/${d.getDate().toString().padStart(2,"0")}`}))},[e,M,w,h,a,r,t]),i.jsxs("div",{className:c.container,children:[i.jsxs("div",{className:c.header,children:[i.jsx("h3",{className:c.title,children:"Sleep Pattern"}),i.jsxs("div",{className:c.legend,children:[i.jsxs("div",{className:c.legendItem,children:[i.jsx("span",{className:c.sleepDot}),i.jsx("span",{children:"Sleep Time"})]}),i.jsxs("div",{className:c.legendItem,children:[i.jsx("span",{className:c.wakeDot}),i.jsx("span",{children:"Wake Time"})]})]})]}),i.jsx("svg",{ref:n,width:t,height:r,className:c.chart}),s&&i.jsxs("div",{className:`${c.tooltip} ${s?c.visible:""}`,style:{left:`${s.x}px`,top:`${s.y}px`},children:[i.jsxs("div",{className:c.tooltipHeader,children:[i.jsx("span",{className:c.tooltipEmoji,children:"😴"}),i.jsx("span",{children:new Date(s.date).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})})]}),i.jsxs("div",{className:c.tooltipInfo,children:[s.sleepTime&&i.jsxs("div",{className:c.tooltipRow,children:[i.jsxs("span",{className:c.tooltipLabel,children:[i.jsx("span",{children:"🌙"}),i.jsx("span",{children:"Sleep:"})]}),i.jsx("span",{className:c.tooltipValue,children:s.sleepTime})]}),s.wakeTime&&i.jsxs("div",{className:c.tooltipRow,children:[i.jsxs("span",{className:c.tooltipLabel,children:[i.jsx("span",{children:"☀️"}),i.jsx("span",{children:"Wake:"})]}),i.jsx("span",{className:c.tooltipValue,children:s.wakeTime})]}),s.duration!==null&&i.jsxs("div",{className:c.tooltipDuration,children:[i.jsx("span",{children:"⏱️"}),i.jsxs("span",{children:[Math.floor(s.duration),"h ",Math.round(s.duration%1*60),"m"]})]})]})]})]})};ct.__docgenInfo={description:"",methods:[],displayName:"SleepChart",props:{sleepData:{required:!0,tsType:{name:"Array",elements:[{name:"SleepData"}],raw:"SleepData[]"},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}},onDateClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(date: string) => void",signature:{arguments:[{type:{name:"string"},name:"date"}],return:{name:"void"}}},description:""}}};const Ft={title:"Organisms/Charts/SleepChart",component:ct,parameters:{layout:"centered"},argTypes:{width:{control:{type:"number",min:400,max:1200,step:50}},height:{control:{type:"number",min:200,max:600,step:50}},onDateClick:{action:"dateClicked"}}},I=e=>{const t=[],r=new Date;for(let a=e-1;a>=0;a--){const n=new Date(r);n.setDate(n.getDate()-a),t.push(n.toISOString().split("T")[0])}return t},j={args:{sleepData:I(7).map(e=>{const t=Math.floor(Math.random()*3)+22,r=Math.floor(Math.random()*3)+6;return{date:e,sleep_time:`${t%24}:${Math.floor(Math.random()*60).toString().padStart(2,"0")}`,wake_hour:`${r}:${Math.floor(Math.random()*60).toString().padStart(2,"0")}`}}),width:800,height:400}},A={args:{sleepData:I(30).map(e=>({date:e,sleep_time:`${(Math.floor(Math.random()*3)+22)%24}:${Math.floor(Math.random()*60).toString().padStart(2,"0")}`,wake_hour:`${Math.floor(Math.random()*2)+7}:${Math.floor(Math.random()*60).toString().padStart(2,"0")}`})),width:900,height:400}},z={args:{sleepData:I(14).map((e,t)=>{const r=t%7===5||t%7===6,a=r?Math.floor(Math.random()*4)+24:Math.floor(Math.random()*2)+22,n=r?Math.floor(Math.random()*3)+9:Math.floor(Math.random()*2)+6;return{date:e,sleep_time:`${a%24}:${Math.floor(Math.random()*60).toString().padStart(2,"0")}`,wake_hour:`${n}:${Math.floor(Math.random()*60).toString().padStart(2,"0")}`}}),width:850,height:400}},N={args:{sleepData:I(14).map((e,t)=>({date:e,sleep_time:t%3===0?null:`${(Math.floor(Math.random()*3)+22)%24}:30`,wake_hour:t%3===0?null:`${Math.floor(Math.random()*2)+7}:00`})),width:800,height:400}},H={args:{sleepData:[],width:800,height:400}};var F,X,Y;j.parameters={...j.parameters,docs:{...(F=j.parameters)==null?void 0:F.docs,source:{originalSource:`{
|
|
1
|
+
import{r as b,j as i}from"./iframe-gZo2MXmI.js";import{s as v,a as ut}from"./transform-BKmuZieF.js";import{i as it,l as ht}from"./linear-dkJHgUri.js";import{a as mt,b as ft}from"./axis-D3QohQNI.js";import"./preload-helper-C1FmrZbK.js";class V extends Map{constructor(t,r=wt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[a,n]of t)this.set(a,n)}get(t){return super.get(W(this,t))}has(t){return super.has(W(this,t))}set(t,r){return super.set(gt(this,t),r)}delete(t){return super.delete(Mt(this,t))}}function W({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):r}function gt({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):(e.set(a,r),r)}function Mt({_intern:e,_key:t},r){const a=t(r);return e.has(a)&&(r=e.get(a),e.delete(a)),r}function wt(e){return e!==null&&typeof e=="object"?e.valueOf():e}function E(e,t,r){e=+e,t=+t,r=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+r;for(var a=-1,n=Math.max(0,Math.ceil((t-e)/r))|0,s=new Array(n);++a<n;)s[a]=e+a*r;return s}var O=1.70158;(function e(t){t=+t;function r(a){return(a=+a)*a*(t*(a-1)+a)}return r.overshoot=e,r})(O);var P=function e(t){t=+t;function r(a){return--a*a*((a+1)*t+a)+1}return r.overshoot=e,r}(O);(function e(t){t=+t;function r(a){return((a*=2)<1?a*a*((t+1)*a-t):(a-=2)*a*((t+1)*a+t)+2)/2}return r.overshoot=e,r})(O);const q=Symbol("implicit");function lt(){var e=new V,t=[],r=[],a=q;function n(s){let p=e.get(s);if(p===void 0){if(a!==q)return a;e.set(s,p=t.push(s)-1)}return r[p%r.length]}return n.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new V;for(const p of s)e.has(p)||e.set(p,t.push(p)-1);return n},n.range=function(s){return arguments.length?(r=Array.from(s),n):r.slice()},n.unknown=function(s){return arguments.length?(a=s,n):a},n.copy=function(){return lt(t,r).unknown(a)},it.apply(n,arguments),n}function dt(){var e=lt().unknown(void 0),t=e.domain,r=e.range,a=0,n=1,s,p,h=!1,M=0,w=0,g=.5;delete e.unknown;function m(){var l=t().length,k=n<a,x=k?n:a,T=k?a:n;s=(T-x)/Math.max(1,l-M+w*2),h&&(s=Math.floor(s)),x+=(T-x-s*(l-M))*g,p=s*(1-M),h&&(x=Math.round(x),p=Math.round(p));var y=E(l).map(function($){return x+s*$});return r(k?y.reverse():y)}return e.domain=function(l){return arguments.length?(t(l),m()):t()},e.range=function(l){return arguments.length?([a,n]=l,a=+a,n=+n,m()):[a,n]},e.rangeRound=function(l){return[a,n]=l,a=+a,n=+n,h=!0,m()},e.bandwidth=function(){return p},e.step=function(){return s},e.round=function(l){return arguments.length?(h=!!l,m()):h},e.padding=function(l){return arguments.length?(M=Math.min(1,w=+l),m()):M},e.paddingInner=function(l){return arguments.length?(M=Math.min(1,l),m()):M},e.paddingOuter=function(l){return arguments.length?(w=+l,m()):w},e.align=function(l){return arguments.length?(g=Math.max(0,Math.min(1,l)),m()):g},e.copy=function(){return dt(t(),[a,n]).round(h).paddingInner(M).paddingOuter(w).align(g)},it.apply(m(),arguments)}const xt="_container_wk2zd_1",_t="_header_wk2zd_7",kt="_title_wk2zd_14",yt="_legend_wk2zd_20",St="_legendItem_wk2zd_25",bt="_sleepDot_wk2zd_33",vt="_wakeDot_wk2zd_42",$t="_chart_wk2zd_51",Dt="_gridLine_wk2zd_55",jt="_sleepBar_wk2zd_60",At="_xAxis_wk2zd_70",zt="_yAxis_wk2zd_71",Nt="_tooltip_wk2zd_96",Ht="_visible_wk2zd_117",It="_tooltipHeader_wk2zd_122",Tt="_tooltipEmoji_wk2zd_133",Rt="_tooltipInfo_wk2zd_138",Et="_tooltipRow_wk2zd_144",Ot="_tooltipLabel_wk2zd_152",Bt="_tooltipValue_wk2zd_158",Lt="_tooltipDuration_wk2zd_163",c={container:xt,header:_t,title:kt,legend:yt,legendItem:St,sleepDot:bt,wakeDot:vt,chart:$t,gridLine:Dt,sleepBar:jt,xAxis:At,yAxis:zt,tooltip:Nt,visible:Ht,tooltipHeader:It,tooltipEmoji:Tt,tooltipInfo:Rt,tooltipRow:Et,tooltipLabel:Ot,tooltipValue:Bt,tooltipDuration:Lt},G=e=>{const[t,r]=e.split(":").map(Number);return t+r/60},C=e=>{const t=Math.floor(e%24),r=t===0?12:t>12?t-12:t,a=t>=12?"PM":"AM",n=Math.round(e%1*60);return`${Math.floor(r)}:${n.toString().padStart(2,"0")} ${a}`},ct=({sleepData:e,width:t=800,height:r=400,onDateClick:a})=>{const n=b.useRef(null),[s,p]=b.useState(null),h=b.useMemo(()=>({top:30,right:30,bottom:50,left:80}),[]),M=t-h.left-h.right,w=r-h.top-h.bottom;return b.useEffect(()=>{const g=()=>{p(null)};return window.addEventListener("scroll",g,!0),()=>{window.removeEventListener("scroll",g,!0)}},[]),b.useEffect(()=>{if(!n.current||e.length===0)return;const g=v(n.current);g.selectAll("*").remove(),g.append("rect").attr("width",t).attr("height",r).attr("fill","transparent").style("pointer-events","all").on("mouseleave",()=>{p(null)});const m=g.append("g").attr("transform",`translate(${h.left},${h.top})`),l=ht().domain([18,42]).range([0,M]),k=e.map(o=>o.date),x=dt().domain(k).range([0,w]).paddingInner(.2).paddingOuter(.1);m.selectAll(".grid-line-x").data(E(18,43,1)).enter().append("line").attr("class",c.gridLine).attr("x1",o=>l(o)).attr("y1",0).attr("x2",o=>l(o)).attr("y2",w).style("stroke",o=>{const d=o%24;return"var(--color-border)"}).style("stroke-opacity",o=>{const d=o%24;return d===0||d===12?.3:d%3===0?.15:.05}).style("stroke-width",o=>{const d=o%24;return d===0||d===12?2:1}),e.forEach(o=>{const d=x(o.date);if(d===void 0)return;const S=x.bandwidth(),D=m.append("g").attr("class",c.sleepBar).style("cursor","pointer").on("click",()=>a==null?void 0:a(o.date));let u=null,f=null;o.sleep_time&&(u=G(o.sleep_time),u<18&&(u+=24)),o.wake_hour&&(f=G(o.wake_hour),u!==null?(f<u||u>=18&&f<18)&&(f+=24):f<12&&(f+=24)),u!==null&&f!==null&&D.append("rect").attr("x",l(u)).attr("y",d).attr("width",0).attr("height",S).attr("rx",S/2).attr("fill","url(#sleepGradient)").attr("opacity",0).attr("stroke","rgba(255,255,255,0.3)").attr("stroke-width",1).style("filter","drop-shadow(0 2px 8px rgba(155, 89, 182, 0.3))").transition().duration(800).delay(Math.random()*200).ease(ut).attr("width",Math.max(0,l(f)-l(u))).attr("opacity",.85),u!==null&&D.append("circle").attr("cx",l(u)).attr("cy",d+S/2).attr("r",0).attr("fill","#9B59B6").attr("stroke","#ffffff").attr("stroke-width",2).style("filter","drop-shadow(0 3px 6px rgba(155, 89, 182, 0.4))").style("transition","all 0.3s ease").transition().duration(400).delay(300+Math.random()*100).ease(P).attr("r",6),f!==null&&D.append("circle").attr("cx",l(f)).attr("cy",d+S/2).attr("r",0).attr("fill","#3498DB").attr("stroke","#ffffff").attr("stroke-width",2).style("filter","drop-shadow(0 3px 6px rgba(52, 152, 219, 0.4))").style("transition","all 0.3s ease").transition().duration(400).delay(500+Math.random()*100).ease(P).attr("r",6),D.on("mouseenter",function(_){var B;if(v(this).select("rect").transition().duration(200).attr("opacity",1).style("filter","drop-shadow(0 4px 12px rgba(155, 89, 182, 0.5)) brightness(1.1)"),v(this).selectAll("circle").transition().duration(200).attr("r",8),(B=n.current)==null?void 0:B.getBoundingClientRect()){const L=u!==null&&f!==null?f-u:null;p({date:o.date,sleepTime:u!==null?C(u):null,wakeTime:f!==null?C(f):null,duration:L!==null?Math.round(L*100)/100:null,x:_.pageX,y:_.pageY-80})}}).on("mouseleave",function(){v(this).select("rect").transition().duration(200).attr("opacity",.85).style("filter","drop-shadow(0 2px 8px rgba(155, 89, 182, 0.3))"),v(this).selectAll("circle").transition().duration(200).attr("r",6),p(null)}).on("mousemove",function(_){p(R=>R?{...R,x:_.pageX,y:_.pageY-80}:null)})});const y=g.append("defs").append("linearGradient").attr("id","sleepGradient").attr("x1","0%").attr("x2","100%");y.append("stop").attr("offset","0%").attr("stop-color","#9B59B6").attr("stop-opacity",1),y.append("stop").attr("offset","50%").attr("stop-color","#7B68A6").attr("stop-opacity",1),y.append("stop").attr("offset","100%").attr("stop-color","#3498DB").attr("stop-opacity",1);const $=E(18,43,3).map(o=>({value:o,label:o===24?"12 AM":o===36?"12 PM":o%24===0?"12 AM":o%24<12?`${o%24} AM`:o%24===12?"12 PM":`${o%24-12} PM`}));m.append("g").attr("class",c.xAxis).attr("transform",`translate(0,${w})`).call(mt(l).tickValues($.map(o=>o.value)).tickFormat(o=>{const d=$.find(S=>S.value===o);return d?d.label:""}).tickSizeOuter(0)).selectAll("text").style("font-weight",o=>{const d=o%24;return d===0||d===12?"600":"400"});const pt=k.filter((o,d)=>d%Math.ceil(k.length/10)===0);m.append("g").attr("class",c.yAxis).call(ft(x).tickValues(pt).tickFormat(o=>{const d=new Date(o);return`${(d.getMonth()+1).toString().padStart(2,"0")}/${d.getDate().toString().padStart(2,"0")}`}))},[e,M,w,h,a,r,t]),i.jsxs("div",{className:c.container,children:[i.jsxs("div",{className:c.header,children:[i.jsx("h3",{className:c.title,children:"Sleep Pattern"}),i.jsxs("div",{className:c.legend,children:[i.jsxs("div",{className:c.legendItem,children:[i.jsx("span",{className:c.sleepDot}),i.jsx("span",{children:"Sleep Time"})]}),i.jsxs("div",{className:c.legendItem,children:[i.jsx("span",{className:c.wakeDot}),i.jsx("span",{children:"Wake Time"})]})]})]}),i.jsx("svg",{ref:n,width:t,height:r,className:c.chart}),s&&i.jsxs("div",{className:`${c.tooltip} ${s?c.visible:""}`,style:{left:`${s.x}px`,top:`${s.y}px`},children:[i.jsxs("div",{className:c.tooltipHeader,children:[i.jsx("span",{className:c.tooltipEmoji,children:"😴"}),i.jsx("span",{children:new Date(s.date).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})})]}),i.jsxs("div",{className:c.tooltipInfo,children:[s.sleepTime&&i.jsxs("div",{className:c.tooltipRow,children:[i.jsxs("span",{className:c.tooltipLabel,children:[i.jsx("span",{children:"🌙"}),i.jsx("span",{children:"Sleep:"})]}),i.jsx("span",{className:c.tooltipValue,children:s.sleepTime})]}),s.wakeTime&&i.jsxs("div",{className:c.tooltipRow,children:[i.jsxs("span",{className:c.tooltipLabel,children:[i.jsx("span",{children:"☀️"}),i.jsx("span",{children:"Wake:"})]}),i.jsx("span",{className:c.tooltipValue,children:s.wakeTime})]}),s.duration!==null&&i.jsxs("div",{className:c.tooltipDuration,children:[i.jsx("span",{children:"⏱️"}),i.jsxs("span",{children:[Math.floor(s.duration),"h ",Math.round(s.duration%1*60),"m"]})]})]})]})]})};ct.__docgenInfo={description:"",methods:[],displayName:"SleepChart",props:{sleepData:{required:!0,tsType:{name:"Array",elements:[{name:"SleepData"}],raw:"SleepData[]"},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}},onDateClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(date: string) => void",signature:{arguments:[{type:{name:"string"},name:"date"}],return:{name:"void"}}},description:""}}};const Ft={title:"Organisms/Charts/SleepChart",component:ct,parameters:{layout:"centered"},argTypes:{width:{control:{type:"number",min:400,max:1200,step:50}},height:{control:{type:"number",min:200,max:600,step:50}},onDateClick:{action:"dateClicked"}}},I=e=>{const t=[],r=new Date;for(let a=e-1;a>=0;a--){const n=new Date(r);n.setDate(n.getDate()-a),t.push(n.toISOString().split("T")[0])}return t},j={args:{sleepData:I(7).map(e=>{const t=Math.floor(Math.random()*3)+22,r=Math.floor(Math.random()*3)+6;return{date:e,sleep_time:`${t%24}:${Math.floor(Math.random()*60).toString().padStart(2,"0")}`,wake_hour:`${r}:${Math.floor(Math.random()*60).toString().padStart(2,"0")}`}}),width:800,height:400}},A={args:{sleepData:I(30).map(e=>({date:e,sleep_time:`${(Math.floor(Math.random()*3)+22)%24}:${Math.floor(Math.random()*60).toString().padStart(2,"0")}`,wake_hour:`${Math.floor(Math.random()*2)+7}:${Math.floor(Math.random()*60).toString().padStart(2,"0")}`})),width:900,height:400}},z={args:{sleepData:I(14).map((e,t)=>{const r=t%7===5||t%7===6,a=r?Math.floor(Math.random()*4)+24:Math.floor(Math.random()*2)+22,n=r?Math.floor(Math.random()*3)+9:Math.floor(Math.random()*2)+6;return{date:e,sleep_time:`${a%24}:${Math.floor(Math.random()*60).toString().padStart(2,"0")}`,wake_hour:`${n}:${Math.floor(Math.random()*60).toString().padStart(2,"0")}`}}),width:850,height:400}},N={args:{sleepData:I(14).map((e,t)=>({date:e,sleep_time:t%3===0?null:`${(Math.floor(Math.random()*3)+22)%24}:30`,wake_hour:t%3===0?null:`${Math.floor(Math.random()*2)+7}:00`})),width:800,height:400}},H={args:{sleepData:[],width:800,height:400}};var F,X,Y;j.parameters={...j.parameters,docs:{...(F=j.parameters)==null?void 0:F.docs,source:{originalSource:`{
|
|
2
2
|
args: {
|
|
3
3
|
sleepData: generateDateRange(7).map(date => {
|
|
4
4
|
const bedHour = Math.floor(Math.random() * 3) + 22;
|