@omnifyjp/ui 0.5.3 → 1.0.1
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/README.md +3 -6
- package/dist/chunk-2C2HRGM7.js +51 -0
- package/dist/chunk-2C2HRGM7.js.map +1 -0
- package/dist/chunk-2TUWDXAC.js +196 -0
- package/dist/chunk-2TUWDXAC.js.map +1 -0
- package/dist/chunk-34ARZSNP.js +63 -0
- package/dist/chunk-34ARZSNP.js.map +1 -0
- package/dist/chunk-35DNN46W.js +13 -0
- package/dist/chunk-35DNN46W.js.map +1 -0
- package/dist/chunk-35U6QG4P.js +116 -0
- package/dist/chunk-35U6QG4P.js.map +1 -0
- package/dist/chunk-3EOHW4QN.js +35 -0
- package/dist/chunk-3EOHW4QN.js.map +1 -0
- package/dist/chunk-3VU56V66.js +41 -0
- package/dist/chunk-3VU56V66.js.map +1 -0
- package/dist/chunk-55E7D2HR.js +99 -0
- package/dist/chunk-55E7D2HR.js.map +1 -0
- package/dist/chunk-67YUL2ZS.js +53 -0
- package/dist/chunk-67YUL2ZS.js.map +1 -0
- package/dist/chunk-6DIDQ4TB.js +131 -0
- package/dist/chunk-6DIDQ4TB.js.map +1 -0
- package/dist/chunk-6GWVQB3Q.js +155 -0
- package/dist/chunk-6GWVQB3Q.js.map +1 -0
- package/dist/chunk-75WZR6HF.js +44 -0
- package/dist/chunk-75WZR6HF.js.map +1 -0
- package/dist/chunk-7IRLBU2I.js +114 -0
- package/dist/chunk-7IRLBU2I.js.map +1 -0
- package/dist/chunk-7RMTPT6O.js +99 -0
- package/dist/chunk-7RMTPT6O.js.map +1 -0
- package/dist/chunk-7XH3MGBR.js +128 -0
- package/dist/chunk-7XH3MGBR.js.map +1 -0
- package/dist/chunk-A3BB5ZOC.js +77 -0
- package/dist/chunk-A3BB5ZOC.js.map +1 -0
- package/dist/chunk-BAQWGQJG.js +106 -0
- package/dist/chunk-BAQWGQJG.js.map +1 -0
- package/dist/chunk-BRSM3SZP.js +46 -0
- package/dist/chunk-BRSM3SZP.js.map +1 -0
- package/dist/chunk-C34KSTWA.js +43 -0
- package/dist/chunk-C34KSTWA.js.map +1 -0
- package/dist/chunk-C5NZAOA7.js +54 -0
- package/dist/chunk-C5NZAOA7.js.map +1 -0
- package/dist/chunk-CUZR4JWM.js +23 -0
- package/dist/chunk-CUZR4JWM.js.map +1 -0
- package/dist/chunk-DGPY4WP3.js +11 -0
- package/dist/chunk-DGPY4WP3.js.map +1 -0
- package/dist/chunk-EWBCV7VA.js +65 -0
- package/dist/chunk-EWBCV7VA.js.map +1 -0
- package/dist/chunk-F2ZJLKDP.js +119 -0
- package/dist/chunk-F2ZJLKDP.js.map +1 -0
- package/dist/chunk-FLWMT4DB.js +66 -0
- package/dist/chunk-FLWMT4DB.js.map +1 -0
- package/dist/chunk-FRKG7JQY.js +48 -0
- package/dist/chunk-FRKG7JQY.js.map +1 -0
- package/dist/chunk-G7HTZBUR.js +187 -0
- package/dist/chunk-G7HTZBUR.js.map +1 -0
- package/dist/chunk-IAWKX5W4.js +219 -0
- package/dist/chunk-IAWKX5W4.js.map +1 -0
- package/dist/chunk-INLM7UJC.js +238 -0
- package/dist/chunk-INLM7UJC.js.map +1 -0
- package/dist/chunk-JAJMM32I.js +18 -0
- package/dist/chunk-JAJMM32I.js.map +1 -0
- package/dist/chunk-JJSVA3TH.js +61 -0
- package/dist/chunk-JJSVA3TH.js.map +1 -0
- package/dist/chunk-JLTBUACL.js +121 -0
- package/dist/chunk-JLTBUACL.js.map +1 -0
- package/dist/chunk-JRU2QX7T.js +38 -0
- package/dist/chunk-JRU2QX7T.js.map +1 -0
- package/dist/chunk-JXGRW2MR.js +17 -0
- package/dist/chunk-JXGRW2MR.js.map +1 -0
- package/dist/chunk-LMT327XH.js +56 -0
- package/dist/chunk-LMT327XH.js.map +1 -0
- package/dist/chunk-LTTNCAAA.js +138 -0
- package/dist/chunk-LTTNCAAA.js.map +1 -0
- package/dist/chunk-MJLFJPUG.js +143 -0
- package/dist/chunk-MJLFJPUG.js.map +1 -0
- package/dist/chunk-MZ2P566X.js +65 -0
- package/dist/chunk-MZ2P566X.js.map +1 -0
- package/dist/chunk-N47H4MHX.js +41 -0
- package/dist/chunk-N47H4MHX.js.map +1 -0
- package/dist/chunk-NNJTKHCE.js +160 -0
- package/dist/chunk-NNJTKHCE.js.map +1 -0
- package/dist/chunk-NPL2R5LD.js +171 -0
- package/dist/chunk-NPL2R5LD.js.map +1 -0
- package/dist/chunk-NU56GKGM.js +44 -0
- package/dist/chunk-NU56GKGM.js.map +1 -0
- package/dist/chunk-P3M5TZD2.js +24 -0
- package/dist/chunk-P3M5TZD2.js.map +1 -0
- package/dist/chunk-PGWNOZDX.js +28 -0
- package/dist/chunk-PGWNOZDX.js.map +1 -0
- package/dist/chunk-QB3UWRZH.js +92 -0
- package/dist/chunk-QB3UWRZH.js.map +1 -0
- package/dist/chunk-R2CDE5DO.js +33 -0
- package/dist/chunk-R2CDE5DO.js.map +1 -0
- package/dist/chunk-RQNZDWY3.js +65 -0
- package/dist/chunk-RQNZDWY3.js.map +1 -0
- package/dist/chunk-S6PDRGR5.js +109 -0
- package/dist/chunk-S6PDRGR5.js.map +1 -0
- package/dist/chunk-TGYQ3AKH.js +95 -0
- package/dist/chunk-TGYQ3AKH.js.map +1 -0
- package/dist/chunk-TJMK2KBE.js +112 -0
- package/dist/chunk-TJMK2KBE.js.map +1 -0
- package/dist/chunk-USIHM7FV.js +211 -0
- package/dist/chunk-USIHM7FV.js.map +1 -0
- package/dist/chunk-VVYSAGB3.js +104 -0
- package/dist/chunk-VVYSAGB3.js.map +1 -0
- package/dist/chunk-WD5KZE25.js +25 -0
- package/dist/chunk-WD5KZE25.js.map +1 -0
- package/dist/chunk-WL4ZO2H3.js +33 -0
- package/dist/chunk-WL4ZO2H3.js.map +1 -0
- package/dist/chunk-WRCHR4AK.js +23 -0
- package/dist/chunk-WRCHR4AK.js.map +1 -0
- package/dist/chunk-WS6E7HBT.js +39 -0
- package/dist/chunk-WS6E7HBT.js.map +1 -0
- package/dist/chunk-XOJJBNDX.js +33 -0
- package/dist/chunk-XOJJBNDX.js.map +1 -0
- package/dist/chunk-YBMEQZX7.js +164 -0
- package/dist/chunk-YBMEQZX7.js.map +1 -0
- package/dist/chunk-Z2QAABLM.js +86 -0
- package/dist/chunk-Z2QAABLM.js.map +1 -0
- package/dist/chunk-ZHEKDP5X.js +41 -0
- package/dist/chunk-ZHEKDP5X.js.map +1 -0
- package/dist/chunk-ZPMXRW2A.js +63 -0
- package/dist/chunk-ZPMXRW2A.js.map +1 -0
- package/dist/chunk-ZYEGBF7G.js +25 -0
- package/dist/chunk-ZYEGBF7G.js.map +1 -0
- package/dist/components/accordion.d.ts +37 -0
- package/dist/components/accordion.js +4 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +56 -0
- package/dist/components/alert-dialog.js +5 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +68 -0
- package/dist/components/alert.js +4 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.d.ts +23 -0
- package/dist/components/aspect-ratio.js +3 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/avatar.d.ts +48 -0
- package/dist/components/avatar.js +4 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +52 -0
- package/dist/components/badge.js +4 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +50 -0
- package/dist/components/breadcrumb.js +4 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button.d.ts +81 -0
- package/dist/components/button.js +4 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar-category-badge.d.ts +24 -0
- package/dist/components/calendar-category-badge.js +5 -0
- package/dist/components/calendar-category-badge.js.map +1 -0
- package/dist/components/calendar-event-chip.d.ts +41 -0
- package/dist/components/calendar-event-chip.js +30 -0
- package/dist/components/calendar-event-chip.js.map +1 -0
- package/dist/components/calendar-event-sheet.d.ts +68 -0
- package/dist/components/calendar-event-sheet.js +83 -0
- package/dist/components/calendar-event-sheet.js.map +1 -0
- package/dist/components/calendar-mini.d.ts +65 -0
- package/dist/components/calendar-mini.js +93 -0
- package/dist/components/calendar-mini.js.map +1 -0
- package/dist/components/calendar-toolbar.d.ts +58 -0
- package/dist/components/calendar-toolbar.js +54 -0
- package/dist/components/calendar-toolbar.js.map +1 -0
- package/dist/components/calendar.d.ts +19 -0
- package/dist/components/calendar.js +5 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +43 -0
- package/dist/components/card.js +4 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +53 -0
- package/dist/components/carousel.js +5 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.d.ts +125 -0
- package/dist/components/chart.js +239 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +24 -0
- package/dist/components/checkbox.js +4 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.d.ts +28 -0
- package/dist/components/collapsible.js +3 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/color-picker.d.ts +35 -0
- package/dist/components/color-picker.js +7 -0
- package/dist/components/color-picker.js.map +1 -0
- package/dist/components/combobox.d.ts +98 -0
- package/dist/components/combobox.js +8 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.d.ts +63 -0
- package/dist/components/command.js +5 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.d.ts +70 -0
- package/dist/components/context-menu.js +4 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/date-picker.d.ts +71 -0
- package/dist/components/date-picker.js +90 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +58 -0
- package/dist/components/dialog.js +4 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.d.ts +60 -0
- package/dist/components/drawer.js +4 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +76 -0
- package/dist/components/dropdown-menu.js +4 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/file-upload.d.ts +44 -0
- package/dist/components/file-upload.js +5 -0
- package/dist/components/file-upload.js.map +1 -0
- package/dist/components/form.d.ts +67 -0
- package/dist/components/form.js +111 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/hover-card.d.ts +43 -0
- package/dist/components/hover-card.js +4 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-otp.d.ts +38 -0
- package/dist/components/input-otp.js +4 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.d.ts +38 -0
- package/dist/components/input.js +4 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.d.ts +20 -0
- package/dist/components/label.js +4 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/menubar.d.ts +82 -0
- package/dist/components/menubar.js +4 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +64 -0
- package/dist/components/navigation-menu.js +4 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.d.ts +59 -0
- package/dist/components/pagination.js +5 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/password-input.d.ts +32 -0
- package/dist/components/password-input.js +5 -0
- package/dist/components/password-input.js.map +1 -0
- package/dist/components/permission-grid.d.ts +67 -0
- package/dist/components/permission-grid.js +5 -0
- package/dist/components/permission-grid.js.map +1 -0
- package/dist/components/popover.d.ts +37 -0
- package/dist/components/popover.js +4 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +20 -0
- package/dist/components/progress.js +4 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +38 -0
- package/dist/components/radio-group.js +4 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/rating.d.ts +35 -0
- package/dist/components/rating.js +4 -0
- package/dist/components/rating.js.map +1 -0
- package/dist/components/resizable.d.ts +36 -0
- package/dist/components/resizable.js +4 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scope-tree.d.ts +78 -0
- package/dist/components/scope-tree.js +5 -0
- package/dist/components/scope-tree.js.map +1 -0
- package/dist/components/scope-type-badge.d.ts +35 -0
- package/dist/components/scope-type-badge.js +5 -0
- package/dist/components/scope-type-badge.js.map +1 -0
- package/dist/components/scroll-area.d.ts +29 -0
- package/dist/components/scroll-area.js +4 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +52 -0
- package/dist/components/select.js +4 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +24 -0
- package/dist/components/separator.js +4 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +51 -0
- package/dist/components/sheet.js +4 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/skeleton.d.ts +25 -0
- package/dist/components/skeleton.js +4 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +24 -0
- package/dist/components/slider.js +4 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/slug-input.d.ts +50 -0
- package/dist/components/slug-input.js +6 -0
- package/dist/components/slug-input.js.map +1 -0
- package/dist/components/sonner.d.ts +22 -0
- package/dist/components/sonner.js +3 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/stage-type-badge.d.ts +30 -0
- package/dist/components/stage-type-badge.js +5 -0
- package/dist/components/stage-type-badge.js.map +1 -0
- package/dist/components/switch.d.ts +26 -0
- package/dist/components/switch.js +4 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +57 -0
- package/dist/components/table.js +4 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +39 -0
- package/dist/components/tabs.js +4 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/tag-input.d.ts +40 -0
- package/dist/components/tag-input.js +5 -0
- package/dist/components/tag-input.js.map +1 -0
- package/dist/components/textarea.d.ts +21 -0
- package/dist/components/textarea.js +4 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/time-picker.d.ts +57 -0
- package/dist/components/time-picker.js +8 -0
- package/dist/components/time-picker.js.map +1 -0
- package/dist/components/toggle-group.d.ts +45 -0
- package/dist/components/toggle-group.js +5 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +31 -0
- package/dist/components/toggle.js +4 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts +34 -0
- package/dist/components/tooltip.js +4 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/workflow-category-badge.d.ts +32 -0
- package/dist/components/workflow-category-badge.js +5 -0
- package/dist/components/workflow-category-badge.js.map +1 -0
- package/dist/components/workflow-diagram.d.ts +63 -0
- package/dist/components/workflow-diagram.js +5 -0
- package/dist/components/workflow-diagram.js.map +1 -0
- package/dist/components/workflow-status-badge.d.ts +30 -0
- package/dist/components/workflow-status-badge.js +5 -0
- package/dist/components/workflow-status-badge.js.map +1 -0
- package/dist/components/workflow-stepper.d.ts +52 -0
- package/dist/components/workflow-stepper.js +4 -0
- package/dist/components/workflow-stepper.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +3 -3
- package/dist/hooks/use-mobile.js +1 -1
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/index.d.ts +98 -16
- package/dist/index.js +62 -13
- package/dist/lib/types.d.ts +84 -1
- package/dist/lib/types.js +1 -1
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/utils.d.ts +5 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/package.json +68 -31
- package/src/styles/fonts.css +0 -0
- package/src/styles/index.css +3 -1
- package/src/styles/tailwind.css +4 -0
- package/src/styles/theme.css +461 -0
- package/dist/chunk-2GN4WIOV.js +0 -240
- package/dist/chunk-2GN4WIOV.js.map +0 -1
- package/dist/chunk-5BL4VFRJ.js +0 -57
- package/dist/chunk-5BL4VFRJ.js.map +0 -1
- package/dist/chunk-735JNJJO.js +0 -27
- package/dist/chunk-735JNJJO.js.map +0 -1
- package/dist/chunk-EJEVW4RO.js +0 -49
- package/dist/chunk-EJEVW4RO.js.map +0 -1
- package/dist/chunk-FVOQZTHE.js +0 -191
- package/dist/chunk-FVOQZTHE.js.map +0 -1
- package/dist/chunk-ITXOZ4IR.js +0 -85
- package/dist/chunk-ITXOZ4IR.js.map +0 -1
- package/dist/chunk-NVPNMQSR.js +0 -30
- package/dist/chunk-NVPNMQSR.js.map +0 -1
- package/dist/chunk-O25D7DCP.js +0 -72
- package/dist/chunk-O25D7DCP.js.map +0 -1
- package/dist/chunk-O2ADW2GC.js +0 -224
- package/dist/chunk-O2ADW2GC.js.map +0 -1
- package/dist/chunk-OY3PSPA5.js +0 -661
- package/dist/chunk-OY3PSPA5.js.map +0 -1
- package/dist/chunk-UASABUQA.js +0 -39
- package/dist/chunk-UASABUQA.js.map +0 -1
- package/dist/chunk-UR2QLIS2.js +0 -93
- package/dist/chunk-UR2QLIS2.js.map +0 -1
- package/dist/chunk-XDXGUPCR.js +0 -123
- package/dist/chunk-XDXGUPCR.js.map +0 -1
- package/dist/components/AppShell.d.ts +0 -27
- package/dist/components/AppShell.js +0 -13
- package/dist/components/AppShell.js.map +0 -1
- package/dist/components/Header.d.ts +0 -11
- package/dist/components/Header.js +0 -9
- package/dist/components/Header.js.map +0 -1
- package/dist/components/LanguageSelector.d.ts +0 -11
- package/dist/components/LanguageSelector.js +0 -5
- package/dist/components/LanguageSelector.js.map +0 -1
- package/dist/components/OrganizationSelector.d.ts +0 -8
- package/dist/components/OrganizationSelector.js +0 -4
- package/dist/components/OrganizationSelector.js.map +0 -1
- package/dist/components/OrganizationSetupModal.d.ts +0 -5
- package/dist/components/OrganizationSetupModal.js +0 -4
- package/dist/components/OrganizationSetupModal.js.map +0 -1
- package/dist/components/PageContainer.d.ts +0 -105
- package/dist/components/PageContainer.js +0 -3
- package/dist/components/PageContainer.js.map +0 -1
- package/dist/components/ServiceMenu.d.ts +0 -11
- package/dist/components/ServiceMenu.js +0 -3
- package/dist/components/ServiceMenu.js.map +0 -1
- package/dist/components/Sidebar.d.ts +0 -11
- package/dist/components/Sidebar.js +0 -5
- package/dist/components/Sidebar.js.map +0 -1
- package/dist/contexts/LanguageContext.d.ts +0 -17
- package/dist/contexts/LanguageContext.js +0 -4
- package/dist/contexts/LanguageContext.js.map +0 -1
- package/dist/contexts/OrganizationContext.d.ts +0 -28
- package/dist/contexts/OrganizationContext.js +0 -3
- package/dist/contexts/OrganizationContext.js.map +0 -1
- package/dist/contexts/ThemeContext.d.ts +0 -14
- package/dist/contexts/ThemeContext.js +0 -3
- package/dist/contexts/ThemeContext.js.map +0 -1
- package/dist/hooks/useDateFormat.d.ts +0 -28
- package/dist/hooks/useDateFormat.js +0 -4
- package/dist/hooks/useDateFormat.js.map +0 -1
- package/dist/i18n.d.ts +0 -38
- package/dist/i18n.js +0 -3
- package/dist/i18n.js.map +0 -1
- package/dist/types.d.ts +0 -91
- package/dist/types.js +0 -3
- package/dist/types.js.map +0 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { UIColor } from '../lib/types.js';
|
|
5
|
+
|
|
6
|
+
declare const buttonVariants: (props?: ({
|
|
7
|
+
variant?: "link" | "destructive" | "default" | "secondary" | "outline" | "soft" | "ghost" | null | undefined;
|
|
8
|
+
color?: "primary" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
9
|
+
size?: "default" | "xs" | "sm" | "lg" | "xl" | "icon" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
interface ButtonProps extends React.ComponentProps<"button">, Omit<VariantProps<typeof buttonVariants>, "color"> {
|
|
12
|
+
/**
|
|
13
|
+
* Semantic color intent. Works with `variant` to produce the final appearance.
|
|
14
|
+
*
|
|
15
|
+
* | Color | Use for |
|
|
16
|
+
* |-------|---------|
|
|
17
|
+
* | `primary` | Main actions (default) |
|
|
18
|
+
* | `destructive` | Delete, errors |
|
|
19
|
+
* | `success` | Approve, confirm |
|
|
20
|
+
* | `warning` | Caution, attention |
|
|
21
|
+
* | `info` | Informational |
|
|
22
|
+
*
|
|
23
|
+
* @default "primary"
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <Button color="success">Approve</Button>
|
|
27
|
+
* <Button variant="outline" color="destructive">Reject</Button>
|
|
28
|
+
* <Button variant="soft" color="warning">Review</Button>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
color?: UIColor;
|
|
32
|
+
/**
|
|
33
|
+
* Render as a child component using Radix Slot.
|
|
34
|
+
* When `true`, the button merges its props onto its single child element.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
asChild?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Make the button take the full width of its container.
|
|
40
|
+
* @default false
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Button block>Full Width</Button>
|
|
44
|
+
* <Button size="xl" block>Sign In</Button>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
block?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Button component with semantic colors, visual variants, and standard sizes.
|
|
51
|
+
*
|
|
52
|
+
* Combines `variant` (how it looks) with `color` (what it means) for full flexibility.
|
|
53
|
+
* All existing `variant="destructive"` usage continues to work unchanged.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* // Default (solid primary)
|
|
58
|
+
* <Button>Save</Button>
|
|
59
|
+
*
|
|
60
|
+
* // Semantic colors
|
|
61
|
+
* <Button color="success">Approve</Button>
|
|
62
|
+
* <Button color="destructive">Delete</Button>
|
|
63
|
+
* <Button color="warning">Proceed with caution</Button>
|
|
64
|
+
*
|
|
65
|
+
* // Variant × Color combinations
|
|
66
|
+
* <Button variant="outline" color="destructive">Reject</Button>
|
|
67
|
+
* <Button variant="soft" color="success">Approved</Button>
|
|
68
|
+
* <Button variant="ghost" color="info">Learn more</Button>
|
|
69
|
+
*
|
|
70
|
+
* // Legacy (still works)
|
|
71
|
+
* <Button variant="destructive">Delete</Button>
|
|
72
|
+
*
|
|
73
|
+
* // Sizes: xs (24px) | sm (28px) | default (32px) | lg (36px) | xl (44px) | icon (32x32)
|
|
74
|
+
* <Button size="xs">Tiny</Button>
|
|
75
|
+
* <Button size="xl" block>Sign In</Button>
|
|
76
|
+
* <Button size="icon"><PlusIcon /></Button>
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
80
|
+
|
|
81
|
+
export { Button, type ButtonProps, buttonVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"button.js"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface CalendarCategoryBadgeProps {
|
|
4
|
+
/** The category key (e.g. "meeting", "deadline"). Determines the badge color from built-in or custom styles. */
|
|
5
|
+
category: string;
|
|
6
|
+
/** Override display label. Defaults to the raw category key. */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** Custom className styles per category key, merged with built-in defaults. */
|
|
9
|
+
styles?: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Color-coded badge for calendar event categories. Ships with built-in styles
|
|
13
|
+
* for meeting (blue), deadline (red), reminder (amber), personal (purple), and
|
|
14
|
+
* holiday (green). Custom categories can be styled via the `styles` prop.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <CalendarCategoryBadge category="meeting" label="Meeting" />
|
|
19
|
+
* <CalendarCategoryBadge category="custom" label="Custom" styles={{ custom: "bg-pink-50 text-pink-600" }} />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare function CalendarCategoryBadge({ category, label, styles }: CalendarCategoryBadgeProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { CalendarCategoryBadge, type CalendarCategoryBadgeProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"calendar-category-badge.js"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/** Event data shape required by CalendarEventChip. */
|
|
4
|
+
interface CalendarEventChipEvent {
|
|
5
|
+
/** Unique event identifier. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Display title of the event. */
|
|
8
|
+
title: string;
|
|
9
|
+
/** Event start date/time. */
|
|
10
|
+
start: Date;
|
|
11
|
+
/** Event end date/time. */
|
|
12
|
+
end: Date;
|
|
13
|
+
/** Whether this is an all-day event. When true, time is not displayed. */
|
|
14
|
+
allDay?: boolean;
|
|
15
|
+
/** CSS color string used for the chip background, text, and left border. */
|
|
16
|
+
color: string;
|
|
17
|
+
}
|
|
18
|
+
interface CalendarEventChipProps {
|
|
19
|
+
/** The event to display. */
|
|
20
|
+
event: CalendarEventChipEvent;
|
|
21
|
+
/** Use compact layout with tighter line-height. Defaults to `false`. */
|
|
22
|
+
compact?: boolean;
|
|
23
|
+
/** Callback when the chip is clicked. */
|
|
24
|
+
onClick?: (event: CalendarEventChipEvent) => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Small colored chip representing a calendar event. Shows the event title
|
|
28
|
+
* with a colored left border and tinted background. Optionally displays
|
|
29
|
+
* the start time for non-all-day events.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <CalendarEventChip
|
|
34
|
+
* event={{ id: "1", title: "Standup", start: new Date(), end: new Date(), color: "#3b82f6" }}
|
|
35
|
+
* onClick={(e) => openDetail(e.id)}
|
|
36
|
+
* />
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
declare function CalendarEventChip({ event, compact, onClick }: CalendarEventChipProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
|
|
41
|
+
export { CalendarEventChip, type CalendarEventChipEvent, type CalendarEventChipProps };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { cn } from '../chunk-DGPY4WP3.js';
|
|
2
|
+
import { format } from 'date-fns';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function CalendarEventChip({ event, compact = false, onClick }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs(
|
|
7
|
+
"button",
|
|
8
|
+
{
|
|
9
|
+
type: "button",
|
|
10
|
+
onClick: () => onClick?.(event),
|
|
11
|
+
className: cn(
|
|
12
|
+
"w-full text-left rounded px-1.5 py-0.5 text-xs font-medium truncate transition-opacity hover:opacity-80 cursor-pointer",
|
|
13
|
+
compact ? "leading-tight" : "leading-normal"
|
|
14
|
+
),
|
|
15
|
+
style: {
|
|
16
|
+
backgroundColor: `${event.color}20`,
|
|
17
|
+
color: event.color,
|
|
18
|
+
borderLeft: `2px solid ${event.color}`
|
|
19
|
+
},
|
|
20
|
+
children: [
|
|
21
|
+
!event.allDay && !compact && /* @__PURE__ */ jsx("span", { className: "opacity-75 mr-1", children: format(event.start, "HH:mm") }),
|
|
22
|
+
event.title
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { CalendarEventChip };
|
|
29
|
+
//# sourceMappingURL=calendar-event-chip.js.map
|
|
30
|
+
//# sourceMappingURL=calendar-event-chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/calendar-event-chip.tsx"],"names":[],"mappings":";;;;AAyCO,SAAS,kBAAkB,EAAE,KAAA,EAAO,OAAA,GAAU,KAAA,EAAO,SAAQ,EAA2B;AAC7F,EAAA,uBACE,IAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,OAAA,EAAS,MAAM,OAAA,GAAU,KAAK,CAAA;AAAA,MAC9B,SAAA,EAAW,EAAA;AAAA,QACT,wHAAA;AAAA,QACA,UAAU,eAAA,GAAkB;AAAA,OAC9B;AAAA,MACA,KAAA,EAAO;AAAA,QACL,eAAA,EAAiB,CAAA,EAAG,KAAA,CAAM,KAAK,CAAA,EAAA,CAAA;AAAA,QAC/B,OAAO,KAAA,CAAM,KAAA;AAAA,QACb,UAAA,EAAY,CAAA,UAAA,EAAa,KAAA,CAAM,KAAK,CAAA;AAAA,OACtC;AAAA,MAEC,QAAA,EAAA;AAAA,QAAA,CAAC,KAAA,CAAM,MAAA,IAAU,CAAC,OAAA,oBACjB,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,iBAAA,EAAmB,QAAA,EAAA,MAAA,CAAO,KAAA,CAAM,KAAA,EAAO,OAAO,CAAA,EAAE,CAAA;AAAA,QAEjE,KAAA,CAAM;AAAA;AAAA;AAAA,GACT;AAEJ","file":"calendar-event-chip.js","sourcesContent":["import { format } from 'date-fns';\nimport { cn } from '../lib/utils';\n\n/** Event data shape required by CalendarEventChip. */\nexport interface CalendarEventChipEvent {\n /** Unique event identifier. */\n id: string;\n /** Display title of the event. */\n title: string;\n /** Event start date/time. */\n start: Date;\n /** Event end date/time. */\n end: Date;\n /** Whether this is an all-day event. When true, time is not displayed. */\n allDay?: boolean;\n /** CSS color string used for the chip background, text, and left border. */\n color: string;\n}\n\nexport interface CalendarEventChipProps {\n /** The event to display. */\n event: CalendarEventChipEvent;\n /** Use compact layout with tighter line-height. Defaults to `false`. */\n compact?: boolean;\n /** Callback when the chip is clicked. */\n onClick?: (event: CalendarEventChipEvent) => void;\n}\n\n/**\n * Small colored chip representing a calendar event. Shows the event title\n * with a colored left border and tinted background. Optionally displays\n * the start time for non-all-day events.\n *\n * @example\n * ```tsx\n * <CalendarEventChip\n * event={{ id: \"1\", title: \"Standup\", start: new Date(), end: new Date(), color: \"#3b82f6\" }}\n * onClick={(e) => openDetail(e.id)}\n * />\n * ```\n */\nexport function CalendarEventChip({ event, compact = false, onClick }: CalendarEventChipProps) {\n return (\n <button\n type=\"button\"\n onClick={() => onClick?.(event)}\n className={cn(\n 'w-full text-left rounded px-1.5 py-0.5 text-xs font-medium truncate transition-opacity hover:opacity-80 cursor-pointer',\n compact ? 'leading-tight' : 'leading-normal'\n )}\n style={{\n backgroundColor: `${event.color}20`,\n color: event.color,\n borderLeft: `2px solid ${event.color}`,\n }}\n >\n {!event.allDay && !compact && (\n <span className=\"opacity-75 mr-1\">{format(event.start, 'HH:mm')}</span>\n )}\n {event.title}\n </button>\n );\n}\n"]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/** Extended event data shape for the detail sheet, including description, location, and attendees. */
|
|
4
|
+
interface CalendarEventSheetEvent {
|
|
5
|
+
/** Unique event identifier. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Display title of the event. */
|
|
8
|
+
title: string;
|
|
9
|
+
/** Optional long description or notes for the event. */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** Event start date/time. */
|
|
12
|
+
start: Date;
|
|
13
|
+
/** Event end date/time. */
|
|
14
|
+
end: Date;
|
|
15
|
+
/** Whether this is an all-day event. */
|
|
16
|
+
allDay?: boolean;
|
|
17
|
+
/** CSS color string for the event. */
|
|
18
|
+
color: string;
|
|
19
|
+
/** Category key (e.g. "meeting", "deadline") used by CalendarCategoryBadge. */
|
|
20
|
+
category: string;
|
|
21
|
+
/** Optional location string. */
|
|
22
|
+
location?: string;
|
|
23
|
+
/** Optional list of attendee email addresses. */
|
|
24
|
+
attendees?: string[];
|
|
25
|
+
}
|
|
26
|
+
/** Localizable labels for the event detail sheet. All have English defaults. */
|
|
27
|
+
interface CalendarEventSheetLabels {
|
|
28
|
+
/** Text displayed for all-day events instead of a time range. */
|
|
29
|
+
allDay?: string;
|
|
30
|
+
/** Heading text for the attendees section. */
|
|
31
|
+
attendees?: string;
|
|
32
|
+
/** Label for the delete button. */
|
|
33
|
+
delete?: string;
|
|
34
|
+
}
|
|
35
|
+
interface CalendarEventSheetProps {
|
|
36
|
+
/** The event to display, or `null` to render nothing. */
|
|
37
|
+
event: CalendarEventSheetEvent | null;
|
|
38
|
+
/** Whether the sheet is open. */
|
|
39
|
+
open: boolean;
|
|
40
|
+
/** Callback to toggle the sheet open state. */
|
|
41
|
+
onOpenChange: (open: boolean) => void;
|
|
42
|
+
/** Optional callback when the delete button is clicked. Receives the event id. */
|
|
43
|
+
onDelete?: (id: string) => void;
|
|
44
|
+
/** Override display label for the category badge. */
|
|
45
|
+
categoryLabel?: string;
|
|
46
|
+
/** Custom className styles per category key for the CalendarCategoryBadge. */
|
|
47
|
+
categoryStyles?: Record<string, string>;
|
|
48
|
+
/** Localizable UI labels with English defaults. */
|
|
49
|
+
labels?: CalendarEventSheetLabels;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Side sheet that displays full event details including title, category badge,
|
|
53
|
+
* description, date/time, location, attendees, and a delete action.
|
|
54
|
+
* Built on top of the Sheet component.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* <CalendarEventSheet
|
|
59
|
+
* event={selectedEvent}
|
|
60
|
+
* open={sheetOpen}
|
|
61
|
+
* onOpenChange={setSheetOpen}
|
|
62
|
+
* onDelete={(id) => removeEvent(id)}
|
|
63
|
+
* />
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
declare function CalendarEventSheet({ event, open, onOpenChange, onDelete, categoryLabel, categoryStyles, labels: labelsProp, }: CalendarEventSheetProps): react_jsx_runtime.JSX.Element | null;
|
|
67
|
+
|
|
68
|
+
export { CalendarEventSheet, type CalendarEventSheetEvent, type CalendarEventSheetLabels, type CalendarEventSheetProps };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Sheet, SheetContent, SheetHeader, SheetTitle } from '../chunk-JLTBUACL.js';
|
|
2
|
+
import { CalendarCategoryBadge } from '../chunk-JAJMM32I.js';
|
|
3
|
+
import { Separator } from '../chunk-PGWNOZDX.js';
|
|
4
|
+
import { Button } from '../chunk-55E7D2HR.js';
|
|
5
|
+
import '../chunk-A3BB5ZOC.js';
|
|
6
|
+
import '../chunk-DGPY4WP3.js';
|
|
7
|
+
import { format } from 'date-fns';
|
|
8
|
+
import { Clock, MapPin, Users, Trash2 } from 'lucide-react';
|
|
9
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
var defaultLabels = {
|
|
12
|
+
allDay: "All Day",
|
|
13
|
+
attendees: "Attendees",
|
|
14
|
+
delete: "Delete"
|
|
15
|
+
};
|
|
16
|
+
function CalendarEventSheet({
|
|
17
|
+
event,
|
|
18
|
+
open,
|
|
19
|
+
onOpenChange,
|
|
20
|
+
onDelete,
|
|
21
|
+
categoryLabel,
|
|
22
|
+
categoryStyles,
|
|
23
|
+
labels: labelsProp
|
|
24
|
+
}) {
|
|
25
|
+
const labels = { ...defaultLabels, ...labelsProp };
|
|
26
|
+
if (!event) return null;
|
|
27
|
+
const timeDisplay = event.allDay ? labels.allDay : `${format(event.start, "HH:mm")} - ${format(event.end, "HH:mm")}`;
|
|
28
|
+
return /* @__PURE__ */ jsx(Sheet, { open, onOpenChange, children: /* @__PURE__ */ jsxs(SheetContent, { className: "sm:max-w-md", children: [
|
|
29
|
+
/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: event.title }) }),
|
|
30
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 space-y-4", children: [
|
|
31
|
+
/* @__PURE__ */ jsx(
|
|
32
|
+
CalendarCategoryBadge,
|
|
33
|
+
{
|
|
34
|
+
category: event.category,
|
|
35
|
+
label: categoryLabel,
|
|
36
|
+
styles: categoryStyles
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
event.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: event.description }),
|
|
40
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
41
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
42
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 text-sm", children: [
|
|
43
|
+
/* @__PURE__ */ jsx(Clock, { className: "w-4 h-4 text-muted-foreground flex-shrink-0" }),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
45
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium", children: format(event.start, "EEEE, MMMM d, yyyy") }),
|
|
46
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: timeDisplay })
|
|
47
|
+
] })
|
|
48
|
+
] }),
|
|
49
|
+
event.location && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 text-sm", children: [
|
|
50
|
+
/* @__PURE__ */ jsx(MapPin, { className: "w-4 h-4 text-muted-foreground flex-shrink-0" }),
|
|
51
|
+
/* @__PURE__ */ jsx("span", { children: event.location })
|
|
52
|
+
] }),
|
|
53
|
+
event.attendees && event.attendees.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 text-sm", children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Users, { className: "w-4 h-4 text-muted-foreground flex-shrink-0 mt-0.5" }),
|
|
55
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
56
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium mb-1", children: labels.attendees }),
|
|
57
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-1", children: event.attendees.map((email) => /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: email }, email)) })
|
|
58
|
+
] })
|
|
59
|
+
] })
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
62
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs(
|
|
63
|
+
Button,
|
|
64
|
+
{
|
|
65
|
+
variant: "destructive",
|
|
66
|
+
size: "sm",
|
|
67
|
+
onClick: () => {
|
|
68
|
+
onDelete?.(event.id);
|
|
69
|
+
onOpenChange(false);
|
|
70
|
+
},
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" }),
|
|
73
|
+
labels.delete
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
) })
|
|
77
|
+
] })
|
|
78
|
+
] }) });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { CalendarEventSheet };
|
|
82
|
+
//# sourceMappingURL=calendar-event-sheet.js.map
|
|
83
|
+
//# sourceMappingURL=calendar-event-sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/calendar-event-sheet.tsx"],"names":[],"mappings":";;;;;;;;;;AAyCA,IAAM,aAAA,GAAoD;AAAA,EACxD,MAAA,EAAQ,SAAA;AAAA,EACR,SAAA,EAAW,WAAA;AAAA,EACX,MAAA,EAAQ;AACV,CAAA;AAkCO,SAAS,kBAAA,CAAmB;AAAA,EACjC,KAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,MAAA,EAAQ;AACV,CAAA,EAA4B;AAC1B,EAAA,MAAM,MAAA,GAAS,EAAE,GAAG,aAAA,EAAe,GAAG,UAAA,EAAW;AAEjD,EAAA,IAAI,CAAC,OAAO,OAAO,IAAA;AAEnB,EAAA,MAAM,cAAc,KAAA,CAAM,MAAA,GACtB,MAAA,CAAO,MAAA,GACP,GAAG,MAA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,YAAA,YAAA,CAAa,KAAK,CAAA;AAAA,UACpB,CAAA;AAAA,UAEA,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,MAAA,EAAA,EAAO,WAAU,SAAA,EAAU,CAAA;AAAA,YAC3B,MAAA,CAAO;AAAA;AAAA;AAAA,OACV,EACF;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ","file":"calendar-event-sheet.js","sourcesContent":["import { format } from 'date-fns';\nimport { Clock, MapPin, Users, Trash2 } from 'lucide-react';\nimport { Sheet, SheetContent, SheetHeader, SheetTitle } from './sheet';\nimport { Button } from './button';\nimport { Separator } from './separator';\nimport { CalendarCategoryBadge } from './calendar-category-badge';\n\n/** Extended event data shape for the detail sheet, including description, location, and attendees. */\nexport interface CalendarEventSheetEvent {\n /** Unique event identifier. */\n id: string;\n /** Display title of the event. */\n title: string;\n /** Optional long description or notes for the event. */\n description?: string;\n /** Event start date/time. */\n start: Date;\n /** Event end date/time. */\n end: Date;\n /** Whether this is an all-day event. */\n allDay?: boolean;\n /** CSS color string for the event. */\n color: string;\n /** Category key (e.g. \"meeting\", \"deadline\") used by CalendarCategoryBadge. */\n category: string;\n /** Optional location string. */\n location?: string;\n /** Optional list of attendee email addresses. */\n attendees?: string[];\n}\n\n/** Localizable labels for the event detail sheet. All have English defaults. */\nexport interface CalendarEventSheetLabels {\n /** Text displayed for all-day events instead of a time range. */\n allDay?: string;\n /** Heading text for the attendees section. */\n attendees?: string;\n /** Label for the delete button. */\n delete?: string;\n}\n\nconst defaultLabels: Required<CalendarEventSheetLabels> = {\n allDay: 'All Day',\n attendees: 'Attendees',\n delete: 'Delete',\n};\n\nexport interface CalendarEventSheetProps {\n /** The event to display, or `null` to render nothing. */\n event: CalendarEventSheetEvent | null;\n /** Whether the sheet is open. */\n open: boolean;\n /** Callback to toggle the sheet open state. */\n onOpenChange: (open: boolean) => void;\n /** Optional callback when the delete button is clicked. Receives the event id. */\n onDelete?: (id: string) => void;\n /** Override display label for the category badge. */\n categoryLabel?: string;\n /** Custom className styles per category key for the CalendarCategoryBadge. */\n categoryStyles?: Record<string, string>;\n /** Localizable UI labels with English defaults. */\n labels?: CalendarEventSheetLabels;\n}\n\n/**\n * Side sheet that displays full event details including title, category badge,\n * description, date/time, location, attendees, and a delete action.\n * Built on top of the Sheet component.\n *\n * @example\n * ```tsx\n * <CalendarEventSheet\n * event={selectedEvent}\n * open={sheetOpen}\n * onOpenChange={setSheetOpen}\n * onDelete={(id) => removeEvent(id)}\n * />\n * ```\n */\nexport function CalendarEventSheet({\n event,\n open,\n onOpenChange,\n onDelete,\n categoryLabel,\n categoryStyles,\n labels: labelsProp,\n}: CalendarEventSheetProps) {\n const labels = { ...defaultLabels, ...labelsProp };\n\n if (!event) return null;\n\n const timeDisplay = event.allDay\n ? labels.allDay\n : `${format(event.start, 'HH:mm')} - ${format(event.end, 'HH:mm')}`;\n\n return (\n <Sheet open={open} onOpenChange={onOpenChange}>\n <SheetContent className=\"sm:max-w-md\">\n <SheetHeader>\n <SheetTitle>{event.title}</SheetTitle>\n </SheetHeader>\n <div className=\"mt-4 space-y-4\">\n <CalendarCategoryBadge\n category={event.category}\n label={categoryLabel}\n styles={categoryStyles}\n />\n\n {event.description && (\n <p className=\"text-sm text-muted-foreground\">{event.description}</p>\n )}\n\n <Separator />\n\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-3 text-sm\">\n <Clock className=\"w-4 h-4 text-muted-foreground flex-shrink-0\" />\n <div>\n <p className=\"font-medium\">{format(event.start, 'EEEE, MMMM d, yyyy')}</p>\n <p className=\"text-muted-foreground\">{timeDisplay}</p>\n </div>\n </div>\n\n {event.location && (\n <div className=\"flex items-center gap-3 text-sm\">\n <MapPin className=\"w-4 h-4 text-muted-foreground flex-shrink-0\" />\n <span>{event.location}</span>\n </div>\n )}\n\n {event.attendees && event.attendees.length > 0 && (\n <div className=\"flex items-start gap-3 text-sm\">\n <Users className=\"w-4 h-4 text-muted-foreground flex-shrink-0 mt-0.5\" />\n <div>\n <p className=\"font-medium mb-1\">{labels.attendees}</p>\n <div className=\"space-y-1\">\n {event.attendees.map(email => (\n <p key={email} className=\"text-muted-foreground\">{email}</p>\n ))}\n </div>\n </div>\n </div>\n )}\n </div>\n\n <Separator />\n\n <div className=\"flex justify-end\">\n <Button\n variant=\"destructive\"\n size=\"sm\"\n onClick={() => {\n onDelete?.(event.id);\n onOpenChange(false);\n }}\n >\n <Trash2 className=\"w-4 h-4\" />\n {labels.delete}\n </Button>\n </div>\n </div>\n </SheetContent>\n </Sheet>\n );\n}\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/** A category that can be toggled on/off in the mini calendar's filter section. */
|
|
4
|
+
interface CalendarCategory {
|
|
5
|
+
/** Unique key for this category. */
|
|
6
|
+
key: string;
|
|
7
|
+
/** CSS color string used for the category dot. */
|
|
8
|
+
color: string;
|
|
9
|
+
/** Display label for the category. */
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
/** Localizable labels for the mini calendar. All have English defaults. */
|
|
13
|
+
interface CalendarMiniLabels {
|
|
14
|
+
/** Label for Sunday column header. */
|
|
15
|
+
sun?: string;
|
|
16
|
+
/** Label for Monday column header. */
|
|
17
|
+
mon?: string;
|
|
18
|
+
/** Label for Tuesday column header. */
|
|
19
|
+
tue?: string;
|
|
20
|
+
/** Label for Wednesday column header. */
|
|
21
|
+
wed?: string;
|
|
22
|
+
/** Label for Thursday column header. */
|
|
23
|
+
thu?: string;
|
|
24
|
+
/** Label for Friday column header. */
|
|
25
|
+
fri?: string;
|
|
26
|
+
/** Label for Saturday column header. */
|
|
27
|
+
sat?: string;
|
|
28
|
+
/** Heading text for the categories filter section. */
|
|
29
|
+
categories?: string;
|
|
30
|
+
}
|
|
31
|
+
interface CalendarMiniProps {
|
|
32
|
+
/** The month to display (any date within the target month). */
|
|
33
|
+
currentDate: Date;
|
|
34
|
+
/** The currently selected date, highlighted with primary color. */
|
|
35
|
+
selectedDate: Date;
|
|
36
|
+
/** Callback when a day cell is clicked. */
|
|
37
|
+
onSelectDate: (date: Date) => void;
|
|
38
|
+
/** Optional list of event categories for the filter section. */
|
|
39
|
+
categories?: CalendarCategory[];
|
|
40
|
+
/** Keys of currently enabled categories. */
|
|
41
|
+
enabledCategories?: string[];
|
|
42
|
+
/** Callback when a category checkbox is toggled. */
|
|
43
|
+
onToggleCategory?: (key: string) => void;
|
|
44
|
+
/** Localizable UI labels with English defaults. */
|
|
45
|
+
labels?: CalendarMiniLabels;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Compact month calendar with optional category filters. Designed for sidebar
|
|
49
|
+
* placement in calendar views. Locale-agnostic via the `labels` prop.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <CalendarMini
|
|
54
|
+
* currentDate={new Date()}
|
|
55
|
+
* selectedDate={selectedDate}
|
|
56
|
+
* onSelectDate={setSelectedDate}
|
|
57
|
+
* categories={[{ key: "meeting", color: "#3b82f6", label: "Meeting" }]}
|
|
58
|
+
* enabledCategories={["meeting"]}
|
|
59
|
+
* onToggleCategory={(key) => toggle(key)}
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare function CalendarMini({ currentDate, selectedDate, onSelectDate, categories, enabledCategories, onToggleCategory, labels: labelsProp, }: CalendarMiniProps): react_jsx_runtime.JSX.Element;
|
|
64
|
+
|
|
65
|
+
export { type CalendarCategory, CalendarMini, type CalendarMiniLabels, type CalendarMiniProps };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Checkbox } from '../chunk-WL4ZO2H3.js';
|
|
2
|
+
import { Separator } from '../chunk-PGWNOZDX.js';
|
|
3
|
+
import { cn } from '../chunk-DGPY4WP3.js';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { startOfMonth, endOfMonth, startOfWeek, endOfWeek, eachDayOfInterval, format, isSameMonth, isSameDay, isToday } from 'date-fns';
|
|
6
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var defaultLabels = {
|
|
9
|
+
sun: "Sun",
|
|
10
|
+
mon: "Mon",
|
|
11
|
+
tue: "Tue",
|
|
12
|
+
wed: "Wed",
|
|
13
|
+
thu: "Thu",
|
|
14
|
+
fri: "Fri",
|
|
15
|
+
sat: "Sat",
|
|
16
|
+
categories: "Categories"
|
|
17
|
+
};
|
|
18
|
+
function CalendarMini({
|
|
19
|
+
currentDate,
|
|
20
|
+
selectedDate,
|
|
21
|
+
onSelectDate,
|
|
22
|
+
categories,
|
|
23
|
+
enabledCategories,
|
|
24
|
+
onToggleCategory,
|
|
25
|
+
labels: labelsProp
|
|
26
|
+
}) {
|
|
27
|
+
const labels = { ...defaultLabels, ...labelsProp };
|
|
28
|
+
const days = useMemo(() => {
|
|
29
|
+
const monthStart = startOfMonth(currentDate);
|
|
30
|
+
const monthEnd = endOfMonth(currentDate);
|
|
31
|
+
const calStart = startOfWeek(monthStart, { weekStartsOn: 0 });
|
|
32
|
+
const calEnd = endOfWeek(monthEnd, { weekStartsOn: 0 });
|
|
33
|
+
return eachDayOfInterval({ start: calStart, end: calEnd });
|
|
34
|
+
}, [currentDate]);
|
|
35
|
+
const weekDays = [labels.sun, labels.mon, labels.tue, labels.wed, labels.thu, labels.fri, labels.sat];
|
|
36
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
37
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
38
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold mb-2", children: format(currentDate, "MMMM yyyy") }),
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-7 gap-0", children: [
|
|
40
|
+
weekDays.map((day) => /* @__PURE__ */ jsx("div", { className: "text-center text-[10px] font-medium text-muted-foreground py-1", children: day }, day)),
|
|
41
|
+
days.map((day) => {
|
|
42
|
+
const inMonth = isSameMonth(day, currentDate);
|
|
43
|
+
const selected = isSameDay(day, selectedDate);
|
|
44
|
+
const today = isToday(day);
|
|
45
|
+
return /* @__PURE__ */ jsx(
|
|
46
|
+
"button",
|
|
47
|
+
{
|
|
48
|
+
type: "button",
|
|
49
|
+
onClick: () => onSelectDate(day),
|
|
50
|
+
className: cn(
|
|
51
|
+
"w-7 h-7 text-[11px] rounded-full flex items-center justify-center transition-colors",
|
|
52
|
+
!inMonth && "text-muted-foreground/40",
|
|
53
|
+
inMonth && !selected && "hover:bg-accent",
|
|
54
|
+
selected && "bg-primary text-primary-foreground",
|
|
55
|
+
today && !selected && "font-bold text-primary"
|
|
56
|
+
),
|
|
57
|
+
children: format(day, "d")
|
|
58
|
+
},
|
|
59
|
+
day.toISOString()
|
|
60
|
+
);
|
|
61
|
+
})
|
|
62
|
+
] })
|
|
63
|
+
] }),
|
|
64
|
+
categories && categories.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
65
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
67
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold mb-2", children: labels.categories }),
|
|
68
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-1.5", children: categories.map((cat) => /* @__PURE__ */ jsxs(
|
|
69
|
+
"label",
|
|
70
|
+
{
|
|
71
|
+
className: "flex items-center gap-2 py-1 px-1 rounded hover:bg-accent transition-colors cursor-pointer",
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
Checkbox,
|
|
75
|
+
{
|
|
76
|
+
checked: enabledCategories?.includes(cat.key) ?? false,
|
|
77
|
+
onCheckedChange: () => onToggleCategory?.(cat.key)
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx("div", { className: "w-2.5 h-2.5 rounded-full", style: { backgroundColor: cat.color } }),
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: cat.label })
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
cat.key
|
|
85
|
+
)) })
|
|
86
|
+
] })
|
|
87
|
+
] })
|
|
88
|
+
] });
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { CalendarMini };
|
|
92
|
+
//# sourceMappingURL=calendar-mini.js.map
|
|
93
|
+
//# sourceMappingURL=calendar-mini.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/calendar-mini.tsx"],"names":[],"mappings":";;;;;;;AAuCA,IAAM,aAAA,GAA8C;AAAA,EAClD,GAAA,EAAK,KAAA;AAAA,EAAO,GAAA,EAAK,KAAA;AAAA,EAAO,GAAA,EAAK,KAAA;AAAA,EAAO,GAAA,EAAK,KAAA;AAAA,EAAO,GAAA,EAAK,KAAA;AAAA,EAAO,GAAA,EAAK,KAAA;AAAA,EAAO,GAAA,EAAK,KAAA;AAAA,EAC7E,UAAA,EAAY;AACd,CAAA;AAmCO,SAAS,YAAA,CAAa;AAAA,EAC3B,WAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,MAAA,EAAQ;AACV,CAAA,EAAsB;AACpB,EAAA,MAAM,MAAA,GAAS,EAAE,GAAG,aAAA,EAAe,GAAG,UAAA,EAAW;AAEjD,EAAA,MAAM,IAAA,GAAO,QAAQ,MAAM;AACzB,IAAA,MAAM,UAAA,GAAa,aAAa,WAAW,CAAA;AAC3C,IAAA,MAAM,QAAA,GAAW,WAAW,WAAW,CAAA;AACvC,IAAA,MAAM,WAAW,WAAA,CAAY,UAAA,EAAY,EAAE,YAAA,EAAc,GAAG,CAAA;AAC5D,IAAA,MAAM,SAAS,SAAA,CAAU,QAAA,EAAU,EAAE,YAAA,EAAc,GAAG,CAAA;AACtD,IAAA,OAAO,kBAAkB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A;AAAA,UARhC,GAAA,CAAI;AAAA,SAUZ,CAAA,EACH;AAAA,OAAA,EACF;AAAA,KAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ","file":"calendar-mini.js","sourcesContent":["import { useMemo } from 'react';\nimport {\n startOfMonth, endOfMonth, startOfWeek, endOfWeek,\n eachDayOfInterval, isSameMonth, isSameDay, isToday, format,\n} from 'date-fns';\nimport { cn } from '../lib/utils';\nimport { Checkbox } from './checkbox';\nimport { Separator } from './separator';\n\n/** A category that can be toggled on/off in the mini calendar's filter section. */\nexport interface CalendarCategory {\n /** Unique key for this category. */\n key: string;\n /** CSS color string used for the category dot. */\n color: string;\n /** Display label for the category. */\n label: string;\n}\n\n/** Localizable labels for the mini calendar. All have English defaults. */\nexport interface CalendarMiniLabels {\n /** Label for Sunday column header. */\n sun?: string;\n /** Label for Monday column header. */\n mon?: string;\n /** Label for Tuesday column header. */\n tue?: string;\n /** Label for Wednesday column header. */\n wed?: string;\n /** Label for Thursday column header. */\n thu?: string;\n /** Label for Friday column header. */\n fri?: string;\n /** Label for Saturday column header. */\n sat?: string;\n /** Heading text for the categories filter section. */\n categories?: string;\n}\n\nconst defaultLabels: Required<CalendarMiniLabels> = {\n sun: 'Sun', mon: 'Mon', tue: 'Tue', wed: 'Wed', thu: 'Thu', fri: 'Fri', sat: 'Sat',\n categories: 'Categories',\n};\n\nexport interface CalendarMiniProps {\n /** The month to display (any date within the target month). */\n currentDate: Date;\n /** The currently selected date, highlighted with primary color. */\n selectedDate: Date;\n /** Callback when a day cell is clicked. */\n onSelectDate: (date: Date) => void;\n /** Optional list of event categories for the filter section. */\n categories?: CalendarCategory[];\n /** Keys of currently enabled categories. */\n enabledCategories?: string[];\n /** Callback when a category checkbox is toggled. */\n onToggleCategory?: (key: string) => void;\n /** Localizable UI labels with English defaults. */\n labels?: CalendarMiniLabels;\n}\n\n/**\n * Compact month calendar with optional category filters. Designed for sidebar\n * placement in calendar views. Locale-agnostic via the `labels` prop.\n *\n * @example\n * ```tsx\n * <CalendarMini\n * currentDate={new Date()}\n * selectedDate={selectedDate}\n * onSelectDate={setSelectedDate}\n * categories={[{ key: \"meeting\", color: \"#3b82f6\", label: \"Meeting\" }]}\n * enabledCategories={[\"meeting\"]}\n * onToggleCategory={(key) => toggle(key)}\n * />\n * ```\n */\nexport function CalendarMini({\n currentDate,\n selectedDate,\n onSelectDate,\n categories,\n enabledCategories,\n onToggleCategory,\n labels: labelsProp,\n}: CalendarMiniProps) {\n const labels = { ...defaultLabels, ...labelsProp };\n\n const days = useMemo(() => {\n const monthStart = startOfMonth(currentDate);\n const monthEnd = endOfMonth(currentDate);\n const calStart = startOfWeek(monthStart, { weekStartsOn: 0 });\n const calEnd = endOfWeek(monthEnd, { weekStartsOn: 0 });\n return eachDayOfInterval({ start: calStart, end: calEnd });\n }, [currentDate]);\n\n const weekDays = [labels.sun, labels.mon, labels.tue, labels.wed, labels.thu, labels.fri, labels.sat];\n\n return (\n <div className=\"space-y-4\">\n {/* Mini calendar */}\n <div>\n <p className=\"text-sm font-semibold mb-2\">{format(currentDate, 'MMMM yyyy')}</p>\n <div className=\"grid grid-cols-7 gap-0\">\n {weekDays.map(day => (\n <div key={day} className=\"text-center text-[10px] font-medium text-muted-foreground py-1\">\n {day}\n </div>\n ))}\n {days.map(day => {\n const inMonth = isSameMonth(day, currentDate);\n const selected = isSameDay(day, selectedDate);\n const today = isToday(day);\n return (\n <button\n key={day.toISOString()}\n type=\"button\"\n onClick={() => onSelectDate(day)}\n className={cn(\n 'w-7 h-7 text-[11px] rounded-full flex items-center justify-center transition-colors',\n !inMonth && 'text-muted-foreground/40',\n inMonth && !selected && 'hover:bg-accent',\n selected && 'bg-primary text-primary-foreground',\n today && !selected && 'font-bold text-primary',\n )}\n >\n {format(day, 'd')}\n </button>\n );\n })}\n </div>\n </div>\n\n {categories && categories.length > 0 && (\n <>\n <Separator />\n {/* Category filters */}\n <div>\n <p className=\"text-sm font-semibold mb-2\">{labels.categories}</p>\n <div className=\"space-y-1.5\">\n {categories.map(cat => (\n <label\n key={cat.key}\n className=\"flex items-center gap-2 py-1 px-1 rounded hover:bg-accent transition-colors cursor-pointer\"\n >\n <Checkbox\n checked={enabledCategories?.includes(cat.key) ?? false}\n onCheckedChange={() => onToggleCategory?.(cat.key)}\n />\n <div className=\"w-2.5 h-2.5 rounded-full\" style={{ backgroundColor: cat.color }} />\n <span className=\"text-sm\">{cat.label}</span>\n </label>\n ))}\n </div>\n </div>\n </>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/** Supported calendar view modes. */
|
|
4
|
+
type CalendarView = 'month' | 'week' | 'day';
|
|
5
|
+
/** Localizable labels for the calendar toolbar. All have English defaults. */
|
|
6
|
+
interface CalendarToolbarLabels {
|
|
7
|
+
/** Label for the "Today" button. */
|
|
8
|
+
today?: string;
|
|
9
|
+
/** Label for the "Month" view toggle. */
|
|
10
|
+
month?: string;
|
|
11
|
+
/** Label for the "Week" view toggle. */
|
|
12
|
+
week?: string;
|
|
13
|
+
/** Label for the "Day" view toggle. */
|
|
14
|
+
day?: string;
|
|
15
|
+
/** Label for the "Create Event" button. */
|
|
16
|
+
createEvent?: string;
|
|
17
|
+
}
|
|
18
|
+
interface CalendarToolbarProps {
|
|
19
|
+
/** The date currently being viewed. Used for the title display. */
|
|
20
|
+
currentDate: Date;
|
|
21
|
+
/** The active calendar view mode. */
|
|
22
|
+
view: CalendarView;
|
|
23
|
+
/** Callback when the user switches between month/week/day views. */
|
|
24
|
+
onViewChange: (view: CalendarView) => void;
|
|
25
|
+
/** Navigate to the previous period. */
|
|
26
|
+
onPrev: () => void;
|
|
27
|
+
/** Navigate to the next period. */
|
|
28
|
+
onNext: () => void;
|
|
29
|
+
/** Navigate to today. */
|
|
30
|
+
onToday: () => void;
|
|
31
|
+
/** Optional callback for the "Create Event" button. Button is hidden when omitted. */
|
|
32
|
+
onCreateEvent?: () => void;
|
|
33
|
+
/** Localizable UI labels with English defaults. */
|
|
34
|
+
labels?: CalendarToolbarLabels;
|
|
35
|
+
/** date-fns format string for the title. Defaults to `"MMMM yyyy"` or `"EEEE, MMMM d, yyyy"` for day view. */
|
|
36
|
+
titleFormat?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Toolbar for calendar views with navigation controls (prev/next/today),
|
|
40
|
+
* view mode toggle (month/week/day), and an optional "Create Event" button.
|
|
41
|
+
* Locale-agnostic via the `labels` prop.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* <CalendarToolbar
|
|
46
|
+
* currentDate={currentDate}
|
|
47
|
+
* view="month"
|
|
48
|
+
* onViewChange={setView}
|
|
49
|
+
* onPrev={handlePrev}
|
|
50
|
+
* onNext={handleNext}
|
|
51
|
+
* onToday={handleToday}
|
|
52
|
+
* onCreateEvent={() => setDialogOpen(true)}
|
|
53
|
+
* />
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
declare function CalendarToolbar({ currentDate, view, onViewChange, onPrev, onNext, onToday, onCreateEvent, labels: labelsProp, titleFormat: titleFormatProp, }: CalendarToolbarProps): react_jsx_runtime.JSX.Element;
|
|
57
|
+
|
|
58
|
+
export { CalendarToolbar, type CalendarToolbarLabels, type CalendarToolbarProps, type CalendarView };
|