@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,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The hand-written "Next steps" block that ends a guide: two to four links, each with
|
|
3
|
+
* one line on what it gets the reader, drawn as cards or as a list. Its title is a real
|
|
4
|
+
* heading at the surrounding scope's level, with an optional id an outline can link to.
|
|
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 { HeadingLevel } from "../components/heading-scope.js";
|
|
11
|
+
/**
|
|
12
|
+
* Prop types for {@link NextSteps}.
|
|
13
|
+
*/
|
|
14
|
+
export declare namespace NextSteps {
|
|
15
|
+
/** `cards` tiles the links in an auto-fitting grid; `list` runs them down a ruled list. */
|
|
16
|
+
type Variant = "cards" | "list";
|
|
17
|
+
/** One destination and the one line saying what it gets the reader. */
|
|
18
|
+
interface Item {
|
|
19
|
+
title: string;
|
|
20
|
+
href: string;
|
|
21
|
+
description: string;
|
|
22
|
+
}
|
|
23
|
+
/** Props accepted by {@link NextSteps}. */
|
|
24
|
+
interface Props extends Omit<TagProps<"section">, "children" | "title" | "id"> {
|
|
25
|
+
title: string;
|
|
26
|
+
/** Id of the heading, so a table of contents can link to the block. */
|
|
27
|
+
id?: string;
|
|
28
|
+
/** Heading level; defaults to the ambient `HeadingScope` level, else {@link DEFAULT_LEVEL}. */
|
|
29
|
+
level?: HeadingLevel;
|
|
30
|
+
/** Two to four destinations, in the order a reader should consider them. */
|
|
31
|
+
items: Item[];
|
|
32
|
+
/** Defaults to {@link DEFAULT_VARIANT}. */
|
|
33
|
+
variant?: Variant;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Renders the titled block, named by its heading. The heading takes `level`, else the
|
|
38
|
+
* ambient `HeadingScope` level, else `<h2>`; each item is one whole-card or whole-row link.
|
|
39
|
+
*
|
|
40
|
+
* @param handle Runtime handle carrying the block's props.
|
|
41
|
+
* @returns The render function producing the block's markup.
|
|
42
|
+
* @example
|
|
43
|
+
* <NextSteps title="Next steps" id="next-steps" items={[{ title: "Add alerts", href: "/docs/alerts", description: "Page the right person." }]} />
|
|
44
|
+
*/
|
|
45
|
+
export declare function NextSteps(handle: Handle<NextSteps.Props>): () => import("remix/component").RemixElement;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { ArrowRightIcon } from "@sdxc/icons";
|
|
3
|
+
import { bg, border, borderEdge, fg, outline } from "@sdxc/u/color";
|
|
4
|
+
import { rounded, transition } from "@sdxc/u/effects";
|
|
5
|
+
import { listStyle, mergeMix } from "@sdxc/u/general";
|
|
6
|
+
import { gap, grid, gridTemplate, hstack, vstack } from "@sdxc/u/layout";
|
|
7
|
+
import { motionSafe } from "@sdxc/u/responsive";
|
|
8
|
+
import { m, minIs, p, pb } from "@sdxc/u/size";
|
|
9
|
+
import { hover, when } from "@sdxc/u/state";
|
|
10
|
+
import { translateProperty } from "@sdxc/u/transform";
|
|
11
|
+
import { leading, overflowWrap, pretty, text, weight } from "@sdxc/u/typography";
|
|
12
|
+
import { readAmbientLevel, TAG_BY_LEVEL } from "../components/heading-scope.js";
|
|
13
|
+
/** Look {@link NextSteps} draws when `variant` is omitted. */
|
|
14
|
+
const DEFAULT_VARIANT = "cards";
|
|
15
|
+
/** Heading level with no `level` prop and no `HeadingScope` around the block: a section of the page. */
|
|
16
|
+
const DEFAULT_LEVEL = 2;
|
|
17
|
+
/** Selector for a link's arrow, which hover and focus nudge forward. */
|
|
18
|
+
const ARROW = '& [data-slot="next-steps-arrow"]';
|
|
19
|
+
/**
|
|
20
|
+
* Renders the titled block, named by its heading. The heading takes `level`, else the
|
|
21
|
+
* ambient `HeadingScope` level, else `<h2>`; each item is one whole-card or whole-row link.
|
|
22
|
+
*
|
|
23
|
+
* @param handle Runtime handle carrying the block's props.
|
|
24
|
+
* @returns The render function producing the block's markup.
|
|
25
|
+
* @example
|
|
26
|
+
* <NextSteps title="Next steps" id="next-steps" items={[{ title: "Add alerts", href: "/docs/alerts", description: "Page the right person." }]} />
|
|
27
|
+
*/
|
|
28
|
+
export function NextSteps(handle) {
|
|
29
|
+
return () => {
|
|
30
|
+
let { title, id, level, items, variant, mix, ...rest } = handle.props;
|
|
31
|
+
let resolvedVariant = variant ?? DEFAULT_VARIANT;
|
|
32
|
+
let Tag = TAG_BY_LEVEL[level ?? readAmbientLevel(handle) ?? DEFAULT_LEVEL];
|
|
33
|
+
let isCards = resolvedVariant === "cards";
|
|
34
|
+
return (_jsxs("section", { ...rest, "aria-labelledby": id, "aria-label": id ? undefined : title, "data-slot": "next-steps", "data-variant": resolvedVariant, mix: mergeMix([vstack({ gap: 4, align: "stretch" }), minIs(0)], mix), children: [_jsx(Tag, { id: id, "data-slot": "next-steps-title", mix: [m(0), text("lg"), weight("semibold"), fg("neutral.emphasis"), leading("snug")], children: title }), _jsx("ul", { "data-slot": "next-steps-list", mix: [
|
|
35
|
+
m(0),
|
|
36
|
+
p(0),
|
|
37
|
+
listStyle(),
|
|
38
|
+
isCards
|
|
39
|
+
? [
|
|
40
|
+
grid(),
|
|
41
|
+
gap(3),
|
|
42
|
+
gridTemplate({ columns: "repeat(auto-fit, minmax(min(100%, 14rem), 1fr))" }),
|
|
43
|
+
]
|
|
44
|
+
: [
|
|
45
|
+
vstack({ gap: 0, align: "stretch" }),
|
|
46
|
+
borderEdge("block-start", { color: "neutral.border", width: 1, style: "solid" }),
|
|
47
|
+
],
|
|
48
|
+
], children: items.map((item) => (_jsx("li", { mix: [
|
|
49
|
+
minIs(0),
|
|
50
|
+
isCards
|
|
51
|
+
? []
|
|
52
|
+
: borderEdge("block-end", { color: "neutral.border", width: 1, style: "solid" }),
|
|
53
|
+
], children: _jsx(NextStepsLink, { item: item, cards: isCards }) }, item.href))) })] }));
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* One destination as a single `<a>` holding its title and line, so the whole card or row
|
|
58
|
+
* follows the link and its accessible name reads title then description.
|
|
59
|
+
*/
|
|
60
|
+
function NextStepsLink(handle) {
|
|
61
|
+
return () => {
|
|
62
|
+
let { item, cards } = handle.props;
|
|
63
|
+
return (_jsxs("a", { href: item.href, "data-slot": "next-steps-link", mix: [
|
|
64
|
+
vstack({ gap: 1, align: "stretch" }),
|
|
65
|
+
overflowWrap("anywhere"),
|
|
66
|
+
cards
|
|
67
|
+
? [
|
|
68
|
+
p(4),
|
|
69
|
+
rounded("lg"),
|
|
70
|
+
border({ color: "neutral.border", width: 1, style: "solid" }),
|
|
71
|
+
transition("border-color, background-color"),
|
|
72
|
+
hover([border("brand.border"), bg("neutral.bg-tint")]),
|
|
73
|
+
]
|
|
74
|
+
: [pb(3), transition("color")],
|
|
75
|
+
when("&:focus-visible", outline({ color: "brand.ring", offset: 2 })),
|
|
76
|
+
motionSafe(when("&:hover, &:focus-visible", when(ARROW, translateProperty("2px 0")))),
|
|
77
|
+
], children: [_jsxs("span", { mix: [hstack({ gap: 1.5, align: "center" }), text("base"), weight("medium"), fg("brand")], children: [item.title, _jsx(ArrowRightIcon, { size: 14, "aria-hidden": "true", "data-slot": "next-steps-arrow", mix: [transition("translate")] })] }), _jsx("span", { mix: [text("sm"), fg("neutral.muted"), pretty()], children: item.description })] }));
|
|
78
|
+
};
|
|
79
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The "Copy page" split button a docs page carries in its header: the main half copies
|
|
3
|
+
* the page's Markdown twin, and the chevron opens a menu of places to take the page (View
|
|
4
|
+
* as Markdown, Open in Claude, Edit on GitHub). Only the copy hydrates; the menu is HTML.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { EntryComponent, Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
10
|
+
/**
|
|
11
|
+
* Prop types for {@link PageActions}.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace PageActions {
|
|
14
|
+
/** Every string the split button shows or announces. */
|
|
15
|
+
interface Labels {
|
|
16
|
+
/** The main button's label, such as "Copy page". */
|
|
17
|
+
copy: string;
|
|
18
|
+
/** The label shown and announced for two seconds after a copy, such as "Copied". */
|
|
19
|
+
copied: string;
|
|
20
|
+
/** Announced when the copy fails, such as "Could not copy the page". */
|
|
21
|
+
failed: string;
|
|
22
|
+
/** Accessible name of the chevron that opens the menu, such as "More page actions". */
|
|
23
|
+
more: string;
|
|
24
|
+
}
|
|
25
|
+
/** One place the menu takes the page. */
|
|
26
|
+
interface Link {
|
|
27
|
+
label: string;
|
|
28
|
+
/** One line saying what the destination does with the page. */
|
|
29
|
+
description?: string;
|
|
30
|
+
href: string;
|
|
31
|
+
/** A 16px glyph drawn before the label. */
|
|
32
|
+
icon?: RemixNode;
|
|
33
|
+
/** Opens in a new tab, for a destination on another site. */
|
|
34
|
+
external?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** Props accepted by {@link PageActions}. */
|
|
37
|
+
interface Props extends Omit<TagProps<"div">, "children"> {
|
|
38
|
+
/** The page's Markdown twin, fetched and copied by the main button. */
|
|
39
|
+
markdownHref: string;
|
|
40
|
+
labels: Labels;
|
|
41
|
+
/** The menu's entries; with none, the chevron and menu are left out. */
|
|
42
|
+
links?: Link[];
|
|
43
|
+
/** Id shared by the menu and its trigger. @default "page-actions-menu" */
|
|
44
|
+
menuId?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Props {@link PageActionsCopy} serializes for hydration, which is why they are a `type`:
|
|
48
|
+
* `SerializableProps` rejects an interface.
|
|
49
|
+
*/
|
|
50
|
+
type CopyProps = {
|
|
51
|
+
/** Whether the chevron follows, so the copy button squares the corners they share. */
|
|
52
|
+
joined?: boolean;
|
|
53
|
+
href: string;
|
|
54
|
+
copy: string;
|
|
55
|
+
copied: string;
|
|
56
|
+
failed: string;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Renders the split button: the copy island, then the chevron opening a native popover
|
|
61
|
+
* menu through `popovertarget`, so the menu opens and closes without JavaScript.
|
|
62
|
+
*
|
|
63
|
+
* @param handle Runtime handle carrying the actions' props.
|
|
64
|
+
* @returns The render function producing the split button's markup.
|
|
65
|
+
* @example
|
|
66
|
+
* <PageActions markdownHref="/docs/install.md" labels={labels} links={[{ label: "View as Markdown", href: "/docs/install.md" }]} />
|
|
67
|
+
*/
|
|
68
|
+
export declare function PageActions(handle: Handle<PageActions.Props>): () => import("remix/component").RemixElement;
|
|
69
|
+
/**
|
|
70
|
+
* Client island: the main half of {@link PageActions}, loaded from the bare
|
|
71
|
+
* `@sdxc/ui/page-actions` specifier. It copies `href`'s body, swaps its glyph and label to
|
|
72
|
+
* the copied state for two seconds and announces it; before hydration it is inert.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* <PageActionsCopy href="/docs/install.md" copy="Copy page" copied="Copied" failed="Could not copy" />
|
|
76
|
+
*/
|
|
77
|
+
export declare const PageActionsCopy: EntryComponent<PageActions.CopyProps>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { CheckIcon, ChevronDownIcon, CopyIcon } from "@sdxc/icons";
|
|
3
|
+
import { visuallyHidden } from "@sdxc/u/a11y";
|
|
4
|
+
import { fg } from "@sdxc/u/color";
|
|
5
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
6
|
+
import { inlineFlex, shrink, vstack } from "@sdxc/u/layout";
|
|
7
|
+
import { maxIs } from "@sdxc/u/size";
|
|
8
|
+
import { text, weight } from "@sdxc/u/typography";
|
|
9
|
+
import { clientEntry } from "remix/component";
|
|
10
|
+
import { Button } from "../components/button.js";
|
|
11
|
+
import { Group } from "../components/group.js";
|
|
12
|
+
import { Menu } from "../components/menu.js";
|
|
13
|
+
import { copyFeedback } from "./mixins/copy-feedback.js";
|
|
14
|
+
import { copyFromUrl } from "./mixins/copy-from-url.js";
|
|
15
|
+
/** Id the menu and its trigger share when `menuId` is omitted; one page carries one menu. */
|
|
16
|
+
const DEFAULT_MENU_ID = "page-actions-menu";
|
|
17
|
+
/** The corner radius every button draws, which the split button keeps on its outer corners. */
|
|
18
|
+
const RADIUS = "var(--ui-radius-md, 0.375rem)";
|
|
19
|
+
/**
|
|
20
|
+
* Renders the split button: the copy island, then the chevron opening a native popover
|
|
21
|
+
* menu through `popovertarget`, so the menu opens and closes without JavaScript.
|
|
22
|
+
*
|
|
23
|
+
* @param handle Runtime handle carrying the actions' props.
|
|
24
|
+
* @returns The render function producing the split button's markup.
|
|
25
|
+
* @example
|
|
26
|
+
* <PageActions markdownHref="/docs/install.md" labels={labels} links={[{ label: "View as Markdown", href: "/docs/install.md" }]} />
|
|
27
|
+
*/
|
|
28
|
+
export function PageActions(handle) {
|
|
29
|
+
return () => {
|
|
30
|
+
let { markdownHref, labels, links = [], menuId, mix, ...rest } = handle.props;
|
|
31
|
+
let id = menuId ?? DEFAULT_MENU_ID;
|
|
32
|
+
return (_jsxs("div", { ...rest, "data-slot": "page-actions", mix: mergeMix([inlineFlex()], mix), children: [_jsxs(Group, { "data-slot": "page-actions-group", children: [_jsx(PageActionsCopy, { href: markdownHref, copy: labels.copy, copied: labels.copied, failed: labels.failed, joined: links.length > 0 }), links.length > 0 ? (_jsx(Button, { type: "button", size: "sm", variant: "surface", color: "neutral", popovertarget: id, "aria-label": labels.more, "data-slot": "page-actions-trigger", mix: [splitCorners("end")], children: _jsx(ChevronDownIcon, { size: 16, "aria-hidden": "true" }) })) : null] }), links.length > 0 ? (_jsx(Menu, { id: id, "aria-label": labels.more, placement: "bottom-end", mix: [maxIs("min(20rem, 90vw)")], children: links.map((link) => (_jsxs(Menu.Item, { href: link.href, ...(link.external ? { target: "_blank", rel: "noopener noreferrer" } : {}), children: [link.icon ?? null, _jsxs("span", { mix: [vstack({ gap: 0.5, align: "start" })], children: [_jsx("span", { mix: [weight("medium")], children: link.label }), link.description ? (_jsx("span", { mix: [text("xs"), fg("neutral.muted")], children: link.description })) : null] })] }, link.href))) })) : null] }));
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Client island: the main half of {@link PageActions}, loaded from the bare
|
|
37
|
+
* `@sdxc/ui/page-actions` specifier. It copies `href`'s body, swaps its glyph and label to
|
|
38
|
+
* the copied state for two seconds and announces it; before hydration it is inert.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* <PageActionsCopy href="/docs/install.md" copy="Copy page" copied="Copied" failed="Could not copy" />
|
|
42
|
+
*/
|
|
43
|
+
export const PageActionsCopy = clientEntry("@sdxc/ui/page-actions#PageActionsCopy", function PageActionsCopy(handle) {
|
|
44
|
+
return () => {
|
|
45
|
+
let { copied, copy, failed, href, joined = false } = handle.props;
|
|
46
|
+
return (_jsxs(Button, { type: "button", size: "sm", variant: "surface", color: "neutral", "data-slot": "page-actions-copy", mix: [
|
|
47
|
+
shrink(0),
|
|
48
|
+
joined ? splitCorners("start") : [],
|
|
49
|
+
/**
|
|
50
|
+
* Each state's glyph and label are drawn together and swapped in one rule, so
|
|
51
|
+
* the copied state always wins whatever order the stylesheet layers land in.
|
|
52
|
+
*/
|
|
53
|
+
raw({
|
|
54
|
+
"& [data-state]": { display: "inline-flex", alignItems: "center" },
|
|
55
|
+
'& [data-state="copied"]': { display: "none" },
|
|
56
|
+
'&[data-copied] [data-state="idle"]': { display: "none" },
|
|
57
|
+
'&[data-copied] [data-state="copied"]': { display: "inline-flex" },
|
|
58
|
+
}),
|
|
59
|
+
copyFromUrl(href, failed),
|
|
60
|
+
copyFeedback(copied),
|
|
61
|
+
], children: [_jsxs("span", { "data-state": "idle", mix: [raw({ gap: "0.375rem" })], children: [_jsx(CopyIcon, { size: 16, "aria-hidden": "true" }), copy] }), _jsxs("span", { "data-state": "copied", mix: [raw({ gap: "0.375rem" })], children: [_jsx(CheckIcon, { size: 16, "aria-hidden": "true", mix: [fg("success")] }), copied] }), _jsx("span", { role: "status", mix: [visuallyHidden()] })] }));
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
/**
|
|
65
|
+
* Rounds one half of the split button on its outer corners only, through the radius
|
|
66
|
+
* variable `Button` draws from, so the two halves read as one shape whatever order the
|
|
67
|
+
* stylesheet layers land in; right-to-left text mirrors which corners are outer.
|
|
68
|
+
*
|
|
69
|
+
* @param half Which half this button is, in reading order.
|
|
70
|
+
*/
|
|
71
|
+
function splitCorners(half) {
|
|
72
|
+
let left = `${RADIUS} 0 0 ${RADIUS}`;
|
|
73
|
+
let right = `0 ${RADIUS} ${RADIUS} 0`;
|
|
74
|
+
return raw({
|
|
75
|
+
"--ui-button-radius": half === "start" ? left : right,
|
|
76
|
+
"&:dir(rtl)": { "--ui-button-radius": half === "start" ? right : left },
|
|
77
|
+
});
|
|
78
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The quiet box under a help page's title that says which plan or role a feature needs,
|
|
3
|
+
* so a reader learns it before following steps they cannot complete. Pages repeat one
|
|
4
|
+
* fixed sentence, with the plan names linked to pricing.
|
|
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 PlanNotice}.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace PlanNotice {
|
|
14
|
+
/** Native `<p>` attributes plus the one sentence, which may link plan names to pricing. */
|
|
15
|
+
interface Props extends TagProps<"p"> {
|
|
16
|
+
children: RemixNode;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders the sentence in a muted, hairline-bordered box at the body's small size, with
|
|
21
|
+
* its links underlined in the box's own ink so they read as links without shouting.
|
|
22
|
+
*
|
|
23
|
+
* @param handle Runtime handle carrying the host `<p>`'s props.
|
|
24
|
+
* @returns The render function producing the notice's markup.
|
|
25
|
+
* @example
|
|
26
|
+
* <PlanNotice>Available on the <a href="/pricing">Team plan</a>.</PlanNotice>
|
|
27
|
+
*/
|
|
28
|
+
export declare function PlanNotice(handle: Handle<PlanNotice.Props>): () => import("remix/component").RemixElement;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 } from "@sdxc/u/general";
|
|
5
|
+
import { m, p } from "@sdxc/u/size";
|
|
6
|
+
import { when } from "@sdxc/u/state";
|
|
7
|
+
import { leading, overflowWrap, text, textDecoration } from "@sdxc/u/typography";
|
|
8
|
+
/**
|
|
9
|
+
* Renders the sentence in a muted, hairline-bordered box at the body's small size, with
|
|
10
|
+
* its links underlined in the box's own ink so they read as links without shouting.
|
|
11
|
+
*
|
|
12
|
+
* @param handle Runtime handle carrying the host `<p>`'s props.
|
|
13
|
+
* @returns The render function producing the notice's markup.
|
|
14
|
+
* @example
|
|
15
|
+
* <PlanNotice>Available on the <a href="/pricing">Team plan</a>.</PlanNotice>
|
|
16
|
+
*/
|
|
17
|
+
export function PlanNotice(handle) {
|
|
18
|
+
return () => {
|
|
19
|
+
let { mix, ...rest } = handle.props;
|
|
20
|
+
return (_jsx("p", { ...rest, "data-slot": "plan-notice", mix: mergeMix([
|
|
21
|
+
m(0),
|
|
22
|
+
p(2, 3),
|
|
23
|
+
rounded("md"),
|
|
24
|
+
bg("neutral.tint"),
|
|
25
|
+
border({ color: "neutral.border", width: 1, style: "solid" }),
|
|
26
|
+
fg("neutral"),
|
|
27
|
+
text("sm"),
|
|
28
|
+
leading("relaxed"),
|
|
29
|
+
overflowWrap("anywhere"),
|
|
30
|
+
when("& a", [fg("neutral.emphasis"), textDecoration("underline")]),
|
|
31
|
+
], mix) }));
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The reference table a docs page prints for props, options, fields or a request body:
|
|
3
|
+
* name, type, default, required and description, with nested fields behind a native
|
|
4
|
+
* disclosure that expands in place. In a narrow column each row stacks into a card.
|
|
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 PropsTable}.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace PropsTable {
|
|
14
|
+
/**
|
|
15
|
+
* One documented field. The shape follows a JSON Schema property: `type` is the type as
|
|
16
|
+
* it should read, `default` its serialized default, `required` whether the parent's
|
|
17
|
+
* `required` list names it, and `children` the properties of an object or array item.
|
|
18
|
+
*/
|
|
19
|
+
interface Row {
|
|
20
|
+
name: string;
|
|
21
|
+
type: string;
|
|
22
|
+
default?: string;
|
|
23
|
+
required?: boolean;
|
|
24
|
+
description?: RemixNode;
|
|
25
|
+
children?: readonly Row[];
|
|
26
|
+
}
|
|
27
|
+
/** Every string the table prints; the library ships no copy of its own. */
|
|
28
|
+
interface Labels {
|
|
29
|
+
name: string;
|
|
30
|
+
type: string;
|
|
31
|
+
default: string;
|
|
32
|
+
required: string;
|
|
33
|
+
description: string;
|
|
34
|
+
/** The cell value of a required field, such as "Yes" or "Required". */
|
|
35
|
+
yes: string;
|
|
36
|
+
/** The cell value of an optional field, such as "No" or "Optional". */
|
|
37
|
+
no: string;
|
|
38
|
+
/** The closed disclosure's summary, such as "Show child parameters". */
|
|
39
|
+
showChildren: string;
|
|
40
|
+
/** The open disclosure's summary, such as "Hide child parameters". Defaults to `showChildren`. */
|
|
41
|
+
hideChildren?: string;
|
|
42
|
+
}
|
|
43
|
+
/** Props accepted by {@link PropsTable}. */
|
|
44
|
+
interface Props extends Omit<TagProps<"div">, "children"> {
|
|
45
|
+
rows: readonly Row[];
|
|
46
|
+
labels: Labels;
|
|
47
|
+
/** Names the table for a reader who reaches it without the heading above it. */
|
|
48
|
+
"aria-label"?: string;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Renders the table inside a box that is its own size container. Above 36rem it reads as
|
|
53
|
+
* five columns; at or below, each row stacks with the column label before each value. A
|
|
54
|
+
* long type wraps inside its cell, so the table never widens the page.
|
|
55
|
+
*
|
|
56
|
+
* @param handle Runtime handle carrying the table's props.
|
|
57
|
+
* @returns The render function producing the table.
|
|
58
|
+
* @example
|
|
59
|
+
* <PropsTable aria-label={t("props")} labels={labels} rows={[
|
|
60
|
+
* { name: "title", type: "string", description: "The file the block belongs to." },
|
|
61
|
+
* { name: "retry", type: "object", children: [{ name: "attempts", type: "number", default: "3" }] },
|
|
62
|
+
* ]} />
|
|
63
|
+
*/
|
|
64
|
+
export declare function PropsTable(handle: Handle<PropsTable.Props>): () => import("remix/component").RemixElement;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { visuallyHidden } from "@sdxc/u/a11y";
|
|
3
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
4
|
+
import { container } from "@sdxc/u/layout";
|
|
5
|
+
import { font, text, weight } from "@sdxc/u/typography";
|
|
6
|
+
/** Container the table queries, so it stacks by the width it is given rather than the viewport. */
|
|
7
|
+
const CONTAINER = "ui-props-table";
|
|
8
|
+
/** The container width at or under which rows stack into cards. */
|
|
9
|
+
const STACK_BELOW = "36rem";
|
|
10
|
+
/** Muted ink for column labels, empty cells and the disclosure. */
|
|
11
|
+
const MUTED = "var(--ui-neutral-fg-muted)";
|
|
12
|
+
/** Hairline between rows. */
|
|
13
|
+
const RULE = "1px solid var(--ui-neutral-border)";
|
|
14
|
+
/**
|
|
15
|
+
* Renders the table inside a box that is its own size container. Above 36rem it reads as
|
|
16
|
+
* five columns; at or below, each row stacks with the column label before each value. A
|
|
17
|
+
* long type wraps inside its cell, so the table never widens the page.
|
|
18
|
+
*
|
|
19
|
+
* @param handle Runtime handle carrying the table's props.
|
|
20
|
+
* @returns The render function producing the table.
|
|
21
|
+
* @example
|
|
22
|
+
* <PropsTable aria-label={t("props")} labels={labels} rows={[
|
|
23
|
+
* { name: "title", type: "string", description: "The file the block belongs to." },
|
|
24
|
+
* { name: "retry", type: "object", children: [{ name: "attempts", type: "number", default: "3" }] },
|
|
25
|
+
* ]} />
|
|
26
|
+
*/
|
|
27
|
+
export function PropsTable(handle) {
|
|
28
|
+
return () => {
|
|
29
|
+
let { "aria-label": label, labels, mix, rows, ...rest } = handle.props;
|
|
30
|
+
return (_jsx("div", { ...rest, "data-slot": "props-table", mix: mergeMix([container(CONTAINER), raw({ minInlineSize: 0, overflowX: "auto" })], mix), children: _jsx(RowsTable, { rows: rows, labels: labels, label: label, nested: false }) }));
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* One level of rows. A row with children is followed by a row spanning every column that
|
|
35
|
+
* holds a `<details>` with the next level, so the children expand right under their parent.
|
|
36
|
+
* The Default column is drawn only when a row at this level has a default to show.
|
|
37
|
+
*/
|
|
38
|
+
function RowsTable(handle) {
|
|
39
|
+
return () => {
|
|
40
|
+
let { label, labels, nested, rows } = handle.props;
|
|
41
|
+
let defaults = rows.some((row) => row.default !== undefined);
|
|
42
|
+
let columns = [
|
|
43
|
+
labels.name,
|
|
44
|
+
labels.type,
|
|
45
|
+
...(defaults ? [labels.default] : []),
|
|
46
|
+
labels.required,
|
|
47
|
+
labels.description,
|
|
48
|
+
];
|
|
49
|
+
return (_jsxs("table", { "aria-label": label, "data-not-typeset": "", mix: [text("sm"), tableRules(nested)], children: [_jsx("thead", { mix: nested ? [visuallyHidden()] : [], children: _jsx("tr", { children: columns.map((column) => (_jsx("th", { scope: "col", children: column }, column))) }) }), _jsx("tbody", { children: rows.flatMap((row) => [
|
|
50
|
+
_jsxs("tr", { "data-row": "", children: [_jsx("th", { scope: "row", "data-cell": "name", children: _jsx("code", { mix: [font("mono"), weight("semibold")], children: row.name }) }), _jsx("td", { "data-cell": "type", "data-label": labels.type, children: _jsx("code", { mix: [font("mono")], children: row.type }) }), defaults ? (_jsx("td", { "data-cell": "default", "data-label": labels.default, children: row.default === undefined ? (_jsx("span", { "data-empty": "", children: "\u2014" })) : (_jsx("code", { mix: [font("mono")], children: row.default })) })) : null, _jsx("td", { "data-cell": "required", "data-label": labels.required, "data-required": row.required ? "" : undefined, children: row.required ? labels.yes : labels.no }), _jsx("td", { "data-cell": "description", "data-label": labels.description, children: row.description })] }, row.name),
|
|
51
|
+
row.children && row.children.length > 0 ? (_jsx("tr", { "data-children": "", children: _jsx("td", { colSpan: columns.length, children: _jsxs("details", { children: [_jsxs("summary", { children: [_jsx("span", { "data-summary": "closed", children: labels.showChildren }), _jsx("span", { "data-summary": "open", children: labels.hideChildren ?? labels.showChildren })] }), _jsx(RowsTable, { rows: row.children, labels: labels, label: row.name, nested: true })] }) }) }, `${row.name}-children`)) : null,
|
|
52
|
+
]) })] }));
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Every rule a table level follows, in one block so the stacked layout's `display`
|
|
57
|
+
* overrides resolve by specificity. Child selectors keep each level's rules off the
|
|
58
|
+
* tables nested inside it, which answer to their own container query.
|
|
59
|
+
*
|
|
60
|
+
* @param nested Whether this level sits inside a parent row's disclosure.
|
|
61
|
+
*/
|
|
62
|
+
function tableRules(nested) {
|
|
63
|
+
let stacked = {
|
|
64
|
+
"& > thead": { display: "none" },
|
|
65
|
+
"&, & > tbody, & > tbody > tr, & > tbody > tr > :is(th, td)": { display: "block" },
|
|
66
|
+
"& > tbody > tr[data-row]": { paddingBlock: "0.75rem", borderBlockStart: RULE },
|
|
67
|
+
"& > tbody > tr[data-children]": { borderBlockStart: 0 },
|
|
68
|
+
"& > tbody > tr > :is(th, td)": {
|
|
69
|
+
borderBlockStart: 0,
|
|
70
|
+
paddingBlock: "0.125rem",
|
|
71
|
+
paddingInline: 0,
|
|
72
|
+
},
|
|
73
|
+
"& > tbody > tr > td[data-label]": {
|
|
74
|
+
minInlineSize: 0,
|
|
75
|
+
maxInlineSize: "none",
|
|
76
|
+
display: "grid",
|
|
77
|
+
gridTemplateColumns: "minmax(5.5rem, 30%) minmax(0, 1fr)",
|
|
78
|
+
columnGap: "0.75rem",
|
|
79
|
+
},
|
|
80
|
+
"& > tbody > tr > td[data-label]::before": { content: "attr(data-label)", color: MUTED },
|
|
81
|
+
'& > tbody > tr > td[data-cell="description"]': {
|
|
82
|
+
display: "block",
|
|
83
|
+
paddingBlockStart: "0.375rem",
|
|
84
|
+
},
|
|
85
|
+
'& > tbody > tr > td[data-cell="description"]::before': { content: "none" },
|
|
86
|
+
"& > tbody > tr > td[colspan]": { paddingBlock: 0 },
|
|
87
|
+
};
|
|
88
|
+
return raw({
|
|
89
|
+
inlineSize: "100%",
|
|
90
|
+
borderCollapse: "collapse",
|
|
91
|
+
textAlign: "start",
|
|
92
|
+
color: "var(--ui-neutral-fg)",
|
|
93
|
+
"& > thead > tr > th": {
|
|
94
|
+
paddingBlock: "0.5rem",
|
|
95
|
+
paddingInline: "0.75rem",
|
|
96
|
+
textAlign: "start",
|
|
97
|
+
fontWeight: 600,
|
|
98
|
+
color: MUTED,
|
|
99
|
+
borderBlockEnd: RULE,
|
|
100
|
+
whiteSpace: "nowrap",
|
|
101
|
+
},
|
|
102
|
+
"& > tbody > tr > :is(th, td)": {
|
|
103
|
+
paddingBlock: "0.625rem",
|
|
104
|
+
paddingInline: "0.75rem",
|
|
105
|
+
verticalAlign: "top",
|
|
106
|
+
textAlign: "start",
|
|
107
|
+
fontWeight: "inherit",
|
|
108
|
+
borderBlockStart: RULE,
|
|
109
|
+
overflowWrap: "anywhere",
|
|
110
|
+
},
|
|
111
|
+
"& > tbody > tr > :is(th, td):first-child": { paddingInlineStart: nested ? "0.75rem" : 0 },
|
|
112
|
+
'& > tbody > tr > th[data-cell="name"]': {
|
|
113
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
114
|
+
minInlineSize: "7rem",
|
|
115
|
+
},
|
|
116
|
+
'& > tbody > tr > td[data-cell="type"]': { minInlineSize: "7rem", maxInlineSize: "16rem" },
|
|
117
|
+
'& > tbody > tr > td[data-cell="description"]': { minInlineSize: "12rem" },
|
|
118
|
+
'& > tbody > tr > td[data-cell="required"][data-required]': {
|
|
119
|
+
color: "var(--ui-warning-fg)",
|
|
120
|
+
fontWeight: 500,
|
|
121
|
+
},
|
|
122
|
+
"& [data-empty]": { color: MUTED },
|
|
123
|
+
"& > tbody > tr[data-children] > td": { borderBlockStart: 0, paddingBlockStart: 0 },
|
|
124
|
+
"& > tbody > tr[data-children] > td > details": {
|
|
125
|
+
borderInlineStart: RULE,
|
|
126
|
+
marginInlineStart: "0.25rem",
|
|
127
|
+
},
|
|
128
|
+
"& > tbody > tr[data-children] > td > details > summary": {
|
|
129
|
+
paddingBlock: "0.25rem",
|
|
130
|
+
paddingInline: "0.75rem",
|
|
131
|
+
cursor: "pointer",
|
|
132
|
+
color: "var(--ui-brand-fg)",
|
|
133
|
+
fontWeight: 500,
|
|
134
|
+
"&:focus-visible": { outline: "2px solid var(--ui-brand-ring)", borderRadius: "0.25rem" },
|
|
135
|
+
},
|
|
136
|
+
'& > tbody > tr[data-children] > td > details > summary > [data-summary="open"]': {
|
|
137
|
+
display: "none",
|
|
138
|
+
},
|
|
139
|
+
'& > tbody > tr[data-children] > td > details[open] > summary > [data-summary="open"]': {
|
|
140
|
+
display: "inline",
|
|
141
|
+
},
|
|
142
|
+
'& > tbody > tr[data-children] > td > details[open] > summary > [data-summary="closed"]': {
|
|
143
|
+
display: "none",
|
|
144
|
+
},
|
|
145
|
+
[`@container ${CONTAINER} (max-width: ${STACK_BELOW})`]: stacked,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Numbered steps for a docs procedure: a ringed counter beside each step and a hairline
|
|
3
|
+
* running from under it toward the next. Counters and the rail are CSS on a plain `<ol>`,
|
|
4
|
+
* and every step title is a real heading, so the page outline and its TOC list each step.
|
|
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
|
+
import type { HeadingLevel } from "../components/heading-scope.js";
|
|
11
|
+
/**
|
|
12
|
+
* Prop types for {@link Steps} and {@link Steps.Item}.
|
|
13
|
+
*/
|
|
14
|
+
export declare namespace Steps {
|
|
15
|
+
/** Native `<ol>` attributes plus the depth the step titles render at. */
|
|
16
|
+
interface Props extends TagProps<"ol"> {
|
|
17
|
+
/**
|
|
18
|
+
* Heading depth of every step title. Defaults to one level past the nearest
|
|
19
|
+
* `HeadingScope`, or `2` where no scope wraps the list.
|
|
20
|
+
*/
|
|
21
|
+
level?: HeadingLevel;
|
|
22
|
+
/** {@link Steps.Item} children, numbered in order by CSS counters. */
|
|
23
|
+
children: RemixNode;
|
|
24
|
+
}
|
|
25
|
+
/** Native `<li>` attributes plus the step's heading and its optional anchor. */
|
|
26
|
+
interface ItemProps extends Omit<TagProps<"li">, "title" | "id"> {
|
|
27
|
+
/** What the reader does in this step, rendered as a heading. */
|
|
28
|
+
title: RemixNode;
|
|
29
|
+
/** Id on the title heading, so a table of contents or a link can target the step. */
|
|
30
|
+
id?: string;
|
|
31
|
+
/** Instructions, commands and code for the step. */
|
|
32
|
+
children?: RemixNode;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Renders the ordered list and the heading scope its titles read. Each step pads its
|
|
37
|
+
* own end instead of the list using a gap, so the rail spans the whole distance between
|
|
38
|
+
* one counter and the next.
|
|
39
|
+
*
|
|
40
|
+
* @param handle Runtime handle carrying the host `<ol>`'s props.
|
|
41
|
+
* @returns The render function producing the list's markup.
|
|
42
|
+
* @example
|
|
43
|
+
* <Steps>
|
|
44
|
+
* <Steps.Item id="add-a-monitor" title={t("quickstart.add")}>{t("quickstart.add.body")}</Steps.Item>
|
|
45
|
+
* <Steps.Item title={t("quickstart.alerts")}>{t("quickstart.alerts.body")}</Steps.Item>
|
|
46
|
+
* </Steps>
|
|
47
|
+
*/
|
|
48
|
+
export declare function Steps(handle: Handle<Steps.Props>): () => import("remix/component").RemixElement;
|
|
49
|
+
export declare namespace Steps {
|
|
50
|
+
var Item: (handle: Handle<Steps.ItemProps>) => () => import("remix/component").RemixElement;
|
|
51
|
+
}
|