@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,254 @@
|
|
|
1
|
+
// src/components/toast/toast.tsx
|
|
2
|
+
import { Toast as Base } from "@base-ui/react/toast";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
import { Icon } from "../../icon/index.js";
|
|
5
|
+
import { cn } from "../../lib/cn.js";
|
|
6
|
+
import { Button } from "../button/button.js";
|
|
7
|
+
import { hitTargetMin } from "../../lib/hit-target.js";
|
|
8
|
+
import { withPortalThemeScope } from "../../lib/portal-theme-scope.js";
|
|
9
|
+
import { Spinner } from "../spinner/spinner.js";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
var toastManager = Base.createToastManager();
|
|
12
|
+
var POSITION = {
|
|
13
|
+
"top-left": "top-4 left-4 items-start",
|
|
14
|
+
"top-center": "top-4 left-1/2 -translate-x-1/2 items-center",
|
|
15
|
+
"top-right": "top-4 right-4 items-end",
|
|
16
|
+
"bottom-left": "bottom-4 left-4 items-start",
|
|
17
|
+
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2 items-center",
|
|
18
|
+
"bottom-right": "bottom-4 right-4 items-end"
|
|
19
|
+
};
|
|
20
|
+
var ENTER_MOTION = {
|
|
21
|
+
"top-left": "motion-slide-right",
|
|
22
|
+
"top-center": "motion-slide-down",
|
|
23
|
+
"top-right": "motion-slide-left",
|
|
24
|
+
"bottom-left": "motion-slide-right",
|
|
25
|
+
"bottom-center": "motion-slide-up",
|
|
26
|
+
"bottom-right": "motion-slide-left"
|
|
27
|
+
};
|
|
28
|
+
var STACKED_ROOT = [
|
|
29
|
+
// design-lint-disable-next-line raw-z-index -- orders the cards inside the viewport's own stacking context (it is fixed at z-(--z-toast)); not a page layer
|
|
30
|
+
"absolute inset-x-0 z-[calc(100-var(--toast-index))] select-none",
|
|
31
|
+
"[--toast-gap:--spacing(2)] [--toast-peek:--spacing(3)]",
|
|
32
|
+
"[--toast-scale:max(0,1-var(--toast-index)*0.05)]",
|
|
33
|
+
"[--toast-h:var(--toast-frontmost-height,var(--toast-height))]",
|
|
34
|
+
"h-(--toast-h) data-expanded:h-(--toast-height)",
|
|
35
|
+
// Collapsed: shrink about the anchored edge, then lift a peek per card.
|
|
36
|
+
"[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+var(--toast-dir)*(var(--toast-index)*var(--toast-peek)+(1-var(--toast-scale))*var(--toast-h))))_scale(var(--toast-scale))]",
|
|
37
|
+
// Fanned out: Base UI's offset is the heights in front of it; add the gaps.
|
|
38
|
+
"data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+var(--toast-dir)*(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap))))]",
|
|
39
|
+
// Arrive from the anchored edge and leave the same way, unless swiped or
|
|
40
|
+
// pushed out by the limit, which only fade.
|
|
41
|
+
"data-starting-style:[translate:0_calc(var(--toast-dir)*-100%)] data-starting-style:opacity-0",
|
|
42
|
+
"[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[translate:0_calc(var(--toast-dir)*-100%)]",
|
|
43
|
+
"data-ending-style:opacity-0 data-limited:opacity-0",
|
|
44
|
+
// Fanned out, bridges the gap to the next card, so the pointer stays on the
|
|
45
|
+
// stack and the list does not collapse under it.
|
|
46
|
+
"after:absolute after:inset-x-0 after:h-[calc(var(--toast-gap)+1px)] not-data-expanded:after:hidden",
|
|
47
|
+
// Collapsed, the deck lifts as one: cards resting on each other barely shade
|
|
48
|
+
// each other. A full shadow on every card stacked a slab per card, and a
|
|
49
|
+
// theme with hard offset shadows (Poppy's reach 12px, past the 12px peek)
|
|
50
|
+
// painted the front card's slab over the cards behind it. So the front card
|
|
51
|
+
// steps down to shadow-md and the cards behind to shadow-sm; fanned out,
|
|
52
|
+
// each is a toast again and takes the full step back.
|
|
53
|
+
"not-data-expanded:shadow-md not-data-expanded:has-[>[data-behind]]:shadow-sm",
|
|
54
|
+
"transition-[transform,translate,opacity,height,box-shadow] duration-(--motion-duration-slow) ease-emphasized"
|
|
55
|
+
].join(" ");
|
|
56
|
+
var STACKED_EDGE = {
|
|
57
|
+
top: "top-0 origin-top [--toast-dir:1] after:top-full",
|
|
58
|
+
bottom: "bottom-0 origin-bottom [--toast-dir:-1] after:bottom-full"
|
|
59
|
+
};
|
|
60
|
+
var edgeOf = (position) => position.startsWith("top") ? "top" : "bottom";
|
|
61
|
+
var ToastViewportContext = createContext({
|
|
62
|
+
position: "top-right",
|
|
63
|
+
stacked: false
|
|
64
|
+
});
|
|
65
|
+
function persistsByDefault(type, options) {
|
|
66
|
+
return type === "loading" || type === "error" || options?.actionProps !== void 0;
|
|
67
|
+
}
|
|
68
|
+
function withPersistence(options) {
|
|
69
|
+
const type = options.type;
|
|
70
|
+
return options.timeout === void 0 && persistsByDefault(type, options) ? { ...options, timeout: 0 } : options;
|
|
71
|
+
}
|
|
72
|
+
function useToast() {
|
|
73
|
+
const manager = Base.useToastManager();
|
|
74
|
+
return { ...manager, add: (options) => manager.add(withPersistence(options)) };
|
|
75
|
+
}
|
|
76
|
+
var useToastManager = useToast;
|
|
77
|
+
function show(type, message, options) {
|
|
78
|
+
return toastManager.add(withPersistence({ title: message, type, ...options }));
|
|
79
|
+
}
|
|
80
|
+
var toast = Object.assign(
|
|
81
|
+
(message, options) => show(void 0, message, options),
|
|
82
|
+
{
|
|
83
|
+
success: (m, o) => show("success", m, o),
|
|
84
|
+
error: (m, o) => show("error", m, o),
|
|
85
|
+
warning: (m, o) => show("warning", m, o),
|
|
86
|
+
info: (m, o) => show("info", m, o),
|
|
87
|
+
message: (m, o) => show(void 0, m, o),
|
|
88
|
+
loading: (m, o) => show("loading", m, o),
|
|
89
|
+
custom: (o) => toastManager.add(withPersistence(o)),
|
|
90
|
+
add: (o) => toastManager.add(withPersistence(o)),
|
|
91
|
+
promise: toastManager.promise,
|
|
92
|
+
dismiss: (id) => toastManager.close(id),
|
|
93
|
+
update: toastManager.update
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
var ToastPortal = withPortalThemeScope(Base.Portal);
|
|
97
|
+
function ToastViewport({
|
|
98
|
+
className,
|
|
99
|
+
position = "top-right",
|
|
100
|
+
stacked = false,
|
|
101
|
+
...props
|
|
102
|
+
}) {
|
|
103
|
+
return /* @__PURE__ */ jsx(ToastViewportContext.Provider, { value: { position, stacked }, children: /* @__PURE__ */ jsx(ToastPortal, { children: /* @__PURE__ */ jsx(
|
|
104
|
+
Base.Viewport,
|
|
105
|
+
{
|
|
106
|
+
className: cn(
|
|
107
|
+
"fixed z-(--z-toast) w-95 max-w-[90vw] outline-none",
|
|
108
|
+
// Stacked toasts are positioned against the viewport, not laid out in it.
|
|
109
|
+
!stacked && "flex flex-col gap-2",
|
|
110
|
+
POSITION[position],
|
|
111
|
+
className
|
|
112
|
+
),
|
|
113
|
+
...props
|
|
114
|
+
}
|
|
115
|
+
) }) });
|
|
116
|
+
}
|
|
117
|
+
function ToastRoot({ className, ...props }) {
|
|
118
|
+
const { position, stacked } = useContext(ToastViewportContext);
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
Base.Root,
|
|
121
|
+
{
|
|
122
|
+
className: cn(
|
|
123
|
+
"flex w-full gap-3 rounded-md border border-border-floating bg-popover p-4 text-popover-foreground shadow-xl",
|
|
124
|
+
stacked ? [STACKED_ROOT, STACKED_EDGE[edgeOf(position)]] : ENTER_MOTION[position],
|
|
125
|
+
className
|
|
126
|
+
),
|
|
127
|
+
...props
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
function ToastContent({ className, ...props }) {
|
|
132
|
+
const { stacked } = useContext(ToastViewportContext);
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
Base.Content,
|
|
135
|
+
{
|
|
136
|
+
className: cn(
|
|
137
|
+
"flex min-w-0 flex-1 gap-3",
|
|
138
|
+
stacked && "transition-opacity duration-(--motion-duration-base) ease-standard data-behind:not-data-expanded:pointer-events-none data-behind:not-data-expanded:opacity-0",
|
|
139
|
+
className
|
|
140
|
+
),
|
|
141
|
+
...props
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
function ToastTitle({ className, ...props }) {
|
|
146
|
+
return /* @__PURE__ */ jsx(
|
|
147
|
+
Base.Title,
|
|
148
|
+
{
|
|
149
|
+
className: cn("text-title-sm", className),
|
|
150
|
+
...props
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
function ToastDescription({ className, ...props }) {
|
|
155
|
+
return /* @__PURE__ */ jsx(
|
|
156
|
+
Base.Description,
|
|
157
|
+
{
|
|
158
|
+
className: cn("text-body-sm text-muted-foreground", className),
|
|
159
|
+
...props
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
function ToastClose({ className, children, ...props }) {
|
|
164
|
+
return /* @__PURE__ */ jsx(
|
|
165
|
+
Base.Close,
|
|
166
|
+
{
|
|
167
|
+
className: cn(
|
|
168
|
+
"-m-1 ms-auto flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-muted-foreground outline-none motion-interactive",
|
|
169
|
+
hitTargetMin,
|
|
170
|
+
"hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
171
|
+
className
|
|
172
|
+
),
|
|
173
|
+
"aria-label": "Dismiss",
|
|
174
|
+
...props,
|
|
175
|
+
children
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
function ToastAction({ className, ...props }) {
|
|
180
|
+
return /* @__PURE__ */ jsx(Base.Action, { render: /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", className }), ...props });
|
|
181
|
+
}
|
|
182
|
+
function ToastProvider({
|
|
183
|
+
children,
|
|
184
|
+
timeout,
|
|
185
|
+
limit,
|
|
186
|
+
closeIcon,
|
|
187
|
+
position,
|
|
188
|
+
stacked,
|
|
189
|
+
viewportClassName
|
|
190
|
+
}) {
|
|
191
|
+
return /* @__PURE__ */ jsxs(Base.Provider, { timeout, limit, toastManager, children: [
|
|
192
|
+
children,
|
|
193
|
+
/* @__PURE__ */ jsx(
|
|
194
|
+
ToastList,
|
|
195
|
+
{
|
|
196
|
+
closeIcon,
|
|
197
|
+
position,
|
|
198
|
+
stacked,
|
|
199
|
+
viewportClassName
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
] });
|
|
203
|
+
}
|
|
204
|
+
var TYPE_ACCENT = {
|
|
205
|
+
success: "bg-success",
|
|
206
|
+
error: "bg-destructive",
|
|
207
|
+
warning: "bg-tone-warning",
|
|
208
|
+
info: "bg-tone-info"
|
|
209
|
+
};
|
|
210
|
+
function ToastList({
|
|
211
|
+
closeIcon,
|
|
212
|
+
position,
|
|
213
|
+
stacked,
|
|
214
|
+
viewportClassName
|
|
215
|
+
}) {
|
|
216
|
+
const { toasts } = useToast();
|
|
217
|
+
return /* @__PURE__ */ jsx(ToastViewport, { position, stacked, className: viewportClassName, children: toasts.map((item) => {
|
|
218
|
+
const accent = item.type ? TYPE_ACCENT[item.type] : void 0;
|
|
219
|
+
return /* @__PURE__ */ jsx(ToastRoot, { toast: item, children: /* @__PURE__ */ jsxs(ToastContent, { children: [
|
|
220
|
+
item.type === "loading" ? /* @__PURE__ */ jsx(
|
|
221
|
+
Spinner,
|
|
222
|
+
{
|
|
223
|
+
"aria-hidden": true,
|
|
224
|
+
className: "mt-0.5 size-4 shrink-0 text-muted-foreground"
|
|
225
|
+
}
|
|
226
|
+
) : accent ? /* @__PURE__ */ jsx(
|
|
227
|
+
"span",
|
|
228
|
+
{
|
|
229
|
+
"aria-hidden": true,
|
|
230
|
+
className: cn("w-1 shrink-0 self-stretch rounded-full", accent)
|
|
231
|
+
}
|
|
232
|
+
) : null,
|
|
233
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
234
|
+
item.title ? /* @__PURE__ */ jsx(ToastTitle, { children: item.title }) : null,
|
|
235
|
+
item.description ? /* @__PURE__ */ jsx(ToastDescription, { children: item.description }) : null
|
|
236
|
+
] }),
|
|
237
|
+
/* @__PURE__ */ jsx(ToastAction, { className: "self-center" }),
|
|
238
|
+
/* @__PURE__ */ jsx(ToastClose, { children: closeIcon ?? /* @__PURE__ */ jsx(Icon, { name: "xmark", className: "text-sm" }) })
|
|
239
|
+
] }) }, item.id);
|
|
240
|
+
}) });
|
|
241
|
+
}
|
|
242
|
+
export {
|
|
243
|
+
ToastAction,
|
|
244
|
+
ToastClose,
|
|
245
|
+
ToastContent,
|
|
246
|
+
ToastDescription,
|
|
247
|
+
ToastProvider,
|
|
248
|
+
ToastRoot,
|
|
249
|
+
ToastTitle,
|
|
250
|
+
ToastViewport,
|
|
251
|
+
toast,
|
|
252
|
+
useToast,
|
|
253
|
+
useToastManager
|
|
254
|
+
};
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// src/components/toast/toast.meta.ts
|
|
2
|
+
var toastMeta = {
|
|
3
|
+
name: "Toast",
|
|
4
|
+
// A system, not an import: the parts are ToastProvider / toast() / ToastRoot…
|
|
5
|
+
// and nothing is exported as plain `Toast`.
|
|
6
|
+
system: true,
|
|
7
|
+
summary: "Imperative notification system over Base UI Toast \u2014 auto-dismiss timers, swipe-to-dismiss, focus management, ARIA live-region announcements, and a limit-aware stack. Wrap the app in ToastProvider, then push toasts from anywhere with the global, Sonner-shaped toast() (toast.success/error/info/warning/loading/promise/dismiss) or the useToast() hook inside components.",
|
|
8
|
+
keywords: [
|
|
9
|
+
"toast",
|
|
10
|
+
"notification",
|
|
11
|
+
"snackbar",
|
|
12
|
+
"feedback",
|
|
13
|
+
"success",
|
|
14
|
+
"error",
|
|
15
|
+
"promise",
|
|
16
|
+
"loading",
|
|
17
|
+
"undo"
|
|
18
|
+
],
|
|
19
|
+
usage: {
|
|
20
|
+
description: "Use Toast for transient feedback caused by a user action: saved, failed, copied, queued, uploaded, or undone. Use Banner for persistent page/app state and InlineStatus or Field errors for feedback that must remain attached to content.",
|
|
21
|
+
bestPractices: [
|
|
22
|
+
{
|
|
23
|
+
guidance: "do",
|
|
24
|
+
description: "Mount one ToastProvider near the app root before any code calls toast() or useToast()."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
guidance: "do",
|
|
28
|
+
description: "Use toast.promise for async actions so loading, success, and error states stay tied to one notification."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
guidance: "do",
|
|
32
|
+
description: "Keep toast copy short and outcome-focused. Add an action only when it is immediately useful, such as Undo."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
guidance: "dont",
|
|
36
|
+
description: "Use Toast for critical blockers or persistent outages. Use Banner or Dialog when the user must notice and act."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
guidance: "dont",
|
|
40
|
+
description: "Fire multiple toasts for one operation. Update the same toast when a task progresses."
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
guidance: "dont",
|
|
44
|
+
description: "Put the only path to an action in a toast that auto-dismisses. An Undo that expires on a timer is data loss on a schedule, so error toasts and any toast carrying actionProps default to timeout 0 and wait to be read \u2014 pass an explicit timeout only when the action is also reachable somewhere else. When a timeout exists at all, 5s is the floor: anything shorter cannot be read and acted on."
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
anatomy: [
|
|
48
|
+
{
|
|
49
|
+
name: "Viewport",
|
|
50
|
+
required: true,
|
|
51
|
+
description: "The positioned live-region stack rendered by ToastProvider."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "Surface",
|
|
55
|
+
required: true,
|
|
56
|
+
description: "The individual ToastRoot containing title, description, action, and close affordance."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "Title",
|
|
60
|
+
required: true,
|
|
61
|
+
description: "Short outcome text, used as the accessible name."
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "Description",
|
|
65
|
+
required: false,
|
|
66
|
+
description: "Optional detail or context beneath the title."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "Action",
|
|
70
|
+
required: false,
|
|
71
|
+
description: "Optional inline action such as Undo or Retry."
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
related: {
|
|
76
|
+
components: ["Banner", "InlineStatus", "Button", "Progress"],
|
|
77
|
+
patterns: ["DashboardPage", "SettingsPage"]
|
|
78
|
+
},
|
|
79
|
+
status: "stable",
|
|
80
|
+
props: [
|
|
81
|
+
{
|
|
82
|
+
name: "ToastProvider",
|
|
83
|
+
type: "{ children, timeout?, limit?, closeIcon?, position?, stacked?, viewportClassName? }",
|
|
84
|
+
default: "\u2014",
|
|
85
|
+
description: "Wraps Base UI Toast.Provider and renders the themed Viewport + toast list. Mount once near the app root, above any caller of useToast()."
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "position",
|
|
89
|
+
type: '"top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right"',
|
|
90
|
+
default: '"top-right"',
|
|
91
|
+
description: "Screen anchor for the toast stack."
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "stacked",
|
|
95
|
+
type: "boolean",
|
|
96
|
+
default: "false",
|
|
97
|
+
description: "Stack the toasts like a deck of cards, the newest in front and the older ones peeking out behind it, a step smaller, instead of listing them one under another. Hovering or focusing the stack fans it out into the list. Use it when an app can raise several toasts in a row, so they don't take over the corner of the page."
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: "viewportClassName",
|
|
101
|
+
type: "string",
|
|
102
|
+
description: "Extra classes merged LAST onto the fixed viewport region \u2014 for safe-area insets or an offset (e.g. clearing a sidebar)."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "timeout",
|
|
106
|
+
type: "number",
|
|
107
|
+
default: "5000",
|
|
108
|
+
description: "Default auto-dismiss time in ms for toasts. 0 keeps a toast until it is dismissed. Error toasts, loading toasts, and any toast carrying actionProps default to 0 regardless of this value; a per-toast timeout overrides both."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "limit",
|
|
112
|
+
type: "number",
|
|
113
|
+
default: "3",
|
|
114
|
+
description: "Maximum toasts shown at once; older toasts are pushed out when the limit is exceeded."
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "closeIcon",
|
|
118
|
+
type: "ReactNode",
|
|
119
|
+
default: '<Icon name="xmark" />',
|
|
120
|
+
description: "Override the dismiss-button glyph. The default already follows the injected icon set."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "useToast / useToastManager",
|
|
124
|
+
type: "() => { toasts, add, close, update, promise }",
|
|
125
|
+
default: "\u2014",
|
|
126
|
+
description: "Manager hook for use inside components. add({ title, description, timeout?, type?, priority?, actionProps? }) returns the new toast id and applies the same persistence default as toast.* \u2014 an error, loading, or actionProps toast stays until dismissed unless you pass a timeout. close(id), update(id, opts), and promise(p, opts) round out the API."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "toast",
|
|
130
|
+
type: "(message, options?) => string & { success, error, warning, info, message, loading, promise, dismiss, update, add, custom }",
|
|
131
|
+
default: "\u2014",
|
|
132
|
+
description: "Imperative singleton callable OUTSIDE React (event handlers, utilities, non-React code) \u2014 the Sonner-shaped surface that makes migrating a lib/toast wrapper a near drop-in. Requires a mounted <ToastProvider> (it binds the shared manager). Each call returns the toast id; toast.dismiss(id?) closes one or all; toast.promise(p, { loading, success, error }) and toast.update(id, opts) handle async + in-place updates."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "type (toast option)",
|
|
136
|
+
type: '"success" | "error" | "warning" | "info" | "loading"',
|
|
137
|
+
default: "\u2014",
|
|
138
|
+
description: "Set by the toast.* helpers. Drives a semantic left accent (success\u2192success, error\u2192destructive, warning\u2192tone-warning, info\u2192tone-info); loading shows a spinner. Both loading and error persist until updated or dismissed unless the call supplies a timeout."
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
subcomponents: [
|
|
142
|
+
{
|
|
143
|
+
name: "ToastRoot",
|
|
144
|
+
type: "Base UI Toast.Root props + className (requires the `toast` object)",
|
|
145
|
+
description: "A single toast surface. Animates enter/leave via data-[starting-style]/data-[ending-style]; swipe-to-dismiss is wired by Base UI."
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: "ToastContent",
|
|
149
|
+
type: "Base UI Toast.Content props + className",
|
|
150
|
+
description: "The toast's contents as one row. In a stacked viewport it fades on the cards behind the front one and returns when the stack fans out. Wrap a hand-composed toast's parts in it so a stacked viewport can hide them."
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "ToastTitle",
|
|
154
|
+
type: "Base UI Toast.Title props + className",
|
|
155
|
+
description: "The toast headline (text-title-sm). Auto-associated as the toast's accessible name."
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "ToastDescription",
|
|
159
|
+
type: "Base UI Toast.Description props + className",
|
|
160
|
+
description: "Supporting body copy beneath the title (text-body-sm, muted). Auto-associated as the toast's accessible description."
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "ToastClose",
|
|
164
|
+
type: "Base UI Toast.Close props + className",
|
|
165
|
+
description: 'Dismiss button. Base UI handles the close and leave animation; labelled "Dismiss" by default.'
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "ToastAction",
|
|
169
|
+
type: "Base UI Toast.Action props + className",
|
|
170
|
+
description: "Inline action button (e.g. Undo). The imperative path renders one on every toast and Base UI sources its label and handler from that toast's `actionProps`, rendering nothing when there are none \u2014 so `toast(msg, { actionProps })` is all an action needs. Reach for the component directly only when composing a toast by hand; compose with render={<Button \u2026 />}."
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
tokensUsed: [
|
|
174
|
+
"popover",
|
|
175
|
+
"popover-foreground",
|
|
176
|
+
"border",
|
|
177
|
+
"muted-foreground",
|
|
178
|
+
"accent",
|
|
179
|
+
"accent-foreground",
|
|
180
|
+
"secondary",
|
|
181
|
+
"secondary-foreground",
|
|
182
|
+
"ring",
|
|
183
|
+
"success",
|
|
184
|
+
"tone-warning",
|
|
185
|
+
"tone-info",
|
|
186
|
+
"destructive"
|
|
187
|
+
],
|
|
188
|
+
motion: [
|
|
189
|
+
{
|
|
190
|
+
slot: "arrival",
|
|
191
|
+
recipe: "motion-slide-left",
|
|
192
|
+
part: "ToastRoot",
|
|
193
|
+
why: "A toast interrupts without being asked, so where it came from is the reader's first question. Sliding in from the viewport edge answers it and marks the toast as belonging to the edge rather than to whatever it happens to cover."
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
slot: "response",
|
|
197
|
+
recipe: "motion-interactive",
|
|
198
|
+
part: "ToastAction",
|
|
199
|
+
why: "Toasts are on a timer, so the action has to look actionable at a glance \u2014 there is no time to hunt for the hit target."
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
slot: "transition",
|
|
203
|
+
recipe: "motion-slide-left",
|
|
204
|
+
part: "ToastRoot",
|
|
205
|
+
why: "Leaving the same way it entered keeps the stack legible when several dismiss at once; toasts that fade in place leave the remaining ones jumping to fill gaps with no visible cause."
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
slot: "transition",
|
|
209
|
+
recipe: "custom",
|
|
210
|
+
part: "ToastRoot (stacked)",
|
|
211
|
+
why: "A stacked toast arrives from the anchored edge in front of the others, which step back and shrink to make room; hovering fans the deck out into the list. Moving every card, rather than snapping them, shows that the new one went on top and the old ones are still there."
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
slot: "activity",
|
|
215
|
+
recipe: "none",
|
|
216
|
+
part: "ToastRoot",
|
|
217
|
+
why: "A toast reports a result that has already happened. Anything still in flight belongs in the surface that started it, where the reader is still looking."
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
a11y: [
|
|
221
|
+
"Base UI announces toasts through an ARIA live region \u2014 `low` priority is polite, `high` is assertive.",
|
|
222
|
+
"Auto-dismiss timers pause on hover/focus and while the window is hidden.",
|
|
223
|
+
"ToastClose is keyboard-focusable and labelled; Esc dismisses the focused toast.",
|
|
224
|
+
"ToastClose draws a 24px box (21px against the desktop root) and carries a 24x24+ POINTER TARGET behind it, per WCAG 2.5.8 \u2014 the glyph stays quiet because a dismiss control should not be the loudest thing in a toast. Base UI keeps the button out of the accessibility tree until the toast is focused; the toast itself is the announced element.",
|
|
225
|
+
"An action does NOT dismiss its toast \u2014 Base UI leaves that to the handler, so an action that opens a confirmation keeps the toast it is confirming. Call `toast.dismiss(id)` yourself when the action should close it.",
|
|
226
|
+
"Animate enter/leave via data-[starting-style]/data-[ending-style] rather than mount/unmount flips."
|
|
227
|
+
],
|
|
228
|
+
examples: [
|
|
229
|
+
{
|
|
230
|
+
label: "Imperative (from anywhere)",
|
|
231
|
+
code: 'toast.success("Saved", { description: "Your post is live." })'
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
label: "Promise (loading \u2192 success / error)",
|
|
235
|
+
code: 'toast.promise(publish(), { loading: "Publishing\u2026", success: "Published", error: "Failed to publish" })'
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
label: "Persistent loading, updated in place",
|
|
239
|
+
code: 'const id = toast.loading("Pinning to Arweave\u2026"); /* later */ toast.update(id, { title: "Pinned", type: "success", timeout: 4000 })'
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
label: "Custom toast markup (composed parts)",
|
|
243
|
+
code: 'const { toasts } = useToast()\n<ToastViewport>{toasts.map((t) => (<ToastRoot key={t.id} toast={t}><div className="flex min-w-0 flex-col gap-1"><ToastTitle>{t.title}</ToastTitle><ToastDescription>{t.description}</ToastDescription></div><ToastClose><Icon name="xmark" /></ToastClose></ToastRoot>))}</ToastViewport>'
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
label: "Undo action",
|
|
247
|
+
code: 'toast.message("Post archived", { actionProps: { children: "Undo", onClick: () => restorePost() } })'
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
label: "Stacked",
|
|
251
|
+
code: '<ToastProvider stacked position="bottom-right">{children}</ToastProvider>'
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
label: "Provider with app chrome",
|
|
255
|
+
code: '<ToastProvider position="bottom-right" limit={3}><AppShell><Region max="feed"><Button onClick={() => toast.success("Saved")}>Save</Button></Region></AppShell></ToastProvider>'
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
};
|
|
259
|
+
export {
|
|
260
|
+
toastMeta
|
|
261
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// src/components/toggle/toggle.tsx
|
|
2
|
+
import { Toggle as BaseToggle } from "@base-ui/react/toggle";
|
|
3
|
+
import { ToggleGroup as BaseToggleGroup } from "@base-ui/react/toggle-group";
|
|
4
|
+
import { createContext, useContext } from "react";
|
|
5
|
+
import { cn } from "../../lib/cn.js";
|
|
6
|
+
import { SEGMENTED_ITEM, SEGMENTED_TRACK } from "../../lib/segmented.js";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var ToggleAppearanceContext = createContext("default");
|
|
9
|
+
function Toggle({ className, ...props }) {
|
|
10
|
+
const appearance = useContext(ToggleAppearanceContext);
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
BaseToggle,
|
|
13
|
+
{
|
|
14
|
+
className: cn(
|
|
15
|
+
appearance === "segmented" ? cn(SEGMENTED_ITEM, "cursor-pointer px-2 text-label-md data-[pressed]:hover:text-accent-foreground") : cn(
|
|
16
|
+
"inline-flex h-(--control-sm) min-w-(--control-sm) cursor-pointer items-center justify-center rounded-sm px-2.5 text-label-md text-muted-foreground motion-interactive motion-press",
|
|
17
|
+
// Hover is the surface's quiet step, NOT the pressed fill: with
|
|
18
|
+
// both on bg-accent an unpressed toggle looked pressed under the
|
|
19
|
+
// pointer, which is the one state a toggle must never fake.
|
|
20
|
+
"sable-surface-interactive",
|
|
21
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
22
|
+
),
|
|
23
|
+
"data-[pressed]:bg-accent data-[pressed]:text-accent-foreground",
|
|
24
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
25
|
+
"[&_svg]:shrink-0",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
...props
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
Toggle.displayName = "Toggle";
|
|
33
|
+
function ToggleGroup({ className, appearance = "default", ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(ToggleAppearanceContext.Provider, { value: appearance, children: /* @__PURE__ */ jsx(
|
|
35
|
+
BaseToggleGroup,
|
|
36
|
+
{
|
|
37
|
+
"data-appearance": appearance,
|
|
38
|
+
className: cn(
|
|
39
|
+
appearance === "segmented" ? SEGMENTED_TRACK : "inline-flex items-center gap-1",
|
|
40
|
+
className
|
|
41
|
+
),
|
|
42
|
+
...props,
|
|
43
|
+
"aria-orientation": props.role === "toolbar" ? props.orientation ?? "horizontal" : void 0
|
|
44
|
+
}
|
|
45
|
+
) });
|
|
46
|
+
}
|
|
47
|
+
ToggleGroup.displayName = "ToggleGroup";
|
|
48
|
+
export {
|
|
49
|
+
Toggle,
|
|
50
|
+
ToggleGroup
|
|
51
|
+
};
|