@sdxc/ui 2026.10.30 → 2026.11.3
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/README.md +187 -113
- package/dist/app/app-shell-toggle.d.ts +31 -0
- package/dist/app/app-shell-toggle.js +43 -0
- package/dist/app/app-shell.d.ts +131 -0
- package/dist/app/app-shell.js +542 -0
- package/dist/app/auto-refresh.d.ts +104 -0
- package/dist/app/auto-refresh.js +126 -0
- package/dist/{behaviors → app/behaviors}/drag-session.js +1 -1
- package/dist/app/behaviors/refresh-schedule.d.ts +53 -0
- package/dist/app/behaviors/refresh-schedule.js +95 -0
- package/dist/app/behaviors/shortcuts.d.ts +175 -0
- package/dist/app/behaviors/shortcuts.js +401 -0
- package/dist/{behaviors → app/behaviors}/toaster.d.ts +31 -2
- package/dist/{behaviors → app/behaviors}/toaster.js +63 -6
- package/dist/{components → app}/chart.d.ts +63 -9
- package/dist/{components → app}/chart.js +222 -40
- package/dist/app/command-palette.d.ts +132 -0
- package/dist/app/command-palette.js +181 -0
- package/dist/{components → app}/context-menu.d.ts +2 -2
- package/dist/{components → app}/context-menu.js +8 -7
- package/dist/app/danger-zone.d.ts +66 -0
- package/dist/app/danger-zone.js +66 -0
- package/dist/app/detail-sheet.d.ts +119 -0
- package/dist/app/detail-sheet.js +173 -0
- package/dist/{components → app}/drop-indicator.js +3 -3
- package/dist/{components → app}/drop-zone.d.ts +2 -1
- package/dist/{components → app}/drop-zone.js +7 -4
- package/dist/app/editor-layout.d.ts +69 -0
- package/dist/app/editor-layout.js +143 -0
- package/dist/app/empty.d.ts +128 -0
- package/dist/app/empty.js +248 -0
- package/dist/{components → app}/file-trigger.js +2 -2
- package/dist/app/filter-bar.d.ts +169 -0
- package/dist/app/filter-bar.js +346 -0
- package/dist/{components → app}/grid-list.d.ts +1 -1
- package/dist/{components → app}/grid-list.js +16 -18
- package/dist/app/index.d.ts +92 -0
- package/dist/app/index.js +92 -0
- package/dist/app/keyboard-help.d.ts +66 -0
- package/dist/app/keyboard-help.js +56 -0
- package/dist/{components → app}/menubar.js +5 -7
- package/dist/app/mixins/app-shell-controls.d.ts +46 -0
- package/dist/app/mixins/app-shell-controls.js +131 -0
- package/dist/app/mixins/auto-refresh.d.ts +29 -0
- package/dist/app/mixins/auto-refresh.js +66 -0
- package/dist/app/mixins/command-palette.d.ts +56 -0
- package/dist/app/mixins/command-palette.js +297 -0
- package/dist/app/mixins/copy-permalink.d.ts +26 -0
- package/dist/app/mixins/copy-permalink.js +54 -0
- package/dist/app/mixins/detail-sheet-keys.d.ts +28 -0
- package/dist/app/mixins/detail-sheet-keys.js +88 -0
- package/dist/{mixins → app/mixins}/drag-reorder.js +1 -1
- package/dist/{mixins → app/mixins}/drop-zone.js +1 -1
- package/dist/app/mixins/escape-link.d.ts +17 -0
- package/dist/app/mixins/escape-link.js +35 -0
- package/dist/{mixins → app/mixins}/grid-list-keys.js +2 -2
- package/dist/app/mixins/keyboard-help.d.ts +38 -0
- package/dist/app/mixins/keyboard-help.js +51 -0
- package/dist/{mixins → app/mixins}/menubar-keys.js +2 -2
- package/dist/app/mixins/optimistic-toggle-sync.d.ts +80 -0
- package/dist/app/mixins/optimistic-toggle-sync.js +153 -0
- package/dist/app/mixins/range-picker-keys.d.ts +18 -0
- package/dist/app/mixins/range-picker-keys.js +94 -0
- package/dist/{mixins → app/mixins}/resize-handle.js +3 -3
- package/dist/app/mixins/row-navigation.d.ts +85 -0
- package/dist/app/mixins/row-navigation.js +208 -0
- package/dist/app/mixins/save-bar-sync.d.ts +27 -0
- package/dist/app/mixins/save-bar-sync.js +106 -0
- package/dist/app/mixins/save-shortcut.d.ts +47 -0
- package/dist/app/mixins/save-shortcut.js +101 -0
- package/dist/app/mixins/save-status-sync.d.ts +77 -0
- package/dist/app/mixins/save-status-sync.js +159 -0
- package/dist/app/mixins/selection-bar-sync.d.ts +32 -0
- package/dist/app/mixins/selection-bar-sync.js +151 -0
- package/dist/app/mixins/split-view.d.ts +66 -0
- package/dist/app/mixins/split-view.js +319 -0
- package/dist/app/mixins/status-strip-keys.d.ts +17 -0
- package/dist/app/mixins/status-strip-keys.js +79 -0
- package/dist/app/mixins/submit-on-change.d.ts +16 -0
- package/dist/app/mixins/submit-on-change.js +28 -0
- package/dist/app/mixins/table-selection.d.ts +39 -0
- package/dist/app/mixins/table-selection.js +272 -0
- package/dist/app/mixins/toast-queue.d.ts +36 -0
- package/dist/app/mixins/toast-queue.js +77 -0
- package/dist/app/mixins/toast-stack.d.ts +20 -0
- package/dist/app/mixins/toast-stack.js +55 -0
- package/dist/{mixins/treeKeys.js → app/mixins/tree-keys.js} +2 -2
- package/dist/app/optimistic-toggle.d.ts +48 -0
- package/dist/app/optimistic-toggle.js +38 -0
- package/dist/app/page-header.d.ts +71 -0
- package/dist/app/page-header.js +249 -0
- package/dist/app/range-picker.d.ts +102 -0
- package/dist/app/range-picker.js +118 -0
- package/dist/{components → app}/resizable.js +7 -10
- package/dist/app/save-bar.d.ts +54 -0
- package/dist/app/save-bar.js +64 -0
- package/dist/app/save-status.d.ts +50 -0
- package/dist/app/save-status.js +54 -0
- package/dist/app/selection-bar.d.ts +101 -0
- package/dist/app/selection-bar.js +157 -0
- package/dist/app/settings-layout.d.ts +70 -0
- package/dist/app/settings-layout.js +112 -0
- package/dist/app/settings-section.d.ts +140 -0
- package/dist/app/settings-section.js +182 -0
- package/dist/{components → app}/shortcut-list.js +4 -3
- package/dist/app/skeleton.d.ts +79 -0
- package/dist/app/skeleton.js +185 -0
- package/dist/app/sparkline.d.ts +61 -0
- package/dist/app/sparkline.js +145 -0
- package/dist/app/split-view.d.ts +154 -0
- package/dist/app/split-view.js +272 -0
- package/dist/app/stat-card.d.ts +109 -0
- package/dist/app/stat-card.js +379 -0
- package/dist/app/status-strip.d.ts +70 -0
- package/dist/app/status-strip.js +155 -0
- package/dist/app/styles/action-row.d.ts +41 -0
- package/dist/app/styles/action-row.js +59 -0
- package/dist/{styles → app/styles}/chart-palette.d.ts +1 -1
- package/dist/{styles → app/styles}/graphic-host.d.ts +1 -1
- package/dist/{styles → app/styles}/legend-toggle.d.ts +1 -1
- package/dist/app/styles/stat-delta.d.ts +29 -0
- package/dist/app/styles/stat-delta.js +36 -0
- package/dist/app/styles/toast-stack.d.ts +21 -0
- package/dist/app/styles/toast-stack.js +54 -0
- package/dist/app/table.d.ts +327 -0
- package/dist/app/table.js +839 -0
- package/dist/{components → app}/toast.d.ts +105 -5
- package/dist/{components → app}/toast.js +101 -35
- package/dist/app/toasts.d.ts +49 -0
- package/dist/app/toasts.js +103 -0
- package/dist/{components → app}/toolbar.js +3 -3
- package/dist/{components → app}/tree.d.ts +1 -1
- package/dist/{components → app}/tree.js +10 -14
- package/dist/app/utils/app-shell-cookie.d.ts +21 -0
- package/dist/app/utils/app-shell-cookie.js +33 -0
- package/dist/{utils → app/utils}/chart-marker-indices.d.ts +9 -5
- package/dist/{utils → app/utils}/chart-marker-indices.js +9 -8
- package/dist/{utils → app/utils}/chart-path.d.ts +15 -11
- package/dist/{utils → app/utils}/chart-path.js +48 -20
- package/dist/{utils → app/utils}/chart-scale.js +1 -1
- package/dist/app/utils/edited-time.d.ts +19 -0
- package/dist/app/utils/edited-time.js +35 -0
- package/dist/app/utils/key-target.d.ts +23 -0
- package/dist/app/utils/key-target.js +48 -0
- package/dist/app/utils/search-params.d.ts +69 -0
- package/dist/app/utils/search-params.js +132 -0
- package/dist/app/utils/shortcut-groups.d.ts +21 -0
- package/dist/app/utils/shortcut-groups.js +53 -0
- package/dist/app/utils/split-view-layout.d.ts +48 -0
- package/dist/app/utils/split-view-layout.js +71 -0
- package/dist/app/view-options.d.ts +99 -0
- package/dist/app/view-options.js +182 -0
- package/dist/behaviors/index.d.ts +0 -5
- package/dist/behaviors/index.js +0 -5
- package/dist/{components → chat}/attachment.d.ts +1 -1
- package/dist/{components → chat}/attachment.js +17 -23
- package/dist/{behaviors → chat/behaviors}/scroll-follow-model.js +1 -1
- package/dist/{components → chat}/bubble.js +14 -14
- package/dist/chat/index.d.ts +16 -0
- package/dist/chat/index.js +16 -0
- package/dist/{components → chat}/marker.js +6 -8
- package/dist/{components → chat}/message-scroller.d.ts +1 -1
- package/dist/{components → chat}/message-scroller.js +12 -18
- package/dist/{components → chat}/message.js +10 -12
- package/dist/{mixins → chat/mixins}/message-follow.js +2 -2
- package/dist/{components → color}/color-area.js +7 -10
- package/dist/{components → color}/color-field.js +7 -6
- package/dist/{components → color}/color-picker.d.ts +1 -1
- package/dist/{components → color}/color-picker.js +9 -12
- package/dist/{components → color}/color-slider.js +10 -13
- package/dist/{components → color}/color-swatch-picker.js +4 -5
- package/dist/{components → color}/color-swatch.js +3 -4
- package/dist/{components → color}/color-wheel.js +5 -6
- package/dist/color/index.d.ts +21 -0
- package/dist/color/index.js +21 -0
- package/dist/{mixins → color/mixins}/color-area-drag.d.ts +1 -1
- package/dist/{mixins → color/mixins}/color-area-drag.js +2 -2
- package/dist/{mixins → color/mixins}/color-preview.js +1 -1
- package/dist/{mixins → color/mixins}/color-wheel-drag.js +1 -1
- package/dist/{styles → color/styles}/rtl-aware-gradient-direction.d.ts +1 -1
- package/dist/components/accordion.d.ts +3 -3
- package/dist/components/accordion.js +19 -15
- package/dist/components/alert-dialog.js +5 -4
- package/dist/components/alert.js +10 -20
- package/dist/components/aspect-ratio.js +3 -4
- package/dist/components/avatar.d.ts +6 -6
- package/dist/components/avatar.js +56 -8
- package/dist/components/badge.js +11 -9
- package/dist/components/banner.d.ts +61 -0
- package/dist/components/banner.js +101 -0
- package/dist/components/breadcrumbs.js +7 -9
- package/dist/components/button.d.ts +8 -6
- package/dist/components/button.js +22 -14
- package/dist/components/calendar.js +13 -24
- package/dist/components/card.js +9 -11
- package/dist/components/carousel.d.ts +1 -1
- package/dist/components/carousel.js +12 -20
- package/dist/components/checkbox-group.js +3 -3
- package/dist/components/checkbox.js +2 -2
- package/dist/components/combobox.js +6 -6
- package/dist/components/command.js +10 -14
- package/dist/components/confirm.d.ts +54 -5
- package/dist/components/confirm.js +44 -5
- package/dist/components/cta-group.d.ts +30 -14
- package/dist/components/cta-group.js +29 -10
- package/dist/components/date-field.js +2 -1
- package/dist/components/date-picker.js +4 -5
- package/dist/components/date-range-picker.js +3 -2
- package/dist/components/description.js +2 -1
- package/dist/components/dialog-dismiss.d.ts +18 -0
- package/dist/components/dialog-dismiss.js +15 -0
- package/dist/components/dialog.js +11 -15
- package/dist/components/disclosure.js +10 -14
- package/dist/components/drawer.js +3 -4
- package/dist/components/field-error.js +3 -3
- package/dist/components/form.js +2 -1
- package/dist/components/group.d.ts +14 -0
- package/dist/components/group.js +68 -13
- package/dist/components/header.js +3 -3
- package/dist/components/heading-scope.js +2 -1
- package/dist/components/heading.d.ts +4 -4
- package/dist/components/heading.js +7 -7
- package/dist/components/highlight.js +17 -12
- package/dist/components/hover-card.js +6 -8
- package/dist/components/image-placeholder.js +13 -19
- package/dist/components/index.d.ts +11 -38
- package/dist/components/index.js +11 -38
- package/dist/components/input.js +12 -7
- package/dist/components/item.js +10 -19
- package/dist/components/keyboard.js +3 -3
- package/dist/components/label.js +2 -1
- package/dist/components/link-button.d.ts +7 -5
- package/dist/components/link-button.js +24 -13
- package/dist/components/link.js +3 -4
- package/dist/components/listbox.js +6 -11
- package/dist/components/menu.js +5 -6
- package/dist/components/meter.js +5 -6
- package/dist/components/modal.js +9 -11
- package/dist/components/nav-link.d.ts +1 -1
- package/dist/components/nav-link.js +3 -4
- package/dist/components/navigation-menu.js +17 -23
- package/dist/components/number-field.js +8 -10
- package/dist/components/otp-field.js +2 -1
- package/dist/components/overlay-arrow.js +3 -4
- package/dist/components/pagination.js +8 -10
- package/dist/components/popover.js +3 -4
- package/dist/components/progress-bar.js +5 -5
- package/dist/components/property-list.d.ts +76 -0
- package/dist/components/property-list.js +175 -0
- package/dist/components/radio-group.js +5 -7
- package/dist/components/range-calendar.js +3 -3
- package/dist/components/relative-time.d.ts +72 -0
- package/dist/components/relative-time.js +45 -0
- package/dist/components/scroll-area.js +4 -5
- package/dist/components/search-field.js +8 -11
- package/dist/components/section.js +2 -1
- package/dist/components/select.js +10 -22
- package/dist/components/selection-indicator.js +3 -3
- package/dist/components/sentinel-row.js +3 -3
- package/dist/components/separator.js +3 -3
- package/dist/components/shared-element.js +2 -1
- package/dist/components/sheet.js +6 -7
- package/dist/components/sidebar.js +48 -76
- package/dist/components/slider.js +8 -10
- package/dist/components/spinner.js +3 -3
- package/dist/components/status-dot.d.ts +62 -0
- package/dist/components/status-dot.js +99 -0
- package/dist/components/switch.js +3 -3
- package/dist/components/tabs.js +9 -12
- package/dist/components/tag-group.js +7 -9
- package/dist/components/text-field.d.ts +17 -2
- package/dist/components/text-field.js +14 -4
- package/dist/components/text.js +2 -1
- package/dist/components/textarea.js +3 -4
- package/dist/components/time-field.js +2 -1
- package/dist/components/timeline.d.ts +67 -0
- package/dist/components/timeline.js +159 -0
- package/dist/components/toggle-button.js +5 -7
- package/dist/components/tooltip.js +3 -3
- package/dist/components/typeset.d.ts +2 -1
- package/dist/components/typeset.js +131 -123
- package/dist/components/youtube-embed.js +2 -1
- package/dist/docs/anchor-heading.d.ts +41 -0
- package/dist/docs/anchor-heading.js +62 -0
- package/dist/docs/callout.d.ts +46 -0
- package/dist/docs/callout.js +61 -0
- package/dist/docs/code-block.d.ts +74 -0
- package/dist/docs/code-block.js +322 -0
- package/dist/docs/code-tabs-sync.d.ts +26 -0
- package/dist/docs/code-tabs-sync.js +12 -0
- package/dist/docs/code-tabs.d.ts +53 -0
- package/dist/docs/code-tabs.js +102 -0
- package/dist/docs/copy-button.d.ts +31 -0
- package/dist/docs/copy-button.js +49 -0
- package/dist/docs/docs-feedback.d.ts +67 -0
- package/dist/docs/docs-feedback.js +74 -0
- package/dist/docs/docs-footer.d.ts +40 -0
- package/dist/docs/docs-footer.js +45 -0
- package/dist/docs/docs-hub.d.ts +93 -0
- package/dist/docs/docs-hub.js +142 -0
- package/dist/docs/docs-layout.d.ts +90 -0
- package/dist/docs/docs-layout.js +166 -0
- package/dist/docs/docs-nav-tools.d.ts +25 -0
- package/dist/docs/docs-nav-tools.js +14 -0
- package/dist/docs/docs-nav.d.ts +57 -0
- package/dist/docs/docs-nav.js +76 -0
- package/dist/docs/docs-not-found.d.ts +68 -0
- package/dist/docs/docs-not-found.js +100 -0
- package/dist/docs/docs-page-header.d.ts +55 -0
- package/dist/docs/docs-page-header.js +54 -0
- package/dist/docs/docs-pager.d.ts +50 -0
- package/dist/docs/docs-pager.js +75 -0
- package/dist/docs/file-tree.d.ts +57 -0
- package/dist/docs/file-tree.js +142 -0
- package/dist/docs/index.d.ts +38 -0
- package/dist/docs/index.js +38 -0
- package/dist/docs/install-command.d.ts +54 -0
- package/dist/docs/install-command.js +33 -0
- package/dist/docs/mixins/code-tabs-sync.d.ts +47 -0
- package/dist/docs/mixins/code-tabs-sync.js +137 -0
- package/dist/docs/mixins/copy-feedback.d.ts +25 -0
- package/dist/docs/mixins/copy-feedback.js +49 -0
- package/dist/docs/mixins/copy-from-url.d.ts +27 -0
- package/dist/docs/mixins/copy-from-url.js +95 -0
- package/dist/docs/mixins/docs-nav-tools.d.ts +27 -0
- package/dist/docs/mixins/docs-nav-tools.js +124 -0
- package/dist/docs/mixins/toc-spy.d.ts +30 -0
- package/dist/docs/mixins/toc-spy.js +165 -0
- package/dist/docs/next-steps.d.ts +45 -0
- package/dist/docs/next-steps.js +80 -0
- package/dist/docs/page-actions.d.ts +77 -0
- package/dist/docs/page-actions.js +78 -0
- package/dist/docs/plan-notice.d.ts +28 -0
- package/dist/docs/plan-notice.js +33 -0
- package/dist/docs/props-table.d.ts +64 -0
- package/dist/docs/props-table.js +147 -0
- package/dist/docs/steps.d.ts +51 -0
- package/dist/docs/steps.js +112 -0
- package/dist/docs/table-of-contents.d.ts +49 -0
- package/dist/docs/table-of-contents.js +139 -0
- package/dist/docs/ui-label.d.ts +51 -0
- package/dist/docs/ui-label.js +64 -0
- package/dist/docs/utils/docs-tree.d.ts +81 -0
- package/dist/docs/utils/docs-tree.js +57 -0
- package/dist/docs/utils/reveal-in-scroller.d.ts +19 -0
- package/dist/docs/utils/reveal-in-scroller.js +43 -0
- package/dist/landing/accent-text.d.ts +47 -0
- package/dist/landing/accent-text.js +107 -0
- package/dist/landing/animations/entrance.d.ts +40 -0
- package/dist/landing/animations/entrance.js +52 -0
- package/dist/landing/announcement-chip.d.ts +45 -0
- package/dist/landing/announcement-chip.js +36 -0
- package/dist/landing/author-band.d.ts +78 -0
- package/dist/landing/author-band.js +190 -0
- package/dist/landing/bento.d.ts +99 -0
- package/dist/landing/bento.js +138 -0
- package/dist/landing/changelog-strip.d.ts +74 -0
- package/dist/landing/changelog-strip.js +201 -0
- package/dist/{patterns → landing}/check-row.js +5 -7
- package/dist/{patterns → landing}/closing-cta.d.ts +4 -4
- package/dist/{patterns → landing}/closing-cta.js +8 -8
- package/dist/landing/code-stage.d.ts +93 -0
- package/dist/landing/code-stage.js +434 -0
- package/dist/landing/crosshair.d.ts +44 -0
- package/dist/landing/crosshair.js +48 -0
- package/dist/landing/curriculum.d.ts +79 -0
- package/dist/landing/curriculum.js +194 -0
- package/dist/landing/drawn-chart.d.ts +74 -0
- package/dist/landing/drawn-chart.js +377 -0
- package/dist/landing/event-ticker.d.ts +71 -0
- package/dist/landing/event-ticker.js +331 -0
- package/dist/landing/fan-out-diagram.d.ts +70 -0
- package/dist/landing/fan-out-diagram.js +481 -0
- package/dist/{patterns → landing}/faq-band.d.ts +5 -5
- package/dist/{patterns → landing}/faq-band.js +13 -14
- package/dist/landing/feature-band.d.ts +108 -0
- package/dist/landing/feature-band.js +67 -0
- package/dist/landing/feature.d.ts +148 -0
- package/dist/landing/feature.js +219 -0
- package/dist/landing/flow-diagram.d.ts +62 -0
- package/dist/landing/flow-diagram.js +240 -0
- package/dist/{patterns → landing}/icon-well.d.ts +17 -7
- package/dist/landing/icon-well.js +31 -0
- package/dist/landing/index.d.ts +52 -0
- package/dist/landing/index.js +52 -0
- package/dist/{patterns → landing}/install-tabs.js +4 -5
- package/dist/landing/landing-header.d.ts +103 -0
- package/dist/landing/landing-header.js +110 -0
- package/dist/landing/landing-hero.d.ts +119 -0
- package/dist/landing/landing-hero.js +172 -0
- package/dist/{components/marketing-section.d.ts → landing/landing-section.d.ts} +38 -15
- package/dist/landing/landing-section.js +183 -0
- package/dist/landing/logo-cloud.d.ts +56 -0
- package/dist/landing/logo-cloud.js +160 -0
- package/dist/landing/logo-sentence.d.ts +38 -0
- package/dist/landing/logo-sentence.js +51 -0
- package/dist/landing/marquee.d.ts +44 -0
- package/dist/landing/marquee.js +97 -0
- package/dist/landing/motion-loop.d.ts +43 -0
- package/dist/landing/motion-loop.js +42 -0
- package/dist/landing/pricing-band.d.ts +94 -0
- package/dist/landing/pricing-band.js +151 -0
- package/dist/landing/product-frame.d.ts +108 -0
- package/dist/landing/product-frame.js +202 -0
- package/dist/{patterns → landing}/proof-strip.d.ts +4 -4
- package/dist/{patterns → landing}/proof-strip.js +3 -3
- package/dist/landing/rails.d.ts +45 -0
- package/dist/landing/rails.js +69 -0
- package/dist/landing/rotating-text.d.ts +44 -0
- package/dist/landing/rotating-text.js +67 -0
- package/dist/landing/segmented-stage.d.ts +75 -0
- package/dist/landing/segmented-stage.js +141 -0
- package/dist/landing/sequence-diagram.d.ts +65 -0
- package/dist/landing/sequence-diagram.js +348 -0
- package/dist/landing/site-footer.d.ts +100 -0
- package/dist/landing/site-footer.js +274 -0
- package/dist/landing/site-header.d.ts +126 -0
- package/dist/landing/site-header.js +595 -0
- package/dist/{components → landing}/split.d.ts +12 -5
- package/dist/{components → landing}/split.js +26 -18
- package/dist/landing/sponsor-wall.d.ts +81 -0
- package/dist/landing/sponsor-wall.js +241 -0
- package/dist/{components → landing}/stat-strip.d.ts +31 -7
- package/dist/landing/stat-strip.js +105 -0
- package/dist/landing/step-list.d.ts +73 -0
- package/dist/landing/step-list.js +182 -0
- package/dist/landing/styles/card-grid.d.ts +115 -0
- package/dist/landing/styles/card-grid.js +295 -0
- package/dist/{patterns → landing}/tabbed-stage.d.ts +26 -8
- package/dist/landing/tabbed-stage.js +233 -0
- package/dist/landing/testimonial-band.d.ts +110 -0
- package/dist/landing/testimonial-band.js +164 -0
- package/dist/landing/typed-terminal.d.ts +62 -0
- package/dist/landing/typed-terminal.js +233 -0
- package/dist/landing/utils/pause-toggle.d.ts +37 -0
- package/dist/landing/utils/pause-toggle.js +71 -0
- package/dist/mixins/confirm-phrase.d.ts +19 -0
- package/dist/mixins/confirm-phrase.js +56 -0
- package/dist/mixins/copy-to-clipboard.d.ts +6 -0
- package/dist/mixins/copy-to-clipboard.js +17 -1
- package/dist/mixins/dialog-dismiss.d.ts +21 -0
- package/dist/mixins/dialog-dismiss.js +62 -0
- package/dist/mixins/index.d.ts +4 -15
- package/dist/mixins/index.js +4 -15
- package/dist/mixins/viewer-time.d.ts +20 -0
- package/dist/mixins/viewer-time.js +40 -0
- package/dist/styles/index.d.ts +3 -5
- package/dist/styles/index.js +3 -5
- package/dist/styles/landing.d.ts +200 -0
- package/dist/styles/landing.js +516 -0
- package/dist/styles/segmented-control.d.ts +49 -0
- package/dist/styles/segmented-control.js +71 -0
- package/dist/styles/surface-control.d.ts +18 -0
- package/dist/styles/surface-control.js +31 -0
- package/dist/test/table.d.ts +65 -0
- package/dist/test/table.js +108 -0
- package/dist/utils/eyebrow.d.ts +39 -0
- package/dist/utils/eyebrow.js +21 -0
- package/dist/utils/index.d.ts +2 -5
- package/dist/utils/index.js +2 -5
- package/dist/utils/relative-time.d.ts +44 -0
- package/dist/utils/relative-time.js +69 -0
- package/package.json +16 -6
- package/src/theme.css +87 -22
- package/dist/components/empty.d.ts +0 -91
- package/dist/components/empty.js +0 -151
- package/dist/components/feature.d.ts +0 -102
- package/dist/components/feature.js +0 -150
- package/dist/components/logo-cloud.d.ts +0 -42
- package/dist/components/logo-cloud.js +0 -41
- package/dist/components/marketing-header.d.ts +0 -71
- package/dist/components/marketing-header.js +0 -81
- package/dist/components/marketing-section.js +0 -117
- package/dist/components/skeleton.d.ts +0 -36
- package/dist/components/skeleton.js +0 -38
- package/dist/components/stat-strip.js +0 -65
- package/dist/components/table.d.ts +0 -152
- package/dist/components/table.js +0 -238
- package/dist/patterns/accent-text.d.ts +0 -30
- package/dist/patterns/accent-text.js +0 -17
- package/dist/patterns/announcement-chip.d.ts +0 -41
- package/dist/patterns/announcement-chip.js +0 -49
- package/dist/patterns/bento.d.ts +0 -68
- package/dist/patterns/bento.js +0 -94
- package/dist/patterns/code-stage.d.ts +0 -63
- package/dist/patterns/code-stage.js +0 -82
- package/dist/patterns/feature-band.d.ts +0 -85
- package/dist/patterns/feature-band.js +0 -50
- package/dist/patterns/icon-well.js +0 -38
- package/dist/patterns/index.d.ts +0 -23
- package/dist/patterns/index.js +0 -23
- package/dist/patterns/landing-hero.d.ts +0 -93
- package/dist/patterns/landing-hero.js +0 -126
- package/dist/patterns/product-frame.d.ts +0 -60
- package/dist/patterns/product-frame.js +0 -70
- package/dist/patterns/step-list.d.ts +0 -47
- package/dist/patterns/step-list.js +0 -85
- package/dist/patterns/tabbed-stage.js +0 -77
- package/dist/styles/marketing.d.ts +0 -120
- package/dist/styles/marketing.js +0 -225
- package/dist/utils/semantic-color-panel.d.ts +0 -35
- package/dist/utils/semantic-color-panel.js +0 -28
- /package/dist/{behaviors → app/behaviors}/drag-session.d.ts +0 -0
- /package/dist/{behaviors → app/behaviors}/resize-session.d.ts +0 -0
- /package/dist/{behaviors → app/behaviors}/resize-session.js +0 -0
- /package/dist/{behaviors → app/behaviors}/selection-model.d.ts +0 -0
- /package/dist/{behaviors → app/behaviors}/selection-model.js +0 -0
- /package/dist/{components → app}/drop-indicator.d.ts +0 -0
- /package/dist/{components → app}/file-trigger.d.ts +0 -0
- /package/dist/{components → app}/menubar.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/chart-tooltip.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/chart-tooltip.js +0 -0
- /package/dist/{mixins → app/mixins}/context-menu.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/context-menu.js +0 -0
- /package/dist/{mixins → app/mixins}/drag-reorder.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/drop-zone.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/grid-list-keys.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/menubar-keys.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/resize-handle.d.ts +0 -0
- /package/dist/{mixins/treeKeys.d.ts → app/mixins/tree-keys.d.ts} +0 -0
- /package/dist/{components → app}/resizable.d.ts +0 -0
- /package/dist/{components → app}/shortcut-list.d.ts +0 -0
- /package/dist/{styles → app/styles}/chart-palette.js +0 -0
- /package/dist/{styles → app/styles}/graphic-host.js +0 -0
- /package/dist/{styles → app/styles}/legend-toggle.js +0 -0
- /package/dist/{components → app}/toolbar.d.ts +0 -0
- /package/dist/{utils → app/utils}/chart-scale.d.ts +0 -0
- /package/dist/{behaviors → chat/behaviors}/scroll-follow-model.d.ts +0 -0
- /package/dist/{components → chat}/bubble.d.ts +0 -0
- /package/dist/{components → chat}/marker.d.ts +0 -0
- /package/dist/{components → chat}/message.d.ts +0 -0
- /package/dist/{mixins → chat/mixins}/attachment-trigger.d.ts +0 -0
- /package/dist/{mixins → chat/mixins}/attachment-trigger.js +0 -0
- /package/dist/{mixins → chat/mixins}/message-follow.d.ts +0 -0
- /package/dist/{components → color}/color-area.d.ts +0 -0
- /package/dist/{components → color}/color-field.d.ts +0 -0
- /package/dist/{components → color}/color-slider.d.ts +0 -0
- /package/dist/{components → color}/color-swatch-picker.d.ts +0 -0
- /package/dist/{components → color}/color-swatch.d.ts +0 -0
- /package/dist/{components → color}/color-wheel.d.ts +0 -0
- /package/dist/{mixins → color/mixins}/color-channel-sync.d.ts +0 -0
- /package/dist/{mixins → color/mixins}/color-channel-sync.js +0 -0
- /package/dist/{mixins → color/mixins}/color-preview.d.ts +0 -0
- /package/dist/{mixins → color/mixins}/color-wheel-drag.d.ts +0 -0
- /package/dist/{styles → color/styles}/rtl-aware-gradient-direction.js +0 -0
- /package/dist/{utils → color/utils}/hue-spectrum.d.ts +0 -0
- /package/dist/{utils → color/utils}/hue-spectrum.js +0 -0
- /package/dist/{patterns → landing}/check-row.d.ts +0 -0
- /package/dist/{patterns → landing}/install-tabs.d.ts +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "remix/component/jsx-runtime";
|
|
2
|
+
import { ChevronRightIcon } from "@sdxc/icons";
|
|
3
|
+
import { combine, raw, mergeMix } from "@sdxc/u/general";
|
|
4
|
+
import { container, vstack } from "@sdxc/u/layout";
|
|
5
|
+
import { at, motionSafe } from "@sdxc/u/responsive";
|
|
6
|
+
import { when } from "@sdxc/u/state";
|
|
7
|
+
import { Badge } from "../components/badge.js";
|
|
8
|
+
import { HeadingScope, resolveHeadingLevel, TAG_BY_LEVEL } from "../components/heading-scope.js";
|
|
9
|
+
/** Container the parts' column step queries. */
|
|
10
|
+
const CONTAINER = "ui-landing-curriculum";
|
|
11
|
+
/** Translucent line between lessons. */
|
|
12
|
+
const HAIRLINE = "var(--ui-landing-hairline, color-mix(in oklch, CanvasText 8%, transparent))";
|
|
13
|
+
/** Arrangement {@link Curriculum} applies when `layout` is omitted. */
|
|
14
|
+
const DEFAULT_LAYOUT = "columns";
|
|
15
|
+
/** Width of the chevron track at a lesson row's inline start. */
|
|
16
|
+
const CHEVRON_TRACK = "1rem";
|
|
17
|
+
/** Width of the lesson-number track, wide enough for three mono digits. */
|
|
18
|
+
const NUMBER_TRACK = "2rem";
|
|
19
|
+
/** Gap between a lesson row's tracks. */
|
|
20
|
+
const TRACK_GAP = "0.75rem";
|
|
21
|
+
/** How far a lesson's body is indented, so it starts under the title. */
|
|
22
|
+
const BODY_INDENT = `calc(${CHEVRON_TRACK} + ${NUMBER_TRACK} + 2 * ${TRACK_GAP})`;
|
|
23
|
+
/**
|
|
24
|
+
* Lays the optional summary over the parts, and opens a heading scope so part titles sit
|
|
25
|
+
* one level under the band's title.
|
|
26
|
+
*
|
|
27
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
28
|
+
* @returns The render function producing the curriculum's markup.
|
|
29
|
+
* @example
|
|
30
|
+
* <Curriculum summary={<StatStrip>{totals}</StatStrip>}>
|
|
31
|
+
* <Curriculum.Part title={t("part.one")} meta="5 chapters · 112 pages">
|
|
32
|
+
* <Curriculum.Lesson number="01" title={t("ch.one")} meta="18 pages" badge="Free" />
|
|
33
|
+
* </Curriculum.Part>
|
|
34
|
+
* </Curriculum>
|
|
35
|
+
*/
|
|
36
|
+
export function Curriculum(handle) {
|
|
37
|
+
return () => {
|
|
38
|
+
let { children, layout, mix, summary, ...rest } = handle.props;
|
|
39
|
+
let resolvedLayout = layout ?? DEFAULT_LAYOUT;
|
|
40
|
+
return (_jsxs("div", { ...rest, "data-slot": "curriculum", "data-layout": resolvedLayout, mix: mergeMix([
|
|
41
|
+
container(CONTAINER),
|
|
42
|
+
vstack({ gap: 10, align: "stretch" }),
|
|
43
|
+
raw({ inlineSize: "100%" }),
|
|
44
|
+
], mix), children: [summary ? _jsx("div", { "data-slot": "curriculum-summary", children: summary }) : null, _jsx(HeadingScope, { children: _jsx("div", { "data-slot": "curriculum-parts", mix: [parts(resolvedLayout)], children: children }) })] }));
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The parts' grid in one rule: one column, then, for `columns`, every part in one row of
|
|
49
|
+
* equal tracks from the `lg` container whatever their count.
|
|
50
|
+
*/
|
|
51
|
+
function parts(layout) {
|
|
52
|
+
return combine([
|
|
53
|
+
raw({
|
|
54
|
+
display: "grid",
|
|
55
|
+
gridTemplateColumns: "minmax(0, 1fr)",
|
|
56
|
+
alignItems: "start",
|
|
57
|
+
rowGap: "3rem",
|
|
58
|
+
columnGap: "2.5rem",
|
|
59
|
+
}),
|
|
60
|
+
layout === "columns"
|
|
61
|
+
? at("lg", CONTAINER, raw({
|
|
62
|
+
gridTemplateColumns: "none",
|
|
63
|
+
gridAutoFlow: "column",
|
|
64
|
+
gridAutoColumns: "minmax(0, 1fr)",
|
|
65
|
+
}))
|
|
66
|
+
: [],
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* One part: its title and totals over a ruled list of lessons.
|
|
71
|
+
*
|
|
72
|
+
* @param handle Runtime handle carrying the host `<section>`'s props.
|
|
73
|
+
* @returns The render function producing the part's markup.
|
|
74
|
+
* @example
|
|
75
|
+
* <Curriculum.Part title="Foundations" meta="4 chapters · 86 pages">{lessons}</Curriculum.Part>
|
|
76
|
+
*/
|
|
77
|
+
Curriculum.Part = function CurriculumPart(handle) {
|
|
78
|
+
return () => {
|
|
79
|
+
let { children, meta, mix, title, ...rest } = handle.props;
|
|
80
|
+
let Tag = TAG_BY_LEVEL[resolveHeadingLevel(handle)];
|
|
81
|
+
return (_jsxs("section", { ...rest, "data-slot": "curriculum-part", mix: mergeMix([vstack({ gap: 4, align: "stretch" }), raw({ minInlineSize: "0" })], mix), children: [_jsxs("header", { mix: [vstack({ gap: 1, align: "start" })], children: [_jsx(Tag, { "data-slot": "curriculum-part-title", mix: [
|
|
82
|
+
raw({
|
|
83
|
+
margin: "0",
|
|
84
|
+
fontSize: "var(--ui-text-xl, 1.25rem)",
|
|
85
|
+
lineHeight: "1.75rem",
|
|
86
|
+
fontWeight: "600",
|
|
87
|
+
letterSpacing: "-0.01em",
|
|
88
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
89
|
+
textWrap: "balance",
|
|
90
|
+
}),
|
|
91
|
+
], children: title }), meta ? (_jsx("p", { "data-slot": "curriculum-part-meta", mix: [monoMeta(), raw({ margin: "0" })], children: meta })) : null] }), _jsx("ol", { "data-slot": "curriculum-lessons", mix: [lessonList()], children: children })] }));
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
/** Mono, muted, tabular small print shared by part totals, lesson numbers and lesson meta. */
|
|
95
|
+
function monoMeta() {
|
|
96
|
+
return raw({
|
|
97
|
+
fontFamily: "var(--ui-font-mono, ui-monospace, monospace)",
|
|
98
|
+
fontSize: "var(--ui-text-sm, 0.875rem)",
|
|
99
|
+
lineHeight: "1.5rem",
|
|
100
|
+
fontVariantNumeric: "tabular-nums",
|
|
101
|
+
color: "var(--ui-neutral-fg-muted)",
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/** The lesson list: unstyled, with a hairline above every row and under the last. */
|
|
105
|
+
function lessonList() {
|
|
106
|
+
return combine([
|
|
107
|
+
raw({ listStyle: "none", margin: "0", padding: "0" }),
|
|
108
|
+
when("& > li", raw({ borderBlockStart: `1px solid ${HAIRLINE}` })),
|
|
109
|
+
when("& > li:last-child", raw({ borderBlockEnd: `1px solid ${HAIRLINE}` })),
|
|
110
|
+
]);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The summary row in one rule: chevron, number, title (with its badge) and meta tracks on a
|
|
114
|
+
* shared first baseline, at least 44px tall, so the meta stays at the inline end however
|
|
115
|
+
* far the title wraps. Only an expandable row takes the pointer cursor and hover underline.
|
|
116
|
+
*/
|
|
117
|
+
function lessonSummary(expandable) {
|
|
118
|
+
return combine([
|
|
119
|
+
raw({
|
|
120
|
+
display: "grid",
|
|
121
|
+
gridTemplateColumns: `${CHEVRON_TRACK} ${NUMBER_TRACK} minmax(0, 1fr) auto`,
|
|
122
|
+
columnGap: TRACK_GAP,
|
|
123
|
+
alignItems: "baseline",
|
|
124
|
+
minBlockSize: "2.75rem",
|
|
125
|
+
boxSizing: "border-box",
|
|
126
|
+
paddingBlock: "0.625rem",
|
|
127
|
+
cursor: expandable ? "pointer" : "default",
|
|
128
|
+
listStyle: "none",
|
|
129
|
+
outlineOffset: "2px",
|
|
130
|
+
}),
|
|
131
|
+
when("&::-webkit-details-marker", raw({ display: "none" })),
|
|
132
|
+
when("&::marker", raw({ content: '""' })),
|
|
133
|
+
when('& > [data-slot="curriculum-lesson-chevron"]', raw({
|
|
134
|
+
alignSelf: "start",
|
|
135
|
+
display: "grid",
|
|
136
|
+
placeItems: "center",
|
|
137
|
+
blockSize: "1.5rem",
|
|
138
|
+
color: "var(--ui-neutral-fg-muted)",
|
|
139
|
+
})),
|
|
140
|
+
when('& > [data-slot="curriculum-lesson-chevron"] > svg', raw({ inlineSize: "1rem", blockSize: "1rem" })),
|
|
141
|
+
when('& > [data-slot="curriculum-lesson-chevron"] > svg', motionSafe(raw({ transition: "rotate 200ms" }))),
|
|
142
|
+
expandable
|
|
143
|
+
? when('&:hover > [data-slot="curriculum-lesson-title"]', raw({
|
|
144
|
+
textDecoration: "underline",
|
|
145
|
+
textUnderlineOffset: "0.2em",
|
|
146
|
+
textDecorationThickness: "1px",
|
|
147
|
+
}))
|
|
148
|
+
: [],
|
|
149
|
+
]);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* One lesson as a native disclosure row: the summary shows the chevron, number, title,
|
|
153
|
+
* badge and meta; the children open under the title and the chevron turns while open.
|
|
154
|
+
*
|
|
155
|
+
* @param handle Runtime handle carrying the host `<li>`'s props.
|
|
156
|
+
* @returns The render function producing the lesson's list item.
|
|
157
|
+
* @example
|
|
158
|
+
* <Curriculum.Lesson number="03" title={t("ch.measure")} meta="22 pages" badge="Preview">
|
|
159
|
+
* <CheckList>{subtopics}</CheckList>
|
|
160
|
+
* </Curriculum.Lesson>
|
|
161
|
+
*/
|
|
162
|
+
Curriculum.Lesson = function CurriculumLesson(handle) {
|
|
163
|
+
return () => {
|
|
164
|
+
let { badge, children, meta, mix, number, open, title, ...rest } = handle.props;
|
|
165
|
+
let row = (_jsxs(_Fragment, { children: [_jsx("span", { "data-slot": "curriculum-lesson-chevron", "aria-hidden": "true", children: children ? _jsx(ChevronRightIcon, {}) : null }), _jsx("span", { "data-slot": "curriculum-lesson-number", mix: [monoMeta()], children: number }), _jsxs("span", { "data-slot": "curriculum-lesson-title", mix: [
|
|
166
|
+
raw({
|
|
167
|
+
fontSize: "var(--ui-text-base, 1rem)",
|
|
168
|
+
lineHeight: "1.5rem",
|
|
169
|
+
fontWeight: "500",
|
|
170
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
171
|
+
textWrap: "pretty",
|
|
172
|
+
overflowWrap: "anywhere",
|
|
173
|
+
}),
|
|
174
|
+
], children: [title, badge ? (_jsx(Badge, { variant: "secondary", color: "brand", "data-slot": "curriculum-lesson-badge", mix: [raw({ marginInlineStart: "0.5rem", verticalAlign: "0.0625rem" })], children: badge })) : null] }), _jsx("span", { "data-slot": "curriculum-lesson-meta", mix: [monoMeta(), raw({ textAlign: "end", whiteSpace: "nowrap" })], children: meta })] }));
|
|
175
|
+
if (!children) {
|
|
176
|
+
return (_jsx("li", { ...rest, "data-slot": "curriculum-lesson", mix: mix, children: _jsx("div", { "data-slot": "curriculum-lesson-row", mix: [lessonSummary(false)], children: row }) }));
|
|
177
|
+
}
|
|
178
|
+
return (_jsx("li", { ...rest, "data-slot": "curriculum-lesson", mix: mix, children: _jsxs("details", { open: open, mix: [
|
|
179
|
+
when('&[open] > summary > [data-slot="curriculum-lesson-chevron"] > svg', raw({ rotate: "90deg" })),
|
|
180
|
+
], children: [_jsx("summary", { "data-slot": "curriculum-lesson-row", mix: [lessonSummary(true)], children: row }), _jsx("div", { "data-slot": "curriculum-lesson-body", mix: [
|
|
181
|
+
raw({
|
|
182
|
+
display: "flex",
|
|
183
|
+
flexDirection: "column",
|
|
184
|
+
alignItems: "stretch",
|
|
185
|
+
gap: "0.75rem",
|
|
186
|
+
paddingInlineStart: BODY_INDENT,
|
|
187
|
+
paddingBlockEnd: "1rem",
|
|
188
|
+
fontSize: "var(--ui-text-sm, 0.875rem)",
|
|
189
|
+
lineHeight: "1.5rem",
|
|
190
|
+
color: "var(--ui-neutral-fg)",
|
|
191
|
+
}),
|
|
192
|
+
], children: children })] }) }));
|
|
193
|
+
};
|
|
194
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An animated figure for a measured claim: a headline number counts up from zero and a
|
|
3
|
+
* bar or line chart draws in beside it, holds, then loops. It shows the measurement itself,
|
|
4
|
+
* such as how often feeds are really checked or a month of response times.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
10
|
+
/**
|
|
11
|
+
* Prop types for {@link DrawnChart}.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace DrawnChart {
|
|
14
|
+
/** How the chart draws its series. */
|
|
15
|
+
type Variant = "bars" | "line";
|
|
16
|
+
/** The headline number above the chart. */
|
|
17
|
+
interface Metric {
|
|
18
|
+
/** The measured value; an integer counts up from zero, any other number shows as is. */
|
|
19
|
+
value: number;
|
|
20
|
+
/** Number formatting, such as `{ maximumFractionDigits: 1 }`; also applied to every counted frame. */
|
|
21
|
+
format?: Intl.NumberFormatOptions;
|
|
22
|
+
/** Locale the number formats in. Defaults to `"en-US"`. */
|
|
23
|
+
locale?: string;
|
|
24
|
+
/** What the number measures, set under it. */
|
|
25
|
+
label: RemixNode;
|
|
26
|
+
/** Text drawn before the number, such as `"$"`. */
|
|
27
|
+
prefix?: string;
|
|
28
|
+
/** Text drawn after the number, such as `"%"` or `" ms"`. */
|
|
29
|
+
suffix?: string;
|
|
30
|
+
}
|
|
31
|
+
/** One measured point of the series. */
|
|
32
|
+
interface Datum {
|
|
33
|
+
/** A bar's label, or a point's label under the line; keep it short for the line. */
|
|
34
|
+
label: RemixNode;
|
|
35
|
+
value: number;
|
|
36
|
+
/** The value as shown, such as `"14 min"`; defaults to the bare number. */
|
|
37
|
+
display?: RemixNode;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Props accepted by {@link DrawnChart}.
|
|
41
|
+
*/
|
|
42
|
+
interface Props extends Omit<TagProps<"div">, "children"> {
|
|
43
|
+
/** Accessible name of the chart: the bars' list, or the line's image. Required. */
|
|
44
|
+
"aria-label": string;
|
|
45
|
+
/** Accessible name of the pause toggle. */
|
|
46
|
+
pauseLabel?: string;
|
|
47
|
+
metric?: Metric;
|
|
48
|
+
/** Defaults to `"bars"`, drawn horizontally so labels read on a phone. */
|
|
49
|
+
variant?: Variant;
|
|
50
|
+
series: readonly Datum[];
|
|
51
|
+
/** Value a full bar, or the top of the plot, stands for. Defaults to the series' largest value. */
|
|
52
|
+
max?: number;
|
|
53
|
+
/** Index of the one datum drawn in the brand colour. */
|
|
54
|
+
highlight?: number;
|
|
55
|
+
/** A note under the chart, such as the period or the source of the numbers. */
|
|
56
|
+
footnote?: RemixNode;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Renders the figure on a raised surface inside a {@link MotionLoop}. The markup is the
|
|
61
|
+
* finished figure: full bars or line and the real formatted number, which is what reduced
|
|
62
|
+
* motion and assistive technology get. Charts with the same series length share keyframes.
|
|
63
|
+
*
|
|
64
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
65
|
+
* @returns The render function producing the figure's markup.
|
|
66
|
+
* @example
|
|
67
|
+
* <DrawnChart
|
|
68
|
+
* aria-label="Median time between checks, by how often a feed posts"
|
|
69
|
+
* metric={{ value: 15, suffix: " min", label: "Between checks of an hourly feed" }}
|
|
70
|
+
* series={[{ label: "Hourly", value: 15, display: "15 min" }, { label: "Daily", value: 240, display: "4 h" }]}
|
|
71
|
+
* highlight={0}
|
|
72
|
+
* />
|
|
73
|
+
*/
|
|
74
|
+
export declare function DrawnChart(handle: Handle<DrawnChart.Props>): () => import("remix/component").RemixElement;
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { visuallyHidden } from "@sdxc/u/a11y";
|
|
3
|
+
import { keyframes } from "@sdxc/u/animation";
|
|
4
|
+
import { raw } from "@sdxc/u/general";
|
|
5
|
+
import { motionSafe } from "@sdxc/u/responsive";
|
|
6
|
+
import { landingSurface } from "../styles/landing.js";
|
|
7
|
+
import { MotionLoop } from "./motion-loop.js";
|
|
8
|
+
/** Length of one loop: the figure draws, holds the finished chart, then resets. */
|
|
9
|
+
const CYCLE_SECONDS = 10;
|
|
10
|
+
/** Percent of the cycle at which every drawn element returns to empty for the next loop. */
|
|
11
|
+
const RESET_AT = 94;
|
|
12
|
+
/** Percent of the cycle the headline number starts counting at. */
|
|
13
|
+
const COUNT_FROM = 6;
|
|
14
|
+
/** Percent of the cycle the headline number reaches its value at. */
|
|
15
|
+
const COUNT_TO = 46;
|
|
16
|
+
/** Frames the count passes through on its way up; each is a precomputed, formatted number. */
|
|
17
|
+
const COUNT_STEPS = 24;
|
|
18
|
+
/** Percent of the cycle the first bar, or the line, starts drawing at. */
|
|
19
|
+
const DRAW_FROM = 10;
|
|
20
|
+
/** Percent of the cycle one bar takes to grow to its value. */
|
|
21
|
+
const BAR_GROW = 18;
|
|
22
|
+
/** Percent of the cycle the bars' start times spread over, so a long series still holds. */
|
|
23
|
+
const BAR_STAGGER_SPAN = 30;
|
|
24
|
+
/** Most percent of the cycle between one bar starting and the next. */
|
|
25
|
+
const MAX_BAR_GAP = 6;
|
|
26
|
+
/** Percent of the cycle the line takes to draw from its first point to its last. */
|
|
27
|
+
const LINE_DRAW = 40;
|
|
28
|
+
/**
|
|
29
|
+
* The line's reveal, from nothing to the whole plot. It wipes from the first point to the
|
|
30
|
+
* last, which on a chart read left to right is the line stroking in; the outsets keep the
|
|
31
|
+
* stroke's round caps and the peaks at the plot's edge uncut.
|
|
32
|
+
*/
|
|
33
|
+
const HIDDEN_CLIP = "inset(-0.5rem 100% -0.5rem -0.5rem)";
|
|
34
|
+
/** The line's reveal at rest: the whole plot, plus the outset for the stroke. */
|
|
35
|
+
const SHOWN_CLIP = "inset(-0.5rem -0.5rem -0.5rem -0.5rem)";
|
|
36
|
+
/** Height of the line chart's plot, which the SVG stretches to fill. */
|
|
37
|
+
const LINE_HEIGHT = "7.5rem";
|
|
38
|
+
/** Size of a point on the line; the highlighted point is drawn larger. */
|
|
39
|
+
const POINT = "0.5rem";
|
|
40
|
+
/** Easing a bar's growth starts with, so it lands softly on its value. */
|
|
41
|
+
const GROW_EASING = "cubic-bezier(0.2, 0.7, 0.2, 1)";
|
|
42
|
+
/**
|
|
43
|
+
* Room the first text line keeps at its end for the pause toggle pinned to the surface's
|
|
44
|
+
* top corner, so a label that wraps on a phone stays clear of the button.
|
|
45
|
+
*/
|
|
46
|
+
const PAUSE_CLEARANCE = "2.75rem";
|
|
47
|
+
/** Locale the headline number formats in when `metric.locale` is omitted. */
|
|
48
|
+
const DEFAULT_LOCALE = "en-US";
|
|
49
|
+
/**
|
|
50
|
+
* Renders the figure on a raised surface inside a {@link MotionLoop}. The markup is the
|
|
51
|
+
* finished figure: full bars or line and the real formatted number, which is what reduced
|
|
52
|
+
* motion and assistive technology get. Charts with the same series length share keyframes.
|
|
53
|
+
*
|
|
54
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
55
|
+
* @returns The render function producing the figure's markup.
|
|
56
|
+
* @example
|
|
57
|
+
* <DrawnChart
|
|
58
|
+
* aria-label="Median time between checks, by how often a feed posts"
|
|
59
|
+
* metric={{ value: 15, suffix: " min", label: "Between checks of an hourly feed" }}
|
|
60
|
+
* series={[{ label: "Hourly", value: 15, display: "15 min" }, { label: "Daily", value: 240, display: "4 h" }]}
|
|
61
|
+
* highlight={0}
|
|
62
|
+
* />
|
|
63
|
+
*/
|
|
64
|
+
export function DrawnChart(handle) {
|
|
65
|
+
return () => {
|
|
66
|
+
let { "aria-label": label, footnote, highlight, max, metric, mix, pauseLabel, series, variant, ...rest } = handle.props;
|
|
67
|
+
let scale = max ?? Math.max(0, ...series.map((datum) => datum.value));
|
|
68
|
+
let chart = (variant ?? "bars") === "line" ? (_jsx(LineChart, { label: label, series: series, scale: scale, highlight: highlight })) : (_jsx(BarChart, { label: label, series: series, scale: scale, highlight: highlight, clearance: metric === undefined }));
|
|
69
|
+
return (_jsx(MotionLoop, { ...rest, pauseLabel: pauseLabel, placement: "start-end", mix: mix, children: _jsxs("div", { "data-slot": "drawn-chart", mix: [
|
|
70
|
+
landingSurface(),
|
|
71
|
+
raw({ display: "grid", gap: "1.5rem", padding: "clamp(1.25rem, 4cqi, 2rem)" }),
|
|
72
|
+
], children: [metric ? _jsx(Headline, { metric: metric }) : null, chart, footnote ? (_jsx("p", { "data-slot": "drawn-chart-footnote", mix: [
|
|
73
|
+
small(),
|
|
74
|
+
raw({
|
|
75
|
+
margin: "0",
|
|
76
|
+
paddingBlockStart: "1rem",
|
|
77
|
+
borderBlockStart: "1px solid var(--ui-landing-hairline, var(--ui-neutral-border))",
|
|
78
|
+
}),
|
|
79
|
+
], children: footnote })) : null] }) }));
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The large number over its label. An integer value also gets a decorative counter whose
|
|
84
|
+
* `::before` steps through precomputed formatted frames while motion is allowed; the real
|
|
85
|
+
* number stays in the DOM as text, only visually hidden while the counter shows.
|
|
86
|
+
*/
|
|
87
|
+
function Headline(handle) {
|
|
88
|
+
return () => {
|
|
89
|
+
let { metric } = handle.props;
|
|
90
|
+
let text = formatMetric(metric, metric.value);
|
|
91
|
+
let counts = Number.isInteger(metric.value) && metric.value !== 0;
|
|
92
|
+
return (_jsxs("div", { "data-slot": "drawn-chart-metric", mix: [raw({ display: "grid", gap: "0.25rem", paddingInlineEnd: PAUSE_CLEARANCE })], children: [_jsxs("p", { "data-slot": "drawn-chart-number", mix: [
|
|
93
|
+
raw({
|
|
94
|
+
position: "relative",
|
|
95
|
+
margin: "0",
|
|
96
|
+
fontSize: "clamp(2.25rem, 10cqi, 3.25rem)",
|
|
97
|
+
lineHeight: "1.05",
|
|
98
|
+
fontWeight: "700",
|
|
99
|
+
letterSpacing: "-0.02em",
|
|
100
|
+
fontVariantNumeric: "tabular-nums",
|
|
101
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
102
|
+
}),
|
|
103
|
+
], children: [counts ? _jsx(Counter, { metric: metric, text: text }) : null, _jsx("span", { "data-slot": "drawn-chart-number-text", mix: [counts ? motionSafe(visuallyHidden()) : []], children: text })] }), _jsx("p", { mix: [small(), raw({ margin: "0" })], children: metric.label })] }));
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The counting number, drawn only by a pseudo-element and hidden from assistive technology.
|
|
108
|
+
* Its resting content is the finished number, so a browser that skips animating `content`
|
|
109
|
+
* still shows the right value.
|
|
110
|
+
*/
|
|
111
|
+
function Counter(handle) {
|
|
112
|
+
return () => {
|
|
113
|
+
let { metric, text } = handle.props;
|
|
114
|
+
let frames = countFrames(metric);
|
|
115
|
+
let name = `ui-drawn-chart-count-${hash(Object.values(frames)
|
|
116
|
+
.map((frame) => frame.content)
|
|
117
|
+
.join("|"))}`;
|
|
118
|
+
return (_jsx("span", { "aria-hidden": "true", "data-slot": "drawn-chart-count", mix: [
|
|
119
|
+
keyframes(name, frames),
|
|
120
|
+
raw({ display: "none" }),
|
|
121
|
+
motionSafe(raw({
|
|
122
|
+
display: "inline",
|
|
123
|
+
"&::before": {
|
|
124
|
+
content: cssString(text),
|
|
125
|
+
...loop(name),
|
|
126
|
+
animationTimingFunction: "step-end",
|
|
127
|
+
},
|
|
128
|
+
})),
|
|
129
|
+
] }));
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Keyframe stops for the count: zero until {@link COUNT_FROM}, then {@link COUNT_STEPS}
|
|
134
|
+
* eased-out frames up to the value, held until {@link RESET_AT}. Each stop's `content` is
|
|
135
|
+
* the frame already formatted with the metric's prefix, suffix and number format.
|
|
136
|
+
*/
|
|
137
|
+
function countFrames(metric) {
|
|
138
|
+
let frame = (value) => ({ content: cssString(formatMetric(metric, value)) });
|
|
139
|
+
let frames = { "0%": frame(0) };
|
|
140
|
+
for (let step = 0; step <= COUNT_STEPS; step++) {
|
|
141
|
+
let progress = step / COUNT_STEPS;
|
|
142
|
+
let eased = 1 - (1 - progress) ** 3;
|
|
143
|
+
frames[percent(COUNT_FROM + (COUNT_TO - COUNT_FROM) * progress)] = frame(Math.round(metric.value * eased));
|
|
144
|
+
}
|
|
145
|
+
frames[`${RESET_AT}%`] = frame(metric.value);
|
|
146
|
+
frames["100%"] = frame(0);
|
|
147
|
+
return frames;
|
|
148
|
+
}
|
|
149
|
+
/** The metric's value, or one counted frame of it, with its prefix and suffix. */
|
|
150
|
+
function formatMetric(metric, value) {
|
|
151
|
+
let number = new Intl.NumberFormat(metric.locale ?? DEFAULT_LOCALE, metric.format).format(value);
|
|
152
|
+
return `${metric.prefix ?? ""}${number}${metric.suffix ?? ""}`;
|
|
153
|
+
}
|
|
154
|
+
/** `text` as a quoted CSS string, safe for the `content` property. */
|
|
155
|
+
function cssString(text) {
|
|
156
|
+
return `"${text.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
157
|
+
}
|
|
158
|
+
/** A short, stable name fragment for a set of frames, so different metrics never share keyframes. */
|
|
159
|
+
function hash(text) {
|
|
160
|
+
let value = 5381;
|
|
161
|
+
for (let index = 0; index < text.length; index++) {
|
|
162
|
+
value = (Math.imul(value, 33) ^ text.charCodeAt(index)) >>> 0;
|
|
163
|
+
}
|
|
164
|
+
return value.toString(36);
|
|
165
|
+
}
|
|
166
|
+
/** A keyframe stop key, rounded so computed offsets stay readable in the stylesheet. */
|
|
167
|
+
function percent(value) {
|
|
168
|
+
return `${Math.round(value * 100) / 100}%`;
|
|
169
|
+
}
|
|
170
|
+
/** Share of the scale `value` fills, in percent and clamped to the track. */
|
|
171
|
+
function share(value, scale) {
|
|
172
|
+
return scale > 0 ? Math.min(100, Math.max(0, (value / scale) * 100)) : 0;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* The series as a named list of horizontal bars: each row's label and value over a track
|
|
176
|
+
* whose fill is the value's share of the scale. Each fill grows from zero in turn.
|
|
177
|
+
*/
|
|
178
|
+
function BarChart(handle) {
|
|
179
|
+
return () => {
|
|
180
|
+
let { clearance, highlight, label, scale, series } = handle.props;
|
|
181
|
+
let gap = series.length > 0 ? Math.min(MAX_BAR_GAP, BAR_STAGGER_SPAN / series.length) : 0;
|
|
182
|
+
return (_jsx("ol", { "aria-label": label, "data-slot": "drawn-chart-bars", mix: [
|
|
183
|
+
raw({ display: "grid", gap: "0.875rem", margin: "0", padding: "0", listStyle: "none" }),
|
|
184
|
+
], children: series.map((datum, index) => {
|
|
185
|
+
let lit = index === highlight;
|
|
186
|
+
let name = `ui-drawn-chart-bar-${series.length}-${index}`;
|
|
187
|
+
let start = DRAW_FROM + index * gap;
|
|
188
|
+
return (_jsxs("li", { mix: [raw({ display: "grid", gap: "0.375rem" })], children: [_jsxs("span", { mix: [
|
|
189
|
+
raw({
|
|
190
|
+
display: "flex",
|
|
191
|
+
justifyContent: "space-between",
|
|
192
|
+
alignItems: "baseline",
|
|
193
|
+
gap: "0.75rem",
|
|
194
|
+
}),
|
|
195
|
+
clearance && index === 0 ? raw({ paddingInlineEnd: PAUSE_CLEARANCE }) : [],
|
|
196
|
+
], children: [_jsx("span", { mix: [caption(lit)], children: datum.label }), _jsx("span", { mix: [caption(lit), raw({ flexShrink: "0", fontVariantNumeric: "tabular-nums" })], children: datum.display ?? datum.value })] }), _jsx("span", { "aria-hidden": "true", mix: [
|
|
197
|
+
raw({
|
|
198
|
+
display: "block",
|
|
199
|
+
blockSize: "0.5rem",
|
|
200
|
+
borderRadius: "9999px",
|
|
201
|
+
backgroundColor: "var(--ui-neutral-bg-tint)",
|
|
202
|
+
overflow: "hidden",
|
|
203
|
+
}),
|
|
204
|
+
], children: _jsx("span", { "data-slot": "drawn-chart-bar", style: { inlineSize: `${share(datum.value, scale)}%` }, mix: [
|
|
205
|
+
keyframes(name, {
|
|
206
|
+
"0%": { transform: "scaleX(0)" },
|
|
207
|
+
[percent(start)]: {
|
|
208
|
+
transform: "scaleX(0)",
|
|
209
|
+
animationTimingFunction: GROW_EASING,
|
|
210
|
+
},
|
|
211
|
+
[percent(start + BAR_GROW)]: { transform: "scaleX(1)" },
|
|
212
|
+
[`${RESET_AT}%`]: { transform: "scaleX(1)" },
|
|
213
|
+
[`${RESET_AT + 2}%`]: { transform: "scaleX(0)" },
|
|
214
|
+
"100%": { transform: "scaleX(0)" },
|
|
215
|
+
}),
|
|
216
|
+
raw({
|
|
217
|
+
display: "block",
|
|
218
|
+
blockSize: "100%",
|
|
219
|
+
borderRadius: "inherit",
|
|
220
|
+
backgroundColor: lit
|
|
221
|
+
? "var(--ui-brand-bg-solid)"
|
|
222
|
+
: "var(--ui-neutral-fg-muted)",
|
|
223
|
+
transformOrigin: "left center",
|
|
224
|
+
"&:dir(rtl)": { transformOrigin: "right center" },
|
|
225
|
+
}),
|
|
226
|
+
motionSafe(raw(loop(name))),
|
|
227
|
+
] }) })] }, index));
|
|
228
|
+
}) }));
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* The series as a line drawn in from its first point, each point appearing as the line
|
|
233
|
+
* reaches it, with short labels under the plot. The SVG is a named image; a visually
|
|
234
|
+
* hidden list carries every label and value for assistive technology.
|
|
235
|
+
*/
|
|
236
|
+
function LineChart(handle) {
|
|
237
|
+
return () => {
|
|
238
|
+
let { highlight, label, scale, series } = handle.props;
|
|
239
|
+
let count = series.length;
|
|
240
|
+
let points = series.map((datum, index) => ({
|
|
241
|
+
x: count > 1 ? (index / (count - 1)) * 100 : 50,
|
|
242
|
+
y: 100 - share(datum.value, scale),
|
|
243
|
+
}));
|
|
244
|
+
let path = points
|
|
245
|
+
.map((point, index) => `${index === 0 ? "M" : "L"}${round(point.x)} ${round(point.y)}`)
|
|
246
|
+
.join(" ");
|
|
247
|
+
let lineName = `ui-drawn-chart-line-${count}`;
|
|
248
|
+
return (_jsxs("div", { "data-slot": "drawn-chart-line", mix: [raw({ display: "grid", gap: "0.625rem" })], children: [_jsxs("div", { mix: [
|
|
249
|
+
raw({
|
|
250
|
+
position: "relative",
|
|
251
|
+
blockSize: LINE_HEIGHT,
|
|
252
|
+
marginInline: `calc(${POINT} / 2)`,
|
|
253
|
+
borderBlockEnd: "1px solid var(--ui-landing-hairline, var(--ui-neutral-border))",
|
|
254
|
+
}),
|
|
255
|
+
], children: [_jsx("svg", { role: "img", "aria-label": label, viewBox: "0 0 100 100", preserveAspectRatio: "none", "data-slot": "drawn-chart-plot", mix: [
|
|
256
|
+
keyframes(lineName, {
|
|
257
|
+
"0%": { clipPath: HIDDEN_CLIP },
|
|
258
|
+
[`${DRAW_FROM}%`]: { clipPath: HIDDEN_CLIP },
|
|
259
|
+
[`${DRAW_FROM + LINE_DRAW}%`]: { clipPath: SHOWN_CLIP },
|
|
260
|
+
[`${RESET_AT}%`]: { clipPath: SHOWN_CLIP },
|
|
261
|
+
[`${RESET_AT + 2}%`]: { clipPath: HIDDEN_CLIP },
|
|
262
|
+
"100%": { clipPath: HIDDEN_CLIP },
|
|
263
|
+
}),
|
|
264
|
+
raw({
|
|
265
|
+
display: "block",
|
|
266
|
+
inlineSize: "100%",
|
|
267
|
+
blockSize: "100%",
|
|
268
|
+
overflow: "visible",
|
|
269
|
+
}),
|
|
270
|
+
motionSafe(raw(loop(lineName))),
|
|
271
|
+
], children: _jsx("path", { d: path, mix: [
|
|
272
|
+
raw({
|
|
273
|
+
fill: "none",
|
|
274
|
+
stroke: "var(--ui-neutral-fg-emphasis)",
|
|
275
|
+
strokeWidth: "2",
|
|
276
|
+
strokeLinecap: "round",
|
|
277
|
+
strokeLinejoin: "round",
|
|
278
|
+
vectorEffect: "non-scaling-stroke",
|
|
279
|
+
}),
|
|
280
|
+
] }) }), points.map((point, index) => (_jsx(Point, { x: point.x, y: point.y, count: count, index: index, lit: index === highlight }, index)))] }), _jsx("div", { "aria-hidden": "true", mix: [
|
|
281
|
+
raw({
|
|
282
|
+
position: "relative",
|
|
283
|
+
blockSize: "1.125rem",
|
|
284
|
+
marginInline: `calc(${POINT} / 2)`,
|
|
285
|
+
}),
|
|
286
|
+
], children: series.map((datum, index) => (_jsx("span", { style: { left: `${points[index].x}%` }, mix: [
|
|
287
|
+
small(),
|
|
288
|
+
raw({
|
|
289
|
+
position: "absolute",
|
|
290
|
+
insetBlockStart: "0",
|
|
291
|
+
whiteSpace: "nowrap",
|
|
292
|
+
lineHeight: "1.125rem",
|
|
293
|
+
translate: edgeAlign(index, count),
|
|
294
|
+
}),
|
|
295
|
+
index === highlight ? raw({ color: "var(--ui-brand-fg)", fontWeight: "600" }) : [],
|
|
296
|
+
], children: datum.label }, index))) }), _jsx("ol", { mix: [visuallyHidden()], children: series.map((datum, index) => (_jsxs("li", { children: [datum.label, ": ", datum.display ?? datum.value] }, index))) })] }));
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
/** Rounds a plot coordinate so the path data stays short. */
|
|
300
|
+
function round(value) {
|
|
301
|
+
return Math.round(value * 100) / 100;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* How far a label under the line shifts from its point: the first and last align to the
|
|
305
|
+
* plot's edges so they stay inside the surface, every other one centres on its point.
|
|
306
|
+
*/
|
|
307
|
+
function edgeAlign(index, count) {
|
|
308
|
+
if (count > 1 && index === 0)
|
|
309
|
+
return "0";
|
|
310
|
+
if (count > 1 && index === count - 1)
|
|
311
|
+
return "-100%";
|
|
312
|
+
return "-50%";
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* A point on the line, drawn in HTML over the stretched SVG so it stays round. It appears
|
|
316
|
+
* when the line reaches it, and the highlighted point is larger and in the brand colour.
|
|
317
|
+
*/
|
|
318
|
+
function Point(handle) {
|
|
319
|
+
return () => {
|
|
320
|
+
let { count, index, lit, x, y } = handle.props;
|
|
321
|
+
let name = `ui-drawn-chart-point-${count}-${index}`;
|
|
322
|
+
let at = DRAW_FROM + (count > 1 ? (index / (count - 1)) * LINE_DRAW : 0);
|
|
323
|
+
let off = { opacity: "0", transform: "scale(0.4)" };
|
|
324
|
+
let on = { opacity: "1", transform: "scale(1)" };
|
|
325
|
+
return (_jsx("span", { "aria-hidden": "true", "data-slot": "drawn-chart-point", style: { left: `${x}%`, top: `${y}%` }, mix: [
|
|
326
|
+
keyframes(name, {
|
|
327
|
+
"0%": off,
|
|
328
|
+
[percent(Math.max(0, at - 1))]: off,
|
|
329
|
+
[percent(at + 1)]: on,
|
|
330
|
+
[`${RESET_AT}%`]: on,
|
|
331
|
+
[`${RESET_AT + 2}%`]: off,
|
|
332
|
+
"100%": off,
|
|
333
|
+
}),
|
|
334
|
+
raw({
|
|
335
|
+
position: "absolute",
|
|
336
|
+
inlineSize: lit ? `calc(${POINT} * 1.75)` : POINT,
|
|
337
|
+
blockSize: lit ? `calc(${POINT} * 1.75)` : POINT,
|
|
338
|
+
marginInlineStart: lit ? `calc(${POINT} * -0.875)` : `calc(${POINT} / -2)`,
|
|
339
|
+
marginBlockStart: lit ? `calc(${POINT} * -0.875)` : `calc(${POINT} / -2)`,
|
|
340
|
+
borderRadius: "9999px",
|
|
341
|
+
backgroundColor: lit ? "var(--ui-brand-bg-solid)" : "var(--ui-neutral-fg-emphasis)",
|
|
342
|
+
boxShadow: "0 0 0 2px var(--ui-bg)",
|
|
343
|
+
}),
|
|
344
|
+
motionSafe(raw(loop(name))),
|
|
345
|
+
] }));
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
/** The animation declarations every drawn element shares: one linear loop of the cycle. */
|
|
349
|
+
function loop(name) {
|
|
350
|
+
return {
|
|
351
|
+
animationName: name,
|
|
352
|
+
animationDuration: `${CYCLE_SECONDS}s`,
|
|
353
|
+
animationTimingFunction: "linear",
|
|
354
|
+
animationIterationCount: "infinite",
|
|
355
|
+
animationFillMode: "both",
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
/** A bar's label or value, in the heading ink, or the brand ink when highlighted. */
|
|
359
|
+
function caption(lit) {
|
|
360
|
+
return raw({
|
|
361
|
+
fontSize: "0.875rem",
|
|
362
|
+
lineHeight: "1.25rem",
|
|
363
|
+
fontWeight: lit ? "600" : "500",
|
|
364
|
+
color: lit ? "var(--ui-brand-fg)" : "var(--ui-neutral-fg-emphasis)",
|
|
365
|
+
minInlineSize: "0",
|
|
366
|
+
overflowWrap: "anywhere",
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
/** The quieter text: the metric's label, the line's labels and the footnote. */
|
|
370
|
+
function small() {
|
|
371
|
+
return raw({
|
|
372
|
+
fontSize: "0.8125rem",
|
|
373
|
+
lineHeight: "1.25rem",
|
|
374
|
+
color: "var(--ui-neutral-fg-muted)",
|
|
375
|
+
overflowWrap: "anywhere",
|
|
376
|
+
});
|
|
377
|
+
}
|