@sdxc/ui 2026.10.30 → 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 +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/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 -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/stat-strip.js +0 -65
- 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/{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,182 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { fg } from "@sdxc/u/color";
|
|
3
|
+
import { rounded } from "@sdxc/u/effects";
|
|
4
|
+
import { combine, counterIncrement, counterReset, pseudoContent, raw, mergeMix, } from "@sdxc/u/general";
|
|
5
|
+
import { absolute, container, gap, grid, gridTemplate, inlineFlex, items, justify, relative, vstack, } from "@sdxc/u/layout";
|
|
6
|
+
import { at } from "@sdxc/u/responsive";
|
|
7
|
+
import { bs, is, m, mbe } from "@sdxc/u/size";
|
|
8
|
+
import { after, before, not } from "@sdxc/u/state";
|
|
9
|
+
import { balance, font, leading, pretty, text, textAlign, weight } from "@sdxc/u/typography";
|
|
10
|
+
import { HeadingScope, resolveHeadingLevel, TAG_BY_LEVEL } from "../components/heading-scope.js";
|
|
11
|
+
import { landingEmphasis } from "../styles/landing.js";
|
|
12
|
+
/** Look {@link StepList} draws when `variant` is omitted. */
|
|
13
|
+
const DEFAULT_VARIANT = "numbered";
|
|
14
|
+
/** Container the list's tracks and each timeline step's media column query. */
|
|
15
|
+
const LIST_CONTAINER = "ui-landing-step-list";
|
|
16
|
+
/** Translucent line connectors and the timeline rule draw with. */
|
|
17
|
+
const HAIRLINE = "var(--ui-landing-hairline, color-mix(in oklch, CanvasText 8%, transparent))";
|
|
18
|
+
/** Space between the timeline rule and a step's copy. */
|
|
19
|
+
const TIMELINE_INSET = "2rem";
|
|
20
|
+
/**
|
|
21
|
+
* Lays steps in a responsive track. A sizing wrapper is the named container; the `<ol>`
|
|
22
|
+
* holds the grid so the query can restyle a descendant. A numbered list sets every step in
|
|
23
|
+
* one row from `xl` (64rem) with connectors between them; a timeline stays one column.
|
|
24
|
+
*
|
|
25
|
+
* @param handle Runtime handle carrying the host `<ol>`'s props and providing {@link StepList.Context}.
|
|
26
|
+
* @returns The render function producing the list's markup.
|
|
27
|
+
* @example
|
|
28
|
+
* <StepList>
|
|
29
|
+
* <StepList.Item title={t("step.one")}>{t("step.one.body")}</StepList.Item>
|
|
30
|
+
* </StepList>
|
|
31
|
+
* @example
|
|
32
|
+
* <StepList variant="timeline">
|
|
33
|
+
* <StepList.Item meta="14:02 UTC" title={t("incident.detect")} media={probeCard}>
|
|
34
|
+
* {t("incident.detect.body")}
|
|
35
|
+
* </StepList.Item>
|
|
36
|
+
* </StepList>
|
|
37
|
+
*/
|
|
38
|
+
export function StepList(handle) {
|
|
39
|
+
return () => {
|
|
40
|
+
let { children, mix, variant, ...rest } = handle.props;
|
|
41
|
+
let resolvedVariant = variant ?? DEFAULT_VARIANT;
|
|
42
|
+
handle.context.set({ variant: resolvedVariant });
|
|
43
|
+
return (_jsx("div", { mix: [container(LIST_CONTAINER)], children: _jsx(HeadingScope, { children: _jsx("ol", { ...rest, "data-slot": "step-list", "data-variant": resolvedVariant, mix: mergeMix([
|
|
44
|
+
counterReset("ui-landing-step"),
|
|
45
|
+
raw({ listStyle: "none", padding: "0", margin: "0" }),
|
|
46
|
+
grid(),
|
|
47
|
+
resolvedVariant === "timeline"
|
|
48
|
+
? [gap(0), gridTemplate({ columns: "minmax(0, 1fr)" })]
|
|
49
|
+
: [
|
|
50
|
+
gap(8),
|
|
51
|
+
/**
|
|
52
|
+
* Every step shares one row from the `xl` container, whatever the count,
|
|
53
|
+
* so connectors run step to step and no row is left short.
|
|
54
|
+
*/
|
|
55
|
+
combine([
|
|
56
|
+
gridTemplate({ columns: "minmax(0, 1fr)" }),
|
|
57
|
+
at("xl", LIST_CONTAINER, raw({
|
|
58
|
+
gridTemplateColumns: "none",
|
|
59
|
+
gridAutoFlow: "column",
|
|
60
|
+
gridAutoColumns: "minmax(0, 1fr)",
|
|
61
|
+
})),
|
|
62
|
+
]),
|
|
63
|
+
],
|
|
64
|
+
], mix), children: children }) }) }));
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Numbered step: a quiet ringed disc with the step number, then the title and copy. The
|
|
69
|
+
* connector to the next step runs between the two discs once the list lays out in columns.
|
|
70
|
+
*/
|
|
71
|
+
function numberedStep() {
|
|
72
|
+
return [
|
|
73
|
+
relative(),
|
|
74
|
+
vstack({ align: "center", gap: 4 }),
|
|
75
|
+
textAlign("center"),
|
|
76
|
+
counterIncrement("ui-landing-step"),
|
|
77
|
+
before([
|
|
78
|
+
pseudoContent("counter(ui-landing-step)"),
|
|
79
|
+
inlineFlex(),
|
|
80
|
+
items("center"),
|
|
81
|
+
justify("center"),
|
|
82
|
+
is(10),
|
|
83
|
+
bs(10),
|
|
84
|
+
mbe(2),
|
|
85
|
+
rounded("full"),
|
|
86
|
+
raw({
|
|
87
|
+
backgroundColor: "transparent",
|
|
88
|
+
boxShadow: `inset 0 0 0 1px ${HAIRLINE}`,
|
|
89
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
90
|
+
}),
|
|
91
|
+
text("base"),
|
|
92
|
+
weight("semibold"),
|
|
93
|
+
]),
|
|
94
|
+
not(":last-child", after(combine([
|
|
95
|
+
pseudoContent('""'),
|
|
96
|
+
absolute(),
|
|
97
|
+
raw({
|
|
98
|
+
insetBlockStart: "1.25rem",
|
|
99
|
+
insetInlineStart: "calc(50% + 1.75rem)",
|
|
100
|
+
inlineSize: "calc(100% - 1.5rem)",
|
|
101
|
+
blockSize: "1px",
|
|
102
|
+
backgroundColor: HAIRLINE,
|
|
103
|
+
display: "none",
|
|
104
|
+
}),
|
|
105
|
+
at("xl", LIST_CONTAINER, raw({ display: "block" })),
|
|
106
|
+
]))),
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Timeline step: a hairline rule down the inline-start edge with a square brand marker
|
|
111
|
+
* centred on the step's first line — the timestamp when there is one, else the title.
|
|
112
|
+
*
|
|
113
|
+
* @param hasMeta Whether the step opens with a timestamp line.
|
|
114
|
+
*/
|
|
115
|
+
function timelineStep(hasMeta) {
|
|
116
|
+
return [
|
|
117
|
+
relative(),
|
|
118
|
+
raw({ paddingInlineStart: TIMELINE_INSET, paddingBlockEnd: "2.5rem" }),
|
|
119
|
+
textAlign("start"),
|
|
120
|
+
counterIncrement("ui-landing-step"),
|
|
121
|
+
before([
|
|
122
|
+
pseudoContent('""'),
|
|
123
|
+
absolute(),
|
|
124
|
+
raw({
|
|
125
|
+
insetBlock: "0",
|
|
126
|
+
insetInlineStart: "calc(0.25rem - 0.5px)",
|
|
127
|
+
inlineSize: "1px",
|
|
128
|
+
backgroundColor: HAIRLINE,
|
|
129
|
+
}),
|
|
130
|
+
]),
|
|
131
|
+
after([
|
|
132
|
+
pseudoContent('""'),
|
|
133
|
+
absolute(),
|
|
134
|
+
raw({
|
|
135
|
+
insetInlineStart: "0",
|
|
136
|
+
insetBlockStart: hasMeta ? "0.25rem" : "0.5rem",
|
|
137
|
+
inlineSize: "0.5rem",
|
|
138
|
+
blockSize: "0.5rem",
|
|
139
|
+
backgroundColor: "var(--ui-brand-bg-solid)",
|
|
140
|
+
}),
|
|
141
|
+
]),
|
|
142
|
+
];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* One step. In a numbered list: a ringed number disc, a title, and supporting copy. In a
|
|
146
|
+
* timeline: an optional timestamp, a title and copy, with optional media beside the copy
|
|
147
|
+
* from the `lg` container up (copy 5fr, media 7fr) and under it below.
|
|
148
|
+
*
|
|
149
|
+
* @param handle Runtime handle carrying the host `<li>`'s props.
|
|
150
|
+
* @returns The render function producing the step's markup.
|
|
151
|
+
*/
|
|
152
|
+
StepList.Item = function StepListItem(handle) {
|
|
153
|
+
return () => {
|
|
154
|
+
let { children, media, meta, mix, title, ...rest } = handle.props;
|
|
155
|
+
let context = handle.context.get(StepList);
|
|
156
|
+
let resolved = resolveHeadingLevel(handle);
|
|
157
|
+
let Tag = TAG_BY_LEVEL[resolved];
|
|
158
|
+
if (context?.variant !== "timeline") {
|
|
159
|
+
return (_jsxs("li", { ...rest, "data-slot": "step-list-item", mix: mergeMix(numberedStep(), mix), children: [_jsx(Tag, { "data-slot": "step-list-title", "data-heading-level": resolved, mix: [m(0), text("xl"), balance(), weight("medium"), fg("neutral.emphasis")], children: title }), _jsx("div", { mix: [text("base"), leading("relaxed"), pretty(), fg("neutral")], children: children })] }));
|
|
160
|
+
}
|
|
161
|
+
let hasMeta = meta !== undefined && meta !== null;
|
|
162
|
+
let copy = (_jsxs("div", { "data-slot": "step-list-copy", mix: [vstack({ gap: 2, align: "stretch" })], children: [hasMeta ? (_jsx("p", { "data-slot": "step-list-meta", mix: [m(0), font("mono"), text("xs"), raw({ lineHeight: "1rem" }), fg("neutral.muted")], children: meta })) : null, _jsx(Tag, { "data-slot": "step-list-title", "data-heading-level": resolved, mix: [
|
|
163
|
+
m(0),
|
|
164
|
+
raw({ fontSize: "1rem", lineHeight: "1.5rem" }),
|
|
165
|
+
balance(),
|
|
166
|
+
weight("semibold"),
|
|
167
|
+
fg("neutral.emphasis"),
|
|
168
|
+
], children: title }), _jsx("div", { mix: [
|
|
169
|
+
raw({ fontSize: "1rem", lineHeight: "1.5rem" }),
|
|
170
|
+
pretty(),
|
|
171
|
+
fg("neutral"),
|
|
172
|
+
landingEmphasis(),
|
|
173
|
+
], children: children })] }));
|
|
174
|
+
return (_jsx("li", { ...rest, "data-slot": "step-list-item", "data-has-media": media ? "true" : undefined, mix: mergeMix(timelineStep(hasMeta), mix), children: media ? (_jsxs("div", { mix: [
|
|
175
|
+
combine([
|
|
176
|
+
grid(),
|
|
177
|
+
raw({ gap: "1rem", gridTemplateColumns: "minmax(0, 1fr)" }),
|
|
178
|
+
at("lg", LIST_CONTAINER, raw({ gridTemplateColumns: "minmax(0, 5fr) minmax(0, 7fr)", columnGap: "3rem" })),
|
|
179
|
+
]),
|
|
180
|
+
], children: [copy, _jsx("div", { "data-slot": "step-list-media", children: media })] })) : (copy) }));
|
|
181
|
+
};
|
|
182
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The card-grid recipe {@link Feature.Grid} and {@link Bento} share: column steps,
|
|
3
|
+
* raised cells with concentric outer corners, orphan spans, cell padding the media
|
|
4
|
+
* slot reads back, and the quiet or brand glyph tile.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { UtilityInput, UtilityMixin } from "@sdxc/u";
|
|
10
|
+
/** Side of a claim's glyph tile on the spacing scale (2.5rem), shared by every claim icon. */
|
|
11
|
+
export declare const ICON_TILE_SIDE = 10;
|
|
12
|
+
/**
|
|
13
|
+
* Options accepted by {@link cardGrid}.
|
|
14
|
+
*/
|
|
15
|
+
export interface CardGridOptions {
|
|
16
|
+
/** Columns at the `lg` container; the grid shows one track on a phone and two from `md`. */
|
|
17
|
+
columns: number;
|
|
18
|
+
/** Separate raised cards, one hairline-ruled mosaic box, or an un-carded `list`. */
|
|
19
|
+
variant: "cards" | "mosaic" | "list";
|
|
20
|
+
/** Named sizing container on the grid's host that the column steps query. */
|
|
21
|
+
containerName: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Lays a grid's direct children as cards or a mosaic in one class, so the
|
|
25
|
+
* cell fill, edge and per-corner radii never compete across cascade layers.
|
|
26
|
+
* A lone last cell spans the rest of its row at every step, unless the cells set
|
|
27
|
+
* their own `data-span` or the grid is a `list`. In `cards`, the
|
|
28
|
+
* corners on the grid's outer edge take `--ui-landing-card-radius-outer`;
|
|
29
|
+
* once any cell carries `data-corner`, the `lg` step rounds only the corners
|
|
30
|
+
* those cells list, so a page with custom spans names its own outer corners.
|
|
31
|
+
*
|
|
32
|
+
* @param options Column count, chrome and the container the steps query.
|
|
33
|
+
* @returns One mixin for the element whose children are the cells.
|
|
34
|
+
* @example
|
|
35
|
+
* <div mix={[cardGrid({ columns: 3, variant: "cards", containerName: "ui-landing-bento" })]}>{cells}</div>
|
|
36
|
+
*/
|
|
37
|
+
export declare function cardGrid<Node extends Element = Element>({ columns, variant, containerName, }: CardGridOptions): UtilityMixin<Node>;
|
|
38
|
+
/**
|
|
39
|
+
* One container range of a {@link balancedGrid}: the query that selects it and the
|
|
40
|
+
* most items one row holds there.
|
|
41
|
+
*/
|
|
42
|
+
export interface BalancedGridStep {
|
|
43
|
+
/** Container size query, such as `(36rem <= width < 48rem)`. */
|
|
44
|
+
query: string;
|
|
45
|
+
/** The most items one row holds in this range. */
|
|
46
|
+
columns: number;
|
|
47
|
+
/**
|
|
48
|
+
* Columns for a run of exactly `count` items in this range, where the even split
|
|
49
|
+
* would still leave a short row the layout should not show.
|
|
50
|
+
*/
|
|
51
|
+
columnsFor?: (count: number) => number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The column count that splits `count` items into the fewest rows of at most
|
|
55
|
+
* `columns` while keeping the rows as even as possible: 6 in at most 4 is 3 + 3,
|
|
56
|
+
* 5 in at most 4 is 3 + 2.
|
|
57
|
+
*
|
|
58
|
+
* @param count Items in the run.
|
|
59
|
+
* @param columns The most items one row may hold.
|
|
60
|
+
* @returns Columns between 1 and `columns`.
|
|
61
|
+
*/
|
|
62
|
+
export declare function balancedColumns(count: number, columns: number): number;
|
|
63
|
+
/**
|
|
64
|
+
* Applies `build(count)` to an element whose direct children number exactly
|
|
65
|
+
* `count`, for every count up to {@link BALANCED_MAX_COUNT}; a longer run keeps the
|
|
66
|
+
* rules written outside it.
|
|
67
|
+
*
|
|
68
|
+
* @param build Styles for a run of that many children.
|
|
69
|
+
* @returns One quantity rule per count.
|
|
70
|
+
*/
|
|
71
|
+
export declare function byChildCount<Node extends Element = Element>(build: (count: number) => UtilityInput<Node>): UtilityMixin<Node>[];
|
|
72
|
+
/**
|
|
73
|
+
* Lays direct children in rows that are full or centred: each step picks the even
|
|
74
|
+
* column count for the run ({@link balancedColumns}), and a shorter last row sits
|
|
75
|
+
* in the middle at one column per item. Tracks are doubled so a centred row can
|
|
76
|
+
* start half a column in; the element must leave `grid-template-columns` and the
|
|
77
|
+
* children's `grid-column` to this mixin.
|
|
78
|
+
*
|
|
79
|
+
* @param containerName Named sizing container the steps query.
|
|
80
|
+
* @param steps Container ranges, each with the most items a row holds there.
|
|
81
|
+
* @param rowStart Extra styles for the first item of a centred last row, such as the edge it now exposes.
|
|
82
|
+
* @returns One mixin for the element whose children are the items.
|
|
83
|
+
* @example
|
|
84
|
+
* <div mix={[grid(), balancedGrid("ui-logos", [{ query: "(width < 30rem)", columns: 2 }, { query: "(width >= 30rem)", columns: 4 }])]}>{marks}</div>
|
|
85
|
+
*/
|
|
86
|
+
export declare function balancedGrid<Node extends Element = Element>(containerName: string, steps: ReadonlyArray<BalancedGridStep>, rowStart?: UtilityInput<Node>): UtilityMixin<Node>;
|
|
87
|
+
/**
|
|
88
|
+
* Pads a card cell through custom properties that {@link cardMedia} reads back,
|
|
89
|
+
* so the media slot bleeds to the cell's edges at every padding step.
|
|
90
|
+
*
|
|
91
|
+
* @param block Block padding below the `lg` step.
|
|
92
|
+
* @param inline Inline padding below the `lg` step.
|
|
93
|
+
* @param wide Padding on both axes from the `lg` container.
|
|
94
|
+
* @param containerName Named container the `lg` step queries; omitted queries the nearest one.
|
|
95
|
+
* @returns One mixin for the cell.
|
|
96
|
+
*/
|
|
97
|
+
export declare function cardPadding<Node extends Element = Element>(block: string, inline: string, wide: string, containerName?: string): UtilityMixin<Node>;
|
|
98
|
+
/**
|
|
99
|
+
* Draws a cell's top media edge to edge, fading its lower half into the cell
|
|
100
|
+
* fill, and drops it below the `md` container where a phone has no room for
|
|
101
|
+
* the illustration.
|
|
102
|
+
*
|
|
103
|
+
* @returns One mixin for the media wrapper, placed first in the cell.
|
|
104
|
+
*/
|
|
105
|
+
export declare function cardMedia<Node extends Element = Element>(): UtilityMixin<Node>;
|
|
106
|
+
/**
|
|
107
|
+
* Centers a glyph in a square tile so claim icons share one size language.
|
|
108
|
+
* `quiet` frames it with a hairline ring in the heading ink; `brand` paints
|
|
109
|
+
* the tinted, bordered badge.
|
|
110
|
+
*
|
|
111
|
+
* @param tone Tile chrome.
|
|
112
|
+
* @param side Side length on the spacing scale.
|
|
113
|
+
* @returns One mixin for the tile.
|
|
114
|
+
*/
|
|
115
|
+
export declare function iconTile<Node extends Element = Element>(tone: "quiet" | "brand", side: number): UtilityMixin<Node>;
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The card-grid recipe {@link Feature.Grid} and {@link Bento} share: column steps,
|
|
3
|
+
* raised cells with concentric outer corners, orphan spans, cell padding the media
|
|
4
|
+
* slot reads back, and the quiet or brand glyph tile.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import { bg, border, fg } from "@sdxc/u/color";
|
|
10
|
+
import { rounded } from "@sdxc/u/effects";
|
|
11
|
+
import { combine, raw } from "@sdxc/u/general";
|
|
12
|
+
import { center, gap, grid, inlineFlex } from "@sdxc/u/layout";
|
|
13
|
+
import { at } from "@sdxc/u/responsive";
|
|
14
|
+
import { bs, is } from "@sdxc/u/size";
|
|
15
|
+
import { when } from "@sdxc/u/state";
|
|
16
|
+
/** Translucent ink line shared by the mosaic rules and the quiet icon ring. */
|
|
17
|
+
const HAIRLINE = "var(--ui-landing-hairline, color-mix(in oklch, CanvasText 8%, transparent))";
|
|
18
|
+
/** Radius of a card corner that sits on the grid's outer edge. */
|
|
19
|
+
const OUTER_RADIUS = "var(--ui-landing-card-radius-outer, 1.5rem)";
|
|
20
|
+
/**
|
|
21
|
+
* Radius of a card corner that faces a neighbouring card; a page that wants every corner
|
|
22
|
+
* alike sets `--ui-landing-card-radius-inner` to the outer radius.
|
|
23
|
+
*/
|
|
24
|
+
const INNER_RADIUS = "var(--ui-landing-card-radius-inner, 0.5rem)";
|
|
25
|
+
/** Custom property holding a card cell's block padding, read back by the media slot. */
|
|
26
|
+
const PADDING_BLOCK = "--ui-landing-cell-padding-block";
|
|
27
|
+
/** Custom property holding a card cell's inline padding, read back by the media slot. */
|
|
28
|
+
const PADDING_INLINE = "--ui-landing-cell-padding-inline";
|
|
29
|
+
/**
|
|
30
|
+
* The three column steps every card grid walks: one track on a phone, two from
|
|
31
|
+
* the `md` container (36rem), the requested count from `lg` (48rem). Ranges keep
|
|
32
|
+
* each step's spans and corners from leaking into the next.
|
|
33
|
+
*/
|
|
34
|
+
const GRID_STEPS = [
|
|
35
|
+
{ query: "(width < 36rem)", columns: () => 1 },
|
|
36
|
+
{ query: "(36rem <= width < 48rem)", columns: (requested) => Math.min(2, requested) },
|
|
37
|
+
{ query: "(width >= 48rem)", columns: (requested) => requested },
|
|
38
|
+
];
|
|
39
|
+
/** Side of a claim's glyph tile on the spacing scale (2.5rem), shared by every claim icon. */
|
|
40
|
+
export const ICON_TILE_SIDE = 10;
|
|
41
|
+
/** Longest run of children the quantity rules tune; a longer one keeps each step's full count. */
|
|
42
|
+
const BALANCED_MAX_COUNT = 12;
|
|
43
|
+
/** Corner names a page lists in a cell's `data-corner`, and the radius each one sets. */
|
|
44
|
+
const CORNER_PROPERTIES = [
|
|
45
|
+
["start-start", "borderStartStartRadius"],
|
|
46
|
+
["start-end", "borderStartEndRadius"],
|
|
47
|
+
["end-start", "borderEndStartRadius"],
|
|
48
|
+
["end-end", "borderEndEndRadius"],
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* Lays a grid's direct children as cards or a mosaic in one class, so the
|
|
52
|
+
* cell fill, edge and per-corner radii never compete across cascade layers.
|
|
53
|
+
* A lone last cell spans the rest of its row at every step, unless the cells set
|
|
54
|
+
* their own `data-span` or the grid is a `list`. In `cards`, the
|
|
55
|
+
* corners on the grid's outer edge take `--ui-landing-card-radius-outer`;
|
|
56
|
+
* once any cell carries `data-corner`, the `lg` step rounds only the corners
|
|
57
|
+
* those cells list, so a page with custom spans names its own outer corners.
|
|
58
|
+
*
|
|
59
|
+
* @param options Column count, chrome and the container the steps query.
|
|
60
|
+
* @returns One mixin for the element whose children are the cells.
|
|
61
|
+
* @example
|
|
62
|
+
* <div mix={[cardGrid({ columns: 3, variant: "cards", containerName: "ui-landing-bento" })]}>{cells}</div>
|
|
63
|
+
*/
|
|
64
|
+
export function cardGrid({ columns, variant, containerName, }) {
|
|
65
|
+
let isCards = variant === "cards";
|
|
66
|
+
let steps = GRID_STEPS.map((step) => {
|
|
67
|
+
let count = step.columns(columns);
|
|
68
|
+
let widest = step === GRID_STEPS[GRID_STEPS.length - 1];
|
|
69
|
+
return when(`@container ${containerName} ${step.query}`, [
|
|
70
|
+
raw({ gridTemplateColumns: `repeat(${count}, minmax(0, 1fr))` }),
|
|
71
|
+
variant === "list" ? null : orphanSpans(count),
|
|
72
|
+
cellSpans(count),
|
|
73
|
+
isCards ? outerCorners(count, widest) : null,
|
|
74
|
+
]);
|
|
75
|
+
});
|
|
76
|
+
return combine([grid(), raw({ textAlign: "start" }), cellChrome(variant), steps]);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The chrome a grid variant draws: raised cards on a 1rem gap, a mosaic box whose
|
|
80
|
+
* 1px gaps rule flush cells, or a `list` of bare cells on wide gaps.
|
|
81
|
+
*
|
|
82
|
+
* @param variant Grid chrome.
|
|
83
|
+
* @returns The rules for the grid and its cells.
|
|
84
|
+
*/
|
|
85
|
+
function cellChrome(variant) {
|
|
86
|
+
if (variant === "list")
|
|
87
|
+
return raw({ columnGap: "2.5rem", rowGap: "3rem" });
|
|
88
|
+
if (variant === "cards") {
|
|
89
|
+
return [
|
|
90
|
+
gap(4),
|
|
91
|
+
when("& > *", raw({
|
|
92
|
+
backgroundColor: "var(--ui-surface-raised, Canvas)",
|
|
93
|
+
boxShadow: "var(--ui-shadow-surface, 0 0 0 1px rgb(0 0 0 / 0.06))",
|
|
94
|
+
borderRadius: INNER_RADIUS,
|
|
95
|
+
overflow: "hidden",
|
|
96
|
+
})),
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
return [
|
|
100
|
+
gap("1px"),
|
|
101
|
+
rounded("xl"),
|
|
102
|
+
raw({
|
|
103
|
+
overflow: "hidden",
|
|
104
|
+
backgroundColor: HAIRLINE,
|
|
105
|
+
boxShadow: `0 0 0 1px ${HAIRLINE}`,
|
|
106
|
+
}),
|
|
107
|
+
when("& > *", raw({ backgroundColor: "var(--ui-surface-raised, Canvas)" })),
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Widens a cell carrying `data-span` across that many tracks, capped at the step's
|
|
112
|
+
* count, for a grid of mixed spans.
|
|
113
|
+
*
|
|
114
|
+
* @param count Tracks at this step.
|
|
115
|
+
* @returns The span rules for the step.
|
|
116
|
+
*/
|
|
117
|
+
function cellSpans(count) {
|
|
118
|
+
if (count < 2)
|
|
119
|
+
return [];
|
|
120
|
+
return [2, 3].map((span) => when(`& > [data-span="${span}"]`, raw({ gridColumn: span >= count ? "1 / -1" : `span ${span}` })));
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Spans a lone last cell across what its row leaves free, so a short last row
|
|
124
|
+
* never strands an empty track. A grid whose cells set their own spans is left as the
|
|
125
|
+
* page laid it out.
|
|
126
|
+
*
|
|
127
|
+
* @param count Tracks at this step.
|
|
128
|
+
* @returns One `grid-column` rule per possible short-row length.
|
|
129
|
+
*/
|
|
130
|
+
function orphanSpans(count) {
|
|
131
|
+
let rules = [];
|
|
132
|
+
for (let filled = 1; filled < count; filled++) {
|
|
133
|
+
rules.push(when(`&:not(:has(> [data-span])) > :last-child:nth-child(${count}n + ${filled})`, raw({ gridColumn: filled === 1 ? "1 / -1" : `span ${count - filled + 1}` })));
|
|
134
|
+
}
|
|
135
|
+
return rules;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Rounds the corners that sit on the grid's outer edge for a plain grid of
|
|
139
|
+
* `count` tracks whose short last row ends in a spanning cell: the first cell's
|
|
140
|
+
* start-start, the cell closing the first row, the cell opening the last row
|
|
141
|
+
* and the last cell's end-end. At the widest step a `data-corner` cell hands
|
|
142
|
+
* that choice to the page.
|
|
143
|
+
*
|
|
144
|
+
* @param count Tracks at this step.
|
|
145
|
+
* @param explicit Whether `data-corner` takes over at this step.
|
|
146
|
+
* @returns The corner rules for the step.
|
|
147
|
+
*/
|
|
148
|
+
function outerCorners(count, explicit) {
|
|
149
|
+
let auto = explicit ? "&:not(:has(> [data-corner])) >" : "& >";
|
|
150
|
+
let rules = [
|
|
151
|
+
when(`${auto} :first-child`, raw({ borderStartStartRadius: OUTER_RADIUS })),
|
|
152
|
+
when(`${auto} :is(:nth-child(${count}), :last-child:nth-child(-n + ${count}))`, raw({ borderStartEndRadius: OUTER_RADIUS })),
|
|
153
|
+
when(`${auto} :nth-child(${count}n + 1):nth-last-child(-n + ${count})`, raw({ borderEndStartRadius: OUTER_RADIUS })),
|
|
154
|
+
when(`${auto} :last-child`, raw({ borderEndEndRadius: OUTER_RADIUS })),
|
|
155
|
+
];
|
|
156
|
+
if (!explicit)
|
|
157
|
+
return rules;
|
|
158
|
+
for (let [corner, property] of CORNER_PROPERTIES) {
|
|
159
|
+
rules.push(when(`& > [data-corner~="${corner}"]`, raw({ [property]: OUTER_RADIUS })));
|
|
160
|
+
}
|
|
161
|
+
return rules;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The column count that splits `count` items into the fewest rows of at most
|
|
165
|
+
* `columns` while keeping the rows as even as possible: 6 in at most 4 is 3 + 3,
|
|
166
|
+
* 5 in at most 4 is 3 + 2.
|
|
167
|
+
*
|
|
168
|
+
* @param count Items in the run.
|
|
169
|
+
* @param columns The most items one row may hold.
|
|
170
|
+
* @returns Columns between 1 and `columns`.
|
|
171
|
+
*/
|
|
172
|
+
export function balancedColumns(count, columns) {
|
|
173
|
+
if (count <= columns)
|
|
174
|
+
return Math.max(1, count);
|
|
175
|
+
return Math.ceil(count / Math.ceil(count / columns));
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Applies `build(count)` to an element whose direct children number exactly
|
|
179
|
+
* `count`, for every count up to {@link BALANCED_MAX_COUNT}; a longer run keeps the
|
|
180
|
+
* rules written outside it.
|
|
181
|
+
*
|
|
182
|
+
* @param build Styles for a run of that many children.
|
|
183
|
+
* @returns One quantity rule per count.
|
|
184
|
+
*/
|
|
185
|
+
export function byChildCount(build) {
|
|
186
|
+
let rules = [];
|
|
187
|
+
for (let count = 1; count <= BALANCED_MAX_COUNT; count++) {
|
|
188
|
+
rules.push(when(`&:has(> :nth-child(${count}):last-child)`, build(count)));
|
|
189
|
+
}
|
|
190
|
+
return rules;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Lays direct children in rows that are full or centred: each step picks the even
|
|
194
|
+
* column count for the run ({@link balancedColumns}), and a shorter last row sits
|
|
195
|
+
* in the middle at one column per item. Tracks are doubled so a centred row can
|
|
196
|
+
* start half a column in; the element must leave `grid-template-columns` and the
|
|
197
|
+
* children's `grid-column` to this mixin.
|
|
198
|
+
*
|
|
199
|
+
* @param containerName Named sizing container the steps query.
|
|
200
|
+
* @param steps Container ranges, each with the most items a row holds there.
|
|
201
|
+
* @param rowStart Extra styles for the first item of a centred last row, such as the edge it now exposes.
|
|
202
|
+
* @returns One mixin for the element whose children are the items.
|
|
203
|
+
* @example
|
|
204
|
+
* <div mix={[grid(), balancedGrid("ui-logos", [{ query: "(width < 30rem)", columns: 2 }, { query: "(width >= 30rem)", columns: 4 }])]}>{marks}</div>
|
|
205
|
+
*/
|
|
206
|
+
export function balancedGrid(containerName, steps, rowStart) {
|
|
207
|
+
return combine(steps.map((step) => when(`@container ${containerName} ${step.query}`, [
|
|
208
|
+
centredRows(step.columns, rowStart),
|
|
209
|
+
byChildCount((count) => centredRows(step.columnsFor?.(count) ?? balancedColumns(count, step.columns), rowStart)),
|
|
210
|
+
])));
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Doubled tracks for `columns` items a row, each item spanning two, with the first
|
|
214
|
+
* item of a short last row pushed in by the half-tracks the row leaves free.
|
|
215
|
+
*
|
|
216
|
+
* @param columns Items in a full row.
|
|
217
|
+
* @param rowStart Extra styles for the first item of a centred last row.
|
|
218
|
+
* @returns The rules for one column count.
|
|
219
|
+
*/
|
|
220
|
+
function centredRows(columns, rowStart) {
|
|
221
|
+
let rules = [
|
|
222
|
+
raw({ gridTemplateColumns: `repeat(${columns * 2}, minmax(0, 1fr))` }),
|
|
223
|
+
when("& > *", raw({ gridColumn: "span 2" })),
|
|
224
|
+
];
|
|
225
|
+
for (let short = 1; short < columns; short++) {
|
|
226
|
+
rules.push(when(`& > :nth-child(${columns}n + 1):nth-last-child(${short})`, [
|
|
227
|
+
raw({ gridColumn: `${columns - short + 1} / span 2` }),
|
|
228
|
+
rowStart ?? [],
|
|
229
|
+
]));
|
|
230
|
+
}
|
|
231
|
+
return rules;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Pads a card cell through custom properties that {@link cardMedia} reads back,
|
|
235
|
+
* so the media slot bleeds to the cell's edges at every padding step.
|
|
236
|
+
*
|
|
237
|
+
* @param block Block padding below the `lg` step.
|
|
238
|
+
* @param inline Inline padding below the `lg` step.
|
|
239
|
+
* @param wide Padding on both axes from the `lg` container.
|
|
240
|
+
* @param containerName Named container the `lg` step queries; omitted queries the nearest one.
|
|
241
|
+
* @returns One mixin for the cell.
|
|
242
|
+
*/
|
|
243
|
+
export function cardPadding(block, inline, wide, containerName) {
|
|
244
|
+
let wideVars = raw({ [PADDING_BLOCK]: wide, [PADDING_INLINE]: wide });
|
|
245
|
+
return combine([
|
|
246
|
+
raw({
|
|
247
|
+
[PADDING_BLOCK]: block,
|
|
248
|
+
[PADDING_INLINE]: inline,
|
|
249
|
+
paddingBlock: `var(${PADDING_BLOCK})`,
|
|
250
|
+
paddingInline: `var(${PADDING_INLINE})`,
|
|
251
|
+
}),
|
|
252
|
+
containerName ? at("lg", containerName, wideVars) : at("lg", wideVars),
|
|
253
|
+
]);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Draws a cell's top media edge to edge, fading its lower half into the cell
|
|
257
|
+
* fill, and drops it below the `md` container where a phone has no room for
|
|
258
|
+
* the illustration.
|
|
259
|
+
*
|
|
260
|
+
* @returns One mixin for the media wrapper, placed first in the cell.
|
|
261
|
+
*/
|
|
262
|
+
export function cardMedia() {
|
|
263
|
+
return combine([
|
|
264
|
+
raw({
|
|
265
|
+
display: "none",
|
|
266
|
+
marginBlockStart: `calc(-1 * var(${PADDING_BLOCK}, 0px))`,
|
|
267
|
+
marginInline: `calc(-1 * var(${PADDING_INLINE}, 0px))`,
|
|
268
|
+
overflow: "hidden",
|
|
269
|
+
maskImage: "linear-gradient(to bottom, black 50%, transparent)",
|
|
270
|
+
}),
|
|
271
|
+
when("& > :is(img, svg, video, picture)", raw({ display: "block", inlineSize: "100%", blockSize: "auto" })),
|
|
272
|
+
at("md", raw({ display: "block" })),
|
|
273
|
+
]);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Centers a glyph in a square tile so claim icons share one size language.
|
|
277
|
+
* `quiet` frames it with a hairline ring in the heading ink; `brand` paints
|
|
278
|
+
* the tinted, bordered badge.
|
|
279
|
+
*
|
|
280
|
+
* @param tone Tile chrome.
|
|
281
|
+
* @param side Side length on the spacing scale.
|
|
282
|
+
* @returns One mixin for the tile.
|
|
283
|
+
*/
|
|
284
|
+
export function iconTile(tone, side) {
|
|
285
|
+
return combine([
|
|
286
|
+
inlineFlex(),
|
|
287
|
+
center(),
|
|
288
|
+
is(side),
|
|
289
|
+
bs(side),
|
|
290
|
+
rounded("lg"),
|
|
291
|
+
tone === "brand"
|
|
292
|
+
? [bg("brand.tint"), fg("brand"), border({ color: "brand", width: 1, style: "solid" })]
|
|
293
|
+
: [fg("neutral.emphasis"), raw({ boxShadow: `inset 0 0 0 1px ${HAIRLINE}` })],
|
|
294
|
+
]);
|
|
295
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* a radio group styled with CSS,
|
|
4
|
-
*
|
|
2
|
+
* Tabs that reveal one media panel at a time, as a row of pills over the stage or as a
|
|
3
|
+
* rail of steps beside a sticky stage. Selection is a radio group styled with CSS, and every
|
|
4
|
+
* panel shares one stage cell, so the stage keeps its height on every tab without JavaScript.
|
|
5
5
|
*
|
|
6
6
|
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
7
|
* @copyright Sergio Xalambrí 2026
|
|
@@ -12,11 +12,18 @@ import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
|
12
12
|
*/
|
|
13
13
|
export declare namespace TabbedStage {
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* `horizontal` lays pill tabs over a full-width stage; `vertical` lays a rail of
|
|
16
|
+
* items beside a sticky stage from the `lg` container up, and stacks them below.
|
|
17
|
+
*/
|
|
18
|
+
type Orientation = "horizontal" | "vertical";
|
|
19
|
+
/**
|
|
20
|
+
* Value {@link TabbedStage} provides so nested items share one radio name and layout.
|
|
16
21
|
*/
|
|
17
22
|
interface Context {
|
|
18
23
|
/** Radio `name` every item in this stage writes. */
|
|
19
24
|
name: string;
|
|
25
|
+
/** Layout every item draws its tab and panel for. */
|
|
26
|
+
orientation: Orientation;
|
|
20
27
|
}
|
|
21
28
|
/**
|
|
22
29
|
* Props accepted by {@link TabbedStage}.
|
|
@@ -29,6 +36,8 @@ export declare namespace TabbedStage {
|
|
|
29
36
|
name: string;
|
|
30
37
|
/** Accessible name for the stage. Required — the library ships no copy. */
|
|
31
38
|
"aria-label": string;
|
|
39
|
+
/** Tab layout. Defaults to {@link DEFAULT_ORIENTATION}. */
|
|
40
|
+
orientation?: Orientation;
|
|
32
41
|
/** One or more {@link TabbedStage.Item} entries. */
|
|
33
42
|
children: RemixNode;
|
|
34
43
|
}
|
|
@@ -42,6 +51,11 @@ export declare namespace TabbedStage {
|
|
|
42
51
|
label: RemixNode;
|
|
43
52
|
/** Optional glyph shown before the label. */
|
|
44
53
|
icon?: RemixNode;
|
|
54
|
+
/**
|
|
55
|
+
* Supporting copy under the label, shown while the item is selected in a
|
|
56
|
+
* vertical stage. A horizontal stage leaves it out.
|
|
57
|
+
*/
|
|
58
|
+
description?: RemixNode;
|
|
45
59
|
/**
|
|
46
60
|
* Marks this item as the initially selected one. Only one item in a
|
|
47
61
|
* stage should pass `defaultChecked`.
|
|
@@ -52,8 +66,9 @@ export declare namespace TabbedStage {
|
|
|
52
66
|
}
|
|
53
67
|
}
|
|
54
68
|
/**
|
|
55
|
-
* Host for
|
|
56
|
-
*
|
|
69
|
+
* Host for tabs and their panels. Nest {@link TabbedStage.Item} children; each item
|
|
70
|
+
* pairs a tab with the media it reveals. A vertical stage wraps itself in a named
|
|
71
|
+
* container so the rail and stage sit side by side where there is room, and stack below.
|
|
57
72
|
*
|
|
58
73
|
* @param handle Runtime handle carrying the host `<div>`'s props and providing
|
|
59
74
|
* {@link TabbedStage.Context}.
|
|
@@ -63,8 +78,11 @@ export declare namespace TabbedStage {
|
|
|
63
78
|
* <TabbedStage.Item value="inbox" label={t("stage.inbox")} icon={inboxIcon} defaultChecked>
|
|
64
79
|
* {inboxShot}
|
|
65
80
|
* </TabbedStage.Item>
|
|
66
|
-
*
|
|
67
|
-
*
|
|
81
|
+
* </TabbedStage>
|
|
82
|
+
* @example
|
|
83
|
+
* <TabbedStage name="how" orientation="vertical" aria-label={t("how.label")}>
|
|
84
|
+
* <TabbedStage.Item value="detect" label={t("how.detect")} description={t("how.detect.body")} defaultChecked>
|
|
85
|
+
* {detectShot}
|
|
68
86
|
* </TabbedStage.Item>
|
|
69
87
|
* </TabbedStage>
|
|
70
88
|
*/
|