@brandlab-digital/site-next 3.14.0 → 3.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics.d.ts +1 -1
- package/dist/analytics.d.ts.map +1 -1
- package/dist/analytics.js +2 -0
- package/dist/analytics.js.map +1 -1
- package/dist/image-runtime.js +6 -1
- package/dist/image-runtime.js.map +1 -1
- package/dist/navigation/constants.d.ts +11 -2
- package/dist/navigation/constants.d.ts.map +1 -1
- package/dist/navigation/constants.js +11 -2
- package/dist/navigation/constants.js.map +1 -1
- package/dist/navigation/index.d.ts +1 -1
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +1 -1
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/use-back-to-top.d.ts.map +1 -1
- package/dist/navigation/use-back-to-top.js +12 -4
- package/dist/navigation/use-back-to-top.js.map +1 -1
- package/dist/navigation/use-header-metrics.d.ts +1 -1
- package/dist/navigation/use-header-metrics.js +1 -1
- package/dist/navigation/use-header-metrics.js.map +1 -1
- package/dist/navigation/use-sticky-call-bar.d.ts +2 -1
- package/dist/navigation/use-sticky-call-bar.d.ts.map +1 -1
- package/dist/navigation/use-sticky-call-bar.js +11 -2
- package/dist/navigation/use-sticky-call-bar.js.map +1 -1
- package/dist/next-sharp.d.ts +14 -9
- package/dist/next-sharp.d.ts.map +1 -1
- package/dist/next-sharp.js +26 -25
- package/dist/next-sharp.js.map +1 -1
- package/dist/ui-kit/brandlab-skin.d.ts +26 -0
- package/dist/ui-kit/brandlab-skin.d.ts.map +1 -1
- package/dist/ui-kit/brandlab-skin.js.map +1 -1
- package/dist/ui-kit/prefetch.d.ts +19 -10
- package/dist/ui-kit/prefetch.d.ts.map +1 -1
- package/dist/ui-kit/prefetch.js +23 -10
- package/dist/ui-kit/prefetch.js.map +1 -1
- package/dist/ui-kit/primitives/index.d.ts +1 -1
- package/dist/ui-kit/primitives/index.d.ts.map +1 -1
- package/dist/ui-kit/primitives/index.js.map +1 -1
- package/dist/ui-kit/primitives/links.js +1 -1
- package/dist/ui-kit/primitives/links.js.map +1 -1
- package/dist/ui-kit/primitives/lists.d.ts +9 -1
- package/dist/ui-kit/primitives/lists.d.ts.map +1 -1
- package/dist/ui-kit/primitives/lists.js +1 -1
- package/dist/ui-kit/primitives/lists.js.map +1 -1
- package/dist/ui-kit/primitives/quote-button.d.ts +25 -2
- package/dist/ui-kit/primitives/quote-button.d.ts.map +1 -1
- package/dist/ui-kit/primitives/quote-button.js +25 -3
- package/dist/ui-kit/primitives/quote-button.js.map +1 -1
- package/dist/ui-kit/repeated-slots.d.ts +32 -0
- package/dist/ui-kit/repeated-slots.d.ts.map +1 -1
- package/dist/ui-kit/repeated-slots.js +16 -0
- package/dist/ui-kit/repeated-slots.js.map +1 -1
- package/dist/ui-kit/sections/area-map.d.ts +64 -0
- package/dist/ui-kit/sections/area-map.d.ts.map +1 -0
- package/dist/ui-kit/sections/area-map.js +142 -0
- package/dist/ui-kit/sections/area-map.js.map +1 -0
- package/dist/ui-kit/sections/before-after.d.ts +59 -0
- package/dist/ui-kit/sections/before-after.d.ts.map +1 -0
- package/dist/ui-kit/sections/before-after.js +42 -0
- package/dist/ui-kit/sections/before-after.js.map +1 -0
- package/dist/ui-kit/sections/council-rules.d.ts +64 -0
- package/dist/ui-kit/sections/council-rules.d.ts.map +1 -0
- package/dist/ui-kit/sections/council-rules.js +46 -0
- package/dist/ui-kit/sections/council-rules.js.map +1 -0
- package/dist/ui-kit/sections/coverage.d.ts +53 -0
- package/dist/ui-kit/sections/coverage.d.ts.map +1 -0
- package/dist/ui-kit/sections/coverage.js +57 -0
- package/dist/ui-kit/sections/coverage.js.map +1 -0
- package/dist/ui-kit/sections/emergency-band.d.ts +60 -0
- package/dist/ui-kit/sections/emergency-band.d.ts.map +1 -0
- package/dist/ui-kit/sections/emergency-band.js +43 -0
- package/dist/ui-kit/sections/emergency-band.js.map +1 -0
- package/dist/ui-kit/sections/gallery.d.ts +60 -0
- package/dist/ui-kit/sections/gallery.d.ts.map +1 -0
- package/dist/ui-kit/sections/gallery.js +39 -0
- package/dist/ui-kit/sections/gallery.js.map +1 -0
- package/dist/ui-kit/sections/hero.d.ts +5 -0
- package/dist/ui-kit/sections/hero.d.ts.map +1 -1
- package/dist/ui-kit/sections/hero.js +1 -1
- package/dist/ui-kit/sections/hero.js.map +1 -1
- package/dist/ui-kit/sections/index.d.ts +14 -1
- package/dist/ui-kit/sections/index.d.ts.map +1 -1
- package/dist/ui-kit/sections/index.js +14 -1
- package/dist/ui-kit/sections/index.js.map +1 -1
- package/dist/ui-kit/sections/licences.d.ts +72 -0
- package/dist/ui-kit/sections/licences.d.ts.map +1 -0
- package/dist/ui-kit/sections/licences.js +46 -0
- package/dist/ui-kit/sections/licences.js.map +1 -0
- package/dist/ui-kit/sections/local-facts.d.ts +78 -0
- package/dist/ui-kit/sections/local-facts.d.ts.map +1 -0
- package/dist/ui-kit/sections/local-facts.js +32 -0
- package/dist/ui-kit/sections/local-facts.js.map +1 -0
- package/dist/ui-kit/sections/nearby-areas.d.ts +50 -0
- package/dist/ui-kit/sections/nearby-areas.d.ts.map +1 -0
- package/dist/ui-kit/sections/nearby-areas.js +49 -0
- package/dist/ui-kit/sections/nearby-areas.js.map +1 -0
- package/dist/ui-kit/sections/nearby-jobs.d.ts +66 -0
- package/dist/ui-kit/sections/nearby-jobs.d.ts.map +1 -0
- package/dist/ui-kit/sections/nearby-jobs.js +49 -0
- package/dist/ui-kit/sections/nearby-jobs.js.map +1 -0
- package/dist/ui-kit/sections/projects.d.ts +79 -0
- package/dist/ui-kit/sections/projects.d.ts.map +1 -0
- package/dist/ui-kit/sections/projects.js +69 -0
- package/dist/ui-kit/sections/projects.js.map +1 -0
- package/dist/ui-kit/sections/quote-checklist.d.ts +43 -0
- package/dist/ui-kit/sections/quote-checklist.d.ts.map +1 -0
- package/dist/ui-kit/sections/quote-checklist.js +19 -0
- package/dist/ui-kit/sections/quote-checklist.js.map +1 -0
- package/dist/ui-kit/sections/related-services.d.ts +41 -0
- package/dist/ui-kit/sections/related-services.d.ts.map +1 -0
- package/dist/ui-kit/sections/related-services.js +52 -0
- package/dist/ui-kit/sections/related-services.js.map +1 -0
- package/dist/ui-kit/sections/reviews-band.d.ts +11 -0
- package/dist/ui-kit/sections/reviews-band.d.ts.map +1 -1
- package/dist/ui-kit/sections/reviews-band.js +11 -0
- package/dist/ui-kit/sections/reviews-band.js.map +1 -1
- package/dist/ui-kit/sections/services-grid.js +1 -1
- package/dist/ui-kit/sections/services-grid.js.map +1 -1
- package/dist/ui-kit/sections/work-photos.d.ts +15 -0
- package/dist/ui-kit/sections/work-photos.d.ts.map +1 -0
- package/dist/ui-kit/sections/work-photos.js +24 -0
- package/dist/ui-kit/sections/work-photos.js.map +1 -0
- package/dist/ui-kit/shell/back-to-top.js +1 -1
- package/dist/ui-kit/shell/back-to-top.js.map +1 -1
- package/dist/ui-kit/shell/current-link.d.ts +21 -5
- package/dist/ui-kit/shell/current-link.d.ts.map +1 -1
- package/dist/ui-kit/shell/current-link.js +16 -5
- package/dist/ui-kit/shell/current-link.js.map +1 -1
- package/dist/ui-kit/shell/drawer-client.js +1 -1
- package/dist/ui-kit/shell/drawer-client.js.map +1 -1
- package/dist/ui-kit/shell/intent-prefetch.d.ts.map +1 -1
- package/dist/ui-kit/shell/intent-prefetch.js +3 -2
- package/dist/ui-kit/shell/intent-prefetch.js.map +1 -1
- package/dist/ui-kit/shell/mobile-call-bar.d.ts +6 -1
- package/dist/ui-kit/shell/mobile-call-bar.d.ts.map +1 -1
- package/dist/ui-kit/shell/mobile-call-bar.js +6 -3
- package/dist/ui-kit/shell/mobile-call-bar.js.map +1 -1
- package/dist/ui-kit/shell/mobile-drawer.js +2 -2
- package/dist/ui-kit/shell/mobile-drawer.js.map +1 -1
- package/dist/ui-kit/shell/shell-quote.d.ts +10 -0
- package/dist/ui-kit/shell/shell-quote.d.ts.map +1 -0
- package/dist/ui-kit/shell/shell-quote.js +13 -0
- package/dist/ui-kit/shell/shell-quote.js.map +1 -0
- package/dist/ui-kit/shell/site-header.d.ts +1 -1
- package/dist/ui-kit/shell/site-header.js +4 -4
- package/dist/ui-kit/shell/site-header.js.map +1 -1
- package/dist/ui-kit/structure.css +410 -7
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-sticky-call-bar.js","sourceRoot":"","sources":["../../src/navigation/use-sticky-call-bar.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAEzE,MAAM,cAAc,GAAG;IACrB,iHAAiH;IACjH,UAAU;IACV,QAAQ;IACR,sBAAsB;IACtB,0BAA0B;CAC3B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ,SAAS,OAAO,CAAC,MAA0B;IACzC,OAAO,MAAM,YAAY,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;AACpE,CAAC;AAED,qHAAqH;AACrH,SAAS,YAAY,CAAC,OAAgB;IACpC,OAAO,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,oCAAoC,CAAC,CAAA;AACvH,CAAC;AAED,SAAS,WAAW;IAClB,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,4BAA4B,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;AACjG,CAAC;AAED;;;GAGG;AACH,SAAS,UAAU,CAAC,MAA0B;IAC5C,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,CAAC;QAAE,OAAO,KAAK,CAAA;IAC9C,IAAI,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC;QAAE,OAAO,IAAI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AAM,CAAC,EAAE,CAAC,CAAA;QAC9F,MAAM,SAAS,GAAG,CAAC,KAAiB,EAAE,EAAE;YACtC,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YACpC,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YACtC,MAAM,EAAE,CAAA;QACV,CAAC,CAAA;QACD,MAAM,UAAU,GAAG,CAAC,KAAiB,EAAE,EAAE;YACvC,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;YAC3C,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;YAC7C,MAAM,EAAE,CAAA;QACV,CAAC,CAAA;QACD,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAC/C,QAAQ,CAAC,gBAAgB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;QACjD,MAAM,EAAE,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAC1C,MAAM,EAAE,CAAA;QAER,OAAO,GAAG,EAAE;YACV,aAAa,EAAE,UAAU,EAAE,CAAA;YAC3B,OAAO,CAAC,UAAU,EAAE,CAAA;YACpB,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;YAClD,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;YACpD,MAAM,EAAE,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;YAC7C,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAA;QAClD,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAA;IAEvB,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["'use client'\n\n/**\n * F6: when the phone call bar shows. TotalCare's logic, ported: below 1024 px the bar shows once every call path on\n * screen (the hero's own call and quote buttons, marked `data-bl-call-path`) has scrolled out, and hides again while\n * a call path, the page footer or an open dialog (the drawer, the quote dialog) is on screen, while a form field has\n * focus (v2) and while focus is inside the footer or a call path. The hook keeps `--bl-callbar-height` at the bar's height while it shows and `0px` otherwise, which\n * drives `scroll-padding-bottom` (WCAG 2.4.11) and lifts back-to-top above the bar.\n */\nimport { useLayoutEffect, useState, type RefObject } from 'react'\nimport { CALL_BAR_MEDIA_QUERY, CALL_PATH_SELECTOR } from './constants.js'\n\nconst FIELD_SELECTOR = [\n 'input:not([type=\"button\"], [type=\"submit\"], [type=\"reset\"], [type=\"checkbox\"], [type=\"radio\"], [type=\"hidden\"])',\n 'textarea',\n 'select',\n '[contenteditable=\"\"]',\n '[contenteditable=\"true\"]',\n].join(', ')\n\nfunction isField(target: EventTarget | null): boolean {\n return target instanceof Element && target.matches(FIELD_SELECTOR)\n}\n\n/** The page footer: the shared footer, or a `<footer>` that isn't inside an article, aside, main, nav or section. */\nfunction isPageFooter(element: Element): boolean {\n return element.matches('[data-bl=\"footer\"]') || !element.parentElement?.closest('article, aside, main, nav, section')\n}\n\nfunction pageFooters(): Element[] {\n return Array.from(document.querySelectorAll('footer, [data-bl=\"footer\"]')).filter(isPageFooter)\n}\n\n/**\n * Focus inside the footer or a call path hides the bar at once, before the observer reports (fast Tab stops would\n * otherwise sit under the bar, K5).\n */\nfunction inHideZone(target: EventTarget | null): boolean {\n if (!(target instanceof Element)) return false\n if (target.closest(CALL_PATH_SELECTOR)) return true\n const footer = target.closest('footer, [data-bl=\"footer\"]')\n return footer !== null && isPageFooter(footer)\n}\n\n/** True when any part of the element's box is inside the viewport. */\nfunction inViewport(element: Element): boolean {\n const box = element.getBoundingClientRect()\n return box.bottom > 0 && box.right > 0 && box.top < window.innerHeight && box.left < window.innerWidth\n}\n\n/**\n * True while the bar should show. `resetKey` (the route) re-collects the call paths and the footer. The first state\n * is seeded from their boxes before paint, so the bar never flashes on load or on a client navigation while the\n * observer's first report is pending.\n */\nexport function useStickyCallBar(rootRef: RefObject<HTMLElement | null>, resetKey: unknown): boolean {\n const [shown, setShown] = useState(false)\n\n useLayoutEffect(() => {\n const root = rootRef.current\n if (!root) return\n const html = document.documentElement\n const narrow = typeof window.matchMedia === 'function' ? window.matchMedia(CALL_BAR_MEDIA_QUERY) : null\n const onScreen = new Set<Element>()\n let fieldFocused = isField(document.activeElement)\n let focusHidden = inHideZone(document.activeElement)\n\n const update = () => {\n const next = (narrow?.matches ?? false) && onScreen.size === 0 && !fieldFocused && !focusHidden && !document.querySelector('dialog[open]')\n setShown(next)\n html.style.setProperty('--bl-callbar-height', next ? `${Math.round(root.getBoundingClientRect().height)}px` : '0px')\n }\n\n let intersections: IntersectionObserver | undefined\n if (typeof IntersectionObserver === 'function') {\n intersections = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) onScreen.add(entry.target)\n else onScreen.delete(entry.target)\n }\n update()\n })\n }\n for (const target of [...document.querySelectorAll(CALL_PATH_SELECTOR), ...pageFooters()]) {\n if (inViewport(target)) onScreen.add(target)\n intersections?.observe(target)\n }\n const dialogs = new MutationObserver(update)\n dialogs.observe(document.body, { subtree: true, attributes: true, attributeFilter: ['open'] })\n const onFocusIn = (event: FocusEvent) => {\n fieldFocused = isField(event.target)\n focusHidden = inHideZone(event.target)\n update()\n }\n const onFocusOut = (event: FocusEvent) => {\n fieldFocused = isField(event.relatedTarget)\n focusHidden = inHideZone(event.relatedTarget)\n update()\n }\n document.addEventListener('focusin', onFocusIn)\n document.addEventListener('focusout', onFocusOut)\n narrow?.addEventListener('change', update)\n update()\n\n return () => {\n intersections?.disconnect()\n dialogs.disconnect()\n document.removeEventListener('focusin', onFocusIn)\n document.removeEventListener('focusout', onFocusOut)\n narrow?.removeEventListener('change', update)\n html.style.removeProperty('--bl-callbar-height')\n }\n }, [rootRef, resetKey])\n\n return shown\n}\n"]}
|
|
1
|
+
{"version":3,"file":"use-sticky-call-bar.js","sourceRoot":"","sources":["../../src/navigation/use-sticky-call-b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AE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAA;QAC7F,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAA;IAEvB,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["'use client'\n\n/**\n * F6: when the phone call bar shows. TotalCare's logic, ported: below 1024 px the bar shows once every call path on\n * screen (the hero's own call and quote buttons, marked `data-bl-call-path`) has scrolled out, and hides again while\n * a call path, the page footer or an open dialog (the drawer, the quote dialog) is on screen, while a form field has\n * focus (v2) and while focus is inside the footer or a call path. The hook keeps `--bl-callbar-height` at the bar's height while it shows and `0px` otherwise, which\n * drives `scroll-padding-bottom` (WCAG 2.4.11), and publishes its state (`data-bl-callbar` on the root element and a\n * `bl:callbar` event) so back-to-top stays hidden while the bar shows: on a phone the button never covers the bar.\n */\nimport { useLayoutEffect, useState, type RefObject } from 'react'\nimport { CALL_BAR_MEDIA_QUERY, CALL_BAR_STATE_ATTRIBUTE, CALL_BAR_STATE_EVENT, CALL_PATH_SELECTOR } from './constants.js'\n\nconst FIELD_SELECTOR = [\n 'input:not([type=\"button\"], [type=\"submit\"], [type=\"reset\"], [type=\"checkbox\"], [type=\"radio\"], [type=\"hidden\"])',\n 'textarea',\n 'select',\n '[contenteditable=\"\"]',\n '[contenteditable=\"true\"]',\n].join(', ')\n\nfunction isField(target: EventTarget | null): boolean {\n return target instanceof Element && target.matches(FIELD_SELECTOR)\n}\n\n/** The page footer: the shared footer, or a `<footer>` that isn't inside an article, aside, main, nav or section. */\nfunction isPageFooter(element: Element): boolean {\n return element.matches('[data-bl=\"footer\"]') || !element.parentElement?.closest('article, aside, main, nav, section')\n}\n\nfunction pageFooters(): Element[] {\n return Array.from(document.querySelectorAll('footer, [data-bl=\"footer\"]')).filter(isPageFooter)\n}\n\n/**\n * Focus inside the footer or a call path hides the bar at once, before the observer reports (fast Tab stops would\n * otherwise sit under the bar, K5).\n */\nfunction inHideZone(target: EventTarget | null): boolean {\n if (!(target instanceof Element)) return false\n if (target.closest(CALL_PATH_SELECTOR)) return true\n const footer = target.closest('footer, [data-bl=\"footer\"]')\n return footer !== null && isPageFooter(footer)\n}\n\n/** True when any part of the element's box is inside the viewport. */\nfunction inViewport(element: Element): boolean {\n const box = element.getBoundingClientRect()\n return box.bottom > 0 && box.right > 0 && box.top < window.innerHeight && box.left < window.innerWidth\n}\n\n/**\n * True while the bar should show. `resetKey` (the route) re-collects the call paths and the footer. The first state\n * is seeded from their boxes before paint, so the bar never flashes on load or on a client navigation while the\n * observer's first report is pending.\n */\nexport function useStickyCallBar(rootRef: RefObject<HTMLElement | null>, resetKey: unknown): boolean {\n const [shown, setShown] = useState(false)\n\n useLayoutEffect(() => {\n const root = rootRef.current\n if (!root) return\n const html = document.documentElement\n const narrow = typeof window.matchMedia === 'function' ? window.matchMedia(CALL_BAR_MEDIA_QUERY) : null\n const onScreen = new Set<Element>()\n let fieldFocused = isField(document.activeElement)\n let focusHidden = inHideZone(document.activeElement)\n\n let published: boolean | undefined\n const update = () => {\n const next = (narrow?.matches ?? false) && onScreen.size === 0 && !fieldFocused && !focusHidden && !document.querySelector('dialog[open]')\n setShown(next)\n html.style.setProperty('--bl-callbar-height', next ? `${Math.round(root.getBoundingClientRect().height)}px` : '0px')\n if (next === published) return\n published = next\n html.setAttribute(CALL_BAR_STATE_ATTRIBUTE, next ? 'shown' : 'hidden')\n document.dispatchEvent(new CustomEvent(CALL_BAR_STATE_EVENT, { detail: { shown: next } }))\n }\n\n let intersections: IntersectionObserver | undefined\n if (typeof IntersectionObserver === 'function') {\n intersections = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) onScreen.add(entry.target)\n else onScreen.delete(entry.target)\n }\n update()\n })\n }\n for (const target of [...document.querySelectorAll(CALL_PATH_SELECTOR), ...pageFooters()]) {\n if (inViewport(target)) onScreen.add(target)\n intersections?.observe(target)\n }\n const dialogs = new MutationObserver(update)\n dialogs.observe(document.body, { subtree: true, attributes: true, attributeFilter: ['open'] })\n const onFocusIn = (event: FocusEvent) => {\n fieldFocused = isField(event.target)\n focusHidden = inHideZone(event.target)\n update()\n }\n const onFocusOut = (event: FocusEvent) => {\n fieldFocused = isField(event.relatedTarget)\n focusHidden = inHideZone(event.relatedTarget)\n update()\n }\n document.addEventListener('focusin', onFocusIn)\n document.addEventListener('focusout', onFocusOut)\n narrow?.addEventListener('change', update)\n update()\n\n return () => {\n intersections?.disconnect()\n dialogs.disconnect()\n document.removeEventListener('focusin', onFocusIn)\n document.removeEventListener('focusout', onFocusOut)\n narrow?.removeEventListener('change', update)\n html.style.removeProperty('--bl-callbar-height')\n html.removeAttribute(CALL_BAR_STATE_ATTRIBUTE)\n document.dispatchEvent(new CustomEvent(CALL_BAR_STATE_EVENT, { detail: { shown: false } }))\n }\n }, [rootRef, resetKey])\n\n return shown\n}\n"]}
|
package/dist/next-sharp.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Next
|
|
3
|
-
* `next/dist/server/image-optimizer.js` to `next/dist/server/image-optimizer/transform.js
|
|
4
|
-
* before blocking the HEIF decoder, because Next unblocks HEIF the first time its optimiser acquires Sharp.
|
|
2
|
+
* The Next module that holds its private Sharp initialiser on the pinned Next release (16.4 moved `getSharp` from
|
|
3
|
+
* `next/dist/server/image-optimizer.js` to `next/dist/server/image-optimizer/transform.js`). The image runtime calls
|
|
4
|
+
* it before blocking the HEIF decoder, because Next unblocks HEIF the first time its optimiser acquires Sharp.
|
|
5
|
+
*
|
|
6
|
+
* The image runtime must load this module with a literal `require('next/dist/server/image-optimizer/transform.js')`
|
|
7
|
+
* on its own `createRequire(import.meta.url)`. Next's output tracing only copies a module into a deployed route
|
|
8
|
+
* when it sees a literal path there; a path held in a variable or passed through a helper is never traced, so the
|
|
9
|
+
* route fails on Vercel while it passes against a full local `node_modules` (3.12.1–3.15.0).
|
|
5
10
|
*/
|
|
6
|
-
export declare const
|
|
7
|
-
type ModuleRequire = (id: string) => unknown;
|
|
11
|
+
export declare const NEXT_SHARP_MODULE = "next/dist/server/image-optimizer/transform.js";
|
|
8
12
|
/**
|
|
9
|
-
* The installed Next's `getSharp`, or undefined when Next is not installed.
|
|
10
|
-
*
|
|
13
|
+
* The installed Next's `getSharp`, or undefined when Next is not installed. `resolveNext` resolves
|
|
14
|
+
* `next/package.json`; `loadTransform` is the image runtime's literal require of {@link NEXT_SHARP_MODULE}. Throws
|
|
15
|
+
* when Next is installed but the module cannot be loaded (keeping the original error as the cause) or exposes no
|
|
16
|
+
* `getSharp`, so the route fails at startup instead of leaving HEIF decoding open.
|
|
11
17
|
*/
|
|
12
|
-
export declare function findNextGetSharp(
|
|
13
|
-
export {};
|
|
18
|
+
export declare function findNextGetSharp(resolveNext: () => unknown, loadTransform: () => unknown): (() => unknown) | undefined;
|
|
14
19
|
//# sourceMappingURL=next-sharp.d.ts.map
|
package/dist/next-sharp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-sharp.d.ts","sourceRoot":"","sources":["../src/next-sharp.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"next-sharp.d.ts","sourceRoot":"","sources":["../src/next-sharp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,kDAAkD,CAAA;AAEhF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,OAAO,EAC1B,aAAa,EAAE,MAAM,OAAO,GAC3B,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS,CAsB7B"}
|
package/dist/next-sharp.js
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Next
|
|
3
|
-
* `next/dist/server/image-optimizer.js` to `next/dist/server/image-optimizer/transform.js
|
|
4
|
-
* before blocking the HEIF decoder, because Next unblocks HEIF the first time its optimiser acquires Sharp.
|
|
2
|
+
* The Next module that holds its private Sharp initialiser on the pinned Next release (16.4 moved `getSharp` from
|
|
3
|
+
* `next/dist/server/image-optimizer.js` to `next/dist/server/image-optimizer/transform.js`). The image runtime calls
|
|
4
|
+
* it before blocking the HEIF decoder, because Next unblocks HEIF the first time its optimiser acquires Sharp.
|
|
5
|
+
*
|
|
6
|
+
* The image runtime must load this module with a literal `require('next/dist/server/image-optimizer/transform.js')`
|
|
7
|
+
* on its own `createRequire(import.meta.url)`. Next's output tracing only copies a module into a deployed route
|
|
8
|
+
* when it sees a literal path there; a path held in a variable or passed through a helper is never traced, so the
|
|
9
|
+
* route fails on Vercel while it passes against a full local `node_modules` (3.12.1–3.15.0).
|
|
5
10
|
*/
|
|
6
|
-
export const
|
|
7
|
-
'next/dist/server/image-optimizer/transform.js',
|
|
8
|
-
'next/dist/server/image-optimizer.js',
|
|
9
|
-
];
|
|
11
|
+
export const NEXT_SHARP_MODULE = 'next/dist/server/image-optimizer/transform.js';
|
|
10
12
|
/**
|
|
11
|
-
* The installed Next's `getSharp`, or undefined when Next is not installed.
|
|
12
|
-
*
|
|
13
|
+
* The installed Next's `getSharp`, or undefined when Next is not installed. `resolveNext` resolves
|
|
14
|
+
* `next/package.json`; `loadTransform` is the image runtime's literal require of {@link NEXT_SHARP_MODULE}. Throws
|
|
15
|
+
* when Next is installed but the module cannot be loaded (keeping the original error as the cause) or exposes no
|
|
16
|
+
* `getSharp`, so the route fails at startup instead of leaving HEIF decoding open.
|
|
13
17
|
*/
|
|
14
|
-
export function findNextGetSharp(
|
|
18
|
+
export function findNextGetSharp(resolveNext, loadTransform) {
|
|
15
19
|
try {
|
|
16
|
-
|
|
20
|
+
resolveNext();
|
|
17
21
|
}
|
|
18
22
|
catch (error) {
|
|
19
23
|
if (error.code === 'MODULE_NOT_FOUND')
|
|
20
24
|
return undefined;
|
|
21
25
|
throw error;
|
|
22
26
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
continue;
|
|
31
|
-
throw error;
|
|
32
|
-
}
|
|
33
|
-
const getSharp = loaded?.getSharp;
|
|
34
|
-
if (typeof getSharp === 'function')
|
|
35
|
-
return getSharp;
|
|
27
|
+
let loaded;
|
|
28
|
+
try {
|
|
29
|
+
loaded = loadTransform();
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
33
|
+
throw new Error(`@brandlab-digital/site-next/image-runtime could not load ${NEXT_SHARP_MODULE} from the installed Next.js (${detail}), so it cannot keep HEIF decoding blocked. Use the Next.js version the Brandlab release pins, and check that the deployed route includes that file.`, { cause: error });
|
|
36
34
|
}
|
|
37
|
-
|
|
35
|
+
const getSharp = loaded?.getSharp;
|
|
36
|
+
if (typeof getSharp === 'function')
|
|
37
|
+
return getSharp;
|
|
38
|
+
throw new Error(`The installed Next.js exposes no getSharp in ${NEXT_SHARP_MODULE}; @brandlab-digital/site-next/image-runtime cannot keep HEIF decoding blocked. Use the Next.js version the Brandlab release pins.`);
|
|
38
39
|
}
|
|
39
40
|
//# sourceMappingURL=next-sharp.js.map
|
package/dist/next-sharp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-sharp.js","sourceRoot":"","sources":["../src/next-sharp.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"next-sharp.js","sourceRoot":"","sources":["../src/next-sharp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,+CAA+C,CAAA;AAEhF;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,WAA0B,EAC1B,aAA4B;IAE5B,IAAI,CAAC;QACH,WAAW,EAAE,CAAA;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA+B,CAAC,IAAI,KAAK,kBAAkB;YAAE,OAAO,SAAS,CAAA;QAClF,MAAM,KAAK,CAAA;IACb,CAAC;IACD,IAAI,MAAe,CAAA;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,aAAa,EAAE,CAAA;IAC1B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QACrE,MAAM,IAAI,KAAK,CACb,4DAA4D,iBAAiB,gCAAgC,MAAM,sJAAsJ,EACzQ,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAA;IACH,CAAC;IACD,MAAM,QAAQ,GAAI,MAAwC,EAAE,QAAQ,CAAA;IACpE,IAAI,OAAO,QAAQ,KAAK,UAAU;QAAE,OAAO,QAAyB,CAAA;IACpE,MAAM,IAAI,KAAK,CACb,gDAAgD,iBAAiB,mIAAmI,CACrM,CAAA;AACH,CAAC","sourcesContent":["/**\n * The Next module that holds its private Sharp initialiser on the pinned Next release (16.4 moved `getSharp` from\n * `next/dist/server/image-optimizer.js` to `next/dist/server/image-optimizer/transform.js`). The image runtime calls\n * it before blocking the HEIF decoder, because Next unblocks HEIF the first time its optimiser acquires Sharp.\n *\n * The image runtime must load this module with a literal `require('next/dist/server/image-optimizer/transform.js')`\n * on its own `createRequire(import.meta.url)`. Next's output tracing only copies a module into a deployed route\n * when it sees a literal path there; a path held in a variable or passed through a helper is never traced, so the\n * route fails on Vercel while it passes against a full local `node_modules` (3.12.1–3.15.0).\n */\nexport const NEXT_SHARP_MODULE = 'next/dist/server/image-optimizer/transform.js'\n\n/**\n * The installed Next's `getSharp`, or undefined when Next is not installed. `resolveNext` resolves\n * `next/package.json`; `loadTransform` is the image runtime's literal require of {@link NEXT_SHARP_MODULE}. Throws\n * when Next is installed but the module cannot be loaded (keeping the original error as the cause) or exposes no\n * `getSharp`, so the route fails at startup instead of leaving HEIF decoding open.\n */\nexport function findNextGetSharp(\n resolveNext: () => unknown,\n loadTransform: () => unknown,\n): (() => unknown) | undefined {\n try {\n resolveNext()\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'MODULE_NOT_FOUND') return undefined\n throw error\n }\n let loaded: unknown\n try {\n loaded = loadTransform()\n } catch (error) {\n const detail = error instanceof Error ? error.message : String(error)\n throw new Error(\n `@brandlab-digital/site-next/image-runtime could not load ${NEXT_SHARP_MODULE} from the installed Next.js (${detail}), so it cannot keep HEIF decoding blocked. Use the Next.js version the Brandlab release pins, and check that the deployed route includes that file.`,\n { cause: error },\n )\n }\n const getSharp = (loaded as { getSharp?: unknown } | null)?.getSharp\n if (typeof getSharp === 'function') return getSharp as () => unknown\n throw new Error(\n `The installed Next.js exposes no getSharp in ${NEXT_SHARP_MODULE}; @brandlab-digital/site-next/image-runtime cannot keep HEIF decoding blocked. Use the Next.js version the Brandlab release pins.`,\n )\n}\n"]}
|
|
@@ -38,6 +38,19 @@ import type { HeroSkin } from './sections/hero.js';
|
|
|
38
38
|
import type { ServicesGridSkin } from './sections/services-grid.js';
|
|
39
39
|
import type { MediaSkin } from './primitives/media.js';
|
|
40
40
|
import type { BreadcrumbsSkin } from './primitives/breadcrumbs.js';
|
|
41
|
+
import type { CouncilRulesSkin } from './sections/council-rules.js';
|
|
42
|
+
import type { CoverageSkin } from './sections/coverage.js';
|
|
43
|
+
import type { LocalFactsSkin } from './sections/local-facts.js';
|
|
44
|
+
import type { AreaMapSkin } from './sections/area-map.js';
|
|
45
|
+
import type { NearbyAreasSkin } from './sections/nearby-areas.js';
|
|
46
|
+
import type { NearbyJobsSkin } from './sections/nearby-jobs.js';
|
|
47
|
+
import type { RelatedServicesSkin } from './sections/related-services.js';
|
|
48
|
+
import type { ProjectsSkin } from './sections/projects.js';
|
|
49
|
+
import type { GallerySkin } from './sections/gallery.js';
|
|
50
|
+
import type { BeforeAfterSkin } from './sections/before-after.js';
|
|
51
|
+
import type { LicencesSkin } from './sections/licences.js';
|
|
52
|
+
import type { QuoteChecklistSkin } from './sections/quote-checklist.js';
|
|
53
|
+
import type { EmergencyBandSkin } from './sections/emergency-band.js';
|
|
41
54
|
export interface BrandlabSkin {
|
|
42
55
|
readonly buttonLink?: ButtonLinkSkin;
|
|
43
56
|
readonly textLink?: TextLinkSkin;
|
|
@@ -80,5 +93,18 @@ export interface BrandlabSkin {
|
|
|
80
93
|
readonly servicesGrid?: ServicesGridSkin;
|
|
81
94
|
readonly media?: MediaSkin;
|
|
82
95
|
readonly breadcrumbs?: BreadcrumbsSkin;
|
|
96
|
+
readonly localFacts?: LocalFactsSkin;
|
|
97
|
+
readonly councilRules?: CouncilRulesSkin;
|
|
98
|
+
readonly nearbyJobs?: NearbyJobsSkin;
|
|
99
|
+
readonly nearbyAreas?: NearbyAreasSkin;
|
|
100
|
+
readonly areaMap?: AreaMapSkin;
|
|
101
|
+
readonly coverage?: CoverageSkin;
|
|
102
|
+
readonly relatedServices?: RelatedServicesSkin;
|
|
103
|
+
readonly projects?: ProjectsSkin;
|
|
104
|
+
readonly gallery?: GallerySkin;
|
|
105
|
+
readonly beforeAfter?: BeforeAfterSkin;
|
|
106
|
+
readonly licences?: LicencesSkin;
|
|
107
|
+
readonly quoteChecklist?: QuoteChecklistSkin;
|
|
108
|
+
readonly emergencyBand?: EmergencyBandSkin;
|
|
83
109
|
}
|
|
84
110
|
//# sourceMappingURL=brandlab-skin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brandlab-skin.d.ts","sourceRoot":"","sources":["../../src/ui-kit/brandlab-skin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC5F,OAAO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QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAA;IAChC,QAAQ,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAA;IAC5C,QAAQ,CAAC,aAAa,CAAC,EAAE,iBAAiB,CAAA;CAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brandlab-skin.js","sourceRoot":"","sources":["../../src/ui-kit/brandlab-skin.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A site's whole look for the ui-kit: one entry per shared component it renders (`src/site/skin.ts`, written with\n * `satisfies BrandlabSkin`). Each release adds the entries for its components. K2 checks that every rendered\n * component has an entry and that no reference-skin class ships.\n */\nimport type { ButtonLinkSkin, PhoneLinkSkin, TextLinkSkin } from './primitives/links.js'\nimport type { QuoteButtonSkin } from './primitives/quote-button.js'\nimport type { ContainerSkin, EyebrowSkin, SectionHeadingSkin } from './primitives/layout.js'\nimport type { BadgeSkin, ChipSkin } from './primitives/badge.js'\nimport type { ButtonSkin } from './primitives/button.js'\nimport type { CardSkin } from './primitives/card.js'\nimport type { LinkListSkin, TickListSkin } from './primitives/lists.js'\nimport type { MediaFrameSkin } from './primitives/media-frame.js'\nimport type { StatSkin } from './primitives/stat.js'\nimport type { BackToTopSkin } from './shell/back-to-top.js'\nimport type { MobileCallBarSkin } from './shell/mobile-call-bar.js'\nimport type { MobileDrawerSkin } from './shell/mobile-drawer.js'\nimport type { SiteHeaderSkin } from './shell/site-header.js'\nimport type { UtilityBarSkin } from './shell/utility-bar.js'\nimport type { DialogSkin } from './form/dialog.js'\nimport type { FieldSkin } from './form/field.js'\nimport type { PhotoUploadSkin } from './form/photo-upload.js'\nimport type { QuoteDialogSkin } from './form/quote-dialog.js'\nimport type { QuoteFormSkin } from './form/quote-form.js'\nimport type { ThankYouSkin } from './form/thank-you.js'\nimport type { CTABandSkin } from './sections/cta-band.js'\nimport type { RatingChipSkin } from './sections/rating-chip.js'\nimport type { ReviewsBandSkin } from './sections/reviews-band.js'\nimport type { SiteFooterSkin } from './sections/site-footer.js'\nimport type { AccordionSkin } from './sections/accordion.js'\nimport type { ContactBlockSkin } from './sections/contact-block.js'\nimport type { FAQsSkin } from './sections/faqs.js'\nimport type { PageHeaderSkin } from './sections/page-header.js'\nimport type { PriceGuideSkin } from './sections/price-guide.js'\nimport type { PriceTableSkin } from './sections/price-table.js'\nimport type { ProofStripSkin } from './sections/proof-strip.js'\nimport type { HeroSkin } from './sections/hero.js'\nimport type { ServicesGridSkin } from './sections/services-grid.js'\nimport type { MediaSkin } from './primitives/media.js'\nimport type { BreadcrumbsSkin } from './primitives/breadcrumbs.js'\n\nexport interface BrandlabSkin {\n readonly buttonLink?: ButtonLinkSkin\n readonly textLink?: TextLinkSkin\n readonly phoneLink?: PhoneLinkSkin\n readonly quoteButton?: QuoteButtonSkin\n readonly container?: ContainerSkin\n readonly sectionHeading?: SectionHeadingSkin\n // primitives (3.14.0)\n readonly button?: ButtonSkin\n readonly eyebrow?: EyebrowSkin\n readonly card?: CardSkin\n readonly badge?: BadgeSkin\n readonly chip?: ChipSkin\n readonly stat?: StatSkin\n readonly tickList?: TickListSkin\n readonly linkList?: LinkListSkin\n readonly mediaFrame?: MediaFrameSkin\n readonly siteHeader?: SiteHeaderSkin\n readonly mobileDrawer?: MobileDrawerSkin\n readonly utilityBar?: UtilityBarSkin\n readonly mobileCallBar?: MobileCallBarSkin\n readonly backToTop?: BackToTopSkin\n // form (3.10.0)\n readonly quoteForm?: QuoteFormSkin\n readonly quoteDialog?: QuoteDialogSkin\n readonly photoUpload?: PhotoUploadSkin\n readonly dialog?: DialogSkin\n readonly field?: FieldSkin\n readonly thankYou?: ThankYouSkin\n readonly ratingChip?: RatingChipSkin\n readonly reviewsBand?: ReviewsBandSkin\n readonly ctaBand?: CTABandSkin\n readonly siteFooter?: SiteFooterSkin\n readonly accordion?: AccordionSkin\n readonly faqs?: FAQsSkin\n readonly priceTable?: PriceTableSkin\n readonly priceGuide?: PriceGuideSkin\n readonly proofStrip?: ProofStripSkin\n readonly pageHeader?: PageHeaderSkin\n readonly contactBlock?: ContactBlockSkin\n // hero (3.14.0)\n readonly hero?: HeroSkin\n // 3.14.0\n readonly servicesGrid?: ServicesGridSkin\n readonly media?: MediaSkin\n readonly breadcrumbs?: BreadcrumbsSkin\n}\n"]}
|
|
1
|
+
{"version":3,"file":"brandlab-skin.js","sourceRoot":"","sources":["../../src/ui-kit/brandlab-skin.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A site's whole look for the ui-kit: one entry per shared component it renders (`src/site/skin.ts`, written with\n * `satisfies BrandlabSkin`). Each release adds the entries for its components. K2 checks that every rendered\n * component has an entry and that no reference-skin class ships.\n */\nimport type { ButtonLinkSkin, PhoneLinkSkin, TextLinkSkin } from './primitives/links.js'\nimport type { QuoteButtonSkin } from './primitives/quote-button.js'\nimport type { ContainerSkin, EyebrowSkin, SectionHeadingSkin } from './primitives/layout.js'\nimport type { BadgeSkin, ChipSkin } from './primitives/badge.js'\nimport type { ButtonSkin } from './primitives/button.js'\nimport type { CardSkin } from './primitives/card.js'\nimport type { LinkListSkin, TickListSkin } from './primitives/lists.js'\nimport type { MediaFrameSkin } from './primitives/media-frame.js'\nimport type { StatSkin } from './primitives/stat.js'\nimport type { BackToTopSkin } from './shell/back-to-top.js'\nimport type { MobileCallBarSkin } from './shell/mobile-call-bar.js'\nimport type { MobileDrawerSkin } from './shell/mobile-drawer.js'\nimport type { SiteHeaderSkin } from './shell/site-header.js'\nimport type { UtilityBarSkin } from './shell/utility-bar.js'\nimport type { DialogSkin } from './form/dialog.js'\nimport type { FieldSkin } from './form/field.js'\nimport type { PhotoUploadSkin } from './form/photo-upload.js'\nimport type { QuoteDialogSkin } from './form/quote-dialog.js'\nimport type { QuoteFormSkin } from './form/quote-form.js'\nimport type { ThankYouSkin } from './form/thank-you.js'\nimport type { CTABandSkin } from './sections/cta-band.js'\nimport type { RatingChipSkin } from './sections/rating-chip.js'\nimport type { ReviewsBandSkin } from './sections/reviews-band.js'\nimport type { SiteFooterSkin } from './sections/site-footer.js'\nimport type { AccordionSkin } from './sections/accordion.js'\nimport type { ContactBlockSkin } from './sections/contact-block.js'\nimport type { FAQsSkin } from './sections/faqs.js'\nimport type { PageHeaderSkin } from './sections/page-header.js'\nimport type { PriceGuideSkin } from './sections/price-guide.js'\nimport type { PriceTableSkin } from './sections/price-table.js'\nimport type { ProofStripSkin } from './sections/proof-strip.js'\nimport type { HeroSkin } from './sections/hero.js'\nimport type { ServicesGridSkin } from './sections/services-grid.js'\nimport type { MediaSkin } from './primitives/media.js'\nimport type { BreadcrumbsSkin } from './primitives/breadcrumbs.js'\nimport type { CouncilRulesSkin } from './sections/council-rules.js'\nimport type { CoverageSkin } from './sections/coverage.js'\nimport type { LocalFactsSkin } from './sections/local-facts.js'\nimport type { AreaMapSkin } from './sections/area-map.js'\nimport type { NearbyAreasSkin } from './sections/nearby-areas.js'\nimport type { NearbyJobsSkin } from './sections/nearby-jobs.js'\nimport type { RelatedServicesSkin } from './sections/related-services.js'\nimport type { ProjectsSkin } from './sections/projects.js'\nimport type { GallerySkin } from './sections/gallery.js'\nimport type { BeforeAfterSkin } from './sections/before-after.js'\nimport type { LicencesSkin } from './sections/licences.js'\nimport type { QuoteChecklistSkin } from './sections/quote-checklist.js'\nimport type { EmergencyBandSkin } from './sections/emergency-band.js'\n\nexport interface BrandlabSkin {\n readonly buttonLink?: ButtonLinkSkin\n readonly textLink?: TextLinkSkin\n readonly phoneLink?: PhoneLinkSkin\n readonly quoteButton?: QuoteButtonSkin\n readonly container?: ContainerSkin\n readonly sectionHeading?: SectionHeadingSkin\n // primitives (3.14.0)\n readonly button?: ButtonSkin\n readonly eyebrow?: EyebrowSkin\n readonly card?: CardSkin\n readonly badge?: BadgeSkin\n readonly chip?: ChipSkin\n readonly stat?: StatSkin\n readonly tickList?: TickListSkin\n readonly linkList?: LinkListSkin\n readonly mediaFrame?: MediaFrameSkin\n readonly siteHeader?: SiteHeaderSkin\n readonly mobileDrawer?: MobileDrawerSkin\n readonly utilityBar?: UtilityBarSkin\n readonly mobileCallBar?: MobileCallBarSkin\n readonly backToTop?: BackToTopSkin\n // form (3.10.0)\n readonly quoteForm?: QuoteFormSkin\n readonly quoteDialog?: QuoteDialogSkin\n readonly photoUpload?: PhotoUploadSkin\n readonly dialog?: DialogSkin\n readonly field?: FieldSkin\n readonly thankYou?: ThankYouSkin\n readonly ratingChip?: RatingChipSkin\n readonly reviewsBand?: ReviewsBandSkin\n readonly ctaBand?: CTABandSkin\n readonly siteFooter?: SiteFooterSkin\n readonly accordion?: AccordionSkin\n readonly faqs?: FAQsSkin\n readonly priceTable?: PriceTableSkin\n readonly priceGuide?: PriceGuideSkin\n readonly proofStrip?: ProofStripSkin\n readonly pageHeader?: PageHeaderSkin\n readonly contactBlock?: ContactBlockSkin\n // hero (3.14.0)\n readonly hero?: HeroSkin\n // 3.14.0\n readonly servicesGrid?: ServicesGridSkin\n readonly media?: MediaSkin\n readonly breadcrumbs?: BreadcrumbsSkin\n // location sections (3.15.0)\n readonly localFacts?: LocalFactsSkin\n readonly councilRules?: CouncilRulesSkin\n readonly nearbyJobs?: NearbyJobsSkin\n readonly nearbyAreas?: NearbyAreasSkin\n readonly areaMap?: AreaMapSkin\n readonly coverage?: CoverageSkin\n readonly relatedServices?: RelatedServicesSkin\n // proof sections (3.15.0)\n readonly projects?: ProjectsSkin\n readonly gallery?: GallerySkin\n readonly beforeAfter?: BeforeAfterSkin\n readonly licences?: LicencesSkin\n readonly quoteChecklist?: QuoteChecklistSkin\n readonly emergencyBand?: EmergencyBandSkin\n}\n"]}
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
* about 200 px of the viewport, so a long page of suburb, footer and map links fetched 16 to 45 pages on a full scroll
|
|
4
4
|
* while visitors read 1.0 to 1.3 pages a session. Each link role now has one setting:
|
|
5
5
|
*
|
|
6
|
-
* - `auto` (Next's default): the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* - `false`: header panels, the drawer, the footer, area and suburb lists, nearby suburbs, area
|
|
12
|
-
* results, other services in this suburb and any link inside a hidden container.
|
|
6
|
+
* - `auto` (Next's default): the main quote or contact action only, and never on its own page;
|
|
7
|
+
* - `intent`: the top-level header links (7 at most, 3.15.0) and in-content service, project and blog cards (8 at
|
|
8
|
+
* most, matching K11). They render `prefetch={false}` and `data-prefetch="intent"`; `IntentPrefetch` (mounted once
|
|
9
|
+
* in the root layout) prefetches one of them when a visitor points at, focuses or touches it. Until 3.15.0 the
|
|
10
|
+
* header links prefetched in view, which at 1440 px fetched 9 or 10 pages on landing (AA);
|
|
11
|
+
* - `false`: the header logo, header panels, the drawer, the footer, area and suburb lists, nearby suburbs, area
|
|
12
|
+
* maps, suburb finder results, other services in this suburb and any link inside a hidden container.
|
|
13
|
+
*
|
|
14
|
+
* The current page is never prefetched, whatever the role: a header link to it, and a quote button on its own quote
|
|
15
|
+
* page, render `prefetch={false}`, and a link to a place on the same page (`#quote-hero`, `?page=2`) never
|
|
16
|
+
* prefetches, because Next resolves it to the current page and fetches that.
|
|
13
17
|
*
|
|
14
18
|
* The ready gate's W2 journey fails a page that prefetches more than 8 destinations on landing or 12 after a full
|
|
15
19
|
* scroll, or prefetches from an off role, a hidden link or the current page. It finds a site's own off-role
|
|
@@ -19,7 +23,7 @@
|
|
|
19
23
|
/** A link's prefetch setting: Next's default, on intent only, or off. */
|
|
20
24
|
export type LinkPrefetch = 'auto' | 'intent' | false;
|
|
21
25
|
export declare const LINK_PREFETCH_POLICY: Readonly<{
|
|
22
|
-
readonly headerTopLevel: "
|
|
26
|
+
readonly headerTopLevel: "intent";
|
|
23
27
|
readonly primaryAction: "auto";
|
|
24
28
|
readonly contentCard: "intent";
|
|
25
29
|
readonly headerPanel: false;
|
|
@@ -42,8 +46,13 @@ export declare const LINK_PREFETCH_LIMITS: Readonly<{
|
|
|
42
46
|
}>;
|
|
43
47
|
/** The marker `IntentPrefetch` listens for. */
|
|
44
48
|
export declare const INTENT_PREFETCH_SELECTOR = "a[data-prefetch=\"intent\"]";
|
|
45
|
-
/**
|
|
46
|
-
export declare function
|
|
49
|
+
/** True for an href that stays on the current page: a fragment (`#quote-hero`), a query only (`?page=2`) or empty. */
|
|
50
|
+
export declare function isSamePageHref(href: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The `next/link` props for a setting: nothing for `auto`, prefetch off for `false`, and off plus the marker for
|
|
53
|
+
* `intent`. Given the `href`, a link that stays on the current page is always off, without the marker.
|
|
54
|
+
*/
|
|
55
|
+
export declare function linkPrefetchProps(prefetch: LinkPrefetch | undefined, href?: string): {
|
|
47
56
|
prefetch?: false;
|
|
48
57
|
'data-prefetch'?: 'intent';
|
|
49
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefetch.d.ts","sourceRoot":"","sources":["../../src/ui-kit/prefetch.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prefetch.d.ts","sourceRoot":"","sources":["../../src/ui-kit/prefetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,yEAAyE;AACzE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;AAEpD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;EAaiB,CAAA;AAElD,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,oBAAoB,CAAA;AAEhE,iFAAiF;AACjF,eAAO,MAAM,oBAAoB;;;;;EAK/B,CAAA;AAEF,+CAA+C;AAC/C,eAAO,MAAM,wBAAwB,gCAA8B,CAAA;AAEnE,sHAAsH;AACtH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC;IAAC,eAAe,CAAC,EAAE,QAAQ,CAAA;CAAE,CAKrI"}
|
package/dist/ui-kit/prefetch.js
CHANGED
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
* about 200 px of the viewport, so a long page of suburb, footer and map links fetched 16 to 45 pages on a full scroll
|
|
4
4
|
* while visitors read 1.0 to 1.3 pages a session. Each link role now has one setting:
|
|
5
5
|
*
|
|
6
|
-
* - `auto` (Next's default): the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* - `false`: header panels, the drawer, the footer, area and suburb lists, nearby suburbs, area
|
|
12
|
-
* results, other services in this suburb and any link inside a hidden container.
|
|
6
|
+
* - `auto` (Next's default): the main quote or contact action only, and never on its own page;
|
|
7
|
+
* - `intent`: the top-level header links (7 at most, 3.15.0) and in-content service, project and blog cards (8 at
|
|
8
|
+
* most, matching K11). They render `prefetch={false}` and `data-prefetch="intent"`; `IntentPrefetch` (mounted once
|
|
9
|
+
* in the root layout) prefetches one of them when a visitor points at, focuses or touches it. Until 3.15.0 the
|
|
10
|
+
* header links prefetched in view, which at 1440 px fetched 9 or 10 pages on landing (AA);
|
|
11
|
+
* - `false`: the header logo, header panels, the drawer, the footer, area and suburb lists, nearby suburbs, area
|
|
12
|
+
* maps, suburb finder results, other services in this suburb and any link inside a hidden container.
|
|
13
|
+
*
|
|
14
|
+
* The current page is never prefetched, whatever the role: a header link to it, and a quote button on its own quote
|
|
15
|
+
* page, render `prefetch={false}`, and a link to a place on the same page (`#quote-hero`, `?page=2`) never
|
|
16
|
+
* prefetches, because Next resolves it to the current page and fetches that.
|
|
13
17
|
*
|
|
14
18
|
* The ready gate's W2 journey fails a page that prefetches more than 8 destinations on landing or 12 after a full
|
|
15
19
|
* scroll, or prefetches from an off role, a hidden link or the current page. It finds a site's own off-role
|
|
@@ -17,7 +21,7 @@
|
|
|
17
21
|
* `data-bl-links` with one of `area`, `nearby`, `map`, `finder` or `other-services` on the list's container.
|
|
18
22
|
*/
|
|
19
23
|
export const LINK_PREFETCH_POLICY = Object.freeze({
|
|
20
|
-
headerTopLevel: '
|
|
24
|
+
headerTopLevel: 'intent',
|
|
21
25
|
primaryAction: 'auto',
|
|
22
26
|
contentCard: 'intent',
|
|
23
27
|
headerPanel: false,
|
|
@@ -39,8 +43,17 @@ export const LINK_PREFETCH_LIMITS = Object.freeze({
|
|
|
39
43
|
});
|
|
40
44
|
/** The marker `IntentPrefetch` listens for. */
|
|
41
45
|
export const INTENT_PREFETCH_SELECTOR = 'a[data-prefetch="intent"]';
|
|
42
|
-
/**
|
|
43
|
-
export function
|
|
46
|
+
/** True for an href that stays on the current page: a fragment (`#quote-hero`), a query only (`?page=2`) or empty. */
|
|
47
|
+
export function isSamePageHref(href) {
|
|
48
|
+
return href === '' || href.startsWith('#') || href.startsWith('?');
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The `next/link` props for a setting: nothing for `auto`, prefetch off for `false`, and off plus the marker for
|
|
52
|
+
* `intent`. Given the `href`, a link that stays on the current page is always off, without the marker.
|
|
53
|
+
*/
|
|
54
|
+
export function linkPrefetchProps(prefetch, href) {
|
|
55
|
+
if (href !== undefined && isSamePageHref(href))
|
|
56
|
+
return { prefetch: false };
|
|
44
57
|
if (prefetch === 'intent')
|
|
45
58
|
return { prefetch: false, 'data-prefetch': 'intent' };
|
|
46
59
|
if (prefetch === false)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefetch.js","sourceRoot":"","sources":["../../src/ui-kit/prefetch.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prefetch.js","sourceRoot":"","sources":["../../src/ui-kit/prefetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,cAAc,EAAE,QAAQ;IACxB,aAAa,EAAE,MAAM;IACrB,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,KAAK;IAClB,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,KAAK;IACf,aAAa,EAAE,KAAK;IACpB,OAAO,EAAE,KAAK;IACd,aAAa,EAAE,KAAK;IACpB,qBAAqB,EAAE,KAAK;IAC5B,eAAe,EAAE,KAAK;CACyB,CAAC,CAAA;AAIlD,iFAAiF;AACjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,cAAc,EAAE,CAAC;IACjB,WAAW,EAAE,CAAC;IACd,mBAAmB,EAAE,CAAC;IACtB,oBAAoB,EAAE,EAAE;CACzB,CAAC,CAAA;AAEF,+CAA+C;AAC/C,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAA;AAEnE,sHAAsH;AACtH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI,KAAK,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AACpE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAkC,EAAE,IAAa;IACjF,IAAI,IAAI,KAAK,SAAS,IAAI,cAAc,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;IAC1E,IAAI,QAAQ,KAAK,QAAQ;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAA;IAChF,IAAI,QAAQ,KAAK,KAAK;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;IAClD,OAAO,EAAE,CAAA;AACX,CAAC","sourcesContent":["/**\n * Prefetch by link role (W2, 3.13.0). Next's default `<Link>` prefetches the whole route when the link comes within\n * about 200 px of the viewport, so a long page of suburb, footer and map links fetched 16 to 45 pages on a full scroll\n * while visitors read 1.0 to 1.3 pages a session. Each link role now has one setting:\n *\n * - `auto` (Next's default): the main quote or contact action only, and never on its own page;\n * - `intent`: the top-level header links (7 at most, 3.15.0) and in-content service, project and blog cards (8 at\n * most, matching K11). They render `prefetch={false}` and `data-prefetch=\"intent\"`; `IntentPrefetch` (mounted once\n * in the root layout) prefetches one of them when a visitor points at, focuses or touches it. Until 3.15.0 the\n * header links prefetched in view, which at 1440 px fetched 9 or 10 pages on landing (AA);\n * - `false`: the header logo, header panels, the drawer, the footer, area and suburb lists, nearby suburbs, area\n * maps, suburb finder results, other services in this suburb and any link inside a hidden container.\n *\n * The current page is never prefetched, whatever the role: a header link to it, and a quote button on its own quote\n * page, render `prefetch={false}`, and a link to a place on the same page (`#quote-hero`, `?page=2`) never\n * prefetches, because Next resolves it to the current page and fetches that.\n *\n * The ready gate's W2 journey fails a page that prefetches more than 8 destinations on landing or 12 after a full\n * scroll, or prefetches from an off role, a hidden link or the current page. It finds a site's own off-role\n * containers by the shared section ids (`coverage`, `nearby-areas`, `area-map`), the area map's `data-area-map` or\n * `data-bl-links` with one of `area`, `nearby`, `map`, `finder` or `other-services` on the list's container.\n */\n\n/** A link's prefetch setting: Next's default, on intent only, or off. */\nexport type LinkPrefetch = 'auto' | 'intent' | false\n\nexport const LINK_PREFETCH_POLICY = Object.freeze({\n headerTopLevel: 'intent',\n primaryAction: 'auto',\n contentCard: 'intent',\n headerPanel: false,\n drawer: false,\n footer: false,\n areaList: false,\n nearbySuburbs: false,\n areaMap: false,\n finderResults: false,\n otherServicesInSuburb: false,\n hiddenContainer: false,\n} as const satisfies Record<string, LinkPrefetch>)\n\nexport type LinkPrefetchRole = keyof typeof LINK_PREFETCH_POLICY\n\n/** The most links of each prefetching role on one page, and W2's page limits. */\nexport const LINK_PREFETCH_LIMITS = Object.freeze({\n headerTopLevel: 7,\n contentCard: 8,\n landingDestinations: 8,\n scrolledDestinations: 12,\n})\n\n/** The marker `IntentPrefetch` listens for. */\nexport const INTENT_PREFETCH_SELECTOR = 'a[data-prefetch=\"intent\"]'\n\n/** True for an href that stays on the current page: a fragment (`#quote-hero`), a query only (`?page=2`) or empty. */\nexport function isSamePageHref(href: string): boolean {\n return href === '' || href.startsWith('#') || href.startsWith('?')\n}\n\n/**\n * The `next/link` props for a setting: nothing for `auto`, prefetch off for `false`, and off plus the marker for\n * `intent`. Given the `href`, a link that stays on the current page is always off, without the marker.\n */\nexport function linkPrefetchProps(prefetch: LinkPrefetch | undefined, href?: string): { prefetch?: false; 'data-prefetch'?: 'intent' } {\n if (href !== undefined && isSamePageHref(href)) return { prefetch: false }\n if (prefetch === 'intent') return { prefetch: false, 'data-prefetch': 'intent' }\n if (prefetch === false) return { prefetch: false }\n return {}\n}\n"]}
|
|
@@ -4,7 +4,7 @@ export { Button, type ButtonProps, type ButtonSkin, type ButtonSlot } from './bu
|
|
|
4
4
|
export { Card, type CardLayout, type CardProps, type CardSkin, type CardSlot } from './card.js';
|
|
5
5
|
export { Badge, Chip, type BadgeProps, type BadgeSkin, type BadgeSlot, type ChipProps, type ChipSkin, type ChipSlot } from './badge.js';
|
|
6
6
|
export { Stat, type StatProps, type StatSkin, type StatSlot } from './stat.js';
|
|
7
|
-
export { LINK_LIST_KINDS, LinkList, TickList, type LinkListKind, type LinkListLayout, type LinkListProps, type LinkListSkin, type LinkListSlot, type TickItem, type TickListLayout, type TickListProps, type TickListRepeatedSlot, type TickListSkin, type TickListSlot, } from './lists.js';
|
|
7
|
+
export { LINK_LIST_KINDS, LinkList, TickList, type LinkListKind, type LinkListLayout, type LinkListEntry, type LinkListProps, type LinkListSkin, type LinkListSlot, type TickItem, type TickListLayout, type TickListProps, type TickListRepeatedSlot, type TickListSkin, type TickListSlot, } from './lists.js';
|
|
8
8
|
export { ILLUSTRATION_LABEL, MediaFrame, type MediaFrameProps, type MediaFrameSizing, type MediaFrameSkin, type MediaFrameSlot, type UiMedia, } from './media-frame.js';
|
|
9
9
|
export { MEDIA_ILLUSTRATION_LABEL, Media, type MediaLayout, type MediaProps, type MediaSkin, type MediaSlot } from './media.js';
|
|
10
10
|
export { BREADCRUMBS_LABEL, Breadcrumbs, breadcrumbsSchema, type BreadcrumbTrail, type BreadcrumbsProps, type BreadcrumbsRepeatedSlot, type BreadcrumbsSkin, type BreadcrumbsSlot, } from './breadcrumbs.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,SAAS,EACT,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,cAAc,EACd,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AACxF,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC/F,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EA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AAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1G,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,SAAS,EACT,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,cAAc,EACd,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AACxF,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC/F,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAA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AAO,EAAE,eAAe,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1G,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui-kit/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,SAAS,EACT,QAAQ,GAWT,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,cAAc,EACd,cAAc,GAWf,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,MAAM,EAAsD,MAAM,aAAa,CAAA;AACxF,OAAO,EAAE,IAAI,EAAiE,MAAM,WAAW,CAAA;AAC/F,OAAO,EAAE,KAAK,EAAE,IAAI,EAAiG,MAAM,YAAY,CAAA;AACvI,OAAO,EAAE,IAAI,EAAgD,MAAM,WAAW,CAAA;AAC9E,OAAO,EACL,eAAe,EACf,QAAQ,EACR,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui-kit/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,SAAS,EACT,QAAQ,GAWT,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,cAAc,EACd,cAAc,GAWf,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,MAAM,EAAsD,MAAM,aAAa,CAAA;AACxF,OAAO,EAAE,IAAI,EAAiE,MAAM,WAAW,CAAA;AAC/F,OAAO,EAAE,KAAK,EAAE,IAAI,EAAiG,MAAM,YAAY,CAAA;AACvI,OAAO,EAAE,IAAI,EAAgD,MAAM,WAAW,CAAA;AAC9E,OAAO,EACL,eAAe,EACf,QAAQ,EACR,QAAQ,GAaT,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,kBAAkB,EAClB,UAAU,GAMX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,wBAAwB,EAAE,KAAK,EAAqE,MAAM,YAAY,CAAA;AAC/H,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,iBAAiB,GAMlB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,WAAW,EAAqE,MAAM,mBAAmB,CAAA;AAClH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAmC,MAAM,aAAa,CAAA;AAC9H,OAAO,EAAE,eAAe,EAAoC,MAAM,mBAAmB,CAAA;AACrF,OAAO,EAAE,eAAe,EAA+D,MAAM,aAAa,CAAA;AAC1G,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,GAGlB,MAAM,gBAAgB,CAAA","sourcesContent":["export {\n BUTTON_VARIANTS,\n ButtonLink,\n PhoneLink,\n TextLink,\n type ButtonLinkProps,\n type ButtonLinkSkin,\n type ButtonLinkSlot,\n type ButtonVariant,\n type PhoneLinkProps,\n type PhoneLinkSkin,\n type PhoneLinkSlot,\n type TextLinkProps,\n type TextLinkSkin,\n type TextLinkSlot,\n} from './links.js'\nexport {\n CONTAINER_WIDTHS,\n Container,\n Eyebrow,\n RatingStars,\n SECTION_TONES,\n Section,\n SectionHeading,\n VisuallyHidden,\n type ContainerSkin,\n type ContainerWidth,\n type EyebrowSkin,\n type EyebrowSlot,\n type SectionHeadingProps,\n type SectionHeadingSkin,\n type SectionHeadingSlot,\n type SectionProps,\n type SectionSlot,\n type SectionTone,\n} from './layout.js'\nexport { Button, type ButtonProps, type ButtonSkin, type ButtonSlot } from './button.js'\nexport { Card, type CardLayout, type CardProps, type CardSkin, type CardSlot } from './card.js'\nexport { Badge, Chip, type BadgeProps, type BadgeSkin, type BadgeSlot, type ChipProps, type ChipSkin, type ChipSlot } from './badge.js'\nexport { Stat, type StatProps, type StatSkin, type StatSlot } from './stat.js'\nexport {\n LINK_LIST_KINDS,\n LinkList,\n TickList,\n type LinkListKind,\n type LinkListLayout,\n type LinkListEntry,\n type LinkListProps,\n type LinkListSkin,\n type LinkListSlot,\n type TickItem,\n type TickListLayout,\n type TickListProps,\n type TickListRepeatedSlot,\n type TickListSkin,\n type TickListSlot,\n} from './lists.js'\nexport {\n ILLUSTRATION_LABEL,\n MediaFrame,\n type MediaFrameProps,\n type MediaFrameSizing,\n type MediaFrameSkin,\n type MediaFrameSlot,\n type UiMedia,\n} from './media-frame.js'\nexport { MEDIA_ILLUSTRATION_LABEL, Media, type MediaLayout, type MediaProps, type MediaSkin, type MediaSlot } from './media.js'\nexport {\n BREADCRUMBS_LABEL,\n Breadcrumbs,\n breadcrumbsSchema,\n type BreadcrumbTrail,\n type BreadcrumbsProps,\n type BreadcrumbsRepeatedSlot,\n type BreadcrumbsSkin,\n type BreadcrumbsSlot,\n} from './breadcrumbs.js'\nexport { QuoteButton, type QuoteButtonProps, type QuoteButtonSkin, type QuoteButtonSlot } from './quote-button.js'\nexport { Icon, SocialIcon, UI_ICON_NAMES, createSiteIcon, iconSpriteHref, type IconProps, type UiIconName } from '../icons.js'\nexport { defineSiteIcons, type IconGlyph, type SiteIconSet } from '../icon-glyphs.js'\nexport { UI_SOCIAL_KINDS, type UiLink, type UiPhone, type UiSocial, type UiSocialKind } from '../types.js'\nexport {\n INTENT_PREFETCH_SELECTOR,\n LINK_PREFETCH_LIMITS,\n LINK_PREFETCH_POLICY,\n linkPrefetchProps,\n type LinkPrefetch,\n type LinkPrefetchRole,\n} from '../prefetch.js'\n"]}
|
|
@@ -19,7 +19,7 @@ export function Anchor({ href, external, prefetch, hooks, children, }) {
|
|
|
19
19
|
if (external ?? isExternal(href)) {
|
|
20
20
|
return (_jsx("a", { href: href, target: "_blank", rel: "noopener noreferrer", ...hooks, children: children }));
|
|
21
21
|
}
|
|
22
|
-
return (_jsx(Link, { href: href, ...linkPrefetchProps(prefetch), ...hooks, children: children }));
|
|
22
|
+
return (_jsx(Link, { href: href, ...linkPrefetchProps(prefetch, href), ...hooks, children: children }));
|
|
23
23
|
}
|
|
24
24
|
export const BUTTON_VARIANTS = ['primary', 'secondary', 'quiet'];
|
|
25
25
|
/** A link styled as a button. A primary action is at least 44 px tall (structure.css). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.js","sourceRoot":"","sources":["../../../src/ui-kit/primitives/links.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,OAAO,IAAI,MAAM,WAAW,CAAA;AAG5B,OAAO,EAAE,IAAI,EAAmB,MAAM,aAAa,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAqB,MAAM,gBAAgB,CAAA;AACrE,OAAO,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAGjD,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC;AAKD;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,QAAQ,GAOT;IACC,IAAI,QAAQ,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,OAAO,CACL,YAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,KAAK,KAAK,YAC/D,QAAQ,GACP,CACL,CAAA;IACH,CAAC;IACD,OAAO,CACL,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,KAAM,iBAAiB,CAAC,QAAQ,CAAC,KAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"links.js","sourceRoot":"","sources":["../../../src/ui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AAC,CACV,kBAAU,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,YAC7B,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GAChB,CACR,CAAC,CAAC,CAAC,IAAI,EACP,KAAK,CAAC,CAAC,CAAC,CACP,8BACE,kBAAU,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,YAAG,KAAK,GAAQ,EAAC,GAAG,IACnD,CACJ,CAAC,CAAC,CAAC,IAAI,EACR,kBAAU,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,YAAG,KAAK,CAAC,OAAO,GAAQ,IACvD,CACL,CAAA;AACH,CAAC","sourcesContent":["/**\n * Link primitives: `ButtonLink`, `TextLink` and `PhoneLink`. Server components; every link is a real `<a href>`.\n * External links open in a new tab with `rel=\"noopener noreferrer\"`. `PhoneLink` requires a typed placement, which the\n * shared instrumentation reads to send one `phone_link_click` per tap; nothing here emits events itself.\n */\nimport Link from 'next/link'\nimport type { ReactNode } from 'react'\nimport type { PhoneCallPlacement } from '../../analytics.js'\nimport { Icon, type UiIconName } from '../icons.js'\nimport { linkPrefetchProps, type LinkPrefetch } from '../prefetch.js'\nimport { slot, type SkinEntry } from '../skin.js'\nimport type { UiPhone } from '../types.js'\n\nfunction isExternal(href: string) {\n return /^https?:\\/\\//i.test(href)\n}\n\n/** Data hooks and the skin class for an anchor's root. */\nexport type AnchorHooks = { readonly className?: string | undefined } & Readonly<Record<`data-${string}`, string | undefined>>\n\n/**\n * The one anchor every ui-kit link renders (internal; not exported from the subpath): `next/link` with the prefetch\n * role for internal links, a plain `<a target=\"_blank\" rel=\"noopener noreferrer\">` for external ones.\n */\nexport function Anchor({\n href,\n external,\n prefetch,\n hooks,\n children,\n}: {\n href: string\n external?: boolean | undefined\n prefetch?: LinkPrefetch | undefined\n hooks: AnchorHooks\n children: ReactNode\n}) {\n if (external ?? isExternal(href)) {\n return (\n <a href={href} target=\"_blank\" rel=\"noopener noreferrer\" {...hooks}>\n {children}\n </a>\n )\n }\n return (\n <Link href={href} {...linkPrefetchProps(prefetch, href)} {...hooks}>\n {children}\n </Link>\n )\n}\n\nexport type ButtonLinkSlot = 'root' | 'label' | 'icon'\nexport const BUTTON_VARIANTS = ['primary', 'secondary', 'quiet'] as const\nexport type ButtonVariant = (typeof BUTTON_VARIANTS)[number]\nexport type ButtonLinkSkin = SkinEntry<ButtonLinkSlot, ButtonVariant, { size?: 'regular' | 'large' }>\n\nexport interface ButtonLinkProps extends ButtonLinkSkin {\n readonly href: string\n readonly children: ReactNode\n /** An icon after the label (`arrow`) or before it (`phone`). */\n readonly icon?: UiIconName\n readonly iconPosition?: 'start' | 'end'\n /** Force external handling; by default `http(s)://` links are external. */\n readonly external?: boolean\n /**\n * Prefetch by link role (`LINK_PREFETCH_POLICY`): `auto` (the default, Next's prefetch in view) for a main action,\n * `intent` for an in-content card link, `false` for footer, area, nearby, map and finder links.\n */\n readonly prefetch?: LinkPrefetch\n}\n\n/** A link styled as a button. A primary action is at least 44 px tall (structure.css). */\nexport function ButtonLink({ href, children, icon, iconPosition = 'end', external, prefetch, variant = 'primary', layout, classes }: ButtonLinkProps) {\n const iconNode = icon ? <span {...slot(classes, 'icon')}><Icon name={icon} /></span> : null\n return (\n <Anchor\n href={href}\n external={external}\n prefetch={prefetch}\n hooks={{ 'data-bl': 'button', 'data-variant': variant, 'data-size': layout?.size ?? 'regular', className: classes?.root }}\n >\n {iconPosition === 'start' ? iconNode : null}\n <span {...slot(classes, 'label')}>{children}</span>\n {iconPosition === 'end' ? iconNode : null}\n </Anchor>\n )\n}\n\nexport type TextLinkSlot = 'root'\nexport type TextLinkSkin = SkinEntry<TextLinkSlot, 'inline' | 'standalone'>\n\nexport interface TextLinkProps extends TextLinkSkin {\n readonly href: string\n readonly children: ReactNode\n readonly external?: boolean\n /**\n * Prefetch by link role (`LINK_PREFETCH_POLICY`): `auto` (the default, Next's prefetch in view) for a main action,\n * `intent` for an in-content card link, `false` for footer, area, nearby, map and finder links.\n */\n readonly prefetch?: LinkPrefetch\n}\n\n/** An inline or standalone text link. */\nexport function TextLink({ href, children, external, prefetch, variant = 'inline', classes }: TextLinkProps) {\n return (\n <Anchor href={href} external={external} prefetch={prefetch} hooks={{ 'data-bl': 'text-link', 'data-variant': variant, className: classes?.root }}>\n {children}\n </Anchor>\n )\n}\n\nexport type PhoneLinkSlot = 'root' | 'icon' | 'label' | 'number'\nexport type PhoneLinkSkin = SkinEntry<PhoneLinkSlot, 'text' | 'button'>\n\nexport interface PhoneLinkProps extends PhoneLinkSkin {\n readonly phone: UiPhone\n /** Where the link sits, for `phone_link_click`. Required: a section sets its own. */\n readonly placement: PhoneCallPlacement\n /** Optional words before the number, for example \"Call\". The accessible name is always the visible text. */\n readonly label?: string\n /** The phone icon on the left (header and hero). */\n readonly showIcon?: boolean\n}\n\n/**\n * A `tel:` link. Its accessible name is its visible text, which always includes the number (WCAG 2.5.3). Use it for\n * every call link: a literal `tel:` anywhere else fails lint (K1) and C10 checks the href against the evidence file.\n */\nexport function PhoneLink({ phone, placement, label, showIcon = false, variant = 'text', classes }: PhoneLinkProps) {\n return (\n <a href={phone.telHref} data-bl=\"phone-link\" data-variant={variant} data-phone-location={placement} className={classes?.root}>\n {showIcon ? (\n <span {...slot(classes, 'icon')}>\n <Icon name=\"phone\" />\n </span>\n ) : null}\n {label ? (\n <>\n <span {...slot(classes, 'label')}>{label}</span>{' '}\n </>\n ) : null}\n <span {...slot(classes, 'number')}>{phone.display}</span>\n </a>\n )\n}\n"]}
|
|
@@ -32,8 +32,16 @@ export interface LinkListLayout {
|
|
|
32
32
|
readonly columns?: 1 | 2 | 3 | 4;
|
|
33
33
|
}
|
|
34
34
|
export type LinkListSkin = SkinEntry<LinkListSlot, never, LinkListLayout>;
|
|
35
|
+
/**
|
|
36
|
+
* One entry: a link, or (3.15.0) a name with no `href`, rendered as plain text in the same list (`<li>Putney</li>`, no
|
|
37
|
+
* anchor), for an area whose page is still noindex while it waits for its return wave.
|
|
38
|
+
*/
|
|
39
|
+
export type LinkListEntry = UiLink | {
|
|
40
|
+
readonly label: string;
|
|
41
|
+
readonly href?: undefined;
|
|
42
|
+
};
|
|
35
43
|
export interface LinkListProps extends LinkListSkin {
|
|
36
|
-
readonly links: readonly
|
|
44
|
+
readonly links: readonly LinkListEntry[];
|
|
37
45
|
/** What the list holds, rendered as `data-bl-links` for W2. Leave it out for a list of other destinations. */
|
|
38
46
|
readonly kind?: LinkListKind;
|
|
39
47
|
/** Off by default; `intent` only for a short list of in-content destinations. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/primitives/lists.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,uEAAuE;AACvE,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEjF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAC9D,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAC7D,MAAM,WAAW,cAAc;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;IACxB;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAChC;AACD,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,oBAAoB,CAAC,CAAA;AAE/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iF;IACjF,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;CAClD;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,aAAa,kDAiBzF"}
|
|
@@ -29,6 +29,6 @@ export const LINK_LIST_KINDS = ['area', 'nearby', 'map', 'finder', 'other-servic
|
|
|
29
29
|
export function LinkList({ links, kind, prefetch = false, layout, classes }) {
|
|
30
30
|
if (links.length === 0)
|
|
31
31
|
return null;
|
|
32
|
-
return (_jsx("ul", { role: "list", "data-bl": "link-list", "data-columns": String(layout?.columns ?? 3), "data-bl-links": kind, className: classes?.root, children: links.map((link) => (_jsx("li", { children: _jsx(Anchor, { href: link.href, prefetch: prefetch, hooks: {}, children: link.label }) }, link.href))) }));
|
|
32
|
+
return (_jsx("ul", { role: "list", "data-bl": "link-list", "data-columns": String(layout?.columns ?? 3), "data-bl-links": kind, className: classes?.root, children: links.map((link) => link.href === undefined ? (_jsx("li", { children: link.label }, `text:${link.label}`)) : (_jsx("li", { children: _jsx(Anchor, { href: link.href, prefetch: prefetch, hooks: {}, children: link.label }) }, link.href))) }));
|
|
33
33
|
}
|
|
34
34
|
//# sourceMappingURL=lists.js.map
|