@brandlab-digital/site-next 3.19.1 → 4.0.0
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/dist/blog.d.ts +18 -2
- package/dist/blog.d.ts.map +1 -1
- package/dist/blog.js +14 -2
- package/dist/blog.js.map +1 -1
- package/dist/instrumentation-client.d.ts +1 -1
- package/dist/instrumentation-client.js +1 -1
- package/dist/instrumentation-client.js.map +1 -1
- package/dist/navigation/index.d.ts +2 -3
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +2 -3
- package/dist/navigation/index.js.map +1 -1
- package/dist/next-config.d.ts +1 -17
- package/dist/next-config.d.ts.map +1 -1
- package/dist/next-config.js +2 -33
- package/dist/next-config.js.map +1 -1
- package/package.json +4 -33
- package/dist/ui-kit/brandlab-skin.d.ts +0 -112
- package/dist/ui-kit/brandlab-skin.d.ts.map +0 -1
- package/dist/ui-kit/brandlab-skin.js +0 -2
- package/dist/ui-kit/brandlab-skin.js.map +0 -1
- package/dist/ui-kit/form/copy.d.ts +0 -3
- package/dist/ui-kit/form/copy.d.ts.map +0 -1
- package/dist/ui-kit/form/copy.js +0 -5
- package/dist/ui-kit/form/copy.js.map +0 -1
- package/dist/ui-kit/form/dialog.d.ts +0 -24
- package/dist/ui-kit/form/dialog.d.ts.map +0 -1
- package/dist/ui-kit/form/dialog.js +0 -17
- package/dist/ui-kit/form/dialog.js.map +0 -1
- package/dist/ui-kit/form/field.d.ts +0 -30
- package/dist/ui-kit/form/field.d.ts.map +0 -1
- package/dist/ui-kit/form/field.js +0 -11
- package/dist/ui-kit/form/field.js.map +0 -1
- package/dist/ui-kit/form/index.d.ts +0 -7
- package/dist/ui-kit/form/index.d.ts.map +0 -1
- package/dist/ui-kit/form/index.js +0 -7
- package/dist/ui-kit/form/index.js.map +0 -1
- package/dist/ui-kit/form/photo-upload.d.ts +0 -40
- package/dist/ui-kit/form/photo-upload.d.ts.map +0 -1
- package/dist/ui-kit/form/photo-upload.js +0 -19
- package/dist/ui-kit/form/photo-upload.js.map +0 -1
- package/dist/ui-kit/form/quote-dialog.d.ts +0 -15
- package/dist/ui-kit/form/quote-dialog.d.ts.map +0 -1
- package/dist/ui-kit/form/quote-dialog.js +0 -68
- package/dist/ui-kit/form/quote-dialog.js.map +0 -1
- package/dist/ui-kit/form/quote-form.d.ts +0 -172
- package/dist/ui-kit/form/quote-form.d.ts.map +0 -1
- package/dist/ui-kit/form/quote-form.js +0 -238
- package/dist/ui-kit/form/quote-form.js.map +0 -1
- package/dist/ui-kit/form/thank-you.d.ts +0 -40
- package/dist/ui-kit/form/thank-you.d.ts.map +0 -1
- package/dist/ui-kit/form/thank-you.js +0 -36
- package/dist/ui-kit/form/thank-you.js.map +0 -1
- package/dist/ui-kit/icon-glyphs.d.ts +0 -41
- package/dist/ui-kit/icon-glyphs.d.ts.map +0 -1
- package/dist/ui-kit/icon-glyphs.js +0 -138
- package/dist/ui-kit/icon-glyphs.js.map +0 -1
- package/dist/ui-kit/icon-sprite.d.ts +0 -19
- package/dist/ui-kit/icon-sprite.d.ts.map +0 -1
- package/dist/ui-kit/icon-sprite.js +0 -44
- package/dist/ui-kit/icon-sprite.js.map +0 -1
- package/dist/ui-kit/icons.d.ts +0 -50
- package/dist/ui-kit/icons.d.ts.map +0 -1
- package/dist/ui-kit/icons.js +0 -55
- package/dist/ui-kit/icons.js.map +0 -1
- package/dist/ui-kit/prefetch.d.ts +0 -59
- package/dist/ui-kit/prefetch.d.ts.map +0 -1
- package/dist/ui-kit/prefetch.js +0 -63
- package/dist/ui-kit/prefetch.js.map +0 -1
- package/dist/ui-kit/primitives/badge.d.ts +0 -25
- package/dist/ui-kit/primitives/badge.d.ts.map +0 -1
- package/dist/ui-kit/primitives/badge.js +0 -21
- package/dist/ui-kit/primitives/badge.js.map +0 -1
- package/dist/ui-kit/primitives/breadcrumbs.d.ts +0 -27
- package/dist/ui-kit/primitives/breadcrumbs.d.ts.map +0 -1
- package/dist/ui-kit/primitives/breadcrumbs.js +0 -40
- package/dist/ui-kit/primitives/breadcrumbs.js.map +0 -1
- package/dist/ui-kit/primitives/button.d.ts +0 -32
- package/dist/ui-kit/primitives/button.d.ts.map +0 -1
- package/dist/ui-kit/primitives/button.js +0 -8
- package/dist/ui-kit/primitives/button.js.map +0 -1
- package/dist/ui-kit/primitives/card.d.ts +0 -40
- package/dist/ui-kit/primitives/card.d.ts.map +0 -1
- package/dist/ui-kit/primitives/card.js +0 -8
- package/dist/ui-kit/primitives/card.js.map +0 -1
- package/dist/ui-kit/primitives/index.d.ts +0 -16
- package/dist/ui-kit/primitives/index.d.ts.map +0 -1
- package/dist/ui-kit/primitives/index.js +0 -16
- package/dist/ui-kit/primitives/index.js.map +0 -1
- package/dist/ui-kit/primitives/layout.d.ts +0 -85
- package/dist/ui-kit/primitives/layout.d.ts.map +0 -1
- package/dist/ui-kit/primitives/layout.js +0 -52
- package/dist/ui-kit/primitives/layout.js.map +0 -1
- package/dist/ui-kit/primitives/links.d.ts +0 -74
- package/dist/ui-kit/primitives/links.d.ts.map +0 -1
- package/dist/ui-kit/primitives/links.js +0 -41
- package/dist/ui-kit/primitives/links.js.map +0 -1
- package/dist/ui-kit/primitives/lists.d.ts +0 -51
- package/dist/ui-kit/primitives/lists.d.ts.map +0 -1
- package/dist/ui-kit/primitives/lists.js +0 -34
- package/dist/ui-kit/primitives/lists.js.map +0 -1
- package/dist/ui-kit/primitives/media-frame.d.ts +0 -33
- package/dist/ui-kit/primitives/media-frame.d.ts.map +0 -1
- package/dist/ui-kit/primitives/media-frame.js +0 -61
- package/dist/ui-kit/primitives/media-frame.js.map +0 -1
- package/dist/ui-kit/primitives/media.d.ts +0 -40
- package/dist/ui-kit/primitives/media.d.ts.map +0 -1
- package/dist/ui-kit/primitives/media.js +0 -9
- package/dist/ui-kit/primitives/media.js.map +0 -1
- package/dist/ui-kit/primitives/quote-button.d.ts +0 -46
- package/dist/ui-kit/primitives/quote-button.d.ts.map +0 -1
- package/dist/ui-kit/primitives/quote-button.js +0 -38
- package/dist/ui-kit/primitives/quote-button.js.map +0 -1
- package/dist/ui-kit/primitives/stat.d.ts +0 -25
- package/dist/ui-kit/primitives/stat.d.ts.map +0 -1
- package/dist/ui-kit/primitives/stat.js +0 -7
- package/dist/ui-kit/primitives/stat.js.map +0 -1
- package/dist/ui-kit/repeated-slots.d.ts +0 -153
- package/dist/ui-kit/repeated-slots.d.ts.map +0 -1
- package/dist/ui-kit/repeated-slots.js +0 -100
- package/dist/ui-kit/repeated-slots.js.map +0 -1
- package/dist/ui-kit/sections/accordion.d.ts +0 -28
- package/dist/ui-kit/sections/accordion.d.ts.map +0 -1
- package/dist/ui-kit/sections/accordion.js +0 -14
- package/dist/ui-kit/sections/accordion.js.map +0 -1
- package/dist/ui-kit/sections/area-map.d.ts +0 -64
- package/dist/ui-kit/sections/area-map.d.ts.map +0 -1
- package/dist/ui-kit/sections/area-map.js +0 -146
- package/dist/ui-kit/sections/area-map.js.map +0 -1
- package/dist/ui-kit/sections/before-after.d.ts +0 -59
- package/dist/ui-kit/sections/before-after.d.ts.map +0 -1
- package/dist/ui-kit/sections/before-after.js +0 -42
- package/dist/ui-kit/sections/before-after.js.map +0 -1
- package/dist/ui-kit/sections/contact-block.d.ts +0 -77
- package/dist/ui-kit/sections/contact-block.d.ts.map +0 -1
- package/dist/ui-kit/sections/contact-block.js +0 -23
- package/dist/ui-kit/sections/contact-block.js.map +0 -1
- package/dist/ui-kit/sections/council-rules.d.ts +0 -64
- package/dist/ui-kit/sections/council-rules.d.ts.map +0 -1
- package/dist/ui-kit/sections/council-rules.js +0 -46
- package/dist/ui-kit/sections/council-rules.js.map +0 -1
- package/dist/ui-kit/sections/coverage.d.ts +0 -53
- package/dist/ui-kit/sections/coverage.d.ts.map +0 -1
- package/dist/ui-kit/sections/coverage.js +0 -57
- package/dist/ui-kit/sections/coverage.js.map +0 -1
- package/dist/ui-kit/sections/cta-band.d.ts +0 -67
- package/dist/ui-kit/sections/cta-band.d.ts.map +0 -1
- package/dist/ui-kit/sections/cta-band.js +0 -11
- package/dist/ui-kit/sections/cta-band.js.map +0 -1
- package/dist/ui-kit/sections/emergency-band.d.ts +0 -60
- package/dist/ui-kit/sections/emergency-band.d.ts.map +0 -1
- package/dist/ui-kit/sections/emergency-band.js +0 -43
- package/dist/ui-kit/sections/emergency-band.js.map +0 -1
- package/dist/ui-kit/sections/faqs.d.ts +0 -46
- package/dist/ui-kit/sections/faqs.d.ts.map +0 -1
- package/dist/ui-kit/sections/faqs.js +0 -39
- package/dist/ui-kit/sections/faqs.js.map +0 -1
- package/dist/ui-kit/sections/gallery.d.ts +0 -60
- package/dist/ui-kit/sections/gallery.d.ts.map +0 -1
- package/dist/ui-kit/sections/gallery.js +0 -39
- package/dist/ui-kit/sections/gallery.js.map +0 -1
- package/dist/ui-kit/sections/hero.d.ts +0 -168
- package/dist/ui-kit/sections/hero.d.ts.map +0 -1
- package/dist/ui-kit/sections/hero.js +0 -147
- package/dist/ui-kit/sections/hero.js.map +0 -1
- package/dist/ui-kit/sections/index.d.ts +0 -29
- package/dist/ui-kit/sections/index.d.ts.map +0 -1
- package/dist/ui-kit/sections/index.js +0 -29
- package/dist/ui-kit/sections/index.js.map +0 -1
- package/dist/ui-kit/sections/licences.d.ts +0 -95
- package/dist/ui-kit/sections/licences.d.ts.map +0 -1
- package/dist/ui-kit/sections/licences.js +0 -72
- package/dist/ui-kit/sections/licences.js.map +0 -1
- package/dist/ui-kit/sections/local-facts.d.ts +0 -107
- package/dist/ui-kit/sections/local-facts.d.ts.map +0 -1
- package/dist/ui-kit/sections/local-facts.js +0 -44
- package/dist/ui-kit/sections/local-facts.js.map +0 -1
- package/dist/ui-kit/sections/nearby-areas.d.ts +0 -50
- package/dist/ui-kit/sections/nearby-areas.d.ts.map +0 -1
- package/dist/ui-kit/sections/nearby-areas.js +0 -49
- package/dist/ui-kit/sections/nearby-areas.js.map +0 -1
- package/dist/ui-kit/sections/nearby-jobs.d.ts +0 -84
- package/dist/ui-kit/sections/nearby-jobs.d.ts.map +0 -1
- package/dist/ui-kit/sections/nearby-jobs.js +0 -69
- package/dist/ui-kit/sections/nearby-jobs.js.map +0 -1
- package/dist/ui-kit/sections/page-header.d.ts +0 -29
- package/dist/ui-kit/sections/page-header.d.ts.map +0 -1
- package/dist/ui-kit/sections/page-header.js +0 -9
- package/dist/ui-kit/sections/page-header.js.map +0 -1
- package/dist/ui-kit/sections/price-guide.d.ts +0 -59
- package/dist/ui-kit/sections/price-guide.d.ts.map +0 -1
- package/dist/ui-kit/sections/price-guide.js +0 -28
- package/dist/ui-kit/sections/price-guide.js.map +0 -1
- package/dist/ui-kit/sections/price-table.d.ts +0 -42
- package/dist/ui-kit/sections/price-table.d.ts.map +0 -1
- package/dist/ui-kit/sections/price-table.js +0 -29
- package/dist/ui-kit/sections/price-table.js.map +0 -1
- package/dist/ui-kit/sections/projects.d.ts +0 -79
- package/dist/ui-kit/sections/projects.d.ts.map +0 -1
- package/dist/ui-kit/sections/projects.js +0 -69
- package/dist/ui-kit/sections/projects.js.map +0 -1
- package/dist/ui-kit/sections/proof-strip.d.ts +0 -68
- package/dist/ui-kit/sections/proof-strip.d.ts.map +0 -1
- package/dist/ui-kit/sections/proof-strip.js +0 -27
- package/dist/ui-kit/sections/proof-strip.js.map +0 -1
- package/dist/ui-kit/sections/quote-checklist.d.ts +0 -43
- package/dist/ui-kit/sections/quote-checklist.d.ts.map +0 -1
- package/dist/ui-kit/sections/quote-checklist.js +0 -19
- package/dist/ui-kit/sections/quote-checklist.js.map +0 -1
- package/dist/ui-kit/sections/rating-chip.d.ts +0 -35
- package/dist/ui-kit/sections/rating-chip.d.ts.map +0 -1
- package/dist/ui-kit/sections/rating-chip.js +0 -21
- package/dist/ui-kit/sections/rating-chip.js.map +0 -1
- package/dist/ui-kit/sections/related-services.d.ts +0 -41
- package/dist/ui-kit/sections/related-services.d.ts.map +0 -1
- package/dist/ui-kit/sections/related-services.js +0 -52
- package/dist/ui-kit/sections/related-services.js.map +0 -1
- package/dist/ui-kit/sections/reviews-band.d.ts +0 -124
- package/dist/ui-kit/sections/reviews-band.d.ts.map +0 -1
- package/dist/ui-kit/sections/reviews-band.js +0 -115
- package/dist/ui-kit/sections/reviews-band.js.map +0 -1
- package/dist/ui-kit/sections/section-sequence.d.ts +0 -41
- package/dist/ui-kit/sections/section-sequence.d.ts.map +0 -1
- package/dist/ui-kit/sections/section-sequence.js +0 -36
- package/dist/ui-kit/sections/section-sequence.js.map +0 -1
- package/dist/ui-kit/sections/services-grid.d.ts +0 -82
- package/dist/ui-kit/sections/services-grid.d.ts.map +0 -1
- package/dist/ui-kit/sections/services-grid.js +0 -90
- package/dist/ui-kit/sections/services-grid.js.map +0 -1
- package/dist/ui-kit/sections/signature-section.d.ts +0 -42
- package/dist/ui-kit/sections/signature-section.d.ts.map +0 -1
- package/dist/ui-kit/sections/signature-section.js +0 -14
- package/dist/ui-kit/sections/signature-section.js.map +0 -1
- package/dist/ui-kit/sections/site-footer-columns.d.ts +0 -12
- package/dist/ui-kit/sections/site-footer-columns.d.ts.map +0 -1
- package/dist/ui-kit/sections/site-footer-columns.js +0 -63
- package/dist/ui-kit/sections/site-footer-columns.js.map +0 -1
- package/dist/ui-kit/sections/site-footer.d.ts +0 -66
- package/dist/ui-kit/sections/site-footer.d.ts.map +0 -1
- package/dist/ui-kit/sections/site-footer.js +0 -49
- package/dist/ui-kit/sections/site-footer.js.map +0 -1
- package/dist/ui-kit/sections/work-photos.d.ts +0 -15
- package/dist/ui-kit/sections/work-photos.d.ts.map +0 -1
- package/dist/ui-kit/sections/work-photos.js +0 -24
- package/dist/ui-kit/sections/work-photos.js.map +0 -1
- package/dist/ui-kit/shell/back-to-top-client.d.ts +0 -9
- package/dist/ui-kit/shell/back-to-top-client.d.ts.map +0 -1
- package/dist/ui-kit/shell/back-to-top-client.js +0 -8
- package/dist/ui-kit/shell/back-to-top-client.js.map +0 -1
- package/dist/ui-kit/shell/back-to-top.d.ts +0 -13
- package/dist/ui-kit/shell/back-to-top.d.ts.map +0 -1
- package/dist/ui-kit/shell/back-to-top.js +0 -14
- package/dist/ui-kit/shell/back-to-top.js.map +0 -1
- package/dist/ui-kit/shell/call-bar-client.d.ts +0 -8
- package/dist/ui-kit/shell/call-bar-client.d.ts.map +0 -1
- package/dist/ui-kit/shell/call-bar-client.js +0 -13
- package/dist/ui-kit/shell/call-bar-client.js.map +0 -1
- package/dist/ui-kit/shell/current-link.d.ts +0 -45
- package/dist/ui-kit/shell/current-link.d.ts.map +0 -1
- package/dist/ui-kit/shell/current-link.js +0 -54
- package/dist/ui-kit/shell/current-link.js.map +0 -1
- package/dist/ui-kit/shell/drawer-client.d.ts +0 -22
- package/dist/ui-kit/shell/drawer-client.d.ts.map +0 -1
- package/dist/ui-kit/shell/drawer-client.js +0 -70
- package/dist/ui-kit/shell/drawer-client.js.map +0 -1
- package/dist/ui-kit/shell/header-client.d.ts +0 -44
- package/dist/ui-kit/shell/header-client.d.ts.map +0 -1
- package/dist/ui-kit/shell/header-client.js +0 -59
- package/dist/ui-kit/shell/header-client.js.map +0 -1
- package/dist/ui-kit/shell/index.d.ts +0 -7
- package/dist/ui-kit/shell/index.d.ts.map +0 -1
- package/dist/ui-kit/shell/index.js +0 -7
- package/dist/ui-kit/shell/index.js.map +0 -1
- package/dist/ui-kit/shell/intent-prefetch.d.ts +0 -4
- package/dist/ui-kit/shell/intent-prefetch.d.ts.map +0 -1
- package/dist/ui-kit/shell/intent-prefetch.js +0 -62
- package/dist/ui-kit/shell/intent-prefetch.js.map +0 -1
- package/dist/ui-kit/shell/mobile-call-bar.d.ts +0 -25
- package/dist/ui-kit/shell/mobile-call-bar.d.ts.map +0 -1
- package/dist/ui-kit/shell/mobile-call-bar.js +0 -21
- package/dist/ui-kit/shell/mobile-call-bar.js.map +0 -1
- package/dist/ui-kit/shell/mobile-drawer.d.ts +0 -41
- package/dist/ui-kit/shell/mobile-drawer.d.ts.map +0 -1
- package/dist/ui-kit/shell/mobile-drawer.js +0 -41
- package/dist/ui-kit/shell/mobile-drawer.js.map +0 -1
- package/dist/ui-kit/shell/shell-context.d.ts +0 -3
- package/dist/ui-kit/shell/shell-context.d.ts.map +0 -1
- package/dist/ui-kit/shell/shell-context.js +0 -5
- package/dist/ui-kit/shell/shell-context.js.map +0 -1
- package/dist/ui-kit/shell/shell-quote.d.ts +0 -10
- package/dist/ui-kit/shell/shell-quote.d.ts.map +0 -1
- package/dist/ui-kit/shell/shell-quote.js +0 -13
- package/dist/ui-kit/shell/shell-quote.js.map +0 -1
- package/dist/ui-kit/shell/site-header.d.ts +0 -55
- package/dist/ui-kit/shell/site-header.d.ts.map +0 -1
- package/dist/ui-kit/shell/site-header.js +0 -35
- package/dist/ui-kit/shell/site-header.js.map +0 -1
- package/dist/ui-kit/shell/social-links.d.ts +0 -7
- package/dist/ui-kit/shell/social-links.d.ts.map +0 -1
- package/dist/ui-kit/shell/social-links.js +0 -12
- package/dist/ui-kit/shell/social-links.js.map +0 -1
- package/dist/ui-kit/shell/utility-bar.d.ts +0 -33
- package/dist/ui-kit/shell/utility-bar.d.ts.map +0 -1
- package/dist/ui-kit/shell/utility-bar.js +0 -15
- package/dist/ui-kit/shell/utility-bar.js.map +0 -1
- package/dist/ui-kit/skin-index.d.ts +0 -4
- package/dist/ui-kit/skin-index.d.ts.map +0 -1
- package/dist/ui-kit/skin-index.js +0 -3
- package/dist/ui-kit/skin-index.js.map +0 -1
- package/dist/ui-kit/skin.d.ts +0 -65
- package/dist/ui-kit/skin.d.ts.map +0 -1
- package/dist/ui-kit/skin.js +0 -60
- package/dist/ui-kit/skin.js.map +0 -1
- package/dist/ui-kit/structure.css +0 -2546
- package/dist/ui-kit/types.d.ts +0 -27
- package/dist/ui-kit/types.d.ts.map +0 -1
- package/dist/ui-kit/types.js +0 -6
- package/dist/ui-kit/types.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"current-link.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/shell/current-link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IACD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IAC5C,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAA;IACpH,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC7B,2CAQA"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
/**
|
|
4
|
-
* A menu link that marks itself `aria-current="page"` on its own page. A client leaf only because the root layout
|
|
5
|
-
* can't read the route: it receives one href and its server-rendered label, and renders in the server HTML with the
|
|
6
|
-
* right state. The current page is never prefetched (W2), so a link to it renders `prefetch={false}` whatever its role.
|
|
7
|
-
*/
|
|
8
|
-
import Link from 'next/link';
|
|
9
|
-
import { usePathname } from 'next/navigation';
|
|
10
|
-
import { isSamePageHref, linkPrefetchProps } from '../prefetch.js';
|
|
11
|
-
function normalisePath(path) {
|
|
12
|
-
const bare = path.split(/[?#]/, 1)[0] ?? '';
|
|
13
|
-
return bare.replace(/\/+$/, '') || '/';
|
|
14
|
-
}
|
|
15
|
-
/** True when `href` is the current page. External links are never current. */
|
|
16
|
-
export function isCurrentPage(pathname, href) {
|
|
17
|
-
if (!href.startsWith('/') || href.startsWith('//'))
|
|
18
|
-
return false;
|
|
19
|
-
return normalisePath(pathname) === normalisePath(href);
|
|
20
|
-
}
|
|
21
|
-
/** True when the page is one of `paths` or below it (the home path matches only itself). */
|
|
22
|
-
export function isCurrentSection(pathname, paths) {
|
|
23
|
-
const current = normalisePath(pathname);
|
|
24
|
-
return paths.some((path) => {
|
|
25
|
-
if (!path.startsWith('/') || path.startsWith('//'))
|
|
26
|
-
return false;
|
|
27
|
-
const section = normalisePath(path);
|
|
28
|
-
return current === section || (section !== '/' && current.startsWith(`${section}/`));
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
export function CurrentLink({ href, slot, hub = false, prefetch, className, children, }) {
|
|
32
|
-
const pathname = usePathname();
|
|
33
|
-
const current = isCurrentPage(pathname, href);
|
|
34
|
-
return (_jsx(Link, { href: href, ...(current ? { prefetch: false } : linkPrefetchProps(prefetch, href)), "data-slot": slot, "data-hub": hub ? 'true' : undefined, "aria-current": current ? 'page' : undefined, className: className, children: children }));
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* The header logo's home link. It never prefetches (3.15.0): the logo is in view on every page, so on landing it
|
|
38
|
-
* prefetched home from every page, and home itself on the home page. No `aria-current`: the logo is named by the
|
|
39
|
-
* brand, not as a menu item.
|
|
40
|
-
*/
|
|
41
|
-
export function LogoLink({ href, label, slot, className, children, }) {
|
|
42
|
-
return (_jsx(Link, { href: href, prefetch: false, "aria-label": label, "data-slot": slot, className: className, children: children }));
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* A shell action's link (the quote button in the header, drawer and call bar): its role's prefetch, except that it
|
|
46
|
-
* never prefetches the page it is on (`/contact#quote` on `/contact`) or a place on the same page. The anchor's
|
|
47
|
-
* hooks and content come from the server component that renders it.
|
|
48
|
-
*/
|
|
49
|
-
export function PageLink({ href, prefetch, hooks, children, }) {
|
|
50
|
-
const pathname = usePathname();
|
|
51
|
-
const current = isSamePageHref(href) || isCurrentPage(pathname, href);
|
|
52
|
-
return (_jsx(Link, { href: href, ...(current ? { prefetch: false } : linkPrefetchProps(prefetch)), ...hooks, children: children }));
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=current-link.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"current-link.js","sourceRoot":"","sources":["../../../src/ui-kit/shell/current-link.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ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AC,QAAQ,CAAC,CAAC,KAAM,KAAK,YACpG,QAAQ,GACJ,CACR,CAAA;AACH,CAAC","sourcesContent":["'use client'\n\n/**\n * A menu link that marks itself `aria-current=\"page\"` on its own page. A client leaf only because the root layout\n * can't read the route: it receives one href and its server-rendered label, and renders in the server HTML with the\n * right state. The current page is never prefetched (W2), so a link to it renders `prefetch={false}` whatever its role.\n */\nimport Link from 'next/link'\nimport { usePathname } from 'next/navigation'\nimport type { ReactNode } from 'react'\nimport { isSamePageHref, linkPrefetchProps, type LinkPrefetch } from '../prefetch.js'\n\nfunction normalisePath(path: string) {\n const bare = path.split(/[?#]/, 1)[0] ?? ''\n return bare.replace(/\\/+$/, '') || '/'\n}\n\n/** True when `href` is the current page. External links are never current. */\nexport function isCurrentPage(pathname: string, href: string) {\n if (!href.startsWith('/') || href.startsWith('//')) return false\n return normalisePath(pathname) === normalisePath(href)\n}\n\n/** True when the page is one of `paths` or below it (the home path matches only itself). */\nexport function isCurrentSection(pathname: string, paths: readonly string[]) {\n const current = normalisePath(pathname)\n return paths.some((path) => {\n if (!path.startsWith('/') || path.startsWith('//')) return false\n const section = normalisePath(path)\n return current === section || (section !== '/' && current.startsWith(`${section}/`))\n })\n}\n\nexport function CurrentLink({\n href,\n slot,\n hub = false,\n prefetch,\n className,\n children,\n}: {\n readonly href: string\n readonly slot: string\n readonly hub?: boolean\n /**\n * The link's prefetch role (`LINK_PREFETCH_POLICY`): `intent` for the top-level menu links, false for links in panels\n * and the drawer (hidden panels count as in view and would prefetch every menu page). The current page is never\n * prefetched, whatever this says.\n */\n readonly prefetch?: LinkPrefetch | undefined\n readonly className?: string | undefined\n readonly children: ReactNode\n}) {\n const pathname = usePathname()\n const current = isCurrentPage(pathname, href)\n return (\n <Link\n href={href}\n {...(current ? { prefetch: false as const } : linkPrefetchProps(prefetch, href))}\n data-slot={slot}\n data-hub={hub ? 'true' : undefined}\n aria-current={current ? 'page' : undefined}\n className={className}\n >\n {children}\n </Link>\n )\n}\n\n/**\n * The header logo's home link. It never prefetches (3.15.0): the logo is in view on every page, so on landing it\n * prefetched home from every page, and home itself on the home page. No `aria-current`: the logo is named by the\n * brand, not as a menu item.\n */\nexport function LogoLink({\n href,\n label,\n slot,\n className,\n children,\n}: {\n readonly href: string\n readonly label: string\n readonly slot: string\n readonly className?: string | undefined\n readonly children: ReactNode\n}) {\n return (\n <Link href={href} prefetch={false} aria-label={label} data-slot={slot} className={className}>\n {children}\n </Link>\n )\n}\n\n/**\n * A shell action's link (the quote button in the header, drawer and call bar): its role's prefetch, except that it\n * never prefetches the page it is on (`/contact#quote` on `/contact`) or a place on the same page. The anchor's\n * hooks and content come from the server component that renders it.\n */\nexport function PageLink({\n href,\n prefetch,\n hooks,\n children,\n}: {\n readonly href: string\n readonly prefetch?: LinkPrefetch | undefined\n readonly hooks: { readonly className?: string | undefined } & Readonly<Record<`data-${string}`, string | undefined>>\n readonly children: ReactNode\n}) {\n const pathname = usePathname()\n const current = isSamePageHref(href) || isCurrentPage(pathname, href)\n return (\n <Link href={href} {...(current ? { prefetch: false as const } : linkPrefetchProps(prefetch))} {...hooks}>\n {children}\n </Link>\n )\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
export interface DrawerControllerClasses {
|
|
3
|
-
readonly root?: string | undefined;
|
|
4
|
-
readonly menuButton?: string | undefined;
|
|
5
|
-
readonly menuLabel?: string | undefined;
|
|
6
|
-
readonly panel?: string | undefined;
|
|
7
|
-
readonly top?: string | undefined;
|
|
8
|
-
readonly close?: string | undefined;
|
|
9
|
-
readonly title?: string | undefined;
|
|
10
|
-
readonly logo?: string | undefined;
|
|
11
|
-
}
|
|
12
|
-
export declare function DrawerController({ id, variant, side, classes, logo, menuIcon, closeIcon, children, }: {
|
|
13
|
-
readonly id: string;
|
|
14
|
-
readonly variant: string;
|
|
15
|
-
readonly side: string;
|
|
16
|
-
readonly classes: DrawerControllerClasses;
|
|
17
|
-
readonly logo?: ReactNode;
|
|
18
|
-
readonly menuIcon: ReactNode;
|
|
19
|
-
readonly closeIcon: ReactNode;
|
|
20
|
-
readonly children: ReactNode;
|
|
21
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
//# sourceMappingURL=drawer-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drawer-client.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/shell/drawer-client.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAwD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAG5F,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACnC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,OAAO,EACP,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,uBAAuB,CAAA;IACzC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC7B,2CAkGA"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
/**
|
|
4
|
-
* The drawer's client leaf: the Menu button and the modal `<dialog>` (top layer, the page inert, focus kept inside).
|
|
5
|
-
* The menu, the actions and the social links are server-rendered children. The drawer closes on Escape, the close
|
|
6
|
-
* button, a tap on the backdrop, a link click, a route change and any change of the header's mode (crossing 1024 or
|
|
7
|
-
* 1200 px), so the page is never left inert. Groups are `<details name>` (one open at a time, no script needed); the
|
|
8
|
-
* toggle listener below keeps that rule in browsers without exclusive `<details>`.
|
|
9
|
-
*/
|
|
10
|
-
import { usePathname } from 'next/navigation';
|
|
11
|
-
import { useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
12
|
-
import { HeaderModeContext } from './shell-context.js';
|
|
13
|
-
export function DrawerController({ id, variant, side, classes, logo, menuIcon, closeIcon, children, }) {
|
|
14
|
-
const pathname = usePathname();
|
|
15
|
-
const mode = useContext(HeaderModeContext);
|
|
16
|
-
const dialogRef = useRef(null);
|
|
17
|
-
const buttonRef = useRef(null);
|
|
18
|
-
const closeRef = useRef(null);
|
|
19
|
-
const [open, setOpen] = useState(false);
|
|
20
|
-
const titleId = `${id}-title`;
|
|
21
|
-
const close = useCallback(() => {
|
|
22
|
-
const dialog = dialogRef.current;
|
|
23
|
-
if (dialog?.open)
|
|
24
|
-
dialog.close();
|
|
25
|
-
}, []);
|
|
26
|
-
const show = () => {
|
|
27
|
-
const dialog = dialogRef.current;
|
|
28
|
-
if (!dialog || dialog.open)
|
|
29
|
-
return;
|
|
30
|
-
for (const group of dialog.querySelectorAll('details[open]'))
|
|
31
|
-
group.open = false;
|
|
32
|
-
dialog.showModal();
|
|
33
|
-
// The close button comes first in focus order and takes focus when the drawer opens.
|
|
34
|
-
closeRef.current?.focus();
|
|
35
|
-
setOpen(true);
|
|
36
|
-
};
|
|
37
|
-
// A route change or a mode change (breakpoint crossing) resets the drawer.
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
close();
|
|
40
|
-
}, [pathname, mode, close]);
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
const dialog = dialogRef.current;
|
|
43
|
-
if (!dialog)
|
|
44
|
-
return;
|
|
45
|
-
const onToggle = (event) => {
|
|
46
|
-
const opened = event.target;
|
|
47
|
-
if (!(opened instanceof HTMLDetailsElement) || !opened.open)
|
|
48
|
-
return;
|
|
49
|
-
for (const other of dialog.querySelectorAll('details[open]'))
|
|
50
|
-
if (other !== opened)
|
|
51
|
-
other.open = false;
|
|
52
|
-
};
|
|
53
|
-
dialog.addEventListener('toggle', onToggle, true);
|
|
54
|
-
return () => dialog.removeEventListener('toggle', onToggle, true);
|
|
55
|
-
}, []);
|
|
56
|
-
return (_jsxs(_Fragment, { children: [_jsxs("button", { ref: buttonRef, type: "button", "data-slot": "menuButton", "aria-haspopup": "dialog", "aria-expanded": open, "aria-controls": id, className: classes.menuButton, onClick: show, children: [menuIcon, _jsx("span", { "data-slot": "menuLabel", className: classes.menuLabel, children: "Menu" })] }), _jsx("dialog", { ref: dialogRef, id: id, "data-bl": "drawer", "data-variant": variant, "data-side": side, "aria-labelledby": titleId, className: classes.root, ...{ closedby: 'any' }, onClose: () => {
|
|
57
|
-
setOpen(false);
|
|
58
|
-
// Safari doesn't focus a clicked button, so the dialog may have nothing to return focus to.
|
|
59
|
-
const active = document.activeElement;
|
|
60
|
-
if (!active || active === document.body || dialogRef.current?.contains(active))
|
|
61
|
-
buttonRef.current?.focus();
|
|
62
|
-
}, onClick: (event) => {
|
|
63
|
-
// A tap on the backdrop (where closedby="any" isn't supported yet) or on any link closes the drawer.
|
|
64
|
-
if (event.target === dialogRef.current)
|
|
65
|
-
close();
|
|
66
|
-
else if (event.target.closest('a[href]'))
|
|
67
|
-
close();
|
|
68
|
-
}, children: _jsxs("div", { "data-slot": "panel", className: classes.panel, children: [_jsxs("div", { "data-slot": "top", className: classes.top, children: [_jsx("button", { ref: closeRef, type: "button", "data-slot": "close", "aria-label": "Close menu", className: classes.close, onClick: close, children: closeIcon }), _jsx("p", { id: titleId, "data-slot": "title", className: classes.title, children: "Menu" }), logo ? (_jsx("span", { "data-slot": "logo", "aria-hidden": "true", className: classes.logo, children: logo })) : null] }), children] }) })] }));
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=drawer-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drawer-client.js","sourceRoot":"","sources":["../../../src/ui-kit/shell/drawer-client.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;GAMG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAatD,MAAM,UAAU,gBAAgB,CAAC,EAC/B,EAAE,EACF,OAAO,EACP,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,QAAQ,GAUT;IACC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,MAAM,IAAI,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC1C,MAAM,SAAS,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAA;IACjD,MAAM,SAAS,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAA;IACjD,MAAM,QAAQ,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAA;IAChD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,C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E,CAAA;gBAChE,CAAC,YAED,4BAAe,OAAO,EAAC,SAAS,EAAE,OAAO,CAAC,KAAK,aAC7C,4BAAe,KAAK,EAAC,SAAS,EAAE,OAAO,CAAC,GAAG,aACzC,iBAAQ,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAC,QAAQ,eAAW,OAAO,gBAAY,YAAY,EAAC,SAAS,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,YACpH,SAAS,GACH,EACT,YAAG,EAAE,EAAE,OAAO,eAAY,OAAO,EAAC,SAAS,EAAE,OAAO,CAAC,KAAK,qBAEtD,EACH,IAAI,CAAC,CAAC,CAAC,CACN,4BAAgB,MAAM,iBAAa,MAAM,EAAC,SAAS,EAAE,OAAO,CAAC,IAAI,YAC9D,IAAI,GACA,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,QAAQ,IACL,GACC,IACR,CACJ,CAAA;AACH,CAAC","sourcesContent":["'use client'\n\n/**\n * The drawer's client leaf: the Menu button and the modal `<dialog>` (top layer, the page inert, focus kept inside).\n * The menu, the actions and the social links are server-rendered children. The drawer closes on Escape, the close\n * button, a tap on the backdrop, a link click, a route change and any change of the header's mode (crossing 1024 or\n * 1200 px), so the page is never left inert. Groups are `<details name>` (one open at a time, no script needed); the\n * toggle listener below keeps that rule in browsers without exclusive `<details>`.\n */\nimport { usePathname } from 'next/navigation'\nimport { useCallback, useContext, useEffect, useRef, useState, type ReactNode } from 'react'\nimport { HeaderModeContext } from './shell-context.js'\n\nexport interface DrawerControllerClasses {\n readonly root?: string | undefined\n readonly menuButton?: string | undefined\n readonly menuLabel?: string | undefined\n readonly panel?: string | undefined\n readonly top?: string | undefined\n readonly close?: string | undefined\n readonly title?: string | undefined\n readonly logo?: string | undefined\n}\n\nexport function DrawerController({\n id,\n variant,\n side,\n classes,\n logo,\n menuIcon,\n closeIcon,\n children,\n}: {\n readonly id: string\n readonly variant: string\n readonly side: string\n readonly classes: DrawerControllerClasses\n readonly logo?: ReactNode\n readonly menuIcon: ReactNode\n readonly closeIcon: ReactNode\n readonly children: ReactNode\n}) {\n const pathname = usePathname()\n const mode = useContext(HeaderModeContext)\n const dialogRef = useRef<HTMLDialogElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const closeRef = useRef<HTMLButtonElement>(null)\n const [open, setOpen] = useState(false)\n const titleId = `${id}-title`\n\n const close = useCallback(() => {\n const dialog = dialogRef.current\n if (dialog?.open) dialog.close()\n }, [])\n\n const show = () => {\n const dialog = dialogRef.current\n if (!dialog || dialog.open) return\n for (const group of dialog.querySelectorAll<HTMLDetailsElement>('details[open]')) group.open = false\n dialog.showModal()\n // The close button comes first in focus order and takes focus when the drawer opens.\n closeRef.current?.focus()\n setOpen(true)\n }\n\n // A route change or a mode change (breakpoint crossing) resets the drawer.\n useEffect(() => {\n close()\n }, [pathname, mode, close])\n\n useEffect(() => {\n const dialog = dialogRef.current\n if (!dialog) return\n const onToggle = (event: Event) => {\n const opened = event.target\n if (!(opened instanceof HTMLDetailsElement) || !opened.open) return\n for (const other of dialog.querySelectorAll<HTMLDetailsElement>('details[open]')) if (other !== opened) other.open = false\n }\n dialog.addEventListener('toggle', onToggle, true)\n return () => dialog.removeEventListener('toggle', onToggle, true)\n }, [])\n\n return (\n <>\n <button\n ref={buttonRef}\n type=\"button\"\n data-slot=\"menuButton\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-controls={id}\n className={classes.menuButton}\n onClick={show}\n >\n {menuIcon}\n <span data-slot=\"menuLabel\" className={classes.menuLabel}>\n Menu\n </span>\n </button>\n <dialog\n ref={dialogRef}\n id={id}\n data-bl=\"drawer\"\n data-variant={variant}\n data-side={side}\n aria-labelledby={titleId}\n className={classes.root}\n {...({ closedby: 'any' } as Record<string, string>)}\n onClose={() => {\n setOpen(false)\n // Safari doesn't focus a clicked button, so the dialog may have nothing to return focus to.\n const active = document.activeElement\n if (!active || active === document.body || dialogRef.current?.contains(active)) buttonRef.current?.focus()\n }}\n onClick={(event) => {\n // A tap on the backdrop (where closedby=\"any\" isn't supported yet) or on any link closes the drawer.\n if (event.target === dialogRef.current) close()\n else if ((event.target as Element).closest('a[href]')) close()\n }}\n >\n <div data-slot=\"panel\" className={classes.panel}>\n <div data-slot=\"top\" className={classes.top}>\n <button ref={closeRef} type=\"button\" data-slot=\"close\" aria-label=\"Close menu\" className={classes.close} onClick={close}>\n {closeIcon}\n </button>\n <p id={titleId} data-slot=\"title\" className={classes.title}>\n Menu\n </p>\n {logo ? (\n <span data-slot=\"logo\" aria-hidden=\"true\" className={classes.logo}>\n {logo}\n </span>\n ) : null}\n </div>\n {children}\n </div>\n </dialog>\n </>\n )\n}\n"]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
/** The `<header>` root: measures the header (mode, height, compact) and shares its mode. */
|
|
3
|
-
export declare function HeaderRoot({ variant, navAlign, compactAfterScroll, className, children, }: {
|
|
4
|
-
readonly variant: string;
|
|
5
|
-
readonly navAlign: string;
|
|
6
|
-
readonly compactAfterScroll: boolean;
|
|
7
|
-
readonly className?: string | undefined;
|
|
8
|
-
readonly children: ReactNode;
|
|
9
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
/** The `<nav>` landmark and the menu state (F3 engine) for the items inside it. */
|
|
11
|
-
export declare function NavController({ label, className, children }: {
|
|
12
|
-
readonly label: string;
|
|
13
|
-
readonly className?: string | undefined;
|
|
14
|
-
readonly children: ReactNode;
|
|
15
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
/**
|
|
17
|
-
* One top-level item. `data-current` marks the current section: the page is the item's hub or one of its active
|
|
18
|
-
* paths (or below them), or one of its panel links is the current page.
|
|
19
|
-
*/
|
|
20
|
-
export declare function NavItem({ menuId, paths, className, children, }: {
|
|
21
|
-
/** Set for an item with a panel. */
|
|
22
|
-
readonly menuId?: string;
|
|
23
|
-
readonly paths: readonly string[];
|
|
24
|
-
readonly className?: string | undefined;
|
|
25
|
-
readonly children: ReactNode;
|
|
26
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
/** The disclosure button beside an item's hub link, named "{label} menu". */
|
|
28
|
-
export declare function NavTrigger({ menuId, panelId, label, className, children, }: {
|
|
29
|
-
readonly menuId: string;
|
|
30
|
-
readonly panelId: string;
|
|
31
|
-
readonly label: string;
|
|
32
|
-
readonly className?: string | undefined;
|
|
33
|
-
readonly children: ReactNode;
|
|
34
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
/** The panel box. Its links are the server-rendered children; the panel only changes state. */
|
|
36
|
-
export declare function NavPanel({ menuId, panelId, variant, columns, className, children, }: {
|
|
37
|
-
readonly menuId: string;
|
|
38
|
-
readonly panelId: string;
|
|
39
|
-
readonly variant: string;
|
|
40
|
-
readonly columns?: number | undefined;
|
|
41
|
-
readonly className?: string | undefined;
|
|
42
|
-
readonly children: ReactNode;
|
|
43
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
44
|
-
//# sourceMappingURL=header-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"header-client.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/shell/header-client.tsx"],"names":[],"mappings":"AASA,OAAO,EAA0D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAM9F,4FAA4F;AAC5F,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAA;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC7B,2CAQA;AASD,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,EAAE,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AS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC7B,2CAkBA"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
/**
|
|
4
|
-
* The header's client leaves. They receive ids, labels, flags and class strings only; every link and panel is
|
|
5
|
-
* server-rendered and passed in as `children`. The leaves toggle `data-state`, `aria-expanded` and `inert` on those
|
|
6
|
-
* server nodes, so opening a panel never re-renders its links. `inert` is added only after hydration: closed panels
|
|
7
|
-
* are `visibility: hidden` in the server HTML, and inert content would break the pre-hydration hover fallback.
|
|
8
|
-
*/
|
|
9
|
-
import { usePathname } from 'next/navigation';
|
|
10
|
-
import { createContext, useContext, useEffect, useRef, useState } from 'react';
|
|
11
|
-
import { useHeaderMetrics } from '../../navigation/use-header-metrics.js';
|
|
12
|
-
import { useNavigationMenu } from '../../navigation/use-navigation-menu.js';
|
|
13
|
-
import { isCurrentSection } from './current-link.js';
|
|
14
|
-
import { HeaderModeContext } from './shell-context.js';
|
|
15
|
-
/** The `<header>` root: measures the header (mode, height, compact) and shares its mode. */
|
|
16
|
-
export function HeaderRoot({ variant, navAlign, compactAfterScroll, className, children, }) {
|
|
17
|
-
const ref = useRef(null);
|
|
18
|
-
const { mode } = useHeaderMetrics(ref, { compactAfterScroll });
|
|
19
|
-
return (_jsx("header", { ref: ref, "data-bl": "header", "data-variant": variant, "data-nav-align": navAlign, className: className, children: _jsx(HeaderModeContext, { value: mode, children: children }) }));
|
|
20
|
-
}
|
|
21
|
-
const NavContext = createContext(null);
|
|
22
|
-
/** The `<nav>` landmark and the menu state (F3 engine) for the items inside it. */
|
|
23
|
-
export function NavController({ label, className, children }) {
|
|
24
|
-
const navRef = useRef(null);
|
|
25
|
-
const pathname = usePathname();
|
|
26
|
-
const mode = useContext(HeaderModeContext);
|
|
27
|
-
const menu = useNavigationMenu(navRef, `${pathname}|${mode}`);
|
|
28
|
-
const [hydrated, setHydrated] = useState(false);
|
|
29
|
-
useEffect(() => setHydrated(true), []);
|
|
30
|
-
return (_jsx("nav", { ref: navRef, "aria-label": label, "data-slot": "nav", className: className, children: _jsx(NavContext, { value: { menu, hydrated }, children: children }) }));
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* One top-level item. `data-current` marks the current section: the page is the item's hub or one of its active
|
|
34
|
-
* paths (or below them), or one of its panel links is the current page.
|
|
35
|
-
*/
|
|
36
|
-
export function NavItem({ menuId, paths, className, children, }) {
|
|
37
|
-
const ref = useRef(null);
|
|
38
|
-
const pathname = usePathname();
|
|
39
|
-
const nav = useContext(NavContext);
|
|
40
|
-
const [panelLinkCurrent, setPanelLinkCurrent] = useState(false);
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
setPanelLinkCurrent(ref.current?.querySelector('[data-slot="panel"] [aria-current="page"]') != null);
|
|
43
|
-
}, [pathname]);
|
|
44
|
-
const current = panelLinkCurrent || isCurrentSection(pathname, paths);
|
|
45
|
-
const open = menuId !== undefined && nav?.menu.openId === menuId;
|
|
46
|
-
return (_jsx("li", { ref: ref, "data-slot": "item", "data-has-panel": menuId !== undefined ? 'true' : undefined, "data-state": menuId !== undefined ? (open ? 'open' : 'closed') : undefined, "data-current": current ? 'true' : undefined, className: className, ...(menuId !== undefined && nav ? nav.menu.itemHandlers(menuId) : {}), children: children }));
|
|
47
|
-
}
|
|
48
|
-
/** The disclosure button beside an item's hub link, named "{label} menu". */
|
|
49
|
-
export function NavTrigger({ menuId, panelId, label, className, children, }) {
|
|
50
|
-
const nav = useContext(NavContext);
|
|
51
|
-
return (_jsx("button", { type: "button", "data-slot": "trigger", "data-menu-id": menuId, "aria-expanded": nav?.menu.openId === menuId, "aria-controls": panelId, "aria-label": `${label} menu`, className: className, ...nav?.menu.triggerHandlers(menuId), children: children }));
|
|
52
|
-
}
|
|
53
|
-
/** The panel box. Its links are the server-rendered children; the panel only changes state. */
|
|
54
|
-
export function NavPanel({ menuId, panelId, variant, columns, className, children, }) {
|
|
55
|
-
const nav = useContext(NavContext);
|
|
56
|
-
const open = nav?.menu.openId === menuId;
|
|
57
|
-
return (_jsx("div", { id: panelId, "data-slot": "panel", "data-menu-id": menuId, "data-variant": variant, "data-columns": columns, "data-state": open ? 'open' : 'closed', inert: Boolean(nav?.hydrated) && !open, className: className, ...nav?.menu.panelHandlers(menuId), children: children }));
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=header-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"header-client.js","sourceRoot":"","sources":["../../../src/ui-kit/shell/header-client.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAAE,iBAAiB,EAAuB,MAAM,yCAAyC,CAAA;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEtD,4FAA4F;AAC5F,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,EACP,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,QAAQ,GAOT;IACC,MAAM,GAAG,GAAG,MAAM,CAAc,IAAI,CAAC,CAAA;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,GAAG,EAAE,EAAE,kBAAkB,EAAE,CAAC,CAAA;IAC9D,OAAO,CACL,iBAAQ,GAAG,EAAE,GAAG,aAAU,QAAQ,kBAAe,OAAO,oBAAkB,QAAQ,EAAE,SAAS,EAAE,SAAS,YACtG,KAAC,iBAAiB,IA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CAAA;AACH,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,QAAQ,CAAC,EACvB,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,GAQT;IACC,MAAM,GAAG,GAAG,UAAU,CAAC,UAAU,CAAC,CAAA;IAClC,MAAM,IAAI,GAAG,GAAG,EAAE,IAAI,CAAC,MAAM,KAAK,MAAM,CAAA;IACxC,OAAO,CACL,cACE,EAAE,EAAE,OAAO,eACD,OAAO,kBACH,MAAM,kBACN,OAAO,kBACP,OAAO,gBACT,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EACpC,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,EACtC,SAAS,EAAE,SAAS,KAChB,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,YAElC,QAAQ,GACL,CACP,CAAA;AACH,CAAC","sourcesContent":["'use client'\n\n/**\n * The header's client leaves. They receive ids, labels, flags and class strings only; every link and panel is\n * server-rendered and passed in as `children`. The leaves toggle `data-state`, `aria-expanded` and `inert` on those\n * server nodes, so opening a panel never re-renders its links. `inert` is added only after hydration: closed panels\n * are `visibility: hidden` in the server HTML, and inert content would break the pre-hydration hover fallback.\n */\nimport { usePathname } from 'next/navigation'\nimport { createContext, useContext, useEffect, useRef, useState, type ReactNode } from 'react'\nimport { useHeaderMetrics } from '../../navigation/use-header-metrics.js'\nimport { useNavigationMenu, type NavigationMenu } from '../../navigation/use-navigation-menu.js'\nimport { isCurrentSection } from './current-link.js'\nimport { HeaderModeContext } from './shell-context.js'\n\n/** The `<header>` root: measures the header (mode, height, compact) and shares its mode. */\nexport function HeaderRoot({\n variant,\n navAlign,\n compactAfterScroll,\n className,\n children,\n}: {\n readonly variant: string\n readonly navAlign: string\n readonly compactAfterScroll: boolean\n readonly className?: string | undefined\n readonly children: ReactNode\n}) {\n const ref = useRef<HTMLElement>(null)\n const { mode } = useHeaderMetrics(ref, { compactAfterScroll })\n return (\n <header ref={ref} data-bl=\"header\" data-variant={variant} data-nav-align={navAlign} className={className}>\n <HeaderModeContext value={mode}>{children}</HeaderModeContext>\n </header>\n )\n}\n\ninterface NavState {\n readonly menu: NavigationMenu\n readonly hydrated: boolean\n}\n\nconst NavContext = createContext<NavState | null>(null)\n\n/** The `<nav>` landmark and the menu state (F3 engine) for the items inside it. */\nexport function NavController({ label, className, children }: { readonly label: string; readonly className?: string | undefined; readonly children: ReactNode }) {\n const navRef = useRef<HTMLElement>(null)\n const pathname = usePathname()\n const mode = useContext(HeaderModeContext)\n const menu = useNavigationMenu(navRef, `${pathname}|${mode}`)\n const [hydrated, setHydrated] = useState(false)\n useEffect(() => setHydrated(true), [])\n return (\n <nav ref={navRef} aria-label={label} data-slot=\"nav\" className={className}>\n <NavContext value={{ menu, hydrated }}>{children}</NavContext>\n </nav>\n )\n}\n\n/**\n * One top-level item. `data-current` marks the current section: the page is the item's hub or one of its active\n * paths (or below them), or one of its panel links is the current page.\n */\nexport function NavItem({\n menuId,\n paths,\n className,\n children,\n}: {\n /** Set for an item with a panel. */\n readonly menuId?: string\n readonly paths: readonly string[]\n readonly className?: string | undefined\n readonly children: ReactNode\n}) {\n const ref = useRef<HTMLLIElement>(null)\n const pathname = usePathname()\n const nav = useContext(NavContext)\n const [panelLinkCurrent, setPanelLinkCurrent] = useState(false)\n useEffect(() => {\n setPanelLinkCurrent(ref.current?.querySelector('[data-slot=\"panel\"] [aria-current=\"page\"]') != null)\n }, [pathname])\n const current = panelLinkCurrent || isCurrentSection(pathname, paths)\n const open = menuId !== undefined && nav?.menu.openId === menuId\n return (\n <li\n ref={ref}\n data-slot=\"item\"\n data-has-panel={menuId !== undefined ? 'true' : undefined}\n data-state={menuId !== undefined ? (open ? 'open' : 'closed') : undefined}\n data-current={current ? 'true' : undefined}\n className={className}\n {...(menuId !== undefined && nav ? nav.menu.itemHandlers(menuId) : {})}\n >\n {children}\n </li>\n )\n}\n\n/** The disclosure button beside an item's hub link, named \"{label} menu\". */\nexport function NavTrigger({\n menuId,\n panelId,\n label,\n className,\n children,\n}: {\n readonly menuId: string\n readonly panelId: string\n readonly label: string\n readonly className?: string | undefined\n readonly children: ReactNode\n}) {\n const nav = useContext(NavContext)\n return (\n <button\n type=\"button\"\n data-slot=\"trigger\"\n data-menu-id={menuId}\n aria-expanded={nav?.menu.openId === menuId}\n aria-controls={panelId}\n aria-label={`${label} menu`}\n className={className}\n {...nav?.menu.triggerHandlers(menuId)}\n >\n {children}\n </button>\n )\n}\n\n/** The panel box. Its links are the server-rendered children; the panel only changes state. */\nexport function NavPanel({\n menuId,\n panelId,\n variant,\n columns,\n className,\n children,\n}: {\n readonly menuId: string\n readonly panelId: string\n readonly variant: string\n readonly columns?: number | undefined\n readonly className?: string | undefined\n readonly children: ReactNode\n}) {\n const nav = useContext(NavContext)\n const open = nav?.menu.openId === menuId\n return (\n <div\n id={panelId}\n data-slot=\"panel\"\n data-menu-id={menuId}\n data-variant={variant}\n data-columns={columns}\n data-state={open ? 'open' : 'closed'}\n inert={Boolean(nav?.hydrated) && !open}\n className={className}\n {...nav?.menu.panelHandlers(menuId)}\n >\n {children}\n </div>\n )\n}\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { SITE_HEADER_VARIANTS, SiteHeader, type SiteHeaderLayout, type SiteHeaderProps, type SiteHeaderSkin, type SiteHeaderSlot, type SiteHeaderVariant, } from './site-header.js';
|
|
2
|
-
export { MOBILE_DRAWER_VARIANTS, MobileDrawer, type MobileDrawerLayout, type MobileDrawerProps, type MobileDrawerSkin, type MobileDrawerSlot, type MobileDrawerVariant, type ShellQuote, } from './mobile-drawer.js';
|
|
3
|
-
export { UtilityBar, type UtilityBarLayout, type UtilityBarProps, type UtilityBarSkin, type UtilityBarSlot, type UtilityLicence, type UtilityRating, } from './utility-bar.js';
|
|
4
|
-
export { MOBILE_CALL_BAR_VARIANTS, MobileCallBar, type MobileCallBarProps, type MobileCallBarSkin, type MobileCallBarSlot, type MobileCallBarVariant, } from './mobile-call-bar.js';
|
|
5
|
-
export { BACK_TO_TOP_OFFSETS, BackToTop, type BackToTopLayout, type BackToTopProps, type BackToTopSkin, type BackToTopSlot } from './back-to-top.js';
|
|
6
|
-
export { IntentPrefetch, intentPrefetchTarget } from './intent-prefetch.js';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/shell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,UAAU,GAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACpJ,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { SITE_HEADER_VARIANTS, SiteHeader, } from './site-header.js';
|
|
2
|
-
export { MOBILE_DRAWER_VARIANTS, MobileDrawer, } from './mobile-drawer.js';
|
|
3
|
-
export { UtilityBar, } from './utility-bar.js';
|
|
4
|
-
export { MOBILE_CALL_BAR_VARIANTS, MobileCallBar, } from './mobile-call-bar.js';
|
|
5
|
-
export { BACK_TO_TOP_OFFSETS, BackToTop } from './back-to-top.js';
|
|
6
|
-
export { IntentPrefetch, intentPrefetchTarget } from './intent-prefetch.js';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui-kit/shell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,UAAU,GAMX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,sBAAsB,EACtB,YAAY,GAOb,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,UAAU,GAOX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,wBAAwB,EACxB,aAAa,GAKd,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAqF,MAAM,kBAAkB,CAAA;AACpJ,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA","sourcesContent":["export {\n SITE_HEADER_VARIANTS,\n SiteHeader,\n type SiteHeaderLayout,\n type SiteHeaderProps,\n type SiteHeaderSkin,\n type SiteHeaderSlot,\n type SiteHeaderVariant,\n} from './site-header.js'\nexport {\n MOBILE_DRAWER_VARIANTS,\n MobileDrawer,\n type MobileDrawerLayout,\n type MobileDrawerProps,\n type MobileDrawerSkin,\n type MobileDrawerSlot,\n type MobileDrawerVariant,\n type ShellQuote,\n} from './mobile-drawer.js'\nexport {\n UtilityBar,\n type UtilityBarLayout,\n type UtilityBarProps,\n type UtilityBarSkin,\n type UtilityBarSlot,\n type UtilityLicence,\n type UtilityRating,\n} from './utility-bar.js'\nexport {\n MOBILE_CALL_BAR_VARIANTS,\n MobileCallBar,\n type MobileCallBarProps,\n type MobileCallBarSkin,\n type MobileCallBarSlot,\n type MobileCallBarVariant,\n} from './mobile-call-bar.js'\nexport { BACK_TO_TOP_OFFSETS, BackToTop, type BackToTopLayout, type BackToTopProps, type BackToTopSkin, type BackToTopSlot } from './back-to-top.js'\nexport { IntentPrefetch, intentPrefetchTarget } from './intent-prefetch.js'\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** The site path an intent link points to, without its fragment; null for another site or no href. */
|
|
2
|
-
export declare function intentPrefetchTarget(href: string | null): string | null;
|
|
3
|
-
export declare function IntentPrefetch(): null;
|
|
4
|
-
//# sourceMappingURL=intent-prefetch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent-prefetch.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/shell/intent-prefetch.tsx"],"names":[],"mappings":"AA6BA,sGAAsG;AACtG,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAIvE;AAOD,wBAAgB,cAAc,IAAI,IAAI,CAsBrC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
/**
|
|
3
|
-
* `IntentPrefetch`: prefetches a top-level header link (from 3.15.0) or an in-content card link when a visitor shows
|
|
4
|
-
* intent, not when it scrolls into view. Links with `prefetch="intent"` (ButtonLink, TextLink, QuoteButton and the
|
|
5
|
-
* SiteHeader's top-level links) render `prefetch={false}` and
|
|
6
|
-
* `data-prefetch="intent"`; this island holds one document listener for pointer entry, focus and touch, and calls
|
|
7
|
-
* `router.prefetch(href)` for the one link the visitor points at, focuses or touches, once per page address. A touch
|
|
8
|
-
* prefetches only the touched link, never the list around it; the current page and links to other sites are never
|
|
9
|
-
* prefetched.
|
|
10
|
-
*
|
|
11
|
-
* Mount it once, in the root layout, beside the header:
|
|
12
|
-
*
|
|
13
|
-
* // src/app/layout.tsx
|
|
14
|
-
* import { IntentPrefetch } from '@brandlab-digital/site-next/ui-kit/shell'
|
|
15
|
-
* <body>
|
|
16
|
-
* <SiteHeader … />
|
|
17
|
-
* <IntentPrefetch />
|
|
18
|
-
* …
|
|
19
|
-
* </body>
|
|
20
|
-
*
|
|
21
|
-
* It renders nothing; without scripts the links still work and simply do not prefetch.
|
|
22
|
-
*/
|
|
23
|
-
import { useRouter } from 'next/navigation';
|
|
24
|
-
import { useEffect } from 'react';
|
|
25
|
-
import { INTENT_PREFETCH_SELECTOR } from '../prefetch.js';
|
|
26
|
-
const INTENT_EVENTS = ['pointerenter', 'focusin', 'touchstart'];
|
|
27
|
-
/** The site path an intent link points to, without its fragment; null for another site or no href. */
|
|
28
|
-
export function intentPrefetchTarget(href) {
|
|
29
|
-
if (!href || !href.startsWith('/') || href.startsWith('//'))
|
|
30
|
-
return null;
|
|
31
|
-
const target = href.split('#', 1)[0] ?? '';
|
|
32
|
-
return target || null;
|
|
33
|
-
}
|
|
34
|
-
function samePage(target, location) {
|
|
35
|
-
const path = (value) => value.replace(/\/+$/, '') || '/';
|
|
36
|
-
return path(target.split('?', 1)[0] ?? '') === path(location.pathname);
|
|
37
|
-
}
|
|
38
|
-
export function IntentPrefetch() {
|
|
39
|
-
const router = useRouter();
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
const prefetched = new Set();
|
|
42
|
-
const onIntent = (event) => {
|
|
43
|
-
const element = event.target instanceof Element ? event.target : null;
|
|
44
|
-
const link = element?.closest(INTENT_PREFETCH_SELECTOR);
|
|
45
|
-
const target = intentPrefetchTarget(link?.getAttribute('href') ?? null);
|
|
46
|
-
if (!target || prefetched.has(target) || samePage(target, window.location))
|
|
47
|
-
return;
|
|
48
|
-
prefetched.add(target);
|
|
49
|
-
router.prefetch(target);
|
|
50
|
-
};
|
|
51
|
-
// Capture, so pointerenter (which does not bubble) reaches the document; passive, so touch never waits on it.
|
|
52
|
-
const options = { capture: true, passive: true };
|
|
53
|
-
for (const type of INTENT_EVENTS)
|
|
54
|
-
document.addEventListener(type, onIntent, options);
|
|
55
|
-
return () => {
|
|
56
|
-
for (const type of INTENT_EVENTS)
|
|
57
|
-
document.removeEventListener(type, onIntent, options);
|
|
58
|
-
};
|
|
59
|
-
}, [router]);
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=intent-prefetch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent-prefetch.js","sourceRoot":"","sources":["../../../src/ui-kit/shell/intent-prefetch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAEzD,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,SAAS,EAAE,YAAY,CAAU,CAAA;AAExE,sGAAsG;AACtG,MAAM,UAAU,oBAAoB,CAAC,IAAmB;IACtD,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IACxE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IAC1C,OAAO,MAAM,IAAI,IAAI,CAAA;AACvB,CAAC;AAED,SAAS,QAAQ,CAAC,MAAc,EAAE,QAAkB;IAClD,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,CAAA;IAChE,OA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AO,CAAC,CAAA;QACzF,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;IAEZ,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["'use client'\n\n/**\n * `IntentPrefetch`: prefetches a top-level header link (from 3.15.0) or an in-content card link when a visitor shows\n * intent, not when it scrolls into view. Links with `prefetch=\"intent\"` (ButtonLink, TextLink, QuoteButton and the\n * SiteHeader's top-level links) render `prefetch={false}` and\n * `data-prefetch=\"intent\"`; this island holds one document listener for pointer entry, focus and touch, and calls\n * `router.prefetch(href)` for the one link the visitor points at, focuses or touches, once per page address. A touch\n * prefetches only the touched link, never the list around it; the current page and links to other sites are never\n * prefetched.\n *\n * Mount it once, in the root layout, beside the header:\n *\n * // src/app/layout.tsx\n * import { IntentPrefetch } from '@brandlab-digital/site-next/ui-kit/shell'\n * <body>\n * <SiteHeader … />\n * <IntentPrefetch />\n * …\n * </body>\n *\n * It renders nothing; without scripts the links still work and simply do not prefetch.\n */\nimport { useRouter } from 'next/navigation'\nimport { useEffect } from 'react'\nimport { INTENT_PREFETCH_SELECTOR } from '../prefetch.js'\n\nconst INTENT_EVENTS = ['pointerenter', 'focusin', 'touchstart'] as const\n\n/** The site path an intent link points to, without its fragment; null for another site or no href. */\nexport function intentPrefetchTarget(href: string | null): string | null {\n if (!href || !href.startsWith('/') || href.startsWith('//')) return null\n const target = href.split('#', 1)[0] ?? ''\n return target || null\n}\n\nfunction samePage(target: string, location: Location) {\n const path = (value: string) => value.replace(/\\/+$/, '') || '/'\n return path(target.split('?', 1)[0] ?? '') === path(location.pathname)\n}\n\nexport function IntentPrefetch(): null {\n const router = useRouter()\n\n useEffect(() => {\n const prefetched = new Set<string>()\n const onIntent = (event: Event) => {\n const element = event.target instanceof Element ? event.target : null\n const link = element?.closest<HTMLAnchorElement>(INTENT_PREFETCH_SELECTOR)\n const target = intentPrefetchTarget(link?.getAttribute('href') ?? null)\n if (!target || prefetched.has(target) || samePage(target, window.location)) return\n prefetched.add(target)\n router.prefetch(target)\n }\n // Capture, so pointerenter (which does not bubble) reaches the document; passive, so touch never waits on it.\n const options: AddEventListenerOptions = { capture: true, passive: true }\n for (const type of INTENT_EVENTS) document.addEventListener(type, onIntent, options)\n return () => {\n for (const type of INTENT_EVENTS) document.removeEventListener(type, onIntent, options)\n }\n }, [router])\n\n return null\n}\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { SkinEntry } from '../skin.js';
|
|
2
|
-
import type { UiPhone } from '../types.js';
|
|
3
|
-
import type { ShellQuote } from './mobile-drawer.js';
|
|
4
|
-
export type MobileCallBarSlot = 'root' | 'call' | 'quote';
|
|
5
|
-
export declare const MOBILE_CALL_BAR_VARIANTS: readonly ["bar", "float"];
|
|
6
|
-
/** `bar`: full width; `float`: two pills at the end. */
|
|
7
|
-
export type MobileCallBarVariant = (typeof MOBILE_CALL_BAR_VARIANTS)[number];
|
|
8
|
-
export interface MobileCallBarLayout {
|
|
9
|
-
/** `after-call-path` (the default): once the hero's buttons scroll out; `always`: from the first phone screen. */
|
|
10
|
-
readonly show?: 'after-call-path' | 'always';
|
|
11
|
-
}
|
|
12
|
-
export type MobileCallBarSkin = SkinEntry<MobileCallBarSlot, MobileCallBarVariant, MobileCallBarLayout>;
|
|
13
|
-
export interface MobileCallBarProps extends MobileCallBarSkin {
|
|
14
|
-
readonly phone: UiPhone;
|
|
15
|
-
/** Words before the number, for example "Call". The button's name always includes the number. */
|
|
16
|
-
readonly phoneLabel?: string | undefined;
|
|
17
|
-
readonly quote: ShellQuote;
|
|
18
|
-
/**
|
|
19
|
-
* A shorter quote label for phones narrower than 420 px, for example "Free quote" for "Get a Free Quote". It must be
|
|
20
|
-
* part of the quote label; the button's text and name stay the full label.
|
|
21
|
-
*/
|
|
22
|
-
readonly compactLabel?: string | undefined;
|
|
23
|
-
}
|
|
24
|
-
export declare function MobileCallBar({ phone, phoneLabel, quote, compactLabel, variant, layout, classes }: MobileCallBarProps): import("react/jsx-run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|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* F6: the phone call bar (server component). Call and quote always one tap away below 1024 px: it shows once the
|
|
4
|
-
* hero's own call and quote buttons (`data-bl-call-path`) have scrolled out, and hides over the footer, the drawer, a
|
|
5
|
-
* dialog, any call path and while a form field has focus. Call reports placement `fab`; the quote button sends
|
|
6
|
-
* `lead_cta_click` with placement `floating`. Render it once, after the page's `<main>`.
|
|
7
|
-
*
|
|
8
|
-
* Both buttons stay on one line down to 360 px (3.15.0): the number never wraps or truncates; below 420 px the verb
|
|
9
|
-
* ("Call") is visually hidden (the link's name keeps it) and the quote button shows `compactLabel` when given.
|
|
10
|
-
*
|
|
11
|
-
* `layout.show: 'always'` (3.16.0, as AA's live site): the bar shows from the first phone screen, beside the hero's
|
|
12
|
-
* buttons, still Call before Quote (K6), and still hides over the footer, a dialog and a focused field.
|
|
13
|
-
*/
|
|
14
|
-
import { PhoneLink } from '../primitives/links.js';
|
|
15
|
-
import { ShellQuoteButton } from './shell-quote.js';
|
|
16
|
-
import { CallBarController } from './call-bar-client.js';
|
|
17
|
-
export const MOBILE_CALL_BAR_VARIANTS = ['bar', 'float'];
|
|
18
|
-
export function MobileCallBar({ phone, phoneLabel, quote, compactLabel, variant = 'bar', layout, classes }) {
|
|
19
|
-
return (_jsxs(CallBarController, { variant: variant, always: layout?.show === 'always', className: classes?.root, children: [_jsx(PhoneLink, { phone: phone, placement: "fab", label: phoneLabel, showIcon: true, variant: "button", classes: { root: classes?.call } }), _jsx(ShellQuoteButton, { label: quote.label, href: quote.href, placement: "floating", ctaId: "quote-callbar", compactLabel: compactLabel, classes: { root: classes?.quote } })] }));
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=mobile-call-bar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-call-bar.js","sourceRoot":"","sources":["../../../src/ui-kit/shell/mobile-call-bar.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAIxD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,OAAO,CAAU,CAAA;AAqBjE,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,GAAG,KAAK,EAAE,MAAM,EAAE,OAAO,EAAsB;IAC5H,OAAO,CACL,MAAC,iBAAiB,IAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,KAAK,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,aAC9F,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,KAAK,EAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,QAAC,OAAO,EAAC,QAAQ,EAAC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAI,EAC1H,KAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAC,UAAU,EAAC,KAAK,EAAC,eAAe,EAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAI,IAClJ,CACrB,CAAA;AACH,CAAC","sourcesContent":["/**\n * F6: the phone call bar (server component). Call and quote always one tap away below 1024 px: it shows once the\n * hero's own call and quote buttons (`data-bl-call-path`) have scrolled out, and hides over the footer, the drawer, a\n * dialog, any call path and while a form field has focus. Call reports placement `fab`; the quote button sends\n * `lead_cta_click` with placement `floating`. Render it once, after the page's `<main>`.\n *\n * Both buttons stay on one line down to 360 px (3.15.0): the number never wraps or truncates; below 420 px the verb\n * (\"Call\") is visually hidden (the link's name keeps it) and the quote button shows `compactLabel` when given.\n *\n * `layout.show: 'always'` (3.16.0, as AA's live site): the bar shows from the first phone screen, beside the hero's\n * buttons, still Call before Quote (K6), and still hides over the footer, a dialog and a focused field.\n */\nimport { PhoneLink } from '../primitives/links.js'\nimport { ShellQuoteButton } from './shell-quote.js'\nimport type { SkinEntry } from '../skin.js'\nimport type { UiPhone } from '../types.js'\nimport { CallBarController } from './call-bar-client.js'\nimport type { ShellQuote } from './mobile-drawer.js'\n\nexport type MobileCallBarSlot = 'root' | 'call' | 'quote'\nexport const MOBILE_CALL_BAR_VARIANTS = ['bar', 'float'] as const\n/** `bar`: full width; `float`: two pills at the end. */\nexport type MobileCallBarVariant = (typeof MOBILE_CALL_BAR_VARIANTS)[number]\nexport interface MobileCallBarLayout {\n /** `after-call-path` (the default): once the hero's buttons scroll out; `always`: from the first phone screen. */\n readonly show?: 'after-call-path' | 'always'\n}\nexport type MobileCallBarSkin = SkinEntry<MobileCallBarSlot, MobileCallBarVariant, MobileCallBarLayout>\n\nexport interface MobileCallBarProps extends MobileCallBarSkin {\n readonly phone: UiPhone\n /** Words before the number, for example \"Call\". The button's name always includes the number. */\n readonly phoneLabel?: string | undefined\n readonly quote: ShellQuote\n /**\n * A shorter quote label for phones narrower than 420 px, for example \"Free quote\" for \"Get a Free Quote\". It must be\n * part of the quote label; the button's text and name stay the full label.\n */\n readonly compactLabel?: string | undefined\n}\n\nexport function MobileCallBar({ phone, phoneLabel, quote, compactLabel, variant = 'bar', layout, classes }: MobileCallBarProps) {\n return (\n <CallBarController variant={variant} always={layout?.show === 'always'} className={classes?.root}>\n <PhoneLink phone={phone} placement=\"fab\" label={phoneLabel} showIcon variant=\"button\" classes={{ root: classes?.call }} />\n <ShellQuoteButton label={quote.label} href={quote.href} placement=\"floating\" ctaId=\"quote-callbar\" compactLabel={compactLabel} classes={{ root: classes?.quote }} />\n </CallBarController>\n )\n}\n"]}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* F4: the phone and compact-band menu (server component). A modal dialog named "Menu", sliding in at
|
|
3
|
-
* `min(100%, 420px)`: the close button first, then the menu in the desktop order (F1, 3.14.0), each dropdown an
|
|
4
|
-
* accordion where it stands (one open at a time) and each run of plain links one list, then full-width Call and quote
|
|
5
|
-
* buttons, and the social links. Every link is in the server HTML. `SiteHeader` renders it;
|
|
6
|
-
* render it on its own only inside a recorded bespoke header.
|
|
7
|
-
*/
|
|
8
|
-
import type { BrandlabNavigation } from '@brandlab-digital/site-core/navigation';
|
|
9
|
-
import type { ReactNode } from 'react';
|
|
10
|
-
import type { RepeatedSlotOf } from '../repeated-slots.js';
|
|
11
|
-
import { type SkinEntry } from '../skin.js';
|
|
12
|
-
import type { UiPhone, UiSocial } from '../types.js';
|
|
13
|
-
export type MobileDrawerSlot = 'root' | 'menuButton' | 'menuLabel' | 'panel' | 'top' | 'close' | 'title' | 'logo' | 'nav' | 'group' | 'groupTrigger' | 'groupLinks' | 'groupLink' | 'links' | 'link' | 'actions' | 'call' | 'quote' | 'social' | 'socialLink';
|
|
14
|
-
export declare const MOBILE_DRAWER_VARIANTS: readonly ["side", "full"];
|
|
15
|
-
export type MobileDrawerVariant = (typeof MOBILE_DRAWER_VARIANTS)[number];
|
|
16
|
-
export interface MobileDrawerLayout {
|
|
17
|
-
/** The side the panel slides from (`side` variant). */
|
|
18
|
-
readonly side?: 'end' | 'start';
|
|
19
|
-
}
|
|
20
|
-
/** Rendered once per group, link or social profile: styled from the skin stylesheet, never by class (3.14.0). */
|
|
21
|
-
export type MobileDrawerRepeatedSlot = RepeatedSlotOf<'mobileDrawer'>;
|
|
22
|
-
export type MobileDrawerSkin = SkinEntry<MobileDrawerSlot, MobileDrawerVariant, MobileDrawerLayout, MobileDrawerRepeatedSlot>;
|
|
23
|
-
/** The quote action. `href` is the quote form it falls back to without scripts, for example `/contact#quote`. */
|
|
24
|
-
export interface ShellQuote {
|
|
25
|
-
readonly label: string;
|
|
26
|
-
readonly href: string;
|
|
27
|
-
}
|
|
28
|
-
export interface MobileDrawerProps extends MobileDrawerSkin {
|
|
29
|
-
readonly navigation: BrandlabNavigation;
|
|
30
|
-
readonly phone: UiPhone;
|
|
31
|
-
/** Words before the number on the Call button, for example "Call". */
|
|
32
|
-
readonly phoneLabel?: string | undefined;
|
|
33
|
-
readonly quote: ShellQuote;
|
|
34
|
-
readonly socials?: readonly UiSocial[] | undefined;
|
|
35
|
-
/** An optional logo in the drawer's top bar (decorative there). */
|
|
36
|
-
readonly logo?: ReactNode;
|
|
37
|
-
/** Prefix for element ids; one per header on the page. */
|
|
38
|
-
readonly idPrefix?: string | undefined;
|
|
39
|
-
}
|
|
40
|
-
export declare function MobileDrawer({ navigation, phone, phoneLabel, quote, socials, logo, idPrefix, variant, layout, classes, }: MobileDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
-
//# sourceMappingURL=mobile-drawer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-drawer.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/shell/mobile-drawer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAA4C,MAAM,wCAAwC,CAAA;AAC1H,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAKpD,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,YAAY,GACZ,WAAW,GACX,OAAO,GACP,KAAK,GACL,OAAO,GACP,OAAO,GACP,MAAM,GACN,KAAK,GACL,OAAO,GACP,cAAc,GACd,YAAY,GACZ,WAAW,GACX,OAAO,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OAAO,GACR,EAAE,iBAAiB,2CAwDnB"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Icon } from '../icons.js';
|
|
3
|
-
import { PhoneLink } from '../primitives/links.js';
|
|
4
|
-
import { ShellQuoteButton } from './shell-quote.js';
|
|
5
|
-
import { repeatedSlot, slot } from '../skin.js';
|
|
6
|
-
import { CurrentLink } from './current-link.js';
|
|
7
|
-
import { DrawerController } from './drawer-client.js';
|
|
8
|
-
import { SocialLinks } from './social-links.js';
|
|
9
|
-
export const MOBILE_DRAWER_VARIANTS = ['side', 'full'];
|
|
10
|
-
export function MobileDrawer({ navigation, phone, phoneLabel, quote, socials = [], logo, idPrefix = 'bl-header', variant = 'side', layout, classes, }) {
|
|
11
|
-
const id = `${idPrefix}-drawer`;
|
|
12
|
-
// The drawer keeps the desktop menu's order (F1): a dropdown becomes an accordion where it stands, and each run of
|
|
13
|
-
// plain links between dropdowns is one list.
|
|
14
|
-
const runs = [];
|
|
15
|
-
for (const item of navigation.items) {
|
|
16
|
-
if (item.kind === 'menu')
|
|
17
|
-
runs.push(item);
|
|
18
|
-
else {
|
|
19
|
-
const last = runs[runs.length - 1];
|
|
20
|
-
if (Array.isArray(last))
|
|
21
|
-
last.push(item);
|
|
22
|
-
else
|
|
23
|
-
runs.push([item]);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return (_jsxs(DrawerController, { id: id, variant: variant, side: layout?.side ?? 'end', classes: {
|
|
27
|
-
root: classes?.root,
|
|
28
|
-
menuButton: classes?.menuButton,
|
|
29
|
-
menuLabel: classes?.menuLabel,
|
|
30
|
-
panel: classes?.panel,
|
|
31
|
-
top: classes?.top,
|
|
32
|
-
close: classes?.close,
|
|
33
|
-
title: classes?.title,
|
|
34
|
-
logo: classes?.logo,
|
|
35
|
-
}, logo: logo, menuIcon: _jsx(Icon, { name: "menu" }), closeIcon: _jsx(Icon, { name: "close" }), children: [_jsx("nav", { "aria-label": "Main", ...slot(classes, 'nav'), children: runs.map((run) => Array.isArray(run) ? (_jsx("ul", { ...slot(classes, 'links'), children: run.map((link) => (_jsx("li", { children: _jsx(CurrentLink, { href: link.href, slot: "link", prefetch: false, children: link.label }) }, link.id))) }, `links-${run[0].id}`)) : (_jsx(GroupAccordion, { group: run, name: `${id}-groups` }, run.id))) }), _jsxs("div", { ...slot(classes, 'actions'), children: [_jsx(PhoneLink, { phone: phone, placement: "header", label: phoneLabel, showIcon: true, variant: "button", classes: { root: classes?.call } }), _jsx(ShellQuoteButton, { label: quote.label, href: quote.href, placement: "navigation", ctaId: "quote-menu", classes: { root: classes?.quote } })] }), _jsx(SocialLinks, { socials: socials, slotName: "social", className: classes?.social })] }));
|
|
36
|
-
}
|
|
37
|
-
/** One dropdown as an accordion: its hub link first, the featured card's page, then its links. */
|
|
38
|
-
function GroupAccordion({ group, name }) {
|
|
39
|
-
return (_jsxs("details", { name: name, ...repeatedSlot('group'), children: [_jsxs("summary", { ...repeatedSlot('groupTrigger'), children: [_jsx("span", { children: group.label }), _jsx(Icon, { name: "chevron" })] }), _jsxs("ul", { ...repeatedSlot('groupLinks'), children: [_jsx("li", { children: _jsx(CurrentLink, { href: group.href, slot: "groupLink", prefetch: false, hub: true, children: group.hubLabel }) }), group.featured && !group.links.some((link) => link.href === group.featured?.href) ? (_jsx("li", { children: _jsx(CurrentLink, { href: group.featured.href, slot: "groupLink", prefetch: false, children: group.featured.label }) })) : null, group.links.map((link) => (_jsx("li", { children: _jsx(CurrentLink, { href: link.href, slot: "groupLink", prefetch: false, children: link.label }) }, link.href)))] })] }));
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=mobile-drawer.js.map
|