@sdxc/ui 2026.11.27 → 2026.11.29
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 +265 -162
- package/dist/app/app-shell.d.ts +85 -50
- package/dist/app/app-shell.js +419 -222
- package/dist/app/auto-refresh.d.ts +68 -51
- package/dist/app/auto-refresh.js +193 -61
- package/dist/app/board.d.ts +40 -17
- package/dist/app/board.js +173 -88
- package/dist/app/chart.d.ts +10 -63
- package/dist/app/chart.js +22 -29
- package/dist/app/code-view.d.ts +12 -11
- package/dist/app/code-view.js +83 -19
- package/dist/app/command-palette.d.ts +61 -33
- package/dist/app/command-palette.js +178 -32
- package/dist/app/contribution-graph.d.ts +30 -14
- package/dist/app/contribution-graph.js +87 -26
- package/dist/app/danger-zone.d.ts +40 -35
- package/dist/app/danger-zone.js +177 -34
- package/dist/app/detail-sheet.d.ts +42 -51
- package/dist/app/detail-sheet.js +156 -37
- package/dist/app/diff.d.ts +6 -5
- package/dist/app/diff.js +9 -6
- package/dist/app/drop-zone.d.ts +3 -13
- package/dist/app/drop-zone.js +2 -2
- package/dist/app/editor-layout.d.ts +69 -47
- package/dist/app/editor-layout.js +256 -115
- package/dist/app/empty.d.ts +16 -12
- package/dist/app/empty.js +45 -19
- package/dist/app/file-trigger.d.ts +5 -13
- package/dist/app/file-trigger.js +3 -4
- package/dist/app/filter-bar.d.ts +182 -120
- package/dist/app/filter-bar.js +509 -161
- package/dist/app/filter-menu.d.ts +51 -33
- package/dist/app/filter-menu.js +105 -40
- package/dist/app/gantt.d.ts +67 -27
- package/dist/app/gantt.js +320 -163
- package/dist/app/grid-list.d.ts +2 -15
- package/dist/app/grid-list.js +3 -3
- package/dist/app/merge-box.d.ts +58 -52
- package/dist/app/merge-box.js +107 -46
- package/dist/app/mixins/optimistic-toggle-sync.d.ts +2 -2
- package/dist/app/mixins/optimistic-toggle-sync.js +3 -2
- package/dist/app/mixins/range-picker-keys.d.ts +1 -1
- package/dist/app/mixins/range-picker-keys.js +1 -1
- package/dist/app/mixins/save-bar-sync.d.ts +1 -1
- package/dist/app/mixins/save-bar-sync.js +3 -2
- package/dist/app/mixins/split-view.d.ts +3 -1
- package/dist/app/mixins/split-view.js +16 -8
- package/dist/app/optimistic-toggle.d.ts +65 -37
- package/dist/app/optimistic-toggle.js +38 -15
- package/dist/app/page-header.d.ts +80 -58
- package/dist/app/page-header.js +329 -154
- package/dist/app/profile-picker.d.ts +31 -24
- package/dist/app/profile-picker.js +134 -58
- package/dist/app/range-picker.d.ts +62 -59
- package/dist/app/range-picker.js +124 -37
- package/dist/app/review-thread.d.ts +69 -66
- package/dist/app/review-thread.js +203 -53
- package/dist/app/save-bar.d.ts +56 -27
- package/dist/app/save-bar.js +66 -14
- package/dist/app/selection-bar.d.ts +64 -66
- package/dist/app/selection-bar.js +157 -56
- package/dist/app/settings-layout.d.ts +65 -52
- package/dist/app/settings-layout.js +198 -71
- package/dist/app/settings-section.d.ts +86 -93
- package/dist/app/settings-section.js +297 -120
- package/dist/app/shortcut-list.d.ts +19 -8
- package/dist/app/shortcut-list.js +50 -9
- package/dist/app/sparkline.d.ts +14 -16
- package/dist/app/sparkline.js +20 -7
- package/dist/app/split-view.d.ts +66 -42
- package/dist/app/split-view.js +235 -128
- package/dist/app/stat-card.d.ts +16 -4
- package/dist/app/stat-card.js +57 -21
- package/dist/app/status-strip.d.ts +24 -25
- package/dist/app/status-strip.js +82 -25
- package/dist/app/tab-bar.d.ts +15 -7
- package/dist/app/tab-bar.js +74 -37
- package/dist/app/table.d.ts +37 -38
- package/dist/app/table.js +101 -45
- package/dist/app/view-options.d.ts +100 -76
- package/dist/app/view-options.js +263 -129
- package/dist/audio/media-tile.d.ts +33 -21
- package/dist/audio/media-tile.js +139 -79
- package/dist/audio/player-bar.d.ts +24 -43
- package/dist/audio/player-bar.js +183 -118
- package/dist/audio/queue-list.d.ts +40 -36
- package/dist/audio/queue-list.js +172 -73
- package/dist/audio/track-list.d.ts +53 -54
- package/dist/audio/track-list.js +127 -35
- package/dist/blog/archive-list.d.ts +158 -0
- package/dist/blog/archive-list.js +353 -0
- package/dist/blog/article-layout.d.ts +81 -0
- package/dist/blog/article-layout.js +211 -0
- package/dist/blog/author-card.d.ts +99 -0
- package/dist/blog/author-card.js +184 -0
- package/dist/blog/blog-masthead.d.ts +55 -0
- package/dist/blog/blog-masthead.js +143 -0
- package/dist/blog/index.d.ts +21 -0
- package/dist/blog/index.js +21 -0
- package/dist/blog/link-host.d.ts +47 -0
- package/dist/blog/link-host.js +61 -0
- package/dist/blog/newsletter-form.d.ts +66 -0
- package/dist/blog/newsletter-form.js +100 -0
- package/dist/blog/post-byline.d.ts +96 -0
- package/dist/blog/post-byline.js +180 -0
- package/dist/blog/post-entry.d.ts +153 -0
- package/dist/blog/post-entry.js +402 -0
- package/dist/blog/post-stream.d.ts +92 -0
- package/dist/blog/post-stream.js +163 -0
- package/dist/blog/series-nav.d.ts +144 -0
- package/dist/blog/series-nav.js +275 -0
- package/dist/blog/tag-cloud.d.ts +103 -0
- package/dist/blog/tag-cloud.js +138 -0
- package/dist/blog/tag-list.d.ts +91 -0
- package/dist/blog/tag-list.js +92 -0
- package/dist/blog/widget.d.ts +68 -0
- package/dist/blog/widget.js +61 -0
- package/dist/chat/activity.d.ts +47 -15
- package/dist/chat/activity.js +124 -46
- package/dist/chat/mention-menu.d.ts +6 -7
- package/dist/chat/mention-menu.js +4 -4
- package/dist/chat/message-group.d.ts +17 -4
- package/dist/chat/message-group.js +29 -6
- package/dist/color/color-field.d.ts +41 -68
- package/dist/color/color-field.js +21 -38
- package/dist/color/color-picker.d.ts +10 -61
- package/dist/color/color-picker.js +7 -15
- package/dist/color/color-swatch-picker.d.ts +0 -11
- package/dist/color/color-swatch-picker.js +2 -3
- package/dist/color/color-wheel.d.ts +3 -13
- package/dist/color/color-wheel.js +1 -2
- package/dist/commerce/cart-drawer.d.ts +41 -24
- package/dist/commerce/cart-drawer.js +129 -58
- package/dist/commerce/cart-line.d.ts +34 -19
- package/dist/commerce/cart-line.js +94 -28
- package/dist/commerce/checkout-layout.d.ts +23 -19
- package/dist/commerce/checkout-layout.js +53 -24
- package/dist/commerce/facet-filters.d.ts +57 -59
- package/dist/commerce/facet-filters.js +219 -129
- package/dist/commerce/item-options-dialog.d.ts +69 -40
- package/dist/commerce/item-options-dialog.js +231 -104
- package/dist/commerce/menu-item-card.d.ts +36 -20
- package/dist/commerce/menu-item-card.js +114 -61
- package/dist/commerce/option-group.d.ts +46 -27
- package/dist/commerce/option-group.js +123 -52
- package/dist/commerce/order-summary.d.ts +41 -26
- package/dist/commerce/order-summary.js +103 -49
- package/dist/commerce/order-tracker.d.ts +32 -16
- package/dist/commerce/order-tracker.js +91 -66
- package/dist/commerce/price.d.ts +41 -25
- package/dist/commerce/price.js +131 -68
- package/dist/commerce/product-card.d.ts +66 -36
- package/dist/commerce/product-card.js +215 -100
- package/dist/commerce/product-gallery.d.ts +72 -38
- package/dist/commerce/product-gallery.js +187 -82
- package/dist/commerce/promo-code.d.ts +73 -37
- package/dist/commerce/promo-code.js +172 -77
- package/dist/commerce/question-list.d.ts +43 -35
- package/dist/commerce/question-list.js +146 -72
- package/dist/commerce/shipping-estimate.d.ts +68 -33
- package/dist/commerce/shipping-estimate.js +149 -25
- package/dist/commerce/sort-select.d.ts +33 -22
- package/dist/commerce/sort-select.js +55 -26
- package/dist/commerce/variant-picker.d.ts +25 -23
- package/dist/commerce/variant-picker.js +103 -29
- package/dist/{docs → components}/anchor-heading.d.ts +1 -1
- package/dist/{docs → components}/anchor-heading.js +1 -1
- package/dist/components/autocomplete.d.ts +19 -21
- package/dist/components/autocomplete.js +57 -21
- package/dist/components/banner.d.ts +48 -37
- package/dist/components/banner.js +69 -27
- package/dist/components/button.d.ts +2 -18
- package/dist/components/button.js +4 -3
- package/dist/components/callout.d.ts +52 -0
- package/dist/components/callout.js +77 -0
- package/dist/components/checkbox.d.ts +3 -12
- package/dist/components/checkbox.js +1 -2
- package/dist/components/code-block.d.ts +110 -0
- package/dist/{docs → components}/code-block.js +92 -23
- package/dist/components/confirm.d.ts +63 -130
- package/dist/components/confirm.js +133 -52
- package/dist/{docs → components}/copy-button.d.ts +1 -1
- package/dist/{docs → components}/copy-button.js +3 -3
- package/dist/components/date-field.d.ts +40 -60
- package/dist/components/date-field.js +23 -36
- package/dist/components/date-picker.d.ts +11 -67
- package/dist/components/date-picker.js +4 -15
- package/dist/components/date-range-picker.d.ts +20 -91
- package/dist/components/date-range-picker.js +13 -27
- package/dist/components/dialog-dismiss.d.ts +1 -1
- package/dist/components/dialog-dismiss.js +1 -1
- package/dist/components/field-parts.d.ts +158 -0
- package/dist/components/field-parts.js +237 -0
- package/dist/components/filter-links.d.ts +107 -0
- package/dist/components/filter-links.js +120 -0
- package/dist/components/form.d.ts +3 -1
- package/dist/components/form.js +3 -1
- package/dist/components/index.d.ts +14 -7
- package/dist/components/index.js +14 -7
- package/dist/components/listbox.d.ts +0 -9
- package/dist/components/listbox.js +2 -2
- package/dist/components/media-grid.d.ts +15 -16
- package/dist/components/media-grid.js +75 -34
- package/dist/components/pager.d.ts +103 -0
- package/dist/components/pager.js +187 -0
- package/dist/components/property-list.d.ts +38 -39
- package/dist/components/property-list.js +149 -96
- package/dist/components/radio-group.d.ts +0 -11
- package/dist/components/radio-group.js +5 -6
- package/dist/components/range-calendar.d.ts +2 -14
- package/dist/components/range-calendar.js +2 -2
- package/dist/components/range-months.d.ts +12 -2
- package/dist/components/range-months.js +32 -16
- package/dist/components/rating-input.d.ts +14 -6
- package/dist/components/rating-input.js +26 -12
- package/dist/components/rating.d.ts +13 -8
- package/dist/components/rating.js +19 -5
- package/dist/components/review-card.d.ts +51 -26
- package/dist/components/review-card.js +173 -40
- package/dist/components/search-field.js +18 -8
- package/dist/components/section-bar.d.ts +23 -15
- package/dist/components/section-bar.js +59 -37
- package/dist/components/sidebar.d.ts +27 -0
- package/dist/components/sidebar.js +49 -20
- package/dist/{docs → components}/table-of-contents.d.ts +1 -1
- package/dist/{docs → components}/table-of-contents.js +3 -3
- package/dist/components/text-field.d.ts +54 -81
- package/dist/components/text-field.js +30 -44
- package/dist/components/time-field.d.ts +45 -65
- package/dist/components/time-field.js +23 -35
- package/dist/components/timeline.d.ts +80 -86
- package/dist/components/timeline.js +383 -170
- package/dist/components/typeset.d.ts +5 -0
- package/dist/components/typeset.js +17 -2
- package/dist/docs/code-tabs.d.ts +50 -24
- package/dist/docs/code-tabs.js +91 -25
- package/dist/docs/docs-feedback.d.ts +70 -27
- package/dist/docs/docs-feedback.js +156 -27
- package/dist/docs/docs-footer.d.ts +36 -22
- package/dist/docs/docs-footer.js +76 -23
- package/dist/docs/docs-hub.d.ts +103 -73
- package/dist/docs/docs-hub.js +333 -83
- package/dist/docs/docs-layout.d.ts +111 -42
- package/dist/docs/docs-layout.js +371 -97
- package/dist/docs/docs-nav-tools.d.ts +11 -7
- package/dist/docs/docs-nav-tools.js +4 -3
- package/dist/docs/docs-nav.d.ts +53 -17
- package/dist/docs/docs-nav.js +125 -14
- package/dist/docs/docs-not-found.d.ts +61 -35
- package/dist/docs/docs-not-found.js +198 -52
- package/dist/docs/docs-page-header.d.ts +47 -30
- package/dist/docs/docs-page-header.js +114 -31
- package/dist/docs/docs-pager.d.ts +43 -27
- package/dist/docs/docs-pager.js +73 -23
- package/dist/docs/file-tree.d.ts +16 -6
- package/dist/docs/file-tree.js +19 -4
- package/dist/docs/index.d.ts +0 -7
- package/dist/docs/index.js +0 -7
- package/dist/docs/install-command.d.ts +7 -6
- package/dist/docs/install-command.js +8 -10
- package/dist/docs/mixins/docs-nav-tools.js +1 -1
- package/dist/docs/next-steps.d.ts +56 -23
- package/dist/docs/next-steps.js +121 -35
- package/dist/docs/page-actions.d.ts +68 -46
- package/dist/docs/page-actions.js +129 -21
- package/dist/docs/steps.d.ts +14 -11
- package/dist/docs/steps.js +36 -18
- package/dist/docs/ui-label.d.ts +7 -6
- package/dist/docs/ui-label.js +21 -8
- package/dist/finance/ledger.d.ts +33 -29
- package/dist/finance/ledger.js +190 -43
- package/dist/finance/payment-card.d.ts +43 -31
- package/dist/finance/payment-card.js +170 -67
- package/dist/landing/author-band.d.ts +57 -54
- package/dist/landing/author-band.js +218 -64
- package/dist/landing/case-study.d.ts +57 -57
- package/dist/landing/case-study.js +148 -17
- package/dist/landing/changelog-strip.d.ts +56 -36
- package/dist/landing/changelog-strip.js +176 -68
- package/dist/landing/closing-cta.d.ts +21 -41
- package/dist/landing/closing-cta.js +13 -19
- package/dist/landing/code-stage.d.ts +55 -47
- package/dist/landing/code-stage.js +198 -67
- package/dist/landing/contributor-wall.d.ts +4 -4
- package/dist/landing/contributor-wall.js +4 -4
- package/dist/landing/curriculum.d.ts +74 -45
- package/dist/landing/curriculum.js +220 -62
- package/dist/landing/drawn-chart.d.ts +18 -10
- package/dist/landing/drawn-chart.js +57 -26
- package/dist/landing/episode-player.d.ts +69 -43
- package/dist/landing/episode-player.js +213 -48
- package/dist/landing/event-ticker.d.ts +13 -7
- package/dist/landing/event-ticker.js +67 -32
- package/dist/landing/fan-out-diagram.d.ts +19 -8
- package/dist/landing/fan-out-diagram.js +60 -19
- package/dist/landing/faq-band.d.ts +30 -48
- package/dist/landing/faq-band.js +37 -30
- package/dist/landing/feature-band.d.ts +48 -76
- package/dist/landing/feature-band.js +71 -49
- package/dist/landing/flow-diagram.d.ts +16 -8
- package/dist/landing/flow-diagram.js +50 -18
- package/dist/landing/install-tabs.d.ts +16 -14
- package/dist/landing/install-tabs.js +87 -39
- package/dist/landing/landing-header.d.ts +75 -66
- package/dist/landing/landing-header.js +284 -57
- package/dist/landing/landing-hero.d.ts +59 -87
- package/dist/landing/landing-hero.js +157 -128
- package/dist/landing/landing-section.d.ts +0 -9
- package/dist/landing/landing-section.js +1 -2
- package/dist/landing/logo-cloud.d.ts +26 -9
- package/dist/landing/logo-cloud.js +62 -18
- package/dist/landing/phone-fan.d.ts +15 -7
- package/dist/landing/phone-fan.js +60 -17
- package/dist/landing/price-list.d.ts +29 -22
- package/dist/landing/price-list.js +175 -77
- package/dist/landing/pricing-band.d.ts +46 -53
- package/dist/landing/pricing-band.js +167 -51
- package/dist/landing/product-frame.d.ts +44 -42
- package/dist/landing/product-frame.js +182 -85
- package/dist/landing/proof-strip.d.ts +7 -2
- package/dist/landing/proof-strip.js +7 -2
- package/dist/landing/rails.d.ts +1 -1
- package/dist/landing/rails.js +1 -1
- package/dist/landing/segmented-stage.d.ts +19 -8
- package/dist/landing/segmented-stage.js +60 -16
- package/dist/landing/sequence-diagram.d.ts +18 -8
- package/dist/landing/sequence-diagram.js +49 -18
- package/dist/landing/site-footer.d.ts +89 -68
- package/dist/landing/site-footer.js +344 -111
- package/dist/landing/site-header.d.ts +118 -80
- package/dist/landing/site-header.js +482 -67
- package/dist/landing/sponsor-wall.d.ts +34 -15
- package/dist/landing/sponsor-wall.js +111 -34
- package/dist/landing/stat-strip.d.ts +7 -9
- package/dist/landing/stat-strip.js +57 -22
- package/dist/landing/step-list.d.ts +18 -21
- package/dist/landing/step-list.js +132 -38
- package/dist/landing/tabbed-stage.d.ts +23 -15
- package/dist/landing/tabbed-stage.js +103 -21
- package/dist/landing/testimonial-band.d.ts +58 -61
- package/dist/landing/testimonial-band.js +209 -71
- package/dist/landing/typed-terminal.d.ts +9 -6
- package/dist/landing/typed-terminal.js +16 -5
- package/dist/landing/usage-estimate.d.ts +83 -74
- package/dist/landing/usage-estimate.js +254 -113
- package/dist/landing/utils/has-parts.d.ts +17 -0
- package/dist/landing/utils/has-parts.js +24 -0
- package/dist/map/map-canvas.d.ts +15 -16
- package/dist/map/map-canvas.js +40 -24
- package/dist/map/map.d.ts +42 -33
- package/dist/map/map.js +149 -38
- package/dist/mixins/aria-checked.d.ts +1 -4
- package/dist/mixins/aria-checked.js +1 -4
- package/dist/mixins/clear-field.d.ts +2 -4
- package/dist/mixins/clear-field.js +2 -4
- package/dist/mixins/index.d.ts +2 -0
- package/dist/mixins/index.js +2 -0
- package/dist/schedule/agenda.d.ts +69 -41
- package/dist/schedule/agenda.js +273 -134
- package/dist/schedule/day-strip.d.ts +38 -26
- package/dist/schedule/day-strip.js +119 -88
- package/dist/test/map.d.ts +1 -1
- package/dist/test/map.js +1 -6
- package/dist/test/reels.js +1 -1
- package/dist/test/stories.js +2 -2
- package/dist/travel/boarding-pass.d.ts +94 -70
- package/dist/travel/boarding-pass.js +341 -144
- package/dist/travel/car-offer.d.ts +109 -49
- package/dist/travel/car-offer.js +424 -64
- package/dist/travel/fare-options.d.ts +58 -34
- package/dist/travel/fare-options.js +210 -69
- package/dist/travel/flight-itinerary.d.ts +62 -55
- package/dist/travel/flight-itinerary.js +230 -55
- package/dist/travel/flight-option.d.ts +65 -33
- package/dist/travel/flight-option.js +250 -69
- package/dist/travel/flight-segment.d.ts +121 -70
- package/dist/travel/flight-segment.js +358 -96
- package/dist/travel/package-savings.d.ts +79 -39
- package/dist/travel/package-savings.js +309 -65
- package/dist/travel/price-breakdown.d.ts +30 -22
- package/dist/travel/price-breakdown.js +72 -17
- package/dist/travel/rating-breakdown.d.ts +25 -18
- package/dist/travel/rating-breakdown.js +60 -23
- package/dist/travel/seat-map.d.ts +29 -22
- package/dist/travel/seat-map.js +140 -78
- package/dist/travel/trip-timeline.d.ts +77 -39
- package/dist/travel/trip-timeline.js +316 -107
- package/dist/utils/eyebrow.d.ts +2 -2
- package/dist/utils/eyebrow.js +3 -3
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/video/episode-list.d.ts +22 -14
- package/dist/video/episode-list.js +89 -53
- package/dist/video/reel-feed.d.ts +21 -15
- package/dist/video/reel-feed.js +59 -24
- package/dist/video/story-viewer.d.ts +6 -5
- package/dist/video/story-viewer.js +84 -53
- package/dist/video/title-hero.d.ts +8 -8
- package/dist/video/title-hero.js +48 -34
- package/dist/video/video-card.d.ts +34 -20
- package/dist/video/video-card.js +119 -76
- package/dist/video/video-player.d.ts +17 -14
- package/dist/video/video-player.js +68 -30
- package/dist/video/video-shelf.d.ts +26 -14
- package/dist/video/video-shelf.js +88 -50
- package/package.json +4 -2
- package/dist/docs/callout.d.ts +0 -46
- package/dist/docs/callout.js +0 -61
- package/dist/docs/code-block.d.ts +0 -74
- package/dist/utils/field-parts.d.ts +0 -26
- package/dist/utils/field-parts.js +0 -12
- /package/dist/{docs/mixins → mixins}/copy-feedback.d.ts +0 -0
- /package/dist/{docs/mixins → mixins}/copy-feedback.js +0 -0
- /package/dist/{docs/mixins → mixins}/toc-spy.d.ts +0 -0
- /package/dist/{docs/mixins → mixins}/toc-spy.js +0 -0
- /package/dist/{docs/utils → utils}/reveal-in-scroller.d.ts +0 -0
- /package/dist/{docs/utils → utils}/reveal-in-scroller.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
2
|
import { ChevronDownIcon, MenuIcon, XIcon } from "@sdxc/icons";
|
|
3
3
|
import { keyframes } from "@sdxc/u/animation";
|
|
4
4
|
import { combine, raw, mergeMix } from "@sdxc/u/general";
|
|
@@ -15,6 +15,18 @@ const CONTAINER = "ui-site-header";
|
|
|
15
15
|
const DEFAULT_VARIANT = "bar";
|
|
16
16
|
/** Breakpoint {@link SiteHeader} switches to the inline navigation at when `collapseAt` is omitted. */
|
|
17
17
|
const DEFAULT_COLLAPSE_AT = "xl";
|
|
18
|
+
/** Accessible name of the navigation landmarks and the sheet when `navLabel` is omitted. */
|
|
19
|
+
const DEFAULT_NAV_LABEL = "Main";
|
|
20
|
+
/** What a part reads when it renders outside a {@link SiteHeader}, as in a test or a story. */
|
|
21
|
+
const DEFAULT_CONTEXT = {
|
|
22
|
+
variant: DEFAULT_VARIANT,
|
|
23
|
+
collapseAt: DEFAULT_COLLAPSE_AT,
|
|
24
|
+
navLabel: DEFAULT_NAV_LABEL,
|
|
25
|
+
prefetch: "none",
|
|
26
|
+
base: "site-header",
|
|
27
|
+
anchor: "--site-header-bar",
|
|
28
|
+
groups: { next: 0 },
|
|
29
|
+
};
|
|
18
30
|
/** Block size of the bar; mega panels and their backdrop start right under it. */
|
|
19
31
|
const BAR_HEIGHT = "4rem";
|
|
20
32
|
/** Block size of the floating bar, which sits {@link FLOAT_GAP} below the viewport top. */
|
|
@@ -34,33 +46,65 @@ const FLOAT_FILL_KEYFRAMES = "ui-site-header-float-fill";
|
|
|
34
46
|
/** Keyframes for the phone sheet's entry. */
|
|
35
47
|
const SHEET_ENTER_KEYFRAMES = "ui-site-header-sheet-enter";
|
|
36
48
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
|
|
49
|
+
* Inline padding of a mega panel's content, which its footer row cancels and restores so
|
|
50
|
+
* the footer's hairline spans the same measure as the columns.
|
|
51
|
+
*/
|
|
52
|
+
const PANEL_GUTTER = "--ui-site-header-panel-gutter";
|
|
53
|
+
/**
|
|
54
|
+
* Parts are selected by a marker the header owns, so a caller's own `data-slot` leaves the
|
|
55
|
+
* layout intact.
|
|
56
|
+
*/
|
|
57
|
+
const BRAND = "[data-site-header-part='brand']";
|
|
58
|
+
/** Selects the navigation, centered on a wide bar and the sheet's scrolling row. */
|
|
59
|
+
const NAV = "[data-site-header-part='nav']";
|
|
60
|
+
/** Selects the actions, at the bar's inline end. */
|
|
61
|
+
const ACTIONS = "[data-site-header-part='actions']";
|
|
62
|
+
/** Selects the menu button the header draws after the caller's parts. */
|
|
63
|
+
const MENU = "[data-site-header-part='menu']";
|
|
64
|
+
/** Selects a mega panel column, which the panel counts to size its tracks. */
|
|
65
|
+
const COLUMN = "[data-site-header-part='column']";
|
|
66
|
+
/** Selects a mega panel's closing row. */
|
|
67
|
+
const PANEL_FOOTER = "[data-site-header-part='panel-footer']";
|
|
68
|
+
/** Selects a panel link's glyph well. */
|
|
69
|
+
const LINK_ICON = "[data-site-header-part='column-link-icon']";
|
|
70
|
+
/** Selects a panel link's second line. */
|
|
71
|
+
const LINK_DESCRIPTION = "[data-site-header-part='column-link-description']";
|
|
72
|
+
/**
|
|
73
|
+
* Renders a sticky header whose bar fills as the page scrolls under it, laying out the parts
|
|
74
|
+
* it is given: a {@link SiteHeader.Brand} at the start, a {@link SiteHeader.Nav} centered from
|
|
75
|
+
* `collapseAt`, and {@link SiteHeader.Actions} at the end, followed by the menu button. Below
|
|
76
|
+
* `collapseAt` the same parts draw again in a full-screen sheet of rows at least 44px tall,
|
|
77
|
+
* so the links are written once for both surfaces. Its children are parts only, since the
|
|
78
|
+
* header renders them once per surface.
|
|
40
79
|
*
|
|
41
80
|
* @param handle Runtime handle carrying the host `<header>`'s props.
|
|
42
81
|
* @returns The render function producing the header's markup.
|
|
43
82
|
* @example
|
|
44
|
-
* <SiteHeader
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* />
|
|
83
|
+
* <SiteHeader>
|
|
84
|
+
* <SiteHeader.Brand><a href="/" aria-label="Keel home"><KeelLogo /></a></SiteHeader.Brand>
|
|
85
|
+
* <SiteHeader.Nav><SiteHeader.Link href="/pricing">Pricing</SiteHeader.Link></SiteHeader.Nav>
|
|
86
|
+
* <SiteHeader.Actions><SiteHeader.Action href="/signup" variant="primary">Start free</SiteHeader.Action></SiteHeader.Actions>
|
|
87
|
+
* </SiteHeader>
|
|
50
88
|
*/
|
|
51
89
|
export function SiteHeader(handle) {
|
|
52
90
|
return () => {
|
|
53
|
-
let {
|
|
91
|
+
let { children, closeLabel, collapseAt, menuLabel, mix, navLabel, prefetch, variant, ...rest } = handle.props;
|
|
54
92
|
let resolvedVariant = variant ?? DEFAULT_VARIANT;
|
|
55
93
|
let breakpoint = collapseAt ?? DEFAULT_COLLAPSE_AT;
|
|
56
94
|
let isFloating = resolvedVariant === "floating";
|
|
57
|
-
let
|
|
58
|
-
let resolvedActions = actions ?? [];
|
|
59
|
-
let label = navLabel ?? "Main";
|
|
95
|
+
let label = navLabel ?? DEFAULT_NAV_LABEL;
|
|
60
96
|
let base = rest.id ?? handle.id;
|
|
61
97
|
let sheetId = `${base}-sheet`;
|
|
62
98
|
let anchor = `--${base}-bar`;
|
|
63
|
-
|
|
99
|
+
handle.context.set({
|
|
100
|
+
variant: resolvedVariant,
|
|
101
|
+
collapseAt: breakpoint,
|
|
102
|
+
navLabel: label,
|
|
103
|
+
prefetch: prefetch ?? "none",
|
|
104
|
+
base,
|
|
105
|
+
anchor,
|
|
106
|
+
groups: { next: 0 },
|
|
107
|
+
});
|
|
64
108
|
return (_jsxs("header", { ...rest, "data-slot": "site-header", "data-variant": resolvedVariant, mix: mergeMix([
|
|
65
109
|
container(CONTAINER),
|
|
66
110
|
raw({
|
|
@@ -71,43 +115,369 @@ export function SiteHeader(handle) {
|
|
|
71
115
|
paddingInline: isFloating ? FLOAT_GAP : "0",
|
|
72
116
|
paddingBlockStart: isFloating ? FLOAT_GAP : "0",
|
|
73
117
|
}),
|
|
74
|
-
], mix), children: [_jsx("div", { "data-slot": "site-header-bar", style: { anchorName: anchor }, mix: [isFloating ? floatingBar() : fullBar()], children: _jsxs("div", { "data-slot": "site-header-row", mix: [row(isFloating, breakpoint)], children: [_jsx(
|
|
118
|
+
], mix), children: [_jsx("div", { "data-slot": "site-header-bar", style: { anchorName: anchor }, mix: [isFloating ? floatingBar() : fullBar()], children: _jsxs("div", { "data-slot": "site-header-row", mix: [row(isFloating, breakpoint)], children: [_jsx(SiteHeaderSurface, { surface: "bar", children: children }), _jsx("button", { type: "button", commandfor: sheetId, command: "show-modal", "aria-label": menuLabel ?? "Open menu", "aria-haspopup": "dialog", "data-slot": "site-header-menu-button", "data-site-header-part": "menu", mix: [menuButton(), hideFrom(breakpoint, "inline-grid")], children: _jsx(MenuIcon, { "aria-hidden": "true" }) })] }) }), _jsxs("dialog", { id: sheetId, closedby: "any", "aria-label": label, "data-slot": "site-header-sheet", mix: [sheetSurface()], children: [_jsxs("div", { "data-slot": "site-header-sheet-top", mix: [sheetTop()], children: [_jsx(SiteHeaderSurface, { surface: "sheet-top", children: children }), _jsx("button", { type: "button", commandfor: sheetId, command: "close", "aria-label": closeLabel ?? "Close menu", mix: [menuButton(), raw({ display: "inline-grid", marginInlineStart: "auto" })], children: _jsx(XIcon, { "aria-hidden": "true" }) })] }), _jsx(SiteHeaderSurface, { surface: "sheet", children: children })] })] }));
|
|
75
119
|
};
|
|
76
120
|
}
|
|
77
121
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
122
|
+
* The home link with the logo, at the bar's start and again beside the sheet's close button.
|
|
123
|
+
*
|
|
124
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
125
|
+
* @returns The render function producing the brand cell.
|
|
126
|
+
* @example
|
|
127
|
+
* <SiteHeader.Brand>
|
|
128
|
+
* <a href="/" aria-label="Keel home"><KeelLogo /></a>
|
|
129
|
+
* </SiteHeader.Brand>
|
|
80
130
|
*/
|
|
81
|
-
function
|
|
131
|
+
SiteHeader.Brand = function SiteHeaderBrand(handle) {
|
|
82
132
|
return () => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
], children: link.label }), link.description ? (_jsx("span", { mix: [
|
|
88
|
-
raw({
|
|
89
|
-
fontSize: "0.8125rem",
|
|
90
|
-
lineHeight: "1.25rem",
|
|
91
|
-
color: "var(--ui-neutral-fg-muted)",
|
|
92
|
-
}),
|
|
93
|
-
], children: link.description })) : null] })] }) }, linkIndex))) })] }, index))) }), group.footer ? (_jsx("div", { mix: [panelFooter(floating)], children: _jsxs("a", { href: group.footer.href, "data-rmx-prefetch": linkPrefetch, mix: [panelFooterLink()], children: [group.footer.label, _jsx("span", { "aria-hidden": "true", children: "\u2192" })] }) })) : null] })] }));
|
|
133
|
+
if (readSurface(handle) === "sheet")
|
|
134
|
+
return null;
|
|
135
|
+
let { mix, ...rest } = handle.props;
|
|
136
|
+
return (_jsx("div", { "data-slot": "site-header-brand", ...rest, "data-site-header-part": "brand", mix: mergeMix([brandSlot()], mix) }));
|
|
94
137
|
};
|
|
95
|
-
}
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* The primary navigation: an inline row of {@link SiteHeader.Link} and {@link SiteHeader.Group}
|
|
141
|
+
* entries centered on the bar from `collapseAt`, and the scrolling list of the phone sheet.
|
|
142
|
+
*
|
|
143
|
+
* @param handle Runtime handle carrying the host `<nav>`'s props.
|
|
144
|
+
* @returns The render function producing the navigation landmark.
|
|
145
|
+
* @example
|
|
146
|
+
* <SiteHeader.Nav aria-label="Site">
|
|
147
|
+
* <SiteHeader.Link href="/docs" aria-current="page">Docs</SiteHeader.Link>
|
|
148
|
+
* </SiteHeader.Nav>
|
|
149
|
+
*/
|
|
150
|
+
SiteHeader.Nav = function SiteHeaderNav(handle) {
|
|
151
|
+
return () => {
|
|
152
|
+
let surface = readSurface(handle);
|
|
153
|
+
if (surface === "sheet-top")
|
|
154
|
+
return null;
|
|
155
|
+
let context = readContext(handle);
|
|
156
|
+
let { children, mix, ...rest } = handle.props;
|
|
157
|
+
if (surface === "sheet") {
|
|
158
|
+
return (_jsx("nav", { "aria-label": context.navLabel, "data-slot": "site-header-sheet-nav", ...rest, "data-site-header-part": "nav", mix: mergeMix([sheetBody()], mix), children: _jsx("ul", { mix: [raw({ listStyle: "none", margin: "0", padding: "0" })], children: children }) }));
|
|
159
|
+
}
|
|
160
|
+
return (_jsx("nav", { "aria-label": context.navLabel, "data-slot": "site-header-nav", ...rest, "data-site-header-part": "nav", mix: mergeMix([showFrom(context.collapseAt, "flex")], mix), children: _jsx("ul", { mix: [navList()], children: children }) }));
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* A top-level destination: a quiet link on the bar and a full 3.25rem row in the sheet.
|
|
165
|
+
*
|
|
166
|
+
* @param handle Runtime handle carrying the host `<a>`'s props.
|
|
167
|
+
* @returns The render function producing the list item and its link.
|
|
168
|
+
* @example <SiteHeader.Link href="/pricing">Pricing</SiteHeader.Link>
|
|
169
|
+
*/
|
|
170
|
+
SiteHeader.Link = function SiteHeaderLink(handle) {
|
|
171
|
+
return () => {
|
|
172
|
+
let surface = readSurface(handle);
|
|
173
|
+
let { mix, prefetch, ...rest } = handle.props;
|
|
174
|
+
let linkPrefetch = prefetchAttribute(prefetch ?? readContext(handle).prefetch);
|
|
175
|
+
if (surface === "sheet") {
|
|
176
|
+
return (_jsx("li", { mix: [raw({ borderBlockEnd: "1px solid var(--ui-landing-hairline)" })], children: _jsx("a", { "data-slot": "site-header-link", "data-rmx-prefetch": linkPrefetch, ...rest, mix: mergeMix([sheetRow()], mix) }) }));
|
|
177
|
+
}
|
|
178
|
+
return (_jsx("li", { children: _jsx("a", { "data-slot": "site-header-link", "data-rmx-prefetch": linkPrefetch, ...rest, mix: mergeMix([navTrigger()], mix) }) }));
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* A top-level entry that opens a mega panel on the bar and a disclosure in the sheet. Write
|
|
183
|
+
* its {@link SiteHeader.GroupTrigger} first and its {@link SiteHeader.Panel} right after, so
|
|
184
|
+
* the trigger's chevron turns while the panel is open.
|
|
185
|
+
*
|
|
186
|
+
* @param handle Runtime handle carrying the host `<li>`'s props.
|
|
187
|
+
* @returns The render function producing the group's list item.
|
|
188
|
+
* @example
|
|
189
|
+
* <SiteHeader.Group>
|
|
190
|
+
* <SiteHeader.GroupTrigger>Product</SiteHeader.GroupTrigger>
|
|
191
|
+
* <SiteHeader.Panel>…</SiteHeader.Panel>
|
|
192
|
+
* </SiteHeader.Group>
|
|
193
|
+
*/
|
|
194
|
+
SiteHeader.Group = function SiteHeaderGroup(handle) {
|
|
195
|
+
return () => {
|
|
196
|
+
let surface = readSurface(handle);
|
|
197
|
+
let { children, mix, ...rest } = handle.props;
|
|
198
|
+
if (surface === "sheet") {
|
|
199
|
+
handle.context.set({ panelId: "" });
|
|
200
|
+
return (_jsx("li", { ...rest, mix: mergeMix([raw({ borderBlockEnd: "1px solid var(--ui-landing-hairline)" })], mix), children: _jsx("details", { "data-slot": "site-header-sheet-group", mix: [sheetGroup()], children: children }) }));
|
|
201
|
+
}
|
|
202
|
+
let context = readContext(handle);
|
|
203
|
+
let index = context.groups.next;
|
|
204
|
+
context.groups.next += 1;
|
|
205
|
+
handle.context.set({ panelId: `${context.base}-panel-${index}` });
|
|
206
|
+
return (_jsx("li", { "data-slot": "site-header-group", ...rest, mix: mix, children: children }));
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* The group's label with a chevron: a button toggling the panel on the bar, and the
|
|
211
|
+
* disclosure's summary row in the sheet.
|
|
212
|
+
*
|
|
213
|
+
* @param handle Runtime handle carrying the host `<button>`'s props.
|
|
214
|
+
* @returns The render function producing the trigger.
|
|
215
|
+
* @example <SiteHeader.GroupTrigger>Product</SiteHeader.GroupTrigger>
|
|
216
|
+
*/
|
|
217
|
+
SiteHeader.GroupTrigger = function SiteHeaderGroupTrigger(handle) {
|
|
218
|
+
return () => {
|
|
219
|
+
let { children, mix, ...rest } = handle.props;
|
|
220
|
+
if (readSurface(handle) === "sheet") {
|
|
221
|
+
return (_jsxs("summary", { "data-slot": "site-header-group-trigger", ...rest, mix: mergeMix([sheetRow(), sheetSummary()], mix), children: [children, _jsx(ChevronDownIcon, { "aria-hidden": "true" })] }));
|
|
222
|
+
}
|
|
223
|
+
return (_jsxs("button", { type: "button", commandfor: readGroup(handle).panelId, command: "toggle-popover", "data-slot": "site-header-group-trigger", ...rest, mix: mergeMix([navTrigger(), groupTrigger()], mix), children: [children, _jsx(ChevronDownIcon, { "aria-hidden": "true" })] }));
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* The group's mega panel: fixed under the bar at its full width, with one equal track per
|
|
228
|
+
* {@link SiteHeader.Column} up to four, and a {@link SiteHeader.PanelFooter} ruled off below
|
|
229
|
+
* them. In the sheet it is the open disclosure's body.
|
|
230
|
+
*
|
|
231
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
232
|
+
* @returns The render function producing the panel.
|
|
233
|
+
* @example
|
|
234
|
+
* <SiteHeader.Panel>
|
|
235
|
+
* <SiteHeader.Column>…</SiteHeader.Column>
|
|
236
|
+
* <SiteHeader.PanelFooter href="/features">Browse all features</SiteHeader.PanelFooter>
|
|
237
|
+
* </SiteHeader.Panel>
|
|
238
|
+
*/
|
|
239
|
+
SiteHeader.Panel = function SiteHeaderPanel(handle) {
|
|
240
|
+
return () => {
|
|
241
|
+
let { children, mix, ...rest } = handle.props;
|
|
242
|
+
if (readSurface(handle) === "sheet") {
|
|
243
|
+
return (_jsx("div", { "data-slot": "site-header-sheet-panel", ...rest, mix: mergeMix([raw({ display: "grid", gap: "1.25rem", paddingBlockEnd: "1rem" })], mix), children: children }));
|
|
244
|
+
}
|
|
245
|
+
let context = readContext(handle);
|
|
246
|
+
let floating = context.variant === "floating";
|
|
247
|
+
return (_jsx("div", { id: readGroup(handle).panelId, popover: "auto", "data-slot": "site-header-panel", ...rest, style: { positionAnchor: context.anchor }, mix: mergeMix([panelSurface(floating)], mix), children: _jsx("div", { "data-slot": "site-header-panel-grid", mix: [panelGrid(floating)], children: children }) }));
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* A titled column of links inside a panel, or a group of rows in the sheet's disclosure.
|
|
252
|
+
*
|
|
253
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
254
|
+
* @returns The render function producing the column.
|
|
255
|
+
* @example
|
|
256
|
+
* <SiteHeader.Column>
|
|
257
|
+
* <SiteHeader.ColumnTitle>Monitor</SiteHeader.ColumnTitle>
|
|
258
|
+
* <SiteHeader.ColumnList>…</SiteHeader.ColumnList>
|
|
259
|
+
* </SiteHeader.Column>
|
|
260
|
+
*/
|
|
261
|
+
SiteHeader.Column = function SiteHeaderColumn(handle) {
|
|
262
|
+
return () => {
|
|
263
|
+
let { mix, ...rest } = handle.props;
|
|
264
|
+
return (_jsx("div", { "data-slot": "site-header-column", ...rest, "data-site-header-part": "column", mix: mergeMix([raw({ minInlineSize: "0" })], mix) }));
|
|
265
|
+
};
|
|
266
|
+
};
|
|
96
267
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
268
|
+
* The column's label, set as a mono eyebrow.
|
|
269
|
+
*
|
|
270
|
+
* @param handle Runtime handle carrying the host `<p>`'s props.
|
|
271
|
+
* @returns The render function producing the title.
|
|
272
|
+
* @example <SiteHeader.ColumnTitle>Monitor</SiteHeader.ColumnTitle>
|
|
99
273
|
*/
|
|
100
|
-
function
|
|
274
|
+
SiteHeader.ColumnTitle = function SiteHeaderColumnTitle(handle) {
|
|
101
275
|
return () => {
|
|
102
|
-
let {
|
|
103
|
-
let
|
|
104
|
-
|
|
105
|
-
|
|
276
|
+
let { mix, ...rest } = handle.props;
|
|
277
|
+
let spacing = readSurface(handle) === "sheet"
|
|
278
|
+
? raw({ marginBlock: "0.25rem" })
|
|
279
|
+
: raw({ marginBlockEnd: "0.75rem" });
|
|
280
|
+
return (_jsx("p", { "data-variant": "mono", "data-slot": "site-header-column-title", ...rest, mix: mergeMix([eyebrow(), spacing], mix) }));
|
|
106
281
|
};
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* The column's links, as an unmarked list.
|
|
285
|
+
*
|
|
286
|
+
* @param handle Runtime handle carrying the host `<ul>`'s props.
|
|
287
|
+
* @returns The render function producing the list.
|
|
288
|
+
* @example
|
|
289
|
+
* <SiteHeader.ColumnList>
|
|
290
|
+
* <SiteHeader.ColumnLink href="/uptime">Uptime</SiteHeader.ColumnLink>
|
|
291
|
+
* </SiteHeader.ColumnList>
|
|
292
|
+
*/
|
|
293
|
+
SiteHeader.ColumnList = function SiteHeaderColumnList(handle) {
|
|
294
|
+
return () => {
|
|
295
|
+
let { mix, ...rest } = handle.props;
|
|
296
|
+
return (_jsx("ul", { "data-slot": "site-header-column-list", ...rest, mix: mergeMix([raw({ listStyle: "none", margin: "0", padding: "0" })], mix) }));
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* One destination in a column: a 44px panel row with an optional
|
|
301
|
+
* {@link SiteHeader.ColumnLinkIcon} written first and a
|
|
302
|
+
* {@link SiteHeader.ColumnLinkDescription} under the label; the sheet shows the label alone.
|
|
303
|
+
*
|
|
304
|
+
* @param handle Runtime handle carrying the host `<a>`'s props.
|
|
305
|
+
* @returns The render function producing the list item and its link.
|
|
306
|
+
* @example
|
|
307
|
+
* <SiteHeader.ColumnLink href="/uptime">
|
|
308
|
+
* <SiteHeader.ColumnLinkIcon><ActivityIcon /></SiteHeader.ColumnLinkIcon>
|
|
309
|
+
* Uptime
|
|
310
|
+
* <SiteHeader.ColumnLinkDescription>Probes from 12 regions</SiteHeader.ColumnLinkDescription>
|
|
311
|
+
* </SiteHeader.ColumnLink>
|
|
312
|
+
*/
|
|
313
|
+
SiteHeader.ColumnLink = function SiteHeaderColumnLink(handle) {
|
|
314
|
+
return () => {
|
|
315
|
+
let { mix, prefetch, ...rest } = handle.props;
|
|
316
|
+
let linkPrefetch = prefetchAttribute(prefetch ?? readContext(handle).prefetch);
|
|
317
|
+
let sheet = readSurface(handle) === "sheet";
|
|
318
|
+
return (_jsx("li", { children: _jsx("a", { "data-slot": "site-header-column-link", "data-rmx-prefetch": linkPrefetch, ...rest, mix: mergeMix([sheet ? sheetSubRow() : panelLink()], mix) }) }));
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* A decorative glyph well beside a panel link's label; the sheet leaves it out.
|
|
323
|
+
*
|
|
324
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
325
|
+
* @returns The render function producing the well.
|
|
326
|
+
* @example <SiteHeader.ColumnLinkIcon><ActivityIcon /></SiteHeader.ColumnLinkIcon>
|
|
327
|
+
*/
|
|
328
|
+
SiteHeader.ColumnLinkIcon = function SiteHeaderColumnLinkIcon(handle) {
|
|
329
|
+
return () => {
|
|
330
|
+
if (readSurface(handle) === "sheet")
|
|
331
|
+
return null;
|
|
332
|
+
let { mix, ...rest } = handle.props;
|
|
333
|
+
return (_jsx("span", { "aria-hidden": "true", "data-slot": "site-header-column-link-icon", ...rest, "data-site-header-part": "column-link-icon", mix: mergeMix([panelIcon()], mix) }));
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
/**
|
|
337
|
+
* One muted line under a panel link's label; the sheet leaves it out.
|
|
338
|
+
*
|
|
339
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
340
|
+
* @returns The render function producing the line.
|
|
341
|
+
* @example <SiteHeader.ColumnLinkDescription>Probes from 12 regions</SiteHeader.ColumnLinkDescription>
|
|
342
|
+
*/
|
|
343
|
+
SiteHeader.ColumnLinkDescription = function SiteHeaderColumnLinkDescription(handle) {
|
|
344
|
+
return () => {
|
|
345
|
+
if (readSurface(handle) === "sheet")
|
|
346
|
+
return null;
|
|
347
|
+
let { mix, ...rest } = handle.props;
|
|
348
|
+
return (_jsx("span", { "data-slot": "site-header-column-link-description", ...rest, "data-site-header-part": "column-link-description", mix: mergeMix([
|
|
349
|
+
raw({
|
|
350
|
+
fontSize: "0.8125rem",
|
|
351
|
+
lineHeight: "1.25rem",
|
|
352
|
+
fontWeight: "400",
|
|
353
|
+
color: "var(--ui-neutral-fg-muted)",
|
|
354
|
+
}),
|
|
355
|
+
], mix) }));
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
/**
|
|
359
|
+
* The panel's closing link under a hairline, such as "Browse all integrations", with a
|
|
360
|
+
* trailing arrow; in the sheet it is the disclosure's last, bold row.
|
|
361
|
+
*
|
|
362
|
+
* @param handle Runtime handle carrying the host `<a>`'s props.
|
|
363
|
+
* @returns The render function producing the closing row.
|
|
364
|
+
* @example <SiteHeader.PanelFooter href="/features">Browse all features</SiteHeader.PanelFooter>
|
|
365
|
+
*/
|
|
366
|
+
SiteHeader.PanelFooter = function SiteHeaderPanelFooter(handle) {
|
|
367
|
+
return () => {
|
|
368
|
+
let { children, mix, prefetch, ...rest } = handle.props;
|
|
369
|
+
let linkPrefetch = prefetchAttribute(prefetch ?? readContext(handle).prefetch);
|
|
370
|
+
if (readSurface(handle) === "sheet") {
|
|
371
|
+
return (_jsxs("a", { "data-slot": "site-header-panel-footer", "data-rmx-prefetch": linkPrefetch, ...rest, mix: mergeMix([sheetSubRow(), raw({ fontWeight: "600" })], mix), children: [children, " ", _jsx("span", { "aria-hidden": "true", children: "\u2192" })] }));
|
|
372
|
+
}
|
|
373
|
+
return (_jsx("div", { "data-site-header-part": "panel-footer", mix: [panelFooter()], children: _jsxs("a", { "data-slot": "site-header-panel-footer", "data-rmx-prefetch": linkPrefetch, ...rest, mix: mergeMix([panelFooterLink()], mix), children: [children, _jsx("span", { "aria-hidden": "true", children: "\u2192" })] }) }));
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* The bar's trailing cell holding {@link SiteHeader.Tools} and {@link SiteHeader.Action}
|
|
378
|
+
* parts, end-aligned before the menu button; in the sheet, the actions stack full width at
|
|
379
|
+
* its foot, and a foot with no action to show leaves no row.
|
|
380
|
+
*
|
|
381
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
382
|
+
* @returns The render function producing the actions cell.
|
|
383
|
+
* @example
|
|
384
|
+
* <SiteHeader.Actions>
|
|
385
|
+
* <SiteHeader.Action href="/login">Log in</SiteHeader.Action>
|
|
386
|
+
* <SiteHeader.Action href="/signup" variant="primary">Start free</SiteHeader.Action>
|
|
387
|
+
* </SiteHeader.Actions>
|
|
388
|
+
*/
|
|
389
|
+
SiteHeader.Actions = function SiteHeaderActions(handle) {
|
|
390
|
+
return () => {
|
|
391
|
+
let surface = readSurface(handle);
|
|
392
|
+
if (surface === "sheet-top")
|
|
393
|
+
return null;
|
|
394
|
+
let { mix, ...rest } = handle.props;
|
|
395
|
+
if (surface === "sheet") {
|
|
396
|
+
return (_jsx("div", { "data-slot": "site-header-sheet-actions", ...rest, "data-site-header-part": "actions", mix: mergeMix([sheetActions(), when("&:not(:has(> *))", raw({ display: "none" }))], mix) }));
|
|
397
|
+
}
|
|
398
|
+
return (_jsx("div", { "data-slot": "site-header-actions", ...rest, "data-site-header-part": "actions", mix: mergeMix([endSlot()], mix) }));
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* Controls the bar shows before its actions, such as search, a theme toggle or a repository
|
|
403
|
+
* link. They render on the bar alone, so a control that owns a dialog or an id draws once.
|
|
404
|
+
*
|
|
405
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
406
|
+
* @returns The render function producing the tools.
|
|
407
|
+
* @example <SiteHeader.Tools><SearchTrigger /></SiteHeader.Tools>
|
|
408
|
+
*/
|
|
409
|
+
SiteHeader.Tools = function SiteHeaderTools(handle) {
|
|
410
|
+
return () => {
|
|
411
|
+
if (readSurface(handle) !== "bar")
|
|
412
|
+
return null;
|
|
413
|
+
let { mix, ...rest } = handle.props;
|
|
414
|
+
return (_jsx("div", { "data-slot": "site-header-tools", ...rest, mix: mergeMix([raw({ display: "flex", alignItems: "center", gap: "0.5rem", minInlineSize: "0" })], mix) }));
|
|
415
|
+
};
|
|
416
|
+
};
|
|
417
|
+
/**
|
|
418
|
+
* An account action the header sizes per surface: on the bar a `primary` action is the brand
|
|
419
|
+
* button at every width and a `secondary` one a ghost button from `collapseAt`; in the sheet
|
|
420
|
+
* both are large and full width.
|
|
421
|
+
*
|
|
422
|
+
* @param handle Runtime handle carrying the host `<a>`'s props.
|
|
423
|
+
* @returns The render function producing the action.
|
|
424
|
+
* @example <SiteHeader.Action href="/signup" variant="primary">Start free</SiteHeader.Action>
|
|
425
|
+
*/
|
|
426
|
+
SiteHeader.Action = function SiteHeaderAction(handle) {
|
|
427
|
+
return () => {
|
|
428
|
+
let surface = readSurface(handle);
|
|
429
|
+
let context = readContext(handle);
|
|
430
|
+
let { mix, prefetch, variant, ...rest } = handle.props;
|
|
431
|
+
let primary = variant === "primary";
|
|
432
|
+
let resolvedPrefetch = prefetch ?? context.prefetch;
|
|
433
|
+
if (surface === "sheet") {
|
|
434
|
+
return (_jsx(LinkButton, { "data-slot": "site-header-action", ...rest, prefetch: resolvedPrefetch, variant: primary ? "solid" : "surface", color: primary ? "brand" : "neutral", size: "lg", mix: [raw({ inlineSize: "100%", justifyContent: "center" }), mix] }));
|
|
435
|
+
}
|
|
436
|
+
if (primary) {
|
|
437
|
+
return (_jsx(LinkButton, { "data-slot": "site-header-action", ...rest, prefetch: resolvedPrefetch, color: "brand", mix: mix }));
|
|
438
|
+
}
|
|
439
|
+
return (_jsx("span", { mix: [showFrom(context.collapseAt, "inline-flex")], children: _jsx(LinkButton, { "data-slot": "site-header-action", ...rest, prefetch: resolvedPrefetch, variant: "ghost", color: "neutral", mix: mix }) }));
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
/**
|
|
443
|
+
* What the phone sheet ends with, under its actions, such as a few secondary links or a
|
|
444
|
+
* client island that closes the sheet when an in-page link is followed. The bar leaves it out.
|
|
445
|
+
*
|
|
446
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
447
|
+
* @returns The render function producing the sheet's closing content.
|
|
448
|
+
* @example <SiteHeader.Sheet><DialogDismiss /></SiteHeader.Sheet>
|
|
449
|
+
*/
|
|
450
|
+
SiteHeader.Sheet = function SiteHeaderSheet(handle) {
|
|
451
|
+
return () => {
|
|
452
|
+
if (readSurface(handle) !== "sheet")
|
|
453
|
+
return null;
|
|
454
|
+
return _jsx("div", { "data-slot": "site-header-sheet-extra", ...handle.props });
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Tells the parts beneath it which surface they draw on, so the header can render the same
|
|
459
|
+
* parts in the bar and the sheet and each part picks its markup there.
|
|
460
|
+
*/
|
|
461
|
+
function SiteHeaderSurface(handle) {
|
|
462
|
+
return () => {
|
|
463
|
+
handle.context.set({ surface: handle.props.surface });
|
|
464
|
+
return handle.props.children;
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
/** The surface a part draws on, the bar when it renders outside a header. */
|
|
468
|
+
function readSurface(handle) {
|
|
469
|
+
let surface = handle.context.get(SiteHeaderSurface);
|
|
470
|
+
return surface?.surface ?? "bar";
|
|
107
471
|
}
|
|
108
|
-
/**
|
|
109
|
-
function
|
|
110
|
-
return
|
|
472
|
+
/** The header's resolved values, or the defaults when a part renders alone. */
|
|
473
|
+
function readContext(handle) {
|
|
474
|
+
return handle.context.get(SiteHeader) ?? DEFAULT_CONTEXT;
|
|
475
|
+
}
|
|
476
|
+
/** The enclosing group's ids, empty when a trigger or panel renders alone. */
|
|
477
|
+
function readGroup(handle) {
|
|
478
|
+
return (handle.context.get(SiteHeader.Group) ?? {
|
|
479
|
+
panelId: `${readContext(handle).base}-panel`,
|
|
480
|
+
});
|
|
111
481
|
}
|
|
112
482
|
/** Hides an element until the header reaches `breakpoint`, then shows it with `display`. */
|
|
113
483
|
function showFrom(breakpoint, display) {
|
|
@@ -185,7 +555,9 @@ function floatingBar() {
|
|
|
185
555
|
/**
|
|
186
556
|
* The bar's row. A full bar uses the content measure, so the brand lines up with every
|
|
187
557
|
* band's copy; a floating bar's padding is the gutter less its own inset, which keeps the
|
|
188
|
-
* same alignment.
|
|
558
|
+
* same alignment. Below `breakpoint` the brand pushes everything after it to the end; from
|
|
559
|
+
* it the row is three tracks with the brand, the navigation and the actions each in its own,
|
|
560
|
+
* whatever order they are written in, so the links sit centered.
|
|
189
561
|
*/
|
|
190
562
|
function row(floating, breakpoint) {
|
|
191
563
|
return [
|
|
@@ -199,14 +571,19 @@ function row(floating, breakpoint) {
|
|
|
199
571
|
raw({
|
|
200
572
|
display: "flex",
|
|
201
573
|
alignItems: "center",
|
|
202
|
-
justifyContent: "space-between",
|
|
203
574
|
gap: "1rem",
|
|
204
575
|
blockSize: floating ? FLOAT_HEIGHT : BAR_HEIGHT,
|
|
576
|
+
[`& > ${BRAND}`]: { marginInlineEnd: "auto" },
|
|
577
|
+
[`& > ${MENU}`]: { marginInlineStart: "-0.5rem" },
|
|
205
578
|
}),
|
|
206
579
|
at(breakpoint, CONTAINER, raw({
|
|
207
580
|
display: "grid",
|
|
208
581
|
gridTemplateColumns: "1fr auto 1fr",
|
|
209
582
|
gap: "2rem",
|
|
583
|
+
"& > *": { gridRow: "1" },
|
|
584
|
+
[`& > ${BRAND}`]: { gridColumn: "1" },
|
|
585
|
+
[`& > ${NAV}`]: { gridColumn: "2" },
|
|
586
|
+
[`& > ${ACTIONS}`]: { gridColumn: "3" },
|
|
210
587
|
})),
|
|
211
588
|
];
|
|
212
589
|
}
|
|
@@ -220,7 +597,7 @@ function brandSlot() {
|
|
|
220
597
|
color: "var(--ui-neutral-fg-emphasis)",
|
|
221
598
|
});
|
|
222
599
|
}
|
|
223
|
-
/** The trailing cell: tools, actions
|
|
600
|
+
/** The trailing cell: tools, actions and the primary action, end-aligned. */
|
|
224
601
|
function endSlot() {
|
|
225
602
|
return raw({
|
|
226
603
|
display: "flex",
|
|
@@ -374,29 +751,53 @@ function panelSurface(floating) {
|
|
|
374
751
|
]);
|
|
375
752
|
}
|
|
376
753
|
/**
|
|
377
|
-
* The panel's
|
|
378
|
-
* the
|
|
754
|
+
* The panel's content on the content measure: one equal track per column, from one to four,
|
|
755
|
+
* counted from the columns written, so a three-column group never leaves an empty fourth
|
|
756
|
+
* track. A footer spans every track on the last row.
|
|
379
757
|
*/
|
|
380
|
-
function panelGrid(
|
|
381
|
-
let tracks = Math.min(Math.max(count, 1), 4);
|
|
758
|
+
function panelGrid(floating) {
|
|
382
759
|
return [
|
|
383
|
-
floating
|
|
760
|
+
floating
|
|
761
|
+
? raw({ [PANEL_GUTTER]: "1.5rem" })
|
|
762
|
+
: combine([
|
|
763
|
+
raw({ [PANEL_GUTTER]: "var(--ui-landing-gutter, 1rem)" }),
|
|
764
|
+
at("md", raw({ [PANEL_GUTTER]: "1.5rem" })),
|
|
765
|
+
at("lg", raw({ [PANEL_GUTTER]: "2rem" })),
|
|
766
|
+
]),
|
|
384
767
|
raw({
|
|
768
|
+
maxInlineSize: floating ? "none" : "var(--ui-landing-measure, 72rem)",
|
|
769
|
+
marginInline: "auto",
|
|
770
|
+
paddingInline: `var(${PANEL_GUTTER})`,
|
|
385
771
|
display: "grid",
|
|
386
|
-
gridTemplateColumns:
|
|
772
|
+
gridTemplateColumns: "minmax(0, 1fr)",
|
|
387
773
|
columnGap: "2rem",
|
|
388
774
|
rowGap: "1.5rem",
|
|
389
775
|
paddingBlock: "1.75rem",
|
|
776
|
+
[`&:has(> :nth-child(2 of ${COLUMN}))`]: {
|
|
777
|
+
gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
|
|
778
|
+
},
|
|
779
|
+
[`&:has(> :nth-child(3 of ${COLUMN}))`]: {
|
|
780
|
+
gridTemplateColumns: "repeat(3, minmax(0, 1fr))",
|
|
781
|
+
},
|
|
782
|
+
[`&:has(> :nth-child(4 of ${COLUMN}))`]: {
|
|
783
|
+
gridTemplateColumns: "repeat(4, minmax(0, 1fr))",
|
|
784
|
+
},
|
|
785
|
+
[`&:has(> ${PANEL_FOOTER})`]: { paddingBlockEnd: "0" },
|
|
390
786
|
}),
|
|
391
787
|
];
|
|
392
788
|
}
|
|
393
|
-
/**
|
|
789
|
+
/**
|
|
790
|
+
* A panel link: a 44px row with an optional glyph well spanning the label and its muted
|
|
791
|
+
* line. The label sets in the heading ink; a description sets its own size and ink.
|
|
792
|
+
*/
|
|
394
793
|
function panelLink() {
|
|
395
794
|
return combine([
|
|
396
795
|
raw({
|
|
397
|
-
display: "
|
|
398
|
-
|
|
399
|
-
|
|
796
|
+
display: "grid",
|
|
797
|
+
gridTemplateColumns: "minmax(0, 1fr)",
|
|
798
|
+
alignItems: "start",
|
|
799
|
+
columnGap: "0.75rem",
|
|
800
|
+
rowGap: "0.125rem",
|
|
400
801
|
minBlockSize: "2.75rem",
|
|
401
802
|
marginInline: "-0.625rem",
|
|
402
803
|
paddingBlock: "0.5rem",
|
|
@@ -404,7 +805,13 @@ function panelLink() {
|
|
|
404
805
|
borderRadius: "0.625rem",
|
|
405
806
|
fontSize: "0.9375rem",
|
|
406
807
|
lineHeight: "1.375rem",
|
|
808
|
+
fontWeight: "500",
|
|
809
|
+
color: "var(--ui-neutral-fg-emphasis)",
|
|
407
810
|
textDecoration: "none",
|
|
811
|
+
[`&:has(> ${LINK_ICON})`]: { gridTemplateColumns: "auto minmax(0, 1fr)" },
|
|
812
|
+
[`& > ${LINK_ICON}`]: { gridColumn: "1" },
|
|
813
|
+
[`&:has(> ${LINK_DESCRIPTION}) > ${LINK_ICON}`]: { gridRow: "span 2" },
|
|
814
|
+
[`& > ${LINK_DESCRIPTION}`]: { gridColumn: "-2" },
|
|
408
815
|
}),
|
|
409
816
|
hover(raw({ backgroundColor: "var(--ui-neutral-bg-tint-hover)" })),
|
|
410
817
|
when("&:focus-visible", raw({
|
|
@@ -429,16 +836,21 @@ function panelIcon() {
|
|
|
429
836
|
when("& > svg", raw({ inlineSize: "1.25rem", blockSize: "1.25rem" })),
|
|
430
837
|
]);
|
|
431
838
|
}
|
|
432
|
-
/**
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
839
|
+
/**
|
|
840
|
+
* The panel's closing row across every track, ruled off from the columns. It reaches back
|
|
841
|
+
* over the panel's gutter so the hairline spans the content measure, and keeps the 1.75rem
|
|
842
|
+
* the columns end with above the rule.
|
|
843
|
+
*/
|
|
844
|
+
function panelFooter() {
|
|
845
|
+
return raw({
|
|
846
|
+
gridColumn: "1 / -1",
|
|
847
|
+
display: "flex",
|
|
848
|
+
marginBlockStart: "0.25rem",
|
|
849
|
+
marginInline: `calc(-1 * var(${PANEL_GUTTER}))`,
|
|
850
|
+
paddingInline: `var(${PANEL_GUTTER})`,
|
|
851
|
+
paddingBlock: "1rem",
|
|
852
|
+
borderBlockStart: "1px solid var(--ui-landing-hairline)",
|
|
853
|
+
});
|
|
442
854
|
}
|
|
443
855
|
/** The panel's closing link, set in the heading ink with a trailing arrow. */
|
|
444
856
|
function panelFooterLink() {
|
|
@@ -457,8 +869,9 @@ function panelFooterLink() {
|
|
|
457
869
|
}
|
|
458
870
|
/**
|
|
459
871
|
* The phone sheet: a modal dialog covering the viewport, opaque, with the bar repeated at
|
|
460
|
-
* its top,
|
|
461
|
-
* 0.5rem in 150ms when motion
|
|
872
|
+
* its top, the scrolling navigation in the one stretching row, and the actions and the
|
|
873
|
+
* sheet's closing content after it. Its entry fades and drops 0.5rem in 150ms when motion
|
|
874
|
+
* is allowed.
|
|
462
875
|
*/
|
|
463
876
|
function sheetSurface() {
|
|
464
877
|
return combine([
|
|
@@ -482,7 +895,9 @@ function sheetSurface() {
|
|
|
482
895
|
}),
|
|
483
896
|
when("&[open]", raw({
|
|
484
897
|
display: "grid",
|
|
485
|
-
gridTemplateRows: "auto minmax(0, 1fr)
|
|
898
|
+
gridTemplateRows: "auto minmax(0, 1fr)",
|
|
899
|
+
gridAutoRows: "auto",
|
|
900
|
+
[`& > ${NAV}`]: { gridRow: "2" },
|
|
486
901
|
})),
|
|
487
902
|
when("&::backdrop", raw({ backgroundColor: "var(--ui-bg)" })),
|
|
488
903
|
motionSafe(when("&[open]", raw({
|