@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,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The opening of every docs page in one order: breadcrumb trail, the page's `<h1>`, its
|
|
3
|
+
* lead, an optional plan or role notice, then one quiet row with the last-updated date
|
|
4
|
+
* and the page actions. Every string arrives as a prop, so a localized site fills it in.
|
|
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 DocsPageHeader}.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace DocsPageHeader {
|
|
14
|
+
/** One step of the trail; a step without `href` is a section with no page of its own. */
|
|
15
|
+
interface Crumb {
|
|
16
|
+
label: string;
|
|
17
|
+
href?: string;
|
|
18
|
+
}
|
|
19
|
+
/** When the page last changed. */
|
|
20
|
+
interface Updated {
|
|
21
|
+
/** Text before the date, such as "Last updated". */
|
|
22
|
+
label: string;
|
|
23
|
+
/** Machine-readable date for `<time datetime>`, such as `2026-10-12`. */
|
|
24
|
+
date: string;
|
|
25
|
+
/** The date as the reader sees it; defaults to `date`. */
|
|
26
|
+
text?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Props accepted by {@link DocsPageHeader}. */
|
|
29
|
+
interface Props extends Omit<TagProps<"header">, "children" | "title"> {
|
|
30
|
+
/** The trail from the docs root to this page; the last crumb is the page itself. */
|
|
31
|
+
crumbs?: Crumb[];
|
|
32
|
+
/** Name of the breadcrumb landmark, such as "Breadcrumb". */
|
|
33
|
+
crumbsLabel?: string;
|
|
34
|
+
title: RemixNode;
|
|
35
|
+
/** Sets the title in the monospace face, for a title that is a name a reader types. */
|
|
36
|
+
mono?: boolean;
|
|
37
|
+
/** The lead under the title. */
|
|
38
|
+
description?: RemixNode;
|
|
39
|
+
updated?: Updated;
|
|
40
|
+
/** Page actions for the meta row, such as `<PageActions>`. */
|
|
41
|
+
actions?: RemixNode;
|
|
42
|
+
/** A plan or role notice drawn under the lead. */
|
|
43
|
+
notice?: RemixNode;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Renders the header. Long names in the title or lead break inside the column, the trail
|
|
48
|
+
* wraps whole steps, and under 30rem of header width the page's own crumb hides since the title names it.
|
|
49
|
+
*
|
|
50
|
+
* @param handle Runtime handle carrying the header's props.
|
|
51
|
+
* @returns The render function producing the header's markup.
|
|
52
|
+
* @example
|
|
53
|
+
* <DocsPageHeader crumbsLabel="Breadcrumb" crumbs={[{ label: "Docs", href: "/docs" }, { label: "Alerts" }]} title="Alerts" description="Page the right person." updated={{ label: "Last updated", date: "2026-10-12", text: "Oct 12, 2026" }} actions={<PageActions … />} />
|
|
54
|
+
*/
|
|
55
|
+
export declare function DocsPageHeader(handle: Handle<DocsPageHeader.Props>): () => import("remix/component").RemixElement;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { fg } from "@sdxc/u/color";
|
|
3
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
4
|
+
import { container, flex, gap, hidden, items, vstack } from "@sdxc/u/layout";
|
|
5
|
+
import { at, atMax } from "@sdxc/u/responsive";
|
|
6
|
+
import { m, minIs } from "@sdxc/u/size";
|
|
7
|
+
import { balance, font, leading, overflowWrap, pretty, text, tracking, weight, } from "@sdxc/u/typography";
|
|
8
|
+
import { Breadcrumbs } from "../components/breadcrumbs.js";
|
|
9
|
+
/** Container the header measures; under 30rem the current crumb leaves the trail to the title. */
|
|
10
|
+
const HEADER_CONTAINER = "ui-docs-page-header";
|
|
11
|
+
/**
|
|
12
|
+
* Renders the header. Long names in the title or lead break inside the column, the trail
|
|
13
|
+
* wraps whole steps, and under 30rem of header width the page's own crumb hides since the title names it.
|
|
14
|
+
*
|
|
15
|
+
* @param handle Runtime handle carrying the header's props.
|
|
16
|
+
* @returns The render function producing the header's markup.
|
|
17
|
+
* @example
|
|
18
|
+
* <DocsPageHeader crumbsLabel="Breadcrumb" crumbs={[{ label: "Docs", href: "/docs" }, { label: "Alerts" }]} title="Alerts" description="Page the right person." updated={{ label: "Last updated", date: "2026-10-12", text: "Oct 12, 2026" }} actions={<PageActions … />} />
|
|
19
|
+
*/
|
|
20
|
+
export function DocsPageHeader(handle) {
|
|
21
|
+
return () => {
|
|
22
|
+
let { crumbs = [], crumbsLabel, title, mono = false, description, updated, actions, notice, mix, ...rest } = handle.props;
|
|
23
|
+
let hasMeta = updated !== undefined || actions !== undefined;
|
|
24
|
+
return (_jsxs("header", { ...rest, "data-slot": "docs-page-header", mix: mergeMix([
|
|
25
|
+
vstack({ gap: 3, align: "stretch" }),
|
|
26
|
+
minIs(0),
|
|
27
|
+
overflowWrap("break-word"),
|
|
28
|
+
container(HEADER_CONTAINER),
|
|
29
|
+
], mix), children: [crumbs.length > 0 ? (_jsx(Breadcrumbs, { "aria-label": crumbsLabel, children: _jsx(Breadcrumbs.List, { mix: [raw({ flexWrap: "wrap", rowGap: "0.25rem" })], children: crumbs.map((crumb, index) => {
|
|
30
|
+
let isCurrent = index === crumbs.length - 1;
|
|
31
|
+
return (_jsx(Breadcrumbs.Item, { mix: [
|
|
32
|
+
raw({ whiteSpace: "nowrap" }),
|
|
33
|
+
isCurrent && index > 0 ? atMax("29.9375rem", HEADER_CONTAINER, hidden()) : [],
|
|
34
|
+
], children: _jsx(Breadcrumbs.Link, { href: isCurrent ? undefined : crumb.href, "aria-current": isCurrent ? "page" : undefined, children: crumb.label }) }, `${index}:${crumb.label}`));
|
|
35
|
+
}) }) })) : null, _jsx("h1", { "data-slot": "docs-page-header-title", mix: [
|
|
36
|
+
m(0),
|
|
37
|
+
fg("neutral.emphasis"),
|
|
38
|
+
weight("semibold"),
|
|
39
|
+
leading(1.1),
|
|
40
|
+
balance(),
|
|
41
|
+
mono
|
|
42
|
+
? [font("mono"), tracking("tight"), text("2xl")]
|
|
43
|
+
: [tracking("-0.02em"), text("3xl")],
|
|
44
|
+
at("48rem", HEADER_CONTAINER, text(mono ? "3xl" : "4xl")),
|
|
45
|
+
], children: title }), description ? (_jsx("p", { "data-slot": "docs-page-header-description", mix: [m(0), text("lg"), leading("relaxed"), fg("neutral"), pretty()], children: description })) : null, notice ?? null, hasMeta ? (_jsxs("div", { "data-slot": "docs-page-header-meta", mix: [
|
|
46
|
+
flex(),
|
|
47
|
+
items("center"),
|
|
48
|
+
gap(2, 4),
|
|
49
|
+
raw({ flexWrap: "wrap" }),
|
|
50
|
+
text("sm"),
|
|
51
|
+
fg("neutral.muted"),
|
|
52
|
+
], children: [updated ? (_jsxs("p", { "data-slot": "docs-page-header-updated", mix: [m(0)], children: [updated.label, " ", _jsx("time", { dateTime: updated.date, children: updated.text ?? updated.date })] })) : null, actions ?? null] })) : null] }));
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The previous and next links closing a docs page, each a whole-card link naming its
|
|
3
|
+
* destination, with the section shown when the step crosses into another one. Pair it
|
|
4
|
+
* with `findNeighbours` from `@sdxc/ui/utils`, which reads the same sidebar tree.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { Handle, Props as TagProps } from "remix/component";
|
|
10
|
+
/**
|
|
11
|
+
* Prop types for {@link DocsPager}.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace DocsPager {
|
|
14
|
+
/** One neighbouring page; a `DocsTree.Page` from `findNeighbours` fits as is. */
|
|
15
|
+
interface Entry {
|
|
16
|
+
title: string;
|
|
17
|
+
href: string;
|
|
18
|
+
/** Title of the section the page sits in, shown when it differs from `section`. */
|
|
19
|
+
section?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Every string the pager shows or announces. */
|
|
22
|
+
interface Labels {
|
|
23
|
+
/** Name of the navigation landmark, such as "Pagination". */
|
|
24
|
+
nav: string;
|
|
25
|
+
previous: string;
|
|
26
|
+
next: string;
|
|
27
|
+
}
|
|
28
|
+
/** Props accepted by {@link DocsPager}. */
|
|
29
|
+
interface Props extends Omit<TagProps<"nav">, "children"> {
|
|
30
|
+
previous?: Entry | null;
|
|
31
|
+
next?: Entry | null;
|
|
32
|
+
/** Section of the page being read; a destination in another section names its own. */
|
|
33
|
+
section?: string;
|
|
34
|
+
labels: Labels;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Renders the pair of neighbours, or nothing when the page has neither. A card with no
|
|
39
|
+
* partner fills the row on its own, and the pair stacks when the pager is under 36rem wide.
|
|
40
|
+
*
|
|
41
|
+
* @param handle Runtime handle carrying the pager's props.
|
|
42
|
+
* @returns The render function producing the pager's markup.
|
|
43
|
+
* @example
|
|
44
|
+
* <DocsPager {...findNeighbours(tree, path)} section="Guides" labels={{ nav: "Pagination", previous: "Previous", next: "Next" }} />
|
|
45
|
+
*/
|
|
46
|
+
export declare function DocsPager(handle: Handle<DocsPager.Props>): () => import("remix/component").RemixElement | null;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { ArrowLeftIcon, ArrowRightIcon } from "@sdxc/icons";
|
|
3
|
+
import { bg, border, fg, outline } from "@sdxc/u/color";
|
|
4
|
+
import { rounded, transition } from "@sdxc/u/effects";
|
|
5
|
+
import { mergeMix } from "@sdxc/u/general";
|
|
6
|
+
import { raw } from "@sdxc/u/general";
|
|
7
|
+
import { container, gap, grid, hstack, vstack } from "@sdxc/u/layout";
|
|
8
|
+
import { motionSafe } from "@sdxc/u/responsive";
|
|
9
|
+
import { is, minIs, p } from "@sdxc/u/size";
|
|
10
|
+
import { hover, when } from "@sdxc/u/state";
|
|
11
|
+
import { translateProperty } from "@sdxc/u/transform";
|
|
12
|
+
import { overflowWrap, text, textAlign, weight } from "@sdxc/u/typography";
|
|
13
|
+
/** Container the pager measures; at 36rem of its own width a pair of cards sits side by side. */
|
|
14
|
+
const PAGER_CONTAINER = "ui-docs-pager";
|
|
15
|
+
/** Selector for a card's arrow, which hover and focus nudge toward the destination. */
|
|
16
|
+
const ARROW = '& [data-slot="docs-pager-arrow"]';
|
|
17
|
+
/**
|
|
18
|
+
* Renders the pair of neighbours, or nothing when the page has neither. A card with no
|
|
19
|
+
* partner fills the row on its own, and the pair stacks when the pager is under 36rem wide.
|
|
20
|
+
*
|
|
21
|
+
* @param handle Runtime handle carrying the pager's props.
|
|
22
|
+
* @returns The render function producing the pager's markup.
|
|
23
|
+
* @example
|
|
24
|
+
* <DocsPager {...findNeighbours(tree, path)} section="Guides" labels={{ nav: "Pagination", previous: "Previous", next: "Next" }} />
|
|
25
|
+
*/
|
|
26
|
+
export function DocsPager(handle) {
|
|
27
|
+
return () => {
|
|
28
|
+
let { previous, next, section, labels, mix, ...rest } = handle.props;
|
|
29
|
+
if (!previous && !next)
|
|
30
|
+
return null;
|
|
31
|
+
let paired = Boolean(previous && next);
|
|
32
|
+
return (_jsx("nav", { ...rest, "aria-label": labels.nav, "data-slot": "docs-pager", mix: mergeMix([is("100%"), container(PAGER_CONTAINER)], mix), children: _jsxs("div", { mix: [
|
|
33
|
+
grid(),
|
|
34
|
+
gap(3),
|
|
35
|
+
/**
|
|
36
|
+
* Both column counts live in one rule, so the wide layout always wins at its
|
|
37
|
+
* width whatever order the stylesheet layers land in.
|
|
38
|
+
*/
|
|
39
|
+
raw({
|
|
40
|
+
gridTemplateColumns: "minmax(0, 1fr)",
|
|
41
|
+
[`@container ${PAGER_CONTAINER} (min-width: 36rem)`]: {
|
|
42
|
+
gridTemplateColumns: paired ? "repeat(2, minmax(0, 1fr))" : "minmax(0, 1fr)",
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
], children: [previous ? (_jsx(DocsPagerCard, { entry: previous, label: labels.previous, direction: "previous", section: section })) : null, next ? (_jsx(DocsPagerCard, { entry: next, label: labels.next, direction: "next", section: section })) : null] }) }));
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* One neighbour as a single `<a>`, so every pixel of the card follows the link. The
|
|
50
|
+
* previous card reads from the start edge and the next from the end edge, so each points
|
|
51
|
+
* the way it goes.
|
|
52
|
+
*/
|
|
53
|
+
function DocsPagerCard(handle) {
|
|
54
|
+
return () => {
|
|
55
|
+
let { direction, entry, label, section } = handle.props;
|
|
56
|
+
let isNext = direction === "next";
|
|
57
|
+
let Arrow = isNext ? ArrowRightIcon : ArrowLeftIcon;
|
|
58
|
+
let showSection = entry.section !== undefined && entry.section !== section;
|
|
59
|
+
let arrow = (_jsx(Arrow, { size: 14, "aria-hidden": "true", "data-slot": "docs-pager-arrow", mix: [transition("translate")] }));
|
|
60
|
+
return (_jsxs("a", { href: entry.href, rel: isNext ? "next" : "prev", "data-slot": "docs-pager-card", "data-direction": direction, mix: [
|
|
61
|
+
vstack({ gap: 1, align: isNext ? "end" : "start" }),
|
|
62
|
+
minIs(0),
|
|
63
|
+
p(4, 5),
|
|
64
|
+
rounded("lg"),
|
|
65
|
+
border({ color: "neutral.border", width: 1, style: "solid" }),
|
|
66
|
+
textAlign(isNext ? "end" : "start"),
|
|
67
|
+
overflowWrap("anywhere"),
|
|
68
|
+
transition("border-color, background-color"),
|
|
69
|
+
hover([border("brand.border"), bg("neutral.bg-tint")]),
|
|
70
|
+
when("&:focus-visible", outline({ color: "brand.ring", offset: 2 })),
|
|
71
|
+
motionSafe(when("&:hover, &:focus-visible", when(ARROW, translateProperty(isNext ? "2px 0" : "-2px 0")))),
|
|
72
|
+
], children: [_jsxs("span", { mix: [hstack({ gap: 1.5, align: "center" }), text("xs"), fg("neutral.muted")], children: [isNext ? null : arrow, label, showSection ? _jsx("span", { "aria-hidden": "true", children: "\u00B7" }) : null, showSection ? _jsx("span", { "data-slot": "docs-pager-section", children: entry.section }) : null, isNext ? arrow : null] }), _jsx("span", { "data-slot": "docs-pager-title", mix: [text("base"), weight("medium"), fg("brand")], children: entry.title })] }));
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A project layout drawn as a tree: directories are native `<details>` that fold without
|
|
3
|
+
* JavaScript, files carry an icon for their type, the file a page is about stands out as
|
|
4
|
+
* an accent pill, and short comments explain an entry in muted text beside it.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { Handle, Props as TagProps } from "remix/component";
|
|
10
|
+
/** Placeholder entry standing for "more files here" that a tree leaves out. */
|
|
11
|
+
declare const MORE = "\u2026";
|
|
12
|
+
/**
|
|
13
|
+
* Prop types for {@link FileTree}.
|
|
14
|
+
*/
|
|
15
|
+
export declare namespace FileTree {
|
|
16
|
+
/**
|
|
17
|
+
* One file or directory. An entry with `children`, even an empty array, is a directory;
|
|
18
|
+
* one without is a file.
|
|
19
|
+
*/
|
|
20
|
+
interface Node {
|
|
21
|
+
name: string;
|
|
22
|
+
/** A few muted words after the name saying what the entry is for. */
|
|
23
|
+
comment?: string;
|
|
24
|
+
/** Marks the file or directory the surrounding page is about, drawn as an accent pill. */
|
|
25
|
+
highlight?: boolean;
|
|
26
|
+
/** A directory's entries; the `"…"` string stands for files the tree leaves out. */
|
|
27
|
+
children?: Entry[];
|
|
28
|
+
/** Renders a directory folded; directories render open by default. */
|
|
29
|
+
collapsed?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** A file, a directory, or the `"…"` placeholder for entries left out. */
|
|
32
|
+
type Entry = Node | typeof MORE;
|
|
33
|
+
/** Native `<div>` attributes plus the tree's entries and its accessible name. */
|
|
34
|
+
interface Props extends Omit<TagProps<"div">, "title"> {
|
|
35
|
+
nodes: Entry[];
|
|
36
|
+
/** Names the tree for assistive technology, such as "Project layout". */
|
|
37
|
+
"aria-label": string;
|
|
38
|
+
/** A caption drawn above the tree, such as the project or directory the tree shows. */
|
|
39
|
+
title?: string;
|
|
40
|
+
/** Accessible text for the `"…"` placeholder, such as "More files". */
|
|
41
|
+
moreLabel?: string;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Renders the tree's card: an optional caption, then the top level of entries in a box
|
|
46
|
+
* that scrolls sideways on its own when a deep path is wider than the page.
|
|
47
|
+
*
|
|
48
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
49
|
+
* @returns The render function producing the tree's markup.
|
|
50
|
+
* @example
|
|
51
|
+
* <FileTree aria-label="Project layout" nodes={[
|
|
52
|
+
* { name: "app", children: [{ name: "routes.ts", highlight: true, comment: "every URL" }, "…"] },
|
|
53
|
+
* { name: "package.json" },
|
|
54
|
+
* ]} />
|
|
55
|
+
*/
|
|
56
|
+
export declare function FileTree(handle: Handle<FileTree.Props>): () => import("remix/component").RemixElement;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { EllipsisIcon, FileBracesIcon, FileCodeIcon, FileCogIcon, FileIcon, FileImageIcon, FileLockIcon, FileTerminalIcon, FileTextIcon, FileTypeIcon, FolderIcon, FolderOpenIcon, } from "@sdxc/icons";
|
|
3
|
+
import { bg, border, borderEdge, fg } from "@sdxc/u/color";
|
|
4
|
+
import { rounded } from "@sdxc/u/effects";
|
|
5
|
+
import { cursor, listStyle, mergeMix, raw } from "@sdxc/u/general";
|
|
6
|
+
import { hidden, hstack, inlineFlex, shrink, vstack } from "@sdxc/u/layout";
|
|
7
|
+
import { overflowX } from "@sdxc/u/overflow";
|
|
8
|
+
import { m, minIs, mis, p, pi, pis } from "@sdxc/u/size";
|
|
9
|
+
import { focusVisible, when } from "@sdxc/u/state";
|
|
10
|
+
import { font, nowrap, text, weight } from "@sdxc/u/typography";
|
|
11
|
+
/** Placeholder entry standing for "more files here" that a tree leaves out. */
|
|
12
|
+
const MORE = "…";
|
|
13
|
+
/** Matches an icon inside the summary row of an open directory, and only that directory's. */
|
|
14
|
+
const OPEN_ROW = ":is(details[open] > summary) &";
|
|
15
|
+
/** Icons for file extensions whose type a reader recognises at a glance. */
|
|
16
|
+
const ICON_BY_EXTENSION = {
|
|
17
|
+
ts: FileCodeIcon,
|
|
18
|
+
tsx: FileCodeIcon,
|
|
19
|
+
js: FileCodeIcon,
|
|
20
|
+
jsx: FileCodeIcon,
|
|
21
|
+
mjs: FileCodeIcon,
|
|
22
|
+
cjs: FileCodeIcon,
|
|
23
|
+
mts: FileCodeIcon,
|
|
24
|
+
cts: FileCodeIcon,
|
|
25
|
+
html: FileCodeIcon,
|
|
26
|
+
sql: FileCodeIcon,
|
|
27
|
+
json: FileBracesIcon,
|
|
28
|
+
jsonc: FileBracesIcon,
|
|
29
|
+
md: FileTextIcon,
|
|
30
|
+
mdx: FileTextIcon,
|
|
31
|
+
txt: FileTextIcon,
|
|
32
|
+
css: FileTypeIcon,
|
|
33
|
+
png: FileImageIcon,
|
|
34
|
+
jpg: FileImageIcon,
|
|
35
|
+
jpeg: FileImageIcon,
|
|
36
|
+
gif: FileImageIcon,
|
|
37
|
+
svg: FileImageIcon,
|
|
38
|
+
webp: FileImageIcon,
|
|
39
|
+
avif: FileImageIcon,
|
|
40
|
+
ico: FileImageIcon,
|
|
41
|
+
sh: FileTerminalIcon,
|
|
42
|
+
toml: FileCogIcon,
|
|
43
|
+
yaml: FileCogIcon,
|
|
44
|
+
yml: FileCogIcon,
|
|
45
|
+
env: FileCogIcon,
|
|
46
|
+
lock: FileLockIcon,
|
|
47
|
+
lockb: FileLockIcon,
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Picks a file's icon from its extension, treating a dotfile's name as its extension
|
|
51
|
+
* (`.env`), and falls back to a plain file icon for anything unrecognised.
|
|
52
|
+
*
|
|
53
|
+
* @param name File name as shown in the tree.
|
|
54
|
+
*/
|
|
55
|
+
function iconFor(name) {
|
|
56
|
+
let dot = name.lastIndexOf(".");
|
|
57
|
+
if (dot === -1)
|
|
58
|
+
return FileIcon;
|
|
59
|
+
return ICON_BY_EXTENSION[name.slice(dot + 1).toLowerCase()] ?? FileIcon;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Renders the tree's card: an optional caption, then the top level of entries in a box
|
|
63
|
+
* that scrolls sideways on its own when a deep path is wider than the page.
|
|
64
|
+
*
|
|
65
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
66
|
+
* @returns The render function producing the tree's markup.
|
|
67
|
+
* @example
|
|
68
|
+
* <FileTree aria-label="Project layout" nodes={[
|
|
69
|
+
* { name: "app", children: [{ name: "routes.ts", highlight: true, comment: "every URL" }, "…"] },
|
|
70
|
+
* { name: "package.json" },
|
|
71
|
+
* ]} />
|
|
72
|
+
*/
|
|
73
|
+
export function FileTree(handle) {
|
|
74
|
+
return () => {
|
|
75
|
+
let { "aria-label": label, mix, moreLabel, nodes, title, ...rest } = handle.props;
|
|
76
|
+
return (_jsxs("div", { ...rest, "data-slot": "file-tree", mix: mergeMix([
|
|
77
|
+
vstack({ gap: 2, align: "stretch" }),
|
|
78
|
+
minIs(0),
|
|
79
|
+
p(3, 4),
|
|
80
|
+
rounded("lg"),
|
|
81
|
+
bg("neutral.tint"),
|
|
82
|
+
border({ color: "neutral.border", width: 1, style: "solid" }),
|
|
83
|
+
overflowX("auto"),
|
|
84
|
+
font("mono"),
|
|
85
|
+
text("sm"),
|
|
86
|
+
], mix), children: [title ? (_jsx("p", { "data-slot": "file-tree-title", mix: [m(0), fg("neutral.muted")], children: title })) : null, _jsx(EntryList, { "aria-label": label, entries: nodes, moreLabel: moreLabel })] }));
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* One level of the tree as a list; the list keeps the entries' count and position
|
|
91
|
+
* available to screen readers.
|
|
92
|
+
*/
|
|
93
|
+
function EntryList(handle) {
|
|
94
|
+
return () => {
|
|
95
|
+
let { "aria-label": label, entries, moreLabel } = handle.props;
|
|
96
|
+
return (_jsx("ul", { "aria-label": label, "data-slot": "file-tree-list", "data-not-typeset": "", mix: [listStyle("none"), m(0), p(0), vstack({ gap: 0.5, align: "start" })], children: entries.map((entry, index) => (_jsx(Entry, { entry: entry, moreLabel: moreLabel }, typeof entry === "string" ? `more-${index}` : entry.name))) }));
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* One entry: the `"…"` placeholder, a directory whose row toggles its `<details>`, or a
|
|
101
|
+
* file row. A directory's icon swaps between closed and open folders with its state.
|
|
102
|
+
*/
|
|
103
|
+
function Entry(handle) {
|
|
104
|
+
return () => {
|
|
105
|
+
let { entry, moreLabel } = handle.props;
|
|
106
|
+
if (entry === MORE) {
|
|
107
|
+
return (_jsx("li", { "data-slot": "file-tree-more", "aria-label": moreLabel, mix: [m(0), fg("neutral.muted")], children: _jsx("span", { mix: [hstack({ gap: 2, align: "center" })], children: _jsx(EllipsisIcon, { size: 16, "aria-hidden": "true" }) }) }));
|
|
108
|
+
}
|
|
109
|
+
if (entry.children === undefined) {
|
|
110
|
+
let Glyph = iconFor(entry.name);
|
|
111
|
+
return (_jsx("li", { "data-slot": "file-tree-file", mix: [m(0)], children: _jsx(Row, { node: entry, children: _jsx(Glyph, { size: 16, "aria-hidden": "true" }) }) }));
|
|
112
|
+
}
|
|
113
|
+
return (_jsx("li", { "data-slot": "file-tree-directory", mix: [m(0), minIs(0)], children: _jsxs("details", { open: !entry.collapsed, children: [_jsx("summary", { mix: [
|
|
114
|
+
listStyle("none"),
|
|
115
|
+
cursor("pointer"),
|
|
116
|
+
rounded("sm"),
|
|
117
|
+
when("&::-webkit-details-marker", raw({ display: "none" })),
|
|
118
|
+
focusVisible(raw({ outline: "2px solid var(--ui-brand-ring)", outlineOffset: "1px" })),
|
|
119
|
+
], children: _jsxs(Row, { node: entry, children: [_jsx("span", { "data-slot": "file-tree-folder-closed", mix: [inlineFlex(), when(OPEN_ROW, hidden())], children: _jsx(FolderIcon, { size: 16, "aria-hidden": "true" }) }), _jsx("span", { "data-slot": "file-tree-folder-open", mix: [hidden(), when(OPEN_ROW, inlineFlex())], children: _jsx(FolderOpenIcon, { size: 16, "aria-hidden": "true" }) })] }) }), _jsx("div", { mix: [
|
|
120
|
+
mis(2),
|
|
121
|
+
pis(4),
|
|
122
|
+
raw({ paddingBlockStart: "0.125rem" }),
|
|
123
|
+
borderEdge("inline-start", { color: "neutral.border", width: 1, style: "solid" }),
|
|
124
|
+
], children: _jsx(EntryList, { entries: entry.children, moreLabel: moreLabel }) })] }) }));
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/** Draws one entry's icon, name (as a pill when highlighted) and comment on one line. */
|
|
128
|
+
function Row(handle) {
|
|
129
|
+
return () => {
|
|
130
|
+
let { children, node } = handle.props;
|
|
131
|
+
let isDirectory = node.children !== undefined;
|
|
132
|
+
return (_jsxs("span", { "data-slot": "file-tree-row", mix: [inlineFlex(), hstack({ gap: 2, align: "center" }), nowrap()], children: [_jsx("span", { "data-slot": "file-tree-icon", mix: [inlineFlex(), shrink(0), fg(isDirectory ? "brand" : "neutral.muted")], children: children }), _jsx("span", { "data-slot": "file-tree-name", "data-highlight": node.highlight ? "" : undefined, mix: node.highlight
|
|
133
|
+
? [
|
|
134
|
+
pi(1.5),
|
|
135
|
+
rounded("full"),
|
|
136
|
+
bg("brand.tint"),
|
|
137
|
+
fg("brand.emphasis"),
|
|
138
|
+
weight("semibold"),
|
|
139
|
+
]
|
|
140
|
+
: [fg("neutral.emphasis")], children: node.name }), node.comment ? (_jsx("span", { "data-slot": "file-tree-comment", mix: [fg("neutral.muted")], children: node.comment })) : null] }));
|
|
141
|
+
};
|
|
142
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel for `@sdxc/ui/docs`: the documentation shell, its navigation and content
|
|
3
|
+
* blocks, with the helpers only they use. Each component also imports on its own as
|
|
4
|
+
* `@sdxc/ui/docs/<module>`, which is also how its islands load.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
export * from "./anchor-heading.js";
|
|
10
|
+
export * from "./callout.js";
|
|
11
|
+
export * from "./code-block.js";
|
|
12
|
+
export * from "./code-tabs-sync.js";
|
|
13
|
+
export * from "./code-tabs.js";
|
|
14
|
+
export * from "./copy-button.js";
|
|
15
|
+
export * from "./docs-feedback.js";
|
|
16
|
+
export * from "./docs-footer.js";
|
|
17
|
+
export * from "./docs-hub.js";
|
|
18
|
+
export * from "./docs-layout.js";
|
|
19
|
+
export * from "./docs-nav-tools.js";
|
|
20
|
+
export * from "./docs-nav.js";
|
|
21
|
+
export * from "./docs-not-found.js";
|
|
22
|
+
export * from "./docs-page-header.js";
|
|
23
|
+
export * from "./docs-pager.js";
|
|
24
|
+
export * from "./file-tree.js";
|
|
25
|
+
export * from "./install-command.js";
|
|
26
|
+
export * from "./mixins/code-tabs-sync.js";
|
|
27
|
+
export * from "./mixins/copy-feedback.js";
|
|
28
|
+
export * from "./mixins/copy-from-url.js";
|
|
29
|
+
export * from "./mixins/docs-nav-tools.js";
|
|
30
|
+
export * from "./mixins/toc-spy.js";
|
|
31
|
+
export * from "./next-steps.js";
|
|
32
|
+
export * from "./page-actions.js";
|
|
33
|
+
export * from "./plan-notice.js";
|
|
34
|
+
export * from "./props-table.js";
|
|
35
|
+
export * from "./steps.js";
|
|
36
|
+
export * from "./table-of-contents.js";
|
|
37
|
+
export * from "./ui-label.js";
|
|
38
|
+
export * from "./utils/docs-tree.js";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel for `@sdxc/ui/docs`: the documentation shell, its navigation and content
|
|
3
|
+
* blocks, with the helpers only they use. Each component also imports on its own as
|
|
4
|
+
* `@sdxc/ui/docs/<module>`, which is also how its islands load.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
export * from "./anchor-heading.js";
|
|
10
|
+
export * from "./callout.js";
|
|
11
|
+
export * from "./code-block.js";
|
|
12
|
+
export * from "./code-tabs-sync.js";
|
|
13
|
+
export * from "./code-tabs.js";
|
|
14
|
+
export * from "./copy-button.js";
|
|
15
|
+
export * from "./docs-feedback.js";
|
|
16
|
+
export * from "./docs-footer.js";
|
|
17
|
+
export * from "./docs-hub.js";
|
|
18
|
+
export * from "./docs-layout.js";
|
|
19
|
+
export * from "./docs-nav-tools.js";
|
|
20
|
+
export * from "./docs-nav.js";
|
|
21
|
+
export * from "./docs-not-found.js";
|
|
22
|
+
export * from "./docs-page-header.js";
|
|
23
|
+
export * from "./docs-pager.js";
|
|
24
|
+
export * from "./file-tree.js";
|
|
25
|
+
export * from "./install-command.js";
|
|
26
|
+
export * from "./mixins/code-tabs-sync.js";
|
|
27
|
+
export * from "./mixins/copy-feedback.js";
|
|
28
|
+
export * from "./mixins/copy-from-url.js";
|
|
29
|
+
export * from "./mixins/docs-nav-tools.js";
|
|
30
|
+
export * from "./mixins/toc-spy.js";
|
|
31
|
+
export * from "./next-steps.js";
|
|
32
|
+
export * from "./page-actions.js";
|
|
33
|
+
export * from "./plan-notice.js";
|
|
34
|
+
export * from "./props-table.js";
|
|
35
|
+
export * from "./steps.js";
|
|
36
|
+
export * from "./table-of-contents.js";
|
|
37
|
+
export * from "./ui-label.js";
|
|
38
|
+
export * from "./utils/docs-tree.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The install line a docs page prints for its packages, spelled by each package manager
|
|
3
|
+
* in a synced set of code tabs: a reader who picks Bun once sees Bun in every install
|
|
4
|
+
* line, on this page and the next.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { Handle, Props as TagProps } from "remix/component";
|
|
10
|
+
import type { CodeTabsPersistence } from "./mixins/code-tabs-sync.js";
|
|
11
|
+
import { CodeBlock } from "./code-block.js";
|
|
12
|
+
/**
|
|
13
|
+
* Prop types for {@link InstallCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export declare namespace InstallCommand {
|
|
16
|
+
/** A package manager the strip offers, which is also the value its sync key stores. */
|
|
17
|
+
type Manager = "npm" | "pnpm" | "yarn" | "bun";
|
|
18
|
+
/** Props accepted by {@link InstallCommand}. */
|
|
19
|
+
interface Props extends Omit<TagProps<"form">, "children" | "aria-label" | "title"> {
|
|
20
|
+
/** Package specifiers to install, such as `["@sdxc/ui", "remix@3.1.0"]`. */
|
|
21
|
+
packages: readonly string[];
|
|
22
|
+
/** Installs them as development dependencies. */
|
|
23
|
+
dev?: boolean;
|
|
24
|
+
/** Defaults to `package-manager`, so every install line on the site follows one choice. */
|
|
25
|
+
syncKey?: string;
|
|
26
|
+
/** Where the choice is remembered; see `CodeTabs`. Defaults to `local`. */
|
|
27
|
+
persist?: CodeTabsPersistence;
|
|
28
|
+
/** The manager to render selected, such as the one a cookie remembered. */
|
|
29
|
+
selected?: string;
|
|
30
|
+
/** The managers to offer, in order. Defaults to npm, pnpm, yarn and bun. */
|
|
31
|
+
managers?: readonly Manager[];
|
|
32
|
+
/** The header each block reads as, such as "Terminal". */
|
|
33
|
+
title?: string;
|
|
34
|
+
labels: CodeBlock.Labels;
|
|
35
|
+
/** Names the strip for assistive technology, such as "Package manager". */
|
|
36
|
+
"aria-label": string;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Renders one terminal block per manager inside a synced {@link CodeTabs}.
|
|
41
|
+
*
|
|
42
|
+
* @param handle Runtime handle carrying the command's props.
|
|
43
|
+
* @returns The render function producing the tabs.
|
|
44
|
+
* @example
|
|
45
|
+
* <InstallCommand packages={["@sdxc/ui"]} title={t("terminal")} aria-label={t("packageManager")} labels={{ copy: t("copy"), copied: t("copied") }} />
|
|
46
|
+
*/
|
|
47
|
+
export declare function InstallCommand(handle: Handle<InstallCommand.Props>): () => import("remix/component").RemixElement;
|
|
48
|
+
/**
|
|
49
|
+
* The install line `manager` spells: npm installs, every other manager adds, and all
|
|
50
|
+
* four take `-D` for a development dependency.
|
|
51
|
+
*
|
|
52
|
+
* @example installLine("bun", ["@sdxc/ui"], true) // "bun add -D @sdxc/ui"
|
|
53
|
+
*/
|
|
54
|
+
export declare function installLine(manager: InstallCommand.Manager, packages: readonly string[], dev: boolean): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "remix/component/jsx-runtime";
|
|
2
|
+
import { CodeBlock } from "./code-block.js";
|
|
3
|
+
import { CodeTabs } from "./code-tabs.js";
|
|
4
|
+
/** The managers on offer, in the order the strip reads; the first is the default choice. */
|
|
5
|
+
const PACKAGE_MANAGERS = ["npm", "pnpm", "yarn", "bun"];
|
|
6
|
+
/**
|
|
7
|
+
* Renders one terminal block per manager inside a synced {@link CodeTabs}.
|
|
8
|
+
*
|
|
9
|
+
* @param handle Runtime handle carrying the command's props.
|
|
10
|
+
* @returns The render function producing the tabs.
|
|
11
|
+
* @example
|
|
12
|
+
* <InstallCommand packages={["@sdxc/ui"]} title={t("terminal")} aria-label={t("packageManager")} labels={{ copy: t("copy"), copied: t("copied") }} />
|
|
13
|
+
*/
|
|
14
|
+
export function InstallCommand(handle) {
|
|
15
|
+
return () => {
|
|
16
|
+
let { dev = false, labels, managers = PACKAGE_MANAGERS, packages, syncKey = "package-manager", title, ...rest } = handle.props;
|
|
17
|
+
return (_jsx(CodeTabs, { ...rest, syncKey: syncKey, tabs: managers.map((manager) => ({
|
|
18
|
+
label: manager,
|
|
19
|
+
value: manager,
|
|
20
|
+
children: (_jsx(CodeBlock, { title: title, language: "sh", code: installLine(manager, packages, dev), labels: labels })),
|
|
21
|
+
})) }));
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The install line `manager` spells: npm installs, every other manager adds, and all
|
|
26
|
+
* four take `-D` for a development dependency.
|
|
27
|
+
*
|
|
28
|
+
* @example installLine("bun", ["@sdxc/ui"], true) // "bun add -D @sdxc/ui"
|
|
29
|
+
*/
|
|
30
|
+
export function installLine(manager, packages, dev) {
|
|
31
|
+
let verb = manager === "npm" ? "install" : "add";
|
|
32
|
+
return [manager, verb, ...(dev ? ["-D"] : []), ...packages].join(" ");
|
|
33
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why JS: a reader who picks Bun in one set of code tabs expects every set sharing that
|
|
3
|
+
* choice to switch, on this page and the next; radios only know their own group.
|
|
4
|
+
* No-JS baseline: each set still switches on its own through its radios and CSS.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { ElementProps, MixinFactory } from "remix/component";
|
|
10
|
+
/** Where a set of code tabs remembers the reader's choice between pages. */
|
|
11
|
+
export type CodeTabsPersistence = "cookie" | "local" | "none";
|
|
12
|
+
/** Attribute every set of code tabs carries, holding its sync key (empty when unsynced). */
|
|
13
|
+
export declare const CODE_TABS_ATTRIBUTE = "data-code-tabs";
|
|
14
|
+
/**
|
|
15
|
+
* The cookie and `localStorage` key a sync key's choice is stored under. A server that
|
|
16
|
+
* renders the remembered choice reads the cookie by this name, or uses
|
|
17
|
+
* {@link readCodeTabsCookie}.
|
|
18
|
+
*
|
|
19
|
+
* @param syncKey The key the tab sets share, such as `package-manager`.
|
|
20
|
+
* @returns The storage key, such as `ui-code-tabs.package-manager`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function codeTabsStorageKey(syncKey: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Reads the remembered choice for `syncKey` from a request's `Cookie` header, so the
|
|
25
|
+
* server renders the reader's tab already selected and the page never flashes.
|
|
26
|
+
*
|
|
27
|
+
* @param cookieHeader The request's `Cookie` header, or nothing when none was sent.
|
|
28
|
+
* @param syncKey The key the tab sets share.
|
|
29
|
+
* @returns The chosen tab's value, or `undefined` when the reader has not chosen.
|
|
30
|
+
* @example <CodeTabs syncKey="package-manager" persist="cookie" selected={readCodeTabsCookie(request.headers.get("Cookie"), "package-manager")} … />
|
|
31
|
+
*/
|
|
32
|
+
export declare function readCodeTabsCookie(cookieHeader: string | null | undefined, syncKey: string): string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Keeps every set of code tabs sharing `syncKey` on one choice. Attach it to an element
|
|
35
|
+
* inside the set: on insertion it selects the remembered choice (a cached page was
|
|
36
|
+
* rendered for whoever asked first), and each switch is stored and mirrored into the
|
|
37
|
+
* other sets on the page. With `local` storage, other browser tabs follow too.
|
|
38
|
+
*
|
|
39
|
+
* @param syncKey The key the tab sets share.
|
|
40
|
+
* @param persist Where the choice is remembered between pages.
|
|
41
|
+
* @returns A mixin descriptor for an element inside the set's `[data-code-tabs]` root.
|
|
42
|
+
* @example <span hidden mix={[codeTabsSync("package-manager", "cookie")]} />
|
|
43
|
+
*/
|
|
44
|
+
export declare const codeTabsSync: MixinFactory<HTMLElement, [
|
|
45
|
+
syncKey: string,
|
|
46
|
+
persist: CodeTabsPersistence
|
|
47
|
+
], ElementProps>;
|