@atomic-ui/blocks 0.0.0-stage → 0.6.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 (61) hide show
  1. package/README.md +77 -2
  2. package/custom-elements.json +8688 -0
  3. package/dist/chunk-4JW2CHWS.js +708 -0
  4. package/dist/chunk-4JW2CHWS.js.map +1 -0
  5. package/dist/chunk-AFN7IAG2.js +379 -0
  6. package/dist/chunk-AFN7IAG2.js.map +1 -0
  7. package/dist/chunk-F4BTXUYP.js +65 -0
  8. package/dist/chunk-F4BTXUYP.js.map +1 -0
  9. package/dist/chunk-MYTYMOH6.js +193 -0
  10. package/dist/chunk-MYTYMOH6.js.map +1 -0
  11. package/dist/chunk-OTOFULMT.js +465 -0
  12. package/dist/chunk-OTOFULMT.js.map +1 -0
  13. package/dist/chunk-PORKVHAX.js +255 -0
  14. package/dist/chunk-PORKVHAX.js.map +1 -0
  15. package/dist/chunk-T7U4OPTW.js +413 -0
  16. package/dist/chunk-T7U4OPTW.js.map +1 -0
  17. package/dist/chunk-WHENVU5E.js +318 -0
  18. package/dist/chunk-WHENVU5E.js.map +1 -0
  19. package/dist/chunk-XHFUTZGU.js +228 -0
  20. package/dist/chunk-XHFUTZGU.js.map +1 -0
  21. package/dist/chunk-XJMKAK2I.js +442 -0
  22. package/dist/chunk-XJMKAK2I.js.map +1 -0
  23. package/dist/components/card-grid.d.ts +72 -0
  24. package/dist/components/card-grid.js +7 -0
  25. package/dist/components/card-grid.js.map +1 -0
  26. package/dist/components/changelog.d.ts +373 -0
  27. package/dist/components/changelog.js +16 -0
  28. package/dist/components/changelog.js.map +1 -0
  29. package/dist/components/estimator.d.ts +246 -0
  30. package/dist/components/estimator.js +11 -0
  31. package/dist/components/estimator.js.map +1 -0
  32. package/dist/components/marketing.d.ts +342 -0
  33. package/dist/components/marketing.js +17 -0
  34. package/dist/components/marketing.js.map +1 -0
  35. package/dist/components/organisms.d.ts +559 -0
  36. package/dist/components/organisms.js +23 -0
  37. package/dist/components/organisms.js.map +1 -0
  38. package/dist/components/property.d.ts +389 -0
  39. package/dist/components/property.js +17 -0
  40. package/dist/components/property.js.map +1 -0
  41. package/dist/components/scene.d.ts +138 -0
  42. package/dist/components/scene.js +7 -0
  43. package/dist/components/scene.js.map +1 -0
  44. package/dist/components/scrubber.d.ts +86 -0
  45. package/dist/components/scrubber.js +7 -0
  46. package/dist/components/scrubber.js.map +1 -0
  47. package/dist/components/selling.d.ts +409 -0
  48. package/dist/components/selling.js +23 -0
  49. package/dist/components/selling.js.map +1 -0
  50. package/dist/components/site.d.ts +235 -0
  51. package/dist/components/site.js +11 -0
  52. package/dist/components/site.js.map +1 -0
  53. package/dist/index.d.ts +21 -0
  54. package/dist/index.js +114 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/standalone/atomic-ui-blocks.js +1229 -0
  57. package/dist/standalone/atomic-ui-blocks.js.map +7 -0
  58. package/dist/standalone/index.html +78 -0
  59. package/package.json +64 -3
  60. package/scripts/copy-to-product.mjs +59 -0
  61. package/specimen/index.html +78 -0
@@ -0,0 +1,318 @@
1
+ // packages/blocks/src/components/marketing.ts
2
+ import { css, html, nothing } from "lit";
3
+ import { ImpaktElement, fontSize, fontWeight, lineHeight, space, spaceAround, t, type, iconSvg } from "@atomic-ui/ui";
4
+ var heading = (level, text, cls) => html`<div class=${cls} role="heading" aria-level=${level}>${text}</div>`;
5
+ var headingStyles = css`
6
+ .h { margin: 0; color: ${t.textHeading}; font-family: ${t.fontHeading}; font-weight: ${fontWeight("bold")}; line-height: ${lineHeight("tight")}; }
7
+ .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; }
8
+ .body { margin: 0; line-height: ${lineHeight("normal")}; max-inline-size: 65ch; }
9
+ `;
10
+ var ImpaktHero = class extends ImpaktElement {
11
+ static {
12
+ this.properties = {
13
+ eyebrow: { type: String },
14
+ heading: { type: String },
15
+ lead: { type: String },
16
+ level: { type: Number, reflect: true },
17
+ imageSrc: { type: String, attribute: "image-src" },
18
+ imageAlt: { type: String, attribute: "image-alt" },
19
+ treatment: { type: String, reflect: true },
20
+ ratingText: { type: String, attribute: "rating-text" },
21
+ eyebrowIcon: { type: String, attribute: "eyebrow-icon" },
22
+ align: { type: String, reflect: true },
23
+ spaceAbove: { type: String, reflect: true, attribute: "space-above" },
24
+ spaceBelow: { type: String, reflect: true, attribute: "space-below" }
25
+ };
26
+ }
27
+ constructor() {
28
+ super();
29
+ this.eyebrow = "";
30
+ this.heading = "";
31
+ this.lead = "";
32
+ this.level = 1;
33
+ this.imageSrc = "";
34
+ this.imageAlt = "";
35
+ this.treatment = "split";
36
+ this.ratingText = "";
37
+ this.eyebrowIcon = "none";
38
+ this.align = "start";
39
+ this.spaceAbove = "none";
40
+ this.spaceBelow = "none";
41
+ }
42
+ static {
43
+ this.styles = [...ImpaktElement.styles, spaceAround, headingStyles, css`
44
+ :host { display: block; container-type: inline-size; }
45
+ .hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: ${space(8)}; align-items: center; }
46
+ .hero.pictured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
47
+ .words { display: flex; flex-direction: column; gap: ${space(4)}; }
48
+ :host([align='center']) .words { align-items: center; text-align: center; margin-inline: auto; max-inline-size: 48rem; }
49
+ .h { ${type("5xl")} letter-spacing: ${t.trackingTight}; text-wrap: balance; }
50
+ .body { ${type("lg")} color: ${t.textMuted}; text-wrap: pretty; }
51
+ @container (max-width: 40rem) { .h { ${type("4xl")} } }
52
+ .actions { display: flex; flex-wrap: wrap; gap: ${space(3)} ${space(4)}; align-items: center; margin-block-start: ${space(2)}; }
53
+ :host([align='center']) .actions { justify-content: center; }
54
+ img { display: block; inline-size: 100%; block-size: auto; border-radius: ${t.radius2xl}; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: ${t.shadowLg}; }
55
+ @container (max-width: 48rem) { .hero.pictured { grid-template-columns: minmax(0, 1fr); } }
56
+ /* Cover: the picture fills the block edge to edge, a scrim keeps the words readable (1.4.3). */
57
+ .cover { position: relative; display: flex; flex-direction: column; justify-content: center; min-block-size: clamp(44rem, 61vw, 55rem); margin-inline: calc(var(--impakt-bleed, 1) * (50% - 50vw)); padding: ${space(32)} max(${space(8)}, calc(var(--impakt-bleed, 1) * (50vw - 50%))) ${space(24)}; overflow: hidden; color: #fff; --impakt-color-text-heading: #fff; }
58
+ .cover img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
59
+ .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(18 31 26 / 0.82) 0%, rgb(18 31 26 / 0.42) 55%, rgb(18 31 26 / 0.05) 100%); }
60
+ .cover .words { position: relative; z-index: 1; max-inline-size: 48rem; }
61
+ .cover .eyebrow { display: inline-flex; align-items: center; gap: ${space(2)}; align-self: flex-start; padding: ${space(2)} ${space(3.5)}; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: 999px; text-transform: none; letter-spacing: 0; }
62
+ .chip-line { position: relative; z-index: 1; block-size: 0; }
63
+ .chip { position: absolute; inset-block-start: ${space(14)}; inset-inline-end: ${space(9)}; display: inline-flex; align-items: center; gap: ${space(2.5)}; padding: ${space(3)} ${space(4.5)}; ${type("sm")} font-weight: ${fontWeight("semibold")}; white-space: nowrap; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: ${t.radiusXl}; }
64
+ .finder { position: relative; z-index: 1; margin-block-start: ${space(12)}; }
65
+ .cover .h { font-size: clamp(3rem, 6.4vw, 5.75rem); line-height: 1; }
66
+ .cover .body { color: rgb(255 255 255 / 0.92); max-inline-size: 40rem; }
67
+ @container (max-width: 64rem) { .chip { display: none; } }
68
+ @container (max-width: 30rem) { .finder { display: none; } }
69
+ @container (max-width: 48rem) { .finder { margin-block-start: ${space(6)}; } .cover { justify-content: flex-end; min-block-size: 43.75rem; padding-block: ${space(32)} ${space(10)}; } .cover::after { background: linear-gradient(180deg, rgb(18 31 26 / 0.1) 0%, rgb(18 31 26 / 0.3) 42%, rgb(18 31 26 / 0.86) 100%); } .cover .h { font-size: 3rem; } }
70
+ `];
71
+ }
72
+ render() {
73
+ if (this.treatment === "cover" && this.imageSrc) {
74
+ return html`<div class="cover" part="hero">
75
+ ${this.ratingText ? html`<div class="chip-line"><div class="chip">${iconSvg("star", "20px")}${this.ratingText}</div></div>` : nothing}
76
+ <img src=${this.imageSrc} alt=${this.imageAlt} part="image" />
77
+ <div class="words">
78
+ ${this.eyebrow ? html`<p class="eyebrow" part="eyebrow">${this.eyebrowIcon !== "none" ? iconSvg(this.eyebrowIcon, "16px") : nothing}${this.eyebrow}</p>` : nothing}
79
+ ${heading(this.level, this.heading, "h")}
80
+ ${this.lead ? html`<p class="body">${this.lead}</p>` : nothing}
81
+ <div class="actions"><slot name="actions"></slot></div>
82
+ </div>
83
+ <div class="finder"><slot name="search"></slot></div>
84
+ </div>`;
85
+ }
86
+ const pictured = Boolean(this.imageSrc) && this.align !== "center";
87
+ return html`<div class="hero ${pictured ? "pictured" : ""}" part="hero">
88
+ <div class="words">
89
+ ${this.eyebrow ? html`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>` : nothing}
90
+ ${heading(this.level, this.heading, "h")}
91
+ ${this.lead ? html`<p class="body">${this.lead}</p>` : nothing}
92
+ <div class="actions"><slot name="actions"></slot></div>
93
+ </div>
94
+ ${pictured ? html`<img src=${this.imageSrc} alt=${this.imageAlt} part="image" />` : nothing}
95
+ </div>`;
96
+ }
97
+ };
98
+ var ImpaktFeatureList = class extends ImpaktElement {
99
+ static {
100
+ this.properties = {
101
+ items: { type: Array },
102
+ columns: { type: String, reflect: true },
103
+ headingLevel: { type: Number, attribute: "heading-level" },
104
+ layout: { type: String, reflect: true },
105
+ spaceAbove: { type: String, reflect: true, attribute: "space-above" },
106
+ spaceBelow: { type: String, reflect: true, attribute: "space-below" }
107
+ };
108
+ }
109
+ constructor() {
110
+ super();
111
+ this.items = [];
112
+ this.columns = "three";
113
+ this.headingLevel = 3;
114
+ this.layout = "stacked";
115
+ this.spaceAbove = "none";
116
+ this.spaceBelow = "none";
117
+ }
118
+ static {
119
+ this.styles = [...ImpaktElement.styles, spaceAround, headingStyles, css`
120
+ :host { display: block; container-type: inline-size; }
121
+ ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(8)} ${space(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
122
+ :host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
123
+ :host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
124
+ li { display: flex; flex-direction: column; gap: ${space(2)}; }
125
+ :host([layout='inline']) li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: ${space(4)}; align-items: start; }
126
+ :host([layout='inline']) .words { display: flex; flex-direction: column; gap: ${space(1)}; }
127
+ .icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 48px; block-size: 48px; border-radius: ${t.radiusLg}; background: ${t.brandSubtle}; color: ${t.brand}; margin-block-end: ${space(2)}; }
128
+ :host([layout='inline']) .icon { margin: 0; }
129
+ .h { font-size: ${fontSize("lg")}; }
130
+ .body { color: ${t.text}; }
131
+ @container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
132
+ @container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
133
+ `];
134
+ }
135
+ render() {
136
+ return html`<ul part="list">${(this.items ?? []).map((item) => html`<li part="item">
137
+ ${item.icon ? html`<span class="icon">${iconSvg(item.icon, "24px")}</span>` : nothing}
138
+ <div class="words">${heading(this.headingLevel, item.heading, "h")}${item.text ? html`<p class="body">${item.text}</p>` : nothing}</div>
139
+ </li>`)}</ul>`;
140
+ }
141
+ };
142
+ var ImpaktQuote = class extends ImpaktElement {
143
+ static {
144
+ this.properties = {
145
+ quote: { type: String },
146
+ person: { type: String },
147
+ about: { type: String },
148
+ imageSrc: { type: String, attribute: "image-src" },
149
+ size: { type: String, reflect: true },
150
+ align: { type: String, reflect: true },
151
+ spaceAbove: { type: String, reflect: true, attribute: "space-above" },
152
+ spaceBelow: { type: String, reflect: true, attribute: "space-below" }
153
+ };
154
+ }
155
+ constructor() {
156
+ super();
157
+ this.quote = "";
158
+ this.person = "";
159
+ this.about = "";
160
+ this.imageSrc = "";
161
+ this.size = "md";
162
+ this.align = "start";
163
+ this.spaceAbove = "none";
164
+ this.spaceBelow = "none";
165
+ }
166
+ static {
167
+ this.styles = [...ImpaktElement.styles, spaceAround, css`
168
+ :host { display: block; }
169
+ figure { margin: 0; display: flex; flex-direction: column; gap: ${space(4)}; max-inline-size: 48rem; }
170
+ :host([align='center']) figure { margin-inline: auto; align-items: center; text-align: center; }
171
+ blockquote { margin: 0; font-family: ${t.fontHeading}; font-size: ${fontSize("lg")}; line-height: ${lineHeight("normal")}; color: inherit; }
172
+ :host([size='lg']) blockquote { font-size: ${fontSize("2xl")}; line-height: ${lineHeight("tight")}; }
173
+ blockquote::before { content: '\\201C'; } blockquote::after { content: '\\201D'; }
174
+ figcaption { display: flex; align-items: center; gap: ${space(3)}; }
175
+ img { inline-size: 48px; block-size: 48px; border-radius: 50%; object-fit: cover; }
176
+ .name { font-weight: ${fontWeight("semibold")}; }
177
+ .detail { color: ${t.textMuted}; font-size: ${fontSize("sm")}; }
178
+ `];
179
+ }
180
+ render() {
181
+ return html`<figure part="figure">
182
+ <blockquote part="quote">${this.quote}</blockquote>
183
+ ${this.person ? html`<figcaption>${this.imageSrc ? html`<img src=${this.imageSrc} alt="" />` : nothing}<span><span class="name">${this.person}</span>${this.about ? html`<br /><span class="detail">${this.about}</span>` : nothing}</span></figcaption>` : nothing}
184
+ </figure>`;
185
+ }
186
+ };
187
+ var ImpaktStat = class extends ImpaktElement {
188
+ static {
189
+ this.properties = {
190
+ figure: { type: String },
191
+ label: { type: String },
192
+ note: { type: String },
193
+ size: { type: String, reflect: true },
194
+ align: { type: String, reflect: true }
195
+ };
196
+ }
197
+ constructor() {
198
+ super();
199
+ this.figure = "";
200
+ this.label = "";
201
+ this.note = "";
202
+ this.size = "md";
203
+ this.align = "start";
204
+ }
205
+ static {
206
+ this.styles = [...ImpaktElement.styles, css`
207
+ :host { display: block; }
208
+ .stat { display: flex; flex-direction: column; gap: ${space(1)}; }
209
+ :host([align='center']) .stat { align-items: center; text-align: center; }
210
+ .value { font-family: ${t.fontHeading}; font-size: ${fontSize("3xl")}; font-weight: ${fontWeight("bold")}; line-height: 1; color: ${t.textHeading}; }
211
+ :host([size='lg']) .value { font-size: ${fontSize("5xl")}; }
212
+ :host([size='xl']) .value { font-size: clamp(2.75rem, 6vw, 4rem); }
213
+ .label { font-weight: ${fontWeight("semibold")}; }
214
+ .detail { color: ${t.textMuted}; font-size: ${fontSize("sm")}; }
215
+ `];
216
+ }
217
+ render() {
218
+ return html`<p class="stat" part="stat" style="margin:0"><span class="value">${this.figure}</span> <span class="label">${this.label}</span>${this.note ? html` <span class="detail">${this.note}</span>` : nothing}</p>`;
219
+ }
220
+ };
221
+ var ImpaktAnnouncement = class extends ImpaktElement {
222
+ static {
223
+ this.properties = {
224
+ message: { type: String },
225
+ linkText: { type: String, attribute: "link-text" },
226
+ href: { type: String }
227
+ };
228
+ }
229
+ constructor() {
230
+ super();
231
+ this.message = "";
232
+ this.linkText = "";
233
+ this.href = "";
234
+ }
235
+ static {
236
+ this.styles = [...ImpaktElement.styles, css`
237
+ :host { display: block; }
238
+ .bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: ${space(2)} ${space(3)}; padding: ${space(2.5)} ${space(5)}; ${type("sm")} text-align: center; color: ${t.onBrand}; background: ${t.brand}; }
239
+ :host { margin-inline: calc(var(--impakt-bleed, 1) * (50% - 50vw)); }
240
+ a { display: inline-flex; align-items: center; gap: ${space(1)}; min-block-size: ${t.targetMin}; color: inherit; font-weight: ${fontWeight("semibold")}; }
241
+ `];
242
+ }
243
+ render() {
244
+ return html`<div class="bar" part="bar"><span>${this.message}</span>${this.linkText && this.href ? html`<a href=${this.href}>${this.linkText}${iconSvg("arrow-right", "14px")}</a>` : nothing}</div>`;
245
+ }
246
+ };
247
+ var ImpaktSearchBar = class extends ImpaktElement {
248
+ static {
249
+ this.properties = {
250
+ items: { type: Array },
251
+ buttonText: { type: String, attribute: "button-text" },
252
+ action: { type: String },
253
+ label: { type: String },
254
+ spaceAbove: { type: String, reflect: true, attribute: "space-above" },
255
+ spaceBelow: { type: String, reflect: true, attribute: "space-below" }
256
+ };
257
+ }
258
+ constructor() {
259
+ super();
260
+ this.items = [];
261
+ this.buttonText = "Search";
262
+ this.action = "";
263
+ this.label = "Search";
264
+ this.spaceAbove = "none";
265
+ this.spaceBelow = "none";
266
+ }
267
+ static {
268
+ this.styles = [...ImpaktElement.styles, spaceAround, css`
269
+ :host { display: block; container-type: inline-size; }
270
+ form { display: flex; align-items: center; padding: ${space(3)}; background: ${t.surfaceCard}; color: ${t.text}; border-radius: ${t.radius2xl}; box-shadow: ${t.shadowXl}; }
271
+ .field { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${space(1)}; padding: ${space(1.5)} ${space(5)}; }
272
+ label { ${type("sm")} color: ${t.textMuted}; }
273
+ select { inline-size: 100%; min-block-size: 28px; padding: 0; font: inherit; ${type("sm")} font-weight: ${fontWeight("semibold")}; color: ${t.text}; background: transparent; border: 0; border-radius: ${t.radiusSm}; cursor: pointer; }
274
+ select:focus-visible, button:focus-visible { outline: 2px solid ${t.brand}; outline-offset: 2px; }
275
+ button { flex: none; min-block-size: 48px; padding: ${space(3)} ${space(6)}; font: inherit; font-weight: ${fontWeight("semibold")}; color: ${t.onBrand}; background: ${t.brand}; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }
276
+ button:hover { background: ${t.brandHover}; }
277
+ @container (max-width: 56rem) { form { flex-wrap: wrap; } .field { flex: 1 1 40%; } button { inline-size: 100%; } }
278
+ @container (max-width: 30rem) { form { flex-direction: column; align-items: stretch; gap: ${space(2)}; } .field { flex: none; } }
279
+ `];
280
+ }
281
+ submit(event) {
282
+ const data = new FormData(event.currentTarget);
283
+ const values = {};
284
+ data.forEach((value, key) => {
285
+ if (value !== "") values[key] = String(value);
286
+ });
287
+ this.dispatchEvent(new CustomEvent("impakt-submit", { detail: { values }, bubbles: true, composed: true }));
288
+ if (!this.action) event.preventDefault();
289
+ }
290
+ render() {
291
+ return html`<form role="search" aria-label=${this.label} method="get" action=${this.action || nothing} @submit=${this.submit} part="form">
292
+ ${(this.items ?? []).map((field, i) => {
293
+ const id = this.id_(`field-${i}`);
294
+ const choices = String(field.options ?? "").split(",").map((o) => o.trim()).filter(Boolean);
295
+ return html`<div class="field"><label for=${id}>${field.label}</label><select id=${id} name=${field.name || field.label.toLowerCase().replace(/[^a-z0-9]+/g, "-")}>
296
+ <option value="">${field.placeholder || "Any"}</option>${choices.map((c) => html`<option value=${c}>${c}</option>`)}
297
+ </select></div>`;
298
+ })}
299
+ <button type="submit">${this.buttonText}</button>
300
+ </form>`;
301
+ }
302
+ };
303
+ customElements.define("impakt-search-bar", ImpaktSearchBar);
304
+ customElements.define("impakt-announcement", ImpaktAnnouncement);
305
+ customElements.define("impakt-hero", ImpaktHero);
306
+ customElements.define("impakt-feature-list", ImpaktFeatureList);
307
+ customElements.define("impakt-quote", ImpaktQuote);
308
+ customElements.define("impakt-stat", ImpaktStat);
309
+
310
+ export {
311
+ ImpaktHero,
312
+ ImpaktFeatureList,
313
+ ImpaktQuote,
314
+ ImpaktStat,
315
+ ImpaktAnnouncement,
316
+ ImpaktSearchBar
317
+ };
318
+ //# sourceMappingURL=chunk-WHENVU5E.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/marketing.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement, fontSize, fontWeight, lineHeight, space, spaceAround, t, type, iconSvg } from '@atomic-ui/ui';\n\n/** A heading at a level the author chose, drawn at a size the component chose. */\nconst heading = (level: number, text: string, cls: string): TemplateResult =>\n html`<div class=${cls} role=\"heading\" aria-level=${level}>${text}</div>`;\n\nconst headingStyles = css`\n .h { margin: 0; color: ${t.textHeading}; font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; line-height: ${lineHeight('tight')}; }\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 .body { margin: 0; line-height: ${lineHeight('normal')}; max-inline-size: 65ch; }\n`;\n\n/**\n * The opening of a page: a short label, a big heading, a line of text, the\n * page's main actions and, beside them, a picture.\n *\n * Put the buttons in the `actions` slot. The picture goes beside the words on\n * a wide screen and below them on a phone, so the heading is always the first\n * thing read.\n *\n * @category layout\n * @icon hero\n * @role heading\n * @slot actions - The page's main buttons and links.\n * @slot search - A search bar across the bottom of a full-picture hero.\n */\nexport class ImpaktHero extends ImpaktElement {\n static properties = {\n eyebrow: { type: String },\n heading: { type: String },\n lead: { type: String },\n level: { type: Number, reflect: true },\n imageSrc: { type: String, attribute: 'image-src' },\n imageAlt: { type: String, attribute: 'image-alt' },\n treatment: { type: String, reflect: true },\n ratingText: { type: String, attribute: 'rating-text' },\n eyebrowIcon: { type: String, attribute: 'eyebrow-icon' },\n align: { 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 short label above the heading, such as the name of the development. */\n declare eyebrow: string;\n declare heading: string;\n /** A sentence or two under the heading. */\n declare lead: string;\n /** The heading's level in the page. A page's hero is usually its only level 1. */\n declare level: 1 | 2;\n declare imageSrc: string;\n /** What the picture shows. Leave empty only when it is decoration. */\n declare imageAlt: string;\n /** The picture beside the words, or filling the whole block with the words over it. */\n declare treatment: 'split' | 'cover';\n /** A short line of proof on the picture, such as \"4.8 from 312 buyers\". */\n declare ratingText: string;\n /** A small picture before the eyebrow on a full-picture hero. */\n declare eyebrowIcon: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat';\n /** Where the words sit. Centred heroes have no picture beside them. */\n declare align: 'start' | 'center';\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.level = 1;\n this.imageSrc = '';\n this.imageAlt = '';\n this.treatment = 'split';\n this.ratingText = '';\n this.eyebrowIcon = 'none';\n this.align = 'start';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpaktElement.styles, spaceAround, headingStyles, css`\n :host { display: block; container-type: inline-size; }\n .hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: ${space(8)}; align-items: center; }\n .hero.pictured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }\n .words { display: flex; flex-direction: column; gap: ${space(4)}; }\n :host([align='center']) .words { align-items: center; text-align: center; margin-inline: auto; max-inline-size: 48rem; }\n .h { ${type('5xl')} letter-spacing: ${t.trackingTight}; text-wrap: balance; }\n .body { ${type('lg')} color: ${t.textMuted}; text-wrap: pretty; }\n @container (max-width: 40rem) { .h { ${type('4xl')} } }\n .actions { display: flex; flex-wrap: wrap; gap: ${space(3)} ${space(4)}; align-items: center; margin-block-start: ${space(2)}; }\n :host([align='center']) .actions { justify-content: center; }\n img { display: block; inline-size: 100%; block-size: auto; border-radius: ${t.radius2xl}; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: ${t.shadowLg}; }\n @container (max-width: 48rem) { .hero.pictured { grid-template-columns: minmax(0, 1fr); } }\n /* Cover: the picture fills the block edge to edge, a scrim keeps the words readable (1.4.3). */\n .cover { position: relative; display: flex; flex-direction: column; justify-content: center; min-block-size: clamp(44rem, 61vw, 55rem); margin-inline: calc(var(--impakt-bleed, 1) * (50% - 50vw)); padding: ${space(32)} max(${space(8)}, calc(var(--impakt-bleed, 1) * (50vw - 50%))) ${space(24)}; overflow: hidden; color: #fff; --impakt-color-text-heading: #fff; }\n .cover img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }\n .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(18 31 26 / 0.82) 0%, rgb(18 31 26 / 0.42) 55%, rgb(18 31 26 / 0.05) 100%); }\n .cover .words { position: relative; z-index: 1; max-inline-size: 48rem; }\n .cover .eyebrow { display: inline-flex; align-items: center; gap: ${space(2)}; align-self: flex-start; padding: ${space(2)} ${space(3.5)}; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: 999px; text-transform: none; letter-spacing: 0; }\n .chip-line { position: relative; z-index: 1; block-size: 0; }\n .chip { position: absolute; inset-block-start: ${space(14)}; inset-inline-end: ${space(9)}; display: inline-flex; align-items: center; gap: ${space(2.5)}; padding: ${space(3)} ${space(4.5)}; ${type('sm')} font-weight: ${fontWeight('semibold')}; white-space: nowrap; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: ${t.radiusXl}; }\n .finder { position: relative; z-index: 1; margin-block-start: ${space(12)}; }\n .cover .h { font-size: clamp(3rem, 6.4vw, 5.75rem); line-height: 1; }\n .cover .body { color: rgb(255 255 255 / 0.92); max-inline-size: 40rem; }\n @container (max-width: 64rem) { .chip { display: none; } }\n @container (max-width: 30rem) { .finder { display: none; } }\n @container (max-width: 48rem) { .finder { margin-block-start: ${space(6)}; } .cover { justify-content: flex-end; min-block-size: 43.75rem; padding-block: ${space(32)} ${space(10)}; } .cover::after { background: linear-gradient(180deg, rgb(18 31 26 / 0.1) 0%, rgb(18 31 26 / 0.3) 42%, rgb(18 31 26 / 0.86) 100%); } .cover .h { font-size: 3rem; } }\n `];\n\n render(): TemplateResult {\n if (this.treatment === 'cover' && this.imageSrc) {\n return html`<div class=\"cover\" part=\"hero\">\n ${this.ratingText ? html`<div class=\"chip-line\"><div class=\"chip\">${iconSvg('star', '20px')}${this.ratingText}</div></div>` : nothing}\n <img src=${this.imageSrc} alt=${this.imageAlt} part=\"image\" />\n <div class=\"words\">\n ${this.eyebrow ? html`<p class=\"eyebrow\" part=\"eyebrow\">${this.eyebrowIcon !== 'none' ? iconSvg(this.eyebrowIcon, '16px') : nothing}${this.eyebrow}</p>` : nothing}\n ${heading(this.level, this.heading, 'h')}\n ${this.lead ? html`<p class=\"body\">${this.lead}</p>` : nothing}\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>\n <div class=\"finder\"><slot name=\"search\"></slot></div>\n </div>`;\n }\n const pictured = Boolean(this.imageSrc) && this.align !== 'center';\n return html`<div class=\"hero ${pictured ? 'pictured' : ''}\" part=\"hero\">\n <div class=\"words\">\n ${this.eyebrow ? html`<p class=\"eyebrow\" part=\"eyebrow\">${this.eyebrow}</p>` : nothing}\n ${heading(this.level, this.heading, 'h')}\n ${this.lead ? html`<p class=\"body\">${this.lead}</p>` : nothing}\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>\n ${pictured ? html`<img src=${this.imageSrc} alt=${this.imageAlt} part=\"image\" />` : nothing}\n </div>`;\n }\n}\n\n/** One benefit or feature in a list of them. */\nexport interface FeatureItem {\n id?: string;\n icon?: string;\n heading: string;\n text?: string;\n}\n\n/**\n * Benefits or features side by side, each with an icon, a short heading and a\n * line of text: \"Ten years of cover\", \"Lower bills from day one\".\n *\n * The icons are decoration, because each heading already says what it is.\n * The items are a list, so a screen reader says how many there are.\n *\n * @category content\n * @icon features\n */\nexport class ImpaktFeatureList extends ImpaktElement {\n static properties = {\n items: { type: Array },\n columns: { type: String, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n layout: { 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 items: FeatureItem[];\n declare columns: 'two' | 'three' | 'four';\n /** The level of each item's heading. One below the heading above the list. */\n declare headingLevel: 2 | 3 | 4;\n /** Icons above the words, or beside them. */\n declare layout: 'stacked' | 'inline';\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.columns = 'three';\n this.headingLevel = 3;\n this.layout = 'stacked';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpaktElement.styles, spaceAround, headingStyles, css`\n :host { display: block; container-type: inline-size; }\n ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(8)} ${space(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }\n :host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n :host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }\n li { display: flex; flex-direction: column; gap: ${space(2)}; }\n :host([layout='inline']) li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: ${space(4)}; align-items: start; }\n :host([layout='inline']) .words { display: flex; flex-direction: column; gap: ${space(1)}; }\n .icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 48px; block-size: 48px; border-radius: ${t.radiusLg}; background: ${t.brandSubtle}; color: ${t.brand}; margin-block-end: ${space(2)}; }\n :host([layout='inline']) .icon { margin: 0; }\n .h { font-size: ${fontSize('lg')}; }\n .body { color: ${t.text}; }\n @container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n @container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }\n `];\n\n render(): TemplateResult {\n return html`<ul part=\"list\">${(this.items ?? []).map((item) => html`<li part=\"item\">\n ${item.icon ? html`<span class=\"icon\">${iconSvg(item.icon, '24px')}</span>` : nothing}\n <div class=\"words\">${heading(this.headingLevel, item.heading, 'h')}${item.text ? html`<p class=\"body\">${item.text}</p>` : nothing}</div>\n </li>`)}</ul>`;\n }\n}\n\n/**\n * Something a customer said, and who said it.\n *\n * It is a `blockquote` with a `figcaption`, so the words and the person are\n * tied together for a screen reader as well as on the screen.\n *\n * @category content\n * @icon quote\n */\nexport class ImpaktQuote extends ImpaktElement {\n static properties = {\n quote: { type: String },\n person: { type: String },\n about: { type: String },\n imageSrc: { type: String, attribute: 'image-src' },\n size: { type: String, reflect: true },\n align: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** The words they said, without quotation marks. */\n declare quote: string;\n /** Who said it. */\n declare person: string;\n /** Who they are, such as \"Bought at Larkfield Meadows, 2025\". */\n declare about: string;\n /** A photo of them. It is decoration, because their name is beside it. */\n declare imageSrc: string;\n declare size: 'md' | 'lg';\n declare align: 'start' | 'center';\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.quote = '';\n this.person = '';\n this.about = '';\n this.imageSrc = '';\n this.size = 'md';\n this.align = 'start';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpaktElement.styles, spaceAround, css`\n :host { display: block; }\n figure { margin: 0; display: flex; flex-direction: column; gap: ${space(4)}; max-inline-size: 48rem; }\n :host([align='center']) figure { margin-inline: auto; align-items: center; text-align: center; }\n blockquote { margin: 0; font-family: ${t.fontHeading}; font-size: ${fontSize('lg')}; line-height: ${lineHeight('normal')}; color: inherit; }\n :host([size='lg']) blockquote { font-size: ${fontSize('2xl')}; line-height: ${lineHeight('tight')}; }\n blockquote::before { content: '\\\\201C'; } blockquote::after { content: '\\\\201D'; }\n figcaption { display: flex; align-items: center; gap: ${space(3)}; }\n img { inline-size: 48px; block-size: 48px; border-radius: 50%; object-fit: cover; }\n .name { font-weight: ${fontWeight('semibold')}; }\n .detail { color: ${t.textMuted}; font-size: ${fontSize('sm')}; }\n `];\n\n render(): TemplateResult {\n return html`<figure part=\"figure\">\n <blockquote part=\"quote\">${this.quote}</blockquote>\n ${this.person ? html`<figcaption>${this.imageSrc ? html`<img src=${this.imageSrc} alt=\"\" />` : nothing}<span><span class=\"name\">${this.person}</span>${this.about ? html`<br /><span class=\"detail\">${this.about}</span>` : nothing}</span></figcaption>` : nothing}\n </figure>`;\n }\n}\n\n/**\n * A number that makes a point, with what it counts beneath it: \"36 years\",\n * \"Building in Kent since 1987\".\n *\n * @category content\n * @icon stat\n */\nexport class ImpaktStat extends ImpaktElement {\n static properties = {\n figure: { type: String },\n label: { type: String },\n note: { type: String },\n size: { type: String, reflect: true },\n align: { type: String, reflect: true },\n };\n /** How large the number is drawn. */\n declare size: 'md' | 'lg' | 'xl';\n /** The number, written as it should appear, such as \"36\" or \"£280k\". */\n declare figure: string;\n /** What the number counts. */\n declare label: string;\n /** A line more, if the label needs it. */\n declare note: string;\n declare align: 'start' | 'center';\n\n constructor() {\n super();\n this.figure = '';\n this.label = '';\n this.note = '';\n this.size = 'md';\n this.align = 'start';\n }\n\n static styles = [...ImpaktElement.styles, css`\n :host { display: block; }\n .stat { display: flex; flex-direction: column; gap: ${space(1)}; }\n :host([align='center']) .stat { align-items: center; text-align: center; }\n .value { font-family: ${t.fontHeading}; font-size: ${fontSize('3xl')}; font-weight: ${fontWeight('bold')}; line-height: 1; color: ${t.textHeading}; }\n :host([size='lg']) .value { font-size: ${fontSize('5xl')}; }\n :host([size='xl']) .value { font-size: clamp(2.75rem, 6vw, 4rem); }\n .label { font-weight: ${fontWeight('semibold')}; }\n .detail { color: ${t.textMuted}; font-size: ${fontSize('sm')}; }\n `];\n\n render(): TemplateResult {\n // Read as one phrase, \"36 years\", rather than a bare number and then a label.\n return html`<p class=\"stat\" part=\"stat\" style=\"margin:0\"><span class=\"value\">${this.figure}</span> <span class=\"label\">${this.label}</span>${this.note ? html` <span class=\"detail\">${this.note}</span>` : nothing}</p>`;\n }\n}\n\n/**\n * A thin line of news across the top of a page: a launch, a change to opening\n * hours. Keep it to one short sentence.\n *\n * @category feedback\n * @icon alert\n */\nexport class ImpaktAnnouncement extends ImpaktElement {\n static properties = {\n message: { type: String },\n linkText: { type: String, attribute: 'link-text' },\n href: { type: String },\n };\n declare message: string;\n declare linkText: string;\n declare href: string;\n\n constructor() {\n super();\n this.message = '';\n this.linkText = '';\n this.href = '';\n }\n\n static styles = [...ImpaktElement.styles, css`\n :host { display: block; }\n .bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: ${space(2)} ${space(3)}; padding: ${space(2.5)} ${space(5)}; ${type('sm')} text-align: center; color: ${t.onBrand}; background: ${t.brand}; }\n :host { margin-inline: calc(var(--impakt-bleed, 1) * (50% - 50vw)); }\n a { display: inline-flex; align-items: center; gap: ${space(1)}; min-block-size: ${t.targetMin}; color: inherit; font-weight: ${fontWeight('semibold')}; }\n `];\n\n render(): TemplateResult {\n return html`<div class=\"bar\" part=\"bar\"><span>${this.message}</span>${this.linkText && this.href ? html`<a href=${this.href}>${this.linkText}${iconSvg('arrow-right', '14px')}</a>` : nothing}</div>`;\n }\n}\n\n/** One choice in a search bar. */\nexport interface SearchField {\n id?: string;\n /** The name it sends, such as \"bedrooms\". */\n name?: string;\n label: string;\n /** What it shows before anything is chosen. */\n placeholder?: string;\n /** The other choices, separated by commas. */\n options?: string;\n}\n\n/**\n * A row of choices and one button that finds what fits: where, how many\n * bedrooms, up to what budget.\n *\n * Each choice is a native select with a real label. It sends the visitor to\n * `action` with their choices in the address, so it works as a plain link can.\n *\n * @category form\n * @icon search\n * @fires {CustomEvent<{ values: Record<string, string> }>} impakt-submit - When the search is run. The choices are in detail.values.\n */\nexport class ImpaktSearchBar extends ImpaktElement {\n static properties = {\n items: { type: Array },\n buttonText: { type: String, attribute: 'button-text' },\n action: { type: String },\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: SearchField[];\n declare buttonText: string;\n /** Where the search goes. Leave empty to handle it in the app. */\n declare action: string;\n /** What the search is called 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 constructor() {\n super();\n this.items = [];\n this.buttonText = 'Search';\n this.action = '';\n this.label = 'Search';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpaktElement.styles, spaceAround, css`\n :host { display: block; container-type: inline-size; }\n form { display: flex; align-items: center; padding: ${space(3)}; background: ${t.surfaceCard}; color: ${t.text}; border-radius: ${t.radius2xl}; box-shadow: ${t.shadowXl}; }\n .field { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${space(1)}; padding: ${space(1.5)} ${space(5)}; }\n label { ${type('sm')} color: ${t.textMuted}; }\n select { inline-size: 100%; min-block-size: 28px; padding: 0; font: inherit; ${type('sm')} font-weight: ${fontWeight('semibold')}; color: ${t.text}; background: transparent; border: 0; border-radius: ${t.radiusSm}; cursor: pointer; }\n select:focus-visible, button:focus-visible { outline: 2px solid ${t.brand}; outline-offset: 2px; }\n button { flex: none; min-block-size: 48px; padding: ${space(3)} ${space(6)}; font: inherit; font-weight: ${fontWeight('semibold')}; color: ${t.onBrand}; background: ${t.brand}; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }\n button:hover { background: ${t.brandHover}; }\n @container (max-width: 56rem) { form { flex-wrap: wrap; } .field { flex: 1 1 40%; } button { inline-size: 100%; } }\n @container (max-width: 30rem) { form { flex-direction: column; align-items: stretch; gap: ${space(2)}; } .field { flex: none; } }\n `];\n\n private submit(event: SubmitEvent): void {\n const data = new FormData(event.currentTarget as HTMLFormElement);\n const values: Record<string, string> = {};\n data.forEach((value, key) => { if (value !== '') values[key] = String(value); });\n this.dispatchEvent(new CustomEvent('impakt-submit', { detail: { values }, bubbles: true, composed: true }));\n if (!this.action) event.preventDefault();\n }\n\n render(): TemplateResult {\n return html`<form role=\"search\" aria-label=${this.label} method=\"get\" action=${this.action || nothing} @submit=${this.submit} part=\"form\">\n ${(this.items ?? []).map((field, i) => {\n const id = this.id_(`field-${i}`);\n const choices = String(field.options ?? '').split(',').map((o) => o.trim()).filter(Boolean);\n return html`<div class=\"field\"><label for=${id}>${field.label}</label><select id=${id} name=${field.name || field.label.toLowerCase().replace(/[^a-z0-9]+/g, '-')}>\n <option value=\"\">${field.placeholder || 'Any'}</option>${choices.map((c) => html`<option value=${c}>${c}</option>`)}\n </select></div>`;\n })}\n <button type=\"submit\">${this.buttonText}</button>\n </form>`;\n }\n}\n\ncustomElements.define('impakt-search-bar', ImpaktSearchBar);\ncustomElements.define('impakt-announcement', ImpaktAnnouncement);\ncustomElements.define('impakt-hero', ImpaktHero);\ncustomElements.define('impakt-feature-list', ImpaktFeatureList);\ncustomElements.define('impakt-quote', ImpaktQuote);\ncustomElements.define('impakt-stat', ImpaktStat);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-hero': ImpaktHero; 'impakt-feature-list': ImpaktFeatureList; 'impakt-quote': ImpaktQuote; 'impakt-stat': ImpaktStat;\n }\n}\n"],"mappings":";AA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","names":[]}
@@ -0,0 +1,228 @@
1
+ // packages/blocks/src/components/scrubber.ts
2
+ import { html, css } from "lit";
3
+ import { say, ImpaktElement, visuallyHidden, fontSize, fontWeight, space, t, token } from "@atomic-ui/ui";
4
+ var TONES = {
5
+ brand: "var(--impakt-color-brand-default, #1f4ed8)",
6
+ accent: "var(--impakt-color-accent-default, #c8a15a)",
7
+ info: "var(--impakt-color-status-info-default, #1f4ed8)",
8
+ success: "var(--impakt-color-status-success-default, #047857)",
9
+ warning: "var(--impakt-color-status-warning-default, #b45309)",
10
+ danger: "var(--impakt-color-status-danger-default, #c8102e)"
11
+ };
12
+ var ImpaktScrubber = class extends ImpaktElement {
13
+ constructor() {
14
+ super();
15
+ this.scene = null;
16
+ this.onProgress = (e) => {
17
+ this.value = e.detail.progress;
18
+ };
19
+ this.onInput = (e) => {
20
+ const v = Number(e.target.value) / 1e3;
21
+ this.value = v;
22
+ this.scene?.seek(v);
23
+ };
24
+ this.label = "Scene progress";
25
+ this.stops = [];
26
+ this.look = "buttons";
27
+ this.hint = "";
28
+ this.value = 0;
29
+ }
30
+ static {
31
+ this.properties = {
32
+ label: { type: String },
33
+ stops: { type: Array },
34
+ look: { type: String, reflect: true },
35
+ hint: { type: String },
36
+ value: { type: Number, state: true }
37
+ };
38
+ }
39
+ static {
40
+ this.styles = [
41
+ ...ImpaktElement.styles,
42
+ css`
43
+ :host {
44
+ display: block;
45
+ width: 100%;
46
+ max-width: 48rem;
47
+ margin-inline: auto;
48
+ }
49
+ .wrap {
50
+ display: grid;
51
+ gap: ${space(2)};
52
+ padding: ${space(3)} ${space(4)};
53
+ border-radius: ${token("radius.xl", "16px")};
54
+ background: ${t.surfaceCard};
55
+ box-shadow: ${token("shadow.lg", "0 10px 15px -3px rgba(0,0,0,.1)")};
56
+ border: 1px solid ${t.border};
57
+ }
58
+ input {
59
+ width: 100%;
60
+ min-height: ${token("target.min", "24px")};
61
+ accent-color: ${t.brand};
62
+ margin: 0;
63
+ }
64
+ .stops {
65
+ position: relative;
66
+ display: flex;
67
+ flex-wrap: wrap;
68
+ gap: ${space(2)};
69
+ list-style: none;
70
+ margin: 0;
71
+ padding: 0;
72
+ }
73
+ button {
74
+ min-height: ${token("target.min", "24px")};
75
+ padding: ${space(1)} ${space(3)};
76
+ border-radius: ${token("radius.full", "9999px")};
77
+ border: 1px solid ${t.border};
78
+ background: transparent;
79
+ color: ${t.textMuted};
80
+ font-size: ${fontSize("xs")};
81
+ font-weight: ${fontWeight("medium")};
82
+ cursor: pointer;
83
+ }
84
+ button[aria-current='true'] {
85
+ color: ${t.text};
86
+ border-color: ${t.text};
87
+ }
88
+ .sr-only {
89
+ ${visuallyHidden}
90
+ }
91
+ /* The graph look: the code of where you are, the line of stops, where you are. */
92
+ :host([look='graph']) { max-width: none; }
93
+ .graph { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr) auto; gap: ${space(6)}; align-items: center; padding: ${space(4)} ${space(6)}; border-radius: ${token("radius.xl", "16px")}; background: ${t.surfaceCard}; box-shadow: ${token("shadow.lg", "0 10px 15px -3px rgba(0,0,0,.1)")}; border: 1px solid ${t.border}; }
94
+ .mono { font-family: ${t.fontMono}; font-size: ${fontSize("xs")}; letter-spacing: 0.04em; }
95
+ .head { display: grid; gap: 2px; }
96
+ .head .k { color: ${t.textMuted}; text-transform: uppercase; }
97
+ .head .code { font-size: ${fontSize("md")}; color: ${t.text}; }
98
+ .head .note { color: ${t.textMuted}; }
99
+ .line { position: relative; block-size: 48px; }
100
+ .track, .fill { position: absolute; inset-inline: 0; inset-block-start: 14px; block-size: 3px; border-radius: 3px; background: ${t.border}; opacity: 0.5; }
101
+ .fill { opacity: 1; background: none; display: flex; overflow: hidden; }
102
+ .fill span { block-size: 100%; }
103
+ .dot { position: absolute; inset-block-start: 15px; inline-size: 14px; block-size: 14px; translate: -50% -50%; border-radius: 50%; border: 2px solid var(--c); background: ${t.surfaceCard}; padding: 0; min-height: 0; cursor: pointer; }
104
+ .dot[data-passed] { background: var(--c); }
105
+ .dot[aria-current='true'] { inline-size: 24px; block-size: 24px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
106
+ .dot-label { position: absolute; inset-block-start: 30px; translate: -50% 0; white-space: nowrap; color: ${t.textMuted}; text-transform: uppercase; pointer-events: none; }
107
+ .dot-label[data-current] { color: ${t.text}; font-weight: ${fontWeight("bold")}; }
108
+ .line input { position: absolute; inset: 0 0 auto; block-size: 30px; opacity: 0; cursor: grab; }
109
+ .line input:focus-visible { opacity: 1; }
110
+ .where { display: grid; gap: ${space(2)}; justify-items: end; }
111
+ .chip { display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border-radius: ${token("radius.full", "9999px")}; border: 1px solid ${t.border}; color: ${t.text}; text-transform: uppercase; }
112
+ .chip::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--c); }
113
+ .hint { color: ${t.textMuted}; text-transform: uppercase; }
114
+ /* Muted by colour, not opacity, so the code keeps its contrast (1.4.3). */
115
+ .chip .meta { color: ${t.textMuted}; }
116
+ @media (max-width: 48rem) {
117
+ .graph { grid-template-columns: minmax(0, 1fr); }
118
+ .where { justify-items: start; }
119
+ .dot-label:not([data-current]) { display: none; }
120
+ }
121
+ button:focus-visible,
122
+ input:focus-visible {
123
+ outline: none;
124
+ box-shadow: ${token("focus.ring.shadow", "0 0 0 2px #fff, 0 0 0 4px #1a1a1a")};
125
+ }
126
+ `
127
+ ];
128
+ }
129
+ /** @ignore */
130
+ connectedCallback() {
131
+ super.connectedCallback();
132
+ this.scene = this.closest("impakt-scene");
133
+ this.scene?.addEventListener("impakt-scene-progress", this.onProgress);
134
+ if (this.scene) this.value = this.scene.progress;
135
+ }
136
+ /** @ignore */
137
+ disconnectedCallback() {
138
+ super.disconnectedCallback();
139
+ this.scene?.removeEventListener("impakt-scene-progress", this.onProgress);
140
+ this.scene = null;
141
+ }
142
+ goTo(stop) {
143
+ this.scene?.seek(stop.at, 600);
144
+ }
145
+ /** The stop nearest the current position, which the stop list marks as current. */
146
+ nearest() {
147
+ let best = -1;
148
+ let gap = Infinity;
149
+ this.stops.forEach((s, i) => {
150
+ const d = Math.abs(s.at - this.value);
151
+ if (d < gap) {
152
+ gap = d;
153
+ best = i;
154
+ }
155
+ });
156
+ return best;
157
+ }
158
+ renderGraph(nearestIndex, valueText) {
159
+ let current = nearestIndex;
160
+ const stops = [...this.stops ?? []].sort((a, b) => a.at - b.at);
161
+ current = stops.indexOf(this.stops[current]);
162
+ const colour = (s) => {
163
+ const tone = s?.tone ?? "brand";
164
+ return typeof tone === "number" ? `var(--impakt-color-chart-${tone}, ${TONES.brand})` : TONES[tone] ?? TONES.brand;
165
+ };
166
+ const now = stops[current] ?? stops[0];
167
+ const segments = stops.map((s, i) => {
168
+ const from = i === 0 ? 0 : stops[i - 1].at;
169
+ const to = Math.min(s.at, this.value);
170
+ return { width: Math.round(Math.max(0, to - from) * 1e4) / 100, c: colour(s) };
171
+ });
172
+ return html`<div class="graph" part="wrap">
173
+ <div class="head mono" aria-hidden="true">
174
+ <span class="k">HEAD</span>
175
+ <span class="code">${now?.meta ?? now?.label ?? ""}</span>
176
+ ${now?.note ? html`<span class="note">${now.note}</span>` : null}
177
+ </div>
178
+ <div class="line">
179
+ <div class="track"></div>
180
+ <div class="fill" aria-hidden="true">${segments.map((g) => html`<span style=${`width:${g.width}%;background:${g.c}`}></span>`)}</div>
181
+ ${stops.map((s, i) => html`
182
+ <button type="button" class="dot" style=${`left:${s.at * 100}%;--c:${colour(s)}`} ?data-passed=${s.at <= this.value + 1e-4} aria-current=${i === current ? "true" : "false"} @click=${() => this.goTo(s)}>
183
+ <span class="sr-only">${say("Go to {name}", { name: s.label })}</span>
184
+ </button>
185
+ <span class="dot-label mono" style=${`left:${s.at * 100}%`} ?data-current=${i === current} aria-hidden="true">${s.label}</span>`)}
186
+ <input type="range" min="0" max="1000" step="1" .value=${String(Math.round(this.value * 1e3))} aria-label=${this.label} aria-valuetext=${valueText} @input=${this.onInput} />
187
+ </div>
188
+ <div class="where" aria-hidden="true">
189
+ ${now ? html`<span class="chip mono" style=${`--c:${colour(now)}`}>${now.label}${now.meta ? html`&nbsp;<span class="meta">${now.meta}</span>` : null}</span>` : null}
190
+ ${this.hint ? html`<span class="hint mono">${this.hint}</span>` : null}
191
+ </div>
192
+ </div>`;
193
+ }
194
+ render() {
195
+ const current = this.nearest();
196
+ const valueText = current >= 0 ? this.stops[current].label : `${Math.round(this.value * 100)}%`;
197
+ if (this.look === "graph") return this.renderGraph(current, valueText);
198
+ return html`
199
+ <div class="wrap" part="wrap">
200
+ <input
201
+ type="range"
202
+ min="0"
203
+ max="1000"
204
+ step="1"
205
+ .value=${String(Math.round(this.value * 1e3))}
206
+ aria-label=${this.label}
207
+ aria-valuetext=${valueText}
208
+ @input=${this.onInput}
209
+ />
210
+ ${this.stops.length ? html`<ul class="stops" part="stops">
211
+ ${this.stops.map(
212
+ (s, i) => html`<li>
213
+ <button type="button" aria-current=${i === current ? "true" : "false"} @click=${() => this.goTo(s)}>
214
+ <span aria-hidden="true">${s.label}</span><span class="sr-only">${say("Go to {name}", { name: s.label })}</span>
215
+ </button>
216
+ </li>`
217
+ )}
218
+ </ul>` : null}
219
+ </div>
220
+ `;
221
+ }
222
+ };
223
+ customElements.define("impakt-scrubber", ImpaktScrubber);
224
+
225
+ export {
226
+ ImpaktScrubber
227
+ };
228
+ //# sourceMappingURL=chunk-XHFUTZGU.js.map