@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,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Checkbox
|
|
3
|
+
slug: checkbox
|
|
4
|
+
description: A square check for turning several independent options on or off.
|
|
5
|
+
group: Inputs
|
|
6
|
+
layer: primitive
|
|
7
|
+
status: stable
|
|
8
|
+
since: 0.1.0
|
|
9
|
+
primitive: Checkbox
|
|
10
|
+
import: import { Checkbox } from "@major-tech/ui/checkbox";
|
|
11
|
+
source: packages/ui/src/components/checkbox.tsx
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Checkbox
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### Independent options
|
|
19
|
+
|
|
20
|
+
A 16px box with a 1.5px faint border; checked fills with link (checks use link, never accent). Checkbox is only the box: a horizontal Field puts the 13px label 8px to its right, and FieldContent adds a muted second line. Disabled, the box and its label dim to 50%.
|
|
21
|
+
|
|
22
|
+
Example: `basic`
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { Checkbox } from "@major-tech/ui/checkbox";
|
|
26
|
+
import { Field, FieldContent, FieldDescription, FieldLabel } from "@major-tech/ui/field";
|
|
27
|
+
|
|
28
|
+
export default function CheckboxBasic() {
|
|
29
|
+
return (
|
|
30
|
+
<div className="flex flex-col gap-space-12">
|
|
31
|
+
<Field orientation="horizontal">
|
|
32
|
+
<Checkbox id="daily-summary" defaultChecked />
|
|
33
|
+
<FieldLabel htmlFor="daily-summary">Send a daily summary</FieldLabel>
|
|
34
|
+
</Field>
|
|
35
|
+
<Field orientation="horizontal">
|
|
36
|
+
<Checkbox id="run-failed" aria-describedby="run-failed-hint" />
|
|
37
|
+
<FieldContent>
|
|
38
|
+
<FieldLabel htmlFor="run-failed">Notify me when a run fails</FieldLabel>
|
|
39
|
+
<FieldDescription id="run-failed-hint">By email and in Slack</FieldDescription>
|
|
40
|
+
</FieldContent>
|
|
41
|
+
</Field>
|
|
42
|
+
<Field orientation="horizontal">
|
|
43
|
+
<Checkbox id="archive-runs" disabled />
|
|
44
|
+
<FieldLabel htmlFor="archive-runs">Archive old runs</FieldLabel>
|
|
45
|
+
</Field>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Indeterminate
|
|
52
|
+
|
|
53
|
+
`indeterminate` for a parent row whose children are partly checked (“Select all”). It shows a dash, not a tick: some is not all.
|
|
54
|
+
|
|
55
|
+
Example: `select-all`
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
"use client";
|
|
59
|
+
|
|
60
|
+
import { useState } from "react";
|
|
61
|
+
import { Checkbox } from "@major-tech/ui/checkbox";
|
|
62
|
+
import { Field, FieldLabel } from "@major-tech/ui/field";
|
|
63
|
+
|
|
64
|
+
const SCOPES = [
|
|
65
|
+
{ id: "read-messages", label: "Read messages" },
|
|
66
|
+
{ id: "send-messages", label: "Send messages" },
|
|
67
|
+
{ id: "manage-channels", label: "Manage channels" },
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
export default function CheckboxSelectAll() {
|
|
71
|
+
const [checkedIds, setCheckedIds] = useState<string[]>(["read-messages"]);
|
|
72
|
+
// Checked when every scope is, a dash when some are.
|
|
73
|
+
const isAllChecked = checkedIds.length === SCOPES.length;
|
|
74
|
+
const isSomeChecked = checkedIds.length > 0 && !isAllChecked;
|
|
75
|
+
|
|
76
|
+
const handleSelectAllChange = () => setCheckedIds(isAllChecked ? [] : SCOPES.map((scope) => scope.id));
|
|
77
|
+
|
|
78
|
+
const handleScopeChange = (id: string, isChecked: boolean) =>
|
|
79
|
+
setCheckedIds(isChecked ? [...checkedIds, id] : checkedIds.filter((checkedId) => checkedId !== id));
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<div className="flex flex-col gap-space-12">
|
|
83
|
+
<Field orientation="horizontal">
|
|
84
|
+
<Checkbox
|
|
85
|
+
id="all-scopes"
|
|
86
|
+
checked={isAllChecked}
|
|
87
|
+
indeterminate={isSomeChecked}
|
|
88
|
+
onCheckedChange={handleSelectAllChange}
|
|
89
|
+
/>
|
|
90
|
+
<FieldLabel htmlFor="all-scopes">Select all</FieldLabel>
|
|
91
|
+
</Field>
|
|
92
|
+
<div className="flex flex-col gap-space-12 pl-space-24">
|
|
93
|
+
{SCOPES.map((scope) => (
|
|
94
|
+
<Field key={scope.id} orientation="horizontal">
|
|
95
|
+
<Checkbox
|
|
96
|
+
id={scope.id}
|
|
97
|
+
checked={checkedIds.includes(scope.id)}
|
|
98
|
+
onCheckedChange={(checked) => handleScopeChange(scope.id, checked)}
|
|
99
|
+
/>
|
|
100
|
+
<FieldLabel htmlFor={scope.id}>{scope.label}</FieldLabel>
|
|
101
|
+
</Field>
|
|
102
|
+
))}
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Guidelines
|
|
110
|
+
|
|
111
|
+
Do:
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
<Field orientation="horizontal">
|
|
115
|
+
<Checkbox id="do-read-messages" defaultChecked />
|
|
116
|
+
<FieldLabel htmlFor="do-read-messages">Read messages</FieldLabel>
|
|
117
|
+
</Field>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
- Use it for choices confirmed together, or for selecting rows.
|
|
121
|
+
- Phrase labels as the thing that becomes true: “Send a daily summary”.
|
|
122
|
+
|
|
123
|
+
Don't:
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
<Field orientation="horizontal">
|
|
127
|
+
<Checkbox id="dont-reachable" defaultChecked />
|
|
128
|
+
<FieldLabel htmlFor="dont-reachable">Reachable in Slack</FieldLabel>
|
|
129
|
+
</Field>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
- A Checkbox for a setting that applies immediately: use a Switch.
|
|
133
|
+
- Negative labels (“Don't notify me”).
|
|
134
|
+
|
|
135
|
+
For an instant setting, prefer:
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
<Field orientation="horizontal">
|
|
139
|
+
<Switch id="prefer-switch" defaultChecked />
|
|
140
|
+
<FieldLabel htmlFor="prefer-switch">Reachable in Slack</FieldLabel>
|
|
141
|
+
</Field>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## API
|
|
145
|
+
|
|
146
|
+
```tsx
|
|
147
|
+
import { Checkbox } from "@major-tech/ui/checkbox";
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### `<Checkbox />`
|
|
151
|
+
|
|
152
|
+
Base UI Checkbox.Root: also `name`, `value`, `required`, `disabled`. Give it the `id` a FieldLabel points at.
|
|
153
|
+
|
|
154
|
+
| Prop | Type | Default | Description |
|
|
155
|
+
| --- | --- | --- | --- |
|
|
156
|
+
| `checked / defaultChecked` | `boolean` | — | The state. |
|
|
157
|
+
| `indeterminate` | `boolean` | `false` | Shows the dash: some, not all. |
|
|
158
|
+
| `onCheckedChange` | `(checked: boolean, eventDetails) => void` | — | Called on toggle. |
|
|
159
|
+
|
|
160
|
+
### Accessibility
|
|
161
|
+
|
|
162
|
+
- `role="checkbox"`, with `aria-checked="mixed"` when indeterminate.
|
|
163
|
+
- Space toggles; focus shows a 2px secondary ring with a faint outline.
|
|
164
|
+
- Label it with FieldLabel `htmlFor`; without a visible label, pass `aria-label`.
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Chip
|
|
3
|
+
slug: chip
|
|
4
|
+
description: "Everything a person or an agent works with as one chip: connectors, apps, agents, workflows, skills, variables, files and picked elements, in the Details panel, the Composer, messages and instructions, or inline in text."
|
|
5
|
+
group: Labels
|
|
6
|
+
layer: composed
|
|
7
|
+
status: stable
|
|
8
|
+
since: 0.1.0
|
|
9
|
+
import: import { Chip, ChipAdd, DetailsGroup, CHIP_KINDS, CHIP_STATES } from "@major-tech/ui/chip";
|
|
10
|
+
source: packages/ui/src/components/chip.tsx
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Chip
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
One chip for everything a person or an agent works with: a connector, an app, an agent, a workflow, a skill, a variable, a file, a picked element. The same Chip in the Details panel, the Composer, a sent message and an agent's instructions; only `inline` changes, for a chip set in a line of text.
|
|
18
|
+
|
|
19
|
+
### In the Details panel
|
|
20
|
+
|
|
21
|
+
The Config page's Details panel lists what an agent uses as 22px chips, grouped under DetailsGroup labels (12px faint: Connectors, Applications, Workflows, Skills, Variables). One chip per connector: its actions collapse into it.
|
|
22
|
+
|
|
23
|
+
Example: `details`
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
"use client";
|
|
27
|
+
|
|
28
|
+
import { useState, type ReactElement } from "react";
|
|
29
|
+
import { BrandTile } from "@major-tech/ui/brand-tile";
|
|
30
|
+
import { Button } from "@major-tech/ui/button";
|
|
31
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@major-tech/ui/dropdown-menu";
|
|
32
|
+
import { DetailsGroup, Chip, ChipAdd, CHIP_STATES } from "@major-tech/ui/chip";
|
|
33
|
+
import { Popover, PopoverClose, PopoverContent, PopoverTrigger } from "@major-tech/ui/popover";
|
|
34
|
+
import { AppWindow, BookOpenText, SlidersHorizontal } from "lucide-react";
|
|
35
|
+
|
|
36
|
+
const ALL_SKILLS = ["workplace-humor-guide", "standup-spinner-order", "lead-scoring"];
|
|
37
|
+
|
|
38
|
+
interface ObjectDetailsProps {
|
|
39
|
+
/** The chip that opens the details. */
|
|
40
|
+
children: ReactElement;
|
|
41
|
+
title: string;
|
|
42
|
+
/** Connector, Application, Skill or Variable. */
|
|
43
|
+
kindLabel: string;
|
|
44
|
+
description: string;
|
|
45
|
+
/** Opens the object's permissions; the product's own page or dialog. */
|
|
46
|
+
onConfigure?: () => void;
|
|
47
|
+
onRemove?: () => void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** What a chip opens: the object, a line about it, and what can be done with it here. */
|
|
51
|
+
function ObjectDetails({ children, title, kindLabel, description, onConfigure, onRemove }: ObjectDetailsProps) {
|
|
52
|
+
const isActionRowVisible = Boolean(onConfigure || onRemove);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Popover>
|
|
56
|
+
<PopoverTrigger render={children} />
|
|
57
|
+
<PopoverContent align="start" className="flex w-70 flex-col gap-space-8 p-space-12">
|
|
58
|
+
<div className="flex flex-col">
|
|
59
|
+
<span className="text-ui-strong text-ink">{title}</span>
|
|
60
|
+
<span className="text-small text-muted">{kindLabel}</span>
|
|
61
|
+
</div>
|
|
62
|
+
<p className="text-ui text-muted">{description}</p>
|
|
63
|
+
{isActionRowVisible && (
|
|
64
|
+
<div className="flex flex-wrap gap-space-6">
|
|
65
|
+
{onConfigure && (
|
|
66
|
+
<PopoverClose render={<Button variant="outline" size="sm" onClick={onConfigure} />}>
|
|
67
|
+
<SlidersHorizontal />
|
|
68
|
+
Permissions
|
|
69
|
+
</PopoverClose>
|
|
70
|
+
)}
|
|
71
|
+
{onRemove && (
|
|
72
|
+
<PopoverClose render={<Button variant="ghost" size="sm" onClick={onRemove} />}>
|
|
73
|
+
Remove from agent
|
|
74
|
+
</PopoverClose>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
)}
|
|
78
|
+
</PopoverContent>
|
|
79
|
+
</Popover>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default function ChipDetails() {
|
|
84
|
+
const [skills, setSkills] = useState(["workplace-humor-guide", "standup-spinner-order"]);
|
|
85
|
+
const availableSkills = ALL_SKILLS.filter((skill) => !skills.includes(skill));
|
|
86
|
+
|
|
87
|
+
const removeSkill = (skill: string) => setSkills((current) => current.filter((attached) => attached !== skill));
|
|
88
|
+
const addSkill = (skill: string) => setSkills((current) => [...current, skill]);
|
|
89
|
+
|
|
90
|
+
// Permissions and connecting belong to the product.
|
|
91
|
+
const handleConfigure = () => {};
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<aside className="flex w-64 flex-col border-l border-line pl-space-24">
|
|
95
|
+
<div className="pb-space-10 text-label text-muted uppercase">Details</div>
|
|
96
|
+
<DetailsGroup label="Connectors">
|
|
97
|
+
<ObjectDetails
|
|
98
|
+
title="Google Calendar"
|
|
99
|
+
kindLabel="Connector"
|
|
100
|
+
description="Not connected yet: connect it so the agent can read who is out of office."
|
|
101
|
+
onConfigure={handleConfigure}
|
|
102
|
+
>
|
|
103
|
+
<Chip
|
|
104
|
+
kind="connector"
|
|
105
|
+
icon={<BrandTile letter="G" color="#1967D2" size="xs" />}
|
|
106
|
+
state={CHIP_STATES.WARN}
|
|
107
|
+
note="Connect"
|
|
108
|
+
>
|
|
109
|
+
Google Calendar
|
|
110
|
+
</Chip>
|
|
111
|
+
</ObjectDetails>
|
|
112
|
+
<ObjectDetails
|
|
113
|
+
title="Slack"
|
|
114
|
+
kindLabel="Connector"
|
|
115
|
+
description="Posts the joke to #general every morning."
|
|
116
|
+
onConfigure={handleConfigure}
|
|
117
|
+
>
|
|
118
|
+
<Chip kind="connector" icon={<BrandTile letter="S" color="#4A154B" size="xs" />}>
|
|
119
|
+
Slack
|
|
120
|
+
</Chip>
|
|
121
|
+
</ObjectDetails>
|
|
122
|
+
</DetailsGroup>
|
|
123
|
+
<DetailsGroup label="Applications">
|
|
124
|
+
<ObjectDetails title="Joke archive" kindLabel="Application" description="Where every joke sent is saved.">
|
|
125
|
+
<Chip kind="application" icon={<AppWindow />}>
|
|
126
|
+
Joke archive
|
|
127
|
+
</Chip>
|
|
128
|
+
</ObjectDetails>
|
|
129
|
+
</DetailsGroup>
|
|
130
|
+
<DetailsGroup label="Skills">
|
|
131
|
+
{skills.map((skill) => (
|
|
132
|
+
<ObjectDetails
|
|
133
|
+
key={skill}
|
|
134
|
+
title={skill}
|
|
135
|
+
kindLabel="Skill"
|
|
136
|
+
description="Instructions the agent follows when the task calls for them."
|
|
137
|
+
onRemove={() => removeSkill(skill)}
|
|
138
|
+
>
|
|
139
|
+
<Chip
|
|
140
|
+
kind="skill"
|
|
141
|
+
icon={<BookOpenText />}
|
|
142
|
+
onRemove={() => removeSkill(skill)}
|
|
143
|
+
removeLabel={`Remove ${skill}`}
|
|
144
|
+
>
|
|
145
|
+
{skill}
|
|
146
|
+
</Chip>
|
|
147
|
+
</ObjectDetails>
|
|
148
|
+
))}
|
|
149
|
+
<DropdownMenu>
|
|
150
|
+
<DropdownMenuTrigger
|
|
151
|
+
render={
|
|
152
|
+
<ChipAdd
|
|
153
|
+
isLabelVisible={skills.length === 0}
|
|
154
|
+
aria-label="Add a skill"
|
|
155
|
+
disabled={availableSkills.length === 0}
|
|
156
|
+
/>
|
|
157
|
+
}
|
|
158
|
+
/>
|
|
159
|
+
<DropdownMenuContent align="start" className="w-60">
|
|
160
|
+
{availableSkills.map((skill) => (
|
|
161
|
+
<DropdownMenuItem key={skill} onClick={() => addSkill(skill)}>
|
|
162
|
+
<BookOpenText />
|
|
163
|
+
{skill}
|
|
164
|
+
</DropdownMenuItem>
|
|
165
|
+
))}
|
|
166
|
+
</DropdownMenuContent>
|
|
167
|
+
</DropdownMenu>
|
|
168
|
+
</DetailsGroup>
|
|
169
|
+
<DetailsGroup label="Variables">
|
|
170
|
+
<ObjectDetails
|
|
171
|
+
title="RECIPIENT_EMAIL"
|
|
172
|
+
kindLabel="Variable"
|
|
173
|
+
description="The address the joke goes to, set when the agent runs."
|
|
174
|
+
>
|
|
175
|
+
<Chip kind="variable">RECIPIENT_EMAIL</Chip>
|
|
176
|
+
</ObjectDetails>
|
|
177
|
+
</DetailsGroup>
|
|
178
|
+
</aside>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
- Each chip is a button that opens its details popover (description, permission, Open, Remove).
|
|
184
|
+
- **onRemove** adds a small ✕ inside the chip that detaches the object; it stays quiet until hovered.
|
|
185
|
+
- **ChipAdd** is the “+” after a group's chips, usually the trigger of a picker. A group with nothing in it yet shows “+ Add” (isLabelVisible): a lone “+” reads as decoration.
|
|
186
|
+
- Not usable as attached: the warn state, with the way out as a note (“Connect”, “Not deployed”).
|
|
187
|
+
|
|
188
|
+
### Inline in text
|
|
189
|
+
|
|
190
|
+
With `inline` the chip sits in a line of text: a mention in an agent's instructions, the Composer or a chat message. It takes its size from the text, flows with the sentence and wraps with the line; chips on wrapped lines keep a gap between them.
|
|
191
|
+
|
|
192
|
+
Example: `inline`
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
import { BrandTile } from "@major-tech/ui/brand-tile";
|
|
196
|
+
import { Chip } from "@major-tech/ui/chip";
|
|
197
|
+
import { AppWindow, BookOpenText, FileText } from "lucide-react";
|
|
198
|
+
|
|
199
|
+
export default function ChipInline() {
|
|
200
|
+
return (
|
|
201
|
+
<p className="max-w-140 text-editor-body text-ink">
|
|
202
|
+
Check{" "}
|
|
203
|
+
<Chip inline kind="skill" icon={<BookOpenText />}>
|
|
204
|
+
workplace-humor-guide
|
|
205
|
+
</Chip>
|
|
206
|
+
. Skip the joke if{" "}
|
|
207
|
+
<Chip inline kind="connector" icon={<BrandTile letter="G" color="#1967D2" size="xs" />}>
|
|
208
|
+
Google Calendar
|
|
209
|
+
</Chip>{" "}
|
|
210
|
+
shows Maksim is out of office. Send it to{" "}
|
|
211
|
+
<Chip inline kind="variable">
|
|
212
|
+
RECIPIENT_EMAIL
|
|
213
|
+
</Chip>{" "}
|
|
214
|
+
with{" "}
|
|
215
|
+
<Chip inline kind="connector" icon={<BrandTile letter="S" color="#4A154B" size="xs" />}>
|
|
216
|
+
Slack
|
|
217
|
+
</Chip>{" "}
|
|
218
|
+
and save it to{" "}
|
|
219
|
+
<Chip inline kind="application" icon={<AppWindow />}>
|
|
220
|
+
Joke archive
|
|
221
|
+
</Chip>
|
|
222
|
+
, in the format of{" "}
|
|
223
|
+
<Chip inline icon={<FileText />}>
|
|
224
|
+
brief.pdf
|
|
225
|
+
</Chip>
|
|
226
|
+
.
|
|
227
|
+
</p>
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
- Without a kind the chip is neutral, for what isn't one of an agent's objects (a file in a chat message).
|
|
233
|
+
- A chip nothing opens is static, not a tab stop; give it onRemove where the mention can be deleted.
|
|
234
|
+
|
|
235
|
+
### States
|
|
236
|
+
|
|
237
|
+
A chip that can't work as written says so. warn and missing replace the kind's colours; the dot adds what the colours alone don't tell, in its tooltip.
|
|
238
|
+
|
|
239
|
+
Example: `states`
|
|
240
|
+
|
|
241
|
+
```tsx
|
|
242
|
+
"use client";
|
|
243
|
+
|
|
244
|
+
import { BrandTile } from "@major-tech/ui/brand-tile";
|
|
245
|
+
import { Chip, CHIP_STATES, CHIP_KINDS } from "@major-tech/ui/chip";
|
|
246
|
+
import { AppWindow, BookOpenText } from "lucide-react";
|
|
247
|
+
|
|
248
|
+
export default function ChipStates() {
|
|
249
|
+
return (
|
|
250
|
+
<p className="max-w-140 text-editor-body text-ink">
|
|
251
|
+
Post the summary with{" "}
|
|
252
|
+
<Chip
|
|
253
|
+
inline
|
|
254
|
+
kind={CHIP_KINDS.CONNECTOR}
|
|
255
|
+
icon={<BrandTile letter="S" color="#4A154B" size="xs" />}
|
|
256
|
+
state={CHIP_STATES.WARN}
|
|
257
|
+
dot="Not connected"
|
|
258
|
+
>
|
|
259
|
+
Slack
|
|
260
|
+
</Chip>
|
|
261
|
+
, follow{" "}
|
|
262
|
+
<Chip inline kind={CHIP_KINDS.SKILL} icon={<BookOpenText />} state={CHIP_STATES.WARN}>
|
|
263
|
+
weekly-report-style
|
|
264
|
+
</Chip>{" "}
|
|
265
|
+
and file it in{" "}
|
|
266
|
+
<Chip inline kind={CHIP_KINDS.APPLICATION} icon={<AppWindow />} state={CHIP_STATES.MISSING}>
|
|
267
|
+
Old reports
|
|
268
|
+
</Chip>
|
|
269
|
+
.
|
|
270
|
+
</p>
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
- **warn**: it can't work yet. The object isn't attached to the agent, the connector isn't connected, the app isn't deployed. The product decides; the details popover says why.
|
|
276
|
+
- **missing**: the object is no longer in the organization. Faint and struck through.
|
|
277
|
+
- **dot**: a 6px dot after the name in the chip's colour, for a reason (“Not connected”) or a comment. The text is its tooltip and is read with the chip's name.
|
|
278
|
+
|
|
279
|
+
### A picked element
|
|
280
|
+
|
|
281
|
+
What the person points at for the agent: an element picked with Click and ask, or a node picked on a workflow canvas. In the Composer it sits in ComposerChips with its ✕; on the sent message it stays, without one.
|
|
282
|
+
|
|
283
|
+
Example: `element`
|
|
284
|
+
|
|
285
|
+
```tsx
|
|
286
|
+
"use client";
|
|
287
|
+
|
|
288
|
+
import { useState } from "react";
|
|
289
|
+
import { BUTTON_SIZES, BUTTON_VARIANTS, Button } from "@major-tech/ui/button";
|
|
290
|
+
import { CHIP_KINDS, Chip } from "@major-tech/ui/chip";
|
|
291
|
+
import { MousePointerClick } from "lucide-react";
|
|
292
|
+
|
|
293
|
+
const ELEMENT = "DateRangePicker > button";
|
|
294
|
+
const WHERE = "“Today” · /reports";
|
|
295
|
+
const COMMENT = "Make this the default range";
|
|
296
|
+
|
|
297
|
+
export default function ChipElement() {
|
|
298
|
+
const [isPicked, setIsPicked] = useState(true);
|
|
299
|
+
|
|
300
|
+
return (
|
|
301
|
+
<div className="flex max-w-100 flex-col items-start gap-space-12">
|
|
302
|
+
{isPicked ? (
|
|
303
|
+
<Chip
|
|
304
|
+
kind={CHIP_KINDS.ELEMENT}
|
|
305
|
+
icon={<MousePointerClick />}
|
|
306
|
+
note={WHERE}
|
|
307
|
+
dot={COMMENT}
|
|
308
|
+
onRemove={() => setIsPicked(false)}
|
|
309
|
+
removeLabel={`Remove ${ELEMENT}`}
|
|
310
|
+
title={`${ELEMENT} ${WHERE}`}
|
|
311
|
+
>
|
|
312
|
+
{ELEMENT}
|
|
313
|
+
</Chip>
|
|
314
|
+
) : (
|
|
315
|
+
<Button variant={BUTTON_VARIANTS.GHOST} size={BUTTON_SIZES.SM} onClick={() => setIsPicked(true)}>
|
|
316
|
+
Pick it again
|
|
317
|
+
</Button>
|
|
318
|
+
)}
|
|
319
|
+
<Chip kind={CHIP_KINDS.ELEMENT} icon={<MousePointerClick />} note="Weekly report">
|
|
320
|
+
Send to Slack
|
|
321
|
+
</Chip>
|
|
322
|
+
</div>
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
- The name is the component, and the tag inside it when the pick is deeper (“DateRangePicker > button”); a node's is its own name.
|
|
328
|
+
- The note says where it is: the element's text and its page, or the node's workflow. It gives way before the name when the chip runs out of room; the chip's title has all of it.
|
|
329
|
+
- A comment written on it in Click and ask is its dot. Where the preview it was written on is open, a click on the chip opens the comment to edit it.
|
|
330
|
+
|
|
331
|
+
### Kinds
|
|
332
|
+
|
|
333
|
+
Colours are fixed per kind, so a tool reads the same everywhere.
|
|
334
|
+
|
|
335
|
+
- Daily Joke **Agent**: what uses a skill. Neutral chip, its icon in ink-2.
|
|
336
|
+
- Slack **Connector**: neutral chip; its 14px BrandTile or logo carries the brand.
|
|
337
|
+
- Joke archive **Application**: object-green on object-green-soft.
|
|
338
|
+
- Weekly report **Workflow**: one the agent can start. Neutral chip, its icon in ink-2.
|
|
339
|
+
- lead-scoring **Skill**: object-purple on object-purple-soft, with the BookOpenText icon.
|
|
340
|
+
- RECIPIENT_EMAIL **Variable**: object-blue, in mono; it reads by colour alone.
|
|
341
|
+
- Button **Element**: an element picked in the preview, or a node picked on a workflow canvas. selection on selection-soft, with the MousePointerClick icon.
|
|
342
|
+
- layout.tsx **No kind**: a file or an attachment. Neutral, its icon in ink-2.
|
|
343
|
+
|
|
344
|
+
### Guidelines
|
|
345
|
+
|
|
346
|
+
Do:
|
|
347
|
+
|
|
348
|
+
- Show the way out on an unavailable chip: “Connect”, “Not deployed”.
|
|
349
|
+
- Use letter BrandTiles in the brand colour, or the service's own logo, at 14px.
|
|
350
|
+
- Give a removable chip a removeLabel that names it: “Remove lead-scoring”.
|
|
351
|
+
|
|
352
|
+
Don't:
|
|
353
|
+
|
|
354
|
+
- A chip of your own for a mention, a picked element or a file: it's this one, with its kind.
|
|
355
|
+
- New colours for a kind, or green for anything that isn't an application.
|
|
356
|
+
- Editable text inside a chip.
|
|
357
|
+
|
|
358
|
+
## API
|
|
359
|
+
|
|
360
|
+
```tsx
|
|
361
|
+
import { Chip, ChipAdd, DetailsGroup, CHIP_KINDS, CHIP_STATES } from "@major-tech/ui/chip";
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### `<Chip />`
|
|
365
|
+
|
|
366
|
+
Renders a `<button>` when it has an onClick (a trigger passes one through `render`), otherwise a static `<span>`; native attributes go to it. With onRemove, it and its ✕ share a `<span>`.
|
|
367
|
+
|
|
368
|
+
| Prop | Type | Default | Description |
|
|
369
|
+
| --- | --- | --- | --- |
|
|
370
|
+
| `kind` | `"agent" \| "connector" \| "application" \| "workflow" \| "skill" \| "variable" \| "element"` | — | Fixes the colours. Omit for a file or an attachment: neutral. |
|
|
371
|
+
| `inline` | `boolean` | `false` | Set in a line of text: sized to the text, it wraps with the line. |
|
|
372
|
+
| `icon` | `ReactNode` | — | A 14px mark before the name: a BrandTile or logo, an app's icon, BookOpenText. |
|
|
373
|
+
| `note` | `ReactNode` | — | Regular-weight text after the name: “Connect”; a picked element's text and page, which gives way first. |
|
|
374
|
+
| `state` | `ChipState` | `"ok"` | warn: can't work yet (warn on warn-soft). missing: no longer in the organization (faint, struck through). |
|
|
375
|
+
| `dot` | `string` | — | Adds the 6px dot after the name in the chip's colour; the text is its tooltip and part of the accessible name. |
|
|
376
|
+
| `onRemove` | `() => void` | — | Adds the ✕ that detaches the object, deletes the mention or drops the pick. |
|
|
377
|
+
| `isRemoveDisabled` | `boolean` | `false` | Disables the ✕. |
|
|
378
|
+
| `removeLabel` | `string` | `"Remove"` | The ✕'s accessible name. |
|
|
379
|
+
|
|
380
|
+
### `<ChipAdd />`
|
|
381
|
+
|
|
382
|
+
| Prop | Type | Default | Description |
|
|
383
|
+
| --- | --- | --- | --- |
|
|
384
|
+
| `isLabelVisible` | `boolean` | `false` | Also says “Add”, for a group with nothing in it yet. |
|
|
385
|
+
|
|
386
|
+
### `<DetailsGroup />`
|
|
387
|
+
|
|
388
|
+
| Prop | Type | Default | Description |
|
|
389
|
+
| --- | --- | --- | --- |
|
|
390
|
+
| `label`* | `ReactNode` | — | 12px faint: “Connectors”. |
|
|
391
|
+
| `actions` | `ReactNode` | — | Extras on the right of the label row (a suggestions chip). |
|
|
392
|
+
| `children` | `ReactNode` | — | The chips, in a wrapping row. |
|
|
393
|
+
|
|
394
|
+
### `CHIP_STATES`
|
|
395
|
+
|
|
396
|
+
| Prop | Type | Default | Description |
|
|
397
|
+
| --- | --- | --- | --- |
|
|
398
|
+
| `OK · WARN · MISSING` | `ChipState` | — | The state values. |
|
|
399
|
+
|
|
400
|
+
### `CHIP_KINDS`
|
|
401
|
+
|
|
402
|
+
| Prop | Type | Default | Description |
|
|
403
|
+
| --- | --- | --- | --- |
|
|
404
|
+
| `AGENT · CONNECTOR · APPLICATION · WORKFLOW · SKILL · VARIABLE · ELEMENT` | `ChipKind` | — | The kind values. |
|
|
405
|
+
|
|
406
|
+
### Accessibility
|
|
407
|
+
|
|
408
|
+
- A chip that opens something is a button, focusable and opened with Enter or Space; one that opens nothing is a static chip, not a tab stop.
|
|
409
|
+
- The ✕ is its own button with an accessible name and a 24px hit area; its mousedown is kept from a surrounding editor.
|
|
410
|
+
- Unavailable is said in words (the note or the dot), not by colour alone.
|
|
411
|
+
- The dot is hidden from screen readers; its text is read after the name instead (“Slack, Not connected”).
|