@major-tech/ui 0.0.0-stage → 1.0.1
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 +107 -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 +159 -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 +284 -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,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Badge
|
|
3
|
+
slug: badge
|
|
4
|
+
description: "Small labels and counts: version state, New, Managed, an unread count."
|
|
5
|
+
group: Labels
|
|
6
|
+
layer: primitive
|
|
7
|
+
status: stable
|
|
8
|
+
since: 0.1.0
|
|
9
|
+
primitive: useRender
|
|
10
|
+
import: import { Badge, BADGE_VARIANTS, badgeVariants } from "@major-tech/ui/badge";
|
|
11
|
+
source: packages/ui/src/components/badge.tsx
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Badge
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### Labels
|
|
19
|
+
|
|
20
|
+
A 20px pill, 12px medium, sentence case.
|
|
21
|
+
|
|
22
|
+
Example: `labels`
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { Badge } from "@major-tech/ui/badge";
|
|
26
|
+
|
|
27
|
+
export default function BadgeLabels() {
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<Badge variant="live">Live</Badge>
|
|
31
|
+
<Badge>Draft</Badge>
|
|
32
|
+
<Badge variant="outline">Managed</Badge>
|
|
33
|
+
<Badge variant="live">New</Badge>
|
|
34
|
+
<Badge variant="live">Connected</Badge>
|
|
35
|
+
<Badge variant="outline">Per-user</Badge>
|
|
36
|
+
<Badge variant="danger">Failed</Badge>
|
|
37
|
+
<Badge variant="warn">High</Badge>
|
|
38
|
+
</>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- **default** — Draft, Reply drafted.
|
|
44
|
+
- **live** — Live, New, Connected, Most popular: link text on success-soft.
|
|
45
|
+
- **outline** — Managed, Per-user.
|
|
46
|
+
- **danger** — Failed, Critical: something went wrong or needs fixing first; danger on danger-soft.
|
|
47
|
+
- **warn** — High, Expiring: worth a look, not broken; warn on warn-soft.
|
|
48
|
+
|
|
49
|
+
### Version state
|
|
50
|
+
|
|
51
|
+
Live (`live`) or Draft (`default`) next to a version, with its meta line after.
|
|
52
|
+
|
|
53
|
+
Example: `version`
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { Badge } from "@major-tech/ui/badge";
|
|
57
|
+
|
|
58
|
+
export default function BadgeVersion() {
|
|
59
|
+
return (
|
|
60
|
+
<div className="flex flex-col gap-space-8 text-ui">
|
|
61
|
+
<div className="flex items-center gap-space-8">
|
|
62
|
+
<span className="font-medium text-ink">v5</span>
|
|
63
|
+
<Badge variant="live">Live</Badge>
|
|
64
|
+
<span className="text-small text-muted">Published 2 days ago</span>
|
|
65
|
+
</div>
|
|
66
|
+
<div className="flex items-center gap-space-8">
|
|
67
|
+
<span className="font-medium text-ink">v6</span>
|
|
68
|
+
<Badge>Draft</Badge>
|
|
69
|
+
<span className="text-small text-muted">Edited 4 min ago</span>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Counts
|
|
77
|
+
|
|
78
|
+
`count` is an unread or active-filter count: a 16px pill at least 24px wide, 11px semibold, with a 2px ring in the panel colour. `count-destructive` is Pepper's unread count, asking for attention. Place a count top-right with `absolute -right-1.5 -top-1.5`.
|
|
79
|
+
|
|
80
|
+
Example: `count`
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { Avatar, AvatarFallback } from "@major-tech/ui/avatar";
|
|
84
|
+
import { Badge } from "@major-tech/ui/badge";
|
|
85
|
+
import { Button } from "@major-tech/ui/button";
|
|
86
|
+
import { ListFilter } from "lucide-react";
|
|
87
|
+
|
|
88
|
+
const ACTIVE_FILTER_COUNT = 2;
|
|
89
|
+
const UNREAD_COUNT = 3;
|
|
90
|
+
|
|
91
|
+
export default function BadgeCount() {
|
|
92
|
+
return (
|
|
93
|
+
<>
|
|
94
|
+
<Badge variant="count">{ACTIVE_FILTER_COUNT}</Badge>
|
|
95
|
+
<Badge variant="count-destructive">{UNREAD_COUNT}</Badge>
|
|
96
|
+
<Button variant="toolbar" size="icon-lg" aria-label={`Filter, ${ACTIVE_FILTER_COUNT} active`} aria-pressed>
|
|
97
|
+
<ListFilter />
|
|
98
|
+
<Badge variant="count" className="absolute -top-1.5 -right-1.5">
|
|
99
|
+
{ACTIVE_FILTER_COUNT}
|
|
100
|
+
</Badge>
|
|
101
|
+
</Button>
|
|
102
|
+
<span className="relative">
|
|
103
|
+
<Avatar size="lg">
|
|
104
|
+
<AvatarFallback>P</AvatarFallback>
|
|
105
|
+
</Avatar>
|
|
106
|
+
<Badge variant="count-destructive" className="absolute -top-1.5 -right-1.5">
|
|
107
|
+
{UNREAD_COUNT}
|
|
108
|
+
</Badge>
|
|
109
|
+
</span>
|
|
110
|
+
</>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Guidelines
|
|
116
|
+
|
|
117
|
+
Do:
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
<Badge variant="live">New</Badge>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
- One or two words in sentence case, next to what they describe.
|
|
124
|
+
- Hide a count at zero, and cap long ones yourself (“99+”).
|
|
125
|
+
- A status with a coloured dot is a StatusDot, not a Badge.
|
|
126
|
+
|
|
127
|
+
Don't:
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
<Badge variant="live">NEW!</Badge>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
- Uppercase or exclamation marks.
|
|
134
|
+
- Badges as buttons: they are not interactive.
|
|
135
|
+
- `count-destructive` for ordinary totals.
|
|
136
|
+
|
|
137
|
+
## API
|
|
138
|
+
|
|
139
|
+
```tsx
|
|
140
|
+
import { Badge, BADGE_VARIANTS, badgeVariants } from "@major-tech/ui/badge";
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### `<Badge />`
|
|
144
|
+
|
|
145
|
+
Also accepts native `<span>` attributes. `BADGE_VARIANTS` holds the variants as constants.
|
|
146
|
+
|
|
147
|
+
| Prop | Type | Default | Description |
|
|
148
|
+
| --- | --- | --- | --- |
|
|
149
|
+
| `variant` | `"default" \| "live" \| "outline" \| "danger" \| "warn" \| "count" \| "count-destructive"` | `"default"` | Label styles, or the two counts. |
|
|
150
|
+
| `render` | `ReactElement \| function` | — | Render another element (a link) with badge styles instead of a `<span>`. |
|
|
151
|
+
|
|
152
|
+
### `badgeVariants()`
|
|
153
|
+
|
|
154
|
+
| Prop | Type | Default | Description |
|
|
155
|
+
| --- | --- | --- | --- |
|
|
156
|
+
| `({ variant })` | `string` | — | The cva class builder, for styling another element as a badge. |
|
|
157
|
+
|
|
158
|
+
### Accessibility
|
|
159
|
+
|
|
160
|
+
- Badges are plain text; screen readers read them inline with their neighbour.
|
|
161
|
+
- A count on an icon button goes in the button's label too: “Filter, 2 active”.
|
|
162
|
+
- Contrast meets 4.5:1 in both themes.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: BrandTile
|
|
3
|
+
slug: brand-tile
|
|
4
|
+
description: "The mark of a connector, service or org: a letter tile in the brand colour, or an icon tile."
|
|
5
|
+
group: Labels
|
|
6
|
+
layer: composed
|
|
7
|
+
status: stable
|
|
8
|
+
since: 0.1.0
|
|
9
|
+
import: import { BrandTile, BRAND_TILE_SIZES } from "@major-tech/ui/brand-tile";
|
|
10
|
+
source: packages/ui/src/components/brand-tile.tsx
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# BrandTile
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### Letter tiles
|
|
18
|
+
|
|
19
|
+
A white semibold letter on the brand colour (bold at xs), next to the service's name. Keep one letter and one colour per service everywhere it appears.
|
|
20
|
+
|
|
21
|
+
Example: `letters`
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { BRAND_TILE_SIZES, BrandTile } from "@major-tech/ui/brand-tile";
|
|
25
|
+
|
|
26
|
+
// Letter and brand colour per service. Never real logos.
|
|
27
|
+
const BRANDS = [
|
|
28
|
+
{ name: "Gmail", letter: "M", color: "#B3261E" },
|
|
29
|
+
{ name: "Google Calendar", letter: "C", color: "#1967D2" },
|
|
30
|
+
{ name: "Google Drive", letter: "D", color: "#188038" },
|
|
31
|
+
{ name: "Slack", letter: "S", color: "#4A154B" },
|
|
32
|
+
{ name: "HubSpot", letter: "H", color: "#E8613C" },
|
|
33
|
+
{ name: "Linear", letter: "L", color: "#5E6AD2" },
|
|
34
|
+
{ name: "PostgreSQL", letter: "P", color: "#336791" },
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
export default function BrandTileLetters() {
|
|
38
|
+
return (
|
|
39
|
+
<ul className="flex flex-col gap-space-8">
|
|
40
|
+
{BRANDS.map((brand) => (
|
|
41
|
+
<li key={brand.name} className="flex items-center gap-space-10 text-ui text-ink">
|
|
42
|
+
<BrandTile letter={brand.letter} color={brand.color} size={BRAND_TILE_SIZES.SM} />
|
|
43
|
+
{brand.name}
|
|
44
|
+
</li>
|
|
45
|
+
))}
|
|
46
|
+
</ul>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Sizes
|
|
52
|
+
|
|
53
|
+
xs 14px inline in text, chips and menus; sm 28px in table rows (the default); md 36px on catalog cards; lg 44px in detail headers; xl 52px in page headers and the connect dialog. The radius grows with the size, from 3 to 13px.
|
|
54
|
+
|
|
55
|
+
Example: `sizes`
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { BRAND_TILE_SIZES, BrandTile } from "@major-tech/ui/brand-tile";
|
|
59
|
+
|
|
60
|
+
export default function BrandTileSizes() {
|
|
61
|
+
return (
|
|
62
|
+
<div className="flex items-end gap-space-16">
|
|
63
|
+
{Object.values(BRAND_TILE_SIZES).map((size) => (
|
|
64
|
+
<div key={size} className="flex flex-col items-center gap-space-8">
|
|
65
|
+
<BrandTile size={size} letter="S" color="#4A154B" />
|
|
66
|
+
<span className="text-small text-muted">{size}</span>
|
|
67
|
+
</div>
|
|
68
|
+
))}
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Icon tiles
|
|
75
|
+
|
|
76
|
+
For connectors you build yourself: Custom API (code), MCP server (plug), Webhook (zap). A surface tile with a line border and the icon in ink-2.
|
|
77
|
+
|
|
78
|
+
Example: `icons`
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import { BRAND_TILE_SIZES, BrandTile } from "@major-tech/ui/brand-tile";
|
|
82
|
+
import { Code, Plug, Zap } from "lucide-react";
|
|
83
|
+
|
|
84
|
+
const OWN_CONNECTORS = [
|
|
85
|
+
{ name: "Custom API", icon: <Code /> },
|
|
86
|
+
{ name: "MCP server", icon: <Plug /> },
|
|
87
|
+
{ name: "Webhook", icon: <Zap /> },
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
export default function BrandTileIcons() {
|
|
91
|
+
return (
|
|
92
|
+
<>
|
|
93
|
+
{OWN_CONNECTORS.map((connector) => (
|
|
94
|
+
<span key={connector.name} className="inline-flex items-center gap-space-10 text-ui text-ink">
|
|
95
|
+
<BrandTile icon={connector.icon} size={BRAND_TILE_SIZES.MD} />
|
|
96
|
+
{connector.name}
|
|
97
|
+
</span>
|
|
98
|
+
))}
|
|
99
|
+
</>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Guidelines
|
|
105
|
+
|
|
106
|
+
Do:
|
|
107
|
+
|
|
108
|
+
- Use the tile everywhere a connector or service appears.
|
|
109
|
+
- Pick the size by where it lives.
|
|
110
|
+
- Brand colours: Gmail #B3261E, Google Calendar #1967D2, Google Drive #188038, Slack #4A154B, HubSpot #E8613C, Linear #5E6AD2, PostgreSQL #336791.
|
|
111
|
+
|
|
112
|
+
Don't:
|
|
113
|
+
|
|
114
|
+
- Recolour a known brand.
|
|
115
|
+
- A size between the five listed.
|
|
116
|
+
- The tile alone to name a service: the name sits next to it.
|
|
117
|
+
|
|
118
|
+
## API
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
import { BrandTile, BRAND_TILE_SIZES } from "@major-tech/ui/brand-tile";
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### `<BrandTile />`
|
|
125
|
+
|
|
126
|
+
| Prop | Type | Default | Description |
|
|
127
|
+
| --- | --- | --- | --- |
|
|
128
|
+
| `letter` | `string` | — | “M” for Gmail. Omit when passing `icon`. |
|
|
129
|
+
| `color` | `string` | `"#555555"` | The brand colour behind the letter. |
|
|
130
|
+
| `icon` | `ReactNode` | — | An icon tile for things you build yourself. |
|
|
131
|
+
| `src` | `string` | — | A logo image; wins over the letter and the icon. |
|
|
132
|
+
| `size` | `"xs" \| "sm" \| "md" \| "lg" \| "xl"` | `"sm"` | 14, 28, 36, 44 or 52px. Use `BRAND_TILE_SIZES`. |
|
|
133
|
+
| `className` | `string` | — | On the tile. |
|
|
134
|
+
|
|
135
|
+
### Accessibility
|
|
136
|
+
|
|
137
|
+
- The letter is plain text and a logo has an empty alt: the service's name next to the tile does the naming.
|
|
138
|
+
- White letters on the brand colours meet 3:1 as icons; never rely on the tile alone.
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Button
|
|
3
|
+
slug: button
|
|
4
|
+
description: Buttons for actions, with or without a label; the green fill is reserved for the one action a view exists for.
|
|
5
|
+
group: Actions
|
|
6
|
+
layer: primitive
|
|
7
|
+
status: stable
|
|
8
|
+
since: 0.1.0
|
|
9
|
+
primitive: Button
|
|
10
|
+
import: import { Button, BUTTON_VARIANTS, BUTTON_SIZES, buttonVariants } from "@major-tech/ui/button";
|
|
11
|
+
source: packages/ui/src/components/button.tsx
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Button
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### Styles
|
|
19
|
+
|
|
20
|
+
Every style works at every size. Green primary is the one action a view exists for.
|
|
21
|
+
|
|
22
|
+
Example: `variants`
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { Button } from "@major-tech/ui/button";
|
|
26
|
+
|
|
27
|
+
export default function ButtonVariants() {
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<Button>Create agent</Button>
|
|
31
|
+
<Button variant="outline">Share</Button>
|
|
32
|
+
<Button variant="secondary">Duplicate</Button>
|
|
33
|
+
<Button variant="ghost">Cancel</Button>
|
|
34
|
+
<Button variant="destructive-soft">Delete skill</Button>
|
|
35
|
+
<Button variant="link">Clear all</Button>
|
|
36
|
+
</>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- **Primary** (`default`) — the one green action per view (Create agent, Publish, Connect). Rows, cards and dialogs never add a second one.
|
|
42
|
+
- **Default** (`outline`) — surface with a line border: Share, Test run, Copy.
|
|
43
|
+
- **Secondary** — a filled neutral button where an outline would be too loud.
|
|
44
|
+
- **Ghost** — muted text: Cancel, quiet dismissals and icon-only buttons.
|
|
45
|
+
- **Danger** (`destructive-soft`) — soft red fill for destructive actions in rows and dialogs. The solid `destructive` fill is reserved for the final confirm of an AlertDialog.
|
|
46
|
+
- **Link** — a text action inline with content: Clear all, Reset all.
|
|
47
|
+
- **Glass** (`glass`) — the send tile of a composer that starts something (Build), at `icon-lg`. Nowhere else.
|
|
48
|
+
|
|
49
|
+
### Sizes
|
|
50
|
+
|
|
51
|
+
Chosen by where the button lives, not by how important it is.
|
|
52
|
+
|
|
53
|
+
Example: `sizes`
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { Button } from "@major-tech/ui/button";
|
|
57
|
+
|
|
58
|
+
export default function ButtonSizes() {
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
<Button variant="outline" size="sm">
|
|
62
|
+
Test run
|
|
63
|
+
</Button>
|
|
64
|
+
<Button>Save changes</Button>
|
|
65
|
+
<Button variant="outline" size="lg">
|
|
66
|
+
Continue
|
|
67
|
+
</Button>
|
|
68
|
+
</>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- **Small, 28px** (`sm`) — a button in a bar or a dense row: editor header, panel headers, the composer, table rows, cards.
|
|
74
|
+
- **Medium, 34px** (`default`) — a button on the page: page headers, toolbars, dialogs, popovers, settings rows, empty states. The page CTA is a Medium primary.
|
|
75
|
+
- **Large, 42px pill** (`lg`) — a button in a conversation: onboarding answers and Continue.
|
|
76
|
+
- Pair with neighbours: Medium beside 34px fields and Selects, Small beside 28px row controls.
|
|
77
|
+
|
|
78
|
+
### With icons
|
|
79
|
+
|
|
80
|
+
The icon goes in children, before the label: 14px (16px at Large). A trailing chevron marks a button that opens a menu; an arrow may follow Continue.
|
|
81
|
+
|
|
82
|
+
Example: `icons`
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
import { Button } from "@major-tech/ui/button";
|
|
86
|
+
import { ArrowRight, ChevronDown, Plus, Share2 } from "lucide-react";
|
|
87
|
+
|
|
88
|
+
export default function ButtonIcons() {
|
|
89
|
+
return (
|
|
90
|
+
<>
|
|
91
|
+
<Button>
|
|
92
|
+
<Plus />
|
|
93
|
+
Add connector
|
|
94
|
+
</Button>
|
|
95
|
+
<Button variant="outline">
|
|
96
|
+
<Share2 />
|
|
97
|
+
Share
|
|
98
|
+
</Button>
|
|
99
|
+
<Button variant="outline">
|
|
100
|
+
Sort
|
|
101
|
+
<ChevronDown />
|
|
102
|
+
</Button>
|
|
103
|
+
<Button variant="outline" size="lg">
|
|
104
|
+
Continue
|
|
105
|
+
<ArrowRight />
|
|
106
|
+
</Button>
|
|
107
|
+
</>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Icon buttons
|
|
113
|
+
|
|
114
|
+
Icon-only buttons use the square sizes: `icon-sm` 24px for sidebar tools, `icon` 28px for rows and panels. Each one has an `aria-label` and a Tooltip with the same words.
|
|
115
|
+
|
|
116
|
+
Example: `icon-buttons`
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import { Button } from "@major-tech/ui/button";
|
|
120
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@major-tech/ui/tooltip";
|
|
121
|
+
import { EllipsisVertical, PanelLeft, Pencil } from "lucide-react";
|
|
122
|
+
|
|
123
|
+
export default function ButtonIconButtons() {
|
|
124
|
+
return (
|
|
125
|
+
<>
|
|
126
|
+
<Tooltip>
|
|
127
|
+
<TooltipTrigger render={<Button variant="ghost" size="icon" aria-label="More options" />}>
|
|
128
|
+
<EllipsisVertical />
|
|
129
|
+
</TooltipTrigger>
|
|
130
|
+
<TooltipContent>More options</TooltipContent>
|
|
131
|
+
</Tooltip>
|
|
132
|
+
<Tooltip>
|
|
133
|
+
<TooltipTrigger render={<Button variant="ghost" size="icon" aria-label="Rename" />}>
|
|
134
|
+
<Pencil />
|
|
135
|
+
</TooltipTrigger>
|
|
136
|
+
<TooltipContent>Rename</TooltipContent>
|
|
137
|
+
</Tooltip>
|
|
138
|
+
<Tooltip>
|
|
139
|
+
<TooltipTrigger render={<Button variant="ghost" size="icon-sm" aria-label="Collapse sidebar" />}>
|
|
140
|
+
<PanelLeft />
|
|
141
|
+
</TooltipTrigger>
|
|
142
|
+
<TooltipContent>Collapse sidebar</TooltipContent>
|
|
143
|
+
</Tooltip>
|
|
144
|
+
</>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
- Vertical dots for every overflow menu.
|
|
150
|
+
- A ghost icon button keeps its hover fill while the menu it opens is open (`aria-expanded`).
|
|
151
|
+
- Don't put essential information only in the tooltip.
|
|
152
|
+
|
|
153
|
+
### Toolbar
|
|
154
|
+
|
|
155
|
+
Sort, filter and view switch in list headers: the `toolbar` style at `icon-lg`, 34px on the card surface. `aria-pressed` turns the icon green for an active filter; a count Badge sits on the corner.
|
|
156
|
+
|
|
157
|
+
Example: `toolbar`
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
"use client";
|
|
161
|
+
|
|
162
|
+
import { useState } from "react";
|
|
163
|
+
import { Badge } from "@major-tech/ui/badge";
|
|
164
|
+
import { Button } from "@major-tech/ui/button";
|
|
165
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@major-tech/ui/tooltip";
|
|
166
|
+
import { ArrowUpDown, LayoutGrid, List, ListFilter } from "lucide-react";
|
|
167
|
+
|
|
168
|
+
const VIEWS = {
|
|
169
|
+
CARDS: "cards",
|
|
170
|
+
LIST: "list",
|
|
171
|
+
} as const;
|
|
172
|
+
|
|
173
|
+
type View = (typeof VIEWS)[keyof typeof VIEWS];
|
|
174
|
+
|
|
175
|
+
const ACTIVE_FILTER_COUNT = 2;
|
|
176
|
+
|
|
177
|
+
export default function ButtonToolbar() {
|
|
178
|
+
const [view, setView] = useState<View>(VIEWS.CARDS);
|
|
179
|
+
const isCardView = view === VIEWS.CARDS;
|
|
180
|
+
const viewLabel = isCardView ? "Show as list" : "Show as cards";
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<>
|
|
184
|
+
<Tooltip>
|
|
185
|
+
<TooltipTrigger render={<Button variant="toolbar" size="icon-lg" aria-label="Sort" />}>
|
|
186
|
+
<ArrowUpDown />
|
|
187
|
+
</TooltipTrigger>
|
|
188
|
+
<TooltipContent>Sort</TooltipContent>
|
|
189
|
+
</Tooltip>
|
|
190
|
+
<Tooltip>
|
|
191
|
+
<TooltipTrigger
|
|
192
|
+
render={
|
|
193
|
+
<Button
|
|
194
|
+
variant="toolbar"
|
|
195
|
+
size="icon-lg"
|
|
196
|
+
aria-label={`Filter, ${ACTIVE_FILTER_COUNT} active`}
|
|
197
|
+
aria-pressed
|
|
198
|
+
/>
|
|
199
|
+
}
|
|
200
|
+
>
|
|
201
|
+
<ListFilter />
|
|
202
|
+
<Badge variant="count" className="absolute -top-1.5 -right-1.5">
|
|
203
|
+
{ACTIVE_FILTER_COUNT}
|
|
204
|
+
</Badge>
|
|
205
|
+
</TooltipTrigger>
|
|
206
|
+
<TooltipContent>Filter</TooltipContent>
|
|
207
|
+
</Tooltip>
|
|
208
|
+
{/* The icon shows the view you switch to, not the current one. */}
|
|
209
|
+
<Tooltip>
|
|
210
|
+
<TooltipTrigger
|
|
211
|
+
render={
|
|
212
|
+
<Button
|
|
213
|
+
variant="toolbar"
|
|
214
|
+
size="icon-lg"
|
|
215
|
+
aria-label={viewLabel}
|
|
216
|
+
onClick={() => setView(isCardView ? VIEWS.LIST : VIEWS.CARDS)}
|
|
217
|
+
/>
|
|
218
|
+
}
|
|
219
|
+
>
|
|
220
|
+
{isCardView ? <List /> : <LayoutGrid />}
|
|
221
|
+
</TooltipTrigger>
|
|
222
|
+
<TooltipContent>{viewLabel}</TooltipContent>
|
|
223
|
+
</Tooltip>
|
|
224
|
+
</>
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Working and finished
|
|
230
|
+
|
|
231
|
+
`loading` turns the first icon into the spinner (or adds one) and disables the button. Pair it with a present-tense label. Nothing else on the page locks. A finished state replaces the label and stays focusable with `aria-disabled`.
|
|
232
|
+
|
|
233
|
+
Example: `states` (Publish → Publishing… → Published)
|
|
234
|
+
|
|
235
|
+
```tsx
|
|
236
|
+
"use client";
|
|
237
|
+
|
|
238
|
+
import { useState } from "react";
|
|
239
|
+
import { Button } from "@major-tech/ui/button";
|
|
240
|
+
import { Check, Upload } from "lucide-react";
|
|
241
|
+
|
|
242
|
+
const PUBLISH_STATES = {
|
|
243
|
+
IDLE: "idle",
|
|
244
|
+
WORKING: "working",
|
|
245
|
+
DONE: "done",
|
|
246
|
+
} as const;
|
|
247
|
+
|
|
248
|
+
type PublishState = (typeof PUBLISH_STATES)[keyof typeof PUBLISH_STATES];
|
|
249
|
+
|
|
250
|
+
/** Stands in for the request. */
|
|
251
|
+
const PUBLISH_DURATION_MS = 1600;
|
|
252
|
+
|
|
253
|
+
export default function ButtonStates() {
|
|
254
|
+
const [publishState, setPublishState] = useState<PublishState>(PUBLISH_STATES.IDLE);
|
|
255
|
+
const isPublishing = publishState === PUBLISH_STATES.WORKING;
|
|
256
|
+
const isPublished = publishState === PUBLISH_STATES.DONE;
|
|
257
|
+
|
|
258
|
+
const handlePublish = () => {
|
|
259
|
+
setPublishState(PUBLISH_STATES.WORKING);
|
|
260
|
+
setTimeout(() => setPublishState(PUBLISH_STATES.DONE), PUBLISH_DURATION_MS);
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
return (
|
|
264
|
+
<>
|
|
265
|
+
{isPublished ? (
|
|
266
|
+
<Button variant="outline" aria-disabled>
|
|
267
|
+
<Check />
|
|
268
|
+
Published
|
|
269
|
+
</Button>
|
|
270
|
+
) : (
|
|
271
|
+
<Button loading={isPublishing} onClick={handlePublish}>
|
|
272
|
+
<Upload />
|
|
273
|
+
{isPublishing ? "Publishing…" : "Publish"}
|
|
274
|
+
</Button>
|
|
275
|
+
)}
|
|
276
|
+
{isPublished && (
|
|
277
|
+
<Button variant="ghost" onClick={() => setPublishState(PUBLISH_STATES.IDLE)}>
|
|
278
|
+
Reset
|
|
279
|
+
</Button>
|
|
280
|
+
)}
|
|
281
|
+
<Button variant="outline" disabled>
|
|
282
|
+
Disabled
|
|
283
|
+
</Button>
|
|
284
|
+
</>
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Full width
|
|
290
|
+
|
|
291
|
+
A layout choice, not a size: `className="w-full"` when it is the only action in a narrow container (the connect dialog, plan cards). It keeps its height.
|
|
292
|
+
|
|
293
|
+
Example: `full-width`
|
|
294
|
+
|
|
295
|
+
```tsx
|
|
296
|
+
import { Button } from "@major-tech/ui/button";
|
|
297
|
+
import { Card, CardDescription, CardTitle } from "@major-tech/ui/card";
|
|
298
|
+
|
|
299
|
+
export default function ButtonFullWidth() {
|
|
300
|
+
return (
|
|
301
|
+
<Card className="w-80 p-space-16">
|
|
302
|
+
<CardTitle>Connect HubSpot</CardTitle>
|
|
303
|
+
<CardDescription>Sign in once; every agent in this workspace can use it.</CardDescription>
|
|
304
|
+
<Button className="w-full">Connect</Button>
|
|
305
|
+
</Card>
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### As a link
|
|
311
|
+
|
|
312
|
+
Navigation that should look like a button is the link itself, styled with `buttonVariants({ variant, size })`: it stays a link to assistive tech, which a Button rendering a link would not.
|
|
313
|
+
|
|
314
|
+
Example: `as-link`
|
|
315
|
+
|
|
316
|
+
```tsx
|
|
317
|
+
"use client";
|
|
318
|
+
|
|
319
|
+
import Link from "next/link";
|
|
320
|
+
import { buttonVariants } from "@major-tech/ui/button";
|
|
321
|
+
|
|
322
|
+
export default function ButtonAsLink() {
|
|
323
|
+
return (
|
|
324
|
+
<>
|
|
325
|
+
<Link href="/components" className={buttonVariants({ variant: "outline" })}>
|
|
326
|
+
Browse components
|
|
327
|
+
</Link>
|
|
328
|
+
<Link href="/components/badge" className={buttonVariants({ variant: "link" })}>
|
|
329
|
+
Badge
|
|
330
|
+
</Link>
|
|
331
|
+
</>
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Guidelines
|
|
337
|
+
|
|
338
|
+
Do:
|
|
339
|
+
|
|
340
|
+
```tsx
|
|
341
|
+
<Button>Save changes</Button>
|
|
342
|
+
<Button variant="ghost">Cancel</Button>
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
- Start with a verb, in sentence case: “Save changes”, “Delete skill”.
|
|
346
|
+
- Say exactly what happens; confirm afterwards in the past tense with a toast.
|
|
347
|
+
- Swap Share + Publish for Cancel + Save changes while there are unsaved changes.
|
|
348
|
+
|
|
349
|
+
Don't:
|
|
350
|
+
|
|
351
|
+
```tsx
|
|
352
|
+
<Button>Save</Button>
|
|
353
|
+
<Button>Publish</Button>
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
- Two green buttons in one view.
|
|
357
|
+
- Title Case, exclamation marks or vague labels (“OK”, “Submit”).
|
|
358
|
+
- A special size for one place: use Small, Medium or Large.
|
|
359
|
+
|
|
360
|
+
## API
|
|
361
|
+
|
|
362
|
+
```tsx
|
|
363
|
+
import { Button, BUTTON_VARIANTS, BUTTON_SIZES, buttonVariants } from "@major-tech/ui/button";
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### `<Button />`
|
|
367
|
+
|
|
368
|
+
Also accepts every native `<button>` attribute, including `ref`. `BUTTON_VARIANTS` and `BUTTON_SIZES` hold the values below as constants.
|
|
369
|
+
|
|
370
|
+
| Prop | Type | Default | Description |
|
|
371
|
+
| --- | --- | --- | --- |
|
|
372
|
+
| `variant` | `"default" \| "outline" \| "secondary" \| "ghost" \| "destructive-soft" \| "destructive" \| "toolbar" \| "link" \| "glass"` | `"default"` | Visual style. `default` is the green primary: once per view. |
|
|
373
|
+
| `size` | `"sm" \| "default" \| "lg" \| "icon-sm" \| "icon" \| "icon-lg"` | `"default"` | 28px, 34px or 42px pill; icon squares of 24, 28 and 34px. |
|
|
374
|
+
| `loading` | `boolean` | `false` | Turns the first icon into the spinner, sets `aria-busy` and disables the button. Pair with a present-tense label. |
|
|
375
|
+
| `render` | `ReactElement \| function` | — | Render another element with button styles and behaviour instead of a `<button>`. A link uses `buttonVariants` instead. |
|
|
376
|
+
| `nativeButton` | `boolean` | `true` | Set false when `render` is not a `<button>`: the element gets `role="button"` and Enter and Space. Not for links. |
|
|
377
|
+
| `focusableWhenDisabled` | `boolean` | `false` | Keep a disabled button reachable by keyboard. |
|
|
378
|
+
|
|
379
|
+
### `buttonVariants()`
|
|
380
|
+
|
|
381
|
+
| Prop | Type | Default | Description |
|
|
382
|
+
| --- | --- | --- | --- |
|
|
383
|
+
| `({ variant, size })` | `string` | — | The cva class builder: a Link that looks like a button takes it as its `className` and stays a link. |
|
|
384
|
+
|
|
385
|
+
### Accessibility
|
|
386
|
+
|
|
387
|
+
- Renders a native `<button>` with `type="button"`: a button that submits its form passes `type="submit"`.
|
|
388
|
+
- A link styled with `buttonVariants` is announced as a link and listed with the page's links.
|
|
389
|
+
- Icon-only buttons need an `aria-label`; a Tooltip shows the same words.
|
|
390
|
+
- `loading` sets `aria-busy` and disables the control; keep the label meaningful (“Publishing…”).
|
|
391
|
+
- A finished state that should stay focusable uses `aria-disabled` instead of `disabled`.
|
|
392
|
+
- Focus shows a 2px accent-tinted ring.
|