@brandlab-digital/site-next 3.17.1 → 3.19.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/contact/client-entry.d.ts +2 -1
- package/dist/contact/client-entry.d.ts.map +1 -1
- package/dist/contact/client-entry.js +1 -0
- package/dist/contact/client-entry.js.map +1 -1
- package/dist/contact/form-client.d.ts +12 -3
- package/dist/contact/form-client.d.ts.map +1 -1
- package/dist/contact/form-client.js +18 -2
- package/dist/contact/form-client.js.map +1 -1
- package/dist/contact/google-tag-navigate.d.ts +32 -0
- package/dist/contact/google-tag-navigate.d.ts.map +1 -0
- package/dist/contact/google-tag-navigate.js +72 -0
- package/dist/contact/google-tag-navigate.js.map +1 -0
- package/dist/next-config.d.ts +5 -0
- package/dist/next-config.d.ts.map +1 -1
- package/dist/next-config.js +6 -1
- package/dist/next-config.js.map +1 -1
- package/dist/ui-kit/form/quote-form.d.ts +6 -2
- package/dist/ui-kit/form/quote-form.d.ts.map +1 -1
- package/dist/ui-kit/form/quote-form.js +6 -3
- package/dist/ui-kit/form/quote-form.js.map +1 -1
- package/dist/ui-kit/primitives/media-frame.d.ts +5 -0
- package/dist/ui-kit/primitives/media-frame.d.ts.map +1 -1
- package/dist/ui-kit/primitives/media-frame.js +5 -2
- package/dist/ui-kit/primitives/media-frame.js.map +1 -1
- package/dist/ui-kit/primitives/media.d.ts +2 -0
- package/dist/ui-kit/primitives/media.d.ts.map +1 -1
- package/dist/ui-kit/primitives/media.js +1 -1
- package/dist/ui-kit/primitives/media.js.map +1 -1
- package/dist/ui-kit/repeated-slots.d.ts +1 -1
- package/dist/ui-kit/repeated-slots.js +1 -1
- package/dist/ui-kit/repeated-slots.js.map +1 -1
- 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/licences.d.ts +23 -0
- package/dist/ui-kit/sections/licences.d.ts.map +1 -1
- package/dist/ui-kit/sections/licences.js +29 -3
- package/dist/ui-kit/sections/licences.js.map +1 -1
- package/package.json +2 -2
|
@@ -17,6 +17,8 @@ export type MediaSlot = 'root' | 'img' | 'caption' | 'label';
|
|
|
17
17
|
export interface MediaLayout {
|
|
18
18
|
/** Crop to one of the allowed ratios (16:9, 4:5, 4:3, 3:2). Left out, the image keeps its own shape. */
|
|
19
19
|
readonly ratio?: BrandlabMediaRatio;
|
|
20
|
+
/** The WebP quality, 1 to 100 (3.18.0), for example a page header photo over B1's budget; see `MediaFrame`. */
|
|
21
|
+
readonly imageQuality?: number;
|
|
20
22
|
}
|
|
21
23
|
export type MediaSkin = SkinEntry<MediaSlot, never, MediaLayout>;
|
|
22
24
|
/** The visible label on an AI image (F13). Locked: a site can't rename or hide it. The same value as `ILLUSTRATION_LABEL`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/primitives/media.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC/F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG3C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAA;AAC5D,MAAM,WAAW,WAAW;IAC1B,wGAAwG;IACxG,QAAQ,CAAC,KAAK,CAAC,EAAE,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/primitives/media.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC/F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG3C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAA;AAC5D,MAAM,WAAW,WAAW;IAC1B,wGAAwG;IACxG,QAAQ,CAAC,KAAK,CAAC,EAAE,kBAAkB,CAAA;IACnC,+GAA+G;IAC/G,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAC/B;AACD,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,KAAK,EAAE,WAAW,CAAC,CAAA;AAEhE,8HAA8H;AAC9H,eAAO,MAAM,wBAAwB,iBAAqB,CAAA;AAE1D,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAA;IAClC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IAC/B,mFAAmF;IACnF,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAA;CAC7B;AAED,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAe,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,UAAU,2CAK5F"}
|
|
@@ -4,6 +4,6 @@ import { ILLUSTRATION_LABEL, MediaFrame } from './media-frame.js';
|
|
|
4
4
|
export const MEDIA_ILLUSTRATION_LABEL = ILLUSTRATION_LABEL;
|
|
5
5
|
export function Media({ media, sizes, preload = false, caption, layout, classes }) {
|
|
6
6
|
const sizing = typeof sizes === 'number' ? { displayWidth: sizes } : { sizes };
|
|
7
|
-
return (_jsx(MediaFrame, { media: media, ...sizing, ratio: layout?.ratio, caption: caption, priority: preload, classes: classes }));
|
|
7
|
+
return (_jsx(MediaFrame, { media: media, ...sizing, ratio: layout?.ratio, quality: layout?.imageQuality, caption: caption, priority: preload, classes: classes }));
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=media.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../src/ui-kit/primitives/media.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../src/ui-kit/primitives/media.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAWjE,8HAA8H;AAC9H,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAA;AAgB1D,MAAM,UAAU,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAc;IAC3F,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAA;IAC9E,OAAO,CACL,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,KAAM,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAI,CACrJ,CAAA;AACH,CAAC","sourcesContent":["/**\n * `Media` (F13, 3.14.0): one image from the site's media manifest (`src/data/media.ts`, `defineMedia`), rendered through\n * `MediaFrame`, the library's one image path. Server component. It takes a skin entry with `layout.ratio`, which the\n * services grid uses for its photos; everything else (provenance, the locked \"Illustration\" label, the focal point\n * and the sizing rule) is `MediaFrame`'s.\n *\n * - `sizes` is required. A number is a fixed CSS width (logos, avatars, thumbnails, the header's featured image): it\n * becomes `MediaFrame`'s `displayWidth`, so the image renders no `sizes` and Next emits only the 1x and 2x candidates\n * (cost item 1g). A string is a fluid `sizes` value and must have a `vw` part.\n * - `preload` is for the page's main (hero) image only: preloaded at high priority and never lazy.\n * - `layout.ratio` crops to one of the allowed ratios, keeping the entry's focal point in view.\n */\nimport type { ReactNode } from 'react'\nimport type { BrandlabMediaEntry, BrandlabMediaRatio } from '@brandlab-digital/site-core/media'\nimport type { SkinEntry } from '../skin.js'\nimport { ILLUSTRATION_LABEL, MediaFrame } from './media-frame.js'\n\nexport type MediaSlot = 'root' | 'img' | 'caption' | 'label'\nexport interface MediaLayout {\n /** Crop to one of the allowed ratios (16:9, 4:5, 4:3, 3:2). Left out, the image keeps its own shape. */\n readonly ratio?: BrandlabMediaRatio\n /** The WebP quality, 1 to 100 (3.18.0), for example a page header photo over B1's budget; see `MediaFrame`. */\n readonly imageQuality?: number\n}\nexport type MediaSkin = SkinEntry<MediaSlot, never, MediaLayout>\n\n/** The visible label on an AI image (F13). Locked: a site can't rename or hide it. The same value as `ILLUSTRATION_LABEL`. */\nexport const MEDIA_ILLUSTRATION_LABEL = ILLUSTRATION_LABEL\n\nexport interface MediaProps extends MediaSkin {\n /** The manifest entry, for example `media['castle-hill-gum-removal']`. */\n readonly media: BrandlabMediaEntry\n /**\n * The rendered width: a whole number of CSS pixels for a fixed-size image (no `sizes`, so 1x and 2x only), or a\n * fluid `sizes` string with a `vw` part such as `(min-width: 1024px) 50vw, 100vw`.\n */\n readonly sizes: number | string\n /** The page's main image: preloaded at high priority, never lazy. One per page. */\n readonly preload?: boolean\n /** A visible caption, for example \"Gum removal over a pool, Epping, March 2026\". */\n readonly caption?: ReactNode\n}\n\nexport function Media({ media, sizes, preload = false, caption, layout, classes }: MediaProps) {\n const sizing = typeof sizes === 'number' ? { displayWidth: sizes } : { sizes }\n return (\n <MediaFrame media={media} {...sizing} ratio={layout?.ratio} quality={layout?.imageQuality} caption={caption} priority={preload} classes={classes} />\n )\n}\n"]}
|
|
@@ -101,7 +101,7 @@ export declare const REPEATED_SLOTS: {
|
|
|
101
101
|
};
|
|
102
102
|
readonly licences: {
|
|
103
103
|
readonly scope: "[data-bl-section=\"licences\"] [data-slot=\"list\"]";
|
|
104
|
-
readonly slots: readonly ["row", "label", "value", "number", "holder", "classes", "class", "register", "cover", "amount"];
|
|
104
|
+
readonly slots: readonly ["row", "label", "value", "number", "holder", "classes", "class", "register", "cover", "amount", "date", "abn", "lookup"];
|
|
105
105
|
};
|
|
106
106
|
readonly thankYou: {
|
|
107
107
|
readonly scope: "[data-bl=\"thank-you\"]";
|
|
@@ -77,7 +77,7 @@ export const REPEATED_SLOTS = {
|
|
|
77
77
|
beforeAfter: { scope: '[data-bl-section="before-after"] [data-slot="list"]', slots: ['pair', 'frames', 'frame', 'note'] },
|
|
78
78
|
licences: {
|
|
79
79
|
scope: '[data-bl-section="licences"] [data-slot="list"]',
|
|
80
|
-
slots: ['row', 'label', 'value', 'number', 'holder', 'classes', 'class', 'register', 'cover', 'amount'],
|
|
80
|
+
slots: ['row', 'label', 'value', 'number', 'holder', 'classes', 'class', 'register', 'cover', 'amount', 'date', 'abn', 'lookup'],
|
|
81
81
|
},
|
|
82
82
|
thankYou: { scope: '[data-bl="thank-you"]', slots: ['step'] },
|
|
83
83
|
photoUpload: { scope: '[data-bl="photo-upload"]', slots: ['photo', 'thumb', 'remove'] },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repeated-slots.js","sourceRoot":"","sources":["../../src/ui-kit/repeated-slots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE;QACV,KAAK,EAAE,uCAAuC;QAC9C,KAAK,EAAE;YACL,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO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,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;IAC9F,KAAK,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IAC/D,IAAI,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IAC7D,IAAI,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE;IACtE,QAAQ,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;IACrF,mGAAmG;IACnG,QAAQ,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE;CACxG,CAAA;AAMV,sHAAsH;AACtH,MAAM,UAAU,oBAAoB,CAA0C,SAAoB,EAAE,IAA+B;IACjI,MAAM,KAAK,GAAkF,cAAc,CAAC,SAAS,CAAC,CAAA;IACtH,OAAO,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,eAAe,IAAI,IAAI,EAAE,CAAA;AAC3E,CAAC","sourcesContent":["/**\n * The repeated slots of every shared component (3.14.0): the parts a component renders once per entry of a list in\n * its data. They carry their `data-slot` hook and never a class, so a long class string is not repeated in the HTML and\n * the RSC payload for every link, review, star, card or chip. A site styles them once in `src/site/skin.css`:\n *\n * ```css\n * @layer components {\n * [data-bl=\"footer\"] [data-slot=\"link\"] { @apply text-sm text-white/80 hover:text-white; }\n * [data-bl=\"header\"] [data-slot=\"list\"] [data-slot=\"panelLink\"] { padding: 0.5rem 0.75rem; }\n * }\n * ```\n *\n * `scope` is the selector that holds the repeated slots without reaching a nested component that reuses a slot name\n * (the drawer sits inside the header; the rating chip inside the reviews band uses `stars` too).\n * `repeatedSlotSelector()` joins the two. Pure data: safe to import anywhere.\n */\nexport const REPEATED_SLOTS = {\n siteHeader: {\n scope: '[data-bl=\"header\"] [data-slot=\"list\"]',\n slots: [\n 'item', 'itemRow', 'link', 'trigger', 'panel', 'panelBody', 'panelList', 'panelGroup', 'panelHeading', 'panelLink',\n 'panelLabel', 'panelText', 'featured', 'featuredMedia', 'featuredLabel', 'featuredText',\n ],\n },\n mobileDrawer: {\n scope: '[data-bl=\"drawer\"]',\n slots: ['group', 'groupTrigger', 'groupLinks', 'groupLink', 'link', 'socialLink'],\n },\n utilityBar: { scope: '[data-bl=\"utility\"]', slots: ['item', 'licence', 'socialLink'] },\n siteFooter: {\n scope: '[data-bl=\"footer\"]',\n slots: ['licenceLink', 'socialLink', 'column', 'heading', 'toggle', 'list', 'link', 'policyLink'],\n },\n accordion: { scope: '[data-bl=\"accordion\"]', slots: ['item', 'summary', 'label', 'marker', 'content'] },\n faqs: {\n scope: '[data-bl-section=\"faqs\"] [data-slot=\"columns\"]',\n slots: ['column', 'group', 'subheading', 'accordion', 'item', 'summary', 'label', 'marker', 'content'],\n /** The nested accordion's root is its own component: `data-bl=\"accordion\"`, not a `data-slot`. */\n hooks: { accordion: '[data-bl=\"accordion\"]' },\n },\n priceTable: {\n scope: '[data-bl=\"price-table\"]',\n slots: ['row', 'job', 'cell', 'label', 'range', 'unit', 'gst', 'parts', 'part', 'includes', 'excludes'],\n },\n priceGuide: {\n scope: '[data-bl-section=\"price-guide\"]',\n slots: [\n 'row', 'job', 'cell', 'label', 'range', 'unit', 'gst', 'parts', 'part', 'includes', 'excludes', 'card', 'title',\n 'figures', 'band', 'factor', 'name', 'effect', 'detail',\n ],\n },\n proofStrip: {\n scope: '[data-bl-section=\"proof-strip\"] [data-slot=\"list\"]',\n slots: ['item', 'link', 'icon', 'stars', 'value', 'label', 'linkLabel'],\n },\n reviewsBand: {\n scope: '[data-bl-section=\"reviews\"] [data-slot=\"list\"]',\n slots: ['item', 'stars', 'quote', 'more', 'author', 'avatar', 'name', 'date'],\n },\n contactBlock: { scope: '[data-bl-section=\"contact\"] [data-slot=\"details\"]', slots: ['line', 'note'] },\n servicesGrid: {\n scope: '[data-bl-section=\"services\"] [data-slot=\"list\"]',\n slots: ['item', 'body', 'media', 'title', 'summary', 'points', 'point', 'action', 'link'],\n },\n breadcrumbs: { scope: '[data-bl=\"breadcrumbs\"]', slots: ['item', 'link', 'current'] },\n // Location sections (3.15.0). Their link lists are `LinkList`s, reached through `linkList` (`[data-bl=\"link-list\"]`).\n localFacts: { scope: '[data-bl-section=\"local-facts\"]', slots: ['fact', 'factSource', 'fee'] },\n councilRules: { scope: '[data-bl-section=\"council-rules\"]', slots: ['fee'] },\n nearbyJobs: { scope: '[data-bl-section=\"nearby-jobs\"] [data-slot=\"list\"]', slots: ['item', 'body', 'media', 'title', 'link', 'outcome', 'cue'] },\n coverage: { scope: '[data-bl-section=\"coverage\"] [data-slot=\"groups\"]', slots: ['group', 'groupHeading'] },\n relatedServices: {\n scope: '[data-bl-section=\"related-services\"] [data-slot=\"list\"]',\n slots: ['item', 'body', 'media', 'title', 'summary', 'link'],\n },\n // Proof sections (3.15.0). Their photos are nested `[data-bl=\"media\"]` frames; project cards are `[data-bl=\"card\"]`.\n gallery: { scope: '[data-bl-section=\"gallery\"] [data-slot=\"list\"]', slots: ['item', 'link'] },\n beforeAfter: { scope: '[data-bl-section=\"before-after\"] [data-slot=\"list\"]', slots: ['pair', 'frames', 'frame', 'note'] },\n licences: {\n scope: '[data-bl-section=\"licences\"] [data-slot=\"list\"]',\n slots: ['row', 'label', 'value', 'number', 'holder', 'classes', 'class', 'register', 'cover', 'amount'],\n },\n thankYou: { scope: '[data-bl=\"thank-you\"]', slots: ['step'] },\n photoUpload: { scope: '[data-bl=\"photo-upload\"]', slots: ['photo', 'thumb', 'remove'] },\n quoteForm: { scope: '[data-bl=\"quote-form\"] [data-bl=\"photo-upload\"]', slots: ['photo', 'thumb', 'remove'] },\n // Primitives rendered once per list entry (3.14.0): every part is repeated, the root included (style the root\n // through its own hook, `[data-bl=\"card\"]`).\n card: { scope: '[data-bl=\"card\"]', slots: ['media', 'body', 'title', 'link', 'text', 'meta'] },\n badge: { scope: '[data-bl=\"badge\"]', slots: ['icon', 'label'] },\n chip: { scope: '[data-bl=\"chip\"]', slots: ['icon', 'label'] },\n stat: { scope: '[data-bl=\"stat\"]', slots: ['value', 'label', 'link'] },\n tickList: { scope: '[data-bl=\"tick-list\"]', slots: ['item', 'tick', 'text', 'link'] },\n /** A lean list (cost item 1f): plain `<li><a>` entries with no `data-slot`, reached by element. */\n linkList: { scope: '[data-bl=\"link-list\"]', slots: ['item', 'link'], hooks: { item: '> li', link: '> li > a' } },\n} as const\n\nexport type RepeatedSlotComponent = keyof typeof REPEATED_SLOTS\n/** The repeated slots of one component, for example `RepeatedSlotOf<'siteFooter'>` is `'licenceLink' | … | 'policyLink'`. */\nexport type RepeatedSlotOf<Component extends RepeatedSlotComponent> = (typeof REPEATED_SLOTS)[Component]['slots'][number]\n\n/** The selector a skin stylesheet uses for one repeated slot, for example `[data-bl=\"footer\"] [data-slot=\"link\"]`. */\nexport function repeatedSlotSelector<Component extends RepeatedSlotComponent>(component: Component, slot: RepeatedSlotOf<Component>): string {\n const entry: { readonly scope: string; readonly hooks?: Readonly<Record<string, string>> } = REPEATED_SLOTS[component]\n return `${entry.scope} ${entry.hooks?.[slot] ?? `[data-slot=\"${slot}\"]`}`\n}\n"]}
|
|
1
|
+
{"version":3,"file":"repeated-slots.js","sourceRoot":"","sources":["../../src/ui-kit/repeated-slots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE;QACV,KAAK,EAAE,uCAAuC;QAC9C,KAAK,EAAE;YACL,M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AE,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;IAC9F,KAAK,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IAC/D,IAAI,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IAC7D,IAAI,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE;IACtE,QAAQ,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;IACrF,mGAAmG;IACnG,QAAQ,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE;CACxG,CAAA;AAMV,sHAAsH;AACtH,MAAM,UAAU,oBAAoB,CAA0C,SAAoB,EAAE,IAA+B;IACjI,MAAM,KAAK,GAAkF,cAAc,CAAC,SAAS,CAAC,CAAA;IACtH,OAAO,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,eAAe,IAAI,IAAI,EAAE,CAAA;AAC3E,CAAC","sourcesContent":["/**\n * The repeated slots of every shared component (3.14.0): the parts a component renders once per entry of a list in\n * its data. They carry their `data-slot` hook and never a class, so a long class string is not repeated in the HTML and\n * the RSC payload for every link, review, star, card or chip. A site styles them once in `src/site/skin.css`:\n *\n * ```css\n * @layer components {\n * [data-bl=\"footer\"] [data-slot=\"link\"] { @apply text-sm text-white/80 hover:text-white; }\n * [data-bl=\"header\"] [data-slot=\"list\"] [data-slot=\"panelLink\"] { padding: 0.5rem 0.75rem; }\n * }\n * ```\n *\n * `scope` is the selector that holds the repeated slots without reaching a nested component that reuses a slot name\n * (the drawer sits inside the header; the rating chip inside the reviews band uses `stars` too).\n * `repeatedSlotSelector()` joins the two. Pure data: safe to import anywhere.\n */\nexport const REPEATED_SLOTS = {\n siteHeader: {\n scope: '[data-bl=\"header\"] [data-slot=\"list\"]',\n slots: [\n 'item', 'itemRow', 'link', 'trigger', 'panel', 'panelBody', 'panelList', 'panelGroup', 'panelHeading', 'panelLink',\n 'panelLabel', 'panelText', 'featured', 'featuredMedia', 'featuredLabel', 'featuredText',\n ],\n },\n mobileDrawer: {\n scope: '[data-bl=\"drawer\"]',\n slots: ['group', 'groupTrigger', 'groupLinks', 'groupLink', 'link', 'socialLink'],\n },\n utilityBar: { scope: '[data-bl=\"utility\"]', slots: ['item', 'licence', 'socialLink'] },\n siteFooter: {\n scope: '[data-bl=\"footer\"]',\n slots: ['licenceLink', 'socialLink', 'column', 'heading', 'toggle', 'list', 'link', 'policyLink'],\n },\n accordion: { scope: '[data-bl=\"accordion\"]', slots: ['item', 'summary', 'label', 'marker', 'content'] },\n faqs: {\n scope: '[data-bl-section=\"faqs\"] [data-slot=\"columns\"]',\n slots: ['column', 'group', 'subheading', 'accordion', 'item', 'summary', 'label', 'marker', 'content'],\n /** The nested accordion's root is its own component: `data-bl=\"accordion\"`, not a `data-slot`. */\n hooks: { accordion: '[data-bl=\"accordion\"]' },\n },\n priceTable: {\n scope: '[data-bl=\"price-table\"]',\n slots: ['row', 'job', 'cell', 'label', 'range', 'unit', 'gst', 'parts', 'part', 'includes', 'excludes'],\n },\n priceGuide: {\n scope: '[data-bl-section=\"price-guide\"]',\n slots: [\n 'row', 'job', 'cell', 'label', 'range', 'unit', 'gst', 'parts', 'part', 'includes', 'excludes', 'card', 'title',\n 'figures', 'band', 'factor', 'name', 'effect', 'detail',\n ],\n },\n proofStrip: {\n scope: '[data-bl-section=\"proof-strip\"] [data-slot=\"list\"]',\n slots: ['item', 'link', 'icon', 'stars', 'value', 'label', 'linkLabel'],\n },\n reviewsBand: {\n scope: '[data-bl-section=\"reviews\"] [data-slot=\"list\"]',\n slots: ['item', 'stars', 'quote', 'more', 'author', 'avatar', 'name', 'date'],\n },\n contactBlock: { scope: '[data-bl-section=\"contact\"] [data-slot=\"details\"]', slots: ['line', 'note'] },\n servicesGrid: {\n scope: '[data-bl-section=\"services\"] [data-slot=\"list\"]',\n slots: ['item', 'body', 'media', 'title', 'summary', 'points', 'point', 'action', 'link'],\n },\n breadcrumbs: { scope: '[data-bl=\"breadcrumbs\"]', slots: ['item', 'link', 'current'] },\n // Location sections (3.15.0). Their link lists are `LinkList`s, reached through `linkList` (`[data-bl=\"link-list\"]`).\n localFacts: { scope: '[data-bl-section=\"local-facts\"]', slots: ['fact', 'factSource', 'fee'] },\n councilRules: { scope: '[data-bl-section=\"council-rules\"]', slots: ['fee'] },\n nearbyJobs: { scope: '[data-bl-section=\"nearby-jobs\"] [data-slot=\"list\"]', slots: ['item', 'body', 'media', 'title', 'link', 'outcome', 'cue'] },\n coverage: { scope: '[data-bl-section=\"coverage\"] [data-slot=\"groups\"]', slots: ['group', 'groupHeading'] },\n relatedServices: {\n scope: '[data-bl-section=\"related-services\"] [data-slot=\"list\"]',\n slots: ['item', 'body', 'media', 'title', 'summary', 'link'],\n },\n // Proof sections (3.15.0). Their photos are nested `[data-bl=\"media\"]` frames; project cards are `[data-bl=\"card\"]`.\n gallery: { scope: '[data-bl-section=\"gallery\"] [data-slot=\"list\"]', slots: ['item', 'link'] },\n beforeAfter: { scope: '[data-bl-section=\"before-after\"] [data-slot=\"list\"]', slots: ['pair', 'frames', 'frame', 'note'] },\n licences: {\n scope: '[data-bl-section=\"licences\"] [data-slot=\"list\"]',\n slots: ['row', 'label', 'value', 'number', 'holder', 'classes', 'class', 'register', 'cover', 'amount', 'date', 'abn', 'lookup'],\n },\n thankYou: { scope: '[data-bl=\"thank-you\"]', slots: ['step'] },\n photoUpload: { scope: '[data-bl=\"photo-upload\"]', slots: ['photo', 'thumb', 'remove'] },\n quoteForm: { scope: '[data-bl=\"quote-form\"] [data-bl=\"photo-upload\"]', slots: ['photo', 'thumb', 'remove'] },\n // Primitives rendered once per list entry (3.14.0): every part is repeated, the root included (style the root\n // through its own hook, `[data-bl=\"card\"]`).\n card: { scope: '[data-bl=\"card\"]', slots: ['media', 'body', 'title', 'link', 'text', 'meta'] },\n badge: { scope: '[data-bl=\"badge\"]', slots: ['icon', 'label'] },\n chip: { scope: '[data-bl=\"chip\"]', slots: ['icon', 'label'] },\n stat: { scope: '[data-bl=\"stat\"]', slots: ['value', 'label', 'link'] },\n tickList: { scope: '[data-bl=\"tick-list\"]', slots: ['item', 'tick', 'text', 'link'] },\n /** A lean list (cost item 1f): plain `<li><a>` entries with no `data-slot`, reached by element. */\n linkList: { scope: '[data-bl=\"link-list\"]', slots: ['item', 'link'], hooks: { item: '> li', link: '> li > a' } },\n} as const\n\nexport type RepeatedSlotComponent = keyof typeof REPEATED_SLOTS\n/** The repeated slots of one component, for example `RepeatedSlotOf<'siteFooter'>` is `'licenceLink' | … | 'policyLink'`. */\nexport type RepeatedSlotOf<Component extends RepeatedSlotComponent> = (typeof REPEATED_SLOTS)[Component]['slots'][number]\n\n/** The selector a skin stylesheet uses for one repeated slot, for example `[data-bl=\"footer\"] [data-slot=\"link\"]`. */\nexport function repeatedSlotSelector<Component extends RepeatedSlotComponent>(component: Component, slot: RepeatedSlotOf<Component>): string {\n const entry: { readonly scope: string; readonly hooks?: Readonly<Record<string, string>> } = REPEATED_SLOTS[component]\n return `${entry.scope} ${entry.hooks?.[slot] ?? `[data-slot=\"${slot}\"]`}`\n}\n"]}
|
|
@@ -84,6 +84,11 @@ export interface HeroLayout {
|
|
|
84
84
|
readonly rating?: 'chip' | 'figure';
|
|
85
85
|
/** The photo's overlay (3.16.0): `full`, `column` (behind the text side only) or `none`. */
|
|
86
86
|
readonly scrim?: HeroScrim;
|
|
87
|
+
/**
|
|
88
|
+
* The photo's WebP quality, 1 to 100 (3.18.0; Next's default 75). Add it to `images.qualities` in
|
|
89
|
+
* `brandlabNextConfig`. A hero over B1's 200 KB at 1440 px usually passes at 60 to 65.
|
|
90
|
+
*/
|
|
91
|
+
readonly imageQuality?: number;
|
|
87
92
|
}
|
|
88
93
|
export type HeroSkin = SkinEntry<HeroSlot, HeroVariant, HeroLayout>;
|
|
89
94
|
/** The form's id and lead diagnostics `form_id` in the hero; the quote button links here. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/hero.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,sCAAsC,CAAA;AACvF,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAEnE,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAEvE,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEnF,mGAAmG;AACnG,eAAO,MAAM,kBAAkB,mFAAoF,CAAA;AACnH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEjE,eAAO,MAAM,WAAW,qCAAsC,CAAA;AAC9D,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CA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,EAAE;QAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACpG,oHAAoH;IACpH,QAAQ,CAAC,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;CACnE;AAED,sCAAsC;AACtC,eAAO,MAAM,oBAAoB,qBAA0B,CAAA;AAE3D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,SAAS,eAAe,EAAO,GAAG,eAAe,EAAE,CAe1F;AAkBD,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,2CA6HpC"}
|
|
@@ -142,6 +142,6 @@ export function Hero(props) {
|
|
|
142
142
|
'data-media-side': variant === 'split' ? (layout?.mediaSide ?? 'end') : undefined,
|
|
143
143
|
'data-form': form ? '' : undefined,
|
|
144
144
|
'data-scrim': scrim === 'none' ? undefined : scrim,
|
|
145
|
-
}, children: [_jsxs("div", { ...slot(classes, 'content'), children: [crumbs ? _jsx("div", { ...slot(classes, 'crumbs'), children: crumbs }) : null, heroContentOrder(layout?.contentOrder).map((part) => (_jsx(Fragment, { children: parts[part] }, part)))] }), _jsxs("div", { ...slot(classes, 'media'), children: [_jsx(MediaFrame, { media: media, ratio: "4:3", sizes: variant === 'full-bleed' ? '100vw' : '(min-width: 1024px) 50vw, 100vw', caption: caption, priority: true, classes: { caption: classes?.caption } }), scrim === 'none' ? null : _jsx("div", { ...slot(classes, 'scrim'), "aria-hidden": "true" }), seal ? (_jsxs("p", { ...slot(classes, 'seal'), children: [_jsx("span", { ...slot(classes, 'sealValue'), children: seal.value }), " ", _jsx("span", { ...slot(classes, 'sealLabel'), children: seal.label })] })) : null] }), form ? (_jsxs("div", { ...slot(classes, 'form'), children: [formHeading ? (_jsxs("div", { ...slot(classes, 'formHead'), children: [formHeading.eyebrow ? _jsx("p", { ...slot(classes, 'formEyebrow'), children: formHeading.eyebrow }) : null, _jsx("h2", { id: HERO_FORM_HEADING_ID, ...slot(classes, 'formTitle'), children: formHeading.title }), formHeading.text ? _jsx("p", { ...slot(classes, 'formText'), children: formHeading.text }) : null] })) : null, form] })) : null] }));
|
|
145
|
+
}, children: [_jsxs("div", { ...slot(classes, 'content'), children: [crumbs ? _jsx("div", { ...slot(classes, 'crumbs'), children: crumbs }) : null, heroContentOrder(layout?.contentOrder).map((part) => (_jsx(Fragment, { children: parts[part] }, part)))] }), _jsxs("div", { ...slot(classes, 'media'), children: [_jsx(MediaFrame, { media: media, ratio: "4:3", sizes: variant === 'full-bleed' ? '100vw' : '(min-width: 1024px) 50vw, 100vw', caption: caption, priority: true, quality: layout?.imageQuality, classes: { caption: classes?.caption } }), scrim === 'none' ? null : _jsx("div", { ...slot(classes, 'scrim'), "aria-hidden": "true" }), seal ? (_jsxs("p", { ...slot(classes, 'seal'), children: [_jsx("span", { ...slot(classes, 'sealValue'), children: seal.value }), " ", _jsx("span", { ...slot(classes, 'sealLabel'), children: seal.label })] })) : null] }), form ? (_jsxs("div", { ...slot(classes, 'form'), children: [formHeading ? (_jsxs("div", { ...slot(classes, 'formHead'), children: [formHeading.eyebrow ? _jsx("p", { ...slot(classes, 'formEyebrow'), children: formHeading.eyebrow }) : null, _jsx("h2", { id: HERO_FORM_HEADING_ID, ...slot(classes, 'formTitle'), children: formHeading.title }), formHeading.text ? _jsx("p", { ...slot(classes, 'formText'), children: formHeading.text }) : null] })) : null, form] })) : null] }));
|
|
146
146
|
}
|
|
147
147
|
//# sourceMappingURL=hero.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/hero.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH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CAAC,IAAI,IACJ,EACL,IAAI,CAAC,CAAC,CAAC,CACN,kBAAS,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,aAC3B,WAAW,CAAC,CAAC,CAAC,CACb,kBAAS,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,aAC/B,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,eAAO,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,YAAG,WAAW,CAAC,OAAO,GAAK,CAAC,CAAC,CAAC,IAAI,EAC5F,aAAI,EAAE,EAAE,oBAAoB,KAAM,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,YACzD,WAAW,CAAC,KAAK,GACf,EACJ,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,eAAO,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,YAAG,WAAW,CAAC,IAAI,GAAK,CAAC,CAAC,CAAC,IAAI,IAC/E,CACP,CAAC,CAAC,CAAC,IAAI,EACP,IAAI,IACD,CACP,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `Hero` (S1, `hero`, 3.14.0): the first screen of the home, service and service-in-suburb pages. Server component;\n * it wins the click and starts the enquiry. Light by default: every colour comes from the site's tokens and skin.\n *\n * In source order, which is the phone order: breadcrumbs (service and location pages), an optional eyebrow, the H1\n * (once, as plain text; on a location page the built \"{Service} {Suburb}\" string), one offer line of 25 words or fewer,\n * the two actions, the trust checklist (up to six verified facts, two columns), Google's feed rating, partner badges,\n * the photo and then the site's quote form. On desktop the form sits beside the text (`split`, the photo on the other side) or over the photo\n * as a card (`full-bleed`, under a text-side scrim the skin colours).\n *\n * Locked:\n * - the actions are the phone link (`data-phone-location=\"hero\"`, icon on the left) then the quote button\n * (`lead_cta_click` placement `hero`, id `quote-hero`): the same phone-first order as the header, the call bar and the\n * CTA band (K6). Job mode only moves the primary styling (`data-primary`), never the order;\n * - the actions are the page's call path (`data-bl-call-path`), so the phone call bar stays hidden while they are on\n * screen and shows once they scroll out (F6);\n * - with a form, the quote button links to it (`#quote-hero`, the form's own id) and the form is in the hero, so C1 sees\n * the H1, a call and a quote action in the first phone screen and the form in the first desktop screen;\n * - the photo is the page's largest image: preloaded, high priority, never lazy. It must be real work or licensed stock\n * (an AI illustration is supporting only, F13), and a job caption needs a genuine photo;\n * - no review quote, and no visible words the site doesn't pass.\n *\n * `family` is the page family (`data-family`): `home` takes no breadcrumbs and is `tall` by default; `service` and\n * `location` take breadcrumbs. A skin styles families apart through `[data-family]`; the variant is the site's one\n * hero structure.\n *\n * The site's own hero (3.16.0), inside the same skeleton:\n * - `layout.contentOrder` arranges the text column's parts (AA: H1, rating, summary, checklist, actions). The\n * breadcrumbs stay first, an eyebrow sits straight before the H1, and the H1 comes before the summary and actions;\n * parts left out follow in the default order;\n * - `layout.rating: 'figure'` shows Google's rating as a large figure with the stars and count, and `ratingMoreLabel`\n * adds the site's link to all the reviews;\n * - `formHeading` puts an eyebrow, an H2 and a line above the quote form (the hero's one H2);\n * - `seal` stamps one verified fact on the photo (`{ value: '15+', label: 'years of tree work' }`);\n * - `layout.scrim` chooses the overlay: `full` over the whole photo, `column` behind the text side only (as wide as\n * `--bl-hero-scrim-column-width`, 60% by default), or `none` (the default on `split`; `full-bleed` defaults to\n * `full`), coloured by the skin's `--bl-hero-scrim`;\n * - the photo's corners, shadow and filter come from `--bl-hero-photo-radius`, `--bl-hero-photo-shadow` and\n * `--bl-hero-photo-filter`, and the `decoration` slot holds the site's motif.\n */\nimport { Fragment, type ReactNode } from 'react'\nimport { SITE_JOB_MODES, type SiteJobMode } from '@brandlab-digital/site-core/strategy'\nimport { Section, type SectionTone } from '../primitives/layout.js'\nimport { PhoneLink } from '../primitives/links.js'\nimport { TickList, type TickItem } from '../primitives/lists.js'\nimport { MediaFrame, type UiMedia } from '../primitives/media-frame.js'\nimport { QuoteButton } from '../primitives/quote-button.js'\nimport { slot, type SkinEntry } from '../skin.js'\nimport type { UiPhone } from '../types.js'\nimport { RatingChip, hasGoogleRating, type RatingChipData } from './rating-chip.js'\n\n/** The text column's parts, in their default order (3.16.0). The breadcrumbs always come first. */\nexport const HERO_CONTENT_PARTS = ['eyebrow', 'h1', 'summary', 'actions', 'checklist', 'rating', 'badges'] as const\nexport type HeroContentPart = (typeof HERO_CONTENT_PARTS)[number]\n\nexport const HERO_SCRIMS = ['none', 'full', 'column'] as const\nexport type HeroScrim = (typeof HERO_SCRIMS)[number]\n\nexport const HERO_VARIANTS = ['split', 'full-bleed'] as const\nexport type HeroVariant = (typeof HERO_VARIANTS)[number]\n\n/**\n * The hero's family (`data-family`). Site-core's page families are finer (`service-in-suburb`, `region`, `suburb` all\n * take the `location` hero), so this stays a hero-level grouping.\n */\nexport const HERO_FAMILIES = ['home', 'service', 'location'] as const\nexport type HeroFamily = (typeof HERO_FAMILIES)[number]\n\n/**\n * A service's job mode (v2 §2.2), as the site's strategy decision card records it (`SiteJobMode` in\n * `site-core/strategy`): which action is styled primary. Never the order.\n */\nexport const HERO_JOB_MODES = SITE_JOB_MODES\nexport type HeroJobMode = SiteJobMode\n\nexport type HeroSlot =\n | 'root'\n | 'inner'\n | 'content'\n | 'crumbs'\n | 'eyebrow'\n | 'h1'\n | 'summary'\n | 'actions'\n | 'phone'\n | 'quote'\n | 'checklist'\n | 'rating'\n | 'badges'\n | 'media'\n | 'caption'\n | 'scrim'\n | 'form'\n | 'formHead'\n | 'formEyebrow'\n | 'formTitle'\n | 'formText'\n | 'seal'\n | 'sealValue'\n | 'sealLabel'\n\nexport interface HeroLayout {\n /** `split`: the photo's side on desktop (default `end`). */\n readonly mediaSide?: 'start' | 'end'\n /** Default `tall` on the home page, `standard` elsewhere. */\n readonly height?: 'standard' | 'tall'\n /** The trust checklist's columns (default 2). */\n readonly checklistColumns?: 1 | 2\n /**\n * The checklist's ticks (3.15.0): `icon` (the default) is the sprite's check; `rule` ships no svg, only a mark the\n * stylesheet draws as a short rule (`TickList`'s `layout.tick`), about 100 bytes less a fact.\n */\n readonly checklistTick?: 'icon' | 'rule'\n /** The text column's order (3.16.0); parts left out follow in the default order. */\n readonly contentOrder?: readonly HeroContentPart[]\n /** Google's rating as one line (`chip`, the default) or a large figure with the stars and count (3.16.0). */\n readonly rating?: 'chip' | 'figure'\n /** The photo's overlay (3.16.0): `full`, `column` (behind the text side only) or `none`. */\n readonly scrim?: HeroScrim\n}\n\nexport type HeroSkin = SkinEntry<HeroSlot, HeroVariant, HeroLayout>\n\n/** The form's id and lead diagnostics `form_id` in the hero; the quote button links here. */\nexport const HERO_FORM_ID = 'quote-hero'\n/** The most facts the trust checklist holds (v2 S1: three to six). */\nexport const HERO_CHECKLIST_MAX = 6\n/** The offer line's word limit (v2 §9.2). */\nexport const HERO_SUMMARY_MAX_WORDS = 25\n\nexport interface HeroProps extends HeroSkin {\n readonly family: HeroFamily\n /** The H1 text: the recorded H1 on live pages, the title builder's on new ones (\"Tree Removal Castle Hill\"). */\n readonly title: string\n /** The one offer line under the H1, 25 words or fewer. */\n readonly summary: string\n /** A short label above the H1. */\n readonly eyebrow?: string\n /** The page's breadcrumbs (the shared `Breadcrumbs`, with its own `nav`). Service and location pages only. */\n readonly breadcrumbs?: ReactNode\n /** The trust checklist: verified facts only (licence, insurance, rating source, years), at most six. */\n readonly checklist: readonly TickItem[]\n /**\n * Google's average and total from the reviews feed (`prepareBusinessProfileReviews`), shown as the shared\n * `RatingChip` (`data-bl=\"rating-chip\"`, the `rating` class on its root, like `phone` and `quote`) after the\n * checklist, linked to the Business Profile. Never typed by hand: without a feed average and a total of 1 or more,\n * nothing renders.\n */\n readonly rating?: RatingChipData | null\n /** Partner badges or logos held and verified (a `LogoStrip`). */\n readonly badges?: ReactNode\n /** The best genuine photo of this page's service; on a location page the nearest job's. From `media.ts`. */\n readonly media: UiMedia\n /** \"{what}, {suburb}, {month year}\" for a genuine job photo, for example on a location page. */\n readonly caption?: string\n readonly phone: UiPhone\n /** Optional words before the number, for example \"Call\". */\n readonly phoneLabel?: string\n /**\n * The site's recorded quote label (C5). `href` defaults to the hero's own form (`#quote-hero`); without a form it\n * is required (for example `/contact#quote`).\n */\n readonly quote: { readonly label: string; readonly href?: string }\n /** The site's bound quote form: `<QuoteForm formId=\"quote-hero\" />`. Required on money pages (C1). */\n readonly form?: ReactNode\n /** The page's service job mode (default `planned`): `urgent` styles the phone link primary. */\n readonly jobMode?: HeroJobMode\n /** The H1's id (default `hero-title`). */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n /** Signature art, rendered `aria-hidden` (Superior's waterline, Absolute's grass edge). */\n readonly decoration?: ReactNode\n /** The site's words for a link to all the reviews on Google, after the rating (3.16.0). */\n readonly ratingMoreLabel?: string\n /** A heading block above the quote form (3.16.0): an optional eyebrow, the H2 and an optional line. */\n readonly formHeading?: { readonly eyebrow?: string; readonly title: string; readonly text?: string }\n /** One verified fact stamped on the photo (3.16.0), for example `{ value: '15+', label: 'years of tree work' }`. */\n readonly seal?: { readonly value: string; readonly label: string }\n}\n\n/** The form heading's id (3.16.0). */\nexport const HERO_FORM_HEADING_ID = `${HERO_FORM_ID}-title`\n\n/**\n * The text column's order: the site's order, then the parts it left out in the default order. A left-out eyebrow goes\n * straight before the H1, where it always sits (3.16.1).\n */\nexport function heroContentOrder(order: readonly HeroContentPart[] = []): HeroContentPart[] {\n const problems: string[] = []\n const seen = new Set<string>()\n for (const part of order) {\n if (!(HERO_CONTENT_PARTS as readonly string[]).includes(part)) problems.push(`\"${part}\" is not a hero part (${HERO_CONTENT_PARTS.join(', ')})`)\n else if (seen.has(part)) problems.push(`\"${part}\" appears twice`)\n seen.add(part)\n }\n const full = [...order, ...HERO_CONTENT_PARTS.filter((part) => !seen.has(part) && part !== 'eyebrow')]\n if (!seen.has('eyebrow')) full.splice(full.indexOf('h1'), 0, 'eyebrow')\n const at = (part: HeroContentPart) => full.indexOf(part)\n if (at('eyebrow') !== at('h1') - 1) problems.push('the eyebrow sits straight before the H1')\n if (at('summary') < at('h1') || at('actions') < at('h1')) problems.push('the H1 comes before the summary and the actions')\n if (problems.length > 0) throw new Error(`Hero content order: ${problems.join('; ')}.`)\n return full\n}\n\nconst words = (text: string) => text.trim().split(/\\s+/).filter(Boolean).length\n\nfunction assertHero({ title, summary, checklist, media, caption, quote, form, formHeading, seal }: HeroProps): void {\n const problems: string[] = []\n if (title.trim() === '') problems.push('the H1 is empty')\n if (words(summary) > HERO_SUMMARY_MAX_WORDS) problems.push(`the offer line has ${words(summary)} words (${HERO_SUMMARY_MAX_WORDS} at most)`)\n if (checklist.length > HERO_CHECKLIST_MAX) problems.push(`the checklist has ${checklist.length} facts (${HERO_CHECKLIST_MAX} at most)`)\n if (media.provenance === 'illustrative-ai') problems.push(`${media.src} is an AI illustration; the hero shows real work or licensed stock`)\n if (caption && media.provenance !== 'genuine') problems.push(`a job caption needs a genuine photo (${media.src} is ${media.provenance})`)\n if (!form && !quote.href) problems.push('without a form, quote.href must name the quote form, for example /contact#quote')\n if (formHeading && !form) problems.push('a form heading needs the form')\n if (formHeading && formHeading.title.trim() === '') problems.push('the form heading is empty')\n if (seal && (seal.value.trim() === '' || seal.label.trim() === '')) problems.push('the seal needs a value and a label')\n if (problems.length > 0) throw new Error(`Hero \"${title}\": ${problems.join('; ')}.`)\n}\n\nexport function Hero(props: HeroProps) {\n assertHero(props)\n const {\n family,\n title,\n summary,\n eyebrow,\n breadcrumbs,\n checklist,\n rating,\n badges,\n media,\n caption,\n phone,\n phoneLabel,\n quote,\n form,\n jobMode = 'planned',\n headingId = 'hero-title',\n tone,\n decoration,\n ratingMoreLabel,\n formHeading,\n seal,\n variant = 'split',\n layout,\n classes,\n } = props\n const primary = jobMode === 'urgent' ? 'phone' : 'quote'\n const crumbs = family === 'home' ? null : breadcrumbs\n const scrim = layout?.scrim ?? (variant === 'full-bleed' ? 'full' : 'none')\n const parts: Record<HeroContentPart, ReactNode> = {\n eyebrow: eyebrow ? <p {...slot(classes, 'eyebrow')}>{eyebrow}</p> : null,\n h1: (\n <h1 id={headingId} {...slot(classes, 'h1')}>\n {title}\n </h1>\n ),\n summary: <p {...slot(classes, 'summary')}>{summary}</p>,\n actions: (\n <div {...slot(classes, 'actions')} data-bl-call-path=\"\" data-primary={primary}>\n <PhoneLink phone={phone} placement=\"hero\" label={phoneLabel} showIcon variant=\"button\" classes={{ root: classes?.phone }} />\n <QuoteButton\n label={quote.label}\n href={quote.href ?? `#${HERO_FORM_ID}`}\n placement=\"hero\"\n ctaId=\"quote-hero\"\n variant={primary === 'quote' ? 'primary' : 'secondary'}\n classes={{ root: classes?.quote }}\n />\n </div>\n ),\n checklist:\n checklist.length > 0 ? (\n <div {...slot(classes, 'checklist')}>\n <TickList items={checklist} layout={{ columns: layout?.checklistColumns ?? 2, ...(layout?.checklistTick ? { tick: layout.checklistTick } : {}) }} />\n </div>\n ) : null,\n rating: hasGoogleRating(rating) ? (\n <RatingChip\n reviews={rating}\n moreLabel={ratingMoreLabel}\n layout={layout?.rating === 'figure' ? { display: 'figure' } : undefined}\n classes={{ root: classes?.rating }}\n />\n ) : null,\n badges: badges ? <div {...slot(classes, 'badges')}>{badges}</div> : null,\n }\n return (\n <Section\n id=\"hero\"\n labelledBy={headingId}\n tone={tone}\n variant={variant}\n classes={classes}\n decoration={decoration}\n phonePlacement=\"hero\"\n hooks={{\n 'data-family': family,\n 'data-job-mode': jobMode,\n 'data-height': layout?.height ?? (family === 'home' ? 'tall' : 'standard'),\n 'data-media-side': variant === 'split' ? (layout?.mediaSide ?? 'end') : undefined,\n 'data-form': form ? '' : undefined,\n 'data-scrim': scrim === 'none' ? undefined : scrim,\n }}\n >\n <div {...slot(classes, 'content')}>\n {crumbs ? <div {...slot(classes, 'crumbs')}>{crumbs}</div> : null}\n {heroContentOrder(layout?.contentOrder).map((part) => (\n <Fragment key={part}>{parts[part]}</Fragment>\n ))}\n </div>\n <div {...slot(classes, 'media')}>\n <MediaFrame\n media={media}\n ratio=\"4:3\"\n sizes={variant === 'full-bleed' ? '100vw' : '(min-width: 1024px) 50vw, 100vw'}\n caption={caption}\n priority\n classes={{ caption: classes?.caption }}\n />\n {scrim === 'none' ? null : <div {...slot(classes, 'scrim')} aria-hidden=\"true\" />}\n {seal ? (\n <p {...slot(classes, 'seal')}>\n <span {...slot(classes, 'sealValue')}>{seal.value}</span> <span {...slot(classes, 'sealLabel')}>{seal.label}</span>\n </p>\n ) : null}\n </div>\n {form ? (\n <div {...slot(classes, 'form')}>\n {formHeading ? (\n <div {...slot(classes, 'formHead')}>\n {formHeading.eyebrow ? <p {...slot(classes, 'formEyebrow')}>{formHeading.eyebrow}</p> : null}\n <h2 id={HERO_FORM_HEADING_ID} {...slot(classes, 'formTitle')}>\n {formHeading.title}\n </h2>\n {formHeading.text ? <p {...slot(classes, 'formText')}>{formHeading.text}</p> : null}\n </div>\n ) : null}\n {form}\n </div>\n ) : null}\n </Section>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/hero.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,cAAc,EAAoB,MAAM,sCAAsC,CAAA;AACvF,OAAO,EAAE,OAAO,EAAoB,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAiB,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,UAAU,EAAgB,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAEjD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAuB,MAAM,kBAAkB,CAAA;AAEnF,mGAAmG;AACnG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,IAAI,EAA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CAAC,IAAI,GAAK,CAAC,CAAC,CAAC,IAAI,IAC/E,CACP,CAAC,CAAC,CAAC,IAAI,EACP,IAAI,IACD,CACP,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `Hero` (S1, `hero`, 3.14.0): the first screen of the home, service and service-in-suburb pages. Server component;\n * it wins the click and starts the enquiry. Light by default: every colour comes from the site's tokens and skin.\n *\n * In source order, which is the phone order: breadcrumbs (service and location pages), an optional eyebrow, the H1\n * (once, as plain text; on a location page the built \"{Service} {Suburb}\" string), one offer line of 25 words or fewer,\n * the two actions, the trust checklist (up to six verified facts, two columns), Google's feed rating, partner badges,\n * the photo and then the site's quote form. On desktop the form sits beside the text (`split`, the photo on the other side) or over the photo\n * as a card (`full-bleed`, under a text-side scrim the skin colours).\n *\n * Locked:\n * - the actions are the phone link (`data-phone-location=\"hero\"`, icon on the left) then the quote button\n * (`lead_cta_click` placement `hero`, id `quote-hero`): the same phone-first order as the header, the call bar and the\n * CTA band (K6). Job mode only moves the primary styling (`data-primary`), never the order;\n * - the actions are the page's call path (`data-bl-call-path`), so the phone call bar stays hidden while they are on\n * screen and shows once they scroll out (F6);\n * - with a form, the quote button links to it (`#quote-hero`, the form's own id) and the form is in the hero, so C1 sees\n * the H1, a call and a quote action in the first phone screen and the form in the first desktop screen;\n * - the photo is the page's largest image: preloaded, high priority, never lazy. It must be real work or licensed stock\n * (an AI illustration is supporting only, F13), and a job caption needs a genuine photo;\n * - no review quote, and no visible words the site doesn't pass.\n *\n * `family` is the page family (`data-family`): `home` takes no breadcrumbs and is `tall` by default; `service` and\n * `location` take breadcrumbs. A skin styles families apart through `[data-family]`; the variant is the site's one\n * hero structure.\n *\n * The site's own hero (3.16.0), inside the same skeleton:\n * - `layout.contentOrder` arranges the text column's parts (AA: H1, rating, summary, checklist, actions). The\n * breadcrumbs stay first, an eyebrow sits straight before the H1, and the H1 comes before the summary and actions;\n * parts left out follow in the default order;\n * - `layout.rating: 'figure'` shows Google's rating as a large figure with the stars and count, and `ratingMoreLabel`\n * adds the site's link to all the reviews;\n * - `formHeading` puts an eyebrow, an H2 and a line above the quote form (the hero's one H2);\n * - `seal` stamps one verified fact on the photo (`{ value: '15+', label: 'years of tree work' }`);\n * - `layout.scrim` chooses the overlay: `full` over the whole photo, `column` behind the text side only (as wide as\n * `--bl-hero-scrim-column-width`, 60% by default), or `none` (the default on `split`; `full-bleed` defaults to\n * `full`), coloured by the skin's `--bl-hero-scrim`;\n * - the photo's corners, shadow and filter come from `--bl-hero-photo-radius`, `--bl-hero-photo-shadow` and\n * `--bl-hero-photo-filter`, and the `decoration` slot holds the site's motif.\n */\nimport { Fragment, type ReactNode } from 'react'\nimport { SITE_JOB_MODES, type SiteJobMode } from '@brandlab-digital/site-core/strategy'\nimport { Section, type SectionTone } from '../primitives/layout.js'\nimport { PhoneLink } from '../primitives/links.js'\nimport { TickList, type TickItem } from '../primitives/lists.js'\nimport { MediaFrame, type UiMedia } from '../primitives/media-frame.js'\nimport { QuoteButton } from '../primitives/quote-button.js'\nimport { slot, type SkinEntry } from '../skin.js'\nimport type { UiPhone } from '../types.js'\nimport { RatingChip, hasGoogleRating, type RatingChipData } from './rating-chip.js'\n\n/** The text column's parts, in their default order (3.16.0). The breadcrumbs always come first. */\nexport const HERO_CONTENT_PARTS = ['eyebrow', 'h1', 'summary', 'actions', 'checklist', 'rating', 'badges'] as const\nexport type HeroContentPart = (typeof HERO_CONTENT_PARTS)[number]\n\nexport const HERO_SCRIMS = ['none', 'full', 'column'] as const\nexport type HeroScrim = (typeof HERO_SCRIMS)[number]\n\nexport const HERO_VARIANTS = ['split', 'full-bleed'] as const\nexport type HeroVariant = (typeof HERO_VARIANTS)[number]\n\n/**\n * The hero's family (`data-family`). Site-core's page families are finer (`service-in-suburb`, `region`, `suburb` all\n * take the `location` hero), so this stays a hero-level grouping.\n */\nexport const HERO_FAMILIES = ['home', 'service', 'location'] as const\nexport type HeroFamily = (typeof HERO_FAMILIES)[number]\n\n/**\n * A service's job mode (v2 §2.2), as the site's strategy decision card records it (`SiteJobMode` in\n * `site-core/strategy`): which action is styled primary. Never the order.\n */\nexport const HERO_JOB_MODES = SITE_JOB_MODES\nexport type HeroJobMode = SiteJobMode\n\nexport type HeroSlot =\n | 'root'\n | 'inner'\n | 'content'\n | 'crumbs'\n | 'eyebrow'\n | 'h1'\n | 'summary'\n | 'actions'\n | 'phone'\n | 'quote'\n | 'checklist'\n | 'rating'\n | 'badges'\n | 'media'\n | 'caption'\n | 'scrim'\n | 'form'\n | 'formHead'\n | 'formEyebrow'\n | 'formTitle'\n | 'formText'\n | 'seal'\n | 'sealValue'\n | 'sealLabel'\n\nexport interface HeroLayout {\n /** `split`: the photo's side on desktop (default `end`). */\n readonly mediaSide?: 'start' | 'end'\n /** Default `tall` on the home page, `standard` elsewhere. */\n readonly height?: 'standard' | 'tall'\n /** The trust checklist's columns (default 2). */\n readonly checklistColumns?: 1 | 2\n /**\n * The checklist's ticks (3.15.0): `icon` (the default) is the sprite's check; `rule` ships no svg, only a mark the\n * stylesheet draws as a short rule (`TickList`'s `layout.tick`), about 100 bytes less a fact.\n */\n readonly checklistTick?: 'icon' | 'rule'\n /** The text column's order (3.16.0); parts left out follow in the default order. */\n readonly contentOrder?: readonly HeroContentPart[]\n /** Google's rating as one line (`chip`, the default) or a large figure with the stars and count (3.16.0). */\n readonly rating?: 'chip' | 'figure'\n /** The photo's overlay (3.16.0): `full`, `column` (behind the text side only) or `none`. */\n readonly scrim?: HeroScrim\n /**\n * The photo's WebP quality, 1 to 100 (3.18.0; Next's default 75). Add it to `images.qualities` in\n * `brandlabNextConfig`. A hero over B1's 200 KB at 1440 px usually passes at 60 to 65.\n */\n readonly imageQuality?: number\n}\n\nexport type HeroSkin = SkinEntry<HeroSlot, HeroVariant, HeroLayout>\n\n/** The form's id and lead diagnostics `form_id` in the hero; the quote button links here. */\nexport const HERO_FORM_ID = 'quote-hero'\n/** The most facts the trust checklist holds (v2 S1: three to six). */\nexport const HERO_CHECKLIST_MAX = 6\n/** The offer line's word limit (v2 §9.2). */\nexport const HERO_SUMMARY_MAX_WORDS = 25\n\nexport interface HeroProps extends HeroSkin {\n readonly family: HeroFamily\n /** The H1 text: the recorded H1 on live pages, the title builder's on new ones (\"Tree Removal Castle Hill\"). */\n readonly title: string\n /** The one offer line under the H1, 25 words or fewer. */\n readonly summary: string\n /** A short label above the H1. */\n readonly eyebrow?: string\n /** The page's breadcrumbs (the shared `Breadcrumbs`, with its own `nav`). Service and location pages only. */\n readonly breadcrumbs?: ReactNode\n /** The trust checklist: verified facts only (licence, insurance, rating source, years), at most six. */\n readonly checklist: readonly TickItem[]\n /**\n * Google's average and total from the reviews feed (`prepareBusinessProfileReviews`), shown as the shared\n * `RatingChip` (`data-bl=\"rating-chip\"`, the `rating` class on its root, like `phone` and `quote`) after the\n * checklist, linked to the Business Profile. Never typed by hand: without a feed average and a total of 1 or more,\n * nothing renders.\n */\n readonly rating?: RatingChipData | null\n /** Partner badges or logos held and verified (a `LogoStrip`). */\n readonly badges?: ReactNode\n /** The best genuine photo of this page's service; on a location page the nearest job's. From `media.ts`. */\n readonly media: UiMedia\n /** \"{what}, {suburb}, {month year}\" for a genuine job photo, for example on a location page. */\n readonly caption?: string\n readonly phone: UiPhone\n /** Optional words before the number, for example \"Call\". */\n readonly phoneLabel?: string\n /**\n * The site's recorded quote label (C5). `href` defaults to the hero's own form (`#quote-hero`); without a form it\n * is required (for example `/contact#quote`).\n */\n readonly quote: { readonly label: string; readonly href?: string }\n /** The site's bound quote form: `<QuoteForm formId=\"quote-hero\" />`. Required on money pages (C1). */\n readonly form?: ReactNode\n /** The page's service job mode (default `planned`): `urgent` styles the phone link primary. */\n readonly jobMode?: HeroJobMode\n /** The H1's id (default `hero-title`). */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n /** Signature art, rendered `aria-hidden` (Superior's waterline, Absolute's grass edge). */\n readonly decoration?: ReactNode\n /** The site's words for a link to all the reviews on Google, after the rating (3.16.0). */\n readonly ratingMoreLabel?: string\n /** A heading block above the quote form (3.16.0): an optional eyebrow, the H2 and an optional line. */\n readonly formHeading?: { readonly eyebrow?: string; readonly title: string; readonly text?: string }\n /** One verified fact stamped on the photo (3.16.0), for example `{ value: '15+', label: 'years of tree work' }`. */\n readonly seal?: { readonly value: string; readonly label: string }\n}\n\n/** The form heading's id (3.16.0). */\nexport const HERO_FORM_HEADING_ID = `${HERO_FORM_ID}-title`\n\n/**\n * The text column's order: the site's order, then the parts it left out in the default order. A left-out eyebrow goes\n * straight before the H1, where it always sits (3.16.1).\n */\nexport function heroContentOrder(order: readonly HeroContentPart[] = []): HeroContentPart[] {\n const problems: string[] = []\n const seen = new Set<string>()\n for (const part of order) {\n if (!(HERO_CONTENT_PARTS as readonly string[]).includes(part)) problems.push(`\"${part}\" is not a hero part (${HERO_CONTENT_PARTS.join(', ')})`)\n else if (seen.has(part)) problems.push(`\"${part}\" appears twice`)\n seen.add(part)\n }\n const full = [...order, ...HERO_CONTENT_PARTS.filter((part) => !seen.has(part) && part !== 'eyebrow')]\n if (!seen.has('eyebrow')) full.splice(full.indexOf('h1'), 0, 'eyebrow')\n const at = (part: HeroContentPart) => full.indexOf(part)\n if (at('eyebrow') !== at('h1') - 1) problems.push('the eyebrow sits straight before the H1')\n if (at('summary') < at('h1') || at('actions') < at('h1')) problems.push('the H1 comes before the summary and the actions')\n if (problems.length > 0) throw new Error(`Hero content order: ${problems.join('; ')}.`)\n return full\n}\n\nconst words = (text: string) => text.trim().split(/\\s+/).filter(Boolean).length\n\nfunction assertHero({ title, summary, checklist, media, caption, quote, form, formHeading, seal }: HeroProps): void {\n const problems: string[] = []\n if (title.trim() === '') problems.push('the H1 is empty')\n if (words(summary) > HERO_SUMMARY_MAX_WORDS) problems.push(`the offer line has ${words(summary)} words (${HERO_SUMMARY_MAX_WORDS} at most)`)\n if (checklist.length > HERO_CHECKLIST_MAX) problems.push(`the checklist has ${checklist.length} facts (${HERO_CHECKLIST_MAX} at most)`)\n if (media.provenance === 'illustrative-ai') problems.push(`${media.src} is an AI illustration; the hero shows real work or licensed stock`)\n if (caption && media.provenance !== 'genuine') problems.push(`a job caption needs a genuine photo (${media.src} is ${media.provenance})`)\n if (!form && !quote.href) problems.push('without a form, quote.href must name the quote form, for example /contact#quote')\n if (formHeading && !form) problems.push('a form heading needs the form')\n if (formHeading && formHeading.title.trim() === '') problems.push('the form heading is empty')\n if (seal && (seal.value.trim() === '' || seal.label.trim() === '')) problems.push('the seal needs a value and a label')\n if (problems.length > 0) throw new Error(`Hero \"${title}\": ${problems.join('; ')}.`)\n}\n\nexport function Hero(props: HeroProps) {\n assertHero(props)\n const {\n family,\n title,\n summary,\n eyebrow,\n breadcrumbs,\n checklist,\n rating,\n badges,\n media,\n caption,\n phone,\n phoneLabel,\n quote,\n form,\n jobMode = 'planned',\n headingId = 'hero-title',\n tone,\n decoration,\n ratingMoreLabel,\n formHeading,\n seal,\n variant = 'split',\n layout,\n classes,\n } = props\n const primary = jobMode === 'urgent' ? 'phone' : 'quote'\n const crumbs = family === 'home' ? null : breadcrumbs\n const scrim = layout?.scrim ?? (variant === 'full-bleed' ? 'full' : 'none')\n const parts: Record<HeroContentPart, ReactNode> = {\n eyebrow: eyebrow ? <p {...slot(classes, 'eyebrow')}>{eyebrow}</p> : null,\n h1: (\n <h1 id={headingId} {...slot(classes, 'h1')}>\n {title}\n </h1>\n ),\n summary: <p {...slot(classes, 'summary')}>{summary}</p>,\n actions: (\n <div {...slot(classes, 'actions')} data-bl-call-path=\"\" data-primary={primary}>\n <PhoneLink phone={phone} placement=\"hero\" label={phoneLabel} showIcon variant=\"button\" classes={{ root: classes?.phone }} />\n <QuoteButton\n label={quote.label}\n href={quote.href ?? `#${HERO_FORM_ID}`}\n placement=\"hero\"\n ctaId=\"quote-hero\"\n variant={primary === 'quote' ? 'primary' : 'secondary'}\n classes={{ root: classes?.quote }}\n />\n </div>\n ),\n checklist:\n checklist.length > 0 ? (\n <div {...slot(classes, 'checklist')}>\n <TickList items={checklist} layout={{ columns: layout?.checklistColumns ?? 2, ...(layout?.checklistTick ? { tick: layout.checklistTick } : {}) }} />\n </div>\n ) : null,\n rating: hasGoogleRating(rating) ? (\n <RatingChip\n reviews={rating}\n moreLabel={ratingMoreLabel}\n layout={layout?.rating === 'figure' ? { display: 'figure' } : undefined}\n classes={{ root: classes?.rating }}\n />\n ) : null,\n badges: badges ? <div {...slot(classes, 'badges')}>{badges}</div> : null,\n }\n return (\n <Section\n id=\"hero\"\n labelledBy={headingId}\n tone={tone}\n variant={variant}\n classes={classes}\n decoration={decoration}\n phonePlacement=\"hero\"\n hooks={{\n 'data-family': family,\n 'data-job-mode': jobMode,\n 'data-height': layout?.height ?? (family === 'home' ? 'tall' : 'standard'),\n 'data-media-side': variant === 'split' ? (layout?.mediaSide ?? 'end') : undefined,\n 'data-form': form ? '' : undefined,\n 'data-scrim': scrim === 'none' ? undefined : scrim,\n }}\n >\n <div {...slot(classes, 'content')}>\n {crumbs ? <div {...slot(classes, 'crumbs')}>{crumbs}</div> : null}\n {heroContentOrder(layout?.contentOrder).map((part) => (\n <Fragment key={part}>{parts[part]}</Fragment>\n ))}\n </div>\n <div {...slot(classes, 'media')}>\n <MediaFrame\n media={media}\n ratio=\"4:3\"\n sizes={variant === 'full-bleed' ? '100vw' : '(min-width: 1024px) 50vw, 100vw'}\n caption={caption}\n priority\n quality={layout?.imageQuality}\n classes={{ caption: classes?.caption }}\n />\n {scrim === 'none' ? null : <div {...slot(classes, 'scrim')} aria-hidden=\"true\" />}\n {seal ? (\n <p {...slot(classes, 'seal')}>\n <span {...slot(classes, 'sealValue')}>{seal.value}</span> <span {...slot(classes, 'sealLabel')}>{seal.label}</span>\n </p>\n ) : null}\n </div>\n {form ? (\n <div {...slot(classes, 'form')}>\n {formHeading ? (\n <div {...slot(classes, 'formHead')}>\n {formHeading.eyebrow ? <p {...slot(classes, 'formEyebrow')}>{formHeading.eyebrow}</p> : null}\n <h2 id={HERO_FORM_HEADING_ID} {...slot(classes, 'formTitle')}>\n {formHeading.title}\n </h2>\n {formHeading.text ? <p {...slot(classes, 'formText')}>{formHeading.text}</p> : null}\n </div>\n ) : null}\n {form}\n </div>\n ) : null}\n </Section>\n )\n}\n"]}
|
|
@@ -18,6 +18,13 @@
|
|
|
18
18
|
* with nothing to show, the section renders nothing;
|
|
19
19
|
* - no default visible copy: the row labels, cover names and register link text are the site's (`labels`). A line
|
|
20
20
|
* with no label fails the build rather than render unlabelled.
|
|
21
|
+
*
|
|
22
|
+
* Optional lines (3.19.0), shown only when the site gives their label:
|
|
23
|
+
* - `labels.experience` with `labels.experienceLine` ("More than {years} years of {field}"): the evidenced
|
|
24
|
+
* experience of the person doing the work (`holder: 'practitioner'`), right after the qualifications. A business's
|
|
25
|
+
* own age is never shown here; that is the established line;
|
|
26
|
+
* - `labels.established`: the month and year the business was established (`credentials.established`), and with
|
|
27
|
+
* `labels.abn` the verified ABN from `registration.abn`, linking to ABN Lookup when `labels.abnLookup` is given.
|
|
21
28
|
*/
|
|
22
29
|
import type { ReactNode } from 'react';
|
|
23
30
|
import { type BrandlabBusiness, type BrandlabInsuranceCover, type BrandlabLicence, type BrandlabRenderableCredentials } from '@brandlab-digital/site-core/business';
|
|
@@ -41,7 +48,21 @@ export interface LicencesLabels {
|
|
|
41
48
|
readonly covers?: Readonly<Partial<Record<BrandlabInsuranceCover, string>>>;
|
|
42
49
|
/** The register link's text, for example "Check the register". Left out, no register link renders. */
|
|
43
50
|
readonly register?: string;
|
|
51
|
+
/** The experience row's label, for example "Experience" (3.19.0). Left out, the row doesn't render. */
|
|
52
|
+
readonly experience?: string;
|
|
53
|
+
/** Each experience line with `{years}` and `{field}`, for example "More than {years} years of {field}". */
|
|
54
|
+
readonly experienceLine?: string;
|
|
55
|
+
/** The established row's label, for example "Established" (3.19.0). Left out, the row doesn't render. */
|
|
56
|
+
readonly established?: string;
|
|
57
|
+
/** The ABN's label in the established row, for example "ABN". Left out, the ABN doesn't show. */
|
|
58
|
+
readonly abn?: string;
|
|
59
|
+
/** The ABN Lookup link's text, for example "Check ABN Lookup". Left out, the ABN shows without a link. */
|
|
60
|
+
readonly abnLookup?: string;
|
|
44
61
|
}
|
|
62
|
+
/** The public ABN Lookup page for an 11-digit ABN. */
|
|
63
|
+
export declare function abnLookupUrl(abn: string): string;
|
|
64
|
+
/** An ABN as it is written: "12 345 678 901". */
|
|
65
|
+
export declare function formatAbn(abn: string): string;
|
|
45
66
|
/** The business facts the ledger reads: `business.registration` and `business.credentials`. */
|
|
46
67
|
export type LicencesBusiness = Pick<BrandlabBusiness, 'registration' | 'credentials'>;
|
|
47
68
|
export interface LicencesProps extends LicencesSkin {
|
|
@@ -62,6 +83,8 @@ interface LedgerContent {
|
|
|
62
83
|
readonly licences: readonly BrandlabLicence[];
|
|
63
84
|
readonly credentials: BrandlabRenderableCredentials;
|
|
64
85
|
readonly skips: readonly BrandlabSectionSlotSkip[];
|
|
86
|
+
/** The verified ABN the website may show (3.19.0). */
|
|
87
|
+
readonly abn?: string;
|
|
65
88
|
}
|
|
66
89
|
/** What the evidence lets the variant show today, and the expected lines it has to leave out. */
|
|
67
90
|
export declare function licencesContent(business: LicencesBusiness, variant: LicencesVariant, asOf?: Date): LedgerContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"licences.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/licences.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"licences.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/licences.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,6BAA6B,EACnC,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAKL,KAAK,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AAE,IAAI,GAAE,IAAiB,GAAG,aAAa,CAkB5H;AAMD,kGAAkG;AAClG,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAmB,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC,GAAG,wBAAwB,CAErJ;AA2CD,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAA8B,EAAE,IAAI,EAAE,OAAmB,EAAE,OAAO,EAAE,EAAE,aAAa,kDAqF3J"}
|
|
@@ -5,6 +5,16 @@ import { Section, SectionHeading } from '../primitives/layout.js';
|
|
|
5
5
|
import { Anchor } from '../primitives/links.js';
|
|
6
6
|
import { repeatedSlot, slot } from '../skin.js';
|
|
7
7
|
export const LICENCES_VARIANTS = ['licence', 'qualifications'];
|
|
8
|
+
/** The public ABN Lookup page for an 11-digit ABN. */
|
|
9
|
+
export function abnLookupUrl(abn) {
|
|
10
|
+
return `https://abr.business.gov.au/ABN/View?abn=${abn.replace(/\s/g, '')}`;
|
|
11
|
+
}
|
|
12
|
+
/** An ABN as it is written: "12 345 678 901". */
|
|
13
|
+
export function formatAbn(abn) {
|
|
14
|
+
const digits = abn.replace(/\s/g, '');
|
|
15
|
+
return `${digits.slice(0, 2)} ${digits.slice(2, 5)} ${digits.slice(5, 8)} ${digits.slice(8)}`;
|
|
16
|
+
}
|
|
17
|
+
const MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
8
18
|
/** What the evidence lets the variant show today, and the expected lines it has to leave out. */
|
|
9
19
|
export function licencesContent(business, variant, asOf = new Date()) {
|
|
10
20
|
const credentials = renderableCredentials(business.credentials, 'website-copy', asOf);
|
|
@@ -16,7 +26,17 @@ export function licencesContent(business, variant, asOf = new Date()) {
|
|
|
16
26
|
skips.push({ slot: 'qualifications', reason: 'no-evidenced-qualification' });
|
|
17
27
|
if (variant === 'qualifications' && credentials.insurance.length === 0)
|
|
18
28
|
skips.push({ slot: 'insurance', reason: 'no-current-insurance' });
|
|
19
|
-
|
|
29
|
+
const abn = resolveVerifiedFactForSurface(business.registration.abn, 'website-copy', asOf);
|
|
30
|
+
return {
|
|
31
|
+
licences,
|
|
32
|
+
credentials: {
|
|
33
|
+
...(variant === 'qualifications' ? credentials : { ...credentials, qualifications: [] }),
|
|
34
|
+
// A person's experience only: the business's age is the established line.
|
|
35
|
+
experience: credentials.experience.filter((entry) => entry.holder === 'practitioner'),
|
|
36
|
+
},
|
|
37
|
+
skips,
|
|
38
|
+
...(abn ? { abn } : {}),
|
|
39
|
+
};
|
|
20
40
|
}
|
|
21
41
|
function hasLines({ licences, credentials }) {
|
|
22
42
|
return licences.length + credentials.qualifications.length + credentials.insurance.length > 0;
|
|
@@ -37,10 +57,16 @@ export function Licences({ title, eyebrow, lead, business, labels, asOf, heading
|
|
|
37
57
|
const content = licencesContent(business, variant, asOf);
|
|
38
58
|
if (!hasLines(content))
|
|
39
59
|
return null;
|
|
40
|
-
const { licences, credentials, skips } = content;
|
|
60
|
+
const { licences, credentials, skips, abn } = content;
|
|
61
|
+
const experience = labels.experience && credentials.experience.length > 0 ? credentials.experience : [];
|
|
62
|
+
const experienceLine = experience.length > 0 ? required(labels.experienceLine, 'experienceLine') : undefined;
|
|
63
|
+
if (experienceLine && !experienceLine.includes('{years}'))
|
|
64
|
+
throw new Error('Licences: labels.experienceLine needs {years}.');
|
|
65
|
+
const established = labels.established ? credentials.established : undefined;
|
|
66
|
+
const shownAbn = established && labels.abn && abn ? abn : undefined;
|
|
41
67
|
const qualificationsLabel = credentials.qualifications.length > 0 ? required(labels.qualifications, 'qualifications') : undefined;
|
|
42
68
|
const insuranceLabel = credentials.insurance.length > 0 ? required(labels.insurance, 'insurance') : undefined;
|
|
43
69
|
const coverName = (cover) => required(labels.covers?.[cover], `covers['${cover}']`);
|
|
44
|
-
return (_jsxs(Section, { id: "licences", labelledBy: headingId, tone: tone, variant: variant, classes: classes, hooks: skips.length > 0 ? { [SECTION_SLOT_SKIP_ATTRIBUTE]: formatSectionSlotSkips(skips) } : undefined, children: [_jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), _jsxs("dl", { ...slot(classes, 'list'), children: [licences.map((licence) => (_jsx(LicenceLine, { licence: licence, registerLabel: labels.register }, `${licence.name}-${licence.identifier}`))), qualificationsLabel ? (_jsxs("div", { ...repeatedSlot('row'), [SECTION_SLOT_ATTRIBUTE]: 'qualifications', children: [_jsx("dt", { ...repeatedSlot('label'), children: qualificationsLabel }), credentials.qualifications.map((entry) => (_jsx("dd", { ...repeatedSlot('value'), children: entry.title }, entry.title)))] })) : null, insuranceLabel ? (_jsxs("div", { ...repeatedSlot('row'), [SECTION_SLOT_ATTRIBUTE]: 'insurance', children: [_jsx("dt", { ...repeatedSlot('label'), children: insuranceLabel }), credentials.insurance.map((entry) => (_jsxs("dd", { ...repeatedSlot('value'), children: [_jsx("span", { ...repeatedSlot('cover'), children: coverName(entry.cover) }), ' ', _jsx("span", { ...repeatedSlot('amount'), children: formatInsuranceAmount(entry.amountAud) })] }, `${entry.cover}-${entry.amountAud}`)))] })) : null] })] }));
|
|
70
|
+
return (_jsxs(Section, { id: "licences", labelledBy: headingId, tone: tone, variant: variant, classes: classes, hooks: skips.length > 0 ? { [SECTION_SLOT_SKIP_ATTRIBUTE]: formatSectionSlotSkips(skips) } : undefined, children: [_jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), _jsxs("dl", { ...slot(classes, 'list'), children: [licences.map((licence) => (_jsx(LicenceLine, { licence: licence, registerLabel: labels.register }, `${licence.name}-${licence.identifier}`))), qualificationsLabel ? (_jsxs("div", { ...repeatedSlot('row'), [SECTION_SLOT_ATTRIBUTE]: 'qualifications', children: [_jsx("dt", { ...repeatedSlot('label'), children: qualificationsLabel }), credentials.qualifications.map((entry) => (_jsx("dd", { ...repeatedSlot('value'), children: entry.title }, entry.title)))] })) : null, experienceLine ? (_jsxs("div", { ...repeatedSlot('row'), [SECTION_SLOT_ATTRIBUTE]: 'experience', children: [_jsx("dt", { ...repeatedSlot('label'), children: labels.experience }), experience.map((entry) => (_jsx("dd", { ...repeatedSlot('value'), children: experienceLine.replaceAll('{years}', String(entry.years)).replaceAll('{field}', entry.field) }, entry.claimId)))] })) : null, established ? (_jsxs("div", { ...repeatedSlot('row'), [SECTION_SLOT_ATTRIBUTE]: 'established', children: [_jsx("dt", { ...repeatedSlot('label'), children: labels.established }), _jsx("dd", { ...repeatedSlot('value'), children: _jsx("span", { ...repeatedSlot('date'), children: established.month ? `${MONTHS[established.month - 1]} ${established.year}` : established.year }) }), shownAbn ? (_jsxs("dd", { ...repeatedSlot('abn'), children: [labels.abn, " ", formatAbn(shownAbn), labels.abnLookup ? (_jsxs(_Fragment, { children: [' ', _jsx("span", { ...repeatedSlot('lookup'), children: _jsx(Anchor, { href: abnLookupUrl(shownAbn), prefetch: false, hooks: {}, children: labels.abnLookup }) })] })) : null] })) : null] })) : null, insuranceLabel ? (_jsxs("div", { ...repeatedSlot('row'), [SECTION_SLOT_ATTRIBUTE]: 'insurance', children: [_jsx("dt", { ...repeatedSlot('label'), children: insuranceLabel }), credentials.insurance.map((entry) => (_jsxs("dd", { ...repeatedSlot('value'), children: [_jsx("span", { ...repeatedSlot('cover'), children: coverName(entry.cover) }), ' ', _jsx("span", { ...repeatedSlot('amount'), children: formatInsuranceAmount(entry.amountAud) })] }, `${entry.cover}-${entry.amountAud}`)))] })) : null] })] }));
|
|
45
71
|
}
|
|
46
72
|
//# sourceMappingURL=licences.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"licences.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/licences.tsx"],"names":[],"mappings":";AAsBA,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,6BAA6B,G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licences`, 3.15.0): the business's credentials as a ruled ledger, read straight from the site's business\n * facts (`site-core/business`), so the page can only say what the evidence allows. Server component.\n *\n * Variants (matrix part B):\n * - `licence` (licensed trades): each current licence as the register shows it (its name, number, licensee, classes\n * with their conditions and the register link), then the insurance lines;\n * - `qualifications` (trades with no licence, such as tree work): the qualifications as the business may state them,\n * without a person's name (\"AQF Level 3-qualified arborist\"), then the insurance lines.\n *\n * Locked:\n * - licences come only from a verified `registration.licences` fact whose evidence allows website copy and has not\n * expired, less any expired licence (`renderableLicences`); a licence number is never typed in by hand;\n * - qualifications and insurance come only through `renderableCredentials(credentials, 'website-copy')`: evidenced\n * for the surface, not expired, and no policy past its end date. The amount is `formatInsuranceAmount`'s (\"$20 million\");\n * - each line carries its K12-slots hook (`data-bl-slot=\"licence\" | \"qualifications\" | \"insurance\"`); a line the\n * variant expects but the evidence doesn't allow is left out and listed in `data-bl-slot-skip` with its reason;\n * with nothing to show, the section renders nothing;\n * - no default visible copy: the row labels, cover names and register link text are the site's (`labels`). A line\n * with no label fails the build rather than render unlabelled.\n */\nimport type { ReactNode } from 'react'\nimport {\n formatInsuranceAmount,\n renderableCredentials,\n renderableLicences,\n resolveVerifiedFactForSurface,\n type BrandlabBusiness,\n type BrandlabInsuranceCover,\n type BrandlabLicence,\n type BrandlabRenderableCredentials,\n} from '@brandlab-digital/site-core/business'\nimport {\n SECTION_READY,\n SECTION_SLOT_ATTRIBUTE,\n SECTION_SLOT_SKIP_ATTRIBUTE,\n formatSectionSlotSkips,\n type BrandlabSectionReadiness,\n type BrandlabSectionSlotSkip,\n} from '@brandlab-digital/site-core/section-order'\nimport { Section, SectionHeading, type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js'\nimport { Anchor } from '../primitives/links.js'\nimport type { RepeatedSlotOf } from '../repeated-slots.js'\nimport { repeatedSlot, slot, type SkinEntry } from '../skin.js'\n\nexport const LICENCES_VARIANTS = ['licence', 'qualifications'] as const\nexport type LicencesVariant = (typeof LICENCES_VARIANTS)[number]\n/** Rendered once per line: styled from the skin stylesheet, never by class. */\nexport type LicencesRepeatedSlot = RepeatedSlotOf<'licences'>\nexport type LicencesSlot = SectionSlot | SectionHeadingSlot | 'list' | LicencesRepeatedSlot\nexport type LicencesSkin = SkinEntry<LicencesSlot, LicencesVariant, Record<never, never>, LicencesRepeatedSlot>\n\n/** The site's words for the ledger. Each is needed only when its line renders. */\nexport interface LicencesLabels {\n /** The qualifications row's label, for example \"Qualifications\". */\n readonly qualifications?: string\n /** The insurance row's label, for example \"Insurance\". */\n readonly insurance?: string\n /** Each cover's name, for example `{ 'public-liability': 'Public liability' }`. */\n readonly covers?: Readonly<Partial<Record<BrandlabInsuranceCover, string>>>\n /** The register link's text, for example \"Check the register\". Left out, no register link renders. */\n readonly register?: string\n}\n\n/** The business facts the ledger reads: `business.registration` and `business.credentials`. */\nexport type LicencesBusiness = Pick<BrandlabBusiness, 'registration' | 'credentials'>\n\nexport interface LicencesProps extends LicencesSkin {\n /** The H2, for example \"Qualified and insured\". */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n readonly business: LicencesBusiness\n readonly labels: LicencesLabels\n /** The day the page is built (tests pin it). */\n readonly asOf?: Date\n /** Defaults to `licences-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\ninterface LedgerContent {\n readonly licences: readonly BrandlabLicence[]\n readonly credentials: BrandlabRenderableCredentials\n readonly skips: readonly BrandlabSectionSlotSkip[]\n}\n\n/** What the evidence lets the variant show today, and the expected lines it has to leave out. */\nexport function licencesContent(business: LicencesBusiness, variant: LicencesVariant, asOf: Date = new Date()): LedgerContent {\n const credentials = renderableCredentials(business.credentials, 'website-copy', asOf)\n const licences = variant === 'licence' ? renderableLicences(resolveVerifiedFactForSurface(business.registration.licences, 'website-copy', asOf) ?? [], asOf) : []\n const skips: BrandlabSectionSlotSkip[] = []\n if (variant === 'licence' && licences.length === 0) skips.push({ slot: 'licence', reason: 'no-current-licence' })\n if (variant === 'qualifications' && credentials.qualifications.length === 0) skips.push({ slot: 'qualifications', reason: 'no-evidenced-qualification' })\n if (variant === 'qualifications' && credentials.insurance.length === 0) skips.push({ slot: 'insurance', reason: 'no-current-insurance' })\n return { licences, credentials: variant === 'qualifications' ? credentials : { ...credentials, qualifications: [] }, skips }\n}\n\nfunction hasLines({ licences, credentials }: LedgerContent): boolean {\n return licences.length + credentials.qualifications.length + credentials.insurance.length > 0\n}\n\n/** The section's guard for `SectionSequence`: skipped when the evidence allows no line at all. */\nexport function licencesReady({ business, variant = 'licence', asOf }: Pick<LicencesProps, 'business' | 'variant' | 'asOf'>): BrandlabSectionReadiness {\n return hasLines(licencesContent(business, variant, asOf)) ? SECTION_READY : { render: false, reason: 'no-evidenced-credentials' }\n}\n\nfunction required(value: string | undefined, name: string): string {\n if (!value?.trim()) throw new Error(`Licences: labels.${name} is needed to show this line, in the site's words.`)\n return value\n}\n\nfunction LicenceLine({ licence, registerLabel }: { licence: BrandlabLicence; registerLabel: string | undefined }) {\n return (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'licence' }}>\n <dt {...repeatedSlot('label')}>{licence.name}</dt>\n <dd {...repeatedSlot('value')}>\n <span {...repeatedSlot('number')}>{licence.identifier}</span>\n {licence.licensee ? (\n <>\n {' '}\n <span {...repeatedSlot('holder')}>{licence.licensee}</span>\n </>\n ) : null}\n </dd>\n {licence.classes && licence.classes.length > 0 ? (\n <dd {...repeatedSlot('classes')}>\n <ul role=\"list\">\n {licence.classes.map((entry) => (\n <li key={entry.name} {...repeatedSlot('class')}>\n {entry.name}\n {entry.conditions && entry.conditions.length > 0 ? `: ${entry.conditions.join('; ')}` : null}\n </li>\n ))}\n </ul>\n </dd>\n ) : null}\n {licence.registerUrl && registerLabel ? (\n <dd {...repeatedSlot('register')}>\n <Anchor href={licence.registerUrl} prefetch={false} hooks={{}}>\n {registerLabel}\n </Anchor>\n </dd>\n ) : null}\n </div>\n )\n}\n\nexport function Licences({ title, eyebrow, lead, business, labels, asOf, headingId = 'licences-heading', tone, variant = 'licence', classes }: LicencesProps) {\n const content = licencesContent(business, variant, asOf)\n if (!hasLines(content)) return null\n const { licences, credentials, skips } = content\n const qualificationsLabel = credentials.qualifications.length > 0 ? required(labels.qualifications, 'qualifications') : undefined\n const insuranceLabel = credentials.insurance.length > 0 ? required(labels.insurance, 'insurance') : undefined\n const coverName = (cover: BrandlabInsuranceCover) => required(labels.covers?.[cover], `covers['${cover}']`)\n return (\n <Section\n id=\"licences\"\n labelledBy={headingId}\n tone={tone}\n variant={variant}\n classes={classes}\n hooks={skips.length > 0 ? { [SECTION_SLOT_SKIP_ATTRIBUTE]: formatSectionSlotSkips(skips) } : undefined}\n >\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n <dl {...slot(classes, 'list')}>\n {licences.map((licence) => (\n <LicenceLine key={`${licence.name}-${licence.identifier}`} licence={licence} registerLabel={labels.register} />\n ))}\n {qualificationsLabel ? (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'qualifications' }}>\n <dt {...repeatedSlot('label')}>{qualificationsLabel}</dt>\n {credentials.qualifications.map((entry) => (\n <dd key={entry.title} {...repeatedSlot('value')}>\n {entry.title}\n </dd>\n ))}\n </div>\n ) : null}\n {insuranceLabel ? (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'insurance' }}>\n <dt {...repeatedSlot('label')}>{insuranceLabel}</dt>\n {credentials.insurance.map((entry) => (\n <dd key={`${entry.cover}-${entry.amountAud}`} {...repeatedSlot('value')}>\n <span {...repeatedSlot('cover')}>{coverName(entry.cover)}</span>{' '}\n <span {...repeatedSlot('amount')}>{formatInsuranceAmount(entry.amountAud)}</span>\n </dd>\n ))}\n </div>\n ) : null}\n </dl>\n </Section>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"licences.js","sourceRoot":"","sources":["../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M,CAAC,SAAS,GACV,GACJ,IACN,CACJ,CAAC,CAAC,CAAC,IAAI,IACL,CACN,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC,CAAC,CAAC,IAAI,EACP,cAAc,CAAC,CAAC,CAAC,CAChB,kBAAS,YAAY,CAAC,KAAK,CAAC,EAAQ,CAAC,sBAAsB,CAAC,EAAE,WAAW,aACvE,gBAAQ,YAAY,CAAC,OAAO,CAAC,YAAG,cAAc,GAAM,EACnD,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACpC,iBAAkD,YAAY,CAAC,OAAO,CAAC,aACrE,kBAAU,YAAY,CAAC,OAAO,CAAC,YAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAQ,EAAC,GAAG,EACpE,kBAAU,YAAY,CAAC,QAAQ,CAAC,YAAG,qBAAqB,CAAC,KAAK,CAAC,SAAS,CAAC,GAAQ,KAF1E,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,SAAS,EAAE,CAGvC,CACN,CAAC,IACE,CACP,CAAC,CAAC,CAAC,IAAI,IACL,IACG,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `Licences` (`licences`, 3.15.0): the business's credentials as a ruled ledger, read straight from the site's business\n * facts (`site-core/business`), so the page can only say what the evidence allows. Server component.\n *\n * Variants (matrix part B):\n * - `licence` (licensed trades): each current licence as the register shows it (its name, number, licensee, classes\n * with their conditions and the register link), then the insurance lines;\n * - `qualifications` (trades with no licence, such as tree work): the qualifications as the business may state them,\n * without a person's name (\"AQF Level 3-qualified arborist\"), then the insurance lines.\n *\n * Locked:\n * - licences come only from a verified `registration.licences` fact whose evidence allows website copy and has not\n * expired, less any expired licence (`renderableLicences`); a licence number is never typed in by hand;\n * - qualifications and insurance come only through `renderableCredentials(credentials, 'website-copy')`: evidenced\n * for the surface, not expired, and no policy past its end date. The amount is `formatInsuranceAmount`'s (\"$20 million\");\n * - each line carries its K12-slots hook (`data-bl-slot=\"licence\" | \"qualifications\" | \"insurance\"`); a line the\n * variant expects but the evidence doesn't allow is left out and listed in `data-bl-slot-skip` with its reason;\n * with nothing to show, the section renders nothing;\n * - no default visible copy: the row labels, cover names and register link text are the site's (`labels`). A line\n * with no label fails the build rather than render unlabelled.\n *\n * Optional lines (3.19.0), shown only when the site gives their label:\n * - `labels.experience` with `labels.experienceLine` (\"More than {years} years of {field}\"): the evidenced\n * experience of the person doing the work (`holder: 'practitioner'`), right after the qualifications. A business's\n * own age is never shown here; that is the established line;\n * - `labels.established`: the month and year the business was established (`credentials.established`), and with\n * `labels.abn` the verified ABN from `registration.abn`, linking to ABN Lookup when `labels.abnLookup` is given.\n */\nimport type { ReactNode } from 'react'\nimport {\n formatInsuranceAmount,\n renderableCredentials,\n renderableLicences,\n resolveVerifiedFactForSurface,\n type BrandlabBusiness,\n type BrandlabInsuranceCover,\n type BrandlabLicence,\n type BrandlabRenderableCredentials,\n} from '@brandlab-digital/site-core/business'\nimport {\n SECTION_READY,\n SECTION_SLOT_ATTRIBUTE,\n SECTION_SLOT_SKIP_ATTRIBUTE,\n formatSectionSlotSkips,\n type BrandlabSectionReadiness,\n type BrandlabSectionSlotSkip,\n} from '@brandlab-digital/site-core/section-order'\nimport { Section, SectionHeading, type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js'\nimport { Anchor } from '../primitives/links.js'\nimport type { RepeatedSlotOf } from '../repeated-slots.js'\nimport { repeatedSlot, slot, type SkinEntry } from '../skin.js'\n\nexport const LICENCES_VARIANTS = ['licence', 'qualifications'] as const\nexport type LicencesVariant = (typeof LICENCES_VARIANTS)[number]\n/** Rendered once per line: styled from the skin stylesheet, never by class. */\nexport type LicencesRepeatedSlot = RepeatedSlotOf<'licences'>\nexport type LicencesSlot = SectionSlot | SectionHeadingSlot | 'list' | LicencesRepeatedSlot\nexport type LicencesSkin = SkinEntry<LicencesSlot, LicencesVariant, Record<never, never>, LicencesRepeatedSlot>\n\n/** The site's words for the ledger. Each is needed only when its line renders. */\nexport interface LicencesLabels {\n /** The qualifications row's label, for example \"Qualifications\". */\n readonly qualifications?: string\n /** The insurance row's label, for example \"Insurance\". */\n readonly insurance?: string\n /** Each cover's name, for example `{ 'public-liability': 'Public liability' }`. */\n readonly covers?: Readonly<Partial<Record<BrandlabInsuranceCover, string>>>\n /** The register link's text, for example \"Check the register\". Left out, no register link renders. */\n readonly register?: string\n /** The experience row's label, for example \"Experience\" (3.19.0). Left out, the row doesn't render. */\n readonly experience?: string\n /** Each experience line with `{years}` and `{field}`, for example \"More than {years} years of {field}\". */\n readonly experienceLine?: string\n /** The established row's label, for example \"Established\" (3.19.0). Left out, the row doesn't render. */\n readonly established?: string\n /** The ABN's label in the established row, for example \"ABN\". Left out, the ABN doesn't show. */\n readonly abn?: string\n /** The ABN Lookup link's text, for example \"Check ABN Lookup\". Left out, the ABN shows without a link. */\n readonly abnLookup?: string\n}\n\n/** The public ABN Lookup page for an 11-digit ABN. */\nexport function abnLookupUrl(abn: string): string {\n return `https://abr.business.gov.au/ABN/View?abn=${abn.replace(/\\s/g, '')}`\n}\n\n/** An ABN as it is written: \"12 345 678 901\". */\nexport function formatAbn(abn: string): string {\n const digits = abn.replace(/\\s/g, '')\n return `${digits.slice(0, 2)} ${digits.slice(2, 5)} ${digits.slice(5, 8)} ${digits.slice(8)}`\n}\n\nconst MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n\n/** The business facts the ledger reads: `business.registration` and `business.credentials`. */\nexport type LicencesBusiness = Pick<BrandlabBusiness, 'registration' | 'credentials'>\n\nexport interface LicencesProps extends LicencesSkin {\n /** The H2, for example \"Qualified and insured\". */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n readonly business: LicencesBusiness\n readonly labels: LicencesLabels\n /** The day the page is built (tests pin it). */\n readonly asOf?: Date\n /** Defaults to `licences-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\ninterface LedgerContent {\n readonly licences: readonly BrandlabLicence[]\n readonly credentials: BrandlabRenderableCredentials\n readonly skips: readonly BrandlabSectionSlotSkip[]\n /** The verified ABN the website may show (3.19.0). */\n readonly abn?: string\n}\n\n/** What the evidence lets the variant show today, and the expected lines it has to leave out. */\nexport function licencesContent(business: LicencesBusiness, variant: LicencesVariant, asOf: Date = new Date()): LedgerContent {\n const credentials = renderableCredentials(business.credentials, 'website-copy', asOf)\n const licences = variant === 'licence' ? renderableLicences(resolveVerifiedFactForSurface(business.registration.licences, 'website-copy', asOf) ?? [], asOf) : []\n const skips: BrandlabSectionSlotSkip[] = []\n if (variant === 'licence' && licences.length === 0) skips.push({ slot: 'licence', reason: 'no-current-licence' })\n if (variant === 'qualifications' && credentials.qualifications.length === 0) skips.push({ slot: 'qualifications', reason: 'no-evidenced-qualification' })\n if (variant === 'qualifications' && credentials.insurance.length === 0) skips.push({ slot: 'insurance', reason: 'no-current-insurance' })\n const abn = resolveVerifiedFactForSurface(business.registration.abn, 'website-copy', asOf)\n return {\n licences,\n credentials: {\n ...(variant === 'qualifications' ? credentials : { ...credentials, qualifications: [] }),\n // A person's experience only: the business's age is the established line.\n experience: credentials.experience.filter((entry) => entry.holder === 'practitioner'),\n },\n skips,\n ...(abn ? { abn } : {}),\n }\n}\n\nfunction hasLines({ licences, credentials }: LedgerContent): boolean {\n return licences.length + credentials.qualifications.length + credentials.insurance.length > 0\n}\n\n/** The section's guard for `SectionSequence`: skipped when the evidence allows no line at all. */\nexport function licencesReady({ business, variant = 'licence', asOf }: Pick<LicencesProps, 'business' | 'variant' | 'asOf'>): BrandlabSectionReadiness {\n return hasLines(licencesContent(business, variant, asOf)) ? SECTION_READY : { render: false, reason: 'no-evidenced-credentials' }\n}\n\nfunction required(value: string | undefined, name: string): string {\n if (!value?.trim()) throw new Error(`Licences: labels.${name} is needed to show this line, in the site's words.`)\n return value\n}\n\nfunction LicenceLine({ licence, registerLabel }: { licence: BrandlabLicence; registerLabel: string | undefined }) {\n return (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'licence' }}>\n <dt {...repeatedSlot('label')}>{licence.name}</dt>\n <dd {...repeatedSlot('value')}>\n <span {...repeatedSlot('number')}>{licence.identifier}</span>\n {licence.licensee ? (\n <>\n {' '}\n <span {...repeatedSlot('holder')}>{licence.licensee}</span>\n </>\n ) : null}\n </dd>\n {licence.classes && licence.classes.length > 0 ? (\n <dd {...repeatedSlot('classes')}>\n <ul role=\"list\">\n {licence.classes.map((entry) => (\n <li key={entry.name} {...repeatedSlot('class')}>\n {entry.name}\n {entry.conditions && entry.conditions.length > 0 ? `: ${entry.conditions.join('; ')}` : null}\n </li>\n ))}\n </ul>\n </dd>\n ) : null}\n {licence.registerUrl && registerLabel ? (\n <dd {...repeatedSlot('register')}>\n <Anchor href={licence.registerUrl} prefetch={false} hooks={{}}>\n {registerLabel}\n </Anchor>\n </dd>\n ) : null}\n </div>\n )\n}\n\nexport function Licences({ title, eyebrow, lead, business, labels, asOf, headingId = 'licences-heading', tone, variant = 'licence', classes }: LicencesProps) {\n const content = licencesContent(business, variant, asOf)\n if (!hasLines(content)) return null\n const { licences, credentials, skips, abn } = content\n const experience = labels.experience && credentials.experience.length > 0 ? credentials.experience : []\n const experienceLine = experience.length > 0 ? required(labels.experienceLine, 'experienceLine') : undefined\n if (experienceLine && !experienceLine.includes('{years}')) throw new Error('Licences: labels.experienceLine needs {years}.')\n const established = labels.established ? credentials.established : undefined\n const shownAbn = established && labels.abn && abn ? abn : undefined\n const qualificationsLabel = credentials.qualifications.length > 0 ? required(labels.qualifications, 'qualifications') : undefined\n const insuranceLabel = credentials.insurance.length > 0 ? required(labels.insurance, 'insurance') : undefined\n const coverName = (cover: BrandlabInsuranceCover) => required(labels.covers?.[cover], `covers['${cover}']`)\n return (\n <Section\n id=\"licences\"\n labelledBy={headingId}\n tone={tone}\n variant={variant}\n classes={classes}\n hooks={skips.length > 0 ? { [SECTION_SLOT_SKIP_ATTRIBUTE]: formatSectionSlotSkips(skips) } : undefined}\n >\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n <dl {...slot(classes, 'list')}>\n {licences.map((licence) => (\n <LicenceLine key={`${licence.name}-${licence.identifier}`} licence={licence} registerLabel={labels.register} />\n ))}\n {qualificationsLabel ? (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'qualifications' }}>\n <dt {...repeatedSlot('label')}>{qualificationsLabel}</dt>\n {credentials.qualifications.map((entry) => (\n <dd key={entry.title} {...repeatedSlot('value')}>\n {entry.title}\n </dd>\n ))}\n </div>\n ) : null}\n {experienceLine ? (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'experience' }}>\n <dt {...repeatedSlot('label')}>{labels.experience}</dt>\n {experience.map((entry) => (\n <dd key={entry.claimId} {...repeatedSlot('value')}>\n {experienceLine.replaceAll('{years}', String(entry.years)).replaceAll('{field}', entry.field)}\n </dd>\n ))}\n </div>\n ) : null}\n {established ? (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'established' }}>\n <dt {...repeatedSlot('label')}>{labels.established}</dt>\n <dd {...repeatedSlot('value')}>\n <span {...repeatedSlot('date')}>\n {established.month ? `${MONTHS[established.month - 1]} ${established.year}` : established.year}\n </span>\n </dd>\n {shownAbn ? (\n <dd {...repeatedSlot('abn')}>\n {labels.abn} {formatAbn(shownAbn)}\n {labels.abnLookup ? (\n <>\n {' '}\n <span {...repeatedSlot('lookup')}>\n <Anchor href={abnLookupUrl(shownAbn)} prefetch={false} hooks={{}}>\n {labels.abnLookup}\n </Anchor>\n </span>\n </>\n ) : null}\n </dd>\n ) : null}\n </div>\n ) : null}\n {insuranceLabel ? (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'insurance' }}>\n <dt {...repeatedSlot('label')}>{insuranceLabel}</dt>\n {credentials.insurance.map((entry) => (\n <dd key={`${entry.cover}-${entry.amountAud}`} {...repeatedSlot('value')}>\n <span {...repeatedSlot('cover')}>{coverName(entry.cover)}</span>{' '}\n <span {...repeatedSlot('amount')}>{formatInsuranceAmount(entry.amountAud)}</span>\n </dd>\n ))}\n </div>\n ) : null}\n </dl>\n </Section>\n )\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brandlab-digital/site-next",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@brandlab-digital/site-core": "3.
|
|
28
|
+
"@brandlab-digital/site-core": "3.19.0",
|
|
29
29
|
"browser-image-compression": "2.0.2",
|
|
30
30
|
"pdf-lib": "1.17.1",
|
|
31
31
|
"server-only": "0.0.1",
|