@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,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shell a docs page composes into: the sidebar pinned on the left from the header to the
|
|
3
|
+
* viewport's foot, the article and its footer beside it, and the page's own headings in a
|
|
4
|
+
* rail. Narrower screens fold the sidebar into a drawer and the headings into a sticky bar.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { Handle, RemixNode } from "remix/component";
|
|
10
|
+
import { TableOfContents } from "./table-of-contents.js";
|
|
11
|
+
/** Width each `dock` value docks the sidebar from; narrower, it opens in the drawer. */
|
|
12
|
+
declare const DOCK_QUERY: {
|
|
13
|
+
readonly md: "(min-width: 48rem)";
|
|
14
|
+
readonly lg: "(min-width: 64rem)";
|
|
15
|
+
};
|
|
16
|
+
/** Prop types for {@link DocsLayout}. */
|
|
17
|
+
export declare namespace DocsLayout {
|
|
18
|
+
/** Which breakpoint docks the sidebar: `md` at 48rem, `lg` at 64rem. */
|
|
19
|
+
type Dock = keyof typeof DOCK_QUERY;
|
|
20
|
+
interface Props {
|
|
21
|
+
/** The tree to read through, usually a `DocsNav`; drawn docked and again in the drawer. */
|
|
22
|
+
sidebar: RemixNode;
|
|
23
|
+
/** The article: a page header, the prose, then its pager and next steps. */
|
|
24
|
+
children: RemixNode;
|
|
25
|
+
/** The page's own headings; fewer than `tocMinItems` draw neither rail nor bar list. */
|
|
26
|
+
toc?: TableOfContents.Item[];
|
|
27
|
+
/** "On this page", for the rail's heading and the bar. */
|
|
28
|
+
tocLabel: string;
|
|
29
|
+
/** @default 2 */
|
|
30
|
+
tocMinItems?: number;
|
|
31
|
+
/** The bar button that opens the drawer below the dock width ("Menu"). */
|
|
32
|
+
menuLabel: string;
|
|
33
|
+
/** The drawer's heading and accessible name ("Documentation"). */
|
|
34
|
+
drawerLabel: string;
|
|
35
|
+
/** The drawer's close button's accessible name ("Close menu"). */
|
|
36
|
+
closeLabel: string;
|
|
37
|
+
/** Drawn under the headings in the rail, such as feedback or an edit link. */
|
|
38
|
+
railFooter?: RemixNode;
|
|
39
|
+
/**
|
|
40
|
+
* Closes the page across the article and rail columns, never under the sidebar, so
|
|
41
|
+
* the docked sidebar runs to the viewport's foot; usually a `DocsFooter`.
|
|
42
|
+
*/
|
|
43
|
+
footer?: RemixNode;
|
|
44
|
+
/** A site header drawn above the shell, kept on screen as the page scrolls. */
|
|
45
|
+
header?: RemixNode;
|
|
46
|
+
/**
|
|
47
|
+
* The height of everything kept on screen above the shell (the `header` slot, or a
|
|
48
|
+
* site header the app draws around the layout), so sticky columns and jumped-to
|
|
49
|
+
* headings sit below it.
|
|
50
|
+
* @default "0px"
|
|
51
|
+
*/
|
|
52
|
+
stickyTop?: string;
|
|
53
|
+
/** @default "lg" */
|
|
54
|
+
dock?: Dock;
|
|
55
|
+
/**
|
|
56
|
+
* The article column's widest extent, which code, images, tables and charts may fill.
|
|
57
|
+
* @default "64rem"
|
|
58
|
+
*/
|
|
59
|
+
measure?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The widest line of running text: paragraphs, lists, headings, quotes and callouts stop
|
|
62
|
+
* here while wider blocks keep growing to `measure`. Readable prose sits at 60–75ch.
|
|
63
|
+
* @default "66ch"
|
|
64
|
+
*/
|
|
65
|
+
proseMeasure?: string;
|
|
66
|
+
/** The whole shell's widest extent. @default "88rem" */
|
|
67
|
+
maxWidth?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Whether the article column is the page's `<main>` landmark; pass `false` when the
|
|
70
|
+
* app's own layout already draws one around the shell.
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
main?: boolean;
|
|
74
|
+
/** Shared by the drawer and the button that opens it. @default "docs-drawer" */
|
|
75
|
+
drawerId?: string;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Renders the three columns and their narrow-screen fallbacks. Load
|
|
80
|
+
* `@sdxc/ui/table-of-contents` and `@sdxc/ui/dialog-dismiss` in the browser entry. Headings
|
|
81
|
+
* with an `id` in the article get a `scroll-margin-top` that clears the sticky chrome, and
|
|
82
|
+
* `--ui-docs-scroll-margin` carries the same offset for anything else jumped to.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* <DocsLayout sidebar={<DocsNav tree={tree} activePath={path} />} toc={anchors} tocLabel="On this page" menuLabel="Menu" drawerLabel="Documentation" closeLabel="Close menu">
|
|
86
|
+
* <DocsPageHeader title="Install" crumbs={crumbs} />
|
|
87
|
+
* </DocsLayout>
|
|
88
|
+
*/
|
|
89
|
+
export declare function DocsLayout(handle: Handle<DocsLayout.Props>): () => import("remix/component").RemixElement;
|
|
90
|
+
export {};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { MenuIcon, XIcon } from "@sdxc/icons";
|
|
3
|
+
import { bg, borderEdge, fg } from "@sdxc/u/color";
|
|
4
|
+
import { raw } from "@sdxc/u/general";
|
|
5
|
+
import { hidden, hstack, inlineFlex, insBs, shrink, sticky, vstack } from "@sdxc/u/layout";
|
|
6
|
+
import { overflowY } from "@sdxc/u/overflow";
|
|
7
|
+
import { media } from "@sdxc/u/responsive";
|
|
8
|
+
import { bs, maxBs, mis, minIs, pb, pbe, pbs } from "@sdxc/u/size";
|
|
9
|
+
import { z } from "@sdxc/u/stacking";
|
|
10
|
+
import { when } from "@sdxc/u/state";
|
|
11
|
+
import { overflowWrap, text, weight } from "@sdxc/u/typography";
|
|
12
|
+
import { Button } from "../components/button.js";
|
|
13
|
+
import { DialogDismiss } from "../components/dialog-dismiss.js";
|
|
14
|
+
import { Sidebar } from "../components/sidebar.js";
|
|
15
|
+
import { TOC_MIN_ITEMS, TableOfContents } from "./table-of-contents.js";
|
|
16
|
+
/** Width each `dock` value docks the sidebar from; narrower, it opens in the drawer. */
|
|
17
|
+
const DOCK_QUERY = { md: "(min-width: 48rem)", lg: "(min-width: 64rem)" };
|
|
18
|
+
/** Every width under each `dock` value, where the drawer and its button take over. */
|
|
19
|
+
const UNDOCK_QUERY = { md: "(max-width: 47.9375rem)", lg: "(max-width: 63.9375rem)" };
|
|
20
|
+
/**
|
|
21
|
+
* Width the heading rail is drawn from. Narrower, a third column would squeeze the prose
|
|
22
|
+
* under a readable measure, so the headings fold into the sticky bar instead.
|
|
23
|
+
*/
|
|
24
|
+
const RAIL_QUERY = "(min-width: 75rem)";
|
|
25
|
+
/** The sticky bar's height, which a jumped-to heading also clears below the rail width. */
|
|
26
|
+
const BAR_HEIGHT = "2.75rem";
|
|
27
|
+
/**
|
|
28
|
+
* Room the docked sidebar keeps beside its links for a focus ring (3px wide, 2px out),
|
|
29
|
+
* which its scroll box would otherwise clip; a matching negative margin keeps it aligned.
|
|
30
|
+
*/
|
|
31
|
+
const RING_CLEARANCE = "0.375rem";
|
|
32
|
+
/**
|
|
33
|
+
* Renders the three columns and their narrow-screen fallbacks. Load
|
|
34
|
+
* `@sdxc/ui/table-of-contents` and `@sdxc/ui/dialog-dismiss` in the browser entry. Headings
|
|
35
|
+
* with an `id` in the article get a `scroll-margin-top` that clears the sticky chrome, and
|
|
36
|
+
* `--ui-docs-scroll-margin` carries the same offset for anything else jumped to.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* <DocsLayout sidebar={<DocsNav tree={tree} activePath={path} />} toc={anchors} tocLabel="On this page" menuLabel="Menu" drawerLabel="Documentation" closeLabel="Close menu">
|
|
40
|
+
* <DocsPageHeader title="Install" crumbs={crumbs} />
|
|
41
|
+
* </DocsLayout>
|
|
42
|
+
*/
|
|
43
|
+
export function DocsLayout(handle) {
|
|
44
|
+
return () => {
|
|
45
|
+
let { sidebar, children, toc = [], tocLabel, tocMinItems = TOC_MIN_ITEMS, menuLabel, drawerLabel, closeLabel, railFooter, footer, header, stickyTop = "0px", dock = "lg", measure = "64rem", proseMeasure = "66ch", maxWidth = "88rem", main = true, drawerId = "docs-drawer", } = handle.props;
|
|
46
|
+
let outlined = toc.length >= tocMinItems;
|
|
47
|
+
let docked = DOCK_QUERY[dock];
|
|
48
|
+
let undocked = UNDOCK_QUERY[dock];
|
|
49
|
+
return (_jsxs("div", { "data-slot": "docs-layout", mix: [
|
|
50
|
+
raw({
|
|
51
|
+
inlineSize: "100%",
|
|
52
|
+
"--docs-sticky-top": stickyTop,
|
|
53
|
+
"--ui-docs-scroll-margin": outlined
|
|
54
|
+
? `calc(${stickyTop} + ${BAR_HEIGHT} + 1rem)`
|
|
55
|
+
: `calc(${stickyTop} + 1rem)`,
|
|
56
|
+
}),
|
|
57
|
+
media(undocked, raw({ "--ui-docs-scroll-margin": `calc(${stickyTop} + ${BAR_HEIGHT} + 1rem)` })),
|
|
58
|
+
media(RAIL_QUERY, raw({ "--ui-docs-scroll-margin": `calc(${stickyTop} + 1.5rem)` })),
|
|
59
|
+
], children: [header ? (_jsx("div", { "data-slot": "docs-header", mix: [sticky(), insBs(0), z(3), bg()], children: header })) : null, _jsxs("div", { "data-slot": "docs-shell", mix: [
|
|
60
|
+
raw({
|
|
61
|
+
"--docs-gutter": "1rem",
|
|
62
|
+
display: "grid",
|
|
63
|
+
gridTemplateColumns: "minmax(0, 1fr)",
|
|
64
|
+
columnGap: "2.5rem",
|
|
65
|
+
alignItems: "start",
|
|
66
|
+
maxInlineSize: maxWidth,
|
|
67
|
+
marginInline: "auto",
|
|
68
|
+
paddingInline: "var(--docs-gutter)",
|
|
69
|
+
}),
|
|
70
|
+
media("(min-width: 48rem)", raw({ "--docs-gutter": "1.5rem" })),
|
|
71
|
+
media("(min-width: 64rem)", raw({ "--docs-gutter": "2rem" })),
|
|
72
|
+
media(docked, raw({ gridTemplateColumns: "15rem minmax(0, 1fr)" })),
|
|
73
|
+
outlined
|
|
74
|
+
? media(RAIL_QUERY, raw({ gridTemplateColumns: "15rem minmax(0, 1fr) 13rem" }))
|
|
75
|
+
: [],
|
|
76
|
+
], children: [_jsx("div", { "data-slot": "docs-sidebar", mix: [
|
|
77
|
+
hidden(),
|
|
78
|
+
media(docked, [
|
|
79
|
+
raw({
|
|
80
|
+
display: "block",
|
|
81
|
+
gridRow: "1 / span 2",
|
|
82
|
+
alignSelf: "start",
|
|
83
|
+
boxSizing: "border-box",
|
|
84
|
+
}),
|
|
85
|
+
sticky(),
|
|
86
|
+
insBs("var(--docs-sticky-top)"),
|
|
87
|
+
bs("calc(100dvh - var(--docs-sticky-top))"),
|
|
88
|
+
overflowY("auto"),
|
|
89
|
+
raw({
|
|
90
|
+
overscrollBehavior: "contain",
|
|
91
|
+
scrollbarWidth: "thin",
|
|
92
|
+
paddingInline: RING_CLEARANCE,
|
|
93
|
+
marginInline: `-${RING_CLEARANCE}`,
|
|
94
|
+
}),
|
|
95
|
+
pbs("2rem"),
|
|
96
|
+
pbe("3rem"),
|
|
97
|
+
]),
|
|
98
|
+
], children: sidebar }), _jsxs("div", { "data-slot": "docs-content", mix: [minIs(0), media(docked, raw({ gridRow: "1" }))], children: [_jsxs("div", { "data-slot": "docs-bar", mix: [
|
|
99
|
+
hstack({ gap: 1, align: "center" }),
|
|
100
|
+
sticky(),
|
|
101
|
+
insBs("var(--docs-sticky-top)"),
|
|
102
|
+
z(2),
|
|
103
|
+
raw({
|
|
104
|
+
minBlockSize: BAR_HEIGHT,
|
|
105
|
+
marginInline: "calc(-1 * var(--docs-gutter))",
|
|
106
|
+
paddingInline: "calc(var(--docs-gutter) - 0.5rem) var(--docs-gutter)",
|
|
107
|
+
}),
|
|
108
|
+
bg(),
|
|
109
|
+
borderEdge("block-end", { color: "neutral.border", width: 1, style: "solid" }),
|
|
110
|
+
media(docked, [
|
|
111
|
+
raw({ marginInline: 0, paddingInline: 0 }),
|
|
112
|
+
outlined ? [] : hidden(),
|
|
113
|
+
]),
|
|
114
|
+
media(RAIL_QUERY, hidden()),
|
|
115
|
+
], children: [_jsx("span", { mix: [
|
|
116
|
+
inlineFlex(),
|
|
117
|
+
shrink(0),
|
|
118
|
+
outlined
|
|
119
|
+
? raw({
|
|
120
|
+
borderInlineEnd: "1px solid var(--ui-neutral-border)",
|
|
121
|
+
paddingInlineEnd: "0.25rem",
|
|
122
|
+
})
|
|
123
|
+
: [],
|
|
124
|
+
media(docked, hidden()),
|
|
125
|
+
], children: _jsxs(Button, { type: "button", variant: "ghost", color: "neutral", size: "sm", commandfor: drawerId, command: "show-modal", children: [_jsx(MenuIcon, { size: 16, "aria-hidden": "true" }), menuLabel] }) }), outlined ? (_jsx(TableOfContents, { items: toc, label: tocLabel, layout: "bar", minItems: tocMinItems })) : null] }), main ? (_jsx("main", { "data-slot": "docs-article", mix: articleMixins(measure, proseMeasure, footer), children: children })) : (_jsx("div", { "data-slot": "docs-article", mix: articleMixins(measure, proseMeasure, footer), children: children }))] }), outlined ? (_jsxs("div", { "data-slot": "docs-rail", mix: [
|
|
126
|
+
hidden(),
|
|
127
|
+
media(RAIL_QUERY, [
|
|
128
|
+
raw({ gridRow: "1" }),
|
|
129
|
+
vstack({ gap: 6 }),
|
|
130
|
+
sticky(),
|
|
131
|
+
insBs("var(--docs-sticky-top)"),
|
|
132
|
+
maxBs("calc(100dvh - var(--docs-sticky-top))"),
|
|
133
|
+
overflowY("auto"),
|
|
134
|
+
raw({ overscrollBehavior: "contain", scrollbarWidth: "thin" }),
|
|
135
|
+
pb("2.5rem"),
|
|
136
|
+
]),
|
|
137
|
+
], children: [_jsx(TableOfContents, { items: toc, label: tocLabel, minItems: tocMinItems }), railFooter] })) : null, footer ? (_jsx("div", { "data-slot": "docs-footer-area", mix: [minIs(0), media(docked, raw({ gridColumn: "2 / -1", gridRow: "2" }))], children: footer })) : null] }), _jsxs(Sidebar.MobileNav, { id: drawerId, "aria-label": drawerLabel, children: [_jsxs(Sidebar.Header, { children: [_jsx("span", { mix: [text("base"), weight("semibold"), fg("neutral.emphasis")], children: drawerLabel }), _jsx("span", { mix: [mis("auto")], children: _jsx(Button, { type: "button", variant: "ghost", color: "neutral", size: "sm", commandfor: drawerId, command: "close", "aria-label": closeLabel, children: _jsx(XIcon, { size: 16, "aria-hidden": "true" }) }) })] }), _jsx(Sidebar.Content, { mix: [vstack({ gap: 0 }), pb("1rem")], children: sidebar }), _jsx(DialogDismiss, {})] })] }));
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Running text in the article that stops at the prose measure. Elements a component draws
|
|
142
|
+
* (`data-slot`) keep their own width unless listed, so a code block, file tree or props
|
|
143
|
+
* table inside a list or a step still grows to the column.
|
|
144
|
+
*/
|
|
145
|
+
const PROSE_SELECTOR = [
|
|
146
|
+
"& :where(p, ul, ol, dl, blockquote, h1, h2, h3, h4, h5, h6, hr):not([data-slot])",
|
|
147
|
+
'& :where([data-slot="anchor-heading"], [data-slot="callout"], [data-slot="docs-page-header"])',
|
|
148
|
+
].join(", ");
|
|
149
|
+
/**
|
|
150
|
+
* The article column: running text at a reading measure while code, images, tables and
|
|
151
|
+
* charts fill the column, long words broken, wide code or tables scrolled inside their own
|
|
152
|
+
* box, and headings that stop clear of the sticky chrome.
|
|
153
|
+
*/
|
|
154
|
+
function articleMixins(measure, proseMeasure, footer) {
|
|
155
|
+
return [
|
|
156
|
+
raw({ maxInlineSize: measure, "--ui-docs-prose-measure": proseMeasure }),
|
|
157
|
+
when(PROSE_SELECTOR, raw({ maxInlineSize: "var(--ui-docs-prose-measure)" })),
|
|
158
|
+
overflowWrap("break-word"),
|
|
159
|
+
pbs("2rem"),
|
|
160
|
+
pbe(footer ? "3rem" : "5rem"),
|
|
161
|
+
media("(min-width: 48rem)", pbs("2.5rem")),
|
|
162
|
+
when("& :is(h2, h3, h4, h5, h6)[id]", raw({ scrollMarginBlockStart: "var(--ui-docs-scroll-margin)" })),
|
|
163
|
+
when("& :is(pre, table)", raw({ maxInlineSize: "100%", overflowX: "auto" })),
|
|
164
|
+
when("& table", raw({ display: "block" })),
|
|
165
|
+
];
|
|
166
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Island that finishes a {@link DocsNav} in the browser: the sidebar opens scrolled to the
|
|
3
|
+
* current page, and an optional field filters its pages by title. It renders only the field,
|
|
4
|
+
* so the tree it acts on stays server HTML however many pages it holds.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { EntryComponent } from "remix/component";
|
|
10
|
+
/** Prop types for {@link DocsNavTools}. */
|
|
11
|
+
export declare namespace DocsNavTools {
|
|
12
|
+
/** Plain data only, since the props cross into the browser with the island. */
|
|
13
|
+
type Props = {
|
|
14
|
+
/** The title filter's accessible name and placeholder; unset draws no field. */
|
|
15
|
+
filter?: {
|
|
16
|
+
label: string;
|
|
17
|
+
placeholder: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Renders the filter field, hidden until it loads, inside the nav it enhances. `DocsNav`
|
|
23
|
+
* places it; load `@sdxc/ui/docs-nav-tools` in the browser entry.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DocsNavTools: EntryComponent<DocsNavTools.Props>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "remix/component/jsx-runtime";
|
|
2
|
+
import { clientEntry } from "remix/component";
|
|
3
|
+
import { SearchField } from "../components/search-field.js";
|
|
4
|
+
import { docsNavTools } from "./mixins/docs-nav-tools.js";
|
|
5
|
+
/**
|
|
6
|
+
* Renders the filter field, hidden until it loads, inside the nav it enhances. `DocsNav`
|
|
7
|
+
* places it; load `@sdxc/ui/docs-nav-tools` in the browser entry.
|
|
8
|
+
*/
|
|
9
|
+
export const DocsNavTools = clientEntry("@sdxc/ui/docs-nav-tools#DocsNavTools", function DocsNavTools(handle) {
|
|
10
|
+
return () => {
|
|
11
|
+
let { filter } = handle.props;
|
|
12
|
+
return (_jsx("div", { hidden: true, mix: [docsNavTools()], children: filter ? (_jsx(SearchField, { "aria-label": filter.label, children: _jsx(SearchField.Input, { placeholder: filter.placeholder, autocomplete: "off" }) })) : null }));
|
|
13
|
+
};
|
|
14
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A docs sidebar drawn from a {@link DocsTree}: sections under plain labels, pages and
|
|
3
|
+
* titled groups of pages, the current page marked and scrolled into view, an optional
|
|
4
|
+
* title filter, and a footer for support links. The same tree feeds the pager.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { Handle, RemixNode } from "remix/component";
|
|
10
|
+
import { Sidebar } from "../components/sidebar.js";
|
|
11
|
+
import type { DocsTree } from "./utils/docs-tree.js";
|
|
12
|
+
/** Prop types for {@link DocsNav}. */
|
|
13
|
+
export declare namespace DocsNav {
|
|
14
|
+
interface Props {
|
|
15
|
+
/** The pages to list; `tree.label` names the navigation landmark. */
|
|
16
|
+
tree: DocsTree;
|
|
17
|
+
/** The path being read, which marks one link `aria-current="page"`. */
|
|
18
|
+
activePath: string;
|
|
19
|
+
/**
|
|
20
|
+
* A field that filters pages by title, with the line shown when nothing matches.
|
|
21
|
+
* It appears once the page's script loads.
|
|
22
|
+
*/
|
|
23
|
+
filter?: {
|
|
24
|
+
label: string;
|
|
25
|
+
placeholder: string;
|
|
26
|
+
noResults: string;
|
|
27
|
+
};
|
|
28
|
+
/** Drawn under the tree, such as "Contact support" or a status link. */
|
|
29
|
+
footer?: RemixNode;
|
|
30
|
+
/**
|
|
31
|
+
* Folds every group except the ones holding the current page, for a tree whose
|
|
32
|
+
* groups run to hundreds of pages.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
collapseGroups?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* When a link prefetches its page.
|
|
38
|
+
* @default "intent"
|
|
39
|
+
*/
|
|
40
|
+
prefetch?: Sidebar.Prefetch;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Renders the tree in reading order. A group whose `href` is set links its own page from
|
|
45
|
+
* its summary, and every group is a native `<details>`, so folding needs no script. Load
|
|
46
|
+
* `@sdxc/ui/docs-nav-tools` in the browser entry for the scroll-to-current and the filter.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* <DocsNav tree={tree} activePath={url.pathname} />
|
|
50
|
+
* @example
|
|
51
|
+
* <DocsNav tree={tree} activePath={path} filter={{ label: "Filter pages", placeholder: "Filter", noResults: "No page matches" }} footer={<a href="/support">Contact support</a>} />
|
|
52
|
+
*/
|
|
53
|
+
export declare function DocsNav(handle: Handle<DocsNav.Props>): () => import("remix/component").RemixElement;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { ChevronRightIcon } from "@sdxc/icons";
|
|
3
|
+
import { fg } from "@sdxc/u/color";
|
|
4
|
+
import { transition, transitionDuration } from "@sdxc/u/effects";
|
|
5
|
+
import { listStyle, raw } from "@sdxc/u/general";
|
|
6
|
+
import { hidden, hstack, shrink, vstack } from "@sdxc/u/layout";
|
|
7
|
+
import { media } from "@sdxc/u/responsive";
|
|
8
|
+
import { m, minBs, minIs, mis, p, pi } from "@sdxc/u/size";
|
|
9
|
+
import { hover, when } from "@sdxc/u/state";
|
|
10
|
+
import { rotate } from "@sdxc/u/transform";
|
|
11
|
+
import { text, weight } from "@sdxc/u/typography";
|
|
12
|
+
import { Sidebar } from "../components/sidebar.js";
|
|
13
|
+
import { DocsNavTools } from "./docs-nav-tools.js";
|
|
14
|
+
/**
|
|
15
|
+
* Renders the tree in reading order. A group whose `href` is set links its own page from
|
|
16
|
+
* its summary, and every group is a native `<details>`, so folding needs no script. Load
|
|
17
|
+
* `@sdxc/ui/docs-nav-tools` in the browser entry for the scroll-to-current and the filter.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <DocsNav tree={tree} activePath={url.pathname} />
|
|
21
|
+
* @example
|
|
22
|
+
* <DocsNav tree={tree} activePath={path} filter={{ label: "Filter pages", placeholder: "Filter", noResults: "No page matches" }} footer={<a href="/support">Contact support</a>} />
|
|
23
|
+
*/
|
|
24
|
+
export function DocsNav(handle) {
|
|
25
|
+
return () => {
|
|
26
|
+
let { tree, activePath, filter, footer, collapseGroups = false, prefetch = "intent", } = handle.props;
|
|
27
|
+
let context = { activePath, collapseGroups, prefetch };
|
|
28
|
+
return (_jsxs("div", { "data-docs-nav": "", mix: [
|
|
29
|
+
vstack({ gap: 4 }),
|
|
30
|
+
minIs(0),
|
|
31
|
+
when("& [hidden]", raw({ display: "none !important" })),
|
|
32
|
+
], children: [_jsx(DocsNavTools, { filter: filter ? { label: filter.label, placeholder: filter.placeholder } : undefined }), _jsxs(Sidebar.Nav, { "aria-label": tree.label, mix: [raw({ gap: "1.25rem" })], children: [tree.sections.map((section) => (_jsxs("div", { "data-docs-nav-section": "", mix: [vstack({ gap: 1 })], children: [_jsx("p", { mix: [m(0), p(1, 2.5), text("sm"), weight("semibold"), fg("neutral.emphasis")], children: section.title }), _jsx(Sidebar.Menu, { "data-docs-nav-list": "", mix: [m(0), p(0), listStyle("none")], children: section.items.map((item) => (_jsx(NavItem, { item: item, context: context, depth: 0 }, item.href ?? item.title))) })] }, section.title))), filter ? (_jsx("p", { "data-docs-nav-empty": "", hidden: true, mix: [m(0), p(2, 2.5), text("sm"), fg("neutral.muted")], children: filter.noResults })) : null] }), footer ? _jsx("div", { mix: [pi("0.625rem")], children: footer }) : null] }));
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Whether `item` is, or holds, the page at `path`. */
|
|
36
|
+
function holds(item, path) {
|
|
37
|
+
return item.href === path || (item.items ?? []).some((child) => holds(child, path));
|
|
38
|
+
}
|
|
39
|
+
/** One page, or a group folding its pages under a summary. */
|
|
40
|
+
function NavItem(handle) {
|
|
41
|
+
return () => {
|
|
42
|
+
let { item, context, depth } = handle.props;
|
|
43
|
+
let { activePath, collapseGroups, prefetch } = context;
|
|
44
|
+
let Row = depth === 0 ? Sidebar.MenuItem : Sidebar.MenuSubItem;
|
|
45
|
+
let badge = item.badge ? _jsx(Sidebar.MenuBadge, { children: item.badge }) : null;
|
|
46
|
+
if (!item.items || item.items.length === 0) {
|
|
47
|
+
if (item.href === undefined)
|
|
48
|
+
return null;
|
|
49
|
+
let Link = depth === 0 ? Sidebar.MenuLink : Sidebar.MenuSubLink;
|
|
50
|
+
return (_jsx(Row, { children: _jsxs(Link, { href: item.href, prefetch: prefetch, active: item.href === activePath, children: [_jsx("span", { children: item.title }), badge] }) }));
|
|
51
|
+
}
|
|
52
|
+
let open = !collapseGroups || holds(item, activePath);
|
|
53
|
+
let current = item.href !== undefined && item.href === activePath;
|
|
54
|
+
return (_jsx(Row, { children: _jsxs("details", { open: open, children: [_jsxs("summary", { mix: [
|
|
55
|
+
hstack({ gap: 2, align: "center" }),
|
|
56
|
+
minBs("2.25rem"),
|
|
57
|
+
pi("0.625rem"),
|
|
58
|
+
text("sm"),
|
|
59
|
+
fg("neutral.muted"),
|
|
60
|
+
listStyle("none"),
|
|
61
|
+
raw({ cursor: "pointer", borderRadius: "var(--ui-radius-lg, 0.5rem)" }),
|
|
62
|
+
hover(fg("neutral.emphasis")),
|
|
63
|
+
when("&::-webkit-details-marker", hidden()),
|
|
64
|
+
], children: [item.href ? (_jsx("a", { href: item.href, "aria-current": current ? "page" : undefined, mix: [
|
|
65
|
+
fg("inherit"),
|
|
66
|
+
raw({ textDecoration: "none" }),
|
|
67
|
+
when('&[aria-current="page"]', [fg("neutral.emphasis"), weight("medium")]),
|
|
68
|
+
], children: item.title })) : (_jsx("span", { children: item.title })), badge, _jsx(ChevronRightIcon, { size: 14, "aria-hidden": "true", mix: [
|
|
69
|
+
shrink(0),
|
|
70
|
+
mis("auto"),
|
|
71
|
+
transition("transform"),
|
|
72
|
+
media("(prefers-reduced-motion: reduce)", transitionDuration("0s")),
|
|
73
|
+
when("[open] > summary > &", rotate(90)),
|
|
74
|
+
] })] }), _jsx(Sidebar.MenuSub, { mix: [m(0), mis("0.625rem"), listStyle("none")], children: item.items.map((child) => (_jsx(NavItem, { item: child, context: context, depth: depth + 1 }, child.href ?? child.title))) })] }) }));
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The body of a docs 404, drawn inside the docs shell so the sidebar stays: the address
|
|
3
|
+
* that matched nothing, the app's search pre-filled from that address, and a few places to
|
|
4
|
+
* start. A reader who mistyped a slug searches for it instead of starting over.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
10
|
+
/**
|
|
11
|
+
* Prop types for {@link DocsNotFound}.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace DocsNotFound {
|
|
14
|
+
/** A page to start from, usually the hub's start links. */
|
|
15
|
+
interface Link {
|
|
16
|
+
title: string;
|
|
17
|
+
href: string;
|
|
18
|
+
/** One line under the title saying what the page gets the reader. */
|
|
19
|
+
description?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Every string the 404 shows, so each app supplies them in the reader's language. */
|
|
22
|
+
interface Labels {
|
|
23
|
+
/** The page title ("Page not found"). */
|
|
24
|
+
title: string;
|
|
25
|
+
/** One sentence under the title ("No page answers to this address. Search for it instead."). */
|
|
26
|
+
body: RemixNode;
|
|
27
|
+
/** Heading over the start links ("Start from one of these"). */
|
|
28
|
+
linksTitle: string;
|
|
29
|
+
/** Small line above the title ("404"). */
|
|
30
|
+
eyebrow?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Props accepted by {@link DocsNotFound}. */
|
|
33
|
+
interface Props extends Omit<TagProps<"div">, "title"> {
|
|
34
|
+
/** The address that matched nothing, shown as code so the reader spots the typo. */
|
|
35
|
+
path: string;
|
|
36
|
+
/** The app's search field, pre-filled with {@link searchQueryFromPath} of `path`. */
|
|
37
|
+
search?: RemixNode;
|
|
38
|
+
links: Link[];
|
|
39
|
+
labels: Labels;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The search a docs 404 pre-fills: the address's last segment, decoded, without a page
|
|
44
|
+
* extension, with `-`, `_` and `+` read as spaces. A query, a hash and trailing slashes
|
|
45
|
+
* are ignored, and an address with no segment gives an empty query.
|
|
46
|
+
*
|
|
47
|
+
* @param path The address that matched nothing, with or without an origin.
|
|
48
|
+
* @returns The words to search for, or `""` when the address names none.
|
|
49
|
+
* @example searchQueryFromPath("/docs/guides/web-hooks"); // "web hooks"
|
|
50
|
+
* @example searchQueryFromPath("/docs/api/rate_limits.md?ref=x"); // "rate limits"
|
|
51
|
+
*/
|
|
52
|
+
export declare function searchQueryFromPath(path: string): string;
|
|
53
|
+
/**
|
|
54
|
+
* Renders the 404 body: eyebrow, title at the ambient heading level, a sentence, the
|
|
55
|
+
* missing address as code that wraps on a phone, the search slot, then the start links
|
|
56
|
+
* under a heading one level deeper.
|
|
57
|
+
*
|
|
58
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
59
|
+
* @returns The render function producing the 404's markup.
|
|
60
|
+
* @example
|
|
61
|
+
* <DocsNotFound
|
|
62
|
+
* path={url.pathname}
|
|
63
|
+
* search={<SearchField defaultValue={searchQueryFromPath(url.pathname)} />}
|
|
64
|
+
* links={[{ title: "Quickstart", href: "/docs/quickstart" }]}
|
|
65
|
+
* labels={{ title: "Page not found", body: "Search for it instead.", linksTitle: "Start here" }}
|
|
66
|
+
* />
|
|
67
|
+
*/
|
|
68
|
+
export declare function DocsNotFound(handle: Handle<DocsNotFound.Props>): () => import("remix/component").RemixElement;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { ArrowRightIcon } from "@sdxc/icons";
|
|
3
|
+
import { bg, fg, outline } from "@sdxc/u/color";
|
|
4
|
+
import { rounded } from "@sdxc/u/effects";
|
|
5
|
+
import { listStyle, mergeMix, raw } from "@sdxc/u/general";
|
|
6
|
+
import { hstack, vstack } from "@sdxc/u/layout";
|
|
7
|
+
import { m, p } from "@sdxc/u/size";
|
|
8
|
+
import { hover, when } from "@sdxc/u/state";
|
|
9
|
+
import { balance, font, pretty, text, textTransform, tracking, weight } from "@sdxc/u/typography";
|
|
10
|
+
import { resolveHeadingLevel, TAG_BY_LEVEL } from "../components/heading-scope.js";
|
|
11
|
+
/** File extensions a docs address may carry that name no words of the page. */
|
|
12
|
+
const PAGE_EXTENSION = /\.(md|mdx|html?|txt)$/i;
|
|
13
|
+
/**
|
|
14
|
+
* The search a docs 404 pre-fills: the address's last segment, decoded, without a page
|
|
15
|
+
* extension, with `-`, `_` and `+` read as spaces. A query, a hash and trailing slashes
|
|
16
|
+
* are ignored, and an address with no segment gives an empty query.
|
|
17
|
+
*
|
|
18
|
+
* @param path The address that matched nothing, with or without an origin.
|
|
19
|
+
* @returns The words to search for, or `""` when the address names none.
|
|
20
|
+
* @example searchQueryFromPath("/docs/guides/web-hooks"); // "web hooks"
|
|
21
|
+
* @example searchQueryFromPath("/docs/api/rate_limits.md?ref=x"); // "rate limits"
|
|
22
|
+
*/
|
|
23
|
+
export function searchQueryFromPath(path) {
|
|
24
|
+
let pathname = path.replace(/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i, "").split(/[?#]/)[0] ?? "";
|
|
25
|
+
let segment = pathname.split("/").filter(Boolean).at(-1) ?? "";
|
|
26
|
+
let decoded = segment;
|
|
27
|
+
try {
|
|
28
|
+
decoded = decodeURIComponent(segment.replace(/\+/g, " "));
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
decoded = segment;
|
|
32
|
+
}
|
|
33
|
+
return decoded
|
|
34
|
+
.replace(PAGE_EXTENSION, "")
|
|
35
|
+
.replace(/[-_+]+/g, " ")
|
|
36
|
+
.replace(/\s+/g, " ")
|
|
37
|
+
.trim();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Renders the 404 body: eyebrow, title at the ambient heading level, a sentence, the
|
|
41
|
+
* missing address as code that wraps on a phone, the search slot, then the start links
|
|
42
|
+
* under a heading one level deeper.
|
|
43
|
+
*
|
|
44
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
45
|
+
* @returns The render function producing the 404's markup.
|
|
46
|
+
* @example
|
|
47
|
+
* <DocsNotFound
|
|
48
|
+
* path={url.pathname}
|
|
49
|
+
* search={<SearchField defaultValue={searchQueryFromPath(url.pathname)} />}
|
|
50
|
+
* links={[{ title: "Quickstart", href: "/docs/quickstart" }]}
|
|
51
|
+
* labels={{ title: "Page not found", body: "Search for it instead.", linksTitle: "Start here" }}
|
|
52
|
+
* />
|
|
53
|
+
*/
|
|
54
|
+
export function DocsNotFound(handle) {
|
|
55
|
+
return () => {
|
|
56
|
+
let { labels, links, mix, path, search, ...rest } = handle.props;
|
|
57
|
+
let level = resolveHeadingLevel(handle);
|
|
58
|
+
let TitleTag = TAG_BY_LEVEL[level];
|
|
59
|
+
let LinksTag = TAG_BY_LEVEL[Math.min(level + 1, 6)];
|
|
60
|
+
return (_jsxs("div", { ...rest, "data-slot": "docs-not-found", mix: mergeMix([vstack({ gap: 8, align: "stretch" }), raw({ minInlineSize: "0" })], mix), children: [_jsxs("div", { mix: [vstack({ gap: 3, align: "stretch" })], children: [labels.eyebrow ? (_jsx("p", { mix: [
|
|
61
|
+
m(0),
|
|
62
|
+
font("mono"),
|
|
63
|
+
text("xs"),
|
|
64
|
+
weight("medium"),
|
|
65
|
+
textTransform("uppercase"),
|
|
66
|
+
tracking("widest"),
|
|
67
|
+
fg("brand"),
|
|
68
|
+
], children: labels.eyebrow })) : null, _jsx(TitleTag, { "data-slot": "docs-not-found-title", mix: [
|
|
69
|
+
m(0),
|
|
70
|
+
text("3xl"),
|
|
71
|
+
balance(),
|
|
72
|
+
fg("neutral.emphasis"),
|
|
73
|
+
raw({ fontWeight: 650, letterSpacing: "-0.02em", lineHeight: 1.15 }),
|
|
74
|
+
], children: labels.title }), _jsx("p", { mix: [m(0), text("base"), pretty(), fg("neutral"), raw({ maxInlineSize: "65ch" })], children: labels.body }), _jsx("p", { mix: [m(0)], children: _jsx("code", { "data-slot": "docs-not-found-path", mix: [
|
|
75
|
+
raw({
|
|
76
|
+
display: "inline-block",
|
|
77
|
+
maxInlineSize: "100%",
|
|
78
|
+
overflowWrap: "anywhere",
|
|
79
|
+
paddingInline: "0.5rem",
|
|
80
|
+
paddingBlock: "0.25rem",
|
|
81
|
+
}),
|
|
82
|
+
rounded("md"),
|
|
83
|
+
bg("neutral.bg-tint"),
|
|
84
|
+
font("mono"),
|
|
85
|
+
text("sm"),
|
|
86
|
+
fg("neutral.emphasis"),
|
|
87
|
+
], children: path }) })] }), search ? (_jsx("div", { "data-slot": "docs-not-found-search", mix: [raw({ maxInlineSize: "36rem" })], children: search })) : null, links.length > 0 ? (_jsxs("section", { "data-slot": "docs-not-found-links", mix: [vstack({ gap: 3, align: "stretch" })], children: [_jsx(LinksTag, { mix: [m(0), text("base"), weight("semibold"), balance(), fg("neutral.emphasis")], children: labels.linksTitle }), _jsx("ul", { mix: [vstack({ gap: 1, align: "stretch" }), m(0), p(0), listStyle("none")], children: links.map((link) => (_jsx("li", { children: _jsxs("a", { href: link.href, "data-rmx-prefetch": "intent", "data-slot": "docs-not-found-link", mix: [
|
|
88
|
+
hstack({ gap: 3, align: "center", justify: "between" }),
|
|
89
|
+
raw({
|
|
90
|
+
minBlockSize: "2.75rem",
|
|
91
|
+
paddingInline: "0.75rem",
|
|
92
|
+
paddingBlock: "0.5rem",
|
|
93
|
+
textDecoration: "none",
|
|
94
|
+
}),
|
|
95
|
+
rounded("md"),
|
|
96
|
+
hover(bg("neutral.bg-tint")),
|
|
97
|
+
when("&:focus-visible", outline({ color: "brand.ring", offset: 2 })),
|
|
98
|
+
], children: [_jsxs("span", { mix: [vstack({ gap: 0.5, align: "start" }), raw({ minInlineSize: "0" })], children: [_jsx("span", { mix: [text("sm"), weight("medium"), fg("brand")], children: link.title }), link.description ? (_jsx("span", { mix: [text("sm"), pretty(), fg("neutral")], children: link.description })) : null] }), _jsx("span", { mix: [hstack(), fg("neutral.muted")], children: _jsx(ArrowRightIcon, { size: 14, "aria-hidden": "true" }) })] }) }, link.href))) })] })) : null] }));
|
|
99
|
+
};
|
|
100
|
+
}
|