@atomic-ui/blocks 0.7.2 → 0.8.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/studio.ts"],"sourcesContent":["/**\n * The blocks a studio's own site is built from: the numbered list of work, a\n * row of figures, and the questions at the foot of a page.\n */\nimport { css, html, nothing, type TemplateResult } from 'lit';\nimport {\n ImpaktElement,\n focusRing,\n fontSize,\n fontWeight,\n lineHeight,\n lockScroll,\n space,\n spaceAround,\n t,\n token,\n unlockScroll,\n type NavLink,\n} from '@atomic-ui/ui';\n\n/** One project in a list of work. */\nexport interface WorkItem {\n id?: string;\n /** The project's name, set large. */\n name: string;\n /** What it is and who it is for, such as \"Web platform · Automotive\". */\n meta?: string;\n /** Where the row goes when it is pressed. Leave empty for a row that goes nowhere. */\n href?: string;\n}\n\n/** The arrow at the end of a row that goes somewhere. Drawn, so no font has to hold the glyph. */\nconst arrow = html`<svg viewBox=\"0 0 22 22\" width=\"22\" height=\"22\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M5 17 17 5M8 5h9v9\" />\n</svg>`;\n\n/**\n * A numbered list of projects, each name set large: the work on a studio's\n * home page, or the index on its work page.\n *\n * **Each row is one link.** The link sits on the project's name, which is a\n * heading, and is stretched over the row, so the whole row can be pressed\n * while a screen reader meets one link with one name (2.4.4, 2.5.8). The\n * number and the arrow are decoration and are hidden from it; the list itself\n * says how many projects there are and which one this is (1.3.1).\n *\n * **Pointing at a row and focusing it look the same.** The row turns to the\n * text colour with the card colour on it, a pair every brand's tokens already\n * hold at 4.5:1, so the state never depends on a colour of its own (1.4.3,\n * 1.4.11). The focus ring is still drawn over it (2.4.7).\n *\n * The names shrink with the block's own width, not the window's, so the list\n * reads the same in a narrow column as on a phone (1.4.10).\n *\n * @category content\n * @icon list\n */\nexport class ImpaktWorkList extends ImpaktElement {\n static properties = {\n items: { type: Array },\n headingLevel: { type: Number, attribute: 'heading-level' },\n start: { type: Number },\n label: { type: String },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** The projects, in order. */\n declare items: WorkItem[];\n /** The heading level of each project's name. It depends on what is above the list on the page. */\n declare headingLevel: number;\n /** The number the first project is given. */\n declare start: number;\n /** A name for the list, so a screen reader can tell it from other lists on the page. Leave empty for none. */\n declare label: string;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.items = [];\n this.headingLevel = 3;\n this.start = 1;\n this.label = '';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n spaceAround,\n css`\n :host { display: block; container: impakt-work-list / inline-size; }\n ol { list-style: none; margin: 0; padding: 0; border-block-start: ${t.borderThin} solid ${t.text}; }\n li { position: relative; display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto auto; align-items: center; column-gap: ${space(6)}; padding: ${space(5)} ${space(8)}; border-block-end: ${t.borderThin} solid ${t.text}; transition: background-color 140ms ease-out, color 140ms ease-out; }\n .number { font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; font-variant-numeric: tabular-nums; color: ${t.textMuted}; }\n .name { font-family: ${t.fontHeading}; font-size: clamp(2rem, 7cqi, 4.5rem); font-weight: ${fontWeight('semibold')}; line-height: 1; letter-spacing: -0.05em; color: ${t.text}; overflow-wrap: anywhere; }\n .name a { color: inherit; text-decoration: none; }\n /* The link is stretched over the row, so the row is one target. */\n .name a::after { content: ''; position: absolute; inset: 0; }\n .name a:focus-visible { outline: none; }\n .name a:focus-visible::after { box-shadow: ${t.focusShadow}; }\n .meta { font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; }\n .arrow { display: flex; color: ${t.text}; }\n /* Pointed at or focused, the row turns to ink. The card colour on the text colour is a pair every brand already holds at 4.5:1. */\n li:has(a):hover, li:has(a:focus-visible) { background: ${t.text}; }\n li:has(a):hover .name, li:has(a:focus-visible) .name { color: ${t.surfaceCard}; }\n li:has(a):hover :is(.number, .meta), li:has(a:focus-visible) :is(.number, .meta) { color: color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text}); }\n li:has(a):hover .arrow, li:has(a:focus-visible) .arrow { color: ${token('color.accent.default', 'currentColor')}; }\n @container impakt-work-list (max-width: 40rem) {\n li { grid-template-columns: 2rem minmax(0, 1fr) auto; column-gap: ${space(3)}; padding-inline: ${space(4)}; }\n .meta { grid-column: 2; grid-row: 2; margin-block-start: ${space(2)}; }\n .arrow { grid-column: 3; grid-row: 1; }\n }\n @media (forced-colors: active) {\n li:has(a):hover, li:has(a:focus-visible) { background: Canvas; outline: 2px solid Highlight; outline-offset: -2px; }\n li:has(a):hover :is(.name, .number, .meta, .arrow), li:has(a:focus-visible) :is(.name, .number, .meta, .arrow) { color: CanvasText; }\n }\n `,\n ];\n\n render(): TemplateResult {\n // role=\"list\" is set by hand: a list with its markers removed is not announced as a list by every screen reader.\n return html`<ol role=\"list\" part=\"list\" aria-label=${this.label || nothing}>\n ${this.items.map((item, index) => {\n const number = String(this.start + index).padStart(2, '0');\n return html`<li part=\"row\">\n <span class=\"number\" aria-hidden=\"true\">${number}</span>\n <div class=\"name\" part=\"name\" role=\"heading\" aria-level=${this.headingLevel}>\n ${item.href ? html`<a href=${item.href} part=\"link\">${item.name}</a>` : item.name}\n </div>\n ${item.meta ? html`<span class=\"meta\" part=\"meta\">${item.meta}</span>` : html`<span></span>`}\n ${item.href ? html`<span class=\"arrow\">${arrow}</span>` : html`<span></span>`}\n </li>`;\n })}\n </ol>`;\n }\n}\n\n/** One figure in a row of them. */\nexport interface StatRowItem {\n /** The number, written as it should appear, such as \"161 ms\" or \"4\". */\n figure: string;\n /** What the number counts. */\n label: string;\n /** A line more, if the label needs it. */\n note?: string;\n}\n\n/**\n * A row of figures under a rule, each with what it counts: \"4 live products\",\n * \"161 ms response time\".\n *\n * The figures are a list, so a screen reader says how many there are, and each\n * is read as one phrase, \"161 ms response time\", not a bare number followed\n * some way off by its label (1.3.1). The row wraps by its own width: four\n * across, then two, then one, with nothing to scroll sideways at 320px\n * (1.4.10).\n *\n * @category content\n * @icon stat\n */\nexport class ImpaktStatRow extends ImpaktElement {\n static properties = {\n items: { type: Array },\n label: { type: String },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** The figures, in order. Four fit a row on a wide page. */\n declare items: StatRowItem[];\n /** A name for the row, such as \"Live products\", read before the figures. Leave empty for none. */\n declare label: string;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.items = [];\n this.label = '';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n css`\n :host { display: block; container: impakt-stat-row / inline-size; }\n ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: ${space(6)}; }\n li { border-block-start: ${t.borderThin} solid ${t.rule}; padding-block-start: ${space(5)}; }\n p { margin: 0; display: flex; flex-direction: column; gap: ${space(2)}; }\n .value { font-family: ${t.fontHeading}; font-size: clamp(2.25rem, 6cqi, 3.25rem); font-weight: ${fontWeight('semibold')}; line-height: 1; letter-spacing: -0.04em; color: ${t.textHeading}; }\n .label { font-size: ${fontSize('sm')}; line-height: ${lineHeight('normal')}; color: ${t.textMuted}; }\n .note { font-size: ${fontSize('sm')}; color: ${t.textMuted}; }\n `,\n ];\n\n render(): TemplateResult {\n return html`<ul role=\"list\" part=\"list\" aria-label=${this.label || nothing}>\n ${this.items.map(\n (item) =>\n html`<li part=\"stat\">\n <p><span class=\"value\" part=\"value\">${item.figure}</span> <span class=\"label\" part=\"label\">${item.label}</span>${item.note ? html` <span class=\"note\">${item.note}</span>` : nothing}</p>\n </li>`,\n )}\n </ul>`;\n }\n}\n\n/** One question and its answer. */\nexport interface FaqItem {\n id: string;\n /** The question. */\n heading: string;\n /** The answer, as plain text. An answer with links or a list is slotted as `panel-<id>` instead. */\n body: string;\n}\n\n/**\n * The questions at the foot of a page, under a heading: a title, a line of\n * introduction, and the questions as sections that open.\n *\n * It is `impakt-accordion` with the heading a page always writes above it, so\n * the levels cannot drift: the questions are always one level below the\n * block's own heading (1.3.1). With a heading, the block is a region named by\n * it, so a screen reader can jump straight to the questions (2.4.1).\n *\n * An answer that is more than words is slotted as `panel-<id>`, exactly as\n * on the accordion, and is passed through to it.\n *\n * @category content\n * @icon accordion\n */\nexport class ImpaktFaq extends ImpaktElement {\n static properties = {\n eyebrow: { type: String },\n heading: { type: String },\n lead: { type: String },\n items: { type: Array },\n headingLevel: { type: Number, attribute: 'heading-level' },\n open: { type: Array },\n multiple: { type: Boolean },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** The small line above the heading, such as \"Questions\". */\n declare eyebrow: string;\n /** The block's heading, such as \"Questions founders ask us first.\" */\n declare heading: string;\n /** A line under the heading. */\n declare lead: string;\n /** The questions, in order. */\n declare items: FaqItem[];\n /** The level of the block's heading. The questions are one level below it. */\n declare headingLevel: number;\n /** The ids of the questions that start open. */\n declare open: string[];\n /** Let more than one answer be open at once. */\n declare multiple: boolean;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.eyebrow = '';\n this.heading = '';\n this.lead = '';\n this.items = [];\n this.headingLevel = 2;\n this.open = [];\n this.multiple = true;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n css`\n :host { display: block; container: impakt-faq / inline-size; }\n .head { display: flex; flex-direction: column; gap: ${space(4)}; margin-block-end: ${space(10)}; max-inline-size: 44rem; }\n .eyebrow { margin: 0; font-family: ${t.fontEyebrow}; font-size: ${fontSize('sm')}; color: var(--impakt-eyebrow, ${t.textMuted}); }\n .heading { font-family: ${t.fontHeading}; font-size: clamp(2rem, 6cqi, 3.25rem); font-weight: ${fontWeight('semibold')}; line-height: 1.04; letter-spacing: -0.04em; color: ${t.textHeading}; }\n .lead { margin: 0; font-size: ${fontSize('md')}; line-height: ${lineHeight('normal')}; color: ${t.textMuted}; }\n impakt-accordion { border-block-start: ${t.borderThin} solid ${t.rule}; }\n `,\n ];\n\n render(): TemplateResult {\n const headingId = this.id_('heading');\n const level = Math.min(Math.max(this.headingLevel, 1), 5);\n const head =\n this.eyebrow || this.heading || this.lead\n ? html`<div class=\"head\" part=\"head\">\n ${this.eyebrow ? html`<p class=\"eyebrow\" part=\"eyebrow\">${this.eyebrow}</p>` : nothing}\n ${this.heading ? html`<div id=${headingId} class=\"heading\" part=\"heading\" role=\"heading\" aria-level=${level}>${this.heading}</div>` : nothing}\n ${this.lead ? html`<p class=\"lead\" part=\"lead\">${this.lead}</p>` : nothing}\n </div>`\n : nothing;\n // Each answer's slot is passed through to the accordion, with the plain answer as what shows when nothing is slotted.\n const accordion = html`<impakt-accordion part=\"questions\" .items=${this.items} .headingLevel=${level + 1} .open=${this.open} .multiple=${this.multiple}>\n ${this.items.map((item) => html`<slot name=${`panel-${item.id}`} slot=${`panel-${item.id}`}>${item.body}</slot>`)}\n </impakt-accordion>`;\n return this.heading ? html`<section aria-labelledby=${headingId}>${head}${accordion}</section>` : html`<div>${head}${accordion}</div>`;\n }\n}\n\n/**\n * A site's menu as a whole screen: a few large links, for a phone or for a\n * site with only a handful of pages.\n *\n * **It is a native `<dialog>` opened with `showModal()`**, as the drawer is, so\n * the focus trap, Escape, the inert page behind it and the return of focus to\n * the button that opened it all come from the browser (2.1.2, 2.4.3). The page\n * behind does not scroll while it is open. The button that opens it is the\n * page's own; set `open` from it and listen for `impakt-close`.\n *\n * **The links are a navigation landmark with a name**, and the page the reader\n * is on carries `aria-current=\"page\"` and is marked with a square, so the mark\n * does not depend on colour (1.4.1). A brand whose ink is dark may also colour\n * it, by setting `--impakt-site-menu-current`.\n *\n * The menu is drawn in ink: the text colour as the background with the card\n * colour on it, a pair every brand already holds at 4.5:1. A component slotted\n * at its foot takes the same colours through its tokens; a plain link there\n * keeps the page's own link colour, so slot `impakt-link` instead.\n *\n * @category navigation\n * @icon menu\n * @slot footer - Under the links: a call to action, an email address.\n * @fires {CustomEvent<null>} impakt-close - When the menu is closed, by its button, by Escape or by following a link.\n */\nexport class ImpaktSiteMenu extends ImpaktElement {\n static properties = {\n open: { type: Boolean, reflect: true },\n links: { type: Array },\n current: { type: String },\n brand: { type: String },\n home: { type: String },\n label: { type: String },\n closeText: { type: String, attribute: 'close-text' },\n };\n /** Whether the menu is showing. */\n declare open: boolean;\n /** The pages, in order. */\n declare links: NavLink[];\n /** The `href` of the page the reader is on, so its link is marked. */\n declare current: string;\n /** The site's name, at the top. */\n declare brand: string;\n /** Where the site's name goes. */\n declare home: string;\n /** The menu's name, read when it opens and as the name of its links. */\n declare label: string;\n /** The words on the button that closes it. */\n declare closeText: string;\n\n constructor() {\n super();\n this.open = false;\n this.links = [];\n this.current = '';\n this.brand = '';\n this.home = '/';\n this.label = 'Menu';\n this.closeText = 'Close';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n /* The ink colours are taken on the host, because the dialog repaints the text colour for what is inside it. */\n :host { --impakt-menu: ${t.text}; --impakt-menu-on: ${t.surfaceCard}; --impakt-menu-muted: color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text}); --impakt-menu-rule: color-mix(in srgb, ${t.surfaceCard} 18%, ${t.text}); }\n dialog { box-sizing: border-box; display: none; flex-direction: column; inline-size: 100vw; max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; margin: 0; padding: 0; border: 0; overflow: auto; background: var(--impakt-menu); color: var(--impakt-menu-on); }\n dialog[open] { display: flex; }\n dialog::backdrop { background: var(--impakt-menu); }\n .bar { display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; padding: ${space(2)} ${space(4)}; border-block-end: ${t.borderThin} solid var(--impakt-menu-rule); }\n .brand { color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-size: ${fontSize('md')}; font-weight: ${fontWeight('semibold')}; border-radius: ${t.radiusSm}; }\n .close { display: inline-flex; align-items: center; gap: ${space(2)}; min-block-size: 44px; padding: 0 ${space(4)}; font: inherit; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('medium')}; color: var(--impakt-menu); background: var(--impakt-menu-on); border: 0; border-radius: ${t.radius}; cursor: pointer; }\n nav { flex: 1; padding: ${space(6)} ${space(5)} 0; }\n ol { list-style: none; margin: 0; padding: 0; }\n li { border-block-end: ${t.borderThin} solid var(--impakt-menu-rule); }\n li a { display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; padding-block: ${space(4)}; color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-size: clamp(2.25rem, 12vw, 3.5rem); font-weight: ${fontWeight('semibold')}; line-height: 1; letter-spacing: -0.05em; }\n li a:hover .words { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.12em; }\n .number { font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('regular')}; letter-spacing: 0; color: var(--impakt-menu-muted); }\n /*\n * The current page is marked with a square. Its colour stays the menu's own text colour unless a brand sets\n * --impakt-site-menu-current, because an accent is only readable on ink when the brand's ink is dark (1.4.3).\n */\n a[aria-current] { color: var(--impakt-site-menu-current, var(--impakt-menu-on)); }\n a[aria-current] .words::before { content: ''; display: inline-block; inline-size: 0.28em; block-size: 0.28em; margin-inline-end: 0.22em; vertical-align: 0.18em; background: currentColor; }\n .foot { display: flex; flex-direction: column; gap: ${space(4)}; padding: ${space(8)} ${space(5)} calc(${space(8)} + env(safe-area-inset-bottom)); }\n .foot[hidden] { display: none; }\n /* What is slotted at the foot is read on ink too. */\n ::slotted(*) { --impakt-color-text-default: var(--impakt-menu-on); --impakt-color-text-heading: var(--impakt-menu-on); --impakt-color-text-muted: var(--impakt-menu-muted); --impakt-color-text-link: var(--impakt-menu-on); --impakt-color-text-link-hover: var(--impakt-menu-on); color: var(--impakt-menu-on); }\n @media (forced-colors: active) { dialog { border: 1px solid CanvasText; } .close { border: 1px solid ButtonText; } }\n `,\n ];\n\n private hasFooter = false;\n\n private get dialog(): HTMLDialogElement | null {\n return this.renderRoot.querySelector('dialog');\n }\n\n updated(changed: Map<string, unknown>): void {\n if (!changed.has('open')) return;\n const dialog = this.dialog;\n if (!dialog) return;\n if (this.open) {\n if (typeof dialog.showModal === 'function') dialog.showModal();\n else dialog.setAttribute('open', '');\n lockScroll(this);\n } else {\n if (typeof dialog.close === 'function' && dialog.open) dialog.close();\n else dialog.removeAttribute('open');\n unlockScroll(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n unlockScroll(this);\n }\n\n private close(): void {\n if (!this.open) return;\n this.open = false;\n this.dispatchEvent(new CustomEvent('impakt-close', { bubbles: true, composed: true }));\n }\n\n private footerChanged(event: Event): void {\n this.hasFooter = (event.target as HTMLSlotElement).assignedNodes().length > 0;\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n return html`<dialog part=\"dialog\" aria-label=${this.label} @cancel=${() => this.close()} @close=${() => this.close()}>\n <div class=\"bar\" part=\"bar\">\n ${this.brand ? html`<a class=\"brand\" href=${this.home || '/'} part=\"brand\">${this.brand}</a>` : html`<span></span>`}\n <button class=\"close\" type=\"button\" part=\"close\" @click=${() => this.close()}>\n <span>${this.closeText}</span>\n <svg viewBox=\"0 0 12 12\" width=\"12\" height=\"12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M1 1l10 10M11 1 1 11\" /></svg>\n </button>\n </div>\n <nav aria-label=${this.label} part=\"nav\">\n <ol role=\"list\">\n ${(this.links ?? []).map((link, index) => {\n const current = !!this.current && link.href === this.current;\n // Following a link closes the menu, so a link to a place on the same page does not leave it open over that place.\n return html`<li>\n <a href=${link.href} aria-current=${current ? 'page' : nothing} part=\"link\" @click=${() => this.close()}>\n <span class=\"words\">${link.label}</span><span class=\"number\" aria-hidden=\"true\">${String(index + 1).padStart(2, '0')}</span>\n </a>\n </li>`;\n })}\n </ol>\n </nav>\n <div class=\"foot\" part=\"footer\" ?hidden=${!this.hasFooter}><slot name=\"footer\" @slotchange=${this.footerChanged}></slot></div>\n </dialog>`;\n }\n}\n\n/**\n * An offer, set out in two halves: what it is, with one action, and a short\n * numbered list of what you get.\n *\n * It draws no background of its own. Put it in `impakt-section` with the\n * `accent` or `ink` tone and it takes that band's colours, so the words on it\n * are always the colour the tokens measured against the band (1.4.3).\n *\n * The points are an ordered list, so a screen reader says how many there are;\n * the numbers drawn beside them are decoration (1.3.1). The halves stack by\n * the block's own width (1.4.10).\n *\n * @category content\n * @icon megaphone\n * @slot actions - The action: one button.\n */\nexport class ImpaktOffer extends ImpaktElement {\n static properties = {\n eyebrow: { type: String },\n heading: { type: String },\n lead: { type: String },\n points: { type: Array },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** The small line above the heading, such as \"Free for founders and product owners\". */\n declare eyebrow: string;\n /** What is offered, such as \"Get a 48-hour product teardown.\" */\n declare heading: string;\n /** A sentence or two more. */\n declare lead: string;\n /** What you get, one short line each. */\n declare points: string[];\n declare headingLevel: number;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.eyebrow = '';\n this.heading = '';\n this.lead = '';\n this.points = [];\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n css`\n :host { display: block; container: impakt-offer / inline-size; }\n .offer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${space(12)}; align-items: start; }\n .copy { display: flex; flex-direction: column; align-items: flex-start; gap: ${space(5)}; }\n .eyebrow { margin: 0; font-family: ${t.fontEyebrow}; font-size: ${fontSize('sm')}; color: var(--impakt-eyebrow, ${t.textMuted}); }\n .heading { font-family: ${t.fontHeading}; font-size: clamp(2rem, 6cqi, 3.75rem); font-weight: ${fontWeight('semibold')}; line-height: 1; letter-spacing: -0.04em; color: ${t.textHeading}; }\n .lead { margin: 0; max-inline-size: 32rem; font-size: ${fontSize('md')}; line-height: ${lineHeight('normal')}; color: ${t.text}; }\n ol { list-style: none; margin: 0; padding: 0; }\n li { display: flex; gap: ${space(5)}; padding-block: ${space(5)}; border-block-start: ${t.borderThin} solid ${t.text}; font-size: ${fontSize('lg')}; font-weight: ${fontWeight('medium')}; line-height: 1.2; color: ${t.text}; }\n .number { flex: none; font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('regular')}; line-height: 1.6; }\n @container impakt-offer (max-width: 44rem) { .offer { grid-template-columns: 1fr; gap: ${space(8)}; } }\n `,\n ];\n\n render(): TemplateResult {\n const level = Math.min(Math.max(this.headingLevel, 1), 6);\n return html`<div class=\"offer\" part=\"offer\">\n <div class=\"copy\">\n ${this.eyebrow ? html`<p class=\"eyebrow\" part=\"eyebrow\">${this.eyebrow}</p>` : nothing}\n ${this.heading ? html`<div class=\"heading\" part=\"heading\" role=\"heading\" aria-level=${level}>${this.heading}</div>` : nothing}\n ${this.lead ? html`<p class=\"lead\" part=\"lead\">${this.lead}</p>` : nothing}\n <slot name=\"actions\"></slot>\n </div>\n ${\n (this.points ?? []).length\n ? html`<ol role=\"list\" part=\"points\">\n ${this.points.map((point, index) => html`<li><span class=\"number\" aria-hidden=\"true\">${String(index + 1).padStart(2, '0')}</span><span>${point}</span></li>`)}\n </ol>`\n : nothing\n }\n </div>`;\n }\n}\n\n/**\n * A card for one article: what it is filed under, its title and a line about\n * it.\n *\n * **The card is one link.** The link sits on the title, which is a heading,\n * and is stretched over the card, so the whole card can be pressed while a\n * screen reader meets one link named by the title, not a \"Read more\" that says\n * nothing out of context (2.4.4). `link-text` adds a visible line such as\n * \"Read\"; it is decoration and is hidden from a screen reader, which already\n * has the title.\n *\n * @category content\n * @icon card\n */\nexport class ImpaktPostCard extends ImpaktElement {\n static properties = {\n heading: { type: String },\n text: { type: String },\n meta: { type: String },\n href: { type: String },\n linkText: { type: String, attribute: 'link-text' },\n headingLevel: { type: Number, attribute: 'heading-level' },\n };\n /** The article's title. */\n declare heading: string;\n /** A line about it. */\n declare text: string;\n /** What it is filed under and how long it is, such as \"Pricing · 7 min read\". */\n declare meta: string;\n /** Where the card goes. */\n declare href: string;\n /** A visible line at the foot of the card, such as \"Read\". Leave empty for none. */\n declare linkText: string;\n declare headingLevel: number;\n\n constructor() {\n super();\n this.heading = '';\n this.text = '';\n this.meta = '';\n this.href = '';\n this.linkText = '';\n this.headingLevel = 3;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host { display: block; block-size: 100%; }\n article { position: relative; box-sizing: border-box; block-size: 100%; display: flex; flex-direction: column; gap: ${space(4)}; padding: ${space(6)}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.text}; border-radius: ${t.radius}; transition: background-color 140ms ease-out; }\n .meta { margin: 0; font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; }\n .heading { font-family: ${t.fontHeading}; font-size: ${fontSize('xl')}; font-weight: ${fontWeight('semibold')}; line-height: 1.15; letter-spacing: -0.025em; color: ${t.text}; }\n .heading a { color: inherit; text-decoration: none; }\n .heading a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }\n .heading a:focus-visible { outline: none; }\n .heading a:focus-visible::after { box-shadow: ${t.focusShadow}; }\n article:has(a):hover .heading { text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }\n .text { margin: 0; font-size: ${fontSize('sm')}; line-height: ${lineHeight('normal')}; color: ${t.textMuted}; }\n .more { margin-block-start: auto; font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.text}; }\n @media (forced-colors: active) { article { border-color: CanvasText; } }\n `,\n ];\n\n render(): TemplateResult {\n const level = Math.min(Math.max(this.headingLevel, 1), 6);\n return html`<article part=\"card\">\n ${this.meta ? html`<p class=\"meta\" part=\"meta\">${this.meta}</p>` : nothing}\n <div class=\"heading\" part=\"heading\" role=\"heading\" aria-level=${level}>${this.href ? html`<a href=${this.href} part=\"link\">${this.heading}</a>` : this.heading}</div>\n ${this.text ? html`<p class=\"text\" part=\"text\">${this.text}</p>` : nothing}\n ${this.linkText && this.href ? html`<span class=\"more\" aria-hidden=\"true\">${this.linkText} →</span>` : nothing}\n </article>`;\n }\n}\n\n/**\n * A word or two of a heading picked out as if selected in a design tool: the\n * accent colour behind it, an outline and four handles.\n *\n * It is decoration round real text. The words stay in the heading, in the\n * page, so they are read, found and translated as the rest of it is; the\n * handles and the optional label are hidden from a screen reader (1.3.1).\n * The words on the accent are the colour the tokens measured against it\n * (1.4.3). Nothing moves, so there is nothing to stop for reduced motion.\n *\n * @category content\n * @icon text\n * @slot - The words to pick out.\n */\nexport class ImpaktHighlight extends ImpaktElement {\n static properties = {\n label: { type: String },\n };\n /** A small tag under the words, such as \"Design · H1 / 120\". It is decoration and is not read. */\n declare label: string;\n\n constructor() {\n super();\n this.label = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: inline-block; position: relative; padding-inline: 0.1em; margin-inline: -0.02em; background: ${token('color.accent.default', '#e2cc40')}; color: ${token('color.accent.on', '#1a1a1a')}; outline: 1.5px solid ${token('color.accent.on', '#1a1a1a')}; outline-offset: -1px; }\n .handle { position: absolute; inline-size: 8px; block-size: 8px; box-sizing: border-box; background: ${t.surfaceCard}; border: 1.5px solid ${token('color.accent.on', '#1a1a1a')}; }\n .handle:nth-of-type(1) { inset-block-start: -4px; inset-inline-start: -4px; }\n .handle:nth-of-type(2) { inset-block-start: -4px; inset-inline-end: -4px; }\n .handle:nth-of-type(3) { inset-block-end: -4px; inset-inline-start: -4px; }\n .handle:nth-of-type(4) { inset-block-end: -4px; inset-inline-end: -4px; }\n .label { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-start: 0; padding: 3px 7px; white-space: nowrap; font-family: ${t.fontMono}; font-size: 0.6875rem; font-weight: ${fontWeight('medium')}; line-height: 1.4; letter-spacing: 0.06em; text-transform: uppercase; color: ${t.surfaceCard}; background: ${t.text}; border-radius: 3px; }\n @media (forced-colors: active) { :host { forced-color-adjust: none; background: Highlight; color: HighlightText; outline-color: HighlightText; } .handle { border-color: HighlightText; background: Canvas; } .label { background: CanvasText; color: Canvas; } }\n `,\n ];\n\n render(): TemplateResult {\n return html`<slot></slot><span class=\"handle\" aria-hidden=\"true\"></span><span class=\"handle\" aria-hidden=\"true\"></span><span class=\"handle\" aria-hidden=\"true\"></span><span class=\"handle\" aria-hidden=\"true\"></span>${\n this.label ? html`<span class=\"label\" part=\"label\" aria-hidden=\"true\">${this.label}</span>` : nothing\n }`;\n }\n}\n\ncustomElements.define('impakt-work-list', ImpaktWorkList);\ncustomElements.define('impakt-stat-row', ImpaktStatRow);\ncustomElements.define('impakt-faq', ImpaktFaq);\ncustomElements.define('impakt-site-menu', ImpaktSiteMenu);\ncustomElements.define('impakt-offer', ImpaktOffer);\ncustomElements.define('impakt-post-card', ImpaktPostCard);\ncustomElements.define('impakt-highlight', ImpaktHighlight);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-work-list': ImpaktWorkList;\n 'impakt-stat-row': ImpaktStatRow;\n 'impakt-faq': ImpaktFaq;\n 'impakt-site-menu': ImpaktSiteMenu;\n 'impakt-offer': ImpaktOffer;\n 'impakt-post-card': ImpaktPostCard;\n 'impakt-highlight': ImpaktHighlight;\n }\n}\n"],"mappings":";AAIA,SAAS,KAAK,MAAM,eAAoC;AACxD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAcP,IAAM,QAAQ;AAAA;AAAA;AAyBP,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,MAAM;AAAA,MACrB,cAAc,EAAE,MAAM,QAAQ,WAAW,gBAAgB;AAAA,MACzD,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,YAAY,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,cAAc;AAAA,MACpE,YAAY,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,cAAc;AAAA,IACtE;AAAA;AAAA,EAYA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ,CAAC;AACd,SAAK,eAAe;AACpB,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,aAAa;AAClB,SAAK,aAAa;AAAA,EACpB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA;AAAA,wEAEoE,EAAE,UAAU,UAAU,EAAE,IAAI;AAAA,qIACiC,MAAM,CAAC,CAAC,cAAc,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,uBAAuB,EAAE,UAAU,UAAU,EAAE,IAAI;AAAA,6BACrM,EAAE,QAAQ,g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AAK,QAAQ,2DAA2D,KAAK,KAAK,YAAY,OAChG;AAAA,EACF;AACF;AAEA,eAAe,OAAO,oBAAoB,cAAc;AACxD,eAAe,OAAO,mBAAmB,aAAa;AACtD,eAAe,OAAO,cAAc,SAAS;AAC7C,eAAe,OAAO,oBAAoB,cAAc;AACxD,eAAe,OAAO,gBAAgB,WAAW;AACjD,eAAe,OAAO,oBAAoB,cAAc;AACxD,eAAe,OAAO,oBAAoB,eAAe;","names":[]}
@@ -0,0 +1,142 @@
1
+ // packages/blocks/src/components/journey.ts
2
+ import { css, html, nothing } from "lit";
3
+ import { ImpaktElement, focusRing, fontSize, fontWeight, space, t, token } from "@atomic-ui/ui";
4
+ var JOURNEY_STAGES = ["note", "wireframe", "component", "code", "live"];
5
+ var isStage = (value) => JOURNEY_STAGES.includes(value);
6
+ var arrow = html`<svg class="arrow" viewBox="0 0 20 12" width="20" height="12" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" focusable="false">
7
+ <path d="M0 6h18M13 1l5 5-5 5" />
8
+ </svg>`;
9
+ var ImpaktJourneyButton = class extends ImpaktElement {
10
+ static {
11
+ this.properties = {
12
+ stage: { type: String, reflect: true },
13
+ label: { type: String },
14
+ href: { type: String },
15
+ decorative: { type: Boolean, reflect: true },
16
+ track: { type: String },
17
+ code: { type: Array }
18
+ };
19
+ }
20
+ constructor() {
21
+ super();
22
+ this.stage = "live";
23
+ this.label = "";
24
+ this.href = "";
25
+ this.decorative = false;
26
+ this.track = "";
27
+ this.code = {};
28
+ }
29
+ static {
30
+ this.styles = [
31
+ ...ImpaktElement.styles,
32
+ focusRing,
33
+ css`
34
+ :host { display: block; inline-size: min(100%, 26rem); --impakt-journey-accent: ${token("color.accent.default", "#e2cc40")}; --impakt-journey-on-accent: ${token("color.accent.on", "#1a1a1a")}; --impakt-journey-ease: cubic-bezier(0.65, 0, 0.35, 1); --impakt-journey-time: 600ms; }
35
+ .frame { position: relative; block-size: 15rem; }
36
+ /* Each plate is one stage's shape. Only its opacity and transform ever change. */
37
+ .plate { position: absolute; box-sizing: border-box; opacity: 0; pointer-events: none; transition: opacity var(--impakt-journey-time) var(--impakt-journey-ease), transform var(--impakt-journey-time) var(--impakt-journey-ease); }
38
+ .bar { inset-inline: 0; inset-block-start: calc(50% - 3rem); block-size: 6rem; }
39
+ .note { inset-inline-start: 12%; inset-block-start: 0.5rem; inline-size: min(14rem, 80%); block-size: 14rem; background: var(--impakt-journey-accent); box-shadow: 0 1.1rem 2.2rem rgb(0 0 0 / 0.18); transform: rotate(-4deg); }
40
+ .wire { background: ${t.surfaceCard}; border: ${t.borderThin} dashed ${t.textMuted}; }
41
+ .wire svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; color: ${t.rule}; }
42
+ .solid { background: var(--impakt-journey-accent); }
43
+ .shadow { box-shadow: 0 0.9rem 1.75rem rgb(0 0 0 / 0.22); }
44
+ .window { inset: 0; padding: ${space(5)}; background: ${t.text}; border-radius: ${t.radius}; font-family: ${t.fontMono}; font-size: ${fontSize("sm")}; line-height: 1.6; color: color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text}); white-space: pre; overflow: hidden; display: grid; grid-template-rows: 1fr 44px 1fr; }
45
+ .window .before { align-self: end; display: flex; flex-direction: column; }
46
+ .window .after { align-self: start; display: flex; flex-direction: column; }
47
+ .window .rule { display: block; block-size: 0.5em; margin-block: 0.55em; background: currentColor; opacity: 0.35; }
48
+ /* A measuring line above the bar, with a tick at each end. */
49
+ .marks { inset-inline: 0; inset-block-start: calc(50% - 4.5rem); block-size: 0.75rem; border-inline: 1.5px solid ${t.text}; }
50
+ .marks::before { content: ''; position: absolute; inset-inline: 0; inset-block-start: calc(50% - 0.75px); border-block-start: 1.5px solid ${t.text}; }
51
+
52
+ /* A stage that has passed shrinks toward the next shape as it fades; one still to come starts from the last. */
53
+ /* The note flattens without growing wider, so a shape that is not showing never reaches past the block (1.4.10). */
54
+ :host(:not([stage='note'])) .note { transform: rotate(0deg) scale(1, 0.45); }
55
+ :host([stage='note']) .wire { transform: rotate(-4deg) scale(0.6, 1.9); }
56
+ :host(:not([stage='code'])) .window { transform: scale(0.94, 0.5); }
57
+ :host([stage='note']) .note, :host([stage='wireframe']) .wire, :host(:is([stage='component'], [stage='live'])) .solid, :host([stage='code']) .window, :host([stage='component']) .marks, :host([stage='live']) .shadow { opacity: 1; }
58
+
59
+ /* The words. One element at every stage: a link, or a picture of one. */
60
+ .words { position: absolute; inset-inline: 0; inset-block-start: calc(50% - 3rem); box-sizing: border-box; min-block-size: 6rem; display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; padding-inline: ${space(8)}; font-family: ${t.fontBody}; font-size: ${fontSize("lg")}; font-weight: ${fontWeight("medium")}; line-height: 1.2; color: var(--impakt-journey-on-accent); text-decoration: none; transition: color var(--impakt-journey-time) var(--impakt-journey-ease), transform 180ms cubic-bezier(0.2, 0, 0, 1); }
61
+ .arrow { flex: none; }
62
+ :host([stage='note']) .words { inset-inline: 12% auto; inset-block-start: 0.5rem; inline-size: min(14rem, 80%); min-block-size: 14rem; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: ${space(6)}; font-size: ${fontSize("2xl")}; font-weight: ${fontWeight("semibold")}; letter-spacing: -0.02em; transform: rotate(-4deg); }
63
+ :host([stage='note']) .arrow { align-self: flex-end; }
64
+ :host([stage='wireframe']) .words { justify-content: center; font-family: ${t.fontMono}; font-size: ${fontSize("sm")}; font-weight: ${fontWeight("regular")}; color: ${t.textMuted}; }
65
+ :host([stage='code']) .words { inset-inline: ${space(5)}; justify-content: flex-start; min-block-size: 44px; inset-block-start: calc(50% - 22px); padding-inline: 3ch 0; font-family: ${t.fontMono}; font-size: ${fontSize("sm")}; font-weight: ${fontWeight("regular")}; color: var(--impakt-journey-code-words, ${t.surfaceCard}); }
66
+ /* Live, it answers a pointer: it lifts when pointed at and sits when pressed. */
67
+ :host([stage='live']) a.words:hover { transform: translateY(-2px); }
68
+ :host([stage='live']) a.words:active { transform: translateY(1px); }
69
+ a.words:focus-visible { outline: none; box-shadow: ${t.focusShadow}; }
70
+ @media (prefers-reduced-motion: reduce) { .plate, .words { transition: none; } :host([stage='live']) a.words:hover, :host([stage='live']) a.words:active { transform: none; } }
71
+ @media (forced-colors: active) {
72
+ .plate { forced-color-adjust: none; }
73
+ .note, .solid { background: Highlight; }
74
+ .marks, .marks::before { border-color: CanvasText; }
75
+ .window { background: Canvas; border: 1px solid CanvasText; color: CanvasText; }
76
+ .wire { background: Canvas; border-color: CanvasText; }
77
+ .words, :host([stage='wireframe']) .words, :host([stage='code']) .words { color: LinkText; forced-color-adjust: none; }
78
+ :host(:is([stage='note'], [stage='component'], [stage='live'])) .words { color: HighlightText; }
79
+ }
80
+ `
81
+ ];
82
+ }
83
+ connectedCallback() {
84
+ super.connectedCallback();
85
+ if (this.hasUpdated) this.watch();
86
+ }
87
+ disconnectedCallback() {
88
+ super.disconnectedCallback();
89
+ this.observer?.disconnect();
90
+ this.observer = void 0;
91
+ }
92
+ willUpdate(changed) {
93
+ if (changed.has("stage") && !isStage(this.stage)) this.stage = "live";
94
+ }
95
+ updated(changed) {
96
+ if (changed.has("track")) this.watch();
97
+ }
98
+ /** Follow the sections named by `track`: the one across the middle of the screen sets the stage. */
99
+ watch() {
100
+ this.observer?.disconnect();
101
+ this.observer = void 0;
102
+ if (!this.track || !this.isConnected || typeof IntersectionObserver !== "function") return;
103
+ let sections;
104
+ try {
105
+ sections = Array.from(this.ownerDocument.querySelectorAll(this.track)).filter((el) => isStage(el.getAttribute("data-journey-stage")));
106
+ } catch {
107
+ return;
108
+ }
109
+ if (!sections.length) return;
110
+ this.observer = new IntersectionObserver((entries) => this.crossed(entries), { rootMargin: "-50% 0px -50% 0px", threshold: 0 });
111
+ for (const section of sections) this.observer.observe(section);
112
+ }
113
+ crossed(entries) {
114
+ const entry = entries.find((e) => e.isIntersecting);
115
+ const stage = entry?.target.getAttribute("data-journey-stage");
116
+ if (!isStage(stage) || stage === this.stage) return;
117
+ this.stage = stage;
118
+ this.dispatchEvent(new CustomEvent("impakt-journey-stage", { detail: { stage }, bubbles: true, composed: true }));
119
+ }
120
+ lines(lines, fallback) {
121
+ return lines?.length ? lines.map((line) => html`<span>${line}</span>`) : Array.from({ length: fallback }, (_, i) => html`<span class="rule" style=${`inline-size:${[58, 72, 44][i % 3]}%`}></span>`);
122
+ }
123
+ render() {
124
+ const words = html`<span>${this.label}</span>${arrow}`;
125
+ return html`<div class="frame" part="frame" aria-hidden=${this.decorative ? "true" : nothing}>
126
+ <span class="plate note" aria-hidden="true"></span>
127
+ <span class="plate bar wire" aria-hidden="true"><svg viewBox="0 0 100 100" preserveAspectRatio="none" fill="none" stroke="currentColor" focusable="false"><path d="M0 0 100 100M0 100 100 0" vector-effect="non-scaling-stroke" /></svg></span>
128
+ <span class="plate bar shadow" aria-hidden="true"></span>
129
+ <span class="plate bar solid" aria-hidden="true"></span>
130
+ <span class="plate window" aria-hidden="true"><span class="before">${this.lines(this.code?.before, 3)}</span><span></span><span class="after">${this.lines(this.code?.after, 2)}</span></span>
131
+ <span class="plate marks" aria-hidden="true"></span>
132
+ ${this.decorative || !this.href ? html`<span class="words" part="button">${words}</span>` : html`<a class="words" part="button" href=${this.href}>${words}</a>`}
133
+ </div>`;
134
+ }
135
+ };
136
+ customElements.define("impakt-journey-button", ImpaktJourneyButton);
137
+
138
+ export {
139
+ JOURNEY_STAGES,
140
+ ImpaktJourneyButton
141
+ };
142
+ //# sourceMappingURL=chunk-YMSFOS3H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/journey.ts"],"sourcesContent":["/**\n * The journey button: a site's one call to action, drawn at the stage a\n * section of the page is about.\n */\nimport { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement, focusRing, fontSize, fontWeight, space, t, token } from '@atomic-ui/ui';\n\n/** The stages a button passes through on its way to being live, in order. */\nexport const JOURNEY_STAGES = ['note', 'wireframe', 'component', 'code', 'live'] as const;\nexport type JourneyStage = (typeof JOURNEY_STAGES)[number];\n\nconst isStage = (value: unknown): value is JourneyStage => (JOURNEY_STAGES as readonly string[]).includes(value as string);\n\n/** The arrow after the words. Drawn, so no font has to hold the glyph. */\nconst arrow = html`<svg class=\"arrow\" viewBox=\"0 0 20 12\" width=\"20\" height=\"12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M0 6h18M13 1l5 5-5 5\" />\n</svg>`;\n\n/**\n * A call to action drawn as the thing it once was: a sticky note from a\n * workshop, a wireframe box, a designed component, the code that renders it,\n * and at last the live button. A page shows it at the stage each section is\n * about, so the same button is seen being made as the page is read.\n *\n * **It is the same link at every stage.** Whatever it is drawn as, it is one\n * `<a>` whose name is its words, so a screen reader and a keyboard meet an\n * ordinary link; the note, the wireframe cross, the measuring marks and the\n * lines of code around it are decoration and are hidden (1.3.1, 4.1.2). Its\n * target is at least 44px tall at every stage (2.5.8).\n *\n * **A page that shows it more than once sets `decorative` on the copies.** A\n * decorative one is a picture of the button, not a control: it has no link\n * and is hidden from a screen reader, so the page does not hold five links\n * that say the same thing (2.4.4).\n *\n * **One button can follow the page.** Give `track` a selector for the page's\n * sections, each carrying `data-journey-stage`, and the button takes the stage\n * of whichever section is across the middle of the screen. It watches with an\n * IntersectionObserver, so nothing runs while the page scrolls.\n *\n * **Only transforms, opacity and colour move**, so a change of stage costs no\n * layout. With reduced motion asked for, a stage cuts straight to the next\n * (2.3.3). The words on every fill are a pair the tokens already measured:\n * the accent with its own text colour, and the text colour with the card\n * colour (1.4.3). A brand whose ink is dark may colour the words in the code\n * window by setting `--impakt-journey-code-words`.\n *\n * @category action\n * @icon button\n * @fires {CustomEvent<{ stage: JourneyStage }>} impakt-journey-stage - When a tracked button changes stage as the page scrolls.\n */\nexport class ImpaktJourneyButton extends ImpaktElement {\n static properties = {\n stage: { type: String, reflect: true },\n label: { type: String },\n href: { type: String },\n decorative: { type: Boolean, reflect: true },\n track: { type: String },\n code: { type: Array },\n };\n /** What the button is drawn as. */\n declare stage: JourneyStage;\n /** The button's words, such as \"Book a 30-minute call\". */\n declare label: string;\n /** Where the button goes. */\n declare href: string;\n /** Draw it as a picture only, with no link, for a page that already has the real button. */\n declare decorative: boolean;\n /**\n * A selector for the sections of the page that each carry\n * `data-journey-stage`. The button then takes the stage of the section\n * across the middle of the screen. Leave empty to set `stage` by hand.\n */\n declare track: string;\n /**\n * Lines of code drawn around the words at the `code` stage, split where the\n * words go: the lines before, then the lines after. They are decoration and\n * are not read. Left empty, plain bars are drawn instead.\n */\n declare code: { before?: string[]; after?: string[] };\n\n constructor() {\n super();\n this.stage = 'live';\n this.label = '';\n this.href = '';\n this.decorative = false;\n this.track = '';\n this.code = {};\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host { display: block; inline-size: min(100%, 26rem); --impakt-journey-accent: ${token('color.accent.default', '#e2cc40')}; --impakt-journey-on-accent: ${token('color.accent.on', '#1a1a1a')}; --impakt-journey-ease: cubic-bezier(0.65, 0, 0.35, 1); --impakt-journey-time: 600ms; }\n .frame { position: relative; block-size: 15rem; }\n /* Each plate is one stage's shape. Only its opacity and transform ever change. */\n .plate { position: absolute; box-sizing: border-box; opacity: 0; pointer-events: none; transition: opacity var(--impakt-journey-time) var(--impakt-journey-ease), transform var(--impakt-journey-time) var(--impakt-journey-ease); }\n .bar { inset-inline: 0; inset-block-start: calc(50% - 3rem); block-size: 6rem; }\n .note { inset-inline-start: 12%; inset-block-start: 0.5rem; inline-size: min(14rem, 80%); block-size: 14rem; background: var(--impakt-journey-accent); box-shadow: 0 1.1rem 2.2rem rgb(0 0 0 / 0.18); transform: rotate(-4deg); }\n .wire { background: ${t.surfaceCard}; border: ${t.borderThin} dashed ${t.textMuted}; }\n .wire svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; color: ${t.rule}; }\n .solid { background: var(--impakt-journey-accent); }\n .shadow { box-shadow: 0 0.9rem 1.75rem rgb(0 0 0 / 0.22); }\n .window { inset: 0; padding: ${space(5)}; background: ${t.text}; border-radius: ${t.radius}; font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; line-height: 1.6; color: color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text}); white-space: pre; overflow: hidden; display: grid; grid-template-rows: 1fr 44px 1fr; }\n .window .before { align-self: end; display: flex; flex-direction: column; }\n .window .after { align-self: start; display: flex; flex-direction: column; }\n .window .rule { display: block; block-size: 0.5em; margin-block: 0.55em; background: currentColor; opacity: 0.35; }\n /* A measuring line above the bar, with a tick at each end. */\n .marks { inset-inline: 0; inset-block-start: calc(50% - 4.5rem); block-size: 0.75rem; border-inline: 1.5px solid ${t.text}; }\n .marks::before { content: ''; position: absolute; inset-inline: 0; inset-block-start: calc(50% - 0.75px); border-block-start: 1.5px solid ${t.text}; }\n\n /* A stage that has passed shrinks toward the next shape as it fades; one still to come starts from the last. */\n /* The note flattens without growing wider, so a shape that is not showing never reaches past the block (1.4.10). */\n :host(:not([stage='note'])) .note { transform: rotate(0deg) scale(1, 0.45); }\n :host([stage='note']) .wire { transform: rotate(-4deg) scale(0.6, 1.9); }\n :host(:not([stage='code'])) .window { transform: scale(0.94, 0.5); }\n :host([stage='note']) .note, :host([stage='wireframe']) .wire, :host(:is([stage='component'], [stage='live'])) .solid, :host([stage='code']) .window, :host([stage='component']) .marks, :host([stage='live']) .shadow { opacity: 1; }\n\n /* The words. One element at every stage: a link, or a picture of one. */\n .words { position: absolute; inset-inline: 0; inset-block-start: calc(50% - 3rem); box-sizing: border-box; min-block-size: 6rem; display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; padding-inline: ${space(8)}; font-family: ${t.fontBody}; font-size: ${fontSize('lg')}; font-weight: ${fontWeight('medium')}; line-height: 1.2; color: var(--impakt-journey-on-accent); text-decoration: none; transition: color var(--impakt-journey-time) var(--impakt-journey-ease), transform 180ms cubic-bezier(0.2, 0, 0, 1); }\n .arrow { flex: none; }\n :host([stage='note']) .words { inset-inline: 12% auto; inset-block-start: 0.5rem; inline-size: min(14rem, 80%); min-block-size: 14rem; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: ${space(6)}; font-size: ${fontSize('2xl')}; font-weight: ${fontWeight('semibold')}; letter-spacing: -0.02em; transform: rotate(-4deg); }\n :host([stage='note']) .arrow { align-self: flex-end; }\n :host([stage='wireframe']) .words { justify-content: center; font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('regular')}; color: ${t.textMuted}; }\n :host([stage='code']) .words { inset-inline: ${space(5)}; justify-content: flex-start; min-block-size: 44px; inset-block-start: calc(50% - 22px); padding-inline: 3ch 0; font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('regular')}; color: var(--impakt-journey-code-words, ${t.surfaceCard}); }\n /* Live, it answers a pointer: it lifts when pointed at and sits when pressed. */\n :host([stage='live']) a.words:hover { transform: translateY(-2px); }\n :host([stage='live']) a.words:active { transform: translateY(1px); }\n a.words:focus-visible { outline: none; box-shadow: ${t.focusShadow}; }\n @media (prefers-reduced-motion: reduce) { .plate, .words { transition: none; } :host([stage='live']) a.words:hover, :host([stage='live']) a.words:active { transform: none; } }\n @media (forced-colors: active) {\n .plate { forced-color-adjust: none; }\n .note, .solid { background: Highlight; }\n .marks, .marks::before { border-color: CanvasText; }\n .window { background: Canvas; border: 1px solid CanvasText; color: CanvasText; }\n .wire { background: Canvas; border-color: CanvasText; }\n .words, :host([stage='wireframe']) .words, :host([stage='code']) .words { color: LinkText; forced-color-adjust: none; }\n :host(:is([stage='note'], [stage='component'], [stage='live'])) .words { color: HighlightText; }\n }\n `,\n ];\n\n private observer?: IntersectionObserver;\n\n connectedCallback(): void {\n super.connectedCallback();\n // The first render starts the watch; this is for a button taken off the page and put back.\n if (this.hasUpdated) this.watch();\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.observer = undefined;\n }\n\n protected willUpdate(changed: Map<string, unknown>): void {\n // A stage that is not one of the five would draw nothing at all, so it falls back to the finished button.\n if (changed.has('stage') && !isStage(this.stage)) this.stage = 'live';\n }\n\n protected updated(changed: Map<string, unknown>): void {\n if (changed.has('track')) this.watch();\n }\n\n /** Follow the sections named by `track`: the one across the middle of the screen sets the stage. */\n private watch(): void {\n this.observer?.disconnect();\n this.observer = undefined;\n if (!this.track || !this.isConnected || typeof IntersectionObserver !== 'function') return;\n let sections: Element[];\n try {\n sections = Array.from(this.ownerDocument.querySelectorAll(this.track)).filter((el) => isStage(el.getAttribute('data-journey-stage')));\n } catch {\n // Not a selector: nothing to follow.\n return;\n }\n if (!sections.length) return;\n // A line across the middle of the screen. A section is \"current\" while it crosses that line.\n this.observer = new IntersectionObserver((entries) => this.crossed(entries), { rootMargin: '-50% 0px -50% 0px', threshold: 0 });\n for (const section of sections) this.observer.observe(section);\n }\n\n private crossed(entries: IntersectionObserverEntry[]): void {\n const entry = entries.find((e) => e.isIntersecting);\n const stage = entry?.target.getAttribute('data-journey-stage');\n if (!isStage(stage) || stage === this.stage) return;\n this.stage = stage;\n this.dispatchEvent(new CustomEvent('impakt-journey-stage', { detail: { stage }, bubbles: true, composed: true }));\n }\n\n private lines(lines: string[] | undefined, fallback: number): TemplateResult[] {\n return lines?.length\n ? lines.map((line) => html`<span>${line}</span>`)\n : Array.from({ length: fallback }, (_, i) => html`<span class=\"rule\" style=${`inline-size:${[58, 72, 44][i % 3]}%`}></span>`);\n }\n\n render(): TemplateResult {\n const words = html`<span>${this.label}</span>${arrow}`;\n return html`<div class=\"frame\" part=\"frame\" aria-hidden=${this.decorative ? 'true' : nothing}>\n <span class=\"plate note\" aria-hidden=\"true\"></span>\n <span class=\"plate bar wire\" aria-hidden=\"true\"><svg viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" fill=\"none\" stroke=\"currentColor\" focusable=\"false\"><path d=\"M0 0 100 100M0 100 100 0\" vector-effect=\"non-scaling-stroke\" /></svg></span>\n <span class=\"plate bar shadow\" aria-hidden=\"true\"></span>\n <span class=\"plate bar solid\" aria-hidden=\"true\"></span>\n <span class=\"plate window\" aria-hidden=\"true\"><span class=\"before\">${this.lines(this.code?.before, 3)}</span><span></span><span class=\"after\">${this.lines(this.code?.after, 2)}</span></span>\n <span class=\"plate marks\" aria-hidden=\"true\"></span>\n ${this.decorative || !this.href ? html`<span class=\"words\" part=\"button\">${words}</span>` : html`<a class=\"words\" part=\"button\" href=${this.href}>${words}</a>`}\n </div>`;\n }\n}\n\ncustomElements.define('impakt-journey-button', ImpaktJourneyButton);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-journey-button': ImpaktJourneyButton;\n }\n}\n"],"mappings":";AAIA,SAAS,KAAK,MAAM,eAAoC;AACxD,SAAS,eAAe,WAAW,UAAU,YAAY,OAAO,GAAG,aAAa;AAGzE,IAAM,iBAAiB,CAAC,QAAQ,aAAa,aAAa,QAAQ,MAAM;AAG/E,IAAM,UAAU,CAAC,UAA2C,eAAqC,SAAS,KAAe;AAGzH,IAAM,QAAQ;AAAA;AAAA;AAqCP,IAAM,sBAAN,cAAkC,cAAc;AAAA,EACrD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,YAAY,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MAC3C,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE,MAAM,MAAM;AAAA,IACtB;AAAA;AAAA,EAsBA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,QAAQ;AACb,SAAK,OAAO,CAAC;AAAA,EACf;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA,MACA;AAAA,sFACkF,MAAM,wBAAwB,SAAS,CAAC,iCAAiC,MAAM,mBAAmB,SAAS,C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,IAAI,CAAC,CAAC,GAAG,UAAU;AAAA,EAChI;AAAA,EAEA,SAAyB;AACvB,UAAM,QAAQ,aAAa,KAAK,KAAK,UAAU,KAAK;AACpD,WAAO,mDAAmD,KAAK,aAAa,SAAS,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,2EAKrB,KAAK,MAAM,KAAK,MAAM,QAAQ,CAAC,CAAC,2CAA2C,KAAK,MAAM,KAAK,MAAM,OAAO,CAAC,CAAC;AAAA;AAAA,QAE7K,KAAK,cAAc,CAAC,KAAK,OAAO,yCAAyC,KAAK,YAAY,2CAA2C,KAAK,IAAI,IAAI,KAAK,MAAM;AAAA;AAAA,EAEnK;AACF;AAEA,eAAe,OAAO,yBAAyB,mBAAmB;","names":[]}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * The journey button: a site's one call to action, drawn at the stage a
3
+ * section of the page is about.
4
+ */
5
+ import { type TemplateResult } from 'lit';
6
+ import { ImpaktElement } from '@atomic-ui/ui';
7
+ /** The stages a button passes through on its way to being live, in order. */
8
+ export declare const JOURNEY_STAGES: readonly ["note", "wireframe", "component", "code", "live"];
9
+ export type JourneyStage = (typeof JOURNEY_STAGES)[number];
10
+ /**
11
+ * A call to action drawn as the thing it once was: a sticky note from a
12
+ * workshop, a wireframe box, a designed component, the code that renders it,
13
+ * and at last the live button. A page shows it at the stage each section is
14
+ * about, so the same button is seen being made as the page is read.
15
+ *
16
+ * **It is the same link at every stage.** Whatever it is drawn as, it is one
17
+ * `<a>` whose name is its words, so a screen reader and a keyboard meet an
18
+ * ordinary link; the note, the wireframe cross, the measuring marks and the
19
+ * lines of code around it are decoration and are hidden (1.3.1, 4.1.2). Its
20
+ * target is at least 44px tall at every stage (2.5.8).
21
+ *
22
+ * **A page that shows it more than once sets `decorative` on the copies.** A
23
+ * decorative one is a picture of the button, not a control: it has no link
24
+ * and is hidden from a screen reader, so the page does not hold five links
25
+ * that say the same thing (2.4.4).
26
+ *
27
+ * **One button can follow the page.** Give `track` a selector for the page's
28
+ * sections, each carrying `data-journey-stage`, and the button takes the stage
29
+ * of whichever section is across the middle of the screen. It watches with an
30
+ * IntersectionObserver, so nothing runs while the page scrolls.
31
+ *
32
+ * **Only transforms, opacity and colour move**, so a change of stage costs no
33
+ * layout. With reduced motion asked for, a stage cuts straight to the next
34
+ * (2.3.3). The words on every fill are a pair the tokens already measured:
35
+ * the accent with its own text colour, and the text colour with the card
36
+ * colour (1.4.3). A brand whose ink is dark may colour the words in the code
37
+ * window by setting `--impakt-journey-code-words`.
38
+ *
39
+ * @category action
40
+ * @icon button
41
+ * @fires {CustomEvent<{ stage: JourneyStage }>} impakt-journey-stage - When a tracked button changes stage as the page scrolls.
42
+ */
43
+ export declare class ImpaktJourneyButton extends ImpaktElement {
44
+ static properties: {
45
+ stage: {
46
+ type: StringConstructor;
47
+ reflect: boolean;
48
+ };
49
+ label: {
50
+ type: StringConstructor;
51
+ };
52
+ href: {
53
+ type: StringConstructor;
54
+ };
55
+ decorative: {
56
+ type: BooleanConstructor;
57
+ reflect: boolean;
58
+ };
59
+ track: {
60
+ type: StringConstructor;
61
+ };
62
+ code: {
63
+ type: ArrayConstructor;
64
+ };
65
+ };
66
+ /** What the button is drawn as. */
67
+ stage: JourneyStage;
68
+ /** The button's words, such as "Book a 30-minute call". */
69
+ label: string;
70
+ /** Where the button goes. */
71
+ href: string;
72
+ /** Draw it as a picture only, with no link, for a page that already has the real button. */
73
+ decorative: boolean;
74
+ /**
75
+ * A selector for the sections of the page that each carry
76
+ * `data-journey-stage`. The button then takes the stage of the section
77
+ * across the middle of the screen. Leave empty to set `stage` by hand.
78
+ */
79
+ track: string;
80
+ /**
81
+ * Lines of code drawn around the words at the `code` stage, split where the
82
+ * words go: the lines before, then the lines after. They are decoration and
83
+ * are not read. Left empty, plain bars are drawn instead.
84
+ */
85
+ code: {
86
+ before?: string[];
87
+ after?: string[];
88
+ };
89
+ constructor();
90
+ static styles: import("lit").CSSResult[];
91
+ private observer?;
92
+ connectedCallback(): void;
93
+ disconnectedCallback(): void;
94
+ protected willUpdate(changed: Map<string, unknown>): void;
95
+ protected updated(changed: Map<string, unknown>): void;
96
+ /** Follow the sections named by `track`: the one across the middle of the screen sets the stage. */
97
+ private watch;
98
+ private crossed;
99
+ private lines;
100
+ render(): TemplateResult;
101
+ }
102
+ declare global {
103
+ interface HTMLElementTagNameMap {
104
+ 'impakt-journey-button': ImpaktJourneyButton;
105
+ }
106
+ }
@@ -0,0 +1,9 @@
1
+ import {
2
+ ImpaktJourneyButton,
3
+ JOURNEY_STAGES
4
+ } from "../chunk-YMSFOS3H.js";
5
+ export {
6
+ ImpaktJourneyButton,
7
+ JOURNEY_STAGES
8
+ };
9
+ //# sourceMappingURL=journey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -185,6 +185,11 @@ export declare class ImpaktSiteFooter extends ImpaktElement {
185
185
  brand: {
186
186
  type: StringConstructor;
187
187
  };
188
+ brandSize: {
189
+ type: StringConstructor;
190
+ reflect: boolean;
191
+ attribute: string;
192
+ };
188
193
  log: {
189
194
  type: ArrayConstructor;
190
195
  };
@@ -210,6 +215,12 @@ export declare class ImpaktSiteFooter extends ImpaktElement {
210
215
  };
211
216
  /** The site's name, set large. */
212
217
  brand: string;
218
+ /**
219
+ * How large the name is set. `display` runs it the full width of the footer,
220
+ * under the columns, sized by the footer's own width so it never spills at
221
+ * 320px.
222
+ */
223
+ brandSize: 'lg' | 'display';
213
224
  /** Lines set in code type under the brand, newest first. The first is bright. */
214
225
  log: FooterLogLine[];
215
226
  columns: FooterColumn[];
@@ -2,7 +2,7 @@ import {
2
2
  ImpaktSiteFooter,
3
3
  ImpaktSiteHeader,
4
4
  ImpaktWordmark
5
- } from "../chunk-YWATQR3J.js";
5
+ } from "../chunk-CPOCQURG.js";
6
6
  export {
7
7
  ImpaktSiteFooter,
8
8
  ImpaktSiteHeader,