@atomic-ui/ui 0.1.7 → 0.3.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 (190) hide show
  1. package/README.md +82 -95
  2. package/custom-elements.json +25364 -0
  3. package/dist/base/FieldElement.d.ts +11 -0
  4. package/dist/base/ImpktElement.d.ts +14 -0
  5. package/dist/base/locale.d.ts +8 -0
  6. package/dist/base/say.d.ts +1 -0
  7. package/dist/base/scroll-lock.d.ts +2 -0
  8. package/dist/base/styles.d.ts +25 -6
  9. package/dist/base/tokens.d.ts +5 -1
  10. package/dist/chunk-2YRTFWW2.js +26 -0
  11. package/dist/chunk-2YRTFWW2.js.map +1 -0
  12. package/dist/{chunk-X7IPZPTG.js → chunk-37PA72FC.js} +34 -19
  13. package/dist/chunk-37PA72FC.js.map +1 -0
  14. package/dist/chunk-3IGNZTJU.js +14 -0
  15. package/dist/chunk-3IGNZTJU.js.map +1 -0
  16. package/dist/{chunk-NTNXHLTM.js → chunk-3KO55PZK.js} +47 -2
  17. package/dist/chunk-3KO55PZK.js.map +1 -0
  18. package/dist/chunk-3RE4H2XO.js +53 -0
  19. package/dist/chunk-3RE4H2XO.js.map +1 -0
  20. package/dist/{chunk-5EA4IDUD.js → chunk-46BYUQ5A.js} +2 -2
  21. package/dist/{chunk-WECSVHIM.js → chunk-4OYHT4BN.js} +7 -3
  22. package/dist/chunk-4OYHT4BN.js.map +1 -0
  23. package/dist/{chunk-4HU4Y23Q.js → chunk-55DK75QF.js} +6 -4
  24. package/dist/chunk-55DK75QF.js.map +1 -0
  25. package/dist/{chunk-XVKEM5JY.js → chunk-5QSTXIPG.js} +2 -2
  26. package/dist/{chunk-QCNT7D5V.js → chunk-7P4Z4CLK.js} +63 -20
  27. package/dist/chunk-7P4Z4CLK.js.map +1 -0
  28. package/dist/{chunk-GSCVG2ER.js → chunk-APJ5JGRW.js} +3 -3
  29. package/dist/chunk-AUVIOU5G.js +522 -0
  30. package/dist/chunk-AUVIOU5G.js.map +1 -0
  31. package/dist/{chunk-6ICOJPMD.js → chunk-CUUBAETM.js} +4 -3
  32. package/dist/chunk-CUUBAETM.js.map +1 -0
  33. package/dist/{chunk-NQKYHILD.js → chunk-DAH7RLW3.js} +3 -3
  34. package/dist/{chunk-OB7LC6NJ.js → chunk-DJEZW7AC.js} +2 -2
  35. package/dist/{chunk-XJP45LFA.js → chunk-DKZ425AM.js} +15 -5
  36. package/dist/chunk-DKZ425AM.js.map +1 -0
  37. package/dist/{chunk-GO2IBRFP.js → chunk-F4YQWKK2.js} +7 -4
  38. package/dist/chunk-F4YQWKK2.js.map +1 -0
  39. package/dist/chunk-FVCM4WHD.js +328 -0
  40. package/dist/chunk-FVCM4WHD.js.map +1 -0
  41. package/dist/chunk-GBRML4RF.js +264 -0
  42. package/dist/chunk-GBRML4RF.js.map +1 -0
  43. package/dist/{chunk-ZQJD4YEJ.js → chunk-HXINWP3V.js} +42 -13
  44. package/dist/chunk-HXINWP3V.js.map +1 -0
  45. package/dist/{chunk-T6L3USBZ.js → chunk-IOBSIAHB.js} +23 -11
  46. package/dist/chunk-IOBSIAHB.js.map +1 -0
  47. package/dist/{chunk-7Y6UCSUS.js → chunk-IZOTGWWI.js} +5 -5
  48. package/dist/chunk-IZOTGWWI.js.map +1 -0
  49. package/dist/{chunk-MLVUMCQ2.js → chunk-J2FACXYI.js} +14 -5
  50. package/dist/chunk-J2FACXYI.js.map +1 -0
  51. package/dist/{chunk-VTFCTWSX.js → chunk-KKJEEKL2.js} +33 -7
  52. package/dist/chunk-KKJEEKL2.js.map +1 -0
  53. package/dist/{chunk-HWWA27DN.js → chunk-KMCGX76Y.js} +2 -2
  54. package/dist/{chunk-2YQA3VBY.js → chunk-NKMVICB5.js} +4 -2
  55. package/dist/chunk-NKMVICB5.js.map +1 -0
  56. package/dist/{chunk-ZBLTU67D.js → chunk-OFLMG6RN.js} +15 -11
  57. package/dist/chunk-OFLMG6RN.js.map +1 -0
  58. package/dist/{chunk-CMAU4DSB.js → chunk-P6GDMZK4.js} +5 -5
  59. package/dist/chunk-P6GDMZK4.js.map +1 -0
  60. package/dist/{chunk-MOEMFL4K.js → chunk-PO6FCAIS.js} +5 -5
  61. package/dist/chunk-PO6FCAIS.js.map +1 -0
  62. package/dist/chunk-PWLZFGS3.js +494 -0
  63. package/dist/chunk-PWLZFGS3.js.map +1 -0
  64. package/dist/chunk-QJIB36DM.js +249 -0
  65. package/dist/chunk-QJIB36DM.js.map +1 -0
  66. package/dist/{chunk-TPF4MOMF.js → chunk-R7FKGFW6.js} +7 -4
  67. package/dist/chunk-R7FKGFW6.js.map +1 -0
  68. package/dist/{chunk-ZGAOMRYD.js → chunk-RWWRTURA.js} +3 -3
  69. package/dist/{chunk-QDNI54ON.js → chunk-RYBY35QE.js} +10 -8
  70. package/dist/chunk-RYBY35QE.js.map +1 -0
  71. package/dist/chunk-S7F5VKWU.js +453 -0
  72. package/dist/chunk-S7F5VKWU.js.map +1 -0
  73. package/dist/chunk-T5W3FDSF.js +396 -0
  74. package/dist/chunk-T5W3FDSF.js.map +1 -0
  75. package/dist/{chunk-BTGCUONV.js → chunk-TCXKZDMR.js} +2 -2
  76. package/dist/{chunk-C36CZRHK.js → chunk-WGPB3QQU.js} +43 -13
  77. package/dist/chunk-WGPB3QQU.js.map +1 -0
  78. package/dist/{chunk-G6OVKNL7.js → chunk-XPCU4KUY.js} +5 -4
  79. package/dist/chunk-XPCU4KUY.js.map +1 -0
  80. package/dist/chunk-YRYZUYY7.js +236 -0
  81. package/dist/chunk-YRYZUYY7.js.map +1 -0
  82. package/dist/{chunk-7BIQ3K6H.js → chunk-ZOTAAYO5.js} +12 -2
  83. package/dist/chunk-ZOTAAYO5.js.map +1 -0
  84. package/dist/components/accordion.js +2 -2
  85. package/dist/components/alert.js +2 -2
  86. package/dist/components/app-ui.d.ts +28 -12
  87. package/dist/components/app-ui.js +6 -4
  88. package/dist/components/blocks.d.ts +28 -2
  89. package/dist/components/blocks.js +3 -3
  90. package/dist/components/button.d.ts +7 -0
  91. package/dist/components/button.js +3 -3
  92. package/dist/components/changelog.d.ts +386 -0
  93. package/dist/components/changelog.js +25 -0
  94. package/dist/components/changelog.js.map +1 -0
  95. package/dist/components/checkbox-group.js +3 -3
  96. package/dist/components/checkbox.js +3 -3
  97. package/dist/components/date-input.js +3 -3
  98. package/dist/components/dialog.d.ts +15 -0
  99. package/dist/components/dialog.js +3 -2
  100. package/dist/components/estimator.d.ts +246 -0
  101. package/dist/components/estimator.js +16 -0
  102. package/dist/components/estimator.js.map +1 -0
  103. package/dist/components/fieldset.js +2 -2
  104. package/dist/components/grid.js +2 -2
  105. package/dist/components/help.js +2 -2
  106. package/dist/components/icon.d.ts +2 -0
  107. package/dist/components/icon.js +2 -2
  108. package/dist/components/journey.d.ts +447 -0
  109. package/dist/components/journey.js +22 -0
  110. package/dist/components/journey.js.map +1 -0
  111. package/dist/components/layout.d.ts +24 -0
  112. package/dist/components/layout.js +2 -2
  113. package/dist/components/link.js +3 -3
  114. package/dist/components/list.d.ts +50 -0
  115. package/dist/components/list.js +8 -0
  116. package/dist/components/list.js.map +1 -0
  117. package/dist/components/marketing.d.ts +1 -1
  118. package/dist/components/marketing.js +3 -3
  119. package/dist/components/media.d.ts +10 -0
  120. package/dist/components/media.js +2 -2
  121. package/dist/components/navigation.d.ts +16 -0
  122. package/dist/components/navigation.js +3 -3
  123. package/dist/components/organisms.d.ts +13 -1
  124. package/dist/components/organisms.js +3 -3
  125. package/dist/components/page.js +2 -2
  126. package/dist/components/price.d.ts +1 -1
  127. package/dist/components/price.js +3 -2
  128. package/dist/components/progress.js +2 -2
  129. package/dist/components/property.d.ts +1 -1
  130. package/dist/components/property.js +4 -3
  131. package/dist/components/radio-group.js +3 -3
  132. package/dist/components/scene.d.ts +138 -0
  133. package/dist/components/scene.js +8 -0
  134. package/dist/components/scene.js.map +1 -0
  135. package/dist/components/scrubber.d.ts +86 -0
  136. package/dist/components/scrubber.js +8 -0
  137. package/dist/components/scrubber.js.map +1 -0
  138. package/dist/components/select.js +3 -3
  139. package/dist/components/selling.d.ts +409 -0
  140. package/dist/components/selling.js +25 -0
  141. package/dist/components/selling.js.map +1 -0
  142. package/dist/components/site.d.ts +283 -0
  143. package/dist/components/site.js +20 -0
  144. package/dist/components/site.js.map +1 -0
  145. package/dist/components/summary-list.js +2 -2
  146. package/dist/components/table.d.ts +94 -2
  147. package/dist/components/table.js +4 -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 +10 -2
  152. package/dist/index.js +135 -55
  153. package/dist/standalone/atomic-ui.js +3134 -0
  154. package/dist/standalone/atomic-ui.js.map +7 -0
  155. package/dist/standalone/index.html +174 -0
  156. package/package.json +26 -7
  157. package/scripts/copy-to-product.mjs +52 -0
  158. package/specimen/index.html +174 -0
  159. package/dist/chunk-2YQA3VBY.js.map +0 -1
  160. package/dist/chunk-4HU4Y23Q.js.map +0 -1
  161. package/dist/chunk-6ICOJPMD.js.map +0 -1
  162. package/dist/chunk-7BIQ3K6H.js.map +0 -1
  163. package/dist/chunk-7Y6UCSUS.js.map +0 -1
  164. package/dist/chunk-C36CZRHK.js.map +0 -1
  165. package/dist/chunk-CMAU4DSB.js.map +0 -1
  166. package/dist/chunk-G6OVKNL7.js.map +0 -1
  167. package/dist/chunk-GO2IBRFP.js.map +0 -1
  168. package/dist/chunk-MLVUMCQ2.js.map +0 -1
  169. package/dist/chunk-MOEMFL4K.js.map +0 -1
  170. package/dist/chunk-NTNXHLTM.js.map +0 -1
  171. package/dist/chunk-QCNT7D5V.js.map +0 -1
  172. package/dist/chunk-QDNI54ON.js.map +0 -1
  173. package/dist/chunk-T6L3USBZ.js.map +0 -1
  174. package/dist/chunk-TPF4MOMF.js.map +0 -1
  175. package/dist/chunk-VTFCTWSX.js.map +0 -1
  176. package/dist/chunk-VWNBB7FW.js +0 -104
  177. package/dist/chunk-VWNBB7FW.js.map +0 -1
  178. package/dist/chunk-WECSVHIM.js.map +0 -1
  179. package/dist/chunk-X7IPZPTG.js.map +0 -1
  180. package/dist/chunk-XJP45LFA.js.map +0 -1
  181. package/dist/chunk-ZBLTU67D.js.map +0 -1
  182. package/dist/chunk-ZQJD4YEJ.js.map +0 -1
  183. /package/dist/{chunk-5EA4IDUD.js.map → chunk-46BYUQ5A.js.map} +0 -0
  184. /package/dist/{chunk-XVKEM5JY.js.map → chunk-5QSTXIPG.js.map} +0 -0
  185. /package/dist/{chunk-GSCVG2ER.js.map → chunk-APJ5JGRW.js.map} +0 -0
  186. /package/dist/{chunk-NQKYHILD.js.map → chunk-DAH7RLW3.js.map} +0 -0
  187. /package/dist/{chunk-OB7LC6NJ.js.map → chunk-DJEZW7AC.js.map} +0 -0
  188. /package/dist/{chunk-HWWA27DN.js.map → chunk-KMCGX76Y.js.map} +0 -0
  189. /package/dist/{chunk-ZGAOMRYD.js.map → chunk-RWWRTURA.js.map} +0 -0
  190. /package/dist/{chunk-BTGCUONV.js.map → chunk-TCXKZDMR.js.map} +0 -0
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  FieldElement,
3
3
  fieldWidths
4
- } from "./chunk-7BIQ3K6H.js";
4
+ } from "./chunk-ZOTAAYO5.js";
5
5
  import {
6
6
  fontSize,
7
7
  space,
8
8
  t
9
- } from "./chunk-NTNXHLTM.js";
9
+ } from "./chunk-3KO55PZK.js";
10
10
 
11
11
  // packages/ui/src/components/select.ts
12
12
  import { html, css, nothing } from "lit";
@@ -37,10 +37,10 @@ var ImpktSelect = class extends FieldElement {
37
37
  font-family: inherit;
38
38
  font-size: ${fontSize("md")};
39
39
  color: ${t.text};
40
- background: ${t.surfaceCard};
40
+ background: var(--impkt-color-field-surface, ${t.surfaceCard});
41
41
  border: ${t.borderThin} solid ${t.border};
42
42
  border-radius: ${t.radiusLg};
43
- box-shadow: ${t.shadowXs};
43
+ box-shadow: var(--impkt-shadow-field, ${t.shadowXs});
44
44
  transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
45
45
  }
46
46
  select:hover:not(:disabled) {
@@ -90,4 +90,4 @@ customElements.define("impkt-select", ImpktSelect);
90
90
  export {
91
91
  ImpktSelect
92
92
  };
93
- //# sourceMappingURL=chunk-CMAU4DSB.js.map
93
+ //# sourceMappingURL=chunk-P6GDMZK4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/select.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { FieldElement, fieldWidths } from '../base/FieldElement';\nimport { fontSize, space, t } from '../base/tokens';\n\nexport interface SelectOption {\n value: string;\n label: string;\n}\n\n/**\n * A dropdown.\n *\n * A native `<select>`, because the alternative is a listbox widget that has to\n * reimplement type-ahead, keyboard selection, and the platform's own picker on\n * touch — and whose main advantage is that the arrow can be restyled. On a\n * phone, native wins outright: it opens the system control that the user\n * already knows how to drive.\n *\n * The empty first option carries a real label rather than being blank, so a\n * screen reader announces a choice to make rather than silence.\n\n *\n * @category form\n * @icon select\n */\nexport class ImpktSelect extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n width: { type: String, reflect: true },\n options: { type: Array },\n placeholder: { type: String },\n };\n\n declare options: SelectOption[];\n declare placeholder: string;\n\n /** How wide the box is, to suit the answer. Full width on a phone whatever this says. */\n declare width: 'full' | 'lg' | 'md' | 'sm' | 'xs';\n\n constructor() {\n super();\n this.width = 'full';\n this.options = [];\n this.placeholder = 'Choose an option';\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n css`\n select {\n inline-size: min(100%, var(--impkt-field-width));\n min-block-size: 44px;\n padding: ${space(2.5)} ${space(3)};\n font-family: inherit;\n font-size: ${fontSize('md')};\n color: ${t.text};\n background: var(--impkt-color-field-surface, ${t.surfaceCard});\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radiusLg};\n box-shadow: var(--impkt-shadow-field, ${t.shadowXs});\n transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;\n }\n select:hover:not(:disabled) {\n border-color: ${t.borderStrong};\n }\n /* A brand halo as well as the focus ring, so the field being typed in is plain at a glance. */\n select:focus-visible {\n border-color: ${t.brand};\n box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};\n }\n select:disabled {\n background: ${t.surfaceInset};\n cursor: not-allowed;\n }\n :host([invalid]) select {\n border-color: ${t.danger};\n border-width: ${t.borderThick};\n }\n `,\n ];\n\n protected renderControl(): TemplateResult {\n return html`\n <select\n id=${this.controlId}\n part=\"select\"\n name=${this.name || nothing}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-describedby=${this.describedBy}\n aria-invalid=${this.error ? 'true' : nothing}\n @change=${(e: Event) => this.setFormValue((e.target as HTMLSelectElement).value)}\n >\n <option value=\"\" ?selected=${!this.value}>${this.placeholder}</option>\n ${this.options.map(\n (o) => html`<option value=${o.value} ?selected=${this.value === o.value}>${o.label}</option>`,\n )}\n </select>\n `;\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-select', ImpktSelect);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-select': ImpktSelect;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAyBjD,IAAM,cAAN,cAA0B,aAAa;AAAA,EAC5C;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,SAAS,EAAE,MAAM,MAAM;AAAA,MACvB,aAAa,EAAE,MAAM,OAAO;AAAA,IAC9B;AAAA;AAAA,EAQA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ;AACb,SAAK,UAAU,CAAC;AAChB,SAAK,cAAc;AAAA,EACrB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA,MACA;AAAA;AAAA;AAAA;AAAA,mBAIe,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA;AAAA,qBAEpB,SAAS,IAAI,CAAC;AAAA,iBAClB,EAAE,IAAI;AAAA,uDACgC,EAAE,WAAW;AAAA,kBAClD,EAAE,UAAU,UAAU,EAAE,MAAM;AAAA,yBACvB,EAAE,QAAQ;AAAA,gDACa,EAAE,QAAQ;AAAA;AAAA;AAAA;AAAA,wBAIlC,EAAE,YAAY;AAAA;AAAA;AAAA;AAAA,wBAId,EAAE,KAAK;AAAA,sBACT,EAAE,WAAW,eAAe,EAAE,SAAS;AAAA;AAAA;AAAA,sBAGvC,EAAE,YAAY;AAAA;AAAA;AAAA;AAAA,wBAIZ,EAAE,MAAM;AAAA,wBACR,EAAE,WAAW;AAAA;AAAA;AAAA,IAGnC;AAAA;AAAA,EAEU,gBAAgC;AACxC,WAAO;AAAA;AAAA,aAEE,KAAK,SAAS;AAAA;AAAA,eAEZ,KAAK,QAAQ,OAAO;AAAA,oBACf,KAAK,QAAQ;AAAA,oBACb,KAAK,QAAQ;AAAA,2BACN,KAAK,WAAW;AAAA,uBACpB,KAAK,QAAQ,SAAS,OAAO;AAAA,kBAClC,CAAC,MAAa,KAAK,aAAc,EAAE,OAA6B,KAAK,CAAC;AAAA;AAAA,qCAEnD,CAAC,KAAK,KAAK,IAAI,KAAK,WAAW;AAAA,UAC1D,KAAK,QAAQ;AAAA,MACb,CAAC,MAAM,qBAAqB,EAAE,KAAK,cAAc,KAAK,UAAU,EAAE,KAAK,IAAI,EAAE,KAAK;AAAA,IACpF,CAAC;AAAA;AAAA;AAAA,EAGP;AAAA,EAEA,QAAQ,SAAqC;AAC3C,QAAI,QAAQ,IAAI,OAAO,EAAG,MAAK,gBAAgB,WAAW,QAAQ,KAAK,KAAK,CAAC;AAAA,EAC/E;AACF;AAEA,eAAe,OAAO,gBAAgB,WAAW;","names":[]}
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  FieldElement,
3
3
  fieldWidths
4
- } from "./chunk-7BIQ3K6H.js";
4
+ } from "./chunk-ZOTAAYO5.js";
5
5
  import {
6
6
  fontSize,
7
7
  space,
8
8
  t
9
- } from "./chunk-NTNXHLTM.js";
9
+ } from "./chunk-3KO55PZK.js";
10
10
 
11
11
  // packages/ui/src/components/text-input.ts
12
12
  import { html, css, nothing } from "lit";
@@ -43,10 +43,10 @@ var ImpktTextInput = class extends FieldElement {
43
43
  font-family: inherit;
44
44
  font-size: ${fontSize("md")};
45
45
  color: ${t.text};
46
- background: ${t.surfaceCard};
46
+ background: var(--impkt-color-field-surface, ${t.surfaceCard});
47
47
  border: ${t.borderThin} solid ${t.border};
48
48
  border-radius: ${t.radiusLg};
49
- box-shadow: ${t.shadowXs};
49
+ box-shadow: var(--impkt-shadow-field, ${t.shadowXs});
50
50
  transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
51
51
  }
52
52
  input:hover:not(:disabled) {
@@ -103,4 +103,4 @@ customElements.define("impkt-text-input", ImpktTextInput);
103
103
  export {
104
104
  ImpktTextInput
105
105
  };
106
- //# sourceMappingURL=chunk-MOEMFL4K.js.map
106
+ //# sourceMappingURL=chunk-PO6FCAIS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/text-input.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { FieldElement, fieldWidths } from '../base/FieldElement';\nimport { fontSize, space, t } from '../base/tokens';\n\n/**\n * A single-line text field.\n *\n * `inputmode` and `autocomplete` are first-class properties rather than\n * afterthoughts. 1.3.5 Identify Input Purpose is a Level AA criterion that\n * autofill satisfies directly, and it is the single cheapest accessibility win\n * in a checkout journey — a form that fills itself is a form that someone with a\n * motor impairment can actually finish.\n\n *\n * @category form\n * @icon field\n */\nexport class ImpktTextInput extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n width: { type: String, reflect: true },\n type: { type: String },\n placeholder: { type: String },\n autocomplete: { type: String },\n inputmode: { type: String },\n maxlength: { type: Number },\n };\n\n declare type: 'text' | 'email' | 'tel' | 'number' | 'password' | 'date';\n declare placeholder: string;\n /** A token from the HTML autofill list — `given-name`, `postal-code`, `tel`. */\n declare autocomplete: string;\n declare inputmode: string;\n declare maxlength: number | undefined;\n\n /** How wide the box is, to suit the answer. Full width on a phone whatever this says. */\n declare width: 'full' | 'lg' | 'md' | 'sm' | 'xs';\n\n constructor() {\n super();\n this.width = 'full';\n this.type = 'text';\n this.placeholder = '';\n this.autocomplete = '';\n this.inputmode = '';\n this.maxlength = undefined;\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n css`\n input {\n inline-size: min(100%, var(--impkt-field-width));\n min-block-size: 44px;\n padding: ${space(2.5)} ${space(3)};\n font-family: inherit;\n font-size: ${fontSize('md')};\n color: ${t.text};\n background: var(--impkt-color-field-surface, ${t.surfaceCard});\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radiusLg};\n box-shadow: var(--impkt-shadow-field, ${t.shadowXs});\n transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;\n }\n input:hover:not(:disabled) {\n border-color: ${t.borderStrong};\n }\n /* A brand halo as well as the focus ring, so the field being typed in is plain at a glance. */\n input:focus-visible {\n border-color: ${t.brand};\n box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};\n }\n input::placeholder {\n color: ${t.textPlaceholder};\n }\n input:disabled {\n background: ${t.surfaceInset};\n cursor: not-allowed;\n }\n /* The border thickens as well as reddening. Colour alone would carry the\n error, which 1.4.1 forbids — and the message below says it in words. */\n :host([invalid]) input {\n border-color: ${t.danger};\n border-width: ${t.borderThick};\n }\n `,\n ];\n\n protected renderControl(): TemplateResult {\n return html`\n <input\n id=${this.controlId}\n part=\"input\"\n type=${this.type}\n name=${this.name || nothing}\n .value=${this.value}\n placeholder=${this.placeholder || nothing}\n autocomplete=${this.autocomplete || nothing}\n inputmode=${this.inputmode || nothing}\n maxlength=${this.maxlength ?? nothing}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n aria-describedby=${this.describedBy}\n aria-invalid=${this.error ? 'true' : nothing}\n @input=${(e: Event) => this.setFormValue((e.target as HTMLInputElement).value)}\n />\n `;\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-text-input', ImpktTextInput);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-text-input': ImpktTextInput;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAiBjD,IAAM,iBAAN,cAA6B,aAAa;AAAA,EAC/C;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,aAAa,EAAE,MAAM,OAAO;AAAA,MAC5B,cAAc,EAAE,MAAM,OAAO;AAAA,MAC7B,WAAW,EAAE,MAAM,OAAO;AAAA,MAC1B,WAAW,EAAE,MAAM,OAAO;AAAA,IAC5B;AAAA;AAAA,EAYA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,cAAc;AACnB,SAAK,eAAe;AACpB,SAAK,YAAY;AACjB,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA,MACA;AAAA;AAAA;AAAA;AAAA,mBAIe,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA;AAAA,qBAEpB,SAAS,IAAI,CAAC;AAAA,iBAClB,EAAE,IAAI;AAAA,uDACgC,EAAE,WAAW;AAAA,kBAClD,EAAE,UAAU,UAAU,EAAE,MAAM;AAAA,yBACvB,EAAE,QAAQ;AAAA,gDACa,EAAE,QAAQ;AAAA;AAAA;AAAA;AAAA,wBAIlC,EAAE,YAAY;AAAA;AAAA;AAAA;AAAA,wBAId,EAAE,KAAK;AAAA,sBACT,EAAE,WAAW,eAAe,EAAE,SAAS;AAAA;AAAA;AAAA,iBAG5C,EAAE,eAAe;AAAA;AAAA;AAAA,sBAGZ,EAAE,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAMZ,EAAE,MAAM;AAAA,wBACR,EAAE,WAAW;AAAA;AAAA;AAAA,IAGnC;AAAA;AAAA,EAEU,gBAAgC;AACxC,WAAO;AAAA;AAAA,aAEE,KAAK,SAAS;AAAA;AAAA,eAEZ,KAAK,IAAI;AAAA,eACT,KAAK,QAAQ,OAAO;AAAA,iBAClB,KAAK,KAAK;AAAA,sBACL,KAAK,eAAe,OAAO;AAAA,uBAC1B,KAAK,gBAAgB,OAAO;AAAA,oBAC/B,KAAK,aAAa,OAAO;AAAA,oBACzB,KAAK,aAAa,OAAO;AAAA,oBACzB,KAAK,QAAQ;AAAA,oBACb,KAAK,QAAQ;AAAA,oBACb,KAAK,QAAQ;AAAA,2BACN,KAAK,WAAW;AAAA,uBACpB,KAAK,QAAQ,SAAS,OAAO;AAAA,iBACnC,CAAC,MAAa,KAAK,aAAc,EAAE,OAA4B,KAAK,CAAC;AAAA;AAAA;AAAA,EAGpF;AAAA,EAEA,QAAQ,SAAqC;AAC3C,QAAI,QAAQ,IAAI,OAAO,EAAG,MAAK,gBAAgB,WAAW,QAAQ,KAAK,KAAK,CAAC;AAAA,EAC/E;AACF;AAEA,eAAe,OAAO,oBAAoB,cAAc;","names":[]}
@@ -0,0 +1,494 @@
1
+ import {
2
+ iconSvg
3
+ } from "./chunk-NKMVICB5.js";
4
+ import {
5
+ ImpktElement,
6
+ fontSize,
7
+ fontWeight,
8
+ say,
9
+ space,
10
+ spaceAround,
11
+ t,
12
+ type,
13
+ visuallyHidden
14
+ } from "./chunk-3KO55PZK.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-PWLZFGS3.js.map