@major-tech/ui 0.0.0-stage → 1.0.0
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/CHANGELOG.md +101 -0
- package/THIRD_PARTY_NOTICES.md +27 -0
- package/dist/components/accordion.d.ts +33 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +51 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/activity-chart.d.ts +26 -0
- package/dist/components/activity-chart.d.ts.map +1 -0
- package/dist/components/activity-chart.js +56 -0
- package/dist/components/activity-chart.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +28 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +51 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +34 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +59 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/ask-user-question.d.ts +103 -0
- package/dist/components/ask-user-question.d.ts.map +1 -0
- package/dist/components/ask-user-question.js +401 -0
- package/dist/components/ask-user-question.js.map +1 -0
- package/dist/components/attachment-gallery.d.ts +137 -0
- package/dist/components/attachment-gallery.d.ts.map +1 -0
- package/dist/components/attachment-gallery.js +317 -0
- package/dist/components/attachment-gallery.js.map +1 -0
- package/dist/components/avatar.d.ts +37 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +62 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +29 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +50 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/brand-tile.d.ts +33 -0
- package/dist/components/brand-tile.d.ts.map +1 -0
- package/dist/components/brand-tile.js +36 -0
- package/dist/components/brand-tile.js.map +1 -0
- package/dist/components/button.d.ts +51 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +90 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +18 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +78 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +18 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +34 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +48 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +227 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/catalog-card.d.ts +29 -0
- package/dist/components/catalog-card.d.ts.map +1 -0
- package/dist/components/catalog-card.js +20 -0
- package/dist/components/catalog-card.js.map +1 -0
- package/dist/components/chart.d.ts +118 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +209 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +8 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +14 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/chip.d.ts +68 -0
- package/dist/components/chip.d.ts.map +1 -0
- package/dist/components/chip.js +100 -0
- package/dist/components/chip.js.map +1 -0
- package/dist/components/code-block.d.ts +99 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +144 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/collapsible.d.ts +17 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +25 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/command.d.ts +51 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +120 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/composer.d.ts +211 -0
- package/dist/components/composer.d.ts.map +1 -0
- package/dist/components/composer.js +605 -0
- package/dist/components/composer.js.map +1 -0
- package/dist/components/connector-request.d.ts +63 -0
- package/dist/components/connector-request.d.ts.map +1 -0
- package/dist/components/connector-request.js +57 -0
- package/dist/components/connector-request.js.map +1 -0
- package/dist/components/context-menu.d.ts +26 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +33 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/data-table.d.ts +61 -0
- package/dist/components/data-table.d.ts.map +1 -0
- package/dist/components/data-table.js +79 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/date-range-picker.d.ts +54 -0
- package/dist/components/date-range-picker.d.ts.map +1 -0
- package/dist/components/date-range-picker.js +451 -0
- package/dist/components/date-range-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +46 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +75 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.d.ts +85 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +166 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +77 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +112 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/editor-tabs.d.ts +49 -0
- package/dist/components/editor-tabs.d.ts.map +1 -0
- package/dist/components/editor-tabs.js +157 -0
- package/dist/components/editor-tabs.js.map +1 -0
- package/dist/components/empty-state.d.ts +21 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state.js +14 -0
- package/dist/components/empty-state.js.map +1 -0
- package/dist/components/entity-card.d.ts +301 -0
- package/dist/components/entity-card.d.ts.map +1 -0
- package/dist/components/entity-card.js +392 -0
- package/dist/components/entity-card.js.map +1 -0
- package/dist/components/entity-row.d.ts +37 -0
- package/dist/components/entity-row.d.ts.map +1 -0
- package/dist/components/entity-row.js +65 -0
- package/dist/components/entity-row.js.map +1 -0
- package/dist/components/env-var-request.d.ts +51 -0
- package/dist/components/env-var-request.d.ts.map +1 -0
- package/dist/components/env-var-request.js +50 -0
- package/dist/components/env-var-request.js.map +1 -0
- package/dist/components/field.d.ts +30 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +48 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/file-upload.d.ts +108 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload.js +217 -0
- package/dist/components/file-upload.js.map +1 -0
- package/dist/components/hover-card.d.ts +18 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +84 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +29 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +61 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input.d.ts +9 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +13 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/island.d.ts +18 -0
- package/dist/components/island.d.ts.map +1 -0
- package/dist/components/island.js +30 -0
- package/dist/components/island.js.map +1 -0
- package/dist/components/kbd.d.ts +7 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +11 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +8 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +12 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/markdown.d.ts +24 -0
- package/dist/components/markdown.d.ts.map +1 -0
- package/dist/components/markdown.js +38 -0
- package/dist/components/markdown.js.map +1 -0
- package/dist/components/message.d.ts +38 -0
- package/dist/components/message.d.ts.map +1 -0
- package/dist/components/message.js +25 -0
- package/dist/components/message.js.map +1 -0
- package/dist/components/page-header.d.ts +31 -0
- package/dist/components/page-header.d.ts.map +1 -0
- package/dist/components/page-header.js +94 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/pagination.d.ts +22 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +36 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/password-input.d.ts +5 -0
- package/dist/components/password-input.d.ts.map +1 -0
- package/dist/components/password-input.js +12 -0
- package/dist/components/password-input.js.map +1 -0
- package/dist/components/pepper.d.ts +92 -0
- package/dist/components/pepper.d.ts.map +1 -0
- package/dist/components/pepper.js +1279 -0
- package/dist/components/pepper.js.map +1 -0
- package/dist/components/permission-request.d.ts +53 -0
- package/dist/components/permission-request.d.ts.map +1 -0
- package/dist/components/permission-request.js +54 -0
- package/dist/components/permission-request.js.map +1 -0
- package/dist/components/popover.d.ts +42 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +76 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +9 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +12 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/progressive-blur.d.ts +31 -0
- package/dist/components/progressive-blur.d.ts.map +1 -0
- package/dist/components/progressive-blur.js +44 -0
- package/dist/components/progressive-blur.js.map +1 -0
- package/dist/components/radio-group.d.ts +8 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +15 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/request-card.d.ts +34 -0
- package/dist/components/request-card.d.ts.map +1 -0
- package/dist/components/request-card.js +50 -0
- package/dist/components/request-card.js.map +1 -0
- package/dist/components/resizable.d.ts +24 -0
- package/dist/components/resizable.d.ts.map +1 -0
- package/dist/components/resizable.js +40 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/responsive-overlay.d.ts +136 -0
- package/dist/components/responsive-overlay.d.ts.map +1 -0
- package/dist/components/responsive-overlay.js +302 -0
- package/dist/components/responsive-overlay.js.map +1 -0
- package/dist/components/scroll-shadows.d.ts +11 -0
- package/dist/components/scroll-shadows.d.ts.map +1 -0
- package/dist/components/scroll-shadows.js +53 -0
- package/dist/components/scroll-shadows.js.map +1 -0
- package/dist/components/search-field.d.ts +16 -0
- package/dist/components/search-field.d.ts.map +1 -0
- package/dist/components/search-field.js +50 -0
- package/dist/components/search-field.js.map +1 -0
- package/dist/components/searchable-select.d.ts +43 -0
- package/dist/components/searchable-select.d.ts.map +1 -0
- package/dist/components/searchable-select.js +39 -0
- package/dist/components/searchable-select.js.map +1 -0
- package/dist/components/select.d.ts +60 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +94 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +7 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +12 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/settings-section.d.ts +41 -0
- package/dist/components/settings-section.d.ts.map +1 -0
- package/dist/components/settings-section.js +50 -0
- package/dist/components/settings-section.js.map +1 -0
- package/dist/components/sidebar-item.d.ts +41 -0
- package/dist/components/sidebar-item.d.ts.map +1 -0
- package/dist/components/sidebar-item.js +59 -0
- package/dist/components/sidebar-item.js.map +1 -0
- package/dist/components/skeleton.d.ts +7 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +11 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +10 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +36 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.d.ts +8 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +21 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.d.ts +7 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +12 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stat-strip.d.ts +20 -0
- package/dist/components/stat-strip.d.ts.map +1 -0
- package/dist/components/stat-strip.js +11 -0
- package/dist/components/stat-strip.js.map +1 -0
- package/dist/components/status-dot.d.ts +25 -0
- package/dist/components/status-dot.d.ts.map +1 -0
- package/dist/components/status-dot.js +31 -0
- package/dist/components/status-dot.js.map +1 -0
- package/dist/components/subagent-run.d.ts +27 -0
- package/dist/components/subagent-run.d.ts.map +1 -0
- package/dist/components/subagent-run.js +38 -0
- package/dist/components/subagent-run.js.map +1 -0
- package/dist/components/switch.d.ts +8 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +13 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/system-notice.d.ts +34 -0
- package/dist/components/system-notice.d.ts.map +1 -0
- package/dist/components/system-notice.js +52 -0
- package/dist/components/system-notice.js.map +1 -0
- package/dist/components/table.d.ts +27 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +37 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +40 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +52 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +5 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +9 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/thinking-indicator.d.ts +21 -0
- package/dist/components/thinking-indicator.d.ts.map +1 -0
- package/dist/components/thinking-indicator.js +136 -0
- package/dist/components/thinking-indicator.js.map +1 -0
- package/dist/components/thread-status.d.ts +25 -0
- package/dist/components/thread-status.d.ts.map +1 -0
- package/dist/components/thread-status.js +41 -0
- package/dist/components/thread-status.js.map +1 -0
- package/dist/components/todo-list.d.ts +52 -0
- package/dist/components/todo-list.d.ts.map +1 -0
- package/dist/components/todo-list.js +137 -0
- package/dist/components/todo-list.js.map +1 -0
- package/dist/components/toggle-group.d.ts +17 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +26 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +27 -0
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +44 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tool-call.d.ts +60 -0
- package/dist/components/tool-call.d.ts.map +1 -0
- package/dist/components/tool-call.js +94 -0
- package/dist/components/tool-call.js.map +1 -0
- package/dist/components/tool-result.d.ts +127 -0
- package/dist/components/tool-result.d.ts.map +1 -0
- package/dist/components/tool-result.js +155 -0
- package/dist/components/tool-result.js.map +1 -0
- package/dist/components/tooltip.d.ts +18 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +38 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/trace.d.ts +38 -0
- package/dist/components/trace.d.ts.map +1 -0
- package/dist/components/trace.js +52 -0
- package/dist/components/trace.js.map +1 -0
- package/dist/components/turn-summary.d.ts +17 -0
- package/dist/components/turn-summary.d.ts.map +1 -0
- package/dist/components/turn-summary.js +19 -0
- package/dist/components/turn-summary.js.map +1 -0
- package/dist/components/usage-meter.d.ts +16 -0
- package/dist/components/usage-meter.d.ts.map +1 -0
- package/dist/components/usage-meter.js +10 -0
- package/dist/components/usage-meter.js.map +1 -0
- package/dist/components/view-switcher.d.ts +25 -0
- package/dist/components/view-switcher.d.ts.map +1 -0
- package/dist/components/view-switcher.js +196 -0
- package/dist/components/view-switcher.js.map +1 -0
- package/dist/docs/components/accordion.md +151 -0
- package/dist/docs/components/activity-chart.md +104 -0
- package/dist/docs/components/alert-dialog.md +216 -0
- package/dist/docs/components/alert.md +203 -0
- package/dist/docs/components/ask-user-question.md +429 -0
- package/dist/docs/components/attachment-gallery.md +377 -0
- package/dist/docs/components/avatar.md +197 -0
- package/dist/docs/components/badge.md +162 -0
- package/dist/docs/components/brand-tile.md +138 -0
- package/dist/docs/components/button.md +392 -0
- package/dist/docs/components/calendar.md +113 -0
- package/dist/docs/components/card.md +157 -0
- package/dist/docs/components/carousel.md +144 -0
- package/dist/docs/components/catalog-card.md +136 -0
- package/dist/docs/components/chart.md +608 -0
- package/dist/docs/components/checkbox.md +164 -0
- package/dist/docs/components/chip.md +411 -0
- package/dist/docs/components/code-block.md +389 -0
- package/dist/docs/components/collapsible.md +93 -0
- package/dist/docs/components/command.md +276 -0
- package/dist/docs/components/composer.md +1092 -0
- package/dist/docs/components/connector-request.md +497 -0
- package/dist/docs/components/context-menu.md +127 -0
- package/dist/docs/components/data-table.md +462 -0
- package/dist/docs/components/date-range-picker.md +425 -0
- package/dist/docs/components/dialog.md +263 -0
- package/dist/docs/components/drawer.md +505 -0
- package/dist/docs/components/dropdown-menu.md +336 -0
- package/dist/docs/components/editor-tabs.md +283 -0
- package/dist/docs/components/empty-state.md +134 -0
- package/dist/docs/components/entity-card.md +640 -0
- package/dist/docs/components/entity-row.md +291 -0
- package/dist/docs/components/env-var-request.md +223 -0
- package/dist/docs/components/field.md +272 -0
- package/dist/docs/components/file-upload.md +255 -0
- package/dist/docs/components/hover-card.md +335 -0
- package/dist/docs/components/input-group.md +134 -0
- package/dist/docs/components/input.md +97 -0
- package/dist/docs/components/island.md +97 -0
- package/dist/docs/components/kbd.md +91 -0
- package/dist/docs/components/markdown.md +180 -0
- package/dist/docs/components/message.md +336 -0
- package/dist/docs/components/page-header.md +203 -0
- package/dist/docs/components/pagination.md +211 -0
- package/dist/docs/components/password-input.md +68 -0
- package/dist/docs/components/pepper.md +238 -0
- package/dist/docs/components/permission-request.md +265 -0
- package/dist/docs/components/popover.md +206 -0
- package/dist/docs/components/progress.md +142 -0
- package/dist/docs/components/progressive-blur.md +195 -0
- package/dist/docs/components/radio-group.md +129 -0
- package/dist/docs/components/request-card.md +305 -0
- package/dist/docs/components/resizable.md +318 -0
- package/dist/docs/components/responsive-overlay.md +449 -0
- package/dist/docs/components/scroll-shadows.md +161 -0
- package/dist/docs/components/search-field.md +86 -0
- package/dist/docs/components/searchable-select.md +144 -0
- package/dist/docs/components/select.md +331 -0
- package/dist/docs/components/separator.md +80 -0
- package/dist/docs/components/settings-section.md +246 -0
- package/dist/docs/components/sidebar-item.md +307 -0
- package/dist/docs/components/skeleton.md +107 -0
- package/dist/docs/components/slider.md +171 -0
- package/dist/docs/components/sonner.md +122 -0
- package/dist/docs/components/spinner.md +112 -0
- package/dist/docs/components/stat-strip.md +85 -0
- package/dist/docs/components/status-dot.md +190 -0
- package/dist/docs/components/subagent-run.md +196 -0
- package/dist/docs/components/switch.md +91 -0
- package/dist/docs/components/system-notice.md +144 -0
- package/dist/docs/components/table.md +201 -0
- package/dist/docs/components/tabs.md +233 -0
- package/dist/docs/components/textarea.md +89 -0
- package/dist/docs/components/thinking-indicator.md +164 -0
- package/dist/docs/components/thread-status.md +143 -0
- package/dist/docs/components/todo-list.md +225 -0
- package/dist/docs/components/toggle-group.md +117 -0
- package/dist/docs/components/toggle.md +132 -0
- package/dist/docs/components/tool-call.md +237 -0
- package/dist/docs/components/tool-result.md +418 -0
- package/dist/docs/components/tooltip.md +136 -0
- package/dist/docs/components/trace.md +319 -0
- package/dist/docs/components/turn-summary.md +218 -0
- package/dist/docs/components/usage-meter.md +69 -0
- package/dist/docs/components/view-switcher.md +193 -0
- package/dist/docs/foundations/colors.md +83 -0
- package/dist/docs/foundations/elevation.md +19 -0
- package/dist/docs/foundations/iconography.md +34 -0
- package/dist/docs/foundations/layout.md +42 -0
- package/dist/docs/foundations/logo.md +111 -0
- package/dist/docs/foundations/motion.md +91 -0
- package/dist/docs/foundations/radius.md +13 -0
- package/dist/docs/foundations/spacing.md +23 -0
- package/dist/docs/foundations/typography.md +42 -0
- package/dist/docs/getting-started/installation.md +116 -0
- package/dist/docs/getting-started/releases.md +59 -0
- package/dist/docs/getting-started/theming.md +58 -0
- package/dist/docs/guidelines/accessibility.md +28 -0
- package/dist/docs/guidelines/content.md +36 -0
- package/dist/docs/guidelines/forms.md +36 -0
- package/dist/docs/guidelines/principles.md +30 -0
- package/dist/docs/hooks/use-is-mobile.md +134 -0
- package/dist/docs/index.md +182 -0
- package/dist/docs/overview.md +35 -0
- package/dist/docs/patterns/chat.md +477 -0
- package/dist/docs/patterns/index.md +13 -0
- package/dist/docs/patterns/login.md +311 -0
- package/dist/docs/patterns/share.md +415 -0
- package/dist/hooks/use-is-mobile.d.ts +9 -0
- package/dist/hooks/use-is-mobile.d.ts.map +1 -0
- package/dist/hooks/use-is-mobile.js +26 -0
- package/dist/hooks/use-is-mobile.js.map +1 -0
- package/dist/lib/cn.d.ts +4 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +31 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/code-language.d.ts +8 -0
- package/dist/lib/code-language.d.ts.map +1 -0
- package/dist/lib/code-language.js +48 -0
- package/dist/lib/code-language.js.map +1 -0
- package/dist/lib/date-range.d.ts +122 -0
- package/dist/lib/date-range.d.ts.map +1 -0
- package/dist/lib/date-range.js +281 -0
- package/dist/lib/date-range.js.map +1 -0
- package/dist/lib/major-tokens.d.ts +40 -0
- package/dist/lib/major-tokens.d.ts.map +1 -0
- package/dist/lib/major-tokens.js +602 -0
- package/dist/lib/major-tokens.js.map +1 -0
- package/dist/lib/markdown.d.ts +25 -0
- package/dist/lib/markdown.d.ts.map +1 -0
- package/dist/lib/markdown.js +87 -0
- package/dist/lib/markdown.js.map +1 -0
- package/dist/lib/overlay-portal-branch.d.ts +6 -0
- package/dist/lib/overlay-portal-branch.d.ts.map +1 -0
- package/dist/lib/overlay-portal-branch.js +15 -0
- package/dist/lib/overlay-portal-branch.js.map +1 -0
- package/dist/lib/pepper-matcap.d.ts +2 -0
- package/dist/lib/pepper-matcap.d.ts.map +1 -0
- package/dist/lib/pepper-matcap.js +4 -0
- package/dist/lib/pepper-matcap.js.map +1 -0
- package/dist/lib/scroll-fade.d.ts +28 -0
- package/dist/lib/scroll-fade.d.ts.map +1 -0
- package/dist/lib/scroll-fade.js +57 -0
- package/dist/lib/scroll-fade.js.map +1 -0
- package/dist/tailwind.css +7 -0
- package/dist/theme.css +428 -0
- package/package.json +145 -3
- package/tokens.json +841 -0
- package/README.md +0 -3
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: SubagentRun
|
|
3
|
+
slug: subagent-run
|
|
4
|
+
description: A subagent's run as one step line, its state as its icon, that opens into the subagent's own steps.
|
|
5
|
+
group: AI
|
|
6
|
+
layer: composed
|
|
7
|
+
status: beta
|
|
8
|
+
since: 0.4.0
|
|
9
|
+
primitive: Collapsible
|
|
10
|
+
import: import { SubagentRun, SUBAGENT_RUN_STATUSES } from "@major-tech/ui/subagent-run";
|
|
11
|
+
source: packages/ui/src/components/subagent-run.tsx
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# SubagentRun
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### Runs
|
|
19
|
+
|
|
20
|
+
When Major hands part of a task to a subagent, the run is one step line: its state as its icon, what it was sent to do, and its steps and time in muted. It opens into the subagent's own steps behind a line rule.
|
|
21
|
+
|
|
22
|
+
Example: `states`
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
"use client";
|
|
26
|
+
|
|
27
|
+
import { SUBAGENT_RUN_STATUSES, SubagentRun } from "@major-tech/ui/subagent-run";
|
|
28
|
+
import { TOOL_CALL_STATUSES, ToolCall } from "@major-tech/ui/tool-call";
|
|
29
|
+
import { FileText, Search } from "lucide-react";
|
|
30
|
+
|
|
31
|
+
export default function SubagentRunStates() {
|
|
32
|
+
return (
|
|
33
|
+
<div className="flex w-full max-w-2xl flex-col">
|
|
34
|
+
<SubagentRun label="Analyzing codebase structure" stepCount={3} duration="8s" defaultOpen>
|
|
35
|
+
<ToolCall icon={<Search />} name="Glob" description="**/*.tsx" />
|
|
36
|
+
<ToolCall icon={<FileText />} name="Read" description="ui/package.json" />
|
|
37
|
+
<ToolCall icon={<Search />} name="Grep" description="createChatStore in src" />
|
|
38
|
+
</SubagentRun>
|
|
39
|
+
<SubagentRun
|
|
40
|
+
label="Finding the shared test helpers"
|
|
41
|
+
status={SUBAGENT_RUN_STATUSES.RUNNING}
|
|
42
|
+
stepCount={2}
|
|
43
|
+
progress="Reading the test files to see which helpers are shared"
|
|
44
|
+
>
|
|
45
|
+
<ToolCall icon={<Search />} name="Glob" description="**/*.test.tsx" />
|
|
46
|
+
<ToolCall icon={<FileText />} name="Read" description="test/render.tsx" status={TOOL_CALL_STATUSES.RUNNING} />
|
|
47
|
+
</SubagentRun>
|
|
48
|
+
<SubagentRun label="Checking the deploy logs" status={SUBAGENT_RUN_STATUSES.ERROR} stepCount={1} duration="2s">
|
|
49
|
+
<ToolCall icon={<FileText />} name="Read" description="logs/deploy.log" status={TOOL_CALL_STATUSES.ERROR} />
|
|
50
|
+
</SubagentRun>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- **running**: a Spinner, and the label shimmers.
|
|
57
|
+
- Done (no status): a CircleCheck in `success`.
|
|
58
|
+
- **error**: a CircleX, and the line reads in danger.
|
|
59
|
+
- “4 steps · 8s” after the label, from its first step; the time once the run is over.
|
|
60
|
+
- Its steps are [ToolCalls](tool-call.md), as in a [TurnSummary](turn-summary.md).
|
|
61
|
+
|
|
62
|
+
### While it runs
|
|
63
|
+
|
|
64
|
+
A running subagent shows its latest line under its name, 12px in muted, aligned with the label. Each new line fades in over the last.
|
|
65
|
+
|
|
66
|
+
Example: `running`
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
"use client";
|
|
70
|
+
|
|
71
|
+
import { useEffect, useState } from "react";
|
|
72
|
+
import { BUTTON_SIZES, BUTTON_VARIANTS, Button } from "@major-tech/ui/button";
|
|
73
|
+
import { SUBAGENT_RUN_STATUSES, SubagentRun } from "@major-tech/ui/subagent-run";
|
|
74
|
+
import { TOOL_CALL_STATUSES, ToolCall } from "@major-tech/ui/tool-call";
|
|
75
|
+
import { FileText, Search } from "lucide-react";
|
|
76
|
+
|
|
77
|
+
const STEPS = [
|
|
78
|
+
{
|
|
79
|
+
id: "glob",
|
|
80
|
+
icon: <Search />,
|
|
81
|
+
name: "Glob",
|
|
82
|
+
description: "**/*.test.tsx",
|
|
83
|
+
progress: "Looking for the test files",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: "read-render",
|
|
87
|
+
icon: <FileText />,
|
|
88
|
+
name: "Read",
|
|
89
|
+
description: "test/render.tsx",
|
|
90
|
+
progress: "Reading the test files to see which helpers are shared",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: "grep",
|
|
94
|
+
icon: <Search />,
|
|
95
|
+
name: "Grep",
|
|
96
|
+
description: "renderWithStore in src",
|
|
97
|
+
progress: "Checking where renderWithStore is used",
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
/** How long each step runs before the next one starts. */
|
|
102
|
+
const STEP_DURATION_MS = 2000;
|
|
103
|
+
const ELAPSED = "6s";
|
|
104
|
+
|
|
105
|
+
export default function SubagentRunRunning() {
|
|
106
|
+
const [doneCount, setDoneCount] = useState(0);
|
|
107
|
+
const isDone = doneCount >= STEPS.length;
|
|
108
|
+
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (isDone) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const timer = setTimeout(() => setDoneCount(doneCount + 1), STEP_DURATION_MS);
|
|
115
|
+
|
|
116
|
+
return () => clearTimeout(timer);
|
|
117
|
+
}, [doneCount, isDone]);
|
|
118
|
+
|
|
119
|
+
const visibleSteps = STEPS.slice(0, Math.min(doneCount + 1, STEPS.length));
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<div className="flex w-full max-w-2xl flex-col items-start gap-space-16">
|
|
123
|
+
<SubagentRun
|
|
124
|
+
className="w-full"
|
|
125
|
+
label="Finding the shared test helpers"
|
|
126
|
+
status={isDone ? undefined : SUBAGENT_RUN_STATUSES.RUNNING}
|
|
127
|
+
stepCount={visibleSteps.length}
|
|
128
|
+
duration={isDone ? ELAPSED : undefined}
|
|
129
|
+
progress={isDone ? undefined : STEPS[doneCount].progress}
|
|
130
|
+
>
|
|
131
|
+
{visibleSteps.map((step, index) => (
|
|
132
|
+
<ToolCall
|
|
133
|
+
key={step.id}
|
|
134
|
+
icon={step.icon}
|
|
135
|
+
name={step.name}
|
|
136
|
+
description={step.description}
|
|
137
|
+
status={index === doneCount ? TOOL_CALL_STATUSES.RUNNING : undefined}
|
|
138
|
+
/>
|
|
139
|
+
))}
|
|
140
|
+
</SubagentRun>
|
|
141
|
+
<Button variant={BUTTON_VARIANTS.OUTLINE} size={BUTTON_SIZES.SM} onClick={() => setDoneCount(0)}>
|
|
142
|
+
Replay
|
|
143
|
+
</Button>
|
|
144
|
+
</div>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
- The line is what the subagent is doing now, in the present tense: “Reading the test files to see which helpers are shared”.
|
|
150
|
+
- It truncates to one line, so a long status never crowds the step line.
|
|
151
|
+
- It goes once the run ends; the step count and time stay.
|
|
152
|
+
|
|
153
|
+
### Guidelines
|
|
154
|
+
|
|
155
|
+
Do:
|
|
156
|
+
|
|
157
|
+
- Label the run by what the subagent was sent to do: “Analyzing codebase structure”.
|
|
158
|
+
- Leave the run closed while it works: its latest line says enough.
|
|
159
|
+
|
|
160
|
+
Don't:
|
|
161
|
+
|
|
162
|
+
- Label it with the subagent's type or id.
|
|
163
|
+
- Put a subagent's steps straight into the turn: they belong under its line.
|
|
164
|
+
|
|
165
|
+
## API
|
|
166
|
+
|
|
167
|
+
```tsx
|
|
168
|
+
import { SubagentRun, SUBAGENT_RUN_STATUSES } from "@major-tech/ui/subagent-run";
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### `<SubagentRun />`
|
|
172
|
+
|
|
173
|
+
Renders a Trace (a `<div>`) with every `<div>` attribute. Its children are the subagent's steps.
|
|
174
|
+
|
|
175
|
+
| Prop | Type | Default | Description |
|
|
176
|
+
| --- | --- | --- | --- |
|
|
177
|
+
| `label`* | `string` | — | What the subagent was sent to do. |
|
|
178
|
+
| `status` | `"running" \| "error"` | — | No status means done: a check in success. |
|
|
179
|
+
| `stepCount`* | `number` | — | Its tool calls so far: “4 steps”. Hidden at 0. |
|
|
180
|
+
| `duration` | `string` | — | How long it ran, formatted: “8s”; after the steps, or alone when there are none. |
|
|
181
|
+
| `progress` | `string` | — | The latest line, under the name while it runs. |
|
|
182
|
+
| `defaultOpen` | `boolean` | `false` | Open at first. |
|
|
183
|
+
|
|
184
|
+
`*` marks a required prop.
|
|
185
|
+
|
|
186
|
+
### `SUBAGENT_RUN_STATUSES`
|
|
187
|
+
|
|
188
|
+
| Prop | Type | Default | Description |
|
|
189
|
+
| --- | --- | --- | --- |
|
|
190
|
+
| `RUNNING · ERROR` | `SubagentRunStatus` | — | The status values. |
|
|
191
|
+
|
|
192
|
+
### Accessibility
|
|
193
|
+
|
|
194
|
+
- The line is a button with `aria-expanded` (Base UI Collapsible) once it has steps to open.
|
|
195
|
+
- The state icon and the chevron are decorative (`aria-hidden`); a running or failed run is read with “running” or “failed” after its label.
|
|
196
|
+
- With reduced motion the shimmer stops and the latest line appears without fading in.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Switch
|
|
3
|
+
slug: switch
|
|
4
|
+
description: An on/off toggle for a single setting that applies immediately.
|
|
5
|
+
group: Inputs
|
|
6
|
+
layer: primitive
|
|
7
|
+
status: stable
|
|
8
|
+
since: 0.1.0
|
|
9
|
+
primitive: Switch
|
|
10
|
+
import: import { Switch } from "@major-tech/ui/switch";
|
|
11
|
+
source: packages/ui/src/components/switch.tsx
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Switch
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### A setting that applies immediately
|
|
19
|
+
|
|
20
|
+
Track 26×15, line when off, accent when on; the thumb slides in 150ms. Switch is only the track: a horizontal Field puts its 13px label to the right, and FieldContent adds a muted second line. In a settings row it sits on the right instead, with the row's text as its label.
|
|
21
|
+
|
|
22
|
+
Example: `basic`
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
"use client";
|
|
26
|
+
|
|
27
|
+
import { useState } from "react";
|
|
28
|
+
import { Field, FieldContent, FieldDescription, FieldLabel } from "@major-tech/ui/field";
|
|
29
|
+
import { Switch } from "@major-tech/ui/switch";
|
|
30
|
+
|
|
31
|
+
export default function SwitchBasic() {
|
|
32
|
+
const [isReachableInSlack, setIsReachableInSlack] = useState(true);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className="flex flex-col gap-space-16">
|
|
36
|
+
<Field orientation="horizontal">
|
|
37
|
+
<Switch id="reachable-in-slack" checked={isReachableInSlack} onCheckedChange={setIsReachableInSlack} />
|
|
38
|
+
<FieldLabel htmlFor="reachable-in-slack">Reachable in Slack</FieldLabel>
|
|
39
|
+
</Field>
|
|
40
|
+
<Field orientation="horizontal">
|
|
41
|
+
<Switch id="per-environment" aria-describedby="per-environment-hint" />
|
|
42
|
+
<FieldContent>
|
|
43
|
+
<FieldLabel htmlFor="per-environment">Different credentials per environment</FieldLabel>
|
|
44
|
+
<FieldDescription id="per-environment-hint">
|
|
45
|
+
Recommended when the service has a separate staging setup.
|
|
46
|
+
</FieldDescription>
|
|
47
|
+
</FieldContent>
|
|
48
|
+
</Field>
|
|
49
|
+
<Field orientation="horizontal">
|
|
50
|
+
<Switch id="rate-limiting" disabled />
|
|
51
|
+
<FieldLabel htmlFor="rate-limiting">Rate limiting</FieldLabel>
|
|
52
|
+
</Field>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Guidelines
|
|
59
|
+
|
|
60
|
+
Do:
|
|
61
|
+
|
|
62
|
+
- Apply the change the moment it flips, and confirm with a toast where it matters (“Saved for Staging”).
|
|
63
|
+
- Label the setting, not the state: “Reachable in Slack”.
|
|
64
|
+
- Use it in Details panels and settings rows.
|
|
65
|
+
|
|
66
|
+
Don't:
|
|
67
|
+
|
|
68
|
+
- A Switch inside a form that needs a Save button: use a Checkbox.
|
|
69
|
+
- “On / Off” labels next to the switch.
|
|
70
|
+
- A Switch for choosing between two different things: use Tabs.
|
|
71
|
+
|
|
72
|
+
## API
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
import { Switch } from "@major-tech/ui/switch";
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### `<Switch />`
|
|
79
|
+
|
|
80
|
+
Base UI `Switch.Root`: also `name`, `value`, `required`, `disabled`. Give it the `id` a `FieldLabel` points at.
|
|
81
|
+
|
|
82
|
+
| Prop | Type | Default | Description |
|
|
83
|
+
| --- | --- | --- | --- |
|
|
84
|
+
| `checked / defaultChecked` | `boolean` | — | The state. |
|
|
85
|
+
| `onCheckedChange` | `(checked: boolean, eventDetails) => void` | — | Called on toggle: save here. |
|
|
86
|
+
|
|
87
|
+
### Accessibility
|
|
88
|
+
|
|
89
|
+
- `role="switch"` with `aria-checked`; Space and Enter toggle.
|
|
90
|
+
- Focus shows a 2px faint ring with a 2px offset.
|
|
91
|
+
- Label it with FieldLabel `htmlFor`; on the right of a settings row, pass `aria-label` with the row's title.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: SystemNotice
|
|
3
|
+
slug: system-notice
|
|
4
|
+
description: How a turn ended (stopped, failed, out of turns) as a centred pill, or a step's outcome (a theme applied, a connector set up) as a quiet line.
|
|
5
|
+
group: AI
|
|
6
|
+
layer: composed
|
|
7
|
+
status: beta
|
|
8
|
+
since: 0.4.0
|
|
9
|
+
import: import { SystemNotice, SystemNoticeError, SYSTEM_NOTICE_VARIANTS, SYSTEM_NOTICE_TONES } from "@major-tech/ui/system-notice";
|
|
10
|
+
source: packages/ui/src/components/system-notice.tsx
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# SystemNotice
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### How a turn ended
|
|
18
|
+
|
|
19
|
+
A pill, centred between turns, when a turn stops short of a reply: 12px text and a 14px icon on the tone's soft fill (`secondary` for neutral and off).
|
|
20
|
+
|
|
21
|
+
Example: `turn-endings`
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
"use client";
|
|
25
|
+
|
|
26
|
+
import { SYSTEM_NOTICE_TONES, SystemNotice, SystemNoticeError } from "@major-tech/ui/system-notice";
|
|
27
|
+
import { CircleAlert, CircleStop } from "lucide-react";
|
|
28
|
+
|
|
29
|
+
const MAX_TURNS = 25;
|
|
30
|
+
|
|
31
|
+
export default function SystemNoticeTurnEndings() {
|
|
32
|
+
return (
|
|
33
|
+
<div className="flex w-full max-w-130 flex-col gap-space-12">
|
|
34
|
+
<SystemNotice tone={SYSTEM_NOTICE_TONES.WARN}>
|
|
35
|
+
<CircleAlert />
|
|
36
|
+
Maximum turns reached ({MAX_TURNS})
|
|
37
|
+
</SystemNotice>
|
|
38
|
+
<div>
|
|
39
|
+
<SystemNotice tone={SYSTEM_NOTICE_TONES.DANGER}>
|
|
40
|
+
<CircleAlert />
|
|
41
|
+
Error during execution
|
|
42
|
+
</SystemNotice>
|
|
43
|
+
<SystemNoticeError>The sandbox stopped responding after 120s.</SystemNoticeError>
|
|
44
|
+
</div>
|
|
45
|
+
<SystemNotice>
|
|
46
|
+
<CircleStop />
|
|
47
|
+
Interrupted by user
|
|
48
|
+
</SystemNotice>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- **warn**: Major ran out of turns. Say how many: “Maximum turns reached (25)”.
|
|
55
|
+
- **danger**: the turn failed. Put each error under it in a `SystemNoticeError`, so it says what failed.
|
|
56
|
+
- **neutral**: the person stopped it: “Interrupted by user”. A conversation that is only messaged, never stopped (Pepper), doesn’t show it.
|
|
57
|
+
- success and off are for a step's outcome; a pill takes them only for a turn ending of the product's own (a scheduled run that finished or was skipped).
|
|
58
|
+
|
|
59
|
+
### A step's outcome
|
|
60
|
+
|
|
61
|
+
A quiet line where the step it reports on would sit: 13px muted, 24px tall and 7px from icon to text, like a Trace step. The tone colours only the icon.
|
|
62
|
+
|
|
63
|
+
Example: `step-outcomes`
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
"use client";
|
|
67
|
+
|
|
68
|
+
import { SYSTEM_NOTICE_TONES, SYSTEM_NOTICE_VARIANTS, SystemNotice } from "@major-tech/ui/system-notice";
|
|
69
|
+
import { CircleCheck, CircleX, Palette } from "lucide-react";
|
|
70
|
+
|
|
71
|
+
export default function SystemNoticeStepOutcomes() {
|
|
72
|
+
return (
|
|
73
|
+
<div className="flex w-full max-w-130 flex-col">
|
|
74
|
+
<SystemNotice variant={SYSTEM_NOTICE_VARIANTS.LINE}>
|
|
75
|
+
<Palette />
|
|
76
|
+
Theme updated — applying changes
|
|
77
|
+
</SystemNotice>
|
|
78
|
+
<SystemNotice variant={SYSTEM_NOTICE_VARIANTS.LINE} tone={SYSTEM_NOTICE_TONES.SUCCESS}>
|
|
79
|
+
<CircleCheck />
|
|
80
|
+
Resource connector configured
|
|
81
|
+
</SystemNotice>
|
|
82
|
+
<SystemNotice variant={SYSTEM_NOTICE_VARIANTS.LINE} tone={SYSTEM_NOTICE_TONES.OFF}>
|
|
83
|
+
<CircleX />
|
|
84
|
+
Resource setup declined
|
|
85
|
+
</SystemNotice>
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- neutral for news with no verdict: a theme applied.
|
|
92
|
+
- success for something set up: a connector configured.
|
|
93
|
+
- off for something declined or skipped: its icon in faint.
|
|
94
|
+
- warn and danger for a step that needs a look or failed, when no Trace step says it already.
|
|
95
|
+
|
|
96
|
+
### Guidelines
|
|
97
|
+
|
|
98
|
+
Do:
|
|
99
|
+
|
|
100
|
+
- Keep it to one short sentence in sentence case.
|
|
101
|
+
- Use a pill only for how a turn ended, a line for anything that happened inside one.
|
|
102
|
+
- Say what failed under a failed turn, one error per line.
|
|
103
|
+
|
|
104
|
+
Don't:
|
|
105
|
+
|
|
106
|
+
- Stack several pills in a row: show the one that ended the turn.
|
|
107
|
+
- Put actions in a notice: a request Major waits on is a RequestCard.
|
|
108
|
+
- Use danger for a step the person declined: that's off.
|
|
109
|
+
|
|
110
|
+
## API
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
import { SystemNotice, SystemNoticeError, SYSTEM_NOTICE_VARIANTS, SYSTEM_NOTICE_TONES } from "@major-tech/ui/system-notice";
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### `<SystemNotice />`
|
|
117
|
+
|
|
118
|
+
Renders a `<div>`. Children are a lucide icon (sized 14px for you) and the text.
|
|
119
|
+
|
|
120
|
+
| Prop | Type | Default | Description |
|
|
121
|
+
| --- | --- | --- | --- |
|
|
122
|
+
| `variant` | `"pill" \| "line"` | `"pill"` | pill is centred between turns; line sits where a step would. |
|
|
123
|
+
| `tone` | `"neutral" \| "warn" \| "danger" \| "success" \| "off"` | `"neutral"` | A pill's fill and text; a line's icon colour. |
|
|
124
|
+
|
|
125
|
+
### `<SystemNoticeError />`
|
|
126
|
+
|
|
127
|
+
Renders a `<p>`, centred under the pill in 12px danger, up to 420px wide. One per error.
|
|
128
|
+
|
|
129
|
+
| Prop | Type | Default | Description |
|
|
130
|
+
| --- | --- | --- | --- |
|
|
131
|
+
| `children` | `ReactNode` | — | What failed. |
|
|
132
|
+
|
|
133
|
+
### `SYSTEM_NOTICE_VARIANTS · SYSTEM_NOTICE_TONES`
|
|
134
|
+
|
|
135
|
+
| Prop | Type | Default | Description |
|
|
136
|
+
| --- | --- | --- | --- |
|
|
137
|
+
| `PILL · LINE` | `SystemNoticeVariant` | — | The forms. |
|
|
138
|
+
| `NEUTRAL · WARN · DANGER · SUCCESS · OFF` | `SystemNoticeTone` | — | The tones. |
|
|
139
|
+
|
|
140
|
+
### Accessibility
|
|
141
|
+
|
|
142
|
+
- A notice is plain text: the words carry the meaning, never the colour alone.
|
|
143
|
+
- The icon is decorative: lucide icons are `aria-hidden` by default.
|
|
144
|
+
- Announce how a turn ended in the chat's live region along with the reply, not as a separate alert.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Table
|
|
3
|
+
slug: table
|
|
4
|
+
description: "Semantic table parts: a 36px header, 56px rows with line dividers and a hover fill."
|
|
5
|
+
group: Data
|
|
6
|
+
layer: primitive
|
|
7
|
+
status: stable
|
|
8
|
+
since: 0.3.0
|
|
9
|
+
import: import { Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption } from "@major-tech/ui/table";
|
|
10
|
+
source: packages/ui/src/components/table.tsx
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Table
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### Rows
|
|
18
|
+
|
|
19
|
+
A 36px header of 12px muted labels with a line under it, then 56px rows with line dividers and the hover fill. Cells have 12px side padding and no vertical padding: the row height centres them.
|
|
20
|
+
|
|
21
|
+
Example: `members`
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Avatar, AvatarFallback, AVATAR_SIZES, AVATAR_TONES } from "@major-tech/ui/avatar";
|
|
25
|
+
import { BADGE_VARIANTS, Badge } from "@major-tech/ui/badge";
|
|
26
|
+
import { BUTTON_SIZES, BUTTON_VARIANTS, Button } from "@major-tech/ui/button";
|
|
27
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@major-tech/ui/table";
|
|
28
|
+
import { EllipsisVertical } from "lucide-react";
|
|
29
|
+
|
|
30
|
+
const MEMBER_STATUSES = {
|
|
31
|
+
ACTIVE: "Active",
|
|
32
|
+
PENDING: "Pending",
|
|
33
|
+
} as const;
|
|
34
|
+
|
|
35
|
+
const MEMBERS = [
|
|
36
|
+
{ initials: "MB", name: "Maksim Borisov", email: "maksim@acme.com", role: "Admin", status: MEMBER_STATUSES.ACTIVE },
|
|
37
|
+
{ initials: "JB", name: "Jason Bao", email: "jason@acme.com", role: "Editor", status: MEMBER_STATUSES.ACTIVE },
|
|
38
|
+
{ initials: "AL", name: "Ana López", email: "ana@acme.com", role: "Viewer", status: MEMBER_STATUSES.PENDING },
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
export default function TableMembers() {
|
|
42
|
+
return (
|
|
43
|
+
<Table>
|
|
44
|
+
<TableHeader>
|
|
45
|
+
<TableRow>
|
|
46
|
+
<TableHead>Name</TableHead>
|
|
47
|
+
<TableHead>Role</TableHead>
|
|
48
|
+
<TableHead>Status</TableHead>
|
|
49
|
+
<TableHead className="w-12">
|
|
50
|
+
<span className="sr-only">Actions</span>
|
|
51
|
+
</TableHead>
|
|
52
|
+
</TableRow>
|
|
53
|
+
</TableHeader>
|
|
54
|
+
<TableBody>
|
|
55
|
+
{MEMBERS.map((member) => (
|
|
56
|
+
<TableRow key={member.email}>
|
|
57
|
+
<TableCell>
|
|
58
|
+
<div className="flex items-center gap-space-10">
|
|
59
|
+
<Avatar size={AVATAR_SIZES.MD}>
|
|
60
|
+
<AvatarFallback tone={AVATAR_TONES.MUTED}>{member.initials}</AvatarFallback>
|
|
61
|
+
</Avatar>
|
|
62
|
+
<div className="flex flex-col">
|
|
63
|
+
<span className="text-body font-medium text-ink">{member.name}</span>
|
|
64
|
+
<span className="text-small text-muted">{member.email}</span>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</TableCell>
|
|
68
|
+
<TableCell className="text-ink-2">{member.role}</TableCell>
|
|
69
|
+
<TableCell>
|
|
70
|
+
<Badge variant={member.status === MEMBER_STATUSES.ACTIVE ? BADGE_VARIANTS.LIVE : BADGE_VARIANTS.DEFAULT}>
|
|
71
|
+
{member.status}
|
|
72
|
+
</Badge>
|
|
73
|
+
</TableCell>
|
|
74
|
+
<TableCell>
|
|
75
|
+
<Button variant={BUTTON_VARIANTS.GHOST} size={BUTTON_SIZES.ICON} aria-label="Options">
|
|
76
|
+
<EllipsisVertical />
|
|
77
|
+
</Button>
|
|
78
|
+
</TableCell>
|
|
79
|
+
</TableRow>
|
|
80
|
+
))}
|
|
81
|
+
</TableBody>
|
|
82
|
+
</Table>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Footer and caption
|
|
88
|
+
|
|
89
|
+
`TableFooter` carries totals above a line; `TableCaption` sits under the table in 13px muted. Right-align numbers in both the header and the cells.
|
|
90
|
+
|
|
91
|
+
Example: `totals`
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
import {
|
|
95
|
+
Table,
|
|
96
|
+
TableBody,
|
|
97
|
+
TableCaption,
|
|
98
|
+
TableCell,
|
|
99
|
+
TableFooter,
|
|
100
|
+
TableHead,
|
|
101
|
+
TableHeader,
|
|
102
|
+
TableRow,
|
|
103
|
+
} from "@major-tech/ui/table";
|
|
104
|
+
|
|
105
|
+
const SPEND = [
|
|
106
|
+
{ agent: "Daily Joke", runs: 212, cost: 4.18 },
|
|
107
|
+
{ agent: "Invoice matcher", runs: 96, cost: 11.42 },
|
|
108
|
+
{ agent: "Lead enricher", runs: 31, cost: 6.74 },
|
|
109
|
+
];
|
|
110
|
+
|
|
111
|
+
const formatUsd = (value: number) => `$${value.toFixed(2)}`;
|
|
112
|
+
|
|
113
|
+
export default function TableTotals() {
|
|
114
|
+
const totalRuns = SPEND.reduce((total, row) => total + row.runs, 0);
|
|
115
|
+
const totalCost = SPEND.reduce((total, row) => total + row.cost, 0);
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<Table>
|
|
119
|
+
<TableCaption>Spend per agent, October.</TableCaption>
|
|
120
|
+
<TableHeader>
|
|
121
|
+
<TableRow>
|
|
122
|
+
<TableHead>Agent</TableHead>
|
|
123
|
+
<TableHead className="text-right">Runs</TableHead>
|
|
124
|
+
<TableHead className="text-right">Cost</TableHead>
|
|
125
|
+
</TableRow>
|
|
126
|
+
</TableHeader>
|
|
127
|
+
<TableBody>
|
|
128
|
+
{SPEND.map((row) => (
|
|
129
|
+
<TableRow key={row.agent}>
|
|
130
|
+
<TableCell className="text-ink">{row.agent}</TableCell>
|
|
131
|
+
<TableCell className="text-right tabular-nums text-ink-2">{row.runs}</TableCell>
|
|
132
|
+
<TableCell className="text-right tabular-nums text-ink-2">{formatUsd(row.cost)}</TableCell>
|
|
133
|
+
</TableRow>
|
|
134
|
+
))}
|
|
135
|
+
</TableBody>
|
|
136
|
+
<TableFooter>
|
|
137
|
+
<TableRow className="hover:bg-transparent">
|
|
138
|
+
<TableCell className="text-ink">Total</TableCell>
|
|
139
|
+
<TableCell className="text-right tabular-nums text-ink">{totalRuns}</TableCell>
|
|
140
|
+
<TableCell className="text-right tabular-nums text-ink">{formatUsd(totalCost)}</TableCell>
|
|
141
|
+
</TableRow>
|
|
142
|
+
</TableFooter>
|
|
143
|
+
</Table>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Table or DataTable?
|
|
149
|
+
|
|
150
|
+
- **Table** — the semantic parts, for rows you lay out yourself: a few members, totals, a short list in a dialog.
|
|
151
|
+
- **DataTable** — the same parts driven by TanStack: sorting, rows that expand, loading skeletons, compact rows, paging with Pagination.
|
|
152
|
+
|
|
153
|
+
### Guidelines
|
|
154
|
+
|
|
155
|
+
Do:
|
|
156
|
+
|
|
157
|
+
- Cells hold text, a Select, a status dot, or one secondary action. The ⋮ menu sits in the last column.
|
|
158
|
+
- Fit wide tables by merging columns; they scroll inside their own container as a last resort.
|
|
159
|
+
- Mark a selected row with `data-state="selected"`: it keeps the hover fill.
|
|
160
|
+
|
|
161
|
+
Don't:
|
|
162
|
+
|
|
163
|
+
- The page's green CTA repeated in every row.
|
|
164
|
+
- Vertical padding on cells: the 56px row sets the rhythm.
|
|
165
|
+
- Zebra stripes or a filled header.
|
|
166
|
+
|
|
167
|
+
## API
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
import { Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption } from "@major-tech/ui/table";
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### `<Table />`
|
|
174
|
+
|
|
175
|
+
A `<table>` inside a horizontally scrolling `<div>`; other props go to the table.
|
|
176
|
+
|
|
177
|
+
| Prop | Type | Default | Description |
|
|
178
|
+
| --- | --- | --- | --- |
|
|
179
|
+
| `containerClassName` | `string` | — | Classes for the scroll container: a card frame, a max height. |
|
|
180
|
+
| `containerStyle` | `CSSProperties` | — | Styles for the scroll container, e.g. a `maxHeight` for a sticky header. |
|
|
181
|
+
| `containerRef` | `Ref<HTMLDivElement>` | — | The scroll container, for virtualizers. |
|
|
182
|
+
|
|
183
|
+
### Parts
|
|
184
|
+
|
|
185
|
+
Every part accepts the native attributes of its element.
|
|
186
|
+
|
|
187
|
+
| Prop | Type | Default | Description |
|
|
188
|
+
| --- | --- | --- | --- |
|
|
189
|
+
| `TableHeader` | `<thead>` | — | A line under the header rows; no hover fill. |
|
|
190
|
+
| `TableBody` | `<tbody>` | — | The rows. |
|
|
191
|
+
| `TableFooter` | `<tfoot>` | — | Totals above a line, in medium weight. |
|
|
192
|
+
| `TableRow` | `<tr>` | — | A line above it and the hover fill; `data-state="selected"` keeps the fill. |
|
|
193
|
+
| `TableHead` | `<th>` | — | 36px, 12px muted, 12px side padding. |
|
|
194
|
+
| `TableCell` | `<td>` | — | 56px row height, 12px side padding. |
|
|
195
|
+
| `TableCaption` | `<caption>` | — | 13px muted, under the table. |
|
|
196
|
+
|
|
197
|
+
### Accessibility
|
|
198
|
+
|
|
199
|
+
- Real table semantics: screen readers announce rows and columns.
|
|
200
|
+
- Give an actions column a visually hidden header (`sr-only`).
|
|
201
|
+
- A caption names the table for screen readers; keep it when the heading above is not enough.
|