@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,97 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { format } from 'date-fns'
|
|
4
|
+
import { ChevronDown } from 'lucide-react'
|
|
5
|
+
|
|
6
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
7
|
+
import { useDateLocale, useLabels } from '@mohou/ui/i18n/context'
|
|
8
|
+
import { Button } from '@mohou/ui/components/button'
|
|
9
|
+
import { Calendar } from '@mohou/ui/components/calendar'
|
|
10
|
+
import {
|
|
11
|
+
Popover,
|
|
12
|
+
PopoverContent,
|
|
13
|
+
PopoverTrigger,
|
|
14
|
+
} from '@mohou/ui/components/popover'
|
|
15
|
+
import { DateChrome } from '@mohou/ui/composites/date-chrome'
|
|
16
|
+
|
|
17
|
+
export type DatePickerProps = {
|
|
18
|
+
value?: Date
|
|
19
|
+
onChange?: (date: Date | undefined) => void
|
|
20
|
+
placeholder?: string
|
|
21
|
+
disabled?: boolean
|
|
22
|
+
className?: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Single calendar date (day precision).
|
|
27
|
+
* @when Filtering or storing one day. With a clock → `DateTimePicker`.
|
|
28
|
+
* @example
|
|
29
|
+
* <DatePicker value={d} onChange={(v) => set(v)} />
|
|
30
|
+
* @family Calendar & date
|
|
31
|
+
*/
|
|
32
|
+
export function DatePicker({
|
|
33
|
+
value,
|
|
34
|
+
onChange,
|
|
35
|
+
placeholder,
|
|
36
|
+
disabled,
|
|
37
|
+
className,
|
|
38
|
+
}: DatePickerProps) {
|
|
39
|
+
const [open, setOpen] = React.useState(false)
|
|
40
|
+
const [month, setMonth] = React.useState(value ?? new Date())
|
|
41
|
+
const t = useLabels('datePicker')
|
|
42
|
+
const dateLocale = useDateLocale()
|
|
43
|
+
const text = placeholder ?? t.placeholder
|
|
44
|
+
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
if (value) setMonth(value)
|
|
47
|
+
}, [value])
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
51
|
+
<PopoverTrigger
|
|
52
|
+
disabled={disabled}
|
|
53
|
+
render={
|
|
54
|
+
<Button
|
|
55
|
+
variant="secondary"
|
|
56
|
+
data-empty={!value}
|
|
57
|
+
data-testid="date-picker-trigger"
|
|
58
|
+
className={cn(
|
|
59
|
+
'justify-between font-medium data-[empty=true]:text-muted-foreground',
|
|
60
|
+
className,
|
|
61
|
+
)}
|
|
62
|
+
/>
|
|
63
|
+
}
|
|
64
|
+
>
|
|
65
|
+
<span className="truncate">
|
|
66
|
+
{value ? format(value, 'yyyy, MMMM d', { locale: dateLocale }) : text}
|
|
67
|
+
</span>
|
|
68
|
+
<ChevronDown className="size-3.5 opacity-50" />
|
|
69
|
+
</PopoverTrigger>
|
|
70
|
+
<PopoverContent align="start" className="w-auto overflow-hidden p-0">
|
|
71
|
+
<DateChrome
|
|
72
|
+
month={month}
|
|
73
|
+
onMonthChange={setMonth}
|
|
74
|
+
onToday={() => {
|
|
75
|
+
const now = new Date()
|
|
76
|
+
onChange?.(now)
|
|
77
|
+
setOpen(false)
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
<Calendar
|
|
81
|
+
mode="single"
|
|
82
|
+
locale={dateLocale}
|
|
83
|
+
month={month}
|
|
84
|
+
onMonthChange={setMonth}
|
|
85
|
+
selected={value}
|
|
86
|
+
hideNavigation
|
|
87
|
+
classNames={{ month_caption: 'hidden', nav: 'hidden' }}
|
|
88
|
+
onSelect={(date) => {
|
|
89
|
+
onChange?.(date)
|
|
90
|
+
setOpen(false)
|
|
91
|
+
}}
|
|
92
|
+
/>
|
|
93
|
+
</DateChrome>
|
|
94
|
+
</PopoverContent>
|
|
95
|
+
</Popover>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { format, isSameMonth, isSameYear, type Locale } from 'date-fns'
|
|
4
|
+
import type { DateRange } from 'react-day-picker'
|
|
5
|
+
import { ChevronDown } from 'lucide-react'
|
|
6
|
+
|
|
7
|
+
// Re-exported so mini-app authors (bare `@mohou/ui` only) can type the value.
|
|
8
|
+
export type { DateRange }
|
|
9
|
+
|
|
10
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
11
|
+
import { useDateLocale, useLabels } from '@mohou/ui/i18n/context'
|
|
12
|
+
import { Button } from '@mohou/ui/components/button'
|
|
13
|
+
import { Calendar } from '@mohou/ui/components/calendar'
|
|
14
|
+
import {
|
|
15
|
+
Popover,
|
|
16
|
+
PopoverContent,
|
|
17
|
+
PopoverTrigger,
|
|
18
|
+
} from '@mohou/ui/components/popover'
|
|
19
|
+
import { DateChrome } from '@mohou/ui/composites/date-chrome'
|
|
20
|
+
|
|
21
|
+
export type DateRangePickerProps = {
|
|
22
|
+
value?: DateRange | undefined
|
|
23
|
+
onChange?: ((range: DateRange | undefined) => void) | undefined
|
|
24
|
+
placeholder?: string | undefined
|
|
25
|
+
className?: string | undefined
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function rangeLabel(value: DateRange, locale: Locale) {
|
|
29
|
+
const opts = { locale }
|
|
30
|
+
if (!value.from) return null
|
|
31
|
+
if (!value.to) return format(value.from, 'yyyy, MMMM d', opts)
|
|
32
|
+
if (isSameYear(value.from, value.to) && isSameMonth(value.from, value.to)) {
|
|
33
|
+
return `${format(value.from, 'yyyy, MMMM d', opts)}–${format(value.to, 'd', opts)}`
|
|
34
|
+
}
|
|
35
|
+
if (isSameYear(value.from, value.to)) {
|
|
36
|
+
return `${format(value.from, 'yyyy, MMM d', opts)} – ${format(value.to, 'MMM d', opts)}`
|
|
37
|
+
}
|
|
38
|
+
return `${format(value.from, 'MMM d, yyyy', opts)} – ${format(value.to, 'MMM d, yyyy', opts)}`
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Popover date range with month/year chrome.
|
|
43
|
+
* @when Filters needing from/to calendar days
|
|
44
|
+
* @example
|
|
45
|
+
* <DateRangePicker value={range} onChange={setRange} />
|
|
46
|
+
* @family Calendar & date
|
|
47
|
+
*/
|
|
48
|
+
export function DateRangePicker({
|
|
49
|
+
value,
|
|
50
|
+
onChange,
|
|
51
|
+
placeholder,
|
|
52
|
+
className,
|
|
53
|
+
}: DateRangePickerProps) {
|
|
54
|
+
const t = useLabels('dateRangePicker')
|
|
55
|
+
const dateLocale = useDateLocale()
|
|
56
|
+
const text = placeholder ?? t.placeholder
|
|
57
|
+
const [month, setMonth] = React.useState(value?.from ?? new Date())
|
|
58
|
+
const label = value?.from ? rangeLabel(value, dateLocale) : text
|
|
59
|
+
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
if (value?.from) setMonth(value.from)
|
|
62
|
+
}, [value?.from])
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<Popover>
|
|
66
|
+
<PopoverTrigger
|
|
67
|
+
render={
|
|
68
|
+
<Button
|
|
69
|
+
variant="secondary"
|
|
70
|
+
data-testid="date-range-picker-trigger"
|
|
71
|
+
className={cn(
|
|
72
|
+
'justify-between font-medium',
|
|
73
|
+
!value?.from && 'text-muted-foreground',
|
|
74
|
+
className,
|
|
75
|
+
)}
|
|
76
|
+
/>
|
|
77
|
+
}
|
|
78
|
+
>
|
|
79
|
+
<span className="truncate">{label}</span>
|
|
80
|
+
<ChevronDown className="size-3.5 opacity-50" />
|
|
81
|
+
</PopoverTrigger>
|
|
82
|
+
<PopoverContent align="start" className="w-auto overflow-hidden p-0">
|
|
83
|
+
<DateChrome month={month} onMonthChange={setMonth}>
|
|
84
|
+
<Calendar
|
|
85
|
+
mode="range"
|
|
86
|
+
locale={dateLocale}
|
|
87
|
+
month={month}
|
|
88
|
+
onMonthChange={setMonth}
|
|
89
|
+
{...value === undefined ? {} : { selected: value }}
|
|
90
|
+
{...onChange === undefined ? {} : { onSelect: onChange }}
|
|
91
|
+
hideNavigation
|
|
92
|
+
numberOfMonths={1}
|
|
93
|
+
classNames={{ month_caption: 'hidden', nav: 'hidden' }}
|
|
94
|
+
/>
|
|
95
|
+
</DateChrome>
|
|
96
|
+
</PopoverContent>
|
|
97
|
+
</Popover>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { format } from 'date-fns'
|
|
4
|
+
import { CalendarIcon } from 'lucide-react'
|
|
5
|
+
|
|
6
|
+
import { Button } from '@mohou/ui/components/button'
|
|
7
|
+
import { Calendar } from '@mohou/ui/components/calendar'
|
|
8
|
+
import {
|
|
9
|
+
Popover,
|
|
10
|
+
PopoverContent,
|
|
11
|
+
PopoverTrigger,
|
|
12
|
+
} from '@mohou/ui/components/popover'
|
|
13
|
+
import { DateChrome } from '@mohou/ui/composites/date-chrome'
|
|
14
|
+
import { TimeWheel } from '@mohou/ui/composites/time-picker'
|
|
15
|
+
import { TimezoneSelect } from '@mohou/ui/composites/timezone-select'
|
|
16
|
+
import { useDateLocale, useLabels } from '@mohou/ui/i18n/context'
|
|
17
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
18
|
+
|
|
19
|
+
function merge(date: Date | undefined, hours: number, minutes: number): Date {
|
|
20
|
+
const next = new Date(date ?? new Date())
|
|
21
|
+
next.setHours(hours, minutes, 0, 0)
|
|
22
|
+
return next
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type DateTimePickerProps = {
|
|
26
|
+
value?: Date | undefined
|
|
27
|
+
onChange?: (date: Date | undefined) => void
|
|
28
|
+
timezone?: string | undefined
|
|
29
|
+
onTimezoneChange?: ((zone: string) => void) | undefined
|
|
30
|
+
placeholder?: string | undefined
|
|
31
|
+
className?: string | undefined
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Date + time, optional timezone.
|
|
36
|
+
* @when Scheduling moments, not days.
|
|
37
|
+
* @example
|
|
38
|
+
* <DateTimePicker value={d} onChange={(v) => set(v)} />
|
|
39
|
+
* @family Calendar & date
|
|
40
|
+
*/
|
|
41
|
+
export function DateTimePicker({
|
|
42
|
+
value,
|
|
43
|
+
onChange,
|
|
44
|
+
timezone,
|
|
45
|
+
onTimezoneChange,
|
|
46
|
+
placeholder,
|
|
47
|
+
className,
|
|
48
|
+
}: DateTimePickerProps) {
|
|
49
|
+
const [open, setOpen] = React.useState(false)
|
|
50
|
+
const [month, setMonth] = React.useState(value ?? new Date())
|
|
51
|
+
const hours = value?.getHours() ?? 0
|
|
52
|
+
const minutes = value?.getMinutes() ?? 0
|
|
53
|
+
const t = useLabels('dateTimePicker')
|
|
54
|
+
const dateLocale = useDateLocale()
|
|
55
|
+
const text = placeholder ?? t.placeholder
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
if (value) setMonth(value)
|
|
58
|
+
}, [value])
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div className="flex flex-wrap items-center gap-2" data-testid="date-time-picker">
|
|
62
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
63
|
+
<PopoverTrigger
|
|
64
|
+
render={
|
|
65
|
+
<Button
|
|
66
|
+
variant="outline"
|
|
67
|
+
data-empty={!value}
|
|
68
|
+
data-testid="date-picker-trigger"
|
|
69
|
+
className={cn(
|
|
70
|
+
'w-[280px] justify-start text-left font-normal data-[empty=true]:text-muted-foreground',
|
|
71
|
+
className,
|
|
72
|
+
)}
|
|
73
|
+
/>
|
|
74
|
+
}
|
|
75
|
+
>
|
|
76
|
+
<CalendarIcon />
|
|
77
|
+
{value ? format(value, 'PPP p', { locale: dateLocale }) : <span>{text}</span>}
|
|
78
|
+
</PopoverTrigger>
|
|
79
|
+
<PopoverContent className="w-auto overflow-hidden p-0">
|
|
80
|
+
<div className="flex">
|
|
81
|
+
<DateChrome
|
|
82
|
+
month={month}
|
|
83
|
+
onMonthChange={setMonth}
|
|
84
|
+
onToday={() => onChange?.(merge(new Date(), hours, minutes))}
|
|
85
|
+
>
|
|
86
|
+
<Calendar
|
|
87
|
+
mode="single"
|
|
88
|
+
locale={dateLocale}
|
|
89
|
+
month={month}
|
|
90
|
+
onMonthChange={setMonth}
|
|
91
|
+
selected={value}
|
|
92
|
+
hideNavigation
|
|
93
|
+
classNames={{ month_caption: 'hidden', nav: 'hidden' }}
|
|
94
|
+
onSelect={date => onChange?.(merge(date, hours, minutes))}
|
|
95
|
+
/>
|
|
96
|
+
</DateChrome>
|
|
97
|
+
<div className="flex gap-1 border-l px-2 py-2">
|
|
98
|
+
<TimeWheel
|
|
99
|
+
testId="time-hour"
|
|
100
|
+
visible={7}
|
|
101
|
+
values={Array.from({ length: 24 }, (_, i) => i)}
|
|
102
|
+
value={hours}
|
|
103
|
+
onChange={h => onChange?.(merge(value, h, minutes))}
|
|
104
|
+
/>
|
|
105
|
+
<TimeWheel
|
|
106
|
+
testId="time-minute"
|
|
107
|
+
visible={7}
|
|
108
|
+
values={Array.from({ length: 60 }, (_, i) => i)}
|
|
109
|
+
value={minutes}
|
|
110
|
+
onChange={m => onChange?.(merge(value, hours, m))}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</PopoverContent>
|
|
115
|
+
</Popover>
|
|
116
|
+
{onTimezoneChange ? (
|
|
117
|
+
<TimezoneSelect value={timezone} onChange={onTimezoneChange} />
|
|
118
|
+
) : null}
|
|
119
|
+
</div>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
|
|
2
|
+
import { Label } from '@mohou/ui/components/label'
|
|
3
|
+
import { DateRangePicker } from '@mohou/ui/composites/date-range-picker'
|
|
4
|
+
import { DateTimePicker } from '@mohou/ui/composites/date-time-picker'
|
|
5
|
+
import { useLabels } from '@mohou/ui/i18n/context'
|
|
6
|
+
|
|
7
|
+
export type DateTimeRange = { start?: Date | undefined; end?: Date | undefined }
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* From/to moments, all-day toggle.
|
|
11
|
+
* @when Run windows, on-call shifts.
|
|
12
|
+
* @example
|
|
13
|
+
* <DateTimeRangePicker onChange={(r) => set(r)} />
|
|
14
|
+
* @family Calendar & date
|
|
15
|
+
*/
|
|
16
|
+
export function DateTimeRangePicker({
|
|
17
|
+
value,
|
|
18
|
+
onChange,
|
|
19
|
+
allDay = false,
|
|
20
|
+
}: {
|
|
21
|
+
value?: DateTimeRange | undefined
|
|
22
|
+
onChange?: (value: DateTimeRange) => void
|
|
23
|
+
allDay?: boolean | undefined
|
|
24
|
+
}) {
|
|
25
|
+
const t = useLabels('dateTimeRange')
|
|
26
|
+
if (allDay) {
|
|
27
|
+
return (
|
|
28
|
+
<div data-testid="date-time-range-picker">
|
|
29
|
+
<DateRangePicker
|
|
30
|
+
value={{ from: value?.start, to: value?.end }}
|
|
31
|
+
onChange={range => onChange?.({ start: range?.from, end: range?.to })}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className="flex flex-col gap-2" data-testid="date-time-range-picker">
|
|
39
|
+
<div className="grid gap-1">
|
|
40
|
+
<Label>{t.start}</Label>
|
|
41
|
+
<DateTimePicker
|
|
42
|
+
value={value?.start}
|
|
43
|
+
onChange={start => onChange?.({ start, end: value?.end })}
|
|
44
|
+
className="w-full"
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
<div className="grid gap-1">
|
|
48
|
+
<Label>{t.end}</Label>
|
|
49
|
+
<DateTimePicker
|
|
50
|
+
value={value?.end}
|
|
51
|
+
onChange={end => onChange?.({ start: value?.start, end })}
|
|
52
|
+
className="w-full"
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
|
|
2
|
+
import { Minus, Plus } from 'lucide-react'
|
|
3
|
+
|
|
4
|
+
import { Button } from '@mohou/ui/components/button'
|
|
5
|
+
import { Input } from '@mohou/ui/components/input'
|
|
6
|
+
import { useLabels } from '@mohou/ui/i18n/context'
|
|
7
|
+
|
|
8
|
+
export function parseDuration(input: string): number {
|
|
9
|
+
const hours = Number(/(\d+)\s*h/i.exec(input)?.[1] ?? 0)
|
|
10
|
+
const minutes = Number(/(\d+)\s*m/i.exec(input)?.[1] ?? 0)
|
|
11
|
+
if (!/[hm]/i.test(input) && /^\d+$/.test(input.trim())) {
|
|
12
|
+
return Number(input)
|
|
13
|
+
}
|
|
14
|
+
return hours * 60 + minutes
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function formatDuration(totalMinutes: number): string {
|
|
18
|
+
const hours = Math.floor(Math.max(0, totalMinutes) / 60)
|
|
19
|
+
const rest = Math.max(0, totalMinutes) % 60
|
|
20
|
+
if (hours && rest) return `${hours}h ${rest}m`
|
|
21
|
+
if (hours) return `${hours}h`
|
|
22
|
+
return `${rest}m`
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function split(value?: string) {
|
|
26
|
+
const total = parseDuration(value ?? '0m')
|
|
27
|
+
return { hours: Math.floor(total / 60), minutes: total % 60 }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function Segment({
|
|
31
|
+
label,
|
|
32
|
+
value,
|
|
33
|
+
onChange,
|
|
34
|
+
min = 0,
|
|
35
|
+
max,
|
|
36
|
+
}: {
|
|
37
|
+
label: string
|
|
38
|
+
value: number
|
|
39
|
+
onChange: (value: number) => void
|
|
40
|
+
min?: number
|
|
41
|
+
max?: number
|
|
42
|
+
}) {
|
|
43
|
+
const t = useLabels('durationInput')
|
|
44
|
+
const clamp = (next: number) => {
|
|
45
|
+
if (max != null) next = Math.min(max, next)
|
|
46
|
+
return Math.max(min, next)
|
|
47
|
+
}
|
|
48
|
+
return (
|
|
49
|
+
<div className="flex items-center gap-1">
|
|
50
|
+
<Button
|
|
51
|
+
type="button"
|
|
52
|
+
variant="ghost"
|
|
53
|
+
size="icon-xs"
|
|
54
|
+
aria-label={t.decrease(label)}
|
|
55
|
+
onClick={() => onChange(clamp(value - 1))}
|
|
56
|
+
>
|
|
57
|
+
<Minus />
|
|
58
|
+
</Button>
|
|
59
|
+
<Input
|
|
60
|
+
inputMode="numeric"
|
|
61
|
+
value={String(value)}
|
|
62
|
+
aria-label={label}
|
|
63
|
+
onChange={(event) => {
|
|
64
|
+
const next = Number(event.target.value.replace(/\D/g, '') || 0)
|
|
65
|
+
onChange(clamp(next))
|
|
66
|
+
}}
|
|
67
|
+
className="h-7 w-10 border-0 bg-transparent p-0 text-center shadow-none focus-visible:ring-0"
|
|
68
|
+
/>
|
|
69
|
+
<span className="text-muted-foreground w-4 text-xs">{label}</span>
|
|
70
|
+
<Button
|
|
71
|
+
type="button"
|
|
72
|
+
variant="ghost"
|
|
73
|
+
size="icon-xs"
|
|
74
|
+
aria-label={t.increase(label)}
|
|
75
|
+
onClick={() => onChange(clamp(value + 1))}
|
|
76
|
+
>
|
|
77
|
+
<Plus />
|
|
78
|
+
</Button>
|
|
79
|
+
</div>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Duration text field (e.g. `1h30m`) with minutes.
|
|
85
|
+
* @when Timeouts/estimates where you store minutes but type human units.
|
|
86
|
+
* @example
|
|
87
|
+
* <DurationInput value="45m" onChange={(v, min) => set(min)} />
|
|
88
|
+
* @family Calendar & date
|
|
89
|
+
*/
|
|
90
|
+
export function DurationInput({
|
|
91
|
+
value,
|
|
92
|
+
onChange,
|
|
93
|
+
}: {
|
|
94
|
+
value?: string
|
|
95
|
+
onChange?: (value: string, minutes: number) => void
|
|
96
|
+
}) {
|
|
97
|
+
const t = useLabels('durationInput')
|
|
98
|
+
const { hours, minutes } = split(value)
|
|
99
|
+
const commit = (h: number, m: number) => {
|
|
100
|
+
let total = h * 60 + m
|
|
101
|
+
if (total < 0) total = 0
|
|
102
|
+
onChange?.(formatDuration(total), total)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<div
|
|
107
|
+
data-testid="duration-input"
|
|
108
|
+
className="inline-flex items-center gap-1 rounded-lg border bg-background px-1 py-0.5"
|
|
109
|
+
>
|
|
110
|
+
<Segment
|
|
111
|
+
label={t.hours}
|
|
112
|
+
value={hours}
|
|
113
|
+
onChange={h => commit(h, minutes)}
|
|
114
|
+
/>
|
|
115
|
+
<span className="text-muted-foreground/40">·</span>
|
|
116
|
+
<Segment
|
|
117
|
+
label={t.minutes}
|
|
118
|
+
value={minutes}
|
|
119
|
+
min={-1}
|
|
120
|
+
onChange={(m) => {
|
|
121
|
+
if (m >= 60) commit(hours + 1, 0)
|
|
122
|
+
else if (m < 0) commit(hours <= 0 ? 0 : hours - 1, hours <= 0 ? 0 : 59)
|
|
123
|
+
else commit(hours, m)
|
|
124
|
+
}}
|
|
125
|
+
/>
|
|
126
|
+
</div>
|
|
127
|
+
)
|
|
128
|
+
}
|