@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,245 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import type { ReactNode } from 'react'
|
|
4
|
+
import {
|
|
5
|
+
DndContext,
|
|
6
|
+
PointerSensor,
|
|
7
|
+
closestCorners,
|
|
8
|
+
useDraggable,
|
|
9
|
+
useDroppable,
|
|
10
|
+
useSensor,
|
|
11
|
+
useSensors,
|
|
12
|
+
type DragEndEvent,
|
|
13
|
+
} from '@dnd-kit/core'
|
|
14
|
+
import { CSS } from '@dnd-kit/utilities'
|
|
15
|
+
|
|
16
|
+
import { Badge } from '@mohou/ui/components/badge'
|
|
17
|
+
import { Avatar, AvatarFallback } from '@mohou/ui/components/avatar'
|
|
18
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
19
|
+
|
|
20
|
+
export type KanbanComment = {
|
|
21
|
+
id: string
|
|
22
|
+
author: string
|
|
23
|
+
body: string
|
|
24
|
+
time?: string | undefined
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type KanbanCard = {
|
|
28
|
+
id: string
|
|
29
|
+
title: string
|
|
30
|
+
columnId: string
|
|
31
|
+
key?: string | undefined
|
|
32
|
+
type?: string | undefined
|
|
33
|
+
status?: string | undefined
|
|
34
|
+
description?: string | undefined
|
|
35
|
+
assignee?: string | undefined
|
|
36
|
+
reporter?: string | undefined
|
|
37
|
+
tags?: string[] | undefined
|
|
38
|
+
priority?: 'P0' | 'P1' | 'P2' | 'P3' | string | undefined
|
|
39
|
+
updated?: string | undefined
|
|
40
|
+
comments?: KanbanComment[] | undefined
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type KanbanColumn = {
|
|
44
|
+
id: string
|
|
45
|
+
title: string
|
|
46
|
+
limit?: number | undefined
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const priorityTone: Record<string, string> = {
|
|
50
|
+
P0: 'bg-destructive/15 text-destructive',
|
|
51
|
+
P1: 'bg-orange-500/15 text-orange-700 dark:text-orange-400',
|
|
52
|
+
P2: 'bg-amber-500/15 text-amber-700 dark:text-amber-400',
|
|
53
|
+
P3: 'bg-muted text-muted-foreground',
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function DefaultCard({ card }: { card: KanbanCard }) {
|
|
57
|
+
return (
|
|
58
|
+
<>
|
|
59
|
+
{card.key ? (
|
|
60
|
+
<div className="text-muted-foreground mb-1 font-mono text-[10px]">{card.key}</div>
|
|
61
|
+
) : null}
|
|
62
|
+
<div className="flex items-start justify-between gap-2">
|
|
63
|
+
<div className="text-sm font-medium">{card.title}</div>
|
|
64
|
+
{card.priority ? (
|
|
65
|
+
<Badge
|
|
66
|
+
variant="outline"
|
|
67
|
+
className={cn(
|
|
68
|
+
'border-transparent text-[10px]',
|
|
69
|
+
priorityTone[card.priority] ?? 'bg-muted'
|
|
70
|
+
)}
|
|
71
|
+
>
|
|
72
|
+
{card.priority}
|
|
73
|
+
</Badge>
|
|
74
|
+
) : null}
|
|
75
|
+
</div>
|
|
76
|
+
{card.description ? (
|
|
77
|
+
<p className="text-muted-foreground line-clamp-2 text-xs">{card.description}</p>
|
|
78
|
+
) : null}
|
|
79
|
+
<div className="mt-2 flex items-center justify-between gap-2">
|
|
80
|
+
<div className="flex flex-wrap gap-1">
|
|
81
|
+
{card.tags?.map(tag => (
|
|
82
|
+
<Badge key={tag} variant="secondary" className="text-[10px]">
|
|
83
|
+
{tag}
|
|
84
|
+
</Badge>
|
|
85
|
+
))}
|
|
86
|
+
</div>
|
|
87
|
+
{card.assignee ? (
|
|
88
|
+
<Avatar className="size-5">
|
|
89
|
+
<AvatarFallback className="text-[9px]">
|
|
90
|
+
{card.assignee.slice(0, 2).toUpperCase()}
|
|
91
|
+
</AvatarFallback>
|
|
92
|
+
</Avatar>
|
|
93
|
+
) : null}
|
|
94
|
+
</div>
|
|
95
|
+
</>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function Card({
|
|
100
|
+
card,
|
|
101
|
+
children,
|
|
102
|
+
onCardClick,
|
|
103
|
+
}: {
|
|
104
|
+
card: KanbanCard
|
|
105
|
+
children: ReactNode
|
|
106
|
+
onCardClick?: ((card: KanbanCard) => void) | undefined
|
|
107
|
+
}) {
|
|
108
|
+
const origin = React.useRef({ x: 0, y: 0 })
|
|
109
|
+
const { attributes, listeners, setNodeRef, transform, isDragging } = useDraggable({
|
|
110
|
+
id: card.id,
|
|
111
|
+
})
|
|
112
|
+
return (
|
|
113
|
+
<div
|
|
114
|
+
ref={setNodeRef}
|
|
115
|
+
data-testid={`kanban-card-${card.id}`}
|
|
116
|
+
style={{ transform: CSS.Translate.toString(transform) }}
|
|
117
|
+
className={cn(
|
|
118
|
+
'cursor-pointer rounded-lg border bg-card px-2.5 py-2 text-left shadow-xs',
|
|
119
|
+
isDragging && 'opacity-70'
|
|
120
|
+
)}
|
|
121
|
+
{...attributes}
|
|
122
|
+
{...listeners}
|
|
123
|
+
onPointerDown={(event) => {
|
|
124
|
+
origin.current = { x: event.clientX, y: event.clientY }
|
|
125
|
+
listeners?.onPointerDown?.(event)
|
|
126
|
+
}}
|
|
127
|
+
onClick={(event) => {
|
|
128
|
+
if (
|
|
129
|
+
Math.hypot(
|
|
130
|
+
event.clientX - origin.current.x,
|
|
131
|
+
event.clientY - origin.current.y,
|
|
132
|
+
) > 6
|
|
133
|
+
) {
|
|
134
|
+
return
|
|
135
|
+
}
|
|
136
|
+
onCardClick?.(card)
|
|
137
|
+
}}
|
|
138
|
+
>
|
|
139
|
+
{children}
|
|
140
|
+
</div>
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function Column({
|
|
145
|
+
column,
|
|
146
|
+
cards,
|
|
147
|
+
renderCard,
|
|
148
|
+
onCardClick,
|
|
149
|
+
}: {
|
|
150
|
+
column: KanbanColumn
|
|
151
|
+
cards: KanbanCard[]
|
|
152
|
+
renderCard?: ((card: KanbanCard) => ReactNode) | undefined
|
|
153
|
+
onCardClick?: ((card: KanbanCard) => void) | undefined
|
|
154
|
+
}) {
|
|
155
|
+
const { setNodeRef, isOver } = useDroppable({ id: column.id })
|
|
156
|
+
const overLimit = column.limit != null && cards.length > column.limit
|
|
157
|
+
return (
|
|
158
|
+
<div
|
|
159
|
+
className={cn(
|
|
160
|
+
'flex w-72 shrink-0 flex-col gap-2 rounded-xl border bg-muted/30 p-2',
|
|
161
|
+
isOver && 'border-primary/50'
|
|
162
|
+
)}
|
|
163
|
+
>
|
|
164
|
+
<div className="flex items-center justify-between px-1">
|
|
165
|
+
<div className="text-xs font-medium tracking-wide text-muted-foreground uppercase">
|
|
166
|
+
{column.title}
|
|
167
|
+
</div>
|
|
168
|
+
<span
|
|
169
|
+
className={cn(
|
|
170
|
+
'text-[11px] tabular-nums text-muted-foreground',
|
|
171
|
+
overLimit && 'text-destructive'
|
|
172
|
+
)}
|
|
173
|
+
>
|
|
174
|
+
{cards.length}
|
|
175
|
+
{column.limit != null ? ` / ${column.limit}` : ''}
|
|
176
|
+
</span>
|
|
177
|
+
</div>
|
|
178
|
+
<div ref={setNodeRef} className="flex min-h-32 flex-col gap-2">
|
|
179
|
+
{cards.map(card => (
|
|
180
|
+
<Card key={card.id} card={card} onCardClick={onCardClick}>
|
|
181
|
+
{renderCard ? renderCard(card) : <DefaultCard card={card} />}
|
|
182
|
+
</Card>
|
|
183
|
+
))}
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* DnD board: columns + cards. Move cards across columns via drag.
|
|
191
|
+
* @when Issue/workflow boards
|
|
192
|
+
* @example
|
|
193
|
+
* <Kanban columns={cols} cards={cards} onCardsChange={setCards} onCardClick={open} />
|
|
194
|
+
* @family Data & tables
|
|
195
|
+
*/
|
|
196
|
+
export function Kanban({
|
|
197
|
+
columns,
|
|
198
|
+
cards,
|
|
199
|
+
onCardsChange,
|
|
200
|
+
renderCard,
|
|
201
|
+
onCardClick,
|
|
202
|
+
}: {
|
|
203
|
+
columns: KanbanColumn[]
|
|
204
|
+
cards: KanbanCard[]
|
|
205
|
+
onCardsChange?: (cards: KanbanCard[]) => void
|
|
206
|
+
renderCard?: (card: KanbanCard) => ReactNode
|
|
207
|
+
onCardClick?: (card: KanbanCard) => void
|
|
208
|
+
}) {
|
|
209
|
+
const sensors = useSensors(
|
|
210
|
+
useSensor(PointerSensor, { activationConstraint: { distance: 6 } }),
|
|
211
|
+
)
|
|
212
|
+
const onDragEnd = (event: DragEndEvent) => {
|
|
213
|
+
const { active, over } = event
|
|
214
|
+
if (!over) return
|
|
215
|
+
const overId = String(over.id)
|
|
216
|
+
const overColumn = columns.some(column => column.id === overId)
|
|
217
|
+
? overId
|
|
218
|
+
: cards.find(card => card.id === overId)?.columnId
|
|
219
|
+
if (!overColumn) return
|
|
220
|
+
onCardsChange?.(
|
|
221
|
+
cards.map(card =>
|
|
222
|
+
card.id === String(active.id) ? { ...card, columnId: overColumn } : card,
|
|
223
|
+
)
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
return (
|
|
227
|
+
<DndContext
|
|
228
|
+
sensors={sensors}
|
|
229
|
+
collisionDetection={closestCorners}
|
|
230
|
+
onDragEnd={onDragEnd}
|
|
231
|
+
>
|
|
232
|
+
<div className="flex gap-3 overflow-x-auto pb-2" data-testid="kanban">
|
|
233
|
+
{columns.map(column => (
|
|
234
|
+
<Column
|
|
235
|
+
key={column.id}
|
|
236
|
+
column={column}
|
|
237
|
+
cards={cards.filter(card => card.columnId === column.id)}
|
|
238
|
+
renderCard={renderCard}
|
|
239
|
+
onCardClick={onCardClick}
|
|
240
|
+
/>
|
|
241
|
+
))}
|
|
242
|
+
</div>
|
|
243
|
+
</DndContext>
|
|
244
|
+
)
|
|
245
|
+
}
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
4
|
+
import {
|
|
5
|
+
ArrowDown,
|
|
6
|
+
Check,
|
|
7
|
+
Copy,
|
|
8
|
+
Download,
|
|
9
|
+
Pause,
|
|
10
|
+
Play,
|
|
11
|
+
Search,
|
|
12
|
+
Terminal,
|
|
13
|
+
Trash2,
|
|
14
|
+
X,
|
|
15
|
+
} from 'lucide-react';
|
|
16
|
+
|
|
17
|
+
import { useLabels } from '@mohou/ui/i18n/context';
|
|
18
|
+
import { writeClipboard } from '@mohou/ui/lib/clipboard';
|
|
19
|
+
import { cn } from '@mohou/ui/lib/utils';
|
|
20
|
+
|
|
21
|
+
export type LogLevel = 'info' | 'warn' | 'error' | 'debug' | 'verbose';
|
|
22
|
+
|
|
23
|
+
export type LogEntry = {
|
|
24
|
+
level: LogLevel
|
|
25
|
+
message: string
|
|
26
|
+
timestamp?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type LevelColors = {
|
|
30
|
+
text: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const DEFAULT_LEVEL_COLORS: Record<LogLevel, LevelColors> = {
|
|
34
|
+
error: { text: 'text-rose-500 dark:text-rose-400' },
|
|
35
|
+
warn: { text: 'text-amber-500 dark:text-amber-400' },
|
|
36
|
+
info: { text: 'text-sky-500 dark:text-sky-400' },
|
|
37
|
+
debug: { text: 'text-violet-500 dark:text-violet-400' },
|
|
38
|
+
verbose: { text: 'text-zinc-400 dark:text-zinc-500' },
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const LEVEL_LABELS: Record<LogLevel, string> = {
|
|
42
|
+
error: 'ERR',
|
|
43
|
+
warn: 'WRN',
|
|
44
|
+
info: 'INF',
|
|
45
|
+
debug: 'DBG',
|
|
46
|
+
verbose: 'VRB',
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function formatTimestampFull(ts?: string): string {
|
|
50
|
+
const d = ts ? new Date(ts) : new Date()
|
|
51
|
+
const ms = d.getMilliseconds().toString().padStart(3, '0');
|
|
52
|
+
return `${d.toLocaleTimeString('en-US', {
|
|
53
|
+
hour12: false,
|
|
54
|
+
hour: '2-digit',
|
|
55
|
+
minute: '2-digit',
|
|
56
|
+
second: '2-digit',
|
|
57
|
+
})}.${ms}`
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function useCopy() {
|
|
61
|
+
const [copied, setCopied] = React.useState(false)
|
|
62
|
+
|
|
63
|
+
const copy = React.useCallback(async (value: string) => {
|
|
64
|
+
if (!(await writeClipboard(value))) return
|
|
65
|
+
setCopied(true)
|
|
66
|
+
window.setTimeout(() => setCopied(false), 1500)
|
|
67
|
+
}, [])
|
|
68
|
+
|
|
69
|
+
return { copied, copy }
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function exportLogs(entries: LogEntry[]): void {
|
|
73
|
+
const text = entries
|
|
74
|
+
.map(
|
|
75
|
+
e =>
|
|
76
|
+
`[${formatTimestampFull(e.timestamp)}] [${LEVEL_LABELS[e.level]}] ${e.message}`,
|
|
77
|
+
)
|
|
78
|
+
.join('\n');
|
|
79
|
+
const blob = new Blob([text], { type: 'text/plain' })
|
|
80
|
+
const url = URL.createObjectURL(blob)
|
|
81
|
+
const a = document.createElement('a');
|
|
82
|
+
a.href = url
|
|
83
|
+
a.download = `logs-${new Date().toISOString().slice(0, 19).replace(/:/g, '-')}.txt`
|
|
84
|
+
a.click()
|
|
85
|
+
URL.revokeObjectURL(url)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function highlightSearch(text: string, query: string): React.ReactNode {
|
|
89
|
+
if (!query) return text
|
|
90
|
+
const escaped = query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
91
|
+
const re = new RegExp(escaped, 'gi');
|
|
92
|
+
const nodes: React.ReactNode[] = []
|
|
93
|
+
let lastIndex = 0
|
|
94
|
+
let match = re.exec(text)
|
|
95
|
+
while (match) {
|
|
96
|
+
if (match.index > lastIndex) {
|
|
97
|
+
nodes.push(text.slice(lastIndex, match.index))
|
|
98
|
+
}
|
|
99
|
+
nodes.push(
|
|
100
|
+
<mark
|
|
101
|
+
key={`h-${match.index}-${match[0]}`}
|
|
102
|
+
className="rounded-sm bg-amber-300/40 px-0.5 text-inherit dark:bg-amber-400/30"
|
|
103
|
+
>
|
|
104
|
+
{match[0]}
|
|
105
|
+
</mark>,
|
|
106
|
+
)
|
|
107
|
+
lastIndex = match.index + match[0].length
|
|
108
|
+
match = re.exec(text)
|
|
109
|
+
}
|
|
110
|
+
if (lastIndex < text.length) {
|
|
111
|
+
nodes.push(text.slice(lastIndex))
|
|
112
|
+
}
|
|
113
|
+
return nodes
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function ToolbarButton({
|
|
117
|
+
onClick,
|
|
118
|
+
label,
|
|
119
|
+
active,
|
|
120
|
+
children,
|
|
121
|
+
className,
|
|
122
|
+
}: {
|
|
123
|
+
onClick: () => void
|
|
124
|
+
label: string
|
|
125
|
+
active?: boolean
|
|
126
|
+
children: React.ReactNode
|
|
127
|
+
className?: string
|
|
128
|
+
}) {
|
|
129
|
+
return (
|
|
130
|
+
<button
|
|
131
|
+
type="button"
|
|
132
|
+
onClick={onClick}
|
|
133
|
+
aria-label={label}
|
|
134
|
+
className={cn(
|
|
135
|
+
'inline-flex size-7 items-center justify-center rounded-md transition-colors outline-none',
|
|
136
|
+
'text-muted-foreground hover:bg-accent hover:text-accent-foreground',
|
|
137
|
+
'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1',
|
|
138
|
+
active && 'bg-accent text-accent-foreground',
|
|
139
|
+
className,
|
|
140
|
+
)}
|
|
141
|
+
>
|
|
142
|
+
{children}
|
|
143
|
+
</button>
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Virtualized streaming log viewer with level colors, search, and auto-scroll.
|
|
149
|
+
* @when Streaming / CLI-style log output
|
|
150
|
+
* @example
|
|
151
|
+
* <LogViewer entries={[{ level: "info", message: "boot" }, { level: "error", message: "boom" }]} />
|
|
152
|
+
* @family Realtime
|
|
153
|
+
*/
|
|
154
|
+
export function LogViewer({
|
|
155
|
+
entries,
|
|
156
|
+
title,
|
|
157
|
+
maxHeight = 320,
|
|
158
|
+
lineNumbers = true,
|
|
159
|
+
timestamps = true,
|
|
160
|
+
autoScroll = true,
|
|
161
|
+
onClear,
|
|
162
|
+
className,
|
|
163
|
+
}: {
|
|
164
|
+
entries: LogEntry[]
|
|
165
|
+
title?: string
|
|
166
|
+
maxHeight?: number
|
|
167
|
+
lineNumbers?: boolean
|
|
168
|
+
timestamps?: boolean
|
|
169
|
+
autoScroll?: boolean
|
|
170
|
+
onClear?: () => void
|
|
171
|
+
className?: string
|
|
172
|
+
}) {
|
|
173
|
+
const t = useLabels('logViewer');
|
|
174
|
+
const resolvedTitle = title ?? t.title
|
|
175
|
+
const [paused, setPaused] = React.useState(false)
|
|
176
|
+
const [searchOpen, setSearchOpen] = React.useState(false)
|
|
177
|
+
const [searchQuery, setSearchQuery] = React.useState('');
|
|
178
|
+
const [isAtBottom, setIsAtBottom] = React.useState(true)
|
|
179
|
+
const parentRef = React.useRef<HTMLDivElement>(null)
|
|
180
|
+
const { copied, copy } = useCopy()
|
|
181
|
+
|
|
182
|
+
const filteredEntries = React.useMemo(
|
|
183
|
+
() =>
|
|
184
|
+
searchQuery
|
|
185
|
+
? entries.filter(e =>
|
|
186
|
+
e.message.toLowerCase().includes(searchQuery.toLowerCase()),
|
|
187
|
+
)
|
|
188
|
+
: entries,
|
|
189
|
+
[entries, searchQuery],
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
const virtualizer = useVirtualizer({
|
|
193
|
+
count: filteredEntries.length,
|
|
194
|
+
getScrollElement: () => parentRef.current,
|
|
195
|
+
estimateSize: () => 24,
|
|
196
|
+
overscan: 12,
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
const scrollEnabled = autoScroll && !paused
|
|
200
|
+
|
|
201
|
+
React.useEffect(() => {
|
|
202
|
+
if (!scrollEnabled || !isAtBottom || filteredEntries.length === 0) return
|
|
203
|
+
virtualizer.scrollToIndex(filteredEntries.length - 1, { align: 'end' })
|
|
204
|
+
}, [filteredEntries.length, scrollEnabled, isAtBottom, virtualizer])
|
|
205
|
+
|
|
206
|
+
const handleScroll = React.useCallback(() => {
|
|
207
|
+
const el = parentRef.current
|
|
208
|
+
if (!el) return
|
|
209
|
+
const threshold = 40
|
|
210
|
+
const atBottom =
|
|
211
|
+
el.scrollHeight - el.scrollTop - el.clientHeight < threshold
|
|
212
|
+
setIsAtBottom(atBottom)
|
|
213
|
+
}, [])
|
|
214
|
+
|
|
215
|
+
const scrollToBottom = React.useCallback(() => {
|
|
216
|
+
if (filteredEntries.length === 0) return
|
|
217
|
+
virtualizer.scrollToIndex(filteredEntries.length - 1, { align: 'end' })
|
|
218
|
+
setIsAtBottom(true)
|
|
219
|
+
}, [filteredEntries.length, virtualizer])
|
|
220
|
+
|
|
221
|
+
const lineNumberWidth = Math.max(String(filteredEntries.length).length, 3)
|
|
222
|
+
|
|
223
|
+
function handleCopyAll() {
|
|
224
|
+
const text = entries
|
|
225
|
+
.map(
|
|
226
|
+
e =>
|
|
227
|
+
`[${formatTimestampFull(e.timestamp)}] [${LEVEL_LABELS[e.level]}] ${e.message}`,
|
|
228
|
+
)
|
|
229
|
+
.join('\n');
|
|
230
|
+
void copy(text)
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return (
|
|
234
|
+
<div
|
|
235
|
+
data-testid="log-viewer"
|
|
236
|
+
className={cn(
|
|
237
|
+
'flex flex-col overflow-hidden rounded-xl border border-border/60 bg-card shadow-sm',
|
|
238
|
+
className,
|
|
239
|
+
)}
|
|
240
|
+
>
|
|
241
|
+
<div className="flex items-center gap-2 border-b border-border/40 bg-muted/30 px-3 py-2">
|
|
242
|
+
<Terminal className="size-3.5 shrink-0 text-muted-foreground" />
|
|
243
|
+
<span className="flex-1 truncate text-sm font-medium text-foreground">
|
|
244
|
+
{resolvedTitle}
|
|
245
|
+
</span>
|
|
246
|
+
|
|
247
|
+
<span className="mr-1 text-[10px] tabular-nums text-muted-foreground">
|
|
248
|
+
{searchQuery
|
|
249
|
+
? t.linesFiltered(filteredEntries.length, entries.length)
|
|
250
|
+
: t.lines(filteredEntries.length)}
|
|
251
|
+
</span>
|
|
252
|
+
|
|
253
|
+
<div className="flex items-center gap-0.5">
|
|
254
|
+
<ToolbarButton
|
|
255
|
+
onClick={() => {
|
|
256
|
+
setSearchOpen(!searchOpen)
|
|
257
|
+
if (searchOpen) setSearchQuery('');
|
|
258
|
+
}}
|
|
259
|
+
label={searchOpen ? t.closeSearch : t.search}
|
|
260
|
+
active={searchOpen}
|
|
261
|
+
>
|
|
262
|
+
<Search className="size-3.5" />
|
|
263
|
+
</ToolbarButton>
|
|
264
|
+
|
|
265
|
+
<ToolbarButton
|
|
266
|
+
onClick={() => setPaused(!paused)}
|
|
267
|
+
label={paused ? t.resumeScroll : t.pauseScroll}
|
|
268
|
+
active={paused}
|
|
269
|
+
>
|
|
270
|
+
{paused ? (
|
|
271
|
+
<Play className="size-3.5" />
|
|
272
|
+
) : (
|
|
273
|
+
<Pause className="size-3.5" />
|
|
274
|
+
)}
|
|
275
|
+
</ToolbarButton>
|
|
276
|
+
|
|
277
|
+
<ToolbarButton
|
|
278
|
+
onClick={handleCopyAll}
|
|
279
|
+
label={copied ? t.copied : t.copyAll}
|
|
280
|
+
>
|
|
281
|
+
{copied ? (
|
|
282
|
+
<Check className="size-3.5 text-emerald-500" />
|
|
283
|
+
) : (
|
|
284
|
+
<Copy className="size-3.5" />
|
|
285
|
+
)}
|
|
286
|
+
</ToolbarButton>
|
|
287
|
+
|
|
288
|
+
<ToolbarButton onClick={() => exportLogs(entries)} label={t.download}>
|
|
289
|
+
<Download className="size-3.5" />
|
|
290
|
+
</ToolbarButton>
|
|
291
|
+
|
|
292
|
+
{onClear ? (
|
|
293
|
+
<ToolbarButton onClick={onClear} label={t.clear}>
|
|
294
|
+
<Trash2 className="size-3.5" />
|
|
295
|
+
</ToolbarButton>
|
|
296
|
+
) : null}
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
{searchOpen ? (
|
|
301
|
+
<div className="flex items-center gap-2 border-b border-border/40 bg-muted/20 px-3 py-1.5">
|
|
302
|
+
<Search className="size-3.5 shrink-0 text-muted-foreground" />
|
|
303
|
+
<input
|
|
304
|
+
type="text"
|
|
305
|
+
value={searchQuery}
|
|
306
|
+
onChange={e => setSearchQuery(e.target.value)}
|
|
307
|
+
placeholder={t.filterPlaceholder}
|
|
308
|
+
className="flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground"
|
|
309
|
+
/>
|
|
310
|
+
{searchQuery ? (
|
|
311
|
+
<button
|
|
312
|
+
type="button"
|
|
313
|
+
onClick={() => setSearchQuery('')}
|
|
314
|
+
className="inline-flex size-5 items-center justify-center rounded text-muted-foreground hover:text-foreground"
|
|
315
|
+
aria-label={t.clearSearch}
|
|
316
|
+
>
|
|
317
|
+
<X className="size-3" />
|
|
318
|
+
</button>
|
|
319
|
+
) : null}
|
|
320
|
+
</div>
|
|
321
|
+
) : null}
|
|
322
|
+
|
|
323
|
+
<div
|
|
324
|
+
ref={parentRef}
|
|
325
|
+
onScroll={handleScroll}
|
|
326
|
+
className="overflow-auto bg-card font-mono text-xs leading-relaxed [scrollbar-width:thin]"
|
|
327
|
+
style={{ maxHeight }}
|
|
328
|
+
role="log"
|
|
329
|
+
aria-live="polite"
|
|
330
|
+
aria-label={resolvedTitle}
|
|
331
|
+
>
|
|
332
|
+
{filteredEntries.length === 0 ? (
|
|
333
|
+
<div className="flex items-center justify-center py-10 text-sm text-muted-foreground">
|
|
334
|
+
{searchQuery ? t.emptySearch : t.empty}
|
|
335
|
+
</div>
|
|
336
|
+
) : (
|
|
337
|
+
<div
|
|
338
|
+
style={{
|
|
339
|
+
height: virtualizer.getTotalSize(),
|
|
340
|
+
position: 'relative',
|
|
341
|
+
width: '100%',
|
|
342
|
+
}}
|
|
343
|
+
>
|
|
344
|
+
{virtualizer.getVirtualItems().map((item) => {
|
|
345
|
+
const entry = filteredEntries[item.index]
|
|
346
|
+
if (!entry) return null
|
|
347
|
+
const colors = DEFAULT_LEVEL_COLORS[entry.level]
|
|
348
|
+
return (
|
|
349
|
+
<div
|
|
350
|
+
key={item.key}
|
|
351
|
+
data-index={item.index}
|
|
352
|
+
ref={virtualizer.measureElement}
|
|
353
|
+
className="absolute left-0 flex w-full gap-3 border-b border-border/20 px-3 py-1 transition-colors hover:bg-muted/30"
|
|
354
|
+
style={{
|
|
355
|
+
top: item.start,
|
|
356
|
+
height: item.size,
|
|
357
|
+
}}
|
|
358
|
+
>
|
|
359
|
+
{lineNumbers ? (
|
|
360
|
+
<span
|
|
361
|
+
className="shrink-0 select-none text-right text-muted-foreground/50"
|
|
362
|
+
style={{ width: `${lineNumberWidth}ch` }}
|
|
363
|
+
aria-hidden="true"
|
|
364
|
+
>
|
|
365
|
+
{item.index + 1}
|
|
366
|
+
</span>
|
|
367
|
+
) : null}
|
|
368
|
+
{timestamps ? (
|
|
369
|
+
<span className="shrink-0 text-muted-foreground/60">
|
|
370
|
+
{formatTimestampFull(entry.timestamp)}
|
|
371
|
+
</span>
|
|
372
|
+
) : null}
|
|
373
|
+
<span
|
|
374
|
+
className={cn(
|
|
375
|
+
'w-[3ch] shrink-0 text-right font-semibold',
|
|
376
|
+
colors.text,
|
|
377
|
+
)}
|
|
378
|
+
>
|
|
379
|
+
{LEVEL_LABELS[entry.level]}
|
|
380
|
+
</span>
|
|
381
|
+
<span className="min-w-0 flex-1 truncate whitespace-pre text-foreground/90">
|
|
382
|
+
{highlightSearch(entry.message, searchQuery)}
|
|
383
|
+
</span>
|
|
384
|
+
</div>
|
|
385
|
+
)
|
|
386
|
+
})}
|
|
387
|
+
</div>
|
|
388
|
+
)}
|
|
389
|
+
</div>
|
|
390
|
+
|
|
391
|
+
{!isAtBottom ? (
|
|
392
|
+
<button
|
|
393
|
+
type="button"
|
|
394
|
+
onClick={scrollToBottom}
|
|
395
|
+
className="flex w-full items-center justify-center gap-1.5 border-t border-border/40 bg-muted/30 py-1.5 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground"
|
|
396
|
+
aria-label={t.scrollLatest}
|
|
397
|
+
>
|
|
398
|
+
<ArrowDown className="size-3" />
|
|
399
|
+
{t.newBelow}
|
|
400
|
+
</button>
|
|
401
|
+
) : null}
|
|
402
|
+
</div>
|
|
403
|
+
)
|
|
404
|
+
}
|