@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,643 @@
|
|
|
1
|
+
|
|
2
|
+
import type { ComponentProps, CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import type { UiMessages } from '@mohou/ui/i18n/en';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Avatar,
|
|
7
|
+
AvatarFallback,
|
|
8
|
+
AvatarImage,
|
|
9
|
+
} from '@mohou/ui/components/avatar';
|
|
10
|
+
import {
|
|
11
|
+
Popover,
|
|
12
|
+
PopoverContent,
|
|
13
|
+
PopoverTrigger,
|
|
14
|
+
} from '@mohou/ui/components/popover';
|
|
15
|
+
import { useDateLocale, useLabels } from '@mohou/ui/i18n/context';
|
|
16
|
+
import { cn } from '@mohou/ui/lib/utils';
|
|
17
|
+
|
|
18
|
+
export type CommitAuthor = {
|
|
19
|
+
name: string
|
|
20
|
+
avatarUrl?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type Commit = {
|
|
24
|
+
/** Commit hash (full or abbreviated). */
|
|
25
|
+
hash: string
|
|
26
|
+
/** Commit message (first line). */
|
|
27
|
+
message: string
|
|
28
|
+
/** Commit author. */
|
|
29
|
+
author: CommitAuthor
|
|
30
|
+
/** ISO date string or Date object. */
|
|
31
|
+
date: string | Date
|
|
32
|
+
/** Parent commit hashes. Empty for root commits. Two parents = merge commit. */
|
|
33
|
+
parents: string[]
|
|
34
|
+
/** Branch or ref label (e.g. "main", "feat/auth"). */
|
|
35
|
+
refs?: string[]
|
|
36
|
+
/** Tag label (e.g. "v1.0.0"). */
|
|
37
|
+
tag?: string
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type CommitGraphProps = Omit<ComponentProps<'div'>, 'children'> & {
|
|
41
|
+
/** Commits in topological order (newest first). Each commit includes parent hashes. */
|
|
42
|
+
commits: Commit[]
|
|
43
|
+
/** Number of hash characters to display. @default 7 */
|
|
44
|
+
truncateHash?: number
|
|
45
|
+
/** Pixel width per rail column. @default 24 */
|
|
46
|
+
railWidth?: number
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const RAIL_COLORS = [
|
|
50
|
+
'#3b82f6',
|
|
51
|
+
'#22c55e',
|
|
52
|
+
'#f59e0b',
|
|
53
|
+
'#ef4444',
|
|
54
|
+
'#8b5cf6',
|
|
55
|
+
'#ec4899',
|
|
56
|
+
'#06b6d4',
|
|
57
|
+
'#f97316',
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
function color(rail: number): string {
|
|
61
|
+
return RAIL_COLORS[rail % RAIL_COLORS.length] ?? '#3b82f6';
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function initials(name: string): string {
|
|
65
|
+
return name
|
|
66
|
+
.split(/\s+/)
|
|
67
|
+
.map(w => w[0] ?? '')
|
|
68
|
+
.join('')
|
|
69
|
+
.toUpperCase()
|
|
70
|
+
.slice(0, 2)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Graph layout computation
|
|
74
|
+
|
|
75
|
+
type GraphRow = {
|
|
76
|
+
commit: Commit
|
|
77
|
+
rail: number
|
|
78
|
+
rails: (string | null)[]
|
|
79
|
+
edges: Edge[]
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
type Edge = {
|
|
83
|
+
fromRail: number
|
|
84
|
+
toRail: number
|
|
85
|
+
color: string
|
|
86
|
+
type: 'straight' | 'merge-in' | 'fork-out';
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function computeLayout(commits: Commit[]): GraphRow[] {
|
|
90
|
+
const rows: GraphRow[] = []
|
|
91
|
+
// Active rails: each slot holds the hash of the commit it's "waiting for"
|
|
92
|
+
const rails: (string | null)[] = []
|
|
93
|
+
|
|
94
|
+
for (const commit of commits) {
|
|
95
|
+
const hash = commit.hash
|
|
96
|
+
|
|
97
|
+
// Find which rail this commit occupies (if any rail is waiting for it)
|
|
98
|
+
let commitRail = rails.indexOf(hash)
|
|
99
|
+
|
|
100
|
+
if (commitRail === -1) {
|
|
101
|
+
// New branch — find first empty slot or append
|
|
102
|
+
const emptySlot = rails.indexOf(null)
|
|
103
|
+
if (emptySlot !== -1) {
|
|
104
|
+
commitRail = emptySlot
|
|
105
|
+
rails[commitRail] = hash
|
|
106
|
+
} else {
|
|
107
|
+
commitRail = rails.length
|
|
108
|
+
rails.push(hash)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const commitColor = color(commitRail)
|
|
113
|
+
const edges: Edge[] = []
|
|
114
|
+
|
|
115
|
+
// Draw straight lines for all other active rails (pass-through)
|
|
116
|
+
for (let r = 0; r < rails.length; r++) {
|
|
117
|
+
if (r !== commitRail && rails[r] !== null) {
|
|
118
|
+
edges.push({
|
|
119
|
+
fromRail: r,
|
|
120
|
+
toRail: r,
|
|
121
|
+
color: color(r),
|
|
122
|
+
type: 'straight',
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Clear this rail — the commit has been rendered
|
|
128
|
+
rails[commitRail] = null
|
|
129
|
+
|
|
130
|
+
// Process parents
|
|
131
|
+
const parents = commit.parents
|
|
132
|
+
const firstParent = parents[0]
|
|
133
|
+
if (firstParent !== undefined) {
|
|
134
|
+
// First parent continues on the same rail
|
|
135
|
+
const existingRail = rails.indexOf(firstParent)
|
|
136
|
+
if (existingRail !== -1) {
|
|
137
|
+
// Parent already expected on another rail — merge line
|
|
138
|
+
edges.push({
|
|
139
|
+
fromRail: commitRail,
|
|
140
|
+
toRail: existingRail,
|
|
141
|
+
color: commitColor,
|
|
142
|
+
type: 'merge-in',
|
|
143
|
+
})
|
|
144
|
+
} else {
|
|
145
|
+
// Parent takes this commit's rail
|
|
146
|
+
rails[commitRail] = firstParent
|
|
147
|
+
edges.push({
|
|
148
|
+
fromRail: commitRail,
|
|
149
|
+
toRail: commitRail,
|
|
150
|
+
color: commitColor,
|
|
151
|
+
type: 'straight',
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Second+ parents (merge sources)
|
|
157
|
+
for (let p = 1; p < parents.length; p++) {
|
|
158
|
+
const parentHash = parents[p]
|
|
159
|
+
if (parentHash === undefined) continue
|
|
160
|
+
const existingRail = rails.indexOf(parentHash)
|
|
161
|
+
if (existingRail !== -1) {
|
|
162
|
+
// Already on a rail — draw merge line from that rail
|
|
163
|
+
edges.push({
|
|
164
|
+
fromRail: existingRail,
|
|
165
|
+
toRail: commitRail,
|
|
166
|
+
color: color(existingRail),
|
|
167
|
+
type: 'merge-in',
|
|
168
|
+
})
|
|
169
|
+
} else {
|
|
170
|
+
// Needs a new rail — fork out
|
|
171
|
+
const emptySlot = rails.indexOf(null)
|
|
172
|
+
const newRail = emptySlot !== -1 ? emptySlot : rails.length
|
|
173
|
+
if (newRail >= rails.length) rails.push(null)
|
|
174
|
+
rails[newRail] = parentHash
|
|
175
|
+
edges.push({
|
|
176
|
+
fromRail: commitRail,
|
|
177
|
+
toRail: newRail,
|
|
178
|
+
color: color(newRail),
|
|
179
|
+
type: 'fork-out',
|
|
180
|
+
})
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Trim trailing nulls
|
|
185
|
+
while (rails.length > 0 && rails[rails.length - 1] === null) {
|
|
186
|
+
rails.pop()
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
rows.push({
|
|
190
|
+
commit,
|
|
191
|
+
rail: commitRail,
|
|
192
|
+
rails: [...rails],
|
|
193
|
+
edges,
|
|
194
|
+
})
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return rows
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// SVG rendering for rails
|
|
201
|
+
|
|
202
|
+
const ROW_HEIGHT = 40
|
|
203
|
+
|
|
204
|
+
function RailsSVG({
|
|
205
|
+
row,
|
|
206
|
+
prevRow,
|
|
207
|
+
railWidth,
|
|
208
|
+
maxRails,
|
|
209
|
+
}: {
|
|
210
|
+
row: GraphRow
|
|
211
|
+
prevRow: GraphRow | null
|
|
212
|
+
railWidth: number
|
|
213
|
+
maxRails: number
|
|
214
|
+
}) {
|
|
215
|
+
const w = maxRails * railWidth
|
|
216
|
+
const h = ROW_HEIGHT
|
|
217
|
+
const cy = h / 2
|
|
218
|
+
|
|
219
|
+
function rx(rail: number) {
|
|
220
|
+
return rail * railWidth + railWidth / 2
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const commitX = rx(row.rail)
|
|
224
|
+
|
|
225
|
+
// Collect which rails are active above this row (from previous row's post-state)
|
|
226
|
+
const activeAbove = new Set<number>()
|
|
227
|
+
if (prevRow) {
|
|
228
|
+
for (let r = 0; r < prevRow.rails.length; r++) {
|
|
229
|
+
if (prevRow.rails[r] !== null) activeAbove.add(r)
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Collect which rails are active below this row
|
|
234
|
+
const activeBelow = new Set<number>()
|
|
235
|
+
for (let r = 0; r < row.rails.length; r++) {
|
|
236
|
+
if (row.rails[r] !== null) activeBelow.add(r)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return (
|
|
240
|
+
<svg
|
|
241
|
+
width={w}
|
|
242
|
+
height={h}
|
|
243
|
+
viewBox={`0 0 ${w} ${h}`}
|
|
244
|
+
className="shrink-0"
|
|
245
|
+
aria-hidden="true"
|
|
246
|
+
>
|
|
247
|
+
{/* Pass-through rails */}
|
|
248
|
+
{Array.from(activeAbove).map((r) => {
|
|
249
|
+
if (r === row.rail) return null
|
|
250
|
+
if (!activeBelow.has(r)) return null
|
|
251
|
+
const x = rx(r)
|
|
252
|
+
return (
|
|
253
|
+
<line
|
|
254
|
+
key={`pt-${r}`}
|
|
255
|
+
x1={x}
|
|
256
|
+
y1={0}
|
|
257
|
+
x2={x}
|
|
258
|
+
y2={h}
|
|
259
|
+
stroke={color(r)}
|
|
260
|
+
strokeWidth={2}
|
|
261
|
+
strokeOpacity={0.6}
|
|
262
|
+
/>
|
|
263
|
+
)
|
|
264
|
+
})}
|
|
265
|
+
|
|
266
|
+
{/* Commit rail: incoming line (top to dot) */}
|
|
267
|
+
{activeAbove.has(row.rail) && (
|
|
268
|
+
<line
|
|
269
|
+
x1={commitX}
|
|
270
|
+
y1={0}
|
|
271
|
+
x2={commitX}
|
|
272
|
+
y2={cy}
|
|
273
|
+
stroke={color(row.rail)}
|
|
274
|
+
strokeWidth={2}
|
|
275
|
+
strokeOpacity={0.6}
|
|
276
|
+
/>
|
|
277
|
+
)}
|
|
278
|
+
|
|
279
|
+
{/* Commit rail: outgoing line (dot to bottom) */}
|
|
280
|
+
{activeBelow.has(row.rail) && (
|
|
281
|
+
<line
|
|
282
|
+
x1={commitX}
|
|
283
|
+
y1={cy}
|
|
284
|
+
x2={commitX}
|
|
285
|
+
y2={h}
|
|
286
|
+
stroke={color(row.rail)}
|
|
287
|
+
strokeWidth={2}
|
|
288
|
+
strokeOpacity={0.6}
|
|
289
|
+
/>
|
|
290
|
+
)}
|
|
291
|
+
|
|
292
|
+
{/* Fork-out curves */}
|
|
293
|
+
{row.edges
|
|
294
|
+
.filter(e => e.type === 'fork-out')
|
|
295
|
+
.map(edge => (
|
|
296
|
+
<path
|
|
297
|
+
key={`f-${edge.fromRail}-${edge.toRail}`}
|
|
298
|
+
d={`M${rx(edge.fromRail)},${cy} C${rx(edge.fromRail)},${h} ${rx(edge.toRail)},${cy} ${rx(edge.toRail)},${h}`}
|
|
299
|
+
stroke={edge.color}
|
|
300
|
+
strokeWidth={2}
|
|
301
|
+
strokeOpacity={0.6}
|
|
302
|
+
fill="none"
|
|
303
|
+
/>
|
|
304
|
+
))}
|
|
305
|
+
|
|
306
|
+
{/* Merge curves */}
|
|
307
|
+
{row.edges
|
|
308
|
+
.filter(e => e.type === 'merge-in')
|
|
309
|
+
.map((edge) => {
|
|
310
|
+
const isOutgoing = edge.fromRail === row.rail
|
|
311
|
+
const x1 = rx(edge.fromRail)
|
|
312
|
+
const x2 = rx(edge.toRail)
|
|
313
|
+
const d = isOutgoing
|
|
314
|
+
? `M${x1},${cy} C${x1},${h} ${x2},${cy} ${x2},${h}`
|
|
315
|
+
: `M${x1},${0} C${x1},${cy} ${x2},${0} ${x2},${cy}`
|
|
316
|
+
return (
|
|
317
|
+
<path
|
|
318
|
+
key={`m-${edge.fromRail}-${edge.toRail}-${isOutgoing ? 'out' : 'in'}`}
|
|
319
|
+
d={d}
|
|
320
|
+
stroke={edge.color}
|
|
321
|
+
strokeWidth={2}
|
|
322
|
+
strokeOpacity={0.6}
|
|
323
|
+
fill="none"
|
|
324
|
+
/>
|
|
325
|
+
)
|
|
326
|
+
})}
|
|
327
|
+
|
|
328
|
+
{/* Rails that terminate here */}
|
|
329
|
+
{Array.from(activeAbove).map((r) => {
|
|
330
|
+
if (r === row.rail) return null
|
|
331
|
+
if (activeBelow.has(r)) return null
|
|
332
|
+
const x = rx(r)
|
|
333
|
+
return (
|
|
334
|
+
<line
|
|
335
|
+
key={`end-${r}`}
|
|
336
|
+
x1={x}
|
|
337
|
+
y1={0}
|
|
338
|
+
x2={x}
|
|
339
|
+
y2={cy}
|
|
340
|
+
stroke={color(r)}
|
|
341
|
+
strokeWidth={2}
|
|
342
|
+
strokeOpacity={0.6}
|
|
343
|
+
/>
|
|
344
|
+
)
|
|
345
|
+
})}
|
|
346
|
+
|
|
347
|
+
{/* Commit dot */}
|
|
348
|
+
<circle
|
|
349
|
+
cx={commitX}
|
|
350
|
+
cy={cy}
|
|
351
|
+
r={5}
|
|
352
|
+
fill={color(row.rail)}
|
|
353
|
+
stroke="var(--color-background)"
|
|
354
|
+
strokeWidth={2}
|
|
355
|
+
/>
|
|
356
|
+
</svg>
|
|
357
|
+
)
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
function AuthorAvatar({
|
|
361
|
+
author,
|
|
362
|
+
className,
|
|
363
|
+
fallbackClassName,
|
|
364
|
+
}: {
|
|
365
|
+
author: CommitAuthor
|
|
366
|
+
className?: string
|
|
367
|
+
fallbackClassName?: string
|
|
368
|
+
}) {
|
|
369
|
+
return (
|
|
370
|
+
<Avatar className={cn('size-4', className)}>
|
|
371
|
+
{author.avatarUrl ? <AvatarImage src={author.avatarUrl} alt="" /> : null}
|
|
372
|
+
<AvatarFallback className={cn('text-[8px] font-bold', fallbackClassName)}>
|
|
373
|
+
{initials(author.name)}
|
|
374
|
+
</AvatarFallback>
|
|
375
|
+
</Avatar>
|
|
376
|
+
)
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function formatDate(
|
|
380
|
+
date: string | Date,
|
|
381
|
+
t: UiMessages['commitGraph'],
|
|
382
|
+
locale: string,
|
|
383
|
+
): string {
|
|
384
|
+
const d = typeof date === 'string' ? new Date(date) : date
|
|
385
|
+
const now = new Date()
|
|
386
|
+
const diffMs = now.getTime() - d.getTime()
|
|
387
|
+
const diffMins = Math.floor(diffMs / 60_000)
|
|
388
|
+
const diffHours = Math.floor(diffMs / 3_600_000)
|
|
389
|
+
const diffDays = Math.floor(diffMs / 86_400_000)
|
|
390
|
+
|
|
391
|
+
if (diffMins < 1) return t.justNow
|
|
392
|
+
if (diffMins < 60) return t.minutesAgo(diffMins)
|
|
393
|
+
if (diffHours < 24) return t.hoursAgo(diffHours)
|
|
394
|
+
if (diffDays < 7) return t.daysAgo(diffDays)
|
|
395
|
+
|
|
396
|
+
return d.toLocaleDateString(locale, {
|
|
397
|
+
month: 'short',
|
|
398
|
+
day: 'numeric',
|
|
399
|
+
year: d.getFullYear() !== now.getFullYear() ? 'numeric' : undefined,
|
|
400
|
+
})
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function formatFullDate(date: string | Date, locale: string): string {
|
|
404
|
+
const d = typeof date === 'string' ? new Date(date) : date
|
|
405
|
+
return d.toLocaleDateString(locale, {
|
|
406
|
+
weekday: 'short',
|
|
407
|
+
month: 'short',
|
|
408
|
+
day: 'numeric',
|
|
409
|
+
year: 'numeric',
|
|
410
|
+
hour: 'numeric',
|
|
411
|
+
minute: '2-digit',
|
|
412
|
+
})
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function CommitDetail({
|
|
416
|
+
commit,
|
|
417
|
+
hashLength,
|
|
418
|
+
railColor,
|
|
419
|
+
children,
|
|
420
|
+
className,
|
|
421
|
+
style,
|
|
422
|
+
}: {
|
|
423
|
+
commit: Commit
|
|
424
|
+
hashLength: number
|
|
425
|
+
railColor: string
|
|
426
|
+
children: ReactNode
|
|
427
|
+
className?: string
|
|
428
|
+
style?: CSSProperties
|
|
429
|
+
}) {
|
|
430
|
+
const t = useLabels('commitGraph');
|
|
431
|
+
const dateLocale = useDateLocale()
|
|
432
|
+
const locale = dateLocale.code ?? 'en-US';
|
|
433
|
+
|
|
434
|
+
return (
|
|
435
|
+
<Popover>
|
|
436
|
+
<PopoverTrigger
|
|
437
|
+
type="button"
|
|
438
|
+
data-slot="commit-entry"
|
|
439
|
+
className={className}
|
|
440
|
+
style={style}
|
|
441
|
+
>
|
|
442
|
+
{children}
|
|
443
|
+
</PopoverTrigger>
|
|
444
|
+
<PopoverContent side="right" sideOffset={8} className="w-80 p-3">
|
|
445
|
+
<div className="flex flex-col gap-2">
|
|
446
|
+
<p className="text-sm leading-snug font-medium">{commit.message}</p>
|
|
447
|
+
<div className="flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
|
|
448
|
+
<span className="inline-flex items-center gap-1.5">
|
|
449
|
+
<AuthorAvatar
|
|
450
|
+
author={commit.author}
|
|
451
|
+
className="size-3.5"
|
|
452
|
+
fallbackClassName="text-[7px]"
|
|
453
|
+
/>
|
|
454
|
+
{commit.author.name}
|
|
455
|
+
</span>
|
|
456
|
+
<span className="text-border">·</span>
|
|
457
|
+
<code className="rounded bg-muted px-1 py-0.5 font-mono text-[10px]">
|
|
458
|
+
{commit.hash.slice(0, hashLength)}
|
|
459
|
+
</code>
|
|
460
|
+
</div>
|
|
461
|
+
<div className="text-[11px] text-muted-foreground">
|
|
462
|
+
{formatFullDate(commit.date, locale)}
|
|
463
|
+
</div>
|
|
464
|
+
{(commit.refs || commit.tag) && (
|
|
465
|
+
<div className="flex flex-wrap gap-1">
|
|
466
|
+
{commit.refs?.map(ref => (
|
|
467
|
+
<span
|
|
468
|
+
key={ref}
|
|
469
|
+
className="inline-flex items-center gap-1 rounded-md border border-border/60 bg-muted/50 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground"
|
|
470
|
+
>
|
|
471
|
+
{ref}
|
|
472
|
+
</span>
|
|
473
|
+
))}
|
|
474
|
+
{commit.tag && (
|
|
475
|
+
<span
|
|
476
|
+
className="inline-flex items-center rounded-md px-1.5 py-0.5 text-[10px] font-medium"
|
|
477
|
+
style={{
|
|
478
|
+
backgroundColor: `${railColor}20`,
|
|
479
|
+
color: railColor,
|
|
480
|
+
}}
|
|
481
|
+
>
|
|
482
|
+
{commit.tag}
|
|
483
|
+
</span>
|
|
484
|
+
)}
|
|
485
|
+
</div>
|
|
486
|
+
)}
|
|
487
|
+
{commit.parents.length > 0 && (
|
|
488
|
+
<div className="text-[10px] text-muted-foreground/60">
|
|
489
|
+
{commit.parents.length === 1 ? t.parent : t.parents}:{' '}
|
|
490
|
+
{commit.parents.map(p => p.slice(0, hashLength)).join(', ')}
|
|
491
|
+
</div>
|
|
492
|
+
)}
|
|
493
|
+
</div>
|
|
494
|
+
</PopoverContent>
|
|
495
|
+
</Popover>
|
|
496
|
+
)
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Topological git commit graph (forks / merges).
|
|
501
|
+
* @when App history, release notes, git timeline views
|
|
502
|
+
* @example
|
|
503
|
+
* <CommitGraph commits={[{ hash, message, author, date, parents }]} />
|
|
504
|
+
* @family Chart & data
|
|
505
|
+
*/
|
|
506
|
+
export function CommitGraph({
|
|
507
|
+
commits,
|
|
508
|
+
truncateHash = 7,
|
|
509
|
+
railWidth = 24,
|
|
510
|
+
className,
|
|
511
|
+
...props
|
|
512
|
+
}: CommitGraphProps) {
|
|
513
|
+
const t = useLabels('commitGraph');
|
|
514
|
+
const dateLocale = useDateLocale()
|
|
515
|
+
const locale = dateLocale.code ?? 'en-US';
|
|
516
|
+
|
|
517
|
+
// Simple mode: if no commit has parents, infer a linear topology
|
|
518
|
+
const hasTopology = commits.some(c => c.parents && c.parents.length > 0)
|
|
519
|
+
const resolvedCommits = hasTopology
|
|
520
|
+
? commits
|
|
521
|
+
: commits.map((c, i) => {
|
|
522
|
+
const next = commits[i + 1]
|
|
523
|
+
return {
|
|
524
|
+
...c,
|
|
525
|
+
parents: next ? [next.hash] : [],
|
|
526
|
+
};
|
|
527
|
+
})
|
|
528
|
+
|
|
529
|
+
if (resolvedCommits.length === 0) {
|
|
530
|
+
return (
|
|
531
|
+
<div
|
|
532
|
+
data-slot="commit-graph"
|
|
533
|
+
data-testid="commit-graph"
|
|
534
|
+
className={cn(
|
|
535
|
+
'flex items-center justify-center rounded-xl border border-border/60 bg-card py-10 text-sm text-muted-foreground shadow-sm',
|
|
536
|
+
className,
|
|
537
|
+
)}
|
|
538
|
+
{...props}
|
|
539
|
+
>
|
|
540
|
+
{t.empty}
|
|
541
|
+
</div>
|
|
542
|
+
)
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
const rows = computeLayout(resolvedCommits)
|
|
546
|
+
const maxRails = Math.max(
|
|
547
|
+
...rows.map(r =>
|
|
548
|
+
Math.max(
|
|
549
|
+
r.rail + 1,
|
|
550
|
+
r.rails.length,
|
|
551
|
+
...r.edges.map(e => Math.max(e.fromRail, e.toRail) + 1),
|
|
552
|
+
),
|
|
553
|
+
),
|
|
554
|
+
)
|
|
555
|
+
const svgWidth = maxRails * railWidth
|
|
556
|
+
|
|
557
|
+
return (
|
|
558
|
+
<div
|
|
559
|
+
data-slot="commit-graph"
|
|
560
|
+
data-testid="commit-graph"
|
|
561
|
+
className={cn(
|
|
562
|
+
'overflow-hidden rounded-xl border border-border/60 bg-card shadow-sm',
|
|
563
|
+
className,
|
|
564
|
+
)}
|
|
565
|
+
{...props}
|
|
566
|
+
>
|
|
567
|
+
<div className="overflow-x-auto">
|
|
568
|
+
{rows.map((row, i) => {
|
|
569
|
+
const prevRow = i > 0 ? (rows[i - 1] ?? null) : null
|
|
570
|
+
return (
|
|
571
|
+
<CommitDetail
|
|
572
|
+
key={row.commit.hash}
|
|
573
|
+
commit={row.commit}
|
|
574
|
+
hashLength={truncateHash}
|
|
575
|
+
railColor={color(row.rail)}
|
|
576
|
+
className="flex w-full items-center gap-0 border-b border-border/30 transition-colors last:border-b-0 hover:bg-muted/30 focus-visible:bg-muted/30 focus-visible:outline-none"
|
|
577
|
+
style={{ height: ROW_HEIGHT }}
|
|
578
|
+
>
|
|
579
|
+
{/* Rails */}
|
|
580
|
+
<div style={{ width: svgWidth }} className="shrink-0">
|
|
581
|
+
<RailsSVG
|
|
582
|
+
row={row}
|
|
583
|
+
prevRow={prevRow}
|
|
584
|
+
railWidth={railWidth}
|
|
585
|
+
maxRails={maxRails}
|
|
586
|
+
/>
|
|
587
|
+
</div>
|
|
588
|
+
|
|
589
|
+
{/* Refs */}
|
|
590
|
+
<div className="flex shrink-0 items-center gap-1 px-2">
|
|
591
|
+
{row.commit.refs?.map(ref => (
|
|
592
|
+
<span
|
|
593
|
+
key={ref}
|
|
594
|
+
className="inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[10px] leading-none font-semibold"
|
|
595
|
+
style={{
|
|
596
|
+
borderColor: `${color(row.rail)}40`,
|
|
597
|
+
backgroundColor: `${color(row.rail)}10`,
|
|
598
|
+
color: color(row.rail),
|
|
599
|
+
}}
|
|
600
|
+
>
|
|
601
|
+
{ref}
|
|
602
|
+
</span>
|
|
603
|
+
))}
|
|
604
|
+
{row.commit.tag && (
|
|
605
|
+
<span
|
|
606
|
+
className="inline-flex items-center rounded-md px-1.5 py-0.5 text-[10px] leading-none font-semibold"
|
|
607
|
+
style={{
|
|
608
|
+
backgroundColor: `${color(row.rail)}20`,
|
|
609
|
+
color: color(row.rail),
|
|
610
|
+
}}
|
|
611
|
+
>
|
|
612
|
+
{row.commit.tag}
|
|
613
|
+
</span>
|
|
614
|
+
)}
|
|
615
|
+
</div>
|
|
616
|
+
|
|
617
|
+
{/* Message */}
|
|
618
|
+
<p className="min-w-0 flex-1 truncate px-2 text-left text-sm text-foreground/80">
|
|
619
|
+
{row.commit.message}
|
|
620
|
+
</p>
|
|
621
|
+
|
|
622
|
+
{/* Meta */}
|
|
623
|
+
<div className="flex shrink-0 items-center gap-3 px-3">
|
|
624
|
+
<code className="font-mono text-[11px] text-muted-foreground/60">
|
|
625
|
+
{row.commit.hash.slice(0, truncateHash)}
|
|
626
|
+
</code>
|
|
627
|
+
<span className="inline-flex items-center gap-1.5 text-xs text-muted-foreground">
|
|
628
|
+
<AuthorAvatar author={row.commit.author} />
|
|
629
|
+
<span className="hidden sm:inline">
|
|
630
|
+
{row.commit.author.name}
|
|
631
|
+
</span>
|
|
632
|
+
</span>
|
|
633
|
+
<span className="text-[11px] text-muted-foreground/50">
|
|
634
|
+
{formatDate(row.commit.date, t, locale)}
|
|
635
|
+
</span>
|
|
636
|
+
</div>
|
|
637
|
+
</CommitDetail>
|
|
638
|
+
)
|
|
639
|
+
})}
|
|
640
|
+
</div>
|
|
641
|
+
</div>
|
|
642
|
+
)
|
|
643
|
+
}
|