@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,268 @@
|
|
|
1
|
+
// src/patterns/settings-page.tsx
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Icon } from "../icon/index.js";
|
|
4
|
+
import { AppHeader } from "../components/app-header/index.js";
|
|
5
|
+
import { AppShell } from "../components/app-shell/index.js";
|
|
6
|
+
import { Avatar } from "../components/avatar/index.js";
|
|
7
|
+
import { BottomNav, BottomNavItem } from "../components/bottom-nav/index.js";
|
|
8
|
+
import { Button } from "../components/button/index.js";
|
|
9
|
+
import {
|
|
10
|
+
Card,
|
|
11
|
+
CardAction,
|
|
12
|
+
CardContent,
|
|
13
|
+
CardDescription,
|
|
14
|
+
CardFooter,
|
|
15
|
+
CardHeader,
|
|
16
|
+
CardList,
|
|
17
|
+
CardTitle
|
|
18
|
+
} from "../components/card/index.js";
|
|
19
|
+
import { DestructiveActionModal } from "../components/destructive-action-modal/index.js";
|
|
20
|
+
import { OverflowMenu } from "../components/overflow-menu/index.js";
|
|
21
|
+
import { Entity } from "../components/entity/index.js";
|
|
22
|
+
import { Field, Form } from "../components/form/index.js";
|
|
23
|
+
import { Input } from "../components/input/index.js";
|
|
24
|
+
import { MenuItem, MenuSeparator } from "../components/menu/index.js";
|
|
25
|
+
import { NotificationBadge } from "../components/notification-badge/index.js";
|
|
26
|
+
import { PageHeader } from "../components/page-header/index.js";
|
|
27
|
+
import { Select, SelectContent, SelectItem, SelectTrigger } from "../components/select/index.js";
|
|
28
|
+
import { SideNav, SideNavItem } from "../components/side-nav/index.js";
|
|
29
|
+
import {
|
|
30
|
+
Sidebar,
|
|
31
|
+
SidebarFooter,
|
|
32
|
+
SidebarBrand,
|
|
33
|
+
SidebarHeader,
|
|
34
|
+
SidebarItem,
|
|
35
|
+
SidebarNav
|
|
36
|
+
} from "../components/sidebar/index.js";
|
|
37
|
+
import { Switch } from "../components/switch/index.js";
|
|
38
|
+
import { Textarea } from "../components/textarea/index.js";
|
|
39
|
+
import { Col, Columns, Grid, Page, Row, Stack } from "../layout/index.js";
|
|
40
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
41
|
+
var sections = [
|
|
42
|
+
{ id: "profile", label: "Profile" },
|
|
43
|
+
{ id: "notifications", label: "Notifications" },
|
|
44
|
+
{ id: "payouts", label: "Payouts" },
|
|
45
|
+
{ id: "account", label: "Account" }
|
|
46
|
+
];
|
|
47
|
+
var timezones = [
|
|
48
|
+
{ value: "europe-london", label: "London (GMT+1)" },
|
|
49
|
+
{ value: "europe-paris", label: "Paris (GMT+2)" },
|
|
50
|
+
{ value: "america-new-york", label: "New York (GMT\u22124)" },
|
|
51
|
+
{ value: "america-los-angeles", label: "Los Angeles (GMT\u22127)" },
|
|
52
|
+
{ value: "asia-tokyo", label: "Tokyo (GMT+9)" }
|
|
53
|
+
];
|
|
54
|
+
var notifications = [
|
|
55
|
+
{ name: "notifyCollects", title: "New collects", description: "When someone collects your work", on: true },
|
|
56
|
+
{ name: "notifySoldOut", title: "Sold out", description: "When an edition sells its last copy", on: true },
|
|
57
|
+
{ name: "notifyFollowers", title: "New followers", description: "When a collector follows you", on: false },
|
|
58
|
+
{ name: "notifyDigest", title: "Weekly digest", description: "Sales and collectors, every Monday", on: true },
|
|
59
|
+
{ name: "notifyProduct", title: "Product updates", description: "New Atelier features", on: false }
|
|
60
|
+
];
|
|
61
|
+
var payouts = [
|
|
62
|
+
{ label: "Next payout", value: "$1,284.60", note: "Friday, Oct 16" },
|
|
63
|
+
{ label: "Pending", value: "$412.00", note: "Clears in 7 days" },
|
|
64
|
+
{ label: "Paid this year", value: "$18,920.00", note: "Across 214 collects" }
|
|
65
|
+
];
|
|
66
|
+
function SettingsPage() {
|
|
67
|
+
const [activeSection, setActiveSection] = useState("profile");
|
|
68
|
+
const [deleteOpen, setDeleteOpen] = useState(false);
|
|
69
|
+
return /* @__PURE__ */ jsxs(
|
|
70
|
+
AppShell,
|
|
71
|
+
{
|
|
72
|
+
header: /* @__PURE__ */ jsx(
|
|
73
|
+
AppHeader,
|
|
74
|
+
{
|
|
75
|
+
title: /* @__PURE__ */ jsxs(Row, { gap: 1, align: "center", children: [
|
|
76
|
+
/* @__PURE__ */ jsx(Icon, { name: "gem", variant: "solid", className: "text-xl" }),
|
|
77
|
+
/* @__PURE__ */ jsx("span", { className: "text-title-sm", children: "Atelier" })
|
|
78
|
+
] }),
|
|
79
|
+
actions: /* @__PURE__ */ jsx(Avatar, { variant: "art", size: "sm", fallback: "AL", alt: "Ada Lovelace" })
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
bottomNav: /* @__PURE__ */ jsxs(BottomNav, { "aria-label": "Primary", children: [
|
|
83
|
+
/* @__PURE__ */ jsx(BottomNavItem, { icon: /* @__PURE__ */ jsx(Icon, { name: "grid" }), label: "Overview", showLabel: true, render: /* @__PURE__ */ jsx("a", { href: "/" }) }),
|
|
84
|
+
/* @__PURE__ */ jsx(BottomNavItem, { icon: /* @__PURE__ */ jsx(Icon, { name: "image-stack" }), label: "Editions", showLabel: true, render: /* @__PURE__ */ jsx("a", { href: "/editions" }) }),
|
|
85
|
+
/* @__PURE__ */ jsx(BottomNavItem, { icon: /* @__PURE__ */ jsx(Icon, { name: "user" }), label: "Collectors", showLabel: true, render: /* @__PURE__ */ jsx("a", { href: "/collectors" }) }),
|
|
86
|
+
/* @__PURE__ */ jsx(BottomNavItem, { icon: /* @__PURE__ */ jsx(Icon, { name: "bell" }), label: "Activity", showLabel: true, render: /* @__PURE__ */ jsx("a", { href: "/activity" }) }),
|
|
87
|
+
/* @__PURE__ */ jsx(BottomNavItem, { icon: /* @__PURE__ */ jsx(Icon, { name: "gear" }), label: "Settings", showLabel: true, active: true, render: /* @__PURE__ */ jsx("a", { href: "/settings" }) })
|
|
88
|
+
] }),
|
|
89
|
+
sidebar: /* @__PURE__ */ jsxs(Sidebar, { children: [
|
|
90
|
+
/* @__PURE__ */ jsx(SidebarHeader, { children: /* @__PURE__ */ jsx(SidebarBrand, { mark: /* @__PURE__ */ jsx(Icon, { name: "gem", variant: "solid" }), label: "Atelier", render: /* @__PURE__ */ jsx("a", { href: "/" }) }) }),
|
|
91
|
+
/* @__PURE__ */ jsxs(SidebarNav, { children: [
|
|
92
|
+
/* @__PURE__ */ jsx(SidebarItem, { icon: /* @__PURE__ */ jsx(Icon, { name: "grid" }), label: "Overview", render: /* @__PURE__ */ jsx("a", { href: "/" }) }),
|
|
93
|
+
/* @__PURE__ */ jsx(SidebarItem, { icon: /* @__PURE__ */ jsx(Icon, { name: "image-stack" }), label: "Editions", render: /* @__PURE__ */ jsx("a", { href: "/editions" }) }),
|
|
94
|
+
/* @__PURE__ */ jsx(SidebarItem, { icon: /* @__PURE__ */ jsx(Icon, { name: "user" }), label: "Collectors", render: /* @__PURE__ */ jsx("a", { href: "/collectors" }) }),
|
|
95
|
+
/* @__PURE__ */ jsx(
|
|
96
|
+
SidebarItem,
|
|
97
|
+
{
|
|
98
|
+
icon: /* @__PURE__ */ jsx(Icon, { name: "bell" }),
|
|
99
|
+
label: "Activity",
|
|
100
|
+
badge: /* @__PURE__ */ jsx(NotificationBadge, { count: 4, tone: "neutral" }),
|
|
101
|
+
render: /* @__PURE__ */ jsx("a", { href: "/activity" })
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ jsx(SidebarItem, { icon: /* @__PURE__ */ jsx(Icon, { name: "gear" }), label: "Settings", active: true, render: /* @__PURE__ */ jsx("a", { href: "/settings" }) })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ jsx(SidebarFooter, { children: /* @__PURE__ */ jsx(
|
|
107
|
+
Entity,
|
|
108
|
+
{
|
|
109
|
+
className: "[--entity-py:0]",
|
|
110
|
+
leading: /* @__PURE__ */ jsx(Avatar, { variant: "art", size: "sm", fallback: "AL", alt: "" }),
|
|
111
|
+
title: "Ada Lovelace",
|
|
112
|
+
subtitle: "@ada",
|
|
113
|
+
action: /* @__PURE__ */ jsxs(OverflowMenu, { label: "Account", size: "icon-sm", children: [
|
|
114
|
+
/* @__PURE__ */ jsx(MenuItem, { render: /* @__PURE__ */ jsx("a", { href: "/@ada" }), children: "View profile" }),
|
|
115
|
+
/* @__PURE__ */ jsx(MenuItem, { render: /* @__PURE__ */ jsx("a", { href: "/settings" }), children: "Settings" }),
|
|
116
|
+
/* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
117
|
+
/* @__PURE__ */ jsx(MenuItem, { children: "Sign out" })
|
|
118
|
+
] })
|
|
119
|
+
}
|
|
120
|
+
) })
|
|
121
|
+
] }),
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ jsxs(Page, { max: "wide", gap: 4, className: "py-6", children: [
|
|
124
|
+
/* @__PURE__ */ jsx(
|
|
125
|
+
PageHeader,
|
|
126
|
+
{
|
|
127
|
+
title: "Settings",
|
|
128
|
+
description: "Manage your profile, notifications, and payouts."
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
/* @__PURE__ */ jsxs(Columns, { gap: 4, children: [
|
|
132
|
+
/* @__PURE__ */ jsx(Col, { span: { base: 12, lg: 3 }, className: "hidden lg:block", children: /* @__PURE__ */ jsx(SideNav, { "aria-label": "Settings sections", className: "sticky top-6", children: sections.map((section) => /* @__PURE__ */ jsx(
|
|
133
|
+
SideNavItem,
|
|
134
|
+
{
|
|
135
|
+
label: section.label,
|
|
136
|
+
active: activeSection === section.id,
|
|
137
|
+
onClick: () => setActiveSection(section.id),
|
|
138
|
+
render: /* @__PURE__ */ jsx("a", { href: `#${section.id}` })
|
|
139
|
+
},
|
|
140
|
+
section.id
|
|
141
|
+
)) }) }),
|
|
142
|
+
/* @__PURE__ */ jsx(Col, { span: { base: 12, lg: 9 }, children: /* @__PURE__ */ jsxs(Stack, { gap: 3, children: [
|
|
143
|
+
/* @__PURE__ */ jsxs(Card, { id: "profile", className: "scroll-mt-6", children: [
|
|
144
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
145
|
+
/* @__PURE__ */ jsx(CardTitle, { render: /* @__PURE__ */ jsx("h2", {}), children: "Profile" }),
|
|
146
|
+
/* @__PURE__ */ jsx(CardDescription, { children: "How collectors see you on Atelier." })
|
|
147
|
+
] }),
|
|
148
|
+
/* @__PURE__ */ jsxs(Form, { onSubmit: (event) => event.preventDefault(), className: "gap-0", children: [
|
|
149
|
+
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs(Stack, { gap: 3, children: [
|
|
150
|
+
/* @__PURE__ */ jsxs(Row, { gap: 2, children: [
|
|
151
|
+
/* @__PURE__ */ jsx(Avatar, { variant: "art", size: "lg", fallback: "AL", alt: "Ada Lovelace" }),
|
|
152
|
+
/* @__PURE__ */ jsxs(Stack, { gap: 0.5, align: "start", children: [
|
|
153
|
+
/* @__PURE__ */ jsxs(Row, { gap: 1, children: [
|
|
154
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", size: "sm", children: "Upload photo" }),
|
|
155
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "sm", children: "Remove" })
|
|
156
|
+
] }),
|
|
157
|
+
/* @__PURE__ */ jsx("p", { className: "text-caption text-muted-foreground", children: "Square PNG or JPG, at least 400 px." })
|
|
158
|
+
] })
|
|
159
|
+
] }),
|
|
160
|
+
/* @__PURE__ */ jsxs(Grid, { cols: { base: 1, sm: 2 }, gap: 3, children: [
|
|
161
|
+
/* @__PURE__ */ jsx(Field, { label: "Display name", name: "displayName", required: true, children: /* @__PURE__ */ jsx(Input, { defaultValue: "Ada Lovelace", autoComplete: "name" }) }),
|
|
162
|
+
/* @__PURE__ */ jsx(Field, { label: "Handle", name: "handle", description: "atelier.com/@ada", required: true, children: /* @__PURE__ */ jsx(Input, { defaultValue: "ada", autoComplete: "username", spellCheck: false }) })
|
|
163
|
+
] }),
|
|
164
|
+
/* @__PURE__ */ jsx(Field, { label: "Bio", name: "bio", description: "Shown on your profile and edition pages.", children: /* @__PURE__ */ jsx(
|
|
165
|
+
Textarea,
|
|
166
|
+
{
|
|
167
|
+
rows: 3,
|
|
168
|
+
defaultValue: "Generative artist working in plotted ink and code. New editions of 25 to 100 every month."
|
|
169
|
+
}
|
|
170
|
+
) }),
|
|
171
|
+
/* @__PURE__ */ jsx(Grid, { cols: { base: 1, sm: 2 }, gap: 3, children: /* @__PURE__ */ jsx(Field, { label: "Timezone", name: "timezone", description: "Release times use this zone.", children: /* @__PURE__ */ jsxs(Select, { defaultValue: "europe-london", items: timezones, children: [
|
|
172
|
+
/* @__PURE__ */ jsx(SelectTrigger, {}),
|
|
173
|
+
/* @__PURE__ */ jsx(SelectContent, { children: timezones.map((zone) => /* @__PURE__ */ jsx(SelectItem, { value: zone.value, children: zone.label }, zone.value)) })
|
|
174
|
+
] }) }) })
|
|
175
|
+
] }) }),
|
|
176
|
+
/* @__PURE__ */ jsx(CardFooter, { className: "justify-end", children: /* @__PURE__ */ jsx(Button, { type: "submit", children: "Save profile" }) })
|
|
177
|
+
] })
|
|
178
|
+
] }),
|
|
179
|
+
/* @__PURE__ */ jsxs(Card, { id: "notifications", className: "scroll-mt-6", children: [
|
|
180
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
181
|
+
/* @__PURE__ */ jsx(CardTitle, { render: /* @__PURE__ */ jsx("h2", {}), children: "Notifications" }),
|
|
182
|
+
/* @__PURE__ */ jsx(CardDescription, { children: "Email updates about your editions. Changes save automatically." })
|
|
183
|
+
] }),
|
|
184
|
+
/* @__PURE__ */ jsx(CardList, { children: notifications.map((item) => /* @__PURE__ */ jsx(
|
|
185
|
+
Entity,
|
|
186
|
+
{
|
|
187
|
+
title: item.title,
|
|
188
|
+
subtitle: item.description,
|
|
189
|
+
action: /* @__PURE__ */ jsx(
|
|
190
|
+
Switch,
|
|
191
|
+
{
|
|
192
|
+
name: item.name,
|
|
193
|
+
defaultChecked: item.on,
|
|
194
|
+
"aria-label": item.title
|
|
195
|
+
}
|
|
196
|
+
)
|
|
197
|
+
},
|
|
198
|
+
item.name
|
|
199
|
+
)) })
|
|
200
|
+
] }),
|
|
201
|
+
/* @__PURE__ */ jsxs(Card, { id: "payouts", className: "scroll-mt-6", children: [
|
|
202
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
203
|
+
/* @__PURE__ */ jsx(CardTitle, { render: /* @__PURE__ */ jsx("h2", {}), children: "Payouts" }),
|
|
204
|
+
/* @__PURE__ */ jsx(CardDescription, { children: "Paid in USD every Friday to Chase checking \u2022\u20224821." }),
|
|
205
|
+
/* @__PURE__ */ jsx(CardAction, { children: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", render: /* @__PURE__ */ jsx("a", { href: "/settings/payouts" }), children: "Manage payouts" }) })
|
|
206
|
+
] }),
|
|
207
|
+
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(Grid, { cols: { base: 1, sm: 3 }, gap: 3, children: payouts.map((stat) => /* @__PURE__ */ jsxs(Stack, { gap: 0.5, children: [
|
|
208
|
+
/* @__PURE__ */ jsx("p", { className: "text-body-sm text-muted-foreground", children: stat.label }),
|
|
209
|
+
/* @__PURE__ */ jsx("p", { className: "text-mono-lg text-foreground", children: stat.value }),
|
|
210
|
+
/* @__PURE__ */ jsx("p", { className: "text-caption text-muted-foreground", children: stat.note })
|
|
211
|
+
] }, stat.label)) }) })
|
|
212
|
+
] }),
|
|
213
|
+
/* @__PURE__ */ jsxs(Card, { id: "account", className: "scroll-mt-6", children: [
|
|
214
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
215
|
+
/* @__PURE__ */ jsx(CardTitle, { render: /* @__PURE__ */ jsx("h2", {}), children: "Account" }),
|
|
216
|
+
/* @__PURE__ */ jsx(CardDescription, { children: "Sign-in details and your data." })
|
|
217
|
+
] }),
|
|
218
|
+
/* @__PURE__ */ jsxs(CardList, { children: [
|
|
219
|
+
/* @__PURE__ */ jsx(
|
|
220
|
+
Entity,
|
|
221
|
+
{
|
|
222
|
+
leading: /* @__PURE__ */ jsx(Icon, { name: "mail", className: "text-lg text-muted-foreground" }),
|
|
223
|
+
title: "Email",
|
|
224
|
+
subtitle: "ada@atelier.art",
|
|
225
|
+
action: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", children: "Change" })
|
|
226
|
+
}
|
|
227
|
+
),
|
|
228
|
+
/* @__PURE__ */ jsx(
|
|
229
|
+
Entity,
|
|
230
|
+
{
|
|
231
|
+
leading: /* @__PURE__ */ jsx(Icon, { name: "download", className: "text-lg text-muted-foreground" }),
|
|
232
|
+
title: "Export data",
|
|
233
|
+
subtitle: "Editions, sales, and collectors",
|
|
234
|
+
action: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", children: "Export" })
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
] })
|
|
238
|
+
] }),
|
|
239
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
240
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
241
|
+
/* @__PURE__ */ jsx(CardTitle, { render: /* @__PURE__ */ jsx("h2", {}), children: "Delete account" }),
|
|
242
|
+
/* @__PURE__ */ jsx(CardDescription, { children: "Permanently remove your profile, editions, and sales history. Collectors keep the editions they own." })
|
|
243
|
+
] }),
|
|
244
|
+
/* @__PURE__ */ jsx(CardFooter, { className: "justify-end", children: /* @__PURE__ */ jsx(Button, { variant: "destructive", onClick: () => setDeleteOpen(true), children: "Delete account" }) })
|
|
245
|
+
] })
|
|
246
|
+
] }) })
|
|
247
|
+
] })
|
|
248
|
+
] }),
|
|
249
|
+
/* @__PURE__ */ jsx(
|
|
250
|
+
DestructiveActionModal,
|
|
251
|
+
{
|
|
252
|
+
open: deleteOpen,
|
|
253
|
+
onOpenChange: setDeleteOpen,
|
|
254
|
+
title: "Delete your account?",
|
|
255
|
+
description: "This permanently removes your profile, 12 editions, and sales history. Pending payouts are still sent. This can't be undone.",
|
|
256
|
+
confirmLabel: "Delete account",
|
|
257
|
+
confirmingLabel: "Deleting\u2026",
|
|
258
|
+
confirmText: "ada",
|
|
259
|
+
onConfirm: () => setDeleteOpen(false)
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
export {
|
|
267
|
+
SettingsPage
|
|
268
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// src/patterns/settings-page.meta.ts
|
|
2
|
+
var settingsPageMeta = {
|
|
3
|
+
name: "SettingsPage",
|
|
4
|
+
summary: "Account settings inside the app shell: a sticky SideNav section rail beside a column of section Cards \u2014 a Profile form with the page's one explicit save, Card + CardList + Entity rows with Switches that apply instantly, a read-only payouts summary, account rows, and a delete card confirmed through DestructiveActionModal.",
|
|
5
|
+
intent: "Reach for this for account/profile/workspace settings and any 'edit a handful of grouped preferences' route. Not for a single short form (use AuthPage's centered form shape) or bulk record editing (use DashboardPage + DataTable).",
|
|
6
|
+
notes: [
|
|
7
|
+
"Region cap is `wide`, split on a 12-column track: a 3-column SideNav rail and a 9-column section column. The rail fills the space a lone content-width column would leave empty and gives the page its table of contents.",
|
|
8
|
+
"The rail is `SideNav` (the documented settings sub-nav), sticky, with in-page anchor items; it hides below lg, where the sections simply stack and the shell's BottomNav carries app navigation.",
|
|
9
|
+
"One save model, stated in the copy: drafted text (the Profile form) commits through its single footer save; toggles apply the moment they change, and the Notifications description says so. Never pair a Switch with a Save button.",
|
|
10
|
+
"Settings rows are Card + CardList + Entity with the Switch in `action` \u2014 the row owns its title and one-line description; keep descriptions short, because Entity truncates its subtitle.",
|
|
11
|
+
"Each section is a Card whose CardTitle holds an h2, so the page has a real heading outline under PageHeader's h1; Cards carry the anchor id and `scroll-mt-*` so anchor jumps clear the top edge.",
|
|
12
|
+
"Field wires label/description/error a11y automatically; never hand-roll <label> + <input> pairs. Pair fields side by side with Grid cols={{ base: 1, sm: 2 }}.",
|
|
13
|
+
"The destructive action is last and isolated in its own Card, and it never acts directly: it opens DestructiveActionModal with type-to-confirm on the handle.",
|
|
14
|
+
"Lives in the same AppShell as DashboardPage: Sidebar from lg up, AppHeader + BottomNav below it, with Settings marked active in both."
|
|
15
|
+
],
|
|
16
|
+
a11y: [
|
|
17
|
+
'AppShell provides the skip link and <main id="main-content"> landmark; the active SidebarItem and BottomNavItem carry aria-current.',
|
|
18
|
+
'The section rail is a labelled <nav> ("Settings sections") distinct from the primary navigation; its active item carries aria-current.',
|
|
19
|
+
"Every section has an h2, so screen-reader heading navigation mirrors the rail.",
|
|
20
|
+
"Each Switch takes its row title as aria-label, since the Entity title is not a <label>.",
|
|
21
|
+
"Field auto-wires htmlFor/id, aria-describedby (description + error), aria-invalid, and required.",
|
|
22
|
+
"DestructiveActionModal is an alertdialog: focus opens on Cancel, the backdrop does not dismiss, and the confirm stays disabled until the handle is typed."
|
|
23
|
+
]
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
settingsPageMeta
|
|
27
|
+
};
|
package/dist/presets/index.js
CHANGED
|
@@ -1,187 +1,30 @@
|
|
|
1
|
-
import { SEMANTIC_TOKENS, WORKSPACE_SURFACE_TOKENS, DERIVED_EDGE_TOKENS, RADIUS_TOKENS, MOTION_TOKENS, TYPE_SCALE_TOKENS, TYPE_REFINEMENT_TOKENS, TYPE_OVERLINE_TOKENS, DENSITY_TOKENS, LAYERING_TOKENS, TYPE_UI_TOKENS, ART_TOKENS } from '../chunk-NETUFI34.js';
|
|
2
|
-
|
|
3
|
-
// src/themes/contrast.ts
|
|
4
|
-
function oklchToLinearRgb(L, C, H) {
|
|
5
|
-
const h = H * Math.PI / 180;
|
|
6
|
-
const a = C * Math.cos(h);
|
|
7
|
-
const b = C * Math.sin(h);
|
|
8
|
-
const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;
|
|
9
|
-
const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;
|
|
10
|
-
const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;
|
|
11
|
-
return [
|
|
12
|
-
4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
|
|
13
|
-
-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
|
|
14
|
-
-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s
|
|
15
|
-
];
|
|
16
|
-
}
|
|
17
|
-
function hexToLinearRgb(hex) {
|
|
18
|
-
const m = hex.trim().match(/^#([0-9a-f]{6})$/i);
|
|
19
|
-
if (!m) return null;
|
|
20
|
-
const n = Number.parseInt(m[1], 16);
|
|
21
|
-
const toLinear = (c) => c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
22
|
-
return [
|
|
23
|
-
toLinear((n >> 16 & 255) / 255),
|
|
24
|
-
toLinear((n >> 8 & 255) / 255),
|
|
25
|
-
toLinear((n & 255) / 255)
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
var clamp01 = (x) => Math.min(1, Math.max(0, x));
|
|
29
|
-
function linearToSrgb(c) {
|
|
30
|
-
const v = clamp01(c);
|
|
31
|
-
return v <= 31308e-7 ? 12.92 * v : 1.055 * v ** (1 / 2.4) - 0.055;
|
|
32
|
-
}
|
|
33
|
-
function parseColorWithAlpha(value) {
|
|
34
|
-
const v = value.trim();
|
|
35
|
-
if (v.startsWith("#")) {
|
|
36
|
-
const rgb2 = hexToLinearRgb(v.length === 9 ? v.slice(0, 7) : v);
|
|
37
|
-
if (!rgb2) return null;
|
|
38
|
-
const alpha2 = v.length === 9 ? Number.parseInt(v.slice(7), 16) / 255 : 1;
|
|
39
|
-
return { rgb: rgb2, alpha: Number.isNaN(alpha2) ? 1 : alpha2 };
|
|
40
|
-
}
|
|
41
|
-
const m = v.match(
|
|
42
|
-
/^oklch\(\s*([\d.]+)(%?)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+)(%?))?\s*\)/i
|
|
43
|
-
);
|
|
44
|
-
if (!m) return null;
|
|
45
|
-
const rgb = oklchToLinearRgb(
|
|
46
|
-
m[2] === "%" ? Number(m[1]) / 100 : Number(m[1]),
|
|
47
|
-
Number(m[3]),
|
|
48
|
-
Number(m[4])
|
|
49
|
-
);
|
|
50
|
-
const alpha = m[5] === void 0 ? 1 : m[6] === "%" ? Number(m[5]) / 100 : Number(m[5]);
|
|
51
|
-
return { rgb, alpha };
|
|
52
|
-
}
|
|
53
|
-
function luminance([r, g, b]) {
|
|
54
|
-
return 0.2126 * clamp01(r) + 0.7152 * clamp01(g) + 0.0722 * clamp01(b);
|
|
55
|
-
}
|
|
56
|
-
function contrastRatio(a, b) {
|
|
57
|
-
const [l1, l2] = [luminance(a), luminance(b)];
|
|
58
|
-
return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
|
|
59
|
-
}
|
|
60
|
-
var CONTRAST_FLOOR = 4.5;
|
|
61
|
-
var toSrgb = linearToSrgb;
|
|
62
|
-
function apcaLc(ink, surface) {
|
|
63
|
-
const Y = (rgb) => {
|
|
64
|
-
const [r, g, b] = rgb.map(toSrgb);
|
|
65
|
-
const y = 0.2126729 * r ** 2.4 + 0.7151522 * g ** 2.4 + 0.072175 * b ** 2.4;
|
|
66
|
-
return y < 0.022 ? y + (0.022 - y) ** 1.414 : y;
|
|
67
|
-
};
|
|
68
|
-
const Yt = Y(ink);
|
|
69
|
-
const Yb = Y(surface);
|
|
70
|
-
if (Math.abs(Yb - Yt) < 5e-4) return 0;
|
|
71
|
-
let out;
|
|
72
|
-
if (Yb > Yt) {
|
|
73
|
-
const s = (Yb ** 0.56 - Yt ** 0.57) * 1.14;
|
|
74
|
-
out = s < 0.035 ? 0 : s - 0.027;
|
|
75
|
-
} else {
|
|
76
|
-
const s = (Yb ** 0.65 - Yt ** 0.62) * 1.14;
|
|
77
|
-
out = s > -0.035 ? 0 : s + 0.027;
|
|
78
|
-
}
|
|
79
|
-
return out * 100;
|
|
80
|
-
}
|
|
81
|
-
var PERCEPTUAL_FLOOR = 60;
|
|
82
|
-
var GAMUT_EPSILON = 1e-4;
|
|
83
|
-
function isInSrgbGamut(rgb, epsilon = GAMUT_EPSILON) {
|
|
84
|
-
return rgb.every((c) => c >= -epsilon && c <= 1 + epsilon);
|
|
85
|
-
}
|
|
86
|
-
var linearOf = ({ l, c, h }) => oklchToLinearRgb(l, c, h);
|
|
87
|
-
function maxChromaAt(l, h) {
|
|
88
|
-
if (l <= 0 || l >= 1) return 0;
|
|
89
|
-
let lo = 0;
|
|
90
|
-
let hi = 0.4;
|
|
91
|
-
for (let i = 0; i < 24; i++) {
|
|
92
|
-
const mid = (lo + hi) / 2;
|
|
93
|
-
if (isInSrgbGamut(oklchToLinearRgb(l, mid, h))) lo = mid;
|
|
94
|
-
else hi = mid;
|
|
95
|
-
}
|
|
96
|
-
return lo;
|
|
97
|
-
}
|
|
98
|
-
function labelContrast(ink, fill) {
|
|
99
|
-
const a = linearOf(ink);
|
|
100
|
-
const b = linearOf(fill);
|
|
101
|
-
const ratio = contrastRatio(a, b);
|
|
102
|
-
const lc = apcaLc(a, b);
|
|
103
|
-
return { ratio, lc, reads: ratio >= CONTRAST_FLOOR && Math.abs(lc) >= PERCEPTUAL_FLOOR };
|
|
104
|
-
}
|
|
105
|
-
function inkFor(fill, inks) {
|
|
106
|
-
const rank = (ink) => {
|
|
107
|
-
const v = labelContrast(ink, fill);
|
|
108
|
-
return (v.reads ? 2 : v.ratio >= CONTRAST_FLOOR ? 1 : 0) * 1e3 + Math.abs(v.lc);
|
|
109
|
-
};
|
|
110
|
-
return inks.reduce((best, ink) => rank(ink) > rank(best) ? ink : best);
|
|
111
|
-
}
|
|
112
|
-
var FILL_GAMUT_SAFETY = 0.98;
|
|
113
|
-
function fitFillToInk(fill, ink) {
|
|
114
|
-
if (labelContrast(ink, fill).reads) return fill;
|
|
115
|
-
const step = ink.l > fill.l ? -5e-3 : 5e-3;
|
|
116
|
-
let candidate = fill;
|
|
117
|
-
for (let l = fill.l + step; l > 0.05 && l < 0.98; l += step) {
|
|
118
|
-
candidate = { ...fill, l, c: Math.min(fill.c, maxChromaAt(l, fill.h) * FILL_GAMUT_SAFETY) };
|
|
119
|
-
if (labelContrast(ink, candidate).reads) return candidate;
|
|
120
|
-
}
|
|
121
|
-
return candidate;
|
|
122
|
-
}
|
|
123
|
-
function inkPolarity(color, inks) {
|
|
124
|
-
const cost = (ink) => {
|
|
125
|
-
const fitted = fitFillToInk(color, ink);
|
|
126
|
-
const v = labelContrast(ink, fitted);
|
|
127
|
-
return (v.reads ? 0 : 10) + Math.abs(fitted.l - color.l) - Math.abs(v.lc) / 1e4;
|
|
128
|
-
};
|
|
129
|
-
return inks.reduce((best, ink) => cost(ink) < cost(best) ? ink : best);
|
|
130
|
-
}
|
|
131
|
-
function linearRgbToOklch([r, g, b]) {
|
|
132
|
-
const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
|
|
133
|
-
const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
|
|
134
|
-
const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
|
|
135
|
-
const L = 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;
|
|
136
|
-
const A = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;
|
|
137
|
-
const B = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;
|
|
138
|
-
const c = Math.hypot(A, B);
|
|
139
|
-
return { l: L, c, h: c < 1e-4 ? 0 : (Math.atan2(B, A) * 180 / Math.PI + 360) % 360 };
|
|
140
|
-
}
|
|
141
|
-
var formatOklchColor = ({ l, c, h }) => `oklch(${(l * 100).toFixed(1)}% ${c.toFixed(3)} ${h.toFixed(1)})`;
|
|
142
|
-
var BRAND_FILLS = ["primary", "sidebar-primary", "highlight"];
|
|
143
|
-
var STATUS_FILLS = ["destructive", "success", "tone-warning", "tone-info"];
|
|
144
|
-
var LABELLED_FILLS = [...BRAND_FILLS, ...STATUS_FILLS];
|
|
145
|
-
var LABEL_CONTRAST_RULE = "label-contrast";
|
|
146
|
-
function checkLabelledFills(tokens) {
|
|
147
|
-
const findings = [];
|
|
148
|
-
const unmeasured = [];
|
|
149
|
-
let measured = 0;
|
|
150
|
-
const read = (value) => {
|
|
151
|
-
const parsed = value ? parseColorWithAlpha(value) : null;
|
|
152
|
-
return parsed && parsed.alpha >= 1 ? linearRgbToOklch(parsed.rgb) : null;
|
|
153
|
-
};
|
|
154
|
-
for (const mode of ["light", "dark"]) {
|
|
155
|
-
for (const fill of LABELLED_FILLS) {
|
|
156
|
-
const rawFill = tokens[mode][fill];
|
|
157
|
-
const rawInk = tokens[mode][`${fill}-foreground`];
|
|
158
|
-
if (!rawFill && !rawInk) continue;
|
|
159
|
-
const fillColor = read(rawFill);
|
|
160
|
-
const ink = read(rawInk);
|
|
161
|
-
if (!fillColor || !ink) {
|
|
162
|
-
unmeasured.push(`${mode}.${fill}`);
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
measured++;
|
|
166
|
-
const verdict = labelContrast(ink, fillColor);
|
|
167
|
-
if (verdict.reads) continue;
|
|
168
|
-
const opposite = ink.l > 0.5 ? { l: 0.2, c: 0.03, h: fillColor.h } : { l: 0.985, c: 0.01, h: fillColor.h };
|
|
169
|
-
const reference = read(tokens.light[fill]) ?? fillColor;
|
|
170
|
-
const chosen = inkPolarity(reference, [ink, { ...opposite, h: reference.h }]);
|
|
171
|
-
const nextInk = chosen === ink ? ink : opposite;
|
|
172
|
-
findings.push({
|
|
173
|
-
mode,
|
|
174
|
-
fill,
|
|
175
|
-
ratio: verdict.ratio,
|
|
176
|
-
lc: verdict.lc,
|
|
177
|
-
suggestion: { fill: formatOklchColor(fitFillToInk(fillColor, nextInk)), ink: formatOklchColor(nextInk) }
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return { findings, measured, unmeasured };
|
|
182
|
-
}
|
|
183
|
-
|
|
184
1
|
// src/presets/index.ts
|
|
2
|
+
import {
|
|
3
|
+
SEMANTIC_TOKENS,
|
|
4
|
+
MOTION_TOKENS,
|
|
5
|
+
RADIUS_TOKENS,
|
|
6
|
+
TYPE_SCALE_TOKENS,
|
|
7
|
+
TYPE_REFINEMENT_TOKENS,
|
|
8
|
+
TYPE_OVERLINE_TOKENS,
|
|
9
|
+
DENSITY_TOKENS,
|
|
10
|
+
LAYERING_TOKENS,
|
|
11
|
+
WORKSPACE_SURFACE_TOKENS,
|
|
12
|
+
DERIVED_EDGE_TOKENS,
|
|
13
|
+
TYPE_UI_TOKENS,
|
|
14
|
+
ART_TOKENS
|
|
15
|
+
} from "../themes/_contract.js";
|
|
16
|
+
import { LABEL_CONTRAST_RULE, LABELLED_FILLS, checkLabelledFills } from "../themes/contrast.js";
|
|
17
|
+
import {
|
|
18
|
+
BRAND_FILLS,
|
|
19
|
+
LABEL_CONTRAST_RULE as LABEL_CONTRAST_RULE2,
|
|
20
|
+
LABELLED_FILLS as LABELLED_FILLS2,
|
|
21
|
+
STATUS_FILLS,
|
|
22
|
+
checkLabelledFills as checkLabelledFills2,
|
|
23
|
+
fitFillToInk,
|
|
24
|
+
inkFor,
|
|
25
|
+
inkPolarity,
|
|
26
|
+
labelContrast
|
|
27
|
+
} from "../themes/contrast.js";
|
|
185
28
|
var PRESET_TOKEN_NAMES = [.../* @__PURE__ */ new Set([
|
|
186
29
|
...SEMANTIC_TOKENS,
|
|
187
30
|
...WORKSPACE_SURFACE_TOKENS.map((name) => `theme-${name}`),
|
|
@@ -355,5 +198,20 @@ function presetLabelContrast(input) {
|
|
|
355
198
|
unmeasured
|
|
356
199
|
};
|
|
357
200
|
}
|
|
358
|
-
|
|
359
|
-
|
|
201
|
+
export {
|
|
202
|
+
BRAND_FILLS,
|
|
203
|
+
LABELLED_FILLS2 as LABELLED_FILLS,
|
|
204
|
+
LABEL_CONTRAST_RULE2 as LABEL_CONTRAST_RULE,
|
|
205
|
+
PRESET_TOKEN_NAMES,
|
|
206
|
+
STATUS_FILLS,
|
|
207
|
+
checkLabelledFills2 as checkLabelledFills,
|
|
208
|
+
fitFillToInk,
|
|
209
|
+
inkFor,
|
|
210
|
+
inkPolarity,
|
|
211
|
+
labelContrast,
|
|
212
|
+
parsePreset,
|
|
213
|
+
presetCss,
|
|
214
|
+
presetLabelContrast,
|
|
215
|
+
presetManifest,
|
|
216
|
+
validatePreset
|
|
217
|
+
};
|