@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 @@
|
|
|
1
|
+
{"version":3,"file":"composer.js","sourceRoot":"","sources":["../../src/components/composer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,QAAQ,EACR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AAE,GAAG,KAAK,EAAyB;IAC3E,OAAO,CACL,2BACY,iBAAiB,EAC3B,SAAS,EAAE,EAAE,CAAC,qGAAqG,EAAE,SAAS,CAAC,KAC3H,KAAK,GACT,CACH,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport {\n Children,\n createContext,\n useContext,\n useEffect,\n useId,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n type ChangeEvent,\n type ComponentProps,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { Document } from \"@tiptap/extension-document\";\nimport { HardBreak } from \"@tiptap/extension-hard-break\";\nimport { Mention } from \"@tiptap/extension-mention\";\nimport { Paragraph } from \"@tiptap/extension-paragraph\";\nimport { Text } from \"@tiptap/extension-text\";\nimport { Placeholder, UndoRedo } from \"@tiptap/extensions\";\nimport { PluginKey, TextSelection } from \"@tiptap/pm/state\";\nimport {\n EditorContent,\n NodeViewWrapper,\n ReactNodeViewRenderer,\n useEditor,\n type Editor,\n type JSONContent,\n type ReactNodeViewProps,\n} from \"@tiptap/react\";\nimport { exitSuggestion, type SuggestionKeyDownProps, type SuggestionProps } from \"@tiptap/suggestion\";\nimport { ArrowUp, ChevronDown, CirclePlus, MousePointerClick, Paperclip } from \"lucide-react\";\nimport { cn } from \"../lib/cn.ts\";\nimport {\n ATTACHMENT_GALLERY_SIZES,\n ATTACHMENT_STATUSES,\n AttachmentGallery,\n isAttachmentBusy,\n type AttachmentGalleryProps,\n type AttachmentItem,\n} from \"./attachment-gallery.tsx\";\nimport { BUTTON_SIZES, BUTTON_VARIANTS, Button } from \"./button.tsx\";\nimport {\n DROPDOWN_MENU_ITEM_CLASSES,\n DROPDOWN_MENU_LABEL_CLASSES,\n DROPDOWN_MENU_SHEET_CLASSES,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"./dropdown-menu.tsx\";\nimport { FileDropArea } from \"./file-upload.tsx\";\nimport { Chip, type ChipKind } from \"./chip.tsx\";\nimport { CARET_POPOVER_SIDES, CaretPopover } from \"./popover.tsx\";\nimport { Spinner } from \"./spinner.tsx\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"./tooltip.tsx\";\n\nexport const COMPOSER_STATUSES = {\n IDLE: \"idle\",\n /** The message is on its way and nothing streams back here yet (a start composer creating the chat): Send spins. */\n SUBMITTING: \"submitting\",\n /** Major is replying: Stop shows, and a typed message goes out beside it with Send. */\n WORKING: \"working\",\n} as const;\n\nexport type ComposerStatus = (typeof COMPOSER_STATUSES)[keyof typeof COMPOSER_STATUSES];\n\nexport const COMPOSER_BOX_VARIANTS = {\n /** A card with its edge, radius and shadow: the chat panel, a page's start composer. */\n CARD: \"card\",\n /** Docked to the bottom of a phone's screen: no side or bottom edge, square corners, room for the home bar. */\n DOCKED: \"docked\",\n} as const;\n\nexport type ComposerBoxVariant = (typeof COMPOSER_BOX_VARIANTS)[keyof typeof COMPOSER_BOX_VARIANTS];\n\nexport const COMPOSER_SEND_VARIANTS = {\n /** The 26px tile of a chat: secondary while empty, accent with something to send. */\n DEFAULT: \"default\",\n /** The 34px glass tile of a composer that starts something (Build, a new chat). */\n GLASS: \"glass\",\n} as const;\n\nexport type ComposerSendVariant = (typeof COMPOSER_SEND_VARIANTS)[keyof typeof COMPOSER_SEND_VARIANTS];\n\n/** Something the message points to, set in the text as an inline Chip: a connector, an app, an agent, a file. */\nexport interface ComposerMention {\n /** What it points to: a connector's id, a file's path. */\n id: string;\n label: string;\n /** The chip's colours, as Chip's; neutral when left out (a file). */\n kind?: ChipKind;\n /** The product's own sort (\"connector\", \"file\"), kept on the chip and handed back. */\n type?: string;\n /** Anything else the product needs back: a connector's subtype, a file's path. */\n data?: Record<string, string>;\n /** After the label in the @ menu, muted: a connector's type, a file's folder. Not on the chip. */\n description?: string;\n}\n\n/** One section of the @ menu: \"Connectors\", \"Files\". */\nexport interface ComposerMentionGroup {\n label?: string;\n items: ComposerMention[];\n}\n\n/** The editor's document, to save a draft and put it back exactly, mentions and all. */\nexport type ComposerDocument = JSONContent;\n\nexport interface ComposerMessage {\n /** The text, each mention written by `serializeMention`. */\n text: string;\n mentions: ComposerMention[];\n document: ComposerDocument;\n}\n\n/** What a product can do to the composer from outside: the file tree's \"Mention in chat\", a queued message to edit. */\nexport interface ComposerHandle {\n focus: () => void;\n clear: () => void;\n /** Puts a mention at the caret, or at the end when the composer isn't focused, followed by a space. */\n insertMention: (mention: ComposerMention) => void;\n /** Replaces the text; each mention's `serializeMention` token in it becomes its chip. */\n setText: (text: string, mentions?: ComposerMention[]) => void;\n getMessage: () => ComposerMessage;\n /** Puts back a document from `getMessage().document`: a saved draft. */\n setDocument: (document: ComposerDocument) => void;\n /** Opens the file picker for `onAddFiles`: a product's own menu of files (Upload file). */\n openFilePicker: () => void;\n}\n\nconst DEFAULT_MAX_HEIGHT = 160;\nconst CONTEXT_WARN_PERCENT = 80;\nconst CONTEXT_DANGER_PERCENT = 95;\nconst CONTEXT_RING_RADIUS = 7;\nconst CONTEXT_RING_CIRCUMFERENCE = 2 * Math.PI * CONTEXT_RING_RADIUS;\n/** Click and ask's shortcut with ⌘ or Ctrl and Shift: the key's place, so it works on any keyboard layout. */\nconst PICKER_SHORTCUT_CODE = \"KeyC\";\nconst MENTION_NODE = \"mention\";\nconst MENTION_PLUGIN_KEY = new PluginKey(\"composer-mention\");\nconst MENTION_MENU_MAX_HEIGHT = 296;\nconst EMPTY_DOCUMENT: ComposerDocument = { type: \"doc\", content: [{ type: \"paragraph\" }] };\n\n/** The 28px ghost icon tools of the box: (+) and Click and ask. Icons in `ink`, a 6px hover shape. */\nconst TOOL_CLASSES = \"rounded-md text-ink hover:text-ink\";\n\nconst defaultSerializeMention = (mention: ComposerMention) => `@${mention.label}`;\n\n/** What takes a message. `false`, or a promise of it, means it didn't go (an answer someone else gave first): the text stays. */\nexport type ComposerSubmitHandler = (message: ComposerMessage) => void | boolean | Promise<void | boolean>;\n\ninterface ComposerContextValue {\n editor: Editor | null;\n registerEditor: (editor: Editor | null) => void;\n /** The text as sent, kept current for Send. */\n text: string;\n setText: (text: string) => void;\n status: ComposerStatus;\n disabled: boolean;\n files: AttachmentItem[];\n onRemoveFile?: (id: string) => void;\n onRetryFile?: (id: string) => void;\n onAddFiles?: (files: File[]) => void;\n hasContent: boolean;\n /** Chips in ComposerChips: what they stand for goes with the message, so Send works without text. */\n setChipCount: (count: number) => void;\n onSubmit?: ComposerSubmitHandler;\n /** Set while Major waits on its questions: Enter and Send answer them. */\n onRespond?: ComposerSubmitHandler;\n /** Sends with `onSubmit`, or with the given handler (Respond, Skip questions and send). */\n submit: (handler?: ComposerSubmitHandler) => void;\n stop: () => void;\n openFilePicker: () => void;\n serializeMention: (mention: ComposerMention) => string;\n onValueChange?: (message: ComposerMessage) => void;\n}\n\nconst ComposerContext = createContext<ComposerContextValue | null>(null);\n\nfunction useComposer(part: string) {\n const context = useContext(ComposerContext);\n\n if (!context) {\n throw new Error(`${part} must be used within <Composer>`);\n }\n\n return context;\n}\n\ntype DocumentNode = { type?: string; text?: string; attrs?: Record<string, unknown>; content?: DocumentNode[] };\n\nfunction readMention(attrs: Record<string, unknown> | undefined): ComposerMention {\n return {\n id: String(attrs?.id ?? \"\"),\n label: String(attrs?.label ?? \"\"),\n kind: (attrs?.kind as ChipKind | null) ?? undefined,\n type: (attrs?.type as string | null) ?? undefined,\n data: (attrs?.data as Record<string, string> | null) ?? undefined,\n };\n}\n\nconst toMentionAttrs = (mention: ComposerMention) => ({\n id: mention.id,\n label: mention.label,\n kind: mention.kind ?? null,\n type: mention.type ?? null,\n data: mention.data ?? null,\n});\n\n/** The text as sent (each mention by `serializeMention`, a line per paragraph) and the mentions, in order. */\nfunction readMessage(editor: Editor | null, serializeMention: (mention: ComposerMention) => string): ComposerMessage {\n if (!editor) {\n return { text: \"\", mentions: [], document: EMPTY_DOCUMENT };\n }\n\n const document = editor.getJSON();\n const mentions: ComposerMention[] = [];\n\n const readInline = (nodes: DocumentNode[] = []) =>\n nodes\n .map((node) => {\n if (node.type === \"text\") return node.text ?? \"\";\n if (node.type === \"hardBreak\") return \"\\n\";\n\n if (node.type === MENTION_NODE) {\n const mention = readMention(node.attrs);\n mentions.push(mention);\n\n return serializeMention(mention);\n }\n\n return \"\";\n })\n .join(\"\");\n\n const text = ((document as DocumentNode).content ?? []).map((paragraph) => readInline(paragraph.content)).join(\"\\n\");\n\n return { text, mentions, document };\n}\n\n/** A document from text: each mention's token becomes its chip, each line a paragraph. */\nfunction buildDocument(\n text: string,\n mentions: ComposerMention[],\n serializeMention: (mention: ComposerMention) => string\n): ComposerDocument {\n const tokens = mentions.map((mention) => ({ mention, token: serializeMention(mention) })).filter(({ token }) => token);\n // Each mention is used once, in order: two that read the same (\"@index.ts\" in two folders) keep their own chips.\n const used = new Set<number>();\n\n const paragraphs = text.split(\"\\n\").map((line) => {\n const content: DocumentNode[] = [];\n let rest = line;\n\n while (rest.length > 0) {\n let match: { index: number; token: string; mention: ComposerMention; position: number } | null = null;\n\n for (const [position, { mention, token }] of tokens.entries()) {\n const index = rest.indexOf(token);\n const isEarlier = match === null || index < match.index;\n const isFresherAtSamePlace = match !== null && index === match.index && used.has(match.position) && !used.has(position);\n\n if (index !== -1 && (isEarlier || isFresherAtSamePlace)) {\n match = { index, token, mention, position };\n }\n }\n\n if (!match) {\n content.push({ type: \"text\", text: rest });\n break;\n }\n\n if (match.index > 0) content.push({ type: \"text\", text: rest.slice(0, match.index) });\n content.push({ type: MENTION_NODE, attrs: toMentionAttrs(match.mention) });\n used.add(match.position);\n rest = rest.slice(match.index + match.token.length);\n }\n\n return content.length > 0 ? { type: \"paragraph\", content } : { type: \"paragraph\" };\n });\n\n return { type: \"doc\", content: paragraphs } as ComposerDocument;\n}\n\nexport interface ComposerProps extends Omit<ComponentProps<\"div\">, \"onSubmit\" | \"ref\"> {\n /** Focus, clear, set the text, insert a mention or read the message from outside. */\n ref?: Ref<ComposerHandle>;\n /**\n * Enter or Send with text, done files or chips. The text clears afterwards unless `clearOnSubmit` is false, or the\n * handler returns `false` (or a promise of it): the message didn't go.\n */\n onSubmit?: ComposerSubmitHandler;\n /**\n * While Major waits on its questions: Enter and Send answer them with the message (\"Respond\"), and Send's menu has\n * \"Skip questions and send\" for `onSubmit`. Leave it out otherwise.\n */\n onRespond?: ComposerSubmitHandler;\n /** Every edit, and once with the text the editor starts from: for a draft that survives a reload. */\n onValueChange?: (message: ComposerMessage) => void;\n /** Default: idle. */\n status?: ComposerStatus;\n /** Stops the reply: Stop, or Esc in the text while Major works. */\n onStop?: () => void;\n disabled?: boolean;\n /** Attached files and screenshots, for ComposerFiles; Send waits while one uploads. */\n files?: AttachmentItem[];\n onRemoveFile?: (id: string) => void;\n onRetryFile?: (id: string) => void;\n /**\n * Takes files from ComposerAttachButton's picker, a drop on ComposerBox and images pasted into the text. Check them\n * with validateFiles, upload, pass them back in `files`.\n */\n onAddFiles?: (files: File[]) => void;\n /** How a mention reads in the sent text and in `setText`. Default: `@` and its label. */\n serializeMention?: (mention: ComposerMention) => string;\n /** Default true. False where the composer goes away on send (a start composer navigates), so it doesn't flash empty. */\n clearOnSubmit?: boolean;\n}\n\n/**\n * The message box, built from parts: a queue attached above, the box (files, chips, the text, a row of actions) and a\n * row of settings under it. The root keeps what the parts share: the text, the files, the status and sending. Enter\n * sends, Shift+Enter adds a line, @ opens the mentions.\n */\nexport function Composer({\n ref,\n onSubmit,\n onRespond,\n onValueChange,\n status = COMPOSER_STATUSES.IDLE,\n onStop,\n disabled = false,\n files = [],\n onRemoveFile,\n onRetryFile,\n onAddFiles,\n serializeMention = defaultSerializeMention,\n clearOnSubmit = true,\n className,\n children,\n ...props\n}: ComposerProps) {\n const [editor, setEditor] = useState<Editor | null>(null);\n const [text, setText] = useState(\"\");\n const [chipCount, setChipCount] = useState(0);\n const isSendingRef = useRef(false);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const isUploading = files.some(isAttachmentBusy);\n const hasReadyFiles = files.some(({ status: fileStatus }) => (fileStatus ?? ATTACHMENT_STATUSES.DONE) === ATTACHMENT_STATUSES.DONE);\n const hasContent = (text.trim().length > 0 || hasReadyFiles || chipCount > 0) && !isUploading;\n\n const getMessage = () => readMessage(editor, serializeMention);\n\n // The handler is picked in the body, not as a default parameter: a compiler that memoizes this function might not\n // see a default parameter's dependencies, and Enter would keep sending after Major starts asking.\n const submit = (handler?: ComposerSubmitHandler) => {\n const send = handler ?? onRespond ?? onSubmit;\n\n if (!hasContent || disabled || status === COMPOSER_STATUSES.SUBMITTING || !send || isSendingRef.current) return;\n const sent = editor;\n const message = getMessage();\n\n // What was sent leaves the text, unless it didn't go, or something was typed while it was on its way: that stays.\n const clear = (result: void | boolean) => {\n const isUnchanged = sent && !sent.isDestroyed && JSON.stringify(sent.getJSON()) === JSON.stringify(message.document);\n\n if (clearOnSubmit && result !== false && isUnchanged) sent.commands.clearContent(true);\n };\n\n const result = send(message);\n\n if (result instanceof Promise) {\n // One message at a time: a second Enter while the first is on its way doesn't send it again.\n isSendingRef.current = true;\n void result.then(clear).finally(() => {\n isSendingRef.current = false;\n });\n } else {\n clear(result);\n }\n };\n\n const stop = () => onStop?.();\n\n const openFilePicker = () => fileInputRef.current?.click();\n\n const handleFilesPicked = (event: ChangeEvent<HTMLInputElement>) => {\n const picked = Array.from(event.target.files ?? []);\n // Picking the same file again must fire again.\n event.target.value = \"\";\n\n if (picked.length > 0) onAddFiles?.(picked);\n };\n\n useImperativeHandle(\n ref,\n () => ({\n focus: () => editor?.commands.focus(\"end\"),\n clear: () => editor?.commands.clearContent(true),\n insertMention: (mention) => {\n if (!editor) return;\n const chain = editor.isFocused ? editor.chain().focus() : editor.chain().focus(\"end\");\n chain.insertContent([{ type: MENTION_NODE, attrs: toMentionAttrs(mention) }, { type: \"text\", text: \" \" }]).run();\n },\n setText: (next, mentions = []) => {\n editor?.chain().setContent(buildDocument(next, mentions, serializeMention)).focus(\"end\").run();\n },\n getMessage,\n setDocument: (document) => {\n editor?.chain().setContent(document).focus(\"end\").run();\n },\n openFilePicker,\n }),\n [editor, serializeMention]\n );\n\n const context: ComposerContextValue = {\n editor,\n registerEditor: setEditor,\n text,\n setText,\n status,\n disabled,\n files,\n onRemoveFile,\n onRetryFile,\n onAddFiles,\n hasContent,\n setChipCount,\n onSubmit,\n onRespond,\n submit,\n stop,\n openFilePicker,\n serializeMention,\n onValueChange,\n };\n\n return (\n <ComposerContext.Provider value={context}>\n <div data-slot=\"composer\" data-status={status} className={cn(\"flex w-full flex-col\", className)} {...props}>\n {children}\n {/* No `accept`: the picker takes what a drop and a paste take; validateFiles checks them all the same way. */}\n {onAddFiles && <input ref={fileInputRef} type=\"file\" multiple hidden onChange={handleFilesPicked} />}\n </div>\n </ComposerContext.Provider>\n );\n}\n\nconst BOX_VARIANT_CLASSES = {\n [COMPOSER_BOX_VARIANTS.CARD]: \"rounded-panel border border-panel-edge shadow-card\",\n [COMPOSER_BOX_VARIANTS.DOCKED]:\n \"rounded-none border-t border-panel-edge pb-[calc(var(--spacing-space-6)+env(safe-area-inset-bottom))]\",\n} satisfies Record<ComposerBoxVariant, string>;\n\nexport interface ComposerBoxProps extends Omit<ComponentProps<\"div\">, \"onDrop\"> {\n /** Default: card. */\n variant?: ComposerBoxVariant;\n /** The drop field's second line: \"Up to 30 files, 100 MB each\". */\n dropHint?: ReactNode;\n}\n\n/**\n * The box: a 6px inset on `surface`, a drop field for files while the root takes them, and a click on its empty\n * space puts the caret in the text.\n */\nexport function ComposerBox({ variant = COMPOSER_BOX_VARIANTS.CARD, dropHint, className, onClick, ...props }: ComposerBoxProps) {\n const { editor, onAddFiles, disabled } = useComposer(\"ComposerBox\");\n\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n onClick?.(event);\n\n if (event.target === event.currentTarget) editor?.commands.focus(\"end\");\n };\n\n return (\n <FileDropArea\n data-slot=\"composer-box\"\n data-variant={variant}\n onFiles={(dropped) => onAddFiles?.(dropped)}\n disabled={!onAddFiles || disabled}\n hint={dropHint}\n onClick={handleClick}\n className={cn(\n \"relative flex flex-col bg-surface p-space-6 font-sans text-ink\",\n BOX_VARIANT_CLASSES[variant],\n disabled && \"opacity-50\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport type ComposerFilesProps = Omit<AttachmentGalleryProps, \"items\" | \"onRemove\" | \"onRetry\">;\n\n/** The root's files as md tiles, removable while they're being added. Nothing without files. */\nexport function ComposerFiles({ size = ATTACHMENT_GALLERY_SIZES.MD, className, ...props }: ComposerFilesProps) {\n const { files, onRemoveFile, onRetryFile } = useComposer(\"ComposerFiles\");\n\n return (\n <AttachmentGallery\n items={files}\n size={size}\n onRemove={onRemoveFile}\n onRetry={onRetryFile}\n className={cn(\"px-space-6 pt-space-6 pb-space-4\", className)}\n {...props}\n />\n );\n}\n\n/** A wrapping row of Chips above the text: elements picked with Click and ask, nodes on a canvas. */\nexport function ComposerChips({ className, children, ...props }: ComponentProps<\"div\">) {\n const { setChipCount } = useComposer(\"ComposerChips\");\n const count = Children.toArray(children).length;\n\n useEffect(() => {\n setChipCount(count);\n\n return () => setChipCount(0);\n }, [count, setChipCount]);\n\n if (count === 0) return null;\n\n return (\n <div data-slot=\"composer-chips\" className={cn(\"flex flex-wrap gap-space-6 px-space-6 py-space-4\", className)} {...props}>\n {children}\n </div>\n );\n}\n\nconst MentionIconContext = createContext<((mention: ComposerMention) => ReactNode) | undefined>(undefined);\n\n/** A mention in the text: the inline Chip, with ✕ while the text can change. */\nfunction MentionChipView({ node, deleteNode, editor }: ReactNodeViewProps) {\n const getIcon = useContext(MentionIconContext);\n const mention = readMention(node.attrs);\n\n return (\n <NodeViewWrapper as=\"span\" contentEditable={false}>\n <Chip\n inline\n kind={mention.kind}\n icon={getIcon?.(mention)}\n title={mention.label}\n onRemove={editor.isEditable ? deleteNode : undefined}\n removeLabel={`Remove ${mention.label}`}\n >\n {mention.label}\n </Chip>\n </NodeViewWrapper>\n );\n}\n\n// A chip is one step for the arrows: the caret jumps over it, never into it.\nconst MentionNode = Mention.extend({\n name: MENTION_NODE,\n selectable: false,\n addAttributes() {\n return {\n id: { default: null },\n label: { default: null },\n kind: { default: null },\n type: { default: null },\n data: { default: null },\n };\n },\n addNodeView() {\n return ReactNodeViewRenderer(MentionChipView);\n },\n addKeyboardShortcuts() {\n const skip = (direction: 1 | -1) => () => {\n const { state, view } = this.editor;\n const { selection } = state;\n\n if (!selection.empty) return false;\n const neighbour = direction === 1 ? selection.$from.nodeAfter : selection.$from.nodeBefore;\n\n if (neighbour?.type.name !== this.name) return false;\n const position = selection.from + direction * neighbour.nodeSize;\n view.dispatch(state.tr.setSelection(TextSelection.near(state.doc.resolve(position), direction)));\n\n return true;\n };\n\n return { ArrowRight: skip(1), ArrowLeft: skip(-1) };\n },\n});\n\ninterface MentionMenuState {\n query: string;\n getRect: (() => DOMRect | null) | null;\n command: ((mention: ComposerMention) => void) | null;\n}\n\nexport interface ComposerEditorProps {\n /** Italic, in `muted`, until something is typed. Default: \"Ask anything\". */\n placeholder?: string;\n /**\n * What the text starts with: a prompt carried over from another page, or a saved draft's document with its mentions.\n * Read on mount; give the editor a `key` to start over (another chat's draft), or use the handle.\n */\n defaultValue?: string | ComposerDocument;\n /** With a string `defaultValue`: the mentions whose `serializeMention` tokens in it start as chips. */\n defaultMentions?: ComposerMention[];\n /** Default: \"Message\". */\n \"aria-label\"?: string;\n /** Puts the caret in the text on mount: a page whose whole point is the composer. */\n autoFocus?: boolean;\n /** Height before the text scrolls. Default: 160. */\n maxHeight?: number;\n /** The @ menu's sections for the current query. Leave both this and `onMentionQueryChange` out for no mentions. */\n mentionGroups?: ComposerMentionGroup[];\n /** Typing after @: the query, \"\" right after the @, and null once the menu closes. */\n onMentionQueryChange?: (query: string | null) => void;\n /** The menu waits on the product's search: a spinner in place of its rows. */\n isMentionLoading?: boolean;\n /** Default: \"No matches\". */\n mentionEmptyText?: string;\n /** A muted line atop the menu before anything is typed after @: \"Mention an agent, a connector or a file\". */\n mentionHint?: string;\n /** A 14px mark for a mention, in the menu and on its chip: a connector's logo, a kind's icon. */\n getMentionIcon?: (mention: ComposerMention) => ReactNode;\n className?: string;\n}\n\n/**\n * The text, on TipTap: plain paragraphs and mentions, nothing else (pasted text comes in plain, formatting shortcuts do\n * nothing). @ opens a menu at the caret with the product's sections; the arrows move in it, Enter or Tab picks, Esc\n * closes. A pasted image goes to `onAddFiles`. Esc while Major works stops it.\n */\nexport function ComposerEditor({\n placeholder = \"Ask anything\",\n defaultValue,\n defaultMentions = [],\n \"aria-label\": ariaLabel = \"Message\",\n autoFocus = false,\n maxHeight = DEFAULT_MAX_HEIGHT,\n mentionGroups,\n onMentionQueryChange,\n isMentionLoading = false,\n mentionEmptyText = \"No matches\",\n mentionHint,\n getMentionIcon,\n className,\n}: ComposerEditorProps) {\n const composer = useComposer(\"ComposerEditor\");\n const menuId = useId();\n const [menu, setMenu] = useState<MentionMenuState | null>(null);\n const [highlighted, setHighlighted] = useState(0);\n const isMentionEnabled = Boolean(mentionGroups || onMentionQueryChange);\n const items = (mentionGroups ?? []).flatMap((group) => group.items);\n const isMenuOpen = isMentionEnabled && menu !== null;\n\n // ProseMirror keeps the handlers it was built with: these refs hand them the current props and state.\n const latest = useRef({ composer, placeholder, items, highlighted, isMenuOpen, isMentionEnabled, onMentionQueryChange });\n const menuRef = useRef<MentionMenuState | null>(null);\n\n useLayoutEffect(() => {\n latest.current = { composer, placeholder, items, highlighted, isMenuOpen, isMentionEnabled, onMentionQueryChange };\n });\n\n const pickMention = (mention: ComposerMention) => {\n menuRef.current?.command?.(mention);\n };\n\n const editor = useEditor({\n immediatelyRender: false,\n autofocus: autoFocus ? \"end\" : false,\n content:\n typeof defaultValue === \"string\" ? buildDocument(defaultValue, defaultMentions, composer.serializeMention) : defaultValue,\n editable: !composer.disabled,\n extensions: [\n Document,\n Paragraph,\n Text,\n HardBreak,\n UndoRedo,\n Placeholder.configure({ placeholder: () => latest.current.placeholder, showOnlyWhenEditable: false }),\n MentionNode.configure({\n suggestion: {\n char: \"@\",\n pluginKey: MENTION_PLUGIN_KEY,\n allowSpaces: false,\n allow: () => latest.current.isMentionEnabled,\n command: ({ editor: target, range, props: mention }) => {\n target\n .chain()\n .focus()\n .insertContentAt(range, [\n { type: MENTION_NODE, attrs: toMentionAttrs(mention as ComposerMention) },\n { type: \"text\", text: \" \" },\n ])\n .run();\n },\n render: () => {\n const open = (props: SuggestionProps) => {\n menuRef.current = {\n query: props.query,\n getRect: props.clientRect ?? null,\n command: (mention) => props.command(mention),\n };\n setMenu(menuRef.current);\n latest.current.onMentionQueryChange?.(props.query);\n };\n\n return {\n onStart: (props) => {\n setHighlighted(0);\n open(props);\n },\n onUpdate: (props) => {\n setHighlighted(0);\n open(props);\n },\n onExit: () => {\n menuRef.current = null;\n setMenu(null);\n latest.current.onMentionQueryChange?.(null);\n },\n onKeyDown: ({ event, view }: SuggestionKeyDownProps) => {\n const { items: options, highlighted: index } = latest.current;\n\n if (event.key === \"Escape\") {\n exitSuggestion(view, MENTION_PLUGIN_KEY);\n\n return true;\n }\n\n if (options.length === 0) return false;\n\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n const step = event.key === \"ArrowDown\" ? 1 : -1;\n setHighlighted((index + step + options.length) % options.length);\n\n return true;\n }\n\n if (event.key === \"Enter\" || event.key === \"Tab\") {\n menuRef.current?.command?.(options[Math.min(index, options.length - 1)]);\n\n return true;\n }\n\n return false;\n },\n };\n },\n },\n }),\n ],\n editorProps: {\n attributes: {\n role: \"textbox\",\n \"aria-multiline\": \"true\",\n \"aria-label\": ariaLabel,\n class: cn(\n \"w-full overflow-y-auto px-space-6 py-space-4 font-sans text-body leading-5 break-words whitespace-pre-wrap text-ink outline-none\",\n \"[&_p]:m-0 min-h-8\",\n // The placeholder: TipTap marks the empty first paragraph and gives it the text.\n \"[&_p.is-editor-empty:first-child]:before:pointer-events-none [&_p.is-editor-empty:first-child]:before:float-left [&_p.is-editor-empty:first-child]:before:h-0 [&_p.is-editor-empty:first-child]:before:text-muted [&_p.is-editor-empty:first-child]:before:italic [&_p.is-editor-empty:first-child]:before:content-[attr(data-placeholder)]\",\n className\n ),\n style: `max-height: ${maxHeight}px`,\n },\n handleKeyDown: (_view, event) => {\n const { composer: current, isMenuOpen: isOpen, items: options } = latest.current;\n\n if (event.key === \"Enter\" && !event.shiftKey && !event.isComposing) {\n // The menu's own Enter picks a mention.\n if (isOpen && options.length > 0) return false;\n event.preventDefault();\n current.submit();\n\n return true;\n }\n\n if (event.key === \"Escape\" && !isOpen && current.status === COMPOSER_STATUSES.WORKING) {\n current.stop();\n\n return true;\n }\n\n // There is no formatting to apply: keep the browser from trying.\n if ((event.metaKey || event.ctrlKey) && [\"b\", \"i\", \"u\"].includes(event.key.toLowerCase())) {\n event.preventDefault();\n\n return true;\n }\n\n return false;\n },\n // Pasted text comes in plain. An image comes in as a file, unless the clipboard also carries text (a range\n // copied from a spreadsheet or a slide is text with a picture of it).\n handlePaste: (view, event) => {\n const pastedFiles = Array.from(event.clipboardData?.files ?? []);\n const pastedText = event.clipboardData?.getData(\"text/plain\") ?? \"\";\n const { onAddFiles } = latest.current.composer;\n\n if (pastedFiles.length > 0 && !pastedText) {\n event.preventDefault();\n onAddFiles?.(pastedFiles);\n\n return true;\n }\n\n if (pastedText) {\n event.preventDefault();\n view.dispatch(view.state.tr.insertText(pastedText));\n\n return true;\n }\n\n return false;\n },\n },\n // The product hears the text it starts from too: a draft's mentions, before the first edit.\n onCreate: ({ editor: created }) => {\n const { composer: current } = latest.current;\n const message = readMessage(created, current.serializeMention);\n current.setText(message.text);\n current.onValueChange?.(message);\n },\n onUpdate: ({ editor: changed }) => {\n const { composer: current } = latest.current;\n const message = readMessage(changed, current.serializeMention);\n current.setText(message.text);\n current.onValueChange?.(message);\n },\n });\n\n const { registerEditor, disabled } = composer;\n\n useEffect(() => {\n registerEditor(editor);\n\n return () => registerEditor(null);\n }, [editor, registerEditor]);\n\n useEffect(() => {\n editor?.setEditable(!disabled);\n }, [editor, disabled]);\n\n // A new placeholder shows at once: the extension reads it when the document redraws.\n useEffect(() => {\n if (editor && !editor.isDestroyed) editor.view.dispatch(editor.state.tr.setMeta(\"composerPlaceholder\", placeholder));\n }, [editor, placeholder]);\n\n // The text field owns the menu for assistive tech: it says the menu is open and which row is current.\n const highlightedId = isMenuOpen && items.length > 0 ? `${menuId}-${Math.min(highlighted, items.length - 1)}` : undefined;\n\n useEffect(() => {\n const field = editor?.isDestroyed ? null : editor?.view.dom;\n\n if (!field || !isMentionEnabled) return;\n field.setAttribute(\"aria-autocomplete\", \"list\");\n field.setAttribute(\"aria-expanded\", String(isMenuOpen));\n if (isMenuOpen) field.setAttribute(\"aria-controls\", menuId);\n else field.removeAttribute(\"aria-controls\");\n if (highlightedId) field.setAttribute(\"aria-activedescendant\", highlightedId);\n else field.removeAttribute(\"aria-activedescendant\");\n }, [editor, isMentionEnabled, isMenuOpen, menuId, highlightedId]);\n\n useEffect(() => {\n if (highlightedId) document.getElementById(highlightedId)?.scrollIntoView({ block: \"nearest\" });\n }, [highlightedId]);\n\n const handleMenuClose = () => {\n if (editor && !editor.isDestroyed) exitSuggestion(editor.view, MENTION_PLUGIN_KEY);\n };\n\n let index = 0;\n\n return (\n <MentionIconContext.Provider value={getMentionIcon}>\n <EditorContent editor={editor} data-slot=\"composer-editor\" />\n\n {isMenuOpen && (\n <CaretPopover\n getCaretRect={() => menu?.getRect?.() ?? null}\n maxHeight={MENTION_MENU_MAX_HEIGHT}\n onClose={handleMenuClose}\n side={CARET_POPOVER_SIDES.TOP}\n className={cn(DROPDOWN_MENU_SHEET_CLASSES, \"w-84 p-space-6\")}\n >\n <div id={menuId} role=\"listbox\" aria-label=\"Mentions\">\n {mentionHint && menu?.query === \"\" && <div className={DROPDOWN_MENU_LABEL_CLASSES}>{mentionHint}</div>}\n {isMentionLoading && items.length === 0 && (\n <div role=\"status\" aria-label=\"Searching\" className=\"flex justify-center py-space-12\">\n <Spinner className=\"text-muted\" />\n </div>\n )}\n {!isMentionLoading && items.length === 0 && (\n <p className=\"m-0 px-space-8 py-space-6 text-ui text-faint\">{mentionEmptyText}</p>\n )}\n {(mentionGroups ?? [])\n .filter((group) => group.items.length > 0)\n .map((group, groupIndex) => (\n <div key={group.label ?? groupIndex} role=\"group\" aria-label={group.label}>\n {/* The menu's own separator between sections. */}\n {groupIndex > 0 && <div role=\"separator\" className=\"mx-space-8 my-1.25 h-px bg-line\" />}\n {group.label && <div className={DROPDOWN_MENU_LABEL_CLASSES}>{group.label}</div>}\n {group.items.map((mention) => {\n const optionIndex = index++;\n\n return (\n <div\n key={`${mention.type ?? \"\"}:${mention.id}`}\n id={`${menuId}-${optionIndex}`}\n role=\"option\"\n aria-selected={optionIndex === highlighted}\n data-highlighted={optionIndex === highlighted ? \"\" : undefined}\n className={DROPDOWN_MENU_ITEM_CLASSES}\n // The text keeps the focus: a press picks without taking it away.\n onMouseDown={(event) => event.preventDefault()}\n onMouseEnter={() => setHighlighted(optionIndex)}\n onClick={() => pickMention(mention)}\n >\n {getMentionIcon?.(mention)}\n <span className=\"min-w-0 flex-1 truncate\">{mention.label}</span>\n {mention.description && (\n <span className=\"max-w-30 shrink-0 truncate text-small text-muted\">{mention.description}</span>\n )}\n </div>\n );\n })}\n </div>\n ))}\n </div>\n </CaretPopover>\n )}\n </MentionIconContext.Provider>\n );\n}\n\n/** The row under the text: tools at the start, Send at the end. Two ComposerActionGroups, or Send alone on the right. */\nexport function ComposerActions({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"composer-actions\"\n className={cn(\"flex items-center justify-between gap-space-4 pt-space-4 [&>:only-child]:ml-auto\", className)}\n {...props}\n />\n );\n}\n\n/** A run of controls in ComposerActions or ComposerFooter, 4px apart. */\nexport function ComposerActionGroup({ className, ...props }: ComponentProps<\"div\">) {\n return <div data-slot=\"composer-action-group\" className={cn(\"flex min-w-0 items-center gap-space-4\", className)} {...props} />;\n}\n\nexport interface ComposerAttachButtonProps extends ComponentProps<\"button\"> {\n /** The tooltip and name. Default: \"Add a file\", or \"Add a file or a screenshot\" with a menu. */\n label?: string;\n /** DropdownMenuItems (ComposerAttachFileItem, Add screenshot): the button opens them as a menu. */\n children?: ReactNode;\n}\n\n/**\n * The (+) tool. Alone it opens the file picker and hands the files to the root's `onAddFiles`; with children it opens\n * them as a menu; with `onClick` (or as a Popover's trigger, through `render`) it does what that says.\n */\nexport function ComposerAttachButton({ label, children, onClick, disabled, className, ...props }: ComposerAttachButtonProps) {\n const composer = useComposer(\"ComposerAttachButton\");\n const hasMenu = Children.toArray(children).length > 0;\n const name = label ?? (hasMenu ? \"Add a file or a screenshot\" : \"Add a file\");\n const isDisabled = disabled || composer.disabled || (!hasMenu && !onClick && !composer.onAddFiles);\n\n const button = (\n <Button\n variant={BUTTON_VARIANTS.GHOST}\n size={BUTTON_SIZES.ICON}\n aria-label={name}\n disabled={isDisabled}\n onClick={hasMenu ? onClick : (onClick ?? composer.openFilePicker)}\n className={cn(TOOL_CLASSES, className)}\n {...props}\n >\n <CirclePlus />\n </Button>\n );\n\n if (hasMenu) {\n return (\n <DropdownMenu modal={false}>\n <Tooltip>\n <TooltipTrigger render={<DropdownMenuTrigger render={button} />} />\n <TooltipContent side=\"top\">{name}</TooltipContent>\n </Tooltip>\n <DropdownMenuContent side=\"top\" align=\"start\" className=\"w-60\">\n {children}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n }\n\n return (\n <Tooltip>\n <TooltipTrigger render={button} />\n <TooltipContent side=\"top\">{name}</TooltipContent>\n </Tooltip>\n );\n}\n\n/** The (+) menu's row that opens the file picker. */\nexport function ComposerAttachFileItem({ children = \"Add a file\", ...props }: ComponentProps<typeof DropdownMenuItem>) {\n const { openFilePicker } = useComposer(\"ComposerAttachFileItem\");\n\n return (\n <DropdownMenuItem onClick={openFilePicker} {...props}>\n <Paperclip />\n {children}\n </DropdownMenuItem>\n );\n}\n\nexport interface ComposerPickerProps extends Omit<ComponentProps<\"button\">, \"onChange\"> {\n active: boolean;\n onActiveChange: (active: boolean) => void;\n}\n\n/**\n * Click and ask, where there is a preview to pick from: on, the person picks an element and it joins the message as a\n * chip. ⌘⇧C (Ctrl+Shift+C) toggles it from anywhere on the page, Esc turns it off.\n */\nexport function ComposerPicker({ active, onActiveChange, disabled, className, ...props }: ComposerPickerProps) {\n const composer = useComposer(\"ComposerPicker\");\n const isDisabled = disabled || composer.disabled;\n\n // The person is usually looking at the preview, not the box: the shortcut works anywhere, as the tooltip promises.\n useEffect(() => {\n if (isDisabled) return;\n\n const handleKeyDown = (event: globalThis.KeyboardEvent) => {\n if (event.defaultPrevented || event.repeat) return;\n const isShortcut = (event.metaKey || event.ctrlKey) && event.shiftKey && !event.altKey && event.code === PICKER_SHORTCUT_CODE;\n\n if (isShortcut) {\n event.preventDefault();\n onActiveChange(!active);\n } else if (event.key === \"Escape\" && active) {\n onActiveChange(false);\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [isDisabled, active, onActiveChange]);\n\n return (\n <Tooltip>\n <TooltipTrigger\n render={\n <Button\n variant={BUTTON_VARIANTS.GHOST}\n size={BUTTON_SIZES.ICON}\n aria-label=\"Click and ask\"\n aria-pressed={active}\n disabled={isDisabled}\n onClick={() => onActiveChange(!active)}\n className={cn(TOOL_CLASSES, active && \"bg-secondary text-selection hover:bg-secondary hover:text-selection\", className)}\n {...props}\n />\n }\n >\n <MousePointerClick />\n </TooltipTrigger>\n <TooltipContent side=\"top\">\n {active ? \"Click and ask · on\" : \"Click and ask\"}\n <kbd>{active ? \"Esc\" : \"⌘⇧C\"}</kbd>\n </TooltipContent>\n </Tooltip>\n );\n}\n\n/** 26px, between the Button icon sizes: the chat's Send and Stop tile. */\nconst SEND_TILE_CLASSES =\n \"inline-grid size-6.5 shrink-0 cursor-pointer place-items-center rounded-md border-0 p-0 outline-none transition-colors duration-120 focus-visible:ring-2 focus-visible:ring-accent/40 disabled:cursor-default [&_svg]:size-4\";\n\nfunction StopTile() {\n const { stop } = useComposer(\"ComposerSend\");\n\n return (\n <Tooltip>\n <TooltipTrigger\n render={<button type=\"button\" aria-label=\"Stop\" onClick={stop} className={cn(SEND_TILE_CLASSES, \"bg-secondary text-ink\")} />}\n >\n <span className=\"block size-2.25 rounded-[2px] bg-current\" />\n </TooltipTrigger>\n <TooltipContent side=\"top\">\n Stop\n <kbd>Esc</kbd>\n </TooltipContent>\n </Tooltip>\n );\n}\n\nexport interface ComposerSendProps {\n /** Default: the chat's 26px tile; `glass` for a composer that starts something. */\n variant?: ComposerSendVariant;\n className?: string;\n}\n\n/**\n * Send, in every state: secondary with a faint arrow while there is nothing to send, accent once there is, a spinner\n * while submitting. While Major works, Stop, and Send beside it once something is typed. While Major waits on its\n * questions (the root's `onRespond`), Send is Respond, with \"Skip questions and send\" in its menu.\n */\nexport function ComposerSend({ variant = COMPOSER_SEND_VARIANTS.DEFAULT, className }: ComposerSendProps) {\n const { hasContent, status, disabled, submit, onRespond, onSubmit } = useComposer(\"ComposerSend\");\n const isWorking = status === COMPOSER_STATUSES.WORKING;\n const isSubmitting = status === COMPOSER_STATUSES.SUBMITTING;\n\n if (variant === COMPOSER_SEND_VARIANTS.GLASS) {\n return (\n <Button\n data-slot=\"composer-send\"\n variant={BUTTON_VARIANTS.GLASS}\n size={BUTTON_SIZES.ICON_LG}\n loading={isSubmitting}\n aria-label={isSubmitting ? \"Sending\" : \"Send\"}\n disabled={disabled || (!hasContent && !isSubmitting)}\n onClick={() => submit()}\n className={className}\n >\n <ArrowUp />\n </Button>\n );\n }\n\n if (isWorking || (onRespond && hasContent)) {\n return (\n <div data-slot=\"composer-send\" className={cn(\"flex items-center gap-space-4\", className)}>\n {isWorking && <StopTile />}\n {hasContent && onRespond && (\n <div className=\"flex items-center\">\n <Button size={BUTTON_SIZES.SM} disabled={disabled} onClick={() => submit(onRespond)} className=\"rounded-r-none\">\n Respond\n </Button>\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button\n size={BUTTON_SIZES.ICON}\n disabled={disabled}\n aria-label=\"More send options\"\n className=\"w-6 rounded-l-none border-l-accent-ink/30\"\n />\n }\n >\n <ChevronDown />\n </DropdownMenuTrigger>\n <DropdownMenuContent side=\"top\" align=\"end\" className=\"w-49\">\n <DropdownMenuItem disabled={!onSubmit} onClick={() => submit(onSubmit)}>\n Skip questions and send\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n )}\n {hasContent && !onRespond && (\n <Button size={BUTTON_SIZES.SM} disabled={disabled} onClick={() => submit()}>\n Send\n </Button>\n )}\n </div>\n );\n }\n\n return (\n <Tooltip>\n <TooltipTrigger\n render={\n <button\n type=\"button\"\n data-slot=\"composer-send\"\n aria-label={isSubmitting ? \"Sending\" : \"Send\"}\n disabled={disabled || !hasContent || isSubmitting}\n onClick={() => submit()}\n className={cn(\n SEND_TILE_CLASSES,\n hasContent && !isSubmitting ? \"bg-accent text-accent-ink hover:brightness-94\" : \"bg-secondary text-faint\",\n className\n )}\n />\n }\n >\n {isSubmitting ? <Spinner className=\"size-3.5 text-ink-2\" /> : <ArrowUp />}\n </TooltipTrigger>\n <TooltipContent side=\"top\">{isSubmitting ? \"Sending\" : \"Send\"}</TooltipContent>\n </Tooltip>\n );\n}\n\nexport interface ComposerContextRingProps extends ComponentProps<\"button\"> {\n /** How full the context window is, 0–100. */\n value: number;\n}\n\n/**\n * How full the context window is: an 18px ring, `ok`, then `warn` from 80% and `danger` from 95%, with the share in its\n * tooltip. With `onClick`, or as a Popover's trigger through `render`, it's a button (a breakdown of what fills it).\n */\nexport function ComposerContextRing({ value, className, ...props }: ComposerContextRingProps) {\n const percent = Math.max(0, Math.min(100, Math.round(value)));\n const tone = percent >= CONTEXT_DANGER_PERCENT ? \"stroke-danger\" : percent >= CONTEXT_WARN_PERCENT ? \"stroke-warn\" : \"stroke-ok\";\n const label =\n percent >= CONTEXT_WARN_PERCENT ? `Context ${percent}% full · older messages get summarised` : `Context ${percent}% full`;\n const ringClassName = cn(\n \"inline-grid size-7 shrink-0 place-items-center rounded-md outline-none focus-visible:ring-2 focus-visible:ring-accent/40\",\n className\n );\n const trigger = props.onClick ? (\n <button type=\"button\" data-slot=\"composer-context-ring\" aria-label={label} className={cn(ringClassName, \"cursor-pointer hover:bg-hover\")} {...props} />\n ) : (\n <span data-slot=\"composer-context-ring\" tabIndex={0} role=\"img\" aria-label={label} className={ringClassName} />\n );\n\n return (\n <Tooltip>\n <TooltipTrigger render={trigger}>\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" className=\"-rotate-90\" aria-hidden=\"true\">\n <circle cx=\"9\" cy=\"9\" r={CONTEXT_RING_RADIUS} fill=\"none\" strokeWidth=\"2.5\" className=\"stroke-line\" />\n <circle\n cx=\"9\"\n cy=\"9\"\n r={CONTEXT_RING_RADIUS}\n fill=\"none\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeDasharray={CONTEXT_RING_CIRCUMFERENCE}\n strokeDashoffset={CONTEXT_RING_CIRCUMFERENCE * (1 - percent / 100)}\n className={tone}\n />\n </svg>\n </TooltipTrigger>\n <TooltipContent side=\"top\">{label}</TooltipContent>\n </Tooltip>\n );\n}\n\n/** The quiet row under the box: the session's settings (model, approvals) at the start, the context ring at the end. */\nexport function ComposerFooter({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"composer-footer\"\n className={cn(\"mx-space-2 mt-space-4 flex min-h-7 items-center justify-between gap-space-6 [&>:only-child]:ml-auto\", className)}\n {...props}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { RequestCard } from "./request-card.tsx";
|
|
3
|
+
/**
|
|
4
|
+
* A request for a connector, in Major's reply: the Plug kicker “Connector”, then RequestCard parts. Compose the
|
|
5
|
+
* kind it is: a RequestCardHeader with what Major asks for (“Create a new connection”), a ConnectorRequestConnector
|
|
6
|
+
* naming the connector, and a RequestCardFooter with its actions, or ConnectorRequestConnected once it's done.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ConnectorRequest({ children, ...props }: ComponentProps<typeof RequestCard>): import("react").JSX.Element;
|
|
9
|
+
export type ConnectorRequestConnectorProps = Omit<ComponentProps<"div">, "children"> & {
|
|
10
|
+
/** The connector's logo, which fills its 32px tile. */
|
|
11
|
+
logo?: ReactNode;
|
|
12
|
+
/** An icon in place of a logo, 16px `muted`: the Database icon of a request that names no connector. */
|
|
13
|
+
icon?: ReactNode;
|
|
14
|
+
/** The connector's name (“HubSpot”). Leave it out when the request names none. */
|
|
15
|
+
name?: ReactNode;
|
|
16
|
+
/** What connecting grants (the default scope's summary), or why Major needs it. */
|
|
17
|
+
description: ReactNode;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The connector a request is for, 12px under its header: the 32px logo tile, its name in 13px semibold, and what
|
|
21
|
+
* connecting grants in 12px `muted`. With no `name` the description reads alone, in 13px `ink-2`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ConnectorRequestConnector({ logo, icon, name, description, className, ...props }: ConnectorRequestConnectorProps): import("react").JSX.Element;
|
|
24
|
+
/** “Connected” with a check, in 12px `success`: the footer of a request once the connector is set up. */
|
|
25
|
+
export declare function ConnectorRequestConnected({ className, children, ...props }: ComponentProps<"span">): import("react").JSX.Element;
|
|
26
|
+
export type ConnectorGroupProps = Omit<ComponentProps<typeof RequestCard>, "title"> & {
|
|
27
|
+
/** “Connect your apps”; “Save a login” when every row is a website login. */
|
|
28
|
+
title?: ReactNode;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Several connectors Major asks for together, in one card: its title, then one ConnectorGroupItem per connector.
|
|
32
|
+
* Each row is its own request: tapping it connects that one.
|
|
33
|
+
*/
|
|
34
|
+
export declare function ConnectorGroup({ title, children, ...props }: ConnectorGroupProps): import("react").JSX.Element;
|
|
35
|
+
export declare const CONNECTOR_GROUP_ITEM_STATUSES: {
|
|
36
|
+
/** Waiting for the person: the row is a button. */
|
|
37
|
+
readonly PENDING: "pending";
|
|
38
|
+
/** Connecting after a tap: a spinner, and the row waits. */
|
|
39
|
+
readonly CONNECTING: "connecting";
|
|
40
|
+
/** Done: a `success` check. */
|
|
41
|
+
readonly CONNECTED: "connected";
|
|
42
|
+
/** Declined: the row fades to 50%. */
|
|
43
|
+
readonly DECLINED: "declined";
|
|
44
|
+
};
|
|
45
|
+
export type ConnectorGroupItemStatus = (typeof CONNECTOR_GROUP_ITEM_STATUSES)[keyof typeof CONNECTOR_GROUP_ITEM_STATUSES];
|
|
46
|
+
export type ConnectorGroupItemProps = Omit<ComponentProps<"button">, "title" | "children"> & {
|
|
47
|
+
/** The connector's logo (or a site's icon), which fills its 32px tile. */
|
|
48
|
+
logo: ReactNode;
|
|
49
|
+
/** The connector or site: “HubSpot”, “app.example.com”. */
|
|
50
|
+
title: ReactNode;
|
|
51
|
+
/** The account, what connecting grants, or “Add login”. */
|
|
52
|
+
description: ReactNode;
|
|
53
|
+
status?: ConnectorGroupItemStatus;
|
|
54
|
+
/** A follow-up step under the row, such as the product's spreadsheet picker. */
|
|
55
|
+
action?: ReactNode;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* One connector in a ConnectorGroup: a row button with the 32px logo tile, the name in 13px semibold and a 12px
|
|
59
|
+
* `muted` line, then its state. Only a pending row that isn't `disabled` takes a tap; it fills with `hover` under the
|
|
60
|
+
* pointer.
|
|
61
|
+
*/
|
|
62
|
+
export declare function ConnectorGroupItem({ logo, title, description, status, action, disabled, className, ...props }: ConnectorGroupItemProps): import("react").JSX.Element;
|
|
63
|
+
//# sourceMappingURL=connector-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector-request.d.ts","sourceRoot":"","sources":["../../src/components/connector-request.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,EAAE,WAAW,EAA2E,MAAM,oBAAoB,CAAC;AAW1H;;;;GAIG;AACH,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EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAC3F,0EAA0E;IAC1E,IAAI,EAAE,SAAS,CAAC;IAChB,2DAA2D;IAC3D,KAAK,EAAE,SAAS,CAAC;IACjB,2DAA2D;IAC3D,WAAW,EAAE,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC,gFAAgF;IAChF,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,KAAK,EACL,WAAW,EACX,MAA8C,EAC9C,MAAM,EACN,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,uBAAuB,+BAqCzB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Check, Plug } from "lucide-react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { RequestCard, RequestCardBody, RequestCardHeader, RequestCardKicker, RequestCardTitle } from "./request-card.js";
|
|
6
|
+
import { Spinner } from "./spinner.js";
|
|
7
|
+
/** The 32px frame a connector's logo sits in: a `line` border on `surface`, the logo filling it inside 6px. */
|
|
8
|
+
const LOGO_TILE_CLASSES = "grid size-8 shrink-0 place-items-center overflow-hidden rounded-lg border border-line bg-surface p-1.5 *:size-full";
|
|
9
|
+
/** The same frame around a 16px `muted` icon, for a request that names no connector. */
|
|
10
|
+
const ICON_TILE_CLASSES = "grid size-8 shrink-0 place-items-center rounded-lg border border-line bg-surface text-muted [&_svg]:size-4";
|
|
11
|
+
/**
|
|
12
|
+
* A request for a connector, in Major's reply: the Plug kicker “Connector”, then RequestCard parts. Compose the
|
|
13
|
+
* kind it is: a RequestCardHeader with what Major asks for (“Create a new connection”), a ConnectorRequestConnector
|
|
14
|
+
* naming the connector, and a RequestCardFooter with its actions, or ConnectorRequestConnected once it's done.
|
|
15
|
+
*/
|
|
16
|
+
export function ConnectorRequest({ children, ...props }) {
|
|
17
|
+
return (_jsxs(RequestCard, { "aria-label": "Connector request", ...props, children: [_jsxs(RequestCardKicker, { children: [_jsx(Plug, {}), "Connector"] }), children] }));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The connector a request is for, 12px under its header: the 32px logo tile, its name in 13px semibold, and what
|
|
21
|
+
* connecting grants in 12px `muted`. With no `name` the description reads alone, in 13px `ink-2`.
|
|
22
|
+
*/
|
|
23
|
+
export function ConnectorRequestConnector({ logo, icon, name, description, className, ...props }) {
|
|
24
|
+
const hasName = name !== undefined && name !== null;
|
|
25
|
+
return (_jsxs(RequestCardBody, { "data-slot": "connector-request-connector", className: cn("flex min-w-0 items-center gap-space-10", className), ...props, children: [logo ? (_jsx("span", { "aria-hidden": true, className: LOGO_TILE_CLASSES, children: logo })) : (_jsx("span", { "aria-hidden": true, className: ICON_TILE_CLASSES, children: icon })), hasName ? (_jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx("p", { className: "m-0 truncate text-ui-strong text-ink", children: name }), _jsx("p", { className: "m-0 text-small text-muted", children: description })] })) : (_jsx("p", { className: "m-0 text-ui text-ink-2", children: description }))] }));
|
|
26
|
+
}
|
|
27
|
+
/** “Connected” with a check, in 12px `success`: the footer of a request once the connector is set up. */
|
|
28
|
+
export function ConnectorRequestConnected({ className, children = "Connected", ...props }) {
|
|
29
|
+
return (_jsxs("span", { "data-slot": "connector-request-connected", className: cn("flex items-center gap-space-4 text-small font-medium text-success", className), ...props, children: [_jsx(Check, { "aria-hidden": true, className: "size-3.5" }), children] }));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Several connectors Major asks for together, in one card: its title, then one ConnectorGroupItem per connector.
|
|
33
|
+
* Each row is its own request: tapping it connects that one.
|
|
34
|
+
*/
|
|
35
|
+
export function ConnectorGroup({ title = "Connect your apps", children, ...props }) {
|
|
36
|
+
return (_jsxs(RequestCard, { "aria-label": typeof title === "string" ? title : undefined, ...props, children: [_jsx(RequestCardHeader, { children: _jsx(RequestCardTitle, { children: title }) }), _jsx("div", { "data-slot": "connector-group-items", className: "flex flex-col gap-px p-space-6", children: children })] }));
|
|
37
|
+
}
|
|
38
|
+
export const CONNECTOR_GROUP_ITEM_STATUSES = {
|
|
39
|
+
/** Waiting for the person: the row is a button. */
|
|
40
|
+
PENDING: "pending",
|
|
41
|
+
/** Connecting after a tap: a spinner, and the row waits. */
|
|
42
|
+
CONNECTING: "connecting",
|
|
43
|
+
/** Done: a `success` check. */
|
|
44
|
+
CONNECTED: "connected",
|
|
45
|
+
/** Declined: the row fades to 50%. */
|
|
46
|
+
DECLINED: "declined",
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* One connector in a ConnectorGroup: a row button with the 32px logo tile, the name in 13px semibold and a 12px
|
|
50
|
+
* `muted` line, then its state. Only a pending row that isn't `disabled` takes a tap; it fills with `hover` under the
|
|
51
|
+
* pointer.
|
|
52
|
+
*/
|
|
53
|
+
export function ConnectorGroupItem({ logo, title, description, status = CONNECTOR_GROUP_ITEM_STATUSES.PENDING, action, disabled, className, ...props }) {
|
|
54
|
+
const isTappable = status === CONNECTOR_GROUP_ITEM_STATUSES.PENDING && !disabled;
|
|
55
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", "data-slot": "connector-group-item", "data-status": status, disabled: !isTappable, className: cn("flex w-full items-center gap-space-10 rounded-row px-space-8 py-space-6 text-left font-sans outline-none transition-colors focus-visible:ring-2 focus-visible:ring-faint", isTappable && "cursor-pointer hover:bg-hover", status === CONNECTOR_GROUP_ITEM_STATUSES.DECLINED && "opacity-50", className), ...props, children: [_jsx("span", { "aria-hidden": true, className: LOGO_TILE_CLASSES, children: logo }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "truncate text-ui-strong text-ink", children: title }), _jsx("span", { className: "truncate text-small text-muted", children: description })] }), status === CONNECTOR_GROUP_ITEM_STATUSES.CONNECTING && _jsx(Spinner, { className: "size-4 shrink-0 text-muted" }), status === CONNECTOR_GROUP_ITEM_STATUSES.CONNECTED && (_jsxs(_Fragment, { children: [_jsx(Check, { "aria-hidden": true, className: "size-4 shrink-0 text-success", strokeWidth: 1.75 }), _jsx("span", { className: "sr-only", children: "Connected" })] })), status === CONNECTOR_GROUP_ITEM_STATUSES.DECLINED && _jsx("span", { className: "sr-only", children: "Declined" })] }), action && _jsx("div", { className: "px-space-8 pb-space-6", children: action })] }));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=connector-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector-request.js","sourceRoot":"","sources":["../../src/components/connector-request.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAoB,CAAC;AAC1H,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AAExC,+GAA+G;AAC/G,MAAM,iBAAiB,GACrB,oHAAoH,CAAC;AAEvH,wFAAwF;AACxF,MAAM,iBAAiB,GACrB,4GAA4G,CAAC;AAE/G;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAsC;IACzF,OAAO,CACL,MAAC,WAAW,kBAAY,mBAAmB,KAAK,KAAK,aACnD,MAAC,iBAAiB,eAChB,KAAC,IAAI,KAAG,iBAEU,EACnB,QAAQ,IACG,CACf,CAAC;AACJ,CAAC;AAaD;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,K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F,eAAM,SAAS,EAAC,SAAS,0BAAiB,IACzC,CACJ,EACA,MAAM,KAAK,6BAA6B,CAAC,QAAQ,IAAI,eAAM,SAAS,EAAC,SAAS,yBAAgB,IACxF,EACR,MAAM,IAAI,cAAK,SAAS,EAAC,uBAAuB,YAAE,MAAM,GAAO,IAC/D,CACJ,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { Check, Plug } from \"lucide-react\";\nimport { cn } from \"../lib/cn.ts\";\nimport { RequestCard, RequestCardBody, RequestCardHeader, RequestCardKicker, RequestCardTitle } from \"./request-card.tsx\";\nimport { Spinner } from \"./spinner.tsx\";\n\n/** The 32px frame a connector's logo sits in: a `line` border on `surface`, the logo filling it inside 6px. */\nconst LOGO_TILE_CLASSES =\n \"grid size-8 shrink-0 place-items-center overflow-hidden rounded-lg border border-line bg-surface p-1.5 *:size-full\";\n\n/** The same frame around a 16px `muted` icon, for a request that names no connector. */\nconst ICON_TILE_CLASSES =\n \"grid size-8 shrink-0 place-items-center rounded-lg border border-line bg-surface text-muted [&_svg]:size-4\";\n\n/**\n * A request for a connector, in Major's reply: the Plug kicker “Connector”, then RequestCard parts. Compose the\n * kind it is: a RequestCardHeader with what Major asks for (“Create a new connection”), a ConnectorRequestConnector\n * naming the connector, and a RequestCardFooter with its actions, or ConnectorRequestConnected once it's done.\n */\nexport function ConnectorRequest({ children, ...props }: ComponentProps<typeof RequestCard>) {\n return (\n <RequestCard aria-label=\"Connector request\" {...props}>\n <RequestCardKicker>\n <Plug />\n Connector\n </RequestCardKicker>\n {children}\n </RequestCard>\n );\n}\n\nexport type ConnectorRequestConnectorProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n /** The connector's logo, which fills its 32px tile. */\n logo?: ReactNode;\n /** An icon in place of a logo, 16px `muted`: the Database icon of a request that names no connector. */\n icon?: ReactNode;\n /** The connector's name (“HubSpot”). Leave it out when the request names none. */\n name?: ReactNode;\n /** What connecting grants (the default scope's summary), or why Major needs it. */\n description: ReactNode;\n};\n\n/**\n * The connector a request is for, 12px under its header: the 32px logo tile, its name in 13px semibold, and what\n * connecting grants in 12px `muted`. With no `name` the description reads alone, in 13px `ink-2`.\n */\nexport function ConnectorRequestConnector({ logo, icon, name, description, className, ...props }: ConnectorRequestConnectorProps) {\n const hasName = name !== undefined && name !== null;\n\n return (\n <RequestCardBody\n data-slot=\"connector-request-connector\"\n className={cn(\"flex min-w-0 items-center gap-space-10\", className)}\n {...props}\n >\n {logo ? (\n <span aria-hidden className={LOGO_TILE_CLASSES}>\n {logo}\n </span>\n ) : (\n <span aria-hidden className={ICON_TILE_CLASSES}>\n {icon}\n </span>\n )}\n {hasName ? (\n <div className=\"flex min-w-0 flex-col\">\n <p className=\"m-0 truncate text-ui-strong text-ink\">{name}</p>\n <p className=\"m-0 text-small text-muted\">{description}</p>\n </div>\n ) : (\n <p className=\"m-0 text-ui text-ink-2\">{description}</p>\n )}\n </RequestCardBody>\n );\n}\n\n/** “Connected” with a check, in 12px `success`: the footer of a request once the connector is set up. */\nexport function ConnectorRequestConnected({ className, children = \"Connected\", ...props }: ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"connector-request-connected\"\n className={cn(\"flex items-center gap-space-4 text-small font-medium text-success\", className)}\n {...props}\n >\n <Check aria-hidden className=\"size-3.5\" />\n {children}\n </span>\n );\n}\n\nexport type ConnectorGroupProps = Omit<ComponentProps<typeof RequestCard>, \"title\"> & {\n /** “Connect your apps”; “Save a login” when every row is a website login. */\n title?: ReactNode;\n};\n\n/**\n * Several connectors Major asks for together, in one card: its title, then one ConnectorGroupItem per connector.\n * Each row is its own request: tapping it connects that one.\n */\nexport function ConnectorGroup({ title = \"Connect your apps\", children, ...props }: ConnectorGroupProps) {\n return (\n <RequestCard aria-label={typeof title === \"string\" ? title : undefined} {...props}>\n <RequestCardHeader>\n <RequestCardTitle>{title}</RequestCardTitle>\n </RequestCardHeader>\n <div data-slot=\"connector-group-items\" className=\"flex flex-col gap-px p-space-6\">\n {children}\n </div>\n </RequestCard>\n );\n}\n\nexport const CONNECTOR_GROUP_ITEM_STATUSES = {\n /** Waiting for the person: the row is a button. */\n PENDING: \"pending\",\n /** Connecting after a tap: a spinner, and the row waits. */\n CONNECTING: \"connecting\",\n /** Done: a `success` check. */\n CONNECTED: \"connected\",\n /** Declined: the row fades to 50%. */\n DECLINED: \"declined\",\n} as const;\n\nexport type ConnectorGroupItemStatus = (typeof CONNECTOR_GROUP_ITEM_STATUSES)[keyof typeof CONNECTOR_GROUP_ITEM_STATUSES];\n\nexport type ConnectorGroupItemProps = Omit<ComponentProps<\"button\">, \"title\" | \"children\"> & {\n /** The connector's logo (or a site's icon), which fills its 32px tile. */\n logo: ReactNode;\n /** The connector or site: “HubSpot”, “app.example.com”. */\n title: ReactNode;\n /** The account, what connecting grants, or “Add login”. */\n description: ReactNode;\n status?: ConnectorGroupItemStatus;\n /** A follow-up step under the row, such as the product's spreadsheet picker. */\n action?: ReactNode;\n};\n\n/**\n * One connector in a ConnectorGroup: a row button with the 32px logo tile, the name in 13px semibold and a 12px\n * `muted` line, then its state. Only a pending row that isn't `disabled` takes a tap; it fills with `hover` under the\n * pointer.\n */\nexport function ConnectorGroupItem({\n logo,\n title,\n description,\n status = CONNECTOR_GROUP_ITEM_STATUSES.PENDING,\n action,\n disabled,\n className,\n ...props\n}: ConnectorGroupItemProps) {\n const isTappable = status === CONNECTOR_GROUP_ITEM_STATUSES.PENDING && !disabled;\n\n return (\n <>\n <button\n type=\"button\"\n data-slot=\"connector-group-item\"\n data-status={status}\n disabled={!isTappable}\n className={cn(\n \"flex w-full items-center gap-space-10 rounded-row px-space-8 py-space-6 text-left font-sans outline-none transition-colors focus-visible:ring-2 focus-visible:ring-faint\",\n isTappable && \"cursor-pointer hover:bg-hover\",\n status === CONNECTOR_GROUP_ITEM_STATUSES.DECLINED && \"opacity-50\",\n className\n )}\n {...props}\n >\n <span aria-hidden className={LOGO_TILE_CLASSES}>\n {logo}\n </span>\n <span className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"truncate text-ui-strong text-ink\">{title}</span>\n <span className=\"truncate text-small text-muted\">{description}</span>\n </span>\n {status === CONNECTOR_GROUP_ITEM_STATUSES.CONNECTING && <Spinner className=\"size-4 shrink-0 text-muted\" />}\n {status === CONNECTOR_GROUP_ITEM_STATUSES.CONNECTED && (\n <>\n <Check aria-hidden className=\"size-4 shrink-0 text-success\" strokeWidth={1.75} />\n <span className=\"sr-only\">Connected</span>\n </>\n )}\n {status === CONNECTOR_GROUP_ITEM_STATUSES.DECLINED && <span className=\"sr-only\">Declined</span>}\n </button>\n {action && <div className=\"px-space-8 pb-space-6\">{action}</div>}\n </>\n );\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";
|
|
2
|
+
import { DropdownMenuCheckboxItem, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger } from "./dropdown-menu.tsx";
|
|
3
|
+
/** Root of a right-click menu: DropdownMenu's sheet and rows, opened at the pointer instead of from a button. */
|
|
4
|
+
export declare function ContextMenu(props: ContextMenuPrimitive.Root.Props): import("react").JSX.Element;
|
|
5
|
+
/**
|
|
6
|
+
* The area a right click (or a long press on touch) opens the menu on: a file row, a canvas node. A `<div>` unless
|
|
7
|
+
* `render` gives the element itself.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ContextMenuTrigger(props: ContextMenuPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
10
|
+
type ContextMenuContentProps = ContextMenuPrimitive.Popup.Props & Pick<ContextMenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset" | "collisionPadding">;
|
|
11
|
+
/** The menu sheet at the pointer: 196px for the usual few actions; it scrolls when it runs out of room. */
|
|
12
|
+
export declare function ContextMenuContent({ className, side, sideOffset, align, alignOffset, collisionPadding, children, ...props }: ContextMenuContentProps): import("react").JSX.Element;
|
|
13
|
+
/** DropdownMenu's rows, under the names of this menu: the same parts, so the two menus never drift apart. */
|
|
14
|
+
export declare const ContextMenuItem: typeof DropdownMenuItem;
|
|
15
|
+
export declare const ContextMenuCheckboxItem: typeof DropdownMenuCheckboxItem;
|
|
16
|
+
export declare const ContextMenuRadioGroup: typeof DropdownMenuRadioGroup;
|
|
17
|
+
export declare const ContextMenuRadioItem: typeof DropdownMenuRadioItem;
|
|
18
|
+
export declare const ContextMenuGroup: typeof DropdownMenuGroup;
|
|
19
|
+
export declare const ContextMenuLabel: typeof DropdownMenuLabel;
|
|
20
|
+
export declare const ContextMenuSeparator: typeof DropdownMenuSeparator;
|
|
21
|
+
export declare const ContextMenuShortcut: typeof DropdownMenuShortcut;
|
|
22
|
+
export declare const ContextMenuSub: typeof DropdownMenuSub;
|
|
23
|
+
export declare const ContextMenuSubTrigger: typeof DropdownMenuSubTrigger;
|
|
24
|
+
export declare const ContextMenuSubContent: typeof DropdownMenuSubContent;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=context-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/components/context-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAElF,OAAO,EAEL,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAE7B,iHAAiH;AACjH,wBAAgB,WAAW,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,+BAEjE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,CAAC,OAAO,CAAC,KAAK,+BAE3E;AAED,KAAK,uBAAuB,GAAG,oBAAoB,CAAC,KAAK,CAAC,KAAK,GAC7D,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,CAAC,CAAC;AAEpH,2GAA2G;AAC3G,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,IAAI,EACJ,UAAU,EACV,KAAK,EACL,WAAW,EACX,gBAAoB,EACpB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,uBAAuB,+BAqBzB;AAED,6GAA6G;AAC7G,eAAO,MAAM,eAAe,yBAAmB,CAAC;AAChD,eAAO,MAAM,uBAAuB,iCAA2B,CAAC;AAChE,eAAO,MAAM,qBAAqB,+BAAyB,CAAC;AAC5D,eAAO,MAAM,oBAAoB,8BAAwB,CAAC;AAC1D,eAAO,MAAM,gBAAgB,0BAAoB,CAAC;AAClD,eAAO,MAAM,gBAAgB,0BAAoB,CAAC;AAClD,eAAO,MAAM,oBAAoB,8BAAwB,CAAC;AAC1D,eAAO,MAAM,mBAAmB,6BAAuB,CAAC;AACxD,eAAO,MAAM,cAAc,wBAAkB,CAAC;AAC9C,eAAO,MAAM,qBAAqB,+BAAyB,CAAC;AAC5D,eAAO,MAAM,qBAAqB,+BAAyB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { DROPDOWN_MENU_SHEET_CLASSES, DropdownMenuCheckboxItem, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, } from "./dropdown-menu.js";
|
|
6
|
+
/** Root of a right-click menu: DropdownMenu's sheet and rows, opened at the pointer instead of from a button. */
|
|
7
|
+
export function ContextMenu(props) {
|
|
8
|
+
return _jsx(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The area a right click (or a long press on touch) opens the menu on: a file row, a canvas node. A `<div>` unless
|
|
12
|
+
* `render` gives the element itself.
|
|
13
|
+
*/
|
|
14
|
+
export function ContextMenuTrigger(props) {
|
|
15
|
+
return _jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", ...props });
|
|
16
|
+
}
|
|
17
|
+
/** The menu sheet at the pointer: 196px for the usual few actions; it scrolls when it runs out of room. */
|
|
18
|
+
export function ContextMenuContent({ className, side, sideOffset, align, alignOffset, collisionPadding = 8, children, ...props }) {
|
|
19
|
+
return (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, collisionPadding: collisionPadding, className: "isolate z-50 outline-none", children: _jsx(ContextMenuPrimitive.Popup, { "data-slot": "context-menu-content", className: cn(DROPDOWN_MENU_SHEET_CLASSES, "max-h-(--available-height) w-49", className), ...props, children: children }) }) }));
|
|
20
|
+
}
|
|
21
|
+
/** DropdownMenu's rows, under the names of this menu: the same parts, so the two menus never drift apart. */
|
|
22
|
+
export const ContextMenuItem = DropdownMenuItem;
|
|
23
|
+
export const ContextMenuCheckboxItem = DropdownMenuCheckboxItem;
|
|
24
|
+
export const ContextMenuRadioGroup = DropdownMenuRadioGroup;
|
|
25
|
+
export const ContextMenuRadioItem = DropdownMenuRadioItem;
|
|
26
|
+
export const ContextMenuGroup = DropdownMenuGroup;
|
|
27
|
+
export const ContextMenuLabel = DropdownMenuLabel;
|
|
28
|
+
export const ContextMenuSeparator = DropdownMenuSeparator;
|
|
29
|
+
export const ContextMenuShortcut = DropdownMenuShortcut;
|
|
30
|
+
export const ContextMenuSub = DropdownMenuSub;
|
|
31
|
+
export const ContextMenuSubTrigger = DropdownMenuSubTrigger;
|
|
32
|
+
export const ContextMenuSubContent = DropdownMenuSubContent;
|
|
33
|
+
//# sourceMappingURL=context-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../../src/components/context-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,oBAAqB,CAAC;AAE7B,iHAAiH;AACjH,MAAM,UAAU,WAAW,CAAC,KAAsC;IAChE,OAAO,KAAC,oBAAoB,CAAC,IAAI,iBAAW,cAAc,KAAK,KAAK,GAAI,CAAC;AAC3E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAyC;IAC1E,OAAO,KAAC,oBAAoB,CAAC,OAAO,iBAAW,sBAAsB,KAAK,KAAK,GAAI,CAAC;AACtF,CAAC;AAKD,2GAA2G;AAC3G,MAAM,UAAU,kBAAkB,CAAC,EACjC,SAAS,EACT,IAAI,EACJ,UAAU,EACV,KAAK,EACL,WAAW,EACX,gBAAgB,GAAG,CAAC,EACpB,QAAQ,EACR,GAAG,KAAK,EACgB;IACxB,OAAO,CACL,KAAC,oBAAoB,CAAC,MAAM,cAC1B,KAAC,oBAAoB,CAAC,UAAU,IAC9B,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAC,2BAA2B,YAErC,KAAC,oBAAoB,CAAC,KAAK,iBACf,sBAAsB,EAChC,SAAS,EAAE,EAAE,CAAC,2BAA2B,EAAE,iCAAiC,EAAE,SAAS,CAAC,KACpF,KAAK,YAER,QAAQ,GACkB,GACG,GACN,CAC/B,CAAC;AACJ,CAAC;AAED,6GAA6G;AAC7G,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAChD,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAC5D,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAC1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AACxD,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC;AAC9C,MAAM,CAAC,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAC5D,MAAM,CAAC,MAAM,qBAAqB,GAAG,sBAAsB,CAAC","sourcesContent":["\"use client\";\n\nimport { ContextMenu as ContextMenuPrimitive } from \"@base-ui/react/context-menu\";\nimport { cn } from \"../lib/cn.ts\";\nimport {\n DROPDOWN_MENU_SHEET_CLASSES,\n DropdownMenuCheckboxItem,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n} from \"./dropdown-menu.tsx\";\n\n/** Root of a right-click menu: DropdownMenu's sheet and rows, opened at the pointer instead of from a button. */\nexport function ContextMenu(props: ContextMenuPrimitive.Root.Props) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\n/**\n * The area a right click (or a long press on touch) opens the menu on: a file row, a canvas node. A `<div>` unless\n * `render` gives the element itself.\n */\nexport function ContextMenuTrigger(props: ContextMenuPrimitive.Trigger.Props) {\n return <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" {...props} />;\n}\n\ntype ContextMenuContentProps = ContextMenuPrimitive.Popup.Props &\n Pick<ContextMenuPrimitive.Positioner.Props, \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"collisionPadding\">;\n\n/** The menu sheet at the pointer: 196px for the usual few actions; it scrolls when it runs out of room. */\nexport function ContextMenuContent({\n className,\n side,\n sideOffset,\n align,\n alignOffset,\n collisionPadding = 8,\n children,\n ...props\n}: ContextMenuContentProps) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n collisionPadding={collisionPadding}\n className=\"isolate z-50 outline-none\"\n >\n <ContextMenuPrimitive.Popup\n data-slot=\"context-menu-content\"\n className={cn(DROPDOWN_MENU_SHEET_CLASSES, \"max-h-(--available-height) w-49\", className)}\n {...props}\n >\n {children}\n </ContextMenuPrimitive.Popup>\n </ContextMenuPrimitive.Positioner>\n </ContextMenuPrimitive.Portal>\n );\n}\n\n/** DropdownMenu's rows, under the names of this menu: the same parts, so the two menus never drift apart. */\nexport const ContextMenuItem = DropdownMenuItem;\nexport const ContextMenuCheckboxItem = DropdownMenuCheckboxItem;\nexport const ContextMenuRadioGroup = DropdownMenuRadioGroup;\nexport const ContextMenuRadioItem = DropdownMenuRadioItem;\nexport const ContextMenuGroup = DropdownMenuGroup;\nexport const ContextMenuLabel = DropdownMenuLabel;\nexport const ContextMenuSeparator = DropdownMenuSeparator;\nexport const ContextMenuShortcut = DropdownMenuShortcut;\nexport const ContextMenuSub = DropdownMenuSub;\nexport const ContextMenuSubTrigger = DropdownMenuSubTrigger;\nexport const ContextMenuSubContent = DropdownMenuSubContent;\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ColumnDef, type Row, type RowData, type Table as TanstackTable } from "@tanstack/react-table";
|
|
3
|
+
/**
|
|
4
|
+
* Per-column presentation the table applies to both ends: the header lays its label and sort icon out in a
|
|
5
|
+
* flex row, so a `text-right` inside the label alone would leave the header on the left.
|
|
6
|
+
*/
|
|
7
|
+
declare module "@tanstack/react-table" {
|
|
8
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
9
|
+
/** Right-align the header and the cells: amounts, durations, counts. */
|
|
10
|
+
align?: "left" | "right";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** The id of the chevron column made by `createDataTableExpandColumn`. */
|
|
14
|
+
export declare const DATA_TABLE_EXPAND_COLUMN_ID = "expand";
|
|
15
|
+
export declare const DATA_TABLE_DENSITIES: {
|
|
16
|
+
/** 56px rows: two-line cells, the audit log. */
|
|
17
|
+
readonly DEFAULT: "default";
|
|
18
|
+
/** 36px rows: one-line figures in a dashboard, the analytics runs. */
|
|
19
|
+
readonly COMPACT: "compact";
|
|
20
|
+
};
|
|
21
|
+
export type DataTableDensity = (typeof DATA_TABLE_DENSITIES)[keyof typeof DATA_TABLE_DENSITIES];
|
|
22
|
+
/** The chevron column for tables whose rows expand. Its click toggles the row without opening anything. */
|
|
23
|
+
declare function createDataTableExpandColumn<TData>(): ColumnDef<TData, unknown>;
|
|
24
|
+
export interface DataTableProps<TData> {
|
|
25
|
+
/** The TanStack table instance. The caller owns it, so paging and sorting stay wherever they already live. */
|
|
26
|
+
table: TanstackTable<TData>;
|
|
27
|
+
/** Drawn full-width under an expanded row. */
|
|
28
|
+
renderExpandedRow?: (row: Row<TData>) => ReactNode;
|
|
29
|
+
/** Makes whole rows clickable: open the detail page, or toggle the row. */
|
|
30
|
+
onRowClick?: (row: Row<TData>) => void;
|
|
31
|
+
/** Skeleton rows while there's nothing yet; a dimmed body while a refetch replaces rows. */
|
|
32
|
+
isLoading?: boolean;
|
|
33
|
+
density?: DataTableDensity;
|
|
34
|
+
/** On the scroll container: the card frame, a max height. */
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A TanStack table drawn with the Table parts: sortable headers, rows that expand in place under themselves,
|
|
39
|
+
* and skeleton rows while the first page loads.
|
|
40
|
+
*/
|
|
41
|
+
declare function DataTable<TData>({ table, renderExpandedRow, onRowClick, isLoading, density, className, }: DataTableProps<TData>): import("react").JSX.Element;
|
|
42
|
+
export interface NameCellProps {
|
|
43
|
+
/** The tile's letter: "M" for Gmail. Omit when passing `icon`. */
|
|
44
|
+
letter?: string;
|
|
45
|
+
/** The brand colour behind the letter. */
|
|
46
|
+
color?: string;
|
|
47
|
+
/** An icon tile for things you build yourself: Custom API, MCP, Webhook. */
|
|
48
|
+
icon?: ReactNode;
|
|
49
|
+
/** The name, 14px medium. */
|
|
50
|
+
name: ReactNode;
|
|
51
|
+
/** A `muted` second line: "Signed in as maya@acme.co". */
|
|
52
|
+
detail?: ReactNode;
|
|
53
|
+
/** No access: the tile and the name dim and a lock follows the name. Say "No access" in place of the row's controls. */
|
|
54
|
+
locked?: boolean;
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
/** The first cell of a row of things: a 28px BrandTile, the name, an optional second line. */
|
|
58
|
+
declare function NameCell({ letter, color, icon, name, detail, locked, className }: NameCellProps): import("react").JSX.Element;
|
|
59
|
+
export { DataTable, createDataTableExpandColumn, NameCell };
|
|
60
|
+
export { getCoreRowModel, getExpandedRowModel, getPaginationRowModel, getSortedRowModel, useReactTable, type ColumnDef, type ExpandedState, type PaginationState, type Row, type SortingState, } from "@tanstack/react-table";
|
|
61
|
+
//# sourceMappingURL=data-table.d.ts.map
|
|
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AAED;;;GAGG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE,EACxB,KAAK,EACL,iBAAiB,EACjB,UAAU,EACV,SAAiB,EACjB,OAAsC,EACtC,SAAS,GACV,EAAE,cAAc,CAAC,KAAK,CAAC,+BA0FvB;AAcD,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,6BAA6B;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,wHAAwH;IACxH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,8FAA8F;AAC9F,iBAAS,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAc,EAAE,SAAS,EAAE,EAAE,aAAa,+BAahG;AAED,OAAO,EAAE,SAAS,EAAE,2BAA2B,EAAE,QAAQ,EAAE,CAAC;AAI5D,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,GAAG,EACR,KAAK,YAAY,GAClB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Fragment } from "react";
|
|
4
|
+
import { flexRender } from "@tanstack/react-table";
|
|
5
|
+
import { ArrowUpDown, ChevronDown, ChevronRight, ChevronUp, Lock } from "lucide-react";
|
|
6
|
+
import { cn } from "../lib/cn.js";
|
|
7
|
+
import { BrandTile } from "./brand-tile.js";
|
|
8
|
+
import { BUTTON_SIZES, BUTTON_VARIANTS, Button } from "./button.js";
|
|
9
|
+
import { Skeleton } from "./skeleton.js";
|
|
10
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "./table.js";
|
|
11
|
+
/** The id of the chevron column made by `createDataTableExpandColumn`. */
|
|
12
|
+
export const DATA_TABLE_EXPAND_COLUMN_ID = "expand";
|
|
13
|
+
const SKELETON_ROW_COUNT = 5;
|
|
14
|
+
export const DATA_TABLE_DENSITIES = {
|
|
15
|
+
/** 56px rows: two-line cells, the audit log. */
|
|
16
|
+
DEFAULT: "default",
|
|
17
|
+
/** 36px rows: one-line figures in a dashboard, the analytics runs. */
|
|
18
|
+
COMPACT: "compact",
|
|
19
|
+
};
|
|
20
|
+
const DENSITY_CLASSES = {
|
|
21
|
+
[DATA_TABLE_DENSITIES.DEFAULT]: { head: "", cell: "" },
|
|
22
|
+
[DATA_TABLE_DENSITIES.COMPACT]: { head: "h-8", cell: "h-9" },
|
|
23
|
+
};
|
|
24
|
+
const SORT_DIRECTIONS = { ASC: "asc", DESC: "desc" };
|
|
25
|
+
/** The chevron column for tables whose rows expand. Its click toggles the row without opening anything. */
|
|
26
|
+
function createDataTableExpandColumn() {
|
|
27
|
+
return {
|
|
28
|
+
id: DATA_TABLE_EXPAND_COLUMN_ID,
|
|
29
|
+
header: () => null,
|
|
30
|
+
// Read here, not in the button: the row object never changes, so a compiled button would keep
|
|
31
|
+
// its first answer and the chevron would never turn.
|
|
32
|
+
cell: ({ row }) => _jsx(ExpandRowButton, { isExpanded: row.getIsExpanded(), onToggle: row.toggleExpanded }),
|
|
33
|
+
enableSorting: false,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function ExpandRowButton({ isExpanded, onToggle }) {
|
|
37
|
+
const handleClick = (event) => {
|
|
38
|
+
event.stopPropagation();
|
|
39
|
+
onToggle();
|
|
40
|
+
};
|
|
41
|
+
return (_jsx(Button, { variant: BUTTON_VARIANTS.GHOST, size: BUTTON_SIZES.ICON_SM, "aria-label": isExpanded ? "Collapse row" : "Expand row", "aria-expanded": isExpanded, onClick: handleClick, children: _jsx(ChevronRight, { className: cn("text-muted transition-transform duration-150", isExpanded && "rotate-90") }) }));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A TanStack table drawn with the Table parts: sortable headers, rows that expand in place under themselves,
|
|
45
|
+
* and skeleton rows while the first page loads.
|
|
46
|
+
*/
|
|
47
|
+
function DataTable({ table, renderExpandedRow, onRowClick, isLoading = false, density = DATA_TABLE_DENSITIES.DEFAULT, className, }) {
|
|
48
|
+
// The table instance is mutable and read during render; memoising hands back stale rows.
|
|
49
|
+
"use no memo";
|
|
50
|
+
const rows = table.getRowModel().rows;
|
|
51
|
+
const columnCount = table.getVisibleLeafColumns().length;
|
|
52
|
+
const isSkeletonVisible = isLoading && rows.length === 0;
|
|
53
|
+
const densityClasses = DENSITY_CLASSES[density];
|
|
54
|
+
return (_jsxs(Table, { containerClassName: className, children: [_jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { children: headerGroup.headers.map((header) => {
|
|
55
|
+
const isRightAligned = header.column.columnDef.meta?.align === "right";
|
|
56
|
+
const isExpandColumn = header.column.id === DATA_TABLE_EXPAND_COLUMN_ID;
|
|
57
|
+
const label = !header.isPlaceholder && flexRender(header.column.columnDef.header, header.getContext());
|
|
58
|
+
return (_jsx(TableHead, { className: cn(densityClasses.head, isRightAligned && "text-right", isExpandColumn && "w-9 pr-0"), children: header.column.getCanSort() ? (_jsxs("button", { type: "button", onClick: header.column.getToggleSortingHandler(), className: cn("inline-flex cursor-pointer items-center gap-space-4 rounded-sm outline-none transition-colors hover:text-ink focus-visible:ring-2 focus-visible:ring-faint", isRightAligned && "flex-row-reverse"), children: [label, _jsx(SortIcon, { direction: header.column.getIsSorted() })] })) : (label) }, header.id));
|
|
59
|
+
}) }, headerGroup.id))) }), _jsxs(TableBody, { className: cn(isLoading && !isSkeletonVisible && "opacity-60 transition-opacity"), children: [isSkeletonVisible &&
|
|
60
|
+
Array.from({ length: SKELETON_ROW_COUNT }, (_, rowIndex) => (_jsx(TableRow, { className: "hover:bg-transparent", children: Array.from({ length: columnCount }, (_, cellIndex) => (_jsx(TableCell, { className: densityClasses.cell, children: _jsx(Skeleton, { className: "w-full max-w-24" }) }, cellIndex))) }, rowIndex))), rows.map((row) => (_jsxs(Fragment, { children: [_jsx(TableRow, { className: cn(onRowClick && "cursor-pointer", row.getIsExpanded() && "hover:bg-transparent"), onClick: onRowClick ? () => onRowClick(row) : undefined, children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { className: cn(densityClasses.cell, cell.column.columnDef.meta?.align === "right" && "text-right", cell.column.id === DATA_TABLE_EXPAND_COLUMN_ID && "w-9 pr-0"), children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }), row.getIsExpanded() && renderExpandedRow !== undefined && (_jsx(TableRow, { className: "border-t-0 hover:bg-transparent", children: _jsx(TableCell, { colSpan: columnCount, className: "h-auto p-0", children: renderExpandedRow(row) }) }))] }, row.id)))] })] }));
|
|
61
|
+
}
|
|
62
|
+
function SortIcon({ direction }) {
|
|
63
|
+
if (direction === SORT_DIRECTIONS.ASC) {
|
|
64
|
+
return _jsx(ChevronUp, { className: "size-3.5 text-ink-2" });
|
|
65
|
+
}
|
|
66
|
+
if (direction === SORT_DIRECTIONS.DESC) {
|
|
67
|
+
return _jsx(ChevronDown, { className: "size-3.5 text-ink-2" });
|
|
68
|
+
}
|
|
69
|
+
return _jsx(ArrowUpDown, { className: "size-3.25 text-faint" });
|
|
70
|
+
}
|
|
71
|
+
/** The first cell of a row of things: a 28px BrandTile, the name, an optional second line. */
|
|
72
|
+
function NameCell({ letter, color, icon, name, detail, locked = false, className }) {
|
|
73
|
+
return (_jsxs("span", { "data-slot": "name-cell", className: cn("flex min-w-0 items-center gap-space-12", className), children: [_jsx(BrandTile, { letter: letter, color: color, icon: icon, className: cn(locked && "opacity-55") }), _jsxs("span", { className: "flex min-w-0 flex-col gap-px", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-space-8", children: [_jsx("span", { className: cn("truncate text-body font-medium leading-auto text-ink", locked && "opacity-55"), children: name }), locked && _jsx(Lock, { role: "img", "aria-label": "No access", className: "size-3.25 shrink-0 text-muted" })] }), detail && _jsx("span", { className: "truncate text-small text-muted", children: detail })] })] }));
|
|
74
|
+
}
|
|
75
|
+
export { DataTable, createDataTableExpandColumn, NameCell };
|
|
76
|
+
// The TanStack pieces a DataTable caller needs, from the same copy the table is drawn with, so a product
|
|
77
|
+
// doesn't have to add @tanstack/react-table at a matching version itself.
|
|
78
|
+
export { getCoreRowModel, getExpandedRowModel, getPaginationRowModel, getSortedRowModel, useReactTable, } from "@tanstack/react-table";
|
|
79
|
+
//# sourceMappingURL=data-table.js.map
|