@stfrigerio/sito-template 0.1.59 → 0.1.61
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/molecules/TimeInput/TimeInput.d.ts +1 -1
- package/dist/components/molecules/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/components/molecules/TimeInput/index.d.ts +0 -1
- package/dist/components/molecules/TimeInput/index.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/Calendar.d.ts +5 -1
- package/dist/components/organisms/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/Calendar.stories.d.ts +1 -0
- package/dist/components/organisms/Calendar/Calendar.stories.d.ts.map +1 -1
- package/dist/components/organisms/Calendar/exportEvents.d.ts +8 -0
- package/dist/components/organisms/Calendar/exportEvents.d.ts.map +1 -0
- package/dist/index.esm.js +313 -218
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +311 -216
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +11 -1
- package/storybook-static/assets/{ASCIIText.stories-CsG3yKr5.js → ASCIIText.stories-OSKwRAyY.js} +1 -1
- package/storybook-static/assets/{AllAtoms.stories-D2Pzz8c7.js → AllAtoms.stories-BMrwCHeq.js} +1 -1
- package/storybook-static/assets/{AnimatedContent.stories-BP9feFGz.js → AnimatedContent.stories-Bxf47ut1.js} +1 -1
- package/storybook-static/assets/{AnimatedList.stories-DQ8jdk44.js → AnimatedList.stories-B1E8UqMr.js} +1 -1
- package/storybook-static/assets/{Antigravity.stories-BTIHyYKU.js → Antigravity.stories-I5mdFgmP.js} +1 -1
- package/storybook-static/assets/{ArrayInput.stories-d5_OJJMu.js → ArrayInput.stories-DxmE1Rmk.js} +1 -1
- package/storybook-static/assets/{Aurora.stories-D_eQNPaB.js → Aurora.stories-DTyse-oN.js} +1 -1
- package/storybook-static/assets/{Beams.stories-VLKuYE0_.js → Beams.stories-BTOldQ0-.js} +1 -1
- package/storybook-static/assets/{BlobCursor.stories-BQJgTsuD.js → BlobCursor.stories-C_EhL1Sb.js} +1 -1
- package/storybook-static/assets/{BlurText.stories-oSn5_w7h.js → BlurText.stories-DBE9duA2.js} +1 -1
- package/storybook-static/assets/{BooleansHeatmap.stories-CHoCYK4N.js → BooleansHeatmap.stories-BK-0k1Yf.js} +1 -1
- package/storybook-static/assets/{BorderGlow.stories-D-vgIU3S.js → BorderGlow.stories-DUaNIh97.js} +1 -1
- package/storybook-static/assets/{BubbleMenu.stories-DcWoqA7_.js → BubbleMenu.stories-DUkNhCYN.js} +1 -1
- package/storybook-static/assets/{Button-DgpqJWgD.js → Button-CmL8YExH.js} +1 -1
- package/storybook-static/assets/{Button.stories-TQXKQagp.js → Button.stories-Qe92VaQO.js} +1 -1
- package/storybook-static/assets/Calendar-CXrUBxYt.css +1 -0
- package/storybook-static/assets/Calendar.stories-DvRq1jLb.js +352 -0
- package/storybook-static/assets/{Card-Bu54h8gN.js → Card-BNN9rA1_.js} +1 -1
- package/storybook-static/assets/{Card.stories-Dw2bPvLo.js → Card.stories-DJtwbzzK.js} +1 -1
- package/storybook-static/assets/{CardNav.stories-CnbwwAde.js → CardNav.stories-D3WJ4l1d.js} +1 -1
- package/storybook-static/assets/{Carousel.stories-ChBLLqBg.js → Carousel.stories-Cl5XZxQx.js} +1 -1
- package/storybook-static/assets/{Checkbox-Duyafa-Y.js → Checkbox-NV1yLfww.js} +1 -1
- package/storybook-static/assets/{Checkbox.stories-Co7IxmK1.js → Checkbox.stories-DEt8_02c.js} +1 -1
- package/storybook-static/assets/{ChromaGrid.stories-68ukohGs.js → ChromaGrid.stories-BPq9jzOX.js} +1 -1
- package/storybook-static/assets/{CircularGallery.stories-CV4iXVIX.js → CircularGallery.stories-BKkHClqR.js} +1 -1
- package/storybook-static/assets/{CircularText.stories-DqYHtbPW.js → CircularText.stories-DL97L-4c.js} +1 -1
- package/storybook-static/assets/{ClickSpark.stories-DvAOxLjs.js → ClickSpark.stories-CePCUrfJ.js} +1 -1
- package/storybook-static/assets/{ColorBends.stories-Dm4nxTTN.js → ColorBends.stories-qHNzC_b-.js} +1 -1
- package/storybook-static/assets/{CountUp.stories-DTaL8Yfy.js → CountUp.stories-DN2cFFy0.js} +1 -1
- package/storybook-static/assets/{Counter.stories-Bf_2Js0l.js → Counter.stories-U-VxTg4K.js} +1 -1
- package/storybook-static/assets/{Crosshair.stories-DJjjCcED.js → Crosshair.stories-DZ3e7z4E.js} +1 -1
- package/storybook-static/assets/{Cubes.stories-Qh3JqlQW.js → Cubes.stories-zndGensK.js} +1 -1
- package/storybook-static/assets/{CurvedLoop.stories-BvyrCuM7.js → CurvedLoop.stories-CPwaetTg.js} +1 -1
- package/storybook-static/assets/{DarkVeil.stories-BVY870pm.js → DarkVeil.stories-7UE8YAds.js} +1 -1
- package/storybook-static/assets/{DateInput-DfGES3te.js → DateInput-C7UYtU2f.js} +1 -1
- package/storybook-static/assets/{DateInput.stories-BXF8Ttde.js → DateInput.stories-Blprxd6L.js} +1 -1
- package/storybook-static/assets/{DecayCard.stories-B0g2xWqX.js → DecayCard.stories-CyDj4Rzg.js} +1 -1
- package/storybook-static/assets/{DecryptedText.stories-fqDZfjv8.js → DecryptedText.stories-CcmNeei7.js} +1 -1
- package/storybook-static/assets/{Dither.stories-B4N3Z5sW.js → Dither.stories-Cx3gQA5F.js} +1 -1
- package/storybook-static/assets/{Dock.stories-f_YKz-pl.js → Dock.stories-BnetMt5P.js} +1 -1
- package/storybook-static/assets/{EditFAB.stories-LhVUDgtx.js → EditFAB.stories-BM8RRvq2.js} +1 -1
- package/storybook-static/assets/{EvilEye.stories-BtBvvs31.js → EvilEye.stories-CU9FGY5P.js} +1 -1
- package/storybook-static/assets/{FadeContent.stories-oNqKrfSe.js → FadeContent.stories-BaWDFQed.js} +1 -1
- package/storybook-static/assets/{FaultyTerminal.stories-7nV4DvrW.js → FaultyTerminal.stories-D1AZCPEZ.js} +1 -1
- package/storybook-static/assets/{Fbo-Clk04E0N.js → Fbo-BM-i3UPR.js} +1 -1
- package/storybook-static/assets/{FloatingLines.stories-DgxhGl_b.js → FloatingLines.stories-fehYMPcZ.js} +1 -1
- package/storybook-static/assets/{FlowingMenu.stories-C5dfG25U.js → FlowingMenu.stories-DRGoAotO.js} +1 -1
- package/storybook-static/assets/{FluidGlass.stories-DGLlp1x1.js → FluidGlass.stories-DgAiwR5f.js} +1 -1
- package/storybook-static/assets/{Folder.stories-BJGdA6Qb.js → Folder.stories-Bys9N63w.js} +1 -1
- package/storybook-static/assets/{FuzzyText.stories-DygRT6bB.js → FuzzyText.stories-D-74llkc.js} +1 -1
- package/storybook-static/assets/{Galaxy.stories-BU6XCHeu.js → Galaxy.stories-VD6ETxyT.js} +1 -1
- package/storybook-static/assets/{GhostCursor.stories-D_HIFPUl.js → GhostCursor.stories-DjMEnN7i.js} +1 -1
- package/storybook-static/assets/{GlareHover.stories-D5_-xnyP.js → GlareHover.stories-6KgkPV6C.js} +1 -1
- package/storybook-static/assets/{GlassSurface.stories-CrZqAGRq.js → GlassSurface.stories-Dj1kCNDg.js} +1 -1
- package/storybook-static/assets/{GlitchText.stories-BRqI-kBX.js → GlitchText.stories-DcGDGtvN.js} +1 -1
- package/storybook-static/assets/{GooeyNav.stories-DjR0-Th2.js → GooeyNav.stories-yae-ax1k.js} +1 -1
- package/storybook-static/assets/{GradientBlinds.stories-CiIDtPz3.js → GradientBlinds.stories-B7h647VQ.js} +1 -1
- package/storybook-static/assets/{GradientText.stories-pLA_An71.js → GradientText.stories-BPUXNES_.js} +1 -1
- package/storybook-static/assets/{Grainient.stories-BthRrRMd.js → Grainient.stories-BjFhc8gt.js} +1 -1
- package/storybook-static/assets/{GridMotion.stories-BSwjL8IE.js → GridMotion.stories-Bm8YB3Nc.js} +1 -1
- package/storybook-static/assets/{ImageSlideshow.stories-BYAQMHlZ.js → ImageSlideshow.stories-BT5Pfqt3.js} +6 -11
- package/storybook-static/assets/{Iridescence.stories-ChHTH2TM.js → Iridescence.stories-DysieilC.js} +1 -1
- package/storybook-static/assets/{LaserFlow.stories-DlDx8Vr8.js → LaserFlow.stories-BJMXiU6b.js} +1 -1
- package/storybook-static/assets/{LetterGlitch.stories-C-S2SRjU.js → LetterGlitch.stories-Qpkbs2x5.js} +1 -1
- package/storybook-static/assets/{LightPillar.stories-D0PF-h7T.js → LightPillar.stories-D7r7SjN3.js} +1 -1
- package/storybook-static/assets/{LightRays.stories-Cbkl7wuP.js → LightRays.stories-CSmrA40u.js} +1 -1
- package/storybook-static/assets/{Lightning.stories-BUs-gwYj.js → Lightning.stories-0zr6qZVm.js} +1 -1
- package/storybook-static/assets/{LineWaves.stories-D2GXzteP.js → LineWaves.stories-KgMfrrqs.js} +1 -1
- package/storybook-static/assets/{LiquidChrome.stories-CtDp7th1.js → LiquidChrome.stories-B8ZLHoH1.js} +1 -1
- package/storybook-static/assets/{LiquidEther.stories-DM2n5oEm.js → LiquidEther.stories-C4k9P7aN.js} +1 -1
- package/storybook-static/assets/{LoadingSpinner-DaUSIVPY.js → LoadingSpinner-Cy3HB7-7.js} +1 -1
- package/storybook-static/assets/{LoadingSpinner.stories-Cx4_nNAf.js → LoadingSpinner.stories-DDNFJhwe.js} +1 -1
- package/storybook-static/assets/{MagicRings.stories-CZt-cHcL.js → MagicRings.stories-UqocGxaQ.js} +1 -1
- package/storybook-static/assets/{Magnet.stories-B6js1VeO.js → Magnet.stories-BxvO0Fqj.js} +1 -1
- package/storybook-static/assets/{MagnetLines.stories-BKQ9YC_E.js → MagnetLines.stories-BMqOFHvT.js} +1 -1
- package/storybook-static/assets/{Masonry.stories-BGkTkNUa.js → Masonry.stories-CLwqpLTU.js} +1 -1
- package/storybook-static/assets/{MetaBalls.stories-Cao6Tqjg.js → MetaBalls.stories-B_lPmlPu.js} +1 -1
- package/storybook-static/assets/{MetallicPaint.stories-DF9qb3W_.js → MetallicPaint.stories-9AWQepP6.js} +1 -1
- package/storybook-static/assets/{MoodChart.stories-AGxwnR6s.js → MoodChart.stories-B6LHsTmy.js} +1 -1
- package/storybook-static/assets/{MotionConfigContext-BCa1jVYq.js → MotionConfigContext-CJ0kpWbz.js} +1 -1
- package/storybook-static/assets/{Navbar.stories-CFHb1c22.js → Navbar.stories-Cag40GVb.js} +1 -1
- package/storybook-static/assets/{Noise.stories-ConXbyqm.js → Noise.stories-BukT-fj1.js} +1 -1
- package/storybook-static/assets/{NumberStepper-DH9y3k8b.js → NumberStepper-Ut_VByYA.js} +1 -1
- package/storybook-static/assets/{NumberStepper.stories-PMwPqbsn.js → NumberStepper.stories-3y594BTK.js} +1 -1
- package/storybook-static/assets/{Orb.stories-DcXSWhV1.js → Orb.stories-B45u5gJo.js} +1 -1
- package/storybook-static/assets/{OrbitImages.stories-Dk417qKA.js → OrbitImages.stories-B_7X-GMA.js} +1 -1
- package/storybook-static/assets/{PieChart.stories-6sgfe6Xk.js → PieChart.stories-DLrtlyWH.js} +1 -1
- package/storybook-static/assets/{PixelBlast.stories-_cBuognT.js → PixelBlast.stories-C4ZAaMH_.js} +1 -1
- package/storybook-static/assets/{PixelCard.stories-D_EZOUox.js → PixelCard.stories-CaOGvNQ_.js} +1 -1
- package/storybook-static/assets/{PixelSnow.stories-DcD7737G.js → PixelSnow.stories-CGmFGV3L.js} +1 -1
- package/storybook-static/assets/{PixelTransition.stories-BwNcUv5J.js → PixelTransition.stories-DzTJZhF-.js} +1 -1
- package/storybook-static/assets/{Plasma.stories-BLolMCfR.js → Plasma.stories-CoyLfj7o.js} +1 -1
- package/storybook-static/assets/{Prism.stories-CG2_KGsq.js → Prism.stories-D2E3ZI6g.js} +1 -1
- package/storybook-static/assets/{PrismaticBurst.stories-DzS--Ffu.js → PrismaticBurst.stories-B8PJhK5n.js} +1 -1
- package/storybook-static/assets/{ProfileCard.stories-vI_ispYe.js → ProfileCard.stories-CbRCcyd9.js} +1 -1
- package/storybook-static/assets/{QuantifiableHabitsChart.stories-D5yeGCZ5.js → QuantifiableHabitsChart.stories-BCrpnpyh.js} +1 -1
- package/storybook-static/assets/{Radar.stories-DLv_hY9T.js → Radar.stories-B-Ki4OHb.js} +1 -1
- package/storybook-static/assets/{Ribbons.stories-4BbVINtW.js → Ribbons.stories-DMBczKgc.js} +1 -1
- package/storybook-static/assets/{RippleGrid.stories-CFh8tigy.js → RippleGrid.stories-C8dKr2CX.js} +1 -1
- package/storybook-static/assets/{RotatingText.stories-AM4GcpU2.js → RotatingText.stories-DJu0v3mv.js} +1 -1
- package/storybook-static/assets/{ScrollFloat.stories-Ct_ZkL7k.js → ScrollFloat.stories-B_edvvO1.js} +1 -1
- package/storybook-static/assets/{ScrollReveal.stories-B7fcgLZ3.js → ScrollReveal.stories-DTYFesNE.js} +1 -1
- package/storybook-static/assets/{ScrollVelocity.stories-BRDv3Fdk.js → ScrollVelocity.stories-B2O7zZ2t.js} +1 -1
- package/storybook-static/assets/{SearchBar.stories-Dnmegbak.js → SearchBar.stories-CUEF7Ba4.js} +1 -1
- package/storybook-static/assets/{SearchableDropdown-BtIsuxmT.js → SearchableDropdown-C6KY2mIJ.js} +1 -1
- package/storybook-static/assets/{SearchableDropdown.stories-DVub17TN.js → SearchableDropdown.stories-DbSJdUAJ.js} +1 -1
- package/storybook-static/assets/{SelectInput-C0kBLYgX.js → SelectInput-tDvouCuN.js} +1 -1
- package/storybook-static/assets/{SelectInput.stories-HoF32-Km.js → SelectInput.stories-C6apSsWx.js} +1 -1
- package/storybook-static/assets/{ShapeBlur.stories-C3RyLvBh.js → ShapeBlur.stories-DVQs_Ng0.js} +1 -1
- package/storybook-static/assets/{ShapeGrid.stories-ltmu466o.js → ShapeGrid.stories-BjibW7b1.js} +1 -1
- package/storybook-static/assets/{ShinyText.stories-JO2F4CpJ.js → ShinyText.stories-DTezLW7e.js} +1 -1
- package/storybook-static/assets/{Silk.stories-CUzWiwqP.js → Silk.stories-fZbeNXOO.js} +1 -1
- package/storybook-static/assets/{SleepChart.stories-YvCzf0BI.js → SleepChart.stories-nqH0hgCL.js} +1 -1
- package/storybook-static/assets/{Slider-CI9mXQSu.js → Slider-DIeyN9Hx.js} +1 -1
- package/storybook-static/assets/{Slider.stories-DQYlBjGq.js → Slider.stories-BzcscFcU.js} +1 -1
- package/storybook-static/assets/{SoftAurora.stories-ubq_KV8Q.js → SoftAurora.stories-Cvtf3TKB.js} +1 -1
- package/storybook-static/assets/{SoundDemo.stories-Cie-leKw.js → SoundDemo.stories-Dpq3K-yq.js} +1 -1
- package/storybook-static/assets/{SplashCursor.stories-Clea3dMy.js → SplashCursor.stories-Y5zBSBCL.js} +1 -1
- package/storybook-static/assets/{SpotlightCard.stories-BWv0AuTI.js → SpotlightCard.stories-B1KBEp6T.js} +1 -1
- package/storybook-static/assets/{Stack.stories-DxVGTJ6l.js → Stack.stories-CA5YToyH.js} +1 -1
- package/storybook-static/assets/{StaggeredMenu.stories-1UB8ravq.js → StaggeredMenu.stories-BvQIujuB.js} +1 -1
- package/storybook-static/assets/{StarBorder.stories-DiSAqN3r.js → StarBorder.stories-CHtwoVna.js} +1 -1
- package/storybook-static/assets/{SunburstChart.stories-DLjQA_I1.js → SunburstChart.stories-Ch-ivaQT.js} +1 -1
- package/storybook-static/assets/{Table.stories-wQGb96WC.js → Table.stories-CvYZiI3H.js} +1 -1
- package/storybook-static/assets/{Tabs.stories-jkioQ4xt.js → Tabs.stories-BN3Icfzj.js} +1 -1
- package/storybook-static/assets/{TargetCursor.stories-B4ACbrmW.js → TargetCursor.stories-D1PTwE36.js} +1 -1
- package/storybook-static/assets/{TextArea-DN6IYITs.js → TextArea-DKtwryA1.js} +1 -1
- package/storybook-static/assets/{TextArea.stories-CwLLZFoD.js → TextArea.stories-CxsYukYi.js} +1 -1
- package/storybook-static/assets/{TextCursor.stories-NORQhkfy.js → TextCursor.stories-BouFdSlt.js} +1 -1
- package/storybook-static/assets/{TextInput-CLgIGUn3.js → TextInput-CsK2bPrD.js} +1 -1
- package/storybook-static/assets/{TextInput.stories-BNooOWA2.js → TextInput.stories-fZ3j5ID4.js} +1 -1
- package/storybook-static/assets/{TextPressure.stories-BaCAyBD4.js → TextPressure.stories-B6pN9RLp.js} +1 -1
- package/storybook-static/assets/{TextType.stories-DG4mQ3HF.js → TextType.stories-C9jm9TdC.js} +1 -1
- package/storybook-static/assets/{ThemeSwitcher.stories-slxIamHU.js → ThemeSwitcher.stories-DHJZPEtd.js} +1 -1
- package/storybook-static/assets/{Threads.stories-Rsg8lRsX.js → Threads.stories-BiH2lkaI.js} +1 -1
- package/storybook-static/assets/{TimeInput.stories-CaO8_PY2.js → TimeInput.stories-DOyFcxE2.js} +1 -1
- package/storybook-static/assets/{Toggle-CTTN-13k.js → Toggle-sPP5IZcW.js} +1 -1
- package/storybook-static/assets/{Toggle.stories-DrNYDjFB.js → Toggle.stories-D5BPv-SU.js} +1 -1
- package/storybook-static/assets/{ToggleButton-CXK855yx.js → ToggleButton-DmyfG7tC.js} +1 -1
- package/storybook-static/assets/{ToggleButton.stories-DNsNH9vH.js → ToggleButton.stories-B1AcmGcL.js} +1 -1
- package/storybook-static/assets/{TrueFocus.stories-zG6Ml8RP.js → TrueFocus.stories-CYVbY0Hb.js} +1 -1
- package/storybook-static/assets/{VariableProximity.stories-CMZW-Tov.js → VariableProximity.stories-BZRrDkSH.js} +1 -1
- package/storybook-static/assets/{Waves.stories-CscXTp_S.js → Waves.stories-D9BkuCeQ.js} +1 -1
- package/storybook-static/assets/{check-DLeHG_Da.js → check-B3Ha7gnS.js} +1 -1
- package/storybook-static/assets/{chevron-down-Ciks5pXx.js → chevron-down-DlPO5f1Y.js} +1 -1
- package/storybook-static/assets/{chevron-right-DjeluSA0.js → chevron-right-B8eoaBIh.js} +1 -1
- package/storybook-static/assets/client-DxIdGip8.js +1 -0
- package/storybook-static/assets/{createLucideIcon-dvowvj4F.js → createLucideIcon-G8N511cp.js} +1 -1
- package/storybook-static/assets/download-w1NWX-h6.js +6 -0
- package/storybook-static/assets/{folder-CCqkDvFG.js → folder-JRyPzO6h.js} +1 -1
- package/storybook-static/assets/{iconBase-nrk1zV8Q.js → iconBase-DxMTUG9N.js} +1 -1
- package/storybook-static/assets/{iframe-Cw8dCV4Z.js → iframe-DCkPNH_h.js} +3 -3
- package/storybook-static/assets/{index-CzApopWo.js → index-BTVArzym.js} +1 -1
- package/storybook-static/assets/{index-A7l1uA6_.js → index-BW6Op62F.js} +1 -1
- package/storybook-static/assets/{index-Bm5msOcI.js → index-CsT-CD6f.js} +1 -1
- package/storybook-static/assets/{proxy-p8L3T_Zy.js → proxy-cgPyYfyG.js} +1 -1
- package/storybook-static/assets/{react-18-D7YhBYbX.js → react-18-YVQChixo.js} +1 -1
- package/storybook-static/assets/{react-three-fiber.esm-BnMrba87.js → react-three-fiber.esm-_mYjl9J6.js} +1 -1
- package/storybook-static/assets/{search-7V6DOf2z.js → search-DioxI_xb.js} +1 -1
- package/storybook-static/assets/{settings-B8s5hJGs.js → settings-DFQ10p72.js} +1 -1
- package/storybook-static/assets/{sun-5V6ee2LJ.js → sun-BfIldVmy.js} +1 -1
- package/storybook-static/assets/{trash-2-DeQvYdO7.js → trash-2-DqTvgQRR.js} +1 -1
- package/storybook-static/assets/{use-animation-frame-DovyG_Es.js → use-animation-frame-CnngNm80.js} +1 -1
- package/storybook-static/assets/{use-in-view-Dv3LTdsl.js → use-in-view-DLYDN0EG.js} +1 -1
- package/storybook-static/assets/{use-motion-value-BVm7csqA.js → use-motion-value-Ud8-h3gV.js} +1 -1
- package/storybook-static/assets/{use-spring-BkrdNVnG.js → use-spring-DcEBTvl_.js} +1 -1
- package/storybook-static/assets/{use-transform-CQNghMvr.js → use-transform-8mNuLPFu.js} +1 -1
- package/storybook-static/assets/{useSound-D23BsIr4.js → useSound-Cv_O9Yec.js} +1 -1
- package/storybook-static/assets/{users-R6T-yLyH.js → users-B5lo7ErU.js} +1 -1
- package/storybook-static/assets/{x-CypMgsiv.js → x-CgTXkpyT.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/Calendar-BZCyXxvF.css +0 -1
- package/storybook-static/assets/Calendar.stories-D5CKBagI.js +0 -321
- package/storybook-static/assets/client-D1KVnN68.js +0 -1
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import{r as x,j as e}from"./iframe-DCkPNH_h.js";import{u as rt}from"./use-motion-value-Ud8-h3gV.js";import{u as Qt}from"./use-transform-8mNuLPFu.js";import{m as $e}from"./proxy-cgPyYfyG.js";import{T as Kt}from"./trash-2-DqTvgQRR.js";import{c as Bt}from"./createLucideIcon-G8N511cp.js";import{C as Zt}from"./check-B3Ha7gnS.js";import{a as _e}from"./index-CsT-CD6f.js";import{D as en}from"./download-w1NWX-h6.js";import"./preload-helper-C1FmrZbK.js";import"./MotionConfigContext-CJ0kpWbz.js";/**
|
|
2
|
+
* @license lucide-react v0.539.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const tn=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],nn=Bt("grip-vertical",tn);/**
|
|
7
|
+
* @license lucide-react v0.539.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const an=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],on=Bt("pencil",an),rn="_calendar_qyzkq_2",sn="_loading_qyzkq_14",ln="_loadingSpinner_qyzkq_21",cn="_header_qyzkq_27",dn="_navigation_qyzkq_35",mn="_navButton_qyzkq_41",un="_title_qyzkq_60",pn="_controls_qyzkq_70",yn="_exportDropdown_qyzkq_76",gn="_exportButton_qyzkq_80",vn="_exportMenu_qyzkq_98",fn="_exportMenuItem_qyzkq_113",hn="_todayButton_qyzkq_130",wn="_viewToggle_qyzkq_146",kn="_viewButton_qyzkq_153",Dn="_active_qyzkq_167",_n="_filterBar_qyzkq_177",xn="_filterPill_qyzkq_186",Sn="_filterPillActive_qyzkq_205",Cn="_filterDot_qyzkq_211",Tn="_weekDays_qyzkq_219",En="_withWeekNumbers_qyzkq_226",qn="_weekNumberHeader_qyzkq_230",bn="_weekDay_qyzkq_219",jn="_daysGrid_qyzkq_247",Nn="_dayCell_qyzkq_263",Mn="_dayNumber_qyzkq_292",Hn="_today_qyzkq_130",zn="_events_qyzkq_311",$n="_event_qyzkq_311",Ln="_eventTitle_qyzkq_338",In="_eventTime_qyzkq_347",Pn="_otherMonth_qyzkq_392",Bn="_selected_qyzkq_397",Fn="_compact_qyzkq_409",An="_dots_qyzkq_431",Wn="_dot_qyzkq_431",On="_dotMore_qyzkq_446",Rn="_weekNumberCell_qyzkq_453",Vn="_completed_qyzkq_499",Gn="_completedIcon_qyzkq_520",Un="_moreEvents_qyzkq_527",Yn="_emptyState_qyzkq_537",Xn="_dayView_qyzkq_547",Jn="_dayViewHeader_qyzkq_556",Qn="_timeColumnHeader_qyzkq_566",Kn="_dayColumnHeader_qyzkq_573",Zn="_allDayStrip_qyzkq_583",ea="_allDayLabel_qyzkq_591",ta="_allDayList_qyzkq_602",na="_dayViewScrollContainer_qyzkq_625",aa="_dayTimelineGrid_qyzkq_634",oa="_hourRow_qyzkq_639",ra="_hourLabel_qyzkq_645",sa="_hourSlots_qyzkq_656",ia="_halfHourSlot_qyzkq_663",la="_halfHourSlotBottom_qyzkq_673",ca="_dayEventAnchor_qyzkq_678",da="_weekTimeline_qyzkq_686",ma="_weekTimelineHeader_qyzkq_695",ua="_weekDayColumnHeader_qyzkq_707",pa="_weekDayLabel_qyzkq_741",ya="_weekDayNumber_qyzkq_749",ga="_weekTimelineScroll_qyzkq_754",va="_weekTimelineGrid_qyzkq_762",fa="_weekTimeColumn_qyzkq_768",ha="_weekTimeSlot_qyzkq_776",wa="_weekHourLabel_qyzkq_783",ka="_weekDayColumns_qyzkq_789",Da="_weekDayColumn_qyzkq_707",_a="_weekHourRow_qyzkq_807",xa="_weekEventAnchor_qyzkq_813",Sa="_currentTimeIndicator_qyzkq_821",n={calendar:rn,loading:sn,loadingSpinner:ln,header:cn,navigation:dn,navButton:mn,title:un,controls:pn,exportDropdown:yn,exportButton:gn,exportMenu:vn,exportMenuItem:fn,todayButton:hn,viewToggle:wn,viewButton:kn,active:Dn,filterBar:_n,filterPill:xn,filterPillActive:Sn,filterDot:Cn,weekDays:Tn,withWeekNumbers:En,weekNumberHeader:qn,weekDay:bn,daysGrid:jn,dayCell:Nn,dayNumber:Mn,today:Hn,events:zn,event:$n,eventTitle:Ln,eventTime:In,otherMonth:Pn,selected:Bn,compact:Fn,dots:An,dot:Wn,dotMore:On,weekNumberCell:Rn,completed:Vn,completedIcon:Gn,moreEvents:Un,emptyState:Yn,dayView:Xn,dayViewHeader:Jn,timeColumnHeader:Qn,dayColumnHeader:Kn,allDayStrip:Zn,allDayLabel:ea,allDayList:ta,dayViewScrollContainer:na,dayTimelineGrid:aa,hourRow:oa,hourLabel:ra,hourSlots:sa,halfHourSlot:ia,halfHourSlotBottom:la,dayEventAnchor:ca,weekTimeline:da,weekTimelineHeader:ma,weekDayColumnHeader:ua,weekDayLabel:pa,weekDayNumber:ya,weekTimelineScroll:ga,weekTimelineGrid:va,weekTimeColumn:fa,weekTimeSlot:ha,weekHourLabel:wa,weekDayColumns:ka,weekDayColumn:Da,weekHourRow:_a,weekEventAnchor:xa,currentTimeIndicator:Sa},Ca="_wrapper_nyv1b_1",Ta="_deleteUnderlay_nyv1b_7",Ea="_card_nyv1b_23",qa="_dragging_nyv1b_43",ba="_completed_nyv1b_49",ja="_text_nyv1b_53",Na="_grip_nyv1b_57",Ma="_checkIcon_nyv1b_77",Ha="_time_nyv1b_89",za="_editButton_nyv1b_96",P={wrapper:Ca,deleteUnderlay:Ta,card:Ea,dragging:qa,completed:ba,text:ja,grip:Na,checkIcon:Ma,time:Ha,editButton:za},$a=-80,ze=({event:o,color:a,textColor:s,onComplete:l,onEdit:c,onDelete:u,onDragEnd:d,draggable:f=!0})=>{const w=rt(0),_=rt(0),k=Qt(w,[-80,0],[1,0]),[T,b]=x.useState(!1),$=x.useRef(!1),N=x.useRef(null),K=o.status==="completed",O=(p,V)=>{u&&V.offset.x<$a?_e(w,-1e3,{duration:.2,onComplete:()=>u(o)}):_e(w,0,{type:"spring",stiffness:400,damping:30})},Z=()=>{if($.current){$.current=!1;return}T||l==null||l(o)},le=p=>{!f||!d||(p.stopPropagation(),p.preventDefault(),N.current={x:p.clientX,y:p.clientY,pointerId:p.pointerId},p.currentTarget.setPointerCapture(p.pointerId),b(!0))},ee=p=>{N.current&&(w.set(p.clientX-N.current.x),_.set(p.clientY-N.current.y))},ce=p=>{if(!N.current)return;const V=p.clientY,D=p.clientX;try{p.currentTarget.releasePointerCapture(N.current.pointerId)}catch{}N.current=null,b(!1),_e(_,0,{type:"spring",stiffness:400,damping:30}),_e(w,0,{type:"spring",stiffness:400,damping:30}),d==null||d(V,D)},R=!!u,de=f&&!!d;return e.jsxs("div",{className:P.wrapper,children:[R&&e.jsxs($e.div,{className:P.deleteUnderlay,style:{opacity:k},children:[e.jsx(Kt,{size:16}),e.jsx("span",{children:"Delete"})]}),e.jsxs($e.div,{className:`${P.card} ${K?P.completed:""} ${T?P.dragging:""}`,style:{x:w,y:_,background:a,color:s,borderLeftColor:a},drag:R&&!T?"x":!1,dragConstraints:R?{left:-200,right:0}:void 0,dragElastic:.15,dragDirectionLock:!0,onDragStart:()=>{$.current=!0},onDragEnd:O,whileTap:T?void 0:{scale:.98},animate:T?{scale:1.03}:{scale:1},onClick:Z,children:[de&&e.jsx("div",{className:P.grip,onPointerDown:le,onPointerMove:ee,onPointerUp:ce,onPointerCancel:ce,onClick:p=>p.stopPropagation(),children:e.jsx(nn,{size:14})}),K&&e.jsx(Zt,{size:14,className:P.checkIcon,strokeWidth:3}),e.jsx("span",{className:P.text,children:o.title}),o.time&&e.jsx("span",{className:P.time,children:o.time}),c&&e.jsx("button",{className:P.editButton,onClick:p=>{p.stopPropagation(),c(o)},"aria-label":"Edit event",children:e.jsx(on,{size:13})})]})]})};ze.__docgenInfo={description:"",methods:[],displayName:"DayEventCard",props:{draggable:{defaultValue:{value:"true",computed:!1},required:!1}}};const ye=["id","title","date","time","endTime","allDay","type","status","priority","category"],La=o=>(typeof o=="string"?new Date(o):o).toISOString(),Ve=o=>{const a={};for(const s of ye){const l=o[s];l!==void 0&&(a[s]=s==="date"?La(l):l)}return a},Ia=o=>{if(o==null)return"";const a=String(o);return/[",\n\r]/.test(a)?`"${a.replace(/"/g,'""')}"`:a},Pa=o=>{const a=ye.join(","),s=o.map(l=>{const c=Ve(l);return ye.map(u=>Ia(c[u])).join(",")});return[a,...s].join(`
|
|
12
|
+
`)},Ba=o=>JSON.stringify(o.map(Ve),null,2),Fa=o=>{if(o==null)return"";const a=String(o);return/[",\n\r]/.test(a)?`"${a.replace(/"/g,'""')}"`:a},Aa=o=>{const a=`events[${o.length}]{${ye.join(",")}}:`,s=o.map(l=>{const c=Ve(l);return" "+ye.map(u=>Fa(c[u])).join(",")});return[a,...s].join(`
|
|
13
|
+
`)},Wa={csv:"text/csv;charset=utf-8;",json:"application/json;charset=utf-8;",toon:"text/plain;charset=utf-8;"},Oa={csv:"csv",json:"json",toon:"toon"},Ra=(o,a)=>a==="csv"?Pa(o):a==="json"?Ba(o):Aa(o),Va=(o,a,s)=>{const l=Ra(o,a),c=new Blob([l],{type:Wa[a]}),u=URL.createObjectURL(c),d=document.createElement("a");d.href=u,d.download=`events-${new Date().toISOString().slice(0,10)}.${Oa[a]}`,document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(u)};function se({events:o,onEventClick:a,onDateClick:s,onEventClickByView:l,onDateClickByView:c,onTimeSlotClick:u,onEventDrop:d,onEventComplete:f,onEventDelete:w,onEventEdit:_,viewMode:k="month",initialDate:T=new Date,config:b={},className:$="",style:N={},loading:K=!1,emptyState:O,hideHeader:Z=!1,compact:le=!1,selectedDate:ee,selectedCategoryId:ce,onCategoryChange:R,exportFormats:de}){const[p,V]=x.useState(T),[D,Ie]=x.useState(k),[Ft,At]=x.useState(null),Ge=ce!==void 0,te=Ge?ce??null:Ft,Ue=t=>{Ge||At(t),R==null||R(t)},Pe=x.useRef(null),Be=x.useRef(null),[ge,Fe]=x.useState(!1),Ae=x.useRef(null);x.useEffect(()=>{if(!ge)return;const t=r=>{Ae.current&&!Ae.current.contains(r.target)&&Fe(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[ge]);const{eventColors:Ye={},iconRenderer:Xe,maxEventsPerDay:G=3,mondayStart:me=!1,showWeekNumbers:ve=!1,dateFormat:Je={month:"long",year:"numeric"},locale:U="en-US",dayLabels:Wt,monthNames:fe,startHour:L=0,endHour:Qe=24,hourHeight:E=60,halfHourSlots:I=!1,categories:ne}=b,Ke=x.useMemo(()=>!ne||ne.length===0||te===null?o:o.filter(t=>!t.category||t.category===te),[o,ne,te]),Ot=Wt||(me?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),Ze=(b==null?void 0:b.hourHeight)??60,et=(b==null?void 0:b.startHour)??0,ue=x.useMemo(()=>{const t=p.getFullYear(),r=p.getMonth();let y,m,S;if(D==="week"){y=new Date(p);const H=y.getDay(),h=me?y.getDate()-H+(H===0?-6:1):y.getDate()-H;y=new Date(y.setDate(h)),y.setHours(0,0,0,0),m=new Date(y),m.setDate(m.getDate()+6);const F=y.toLocaleDateString(U,{day:"numeric",month:"short"}),z=m.toLocaleDateString(U,{day:"numeric",month:"short"});S=`${F} - ${z}`}else if(D==="day")y=new Date(p),y.setHours(0,0,0,0),m=new Date(p),m.setHours(23,59,59,999),S=p.toLocaleDateString(U,{weekday:"long",year:"numeric",month:"long",day:"numeric"});else{const H=new Date(t,r,1),h=new Date(t,r+1,0);y=new Date(H);const F=me?(H.getDay()+6)%7:H.getDay();y.setDate(y.getDate()-F),m=new Date(h);const z=me?(h.getDay()+6)%7:h.getDay();m.setDate(m.getDate()+(6-z)),fe&&fe[r]?S=`${fe[r]} ${t}`:S=p.toLocaleDateString(U,Je)}const j=[],M=new Date(y);for(;M<=m;)j.push(new Date(M)),M.setDate(M.getDate()+1);return{days:j,displayTitle:S}},[p,D,me,U,Je,fe]);x.useEffect(()=>{const t=D==="day"?Pe:D==="week"?Be:null;if(!(t!=null&&t.current))return;const r=new Date;if(!(D==="day"?p.toDateString()===r.toDateString():ue.days.some(j=>j.toDateString()===r.toDateString())))return;const m=(r.getHours()-et)*60+r.getMinutes(),S=Math.max(0,m/60*Ze-100);setTimeout(()=>{t.current&&(t.current.scrollTop=S)},0)},[D,p,et,Ze,ue]);const We=t=>{const r=Ke.filter(y=>new Date(y.date).toDateString()===t.toDateString());return D==="week"?r.sort((y,m)=>{const S=y.time?tt(y.time):999999,j=m.time?tt(m.time):999999;return S-j}):r},tt=t=>{const[r,y]=t.split(":").map(Number);return r*60+y},Rt=()=>{const t=new Date(p);D==="week"?t.setDate(t.getDate()-7):D==="day"?t.setDate(t.getDate()-1):t.setMonth(t.getMonth()-1),V(t)},Vt=()=>{const t=new Date(p);D==="week"?t.setDate(t.getDate()+7):D==="day"?t.setDate(t.getDate()+1):t.setMonth(t.getMonth()+1),V(t)},Gt=()=>{V(new Date)},ae=t=>{if(t.color)return t.color;if(t.type&&Ye[t.type])return Ye[t.type];const r={high:"#FF4444",medium:"#FFA500",low:"#4A90E2"};return t.priority&&r[t.priority]?r[t.priority]:"#4A90E2"},Ut=t=>{const r=t.replace("#",""),y=parseInt(r.substring(0,2),16),m=parseInt(r.substring(2,4),16),S=parseInt(r.substring(4,6),16);return(.299*y+.587*m+.114*S)/255>.5?"#000000":"#FFFFFF"},he=t=>{if(t.textColor)return t.textColor;const r=ae(t);return Ut(r)},we=t=>{l&&l[D]?l[D](t):a&&a(t)},nt=t=>{c&&c[D]?c[D](t):s&&s(t)},Yt=t=>{const r=new Date;return t.toDateString()===r.toDateString()},Xt=t=>t.getMonth()===p.getMonth(),Jt=t=>{const r=new Date(t.getFullYear(),0,1),y=t.getTime()-r.getTime(),m=1e3*60*60*24*7;return Math.floor(y/m)+1};return K?e.jsx("div",{className:`${n.calendar} ${n.loading} ${$}`,style:N,children:e.jsx("div",{className:n.loadingSpinner,children:"Loading..."})}):e.jsxs("div",{className:`${n.calendar} ${le?n.compact:""} ${$}`,style:N,children:[!Z&&e.jsxs("div",{className:n.header,children:[e.jsxs("div",{className:n.navigation,children:[e.jsx("button",{onClick:Rt,className:n.navButton,"aria-label":"Previous",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("polyline",{points:"15,18 9,12 15,6"})})}),e.jsx("h3",{className:n.title,children:ue.displayTitle}),e.jsx("button",{onClick:Vt,className:n.navButton,"aria-label":"Next",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("polyline",{points:"9,6 15,12 9,18"})})})]}),ne&&ne.length>0&&e.jsxs("div",{className:n.filterBar,role:"tablist","aria-label":"Filter by category",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":te===null,className:`${n.filterPill} ${te===null?n.filterPillActive:""}`,onClick:()=>Ue(null),children:"All"}),ne.map(t=>{const r=te===t.id;return e.jsxs("button",{type:"button",role:"tab","aria-selected":r,className:`${n.filterPill} ${r?n.filterPillActive:""}`,style:r?{background:t.color,borderColor:t.color,color:"#ffffff"}:void 0,onClick:()=>Ue(t.id),children:[!r&&e.jsx("span",{className:n.filterDot,style:{background:t.color}}),t.label]},t.id)})]}),e.jsxs("div",{className:n.controls,children:[de&&de.length>0&&e.jsxs("div",{className:n.exportDropdown,ref:Ae,children:[e.jsx("button",{type:"button",className:n.exportButton,onClick:()=>Fe(t=>!t),"aria-haspopup":"menu","aria-expanded":ge,"aria-label":"Export events",title:"Export events",children:e.jsx(en,{size:16})}),ge&&e.jsx("div",{className:n.exportMenu,role:"menu",children:de.map(t=>e.jsx("button",{type:"button",role:"menuitem",className:n.exportMenuItem,onClick:()=>{Va(Ke,t),Fe(!1)},children:t.toUpperCase()},t))})]}),e.jsx("button",{onClick:Gt,className:n.todayButton,children:"Today"}),e.jsxs("div",{className:n.viewToggle,children:[e.jsx("button",{className:`${n.viewButton} ${D==="month"?n.active:""}`,onClick:()=>Ie("month"),children:"Month"}),e.jsx("button",{className:`${n.viewButton} ${D==="week"?n.active:""}`,onClick:()=>Ie("week"),children:"Week"}),e.jsx("button",{className:`${n.viewButton} ${D==="day"?n.active:""}`,onClick:()=>Ie("day"),children:"Day"})]})]})]}),D==="month"&&e.jsxs("div",{className:`${n.weekDays} ${ve?n.withWeekNumbers:""}`,children:[ve&&e.jsx("div",{className:n.weekNumberHeader,children:"Wk"}),Ot.map(t=>e.jsx("div",{className:n.weekDay,children:t},t))]}),D==="day"?(()=>{const t=We(p),r=t.filter(i=>!i.allDay&&i.time),y=t.filter(i=>i.allDay||!i.time),m=Array.from({length:Qe-L},(i,g)=>L+g),S=m.length*E,j=new Date,M=p.toDateString()===j.toDateString(),h=((j.getHours()-L)*60+j.getMinutes())/60*E,F=M&&h>=0&&h<=S,z=i=>{const[g,q]=i.split(":").map(Number);return g*60+q},Oe=i=>{if(!i.time||!i.endTime)return 30;const g=z(i.endTime)-z(i.time);return g>0?g:30},v=(i,g)=>{if(u){const q=new Date(p);q.setHours(i,g,0,0);const A=`${i.toString().padStart(2,"0")}:${g.toString().padStart(2,"0")}`;u(q,i,A)}},C=(i,g)=>{var De;if(!d)return;const q=(De=Pe.current)==null?void 0:De.querySelector(`.${n.dayTimelineGrid}`);if(!q)return;const A=q.getBoundingClientRect(),Y=g-A.top,X=I?E/2:E,W=Math.max(0,Math.floor(Y/X)),J=I?m.length*2:m.length,Q=Math.min(J-1,W),Re=L+Math.floor(I?Q/2:Q),pe=I&&Q%2===1?30:0,ke=new Date(p);ke.setHours(Re,pe,0,0),d(i,ke)};return e.jsxs("div",{className:n.dayView,children:[e.jsxs("div",{className:n.dayViewHeader,children:[e.jsx("div",{className:n.timeColumnHeader}),e.jsx("div",{className:n.dayColumnHeader,children:p.toLocaleDateString(U,{weekday:"short",day:"numeric"})})]}),y.length>0&&e.jsxs("div",{className:n.allDayStrip,children:[e.jsx("span",{className:n.allDayLabel,children:"All day"}),e.jsx("div",{className:n.allDayList,children:y.map(i=>e.jsx(ze,{event:i,color:ae(i),textColor:he(i),onComplete:f??(a?we:void 0),onEdit:_,onDelete:w,draggable:!1},i.id))})]}),e.jsx("div",{className:n.dayViewScrollContainer,ref:Pe,children:e.jsxs("div",{className:n.dayTimelineGrid,style:{height:S},children:[m.map(i=>e.jsxs("div",{className:n.hourRow,style:{height:E},children:[e.jsxs("span",{className:n.hourLabel,children:[i.toString().padStart(2,"0"),":00"]}),e.jsx("div",{className:n.hourSlots,children:I?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.halfHourSlot,onClick:()=>v(i,0)}),e.jsx("div",{className:`${n.halfHourSlot} ${n.halfHourSlotBottom}`,onClick:()=>v(i,30)})]}):e.jsx("div",{className:n.halfHourSlot,onClick:()=>v(i,0)})})]},i)),r.map(i=>{const[g,q]=i.time.split(":").map(Number),A=(g-L)*E+q/60*E,Y=Oe(i),X=Math.max(24,Y/60*E-2);return e.jsx("div",{className:n.dayEventAnchor,style:{top:A,height:X},onClick:W=>W.stopPropagation(),children:e.jsx(ze,{event:i,color:ae(i),textColor:he(i),onComplete:f??(a?we:void 0),onEdit:_,onDelete:w,onDragEnd:d?W=>C(i,W):void 0})},i.id)}),F&&e.jsx("div",{className:n.currentTimeIndicator,style:{top:`${h}px`}})]})})]})})():D==="week"?(()=>{const t=ue.days,r=Array.from({length:Qe-L},(v,C)=>L+C),y=r.length*E,m=new Date,S=t.findIndex(v=>v.toDateString()===m.toDateString()),M=((m.getHours()-L)*60+m.getMinutes())/60*E,H=S>=0&&M>=0&&M<=y,h=v=>{const[C,i]=v.split(":").map(Number);return C*60+i},F=v=>{if(!v.time||!v.endTime)return 30;const C=h(v.endTime)-h(v.time);return C>0?C:30},z=(v,C,i)=>{if(!u)return;const g=new Date(v);g.setHours(C,i,0,0);const q=`${C.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`;u(g,C,q)},Oe=(v,C,i)=>{var ot;if(!d)return;const g=(ot=Be.current)==null?void 0:ot.querySelector(`.${n.weekDayColumns}`);if(!g)return;const q=g.getBoundingClientRect(),A=i-q.left,Y=C-q.top,X=q.width/7,W=Math.min(6,Math.max(0,Math.floor(A/X))),J=t[W],Q=I?E/2:E,Re=I?r.length*2:r.length,pe=Math.min(Re-1,Math.max(0,Math.floor(Y/Q))),ke=L+Math.floor(I?pe/2:pe),De=I&&pe%2===1?30:0,at=new Date(J);at.setHours(ke,De,0,0),d(v,at)};return e.jsxs("div",{className:n.weekTimeline,children:[e.jsxs("div",{className:n.weekTimelineHeader,children:[e.jsx("div",{className:n.timeColumnHeader}),t.map(v=>{const C=v.toDateString()===m.toDateString(),i=ee&&v.toDateString()===ee.toDateString();return e.jsxs("button",{type:"button",className:`${n.weekDayColumnHeader} ${C?n.today:""} ${i?n.selected:""}`,onClick:()=>nt(v),children:[e.jsx("span",{className:n.weekDayLabel,children:v.toLocaleDateString(U,{weekday:"short"})}),e.jsx("span",{className:n.weekDayNumber,children:v.getDate()})]},v.toISOString())})]}),e.jsx("div",{className:n.weekTimelineScroll,ref:Be,children:e.jsxs("div",{className:n.weekTimelineGrid,style:{height:y},children:[e.jsx("div",{className:n.weekTimeColumn,children:r.map(v=>e.jsx("div",{className:n.weekTimeSlot,style:{height:E},children:e.jsxs("span",{className:n.weekHourLabel,children:[v.toString().padStart(2,"0"),":00"]})},v))}),e.jsx("div",{className:n.weekDayColumns,children:t.map(v=>{const C=We(v).filter(g=>!g.allDay&&g.time),i=v.toDateString()===m.toDateString();return e.jsxs("div",{className:n.weekDayColumn,children:[r.map(g=>e.jsx("div",{className:n.weekHourRow,style:{height:E},children:I?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.halfHourSlot,onClick:()=>z(v,g,0)}),e.jsx("div",{className:`${n.halfHourSlot} ${n.halfHourSlotBottom}`,onClick:()=>z(v,g,30)})]}):e.jsx("div",{className:n.halfHourSlot,onClick:()=>z(v,g,0)})},g)),C.map(g=>{const[q,A]=g.time.split(":").map(Number),Y=(q-L)*E+A/60*E,X=F(g),W=Math.max(24,X/60*E-2);return e.jsx("div",{className:n.weekEventAnchor,style:{top:Y,height:W},onClick:J=>J.stopPropagation(),children:e.jsx(ze,{event:g,color:ae(g),textColor:he(g),onComplete:f??(a?we:void 0),onEdit:_,onDelete:w,onDragEnd:d?(J,Q)=>Oe(g,J,Q):void 0})},g.id)}),i&&H&&e.jsx("div",{className:n.currentTimeIndicator,style:{top:`${M}px`,left:0}})]},v.toISOString())})})]})})]})})():(()=>{const t=le?void 0:40+G*24;return e.jsx("div",{className:`${n.daysGrid} ${ve?n.withWeekNumbers:""}`,children:ue.days.map((r,y)=>{const m=We(r),S=Yt(r),j=Xt(r),M=ve&&y%7===0,H=ee&&r.toDateString()===ee.toDateString();return e.jsxs(x.Fragment,{children:[M&&e.jsx("div",{className:n.weekNumberCell,style:t!==void 0?{height:t,minHeight:t}:void 0,children:Jt(r)}),e.jsxs($e.div,{className:`${n.dayCell} ${S?n.today:""} ${j?"":n.otherMonth} ${H?n.selected:""}`,style:t!==void 0?{height:t,minHeight:t}:void 0,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,delay:y*.02,ease:"easeOut"},onClick:()=>nt(r),children:[e.jsx("div",{className:n.dayNumber,children:r.getDate()}),m.length>0&&le&&D==="month"?e.jsxs("div",{className:n.dots,children:[m.slice(0,G).map(h=>e.jsx("span",{className:n.dot,style:{backgroundColor:ae(h)}},h.id)),m.length>G&&e.jsxs("span",{className:n.dotMore,children:["+",m.length-G]})]}):m.length>0?e.jsxs("div",{className:n.events,children:[m.slice(0,G).map((h,F)=>e.jsxs($e.div,{className:`${n.event} ${h.status==="completed"?n.completed:""}`,style:{backgroundColor:ae(h),color:he(h),opacity:h.status==="completed"?.7:1},onClick:z=>{z.stopPropagation(),we(h)},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{duration:.2,delay:F*.05,ease:"easeOut"},whileHover:{scale:1.02,y:-1,transition:{duration:.1}},whileTap:{scale:.98,transition:{duration:.1}},children:[Xe&&Xe(h),e.jsxs("span",{className:n.eventTitle,children:[h.time&&e.jsx("span",{className:n.eventTime,children:h.time}),h.title]}),h.status==="completed"&&e.jsx("svg",{className:n.completedIcon,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("polyline",{points:"20,6 9,17 4,12"})})]},h.id)),m.length>G&&e.jsxs("div",{className:n.moreEvents,children:["+",m.length-G," more"]})]}):O?e.jsx("div",{className:n.emptyState,children:O}):null]})]},`${r.getFullYear()}-${r.getMonth()}-${r.getDate()}`)})})})()]})}se.__docgenInfo={description:`Calendar component - A flexible, reusable calendar for displaying events
|
|
14
|
+
|
|
15
|
+
@component
|
|
16
|
+
@description
|
|
17
|
+
A highly customizable calendar component that can display events in month or week view.
|
|
18
|
+
Supports custom event types, colors, icons, and localization. Perfect for scheduling,
|
|
19
|
+
project management, habit tracking, or any date-based data visualization.
|
|
20
|
+
|
|
21
|
+
@example
|
|
22
|
+
// Basic usage
|
|
23
|
+
<Calendar
|
|
24
|
+
events={myEvents}
|
|
25
|
+
onEventClick={handleEventClick}
|
|
26
|
+
viewMode="month"
|
|
27
|
+
/>
|
|
28
|
+
|
|
29
|
+
@example
|
|
30
|
+
// With custom configuration
|
|
31
|
+
<Calendar
|
|
32
|
+
events={projectEvents}
|
|
33
|
+
config={{
|
|
34
|
+
eventColors: { task: '#4A90E2', meeting: '#7ED321' },
|
|
35
|
+
maxEventsPerDay: 5,
|
|
36
|
+
mondayStart: true
|
|
37
|
+
}}
|
|
38
|
+
onEventClick={handleEventClick}
|
|
39
|
+
/>`,methods:[],displayName:"Calendar",props:{events:{required:!0,tsType:{name:"Array",elements:[{name:"CalendarEvent"}],raw:"CalendarEvent[]"},description:"Array of events to display"},onEventClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(event: CalendarEvent) => void",signature:{arguments:[{type:{name:"CalendarEvent"},name:"event"}],return:{name:"void"}}},description:"Callback when an event is clicked"},onDateClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(date: Date) => void",signature:{arguments:[{type:{name:"Date"},name:"date"}],return:{name:"void"}}},description:"Callback when a date is clicked"},onEventClickByView:{required:!1,tsType:{name:"signature",type:"object",raw:`{
|
|
40
|
+
month?: (event: CalendarEvent) => void;
|
|
41
|
+
week?: (event: CalendarEvent) => void;
|
|
42
|
+
day?: (event: CalendarEvent) => void;
|
|
43
|
+
}`,signature:{properties:[{key:"month",value:{name:"signature",type:"function",raw:"(event: CalendarEvent) => void",signature:{arguments:[{type:{name:"CalendarEvent"},name:"event"}],return:{name:"void"}},required:!1}},{key:"week",value:{name:"signature",type:"function",raw:"(event: CalendarEvent) => void",signature:{arguments:[{type:{name:"CalendarEvent"},name:"event"}],return:{name:"void"}},required:!1}},{key:"day",value:{name:"signature",type:"function",raw:"(event: CalendarEvent) => void",signature:{arguments:[{type:{name:"CalendarEvent"},name:"event"}],return:{name:"void"}},required:!1}}]}},description:"View-specific event click handlers"},onDateClickByView:{required:!1,tsType:{name:"signature",type:"object",raw:`{
|
|
44
|
+
month?: (date: Date) => void;
|
|
45
|
+
week?: (date: Date) => void;
|
|
46
|
+
day?: (date: Date) => void;
|
|
47
|
+
}`,signature:{properties:[{key:"month",value:{name:"signature",type:"function",raw:"(date: Date) => void",signature:{arguments:[{type:{name:"Date"},name:"date"}],return:{name:"void"}},required:!1}},{key:"week",value:{name:"signature",type:"function",raw:"(date: Date) => void",signature:{arguments:[{type:{name:"Date"},name:"date"}],return:{name:"void"}},required:!1}},{key:"day",value:{name:"signature",type:"function",raw:"(date: Date) => void",signature:{arguments:[{type:{name:"Date"},name:"date"}],return:{name:"void"}},required:!1}}]}},description:"View-specific date click handlers"},onTimeSlotClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(date: Date, hour: number, time: string) => void",signature:{arguments:[{type:{name:"Date"},name:"date"},{type:{name:"number"},name:"hour"},{type:{name:"string"},name:"time"}],return:{name:"void"}}},description:"Callback when a time slot is clicked in day view"},onEventDrop:{required:!1,tsType:{name:"signature",type:"function",raw:"(event: CalendarEvent, newDate: Date) => void",signature:{arguments:[{type:{name:"CalendarEvent"},name:"event"},{type:{name:"Date"},name:"newDate"}],return:{name:"void"}}},description:"Callback when an event is dropped (drag-rescheduled) in day view"},onEventComplete:{required:!1,tsType:{name:"signature",type:"function",raw:"(event: CalendarEvent) => void",signature:{arguments:[{type:{name:"CalendarEvent"},name:"event"}],return:{name:"void"}}},description:"Day view: callback when an event body is tapped to toggle complete"},onEventDelete:{required:!1,tsType:{name:"signature",type:"function",raw:"(event: CalendarEvent) => void",signature:{arguments:[{type:{name:"CalendarEvent"},name:"event"}],return:{name:"void"}}},description:"Day view: callback when an event is swiped left to delete"},onEventEdit:{required:!1,tsType:{name:"signature",type:"function",raw:"(event: CalendarEvent) => void",signature:{arguments:[{type:{name:"CalendarEvent"},name:"event"}],return:{name:"void"}}},description:"Day view: callback when an event's edit button is clicked"},viewMode:{required:!1,tsType:{name:"union",raw:"'month' | 'week' | 'day'",elements:[{name:"literal",value:"'month'"},{name:"literal",value:"'week'"},{name:"literal",value:"'day'"}]},description:"Initial view mode",defaultValue:{value:"'month'",computed:!1}},initialDate:{required:!1,tsType:{name:"Date"},description:"Initial date to display",defaultValue:{value:"new Date()",computed:!1}},config:{required:!1,tsType:{name:"CalendarConfig"},description:"Configuration options",defaultValue:{value:"{}",computed:!1}},className:{required:!1,tsType:{name:"string"},description:"Custom CSS class",defaultValue:{value:"''",computed:!1}},style:{required:!1,tsType:{name:"ReactCSSProperties",raw:"React.CSSProperties"},description:"Custom styles",defaultValue:{value:"{}",computed:!1}},loading:{required:!1,tsType:{name:"boolean"},description:"Loading state",defaultValue:{value:"false",computed:!1}},emptyState:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:"Custom empty state component"},hideHeader:{required:!1,tsType:{name:"boolean"},description:"Hide the calendar header (navigation, title, view controls)",defaultValue:{value:"false",computed:!1}},compact:{required:!1,tsType:{name:"boolean"},description:"Compact mode - renders colored dots instead of event blocks in month view",defaultValue:{value:"false",computed:!1}},selectedDate:{required:!1,tsType:{name:"Date"},description:"Externally controlled selected date highlight (distinct from initialDate which controls navigation)"},selectedCategoryId:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:'Controlled category filter selection. `null` means "All". Omit for uncontrolled.'},onCategoryChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(categoryId: string | null) => void",signature:{arguments:[{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"categoryId"}],return:{name:"void"}}},description:'Called when the user picks a pill in the category filter. `null` = "All".'},exportFormats:{required:!1,tsType:{name:"Array",elements:[{name:"union",raw:"'csv' | 'json' | 'toon'",elements:[{name:"literal",value:"'csv'"},{name:"literal",value:"'json'"},{name:"literal",value:"'toon'"}]}],raw:"ExportFormat[]"},description:'Offer an "Export" dropdown in the header with the given formats. Exports the currently\nfiltered events (respects category filter). Omit or pass `[]` to hide the button.'}}};const io={title:"Organisms/Calendar",component:se,parameters:{layout:"padded"},argTypes:{viewMode:{control:"radio",options:["month","week","day"]},compact:{control:"boolean"},config:{control:"object"},onEventClick:{action:"event-clicked"},onDateClick:{action:"date-clicked"},onTimeSlotClick:{action:"slot-clicked"}}},oe=["#4A90E2","#7ED321","#BD10E0","#F5B829","#FF6B6B","#4ECDC4","#7C6FBF"],re=["Morning standup","Sprint planning","Code review","1:1 with manager","Design critique","Client demo","Deep work","Lunch with Ava","Architecture review","Release sign-off","Interview (FE)","Write weekly summary","Bug triage","Pairing session","Retro","Security debrief"],Le=["meeting","task","review","deadline"],B=(o,a=0)=>`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`,Ga=o=>{let a=o;return()=>{a|=0,a=a+1831565813|0;let s=Math.imul(a^a>>>15,1|a);return s=s+Math.imul(s^s>>>7,61|s)^s,((s^s>>>14)>>>0)/4294967296}},ie=(o=42)=>{const a=Ga(o),s=new Date,l=[];for(let c=0;c<28;c++){const u=new Date(s);u.setDate(s.getDate()+Math.floor(a()*30)-15);const d=8+Math.floor(a()*10),f=a()>.5?0:30;l.push({id:`m-${c}`,title:re[c%re.length],date:u,time:a()>.35?B(d,f):void 0,type:Le[Math.floor(a()*Le.length)],status:a()>.75?"completed":"pending",color:oe[c%oe.length],textColor:"#ffffff"})}return l},Ua=()=>{const o=new Date,a=(s,l=0)=>{const c=new Date(o);return c.setHours(s,l,0,0),c};return[{id:"ad-1",title:"Offsite — Q2 planning",date:a(0),allDay:!0,color:"#7C6FBF",textColor:"#ffffff"},{id:"d-1",title:"Morning standup",date:a(9),time:"09:00",endTime:"09:30",status:"completed",color:"#4A90E2",textColor:"#ffffff"},{id:"d-2",title:"Deep work: refactor auth",date:a(10),time:"10:00",endTime:"12:00",color:"#F5B829",textColor:"#1a1a1a"},{id:"d-3",title:"Lunch with Ava",date:a(12,30),time:"12:30",endTime:"13:30",color:"#4ECDC4",textColor:"#1a1a1a"},{id:"d-4",title:"1:1 with manager",date:a(14),time:"14:00",endTime:"14:30",color:"#BD10E0",textColor:"#ffffff"},{id:"d-5",title:"Design review",date:a(15),time:"15:00",endTime:"16:30",color:"#FF6B6B",textColor:"#ffffff"},{id:"d-6",title:"Write weekly summary",date:a(17,30),time:"17:30",endTime:"18:00",color:"#10b981",textColor:"#ffffff"}]},Ya=o=>{const a={meeting:"👥",task:"✓",review:"👀",deadline:"⏰"};return e.jsx("span",{style:{fontSize:11},children:a[o.type??""]??"📅"})},xe={args:{events:ie(),viewMode:"month",config:{mondayStart:!0,maxEventsPerDay:3,iconRenderer:Ya}},render:o=>{const[a,s]=x.useState(o.events??[]);return e.jsx(se,{...o,events:a,onEventClick:l=>{s(c=>c.map(u=>u.id===l.id?{...u,status:u.status==="completed"?"pending":"completed"}:u))},onDateClick:l=>{s(c=>[...c,{id:`new-${Date.now()}`,title:"New event",date:l,time:"15:00",type:"task",status:"pending",color:"#6366f1",textColor:"#ffffff"}])}})}},Se={args:{events:[],viewMode:"week",config:{mondayStart:!0,startHour:7,endHour:22,hourHeight:56,halfHourSlots:!0}},render:o=>{const a=new Date,s=(a.getDay()+6)%7,l=new Date(a);l.setDate(a.getDate()-s),l.setHours(0,0,0,0);const c=[];for(let f=0;f<7;f++){const w=new Date(l);w.setDate(l.getDate()+f);const _=f*2%3+1;for(let k=0;k<_;k++){const T=9+k*3+f%2;c.push({id:`w-${f}-${k}`,title:re[(f*3+k)%re.length],date:new Date(w),time:B(T,k%2===0?0:30),endTime:B(T+1,k%2===0?0:30),color:oe[(f+k)%oe.length],textColor:"#ffffff"})}}const[u,d]=x.useState(c);return e.jsx(se,{...o,events:u,onTimeSlotClick:(f,w,_)=>{const k=Math.min(23,f.getHours()+1);d(T=>[...T,{id:`new-${Date.now()}`,title:`New @ ${_}`,date:f,time:_,endTime:B(k,f.getMinutes()),color:"#6366f1",textColor:"#ffffff"}])},onEventComplete:f=>d(w=>w.map(_=>_.id===f.id?{..._,status:_.status==="completed"?"pending":"completed"}:_)),onEventDelete:f=>d(w=>w.filter(_=>_.id!==f.id)),onEventDrop:(f,w)=>{d(_=>_.map(k=>{if(k.id!==f.id)return k;const T=new Date(k.date),b=w.getTime()-T.getTime(),$=(()=>{if(!k.endTime||!k.time)return k.endTime;const[N,K]=k.endTime.split(":").map(Number),O=new Date(T);O.setHours(N,K,0,0);const Z=new Date(O.getTime()+b);return B(Z.getHours(),Z.getMinutes())})();return{...k,date:w,time:B(w.getHours(),w.getMinutes()),endTime:$}}))}})}},Ce={args:{events:[],viewMode:"day",config:{startHour:6,endHour:24,hourHeight:72,halfHourSlots:!0,mondayStart:!0}},render:o=>{const[a,s]=x.useState(Ua());return e.jsx(se,{...o,events:a,onTimeSlotClick:(l,c,u)=>{const d=Math.min(23,l.getHours()+1);s(f=>[...f,{id:`new-${Date.now()}`,title:`New @ ${u}`,date:l,time:u,endTime:B(d,l.getMinutes()),color:"#6366f1",textColor:"#ffffff"}])},onEventComplete:l=>s(c=>c.map(u=>u.id===l.id?{...u,status:u.status==="completed"?"pending":"completed"}:u)),onEventDelete:l=>s(c=>c.filter(u=>u.id!==l.id)),onEventEdit:l=>{const c=window.prompt("Rename event",l.title);c&&s(u=>u.map(d=>d.id===l.id?{...d,title:c}:d))},onEventDrop:(l,c)=>{s(u=>u.map(d=>{if(d.id!==l.id)return d;const f=new Date(d.date),w=c.getTime()-f.getTime(),_=(()=>{if(!d.endTime||!d.time)return d.endTime;const[k,T]=d.endTime.split(":").map(Number),b=new Date(f);b.setHours(k,T,0,0);const $=new Date(b.getTime()+w);return B($.getHours(),$.getMinutes())})();return{...d,date:c,time:B(c.getHours(),c.getMinutes()),endTime:_}}))}})}},Te={args:{events:ie(1).map((a,s)=>({...a,category:s%3===0?"work":s%3===1?"life":"side"})),viewMode:"month",compact:!0,config:{mondayStart:!0,maxEventsPerDay:4,categories:[{id:"life",label:"Life",color:"#F5B829"},{id:"work",label:"Work",color:"#7C6FBF"},{id:"side",label:"Side",color:"#4ECDC4"}]},style:{maxWidth:420}}},Ee={args:{events:ie(3),viewMode:"month",config:{mondayStart:!0,showWeekNumbers:!0,maxEventsPerDay:3}}},qe={args:{events:(()=>{const o=new Date;return Array.from({length:9},(a,s)=>({id:`over-${s}`,title:re[s%re.length],date:new Date(o),time:B(8+s),type:Le[s%Le.length],color:oe[s%oe.length],textColor:"#ffffff"}))})(),viewMode:"month",config:{mondayStart:!0,maxEventsPerDay:3}}},be={args:{events:[],loading:!0}},je={args:{events:[],viewMode:"month",config:{mondayStart:!0},emptyState:e.jsx("span",{style:{color:"var(--color-text-tertiary)",fontSize:11},children:"No events"})}},Ne={args:{events:ie(5),viewMode:"month",exportFormats:["csv","json","toon"],config:{mondayStart:!0,maxEventsPerDay:3}}},Me={args:{events:ie(11).map((a,s)=>({...a,category:s%3===0?"work":s%3===1?"life":"side"})),viewMode:"month",config:{mondayStart:!0,maxEventsPerDay:3,categories:[{id:"life",label:"Life",color:"#F5B829"},{id:"work",label:"Work",color:"#7C6FBF"},{id:"side",label:"Side projects",color:"#4ECDC4"}]}}},He={args:{events:[]},render:()=>{const[o,a]=x.useState(new Date),s=x.useMemo(()=>ie(9),[]);return e.jsxs("div",{style:{display:"grid",gap:"var(--spacing-md)"},children:[e.jsxs("div",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:["Selected: ",e.jsx("strong",{children:o.toLocaleDateString()})]}),e.jsx(se,{events:s,viewMode:"month",selectedDate:o,onDateClick:a,config:{mondayStart:!0,maxEventsPerDay:3}})]})}};var st,it,lt;xe.parameters={...xe.parameters,docs:{...(st=xe.parameters)==null?void 0:st.docs,source:{originalSource:`{
|
|
48
|
+
args: {
|
|
49
|
+
events: buildMonthEvents(),
|
|
50
|
+
viewMode: 'month',
|
|
51
|
+
config: {
|
|
52
|
+
mondayStart: true,
|
|
53
|
+
maxEventsPerDay: 3,
|
|
54
|
+
iconRenderer: iconForType
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
render: args => {
|
|
58
|
+
const [events, setEvents] = useState<CalendarEvent[]>(args.events ?? []);
|
|
59
|
+
return <Calendar {...args} events={events} onEventClick={e => {
|
|
60
|
+
setEvents(prev => prev.map(ev => ev.id === e.id ? {
|
|
61
|
+
...ev,
|
|
62
|
+
status: ev.status === 'completed' ? 'pending' : 'completed'
|
|
63
|
+
} : ev));
|
|
64
|
+
}} onDateClick={date => {
|
|
65
|
+
setEvents(prev => [...prev, {
|
|
66
|
+
id: \`new-\${Date.now()}\`,
|
|
67
|
+
title: 'New event',
|
|
68
|
+
date,
|
|
69
|
+
time: '15:00',
|
|
70
|
+
type: 'task',
|
|
71
|
+
status: 'pending',
|
|
72
|
+
color: '#6366f1',
|
|
73
|
+
textColor: '#ffffff'
|
|
74
|
+
}]);
|
|
75
|
+
}} />;
|
|
76
|
+
}
|
|
77
|
+
}`,...(lt=(it=xe.parameters)==null?void 0:it.docs)==null?void 0:lt.source}}};var ct,dt,mt;Se.parameters={...Se.parameters,docs:{...(ct=Se.parameters)==null?void 0:ct.docs,source:{originalSource:`{
|
|
78
|
+
args: {
|
|
79
|
+
events: [],
|
|
80
|
+
viewMode: 'week',
|
|
81
|
+
config: {
|
|
82
|
+
mondayStart: true,
|
|
83
|
+
startHour: 7,
|
|
84
|
+
endHour: 22,
|
|
85
|
+
hourHeight: 56,
|
|
86
|
+
halfHourSlots: true
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
render: args => {
|
|
90
|
+
// Build 7 days of timed events around "today" so drag has neighbours to land on
|
|
91
|
+
const today = new Date();
|
|
92
|
+
const mondayOffset = (today.getDay() + 6) % 7;
|
|
93
|
+
const weekStart = new Date(today);
|
|
94
|
+
weekStart.setDate(today.getDate() - mondayOffset);
|
|
95
|
+
weekStart.setHours(0, 0, 0, 0);
|
|
96
|
+
const initial: CalendarEvent[] = [];
|
|
97
|
+
for (let i = 0; i < 7; i++) {
|
|
98
|
+
const d = new Date(weekStart);
|
|
99
|
+
d.setDate(weekStart.getDate() + i);
|
|
100
|
+
const count = i * 2 % 3 + 1;
|
|
101
|
+
for (let j = 0; j < count; j++) {
|
|
102
|
+
const startH = 9 + j * 3 + i % 2;
|
|
103
|
+
initial.push({
|
|
104
|
+
id: \`w-\${i}-\${j}\`,
|
|
105
|
+
title: TITLES[(i * 3 + j) % TITLES.length],
|
|
106
|
+
date: new Date(d),
|
|
107
|
+
time: hhmm(startH, j % 2 === 0 ? 0 : 30),
|
|
108
|
+
endTime: hhmm(startH + 1, j % 2 === 0 ? 0 : 30),
|
|
109
|
+
color: PALETTE[(i + j) % PALETTE.length],
|
|
110
|
+
textColor: '#ffffff'
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const [events, setEvents] = useState<CalendarEvent[]>(initial);
|
|
115
|
+
return <Calendar {...args} events={events} onTimeSlotClick={(date, _h, time) => {
|
|
116
|
+
const endH = Math.min(23, date.getHours() + 1);
|
|
117
|
+
setEvents(prev => [...prev, {
|
|
118
|
+
id: \`new-\${Date.now()}\`,
|
|
119
|
+
title: \`New @ \${time}\`,
|
|
120
|
+
date,
|
|
121
|
+
time,
|
|
122
|
+
endTime: hhmm(endH, date.getMinutes()),
|
|
123
|
+
color: '#6366f1',
|
|
124
|
+
textColor: '#ffffff'
|
|
125
|
+
}]);
|
|
126
|
+
}} onEventComplete={e => setEvents(prev => prev.map(ev => ev.id === e.id ? {
|
|
127
|
+
...ev,
|
|
128
|
+
status: ev.status === 'completed' ? 'pending' : 'completed'
|
|
129
|
+
} : ev))} onEventDelete={e => setEvents(prev => prev.filter(ev => ev.id !== e.id))} onEventDrop={(e, newDate) => {
|
|
130
|
+
setEvents(prev => prev.map(ev => {
|
|
131
|
+
if (ev.id !== e.id) return ev;
|
|
132
|
+
const oldStart = new Date(ev.date);
|
|
133
|
+
const deltaMs = newDate.getTime() - oldStart.getTime();
|
|
134
|
+
const nextEndTime = (() => {
|
|
135
|
+
if (!ev.endTime || !ev.time) return ev.endTime;
|
|
136
|
+
const [oh, om] = ev.endTime.split(':').map(Number);
|
|
137
|
+
const endOld = new Date(oldStart);
|
|
138
|
+
endOld.setHours(oh, om, 0, 0);
|
|
139
|
+
const endNew = new Date(endOld.getTime() + deltaMs);
|
|
140
|
+
return hhmm(endNew.getHours(), endNew.getMinutes());
|
|
141
|
+
})();
|
|
142
|
+
return {
|
|
143
|
+
...ev,
|
|
144
|
+
date: newDate,
|
|
145
|
+
time: hhmm(newDate.getHours(), newDate.getMinutes()),
|
|
146
|
+
endTime: nextEndTime
|
|
147
|
+
};
|
|
148
|
+
}));
|
|
149
|
+
}} />;
|
|
150
|
+
}
|
|
151
|
+
}`,...(mt=(dt=Se.parameters)==null?void 0:dt.docs)==null?void 0:mt.source}}};var ut,pt,yt;Ce.parameters={...Ce.parameters,docs:{...(ut=Ce.parameters)==null?void 0:ut.docs,source:{originalSource:`{
|
|
152
|
+
args: {
|
|
153
|
+
events: [],
|
|
154
|
+
viewMode: 'day',
|
|
155
|
+
config: {
|
|
156
|
+
startHour: 6,
|
|
157
|
+
endHour: 24,
|
|
158
|
+
hourHeight: 72,
|
|
159
|
+
halfHourSlots: true,
|
|
160
|
+
mondayStart: true
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
render: args => {
|
|
164
|
+
const [events, setEvents] = useState<CalendarEvent[]>(buildDayEvents());
|
|
165
|
+
return <Calendar {...args} events={events} onTimeSlotClick={(date, _h, time) => {
|
|
166
|
+
const endH = Math.min(23, date.getHours() + 1);
|
|
167
|
+
setEvents(prev => [...prev, {
|
|
168
|
+
id: \`new-\${Date.now()}\`,
|
|
169
|
+
title: \`New @ \${time}\`,
|
|
170
|
+
date,
|
|
171
|
+
time,
|
|
172
|
+
endTime: hhmm(endH, date.getMinutes()),
|
|
173
|
+
color: '#6366f1',
|
|
174
|
+
textColor: '#ffffff'
|
|
175
|
+
}]);
|
|
176
|
+
}} onEventComplete={e => setEvents(prev => prev.map(ev => ev.id === e.id ? {
|
|
177
|
+
...ev,
|
|
178
|
+
status: ev.status === 'completed' ? 'pending' : 'completed'
|
|
179
|
+
} : ev))} onEventDelete={e => setEvents(prev => prev.filter(ev => ev.id !== e.id))} onEventEdit={e => {
|
|
180
|
+
const next = window.prompt('Rename event', e.title);
|
|
181
|
+
if (!next) return;
|
|
182
|
+
setEvents(prev => prev.map(ev => ev.id === e.id ? {
|
|
183
|
+
...ev,
|
|
184
|
+
title: next
|
|
185
|
+
} : ev));
|
|
186
|
+
}} onEventDrop={(e, newDate) => {
|
|
187
|
+
setEvents(prev => prev.map(ev => {
|
|
188
|
+
if (ev.id !== e.id) return ev;
|
|
189
|
+
const oldStart = new Date(ev.date);
|
|
190
|
+
const deltaMs = newDate.getTime() - oldStart.getTime();
|
|
191
|
+
const nextEndTime = (() => {
|
|
192
|
+
if (!ev.endTime || !ev.time) return ev.endTime;
|
|
193
|
+
const [oh, om] = ev.endTime.split(':').map(Number);
|
|
194
|
+
const endOld = new Date(oldStart);
|
|
195
|
+
endOld.setHours(oh, om, 0, 0);
|
|
196
|
+
const endNew = new Date(endOld.getTime() + deltaMs);
|
|
197
|
+
return hhmm(endNew.getHours(), endNew.getMinutes());
|
|
198
|
+
})();
|
|
199
|
+
return {
|
|
200
|
+
...ev,
|
|
201
|
+
date: newDate,
|
|
202
|
+
time: hhmm(newDate.getHours(), newDate.getMinutes()),
|
|
203
|
+
endTime: nextEndTime
|
|
204
|
+
};
|
|
205
|
+
}));
|
|
206
|
+
}} />;
|
|
207
|
+
}
|
|
208
|
+
}`,...(yt=(pt=Ce.parameters)==null?void 0:pt.docs)==null?void 0:yt.source}}};var gt,vt,ft;Te.parameters={...Te.parameters,docs:{...(gt=Te.parameters)==null?void 0:gt.docs,source:{originalSource:`{
|
|
209
|
+
args: {
|
|
210
|
+
events: (() => {
|
|
211
|
+
const base = buildMonthEvents(1);
|
|
212
|
+
return base.map((e, i) => ({
|
|
213
|
+
...e,
|
|
214
|
+
category: i % 3 === 0 ? 'work' : i % 3 === 1 ? 'life' : 'side'
|
|
215
|
+
}));
|
|
216
|
+
})(),
|
|
217
|
+
viewMode: 'month',
|
|
218
|
+
compact: true,
|
|
219
|
+
config: {
|
|
220
|
+
mondayStart: true,
|
|
221
|
+
maxEventsPerDay: 4,
|
|
222
|
+
categories: [{
|
|
223
|
+
id: 'life',
|
|
224
|
+
label: 'Life',
|
|
225
|
+
color: '#F5B829'
|
|
226
|
+
}, {
|
|
227
|
+
id: 'work',
|
|
228
|
+
label: 'Work',
|
|
229
|
+
color: '#7C6FBF'
|
|
230
|
+
}, {
|
|
231
|
+
id: 'side',
|
|
232
|
+
label: 'Side',
|
|
233
|
+
color: '#4ECDC4'
|
|
234
|
+
}]
|
|
235
|
+
},
|
|
236
|
+
style: {
|
|
237
|
+
maxWidth: 420
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}`,...(ft=(vt=Te.parameters)==null?void 0:vt.docs)==null?void 0:ft.source}}};var ht,wt,kt;Ee.parameters={...Ee.parameters,docs:{...(ht=Ee.parameters)==null?void 0:ht.docs,source:{originalSource:`{
|
|
241
|
+
args: {
|
|
242
|
+
events: buildMonthEvents(3),
|
|
243
|
+
viewMode: 'month',
|
|
244
|
+
config: {
|
|
245
|
+
mondayStart: true,
|
|
246
|
+
showWeekNumbers: true,
|
|
247
|
+
maxEventsPerDay: 3
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}`,...(kt=(wt=Ee.parameters)==null?void 0:wt.docs)==null?void 0:kt.source}}};var Dt,_t,xt;qe.parameters={...qe.parameters,docs:{...(Dt=qe.parameters)==null?void 0:Dt.docs,source:{originalSource:`{
|
|
251
|
+
args: {
|
|
252
|
+
events: (() => {
|
|
253
|
+
const today = new Date();
|
|
254
|
+
return Array.from({
|
|
255
|
+
length: 9
|
|
256
|
+
}, (_, i) => ({
|
|
257
|
+
id: \`over-\${i}\`,
|
|
258
|
+
title: TITLES[i % TITLES.length],
|
|
259
|
+
date: new Date(today),
|
|
260
|
+
time: hhmm(8 + i),
|
|
261
|
+
type: TYPES[i % TYPES.length],
|
|
262
|
+
color: PALETTE[i % PALETTE.length],
|
|
263
|
+
textColor: '#ffffff'
|
|
264
|
+
}));
|
|
265
|
+
})(),
|
|
266
|
+
viewMode: 'month',
|
|
267
|
+
config: {
|
|
268
|
+
mondayStart: true,
|
|
269
|
+
maxEventsPerDay: 3
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}`,...(xt=(_t=qe.parameters)==null?void 0:_t.docs)==null?void 0:xt.source}}};var St,Ct,Tt;be.parameters={...be.parameters,docs:{...(St=be.parameters)==null?void 0:St.docs,source:{originalSource:`{
|
|
273
|
+
args: {
|
|
274
|
+
events: [],
|
|
275
|
+
loading: true
|
|
276
|
+
}
|
|
277
|
+
}`,...(Tt=(Ct=be.parameters)==null?void 0:Ct.docs)==null?void 0:Tt.source}}};var Et,qt,bt;je.parameters={...je.parameters,docs:{...(Et=je.parameters)==null?void 0:Et.docs,source:{originalSource:`{
|
|
278
|
+
args: {
|
|
279
|
+
events: [],
|
|
280
|
+
viewMode: 'month',
|
|
281
|
+
config: {
|
|
282
|
+
mondayStart: true
|
|
283
|
+
},
|
|
284
|
+
emptyState: <span style={{
|
|
285
|
+
color: 'var(--color-text-tertiary)',
|
|
286
|
+
fontSize: 11
|
|
287
|
+
}}>
|
|
288
|
+
No events
|
|
289
|
+
</span>
|
|
290
|
+
}
|
|
291
|
+
}`,...(bt=(qt=je.parameters)==null?void 0:qt.docs)==null?void 0:bt.source}}};var jt,Nt,Mt;Ne.parameters={...Ne.parameters,docs:{...(jt=Ne.parameters)==null?void 0:jt.docs,source:{originalSource:`{
|
|
292
|
+
args: {
|
|
293
|
+
events: buildMonthEvents(5),
|
|
294
|
+
viewMode: 'month',
|
|
295
|
+
exportFormats: ['csv', 'json', 'toon'],
|
|
296
|
+
config: {
|
|
297
|
+
mondayStart: true,
|
|
298
|
+
maxEventsPerDay: 3
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}`,...(Mt=(Nt=Ne.parameters)==null?void 0:Nt.docs)==null?void 0:Mt.source}}};var Ht,zt,$t;Me.parameters={...Me.parameters,docs:{...(Ht=Me.parameters)==null?void 0:Ht.docs,source:{originalSource:`{
|
|
302
|
+
args: {
|
|
303
|
+
events: (() => {
|
|
304
|
+
const base = buildMonthEvents(11);
|
|
305
|
+
return base.map((e, i) => ({
|
|
306
|
+
...e,
|
|
307
|
+
category: i % 3 === 0 ? 'work' : i % 3 === 1 ? 'life' : 'side'
|
|
308
|
+
}));
|
|
309
|
+
})(),
|
|
310
|
+
viewMode: 'month',
|
|
311
|
+
config: {
|
|
312
|
+
mondayStart: true,
|
|
313
|
+
maxEventsPerDay: 3,
|
|
314
|
+
categories: [{
|
|
315
|
+
id: 'life',
|
|
316
|
+
label: 'Life',
|
|
317
|
+
color: '#F5B829'
|
|
318
|
+
}, {
|
|
319
|
+
id: 'work',
|
|
320
|
+
label: 'Work',
|
|
321
|
+
color: '#7C6FBF'
|
|
322
|
+
}, {
|
|
323
|
+
id: 'side',
|
|
324
|
+
label: 'Side projects',
|
|
325
|
+
color: '#4ECDC4'
|
|
326
|
+
}]
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}`,...($t=(zt=Me.parameters)==null?void 0:zt.docs)==null?void 0:$t.source}}};var Lt,It,Pt;He.parameters={...He.parameters,docs:{...(Lt=He.parameters)==null?void 0:Lt.docs,source:{originalSource:`{
|
|
330
|
+
args: {
|
|
331
|
+
events: []
|
|
332
|
+
},
|
|
333
|
+
render: () => {
|
|
334
|
+
const [selected, setSelected] = useState(new Date());
|
|
335
|
+
const events = useMemo(() => buildMonthEvents(9), []);
|
|
336
|
+
return <div style={{
|
|
337
|
+
display: 'grid',
|
|
338
|
+
gap: 'var(--spacing-md)'
|
|
339
|
+
}}>
|
|
340
|
+
<div style={{
|
|
341
|
+
fontSize: 'var(--font-size-sm)',
|
|
342
|
+
color: 'var(--color-text-secondary)'
|
|
343
|
+
}}>
|
|
344
|
+
Selected: <strong>{selected.toLocaleDateString()}</strong>
|
|
345
|
+
</div>
|
|
346
|
+
<Calendar events={events} viewMode="month" selectedDate={selected} onDateClick={setSelected} config={{
|
|
347
|
+
mondayStart: true,
|
|
348
|
+
maxEventsPerDay: 3
|
|
349
|
+
}} />
|
|
350
|
+
</div>;
|
|
351
|
+
}
|
|
352
|
+
}`,...(Pt=(It=He.parameters)==null?void 0:It.docs)==null?void 0:Pt.source}}};const lo=["Default","WeekView","DayView","CompactMonth","WithWeekNumbers","OverflowDay","Loading","Empty","WithExport","WithCategoryFilter","ControlledSelection"];export{Te as CompactMonth,He as ControlledSelection,Ce as DayView,xe as Default,je as Empty,be as Loading,qe as OverflowDay,Se as WeekView,Me as WithCategoryFilter,Ne as WithExport,Ee as WithWeekNumbers,lo as __namedExportsOrder,io as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as I,j as e}from"./iframe-
|
|
1
|
+
import{r as I,j as e}from"./iframe-DCkPNH_h.js";import{A as M}from"./index-BTVArzym.js";import{m as _}from"./proxy-cgPyYfyG.js";const B="_card_k0xft_1",V="_hoverable_k0xft_50",A="_elevated_k0xft_65",L="_outlined_k0xft_78",S="_flat_k0xft_111",E="_glass_k0xft_156",W="_imageContainer_k0xft_187",F="_image_k0xft_187",H="_header_k0xft_233",R="_headerContent_k0xft_248",O="_expandButton_k0xft_254",D="_expandIcon_k0xft_285",J="_expandableContent_k0xft_289",U="_expandable_k0xft_289",X="_body_k0xft_313",z="_footer_k0xft_319",G="_title_k0xft_350",K="_subtitle_k0xft_366",Q="_clickable_k0xft_380",Y="_padding_k0xft_394",Z="_noPadding_k0xft_398",$="_loading_k0xft_403",ee="_loadingShimmer_k0xft_1",ae="_loadingPulse_k0xft_1",a={card:B,hoverable:V,elevated:A,outlined:L,flat:S,glass:E,imageContainer:W,image:F,header:H,headerContent:R,expandButton:O,expandIcon:D,expandableContent:J,expandable:U,body:X,footer:z,title:G,subtitle:K,clickable:Q,padding:Y,noPadding:Z,loading:$,loadingShimmer:ee,loadingPulse:ae},te=({variant:g="elevated",hoverable:d=!1,clickable:l=!1,padding:c=!0,image:p,imageAlt:v="",title:o,subtitle:s,header:u,footer:m,children:f,expandable:t=!1,defaultExpanded:C=!1,expanded:i,onExpandChange:r,className:b="",onClick:k,motionProps:y,...j})=>{const[T,N]=I.useState(C),n=i!==void 0?i:T,h=()=>{const x=!n;i===void 0&&N(x),r==null||r(x)},q=[a.card,a[g],d&&a.hoverable,l&&a.clickable,!c&&a.noPadding,t&&a.expandable,b].filter(Boolean).join(" "),w=()=>u?e.jsxs("div",{className:a.header,children:[e.jsx("div",{className:a.headerContent,children:u}),t&&e.jsx("button",{className:a.expandButton,onClick:h,"aria-label":n?"Collapse card":"Expand card",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:a.expandIcon,style:{transform:n?"rotate(180deg)":"rotate(0deg)"},children:e.jsx("path",{d:"M6 9l6 6 6-6"})})})]}):o||s?e.jsxs("div",{className:a.header,children:[e.jsxs("div",{className:a.headerContent,children:[o&&e.jsx("h3",{className:a.title,children:o}),s&&e.jsx("p",{className:a.subtitle,children:s})]}),t&&e.jsx("button",{className:a.expandButton,onClick:h,"aria-label":n?"Collapse card":"Expand card",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:a.expandIcon,style:{transform:n?"rotate(180deg)":"rotate(0deg)"},children:e.jsx("path",{d:"M6 9l6 6 6-6"})})})]}):null,P=e.jsxs(e.Fragment,{children:[p&&e.jsx("div",{className:a.imageContainer,children:e.jsx("img",{src:p,alt:v,className:a.image})}),w(),e.jsx(M,{initial:!1,children:(!t||n)&&e.jsxs(_.div,{initial:t?{height:0,opacity:0}:void 0,animate:t?{height:"auto",opacity:1}:void 0,exit:t?{height:0,opacity:0}:void 0,transition:{duration:.3,ease:"easeInOut"},className:a.expandableContent,children:[f&&e.jsx("div",{className:c?a.body:void 0,children:f}),m&&e.jsx("div",{className:a.footer,children:m})]},"content")})]});return e.jsx(_.div,{className:q,onClick:l?k:void 0,whileHover:d?{y:-4}:void 0,transition:{type:"spring",stiffness:400,damping:17},...y,...j,children:P})};te.__docgenInfo={description:`Card Component
|
|
2
2
|
|
|
3
3
|
@component
|
|
4
4
|
@description
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as T}from"./iframe-
|
|
1
|
+
import{j as e,r as T}from"./iframe-DCkPNH_h.js";import{C as a}from"./Card-BNN9rA1_.js";import{B as t}from"./Button-CmL8YExH.js";import"./preload-helper-C1FmrZbK.js";import"./index-BTVArzym.js";import"./proxy-cgPyYfyG.js";import"./MotionConfigContext-CJ0kpWbz.js";import"./useSound-Cv_O9Yec.js";const D={title:"Atoms/Card",component:a,parameters:{layout:"centered",docs:{description:{component:"A flexible container component with various styling options and animation support."}}},argTypes:{variant:{control:"select",options:["elevated","outlined","flat","glass"],description:"Visual style variant of the card"},padding:{control:"boolean"},hoverable:{control:"boolean"},clickable:{control:"boolean"},expandable:{control:"boolean"},defaultExpanded:{control:"boolean"},title:{control:"text"},subtitle:{control:"text"},onClick:{action:"clicked"},onExpandChange:{action:"expand-changed"}}},r={args:{title:"Card Title",subtitle:"Optional subtitle",hoverable:!0,children:e.jsx("p",{children:"Card content goes here. Use controls to switch between elevated, outlined, flat, and glass variants."})}},n={args:{variant:"elevated",hoverable:!0,image:"https://via.placeholder.com/350x200",imageAlt:"Feature image",children:e.jsxs("div",{style:{maxWidth:"350px"},children:[e.jsx("h2",{style:{marginBottom:"0.5rem"},children:"Feature Card"}),e.jsx("p",{style:{marginBottom:"1rem",color:"#666"},children:"Image, title, description, and action buttons composed together."}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem"},children:[e.jsx(t,{variant:"primary",size:"small",children:"Learn More"}),e.jsx(t,{variant:"outline",size:"small",children:"Share"})]})]})}},l={render:()=>e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"1rem",maxWidth:"800px"},children:[e.jsxs(a,{variant:"elevated",hoverable:!0,children:[e.jsx("h4",{children:"Elevated"}),e.jsx("p",{children:"With shadow"})]}),e.jsxs(a,{variant:"outlined",hoverable:!0,children:[e.jsx("h4",{children:"Outlined"}),e.jsx("p",{children:"With border"})]}),e.jsxs(a,{variant:"glass",hoverable:!0,children:[e.jsx("h4",{children:"Glass"}),e.jsx("p",{children:"Glassmorphism"})]})]}),parameters:{controls:{disable:!0},layout:"padded"}},s={args:{title:"Expandable Card",subtitle:"Click the arrow to expand",expandable:!0,variant:"outlined",children:e.jsxs("div",{children:[e.jsx("p",{children:"This content is collapsible. Useful for FAQ sections, settings panels, or progressive disclosure."}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"1rem"},children:[e.jsx(t,{variant:"primary",size:"small",children:"Action"}),e.jsx(t,{variant:"outline",size:"small",children:"Secondary"})]})]})}},i={render:()=>{const[d,p]=T.useState(!1);return e.jsxs("div",{style:{width:"400px"},children:[e.jsxs(a,{title:"Controlled Expandable",subtitle:"State managed externally",expandable:!0,expanded:d,onExpandChange:p,variant:"glass",hoverable:!0,children:[e.jsx("p",{children:"Expanded state is controlled via props."}),e.jsxs("p",{children:["Current: ",e.jsx("strong",{children:d?"Expanded":"Collapsed"})]})]}),e.jsx("div",{style:{marginTop:"1rem",textAlign:"center"},children:e.jsx(t,{variant:"primary",onClick:()=>p(!d),children:"External Toggle"})})]})},parameters:{controls:{disable:!0}}},o={render:()=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",maxWidth:"600px"},children:[e.jsx(a,{title:"Getting Started",expandable:!0,variant:"outlined",children:e.jsx("p",{children:"Create an account and follow the onboarding tutorial to get started."})}),e.jsx(a,{title:"Account Management",expandable:!0,variant:"outlined",children:e.jsx("p",{children:"Manage settings from the profile page: personal info, password, notifications."})}),e.jsx(a,{title:"Billing & Payments",expandable:!0,defaultExpanded:!0,variant:"outlined",children:e.jsx("p",{children:"We accept all major credit cards and PayPal. Billing is monthly or annual."})})]}),parameters:{controls:{disable:!0},layout:"padded"}};var c,m,u;r.parameters={...r.parameters,docs:{...(c=r.parameters)==null?void 0:c.docs,source:{originalSource:`{
|
|
2
2
|
args: {
|
|
3
3
|
title: 'Card Title',
|
|
4
4
|
subtitle: 'Optional subtitle',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o,j as t}from"./iframe-
|
|
1
|
+
import{r as o,j as t}from"./iframe-DCkPNH_h.js";import{g as u}from"./index-C8pce-KX.js";import{G as M}from"./iconBase-DxMTUG9N.js";import"./preload-helper-C1FmrZbK.js";function U(f){return M({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.25 15.5a.75.75 0 0 1-.75-.75V7.56L7.28 17.78a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L16.44 6.5H9.25a.75.75 0 0 1 0-1.5h9a.75.75 0 0 1 .75.75v9a.75.75 0 0 1-.75.75Z"},child:[]}]})(f)}const G="_open_87iwp_63",O="_logo_87iwp_71",n={"card-nav-container":"_card-nav-container_87iwp_1","card-nav":"_card-nav_87iwp_1","card-nav-top":"_card-nav-top_87iwp_25","hamburger-menu":"_hamburger-menu_87iwp_38","hamburger-line":"_hamburger-line_87iwp_48",open:G,"logo-container":"_logo-container_87iwp_71",logo:O,"card-nav-cta-button":"_card-nav-cta-button_87iwp_84","card-nav-content":"_card-nav-content_87iwp_101","nav-card":"_nav-card_87iwp_121","nav-card-label":"_nav-card-label_87iwp_134","nav-card-links":"_nav-card-links_87iwp_140","nav-card-link":"_nav-card-link_87iwp_140"},L=({logo:f,logoAlt:$="Logo",items:m,className:N="",ease:b="power3.out",baseColor:k="#fff",menuColor:R,buttonBgColor:j,buttonTextColor:E})=>{const[A,g]=o.useState(!1),[s,_]=o.useState(!1),c=o.useRef(null),p=o.useRef([]),l=o.useRef(null),C=()=>{const e=c.current;if(!e)return 260;if(window.matchMedia("(max-width: 768px)").matches){const a=e.querySelector(".card-nav-content");if(a){const i=a.style.visibility,v=a.style.pointerEvents,S=a.style.position,T=a.style.height;a.style.visibility="visible",a.style.pointerEvents="auto",a.style.position="static",a.style.height="auto",a.offsetHeight;const V=60,q=16,I=a.scrollHeight;return a.style.visibility=i,a.style.pointerEvents=v,a.style.position=S,a.style.height=T,V+I+q}}return 260},h=()=>{const e=c.current;if(!e)return null;u.set(e,{height:60,overflow:"hidden"}),u.set(p.current,{y:50,opacity:0});const r=u.timeline({paused:!0});return r.to(e,{height:C,duration:.4,ease:b}),r.to(p.current,{y:0,opacity:1,duration:.4,ease:b,stagger:.08},"-=0.1"),r};o.useLayoutEffect(()=>{const e=h();return l.current=e,()=>{e==null||e.kill(),l.current=null}},[b,m]),o.useLayoutEffect(()=>{const e=()=>{if(l.current)if(s){const r=C();u.set(c.current,{height:r}),l.current.kill();const a=h();a&&(a.progress(1),l.current=a)}else{l.current.kill();const r=h();r&&(l.current=r)}};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[s]);const D=()=>{const e=l.current;e&&(s?(g(!1),e.eventCallback("onReverseComplete",()=>_(!1)),e.reverse()):(g(!0),_(!0),e.play(0)))},H=e=>r=>{r&&(p.current[e]=r)};return t.jsx("div",{className:`${n["card-nav-container"]} ${N}`,children:t.jsxs("nav",{ref:c,className:`${n["card-nav"]} ${s?n.open:""}`,style:{backgroundColor:k},children:[t.jsxs("div",{className:`${n["card-nav-top"]}`,children:[t.jsxs("div",{className:`${n["hamburger-menu"]} ${A?n.open:""}`,onClick:D,role:"button","aria-label":s?"Close menu":"Open menu",tabIndex:0,style:{color:R||"#000"},children:[t.jsx("div",{className:`${n["hamburger-line"]}`}),t.jsx("div",{className:`${n["hamburger-line"]}`})]}),t.jsx("div",{className:`${n["logo-container"]}`,children:t.jsx("img",{src:f,alt:$,className:`${n.logo}`})}),t.jsx("button",{type:"button",className:`${n["card-nav-cta-button"]}`,style:{backgroundColor:j,color:E},children:"Get Started"})]}),t.jsx("div",{className:`${n["card-nav-content"]}`,"aria-hidden":!s,children:(m||[]).slice(0,3).map((e,r)=>{var a;return t.jsxs("div",{className:`${n["nav-card"]}`,ref:H(r),style:{backgroundColor:e.bgColor,color:e.textColor},children:[t.jsx("div",{className:`${n["nav-card-label"]}`,children:e.label}),t.jsx("div",{className:`${n["nav-card-links"]}`,children:(a=e.links)==null?void 0:a.map((i,v)=>t.jsxs("a",{className:`${n["nav-card-link"]}`,href:i.href,"aria-label":i.ariaLabel,children:[t.jsx(U,{className:"nav-card-link-icon","aria-hidden":"true"}),i.label]},`${i.label}-${v}`))})]},`${e.label}-${r}`)})})]})})};L.__docgenInfo={description:"",methods:[],displayName:"CardNav",props:{logoAlt:{defaultValue:{value:"'Logo'",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},ease:{defaultValue:{value:"'power3.out'",computed:!1},required:!1},baseColor:{defaultValue:{value:"'#fff'",computed:!1},required:!1}}};const Z={title:"ReactBits/Components/CardNav",component:L,parameters:{layout:"fullscreen"}},d={args:{logoAlt:"Logo",items:[{label:"Products",bgColor:"#1a1a2e",textColor:"#fff",links:[{label:"Analytics",href:"#",ariaLabel:"Analytics"},{label:"Dashboard",href:"#",ariaLabel:"Dashboard"},{label:"Reports",href:"#",ariaLabel:"Reports"}]},{label:"Resources",bgColor:"#16213e",textColor:"#fff",links:[{label:"Documentation",href:"#",ariaLabel:"Documentation"},{label:"Tutorials",href:"#",ariaLabel:"Tutorials"}]},{label:"Company",bgColor:"#0f3460",textColor:"#fff",links:[{label:"About Us",href:"#",ariaLabel:"About Us"},{label:"Careers",href:"#",ariaLabel:"Careers"},{label:"Contact",href:"#",ariaLabel:"Contact"}]}],ease:"power3.out",baseColor:"#fff"}};var y,w,x;d.parameters={...d.parameters,docs:{...(y=d.parameters)==null?void 0:y.docs,source:{originalSource:`{
|
|
2
2
|
args: {
|
|
3
3
|
logoAlt: 'Logo',
|
|
4
4
|
items: [{
|
package/storybook-static/assets/{Carousel.stories-ChBLLqBg.js → Carousel.stories-Cl5XZxQx.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as c,j as i}from"./iframe-
|
|
1
|
+
import{r as c,j as i}from"./iframe-DCkPNH_h.js";import{G as v}from"./iconBase-DxMTUG9N.js";import{u as Y}from"./use-motion-value-Ud8-h3gV.js";import{m as k}from"./proxy-cgPyYfyG.js";import{u as z}from"./use-transform-8mNuLPFu.js";import"./preload-helper-C1FmrZbK.js";import"./MotionConfigContext-CJ0kpWbz.js";function K(e){return v({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"},child:[]},{tag:"line",attr:{x1:"3",y1:"9",x2:"21",y2:"9"},child:[]},{tag:"line",attr:{x1:"9",y1:"21",x2:"9",y2:"9"},child:[]}]})(e)}function Q(e){return v({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"12 2 2 7 12 12 22 7 12 2"},child:[]},{tag:"polyline",attr:{points:"2 17 12 22 22 17"},child:[]},{tag:"polyline",attr:{points:"2 12 12 17 22 12"},child:[]}]})(e)}function X(e){return v({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"},child:[]},{tag:"polyline",attr:{points:"14 2 14 8 20 8"},child:[]},{tag:"line",attr:{x1:"16",y1:"13",x2:"8",y2:"13"},child:[]},{tag:"line",attr:{x1:"16",y1:"17",x2:"8",y2:"17"},child:[]},{tag:"polyline",attr:{points:"10 9 9 9 8 9"},child:[]}]})(e)}function Z(e){return v({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"16 18 22 12 16 6"},child:[]},{tag:"polyline",attr:{points:"8 6 2 12 8 18"},child:[]}]})(e)}function ee(e){return v({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]}]})(e)}const te="_round_14jni_33",ne="_active_14jni_60",oe="_inactive_14jni_64",n={"carousel-container":"_carousel-container_14jni_1","carousel-track":"_carousel-track_14jni_11","carousel-item":"_carousel-item_14jni_15",round:te,"carousel-item-header":"_carousel-item-header_14jni_47","carousel-indicators-container":"_carousel-indicators-container_14jni_52","carousel-indicator":"_carousel-indicator_14jni_52",active:ne,inactive:oe,"carousel-icon-container":"_carousel-icon-container_14jni_74","carousel-icon":"_carousel-icon_14jni_74","carousel-item-content":"_carousel-item-content_14jni_90","carousel-item-title":"_carousel-item-title_14jni_95","carousel-item-description":"_carousel-item-description_14jni_102","carousel-indicators":"_carousel-indicators_14jni_52"},ie=[{title:"Text Animations",description:"Cool text animations for your projects.",id:1,icon:i.jsx(X,{className:`${n["carousel-icon"]}`})},{title:"Animations",description:"Smooth animations for your projects.",id:2,icon:i.jsx(ee,{className:`${n["carousel-icon"]}`})},{title:"Components",description:"Reusable components for your projects.",id:3,icon:i.jsx(Q,{className:`${n["carousel-icon"]}`})},{title:"Backgrounds",description:"Beautiful backgrounds and patterns for your projects.",id:4,icon:i.jsx(K,{className:`${n["carousel-icon"]}`})},{title:"Common UI",description:"Common UI components are coming soon!",id:5,icon:i.jsx(Z,{className:`${n["carousel-icon"]}`})}],S=0,B=500,T=16,se={type:"spring",stiffness:300,damping:30};function ae({item:e,index:l,itemWidth:g,round:m,trackItemOffset:u,x:s,transition:f}){const N=[-(l+1)*u,-l*u,-(l-1)*u],r=z(s,N,[90,0,-90],{clamp:!1});return i.jsxs(k.div,{className:`${n["carousel-item"]} ${m?n.round:""}`,style:{width:g,height:m?g:"100%",rotateY:r,...m&&{borderRadius:"50%"}},transition:f,children:[i.jsx("div",{className:`${n["carousel-item-header"]} ${m?n.round:""}`,children:i.jsx("span",{className:`${n["carousel-icon-container"]}`,children:e.icon})}),i.jsxs("div",{className:`${n["carousel-item-content"]}`,children:[i.jsx("div",{className:`${n["carousel-item-title"]}`,children:e.title}),i.jsx("p",{className:`${n["carousel-item-description"]}`,children:e.description})]})]},`${(e==null?void 0:e.id)??l}-${l}`)}function V({items:e=ie,baseWidth:l=300,autoplay:g=!1,autoplayDelay:m=3e3,pauseOnHover:u=!1,loop:s=!1,round:f=!1}){const x=l-32,r=x+T,a=c.useMemo(()=>s?e.length===0?[]:[e[e.length-1],...e,e[0]]:e,[e,s]),[d,p]=c.useState(s?1:0),h=Y(0),[L,A]=c.useState(!1),[q,j]=c.useState(!1),[w,_]=c.useState(!1),C=c.useRef(null);c.useEffect(()=>{if(u&&C.current){const o=C.current,t=()=>A(!0),y=()=>A(!1);return o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",y),()=>{o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",y)}}},[u]),c.useEffect(()=>{if(!g||a.length<=1||u&&L)return;const o=setInterval(()=>{p(t=>Math.min(t+1,a.length-1))},m);return()=>clearInterval(o)},[g,m,L,u,a.length]),c.useEffect(()=>{const o=s?1:0;p(o),h.set(-o*r)},[e.length,s,r,h]),c.useEffect(()=>{!s&&d>a.length-1&&p(Math.max(0,a.length-1))},[a.length,s,d]);const E=q?{duration:0}:se,P=()=>{_(!0)},U=()=>{if(!s||a.length<=1){_(!1);return}const o=a.length-1;if(d===o){j(!0);const t=1;p(t),h.set(-t*r),requestAnimationFrame(()=>{j(!1),_(!1)});return}if(d===0){j(!0);const t=e.length;p(t),h.set(-t*r),requestAnimationFrame(()=>{j(!1),_(!1)});return}_(!1)},W=(o,t)=>{const{offset:y,velocity:I}=t,R=y.x<-S||I.x<-B?1:y.x>S||I.x>B?-1:0;R!==0&&p(H=>{const O=H+R,J=a.length-1;return Math.max(0,Math.min(O,J))})},G=s?{}:{dragConstraints:{left:-r*Math.max(a.length-1,0),right:0}},F=e.length===0?0:s?(d-1+e.length)%e.length:Math.min(d,e.length-1);return i.jsxs("div",{ref:C,className:`${n["carousel-container"]} ${f?n.round:""}`,style:{width:`${l}px`,...f&&{height:`${l}px`,borderRadius:"50%"}},children:[i.jsx(k.div,{className:`${n["carousel-track"]}`,drag:w?!1:"x",...G,style:{width:x,gap:`${T}px`,perspective:1e3,perspectiveOrigin:`${d*r+x/2}px 50%`,x:h},onDragEnd:W,animate:{x:-(d*r)},transition:E,onAnimationStart:P,onAnimationComplete:U,children:a.map((o,t)=>i.jsx(ae,{item:o,index:t,itemWidth:x,round:f,trackItemOffset:r,x:h,transition:E},`${(o==null?void 0:o.id)??t}-${t}`))}),i.jsx("div",{className:`${n["carousel-indicators-container"]} ${f?n.round:""}`,children:i.jsx("div",{className:`${n["carousel-indicators"]}`,children:e.map((o,t)=>i.jsx(k.div,{className:`${n["carousel-indicator"]} ${F===t?n.active:n.inactive}`,animate:{scale:F===t?1.2:1},onClick:()=>p(s?t+1:t),transition:{duration:.15}},t))})})]})}V.__docgenInfo={description:"",methods:[],displayName:"Carousel",props:{items:{defaultValue:{value:`[
|
|
2
2
|
{
|
|
3
3
|
title: 'Text Animations',
|
|
4
4
|
description: 'Cool text animations for your projects.',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,j as a}from"./iframe-
|
|
1
|
+
import{r as i,j as a}from"./iframe-DCkPNH_h.js";import{u as k}from"./useSound-Cv_O9Yec.js";const x="_checkboxLabel_kh8g9_1",f="_checkbox_kh8g9_1",g="_checkboxText_kh8g9_92",c={checkboxLabel:x,checkbox:f,checkboxText:g},C=({checked:o,onChange:r,label:s,disabled:h=!1,indeterminate:n=!1,id:l,name:d,value:b,soundConfig:e})=>{const t=i.useRef(null),{playSound:u}=k(e);return i.useEffect(()=>{t.current&&(t.current.indeterminate=n)},[n]),a.jsxs("label",{className:c.checkboxLabel,children:[a.jsx("input",{ref:t,type:"checkbox",checked:o,onChange:m=>{const p=m.target.checked;r(p),(e==null?void 0:e.onClick)!==!1&&u("toggle")},className:c.checkbox,disabled:h,id:l,name:d,value:b,"aria-checked":n?"mixed":o}),s&&a.jsx("span",{className:c.checkboxText,children:s})]})};C.__docgenInfo={description:`Checkbox component - Modern interactive checkbox with animations
|
|
2
2
|
|
|
3
3
|
@component
|
|
4
4
|
@description
|
package/storybook-static/assets/{Checkbox.stories-Co7IxmK1.js → Checkbox.stories-DEt8_02c.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as g,j as t}from"./iframe-
|
|
1
|
+
import{r as g,j as t}from"./iframe-DCkPNH_h.js";import{C as s}from"./Checkbox-NV1yLfww.js";import"./preload-helper-C1FmrZbK.js";import"./useSound-Cv_O9Yec.js";const E={title:"Atoms/Checkbox",component:s,parameters:{layout:"centered",docs:{description:{component:"A simple checkbox component with optional label."}}},tags:["autodocs"],argTypes:{checked:{control:"boolean"},label:{control:"text"},disabled:{control:"boolean"},onChange:{action:"changed"}}},n={args:{checked:!1,label:"Accept terms and conditions",onChange:()=>{}}},c={args:{checked:!1,label:"This option is disabled",disabled:!0,onChange:()=>{}}},i={args:{checked:!1,label:"Multiple checkboxes example",onChange:()=>{}},render:()=>{const[e,a]=g.useState({option1:!1,option2:!0,option3:!1,option4:!1});return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:[t.jsx(s,{checked:e.option1,onChange:o=>a({...e,option1:o}),label:"Enable notifications"}),t.jsx(s,{checked:e.option2,onChange:o=>a({...e,option2:o}),label:"Receive marketing emails"}),t.jsx(s,{checked:e.option3,onChange:o=>a({...e,option3:o}),label:"Share usage statistics"}),t.jsx(s,{checked:e.option4,onChange:o=>a({...e,option4:o}),label:"Enable dark mode",disabled:!0})]})},parameters:{controls:{disable:!0}}};var l,r,p;n.parameters={...n.parameters,docs:{...(l=n.parameters)==null?void 0:l.docs,source:{originalSource:`{
|
|
2
2
|
args: {
|
|
3
3
|
checked: false,
|
|
4
4
|
label: 'Accept terms and conditions',
|