@atomic-ui/blocks 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +7 -7
  2. package/custom-elements.json +1375 -3
  3. package/dist/{chunk-XHFUTZGU.js → chunk-CC2U2L2H.js} +5 -3
  4. package/dist/{chunk-XHFUTZGU.js.map → chunk-CC2U2L2H.js.map} +1 -1
  5. package/dist/{chunk-MYTYMOH6.js → chunk-CPOCQURG.js} +26 -7
  6. package/dist/chunk-CPOCQURG.js.map +1 -0
  7. package/dist/{chunk-OTOFULMT.js → chunk-FLOKZ7O3.js} +72 -22
  8. package/dist/chunk-FLOKZ7O3.js.map +1 -0
  9. package/dist/{chunk-WHENVU5E.js → chunk-HNCJLMQB.js} +41 -15
  10. package/dist/chunk-HNCJLMQB.js.map +1 -0
  11. package/dist/{chunk-4JW2CHWS.js → chunk-NLHFBIGQ.js} +67 -21
  12. package/dist/chunk-NLHFBIGQ.js.map +1 -0
  13. package/dist/{chunk-AFN7IAG2.js → chunk-OR4U4UJQ.js} +70 -24
  14. package/dist/chunk-OR4U4UJQ.js.map +1 -0
  15. package/dist/{chunk-T7U4OPTW.js → chunk-PALYJCLC.js} +37 -12
  16. package/dist/chunk-PALYJCLC.js.map +1 -0
  17. package/dist/chunk-PTQDYIC5.js +447 -0
  18. package/dist/chunk-PTQDYIC5.js.map +1 -0
  19. package/dist/{chunk-XJMKAK2I.js → chunk-TT2PTEQO.js} +72 -26
  20. package/dist/chunk-TT2PTEQO.js.map +1 -0
  21. package/dist/{chunk-PORKVHAX.js → chunk-UVHQY3QJ.js} +1 -1
  22. package/dist/{chunk-PORKVHAX.js.map → chunk-UVHQY3QJ.js.map} +1 -1
  23. package/dist/{chunk-F4BTXUYP.js → chunk-YC6KXE6O.js} +12 -5
  24. package/dist/chunk-YC6KXE6O.js.map +1 -0
  25. package/dist/chunk-YMSFOS3H.js +142 -0
  26. package/dist/chunk-YMSFOS3H.js.map +1 -0
  27. package/dist/components/card-grid.js +1 -1
  28. package/dist/components/changelog.js +2 -2
  29. package/dist/components/estimator.js +1 -1
  30. package/dist/components/journey.d.ts +106 -0
  31. package/dist/components/journey.js +9 -0
  32. package/dist/components/journey.js.map +1 -0
  33. package/dist/components/marketing.js +1 -1
  34. package/dist/components/organisms.js +1 -1
  35. package/dist/components/property.js +1 -1
  36. package/dist/components/scene.js +1 -1
  37. package/dist/components/scrubber.js +1 -1
  38. package/dist/components/selling.js +1 -1
  39. package/dist/components/site.d.ts +11 -0
  40. package/dist/components/site.js +1 -1
  41. package/dist/components/studio.d.ts +430 -0
  42. package/dist/components/studio.js +19 -0
  43. package/dist/components/studio.js.map +1 -0
  44. package/dist/index.d.ts +8 -6
  45. package/dist/index.js +34 -12
  46. package/dist/index.js.map +1 -1
  47. package/dist/standalone/atomic-ui-blocks.js +893 -677
  48. package/dist/standalone/atomic-ui-blocks.js.map +4 -4
  49. package/dist/standalone/index.html +85 -63
  50. package/package.json +3 -3
  51. package/scripts/copy-to-product.mjs +8 -7
  52. package/specimen/index.html +85 -63
  53. package/dist/chunk-4JW2CHWS.js.map +0 -1
  54. package/dist/chunk-AFN7IAG2.js.map +0 -1
  55. package/dist/chunk-F4BTXUYP.js.map +0 -1
  56. package/dist/chunk-MYTYMOH6.js.map +0 -1
  57. package/dist/chunk-OTOFULMT.js.map +0 -1
  58. package/dist/chunk-T7U4OPTW.js.map +0 -1
  59. package/dist/chunk-WHENVU5E.js.map +0 -1
  60. package/dist/chunk-XJMKAK2I.js.map +0 -1
@@ -0,0 +1,142 @@
1
+ // packages/blocks/src/components/journey.ts
2
+ import { css, html, nothing } from "lit";
3
+ import { ImpaktElement, focusRing, fontSize, fontWeight, space, t, token } from "@atomic-ui/ui";
4
+ var JOURNEY_STAGES = ["note", "wireframe", "component", "code", "live"];
5
+ var isStage = (value) => JOURNEY_STAGES.includes(value);
6
+ var arrow = html`<svg class="arrow" viewBox="0 0 20 12" width="20" height="12" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" focusable="false">
7
+ <path d="M0 6h18M13 1l5 5-5 5" />
8
+ </svg>`;
9
+ var ImpaktJourneyButton = class extends ImpaktElement {
10
+ static {
11
+ this.properties = {
12
+ stage: { type: String, reflect: true },
13
+ label: { type: String },
14
+ href: { type: String },
15
+ decorative: { type: Boolean, reflect: true },
16
+ track: { type: String },
17
+ code: { type: Array }
18
+ };
19
+ }
20
+ constructor() {
21
+ super();
22
+ this.stage = "live";
23
+ this.label = "";
24
+ this.href = "";
25
+ this.decorative = false;
26
+ this.track = "";
27
+ this.code = {};
28
+ }
29
+ static {
30
+ this.styles = [
31
+ ...ImpaktElement.styles,
32
+ focusRing,
33
+ css`
34
+ :host { display: block; inline-size: min(100%, 26rem); --impakt-journey-accent: ${token("color.accent.default", "#e2cc40")}; --impakt-journey-on-accent: ${token("color.accent.on", "#1a1a1a")}; --impakt-journey-ease: cubic-bezier(0.65, 0, 0.35, 1); --impakt-journey-time: 600ms; }
35
+ .frame { position: relative; block-size: 15rem; }
36
+ /* Each plate is one stage's shape. Only its opacity and transform ever change. */
37
+ .plate { position: absolute; box-sizing: border-box; opacity: 0; pointer-events: none; transition: opacity var(--impakt-journey-time) var(--impakt-journey-ease), transform var(--impakt-journey-time) var(--impakt-journey-ease); }
38
+ .bar { inset-inline: 0; inset-block-start: calc(50% - 3rem); block-size: 6rem; }
39
+ .note { inset-inline-start: 12%; inset-block-start: 0.5rem; inline-size: min(14rem, 80%); block-size: 14rem; background: var(--impakt-journey-accent); box-shadow: 0 1.1rem 2.2rem rgb(0 0 0 / 0.18); transform: rotate(-4deg); }
40
+ .wire { background: ${t.surfaceCard}; border: ${t.borderThin} dashed ${t.textMuted}; }
41
+ .wire svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; color: ${t.rule}; }
42
+ .solid { background: var(--impakt-journey-accent); }
43
+ .shadow { box-shadow: 0 0.9rem 1.75rem rgb(0 0 0 / 0.22); }
44
+ .window { inset: 0; padding: ${space(5)}; background: ${t.text}; border-radius: ${t.radius}; font-family: ${t.fontMono}; font-size: ${fontSize("sm")}; line-height: 1.6; color: color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text}); white-space: pre; overflow: hidden; display: grid; grid-template-rows: 1fr 44px 1fr; }
45
+ .window .before { align-self: end; display: flex; flex-direction: column; }
46
+ .window .after { align-self: start; display: flex; flex-direction: column; }
47
+ .window .rule { display: block; block-size: 0.5em; margin-block: 0.55em; background: currentColor; opacity: 0.35; }
48
+ /* A measuring line above the bar, with a tick at each end. */
49
+ .marks { inset-inline: 0; inset-block-start: calc(50% - 4.5rem); block-size: 0.75rem; border-inline: 1.5px solid ${t.text}; }
50
+ .marks::before { content: ''; position: absolute; inset-inline: 0; inset-block-start: calc(50% - 0.75px); border-block-start: 1.5px solid ${t.text}; }
51
+
52
+ /* A stage that has passed shrinks toward the next shape as it fades; one still to come starts from the last. */
53
+ /* The note flattens without growing wider, so a shape that is not showing never reaches past the block (1.4.10). */
54
+ :host(:not([stage='note'])) .note { transform: rotate(0deg) scale(1, 0.45); }
55
+ :host([stage='note']) .wire { transform: rotate(-4deg) scale(0.6, 1.9); }
56
+ :host(:not([stage='code'])) .window { transform: scale(0.94, 0.5); }
57
+ :host([stage='note']) .note, :host([stage='wireframe']) .wire, :host(:is([stage='component'], [stage='live'])) .solid, :host([stage='code']) .window, :host([stage='component']) .marks, :host([stage='live']) .shadow { opacity: 1; }
58
+
59
+ /* The words. One element at every stage: a link, or a picture of one. */
60
+ .words { position: absolute; inset-inline: 0; inset-block-start: calc(50% - 3rem); box-sizing: border-box; min-block-size: 6rem; display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; padding-inline: ${space(8)}; font-family: ${t.fontBody}; font-size: ${fontSize("lg")}; font-weight: ${fontWeight("medium")}; line-height: 1.2; color: var(--impakt-journey-on-accent); text-decoration: none; transition: color var(--impakt-journey-time) var(--impakt-journey-ease), transform 180ms cubic-bezier(0.2, 0, 0, 1); }
61
+ .arrow { flex: none; }
62
+ :host([stage='note']) .words { inset-inline: 12% auto; inset-block-start: 0.5rem; inline-size: min(14rem, 80%); min-block-size: 14rem; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: ${space(6)}; font-size: ${fontSize("2xl")}; font-weight: ${fontWeight("semibold")}; letter-spacing: -0.02em; transform: rotate(-4deg); }
63
+ :host([stage='note']) .arrow { align-self: flex-end; }
64
+ :host([stage='wireframe']) .words { justify-content: center; font-family: ${t.fontMono}; font-size: ${fontSize("sm")}; font-weight: ${fontWeight("regular")}; color: ${t.textMuted}; }
65
+ :host([stage='code']) .words { inset-inline: ${space(5)}; justify-content: flex-start; min-block-size: 44px; inset-block-start: calc(50% - 22px); padding-inline: 3ch 0; font-family: ${t.fontMono}; font-size: ${fontSize("sm")}; font-weight: ${fontWeight("regular")}; color: var(--impakt-journey-code-words, ${t.surfaceCard}); }
66
+ /* Live, it answers a pointer: it lifts when pointed at and sits when pressed. */
67
+ :host([stage='live']) a.words:hover { transform: translateY(-2px); }
68
+ :host([stage='live']) a.words:active { transform: translateY(1px); }
69
+ a.words:focus-visible { outline: none; box-shadow: ${t.focusShadow}; }
70
+ @media (prefers-reduced-motion: reduce) { .plate, .words { transition: none; } :host([stage='live']) a.words:hover, :host([stage='live']) a.words:active { transform: none; } }
71
+ @media (forced-colors: active) {
72
+ .plate { forced-color-adjust: none; }
73
+ .note, .solid { background: Highlight; }
74
+ .marks, .marks::before { border-color: CanvasText; }
75
+ .window { background: Canvas; border: 1px solid CanvasText; color: CanvasText; }
76
+ .wire { background: Canvas; border-color: CanvasText; }
77
+ .words, :host([stage='wireframe']) .words, :host([stage='code']) .words { color: LinkText; forced-color-adjust: none; }
78
+ :host(:is([stage='note'], [stage='component'], [stage='live'])) .words { color: HighlightText; }
79
+ }
80
+ `
81
+ ];
82
+ }
83
+ connectedCallback() {
84
+ super.connectedCallback();
85
+ if (this.hasUpdated) this.watch();
86
+ }
87
+ disconnectedCallback() {
88
+ super.disconnectedCallback();
89
+ this.observer?.disconnect();
90
+ this.observer = void 0;
91
+ }
92
+ willUpdate(changed) {
93
+ if (changed.has("stage") && !isStage(this.stage)) this.stage = "live";
94
+ }
95
+ updated(changed) {
96
+ if (changed.has("track")) this.watch();
97
+ }
98
+ /** Follow the sections named by `track`: the one across the middle of the screen sets the stage. */
99
+ watch() {
100
+ this.observer?.disconnect();
101
+ this.observer = void 0;
102
+ if (!this.track || !this.isConnected || typeof IntersectionObserver !== "function") return;
103
+ let sections;
104
+ try {
105
+ sections = Array.from(this.ownerDocument.querySelectorAll(this.track)).filter((el) => isStage(el.getAttribute("data-journey-stage")));
106
+ } catch {
107
+ return;
108
+ }
109
+ if (!sections.length) return;
110
+ this.observer = new IntersectionObserver((entries) => this.crossed(entries), { rootMargin: "-50% 0px -50% 0px", threshold: 0 });
111
+ for (const section of sections) this.observer.observe(section);
112
+ }
113
+ crossed(entries) {
114
+ const entry = entries.find((e) => e.isIntersecting);
115
+ const stage = entry?.target.getAttribute("data-journey-stage");
116
+ if (!isStage(stage) || stage === this.stage) return;
117
+ this.stage = stage;
118
+ this.dispatchEvent(new CustomEvent("impakt-journey-stage", { detail: { stage }, bubbles: true, composed: true }));
119
+ }
120
+ lines(lines, fallback) {
121
+ return lines?.length ? lines.map((line) => html`<span>${line}</span>`) : Array.from({ length: fallback }, (_, i) => html`<span class="rule" style=${`inline-size:${[58, 72, 44][i % 3]}%`}></span>`);
122
+ }
123
+ render() {
124
+ const words = html`<span>${this.label}</span>${arrow}`;
125
+ return html`<div class="frame" part="frame" aria-hidden=${this.decorative ? "true" : nothing}>
126
+ <span class="plate note" aria-hidden="true"></span>
127
+ <span class="plate bar wire" aria-hidden="true"><svg viewBox="0 0 100 100" preserveAspectRatio="none" fill="none" stroke="currentColor" focusable="false"><path d="M0 0 100 100M0 100 100 0" vector-effect="non-scaling-stroke" /></svg></span>
128
+ <span class="plate bar shadow" aria-hidden="true"></span>
129
+ <span class="plate bar solid" aria-hidden="true"></span>
130
+ <span class="plate window" aria-hidden="true"><span class="before">${this.lines(this.code?.before, 3)}</span><span></span><span class="after">${this.lines(this.code?.after, 2)}</span></span>
131
+ <span class="plate marks" aria-hidden="true"></span>
132
+ ${this.decorative || !this.href ? html`<span class="words" part="button">${words}</span>` : html`<a class="words" part="button" href=${this.href}>${words}</a>`}
133
+ </div>`;
134
+ }
135
+ };
136
+ customElements.define("impakt-journey-button", ImpaktJourneyButton);
137
+
138
+ export {
139
+ JOURNEY_STAGES,
140
+ ImpaktJourneyButton
141
+ };
142
+ //# sourceMappingURL=chunk-YMSFOS3H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/journey.ts"],"sourcesContent":["/**\n * The journey button: a site's one call to action, drawn at the stage a\n * section of the page is about.\n */\nimport { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement, focusRing, fontSize, fontWeight, space, t, token } from '@atomic-ui/ui';\n\n/** The stages a button passes through on its way to being live, in order. */\nexport const JOURNEY_STAGES = ['note', 'wireframe', 'component', 'code', 'live'] as const;\nexport type JourneyStage = (typeof JOURNEY_STAGES)[number];\n\nconst isStage = (value: unknown): value is JourneyStage => (JOURNEY_STAGES as readonly string[]).includes(value as string);\n\n/** The arrow after the words. Drawn, so no font has to hold the glyph. */\nconst arrow = html`<svg class=\"arrow\" viewBox=\"0 0 20 12\" width=\"20\" height=\"12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M0 6h18M13 1l5 5-5 5\" />\n</svg>`;\n\n/**\n * A call to action drawn as the thing it once was: a sticky note from a\n * workshop, a wireframe box, a designed component, the code that renders it,\n * and at last the live button. A page shows it at the stage each section is\n * about, so the same button is seen being made as the page is read.\n *\n * **It is the same link at every stage.** Whatever it is drawn as, it is one\n * `<a>` whose name is its words, so a screen reader and a keyboard meet an\n * ordinary link; the note, the wireframe cross, the measuring marks and the\n * lines of code around it are decoration and are hidden (1.3.1, 4.1.2). Its\n * target is at least 44px tall at every stage (2.5.8).\n *\n * **A page that shows it more than once sets `decorative` on the copies.** A\n * decorative one is a picture of the button, not a control: it has no link\n * and is hidden from a screen reader, so the page does not hold five links\n * that say the same thing (2.4.4).\n *\n * **One button can follow the page.** Give `track` a selector for the page's\n * sections, each carrying `data-journey-stage`, and the button takes the stage\n * of whichever section is across the middle of the screen. It watches with an\n * IntersectionObserver, so nothing runs while the page scrolls.\n *\n * **Only transforms, opacity and colour move**, so a change of stage costs no\n * layout. With reduced motion asked for, a stage cuts straight to the next\n * (2.3.3). The words on every fill are a pair the tokens already measured:\n * the accent with its own text colour, and the text colour with the card\n * colour (1.4.3). A brand whose ink is dark may colour the words in the code\n * window by setting `--impakt-journey-code-words`.\n *\n * @category action\n * @icon button\n * @fires {CustomEvent<{ stage: JourneyStage }>} impakt-journey-stage - When a tracked button changes stage as the page scrolls.\n */\nexport class ImpaktJourneyButton extends ImpaktElement {\n static properties = {\n stage: { type: String, reflect: true },\n label: { type: String },\n href: { type: String },\n decorative: { type: Boolean, reflect: true },\n track: { type: String },\n code: { type: Array },\n };\n /** What the button is drawn as. */\n declare stage: JourneyStage;\n /** The button's words, such as \"Book a 30-minute call\". */\n declare label: string;\n /** Where the button goes. */\n declare href: string;\n /** Draw it as a picture only, with no link, for a page that already has the real button. */\n declare decorative: boolean;\n /**\n * A selector for the sections of the page that each carry\n * `data-journey-stage`. The button then takes the stage of the section\n * across the middle of the screen. Leave empty to set `stage` by hand.\n */\n declare track: string;\n /**\n * Lines of code drawn around the words at the `code` stage, split where the\n * words go: the lines before, then the lines after. They are decoration and\n * are not read. Left empty, plain bars are drawn instead.\n */\n declare code: { before?: string[]; after?: string[] };\n\n constructor() {\n super();\n this.stage = 'live';\n this.label = '';\n this.href = '';\n this.decorative = false;\n this.track = '';\n this.code = {};\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host { display: block; inline-size: min(100%, 26rem); --impakt-journey-accent: ${token('color.accent.default', '#e2cc40')}; --impakt-journey-on-accent: ${token('color.accent.on', '#1a1a1a')}; --impakt-journey-ease: cubic-bezier(0.65, 0, 0.35, 1); --impakt-journey-time: 600ms; }\n .frame { position: relative; block-size: 15rem; }\n /* Each plate is one stage's shape. Only its opacity and transform ever change. */\n .plate { position: absolute; box-sizing: border-box; opacity: 0; pointer-events: none; transition: opacity var(--impakt-journey-time) var(--impakt-journey-ease), transform var(--impakt-journey-time) var(--impakt-journey-ease); }\n .bar { inset-inline: 0; inset-block-start: calc(50% - 3rem); block-size: 6rem; }\n .note { inset-inline-start: 12%; inset-block-start: 0.5rem; inline-size: min(14rem, 80%); block-size: 14rem; background: var(--impakt-journey-accent); box-shadow: 0 1.1rem 2.2rem rgb(0 0 0 / 0.18); transform: rotate(-4deg); }\n .wire { background: ${t.surfaceCard}; border: ${t.borderThin} dashed ${t.textMuted}; }\n .wire svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; color: ${t.rule}; }\n .solid { background: var(--impakt-journey-accent); }\n .shadow { box-shadow: 0 0.9rem 1.75rem rgb(0 0 0 / 0.22); }\n .window { inset: 0; padding: ${space(5)}; background: ${t.text}; border-radius: ${t.radius}; font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; line-height: 1.6; color: color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text}); white-space: pre; overflow: hidden; display: grid; grid-template-rows: 1fr 44px 1fr; }\n .window .before { align-self: end; display: flex; flex-direction: column; }\n .window .after { align-self: start; display: flex; flex-direction: column; }\n .window .rule { display: block; block-size: 0.5em; margin-block: 0.55em; background: currentColor; opacity: 0.35; }\n /* A measuring line above the bar, with a tick at each end. */\n .marks { inset-inline: 0; inset-block-start: calc(50% - 4.5rem); block-size: 0.75rem; border-inline: 1.5px solid ${t.text}; }\n .marks::before { content: ''; position: absolute; inset-inline: 0; inset-block-start: calc(50% - 0.75px); border-block-start: 1.5px solid ${t.text}; }\n\n /* A stage that has passed shrinks toward the next shape as it fades; one still to come starts from the last. */\n /* The note flattens without growing wider, so a shape that is not showing never reaches past the block (1.4.10). */\n :host(:not([stage='note'])) .note { transform: rotate(0deg) scale(1, 0.45); }\n :host([stage='note']) .wire { transform: rotate(-4deg) scale(0.6, 1.9); }\n :host(:not([stage='code'])) .window { transform: scale(0.94, 0.5); }\n :host([stage='note']) .note, :host([stage='wireframe']) .wire, :host(:is([stage='component'], [stage='live'])) .solid, :host([stage='code']) .window, :host([stage='component']) .marks, :host([stage='live']) .shadow { opacity: 1; }\n\n /* The words. One element at every stage: a link, or a picture of one. */\n .words { position: absolute; inset-inline: 0; inset-block-start: calc(50% - 3rem); box-sizing: border-box; min-block-size: 6rem; display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; padding-inline: ${space(8)}; font-family: ${t.fontBody}; font-size: ${fontSize('lg')}; font-weight: ${fontWeight('medium')}; line-height: 1.2; color: var(--impakt-journey-on-accent); text-decoration: none; transition: color var(--impakt-journey-time) var(--impakt-journey-ease), transform 180ms cubic-bezier(0.2, 0, 0, 1); }\n .arrow { flex: none; }\n :host([stage='note']) .words { inset-inline: 12% auto; inset-block-start: 0.5rem; inline-size: min(14rem, 80%); min-block-size: 14rem; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: ${space(6)}; font-size: ${fontSize('2xl')}; font-weight: ${fontWeight('semibold')}; letter-spacing: -0.02em; transform: rotate(-4deg); }\n :host([stage='note']) .arrow { align-self: flex-end; }\n :host([stage='wireframe']) .words { justify-content: center; font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('regular')}; color: ${t.textMuted}; }\n :host([stage='code']) .words { inset-inline: ${space(5)}; justify-content: flex-start; min-block-size: 44px; inset-block-start: calc(50% - 22px); padding-inline: 3ch 0; font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('regular')}; color: var(--impakt-journey-code-words, ${t.surfaceCard}); }\n /* Live, it answers a pointer: it lifts when pointed at and sits when pressed. */\n :host([stage='live']) a.words:hover { transform: translateY(-2px); }\n :host([stage='live']) a.words:active { transform: translateY(1px); }\n a.words:focus-visible { outline: none; box-shadow: ${t.focusShadow}; }\n @media (prefers-reduced-motion: reduce) { .plate, .words { transition: none; } :host([stage='live']) a.words:hover, :host([stage='live']) a.words:active { transform: none; } }\n @media (forced-colors: active) {\n .plate { forced-color-adjust: none; }\n .note, .solid { background: Highlight; }\n .marks, .marks::before { border-color: CanvasText; }\n .window { background: Canvas; border: 1px solid CanvasText; color: CanvasText; }\n .wire { background: Canvas; border-color: CanvasText; }\n .words, :host([stage='wireframe']) .words, :host([stage='code']) .words { color: LinkText; forced-color-adjust: none; }\n :host(:is([stage='note'], [stage='component'], [stage='live'])) .words { color: HighlightText; }\n }\n `,\n ];\n\n private observer?: IntersectionObserver;\n\n connectedCallback(): void {\n super.connectedCallback();\n // The first render starts the watch; this is for a button taken off the page and put back.\n if (this.hasUpdated) this.watch();\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.observer = undefined;\n }\n\n protected willUpdate(changed: Map<string, unknown>): void {\n // A stage that is not one of the five would draw nothing at all, so it falls back to the finished button.\n if (changed.has('stage') && !isStage(this.stage)) this.stage = 'live';\n }\n\n protected updated(changed: Map<string, unknown>): void {\n if (changed.has('track')) this.watch();\n }\n\n /** Follow the sections named by `track`: the one across the middle of the screen sets the stage. */\n private watch(): void {\n this.observer?.disconnect();\n this.observer = undefined;\n if (!this.track || !this.isConnected || typeof IntersectionObserver !== 'function') return;\n let sections: Element[];\n try {\n sections = Array.from(this.ownerDocument.querySelectorAll(this.track)).filter((el) => isStage(el.getAttribute('data-journey-stage')));\n } catch {\n // Not a selector: nothing to follow.\n return;\n }\n if (!sections.length) return;\n // A line across the middle of the screen. A section is \"current\" while it crosses that line.\n this.observer = new IntersectionObserver((entries) => this.crossed(entries), { rootMargin: '-50% 0px -50% 0px', threshold: 0 });\n for (const section of sections) this.observer.observe(section);\n }\n\n private crossed(entries: IntersectionObserverEntry[]): void {\n const entry = entries.find((e) => e.isIntersecting);\n const stage = entry?.target.getAttribute('data-journey-stage');\n if (!isStage(stage) || stage === this.stage) return;\n this.stage = stage;\n this.dispatchEvent(new CustomEvent('impakt-journey-stage', { detail: { stage }, bubbles: true, composed: true }));\n }\n\n private lines(lines: string[] | undefined, fallback: number): TemplateResult[] {\n return lines?.length\n ? lines.map((line) => html`<span>${line}</span>`)\n : Array.from({ length: fallback }, (_, i) => html`<span class=\"rule\" style=${`inline-size:${[58, 72, 44][i % 3]}%`}></span>`);\n }\n\n render(): TemplateResult {\n const words = html`<span>${this.label}</span>${arrow}`;\n return html`<div class=\"frame\" part=\"frame\" aria-hidden=${this.decorative ? 'true' : nothing}>\n <span class=\"plate note\" aria-hidden=\"true\"></span>\n <span class=\"plate bar wire\" aria-hidden=\"true\"><svg viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" fill=\"none\" stroke=\"currentColor\" focusable=\"false\"><path d=\"M0 0 100 100M0 100 100 0\" vector-effect=\"non-scaling-stroke\" /></svg></span>\n <span class=\"plate bar shadow\" aria-hidden=\"true\"></span>\n <span class=\"plate bar solid\" aria-hidden=\"true\"></span>\n <span class=\"plate window\" aria-hidden=\"true\"><span class=\"before\">${this.lines(this.code?.before, 3)}</span><span></span><span class=\"after\">${this.lines(this.code?.after, 2)}</span></span>\n <span class=\"plate marks\" aria-hidden=\"true\"></span>\n ${this.decorative || !this.href ? html`<span class=\"words\" part=\"button\">${words}</span>` : html`<a class=\"words\" part=\"button\" href=${this.href}>${words}</a>`}\n </div>`;\n }\n}\n\ncustomElements.define('impakt-journey-button', ImpaktJourneyButton);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-journey-button': ImpaktJourneyButton;\n }\n}\n"],"mappings":";AAIA,SAAS,KAAK,MAAM,eAAoC;AACxD,SAAS,eAAe,WAAW,UAAU,YAAY,OAAO,GAAG,aAAa;AAGzE,IAAM,iBAAiB,CAAC,QAAQ,aAAa,aAAa,QAAQ,MAAM;AAG/E,IAAM,UAAU,CAAC,UAA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unk-YC6KXE6O.js";
4
4
  export {
5
5
  ImpaktCardGrid
6
6
  };
@@ -4,8 +4,8 @@ import {
4
4
  ImpaktCheckList,
5
5
  ImpaktReleaseCard,
6
6
  ImpaktReleaseList
7
- } from "../chunk-OTOFULMT.js";
8
- import "../chunk-T7U4OPTW.js";
7
+ } from "../chunk-FLOKZ7O3.js";
8
+ import "../chunk-PALYJCLC.js";
9
9
  export {
10
10
  ImpaktBranchList,
11
11
  ImpaktBranchTimeline,
@@ -2,7 +2,7 @@ import {
2
2
  ImpaktEstimator,
3
3
  estimate,
4
4
  phaseWeeks
5
- } from "../chunk-AFN7IAG2.js";
5
+ } from "../chunk-OR4U4UJQ.js";
6
6
  export {
7
7
  ImpaktEstimator,
8
8
  estimate,
@@ -0,0 +1,106 @@
1
+ /**
2
+ * The journey button: a site's one call to action, drawn at the stage a
3
+ * section of the page is about.
4
+ */
5
+ import { type TemplateResult } from 'lit';
6
+ import { ImpaktElement } from '@atomic-ui/ui';
7
+ /** The stages a button passes through on its way to being live, in order. */
8
+ export declare const JOURNEY_STAGES: readonly ["note", "wireframe", "component", "code", "live"];
9
+ export type JourneyStage = (typeof JOURNEY_STAGES)[number];
10
+ /**
11
+ * A call to action drawn as the thing it once was: a sticky note from a
12
+ * workshop, a wireframe box, a designed component, the code that renders it,
13
+ * and at last the live button. A page shows it at the stage each section is
14
+ * about, so the same button is seen being made as the page is read.
15
+ *
16
+ * **It is the same link at every stage.** Whatever it is drawn as, it is one
17
+ * `<a>` whose name is its words, so a screen reader and a keyboard meet an
18
+ * ordinary link; the note, the wireframe cross, the measuring marks and the
19
+ * lines of code around it are decoration and are hidden (1.3.1, 4.1.2). Its
20
+ * target is at least 44px tall at every stage (2.5.8).
21
+ *
22
+ * **A page that shows it more than once sets `decorative` on the copies.** A
23
+ * decorative one is a picture of the button, not a control: it has no link
24
+ * and is hidden from a screen reader, so the page does not hold five links
25
+ * that say the same thing (2.4.4).
26
+ *
27
+ * **One button can follow the page.** Give `track` a selector for the page's
28
+ * sections, each carrying `data-journey-stage`, and the button takes the stage
29
+ * of whichever section is across the middle of the screen. It watches with an
30
+ * IntersectionObserver, so nothing runs while the page scrolls.
31
+ *
32
+ * **Only transforms, opacity and colour move**, so a change of stage costs no
33
+ * layout. With reduced motion asked for, a stage cuts straight to the next
34
+ * (2.3.3). The words on every fill are a pair the tokens already measured:
35
+ * the accent with its own text colour, and the text colour with the card
36
+ * colour (1.4.3). A brand whose ink is dark may colour the words in the code
37
+ * window by setting `--impakt-journey-code-words`.
38
+ *
39
+ * @category action
40
+ * @icon button
41
+ * @fires {CustomEvent<{ stage: JourneyStage }>} impakt-journey-stage - When a tracked button changes stage as the page scrolls.
42
+ */
43
+ export declare class ImpaktJourneyButton extends ImpaktElement {
44
+ static properties: {
45
+ stage: {
46
+ type: StringConstructor;
47
+ reflect: boolean;
48
+ };
49
+ label: {
50
+ type: StringConstructor;
51
+ };
52
+ href: {
53
+ type: StringConstructor;
54
+ };
55
+ decorative: {
56
+ type: BooleanConstructor;
57
+ reflect: boolean;
58
+ };
59
+ track: {
60
+ type: StringConstructor;
61
+ };
62
+ code: {
63
+ type: ArrayConstructor;
64
+ };
65
+ };
66
+ /** What the button is drawn as. */
67
+ stage: JourneyStage;
68
+ /** The button's words, such as "Book a 30-minute call". */
69
+ label: string;
70
+ /** Where the button goes. */
71
+ href: string;
72
+ /** Draw it as a picture only, with no link, for a page that already has the real button. */
73
+ decorative: boolean;
74
+ /**
75
+ * A selector for the sections of the page that each carry
76
+ * `data-journey-stage`. The button then takes the stage of the section
77
+ * across the middle of the screen. Leave empty to set `stage` by hand.
78
+ */
79
+ track: string;
80
+ /**
81
+ * Lines of code drawn around the words at the `code` stage, split where the
82
+ * words go: the lines before, then the lines after. They are decoration and
83
+ * are not read. Left empty, plain bars are drawn instead.
84
+ */
85
+ code: {
86
+ before?: string[];
87
+ after?: string[];
88
+ };
89
+ constructor();
90
+ static styles: import("lit").CSSResult[];
91
+ private observer?;
92
+ connectedCallback(): void;
93
+ disconnectedCallback(): void;
94
+ protected willUpdate(changed: Map<string, unknown>): void;
95
+ protected updated(changed: Map<string, unknown>): void;
96
+ /** Follow the sections named by `track`: the one across the middle of the screen sets the stage. */
97
+ private watch;
98
+ private crossed;
99
+ private lines;
100
+ render(): TemplateResult;
101
+ }
102
+ declare global {
103
+ interface HTMLElementTagNameMap {
104
+ 'impakt-journey-button': ImpaktJourneyButton;
105
+ }
106
+ }
@@ -0,0 +1,9 @@
1
+ import {
2
+ ImpaktJourneyButton,
3
+ JOURNEY_STAGES
4
+ } from "../chunk-YMSFOS3H.js";
5
+ export {
6
+ ImpaktJourneyButton,
7
+ JOURNEY_STAGES
8
+ };
9
+ //# sourceMappingURL=journey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -5,7 +5,7 @@ import {
5
5
  ImpaktQuote,
6
6
  ImpaktSearchBar,
7
7
  ImpaktStat
8
- } from "../chunk-WHENVU5E.js";
8
+ } from "../chunk-HNCJLMQB.js";
9
9
  export {
10
10
  ImpaktAnnouncement,
11
11
  ImpaktFeatureList,
@@ -8,7 +8,7 @@ import {
8
8
  ImpaktReviews,
9
9
  ImpaktSteps,
10
10
  gallerySpan
11
- } from "../chunk-4JW2CHWS.js";
11
+ } from "../chunk-NLHFBIGQ.js";
12
12
  export {
13
13
  ImpaktCarousel,
14
14
  ImpaktCtaBanner,
@@ -5,7 +5,7 @@ import {
5
5
  ImpaktSitePlan,
6
6
  ImpaktStickyBar,
7
7
  monthlyPayment
8
- } from "../chunk-T7U4OPTW.js";
8
+ } from "../chunk-PALYJCLC.js";
9
9
  export {
10
10
  ImpaktBeforeAfter,
11
11
  ImpaktLocationCard,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ImpaktScene
3
- } from "../chunk-PORKVHAX.js";
3
+ } from "../chunk-UVHQY3QJ.js";
4
4
  export {
5
5
  ImpaktScene
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ImpaktScrubber
3
- } from "../chunk-XHFUTZGU.js";
3
+ } from "../chunk-CC2U2L2H.js";
4
4
  export {
5
5
  ImpaktScrubber
6
6
  };
@@ -8,7 +8,7 @@ import {
8
8
  SDLT,
9
9
  embedOf,
10
10
  stampDuty
11
- } from "../chunk-XJMKAK2I.js";
11
+ } from "../chunk-TT2PTEQO.js";
12
12
  export {
13
13
  ImpaktAffordabilityCalculator,
14
14
  ImpaktContactBlock,
@@ -185,6 +185,11 @@ export declare class ImpaktSiteFooter extends ImpaktElement {
185
185
  brand: {
186
186
  type: StringConstructor;
187
187
  };
188
+ brandSize: {
189
+ type: StringConstructor;
190
+ reflect: boolean;
191
+ attribute: string;
192
+ };
188
193
  log: {
189
194
  type: ArrayConstructor;
190
195
  };
@@ -210,6 +215,12 @@ export declare class ImpaktSiteFooter extends ImpaktElement {
210
215
  };
211
216
  /** The site's name, set large. */
212
217
  brand: string;
218
+ /**
219
+ * How large the name is set. `display` runs it the full width of the footer,
220
+ * under the columns, sized by the footer's own width so it never spills at
221
+ * 320px.
222
+ */
223
+ brandSize: 'lg' | 'display';
213
224
  /** Lines set in code type under the brand, newest first. The first is bright. */
214
225
  log: FooterLogLine[];
215
226
  columns: FooterColumn[];
@@ -2,7 +2,7 @@ import {
2
2
  ImpaktSiteFooter,
3
3
  ImpaktSiteHeader,
4
4
  ImpaktWordmark
5
- } from "../chunk-MYTYMOH6.js";
5
+ } from "../chunk-CPOCQURG.js";
6
6
  export {
7
7
  ImpaktSiteFooter,
8
8
  ImpaktSiteHeader,