@mohou/ui 1.0.20
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 +10 -0
- package/lib/types/blocks/activity-feed.d.ts +12 -0
- package/lib/types/blocks/activity-feed.d.ts.map +1 -0
- package/lib/types/blocks/app-shell.d.ts +17 -0
- package/lib/types/blocks/app-shell.d.ts.map +1 -0
- package/lib/types/blocks/attachment-gallery.d.ts +15 -0
- package/lib/types/blocks/attachment-gallery.d.ts.map +1 -0
- package/lib/types/blocks/bar-chart.d.ts +19 -0
- package/lib/types/blocks/bar-chart.d.ts.map +1 -0
- package/lib/types/blocks/comment-thread.d.ts +17 -0
- package/lib/types/blocks/comment-thread.d.ts.map +1 -0
- package/lib/types/blocks/dashboard-shell.d.ts +35 -0
- package/lib/types/blocks/dashboard-shell.d.ts.map +1 -0
- package/lib/types/blocks/description-list.d.ts +14 -0
- package/lib/types/blocks/description-list.d.ts.map +1 -0
- package/lib/types/blocks/detail-panel.d.ts +16 -0
- package/lib/types/blocks/detail-panel.d.ts.map +1 -0
- package/lib/types/blocks/donut-chart.d.ts +21 -0
- package/lib/types/blocks/donut-chart.d.ts.map +1 -0
- package/lib/types/blocks/env-badge.d.ts +11 -0
- package/lib/types/blocks/env-badge.d.ts.map +1 -0
- package/lib/types/blocks/env-table.d.ts +29 -0
- package/lib/types/blocks/env-table.d.ts.map +1 -0
- package/lib/types/blocks/file-tree.d.ts +12 -0
- package/lib/types/blocks/file-tree.d.ts.map +1 -0
- package/lib/types/blocks/filter-bar.d.ts +15 -0
- package/lib/types/blocks/filter-bar.d.ts.map +1 -0
- package/lib/types/blocks/form-sheet.d.ts +47 -0
- package/lib/types/blocks/form-sheet.d.ts.map +1 -0
- package/lib/types/blocks/gauge.d.ts +14 -0
- package/lib/types/blocks/gauge.d.ts.map +1 -0
- package/lib/types/blocks/list-detail.d.ts +42 -0
- package/lib/types/blocks/list-detail.d.ts.map +1 -0
- package/lib/types/blocks/notification-center.d.ts +16 -0
- package/lib/types/blocks/notification-center.d.ts.map +1 -0
- package/lib/types/blocks/page-header.d.ts +15 -0
- package/lib/types/blocks/page-header.d.ts.map +1 -0
- package/lib/types/blocks/progress-ring.d.ts +13 -0
- package/lib/types/blocks/progress-ring.d.ts.map +1 -0
- package/lib/types/blocks/radar-chart.d.ts +19 -0
- package/lib/types/blocks/radar-chart.d.ts.map +1 -0
- package/lib/types/blocks/request-inspector.d.ts +14 -0
- package/lib/types/blocks/request-inspector.d.ts.map +1 -0
- package/lib/types/blocks/reveal.d.ts +30 -0
- package/lib/types/blocks/reveal.d.ts.map +1 -0
- package/lib/types/blocks/run-timeline.d.ts +12 -0
- package/lib/types/blocks/run-timeline.d.ts.map +1 -0
- package/lib/types/blocks/scrollspy.d.ts +15 -0
- package/lib/types/blocks/scrollspy.d.ts.map +1 -0
- package/lib/types/blocks/settings-split.d.ts +47 -0
- package/lib/types/blocks/settings-split.d.ts.map +1 -0
- package/lib/types/blocks/severity-chip.d.ts +23 -0
- package/lib/types/blocks/severity-chip.d.ts.map +1 -0
- package/lib/types/blocks/sparkline.d.ts +14 -0
- package/lib/types/blocks/sparkline.d.ts.map +1 -0
- package/lib/types/blocks/stat-card.d.ts +17 -0
- package/lib/types/blocks/stat-card.d.ts.map +1 -0
- package/lib/types/blocks/status-badge.d.ts +21 -0
- package/lib/types/blocks/status-badge.d.ts.map +1 -0
- package/lib/types/blocks/table-page.d.ts +35 -0
- package/lib/types/blocks/table-page.d.ts.map +1 -0
- package/lib/types/blocks/terminal.d.ts +12 -0
- package/lib/types/blocks/terminal.d.ts.map +1 -0
- package/lib/types/blocks/test-step-list.d.ts +17 -0
- package/lib/types/blocks/test-step-list.d.ts.map +1 -0
- package/lib/types/blocks/trend-card.d.ts +20 -0
- package/lib/types/blocks/trend-card.d.ts.map +1 -0
- package/lib/types/blocks/wizard-shell.d.ts +47 -0
- package/lib/types/blocks/wizard-shell.d.ts.map +1 -0
- package/lib/types/components/accordion.d.ts +14 -0
- package/lib/types/components/accordion.d.ts.map +1 -0
- package/lib/types/components/alert-dialog.d.ts +26 -0
- package/lib/types/components/alert-dialog.d.ts.map +1 -0
- package/lib/types/components/alert.d.ts +18 -0
- package/lib/types/components/alert.d.ts.map +1 -0
- package/lib/types/components/aspect-ratio.d.ts +9 -0
- package/lib/types/components/aspect-ratio.d.ts.map +1 -0
- package/lib/types/components/attachment.d.ts +28 -0
- package/lib/types/components/attachment.d.ts.map +1 -0
- package/lib/types/components/avatar.d.ts +16 -0
- package/lib/types/components/avatar.d.ts.map +1 -0
- package/lib/types/components/badge.d.ts +15 -0
- package/lib/types/components/badge.d.ts.map +1 -0
- package/lib/types/components/breadcrumb.d.ts +15 -0
- package/lib/types/components/breadcrumb.d.ts.map +1 -0
- package/lib/types/components/bubble.d.ts +21 -0
- package/lib/types/components/bubble.d.ts.map +1 -0
- package/lib/types/components/button-group.d.ts +17 -0
- package/lib/types/components/button-group.d.ts.map +1 -0
- package/lib/types/components/button.d.ts +16 -0
- package/lib/types/components/button.d.ts.map +1 -0
- package/lib/types/components/calendar.d.ts +15 -0
- package/lib/types/components/calendar.d.ts.map +1 -0
- package/lib/types/components/card.d.ts +19 -0
- package/lib/types/components/card.d.ts.map +1 -0
- package/lib/types/components/chart.d.ts +52 -0
- package/lib/types/components/chart.d.ts.map +1 -0
- package/lib/types/components/checkbox.d.ts +9 -0
- package/lib/types/components/checkbox.d.ts.map +1 -0
- package/lib/types/components/collapsible.d.ts +10 -0
- package/lib/types/components/collapsible.d.ts.map +1 -0
- package/lib/types/components/combobox.d.ts +29 -0
- package/lib/types/components/combobox.d.ts.map +1 -0
- package/lib/types/components/command.d.ts +26 -0
- package/lib/types/components/command.d.ts.map +1 -0
- package/lib/types/components/context-menu.d.ts +34 -0
- package/lib/types/components/context-menu.d.ts.map +1 -0
- package/lib/types/components/dialog.d.ts +30 -0
- package/lib/types/components/dialog.d.ts.map +1 -0
- package/lib/types/components/drawer.d.ts +21 -0
- package/lib/types/components/drawer.d.ts.map +1 -0
- package/lib/types/components/dropdown-menu.d.ts +37 -0
- package/lib/types/components/dropdown-menu.d.ts.map +1 -0
- package/lib/types/components/empty.d.ts +24 -0
- package/lib/types/components/empty.d.ts.map +1 -0
- package/lib/types/components/field.d.ts +31 -0
- package/lib/types/components/field.d.ts.map +1 -0
- package/lib/types/components/hover-card.d.ts +10 -0
- package/lib/types/components/hover-card.d.ts.map +1 -0
- package/lib/types/components/input-group.d.ts +23 -0
- package/lib/types/components/input-group.d.ts.map +1 -0
- package/lib/types/components/input.d.ts +11 -0
- package/lib/types/components/input.d.ts.map +1 -0
- package/lib/types/components/item.d.ts +27 -0
- package/lib/types/components/item.d.ts.map +1 -0
- package/lib/types/components/kbd.d.ts +8 -0
- package/lib/types/components/kbd.d.ts.map +1 -0
- package/lib/types/components/label.d.ts +11 -0
- package/lib/types/components/label.d.ts.map +1 -0
- package/lib/types/components/marker.d.ts +15 -0
- package/lib/types/components/marker.d.ts.map +1 -0
- package/lib/types/components/menubar.d.ts +34 -0
- package/lib/types/components/menubar.d.ts.map +1 -0
- package/lib/types/components/message-scroller.d.ts +15 -0
- package/lib/types/components/message-scroller.d.ts.map +1 -0
- package/lib/types/components/message.d.ts +15 -0
- package/lib/types/components/message.d.ts.map +1 -0
- package/lib/types/components/native-select.d.ts +13 -0
- package/lib/types/components/native-select.d.ts.map +1 -0
- package/lib/types/components/navigation-menu.d.ts +16 -0
- package/lib/types/components/navigation-menu.d.ts.map +1 -0
- package/lib/types/components/pagination.d.ts +22 -0
- package/lib/types/components/pagination.d.ts.map +1 -0
- package/lib/types/components/popover.d.ts +17 -0
- package/lib/types/components/popover.d.ts.map +1 -0
- package/lib/types/components/progress.d.ts +15 -0
- package/lib/types/components/progress.d.ts.map +1 -0
- package/lib/types/components/questionnaire.d.ts +24 -0
- package/lib/types/components/questionnaire.d.ts.map +1 -0
- package/lib/types/components/radio-group.d.ts +10 -0
- package/lib/types/components/radio-group.d.ts.map +1 -0
- package/lib/types/components/resizable.d.ts +15 -0
- package/lib/types/components/resizable.d.ts.map +1 -0
- package/lib/types/components/scroll-area.d.ts +9 -0
- package/lib/types/components/scroll-area.d.ts.map +1 -0
- package/lib/types/components/select.d.ts +23 -0
- package/lib/types/components/select.d.ts.map +1 -0
- package/lib/types/components/separator.d.ts +9 -0
- package/lib/types/components/separator.d.ts.map +1 -0
- package/lib/types/components/sheet.d.ts +28 -0
- package/lib/types/components/sheet.d.ts.map +1 -0
- package/lib/types/components/sidebar.d.ts +68 -0
- package/lib/types/components/sidebar.d.ts.map +1 -0
- package/lib/types/components/skeleton.d.ts +10 -0
- package/lib/types/components/skeleton.d.ts.map +1 -0
- package/lib/types/components/slider.d.ts +8 -0
- package/lib/types/components/slider.d.ts.map +1 -0
- package/lib/types/components/spinner.d.ts +9 -0
- package/lib/types/components/spinner.d.ts.map +1 -0
- package/lib/types/components/switch.d.ts +13 -0
- package/lib/types/components/switch.d.ts.map +1 -0
- package/lib/types/components/table.d.ts +18 -0
- package/lib/types/components/table.d.ts.map +1 -0
- package/lib/types/components/tabs.d.ts +18 -0
- package/lib/types/components/tabs.d.ts.map +1 -0
- package/lib/types/components/textarea.d.ts +11 -0
- package/lib/types/components/textarea.d.ts.map +1 -0
- package/lib/types/components/toast.d.ts +35 -0
- package/lib/types/components/toast.d.ts.map +1 -0
- package/lib/types/components/toggle-group.d.ts +16 -0
- package/lib/types/components/toggle-group.d.ts.map +1 -0
- package/lib/types/components/toggle.d.ts +13 -0
- package/lib/types/components/toggle.d.ts.map +1 -0
- package/lib/types/components/tooltip.d.ts +14 -0
- package/lib/types/components/tooltip.d.ts.map +1 -0
- package/lib/types/composites/autocomplete.d.ts +15 -0
- package/lib/types/composites/autocomplete.d.ts.map +1 -0
- package/lib/types/composites/cascader.d.ts +18 -0
- package/lib/types/composites/cascader.d.ts.map +1 -0
- package/lib/types/composites/color-picker.d.ts +12 -0
- package/lib/types/composites/color-picker.d.ts.map +1 -0
- package/lib/types/composites/confirm-dialog.d.ts +17 -0
- package/lib/types/composites/confirm-dialog.d.ts.map +1 -0
- package/lib/types/composites/copyable.d.ts +12 -0
- package/lib/types/composites/copyable.d.ts.map +1 -0
- package/lib/types/composites/currency-input.d.ts +13 -0
- package/lib/types/composites/currency-input.d.ts.map +1 -0
- package/lib/types/composites/date-chrome.d.ts +8 -0
- package/lib/types/composites/date-chrome.d.ts.map +1 -0
- package/lib/types/composites/date-picker.d.ts +17 -0
- package/lib/types/composites/date-picker.d.ts.map +1 -0
- package/lib/types/composites/date-range-picker.d.ts +18 -0
- package/lib/types/composites/date-range-picker.d.ts.map +1 -0
- package/lib/types/composites/date-time-picker.d.ts +18 -0
- package/lib/types/composites/date-time-picker.d.ts.map +1 -0
- package/lib/types/composites/date-time-range-picker.d.ts +17 -0
- package/lib/types/composites/date-time-range-picker.d.ts.map +1 -0
- package/lib/types/composites/duration-input.d.ts +14 -0
- package/lib/types/composites/duration-input.d.ts.map +1 -0
- package/lib/types/composites/live-refresh.d.ts +46 -0
- package/lib/types/composites/live-refresh.d.ts.map +1 -0
- package/lib/types/composites/mini-calendar.d.ts +13 -0
- package/lib/types/composites/mini-calendar.d.ts.map +1 -0
- package/lib/types/composites/number-field.d.ts +15 -0
- package/lib/types/composites/number-field.d.ts.map +1 -0
- package/lib/types/composites/password-field.d.ts +13 -0
- package/lib/types/composites/password-field.d.ts.map +1 -0
- package/lib/types/composites/phone-input.d.ts +12 -0
- package/lib/types/composites/phone-input.d.ts.map +1 -0
- package/lib/types/composites/rating.d.ts +13 -0
- package/lib/types/composites/rating.d.ts.map +1 -0
- package/lib/types/composites/relative-date-picker.d.ts +16 -0
- package/lib/types/composites/relative-date-picker.d.ts.map +1 -0
- package/lib/types/composites/search-input.d.ts +16 -0
- package/lib/types/composites/search-input.d.ts.map +1 -0
- package/lib/types/composites/slider-range.d.ts +14 -0
- package/lib/types/composites/slider-range.d.ts.map +1 -0
- package/lib/types/composites/tag-input.d.ts +14 -0
- package/lib/types/composites/tag-input.d.ts.map +1 -0
- package/lib/types/composites/time-picker.d.ts +28 -0
- package/lib/types/composites/time-picker.d.ts.map +1 -0
- package/lib/types/composites/time-range-picker.d.ts +16 -0
- package/lib/types/composites/time-range-picker.d.ts.map +1 -0
- package/lib/types/composites/timezone-select.d.ts +22 -0
- package/lib/types/composites/timezone-select.d.ts.map +1 -0
- package/lib/types/composites/transfer.d.ts +17 -0
- package/lib/types/composites/transfer.d.ts.map +1 -0
- package/lib/types/composites/user-picker.d.ts +17 -0
- package/lib/types/composites/user-picker.d.ts.map +1 -0
- package/lib/types/hooks/use-html-dark.d.ts +4 -0
- package/lib/types/hooks/use-html-dark.d.ts.map +1 -0
- package/lib/types/hooks/use-mobile.d.ts +2 -0
- package/lib/types/hooks/use-mobile.d.ts.map +1 -0
- package/lib/types/i18n/context.d.ts +310 -0
- package/lib/types/i18n/context.d.ts.map +1 -0
- package/lib/types/i18n/en.d.ts +290 -0
- package/lib/types/i18n/en.d.ts.map +1 -0
- package/lib/types/i18n/zh.d.ts +3 -0
- package/lib/types/i18n/zh.d.ts.map +1 -0
- package/lib/types/index.d.ts +151 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/lib/clipboard.d.ts +3 -0
- package/lib/types/lib/clipboard.d.ts.map +1 -0
- package/lib/types/lib/defined.d.ts +3 -0
- package/lib/types/lib/defined.d.ts.map +1 -0
- package/lib/types/lib/icons.d.ts +16 -0
- package/lib/types/lib/icons.d.ts.map +1 -0
- package/lib/types/lib/illustrations.d.ts +18 -0
- package/lib/types/lib/illustrations.d.ts.map +1 -0
- package/lib/types/lib/utils.d.ts +3 -0
- package/lib/types/lib/utils.d.ts.map +1 -0
- package/lib/types/products/cells.d.ts +13 -0
- package/lib/types/products/cells.d.ts.map +1 -0
- package/lib/types/products/code-block.d.ts +14 -0
- package/lib/types/products/code-block.d.ts.map +1 -0
- package/lib/types/products/code-editor.d.ts +21 -0
- package/lib/types/products/code-editor.d.ts.map +1 -0
- package/lib/types/products/commit-graph.d.ts +38 -0
- package/lib/types/products/commit-graph.d.ts.map +1 -0
- package/lib/types/products/data-grid.d.ts +79 -0
- package/lib/types/products/data-grid.d.ts.map +1 -0
- package/lib/types/products/diff-viewer.d.ts +15 -0
- package/lib/types/products/diff-viewer.d.ts.map +1 -0
- package/lib/types/products/event-calendar.d.ts +23 -0
- package/lib/types/products/event-calendar.d.ts.map +1 -0
- package/lib/types/products/export-csv.d.ts +2 -0
- package/lib/types/products/export-csv.d.ts.map +1 -0
- package/lib/types/products/file-dropzone.d.ts +12 -0
- package/lib/types/products/file-dropzone.d.ts.map +1 -0
- package/lib/types/products/full-calendar/animations.d.ts +12 -0
- package/lib/types/products/full-calendar/animations.d.ts.map +1 -0
- package/lib/types/products/full-calendar/calendar-body.d.ts +2 -0
- package/lib/types/products/full-calendar/calendar-body.d.ts.map +1 -0
- package/lib/types/products/full-calendar/constants.d.ts +3 -0
- package/lib/types/products/full-calendar/constants.d.ts.map +1 -0
- package/lib/types/products/full-calendar/contexts/calendar-context.d.ts +42 -0
- package/lib/types/products/full-calendar/contexts/calendar-context.d.ts.map +1 -0
- package/lib/types/products/full-calendar/contexts/dnd-context.d.ts +16 -0
- package/lib/types/products/full-calendar/contexts/dnd-context.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dialogs/add-edit-event-dialog.d.ts +21 -0
- package/lib/types/products/full-calendar/dialogs/add-edit-event-dialog.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dialogs/delete-event-dialog.d.ts +4 -0
- package/lib/types/products/full-calendar/dialogs/delete-event-dialog.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dialogs/event-details-dialog.d.ts +7 -0
- package/lib/types/products/full-calendar/dialogs/event-details-dialog.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dialogs/events-list-dialog.d.ts +9 -0
- package/lib/types/products/full-calendar/dialogs/events-list-dialog.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dnd/draggable-event.d.ts +11 -0
- package/lib/types/products/full-calendar/dnd/draggable-event.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dnd/droppable-area.d.ts +11 -0
- package/lib/types/products/full-calendar/dnd/droppable-area.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dnd/resizable-event.d.ts +10 -0
- package/lib/types/products/full-calendar/dnd/resizable-event.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/calendar-header.d.ts +2 -0
- package/lib/types/products/full-calendar/header/calendar-header.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/date-navigator.d.ts +9 -0
- package/lib/types/products/full-calendar/header/date-navigator.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/filter.d.ts +2 -0
- package/lib/types/products/full-calendar/header/filter.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/today-button.d.ts +2 -0
- package/lib/types/products/full-calendar/header/today-button.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/user-select.d.ts +2 -0
- package/lib/types/products/full-calendar/header/user-select.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/view-tabs.d.ts +4 -0
- package/lib/types/products/full-calendar/header/view-tabs.d.ts.map +1 -0
- package/lib/types/products/full-calendar/helpers.d.ts +42 -0
- package/lib/types/products/full-calendar/helpers.d.ts.map +1 -0
- package/lib/types/products/full-calendar/hooks/use-time-range-create.d.ts +25 -0
- package/lib/types/products/full-calendar/hooks/use-time-range-create.d.ts.map +1 -0
- package/lib/types/products/full-calendar/hooks.d.ts +11 -0
- package/lib/types/products/full-calendar/hooks.d.ts.map +1 -0
- package/lib/types/products/full-calendar/interfaces.d.ts +21 -0
- package/lib/types/products/full-calendar/interfaces.d.ts.map +1 -0
- package/lib/types/products/full-calendar/settings/settings.d.ts +2 -0
- package/lib/types/products/full-calendar/settings/settings.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/avatar-group.d.ts +7 -0
- package/lib/types/products/full-calendar/shims/avatar-group.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/day-picker.d.ts +2 -0
- package/lib/types/products/full-calendar/shims/day-picker.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/motion.d.ts +32 -0
- package/lib/types/products/full-calendar/shims/motion.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/next-themes.d.ts +5 -0
- package/lib/types/products/full-calendar/shims/next-themes.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/re-resizable.d.ts +19 -0
- package/lib/types/products/full-calendar/shims/re-resizable.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/sonner.d.ts +5 -0
- package/lib/types/products/full-calendar/shims/sonner.d.ts.map +1 -0
- package/lib/types/products/full-calendar/types.d.ts +3 -0
- package/lib/types/products/full-calendar/types.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/agenda-view/agenda-events.d.ts +3 -0
- package/lib/types/products/full-calendar/views/agenda-view/agenda-events.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/month-view/calendar-month-view.d.ts +8 -0
- package/lib/types/products/full-calendar/views/month-view/calendar-month-view.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/month-view/day-cell.d.ts +12 -0
- package/lib/types/products/full-calendar/views/month-view/day-cell.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/month-view/event-bullet.d.ts +6 -0
- package/lib/types/products/full-calendar/views/month-view/event-bullet.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/month-view/month-event-badge.d.ts +17 -0
- package/lib/types/products/full-calendar/views/month-view/month-event-badge.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-day-view.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-day-view.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-time-line.d.ts +2 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-time-line.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-week-view.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-week-view.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/day-view-multi-day-events-row.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/day-view-multi-day-events-row.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/event-block.d.ts +12 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/event-block.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/render-grouped-events.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/render-grouped-events.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/week-view-multi-day-events-row.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/week-view-multi-day-events-row.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/year-view/calendar-year-view.d.ts +8 -0
- package/lib/types/products/full-calendar/views/year-view/calendar-year-view.d.ts.map +1 -0
- package/lib/types/products/gantt.d.ts +17 -0
- package/lib/types/products/gantt.d.ts.map +1 -0
- package/lib/types/products/jira-wiki-parse.d.ts +55 -0
- package/lib/types/products/jira-wiki-parse.d.ts.map +1 -0
- package/lib/types/products/jira-wiki.d.ts +39 -0
- package/lib/types/products/jira-wiki.d.ts.map +1 -0
- package/lib/types/products/jql-input.d.ts +22 -0
- package/lib/types/products/jql-input.d.ts.map +1 -0
- package/lib/types/products/json-viewer.d.ts +12 -0
- package/lib/types/products/json-viewer.d.ts.map +1 -0
- package/lib/types/products/kanban-issue-panel.d.ts +15 -0
- package/lib/types/products/kanban-issue-panel.d.ts.map +1 -0
- package/lib/types/products/kanban.d.ts +43 -0
- package/lib/types/products/kanban.d.ts.map +1 -0
- package/lib/types/products/log-viewer.d.ts +25 -0
- package/lib/types/products/log-viewer.d.ts.map +1 -0
- package/lib/types/products/markdown-editor.d.ts +16 -0
- package/lib/types/products/markdown-editor.d.ts.map +1 -0
- package/lib/types/products/markdown.d.ts +13 -0
- package/lib/types/products/markdown.d.ts.map +1 -0
- package/lib/types/products/rich-text-editor.d.ts +13 -0
- package/lib/types/products/rich-text-editor.d.ts.map +1 -0
- package/lib/types/products/sortable-list.d.ts +16 -0
- package/lib/types/products/sortable-list.d.ts.map +1 -0
- package/lib/types/products/stepper.d.ts +39 -0
- package/lib/types/products/stepper.d.ts.map +1 -0
- package/lib/types/products/timeline.d.ts +17 -0
- package/lib/types/products/timeline.d.ts.map +1 -0
- package/lib/types/products/tree-view.d.ts +17 -0
- package/lib/types/products/tree-view.d.ts.map +1 -0
- package/lib/types/sdk/app-error-boundary.d.ts +33 -0
- package/lib/types/sdk/app-error-boundary.d.ts.map +1 -0
- package/lib/types/sdk/app-id.d.ts +6 -0
- package/lib/types/sdk/app-id.d.ts.map +1 -0
- package/lib/types/sdk/use-app.d.ts +32 -0
- package/lib/types/sdk/use-app.d.ts.map +1 -0
- package/package.json +67 -0
- package/src/blocks/activity-feed.tsx +16 -0
- package/src/blocks/app-shell.tsx +38 -0
- package/src/blocks/attachment-gallery.tsx +36 -0
- package/src/blocks/bar-chart.tsx +46 -0
- package/src/blocks/comment-thread.tsx +37 -0
- package/src/blocks/dashboard-shell.tsx +108 -0
- package/src/blocks/description-list.tsx +23 -0
- package/src/blocks/detail-panel.tsx +43 -0
- package/src/blocks/donut-chart.tsx +54 -0
- package/src/blocks/env-badge.tsx +30 -0
- package/src/blocks/env-table.tsx +315 -0
- package/src/blocks/file-tree.tsx +12 -0
- package/src/blocks/filter-bar.tsx +22 -0
- package/src/blocks/form-sheet.tsx +159 -0
- package/src/blocks/gauge.tsx +36 -0
- package/src/blocks/list-detail.tsx +120 -0
- package/src/blocks/notification-center.tsx +29 -0
- package/src/blocks/page-header.tsx +31 -0
- package/src/blocks/progress-ring.tsx +43 -0
- package/src/blocks/radar-chart.tsx +47 -0
- package/src/blocks/request-inspector.tsx +41 -0
- package/src/blocks/reveal.tsx +56 -0
- package/src/blocks/run-timeline.tsx +12 -0
- package/src/blocks/scrollspy.tsx +48 -0
- package/src/blocks/settings-split.tsx +153 -0
- package/src/blocks/severity-chip.tsx +34 -0
- package/src/blocks/sparkline.tsx +27 -0
- package/src/blocks/stat-card.tsx +50 -0
- package/src/blocks/status-badge.tsx +40 -0
- package/src/blocks/table-page.tsx +82 -0
- package/src/blocks/terminal.tsx +28 -0
- package/src/blocks/test-step-list.tsx +26 -0
- package/src/blocks/trend-card.tsx +57 -0
- package/src/blocks/wizard-shell.tsx +131 -0
- package/src/cdn-modules.d.ts +5 -0
- package/src/components/accordion.tsx +79 -0
- package/src/components/alert-dialog.tsx +192 -0
- package/src/components/alert.tsx +83 -0
- package/src/components/aspect-ratio.tsx +26 -0
- package/src/components/attachment.tsx +211 -0
- package/src/components/avatar.tsx +111 -0
- package/src/components/badge.tsx +59 -0
- package/src/components/breadcrumb.tsx +129 -0
- package/src/components/bubble.tsx +132 -0
- package/src/components/button-group.tsx +93 -0
- package/src/components/button.tsx +65 -0
- package/src/components/calendar.tsx +224 -0
- package/src/components/card.tsx +110 -0
- package/src/components/chart.tsx +378 -0
- package/src/components/checkbox.tsx +33 -0
- package/src/components/collapsible.tsx +23 -0
- package/src/components/combobox.tsx +299 -0
- package/src/components/command.tsx +201 -0
- package/src/components/context-menu.tsx +274 -0
- package/src/components/dialog.tsx +179 -0
- package/src/components/drawer.tsx +230 -0
- package/src/components/dropdown-menu.tsx +274 -0
- package/src/components/empty.tsx +130 -0
- package/src/components/field.tsx +242 -0
- package/src/components/hover-card.tsx +53 -0
- package/src/components/input-group.tsx +161 -0
- package/src/components/input.tsx +27 -0
- package/src/components/item.tsx +205 -0
- package/src/components/kbd.tsx +30 -0
- package/src/components/label.tsx +26 -0
- package/src/components/marker.tsx +75 -0
- package/src/components/menubar.tsx +283 -0
- package/src/components/message-scroller.tsx +133 -0
- package/src/components/message.tsx +96 -0
- package/src/components/native-select.tsx +65 -0
- package/src/components/navigation-menu.tsx +172 -0
- package/src/components/pagination.tsx +138 -0
- package/src/components/popover.tsx +95 -0
- package/src/components/progress.tsx +89 -0
- package/src/components/questionnaire.tsx +332 -0
- package/src/components/radio-group.tsx +40 -0
- package/src/components/resizable.tsx +56 -0
- package/src/components/scroll-area.tsx +56 -0
- package/src/components/select.tsx +207 -0
- package/src/components/separator.tsx +28 -0
- package/src/components/sheet.tsx +158 -0
- package/src/components/sidebar.tsx +725 -0
- package/src/components/skeleton.tsx +20 -0
- package/src/components/slider.tsx +56 -0
- package/src/components/spinner.tsx +16 -0
- package/src/components/switch.tsx +38 -0
- package/src/components/table.tsx +121 -0
- package/src/components/tabs.tsx +88 -0
- package/src/components/textarea.tsx +25 -0
- package/src/components/toast.tsx +273 -0
- package/src/components/toggle-group.tsx +92 -0
- package/src/components/toggle.tsx +47 -0
- package/src/components/tooltip.tsx +72 -0
- package/src/composites/autocomplete.tsx +61 -0
- package/src/composites/cascader.tsx +52 -0
- package/src/composites/color-picker.tsx +25 -0
- package/src/composites/confirm-dialog.tsx +62 -0
- package/src/composites/copyable.tsx +44 -0
- package/src/composites/currency-input.tsx +37 -0
- package/src/composites/date-chrome.tsx +156 -0
- package/src/composites/date-picker.tsx +97 -0
- package/src/composites/date-range-picker.tsx +99 -0
- package/src/composites/date-time-picker.tsx +121 -0
- package/src/composites/date-time-range-picker.tsx +57 -0
- package/src/composites/duration-input.tsx +128 -0
- package/src/composites/live-refresh.tsx +348 -0
- package/src/composites/mini-calendar.tsx +30 -0
- package/src/composites/number-field.tsx +59 -0
- package/src/composites/password-field.tsx +50 -0
- package/src/composites/phone-input.tsx +28 -0
- package/src/composites/rating.tsx +45 -0
- package/src/composites/relative-date-picker.tsx +68 -0
- package/src/composites/search-input.tsx +55 -0
- package/src/composites/slider-range.tsx +36 -0
- package/src/composites/tag-input.tsx +62 -0
- package/src/composites/time-picker.tsx +208 -0
- package/src/composites/time-range-picker.tsx +31 -0
- package/src/composites/timezone-select.tsx +257 -0
- package/src/composites/transfer.tsx +58 -0
- package/src/composites/user-picker.tsx +46 -0
- package/src/hooks/use-html-dark.ts +36 -0
- package/src/hooks/use-mobile.ts +22 -0
- package/src/i18n/context.tsx +71 -0
- package/src/i18n/en.ts +308 -0
- package/src/i18n/zh.ts +290 -0
- package/src/index.ts +151 -0
- package/src/lib/clipboard.ts +10 -0
- package/src/lib/defined.ts +8 -0
- package/src/lib/icons.tsx +16 -0
- package/src/lib/illustrations.tsx +573 -0
- package/src/lib/utils.ts +6 -0
- package/src/products/cells.tsx +18 -0
- package/src/products/code-block.tsx +91 -0
- package/src/products/code-editor.tsx +271 -0
- package/src/products/column-meta.d.ts +9 -0
- package/src/products/commit-graph.tsx +643 -0
- package/src/products/data-grid.tsx +692 -0
- package/src/products/diff-viewer.tsx +224 -0
- package/src/products/event-calendar.tsx +49 -0
- package/src/products/export-csv.ts +26 -0
- package/src/products/file-dropzone.tsx +47 -0
- package/src/products/full-calendar/animations.ts +38 -0
- package/src/products/full-calendar/calendar-body.tsx +76 -0
- package/src/products/full-calendar/constants.ts +10 -0
- package/src/products/full-calendar/contexts/calendar-context.tsx +254 -0
- package/src/products/full-calendar/contexts/dnd-context.tsx +156 -0
- package/src/products/full-calendar/dialogs/add-edit-event-dialog.tsx +186 -0
- package/src/products/full-calendar/dialogs/delete-event-dialog.tsx +39 -0
- package/src/products/full-calendar/dialogs/event-details-dialog.tsx +99 -0
- package/src/products/full-calendar/dialogs/events-list-dialog.tsx +86 -0
- package/src/products/full-calendar/dnd/draggable-event.tsx +45 -0
- package/src/products/full-calendar/dnd/droppable-area.tsx +45 -0
- package/src/products/full-calendar/dnd/resizable-event.tsx +178 -0
- package/src/products/full-calendar/header/calendar-header.tsx +64 -0
- package/src/products/full-calendar/header/date-navigator.tsx +110 -0
- package/src/products/full-calendar/header/filter.tsx +58 -0
- package/src/products/full-calendar/header/today-button.tsx +45 -0
- package/src/products/full-calendar/header/user-select.tsx +64 -0
- package/src/products/full-calendar/header/view-tabs.tsx +36 -0
- package/src/products/full-calendar/helpers.ts +463 -0
- package/src/products/full-calendar/hooks/use-time-range-create.ts +152 -0
- package/src/products/full-calendar/hooks.ts +70 -0
- package/src/products/full-calendar/interfaces.ts +23 -0
- package/src/products/full-calendar/settings/settings.tsx +80 -0
- package/src/products/full-calendar/shims/avatar-group.tsx +16 -0
- package/src/products/full-calendar/shims/day-picker.tsx +1 -0
- package/src/products/full-calendar/shims/motion.tsx +97 -0
- package/src/products/full-calendar/shims/next-themes.ts +6 -0
- package/src/products/full-calendar/shims/re-resizable.tsx +25 -0
- package/src/products/full-calendar/shims/sonner.ts +4 -0
- package/src/products/full-calendar/types.ts +8 -0
- package/src/products/full-calendar/views/agenda-view/agenda-events.tsx +140 -0
- package/src/products/full-calendar/views/month-view/calendar-month-view.tsx +69 -0
- package/src/products/full-calendar/views/month-view/day-cell.tsx +200 -0
- package/src/products/full-calendar/views/month-view/event-bullet.tsx +40 -0
- package/src/products/full-calendar/views/month-view/month-event-badge.tsx +143 -0
- package/src/products/full-calendar/views/week-and-day-view/calendar-day-view.tsx +295 -0
- package/src/products/full-calendar/views/week-and-day-view/calendar-time-line.tsx +35 -0
- package/src/products/full-calendar/views/week-and-day-view/calendar-week-view.tsx +251 -0
- package/src/products/full-calendar/views/week-and-day-view/day-view-multi-day-events-row.tsx +73 -0
- package/src/products/full-calendar/views/week-and-day-view/event-block.tsx +114 -0
- package/src/products/full-calendar/views/week-and-day-view/render-grouped-events.tsx +49 -0
- package/src/products/full-calendar/views/week-and-day-view/week-view-multi-day-events-row.tsx +145 -0
- package/src/products/full-calendar/views/year-view/calendar-year-view.tsx +161 -0
- package/src/products/gantt.tsx +47 -0
- package/src/products/jira-wiki-parse.ts +197 -0
- package/src/products/jira-wiki.tsx +287 -0
- package/src/products/jql-input.tsx +391 -0
- package/src/products/json-viewer.tsx +43 -0
- package/src/products/kanban-issue-panel.tsx +104 -0
- package/src/products/kanban.tsx +245 -0
- package/src/products/log-viewer.tsx +404 -0
- package/src/products/markdown-editor.tsx +77 -0
- package/src/products/markdown.tsx +50 -0
- package/src/products/rich-text-editor.tsx +89 -0
- package/src/products/sortable-list.tsx +67 -0
- package/src/products/stepper.tsx +237 -0
- package/src/products/timeline.tsx +39 -0
- package/src/products/tree-view.tsx +62 -0
- package/src/sdk/app-error-boundary.tsx +240 -0
- package/src/sdk/app-id.ts +7 -0
- package/src/sdk/use-app.ts +43 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { set as setTime } from 'date-fns'
|
|
2
|
+
import { useCallback, useRef, useState, type PointerEvent as ReactPointerEvent } from 'react'
|
|
3
|
+
|
|
4
|
+
import { HOUR_HEIGHT_PX } from '../helpers'
|
|
5
|
+
|
|
6
|
+
export type TimeRangeDraft = {
|
|
7
|
+
start: Date
|
|
8
|
+
end: Date
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type Selection = {
|
|
12
|
+
day: Date
|
|
13
|
+
startMin: number
|
|
14
|
+
endMin: number
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function clamp(n: number, min: number, max: number) {
|
|
18
|
+
return Math.min(max, Math.max(min, n))
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function snapMinutes(raw: number, step = 15) {
|
|
22
|
+
return Math.round(raw / step) * step
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function minutesToDate(day: Date, minutes: number) {
|
|
26
|
+
const h = Math.floor(minutes / 60)
|
|
27
|
+
const m = minutes % 60
|
|
28
|
+
return setTime(day, { hours: h, minutes: m, seconds: 0, milliseconds: 0 })
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Drag on a day column to select a time range (Google Calendar style). */
|
|
32
|
+
export function useTimeRangeCreate() {
|
|
33
|
+
const [selection, setSelection] = useState<Selection | null>(null)
|
|
34
|
+
const [draft, setDraft] = useState<TimeRangeDraft | null>(null)
|
|
35
|
+
const selectionRef = useRef<Selection | null>(null)
|
|
36
|
+
const dragRef = useRef<{
|
|
37
|
+
day: Date
|
|
38
|
+
originMin: number
|
|
39
|
+
moved: boolean
|
|
40
|
+
pointerId: number
|
|
41
|
+
} | null>(null)
|
|
42
|
+
/**
|
|
43
|
+
* Column geometry, captured at pointerdown. While dragging, the column stays
|
|
44
|
+
* connected we re-read its rect (so an ancestor scroll is followed); if the
|
|
45
|
+
* node was replaced by a re-render we keep the last good top. A detached
|
|
46
|
+
* element reports an all-zero DOMRect, and `clientY - 0` counts minutes from
|
|
47
|
+
* the top of the viewport — which drags a few pixels into a multi-hour range.
|
|
48
|
+
*/
|
|
49
|
+
const geomRef = useRef<{ el: HTMLElement; top: number } | null>(null)
|
|
50
|
+
|
|
51
|
+
const updateSelection = useCallback((next: Selection | null) => {
|
|
52
|
+
selectionRef.current = next
|
|
53
|
+
setSelection(next)
|
|
54
|
+
}, [])
|
|
55
|
+
|
|
56
|
+
const yToMinutes = useCallback((clientY: number) => {
|
|
57
|
+
const geom = geomRef.current
|
|
58
|
+
if (!geom) return 0
|
|
59
|
+
// getBoundingClientRect tracks scroll of ancestors; do not add scrollTop again.
|
|
60
|
+
if (geom.el.isConnected) geom.top = geom.el.getBoundingClientRect().top
|
|
61
|
+
return clamp(snapMinutes(((clientY - geom.top) / HOUR_HEIGHT_PX) * 60), 0, 24 * 60)
|
|
62
|
+
}, [])
|
|
63
|
+
|
|
64
|
+
const onPointerDown = useCallback(
|
|
65
|
+
(e: ReactPointerEvent<HTMLElement>, day: Date, columnEl: HTMLElement) => {
|
|
66
|
+
// Only primary button; ignore when starting on an existing event.
|
|
67
|
+
if (e.button !== 0) return
|
|
68
|
+
const target = e.target as HTMLElement | null
|
|
69
|
+
if (target?.closest('[data-calendar-event],button,a,input,textarea')) return
|
|
70
|
+
|
|
71
|
+
e.preventDefault()
|
|
72
|
+
columnEl.setPointerCapture?.(e.pointerId)
|
|
73
|
+
geomRef.current = { el: columnEl, top: columnEl.getBoundingClientRect().top }
|
|
74
|
+
const originMin = yToMinutes(e.clientY)
|
|
75
|
+
dragRef.current = { day, originMin, moved: false, pointerId: e.pointerId }
|
|
76
|
+
updateSelection({ day, startMin: originMin, endMin: originMin + 30 })
|
|
77
|
+
},
|
|
78
|
+
[updateSelection, yToMinutes],
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
const onPointerMove = useCallback(
|
|
82
|
+
(e: ReactPointerEvent<HTMLElement>) => {
|
|
83
|
+
const drag = dragRef.current
|
|
84
|
+
if (!drag || !geomRef.current) return
|
|
85
|
+
const mins = yToMinutes(e.clientY)
|
|
86
|
+
if (Math.abs(mins - drag.originMin) >= 15) drag.moved = true
|
|
87
|
+
const startMin = Math.min(drag.originMin, mins)
|
|
88
|
+
const endMin = Math.max(drag.originMin, mins)
|
|
89
|
+
updateSelection({
|
|
90
|
+
day: drag.day,
|
|
91
|
+
startMin,
|
|
92
|
+
endMin: endMin === startMin ? startMin + 30 : endMin,
|
|
93
|
+
})
|
|
94
|
+
},
|
|
95
|
+
[updateSelection, yToMinutes],
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
const finish = useCallback(() => {
|
|
99
|
+
const drag = dragRef.current
|
|
100
|
+
const sel = selectionRef.current
|
|
101
|
+
dragRef.current = null
|
|
102
|
+
geomRef.current = null
|
|
103
|
+
updateSelection(null)
|
|
104
|
+
if (!drag || !sel) return
|
|
105
|
+
|
|
106
|
+
const startMin = Math.min(sel.startMin, sel.endMin)
|
|
107
|
+
let endMin = Math.max(sel.startMin, sel.endMin)
|
|
108
|
+
// Click without drag → default 30 minutes.
|
|
109
|
+
if (!drag.moved || endMin - startMin < 15) endMin = startMin + 30
|
|
110
|
+
if (endMin > 24 * 60) endMin = 24 * 60
|
|
111
|
+
|
|
112
|
+
setDraft({
|
|
113
|
+
start: minutesToDate(sel.day, startMin),
|
|
114
|
+
end: minutesToDate(sel.day, endMin),
|
|
115
|
+
})
|
|
116
|
+
}, [updateSelection])
|
|
117
|
+
|
|
118
|
+
const onPointerUp = useCallback(
|
|
119
|
+
(e: ReactPointerEvent<HTMLElement>) => {
|
|
120
|
+
if (!dragRef.current) return
|
|
121
|
+
try {
|
|
122
|
+
;(e.currentTarget as HTMLElement).releasePointerCapture?.(e.pointerId)
|
|
123
|
+
} catch {
|
|
124
|
+
/* ignore */
|
|
125
|
+
}
|
|
126
|
+
finish()
|
|
127
|
+
},
|
|
128
|
+
[finish],
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
const clearDraft = useCallback(() => setDraft(null), [])
|
|
132
|
+
|
|
133
|
+
const overlayStyle =
|
|
134
|
+
selection == null
|
|
135
|
+
? null
|
|
136
|
+
: {
|
|
137
|
+
top: (Math.min(selection.startMin, selection.endMin) / 60) * HOUR_HEIGHT_PX,
|
|
138
|
+
height:
|
|
139
|
+
(Math.abs(selection.endMin - selection.startMin) / 60) * HOUR_HEIGHT_PX ||
|
|
140
|
+
HOUR_HEIGHT_PX / 2,
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return {
|
|
144
|
+
selection,
|
|
145
|
+
draft,
|
|
146
|
+
clearDraft,
|
|
147
|
+
overlayStyle,
|
|
148
|
+
onPointerDown,
|
|
149
|
+
onPointerMove,
|
|
150
|
+
onPointerUp,
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
export function useDisclosure({
|
|
4
|
+
defaultIsOpen = false,
|
|
5
|
+
}: {
|
|
6
|
+
defaultIsOpen?: boolean
|
|
7
|
+
} = {}) {
|
|
8
|
+
const [isOpen, setIsOpen] = useState(defaultIsOpen)
|
|
9
|
+
|
|
10
|
+
const onOpen = () => setIsOpen(true)
|
|
11
|
+
const onClose = () => setIsOpen(false)
|
|
12
|
+
const onToggle = () => setIsOpen(currentValue => !currentValue)
|
|
13
|
+
|
|
14
|
+
return { onOpen, onClose, isOpen, onToggle }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const useLocalStorage = <T>(
|
|
18
|
+
key: string,
|
|
19
|
+
initialValue: T,
|
|
20
|
+
): [T, (value: T | ((prev: T) => T)) => void] => {
|
|
21
|
+
const readValue = (): T => {
|
|
22
|
+
if (typeof window === 'undefined') {
|
|
23
|
+
return initialValue
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const item = window.localStorage.getItem(key)
|
|
28
|
+
return item ? (JSON.parse(item) as T) : initialValue
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.warn(`Error reading localStorage key "${key}":`, error)
|
|
31
|
+
return initialValue
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const [storedValue, setStoredValue] = useState<T>(readValue)
|
|
36
|
+
|
|
37
|
+
const setValue = (value: T | ((prev: T) => T)) => {
|
|
38
|
+
try {
|
|
39
|
+
const valueToStore =
|
|
40
|
+
value instanceof Function ? value(storedValue) : value
|
|
41
|
+
setStoredValue(valueToStore)
|
|
42
|
+
if (typeof window !== 'undefined') {
|
|
43
|
+
window.localStorage.setItem(key, JSON.stringify(valueToStore))
|
|
44
|
+
}
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.warn(`Error setting localStorage key "${key}":`, error)
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return [storedValue, setValue]
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export function useMediaQuery(query: string): boolean {
|
|
54
|
+
const [matches, setMatches] = useState(false)
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (typeof window.matchMedia !== 'function') return
|
|
58
|
+
const media = window.matchMedia(query)
|
|
59
|
+
if (media.matches !== matches) {
|
|
60
|
+
setMatches(media.matches)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const listener = () => setMatches(media.matches)
|
|
64
|
+
media.addEventListener('change', listener)
|
|
65
|
+
|
|
66
|
+
return () => media.removeEventListener('change', listener)
|
|
67
|
+
}, [matches, query])
|
|
68
|
+
|
|
69
|
+
return matches
|
|
70
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TEventColor } from './types';
|
|
2
|
+
|
|
3
|
+
export interface IUser {
|
|
4
|
+
id: string
|
|
5
|
+
name: string
|
|
6
|
+
picturePath: string | null
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface IEvent {
|
|
10
|
+
id: number
|
|
11
|
+
startDate: string
|
|
12
|
+
endDate: string
|
|
13
|
+
title: string
|
|
14
|
+
color: TEventColor
|
|
15
|
+
description: string
|
|
16
|
+
user: IUser
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ICalendarCell {
|
|
20
|
+
day: number
|
|
21
|
+
currentMonth: boolean
|
|
22
|
+
date: Date
|
|
23
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { SettingsIcon } from 'lucide-react'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenu,
|
|
5
|
+
DropdownMenuContent,
|
|
6
|
+
DropdownMenuGroup,
|
|
7
|
+
DropdownMenuLabel,
|
|
8
|
+
DropdownMenuRadioGroup,
|
|
9
|
+
DropdownMenuRadioItem,
|
|
10
|
+
DropdownMenuSeparator,
|
|
11
|
+
DropdownMenuTrigger,
|
|
12
|
+
} from '@mohou/ui/components/dropdown-menu'
|
|
13
|
+
import { Input } from '@mohou/ui/components/input'
|
|
14
|
+
import { Switch } from '@mohou/ui/components/switch'
|
|
15
|
+
import { useLabels } from '@mohou/ui/i18n/context'
|
|
16
|
+
|
|
17
|
+
import { MAX_SCROLL_HOUR, MIN_SCROLL_HOUR, useCalendar } from '../contexts/calendar-context'
|
|
18
|
+
|
|
19
|
+
export function Settings() {
|
|
20
|
+
const {
|
|
21
|
+
badgeVariant,
|
|
22
|
+
setBadgeVariant,
|
|
23
|
+
use24HourFormat,
|
|
24
|
+
toggleTimeFormat,
|
|
25
|
+
startOfDayHour,
|
|
26
|
+
setStartOfDayHour,
|
|
27
|
+
agendaModeGroupBy,
|
|
28
|
+
setAgendaModeGroupBy,
|
|
29
|
+
} = useCalendar()
|
|
30
|
+
const t = useLabels('eventCalendar')
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<DropdownMenu>
|
|
34
|
+
<DropdownMenuTrigger
|
|
35
|
+
className="inline-flex size-8 items-center justify-center rounded-lg border border-border bg-background"
|
|
36
|
+
aria-label={t.settingsAria}
|
|
37
|
+
>
|
|
38
|
+
<SettingsIcon className="h-4 w-4" />
|
|
39
|
+
</DropdownMenuTrigger>
|
|
40
|
+
<DropdownMenuContent className="w-56">
|
|
41
|
+
<DropdownMenuGroup>
|
|
42
|
+
<DropdownMenuLabel>{t.settings}</DropdownMenuLabel>
|
|
43
|
+
<div className="flex items-center justify-between gap-2 px-1.5 py-1.5 text-sm">
|
|
44
|
+
<span>{t.useDotBadge}</span>
|
|
45
|
+
<Switch
|
|
46
|
+
checked={badgeVariant === 'dot'}
|
|
47
|
+
onCheckedChange={checked => setBadgeVariant(checked ? 'dot' : 'colored')}
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
<div className="flex items-center justify-between gap-2 px-1.5 py-1.5 text-sm">
|
|
51
|
+
<span>{t.use24Hour}</span>
|
|
52
|
+
<Switch checked={use24HourFormat} onCheckedChange={() => toggleTimeFormat()} />
|
|
53
|
+
</div>
|
|
54
|
+
<div className="flex items-center justify-between gap-2 px-1.5 py-1.5 text-sm">
|
|
55
|
+
<span>{t.scrollHour}</span>
|
|
56
|
+
<Input
|
|
57
|
+
type="number"
|
|
58
|
+
className="h-7 w-16"
|
|
59
|
+
min={MIN_SCROLL_HOUR}
|
|
60
|
+
max={MAX_SCROLL_HOUR}
|
|
61
|
+
value={startOfDayHour}
|
|
62
|
+
onChange={e => setStartOfDayHour(Number(e.target.value))}
|
|
63
|
+
onClick={e => e.stopPropagation()}
|
|
64
|
+
onKeyDown={e => e.stopPropagation()}
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
</DropdownMenuGroup>
|
|
68
|
+
<DropdownMenuSeparator />
|
|
69
|
+
<DropdownMenuRadioGroup
|
|
70
|
+
value={agendaModeGroupBy}
|
|
71
|
+
onValueChange={value => setAgendaModeGroupBy(value as 'date' | 'color')}
|
|
72
|
+
>
|
|
73
|
+
<DropdownMenuLabel>{t.agendaGroupBy}</DropdownMenuLabel>
|
|
74
|
+
<DropdownMenuRadioItem value="date">{t.groupByDate}</DropdownMenuRadioItem>
|
|
75
|
+
<DropdownMenuRadioItem value="color">{t.groupByColor}</DropdownMenuRadioItem>
|
|
76
|
+
</DropdownMenuRadioGroup>
|
|
77
|
+
</DropdownMenuContent>
|
|
78
|
+
</DropdownMenu>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
|
|
3
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
4
|
+
|
|
5
|
+
export function AvatarGroup({
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
max = 3,
|
|
9
|
+
}: {
|
|
10
|
+
children: React.ReactNode
|
|
11
|
+
className?: string
|
|
12
|
+
max?: number
|
|
13
|
+
}) {
|
|
14
|
+
const items = React.Children.toArray(children).slice(0, max)
|
|
15
|
+
return <div className={cn('flex items-center -space-x-2', className)}>{items}</div>
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Calendar as DayPicker } from '@mohou/ui/components/calendar'
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
|
|
3
|
+
function strip(props: Record<string, unknown>) {
|
|
4
|
+
const {
|
|
5
|
+
initial: _i,
|
|
6
|
+
animate: _a,
|
|
7
|
+
exit: _e,
|
|
8
|
+
variants: _v,
|
|
9
|
+
transition: _t,
|
|
10
|
+
whileHover: _h,
|
|
11
|
+
whileTap: _p,
|
|
12
|
+
layout: _l,
|
|
13
|
+
scrollPosition: _s,
|
|
14
|
+
...rest
|
|
15
|
+
} = props
|
|
16
|
+
return rest
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function make(tag: React.ElementType) {
|
|
20
|
+
const El = React.forwardRef(function MotionEl(props: Record<string, unknown>, ref: React.Ref<unknown>) {
|
|
21
|
+
return React.createElement(tag, { ...strip(props), ref })
|
|
22
|
+
})
|
|
23
|
+
El.displayName = `motion.${typeof tag === 'string' ? tag : 'el'}`
|
|
24
|
+
return El
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* One component per tag, cached.
|
|
29
|
+
*
|
|
30
|
+
* Without the cache `motion.div` returns a NEW component type on every property
|
|
31
|
+
* access, so React sees a different `type` each render and tears the subtree down:
|
|
32
|
+
* DOM refs held across renders (pointer capture, `getBoundingClientRect` during a
|
|
33
|
+
* drag) then point at detached nodes, and every `motion.*` descendant remounts on
|
|
34
|
+
* each state change. Keep this memoised.
|
|
35
|
+
*/
|
|
36
|
+
const byTag = new Map<string, React.ElementType>()
|
|
37
|
+
const byComponent = new Map<React.ElementType, React.ElementType>()
|
|
38
|
+
|
|
39
|
+
function forTag(tag: string): React.ElementType {
|
|
40
|
+
let el = byTag.get(tag)
|
|
41
|
+
if (!el) {
|
|
42
|
+
el = make(tag as React.ElementType)
|
|
43
|
+
byTag.set(tag, el)
|
|
44
|
+
}
|
|
45
|
+
return el
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function forComponent(comp: React.ElementType): React.ElementType {
|
|
49
|
+
let el = byComponent.get(comp)
|
|
50
|
+
if (!el) {
|
|
51
|
+
el = make(comp)
|
|
52
|
+
byComponent.set(comp, el)
|
|
53
|
+
}
|
|
54
|
+
return el
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Props the shim swallows rather than forwarding to the DOM. */
|
|
58
|
+
export type MotionProps = {
|
|
59
|
+
initial?: unknown
|
|
60
|
+
animate?: unknown
|
|
61
|
+
exit?: unknown
|
|
62
|
+
variants?: unknown
|
|
63
|
+
transition?: unknown
|
|
64
|
+
whileHover?: unknown
|
|
65
|
+
whileTap?: unknown
|
|
66
|
+
layout?: unknown
|
|
67
|
+
scrollPosition?: unknown
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* `motion.div` has to type as a component taking **the real element's props** plus the motion
|
|
72
|
+
* ones. Typed as a bare `React.ElementType` (or a `Record<string, unknown>` props bag), every
|
|
73
|
+
* handler at a call site becomes an implicit any — that is how the week view's
|
|
74
|
+
* `onPointerDown={(e) => …}` lost its `e`.
|
|
75
|
+
*/
|
|
76
|
+
export type MotionComponents = {
|
|
77
|
+
[K in keyof React.JSX.IntrinsicElements]: React.ComponentType<
|
|
78
|
+
React.ComponentProps<K> & MotionProps
|
|
79
|
+
>
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const motion = new Proxy(
|
|
83
|
+
{ create: (comp: React.ElementType) => forComponent(comp) },
|
|
84
|
+
{
|
|
85
|
+
get(target, key) {
|
|
86
|
+
if (key === 'create') return target.create
|
|
87
|
+
if (typeof key === 'string') return forTag(key)
|
|
88
|
+
return undefined
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
) as unknown as { create: (comp: React.ElementType) => React.ElementType } & MotionComponents
|
|
92
|
+
|
|
93
|
+
export function AnimatePresence({ children }: { children?: React.ReactNode; initial?: boolean; mode?: string }) {
|
|
94
|
+
return <>{children}</>
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type Variants = Record<string, unknown>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
export type ResizeCallback = (
|
|
4
|
+
_event: unknown,
|
|
5
|
+
direction: string,
|
|
6
|
+
ref: { style: { height: string } },
|
|
7
|
+
) => void
|
|
8
|
+
|
|
9
|
+
export function Resizable({
|
|
10
|
+
children,
|
|
11
|
+
className,
|
|
12
|
+
}: {
|
|
13
|
+
children?: ReactNode
|
|
14
|
+
className?: string
|
|
15
|
+
minHeight?: number
|
|
16
|
+
maxHeight?: number
|
|
17
|
+
enable?: unknown
|
|
18
|
+
handleStyles?: unknown
|
|
19
|
+
handleClasses?: unknown
|
|
20
|
+
onResizeStart?: unknown
|
|
21
|
+
onResize?: unknown
|
|
22
|
+
onResizeStop?: unknown
|
|
23
|
+
}) {
|
|
24
|
+
return <div className={className}>{children}</div>
|
|
25
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { format, parseISO } from 'date-fns';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import { Avatar, AvatarFallback, AvatarImage } from '@mohou/ui/components/avatar';
|
|
4
|
+
import {
|
|
5
|
+
Command,
|
|
6
|
+
CommandEmpty,
|
|
7
|
+
CommandGroup,
|
|
8
|
+
CommandInput,
|
|
9
|
+
CommandItem,
|
|
10
|
+
CommandList,
|
|
11
|
+
} from '@mohou/ui/components/command';
|
|
12
|
+
import { useDateLocale, useLabels } from '@mohou/ui/i18n/context';
|
|
13
|
+
import { cn } from '@mohou/ui/lib/utils';
|
|
14
|
+
import { useCalendar } from '../../contexts/calendar-context';
|
|
15
|
+
import { EventDetailsDialog } from '../../dialogs/event-details-dialog';
|
|
16
|
+
import {
|
|
17
|
+
formatTime,
|
|
18
|
+
getBgColor,
|
|
19
|
+
getColorClass,
|
|
20
|
+
getEventsForMonth,
|
|
21
|
+
getFirstLetters,
|
|
22
|
+
toCapitalize,
|
|
23
|
+
} from '../../helpers';
|
|
24
|
+
import { EventBullet } from '../month-view/event-bullet';
|
|
25
|
+
|
|
26
|
+
export const AgendaEvents: FC = () => {
|
|
27
|
+
const {
|
|
28
|
+
events,
|
|
29
|
+
use24HourFormat,
|
|
30
|
+
badgeVariant,
|
|
31
|
+
agendaModeGroupBy,
|
|
32
|
+
selectedDate,
|
|
33
|
+
} = useCalendar()
|
|
34
|
+
const t = useLabels('eventCalendar');
|
|
35
|
+
const dateLocale = useDateLocale()
|
|
36
|
+
|
|
37
|
+
const monthEvents = getEventsForMonth(events, selectedDate)
|
|
38
|
+
|
|
39
|
+
const agendaEvents: Record<string, typeof monthEvents> = {}
|
|
40
|
+
for (const event of monthEvents) {
|
|
41
|
+
const key =
|
|
42
|
+
agendaModeGroupBy === 'date'
|
|
43
|
+
? format(parseISO(event.startDate), 'yyyy-MM-dd')
|
|
44
|
+
: event.color;
|
|
45
|
+
(agendaEvents[key] ??= []).push(event)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const groupedAndSortedEvents = Object.entries(agendaEvents).sort(
|
|
49
|
+
(a, b) => new Date(a[0]).getTime() - new Date(b[0]).getTime(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<Command className="py-4 h-[80vh] bg-transparent">
|
|
54
|
+
<div className="mb-4 mx-4">
|
|
55
|
+
<CommandInput placeholder={t.searchAgenda} />
|
|
56
|
+
</div>
|
|
57
|
+
<CommandList className="max-h-max px-3 border-t">
|
|
58
|
+
{groupedAndSortedEvents.map(([date, groupedEvents]) => (
|
|
59
|
+
<CommandGroup
|
|
60
|
+
key={date}
|
|
61
|
+
heading={
|
|
62
|
+
agendaModeGroupBy === 'date'
|
|
63
|
+
? format(parseISO(date), 'EEEE, MMMM d, yyyy', { locale: dateLocale })
|
|
64
|
+
: toCapitalize(groupedEvents?.[0]?.color ?? '')
|
|
65
|
+
}
|
|
66
|
+
>
|
|
67
|
+
{groupedEvents!.map(event => (
|
|
68
|
+
<CommandItem
|
|
69
|
+
key={event.id}
|
|
70
|
+
className={cn(
|
|
71
|
+
'mb-2 p-4 border rounded-md data-[selected=true]:bg-bg transition-all data-[selected=true]:text-none hover:cursor-pointer',
|
|
72
|
+
{
|
|
73
|
+
[getColorClass(event.color)]: badgeVariant === 'colored',
|
|
74
|
+
'hover:bg-zinc-200 dark:hover:bg-gray-900':
|
|
75
|
+
badgeVariant === 'dot',
|
|
76
|
+
'hover:opacity-60': badgeVariant === 'colored',
|
|
77
|
+
},
|
|
78
|
+
)}
|
|
79
|
+
>
|
|
80
|
+
<EventDetailsDialog event={event}>
|
|
81
|
+
<div className="w-full flex items-center justify-between gap-4">
|
|
82
|
+
<div className="flex items-center gap-2">
|
|
83
|
+
{badgeVariant === 'dot' ? (
|
|
84
|
+
<EventBullet color={event.color} />
|
|
85
|
+
) : (
|
|
86
|
+
<Avatar>
|
|
87
|
+
<AvatarImage src="" alt="@shadcn" />
|
|
88
|
+
<AvatarFallback className={getBgColor(event.color)}>
|
|
89
|
+
{getFirstLetters(event.title)}
|
|
90
|
+
</AvatarFallback>
|
|
91
|
+
</Avatar>
|
|
92
|
+
)}
|
|
93
|
+
<div className="flex flex-col">
|
|
94
|
+
<p
|
|
95
|
+
className={cn({
|
|
96
|
+
'font-medium': badgeVariant === 'dot',
|
|
97
|
+
'text-foreground': badgeVariant === 'dot',
|
|
98
|
+
})}
|
|
99
|
+
>
|
|
100
|
+
{event.title}
|
|
101
|
+
</p>
|
|
102
|
+
<p className="text-muted-foreground text-sm line-clamp-1 text-ellipsis md:text-clip w-1/3">
|
|
103
|
+
{event.description}
|
|
104
|
+
</p>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
<div className="w-40 flex justify-center items-center gap-1">
|
|
108
|
+
{agendaModeGroupBy === 'date' ? (
|
|
109
|
+
<>
|
|
110
|
+
<p className="text-sm">
|
|
111
|
+
{formatTime(event.startDate, use24HourFormat)}
|
|
112
|
+
</p>
|
|
113
|
+
<span className="text-muted-foreground">-</span>
|
|
114
|
+
<p className="text-sm">
|
|
115
|
+
{formatTime(event.endDate, use24HourFormat)}
|
|
116
|
+
</p>
|
|
117
|
+
</>
|
|
118
|
+
) : (
|
|
119
|
+
<>
|
|
120
|
+
<p className="text-sm">
|
|
121
|
+
{format(event.startDate, 'MM/dd/yyyy')}
|
|
122
|
+
</p>
|
|
123
|
+
<span className="text-sm">at</span>
|
|
124
|
+
<p className="text-sm">
|
|
125
|
+
{formatTime(event.startDate, use24HourFormat)}
|
|
126
|
+
</p>
|
|
127
|
+
</>
|
|
128
|
+
)}
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</EventDetailsDialog>
|
|
132
|
+
</CommandItem>
|
|
133
|
+
))}
|
|
134
|
+
</CommandGroup>
|
|
135
|
+
))}
|
|
136
|
+
<CommandEmpty>{t.noEvents}</CommandEmpty>
|
|
137
|
+
</CommandList>
|
|
138
|
+
</Command>
|
|
139
|
+
)
|
|
140
|
+
};
|