@stfrigerio/sito-template 0.1.99 → 0.1.100
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/components/organisms/charts/BooleansHeatmap/BooleansHeatmap.d.ts.map +1 -1
- package/dist/components/organisms/charts/ChordDiagram/ChordDiagram.d.ts +20 -0
- package/dist/components/organisms/charts/ChordDiagram/ChordDiagram.d.ts.map +1 -0
- package/dist/components/organisms/charts/ChordDiagram/ChordDiagram.stories.d.ts +9 -0
- package/dist/components/organisms/charts/ChordDiagram/ChordDiagram.stories.d.ts.map +1 -0
- package/dist/components/organisms/charts/HabitTimeOfDayChart/HabitTimeOfDayChart.d.ts.map +1 -1
- package/dist/components/organisms/charts/PieChart/PieChart.d.ts.map +1 -1
- package/dist/components/organisms/charts/PolarHeatmap/PolarHeatmap.d.ts +30 -0
- package/dist/components/organisms/charts/PolarHeatmap/PolarHeatmap.d.ts.map +1 -0
- package/dist/components/organisms/charts/PolarHeatmap/PolarHeatmap.stories.d.ts +9 -0
- package/dist/components/organisms/charts/PolarHeatmap/PolarHeatmap.stories.d.ts.map +1 -0
- package/dist/components/organisms/charts/ProgressRings/ProgressRings.d.ts +20 -0
- package/dist/components/organisms/charts/ProgressRings/ProgressRings.d.ts.map +1 -0
- package/dist/components/organisms/charts/ProgressRings/ProgressRings.stories.d.ts +9 -0
- package/dist/components/organisms/charts/ProgressRings/ProgressRings.stories.d.ts.map +1 -0
- package/dist/components/organisms/charts/RadialDayChart/RadialDayChart.d.ts +30 -0
- package/dist/components/organisms/charts/RadialDayChart/RadialDayChart.d.ts.map +1 -0
- package/dist/components/organisms/charts/RadialDayChart/RadialDayChart.stories.d.ts +9 -0
- package/dist/components/organisms/charts/RadialDayChart/RadialDayChart.stories.d.ts.map +1 -0
- package/dist/components/organisms/charts/SleepChart/SleepChart.d.ts.map +1 -1
- package/dist/components/organisms/charts/SunburstChart/SunburstChart.d.ts.map +1 -1
- package/dist/components/organisms/charts/index.d.ts +7 -0
- package/dist/components/organisms/charts/index.d.ts.map +1 -1
- package/dist/components/organisms/index.d.ts +7 -0
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/index.esm.js +962 -302
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +968 -304
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
- package/storybook-static/assets/{ASCIIText.stories-DSI7g-mB.js → ASCIIText.stories-pbbzaeoe.js} +1 -1
- package/storybook-static/assets/{AllAtoms.stories-JflUIS5e.js → AllAtoms.stories-Cl6OlQtE.js} +1 -1
- package/storybook-static/assets/{AnimatedContent.stories-YR7SgIxb.js → AnimatedContent.stories-CBgdeKum.js} +1 -1
- package/storybook-static/assets/{AnimatedList.stories-GR75O93H.js → AnimatedList.stories-BvsDoR0x.js} +1 -1
- package/storybook-static/assets/{Antigravity.stories-B2MVCdRl.js → Antigravity.stories-DDREZ42A.js} +1 -1
- package/storybook-static/assets/{ArrayInput.stories-BI_3D81-.js → ArrayInput.stories-CVoXOB8N.js} +1 -1
- package/storybook-static/assets/{Aurora.stories-C_w705rr.js → Aurora.stories-BBYKIq3G.js} +1 -1
- package/storybook-static/assets/{Beams.stories-D1L26zBi.js → Beams.stories-D3pidC9q.js} +1 -1
- package/storybook-static/assets/{BlobCursor.stories-BjywoQ5q.js → BlobCursor.stories-CGYCm6z4.js} +1 -1
- package/storybook-static/assets/{BlurText.stories-CSpGTebR.js → BlurText.stories-B3O9QJYR.js} +1 -1
- package/storybook-static/assets/BooleansHeatmap.stories-BV9FcXUZ.js +63 -0
- package/storybook-static/assets/{BorderGlow.stories-BadihHiQ.js → BorderGlow.stories-8Gc0vp0f.js} +1 -1
- package/storybook-static/assets/{BubbleMenu.stories-Up_UUIWc.js → BubbleMenu.stories-C4DR01bC.js} +1 -1
- package/storybook-static/assets/{Button-DtiJJxMy.js → Button-83Rb3m5a.js} +1 -1
- package/storybook-static/assets/{Button.stories-BG9uxBwH.js → Button.stories-CBYliITN.js} +1 -1
- package/storybook-static/assets/{Calendar.stories-CUZikQRy.js → Calendar.stories-Dqi94wuY.js} +1 -1
- package/storybook-static/assets/{Card-BrvmNtM2.js → Card-COnu8cMa.js} +1 -1
- package/storybook-static/assets/{Card.stories-Bf_EtMxA.js → Card.stories-Bq9z7byl.js} +1 -1
- package/storybook-static/assets/{CardNav.stories-OiwfVEn3.js → CardNav.stories-Dt55ZFOT.js} +1 -1
- package/storybook-static/assets/{Carousel.stories-Gw1aPaNl.js → Carousel.stories-DPGGh8e2.js} +1 -1
- package/storybook-static/assets/{Checkbox-CJhut6rk.js → Checkbox-DXyNO7YZ.js} +1 -1
- package/storybook-static/assets/{Checkbox.stories-tIqU6B-y.js → Checkbox.stories-XFy6_cHg.js} +1 -1
- package/storybook-static/assets/ChordDiagram-Bk6idINH.css +1 -0
- package/storybook-static/assets/ChordDiagram.stories-BZliaejf.js +25 -0
- package/storybook-static/assets/{ChromaGrid.stories-DbsrxAuC.js → ChromaGrid.stories-CApS2QXP.js} +1 -1
- package/storybook-static/assets/{CircularGallery.stories-0ffqgfyn.js → CircularGallery.stories-BlNX4k_S.js} +1 -1
- package/storybook-static/assets/{CircularText.stories-o46bAR53.js → CircularText.stories-Ceh0rRi1.js} +1 -1
- package/storybook-static/assets/{ClickSpark.stories-Ci-BtpH_.js → ClickSpark.stories-WnLtsFNk.js} +1 -1
- package/storybook-static/assets/{ColorBends.stories-CAiI7Gmw.js → ColorBends.stories-CLsU0EG8.js} +1 -1
- package/storybook-static/assets/{CountUp.stories-CFiYranp.js → CountUp.stories-reozHM_1.js} +1 -1
- package/storybook-static/assets/{Counter.stories-BfaVu_y6.js → Counter.stories-Dku6-Lnw.js} +1 -1
- package/storybook-static/assets/{Crosshair.stories-_Hh1nKQp.js → Crosshair.stories-DybQmZ3h.js} +1 -1
- package/storybook-static/assets/{Cubes.stories-DXBS_f8J.js → Cubes.stories-BjXSc5QW.js} +1 -1
- package/storybook-static/assets/{CurvedLoop.stories-jcgMeMsw.js → CurvedLoop.stories-KgersFw2.js} +1 -1
- package/storybook-static/assets/{DarkVeil.stories-BwtU9vKO.js → DarkVeil.stories-CJBTJSz8.js} +1 -1
- package/storybook-static/assets/{DateInput-6Jn_FyvO.js → DateInput-BLV3e07T.js} +1 -1
- package/storybook-static/assets/{DateInput.stories-C_XBRwB3.js → DateInput.stories-DLRz8fqR.js} +1 -1
- package/storybook-static/assets/{DecayCard.stories-D6kTH79t.js → DecayCard.stories-DGN4O3Mj.js} +1 -1
- package/storybook-static/assets/{DecryptedText.stories-B4xWEvyF.js → DecryptedText.stories-SdAoPuM6.js} +1 -1
- package/storybook-static/assets/{Dither.stories-DmAOxBWe.js → Dither.stories-Dg2Qff92.js} +1 -1
- package/storybook-static/assets/{Dock.stories-AHZywNVf.js → Dock.stories-D74JtWe-.js} +1 -1
- package/storybook-static/assets/{EditFAB.stories-BJ5P85ZN.js → EditFAB.stories-B9Sa836v.js} +1 -1
- package/storybook-static/assets/{EvilEye.stories-D0CBPfm1.js → EvilEye.stories-Cw-2c0HG.js} +1 -1
- package/storybook-static/assets/{FadeContent.stories-D1capsBJ.js → FadeContent.stories-DqJHiF9w.js} +1 -1
- package/storybook-static/assets/{FaultyTerminal.stories-BxqqRf0S.js → FaultyTerminal.stories-MgqyW8nH.js} +1 -1
- package/storybook-static/assets/{Fbo-DvyLCJ1Y.js → Fbo-rjI50RR9.js} +1 -1
- package/storybook-static/assets/{FloatingLines.stories-7ze9ddpl.js → FloatingLines.stories-DmY-Mkaf.js} +1 -1
- package/storybook-static/assets/{FlowingMenu.stories-BX9PD8x2.js → FlowingMenu.stories-DKz3a0Zd.js} +1 -1
- package/storybook-static/assets/{FluidGlass.stories-DynD7GVO.js → FluidGlass.stories-DbWDIAaP.js} +1 -1
- package/storybook-static/assets/{Folder.stories-DDktLoEO.js → Folder.stories-CkEj6N-U.js} +1 -1
- package/storybook-static/assets/{FuzzyText.stories-D9tRARUX.js → FuzzyText.stories-XIFHJ6IE.js} +1 -1
- package/storybook-static/assets/{Galaxy.stories-aSApGekp.js → Galaxy.stories-Bpx63raQ.js} +1 -1
- package/storybook-static/assets/{GhostCursor.stories-5l0di532.js → GhostCursor.stories-DyxjSzii.js} +1 -1
- package/storybook-static/assets/{GlareHover.stories-Dc69-LbU.js → GlareHover.stories-BwQV1tAW.js} +1 -1
- package/storybook-static/assets/{GlassSurface.stories-DETLyc0H.js → GlassSurface.stories-OC5mV8xA.js} +1 -1
- package/storybook-static/assets/{GlitchText.stories-Bzb3ZMSY.js → GlitchText.stories-B0bz69xi.js} +1 -1
- package/storybook-static/assets/{GooeyNav.stories-rxdxJjAy.js → GooeyNav.stories-vKC1eIZ7.js} +1 -1
- package/storybook-static/assets/{GradientBlinds.stories-03LkBbo8.js → GradientBlinds.stories-BlFIa6E1.js} +1 -1
- package/storybook-static/assets/{GradientText.stories-CGo9FyNH.js → GradientText.stories-B662V5lp.js} +1 -1
- package/storybook-static/assets/{Grainient.stories-CzGAEJr-.js → Grainient.stories-ASLiDGhy.js} +1 -1
- package/storybook-static/assets/{GridMotion.stories-BzeBDaK8.js → GridMotion.stories-9vYEfFU5.js} +1 -1
- package/storybook-static/assets/HabitTimeOfDayChart.stories-DFGnkEfQ.js +49 -0
- package/storybook-static/assets/{ImageSlideshow.stories-hoGOc1Gf.js → ImageSlideshow.stories-BDdgiAUd.js} +1 -1
- package/storybook-static/assets/{Iridescence.stories-CQTjQ1lh.js → Iridescence.stories-FZVPa6Zb.js} +1 -1
- package/storybook-static/assets/{LaserFlow.stories-DzkVWskc.js → LaserFlow.stories-DObt_d2n.js} +1 -1
- package/storybook-static/assets/{LetterGlitch.stories-0wcxCpnJ.js → LetterGlitch.stories-Cf_vULWH.js} +1 -1
- package/storybook-static/assets/{LightPillar.stories-C3jRtdg9.js → LightPillar.stories-nZkTB0fq.js} +1 -1
- package/storybook-static/assets/{LightRays.stories-C52kBsnd.js → LightRays.stories-K-i71-tu.js} +1 -1
- package/storybook-static/assets/{Lightning.stories-BFVGqmMh.js → Lightning.stories-ByQwF3RZ.js} +1 -1
- package/storybook-static/assets/{LineWaves.stories-DNdwRrSd.js → LineWaves.stories-CdfUDsCS.js} +1 -1
- package/storybook-static/assets/{LiquidChrome.stories-DFTBXxI6.js → LiquidChrome.stories-BXkNdjZS.js} +1 -1
- package/storybook-static/assets/{LiquidEther.stories-BGYmyfDI.js → LiquidEther.stories-CGpLWWCj.js} +1 -1
- package/storybook-static/assets/{LoadingSpinner-D3Kx-V7J.js → LoadingSpinner-C2iJvHMr.js} +1 -1
- package/storybook-static/assets/{LoadingSpinner.stories-CP70BGAb.js → LoadingSpinner.stories-C9SM_Yp7.js} +1 -1
- package/storybook-static/assets/{MagicRings.stories-BA9xv5mB.js → MagicRings.stories-CDsUclcL.js} +1 -1
- package/storybook-static/assets/{Magnet.stories-cqBYCb-D.js → Magnet.stories-CGvgF9lm.js} +1 -1
- package/storybook-static/assets/{MagnetLines.stories-QkoPnGKj.js → MagnetLines.stories-CAeIkhJn.js} +1 -1
- package/storybook-static/assets/{Masonry.stories-CiGXRf3O.js → Masonry.stories-CUJK0KGB.js} +1 -1
- package/storybook-static/assets/{MetaBalls.stories-3l0pQiKn.js → MetaBalls.stories-Ct_AsbzH.js} +1 -1
- package/storybook-static/assets/{MetallicPaint.stories-DgZJfMr5.js → MetallicPaint.stories-Df_Zgq1A.js} +1 -1
- package/storybook-static/assets/MoodChart.stories-3V2WoSGm.js +40 -0
- package/storybook-static/assets/{MotionConfigContext-BWFxZgdN.js → MotionConfigContext-CRCVf1uh.js} +1 -1
- package/storybook-static/assets/{Navbar.stories-C_Zyfhqr.js → Navbar.stories-DnyCDm9i.js} +1 -1
- package/storybook-static/assets/{Noise.stories-Cg7CucgT.js → Noise.stories-BqQkIZ8v.js} +1 -1
- package/storybook-static/assets/{NumberStepper-DpOu7xmF.js → NumberStepper-Cq7QAruL.js} +1 -1
- package/storybook-static/assets/{NumberStepper.stories-CvG9oY5Q.js → NumberStepper.stories-B9Ektv04.js} +1 -1
- package/storybook-static/assets/{Orb.stories-BR92tgyW.js → Orb.stories-CpdPYpRZ.js} +1 -1
- package/storybook-static/assets/{OrbitImages.stories-D_-2HcAd.js → OrbitImages.stories-B1O85i87.js} +1 -1
- package/storybook-static/assets/PieChart.stories-DEShZFit.js +91 -0
- package/storybook-static/assets/{PixelBlast.stories-B6FXuNf4.js → PixelBlast.stories-toacD96G.js} +1 -1
- package/storybook-static/assets/{PixelCard.stories-Dq4CP2Qj.js → PixelCard.stories-C8QPPRqE.js} +1 -1
- package/storybook-static/assets/{PixelSnow.stories-BoQSOear.js → PixelSnow.stories-DCZqYJ8y.js} +1 -1
- package/storybook-static/assets/{PixelTransition.stories-CtQQ070z.js → PixelTransition.stories-hOlznl24.js} +1 -1
- package/storybook-static/assets/{Plasma.stories-D-421jzZ.js → Plasma.stories-BD2LF5uw.js} +1 -1
- package/storybook-static/assets/PolarHeatmap.stories-CPPy32mr.js +26 -0
- package/storybook-static/assets/{Prism.stories-BuibpwdU.js → Prism.stories-yp33iZTg.js} +1 -1
- package/storybook-static/assets/{PrismaticBurst.stories-CwYzdBlM.js → PrismaticBurst.stories-6MirvK8Q.js} +1 -1
- package/storybook-static/assets/{ProfileCard.stories-Dj4oJCxw.js → ProfileCard.stories-l6W358Jg.js} +1 -1
- package/storybook-static/assets/ProgressRings-CR8t1see.css +1 -0
- package/storybook-static/assets/ProgressRings.stories-DQpINdQ5.js +67 -0
- package/storybook-static/assets/{QuantifiableHabitsChart.stories-ZY1-WQ1g.js → QuantifiableHabitsChart.stories-CAbcMOsL.js} +3 -3
- package/storybook-static/assets/{Radar.stories-DxNmoYV3.js → Radar.stories-cawmnZFr.js} +1 -1
- package/storybook-static/assets/RadialDayChart-CjNQ36HL.css +1 -0
- package/storybook-static/assets/RadialDayChart.stories-D1QVgDAt.js +26 -0
- package/storybook-static/assets/{RecurrencePicker.stories-BAicSNhQ.js → RecurrencePicker.stories-Dj2MXHV4.js} +1 -1
- package/storybook-static/assets/{Ribbons.stories-usN1kCyI.js → Ribbons.stories-CSQ2SZyL.js} +1 -1
- package/storybook-static/assets/{RippleGrid.stories-nTLGHPV6.js → RippleGrid.stories-CwWpTtq1.js} +1 -1
- package/storybook-static/assets/{RotatingText.stories-8CShs_WJ.js → RotatingText.stories-Cuq7WFhZ.js} +1 -1
- package/storybook-static/assets/{ScrollFloat.stories-Dp9YyvHK.js → ScrollFloat.stories-BhUAiHbQ.js} +1 -1
- package/storybook-static/assets/{ScrollReveal.stories-Dy4JUrqi.js → ScrollReveal.stories-D8UDTvCL.js} +1 -1
- package/storybook-static/assets/{ScrollVelocity.stories-CUf-OHNp.js → ScrollVelocity.stories-6VBsKp1n.js} +1 -1
- package/storybook-static/assets/{SearchBar.stories-BKfuRnlK.js → SearchBar.stories-DlWYwaoD.js} +1 -1
- package/storybook-static/assets/{SearchableDropdown-Ctnh_PVq.js → SearchableDropdown-C_Ne0TA3.js} +1 -1
- package/storybook-static/assets/{SearchableDropdown.stories-1d-goy0G.js → SearchableDropdown.stories-nwQqM99l.js} +1 -1
- package/storybook-static/assets/{SelectInput-C94OHQIl.js → SelectInput-39F_8d3i.js} +1 -1
- package/storybook-static/assets/{SelectInput.stories-DPV5iKcs.js → SelectInput.stories-7ET-2BZM.js} +1 -1
- package/storybook-static/assets/{ShapeBlur.stories-CdASN24B.js → ShapeBlur.stories-DuzZfhXI.js} +1 -1
- package/storybook-static/assets/{ShapeGrid.stories-Duzq6qpW.js → ShapeGrid.stories-6Emgz4Xz.js} +1 -1
- package/storybook-static/assets/{ShinyText.stories-Dgqps29_.js → ShinyText.stories-CPR__VsR.js} +1 -1
- package/storybook-static/assets/{Silk.stories-DWnaBFZp.js → Silk.stories-BGWPr5D2.js} +1 -1
- package/storybook-static/assets/SleepChart.stories-Dmf1Hltv.js +58 -0
- package/storybook-static/assets/{Slider-C69QbwVa.js → Slider-D9vb-_lz.js} +1 -1
- package/storybook-static/assets/{Slider.stories-DDhTLU2g.js → Slider.stories-CUNPAtd0.js} +1 -1
- package/storybook-static/assets/{SoftAurora.stories-C5OSOqjj.js → SoftAurora.stories-ChcxW0hb.js} +1 -1
- package/storybook-static/assets/{SoundDemo.stories-sb4V9P8H.js → SoundDemo.stories-VemKEfkR.js} +1 -1
- package/storybook-static/assets/{SplashCursor.stories-PeC0-y78.js → SplashCursor.stories-D1ZTyWhi.js} +1 -1
- package/storybook-static/assets/{SpotlightCard.stories-BCCdQhIJ.js → SpotlightCard.stories-CBaCxWbM.js} +1 -1
- package/storybook-static/assets/{Stack.stories-DJekNsdu.js → Stack.stories-65akIYaj.js} +1 -1
- package/storybook-static/assets/{StaggeredMenu.stories-BU-AxZRv.js → StaggeredMenu.stories-BU40lLcN.js} +1 -1
- package/storybook-static/assets/{StarBorder.stories-Dw9LDvMk.js → StarBorder.stories-Cqh86yZs.js} +1 -1
- package/storybook-static/assets/SunburstChart.stories-BGVtmBel.js +285 -0
- package/storybook-static/assets/{Table.stories-IhtnLV5J.js → Table.stories-m-dD0hDS.js} +1 -1
- package/storybook-static/assets/{Tabs.stories-F_Q4-xiR.js → Tabs.stories-DjpA129B.js} +1 -1
- package/storybook-static/assets/{TargetCursor.stories-B-Tl1DdA.js → TargetCursor.stories-B62hPQV-.js} +1 -1
- package/storybook-static/assets/{TextArea-Bb148SaD.js → TextArea-CMIvdohR.js} +1 -1
- package/storybook-static/assets/{TextArea.stories-5-dHoUPL.js → TextArea.stories-C2ejt4yi.js} +1 -1
- package/storybook-static/assets/{TextCursor.stories-O-EIx7Nu.js → TextCursor.stories-DbSzkVIZ.js} +1 -1
- package/storybook-static/assets/{TextInput-BQ78htqq.js → TextInput-kBi6r-DZ.js} +1 -1
- package/storybook-static/assets/{TextInput.stories-Bjjfu_5O.js → TextInput.stories-BSbA4H9h.js} +1 -1
- package/storybook-static/assets/{TextPressure.stories-BvXWcayn.js → TextPressure.stories-BjYHv0dB.js} +1 -1
- package/storybook-static/assets/{TextType.stories-DL92625c.js → TextType.stories-CTsOM2j0.js} +1 -1
- package/storybook-static/assets/{ThemeSwitcher.stories-BUUyb12v.js → ThemeSwitcher.stories-BUnyRqDi.js} +1 -1
- package/storybook-static/assets/{Threads.stories-C_LDNe0R.js → Threads.stories-CbFZ2-LC.js} +1 -1
- package/storybook-static/assets/{TimeInput.stories-Tj2LrCtN.js → TimeInput.stories-CCYb3ycp.js} +1 -1
- package/storybook-static/assets/{Toggle-BgFXbOVy.js → Toggle-B8i7xSap.js} +1 -1
- package/storybook-static/assets/{Toggle.stories-voNeGmVh.js → Toggle.stories-IhnDej2s.js} +1 -1
- package/storybook-static/assets/{ToggleButton-CQLM9369.js → ToggleButton-DZOeCY6k.js} +1 -1
- package/storybook-static/assets/{ToggleButton.stories-CLdG94qe.js → ToggleButton.stories-Ca6yok5k.js} +1 -1
- package/storybook-static/assets/{TrueFocus.stories-CEC_mKz7.js → TrueFocus.stories-C4zaM767.js} +1 -1
- package/storybook-static/assets/{VariableProximity.stories-CoB68xuF.js → VariableProximity.stories-CZcw99go.js} +1 -1
- package/storybook-static/assets/{Waves.stories-Cpn9tv6C.js → Waves.stories-Mo0BfNOq.js} +1 -1
- package/storybook-static/assets/{arc-DgcIQOLP.js → arc--Q2xWRUA.js} +1 -1
- package/storybook-static/assets/back-BxPoHLz2.js +1 -0
- package/storybook-static/assets/{band-Cq25-Mh7.js → band-D-svgzWl.js} +1 -1
- package/storybook-static/assets/{calendar-B90N4a5g.js → calendar-bUcBNUjV.js} +1 -1
- package/storybook-static/assets/{chart-column-Qn3KVlVm.js → chart-column-CB0l3JOL.js} +1 -1
- package/storybook-static/assets/{check-BdgefYk0.js → check-D11muFzc.js} +1 -1
- package/storybook-static/assets/{chevron-down-rAxqUK0f.js → chevron-down-D5ipCjUH.js} +1 -1
- package/storybook-static/assets/{chevron-right-BQYLOSGD.js → chevron-right-pxDpP2zm.js} +1 -1
- package/storybook-static/assets/client-BcH49jwt.js +1 -0
- package/storybook-static/assets/{createLucideIcon-CanksmPJ.js → createLucideIcon-S7OoTmdc.js} +1 -1
- package/storybook-static/assets/descending-BO6OmMcj.js +1 -0
- package/storybook-static/assets/{download-BoPCl2gy.js → download-nBu86hUE.js} +1 -1
- package/storybook-static/assets/{folder-B0zTnOfo.js → folder-DA8vtXXN.js} +1 -1
- package/storybook-static/assets/{iconBase-jWAd7fUM.js → iconBase-DEIlaCbU.js} +1 -1
- package/storybook-static/assets/{iframe-BTbLpgFM.js → iframe-BxepBtx0.js} +3 -3
- package/storybook-static/assets/{index-8orVvKs3.js → index-4UL0sjOk.js} +1 -1
- package/storybook-static/assets/{index-Dnnp7mc9.js → index-Ct0SUml7.js} +1 -1
- package/storybook-static/assets/{index-D9A3yXPP.js → index-DyYqwgzw.js} +1 -1
- package/storybook-static/assets/linear-BTA54h8k.js +1 -0
- package/storybook-static/assets/monotone-Ca9yXB0X.js +1 -0
- package/storybook-static/assets/path-CSVzDSO0.js +1 -0
- package/storybook-static/assets/{proxy-DHiOkbBq.js → proxy-CriS3ead.js} +1 -1
- package/storybook-static/assets/{react-18-RyhzFaVZ.js → react-18-B5blUeRu.js} +1 -1
- package/storybook-static/assets/{react-three-fiber.esm-DyDueq1t.js → react-three-fiber.esm-Bbpjp-0U.js} +1 -1
- package/storybook-static/assets/{search-C2F8ucQI.js → search-Db-1eb78.js} +1 -1
- package/storybook-static/assets/{settings-B4F4kfld.js → settings-DZmzMR5T.js} +1 -1
- package/storybook-static/assets/{sun-CbGl2Vwt.js → sun-DC4WyAtt.js} +1 -1
- package/storybook-static/assets/{transform-v7fcW145.js → transform-DaumkFRH.js} +1 -1
- package/storybook-static/assets/{trash-2-CNCXZ0wH.js → trash-2-C-dE1YLC.js} +1 -1
- package/storybook-static/assets/{use-animation-frame-DY1VsI4g.js → use-animation-frame-eP0MSTj9.js} +1 -1
- package/storybook-static/assets/{use-in-view-Cawxv_UZ.js → use-in-view-BXgNpgg1.js} +1 -1
- package/storybook-static/assets/{use-motion-value-BKT0PPfP.js → use-motion-value-DWEoPKqa.js} +1 -1
- package/storybook-static/assets/{use-spring-CDH8BIpQ.js → use-spring-CHtlXZ5H.js} +1 -1
- package/storybook-static/assets/{use-transform-Bj0aHFrd.js → use-transform-CWJyn-_D.js} +1 -1
- package/storybook-static/assets/{useSound-OlKqgJtL.js → useSound-B4Mjw5gj.js} +1 -1
- package/storybook-static/assets/{users-Oy8C2tFC.js → users-BKw8hMYi.js} +1 -1
- package/storybook-static/assets/value-CMZJhU-O.js +1 -0
- package/storybook-static/assets/{x-CR0CkM0G.js → x-aUMnvdMn.js} +1 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.json +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/assets/BooleansHeatmap.stories-CKYZW8W5.js +0 -63
- package/storybook-static/assets/HabitTimeOfDayChart.stories-CbMqUfq0.js +0 -49
- package/storybook-static/assets/MoodChart.stories-UXaQU4EG.js +0 -40
- package/storybook-static/assets/PieChart.stories-CjtEiSJY.js +0 -91
- package/storybook-static/assets/SleepChart.stories-C1n9aK7B.js +0 -58
- package/storybook-static/assets/SunburstChart.stories-CE4d4r8-.js +0 -285
- package/storybook-static/assets/client-Chg03P_H.js +0 -1
- package/storybook-static/assets/linear-9syG7RFK.js +0 -1
- package/storybook-static/assets/monotone-B6BFTqpP.js +0 -1
- package/storybook-static/assets/path-CbwjOpE9.js +0 -1
package/storybook-static/assets/{OrbitImages.stories-D_-2HcAd.js → OrbitImages.stories-B1O85i87.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as j,j as c}from"./iframe-
|
|
1
|
+
import{r as j,j as c}from"./iframe-BxepBtx0.js";import{u as K}from"./use-motion-value-DWEoPKqa.js";import{a as Q}from"./index-4UL0sjOk.js";import{u as U}from"./use-transform-CWJyn-_D.js";import{m as X}from"./proxy-CriS3ead.js";import"./preload-helper-C1FmrZbK.js";import"./MotionConfigContext-CRCVf1uh.js";const g={"orbit-container":"_orbit-container_tujj3_1","orbit-scaling-container":"_orbit-scaling-container_tujj3_7","orbit-rotation-wrapper":"_orbit-rotation-wrapper_tujj3_20","orbit-path-svg":"_orbit-path-svg_tujj3_27","orbit-item":"_orbit-item_tujj3_33","orbit-center-content":"_orbit-center-content_tujj3_39","orbit-image":"_orbit-image_tujj3_48"};function P(e,t,r,a){return`M ${e-r} ${t} A ${r} ${a} 0 1 0 ${e+r} ${t} A ${r} ${a} 0 1 0 ${e-r} ${t}`}function S(e,t,r){return P(e,t,r,r)}function Y(e,t,r){const a=r/2;return`M ${e-a} ${t-a} L ${e+a} ${t-a} L ${e+a} ${t+a} L ${e-a} ${t+a} Z`}function x(e,t,r,a){const s=r/2,n=a/2;return`M ${e-s} ${t-n} L ${e+s} ${t-n} L ${e+s} ${t+n} L ${e-s} ${t+n} Z`}function y(e,t,r){const a=r*Math.sqrt(3)/2,s=r/2;return`M ${e} ${t-a/1.5} L ${e+s} ${t+a/3} L ${e-s} ${t+a/3} Z`}function ee(e,t,r,a,s){const n=Math.PI/s;let l="";for(let o=0;o<2*s;o++){const i=o%2===0?r:a,u=o*n-Math.PI/2,f=e+i*Math.cos(u),b=t+i*Math.sin(u);l+=o===0?`M ${f} ${b}`:` L ${f} ${b}`}return l+" Z"}function te(e,t,r){const a=r/30;return`M ${e} ${t+12*a} C ${e-20*a} ${t-5*a}, ${e-12*a} ${t-18*a}, ${e} ${t-8*a} C ${e+12*a} ${t-18*a}, ${e+20*a} ${t-5*a}, ${e} ${t+12*a}`}function ae(e,t,r,a){const s=r/2,n=a/2;return`M ${e} ${t} C ${e+s*.5} ${t-n}, ${e+s} ${t-n}, ${e+s} ${t} C ${e+s} ${t+n}, ${e+s*.5} ${t+n}, ${e} ${t} C ${e-s*.5} ${t+n}, ${e-s} ${t+n}, ${e-s} ${t} C ${e-s} ${t-n}, ${e-s*.5} ${t-n}, ${e} ${t}`}function se(e,t,r,a,s){const n=[],l=s*20,o=r/2;for(let i=0;i<=l;i++){const u=e-o+r*i/l,f=t+Math.sin(i/l*s*2*Math.PI)*a;n.push(i===0?`M ${u} ${f}`:`L ${u} ${f}`)}for(let i=l;i>=0;i--){const u=e-o+r*i/l,f=t-Math.sin(i/l*s*2*Math.PI)*a;n.push(`L ${u} ${f}`)}return n.join(" ")+" Z"}function re({item:e,index:t,totalItems:r,path:a,itemSize:s,rotation:n,progress:l,fill:o}){const i=o?t/r*100:0,u=U(l,f=>`${((f+i)%100+100)%100}%`);return c.jsx(X.div,{className:`${g["orbit-item"]}`,style:{width:s,height:s,offsetPath:`path("${a}")`,offsetRotate:"0deg",offsetAnchor:"center center",offsetDistance:u},children:c.jsx("div",{style:{transform:`rotate(${-n}deg)`},children:e})})}function D({images:e=[],altPrefix:t="Orbiting image",shape:r="ellipse",customPath:a,baseWidth:s=1400,radiusX:n=700,radiusY:l=170,radius:o=300,starPoints:i=5,starInnerRatio:u=.5,rotation:f=-8,duration:b=40,itemSize:T=64,direction:M="normal",fill:W=!0,width:q=100,height:I=100,className:k="",showPath:z=!1,pathColor:B="rgba(0,0,0,0.1)",pathWidth:H=2,easing:w="linear",paused:C=!1,centerContent:L,responsive:h=!1}){const v=j.useRef(null),[O,F]=j.useState(1),d=s/2,p=s/2,R=j.useMemo(()=>{switch(r){case"circle":return S(d,p,o);case"ellipse":return P(d,p,n,l);case"square":return Y(d,p,o*2);case"rectangle":return x(d,p,n*2,l*2);case"triangle":return y(d,p,o*2);case"star":return ee(d,p,o,o*u,i);case"heart":return te(d,p,o*2);case"infinity":return ae(d,p,n*2,l*2);case"wave":return se(d,p,n*2,l,3);case"custom":return a||S(d,p,o);default:return P(d,p,n,l)}},[r,a,d,p,n,l,o,i,u]);j.useEffect(()=>{if(!h||!v.current)return;const m=()=>{v.current&&F(v.current.clientWidth/s)};m();const $=new ResizeObserver(m);return $.observe(v.current),()=>$.disconnect()},[h,s]);const V=K(0);j.useEffect(()=>{if(C)return;const m=Q(V,M==="reverse"?-100:100,{duration:b,ease:w,repeat:1/0,repeatType:"loop"});return()=>m.stop()},[V,b,w,M,C]);const G=h?"100%":typeof q=="number"?q:"100%",J=h?"auto":typeof I=="number"?I:typeof q=="number"?q:"auto",N=e.map((m,$)=>c.jsx("img",{src:m,alt:`${t} ${$+1}`,draggable:!1,className:`${g["orbit-image"]}`},m));return c.jsxs("div",{ref:v,className:`${g["orbit-container"]} ${k}`,style:{width:G,height:J,aspectRatio:h?"1 / 1":void 0},"aria-hidden":"true",children:[c.jsx("div",{className:h?"orbit-scaling-container orbit-scaling-container--responsive":g["orbit-scaling-container"],style:{width:h?s:"100%",height:h?s:"100%",transform:h?`translate(-50%, -50%) scale(${O})`:void 0},children:c.jsxs("div",{className:`${g["orbit-rotation-wrapper"]}`,style:{transform:`rotate(${f}deg)`},children:[z&&c.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${s} ${s}`,className:`${g["orbit-path-svg"]}`,children:c.jsx("path",{d:R,fill:"none",stroke:B,strokeWidth:H/O})}),N.map((m,$)=>c.jsx(re,{item:m,index:$,totalItems:N.length,path:R,itemSize:T,rotation:f,progress:V,fill:W},$))]})}),L&&c.jsx("div",{className:`${g["orbit-center-content"]}`,children:L})]})}D.__docgenInfo={description:"",methods:[],displayName:"OrbitImages",props:{images:{defaultValue:{value:"[]",computed:!1},required:!1},altPrefix:{defaultValue:{value:"'Orbiting image'",computed:!1},required:!1},shape:{defaultValue:{value:"'ellipse'",computed:!1},required:!1},baseWidth:{defaultValue:{value:"1400",computed:!1},required:!1},radiusX:{defaultValue:{value:"700",computed:!1},required:!1},radiusY:{defaultValue:{value:"170",computed:!1},required:!1},radius:{defaultValue:{value:"300",computed:!1},required:!1},starPoints:{defaultValue:{value:"5",computed:!1},required:!1},starInnerRatio:{defaultValue:{value:"0.5",computed:!1},required:!1},rotation:{defaultValue:{value:"-8",computed:!1},required:!1},duration:{defaultValue:{value:"40",computed:!1},required:!1},itemSize:{defaultValue:{value:"64",computed:!1},required:!1},direction:{defaultValue:{value:"'normal'",computed:!1},required:!1},fill:{defaultValue:{value:"true",computed:!1},required:!1},width:{defaultValue:{value:"100",computed:!1},required:!1},height:{defaultValue:{value:"100",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},showPath:{defaultValue:{value:"false",computed:!1},required:!1},pathColor:{defaultValue:{value:"'rgba(0,0,0,0.1)'",computed:!1},required:!1},pathWidth:{defaultValue:{value:"2",computed:!1},required:!1},easing:{defaultValue:{value:"'linear'",computed:!1},required:!1},paused:{defaultValue:{value:"false",computed:!1},required:!1},responsive:{defaultValue:{value:"false",computed:!1},required:!1}}};const pe={title:"ReactBits/Animations/OrbitImages",component:D,parameters:{layout:"fullscreen"}},_={args:{images:["https://picsum.photos/seed/a/200/200","https://picsum.photos/seed/b/200/200","https://picsum.photos/seed/c/200/200","https://picsum.photos/seed/d/200/200","https://picsum.photos/seed/e/200/200","https://picsum.photos/seed/f/200/200"],altPrefix:"Orbiting image",shape:"ellipse",baseWidth:1400,radiusX:700,radiusY:170,radius:300,starPoints:5,starInnerRatio:.5,rotation:-8,duration:40,itemSize:64,direction:"normal",fill:!0,width:100,height:100,showPath:!1,pathColor:"rgba(0,0,0,0.1)",pathWidth:2,easing:"linear",paused:!1,responsive:!1}};var E,Z,A;_.parameters={..._.parameters,docs:{...(E=_.parameters)==null?void 0:E.docs,source:{originalSource:`{
|
|
2
2
|
args: {
|
|
3
3
|
images: ['https://picsum.photos/seed/a/200/200', 'https://picsum.photos/seed/b/200/200', 'https://picsum.photos/seed/c/200/200', 'https://picsum.photos/seed/d/200/200', 'https://picsum.photos/seed/e/200/200', 'https://picsum.photos/seed/f/200/200'],
|
|
4
4
|
altPrefix: 'Orbiting image',
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import{r as k,j as h}from"./iframe-BxepBtx0.js";import{s as S,c as H,b as Q,e as W}from"./transform-DaumkFRH.js";import{a as Z}from"./array-BKyUJesY.js";import{c as w}from"./path-CSVzDSO0.js";import{t as $,a as M}from"./arc--Q2xWRUA.js";import{i as ee}from"./value-CMZJhU-O.js";import"./preload-helper-C1FmrZbK.js";function te(n,a){let o=0;if(a===void 0)for(let c of n)(c=+c)&&(o+=c);else{let c=-1;for(let f of n)(f=+a(f,++c,n))&&(o+=f)}return o}function ne(n,a){return a<n?-1:a>n?1:a>=n?0:NaN}function ae(n){return n}function re(){var n=ae,a=ne,o=null,c=w(0),f=w($),C=w(0);function s(t){var r,i=(t=Z(t)).length,m,D,x=0,A=new Array(i),u=new Array(i),_=+c.apply(this,arguments),b=Math.min($,Math.max(-$,f.apply(this,arguments)-_)),T,L=Math.min(Math.abs(b)/i,C.apply(this,arguments)),R=L*(b<0?-1:1),d;for(r=0;r<i;++r)(d=u[A[r]=r]=+n(t[r],r,t))>0&&(x+=d);for(a!=null?A.sort(function(P,y){return a(u[P],u[y])}):o!=null&&A.sort(function(P,y){return o(t[P],t[y])}),r=0,D=x?(b-i*R)/x:0;r<i;++r,_=T)m=A[r],d=u[m],T=_+(d>0?d*D:0)+R,u[m]={data:t[m],index:r,value:d,startAngle:_,endAngle:T,padAngle:L};return u}return s.value=function(t){return arguments.length?(n=typeof t=="function"?t:w(+t),s):n},s.sortValues=function(t){return arguments.length?(a=t,o=null,s):a},s.sort=function(t){return arguments.length?(o=t,a=null,s):o},s.startAngle=function(t){return arguments.length?(c=typeof t=="function"?t:w(+t),s):c},s.endAngle=function(t){return arguments.length?(f=typeof t=="function"?t:w(+t),s):f},s.padAngle=function(t){return arguments.length?(C=typeof t=="function"?t:w(+t),s):C},s}const oe="_container_1d3zv_1",le="_title_1d3zv_7",se="_chartContainer_1d3zv_15",ie="_chart_1d3zv_15",ce="_legend_1d3zv_26",ue="_legendItem_1d3zv_31",de="_legendColor_1d3zv_45",me="_legendLabel_1d3zv_52",ge="_legendValue_1d3zv_59",pe="_tooltip_1d3zv_65",g={container:oe,title:le,chartContainer:se,chart:ie,legend:ce,legendItem:ue,legendColor:de,legendLabel:me,legendValue:ge,tooltip:pe},p=["#6366f1","#8b5cf6","#06b6d4","#10b981","#f59e0b","#ef4444","#ec4899","#84cc16","#f97316","#3b82f6","#8b5cf6","#14b8a6","#f59e0b","#ef4444","#06b6d4","#10b981"],V=n=>{const a=W(n);if(!a)return"#ffffff";const o=a.rgb();return(.299*o.r+.587*o.g+.114*o.b)/255>.5?"#000000":"#ffffff"},X=({data:n,width:a=400,height:o=400,title:c="Distribution",showLegend:f=!0,unit:C="items",centerLabel:s})=>{const t=k.useRef(null),r=Math.min(a,o)/2-20;return k.useEffect(()=>{if(!t.current||!n.length)return;const i=S(t.current);i.selectAll("*").remove();const m=i.append("g").attr("transform",`translate(${a/2},${o/2})`),D=re().value(e=>e.value).sort(null),x=M().innerRadius(r*.4).outerRadius(r).cornerRadius(4),A=M().innerRadius(r*.7).outerRadius(r*.7),u=S("body").append("div").attr("class",g.tooltip).style("opacity",0).style("position","absolute"),_=D(n),b=te(n,e=>e.value),T=m.selectAll(".arc").data(_).enter().append("g").attr("class","arc"),L=900,R=T.append("path").attr("fill",(e,l)=>e.data.color||p[l%p.length]).attr("stroke","var(--bg-primary)").attr("stroke-width",3).style("cursor","pointer").style("filter","drop-shadow(0 2px 8px rgba(0,0,0,0.15))").attr("d",e=>x({...e,endAngle:e.startAngle}));R.transition().delay(e=>e.startAngle/(2*Math.PI)*L).duration(e=>(e.endAngle-e.startAngle)/(2*Math.PI)*L+200).ease(H).attrTween("d",function(e){const l=ee(e.startAngle,e.endAngle);return v=>x({...e,endAngle:l(v)})||""}),R.on("mouseover",function(e,l){const v=M().innerRadius(r*.4).outerRadius(r*1.05).cornerRadius(4);S(this).transition().duration(200).attr("d",q=>v(q)).style("filter","drop-shadow(0 4px 12px rgba(0,0,0,0.25))"),u.transition().duration(200).style("opacity",1);const I=(l.data.value/b*100).toFixed(1);u.html(`
|
|
2
|
+
<div><strong>${l.data.name}</strong></div>
|
|
3
|
+
<div>Value: ${l.data.value.toLocaleString()}</div>
|
|
4
|
+
<div>${I}% of total</div>
|
|
5
|
+
`).style("left",e.pageX+10+"px").style("top",e.pageY-28+"px")}).on("mouseout",function(e,l){S(this).transition().duration(200).attr("d",v=>x(v)).style("filter","drop-shadow(0 2px 8px rgba(0,0,0,0.15))"),u.transition().duration(500).style("opacity",0)});const d=n.map((e,l)=>e.color||p[l%p.length]),P=d.length>=2?Q.gamma(2.2)(d[0],d[1])(.5):d[0]||"#ffffff",y=V(P);return m.append("text").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("font-size","20px").attr("font-weight","bold").attr("fill",y).style("text-shadow",y==="#ffffff"?"0 1px 3px rgba(0,0,0,0.5)":"0 1px 3px rgba(255,255,255,0.5)").text(s||"Total"),m.append("text").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("y",22).attr("font-size","16px").attr("font-weight","600").attr("fill",y).style("text-shadow",y==="#ffffff"?"0 1px 2px rgba(0,0,0,0.4)":"0 1px 2px rgba(255,255,255,0.4)").text(`${b.toLocaleString()} ${C}`),T.filter(e=>e.endAngle-e.startAngle>.2).append("text").attr("transform",e=>`translate(${A.centroid(e)})`).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("font-size","13px").attr("fill",(e,l)=>{const v=e.data.color||p[l%p.length];return V(v)}).attr("font-weight","600").style("pointer-events","none").style("text-shadow",(e,l)=>{const v=e.data.color||p[l%p.length];return`0 1px 2px ${V(v)==="#ffffff"?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.4)"}`}).text(e=>{const l=e.data.value/b*100;return l>8?`${l.toFixed(0)}%`:""}).style("opacity",0).transition().delay(e=>(e.startAngle+e.endAngle)/2/(2*Math.PI)*L+250).duration(300).style("opacity",1),()=>{u.remove()}},[n,a,o,r,s,C]),h.jsxs("div",{className:g.container,children:[h.jsx("h3",{className:g.title,children:c}),h.jsxs("div",{className:g.chartContainer,children:[h.jsx("svg",{ref:t,width:a,height:o,className:g.chart}),f&&h.jsx("div",{className:g.legend,children:n.map((i,m)=>h.jsxs("div",{className:g.legendItem,children:[h.jsx("span",{className:g.legendColor,style:{backgroundColor:i.color||p[m%p.length]}}),h.jsx("span",{className:g.legendLabel,children:i.name}),h.jsx("span",{className:g.legendValue,children:i.value.toLocaleString()})]},i.name))})]})]})};X.__docgenInfo={description:"",methods:[],displayName:"PieChart",props:{data:{required:!0,tsType:{name:"Array",elements:[{name:"PieDataPoint"}],raw:"PieDataPoint[]"},description:""},width:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"400",computed:!1}},height:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"400",computed:!1}},title:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'Distribution'",computed:!1}},showLegend:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},unit:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'items'",computed:!1}},centerLabel:{required:!1,tsType:{name:"string"},description:""}}};const Ce={title:"Organisms/Charts/PieChart",component:X,parameters:{layout:"centered"},argTypes:{width:{control:{type:"number",min:300,max:700,step:50}},height:{control:{type:"number",min:300,max:700,step:50}},title:{control:{type:"text"}},showLegend:{control:{type:"boolean"}}}},j={args:{data:[{name:"Frontend Development",value:35,color:"#8b5cf6"},{name:"Backend Development",value:25,color:"#3b82f6"},{name:"Meetings",value:15,color:"#10b981"},{name:"Code Review",value:10,color:"#f59e0b"},{name:"Documentation",value:8,color:"#ec4899"},{name:"Testing",value:7,color:"#14b8a6"}],width:500,height:500,title:"Project Time Allocation",showLegend:!0}},N={args:{data:[{name:"Yes",value:73,color:"#10b981"},{name:"No",value:27,color:"#ef4444"}],width:350,height:350,title:"Survey Results",showLegend:!1}},z={args:{data:[{name:"JavaScript",value:25},{name:"Python",value:20},{name:"Java",value:15},{name:"TypeScript",value:12},{name:"C++",value:8},{name:"C#",value:6},{name:"Go",value:5},{name:"Rust",value:4},{name:"Swift",value:3},{name:"Kotlin",value:2}],width:600,height:600,title:"Programming Language Usage",showLegend:!0}};var E,F,O;j.parameters={...j.parameters,docs:{...(E=j.parameters)==null?void 0:E.docs,source:{originalSource:`{
|
|
6
|
+
args: {
|
|
7
|
+
data: [{
|
|
8
|
+
name: 'Frontend Development',
|
|
9
|
+
value: 35,
|
|
10
|
+
color: '#8b5cf6'
|
|
11
|
+
}, {
|
|
12
|
+
name: 'Backend Development',
|
|
13
|
+
value: 25,
|
|
14
|
+
color: '#3b82f6'
|
|
15
|
+
}, {
|
|
16
|
+
name: 'Meetings',
|
|
17
|
+
value: 15,
|
|
18
|
+
color: '#10b981'
|
|
19
|
+
}, {
|
|
20
|
+
name: 'Code Review',
|
|
21
|
+
value: 10,
|
|
22
|
+
color: '#f59e0b'
|
|
23
|
+
}, {
|
|
24
|
+
name: 'Documentation',
|
|
25
|
+
value: 8,
|
|
26
|
+
color: '#ec4899'
|
|
27
|
+
}, {
|
|
28
|
+
name: 'Testing',
|
|
29
|
+
value: 7,
|
|
30
|
+
color: '#14b8a6'
|
|
31
|
+
}],
|
|
32
|
+
width: 500,
|
|
33
|
+
height: 500,
|
|
34
|
+
title: 'Project Time Allocation',
|
|
35
|
+
showLegend: true
|
|
36
|
+
}
|
|
37
|
+
}`,...(O=(F=j.parameters)==null?void 0:F.docs)==null?void 0:O.source}}};var J,U,Y;N.parameters={...N.parameters,docs:{...(J=N.parameters)==null?void 0:J.docs,source:{originalSource:`{
|
|
38
|
+
args: {
|
|
39
|
+
data: [{
|
|
40
|
+
name: 'Yes',
|
|
41
|
+
value: 73,
|
|
42
|
+
color: '#10b981'
|
|
43
|
+
}, {
|
|
44
|
+
name: 'No',
|
|
45
|
+
value: 27,
|
|
46
|
+
color: '#ef4444'
|
|
47
|
+
}],
|
|
48
|
+
width: 350,
|
|
49
|
+
height: 350,
|
|
50
|
+
title: 'Survey Results',
|
|
51
|
+
showLegend: false
|
|
52
|
+
}
|
|
53
|
+
}`,...(Y=(U=N.parameters)==null?void 0:U.docs)==null?void 0:Y.source}}};var B,G,K;z.parameters={...z.parameters,docs:{...(B=z.parameters)==null?void 0:B.docs,source:{originalSource:`{
|
|
54
|
+
args: {
|
|
55
|
+
data: [{
|
|
56
|
+
name: 'JavaScript',
|
|
57
|
+
value: 25
|
|
58
|
+
}, {
|
|
59
|
+
name: 'Python',
|
|
60
|
+
value: 20
|
|
61
|
+
}, {
|
|
62
|
+
name: 'Java',
|
|
63
|
+
value: 15
|
|
64
|
+
}, {
|
|
65
|
+
name: 'TypeScript',
|
|
66
|
+
value: 12
|
|
67
|
+
}, {
|
|
68
|
+
name: 'C++',
|
|
69
|
+
value: 8
|
|
70
|
+
}, {
|
|
71
|
+
name: 'C#',
|
|
72
|
+
value: 6
|
|
73
|
+
}, {
|
|
74
|
+
name: 'Go',
|
|
75
|
+
value: 5
|
|
76
|
+
}, {
|
|
77
|
+
name: 'Rust',
|
|
78
|
+
value: 4
|
|
79
|
+
}, {
|
|
80
|
+
name: 'Swift',
|
|
81
|
+
value: 3
|
|
82
|
+
}, {
|
|
83
|
+
name: 'Kotlin',
|
|
84
|
+
value: 2
|
|
85
|
+
}],
|
|
86
|
+
width: 600,
|
|
87
|
+
height: 600,
|
|
88
|
+
title: 'Programming Language Usage',
|
|
89
|
+
showLegend: true
|
|
90
|
+
}
|
|
91
|
+
}`,...(K=(G=z.parameters)==null?void 0:G.docs)==null?void 0:K.source}}};const Ae=["Default","TwoCategories","ManyCategories"];export{j as Default,z as ManyCategories,N as TwoCategories,Ae as __namedExportsOrder,Ce as default};
|
package/storybook-static/assets/{PixelBlast.stories-B6FXuNf4.js → PixelBlast.stories-toacD96G.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as z,j as Ee}from"./iframe-
|
|
1
|
+
import{r as z,j as Ee}from"./iframe-BxepBtx0.js";import{E as re,R as le,b as ie,a as me}from"./index-DcRHiSf7.js";import{W as we,d as ne,n as Re,S as Ce,a as Pe,i as qe,a9 as Te,q as be,M as Ae,f as ze,G as M,a2 as Me,z as se}from"./three.module--_vTUKhS.js";import"./preload-helper-C1FmrZbK.js";const Fe={"pixel-blast-container":"_pixel-blast-container_a95g7_1"},ke=()=>{const l=document.createElement("canvas");l.width=64,l.height=64;const i=l.getContext("2d");if(!i)throw new Error("2D context not available");i.fillStyle="black",i.fillRect(0,0,l.width,l.height);const T=new Me(l);T.minFilter=se,T.magFilter=se,T.generateMipmaps=!1;const E=[];let w=null;const m=64;let R=.1*64;const F=1/m,k=()=>{i.fillStyle="black",i.fillRect(0,0,l.width,l.height)},I=a=>{const n={x:a.x*64,y:(1-a.y)*64};let c=1;const C=v=>Math.sin(v*Math.PI/2),g=v=>-v*(v-2);a.age<m*.3?c=C(a.age/(m*.3)):c=g(1-(a.age-m*.3)/(m*.7))||0,c*=a.force;const h=`${(a.vx+1)/2*255}, ${(a.vy+1)/2*255}, ${c*255}`,p=64*5;i.shadowOffsetX=p,i.shadowOffsetY=p,i.shadowBlur=R,i.shadowColor=`rgba(${h},${.22*c})`,i.beginPath(),i.fillStyle="rgba(255,0,0,1)",i.arc(n.x-p,n.y-p,R,0,Math.PI*2),i.fill()};return{canvas:l,texture:T,addTouch:a=>{let n=0,c=0,C=0;if(w){const g=a.x-w.x,h=a.y-w.y;if(g===0&&h===0)return;const p=g*g+h*h,v=Math.sqrt(p);c=g/(v||1),C=h/(v||1),n=Math.min(p*1e4,1)}w={x:a.x,y:a.y},E.push({x:a.x,y:a.y,age:0,force:n,vx:c,vy:C})},update:()=>{k();for(let a=E.length-1;a>=0;a--){const n=E[a],c=n.force*F*(1-n.age/m);n.x+=n.vx*c,n.y+=n.vy*c,n.age++,n.age>m&&E.splice(a,1)}for(let a=0;a<E.length;a++)I(E[a]);T.needsUpdate=!0},set radiusScale(a){R=.1*64*a},get radiusScale(){return R/(.1*64)},size:64}},Ie=(b,l)=>{const i=`
|
|
2
2
|
uniform sampler2D uTexture;
|
|
3
3
|
uniform float uStrength;
|
|
4
4
|
uniform float uTime;
|
package/storybook-static/assets/{PixelCard.stories-Dq4CP2Qj.js → PixelCard.stories-C8QPPRqE.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as V}from"./iframe-
|
|
1
|
+
import{r as l,j as V}from"./iframe-BxepBtx0.js";import"./preload-helper-C1FmrZbK.js";const q={"pixel-canvas":"_pixel-canvas_wo94u_1","pixel-card":"_pixel-card_wo94u_7"};class J{constructor(t,u,p,x,i,y,n){this.width=t.width,this.height=t.height,this.ctx=u,this.x=p,this.y=x,this.color=i,this.speed=this.getRandomValue(.1,.9)*y,this.size=0,this.sizeStep=Math.random()*.4,this.minSize=.5,this.maxSizeInteger=2,this.maxSize=this.getRandomValue(this.minSize,this.maxSizeInteger),this.delay=n,this.counter=0,this.counterStep=Math.random()*4+(this.width+this.height)*.01,this.isIdle=!1,this.isReverse=!1,this.isShimmer=!1}getRandomValue(t,u){return Math.random()*(u-t)+t}draw(){const t=this.maxSizeInteger*.5-this.size*.5;this.ctx.fillStyle=this.color,this.ctx.fillRect(this.x+t,this.y+t,this.size,this.size)}appear(){if(this.isIdle=!1,this.counter<=this.delay){this.counter+=this.counterStep;return}this.size>=this.maxSize&&(this.isShimmer=!0),this.isShimmer?this.shimmer():this.size+=this.sizeStep,this.draw()}disappear(){if(this.isShimmer=!1,this.counter=0,this.size<=0){this.isIdle=!0;return}else this.size-=.1;this.draw()}shimmer(){this.size>=this.maxSize?this.isReverse=!0:this.size<=this.minSize&&(this.isReverse=!1),this.isReverse?this.size-=this.speed:this.size+=this.speed}}function K(m,t){const i=parseInt(m,10);return i<=0||t?0:i>=100?100*.001:i*.001}const T={default:{activeColor:null,gap:5,speed:35,colors:"#f8fafc,#f1f5f9,#cbd5e1",noFocus:!1},blue:{activeColor:"#e0f2fe",gap:10,speed:25,colors:"#e0f2fe,#7dd3fc,#0ea5e9",noFocus:!1},yellow:{activeColor:"#fef08a",gap:3,speed:20,colors:"#fef08a,#fde047,#eab308",noFocus:!1},pink:{activeColor:"#fecdd3",gap:6,speed:80,colors:"#fecdd3,#fda4af,#e11d48",noFocus:!0}};function O({variant:m="default",gap:t,speed:u,colors:p,noFocus:x,className:i="",children:y}){const n=l.useRef(null),s=l.useRef(null),I=l.useRef([]),h=l.useRef(null),F=l.useRef(performance.now()),M=l.useRef(window.matchMedia("(prefers-reduced-motion: reduce)").matches).current,g=T[m]||T.default,C=t??g.gap,A=u??g.speed,_=p??g.colors,v=x??g.noFocus,b=()=>{if(!n.current||!s.current)return;const e=n.current.getBoundingClientRect(),a=Math.floor(e.width),o=Math.floor(e.height),z=s.current.getContext("2d");s.current.width=a,s.current.height=o,s.current.style.width=`${a}px`,s.current.style.height=`${o}px`;const d=_.split(","),f=[];for(let c=0;c<a;c+=parseInt(C,10))for(let r=0;r<o;r+=parseInt(C,10)){const S=d[Math.floor(Math.random()*d.length)],E=c-a/2,N=r-o/2,G=Math.sqrt(E*E+N*N),L=M?0:G;f.push(new J(s.current,z,c,r,S,K(A,M),L))}I.current=f},P=e=>{var c;h.current=requestAnimationFrame(()=>P(e));const a=performance.now(),o=a-F.current,z=1e3/60;if(o<z)return;F.current=a-o%z;const d=(c=s.current)==null?void 0:c.getContext("2d");if(!d||!s.current)return;d.clearRect(0,0,s.current.width,s.current.height);let f=!0;for(let r=0;r<I.current.length;r++){const S=I.current[r];S[e](),S.isIdle||(f=!1)}f&&cancelAnimationFrame(h.current)},R=e=>{cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>P(e))},D=()=>R("appear"),H=()=>R("disappear"),W=e=>{e.currentTarget.contains(e.relatedTarget)||R("appear")},k=e=>{e.currentTarget.contains(e.relatedTarget)||R("disappear")};return l.useEffect(()=>{b();const e=new ResizeObserver(()=>{b()});return n.current&&e.observe(n.current),()=>{e.disconnect(),cancelAnimationFrame(h.current)}},[C,A,_,v]),V.jsxs("div",{ref:n,className:`${q["pixel-card"]} ${i}`,onMouseEnter:D,onMouseLeave:H,onFocus:v?void 0:W,onBlur:v?void 0:k,tabIndex:v?-1:0,children:[V.jsx("canvas",{className:`${q["pixel-canvas"]}`,ref:s}),y]})}O.__docgenInfo={description:"",methods:[],displayName:"PixelCard",props:{variant:{defaultValue:{value:"'default'",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1}}};const X={title:"ReactBits/Components/PixelCard",component:O,parameters:{layout:"fullscreen"}},w={args:{variant:"default",children:"Hello World"}};var $,j,B;w.parameters={...w.parameters,docs:{...($=w.parameters)==null?void 0:$.docs,source:{originalSource:`{
|
|
2
2
|
args: {
|
|
3
3
|
variant: 'default',
|
|
4
4
|
children: 'Hello World'
|
package/storybook-static/assets/{PixelSnow.stories-BoQSOear.js → PixelSnow.stories-DCZqYJ8y.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,j as B}from"./iframe-
|
|
1
|
+
import{r as t,j as B}from"./iframe-BxepBtx0.js";import{n as K,e as O,S as T,a as U,W as X,i as G,d as H,q as W,M as Y}from"./three.module--_vTUKhS.js";import"./preload-helper-C1FmrZbK.js";const J={"pixel-snow-container":"_pixel-snow-container_udm6i_1"},L=`
|
|
2
2
|
void main() {
|
|
3
3
|
gl_Position = vec4(position, 1.0);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r,j as l}from"./iframe-
|
|
1
|
+
import{r,j as l}from"./iframe-BxepBtx0.js";import{g as d}from"./index-C8pce-KX.js";import"./preload-helper-C1FmrZbK.js";const c={"pixelated-image-card":"_pixelated-image-card_12og9_1","pixelated-image-card__default":"_pixelated-image-card__default_12og9_12","pixelated-image-card__active":"_pixelated-image-card__active_12og9_13","pixelated-image-card__pixels":"_pixelated-image-card__pixels_12og9_14","pixelated-image-card__pixel":"_pixelated-image-card__pixel_12og9_14"};function E({firstContent:b,secondContent:F,gridSize:u=7,pixelColor:_="currentColor",animationStepDuration:m=.3,once:v=!1,aspectRatio:$="100%",className:q="",style:S={}}){const T=r.useRef(null),x=r.useRef(null),h=r.useRef(null),g=r.useRef(null),[i,I]=r.useState(!1),o="ontouchstart"in window||navigator.maxTouchPoints>0||window.matchMedia("(pointer: coarse)").matches;r.useEffect(()=>{const t=x.current;if(t){t.innerHTML="";for(let n=0;n<u;n++)for(let a=0;a<u;a++){const e=document.createElement("div");e.classList.add(c["pixelated-image-card__pixel"]),e.setAttribute("data-pixel",""),e.style.backgroundColor=_;const s=100/u;e.style.width=`${s}%`,e.style.height=`${s}%`,e.style.left=`${a*s}%`,e.style.top=`${n*s}%`,t.appendChild(e)}}},[u,_]);const f=t=>{I(t);const n=x.current,a=h.current;if(!n||!a)return;const e=n.querySelectorAll("[data-pixel]");if(!e.length)return;d.killTweensOf(e),g.current&&g.current.kill(),d.set(e,{display:"none"});const s=e.length,R=m/s;d.to(e,{display:"block",duration:0,stagger:{each:R,from:"random"}}),g.current=d.delayedCall(m,()=>{a.style.display=t?"block":"none",a.style.pointerEvents=t?"none":""}),d.to(e,{display:"none",duration:0,delay:m,stagger:{each:R,from:"random"}})},y=()=>{i||f(!0)},C=()=>{i&&!v&&f(!1)},V=()=>{i?i&&!v&&f(!1):f(!0)};return l.jsxs("div",{ref:T,className:`${c["pixelated-image-card"]} ${q}`,style:S,onMouseEnter:o?void 0:y,onMouseLeave:o?void 0:C,onClick:o?V:void 0,onFocus:o?void 0:y,onBlur:o?void 0:C,tabIndex:0,children:[l.jsx("div",{style:{paddingTop:$}}),l.jsx("div",{className:`${c["pixelated-image-card__default"]}`,"aria-hidden":i,children:b}),l.jsx("div",{className:`${c["pixelated-image-card__active"]}`,ref:h,"aria-hidden":!i,children:F}),l.jsx("div",{className:`${c["pixelated-image-card__pixels"]}`,ref:x})]})}E.__docgenInfo={description:"",methods:[],displayName:"PixelTransition",props:{gridSize:{defaultValue:{value:"7",computed:!1},required:!1},pixelColor:{defaultValue:{value:"'currentColor'",computed:!1},required:!1},animationStepDuration:{defaultValue:{value:"0.3",computed:!1},required:!1},once:{defaultValue:{value:"false",computed:!1},required:!1},aspectRatio:{defaultValue:{value:"'100%'",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1}}};const A={title:"ReactBits/Animations/PixelTransition",component:E,parameters:{layout:"fullscreen"}},p={args:{firstContent:l.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"#1a1a2e",color:"#fff",fontSize:"2rem"},children:"Hover me"}),secondContent:l.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"#5227FF",color:"#fff",fontSize:"2rem"},children:"Revealed!"}),gridSize:7,pixelColor:"#5227FF",aspectRatio:"100%"}};var j,k,w;p.parameters={...p.parameters,docs:{...(j=p.parameters)==null?void 0:j.docs,source:{originalSource:`{
|
|
2
2
|
args: {
|
|
3
3
|
firstContent: <div style={{
|
|
4
4
|
width: '100%',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as y,j as U}from"./iframe-
|
|
1
|
+
import{r as y,j as U}from"./iframe-BxepBtx0.js";import{R as E,P as Q,M as j}from"./Mesh-CwXV3WjE.js";import{T as k}from"./Triangle-64ffRKNB.js";import"./preload-helper-C1FmrZbK.js";const L={"plasma-container":"_plasma-container_4c6hx_1"},N=n=>{const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return o?[parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255]:[1,.5,.2]},$=`#version 300 es
|
|
2
2
|
precision highp float;
|
|
3
3
|
in vec2 position;
|
|
4
4
|
in vec2 uv;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{r as f,j as v}from"./iframe-BxepBtx0.js";import{s as X,c as J}from"./transform-DaumkFRH.js";import{a as K}from"./arc--Q2xWRUA.js";import"./preload-helper-C1FmrZbK.js";import"./path-CSVzDSO0.js";const Q="_container_1c0jn_1",Z="_svgWrap_1c0jn_9",tt="_tooltip_1c0jn_15",et="_visible_1c0jn_31",at="_tipLabel_1c0jn_35",rt="_tipRow_1c0jn_40",m={container:Q,svgWrap:Z,tooltip:tt,visible:et,tipLabel:at,tipRow:rt},st="#c8a14a",W=({cells:p,days:e,accentColor:a=st,centerTopLabel:i,centerMainLabel:u,size:y,minSize:b=320,maxSize:R=560})=>{const A=f.useRef(null),_=f.useRef(null),j=f.useRef(null),[Y,G]=f.useState(560),g=y??Y;f.useEffect(()=>{if(y)return;const o=A.current;if(!o)return;const s=new ResizeObserver(n=>{for(const d of n){const c=d.contentRect.width;c>0&&G(Math.max(b,Math.min(R,c)))}});return s.observe(o),()=>s.disconnect()},[y,b,R]);const O=f.useCallback((o,s)=>{const n=j.current,d=A.current;if(!n||!d)return;const c=d.getBoundingClientRect();n.style.left=`${o.clientX-c.left+12}px`,n.style.top=`${o.clientY-c.top-10}px`,n.innerHTML=s,n.classList.add(m.visible)},[]),z=f.useCallback(()=>{var o;(o=j.current)==null||o.classList.remove(m.visible)},[]);return f.useEffect(()=>{if(!_.current||p.length===0||e<=0)return;const o=X(_.current);o.selectAll("*").remove();const s=g/2-32,n=64,d=4,c=(s-n-d*(e-1))/e,V=o.append("defs"),$=`polar-heatmap-glow-${Math.random().toString(36).slice(2,9)}`,S=V.append("radialGradient").attr("id",$).attr("cx","50%").attr("cy","50%").attr("r","50%");S.append("stop").attr("offset","0%").attr("stop-color",a).attr("stop-opacity",.18),S.append("stop").attr("offset","60%").attr("stop-color",a).attr("stop-opacity",.05),S.append("stop").attr("offset","100%").attr("stop-color",a).attr("stop-opacity",0);const l=o.attr("width",g).attr("height",g).append("g").attr("transform",`translate(${g/2}, ${g/2})`),h=t=>t/24*Math.PI*2;l.append("circle").attr("r",s+44).attr("fill",`url(#${$})`);for(let t=0;t<24;t++){const r=h(t)-Math.PI/2;l.append("line").attr("x1",Math.cos(r)*n).attr("y1",Math.sin(r)*n).attr("x2",Math.cos(r)*(s+6)).attr("y2",Math.sin(r)*(s+6)).attr("stroke",a).attr("stroke-width",t%3===0?.7:.35).attr("opacity",t%3===0?.55:.25)}const F=K().innerRadius(t=>s-t.dayOffset*(c+d)-c).outerRadius(t=>s-t.dayOffset*(c+d)).startAngle(t=>h(t.hour)).endAngle(t=>h(t.hour+1)).padAngle(.014).cornerRadius(2.5),B=p.filter(t=>t.dayOffset>=0&&t.dayOffset<e&&t.hour>=0&&t.hour<24);l.selectAll("path.cell").data(B).join("path").attr("class","cell").attr("d",F).attr("fill",t=>t.color).attr("opacity",0).style("cursor",t=>t.label?"pointer":"default").on("mousemove",function(t,r){if(!r.label)return;const x=`${String(r.hour).padStart(2,"0")}:00`,U=r.dayLabel??(r.dayOffset===0?"Today":`${r.dayOffset} days ago`);O(t,`<div class="${m.tipLabel}">${r.emoji??""} ${r.label}</div><div class="${m.tipRow}">${U} · ${x}</div>`)}).on("mouseleave",z).transition().delay(t=>t.hour/24*600+t.dayOffset*30).duration(380).ease(J).attr("opacity",t=>t.label?.88:0),l.append("circle").attr("r",s+16).attr("fill","none").attr("stroke",a).attr("stroke-width",.4).attr("opacity",.4);for(let t=0;t<48;t++){const r=t/48*Math.PI*2-Math.PI/2;l.append("circle").attr("cx",Math.cos(r)*(s+12)).attr("cy",Math.sin(r)*(s+12)).attr("r",t%2===0?1.4:.6).attr("fill",a).attr("opacity",t%2===0?.75:.4)}for(let t=0;t<24;t+=3){const r=h(t)-Math.PI/2,x=s+28;l.append("text").attr("x",Math.cos(r)*x).attr("y",Math.sin(r)*x).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("fill",a).attr("font-size","11px").attr("font-weight",600).attr("letter-spacing","1px").attr("opacity",.85).text(String(t).padStart(2,"0"))}l.append("circle").attr("r",n-4).attr("fill","var(--color-background)"),l.append("circle").attr("r",3).attr("fill",a).attr("opacity",.9),i&&l.append("text").attr("text-anchor","middle").attr("y",n-33).attr("fill",a).attr("font-size","9px").attr("letter-spacing","3px").attr("opacity",.85).text(i),u&&l.append("text").attr("text-anchor","middle").attr("y",n+2).attr("fill",a).attr("font-size","14px").attr("font-weight",700).attr("letter-spacing","2px").attr("opacity",.95).text(u)},[p,e,g,a,i,u,O,z]),v.jsxs("div",{className:m.container,ref:A,children:[v.jsx("div",{className:m.svgWrap,children:v.jsx("svg",{ref:_})}),v.jsx("div",{ref:j,className:m.tooltip})]})};W.__docgenInfo={description:"",methods:[],displayName:"PolarHeatmap",props:{cells:{required:!0,tsType:{name:"Array",elements:[{name:"PolarHeatmapCell"}],raw:"PolarHeatmapCell[]"},description:"Cells: one per (dayOffset, hour). Empty cells can be omitted or set to color='transparent'"},days:{required:!0,tsType:{name:"number"},description:"Number of concentric day rings. Cells with dayOffset >= days are ignored"},accentColor:{required:!1,tsType:{name:"string"},description:"Accent color for ornamental dots/lines/labels around the rim",defaultValue:{value:"'#c8a14a'",computed:!1}},centerTopLabel:{required:!1,tsType:{name:"string"},description:""},centerMainLabel:{required:!1,tsType:{name:"string"},description:""},size:{required:!1,tsType:{name:"number"},description:"Override the size; otherwise the chart fills its container up to maxSize"},minSize:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"320",computed:!1}},maxSize:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"560",computed:!1}}}};const ut={title:"Organisms/Charts/PolarHeatmap",component:W,parameters:{layout:"centered"}},nt={work:{color:"#6366f1",emoji:"💼"},sleep:{color:"#1e293b",emoji:"😴"},eat:{color:"#f59e0b",emoji:"🍽️"},sport:{color:"#10b981",emoji:"🏃"},play:{color:"#ec4899",emoji:"🎮"},read:{color:"#8b5cf6",emoji:"📚"}},ot=(p,e)=>e<7?"sleep":e===7?"eat":e>=8&&e<=12?p%6===0?"play":"work":e===13?"eat":e>=14&&e<=17?p%5===0?"sport":"work":e===18?"sport":e===19||e===20?"eat":e>=21&&e<=22?"read":e===23?"sleep":null,w=p=>{const e=[];for(let a=0;a<p;a++)for(let i=0;i<24;i++){const u=ot(a,i);if(!u){e.push({dayOffset:a,hour:i,color:"transparent"});continue}const y=nt[u],b=a===0?"Today":a===1?"Yesterday":`${a} days ago`;e.push({dayOffset:a,hour:i,color:y.color,emoji:y.emoji,label:u,dayLabel:b})}return e},T={args:{cells:w(30),days:30,centerTopLabel:"LAST",centerMainLabel:"30 DAYS",size:520}},L={args:{cells:w(7),days:7,centerTopLabel:"LAST",centerMainLabel:"7 DAYS",size:460}},M={args:{cells:w(30),days:30,accentColor:"#7c3aed",centerTopLabel:"PAST",centerMainLabel:"MONTH",size:520}};var k,P,C;T.parameters={...T.parameters,docs:{...(k=T.parameters)==null?void 0:k.docs,source:{originalSource:`{
|
|
2
|
+
args: {
|
|
3
|
+
cells: generateCells(30),
|
|
4
|
+
days: 30,
|
|
5
|
+
centerTopLabel: 'LAST',
|
|
6
|
+
centerMainLabel: '30 DAYS',
|
|
7
|
+
size: 520
|
|
8
|
+
}
|
|
9
|
+
}`,...(C=(P=T.parameters)==null?void 0:P.docs)==null?void 0:C.source}}};var q,E,H;L.parameters={...L.parameters,docs:{...(q=L.parameters)==null?void 0:q.docs,source:{originalSource:`{
|
|
10
|
+
args: {
|
|
11
|
+
cells: generateCells(7),
|
|
12
|
+
days: 7,
|
|
13
|
+
centerTopLabel: 'LAST',
|
|
14
|
+
centerMainLabel: '7 DAYS',
|
|
15
|
+
size: 460
|
|
16
|
+
}
|
|
17
|
+
}`,...(H=(E=L.parameters)==null?void 0:E.docs)==null?void 0:H.source}}};var N,D,I;M.parameters={...M.parameters,docs:{...(N=M.parameters)==null?void 0:N.docs,source:{originalSource:`{
|
|
18
|
+
args: {
|
|
19
|
+
cells: generateCells(30),
|
|
20
|
+
days: 30,
|
|
21
|
+
accentColor: '#7c3aed',
|
|
22
|
+
centerTopLabel: 'PAST',
|
|
23
|
+
centerMainLabel: 'MONTH',
|
|
24
|
+
size: 520
|
|
25
|
+
}
|
|
26
|
+
}`,...(I=(D=M.parameters)==null?void 0:D.docs)==null?void 0:I.source}}};const mt=["Default","Week","CustomAccent"];export{M as CustomAccent,T as Default,L as Week,mt as __namedExportsOrder,ut as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as le,j as Ne}from"./iframe-
|
|
1
|
+
import{r as le,j as Ne}from"./iframe-BxepBtx0.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-BxepBtx0.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-Dj4oJCxw.js → ProfileCard.stories-l6W358Jg.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-BxepBtx0.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,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._container_1jujk_1{position:relative;width:100%}._grid_1jujk_6{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--spacing-md)}._ring_1jujk_13{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;cursor:pointer}._svg_1jujk_22{display:block}._center_1jujk_26{position:absolute;top:60px;left:0;right:0;display:flex;flex-direction:column;align-items:center;transform:translateY(-50%);pointer-events:none}._emoji_1jujk_38{font-size:22px;line-height:1;margin-bottom:2px}._pct_1jujk_44{font-size:var(--font-size-sm);font-weight:700;color:var(--color-text);font-variant-numeric:tabular-nums}._pct_1jujk_44._over_1jujk_51,._over_1jujk_51{color:var(--color-error)}._label_1jujk_59{font-size:var(--font-size-sm);font-weight:600;color:var(--color-text);margin-top:4px}._amounts_1jujk_66{font-size:var(--font-size-xs);color:var(--color-text-secondary);font-variant-numeric:tabular-nums}._budget_1jujk_72{color:var(--color-text-muted)}._empty_1jujk_76{padding:var(--spacing-xl);text-align:center;color:var(--color-text-muted);font-size:var(--font-size-sm)}._tooltip_1jujk_83{position:absolute;pointer-events:none;background:var(--color-background);border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:var(--spacing-xs) var(--spacing-sm);box-shadow:var(--shadow-md);font-size:var(--font-size-xs);color:var(--color-text);white-space:nowrap;z-index:10;opacity:0;transition:opacity .15s ease}._tooltip_1jujk_83._visible_1jujk_99{opacity:1}._tipLabel_1jujk_103{font-weight:600;margin-bottom:2px}._tipRow_1jujk_108{font-size:var(--font-size-xs)}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import{r as v,j as r}from"./iframe-BxepBtx0.js";import"./preload-helper-C1FmrZbK.js";const P="_container_1jujk_1",A="_grid_1jujk_6",F="_ring_1jujk_13",U="_svg_1jujk_22",I="_center_1jujk_26",S="_emoji_1jujk_38",W="_pct_1jujk_44",B="_over_1jujk_51",G="_label_1jujk_59",H="_amounts_1jujk_66",X="_budget_1jujk_72",Y="_empty_1jujk_76",J="_tooltip_1jujk_83",K="_visible_1jujk_99",Q="_tipLabel_1jujk_103",Z="_tipRow_1jujk_108",t={container:P,grid:A,ring:F,svg:U,center:I,emoji:S,pct:W,over:B,label:G,amounts:H,budget:X,empty:Y,tooltip:J,visible:K,tipLabel:Q,tipRow:Z},z=e=>e.toLocaleString(),ee=(e,l)=>`Over by ${l(e)}`,te=(e,l)=>`${l(e)} left`,O=({rings:e,formatValue:l=z,ringSize:s=120,stroke:b=12,emptyMessage:j="No data to display",overLabel:m=ee,underLabel:_=te})=>{const y=v.useRef(null),c=v.useRef(null),d=v.useCallback((n,f)=>{const a=c.current,g=y.current;if(!a||!g)return;const p=g.getBoundingClientRect();a.style.left=`${n.clientX-p.left+12}px`,a.style.top=`${n.clientY-p.top-10}px`,a.innerHTML=f,a.classList.add(t.visible)},[]),R=v.useCallback(()=>{var n;(n=c.current)==null||n.classList.remove(t.visible)},[]);if(e.length===0)return r.jsx("div",{className:t.empty,children:j});const u=(s-b)/2,i=2*Math.PI*u;return r.jsxs("div",{className:t.container,ref:y,children:[r.jsx("div",{className:t.grid,children:e.map((n,f)=>{const a=n.target>0?n.value/n.target:0,g=Math.min(1,a),p=i*(1-g),k=Math.round(a*100),o=a>1,C=o?"var(--color-error)":n.color||"var(--color-primary)";return r.jsx(ne,{label:n.label,emoji:n.emoji,ringSize:s,stroke:b,radius:u,circumference:i,finalOffset:p,ringColor:C,value:n.value,target:n.target,pct:k,over:o,formatValue:l,overLabel:m,underLabel:_,delay:f*80,onTip:d,onTipLeave:R},n.label)})}),r.jsx("div",{ref:c,className:t.tooltip})]})},ne=({label:e,emoji:l,ringSize:s,stroke:b,radius:j,circumference:m,finalOffset:_,ringColor:y,value:c,target:d,pct:R,over:u,formatValue:i,overLabel:n,underLabel:f,delay:a,onTip:g,onTipLeave:p})=>{const k=v.useRef(null);return v.useEffect(()=>{const o=k.current;o&&(o.style.transition="none",o.style.strokeDashoffset=`${m}`,o.getBoundingClientRect(),o.style.transition=`stroke-dashoffset 900ms cubic-bezier(0.22, 1, 0.36, 1) ${a}ms`,o.style.strokeDashoffset=`${_}`)},[m,_,a]),r.jsxs("div",{className:t.ring,onMouseMove:o=>g(o,`<div class="${t.tipLabel}">${l??""} ${e}</div><div class="${t.tipRow}">${i(c)} of ${i(d)}</div><div class="${t.tipRow}" style="color:${u?"var(--color-error)":"var(--color-success)"}">${u?n(c-d,i):f(d-c,i)}</div>`),onMouseLeave:p,children:[r.jsxs("svg",{width:s,height:s,className:t.svg,children:[r.jsx("circle",{cx:s/2,cy:s/2,r:j,fill:"none",stroke:"var(--color-border)",strokeWidth:b,strokeOpacity:"0.35"}),r.jsx("circle",{ref:k,cx:s/2,cy:s/2,r:j,fill:"none",stroke:y,strokeWidth:b,strokeLinecap:"round",strokeDasharray:m,strokeDashoffset:m,transform:`rotate(-90 ${s/2} ${s/2})`})]}),r.jsxs("div",{className:t.center,children:[l&&r.jsx("div",{className:t.emoji,children:l}),r.jsxs("div",{className:`${t.pct} ${u?t.over:""}`,children:[R,"%"]})]}),r.jsx("div",{className:t.label,children:e}),r.jsxs("div",{className:t.amounts,children:[r.jsx("span",{className:u?t.over:"",children:i(c)}),r.jsxs("span",{className:t.budget,children:[" / ",i(d)]})]})]})};O.__docgenInfo={description:"",methods:[],displayName:"ProgressRings",props:{rings:{required:!0,tsType:{name:"Array",elements:[{name:"ProgressRingItem"}],raw:"ProgressRingItem[]"},description:""},formatValue:{required:!1,tsType:{name:"signature",type:"function",raw:"(value: number) => string",signature:{arguments:[{type:{name:"number"},name:"value"}],return:{name:"string"}}},description:"",defaultValue:{value:"(n: number) => n.toLocaleString()",computed:!1}},ringSize:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"120",computed:!1}},stroke:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"12",computed:!1}},emptyMessage:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'No data to display'",computed:!1}},overLabel:{required:!1,tsType:{name:"signature",type:"function",raw:"(over: number, formatValue: (v: number) => string) => string",signature:{arguments:[{type:{name:"number"},name:"over"},{type:{name:"signature",type:"function",raw:"(v: number) => string",signature:{arguments:[{type:{name:"number"},name:"v"}],return:{name:"string"}}},name:"formatValue"}],return:{name:"string"}}},description:"",defaultValue:{value:"(over: number, fmt: (v: number) => string) => `Over by ${fmt(over)}`",computed:!1}},underLabel:{required:!1,tsType:{name:"signature",type:"function",raw:"(left: number, formatValue: (v: number) => string) => string",signature:{arguments:[{type:{name:"number"},name:"left"},{type:{name:"signature",type:"function",raw:"(v: number) => string",signature:{arguments:[{type:{name:"number"},name:"v"}],return:{name:"string"}}},name:"formatValue"}],return:{name:"string"}}},description:"",defaultValue:{value:"(left: number, fmt: (v: number) => string) => `${fmt(left)} left`",computed:!1}}}};const oe={title:"Organisms/Charts/ProgressRings",component:O,parameters:{layout:"centered"}},re=e=>`€${e.toLocaleString("en-US",{maximumFractionDigits:0})}`,h={args:{rings:[{label:"Groceries",emoji:"🥦",color:"#10b981",value:320,target:500},{label:"Rent",emoji:"🏠",color:"#6366f1",value:1200,target:1200},{label:"Eating out",emoji:"🍕",color:"#f59e0b",value:220,target:150},{label:"Transport",emoji:"🚇",color:"#06b6d4",value:60,target:200},{label:"Entertainment",emoji:"🎬",color:"#ec4899",value:95,target:120}],formatValue:re}},$={args:{rings:[{label:"Reading",emoji:"📚",color:"#8b5cf6",value:18,target:30},{label:"Workouts",emoji:"🏋️",color:"#10b981",value:12,target:12},{label:"Meditation",emoji:"🧘",color:"#06b6d4",value:5,target:20}],ringSize:96,stroke:10,formatValue:e=>`${e}`,underLabel:e=>`${e} to go`,overLabel:e=>`+${e} extra`}},x={args:{rings:[]}};var L,T,E;h.parameters={...h.parameters,docs:{...(L=h.parameters)==null?void 0:L.docs,source:{originalSource:`{
|
|
2
|
+
args: {
|
|
3
|
+
rings: [{
|
|
4
|
+
label: 'Groceries',
|
|
5
|
+
emoji: '🥦',
|
|
6
|
+
color: '#10b981',
|
|
7
|
+
value: 320,
|
|
8
|
+
target: 500
|
|
9
|
+
}, {
|
|
10
|
+
label: 'Rent',
|
|
11
|
+
emoji: '🏠',
|
|
12
|
+
color: '#6366f1',
|
|
13
|
+
value: 1200,
|
|
14
|
+
target: 1200
|
|
15
|
+
}, {
|
|
16
|
+
label: 'Eating out',
|
|
17
|
+
emoji: '🍕',
|
|
18
|
+
color: '#f59e0b',
|
|
19
|
+
value: 220,
|
|
20
|
+
target: 150
|
|
21
|
+
}, {
|
|
22
|
+
label: 'Transport',
|
|
23
|
+
emoji: '🚇',
|
|
24
|
+
color: '#06b6d4',
|
|
25
|
+
value: 60,
|
|
26
|
+
target: 200
|
|
27
|
+
}, {
|
|
28
|
+
label: 'Entertainment',
|
|
29
|
+
emoji: '🎬',
|
|
30
|
+
color: '#ec4899',
|
|
31
|
+
value: 95,
|
|
32
|
+
target: 120
|
|
33
|
+
}],
|
|
34
|
+
formatValue: formatEuro
|
|
35
|
+
}
|
|
36
|
+
}`,...(E=(T=h.parameters)==null?void 0:T.docs)==null?void 0:E.source}}};var N,w,D;$.parameters={...$.parameters,docs:{...(N=$.parameters)==null?void 0:N.docs,source:{originalSource:`{
|
|
37
|
+
args: {
|
|
38
|
+
rings: [{
|
|
39
|
+
label: 'Reading',
|
|
40
|
+
emoji: '📚',
|
|
41
|
+
color: '#8b5cf6',
|
|
42
|
+
value: 18,
|
|
43
|
+
target: 30
|
|
44
|
+
}, {
|
|
45
|
+
label: 'Workouts',
|
|
46
|
+
emoji: '🏋️',
|
|
47
|
+
color: '#10b981',
|
|
48
|
+
value: 12,
|
|
49
|
+
target: 12
|
|
50
|
+
}, {
|
|
51
|
+
label: 'Meditation',
|
|
52
|
+
emoji: '🧘',
|
|
53
|
+
color: '#06b6d4',
|
|
54
|
+
value: 5,
|
|
55
|
+
target: 20
|
|
56
|
+
}],
|
|
57
|
+
ringSize: 96,
|
|
58
|
+
stroke: 10,
|
|
59
|
+
formatValue: n => \`\${n}\`,
|
|
60
|
+
underLabel: left => \`\${left} to go\`,
|
|
61
|
+
overLabel: over => \`+\${over} extra\`
|
|
62
|
+
}
|
|
63
|
+
}`,...(D=(w=$.parameters)==null?void 0:w.docs)==null?void 0:D.source}}};var M,V,q;x.parameters={...x.parameters,docs:{...(M=x.parameters)==null?void 0:M.docs,source:{originalSource:`{
|
|
64
|
+
args: {
|
|
65
|
+
rings: []
|
|
66
|
+
}
|
|
67
|
+
}`,...(q=(V=x.parameters)==null?void 0:V.docs)==null?void 0:q.source}}};const le=["Default","Smaller","Empty"];export{h as Default,x as Empty,$ as Smaller,le as __namedExportsOrder,oe as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as d,j as r}from"./iframe-
|
|
1
|
+
import{r as d,j as r}from"./iframe-BxepBtx0.js";import{s as y,c as _t,f as ee}from"./transform-DaumkFRH.js";import{t as ae,e as ne,l as re,m as oe,p as Mt}from"./monotone-Ca9yXB0X.js";import{l as se}from"./linear-BTA54h8k.js";import{C as ie}from"./chart-column-CB0l3JOL.js";import{c as nt}from"./createLucideIcon-S7OoTmdc.js";import{C as le}from"./calendar-bUcBNUjV.js";import{t as mt}from"./defaultLocale-DJ2q5QjE.js";import{a as ce,b as de}from"./axis-D3QohQNI.js";import{b as wt}from"./back-BxPoHLz2.js";import"./preload-helper-C1FmrZbK.js";import"./array-BKyUJesY.js";import"./path-CSVzDSO0.js";import"./value-CMZJhU-O.js";import"./descending-BO6OmMcj.js";/**
|
|
2
2
|
* @license lucide-react v0.539.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -18,7 +18,7 @@ import{r as d,j as r}from"./iframe-BTbLpgFM.js";import{s as y,c as _t,f as ee}fr
|
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const fe=[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]],ve=nt("sigma",fe),be="_container_frpma_1",xe="_controls_frpma_19",_e="_viewToggle_frpma_27",Me="_viewButton_frpma_36",we="_active_frpma_57",ke="_viewIcon_frpma_63",Se="_viewLabel_frpma_68",Te="_aggregationToggle_frpma_78",qe="_aggregationButton_frpma_87",je="_aggregationIcon_frpma_114",Ee="_aggregationLabel_frpma_119",Le="_legend_frpma_129",Ce="_compactLegend_frpma_140",De="_legendItem_frpma_145",Ae="_legendEmoji_frpma_150",$e="_legendLabel_frpma_154",Ne="_inactive_frpma_178",Ie="_legendColor_frpma_188",Ve="_chart_frpma_227",Re="_gridLine_frpma_235",He="_line_frpma_241",We="_crosshair_frpma_248",Fe="_halo_frpma_255",Be="_overlay_frpma_260",Oe="_xAxis_frpma_265",ze="_yAxis_frpma_266",Ge="_dataPoint_frpma_285",Pe="_tooltip_frpma_289",Ye="_visible_frpma_310",Qe="_tooltipHeader_frpma_315",Ue="_tooltipEmoji_frpma_326",Xe="_tooltipDot_frpma_331",Ke="_tooltipInfo_frpma_338",Je="_tooltipDate_frpma_344",Ze="_tooltipValue_frpma_350",e={container:be,controls:xe,viewToggle:_e,viewButton:Me,active:we,viewIcon:ke,viewLabel:Se,aggregationToggle:Te,aggregationButton:qe,aggregationIcon:je,aggregationLabel:Ee,legend:Le,compactLegend:Ce,legendItem:De,legendEmoji:Ae,legendLabel:$e,inactive:Ne,legendColor:Ie,chart:Ve,gridLine:Re,line:He,crosshair:We,halo:Fe,overlay:Be,xAxis:Oe,yAxis:ze,dataPoint:Ge,tooltip:Pe,visible:Ye,tooltipHeader:Qe,tooltipEmoji:Ue,tooltipDot:Xe,tooltipInfo:Ke,tooltipDate:Je,tooltipValue:Ze},ta={Exercise:"#6BCB77",Meditation:"#4D96FF",Reading:"#FFB319",Water:"#00D9FF",Steps:"#FF6B6B",Sleep:"#9B59B6",Calories:"#FF9F1C",Study:"#C774E8"},kt="http://www.w3.org/2000/svg",ea=(n,v,f=80)=>{const L=n&&n.length>0?n:"M0,0",M=v&&v.length>0?v:"M0,0",C=document.createElementNS(kt,"path"),D=document.createElementNS(kt,"path");C.setAttribute("d",L),D.setAttribute("d",M);const H=typeof C.getTotalLength=="function"?C.getTotalLength():0,U=typeof D.getTotalLength=="function"?D.getTotalLength():0;if(H===0||U===0)return()=>M;const A=[],w=[];for(let q=0;q<f;q++){const k=f===1?0:q/(f-1),h=C.getPointAtLength(k*H),i=D.getPointAtLength(k*U);A.push([h.x,h.y]),w.push([i.x,i.y])}return q=>{let k="";for(let h=0;h<f;h++){const i=A[h][0]+(w[h][0]-A[h][0])*q,ot=A[h][1]+(w[h][1]-A[h][1])*q;k+=(h===0?"M":"L")+i+","+ot}return k}},Vt=({data:n,width:v=800,height:f=400,defaultViewType:L="daily",periodType:M="month",habitColors:C={},habitEmojis:D={},onDataPointClick:H,hideControls:U=!1,compactLegend:A=!1})=>{const w=d.useRef(null),q=d.useRef(null),k=d.useRef(H),h=d.useRef(!1),[i,ot]=d.useState(L),[z,gt]=d.useState([]),[G,yt]=d.useState(null),[S,st]=d.useState(null),[X,ft]=d.useState("average");d.useEffect(()=>{k.current=H},[H]);const $=d.useMemo(()=>({top:20,right:20,bottom:50,left:50}),[]),K=v-$.left-$.right,W=f-$.top-$.bottom,P=d.useMemo(()=>Object.keys(n).filter(a=>a!=="dates"),[n]);d.useEffect(()=>{gt(P)},[P]),d.useEffect(()=>{const a=()=>{st(null)};return window.addEventListener("scroll",a,!0),()=>{window.removeEventListener("scroll",a,!0)}},[]);const Rt=d.useMemo(()=>{switch(M){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"]}},[M]),F=d.useCallback(a=>C[a]||ta[a]||`hsl(${Math.abs(a.split("").reduce((l,s)=>l+s.charCodeAt(0),0))%360}, 70%, 50%)`,[C]),x=d.useMemo(()=>{if(i==="daily"||!n.dates.length)return n;const a={dates:[]},l=new Map;return n.dates.forEach((s,_)=>{const j=new Date(s);let m;switch(i){case"weekly":{const c=new Date(j),g=c.getDay(),E=c.getDate()-g+(g===0?-6:1);c.setDate(E),m=c.toISOString().split("T")[0];break}case"monthly":m=`${j.getFullYear()}-${String(j.getMonth()+1).padStart(2,"0")}-01`;break;case"quarterly":{const g=(Math.floor(j.getMonth()/3)+1-1)*3;m=new Date(j.getFullYear(),g,1).toISOString().split("T")[0];break}default:m=s}l.has(m)||l.set(m,[]),l.get(m).push(_)}),a.dates=Array.from(l.keys()).sort(),P.forEach(s=>{a[s]=a.dates.map(_=>{const m=l.get(_).map(c=>n[s][c]).filter(c=>typeof c=="number"&&!isNaN(c));return m.length===0?0:Math.round(X==="sum"?m.reduce((c,g)=>c+g,0):m.reduce((c,g)=>c+g,0)/m.length)})}),a},[n,i,P,X]),Ht=a=>{gt(l=>l.includes(a)?l.filter(s=>s!==a):[...l,a])};d.useEffect(()=>{if(!w.current||x.dates.length===0)return;const a=y(w.current),l=!h.current;h.current=!0;let s=a.select("g.qhc-root");s.empty()&&(s=a.append("g").attr("class","qhc-root")),s.attr("transform",`translate(${$.left},${$.top})`);const _=t=>{let o=s.select(`g.${t}`);return o.empty()&&(o=s.append("g").attr("class",t)),o},j=_("qhc-grid"),m=_("qhc-lines"),c=_("qhc-points"),g=_("qhc-axes"),E=_("qhc-ui"),N=x.dates.map(t=>new Date(t)),I=ae().domain(ne(N)).range([0,K]),Ot=Math.max(1,...z.flatMap(t=>x[t].filter(o=>typeof o=="number"))),V=se().domain([0,Ot*1.1]).range([W,0]),it=re().x(t=>I(t[0])).y(t=>V(t[1])).curve(oe),lt=j.selectAll("line.qhc-grid-line").data(V.ticks(5),t=>String(t));lt.exit().remove(),lt.enter().append("line").attr("class",`${e.gridLine} qhc-grid-line`).style("opacity",0).merge(lt).attr("x1",0).attr("x2",K).attr("y1",t=>V(t)).attr("y2",t=>V(t)).transition().duration(400).style("opacity",1);const zt=t=>{const o=new Date(t);o.setHours(0,0,0,0),o.setDate(o.getDate()+3-(o.getDay()+6)%7);const u=new Date(o.getFullYear(),0,4);return 1+Math.round(((o.getTime()-u.getTime())/864e5-3+(u.getDay()+6)%7)/7)},Gt=(()=>{switch(i){case"daily":return mt("%m-%d");case"weekly":return t=>`W${zt(t).toString().padStart(2,"0")}`;case"monthly":return mt("%b");case"quarterly":return t=>`Q${Math.floor(t.getMonth()/3)+1}`;default:return mt("%m-%d")}})(),vt=(()=>{switch(i){case"daily":return Math.min(10,x.dates.length);case"weekly":return Math.min(12,x.dates.length);case"monthly":return Math.min(12,x.dates.length);case"quarterly":return x.dates.length;default:return}})(),ct=ce(I).tickFormat(t=>Gt(t));i==="quarterly"?ct.tickValues(N):vt&&ct.ticks(vt);let Y=g.select("g.qhc-x-axis");Y.empty()&&(Y=g.append("g").attr("class",`${e.xAxis} qhc-x-axis`)),Y.attr("transform",`translate(0,${W})`).call(ct),Y.selectAll("text").style("text-anchor",i==="daily"||i==="weekly"?"end":"middle").attr("dx",i==="daily"||i==="weekly"?"-.8em":"0").attr("dy",i==="daily"||i==="weekly"?".15em":".71em").attr("transform",i==="daily"||i==="weekly"?"rotate(-45)":null);let J=g.select("g.qhc-y-axis");J.empty()&&(J=g.append("g").attr("class",`${e.yAxis} qhc-y-axis`)),J.call(de(V)),l&&(Y.style("opacity",0).transition().duration(500).delay(80).style("opacity",1),J.style("opacity",0).transition().duration(500).delay(80).style("opacity",1));const Pt=z.map(t=>{const o=N.map((u,p)=>[u,x[t][p]]).filter(u=>typeof u[1]=="number");return{habit:t,color:F(t),points:o}}),dt=m.selectAll("path.qhc-line").data(Pt,t=>t.habit);dt.exit().transition("line-exit").duration(300).style("opacity",0).remove(),dt.enter().append("path").attr("class",`${e.line} qhc-line`).attr("data-habit",t=>t.habit).attr("fill","none").attr("stroke",t=>t.color).attr("opacity",0).attr("d",t=>it(t.points)||"").each(function(){const t=this,o=typeof t.getTotalLength=="function"?t.getTotalLength():0;o>0&&y(t).attr("stroke-dasharray",`${o} ${o}`).attr("stroke-dashoffset",o)}).transition("line-enter").duration(900).ease(_t).attr("opacity",1).attr("stroke-dashoffset",0).on("end",function(){y(this).attr("stroke-dasharray",null)}),dt.transition("line-update").duration(700).ease(ee).attr("stroke",t=>t.color).attrTween("d",function(t){const o=y(this).attr("d")||"",u=it(t.points)||"";return ea(o,u,90)}).on("end",function(t){y(this).attr("d",it(t.points)||"")}),c.selectAll("*").remove();const ut=[];z.forEach(t=>{const o=F(t);N.forEach((u,p)=>{const b=x[t][p];typeof b=="number"&&!isNaN(b)&&ut.push({habit:t,color:o,date:u,value:b})})});const bt=I(N[0]),Yt=I(N[N.length-1]),Qt=Math.max(1,Yt-bt),Ut=l?100:350,Xt=l?1100:600;c.selectAll("circle.qhc-point").data(ut).enter().append("circle").attr("class",`${e.dataPoint} qhc-point`).attr("data-habit",t=>t.habit).attr("cx",t=>I(t.date)).attr("cy",W).attr("r",0).attr("fill",t=>t.color).style("opacity",0).transition("point-enter").delay(t=>Ut+Xt*((I(t.date)-bt)/Qt)).duration(420).ease(Mt.overshoot(2)).attr("cy",t=>V(t.value)).attr("r",4).style("opacity",1),E.selectAll("*").remove();const xt=E.append("line").attr("class",e.crosshair).attr("y1",0).attr("y2",W).style("opacity",0).style("pointer-events","none"),pt=E.append("circle").attr("class",e.halo).attr("r",0).style("opacity",0).style("pointer-events","none");let ht=null;const Kt=(t,o,u)=>{pt.interrupt("halo-pulse").interrupt("halo-out").attr("cx",t).attr("cy",o).attr("fill",u);const p=()=>{pt.attr("r",4).style("opacity",.55).transition("halo-pulse").duration(900).ease(_t).attr("r",18).style("opacity",0).on("end",p)};p()},Jt=()=>{pt.interrupt("halo-pulse").transition("halo-out").duration(180).style("opacity",0).attr("r",0)},B=ut.map(t=>({habit:t.habit,date:t.date,value:t.value,x:I(t.date),y:V(t.value)})),Zt=(t,o,u)=>{const p=`${t.habit}|${t.date.toISOString()}`,b=F(t.habit);xt.attr("x1",t.x).attr("x2",t.x).interrupt("crosshair-fade").transition("crosshair-fade").duration(120).style("opacity",1),ht!==p&&(c.selectAll("circle.qhc-point").filter(function(){return y(this).attr("data-active")==="true"}).attr("data-active",null).transition("point-scale").duration(150).attr("r",4),c.selectAll("circle.qhc-point").filter(function(){const T=+y(this).attr("cx"),R=+y(this).attr("cy");return y(this).attr("data-habit")===t.habit&&Math.abs(T-t.x)<.5&&Math.abs(R-t.y)<.5}).attr("data-active","true").transition("point-scale").duration(180).ease(Mt.overshoot(2)).attr("r",7),Kt(t.x,t.y,b),ht=p),st({habit:t.habit,date:t.date.toISOString().split("T")[0],value:t.value,x:o,y:u})},te=()=>{xt.interrupt("crosshair-fade").transition("crosshair-fade").duration(180).style("opacity",0),c.selectAll("circle.qhc-point").filter(function(){return y(this).attr("data-active")==="true"}).attr("data-active",null).transition("point-scale").duration(180).attr("r",4),Jt(),ht=null,st(null)};E.append("rect").attr("class",e.overlay).attr("width",K).attr("height",W).on("mousemove",function(t){if(B.length===0)return;const[o,u]=wt(t,this);let p=B[0],b=1/0;for(const T of B){const R=T.x-o,O=T.y-u,Q=R*R+O*O;Q<b&&(b=Q,p=T)}Zt(p,t.clientX,t.clientY)}).on("mouseleave",()=>{te()}).on("click",function(t){if(B.length===0||!k.current)return;const[o,u]=wt(t,this);let p=B[0],b=1/0;for(const T of B){const R=T.x-o,O=T.y-u,Q=R*R+O*O;Q<b&&(b=Q,p=T)}k.current(p.habit,p.date.toISOString().split("T")[0],p.value)}),E.raise()},[x,z,K,W,$,F,i,v,f]),d.useEffect(()=>{if(!w.current)return;const a=y(w.current);a.selectAll("path.qhc-line").each(function(){const l=this.getAttribute("data-habit"),s=G&&G!==l;y(this).transition("hover-dim").duration(180).attr("opacity",s?.25:1)}),a.selectAll("circle.qhc-point").each(function(){const l=this.getAttribute("data-habit"),s=G&&G!==l;y(this).transition("hover-dim").duration(180).attr("opacity",s?.25:1)})},[G]);const Wt=(a,l)=>{const s=new Date(a);switch(l){case"daily":return s.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});case"weekly":return`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 a}},Ft={daily:{Icon:le,label:"Daily"},weekly:{Icon:pe,label:"Weekly"},monthly:{Icon:me,label:"Monthly"},quarterly:{Icon:ie,label:"Quarterly"}},Bt=i!=="daily";return r.jsxs("div",{className:e.container,children:[!U&&r.jsxs("div",{className:e.controls,children:[r.jsx("div",{className:e.viewToggle,children:Rt.map(a=>{const{Icon:l,label:s}=Ft[a];return r.jsxs("button",{className:`${e.viewButton} ${i===a?e.active:""}`,onClick:()=>ot(a),title:s,children:[r.jsx("span",{className:e.viewIcon,children:r.jsx(l,{size:16})}),r.jsx("span",{className:e.viewLabel,children:s})]},a)})}),Bt&&r.jsxs("div",{className:e.aggregationToggle,children:[r.jsxs("button",{className:`${e.aggregationButton} ${X==="average"?e.active:""}`,onClick:()=>ft("average"),title:"Show average values for each period",children:[r.jsx("span",{className:e.aggregationIcon,children:r.jsx(ye,{size:16})}),r.jsx("span",{className:e.aggregationLabel,children:"Average"})]}),r.jsxs("button",{className:`${e.aggregationButton} ${X==="sum"?e.active:""}`,onClick:()=>ft("sum"),title:"Show total values for each period",children:[r.jsx("span",{className:e.aggregationIcon,children:r.jsx(ve,{size:16})}),r.jsx("span",{className:e.aggregationLabel,children:"Sum"})]})]})]}),r.jsx("div",{className:`${e.legend}${A?` ${e.compactLegend}`:""}`,children:P.map(a=>r.jsxs("button",{className:`${e.legendItem} ${z.includes(a)?"":e.inactive}`,onClick:()=>Ht(a),onMouseEnter:()=>yt(a),onMouseLeave:()=>yt(null),children:[r.jsx("span",{className:e.legendEmoji,children:D[a]||"📊"}),r.jsx("span",{className:e.legendColor,style:{backgroundColor:F(a)}}),r.jsx("span",{className:e.legendLabel,children:a})]},a))}),r.jsx("svg",{ref:w,viewBox:`0 0 ${v} ${f}`,preserveAspectRatio:"xMidYMid meet",className:e.chart}),S&&r.jsxs("div",{ref:q,className:`${e.tooltip} ${S?e.visible:""}`,style:{left:`${S.x}px`,top:`${S.y-80}px`},children:[r.jsxs("div",{className:e.tooltipHeader,children:[r.jsx("span",{className:e.tooltipEmoji,children:D[S.habit]||"📊"}),r.jsx("span",{className:e.tooltipDot,style:{backgroundColor:F(S.habit)}}),r.jsx("span",{children:S.habit})]}),r.jsxs("div",{className:e.tooltipInfo,children:[r.jsx("div",{className:e.tooltipDate,children:Wt(S.date,i)}),r.jsxs("div",{className:e.tooltipValue,children:[r.jsx("strong",{children:Math.round(S.value*10)/10}),r.jsx("span",{style:{fontSize:"12px",fontWeight:"normal",opacity:.6},children:"units"})]})]})]})]})};Vt.__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 ya={title:"Organisms/Charts/QuantifiableHabitsChart",component:Vt,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"]}}},rt=n=>{const v=[],f=new Date;for(let L=n-1;L>=0;L--){const M=new Date(f);M.setDate(M.getDate()-L),v.push(M.toISOString().split("T")[0])}return v},Z={args:{data:(()=>{const n=rt(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:"👟"}}},tt={args:{data:(()=>{const n=rt(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:"😴"}}},et={args:{data:(()=>{const n=rt(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:"👥"}}},at={args:{data:(()=>{const n=rt(30);return{dates:n,Weight:n.map((v,f)=>70+Math.sin(f/5)*2+Math.random())}})(),width:800,height:300,defaultViewType:"daily",periodType:"month",habitColors:{Weight:"#3b82f6"},habitEmojis:{Weight:"⚖️"}}};var St,Tt,qt;Z.parameters={...Z.parameters,docs:{...(St=Z.parameters)==null?void 0:St.docs,source:{originalSource:`{
|
|
21
|
+
*/const fe=[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]],ve=nt("sigma",fe),be="_container_frpma_1",xe="_controls_frpma_19",_e="_viewToggle_frpma_27",Me="_viewButton_frpma_36",we="_active_frpma_57",ke="_viewIcon_frpma_63",Se="_viewLabel_frpma_68",Te="_aggregationToggle_frpma_78",qe="_aggregationButton_frpma_87",je="_aggregationIcon_frpma_114",Ee="_aggregationLabel_frpma_119",Le="_legend_frpma_129",Ce="_compactLegend_frpma_140",De="_legendItem_frpma_145",Ae="_legendEmoji_frpma_150",$e="_legendLabel_frpma_154",Ne="_inactive_frpma_178",Ie="_legendColor_frpma_188",Ve="_chart_frpma_227",Re="_gridLine_frpma_235",He="_line_frpma_241",We="_crosshair_frpma_248",Fe="_halo_frpma_255",Be="_overlay_frpma_260",Oe="_xAxis_frpma_265",ze="_yAxis_frpma_266",Ge="_dataPoint_frpma_285",Pe="_tooltip_frpma_289",Ye="_visible_frpma_310",Qe="_tooltipHeader_frpma_315",Ue="_tooltipEmoji_frpma_326",Xe="_tooltipDot_frpma_331",Ke="_tooltipInfo_frpma_338",Je="_tooltipDate_frpma_344",Ze="_tooltipValue_frpma_350",e={container:be,controls:xe,viewToggle:_e,viewButton:Me,active:we,viewIcon:ke,viewLabel:Se,aggregationToggle:Te,aggregationButton:qe,aggregationIcon:je,aggregationLabel:Ee,legend:Le,compactLegend:Ce,legendItem:De,legendEmoji:Ae,legendLabel:$e,inactive:Ne,legendColor:Ie,chart:Ve,gridLine:Re,line:He,crosshair:We,halo:Fe,overlay:Be,xAxis:Oe,yAxis:ze,dataPoint:Ge,tooltip:Pe,visible:Ye,tooltipHeader:Qe,tooltipEmoji:Ue,tooltipDot:Xe,tooltipInfo:Ke,tooltipDate:Je,tooltipValue:Ze},ta={Exercise:"#6BCB77",Meditation:"#4D96FF",Reading:"#FFB319",Water:"#00D9FF",Steps:"#FF6B6B",Sleep:"#9B59B6",Calories:"#FF9F1C",Study:"#C774E8"},kt="http://www.w3.org/2000/svg",ea=(n,v,f=80)=>{const L=n&&n.length>0?n:"M0,0",M=v&&v.length>0?v:"M0,0",C=document.createElementNS(kt,"path"),D=document.createElementNS(kt,"path");C.setAttribute("d",L),D.setAttribute("d",M);const H=typeof C.getTotalLength=="function"?C.getTotalLength():0,U=typeof D.getTotalLength=="function"?D.getTotalLength():0;if(H===0||U===0)return()=>M;const A=[],w=[];for(let q=0;q<f;q++){const k=f===1?0:q/(f-1),h=C.getPointAtLength(k*H),i=D.getPointAtLength(k*U);A.push([h.x,h.y]),w.push([i.x,i.y])}return q=>{let k="";for(let h=0;h<f;h++){const i=A[h][0]+(w[h][0]-A[h][0])*q,ot=A[h][1]+(w[h][1]-A[h][1])*q;k+=(h===0?"M":"L")+i+","+ot}return k}},Vt=({data:n,width:v=800,height:f=400,defaultViewType:L="daily",periodType:M="month",habitColors:C={},habitEmojis:D={},onDataPointClick:H,hideControls:U=!1,compactLegend:A=!1})=>{const w=d.useRef(null),q=d.useRef(null),k=d.useRef(H),h=d.useRef(!1),[i,ot]=d.useState(L),[z,gt]=d.useState([]),[G,yt]=d.useState(null),[S,st]=d.useState(null),[X,ft]=d.useState("average");d.useEffect(()=>{k.current=H},[H]);const $=d.useMemo(()=>({top:20,right:20,bottom:50,left:50}),[]),K=v-$.left-$.right,W=f-$.top-$.bottom,P=d.useMemo(()=>Object.keys(n).filter(a=>a!=="dates"),[n]);d.useEffect(()=>{gt(P)},[P]),d.useEffect(()=>{const a=()=>{st(null)};return window.addEventListener("scroll",a,!0),()=>{window.removeEventListener("scroll",a,!0)}},[]);const Rt=d.useMemo(()=>{switch(M){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"]}},[M]),F=d.useCallback(a=>C[a]||ta[a]||`hsl(${Math.abs(a.split("").reduce((l,s)=>l+s.charCodeAt(0),0))%360}, 70%, 50%)`,[C]),x=d.useMemo(()=>{if(i==="daily"||!n.dates.length)return n;const a={dates:[]},l=new Map;return n.dates.forEach((s,_)=>{const j=new Date(s);let m;switch(i){case"weekly":{const c=new Date(j),g=c.getDay(),E=c.getDate()-g+(g===0?-6:1);c.setDate(E),m=c.toISOString().split("T")[0];break}case"monthly":m=`${j.getFullYear()}-${String(j.getMonth()+1).padStart(2,"0")}-01`;break;case"quarterly":{const g=(Math.floor(j.getMonth()/3)+1-1)*3;m=new Date(j.getFullYear(),g,1).toISOString().split("T")[0];break}default:m=s}l.has(m)||l.set(m,[]),l.get(m).push(_)}),a.dates=Array.from(l.keys()).sort(),P.forEach(s=>{a[s]=a.dates.map(_=>{const m=l.get(_).map(c=>n[s][c]).filter(c=>typeof c=="number"&&!isNaN(c));return m.length===0?0:Math.round(X==="sum"?m.reduce((c,g)=>c+g,0):m.reduce((c,g)=>c+g,0)/m.length)})}),a},[n,i,P,X]),Ht=a=>{gt(l=>l.includes(a)?l.filter(s=>s!==a):[...l,a])};d.useEffect(()=>{if(!w.current||x.dates.length===0)return;const a=y(w.current),l=!h.current;h.current=!0;let s=a.select("g.qhc-root");s.empty()&&(s=a.append("g").attr("class","qhc-root")),s.attr("transform",`translate(${$.left},${$.top})`);const _=t=>{let o=s.select(`g.${t}`);return o.empty()&&(o=s.append("g").attr("class",t)),o},j=_("qhc-grid"),m=_("qhc-lines"),c=_("qhc-points"),g=_("qhc-axes"),E=_("qhc-ui"),N=x.dates.map(t=>new Date(t)),I=ae().domain(ne(N)).range([0,K]),Ot=Math.max(1,...z.flatMap(t=>x[t].filter(o=>typeof o=="number"))),V=se().domain([0,Ot*1.1]).range([W,0]),it=re().x(t=>I(t[0])).y(t=>V(t[1])).curve(oe),lt=j.selectAll("line.qhc-grid-line").data(V.ticks(5),t=>String(t));lt.exit().remove(),lt.enter().append("line").attr("class",`${e.gridLine} qhc-grid-line`).style("opacity",0).merge(lt).attr("x1",0).attr("x2",K).attr("y1",t=>V(t)).attr("y2",t=>V(t)).transition().duration(400).style("opacity",1);const zt=t=>{const o=new Date(t);o.setHours(0,0,0,0),o.setDate(o.getDate()+3-(o.getDay()+6)%7);const u=new Date(o.getFullYear(),0,4);return 1+Math.round(((o.getTime()-u.getTime())/864e5-3+(u.getDay()+6)%7)/7)},Gt=(()=>{switch(i){case"daily":return mt("%m-%d");case"weekly":return t=>`W${zt(t).toString().padStart(2,"0")}`;case"monthly":return mt("%b");case"quarterly":return t=>`Q${Math.floor(t.getMonth()/3)+1}`;default:return mt("%m-%d")}})(),vt=(()=>{switch(i){case"daily":return Math.min(10,x.dates.length);case"weekly":return Math.min(12,x.dates.length);case"monthly":return Math.min(12,x.dates.length);case"quarterly":return x.dates.length;default:return}})(),ct=ce(I).tickFormat(t=>Gt(t));i==="quarterly"?ct.tickValues(N):vt&&ct.ticks(vt);let Y=g.select("g.qhc-x-axis");Y.empty()&&(Y=g.append("g").attr("class",`${e.xAxis} qhc-x-axis`)),Y.attr("transform",`translate(0,${W})`).call(ct),Y.selectAll("text").style("text-anchor",i==="daily"||i==="weekly"?"end":"middle").attr("dx",i==="daily"||i==="weekly"?"-.8em":"0").attr("dy",i==="daily"||i==="weekly"?".15em":".71em").attr("transform",i==="daily"||i==="weekly"?"rotate(-45)":null);let J=g.select("g.qhc-y-axis");J.empty()&&(J=g.append("g").attr("class",`${e.yAxis} qhc-y-axis`)),J.call(de(V)),l&&(Y.style("opacity",0).transition().duration(500).delay(80).style("opacity",1),J.style("opacity",0).transition().duration(500).delay(80).style("opacity",1));const Pt=z.map(t=>{const o=N.map((u,p)=>[u,x[t][p]]).filter(u=>typeof u[1]=="number");return{habit:t,color:F(t),points:o}}),dt=m.selectAll("path.qhc-line").data(Pt,t=>t.habit);dt.exit().transition("line-exit").duration(300).style("opacity",0).remove(),dt.enter().append("path").attr("class",`${e.line} qhc-line`).attr("data-habit",t=>t.habit).attr("fill","none").attr("stroke",t=>t.color).attr("opacity",0).attr("d",t=>it(t.points)||"").each(function(){const t=this,o=typeof t.getTotalLength=="function"?t.getTotalLength():0;o>0&&y(t).attr("stroke-dasharray",`${o} ${o}`).attr("stroke-dashoffset",o)}).transition("line-enter").duration(900).ease(_t).attr("opacity",1).attr("stroke-dashoffset",0).on("end",function(){y(this).attr("stroke-dasharray",null)}),dt.transition("line-update").duration(700).ease(ee).attr("stroke",t=>t.color).attrTween("d",function(t){const o=y(this).attr("d")||"",u=it(t.points)||"";return ea(o,u,90)}).on("end",function(t){y(this).attr("d",it(t.points)||"")}),c.selectAll("*").remove();const ut=[];z.forEach(t=>{const o=F(t);N.forEach((u,p)=>{const b=x[t][p];typeof b=="number"&&!isNaN(b)&&ut.push({habit:t,color:o,date:u,value:b})})});const bt=I(N[0]),Yt=I(N[N.length-1]),Qt=Math.max(1,Yt-bt),Ut=l?100:350,Xt=l?1100:600;c.selectAll("circle.qhc-point").data(ut).enter().append("circle").attr("class",`${e.dataPoint} qhc-point`).attr("data-habit",t=>t.habit).attr("cx",t=>I(t.date)).attr("cy",W).attr("r",0).attr("fill",t=>t.color).style("opacity",0).transition("point-enter").delay(t=>Ut+Xt*((I(t.date)-bt)/Qt)).duration(420).ease(wt.overshoot(2)).attr("cy",t=>V(t.value)).attr("r",4).style("opacity",1),E.selectAll("*").remove();const xt=E.append("line").attr("class",e.crosshair).attr("y1",0).attr("y2",W).style("opacity",0).style("pointer-events","none"),pt=E.append("circle").attr("class",e.halo).attr("r",0).style("opacity",0).style("pointer-events","none");let ht=null;const Kt=(t,o,u)=>{pt.interrupt("halo-pulse").interrupt("halo-out").attr("cx",t).attr("cy",o).attr("fill",u);const p=()=>{pt.attr("r",4).style("opacity",.55).transition("halo-pulse").duration(900).ease(_t).attr("r",18).style("opacity",0).on("end",p)};p()},Jt=()=>{pt.interrupt("halo-pulse").transition("halo-out").duration(180).style("opacity",0).attr("r",0)},B=ut.map(t=>({habit:t.habit,date:t.date,value:t.value,x:I(t.date),y:V(t.value)})),Zt=(t,o,u)=>{const p=`${t.habit}|${t.date.toISOString()}`,b=F(t.habit);xt.attr("x1",t.x).attr("x2",t.x).interrupt("crosshair-fade").transition("crosshair-fade").duration(120).style("opacity",1),ht!==p&&(c.selectAll("circle.qhc-point").filter(function(){return y(this).attr("data-active")==="true"}).attr("data-active",null).transition("point-scale").duration(150).attr("r",4),c.selectAll("circle.qhc-point").filter(function(){const T=+y(this).attr("cx"),R=+y(this).attr("cy");return y(this).attr("data-habit")===t.habit&&Math.abs(T-t.x)<.5&&Math.abs(R-t.y)<.5}).attr("data-active","true").transition("point-scale").duration(180).ease(wt.overshoot(2)).attr("r",7),Kt(t.x,t.y,b),ht=p),st({habit:t.habit,date:t.date.toISOString().split("T")[0],value:t.value,x:o,y:u})},te=()=>{xt.interrupt("crosshair-fade").transition("crosshair-fade").duration(180).style("opacity",0),c.selectAll("circle.qhc-point").filter(function(){return y(this).attr("data-active")==="true"}).attr("data-active",null).transition("point-scale").duration(180).attr("r",4),Jt(),ht=null,st(null)};E.append("rect").attr("class",e.overlay).attr("width",K).attr("height",W).on("mousemove",function(t){if(B.length===0)return;const[o,u]=Mt(t,this);let p=B[0],b=1/0;for(const T of B){const R=T.x-o,O=T.y-u,Q=R*R+O*O;Q<b&&(b=Q,p=T)}Zt(p,t.clientX,t.clientY)}).on("mouseleave",()=>{te()}).on("click",function(t){if(B.length===0||!k.current)return;const[o,u]=Mt(t,this);let p=B[0],b=1/0;for(const T of B){const R=T.x-o,O=T.y-u,Q=R*R+O*O;Q<b&&(b=Q,p=T)}k.current(p.habit,p.date.toISOString().split("T")[0],p.value)}),E.raise()},[x,z,K,W,$,F,i,v,f]),d.useEffect(()=>{if(!w.current)return;const a=y(w.current);a.selectAll("path.qhc-line").each(function(){const l=this.getAttribute("data-habit"),s=G&&G!==l;y(this).transition("hover-dim").duration(180).attr("opacity",s?.25:1)}),a.selectAll("circle.qhc-point").each(function(){const l=this.getAttribute("data-habit"),s=G&&G!==l;y(this).transition("hover-dim").duration(180).attr("opacity",s?.25:1)})},[G]);const Wt=(a,l)=>{const s=new Date(a);switch(l){case"daily":return s.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});case"weekly":return`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 a}},Ft={daily:{Icon:le,label:"Daily"},weekly:{Icon:pe,label:"Weekly"},monthly:{Icon:me,label:"Monthly"},quarterly:{Icon:ie,label:"Quarterly"}},Bt=i!=="daily";return r.jsxs("div",{className:e.container,children:[!U&&r.jsxs("div",{className:e.controls,children:[r.jsx("div",{className:e.viewToggle,children:Rt.map(a=>{const{Icon:l,label:s}=Ft[a];return r.jsxs("button",{className:`${e.viewButton} ${i===a?e.active:""}`,onClick:()=>ot(a),title:s,children:[r.jsx("span",{className:e.viewIcon,children:r.jsx(l,{size:16})}),r.jsx("span",{className:e.viewLabel,children:s})]},a)})}),Bt&&r.jsxs("div",{className:e.aggregationToggle,children:[r.jsxs("button",{className:`${e.aggregationButton} ${X==="average"?e.active:""}`,onClick:()=>ft("average"),title:"Show average values for each period",children:[r.jsx("span",{className:e.aggregationIcon,children:r.jsx(ye,{size:16})}),r.jsx("span",{className:e.aggregationLabel,children:"Average"})]}),r.jsxs("button",{className:`${e.aggregationButton} ${X==="sum"?e.active:""}`,onClick:()=>ft("sum"),title:"Show total values for each period",children:[r.jsx("span",{className:e.aggregationIcon,children:r.jsx(ve,{size:16})}),r.jsx("span",{className:e.aggregationLabel,children:"Sum"})]})]})]}),r.jsx("div",{className:`${e.legend}${A?` ${e.compactLegend}`:""}`,children:P.map(a=>r.jsxs("button",{className:`${e.legendItem} ${z.includes(a)?"":e.inactive}`,onClick:()=>Ht(a),onMouseEnter:()=>yt(a),onMouseLeave:()=>yt(null),children:[r.jsx("span",{className:e.legendEmoji,children:D[a]||"📊"}),r.jsx("span",{className:e.legendColor,style:{backgroundColor:F(a)}}),r.jsx("span",{className:e.legendLabel,children:a})]},a))}),r.jsx("svg",{ref:w,viewBox:`0 0 ${v} ${f}`,preserveAspectRatio:"xMidYMid meet",className:e.chart}),S&&r.jsxs("div",{ref:q,className:`${e.tooltip} ${S?e.visible:""}`,style:{left:`${S.x}px`,top:`${S.y-80}px`},children:[r.jsxs("div",{className:e.tooltipHeader,children:[r.jsx("span",{className:e.tooltipEmoji,children:D[S.habit]||"📊"}),r.jsx("span",{className:e.tooltipDot,style:{backgroundColor:F(S.habit)}}),r.jsx("span",{children:S.habit})]}),r.jsxs("div",{className:e.tooltipInfo,children:[r.jsx("div",{className:e.tooltipDate,children:Wt(S.date,i)}),r.jsxs("div",{className:e.tooltipValue,children:[r.jsx("strong",{children:Math.round(S.value*10)/10}),r.jsx("span",{style:{fontSize:"12px",fontWeight:"normal",opacity:.6},children:"units"})]})]})]})]})};Vt.__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 ba={title:"Organisms/Charts/QuantifiableHabitsChart",component:Vt,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"]}}},rt=n=>{const v=[],f=new Date;for(let L=n-1;L>=0;L--){const M=new Date(f);M.setDate(M.getDate()-L),v.push(M.toISOString().split("T")[0])}return v},Z={args:{data:(()=>{const n=rt(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:"👟"}}},tt={args:{data:(()=>{const n=rt(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:"😴"}}},et={args:{data:(()=>{const n=rt(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:"👥"}}},at={args:{data:(()=>{const n=rt(30);return{dates:n,Weight:n.map((v,f)=>70+Math.sin(f/5)*2+Math.random())}})(),width:800,height:300,defaultViewType:"daily",periodType:"month",habitColors:{Weight:"#3b82f6"},habitEmojis:{Weight:"⚖️"}}};var St,Tt,qt;Z.parameters={...Z.parameters,docs:{...(St=Z.parameters)==null?void 0:St.docs,source:{originalSource:`{
|
|
22
22
|
args: {
|
|
23
23
|
data: (() => {
|
|
24
24
|
const dates = generateDateRange(30);
|
|
@@ -122,4 +122,4 @@ import{r as d,j as r}from"./iframe-BTbLpgFM.js";import{s as y,c as _t,f as ee}fr
|
|
|
122
122
|
Weight: '⚖️'
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
}`,...(It=(Nt=at.parameters)==null?void 0:Nt.docs)==null?void 0:It.source}}};const
|
|
125
|
+
}`,...(It=(Nt=at.parameters)==null?void 0:Nt.docs)==null?void 0:It.source}}};const xa=["DailyHabits","WeeklyAverages","YearlyOverview","SingleHabit"];export{Z as DailyHabits,at as SingleHabit,tt as WeeklyAverages,et as YearlyOverview,xa as __namedExportsOrder,ba as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as y,j as W}from"./iframe-
|
|
1
|
+
import{r as y,j as W}from"./iframe-BxepBtx0.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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._container_7142v_1{display:flex;flex-direction:column;align-items:center;gap:var(--spacing-sm);width:100%;position:relative}._clockWrap_7142v_10{width:100%;display:flex;justify-content:center}._tooltip_7142v_16{position:absolute;pointer-events:none;background:var(--color-background);border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:var(--spacing-xs) var(--spacing-sm);box-shadow:var(--shadow-md);font-size:var(--font-size-xs);color:var(--color-text);white-space:nowrap;z-index:10;opacity:0;transition:opacity .15s ease}._tooltip_7142v_16._visible_7142v_32{opacity:1}._tooltipLabel_7142v_36{font-weight:600;margin-bottom:2px}._tooltipRow_7142v_41{color:var(--color-text-secondary);font-size:var(--font-size-xs)}
|