@major-tech/ui 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/THIRD_PARTY_NOTICES.md +27 -0
- package/dist/components/accordion.d.ts +33 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +51 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/activity-chart.d.ts +26 -0
- package/dist/components/activity-chart.d.ts.map +1 -0
- package/dist/components/activity-chart.js +56 -0
- package/dist/components/activity-chart.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +28 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +51 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +34 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +59 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/ask-user-question.d.ts +103 -0
- package/dist/components/ask-user-question.d.ts.map +1 -0
- package/dist/components/ask-user-question.js +401 -0
- package/dist/components/ask-user-question.js.map +1 -0
- package/dist/components/attachment-gallery.d.ts +137 -0
- package/dist/components/attachment-gallery.d.ts.map +1 -0
- package/dist/components/attachment-gallery.js +317 -0
- package/dist/components/attachment-gallery.js.map +1 -0
- package/dist/components/avatar.d.ts +37 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +62 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +29 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +50 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/brand-tile.d.ts +33 -0
- package/dist/components/brand-tile.d.ts.map +1 -0
- package/dist/components/brand-tile.js +36 -0
- package/dist/components/brand-tile.js.map +1 -0
- package/dist/components/button.d.ts +51 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +90 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +18 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +78 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +18 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +34 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +48 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +227 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/catalog-card.d.ts +29 -0
- package/dist/components/catalog-card.d.ts.map +1 -0
- package/dist/components/catalog-card.js +20 -0
- package/dist/components/catalog-card.js.map +1 -0
- package/dist/components/chart.d.ts +118 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +209 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +8 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +14 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/chip.d.ts +68 -0
- package/dist/components/chip.d.ts.map +1 -0
- package/dist/components/chip.js +100 -0
- package/dist/components/chip.js.map +1 -0
- package/dist/components/code-block.d.ts +99 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +144 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/collapsible.d.ts +17 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +25 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/command.d.ts +51 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +120 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/composer.d.ts +211 -0
- package/dist/components/composer.d.ts.map +1 -0
- package/dist/components/composer.js +605 -0
- package/dist/components/composer.js.map +1 -0
- package/dist/components/connector-request.d.ts +63 -0
- package/dist/components/connector-request.d.ts.map +1 -0
- package/dist/components/connector-request.js +57 -0
- package/dist/components/connector-request.js.map +1 -0
- package/dist/components/context-menu.d.ts +26 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +33 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/data-table.d.ts +61 -0
- package/dist/components/data-table.d.ts.map +1 -0
- package/dist/components/data-table.js +79 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/date-range-picker.d.ts +54 -0
- package/dist/components/date-range-picker.d.ts.map +1 -0
- package/dist/components/date-range-picker.js +451 -0
- package/dist/components/date-range-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +46 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +75 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.d.ts +85 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +166 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +77 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +112 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/editor-tabs.d.ts +49 -0
- package/dist/components/editor-tabs.d.ts.map +1 -0
- package/dist/components/editor-tabs.js +157 -0
- package/dist/components/editor-tabs.js.map +1 -0
- package/dist/components/empty-state.d.ts +21 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state.js +14 -0
- package/dist/components/empty-state.js.map +1 -0
- package/dist/components/entity-card.d.ts +301 -0
- package/dist/components/entity-card.d.ts.map +1 -0
- package/dist/components/entity-card.js +392 -0
- package/dist/components/entity-card.js.map +1 -0
- package/dist/components/entity-row.d.ts +37 -0
- package/dist/components/entity-row.d.ts.map +1 -0
- package/dist/components/entity-row.js +65 -0
- package/dist/components/entity-row.js.map +1 -0
- package/dist/components/env-var-request.d.ts +51 -0
- package/dist/components/env-var-request.d.ts.map +1 -0
- package/dist/components/env-var-request.js +50 -0
- package/dist/components/env-var-request.js.map +1 -0
- package/dist/components/field.d.ts +30 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +48 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/file-upload.d.ts +108 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload.js +217 -0
- package/dist/components/file-upload.js.map +1 -0
- package/dist/components/hover-card.d.ts +18 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +84 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +29 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +61 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input.d.ts +9 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +13 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/island.d.ts +18 -0
- package/dist/components/island.d.ts.map +1 -0
- package/dist/components/island.js +30 -0
- package/dist/components/island.js.map +1 -0
- package/dist/components/kbd.d.ts +7 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +11 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +8 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +12 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/markdown.d.ts +24 -0
- package/dist/components/markdown.d.ts.map +1 -0
- package/dist/components/markdown.js +38 -0
- package/dist/components/markdown.js.map +1 -0
- package/dist/components/message.d.ts +38 -0
- package/dist/components/message.d.ts.map +1 -0
- package/dist/components/message.js +25 -0
- package/dist/components/message.js.map +1 -0
- package/dist/components/page-header.d.ts +31 -0
- package/dist/components/page-header.d.ts.map +1 -0
- package/dist/components/page-header.js +94 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/pagination.d.ts +22 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +36 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/password-input.d.ts +5 -0
- package/dist/components/password-input.d.ts.map +1 -0
- package/dist/components/password-input.js +12 -0
- package/dist/components/password-input.js.map +1 -0
- package/dist/components/pepper.d.ts +92 -0
- package/dist/components/pepper.d.ts.map +1 -0
- package/dist/components/pepper.js +1279 -0
- package/dist/components/pepper.js.map +1 -0
- package/dist/components/permission-request.d.ts +53 -0
- package/dist/components/permission-request.d.ts.map +1 -0
- package/dist/components/permission-request.js +54 -0
- package/dist/components/permission-request.js.map +1 -0
- package/dist/components/popover.d.ts +42 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +76 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +9 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +12 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/progressive-blur.d.ts +31 -0
- package/dist/components/progressive-blur.d.ts.map +1 -0
- package/dist/components/progressive-blur.js +44 -0
- package/dist/components/progressive-blur.js.map +1 -0
- package/dist/components/radio-group.d.ts +8 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +15 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/request-card.d.ts +34 -0
- package/dist/components/request-card.d.ts.map +1 -0
- package/dist/components/request-card.js +50 -0
- package/dist/components/request-card.js.map +1 -0
- package/dist/components/resizable.d.ts +24 -0
- package/dist/components/resizable.d.ts.map +1 -0
- package/dist/components/resizable.js +40 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/responsive-overlay.d.ts +136 -0
- package/dist/components/responsive-overlay.d.ts.map +1 -0
- package/dist/components/responsive-overlay.js +302 -0
- package/dist/components/responsive-overlay.js.map +1 -0
- package/dist/components/scroll-shadows.d.ts +11 -0
- package/dist/components/scroll-shadows.d.ts.map +1 -0
- package/dist/components/scroll-shadows.js +53 -0
- package/dist/components/scroll-shadows.js.map +1 -0
- package/dist/components/search-field.d.ts +16 -0
- package/dist/components/search-field.d.ts.map +1 -0
- package/dist/components/search-field.js +50 -0
- package/dist/components/search-field.js.map +1 -0
- package/dist/components/searchable-select.d.ts +43 -0
- package/dist/components/searchable-select.d.ts.map +1 -0
- package/dist/components/searchable-select.js +39 -0
- package/dist/components/searchable-select.js.map +1 -0
- package/dist/components/select.d.ts +60 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +94 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +7 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +12 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/settings-section.d.ts +41 -0
- package/dist/components/settings-section.d.ts.map +1 -0
- package/dist/components/settings-section.js +50 -0
- package/dist/components/settings-section.js.map +1 -0
- package/dist/components/sidebar-item.d.ts +41 -0
- package/dist/components/sidebar-item.d.ts.map +1 -0
- package/dist/components/sidebar-item.js +59 -0
- package/dist/components/sidebar-item.js.map +1 -0
- package/dist/components/skeleton.d.ts +7 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +11 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +10 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +36 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.d.ts +8 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +21 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.d.ts +7 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +12 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stat-strip.d.ts +20 -0
- package/dist/components/stat-strip.d.ts.map +1 -0
- package/dist/components/stat-strip.js +11 -0
- package/dist/components/stat-strip.js.map +1 -0
- package/dist/components/status-dot.d.ts +25 -0
- package/dist/components/status-dot.d.ts.map +1 -0
- package/dist/components/status-dot.js +31 -0
- package/dist/components/status-dot.js.map +1 -0
- package/dist/components/subagent-run.d.ts +27 -0
- package/dist/components/subagent-run.d.ts.map +1 -0
- package/dist/components/subagent-run.js +38 -0
- package/dist/components/subagent-run.js.map +1 -0
- package/dist/components/switch.d.ts +8 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +13 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/system-notice.d.ts +34 -0
- package/dist/components/system-notice.d.ts.map +1 -0
- package/dist/components/system-notice.js +52 -0
- package/dist/components/system-notice.js.map +1 -0
- package/dist/components/table.d.ts +27 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +37 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +40 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +52 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +5 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +9 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/thinking-indicator.d.ts +21 -0
- package/dist/components/thinking-indicator.d.ts.map +1 -0
- package/dist/components/thinking-indicator.js +136 -0
- package/dist/components/thinking-indicator.js.map +1 -0
- package/dist/components/thread-status.d.ts +25 -0
- package/dist/components/thread-status.d.ts.map +1 -0
- package/dist/components/thread-status.js +41 -0
- package/dist/components/thread-status.js.map +1 -0
- package/dist/components/todo-list.d.ts +52 -0
- package/dist/components/todo-list.d.ts.map +1 -0
- package/dist/components/todo-list.js +137 -0
- package/dist/components/todo-list.js.map +1 -0
- package/dist/components/toggle-group.d.ts +17 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +26 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +27 -0
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +44 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tool-call.d.ts +60 -0
- package/dist/components/tool-call.d.ts.map +1 -0
- package/dist/components/tool-call.js +94 -0
- package/dist/components/tool-call.js.map +1 -0
- package/dist/components/tool-result.d.ts +127 -0
- package/dist/components/tool-result.d.ts.map +1 -0
- package/dist/components/tool-result.js +155 -0
- package/dist/components/tool-result.js.map +1 -0
- package/dist/components/tooltip.d.ts +18 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +38 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/trace.d.ts +38 -0
- package/dist/components/trace.d.ts.map +1 -0
- package/dist/components/trace.js +52 -0
- package/dist/components/trace.js.map +1 -0
- package/dist/components/turn-summary.d.ts +17 -0
- package/dist/components/turn-summary.d.ts.map +1 -0
- package/dist/components/turn-summary.js +19 -0
- package/dist/components/turn-summary.js.map +1 -0
- package/dist/components/usage-meter.d.ts +16 -0
- package/dist/components/usage-meter.d.ts.map +1 -0
- package/dist/components/usage-meter.js +10 -0
- package/dist/components/usage-meter.js.map +1 -0
- package/dist/components/view-switcher.d.ts +25 -0
- package/dist/components/view-switcher.d.ts.map +1 -0
- package/dist/components/view-switcher.js +196 -0
- package/dist/components/view-switcher.js.map +1 -0
- package/dist/docs/components/accordion.md +151 -0
- package/dist/docs/components/activity-chart.md +104 -0
- package/dist/docs/components/alert-dialog.md +216 -0
- package/dist/docs/components/alert.md +203 -0
- package/dist/docs/components/ask-user-question.md +429 -0
- package/dist/docs/components/attachment-gallery.md +377 -0
- package/dist/docs/components/avatar.md +197 -0
- package/dist/docs/components/badge.md +162 -0
- package/dist/docs/components/brand-tile.md +138 -0
- package/dist/docs/components/button.md +392 -0
- package/dist/docs/components/calendar.md +113 -0
- package/dist/docs/components/card.md +157 -0
- package/dist/docs/components/carousel.md +144 -0
- package/dist/docs/components/catalog-card.md +136 -0
- package/dist/docs/components/chart.md +608 -0
- package/dist/docs/components/checkbox.md +164 -0
- package/dist/docs/components/chip.md +411 -0
- package/dist/docs/components/code-block.md +389 -0
- package/dist/docs/components/collapsible.md +93 -0
- package/dist/docs/components/command.md +276 -0
- package/dist/docs/components/composer.md +1092 -0
- package/dist/docs/components/connector-request.md +497 -0
- package/dist/docs/components/context-menu.md +127 -0
- package/dist/docs/components/data-table.md +462 -0
- package/dist/docs/components/date-range-picker.md +425 -0
- package/dist/docs/components/dialog.md +263 -0
- package/dist/docs/components/drawer.md +505 -0
- package/dist/docs/components/dropdown-menu.md +336 -0
- package/dist/docs/components/editor-tabs.md +283 -0
- package/dist/docs/components/empty-state.md +134 -0
- package/dist/docs/components/entity-card.md +640 -0
- package/dist/docs/components/entity-row.md +291 -0
- package/dist/docs/components/env-var-request.md +223 -0
- package/dist/docs/components/field.md +272 -0
- package/dist/docs/components/file-upload.md +255 -0
- package/dist/docs/components/hover-card.md +335 -0
- package/dist/docs/components/input-group.md +134 -0
- package/dist/docs/components/input.md +97 -0
- package/dist/docs/components/island.md +97 -0
- package/dist/docs/components/kbd.md +91 -0
- package/dist/docs/components/markdown.md +180 -0
- package/dist/docs/components/message.md +336 -0
- package/dist/docs/components/page-header.md +203 -0
- package/dist/docs/components/pagination.md +211 -0
- package/dist/docs/components/password-input.md +68 -0
- package/dist/docs/components/pepper.md +238 -0
- package/dist/docs/components/permission-request.md +265 -0
- package/dist/docs/components/popover.md +206 -0
- package/dist/docs/components/progress.md +142 -0
- package/dist/docs/components/progressive-blur.md +195 -0
- package/dist/docs/components/radio-group.md +129 -0
- package/dist/docs/components/request-card.md +305 -0
- package/dist/docs/components/resizable.md +318 -0
- package/dist/docs/components/responsive-overlay.md +449 -0
- package/dist/docs/components/scroll-shadows.md +161 -0
- package/dist/docs/components/search-field.md +86 -0
- package/dist/docs/components/searchable-select.md +144 -0
- package/dist/docs/components/select.md +331 -0
- package/dist/docs/components/separator.md +80 -0
- package/dist/docs/components/settings-section.md +246 -0
- package/dist/docs/components/sidebar-item.md +307 -0
- package/dist/docs/components/skeleton.md +107 -0
- package/dist/docs/components/slider.md +171 -0
- package/dist/docs/components/sonner.md +122 -0
- package/dist/docs/components/spinner.md +112 -0
- package/dist/docs/components/stat-strip.md +85 -0
- package/dist/docs/components/status-dot.md +190 -0
- package/dist/docs/components/subagent-run.md +196 -0
- package/dist/docs/components/switch.md +91 -0
- package/dist/docs/components/system-notice.md +144 -0
- package/dist/docs/components/table.md +201 -0
- package/dist/docs/components/tabs.md +233 -0
- package/dist/docs/components/textarea.md +89 -0
- package/dist/docs/components/thinking-indicator.md +164 -0
- package/dist/docs/components/thread-status.md +143 -0
- package/dist/docs/components/todo-list.md +225 -0
- package/dist/docs/components/toggle-group.md +117 -0
- package/dist/docs/components/toggle.md +132 -0
- package/dist/docs/components/tool-call.md +237 -0
- package/dist/docs/components/tool-result.md +418 -0
- package/dist/docs/components/tooltip.md +136 -0
- package/dist/docs/components/trace.md +319 -0
- package/dist/docs/components/turn-summary.md +218 -0
- package/dist/docs/components/usage-meter.md +69 -0
- package/dist/docs/components/view-switcher.md +193 -0
- package/dist/docs/foundations/colors.md +83 -0
- package/dist/docs/foundations/elevation.md +19 -0
- package/dist/docs/foundations/iconography.md +34 -0
- package/dist/docs/foundations/layout.md +42 -0
- package/dist/docs/foundations/logo.md +111 -0
- package/dist/docs/foundations/motion.md +91 -0
- package/dist/docs/foundations/radius.md +13 -0
- package/dist/docs/foundations/spacing.md +23 -0
- package/dist/docs/foundations/typography.md +42 -0
- package/dist/docs/getting-started/installation.md +116 -0
- package/dist/docs/getting-started/releases.md +59 -0
- package/dist/docs/getting-started/theming.md +58 -0
- package/dist/docs/guidelines/accessibility.md +28 -0
- package/dist/docs/guidelines/content.md +36 -0
- package/dist/docs/guidelines/forms.md +36 -0
- package/dist/docs/guidelines/principles.md +30 -0
- package/dist/docs/hooks/use-is-mobile.md +134 -0
- package/dist/docs/index.md +182 -0
- package/dist/docs/overview.md +35 -0
- package/dist/docs/patterns/chat.md +477 -0
- package/dist/docs/patterns/index.md +13 -0
- package/dist/docs/patterns/login.md +311 -0
- package/dist/docs/patterns/share.md +415 -0
- package/dist/hooks/use-is-mobile.d.ts +9 -0
- package/dist/hooks/use-is-mobile.d.ts.map +1 -0
- package/dist/hooks/use-is-mobile.js +26 -0
- package/dist/hooks/use-is-mobile.js.map +1 -0
- package/dist/lib/cn.d.ts +4 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +31 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/code-language.d.ts +8 -0
- package/dist/lib/code-language.d.ts.map +1 -0
- package/dist/lib/code-language.js +48 -0
- package/dist/lib/code-language.js.map +1 -0
- package/dist/lib/date-range.d.ts +122 -0
- package/dist/lib/date-range.d.ts.map +1 -0
- package/dist/lib/date-range.js +281 -0
- package/dist/lib/date-range.js.map +1 -0
- package/dist/lib/major-tokens.d.ts +40 -0
- package/dist/lib/major-tokens.d.ts.map +1 -0
- package/dist/lib/major-tokens.js +602 -0
- package/dist/lib/major-tokens.js.map +1 -0
- package/dist/lib/markdown.d.ts +25 -0
- package/dist/lib/markdown.d.ts.map +1 -0
- package/dist/lib/markdown.js +87 -0
- package/dist/lib/markdown.js.map +1 -0
- package/dist/lib/overlay-portal-branch.d.ts +6 -0
- package/dist/lib/overlay-portal-branch.d.ts.map +1 -0
- package/dist/lib/overlay-portal-branch.js +15 -0
- package/dist/lib/overlay-portal-branch.js.map +1 -0
- package/dist/lib/pepper-matcap.d.ts +2 -0
- package/dist/lib/pepper-matcap.d.ts.map +1 -0
- package/dist/lib/pepper-matcap.js +4 -0
- package/dist/lib/pepper-matcap.js.map +1 -0
- package/dist/lib/scroll-fade.d.ts +28 -0
- package/dist/lib/scroll-fade.d.ts.map +1 -0
- package/dist/lib/scroll-fade.js +57 -0
- package/dist/lib/scroll-fade.js.map +1 -0
- package/dist/tailwind.css +7 -0
- package/dist/theme.css +428 -0
- package/package.json +145 -3
- package/tokens.json +841 -0
- package/README.md +0 -3
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: PageHeader
|
|
3
|
+
slug: page-header
|
|
4
|
+
description: "The top of every page, sticky in its Island: a list header or a detail header."
|
|
5
|
+
group: Layout
|
|
6
|
+
layer: composed
|
|
7
|
+
status: stable
|
|
8
|
+
since: 0.1.0
|
|
9
|
+
import: import { PageHeader, PAGE_HEADER_VARIANTS } from "@major-tech/ui/page-header";
|
|
10
|
+
source: packages/ui/src/components/page-header.tsx
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# PageHeader
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### List header
|
|
18
|
+
|
|
19
|
+
Pages of many items (Apps, Agents, Connectors): one row with the title left, search and toolbar tools centred, the page's one green action right. Scroll the preview: the header sticks to the island and paints its background and glow once cards slide under it.
|
|
20
|
+
|
|
21
|
+
Example: `list`
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Button } from "@major-tech/ui/button";
|
|
25
|
+
import { Card, CardDescription, CardHeader, CardTitle } from "@major-tech/ui/card";
|
|
26
|
+
import { Island } from "@major-tech/ui/island";
|
|
27
|
+
import { PageHeader } from "@major-tech/ui/page-header";
|
|
28
|
+
import { SearchField } from "@major-tech/ui/search-field";
|
|
29
|
+
import { ArrowUpDown, LayoutList, ListFilter, Plus } from "lucide-react";
|
|
30
|
+
|
|
31
|
+
const AGENT_COUNT = 9;
|
|
32
|
+
|
|
33
|
+
export default function PageHeaderList() {
|
|
34
|
+
return (
|
|
35
|
+
<div className="h-110 w-full bg-app-bg p-space-4">
|
|
36
|
+
<Island className="h-full overflow-y-auto">
|
|
37
|
+
<div className="px-space-16 pt-space-16 pb-16 md:px-7 md:pt-space-56">
|
|
38
|
+
<PageHeader
|
|
39
|
+
title="Agents"
|
|
40
|
+
tools={
|
|
41
|
+
<>
|
|
42
|
+
<SearchField placeholder="Search agents" hotkey="/" className="max-md:flex-1" />
|
|
43
|
+
<Button variant="toolbar" size="icon-lg" aria-label="Sort">
|
|
44
|
+
<ArrowUpDown />
|
|
45
|
+
</Button>
|
|
46
|
+
<Button variant="toolbar" size="icon-lg" aria-label="Filter">
|
|
47
|
+
<ListFilter />
|
|
48
|
+
</Button>
|
|
49
|
+
<Button variant="toolbar" size="icon-lg" aria-label="Show as list">
|
|
50
|
+
<LayoutList />
|
|
51
|
+
</Button>
|
|
52
|
+
</>
|
|
53
|
+
}
|
|
54
|
+
action={
|
|
55
|
+
<Button>
|
|
56
|
+
<Plus />
|
|
57
|
+
Create agent
|
|
58
|
+
</Button>
|
|
59
|
+
}
|
|
60
|
+
/>
|
|
61
|
+
<div className="grid grid-cols-1 gap-space-12 md:grid-cols-2">
|
|
62
|
+
{Array.from({ length: AGENT_COUNT }, (_, index) => (
|
|
63
|
+
<Card key={index} className="h-32 px-space-14 pt-space-14 pb-space-12">
|
|
64
|
+
<CardHeader>
|
|
65
|
+
<CardTitle>Agent {index + 1}</CardTitle>
|
|
66
|
+
</CardHeader>
|
|
67
|
+
<CardDescription>Writes one original, work-friendly joke each weekday.</CardDescription>
|
|
68
|
+
</Card>
|
|
69
|
+
))}
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</Island>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- 56px above the header on desktop (the page's top padding), 45px below it to the content.
|
|
79
|
+
- Without tools the title takes the free width up to the action.
|
|
80
|
+
- On a phone the row wraps: the action stays beside the title when it fits, the tools take a row of their own under it.
|
|
81
|
+
|
|
82
|
+
### Detail header
|
|
83
|
+
|
|
84
|
+
A page about one thing: in leading, a back button (with a “Back to …” tooltip) and the BrandTile; the title, a 13px muted status line, and on the right only what this page needs.
|
|
85
|
+
|
|
86
|
+
Example: `detail`
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
import { BrandTile } from "@major-tech/ui/brand-tile";
|
|
90
|
+
import { Button } from "@major-tech/ui/button";
|
|
91
|
+
import { Island } from "@major-tech/ui/island";
|
|
92
|
+
import { PageHeader } from "@major-tech/ui/page-header";
|
|
93
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@major-tech/ui/tooltip";
|
|
94
|
+
import { ArrowLeft } from "lucide-react";
|
|
95
|
+
|
|
96
|
+
export default function PageHeaderDetail() {
|
|
97
|
+
return (
|
|
98
|
+
<div className="w-full bg-app-bg p-space-4">
|
|
99
|
+
<Island className="px-space-16 pt-space-16 pb-space-8 md:px-7 md:pt-space-56">
|
|
100
|
+
<PageHeader
|
|
101
|
+
variant="detail"
|
|
102
|
+
leading={
|
|
103
|
+
<span className="mr-space-4 flex shrink-0 items-center gap-space-8">
|
|
104
|
+
<Tooltip>
|
|
105
|
+
<TooltipTrigger render={<Button variant="ghost" size="icon" aria-label="Back to Connectors" />}>
|
|
106
|
+
<ArrowLeft />
|
|
107
|
+
</TooltipTrigger>
|
|
108
|
+
<TooltipContent>Back to Connectors</TooltipContent>
|
|
109
|
+
</Tooltip>
|
|
110
|
+
<BrandTile letter="P" color="#336791" size="lg" />
|
|
111
|
+
</span>
|
|
112
|
+
}
|
|
113
|
+
title="Sales database"
|
|
114
|
+
status="PostgreSQL · Connected · used by 3 apps"
|
|
115
|
+
action={<Button variant="outline">Test connection</Button>}
|
|
116
|
+
/>
|
|
117
|
+
</Island>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
- Tools and the action sit on the right. Beside an action, tools drop under the title when the header is too narrow for one row.
|
|
124
|
+
- The title keeps at least 240px before the action drops to a row of its own.
|
|
125
|
+
|
|
126
|
+
### Settings header
|
|
127
|
+
|
|
128
|
+
A settings page adds a description: a body-size muted line on a row of its own under the title, lined up with it. It replaces the space under the header, so on desktop the first card follows 16px later.
|
|
129
|
+
|
|
130
|
+
Example: `settings`
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
import { Island } from "@major-tech/ui/island";
|
|
134
|
+
import { PageHeader } from "@major-tech/ui/page-header";
|
|
135
|
+
import { SettingsRow, SettingsSection } from "@major-tech/ui/settings-section";
|
|
136
|
+
import { Switch } from "@major-tech/ui/switch";
|
|
137
|
+
|
|
138
|
+
export default function PageHeaderSettings() {
|
|
139
|
+
return (
|
|
140
|
+
<div className="w-full bg-app-bg p-space-4">
|
|
141
|
+
<Island className="px-space-16 pt-space-16 pb-space-24 md:px-7 md:pt-space-56">
|
|
142
|
+
<PageHeader title="Organization" description="Your organization’s name and who can join it." />
|
|
143
|
+
<SettingsSection>
|
|
144
|
+
<SettingsRow
|
|
145
|
+
label="Automatically add people from @majortechnology.com"
|
|
146
|
+
description="Anyone who signs up with a matching email joins this organization."
|
|
147
|
+
control={<Switch aria-label="Automatically add people" />}
|
|
148
|
+
/>
|
|
149
|
+
</SettingsSection>
|
|
150
|
+
</Island>
|
|
151
|
+
</div>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Guidelines
|
|
157
|
+
|
|
158
|
+
Do:
|
|
159
|
+
|
|
160
|
+
- Put the page in an Island and let the island scroll, so the header can stick.
|
|
161
|
+
- Name the back target in its tooltip: “Back to Connectors”.
|
|
162
|
+
- Keep the parent selected in the sidebar on sub-pages.
|
|
163
|
+
- Use description only on settings pages: one sentence on what the page controls.
|
|
164
|
+
|
|
165
|
+
Don't:
|
|
166
|
+
|
|
167
|
+
- Breadcrumbs or a ⋮ in the header.
|
|
168
|
+
- A description on list or detail pages.
|
|
169
|
+
- More than one green action.
|
|
170
|
+
|
|
171
|
+
## API
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
import { PageHeader, PAGE_HEADER_VARIANTS } from "@major-tech/ui/page-header";
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### `<PageHeader />`
|
|
178
|
+
|
|
179
|
+
| Prop | Type | Default | Description |
|
|
180
|
+
| --- | --- | --- | --- |
|
|
181
|
+
| `title`* | `ReactNode` | — | 26px page-title, truncated. |
|
|
182
|
+
| `variant` | `"list" \| "detail"` | `"list"` | list centres the tools; detail keeps them on the right beside the action. |
|
|
183
|
+
| `tools` | `ReactNode` | — | Search, sort, filter, view switch. |
|
|
184
|
+
| `action` | `ReactNode` | — | The page's one primary action. |
|
|
185
|
+
| `leading` | `ReactNode` | — | Before the title: a back button (and a BrandTile), or the mobile nav trigger. |
|
|
186
|
+
| `status` | `ReactNode` | — | Detail pages: the 13px muted line under the title. |
|
|
187
|
+
| `description` | `ReactNode` | — | Settings pages: a row of its own under the title and action. |
|
|
188
|
+
| `className` | `string` | — | Adjust the space under the header. |
|
|
189
|
+
|
|
190
|
+
`*` marks a required prop.
|
|
191
|
+
|
|
192
|
+
### `PAGE_HEADER_VARIANTS`
|
|
193
|
+
|
|
194
|
+
| Prop | Type | Default | Description |
|
|
195
|
+
| --- | --- | --- | --- |
|
|
196
|
+
| `LIST` | `"list"` | — | Apps, Agents, Analytics. |
|
|
197
|
+
| `DETAIL` | `"detail"` | — | One thing: a connector, a managed service. |
|
|
198
|
+
|
|
199
|
+
### Accessibility
|
|
200
|
+
|
|
201
|
+
- The title is the page's only h1.
|
|
202
|
+
- Icon-only tools and the back button carry an aria-label and a tooltip.
|
|
203
|
+
- The header is a `<header>`; a zero-height sentinel above it tells it when it is stuck.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Pagination
|
|
3
|
+
slug: pagination
|
|
4
|
+
description: "Paging through a long table or list: the range, previous and next, optionally rows per page or page numbers."
|
|
5
|
+
group: Navigation
|
|
6
|
+
layer: composed
|
|
7
|
+
status: stable
|
|
8
|
+
since: 0.3.0
|
|
9
|
+
import: import { Pagination } from "@major-tech/ui/pagination";
|
|
10
|
+
source: packages/ui/src/components/pagination.tsx
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Pagination
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### Range and rows per page
|
|
18
|
+
|
|
19
|
+
Right-aligned under the table or list: “26–50 of 312” in 13px muted, then previous and next, disabled at the ends. With page size options and a handler, a “Rows per page” select leads the row. An empty one reads “0–0 of 0”.
|
|
20
|
+
|
|
21
|
+
Example: `rows-per-page`
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
"use client";
|
|
25
|
+
|
|
26
|
+
import { useState } from "react";
|
|
27
|
+
import { Pagination } from "@major-tech/ui/pagination";
|
|
28
|
+
|
|
29
|
+
const TOTAL_ROWS = 312;
|
|
30
|
+
const PAGE_SIZES = [10, 25, 50];
|
|
31
|
+
const FIRST_PAGE = 1;
|
|
32
|
+
|
|
33
|
+
export default function PaginationRowsPerPage() {
|
|
34
|
+
const [page, setPage] = useState(FIRST_PAGE);
|
|
35
|
+
const [pageSize, setPageSize] = useState(PAGE_SIZES[1]);
|
|
36
|
+
|
|
37
|
+
// A new page size changes what every page holds: start again from the first.
|
|
38
|
+
const handlePageSizeChange = (nextPageSize: number) => {
|
|
39
|
+
setPageSize(nextPageSize);
|
|
40
|
+
setPage(FIRST_PAGE);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Pagination
|
|
45
|
+
page={page}
|
|
46
|
+
pageSize={pageSize}
|
|
47
|
+
total={TOTAL_ROWS}
|
|
48
|
+
onPageChange={setPage}
|
|
49
|
+
pageSizeOptions={PAGE_SIZES}
|
|
50
|
+
onPageSizeChange={handlePageSizeChange}
|
|
51
|
+
className="w-full"
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Page numbers
|
|
58
|
+
|
|
59
|
+
Only where people jump around (audit log). The numbers replace the range; the current page is the white selected surface.
|
|
60
|
+
|
|
61
|
+
Example: `page-list`
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
"use client";
|
|
65
|
+
|
|
66
|
+
import { useState } from "react";
|
|
67
|
+
import { Pagination } from "@major-tech/ui/pagination";
|
|
68
|
+
|
|
69
|
+
const TOTAL_ROWS = 1240;
|
|
70
|
+
const PAGE_SIZE = 50;
|
|
71
|
+
const INITIAL_PAGE = 4;
|
|
72
|
+
|
|
73
|
+
export default function PaginationPageList() {
|
|
74
|
+
const [page, setPage] = useState(INITIAL_PAGE);
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<Pagination
|
|
78
|
+
page={page}
|
|
79
|
+
pageSize={PAGE_SIZE}
|
|
80
|
+
total={TOTAL_ROWS}
|
|
81
|
+
onPageChange={setPage}
|
|
82
|
+
isPageListVisible
|
|
83
|
+
className="w-full"
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Under a DataTable
|
|
90
|
+
|
|
91
|
+
Pagination counts pages from 1, TanStack from 0. Hand it the table's page and size, and set the page index back.
|
|
92
|
+
|
|
93
|
+
Example: `under-a-table`
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
"use client";
|
|
97
|
+
|
|
98
|
+
import { useState } from "react";
|
|
99
|
+
import {
|
|
100
|
+
DataTable,
|
|
101
|
+
getCoreRowModel,
|
|
102
|
+
getPaginationRowModel,
|
|
103
|
+
useReactTable,
|
|
104
|
+
type ColumnDef,
|
|
105
|
+
type PaginationState,
|
|
106
|
+
} from "@major-tech/ui/data-table";
|
|
107
|
+
import { Pagination } from "@major-tech/ui/pagination";
|
|
108
|
+
|
|
109
|
+
interface Run {
|
|
110
|
+
id: string;
|
|
111
|
+
agent: string;
|
|
112
|
+
started: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const AGENTS = ["Daily Joke", "Invoice matcher", "Lead enricher"];
|
|
116
|
+
const RUN_COUNT = 23;
|
|
117
|
+
const PAGE_SIZE = 5;
|
|
118
|
+
|
|
119
|
+
const MINUTES_BETWEEN_RUNS = 7;
|
|
120
|
+
|
|
121
|
+
const RUNS: Run[] = Array.from({ length: RUN_COUNT }, (_, index) => ({
|
|
122
|
+
id: `run_${RUN_COUNT - index}`,
|
|
123
|
+
agent: AGENTS[index % AGENTS.length],
|
|
124
|
+
started: `${(index + 1) * MINUTES_BETWEEN_RUNS} min ago`,
|
|
125
|
+
}));
|
|
126
|
+
|
|
127
|
+
const COLUMNS: ColumnDef<Run, unknown>[] = [
|
|
128
|
+
{
|
|
129
|
+
accessorKey: "id",
|
|
130
|
+
header: "Run",
|
|
131
|
+
cell: ({ row }) => <span className="font-mono text-code-small">{row.original.id}</span>,
|
|
132
|
+
},
|
|
133
|
+
{ accessorKey: "agent", header: "Agent" },
|
|
134
|
+
{
|
|
135
|
+
accessorKey: "started",
|
|
136
|
+
header: "Started",
|
|
137
|
+
cell: ({ row }) => <span className="text-muted">{row.original.started}</span>,
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
|
|
141
|
+
export default function PaginationUnderATable() {
|
|
142
|
+
// The table instance is mutable; let it re-render with every change.
|
|
143
|
+
"use no memo";
|
|
144
|
+
const [pagination, setPagination] = useState<PaginationState>({ pageIndex: 0, pageSize: PAGE_SIZE });
|
|
145
|
+
const table = useReactTable({
|
|
146
|
+
data: RUNS,
|
|
147
|
+
columns: COLUMNS,
|
|
148
|
+
state: { pagination },
|
|
149
|
+
onPaginationChange: setPagination,
|
|
150
|
+
getCoreRowModel: getCoreRowModel(),
|
|
151
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
152
|
+
enableSorting: false,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// Pagination counts pages from 1; TanStack from 0.
|
|
156
|
+
const handlePageChange = (page: number) => table.setPageIndex(page - 1);
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<div className="flex w-full flex-col gap-space-8">
|
|
160
|
+
<DataTable table={table} />
|
|
161
|
+
<Pagination
|
|
162
|
+
page={pagination.pageIndex + 1}
|
|
163
|
+
pageSize={pagination.pageSize}
|
|
164
|
+
total={RUNS.length}
|
|
165
|
+
onPageChange={handlePageChange}
|
|
166
|
+
/>
|
|
167
|
+
</div>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Guidelines
|
|
173
|
+
|
|
174
|
+
Do:
|
|
175
|
+
|
|
176
|
+
- Use it for long tables and lists when infinite scroll would hide the end (runs, audit log, members).
|
|
177
|
+
- Keep filters and sorting when paging.
|
|
178
|
+
- Reset to page 1 when filters or the page size change.
|
|
179
|
+
|
|
180
|
+
Don't:
|
|
181
|
+
|
|
182
|
+
- Page numbers on every table.
|
|
183
|
+
- A green current page.
|
|
184
|
+
- Paginate lists that fit on one screen.
|
|
185
|
+
|
|
186
|
+
## API
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
import { Pagination } from "@major-tech/ui/pagination";
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### `<Pagination />`
|
|
193
|
+
|
|
194
|
+
| Prop | Type | Default | Description |
|
|
195
|
+
| --- | --- | --- | --- |
|
|
196
|
+
| `page`* | `number` | — | The current page, 1-based. |
|
|
197
|
+
| `pageSize`* | `number` | — | Rows per page. |
|
|
198
|
+
| `total`* | `number` | — | All rows, across pages. |
|
|
199
|
+
| `onPageChange`* | `(page: number) => void` | — | Called with the new page, clamped to the first and last. |
|
|
200
|
+
| `pageSizeOptions` | `number[]` | — | With `onPageSizeChange`, shows the “Rows per page” select. |
|
|
201
|
+
| `onPageSizeChange` | `(pageSize: number) => void` | — | Called with the new size. |
|
|
202
|
+
| `isPageListVisible` | `boolean` | `false` | Page numbers with ellipses between the arrows, instead of the range. |
|
|
203
|
+
| `className` | `string` | — | On the `<nav>`. |
|
|
204
|
+
|
|
205
|
+
`*` marks a required prop.
|
|
206
|
+
|
|
207
|
+
### Accessibility
|
|
208
|
+
|
|
209
|
+
- A `<nav aria-label="Pagination">`; the current page number has `aria-current="page"`.
|
|
210
|
+
- Previous and next are icon buttons named “Previous page” and “Next page”.
|
|
211
|
+
- The rows-per-page select is named “Rows per page”.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: PasswordInput
|
|
3
|
+
slug: password-input
|
|
4
|
+
description: A masked field with a show/hide button inside its right edge.
|
|
5
|
+
group: Inputs
|
|
6
|
+
layer: composed
|
|
7
|
+
status: stable
|
|
8
|
+
since: 0.3.0
|
|
9
|
+
import: import { PasswordInput } from "@major-tech/ui/password-input";
|
|
10
|
+
source: packages/ui/src/components/password-input.tsx
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# PasswordInput
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### Show and hide
|
|
18
|
+
|
|
19
|
+
A masked InputGroup with a ghost eye button inside its right edge. Every password, token and secret field is a PasswordInput; disabled, the button is disabled too.
|
|
20
|
+
|
|
21
|
+
Example: `basic`
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Field, FieldLabel } from "@major-tech/ui/field";
|
|
25
|
+
import { PasswordInput } from "@major-tech/ui/password-input";
|
|
26
|
+
|
|
27
|
+
export default function PasswordInputBasic() {
|
|
28
|
+
return (
|
|
29
|
+
<div className="flex w-80 max-w-full flex-col gap-space-14">
|
|
30
|
+
<Field>
|
|
31
|
+
<FieldLabel htmlFor="db-password" required>
|
|
32
|
+
Password
|
|
33
|
+
</FieldLabel>
|
|
34
|
+
<PasswordInput id="db-password" required defaultValue="correct-horse-battery" autoComplete="new-password" />
|
|
35
|
+
</Field>
|
|
36
|
+
<Field>
|
|
37
|
+
<FieldLabel htmlFor="managed-password">Managed password</FieldLabel>
|
|
38
|
+
<PasswordInput id="managed-password" disabled defaultValue="correct-horse-battery" />
|
|
39
|
+
</Field>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Guidelines
|
|
46
|
+
|
|
47
|
+
- Pair it with Username in the form grid; it spans one column.
|
|
48
|
+
- Masked by default; people choose to reveal it.
|
|
49
|
+
- Set `autoComplete` (“current-password” or “new-password”) so password managers fill the right field.
|
|
50
|
+
|
|
51
|
+
## API
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import { PasswordInput } from "@major-tech/ui/password-input";
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### `<PasswordInput />`
|
|
58
|
+
|
|
59
|
+
Accepts every native `<input>` attribute except `type`; `className` goes to the group.
|
|
60
|
+
|
|
61
|
+
| Prop | Type | Default | Description |
|
|
62
|
+
| --- | --- | --- | --- |
|
|
63
|
+
| `disabled` | `boolean` | — | Disables the field and the show/hide button. |
|
|
64
|
+
|
|
65
|
+
### Accessibility
|
|
66
|
+
|
|
67
|
+
- The button is named “Show password” or “Hide password” by its state.
|
|
68
|
+
- Label it with FieldLabel `htmlFor`, as any input.
|