@bison-lab/payload-blocks 3.20.0 → 3.22.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/README.md +37 -20
- package/dist/admin.d.mts +10 -2
- package/dist/admin.d.mts.map +1 -1
- package/dist/admin.mjs +992 -414
- package/dist/admin.mjs.map +1 -1
- package/dist/{header-CznT9Uwv.mjs → header-CTMSB4C0.mjs} +50 -24
- package/dist/header-CTMSB4C0.mjs.map +1 -0
- package/dist/index.d.mts +24 -12
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +14 -60
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +53 -5
- package/dist/react.d.mts.map +1 -1
- package/dist/react.mjs +2 -2
- package/dist/rich-text.d.mts +1 -1
- package/dist/{types-DWEoAURf.d.mts → types-BwWCwKJ4.d.mts} +15 -5
- package/dist/types-BwWCwKJ4.d.mts.map +1 -0
- package/package.json +4 -4
- package/dist/header-CznT9Uwv.mjs.map +0 -1
- package/dist/types-DWEoAURf.d.mts.map +0 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/fields/image.ts","../src/fields/link.ts","../src/blocks/hero/config.ts","../src/blocks/rich-text/config.ts","../src/fields/min-rows.ts","../src/blocks/showcase-panels/config.ts","../src/blocks/process-steps/config.ts","../src/fields/heading.ts","../src/blocks/faq-columns/config.ts","../src/blocks/testimonial-masonry/config.ts","../src/blocks/nap/config.ts","../src/fields/row-limits.ts","../src/blocks/stats-band/config.ts","../src/blocks/mega-menu/rem-width.ts","../src/blocks/mega-menu/config.ts","../src/fields/nav-items.ts","../src/media.ts","../src/blocks/faq-columns/sample.ts","../src/sample-image.ts","../src/blocks/hero/sample.ts","../src/blocks/mega-menu/sample.ts","../src/blocks/nap/sample.ts","../src/blocks/process-steps/sample.ts","../src/blocks/rich-text/sample.ts","../src/blocks/showcase-panels/sample.ts","../src/blocks/stats-band/sample.ts","../src/blocks/testimonial-masonry/sample.ts","../src/samples.ts"],"sourcesContent":["import type { CollectionSlug, UploadField } from \"payload\";\n\n/**\n * Payload's `UploadField` is a union over the polymorphic (`relationTo: [...]`)\n * and `hasMany` variants. A block image is neither, and narrowing here is what\n * lets `imageField({ name: 'portrait' })` stay type-checked at the call site.\n */\ntype MediaUploadField = Extract<\n UploadField,\n { hasMany?: false; relationTo: CollectionSlug }\n>;\n\nexport interface ImageFieldOptions extends Partial<MediaUploadField> {\n /**\n * The upload collection to point at. Every Bison Lab site names it `media`,\n * but a site that does not can say so without forking the field.\n */\n relationTo?: CollectionSlug;\n}\n\n/**\n * A single image from the site's upload collection, for any block with a\n * picture in it.\n *\n * Optional unless the block says otherwise: `imageField({ name: 'portrait',\n * required: true })`. `admin` is replaced, not merged, so a block that passes\n * its own description writes the whole thing.\n */\nexport function imageField(overrides: ImageFieldOptions = {}): MediaUploadField {\n return {\n name: \"image\",\n type: \"upload\",\n relationTo: \"media\" as CollectionSlug,\n // Payload stars a required field and says nothing about an optional one,\n // so an optional image says so itself, and only then.\n ...(overrides.required ? {} : { admin: { description: \"Optional.\" } }),\n ...overrides,\n } as MediaUploadField;\n}\n","import type { Condition, Field, GroupField, RowField } from \"payload\";\n\n/**\n * The import-map path of the link picker, `LinkField` in\n * `@bison-lab/payload-blocks/admin`.\n *\n * It sits on the row that holds a link's `type`, `page` and `href`, and\n * replaces those three inputs with one box: type to search published pages,\n * or paste a URL. Referenced here by package specifier, like\n * `MIN_ROWS_ARRAY_FIELD`; a site picks it up with `payload generate:importmap`.\n * Until it does, Payload logs the missing entry and renders the row as\n * nothing (a custom `Field` with no component behind it is an empty element,\n * not the stock fields), so the step is part of adopting this release.\n */\nexport const LINK_FIELD = \"@bison-lab/payload-blocks/admin#LinkField\";\n\nexport type LinkType = \"page\" | \"external\";\n\n/**\n * A page as the `page` relationship populates it: what `resolveLink` reads,\n * and what the picker shows. A site's generated `Page` is assignable to it.\n * `_status` is absent on a collection without drafts, which counts as\n * published.\n */\nexport interface LinkPageDoc {\n id: number | string;\n title?: string | null;\n slug?: string | null;\n _status?: (\"draft\" | \"published\") | null;\n}\n\n/** Where a link goes: the three fields the picker writes. */\nexport interface LinkDestination {\n /** `page` unless the editor pasted a URL. Rows saved before links had a type carry only `href`. */\n type?: LinkType | null;\n /** The page's id, or the page itself once a `depth >= 1` read populates it. */\n page?: LinkPageDoc | number | string | null;\n /** The pasted URL of an external link. */\n href?: string | null;\n}\n\n/** The shape `linkField`/`linkFields` produce once Payload generates types. */\nexport interface LinkValue extends LinkDestination {\n label?: string | null;\n newTab?: boolean | null;\n}\n\n/**\n * Turns a link's destination into the `href` a renderer emits, or `null`\n * when there is nothing to point at, in which case the renderer shows the\n * label as text. A site passes its own (`RenderBlocks`' `resolveLink`) when\n * a page's path is not `/<slug>`: the package has no way to know a site's\n * routes, the same reason it takes an `imageComponent`.\n */\nexport type ResolveLink = (link: LinkDestination) => string | null;\n\n/**\n * The package's resolver: a published, populated page is `/<slug>`; an\n * external link is its `href` as typed.\n *\n * A page that did not populate is `null`: Payload hands the public read the\n * bare id when the reader may not see the page, which is what an unpublished\n * page looks like from the site. A populated page whose `_status` is `draft`\n * is `null` too, for a read that can see drafts. A row from before links had\n * a `type` is an external link by `linkTypeOf`, here, in the stock fields'\n * conditions and in the picker alike: the site keeps rendering its `href`,\n * the admin shows it as an External chip, and the site's migration to\n * `type: external` only makes the stored row say what every reader already\n * assumes.\n */\nexport function resolveLink(\n link: LinkDestination | null | undefined,\n): string | null {\n if (!link) return null;\n if (linkTypeOf(link) === \"page\") {\n const page = link.page;\n if (!page || typeof page !== \"object\") return null;\n if (page._status === \"draft\") return null;\n return page.slug ? `/${page.slug}` : null;\n }\n return link.href ? link.href : null;\n}\n\n/**\n * Preview resolver for the Header items kit. `LinkField` stores a page as\n * its id; the public `resolveLink` treats that as unpublished. The editor\n * looks the id up (or uses a populated draft) so the sticky bar still\n * shows the destination the picker chose.\n */\nexport function resolveAdminPreviewLink(\n link: LinkDestination | null | undefined,\n pages: ReadonlyMap<string, LinkPageDoc>,\n): string | null {\n const live = resolveLink(link);\n if (live) return live;\n if (!link || linkTypeOf(link) !== \"page\") return null;\n const page = link.page;\n if (page && typeof page === \"object\") {\n return page.slug ? `/${page.slug}` : null;\n }\n if (page == null) return null;\n const doc = pages.get(String(page));\n return doc?.slug ? `/${doc.slug}` : null;\n}\n\n/**\n * Which of the two stored destinations a row is using. `type` decides; a row\n * with no `type` yet (saved before links had one) is read by what it holds,\n * an `href` making it external, the same reading `resolveLink` and the picker\n * make, so all three agree on every row.\n */\nexport function linkTypeOf(link: LinkDestination | null | undefined): LinkType {\n if (link?.type === \"external\") return \"external\";\n if (link?.type === \"page\") return \"page\";\n return link?.href ? \"external\" : \"page\";\n}\n\nconst whenPage: Condition = (_data, siblingData) =>\n linkTypeOf(siblingData as LinkDestination) === \"page\";\n\nconst whenExternal: Condition = (_data, siblingData) =>\n linkTypeOf(siblingData as LinkDestination) === \"external\";\n\nexport interface LinkDestinationOptions {\n /** Require a destination. Defaults to `false`. */\n required?: boolean;\n /** The collection a page link points into. Defaults to `pages`. */\n pagesCollection?: string;\n}\n\n/**\n * Where a link goes, as stored: `type`, `page` and `href` in one row.\n *\n * The row carries the picker (`LINK_FIELD`), which replaces all three inputs\n * with one box. The stored fields are the website template's shape and stay\n * editable on their own: `page` shows for a page link, `href` for an external\n * one, and `required` binds whichever is active, since Payload skips\n * validation on a field whose condition is false. `page` offers published\n * rows only, and Payload re-checks that on publish, so a page that was\n * unpublished after being picked has to be picked again or republished.\n */\nexport function linkDestinationFields({\n required = false,\n pagesCollection = \"pages\",\n}: LinkDestinationOptions = {}): RowField[] {\n return [\n {\n type: \"row\",\n admin: { components: { Field: LINK_FIELD } },\n fields: [\n {\n name: \"type\",\n type: \"radio\",\n label: \"Goes to\",\n defaultValue: \"page\",\n options: [\n { label: \"Page\", value: \"page\" },\n { label: \"URL\", value: \"external\" },\n ],\n admin: { layout: \"horizontal\" },\n },\n {\n name: \"page\",\n type: \"relationship\",\n relationTo: pagesCollection,\n required,\n filterOptions: { _status: { equals: \"published\" } },\n admin: { condition: whenPage },\n },\n {\n name: \"href\",\n type: \"text\",\n label: \"URL\",\n required,\n admin: {\n condition: whenExternal,\n description:\n 'A full URL (\"https://example.com\"), \"mailto:\" or \"tel:\", or a site path (\"/contact\").',\n },\n },\n ],\n },\n ];\n}\n\nexport interface LinkFieldsOptions extends LinkDestinationOptions {\n /** Require the label and destination. Defaults to `false`. */\n required?: boolean;\n /** Wording for the visible text field. Defaults to \"Label\". */\n labelFieldLabel?: string;\n}\n\n/**\n * The fields a call to action is made of, unwrapped: the destination row,\n * then the label and the new-tab flag.\n *\n * `newTab` drives `target=\"_blank\"` *and* the matching `rel`, which is why no\n * renderer takes one without the other.\n */\nexport function linkFields({\n required = false,\n labelFieldLabel = \"Label\",\n pagesCollection,\n}: LinkFieldsOptions = {}): Field[] {\n return [\n ...linkDestinationFields({ required, pagesCollection }),\n { name: \"label\", type: \"text\", label: labelFieldLabel, required },\n {\n name: \"newTab\",\n type: \"checkbox\",\n label: \"Open in a new tab\",\n defaultValue: false,\n },\n ];\n}\n\nexport interface LinkFieldOptions extends LinkFieldsOptions {\n /** Field name. Defaults to `link`. */\n name?: string;\n label?: GroupField[\"label\"];\n admin?: GroupField[\"admin\"];\n}\n\n/** `linkFields()` as one named group, for a block with a single CTA. */\nexport function linkField({\n name = \"link\",\n label,\n admin,\n ...rest\n}: LinkFieldOptions = {}): GroupField {\n return {\n name,\n type: \"group\",\n fields: linkFields(rest),\n ...(label === undefined ? {} : { label }),\n ...(admin === undefined ? {} : { admin }),\n };\n}\n","import type { Block } from \"payload\";\n\nimport { imageField } from \"../../fields/image\";\nimport { linkFields } from \"../../fields/link\";\n\n/**\n * The band a page opens with.\n *\n * Unlike every other block here this one has no `@bison-lab/ui` counterpart:\n * a hero is where a site's brand is loudest, and the shipped renderer is\n * deliberately plain markup so a site can swap in its own by overriding this\n * one registry entry. The *fields* are the shared part — that is what makes a\n * page portable between sites.\n */\nexport const HeroBlock: Block = {\n slug: \"hero\",\n interfaceName: \"HeroBlock\",\n labels: { singular: \"Hero\", plural: \"Heroes\" },\n fields: [\n {\n name: \"eyebrow\",\n type: \"text\",\n admin: { description: \"Small label above the heading. Optional.\" },\n },\n { name: \"heading\", type: \"text\", required: true },\n { name: \"body\", type: \"textarea\" },\n {\n name: \"tone\",\n type: \"select\",\n defaultValue: \"sweep\",\n options: [\n { label: \"Sweep (brand gradient)\", value: \"sweep\" },\n { label: \"Dark (flat brand band)\", value: \"dark\" },\n // Describes the surface, not a lightness: in the dark theme the page\n // surface is dark. The value stays `light` so no site migrates.\n { label: \"Plain (page surface)\", value: \"light\" },\n ],\n admin: {\n description:\n \"How the band is painted. Sites map these to their own surfaces.\",\n },\n },\n imageField({ admin: { description: \"Optional background or lead image.\" } }),\n {\n name: \"links\",\n type: \"array\",\n // Two is the point at which a hero stops having a primary action.\n maxRows: 2,\n labels: { singular: \"Call to action\", plural: \"Calls to action\" },\n fields: linkFields({ required: true }),\n },\n ],\n};\n","import type { Block } from \"payload\";\n\n/** A prose section: one Lexical document at reading measure. */\nexport const RichTextBlock: Block = {\n slug: \"richText\",\n interfaceName: \"RichTextBlock\",\n labels: { singular: \"Rich Text\", plural: \"Rich Text\" },\n fields: [{ name: \"content\", type: \"richText\", required: true }],\n};\n","/**\n * The import-map path of the array field that refuses to go below `minRows`.\n *\n * Payload gates *Add* on `maxRows` but never gates *Remove* on `minRows`: an\n * editor can delete the third showcase panel, see a \"requires 3 panels\"\n * note, and only learn on publish that the section is invalid. Payload has no\n * option for this, so it is an admin component (`@bison-lab/payload-blocks/admin`)\n * referenced here by package specifier. Every array in this package with a\n * `minRows` uses it, and a site can put it on its own arrays:\n *\n * ```ts\n * { name: 'items', type: 'array', minRows: 2,\n * admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } }, fields: [...] }\n * ```\n *\n * Consuming sites pick it up by re-running `payload generate:importmap`. Until\n * they do, Payload logs the missing entry and falls back to its stock field.\n */\nexport const MIN_ROWS_ARRAY_FIELD =\n \"@bison-lab/payload-blocks/admin#MinRowsArrayField\";\n\n/** Empty rows for an array's `defaultValue`, so a block opens at its minimum. */\nexport function emptyRows(count: number): Record<string, never>[] {\n return Array.from({ length: count }, () => ({}));\n}\n","import type { Block } from \"payload\";\n\nimport { imageField } from \"../../fields/image\";\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\n\n/** Expanding panels, one per service or product line. */\nexport const ShowcasePanelsBlock: Block = {\n slug: \"showcasePanels\",\n interfaceName: \"ShowcasePanelsBlock\",\n labels: { singular: \"Showcase Panels\", plural: \"Showcase Panels\" },\n fields: [\n {\n name: \"items\",\n type: \"array\",\n required: true,\n // The layout is designed around 3-6 panels: fewer and the accordion\n // reads as a mistake, more and each collapsed spine is unreadable. The\n // block opens with the minimum already in place, and the admin field\n // refuses to go below it.\n minRows: 3,\n maxRows: 6,\n defaultValue: emptyRows(3),\n labels: { singular: \"Panel\", plural: \"Panels\" },\n admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } },\n fields: [\n { name: \"title\", type: \"text\", required: true },\n {\n name: \"summary\",\n type: \"textarea\",\n required: true,\n admin: { description: \"Revealed when the panel expands.\" },\n },\n imageField({ required: true }),\n {\n name: \"href\",\n type: \"text\",\n admin: {\n description: 'Optional \"read more\" destination for this panel.',\n },\n },\n {\n name: \"numeral\",\n type: \"text\",\n admin: {\n description:\n 'Overrides the spine numeral (\"01\", \"II\"). Leave empty to number automatically.',\n },\n },\n ],\n },\n {\n name: \"spineVariant\",\n type: \"select\",\n defaultValue: \"numbered\",\n options: [\n { label: \"Numbered (01, 02)\", value: \"numbered\" },\n { label: \"Volume (I, II)\", value: \"volume\" },\n { label: \"Minimal (no numeral)\", value: \"minimal\" },\n ],\n },\n {\n name: \"watermark\",\n type: \"text\",\n admin: { description: 'Faint mark behind the panels, e.g. a brand word.' },\n },\n {\n name: \"defaultActiveIndex\",\n type: \"number\",\n defaultValue: 0,\n min: 0,\n admin: { description: \"Which panel is open on load, counting from 0.\" },\n },\n // The region's accessible name and the selected/preview state text are\n // not editor concerns; the `@bison-lab/ui` defaults stand.\n ],\n};\n","import type { Block } from \"payload\";\n\nimport { imageField } from \"../../fields/image\";\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\n\n/** An ordered walkthrough that advances on its own. */\nexport const ProcessStepsBlock: Block = {\n slug: \"processSteps\",\n interfaceName: \"ProcessStepsBlock\",\n labels: { singular: \"Process Steps\", plural: \"Process Steps\" },\n fields: [\n {\n name: \"items\",\n type: \"array\",\n required: true,\n // Same reasoning as the showcase panels: the step rail is designed\n // around 3-6 entries, in order. The block opens with the minimum\n // already in place, and the admin field refuses to go below it.\n minRows: 3,\n maxRows: 6,\n defaultValue: emptyRows(3),\n labels: { singular: \"Step\", plural: \"Steps\" },\n admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } },\n // Steps are numbered by position; ordering is drag and drop. There is\n // deliberately no per-step number override.\n fields: [\n { name: \"title\", type: \"text\", required: true },\n { name: \"description\", type: \"textarea\", required: true },\n imageField({ required: true }),\n ],\n },\n {\n name: \"autoAdvance\",\n type: \"checkbox\",\n defaultValue: true,\n admin: {\n description:\n \"Advance on a timer. Always off for visitors who prefer reduced motion.\",\n },\n },\n {\n name: \"autoAdvanceDuration\",\n type: \"number\",\n defaultValue: 6000,\n min: 1000,\n admin: { description: \"Milliseconds each step holds before advancing.\" },\n },\n { name: \"pauseOnHover\", type: \"checkbox\", defaultValue: true },\n {\n name: \"defaultActiveIndex\",\n type: \"number\",\n defaultValue: 0,\n min: 0,\n admin: { description: \"Which step is active on load, counting from 0.\" },\n },\n // The region's accessible name and the play/pause control text are not\n // editor concerns; the `@bison-lab/ui` defaults stand.\n ],\n};\n","import type { Condition, Field } from \"payload\";\n\nexport interface HeadingFieldsOptions {\n /** Require the section heading. Defaults to `true`. */\n required?: boolean;\n /** Description shown under the eyebrow input. */\n eyebrowDescription?: string;\n /**\n * Show the three fields only when this holds, e.g. unless the block floats.\n * Pair it with `required: false`: a hidden required field can never be\n * satisfied, and the block could not publish.\n */\n condition?: Condition;\n}\n\n/**\n * The eyebrow / title / description trio every marketing band opens with.\n *\n * They are three top-level fields rather than a group: editors read a section\n * heading as the first thing in the block, and burying it one collapse deep\n * puts the least-optional copy behind a click. The field names match the\n * `@bison-lab/ui` prop names so the renderers stay a pass-through.\n */\nexport function headingFields({\n required = true,\n eyebrowDescription = \"Small label above the heading. Leave empty to hide the row.\",\n condition,\n}: HeadingFieldsOptions = {}): Field[] {\n const when = condition ? { condition } : {};\n return [\n {\n name: \"eyebrow\",\n type: \"text\",\n admin: { description: eyebrowDescription, ...when },\n },\n { name: \"title\", type: \"text\", required, admin: when },\n { name: \"description\", type: \"textarea\", admin: when },\n ];\n}\n","import type { Block } from \"payload\";\n\nimport { headingFields } from \"../../fields/heading\";\nimport { linkDestinationFields } from \"../../fields/link\";\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\n\n/** A sticky intro beside a column of questions. */\nexport const FaqColumnsBlock: Block = {\n slug: \"faqColumns\",\n interfaceName: \"FaqColumnsBlock\",\n labels: { singular: \"FAQ Columns\", plural: \"FAQ Columns\" },\n fields: [\n ...headingFields(),\n {\n name: \"items\",\n type: \"array\",\n required: true,\n minRows: 1,\n defaultValue: emptyRows(1),\n labels: { singular: \"Question\", plural: \"Questions\" },\n admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } },\n fields: [\n { name: \"question\", type: \"text\", required: true },\n {\n name: \"answer\",\n // Plain text on purpose. A Lexical answer would pull\n // `@payloadcms/richtext-lexical` into the `./react` entry, which\n // every consumer loads; the `richText` block is where prose with\n // links and lists belongs.\n type: \"textarea\",\n required: true,\n },\n ],\n },\n {\n name: \"cta\",\n type: \"group\",\n label: \"Call to action\",\n admin: {\n description: \"Shown under the intro. Leave the link empty to hide it.\",\n },\n fields: [\n {\n name: \"title\",\n type: \"text\",\n admin: { description: 'Lead-in line, e.g. \"Still have questions?\".' },\n },\n { name: \"linkText\", type: \"text\" },\n // The destination is `linkFields()`' shape (the picker, a page or a\n // URL); only the visible text keeps its own name here.\n ...linkDestinationFields(),\n {\n name: \"newTab\",\n type: \"checkbox\",\n label: \"Open in a new tab\",\n defaultValue: false,\n },\n ],\n },\n {\n name: \"sticky\",\n type: \"checkbox\",\n defaultValue: true,\n admin: { description: \"Pin the intro column while the answers scroll.\" },\n },\n {\n name: \"type\",\n type: \"select\",\n defaultValue: \"single\",\n options: [\n { label: \"One answer open at a time\", value: \"single\" },\n { label: \"Several answers open at once\", value: \"multiple\" },\n ],\n },\n {\n name: \"collapsible\",\n type: \"checkbox\",\n defaultValue: true,\n admin: {\n description: \"Allow the open answer to be closed again. Single mode only.\",\n },\n },\n ],\n};\n","import type { Block } from \"payload\";\n\nimport { headingFields } from \"../../fields/heading\";\nimport { imageField } from \"../../fields/image\";\nimport { linkField } from \"../../fields/link\";\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\n\n/** Quotes in a masonry grid, clipped behind a fade once there are enough. */\nexport const TestimonialMasonryBlock: Block = {\n slug: \"testimonialMasonry\",\n interfaceName: \"TestimonialMasonryBlock\",\n labels: { singular: \"Testimonial Masonry\", plural: \"Testimonial Masonry\" },\n fields: [\n ...headingFields(),\n {\n name: \"items\",\n type: \"array\",\n required: true,\n minRows: 1,\n defaultValue: emptyRows(1),\n labels: { singular: \"Testimonial\", plural: \"Testimonials\" },\n admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } },\n fields: [\n { name: \"content\", type: \"textarea\", required: true, label: \"Quote\" },\n {\n name: \"author\",\n type: \"group\",\n fields: [\n { name: \"name\", type: \"text\", required: true },\n {\n name: \"title\",\n type: \"text\",\n admin: {\n description: 'Role or organisation, e.g. \"Orthopaedic surgeon\".',\n },\n },\n imageField({\n name: \"avatar\",\n admin: {\n description:\n \"Optional. Initials from the name are used when empty.\",\n },\n }),\n ],\n },\n ],\n },\n linkField({\n label: \"Link\",\n admin: {\n description:\n \"Shown under the fade, once there are enough quotes to clip.\",\n },\n }),\n {\n name: \"minItemsForFade\",\n type: \"number\",\n defaultValue: 7,\n min: 1,\n admin: {\n description:\n \"How many quotes before the grid clips and the bottom fade appears.\",\n },\n },\n {\n name: \"maxVisibleRows\",\n type: \"number\",\n min: 1,\n admin: { description: \"Rows shown before the fade. Optional.\" },\n },\n ],\n};\n","import type { Block } from \"payload\";\n\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\n\n/**\n * Name, address, phone — the block local SEO is graded on.\n *\n * The `e164` phone number is a separate field from the displayed one because\n * `NapBlock` uses it, and only it, for the `tel:` href and the JSON-LD\n * `telephone`. A prettified string can never silently become an unreachable\n * link.\n */\nexport const NapBlock: Block = {\n slug: \"nap\",\n interfaceName: \"NapBlock\",\n labels: { singular: \"Name, Address, Phone\", plural: \"Name, Address, Phone\" },\n fields: [\n { name: \"businessName\", type: \"text\", required: true, label: \"Business name\" },\n {\n name: \"businessType\",\n type: \"text\",\n required: true,\n defaultValue: \"LocalBusiness\",\n admin: {\n description:\n 'schema.org type, e.g. \"MedicalBusiness\", \"Chiropractor\", \"LocalBusiness\".',\n },\n },\n {\n name: \"address\",\n type: \"group\",\n fields: [\n { name: \"streetAddress\", type: \"text\", required: true },\n { name: \"addressLocality\", type: \"text\", required: true, label: \"City\" },\n {\n name: \"addressRegion\",\n type: \"text\",\n required: true,\n label: \"State or region\",\n },\n { name: \"postalCode\", type: \"text\", required: true },\n {\n name: \"addressCountry\",\n type: \"text\",\n defaultValue: \"US\",\n admin: { description: \"ISO 3166-1 alpha-2, e.g. US.\" },\n },\n ],\n },\n {\n name: \"departments\",\n type: \"array\",\n required: true,\n minRows: 1,\n defaultValue: emptyRows(1),\n labels: { singular: \"Department\", plural: \"Departments\" },\n admin: {\n components: { Field: MIN_ROWS_ARRAY_FIELD },\n description:\n \"A single-location business has one entry, usually named after the business.\",\n },\n fields: [\n { name: \"name\", type: \"text\", required: true },\n {\n name: \"departmentType\",\n type: \"text\",\n admin: {\n description:\n \"schema.org type for this department. Falls back to the business type.\",\n },\n },\n {\n name: \"phoneE164\",\n type: \"text\",\n required: true,\n label: \"Phone (E.164)\",\n admin: {\n description:\n 'Dialable form, e.g. \"+15551234567\". This is what the tel: link and the structured data use.',\n },\n },\n {\n name: \"phoneDisplay\",\n type: \"text\",\n label: \"Phone (as displayed)\",\n admin: {\n description:\n \"Optional. US numbers are formatted automatically when this is empty.\",\n },\n },\n ],\n },\n {\n name: \"url\",\n type: \"text\",\n admin: { description: \"Canonical URL for the business. Optional.\" },\n },\n {\n name: \"showName\",\n type: \"checkbox\",\n defaultValue: true,\n admin: {\n description:\n \"Turn off when a heading above the block already names the business.\",\n },\n },\n {\n name: \"headingLevel\",\n type: \"select\",\n defaultValue: \"h2\",\n options: [\n { label: \"H2\", value: \"h2\" },\n { label: \"H3\", value: \"h3\" },\n { label: \"H4\", value: \"h4\" },\n ],\n admin: { description: \"Keeps the page's heading order intact.\" },\n },\n {\n name: \"emitJsonLd\",\n type: \"checkbox\",\n defaultValue: true,\n label: \"Emit structured data\",\n admin: {\n description:\n \"Adds a schema.org LocalBusiness script. Turn off if the page emits its own.\",\n },\n },\n ],\n};\n","import type { ArrayFieldValidation } from \"payload\";\n\n/**\n * A custom `validate` replaces Payload's stock array check, so any array\n * with its own rule re-applies the row limits first or `minRows` and\n * `maxRows` stop being enforced. Same messages as the stock check, through\n * the request's translator when the admin supplies one.\n */\nexport function rowLimits(\n value: unknown[] | null | undefined,\n { minRows, maxRows, required, req }: Parameters<ArrayFieldValidation>[1],\n): string | true {\n const count = value?.length ?? 0;\n const t = req?.t;\n if (required && count === 0) {\n return t ? t(\"validation:required\") : \"This field is required.\";\n }\n if (minRows && count < minRows) {\n return t\n ? t(\"validation:requiresAtLeast\", {\n count: minRows,\n label: t(\"general:rows\"),\n })\n : `This field requires at least ${minRows} rows.`;\n }\n if (maxRows && count > maxRows) {\n return t\n ? t(\"validation:requiresNoMoreThan\", {\n count: maxRows,\n label: t(\"general:rows\"),\n })\n : `This field requires no more than ${maxRows} rows.`;\n }\n return true;\n}\n","import type { ArrayFieldValidation, Block, Condition } from \"payload\";\n\nimport { headingFields } from \"../../fields/heading\";\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\nimport { rowLimits } from \"../../fields/row-limits\";\n\n/**\n * The rule on `wide`: on phones the band is two per row, so only an odd\n * count has a stat on a row of its own, only one stat can take it, and it\n * has to be a stat that starts a row (the 1st, 3rd or 5th), since a full-row\n * cell beside another cell would leave a hole. The array's own `validate`,\n * so the editor sees the message as they build, and Payload runs it again on\n * publish.\n */\nexport const validateWideFlag: ArrayFieldValidation = (value, options) => {\n const limits = rowLimits(value, options);\n if (limits !== true) return limits;\n const rows = (value ?? []) as { wide?: boolean | null }[];\n const wide = rows.flatMap((row, i) => (row?.wide ? [i] : []));\n if (wide.length > 1) return \"Only one stat can be full width on phones.\";\n if (wide.length === 0) return true;\n if (rows.length % 2 === 0) {\n return \"Full width on phones only applies to an odd number of stats. With an even count every row is already full.\";\n }\n if (wide[0] % 2 !== 0) {\n return \"Only a stat that starts a phone row can be full width: the 1st, 3rd or 5th. Move it up or down one place, or flag another.\";\n }\n return true;\n};\n\n/**\n * An overlapping band is headless: it floats across the seam as a card, and a\n * heading pulled up into the block above would land on the wrong surface.\n * The heading fields disappear from the admin the moment `overlap` is on,\n * and the renderer ignores them if they were filled in first.\n */\nexport const unlessOverlap: Condition = (_data, siblingData) =>\n !(siblingData as { overlap?: boolean | null })?.overlap;\n\n/**\n * A strip of figures: the facts a visitor should take in at a glance.\n *\n * The count, the order and the desktop column count are the editor's. The\n * phone and tablet layouts are the library's: two per row and three per row,\n * with `wide` naming the one stat that takes a full phone row when the count\n * is odd.\n */\nexport const StatsBandBlock: Block = {\n slug: \"statsBand\",\n interfaceName: \"StatsBandBlock\",\n labels: { singular: \"Stats Band\", plural: \"Stats Bands\" },\n fields: [\n ...headingFields({\n required: false,\n eyebrowDescription:\n \"Small label above the heading. The heading and eyebrow are optional; without them the band stands alone.\",\n condition: unlessOverlap,\n }),\n {\n name: \"items\",\n type: \"array\",\n required: true,\n // Designed around four, workable from two: the block opens at its\n // minimum, the house rule for every array here, and the admin field\n // refuses to go below it.\n minRows: 2,\n maxRows: 6,\n defaultValue: emptyRows(2),\n labels: { singular: \"Stat\", plural: \"Stats\" },\n admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } },\n validate: validateWideFlag,\n fields: [\n {\n name: \"value\",\n type: \"text\",\n required: true,\n admin: {\n description:\n 'The figure, as it should read: \"98%\", \"12,000+\", \"L1–S1\".',\n },\n },\n { name: \"label\", type: \"textarea\", required: true },\n {\n name: \"href\",\n type: \"text\",\n admin: {\n description:\n 'Optional. Makes the whole stat a link: a site path (\"/outcomes\") or a full URL.',\n },\n },\n {\n name: \"wide\",\n type: \"checkbox\",\n label: \"Full width on phones\",\n defaultValue: false,\n admin: {\n description:\n \"Phones show two per row. With an odd number of stats, this one takes a row to itself. Only the 1st, 3rd or 5th stat can.\",\n },\n },\n ],\n },\n {\n name: \"columns\",\n type: \"select\",\n defaultValue: \"4\",\n options: [\n { label: \"2\", value: \"2\" },\n { label: \"3\", value: \"3\" },\n { label: \"4\", value: \"4\" },\n { label: \"5\", value: \"5\" },\n { label: \"6\", value: \"6\" },\n ],\n admin: {\n description:\n \"From large screens up, and never more than there are stats. Phones show two per row and tablets three.\",\n },\n },\n {\n name: \"tone\",\n type: \"select\",\n defaultValue: \"card\",\n options: [\n { label: \"Card (bordered, raised)\", value: \"card\" },\n { label: \"Plain (dividers only)\", value: \"plain\" },\n ],\n },\n {\n name: \"align\",\n type: \"select\",\n defaultValue: \"start\",\n options: [\n { label: \"Left\", value: \"start\" },\n { label: \"Centred\", value: \"center\" },\n ],\n },\n {\n name: \"overlap\",\n type: \"checkbox\",\n label: \"Float over the seam with the block above\",\n defaultValue: false,\n admin: {\n description:\n \"The band sits across the join between the block above and the block below. Both make room for it automatically. A floating band is headless: the heading fields above are hidden while this is on.\",\n },\n },\n ],\n};\n","/**\n * The one rule for a typed panel width, shared by the config's validator and\n * the renderer's reader so the two cannot drift: if the validator accepted a\n * value the renderer dropped, the editor would be back to a width that\n * silently does nothing. React-free, because `config.ts` ships from the Node\n * entry.\n */\nconst REM_WIDTH = /^\\s*(\\d+(?:\\.\\d+)?)\\s*(rem)?\\s*$/;\n\n/** \"30\" and \"30rem\" both mean 30rem; anything else is not a width. */\nexport function remWidth(\n value: string | null | undefined,\n): `${number}rem` | null {\n const match = REM_WIDTH.exec(value ?? \"\");\n return match ? (`${Number(match[1])}rem` as `${number}rem`) : null;\n}\n","import type {\n ArrayFieldValidation,\n Block,\n Condition,\n Field,\n SelectField,\n TextFieldSingleValidation,\n} from \"payload\";\n\nimport { linkDestinationFields, linkField, linkFields } from \"../../fields/link\";\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\nimport { rowLimits } from \"../../fields/row-limits\";\nimport { remWidth } from \"./rem-width\";\n\n/**\n * The blocks a header global's `items` array takes.\n *\n * `megaMenuBlock({ variants, icons })` is the first factory-built block in the\n * package. Every other config is a static `Block`; this one cannot be, because\n * the featured-link variants and the icon list are the site's: the CMS only\n * ever offers approved values, the same rule the sites use for block\n * backgrounds. `LinkBlock` is the plain bar item beside it.\n *\n * Until SPI-52 lands in the Spinal Simplicity repo, no site renders its header\n * from these rows; the Storybook `CMS Blocks/MegaMenu` fixture is the only\n * header built from them.\n */\n\n/** One approved value, as a select option. */\nexport interface MegaMenuOption {\n label: string;\n value: string;\n}\n\nexport interface MegaMenuBlockOptions {\n /** Looks a featured link can take. Empty or absent drops the select. */\n variants?: MegaMenuOption[];\n /** Glyphs a list link can carry. Empty or absent drops the select. */\n icons?: MegaMenuOption[];\n}\n\n/** The percent tokens a column can take, as Payload stores them. */\nexport const MEGA_MENU_WIDTHS = [\"25\", \"33\", \"50\", \"66\", \"75\", \"100\"] as const;\nexport type MegaMenuWidthValue = (typeof MEGA_MENU_WIDTHS)[number];\n\n/** Twelfths, so 33 and 66 are real thirds and 33 + 33 + 33 is a full row. */\nconst TWELFTHS: Record<MegaMenuWidthValue, number> = {\n \"25\": 3,\n \"33\": 4,\n \"50\": 6,\n \"66\": 8,\n \"75\": 9,\n \"100\": 12,\n};\n\ninterface ColumnRow {\n width?: MegaMenuWidthValue | null;\n}\n\n/**\n * The rule on `columns`: read as fractions, the widths must total 100%. It is\n * the array's own `validate`, so the editor sees the message as they build,\n * and Payload runs field validation again on publish (only draft saves skip\n * it), so nothing publishes with a short row. Skipped when Advanced has custom\n * widths on.\n */\nexport const validateColumnWidths: ArrayFieldValidation = (value, options) => {\n const limits = rowLimits(value, options);\n if (limits !== true) return limits;\n const siblingData = options.siblingData as { customWidths?: boolean | null };\n if (siblingData?.customWidths || !value?.length) return true;\n\n const twelfths = (value as ColumnRow[]).reduce(\n (sum, row) => sum + TWELFTHS[row?.width ?? \"100\"],\n 0,\n );\n if (twelfths === 12) return true;\n const percent = Math.round((twelfths / 12) * 100);\n return `The columns add up to ${percent}%. They need to add up to 100%.`;\n};\n\n/**\n * The row `levels` segments above the field at `path`, read off the whole\n * document. A condition on a link needs its section; a condition on a column\n * needs its panel. `data` carries the full form, so the path is enough.\n */\nfunction ancestor(\n data: Record<string, unknown>,\n path: (number | string)[],\n levels: number,\n): Record<string, unknown> | undefined {\n let node: unknown = data;\n for (const segment of path.slice(0, path.length - levels)) {\n if (node === null || typeof node !== \"object\") return undefined;\n node = (node as Record<string, unknown>)[segment];\n }\n return node !== null && typeof node === \"object\"\n ? (node as Record<string, unknown>)\n : undefined;\n}\n\n/** `links.N.variant` → its section, three segments up. */\nconst whenSectionFeatured: Condition = (data, _siblingData, { path }) =>\n ancestor(data, path, 3)?.display === \"featured\";\n\n/** A featured link's glyph comes from its variant, so `icon` is a list link's field. */\nconst unlessSectionFeatured: Condition = (data, siblingData, ctx) =>\n !whenSectionFeatured(data, siblingData, ctx);\n\n/** The renderer would fall back to the preset silently; the editor should hear it here instead. */\nexport const validateRemWidth: TextFieldSingleValidation = (value) =>\n !value || remWidth(value) !== null\n ? true\n : \"Type a width in rem, like 30 or 30rem.\";\n\n/** `columns.N.width` → its panel, three segments up. */\nconst whenCustomWidths: Condition = (data, _siblingData, { path }) =>\n Boolean(ancestor(data, path, 3)?.customWidths);\n\nconst unlessCustomWidths: Condition = (data, siblingData, ctx) =>\n !whenCustomWidths(data, siblingData, ctx);\n\nfunction approvedSelect(\n name: string,\n options: MegaMenuOption[] | undefined,\n admin: SelectField[\"admin\"],\n): SelectField[] {\n if (!options?.length) return [];\n return [{ name, type: \"select\", options, admin }];\n}\n\nexport function megaMenuBlock({\n variants,\n icons,\n}: MegaMenuBlockOptions = {}): Block {\n const linkRowFields: Field[] = [\n ...linkFields({ required: true }),\n {\n name: \"description\",\n type: \"textarea\",\n admin: { description: \"Supporting line under the label. Optional.\" },\n },\n ...approvedSelect(\"variant\", variants, {\n description: \"The look of this featured link.\",\n condition: whenSectionFeatured,\n }),\n ...approvedSelect(\"icon\", icons, {\n description: \"Glyph shown before a list link. Optional.\",\n condition: unlessSectionFeatured,\n }),\n ];\n\n return {\n slug: \"megaMenu\",\n interfaceName: \"MegaMenuBlock\",\n labels: { singular: \"Mega menu\", plural: \"Mega menus\" },\n fields: [\n { name: \"label\", type: \"text\", required: true },\n // Landing page: the same picker every other destination uses. Optional\n // — a trigger with no landing page is allowed. Schema change: sites\n // run `payload migrate:create`.\n ...linkDestinationFields({ required: false }),\n {\n name: \"newTab\",\n type: \"checkbox\",\n label: \"Open in a new tab\",\n defaultValue: false,\n },\n {\n name: \"panel\",\n type: \"group\",\n fields: [\n {\n name: \"maxWidth\",\n type: \"select\",\n defaultValue: \"standard\",\n // No \"Full\": a panel anchors under its own trigger, so it cannot\n // span the bar, and capped at a trigger's room it would only\n // equal Wide. A typed rem width lives under Advanced.\n options: [\n { label: \"Narrow\", value: \"narrow\" },\n { label: \"Standard\", value: \"standard\" },\n { label: \"Wide\", value: \"wide\" },\n ],\n },\n {\n name: \"columns\",\n type: \"array\",\n required: true,\n minRows: 1,\n maxRows: 4,\n defaultValue: emptyRows(1),\n labels: { singular: \"Column\", plural: \"Columns\" },\n validate: validateColumnWidths,\n admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } },\n fields: [\n {\n name: \"width\",\n type: \"select\",\n defaultValue: \"100\",\n options: MEGA_MENU_WIDTHS.map((value) => ({\n label: `${value}%`,\n value,\n })),\n admin: { condition: unlessCustomWidths },\n },\n {\n name: \"customWidth\",\n type: \"text\",\n admin: {\n description: \"A CSS width: 13rem, 1fr, minmax(0, 1fr)\",\n condition: whenCustomWidths,\n },\n },\n {\n name: \"divider\",\n type: \"checkbox\",\n label: \"Draw a line on the left of this column\",\n defaultValue: false,\n },\n {\n name: \"sections\",\n type: \"array\",\n labels: { singular: \"Section\", plural: \"Sections\" },\n fields: [\n {\n name: \"eyebrow\",\n type: \"text\",\n admin: {\n description:\n \"Small heading above this group; leave empty for none\",\n },\n },\n {\n name: \"display\",\n type: \"select\",\n defaultValue: \"list\",\n options: [\n { label: \"Featured\", value: \"featured\" },\n { label: \"List\", value: \"list\" },\n ],\n },\n {\n name: \"hideDescriptionsOnMobile\",\n type: \"checkbox\",\n label: \"Hide descriptions on mobile\",\n defaultValue: true,\n },\n {\n name: \"links\",\n type: \"array\",\n labels: { singular: \"Link\", plural: \"Links\" },\n fields: linkRowFields,\n },\n ],\n },\n ],\n },\n {\n name: \"footer\",\n type: \"group\",\n admin: {\n description:\n \"The strip under the columns. Leave both empty for no footer.\",\n },\n fields: [\n linkField({\n name: \"overview\",\n label: \"Overview link\",\n admin: {\n description:\n \"The section's own landing page, so it stays reachable from the bar.\",\n },\n }),\n linkField({ name: \"cta\", label: \"Call to action\" }),\n ],\n },\n {\n type: \"collapsible\",\n label: \"Advanced\",\n admin: { initCollapsed: true },\n fields: [\n {\n name: \"customWidths\",\n type: \"checkbox\",\n label:\n \"Type a CSS width for each column instead of choosing a percentage\",\n defaultValue: false,\n },\n {\n name: \"customMaxWidth\",\n type: \"text\",\n validate: validateRemWidth,\n admin: {\n description:\n \"Panel width in rem, e.g. 30. Leave empty to use the preset above.\",\n },\n },\n ],\n },\n ],\n },\n ],\n };\n}\n\n/** A plain bar item: label and destination, nothing to open. */\nexport const LinkBlock: Block = {\n slug: \"navLink\",\n interfaceName: \"NavLinkBlock\",\n labels: { singular: \"Link\", plural: \"Links\" },\n fields: linkFields({ required: true }),\n};\n","/**\n * The import-map path of the header-items kit editor, `NavItemsField` in\n * `@bison-lab/payload-blocks/admin`.\n *\n * It sits on `createNavigation`'s `header.items` blocks field and replaces\n * Payload's stock blocks UI. Referenced here by package specifier, like\n * `LINK_FIELD`; a site picks it up with `payload generate:importmap`.\n * Until it does, Payload logs the missing entry and renders the field as\n * nothing (a custom `Field` with no component behind it is an empty\n * element, not the stock blocks UI), so the step is part of adopting this\n * release (SPI-99).\n *\n * Bar behaviour (hide on scroll, viewport, default panel width) stays on\n * BIS-64. Payload's left nav stays until BIS-90. New page blocks still\n * ship stock nesting until those issues adopt this kit.\n */\nexport const NAV_ITEMS_FIELD = \"@bison-lab/payload-blocks/admin#NavItemsField\";\n","/**\n * The upload side of the boundary.\n *\n * A Payload upload field holds either the row's id or, once depth resolves it,\n * the whole document. Neither shape can be imported from here: `Media` is\n * generated per site, and this package must never reach for a site's\n * `payload-types`. So the doc is described structurally, and every renderer\n * goes through `resolveMedia` rather than reading `.url` itself.\n */\n\n/**\n * The subset of a Payload upload document a block renderer actually reads.\n * Every site's generated `Media` interface is assignable to this, whatever\n * else it carries.\n *\n * Deliberately no index signature: TypeScript refuses to assign an interface\n * to a type with one, and a site's generated `Media` is always an interface.\n * An index signature here would break exactly the structural match this type\n * exists to provide.\n */\nexport interface MediaDoc {\n url?: string | null;\n alt?: string | null;\n width?: number | null;\n height?: number | null;\n}\n\n/** What an upload field holds before and after `depth` populates it. */\nexport type MediaValue = number | string | MediaDoc | null | undefined;\n\n/** A resolved image, in the shape every `@bison-lab/ui` block asks for. */\nexport interface ResolvedMedia {\n src: string;\n alt: string;\n width?: number;\n height?: number;\n}\n\nfunction isMediaDoc(value: MediaValue): value is MediaDoc {\n return typeof value === \"object\" && value !== null;\n}\n\n/**\n * Narrows an upload value to something renderable, or `undefined`.\n *\n * `undefined` covers three cases a renderer must treat identically: the field\n * is empty, `depth: 0` left it as a bare id, or the document exists but has no\n * `url` yet (an upload mid-flight). A renderer that gets `undefined` omits the\n * image rather than emitting a broken `<img>`.\n *\n * `alt` is always a string: the media collection requires it, but a draft saved\n * before that validation ran can still reach a renderer, and an `alt` of\n * `undefined` would silently drop the attribute entirely.\n */\nexport function resolveMedia(value: MediaValue): ResolvedMedia | undefined {\n if (!isMediaDoc(value)) return undefined;\n const { url, alt, width, height } = value;\n if (typeof url !== \"string\" || url.length === 0) return undefined;\n return {\n src: url,\n alt: typeof alt === \"string\" ? alt : \"\",\n ...(typeof width === \"number\" ? { width } : {}),\n ...(typeof height === \"number\" ? { height } : {}),\n };\n}\n","import type { FaqColumnsBlockData } from \"../../types\";\n\nexport const faqColumnsSample: FaqColumnsBlockData = {\n id: \"sample-faq-columns\",\n blockType: \"faqColumns\",\n eyebrow: \"Good to know\",\n title: \"Questions patients ask before their first visit\",\n description:\n \"If yours is not here, the front desk answers the phone between eight and six on weekdays.\",\n items: [\n {\n id: \"sample-faq-referral\",\n question: \"Do I need a referral?\",\n answer:\n \"No. You can book directly. Some insurers ask for one before they reimburse, so check your policy if you plan to claim.\",\n },\n {\n id: \"sample-faq-sessions\",\n question: \"How many sessions will I need?\",\n answer:\n \"Most plans finish in six to eight sessions. You will get a written estimate after your assessment, and we revise it with you as you progress.\",\n },\n {\n id: \"sample-faq-wear\",\n question: \"What should I wear?\",\n answer:\n \"Anything you can move in. Shorts for a knee or hip, a vest or loose top for a shoulder or neck.\\n\\nThere are changing rooms if you are coming from work.\",\n },\n {\n id: \"sample-faq-insurance\",\n question: \"Is treatment covered by insurance?\",\n answer:\n \"Usually, once conservative treatment has been recommended. We invoice you directly and give you everything the insurer needs to reimburse you.\",\n },\n {\n id: \"sample-faq-cancel\",\n question: \"What is the cancellation policy?\",\n answer:\n \"Twenty-four hours' notice, by phone or through the booking link in your confirmation email. Later than that and the session is charged.\",\n },\n ],\n cta: {\n title: \"Still have questions?\",\n linkText: \"Call the front desk\",\n type: \"external\",\n href: \"tel:+13035550142\",\n newTab: false,\n },\n sticky: true,\n type: \"single\",\n collapsible: true,\n};\n","import type { MediaDoc } from \"./media\";\n\nexport interface SampleImageOptions {\n /** Text drawn across the placeholder, e.g. \"Panel 1 · 1400 × 1000\". */\n label: string;\n width: number;\n height: number;\n /** Alt text for the document. Defaults to the label. */\n alt?: string;\n}\n\nfunction escapeXml(value: string): string {\n return value\n .replaceAll(\"&\", \"&\")\n .replaceAll(\"<\", \"<\")\n .replaceAll(\">\", \">\")\n .replaceAll('\"', \""\");\n}\n\n/**\n * A placeholder upload document for a block sample.\n *\n * A preview has no site media behind it, so the image has to travel with the\n * sample. This is an inline SVG as a `data:` URL, in the `MediaDoc` shape\n * `resolveMedia` already narrows, with `width` and `height` set so an image\n * adapter can reserve the box. The scheme is what tells an adapter which kind\n * of source it has: `next/image` treats a `data:` src as `unoptimized` on its\n * own, so a site's adapter needs no special case for samples.\n *\n * Neutral greys rather than theme tokens: the SVG is a standalone document\n * and cannot see the page's custom properties.\n */\nexport function sampleImage({\n label,\n width,\n height,\n alt,\n}: SampleImageOptions): MediaDoc {\n const fontSize = Math.max(12, Math.round(Math.min(width, height) / 12));\n const svg =\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${width}\" height=\"${height}\" viewBox=\"0 0 ${width} ${height}\">` +\n `<rect width=\"100%\" height=\"100%\" fill=\"#d4d4d8\"/>` +\n `<text x=\"50%\" y=\"50%\" dominant-baseline=\"middle\" text-anchor=\"middle\" ` +\n `font-family=\"system-ui, sans-serif\" font-size=\"${fontSize}\" fill=\"#52525b\">` +\n `${escapeXml(label)}</text></svg>`;\n return {\n url: `data:image/svg+xml,${encodeURIComponent(svg)}`,\n alt: alt ?? label,\n width,\n height,\n };\n}\n","import { sampleImage } from \"../../sample-image\";\nimport type { HeroBlockData } from \"../../types\";\n\n/**\n * The placeholder hero's sample. The hero family (BIS-45) ships a sample per\n * hero as each one is added; this is the one for the plain renderer.\n */\nexport const heroSample: HeroBlockData = {\n id: \"sample-hero\",\n blockType: \"hero\",\n eyebrow: \"Now booking spring appointments\",\n heading: \"Move well again, without the long wait\",\n body: \"Same-week assessments with a physiotherapist who stays with you from the first visit to the last. Most treatment plans finish in six to eight sessions.\",\n tone: \"sweep\",\n image: sampleImage({\n label: \"Hero background · 2000 × 1000\",\n width: 2000,\n height: 1000,\n alt: \"A bright, open treatment room\",\n }),\n // One link per shape: a page, carried inline as `depth: 1` would populate\n // it, so the preview needs no pages collection; and an external URL.\n links: [\n {\n type: \"page\",\n page: {\n id: \"sample-page-book\",\n title: \"Book an assessment\",\n slug: \"book\",\n _status: \"published\",\n },\n label: \"Book an assessment\",\n newTab: false,\n },\n {\n type: \"external\",\n href: \"https://example.com/approach\",\n label: \"See our approach\",\n newTab: true,\n },\n ],\n};\n","import type { MegaMenuBlockData, NavLinkBlockData } from \"../../types\";\nimport type { MegaMenuBlockOptions } from \"./config\";\n\n/**\n * The options the mega menu sample was written against. A factory block's\n * sample only fits a config built with the same approved values, so a\n * preview builds its block with `megaMenuBlock(megaMenuSampleOptions)`.\n */\nexport const megaMenuSampleOptions = {\n variants: [\n { label: \"Lumbar\", value: \"lumbar\" },\n { label: \"SI joint\", value: \"si\" },\n ],\n icons: [\n { label: \"Help\", value: \"help\" },\n { label: \"Mail\", value: \"mail\" },\n ],\n} satisfies MegaMenuBlockOptions;\n\n/**\n * Spinal Simplicity's Patients panel as a saved row: two featured territories\n * in a 75% column, two rail sections in a divided 25% column, overview and\n * CTA. Every field is set at least once; the Advanced fields are set but off,\n * so the percent widths are what renders. Most links are site paths typed as\n * external links; Testimonials and the overview are page links carried\n * inline, as `depth: 1` would populate them, so the preview needs no pages\n * collection.\n */\nexport const megaMenuSample: MegaMenuBlockData = {\n id: \"sample-mega-menu\",\n blockType: \"megaMenu\",\n label: \"Patients\",\n type: \"external\",\n href: \"/patients\",\n newTab: false,\n panel: {\n maxWidth: \"standard\",\n columns: [\n {\n id: \"treatment\",\n width: \"75\",\n customWidth: \"minmax(0, 1fr)\",\n divider: false,\n sections: [\n {\n id: \"territories\",\n eyebrow: \"Treatment\",\n display: \"featured\",\n hideDescriptionsOnMobile: true,\n links: [\n {\n id: \"lumbar\",\n label: \"Low Back Pain\",\n type: \"external\",\n href: \"/patients/low-back-pain\",\n newTab: false,\n description:\n \"Persistent low back pain from lumbar instability, often with leg pain that limits standing or walking.\",\n variant: \"lumbar\",\n },\n {\n id: \"si\",\n label: \"Hip Pain\",\n type: \"external\",\n href: \"/patients/hip-pain\",\n newTab: false,\n description:\n \"Pain centered on the sacroiliac joint, often worse with sitting or climbing stairs.\",\n variant: \"si\",\n },\n ],\n },\n ],\n },\n {\n id: \"rail\",\n width: \"25\",\n customWidth: \"13rem\",\n divider: true,\n sections: [\n {\n id: \"outcomes\",\n eyebrow: \"Patient Outcomes\",\n display: \"list\",\n hideDescriptionsOnMobile: true,\n links: [\n {\n id: \"stories\",\n label: \"Testimonials\",\n type: \"page\",\n page: {\n id: \"sample-page-stories\",\n title: \"Testimonials\",\n slug: \"patients/stories\",\n _status: \"published\",\n },\n newTab: false,\n },\n { id: \"research\", label: \"Research\", type: \"external\", href: \"/patients/research\", newTab: false },\n { id: \"path\", label: \"Path to Relief\", type: \"external\", href: \"/patients/path-to-relief\", newTab: false },\n ],\n },\n {\n id: \"support\",\n eyebrow: \"Support\",\n display: \"list\",\n hideDescriptionsOnMobile: false,\n links: [\n {\n id: \"faqs\",\n label: \"FAQs\",\n type: \"external\",\n href: \"/patients/faqs\",\n newTab: false,\n description: \"Short answers to the questions patients ask first.\",\n icon: \"help\",\n },\n {\n id: \"contact\",\n label: \"Contact\",\n type: \"external\",\n href: \"https://example.com/contact\",\n newTab: true,\n icon: \"mail\",\n },\n ],\n },\n ],\n },\n ],\n footer: {\n overview: {\n label: \"All patient resources\",\n type: \"page\",\n page: { id: \"sample-page-patients\", title: \"Patients\", slug: \"patients\", _status: \"published\" },\n newTab: false,\n },\n cta: { label: \"Find a Doctor\", type: \"external\", href: \"/find-a-doctor\", newTab: false },\n },\n customWidths: false,\n customMaxWidth: \"42rem\",\n },\n};\n\n/** A plain bar item. */\nexport const navLinkSample: NavLinkBlockData = {\n id: \"sample-nav-link\",\n blockType: \"navLink\",\n label: \"Contact\",\n type: \"external\",\n href: \"/contact\",\n newTab: false,\n};\n","import type { NapBlockData } from \"../../types\";\n\n/**\n * A fictional clinic. `emitJsonLd` is off: the block emits schema.org\n * `LocalBusiness` by default, and a preview must not put a business that does\n * not exist into a site's structured data. The phone numbers are in the\n * 555-01xx range reserved for fiction.\n */\nexport const napSample: NapBlockData = {\n id: \"sample-nap\",\n blockType: \"nap\",\n businessName: \"Larkspur Physiotherapy\",\n businessType: \"Physiotherapy\",\n address: {\n streetAddress: \"400 Larkspur Lane, Suite 120\",\n addressLocality: \"Boulder\",\n addressRegion: \"CO\",\n postalCode: \"80302\",\n addressCountry: \"US\",\n },\n departments: [\n {\n id: \"sample-dept-front-desk\",\n name: \"Front desk\",\n phoneE164: \"+13035550142\",\n phoneDisplay: \"(303) 555-0142\",\n },\n {\n id: \"sample-dept-billing\",\n name: \"Billing and insurance\",\n departmentType: \"AccountingService\",\n phoneE164: \"+13035550143\",\n },\n ],\n url: \"https://example.com\",\n showName: true,\n headingLevel: \"h2\",\n emitJsonLd: false,\n};\n","import { sampleImage } from \"../../sample-image\";\nimport type { ProcessStepsBlockData } from \"../../types\";\n\n/** Four steps: enough to show the rail advancing through a real sequence. */\nexport const processStepsSample: ProcessStepsBlockData = {\n id: \"sample-process-steps\",\n blockType: \"processSteps\",\n items: [\n {\n id: \"sample-step-assess\",\n title: \"Assessment\",\n description:\n \"A fifty-minute first visit: your history, a movement screen, and a clear explanation of what we found.\",\n image: sampleImage({\n label: \"Step 1 · 1600 × 1000\",\n width: 1600,\n height: 1000,\n alt: \"A physiotherapist taking notes during an assessment\",\n }),\n },\n {\n id: \"sample-step-plan\",\n title: \"Your plan\",\n description:\n \"A written plan with the number of sessions we expect, what each one is for, and the exercises between them.\",\n image: sampleImage({\n label: \"Step 2 · 1600 × 1000\",\n width: 1600,\n height: 1000,\n alt: \"A printed treatment plan on a desk\",\n }),\n },\n {\n id: \"sample-step-treat\",\n title: \"Treatment\",\n description:\n \"Hands-on work where it helps, and progressive loading where it matters. You leave every session knowing what to do next.\",\n image: sampleImage({\n label: \"Step 3 · 1600 × 1000\",\n width: 1600,\n height: 1000,\n alt: \"A patient lifting a light kettlebell under supervision\",\n }),\n },\n {\n id: \"sample-step-discharge\",\n title: \"Discharge and beyond\",\n description:\n \"A final review, a maintenance programme, and an open door if anything flares up later.\",\n image: sampleImage({\n label: \"Step 4 · 1600 × 1000\",\n width: 1600,\n height: 1000,\n alt: \"A patient walking out of the clinic\",\n }),\n },\n ],\n autoAdvance: true,\n autoAdvanceDuration: 5000,\n pauseOnHover: true,\n defaultActiveIndex: 0,\n};\n","import type { RichTextBlockData, RichTextContent } from \"../../types\";\n\n/**\n * A serialized Lexical document, written by hand in the shapes the default\n * JSX converters read (`heading`, `paragraph`, `text`, `list`, `link`).\n * `version` is on every serialized Lexical node, and `direction`, `format` and\n * `indent` are what `RichTextContent` requires on the root; the converters\n * read none of them, and the sample carries them so it is shaped like a row\n * the editor saved.\n */\nconst block = {\n direction: \"ltr\" as const,\n format: \"\",\n indent: 0,\n version: 1,\n};\n\nfunction text(value: string, format = 0) {\n return {\n type: \"text\",\n text: value,\n format,\n detail: 0,\n mode: \"normal\",\n style: \"\",\n version: 1,\n };\n}\n\nfunction paragraph(children: unknown[]) {\n return { type: \"paragraph\", children, textFormat: 0, textStyle: \"\", ...block };\n}\n\nconst BOLD = 1;\n\nconst content: RichTextContent = {\n root: {\n type: \"root\",\n ...block,\n children: [\n {\n type: \"heading\",\n tag: \"h2\",\n children: [text(\"What to expect at your first visit\")],\n ...block,\n },\n paragraph([\n text(\"Your first appointment runs about \"),\n text(\"fifty minutes\", BOLD),\n text(\n \". We start with a conversation about what brought you in, then a movement assessment, and you leave with a written plan and the first two exercises.\",\n ),\n ]),\n paragraph([\n text(\"Bring comfortable clothes and any recent imaging. If you have questions before you arrive, \"),\n {\n type: \"link\",\n fields: { url: \"https://example.com/contact\", newTab: true, linkType: \"custom\" },\n children: [text(\"get in touch\")],\n ...block,\n version: 3,\n },\n text(\".\"),\n ]),\n {\n type: \"list\",\n listType: \"bullet\",\n tag: \"ul\",\n start: 1,\n children: [\n \"Assessment and written plan\",\n \"Hands-on treatment where it helps\",\n \"Exercises you can do at home, with video\",\n ].map((item, i) => ({\n type: \"listitem\",\n value: i + 1,\n children: [text(item)],\n ...block,\n })),\n ...block,\n },\n ],\n },\n};\n\nexport const richTextSample: RichTextBlockData = {\n id: \"sample-rich-text\",\n blockType: \"richText\",\n content,\n};\n","import { sampleImage } from \"../../sample-image\";\nimport type { ShowcasePanelsBlockData } from \"../../types\";\n\n/** Three panels: the minimum the layout is designed around. */\nexport const showcasePanelsSample: ShowcasePanelsBlockData = {\n id: \"sample-showcase-panels\",\n blockType: \"showcasePanels\",\n items: [\n {\n id: \"sample-panel-back\",\n title: \"Back and neck pain\",\n summary:\n \"Most back pain settles with the right movement, not rest. We find what is driving yours and build a plan around your week, not ours.\",\n image: sampleImage({\n label: \"Panel 1 · 1400 × 1000\",\n width: 1400,\n height: 1000,\n alt: \"A physiotherapist guiding a patient through a stretch\",\n }),\n href: \"/services/back-and-neck\",\n // Matches what automatic numbering would show, so the preview does not\n // mislead; it is here to exercise the override.\n numeral: \"01\",\n },\n {\n id: \"sample-panel-sport\",\n title: \"Sports injuries\",\n summary:\n \"From a rolled ankle to a post-surgical knee: a return-to-play plan with clear milestones, so you know when you are ready.\",\n image: sampleImage({\n label: \"Panel 2 · 1400 × 1000\",\n width: 1400,\n height: 1000,\n alt: \"A runner mid-stride on a track\",\n }),\n href: \"/services/sports-injuries\",\n },\n {\n id: \"sample-panel-post-op\",\n title: \"Post-operative rehab\",\n summary:\n \"We work from your surgeon's protocol and keep them in the loop, so every stage of recovery is signed off before the next begins.\",\n image: sampleImage({\n label: \"Panel 3 · 1400 × 1000\",\n width: 1400,\n height: 1000,\n alt: \"A patient on a rehabilitation bike\",\n }),\n },\n ],\n spineVariant: \"numbered\",\n watermark: \"LARKSPUR\",\n defaultActiveIndex: 0,\n};\n","import type { StatsBandBlockData } from \"../../types\";\n\n/**\n * Four figures, the count the strip was designed around: one row on a\n * desktop, two by two on a tablet and a phone. `wide` is set (to `false`) so\n * the preview exercises the field, and an even count is where it is ignored.\n * `overlap` is off so the heading shows: a floating band is headless, and a\n * preview page has no hero for it to float over.\n */\nexport const statsBandSample: StatsBandBlockData = {\n id: \"sample-stats-band\",\n blockType: \"statsBand\",\n eyebrow: \"At a glance\",\n title: \"The clinic in numbers\",\n description:\n \"What a year looks like across our two rooms, counted from the front desk rather than estimated.\",\n items: [\n {\n id: \"sample-stat-pain\",\n value: \"94%\",\n label: \"of patients report less pain by their sixth session.\",\n href: \"/outcomes\",\n wide: false,\n },\n {\n id: \"sample-stat-visits\",\n value: \"4,200+\",\n label: \"appointments a year across two treatment rooms.\",\n },\n {\n id: \"sample-stat-wait\",\n value: \"15 min\",\n label: \"average wait from the front desk to the treatment room.\",\n },\n {\n id: \"sample-stat-years\",\n value: \"12\",\n label: \"years in the same building, on the same street.\",\n },\n ],\n columns: \"4\",\n tone: \"card\",\n align: \"start\",\n overlap: false,\n};\n","import { sampleImage } from \"../../sample-image\";\nimport type { TestimonialMasonryBlockData } from \"../../types\";\n\nfunction avatar(name: string) {\n return sampleImage({\n label: name\n .split(\" \")\n .map((part) => part[0])\n .join(\"\"),\n width: 160,\n height: 160,\n alt: `Portrait of ${name}`,\n });\n}\n\n/**\n * Six quotes, two of them without an avatar so the initials fallback shows.\n * `minItemsForFade` is lowered to six so the preview also shows the fade and\n * the link beneath it, which the default of seven would hide at this count.\n */\nexport const testimonialMasonrySample: TestimonialMasonryBlockData = {\n id: \"sample-testimonial-masonry\",\n blockType: \"testimonialMasonry\",\n eyebrow: \"From our patients\",\n title: \"What people say after they finish\",\n description:\n \"Every review here was left by a patient we discharged. We do not edit them.\",\n items: [\n {\n id: \"sample-quote-1\",\n content:\n \"I had written off running. Eight weeks later I did a parkrun, and the plan I was given actually fitted around a job and two kids.\",\n author: {\n name: \"Priya Natarajan\",\n title: \"Recovered from a hamstring tear\",\n avatar: avatar(\"Priya Natarajan\"),\n },\n },\n {\n id: \"sample-quote-2\",\n content:\n \"The first physio who explained what was wrong in words I understood.\",\n author: {\n name: \"Tom Ferreira\",\n title: \"Lower back pain\",\n avatar: avatar(\"Tom Ferreira\"),\n },\n },\n {\n id: \"sample-quote-3\",\n content:\n \"My surgeon said my knee was ahead of schedule at every check-in. That was the rehab, not me.\",\n author: { name: \"Aisha Bello\", title: \"ACL reconstruction\" },\n },\n {\n id: \"sample-quote-4\",\n content:\n \"Booked on a Tuesday, seen on the Thursday. The shoulder I had put up with for a year was sorted in six visits.\",\n author: {\n name: \"Marcus Whitfield\",\n title: \"Frozen shoulder\",\n avatar: avatar(\"Marcus Whitfield\"),\n },\n },\n {\n id: \"sample-quote-5\",\n content:\n \"They kept my consultant in the loop the whole way through, which nobody else had bothered to do.\",\n author: { name: \"Helen Ostrowski\" },\n },\n {\n id: \"sample-quote-6\",\n content:\n \"Honest about what would take time and what would not. I would send my parents here.\",\n author: {\n name: \"Daniel Kim\",\n title: \"Ankle sprain\",\n avatar: avatar(\"Daniel Kim\"),\n },\n },\n ],\n link: {\n type: \"external\",\n href: \"https://example.com/reviews\",\n label: \"Read every review\",\n newTab: true,\n },\n minItemsForFade: 6,\n maxVisibleRows: 2,\n};\n","import { faqColumnsSample } from \"./blocks/faq-columns/sample\";\nimport { heroSample } from \"./blocks/hero/sample\";\nimport { megaMenuSample, navLinkSample } from \"./blocks/mega-menu/sample\";\nimport { napSample } from \"./blocks/nap/sample\";\nimport { processStepsSample } from \"./blocks/process-steps/sample\";\nimport { richTextSample } from \"./blocks/rich-text/sample\";\nimport { showcasePanelsSample } from \"./blocks/showcase-panels/sample\";\nimport { statsBandSample } from \"./blocks/stats-band/sample\";\nimport { testimonialMasonrySample } from \"./blocks/testimonial-masonry/sample\";\nimport type { BisonBlockData, BisonBlockType } from \"./types\";\n\n/**\n * One sample row per block, each typed to its own row shape. Assignable to\n * `Record<BisonBlockType, BisonBlockData>` wherever the wider type is wanted.\n */\nexport type BlockSamples = {\n [K in BisonBlockType]: Extract<BisonBlockData, { blockType: K }>;\n};\n\n/**\n * Every block the package ships, rendered without a CMS row.\n *\n * A Block library page (BIS-52) renders these live so an admin can see each\n * block before enabling it. Each sample lives beside its block's `config.ts`\n * and `component.tsx` as `sample.ts`, and `src/__tests__/samples.test.tsx`\n * locks the contract: one entry per slug, `blockType` matching the key, every\n * config field exercised at least once, and every image self-contained.\n *\n * React-free on purpose: it is read from a Global's field config, which\n * Payload loads in plain Node like the rest of this entry, as well as from a\n * route handler. Only what this package ships is here; a site supplies samples\n * for its own blocks through the Block library factory, whose option BIS-52\n * names.\n */\nexport const blockSamples: BlockSamples = {\n hero: heroSample,\n richText: richTextSample,\n showcasePanels: showcasePanelsSample,\n processSteps: processStepsSample,\n faqColumns: faqColumnsSample,\n testimonialMasonry: testimonialMasonrySample,\n nap: napSample,\n statsBand: statsBandSample,\n // Header blocks: rendered by `MegaMenuBlockRenderer` and `headerItemsFromBlocks`,\n // never by `RenderBlocks`. The mega menu sample fits `megaMenuBlock(megaMenuSampleOptions)`.\n megaMenu: megaMenuSample,\n navLink: navLinkSample,\n};\n"],"mappings":";;;;;;;;;;AA4BA,SAAgB,WAAW,YAA+B,EAAE,EAAoB;AAC9E,QAAO;EACL,MAAM;EACN,MA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D;GACD;IACE,IAAI;IACJ,SACE;IACF,QAAQ;KACN,MAAM;KACN,OAAO;KACP,QAAQ,OAAO,mBAAmB;KACnC;IACF;GACD;IACE,IAAI;IACJ,SACE;IACF,QAAQ,EAAE,MAAM,mBAAmB;IACpC;GACD;IACE,IAAI;IACJ,SACE;IACF,QAAQ;KACN,MAAM;KACN,OAAO;KACP,QAAQ,OAAO,aAAa;KAC7B;IACF;GACF;EACD,MAAM;GACJ,MAAM;GACN,MAAM;GACN,OAAO;GACP,QAAQ;GACT;EACD,iBAAiB;EACjB,gBAAgB;EACjB;CChDC,KAAK;CACL,WAAW;CAGX,UAAU;CACV,SAAS;CACV"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/fields/image.ts","../src/fields/link.ts","../src/blocks/hero/config.ts","../src/blocks/rich-text/config.ts","../src/fields/min-rows.ts","../src/blocks/showcase-panels/config.ts","../src/blocks/process-steps/config.ts","../src/fields/heading.ts","../src/blocks/faq-columns/config.ts","../src/blocks/testimonial-masonry/config.ts","../src/blocks/nap/config.ts","../src/fields/row-limits.ts","../src/blocks/stats-band/config.ts","../src/blocks/mega-menu/config.ts","../src/fields/nav-items.ts","../src/media.ts","../src/blocks/faq-columns/sample.ts","../src/sample-image.ts","../src/blocks/hero/sample.ts","../src/blocks/mega-menu/sample.ts","../src/blocks/nap/sample.ts","../src/blocks/process-steps/sample.ts","../src/blocks/rich-text/sample.ts","../src/blocks/showcase-panels/sample.ts","../src/blocks/stats-band/sample.ts","../src/blocks/testimonial-masonry/sample.ts","../src/samples.ts"],"sourcesContent":["import type { CollectionSlug, UploadField } from \"payload\";\n\n/**\n * Payload's `UploadField` is a union over the polymorphic (`relationTo: [...]`)\n * and `hasMany` variants. A block image is neither, and narrowing here is what\n * lets `imageField({ name: 'portrait' })` stay type-checked at the call site.\n */\ntype MediaUploadField = Extract<\n UploadField,\n { hasMany?: false; relationTo: CollectionSlug }\n>;\n\nexport interface ImageFieldOptions extends Partial<MediaUploadField> {\n /**\n * The upload collection to point at. Every Bison Lab site names it `media`,\n * but a site that does not can say so without forking the field.\n */\n relationTo?: CollectionSlug;\n}\n\n/**\n * A single image from the site's upload collection, for any block with a\n * picture in it.\n *\n * Optional unless the block says otherwise: `imageField({ name: 'portrait',\n * required: true })`. `admin` is replaced, not merged, so a block that passes\n * its own description writes the whole thing.\n */\nexport function imageField(overrides: ImageFieldOptions = {}): MediaUploadField {\n return {\n name: \"image\",\n type: \"upload\",\n relationTo: \"media\" as CollectionSlug,\n // Payload stars a required field and says nothing about an optional one,\n // so an optional image says so itself, and only then.\n ...(overrides.required ? {} : { admin: { description: \"Optional.\" } }),\n ...overrides,\n } as MediaUploadField;\n}\n","import type { Condition, Field, GroupField, RowField } from \"payload\";\n\n/**\n * The import-map path of the link picker, `LinkField` in\n * `@bison-lab/payload-blocks/admin`.\n *\n * It sits on the row that holds a link's `type`, `page` and `href`, and\n * replaces those three inputs with one box: type to search published pages,\n * or paste a URL. Referenced here by package specifier, like\n * `MIN_ROWS_ARRAY_FIELD`; a site picks it up with `payload generate:importmap`.\n * Until it does, Payload logs the missing entry and renders the row as\n * nothing (a custom `Field` with no component behind it is an empty element,\n * not the stock fields), so the step is part of adopting this release.\n */\nexport const LINK_FIELD = \"@bison-lab/payload-blocks/admin#LinkField\";\n\nexport type LinkType = \"page\" | \"external\";\n\n/**\n * A page as the `page` relationship populates it: what `resolveLink` reads,\n * and what the picker shows. A site's generated `Page` is assignable to it.\n * `_status` is absent on a collection without drafts, which counts as\n * published.\n */\nexport interface LinkPageDoc {\n id: number | string;\n title?: string | null;\n slug?: string | null;\n _status?: (\"draft\" | \"published\") | null;\n}\n\n/** Where a link goes: the three fields the picker writes. */\nexport interface LinkDestination {\n /** `page` unless the editor pasted a URL. Rows saved before links had a type carry only `href`. */\n type?: LinkType | null;\n /** The page's id, or the page itself once a `depth >= 1` read populates it. */\n page?: LinkPageDoc | number | string | null;\n /** The pasted URL of an external link. */\n href?: string | null;\n}\n\n/** The shape `linkField`/`linkFields` produce once Payload generates types. */\nexport interface LinkValue extends LinkDestination {\n enabled?: boolean | null;\n label?: string | null;\n newTab?: boolean | null;\n}\n\n/**\n * Turns a link's destination into the `href` a renderer emits, or `null`\n * when there is nothing to point at, in which case the renderer shows the\n * label as text. A site passes its own (`RenderBlocks`' `resolveLink`) when\n * a page's path is not `/<slug>`: the package has no way to know a site's\n * routes, the same reason it takes an `imageComponent`.\n */\nexport type ResolveLink = (link: LinkDestination) => string | null;\n\n/**\n * The package's resolver: a published, populated page is `/<slug>`; an\n * external link is its `href` as typed.\n *\n * A page that did not populate is `null`: Payload hands the public read the\n * bare id when the reader may not see the page, which is what an unpublished\n * page looks like from the site. A populated page whose `_status` is `draft`\n * is `null` too, for a read that can see drafts. A row from before links had\n * a `type` is an external link by `linkTypeOf`, here, in the stock fields'\n * conditions and in the picker alike: the site keeps rendering its `href`,\n * the admin shows it as an External chip, and the site's migration to\n * `type: external` only makes the stored row say what every reader already\n * assumes.\n */\nexport function resolveLink(\n link: LinkDestination | null | undefined,\n): string | null {\n if (!link) return null;\n if (linkTypeOf(link) === \"page\") {\n const page = link.page;\n if (!page || typeof page !== \"object\") return null;\n if (page._status === \"draft\") return null;\n return page.slug ? `/${page.slug}` : null;\n }\n return link.href ? link.href : null;\n}\n\n/**\n * Preview resolver for the Header items kit. `LinkField` stores a page as\n * its id; the public `resolveLink` treats that as unpublished. The editor\n * looks the id up (or uses a populated draft) so the sticky bar still\n * shows the destination the picker chose.\n */\nexport function resolveAdminPreviewLink(\n link: LinkDestination | null | undefined,\n pages: ReadonlyMap<string, LinkPageDoc>,\n): string | null {\n const live = resolveLink(link);\n if (live) return live;\n if (!link || linkTypeOf(link) !== \"page\") return null;\n const page = link.page;\n if (page && typeof page === \"object\") {\n return page.slug ? `/${page.slug}` : null;\n }\n if (page == null) return null;\n const doc = pages.get(String(page));\n return doc?.slug ? `/${doc.slug}` : null;\n}\n\n/**\n * Which of the two stored destinations a row is using. `type` decides; a row\n * with no `type` yet (saved before links had one) is read by what it holds,\n * an `href` making it external, the same reading `resolveLink` and the picker\n * make, so all three agree on every row.\n */\nexport function linkTypeOf(link: LinkDestination | null | undefined): LinkType {\n if (link?.type === \"external\") return \"external\";\n if (link?.type === \"page\") return \"page\";\n return link?.href ? \"external\" : \"page\";\n}\n\nconst whenPage: Condition = (_data, siblingData) =>\n linkTypeOf(siblingData as LinkDestination) === \"page\";\n\nconst whenExternal: Condition = (_data, siblingData) =>\n linkTypeOf(siblingData as LinkDestination) === \"external\";\n\nexport interface LinkDestinationOptions {\n /** Require a destination. Defaults to `false`. */\n required?: boolean;\n /** The collection a page link points into. Defaults to `pages`. */\n pagesCollection?: string;\n}\n\n/**\n * Where a link goes, as stored: `type`, `page` and `href` in one row.\n *\n * The row carries the picker (`LINK_FIELD`), which replaces all three inputs\n * with one box. The stored fields are the website template's shape and stay\n * editable on their own: `page` shows for a page link, `href` for an external\n * one, and `required` binds whichever is active, since Payload skips\n * validation on a field whose condition is false. `page` offers published\n * rows only, and Payload re-checks that on publish, so a page that was\n * unpublished after being picked has to be picked again or republished.\n */\nexport function linkDestinationFields({\n required = false,\n pagesCollection = \"pages\",\n}: LinkDestinationOptions = {}): RowField[] {\n return [\n {\n type: \"row\",\n admin: { components: { Field: LINK_FIELD } },\n fields: [\n {\n name: \"type\",\n type: \"radio\",\n label: \"Goes to\",\n defaultValue: \"page\",\n options: [\n { label: \"Page\", value: \"page\" },\n { label: \"URL\", value: \"external\" },\n ],\n admin: { layout: \"horizontal\" },\n },\n {\n name: \"page\",\n type: \"relationship\",\n relationTo: pagesCollection,\n required,\n filterOptions: { _status: { equals: \"published\" } },\n admin: { condition: whenPage },\n },\n {\n name: \"href\",\n type: \"text\",\n label: \"URL\",\n required,\n admin: {\n condition: whenExternal,\n description:\n 'A full URL (\"https://example.com\"), \"mailto:\" or \"tel:\", or a site path (\"/contact\").',\n },\n },\n ],\n },\n ];\n}\n\nexport interface LinkFieldsOptions extends LinkDestinationOptions {\n /** Require the label and destination. Defaults to `false`. */\n required?: boolean;\n /** Wording for the visible text field. Defaults to \"Label\". */\n labelFieldLabel?: string;\n}\n\n/**\n * The fields a call to action is made of, unwrapped: the destination row,\n * then the label and the new-tab flag.\n *\n * `newTab` drives `target=\"_blank\"` *and* the matching `rel`, which is why no\n * renderer takes one without the other.\n */\nexport function linkFields({\n required = false,\n labelFieldLabel = \"Label\",\n pagesCollection,\n}: LinkFieldsOptions = {}): Field[] {\n return [\n ...linkDestinationFields({ required, pagesCollection }),\n { name: \"label\", type: \"text\", label: labelFieldLabel, required },\n {\n name: \"newTab\",\n type: \"checkbox\",\n label: \"Open in a new tab\",\n defaultValue: false,\n },\n ];\n}\n\nexport interface LinkFieldOptions extends LinkFieldsOptions {\n /** Field name. Defaults to `link`. */\n name?: string;\n label?: GroupField[\"label\"];\n admin?: GroupField[\"admin\"];\n}\n\n/** `linkFields()` as one named group, for a block with a single CTA. */\nexport function linkField({\n name = \"link\",\n label,\n admin,\n ...rest\n}: LinkFieldOptions = {}): GroupField {\n return {\n name,\n type: \"group\",\n fields: linkFields(rest),\n ...(label === undefined ? {} : { label }),\n ...(admin === undefined ? {} : { admin }),\n };\n}\n","import type { Block } from \"payload\";\n\nimport { imageField } from \"../../fields/image\";\nimport { linkFields } from \"../../fields/link\";\n\n/**\n * The band a page opens with.\n *\n * Unlike every other block here this one has no `@bison-lab/ui` counterpart:\n * a hero is where a site's brand is loudest, and the shipped renderer is\n * deliberately plain markup so a site can swap in its own by overriding this\n * one registry entry. The *fields* are the shared part — that is what makes a\n * page portable between sites.\n */\nexport const HeroBlock: Block = {\n slug: \"hero\",\n interfaceName: \"HeroBlock\",\n labels: { singular: \"Hero\", plural: \"Heroes\" },\n fields: [\n {\n name: \"eyebrow\",\n type: \"text\",\n admin: { description: \"Small label above the heading. Optional.\" },\n },\n { name: \"heading\", type: \"text\", required: true },\n { name: \"body\", type: \"textarea\" },\n {\n name: \"tone\",\n type: \"select\",\n defaultValue: \"sweep\",\n options: [\n { label: \"Sweep (brand gradient)\", value: \"sweep\" },\n { label: \"Dark (flat brand band)\", value: \"dark\" },\n // Describes the surface, not a lightness: in the dark theme the page\n // surface is dark. The value stays `light` so no site migrates.\n { label: \"Plain (page surface)\", value: \"light\" },\n ],\n admin: {\n description:\n \"How the band is painted. Sites map these to their own surfaces.\",\n },\n },\n imageField({ admin: { description: \"Optional background or lead image.\" } }),\n {\n name: \"links\",\n type: \"array\",\n // Two is the point at which a hero stops having a primary action.\n maxRows: 2,\n labels: { singular: \"Call to action\", plural: \"Calls to action\" },\n fields: linkFields({ required: true }),\n },\n ],\n};\n","import type { Block } from \"payload\";\n\n/** A prose section: one Lexical document at reading measure. */\nexport const RichTextBlock: Block = {\n slug: \"richText\",\n interfaceName: \"RichTextBlock\",\n labels: { singular: \"Rich Text\", plural: \"Rich Text\" },\n fields: [{ name: \"content\", type: \"richText\", required: true }],\n};\n","/**\n * The import-map path of the array field that refuses to go below `minRows`.\n *\n * Payload gates *Add* on `maxRows` but never gates *Remove* on `minRows`: an\n * editor can delete the third showcase panel, see a \"requires 3 panels\"\n * note, and only learn on publish that the section is invalid. Payload has no\n * option for this, so it is an admin component (`@bison-lab/payload-blocks/admin`)\n * referenced here by package specifier. Every array in this package with a\n * `minRows` uses it, and a site can put it on its own arrays:\n *\n * ```ts\n * { name: 'items', type: 'array', minRows: 2,\n * admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } }, fields: [...] }\n * ```\n *\n * Consuming sites pick it up by re-running `payload generate:importmap`. Until\n * they do, Payload logs the missing entry and falls back to its stock field.\n */\nexport const MIN_ROWS_ARRAY_FIELD =\n \"@bison-lab/payload-blocks/admin#MinRowsArrayField\";\n\n/** Empty rows for an array's `defaultValue`, so a block opens at its minimum. */\nexport function emptyRows(count: number): Record<string, never>[] {\n return Array.from({ length: count }, () => ({}));\n}\n","import type { Block } from \"payload\";\n\nimport { imageField } from \"../../fields/image\";\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\n\n/** Expanding panels, one per service or product line. */\nexport const ShowcasePanelsBlock: Block = {\n slug: \"showcasePanels\",\n interfaceName: \"ShowcasePanelsBlock\",\n labels: { singular: \"Showcase Panels\", plural: \"Showcase Panels\" },\n fields: [\n {\n name: \"items\",\n type: \"array\",\n required: true,\n // The layout is designed around 3-6 panels: fewer and the accordion\n // reads as a mistake, more and each collapsed spine is unreadable. The\n // block opens with the minimum already in place, and the admin field\n // refuses to go below it.\n minRows: 3,\n maxRows: 6,\n defaultValue: emptyRows(3),\n labels: { singular: \"Panel\", plural: \"Panels\" },\n admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } },\n fields: [\n { name: \"title\", type: \"text\", required: true },\n {\n name: \"summary\",\n type: \"textarea\",\n required: true,\n admin: { description: \"Revealed when the panel expands.\" },\n },\n imageField({ required: true }),\n {\n name: \"href\",\n type: \"text\",\n admin: {\n description: 'Optional \"read more\" destination for this panel.',\n },\n },\n {\n name: \"numeral\",\n type: \"text\",\n admin: {\n description:\n 'Overrides the spine numeral (\"01\", \"II\"). Leave empty to number automatically.',\n },\n },\n ],\n },\n {\n name: \"spineVariant\",\n type: \"select\",\n defaultValue: \"numbered\",\n options: [\n { label: \"Numbered (01, 02)\", value: \"numbered\" },\n { label: \"Volume (I, II)\", value: \"volume\" },\n { label: \"Minimal (no numeral)\", value: \"minimal\" },\n ],\n },\n {\n name: \"watermark\",\n type: \"text\",\n admin: { description: 'Faint mark behind the panels, e.g. a brand word.' },\n },\n {\n name: \"defaultActiveIndex\",\n type: \"number\",\n defaultValue: 0,\n min: 0,\n admin: { description: \"Which panel is open on load, counting from 0.\" },\n },\n // The region's accessible name and the selected/preview state text are\n // not editor concerns; the `@bison-lab/ui` defaults stand.\n ],\n};\n","import type { Block } from \"payload\";\n\nimport { imageField } from \"../../fields/image\";\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\n\n/** An ordered walkthrough that advances on its own. */\nexport const ProcessStepsBlock: Block = {\n slug: \"processSteps\",\n interfaceName: \"ProcessStepsBlock\",\n labels: { singular: \"Process Steps\", plural: \"Process Steps\" },\n fields: [\n {\n name: \"items\",\n type: \"array\",\n required: true,\n // Same reasoning as the showcase panels: the step rail is designed\n // around 3-6 entries, in order. The block opens with the minimum\n // already in place, and the admin field refuses to go below it.\n minRows: 3,\n maxRows: 6,\n defaultValue: emptyRows(3),\n labels: { singular: \"Step\", plural: \"Steps\" },\n admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } },\n // Steps are numbered by position; ordering is drag and drop. There is\n // deliberately no per-step number override.\n fields: [\n { name: \"title\", type: \"text\", required: true },\n { name: \"description\", type: \"textarea\", required: true },\n imageField({ required: true }),\n ],\n },\n {\n name: \"autoAdvance\",\n type: \"checkbox\",\n defaultValue: true,\n admin: {\n description:\n \"Advance on a timer. Always off for visitors who prefer reduced motion.\",\n },\n },\n {\n name: \"autoAdvanceDuration\",\n type: \"number\",\n defaultValue: 6000,\n min: 1000,\n admin: { description: \"Milliseconds each step holds before advancing.\" },\n },\n { name: \"pauseOnHover\", type: \"checkbox\", defaultValue: true },\n {\n name: \"defaultActiveIndex\",\n type: \"number\",\n defaultValue: 0,\n min: 0,\n admin: { description: \"Which step is active on load, counting from 0.\" },\n },\n // The region's accessible name and the play/pause control text are not\n // editor concerns; the `@bison-lab/ui` defaults stand.\n ],\n};\n","import type { Condition, Field } from \"payload\";\n\nexport interface HeadingFieldsOptions {\n /** Require the section heading. Defaults to `true`. */\n required?: boolean;\n /** Description shown under the eyebrow input. */\n eyebrowDescription?: string;\n /**\n * Show the three fields only when this holds, e.g. unless the block floats.\n * Pair it with `required: false`: a hidden required field can never be\n * satisfied, and the block could not publish.\n */\n condition?: Condition;\n}\n\n/**\n * The eyebrow / title / description trio every marketing band opens with.\n *\n * They are three top-level fields rather than a group: editors read a section\n * heading as the first thing in the block, and burying it one collapse deep\n * puts the least-optional copy behind a click. The field names match the\n * `@bison-lab/ui` prop names so the renderers stay a pass-through.\n */\nexport function headingFields({\n required = true,\n eyebrowDescription = \"Small label above the heading. Leave empty to hide the row.\",\n condition,\n}: HeadingFieldsOptions = {}): Field[] {\n const when = condition ? { condition } : {};\n return [\n {\n name: \"eyebrow\",\n type: \"text\",\n admin: { description: eyebrowDescription, ...when },\n },\n { name: \"title\", type: \"text\", required, admin: when },\n { name: \"description\", type: \"textarea\", admin: when },\n ];\n}\n","import type { Block } from \"payload\";\n\nimport { headingFields } from \"../../fields/heading\";\nimport { linkDestinationFields } from \"../../fields/link\";\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\n\n/** A sticky intro beside a column of questions. */\nexport const FaqColumnsBlock: Block = {\n slug: \"faqColumns\",\n interfaceName: \"FaqColumnsBlock\",\n labels: { singular: \"FAQ Columns\", plural: \"FAQ Columns\" },\n fields: [\n ...headingFields(),\n {\n name: \"items\",\n type: \"array\",\n required: true,\n minRows: 1,\n defaultValue: emptyRows(1),\n labels: { singular: \"Question\", plural: \"Questions\" },\n admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } },\n fields: [\n { name: \"question\", type: \"text\", required: true },\n {\n name: \"answer\",\n // Plain text on purpose. A Lexical answer would pull\n // `@payloadcms/richtext-lexical` into the `./react` entry, which\n // every consumer loads; the `richText` block is where prose with\n // links and lists belongs.\n type: \"textarea\",\n required: true,\n },\n ],\n },\n {\n name: \"cta\",\n type: \"group\",\n label: \"Call to action\",\n admin: {\n description: \"Shown under the intro. Leave the link empty to hide it.\",\n },\n fields: [\n {\n name: \"title\",\n type: \"text\",\n admin: { description: 'Lead-in line, e.g. \"Still have questions?\".' },\n },\n { name: \"linkText\", type: \"text\" },\n // The destination is `linkFields()`' shape (the picker, a page or a\n // URL); only the visible text keeps its own name here.\n ...linkDestinationFields(),\n {\n name: \"newTab\",\n type: \"checkbox\",\n label: \"Open in a new tab\",\n defaultValue: false,\n },\n ],\n },\n {\n name: \"sticky\",\n type: \"checkbox\",\n defaultValue: true,\n admin: { description: \"Pin the intro column while the answers scroll.\" },\n },\n {\n name: \"type\",\n type: \"select\",\n defaultValue: \"single\",\n options: [\n { label: \"One answer open at a time\", value: \"single\" },\n { label: \"Several answers open at once\", value: \"multiple\" },\n ],\n },\n {\n name: \"collapsible\",\n type: \"checkbox\",\n defaultValue: true,\n admin: {\n description: \"Allow the open answer to be closed again. Single mode only.\",\n },\n },\n ],\n};\n","import type { Block } from \"payload\";\n\nimport { headingFields } from \"../../fields/heading\";\nimport { imageField } from \"../../fields/image\";\nimport { linkField } from \"../../fields/link\";\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\n\n/** Quotes in a masonry grid, clipped behind a fade once there are enough. */\nexport const TestimonialMasonryBlock: Block = {\n slug: \"testimonialMasonry\",\n interfaceName: \"TestimonialMasonryBlock\",\n labels: { singular: \"Testimonial Masonry\", plural: \"Testimonial Masonry\" },\n fields: [\n ...headingFields(),\n {\n name: \"items\",\n type: \"array\",\n required: true,\n minRows: 1,\n defaultValue: emptyRows(1),\n labels: { singular: \"Testimonial\", plural: \"Testimonials\" },\n admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } },\n fields: [\n { name: \"content\", type: \"textarea\", required: true, label: \"Quote\" },\n {\n name: \"author\",\n type: \"group\",\n fields: [\n { name: \"name\", type: \"text\", required: true },\n {\n name: \"title\",\n type: \"text\",\n admin: {\n description: 'Role or organisation, e.g. \"Orthopaedic surgeon\".',\n },\n },\n imageField({\n name: \"avatar\",\n admin: {\n description:\n \"Optional. Initials from the name are used when empty.\",\n },\n }),\n ],\n },\n ],\n },\n linkField({\n label: \"Link\",\n admin: {\n description:\n \"Shown under the fade, once there are enough quotes to clip.\",\n },\n }),\n {\n name: \"minItemsForFade\",\n type: \"number\",\n defaultValue: 7,\n min: 1,\n admin: {\n description:\n \"How many quotes before the grid clips and the bottom fade appears.\",\n },\n },\n {\n name: \"maxVisibleRows\",\n type: \"number\",\n min: 1,\n admin: { description: \"Rows shown before the fade. Optional.\" },\n },\n ],\n};\n","import type { Block } from \"payload\";\n\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\n\n/**\n * Name, address, phone — the block local SEO is graded on.\n *\n * The `e164` phone number is a separate field from the displayed one because\n * `NapBlock` uses it, and only it, for the `tel:` href and the JSON-LD\n * `telephone`. A prettified string can never silently become an unreachable\n * link.\n */\nexport const NapBlock: Block = {\n slug: \"nap\",\n interfaceName: \"NapBlock\",\n labels: { singular: \"Name, Address, Phone\", plural: \"Name, Address, Phone\" },\n fields: [\n { name: \"businessName\", type: \"text\", required: true, label: \"Business name\" },\n {\n name: \"businessType\",\n type: \"text\",\n required: true,\n defaultValue: \"LocalBusiness\",\n admin: {\n description:\n 'schema.org type, e.g. \"MedicalBusiness\", \"Chiropractor\", \"LocalBusiness\".',\n },\n },\n {\n name: \"address\",\n type: \"group\",\n fields: [\n { name: \"streetAddress\", type: \"text\", required: true },\n { name: \"addressLocality\", type: \"text\", required: true, label: \"City\" },\n {\n name: \"addressRegion\",\n type: \"text\",\n required: true,\n label: \"State or region\",\n },\n { name: \"postalCode\", type: \"text\", required: true },\n {\n name: \"addressCountry\",\n type: \"text\",\n defaultValue: \"US\",\n admin: { description: \"ISO 3166-1 alpha-2, e.g. US.\" },\n },\n ],\n },\n {\n name: \"departments\",\n type: \"array\",\n required: true,\n minRows: 1,\n defaultValue: emptyRows(1),\n labels: { singular: \"Department\", plural: \"Departments\" },\n admin: {\n components: { Field: MIN_ROWS_ARRAY_FIELD },\n description:\n \"A single-location business has one entry, usually named after the business.\",\n },\n fields: [\n { name: \"name\", type: \"text\", required: true },\n {\n name: \"departmentType\",\n type: \"text\",\n admin: {\n description:\n \"schema.org type for this department. Falls back to the business type.\",\n },\n },\n {\n name: \"phoneE164\",\n type: \"text\",\n required: true,\n label: \"Phone (E.164)\",\n admin: {\n description:\n 'Dialable form, e.g. \"+15551234567\". This is what the tel: link and the structured data use.',\n },\n },\n {\n name: \"phoneDisplay\",\n type: \"text\",\n label: \"Phone (as displayed)\",\n admin: {\n description:\n \"Optional. US numbers are formatted automatically when this is empty.\",\n },\n },\n ],\n },\n {\n name: \"url\",\n type: \"text\",\n admin: { description: \"Canonical URL for the business. Optional.\" },\n },\n {\n name: \"showName\",\n type: \"checkbox\",\n defaultValue: true,\n admin: {\n description:\n \"Turn off when a heading above the block already names the business.\",\n },\n },\n {\n name: \"headingLevel\",\n type: \"select\",\n defaultValue: \"h2\",\n options: [\n { label: \"H2\", value: \"h2\" },\n { label: \"H3\", value: \"h3\" },\n { label: \"H4\", value: \"h4\" },\n ],\n admin: { description: \"Keeps the page's heading order intact.\" },\n },\n {\n name: \"emitJsonLd\",\n type: \"checkbox\",\n defaultValue: true,\n label: \"Emit structured data\",\n admin: {\n description:\n \"Adds a schema.org LocalBusiness script. Turn off if the page emits its own.\",\n },\n },\n ],\n};\n","import type { ArrayFieldValidation } from \"payload\";\n\n/**\n * A custom `validate` replaces Payload's stock array check, so any array\n * with its own rule re-applies the row limits first or `minRows` and\n * `maxRows` stop being enforced. Same messages as the stock check, through\n * the request's translator when the admin supplies one.\n */\nexport function rowLimits(\n value: unknown[] | null | undefined,\n { minRows, maxRows, required, req }: Parameters<ArrayFieldValidation>[1],\n): string | true {\n const count = value?.length ?? 0;\n const t = req?.t;\n if (required && count === 0) {\n return t ? t(\"validation:required\") : \"This field is required.\";\n }\n if (minRows && count < minRows) {\n return t\n ? t(\"validation:requiresAtLeast\", {\n count: minRows,\n label: t(\"general:rows\"),\n })\n : `This field requires at least ${minRows} rows.`;\n }\n if (maxRows && count > maxRows) {\n return t\n ? t(\"validation:requiresNoMoreThan\", {\n count: maxRows,\n label: t(\"general:rows\"),\n })\n : `This field requires no more than ${maxRows} rows.`;\n }\n return true;\n}\n","import type { ArrayFieldValidation, Block, Condition } from \"payload\";\n\nimport { headingFields } from \"../../fields/heading\";\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\nimport { rowLimits } from \"../../fields/row-limits\";\n\n/**\n * The rule on `wide`: on phones the band is two per row, so only an odd\n * count has a stat on a row of its own, only one stat can take it, and it\n * has to be a stat that starts a row (the 1st, 3rd or 5th), since a full-row\n * cell beside another cell would leave a hole. The array's own `validate`,\n * so the editor sees the message as they build, and Payload runs it again on\n * publish.\n */\nexport const validateWideFlag: ArrayFieldValidation = (value, options) => {\n const limits = rowLimits(value, options);\n if (limits !== true) return limits;\n const rows = (value ?? []) as { wide?: boolean | null }[];\n const wide = rows.flatMap((row, i) => (row?.wide ? [i] : []));\n if (wide.length > 1) return \"Only one stat can be full width on phones.\";\n if (wide.length === 0) return true;\n if (rows.length % 2 === 0) {\n return \"Full width on phones only applies to an odd number of stats. With an even count every row is already full.\";\n }\n if (wide[0] % 2 !== 0) {\n return \"Only a stat that starts a phone row can be full width: the 1st, 3rd or 5th. Move it up or down one place, or flag another.\";\n }\n return true;\n};\n\n/**\n * An overlapping band is headless: it floats across the seam as a card, and a\n * heading pulled up into the block above would land on the wrong surface.\n * The heading fields disappear from the admin the moment `overlap` is on,\n * and the renderer ignores them if they were filled in first.\n */\nexport const unlessOverlap: Condition = (_data, siblingData) =>\n !(siblingData as { overlap?: boolean | null })?.overlap;\n\n/**\n * A strip of figures: the facts a visitor should take in at a glance.\n *\n * The count, the order and the desktop column count are the editor's. The\n * phone and tablet layouts are the library's: two per row and three per row,\n * with `wide` naming the one stat that takes a full phone row when the count\n * is odd.\n */\nexport const StatsBandBlock: Block = {\n slug: \"statsBand\",\n interfaceName: \"StatsBandBlock\",\n labels: { singular: \"Stats Band\", plural: \"Stats Bands\" },\n fields: [\n ...headingFields({\n required: false,\n eyebrowDescription:\n \"Small label above the heading. The heading and eyebrow are optional; without them the band stands alone.\",\n condition: unlessOverlap,\n }),\n {\n name: \"items\",\n type: \"array\",\n required: true,\n // Designed around four, workable from two: the block opens at its\n // minimum, the house rule for every array here, and the admin field\n // refuses to go below it.\n minRows: 2,\n maxRows: 6,\n defaultValue: emptyRows(2),\n labels: { singular: \"Stat\", plural: \"Stats\" },\n admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } },\n validate: validateWideFlag,\n fields: [\n {\n name: \"value\",\n type: \"text\",\n required: true,\n admin: {\n description:\n 'The figure, as it should read: \"98%\", \"12,000+\", \"L1–S1\".',\n },\n },\n { name: \"label\", type: \"textarea\", required: true },\n {\n name: \"href\",\n type: \"text\",\n admin: {\n description:\n 'Optional. Makes the whole stat a link: a site path (\"/outcomes\") or a full URL.',\n },\n },\n {\n name: \"wide\",\n type: \"checkbox\",\n label: \"Full width on phones\",\n defaultValue: false,\n admin: {\n description:\n \"Phones show two per row. With an odd number of stats, this one takes a row to itself. Only the 1st, 3rd or 5th stat can.\",\n },\n },\n ],\n },\n {\n name: \"columns\",\n type: \"select\",\n defaultValue: \"4\",\n options: [\n { label: \"2\", value: \"2\" },\n { label: \"3\", value: \"3\" },\n { label: \"4\", value: \"4\" },\n { label: \"5\", value: \"5\" },\n { label: \"6\", value: \"6\" },\n ],\n admin: {\n description:\n \"From large screens up, and never more than there are stats. Phones show two per row and tablets three.\",\n },\n },\n {\n name: \"tone\",\n type: \"select\",\n defaultValue: \"card\",\n options: [\n { label: \"Card (bordered, raised)\", value: \"card\" },\n { label: \"Plain (dividers only)\", value: \"plain\" },\n ],\n },\n {\n name: \"align\",\n type: \"select\",\n defaultValue: \"start\",\n options: [\n { label: \"Left\", value: \"start\" },\n { label: \"Centred\", value: \"center\" },\n ],\n },\n {\n name: \"overlap\",\n type: \"checkbox\",\n label: \"Float over the seam with the block above\",\n defaultValue: false,\n admin: {\n description:\n \"The band sits across the join between the block above and the block below. Both make room for it automatically. A floating band is headless: the heading fields above are hidden while this is on.\",\n },\n },\n ],\n};\n","import type {\n ArrayFieldValidation,\n Block,\n Condition,\n Field,\n SelectField,\n} from \"payload\";\n\nimport { linkDestinationFields, linkField, linkFields } from \"../../fields/link\";\nimport { emptyRows, MIN_ROWS_ARRAY_FIELD } from \"../../fields/min-rows\";\nimport { rowLimits } from \"../../fields/row-limits\";\n\n/**\n * The blocks a header global's `items` array takes.\n *\n * `megaMenuBlock({ variants, icons })` is the first factory-built block in the\n * package. Every other config is a static `Block`; this one cannot be, because\n * the featured-link variants and the icon list are the site's: the CMS only\n * ever offers approved values, the same rule the sites use for block\n * backgrounds. `LinkBlock` is the plain bar item beside it.\n *\n * Until SPI-52 lands in the Spinal Simplicity repo, no site renders its header\n * from these rows; the Storybook `CMS Blocks/MegaMenu` fixture is the only\n * header built from them.\n */\n\n/** One approved value, as a select option. */\nexport interface MegaMenuOption {\n label: string;\n value: string;\n}\n\nexport interface MegaMenuBlockOptions {\n /** Looks a featured link can take. Empty or absent drops the select. */\n variants?: MegaMenuOption[];\n /** Glyphs a list link can carry. Empty or absent drops the select. */\n icons?: MegaMenuOption[];\n}\n\n/** The percent tokens a column can take, as Payload stores them. */\nexport const MEGA_MENU_WIDTHS = [\"25\", \"33\", \"50\", \"66\", \"75\", \"100\"] as const;\nexport type MegaMenuWidthValue = (typeof MEGA_MENU_WIDTHS)[number];\n\n/** Twelfths, so 33 and 66 are real thirds and 33 + 33 + 33 is a full row. */\nconst TWELFTHS: Record<MegaMenuWidthValue, number> = {\n \"25\": 3,\n \"33\": 4,\n \"50\": 6,\n \"66\": 8,\n \"75\": 9,\n \"100\": 12,\n};\n\ninterface ColumnRow {\n width?: MegaMenuWidthValue | null;\n}\n\n/**\n * The rule on `columns`: read as fractions, the widths must total 100%. It is\n * the array's own `validate`, so the editor sees the message as they build,\n * and Payload runs field validation again on publish (only draft saves skip\n * it), so nothing publishes with a short row.\n */\nexport const validateColumnWidths: ArrayFieldValidation = (value, options) => {\n const limits = rowLimits(value, options);\n if (limits !== true) return limits;\n if (!value?.length) return true;\n\n const twelfths = (value as ColumnRow[]).reduce(\n (sum, row) => sum + TWELFTHS[row?.width ?? \"100\"],\n 0,\n );\n if (twelfths === 12) return true;\n const percent = Math.round((twelfths / 12) * 100);\n return `The columns add up to ${percent}%. They need to add up to 100%.`;\n};\n\n/**\n * The row `levels` segments above the field at `path`, read off the whole\n * document. A condition on a link needs its section; a condition on a column\n * needs its panel. `data` carries the full form, so the path is enough.\n */\nfunction ancestor(\n data: Record<string, unknown>,\n path: (number | string)[],\n levels: number,\n): Record<string, unknown> | undefined {\n let node: unknown = data;\n for (const segment of path.slice(0, path.length - levels)) {\n if (node === null || typeof node !== \"object\") return undefined;\n node = (node as Record<string, unknown>)[segment];\n }\n return node !== null && typeof node === \"object\"\n ? (node as Record<string, unknown>)\n : undefined;\n}\n\n/** `links.N.variant` → its section, three segments up. */\nconst whenSectionFeatured: Condition = (data, _siblingData, { path }) =>\n ancestor(data, path, 3)?.display === \"featured\";\n\n/** A featured link's glyph comes from its variant, so `icon` is a list link's field. */\nconst unlessSectionFeatured: Condition = (data, siblingData, ctx) =>\n !whenSectionFeatured(data, siblingData, ctx);\n\nfunction approvedSelect(\n name: string,\n options: MegaMenuOption[] | undefined,\n admin: SelectField[\"admin\"],\n): SelectField[] {\n if (!options?.length) return [];\n return [{ name, type: \"select\", options, admin }];\n}\n\nexport function megaMenuBlock({\n variants,\n icons,\n}: MegaMenuBlockOptions = {}): Block {\n const linkRowFields: Field[] = [\n ...linkFields({ required: true }),\n {\n name: \"description\",\n type: \"textarea\",\n admin: { description: \"Supporting line under the label. Optional.\" },\n },\n ...approvedSelect(\"variant\", variants, {\n description: \"The look of this featured link.\",\n condition: whenSectionFeatured,\n }),\n ...approvedSelect(\"icon\", icons, {\n description: \"Glyph shown before a list link. Optional.\",\n condition: unlessSectionFeatured,\n }),\n ];\n\n return {\n slug: \"megaMenu\",\n interfaceName: \"MegaMenuBlock\",\n labels: { singular: \"Mega menu\", plural: \"Mega menus\" },\n fields: [\n { name: \"label\", type: \"text\", required: true },\n // Landing page: the same picker every other destination uses. Optional\n // — a trigger with no landing page is allowed. Schema change: sites\n // run `payload migrate:create`.\n ...linkDestinationFields({ required: false }),\n {\n name: \"newTab\",\n type: \"checkbox\",\n label: \"Open in a new tab\",\n defaultValue: false,\n },\n {\n name: \"panel\",\n type: \"group\",\n fields: [\n {\n name: \"maxWidth\",\n type: \"select\",\n defaultValue: \"standard\",\n // No \"Full\": a panel anchors under its own trigger, so it cannot\n // span the bar, and capped at a trigger's room it would only\n // equal Wide.\n options: [\n { label: \"Narrow\", value: \"narrow\" },\n { label: \"Standard\", value: \"standard\" },\n { label: \"Wide\", value: \"wide\" },\n ],\n },\n {\n name: \"columns\",\n type: \"array\",\n required: true,\n minRows: 1,\n maxRows: 4,\n defaultValue: emptyRows(1),\n labels: { singular: \"Column\", plural: \"Columns\" },\n validate: validateColumnWidths,\n admin: { components: { Field: MIN_ROWS_ARRAY_FIELD } },\n fields: [\n {\n name: \"width\",\n type: \"select\",\n defaultValue: \"100\",\n options: MEGA_MENU_WIDTHS.map((value) => ({\n label: `${value}%`,\n value,\n })),\n },\n {\n name: \"divider\",\n type: \"checkbox\",\n label: \"Draw a line on the left of this column\",\n defaultValue: false,\n },\n {\n name: \"sections\",\n type: \"array\",\n labels: { singular: \"Section\", plural: \"Sections\" },\n fields: [\n {\n name: \"eyebrow\",\n type: \"text\",\n admin: {\n description:\n \"Small heading above this group; leave empty for none\",\n },\n },\n {\n name: \"display\",\n type: \"select\",\n defaultValue: \"list\",\n options: [\n { label: \"Featured\", value: \"featured\" },\n { label: \"List\", value: \"list\" },\n ],\n },\n {\n name: \"hideDescriptionsOnMobile\",\n type: \"checkbox\",\n label: \"Hide descriptions on mobile\",\n defaultValue: true,\n },\n {\n name: \"links\",\n type: \"array\",\n labels: { singular: \"Link\", plural: \"Links\" },\n fields: linkRowFields,\n },\n ],\n },\n ],\n },\n {\n name: \"footer\",\n type: \"group\",\n admin: {\n description:\n \"The strip under the columns. Leave both empty for no footer.\",\n },\n fields: [\n linkField({\n name: \"overview\",\n label: \"Overview link\",\n admin: {\n description:\n \"The section's own landing page, so it stays reachable from the bar.\",\n },\n }),\n linkField({ name: \"cta\", label: \"Call to action\" }),\n ],\n },\n ],\n },\n ],\n };\n}\n\n/** A plain bar item: label and destination, nothing to open. */\nexport const LinkBlock: Block = {\n slug: \"navLink\",\n interfaceName: \"NavLinkBlock\",\n labels: { singular: \"Link\", plural: \"Links\" },\n fields: linkFields({ required: true }),\n};\n","/**\n * The import-map path of the header-items kit editor, `NavItemsField` in\n * `@bison-lab/payload-blocks/admin`.\n *\n * It sits on `createNavigation`'s `header.items` blocks field and replaces\n * Payload's stock blocks UI. Referenced here by package specifier, like\n * `LINK_FIELD`; a site picks it up with `payload generate:importmap`.\n * Until it does, Payload logs the missing entry and renders the field as\n * nothing (a custom `Field` with no component behind it is an empty\n * element, not the stock blocks UI), so the step is part of adopting this\n * release (SPI-99).\n *\n * Bar behaviour (hide on scroll, viewport, default panel width) stays\n * on `createNavigation`'s hidden `bar` group; SPI-99 consumes\n * `headerFromNavigation`. Featured looks stay on chrome roles\n * (BIS-85 / SPI-89). Payload's left nav stays until BIS-90. New page\n * blocks still ship stock nesting until those issues adopt this kit.\n */\nexport const NAV_ITEMS_FIELD = \"@bison-lab/payload-blocks/admin#NavItemsField\";\n\n/** The Header document workspace: wraps DefaultEditView. SPI-99 generate:importmap. */\nexport const ADMIN_WORKSPACE = \"@bison-lab/payload-blocks/admin#AdminWorkspace\";\nexport const HEADER_WORKSPACE = ADMIN_WORKSPACE;\n","/**\n * The upload side of the boundary.\n *\n * A Payload upload field holds either the row's id or, once depth resolves it,\n * the whole document. Neither shape can be imported from here: `Media` is\n * generated per site, and this package must never reach for a site's\n * `payload-types`. So the doc is described structurally, and every renderer\n * goes through `resolveMedia` rather than reading `.url` itself.\n */\n\n/**\n * The subset of a Payload upload document a block renderer actually reads.\n * Every site's generated `Media` interface is assignable to this, whatever\n * else it carries.\n *\n * Deliberately no index signature: TypeScript refuses to assign an interface\n * to a type with one, and a site's generated `Media` is always an interface.\n * An index signature here would break exactly the structural match this type\n * exists to provide.\n */\nexport interface MediaDoc {\n url?: string | null;\n alt?: string | null;\n width?: number | null;\n height?: number | null;\n}\n\n/** What an upload field holds before and after `depth` populates it. */\nexport type MediaValue = number | string | MediaDoc | null | undefined;\n\n/** A resolved image, in the shape every `@bison-lab/ui` block asks for. */\nexport interface ResolvedMedia {\n src: string;\n alt: string;\n width?: number;\n height?: number;\n}\n\nfunction isMediaDoc(value: MediaValue): value is MediaDoc {\n return typeof value === \"object\" && value !== null;\n}\n\n/**\n * Narrows an upload value to something renderable, or `undefined`.\n *\n * `undefined` covers three cases a renderer must treat identically: the field\n * is empty, `depth: 0` left it as a bare id, or the document exists but has no\n * `url` yet (an upload mid-flight). A renderer that gets `undefined` omits the\n * image rather than emitting a broken `<img>`.\n *\n * `alt` is always a string: the media collection requires it, but a draft saved\n * before that validation ran can still reach a renderer, and an `alt` of\n * `undefined` would silently drop the attribute entirely.\n */\nexport function resolveMedia(value: MediaValue): ResolvedMedia | undefined {\n if (!isMediaDoc(value)) return undefined;\n const { url, alt, width, height } = value;\n if (typeof url !== \"string\" || url.length === 0) return undefined;\n return {\n src: url,\n alt: typeof alt === \"string\" ? alt : \"\",\n ...(typeof width === \"number\" ? { width } : {}),\n ...(typeof height === \"number\" ? { height } : {}),\n };\n}\n","import type { FaqColumnsBlockData } from \"../../types\";\n\nexport const faqColumnsSample: FaqColumnsBlockData = {\n id: \"sample-faq-columns\",\n blockType: \"faqColumns\",\n eyebrow: \"Good to know\",\n title: \"Questions patients ask before their first visit\",\n description:\n \"If yours is not here, the front desk answers the phone between eight and six on weekdays.\",\n items: [\n {\n id: \"sample-faq-referral\",\n question: \"Do I need a referral?\",\n answer:\n \"No. You can book directly. Some insurers ask for one before they reimburse, so check your policy if you plan to claim.\",\n },\n {\n id: \"sample-faq-sessions\",\n question: \"How many sessions will I need?\",\n answer:\n \"Most plans finish in six to eight sessions. You will get a written estimate after your assessment, and we revise it with you as you progress.\",\n },\n {\n id: \"sample-faq-wear\",\n question: \"What should I wear?\",\n answer:\n \"Anything you can move in. Shorts for a knee or hip, a vest or loose top for a shoulder or neck.\\n\\nThere are changing rooms if you are coming from work.\",\n },\n {\n id: \"sample-faq-insurance\",\n question: \"Is treatment covered by insurance?\",\n answer:\n \"Usually, once conservative treatment has been recommended. We invoice you directly and give you everything the insurer needs to reimburse you.\",\n },\n {\n id: \"sample-faq-cancel\",\n question: \"What is the cancellation policy?\",\n answer:\n \"Twenty-four hours' notice, by phone or through the booking link in your confirmation email. Later than that and the session is charged.\",\n },\n ],\n cta: {\n title: \"Still have questions?\",\n linkText: \"Call the front desk\",\n type: \"external\",\n href: \"tel:+13035550142\",\n newTab: false,\n },\n sticky: true,\n type: \"single\",\n collapsible: true,\n};\n","import type { MediaDoc } from \"./media\";\n\nexport interface SampleImageOptions {\n /** Text drawn across the placeholder, e.g. \"Panel 1 · 1400 × 1000\". */\n label: string;\n width: number;\n height: number;\n /** Alt text for the document. Defaults to the label. */\n alt?: string;\n}\n\nfunction escapeXml(value: string): string {\n return value\n .replaceAll(\"&\", \"&\")\n .replaceAll(\"<\", \"<\")\n .replaceAll(\">\", \">\")\n .replaceAll('\"', \""\");\n}\n\n/**\n * A placeholder upload document for a block sample.\n *\n * A preview has no site media behind it, so the image has to travel with the\n * sample. This is an inline SVG as a `data:` URL, in the `MediaDoc` shape\n * `resolveMedia` already narrows, with `width` and `height` set so an image\n * adapter can reserve the box. The scheme is what tells an adapter which kind\n * of source it has: `next/image` treats a `data:` src as `unoptimized` on its\n * own, so a site's adapter needs no special case for samples.\n *\n * Neutral greys rather than theme tokens: the SVG is a standalone document\n * and cannot see the page's custom properties.\n */\nexport function sampleImage({\n label,\n width,\n height,\n alt,\n}: SampleImageOptions): MediaDoc {\n const fontSize = Math.max(12, Math.round(Math.min(width, height) / 12));\n const svg =\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${width}\" height=\"${height}\" viewBox=\"0 0 ${width} ${height}\">` +\n `<rect width=\"100%\" height=\"100%\" fill=\"#d4d4d8\"/>` +\n `<text x=\"50%\" y=\"50%\" dominant-baseline=\"middle\" text-anchor=\"middle\" ` +\n `font-family=\"system-ui, sans-serif\" font-size=\"${fontSize}\" fill=\"#52525b\">` +\n `${escapeXml(label)}</text></svg>`;\n return {\n url: `data:image/svg+xml,${encodeURIComponent(svg)}`,\n alt: alt ?? label,\n width,\n height,\n };\n}\n","import { sampleImage } from \"../../sample-image\";\nimport type { HeroBlockData } from \"../../types\";\n\n/**\n * The placeholder hero's sample. The hero family (BIS-45) ships a sample per\n * hero as each one is added; this is the one for the plain renderer.\n */\nexport const heroSample: HeroBlockData = {\n id: \"sample-hero\",\n blockType: \"hero\",\n eyebrow: \"Now booking spring appointments\",\n heading: \"Move well again, without the long wait\",\n body: \"Same-week assessments with a physiotherapist who stays with you from the first visit to the last. Most treatment plans finish in six to eight sessions.\",\n tone: \"sweep\",\n image: sampleImage({\n label: \"Hero background · 2000 × 1000\",\n width: 2000,\n height: 1000,\n alt: \"A bright, open treatment room\",\n }),\n // One link per shape: a page, carried inline as `depth: 1` would populate\n // it, so the preview needs no pages collection; and an external URL.\n links: [\n {\n type: \"page\",\n page: {\n id: \"sample-page-book\",\n title: \"Book an assessment\",\n slug: \"book\",\n _status: \"published\",\n },\n label: \"Book an assessment\",\n newTab: false,\n },\n {\n type: \"external\",\n href: \"https://example.com/approach\",\n label: \"See our approach\",\n newTab: true,\n },\n ],\n};\n","import type { MegaMenuBlockData, NavLinkBlockData } from \"../../types\";\nimport type { MegaMenuBlockOptions } from \"./config\";\n\n/**\n * The options the mega menu sample was written against. A factory block's\n * sample only fits a config built with the same approved values, so a\n * preview builds its block with `megaMenuBlock(megaMenuSampleOptions)`.\n */\nexport const megaMenuSampleOptions = {\n variants: [\n { label: \"Lumbar\", value: \"lumbar\" },\n { label: \"SI joint\", value: \"si\" },\n ],\n icons: [\n { label: \"Help\", value: \"help\" },\n { label: \"Mail\", value: \"mail\" },\n ],\n} satisfies MegaMenuBlockOptions;\n\n/**\n * Spinal Simplicity's Patients panel as a saved row: two featured territories\n * in a 75% column, two rail sections in a divided 25% column, overview and\n * CTA. Every field is set at least once. Most links are site paths typed as\n * external links; Testimonials and the overview are page links carried\n * inline, as `depth: 1` would populate them, so the preview needs no pages\n * collection.\n */\nexport const megaMenuSample: MegaMenuBlockData = {\n id: \"sample-mega-menu\",\n blockType: \"megaMenu\",\n label: \"Patients\",\n type: \"external\",\n href: \"/patients\",\n newTab: false,\n panel: {\n maxWidth: \"standard\",\n columns: [\n {\n id: \"treatment\",\n width: \"75\",\n divider: false,\n sections: [\n {\n id: \"territories\",\n eyebrow: \"Treatment\",\n display: \"featured\",\n hideDescriptionsOnMobile: true,\n links: [\n {\n id: \"lumbar\",\n label: \"Low Back Pain\",\n type: \"external\",\n href: \"/patients/low-back-pain\",\n newTab: false,\n description:\n \"Persistent low back pain from lumbar instability, often with leg pain that limits standing or walking.\",\n variant: \"lumbar\",\n },\n {\n id: \"si\",\n label: \"Hip Pain\",\n type: \"external\",\n href: \"/patients/hip-pain\",\n newTab: false,\n description:\n \"Pain centered on the sacroiliac joint, often worse with sitting or climbing stairs.\",\n variant: \"si\",\n },\n ],\n },\n ],\n },\n {\n id: \"rail\",\n width: \"25\",\n divider: true,\n sections: [\n {\n id: \"outcomes\",\n eyebrow: \"Patient Outcomes\",\n display: \"list\",\n hideDescriptionsOnMobile: true,\n links: [\n {\n id: \"stories\",\n label: \"Testimonials\",\n type: \"page\",\n page: {\n id: \"sample-page-stories\",\n title: \"Testimonials\",\n slug: \"patients/stories\",\n _status: \"published\",\n },\n newTab: false,\n },\n { id: \"research\", label: \"Research\", type: \"external\", href: \"/patients/research\", newTab: false },\n { id: \"path\", label: \"Path to Relief\", type: \"external\", href: \"/patients/path-to-relief\", newTab: false },\n ],\n },\n {\n id: \"support\",\n eyebrow: \"Support\",\n display: \"list\",\n hideDescriptionsOnMobile: false,\n links: [\n {\n id: \"faqs\",\n label: \"FAQs\",\n type: \"external\",\n href: \"/patients/faqs\",\n newTab: false,\n description: \"Short answers to the questions patients ask first.\",\n icon: \"help\",\n },\n {\n id: \"contact\",\n label: \"Contact\",\n type: \"external\",\n href: \"https://example.com/contact\",\n newTab: true,\n icon: \"mail\",\n },\n ],\n },\n ],\n },\n ],\n footer: {\n overview: {\n label: \"All patient resources\",\n type: \"page\",\n page: { id: \"sample-page-patients\", title: \"Patients\", slug: \"patients\", _status: \"published\" },\n newTab: false,\n },\n cta: { label: \"Find a Doctor\", type: \"external\", href: \"/find-a-doctor\", newTab: false },\n },\n },\n};\n\n/** A plain bar item. */\nexport const navLinkSample: NavLinkBlockData = {\n id: \"sample-nav-link\",\n blockType: \"navLink\",\n label: \"Contact\",\n type: \"external\",\n href: \"/contact\",\n newTab: false,\n};\n","import type { NapBlockData } from \"../../types\";\n\n/**\n * A fictional clinic. `emitJsonLd` is off: the block emits schema.org\n * `LocalBusiness` by default, and a preview must not put a business that does\n * not exist into a site's structured data. The phone numbers are in the\n * 555-01xx range reserved for fiction.\n */\nexport const napSample: NapBlockData = {\n id: \"sample-nap\",\n blockType: \"nap\",\n businessName: \"Larkspur Physiotherapy\",\n businessType: \"Physiotherapy\",\n address: {\n streetAddress: \"400 Larkspur Lane, Suite 120\",\n addressLocality: \"Boulder\",\n addressRegion: \"CO\",\n postalCode: \"80302\",\n addressCountry: \"US\",\n },\n departments: [\n {\n id: \"sample-dept-front-desk\",\n name: \"Front desk\",\n phoneE164: \"+13035550142\",\n phoneDisplay: \"(303) 555-0142\",\n },\n {\n id: \"sample-dept-billing\",\n name: \"Billing and insurance\",\n departmentType: \"AccountingService\",\n phoneE164: \"+13035550143\",\n },\n ],\n url: \"https://example.com\",\n showName: true,\n headingLevel: \"h2\",\n emitJsonLd: false,\n};\n","import { sampleImage } from \"../../sample-image\";\nimport type { ProcessStepsBlockData } from \"../../types\";\n\n/** Four steps: enough to show the rail advancing through a real sequence. */\nexport const processStepsSample: ProcessStepsBlockData = {\n id: \"sample-process-steps\",\n blockType: \"processSteps\",\n items: [\n {\n id: \"sample-step-assess\",\n title: \"Assessment\",\n description:\n \"A fifty-minute first visit: your history, a movement screen, and a clear explanation of what we found.\",\n image: sampleImage({\n label: \"Step 1 · 1600 × 1000\",\n width: 1600,\n height: 1000,\n alt: \"A physiotherapist taking notes during an assessment\",\n }),\n },\n {\n id: \"sample-step-plan\",\n title: \"Your plan\",\n description:\n \"A written plan with the number of sessions we expect, what each one is for, and the exercises between them.\",\n image: sampleImage({\n label: \"Step 2 · 1600 × 1000\",\n width: 1600,\n height: 1000,\n alt: \"A printed treatment plan on a desk\",\n }),\n },\n {\n id: \"sample-step-treat\",\n title: \"Treatment\",\n description:\n \"Hands-on work where it helps, and progressive loading where it matters. You leave every session knowing what to do next.\",\n image: sampleImage({\n label: \"Step 3 · 1600 × 1000\",\n width: 1600,\n height: 1000,\n alt: \"A patient lifting a light kettlebell under supervision\",\n }),\n },\n {\n id: \"sample-step-discharge\",\n title: \"Discharge and beyond\",\n description:\n \"A final review, a maintenance programme, and an open door if anything flares up later.\",\n image: sampleImage({\n label: \"Step 4 · 1600 × 1000\",\n width: 1600,\n height: 1000,\n alt: \"A patient walking out of the clinic\",\n }),\n },\n ],\n autoAdvance: true,\n autoAdvanceDuration: 5000,\n pauseOnHover: true,\n defaultActiveIndex: 0,\n};\n","import type { RichTextBlockData, RichTextContent } from \"../../types\";\n\n/**\n * A serialized Lexical document, written by hand in the shapes the default\n * JSX converters read (`heading`, `paragraph`, `text`, `list`, `link`).\n * `version` is on every serialized Lexical node, and `direction`, `format` and\n * `indent` are what `RichTextContent` requires on the root; the converters\n * read none of them, and the sample carries them so it is shaped like a row\n * the editor saved.\n */\nconst block = {\n direction: \"ltr\" as const,\n format: \"\",\n indent: 0,\n version: 1,\n};\n\nfunction text(value: string, format = 0) {\n return {\n type: \"text\",\n text: value,\n format,\n detail: 0,\n mode: \"normal\",\n style: \"\",\n version: 1,\n };\n}\n\nfunction paragraph(children: unknown[]) {\n return { type: \"paragraph\", children, textFormat: 0, textStyle: \"\", ...block };\n}\n\nconst BOLD = 1;\n\nconst content: RichTextContent = {\n root: {\n type: \"root\",\n ...block,\n children: [\n {\n type: \"heading\",\n tag: \"h2\",\n children: [text(\"What to expect at your first visit\")],\n ...block,\n },\n paragraph([\n text(\"Your first appointment runs about \"),\n text(\"fifty minutes\", BOLD),\n text(\n \". We start with a conversation about what brought you in, then a movement assessment, and you leave with a written plan and the first two exercises.\",\n ),\n ]),\n paragraph([\n text(\"Bring comfortable clothes and any recent imaging. If you have questions before you arrive, \"),\n {\n type: \"link\",\n fields: { url: \"https://example.com/contact\", newTab: true, linkType: \"custom\" },\n children: [text(\"get in touch\")],\n ...block,\n version: 3,\n },\n text(\".\"),\n ]),\n {\n type: \"list\",\n listType: \"bullet\",\n tag: \"ul\",\n start: 1,\n children: [\n \"Assessment and written plan\",\n \"Hands-on treatment where it helps\",\n \"Exercises you can do at home, with video\",\n ].map((item, i) => ({\n type: \"listitem\",\n value: i + 1,\n children: [text(item)],\n ...block,\n })),\n ...block,\n },\n ],\n },\n};\n\nexport const richTextSample: RichTextBlockData = {\n id: \"sample-rich-text\",\n blockType: \"richText\",\n content,\n};\n","import { sampleImage } from \"../../sample-image\";\nimport type { ShowcasePanelsBlockData } from \"../../types\";\n\n/** Three panels: the minimum the layout is designed around. */\nexport const showcasePanelsSample: ShowcasePanelsBlockData = {\n id: \"sample-showcase-panels\",\n blockType: \"showcasePanels\",\n items: [\n {\n id: \"sample-panel-back\",\n title: \"Back and neck pain\",\n summary:\n \"Most back pain settles with the right movement, not rest. We find what is driving yours and build a plan around your week, not ours.\",\n image: sampleImage({\n label: \"Panel 1 · 1400 × 1000\",\n width: 1400,\n height: 1000,\n alt: \"A physiotherapist guiding a patient through a stretch\",\n }),\n href: \"/services/back-and-neck\",\n // Matches what automatic numbering would show, so the preview does not\n // mislead; it is here to exercise the override.\n numeral: \"01\",\n },\n {\n id: \"sample-panel-sport\",\n title: \"Sports injuries\",\n summary:\n \"From a rolled ankle to a post-surgical knee: a return-to-play plan with clear milestones, so you know when you are ready.\",\n image: sampleImage({\n label: \"Panel 2 · 1400 × 1000\",\n width: 1400,\n height: 1000,\n alt: \"A runner mid-stride on a track\",\n }),\n href: \"/services/sports-injuries\",\n },\n {\n id: \"sample-panel-post-op\",\n title: \"Post-operative rehab\",\n summary:\n \"We work from your surgeon's protocol and keep them in the loop, so every stage of recovery is signed off before the next begins.\",\n image: sampleImage({\n label: \"Panel 3 · 1400 × 1000\",\n width: 1400,\n height: 1000,\n alt: \"A patient on a rehabilitation bike\",\n }),\n },\n ],\n spineVariant: \"numbered\",\n watermark: \"LARKSPUR\",\n defaultActiveIndex: 0,\n};\n","import type { StatsBandBlockData } from \"../../types\";\n\n/**\n * Four figures, the count the strip was designed around: one row on a\n * desktop, two by two on a tablet and a phone. `wide` is set (to `false`) so\n * the preview exercises the field, and an even count is where it is ignored.\n * `overlap` is off so the heading shows: a floating band is headless, and a\n * preview page has no hero for it to float over.\n */\nexport const statsBandSample: StatsBandBlockData = {\n id: \"sample-stats-band\",\n blockType: \"statsBand\",\n eyebrow: \"At a glance\",\n title: \"The clinic in numbers\",\n description:\n \"What a year looks like across our two rooms, counted from the front desk rather than estimated.\",\n items: [\n {\n id: \"sample-stat-pain\",\n value: \"94%\",\n label: \"of patients report less pain by their sixth session.\",\n href: \"/outcomes\",\n wide: false,\n },\n {\n id: \"sample-stat-visits\",\n value: \"4,200+\",\n label: \"appointments a year across two treatment rooms.\",\n },\n {\n id: \"sample-stat-wait\",\n value: \"15 min\",\n label: \"average wait from the front desk to the treatment room.\",\n },\n {\n id: \"sample-stat-years\",\n value: \"12\",\n label: \"years in the same building, on the same street.\",\n },\n ],\n columns: \"4\",\n tone: \"card\",\n align: \"start\",\n overlap: false,\n};\n","import { sampleImage } from \"../../sample-image\";\nimport type { TestimonialMasonryBlockData } from \"../../types\";\n\nfunction avatar(name: string) {\n return sampleImage({\n label: name\n .split(\" \")\n .map((part) => part[0])\n .join(\"\"),\n width: 160,\n height: 160,\n alt: `Portrait of ${name}`,\n });\n}\n\n/**\n * Six quotes, two of them without an avatar so the initials fallback shows.\n * `minItemsForFade` is lowered to six so the preview also shows the fade and\n * the link beneath it, which the default of seven would hide at this count.\n */\nexport const testimonialMasonrySample: TestimonialMasonryBlockData = {\n id: \"sample-testimonial-masonry\",\n blockType: \"testimonialMasonry\",\n eyebrow: \"From our patients\",\n title: \"What people say after they finish\",\n description:\n \"Every review here was left by a patient we discharged. We do not edit them.\",\n items: [\n {\n id: \"sample-quote-1\",\n content:\n \"I had written off running. Eight weeks later I did a parkrun, and the plan I was given actually fitted around a job and two kids.\",\n author: {\n name: \"Priya Natarajan\",\n title: \"Recovered from a hamstring tear\",\n avatar: avatar(\"Priya Natarajan\"),\n },\n },\n {\n id: \"sample-quote-2\",\n content:\n \"The first physio who explained what was wrong in words I understood.\",\n author: {\n name: \"Tom Ferreira\",\n title: \"Lower back pain\",\n avatar: avatar(\"Tom Ferreira\"),\n },\n },\n {\n id: \"sample-quote-3\",\n content:\n \"My surgeon said my knee was ahead of schedule at every check-in. That was the rehab, not me.\",\n author: { name: \"Aisha Bello\", title: \"ACL reconstruction\" },\n },\n {\n id: \"sample-quote-4\",\n content:\n \"Booked on a Tuesday, seen on the Thursday. The shoulder I had put up with for a year was sorted in six visits.\",\n author: {\n name: \"Marcus Whitfield\",\n title: \"Frozen shoulder\",\n avatar: avatar(\"Marcus Whitfield\"),\n },\n },\n {\n id: \"sample-quote-5\",\n content:\n \"They kept my consultant in the loop the whole way through, which nobody else had bothered to do.\",\n author: { name: \"Helen Ostrowski\" },\n },\n {\n id: \"sample-quote-6\",\n content:\n \"Honest about what would take time and what would not. I would send my parents here.\",\n author: {\n name: \"Daniel Kim\",\n title: \"Ankle sprain\",\n avatar: avatar(\"Daniel Kim\"),\n },\n },\n ],\n link: {\n type: \"external\",\n href: \"https://example.com/reviews\",\n label: \"Read every review\",\n newTab: true,\n },\n minItemsForFade: 6,\n maxVisibleRows: 2,\n};\n","import { faqColumnsSample } from \"./blocks/faq-columns/sample\";\nimport { heroSample } from \"./blocks/hero/sample\";\nimport { megaMenuSample, navLinkSample } from \"./blocks/mega-menu/sample\";\nimport { napSample } from \"./blocks/nap/sample\";\nimport { processStepsSample } from \"./blocks/process-steps/sample\";\nimport { richTextSample } from \"./blocks/rich-text/sample\";\nimport { showcasePanelsSample } from \"./blocks/showcase-panels/sample\";\nimport { statsBandSample } from \"./blocks/stats-band/sample\";\nimport { testimonialMasonrySample } from \"./blocks/testimonial-masonry/sample\";\nimport type { BisonBlockData, BisonBlockType } from \"./types\";\n\n/**\n * One sample row per block, each typed to its own row shape. Assignable to\n * `Record<BisonBlockType, BisonBlockData>` wherever the wider type is wanted.\n */\nexport type BlockSamples = {\n [K in BisonBlockType]: Extract<BisonBlockData, { blockType: K }>;\n};\n\n/**\n * Every block the package ships, rendered without a CMS row.\n *\n * A Block library page (BIS-52) renders these live so an admin can see each\n * block before enabling it. Each sample lives beside its block's `config.ts`\n * and `component.tsx` as `sample.ts`, and `src/__tests__/samples.test.tsx`\n * locks the contract: one entry per slug, `blockType` matching the key, every\n * config field exercised at least once, and every image self-contained.\n *\n * React-free on purpose: it is read from a Global's field config, which\n * Payload loads in plain Node like the rest of this entry, as well as from a\n * route handler. Only what this package ships is here; a site supplies samples\n * for its own blocks through the Block library factory, whose option BIS-52\n * names.\n */\nexport const blockSamples: BlockSamples = {\n hero: heroSample,\n richText: richTextSample,\n showcasePanels: showcasePanelsSample,\n processSteps: processStepsSample,\n faqColumns: faqColumnsSample,\n testimonialMasonry: testimonialMasonrySample,\n nap: napSample,\n statsBand: statsBandSample,\n // Header blocks: rendered by `MegaMenuBlockRenderer` and `headerItemsFromBlocks`,\n // never by `RenderBlocks`. The mega menu sample fits `megaMenuBlock(megaMenuSampleOptions)`.\n megaMenu: megaMenuSample,\n navLink: navLinkSample,\n};\n"],"mappings":";;;;;;;;;;AA4BA,SAAgB,WAAW,YAA+B,EAAE,EAAoB;AAC9E,QAAO;EACL,MAAM;EACN,MAAM;EACN,YAAY;EAGZ,GAAI,UAAU,WAAW,EAAE,GAAG,EAAE,OAAO,EAAE,aAAa,aAAa,EAAE;EACrE,GAAG;EACJ;;;;;;;;;;;;;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M;CACN,UAAU;CACV,gBAAgB;CAChB,cAAc;CACd,YAAY;CACZ,oBDpBmE;EACnE,IAAI;EACJ,WAAW;EACX,SAAS;EACT,OAAO;EACP,aACE;EACF,OAAO;GACL;IACE,IAAI;IACJ,SACE;IACF,QAAQ;KACN,MAAM;KACN,OAAO;KACP,QAAQ,OAAO,kBAAkB;KAClC;IACF;GACD;IACE,IAAI;IACJ,SACE;IACF,QAAQ;KACN,MAAM;KACN,OAAO;KACP,QAAQ,OAAO,eAAe;KAC/B;IACF;GACD;IACE,IAAI;IACJ,SACE;IACF,QAAQ;KAAE,MAAM;KAAe,OAAO;KAAsB;IAC7D;GACD;IACE,IAAI;IACJ,SACE;IACF,QAAQ;KACN,MAAM;KACN,OAAO;KACP,QAAQ,OAAO,mBAAmB;KACnC;IACF;GACD;IACE,IAAI;IACJ,SACE;IACF,QAAQ,EAAE,MAAM,mBAAmB;IACpC;GACD;IACE,IAAI;IACJ,SACE;IACF,QAAQ;KACN,MAAM;KACN,OAAO;KACP,QAAQ,OAAO,aAAa;KAC7B;IACF;GACF;EACD,MAAM;GACJ,MAAM;GACN,MAAM;GACN,OAAO;GACP,QAAQ;GACT;EACD,iBAAiB;EACjB,gBAAgB;EACjB;CChDC,KAAK;CACL,WAAW;CAGX,UAAU;CACV,SAAS;CACV"}
|
package/dist/react.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { A as
|
|
2
|
+
import { A as BlockImageComponent, C as linkTypeOf, D as DefaultBlockLink, E as BlockLinkProps, M as DefaultBlockImage, O as newTabAttributes, S as ResolveLink, T as BlockLinkComponent, _ as RenderBlocks, a as NavLinkBlockData, b as LinkPageDoc, d as TestimonialMasonryBlockData, f as BLOCK_ID_ATTRIBUTE, g as DEFAULT_CONTAINER, h as BlockRendererProps, i as NapBlockData, j as BlockImageProps, k as renderLinkWith, l as ShowcasePanelsBlockData, m as BlockRegistryFor, n as HeroBlockData, o as NavigationSettingsData, p as BlockLike, r as MegaMenuBlockData, s as ProcessStepsBlockData, t as FaqColumnsBlockData, u as StatsBandBlockData, v as RenderBlocksProps, w as resolveLink, x as LinkValue, y as LinkDestination } from "./types-BwWCwKJ4.mjs";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
import { FloatingNavItem, MegaMenuIcons, MegaMenuPanelData, MegaMenuVariants } from "@bison-lab/ui";
|
|
4
|
+
import { FloatingNavItem, MegaMenuIcons, MegaMenuMaxWidth, MegaMenuPanelData, MegaMenuVariants } from "@bison-lab/ui";
|
|
5
|
+
import { ReactNode } from "react";
|
|
5
6
|
|
|
6
7
|
//#region src/seam.d.ts
|
|
7
8
|
/**
|
|
@@ -125,7 +126,7 @@ declare function StatsBandBlockRenderer({
|
|
|
125
126
|
* `resolve` turns each link's page into a path; the package's own is the
|
|
126
127
|
* default.
|
|
127
128
|
*/
|
|
128
|
-
declare function megaMenuPanelFromRow(row: MegaMenuBlockData, resolve?: ResolveLink): MegaMenuPanelData | null;
|
|
129
|
+
declare function megaMenuPanelFromRow(row: MegaMenuBlockData, resolve?: ResolveLink, defaultMaxWidth?: MegaMenuMaxWidth): MegaMenuPanelData | null;
|
|
129
130
|
interface MegaMenuBlockRendererProps extends BlockRendererProps<MegaMenuBlockData> {
|
|
130
131
|
/** The look behind each `variants` value the site passed to `megaMenuBlock`. */
|
|
131
132
|
variants?: MegaMenuVariants;
|
|
@@ -156,6 +157,37 @@ interface HeaderItemsOptions {
|
|
|
156
157
|
linkComponent?: BlockLinkComponent;
|
|
157
158
|
/** The site's resolver for page links; defaults to the package's `resolveLink`. */
|
|
158
159
|
resolveLink?: ResolveLink;
|
|
160
|
+
/** Fallback panel width when a mega menu row does not set `panel.maxWidth`. */
|
|
161
|
+
defaultMaxWidth?: MegaMenuMaxWidth;
|
|
162
|
+
}
|
|
163
|
+
/** The Header global (or `getNavigation`'s `{ header, bar }`) as this helper reads it. */
|
|
164
|
+
interface HeaderNavigationDoc {
|
|
165
|
+
header?: {
|
|
166
|
+
items?: unknown;
|
|
167
|
+
cta?: LinkValue | null;
|
|
168
|
+
} | null;
|
|
169
|
+
bar?: NavigationSettingsData | null;
|
|
170
|
+
}
|
|
171
|
+
interface HeaderFromNavigationOptions {
|
|
172
|
+
icons?: MegaMenuIcons;
|
|
173
|
+
isActive?: (href: string) => boolean;
|
|
174
|
+
linkComponent?: BlockLinkComponent;
|
|
175
|
+
/**
|
|
176
|
+
* Featured-link looks from chrome roles (`megaMenuVariantsFromLooks`),
|
|
177
|
+
* not a variants array on Header.
|
|
178
|
+
*/
|
|
179
|
+
looks?: MegaMenuVariants;
|
|
180
|
+
resolveLink?: ResolveLink;
|
|
181
|
+
/** Holds the named item's panel open — a CMS live preview of the edited row. */
|
|
182
|
+
openItem?: string;
|
|
183
|
+
}
|
|
184
|
+
interface HeaderFromNavigationProps {
|
|
185
|
+
items: FloatingNavItem[];
|
|
186
|
+
actions?: ReactNode;
|
|
187
|
+
breakpoint: "lg";
|
|
188
|
+
hideOnScroll: boolean;
|
|
189
|
+
viewport: boolean;
|
|
190
|
+
openItem?: string;
|
|
159
191
|
}
|
|
160
192
|
/**
|
|
161
193
|
* A global's `items` as `FloatingNavBlock` items, so a site's header is one
|
|
@@ -174,8 +206,24 @@ declare function headerItemsFromBlocks(blocks: HeaderBlockRow[], {
|
|
|
174
206
|
icons,
|
|
175
207
|
isActive,
|
|
176
208
|
linkComponent,
|
|
177
|
-
resolveLink: resolve
|
|
209
|
+
resolveLink: resolve,
|
|
210
|
+
defaultMaxWidth
|
|
178
211
|
}?: HeaderItemsOptions): FloatingNavItem[];
|
|
212
|
+
/**
|
|
213
|
+
* The Header global as `FloatingNavBlock` props: items through
|
|
214
|
+
* `headerItemsFromBlocks`, `breakpoint: "lg"`, and bar behaviour from
|
|
215
|
+
* the hidden `bar` group. Looks come from chrome roles (`looks`), not a
|
|
216
|
+
* Header array. A site without the consume bump (SPI-99) never reads
|
|
217
|
+
* these fields.
|
|
218
|
+
*/
|
|
219
|
+
declare function headerFromNavigation(doc: HeaderNavigationDoc, {
|
|
220
|
+
icons,
|
|
221
|
+
isActive,
|
|
222
|
+
linkComponent,
|
|
223
|
+
looks,
|
|
224
|
+
resolveLink: resolve,
|
|
225
|
+
openItem
|
|
226
|
+
}?: HeaderFromNavigationOptions): HeaderFromNavigationProps;
|
|
179
227
|
//#endregion
|
|
180
|
-
export { BLOCK_ID_ATTRIBUTE, type BlockImageComponent, type BlockImageProps, type BlockLike, type BlockLinkComponent, type BlockLinkProps, type BlockRegistryFor, type BlockRendererProps, DEFAULT_CONTAINER, DefaultBlockImage, DefaultBlockLink, FaqColumnsBlockRenderer, type HeaderBlockRow, type HeaderItemsOptions, HeroBlockRenderer, type LinkDestination, type LinkPageDoc, type LinkValue, MegaMenuBlockRenderer, type MegaMenuBlockRendererProps, NapBlockRenderer, OVERLAP_ABOVE_CLEARANCE, OVERLAP_BELOW_CLEARANCE, ProcessStepsBlockRenderer, RenderBlocks, type RenderBlocksProps, type ResolveLink, SEAM_PULL_DOWN, SEAM_PULL_UP, ShowcasePanelsBlockRenderer, StatsBandBlockRenderer, TestimonialMasonryBlockRenderer, headerItemsFromBlocks, linkTypeOf, megaMenuPanelFromRow, newTabAttributes, overlapsSeam, renderLinkWith, resolveLink, seamClasses };
|
|
228
|
+
export { BLOCK_ID_ATTRIBUTE, type BlockImageComponent, type BlockImageProps, type BlockLike, type BlockLinkComponent, type BlockLinkProps, type BlockRegistryFor, type BlockRendererProps, DEFAULT_CONTAINER, DefaultBlockImage, DefaultBlockLink, FaqColumnsBlockRenderer, type HeaderBlockRow, type HeaderFromNavigationOptions, type HeaderFromNavigationProps, type HeaderItemsOptions, type HeaderNavigationDoc, HeroBlockRenderer, type LinkDestination, type LinkPageDoc, type LinkValue, MegaMenuBlockRenderer, type MegaMenuBlockRendererProps, NapBlockRenderer, OVERLAP_ABOVE_CLEARANCE, OVERLAP_BELOW_CLEARANCE, ProcessStepsBlockRenderer, RenderBlocks, type RenderBlocksProps, type ResolveLink, SEAM_PULL_DOWN, SEAM_PULL_UP, ShowcasePanelsBlockRenderer, StatsBandBlockRenderer, TestimonialMasonryBlockRenderer, headerFromNavigation, headerItemsFromBlocks, linkTypeOf, megaMenuPanelFromRow, newTabAttributes, overlapsSeam, renderLinkWith, resolveLink, seamClasses };
|
|
181
229
|
//# sourceMappingURL=react.d.mts.map
|
package/dist/react.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.mts","names":[],"sources":["../src/seam.ts","../src/blocks/hero/component.tsx","../src/blocks/showcase-panels/component.tsx","../src/blocks/process-steps/component.tsx","../src/blocks/faq-columns/component.tsx","../src/blocks/testimonial-masonry/component.tsx","../src/blocks/nap/component.tsx","../src/blocks/stats-band/component.tsx","../src/blocks/mega-menu/component.tsx","../src/blocks/mega-menu/header.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.d.mts","names":[],"sources":["../src/seam.ts","../src/blocks/hero/component.tsx","../src/blocks/showcase-panels/component.tsx","../src/blocks/process-steps/component.tsx","../src/blocks/faq-columns/component.tsx","../src/blocks/testimonial-masonry/component.tsx","../src/blocks/nap/component.tsx","../src/blocks/stats-band/component.tsx","../src/blocks/mega-menu/component.tsx","../src/blocks/mega-menu/header.tsx"],"mappings":";;;;;;;;;;;;AAqBA;;;;;AAGA;;;;;AAGA;AAAA,cANa,YAAA;;cAGA,cAAA;;cAGA,uBAAA;;cAGA,uBAAA;;;AAOb;;;iBAAgB,YAAA,CAAa,KAAA,EAAO,SAAA;;iBAQpB,WAAA,CAAA;EACd,YAAA;EACA;AAAA,GACC,IAAA,CAAK,kBAAA;;;;;;;AA3BR;;;iBCKgB,iBAAA,CAAA;EACd,KAAA;EACA,KAAA;EACA,YAAA;EACA,YAAA;EACA,kBAAA;EACA,cAAA,EAAgB,KAAA;EAChB,aAAA,EAAe,IAAA;EACf,WAAA,EAAa;AAAA,GACZ,kBAAA,CAAmB,aAAA,IAAc,kBAAA,CAA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