@sableui/react 0.6.2 → 0.7.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/AGENTS.md +2 -2
- package/CHANGELOG.md +315 -0
- package/CONTRIBUTING.md +16 -10
- package/DESIGN.md +3 -3
- package/README.md +3 -3
- package/bin/sable-lint.mjs +18 -0
- package/bin/sable.mjs +470 -62
- package/dist/blocks/api-keys-block.js +44 -0
- package/dist/blocks/api-keys-block.meta.js +21 -0
- package/dist/blocks/chat-thread-block.js +17 -0
- package/dist/blocks/chat-thread-block.meta.js +20 -0
- package/dist/blocks/command-palette-block.js +24 -0
- package/dist/blocks/command-palette-block.meta.js +21 -0
- package/dist/blocks/cta-band-block.js +27 -0
- package/dist/blocks/cta-band-block.meta.js +20 -0
- package/dist/blocks/danger-zone-block.js +39 -0
- package/dist/blocks/danger-zone-block.meta.js +21 -0
- package/dist/blocks/device-comparison-block.js +69 -0
- package/dist/blocks/device-comparison-block.meta.js +21 -0
- package/dist/blocks/event-card-block.js +40 -0
- package/dist/blocks/event-card-block.meta.js +21 -0
- package/dist/blocks/faq-block.js +38 -0
- package/dist/blocks/faq-block.meta.js +20 -0
- package/dist/blocks/feature-grid-block.js +38 -0
- package/dist/blocks/feature-grid-block.meta.js +21 -0
- package/dist/blocks/feedback-form-block.js +30 -0
- package/dist/blocks/feedback-form-block.meta.js +21 -0
- package/dist/blocks/goal-progress-block.js +24 -0
- package/dist/blocks/goal-progress-block.meta.js +21 -0
- package/dist/blocks/hero-block.js +33 -0
- package/dist/blocks/hero-block.meta.js +21 -0
- package/dist/blocks/index.js +162 -1964
- package/dist/blocks/invite-team-block.js +36 -0
- package/dist/blocks/invite-team-block.meta.js +20 -0
- package/dist/blocks/invoice-history-block.js +41 -0
- package/dist/blocks/invoice-history-block.meta.js +21 -0
- package/dist/blocks/kpi-sparkline-block.js +29 -0
- package/dist/blocks/kpi-sparkline-block.meta.js +20 -0
- package/dist/blocks/media-player-block.js +68 -0
- package/dist/blocks/media-player-block.meta.js +21 -0
- package/dist/blocks/newsletter-block.js +35 -0
- package/dist/blocks/newsletter-block.meta.js +21 -0
- package/dist/blocks/not-found-block.js +27 -0
- package/dist/blocks/not-found-block.meta.js +20 -0
- package/dist/blocks/notification-list-block.js +32 -0
- package/dist/blocks/notification-list-block.meta.js +21 -0
- package/dist/blocks/notification-settings-block.js +25 -0
- package/dist/blocks/notification-settings-block.meta.js +20 -0
- package/dist/blocks/order-tracking-block.js +26 -0
- package/dist/blocks/order-tracking-block.meta.js +20 -0
- package/dist/blocks/pricing-card-block.js +46 -0
- package/dist/blocks/pricing-card-block.meta.js +21 -0
- package/dist/blocks/pricing-table-block.js +88 -0
- package/dist/blocks/pricing-table-block.meta.js +20 -0
- package/dist/blocks/product-card-block.js +26 -0
- package/dist/blocks/product-card-block.meta.js +21 -0
- package/dist/blocks/profile-card-block.js +58 -0
- package/dist/blocks/profile-card-block.meta.js +21 -0
- package/dist/blocks/profile-form-block.js +70 -0
- package/dist/blocks/profile-form-block.meta.js +21 -0
- package/dist/blocks/revenue-breakdown-block.js +38 -0
- package/dist/blocks/revenue-breakdown-block.meta.js +21 -0
- package/dist/blocks/sign-in-block.js +38 -0
- package/dist/blocks/sign-in-block.meta.js +21 -0
- package/dist/blocks/sign-up-block.js +48 -0
- package/dist/blocks/sign-up-block.meta.js +21 -0
- package/dist/blocks/site-footer-block.js +54 -0
- package/dist/blocks/site-footer-block.meta.js +20 -0
- package/dist/blocks/stat-row-block.js +28 -0
- package/dist/blocks/stat-row-block.meta.js +21 -0
- package/dist/blocks/steps-block.js +37 -0
- package/dist/blocks/steps-block.meta.js +20 -0
- package/dist/blocks/task-list-block.js +52 -0
- package/dist/blocks/task-list-block.meta.js +21 -0
- package/dist/blocks/team-members-block.js +49 -0
- package/dist/blocks/team-members-block.meta.js +21 -0
- package/dist/blocks/testimonial-block.js +49 -0
- package/dist/blocks/testimonial-block.meta.js +20 -0
- package/dist/blocks/traffic-sources-block.js +39 -0
- package/dist/blocks/traffic-sources-block.meta.js +21 -0
- package/dist/blocks/traffic-trend-block.js +61 -0
- package/dist/blocks/traffic-trend-block.meta.js +21 -0
- package/dist/blocks/upload-list-block.js +39 -0
- package/dist/blocks/upload-list-block.meta.js +21 -0
- package/dist/blocks/verify-code-block.js +28 -0
- package/dist/blocks/verify-code-block.meta.js +21 -0
- package/dist/blocks/wallet-block.js +48 -0
- package/dist/blocks/wallet-block.meta.js +21 -0
- package/dist/components/accordion/accordion.js +63 -0
- package/dist/components/accordion/accordion.meta.js +155 -0
- package/dist/components/accordion/index.js +15 -0
- package/dist/components/app-header/app-header.js +30 -0
- package/dist/components/app-header/app-header.meta.js +88 -0
- package/dist/components/app-header/index.js +7 -0
- package/dist/components/app-shell/app-shell-dock.js +37 -0
- package/dist/components/app-shell/app-shell.js +67 -0
- package/dist/components/app-shell/app-shell.meta.js +176 -0
- package/dist/components/app-shell/index.js +7 -0
- package/dist/components/area-chart/area-chart.js +10 -0
- package/dist/components/area-chart/area-chart.meta.js +218 -0
- package/dist/components/area-chart/index.js +7 -0
- package/dist/components/attachment/attachment.js +176 -0
- package/dist/components/attachment/attachment.meta.js +179 -0
- package/dist/components/attachment/attachment.variants.js +47 -0
- package/dist/components/attachment/index.js +7 -0
- package/dist/components/avatar/avatar.js +192 -0
- package/dist/components/avatar/avatar.meta.js +233 -0
- package/dist/components/avatar/avatar.variants.js +44 -0
- package/dist/components/avatar/index.js +22 -0
- package/dist/components/badge/badge.js +26 -0
- package/dist/components/badge/badge.meta.js +171 -0
- package/dist/components/badge/badge.variants.js +103 -0
- package/dist/components/badge/index.js +11 -0
- package/dist/components/banner/banner.js +76 -0
- package/dist/components/banner/banner.meta.js +172 -0
- package/dist/components/banner/banner.variants.js +44 -0
- package/dist/components/banner/index.js +9 -0
- package/dist/components/bar-chart/bar-chart.js +10 -0
- package/dist/components/bar-chart/bar-chart.meta.js +245 -0
- package/dist/components/bar-chart/index.js +7 -0
- package/dist/components/bottom-nav/bottom-nav.js +63 -0
- package/dist/components/bottom-nav/bottom-nav.meta.js +95 -0
- package/dist/components/bottom-nav/index.js +11 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +90 -0
- package/dist/components/breadcrumbs/breadcrumbs.meta.js +111 -0
- package/dist/components/breadcrumbs/index.js +17 -0
- package/dist/components/browser/browser.js +39 -0
- package/dist/components/browser/browser.meta.js +80 -0
- package/dist/components/browser/index.js +7 -0
- package/dist/components/bubble/bubble.js +110 -0
- package/dist/components/bubble/bubble.meta.js +158 -0
- package/dist/components/bubble/bubble.variants.js +90 -0
- package/dist/components/bubble/index.js +13 -0
- package/dist/components/button/button.js +87 -0
- package/dist/components/button/button.meta.js +302 -0
- package/dist/components/button/button.variants.js +137 -0
- package/dist/components/button/index.js +9 -0
- package/dist/components/calendar/calendar.js +89 -0
- package/dist/components/calendar/calendar.meta.js +136 -0
- package/dist/components/calendar/index.js +7 -0
- package/dist/components/card/card.js +203 -0
- package/dist/components/card/card.meta.js +212 -0
- package/dist/components/card/index.js +23 -0
- package/dist/components/carousel/carousel.js +428 -0
- package/dist/components/carousel/carousel.meta.js +100 -0
- package/dist/components/carousel/index.js +7 -0
- package/dist/components/chat-composer/chat-composer.js +174 -0
- package/dist/components/chat-composer/chat-composer.meta.js +241 -0
- package/dist/components/chat-composer/chat-composer.variants.js +17 -0
- package/dist/components/chat-composer/index.js +7 -0
- package/dist/components/checkbox/checkbox-mark.js +28 -0
- package/dist/components/checkbox/checkbox.js +30 -0
- package/dist/components/checkbox/checkbox.meta.js +127 -0
- package/dist/components/checkbox/index.js +7 -0
- package/dist/components/checkbox-card/checkbox-card.js +94 -0
- package/dist/components/checkbox-card/checkbox-card.meta.js +154 -0
- package/dist/components/checkbox-card/checkbox-card.variants.js +43 -0
- package/dist/components/checkbox-card/index.js +11 -0
- package/dist/components/code/code.js +19 -0
- package/dist/components/code/code.meta.js +71 -0
- package/dist/components/code/index.js +7 -0
- package/dist/components/code-block/code-block.js +84 -0
- package/dist/components/code-block/code-block.meta.js +103 -0
- package/dist/components/code-block/index.js +8 -0
- package/dist/components/collapsible/collapsible.js +38 -0
- package/dist/components/collapsible/collapsible.meta.js +117 -0
- package/dist/components/collapsible/index.js +15 -0
- package/dist/components/color-field/color-field.js +293 -0
- package/dist/components/color-field/color-field.meta.js +142 -0
- package/dist/components/color-field/color.js +69 -0
- package/dist/components/color-field/index.js +15 -0
- package/dist/components/combobox/combobox.js +486 -0
- package/dist/components/combobox/combobox.meta.js +217 -0
- package/dist/components/combobox/index.js +37 -0
- package/dist/components/command-menu/command-menu-trigger.js +122 -0
- package/dist/components/command-menu/command-menu.js +433 -0
- package/dist/components/command-menu/command-menu.meta.js +279 -0
- package/dist/components/command-menu/index.js +21 -0
- package/dist/components/context-card/context-card.js +62 -0
- package/dist/components/context-card/context-card.meta.js +106 -0
- package/dist/components/context-card/index.js +17 -0
- package/dist/components/context-menu/context-menu.js +92 -0
- package/dist/components/context-menu/context-menu.meta.js +138 -0
- package/dist/components/context-menu/index.js +23 -0
- package/dist/components/data-table/data-table.js +142 -0
- package/dist/components/data-table/data-table.meta.js +146 -0
- package/dist/components/data-table/index.js +9 -0
- package/dist/components/date-picker/date-picker.js +196 -0
- package/dist/components/date-picker/date-picker.meta.js +164 -0
- package/dist/components/date-picker/index.js +7 -0
- package/dist/components/date-tile/date-tile.js +29 -0
- package/dist/components/date-tile/date-tile.meta.js +72 -0
- package/dist/components/date-tile/index.js +7 -0
- package/dist/components/destructive-action-modal/destructive-action-modal.js +130 -0
- package/dist/components/destructive-action-modal/destructive-action-modal.meta.js +136 -0
- package/dist/components/destructive-action-modal/index.js +9 -0
- package/dist/components/dialog/dialog.js +207 -0
- package/dist/components/dialog/dialog.meta.js +239 -0
- package/dist/components/dialog/index.js +45 -0
- package/dist/components/disclosure-picker/disclosure-picker.js +417 -0
- package/dist/components/disclosure-picker/disclosure-picker.meta.js +213 -0
- package/dist/components/disclosure-picker/index.js +21 -0
- package/dist/components/empty-state/empty-state.js +52 -0
- package/dist/components/empty-state/empty-state.meta.js +158 -0
- package/dist/components/empty-state/index.js +7 -0
- package/dist/components/entity/entity.js +70 -0
- package/dist/components/entity/entity.meta.js +108 -0
- package/dist/components/entity/entity.variants.js +16 -0
- package/dist/components/entity/index.js +7 -0
- package/dist/components/feedback/feedback.js +93 -0
- package/dist/components/feedback/feedback.meta.js +109 -0
- package/dist/components/feedback/index.js +7 -0
- package/dist/components/fieldset/fieldset.js +80 -0
- package/dist/components/fieldset/fieldset.meta.js +160 -0
- package/dist/components/fieldset/index.js +17 -0
- package/dist/components/file-dropzone/file-dropzone.js +193 -0
- package/dist/components/file-dropzone/file-dropzone.meta.js +210 -0
- package/dist/components/file-dropzone/file-dropzone.variants.js +26 -0
- package/dist/components/file-dropzone/index.js +13 -0
- package/dist/components/font-picker/font-picker.js +77 -0
- package/dist/components/font-picker/font-picker.meta.js +119 -0
- package/dist/components/font-picker/index.js +7 -0
- package/dist/components/form/form.js +145 -0
- package/dist/components/form/form.meta.js +142 -0
- package/dist/components/form/index.js +11 -0
- package/dist/components/gliding-highlight/gliding-highlight.js +50 -0
- package/dist/components/gliding-highlight/gliding-highlight.meta.js +135 -0
- package/dist/components/gliding-highlight/index.js +9 -0
- package/dist/components/gradient-art/gradient-art.js +168 -0
- package/dist/components/gradient-art/gradient-art.meta.js +81 -0
- package/dist/components/gradient-art/index.js +7 -0
- package/dist/components/gradient-art/renderer.js +336 -0
- package/dist/components/inline-status/index.js +7 -0
- package/dist/components/inline-status/inline-status.js +33 -0
- package/dist/components/inline-status/inline-status.meta.js +83 -0
- package/dist/components/inline-status/inline-status.variants.js +18 -0
- package/dist/components/input/index.js +7 -0
- package/dist/components/input/input.js +33 -0
- package/dist/components/input/input.meta.js +155 -0
- package/dist/components/kbd/index.js +8 -0
- package/dist/components/kbd/kbd.js +54 -0
- package/dist/components/kbd/kbd.meta.js +95 -0
- package/dist/components/label/index.js +7 -0
- package/dist/components/label/label.js +51 -0
- package/dist/components/label/label.meta.js +98 -0
- package/dist/components/line-chart/index.js +7 -0
- package/dist/components/line-chart/line-chart.js +10 -0
- package/dist/components/line-chart/line-chart.meta.js +222 -0
- package/dist/components/marker/index.js +7 -0
- package/dist/components/marker/marker.js +39 -0
- package/dist/components/marker/marker.meta.js +132 -0
- package/dist/components/marker/marker.variants.js +25 -0
- package/dist/components/marquee/index.js +7 -0
- package/dist/components/marquee/marquee.js +146 -0
- package/dist/components/marquee/marquee.meta.js +106 -0
- package/dist/components/media-image/index.js +7 -0
- package/dist/components/media-image/media-image.js +56 -0
- package/dist/components/media-image/media-image.meta.js +92 -0
- package/dist/components/media-tile/index.js +7 -0
- package/dist/components/media-tile/media-tile.js +135 -0
- package/dist/components/media-tile/media-tile.meta.js +133 -0
- package/dist/components/media-tile/media-tile.variants.js +48 -0
- package/dist/components/menu/index.js +33 -0
- package/dist/components/menu/menu.js +168 -0
- package/dist/components/menu/menu.meta.js +176 -0
- package/dist/components/message/index.js +7 -0
- package/dist/components/message/message.js +83 -0
- package/dist/components/message/message.meta.js +150 -0
- package/dist/components/message/message.variants.js +41 -0
- package/dist/components/message-scroller/index.js +9 -0
- package/dist/components/message-scroller/message-scroller.js +300 -0
- package/dist/components/message-scroller/message-scroller.meta.js +172 -0
- package/dist/components/meter/index.js +20 -0
- package/dist/components/meter/meter.js +112 -0
- package/dist/components/meter/meter.meta.js +227 -0
- package/dist/components/meter/meter.variants.js +61 -0
- package/dist/components/middle-truncate/index.js +7 -0
- package/dist/components/middle-truncate/middle-truncate.js +28 -0
- package/dist/components/middle-truncate/middle-truncate.meta.js +77 -0
- package/dist/components/note/index.js +9 -0
- package/dist/components/note/note.js +73 -0
- package/dist/components/note/note.meta.js +112 -0
- package/dist/components/note/note.variants.js +22 -0
- package/dist/components/notification-badge/index.js +15 -0
- package/dist/components/notification-badge/notification-badge.js +48 -0
- package/dist/components/notification-badge/notification-badge.meta.js +107 -0
- package/dist/components/notification-badge/notification-badge.variants.js +57 -0
- package/dist/components/number-field/index.js +7 -0
- package/dist/components/number-field/number-field.js +70 -0
- package/dist/components/number-field/number-field.meta.js +109 -0
- package/dist/components/otp-field/index.js +7 -0
- package/dist/components/otp-field/otp-field.js +70 -0
- package/dist/components/otp-field/otp-field.meta.js +197 -0
- package/dist/components/overflow-menu/index.js +7 -0
- package/dist/components/overflow-menu/overflow-menu.js +26 -0
- package/dist/components/overflow-menu/overflow-menu.meta.js +100 -0
- package/dist/components/page-header/index.js +7 -0
- package/dist/components/page-header/page-header.js +34 -0
- package/dist/components/page-header/page-header.meta.js +104 -0
- package/dist/components/page-loader/index.js +7 -0
- package/dist/components/page-loader/page-loader.js +37 -0
- package/dist/components/page-loader/page-loader.meta.js +85 -0
- package/dist/components/pagination/index.js +7 -0
- package/dist/components/pagination/pagination.js +105 -0
- package/dist/components/pagination/pagination.meta.js +141 -0
- package/dist/components/panel-group/index.js +10 -0
- package/dist/components/panel-group/panel-group.js +168 -0
- package/dist/components/panel-group/panel-group.meta.js +153 -0
- package/dist/components/panel-section/index.js +9 -0
- package/dist/components/panel-section/panel-section.js +115 -0
- package/dist/components/panel-section/panel-section.meta.js +156 -0
- package/dist/components/phone/index.js +7 -0
- package/dist/components/phone/phone.js +50 -0
- package/dist/{chunk-KFZ43RKU.js → components/phone/phone.meta.js} +3 -50
- package/dist/{chunk-NEQNXI2G.js → components/phone/status-icons.js} +4 -4
- package/dist/components/pie-chart/index.js +7 -0
- package/dist/components/pie-chart/pie-chart.js +191 -0
- package/dist/components/pie-chart/pie-chart.meta.js +210 -0
- package/dist/components/pill/index.js +9 -0
- package/dist/components/pill/pill.js +24 -0
- package/dist/components/pill/pill.meta.js +108 -0
- package/dist/components/pill/pill.variants.js +65 -0
- package/dist/components/popover/index.js +23 -0
- package/dist/components/popover/popover.js +100 -0
- package/dist/components/popover/popover.meta.js +136 -0
- package/dist/components/progress/index.js +19 -0
- package/dist/components/progress/progress.js +70 -0
- package/dist/components/progress/progress.meta.js +171 -0
- package/dist/components/progress/progress.variants.js +17 -0
- package/dist/components/radar-chart/index.js +7 -0
- package/dist/components/radar-chart/radar-chart.js +161 -0
- package/dist/components/radar-chart/radar-chart.meta.js +204 -0
- package/dist/components/radial-chart/index.js +7 -0
- package/dist/components/radial-chart/radial-chart.js +175 -0
- package/dist/components/radial-chart/radial-chart.meta.js +216 -0
- package/dist/components/radio/index.js +8 -0
- package/dist/components/radio/radio.js +39 -0
- package/dist/components/radio/radio.meta.js +104 -0
- package/dist/components/radio-card/index.js +7 -0
- package/dist/components/radio-card/radio-card.js +81 -0
- package/dist/components/radio-card/radio-card.meta.js +144 -0
- package/dist/components/radio-card/radio-card.variants.js +43 -0
- package/dist/components/relative-time/index.js +7 -0
- package/dist/components/relative-time/relative-time.js +47 -0
- package/dist/components/relative-time/relative-time.meta.js +77 -0
- package/dist/components/scroller/index.js +7 -0
- package/dist/components/scroller/scroller.js +111 -0
- package/dist/components/scroller/scroller.meta.js +118 -0
- package/dist/components/scrub-field/index.js +7 -0
- package/dist/components/scrub-field/scrub-field.js +124 -0
- package/dist/components/scrub-field/scrub-field.meta.js +139 -0
- package/dist/components/search-input/index.js +7 -0
- package/dist/components/search-input/search-input.js +91 -0
- package/dist/components/search-input/search-input.meta.js +129 -0
- package/dist/components/section-header/index.js +7 -0
- package/dist/components/section-header/section-header.js +39 -0
- package/dist/components/section-header/section-header.meta.js +174 -0
- package/dist/components/segmented-bar/index.js +14 -0
- package/dist/components/segmented-bar/segmented-bar.js +26 -0
- package/dist/components/segmented-bar/segmented-bar.meta.js +108 -0
- package/dist/components/segmented-bar/segmented-bar.variants.js +39 -0
- package/dist/components/select/index.js +25 -0
- package/dist/components/select/select.js +191 -0
- package/dist/components/select/select.meta.js +189 -0
- package/dist/components/separator/index.js +7 -0
- package/dist/components/separator/separator.js +42 -0
- package/dist/components/separator/separator.meta.js +84 -0
- package/dist/components/settings-menu/index.js +11 -0
- package/dist/components/settings-menu/settings-menu.js +101 -0
- package/dist/components/settings-menu/settings-menu.meta.js +177 -0
- package/dist/components/settings-menu/settings-menu.variants.js +15 -0
- package/dist/components/sheet/index.js +29 -0
- package/dist/components/sheet/sheet.js +121 -0
- package/dist/components/sheet/sheet.meta.js +167 -0
- package/dist/components/sheet/sheet.variants.js +21 -0
- package/dist/components/show-more/index.js +7 -0
- package/dist/components/show-more/show-more.js +87 -0
- package/dist/components/show-more/show-more.meta.js +79 -0
- package/dist/components/side-nav/index.js +13 -0
- package/dist/components/side-nav/side-nav.js +75 -0
- package/dist/components/side-nav/side-nav.meta.js +139 -0
- package/dist/components/side-nav/side-nav.variants.js +34 -0
- package/dist/components/sidebar/index.js +21 -0
- package/dist/components/sidebar/sidebar.js +196 -0
- package/dist/components/sidebar/sidebar.meta.js +118 -0
- package/dist/components/skeleton/index.js +7 -0
- package/dist/components/skeleton/skeleton.js +16 -0
- package/dist/components/skeleton/skeleton.meta.js +90 -0
- package/dist/components/slider/index.js +21 -0
- package/dist/components/slider/slider.js +115 -0
- package/dist/components/slider/slider.meta.js +214 -0
- package/dist/components/sparkline/index.js +7 -0
- package/dist/components/sparkline/sparkline.js +84 -0
- package/dist/components/sparkline/sparkline.meta.js +147 -0
- package/dist/components/spinner/index.js +7 -0
- package/dist/components/spinner/spinner.js +59 -0
- package/dist/components/spinner/spinner.meta.js +118 -0
- package/dist/components/status-bar/index.js +9 -0
- package/dist/components/status-bar/status-bar.js +40 -0
- package/dist/components/status-bar/status-bar.meta.js +117 -0
- package/dist/components/status-dot/index.js +9 -0
- package/dist/components/status-dot/status-dot.js +40 -0
- package/dist/components/status-dot/status-dot.meta.js +113 -0
- package/dist/components/status-dot/status-dot.variants.js +28 -0
- package/dist/components/stepper/index.js +17 -0
- package/dist/components/stepper/stepper.js +161 -0
- package/dist/components/stepper/stepper.meta.js +190 -0
- package/dist/components/stepper/stepper.variants.js +72 -0
- package/dist/components/streaming-text/index.js +7 -0
- package/dist/components/streaming-text/streaming-text.js +55 -0
- package/dist/components/streaming-text/streaming-text.meta.js +147 -0
- package/dist/components/switch/index.js +7 -0
- package/dist/components/switch/switch.js +26 -0
- package/dist/components/switch/switch.meta.js +133 -0
- package/dist/components/table/index.js +23 -0
- package/dist/components/table/table.js +117 -0
- package/dist/components/table/table.meta.js +143 -0
- package/dist/components/tabs/index.js +17 -0
- package/dist/components/tabs/tabs.js +58 -0
- package/dist/components/tabs/tabs.meta.js +120 -0
- package/dist/components/textarea/index.js +7 -0
- package/dist/components/textarea/textarea.js +38 -0
- package/dist/components/textarea/textarea.meta.js +117 -0
- package/dist/components/theme-selector/index.js +11 -0
- package/dist/components/theme-selector/theme-selector.js +145 -0
- package/dist/components/theme-selector/theme-selector.meta.js +181 -0
- package/dist/components/theme-switcher/index.js +7 -0
- package/dist/components/theme-switcher/theme-switcher.js +106 -0
- package/dist/components/theme-switcher/theme-switcher.meta.js +99 -0
- package/dist/components/thinking-orb/index.js +9 -0
- package/dist/components/thinking-orb/thinking-orb.js +126 -0
- package/dist/components/thinking-orb/thinking-orb.meta.js +142 -0
- package/dist/components/thinking-orb/thinking-orb.render.js +252 -0
- package/dist/components/toast/index.js +29 -0
- package/dist/components/toast/toast.js +254 -0
- package/dist/components/toast/toast.meta.js +261 -0
- package/dist/components/toggle/index.js +13 -0
- package/dist/components/toggle/toggle.js +51 -0
- package/dist/components/toggle/toggle.meta.js +129 -0
- package/dist/components/toolbar/index.js +27 -0
- package/dist/components/toolbar/toolbar.js +80 -0
- package/dist/components/toolbar/toolbar.meta.js +272 -0
- package/dist/components/toolbar/toolbar.variants.js +16 -0
- package/dist/components/tooltip/index.js +21 -0
- package/dist/components/tooltip/tooltip.js +74 -0
- package/dist/components/tooltip/tooltip.meta.js +156 -0
- package/dist/components/tree/index.js +12 -0
- package/dist/components/tree/tree.js +364 -0
- package/dist/components/tree/tree.meta.js +334 -0
- package/dist/components/video/index.js +7 -0
- package/dist/components/video/video.js +59 -0
- package/dist/components/video/video.meta.js +81 -0
- package/dist/components/workspace/index.js +9 -0
- package/dist/components/workspace/workspace.js +79 -0
- package/dist/components/workspace/workspace.meta.js +183 -0
- package/dist/foundations/accessibility.js +107 -0
- package/dist/foundations/index.js +25 -792
- package/dist/foundations/motion.js +135 -0
- package/dist/foundations/scrolling.js +62 -0
- package/dist/foundations/shape.js +113 -0
- package/dist/foundations/spacing.js +121 -0
- package/dist/foundations/surfaces.js +107 -0
- package/dist/foundations/types.js +0 -0
- package/dist/foundations/typography.js +152 -0
- package/dist/icon/Icon.js +30 -0
- package/dist/icon/IconProvider.js +27 -0
- package/dist/icon/compose.js +13 -0
- package/dist/icon/index.d.ts +13 -5
- package/dist/icon/index.js +13 -2
- package/dist/icon/registry.js +0 -0
- package/dist/icon-sets/brands.generated.js +123 -0
- package/dist/icon-sets/brands.js +10 -123
- package/dist/icon-sets/reicon.d.ts +3 -1
- package/dist/icon-sets/reicon.js +209 -1
- package/dist/index.d.ts +618 -34
- package/dist/index.js +211 -11351
- package/dist/ios/chrome.js +36 -0
- package/dist/ios/index.js +19 -315
- package/dist/ios/liquid-glass.js +103 -0
- package/dist/ios/native-app.js +46 -0
- package/dist/ios/navigation.js +63 -0
- package/dist/ios/phone-frame.js +64 -0
- package/dist/ios/preview-theme.js +83 -0
- package/dist/ios/preview.js +10 -137
- package/dist/ios/sheet.js +85 -0
- package/dist/ios/theme.js +19 -0
- package/dist/layout/AspectBox.js +27 -0
- package/dist/layout/Bleed.js +15 -0
- package/dist/layout/Center.js +21 -0
- package/dist/layout/Columns.js +70 -0
- package/dist/layout/Grid.js +50 -0
- package/dist/layout/GridOverlay.js +41 -0
- package/dist/layout/Page.js +11 -0
- package/dist/layout/Region.js +39 -0
- package/dist/layout/Row.js +45 -0
- package/dist/layout/SafeArea.js +26 -0
- package/dist/layout/Spacer.js +9 -0
- package/dist/layout/SplitPane.js +55 -0
- package/dist/layout/Stack.js +42 -0
- package/dist/layout/_responsive.js +16 -0
- package/dist/layout/_safeArea.js +18 -0
- package/dist/layout/index.d.ts +30 -8
- package/dist/layout/index.js +14 -2
- package/dist/lib/anchored-scroll.js +7 -0
- package/dist/lib/bleed.js +7 -0
- package/dist/lib/chart/cartesian.js +365 -0
- package/dist/lib/chart/chart-frame.js +163 -0
- package/dist/lib/chart/chart-legend.js +13 -0
- package/dist/lib/chart/chart-tooltip.js +38 -0
- package/dist/lib/chart/format.js +24 -0
- package/dist/lib/chart/geometry.js +114 -0
- package/dist/lib/chart/motion.js +34 -0
- package/dist/lib/chart/scale.js +72 -0
- package/dist/lib/chart/types.js +45 -0
- package/dist/lib/chart/use-arrival.js +41 -0
- package/dist/{chunk-SRQWQUTW.js → lib/cn.js} +5 -5
- package/dist/lib/component-guidance.js +215 -0
- package/dist/lib/density.js +54 -0
- package/dist/lib/field-shell.js +11 -0
- package/dist/lib/glyphs.js +9 -0
- package/dist/lib/heading-row.js +36 -0
- package/dist/lib/highlight-glide.js +84 -0
- package/dist/lib/hit-target.js +5 -0
- package/dist/lib/meta.js +0 -0
- package/dist/lib/portal-theme-scope.js +74 -0
- package/dist/{chunk-FKZXAFIY.js → lib/presentation.js} +8 -3
- package/dist/lib/refs.js +14 -0
- package/dist/lib/scrub-gesture.js +50 -0
- package/dist/lib/segmented.js +13 -0
- package/dist/lib/selection-card.js +41 -0
- package/dist/lib/status-tone.js +13 -0
- package/dist/lib/taxonomy.js +214 -0
- package/dist/lib/trim-label.js +20 -0
- package/dist/lib/use-copy.js +27 -0
- package/dist/lib/use-edge-fade.js +32 -0
- package/dist/lib/use-isomorphic-layout-effect.js +8 -0
- package/dist/lib/use-resize-observer.js +18 -0
- package/dist/lib/use-scroll-activity.js +52 -0
- package/dist/lib/use-wheel-to-horizontal.js +65 -0
- package/dist/motion/MotionProvider.js +75 -0
- package/dist/motion/Presence.js +112 -0
- package/dist/motion/Reveal.js +42 -0
- package/dist/motion/TextReveal.js +61 -0
- package/dist/motion/index.js +24 -0
- package/dist/motion/useInView.js +36 -0
- package/dist/motion/useReducedMotion.js +25 -0
- package/dist/motion/viewTransition.js +47 -0
- package/dist/patterns/auth-page.js +90 -0
- package/dist/patterns/auth-page.meta.js +27 -0
- package/dist/patterns/brand-landing-page.js +341 -0
- package/dist/patterns/brand-landing-page.meta.js +28 -0
- package/dist/patterns/chat-panel.js +185 -0
- package/dist/patterns/chat-panel.meta.js +31 -0
- package/dist/patterns/dashboard-page.js +332 -0
- package/dist/patterns/dashboard-page.meta.js +29 -0
- package/dist/patterns/feed-page.js +205 -0
- package/dist/patterns/feed-page.meta.js +25 -0
- package/dist/patterns/index.js +34 -2140
- package/dist/patterns/landing-page.js +356 -0
- package/dist/patterns/landing-page.meta.js +26 -0
- package/dist/patterns/list-detail-page.js +373 -0
- package/dist/patterns/list-detail-page.meta.js +24 -0
- package/dist/patterns/settings-page.js +268 -0
- package/dist/patterns/settings-page.meta.js +27 -0
- package/dist/presets/index.d.ts +7 -1
- package/dist/presets/index.js +53 -185
- package/dist/styles.css +118 -3
- package/dist/{theme-provider-kQszHYji.d.ts → theme-provider-S0NVJs2Y.d.ts} +6 -1
- package/dist/{chunk-NETUFI34.js → themes/_contract.js} +14 -2
- package/dist/themes/atelier/index.js +17 -1
- package/dist/themes/contrast.js +288 -0
- package/dist/themes/ember/ember.css +6 -6
- package/dist/themes/ember/index.js +16 -1
- package/dist/themes/index.d.ts +1 -1
- package/dist/themes/index.js +3 -8
- package/dist/themes/meridian/index.js +16 -1
- package/dist/themes/poppy/index.js +17 -1
- package/dist/themes/prism/index.js +17 -1
- package/dist/themes/prism/prism.css +2 -2
- package/dist/themes/registry.js +59 -0
- package/dist/themes/sable/index.js +16 -1
- package/dist/{chunk-EFLC4NA3.js → themes/theme-provider.js} +38 -54
- package/dist/themes/verdant/index.js +17 -1
- package/llms/blocks/media-player-block.md +20 -7
- package/llms/blocks/product-card-block.md +6 -4
- package/llms/blocks/task-list-block.md +1 -1
- package/llms/blocks/traffic-sources-block.md +1 -1
- package/llms/blocks/traffic-trend-block.md +5 -3
- package/llms/blocks/verify-code-block.md +1 -1
- package/llms/components/app-shell.md +5 -2
- package/llms/components/avatar.md +25 -3
- package/llms/components/button.md +20 -1
- package/llms/components/card.md +1 -1
- package/llms/components/disclosure-picker.md +168 -0
- package/llms/components/font-picker.md +104 -0
- package/llms/components/media-image.md +98 -0
- package/llms/components/media-tile.md +143 -0
- package/llms/components/page-header.md +6 -5
- package/llms/components/pie-chart.md +2 -2
- package/llms/components/radial-chart.md +1 -1
- package/llms/components/section-header.md +144 -0
- package/llms/components/sheet.md +10 -0
- package/llms/components/sidebar.md +4 -3
- package/llms/components/slider.md +14 -2
- package/llms/components/theme-selector.md +44 -4
- package/llms/components/tree.md +3 -3
- package/llms/layout/grid.md +24 -3
- package/llms/layout/region.md +16 -3
- package/llms/patterns/dashboard-page.md +3 -6
- package/llms/patterns/feed-page.md +4 -4
- package/llms/patterns/list-detail-page.md +1 -0
- package/llms/patterns/settings-page.md +2 -5
- package/llms/reference/utilities.md +84 -4
- package/llms/tasks/building-a-page.md +34 -3
- package/llms/tasks/converting-an-app.md +14 -4
- package/llms/tasks/creating-a-preset.md +4 -1
- package/llms/tasks/reviewing-a-design.md +19 -0
- package/llms/tasks/using-presets.md +19 -0
- package/llms-full.txt +1066 -78
- package/llms.txt +26 -9
- package/package.json +1 -1
- package/registry.json +2342 -164
- package/scripts/agent-setup.mjs +90 -0
- package/scripts/design-presets.mjs +59 -6
- package/scripts/grade.mjs +195 -29
- package/scripts/lint-rules.mjs +486 -10
- package/scripts/review-evidence.mjs +28 -1
- package/skills/sable/SKILL.md +67 -24
- package/targets/ios.json +45 -0
- package/dist/chunk-3IWZYBGH.js +0 -398
- package/dist/chunk-7MG4SHYX.js +0 -15
- package/dist/chunk-7QSDYBXO.js +0 -7421
- package/dist/chunk-ADLLDWLW.js +0 -15
- package/dist/chunk-C4Z3CF54.js +0 -15
- package/dist/chunk-EDXLM7YL.js +0 -5078
- package/dist/chunk-EHH4MHO6.js +0 -14
- package/dist/chunk-K7RUHUGC.js +0 -14
- package/dist/chunk-KO3NAEBF.js +0 -15
- package/dist/chunk-L4IEIQQA.js +0 -14
- package/dist/chunk-QJ6FWTUG.js +0 -40
- package/dist/chunk-VVW4UCDI.js +0 -4908
- package/dist/chunk-XAZGMY73.js +0 -187
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// src/components/empty-state/empty-state.tsx
|
|
2
|
+
import { Icon } from "../../icon/index.js";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
import { Card } from "../card/index.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
function EmptyState({
|
|
7
|
+
icon,
|
|
8
|
+
title,
|
|
9
|
+
description,
|
|
10
|
+
action,
|
|
11
|
+
code,
|
|
12
|
+
tone = "neutral",
|
|
13
|
+
size = "md",
|
|
14
|
+
surface = "none",
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
const destructive = tone === "destructive";
|
|
19
|
+
const glyph = icon ?? (destructive && code == null ? /* @__PURE__ */ jsx(Icon, { name: "warning" }) : null);
|
|
20
|
+
const Title = size === "lg" ? "h2" : "p";
|
|
21
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22
|
+
code != null ? /* @__PURE__ */ jsx("p", { className: "text-display-lg text-muted-foreground", children: code }) : null,
|
|
23
|
+
glyph != null ? /* @__PURE__ */ jsx(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: cn(
|
|
27
|
+
"flex items-center justify-center text-3xl",
|
|
28
|
+
destructive ? "text-destructive" : "text-muted-foreground"
|
|
29
|
+
),
|
|
30
|
+
children: glyph
|
|
31
|
+
}
|
|
32
|
+
) : null,
|
|
33
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex flex-col items-center", size === "lg" ? "gap-2" : "gap-1"), children: [
|
|
34
|
+
/* @__PURE__ */ jsx(Title, { className: size === "lg" ? "text-heading-2" : "text-title-lg", children: title }),
|
|
35
|
+
description != null ? /* @__PURE__ */ jsx("p", { className: "max-w-md text-body-md text-muted-foreground", children: description }) : null
|
|
36
|
+
] }),
|
|
37
|
+
action != null ? /* @__PURE__ */ jsx("div", { className: "mt-1", children: action }) : null
|
|
38
|
+
] });
|
|
39
|
+
const layout = cn(
|
|
40
|
+
"flex flex-col items-center justify-center gap-4 text-center",
|
|
41
|
+
size === "lg" ? "px-6 py-20" : "px-6 py-12"
|
|
42
|
+
);
|
|
43
|
+
const a11y = destructive ? { role: "alert" } : {};
|
|
44
|
+
if (surface === "card") {
|
|
45
|
+
return /* @__PURE__ */ jsx(Card, { className: cn(layout, "p-[var(--card-p)]", className), ...a11y, ...props, children: body });
|
|
46
|
+
}
|
|
47
|
+
return /* @__PURE__ */ jsx("div", { className: cn(layout, className), ...a11y, ...props, children: body });
|
|
48
|
+
}
|
|
49
|
+
EmptyState.displayName = "EmptyState";
|
|
50
|
+
export {
|
|
51
|
+
EmptyState
|
|
52
|
+
};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// src/components/empty-state/empty-state.meta.ts
|
|
2
|
+
var emptyStateMeta = {
|
|
3
|
+
name: "EmptyState",
|
|
4
|
+
summary: 'The centered empty / error block: optional icon or error code, title, description and an action. tone="destructive" makes it an announced error, size="lg" a page-level state, surface="card" a self-contained card.',
|
|
5
|
+
keywords: [
|
|
6
|
+
"empty",
|
|
7
|
+
"zero state",
|
|
8
|
+
"blank slate",
|
|
9
|
+
"no results",
|
|
10
|
+
"placeholder",
|
|
11
|
+
"onboarding",
|
|
12
|
+
"no data"
|
|
13
|
+
],
|
|
14
|
+
usage: {
|
|
15
|
+
description: "Use EmptyState when a content area has no items, no search results, or no first-time setup yet. The title should name the empty condition and the description/action should give the user a next step.",
|
|
16
|
+
bestPractices: [
|
|
17
|
+
{
|
|
18
|
+
guidance: "do",
|
|
19
|
+
description: 'Explain what is empty in plain language, such as "No posts yet" or "No matching collectors".'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
guidance: "do",
|
|
23
|
+
description: "Offer one next step when the user can recover, create, clear filters, or start setup."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
guidance: "do",
|
|
27
|
+
description: "Keep the icon decorative and make the title carry the meaning."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
guidance: "do",
|
|
31
|
+
description: `For a search or filter result, name the query back to the user and offer the way out, such as "No results for 'quarterly'" with a Clear filters action. An empty result that does not say what was searched leaves the user unsure whether the query or the data was wrong.`
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
guidance: "dont",
|
|
35
|
+
description: 'Use generic copy like "No data"; it gives users and agents no useful path forward.'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
guidance: "dont",
|
|
39
|
+
description: "Park anything the user needs permanently here, such as setup instructions, billing notices, or keyboard shortcuts. An empty state is the one surface guaranteed to disappear the moment content exists, so information that matters after the first item is lost exactly when the user has learned enough to want it."
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
guidance: "dont",
|
|
43
|
+
description: `Use it for a field's validation error \u2014 that is Field error messaging. Reserve tone="destructive" for a view or block that failed to load.`
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
anatomy: [
|
|
47
|
+
{
|
|
48
|
+
name: "Icon",
|
|
49
|
+
required: false,
|
|
50
|
+
description: "A decorative cue that reinforces the empty condition."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "Title",
|
|
54
|
+
required: true,
|
|
55
|
+
description: "The short message naming what is empty."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "Description",
|
|
59
|
+
required: false,
|
|
60
|
+
description: "Supporting copy that explains why the state exists or what to try next."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "Action",
|
|
64
|
+
required: false,
|
|
65
|
+
description: "One clear button or link that moves the user forward."
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
related: {
|
|
70
|
+
components: ["Button", "Icon", "Card", "Banner", "DataTable"],
|
|
71
|
+
patterns: ["FeedPage", "ListDetailPage", "DashboardPage"]
|
|
72
|
+
},
|
|
73
|
+
status: "stable",
|
|
74
|
+
props: [
|
|
75
|
+
{
|
|
76
|
+
name: "icon",
|
|
77
|
+
type: "ReactNode",
|
|
78
|
+
description: "Optional glyph above the title \u2014 an `<Icon />` takes the muted ink at 3xl; an image or illustration renders as given."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "title",
|
|
82
|
+
type: "ReactNode",
|
|
83
|
+
description: "The headline. Short and direct."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "description",
|
|
87
|
+
type: "ReactNode",
|
|
88
|
+
description: "Optional supporting line beneath the title."
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "action",
|
|
92
|
+
type: "ReactNode",
|
|
93
|
+
description: "Optional action below the copy \u2014 typically a `<Button />`."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "code",
|
|
97
|
+
type: "ReactNode",
|
|
98
|
+
description: "A large figure above the title, such as an error code (404)."
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "tone",
|
|
102
|
+
type: '"neutral" | "destructive"',
|
|
103
|
+
default: '"neutral"',
|
|
104
|
+
description: 'destructive is an error state: a destructive icon (a warning by default) and role="alert" so it is announced.'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "size",
|
|
108
|
+
type: '"md" | "lg"',
|
|
109
|
+
default: '"md"',
|
|
110
|
+
description: "lg is page-level: the title is an h2 and the block takes more room. md sits in a panel, list or card."
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "surface",
|
|
114
|
+
type: '"none" | "card"',
|
|
115
|
+
default: '"none"',
|
|
116
|
+
description: "card draws it as a Card, for an error or empty block standing on its own in a page."
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
variants: {
|
|
120
|
+
tone: ["neutral", "destructive"],
|
|
121
|
+
size: ["md", "lg"],
|
|
122
|
+
surface: ["none", "card"]
|
|
123
|
+
},
|
|
124
|
+
tokensUsed: ["muted", "muted-foreground", "foreground", "destructive"],
|
|
125
|
+
a11y: [
|
|
126
|
+
"Decorative icons should not carry meaning the title doesn't already convey.",
|
|
127
|
+
"Pair with an actionable next step so the zero-state is a path forward, not a dead end."
|
|
128
|
+
],
|
|
129
|
+
examples: [
|
|
130
|
+
{
|
|
131
|
+
label: "With icon and action",
|
|
132
|
+
code: '<EmptyState icon={<Icon name="info" />} title="No posts yet" description="Create your first." action={<Button>New post</Button>} />'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
label: "No search results",
|
|
136
|
+
code: '<EmptyState icon={<Icon name="search" />} title="No matching posts" description="Try a different keyword or clear your filters." action={<Button variant="secondary">Clear filters</Button>} />'
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
label: "First-run setup",
|
|
140
|
+
code: '<EmptyState surface="card" icon={<Icon name="sparkles" />} title="Start your collection" description="Create a first edition, import an existing drop, or invite collaborators." action={<Row gap={1}><Button>Create edition</Button><Button variant="ghost">Import</Button></Row>} />'
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
label: "Page-level error",
|
|
144
|
+
code: '<EmptyState tone="destructive" size="lg" code="404" title="Page not found" description="The page you are looking for has moved or never existed." action={<Button>Go home</Button>} />'
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
label: "Error card",
|
|
148
|
+
code: '<EmptyState tone="destructive" surface="card" title="Could not load this edition" description="Check your connection and try again." action={<Button variant="secondary">Retry</Button>} />'
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
label: "Empty table body",
|
|
152
|
+
code: '<DataTable data={[]} columns={[{ key: "name", header: "Collector" }, { key: "status", header: "Status" }]} empty={<EmptyState title="No collectors yet" description="Collectors appear here after the first mint." />} />'
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
};
|
|
156
|
+
export {
|
|
157
|
+
emptyStateMeta
|
|
158
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/components/entity/entity.tsx
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import { entityVariants } from "./entity.variants.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
function Entity({
|
|
6
|
+
leading,
|
|
7
|
+
title,
|
|
8
|
+
subtitle,
|
|
9
|
+
action,
|
|
10
|
+
density,
|
|
11
|
+
className,
|
|
12
|
+
interactive,
|
|
13
|
+
onSelect,
|
|
14
|
+
selected,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
+
leading != null ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center", children: leading }) : null,
|
|
19
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
20
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-title-sm text-foreground", children: title }),
|
|
21
|
+
subtitle != null ? /* @__PURE__ */ jsx("span", { className: "truncate text-body-sm text-muted-foreground", children: subtitle }) : null
|
|
22
|
+
] })
|
|
23
|
+
] });
|
|
24
|
+
return /* @__PURE__ */ jsxs(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
className: cn(
|
|
28
|
+
entityVariants({ density }),
|
|
29
|
+
// Hover and selected fills are steps off the surface the row sits on
|
|
30
|
+
// (sable-surface-interactive), so a selected row reads on a card, a
|
|
31
|
+
// well or a popover alike — and stays filled while hovered, which a
|
|
32
|
+
// fixed hover:bg-muted/50 used to override.
|
|
33
|
+
interactive && "sable-surface-interactive relative rounded-[var(--entity-radius,var(--radius-md))] motion-interactive",
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
"data-selected": interactive && selected ? "" : void 0,
|
|
37
|
+
...props,
|
|
38
|
+
children: [
|
|
39
|
+
interactive ? (
|
|
40
|
+
// design-lint-disable-next-line raw-button -- the whole row is the hit target (stretched ::after); a row has its own anatomy, not a Button's height/padding
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
"button",
|
|
43
|
+
{
|
|
44
|
+
type: "button",
|
|
45
|
+
onClick: onSelect,
|
|
46
|
+
"aria-current": selected ? "true" : void 0,
|
|
47
|
+
className: "flex min-w-0 flex-1 cursor-pointer items-center gap-3 text-start outline-none motion-interactive after:absolute after:inset-0 after:rounded-[var(--entity-radius,var(--radius-md))] focus-visible:after:ring-2 focus-visible:after:ring-ring",
|
|
48
|
+
children: body
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
) : body,
|
|
52
|
+
action != null ? /* @__PURE__ */ jsx(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: cn(
|
|
56
|
+
"flex shrink-0 items-center",
|
|
57
|
+
// Above the stretched hit area, so the action keeps its own clicks.
|
|
58
|
+
interactive && "relative z-10"
|
|
59
|
+
),
|
|
60
|
+
children: action
|
|
61
|
+
}
|
|
62
|
+
) : null
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
Entity.displayName = "Entity";
|
|
68
|
+
export {
|
|
69
|
+
Entity
|
|
70
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// src/components/entity/entity.meta.ts
|
|
2
|
+
var entityMeta = {
|
|
3
|
+
name: "Entity",
|
|
4
|
+
summary: "A list-row record: leading visual + title/subtitle column + trailing action, with truncating text. Presentational by default (no hover); `interactive` rows gain the hover highlight, focus ring, and keyboard activation, and `selected` marks the current one. Compact/comfortable density.",
|
|
5
|
+
status: "stable",
|
|
6
|
+
keywords: [
|
|
7
|
+
"entity",
|
|
8
|
+
"identity",
|
|
9
|
+
"object",
|
|
10
|
+
"avatar row"
|
|
11
|
+
],
|
|
12
|
+
usage: {
|
|
13
|
+
description: "Use Entity to show a compact identity block for a person, organization, file, project, or other object.",
|
|
14
|
+
bestPractices: [
|
|
15
|
+
{
|
|
16
|
+
guidance: "do",
|
|
17
|
+
description: "Use a clear title and one or two useful metadata lines."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
guidance: "do",
|
|
21
|
+
description: "Pair with Avatar or Badge (dot for a status) when identity needs state or type."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
guidance: "do",
|
|
25
|
+
description: "For a list, stack Entity rows directly in a column; each row owns its padding. For a list in a card, put the rows in CardList, which insets them to the card's own padding and divides them, so the rows line up with the card's header instead of being tuned by hand with px-* classes."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
guidance: "dont",
|
|
29
|
+
description: "Do not use Entity for long descriptions, editable fields, or full card content."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
guidance: "dont",
|
|
33
|
+
description: "Do not make the whole row a link when it also carries a trailing action. Nesting an interactive element inside a link is invalid, and the action becomes unreachable by keyboard."
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
related: {
|
|
38
|
+
components: ["Avatar", "Badge"]
|
|
39
|
+
},
|
|
40
|
+
props: [
|
|
41
|
+
{
|
|
42
|
+
name: "leading",
|
|
43
|
+
type: "ReactNode",
|
|
44
|
+
description: "Leading visual \u2014 typically an Avatar or an Icon."
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "title",
|
|
48
|
+
type: "ReactNode",
|
|
49
|
+
description: "Primary line (text-title-sm, truncated). Required."
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "subtitle",
|
|
53
|
+
type: "ReactNode",
|
|
54
|
+
description: "Secondary line (text-body-sm muted, truncated)."
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "action",
|
|
58
|
+
type: "ReactNode",
|
|
59
|
+
description: "Trailing slot \u2014 typically a ghost icon Button or a StatusDot."
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "interactive",
|
|
63
|
+
type: "boolean",
|
|
64
|
+
default: "false",
|
|
65
|
+
description: "Make the whole row a target: the leading visual and text become a native <button> whose hit area stretches over the row (focus ring, Enter/Space). The action stays outside it. Requires onSelect."
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "onSelect",
|
|
69
|
+
type: "() => void",
|
|
70
|
+
description: "Activation handler for an interactive row (fired on click and Enter/Space). Required when interactive."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "selected",
|
|
74
|
+
type: "boolean",
|
|
75
|
+
default: "false",
|
|
76
|
+
description: `Interactive rows only: the current row of a selectable list (the record open in a list\u2013detail view). Sets aria-current="true" on the row's button and paints the selected fill, a step off the surface the row sits on, which holds on hover.`
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "density",
|
|
80
|
+
type: '"compact" | "comfortable"',
|
|
81
|
+
default: '"compact"',
|
|
82
|
+
description: "Row padding: compact (12px \xD7 10px, the default) or comfortable (16px \xD7 12px), on the spacing scale. The insets read --entity-px / --entity-py first, which CardList sets from the card's own padding so rows in a card line up with its header."
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
variants: {
|
|
86
|
+
density: ["compact", "comfortable"]
|
|
87
|
+
},
|
|
88
|
+
tokensUsed: ["accent", "accent-foreground", "foreground", "muted-foreground", "ring"],
|
|
89
|
+
a11y: [
|
|
90
|
+
"Default rows are presentational layout; semantics come from the content you place in title/subtitle/action.",
|
|
91
|
+
"interactive rows render a real <button> around the leading visual and text, with its ::after stretched over the whole row \u2014 native focus, a focus-visible ring, and Enter/Space. The action slot sits outside that button and above the overlay, so a Button there stays valid HTML and keeps its own clicks.",
|
|
92
|
+
"Give any interactive action an accessible label (e.g. aria-label on a ghost icon Button).",
|
|
93
|
+
'A selected row announces aria-current="true" on its button, so the current record is spoken, not only shown by its fill.'
|
|
94
|
+
],
|
|
95
|
+
examples: [
|
|
96
|
+
{
|
|
97
|
+
label: "Person row",
|
|
98
|
+
code: '<Entity leading={<Avatar fallback="AM" />} title="Alex Morgan" subtitle="@alex" action={<Button variant="ghost" size="icon" aria-label="More"><Icon name="ellipsis" /></Button>} />'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
label: "Interactive (selectable) row",
|
|
102
|
+
code: '<Entity interactive onSelect={() => selectUser(user)} leading={<Avatar fallback="AM" />} title="Alex Morgan" subtitle="@alex" />'
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
};
|
|
106
|
+
export {
|
|
107
|
+
entityMeta
|
|
108
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/components/entity/entity.variants.ts
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
var entityVariants = cva("flex items-center gap-3", {
|
|
4
|
+
variants: {
|
|
5
|
+
density: {
|
|
6
|
+
compact: "px-[var(--entity-px,--spacing(3))] py-[var(--entity-py,--spacing(2.5))]",
|
|
7
|
+
comfortable: "px-[var(--entity-px,--spacing(4))] py-[var(--entity-py,--spacing(3))]"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
defaultVariants: {
|
|
11
|
+
density: "compact"
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
export {
|
|
15
|
+
entityVariants
|
|
16
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/feedback/feedback.tsx
|
|
4
|
+
import { useId, useState } from "react";
|
|
5
|
+
import { cn } from "../../lib/cn.js";
|
|
6
|
+
import { Button } from "../button/index.js";
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../popover/index.js";
|
|
8
|
+
import { Textarea } from "../textarea/index.js";
|
|
9
|
+
import { Toggle, ToggleGroup } from "../toggle/index.js";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
var DEFAULT_RATINGS = [
|
|
12
|
+
{ value: "bad", label: "\u{1F641}" },
|
|
13
|
+
{ value: "ok", label: "\u{1F610}" },
|
|
14
|
+
{ value: "good", label: "\u{1F642}" }
|
|
15
|
+
];
|
|
16
|
+
function Feedback({
|
|
17
|
+
label = "Feedback",
|
|
18
|
+
heading = "Send feedback",
|
|
19
|
+
placeholder = "What can we improve?",
|
|
20
|
+
submitLabel = "Send",
|
|
21
|
+
ratings = DEFAULT_RATINGS,
|
|
22
|
+
onSubmit,
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
const [open, setOpen] = useState(false);
|
|
27
|
+
const [rating, setRating] = useState(void 0);
|
|
28
|
+
const [message, setMessage] = useState("");
|
|
29
|
+
const headingId = useId();
|
|
30
|
+
function reset() {
|
|
31
|
+
setRating(void 0);
|
|
32
|
+
setMessage("");
|
|
33
|
+
}
|
|
34
|
+
function handleSubmit(event) {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
if (!rating && message.trim() === "") return;
|
|
37
|
+
onSubmit?.({ rating, message });
|
|
38
|
+
reset();
|
|
39
|
+
setOpen(false);
|
|
40
|
+
}
|
|
41
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
PopoverTrigger,
|
|
44
|
+
{
|
|
45
|
+
render: /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", children: label })
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "w-80", children: /* @__PURE__ */ jsxs(
|
|
49
|
+
"form",
|
|
50
|
+
{
|
|
51
|
+
className: cn("flex flex-col gap-3", className),
|
|
52
|
+
"aria-labelledby": headingId,
|
|
53
|
+
onSubmit: handleSubmit,
|
|
54
|
+
...props,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx("p", { id: headingId, className: "text-title-sm text-popover-foreground", children: heading }),
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
ToggleGroup,
|
|
59
|
+
{
|
|
60
|
+
value: rating ? [rating] : [],
|
|
61
|
+
onValueChange: (value) => setRating(value[0]),
|
|
62
|
+
"aria-label": "Rating",
|
|
63
|
+
children: ratings.map((option) => /* @__PURE__ */ jsx(
|
|
64
|
+
Toggle,
|
|
65
|
+
{
|
|
66
|
+
value: option.value,
|
|
67
|
+
"aria-label": option.value,
|
|
68
|
+
className: "flex-1 text-base",
|
|
69
|
+
children: option.label
|
|
70
|
+
},
|
|
71
|
+
option.value
|
|
72
|
+
))
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsx(
|
|
76
|
+
Textarea,
|
|
77
|
+
{
|
|
78
|
+
value: message,
|
|
79
|
+
onChange: (event) => setMessage(event.target.value),
|
|
80
|
+
placeholder,
|
|
81
|
+
"aria-label": placeholder
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-end gap-2", children: /* @__PURE__ */ jsx(Button, { type: "submit", size: "sm", disabled: !rating && message.trim() === "", children: submitLabel }) })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
) })
|
|
88
|
+
] });
|
|
89
|
+
}
|
|
90
|
+
Feedback.displayName = "Feedback";
|
|
91
|
+
export {
|
|
92
|
+
Feedback
|
|
93
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// src/components/feedback/feedback.meta.ts
|
|
2
|
+
var feedbackMeta = {
|
|
3
|
+
name: "Feedback",
|
|
4
|
+
summary: "A compact feedback popover. Composes Popover + Textarea + Button + Toggle into a rating row plus a message field; submitting reports the rating + message and closes the popover.",
|
|
5
|
+
status: "stable",
|
|
6
|
+
keywords: [
|
|
7
|
+
"feedback",
|
|
8
|
+
"sentiment",
|
|
9
|
+
"rating",
|
|
10
|
+
"prompt"
|
|
11
|
+
],
|
|
12
|
+
usage: {
|
|
13
|
+
description: "Use Feedback to collect lightweight sentiment, usefulness, or quality signals from users.",
|
|
14
|
+
bestPractices: [
|
|
15
|
+
{
|
|
16
|
+
guidance: "do",
|
|
17
|
+
description: "Ask for feedback at a moment when the user has enough context to answer."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
guidance: "do",
|
|
21
|
+
description: "Keep the prompt short and optional unless feedback is required by the workflow."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
guidance: "dont",
|
|
25
|
+
description: "Do not use Feedback for errors, alerts, or required support forms."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
guidance: "dont",
|
|
29
|
+
description: "Do not require the message field. Most feedback is a rating with no comment, and forcing prose is how a feedback control stops being used."
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
related: {
|
|
34
|
+
components: [
|
|
35
|
+
"Toast",
|
|
36
|
+
"Banner",
|
|
37
|
+
"Form"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
props: [
|
|
41
|
+
{
|
|
42
|
+
name: "label",
|
|
43
|
+
type: "string",
|
|
44
|
+
default: '"Feedback"',
|
|
45
|
+
description: "Trigger button text."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "heading",
|
|
49
|
+
type: "string",
|
|
50
|
+
default: '"Send feedback"',
|
|
51
|
+
description: "Heading shown above the rating row."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "placeholder",
|
|
55
|
+
type: "string",
|
|
56
|
+
default: '"What can we improve?"',
|
|
57
|
+
description: "Placeholder for the message field."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "submitLabel",
|
|
61
|
+
type: "string",
|
|
62
|
+
default: '"Send"',
|
|
63
|
+
description: "Submit button text."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "ratings",
|
|
67
|
+
type: "FeedbackRating[]",
|
|
68
|
+
default: "\u{1F641} / \u{1F610} / \u{1F642}",
|
|
69
|
+
description: "The rating options shown as a row of toggles. Each is { value, label }."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "onSubmit",
|
|
73
|
+
type: "(data: { rating?: string; message: string }) => void",
|
|
74
|
+
description: "Called with the selected rating + message when the form is submitted."
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
tokensUsed: [
|
|
78
|
+
"popover",
|
|
79
|
+
"popover-foreground",
|
|
80
|
+
"border",
|
|
81
|
+
"input",
|
|
82
|
+
"card",
|
|
83
|
+
"foreground",
|
|
84
|
+
"muted-foreground",
|
|
85
|
+
"accent",
|
|
86
|
+
"accent-foreground",
|
|
87
|
+
"ring"
|
|
88
|
+
],
|
|
89
|
+
a11y: [
|
|
90
|
+
"Trigger opens the popover on press; Base UI manages focus into the form and restores it to the trigger on close.",
|
|
91
|
+
"The rating row is a Base UI ToggleGroup with arrow-key roving focus; each toggle carries an aria-label.",
|
|
92
|
+
'The form is named by its heading (aria-labelledby), so it is announced as "Send feedback" rather than an unnamed form.',
|
|
93
|
+
"The message field carries an aria-label matching its placeholder.",
|
|
94
|
+
"Submit is disabled until there is a rating or a non-whitespace message. Either alone is a complete answer."
|
|
95
|
+
],
|
|
96
|
+
examples: [
|
|
97
|
+
{
|
|
98
|
+
label: "Basic",
|
|
99
|
+
code: "<Feedback onSubmit={({ rating, message }) => console.log(rating, message)} />"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
label: "Custom labels",
|
|
103
|
+
code: '<Feedback label="Tell us" submitLabel="Send it" placeholder="Describe the issue\u2026" />'
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
};
|
|
107
|
+
export {
|
|
108
|
+
feedbackMeta
|
|
109
|
+
};
|