@atomic-ui/ui 0.2.0 → 0.5.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.
- package/README.md +88 -105
- package/custom-elements.json +6370 -15469
- package/dist/base/FieldElement.d.ts +14 -3
- package/dist/base/{ImpktElement.d.ts → ImpaktElement.d.ts} +2 -2
- package/dist/base/scroll-lock.d.ts +2 -0
- package/dist/base/styles.d.ts +31 -5
- package/dist/base/tokens.d.ts +1 -1
- package/dist/base/tone.d.ts +20 -0
- package/dist/chunk-2YRTFWW2.js +26 -0
- package/dist/chunk-2YRTFWW2.js.map +1 -0
- package/dist/{chunk-7BSZPUE3.js → chunk-3EF4T242.js} +7 -7
- package/dist/chunk-3EF4T242.js.map +1 -0
- package/dist/{chunk-KFD4O7VA.js → chunk-5Y3HYRCU.js} +7 -7
- package/dist/chunk-5Y3HYRCU.js.map +1 -0
- package/dist/{chunk-7AJN2TIS.js → chunk-5ZQVL3V2.js} +29 -12
- package/dist/chunk-5ZQVL3V2.js.map +1 -0
- package/dist/{chunk-NCASAXQT.js → chunk-A7YBFS4H.js} +15 -15
- package/dist/chunk-A7YBFS4H.js.map +1 -0
- package/dist/{chunk-E2VBUWJ4.js → chunk-ACQ4KYPR.js} +9 -9
- package/dist/chunk-ACQ4KYPR.js.map +1 -0
- package/dist/{chunk-OMJMUFOW.js → chunk-DE3INTHZ.js} +6 -6
- package/dist/chunk-DE3INTHZ.js.map +1 -0
- package/dist/chunk-EJD6LT7E.js +161 -0
- package/dist/chunk-EJD6LT7E.js.map +1 -0
- package/dist/{chunk-XJXCTGDR.js → chunk-EJSX4WCD.js} +9 -9
- package/dist/chunk-EJSX4WCD.js.map +1 -0
- package/dist/chunk-FMSC7J7J.js +76 -0
- package/dist/chunk-FMSC7J7J.js.map +1 -0
- package/dist/{chunk-R67PDFKE.js → chunk-FWR6SEIA.js} +33 -33
- package/dist/chunk-FWR6SEIA.js.map +1 -0
- package/dist/{chunk-FFCIY7NM.js → chunk-GJPHQLLN.js} +8 -8
- package/dist/chunk-GJPHQLLN.js.map +1 -0
- package/dist/{chunk-OLLZFNO6.js → chunk-HNBG2POR.js} +7 -7
- package/dist/chunk-HNBG2POR.js.map +1 -0
- package/dist/{chunk-E3XJK7MY.js → chunk-HNZQ7LM4.js} +13 -11
- package/dist/chunk-HNZQ7LM4.js.map +1 -0
- package/dist/{chunk-3IQ73WNW.js → chunk-I54DOEZB.js} +9 -7
- package/dist/chunk-I54DOEZB.js.map +1 -0
- package/dist/{chunk-QB2KMV6S.js → chunk-PANH23MF.js} +12 -12
- package/dist/chunk-PANH23MF.js.map +1 -0
- package/dist/{chunk-UCHJCUYI.js → chunk-PYVUQNFQ.js} +39 -13
- package/dist/chunk-PYVUQNFQ.js.map +1 -0
- package/dist/{chunk-GQDUHZE3.js → chunk-Q54FX3SY.js} +8 -8
- package/dist/chunk-Q54FX3SY.js.map +1 -0
- package/dist/{chunk-WFKSOM6O.js → chunk-QBORJTS4.js} +68 -44
- package/dist/chunk-QBORJTS4.js.map +1 -0
- package/dist/{chunk-TGT7J4EG.js → chunk-RXX4CN5J.js} +7 -7
- package/dist/chunk-RXX4CN5J.js.map +1 -0
- package/dist/{chunk-XEJMFFIM.js → chunk-SV77SN6P.js} +8 -8
- package/dist/chunk-SV77SN6P.js.map +1 -0
- package/dist/chunk-TAZZLOUY.js +328 -0
- package/dist/chunk-TAZZLOUY.js.map +1 -0
- package/dist/{chunk-7OXTZJR4.js → chunk-TRZO5CHU.js} +7 -7
- package/dist/chunk-TRZO5CHU.js.map +1 -0
- package/dist/{chunk-EDSZI227.js → chunk-UPOTBKKK.js} +12 -9
- package/dist/chunk-UPOTBKKK.js.map +1 -0
- package/dist/{chunk-26O27BQS.js → chunk-WP5WJ4V5.js} +6 -6
- package/dist/chunk-WP5WJ4V5.js.map +1 -0
- package/dist/{chunk-YD6IZ2C5.js → chunk-WS5AUJ35.js} +7 -7
- package/dist/chunk-WS5AUJ35.js.map +1 -0
- package/dist/{chunk-HYPPG4NF.js → chunk-WWYYNR3Z.js} +93 -53
- package/dist/chunk-WWYYNR3Z.js.map +1 -0
- package/dist/{chunk-NKTMMJYD.js → chunk-XU2XODVH.js} +9 -8
- package/dist/chunk-XU2XODVH.js.map +1 -0
- package/dist/{chunk-D6C7XEY4.js → chunk-YR6T73GY.js} +24 -12
- package/dist/chunk-YR6T73GY.js.map +1 -0
- package/dist/{chunk-OB7WULFK.js → chunk-YYYQPKQ7.js} +24 -24
- package/dist/chunk-YYYQPKQ7.js.map +1 -0
- package/dist/{chunk-FJRHZA3C.js → chunk-Z45LY6BT.js} +9 -9
- package/dist/chunk-Z45LY6BT.js.map +1 -0
- package/dist/{chunk-6YYAOKNI.js → chunk-ZQBEFP2O.js} +7 -7
- package/dist/chunk-ZQBEFP2O.js.map +1 -0
- package/dist/chunk-ZS7RPXCT.js +47 -0
- package/dist/chunk-ZS7RPXCT.js.map +1 -0
- package/dist/components/accordion.d.ts +3 -3
- package/dist/components/accordion.js +4 -4
- package/dist/components/alert.d.ts +3 -3
- package/dist/components/alert.js +4 -4
- package/dist/components/app-ui.d.ts +47 -31
- package/dist/components/app-ui.js +21 -20
- package/dist/components/badge.d.ts +37 -0
- package/dist/components/badge.js +9 -0
- package/dist/components/blocks.d.ts +37 -74
- package/dist/components/blocks.js +10 -13
- package/dist/components/button.d.ts +3 -3
- package/dist/components/button.js +5 -5
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +5 -5
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +5 -5
- package/dist/components/chip.d.ts +58 -0
- package/dist/components/chip.js +8 -0
- package/dist/components/date-input.d.ts +2 -2
- package/dist/components/date-input.js +5 -5
- package/dist/components/dialog.d.ts +18 -3
- package/dist/components/dialog.js +5 -4
- package/dist/components/fieldset.d.ts +3 -3
- package/dist/components/fieldset.js +4 -4
- package/dist/components/grid.d.ts +3 -3
- package/dist/components/grid.js +4 -4
- package/dist/components/help.d.ts +3 -3
- package/dist/components/help.js +4 -4
- package/dist/components/icon.d.ts +3 -3
- package/dist/components/icon.js +4 -4
- package/dist/components/journey.d.ts +30 -16
- package/dist/components/journey.js +15 -15
- package/dist/components/layout.d.ts +9 -9
- package/dist/components/layout.js +10 -10
- package/dist/components/link.d.ts +3 -3
- package/dist/components/link.js +5 -5
- package/dist/components/list.d.ts +3 -3
- package/dist/components/list.js +4 -4
- package/dist/components/media.d.ts +8 -8
- package/dist/components/media.js +8 -8
- package/dist/components/navigation.d.ts +5 -5
- package/dist/components/navigation.js +7 -7
- package/dist/components/page.d.ts +5 -5
- package/dist/components/page.js +6 -6
- package/dist/components/price.d.ts +3 -3
- package/dist/components/price.js +4 -4
- package/dist/components/progress.d.ts +3 -3
- package/dist/components/progress.js +4 -4
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +5 -5
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +5 -5
- package/dist/components/summary-list.d.ts +3 -3
- package/dist/components/summary-list.js +4 -4
- package/dist/components/table.d.ts +97 -5
- package/dist/components/table.js +6 -4
- package/dist/components/text-input.d.ts +2 -2
- package/dist/components/text-input.js +5 -5
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +5 -5
- package/dist/index.d.ts +47 -40
- package/dist/index.js +206 -269
- package/dist/standalone/atomic-ui.js +1928 -0
- package/dist/standalone/atomic-ui.js.map +7 -0
- package/dist/standalone/index.html +173 -0
- package/package.json +19 -7
- package/scripts/copy-to-product.mjs +52 -0
- package/specimen/index.html +173 -0
- package/dist/chunk-26O27BQS.js.map +0 -1
- package/dist/chunk-2CFVV2NZ.js +0 -494
- package/dist/chunk-2CFVV2NZ.js.map +0 -1
- package/dist/chunk-3IQ73WNW.js.map +0 -1
- package/dist/chunk-4X723QBD.js +0 -361
- package/dist/chunk-4X723QBD.js.map +0 -1
- package/dist/chunk-6YYAOKNI.js.map +0 -1
- package/dist/chunk-7AJN2TIS.js.map +0 -1
- package/dist/chunk-7BSZPUE3.js.map +0 -1
- package/dist/chunk-7OXTZJR4.js.map +0 -1
- package/dist/chunk-7XEPNEVQ.js +0 -264
- package/dist/chunk-7XEPNEVQ.js.map +0 -1
- package/dist/chunk-D6C7XEY4.js.map +0 -1
- package/dist/chunk-E2VBUWJ4.js.map +0 -1
- package/dist/chunk-E3XJK7MY.js.map +0 -1
- package/dist/chunk-EDSZI227.js.map +0 -1
- package/dist/chunk-FFCIY7NM.js.map +0 -1
- package/dist/chunk-FJRHZA3C.js.map +0 -1
- package/dist/chunk-GQDUHZE3.js.map +0 -1
- package/dist/chunk-HYPPG4NF.js.map +0 -1
- package/dist/chunk-J4JULXUG.js +0 -249
- package/dist/chunk-J4JULXUG.js.map +0 -1
- package/dist/chunk-KFD4O7VA.js.map +0 -1
- package/dist/chunk-MVEFM5QI.js +0 -195
- package/dist/chunk-MVEFM5QI.js.map +0 -1
- package/dist/chunk-NCASAXQT.js.map +0 -1
- package/dist/chunk-NKTMMJYD.js.map +0 -1
- package/dist/chunk-OB7WULFK.js.map +0 -1
- package/dist/chunk-OHDPGIJ3.js +0 -428
- package/dist/chunk-OHDPGIJ3.js.map +0 -1
- package/dist/chunk-OLLZFNO6.js.map +0 -1
- package/dist/chunk-OMJMUFOW.js.map +0 -1
- package/dist/chunk-QB2KMV6S.js.map +0 -1
- package/dist/chunk-R67PDFKE.js.map +0 -1
- package/dist/chunk-RZSZQMSE.js +0 -236
- package/dist/chunk-RZSZQMSE.js.map +0 -1
- package/dist/chunk-TGT7J4EG.js.map +0 -1
- package/dist/chunk-UCHJCUYI.js.map +0 -1
- package/dist/chunk-UHLRXI6J.js +0 -453
- package/dist/chunk-UHLRXI6J.js.map +0 -1
- package/dist/chunk-UNVL3CNM.js +0 -725
- package/dist/chunk-UNVL3CNM.js.map +0 -1
- package/dist/chunk-WDDWWCHN.js +0 -104
- package/dist/chunk-WDDWWCHN.js.map +0 -1
- package/dist/chunk-WFKSOM6O.js.map +0 -1
- package/dist/chunk-XEJMFFIM.js.map +0 -1
- package/dist/chunk-XJXCTGDR.js.map +0 -1
- package/dist/chunk-YD6IZ2C5.js.map +0 -1
- package/dist/chunk-YK5QI57J.js +0 -396
- package/dist/chunk-YK5QI57J.js.map +0 -1
- package/dist/components/changelog.d.ts +0 -386
- package/dist/components/changelog.js +0 -25
- package/dist/components/estimator.d.ts +0 -246
- package/dist/components/estimator.js +0 -16
- package/dist/components/marketing.d.ts +0 -370
- package/dist/components/marketing.js +0 -21
- package/dist/components/marketing.js.map +0 -1
- package/dist/components/organisms.d.ts +0 -559
- package/dist/components/organisms.js +0 -25
- package/dist/components/organisms.js.map +0 -1
- package/dist/components/property.d.ts +0 -389
- package/dist/components/property.js +0 -20
- package/dist/components/property.js.map +0 -1
- package/dist/components/scene.d.ts +0 -138
- package/dist/components/scene.js +0 -8
- package/dist/components/scene.js.map +0 -1
- package/dist/components/scrubber.d.ts +0 -86
- package/dist/components/scrubber.js +0 -8
- package/dist/components/scrubber.js.map +0 -1
- package/dist/components/selling.d.ts +0 -407
- package/dist/components/selling.js +0 -25
- package/dist/components/selling.js.map +0 -1
- package/dist/components/site.d.ts +0 -283
- package/dist/components/site.js +0 -20
- package/dist/components/site.js.map +0 -1
- /package/dist/components/{changelog.js.map → badge.js.map} +0 -0
- /package/dist/components/{estimator.js.map → chip.js.map} +0 -0
package/dist/chunk-2CFVV2NZ.js
DELETED
|
@@ -1,494 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
iconSvg
|
|
3
|
-
} from "./chunk-KFD4O7VA.js";
|
|
4
|
-
import {
|
|
5
|
-
ImpktElement,
|
|
6
|
-
fontSize,
|
|
7
|
-
fontWeight,
|
|
8
|
-
say,
|
|
9
|
-
space,
|
|
10
|
-
spaceAround,
|
|
11
|
-
t,
|
|
12
|
-
type,
|
|
13
|
-
visuallyHidden
|
|
14
|
-
} from "./chunk-D6C7XEY4.js";
|
|
15
|
-
|
|
16
|
-
// packages/ui/src/components/changelog.ts
|
|
17
|
-
import { css, html, nothing, svg } from "lit";
|
|
18
|
-
var TONE = {
|
|
19
|
-
brand: "var(--impkt-color-brand-default, #1f4ed8)",
|
|
20
|
-
accent: "var(--impkt-color-accent-default, #c8a15a)",
|
|
21
|
-
info: "var(--impkt-color-status-info-default, #1f4ed8)",
|
|
22
|
-
success: "var(--impkt-color-status-success-default, #047857)",
|
|
23
|
-
warning: "var(--impkt-color-status-warning-default, #b45309)",
|
|
24
|
-
danger: "var(--impkt-color-status-danger-default, #c8102e)"
|
|
25
|
-
};
|
|
26
|
-
var CYCLE = ["success", "info", "warning", "accent", "danger", "brand"];
|
|
27
|
-
var toneOf = (tone, i) => {
|
|
28
|
-
if (typeof tone === "number") return `var(--impkt-color-chart-${tone}, ${TONE[CYCLE[(tone - 1) % CYCLE.length]]})`;
|
|
29
|
-
if (tone && tone in TONE) return TONE[tone];
|
|
30
|
-
return `var(--impkt-color-chart-${i % 5 + 1}, ${TONE[CYCLE[i % CYCLE.length]]})`;
|
|
31
|
-
};
|
|
32
|
-
function revealOnView(el, onShow) {
|
|
33
|
-
const show = () => {
|
|
34
|
-
el.setAttribute("shown", "");
|
|
35
|
-
onShow?.();
|
|
36
|
-
};
|
|
37
|
-
if (typeof IntersectionObserver !== "function") {
|
|
38
|
-
show();
|
|
39
|
-
return () => void 0;
|
|
40
|
-
}
|
|
41
|
-
const io = new IntersectionObserver((entries) => {
|
|
42
|
-
if (entries.some((e) => e.isIntersecting)) {
|
|
43
|
-
show();
|
|
44
|
-
io.disconnect();
|
|
45
|
-
}
|
|
46
|
-
}, { threshold: 0.25 });
|
|
47
|
-
io.observe(el);
|
|
48
|
-
return () => io.disconnect();
|
|
49
|
-
}
|
|
50
|
-
var reduced = () => typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
51
|
-
var mono = css`.mono { font-family: ${t.fontMono}; font-size: ${fontSize("xs")}; letter-spacing: 0.04em; }`;
|
|
52
|
-
var heading = (level, text, cls) => {
|
|
53
|
-
const l = Math.min(Math.max(level || 3, 2), 6);
|
|
54
|
-
switch (l) {
|
|
55
|
-
case 2:
|
|
56
|
-
return html`<h2 class=${cls}>${text}</h2>`;
|
|
57
|
-
case 4:
|
|
58
|
-
return html`<h4 class=${cls}>${text}</h4>`;
|
|
59
|
-
case 5:
|
|
60
|
-
return html`<h5 class=${cls}>${text}</h5>`;
|
|
61
|
-
case 6:
|
|
62
|
-
return html`<h6 class=${cls}>${text}</h6>`;
|
|
63
|
-
default:
|
|
64
|
-
return html`<h3 class=${cls}>${text}</h3>`;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
var words = css`
|
|
68
|
-
.h { margin: 0; color: var(--impkt-heading, ${t.textHeading}); font-family: ${t.fontHeading}; font-weight: ${fontWeight("bold")}; letter-spacing: ${t.trackingTight}; text-wrap: balance; }
|
|
69
|
-
.body { margin: 0; color: inherit; opacity: 0.8; text-wrap: pretty; }
|
|
70
|
-
.meta { margin: 0; color: inherit; opacity: 0.6; text-transform: uppercase; }
|
|
71
|
-
.sr-only { ${visuallyHidden} }
|
|
72
|
-
`;
|
|
73
|
-
var ImpktReleaseCard = class extends ImpktElement {
|
|
74
|
-
constructor() {
|
|
75
|
-
super();
|
|
76
|
-
this.raf = 0;
|
|
77
|
-
this.label = "";
|
|
78
|
-
this.heading = "";
|
|
79
|
-
this.text = "";
|
|
80
|
-
this.beforeSrc = "";
|
|
81
|
-
this.beforeAlt = "";
|
|
82
|
-
this.afterSrc = "";
|
|
83
|
-
this.afterAlt = "";
|
|
84
|
-
this.items = [];
|
|
85
|
-
this.href = "";
|
|
86
|
-
this.headingLevel = 3;
|
|
87
|
-
this.spaceAbove = "none";
|
|
88
|
-
this.spaceBelow = "none";
|
|
89
|
-
}
|
|
90
|
-
static {
|
|
91
|
-
this.properties = {
|
|
92
|
-
label: { type: String },
|
|
93
|
-
heading: { type: String },
|
|
94
|
-
text: { type: String },
|
|
95
|
-
beforeSrc: { type: String, attribute: "before-src" },
|
|
96
|
-
beforeAlt: { type: String, attribute: "before-alt" },
|
|
97
|
-
afterSrc: { type: String, attribute: "after-src" },
|
|
98
|
-
afterAlt: { type: String, attribute: "after-alt" },
|
|
99
|
-
items: { type: Array },
|
|
100
|
-
href: { type: String },
|
|
101
|
-
headingLevel: { type: Number, attribute: "heading-level" },
|
|
102
|
-
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
103
|
-
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
static {
|
|
107
|
-
this.styles = [...ImpktElement.styles, spaceAround, mono, words, css`
|
|
108
|
-
:host { display: block; }
|
|
109
|
-
article { display: flex; flex-direction: column; gap: ${space(3)}; }
|
|
110
|
-
.media { border-radius: ${t.radiusXl}; overflow: clip; background: ${t.surfaceInset}; }
|
|
111
|
-
.media img { display: block; inline-size: 100%; aspect-ratio: 5 / 3; object-fit: cover; }
|
|
112
|
-
impkt-before-after { display: block; }
|
|
113
|
-
.h { font-size: ${fontSize("3xl")}; }
|
|
114
|
-
.h a { color: inherit; text-decoration: none; }
|
|
115
|
-
.h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
|
|
116
|
-
.h a:focus-visible { outline: none; box-shadow: ${t.focusShadow}; border-radius: ${t.radiusSm}; }
|
|
117
|
-
ul { list-style: none; margin: ${space(1)} 0 0; padding: 0; display: grid; gap: ${space(1)}; }
|
|
118
|
-
li { display: grid; grid-template-columns: 1.25em minmax(0, 1fr); gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border-radius: ${t.radius}; }
|
|
119
|
-
li[data-change='added'] { background: ${t.successSubtle}; color: ${t.successText}; }
|
|
120
|
-
li[data-change='removed'] { background: ${t.dangerSubtle}; color: ${t.dangerText}; }
|
|
121
|
-
li[data-change='same'] { color: ${t.textMuted}; }
|
|
122
|
-
.sign { font-weight: ${fontWeight("bold")}; }
|
|
123
|
-
`];
|
|
124
|
-
}
|
|
125
|
-
/** Sweep the seam, as Commit's release wipe does: off the screenshot on hover, back on leaving. */
|
|
126
|
-
wipe(to) {
|
|
127
|
-
const ba = this.renderRoot.querySelector("impkt-before-after");
|
|
128
|
-
if (!ba) return;
|
|
129
|
-
cancelAnimationFrame(this.raf);
|
|
130
|
-
if (reduced()) {
|
|
131
|
-
ba.position = to;
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const from = ba.position ?? SEAM;
|
|
135
|
-
const start = performance.now();
|
|
136
|
-
const ease = (k) => k < 0.5 ? 4 * k * k * k : 1 - Math.pow(-2 * k + 2, 3) / 2;
|
|
137
|
-
const step = (now) => {
|
|
138
|
-
const k = Math.min(1, (now - start) / 450);
|
|
139
|
-
ba.position = from + (to - from) * ease(k);
|
|
140
|
-
if (k < 1) this.raf = requestAnimationFrame(step);
|
|
141
|
-
};
|
|
142
|
-
this.raf = requestAnimationFrame(step);
|
|
143
|
-
}
|
|
144
|
-
disconnectedCallback() {
|
|
145
|
-
super.disconnectedCallback();
|
|
146
|
-
cancelAnimationFrame(this.raf);
|
|
147
|
-
}
|
|
148
|
-
render() {
|
|
149
|
-
const both = this.beforeSrc && this.afterSrc;
|
|
150
|
-
const title = this.href ? html`<a href=${this.href}>${this.heading}</a>` : this.heading;
|
|
151
|
-
const SIGN = { added: "+", removed: "\u2212", same: " " };
|
|
152
|
-
const SAID = { added: say("Added"), removed: say("Removed"), same: say("Kept") };
|
|
153
|
-
return html`<article part="card">
|
|
154
|
-
${both ? html`<div class="media" @pointerenter=${(e) => e.pointerType === "mouse" && this.wipe(0)} @pointerleave=${(e) => e.pointerType === "mouse" && this.wipe(SEAM)}><impkt-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 })}></impkt-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}
|
|
155
|
-
${this.label ? html`<p class="meta mono">${this.label}</p>` : nothing}
|
|
156
|
-
${this.heading ? headingWith(this.headingLevel, title) : nothing}
|
|
157
|
-
${this.text ? html`<p class="body">${this.text}</p>` : nothing}
|
|
158
|
-
${(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}
|
|
159
|
-
</article>`;
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
var ImpktReleaseList = class extends ImpktElement {
|
|
163
|
-
static {
|
|
164
|
-
this.properties = {
|
|
165
|
-
items: { type: Array },
|
|
166
|
-
columns: { type: String, reflect: true },
|
|
167
|
-
headingLevel: { type: Number, attribute: "heading-level" },
|
|
168
|
-
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
169
|
-
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
constructor() {
|
|
173
|
-
super();
|
|
174
|
-
this.items = [];
|
|
175
|
-
this.columns = "two";
|
|
176
|
-
this.headingLevel = 3;
|
|
177
|
-
this.spaceAbove = "none";
|
|
178
|
-
this.spaceBelow = "none";
|
|
179
|
-
}
|
|
180
|
-
static {
|
|
181
|
-
this.styles = [...ImpktElement.styles, spaceAround, css`
|
|
182
|
-
:host { display: block; container-type: inline-size; }
|
|
183
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${space(12)} ${space(10)}; }
|
|
184
|
-
:host([columns='one']) ul { grid-template-columns: minmax(0, 1fr); }
|
|
185
|
-
:host([columns='three']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
186
|
-
@container (max-width: 44rem) { ul, :host([columns='three']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
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><impkt-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}></impkt-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 ImpktBranchList = class extends ImpktElement {
|
|
212
|
-
constructor() {
|
|
213
|
-
super();
|
|
214
|
-
this.unwatch = () => void 0;
|
|
215
|
-
this.items = [];
|
|
216
|
-
this.trunk = "";
|
|
217
|
-
this.headingLevel = 3;
|
|
218
|
-
this.spaceAbove = "none";
|
|
219
|
-
this.spaceBelow = "none";
|
|
220
|
-
}
|
|
221
|
-
static {
|
|
222
|
-
this.properties = {
|
|
223
|
-
items: { type: Array },
|
|
224
|
-
trunk: { type: String },
|
|
225
|
-
headingLevel: { type: Number, attribute: "heading-level" },
|
|
226
|
-
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
227
|
-
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
static {
|
|
231
|
-
this.styles = [...ImpktElement.styles, spaceAround, mono, words, css`
|
|
232
|
-
:host { display: block; container-type: inline-size; --trunk: color-mix(in srgb, currentColor 70%, transparent); }
|
|
233
|
-
ul { list-style: none; margin: 0; padding: 0; position: relative; }
|
|
234
|
-
ul::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 11px; inline-size: 3px; border-radius: 3px; background: var(--trunk); }
|
|
235
|
-
li { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); padding-block: ${space(6)}; }
|
|
236
|
-
.graph { position: relative; }
|
|
237
|
-
.graph svg { position: absolute; inset-block-start: -${space(6)}; inset-inline-start: 0; inline-size: 96px; block-size: calc(100% + ${space(12)}); overflow: visible; }
|
|
238
|
-
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${space(4)} ${space(10)}; align-items: start; }
|
|
239
|
-
.path { margin: 0 0 ${space(2)}; opacity: 0.6; }
|
|
240
|
-
.h { font-size: ${fontSize("3xl")}; line-height: 1.05; }
|
|
241
|
-
.h a { color: inherit; text-decoration: none; }
|
|
242
|
-
.h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
|
|
243
|
-
.h a:focus-visible { outline: none; box-shadow: ${t.focusShadow}; border-radius: ${t.radiusSm}; }
|
|
244
|
-
.detail { display: flex; flex-direction: column; gap: ${space(3)}; padding-block-start: ${space(1)}; }
|
|
245
|
-
.tags { margin: 0; opacity: 0.7; text-transform: uppercase; }
|
|
246
|
-
.end { position: relative; display: flex; align-items: center; gap: ${space(3)}; padding-block-start: ${space(4)}; }
|
|
247
|
-
.end::before { content: ''; inline-size: 16px; block-size: 16px; margin-inline-start: 5px; border-radius: 50%; background: currentColor; }
|
|
248
|
-
@container (max-width: 44rem) {
|
|
249
|
-
li { grid-template-columns: 56px minmax(0, 1fr); }
|
|
250
|
-
.graph svg { inline-size: 56px; }
|
|
251
|
-
.row { grid-template-columns: minmax(0, 1fr); }
|
|
252
|
-
.h { font-size: ${fontSize("2xl")}; }
|
|
253
|
-
}
|
|
254
|
-
/* Branch draw: each branch opens down from the trunk, 120 ms after the one above, then its dot pops. */
|
|
255
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
256
|
-
.graph svg { clip-path: inset(0 0 100% 0); transition: clip-path 700ms cubic-bezier(.25, 1, .5, 1) calc(var(--i, 0) * 120ms); }
|
|
257
|
-
.graph circle { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 200ms ease-out calc(var(--i, 0) * 120ms + 500ms); }
|
|
258
|
-
:host([shown]) .graph svg { clip-path: inset(0); }
|
|
259
|
-
:host([shown]) .graph circle { transform: scale(1); }
|
|
260
|
-
}
|
|
261
|
-
`];
|
|
262
|
-
}
|
|
263
|
-
connectedCallback() {
|
|
264
|
-
super.connectedCallback();
|
|
265
|
-
this.unwatch = revealOnView(this);
|
|
266
|
-
}
|
|
267
|
-
disconnectedCallback() {
|
|
268
|
-
super.disconnectedCallback();
|
|
269
|
-
this.unwatch();
|
|
270
|
-
}
|
|
271
|
-
render() {
|
|
272
|
-
const branch = (colour) => svg`<svg viewBox="0 0 96 200" preserveAspectRatio="none" aria-hidden="true" focusable="false">
|
|
273
|
-
<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" />
|
|
274
|
-
<circle cx="60" cy="86" r="8" fill=${colour} />
|
|
275
|
-
</svg>`;
|
|
276
|
-
return html`<ul part="list">${(this.items ?? []).map((item, i) => html`<li part="item" style=${`--i:${i}`}>
|
|
277
|
-
<div class="graph">${branch(toneOf(item.tone, i))}</div>
|
|
278
|
-
<div>
|
|
279
|
-
${item.path ? html`<p class="path mono">${item.path}</p>` : nothing}
|
|
280
|
-
<div class="row">
|
|
281
|
-
${heading(this.headingLevel, item.href ? html`<a href=${item.href}>${item.heading}</a>` : item.heading, "h")}
|
|
282
|
-
<div class="detail">
|
|
283
|
-
${item.text ? html`<p class="body">${item.text}</p>` : nothing}
|
|
284
|
-
${item.tags?.length ? html`<p class="tags mono">${item.tags.join(" \xB7 ")}</p>` : nothing}
|
|
285
|
-
</div>
|
|
286
|
-
</div>
|
|
287
|
-
</div>
|
|
288
|
-
</li>`)}</ul>
|
|
289
|
-
${this.trunk ? html`<p class="end mono" part="trunk">${this.trunk}</p>` : nothing}`;
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
var ImpktCheckList = class extends ImpktElement {
|
|
293
|
-
constructor() {
|
|
294
|
-
super();
|
|
295
|
-
this.unwatch = () => void 0;
|
|
296
|
-
/** How far each figure has counted up, from 0 to 1, while the checks run. */
|
|
297
|
-
this.counted = null;
|
|
298
|
-
this.items = [];
|
|
299
|
-
this.summary = "";
|
|
300
|
-
this.spaceAbove = "none";
|
|
301
|
-
this.spaceBelow = "none";
|
|
302
|
-
}
|
|
303
|
-
static {
|
|
304
|
-
this.properties = {
|
|
305
|
-
items: { type: Array },
|
|
306
|
-
summary: { type: String },
|
|
307
|
-
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
308
|
-
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
static {
|
|
312
|
-
this.styles = [...ImpktElement.styles, spaceAround, mono, words, css`
|
|
313
|
-
:host { display: block; container-type: inline-size; }
|
|
314
|
-
.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); }
|
|
315
|
-
.summary::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: ${t.success}; }
|
|
316
|
-
/* The rows share one grid, so the figure column fits the widest figure and every row lines up. */
|
|
317
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 32px max-content minmax(0, 1fr) auto; column-gap: ${space(6)}; }
|
|
318
|
-
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); }
|
|
319
|
-
/* Checks run: each tick pops in, 150 ms after the one above. */
|
|
320
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
321
|
-
.tick { transform: scale(0); transition: transform 600ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--i, 0) * 150ms); }
|
|
322
|
-
:host([shown]) .tick { transform: scale(1); }
|
|
323
|
-
}
|
|
324
|
-
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
325
|
-
/* A passed check is a filled disc with a tick cut out of it, as a CI run shows one. */
|
|
326
|
-
.tick { display: inline-flex; align-items: center; justify-content: center; inline-size: 26px; block-size: 26px; border-radius: 50%; background: ${t.success}; color: var(--impkt-color-status-success-on, #fff); }
|
|
327
|
-
.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; }
|
|
328
|
-
.label { margin: 0; ${type("xl")} }
|
|
329
|
-
.status { margin: 0; opacity: 0.6; }
|
|
330
|
-
@container (max-width: 40rem) {
|
|
331
|
-
ul { grid-template-columns: 28px minmax(0, 1fr); }
|
|
332
|
-
li { row-gap: ${space(1)}; }
|
|
333
|
-
.label, .status { grid-column: 2; }
|
|
334
|
-
.figure { font-size: ${fontSize("4xl")}; }
|
|
335
|
-
}
|
|
336
|
-
`];
|
|
337
|
-
}
|
|
338
|
-
connectedCallback() {
|
|
339
|
-
super.connectedCallback();
|
|
340
|
-
this.unwatch = revealOnView(this, () => this.run());
|
|
341
|
-
}
|
|
342
|
-
disconnectedCallback() {
|
|
343
|
-
super.disconnectedCallback();
|
|
344
|
-
this.unwatch();
|
|
345
|
-
}
|
|
346
|
-
/** Checks run: each figure counts up over 1200 ms, 150 ms after the one above. */
|
|
347
|
-
run() {
|
|
348
|
-
if (reduced()) return;
|
|
349
|
-
const items = this.items ?? [];
|
|
350
|
-
const start = performance.now();
|
|
351
|
-
const step = (now) => {
|
|
352
|
-
this.counted = items.map((_, i) => Math.min(1, Math.max(0, (now - start - i * 150) / 1200)));
|
|
353
|
-
this.requestUpdate();
|
|
354
|
-
if (this.counted.some((k) => k < 1)) requestAnimationFrame(step);
|
|
355
|
-
else this.counted = null;
|
|
356
|
-
};
|
|
357
|
-
requestAnimationFrame(step);
|
|
358
|
-
}
|
|
359
|
-
render() {
|
|
360
|
-
const shownFigure = (figure, i) => {
|
|
361
|
-
const k = this.counted?.[i];
|
|
362
|
-
const m = /^(\d+)(.*)$/.exec(figure);
|
|
363
|
-
if (k === void 0 || k >= 1 || !m) return html`${figure}`;
|
|
364
|
-
const eased = 1 - Math.pow(1 - k, 3);
|
|
365
|
-
return html`<span aria-hidden="true">${Math.round(Number(m[1]) * eased)}${m[2]}</span><span class="sr-only">${figure}</span>`;
|
|
366
|
-
};
|
|
367
|
-
return html`${this.summary ? html`<p class="summary mono" part="summary">${this.summary}</p>` : nothing}
|
|
368
|
-
<ul part="list">${(this.items ?? []).map((item, i) => html`<li part="item" style=${`--i:${i}`}>
|
|
369
|
-
<span class="tick" aria-hidden="true">${iconSvg("check", "16px")}</span>
|
|
370
|
-
<p class="figure">${shownFigure(item.figure, i)}</p>
|
|
371
|
-
<p class="label">${item.label}</p>
|
|
372
|
-
${item.status ? html`<p class="status mono">${item.status}</p>` : html`<span></span>`}
|
|
373
|
-
</li>`)}</ul>`;
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
var ImpktBranchTimeline = class extends ImpktElement {
|
|
377
|
-
constructor() {
|
|
378
|
-
super();
|
|
379
|
-
this.unwatch = () => void 0;
|
|
380
|
-
this.lanes = [];
|
|
381
|
-
this.marks = [];
|
|
382
|
-
this.span = 20;
|
|
383
|
-
this.unit = "";
|
|
384
|
-
this.every = 2;
|
|
385
|
-
this.release = "";
|
|
386
|
-
this.releaseAt = 0;
|
|
387
|
-
this.label = "";
|
|
388
|
-
this.spaceAbove = "none";
|
|
389
|
-
this.spaceBelow = "none";
|
|
390
|
-
}
|
|
391
|
-
static {
|
|
392
|
-
this.properties = {
|
|
393
|
-
lanes: { type: Array },
|
|
394
|
-
marks: { type: Array },
|
|
395
|
-
span: { type: Number },
|
|
396
|
-
unit: { type: String },
|
|
397
|
-
every: { type: Number },
|
|
398
|
-
release: { type: String },
|
|
399
|
-
releaseAt: { type: Number, attribute: "release-at" },
|
|
400
|
-
label: { type: String },
|
|
401
|
-
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
402
|
-
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
static {
|
|
406
|
-
this.styles = [...ImpktElement.styles, spaceAround, mono, words, css`
|
|
407
|
-
:host { display: block; overflow-x: auto; }
|
|
408
|
-
svg { display: block; inline-size: 100%; min-inline-size: 640px; block-size: auto; overflow: visible; }
|
|
409
|
-
text { font-family: ${t.fontMono}; font-size: 12px; fill: currentColor; }
|
|
410
|
-
.faint { opacity: 0.5; }
|
|
411
|
-
/* A lane's label keeps a band of the page colour around it, so a line crossing it stays legible. */
|
|
412
|
-
.halo { paint-order: stroke; stroke: var(--impkt-color-surface-card, #fff); stroke-width: 5px; stroke-linejoin: round; }
|
|
413
|
-
/* Graph draw: the graph opens left to right, so each demo appears as the line reaches it. */
|
|
414
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
415
|
-
svg { clip-path: inset(0 100% 0 0); transition: clip-path 1400ms cubic-bezier(.25, 1, .5, 1); }
|
|
416
|
-
:host([shown]) svg { clip-path: inset(0 -40px 0 0); }
|
|
417
|
-
}
|
|
418
|
-
`];
|
|
419
|
-
}
|
|
420
|
-
connectedCallback() {
|
|
421
|
-
super.connectedCallback();
|
|
422
|
-
this.unwatch = revealOnView(this);
|
|
423
|
-
}
|
|
424
|
-
disconnectedCallback() {
|
|
425
|
-
super.disconnectedCallback();
|
|
426
|
-
this.unwatch();
|
|
427
|
-
}
|
|
428
|
-
render() {
|
|
429
|
-
const W = 1200;
|
|
430
|
-
const left = 24;
|
|
431
|
-
const right = W - 60;
|
|
432
|
-
const span = this.span > 0 ? this.span : 20;
|
|
433
|
-
const x = (v) => left + Math.min(Math.max(v, 0), span) / span * (right - left);
|
|
434
|
-
const lanes = this.lanes ?? [];
|
|
435
|
-
const rowH = 52;
|
|
436
|
-
const H = 40 + (lanes.length + 1) * rowH + 40;
|
|
437
|
-
const mainY = 40;
|
|
438
|
-
const laneY = (i) => mainY + (i + 1) * rowH;
|
|
439
|
-
const ticks = [];
|
|
440
|
-
for (let v = 0; v <= span; v += Math.max(1, this.every || 2)) ticks.push(v);
|
|
441
|
-
const laneOf = (at) => lanes.findIndex((l) => at >= l.from && at <= l.to);
|
|
442
|
-
const marked = (i) => (this.marks ?? []).some((m) => laneOf(m.at) === i);
|
|
443
|
-
const unit = this.unit || say("wk");
|
|
444
|
-
const label = this.label || say("Project timeline");
|
|
445
|
-
const described = lanes.map((l) => `${l.label}: ${say("{unit} {from} to {to}", { unit, from: l.from, to: l.to })}`).join("; ");
|
|
446
|
-
return html`<figure part="figure" style="margin:0">
|
|
447
|
-
<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 })}` : ""}`}>
|
|
448
|
-
<line x1=${left} y1=${mainY} x2=${right + 40} y2=${mainY} stroke="currentColor" stroke-width="3" stroke-linecap="round" />
|
|
449
|
-
<path d="M${right + 28} ${mainY - 7} L${right + 40} ${mainY} L${right + 28} ${mainY + 7}" fill="none" stroke="currentColor" stroke-width="3" />
|
|
450
|
-
${lanes.map((l, i) => {
|
|
451
|
-
const c = toneOf(l.tone, i);
|
|
452
|
-
const y = laneY(i);
|
|
453
|
-
const a = x(l.from);
|
|
454
|
-
const b = x(l.to);
|
|
455
|
-
const bend = Math.min(36, (b - a) / 3);
|
|
456
|
-
return svg`<g>
|
|
457
|
-
<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" />
|
|
458
|
-
<circle cx=${a} cy=${mainY} r="7" fill=${c} />
|
|
459
|
-
<text x=${a + bend * 1.6} y=${marked(i) ? y - 10 : y + 20} class="halo" style=${`fill:${c}`}>${l.label}</text>
|
|
460
|
-
</g>`;
|
|
461
|
-
})}
|
|
462
|
-
${(this.marks ?? []).map((m) => {
|
|
463
|
-
const i = laneOf(m.at);
|
|
464
|
-
const y = i >= 0 ? laneY(i) : mainY;
|
|
465
|
-
const c = i >= 0 ? toneOf(lanes[i].tone, i) : "currentColor";
|
|
466
|
-
return svg`<g><circle cx=${x(m.at)} cy=${y} r="6" fill="var(--impkt-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>`;
|
|
467
|
-
})}
|
|
468
|
-
${this.release ? svg`<g>
|
|
469
|
-
<circle cx=${x(this.releaseAt)} cy=${mainY} r="10" fill=${TONE.success} />
|
|
470
|
-
<rect x=${x(this.releaseAt) - 8} y=${mainY - 36} rx="4" width=${this.release.length * 7.6 + 16} height="22" fill=${TONE.success} />
|
|
471
|
-
<text x=${x(this.releaseAt)} y=${mainY - 21} style="fill:var(--impkt-color-surface-card, #fff)">${this.release}</text>
|
|
472
|
-
</g>` : nothing}
|
|
473
|
-
${ticks.map((v) => svg`<text x=${x(v)} y=${H - 10} text-anchor="middle" class="faint">${unit} ${v}</text>`)}
|
|
474
|
-
</svg>
|
|
475
|
-
</figure>`;
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
customElements.define("impkt-release-card", ImpktReleaseCard);
|
|
479
|
-
customElements.define("impkt-release-list", ImpktReleaseList);
|
|
480
|
-
customElements.define("impkt-branch-list", ImpktBranchList);
|
|
481
|
-
customElements.define("impkt-check-list", ImpktCheckList);
|
|
482
|
-
customElements.define("impkt-branch-timeline", ImpktBranchTimeline);
|
|
483
|
-
|
|
484
|
-
export {
|
|
485
|
-
TONE,
|
|
486
|
-
CYCLE,
|
|
487
|
-
toneOf,
|
|
488
|
-
ImpktReleaseCard,
|
|
489
|
-
ImpktReleaseList,
|
|
490
|
-
ImpktBranchList,
|
|
491
|
-
ImpktCheckList,
|
|
492
|
-
ImpktBranchTimeline
|
|
493
|
-
};
|
|
494
|
-
//# sourceMappingURL=chunk-2CFVV2NZ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/changelog.ts"],"sourcesContent":["/**\n * Blocks that tell how software was made, in the language software is made\n * in: a release with what it added and removed, services as branches that\n * merge into one product, checks that passed, and a project drawn as a commit\n * graph. They came from building the Impkt site's Commit design in Strata, and\n * they are written for any studio, agency or product team that wants to show\n * its work this way.\n *\n * Every colour is a brand token. A lane's colour is a tone (brand, accent or\n * a status colour), never a hex value, so a partner's brand restyles them.\n */\nimport { css, html, nothing, svg, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, spaceAround, t, type } from '../base/tokens';\nimport { iconSvg } from './icon';\nimport './property';\n\n/** A colour for a line or a lane, named by what it is in the brand. */\ntype NamedTone = 'brand' | 'accent' | 'info' | 'success' | 'warning' | 'danger';\n/** A named tone, or 1 to 5 for the brand's chart colours in order. */\nexport type Tone = NamedTone | 1 | 2 | 3 | 4 | 5;\nexport const TONE: Record<NamedTone, string> = {\n brand: 'var(--impkt-color-brand-default, #1f4ed8)',\n accent: 'var(--impkt-color-accent-default, #c8a15a)',\n info: 'var(--impkt-color-status-info-default, #1f4ed8)',\n success: 'var(--impkt-color-status-success-default, #047857)',\n warning: 'var(--impkt-color-status-warning-default, #b45309)',\n danger: 'var(--impkt-color-status-danger-default, #c8102e)',\n};\n/** When an item names no tone, lanes take these in turn. */\nexport const CYCLE: NamedTone[] = ['success', 'info', 'warning', 'accent', 'danger', 'brand'];\n/**\n * A named tone, or for an item that names none, the brand's chart colour for its\n * place (color.chart.1 to 5), falling back to the status colours in turn.\n */\nexport const toneOf = (tone: Tone | undefined, i: number): string => {\n if (typeof tone === 'number') return `var(--impkt-color-chart-${tone}, ${TONE[CYCLE[(tone - 1) % CYCLE.length]!]})`;\n if (tone && tone in TONE) return TONE[tone];\n return `var(--impkt-color-chart-${(i % 5) + 1}, ${TONE[CYCLE[i % CYCLE.length]!]})`;\n};\n\n/**\n * Marks an element `shown` once a quarter of it is on screen, so it can draw\n * itself in (the Commit motion spec's branch draw, graph draw and checks run).\n * Where nothing can watch, it is shown at once; what draws in is decided by\n * CSS under `prefers-reduced-motion: no-preference`, so reduced motion never waits.\n */\nfunction revealOnView(el: HTMLElement, onShow?: () => void): () => void {\n const show = () => { el.setAttribute('shown', ''); onShow?.(); };\n if (typeof IntersectionObserver !== 'function') { show(); return () => undefined; }\n const io = new IntersectionObserver((entries) => {\n if (entries.some((e) => e.isIntersecting)) { show(); io.disconnect(); }\n }, { threshold: 0.25 });\n io.observe(el);\n return () => io.disconnect();\n}\nconst reduced = () => typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;\n\n/** Code-like labels: a branch name, a version, a hash. The brand has no code face, so the system's is used. */\nconst mono = css`.mono { font-family: ${t.fontMono}; font-size: ${fontSize('xs')}; letter-spacing: 0.04em; }`;\n\nconst heading = (level: number, text: string | TemplateResult, cls: string): TemplateResult => {\n const l = Math.min(Math.max(level || 3, 2), 6);\n switch (l) {\n case 2: return html`<h2 class=${cls}>${text}</h2>`;\n case 4: return html`<h4 class=${cls}>${text}</h4>`;\n case 5: return html`<h5 class=${cls}>${text}</h5>`;\n case 6: return html`<h6 class=${cls}>${text}</h6>`;\n default: return html`<h3 class=${cls}>${text}</h3>`;\n }\n};\n\nconst words = css`\n .h { margin: 0; color: var(--impkt-heading, ${t.textHeading}); font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; letter-spacing: ${t.trackingTight}; text-wrap: balance; }\n .body { margin: 0; color: inherit; opacity: 0.8; text-wrap: pretty; }\n .meta { margin: 0; color: inherit; opacity: 0.6; text-transform: uppercase; }\n .sr-only { ${visuallyHidden} }\n`;\n\n// ── Release card ─────────────────────────────────────────────────────────\n\n/** One line of what a release changed. */\nexport interface DiffLine {\n id?: string;\n /** Added, taken away, or kept as it was. */\n change: 'added' | 'removed' | 'same';\n text: string;\n}\n\n/**\n * A piece of work told as a release: what it looked like when it started and\n * what shipped, a version line, and a short diff of what it added and took\n * away.\n *\n * With both pictures it is a before-and-after comparison a visitor drags; with\n * one it is a picture. The diff is a list, each line saying \"Added\" or\n * \"Removed\" for a screen reader, since the + and − are only drawn.\n *\n * @category content\n * @icon git-commit\n */\nexport class ImpktReleaseCard extends ImpktElement {\n static properties = {\n label: { type: String },\n heading: { type: String },\n text: { type: String },\n beforeSrc: { type: String, attribute: 'before-src' },\n beforeAlt: { type: String, attribute: 'before-alt' },\n afterSrc: { type: String, attribute: 'after-src' },\n afterAlt: { type: String, attribute: 'after-alt' },\n items: { type: Array },\n href: { type: String },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** A line above the heading, such as \"v1.0 · Legal tech · Property\". */\n declare label: string;\n declare heading: string;\n declare text: string;\n /** What it started as: a sketch or a wireframe. */\n declare beforeSrc: string;\n declare beforeAlt: string;\n /** What shipped. */\n declare afterSrc: string;\n declare afterAlt: string;\n /** What the release added, took away or kept. */\n declare items: DiffLine[];\n /** Where the heading links to, such as the case study. */\n declare href: string;\n declare headingLevel: 2 | 3 | 4;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.label = '';\n this.heading = '';\n this.text = '';\n this.beforeSrc = '';\n this.beforeAlt = '';\n this.afterSrc = '';\n this.afterAlt = '';\n this.items = [];\n this.href = '';\n this.headingLevel = 3;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, mono, words, css`\n :host { display: block; }\n article { display: flex; flex-direction: column; gap: ${space(3)}; }\n .media { border-radius: ${t.radiusXl}; overflow: clip; background: ${t.surfaceInset}; }\n .media img { display: block; inline-size: 100%; aspect-ratio: 5 / 3; object-fit: cover; }\n impkt-before-after { display: block; }\n .h { font-size: ${fontSize('3xl')}; }\n .h a { color: inherit; text-decoration: none; }\n .h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }\n .h a:focus-visible { outline: none; box-shadow: ${t.focusShadow}; border-radius: ${t.radiusSm}; }\n ul { list-style: none; margin: ${space(1)} 0 0; padding: 0; display: grid; gap: ${space(1)}; }\n li { display: grid; grid-template-columns: 1.25em minmax(0, 1fr); gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border-radius: ${t.radius}; }\n li[data-change='added'] { background: ${t.successSubtle}; color: ${t.successText}; }\n li[data-change='removed'] { background: ${t.dangerSubtle}; color: ${t.dangerText}; }\n li[data-change='same'] { color: ${t.textMuted}; }\n .sign { font-weight: ${fontWeight('bold')}; }\n `];\n\n private raf = 0;\n\n /** Sweep the seam, as Commit's release wipe does: off the screenshot on hover, back on leaving. */\n private wipe(to: number): void {\n const ba = this.renderRoot.querySelector('impkt-before-after') as (HTMLElement & { position: number }) | null;\n if (!ba) return;\n cancelAnimationFrame(this.raf);\n if (reduced()) { ba.position = to; return; }\n const from = ba.position ?? SEAM;\n const start = performance.now();\n // cubic-bezier(.65, 0, .35, 1), near enough: an ease-in-out.\n const ease = (k: number) => (k < 0.5 ? 4 * k * k * k : 1 - Math.pow(-2 * k + 2, 3) / 2);\n const step = (now: number) => {\n const k = Math.min(1, (now - start) / 450);\n ba.position = from + (to - from) * ease(k);\n if (k < 1) this.raf = requestAnimationFrame(step);\n };\n this.raf = requestAnimationFrame(step);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n cancelAnimationFrame(this.raf);\n }\n\n render(): TemplateResult {\n const both = this.beforeSrc && this.afterSrc;\n const title = this.href ? html`<a href=${this.href}>${this.heading}</a>` : this.heading;\n const SIGN = { added: '+', removed: '−', same: ' ' } as const;\n const SAID = { added: say('Added'), removed: say('Removed'), same: say('Kept') } as const;\n return html`<article part=\"card\">\n ${both\n ? html`<div class=\"media\" @pointerenter=${(e: PointerEvent) => e.pointerType === 'mouse' && this.wipe(0)} @pointerleave=${(e: PointerEvent) => e.pointerType === 'mouse' && this.wipe(SEAM)}><impkt-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 })}></impkt-before-after></div>`\n : this.afterSrc || this.beforeSrc\n ? html`<div class=\"media\"><img src=${this.afterSrc || this.beforeSrc} alt=${this.afterSrc ? this.afterAlt : this.beforeAlt} loading=\"lazy\" /></div>`\n : nothing}\n ${this.label ? html`<p class=\"meta mono\">${this.label}</p>` : nothing}\n ${this.heading ? headingWith(this.headingLevel, title) : nothing}\n ${this.text ? html`<p class=\"body\">${this.text}</p>` : nothing}\n ${(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}\n </article>`;\n }\n}\n\n// ── Release list ─────────────────────────────────────────────────────────\n\n/**\n * One release in a list: a release card's props. `title` is read when there is\n * no `heading`, because that is what a collection's entry carries (ADR 0028).\n */\nexport interface ReleaseItem {\n label?: string;\n heading?: string;\n title?: string;\n text?: string;\n beforeSrc?: string;\n beforeAlt?: string;\n afterSrc?: string;\n afterAlt?: string;\n items?: DiffLine[];\n href?: string;\n}\n\n/**\n * Releases side by side, two to a row: a changelog of case studies.\n *\n * Bind `items` to a collection's entries and the list follows them: a new case\n * study appears here when it is published. The release for the page being\n * read is left out, so a case study's \"more work\" does not offer itself.\n *\n * @category content\n * @icon git-commit\n */\nexport class ImpktReleaseList extends ImpktElement {\n static properties = {\n items: { type: Array },\n columns: { type: String, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare items: ReleaseItem[];\n /** Releases in a row on a wide screen. One on a phone. */\n declare columns: 'one' | 'two' | 'three';\n declare headingLevel: 2 | 3 | 4;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.items = [];\n this.columns = 'two';\n this.headingLevel = 3;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, css`\n :host { display: block; container-type: inline-size; }\n ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${space(12)} ${space(10)}; }\n :host([columns='one']) ul { grid-template-columns: minmax(0, 1fr); }\n :host([columns='three']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n @container (max-width: 44rem) { ul, :host([columns='three']) ul { grid-template-columns: minmax(0, 1fr); } }\n `];\n\n render(): TemplateResult {\n const here = typeof location === 'undefined' ? '' : location.pathname.replace(/\\/$/, '');\n const shown = (this.items ?? []).filter((item) => !item.href || item.href.replace(/\\/$/, '') !== here);\n return html`<ul part=\"list\">${shown.map((item) => {\n const heading = item.heading ?? item.title ?? '';\n return html`<li><impkt-release-card\n .label=${item.label ?? ''} .heading=${heading} .text=${item.text ?? ''} .href=${item.href ?? ''}\n .beforeSrc=${item.beforeSrc ?? ''} .beforeAlt=${item.beforeAlt || say('{name} as a wireframe', { name: heading })}\n .afterSrc=${item.afterSrc ?? ''} .afterAlt=${item.afterAlt || say('{name} as it shipped', { name: heading })}\n .items=${item.items ?? []} .headingLevel=${this.headingLevel}></impkt-release-card></li>`;\n })}</ul>`;\n }\n}\n\n/** Where the seam rests: the wireframe covers the left of the screenshot until it is pointed at. */\nconst SEAM = 42;\n\n/** A heading holding a template, such as a link. */\nfunction headingWith(level: number, content: TemplateResult | string): TemplateResult {\n const l = Math.min(Math.max(level || 3, 2), 6);\n if (l === 2) return html`<h2 class=\"h\">${content}</h2>`;\n if (l === 4) return html`<h4 class=\"h\">${content}</h4>`;\n if (l === 5) return html`<h5 class=\"h\">${content}</h5>`;\n if (l === 6) return html`<h6 class=\"h\">${content}</h6>`;\n return html`<h3 class=\"h\">${content}</h3>`;\n}\n\n// ── Branch list ──────────────────────────────────────────────────────────\n\n/** One branch: a service, a team, a line of work. */\nexport interface Branch {\n id?: string;\n /** A short code-like name, such as \"feature/mobile-apps\". */\n path?: string;\n heading: string;\n text?: string;\n /** A few words below the text, such as the tools it uses. */\n tags?: string[];\n tone?: Tone;\n /** Where the heading links to, such as the service's own page. */\n href?: string;\n}\n\n/**\n * Several lines of work that come together into one: each item branches off a\n * main line on the left and merges back into it, and the line ends in what\n * they make together.\n *\n * The lines are drawn; the items are a list with headings, so a screen reader\n * reads the work, not the drawing.\n *\n * @category content\n * @icon git-merge\n */\nexport class ImpktBranchList extends ImpktElement {\n static properties = {\n items: { type: Array },\n trunk: { type: String },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare items: Branch[];\n /** What the main line ends in, such as \"main ← one team owns the result\". */\n declare trunk: string;\n declare headingLevel: 2 | 3 | 4;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.items = [];\n this.trunk = '';\n this.headingLevel = 3;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, mono, words, css`\n :host { display: block; container-type: inline-size; --trunk: color-mix(in srgb, currentColor 70%, transparent); }\n ul { list-style: none; margin: 0; padding: 0; position: relative; }\n ul::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 11px; inline-size: 3px; border-radius: 3px; background: var(--trunk); }\n li { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); padding-block: ${space(6)}; }\n .graph { position: relative; }\n .graph svg { position: absolute; inset-block-start: -${space(6)}; inset-inline-start: 0; inline-size: 96px; block-size: calc(100% + ${space(12)}); overflow: visible; }\n .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${space(4)} ${space(10)}; align-items: start; }\n .path { margin: 0 0 ${space(2)}; opacity: 0.6; }\n .h { font-size: ${fontSize('3xl')}; line-height: 1.05; }\n .h a { color: inherit; text-decoration: none; }\n .h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }\n .h a:focus-visible { outline: none; box-shadow: ${t.focusShadow}; border-radius: ${t.radiusSm}; }\n .detail { display: flex; flex-direction: column; gap: ${space(3)}; padding-block-start: ${space(1)}; }\n .tags { margin: 0; opacity: 0.7; text-transform: uppercase; }\n .end { position: relative; display: flex; align-items: center; gap: ${space(3)}; padding-block-start: ${space(4)}; }\n .end::before { content: ''; inline-size: 16px; block-size: 16px; margin-inline-start: 5px; border-radius: 50%; background: currentColor; }\n @container (max-width: 44rem) {\n li { grid-template-columns: 56px minmax(0, 1fr); }\n .graph svg { inline-size: 56px; }\n .row { grid-template-columns: minmax(0, 1fr); }\n .h { font-size: ${fontSize('2xl')}; }\n }\n /* Branch draw: each branch opens down from the trunk, 120 ms after the one above, then its dot pops. */\n @media (prefers-reduced-motion: no-preference) {\n .graph svg { clip-path: inset(0 0 100% 0); transition: clip-path 700ms cubic-bezier(.25, 1, .5, 1) calc(var(--i, 0) * 120ms); }\n .graph circle { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 200ms ease-out calc(var(--i, 0) * 120ms + 500ms); }\n :host([shown]) .graph svg { clip-path: inset(0); }\n :host([shown]) .graph circle { transform: scale(1); }\n }\n `];\n\n private unwatch: () => void = () => undefined;\n connectedCallback(): void { super.connectedCallback(); this.unwatch = revealOnView(this); }\n disconnectedCallback(): void { super.disconnectedCallback(); this.unwatch(); }\n\n render(): TemplateResult {\n // Each branch leaves the trunk, swings out to its dot level with the\n // heading, and returns: drawn in a 96-wide box, scaled down on phones.\n const branch = (colour: string) => svg`<svg viewBox=\"0 0 96 200\" preserveAspectRatio=\"none\" aria-hidden=\"true\" focusable=\"false\">\n <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\" />\n <circle cx=\"60\" cy=\"86\" r=\"8\" fill=${colour} />\n </svg>`;\n return html`<ul part=\"list\">${(this.items ?? []).map((item, i) => html`<li part=\"item\" style=${`--i:${i}`}>\n <div class=\"graph\">${branch(toneOf(item.tone, i))}</div>\n <div>\n ${item.path ? html`<p class=\"path mono\">${item.path}</p>` : nothing}\n <div class=\"row\">\n ${heading(this.headingLevel, item.href ? html`<a href=${item.href}>${item.heading}</a>` : item.heading, 'h')}\n <div class=\"detail\">\n ${item.text ? html`<p class=\"body\">${item.text}</p>` : nothing}\n ${item.tags?.length ? html`<p class=\"tags mono\">${item.tags.join(' · ')}</p>` : nothing}\n </div>\n </div>\n </div>\n </li>`)}</ul>\n ${this.trunk ? html`<p class=\"end mono\" part=\"trunk\">${this.trunk}</p>` : nothing}`;\n }\n}\n\n// ── Check list ───────────────────────────────────────────────────────────\n\n/** One check that passed: a figure and what it measures. */\nexport interface CheckItem {\n id?: string;\n figure: string;\n label: string;\n /** A word at the end of the row, such as \"passed\". */\n status?: string;\n}\n\n/**\n * Proof as a list of passing checks: a large figure, what it measures, and its\n * status, each row ticked. It reads its colours from the band it sits on, so\n * it works on a dark section as well as a light one.\n *\n * @category content\n * @icon list-check\n */\nexport class ImpktCheckList extends ImpktElement {\n static properties = {\n items: { type: Array },\n summary: { type: String },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare items: CheckItem[];\n /** A line above the list, such as \"All 4 checks passed\". */\n declare summary: 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.summary = '';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, mono, words, css`\n :host { display: block; container-type: inline-size; }\n .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); }\n .summary::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: ${t.success}; }\n /* The rows share one grid, so the figure column fits the widest figure and every row lines up. */\n ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 32px max-content minmax(0, 1fr) auto; column-gap: ${space(6)}; }\n 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); }\n /* Checks run: each tick pops in, 150 ms after the one above. */\n @media (prefers-reduced-motion: no-preference) {\n .tick { transform: scale(0); transition: transform 600ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--i, 0) * 150ms); }\n :host([shown]) .tick { transform: scale(1); }\n }\n .sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n /* A passed check is a filled disc with a tick cut out of it, as a CI run shows one. */\n .tick { display: inline-flex; align-items: center; justify-content: center; inline-size: 26px; block-size: 26px; border-radius: 50%; background: ${t.success}; color: var(--impkt-color-status-success-on, #fff); }\n .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; }\n .label { margin: 0; ${type('xl')} }\n .status { margin: 0; opacity: 0.6; }\n @container (max-width: 40rem) {\n ul { grid-template-columns: 28px minmax(0, 1fr); }\n li { row-gap: ${space(1)}; }\n .label, .status { grid-column: 2; }\n .figure { font-size: ${fontSize('4xl')}; }\n }\n `];\n\n private unwatch: () => void = () => undefined;\n /** How far each figure has counted up, from 0 to 1, while the checks run. */\n private counted: number[] | null = null;\n connectedCallback(): void { super.connectedCallback(); this.unwatch = revealOnView(this, () => this.run()); }\n disconnectedCallback(): void { super.disconnectedCallback(); this.unwatch(); }\n\n /** Checks run: each figure counts up over 1200 ms, 150 ms after the one above. */\n private run(): void {\n if (reduced()) return;\n const items = this.items ?? [];\n const start = performance.now();\n const step = (now: number) => {\n this.counted = items.map((_, i) => Math.min(1, Math.max(0, (now - start - i * 150) / 1200)));\n this.requestUpdate();\n if (this.counted.some((k) => k < 1)) requestAnimationFrame(step);\n else this.counted = null;\n };\n requestAnimationFrame(step);\n }\n\n render(): TemplateResult {\n // While counting, the drawn figure is hidden from screen readers and the final one is read instead.\n const shownFigure = (figure: string, i: number) => {\n const k = this.counted?.[i];\n const m = /^(\\d+)(.*)$/.exec(figure);\n if (k === undefined || k >= 1 || !m) return html`${figure}`;\n const eased = 1 - Math.pow(1 - k, 3);\n return html`<span aria-hidden=\"true\">${Math.round(Number(m[1]) * eased)}${m[2]}</span><span class=\"sr-only\">${figure}</span>`;\n };\n return html`${this.summary ? html`<p class=\"summary mono\" part=\"summary\">${this.summary}</p>` : nothing}\n <ul part=\"list\">${(this.items ?? []).map((item, i) => html`<li part=\"item\" style=${`--i:${i}`}>\n <span class=\"tick\" aria-hidden=\"true\">${iconSvg('check', '16px')}</span>\n <p class=\"figure\">${shownFigure(item.figure, i)}</p>\n <p class=\"label\">${item.label}</p>\n ${item.status ? html`<p class=\"status mono\">${item.status}</p>` : html`<span></span>`}\n </li>`)}</ul>`;\n }\n}\n\n// ── Branch timeline ──────────────────────────────────────────────────────\n\n/** One stretch of work, drawn as a branch off the main line. */\nexport interface TimelineLane {\n id?: string;\n label: string;\n /** Where it starts and ends, in the timeline's units (weeks, say). */\n from: number;\n to: number;\n tone?: Tone;\n}\n\n/** A moment on a lane, such as a demo. */\nexport interface TimelineMark {\n id?: string;\n label: string;\n at: number;\n}\n\n/**\n * A project drawn as a commit graph: a main line along a scale of weeks, each\n * phase branching off it and merging back, moments marked on the way, and a\n * release tag where it ships.\n *\n * It is a picture, so it carries a text alternative that says the same in\n * words: each phase and when it runs. The steps that explain the phases go\n * beside it as their own block.\n *\n * @category content\n * @icon git-branch\n */\nexport class ImpktBranchTimeline extends ImpktElement {\n static properties = {\n lanes: { type: Array },\n marks: { type: Array },\n span: { type: Number },\n unit: { type: String },\n every: { type: Number },\n release: { type: String },\n releaseAt: { type: Number, attribute: 'release-at' },\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 lanes: TimelineLane[];\n declare marks: TimelineMark[];\n /** How long the whole timeline is, in its units. */\n declare span: number;\n /** The unit's short name on the scale, such as \"wk\". */\n declare unit: string;\n /** How often the scale is labelled. */\n declare every: number;\n /** The tag where it ships, such as \"v1.0 · launch\". */\n declare release: string;\n declare releaseAt: number;\n /** What the picture shows, 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.lanes = [];\n this.marks = [];\n this.span = 20;\n this.unit = '';\n this.every = 2;\n this.release = '';\n this.releaseAt = 0;\n this.label = '';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, mono, words, css`\n :host { display: block; overflow-x: auto; }\n svg { display: block; inline-size: 100%; min-inline-size: 640px; block-size: auto; overflow: visible; }\n text { font-family: ${t.fontMono}; font-size: 12px; fill: currentColor; }\n .faint { opacity: 0.5; }\n /* A lane's label keeps a band of the page colour around it, so a line crossing it stays legible. */\n .halo { paint-order: stroke; stroke: var(--impkt-color-surface-card, #fff); stroke-width: 5px; stroke-linejoin: round; }\n /* Graph draw: the graph opens left to right, so each demo appears as the line reaches it. */\n @media (prefers-reduced-motion: no-preference) {\n svg { clip-path: inset(0 100% 0 0); transition: clip-path 1400ms cubic-bezier(.25, 1, .5, 1); }\n :host([shown]) svg { clip-path: inset(0 -40px 0 0); }\n }\n `];\n\n private unwatch: () => void = () => undefined;\n connectedCallback(): void { super.connectedCallback(); this.unwatch = revealOnView(this); }\n disconnectedCallback(): void { super.disconnectedCallback(); this.unwatch(); }\n\n\n render(): TemplateResult {\n const W = 1200;\n const left = 24;\n const right = W - 60;\n const span = this.span > 0 ? this.span : 20;\n const x = (v: number) => left + (Math.min(Math.max(v, 0), span) / span) * (right - left);\n const lanes = this.lanes ?? [];\n const rowH = 52;\n const H = 40 + (lanes.length + 1) * rowH + 40;\n const mainY = 40;\n const laneY = (i: number) => mainY + (i + 1) * rowH;\n const ticks: number[] = [];\n for (let v = 0; v <= span; v += Math.max(1, this.every || 2)) ticks.push(v);\n const laneOf = (at: number) => lanes.findIndex((l) => at >= l.from && at <= l.to);\n // A lane's label goes under it, out of the way of the curves, unless its marks are labelled there.\n const marked = (i: number) => (this.marks ?? []).some((m) => laneOf(m.at) === i);\n const unit = this.unit || say('wk');\n const label = this.label || say('Project timeline');\n const described = lanes.map((l) => `${l.label}: ${say('{unit} {from} to {to}', { unit, from: l.from, to: l.to })}`).join('; ');\n return html`<figure part=\"figure\" style=\"margin:0\">\n <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 })}` : ''}`}>\n <line x1=${left} y1=${mainY} x2=${right + 40} y2=${mainY} stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" />\n <path d=\"M${right + 28} ${mainY - 7} L${right + 40} ${mainY} L${right + 28} ${mainY + 7}\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" />\n ${lanes.map((l, i) => {\n const c = toneOf(l.tone, i);\n const y = laneY(i);\n const a = x(l.from);\n const b = x(l.to);\n const bend = Math.min(36, (b - a) / 3);\n return svg`<g>\n <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\" />\n <circle cx=${a} cy=${mainY} r=\"7\" fill=${c} />\n <text x=${a + bend * 1.6} y=${marked(i) ? y - 10 : y + 20} class=\"halo\" style=${`fill:${c}`}>${l.label}</text>\n </g>`;\n })}\n ${(this.marks ?? []).map((m) => {\n const i = laneOf(m.at);\n const y = i >= 0 ? laneY(i) : mainY;\n const c = i >= 0 ? toneOf(lanes[i]!.tone, i) : 'currentColor';\n return svg`<g><circle cx=${x(m.at)} cy=${y} r=\"6\" fill=\"var(--impkt-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>`;\n })}\n ${this.release ? svg`<g>\n <circle cx=${x(this.releaseAt)} cy=${mainY} r=\"10\" fill=${TONE.success} />\n <rect x=${x(this.releaseAt) - 8} y=${mainY - 36} rx=\"4\" width=${this.release.length * 7.6 + 16} height=\"22\" fill=${TONE.success} />\n <text x=${x(this.releaseAt)} y=${mainY - 21} style=\"fill:var(--impkt-color-surface-card, #fff)\">${this.release}</text>\n </g>` : nothing}\n ${ticks.map((v) => svg`<text x=${x(v)} y=${H - 10} text-anchor=\"middle\" class=\"faint\">${unit} ${v}</text>`)}\n </svg>\n </figure>`;\n }\n}\n\ncustomElements.define('impkt-release-card', ImpktReleaseCard);\ncustomElements.define('impkt-release-list', ImpktReleaseList);\ncustomElements.define('impkt-branch-list', ImpktBranchList);\ncustomElements.define('impkt-check-list', ImpktCheckList);\ncustomElements.define('impkt-branch-timeline', ImpktBranchTimeline);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-release-card': ImpktReleaseCard;\n 'impkt-release-list': ImpktReleaseList;\n 'impkt-branch-list': ImpktBranchList;\n 'impkt-check-list': ImpktCheckList;\n 'impkt-branch-timeline': ImpktBranchTimeline;\n }\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;AAWA,SAAS,KAAK,MAAM,SAAS,WAAgC;AAYtD,IAAM,OAAkC;AAAA,EAC7C,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;AAEO,IAAM,QAAqB,CAAC,WAAW,QAAQ,WAAW,UAAU,UAAU,OAAO;AAKrF,IAAM,SAAS,CAAC,MAAwB,MAAsB;AACnE,MAAI,OAAO,SAAS,SAAU,QAAO,2BAA2B,IAAI,KAAK,KAAK,O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,SAAS,CAAC;AAAA;AAAA;AAAA,EAGjH;AACF;AAEA,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,qBAAqB,eAAe;AAC1D,eAAe,OAAO,oBAAoB,cAAc;AACxD,eAAe,OAAO,yBAAyB,mBAAmB;","names":["heading"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/checkbox.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { FieldElement } from '../base/FieldElement';\nimport { targetSize } from '../base/styles';\nimport { fontSize, space, t } from '../base/tokens';\n\n/**\n * A single checkbox — a consent, an opt-in, a confirmation.\n *\n * The label sits beside the box rather than above it, so this overrides the\n * base layout. The whole `<label>` is the hit area: a 20px box is legal under\n * 2.5.8 and still unkind, and the row costs nothing.\n\n *\n * @category form\n * @icon checkbox\n */\nexport class ImpktCheckbox extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n checked: { type: Boolean, reflect: true },\n };\n\n declare checked: boolean;\n\n constructor() {\n super();\n this.checked = false;\n }\n\n static styles = [\n ...FieldElement.styles,\n css`\n .row {\n display: flex;\n align-items: flex-start;\n gap: ${space(3)};\n cursor: pointer;\n }\n input {\n ${targetSize}\n inline-size: 20px;\n block-size: 20px;\n margin: 0;\n flex: none;\n accent-color: ${t.brand};\n }\n .text {\n font-size: ${fontSize('md')};\n }\n :host([invalid]) .row {\n color: ${t.dangerText};\n }\n `,\n ];\n\n protected renderControl(): TemplateResult {\n return html`\n <label class=\"row\" part=\"row\" for=${this.controlId}>\n <input\n type=\"checkbox\"\n id=${this.controlId}\n part=\"input\"\n name=${this.name || nothing}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-describedby=${this.describedBy}\n aria-invalid=${this.error ? 'true' : nothing}\n @change=${(e: Event) => {\n this.checked = (e.target as HTMLInputElement).checked;\n this.setFormValue(this.checked ? 'on' : '');\n }}\n />\n <span class=\"text\">\n ${this.label}${this.required\n ? html`<span class=\"required\"> (${this.requiredText})</span>`\n : nothing}\n </span>\n </label>\n `;\n }\n\n /** The label is inside the control here, so the base class's is suppressed. */\n protected renderLabel(): TemplateResult {\n return html`${nothing}`;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\ncustomElements.define('impkt-checkbox', ImpktCheckbox);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-checkbox': ImpktCheckbox;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAgBjD,IAAM,gBAAN,cAA4B,aAAa;AAAA,EAC9C;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,IAC1C;AAAA;AAAA,EAIA,cAAc;AACZ,UAAM;AACN,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA;AAAA;AAAA;AAAA,eAIW,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA,UAIb,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,wBAKI,EAAE,KAAK;AAAA;AAAA;AAAA,qBAGV,SAAS,IAAI,CAAC;AAAA;AAAA;AAAA,iBAGlB,EAAE,UAAU;AAAA;AAAA;AAAA,IAG3B;AAAA;AAAA,EAEU,gBAAgC;AACxC,WAAO;AAAA,0CAC+B,KAAK,SAAS;AAAA;AAAA;AAAA,eAGzC,KAAK,SAAS;AAAA;AAAA,iBAEZ,KAAK,QAAQ,OAAO;AAAA,qBAChB,KAAK,OAAO;AAAA,sBACX,KAAK,QAAQ;AAAA,sBACb,KAAK,QAAQ;AAAA,6BACN,KAAK,WAAW;AAAA,yBACpB,KAAK,QAAQ,SAAS,OAAO;AAAA,oBAClC,CAAC,MAAa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