@sdxc/ui 2026.10.29 → 2026.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +187 -113
- package/dist/{behaviors → app/behaviors}/drag-session.js +1 -1
- package/dist/{behaviors → app/behaviors}/toaster.js +1 -1
- package/dist/{components → app}/chart.d.ts +1 -1
- package/dist/{components → app}/chart.js +18 -34
- package/dist/{components → app}/context-menu.d.ts +2 -2
- package/dist/{components → app}/context-menu.js +8 -7
- package/dist/{components → app}/drop-indicator.js +3 -3
- package/dist/{components → app}/drop-zone.js +3 -3
- package/dist/{components → app}/empty.d.ts +1 -1
- package/dist/{components → app}/empty.js +11 -21
- package/dist/{components → app}/file-trigger.js +2 -2
- package/dist/{components → app}/grid-list.d.ts +1 -1
- package/dist/{components → app}/grid-list.js +16 -18
- package/dist/app/index.d.ts +41 -0
- package/dist/app/index.js +41 -0
- package/dist/{components → app}/menubar.js +5 -7
- package/dist/{mixins → app/mixins}/drag-reorder.js +1 -1
- package/dist/{mixins → app/mixins}/drop-zone.js +1 -1
- package/dist/{mixins → app/mixins}/grid-list-keys.js +2 -2
- package/dist/{mixins → app/mixins}/menubar-keys.js +2 -2
- package/dist/{mixins → app/mixins}/resize-handle.js +3 -3
- package/dist/{mixins/treeKeys.js → app/mixins/tree-keys.js} +2 -2
- package/dist/{components → app}/resizable.js +7 -10
- package/dist/{components → app}/shortcut-list.js +4 -3
- package/dist/{components → app}/skeleton.js +3 -3
- package/dist/{styles → app/styles}/chart-palette.d.ts +1 -1
- package/dist/{styles → app/styles}/graphic-host.d.ts +1 -1
- package/dist/{styles → app/styles}/legend-toggle.d.ts +1 -1
- package/dist/{components → app}/table.js +12 -15
- package/dist/{components → app}/toast.js +18 -24
- package/dist/{components → app}/toolbar.js +3 -3
- package/dist/{components → app}/tree.d.ts +1 -1
- package/dist/{components → app}/tree.js +10 -14
- package/dist/{utils → app/utils}/chart-path.d.ts +1 -1
- package/dist/{utils → app/utils}/chart-path.js +2 -2
- package/dist/{utils → app/utils}/chart-scale.js +1 -1
- package/dist/behaviors/index.d.ts +0 -5
- package/dist/behaviors/index.js +0 -5
- package/dist/{components → chat}/attachment.d.ts +1 -1
- package/dist/{components → chat}/attachment.js +17 -23
- package/dist/{behaviors → chat/behaviors}/scroll-follow-model.js +1 -1
- package/dist/{components → chat}/bubble.js +14 -14
- package/dist/chat/index.d.ts +16 -0
- package/dist/chat/index.js +16 -0
- package/dist/{components → chat}/marker.js +6 -8
- package/dist/{components → chat}/message-scroller.d.ts +1 -1
- package/dist/{components → chat}/message-scroller.js +12 -18
- package/dist/{components → chat}/message.js +10 -12
- package/dist/{mixins → chat/mixins}/message-follow.js +2 -2
- package/dist/{components → color}/color-area.js +7 -10
- package/dist/{components → color}/color-field.js +7 -6
- package/dist/{components → color}/color-picker.d.ts +1 -1
- package/dist/{components → color}/color-picker.js +9 -12
- package/dist/{components → color}/color-slider.js +10 -13
- package/dist/{components → color}/color-swatch-picker.js +4 -5
- package/dist/{components → color}/color-swatch.js +3 -4
- package/dist/{components → color}/color-wheel.js +5 -6
- package/dist/color/index.d.ts +21 -0
- package/dist/color/index.js +21 -0
- package/dist/{mixins → color/mixins}/color-area-drag.d.ts +1 -1
- package/dist/{mixins → color/mixins}/color-area-drag.js +2 -2
- package/dist/{mixins → color/mixins}/color-preview.js +1 -1
- package/dist/{mixins → color/mixins}/color-wheel-drag.js +1 -1
- package/dist/{styles → color/styles}/rtl-aware-gradient-direction.d.ts +1 -1
- package/dist/components/accordion.d.ts +3 -3
- package/dist/components/accordion.js +19 -15
- package/dist/components/alert-dialog.js +5 -4
- package/dist/components/alert.js +10 -20
- package/dist/components/aspect-ratio.js +3 -4
- package/dist/components/avatar.d.ts +6 -6
- package/dist/components/avatar.js +56 -8
- package/dist/components/badge.js +11 -9
- package/dist/components/breadcrumbs.js +7 -9
- package/dist/components/button.d.ts +8 -6
- package/dist/components/button.js +22 -14
- package/dist/components/calendar.js +13 -24
- package/dist/components/card.js +9 -11
- package/dist/components/carousel.d.ts +1 -1
- package/dist/components/carousel.js +12 -20
- package/dist/components/checkbox-group.js +3 -3
- package/dist/components/checkbox.js +2 -2
- package/dist/components/combobox.js +6 -6
- package/dist/components/command.js +10 -14
- package/dist/components/cta-group.d.ts +30 -14
- package/dist/components/cta-group.js +29 -10
- package/dist/components/date-field.js +2 -1
- package/dist/components/date-picker.js +4 -5
- package/dist/components/date-range-picker.js +3 -2
- package/dist/components/description.js +2 -1
- package/dist/components/dialog-dismiss.d.ts +18 -0
- package/dist/components/dialog-dismiss.js +15 -0
- package/dist/components/dialog.js +11 -15
- package/dist/components/disclosure.js +10 -14
- package/dist/components/drawer.js +3 -4
- package/dist/components/field-error.js +3 -3
- package/dist/components/form.js +2 -1
- package/dist/components/group.js +3 -3
- package/dist/components/header.js +3 -3
- package/dist/components/heading-scope.js +2 -1
- package/dist/components/heading.d.ts +4 -4
- package/dist/components/heading.js +7 -7
- package/dist/components/highlight.js +17 -12
- package/dist/components/hover-card.js +6 -8
- package/dist/components/image-placeholder.js +13 -19
- package/dist/components/index.d.ts +6 -38
- package/dist/components/index.js +6 -38
- package/dist/components/input.js +3 -4
- package/dist/components/item.js +10 -19
- package/dist/components/keyboard.js +3 -3
- package/dist/components/label.js +2 -1
- package/dist/components/link-button.d.ts +7 -5
- package/dist/components/link-button.js +16 -11
- package/dist/components/link.js +3 -4
- package/dist/components/listbox.js +6 -11
- package/dist/components/menu.js +5 -6
- package/dist/components/meter.js +5 -6
- package/dist/components/modal.js +9 -11
- package/dist/components/nav-link.d.ts +1 -1
- package/dist/components/nav-link.js +3 -4
- package/dist/components/navigation-menu.js +17 -23
- package/dist/components/number-field.js +8 -10
- package/dist/components/otp-field.js +2 -1
- package/dist/components/overlay-arrow.js +3 -4
- package/dist/components/pagination.js +8 -10
- package/dist/components/popover.js +3 -4
- package/dist/components/progress-bar.js +5 -5
- package/dist/components/radio-group.js +5 -7
- package/dist/components/range-calendar.js +3 -3
- package/dist/components/scroll-area.js +4 -5
- package/dist/components/search-field.js +8 -11
- package/dist/components/section.js +2 -1
- package/dist/components/select.js +10 -22
- package/dist/components/selection-indicator.js +3 -3
- package/dist/components/sentinel-row.js +3 -3
- package/dist/components/separator.js +3 -3
- package/dist/components/shared-element.js +2 -1
- package/dist/components/sheet.js +6 -7
- package/dist/components/sidebar.js +48 -76
- package/dist/components/slider.js +8 -10
- package/dist/components/spinner.js +3 -3
- package/dist/components/switch.js +3 -3
- package/dist/components/tabs.js +9 -12
- package/dist/components/tag-group.js +7 -9
- package/dist/components/text-field.js +2 -1
- package/dist/components/text.js +2 -1
- package/dist/components/textarea.js +3 -4
- package/dist/components/time-field.js +2 -1
- package/dist/components/toggle-button.js +5 -7
- package/dist/components/tooltip.js +3 -3
- package/dist/components/typeset.js +128 -123
- package/dist/components/youtube-embed.js +2 -1
- package/dist/docs/anchor-heading.d.ts +41 -0
- package/dist/docs/anchor-heading.js +62 -0
- package/dist/docs/callout.d.ts +46 -0
- package/dist/docs/callout.js +61 -0
- package/dist/docs/code-block.d.ts +74 -0
- package/dist/docs/code-block.js +322 -0
- package/dist/docs/code-tabs-sync.d.ts +26 -0
- package/dist/docs/code-tabs-sync.js +12 -0
- package/dist/docs/code-tabs.d.ts +53 -0
- package/dist/docs/code-tabs.js +102 -0
- package/dist/docs/copy-button.d.ts +31 -0
- package/dist/docs/copy-button.js +49 -0
- package/dist/docs/docs-feedback.d.ts +55 -0
- package/dist/docs/docs-feedback.js +72 -0
- package/dist/docs/docs-footer.d.ts +40 -0
- package/dist/docs/docs-footer.js +45 -0
- package/dist/docs/docs-hub.d.ts +93 -0
- package/dist/docs/docs-hub.js +142 -0
- package/dist/docs/docs-layout.d.ts +90 -0
- package/dist/docs/docs-layout.js +166 -0
- package/dist/docs/docs-nav-tools.d.ts +25 -0
- package/dist/docs/docs-nav-tools.js +14 -0
- package/dist/docs/docs-nav.d.ts +53 -0
- package/dist/docs/docs-nav.js +76 -0
- package/dist/docs/docs-not-found.d.ts +68 -0
- package/dist/docs/docs-not-found.js +100 -0
- package/dist/docs/docs-page-header.d.ts +55 -0
- package/dist/docs/docs-page-header.js +54 -0
- package/dist/docs/docs-pager.d.ts +46 -0
- package/dist/docs/docs-pager.js +74 -0
- package/dist/docs/file-tree.d.ts +57 -0
- package/dist/docs/file-tree.js +142 -0
- package/dist/docs/index.d.ts +38 -0
- package/dist/docs/index.js +38 -0
- package/dist/docs/install-command.d.ts +54 -0
- package/dist/docs/install-command.js +33 -0
- package/dist/docs/mixins/code-tabs-sync.d.ts +47 -0
- package/dist/docs/mixins/code-tabs-sync.js +137 -0
- package/dist/docs/mixins/copy-feedback.d.ts +25 -0
- package/dist/docs/mixins/copy-feedback.js +49 -0
- package/dist/docs/mixins/copy-from-url.d.ts +27 -0
- package/dist/docs/mixins/copy-from-url.js +95 -0
- package/dist/docs/mixins/docs-nav-tools.d.ts +27 -0
- package/dist/docs/mixins/docs-nav-tools.js +97 -0
- package/dist/docs/mixins/toc-spy.d.ts +30 -0
- package/dist/docs/mixins/toc-spy.js +165 -0
- package/dist/docs/next-steps.d.ts +45 -0
- package/dist/docs/next-steps.js +79 -0
- package/dist/docs/page-actions.d.ts +77 -0
- package/dist/docs/page-actions.js +78 -0
- package/dist/docs/plan-notice.d.ts +28 -0
- package/dist/docs/plan-notice.js +33 -0
- package/dist/docs/props-table.d.ts +64 -0
- package/dist/docs/props-table.js +147 -0
- package/dist/docs/steps.d.ts +51 -0
- package/dist/docs/steps.js +112 -0
- package/dist/docs/table-of-contents.d.ts +49 -0
- package/dist/docs/table-of-contents.js +139 -0
- package/dist/docs/ui-label.d.ts +51 -0
- package/dist/docs/ui-label.js +64 -0
- package/dist/docs/utils/docs-tree.d.ts +81 -0
- package/dist/docs/utils/docs-tree.js +57 -0
- package/dist/docs/utils/reveal-in-scroller.d.ts +19 -0
- package/dist/docs/utils/reveal-in-scroller.js +43 -0
- package/dist/landing/accent-text.d.ts +47 -0
- package/dist/landing/accent-text.js +107 -0
- package/dist/landing/animations/entrance.d.ts +40 -0
- package/dist/landing/animations/entrance.js +52 -0
- package/dist/landing/announcement-chip.d.ts +45 -0
- package/dist/landing/announcement-chip.js +36 -0
- package/dist/landing/author-band.d.ts +78 -0
- package/dist/landing/author-band.js +190 -0
- package/dist/landing/bento.d.ts +99 -0
- package/dist/landing/bento.js +138 -0
- package/dist/landing/changelog-strip.d.ts +74 -0
- package/dist/landing/changelog-strip.js +201 -0
- package/dist/{patterns → landing}/check-row.js +5 -7
- package/dist/{patterns → landing}/closing-cta.d.ts +4 -4
- package/dist/{patterns → landing}/closing-cta.js +8 -8
- package/dist/landing/code-stage.d.ts +93 -0
- package/dist/landing/code-stage.js +434 -0
- package/dist/landing/crosshair.d.ts +44 -0
- package/dist/landing/crosshair.js +48 -0
- package/dist/landing/curriculum.d.ts +79 -0
- package/dist/landing/curriculum.js +194 -0
- package/dist/landing/drawn-chart.d.ts +74 -0
- package/dist/landing/drawn-chart.js +377 -0
- package/dist/landing/event-ticker.d.ts +71 -0
- package/dist/landing/event-ticker.js +331 -0
- package/dist/landing/fan-out-diagram.d.ts +70 -0
- package/dist/landing/fan-out-diagram.js +481 -0
- package/dist/{patterns → landing}/faq-band.d.ts +7 -5
- package/dist/{patterns → landing}/faq-band.js +11 -12
- package/dist/landing/feature-band.d.ts +108 -0
- package/dist/landing/feature-band.js +67 -0
- package/dist/landing/feature.d.ts +148 -0
- package/dist/landing/feature.js +219 -0
- package/dist/landing/flow-diagram.d.ts +62 -0
- package/dist/landing/flow-diagram.js +240 -0
- package/dist/{patterns → landing}/icon-well.d.ts +17 -7
- package/dist/landing/icon-well.js +31 -0
- package/dist/landing/index.d.ts +52 -0
- package/dist/landing/index.js +52 -0
- package/dist/{patterns → landing}/install-tabs.js +4 -5
- package/dist/landing/landing-header.d.ts +103 -0
- package/dist/landing/landing-header.js +110 -0
- package/dist/landing/landing-hero.d.ts +119 -0
- package/dist/landing/landing-hero.js +172 -0
- package/dist/landing/landing-section.d.ts +110 -0
- package/dist/landing/landing-section.js +183 -0
- package/dist/landing/logo-cloud.d.ts +56 -0
- package/dist/landing/logo-cloud.js +160 -0
- package/dist/landing/logo-sentence.d.ts +38 -0
- package/dist/landing/logo-sentence.js +51 -0
- package/dist/landing/marquee.d.ts +44 -0
- package/dist/landing/marquee.js +97 -0
- package/dist/landing/motion-loop.d.ts +43 -0
- package/dist/landing/motion-loop.js +42 -0
- package/dist/landing/pricing-band.d.ts +94 -0
- package/dist/landing/pricing-band.js +151 -0
- package/dist/landing/product-frame.d.ts +108 -0
- package/dist/landing/product-frame.js +202 -0
- package/dist/{patterns → landing}/proof-strip.d.ts +4 -4
- package/dist/{patterns → landing}/proof-strip.js +3 -3
- package/dist/landing/rails.d.ts +45 -0
- package/dist/landing/rails.js +69 -0
- package/dist/landing/rotating-text.d.ts +44 -0
- package/dist/landing/rotating-text.js +67 -0
- package/dist/landing/segmented-stage.d.ts +75 -0
- package/dist/landing/segmented-stage.js +141 -0
- package/dist/landing/sequence-diagram.d.ts +65 -0
- package/dist/landing/sequence-diagram.js +348 -0
- package/dist/landing/site-footer.d.ts +100 -0
- package/dist/landing/site-footer.js +274 -0
- package/dist/landing/site-header.d.ts +126 -0
- package/dist/landing/site-header.js +595 -0
- package/dist/{components → landing}/split.d.ts +14 -4
- package/dist/{components → landing}/split.js +30 -21
- package/dist/landing/sponsor-wall.d.ts +81 -0
- package/dist/landing/sponsor-wall.js +241 -0
- package/dist/{components → landing}/stat-strip.d.ts +31 -4
- package/dist/landing/stat-strip.js +105 -0
- package/dist/landing/step-list.d.ts +73 -0
- package/dist/landing/step-list.js +182 -0
- package/dist/landing/styles/card-grid.d.ts +115 -0
- package/dist/landing/styles/card-grid.js +295 -0
- package/dist/{patterns → landing}/tabbed-stage.d.ts +26 -8
- package/dist/landing/tabbed-stage.js +233 -0
- package/dist/landing/testimonial-band.d.ts +110 -0
- package/dist/landing/testimonial-band.js +164 -0
- package/dist/landing/typed-terminal.d.ts +62 -0
- package/dist/landing/typed-terminal.js +233 -0
- package/dist/landing/utils/pause-toggle.d.ts +37 -0
- package/dist/landing/utils/pause-toggle.js +71 -0
- package/dist/mixins/copy-to-clipboard.d.ts +6 -0
- package/dist/mixins/copy-to-clipboard.js +17 -1
- package/dist/mixins/dialog-dismiss.d.ts +21 -0
- package/dist/mixins/dialog-dismiss.js +62 -0
- package/dist/mixins/index.d.ts +2 -15
- package/dist/mixins/index.js +2 -15
- package/dist/styles/index.d.ts +2 -5
- package/dist/styles/index.js +2 -5
- package/dist/styles/landing.d.ts +200 -0
- package/dist/styles/landing.js +516 -0
- package/dist/styles/surface-control.d.ts +18 -0
- package/dist/styles/surface-control.js +31 -0
- package/dist/utils/eyebrow.d.ts +39 -0
- package/dist/utils/eyebrow.js +21 -0
- package/dist/utils/index.d.ts +1 -5
- package/dist/utils/index.js +1 -5
- package/package.json +14 -4
- package/src/theme.css +87 -22
- package/dist/components/feature.d.ts +0 -102
- package/dist/components/feature.js +0 -151
- package/dist/components/logo-cloud.d.ts +0 -42
- package/dist/components/logo-cloud.js +0 -41
- package/dist/components/marketing-header.d.ts +0 -71
- package/dist/components/marketing-header.js +0 -81
- package/dist/components/marketing-section.d.ts +0 -81
- package/dist/components/marketing-section.js +0 -103
- package/dist/components/stat-strip.js +0 -64
- package/dist/patterns/accent-text.d.ts +0 -30
- package/dist/patterns/accent-text.js +0 -17
- package/dist/patterns/announcement-chip.d.ts +0 -41
- package/dist/patterns/announcement-chip.js +0 -49
- package/dist/patterns/bento.d.ts +0 -67
- package/dist/patterns/bento.js +0 -95
- package/dist/patterns/code-stage.d.ts +0 -63
- package/dist/patterns/code-stage.js +0 -82
- package/dist/patterns/feature-band.d.ts +0 -85
- package/dist/patterns/feature-band.js +0 -50
- package/dist/patterns/icon-well.js +0 -38
- package/dist/patterns/index.d.ts +0 -23
- package/dist/patterns/index.js +0 -23
- package/dist/patterns/landing-hero.d.ts +0 -93
- package/dist/patterns/landing-hero.js +0 -126
- package/dist/patterns/product-frame.d.ts +0 -60
- package/dist/patterns/product-frame.js +0 -70
- package/dist/patterns/step-list.d.ts +0 -45
- package/dist/patterns/step-list.js +0 -84
- package/dist/patterns/tabbed-stage.js +0 -77
- package/dist/styles/marketing.d.ts +0 -120
- package/dist/styles/marketing.js +0 -225
- package/dist/utils/semantic-color-panel.d.ts +0 -35
- package/dist/utils/semantic-color-panel.js +0 -28
- /package/dist/{behaviors → app/behaviors}/drag-session.d.ts +0 -0
- /package/dist/{behaviors → app/behaviors}/resize-session.d.ts +0 -0
- /package/dist/{behaviors → app/behaviors}/resize-session.js +0 -0
- /package/dist/{behaviors → app/behaviors}/selection-model.d.ts +0 -0
- /package/dist/{behaviors → app/behaviors}/selection-model.js +0 -0
- /package/dist/{behaviors → app/behaviors}/toaster.d.ts +0 -0
- /package/dist/{components → app}/drop-indicator.d.ts +0 -0
- /package/dist/{components → app}/drop-zone.d.ts +0 -0
- /package/dist/{components → app}/file-trigger.d.ts +0 -0
- /package/dist/{components → app}/menubar.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/chart-tooltip.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/chart-tooltip.js +0 -0
- /package/dist/{mixins → app/mixins}/context-menu.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/context-menu.js +0 -0
- /package/dist/{mixins → app/mixins}/drag-reorder.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/drop-zone.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/grid-list-keys.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/menubar-keys.d.ts +0 -0
- /package/dist/{mixins → app/mixins}/resize-handle.d.ts +0 -0
- /package/dist/{mixins/treeKeys.d.ts → app/mixins/tree-keys.d.ts} +0 -0
- /package/dist/{components → app}/resizable.d.ts +0 -0
- /package/dist/{components → app}/shortcut-list.d.ts +0 -0
- /package/dist/{components → app}/skeleton.d.ts +0 -0
- /package/dist/{styles → app/styles}/chart-palette.js +0 -0
- /package/dist/{styles → app/styles}/graphic-host.js +0 -0
- /package/dist/{styles → app/styles}/legend-toggle.js +0 -0
- /package/dist/{components → app}/table.d.ts +0 -0
- /package/dist/{components → app}/toast.d.ts +0 -0
- /package/dist/{components → app}/toolbar.d.ts +0 -0
- /package/dist/{utils → app/utils}/chart-marker-indices.d.ts +0 -0
- /package/dist/{utils → app/utils}/chart-marker-indices.js +0 -0
- /package/dist/{utils → app/utils}/chart-scale.d.ts +0 -0
- /package/dist/{behaviors → chat/behaviors}/scroll-follow-model.d.ts +0 -0
- /package/dist/{components → chat}/bubble.d.ts +0 -0
- /package/dist/{components → chat}/marker.d.ts +0 -0
- /package/dist/{components → chat}/message.d.ts +0 -0
- /package/dist/{mixins → chat/mixins}/attachment-trigger.d.ts +0 -0
- /package/dist/{mixins → chat/mixins}/attachment-trigger.js +0 -0
- /package/dist/{mixins → chat/mixins}/message-follow.d.ts +0 -0
- /package/dist/{components → color}/color-area.d.ts +0 -0
- /package/dist/{components → color}/color-field.d.ts +0 -0
- /package/dist/{components → color}/color-slider.d.ts +0 -0
- /package/dist/{components → color}/color-swatch-picker.d.ts +0 -0
- /package/dist/{components → color}/color-swatch.d.ts +0 -0
- /package/dist/{components → color}/color-wheel.d.ts +0 -0
- /package/dist/{mixins → color/mixins}/color-channel-sync.d.ts +0 -0
- /package/dist/{mixins → color/mixins}/color-channel-sync.js +0 -0
- /package/dist/{mixins → color/mixins}/color-preview.d.ts +0 -0
- /package/dist/{mixins → color/mixins}/color-wheel-drag.d.ts +0 -0
- /package/dist/{styles → color/styles}/rtl-aware-gradient-direction.js +0 -0
- /package/dist/{utils → color/utils}/hue-spectrum.d.ts +0 -0
- /package/dist/{utils → color/utils}/hue-spectrum.js +0 -0
- /package/dist/{patterns → landing}/check-row.d.ts +0 -0
- /package/dist/{patterns → landing}/install-tabs.d.ts +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
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 { counterIncrement, counterReset, listStyle, mergeMix, pseudoContent, raw, } from "@sdxc/u/general";
|
|
5
|
+
import { absolute, inlineFlex, items, justify, relative, vstack } from "@sdxc/u/layout";
|
|
6
|
+
import { m, minIs, p } from "@sdxc/u/size";
|
|
7
|
+
import { after, before, not } from "@sdxc/u/state";
|
|
8
|
+
import { balance, leading, tabularNums, text, weight } from "@sdxc/u/typography";
|
|
9
|
+
import { HeadingScope, readAmbientLevel, resolveHeadingLevel, TAG_BY_LEVEL, } from "../components/heading-scope.js";
|
|
10
|
+
/** Diameter of a step's counter; the title's first line is as tall so the two centre. */
|
|
11
|
+
const COUNTER_SIZE = "1.75rem";
|
|
12
|
+
/** Space the rail leaves under one counter and above the next. */
|
|
13
|
+
const RAIL_GAP = "0.375rem";
|
|
14
|
+
/** Depth step titles take when nothing above the list sets one: sections of a page's `<h1>`. */
|
|
15
|
+
const FALLBACK_LEVEL = 2;
|
|
16
|
+
/** Hairline the counter ring and the rail draw with. */
|
|
17
|
+
const HAIRLINE = "var(--ui-neutral-border, color-mix(in oklch, CanvasText 16%, transparent))";
|
|
18
|
+
/**
|
|
19
|
+
* Renders the ordered list and the heading scope its titles read. Each step pads its
|
|
20
|
+
* own end instead of the list using a gap, so the rail spans the whole distance between
|
|
21
|
+
* one counter and the next.
|
|
22
|
+
*
|
|
23
|
+
* @param handle Runtime handle carrying the host `<ol>`'s props.
|
|
24
|
+
* @returns The render function producing the list's markup.
|
|
25
|
+
* @example
|
|
26
|
+
* <Steps>
|
|
27
|
+
* <Steps.Item id="add-a-monitor" title={t("quickstart.add")}>{t("quickstart.add.body")}</Steps.Item>
|
|
28
|
+
* <Steps.Item title={t("quickstart.alerts")}>{t("quickstart.alerts.body")}</Steps.Item>
|
|
29
|
+
* </Steps>
|
|
30
|
+
*/
|
|
31
|
+
export function Steps(handle) {
|
|
32
|
+
return () => {
|
|
33
|
+
let { children, level, mix, ...rest } = handle.props;
|
|
34
|
+
let ambient = readAmbientLevel(handle);
|
|
35
|
+
let resolved = level ?? (ambient === undefined ? FALLBACK_LEVEL : (ambient + 1));
|
|
36
|
+
return (_jsx(HeadingScope, { level: resolveHeadingLevel(handle, resolved), children: _jsx("ol", { ...rest, "data-slot": "steps", mix: mergeMix([counterReset("ui-docs-step"), listStyle("none"), m(0), p(0), minIs(0)], mix), children: children }) }));
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The counter disc: a step number centred in a ring drawn as a 1px inset shadow, so the
|
|
41
|
+
* ring adds nothing to the disc's 28px box.
|
|
42
|
+
*/
|
|
43
|
+
function counter() {
|
|
44
|
+
return before([
|
|
45
|
+
pseudoContent("counter(ui-docs-step)"),
|
|
46
|
+
absolute(),
|
|
47
|
+
raw({
|
|
48
|
+
insetBlockStart: "0",
|
|
49
|
+
insetInlineStart: "0",
|
|
50
|
+
inlineSize: COUNTER_SIZE,
|
|
51
|
+
blockSize: COUNTER_SIZE,
|
|
52
|
+
}),
|
|
53
|
+
inlineFlex(),
|
|
54
|
+
items("center"),
|
|
55
|
+
justify("center"),
|
|
56
|
+
rounded("full"),
|
|
57
|
+
raw({ boxShadow: `inset 0 0 0 1px ${HAIRLINE}` }),
|
|
58
|
+
fg("neutral.emphasis"),
|
|
59
|
+
text("sm"),
|
|
60
|
+
weight("semibold"),
|
|
61
|
+
tabularNums(),
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The rail under a counter: a 1px line centred on the disc that starts a gap below it and
|
|
66
|
+
* ends a gap above the next step, which begins where this step's padding ends.
|
|
67
|
+
*/
|
|
68
|
+
function rail() {
|
|
69
|
+
return not(":last-child", after([
|
|
70
|
+
pseudoContent('""'),
|
|
71
|
+
absolute(),
|
|
72
|
+
raw({
|
|
73
|
+
insetBlockStart: `calc(${COUNTER_SIZE} + ${RAIL_GAP})`,
|
|
74
|
+
insetBlockEnd: RAIL_GAP,
|
|
75
|
+
insetInlineStart: `calc(${COUNTER_SIZE} / 2 - 0.5px)`,
|
|
76
|
+
inlineSize: "1px",
|
|
77
|
+
backgroundColor: HAIRLINE,
|
|
78
|
+
}),
|
|
79
|
+
]));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* One step: the counter and rail in the inline-start gutter, the title heading beside the
|
|
83
|
+
* counter, and the step's content under the title. Content can shrink below its widest
|
|
84
|
+
* line, so a long code block scrolls inside its own box.
|
|
85
|
+
*
|
|
86
|
+
* @param handle Runtime handle carrying the host `<li>`'s props.
|
|
87
|
+
* @returns The render function producing the step's markup.
|
|
88
|
+
*/
|
|
89
|
+
Steps.Item = function StepsItem(handle) {
|
|
90
|
+
return () => {
|
|
91
|
+
let { children, id, mix, title, ...rest } = handle.props;
|
|
92
|
+
let level = resolveHeadingLevel(handle);
|
|
93
|
+
let Tag = TAG_BY_LEVEL[level];
|
|
94
|
+
return (_jsxs("li", { ...rest, "data-slot": "steps-item", mix: mergeMix([
|
|
95
|
+
relative(),
|
|
96
|
+
counterIncrement("ui-docs-step"),
|
|
97
|
+
raw({ paddingInlineStart: `calc(${COUNTER_SIZE} + 1rem)` }),
|
|
98
|
+
not(":last-child", raw({ paddingBlockEnd: "2rem" })),
|
|
99
|
+
minIs(0),
|
|
100
|
+
vstack({ gap: 3, align: "stretch" }),
|
|
101
|
+
counter(),
|
|
102
|
+
rail(),
|
|
103
|
+
], mix), children: [_jsx(Tag, { id: id, "data-slot": "steps-title", "data-heading-level": level, mix: [
|
|
104
|
+
m(0),
|
|
105
|
+
text("base"),
|
|
106
|
+
raw({ lineHeight: COUNTER_SIZE }),
|
|
107
|
+
weight("semibold"),
|
|
108
|
+
balance(),
|
|
109
|
+
fg("neutral.emphasis"),
|
|
110
|
+
], children: title }), children === undefined || children === null ? null : (_jsx("div", { "data-slot": "steps-content", mix: [minIs(0), vstack({ gap: 3, align: "stretch" }), leading("relaxed")], children: children }))] }));
|
|
111
|
+
};
|
|
112
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Island: a docs page's own headings as an "On this page" list, as a rail beside the prose
|
|
3
|
+
* or a sticky bar on a narrow screen. The links work as plain anchors; once it loads a
|
|
4
|
+
* marker slides over every section on screen and the bar names the section being read.
|
|
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 TableOfContents}. */
|
|
11
|
+
export declare namespace TableOfContents {
|
|
12
|
+
/** One heading the list links to; `level` 2 sits flush and each deeper level indents. */
|
|
13
|
+
type Item = {
|
|
14
|
+
id: string;
|
|
15
|
+
text: string;
|
|
16
|
+
level: number;
|
|
17
|
+
};
|
|
18
|
+
/** Plain data only, since the props cross into the browser with the island. */
|
|
19
|
+
type Props = {
|
|
20
|
+
items: Item[];
|
|
21
|
+
/** The list's visible heading and the landmark's accessible name ("On this page"). */
|
|
22
|
+
label: string;
|
|
23
|
+
/**
|
|
24
|
+
* `rail` lists the headings under the label, for the column beside the prose; `bar`
|
|
25
|
+
* folds them into a disclosure whose summary names the section being read.
|
|
26
|
+
* @default "rail"
|
|
27
|
+
*/
|
|
28
|
+
layout?: "rail" | "bar";
|
|
29
|
+
/**
|
|
30
|
+
* Fewest headings that earn a list; a shorter page renders nothing, so a layout can
|
|
31
|
+
* test the same number to drop its rail column.
|
|
32
|
+
* @default 2
|
|
33
|
+
*/
|
|
34
|
+
minItems?: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Renders the in-page navigation, or nothing when the page has fewer than `minItems`
|
|
39
|
+
* headings. Load `@sdxc/ui/table-of-contents` in the browser entry. Headings that the
|
|
40
|
+
* page's layout gives a `scroll-margin-top` set the line a section is read from.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* <TableOfContents items={anchors} label="On this page" />
|
|
44
|
+
* @example
|
|
45
|
+
* <TableOfContents items={anchors} label="On this page" layout="bar" />
|
|
46
|
+
*/
|
|
47
|
+
export declare const TableOfContents: EntryComponent<TableOfContents.Props>;
|
|
48
|
+
/** Fewest headings that earn a list when `minItems` is unset. */
|
|
49
|
+
export declare const TOC_MIN_ITEMS = 2;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { ChevronDownIcon, ListIcon } from "@sdxc/icons";
|
|
3
|
+
import { bg, borderEdge, fg, stroke } from "@sdxc/u/color";
|
|
4
|
+
import { rounded, transition, transitionDuration } from "@sdxc/u/effects";
|
|
5
|
+
import { listStyle, raw } from "@sdxc/u/general";
|
|
6
|
+
import { absolute, block, hidden, hstack, insIs, relative, shrink, vstack } from "@sdxc/u/layout";
|
|
7
|
+
import { overflowY } from "@sdxc/u/overflow";
|
|
8
|
+
import { media } from "@sdxc/u/responsive";
|
|
9
|
+
import { is, m, maxBs, minBs, minIs, mis, p, pi, pis } from "@sdxc/u/size";
|
|
10
|
+
import { hover, when } from "@sdxc/u/state";
|
|
11
|
+
import { rotate } from "@sdxc/u/transform";
|
|
12
|
+
import { text, truncate, weight } from "@sdxc/u/typography";
|
|
13
|
+
import { clientEntry } from "remix/component";
|
|
14
|
+
import { tocSpy } from "./mixins/toc-spy.js";
|
|
15
|
+
/** The shallowest heading level the list offers, which every indent is measured from. */
|
|
16
|
+
const BASE_LEVEL = 2;
|
|
17
|
+
/** How far each heading level below {@link BASE_LEVEL} sets an item in, in rem. */
|
|
18
|
+
const INDENT_STEP = 0.75;
|
|
19
|
+
/**
|
|
20
|
+
* Width below which the bar names only its label: beside a menu button there is room for
|
|
21
|
+
* a letter or two of the section, which reads as noise rather than a name.
|
|
22
|
+
*/
|
|
23
|
+
const NARROW_BAR = "(max-width: 22.4375rem)";
|
|
24
|
+
/** Circumference of the bar's progress ring (radius 7), which its dash pattern spans. */
|
|
25
|
+
const RING = 43.98;
|
|
26
|
+
/** Shared easing for the marker and ring, a quick start that settles softly. */
|
|
27
|
+
const SETTLE = "cubic-bezier(0.32, 0.72, 0, 1)";
|
|
28
|
+
/**
|
|
29
|
+
* Renders the in-page navigation, or nothing when the page has fewer than `minItems`
|
|
30
|
+
* headings. Load `@sdxc/ui/table-of-contents` in the browser entry. Headings that the
|
|
31
|
+
* page's layout gives a `scroll-margin-top` set the line a section is read from.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* <TableOfContents items={anchors} label="On this page" />
|
|
35
|
+
* @example
|
|
36
|
+
* <TableOfContents items={anchors} label="On this page" layout="bar" />
|
|
37
|
+
*/
|
|
38
|
+
export const TableOfContents = clientEntry("@sdxc/ui/table-of-contents#TableOfContents", function TableOfContents(handle) {
|
|
39
|
+
return () => {
|
|
40
|
+
let { items, label, layout = "rail", minItems = TOC_MIN_ITEMS } = handle.props;
|
|
41
|
+
if (items.length < minItems)
|
|
42
|
+
return null;
|
|
43
|
+
let list = _jsx(TocList, { items: items });
|
|
44
|
+
if (layout === "bar") {
|
|
45
|
+
return (_jsxs("details", { "data-toc": "bar", mix: [relative(), minIs(0), raw({ flex: "1 1 auto" })], children: [_jsxs("summary", { mix: [
|
|
46
|
+
hstack({ gap: 2, align: "center" }),
|
|
47
|
+
minBs("2.75rem"),
|
|
48
|
+
pi(3, 0),
|
|
49
|
+
text("sm"),
|
|
50
|
+
fg("neutral"),
|
|
51
|
+
listStyle("none"),
|
|
52
|
+
raw({ cursor: "pointer" }),
|
|
53
|
+
when("&::-webkit-details-marker", hidden()),
|
|
54
|
+
when("&:focus-visible", raw({ outlineOffset: "-2px" })),
|
|
55
|
+
], children: [_jsx(ProgressRing, {}), _jsx("span", { mix: [shrink(0), fg("neutral.emphasis"), weight("medium")], children: label }), _jsx("span", { "data-toc-reading": "", "aria-live": "off", mix: [minIs(0), truncate(), media(NARROW_BAR, hidden())] }), _jsx(ChevronDownIcon, { size: 16, "aria-hidden": "true", mix: [
|
|
56
|
+
shrink(0),
|
|
57
|
+
mis("auto"),
|
|
58
|
+
transition("transform"),
|
|
59
|
+
media("(prefers-reduced-motion: reduce)", transitionDuration("0s")),
|
|
60
|
+
when("[open] > summary > &", rotate(180)),
|
|
61
|
+
] })] }), _jsx("nav", { "aria-label": label, mix: [
|
|
62
|
+
absolute(),
|
|
63
|
+
raw({ insetInline: 0, insetBlockStart: "100%" }),
|
|
64
|
+
maxBs("min(60dvh, 28rem)"),
|
|
65
|
+
overflowY("auto"),
|
|
66
|
+
p(3, 4),
|
|
67
|
+
bg("neutral.bg-tint"),
|
|
68
|
+
borderEdge("block-end", { color: "neutral.border", width: 1, style: "solid" }),
|
|
69
|
+
raw({ boxShadow: "var(--ui-shadow-float, none)" }),
|
|
70
|
+
], children: list })] }));
|
|
71
|
+
}
|
|
72
|
+
return (_jsxs("nav", { "data-toc": "rail", "aria-label": label, mix: [vstack({ gap: 3 })], children: [_jsxs("p", { mix: [
|
|
73
|
+
m(0),
|
|
74
|
+
hstack({ gap: 2, align: "center" }),
|
|
75
|
+
text("sm"),
|
|
76
|
+
fg("neutral.emphasis"),
|
|
77
|
+
weight("medium"),
|
|
78
|
+
], children: [_jsx(ListIcon, { size: 14, "aria-hidden": "true" }), label] }), list] }));
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
/** Fewest headings that earn a list when `minItems` is unset. */
|
|
82
|
+
export const TOC_MIN_ITEMS = 2;
|
|
83
|
+
/**
|
|
84
|
+
* The links on a guide line, with one marker that {@link tocSpy} stretches over the
|
|
85
|
+
* sections on screen. The marker stays invisible until the spy has placed it once.
|
|
86
|
+
*/
|
|
87
|
+
function TocList(handle) {
|
|
88
|
+
return () => (_jsxs("div", { mix: [relative(), tocSpy()], children: [_jsx("span", { "data-toc-marker": "", "aria-hidden": "true", mix: [
|
|
89
|
+
absolute(),
|
|
90
|
+
raw({
|
|
91
|
+
insetBlockStart: 0,
|
|
92
|
+
blockSize: "var(--toc-marker-size, 0px)",
|
|
93
|
+
transform: "translateY(var(--toc-marker-start, 0px))",
|
|
94
|
+
opacity: 0,
|
|
95
|
+
transition: `transform 300ms ${SETTLE}, block-size 300ms ${SETTLE}, opacity 150ms ease-out`,
|
|
96
|
+
}),
|
|
97
|
+
insIs(0),
|
|
98
|
+
is("2px"),
|
|
99
|
+
rounded("full"),
|
|
100
|
+
bg("brand.solid"),
|
|
101
|
+
when("[data-toc-ready] > &", raw({ opacity: 1 })),
|
|
102
|
+
media("(prefers-reduced-motion: reduce)", raw({ transition: "opacity 150ms linear" })),
|
|
103
|
+
] }), _jsx("ul", { mix: [
|
|
104
|
+
vstack({ gap: 0 }),
|
|
105
|
+
m(0),
|
|
106
|
+
p(0),
|
|
107
|
+
listStyle("none"),
|
|
108
|
+
borderEdge("inline-start", { color: "neutral.border", width: 1, style: "solid" }),
|
|
109
|
+
], children: handle.props.items.map((item) => {
|
|
110
|
+
let depth = Math.max(item.level - BASE_LEVEL, 0);
|
|
111
|
+
return (_jsx("li", { children: _jsx("a", { href: `#${item.id}`, mix: [
|
|
112
|
+
block(),
|
|
113
|
+
raw({ textWrap: "pretty" }),
|
|
114
|
+
text("sm"),
|
|
115
|
+
fg("neutral"),
|
|
116
|
+
p(1.5, 0),
|
|
117
|
+
pis(`${INDENT_STEP + depth * INDENT_STEP}rem`),
|
|
118
|
+
transition("color"),
|
|
119
|
+
hover(fg("neutral.emphasis")),
|
|
120
|
+
when("&[data-active]", fg("neutral.emphasis")),
|
|
121
|
+
when('&[data-active="lead"]', [fg("brand"), weight("medium")]),
|
|
122
|
+
], children: item.text }) }, item.id));
|
|
123
|
+
}) })] }));
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* An 18px ring in the bar that fills as the reader moves down the list, read from the
|
|
127
|
+
* `--toc-progress` the spy sets on the bar; empty before it loads.
|
|
128
|
+
*/
|
|
129
|
+
function ProgressRing() {
|
|
130
|
+
return () => (_jsxs("svg", { width: "18", height: "18", viewBox: "0 0 18 18", "aria-hidden": "true", mix: [shrink(0), rotate(-90)], children: [_jsx("circle", { cx: "9", cy: "9", r: "7", fill: "none", "stroke-width": "2", mix: [stroke("neutral.border")] }), _jsx("circle", { cx: "9", cy: "9", r: "7", fill: "none", "stroke-width": "2", "stroke-linecap": "round", mix: [
|
|
131
|
+
stroke("brand.solid"),
|
|
132
|
+
raw({
|
|
133
|
+
strokeDasharray: `${RING}px`,
|
|
134
|
+
strokeDashoffset: `calc(${RING}px * (1 - var(--toc-progress, 0)))`,
|
|
135
|
+
transition: `stroke-dashoffset 300ms ${SETTLE}`,
|
|
136
|
+
}),
|
|
137
|
+
media("(prefers-reduced-motion: reduce)", raw({ transition: "none" })),
|
|
138
|
+
] })] }));
|
|
139
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chips that name a product's controls inside help-doc prose: one chip per button, menu or
|
|
3
|
+
* setting, and a path of chips joined by arrows for where to click in order. Each chip
|
|
4
|
+
* stays whole on one line, so a path wraps only between its steps.
|
|
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 UiLabel}.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace UiLabel {
|
|
14
|
+
/** Native `<span>` attributes plus the control's name exactly as the product shows it. */
|
|
15
|
+
interface Props extends TagProps<"span"> {
|
|
16
|
+
children: RemixNode;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders a control's name as a light, hairline-bordered chip in the sans face, so it
|
|
21
|
+
* reads as something on screen rather than as code. It never breaks inside, and sizes
|
|
22
|
+
* relative to the sentence around it.
|
|
23
|
+
*
|
|
24
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
25
|
+
* @returns The render function producing the chip's markup.
|
|
26
|
+
* @example
|
|
27
|
+
* Click <UiLabel>{t("monitors.add")}</UiLabel> to open the form.
|
|
28
|
+
*/
|
|
29
|
+
export declare function UiLabel(handle: Handle<UiLabel.Props>): () => import("remix/component").RemixElement;
|
|
30
|
+
/**
|
|
31
|
+
* Prop types for {@link UiPath}.
|
|
32
|
+
*/
|
|
33
|
+
export declare namespace UiPath {
|
|
34
|
+
/** Native `<span>` attributes plus the controls to click, in order. */
|
|
35
|
+
interface Props extends Omit<TagProps<"span">, "children"> {
|
|
36
|
+
/** Each control's name, in the order the reader clicks them. */
|
|
37
|
+
items: string[];
|
|
38
|
+
/** Drawn between steps. Defaults to {@link DEFAULT_SEPARATOR}; pass `"←"` on a right-to-left page. */
|
|
39
|
+
separator?: string;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Renders a click path as chips joined by a muted separator. Spaces sit around each
|
|
44
|
+
* separator, so a long path breaks between steps and every chip stays whole.
|
|
45
|
+
*
|
|
46
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
47
|
+
* @returns The render function producing the path's markup.
|
|
48
|
+
* @example
|
|
49
|
+
* Open <UiPath items={[t("nav.settings"), t("settings.notifications"), t("channels.add")]} />.
|
|
50
|
+
*/
|
|
51
|
+
export declare function UiPath(handle: Handle<UiPath.Props>): () => import("remix/component").RemixElement;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as _jsx } from "remix/component/jsx-runtime";
|
|
2
|
+
import { bg, border, fg } from "@sdxc/u/color";
|
|
3
|
+
import { rounded } from "@sdxc/u/effects";
|
|
4
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
5
|
+
import { font, nowrap, weight } from "@sdxc/u/typography";
|
|
6
|
+
/** Separator {@link UiPath} draws between steps when `separator` is omitted. */
|
|
7
|
+
const DEFAULT_SEPARATOR = "→";
|
|
8
|
+
/**
|
|
9
|
+
* Renders a control's name as a light, hairline-bordered chip in the sans face, so it
|
|
10
|
+
* reads as something on screen rather than as code. It never breaks inside, and sizes
|
|
11
|
+
* relative to the sentence around it.
|
|
12
|
+
*
|
|
13
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
14
|
+
* @returns The render function producing the chip's markup.
|
|
15
|
+
* @example
|
|
16
|
+
* Click <UiLabel>{t("monitors.add")}</UiLabel> to open the form.
|
|
17
|
+
*/
|
|
18
|
+
export function UiLabel(handle) {
|
|
19
|
+
return () => {
|
|
20
|
+
let { mix, ...rest } = handle.props;
|
|
21
|
+
return (_jsx("span", { ...rest, "data-slot": "ui-label", mix: mergeMix([
|
|
22
|
+
raw({
|
|
23
|
+
display: "inline-block",
|
|
24
|
+
fontSize: "0.875em",
|
|
25
|
+
lineHeight: "1.4",
|
|
26
|
+
padding: "0.0625em 0.4em",
|
|
27
|
+
verticalAlign: "baseline",
|
|
28
|
+
}),
|
|
29
|
+
rounded("0.3125rem"),
|
|
30
|
+
bg("neutral.tint"),
|
|
31
|
+
border({ color: "neutral.border", width: 1, style: "solid" }),
|
|
32
|
+
fg("neutral.emphasis"),
|
|
33
|
+
font("sans"),
|
|
34
|
+
weight("medium"),
|
|
35
|
+
nowrap(),
|
|
36
|
+
], mix) }));
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Renders a click path as chips joined by a muted separator. Spaces sit around each
|
|
41
|
+
* separator, so a long path breaks between steps and every chip stays whole.
|
|
42
|
+
*
|
|
43
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
44
|
+
* @returns The render function producing the path's markup.
|
|
45
|
+
* @example
|
|
46
|
+
* Open <UiPath items={[t("nav.settings"), t("settings.notifications"), t("channels.add")]} />.
|
|
47
|
+
*/
|
|
48
|
+
export function UiPath(handle) {
|
|
49
|
+
return () => {
|
|
50
|
+
let { items, mix, separator, ...rest } = handle.props;
|
|
51
|
+
let glyph = separator ?? DEFAULT_SEPARATOR;
|
|
52
|
+
return (_jsx("span", { ...rest, "data-slot": "ui-path", mix: mix, children: items.flatMap((item, index) => {
|
|
53
|
+
let chip = _jsx(UiLabel, { children: item }, `item-${index}`);
|
|
54
|
+
if (index === 0)
|
|
55
|
+
return [chip];
|
|
56
|
+
return [
|
|
57
|
+
" ",
|
|
58
|
+
_jsx("span", { "data-slot": "ui-path-separator", mix: [fg("neutral.muted")], children: glyph }, `separator-${index}`),
|
|
59
|
+
" ",
|
|
60
|
+
chip,
|
|
61
|
+
];
|
|
62
|
+
}) }));
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shape of a docs sidebar, and how a page is located inside it: a tree of sections
|
|
3
|
+
* holding pages and titled groups of pages. The sidebar draws it and the pager steps
|
|
4
|
+
* through it, so both always agree on the reading order.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* One docs sidebar in the order it is drawn, top to bottom. A site with several parts
|
|
11
|
+
* builds one tree per part, so the pager walks only the part being read.
|
|
12
|
+
*/
|
|
13
|
+
export interface DocsTree {
|
|
14
|
+
/** What the tree is announced as, for the navigation landmark that draws it. */
|
|
15
|
+
label: string;
|
|
16
|
+
sections: DocsTree.Section[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Types for {@link DocsTree} and the helpers that walk it.
|
|
20
|
+
*/
|
|
21
|
+
export declare namespace DocsTree {
|
|
22
|
+
/** A labelled band of the sidebar; its title is the label a pager shows on crossing into it. */
|
|
23
|
+
interface Section {
|
|
24
|
+
title: string;
|
|
25
|
+
items: Item[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A page (`href`) or a titled group of pages (`items`). A group with an `href` is also a
|
|
29
|
+
* page of its own, read before its children.
|
|
30
|
+
*/
|
|
31
|
+
interface Item {
|
|
32
|
+
title: string;
|
|
33
|
+
href?: string;
|
|
34
|
+
/** Short marker drawn beside the title, such as "New" or "Beta". */
|
|
35
|
+
badge?: string;
|
|
36
|
+
items?: Item[];
|
|
37
|
+
}
|
|
38
|
+
/** One page in reading order, with the title of the section it sits in. */
|
|
39
|
+
interface Page {
|
|
40
|
+
title: string;
|
|
41
|
+
href: string;
|
|
42
|
+
section: string;
|
|
43
|
+
}
|
|
44
|
+
/** Options for {@link findNeighbours}. */
|
|
45
|
+
interface NeighbourOptions {
|
|
46
|
+
/**
|
|
47
|
+
* `"section"` keeps the pager inside the current page's section, so a section's last
|
|
48
|
+
* page offers no next page; `"none"` reads the whole tree as one run.
|
|
49
|
+
* @default "none"
|
|
50
|
+
*/
|
|
51
|
+
boundary?: "section" | "none";
|
|
52
|
+
}
|
|
53
|
+
/** The pages either side of the one being read; an end of the run is `null`. */
|
|
54
|
+
interface Neighbours {
|
|
55
|
+
previous: Page | null;
|
|
56
|
+
next: Page | null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Every page in sidebar reading order, groups' pages inline where the group sits. This is
|
|
61
|
+
* the order the pager steps through.
|
|
62
|
+
*
|
|
63
|
+
* @param tree The sidebar to read.
|
|
64
|
+
* @returns Each page with the title of its section.
|
|
65
|
+
* @example
|
|
66
|
+
* flattenDocsTree(tree).map((page) => page.href);
|
|
67
|
+
*/
|
|
68
|
+
export declare function flattenDocsTree(tree: DocsTree): DocsTree.Page[];
|
|
69
|
+
/**
|
|
70
|
+
* The pages before and after `path` in reading order. A path the tree has no page for
|
|
71
|
+
* reports neither neighbour; with `boundary: "section"` a neighbour in another section is
|
|
72
|
+
* `null`, so the pager never wraps into an unrelated part of the docs.
|
|
73
|
+
*
|
|
74
|
+
* @param tree The sidebar to walk.
|
|
75
|
+
* @param path The `href` of the page being read, matched exactly.
|
|
76
|
+
* @param options Where the run stops.
|
|
77
|
+
* @returns The previous and next pages, each with its section title.
|
|
78
|
+
* @example
|
|
79
|
+
* let { previous, next } = findNeighbours(tree, "/docs/install", { boundary: "section" });
|
|
80
|
+
*/
|
|
81
|
+
export declare function findNeighbours(tree: DocsTree, path: string, options?: DocsTree.NeighbourOptions): DocsTree.Neighbours;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shape of a docs sidebar, and how a page is located inside it: a tree of sections
|
|
3
|
+
* holding pages and titled groups of pages. The sidebar draws it and the pager steps
|
|
4
|
+
* through it, so both always agree on the reading order.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Every page in sidebar reading order, groups' pages inline where the group sits. This is
|
|
11
|
+
* the order the pager steps through.
|
|
12
|
+
*
|
|
13
|
+
* @param tree The sidebar to read.
|
|
14
|
+
* @returns Each page with the title of its section.
|
|
15
|
+
* @example
|
|
16
|
+
* flattenDocsTree(tree).map((page) => page.href);
|
|
17
|
+
*/
|
|
18
|
+
export function flattenDocsTree(tree) {
|
|
19
|
+
return tree.sections.flatMap((section) => flattenItems(section.items, section.title));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Pages of one section's items, depth first, each group's own page before its children.
|
|
23
|
+
*/
|
|
24
|
+
function flattenItems(items, section) {
|
|
25
|
+
return items.flatMap((item) => {
|
|
26
|
+
let own = item.href ? [{ title: item.title, href: item.href, section }] : [];
|
|
27
|
+
return item.items ? [...own, ...flattenItems(item.items, section)] : own;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The pages before and after `path` in reading order. A path the tree has no page for
|
|
32
|
+
* reports neither neighbour; with `boundary: "section"` a neighbour in another section is
|
|
33
|
+
* `null`, so the pager never wraps into an unrelated part of the docs.
|
|
34
|
+
*
|
|
35
|
+
* @param tree The sidebar to walk.
|
|
36
|
+
* @param path The `href` of the page being read, matched exactly.
|
|
37
|
+
* @param options Where the run stops.
|
|
38
|
+
* @returns The previous and next pages, each with its section title.
|
|
39
|
+
* @example
|
|
40
|
+
* let { previous, next } = findNeighbours(tree, "/docs/install", { boundary: "section" });
|
|
41
|
+
*/
|
|
42
|
+
export function findNeighbours(tree, path, options = {}) {
|
|
43
|
+
let pages = flattenDocsTree(tree);
|
|
44
|
+
let index = pages.findIndex((page) => page.href === path);
|
|
45
|
+
if (index === -1)
|
|
46
|
+
return { previous: null, next: null };
|
|
47
|
+
let current = pages[index];
|
|
48
|
+
let previous = pages[index - 1] ?? null;
|
|
49
|
+
let next = pages[index + 1] ?? null;
|
|
50
|
+
if (options.boundary === "section") {
|
|
51
|
+
if (previous && previous.section !== current?.section)
|
|
52
|
+
previous = null;
|
|
53
|
+
if (next && next.section !== current?.section)
|
|
54
|
+
next = null;
|
|
55
|
+
}
|
|
56
|
+
return { previous, next };
|
|
57
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brings an element into view inside the box that scrolls it, such as a sticky sidebar or
|
|
3
|
+
* an "On this page" rail, leaving the page's own scroll position where the reader put it.
|
|
4
|
+
* `scrollIntoView` scrolls every ancestor, the document included, so it cannot do this.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The closest ancestor that scrolls vertically and has content to scroll, stopping short
|
|
11
|
+
* of the document body; `null` when only the page itself scrolls.
|
|
12
|
+
*/
|
|
13
|
+
export declare function scrollingAncestor(node: Element): HTMLElement | null;
|
|
14
|
+
/**
|
|
15
|
+
* Scrolls `node`'s scrolling ancestor so `node` is fully visible. `nearest` moves it by
|
|
16
|
+
* the least distance plus a 16px margin, for a marker tracking the reader; `center` puts
|
|
17
|
+
* it mid-box, for a sidebar opening on the current page. A visible node stays put.
|
|
18
|
+
*/
|
|
19
|
+
export declare function revealInScroller(node: Element, align?: "nearest" | "center"): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brings an element into view inside the box that scrolls it, such as a sticky sidebar or
|
|
3
|
+
* an "On this page" rail, leaving the page's own scroll position where the reader put it.
|
|
4
|
+
* `scrollIntoView` scrolls every ancestor, the document included, so it cannot do this.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The closest ancestor that scrolls vertically and has content to scroll, stopping short
|
|
11
|
+
* of the document body; `null` when only the page itself scrolls.
|
|
12
|
+
*/
|
|
13
|
+
export function scrollingAncestor(node) {
|
|
14
|
+
let parent = node.parentElement;
|
|
15
|
+
while (parent && parent !== node.ownerDocument.body) {
|
|
16
|
+
let overflow = getComputedStyle(parent).overflowY;
|
|
17
|
+
let scrolls = overflow === "auto" || overflow === "scroll";
|
|
18
|
+
if (scrolls && parent.scrollHeight > parent.clientHeight)
|
|
19
|
+
return parent;
|
|
20
|
+
parent = parent.parentElement;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Scrolls `node`'s scrolling ancestor so `node` is fully visible. `nearest` moves it by
|
|
26
|
+
* the least distance plus a 16px margin, for a marker tracking the reader; `center` puts
|
|
27
|
+
* it mid-box, for a sidebar opening on the current page. A visible node stays put.
|
|
28
|
+
*/
|
|
29
|
+
export function revealInScroller(node, align = "nearest") {
|
|
30
|
+
let box = scrollingAncestor(node);
|
|
31
|
+
if (!box)
|
|
32
|
+
return;
|
|
33
|
+
let target = node.getBoundingClientRect();
|
|
34
|
+
let frame = box.getBoundingClientRect();
|
|
35
|
+
if (target.top >= frame.top && target.bottom <= frame.bottom)
|
|
36
|
+
return;
|
|
37
|
+
if (align === "center") {
|
|
38
|
+
box.scrollTop += target.top - frame.top - (frame.height - target.height) / 2;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
let delta = target.top < frame.top ? target.top - frame.top : target.bottom - frame.bottom;
|
|
42
|
+
box.scrollTop += delta + Math.sign(delta) * 16;
|
|
43
|
+
}
|