@sableui/react 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +285 -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 +200 -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 +33 -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 +611 -33
- 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 +25 -6
- 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 +19 -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 +210 -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.js +43 -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/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/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/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/converting-an-app.md +14 -4
- package/llms/tasks/reviewing-a-design.md +15 -0
- package/llms-full.txt +981 -65
- package/llms.txt +27 -10
- package/package.json +1 -1
- package/registry.json +2324 -171
- package/scripts/agent-setup.mjs +90 -0
- package/scripts/design-presets.mjs +46 -4
- 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 +56 -22
- 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,79 @@
|
|
|
1
|
+
// src/components/show-more/show-more.meta.ts
|
|
2
|
+
var showMoreMeta = {
|
|
3
|
+
name: "ShowMore",
|
|
4
|
+
summary: "Collapsible content region that clips children to a collapsed height, fades the cut edge, and reveals the rest with a toggle.",
|
|
5
|
+
status: "stable",
|
|
6
|
+
keywords: [
|
|
7
|
+
"show more",
|
|
8
|
+
"disclosure",
|
|
9
|
+
"truncate",
|
|
10
|
+
"expand"
|
|
11
|
+
],
|
|
12
|
+
usage: {
|
|
13
|
+
description: "Use ShowMore to reveal additional content after an intentionally shortened preview.",
|
|
14
|
+
bestPractices: [
|
|
15
|
+
{
|
|
16
|
+
guidance: "do",
|
|
17
|
+
description: "Use it when the preview is useful on its own and the rest is optional."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
guidance: "do",
|
|
21
|
+
description: "Make the expanded state reversible when collapsing helps users regain context."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
guidance: "dont",
|
|
25
|
+
description: "Do not place it on a card or tinted surface without checking the fade. The cut-edge gradient fades to the page background color, so on any other surface it reads as a visible band."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
guidance: "dont",
|
|
29
|
+
description: "Do not hide required steps, important warnings, or primary actions behind ShowMore."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
guidance: "dont",
|
|
33
|
+
description: "Do not use it to hide content search engines or screen readers need. Collapsed content is still in the DOM here, but if the user must read it to act, it should not be behind a toggle."
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
related: {
|
|
38
|
+
components: [
|
|
39
|
+
"Collapsible"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
props: [
|
|
43
|
+
{
|
|
44
|
+
name: "collapsedHeight",
|
|
45
|
+
type: "number",
|
|
46
|
+
default: "96",
|
|
47
|
+
description: "Collapsed height of the content region in px. The inner wrapper clips to this height until expanded. The toggle and fade only appear when the measured content is taller than this; content that already fits shows in full with no control. Expanding animates to the measured height."
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "collapsedLines",
|
|
51
|
+
type: "number",
|
|
52
|
+
description: "Collapsed height as a count of the content's own lines (measured from its line height). Wins over collapsedHeight, and is the one to prefer: the preview keeps the same number of lines when the type scale or density changes, where a px height shows fewer as type grows."
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "children",
|
|
56
|
+
type: "ReactNode",
|
|
57
|
+
description: "The content to collapse and reveal."
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
tokensUsed: ["background", "foreground", "ring"],
|
|
61
|
+
a11y: [
|
|
62
|
+
"The toggle is a real <button> with aria-expanded reflecting the open state.",
|
|
63
|
+
"The fade overlay is pointer-events-none and decorative; it never traps clicks.",
|
|
64
|
+
"Collapsed content stays in the DOM, so screen readers can still reach it."
|
|
65
|
+
],
|
|
66
|
+
examples: [
|
|
67
|
+
{
|
|
68
|
+
label: "Long paragraph",
|
|
69
|
+
code: '<ShowMore><p className="text-body-md text-foreground">A long paragraph that exceeds the collapsed height\u2026</p></ShowMore>'
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: "Collapsed to a line count",
|
|
73
|
+
code: '<ShowMore collapsedLines={6}><p className="text-body-md text-foreground">{post.description}</p></ShowMore>'
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
};
|
|
77
|
+
export {
|
|
78
|
+
showMoreMeta
|
|
79
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/side-nav/side-nav.tsx
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
import { createContext, useContext } from "react";
|
|
6
|
+
import { cn } from "../../lib/cn.js";
|
|
7
|
+
import { sideNavItemIconVariants, sideNavItemVariants } from "./side-nav.variants.js";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var SideNavContext = createContext({
|
|
10
|
+
size: "md",
|
|
11
|
+
activeVariant: "content"
|
|
12
|
+
});
|
|
13
|
+
function SideNav({
|
|
14
|
+
className,
|
|
15
|
+
size = "md",
|
|
16
|
+
activeVariant = "content",
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ jsx(SideNavContext.Provider, { value: { size, activeVariant }, children: /* @__PURE__ */ jsx("nav", { className: cn("flex flex-col gap-0.5", className), ...props }) });
|
|
20
|
+
}
|
|
21
|
+
SideNav.displayName = "SideNav";
|
|
22
|
+
function SideNavGroup({
|
|
23
|
+
label,
|
|
24
|
+
className,
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-0.5", className), ...props, children: [
|
|
29
|
+
label ? /* @__PURE__ */ jsx("div", { className: "px-3 pt-3 pb-1 text-caption text-muted-foreground", children: label }) : null,
|
|
30
|
+
children
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
SideNavGroup.displayName = "SideNavGroup";
|
|
34
|
+
function SideNavItem({
|
|
35
|
+
label,
|
|
36
|
+
icon,
|
|
37
|
+
active,
|
|
38
|
+
badge,
|
|
39
|
+
size,
|
|
40
|
+
activeVariant,
|
|
41
|
+
render,
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}) {
|
|
45
|
+
const context = useContext(SideNavContext);
|
|
46
|
+
const resolvedSize = size ?? context.size;
|
|
47
|
+
const resolvedActiveVariant = activeVariant ?? context.activeVariant;
|
|
48
|
+
return useRender({
|
|
49
|
+
render: render ?? /* @__PURE__ */ jsx("button", { type: "button" }),
|
|
50
|
+
props: {
|
|
51
|
+
...props,
|
|
52
|
+
"data-active": active ? "" : void 0,
|
|
53
|
+
"aria-current": active ? "page" : void 0,
|
|
54
|
+
className: cn(
|
|
55
|
+
sideNavItemVariants({
|
|
56
|
+
size: resolvedSize,
|
|
57
|
+
activeVariant: resolvedActiveVariant
|
|
58
|
+
}),
|
|
59
|
+
className
|
|
60
|
+
),
|
|
61
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
|
+
icon ? /* @__PURE__ */ jsx("span", { className: sideNavItemIconVariants({ size: resolvedSize }), children: icon }) : null,
|
|
63
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: label }),
|
|
64
|
+
badge ? /* @__PURE__ */ jsx("span", { className: "ms-auto shrink-0", children: badge }) : null
|
|
65
|
+
] })
|
|
66
|
+
},
|
|
67
|
+
defaultTagName: "button"
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
SideNavItem.displayName = "SideNavItem";
|
|
71
|
+
export {
|
|
72
|
+
SideNav,
|
|
73
|
+
SideNavGroup,
|
|
74
|
+
SideNavItem
|
|
75
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// src/components/side-nav/side-nav.meta.ts
|
|
2
|
+
var sideNavMeta = {
|
|
3
|
+
name: "SideNav",
|
|
4
|
+
summary: "A lightweight in-content vertical navigation list - the settings / docs sub-nav, distinct from the app-chrome Sidebar. Router-agnostic items, optional SideNavGroup sections, and an explicit active-state vocabulary for content rails or sidebar chrome.",
|
|
5
|
+
keywords: [
|
|
6
|
+
"side nav",
|
|
7
|
+
"navigation",
|
|
8
|
+
"settings nav",
|
|
9
|
+
"sidebar",
|
|
10
|
+
"rail",
|
|
11
|
+
"docs nav",
|
|
12
|
+
"active item",
|
|
13
|
+
"group"
|
|
14
|
+
],
|
|
15
|
+
usage: {
|
|
16
|
+
description: "Use SideNav for vertical navigation inside a settings page, documentation area, dashboard rail, or sidebar chrome. It is router-agnostic: compose items with render={<Link />} and choose activeVariant based on whether the nav sits in content or app chrome.",
|
|
17
|
+
bestPractices: [
|
|
18
|
+
{
|
|
19
|
+
guidance: "do",
|
|
20
|
+
description: "Use aria-label on SideNav when a page contains more than one nav landmark."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
guidance: "do",
|
|
24
|
+
description: "Group related items with SideNavGroup when the rail has more than one conceptual area."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
guidance: "do",
|
|
28
|
+
description: "Use size='lg' and activeVariant='sidebar' when the nav is part of persistent app chrome."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
guidance: "do",
|
|
32
|
+
description: "Rows are rounded-sm, which nests in the usual rounded-lg p-2 frame. In any other rounded, padded frame give each item rounded-concentric-<outer>/<inset> \u2014 a same-radius row inset into a frame reads as a second system."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
guidance: "dont",
|
|
36
|
+
description: "Use SideNav for bottom mobile navigation; use BottomNav in AppShell's bottomNav slot."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
guidance: "dont",
|
|
40
|
+
description: "Mix content and sidebar active variants in the same rail unless individual items intentionally override the group."
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
anatomy: [
|
|
44
|
+
{
|
|
45
|
+
name: "Nav",
|
|
46
|
+
required: true,
|
|
47
|
+
description: "The landmark container for the vertical navigation list."
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "Group",
|
|
51
|
+
required: false,
|
|
52
|
+
description: "Optional labelled cluster of related navigation items."
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "Item",
|
|
56
|
+
required: true,
|
|
57
|
+
description: "Interactive row with label, optional icon, optional badge, and active state."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "Badge",
|
|
61
|
+
required: false,
|
|
62
|
+
description: "Trailing count or state indicator aligned to the row end."
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
related: {
|
|
67
|
+
components: ["Sidebar", "AppShell", "BottomNav", "Badge", "Icon"],
|
|
68
|
+
patterns: ["SettingsPage", "DashboardPage"]
|
|
69
|
+
},
|
|
70
|
+
status: "stable",
|
|
71
|
+
props: [
|
|
72
|
+
{
|
|
73
|
+
name: "size",
|
|
74
|
+
type: '"md" | "lg"',
|
|
75
|
+
description: 'Density shared by all items. "md" (default) = the lightweight in-content sub-nav; "lg" = chrome-weight (larger label + icon, roomier rows) for a rail that pairs with the app Sidebar.'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "activeVariant",
|
|
79
|
+
type: '"content" | "sidebar"',
|
|
80
|
+
default: '"content"',
|
|
81
|
+
description: 'Active-state token vocabulary shared by all items. "content" uses bg-accent/text-accent-foreground for local rails inside the content area; "sidebar" uses bg-sidebar-accent/text-sidebar-accent-foreground for SideNavs rendered inside app chrome.'
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
subcomponents: [
|
|
85
|
+
{
|
|
86
|
+
name: "SideNavItem",
|
|
87
|
+
type: '{ label: ReactNode; icon?: ReactNode; active?: boolean; badge?: ReactNode; size?: "md" | "lg"; activeVariant?: "content" | "sidebar"; render?: useRender.RenderProp } + button props',
|
|
88
|
+
description: 'A single row. label is the row text; icon is an optional leading icon; active marks the current sub-section (active fill + aria-current="page"); badge is a trailing node (e.g. a count) pushed to the row end; size and activeVariant override the enclosing SideNav per item; render composes another element, e.g. render={<Link to="/x" />}.'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "SideNavGroup",
|
|
92
|
+
type: "{ label?: ReactNode } + div props",
|
|
93
|
+
description: "A labelled section within a SideNav - groups settings into areas. label renders an optional sentence-case caption heading above the group's items."
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
a11y: [
|
|
97
|
+
"SideNav renders a <nav> landmark; pair multiple navs with aria-label to distinguish them.",
|
|
98
|
+
'The active item carries aria-current="page".',
|
|
99
|
+
"Items expose a focus-visible ring; the active state is reinforced by weight + fill, not colour alone.",
|
|
100
|
+
'Use activeVariant="content" for local in-page rails and activeVariant="sidebar" when a SideNav is placed on Sidebar chrome.'
|
|
101
|
+
],
|
|
102
|
+
tokensUsed: [
|
|
103
|
+
"muted",
|
|
104
|
+
"muted-foreground",
|
|
105
|
+
"foreground",
|
|
106
|
+
"accent",
|
|
107
|
+
"accent-foreground",
|
|
108
|
+
"ring",
|
|
109
|
+
"sidebar-foreground",
|
|
110
|
+
"sidebar-accent",
|
|
111
|
+
"sidebar-accent-foreground",
|
|
112
|
+
"sidebar-ring"
|
|
113
|
+
],
|
|
114
|
+
examples: [
|
|
115
|
+
{
|
|
116
|
+
label: "Settings sub-nav",
|
|
117
|
+
code: '<SideNav><SideNavItem label="Profile" active render={<Link to="/settings/profile" />} /><SideNavItem label="Account" render={<Link to="/settings/account" />} /><SideNavItem label="Notifications" render={<Link to="/settings/notifications" />} /></SideNav>'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: "Grouped",
|
|
121
|
+
code: '<SideNav><SideNavGroup label="Account"><SideNavItem label="Profile" active render={<Link to="/settings/profile" />} /><SideNavItem label="Security" render={<Link to="/settings/security" />} /></SideNavGroup><SideNavGroup label="Workspace"><SideNavItem label="Members" render={<Link to="/settings/members" />} /></SideNavGroup></SideNav>'
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
label: "Chrome-weight rail (size=lg)",
|
|
125
|
+
code: '<SideNav size="lg"><SideNavItem label="Profile" active render={<Link to="/settings/profile" />} /><SideNavItem label="Wallets" render={<Link to="/settings/wallets" />} /><SideNavItem label="Security" render={<Link to="/settings/security" />} /></SideNav>'
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
label: "Inside Sidebar chrome",
|
|
129
|
+
code: '<SideNav size="lg" activeVariant="sidebar"><SideNavItem label="Overview" active render={<Link to="/" />} /><SideNavItem label="Reports" render={<Link to="/reports" />} /><SideNavItem label="Settings" render={<Link to="/settings" />} /></SideNav>'
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
label: "Grouped with icons and badges",
|
|
133
|
+
code: '<SideNav aria-label="Settings sections"><SideNavGroup label="Account"><SideNavItem icon={<Icon name="user" />} label="Profile" active render={<Link to="/settings/profile" />} /><SideNavItem icon={<Icon name="lock" />} label="Security" badge={<Badge tone="warning" size="sm">2</Badge>} render={<Link to="/settings/security" />} /></SideNavGroup><SideNavGroup label="Workspace"><SideNavItem icon={<Icon name="bell" />} label="Notifications" render={<Link to="/settings/notifications" />} /></SideNavGroup></SideNav>'
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
};
|
|
137
|
+
export {
|
|
138
|
+
sideNavMeta
|
|
139
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/components/side-nav/side-nav.variants.ts
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
var RAIL_ROW_INLINE = "gap-3 px-3";
|
|
4
|
+
var sideNavItemVariants = cva(
|
|
5
|
+
"flex w-full items-center text-start motion-interactive focus-visible:outline-none focus-visible:ring-2 data-[active]:font-semibold",
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
md: "gap-2.5 rounded-sm px-3 py-1.5 text-body-sm",
|
|
10
|
+
lg: "gap-3 rounded-sm px-3 py-2 text-body-md",
|
|
11
|
+
// The app rail (Sidebar): chrome-weight rows on the label tier.
|
|
12
|
+
rail: `${RAIL_ROW_INLINE} rounded-sm py-2.5 text-label-lg`
|
|
13
|
+
},
|
|
14
|
+
activeVariant: {
|
|
15
|
+
content: "text-foreground hover:bg-muted focus-visible:ring-ring data-[active]:bg-accent data-[active]:text-accent-foreground",
|
|
16
|
+
sidebar: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-sidebar-ring data-[active]:bg-sidebar-accent data-[active]:text-sidebar-accent-foreground"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: { size: "md", activeVariant: "content" }
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
var sideNavItemIconVariants = cva(
|
|
23
|
+
"grid shrink-0 place-items-center",
|
|
24
|
+
{
|
|
25
|
+
variants: { size: { md: "size-5 text-xl", lg: "size-6 text-xl", rail: "size-6 text-2xl" } },
|
|
26
|
+
defaultVariants: { size: "md" }
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
export {
|
|
30
|
+
RAIL_ROW_INLINE,
|
|
31
|
+
sideNavItemIconVariants,
|
|
32
|
+
sideNavItemVariants
|
|
33
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/components/sidebar/index.ts
|
|
2
|
+
import {
|
|
3
|
+
Sidebar,
|
|
4
|
+
SidebarHeader,
|
|
5
|
+
SidebarBrand,
|
|
6
|
+
SidebarNav,
|
|
7
|
+
SidebarFooter,
|
|
8
|
+
SidebarItem,
|
|
9
|
+
useSidebar
|
|
10
|
+
} from "./sidebar.js";
|
|
11
|
+
import { sidebarMeta } from "./sidebar.meta.js";
|
|
12
|
+
export {
|
|
13
|
+
Sidebar,
|
|
14
|
+
SidebarBrand,
|
|
15
|
+
SidebarFooter,
|
|
16
|
+
SidebarHeader,
|
|
17
|
+
SidebarItem,
|
|
18
|
+
SidebarNav,
|
|
19
|
+
sidebarMeta,
|
|
20
|
+
useSidebar
|
|
21
|
+
};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/sidebar/sidebar.tsx
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
import {
|
|
6
|
+
createContext,
|
|
7
|
+
useContext
|
|
8
|
+
} from "react";
|
|
9
|
+
import { cn } from "../../lib/cn.js";
|
|
10
|
+
import { RAIL_ROW_INLINE, sideNavItemIconVariants, sideNavItemVariants } from "../side-nav/side-nav.variants.js";
|
|
11
|
+
import { SimpleTooltip } from "../tooltip/index.js";
|
|
12
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
var SidebarContext = createContext({
|
|
14
|
+
collapsed: false,
|
|
15
|
+
icons: true
|
|
16
|
+
});
|
|
17
|
+
function useSidebar() {
|
|
18
|
+
return useContext(SidebarContext);
|
|
19
|
+
}
|
|
20
|
+
var SIDEBAR_VARIANT = {
|
|
21
|
+
// Full viewport less an AppShell dock (0 without one), so a persistent
|
|
22
|
+
// player bar never covers the rail's last rows.
|
|
23
|
+
app: "hidden lg:flex lg:sticky lg:top-0 lg:h-[calc(100vh-var(--dock-height,0px))] lg:self-start",
|
|
24
|
+
inline: "flex h-full"
|
|
25
|
+
};
|
|
26
|
+
var SIDEBAR_INK = [
|
|
27
|
+
"[--background:var(--sidebar)] [--sable-surface-bg:var(--sidebar)]",
|
|
28
|
+
"[--foreground:var(--sidebar-foreground)]",
|
|
29
|
+
"[--muted:var(--sidebar-accent)]",
|
|
30
|
+
"[--muted-foreground:var(--sidebar-muted-foreground,color-mix(in_oklab,var(--sidebar-foreground)_62%,var(--sidebar)))]",
|
|
31
|
+
"[--accent:var(--sidebar-accent)] [--accent-foreground:var(--sidebar-accent-foreground)]",
|
|
32
|
+
"[--border:var(--sidebar-border)] [--ring:var(--sidebar-ring)]"
|
|
33
|
+
].join(" ");
|
|
34
|
+
function Sidebar({
|
|
35
|
+
collapsed = false,
|
|
36
|
+
icons = true,
|
|
37
|
+
variant = "app",
|
|
38
|
+
className,
|
|
39
|
+
children,
|
|
40
|
+
...props
|
|
41
|
+
}) {
|
|
42
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: { collapsed, icons }, children: /* @__PURE__ */ jsx(
|
|
43
|
+
"aside",
|
|
44
|
+
{
|
|
45
|
+
"data-collapsed": collapsed || void 0,
|
|
46
|
+
"data-variant": variant,
|
|
47
|
+
className: cn(
|
|
48
|
+
"shrink-0 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground",
|
|
49
|
+
// The rail is its own surface. Anything placed in it that inks with
|
|
50
|
+
// page tokens — an Entity account row, an Avatar, a ghost Button,
|
|
51
|
+
// an OverflowMenu — reads the rail's set instead, so a theme can paint a
|
|
52
|
+
// dark rail on a light page (Meridian) and the footer row stays
|
|
53
|
+
// legible. Muted ink is the rail's ink at 62% over the rail, unless
|
|
54
|
+
// a theme names --sidebar-muted-foreground.
|
|
55
|
+
SIDEBAR_INK,
|
|
56
|
+
SIDEBAR_VARIANT[variant],
|
|
57
|
+
"w-[var(--sidebar-width,16rem)] data-[collapsed]:w-[var(--sidebar-width-collapsed,4rem)]",
|
|
58
|
+
className
|
|
59
|
+
),
|
|
60
|
+
...props,
|
|
61
|
+
children
|
|
62
|
+
}
|
|
63
|
+
) });
|
|
64
|
+
}
|
|
65
|
+
Sidebar.displayName = "Sidebar";
|
|
66
|
+
function SidebarHeader({
|
|
67
|
+
className,
|
|
68
|
+
...props
|
|
69
|
+
}) {
|
|
70
|
+
const { collapsed } = useSidebar();
|
|
71
|
+
return /* @__PURE__ */ jsx(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: cn(
|
|
75
|
+
"flex h-16 items-center px-3",
|
|
76
|
+
// Collapsed, the brand mark centres on the same axis as the item icons.
|
|
77
|
+
collapsed && "justify-center px-0",
|
|
78
|
+
className
|
|
79
|
+
),
|
|
80
|
+
...props
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
SidebarHeader.displayName = "SidebarHeader";
|
|
85
|
+
function SidebarBrand({ mark, label, render, className, "aria-label": ariaLabel, ...props }) {
|
|
86
|
+
const { collapsed } = useSidebar();
|
|
87
|
+
return useRender({
|
|
88
|
+
render: render ?? /* @__PURE__ */ jsx("div", {}),
|
|
89
|
+
props: {
|
|
90
|
+
...props,
|
|
91
|
+
// Collapsed shows the mark alone, so a string label still names the link.
|
|
92
|
+
"aria-label": ariaLabel ?? (collapsed && typeof label === "string" ? label : void 0),
|
|
93
|
+
className: cn(
|
|
94
|
+
"flex min-w-0 items-center rounded-sm",
|
|
95
|
+
// The item row's horizontal geometry, without its height.
|
|
96
|
+
RAIL_ROW_INLINE,
|
|
97
|
+
render && "motion-interactive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
|
|
98
|
+
collapsed && "justify-center px-0",
|
|
99
|
+
className
|
|
100
|
+
),
|
|
101
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
102
|
+
/* @__PURE__ */ jsx("span", { className: sideNavItemIconVariants({ size: "rail" }), children: mark }),
|
|
103
|
+
collapsed ? null : /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate text-title-sm", children: label })
|
|
104
|
+
] })
|
|
105
|
+
},
|
|
106
|
+
defaultTagName: "div"
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
SidebarBrand.displayName = "SidebarBrand";
|
|
110
|
+
function SidebarNav({
|
|
111
|
+
className,
|
|
112
|
+
...props
|
|
113
|
+
}) {
|
|
114
|
+
return /* @__PURE__ */ jsx(
|
|
115
|
+
"nav",
|
|
116
|
+
{
|
|
117
|
+
className: cn(
|
|
118
|
+
// Thin scrollbar so a long nav does not hand a fat platform bar to a
|
|
119
|
+
// narrow rail, and contained overscroll so a wheel gesture that runs
|
|
120
|
+
// out of nav stops there instead of scrolling the page behind it.
|
|
121
|
+
"flex flex-1 flex-col gap-1 overflow-y-auto overscroll-contain px-3 py-4 scrollbar-quiet",
|
|
122
|
+
className
|
|
123
|
+
),
|
|
124
|
+
...props
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
SidebarNav.displayName = "SidebarNav";
|
|
129
|
+
function SidebarFooter({
|
|
130
|
+
className,
|
|
131
|
+
...props
|
|
132
|
+
}) {
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
className: cn(
|
|
137
|
+
"flex flex-col gap-1 border-t border-sidebar-border px-3 py-4",
|
|
138
|
+
className
|
|
139
|
+
),
|
|
140
|
+
...props
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
SidebarFooter.displayName = "SidebarFooter";
|
|
145
|
+
function SidebarItem({
|
|
146
|
+
icon,
|
|
147
|
+
label,
|
|
148
|
+
active,
|
|
149
|
+
badge,
|
|
150
|
+
render,
|
|
151
|
+
className,
|
|
152
|
+
"aria-label": ariaLabel,
|
|
153
|
+
...props
|
|
154
|
+
}) {
|
|
155
|
+
const { collapsed, icons } = useSidebar();
|
|
156
|
+
const showIcon = icon != null && (icons || collapsed);
|
|
157
|
+
const element = useRender({
|
|
158
|
+
render: render ?? /* @__PURE__ */ jsx("button", { type: "button" }),
|
|
159
|
+
props: {
|
|
160
|
+
...props,
|
|
161
|
+
"data-active": active ? "" : void 0,
|
|
162
|
+
"aria-current": active ? "page" : void 0,
|
|
163
|
+
// Collapsed rows hide their text, so give the control an accessible name
|
|
164
|
+
// from a string label (the tooltip supplies the visible one on hover).
|
|
165
|
+
"aria-label": ariaLabel ?? (collapsed && typeof label === "string" ? label : void 0),
|
|
166
|
+
className: cn(
|
|
167
|
+
// SideNav's row recipe on the rail rung — one row, not a copy.
|
|
168
|
+
sideNavItemVariants({ size: "rail", activeVariant: "sidebar" }),
|
|
169
|
+
collapsed && "justify-center px-0",
|
|
170
|
+
className
|
|
171
|
+
),
|
|
172
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
173
|
+
showIcon ? /* @__PURE__ */ jsx("span", { className: sideNavItemIconVariants({ size: "rail" }), children: icon }) : null,
|
|
174
|
+
collapsed ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
175
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: label }),
|
|
176
|
+
badge ? /* @__PURE__ */ jsx("span", { className: "ms-auto shrink-0", children: badge }) : null
|
|
177
|
+
] })
|
|
178
|
+
] })
|
|
179
|
+
},
|
|
180
|
+
defaultTagName: "button"
|
|
181
|
+
});
|
|
182
|
+
if (collapsed) {
|
|
183
|
+
return /* @__PURE__ */ jsx(SimpleTooltip, { content: label, side: "right", children: element });
|
|
184
|
+
}
|
|
185
|
+
return element;
|
|
186
|
+
}
|
|
187
|
+
SidebarItem.displayName = "SidebarItem";
|
|
188
|
+
export {
|
|
189
|
+
Sidebar,
|
|
190
|
+
SidebarBrand,
|
|
191
|
+
SidebarFooter,
|
|
192
|
+
SidebarHeader,
|
|
193
|
+
SidebarItem,
|
|
194
|
+
SidebarNav,
|
|
195
|
+
useSidebar
|
|
196
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// src/components/sidebar/sidebar.meta.ts
|
|
2
|
+
var sidebarMeta = {
|
|
3
|
+
name: "Sidebar",
|
|
4
|
+
summary: "Desktop side-navigation rail (in-flow sticky, hidden below lg) with SidebarHeader / SidebarBrand / SidebarNav / SidebarItem / SidebarFooter parts. Items are router-agnostic via the `render` prop; an optional collapsed icon-rail mode reveals labels in tooltips.",
|
|
5
|
+
status: "stable",
|
|
6
|
+
keywords: [
|
|
7
|
+
"sidebar",
|
|
8
|
+
"navigation",
|
|
9
|
+
"app chrome",
|
|
10
|
+
"rail"
|
|
11
|
+
],
|
|
12
|
+
usage: {
|
|
13
|
+
description: "Use Sidebar for persistent desktop navigation or application chrome outside the main content region.",
|
|
14
|
+
bestPractices: [
|
|
15
|
+
{
|
|
16
|
+
guidance: "do",
|
|
17
|
+
description: "Use it for stable app destinations that should remain visible while content changes."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
guidance: "do",
|
|
21
|
+
description: "Keep item labels predictable and active state obvious."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
guidance: "dont",
|
|
25
|
+
description: "Do not use Sidebar for page-local settings, filters, or temporary action groups."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
guidance: "dont",
|
|
29
|
+
description: "Do not put page content in it. It is fixed-width chrome OUTSIDE the content grid, so anything in it is exempt from the page's measure and rhythm."
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
anatomy: [
|
|
33
|
+
{
|
|
34
|
+
name: "Sidebar",
|
|
35
|
+
required: true,
|
|
36
|
+
description: "The persistent navigation container."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "SidebarItem",
|
|
40
|
+
required: true,
|
|
41
|
+
description: "One navigation destination or action."
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
related: {
|
|
46
|
+
components: [
|
|
47
|
+
"SideNav",
|
|
48
|
+
"BottomNav",
|
|
49
|
+
"AppShell"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
props: [
|
|
53
|
+
{
|
|
54
|
+
name: "collapsed",
|
|
55
|
+
type: "boolean",
|
|
56
|
+
default: "false",
|
|
57
|
+
description: "Collapse the rail to an icon-only width (--sidebar-width-collapsed). Items hide their label + badge and reveal the label in a hover tooltip; the content area reflows. Controlled \u2014 wire a toggle from app state. Read the state in custom header/footer content via useSidebar()."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "icons",
|
|
61
|
+
type: "boolean",
|
|
62
|
+
default: "true",
|
|
63
|
+
description: "Render the leading icon on each SidebarItem. Set false for a text-only rail. Ignored while collapsed (icon-only by definition)."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "variant",
|
|
67
|
+
type: '"app" | "inline"',
|
|
68
|
+
default: '"app"',
|
|
69
|
+
description: `Where the rail lives. "app" is the page's chrome column \u2014 sticky, full viewport height, hidden below lg where AppHeader + BottomNav take over. "inline" is always visible and fills its parent's height, for a rail inside a bounded frame (a nested shell, an embedded preview). Use it instead of overriding the layout with !important classes.`
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
subcomponents: [
|
|
73
|
+
{
|
|
74
|
+
name: "SidebarBrand",
|
|
75
|
+
type: "{ mark: ReactNode; label: ReactNode; render?: useRender.RenderProp } + div props",
|
|
76
|
+
description: `The brand row, inside SidebarHeader, on the same grid as SidebarItem: mark in the icons' 24px slot, label on the labels' column, so a logo lines up with the nav below it without copying the rail's inset numbers. Collapsed, it shows the mark alone (named by a string label). render={<Link to="/" />} makes it the home link.`
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "SidebarItem",
|
|
80
|
+
type: "{ label: ReactNode; icon?: ReactNode; active?: boolean; badge?: ReactNode; render?: useRender.RenderProp } + button props",
|
|
81
|
+
description: 'A single nav row. label is the row text (inline when expanded, in a hover tooltip when collapsed); icon is the leading icon node (the consumer swaps fill weight for the active state); active marks the current route (accent fill + aria-current="page"); badge is a trailing node (e.g. a count) pushed to the row end and hidden when collapsed; render composes another element, e.g. render={<Link to="/x" />}.'
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
a11y: [
|
|
85
|
+
"SidebarNav renders a <nav> landmark.",
|
|
86
|
+
'Active item carries aria-current="page".',
|
|
87
|
+
"Items expose a focus-visible ring (sidebar-ring).",
|
|
88
|
+
"Collapsed: items take their accessible name from a string label (or aria-label) and reveal the visible label via the tooltip, so the rail stays usable by keyboard and screen readers."
|
|
89
|
+
],
|
|
90
|
+
tokensUsed: [
|
|
91
|
+
"sidebar",
|
|
92
|
+
"sidebar-foreground",
|
|
93
|
+
"sidebar-border",
|
|
94
|
+
"sidebar-accent",
|
|
95
|
+
"sidebar-accent-foreground",
|
|
96
|
+
"sidebar-ring"
|
|
97
|
+
],
|
|
98
|
+
variants: {
|
|
99
|
+
variant: ["app", "inline"]
|
|
100
|
+
},
|
|
101
|
+
examples: [
|
|
102
|
+
{
|
|
103
|
+
label: "Rail with nav",
|
|
104
|
+
code: '<Sidebar><SidebarHeader><SidebarBrand mark={<Icon name="music" variant="solid" />} label="Undertow" render={<Link to="/" />} /></SidebarHeader><SidebarNav><SidebarItem icon={<Icon name="bell" />} label="Notifications" badge={<NotificationBadge count={3} />} render={<Link to="/notifications" />} /></SidebarNav><SidebarFooter>{wallet}</SidebarFooter></Sidebar>'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
label: "Collapsible (icon rail)",
|
|
108
|
+
code: 'const [collapsed, setCollapsed] = useState(false)\n<Sidebar collapsed={collapsed}><SidebarNav><SidebarItem icon={<Icon name="home" />} label="Home" active render={<Link to="/" />} /></SidebarNav><SidebarFooter><Button variant="ghost" size="icon" onClick={() => setCollapsed((c) => !c)} aria-label="Toggle sidebar"><Icon name="chevron-left" /></Button></SidebarFooter></Sidebar>'
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
label: "Inline (inside a bounded frame)",
|
|
112
|
+
code: '<div className="flex h-80 overflow-hidden rounded-lg border border-border"><Sidebar variant="inline"><SidebarNav><SidebarItem icon={<Icon name="home" />} label="Home" active /></SidebarNav></Sidebar><div className="flex-1 p-6">Content</div></div>'
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
};
|
|
116
|
+
export {
|
|
117
|
+
sidebarMeta
|
|
118
|
+
};
|