@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,26 @@
|
|
|
1
|
+
// src/layout/SafeArea.tsx
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { safeAreaInsets } from "./_safeArea.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function SafeArea({
|
|
6
|
+
edges = ["top", "bottom", "left", "right"],
|
|
7
|
+
className,
|
|
8
|
+
style,
|
|
9
|
+
children,
|
|
10
|
+
ref,
|
|
11
|
+
...rest
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
className: cn(className),
|
|
18
|
+
style: { ...safeAreaInsets(edges), ...style },
|
|
19
|
+
...rest,
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
SafeArea
|
|
26
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/layout/Spacer.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
function Spacer({ size = 1, axis = "vertical", grow, className }) {
|
|
4
|
+
const style = grow ? { flex: "1 1 0%" } : axis === "vertical" ? { height: `calc(var(--rhythm-unit) * ${size})`, flexShrink: 0 } : { width: `calc(var(--rhythm-unit) * ${size})`, flexShrink: 0 };
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { "aria-hidden": true, className, style });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
Spacer
|
|
9
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// src/layout/SplitPane.tsx
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
function parseRatio(ratio) {
|
|
5
|
+
const [a, b] = ratio.split("/");
|
|
6
|
+
const pa = Number(a);
|
|
7
|
+
const pb = Number(b);
|
|
8
|
+
if (!Number.isFinite(pa) || pa <= 0 || !Number.isFinite(pb) || pb <= 0) {
|
|
9
|
+
return { primary: "1fr", secondary: "1fr" };
|
|
10
|
+
}
|
|
11
|
+
return { primary: `${pa}fr`, secondary: `${pb}fr` };
|
|
12
|
+
}
|
|
13
|
+
function resolveGap(gap) {
|
|
14
|
+
if (gap === void 0) return void 0;
|
|
15
|
+
return typeof gap === "number" ? `calc(var(--rhythm-unit) * ${gap})` : gap;
|
|
16
|
+
}
|
|
17
|
+
function SplitPane({
|
|
18
|
+
primary,
|
|
19
|
+
secondary,
|
|
20
|
+
collapseBelow = "lg",
|
|
21
|
+
ratio = "1/1",
|
|
22
|
+
gap,
|
|
23
|
+
className,
|
|
24
|
+
style,
|
|
25
|
+
ref,
|
|
26
|
+
...rest
|
|
27
|
+
}) {
|
|
28
|
+
const { primary: p, secondary: s } = parseRatio(ratio);
|
|
29
|
+
const splitGap = resolveGap(gap);
|
|
30
|
+
const mergedStyle = {
|
|
31
|
+
"--split-primary": p,
|
|
32
|
+
"--split-secondary": s,
|
|
33
|
+
...splitGap ? { "--split-gap": splitGap } : null,
|
|
34
|
+
...style
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsxs(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
"data-sable-split": true,
|
|
41
|
+
"data-collapse": collapseBelow,
|
|
42
|
+
className: cn(className),
|
|
43
|
+
style: mergedStyle,
|
|
44
|
+
...rest,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0", children: primary }),
|
|
47
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0", children: secondary })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
SplitPane.displayName = "SplitPane";
|
|
53
|
+
export {
|
|
54
|
+
SplitPane
|
|
55
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// src/layout/Stack.tsx
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var ALIGN = {
|
|
5
|
+
start: "flex-start",
|
|
6
|
+
center: "center",
|
|
7
|
+
end: "flex-end",
|
|
8
|
+
stretch: "stretch"
|
|
9
|
+
};
|
|
10
|
+
var JUSTIFY = {
|
|
11
|
+
start: "flex-start",
|
|
12
|
+
center: "center",
|
|
13
|
+
end: "flex-end",
|
|
14
|
+
between: "space-between",
|
|
15
|
+
around: "space-around"
|
|
16
|
+
};
|
|
17
|
+
function resolveGap(gap) {
|
|
18
|
+
return typeof gap === "number" ? `calc(var(--rhythm-unit) * ${gap})` : gap;
|
|
19
|
+
}
|
|
20
|
+
function Stack({
|
|
21
|
+
gap = 2,
|
|
22
|
+
align = "stretch",
|
|
23
|
+
justify = "start",
|
|
24
|
+
className,
|
|
25
|
+
style,
|
|
26
|
+
children,
|
|
27
|
+
ref,
|
|
28
|
+
...rest
|
|
29
|
+
}) {
|
|
30
|
+
const mergedStyle = {
|
|
31
|
+
display: "flex",
|
|
32
|
+
flexDirection: "column",
|
|
33
|
+
alignItems: ALIGN[align],
|
|
34
|
+
justifyContent: JUSTIFY[justify],
|
|
35
|
+
gap: resolveGap(gap),
|
|
36
|
+
...style
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(className), style: mergedStyle, ...rest, children });
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
Stack
|
|
42
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/layout/_responsive.ts
|
|
2
|
+
var BREAKPOINTS = ["base", "sm", "md", "lg", "xl", "2xl"];
|
|
3
|
+
function responsiveVars(prefix, value) {
|
|
4
|
+
if (value === void 0) return {};
|
|
5
|
+
if (typeof value === "number") return { [`${prefix}-base`]: value };
|
|
6
|
+
const out = {};
|
|
7
|
+
for (const bp of BREAKPOINTS) {
|
|
8
|
+
const v = value[bp];
|
|
9
|
+
if (v != null) out[`${prefix}-${bp}`] = v;
|
|
10
|
+
}
|
|
11
|
+
return out;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
BREAKPOINTS,
|
|
15
|
+
responsiveVars
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/layout/_safeArea.ts
|
|
2
|
+
var EDGE_PROP = {
|
|
3
|
+
top: "paddingTop",
|
|
4
|
+
bottom: "paddingBottom",
|
|
5
|
+
left: "paddingLeft",
|
|
6
|
+
right: "paddingRight"
|
|
7
|
+
};
|
|
8
|
+
function safeAreaInsets(edges) {
|
|
9
|
+
const out = {};
|
|
10
|
+
for (const edge of edges) {
|
|
11
|
+
out[EDGE_PROP[edge]] = `env(safe-area-inset-${edge}, 0px)`;
|
|
12
|
+
}
|
|
13
|
+
return out;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
EDGE_PROP,
|
|
17
|
+
safeAreaInsets
|
|
18
|
+
};
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -94,19 +94,38 @@ interface GridProps extends ComponentPropsWithRef<"div"> {
|
|
|
94
94
|
*/
|
|
95
95
|
cols?: Responsive<number>;
|
|
96
96
|
/**
|
|
97
|
-
* Make cells "breathe": `
|
|
98
|
-
* The grid grows/wraps responsively without
|
|
97
|
+
* Make cells "breathe": as many columns of at least `minItemWidth` as fit,
|
|
98
|
+
* sharing the leftover space. The grid grows/wraps responsively without
|
|
99
|
+
* breakpoints. e.g. "16rem".
|
|
99
100
|
*/
|
|
100
101
|
minItemWidth?: string;
|
|
101
|
-
/**
|
|
102
|
-
|
|
102
|
+
/**
|
|
103
|
+
* What a `minItemWidth` grid does with columns it has no items for — the
|
|
104
|
+
* difference only shows when there are fewer items than fit one row.
|
|
105
|
+
*
|
|
106
|
+
* - `"fill"` (default) — `auto-fill`: the row keeps every column it has room
|
|
107
|
+
* for, so items keep their size whatever their count. One search result is
|
|
108
|
+
* one cover wide, not a banner. Right for collections: results, shelves,
|
|
109
|
+
* galleries, anything whose count is data.
|
|
110
|
+
* - `"fit"` — `auto-fit`: empty columns collapse and the items stretch to
|
|
111
|
+
* share the row. Right only for a fixed set designed to span it — three
|
|
112
|
+
* KPI cards, a row of plan tiers.
|
|
113
|
+
*/
|
|
114
|
+
track?: "fill" | "fit";
|
|
115
|
+
/**
|
|
116
|
+
* Gap between cells. Number = rhythm units (×8px); `[row, column]` = two
|
|
117
|
+
* rhythm counts, for a gallery whose rows want more air than its columns;
|
|
118
|
+
* string = raw CSS. Default `--grid-gutter`.
|
|
119
|
+
*/
|
|
120
|
+
gap?: number | readonly [row: number, column: number] | string;
|
|
103
121
|
}
|
|
104
122
|
/**
|
|
105
123
|
* CSS Grid layout primitive. Three modes: a fixed `cols` count, a responsive
|
|
106
124
|
* `cols` breakpoint map (fewer columns on small screens), or `minItemWidth`
|
|
107
|
-
*
|
|
125
|
+
* cells that breathe with no breakpoints at all (`track` decides whether a
|
|
126
|
+
* sparse row keeps its empty columns or stretches its items across them).
|
|
108
127
|
*/
|
|
109
|
-
declare function Grid({ cols, minItemWidth, gap, className, style, children, ref, ...rest }: GridProps): react.JSX.Element;
|
|
128
|
+
declare function Grid({ cols, minItemWidth, track, gap, className, style, children, ref, ...rest }: GridProps): react.JSX.Element;
|
|
110
129
|
|
|
111
130
|
interface ColumnsProps extends ComponentPropsWithRef<"div"> {
|
|
112
131
|
/**
|
package/dist/layout/index.js
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// src/layout/index.ts
|
|
2
|
+
export * from "./Region.js";
|
|
3
|
+
export * from "./Page.js";
|
|
4
|
+
export * from "./Grid.js";
|
|
5
|
+
export * from "./Columns.js";
|
|
6
|
+
export * from "./Stack.js";
|
|
7
|
+
export * from "./Row.js";
|
|
8
|
+
export * from "./Spacer.js";
|
|
9
|
+
export * from "./Center.js";
|
|
10
|
+
export * from "./AspectBox.js";
|
|
11
|
+
export * from "./Bleed.js";
|
|
12
|
+
export * from "./SplitPane.js";
|
|
13
|
+
export * from "./SafeArea.js";
|
|
14
|
+
export * from "./GridOverlay.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// src/lib/anchored-scroll.ts
|
|
2
|
+
var anchoredScroll = "max-h-[var(--available-height)] overflow-y-auto overscroll-contain scrollbar-quiet";
|
|
3
|
+
var anchoredListScroll = "max-h-[min(18rem,var(--available-height))] overflow-y-auto overscroll-contain scrollbar-quiet";
|
|
4
|
+
export {
|
|
5
|
+
anchoredListScroll,
|
|
6
|
+
anchoredScroll
|
|
7
|
+
};
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/lib/chart/cartesian.tsx
|
|
4
|
+
import { useId } from "react";
|
|
5
|
+
import { cn } from "../cn.js";
|
|
6
|
+
import { ChartFrame } from "./chart-frame.js";
|
|
7
|
+
import { ChartLegend } from "./chart-legend.js";
|
|
8
|
+
import { ChartTooltipContent } from "./chart-tooltip.js";
|
|
9
|
+
import { approxTextWidth, categoryText, chartFormatters } from "./format.js";
|
|
10
|
+
import { areaPath, linePath, rectPath } from "./geometry.js";
|
|
11
|
+
import { GLIDE, barTransition, drawTransition, morphTransition, pathStyle, riseTransition, stagger } from "./motion.js";
|
|
12
|
+
import { bandScale, extent, linearScale, niceTicks, pointScale, stack } from "./scale.js";
|
|
13
|
+
import {
|
|
14
|
+
chartColor,
|
|
15
|
+
numberValue,
|
|
16
|
+
resolveSeries,
|
|
17
|
+
toneColor
|
|
18
|
+
} from "./types.js";
|
|
19
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
var AXIS_TEXT = "fill-muted-foreground text-caption tabular-nums";
|
|
21
|
+
var RULE = "stroke-foreground/10";
|
|
22
|
+
var SURFACE = "stroke-(--sable-surface-bg,var(--background))";
|
|
23
|
+
var GAP = 2;
|
|
24
|
+
function CartesianChart(props) {
|
|
25
|
+
const {
|
|
26
|
+
kind,
|
|
27
|
+
data,
|
|
28
|
+
index,
|
|
29
|
+
series: rawSeries,
|
|
30
|
+
label,
|
|
31
|
+
className,
|
|
32
|
+
valueFormatter,
|
|
33
|
+
indexFormatter,
|
|
34
|
+
locale,
|
|
35
|
+
tooltip = true,
|
|
36
|
+
legend,
|
|
37
|
+
animate = true,
|
|
38
|
+
activeIndex,
|
|
39
|
+
defaultActiveIndex,
|
|
40
|
+
onActiveIndexChange,
|
|
41
|
+
curve = "smooth",
|
|
42
|
+
stacked = false,
|
|
43
|
+
gradient = false,
|
|
44
|
+
dots = false,
|
|
45
|
+
labels = false,
|
|
46
|
+
orientation = "vertical",
|
|
47
|
+
colorBy = "series",
|
|
48
|
+
negativeTone,
|
|
49
|
+
radius = 4,
|
|
50
|
+
barWidth = 24
|
|
51
|
+
} = props;
|
|
52
|
+
const horizontal = kind === "bar" && orientation === "horizontal";
|
|
53
|
+
const xAxis = props.xAxis ?? !horizontal;
|
|
54
|
+
const yAxis = props.yAxis ?? horizontal;
|
|
55
|
+
const grid = props.grid ?? !horizontal;
|
|
56
|
+
const uid = useId().replace(/:/g, "");
|
|
57
|
+
const series = resolveSeries(rawSeries);
|
|
58
|
+
const fmt = chartFormatters(locale, valueFormatter);
|
|
59
|
+
const expand = stacked === "expand";
|
|
60
|
+
const percent = new Intl.NumberFormat(locale, { style: "percent", maximumFractionDigits: 0 });
|
|
61
|
+
const n = data.length;
|
|
62
|
+
const values = series.map((s) => data.map((d) => numberValue(d[s.key])));
|
|
63
|
+
const stacks = stacked ? stack(values, expand) : null;
|
|
64
|
+
const categories = data.map((d) => categoryText(d[index], locale));
|
|
65
|
+
const tickText = (i) => indexFormatter ? indexFormatter(categories[i]) : categories[i];
|
|
66
|
+
const tooltipOptions = typeof tooltip === "object" ? tooltip : {};
|
|
67
|
+
const showLegend = legend ?? series.length > 1;
|
|
68
|
+
const hasNegative = values.some((s) => s.some((v) => v < 0));
|
|
69
|
+
const domainValues = stacks ? stacks.flatMap((s) => s.map(([a, b]) => [a, b])) : values;
|
|
70
|
+
const [lo, hi] = expand ? [0, 1] : extent(domainValues, kind !== "line");
|
|
71
|
+
const colorAt = (s, i) => {
|
|
72
|
+
if (negativeTone && values[s][i] < 0) return toneColor(negativeTone);
|
|
73
|
+
if (colorBy === "index") return chartColor(i);
|
|
74
|
+
return series[s].colorValue;
|
|
75
|
+
};
|
|
76
|
+
const axisValue = (v) => expand ? percent.format(v) : fmt.axis(v);
|
|
77
|
+
const fullValue = (s, i) => {
|
|
78
|
+
const v = values[s][i];
|
|
79
|
+
if (!expand || !stacks) return fmt.full(v);
|
|
80
|
+
const [a, b] = stacks[s][i];
|
|
81
|
+
return `${fmt.full(v)} (${percent.format(Math.abs(b - a))})`;
|
|
82
|
+
};
|
|
83
|
+
const layoutFor = (size) => {
|
|
84
|
+
const valueSpan = horizontal ? size.width : size.height;
|
|
85
|
+
const ticks = niceTicks(lo, hi, Math.max(2, Math.min(6, Math.round(valueSpan / 56))));
|
|
86
|
+
const domain = expand ? [0, 1] : [ticks[0], ticks[ticks.length - 1]];
|
|
87
|
+
const valueTicks = expand ? [0, 0.25, 0.5, 0.75, 1] : ticks;
|
|
88
|
+
const categoryWidth = Math.max(0, ...categories.map((_, i) => approxTextWidth(tickText(i))));
|
|
89
|
+
const valueWidth = Math.max(0, ...valueTicks.map((t) => approxTextWidth(axisValue(t))));
|
|
90
|
+
const labelRoom = labels ? horizontal ? Math.max(...values.flat().map((v) => approxTextWidth(fmt.full(v)))) + 8 : 20 : 0;
|
|
91
|
+
const inset = kind === "bar" ? 0 : dots ? 6 : 2;
|
|
92
|
+
const left = (yAxis ? (horizontal ? categoryWidth : valueWidth) + 10 : 0) + inset;
|
|
93
|
+
const right = inset + (horizontal ? labelRoom : 0);
|
|
94
|
+
const top = (dots ? 6 : 4) + (horizontal ? 0 : labelRoom);
|
|
95
|
+
const bottom = xAxis ? 26 : dots ? 6 : 2;
|
|
96
|
+
const x0 = left;
|
|
97
|
+
const x1 = Math.max(x0 + 1, size.width - right);
|
|
98
|
+
const y0 = top;
|
|
99
|
+
const y1 = Math.max(y0 + 1, size.height - bottom);
|
|
100
|
+
const value = horizontal ? linearScale(domain, [x0, x1]) : linearScale(domain, [y1, y0]);
|
|
101
|
+
const base = value(Math.max(domain[0], Math.min(domain[1], 0)));
|
|
102
|
+
const catRange = horizontal ? [y0, y1] : [x0, x1];
|
|
103
|
+
const band = kind === "bar" ? bandScale(n, catRange, series.length > 1 && !stacked ? 0.2 : 0.3, 0) : null;
|
|
104
|
+
const point = kind === "bar" ? null : pointScale(n, catRange);
|
|
105
|
+
const center = (i) => band ? band.at(i) + band.bandwidth / 2 : point?.at(i) ?? 0;
|
|
106
|
+
return { x0, x1, y0, y1, value, base, valueTicks, band, point, center };
|
|
107
|
+
};
|
|
108
|
+
const hitTest = (x, y, size) => {
|
|
109
|
+
if (!n) return null;
|
|
110
|
+
const L = layoutFor(size);
|
|
111
|
+
const pos = horizontal ? y : x;
|
|
112
|
+
let best = 0;
|
|
113
|
+
let dist = Number.POSITIVE_INFINITY;
|
|
114
|
+
for (let i = 0; i < n; i++) {
|
|
115
|
+
const d = Math.abs(L.center(i) - pos);
|
|
116
|
+
if (d < dist) {
|
|
117
|
+
dist = d;
|
|
118
|
+
best = i;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return best;
|
|
122
|
+
};
|
|
123
|
+
const describe = (i) => `${categories[i]}: ${series.map((s, k) => `${s.label} ${fullValue(k, i)}`).join(", ")}`;
|
|
124
|
+
const tooltipFor = (i, size) => {
|
|
125
|
+
const L = layoutFor(size);
|
|
126
|
+
const total = values.reduce((sum, s) => sum + s[i], 0);
|
|
127
|
+
const content = /* @__PURE__ */ jsx(
|
|
128
|
+
ChartTooltipContent,
|
|
129
|
+
{
|
|
130
|
+
indicator: tooltipOptions.indicator,
|
|
131
|
+
label: tooltipOptions.hideLabel ? void 0 : tooltipOptions.labelFormatter ? tooltipOptions.labelFormatter(categories[i], data[i]) : categories[i],
|
|
132
|
+
rows: series.map((s, k) => ({ key: s.key, label: s.label, value: fullValue(k, i), color: colorAt(k, i), icon: s.icon })),
|
|
133
|
+
total: tooltipOptions.showTotal ? fmt.full(total) : void 0
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
if (horizontal) {
|
|
137
|
+
const end = Math.max(0, ...series.map((_, k) => stacks ? stacks[k][i][1] : values[k][i]));
|
|
138
|
+
return { content, x: Math.min(L.value(end), L.x1), y: L.center(i) };
|
|
139
|
+
}
|
|
140
|
+
return { content, x: L.center(i), y: (L.y0 + L.y1) / 2 };
|
|
141
|
+
};
|
|
142
|
+
const table = {
|
|
143
|
+
headers: [index.charAt(0).toUpperCase() + index.slice(1), ...series.map((s) => s.label)],
|
|
144
|
+
rows: data.map((_, i) => [categories[i], ...series.map((_2, k) => fullValue(k, i))])
|
|
145
|
+
};
|
|
146
|
+
return /* @__PURE__ */ jsx(
|
|
147
|
+
ChartFrame,
|
|
148
|
+
{
|
|
149
|
+
label,
|
|
150
|
+
className,
|
|
151
|
+
count: n,
|
|
152
|
+
interactive: tooltip !== false,
|
|
153
|
+
animate,
|
|
154
|
+
activeIndex,
|
|
155
|
+
defaultActiveIndex,
|
|
156
|
+
onActiveIndexChange,
|
|
157
|
+
hitTest,
|
|
158
|
+
tooltip: tooltip === false ? void 0 : tooltipFor,
|
|
159
|
+
describe,
|
|
160
|
+
table,
|
|
161
|
+
legend: showLegend ? /* @__PURE__ */ jsx(ChartLegend, { items: series.map((s) => ({ key: s.key, label: s.label, color: s.colorValue, icon: s.icon })) }) : null,
|
|
162
|
+
children: ({ size, activeIndex: active }) => {
|
|
163
|
+
const L = layoutFor(size);
|
|
164
|
+
const marks = [];
|
|
165
|
+
const activeDots = [];
|
|
166
|
+
const widths = categories.map((_, i) => approxTextWidth(tickText(i)));
|
|
167
|
+
const slot = (horizontal ? L.y1 - L.y0 : L.x1 - L.x0) / Math.max(1, n) || 1;
|
|
168
|
+
const every = Math.max(1, Math.ceil((horizontal ? 18 : Math.max(0, ...widths) + 12) / slot));
|
|
169
|
+
const categoryAxis = categories.map((_, i) => {
|
|
170
|
+
if ((n - 1 - i) % every !== 0) return null;
|
|
171
|
+
const p = L.center(i);
|
|
172
|
+
if (horizontal) {
|
|
173
|
+
return /* @__PURE__ */ jsx("text", { x: L.x0 - 10, y: p, dy: "0.32em", textAnchor: "end", className: AXIS_TEXT, children: tickText(i) }, `c${i}`);
|
|
174
|
+
}
|
|
175
|
+
const half = widths[i] / 2;
|
|
176
|
+
const x = Math.min(Math.max(p, L.x0 + half), L.x1 - half);
|
|
177
|
+
return /* @__PURE__ */ jsx("text", { x, y: L.y1 + 18, textAnchor: "middle", className: AXIS_TEXT, children: tickText(i) }, `c${i}`);
|
|
178
|
+
});
|
|
179
|
+
const gridLines = L.valueTicks.map((t) => {
|
|
180
|
+
const p = L.value(t);
|
|
181
|
+
return horizontal ? /* @__PURE__ */ jsx("line", { x1: p, x2: p, y1: L.y0, y2: L.y1, className: RULE }, `g${t}`) : /* @__PURE__ */ jsx("line", { x1: L.x0, x2: L.x1, y1: p, y2: p, className: RULE }, `g${t}`);
|
|
182
|
+
});
|
|
183
|
+
const valueAxis = L.valueTicks.map((t) => {
|
|
184
|
+
const p = L.value(t);
|
|
185
|
+
return horizontal ? /* @__PURE__ */ jsx("text", { x: p, y: L.y1 + 18, textAnchor: "middle", className: AXIS_TEXT, children: axisValue(t) }, `v${t}`) : /* @__PURE__ */ jsx("text", { x: L.x0 - 10, y: p, dy: "0.32em", textAnchor: "end", className: AXIS_TEXT, children: axisValue(t) }, `v${t}`);
|
|
186
|
+
});
|
|
187
|
+
let cursor = null;
|
|
188
|
+
if (active != null && active < n) {
|
|
189
|
+
const c = L.center(active);
|
|
190
|
+
const move = { transform: horizontal ? `translate(0px, ${c}px)` : `translate(${c}px, 0px)`, transition: GLIDE };
|
|
191
|
+
if (L.band) {
|
|
192
|
+
const w = L.band.bandwidth;
|
|
193
|
+
cursor = /* @__PURE__ */ jsx("g", { style: move, children: horizontal ? /* @__PURE__ */ jsx("rect", { x: L.x0, y: -w / 2, width: L.x1 - L.x0, height: w, rx: 6, className: "fill-foreground/5" }) : /* @__PURE__ */ jsx("rect", { x: -w / 2, y: L.y0, width: w, height: L.y1 - L.y0, rx: 6, className: "fill-foreground/5" }) });
|
|
194
|
+
} else {
|
|
195
|
+
cursor = /* @__PURE__ */ jsx("g", { style: move, children: /* @__PURE__ */ jsx("line", { x1: 0, x2: 0, y1: L.y0, y2: L.y1, className: "stroke-foreground/25" }) });
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (kind === "bar" && L.band) {
|
|
199
|
+
const band = L.band;
|
|
200
|
+
const groups = stacked ? 1 : series.length;
|
|
201
|
+
const thickness = Math.max(2, Math.min(barWidth, (band.bandwidth - GAP * (groups - 1)) / groups));
|
|
202
|
+
const groupSize = thickness * groups + GAP * (groups - 1);
|
|
203
|
+
series.forEach((_, k) => {
|
|
204
|
+
for (let i = 0; i < n; i++) {
|
|
205
|
+
const [a, b] = stacks ? stacks[k][i] : [0, values[k][i]];
|
|
206
|
+
if (a === b) continue;
|
|
207
|
+
const offset = band.at(i) + (band.bandwidth - groupSize) / 2 + (stacked ? 0 : k * (thickness + GAP));
|
|
208
|
+
const positive = b >= a;
|
|
209
|
+
const onAnother = stacks ? stacks.some((other, j) => j < k && other[i][0] !== other[i][1] && Math.sign(other[i][1] - other[i][0]) === Math.sign(b - a)) : false;
|
|
210
|
+
const outer = !stacks || !stacks.some((other, j) => j > k && other[i][0] !== other[i][1] && Math.sign(other[i][1] - other[i][0]) === Math.sign(b - a));
|
|
211
|
+
const r = outer ? radius : 0;
|
|
212
|
+
const p0 = L.value(a);
|
|
213
|
+
const p1 = L.value(b);
|
|
214
|
+
const dir = Math.sign(p1 - p0) || 1;
|
|
215
|
+
const start = p0 + (onAnother ? GAP * dir : 0);
|
|
216
|
+
let d;
|
|
217
|
+
let origin;
|
|
218
|
+
if (horizontal) {
|
|
219
|
+
const x = Math.min(start, p1);
|
|
220
|
+
const w = Math.max(1, Math.abs(p1 - start));
|
|
221
|
+
d = rectPath(x, offset, w, thickness, positive ? [0, r, r, 0] : [r, 0, 0, r]);
|
|
222
|
+
origin = `${L.base}px 0px`;
|
|
223
|
+
} else {
|
|
224
|
+
const y = Math.min(start, p1);
|
|
225
|
+
const h = Math.max(1, Math.abs(p1 - start));
|
|
226
|
+
d = rectPath(offset, y, thickness, h, positive ? [r, r, 0, 0] : [0, 0, r, r]);
|
|
227
|
+
origin = `0px ${L.base}px`;
|
|
228
|
+
}
|
|
229
|
+
const dim = active != null && active !== i;
|
|
230
|
+
marks.push(
|
|
231
|
+
/* @__PURE__ */ jsx(
|
|
232
|
+
"path",
|
|
233
|
+
{
|
|
234
|
+
d,
|
|
235
|
+
className: cn(
|
|
236
|
+
horizontal ? "[[data-reveal=out]_&]:scale-x-0" : "[[data-reveal=out]_&]:scale-y-0",
|
|
237
|
+
dim && "opacity-40"
|
|
238
|
+
),
|
|
239
|
+
style: {
|
|
240
|
+
...pathStyle(d),
|
|
241
|
+
fill: colorAt(k, i),
|
|
242
|
+
transformOrigin: origin,
|
|
243
|
+
transition: barTransition(stagger(i))
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
`b${k}-${i}`
|
|
247
|
+
)
|
|
248
|
+
);
|
|
249
|
+
if (labels && (!stacked || outer)) {
|
|
250
|
+
const end = stacks ? stacks[k][i][1] : values[k][i];
|
|
251
|
+
const text = stacked ? fmt.full(values.reduce((sum, sv) => sum + sv[i], 0)) : fmt.full(values[k][i]);
|
|
252
|
+
const shown = expand ? percent.format(1) : text;
|
|
253
|
+
const labelClass = "fill-foreground text-caption tabular-nums [[data-reveal=out]_&]:opacity-0";
|
|
254
|
+
if (labels === "inside" && horizontal && thickness >= 16) {
|
|
255
|
+
marks.push(
|
|
256
|
+
/* @__PURE__ */ jsx("text", { x: Math.min(p0, p1) + 8, y: offset + thickness / 2, dy: "0.32em", className: "fill-background text-label-sm [[data-reveal=out]_&]:opacity-0", style: { transition: riseTransition(stagger(i)) }, children: categories[i] }, `li${k}-${i}`)
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
marks.push(
|
|
260
|
+
horizontal ? /* @__PURE__ */ jsx("text", { x: L.value(end) + (end >= 0 ? 6 : -6), y: offset + thickness / 2, dy: "0.32em", textAnchor: end >= 0 ? "start" : "end", className: labelClass, style: { transition: riseTransition(stagger(i)) }, children: shown }, `l${k}-${i}`) : /* @__PURE__ */ jsx("text", { x: offset + thickness / 2, y: L.value(end) + (end >= 0 ? -7 : 15), textAnchor: "middle", className: labelClass, style: { transition: riseTransition(stagger(i)) }, children: shown }, `l${k}-${i}`)
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
} else if (L.point) {
|
|
266
|
+
const pts = (k, which) => data.map((_, i) => [L.center(i), L.value(stacks ? stacks[k][i][which] : which === 0 ? 0 : values[k][i])]);
|
|
267
|
+
const order = series.map((_, k) => k);
|
|
268
|
+
if (kind === "area" && !stacks) order.reverse();
|
|
269
|
+
for (const k of order) {
|
|
270
|
+
const s = series[k];
|
|
271
|
+
const top = pts(k, 1);
|
|
272
|
+
if (kind === "area") {
|
|
273
|
+
const bottom = stacks ? pts(k, 0) : top.map(([x]) => [x, L.base]);
|
|
274
|
+
const d = areaPath(top, bottom, curve);
|
|
275
|
+
const fillId = `${uid}-fill-${k}`;
|
|
276
|
+
if (gradient) {
|
|
277
|
+
marks.push(
|
|
278
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: fillId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
279
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: s.colorValue, stopOpacity: stacks ? 0.5 : 0.22 }),
|
|
280
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: s.colorValue, stopOpacity: 0.02 })
|
|
281
|
+
] }) }, `d${k}`)
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
marks.push(
|
|
285
|
+
/* @__PURE__ */ jsx(
|
|
286
|
+
"path",
|
|
287
|
+
{
|
|
288
|
+
d,
|
|
289
|
+
className: "[[data-reveal=out]_&]:scale-y-0 [[data-reveal=out]_&]:opacity-0",
|
|
290
|
+
style: {
|
|
291
|
+
...pathStyle(d),
|
|
292
|
+
fill: gradient ? `url(#${fillId})` : s.colorValue,
|
|
293
|
+
// A wash where areas overlap; firmer when stacked, where each band is its own.
|
|
294
|
+
fillOpacity: gradient ? 1 : stacks ? 0.32 : 0.14,
|
|
295
|
+
transformOrigin: `0px ${L.base}px`,
|
|
296
|
+
transition: riseTransition(stagger(k, 80))
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
`a${k}`
|
|
300
|
+
)
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
const line = linePath(top, curve);
|
|
304
|
+
marks.push(
|
|
305
|
+
/* @__PURE__ */ jsx(
|
|
306
|
+
"path",
|
|
307
|
+
{
|
|
308
|
+
d: line,
|
|
309
|
+
pathLength: 1,
|
|
310
|
+
fill: "none",
|
|
311
|
+
strokeWidth: 2,
|
|
312
|
+
strokeLinecap: "round",
|
|
313
|
+
strokeLinejoin: "round",
|
|
314
|
+
className: "[stroke-dasharray:1] [stroke-dashoffset:0] [[data-reveal=out]_&]:[stroke-dashoffset:1]",
|
|
315
|
+
style: { ...pathStyle(line), stroke: s.colorValue, transition: drawTransition(stagger(k, 120)) }
|
|
316
|
+
},
|
|
317
|
+
`s${k}`
|
|
318
|
+
)
|
|
319
|
+
);
|
|
320
|
+
if (dots || labels) {
|
|
321
|
+
top.forEach(([x, y], i) => {
|
|
322
|
+
if (dots)
|
|
323
|
+
marks.push(
|
|
324
|
+
/* @__PURE__ */ jsx(
|
|
325
|
+
"circle",
|
|
326
|
+
{
|
|
327
|
+
cx: x,
|
|
328
|
+
cy: y,
|
|
329
|
+
r: 4,
|
|
330
|
+
strokeWidth: 2,
|
|
331
|
+
className: cn(SURFACE, "[[data-reveal=out]_&]:opacity-0"),
|
|
332
|
+
style: { fill: colorBy === "index" ? colorAt(k, i) : s.colorValue, transition: morphTransition(), transitionDelay: `calc(${300 + i * 25}ms * var(--motion-scale, 1))` }
|
|
333
|
+
},
|
|
334
|
+
`p${k}-${i}`
|
|
335
|
+
)
|
|
336
|
+
);
|
|
337
|
+
if (labels)
|
|
338
|
+
marks.push(
|
|
339
|
+
/* @__PURE__ */ jsx("text", { x, y: y - 12, textAnchor: "middle", className: "fill-foreground text-caption tabular-nums [[data-reveal=out]_&]:opacity-0", style: { transition: morphTransition() }, children: fmt.full(values[k][i]) }, `t${k}-${i}`)
|
|
340
|
+
);
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
if (active != null && active < n) {
|
|
344
|
+
const [x, y] = top[active];
|
|
345
|
+
activeDots.push(/* @__PURE__ */ jsx("circle", { cx: x, cy: y, r: 5, strokeWidth: 2, className: SURFACE, style: { fill: s.colorValue, cx: x, cy: y, transition: GLIDE } }, `ap${k}`));
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
const zero = kind === "bar" && (hasNegative || !grid);
|
|
350
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
351
|
+
grid ? /* @__PURE__ */ jsx("g", { children: gridLines }) : null,
|
|
352
|
+
cursor,
|
|
353
|
+
/* @__PURE__ */ jsx("g", { children: marks }),
|
|
354
|
+
/* @__PURE__ */ jsx("g", { children: activeDots }),
|
|
355
|
+
zero ? horizontal ? /* @__PURE__ */ jsx("line", { x1: L.base, x2: L.base, y1: L.y0, y2: L.y1, className: "stroke-foreground/20" }) : /* @__PURE__ */ jsx("line", { x1: L.x0, x2: L.x1, y1: L.base, y2: L.base, className: "stroke-foreground/20" }) : null,
|
|
356
|
+
(horizontal ? xAxis : yAxis) ? /* @__PURE__ */ jsx("g", { children: valueAxis }) : null,
|
|
357
|
+
(horizontal ? yAxis : xAxis) ? /* @__PURE__ */ jsx("g", { children: categoryAxis }) : null
|
|
358
|
+
] });
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
export {
|
|
364
|
+
CartesianChart
|
|
365
|
+
};
|