@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,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Kbd
|
|
3
|
+
slug: kbd
|
|
4
|
+
description: "One keyboard key in a hint: /, ⌘K, Esc."
|
|
5
|
+
group: Labels
|
|
6
|
+
layer: primitive
|
|
7
|
+
status: stable
|
|
8
|
+
since: 0.3.0
|
|
9
|
+
import: import { Kbd } from "@major-tech/ui/kbd";
|
|
10
|
+
source: packages/ui/src/components/kbd.tsx
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Kbd
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### Key hints
|
|
18
|
+
|
|
19
|
+
One key or one shortcut per Kbd: 20px tall, mono 12px, a line border on the surface. Use it in help text, menus and empty states.
|
|
20
|
+
|
|
21
|
+
Example: `hints`
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Kbd } from "@major-tech/ui/kbd";
|
|
25
|
+
|
|
26
|
+
export default function KbdHints() {
|
|
27
|
+
return (
|
|
28
|
+
<p className="flex items-center gap-space-6 text-ui text-muted">
|
|
29
|
+
Press <Kbd>/</Kbd> to search, <Kbd>Esc</Kbd> to clear, <Kbd>⌘K</Kbd> for the command bar.
|
|
30
|
+
</p>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### In a tooltip
|
|
36
|
+
|
|
37
|
+
Inside a Tooltip, write a plain `<kbd>`: the tooltip styles it for its inverted fill.
|
|
38
|
+
|
|
39
|
+
Example: `in-a-tooltip`
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Button } from "@major-tech/ui/button";
|
|
43
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@major-tech/ui/tooltip";
|
|
44
|
+
import { Search } from "lucide-react";
|
|
45
|
+
|
|
46
|
+
export default function KbdInATooltip() {
|
|
47
|
+
return (
|
|
48
|
+
<Tooltip>
|
|
49
|
+
<TooltipTrigger render={<Button variant="ghost" size="icon" aria-label="Search" aria-keyshortcuts="/" />}>
|
|
50
|
+
<Search />
|
|
51
|
+
</TooltipTrigger>
|
|
52
|
+
<TooltipContent>
|
|
53
|
+
Search <kbd>/</kbd>
|
|
54
|
+
</TooltipContent>
|
|
55
|
+
</Tooltip>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Guidelines
|
|
61
|
+
|
|
62
|
+
Do:
|
|
63
|
+
|
|
64
|
+
- Write keys the way the keyboard shows them: ⌘K, Esc, /.
|
|
65
|
+
- Show a hint only for a shortcut that really exists on the page.
|
|
66
|
+
- Put the shortcut after the action it triggers.
|
|
67
|
+
|
|
68
|
+
Don't:
|
|
69
|
+
|
|
70
|
+
- A Kbd inside a tooltip: use a plain `<kbd>` there.
|
|
71
|
+
- Kbd as a button or a tag: it is not interactive.
|
|
72
|
+
- Shortcuts as the only way to reach something.
|
|
73
|
+
|
|
74
|
+
## API
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import { Kbd } from "@major-tech/ui/kbd";
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### `<Kbd />`
|
|
81
|
+
|
|
82
|
+
Also accepts native `<kbd>` attributes.
|
|
83
|
+
|
|
84
|
+
| Prop | Type | Default | Description |
|
|
85
|
+
| --- | --- | --- | --- |
|
|
86
|
+
| `children` | `ReactNode` | — | The key or shortcut. |
|
|
87
|
+
|
|
88
|
+
### Accessibility
|
|
89
|
+
|
|
90
|
+
- Renders a native `<kbd>`, which screen readers read as text.
|
|
91
|
+
- Name the shortcut on the control it triggers with `aria-keyshortcuts`.
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Markdown
|
|
3
|
+
slug: markdown
|
|
4
|
+
description: "Markdown set in the system's type: a chat reply, an agent's thinking, a .md file. Every tag maps to a named style, and fenced code is a CodeBlock."
|
|
5
|
+
group: Data
|
|
6
|
+
layer: composed
|
|
7
|
+
status: beta
|
|
8
|
+
since: 0.4.0
|
|
9
|
+
import: import { Markdown, markdownVariants, MARKDOWN_SIZES, MARKDOWN_TONES } from "@major-tech/ui/markdown";
|
|
10
|
+
requires: react-markdown, remark-gfm
|
|
11
|
+
source: packages/ui/src/components/markdown.tsx
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Markdown
|
|
15
|
+
|
|
16
|
+
> **Install `react-markdown` too.** Markdown doesn't work without it, and the package doesn't install it for you: `pnpm add react-markdown` (10.1 or later).
|
|
17
|
+
|
|
18
|
+
> **Install `remark-gfm` too.** Markdown doesn't work without it, and the package doesn't install it for you: `pnpm add remark-gfm` (4.0 or later).
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Markdown sets text an agent or a person wrote in the system's type: every tag maps to a named style, so headings stay on the scale, the colours follow the theme, and fenced code is a CodeBlock. GitHub's flavour: tables, task lists, strikethrough and bare links.
|
|
23
|
+
|
|
24
|
+
### In the chat
|
|
25
|
+
|
|
26
|
+
The default, `sm`: an agent's reply at 14/21 in tight blocks. Headings stay small enough for a message: h1 17px (`text-editor-h2`), h2 14.5px (`text-card-title`), the rest 14px semibold.
|
|
27
|
+
|
|
28
|
+
Example: `reply`
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { Markdown } from "@major-tech/ui/markdown";
|
|
32
|
+
|
|
33
|
+
const REPLY = `## Daily Joke is live
|
|
34
|
+
|
|
35
|
+
It posts to **#random** at 9:00 every weekday. Three things changed:
|
|
36
|
+
|
|
37
|
+
1. Jokes are capped at four lines.
|
|
38
|
+
2. Repeats are skipped for 30 days.
|
|
39
|
+
3. A failed post retries once, then tells you.
|
|
40
|
+
|
|
41
|
+
| Day | Posts | Failed |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| Mon | 1 | 0 |
|
|
44
|
+
| Tue | 1 | 1 |
|
|
45
|
+
|
|
46
|
+
The schedule is \`0 9 * * 1-5\`:
|
|
47
|
+
|
|
48
|
+
\`\`\`json
|
|
49
|
+
{ "schedule": "0 9 * * 1-5", "channel": "#random" }
|
|
50
|
+
\`\`\`
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
export default function MarkdownReply() {
|
|
54
|
+
return (
|
|
55
|
+
<div className="w-full max-w-105">
|
|
56
|
+
<Markdown>{REPLY}</Markdown>
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- Blocks are 4px apart; a heading has 12px above it and 4px below, so it reads with what it introduces.
|
|
63
|
+
- A table wider than the message scrolls sideways on its own, in 12px.
|
|
64
|
+
- Fenced code is a HighlightedCodeBlock that wraps; inline code is a chip on `code-surface`.
|
|
65
|
+
|
|
66
|
+
### Thinking
|
|
67
|
+
|
|
68
|
+
`muted` for the agent's narration and thinking inside its trace: text in muted, headings and bold in ink-2.
|
|
69
|
+
|
|
70
|
+
Example: `thinking`
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
"use client";
|
|
74
|
+
|
|
75
|
+
import { MARKDOWN_TONES, Markdown } from "@major-tech/ui/markdown";
|
|
76
|
+
|
|
77
|
+
const THINKING = `The person wants shorter jokes. **Two options:** cap the length in the prompt, or trim the reply after it's written.
|
|
78
|
+
|
|
79
|
+
- Capping in the prompt keeps the punchline.
|
|
80
|
+
- Trimming can cut it off.
|
|
81
|
+
|
|
82
|
+
I'll cap it in the prompt.`;
|
|
83
|
+
|
|
84
|
+
export default function MarkdownThinking() {
|
|
85
|
+
return (
|
|
86
|
+
<div className="w-full max-w-105">
|
|
87
|
+
<Markdown tone={MARKDOWN_TONES.MUTED}>{THINKING}</Markdown>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### A document
|
|
94
|
+
|
|
95
|
+
`md` for a .md file, a skill's instructions or a page of terms: 15/24 (`text-editor-body`), 12px between blocks, h1 `text-editor-title` and h2 `text-editor-h2` as in the instructions editor.
|
|
96
|
+
|
|
97
|
+
Example: `document`
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
"use client";
|
|
101
|
+
|
|
102
|
+
import { MARKDOWN_SIZES, Markdown } from "@major-tech/ui/markdown";
|
|
103
|
+
|
|
104
|
+
const DOCUMENT = `# lead-scoring
|
|
105
|
+
|
|
106
|
+
Scores a new lead from 0 to 100 so sales calls the warm ones first.
|
|
107
|
+
|
|
108
|
+
## When to use it
|
|
109
|
+
|
|
110
|
+
When a lead arrives from the website form or a trade show list. Not for existing customers: their history says more.
|
|
111
|
+
|
|
112
|
+
### Inputs
|
|
113
|
+
|
|
114
|
+
- **Company size**, from the CRM.
|
|
115
|
+
- **Role**, from the form.
|
|
116
|
+
- [Pricing page visits](https://example.com), from analytics.
|
|
117
|
+
|
|
118
|
+
> A score is a guess. Sales can always override it.
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
export default function MarkdownDocument() {
|
|
122
|
+
return (
|
|
123
|
+
<div className="w-full max-w-150">
|
|
124
|
+
<Markdown size={MARKDOWN_SIZES.MD}>{DOCUMENT}</Markdown>
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Guidelines
|
|
131
|
+
|
|
132
|
+
- `inherit` takes every colour from the parent and drops the fills: Markdown inside a highlight, such as a diff's added and removed lines.
|
|
133
|
+
- Pass `components` for a tag the product draws itself (a link that opens a side panel); fenced code and tables stay the system's unless replaced.
|
|
134
|
+
- HTML from elsewhere (an editor's content, static text) takes the same type with `markdownVariants({ size, tone })` on its wrapper. A server component imports it, and the sizes and tones, from `@major-tech/ui/lib/markdown`.
|
|
135
|
+
|
|
136
|
+
Do:
|
|
137
|
+
|
|
138
|
+
- Use Markdown for anything written in Markdown, in the chat and in documents.
|
|
139
|
+
- Pick the size by the place: `sm` in the chat, `md` for a document read on its own.
|
|
140
|
+
|
|
141
|
+
Don't:
|
|
142
|
+
|
|
143
|
+
- Tailwind Typography's `prose` classes: their headings and spacing are off the scale.
|
|
144
|
+
- A heading larger than 17px in a chat message.
|
|
145
|
+
|
|
146
|
+
## API
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
yarn add react-markdown remark-gfm
|
|
150
|
+
# or: pnpm add react-markdown remark-gfm
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
import { Markdown, markdownVariants, MARKDOWN_SIZES, MARKDOWN_TONES } from "@major-tech/ui/markdown";
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### `<Markdown />`
|
|
158
|
+
|
|
159
|
+
Renders a `<div>`; native attributes go to it.
|
|
160
|
+
|
|
161
|
+
| Prop | Type | Default | Description |
|
|
162
|
+
| --- | --- | --- | --- |
|
|
163
|
+
| `children`* | `string` | — | The Markdown source. |
|
|
164
|
+
| `size` | `"sm" \| "md"` | `"sm"` | sm: the chat, 14/21. md: a document, 15/24. `MARKDOWN_SIZES` holds the values. |
|
|
165
|
+
| `tone` | `"default" \| "muted" \| "inherit"` | `"default"` | muted: the agent's thinking. inherit: every colour from the parent, no fills. `MARKDOWN_TONES` holds the values. |
|
|
166
|
+
| `components` | `Components` | — | react-markdown's: tags the product draws itself. |
|
|
167
|
+
| `rehypePlugins` | `PluggableList` | — | Run on the rendered tree after GitHub's flavour: a diff's word highlights. |
|
|
168
|
+
|
|
169
|
+
`*` marks a required prop.
|
|
170
|
+
|
|
171
|
+
### `markdownVariants`
|
|
172
|
+
|
|
173
|
+
| Prop | Type | Default | Description |
|
|
174
|
+
| --- | --- | --- | --- |
|
|
175
|
+
| `{ size, tone }` | `(options) => string` | — | The same type as classes, for HTML that comes from elsewhere. |
|
|
176
|
+
|
|
177
|
+
### Accessibility
|
|
178
|
+
|
|
179
|
+
- The tags stay what Markdown says they are: headings are headings, lists are lists, a table is a table, so screen readers read the structure.
|
|
180
|
+
- Links are underlined, not marked by colour alone.
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Message
|
|
3
|
+
slug: message
|
|
4
|
+
description: "One turn in the chat panel: the person's bubble or the agent's reply."
|
|
5
|
+
group: AI
|
|
6
|
+
layer: composed
|
|
7
|
+
status: stable
|
|
8
|
+
since: 0.1.0
|
|
9
|
+
import: import { Message, MESSAGE_AUTHORS } from "@major-tech/ui/message";
|
|
10
|
+
source: packages/ui/src/components/message.tsx
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Message
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### A conversation
|
|
18
|
+
|
|
19
|
+
The person writes in a right-aligned bubble with the time below. The agent answers in plain text, preceded by its Trace.
|
|
20
|
+
|
|
21
|
+
Example: `conversation`
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Message } from "@major-tech/ui/message";
|
|
25
|
+
import {
|
|
26
|
+
Trace,
|
|
27
|
+
TraceCollapsible,
|
|
28
|
+
TraceCollapsibleContent,
|
|
29
|
+
TraceCollapsibleTrigger,
|
|
30
|
+
TraceDescription,
|
|
31
|
+
TraceIcon,
|
|
32
|
+
TraceLine,
|
|
33
|
+
TraceSteps,
|
|
34
|
+
TraceTitle,
|
|
35
|
+
} from "@major-tech/ui/trace";
|
|
36
|
+
import { BookOpen, MessageSquare, PencilLine } from "lucide-react";
|
|
37
|
+
|
|
38
|
+
export default function ChatConversation() {
|
|
39
|
+
return (
|
|
40
|
+
<div className="flex w-full max-w-90 flex-col gap-space-12">
|
|
41
|
+
<Message from="user" time="9:45am">
|
|
42
|
+
Keep them short, I read them on my phone.
|
|
43
|
+
</Message>
|
|
44
|
+
<Message
|
|
45
|
+
from="agent"
|
|
46
|
+
trace={
|
|
47
|
+
<Trace>
|
|
48
|
+
<TraceCollapsible>
|
|
49
|
+
<TraceCollapsibleTrigger>
|
|
50
|
+
<TraceLine className="text-faint">
|
|
51
|
+
<TraceTitle>Thought for 3s · 3 steps</TraceTitle>
|
|
52
|
+
</TraceLine>
|
|
53
|
+
</TraceCollapsibleTrigger>
|
|
54
|
+
<TraceCollapsibleContent>
|
|
55
|
+
<TraceSteps>
|
|
56
|
+
<TraceLine>
|
|
57
|
+
<TraceIcon>
|
|
58
|
+
<MessageSquare />
|
|
59
|
+
</TraceIcon>
|
|
60
|
+
<TraceTitle>Read your message</TraceTitle>
|
|
61
|
+
</TraceLine>
|
|
62
|
+
<TraceLine>
|
|
63
|
+
<TraceIcon>
|
|
64
|
+
<BookOpen />
|
|
65
|
+
</TraceIcon>
|
|
66
|
+
<TraceTitle>Followed workplace-humor-guide</TraceTitle>
|
|
67
|
+
</TraceLine>
|
|
68
|
+
<TraceLine>
|
|
69
|
+
<TraceIcon>
|
|
70
|
+
<PencilLine />
|
|
71
|
+
</TraceIcon>
|
|
72
|
+
<TraceTitle>Edited step 3 of the instructions</TraceTitle>
|
|
73
|
+
<TraceDescription>+1 −0</TraceDescription>
|
|
74
|
+
</TraceLine>
|
|
75
|
+
</TraceSteps>
|
|
76
|
+
</TraceCollapsibleContent>
|
|
77
|
+
</TraceCollapsible>
|
|
78
|
+
</Trace>
|
|
79
|
+
}
|
|
80
|
+
>
|
|
81
|
+
<p>Jokes are now capped at 1–4 lines, with the punchline on its own line.</p>
|
|
82
|
+
<p>Here's what one looks like.</p>
|
|
83
|
+
</Message>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- **The person**: a bubble fill with a line border, rounded-lg, 14/20, at most 302px wide; the time below in faint 12px.
|
|
90
|
+
- **The agent**: ink-2 body text (14/21), no bubble, left-aligned, its Trace above.
|
|
91
|
+
- 12px between messages; 32px between the last message and the Composer.
|
|
92
|
+
|
|
93
|
+
### In a conversation
|
|
94
|
+
|
|
95
|
+
A conversation that runs elsewhere (Pepper over Slack or Teams) shows where each message came from and how Major answered it.
|
|
96
|
+
|
|
97
|
+
Example: `conversation-over-slack`
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
import { BrandTile } from "@major-tech/ui/brand-tile";
|
|
101
|
+
import { Message } from "@major-tech/ui/message";
|
|
102
|
+
|
|
103
|
+
export default function MessageConversationOverSlack() {
|
|
104
|
+
return (
|
|
105
|
+
<div className="flex w-full max-w-90 flex-col gap-space-12">
|
|
106
|
+
<Message
|
|
107
|
+
from="user"
|
|
108
|
+
time="8:02am"
|
|
109
|
+
reactions={<span title=":thumbsup:">👍</span>}
|
|
110
|
+
meta={<BrandTile letter="S" color="#4A154B" size="xs" aria-label="From Slack" />}
|
|
111
|
+
>
|
|
112
|
+
Move my 3pm with Dana to tomorrow.
|
|
113
|
+
</Message>
|
|
114
|
+
<Message from="agent" bubble time="8:02am">
|
|
115
|
+
Done: Thursday 3pm, and Dana has the new invite.
|
|
116
|
+
</Message>
|
|
117
|
+
</div>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
- **reactions**: the emoji Major reacted with, on the person's bubble's corner like a tapback.
|
|
123
|
+
- **meta**: before the time under the bubble, where it was sent from: a 12px Slack or Teams mark.
|
|
124
|
+
- **bubble**: Major's delivered reply in a bubble too, on the left in `secondary`, as the other app shows it.
|
|
125
|
+
|
|
126
|
+
### Replies with cards and actions
|
|
127
|
+
|
|
128
|
+
Agent replies may include cards on the surface (a joke preview, a run result) and quiet actions underneath: ghost icon-sm Buttons with a tooltip.
|
|
129
|
+
|
|
130
|
+
Example: `with-card`
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
import { BUTTON_SIZES, BUTTON_VARIANTS, Button } from "@major-tech/ui/button";
|
|
134
|
+
import { Message } from "@major-tech/ui/message";
|
|
135
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@major-tech/ui/tooltip";
|
|
136
|
+
import { Copy, RotateCcw } from "lucide-react";
|
|
137
|
+
|
|
138
|
+
const REPLY_ACTIONS = [
|
|
139
|
+
{ label: "Copy", icon: <Copy /> },
|
|
140
|
+
{ label: "Try again", icon: <RotateCcw /> },
|
|
141
|
+
];
|
|
142
|
+
|
|
143
|
+
export default function ChatWithCard() {
|
|
144
|
+
return (
|
|
145
|
+
<div className="flex w-full max-w-90 flex-col gap-space-12">
|
|
146
|
+
<Message from="user" time="12:02pm">
|
|
147
|
+
Show me today's joke
|
|
148
|
+
</Message>
|
|
149
|
+
<Message
|
|
150
|
+
from="agent"
|
|
151
|
+
actions={REPLY_ACTIONS.map((action) => (
|
|
152
|
+
<Tooltip key={action.label}>
|
|
153
|
+
<TooltipTrigger
|
|
154
|
+
render={<Button variant={BUTTON_VARIANTS.GHOST} size={BUTTON_SIZES.ICON_SM} aria-label={action.label} />}
|
|
155
|
+
>
|
|
156
|
+
{action.icon}
|
|
157
|
+
</TooltipTrigger>
|
|
158
|
+
<TooltipContent>{action.label}</TooltipContent>
|
|
159
|
+
</Tooltip>
|
|
160
|
+
))}
|
|
161
|
+
>
|
|
162
|
+
<p>This is what Daily Joke sent Maksim at 12:00:</p>
|
|
163
|
+
<div className="rounded-lg border border-panel-edge bg-surface p-space-12 text-body text-ink shadow-card">
|
|
164
|
+
Why did the spreadsheet break up with the calendar?
|
|
165
|
+
<br />
|
|
166
|
+
It felt boxed in.
|
|
167
|
+
</div>
|
|
168
|
+
</Message>
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Messages with files
|
|
175
|
+
|
|
176
|
+
Files the person sent sit above the text inside their bubble, as an AttachmentGallery; files Major made sit in its reply, under the text. By the time a message is sent every file in it is done, so a sent tile shows its type and size and opens the file.
|
|
177
|
+
|
|
178
|
+
Example: `with-files`
|
|
179
|
+
|
|
180
|
+
```tsx
|
|
181
|
+
import { ATTACHMENT_GALLERY_SIZES, AttachmentGallery, type AttachmentItem } from "@major-tech/ui/attachment-gallery";
|
|
182
|
+
import { Message } from "@major-tech/ui/message";
|
|
183
|
+
|
|
184
|
+
const SENT_FILES: AttachmentItem[] = [
|
|
185
|
+
{ id: "sketch", name: "dashboard-sketch.png", url: "/major-mark.svg", size: 412_000 },
|
|
186
|
+
{ id: "brief", name: "Sales dashboard brief.pdf", url: "/major-mark.svg", size: 2_516_582 },
|
|
187
|
+
{ id: "pipeline", name: "q4-pipeline.xlsx", url: "/major-mark.svg", size: 2_400_000 },
|
|
188
|
+
{ id: "calls", name: "sales-calls.csv", url: "/major-mark.svg", size: 880_000 },
|
|
189
|
+
];
|
|
190
|
+
|
|
191
|
+
const MADE_FILES: AttachmentItem[] = [{ id: "export", name: "top-deals-q4.csv", url: "/major-mark.svg", size: 24_576 }];
|
|
192
|
+
|
|
193
|
+
export default function ChatWithFiles() {
|
|
194
|
+
return (
|
|
195
|
+
<div className="flex w-full max-w-105 flex-col gap-space-12">
|
|
196
|
+
<Message from="user" time="12:02pm">
|
|
197
|
+
<AttachmentGallery items={SENT_FILES} size={ATTACHMENT_GALLERY_SIZES.SM} className="mb-space-6" />
|
|
198
|
+
Build a sales dashboard from these, like the sketch.
|
|
199
|
+
</Message>
|
|
200
|
+
<Message from="agent">
|
|
201
|
+
<p>
|
|
202
|
+
I read all four. The pipeline sheet and the call log share deal IDs, so the dashboard joins them. Here are the
|
|
203
|
+
top 20 deals it will open with:
|
|
204
|
+
</p>
|
|
205
|
+
<AttachmentGallery items={MADE_FILES} size={ATTACHMENT_GALLERY_SIZES.SM} />
|
|
206
|
+
</Message>
|
|
207
|
+
</div>
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
- The person’s files: sm tiles, 6px above the text; more than fit scroll sideways and the bubble stays as wide as ever.
|
|
213
|
+
- Sent files are read-only: no remove, no retry. Failed files never reach a message.
|
|
214
|
+
- Major’s files: sm tiles under the paragraph that introduces them.
|
|
215
|
+
|
|
216
|
+
### Queued
|
|
217
|
+
|
|
218
|
+
What the person sends while Major works waits in the conversation, after the last message, until Major finishes: the whole message as it will go, with its files and chips, so one with only files queues too.
|
|
219
|
+
|
|
220
|
+
Example: `queued`
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
"use client";
|
|
224
|
+
|
|
225
|
+
import { useState } from "react";
|
|
226
|
+
import { ATTACHMENT_GALLERY_SIZES, AttachmentGallery, type AttachmentItem } from "@major-tech/ui/attachment-gallery";
|
|
227
|
+
import { Message } from "@major-tech/ui/message";
|
|
228
|
+
|
|
229
|
+
interface QueuedMessage {
|
|
230
|
+
id: string;
|
|
231
|
+
text: string;
|
|
232
|
+
files: AttachmentItem[];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const QUEUED_MESSAGES: QueuedMessage[] = [
|
|
236
|
+
{ id: "weekend", text: "Also add a weekend version", files: [] },
|
|
237
|
+
{
|
|
238
|
+
id: "logo",
|
|
239
|
+
text: "",
|
|
240
|
+
files: [
|
|
241
|
+
{
|
|
242
|
+
id: "logo",
|
|
243
|
+
name: "joke-logo.png",
|
|
244
|
+
url: "/major-mark.svg",
|
|
245
|
+
size: 86_000,
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
},
|
|
249
|
+
];
|
|
250
|
+
|
|
251
|
+
export default function MessageQueued() {
|
|
252
|
+
const [queue, setQueue] = useState(QUEUED_MESSAGES);
|
|
253
|
+
|
|
254
|
+
const handleCancel = (id: string) => setQueue((queued) => queued.filter((message) => message.id !== id));
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<div className="flex w-full max-w-105 flex-col gap-space-12">
|
|
258
|
+
<Message from="user" time="9:41am">
|
|
259
|
+
Make the jokes shorter
|
|
260
|
+
</Message>
|
|
261
|
+
<Message from="agent">
|
|
262
|
+
<p>Shortening them now.</p>
|
|
263
|
+
</Message>
|
|
264
|
+
{queue.map((message) => (
|
|
265
|
+
<Message
|
|
266
|
+
key={message.id}
|
|
267
|
+
from="user"
|
|
268
|
+
queued
|
|
269
|
+
onEdit={() => handleCancel(message.id)}
|
|
270
|
+
onCancel={() => handleCancel(message.id)}
|
|
271
|
+
>
|
|
272
|
+
{message.files.length > 0 && (
|
|
273
|
+
<AttachmentGallery
|
|
274
|
+
items={message.files}
|
|
275
|
+
size={ATTACHMENT_GALLERY_SIZES.SM}
|
|
276
|
+
className={message.text ? "mb-space-6" : undefined}
|
|
277
|
+
/>
|
|
278
|
+
)}
|
|
279
|
+
{message.text}
|
|
280
|
+
</Message>
|
|
281
|
+
))}
|
|
282
|
+
</div>
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
- **queued**: the bubble at 60%, with “Queued” in muted italic under it.
|
|
288
|
+
- **onEdit** adds Edit, which takes the message out of the queue and back into the Composer; **onCancel** adds Cancel, which drops it.
|
|
289
|
+
- A queued action (fix this error) queues the same way, with Cancel only.
|
|
290
|
+
|
|
291
|
+
### Guidelines
|
|
292
|
+
|
|
293
|
+
Do:
|
|
294
|
+
|
|
295
|
+
- Write the reply the way a colleague would: plain words, short sentences.
|
|
296
|
+
- Say what changed and where: “Jokes are now capped at 1–4 lines.”
|
|
297
|
+
- Put anything the person can act on in a card or the editor, not in prose.
|
|
298
|
+
|
|
299
|
+
Don't:
|
|
300
|
+
|
|
301
|
+
- A bubble around the agent's reply outside a conversation, or an avatar on every turn.
|
|
302
|
+
- Emoji, exclamation marks or internal terms in replies.
|
|
303
|
+
- Margins between messages: stack them with gap.
|
|
304
|
+
|
|
305
|
+
## API
|
|
306
|
+
|
|
307
|
+
```tsx
|
|
308
|
+
import { Message, MESSAGE_AUTHORS } from "@major-tech/ui/message";
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### `<Message />`
|
|
312
|
+
|
|
313
|
+
Also accepts `<div>` attributes, and a ref to the root element.
|
|
314
|
+
|
|
315
|
+
| Prop | Type | Default | Description |
|
|
316
|
+
| --- | --- | --- | --- |
|
|
317
|
+
| `from`* | `"user" \| "agent"` | — | Bubble on the right, or plain reply on the left. `MESSAGE_AUTHORS` holds the values. |
|
|
318
|
+
| `children` | `ReactNode` | — | The message. Agent replies may hold several `<p>` and cards. |
|
|
319
|
+
| `time` | `ReactNode` | — | “9:45am”. Under the bubble; after the actions for the agent. |
|
|
320
|
+
| `trace` | `ReactNode` | — | A Trace shown above the agent's reply. |
|
|
321
|
+
| `actions` | `ReactNode` | — | Ghost icon-sm Buttons under the agent's reply (Copy, Try again). |
|
|
322
|
+
| `avatar` | `ReactNode` | — | Optional, before the agent's reply. Most chats don't show one. |
|
|
323
|
+
| `reactions` | `ReactNode` | — | Emoji on the person's bubble's corner: what Major reacted with. |
|
|
324
|
+
| `meta` | `ReactNode` | — | Before the time under the person's bubble: where it came from (a Slack or Teams mark). |
|
|
325
|
+
| `bubble` | `boolean` | `false` | The agent's reply in a bubble: a reply delivered in a conversation. |
|
|
326
|
+
| `queued` | `boolean` | `false` | The person's message waits until Major finishes: dimmed, “Queued” under it. |
|
|
327
|
+
| `onEdit` | `() => void` | — | With `queued`: Edit, which puts the message back in the Composer. |
|
|
328
|
+
| `onCancel` | `() => void` | — | With `queued`: Cancel, which drops the message. |
|
|
329
|
+
|
|
330
|
+
`*` marks a required prop.
|
|
331
|
+
|
|
332
|
+
### Accessibility
|
|
333
|
+
|
|
334
|
+
- Wrap the thread in an element with `role="log"` and `aria-live="polite"` so new replies are announced.
|
|
335
|
+
- Times are text, not tooltips, so they read in order.
|
|
336
|
+
- Action buttons carry an `aria-label` and a tooltip.
|