@atomic-ui/ui 0.1.5 → 0.2.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 (181) hide show
  1. package/README.md +17 -3
  2. package/custom-elements.json +24569 -0
  3. package/dist/base/ImpktElement.d.ts +14 -0
  4. package/dist/base/locale.d.ts +8 -0
  5. package/dist/base/say.d.ts +1 -0
  6. package/dist/base/styles.d.ts +1 -1
  7. package/dist/base/tokens.d.ts +28 -2
  8. package/dist/{chunk-KWURASAB.js → chunk-26O27BQS.js} +3 -3
  9. package/dist/chunk-2CFVV2NZ.js +494 -0
  10. package/dist/chunk-2CFVV2NZ.js.map +1 -0
  11. package/dist/chunk-3IGNZTJU.js +14 -0
  12. package/dist/chunk-3IGNZTJU.js.map +1 -0
  13. package/dist/{chunk-DR3SJ7ZV.js → chunk-3IQ73WNW.js} +3 -3
  14. package/dist/{chunk-AXQ5YBN2.js → chunk-4X723QBD.js} +135 -10
  15. package/dist/chunk-4X723QBD.js.map +1 -0
  16. package/dist/{chunk-OFAVRPRK.js → chunk-6YYAOKNI.js} +2 -2
  17. package/dist/chunk-6YYAOKNI.js.map +1 -0
  18. package/dist/{chunk-DI2CJ3MZ.js → chunk-7AJN2TIS.js} +2 -2
  19. package/dist/chunk-7BSZPUE3.js +53 -0
  20. package/dist/chunk-7BSZPUE3.js.map +1 -0
  21. package/dist/{chunk-IBTOZOGI.js → chunk-7OXTZJR4.js} +2 -2
  22. package/dist/chunk-7XEPNEVQ.js +264 -0
  23. package/dist/chunk-7XEPNEVQ.js.map +1 -0
  24. package/dist/{chunk-5NUF7ZQA.js → chunk-D6C7XEY4.js} +64 -3
  25. package/dist/chunk-D6C7XEY4.js.map +1 -0
  26. package/dist/{chunk-4JKUAA6K.js → chunk-E2VBUWJ4.js} +53 -14
  27. package/dist/chunk-E2VBUWJ4.js.map +1 -0
  28. package/dist/{chunk-57P4WO4Y.js → chunk-E3XJK7MY.js} +38 -23
  29. package/dist/chunk-E3XJK7MY.js.map +1 -0
  30. package/dist/{chunk-6UDDZQDK.js → chunk-EDSZI227.js} +3 -3
  31. package/dist/chunk-EDSZI227.js.map +1 -0
  32. package/dist/{chunk-3OSL2HMN.js → chunk-FFCIY7NM.js} +9 -6
  33. package/dist/chunk-FFCIY7NM.js.map +1 -0
  34. package/dist/{chunk-4AJPS5AU.js → chunk-FJRHZA3C.js} +16 -6
  35. package/dist/chunk-FJRHZA3C.js.map +1 -0
  36. package/dist/{chunk-JPEWRJSQ.js → chunk-GQDUHZE3.js} +3 -3
  37. package/dist/chunk-HYPPG4NF.js +553 -0
  38. package/dist/chunk-HYPPG4NF.js.map +1 -0
  39. package/dist/chunk-J4JULXUG.js +249 -0
  40. package/dist/chunk-J4JULXUG.js.map +1 -0
  41. package/dist/{chunk-CFGLOYWW.js → chunk-KFD4O7VA.js} +4 -2
  42. package/dist/chunk-KFD4O7VA.js.map +1 -0
  43. package/dist/{chunk-LLRJU7XE.js → chunk-MVEFM5QI.js} +6 -6
  44. package/dist/chunk-MVEFM5QI.js.map +1 -0
  45. package/dist/{chunk-6GKI67P7.js → chunk-NCASAXQT.js} +7 -3
  46. package/dist/chunk-NCASAXQT.js.map +1 -0
  47. package/dist/{chunk-H6L3FSQY.js → chunk-NKTMMJYD.js} +7 -6
  48. package/dist/chunk-NKTMMJYD.js.map +1 -0
  49. package/dist/{chunk-QELX47AP.js → chunk-OB7WULFK.js} +50 -27
  50. package/dist/chunk-OB7WULFK.js.map +1 -0
  51. package/dist/chunk-OHDPGIJ3.js +428 -0
  52. package/dist/chunk-OHDPGIJ3.js.map +1 -0
  53. package/dist/{chunk-TZD7IVVQ.js → chunk-OLLZFNO6.js} +13 -5
  54. package/dist/chunk-OLLZFNO6.js.map +1 -0
  55. package/dist/{chunk-5RVMMKMO.js → chunk-OMJMUFOW.js} +3 -3
  56. package/dist/{chunk-U2S7OESF.js → chunk-QB2KMV6S.js} +56 -15
  57. package/dist/chunk-QB2KMV6S.js.map +1 -0
  58. package/dist/{chunk-QH46SOPJ.js → chunk-R67PDFKE.js} +54 -11
  59. package/dist/chunk-R67PDFKE.js.map +1 -0
  60. package/dist/chunk-RZSZQMSE.js +236 -0
  61. package/dist/chunk-RZSZQMSE.js.map +1 -0
  62. package/dist/{chunk-6MLXFFH4.js → chunk-TGT7J4EG.js} +3 -3
  63. package/dist/chunk-TGT7J4EG.js.map +1 -0
  64. package/dist/{chunk-S3EQO33M.js → chunk-UCHJCUYI.js} +6 -4
  65. package/dist/chunk-UCHJCUYI.js.map +1 -0
  66. package/dist/chunk-UHLRXI6J.js +453 -0
  67. package/dist/chunk-UHLRXI6J.js.map +1 -0
  68. package/dist/chunk-UNVL3CNM.js +725 -0
  69. package/dist/chunk-UNVL3CNM.js.map +1 -0
  70. package/dist/{chunk-2RBYVWZT.js → chunk-WDDWWCHN.js} +5 -3
  71. package/dist/chunk-WDDWWCHN.js.map +1 -0
  72. package/dist/chunk-WFKSOM6O.js +498 -0
  73. package/dist/chunk-WFKSOM6O.js.map +1 -0
  74. package/dist/{chunk-HWNY6U5F.js → chunk-XEJMFFIM.js} +4 -3
  75. package/dist/chunk-XEJMFFIM.js.map +1 -0
  76. package/dist/{chunk-ZDYTNFQI.js → chunk-XJXCTGDR.js} +16 -6
  77. package/dist/chunk-XJXCTGDR.js.map +1 -0
  78. package/dist/{chunk-G6UVYMA6.js → chunk-YD6IZ2C5.js} +2 -2
  79. package/dist/chunk-YK5QI57J.js +396 -0
  80. package/dist/chunk-YK5QI57J.js.map +1 -0
  81. package/dist/components/accordion.js +2 -2
  82. package/dist/components/alert.js +2 -2
  83. package/dist/components/app-ui.d.ts +421 -0
  84. package/dist/components/app-ui.js +27 -0
  85. package/dist/components/app-ui.js.map +1 -0
  86. package/dist/components/blocks.d.ts +2 -2
  87. package/dist/components/blocks.js +3 -3
  88. package/dist/components/button.d.ts +14 -0
  89. package/dist/components/button.js +3 -3
  90. package/dist/components/changelog.d.ts +386 -0
  91. package/dist/components/changelog.js +25 -0
  92. package/dist/components/changelog.js.map +1 -0
  93. package/dist/components/checkbox-group.js +3 -3
  94. package/dist/components/checkbox.js +3 -3
  95. package/dist/components/date-input.js +3 -3
  96. package/dist/components/dialog.js +2 -2
  97. package/dist/components/estimator.d.ts +246 -0
  98. package/dist/components/estimator.js +16 -0
  99. package/dist/components/estimator.js.map +1 -0
  100. package/dist/components/fieldset.js +2 -2
  101. package/dist/components/grid.d.ts +2 -2
  102. package/dist/components/grid.js +2 -2
  103. package/dist/components/help.js +2 -2
  104. package/dist/components/icon.d.ts +2 -0
  105. package/dist/components/icon.js +2 -2
  106. package/dist/components/journey.d.ts +433 -0
  107. package/dist/components/journey.js +22 -0
  108. package/dist/components/journey.js.map +1 -0
  109. package/dist/components/layout.d.ts +34 -5
  110. package/dist/components/layout.js +2 -2
  111. package/dist/components/link.js +3 -3
  112. package/dist/components/list.d.ts +50 -0
  113. package/dist/components/list.js +8 -0
  114. package/dist/components/list.js.map +1 -0
  115. package/dist/components/marketing.d.ts +119 -6
  116. package/dist/components/marketing.js +7 -3
  117. package/dist/components/media.d.ts +10 -0
  118. package/dist/components/media.js +2 -2
  119. package/dist/components/navigation.d.ts +25 -2
  120. package/dist/components/navigation.js +3 -3
  121. package/dist/components/organisms.d.ts +559 -0
  122. package/dist/components/organisms.js +25 -0
  123. package/dist/components/organisms.js.map +1 -0
  124. package/dist/components/page.d.ts +14 -3
  125. package/dist/components/page.js +2 -2
  126. package/dist/components/price.d.ts +6 -1
  127. package/dist/components/price.js +3 -2
  128. package/dist/components/progress.js +2 -2
  129. package/dist/components/property.d.ts +389 -0
  130. package/dist/components/property.js +20 -0
  131. package/dist/components/property.js.map +1 -0
  132. package/dist/components/radio-group.js +3 -3
  133. package/dist/components/scene.d.ts +138 -0
  134. package/dist/components/scene.js +8 -0
  135. package/dist/components/scene.js.map +1 -0
  136. package/dist/components/scrubber.d.ts +86 -0
  137. package/dist/components/scrubber.js +8 -0
  138. package/dist/components/scrubber.js.map +1 -0
  139. package/dist/components/select.js +3 -3
  140. package/dist/components/selling.d.ts +407 -0
  141. package/dist/components/selling.js +25 -0
  142. package/dist/components/selling.js.map +1 -0
  143. package/dist/components/site.d.ts +283 -0
  144. package/dist/components/site.js +20 -0
  145. package/dist/components/site.js.map +1 -0
  146. package/dist/components/summary-list.js +2 -2
  147. package/dist/components/table.js +2 -2
  148. package/dist/components/text-input.js +3 -3
  149. package/dist/components/textarea.d.ts +13 -0
  150. package/dist/components/textarea.js +3 -3
  151. package/dist/index.d.ts +13 -2
  152. package/dist/index.js +180 -47
  153. package/package.json +11 -4
  154. package/dist/chunk-2RBYVWZT.js.map +0 -1
  155. package/dist/chunk-3OSL2HMN.js.map +0 -1
  156. package/dist/chunk-4AJPS5AU.js.map +0 -1
  157. package/dist/chunk-4JKUAA6K.js.map +0 -1
  158. package/dist/chunk-57P4WO4Y.js.map +0 -1
  159. package/dist/chunk-5NUF7ZQA.js.map +0 -1
  160. package/dist/chunk-6GKI67P7.js.map +0 -1
  161. package/dist/chunk-6MLXFFH4.js.map +0 -1
  162. package/dist/chunk-6UDDZQDK.js.map +0 -1
  163. package/dist/chunk-AXQ5YBN2.js.map +0 -1
  164. package/dist/chunk-CFGLOYWW.js.map +0 -1
  165. package/dist/chunk-H6L3FSQY.js.map +0 -1
  166. package/dist/chunk-HWNY6U5F.js.map +0 -1
  167. package/dist/chunk-LLRJU7XE.js.map +0 -1
  168. package/dist/chunk-OFAVRPRK.js.map +0 -1
  169. package/dist/chunk-QELX47AP.js.map +0 -1
  170. package/dist/chunk-QH46SOPJ.js.map +0 -1
  171. package/dist/chunk-S3EQO33M.js.map +0 -1
  172. package/dist/chunk-TZD7IVVQ.js.map +0 -1
  173. package/dist/chunk-U2S7OESF.js.map +0 -1
  174. package/dist/chunk-ZDYTNFQI.js.map +0 -1
  175. /package/dist/{chunk-KWURASAB.js.map → chunk-26O27BQS.js.map} +0 -0
  176. /package/dist/{chunk-DR3SJ7ZV.js.map → chunk-3IQ73WNW.js.map} +0 -0
  177. /package/dist/{chunk-DI2CJ3MZ.js.map → chunk-7AJN2TIS.js.map} +0 -0
  178. /package/dist/{chunk-IBTOZOGI.js.map → chunk-7OXTZJR4.js.map} +0 -0
  179. /package/dist/{chunk-JPEWRJSQ.js.map → chunk-GQDUHZE3.js.map} +0 -0
  180. /package/dist/{chunk-5RVMMKMO.js.map → chunk-OMJMUFOW.js.map} +0 -0
  181. /package/dist/{chunk-G6UVYMA6.js.map → chunk-YD6IZ2C5.js.map} +0 -0
@@ -18,4 +18,18 @@ export declare class ImpktElement extends LitElement {
18
18
  */
19
19
  protected readonly uid: string;
20
20
  protected id_(part: string): string;
21
+ /** @ignore */
22
+ connectedCallback(): void;
23
+ /**
24
+ * The words a component ships with, in the page's language (ADR 0026).
25
+ *
26
+ * Defaults stay plain English in the constructor, so the component manifest
27
+ * still sees them (a prop with no default is read as required). When the
28
+ * element joins the page, each word it holds is looked up in the site's
29
+ * wording; anything that is not one of Strata's own words, such as a page's
30
+ * own text or a variant name, is left exactly as it is.
31
+ *
32
+ * @ignore
33
+ */
34
+ private sayDefaults;
21
35
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The locale a component formats dates, numbers and money in: the language of
3
+ * the page around it (ADR 0026). A delivered page sets `lang` on its root, or
4
+ * on a part of the page in another language, and every component reads the
5
+ * nearest one. English is British English, which is what Strata's sites wrote
6
+ * before they had languages.
7
+ */
8
+ export declare function pageLocale(el?: Element | null): string;
@@ -0,0 +1 @@
1
+ export declare function say(english: string, values?: Record<string, string | number>): string;
@@ -11,7 +11,7 @@
11
11
  * who most need it.
12
12
  *
13
13
  * The colours come from locked tokens a brand cannot reach
14
- * ([ADR 0010](../../../../docs/decisions/0010-what-a-brand-may-set.md)).
14
+ * ([ADR 0010](https://github.com/matthill8286/strata/blob/main/docs/decisions/0010-what-a-brand-may-set.md)).
15
15
  */
16
16
  export declare const focusRing: import("lit").CSSResult;
17
17
  /**
@@ -4,7 +4,7 @@
4
4
  * Components never name a colour, a size or a radius. They name a token, and a
5
5
  * brand decides what it holds — which is what makes a rebrand a content
6
6
  * publish rather than a rebuild
7
- * ([ADR 0005](../../../../docs/decisions/0005-design-tokens.md)).
7
+ * ([ADR 0005](https://github.com/matthill8286/strata/blob/main/docs/decisions/0005-design-tokens.md)).
8
8
  *
9
9
  * Every reference carries a fallback so that a component dropped onto a page
10
10
  * with no token stylesheet still renders something legible. An unstyled
@@ -51,6 +51,10 @@ export declare const t: {
51
51
  readonly infoSubtle: CSSResult;
52
52
  readonly fontBody: CSSResult;
53
53
  readonly fontHeading: CSSResult;
54
+ /** Code-like labels: hashes, branches, version lines. */
55
+ readonly fontMono: CSSResult;
56
+ /** The small line above a heading: the body face, or the code face for a brand that asks. */
57
+ readonly fontEyebrow: CSSResult;
54
58
  readonly focusShadow: CSSResult;
55
59
  readonly focusOffset: CSSResult;
56
60
  readonly targetMin: CSSResult;
@@ -59,8 +63,30 @@ export declare const t: {
59
63
  readonly radiusLg: CSSResult;
60
64
  readonly borderThin: CSSResult;
61
65
  readonly borderThick: CSSResult;
66
+ readonly radiusXs: CSSResult;
67
+ readonly radiusXl: CSSResult;
68
+ readonly radius2xl: CSSResult;
69
+ /** Hairline borders and rings, from the text colour, so they suit any surface. */
70
+ readonly hairline: CSSResult;
71
+ readonly rule: CSSResult;
72
+ /** A wash of the text colour, for hover and pressed states on quiet controls. */
73
+ readonly wash: CSSResult;
74
+ /** The brand at a fifth, for focus halos round fields. */
75
+ readonly brandHalo: CSSResult;
76
+ readonly shadowXs: CSSResult;
77
+ readonly shadowSm: CSSResult;
78
+ readonly shadowMd: CSSResult;
79
+ readonly shadowLg: CSSResult;
80
+ readonly shadowXl: CSSResult;
81
+ readonly trackingTight: CSSResult;
82
+ readonly trackingWide: CSSResult;
62
83
  };
63
- /** `space.3` → the custom property. Spacing is always a token, never a number. */
84
+ /**
85
+ * A size on the type scale with its own line height, so text drawn at
86
+ * `type('xl')` has the leading that size reads best at.
87
+ */
88
+ export declare const type: (name: string) => CSSResult;
89
+ /** `space(3)` → `space.3`, `space(0.5)` → `space.0-5`. Spacing is always a token, never a number. */
64
90
  export declare const space: (step: number) => CSSResult;
65
91
  /** `font.size.lg` → the custom property. */
66
92
  export declare const fontSize: (name: string) => CSSResult;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  FieldElement
3
- } from "./chunk-DI2CJ3MZ.js";
3
+ } from "./chunk-7AJN2TIS.js";
4
4
  import {
5
5
  fontSize,
6
6
  space,
7
7
  t,
8
8
  targetSize
9
- } from "./chunk-5NUF7ZQA.js";
9
+ } from "./chunk-D6C7XEY4.js";
10
10
 
11
11
  // packages/ui/src/components/checkbox-group.ts
12
12
  import { html, css, nothing } from "lit";
@@ -128,4 +128,4 @@ customElements.define("impkt-checkbox-group", ImpktCheckboxGroup);
128
128
  export {
129
129
  ImpktCheckboxGroup
130
130
  };
131
- //# sourceMappingURL=chunk-KWURASAB.js.map
131
+ //# sourceMappingURL=chunk-26O27BQS.js.map
@@ -0,0 +1,494 @@
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