@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,77 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { Button } from '@mohou/ui/components/button'
|
|
5
|
+
import { CodeEditor } from '@mohou/ui/products/code-editor'
|
|
6
|
+
import { Markdown } from '@mohou/ui/products/markdown'
|
|
7
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
8
|
+
import { useLabels } from '@mohou/ui/i18n/context'
|
|
9
|
+
|
|
10
|
+
export type MarkdownEditorMode = 'edit' | 'split' | 'preview'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Markdown edit + preview toggle.
|
|
14
|
+
* @when Authoring md bodies. Read-only render → `Markdown`.
|
|
15
|
+
* @example
|
|
16
|
+
* <MarkdownEditor value={md} onChange={(v) => set(v)} />
|
|
17
|
+
* @family Rich text
|
|
18
|
+
*/
|
|
19
|
+
export function MarkdownEditor({
|
|
20
|
+
value,
|
|
21
|
+
onChange,
|
|
22
|
+
mode = 'split',
|
|
23
|
+
onModeChange,
|
|
24
|
+
}: {
|
|
25
|
+
value: string
|
|
26
|
+
onChange?: (value: string) => void
|
|
27
|
+
mode?: MarkdownEditorMode | undefined
|
|
28
|
+
onModeChange?: (mode: MarkdownEditorMode) => void
|
|
29
|
+
}) {
|
|
30
|
+
const t = useLabels('markdownEditor')
|
|
31
|
+
const [currentMode, setCurrentMode] = React.useState<MarkdownEditorMode>(mode)
|
|
32
|
+
React.useEffect(() => setCurrentMode(mode), [mode])
|
|
33
|
+
const setMode = (next: MarkdownEditorMode) => {
|
|
34
|
+
setCurrentMode(next)
|
|
35
|
+
onModeChange?.(next)
|
|
36
|
+
}
|
|
37
|
+
return (
|
|
38
|
+
<div data-testid="markdown-editor" className="overflow-hidden rounded-xl border bg-card">
|
|
39
|
+
<div className="flex items-center gap-1 border-b p-1">
|
|
40
|
+
{(['edit', 'split', 'preview'] as const).map(item => (
|
|
41
|
+
<Button
|
|
42
|
+
key={item}
|
|
43
|
+
size="sm"
|
|
44
|
+
variant={currentMode === item ? 'default' : 'ghost'}
|
|
45
|
+
data-testid={`markdown-mode-${item}`}
|
|
46
|
+
onClick={() => setMode(item)}
|
|
47
|
+
>
|
|
48
|
+
{t[item]}
|
|
49
|
+
</Button>
|
|
50
|
+
))}
|
|
51
|
+
</div>
|
|
52
|
+
<div
|
|
53
|
+
className={cn(
|
|
54
|
+
'grid min-h-[280px]',
|
|
55
|
+
currentMode === 'split' ? 'md:grid-cols-2' : 'grid-cols-1'
|
|
56
|
+
)}
|
|
57
|
+
>
|
|
58
|
+
{currentMode !== 'preview' ? (
|
|
59
|
+
<div className={cn(currentMode === 'split' && 'border-b md:border-r md:border-b-0')}>
|
|
60
|
+
<CodeEditor
|
|
61
|
+
value={value}
|
|
62
|
+
onChange={onChange}
|
|
63
|
+
language="md"
|
|
64
|
+
height="280px"
|
|
65
|
+
className="rounded-none border-0"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
) : null}
|
|
69
|
+
{currentMode !== 'edit' ? (
|
|
70
|
+
<div className="overflow-auto p-3" data-testid="markdown-preview">
|
|
71
|
+
<Markdown>{value}</Markdown>
|
|
72
|
+
</div>
|
|
73
|
+
) : null}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
import ReactMarkdown from 'react-markdown'
|
|
3
|
+
import remarkGfm from 'remark-gfm'
|
|
4
|
+
|
|
5
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Render a markdown string. The component owns the reading styles.
|
|
9
|
+
* `className` overrides. A normal document does not add its own.
|
|
10
|
+
* @when Model output, README-ish bodies. Children must be a string.
|
|
11
|
+
* @example
|
|
12
|
+
* <Markdown>{text}</Markdown>
|
|
13
|
+
* @family Rich text
|
|
14
|
+
*/
|
|
15
|
+
export function Markdown({
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
}: {
|
|
19
|
+
children: string
|
|
20
|
+
className?: string
|
|
21
|
+
}) {
|
|
22
|
+
return (
|
|
23
|
+
<div data-testid="markdown" className={cn(markdownClass, className)}>
|
|
24
|
+
<ReactMarkdown remarkPlugins={[remarkGfm]}>{children}</ReactMarkdown>
|
|
25
|
+
</div>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const markdownClass = [
|
|
30
|
+
'max-w-full overflow-x-auto text-sm leading-relaxed',
|
|
31
|
+
'[&_h1]:mt-5 [&_h1]:mb-2 [&_h1]:text-lg [&_h1]:font-semibold [&_h1]:tracking-tight',
|
|
32
|
+
'[&_h2]:mt-4 [&_h2]:mb-2 [&_h2]:text-base [&_h2]:font-semibold',
|
|
33
|
+
'[&_h3]:mt-3 [&_h3]:mb-1.5 [&_h3]:text-sm [&_h3]:font-semibold',
|
|
34
|
+
'[&_h4]:mt-3 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:font-medium',
|
|
35
|
+
'[&_p]:my-2 [&_p:first-child]:mt-0 [&_p:last-child]:mb-0',
|
|
36
|
+
'[&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5',
|
|
37
|
+
'[&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5',
|
|
38
|
+
'[&_li]:my-1 [&_li]:pl-0.5',
|
|
39
|
+
'[&_a]:underline [&_a]:underline-offset-2',
|
|
40
|
+
'[&_strong]:font-semibold',
|
|
41
|
+
'[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em]',
|
|
42
|
+
'[&_pre]:my-3 [&_pre]:overflow-auto [&_pre]:rounded-lg [&_pre]:border [&_pre]:bg-muted/40 [&_pre]:p-3',
|
|
43
|
+
'[&_pre_code]:bg-transparent [&_pre_code]:p-0',
|
|
44
|
+
'[&_blockquote]:my-3 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground',
|
|
45
|
+
'[&_hr]:my-4 [&_hr]:border-border',
|
|
46
|
+
'[&_table]:my-3 [&_table]:w-full [&_table]:border-collapse [&_table]:text-left',
|
|
47
|
+
'[&_th]:border [&_th]:border-border [&_th]:bg-muted/70 [&_th]:px-2 [&_th]:py-1.5 [&_th]:text-left [&_th]:font-medium [&_th]:align-top',
|
|
48
|
+
'[&_td]:border [&_td]:border-border [&_td]:px-2 [&_td]:py-1.5 [&_td]:align-top',
|
|
49
|
+
'[&_img]:max-w-full',
|
|
50
|
+
].join(' ')
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { Bold, Code, Italic, List, ListOrdered } from 'lucide-react'
|
|
4
|
+
|
|
5
|
+
import { Button } from '@mohou/ui/components/button'
|
|
6
|
+
import { useLabels } from '@mohou/ui/i18n/context'
|
|
7
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
8
|
+
|
|
9
|
+
function runCommand(command: string, value?: string) {
|
|
10
|
+
// Same primitive as react-simple-wysiwyg. Deprecated, still what lightweight
|
|
11
|
+
// browsers expose for simple WYSIWYG; no TipTap / CDN / second React.
|
|
12
|
+
document.execCommand(command, false, value)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Lightweight rich-text editor (contentEditable + toolbar), same idea as
|
|
17
|
+
* `react-simple-wysiwyg`. HTML is browser-generated — sanitize server-side if needed.
|
|
18
|
+
* @family Rich text
|
|
19
|
+
* @when Notes/descriptions you store as **HTML**. Markdown → `MarkdownEditor`; code → `CodeEditor`. Sanitize server-side before rendering elsewhere.
|
|
20
|
+
*/
|
|
21
|
+
export function RichTextEditor({
|
|
22
|
+
value = '<p></p>',
|
|
23
|
+
onChange,
|
|
24
|
+
placeholder,
|
|
25
|
+
}: {
|
|
26
|
+
value?: string
|
|
27
|
+
onChange?: (html: string) => void
|
|
28
|
+
placeholder?: string
|
|
29
|
+
}) {
|
|
30
|
+
const t = useLabels('richText')
|
|
31
|
+
const ref = React.useRef<HTMLDivElement>(null)
|
|
32
|
+
const ph = placeholder ?? t.placeholder
|
|
33
|
+
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
const el = ref.current
|
|
36
|
+
if (!el) return
|
|
37
|
+
if (el.innerHTML !== value) el.innerHTML = value || ''
|
|
38
|
+
}, [value])
|
|
39
|
+
|
|
40
|
+
const emit = () => {
|
|
41
|
+
onChange?.(ref.current?.innerHTML ?? '')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const cmd = (command: string, arg?: string) => (e: React.MouseEvent) => {
|
|
45
|
+
e.preventDefault()
|
|
46
|
+
ref.current?.focus()
|
|
47
|
+
runCommand(command, arg)
|
|
48
|
+
emit()
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<div data-testid="rich-text-editor" className="overflow-hidden rounded-xl border bg-card">
|
|
53
|
+
<div className="flex flex-wrap gap-0.5 border-b p-1">
|
|
54
|
+
<Button type="button" size="sm" variant="ghost" aria-label={t.bold} onMouseDown={cmd('bold')}>
|
|
55
|
+
<Bold className="size-3.5" />
|
|
56
|
+
</Button>
|
|
57
|
+
<Button type="button" size="sm" variant="ghost" aria-label={t.italic} onMouseDown={cmd('italic')}>
|
|
58
|
+
<Italic className="size-3.5" />
|
|
59
|
+
</Button>
|
|
60
|
+
<Button type="button" size="sm" variant="ghost" aria-label={t.code} onMouseDown={cmd('formatBlock', 'pre')}>
|
|
61
|
+
<Code className="size-3.5" />
|
|
62
|
+
</Button>
|
|
63
|
+
<Button type="button" size="sm" variant="ghost" aria-label={t.bullet} onMouseDown={cmd('insertUnorderedList')}>
|
|
64
|
+
<List className="size-3.5" />
|
|
65
|
+
</Button>
|
|
66
|
+
<Button type="button" size="sm" variant="ghost" aria-label={t.ordered} onMouseDown={cmd('insertOrderedList')}>
|
|
67
|
+
<ListOrdered className="size-3.5" />
|
|
68
|
+
</Button>
|
|
69
|
+
</div>
|
|
70
|
+
<div
|
|
71
|
+
ref={ref}
|
|
72
|
+
role="textbox"
|
|
73
|
+
aria-multiline="true"
|
|
74
|
+
aria-placeholder={ph}
|
|
75
|
+
contentEditable
|
|
76
|
+
suppressContentEditableWarning
|
|
77
|
+
data-placeholder={ph}
|
|
78
|
+
className={cn(
|
|
79
|
+
'min-h-40 px-3 py-2 text-sm outline-none',
|
|
80
|
+
'[&_ul]:list-disc [&_ul]:pl-6 [&_ol]:list-decimal [&_ol]:pl-6',
|
|
81
|
+
'[&_pre]:rounded-md [&_pre]:bg-muted [&_pre]:px-2 [&_pre]:py-1 [&_pre]:font-mono [&_pre]:text-xs',
|
|
82
|
+
'empty:before:pointer-events-none empty:before:text-muted-foreground empty:before:content-[attr(data-placeholder)]',
|
|
83
|
+
)}
|
|
84
|
+
onInput={emit}
|
|
85
|
+
onBlur={emit}
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
DndContext,
|
|
4
|
+
closestCenter,
|
|
5
|
+
type DragEndEvent,
|
|
6
|
+
} from '@dnd-kit/core'
|
|
7
|
+
import {
|
|
8
|
+
SortableContext,
|
|
9
|
+
arrayMove,
|
|
10
|
+
useSortable,
|
|
11
|
+
verticalListSortingStrategy,
|
|
12
|
+
} from '@dnd-kit/sortable'
|
|
13
|
+
import { CSS } from '@dnd-kit/utilities'
|
|
14
|
+
import { GripVertical } from 'lucide-react'
|
|
15
|
+
|
|
16
|
+
export type SortableItem = { id: string; label: string }
|
|
17
|
+
|
|
18
|
+
function Row({ item }: { item: SortableItem }) {
|
|
19
|
+
const { attributes, listeners, setNodeRef, transform, transition } =
|
|
20
|
+
useSortable({ id: item.id })
|
|
21
|
+
return (
|
|
22
|
+
<div
|
|
23
|
+
ref={setNodeRef}
|
|
24
|
+
style={{ transform: CSS.Transform.toString(transform), transition }}
|
|
25
|
+
className="flex items-center gap-2 rounded-lg border bg-card px-2 py-1.5 text-sm"
|
|
26
|
+
>
|
|
27
|
+
<button type="button" className="text-muted-foreground" {...attributes} {...listeners}>
|
|
28
|
+
<GripVertical className="size-3.5" />
|
|
29
|
+
</button>
|
|
30
|
+
{item.label}
|
|
31
|
+
</div>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Drag-to-reorder list.
|
|
37
|
+
* @when Priority queues / column order. Read-only ordered events → `Timeline`.
|
|
38
|
+
* @example
|
|
39
|
+
* <SortableList items={items} onChange={(next) => set(next)} />
|
|
40
|
+
* @family Data & tables
|
|
41
|
+
*/
|
|
42
|
+
export function SortableList({
|
|
43
|
+
items,
|
|
44
|
+
onChange,
|
|
45
|
+
}: {
|
|
46
|
+
items: SortableItem[]
|
|
47
|
+
onChange?: (items: SortableItem[]) => void
|
|
48
|
+
}) {
|
|
49
|
+
const onDragEnd = (event: DragEndEvent) => {
|
|
50
|
+
const { active, over } = event
|
|
51
|
+
if (!over || active.id === over.id) return
|
|
52
|
+
const oldIndex = items.findIndex(item => item.id === active.id)
|
|
53
|
+
const newIndex = items.findIndex(item => item.id === over.id)
|
|
54
|
+
onChange?.(arrayMove(items, oldIndex, newIndex))
|
|
55
|
+
}
|
|
56
|
+
return (
|
|
57
|
+
<DndContext collisionDetection={closestCenter} onDragEnd={onDragEnd}>
|
|
58
|
+
<SortableContext items={items.map(item => item.id)} strategy={verticalListSortingStrategy}>
|
|
59
|
+
<div className="flex flex-col gap-1.5" data-testid="sortable-list">
|
|
60
|
+
{items.map(item => (
|
|
61
|
+
<Row key={item.id} item={item} />
|
|
62
|
+
))}
|
|
63
|
+
</div>
|
|
64
|
+
</SortableContext>
|
|
65
|
+
</DndContext>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Check } from 'lucide-react';
|
|
4
|
+
|
|
5
|
+
import { cn } from '@mohou/ui/lib/utils';
|
|
6
|
+
|
|
7
|
+
export type StepStatus = 'default' | 'active' | 'completed';
|
|
8
|
+
|
|
9
|
+
export interface StepperProps {
|
|
10
|
+
/** StepperItem elements. */
|
|
11
|
+
children: React.ReactNode
|
|
12
|
+
/** Layout direction. Defaults to "vertical". */
|
|
13
|
+
orientation?: 'vertical' | 'horizontal' | undefined
|
|
14
|
+
className?: string | undefined
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface StepperItemProps {
|
|
18
|
+
/** Step heading text. */
|
|
19
|
+
title: string
|
|
20
|
+
/** Optional description below the title. */
|
|
21
|
+
description?: string | undefined
|
|
22
|
+
/** Override the auto-incremented step number. */
|
|
23
|
+
step?: number | undefined
|
|
24
|
+
/** Visual status of this step. Defaults to "default". */
|
|
25
|
+
status?: StepStatus | undefined
|
|
26
|
+
/** Custom icon to replace the step number circle. */
|
|
27
|
+
icon?: React.ReactNode | undefined
|
|
28
|
+
/** Content rendered below the step header (code blocks, text, etc.). */
|
|
29
|
+
children?: React.ReactNode | undefined
|
|
30
|
+
className?: string | undefined
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* One step inside `Stepper` (title, description, status).
|
|
35
|
+
* @family Feedback & status
|
|
36
|
+
* @when As a child of `Stepper` only — status is `default | active | completed` (lowercase).
|
|
37
|
+
*/
|
|
38
|
+
export function StepperItem({
|
|
39
|
+
title,
|
|
40
|
+
description,
|
|
41
|
+
step,
|
|
42
|
+
status = 'default',
|
|
43
|
+
icon,
|
|
44
|
+
children,
|
|
45
|
+
className,
|
|
46
|
+
}: StepperItemProps) {
|
|
47
|
+
const stepNumber = step ?? 1
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div
|
|
51
|
+
data-slot="stepper-item"
|
|
52
|
+
data-status={status}
|
|
53
|
+
className={cn('group/step relative', className)}
|
|
54
|
+
>
|
|
55
|
+
<div className="flex gap-3">
|
|
56
|
+
<div className="flex shrink-0 flex-col items-center self-stretch">
|
|
57
|
+
<div
|
|
58
|
+
className={cn(
|
|
59
|
+
'relative z-10 flex size-8 shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors',
|
|
60
|
+
status === 'completed' &&
|
|
61
|
+
'border-primary bg-primary text-primary-foreground',
|
|
62
|
+
status === 'active' &&
|
|
63
|
+
'border-primary bg-primary/10 text-primary',
|
|
64
|
+
status === 'default' &&
|
|
65
|
+
'border-border bg-background text-muted-foreground'
|
|
66
|
+
)}
|
|
67
|
+
>
|
|
68
|
+
{icon ? (
|
|
69
|
+
icon
|
|
70
|
+
) : status === 'completed' ? (
|
|
71
|
+
<Check className="size-3.5" aria-hidden="true" />
|
|
72
|
+
) : (
|
|
73
|
+
<span className="text-xs">{stepNumber}</span>
|
|
74
|
+
)}
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div
|
|
78
|
+
className={cn(
|
|
79
|
+
'w-px min-h-4 grow',
|
|
80
|
+
status === 'completed'
|
|
81
|
+
? 'bg-primary'
|
|
82
|
+
: 'bg-border dark:bg-muted-foreground/25',
|
|
83
|
+
'group-last/step:hidden'
|
|
84
|
+
)}
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<div className="flex min-w-0 flex-col gap-1 pb-6 pt-1 group-last/step:pb-0">
|
|
89
|
+
<div className="flex flex-col gap-0.5">
|
|
90
|
+
<h3 className="text-sm font-semibold leading-tight text-foreground">
|
|
91
|
+
{title}
|
|
92
|
+
</h3>
|
|
93
|
+
{description ? (
|
|
94
|
+
<p className="text-sm text-muted-foreground">{description}</p>
|
|
95
|
+
) : null}
|
|
96
|
+
</div>
|
|
97
|
+
{children ? <div className="mt-2">{children}</div> : null}
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function VerticalStepper({
|
|
105
|
+
children,
|
|
106
|
+
className,
|
|
107
|
+
}: {
|
|
108
|
+
children: React.ReactNode
|
|
109
|
+
className?: string | undefined
|
|
110
|
+
}) {
|
|
111
|
+
const items = React.Children.toArray(children).filter(React.isValidElement)
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<div
|
|
115
|
+
data-testid="stepper"
|
|
116
|
+
data-slot="stepper"
|
|
117
|
+
data-orientation="vertical"
|
|
118
|
+
className={cn('flex flex-col', className)}
|
|
119
|
+
>
|
|
120
|
+
{items.map((child, index) => {
|
|
121
|
+
if (!React.isValidElement<StepperItemProps>(child)) return child
|
|
122
|
+
return React.cloneElement(child, {
|
|
123
|
+
step: child.props.step ?? index + 1,
|
|
124
|
+
key: child.key ?? index,
|
|
125
|
+
})
|
|
126
|
+
})}
|
|
127
|
+
</div>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function HorizontalStepper({
|
|
132
|
+
children,
|
|
133
|
+
className,
|
|
134
|
+
}: {
|
|
135
|
+
children: React.ReactNode
|
|
136
|
+
className?: string | undefined
|
|
137
|
+
}) {
|
|
138
|
+
const items = React.Children.toArray(children).filter(React.isValidElement)
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<div
|
|
142
|
+
data-testid="stepper"
|
|
143
|
+
data-slot="stepper"
|
|
144
|
+
data-orientation="horizontal"
|
|
145
|
+
className={cn('flex flex-col gap-4', className)}
|
|
146
|
+
>
|
|
147
|
+
<div className="flex items-center">
|
|
148
|
+
{items.map((child, index) => {
|
|
149
|
+
if (!React.isValidElement<StepperItemProps>(child)) return null
|
|
150
|
+
const { status = 'default', icon, step: stepProp } = child.props
|
|
151
|
+
const stepNumber = stepProp ?? index + 1
|
|
152
|
+
const isLast = index === items.length - 1
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<React.Fragment key={child.key ?? index}>
|
|
156
|
+
<div className="flex flex-col items-center gap-1.5">
|
|
157
|
+
<div
|
|
158
|
+
className={cn(
|
|
159
|
+
'flex size-8 shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors',
|
|
160
|
+
status === 'completed' &&
|
|
161
|
+
'border-primary bg-primary text-primary-foreground',
|
|
162
|
+
status === 'active' &&
|
|
163
|
+
'border-primary bg-primary/10 text-primary',
|
|
164
|
+
status === 'default' &&
|
|
165
|
+
'border-border bg-background text-muted-foreground'
|
|
166
|
+
)}
|
|
167
|
+
>
|
|
168
|
+
{icon ? (
|
|
169
|
+
icon
|
|
170
|
+
) : status === 'completed' ? (
|
|
171
|
+
<Check className="size-3.5" aria-hidden="true" />
|
|
172
|
+
) : (
|
|
173
|
+
<span className="text-xs">{stepNumber}</span>
|
|
174
|
+
)}
|
|
175
|
+
</div>
|
|
176
|
+
<span
|
|
177
|
+
className={cn(
|
|
178
|
+
'max-w-[8rem] text-center text-xs font-medium',
|
|
179
|
+
status === 'default'
|
|
180
|
+
? 'text-muted-foreground'
|
|
181
|
+
: 'text-foreground'
|
|
182
|
+
)}
|
|
183
|
+
>
|
|
184
|
+
{child.props.title}
|
|
185
|
+
</span>
|
|
186
|
+
</div>
|
|
187
|
+
{!isLast ? (
|
|
188
|
+
<div
|
|
189
|
+
className={cn(
|
|
190
|
+
'mb-5 h-px flex-1',
|
|
191
|
+
status === 'completed' ? 'bg-primary' : 'bg-border'
|
|
192
|
+
)}
|
|
193
|
+
/>
|
|
194
|
+
) : null}
|
|
195
|
+
</React.Fragment>
|
|
196
|
+
)
|
|
197
|
+
})}
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
{items.map((child, index) => {
|
|
201
|
+
if (!React.isValidElement<StepperItemProps>(child)) return null
|
|
202
|
+
const { status = 'default', description, children: stepChildren } =
|
|
203
|
+
child.props
|
|
204
|
+
if (status !== 'active') return null
|
|
205
|
+
|
|
206
|
+
return (
|
|
207
|
+
<div key={child.key ?? index} className="flex flex-col gap-1.5">
|
|
208
|
+
{description ? (
|
|
209
|
+
<p className="text-sm text-muted-foreground">{description}</p>
|
|
210
|
+
) : null}
|
|
211
|
+
{stepChildren ? <div>{stepChildren}</div> : null}
|
|
212
|
+
</div>
|
|
213
|
+
)
|
|
214
|
+
})}
|
|
215
|
+
</div>
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Numbered steps with status; children are `StepperItem`.
|
|
221
|
+
* @family Feedback & status
|
|
222
|
+
* @when Wizard/progress of an ordered process. Time axis → `RunTimeline`.
|
|
223
|
+
* @example
|
|
224
|
+
* <Stepper><StepperItem title="上传" status="pass" /><StepperItem title="校验" status="running" /></Stepper>
|
|
225
|
+
*/
|
|
226
|
+
export function Stepper({
|
|
227
|
+
children,
|
|
228
|
+
orientation = 'vertical',
|
|
229
|
+
className,
|
|
230
|
+
}: StepperProps) {
|
|
231
|
+
if (orientation === 'horizontal') {
|
|
232
|
+
return (
|
|
233
|
+
<HorizontalStepper className={className}>{children}</HorizontalStepper>
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
return <VerticalStepper className={className}>{children}</VerticalStepper>
|
|
237
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
2
|
+
|
|
3
|
+
export type TimelineItem = {
|
|
4
|
+
id: string
|
|
5
|
+
title: string
|
|
6
|
+
description?: string
|
|
7
|
+
time?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Vertical ordered events.
|
|
12
|
+
* @when Statuses/history without durations. Durations → `RunTimeline`.
|
|
13
|
+
* @example
|
|
14
|
+
* <Timeline items={[{ id: "1", title: "已创建", time: "09:00" }]} />
|
|
15
|
+
* @family Realtime
|
|
16
|
+
*/
|
|
17
|
+
export function Timeline({ items }: { items: TimelineItem[] }) {
|
|
18
|
+
return (
|
|
19
|
+
<ol className="relative space-y-4 border-l pl-4" data-testid="timeline">
|
|
20
|
+
{items.map((item, index) => (
|
|
21
|
+
<li key={item.id} className="relative">
|
|
22
|
+
<span
|
|
23
|
+
className={cn(
|
|
24
|
+
'absolute top-1.5 -left-[21px] size-2.5 rounded-full border bg-background',
|
|
25
|
+
index === 0 ? 'border-primary bg-primary' : 'border-muted-foreground/40'
|
|
26
|
+
)}
|
|
27
|
+
/>
|
|
28
|
+
<div className="text-sm font-medium">{item.title}</div>
|
|
29
|
+
{item.description ? (
|
|
30
|
+
<p className="text-muted-foreground text-xs">{item.description}</p>
|
|
31
|
+
) : null}
|
|
32
|
+
{item.time ? (
|
|
33
|
+
<p className="text-muted-foreground mt-0.5 text-[11px]">{item.time}</p>
|
|
34
|
+
) : null}
|
|
35
|
+
</li>
|
|
36
|
+
))}
|
|
37
|
+
</ol>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { ChevronRight } from 'lucide-react'
|
|
4
|
+
|
|
5
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
6
|
+
|
|
7
|
+
export type TreeNode = {
|
|
8
|
+
id: string
|
|
9
|
+
label: string
|
|
10
|
+
children?: TreeNode[]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function Node({
|
|
14
|
+
node,
|
|
15
|
+
depth,
|
|
16
|
+
}: {
|
|
17
|
+
node: TreeNode
|
|
18
|
+
depth: number
|
|
19
|
+
}) {
|
|
20
|
+
const [open, setOpen] = React.useState(true)
|
|
21
|
+
const hasChildren = Boolean(node.children?.length)
|
|
22
|
+
return (
|
|
23
|
+
<div>
|
|
24
|
+
<button
|
|
25
|
+
type="button"
|
|
26
|
+
className="flex w-full items-center gap-1 rounded-md px-1 py-0.5 text-left text-sm hover:bg-muted"
|
|
27
|
+
style={{ paddingLeft: depth * 12 }}
|
|
28
|
+
onClick={() => hasChildren && setOpen(value => !value)}
|
|
29
|
+
>
|
|
30
|
+
<ChevronRight
|
|
31
|
+
className={cn(
|
|
32
|
+
'size-3.5 text-muted-foreground transition',
|
|
33
|
+
hasChildren ? (open ? 'rotate-90' : '') : 'opacity-0'
|
|
34
|
+
)}
|
|
35
|
+
/>
|
|
36
|
+
{node.label}
|
|
37
|
+
</button>
|
|
38
|
+
{open && hasChildren
|
|
39
|
+
? node.children!.map(child => (
|
|
40
|
+
<Node key={child.id} node={child} depth={depth + 1} />
|
|
41
|
+
))
|
|
42
|
+
: null}
|
|
43
|
+
</div>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Generic expandable node list.
|
|
49
|
+
* @when Any hierarchy without file semantics. Files → `FileTree`.
|
|
50
|
+
* @example
|
|
51
|
+
* <TreeView nodes={[{ id: "a", label: "华东" }]} />
|
|
52
|
+
* @family Data & tables
|
|
53
|
+
*/
|
|
54
|
+
export function TreeView({ nodes }: { nodes: TreeNode[] }) {
|
|
55
|
+
return (
|
|
56
|
+
<div data-testid="tree-view">
|
|
57
|
+
{nodes.map(node => (
|
|
58
|
+
<Node key={node.id} node={node} depth={0} />
|
|
59
|
+
))}
|
|
60
|
+
</div>
|
|
61
|
+
)
|
|
62
|
+
}
|