@sdxc/ui 2026.10.29 → 2026.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +187 -113
- package/dist/{behaviors → app/behaviors}/drag-session.js +1 -1
- package/dist/{behaviors → app/behaviors}/toaster.js +1 -1
- package/dist/{components → app}/chart.d.ts +1 -1
- package/dist/{components → app}/chart.js +18 -34
- package/dist/{components → app}/context-menu.d.ts +2 -2
- package/dist/{components → app}/context-menu.js +8 -7
- package/dist/{components → app}/drop-indicator.js +3 -3
- package/dist/{components → app}/drop-zone.js +3 -3
- package/dist/{components → app}/empty.d.ts +1 -1
- package/dist/{components → app}/empty.js +11 -21
- package/dist/{components → app}/file-trigger.js +2 -2
- 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 +41 -0
- package/dist/app/index.js +41 -0
- package/dist/{components → app}/menubar.js +5 -7
- package/dist/{mixins → app/mixins}/drag-reorder.js +1 -1
- package/dist/{mixins → app/mixins}/drop-zone.js +1 -1
- package/dist/{mixins → app/mixins}/grid-list-keys.js +2 -2
- package/dist/{mixins → app/mixins}/menubar-keys.js +2 -2
- package/dist/{mixins → app/mixins}/resize-handle.js +3 -3
- package/dist/{mixins/treeKeys.js → app/mixins/tree-keys.js} +2 -2
- package/dist/{components → app}/resizable.js +7 -10
- package/dist/{components → app}/shortcut-list.js +4 -3
- package/dist/{components → app}/skeleton.js +3 -3
- 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/{components → app}/table.js +12 -15
- package/dist/{components → app}/toast.js +18 -24
- 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/{utils → app/utils}/chart-path.d.ts +1 -1
- package/dist/{utils → app/utils}/chart-path.js +2 -2
- package/dist/{utils → app/utils}/chart-scale.js +1 -1
- 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/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/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.js +3 -3
- 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 +6 -38
- package/dist/components/index.js +6 -38
- package/dist/components/input.js +3 -4
- 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 +16 -11
- 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/radio-group.js +5 -7
- package/dist/components/range-calendar.js +3 -3
- 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/switch.js +3 -3
- package/dist/components/tabs.js +9 -12
- package/dist/components/tag-group.js +7 -9
- package/dist/components/text-field.js +2 -1
- 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/toggle-button.js +5 -7
- package/dist/components/tooltip.js +3 -3
- package/dist/components/typeset.js +128 -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 +55 -0
- package/dist/docs/docs-feedback.js +72 -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 +53 -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 +46 -0
- package/dist/docs/docs-pager.js +74 -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 +97 -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 +79 -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 +7 -5
- package/dist/{patterns → landing}/faq-band.js +11 -12
- 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/landing/landing-section.d.ts +110 -0
- 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 +14 -4
- package/dist/{components → landing}/split.js +30 -21
- 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 -4
- 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/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 +2 -15
- package/dist/mixins/index.js +2 -15
- package/dist/styles/index.d.ts +2 -5
- package/dist/styles/index.js +2 -5
- package/dist/styles/landing.d.ts +200 -0
- package/dist/styles/landing.js +516 -0
- package/dist/styles/surface-control.d.ts +18 -0
- package/dist/styles/surface-control.js +31 -0
- package/dist/utils/eyebrow.d.ts +39 -0
- package/dist/utils/eyebrow.js +21 -0
- package/dist/utils/index.d.ts +1 -5
- package/dist/utils/index.js +1 -5
- package/package.json +14 -4
- package/src/theme.css +87 -22
- package/dist/components/feature.d.ts +0 -102
- package/dist/components/feature.js +0 -151
- 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.d.ts +0 -81
- package/dist/components/marketing-section.js +0 -103
- package/dist/components/stat-strip.js +0 -64
- 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 -67
- package/dist/patterns/bento.js +0 -95
- 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 -45
- package/dist/patterns/step-list.js +0 -84
- 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/{behaviors → app/behaviors}/toaster.d.ts +0 -0
- /package/dist/{components → app}/drop-indicator.d.ts +0 -0
- /package/dist/{components → app}/drop-zone.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/{components → app}/skeleton.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}/table.d.ts +0 -0
- /package/dist/{components → app}/toast.d.ts +0 -0
- /package/dist/{components → app}/toolbar.d.ts +0 -0
- /package/dist/{utils → app/utils}/chart-marker-indices.d.ts +0 -0
- /package/dist/{utils → app/utils}/chart-marker-indices.js +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,481 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { CheckIcon } from "@sdxc/icons";
|
|
3
|
+
import { keyframes } from "@sdxc/u/animation";
|
|
4
|
+
import { raw } from "@sdxc/u/general";
|
|
5
|
+
import { container } from "@sdxc/u/layout";
|
|
6
|
+
import { at, motionSafe } from "@sdxc/u/responsive";
|
|
7
|
+
import { landingSurface } from "../styles/landing.js";
|
|
8
|
+
import { MotionLoop } from "./motion-loop.js";
|
|
9
|
+
/** Length of one loop: the pulse travels, every target lights, the outcome holds, then resets. */
|
|
10
|
+
const CYCLE_SECONDS = 10;
|
|
11
|
+
/** Percent of the cycle at which every lit element goes dark again for the next loop. */
|
|
12
|
+
const RESET_AT = 94;
|
|
13
|
+
/** Most percent of the cycle between one target lighting and the next. */
|
|
14
|
+
const MAX_TARGET_GAP = 9;
|
|
15
|
+
/** Percent of the cycle the targets share, so six targets still leave time for the outcome. */
|
|
16
|
+
const TARGETS_SPAN = 42;
|
|
17
|
+
/** Container the card declares, which the target grid queries to pick its column count. */
|
|
18
|
+
const CONTAINER_NAME = "ui-fan-out-diagram";
|
|
19
|
+
/** Card content width from which the targets take up to three columns instead of two. */
|
|
20
|
+
const WIDE_FROM = "22.5rem";
|
|
21
|
+
/** Height of the trunk between the source and the nearest bus. */
|
|
22
|
+
const TRUNK = "1.5rem";
|
|
23
|
+
/** Height of the stub from a bus down to each target, kept as the target cell's padding. */
|
|
24
|
+
const STUB = "1rem";
|
|
25
|
+
/** Space between target columns, which each bus segment bridges to meet its neighbour. */
|
|
26
|
+
const COLUMN_GAP = "0.75rem";
|
|
27
|
+
/** Space between target rows, which the rail spans to link one row's bus to the next. */
|
|
28
|
+
const ROW_GAP = "0.5rem";
|
|
29
|
+
/** Room at the grid's start edge for the rail that links rows once the targets wrap. */
|
|
30
|
+
const RAIL_GUTTER = "0.75rem";
|
|
31
|
+
/**
|
|
32
|
+
* Room the card keeps for the pause toggle pinned to its top corner: inline room beside
|
|
33
|
+
* the source on top, or block room above the targets when they sit on top.
|
|
34
|
+
*/
|
|
35
|
+
const PAUSE_CLEARANCE = "2.75rem";
|
|
36
|
+
/** Inline padding of the source row, which with the card padding clears the pause toggle. */
|
|
37
|
+
const SOURCE_CLEARANCE = "1.5rem";
|
|
38
|
+
/** Inline size of the pulse that travels the trunk. */
|
|
39
|
+
const PULSE = "0.5rem";
|
|
40
|
+
/**
|
|
41
|
+
* Renders the source, its trunk and a list of targets on a raised surface inside a
|
|
42
|
+
* {@link MotionLoop}. Without motion every line shows filled and every target lit, so the
|
|
43
|
+
* static picture is the delivered state. Diagrams of the same shape and direction share keyframes.
|
|
44
|
+
*
|
|
45
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
46
|
+
* @returns The render function producing the diagram's markup.
|
|
47
|
+
* @example
|
|
48
|
+
* <FanOutDiagram
|
|
49
|
+
* aria-label="One fetch, every reader"
|
|
50
|
+
* source={{ icon: <RssIcon size={14} />, title: "Feed fetched", detail: "GET /feed.xml" }}
|
|
51
|
+
* targets={[{ title: "Ana", detail: "+3 posts" }, { title: "Ben", detail: "+3 posts" }]}
|
|
52
|
+
* outcome="Delivered to 2 readers"
|
|
53
|
+
* />
|
|
54
|
+
*/
|
|
55
|
+
export function FanOutDiagram(handle) {
|
|
56
|
+
return () => {
|
|
57
|
+
let { "aria-label": label, direction = "out", footnote, mix, outcome, pauseLabel, source, targets, ...rest } = handle.props;
|
|
58
|
+
let timing = timingFor(direction, targets.length);
|
|
59
|
+
let narrow = layoutFor(direction, targets.length, Math.min(targets.length, 2));
|
|
60
|
+
let wide = layoutFor(direction, targets.length, Math.min(targets.length, 3));
|
|
61
|
+
let sourceNode = _jsx(SourceRow, { source: source, timing: timing });
|
|
62
|
+
let trunk = _jsx(Trunk, { timing: timing });
|
|
63
|
+
return (_jsx(MotionLoop, { ...rest, pauseLabel: pauseLabel, placement: "start-end", mix: mix, children: _jsxs("figure", { "aria-label": label, "data-slot": "fan-out-diagram", "data-direction": direction, mix: [
|
|
64
|
+
landingSurface(),
|
|
65
|
+
container(CONTAINER_NAME),
|
|
66
|
+
raw({
|
|
67
|
+
display: "grid",
|
|
68
|
+
gap: "1.5rem",
|
|
69
|
+
margin: "0",
|
|
70
|
+
padding: "clamp(1.25rem, 4cqi, 2rem)",
|
|
71
|
+
}),
|
|
72
|
+
direction === "in" ? raw({ paddingBlockStart: PAUSE_CLEARANCE }) : [],
|
|
73
|
+
], children: [_jsxs("div", { mix: [raw({ display: "grid", minInlineSize: "0" })], children: [direction === "out" ? sourceNode : null, direction === "out" ? trunk : null, _jsx("ul", { "data-slot": "fan-out-diagram-targets", mix: [
|
|
74
|
+
raw({
|
|
75
|
+
"--ui-fan-cols-n": `repeat(${narrow.columns}, minmax(0, 1fr))`,
|
|
76
|
+
"--ui-fan-cols-w": `repeat(${wide.columns}, minmax(0, 1fr))`,
|
|
77
|
+
"--ui-fan-gutter-n": narrow.rows > 1 ? RAIL_GUTTER : "0px",
|
|
78
|
+
"--ui-fan-gutter-w": wide.rows > 1 ? RAIL_GUTTER : "0px",
|
|
79
|
+
display: "grid",
|
|
80
|
+
columnGap: COLUMN_GAP,
|
|
81
|
+
rowGap: ROW_GAP,
|
|
82
|
+
margin: "0",
|
|
83
|
+
padding: "0",
|
|
84
|
+
listStyle: "none",
|
|
85
|
+
}),
|
|
86
|
+
responsive({
|
|
87
|
+
gridTemplateColumns: "var(--ui-fan-cols-n)",
|
|
88
|
+
paddingInlineStart: "var(--ui-fan-gutter-n)",
|
|
89
|
+
}),
|
|
90
|
+
], children: targets.map((target, index) => (_jsx(TargetCell, { target: target, index: index, timing: timing, narrow: narrow.cells[index], wide: wide.cells[index], narrowWraps: narrow.rows > 1, wideWraps: wide.rows > 1 }, index))) }), direction === "in" ? trunk : null, direction === "in" ? sourceNode : null] }), outcome === undefined && footnote === undefined ? null : (_jsxs("div", { "data-slot": "fan-out-diagram-footer", mix: [
|
|
91
|
+
raw({
|
|
92
|
+
display: "flex",
|
|
93
|
+
flexWrap: "wrap",
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
justifyContent: "space-between",
|
|
96
|
+
gap: "0.75rem",
|
|
97
|
+
paddingBlockStart: "1.25rem",
|
|
98
|
+
borderBlockStart: "1px solid var(--ui-landing-hairline, var(--ui-neutral-border))",
|
|
99
|
+
}),
|
|
100
|
+
], children: [outcome === undefined ? null : (_jsxs("span", { "data-slot": "fan-out-diagram-outcome", mix: [outcomeBadge(timing)], children: [_jsx(CheckIcon, { size: 14, strokeWidth: 2.5, "aria-hidden": "true" }), outcome] })), footnote === undefined ? null : (_jsx("span", { "data-slot": "fan-out-diagram-footnote", mix: [
|
|
101
|
+
detail(),
|
|
102
|
+
raw({ display: "inline-flex", alignItems: "center", gap: "0.375rem" }),
|
|
103
|
+
appearsWithOutcome(timing),
|
|
104
|
+
], children: footnote }))] }))] }) }));
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Applies `narrowStyles`, whose values read `-n` custom properties, and the same
|
|
109
|
+
* declarations reading `-w` properties once the card is wide. Every element writes its own
|
|
110
|
+
* values into those properties, so the two rules stay identical for every diagram.
|
|
111
|
+
*/
|
|
112
|
+
function responsive(narrowStyles) {
|
|
113
|
+
let wideStyles = {};
|
|
114
|
+
for (let [property, value] of Object.entries(narrowStyles)) {
|
|
115
|
+
wideStyles[property] = value.replaceAll("-n)", "-w)");
|
|
116
|
+
}
|
|
117
|
+
return [raw(narrowStyles), at(WIDE_FROM, CONTAINER_NAME, raw(wideStyles))];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Places `count` targets in `columns` columns. The row nearest the source is always full,
|
|
121
|
+
* so the trunk meets its bus: flowing out a short row goes last, flowing in it goes first.
|
|
122
|
+
* Once there are several rows, a rail in the start gutter links every row's bus.
|
|
123
|
+
*/
|
|
124
|
+
function layoutFor(direction, count, columns) {
|
|
125
|
+
let safeColumns = Math.max(columns, 1);
|
|
126
|
+
let rows = Math.ceil(count / safeColumns);
|
|
127
|
+
let short = direction === "in" ? count % safeColumns : 0;
|
|
128
|
+
let place = (index) => {
|
|
129
|
+
if (index < short)
|
|
130
|
+
return { row: 0, column: index };
|
|
131
|
+
let offset = index - short;
|
|
132
|
+
return {
|
|
133
|
+
row: (short > 0 ? 1 : 0) + Math.floor(offset / safeColumns),
|
|
134
|
+
column: offset % safeColumns,
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
let cells = [];
|
|
138
|
+
for (let index = 0; index < count; index++) {
|
|
139
|
+
let { row, column } = place(index);
|
|
140
|
+
let next = index + 1 < count ? place(index + 1) : undefined;
|
|
141
|
+
let linked = direction === "out" ? row < rows - 1 : row > 0;
|
|
142
|
+
cells.push({
|
|
143
|
+
row: row + 1,
|
|
144
|
+
column: column + 1,
|
|
145
|
+
rowStart: column === 0,
|
|
146
|
+
rowEnd: next === undefined || next.row !== row,
|
|
147
|
+
rail: column === 0 && linked,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return { columns: safeColumns, rows, cells };
|
|
151
|
+
}
|
|
152
|
+
/** Where a cell's bus segment starts and ends, as inline insets from the cell's edges. */
|
|
153
|
+
function busInsets(cell, wraps) {
|
|
154
|
+
let center = "calc(50% - 1px)";
|
|
155
|
+
let bridge = `calc(${COLUMN_GAP} / -2)`;
|
|
156
|
+
let end = cell.rowEnd ? center : bridge;
|
|
157
|
+
if (!cell.rowStart)
|
|
158
|
+
return { start: bridge, end };
|
|
159
|
+
return { start: wraps ? `calc(${RAIL_GUTTER} / -2 - 1px)` : center, end };
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Lays out one cycle. Flowing out, the pulse runs the trunk, the buses fill, then each
|
|
163
|
+
* stub and target lights in turn. Flowing in, the targets light first, their stubs and
|
|
164
|
+
* the buses fill, and the pulse runs the trunk into the source last.
|
|
165
|
+
*/
|
|
166
|
+
function timingFor(direction, count) {
|
|
167
|
+
let gap = count > 0 ? Math.min(MAX_TARGET_GAP, TARGETS_SPAN / count) : MAX_TARGET_GAP;
|
|
168
|
+
if (direction === "out") {
|
|
169
|
+
let last = 24 + Math.max(count - 1, 0) * gap;
|
|
170
|
+
return {
|
|
171
|
+
direction,
|
|
172
|
+
count,
|
|
173
|
+
first: 24,
|
|
174
|
+
gap,
|
|
175
|
+
trunkFrom: 2,
|
|
176
|
+
trunkTo: 12,
|
|
177
|
+
busFrom: 12,
|
|
178
|
+
busTo: 18,
|
|
179
|
+
sourceAt: 2,
|
|
180
|
+
outcomeAt: last + 8,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
let last = 8 + Math.max(count - 1, 0) * gap;
|
|
184
|
+
return {
|
|
185
|
+
direction,
|
|
186
|
+
count,
|
|
187
|
+
first: 8,
|
|
188
|
+
gap,
|
|
189
|
+
trunkFrom: last + 10,
|
|
190
|
+
trunkTo: last + 20,
|
|
191
|
+
busFrom: last + 4,
|
|
192
|
+
busTo: last + 10,
|
|
193
|
+
sourceAt: last + 20,
|
|
194
|
+
outcomeAt: last + 24,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
/** Percent of the cycle at which target `index` lights. */
|
|
198
|
+
function lightsAt(timing, index) {
|
|
199
|
+
return timing.first + index * timing.gap;
|
|
200
|
+
}
|
|
201
|
+
/** The keyframe name of one part, unique per direction and count, and per index when given. */
|
|
202
|
+
function frameName(timing, part, index) {
|
|
203
|
+
let base = `ui-fan-out-diagram-${timing.direction}-${part}-${timing.count}`;
|
|
204
|
+
return index === undefined ? base : `${base}-${index}`;
|
|
205
|
+
}
|
|
206
|
+
/** The animation declarations every lit element shares: one linear loop of the cycle. */
|
|
207
|
+
function loop(name) {
|
|
208
|
+
return {
|
|
209
|
+
animationName: name,
|
|
210
|
+
animationDuration: `${CYCLE_SECONDS}s`,
|
|
211
|
+
animationTimingFunction: "linear",
|
|
212
|
+
animationIterationCount: "infinite",
|
|
213
|
+
animationFillMode: "both",
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Keyframe stops that hold `off` until `at`, switch to `on`, and go back to `off` at
|
|
218
|
+
* {@link RESET_AT}, so every element of the diagram resets together.
|
|
219
|
+
*/
|
|
220
|
+
function litFrames(at, off, on) {
|
|
221
|
+
return {
|
|
222
|
+
"0%": off,
|
|
223
|
+
[`${at - 1}%`]: off,
|
|
224
|
+
[`${at}%`]: on,
|
|
225
|
+
[`${RESET_AT}%`]: on,
|
|
226
|
+
[`${RESET_AT + 2}%`]: off,
|
|
227
|
+
"100%": off,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
/** A line's fill, full by default and grown from `from` to `to` while the diagram animates. */
|
|
231
|
+
function fill(name, axis, from, to, origin) {
|
|
232
|
+
let empty = { transform: `scale${axis}(0)` };
|
|
233
|
+
let full = { transform: `scale${axis}(1)` };
|
|
234
|
+
return [
|
|
235
|
+
keyframes(name, {
|
|
236
|
+
"0%": empty,
|
|
237
|
+
[`${from}%`]: empty,
|
|
238
|
+
[`${to}%`]: full,
|
|
239
|
+
[`${RESET_AT}%`]: full,
|
|
240
|
+
[`${RESET_AT + 2}%`]: empty,
|
|
241
|
+
"100%": empty,
|
|
242
|
+
}),
|
|
243
|
+
raw({
|
|
244
|
+
position: "absolute",
|
|
245
|
+
inset: "0",
|
|
246
|
+
backgroundColor: "var(--ui-success-bg-solid)",
|
|
247
|
+
transformOrigin: origin,
|
|
248
|
+
}),
|
|
249
|
+
motionSafe(raw(loop(name))),
|
|
250
|
+
];
|
|
251
|
+
}
|
|
252
|
+
/** A neutral track with a success fill drawn over it. */
|
|
253
|
+
function Line(handle) {
|
|
254
|
+
return () => {
|
|
255
|
+
let { filled, slot, track } = handle.props;
|
|
256
|
+
return (_jsx("span", { "aria-hidden": "true", "data-slot": slot, mix: [...track, raw({ backgroundColor: "var(--ui-neutral-border)" })], children: _jsx("span", { mix: filled }) }));
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
/** The source card, centred on the trunk, its text kept clear of the pause toggle. */
|
|
260
|
+
function SourceRow(handle) {
|
|
261
|
+
return () => {
|
|
262
|
+
let { source, timing } = handle.props;
|
|
263
|
+
let name = frameName(timing, "source");
|
|
264
|
+
let on = { borderColor: "var(--ui-brand-border)" };
|
|
265
|
+
let off = { borderColor: "var(--ui-neutral-border)" };
|
|
266
|
+
return (_jsx("div", { "data-slot": "fan-out-diagram-source-row", mix: [
|
|
267
|
+
raw({
|
|
268
|
+
display: "grid",
|
|
269
|
+
justifyItems: "center",
|
|
270
|
+
paddingInline: timing.direction === "out" ? SOURCE_CLEARANCE : "0",
|
|
271
|
+
minInlineSize: "0",
|
|
272
|
+
}),
|
|
273
|
+
], children: _jsxs("div", { "data-slot": "fan-out-diagram-source", mix: [
|
|
274
|
+
raw({
|
|
275
|
+
display: "flex",
|
|
276
|
+
alignItems: "center",
|
|
277
|
+
gap: "0.75rem",
|
|
278
|
+
maxInlineSize: "100%",
|
|
279
|
+
minInlineSize: "0",
|
|
280
|
+
paddingBlock: "0.625rem",
|
|
281
|
+
paddingInline: "0.875rem",
|
|
282
|
+
border: "1px solid",
|
|
283
|
+
borderRadius: "0.75rem",
|
|
284
|
+
backgroundColor: "var(--ui-bg)",
|
|
285
|
+
...on,
|
|
286
|
+
}),
|
|
287
|
+
timing.direction === "in"
|
|
288
|
+
? [keyframes(name, litFrames(timing.sourceAt, off, on)), motionSafe(raw(loop(name)))]
|
|
289
|
+
: [],
|
|
290
|
+
], children: [source.icon === undefined ? null : (_jsx("span", { "aria-hidden": "true", mix: [
|
|
291
|
+
raw({
|
|
292
|
+
display: "grid",
|
|
293
|
+
placeItems: "center",
|
|
294
|
+
flexShrink: "0",
|
|
295
|
+
inlineSize: "1.75rem",
|
|
296
|
+
blockSize: "1.75rem",
|
|
297
|
+
borderRadius: "9999px",
|
|
298
|
+
color: "var(--ui-brand-fg)",
|
|
299
|
+
backgroundColor: "var(--ui-brand-bg-tint)",
|
|
300
|
+
}),
|
|
301
|
+
], children: source.icon })), _jsxs("span", { mix: [raw({ display: "grid", gap: "0.125rem", minInlineSize: "0" })], children: [_jsx("span", { mix: [caption()], children: source.title }), source.detail === undefined ? null : (_jsx("code", { mix: [detail(), raw({ fontFamily: "var(--ui-font-mono)" })], children: source.detail }))] })] }) }));
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
/** The line between the source and the nearest bus, which the pulse travels down. */
|
|
305
|
+
function Trunk(handle) {
|
|
306
|
+
return () => {
|
|
307
|
+
let { timing } = handle.props;
|
|
308
|
+
let pulse = frameName(timing, "pulse");
|
|
309
|
+
let hidden = { opacity: "0", transform: "translateY(0)" };
|
|
310
|
+
let start = { opacity: "1", transform: "translateY(0)" };
|
|
311
|
+
let end = { opacity: "1", transform: `translateY(${TRUNK})` };
|
|
312
|
+
return (_jsxs("span", { "aria-hidden": "true", "data-slot": "fan-out-diagram-trunk", mix: [
|
|
313
|
+
raw({
|
|
314
|
+
position: "relative",
|
|
315
|
+
justifySelf: "center",
|
|
316
|
+
inlineSize: "2px",
|
|
317
|
+
blockSize: TRUNK,
|
|
318
|
+
backgroundColor: "var(--ui-neutral-border)",
|
|
319
|
+
}),
|
|
320
|
+
], children: [_jsx("span", { mix: fill(frameName(timing, "trunk"), "Y", timing.trunkFrom, timing.trunkTo, "top") }), _jsx("span", { mix: [
|
|
321
|
+
keyframes(pulse, {
|
|
322
|
+
"0%": hidden,
|
|
323
|
+
[`${timing.trunkFrom - 1}%`]: hidden,
|
|
324
|
+
[`${timing.trunkFrom}%`]: start,
|
|
325
|
+
[`${timing.trunkTo}%`]: end,
|
|
326
|
+
[`${timing.trunkTo + 1}%`]: { ...end, opacity: "0" },
|
|
327
|
+
"100%": { ...end, opacity: "0" },
|
|
328
|
+
}),
|
|
329
|
+
raw({
|
|
330
|
+
position: "absolute",
|
|
331
|
+
insetBlockStart: `calc(${PULSE} / -2)`,
|
|
332
|
+
insetInlineStart: `calc(1px - ${PULSE} / 2)`,
|
|
333
|
+
inlineSize: PULSE,
|
|
334
|
+
blockSize: PULSE,
|
|
335
|
+
borderRadius: "9999px",
|
|
336
|
+
backgroundColor: "var(--ui-brand-bg-solid)",
|
|
337
|
+
boxShadow: "0 0 0 3px var(--ui-brand-bg-tint)",
|
|
338
|
+
opacity: "0",
|
|
339
|
+
}),
|
|
340
|
+
motionSafe(raw(loop(pulse))),
|
|
341
|
+
] })] }));
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* One target's grid cell: its bus segment along the edge facing the source, a stub from
|
|
346
|
+
* that bus to the chip, and the rail when it links rows. The stub is the cell's padding,
|
|
347
|
+
* so it meets the chip however the grid wraps or the chip's text grows.
|
|
348
|
+
*/
|
|
349
|
+
function TargetCell(handle) {
|
|
350
|
+
return () => {
|
|
351
|
+
let { index, narrow, narrowWraps, target, timing, wide, wideWraps } = handle.props;
|
|
352
|
+
let isOut = timing.direction === "out";
|
|
353
|
+
let narrowBus = busInsets(narrow, narrowWraps);
|
|
354
|
+
let wideBus = busInsets(wide, wideWraps);
|
|
355
|
+
let at = lightsAt(timing, index);
|
|
356
|
+
let stubFrom = isOut ? at - 4 : at;
|
|
357
|
+
let stubTo = isOut ? at : at + 4;
|
|
358
|
+
let edge = isOut ? "insetBlockStart" : "insetBlockEnd";
|
|
359
|
+
let chipName = frameName(timing, "chip", index);
|
|
360
|
+
let on = { borderColor: "var(--ui-brand-border)" };
|
|
361
|
+
let off = { borderColor: "var(--ui-neutral-border)" };
|
|
362
|
+
return (_jsxs("li", { "data-slot": "fan-out-diagram-target", mix: [
|
|
363
|
+
raw({
|
|
364
|
+
"--ui-fan-row-n": String(narrow.row),
|
|
365
|
+
"--ui-fan-row-w": String(wide.row),
|
|
366
|
+
"--ui-fan-col-n": String(narrow.column),
|
|
367
|
+
"--ui-fan-col-w": String(wide.column),
|
|
368
|
+
"--ui-fan-bus-start-n": narrowBus.start,
|
|
369
|
+
"--ui-fan-bus-start-w": wideBus.start,
|
|
370
|
+
"--ui-fan-bus-end-n": narrowBus.end,
|
|
371
|
+
"--ui-fan-bus-end-w": wideBus.end,
|
|
372
|
+
"--ui-fan-rail-n": narrow.rail ? "block" : "none",
|
|
373
|
+
"--ui-fan-rail-w": wide.rail ? "block" : "none",
|
|
374
|
+
position: "relative",
|
|
375
|
+
display: "grid",
|
|
376
|
+
minInlineSize: "0",
|
|
377
|
+
[isOut ? "paddingBlockStart" : "paddingBlockEnd"]: STUB,
|
|
378
|
+
}),
|
|
379
|
+
responsive({ gridRow: "var(--ui-fan-row-n)", gridColumn: "var(--ui-fan-col-n)" }),
|
|
380
|
+
], children: [_jsx(Line, { slot: "fan-out-diagram-bus", track: [
|
|
381
|
+
raw({ position: "absolute", [edge]: "0", blockSize: "2px" }),
|
|
382
|
+
...responsive({
|
|
383
|
+
insetInlineStart: "var(--ui-fan-bus-start-n)",
|
|
384
|
+
insetInlineEnd: "var(--ui-fan-bus-end-n)",
|
|
385
|
+
}),
|
|
386
|
+
], filled: fill(frameName(timing, "bus"), "X", timing.busFrom, timing.busTo, "center") }), _jsx(Line, { slot: "fan-out-diagram-rail", track: [
|
|
387
|
+
raw({
|
|
388
|
+
position: "absolute",
|
|
389
|
+
insetInlineStart: `calc(${RAIL_GUTTER} / -2 - 1px)`,
|
|
390
|
+
inlineSize: "2px",
|
|
391
|
+
insetBlockStart: isOut ? "0" : `calc(-1 * ${ROW_GAP})`,
|
|
392
|
+
insetBlockEnd: isOut ? `calc(-1 * ${ROW_GAP})` : "0",
|
|
393
|
+
}),
|
|
394
|
+
...responsive({ display: "var(--ui-fan-rail-n)" }),
|
|
395
|
+
], filled: fill(frameName(timing, "rail"), "Y", timing.busFrom, timing.busTo, "top") }), _jsx(Line, { slot: "fan-out-diagram-stub", track: [
|
|
396
|
+
raw({
|
|
397
|
+
position: "absolute",
|
|
398
|
+
[edge]: "0",
|
|
399
|
+
insetInlineStart: "calc(50% - 1px)",
|
|
400
|
+
inlineSize: "2px",
|
|
401
|
+
blockSize: STUB,
|
|
402
|
+
}),
|
|
403
|
+
], filled: fill(frameName(timing, "stub", index), "Y", stubFrom, stubTo, "top") }), _jsxs("div", { "data-slot": "fan-out-diagram-chip", mix: [
|
|
404
|
+
keyframes(chipName, litFrames(at, off, on)),
|
|
405
|
+
raw({
|
|
406
|
+
display: "grid",
|
|
407
|
+
gridTemplateColumns: "minmax(0, 1fr) auto",
|
|
408
|
+
alignItems: "start",
|
|
409
|
+
columnGap: "0.375rem",
|
|
410
|
+
minInlineSize: "0",
|
|
411
|
+
paddingBlock: "0.5rem",
|
|
412
|
+
paddingInline: "0.625rem",
|
|
413
|
+
border: "1px solid",
|
|
414
|
+
borderRadius: "0.625rem",
|
|
415
|
+
backgroundColor: "var(--ui-bg)",
|
|
416
|
+
...on,
|
|
417
|
+
}),
|
|
418
|
+
motionSafe(raw(loop(chipName))),
|
|
419
|
+
], children: [_jsxs("span", { mix: [raw({ display: "grid", gap: "0.125rem", minInlineSize: "0" })], children: [_jsxs("span", { mix: [
|
|
420
|
+
caption(),
|
|
421
|
+
raw({ display: "flex", alignItems: "center", gap: "0.375rem", minInlineSize: "0" }),
|
|
422
|
+
], children: [target.icon === undefined ? null : (_jsx("span", { "aria-hidden": "true", mix: [
|
|
423
|
+
raw({ display: "inline-flex", flexShrink: "0", color: "var(--ui-brand-fg)" }),
|
|
424
|
+
], children: target.icon })), _jsx("span", { mix: [raw({ minInlineSize: "0", overflowWrap: "anywhere" })], children: target.title })] }), target.detail === undefined ? null : (_jsx("span", { mix: [detail(), lightsIn(frameName(timing, "detail", index), at)], children: target.detail }))] }), _jsx(CheckIcon, { size: 14, strokeWidth: 2.5, "aria-hidden": "true", mix: [
|
|
425
|
+
raw({ marginBlockStart: "0.125rem", color: "var(--ui-success-fg)" }),
|
|
426
|
+
lightsIn(frameName(timing, "check", index), at),
|
|
427
|
+
] })] })] }));
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
/** Fades an element in when its target lights. */
|
|
431
|
+
function lightsIn(name, at) {
|
|
432
|
+
return [
|
|
433
|
+
keyframes(name, litFrames(at, { opacity: "0" }, { opacity: "1" })),
|
|
434
|
+
motionSafe(raw(loop(name))),
|
|
435
|
+
];
|
|
436
|
+
}
|
|
437
|
+
/** The outcome badge, which appears once the last target lit. */
|
|
438
|
+
function outcomeBadge(timing) {
|
|
439
|
+
return [
|
|
440
|
+
raw({
|
|
441
|
+
display: "inline-flex",
|
|
442
|
+
alignItems: "center",
|
|
443
|
+
gap: "0.375rem",
|
|
444
|
+
paddingInline: "0.625rem",
|
|
445
|
+
paddingBlock: "0.25rem",
|
|
446
|
+
borderRadius: "9999px",
|
|
447
|
+
fontSize: "0.8125rem",
|
|
448
|
+
fontWeight: "600",
|
|
449
|
+
color: "var(--ui-success-fg)",
|
|
450
|
+
backgroundColor: "var(--ui-success-bg-tint)",
|
|
451
|
+
}),
|
|
452
|
+
appearsWithOutcome(timing),
|
|
453
|
+
];
|
|
454
|
+
}
|
|
455
|
+
/** Shows an element when the outcome appears, rising slightly into place. */
|
|
456
|
+
function appearsWithOutcome(timing) {
|
|
457
|
+
let name = frameName(timing, "outcome");
|
|
458
|
+
return [
|
|
459
|
+
keyframes(name, litFrames(timing.outcomeAt, { opacity: "0", transform: "translateY(4px)" }, { opacity: "1", transform: "none" })),
|
|
460
|
+
motionSafe(raw(loop(name))),
|
|
461
|
+
];
|
|
462
|
+
}
|
|
463
|
+
/** A caption in the heading ink. */
|
|
464
|
+
function caption() {
|
|
465
|
+
return raw({
|
|
466
|
+
fontSize: "0.875rem",
|
|
467
|
+
lineHeight: "1.25rem",
|
|
468
|
+
fontWeight: "600",
|
|
469
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
470
|
+
overflowWrap: "anywhere",
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
/** The quieter line under a caption, and the footnote. */
|
|
474
|
+
function detail() {
|
|
475
|
+
return raw({
|
|
476
|
+
fontSize: "0.8125rem",
|
|
477
|
+
lineHeight: "1.25rem",
|
|
478
|
+
color: "var(--ui-neutral-fg-muted)",
|
|
479
|
+
overflowWrap: "anywhere",
|
|
480
|
+
});
|
|
481
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* FAQ band: a {@link
|
|
2
|
+
* FAQ band: a {@link LandingHeader} over one or two {@link Accordion}
|
|
3
3
|
* columns. The page supplies every question and answer as accordion children.
|
|
4
4
|
*
|
|
5
5
|
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
6
6
|
* @copyright Sergio Xalambrí 2026
|
|
7
7
|
*/
|
|
8
8
|
import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
9
|
-
import {
|
|
9
|
+
import { LandingSection } from "./landing-section.js";
|
|
10
10
|
/**
|
|
11
11
|
* Prop types for {@link FaqBand}.
|
|
12
12
|
*/
|
|
@@ -16,9 +16,9 @@ export declare namespace FaqBand {
|
|
|
16
16
|
*/
|
|
17
17
|
type Columns = 1 | 2;
|
|
18
18
|
/**
|
|
19
|
-
* Band fill forwarded to {@link
|
|
19
|
+
* Band fill forwarded to {@link LandingSection}.
|
|
20
20
|
*/
|
|
21
|
-
type Tone =
|
|
21
|
+
type Tone = LandingSection.Tone;
|
|
22
22
|
/**
|
|
23
23
|
* Per-part styling for slots the band composes.
|
|
24
24
|
*/
|
|
@@ -33,7 +33,7 @@ export declare namespace FaqBand {
|
|
|
33
33
|
/**
|
|
34
34
|
* Props accepted by {@link FaqBand}.
|
|
35
35
|
*/
|
|
36
|
-
interface Props extends Omit<
|
|
36
|
+
interface Props extends Omit<LandingSection.Props, "children" | "tone" | "title" | "parts"> {
|
|
37
37
|
/** Column count. Defaults to {@link DEFAULT_COLUMNS}. */
|
|
38
38
|
columns?: Columns;
|
|
39
39
|
/** Band fill. Defaults to {@link DEFAULT_TONE}. */
|
|
@@ -55,6 +55,8 @@ export declare namespace FaqBand {
|
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Renders a FAQ band with a chapter header and one or two accordion columns.
|
|
58
|
+
* The column host is the named sizing container; an inner wrapper holds the
|
|
59
|
+
* `@container` tracks so the query can restyle a descendant.
|
|
58
60
|
*
|
|
59
61
|
* @param handle Runtime handle carrying the band's props.
|
|
60
62
|
* @returns The render function producing the band's markup.
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
2
|
import { container, gap, grid, gridTemplate, vstack } from "@sdxc/u/layout";
|
|
3
3
|
import { at } from "@sdxc/u/responsive";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { MarketingSection } from "../components/marketing-section.js";
|
|
4
|
+
import { LandingHeader } from "./landing-header.js";
|
|
5
|
+
import { LandingSection } from "./landing-section.js";
|
|
7
6
|
/** How many accordion columns {@link FaqBand} uses when `columns` is omitted. */
|
|
8
7
|
const DEFAULT_COLUMNS = 1;
|
|
9
8
|
/** Band fill {@link FaqBand} applies when `tone` is omitted. */
|
|
10
9
|
const DEFAULT_TONE = "plain";
|
|
11
10
|
/**
|
|
12
11
|
* Renders a FAQ band with a chapter header and one or two accordion columns.
|
|
12
|
+
* The column host is the named sizing container; an inner wrapper holds the
|
|
13
|
+
* `@container` tracks so the query can restyle a descendant.
|
|
13
14
|
*
|
|
14
15
|
* @param handle Runtime handle carrying the band's props.
|
|
15
16
|
* @returns The render function producing the band's markup.
|
|
@@ -26,18 +27,16 @@ export function FaqBand(handle) {
|
|
|
26
27
|
let resolvedTone = tone ?? DEFAULT_TONE;
|
|
27
28
|
let resolvedSpacing = spacing ?? "normal";
|
|
28
29
|
let isTwo = resolvedColumns === 2;
|
|
29
|
-
return (_jsx(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
container("ui-marketing-faq"),
|
|
30
|
+
return (_jsx(LandingSection, { ...rest, tone: resolvedTone, spacing: resolvedSpacing, ruled: ruled, mix: mix, children: _jsxs("div", { mix: [vstack({ gap: 0, align: "stretch" })], children: [_jsx(LandingHeader, { eyebrow: eyebrow, description: description, parts: {
|
|
31
|
+
title: parts?.title,
|
|
32
|
+
description: parts?.description,
|
|
33
|
+
}, children: title }), _jsx("div", { "data-columns": String(resolvedColumns), mix: [container("ui-landing-faq"), parts?.columns], children: _jsx("div", { mix: [
|
|
34
34
|
grid(),
|
|
35
|
-
gap(8),
|
|
35
|
+
gap(0, 8),
|
|
36
36
|
gridTemplate({ columns: "minmax(0, 1fr)" }),
|
|
37
37
|
isTwo
|
|
38
|
-
? at("
|
|
38
|
+
? at("xl", "ui-landing-faq", gridTemplate({ columns: "minmax(0, 1fr) minmax(0, 1fr)" }))
|
|
39
39
|
: [],
|
|
40
|
-
|
|
41
|
-
], children: children })] }) }) }));
|
|
40
|
+
], children: children }) })] }) }));
|
|
42
41
|
};
|
|
43
42
|
}
|