@atomic-ui/blocks 0.10.1 → 0.12.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.
Files changed (84) hide show
  1. package/custom-elements.json +3157 -97
  2. package/dist/chunk-2URXTXNQ.js +296 -0
  3. package/dist/chunk-2URXTXNQ.js.map +1 -0
  4. package/dist/chunk-7X4WGV6K.js +97 -0
  5. package/dist/chunk-7X4WGV6K.js.map +1 -0
  6. package/dist/{chunk-QGVIJNTD.js → chunk-CCFBROX3.js} +127 -41
  7. package/dist/chunk-CCFBROX3.js.map +1 -0
  8. package/dist/{chunk-NLHFBIGQ.js → chunk-EYP5LWUR.js} +28 -10
  9. package/dist/chunk-EYP5LWUR.js.map +1 -0
  10. package/dist/chunk-GRKPKJZH.js +275 -0
  11. package/dist/chunk-GRKPKJZH.js.map +1 -0
  12. package/dist/{chunk-OR4U4UJQ.js → chunk-MX7FU5JE.js} +69 -1
  13. package/dist/chunk-MX7FU5JE.js.map +1 -0
  14. package/dist/{chunk-UVHQY3QJ.js → chunk-NHWD2LUR.js} +2 -2
  15. package/dist/chunk-NHWD2LUR.js.map +1 -0
  16. package/dist/{chunk-FLOKZ7O3.js → chunk-PIUPEB4I.js} +44 -11
  17. package/dist/chunk-PIUPEB4I.js.map +1 -0
  18. package/dist/{chunk-HNCJLMQB.js → chunk-R7SSIE2E.js} +26 -8
  19. package/dist/chunk-R7SSIE2E.js.map +1 -0
  20. package/dist/{chunk-LJ6AQO26.js → chunk-SYTQIQT2.js} +73 -18
  21. package/dist/chunk-SYTQIQT2.js.map +1 -0
  22. package/dist/chunk-WGDMORWT.js +48 -0
  23. package/dist/chunk-WGDMORWT.js.map +1 -0
  24. package/dist/{chunk-PALYJCLC.js → chunk-XB6FD4SF.js} +3 -3
  25. package/dist/chunk-XB6FD4SF.js.map +1 -0
  26. package/dist/chunk-XNRFZCNB.js +499 -0
  27. package/dist/chunk-XNRFZCNB.js.map +1 -0
  28. package/dist/{chunk-CC2U2L2H.js → chunk-YXMXLVK7.js} +3 -3
  29. package/dist/chunk-YXMXLVK7.js.map +1 -0
  30. package/dist/{chunk-YC6KXE6O.js → chunk-ZD75GU6J.js} +7 -4
  31. package/dist/chunk-ZD75GU6J.js.map +1 -0
  32. package/dist/{chunk-TT2PTEQO.js → chunk-ZODL5HD4.js} +64 -17
  33. package/dist/chunk-ZODL5HD4.js.map +1 -0
  34. package/dist/components/card-grid.js +1 -1
  35. package/dist/components/changelog.d.ts +24 -0
  36. package/dist/components/changelog.js +2 -2
  37. package/dist/components/estimator.d.ts +25 -0
  38. package/dist/components/estimator.js +1 -1
  39. package/dist/components/g2-case.d.ts +225 -0
  40. package/dist/components/g2-case.js +16 -0
  41. package/dist/components/g2-case.js.map +1 -0
  42. package/dist/components/g2-shared.d.ts +28 -0
  43. package/dist/components/g2-shared.js +35 -0
  44. package/dist/components/g2-shared.js.map +1 -0
  45. package/dist/components/g2-site.d.ts +493 -0
  46. package/dist/components/g2-site.js +26 -0
  47. package/dist/components/g2-site.js.map +1 -0
  48. package/dist/components/g2-tools.d.ts +77 -0
  49. package/dist/components/g2-tools.js +8 -0
  50. package/dist/components/g2-tools.js.map +1 -0
  51. package/dist/components/journey.d.ts +79 -9
  52. package/dist/components/journey.js +1 -1
  53. package/dist/components/marketing.d.ts +23 -0
  54. package/dist/components/marketing.js +1 -1
  55. package/dist/components/organisms.d.ts +23 -2
  56. package/dist/components/organisms.js +1 -1
  57. package/dist/components/property.js +1 -1
  58. package/dist/components/scene.js +1 -1
  59. package/dist/components/scrubber.js +1 -1
  60. package/dist/components/selling.d.ts +42 -1
  61. package/dist/components/selling.js +1 -1
  62. package/dist/components/site.d.ts +78 -0
  63. package/dist/components/site.js +1 -1
  64. package/dist/components/studio.d.ts +87 -6
  65. package/dist/components/studio.js +1 -1
  66. package/dist/index.d.ts +3 -0
  67. package/dist/index.js +81 -42
  68. package/dist/index.js.map +1 -1
  69. package/dist/standalone/atomic-ui-blocks.js +1373 -787
  70. package/dist/standalone/atomic-ui-blocks.js.map +4 -4
  71. package/package.json +3 -3
  72. package/dist/chunk-CC2U2L2H.js.map +0 -1
  73. package/dist/chunk-FLOKZ7O3.js.map +0 -1
  74. package/dist/chunk-HNCJLMQB.js.map +0 -1
  75. package/dist/chunk-LJ6AQO26.js.map +0 -1
  76. package/dist/chunk-NLHFBIGQ.js.map +0 -1
  77. package/dist/chunk-OR4U4UJQ.js.map +0 -1
  78. package/dist/chunk-PALYJCLC.js.map +0 -1
  79. package/dist/chunk-QGVIJNTD.js.map +0 -1
  80. package/dist/chunk-SOFMXF32.js +0 -142
  81. package/dist/chunk-SOFMXF32.js.map +0 -1
  82. package/dist/chunk-TT2PTEQO.js.map +0 -1
  83. package/dist/chunk-UVHQY3QJ.js.map +0 -1
  84. package/dist/chunk-YC6KXE6O.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/organisms.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { say, ImpaktElement, focusRing, targetSize, visuallyHidden, fontWeight, lineHeight, space, spaceAround, t, token, type, iconSvg } from '@atomic-ui/ui';\n\nconst token_accent = token('color.accent.default', '#c8a15a');\n\nconst reducedMotion = (): boolean => typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;\n\n/** A round control laid over or beside content: previous, next, close. */\nconst roundButton = css`\n .round { ${targetSize} display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; padding: 0; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.rule}; border-radius: 50%; box-shadow: ${t.shadowSm}; cursor: pointer; transition: box-shadow 120ms ease-in-out, background-color 120ms ease-in-out; }\n .round:hover:not(:disabled) { box-shadow: ${t.shadowMd}; }\n .round:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }\n`;\n\nconst headingStyles = css`\n .eyebrow { margin: 0; color: var(--impakt-eyebrow, var(--impakt-color-text-eyebrow, ${t.brand})); ${type('sm')} font-size: var(--impakt-font-size-eyebrow, var(--impakt-font-size-sm, 0.875rem)); font-family: ${t.fontEyebrow}; font-weight: var(--impakt-font-weight-eyebrow, ${fontWeight('semibold')}); letter-spacing: ${t.trackingWide}; text-transform: uppercase; }\n .h { margin: 0; color: ${t.textHeading}; font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; letter-spacing: ${t.trackingTight}; text-wrap: balance; }\n .lead { margin: 0; color: ${t.textMuted}; text-wrap: pretty; }\n`;\n\n/**\n * Slides that move sideways: house types, reviews, the rooms of a show home.\n * Put anything in it, one child to a slide.\n *\n * It follows the ARIA carousel pattern. Each slide is named \"2 of 6\", a live\n * region says where you are, and it can be moved with the buttons, the dots,\n * the arrow keys, a swipe or a scroll.\n *\n * **It moves only when asked.** Autoplay is off by default. Turned on, it has a\n * Pause button, stops while pointed at or focused, and never runs for someone\n * who has asked for reduced motion (2.2.2).\n *\n * @category content\n * @icon carousel\n * @slot - The slides, one child to each.\n */\nexport class ImpaktCarousel extends ImpaktElement {\n static properties = {\n label: { type: String },\n perView: { type: String, reflect: true, attribute: 'per-view' },\n arrows: { type: String, reflect: true },\n autoplay: { type: Boolean, reflect: true },\n seconds: { type: Number },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** What the slides are, for a screen reader, such as \"House types\". */\n declare label: string;\n /** How many slides show at once on a wide screen. A tablet shows at most two, and a phone one. */\n declare perView: '1' | '2' | '3';\n /** Where the arrows sit: under the slides, or level with the heading above them. */\n declare arrows: 'below' | 'top';\n /** Move on by itself. People can pause it, and it never runs for those who ask for less motion. */\n declare autoplay: boolean;\n /** How long each slide stays, when it moves by itself. */\n declare seconds: number;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n private index = 0;\n private count = 0;\n /** How many slides fit right now, which the width decides. */\n private visible: number | null = null;\n /** Where a button or dot is taking the row. Until it arrives, the scroll position is not the truth. */\n private heading: number | null = null;\n private settle: ReturnType<typeof setTimeout> | undefined;\n private observer: ResizeObserver | undefined;\n private paused = false;\n private held = false;\n private timer: ReturnType<typeof setInterval> | undefined;\n\n constructor() {\n super();\n this.label = 'Slides';\n this.perView = '1';\n this.arrows = 'below';\n this.autoplay = false;\n this.seconds = 6;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n spaceAround,\n roundButton,\n css`\n :host { display: block; container-type: inline-size; --most: 1; --gap: ${space(6)}; }\n :host([per-view='2']) { --most: 2; }\n :host([per-view='3']) { --most: 3; }\n .track { --per: var(--most); display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: ${space(1)} ${space(2)}; border-radius: ${t.radiusLg}; }\n .track::-webkit-scrollbar { display: none; }\n ::slotted(*) { flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per)); min-inline-size: 0; scroll-snap-align: start; box-sizing: border-box; }\n /* Whole slides only: a slice of the next one reads as content spilling out of the page. */\n @container (max-width: 60rem) { .track { --per: min(var(--most), 2); } }\n @container (max-width: 40rem) { .track { --per: 1; --gap: ${space(4)}; } }\n .controls { display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; margin-block-start: ${space(4)}; }\n .dots { display: flex; flex-wrap: wrap; gap: ${space(1)}; }\n .dot { ${targetSize} display: inline-flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: 0; cursor: pointer; border-radius: ${t.radiusSm}; }\n .dot span { display: block; inline-size: 8px; block-size: 8px; border-radius: 50%; background: ${t.rule}; transition: inline-size 150ms ease-in-out, background-color 150ms ease-in-out; }\n .dot[aria-current='true'] span { inline-size: 24px; background: ${t.brand}; }\n .buttons { display: flex; gap: ${space(2)}; }\n section { position: relative; }\n @container (min-width: 40.01rem) { :host([arrows='top']) .buttons { position: absolute; inset-block-end: calc(100% + ${space(4)}); inset-inline-end: 0; } }\n .sr-only { ${visuallyHidden} }\n @media (forced-colors: active) { .dot span { background: CanvasText; } .dot[aria-current='true'] span { background: Highlight; } }\n `,\n ];\n\n private get track(): HTMLElement | null {\n return this.renderRoot.querySelector('.track');\n }\n\n private get slides(): HTMLElement[] {\n return Array.from(this.children) as HTMLElement[];\n }\n\n /** The last slide that can sit at the start of the row. */\n private get last(): number {\n return Math.max(0, this.count - (this.visible ?? Number(this.perView || 1)));\n }\n\n /** Count what actually fits, and keep the row on a real stop when that changes. */\n private measure(): void {\n const track = this.track;\n const first = this.slides[0];\n if (!track || !first) return;\n const width = first.getBoundingClientRect().width;\n if (width <= 0) return;\n const gap = Number.parseFloat(getComputedStyle(track).columnGap) || 0;\n const fits = Math.max(1, Math.round((track.clientWidth + gap) / (width + gap)));\n if (fits === this.visible) return;\n this.visible = fits;\n this.index = Math.min(this.index, this.last);\n const slide = this.slides[this.index];\n if (slide && typeof track.scrollTo === 'function') track.scrollTo({ left: slide.offsetLeft - track.offsetLeft, behavior: 'auto' });\n this.requestUpdate();\n }\n\n private onSlots(): void {\n const slides = this.slides;\n this.count = slides.length;\n slides.forEach((slide, i) => {\n slide.setAttribute('role', 'group');\n slide.setAttribute('aria-roledescription', say('slide'));\n slide.setAttribute('aria-label', say('{slide} of {slides}', { slide: i + 1, slides: slides.length }));\n });\n this.measure();\n this.requestUpdate();\n }\n\n private go(to: number): void {\n const target = Math.min(this.last, Math.max(0, to));\n this.index = target;\n this.heading = target;\n clearTimeout(this.settle);\n // If the row has not got there by now (a tab in the background, say), put it there.\n this.settle = setTimeout(() => {\n const arrived = this.heading === null;\n this.heading = null;\n const track = this.track;\n const slide = this.slides[this.index];\n if (!arrived && track && slide && typeof track.scrollTo === 'function') track.scrollTo({ left: slide.offsetLeft - track.offsetLeft, behavior: 'auto' });\n }, 900);\n this.requestUpdate();\n const track = this.track;\n const slide = this.slides[target];\n if (track && slide && typeof track.scrollTo === 'function') {\n track.scrollTo({ left: slide.offsetLeft - track.offsetLeft, behavior: reducedMotion() ? 'auto' : 'smooth' });\n }\n }\n\n private onScroll(): void {\n const track = this.track;\n const slides = this.slides;\n if (!track || !slides.length) return;\n let nearest = 0;\n let distance = Infinity;\n slides.forEach((slide, i) => {\n const d = Math.abs(slide.offsetLeft - track.offsetLeft - track.scrollLeft);\n if (d < distance) {\n distance = d;\n nearest = i;\n }\n });\n if (this.heading !== null) {\n if (nearest === this.heading && distance < 2) {\n this.heading = null;\n clearTimeout(this.settle);\n }\n return;\n }\n if (nearest !== this.index) {\n this.index = Math.min(nearest, this.last);\n this.requestUpdate();\n }\n }\n\n private onKey(event: KeyboardEvent): void {\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n this.go(this.index + 1);\n }\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n this.go(this.index - 1);\n }\n }\n\n private get canPlay(): boolean {\n return this.autoplay && !reducedMotion();\n }\n\n private restart(): void {\n clearInterval(this.timer);\n this.timer = undefined;\n if (!this.canPlay || this.paused || this.held) return;\n this.timer = setInterval(() => this.go(this.index >= this.last ? 0 : this.index + 1), Math.max(2, this.seconds) * 1000);\n }\n\n private hold(held: boolean): void {\n this.held = held;\n this.restart();\n }\n\n private togglePause(): void {\n this.paused = !this.paused;\n this.restart();\n this.requestUpdate();\n }\n\n protected firstUpdated(): void {\n if (typeof ResizeObserver === 'function' && this.track) {\n this.observer = new ResizeObserver(() => this.measure());\n this.observer.observe(this.track);\n }\n }\n\n protected updated(changed: Map<string, unknown>): void {\n if (changed.has('autoplay') || changed.has('seconds')) this.restart();\n if (changed.has('perView')) this.measure();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n if (this.track) this.observer?.observe(this.track);\n this.restart();\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n clearInterval(this.timer);\n clearTimeout(this.settle);\n }\n\n render(): TemplateResult {\n const stops = Array.from({ length: this.last + 1 }, (_, i) => i);\n return html`<section aria-roledescription=${say('carousel')} aria-label=${this.label} part=\"carousel\" @keydown=${this.onKey}\n @mouseenter=${() => this.hold(true)} @mouseleave=${() => this.hold(false)} @focusin=${() => this.hold(true)} @focusout=${() => this.hold(false)}>\n <div class=\"track\" part=\"track\" tabindex=\"0\" @scroll=${this.onScroll}><slot @slotchange=${this.onSlots}></slot></div>\n <div class=\"controls\" part=\"controls\">\n <div class=\"dots\">${stops.length > 1 ? stops.map((i) => html`<button class=\"dot\" type=\"button\" aria-label=${say('Go to slide {slide}', { slide: i + 1 })} aria-current=${i === this.index ? 'true' : 'false'} @click=${() => this.go(i)}><span></span></button>`) : nothing}</div>\n <div class=\"buttons\">\n ${this.canPlay ? html`<button class=\"round\" type=\"button\" aria-label=${say(this.paused ? 'Play the slides' : 'Pause the slides')} @click=${this.togglePause}>${this.paused ? iconSvg('arrow-right', '18px') : html`<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\"><rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\"/><rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1\"/></svg>`}</button>` : nothing}\n <button class=\"round\" type=\"button\" aria-label=${say('Previous slide')} ?disabled=${this.index === 0} @click=${() => this.go(this.index - 1)}>${iconSvg('arrow-left', '18px')}</button>\n <button class=\"round\" type=\"button\" aria-label=${say('Next slide')} ?disabled=${this.index >= this.last} @click=${() => this.go(this.index + 1)}>${iconSvg('arrow-right', '18px')}</button>\n </div>\n </div>\n <p class=\"sr-only\" aria-live=\"polite\">${say('Slide {slide} of {slides}', { slide: this.index + 1, slides: this.count })}</p>\n </section>`;\n }\n}\n\n/** One picture in a gallery. */\nexport interface GalleryItem {\n id?: string;\n src: string;\n alt: string;\n caption?: string;\n}\n\n/**\n * How far a gallery picture stretches so that no row ends in a gap, on a wide\n * container and on a narrow one. The large first picture keeps its own size.\n */\nexport function gallerySpan(index: number, count: number, layout: 'feature' | 'grid'): { wide: number; narrow: number; rows: number } {\n const last = index === count - 1;\n const span = { wide: 1, narrow: 1, rows: 1 };\n if (layout === 'grid') {\n if (last) {\n span.wide = count % 3 ? 4 - (count % 3) : 1;\n span.narrow = count % 2 ? 2 : 1;\n }\n return span;\n }\n if (index === 0) return span;\n if (count === 2) return { wide: 2, narrow: 2, rows: 2 };\n if (count === 3) return { ...span, wide: 2 };\n if (last) {\n const extra = (count - 5) % 4;\n span.wide = count === 4 ? 2 : count > 5 && extra ? 5 - extra : 1;\n span.narrow = count % 2 ? 1 : 2;\n }\n return span;\n}\n\n/**\n * A set of pictures, with the first shown large, that open full screen one at\n * a time: the rooms of a show home, or views of a development.\n *\n * Each picture is a button. The full-screen view is a real modal dialog, so\n * focus stays inside it, Escape closes it and focus returns to the picture that\n * opened it. The arrow keys move between pictures.\n *\n * @category media\n * @icon gallery\n */\nexport class ImpaktGallery extends ImpaktElement {\n static properties = {\n items: { type: Array },\n layout: { type: String, reflect: true },\n label: { type: String },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare items: GalleryItem[];\n /** One large picture with smaller ones beside it, or an even grid. */\n declare layout: 'feature' | 'grid';\n /** What the pictures are of, for a screen reader. */\n declare label: string;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n private shown = -1;\n private opener: HTMLElement | null = null;\n\n constructor() {\n super();\n this.items = [];\n this.layout = 'feature';\n this.label = 'Gallery';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n spaceAround,\n roundButton,\n css`\n :host { display: block; container-type: inline-size; }\n ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(3)}; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; }\n :host([layout='grid']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 220px; }\n li { grid-column: span var(--span-wide, 1); grid-row: span var(--span-rows, 1); }\n :host([layout='feature']) li:first-child { grid-column: span 2; grid-row: span 2; }\n .open { position: relative; display: block; inline-size: 100%; block-size: 100%; padding: 0; border: 0; background: ${t.surfaceInset}; border-radius: ${t.radiusXl}; overflow: hidden; cursor: zoom-in; }\n .open img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform 300ms ease-out; }\n .open:hover img { transform: scale(1.03); }\n @container (max-width: 40rem) { ul, :host([layout='grid']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 130px; } li { grid-column: span var(--span-narrow, 1); } }\n dialog { padding: 0; border: 0; background: transparent; max-inline-size: none; max-block-size: none; inline-size: 100vw; block-size: 100dvh; }\n dialog::backdrop { background: rgb(10 14 12 / 0.9); }\n .stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; block-size: 100%; box-sizing: border-box; padding: ${space(4)}; gap: ${space(3)}; color: #fff; }\n .bar { display: flex; align-items: center; justify-content: space-between; ${type('sm')} }\n .middle { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: ${space(3)}; min-block-size: 0; }\n .middle img { display: block; margin: auto; max-inline-size: 100%; max-block-size: 100%; object-fit: contain; border-radius: ${t.radiusLg}; }\n figure { margin: 0; display: flex; min-block-size: 0; block-size: 100%; }\n .caption { margin: 0; text-align: center; ${type('sm')} }\n `,\n ];\n\n private get dialog(): HTMLDialogElement | null {\n return this.renderRoot.querySelector('dialog');\n }\n\n private open(index: number, event: Event): void {\n this.opener = event.currentTarget as HTMLElement;\n this.shown = index;\n this.requestUpdate();\n void this.updateComplete.then(() => {\n const d = this.dialog;\n if (d && !d.open) {\n if (typeof d.showModal === 'function') d.showModal();\n else d.setAttribute('open', '');\n }\n });\n }\n\n private close(): void {\n const d = this.dialog;\n if (d?.open) {\n if (typeof d.close === 'function') d.close();\n else d.removeAttribute('open');\n }\n this.onClosed();\n }\n\n private onClosed(): void {\n if (this.shown === -1) return;\n this.shown = -1;\n this.requestUpdate();\n this.opener?.focus();\n }\n\n private step(by: number): void {\n const n = (this.items ?? []).length;\n if (!n || this.shown < 0) return;\n this.shown = (this.shown + by + n) % n;\n this.requestUpdate();\n }\n\n private onKey(event: KeyboardEvent): void {\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n this.step(1);\n }\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n this.step(-1);\n }\n }\n\n render(): TemplateResult {\n const items = this.items ?? [];\n const current = this.shown >= 0 ? items[this.shown] : undefined;\n return html`<ul aria-label=${this.label} part=\"list\">${items.map((item, i) => {\n const span = gallerySpan(i, items.length, this.layout);\n return html`<li style=${`--span-wide:${span.wide};--span-narrow:${span.narrow};--span-rows:${span.rows}`}>\n <button class=\"open\" type=\"button\" aria-label=${say('View larger: {picture}', { picture: item.alt })} @click=${(e: Event) => this.open(i, e)}><img src=${item.src} alt=${item.alt} loading=\"lazy\" /></button>\n </li>`;\n })}</ul>\n <dialog aria-label=${this.label} @keydown=${this.onKey} @close=${this.onClosed}>\n ${\n current\n ? html`<div class=\"stage\">\n <div class=\"bar\"><span>${this.shown + 1} of ${items.length}</span><button class=\"round\" type=\"button\" aria-label=${say('Close')} @click=${this.close}>${iconSvg('close', '18px')}</button></div>\n <div class=\"middle\">\n <button class=\"round\" type=\"button\" aria-label=${say('Previous picture')} @click=${() => this.step(-1)}>${iconSvg('arrow-left', '18px')}</button>\n <figure><img src=${current.src} alt=${current.alt} /></figure>\n <button class=\"round\" type=\"button\" aria-label=${say('Next picture')} @click=${() => this.step(1)}>${iconSvg('arrow-right', '18px')}</button>\n </div>\n <p class=\"caption\">${current.caption ?? current.alt}</p>\n </div>`\n : nothing\n }\n </dialog>`;\n }\n}\n\n/** One accreditation or partner. */\nexport interface LogoItem {\n id?: string;\n src: string;\n alt: string;\n href?: string;\n}\n\n/**\n * A row of logos that lends trust: accreditations, awards, lenders, partners.\n *\n * The logos are drawn quietly so they do not fight the page, and come to full\n * colour when pointed at. Each one is named by its alt text.\n *\n * @category content\n * @icon logos\n */\nexport class ImpaktLogoCloud extends ImpaktElement {\n static properties = {\n heading: { type: String },\n items: { type: Array },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** A line above the logos, such as \"Accredited by\". */\n declare heading: string;\n declare items: LogoItem[];\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.heading = '';\n this.items = [];\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; }\n p { margin: 0 0 ${space(6)}; text-align: center; color: ${t.textMuted}; ${type('sm')} font-weight: ${fontWeight('medium')}; }\n ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: ${space(8)} ${space(12)}; }\n img { display: block; block-size: 40px; inline-size: auto; max-inline-size: 160px; object-fit: contain; filter: grayscale(1); opacity: 0.7; transition: filter 200ms ease-in-out, opacity 200ms ease-in-out; }\n li:hover img { filter: none; opacity: 1; }\n a { display: block; border-radius: ${t.radiusSm}; }\n `,\n ];\n\n render(): TemplateResult {\n return html`${this.heading ? html`<p part=\"heading\">${this.heading}</p>` : nothing}\n <ul part=\"list\">${(this.items ?? []).map((logo) => html`<li>${logo.href ? html`<a href=${logo.href}><img src=${logo.src} alt=${logo.alt} /></a>` : html`<img src=${logo.src} alt=${logo.alt} />`}</li>`)}</ul>`;\n }\n}\n\n/** One step in a process. */\nexport interface StepItem {\n id?: string;\n heading: string;\n text?: string;\n /** A short line above the heading, such as how long the step takes. */\n meta?: string;\n}\n\n/**\n * A process, in order, joined by a line: how buying a home works, what happens\n * after you apply.\n *\n * It is an ordered list, so a screen reader says the number and how many there\n * are. The numbers are drawn from the list, not typed in.\n *\n * @category content\n * @icon steps\n */\nexport class ImpaktSteps extends ImpaktElement {\n static properties = {\n items: { type: Array },\n orientation: { type: String, reflect: true },\n look: { type: String, reflect: true },\n tones: { type: Boolean, reflect: true },\n current: { type: Number },\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 declare items: StepItem[];\n /** Across the page, or down it. Across becomes down on a narrow screen. */\n declare orientation: 'horizontal' | 'vertical';\n /**\n * `numbered` joins numbered circles with a line. `ruled` gives each step a\n * 1px rule along its top in the band's text colour, with its number and\n * meta in monospace capitals (\"01 · 1 TO 2 WEEKS\"), as a project plan's\n * phases are drawn; on a phone the steps hang off a rail down the left. The\n * steps are an ordered list either way.\n */\n declare look: 'numbered' | 'ruled';\n /**\n * With `ruled`: colour each step's rule in the brand's chart colours, and on\n * a phone draw the steps as a coloured branch graph, for a brand that wants\n * colour there.\n */\n declare tones: boolean;\n /**\n * The index of the step the project is at, from 0, or -1 for none. It is\n * marked `aria-current=\"step\"`, its rule is drawn heavier and its meta and\n * rule take `--impakt-steps-current`, which a dark band sets to the accent.\n */\n declare current: number;\n /** The level of each step's heading. One below the heading above the steps. */\n declare headingLevel: 2 | 3 | 4;\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.orientation = 'horizontal';\n this.look = 'numbered';\n this.tones = false;\n this.current = -1;\n this.headingLevel = 3;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n headingStyles,\n css`\n :host { display: block; container-type: inline-size; }\n ol { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: ${space(6)}; }\n li { position: relative; counter-increment: step; display: flex; flex-direction: column; gap: ${space(2)}; }\n li::before { content: counter(step); display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; border-radius: 50%; background: ${t.brand}; color: ${t.onBrand}; ${type('sm')} font-weight: ${fontWeight('bold')}; position: relative; z-index: 1; margin-block-end: ${space(2)}; }\n li:not(:last-child)::after { content: ''; position: absolute; inset-block-start: 20px; inset-inline-start: 48px; inset-inline-end: calc(-1 * ${space(6)} + 8px); block-size: 2px; background: ${t.rule}; }\n .h { ${type('lg')} letter-spacing: 0; }\n .meta { margin: 0; ${type('sm')} color: ${t.textMuted}; font-family: ${t.fontMono}; letter-spacing: 0.02em; }\n .body { margin: 0; color: ${t.textMuted}; line-height: ${lineHeight('normal')}; text-wrap: pretty; }\n :host([orientation='vertical']) ol { grid-auto-flow: row; }\n :host([orientation='vertical']) li { padding-inline-start: 56px; min-block-size: 56px; }\n :host([orientation='vertical']) li::before { position: absolute; inset-inline-start: 0; inset-block-start: 0; margin: 0; }\n :host([orientation='vertical']) li:not(:last-child)::after { inset-block-start: 48px; inset-block-end: calc(-1 * ${space(6)} + 8px); inset-inline-start: 19px; inset-inline-end: auto; inline-size: 2px; block-size: auto; }\n @container (max-width: 40rem) {\n ol { grid-auto-flow: row; }\n li { padding-inline-start: 56px; min-block-size: 56px; }\n li::before { position: absolute; inset-inline-start: 0; inset-block-start: 0; margin: 0; }\n li:not(:last-child)::after { inset-block-start: 48px; inset-block-end: calc(-1 * ${space(6)} + 8px); inset-inline-start: 19px; inset-inline-end: auto; inline-size: 2px; block-size: auto; }\n }\n /* Ruled: a 1px rule in the band's text colour, or in the chart colours with tones. */\n :host([look='ruled']) li { --rule: currentColor; padding-block-start: ${space(5)}; border-block-start: 1px solid var(--rule); }\n :host([look='ruled'][tones]) li { --rule: var(--chart); border-block-start-width: 3px; }\n :host([look='ruled']:not([tones])) .meta { font-size: 0.6875rem; letter-spacing: ${t.trackingWide}; text-transform: uppercase; }\n :host([look='ruled']:not([tones])) .meta::before { content: counter(step, decimal-leading-zero) ' · '; }\n :host([look='ruled']:not([tones])) li[aria-current] { --rule: var(--impakt-steps-current, currentColor); border-block-start-width: 2px; padding-block-start: calc(${space(5)} - 1px); }\n :host([look='ruled']:not([tones])) li[aria-current] .meta { color: var(--impakt-steps-current, currentColor); }\n :host([look='ruled']) li::before, :host([look='ruled']) li::after { display: none; }\n :host([look='ruled']) ol { gap: ${space(5)}; }\n /* On a phone the ruled steps hang off a rail: a 1.5px line down the left and a hollow 10px ring at each step, the current one filled. */\n @container (max-width: 40rem) {\n :host([look='ruled']) ol { gap: 0; }\n :host([look='ruled']) li, :host([look='ruled']:not([tones])) li[aria-current] { padding-inline-start: 40px; padding-block: ${space(6)}; min-block-size: 0; border-block-start: 0; }\n :host([look='ruled']) li::before { display: block; content: ''; position: absolute; inset-block: 0; inset-inline-start: 4px; inline-size: 1.5px; block-size: auto; border-radius: 0; margin: 0; background: currentColor; }\n :host([look='ruled']) li::after { display: block; content: ''; position: absolute; inset-block-start: calc(${space(6)} + 2px); inset-inline-start: 0; inline-size: 10px; block-size: 10px; box-sizing: border-box; border: 1px solid currentColor; border-radius: 50%; background: ${t.surfaceCard}; }\n :host([look='ruled']) li:first-child::before { inset-block-start: calc(${space(6)} + 7px); }\n :host([look='ruled']) li:last-child::before { inset-block-end: auto; block-size: calc(${space(6)} + 7px); }\n :host([look='ruled']:not([tones])) li[aria-current]::after { background: var(--impakt-steps-current, currentColor); }\n /* With tones: a branch graph, one trunk down the left and each step a coloured branch off it with a dot. */\n :host([look='ruled'][tones]) li::before { inset-block: 0; inset-inline-start: 0; inline-size: 2px; block-size: auto; background: ${t.text}; }\n :host([look='ruled'][tones]) li::after { inset-block: ${space(3)}; inset-inline-start: 2px; inline-size: 12px; block-size: auto; background: radial-gradient(circle at 100% 34px, var(--rule) 4px, transparent 4.5px); border: 2px solid var(--rule); border-inline-start: 0; border-radius: 0 14px 14px 0; }\n }\n @media (forced-colors: active) { li::before { border: 1px solid CanvasText; } li:not(:last-child)::after { background: CanvasText; } :host([look='ruled']) li { border-block-start-color: CanvasText; } :host([look='ruled']) li[aria-current]::after { background: Highlight; } }\n `,\n ];\n\n render(): TemplateResult {\n return html`<ol part=\"list\">${(this.items ?? []).map(\n (\n step,\n i,\n ) => html`<li part=\"step\" aria-current=${i === this.current ? 'step' : nothing} style=${this.look === 'ruled' ? `--chart:var(--impakt-color-chart-${(i % 5) + 1}, ${'var(--impakt-color-brand-default, #1f4ed8)'})` : nothing}>\n ${step.meta ? html`<p class=\"meta\">${step.meta}</p>` : nothing}\n <div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${step.heading}</div>\n ${step.text ? html`<p class=\"body\">${step.text}</p>` : nothing}\n </li>`,\n )}</ol>`;\n }\n}\n\n/**\n * A picture beside words, the working section of a marketing page: a heading,\n * a line of text, a short list of points and an action.\n *\n * On a phone the words come first, whichever side the picture is on, so the\n * reading order never depends on the layout.\n *\n * @category layout\n * @icon split\n * @role heading\n * @slot actions - Buttons and links under the words.\n */\nexport class ImpaktMediaSplit extends ImpaktElement {\n static properties = {\n eyebrow: { type: String },\n heading: { type: String },\n lead: { type: String },\n points: { type: Array },\n level: { type: Number, reflect: true },\n imageSrc: { type: String, attribute: 'image-src' },\n imageAlt: { type: String, attribute: 'image-alt' },\n imageSide: { type: String, reflect: true, attribute: 'image-side' },\n insetSrc: { type: String, attribute: 'inset-src' },\n insetAlt: { type: String, attribute: 'inset-alt' },\n ratio: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare eyebrow: string;\n declare heading: string;\n /** A sentence or two under the heading. */\n declare lead: string;\n /** Short points, each drawn with a tick. */\n declare points: string[];\n /** The heading's level in the page. */\n declare level: 2 | 3;\n declare imageSrc: string;\n /** What the picture shows. Leave empty only when it is decoration. */\n declare imageAlt: string;\n /** A smaller picture overlapping the corner of the main one. */\n declare insetSrc: string;\n declare insetAlt: string;\n /** Which side the picture sits on, on a wide screen. */\n declare imageSide: 'start' | 'end';\n /** The picture's shape. */\n declare ratio: '4:3' | '1:1' | '3:2' | '16:9';\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.level = 2;\n this.imageSrc = '';\n this.imageAlt = '';\n this.imageSide = 'end';\n this.insetSrc = '';\n this.insetAlt = '';\n this.ratio = '4:3';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n headingStyles,\n css`\n :host { display: block; container-type: inline-size; --ratio: 4 / 3; }\n :host([ratio='1:1']) { --ratio: 1 / 1; }\n :host([ratio='3:2']) { --ratio: 3 / 2; }\n :host([ratio='16:9']) { --ratio: 16 / 9; }\n .split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${space(16)}; align-items: center; }\n :host([image-side='start']) .picture { order: -1; }\n .words { display: flex; flex-direction: column; gap: ${space(4)}; }\n .h { ${type('4xl')} }\n .lead { ${type('lg')} }\n ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: ${space(3)}; }\n li { display: flex; gap: ${space(3)}; align-items: flex-start; line-height: ${lineHeight('normal')}; }\n .tick { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 24px; block-size: 24px; border-radius: 50%; background: ${t.brandSubtle}; color: ${t.brand}; }\n .actions { display: flex; flex-wrap: wrap; gap: ${space(3)} ${space(4)}; align-items: center; margin-block-start: ${space(2)}; }\n img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; border-radius: ${t.radius2xl}; box-shadow: ${t.shadowXl}; }\n .picture { position: relative; }\n .picture.has-inset { padding-block-end: 8%; padding-inline-end: 4%; }\n .inset { position: absolute; inset-block-end: 0; inset-inline-end: 0; inline-size: 42%; aspect-ratio: 10 / 7; border: 6px solid ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-sizing: border-box; }\n @container (max-width: 48rem) {\n .split { grid-template-columns: minmax(0, 1fr); gap: ${space(8)}; }\n :host([image-side='start']) .picture { order: 0; }\n .h { ${type('3xl')} }\n }\n `,\n ];\n\n render(): TemplateResult {\n return html`<div class=\"split\" part=\"split\">\n <div class=\"words\">\n ${this.eyebrow ? html`<p class=\"eyebrow\" part=\"eyebrow\">${this.eyebrow}</p>` : nothing}\n <div class=\"h\" role=\"heading\" aria-level=${this.level}>${this.heading}</div>\n ${this.lead ? html`<p class=\"lead\">${this.lead}</p>` : nothing}\n ${this.points?.length ? html`<ul>${this.points.map((p) => html`<li><span class=\"tick\">${iconSvg('check', '14px')}</span><span>${p}</span></li>`)}</ul>` : nothing}\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>\n ${this.imageSrc ? html`<div class=\"picture ${this.insetSrc ? 'has-inset' : ''}\"><img src=${this.imageSrc} alt=${this.imageAlt} loading=\"lazy\" part=\"image\" />${this.insetSrc ? html`<img class=\"inset\" src=${this.insetSrc} alt=${this.insetAlt} loading=\"lazy\" />` : nothing}</div>` : nothing}\n </div>`;\n }\n}\n\n/**\n * The closing push of a page: a rounded panel with a heading, a line of text\n * and the page's main action, set apart from everything above it.\n *\n * @category layout\n * @icon banner\n * @slot actions - The buttons.\n */\nexport class ImpaktCtaBanner extends ImpaktElement {\n static properties = {\n heading: { type: String },\n lead: { type: String },\n tone: { type: String, reflect: true },\n align: { type: String, reflect: true },\n imageSrc: { type: String, attribute: 'image-src' },\n imageAlt: { type: String, attribute: 'image-alt' },\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 declare heading: string;\n declare lead: string;\n /** The panel's colour. */\n declare tone: 'brand' | 'subtle' | 'card';\n /** Words beside the action, centred above it, or above it on the left. */\n declare align: 'split' | 'center' | 'stacked';\n /** A photo behind the words, with a scrim so they stay readable. */\n declare imageSrc: string;\n declare imageAlt: string;\n declare headingLevel: 2 | 3;\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.heading = '';\n this.lead = '';\n this.tone = 'brand';\n this.align = 'split';\n this.imageSrc = '';\n this.imageAlt = '';\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n headingStyles,\n css`\n :host { display: block; container-type: inline-size; }\n .panel { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: ${space(8)}; padding: ${space(16)}; border-radius: ${t.radius2xl}; background: ${t.surfaceCard}; box-shadow: ${t.shadowSm}, inset 0 0 0 1px ${t.hairline}; }\n :host([tone='subtle']) .panel { background: ${t.surfaceSubtle}; box-shadow: none; }\n :host([tone='brand']) .panel { background: ${t.brand}; color: ${t.onBrand}; box-shadow: ${t.shadowMd};\n /* A primary button on the brand panel turns over, as it does on an ink band, so it keeps an edge against the panel. */\n --impakt-button-primary: ${t.onBrand}; --impakt-button-on-primary: ${t.brand}; --impakt-button-primary-hover: color-mix(in srgb, ${t.onBrand} 86%, ${t.brand}); --impakt-color-text-inverse: ${t.brand}; }\n /* Only the words take the light colours: a button in the actions keeps its own. */\n :host([tone='brand']) .words { --impakt-color-text-heading: ${t.onBrand}; --impakt-color-text-default: ${t.onBrand}; --impakt-color-text-muted: ${t.onBrand}; --impakt-color-text-link: ${t.onBrand}; }\n /* A soft glow in the corner, so a flat colour has some depth. Decoration only. */\n :host([tone='brand']) .panel::before { content: ''; position: absolute; inset-block-start: -40%; inset-inline-end: -10%; inline-size: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, ${t.onBrand} 18%, transparent), transparent); pointer-events: none; }\n .photo { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }\n .panel.pictured { min-block-size: 26rem; color: #fff; background: #12211a; --impakt-color-text-heading: #fff; }\n .panel.pictured::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(18 31 26 / 0.8) 0%, rgb(18 31 26 / 0.1) 75%); }\n .panel.pictured .words, .panel.pictured .actions { z-index: 1; }\n @container (max-width: 48rem) { .panel.pictured { justify-content: flex-end; } .panel.pictured::after { background: linear-gradient(180deg, rgb(18 31 26 / 0.15) 0%, rgb(18 31 26 / 0.85) 100%); } }\n .words { position: relative; display: flex; flex-direction: column; gap: ${space(3)}; max-inline-size: 40rem; }\n .h { ${type('4xl')} }\n .lead { ${type('lg')} }\n .actions { position: relative; flex: none; display: flex; flex-wrap: wrap; gap: ${space(3)}; }\n :host([align='stacked']) .panel { flex-direction: column; align-items: flex-start; justify-content: center; }\n :host([align='center']) .panel { flex-direction: column; text-align: center; }\n :host([align='center']) .words { align-items: center; }\n @container (max-width: 48rem) { .panel { flex-direction: column; align-items: flex-start; padding: ${space(8)} ${space(6)}; } .h { ${type('3xl')} } :host([align='center']) .panel { align-items: center; } }\n @media (forced-colors: active) { .panel { border: 1px solid CanvasText; } }\n `,\n ];\n\n render(): TemplateResult {\n return html`<div class=\"panel ${this.imageSrc ? 'pictured' : ''}\" part=\"panel\">\n ${this.imageSrc ? html`<img class=\"photo\" src=${this.imageSrc} alt=${this.imageAlt} />` : nothing}\n <div class=\"words\">\n <div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>\n ${this.lead ? html`<p class=\"lead\">${this.lead}</p>` : nothing}\n </div>\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>`;\n }\n}\n\n/** One review. */\nexport interface ReviewItem {\n id?: string;\n quote: string;\n person: string;\n about?: string;\n rating?: number;\n avatarSrc?: string;\n}\n\nconst stars = (rating: number): TemplateResult =>\n html`<span class=\"stars\" role=\"img\" aria-label=${say('Rated {rating} out of 5', { rating })}>${[1, 2, 3, 4, 5].map((n) => html`<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" fill=${n <= rating ? 'currentColor' : 'none'} stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linejoin=\"round\"><path d=\"M12 3.5l2.6 5.4 5.9.7-4.4 4 1.2 5.8L12 16.5l-5.3 2.9 1.2-5.8-4.4-4 5.9-.7z\"/></svg>`)}</span>`;\n\nconst initials = (name: string): string =>\n name\n .split(/\\s+/)\n .filter((w) => /^[A-Za-z]/.test(w) && w.toLowerCase() !== 'and')\n .slice(0, 2)\n .map((w) => w[0]!.toUpperCase())\n .join('');\n\n/**\n * What customers say, in cards, with their rating and a face or their\n * initials, and a summary line above them.\n *\n * A rating is said in words as well as drawn in stars.\n *\n * @category content\n * @icon reviews\n */\nexport class ImpaktReviews extends ImpaktElement {\n static properties = {\n summary: { type: String },\n rating: { type: Number },\n items: { type: Array },\n columns: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** A line above the reviews, such as \"4.8 from 312 buyers\". */\n declare summary: string;\n /** The overall rating out of 5, drawn beside the summary. */\n declare rating: number | undefined;\n declare items: ReviewItem[];\n declare columns: 'two' | 'three';\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.summary = '';\n this.rating = undefined;\n this.items = [];\n this.columns = 'three';\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-type: inline-size; }\n .top { display: flex; align-items: center; gap: ${space(3)}; margin-block-end: ${space(6)}; ${type('sm')} font-weight: ${fontWeight('medium')}; }\n .stars { display: inline-flex; gap: 2px; color: ${token_accent}; }\n ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }\n :host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n li { display: flex; flex-direction: column; gap: ${space(4)}; padding: ${space(6)}; background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowSm}, inset 0 0 0 1px ${t.hairline}; }\n blockquote { margin: 0; flex: 1; ${type('md')} text-wrap: pretty; }\n .who { display: flex; align-items: center; gap: ${space(3)}; }\n .face { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; border-radius: 50%; overflow: hidden; background: ${t.brandSubtle}; color: ${t.brand}; ${type('sm')} font-weight: ${fontWeight('bold')}; }\n .face img { inline-size: 100%; block-size: 100%; object-fit: cover; }\n .name { font-weight: ${fontWeight('semibold')}; ${type('sm')} }\n .about { color: ${t.textMuted}; ${type('sm')} }\n @container (max-width: 56rem) { ul, :host([columns='two']) ul { grid-template-columns: minmax(0, 1fr); } }\n `,\n ];\n\n render(): TemplateResult {\n return html`${this.summary || this.rating ? html`<p class=\"top\" part=\"summary\" style=\"margin-block-start:0\">${this.rating ? stars(Math.round(this.rating)) : nothing}<span>${this.summary}</span></p>` : nothing}\n <ul part=\"list\">${(this.items ?? []).map(\n (r) => html`<li part=\"review\">\n ${r.rating ? stars(r.rating) : nothing}\n <blockquote>${r.quote}</blockquote>\n <div class=\"who\"><span class=\"face\" aria-hidden=\"true\">${r.avatarSrc ? html`<img src=${r.avatarSrc} alt=\"\" />` : initials(r.person)}</span><span><span class=\"name\">${r.person}</span>${r.about ? html`<br /><span class=\"about\">${r.about}</span>` : nothing}</span></div>\n </li>`,\n )}</ul>`;\n }\n}\n\n/**\n * An email sign-up in one line: release dates, price lists, launch news.\n *\n * The field has a real label, the browser checks the address, and what happens\n * with the address is said beside the button. The app receives the address and\n * says when it is done.\n *\n * @category form\n * @icon mail\n * @fires {CustomEvent<{ email: string }>} impakt-submit - When a valid address is sent. The address is in detail.email.\n */\nexport class ImpaktNewsletter extends ImpaktElement {\n static properties = {\n heading: { type: String },\n lead: { type: String },\n label: { type: String },\n buttonText: { type: String, attribute: 'button-text' },\n smallPrint: { type: String, attribute: 'small-print' },\n doneText: { type: String, attribute: 'done-text' },\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 declare heading: string;\n declare lead: string;\n /** The field's label. */\n declare label: string;\n declare buttonText: string;\n /** What happens with the address, such as how to stop the emails. */\n declare smallPrint: string;\n /** What is said once the address is sent. */\n declare doneText: string;\n declare headingLevel: 2 | 3;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n private done = false;\n\n constructor() {\n super();\n this.heading = '';\n this.lead = '';\n this.label = 'Email address';\n this.buttonText = 'Sign up';\n this.smallPrint = '';\n this.doneText = 'Thank you. You’re on the list.';\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n spaceAround,\n headingStyles,\n css`\n :host { display: block; container-type: inline-size; }\n .wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${space(8)}; align-items: center; }\n .words { display: flex; flex-direction: column; gap: ${space(2)}; }\n .h { ${type('2xl')} }\n form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: ${space(1)} ${space(3)}; }\n label { grid-column: 1 / -1; ${type('sm')} font-weight: ${fontWeight('semibold')}; }\n input { min-block-size: 44px; box-sizing: border-box; inline-size: 100%; padding: ${space(2.5)} ${space(3)}; font: inherit; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: ${t.shadowXs}; }\n button { ${targetSize} min-block-size: 44px; padding: ${space(2)} ${space(5)}; font: inherit; ${type('sm')} font-weight: ${fontWeight('semibold')}; color: ${t.onBrand}; background: ${t.brand}; border: 0; border-radius: ${t.radiusLg}; box-shadow: ${t.shadowXs}; cursor: pointer; }\n button:hover { background: ${t.brandHover}; }\n .note { grid-column: 1 / -1; margin: ${space(1)} 0 0; color: ${t.textMuted}; ${type('sm')} }\n .done { margin: 0; ${type('md')} font-weight: ${fontWeight('semibold')}; }\n @container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); } }\n `,\n ];\n\n private submit(event: SubmitEvent): void {\n event.preventDefault();\n const form = event.currentTarget as HTMLFormElement;\n if (typeof form.reportValidity === 'function' && !form.reportValidity()) return;\n const email = (form.querySelector('input') as HTMLInputElement).value.trim();\n this.dispatchEvent(new CustomEvent('impakt-submit', { detail: { email }, bubbles: true, composed: true }));\n this.done = true;\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n const field = this.id_('email');\n return html`<div class=\"wrap\" part=\"wrap\">\n <div class=\"words\">\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n ${this.lead ? html`<p class=\"lead\">${this.lead}</p>` : nothing}\n </div>\n <div aria-live=\"polite\">${\n this.done\n ? html`<p class=\"done\">${this.doneText}</p>`\n : html`<form @submit=${this.submit}>\n <label for=${field}>${this.label}</label>\n <input id=${field} type=\"email\" name=\"email\" autocomplete=\"email\" required />\n <button type=\"submit\">${this.buttonText}</button>\n ${this.smallPrint ? html`<p class=\"note\">${this.smallPrint}</p>` : nothing}\n </form>`\n }</div>\n </div>`;\n }\n}\n\ncustomElements.define('impakt-carousel', ImpaktCarousel);\ncustomElements.define('impakt-gallery', ImpaktGallery);\ncustomElements.define('impakt-logo-cloud', ImpaktLogoCloud);\ncustomElements.define('impakt-steps', ImpaktSteps);\ncustomElements.define('impakt-media-split', ImpaktMediaSplit);\ncustomElements.define('impakt-cta-banner', ImpaktCtaBanner);\ncustomElements.define('impakt-reviews', ImpaktReviews);\ncustomElements.define('impakt-newsletter', ImpaktNewsletter);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-carousel': ImpaktCarousel;\n 'impakt-gallery': ImpaktGallery;\n 'impakt-logo-cloud': ImpaktLogoCloud;\n 'impakt-steps': ImpaktSteps;\n 'impakt-media-split': ImpaktMediaSplit;\n 'impakt-cta-banner': ImpaktCtaBanner;\n 'impakt-reviews': ImpaktReviews;\n 'impakt-newsletter': ImpaktNewsletter;\n }\n}\n"],"mappings":";AAAA,SAAS,KAAK,MAAM,eAAoC;AACxD,SAAS,KAAK,eAAe,WAAW,YAAY,gBAAgB,YAAY,YAAY,OAAO,aAAa,GAAG,OAAO,MAAM,eAAe;AAE/I,IAAM,eAAe,MAAM,wBAAwB,SAAS;AAE5D,IAAM,gBAAgB,MAAe,OAAO,eAAe,cAAc,WAAW,kCAAkC,EAAE;AAGxH,IAAM,cAAc;AAAA,aACP,UAAU,gIAAgI,EAAE,IAAI,iBAAiB,EAAE,WAAW,aAAa,EAAE,UAAU,UAAU,EAAE,IAAI,qCAAqC,EAAE,QAAQ;AAAA,8CACrO,EAAE,QAAQ;AAAA;AAAA;AAIxD,IAAM,gBAAgB;AAAA,wFACkE,EAAE,KAAK,OAAO,KAAK,IAAI,CAAC,mGAAmG,EAAE,WAAW,oDAAoD,WAAW,UAAU,CAAC,sBAAsB,EAAE,YAAY;AAAA,2BACnT,EAAE,WAAW,kBAAkB,EAAE,WAAW,kBAAkB,WAAW,MAAM,CAAC,qBAAqB,EAAE,aAAa;AAAA,8BACjH,EAAE,SAAS;AAAA;AAmBlC,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAmChD,cAAc;AACZ,UAAM;AAbR,SAAQ,QAAQ;AAChB,SAAQ,QAAQ;AAEhB;AAAA,SAAQ,UAAyB;AAEjC;AAAA,SAAQ,UAAyB;AAGjC,SAAQ,SAAS;AACjB,SAAQ,OAA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AO,MAAM;AACnB,QAAI,OAAO,KAAK,mBAAmB,cAAc,CAAC,KAAK,eAAe,EAAG;AACzE,UAAM,QAAS,KAAK,cAAc,OAAO,EAAuB,MAAM,KAAK;AAC3E,SAAK,cAAc,IAAI,YAAY,iBAAiB,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,UAAU,KAAK,CAAC,CAAC;AACzG,SAAK,OAAO;AACZ,SAAK,cAAc;AAAA,EACrB;AAAA,EAEA,SAAyB;AACvB,UAAM,QAAQ,KAAK,IAAI,OAAO;AAC9B,WAAO;AAAA;AAAA,UAED,KAAK,UAAU,gDAAgD,KAAK,YAAY,IAAI,KAAK,OAAO,WAAW,OAAO;AAAA,UAClH,KAAK,OAAO,uBAAuB,KAAK,IAAI,SAAS,OAAO;AAAA;AAAA,gCAG9D,KAAK,OACD,uBAAuB,KAAK,QAAQ,SACpC,qBAAqB,KAAK,MAAM;AAAA,qBACvB,KAAK,IAAI,KAAK,KAAK;AAAA,oBACpB,KAAK;AAAA,gCACO,KAAK,UAAU;AAAA,UACrC,KAAK,aAAa,uBAAuB,KAAK,UAAU,SAAS,OAAO;AAAA,cAE5E;AAAA;AAAA,EAEJ;AACF;AAEA,eAAe,OAAO,mBAAmB,cAAc;AACvD,eAAe,OAAO,kBAAkB,aAAa;AACrD,eAAe,OAAO,qBAAqB,eAAe;AAC1D,eAAe,OAAO,gBAAgB,WAAW;AACjD,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,qBAAqB,eAAe;AAC1D,eAAe,OAAO,kBAAkB,aAAa;AACrD,eAAe,OAAO,qBAAqB,gBAAgB;","names":["track","slide"]}
@@ -0,0 +1,275 @@
1
+ // packages/blocks/src/components/journey.ts
2
+ import { css, html, nothing, unsafeCSS } from "lit";
3
+ import { ImpaktElement, focusRing, fontWeight, say, 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 indexOf = (stage) => JOURNEY_STAGES.indexOf(stage);
7
+ 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">
8
+ <path d="M0 6h18M13 1l5 5-5 5" />
9
+ </svg>`;
10
+ var pointer = html`<svg class="pointer" viewBox="0 0 16 20" width="16" height="20" aria-hidden="true" focusable="false">
11
+ <path d="M1 1v16l4.2-4 2.9 6.2 2.6-1.2-2.9-6.1H14Z" stroke-width="1.2" stroke-linejoin="round" />
12
+ </svg>`;
13
+ var move = (name, ms, easing) => unsafeCSS(`--jt: var(--impakt-motion-journey-${name}-duration, ${ms}ms); --je: var(--impakt-motion-journey-${name}-easing, ${easing});`);
14
+ var showAt = (k) => `clamp(0, min(calc(1 + var(--jp) - ${k}), calc(1 - var(--jp) + ${k})), 1)`;
15
+ var ImpaktJourneyButton = class extends ImpaktElement {
16
+ constructor() {
17
+ super();
18
+ this.sections = [];
19
+ this.frame = 0;
20
+ this.onScroll = () => {
21
+ if (this.frame) return;
22
+ this.frame = requestAnimationFrame(() => {
23
+ this.frame = 0;
24
+ this.scrub();
25
+ });
26
+ };
27
+ this.stage = "live";
28
+ this.label = "";
29
+ this.href = "";
30
+ this.decorative = false;
31
+ this.track = "";
32
+ this.code = {};
33
+ this.annotations = false;
34
+ this.captions = [];
35
+ this.marginNote = "";
36
+ this.specs = [];
37
+ this.markWidth = "400";
38
+ this.markHeight = "96";
39
+ }
40
+ static {
41
+ this.properties = {
42
+ stage: { type: String, reflect: true },
43
+ label: { type: String },
44
+ href: { type: String },
45
+ decorative: { type: Boolean, reflect: true },
46
+ track: { type: String },
47
+ code: { type: Array },
48
+ annotations: { type: Boolean, reflect: true },
49
+ captions: { type: Array },
50
+ marginNote: { type: String, attribute: "margin-note" },
51
+ specs: { type: Array },
52
+ markWidth: { type: String, attribute: "mark-width" },
53
+ markHeight: { type: String, attribute: "mark-height" }
54
+ };
55
+ }
56
+ static {
57
+ this.styles = [
58
+ ...ImpaktElement.styles,
59
+ focusRing,
60
+ css`
61
+ :host {
62
+ display: block; inline-size: min(100%, 35rem); container-type: inline-size;
63
+ --impakt-journey-accent: ${token("color.accent.default", "#ffd43b")}; --impakt-journey-on-accent: ${token("color.accent.on", "#1a1a1a")};
64
+ --hand: var(--impakt-font-family-hand, ${t.fontBody});
65
+ ${move("flatten", 640, "cubic-bezier(0.65, 0, 0.35, 1)")}
66
+ }
67
+ /* The move into a stage takes that move's timing; back out of it, the same move runs in reverse. */
68
+ :host([stage='component']) { ${move("ink-in", 560, "cubic-bezier(0.22, 1, 0.36, 1)")} }
69
+ :host([stage='code']) { ${move("compile", 720, "cubic-bezier(0.83, 0, 0.17, 1)")} }
70
+ :host([stage='live']) { ${move("ship", 600, "cubic-bezier(0.34, 1.56, 0.64, 1)")} }
71
+ /* About 14 wide to 9 tall at any width. Every size inside is a share of the width (cqi). */
72
+ .frame { position: relative; aspect-ratio: 14 / 9; }
73
+ /* Each plate is one stage's shape. Only its opacity and transform ever change. */
74
+ .plate { position: absolute; box-sizing: border-box; opacity: 0; pointer-events: none; transition: opacity var(--jt) var(--je), transform var(--jt) var(--je); }
75
+ .bar { inset-inline-start: 14.29cqi; inline-size: 71.43cqi; inset-block-start: calc(50% - 8.57cqi); block-size: 17.14cqi; }
76
+ .note { inset-inline-start: 22cqi; inset-block-start: 9cqi; inline-size: 46cqi; block-size: 46cqi; background: var(--impakt-journey-accent); box-shadow: 0 1.1rem 2.2rem rgb(0 0 0 / 0.18); transform: rotate(-4deg); }
77
+ .wire { background: ${t.surfaceCard}; border: ${t.borderThin} dashed ${t.textMuted}; }
78
+ .wire svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; color: ${t.rule}; }
79
+ .solid { background: var(--impakt-journey-accent); transform: scale(0.92); }
80
+ .shadow { box-shadow: 0 0.9rem 1.75rem rgb(0 0 0 / 0.22); transform: scale(0.9); }
81
+ :host(:is([stage='component'], [stage='live'])) .solid, :host([stage='live']) .shadow { transform: none; }
82
+ /* The code window is the raised ink and its muted words, a pair the theme measures, so it stays a dark window on paper and on an ink band alike. */
83
+ .window { inset-inline: 14.29cqi; inset-block: 8cqi; padding: 4cqi; background: var(--impakt-color-surface-ink-raised, ${t.text}); border: ${t.borderThin} solid var(--impakt-color-line-inverse, transparent); border-radius: ${t.radius}; font-family: ${t.fontMono}; font-size: clamp(0.625rem, 2.15cqi, 0.8125rem); line-height: 1.6; color: var(--impakt-color-text-inverse-muted, color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text})); white-space: pre; overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr) 44px minmax(0, 1fr); }
84
+ /* On a small button the lines furthest from the words are cut off, so a line never runs under the words. */
85
+ .window .before { align-self: end; display: flex; flex-direction: column; justify-content: flex-end; max-block-size: 100%; overflow: hidden; }
86
+ .window .after { align-self: start; display: flex; flex-direction: column; max-block-size: 100%; overflow: hidden; }
87
+ .window .comment { font-style: italic; }
88
+ .window .rule { display: block; block-size: 0.5em; margin-block: 0.55em; background: currentColor; opacity: 0.35; }
89
+
90
+ /* A stage that has passed shrinks toward the next shape as it fades; one still to come starts from the last. */
91
+ /* The note flattens without growing wider, so a shape that is not showing never reaches past the block (1.4.10). */
92
+ :host(:not([stage='note'])) .note { transform: rotate(0deg) scale(1, 0.45); }
93
+ :host([stage='note']) .wire { transform: rotate(-4deg) scale(0.6, 1.9); }
94
+ :host(:not([stage='code'])) .window { transform: scale(0.94, 0.5); }
95
+ :host([stage='note']) .note, :host([stage='wireframe']) .wire, :host(:is([stage='component'], [stage='live'])) .solid, :host([stage='code']) .window, :host([stage='live']) .shadow { opacity: 1; }
96
+
97
+ /* Scrubbed by the scroll, a plate's opacity follows the stage as a number, --jp, and only its shape still moves on its own. */
98
+ :host([scrub]) .plate { transition-property: transform; }
99
+ :host([scrub]) .note { opacity: ${unsafeCSS(showAt(0))}; }
100
+ :host([scrub]) .wire { opacity: ${unsafeCSS(showAt(1))}; }
101
+ :host([scrub]) .solid { opacity: max(${unsafeCSS(showAt(2))}, ${unsafeCSS(showAt(4))}); }
102
+ :host([scrub]) .window { opacity: ${unsafeCSS(showAt(3))}; }
103
+ :host([scrub]) .shadow { opacity: ${unsafeCSS(showAt(4))}; }
104
+
105
+ /* The words. One element at every stage: a link, or a picture of one. */
106
+ .words { position: absolute; inset-inline-start: 14.29cqi; inline-size: 71.43cqi; inset-block-start: calc(50% - 8.57cqi); box-sizing: border-box; min-block-size: max(44px, 17.14cqi); display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; padding-inline: 4.3cqi; font-family: ${t.fontBody}; font-size: clamp(0.9375rem, 3.57cqi, 1.25rem); font-weight: ${fontWeight("medium")}; line-height: 1.2; color: var(--impakt-journey-on-accent); text-decoration: none; transition: color var(--jt) var(--je), transform var(--jt) var(--je); }
107
+ .arrow { flex: none; }
108
+ /* At the note stage the words are handwritten, bold, with a line drawn under them. */
109
+ :host([stage='note']) .words { inset-inline-start: 22cqi; inset-block-start: 9cqi; inline-size: 46cqi; min-block-size: 46cqi; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 4.5cqi; font-family: var(--hand); font-size: clamp(1.25rem, 5.4cqi, 2rem); font-weight: ${fontWeight("bold")}; line-height: 1.1; letter-spacing: -0.01em; transform: rotate(-4deg); }
110
+ :host([stage='note']) .text::after { content: ''; display: block; block-size: 0.28em; margin-block-start: 0.12em; inline-size: 92%; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6c30-4 60-5 98-3s66 3 98-1' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6c30-4 60-5 98-3s66 3 98-1' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
111
+ :host([stage='note']) .arrow { align-self: flex-end; }
112
+ :host([stage='wireframe']) .words { justify-content: center; font-family: ${t.fontMono}; font-size: clamp(0.6875rem, 2.5cqi, 0.875rem); font-weight: ${fontWeight("regular")}; color: ${t.textMuted}; }
113
+ :host([stage='code']) .words { inset-inline-start: 14.29cqi; inline-size: 71.43cqi; justify-content: flex-start; min-block-size: 44px; inset-block-start: calc(50% - 22px); padding-inline: calc(4cqi + 3ch) 4cqi; font-family: ${t.fontMono}; font-size: clamp(0.625rem, 2.15cqi, 0.8125rem); font-weight: ${fontWeight("regular")}; color: var(--impakt-journey-code-words, var(--ik-ink-inverse, ${t.surfaceCard})); }
114
+ :host([stage='code']) .words .arrow { display: none; }
115
+ /* Live, it answers a pointer: it lifts when pointed at and sits when pressed, and its fill deepens a little. */
116
+ :host([stage='live']) .frame:has(a.words:hover) .solid { background: color-mix(in srgb, var(--impakt-journey-accent) 90%, ${t.text}); }
117
+ :host([stage='live']) a.words:hover { transform: translateY(-2px); transition: color 180ms, transform var(--impakt-motion-journey-lift-duration, 180ms) var(--impakt-motion-journey-lift-easing, cubic-bezier(0.2, 0, 0, 1)); }
118
+ :host([stage='live']) a.words:active { transform: translateY(1px); transition: color 140ms, transform var(--impakt-motion-journey-press-duration, 140ms) var(--impakt-motion-journey-press-easing, cubic-bezier(0.4, 0, 0.2, 1)); }
119
+ a.words:focus-visible { outline: none; box-shadow: ${t.focusShadow}; }
120
+
121
+ /* The design notes. Each shows at its own stages, and none is read. */
122
+ .ann { position: absolute; opacity: 0; pointer-events: none; transition: opacity var(--jt) var(--je); color: ${t.text}; }
123
+ .caption { inset-block-start: 0; inset-inline-start: 0; font-family: ${t.fontMono}; font-size: 0.6875rem; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; white-space: nowrap; }
124
+ .caption span { position: absolute; inset-block-start: 0; inset-inline-start: 0; opacity: 0; transition: opacity var(--jt) var(--je); }
125
+ :host([stage='note']) .caption span:nth-child(1), :host([stage='wireframe']) .caption span:nth-child(2), :host([stage='component']) .caption span:nth-child(3), :host([stage='code']) .caption span:nth-child(4), :host([stage='live']) .caption span:nth-child(5) { opacity: 1; }
126
+ .caption { opacity: 1; }
127
+ .margin { inset-inline-start: 71cqi; inset-block-start: 10cqi; inline-size: 27cqi; font-family: var(--hand); font-size: clamp(0.75rem, 2.9cqi, 1rem); line-height: 1.25; transform: rotate(4deg); }
128
+ .width { inset-inline-start: 14.29cqi; inline-size: 71.43cqi; inset-block-start: calc(50% - 8.57cqi - 5cqi); block-size: 2cqi; border-inline: 1px solid currentColor; }
129
+ .width::before { content: ''; position: absolute; inset-inline: 0; inset-block-start: 50%; border-block-start: 1px solid currentColor; }
130
+ .width b, .height b { position: absolute; font-family: ${t.fontMono}; font-size: 0.6875rem; font-weight: ${fontWeight("regular")}; line-height: 1; background: var(--impakt-journey-mark-ground, ${t.surfaceCard}); padding-inline: 0.4em; }
131
+ .width b { inset-block-start: 50%; inset-inline-start: 50%; transform: translate(-50%, -50%); }
132
+ .height { inset-inline-start: calc(14.29cqi + 71.43cqi + 2.5cqi); inline-size: 2cqi; inset-block-start: calc(50% - 8.57cqi); block-size: 17.14cqi; border-block: 1px solid currentColor; }
133
+ .height::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 50%; border-inline-start: 1px solid currentColor; }
134
+ .height b { inset-block-start: 50%; inset-inline-start: calc(100% + 0.2em); transform: translateY(-50%); background: none; }
135
+ .specs { inset-inline-start: 14.29cqi; inset-block-start: calc(50% + 8.57cqi + 3cqi); display: flex; flex-wrap: wrap; gap: 1.5cqi; inline-size: 75cqi; }
136
+ .specs span { padding: 0.15em 0.6em; font-family: ${t.fontMono}; font-size: clamp(0.5625rem, 1.9cqi, 0.6875rem); letter-spacing: ${t.trackingWide}; text-transform: uppercase; white-space: nowrap; border: 1px solid currentColor; background: ${t.surfaceCard}; }
137
+ .cursor { inset-inline-start: calc(14.29cqi + 71.43cqi - 4cqi); inset-block-start: calc(50% + 8.57cqi - 4cqi); }
138
+ .pointer { display: block; fill: ${t.text}; stroke: ${t.surfaceCard}; }
139
+ :host([stage='note']) .margin, :host(:is([stage='wireframe'], [stage='component'])) :is(.width, .height), :host([stage='component']) .specs, :host([stage='live']) .cursor { opacity: 1; }
140
+
141
+ @media (prefers-reduced-motion: reduce) {
142
+ .plate, .words, .ann, .caption span { transition: none; }
143
+ :host([stage='live']) a.words:hover, :host([stage='live']) a.words:active { transform: none; transition: none; }
144
+ }
145
+ @media (forced-colors: active) {
146
+ .plate { forced-color-adjust: none; }
147
+ .note, .solid { background: Highlight; }
148
+ .window { background: Canvas; border: 1px solid CanvasText; color: CanvasText; }
149
+ .wire { background: Canvas; border-color: CanvasText; }
150
+ .words, :host([stage='wireframe']) .words, :host([stage='code']) .words { color: LinkText; forced-color-adjust: none; }
151
+ :host(:is([stage='note'], [stage='component'], [stage='live'])) .words { color: HighlightText; }
152
+ .ann { color: CanvasText; }
153
+ }
154
+ `
155
+ ];
156
+ }
157
+ connectedCallback() {
158
+ super.connectedCallback();
159
+ if (this.hasUpdated) this.watch();
160
+ }
161
+ disconnectedCallback() {
162
+ super.disconnectedCallback();
163
+ this.observer?.disconnect();
164
+ this.observer = void 0;
165
+ this.stopScrub();
166
+ }
167
+ willUpdate(changed) {
168
+ if (changed.has("stage") && !isStage(this.stage)) this.stage = "live";
169
+ }
170
+ updated(changed) {
171
+ if (changed.has("track")) this.watch();
172
+ }
173
+ /** Follow the sections named by `track`: the one across the middle of the screen sets the stage. */
174
+ watch() {
175
+ this.observer?.disconnect();
176
+ this.observer = void 0;
177
+ this.stopScrub();
178
+ this.sections = [];
179
+ if (!this.track || !this.isConnected || typeof IntersectionObserver !== "function") return;
180
+ let sections;
181
+ try {
182
+ sections = Array.from(this.ownerDocument.querySelectorAll(this.track)).filter((el) => isStage(el.getAttribute("data-journey-stage")));
183
+ } catch {
184
+ return;
185
+ }
186
+ if (!sections.length) return;
187
+ this.sections = sections;
188
+ this.observer = new IntersectionObserver((entries) => this.crossed(entries), { rootMargin: "-50% 0px -50% 0px", threshold: 0 });
189
+ for (const section of sections) this.observer.observe(section);
190
+ this.startScrub();
191
+ }
192
+ crossed(entries) {
193
+ const entry = entries.find((e) => e.isIntersecting);
194
+ const stage = entry?.target.getAttribute("data-journey-stage");
195
+ if (isStage(stage)) this.become(stage);
196
+ }
197
+ become(stage) {
198
+ if (stage === this.stage) return;
199
+ this.stage = stage;
200
+ this.dispatchEvent(new CustomEvent("impakt-journey-stage", { detail: { stage }, bubbles: true, composed: true }));
201
+ }
202
+ /** Scrub between stages with the scroll, unless reduced motion is asked for. */
203
+ startScrub() {
204
+ const view = this.ownerDocument.defaultView;
205
+ if (!view || typeof view.requestAnimationFrame !== "function" || view.matchMedia?.("(prefers-reduced-motion: reduce)").matches) return;
206
+ view.addEventListener("scroll", this.onScroll, { passive: true });
207
+ view.addEventListener("resize", this.onScroll, { passive: true });
208
+ this.style.setProperty("--jp", String(indexOf(this.stage)));
209
+ this.toggleAttribute("scrub", true);
210
+ }
211
+ stopScrub() {
212
+ const view = this.ownerDocument?.defaultView;
213
+ view?.removeEventListener("scroll", this.onScroll);
214
+ view?.removeEventListener("resize", this.onScroll);
215
+ if (this.frame) cancelAnimationFrame(this.frame);
216
+ this.frame = 0;
217
+ this.removeAttribute("scrub");
218
+ this.style.removeProperty("--jp");
219
+ }
220
+ /**
221
+ * The stage as a number. The section across the middle of the screen gives
222
+ * the whole part; how far the next section has risen toward the middle gives
223
+ * the rest, so the move is complete as the next section crosses it.
224
+ */
225
+ scrub() {
226
+ const view = this.ownerDocument.defaultView;
227
+ if (!view || !this.sections.length) return;
228
+ const middle = view.innerHeight / 2;
229
+ const tops = this.sections.map((s) => s.getBoundingClientRect().top);
230
+ let at = 0;
231
+ tops.forEach((top, i) => {
232
+ if (top <= middle) at = i;
233
+ });
234
+ const stageAt = (i) => indexOf(this.sections[i].getAttribute("data-journey-stage"));
235
+ const next = at + 1 < this.sections.length ? at + 1 : at;
236
+ const span = tops[next] - tops[at];
237
+ const f = next === at || span <= 0 ? 0 : Math.min(1, Math.max(0, (middle - tops[at]) / span));
238
+ const p = stageAt(at) + f * (stageAt(next) - stageAt(at));
239
+ this.style.setProperty("--jp", p.toFixed(3));
240
+ this.become(JOURNEY_STAGES[Math.round(p)]);
241
+ }
242
+ lines(lines, fallback) {
243
+ return lines?.length ? lines.map((line) => html`<span class=${line.trim().startsWith("//") ? "comment" : ""}>${line}</span>`) : Array.from({ length: fallback }, (_, i) => html`<span class="rule" style=${`inline-size:${[58, 72, 44][i % 3]}%`}></span>`);
244
+ }
245
+ /** The design notes around the button. All decoration. */
246
+ notes() {
247
+ const captions = this.captions?.length ? this.captions : [say("Note \u2014 Discover"), say("Wireframe \u2014 Design low-fi"), say("Component \u2014 Design hi-fi"), say("Code \u2014 Build"), say("Live \u2014 Launch")];
248
+ const specs = this.specs?.length ? this.specs : [say("Fill \xB7 Accent/Signal"), say("Radius \xB7 0"), say("Type \xB7 Archivo 20")];
249
+ return html`<span class="ann caption" part="caption">${JOURNEY_STAGES.map((_, i) => html`<span>${String(i + 1).padStart(2, "0")} · ${captions[i] ?? ""}</span>`)}</span>
250
+ <span class="ann margin" part="margin-note">${this.marginNote || say("make it the biggest thing on the page")}</span>
251
+ <span class="ann width"><b>${this.markWidth}</b></span>
252
+ <span class="ann height"><b>${this.markHeight}</b></span>
253
+ <span class="ann specs" part="specs">${specs.map((spec) => html`<span>${spec}</span>`)}</span>
254
+ <span class="ann cursor">${pointer}</span>`;
255
+ }
256
+ render() {
257
+ const words = html`<span class="text">${this.label}</span>${arrow}`;
258
+ return html`<div class="frame" part="frame" aria-hidden=${this.decorative ? "true" : nothing}>
259
+ <span class="plate note" aria-hidden="true"></span>
260
+ <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>
261
+ <span class="plate bar shadow" aria-hidden="true"></span>
262
+ <span class="plate bar solid" aria-hidden="true"></span>
263
+ <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>
264
+ ${this.annotations ? html`<span class="notes" aria-hidden="true">${this.notes()}</span>` : nothing}
265
+ ${this.decorative || !this.href ? html`<span class="words" part="button">${words}</span>` : html`<a class="words" part="button" href=${this.href}>${words}</a>`}
266
+ </div>`;
267
+ }
268
+ };
269
+ customElements.define("impakt-journey-button", ImpaktJourneyButton);
270
+
271
+ export {
272
+ JOURNEY_STAGES,
273
+ ImpaktJourneyButton
274
+ };
275
+ //# sourceMappingURL=chunk-GRKPKJZH.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, unsafeCSS, type TemplateResult } from 'lit';\nimport { ImpaktElement, focusRing, fontWeight, say, 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);\nconst indexOf = (stage: JourneyStage): number => JOURNEY_STAGES.indexOf(stage);\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/** A pointer, drawn at the live button when the annotations are on. */\nconst pointer = html`<svg class=\"pointer\" viewBox=\"0 0 16 20\" width=\"16\" height=\"20\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M1 1v16l4.2-4 2.9 6.2 2.6-1.2-2.9-6.1H14Z\" stroke-width=\"1.2\" stroke-linejoin=\"round\" />\n</svg>`;\n\n/** One move of the motion spec, read from its tokens with the spec's values as the fallback. */\nconst move = (name: string, ms: number, easing: string) =>\n unsafeCSS(`--jt: var(--impakt-motion-journey-${name}-duration, ${ms}ms); --je: var(--impakt-motion-journey-${name}-easing, ${easing});`);\n\n/**\n * How much of a plate shows while the page is scrubbed: 1 at its own stage,\n * fading to 0 one stage either side. `--jp` is the stage as a number, 0 to 4.\n */\nconst showAt = (k: number) => `clamp(0, min(calc(1 + var(--jp) - ${k}), calc(1 - var(--jp) + ${k})), 1)`;\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 * **It keeps its shape as it scales.** The drawing is about 14 wide to 9\n * tall at any width, 560 by 360 on a wide page and 347 by 223 on a phone, and\n * everything in it is sized from its own width.\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; an\n * IntersectionObserver watches for that. Between two sections the move is\n * scrubbed by the scroll: the next stage fades in as the next section rises,\n * and is complete as it crosses the middle of the screen. The scroll is read\n * at most once a frame, and only while a tracked section is on screen.\n *\n * **Each move has its own timing**, from the motion spec: flatten 640ms, ink\n * in 560ms, compile 720ms, ship 600ms with an overshoot, lift 180ms on hover\n * and press 140ms. Each is read from `--impakt-motion-journey-<move>-duration`\n * and `-easing`. **Only transforms, opacity and colour move**, so a change of\n * stage costs no layout. With reduced motion asked for, a stage cuts straight\n * to the next, nothing is scrubbed, and pointing at the live button changes\n * its colour only (2.3.3).\n *\n * **`annotations` draws the design notes around it**, as the site's motion\n * frames show: the stage's caption above, a handwritten note in the margin at\n * the note stage, the width and height marks at the wireframe and component,\n * the spec tags under the component and a pointer at the live button. They\n * are decoration and are hidden from a screen reader. Leave it off when the\n * button is a plain call to action.\n *\n * The words on every fill are a pair the tokens already measured: the accent\n * with its own text colour, and the text colour with the card colour (1.4.3).\n * A brand whose ink is dark may colour the words in the code window by\n * 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 annotations: { type: Boolean, reflect: true },\n captions: { type: Array },\n marginNote: { type: String, attribute: 'margin-note' },\n specs: { type: Array },\n markWidth: { type: String, attribute: 'mark-width' },\n markHeight: { type: String, attribute: 'mark-height' },\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. A line that starts with `//` is drawn dimmer, as a comment.\n * Left empty, plain bars are drawn instead.\n */\n declare code: { before?: string[]; after?: string[] };\n /** Draw the design notes around the button: captions, marks, spec tags, a margin note and a pointer. */\n declare annotations: boolean;\n /** With `annotations`: the caption above each stage, in order, such as \"Note — Discover\". Numbered for you. */\n declare captions: string[];\n /** With `annotations`: the handwritten note beside the sticky note. */\n declare marginNote: string;\n /** With `annotations`: the tags under the component, such as \"Fill · Accent/Signal\". */\n declare specs: string[];\n /** With `annotations`: the width written on the width mark, such as \"400\". */\n declare markWidth: string;\n /** With `annotations`: the height written on the height mark, such as \"96\". */\n declare markHeight: 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 this.annotations = false;\n this.captions = [];\n this.marginNote = '';\n this.specs = [];\n this.markWidth = '400';\n this.markHeight = '96';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host {\n display: block; inline-size: min(100%, 35rem); container-type: inline-size;\n --impakt-journey-accent: ${token('color.accent.default', '#ffd43b')}; --impakt-journey-on-accent: ${token('color.accent.on', '#1a1a1a')};\n --hand: var(--impakt-font-family-hand, ${t.fontBody});\n ${move('flatten', 640, 'cubic-bezier(0.65, 0, 0.35, 1)')}\n }\n /* The move into a stage takes that move's timing; back out of it, the same move runs in reverse. */\n :host([stage='component']) { ${move('ink-in', 560, 'cubic-bezier(0.22, 1, 0.36, 1)')} }\n :host([stage='code']) { ${move('compile', 720, 'cubic-bezier(0.83, 0, 0.17, 1)')} }\n :host([stage='live']) { ${move('ship', 600, 'cubic-bezier(0.34, 1.56, 0.64, 1)')} }\n /* About 14 wide to 9 tall at any width. Every size inside is a share of the width (cqi). */\n .frame { position: relative; aspect-ratio: 14 / 9; }\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(--jt) var(--je), transform var(--jt) var(--je); }\n .bar { inset-inline-start: 14.29cqi; inline-size: 71.43cqi; inset-block-start: calc(50% - 8.57cqi); block-size: 17.14cqi; }\n .note { inset-inline-start: 22cqi; inset-block-start: 9cqi; inline-size: 46cqi; block-size: 46cqi; 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); transform: scale(0.92); }\n .shadow { box-shadow: 0 0.9rem 1.75rem rgb(0 0 0 / 0.22); transform: scale(0.9); }\n :host(:is([stage='component'], [stage='live'])) .solid, :host([stage='live']) .shadow { transform: none; }\n /* The code window is the raised ink and its muted words, a pair the theme measures, so it stays a dark window on paper and on an ink band alike. */\n .window { inset-inline: 14.29cqi; inset-block: 8cqi; padding: 4cqi; background: var(--impakt-color-surface-ink-raised, ${t.text}); border: ${t.borderThin} solid var(--impakt-color-line-inverse, transparent); border-radius: ${t.radius}; font-family: ${t.fontMono}; font-size: clamp(0.625rem, 2.15cqi, 0.8125rem); line-height: 1.6; color: var(--impakt-color-text-inverse-muted, color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text})); white-space: pre; overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr) 44px minmax(0, 1fr); }\n /* On a small button the lines furthest from the words are cut off, so a line never runs under the words. */\n .window .before { align-self: end; display: flex; flex-direction: column; justify-content: flex-end; max-block-size: 100%; overflow: hidden; }\n .window .after { align-self: start; display: flex; flex-direction: column; max-block-size: 100%; overflow: hidden; }\n .window .comment { font-style: italic; }\n .window .rule { display: block; block-size: 0.5em; margin-block: 0.55em; background: currentColor; opacity: 0.35; }\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='live']) .shadow { opacity: 1; }\n\n /* Scrubbed by the scroll, a plate's opacity follows the stage as a number, --jp, and only its shape still moves on its own. */\n :host([scrub]) .plate { transition-property: transform; }\n :host([scrub]) .note { opacity: ${unsafeCSS(showAt(0))}; }\n :host([scrub]) .wire { opacity: ${unsafeCSS(showAt(1))}; }\n :host([scrub]) .solid { opacity: max(${unsafeCSS(showAt(2))}, ${unsafeCSS(showAt(4))}); }\n :host([scrub]) .window { opacity: ${unsafeCSS(showAt(3))}; }\n :host([scrub]) .shadow { opacity: ${unsafeCSS(showAt(4))}; }\n\n /* The words. One element at every stage: a link, or a picture of one. */\n .words { position: absolute; inset-inline-start: 14.29cqi; inline-size: 71.43cqi; inset-block-start: calc(50% - 8.57cqi); box-sizing: border-box; min-block-size: max(44px, 17.14cqi); display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; padding-inline: 4.3cqi; font-family: ${t.fontBody}; font-size: clamp(0.9375rem, 3.57cqi, 1.25rem); font-weight: ${fontWeight('medium')}; line-height: 1.2; color: var(--impakt-journey-on-accent); text-decoration: none; transition: color var(--jt) var(--je), transform var(--jt) var(--je); }\n .arrow { flex: none; }\n /* At the note stage the words are handwritten, bold, with a line drawn under them. */\n :host([stage='note']) .words { inset-inline-start: 22cqi; inset-block-start: 9cqi; inline-size: 46cqi; min-block-size: 46cqi; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 4.5cqi; font-family: var(--hand); font-size: clamp(1.25rem, 5.4cqi, 2rem); font-weight: ${fontWeight('bold')}; line-height: 1.1; letter-spacing: -0.01em; transform: rotate(-4deg); }\n :host([stage='note']) .text::after { content: ''; display: block; block-size: 0.28em; margin-block-start: 0.12em; inline-size: 92%; background: currentColor; -webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6c30-4 60-5 98-3s66 3 98-1' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E\") center / 100% 100% no-repeat; mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6c30-4 60-5 98-3s66 3 98-1' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E\") center / 100% 100% no-repeat; }\n :host([stage='note']) .arrow { align-self: flex-end; }\n :host([stage='wireframe']) .words { justify-content: center; font-family: ${t.fontMono}; font-size: clamp(0.6875rem, 2.5cqi, 0.875rem); font-weight: ${fontWeight('regular')}; color: ${t.textMuted}; }\n :host([stage='code']) .words { inset-inline-start: 14.29cqi; inline-size: 71.43cqi; justify-content: flex-start; min-block-size: 44px; inset-block-start: calc(50% - 22px); padding-inline: calc(4cqi + 3ch) 4cqi; font-family: ${t.fontMono}; font-size: clamp(0.625rem, 2.15cqi, 0.8125rem); font-weight: ${fontWeight('regular')}; color: var(--impakt-journey-code-words, var(--ik-ink-inverse, ${t.surfaceCard})); }\n :host([stage='code']) .words .arrow { display: none; }\n /* Live, it answers a pointer: it lifts when pointed at and sits when pressed, and its fill deepens a little. */\n :host([stage='live']) .frame:has(a.words:hover) .solid { background: color-mix(in srgb, var(--impakt-journey-accent) 90%, ${t.text}); }\n :host([stage='live']) a.words:hover { transform: translateY(-2px); transition: color 180ms, transform var(--impakt-motion-journey-lift-duration, 180ms) var(--impakt-motion-journey-lift-easing, cubic-bezier(0.2, 0, 0, 1)); }\n :host([stage='live']) a.words:active { transform: translateY(1px); transition: color 140ms, transform var(--impakt-motion-journey-press-duration, 140ms) var(--impakt-motion-journey-press-easing, cubic-bezier(0.4, 0, 0.2, 1)); }\n a.words:focus-visible { outline: none; box-shadow: ${t.focusShadow}; }\n\n /* The design notes. Each shows at its own stages, and none is read. */\n .ann { position: absolute; opacity: 0; pointer-events: none; transition: opacity var(--jt) var(--je); color: ${t.text}; }\n .caption { inset-block-start: 0; inset-inline-start: 0; font-family: ${t.fontMono}; font-size: 0.6875rem; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; white-space: nowrap; }\n .caption span { position: absolute; inset-block-start: 0; inset-inline-start: 0; opacity: 0; transition: opacity var(--jt) var(--je); }\n :host([stage='note']) .caption span:nth-child(1), :host([stage='wireframe']) .caption span:nth-child(2), :host([stage='component']) .caption span:nth-child(3), :host([stage='code']) .caption span:nth-child(4), :host([stage='live']) .caption span:nth-child(5) { opacity: 1; }\n .caption { opacity: 1; }\n .margin { inset-inline-start: 71cqi; inset-block-start: 10cqi; inline-size: 27cqi; font-family: var(--hand); font-size: clamp(0.75rem, 2.9cqi, 1rem); line-height: 1.25; transform: rotate(4deg); }\n .width { inset-inline-start: 14.29cqi; inline-size: 71.43cqi; inset-block-start: calc(50% - 8.57cqi - 5cqi); block-size: 2cqi; border-inline: 1px solid currentColor; }\n .width::before { content: ''; position: absolute; inset-inline: 0; inset-block-start: 50%; border-block-start: 1px solid currentColor; }\n .width b, .height b { position: absolute; font-family: ${t.fontMono}; font-size: 0.6875rem; font-weight: ${fontWeight('regular')}; line-height: 1; background: var(--impakt-journey-mark-ground, ${t.surfaceCard}); padding-inline: 0.4em; }\n .width b { inset-block-start: 50%; inset-inline-start: 50%; transform: translate(-50%, -50%); }\n .height { inset-inline-start: calc(14.29cqi + 71.43cqi + 2.5cqi); inline-size: 2cqi; inset-block-start: calc(50% - 8.57cqi); block-size: 17.14cqi; border-block: 1px solid currentColor; }\n .height::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 50%; border-inline-start: 1px solid currentColor; }\n .height b { inset-block-start: 50%; inset-inline-start: calc(100% + 0.2em); transform: translateY(-50%); background: none; }\n .specs { inset-inline-start: 14.29cqi; inset-block-start: calc(50% + 8.57cqi + 3cqi); display: flex; flex-wrap: wrap; gap: 1.5cqi; inline-size: 75cqi; }\n .specs span { padding: 0.15em 0.6em; font-family: ${t.fontMono}; font-size: clamp(0.5625rem, 1.9cqi, 0.6875rem); letter-spacing: ${t.trackingWide}; text-transform: uppercase; white-space: nowrap; border: 1px solid currentColor; background: ${t.surfaceCard}; }\n .cursor { inset-inline-start: calc(14.29cqi + 71.43cqi - 4cqi); inset-block-start: calc(50% + 8.57cqi - 4cqi); }\n .pointer { display: block; fill: ${t.text}; stroke: ${t.surfaceCard}; }\n :host([stage='note']) .margin, :host(:is([stage='wireframe'], [stage='component'])) :is(.width, .height), :host([stage='component']) .specs, :host([stage='live']) .cursor { opacity: 1; }\n\n @media (prefers-reduced-motion: reduce) {\n .plate, .words, .ann, .caption span { transition: none; }\n :host([stage='live']) a.words:hover, :host([stage='live']) a.words:active { transform: none; transition: none; }\n }\n @media (forced-colors: active) {\n .plate { forced-color-adjust: none; }\n .note, .solid { background: Highlight; }\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 .ann { color: CanvasText; }\n }\n `,\n ];\n\n private observer?: IntersectionObserver;\n private sections: Element[] = [];\n private frame = 0;\n private readonly onScroll = (): void => {\n if (this.frame) return;\n this.frame = requestAnimationFrame(() => {\n this.frame = 0;\n this.scrub();\n });\n };\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 this.stopScrub();\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 this.stopScrub();\n this.sections = [];\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 this.sections = sections;\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 this.startScrub();\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)) this.become(stage);\n }\n\n private become(stage: JourneyStage): void {\n if (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 /** Scrub between stages with the scroll, unless reduced motion is asked for. */\n private startScrub(): void {\n const view = this.ownerDocument.defaultView;\n if (!view || typeof view.requestAnimationFrame !== 'function' || view.matchMedia?.('(prefers-reduced-motion: reduce)').matches) return;\n view.addEventListener('scroll', this.onScroll, { passive: true });\n view.addEventListener('resize', this.onScroll, { passive: true });\n // It starts where the button is; the first scroll takes it from there.\n this.style.setProperty('--jp', String(indexOf(this.stage)));\n this.toggleAttribute('scrub', true);\n }\n\n private stopScrub(): void {\n const view = this.ownerDocument?.defaultView;\n view?.removeEventListener('scroll', this.onScroll);\n view?.removeEventListener('resize', this.onScroll);\n if (this.frame) cancelAnimationFrame(this.frame);\n this.frame = 0;\n this.removeAttribute('scrub');\n this.style.removeProperty('--jp');\n }\n\n /**\n * The stage as a number. The section across the middle of the screen gives\n * the whole part; how far the next section has risen toward the middle gives\n * the rest, so the move is complete as the next section crosses it.\n */\n private scrub(): void {\n const view = this.ownerDocument.defaultView;\n if (!view || !this.sections.length) return;\n const middle = view.innerHeight / 2;\n const tops = this.sections.map((s) => s.getBoundingClientRect().top);\n let at = 0;\n tops.forEach((top, i) => {\n if (top <= middle) at = i;\n });\n const stageAt = (i: number) => indexOf(this.sections[i]!.getAttribute('data-journey-stage') as JourneyStage);\n const next = at + 1 < this.sections.length ? at + 1 : at;\n const span = tops[next]! - tops[at]!;\n const f = next === at || span <= 0 ? 0 : Math.min(1, Math.max(0, (middle - tops[at]!) / span));\n const p = stageAt(at) + f * (stageAt(next) - stageAt(at));\n this.style.setProperty('--jp', p.toFixed(3));\n this.become(JOURNEY_STAGES[Math.round(p)]!);\n }\n\n private lines(lines: string[] | undefined, fallback: number): TemplateResult[] {\n return lines?.length\n ? lines.map((line) => html`<span class=${line.trim().startsWith('//') ? 'comment' : ''}>${line}</span>`)\n : Array.from({ length: fallback }, (_, i) => html`<span class=\"rule\" style=${`inline-size:${[58, 72, 44][i % 3]}%`}></span>`);\n }\n\n /** The design notes around the button. All decoration. */\n private notes(): TemplateResult {\n const captions = this.captions?.length\n ? this.captions\n : [say('Note — Discover'), say('Wireframe — Design low-fi'), say('Component — Design hi-fi'), say('Code — Build'), say('Live — Launch')];\n const specs = this.specs?.length ? this.specs : [say('Fill · Accent/Signal'), say('Radius · 0'), say('Type · Archivo 20')];\n return html`<span class=\"ann caption\" part=\"caption\">${JOURNEY_STAGES.map((_, i) => html`<span>${String(i + 1).padStart(2, '0')} · ${captions[i] ?? ''}</span>`)}</span>\n <span class=\"ann margin\" part=\"margin-note\">${this.marginNote || say('make it the biggest thing on the page')}</span>\n <span class=\"ann width\"><b>${this.markWidth}</b></span>\n <span class=\"ann height\"><b>${this.markHeight}</b></span>\n <span class=\"ann specs\" part=\"specs\">${specs.map((spec) => html`<span>${spec}</span>`)}</span>\n <span class=\"ann cursor\">${pointer}</span>`;\n }\n\n render(): TemplateResult {\n const words = html`<span class=\"text\">${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 ${this.annotations ? html`<span class=\"notes\" aria-hidden=\"true\">${this.notes()}</span>` : nothing}\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,SAAS,iBAAsC;AACnE,SAAS,eAAe,WAAW,YAAY,KAAK,OAAO,GAAG,aAAa;AAGpE,IAAM,iBAAiB,CAAC,QAAQ,aAAa,aAAa,QAAQ,MAAM;AAG/E,IAAM,UAAU,CAAC,UAA2C,eAAqC,SAAS,KAAe;AACzH,IAAM,UAAU,CAAC,UAAgC,eAAe,QAAQ,KAAK;AAG7E,IAAM,QAAQ;AAAA;AAAA;AAKd,IAAM,UAAU;AAAA;AAAA;AAKhB,IAAM,OAAO,CAAC,MAAc,IAAY,WACtC,UAAU,qCAAqC,IAAI,cAAc,EAAE,0CAA0C,IAAI,YAAY,MAAM,IAAI;AAMzI,IAAM,SAAS,CAAC,MAAc,qCAAqC,CAAC,2BAA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