@atomic-ui/blocks 0.14.0 → 0.15.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 (69) hide show
  1. package/README.md +15 -15
  2. package/custom-elements.json +2978 -9654
  3. package/dist/chunk-GQ2I44OU.js +226 -0
  4. package/dist/chunk-GQ2I44OU.js.map +1 -0
  5. package/dist/chunk-HISF6RYK.js +199 -0
  6. package/dist/chunk-HISF6RYK.js.map +1 -0
  7. package/dist/{chunk-Q366ZM2X.js → chunk-LJGOTYDJ.js} +17 -41
  8. package/dist/chunk-LJGOTYDJ.js.map +1 -0
  9. package/dist/{chunk-BW5ZMKES.js → chunk-OBBPBN4S.js} +17 -144
  10. package/dist/chunk-OBBPBN4S.js.map +1 -0
  11. package/dist/chunk-OHXEZPBB.js +109 -0
  12. package/dist/chunk-OHXEZPBB.js.map +1 -0
  13. package/dist/{chunk-NZQZRBKV.js → chunk-VOONXP5H.js} +15 -57
  14. package/dist/chunk-VOONXP5H.js.map +1 -0
  15. package/dist/chunk-XSKGWT2D.js +84 -0
  16. package/dist/chunk-XSKGWT2D.js.map +1 -0
  17. package/dist/components/changelog.d.ts +0 -288
  18. package/dist/components/changelog.js +3 -12
  19. package/dist/components/g2-site.d.ts +27 -40
  20. package/dist/components/g2-site.js +1 -3
  21. package/dist/components/marketing.d.ts +0 -283
  22. package/dist/components/marketing.js +3 -13
  23. package/dist/components/organisms.d.ts +0 -489
  24. package/dist/components/organisms.js +3 -19
  25. package/dist/components/selling.d.ts +0 -255
  26. package/dist/components/selling.js +3 -15
  27. package/dist/components/site.d.ts +6 -52
  28. package/dist/components/site.js +3 -5
  29. package/dist/components/studio.d.ts +10 -95
  30. package/dist/components/studio.js +1 -3
  31. package/dist/index.d.ts +9 -13
  32. package/dist/index.js +23 -101
  33. package/dist/index.js.map +1 -1
  34. package/dist/standalone/atomic-ui-blocks.js +751 -1642
  35. package/dist/standalone/atomic-ui-blocks.js.map +4 -4
  36. package/dist/standalone/index.html +18 -26
  37. package/package.json +3 -3
  38. package/specimen/index.html +18 -26
  39. package/dist/chunk-BW5ZMKES.js.map +0 -1
  40. package/dist/chunk-GZTBAT6P.js +0 -574
  41. package/dist/chunk-GZTBAT6P.js.map +0 -1
  42. package/dist/chunk-NHWD2LUR.js +0 -255
  43. package/dist/chunk-NHWD2LUR.js.map +0 -1
  44. package/dist/chunk-NZQZRBKV.js.map +0 -1
  45. package/dist/chunk-Q366ZM2X.js.map +0 -1
  46. package/dist/chunk-R7SSIE2E.js +0 -362
  47. package/dist/chunk-R7SSIE2E.js.map +0 -1
  48. package/dist/chunk-XB6FD4SF.js +0 -438
  49. package/dist/chunk-XB6FD4SF.js.map +0 -1
  50. package/dist/chunk-YXMXLVK7.js +0 -230
  51. package/dist/chunk-YXMXLVK7.js.map +0 -1
  52. package/dist/chunk-ZD75GU6J.js +0 -75
  53. package/dist/chunk-ZD75GU6J.js.map +0 -1
  54. package/dist/chunk-ZM2HLQOG.js +0 -783
  55. package/dist/chunk-ZM2HLQOG.js.map +0 -1
  56. package/dist/chunk-ZODL5HD4.js +0 -535
  57. package/dist/chunk-ZODL5HD4.js.map +0 -1
  58. package/dist/components/card-grid.d.ts +0 -72
  59. package/dist/components/card-grid.js +0 -7
  60. package/dist/components/card-grid.js.map +0 -1
  61. package/dist/components/property.d.ts +0 -389
  62. package/dist/components/property.js +0 -17
  63. package/dist/components/property.js.map +0 -1
  64. package/dist/components/scene.d.ts +0 -138
  65. package/dist/components/scene.js +0 -7
  66. package/dist/components/scene.js.map +0 -1
  67. package/dist/components/scrubber.d.ts +0 -86
  68. package/dist/components/scrubber.js +0 -7
  69. package/dist/components/scrubber.js.map +0 -1
@@ -1,574 +0,0 @@
1
- // packages/blocks/src/components/changelog.ts
2
- import { css, html, nothing, svg } from "lit";
3
- import {
4
- say,
5
- ImpaktElement,
6
- focusRing,
7
- visuallyHidden,
8
- fontSize,
9
- fontWeight,
10
- space,
11
- spaceAround,
12
- t,
13
- token,
14
- type,
15
- iconSvg,
16
- toneOf,
17
- TONE
18
- } from "@atomic-ui/ui";
19
- function revealOnView(el, onShow) {
20
- const show = () => {
21
- el.setAttribute("shown", "");
22
- onShow?.();
23
- };
24
- if (typeof IntersectionObserver !== "function") {
25
- show();
26
- return () => void 0;
27
- }
28
- const io = new IntersectionObserver(
29
- (entries) => {
30
- if (entries.some((e) => e.isIntersecting)) {
31
- show();
32
- io.disconnect();
33
- }
34
- },
35
- { threshold: 0.25 }
36
- );
37
- io.observe(el);
38
- return () => io.disconnect();
39
- }
40
- var reduced = () => typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
41
- var mono = css`.mono { font-family: ${t.fontMono}; font-size: ${fontSize("xs")}; letter-spacing: 0.04em; }`;
42
- var heading = (level, text, cls) => {
43
- const l = Math.min(Math.max(level || 3, 2), 6);
44
- switch (l) {
45
- case 2:
46
- return html`<h2 class=${cls}>${text}</h2>`;
47
- case 4:
48
- return html`<h4 class=${cls}>${text}</h4>`;
49
- case 5:
50
- return html`<h5 class=${cls}>${text}</h5>`;
51
- case 6:
52
- return html`<h6 class=${cls}>${text}</h6>`;
53
- default:
54
- return html`<h3 class=${cls}>${text}</h3>`;
55
- }
56
- };
57
- var words = css`
58
- .h { margin: 0; color: var(--impakt-heading, ${t.textHeading}); font-family: ${t.fontHeading}; font-weight: ${fontWeight("bold")}; letter-spacing: ${t.trackingTight}; text-wrap: balance; }
59
- .body { margin: 0; color: inherit; opacity: 0.8; text-wrap: pretty; }
60
- .meta { margin: 0; color: inherit; opacity: 0.72; text-transform: uppercase; }
61
- .sr-only { ${visuallyHidden} }
62
- `;
63
- var ImpaktReleaseCard = class extends ImpaktElement {
64
- constructor() {
65
- super();
66
- this.raf = 0;
67
- this.label = "";
68
- this.heading = "";
69
- this.text = "";
70
- this.beforeSrc = "";
71
- this.beforeAlt = "";
72
- this.afterSrc = "";
73
- this.afterAlt = "";
74
- this.items = [];
75
- this.href = "";
76
- this.headingLevel = 3;
77
- this.spaceAbove = "none";
78
- this.spaceBelow = "none";
79
- }
80
- static {
81
- this.properties = {
82
- label: { type: String },
83
- heading: { type: String },
84
- text: { type: String },
85
- beforeSrc: { type: String, attribute: "before-src" },
86
- beforeAlt: { type: String, attribute: "before-alt" },
87
- afterSrc: { type: String, attribute: "after-src" },
88
- afterAlt: { type: String, attribute: "after-alt" },
89
- items: { type: Array },
90
- href: { type: String },
91
- headingLevel: { type: Number, attribute: "heading-level" },
92
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
93
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
94
- };
95
- }
96
- static {
97
- this.styles = [
98
- ...ImpaktElement.styles,
99
- spaceAround,
100
- mono,
101
- words,
102
- css`
103
- :host { display: block; }
104
- article { display: flex; flex-direction: column; gap: ${space(3)}; }
105
- .media { border-radius: ${t.radiusXl}; overflow: clip; background: ${t.surfaceInset}; }
106
- .media img { display: block; inline-size: 100%; aspect-ratio: 5 / 3; object-fit: cover; }
107
- impakt-before-after { display: block; }
108
- .h { font-size: ${fontSize("3xl")}; }
109
- .h a { color: inherit; text-decoration: none; }
110
- .h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
111
- .h a:focus-visible { outline: none; box-shadow: ${t.focusShadow}; border-radius: ${t.radiusSm}; }
112
- ul { list-style: none; margin: ${space(1)} 0 0; padding: 0; display: grid; gap: ${space(1)}; }
113
- li { display: grid; grid-template-columns: 1.25em minmax(0, 1fr); gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border-radius: ${t.radius}; }
114
- li[data-change='added'] { background: ${t.successSubtle}; color: ${t.successText}; }
115
- li[data-change='removed'] { background: ${t.dangerSubtle}; color: ${t.dangerText}; }
116
- li[data-change='same'] { color: ${t.textMuted}; }
117
- .sign { font-weight: ${fontWeight("bold")}; }
118
- `
119
- ];
120
- }
121
- /** Sweep the seam, as Commit's release wipe does: off the screenshot on hover, back on leaving. */
122
- wipe(to) {
123
- const ba = this.renderRoot.querySelector("impakt-before-after");
124
- if (!ba) return;
125
- cancelAnimationFrame(this.raf);
126
- if (reduced()) {
127
- ba.position = to;
128
- return;
129
- }
130
- const from = ba.position ?? SEAM;
131
- const start = performance.now();
132
- const ease = (k) => k < 0.5 ? 4 * k * k * k : 1 - Math.pow(-2 * k + 2, 3) / 2;
133
- const step = (now) => {
134
- const k = Math.min(1, (now - start) / 450);
135
- ba.position = from + (to - from) * ease(k);
136
- if (k < 1) this.raf = requestAnimationFrame(step);
137
- };
138
- this.raf = requestAnimationFrame(step);
139
- }
140
- disconnectedCallback() {
141
- super.disconnectedCallback();
142
- cancelAnimationFrame(this.raf);
143
- }
144
- render() {
145
- const both = this.beforeSrc && this.afterSrc;
146
- const title = this.href ? html`<a href=${this.href}>${this.heading}</a>` : this.heading;
147
- const SIGN = { added: "+", removed: "\u2212", same: " " };
148
- const SAID = { added: say("Added"), removed: say("Removed"), same: say("Kept") };
149
- return html`<article part="card">
150
- ${both ? html`<div class="media" @pointerenter=${(e) => e.pointerType === "mouse" && this.wipe(0)} @pointerleave=${(e) => e.pointerType === "mouse" && this.wipe(SEAM)}><impakt-before-after .position=${SEAM} .beforeSrc=${this.beforeSrc} .beforeAlt=${this.beforeAlt} .afterSrc=${this.afterSrc} .afterAlt=${this.afterAlt} .beforeLabel=${say("Before")} .afterLabel=${say("Shipped")} .label=${say("Compare {name} before and after", { name: this.heading })}></impakt-before-after></div>` : this.afterSrc || this.beforeSrc ? html`<div class="media"><img src=${this.afterSrc || this.beforeSrc} alt=${this.afterSrc ? this.afterAlt : this.beforeAlt} loading="lazy" /></div>` : nothing}
151
- ${this.label ? html`<p class="meta mono">${this.label}</p>` : nothing}
152
- ${this.heading ? headingWith(this.headingLevel, title) : nothing}
153
- ${this.text ? html`<p class="body">${this.text}</p>` : nothing}
154
- ${(this.items ?? []).length ? html`<ul class="mono" part="diff">${this.items.map((line) => html`<li data-change=${line.change}><span class="sign" aria-hidden="true">${SIGN[line.change] ?? " "}</span><span><span class="sr-only">${SAID[line.change] ?? ""}: </span>${line.text}</span></li>`)}</ul>` : nothing}
155
- </article>`;
156
- }
157
- };
158
- var ImpaktReleaseList = class extends ImpaktElement {
159
- static {
160
- this.properties = {
161
- items: { type: Array },
162
- columns: { type: String, reflect: true },
163
- headingLevel: { type: Number, attribute: "heading-level" },
164
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
165
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
166
- };
167
- }
168
- constructor() {
169
- super();
170
- this.items = [];
171
- this.columns = "two";
172
- this.headingLevel = 3;
173
- this.spaceAbove = "none";
174
- this.spaceBelow = "none";
175
- }
176
- static {
177
- this.styles = [
178
- ...ImpaktElement.styles,
179
- spaceAround,
180
- css`
181
- :host { display: block; container-type: inline-size; }
182
- ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${space(12)} ${space(10)}; }
183
- :host([columns='one']) ul { grid-template-columns: minmax(0, 1fr); }
184
- :host([columns='three']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
185
- @container (max-width: 44rem) { ul, :host([columns='three']) ul { grid-template-columns: minmax(0, 1fr); } }
186
- `
187
- ];
188
- }
189
- render() {
190
- const here = typeof location === "undefined" ? "" : location.pathname.replace(/\/$/, "");
191
- const shown = (this.items ?? []).filter((item) => !item.href || item.href.replace(/\/$/, "") !== here);
192
- return html`<ul part="list">${shown.map((item) => {
193
- const heading2 = item.heading ?? item.title ?? "";
194
- return html`<li><impakt-release-card
195
- .label=${item.label ?? ""} .heading=${heading2} .text=${item.text ?? ""} .href=${item.href ?? ""}
196
- .beforeSrc=${item.beforeSrc ?? ""} .beforeAlt=${item.beforeAlt || say("{name} as a wireframe", { name: heading2 })}
197
- .afterSrc=${item.afterSrc ?? ""} .afterAlt=${item.afterAlt || say("{name} as it shipped", { name: heading2 })}
198
- .items=${item.items ?? []} .headingLevel=${this.headingLevel}></impakt-release-card></li>`;
199
- })}</ul>`;
200
- }
201
- };
202
- var SEAM = 42;
203
- function headingWith(level, content) {
204
- const l = Math.min(Math.max(level || 3, 2), 6);
205
- if (l === 2) return html`<h2 class="h">${content}</h2>`;
206
- if (l === 4) return html`<h4 class="h">${content}</h4>`;
207
- if (l === 5) return html`<h5 class="h">${content}</h5>`;
208
- if (l === 6) return html`<h6 class="h">${content}</h6>`;
209
- return html`<h3 class="h">${content}</h3>`;
210
- }
211
- var ImpaktBranchList = class extends ImpaktElement {
212
- constructor() {
213
- super();
214
- this.unwatch = () => void 0;
215
- this.items = [];
216
- this.trunk = "";
217
- this.look = "tones";
218
- this.current = -1;
219
- this.currentText = "";
220
- this.headingLevel = 3;
221
- this.spaceAbove = "none";
222
- this.spaceBelow = "none";
223
- }
224
- static {
225
- this.properties = {
226
- items: { type: Array },
227
- trunk: { type: String },
228
- look: { type: String, reflect: true },
229
- current: { type: Number },
230
- currentText: { type: String, attribute: "current-text" },
231
- headingLevel: { type: Number, attribute: "heading-level" },
232
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
233
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
234
- };
235
- }
236
- static {
237
- this.styles = [
238
- ...ImpaktElement.styles,
239
- spaceAround,
240
- mono,
241
- words,
242
- css`
243
- :host { display: block; container-type: inline-size; --trunk: color-mix(in srgb, currentColor 70%, transparent); }
244
- ul { list-style: none; margin: 0; padding: 0; position: relative; }
245
- ul::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 11px; inline-size: 3px; border-radius: 3px; background: var(--trunk); }
246
- li { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); padding-block: ${space(6)}; }
247
- .graph { position: relative; }
248
- .graph svg { position: absolute; inset-block-start: -${space(6)}; inset-inline-start: 0; inline-size: 96px; block-size: calc(100% + ${space(12)}); overflow: visible; }
249
- .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${space(4)} ${space(10)}; align-items: start; }
250
- .path { margin: 0 0 ${space(2)}; opacity: 0.72; }
251
- .h { font-size: ${fontSize("3xl")}; line-height: 1.05; }
252
- .h a { color: inherit; text-decoration: none; }
253
- .h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
254
- .h a:focus-visible { outline: none; box-shadow: ${t.focusShadow}; border-radius: ${t.radiusSm}; }
255
- .detail { display: flex; flex-direction: column; gap: ${space(3)}; padding-block-start: ${space(1)}; }
256
- .tags { margin: 0; opacity: 0.7; text-transform: uppercase; }
257
- .end { position: relative; display: flex; align-items: center; gap: ${space(3)}; padding-block-start: ${space(4)}; }
258
- .end::before { content: ''; inline-size: 16px; block-size: 16px; margin-inline-start: 5px; border-radius: 50%; background: currentColor; }
259
- @container (max-width: 44rem) {
260
- li { grid-template-columns: 56px minmax(0, 1fr); }
261
- .graph svg { inline-size: 56px; }
262
- .row { grid-template-columns: minmax(0, 1fr); }
263
- .h { font-size: ${fontSize("2xl")}; }
264
- }
265
- /*
266
- * The mono look, as the Branches component (12:683) draws it: rows 120px apart, a 1.5px trunk at 10px, and
267
- * each branch a fixed S-curve out to 60px by 28px down, straight to 78 and back by 110, so its shape does not
268
- * change with the row's height. The path and heading sit on the left and the line and tags in a 490px column
269
- * on the right, level with the path; a hairline closes each row 114px down. On a phone (14:989) the trunk is
270
- * at 8px, the branch reaches 40px and the words stack in one column.
271
- */
272
- :host([look='mono']) { --trunk: currentColor; }
273
- :host([look='mono']) ul::before { inset-inline-start: 10px; inline-size: 1.5px; border-radius: 0; }
274
- :host([look='mono']) li { grid-template-columns: 86px minmax(0, 1fr); padding-block: 24px 5px; }
275
- :host([look='mono']) .graph svg { inset-block-start: -24px; inline-size: 96px; block-size: 110px; }
276
- :host([look='mono']) .graph svg path { stroke-width: 1.5; }
277
- :host([look='mono']) .ring { position: absolute; inset-inline-start: 55px; inset-block-start: 20px; inline-size: 10px; block-size: 10px; box-sizing: border-box; border-radius: 50%; border: 1px solid currentColor; background: ${t.surfaceCard}; }
278
- :host([look='mono']) .ring.current { background: ${token("color.accent.default", "#ffd43b")}; }
279
- :host([look='mono']) .text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 490px); grid-template-areas: 'path detail' 'h detail'; grid-template-rows: auto 1fr; column-gap: ${space(10)}; align-content: start; padding-block-end: 20px; border-block-end: ${t.borderThin} solid ${t.rule}; }
280
- :host([look='mono']) .row { display: contents; }
281
- :host([look='mono']) .path { grid-area: path; margin: 0 0 4.6px; font-size: 0.6875rem; line-height: 1.4; letter-spacing: ${t.trackingWide}; text-transform: uppercase; opacity: 1; color: ${t.textMuted}; }
282
- :host([look='mono']) .h { grid-area: h; margin: 0; font-size: 2rem; line-height: 1.1; font-weight: ${fontWeight("semibold")}; letter-spacing: -0.03em; }
283
- :host([look='mono']) .detail { grid-area: detail; gap: 8px; padding: 0; }
284
- :host([look='mono']) .body { margin: 0; font-size: 1rem; line-height: 1.45; color: ${t.textMuted}; opacity: 1; }
285
- :host([look='mono']) .tags { font-size: 0.6875rem; line-height: 1.4; letter-spacing: ${t.trackingWide}; opacity: 1; color: ${t.textMuted}; }
286
- /* The main line's label sits 14px under the last rule and the block ends 17px under it, 520px for four rows (12:716). */
287
- :host([look='mono']) .end { gap: 0; margin: 0; padding-block: 8px 17px; font-size: 0.6875rem; line-height: 1.4; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; }
288
- /* The trunk runs on, unbroken, into its end dot, which sits on the trunk; the words line up with the rows' words. */
289
- :host([look='mono']) .end::before { flex: none; inline-size: 10px; block-size: 10px; margin-inline: 5.75px calc(86px - 15.75px); background: ${t.text}; }
290
- :host([look='mono']) .end::after { content: ''; position: absolute; inset-block-start: 0; inset-inline-start: 10px; inline-size: 1.5px; block-size: 15.7px; background: var(--trunk); }
291
- :host([look='mono']) li:last-child .graph svg { block-size: 110px; }
292
- @container (max-width: 44rem) {
293
- /* Set on the list, since a container query cannot restyle the container itself. */
294
- :host([look='mono']) ul::before { inset-inline-start: 8px; }
295
- :host([look='mono']) li { grid-template-columns: 60px minmax(0, 1fr); padding-block: 18px 5px; }
296
- :host([look='mono']) .graph svg { inset-block-start: -18px; inline-size: 60px; block-size: 132px; }
297
- :host([look='mono']) .ring { inset-inline-start: 35px; inset-block-start: 38px; }
298
- /* On a phone the rows are 150px apart whatever their words, as they are 120px apart on a wide screen (14:989). */
299
- :host([look='mono']) .text { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'path' 'h' 'detail'; box-sizing: border-box; min-block-size: 127px; padding-block-end: 12px; }
300
- :host([look='mono']) .h { font-size: 1.5rem; line-height: 1.15; }
301
- :host([look='mono']) .detail { margin-block-start: 6px; }
302
- :host([look='mono']) .body { font-size: 0.875rem; line-height: 1.43; }
303
- :host([look='mono']) .tags { display: none; }
304
- :host([look='mono']) .end { padding-block-end: 13px; }
305
- :host([look='mono']) .end::before { margin-inline: 3.75px calc(60px - 13.75px); }
306
- :host([look='mono']) .end::after { inset-inline-start: 8px; }
307
- }
308
- :host([look='mono']) .graph .narrow { display: none; }
309
- @container (max-width: 44rem) { :host([look='mono']) .graph .wide { display: none; } :host([look='mono']) .graph .narrow { display: inline; } }
310
- @media (forced-colors: active) { :host([look='mono']) .ring.current { background: Highlight; } }
311
- /* Branch draw: each branch opens down from the trunk, 120 ms after the one above, then its dot pops. */
312
- @media (prefers-reduced-motion: no-preference) {
313
- .graph svg { clip-path: inset(0 0 100% 0); transition: clip-path 700ms cubic-bezier(.25, 1, .5, 1) calc(var(--i, 0) * 120ms); }
314
- .graph circle, .ring { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 200ms ease-out calc(var(--i, 0) * 120ms + 500ms); }
315
- :host([shown]) .graph svg { clip-path: inset(0); }
316
- :host([shown]) .graph circle, :host([shown]) .ring { transform: scale(1); }
317
- }
318
- `
319
- ];
320
- }
321
- connectedCallback() {
322
- super.connectedCallback();
323
- this.unwatch = revealOnView(this);
324
- }
325
- disconnectedCallback() {
326
- super.disconnectedCallback();
327
- this.unwatch();
328
- }
329
- render() {
330
- const mono2 = this.look === "mono";
331
- const branch = (colour) => mono2 ? svg`<svg aria-hidden="true" focusable="false">
332
- <path class="wide" d="M10.75 0C10.75 16 60.75 6 60.75 28V78C60.75 100 10.75 92 10.75 110" fill="none" stroke=${colour} />
333
- <path class="narrow" d="M8.75 0C8.75 16 40.75 6 40.75 28V104C40.75 126 8.75 118 8.75 132" fill="none" stroke=${colour} />
334
- </svg>` : svg`<svg viewBox="0 0 96 200" preserveAspectRatio="none" aria-hidden="true" focusable="false">
335
- <path d="M12 0 C12 40 60 30 60 70 L60 120 C60 160 12 160 12 200" fill="none" stroke=${colour} stroke-width="3" vector-effect="non-scaling-stroke" />
336
- <circle cx="60" cy="86" r="8" fill=${colour} />
337
- </svg>`;
338
- return html`<ul part="list">${(this.items ?? []).map((item, i) => {
339
- const current = i === this.current;
340
- const words2 = html`${item.heading}${current && this.currentText ? html`<span class="sr-only"> (${this.currentText})</span>` : nothing}`;
341
- return html`<li part="item" style=${`--i:${i}`}>
342
- <div class="graph">${branch(mono2 ? "currentColor" : toneOf(item.tone, i))}${mono2 ? html`<span class=${current ? "ring current" : "ring"} aria-hidden="true"></span>` : nothing}</div>
343
- <div class="text">
344
- ${item.path ? html`<p class="path mono">${item.path}</p>` : nothing}
345
- <div class="row">
346
- ${heading(this.headingLevel, item.href ? html`<a href=${item.href}>${words2}</a>` : words2, "h")}
347
- <div class="detail">
348
- ${item.text ? html`<p class="body">${item.text}</p>` : nothing}
349
- ${item.tags?.length ? html`<p class="tags mono">${item.tags.join(" \xB7 ")}</p>` : nothing}
350
- </div>
351
- </div>
352
- </div>
353
- </li>`;
354
- })}</ul>
355
- ${this.trunk ? html`<p class="end mono" part="trunk">${this.trunk}</p>` : nothing}`;
356
- }
357
- };
358
- var ImpaktCheckList = class extends ImpaktElement {
359
- constructor() {
360
- super();
361
- this.unwatch = () => void 0;
362
- /** How far each figure has counted up, from 0 to 1, while the checks run. */
363
- this.counted = null;
364
- this.items = [];
365
- this.summary = "";
366
- this.spaceAbove = "none";
367
- this.spaceBelow = "none";
368
- }
369
- static {
370
- this.properties = {
371
- items: { type: Array },
372
- summary: { type: String },
373
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
374
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
375
- };
376
- }
377
- static {
378
- this.styles = [
379
- ...ImpaktElement.styles,
380
- spaceAround,
381
- mono,
382
- words,
383
- css`
384
- :host { display: block; container-type: inline-size; }
385
- .summary { display: inline-flex; align-items: center; gap: ${space(2)}; margin: 0 0 ${space(6)}; padding: ${space(1)} ${space(3)}; border-radius: ${t.radiusXl}; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
386
- .summary::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: ${t.success}; }
387
- /* The rows share one grid, so the figure column fits the widest figure and every row lines up. */
388
- ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 32px max-content minmax(0, 1fr) auto; column-gap: ${space(6)}; }
389
- li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding-block: ${space(5)}; border-block-end: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
390
- /* Checks run: each tick pops in, 150 ms after the one above. */
391
- @media (prefers-reduced-motion: no-preference) {
392
- .tick { transform: scale(0); transition: transform 600ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--i, 0) * 150ms); }
393
- :host([shown]) .tick { transform: scale(1); }
394
- }
395
- .sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
396
- /* A passed check is a filled disc with a tick cut out of it, as a CI run shows one. */
397
- .tick { display: inline-flex; align-items: center; justify-content: center; inline-size: 26px; block-size: 26px; border-radius: 50%; background: ${t.success}; color: var(--impakt-color-status-success-on, #fff); }
398
- .figure { margin: 0; font-family: ${t.fontHeading}; font-weight: ${fontWeight("bold")}; font-size: ${fontSize("5xl")}; line-height: 1; letter-spacing: ${t.trackingTight}; white-space: nowrap; }
399
- .label { margin: 0; ${type("xl")} }
400
- .status { margin: 0; opacity: 0.72; }
401
- @container (max-width: 40rem) {
402
- ul { grid-template-columns: 28px minmax(0, 1fr); }
403
- li { row-gap: ${space(1)}; }
404
- .label, .status { grid-column: 2; }
405
- .figure { font-size: ${fontSize("4xl")}; }
406
- }
407
- `
408
- ];
409
- }
410
- connectedCallback() {
411
- super.connectedCallback();
412
- this.unwatch = revealOnView(this, () => this.run());
413
- }
414
- disconnectedCallback() {
415
- super.disconnectedCallback();
416
- this.unwatch();
417
- }
418
- /** Checks run: each figure counts up over 1200 ms, 150 ms after the one above. */
419
- run() {
420
- if (reduced()) return;
421
- const items = this.items ?? [];
422
- const start = performance.now();
423
- const step = (now) => {
424
- this.counted = items.map((_, i) => Math.min(1, Math.max(0, (now - start - i * 150) / 1200)));
425
- this.requestUpdate();
426
- if (this.counted.some((k) => k < 1)) requestAnimationFrame(step);
427
- else this.counted = null;
428
- };
429
- requestAnimationFrame(step);
430
- }
431
- render() {
432
- const shownFigure = (figure, i) => {
433
- const k = this.counted?.[i];
434
- const m = /^(\d+)(.*)$/.exec(figure);
435
- if (k === void 0 || k >= 1 || !m) return html`${figure}`;
436
- const eased = 1 - Math.pow(1 - k, 3);
437
- return html`<span aria-hidden="true">${Math.round(Number(m[1]) * eased)}${m[2]}</span><span class="sr-only">${figure}</span>`;
438
- };
439
- return html`${this.summary ? html`<p class="summary mono" part="summary">${this.summary}</p>` : nothing}
440
- <ul part="list">${(this.items ?? []).map(
441
- (item, i) => html`<li part="item" style=${`--i:${i}`}>
442
- <span class="tick" aria-hidden="true">${iconSvg("check", "16px")}</span>
443
- <p class="figure">${shownFigure(item.figure, i)}</p>
444
- <p class="label">${item.label}</p>
445
- ${item.status ? html`<p class="status mono">${item.status}</p>` : html`<span></span>`}
446
- </li>`
447
- )}</ul>`;
448
- }
449
- };
450
- var ImpaktBranchTimeline = class extends ImpaktElement {
451
- constructor() {
452
- super();
453
- this.unwatch = () => void 0;
454
- this.lanes = [];
455
- this.marks = [];
456
- this.span = 20;
457
- this.unit = "";
458
- this.every = 2;
459
- this.release = "";
460
- this.releaseAt = 0;
461
- this.label = "";
462
- this.spaceAbove = "none";
463
- this.spaceBelow = "none";
464
- }
465
- static {
466
- this.properties = {
467
- lanes: { type: Array },
468
- marks: { type: Array },
469
- span: { type: Number },
470
- unit: { type: String },
471
- every: { type: Number },
472
- release: { type: String },
473
- releaseAt: { type: Number, attribute: "release-at" },
474
- label: { type: String },
475
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
476
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
477
- };
478
- }
479
- static {
480
- this.styles = [
481
- ...ImpaktElement.styles,
482
- focusRing,
483
- spaceAround,
484
- mono,
485
- words,
486
- css`
487
- :host { display: block; }
488
- /* On a narrow screen the graph scrolls sideways, so the scroller takes focus and the arrow keys move it (2.1.1). */
489
- figure { margin: 0; overflow-x: auto; border-radius: ${t.radiusSm}; }
490
- svg { display: block; inline-size: 100%; min-inline-size: 640px; block-size: auto; overflow: visible; }
491
- text { font-family: ${t.fontMono}; font-size: 12px; fill: currentColor; }
492
- .faint { opacity: 0.5; }
493
- /* A lane's label keeps a band of the page colour around it, so a line crossing it stays legible. */
494
- .halo { paint-order: stroke; stroke: var(--impakt-color-surface-card, #fff); stroke-width: 5px; stroke-linejoin: round; }
495
- /* Graph draw: the graph opens left to right, so each demo appears as the line reaches it. */
496
- @media (prefers-reduced-motion: no-preference) {
497
- svg { clip-path: inset(0 100% 0 0); transition: clip-path 1400ms cubic-bezier(.25, 1, .5, 1); }
498
- :host([shown]) svg { clip-path: inset(0 -40px 0 0); }
499
- }
500
- `
501
- ];
502
- }
503
- connectedCallback() {
504
- super.connectedCallback();
505
- this.unwatch = revealOnView(this);
506
- }
507
- disconnectedCallback() {
508
- super.disconnectedCallback();
509
- this.unwatch();
510
- }
511
- render() {
512
- const W = 1200;
513
- const left = 24;
514
- const right = W - 60;
515
- const span = this.span > 0 ? this.span : 20;
516
- const x = (v) => left + Math.min(Math.max(v, 0), span) / span * (right - left);
517
- const lanes = this.lanes ?? [];
518
- const rowH = 52;
519
- const H = 40 + (lanes.length + 1) * rowH + 40;
520
- const mainY = 40;
521
- const laneY = (i) => mainY + (i + 1) * rowH;
522
- const ticks = [];
523
- for (let v = 0; v <= span; v += Math.max(1, this.every || 2)) ticks.push(v);
524
- const laneOf = (at) => lanes.findIndex((l) => at >= l.from && at <= l.to);
525
- const marked = (i) => (this.marks ?? []).some((m) => laneOf(m.at) === i);
526
- const unit = this.unit || say("wk");
527
- const label = this.label || say("Project timeline");
528
- const described = lanes.map((l) => `${l.label}: ${say("{unit} {from} to {to}", { unit, from: l.from, to: l.to })}`).join("; ");
529
- return html`<figure part="figure" tabindex="0">
530
- <svg viewBox="0 0 ${W} ${H}" role="img" aria-label=${`${label}. ${described}${this.release ? `. ${say("{name} at {unit} {at}", { name: this.release, unit, at: this.releaseAt })}` : ""}`}>
531
- <line x1=${left} y1=${mainY} x2=${right + 40} y2=${mainY} stroke="currentColor" stroke-width="3" stroke-linecap="round" />
532
- <path d="M${right + 28} ${mainY - 7} L${right + 40} ${mainY} L${right + 28} ${mainY + 7}" fill="none" stroke="currentColor" stroke-width="3" />
533
- ${lanes.map((l, i) => {
534
- const c = toneOf(l.tone, i);
535
- const y = laneY(i);
536
- const a = x(l.from);
537
- const b = x(l.to);
538
- const bend = Math.min(36, (b - a) / 3);
539
- return svg`<g>
540
- <path d="M${a} ${mainY} C${a} ${(mainY + y) / 2} ${a + bend} ${y} ${a + bend * 1.6} ${y} L${b - bend * 1.6} ${y} C${b - bend} ${y} ${b} ${(mainY + y) / 2} ${b} ${mainY}" fill="none" stroke=${c} stroke-width="3" />
541
- <circle cx=${a} cy=${mainY} r="7" fill=${c} />
542
- <text x=${a + bend * 1.6} y=${marked(i) ? y - 10 : y + 20} class="halo" style=${`fill:${c}`}>${l.label}</text>
543
- </g>`;
544
- })}
545
- ${(this.marks ?? []).map((m) => {
546
- const i = laneOf(m.at);
547
- const y = i >= 0 ? laneY(i) : mainY;
548
- const c = i >= 0 ? toneOf(lanes[i].tone, i) : "currentColor";
549
- return svg`<g><circle cx=${x(m.at)} cy=${y} r="6" fill="var(--impakt-color-surface-card, #fff)" stroke=${c} stroke-width="3" /><text x=${x(m.at)} y=${y + 22} text-anchor="middle" class="faint">${m.label}</text></g>`;
550
- })}
551
- ${this.release ? svg`<g>
552
- <circle cx=${x(this.releaseAt)} cy=${mainY} r="10" fill=${TONE.success} />
553
- <rect x=${x(this.releaseAt) - 8} y=${mainY - 36} rx="4" width=${this.release.length * 7.6 + 16} height="22" fill=${TONE.success} />
554
- <text x=${x(this.releaseAt)} y=${mainY - 21} style="fill:var(--impakt-color-surface-card, #fff)">${this.release}</text>
555
- </g>` : nothing}
556
- ${ticks.map((v) => svg`<text x=${x(v)} y=${H - 10} text-anchor="middle" class="faint">${unit} ${v}</text>`)}
557
- </svg>
558
- </figure>`;
559
- }
560
- };
561
- customElements.define("impakt-release-card", ImpaktReleaseCard);
562
- customElements.define("impakt-release-list", ImpaktReleaseList);
563
- customElements.define("impakt-branch-list", ImpaktBranchList);
564
- customElements.define("impakt-check-list", ImpaktCheckList);
565
- customElements.define("impakt-branch-timeline", ImpaktBranchTimeline);
566
-
567
- export {
568
- ImpaktReleaseCard,
569
- ImpaktReleaseList,
570
- ImpaktBranchList,
571
- ImpaktCheckList,
572
- ImpaktBranchTimeline
573
- };
574
- //# sourceMappingURL=chunk-GZTBAT6P.js.map