@atomic-ui/ui 0.10.0 → 0.12.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 (208) hide show
  1. package/custom-elements.json +9839 -6255
  2. package/dist/base/FieldElement.d.ts +10 -3
  3. package/dist/{chunk-YWP2Z3JN.js → chunk-2TNF7O43.js} +7 -5
  4. package/dist/{chunk-YWP2Z3JN.js.map → chunk-2TNF7O43.js.map} +1 -1
  5. package/dist/{chunk-FKUBEVCU.js → chunk-2WHOBIOY.js} +11 -9
  6. package/dist/{chunk-FKUBEVCU.js.map → chunk-2WHOBIOY.js.map} +1 -1
  7. package/dist/{chunk-26BO3W56.js → chunk-3BWCD5U5.js} +5 -3
  8. package/dist/{chunk-26BO3W56.js.map → chunk-3BWCD5U5.js.map} +1 -1
  9. package/dist/chunk-3GPGDERO.js +201 -0
  10. package/dist/chunk-3GPGDERO.js.map +1 -0
  11. package/dist/{chunk-3T7J66Z2.js → chunk-3KAFK24X.js} +13 -11
  12. package/dist/chunk-3KAFK24X.js.map +1 -0
  13. package/dist/{chunk-5OJAJA3U.js → chunk-5HCWL2YD.js} +6 -4
  14. package/dist/{chunk-5OJAJA3U.js.map → chunk-5HCWL2YD.js.map} +1 -1
  15. package/dist/{chunk-AG4EP3OY.js → chunk-5IGBH4GL.js} +8 -6
  16. package/dist/{chunk-AG4EP3OY.js.map → chunk-5IGBH4GL.js.map} +1 -1
  17. package/dist/{chunk-AL4IUSML.js → chunk-5OYQZWP2.js} +5 -3
  18. package/dist/{chunk-AL4IUSML.js.map → chunk-5OYQZWP2.js.map} +1 -1
  19. package/dist/chunk-5PRB7P7N.js +167 -0
  20. package/dist/chunk-5PRB7P7N.js.map +1 -0
  21. package/dist/chunk-6CDQSHVW.js +21 -0
  22. package/dist/chunk-6CDQSHVW.js.map +1 -0
  23. package/dist/{chunk-MLKNZL5J.js → chunk-6J22I7F6.js} +14 -12
  24. package/dist/chunk-6J22I7F6.js.map +1 -0
  25. package/dist/chunk-72WNCCDC.js +136 -0
  26. package/dist/chunk-72WNCCDC.js.map +1 -0
  27. package/dist/chunk-7UI3OBXL.js +104 -0
  28. package/dist/chunk-7UI3OBXL.js.map +1 -0
  29. package/dist/{chunk-D6NET2VB.js → chunk-ALFE35FS.js} +30 -3
  30. package/dist/chunk-ALFE35FS.js.map +1 -0
  31. package/dist/chunk-AYINRYNC.js +184 -0
  32. package/dist/chunk-AYINRYNC.js.map +1 -0
  33. package/dist/{chunk-2D2IMQII.js → chunk-BAITBJUC.js} +51 -29
  34. package/dist/chunk-BAITBJUC.js.map +1 -0
  35. package/dist/{chunk-2EP3IV3G.js → chunk-BGHAANTP.js} +22 -8
  36. package/dist/chunk-BGHAANTP.js.map +1 -0
  37. package/dist/{chunk-OJO62KRX.js → chunk-CFCFKLTN.js} +85 -10
  38. package/dist/chunk-CFCFKLTN.js.map +1 -0
  39. package/dist/{chunk-UFPI4I2Y.js → chunk-CQT3VPYK.js} +8 -29
  40. package/dist/chunk-CQT3VPYK.js.map +1 -0
  41. package/dist/{chunk-AURT72IC.js → chunk-DXLEYNID.js} +13 -7
  42. package/dist/chunk-DXLEYNID.js.map +1 -0
  43. package/dist/{chunk-L4CIBOGK.js → chunk-EKPTMRBG.js} +5 -3
  44. package/dist/{chunk-L4CIBOGK.js.map → chunk-EKPTMRBG.js.map} +1 -1
  45. package/dist/{chunk-7UWJXPR3.js → chunk-F3NHPQU5.js} +17 -36
  46. package/dist/chunk-F3NHPQU5.js.map +1 -0
  47. package/dist/{chunk-Z2EWQMTR.js → chunk-F4IXELLK.js} +5 -3
  48. package/dist/{chunk-Z2EWQMTR.js.map → chunk-F4IXELLK.js.map} +1 -1
  49. package/dist/{chunk-APQEXM4I.js → chunk-FJHPGOGS.js} +5 -3
  50. package/dist/{chunk-APQEXM4I.js.map → chunk-FJHPGOGS.js.map} +1 -1
  51. package/dist/chunk-FLAUZU7Y.js +345 -0
  52. package/dist/chunk-FLAUZU7Y.js.map +1 -0
  53. package/dist/{chunk-3NEWOO2P.js → chunk-FZWUQC42.js} +7 -5
  54. package/dist/{chunk-3NEWOO2P.js.map → chunk-FZWUQC42.js.map} +1 -1
  55. package/dist/{chunk-ONED3PUB.js → chunk-HSXLSJVG.js} +54 -8
  56. package/dist/chunk-HSXLSJVG.js.map +1 -0
  57. package/dist/{chunk-V7EB7Q2M.js → chunk-JTCTQBAX.js} +2 -131
  58. package/dist/chunk-JTCTQBAX.js.map +1 -0
  59. package/dist/{chunk-ZL3JFUIE.js → chunk-K5QFVLCI.js} +7 -5
  60. package/dist/{chunk-ZL3JFUIE.js.map → chunk-K5QFVLCI.js.map} +1 -1
  61. package/dist/{chunk-DN5YZFSG.js → chunk-KE6WCXQP.js} +55 -9
  62. package/dist/chunk-KE6WCXQP.js.map +1 -0
  63. package/dist/chunk-LBHTXY7K.js +75 -0
  64. package/dist/chunk-LBHTXY7K.js.map +1 -0
  65. package/dist/{chunk-OZGKK3N5.js → chunk-LP4RTYTL.js} +88 -9
  66. package/dist/chunk-LP4RTYTL.js.map +1 -0
  67. package/dist/{chunk-MOO63SHZ.js → chunk-LXVPWTSY.js} +80 -23
  68. package/dist/chunk-LXVPWTSY.js.map +1 -0
  69. package/dist/{chunk-JNLKM3JT.js → chunk-N6EEW2GF.js} +6 -4
  70. package/dist/{chunk-JNLKM3JT.js.map → chunk-N6EEW2GF.js.map} +1 -1
  71. package/dist/chunk-NHEU5FT6.js +115 -0
  72. package/dist/chunk-NHEU5FT6.js.map +1 -0
  73. package/dist/chunk-P3BPW446.js +294 -0
  74. package/dist/chunk-P3BPW446.js.map +1 -0
  75. package/dist/chunk-QPOM7W3D.js +104 -0
  76. package/dist/chunk-QPOM7W3D.js.map +1 -0
  77. package/dist/{chunk-FU3CEHBS.js → chunk-R6PBY3YN.js} +6 -4
  78. package/dist/{chunk-FU3CEHBS.js.map → chunk-R6PBY3YN.js.map} +1 -1
  79. package/dist/{chunk-TJOYBDKS.js → chunk-R6YMSJR7.js} +65 -36
  80. package/dist/chunk-R6YMSJR7.js.map +1 -0
  81. package/dist/{chunk-ZEIV5X3U.js → chunk-SOYKSPPX.js} +73 -23
  82. package/dist/chunk-SOYKSPPX.js.map +1 -0
  83. package/dist/{chunk-NKMJMVZP.js → chunk-T52CUOCJ.js} +5 -3
  84. package/dist/{chunk-NKMJMVZP.js.map → chunk-T52CUOCJ.js.map} +1 -1
  85. package/dist/chunk-UFENSIWD.js +135 -0
  86. package/dist/chunk-UFENSIWD.js.map +1 -0
  87. package/dist/{chunk-A4M3A4SZ.js → chunk-UYTIJCCW.js} +10 -42
  88. package/dist/chunk-UYTIJCCW.js.map +1 -0
  89. package/dist/chunk-XX6JZW5N.js +36 -0
  90. package/dist/chunk-XX6JZW5N.js.map +1 -0
  91. package/dist/{chunk-2ZF3J7OO.js → chunk-XXSZL5CY.js} +17 -5
  92. package/dist/chunk-XXSZL5CY.js.map +1 -0
  93. package/dist/{chunk-6PMA6NHE.js → chunk-Y55FNQHS.js} +5 -3
  94. package/dist/{chunk-6PMA6NHE.js.map → chunk-Y55FNQHS.js.map} +1 -1
  95. package/dist/chunk-ZAWGJC4I.js +176 -0
  96. package/dist/chunk-ZAWGJC4I.js.map +1 -0
  97. package/dist/chunk-ZUQ3DOG2.js +110 -0
  98. package/dist/chunk-ZUQ3DOG2.js.map +1 -0
  99. package/dist/components/accordion.d.ts +22 -0
  100. package/dist/components/accordion.js +6 -2
  101. package/dist/components/alert.d.ts +22 -1
  102. package/dist/components/alert.js +3 -2
  103. package/dist/components/app-bar.d.ts +153 -0
  104. package/dist/components/app-bar.js +15 -0
  105. package/dist/components/app-bar.js.map +1 -0
  106. package/dist/components/app-ui.d.ts +29 -2
  107. package/dist/components/app-ui.js +5 -4
  108. package/dist/components/badge.d.ts +17 -1
  109. package/dist/components/badge.js +4 -3
  110. package/dist/components/blocks.js +5 -4
  111. package/dist/components/button.d.ts +18 -2
  112. package/dist/components/button.js +4 -3
  113. package/dist/components/checkbox-group.js +4 -3
  114. package/dist/components/checkbox.js +4 -3
  115. package/dist/components/checked.d.ts +77 -0
  116. package/dist/components/checked.js +10 -0
  117. package/dist/components/checked.js.map +1 -0
  118. package/dist/components/chip-group.d.ts +113 -0
  119. package/dist/components/chip-group.js +11 -0
  120. package/dist/components/chip-group.js.map +1 -0
  121. package/dist/components/chip.d.ts +11 -0
  122. package/dist/components/chip.js +3 -2
  123. package/dist/components/code-diff.d.ts +77 -0
  124. package/dist/components/code-diff.js +10 -0
  125. package/dist/components/code-diff.js.map +1 -0
  126. package/dist/components/date-input.js +4 -3
  127. package/dist/components/dialog.d.ts +15 -0
  128. package/dist/components/dialog.js +3 -2
  129. package/dist/components/fieldset.js +3 -2
  130. package/dist/components/grid.js +3 -2
  131. package/dist/components/help.js +3 -2
  132. package/dist/components/icon.js +3 -2
  133. package/dist/components/journey.js +4 -3
  134. package/dist/components/language-switch.d.ts +59 -0
  135. package/dist/components/language-switch.js +10 -0
  136. package/dist/components/language-switch.js.map +1 -0
  137. package/dist/components/layout.d.ts +8 -2
  138. package/dist/components/layout.js +3 -2
  139. package/dist/components/link.js +4 -3
  140. package/dist/components/list.js +3 -2
  141. package/dist/components/media.js +3 -2
  142. package/dist/components/meter.d.ts +112 -0
  143. package/dist/components/meter.js +13 -0
  144. package/dist/components/meter.js.map +1 -0
  145. package/dist/components/navigation.d.ts +52 -0
  146. package/dist/components/navigation.js +4 -3
  147. package/dist/components/page.d.ts +13 -8
  148. package/dist/components/page.js +3 -2
  149. package/dist/components/price.js +3 -2
  150. package/dist/components/progress.d.ts +16 -2
  151. package/dist/components/progress.js +3 -2
  152. package/dist/components/radio-group.js +4 -3
  153. package/dist/components/redaction.d.ts +51 -0
  154. package/dist/components/redaction.js +10 -0
  155. package/dist/components/redaction.js.map +1 -0
  156. package/dist/components/rows.d.ts +28 -0
  157. package/dist/components/rows.js +7 -3
  158. package/dist/components/select.js +4 -3
  159. package/dist/components/shell.js +4 -3
  160. package/dist/components/source.d.ts +68 -0
  161. package/dist/components/source.js +10 -0
  162. package/dist/components/source.js.map +1 -0
  163. package/dist/components/status-pill-style.d.ts +16 -0
  164. package/dist/components/status-pill-style.js +15 -0
  165. package/dist/components/status-pill-style.js.map +1 -0
  166. package/dist/components/status.d.ts +66 -0
  167. package/dist/components/status.js +10 -0
  168. package/dist/components/status.js.map +1 -0
  169. package/dist/components/summary-list.js +3 -2
  170. package/dist/components/switch.js +4 -3
  171. package/dist/components/table.d.ts +19 -0
  172. package/dist/components/table.js +4 -3
  173. package/dist/components/text-input.js +5 -4
  174. package/dist/components/textarea.d.ts +5 -0
  175. package/dist/components/textarea.js +4 -3
  176. package/dist/components/tool-card.d.ts +107 -0
  177. package/dist/components/tool-card.js +11 -0
  178. package/dist/components/tool-card.js.map +1 -0
  179. package/dist/components/tool-kit-tokens.d.ts +25 -0
  180. package/dist/components/tool-kit-tokens.js +8 -0
  181. package/dist/components/tool-kit-tokens.js.map +1 -0
  182. package/dist/index.d.ts +11 -0
  183. package/dist/index.js +116 -70
  184. package/dist/standalone/atomic-ui.js +2047 -733
  185. package/dist/standalone/atomic-ui.js.map +4 -4
  186. package/package.json +2 -2
  187. package/dist/chunk-2D2IMQII.js.map +0 -1
  188. package/dist/chunk-2EP3IV3G.js.map +0 -1
  189. package/dist/chunk-2ZF3J7OO.js.map +0 -1
  190. package/dist/chunk-3T7J66Z2.js.map +0 -1
  191. package/dist/chunk-7UWJXPR3.js.map +0 -1
  192. package/dist/chunk-A4M3A4SZ.js.map +0 -1
  193. package/dist/chunk-AURT72IC.js.map +0 -1
  194. package/dist/chunk-AYKYHZGQ.js +0 -108
  195. package/dist/chunk-AYKYHZGQ.js.map +0 -1
  196. package/dist/chunk-D6NET2VB.js.map +0 -1
  197. package/dist/chunk-DN5YZFSG.js.map +0 -1
  198. package/dist/chunk-MLKNZL5J.js.map +0 -1
  199. package/dist/chunk-MOO63SHZ.js.map +0 -1
  200. package/dist/chunk-OJO62KRX.js.map +0 -1
  201. package/dist/chunk-ONED3PUB.js.map +0 -1
  202. package/dist/chunk-OZGKK3N5.js.map +0 -1
  203. package/dist/chunk-QU3U2CS2.js +0 -144
  204. package/dist/chunk-QU3U2CS2.js.map +0 -1
  205. package/dist/chunk-TJOYBDKS.js.map +0 -1
  206. package/dist/chunk-UFPI4I2Y.js.map +0 -1
  207. package/dist/chunk-V7EB7Q2M.js.map +0 -1
  208. package/dist/chunk-ZEIV5X3U.js.map +0 -1
@@ -3,12 +3,14 @@ import {
3
3
  } from "./chunk-6WVL3HOC.js";
4
4
  import {
5
5
  ImpaktElement,
6
- focusRing,
6
+ focusRing
7
+ } from "./chunk-72WNCCDC.js";
8
+ import {
7
9
  space,
8
10
  spaceAround,
9
11
  t,
10
12
  token
11
- } from "./chunk-V7EB7Q2M.js";
13
+ } from "./chunk-JTCTQBAX.js";
12
14
 
13
15
  // packages/ui/src/components/page.ts
14
16
  import { css, html, nothing } from "lit";
@@ -16,6 +18,7 @@ var widths = css`
16
18
  :host { --impakt-page-inner: ${token("layout.page-width", "1200px")}; }
17
19
  :host([width='narrow']) { --impakt-page-inner: 760px; }
18
20
  :host([width='wide']) { --impakt-page-inner: 1440px; }
21
+ :host([width='content']) { --impakt-page-inner: 1080px; }
19
22
  `;
20
23
  var margins = css`
21
24
  :host { --impakt-page-margin: ${token("layout.margin.phone", "16px")}; }
@@ -178,11 +181,34 @@ var ImpaktSection = class extends ImpaktElement {
178
181
  :host([tone='subtle']) .band { background: ${t.surfaceSubtle}; }
179
182
  :host([tone='inset']) .band { background: ${t.surfaceInset}; }
180
183
  :host([tone='card']) .band { background: ${t.surfaceCard}; }
184
+ :host([tone='board']) .band { background: var(--impakt-color-surface-board, var(--ik-surface-board, #e3e2dd)); }
185
+ /*
186
+ * A toned band sets what a button and a solid mark on it need, and resets what
187
+ * an outer band set, so a band inside another one, or a banner inside a band,
188
+ * never draws with colours meant for the band round it. --impakt-color-text-inverse
189
+ * is the colour that reads on the band's text colour: a dark button's words.
190
+ */
191
+ :host(:not([tone='none'])) .band { --impakt-button-primary: initial; --impakt-button-on-primary: initial; --impakt-button-primary-hover: initial; --impakt-color-text-inverse: initial; }
192
+ :host([tone='brand']) .band { --impakt-color-text-inverse: ${t.brand}; }
193
+ :host([tone='accent']) .band { --impakt-color-text-inverse: var(--impakt-solid-card); }
181
194
  :host([tone='brand']) .band { background: ${t.brand}; color: ${t.onBrand}; --impakt-eyebrow: ${t.onBrand}; --impakt-color-surface-card: color-mix(in srgb, ${t.onBrand} 10%, transparent); --impakt-color-text-heading: ${t.onBrand}; --impakt-color-text-default: ${t.onBrand}; --impakt-color-text-muted: ${t.onBrand}; --impakt-color-text-link: ${t.onBrand}; --impakt-color-text-link-hover: ${t.onBrand}; }
182
195
  /* Ink and accent bands take their colours from the host, because the band repaints the text colour for what is inside it. */
183
196
  :host([tone='ink']) { --impakt-band: ${t.text}; --impakt-band-on: ${t.surfaceCard}; --impakt-band-muted: color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text}); --impakt-solid-card: ${t.surfaceCard}; --impakt-solid-text: ${t.text}; --impakt-solid-heading: var(--impakt-color-text-heading, ${t.text}); --impakt-solid-muted: ${t.textMuted}; }
184
197
  :host([tone='accent']) { --impakt-band: ${token("color.accent.default", "#ffd43b")}; --impakt-band-on: ${token("color.accent.on", "#1a1a1a")}; --impakt-band-muted: ${token("color.accent.on", "#1a1a1a")}; --impakt-solid-card: ${t.surfaceCard}; --impakt-solid-text: ${t.text}; --impakt-solid-heading: var(--impakt-color-text-heading, ${t.text}); --impakt-solid-muted: ${t.textMuted}; }
185
198
  :host(:is([tone='ink'], [tone='accent'])) .band { background-color: var(--impakt-band); color: var(--impakt-band-on); --impakt-eyebrow: var(--impakt-band-muted); --impakt-color-surface-card: color-mix(in srgb, var(--impakt-band-on) 10%, transparent); --impakt-color-text-heading: var(--impakt-band-on); --impakt-color-text-default: var(--impakt-band-on); --impakt-color-text-muted: var(--impakt-band-muted); --impakt-color-text-link: var(--impakt-band-on); --impakt-color-text-link-hover: var(--impakt-band-on); }
199
+ /* On ink the cards are the raised ink with a darker rule (G2 ink-raised and line-inverse), not a wash. */
200
+ :host([tone='ink']) .band {
201
+ --impakt-color-text-inverse: var(--impakt-band);
202
+ --impakt-button-primary: var(--impakt-band-on);
203
+ --impakt-button-on-primary: var(--impakt-band);
204
+ --impakt-button-primary-hover: color-mix(in srgb, var(--impakt-band-on) 86%, var(--impakt-band));
205
+ /* Mixed from the band, so it is #1C1C1C on light ink and still a step off the band when dark turns the band over. */
206
+ --impakt-color-surface-card: color-mix(in srgb, var(--impakt-band) 95%, var(--impakt-band-on));
207
+ --impakt-color-line-soft: color-mix(in srgb, var(--impakt-band) 87%, var(--impakt-band-on));
208
+ /* The accent reads on light-theme ink only; the theme leaves it unset in dark, where the band turns paper. */
209
+ --impakt-site-menu-current: var(--impakt-color-accent-on-ink, currentColor);
210
+ --impakt-steps-current: var(--impakt-color-accent-on-ink, currentColor);
211
+ }
186
212
  /* The lines are a tenth of the band's own text colour, so they suit any tone. They carry no meaning. */
187
213
  :host([pattern]:not([pattern='none'])) .band { --impakt-pattern-line: color-mix(in srgb, currentColor 10%, transparent); }
188
214
  :host(:is([pattern='grid'], [pattern='blueprint'])) .band { background-image: linear-gradient(to right, var(--impakt-pattern-line) 1px, transparent 1px), linear-gradient(to bottom, var(--impakt-pattern-line) 1px, transparent 1px); background-size: 7rem 7rem; }
@@ -196,6 +222,7 @@ var ImpaktSection = class extends ImpaktElement {
196
222
  :host([padding='lg']) .band { padding-block: ${space(12)}; }
197
223
  :host([padding='xl']) .band { padding-block: ${space(16)}; }
198
224
  :host([padding='2xl']) .band { padding-block: clamp(${space(14)}, 8vw, ${space(28)}); }
225
+ :host([padding='3xl']) .band { padding-block: clamp(${space(16)}, 10vw, ${space(30)}); }
199
226
  .content { max-inline-size: var(--impakt-page-inner); margin-inline: auto; }
200
227
  `
201
228
  ];
@@ -211,4 +238,4 @@ export {
211
238
  ImpaktPage,
212
239
  ImpaktSection
213
240
  };
214
- //# sourceMappingURL=chunk-D6NET2VB.js.map
241
+ //# sourceMappingURL=chunk-ALFE35FS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/page.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { onServer } from '../base/server';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing } from '../base/styles';\nimport { space, spaceAround, t, token } from '../base/tokens';\n\n/** The widest a line of content runs, for each choice of `width`. */\nconst widths = css`\n :host { --impakt-page-inner: ${token('layout.page-width', '1200px')}; }\n :host([width='narrow']) { --impakt-page-inner: 760px; }\n :host([width='wide']) { --impakt-page-inner: 1440px; }\n :host([width='content']) { --impakt-page-inner: 1080px; }\n`;\n\n/**\n * The side margins, from the brand's layout: narrow on a phone, wider on a\n * tablet and a desktop. Measured against the page itself, so a page drawn in a\n * narrow preview gets phone margins whatever the window is.\n */\nconst margins = css`\n :host { --impakt-page-margin: ${token('layout.margin.phone', '16px')}; }\n @container impakt-page (min-width: 40rem) { .frame { --impakt-page-margin: ${token('layout.margin.tablet', '32px')}; } }\n @container impakt-page (min-width: 64rem) { .frame { --impakt-page-margin: ${token('layout.margin.desktop', '64px')}; } }\n`;\n\n/**\n * The frame every page sits in: a header, the page's own content, and a\n * footer, each kept to the brand's page width with the brand's side margins.\n *\n * A layout puts this at its root, with the site's header and footer in their\n * slots and the page content in the middle, so an app draws the same frame the\n * CMS shows. Without it, a page runs edge to edge.\n *\n * **It gives the page its landmarks.** The header, main content and footer are\n * `header`, `main` and `footer` elements, so a screen reader can jump between\n * them (1.3.1), and the first thing in the page is a \"Skip to content\" link\n * that appears when it has focus (2.4.1).\n *\n * @category layout\n * @icon layout\n * @slot header - The site's header: its logo, navigation and a call to action.\n * @slot - The page's own content.\n * @slot footer - The site's footer.\n */\nexport class ImpaktPage extends ImpaktElement {\n static properties = {\n width: { type: String, reflect: true },\n stickyHeader: { type: Boolean, reflect: true, attribute: 'sticky-header' },\n skipText: { type: String, attribute: 'skip-text' },\n noHeader: { type: Boolean, reflect: true, attribute: 'no-header' },\n noFooter: { type: Boolean, reflect: true, attribute: 'no-footer' },\n };\n /** How wide the content runs. Standard is the brand's page width; `content` is G2's 1080px column. */\n declare width: 'narrow' | 'standard' | 'content' | 'wide';\n /** Keep the header at the top of the screen while the page scrolls. */\n declare stickyHeader: boolean;\n /** The words of the link that skips past the header to the content. */\n declare skipText: string;\n /**\n * Leave the header landmark out. In a browser the page sees for itself whether a header was\n * given, so this is only for a page drawn on the server, where it cannot.\n */\n declare noHeader: boolean;\n /** Leave the footer landmark out, for a page drawn on the server with no footer. */\n declare noFooter: boolean;\n\n constructor() {\n super();\n this.width = 'standard';\n this.stickyHeader = false;\n this.skipText = 'Skip to content';\n this.noHeader = false;\n this.noFooter = false;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n widths,\n margins,\n css`\n :host { display: block; container: impakt-page / inline-size; }\n .frame { position: relative; display: flex; flex-direction: column; min-block-size: 100%; overflow-x: clip; }\n .inner { box-sizing: border-box; inline-size: 100%; max-inline-size: calc(var(--impakt-page-inner) + 2 * var(--impakt-page-margin)); margin-inline: auto; padding-inline: var(--impakt-page-margin); }\n header { background: ${token('color.surface.header', 'transparent')}; color: ${token('color.text.on-header', 'inherit')}; padding-block: ${space(4)}; }\n /* What sits in the header and footer takes their text colour, so words on a dark footer stay readable. */\n header { --impakt-color-text-default: ${token('color.text.on-header', 'inherit')}; --impakt-color-text-heading: ${token('color.text.on-header', 'inherit')}; --impakt-color-text-link: ${token('color.text.on-header', 'inherit')}; --impakt-color-text-link-hover: ${token('color.text.on-header', 'inherit')}; }\n footer { --impakt-color-text-default: ${token('color.text.on-footer', 'inherit')}; --impakt-color-text-heading: ${token('color.text.on-footer', 'inherit')}; --impakt-color-text-muted: ${token('color.text.on-footer', 'inherit')}; --impakt-color-text-link: ${token('color.text.on-footer', 'inherit')}; --impakt-color-text-link-hover: ${token('color.text.on-footer', 'inherit')}; }\n :host([sticky-header]) header { position: sticky; inset-block-start: 0; z-index: 10; }\n main { flex: 1; padding-block: ${space(6)} ${space(10)}; }\n main:focus { outline: none; }\n /* A page that opens on a full-picture hero: the header floats over it as a rounded bar. */\n :host([floating]) header { position: absolute; z-index: 20; inset-inline: 0; inset-block-start: var(--impakt-header-top, 0px); padding-block: ${space(6)} 0; background: transparent; border: 0; }\n :host([floating]) header .inner { inline-size: calc(100% - 2 * var(--impakt-page-margin)); max-inline-size: var(--impakt-page-inner); padding: ${space(3)} ${space(4)} ${space(3)} ${space(6)}; background: ${token('color.surface.header', '#fff')}; border-radius: ${t.radius2xl}; box-shadow: ${t.shadowLg}; }\n :host([floating]) main { padding-block-start: 0; }\n footer { background: ${token('color.surface.footer', 'transparent')}; color: ${token('color.text.on-footer', 'inherit')}; padding-block: ${space(8)}; border-block-start: ${t.borderThin} solid ${token('color.border.subtle', 'transparent')}; }\n .skip { position: absolute; inset-inline-start: ${space(2)}; inset-block-start: ${space(2)}; z-index: 20; padding: ${space(2)} ${space(4)}; background: ${t.surfaceCard}; color: ${t.link}; border-radius: ${t.radius}; transform: translateY(-200%); }\n .skip:not(:focus) { clip-path: inset(50%); }\n .skip:focus { transform: none; }\n .empty { display: none; }\n `,\n ];\n\n /**\n * Whether something was given for a slot. An element drawn on the server cannot see its own\n * children, so there the landmark is drawn unless `no-header` or `no-footer` says to leave it out.\n */\n private hasSlot(name: 'header' | 'footer'): boolean {\n if (name === 'header' ? this.noHeader : this.noFooter) return false;\n if (onServer) return true;\n return Array.from(this.children).some((c) => c.getAttribute('slot') === name);\n }\n\n private skip(event: Event): void {\n event.preventDefault();\n const main = this.renderRoot.querySelector('main');\n main?.focus();\n main?.scrollIntoView();\n }\n\n render(): TemplateResult {\n // The header and footer are left out when nothing is in them, so a page\n // with no site header has no empty landmark for a screen reader to land on.\n const header = this.hasSlot('header');\n const footer = this.hasSlot('footer');\n return html`<div class=\"frame\" part=\"frame\">\n <a class=\"skip\" href=\"#content\" part=\"skip\" @click=${this.skip}>${this.skipText}</a>\n ${header ? html`<header part=\"header\"><div class=\"inner\"><slot name=\"header\"></slot></div></header>` : nothing}\n <main id=\"content\" tabindex=\"-1\" part=\"main\"><div class=\"inner\"><slot></slot></div></main>\n ${footer ? html`<footer part=\"footer\"><div class=\"inner\"><slot name=\"footer\"></slot></div></footer>` : nothing}\n </div>`;\n }\n\n /**\n * The header floats when the page opens on a full-picture hero, sitting on the\n * picture itself, so nothing has to be set for it. It stays an ordinary bar\n * while editing, where the blocks are kept inside the page's box.\n */\n private place = (): void => {\n const hero = this.querySelector('impakt-hero[treatment=\"cover\"]');\n const editing = getComputedStyle(this).getPropertyValue('--impakt-bleed').trim() === '0';\n const floats = !!hero && !editing && this.opensOn(hero);\n this.toggleAttribute('floating', floats);\n if (!floats) return;\n const frame = this.renderRoot.querySelector('.frame');\n if (frame) this.style.setProperty('--impakt-header-top', `${Math.round(hero!.getBoundingClientRect().top - frame.getBoundingClientRect().top)}px`);\n };\n\n /** Whether nothing a reader would notice comes before this block, other than an announcement. */\n private opensOn(hero: Element): boolean {\n for (const element of Array.from(this.querySelectorAll('*'))) {\n if (element === hero) return true;\n if (element.closest('[slot=\"header\"],[slot=\"footer\"]')) continue;\n if (element.tagName.startsWith('IMPAKT-') && !/^IMPAKT-(STACK|SECTION|GRID|ANNOUNCEMENT)$/.test(element.tagName)) return false;\n }\n return false;\n }\n\n // A header or footer added after the first render still gets its landmark.\n connectedCallback(): void {\n super.connectedCallback();\n this.observer = new MutationObserver(() => this.requestUpdate());\n this.observer.observe(this, { childList: true, attributes: true, subtree: false, attributeFilter: ['slot'] });\n this.watcher = new MutationObserver(this.place);\n this.watcher.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: ['treatment'] });\n if (typeof ResizeObserver === 'function') {\n this.resize = new ResizeObserver(this.place);\n this.resize.observe(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.watcher?.disconnect();\n this.resize?.disconnect();\n }\n\n protected firstUpdated(): void {\n this.place();\n }\n\n private observer?: MutationObserver;\n private watcher?: MutationObserver;\n private resize?: ResizeObserver;\n}\n\n/**\n * A band across the whole width of the page, with its own background, and its\n * content kept to the page width inside it: a coloured strip of features, a\n * quote on a tinted background, a call to action at the foot of a page.\n *\n * Inside a Page it reaches the edges of the screen whatever the page width is,\n * so a page can alternate bands without any of them knowing the frame. Set\n * `bleed` off to keep the band to the page width, as a panel.\n *\n * @category layout\n * @icon section\n * @slot - The section's content.\n */\nexport class ImpaktSection extends ImpaktElement {\n static properties = {\n tone: { type: String, reflect: true },\n padding: { type: String, reflect: true },\n width: { type: String, reflect: true },\n bleed: { type: Boolean, reflect: true },\n pattern: { type: String, reflect: true },\n label: { type: String },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /**\n * The band's background. Text on it takes the matching colour, so it stays\n * readable. `board` is G2's blueprint grey (#E3E2DD). On `ink` the cards are\n * the raised ink (#1C1C1C) with a #2E2E2E rule, a primary button is the paper\n * with ink words and an outline button has a paper border.\n */\n declare tone: 'none' | 'subtle' | 'inset' | 'brand' | 'card' | 'ink' | 'accent' | 'board';\n /** Space inside the band, above and below its content. `3xl` is G2's 120px on a desktop and 64px on a phone. */\n declare padding: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';\n /** How wide the content inside runs. `content` is G2's 1080px column. */\n declare width: 'narrow' | 'standard' | 'content' | 'wide';\n /** Run the background to the edges of the screen. */\n declare bleed: boolean;\n /**\n * Fine lines drawn across the band: a square grid, a closer blueprint grid,\n * upright columns or ruled lines. They are decoration, drawn in the band's\n * own text colour at a tenth of its strength, and are left out in a forced\n * colours mode.\n */\n declare pattern: 'none' | 'grid' | 'blueprint' | 'columns' | 'ruled';\n /** A name for the section, so a screen reader can find it in the page's regions. Leave empty for none. */\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.tone = 'none';\n this.padding = 'lg';\n this.width = 'standard';\n this.bleed = true;\n this.pattern = 'none';\n this.label = '';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n widths,\n css`\n :host { display: block; --impakt-page-margin: inherit; }\n /* What a solid card on a brand band goes back to, since the band repaints these for its own text. */\n :host([tone='brand']) { --impakt-solid-card: ${t.surfaceCard}; --impakt-solid-text: ${t.text}; --impakt-solid-heading: var(--impakt-color-text-heading, ${t.text}); --impakt-solid-muted: ${t.textMuted}; }\n .band { box-sizing: border-box; border-radius: ${t.radiusLg}; }\n /* --impakt-bleed is 0 while editing, so a full-width block stays inside the box it is being edited in. */\n :host([bleed]) .band { border-radius: 0; margin-inline: calc(var(--impakt-bleed, 1) * (50% - 50vw)); padding-inline: max(${space(4)}, calc(var(--impakt-bleed, 1) * (50vw - 50%))); }\n :host([tone='subtle']) .band { background: ${t.surfaceSubtle}; }\n :host([tone='inset']) .band { background: ${t.surfaceInset}; }\n :host([tone='card']) .band { background: ${t.surfaceCard}; }\n :host([tone='board']) .band { background: var(--impakt-color-surface-board, var(--ik-surface-board, #e3e2dd)); }\n /*\n * A toned band sets what a button and a solid mark on it need, and resets what\n * an outer band set, so a band inside another one, or a banner inside a band,\n * never draws with colours meant for the band round it. --impakt-color-text-inverse\n * is the colour that reads on the band's text colour: a dark button's words.\n */\n :host(:not([tone='none'])) .band { --impakt-button-primary: initial; --impakt-button-on-primary: initial; --impakt-button-primary-hover: initial; --impakt-color-text-inverse: initial; }\n :host([tone='brand']) .band { --impakt-color-text-inverse: ${t.brand}; }\n :host([tone='accent']) .band { --impakt-color-text-inverse: var(--impakt-solid-card); }\n :host([tone='brand']) .band { background: ${t.brand}; color: ${t.onBrand}; --impakt-eyebrow: ${t.onBrand}; --impakt-color-surface-card: color-mix(in srgb, ${t.onBrand} 10%, transparent); --impakt-color-text-heading: ${t.onBrand}; --impakt-color-text-default: ${t.onBrand}; --impakt-color-text-muted: ${t.onBrand}; --impakt-color-text-link: ${t.onBrand}; --impakt-color-text-link-hover: ${t.onBrand}; }\n /* Ink and accent bands take their colours from the host, because the band repaints the text colour for what is inside it. */\n :host([tone='ink']) { --impakt-band: ${t.text}; --impakt-band-on: ${t.surfaceCard}; --impakt-band-muted: color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text}); --impakt-solid-card: ${t.surfaceCard}; --impakt-solid-text: ${t.text}; --impakt-solid-heading: var(--impakt-color-text-heading, ${t.text}); --impakt-solid-muted: ${t.textMuted}; }\n :host([tone='accent']) { --impakt-band: ${token('color.accent.default', '#ffd43b')}; --impakt-band-on: ${token('color.accent.on', '#1a1a1a')}; --impakt-band-muted: ${token('color.accent.on', '#1a1a1a')}; --impakt-solid-card: ${t.surfaceCard}; --impakt-solid-text: ${t.text}; --impakt-solid-heading: var(--impakt-color-text-heading, ${t.text}); --impakt-solid-muted: ${t.textMuted}; }\n :host(:is([tone='ink'], [tone='accent'])) .band { background-color: var(--impakt-band); color: var(--impakt-band-on); --impakt-eyebrow: var(--impakt-band-muted); --impakt-color-surface-card: color-mix(in srgb, var(--impakt-band-on) 10%, transparent); --impakt-color-text-heading: var(--impakt-band-on); --impakt-color-text-default: var(--impakt-band-on); --impakt-color-text-muted: var(--impakt-band-muted); --impakt-color-text-link: var(--impakt-band-on); --impakt-color-text-link-hover: var(--impakt-band-on); }\n /* On ink the cards are the raised ink with a darker rule (G2 ink-raised and line-inverse), not a wash. */\n :host([tone='ink']) .band {\n --impakt-color-text-inverse: var(--impakt-band);\n --impakt-button-primary: var(--impakt-band-on);\n --impakt-button-on-primary: var(--impakt-band);\n --impakt-button-primary-hover: color-mix(in srgb, var(--impakt-band-on) 86%, var(--impakt-band));\n /* Mixed from the band, so it is #1C1C1C on light ink and still a step off the band when dark turns the band over. */\n --impakt-color-surface-card: color-mix(in srgb, var(--impakt-band) 95%, var(--impakt-band-on));\n --impakt-color-line-soft: color-mix(in srgb, var(--impakt-band) 87%, var(--impakt-band-on));\n /* The accent reads on light-theme ink only; the theme leaves it unset in dark, where the band turns paper. */\n --impakt-site-menu-current: var(--impakt-color-accent-on-ink, currentColor);\n --impakt-steps-current: var(--impakt-color-accent-on-ink, currentColor);\n }\n /* The lines are a tenth of the band's own text colour, so they suit any tone. They carry no meaning. */\n :host([pattern]:not([pattern='none'])) .band { --impakt-pattern-line: color-mix(in srgb, currentColor 10%, transparent); }\n :host(:is([pattern='grid'], [pattern='blueprint'])) .band { background-image: linear-gradient(to right, var(--impakt-pattern-line) 1px, transparent 1px), linear-gradient(to bottom, var(--impakt-pattern-line) 1px, transparent 1px); background-size: 7rem 7rem; }\n :host([pattern='blueprint']) .band { background-size: 1.75rem 1.75rem; }\n :host([pattern='columns']) .band { background-image: linear-gradient(to right, var(--impakt-pattern-line) 1px, transparent 1px); background-size: 5.625rem 100%; }\n :host([pattern='ruled']) .band { background-image: linear-gradient(to bottom, var(--impakt-pattern-line) 1px, transparent 1px); background-size: 100% 2.5rem; }\n @media (forced-colors: active) { .band { background-image: none !important; } }\n :host(:not([bleed]):not([tone='none'])) .band { padding-inline: ${space(6)}; }\n :host([padding='sm']) .band { padding-block: ${space(4)}; }\n :host([padding='md']) .band { padding-block: ${space(8)}; }\n :host([padding='lg']) .band { padding-block: ${space(12)}; }\n :host([padding='xl']) .band { padding-block: ${space(16)}; }\n :host([padding='2xl']) .band { padding-block: clamp(${space(14)}, 8vw, ${space(28)}); }\n :host([padding='3xl']) .band { padding-block: clamp(${space(16)}, 10vw, ${space(30)}); }\n .content { max-inline-size: var(--impakt-page-inner); margin-inline: auto; }\n `,\n ];\n\n render(): TemplateResult {\n return html`<section class=\"band\" part=\"band\" aria-label=${this.label || nothing} role=${this.label ? nothing : 'presentation'}><div class=\"content\" part=\"content\"><slot></slot></div></section>`;\n }\n}\n\ncustomElements.define('impakt-page', ImpaktPage);\ncustomElements.define('impakt-section', ImpaktSection);\ndeclare global {\n interface HTML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A;AAAA,IAGrF;AAAA;AAAA,EAEA,SAAyB;AACvB,WAAO,oDAAoD,KAAK,SAAS,OAAO,SAAS,KAAK,QAAQ,UAAU,cAAc;AAAA,EAChI;AACF;AAEA,eAAe,OAAO,eAAe,UAAU;AAC/C,eAAe,OAAO,kBAAkB,aAAa;","names":[]}
@@ -0,0 +1,184 @@
1
+ import {
2
+ kit
3
+ } from "./chunk-XX6JZW5N.js";
4
+ import {
5
+ ImpaktElement,
6
+ say
7
+ } from "./chunk-72WNCCDC.js";
8
+ import {
9
+ space,
10
+ t
11
+ } from "./chunk-JTCTQBAX.js";
12
+
13
+ // packages/ui/src/components/meter.ts
14
+ import { css, html, nothing } from "lit";
15
+ var clamp = (value, min, max) => Math.min(max, Math.max(min, value));
16
+ var share = (value, min, max) => max > min ? (clamp(value, min, max) - min) / (max - min) * 100 : 0;
17
+ var bar = css`
18
+ .track {
19
+ position: relative;
20
+ display: block;
21
+ block-size: 8px;
22
+ min-inline-size: 4rem;
23
+ background: ${kit.lineSoft};
24
+ border-radius: 0;
25
+ overflow: hidden;
26
+ }
27
+ .fill {
28
+ display: block;
29
+ block-size: 100%;
30
+ background: ${t.text};
31
+ }
32
+ .figure {
33
+ font-family: ${t.fontMono};
34
+ font-size: ${kit.small};
35
+ font-variant-numeric: tabular-nums;
36
+ color: ${t.text};
37
+ }
38
+ @media (forced-colors: active) {
39
+ .track {
40
+ border: 1px solid CanvasText;
41
+ }
42
+ .fill {
43
+ background: CanvasText;
44
+ forced-color-adjust: none;
45
+ }
46
+ }
47
+ `;
48
+ var ImpaktMeter = class extends ImpaktElement {
49
+ static {
50
+ this.properties = {
51
+ label: { type: String },
52
+ value: { type: Number },
53
+ min: { type: Number },
54
+ max: { type: Number },
55
+ valueText: { type: String, attribute: "value-text" },
56
+ showValue: { type: Boolean, attribute: "show-value", reflect: true }
57
+ };
58
+ }
59
+ constructor() {
60
+ super();
61
+ this.label = "";
62
+ this.value = 0;
63
+ this.min = 0;
64
+ this.max = 100;
65
+ this.valueText = "";
66
+ this.showValue = false;
67
+ }
68
+ static {
69
+ this.styles = [
70
+ ...ImpaktElement.styles,
71
+ bar,
72
+ css`
73
+ :host {
74
+ display: block;
75
+ }
76
+ .head {
77
+ display: flex;
78
+ flex-wrap: wrap;
79
+ justify-content: space-between;
80
+ gap: ${space(1)} ${space(3)};
81
+ margin-block-end: ${space(2)};
82
+ font-size: ${kit.small};
83
+ }
84
+ .head:empty {
85
+ display: none;
86
+ }
87
+ `
88
+ ];
89
+ }
90
+ render() {
91
+ const now = clamp(this.value, this.min, this.max);
92
+ return html`<div class="head">${this.label ? html`<span class="label" id=${this.id_("label")}>${this.label}</span>` : nothing}${this.showValue ? html`<span class="figure" aria-hidden="true">${this.valueText || now}</span>` : nothing}</div><span
93
+ class="track"
94
+ part="track"
95
+ role="meter"
96
+ aria-labelledby=${this.label ? this.id_("label") : nothing}
97
+ aria-label=${this.label ? nothing : say("Meter")}
98
+ aria-valuemin=${this.min}
99
+ aria-valuemax=${this.max}
100
+ aria-valuenow=${now}
101
+ aria-valuetext=${this.valueText || nothing}
102
+ ><span class="fill" part="fill" style=${`inline-size:${share(now, this.min, this.max)}%`}></span
103
+ ></span>`;
104
+ }
105
+ };
106
+ var ImpaktScoreBars = class extends ImpaktElement {
107
+ static {
108
+ this.properties = {
109
+ label: { type: String },
110
+ items: { type: Array },
111
+ max: { type: Number }
112
+ };
113
+ }
114
+ constructor() {
115
+ super();
116
+ this.label = "Scores";
117
+ this.items = [];
118
+ this.max = 100;
119
+ }
120
+ static {
121
+ this.styles = [
122
+ ...ImpaktElement.styles,
123
+ bar,
124
+ css`
125
+ :host {
126
+ display: block;
127
+ container-type: inline-size;
128
+ }
129
+ ul {
130
+ margin: 0;
131
+ padding: 0;
132
+ list-style: none;
133
+ }
134
+ li {
135
+ display: grid;
136
+ grid-template-columns: minmax(8rem, 12rem) minmax(4rem, 1fr) 3ch minmax(0, 7rem);
137
+ align-items: center;
138
+ gap: ${space(2)} ${space(4)};
139
+ padding-block: ${space(3)};
140
+ font-size: ${kit.small};
141
+ }
142
+ .figure {
143
+ text-align: end;
144
+ }
145
+ @container (max-width: 34rem) {
146
+ li {
147
+ grid-template-columns: minmax(0, 1fr) 3ch;
148
+ }
149
+ .name {
150
+ grid-column: 1 / -1;
151
+ }
152
+ .pill {
153
+ grid-column: 1 / -1;
154
+ }
155
+ }
156
+ `
157
+ ];
158
+ }
159
+ render() {
160
+ return html`<ul part="list" role="list" aria-label=${this.label}>
161
+ ${this.items.map((item, i) => {
162
+ const max = item.max ?? this.max;
163
+ const now = clamp(item.value, 0, max);
164
+ const id = this.id_(`score-${i}`);
165
+ return html`<li part="row">
166
+ <span class="name" id=${id}>${item.label}</span>
167
+ <span class="track" part="track" role="meter" aria-labelledby=${id} aria-valuemin="0" aria-valuemax=${max} aria-valuenow=${now}
168
+ ><span class="fill" part="fill" style=${`inline-size:${share(now, 0, max)}%`}></span
169
+ ></span>
170
+ <span class="figure" aria-hidden="true">${now}</span>
171
+ <span class="pill">${item.status ? html`<impakt-status tone=${item.tone ?? "warn"}>${item.status}</impakt-status>` : nothing}</span>
172
+ </li>`;
173
+ })}
174
+ </ul>`;
175
+ }
176
+ };
177
+ customElements.define("impakt-meter", ImpaktMeter);
178
+ customElements.define("impakt-score-bars", ImpaktScoreBars);
179
+
180
+ export {
181
+ ImpaktMeter,
182
+ ImpaktScoreBars
183
+ };
184
+ //# sourceMappingURL=chunk-AYINRYNC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/meter.ts"],"sourcesContent":["/**\n * A meter, and a labelled list of meters with their figures.\n */\nimport { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { say } from '../base/say';\nimport { space, t } from '../base/tokens';\nimport { kit } from './tool-kit-tokens';\nimport type { StatusTone } from './status';\nimport './status';\n\nconst clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\nconst share = (value: number, min: number, max: number) => (max > min ? ((clamp(value, min, max) - min) / (max - min)) * 100 : 0);\n\n/** The bar itself, shared by the meter and the score list. */\nconst bar = css`\n .track {\n position: relative;\n display: block;\n block-size: 8px;\n min-inline-size: 4rem;\n background: ${kit.lineSoft};\n border-radius: 0;\n overflow: hidden;\n }\n .fill {\n display: block;\n block-size: 100%;\n background: ${t.text};\n }\n .figure {\n font-family: ${t.fontMono};\n font-size: ${kit.small};\n font-variant-numeric: tabular-nums;\n color: ${t.text};\n }\n @media (forced-colors: active) {\n .track {\n border: 1px solid CanvasText;\n }\n .fill {\n background: CanvasText;\n forced-color-adjust: none;\n }\n }\n`;\n\n/**\n * How full something is, such as a word count against its limit: an 8px\n * square bar, an ink fill on a soft track.\n *\n * It is a `meter`, with its minimum, maximum and value, so a screen reader\n * says how full it is. `value-text` replaces the number it reads, such as\n * \"412 of 500 words\". `show-value` draws the figure beside the label too.\n *\n * Figma: kit `33:495`; Tender word count `36:716`.\n *\n * @category feedback\n * @icon progress\n * @csspart track - The bar.\n * @csspart fill - How much of it is filled.\n */\nexport class ImpaktMeter extends ImpaktElement {\n static properties = {\n label: { type: String },\n value: { type: Number },\n min: { type: Number },\n max: { type: Number },\n valueText: { type: String, attribute: 'value-text' },\n showValue: { type: Boolean, attribute: 'show-value', reflect: true },\n };\n\n /** What is being measured. */\n declare label: string;\n declare value: number;\n declare min: number;\n declare max: number;\n /** What a screen reader says in place of the number, and what is drawn when `show-value` is set. */\n declare valueText: string;\n /** Draw the figure beside the label. */\n declare showValue: boolean;\n\n constructor() {\n super();\n this.label = '';\n this.value = 0;\n this.min = 0;\n this.max = 100;\n this.valueText = '';\n this.showValue = false;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n bar,\n css`\n :host {\n display: block;\n }\n .head {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n gap: ${space(1)} ${space(3)};\n margin-block-end: ${space(2)};\n font-size: ${kit.small};\n }\n .head:empty {\n display: none;\n }\n `,\n ];\n\n render(): TemplateResult {\n const now = clamp(this.value, this.min, this.max);\n return html`<div class=\"head\">${this.label ? html`<span class=\"label\" id=${this.id_('label')}>${this.label}</span>` : nothing}${\n this.showValue ? html`<span class=\"figure\" aria-hidden=\"true\">${this.valueText || now}</span>` : nothing\n }</div><span\n class=\"track\"\n part=\"track\"\n role=\"meter\"\n aria-labelledby=${this.label ? this.id_('label') : nothing}\n aria-label=${this.label ? nothing : say('Meter')}\n aria-valuemin=${this.min}\n aria-valuemax=${this.max}\n aria-valuenow=${now}\n aria-valuetext=${this.valueText || nothing}\n ><span class=\"fill\" part=\"fill\" style=${`inline-size:${share(now, this.min, this.max)}%`}></span\n ></span>`;\n }\n}\n\nexport interface ScoreItem {\n label: string;\n value: number;\n /** Defaults to the list's `max`. */\n max?: number;\n /** A pill after the figure, such as \"Weakest\". */\n status?: string;\n /** The pill's tone. Defaults to `warn`, \"this needs your attention\". */\n tone?: StatusTone;\n}\n\n/**\n * A labelled list of scores, each a meter with its figure, and a pill such as\n * \"Weakest\" beside the one that needs attention.\n *\n * Each row is a list item holding a `meter` named by its label, so a screen\n * reader can move from score to score and hear \"Conversion, 41\". The figure is\n * drawn for the eye and the meter carries it for assistive technology. On a\n * narrow screen the label sits above its bar.\n *\n * Figma: Teardown scores `39:801`.\n *\n * @category feedback\n * @icon progress\n * @csspart list - The list.\n * @csspart row - Each score.\n */\nexport class ImpaktScoreBars extends ImpaktElement {\n static properties = {\n label: { type: String },\n items: { type: Array },\n max: { type: Number },\n };\n\n /** What the scores are, as the list's name: \"Scores\". */\n declare label: string;\n declare items: ScoreItem[];\n /** The top of every scale that does not give its own. */\n declare max: number;\n\n constructor() {\n super();\n this.label = 'Scores';\n this.items = [];\n this.max = 100;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n bar,\n css`\n :host {\n display: block;\n container-type: inline-size;\n }\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li {\n display: grid;\n grid-template-columns: minmax(8rem, 12rem) minmax(4rem, 1fr) 3ch minmax(0, 7rem);\n align-items: center;\n gap: ${space(2)} ${space(4)};\n padding-block: ${space(3)};\n font-size: ${kit.small};\n }\n .figure {\n text-align: end;\n }\n @container (max-width: 34rem) {\n li {\n grid-template-columns: minmax(0, 1fr) 3ch;\n }\n .name {\n grid-column: 1 / -1;\n }\n .pill {\n grid-column: 1 / -1;\n }\n }\n `,\n ];\n\n render(): TemplateResult {\n return html`<ul part=\"list\" role=\"list\" aria-label=${this.label}>\n ${this.items.map((item, i) => {\n const max = item.max ?? this.max;\n const now = clamp(item.value, 0, max);\n const id = this.id_(`score-${i}`);\n return html`<li part=\"row\">\n <span class=\"name\" id=${id}>${item.label}</span>\n <span class=\"track\" part=\"track\" role=\"meter\" aria-labelledby=${id} aria-valuemin=\"0\" aria-valuemax=${max} aria-valuenow=${now}\n ><span class=\"fill\" part=\"fill\" style=${`inline-size:${share(now, 0, max)}%`}></span\n ></span>\n <span class=\"figure\" aria-hidden=\"true\">${now}</span>\n <span class=\"pill\">${item.status ? html`<impakt-status tone=${item.tone ?? 'warn'}>${item.status}</impakt-status>` : nothing}</span>\n </li>`;\n })}\n </ul>`;\n }\n}\n\ncustomElements.define('impakt-meter', ImpaktMeter);\ncustomElements.define('impakt-score-bars', ImpaktScoreBars);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-meter': ImpaktMeter;\n 'impakt-score-bars': ImpaktScoreBars;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAGA,SAAS,KAAK,MAAM,eAAoC;AAQxD,IAAM,QAAQ,CAAC,OAAe,KAAa,QAAgB,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC7F,IAAM,QAAQ,CAAC,OAAe,KAAa,QAAiB,MAAM,OAAQ,MAAM,OAAO,KAAK,GAAG,IAAI,QAAQ,MAAM,OAAQ,MAAM;AAG/H,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAMM,IAAI,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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oCAAoC,GAAG,kBAAkB,GAAG;AAAA,oDACpF,eAAe,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG;AAAA;AAAA,oDAEpC,GAAG;AAAA,+BACxB,KAAK,SAAS,2BAA2B,KAAK,QAAQ,MAAM,IAAI,KAAK,MAAM,qBAAqB,OAAO;AAAA;AAAA,IAEhI,CAAC,CAAC;AAAA;AAAA,EAEN;AACF;AAEA,eAAe,OAAO,gBAAgB,WAAW;AACjD,eAAe,OAAO,qBAAqB,eAAe;","names":[]}
@@ -1,24 +1,31 @@
1
+ import {
2
+ statusPill,
3
+ statusPillStyles
4
+ } from "./chunk-6CDQSHVW.js";
1
5
  import {
2
6
  pageLocale
3
7
  } from "./chunk-UNGAG44M.js";
4
8
  import {
5
9
  iconSvg
6
- } from "./chunk-AL4IUSML.js";
10
+ } from "./chunk-5OYQZWP2.js";
7
11
  import {
8
12
  ImpaktElement,
9
13
  focusRing,
14
+ targetSize,
15
+ touchTarget,
16
+ visuallyHidden
17
+ } from "./chunk-72WNCCDC.js";
18
+ import {
10
19
  fontSize,
11
20
  fontWeight,
12
21
  space,
13
22
  t,
14
- targetSize,
15
- token,
16
- touchTarget,
17
- visuallyHidden
18
- } from "./chunk-V7EB7Q2M.js";
23
+ token
24
+ } from "./chunk-JTCTQBAX.js";
19
25
 
20
26
  // packages/ui/src/components/rows.ts
21
27
  import { html, css, nothing } from "lit";
28
+ var INVERSE = token("color.text.inverse", "var(--impakt-solid-card, var(--impakt-color-surface-card, #ffffff))");
22
29
  var LIGHT = token("font.weight.light", "300");
23
30
  var ImpaktStatTile = class extends ImpaktElement {
24
31
  static {
@@ -28,7 +35,9 @@ var ImpaktStatTile = class extends ImpaktElement {
28
35
  caption: { type: String },
29
36
  href: { type: String },
30
37
  tone: { type: String, reflect: true },
31
- size: { type: String, reflect: true }
38
+ size: { type: String, reflect: true },
39
+ status: { type: String },
40
+ statusTone: { type: String, attribute: "status-tone" }
32
41
  };
33
42
  }
34
43
  constructor() {
@@ -39,36 +48,41 @@ var ImpaktStatTile = class extends ImpaktElement {
39
48
  this.href = "";
40
49
  this.tone = "plain";
41
50
  this.size = "md";
51
+ this.status = "";
52
+ this.statusTone = "neutral";
42
53
  }
43
54
  static {
44
55
  this.styles = [
45
56
  ...ImpaktElement.styles,
46
57
  focusRing,
58
+ statusPillStyles,
47
59
  css`
48
60
  :host { display: block; }
49
61
  .tile {
50
62
  box-sizing: border-box;
51
63
  display: flex;
52
64
  flex-direction: column;
53
- gap: ${space(1)};
65
+ align-items: flex-start;
66
+ gap: ${space(2.5)};
54
67
  block-size: 100%;
55
- min-block-size: 84px;
56
- padding: ${space(3)} ${space(4)};
57
- border-radius: ${t.radiusLg};
58
- background: ${t.surfaceInset};
68
+ padding: ${space(5)};
69
+ border: ${t.borderThin} solid ${t.text};
70
+ border-radius: ${t.radius};
71
+ background: ${t.surfaceCard};
59
72
  color: ${t.text};
60
73
  text-decoration: none;
61
74
  }
62
- a.tile:hover { background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 5%); }
63
- .label { font-size: 11px; font-weight: ${fontWeight("medium")}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; }
64
- .value { margin-block-start: auto; font-size: 34px; line-height: 1.1; font-weight: ${LIGHT}; font-variant-numeric: tabular-nums; }
65
- .caption { font-size: ${fontSize("sm")}; color: ${t.textMuted}; }
66
- :host([size='lg']) .tile { min-block-size: 200px; padding: ${space(6)}; border-radius: ${t.radiusXl}; }
67
- :host([size='lg']) .label { font-size: ${fontSize("sm")}; letter-spacing: normal; text-transform: none; }
68
- :host([size='lg']) .value { font-size: 64px; line-height: 1; }
69
- :host([tone='brand']) .tile { background: ${t.brand}; color: ${t.onBrand}; }
75
+ a.tile:hover { background: color-mix(in srgb, ${t.surfaceCard}, ${t.text} 4%); }
76
+ .label { font-family: ${t.fontMono}; font-size: ${fontSize("sm")}; font-weight: ${fontWeight("regular")}; color: ${t.textMuted}; }
77
+ /* G2: Archivo SemiBold 52/1.04, -4%. A word fits as well as a number. */
78
+ .value { font-size: var(--impakt-type-stat-size, 3.25rem); line-height: 1.04; letter-spacing: -0.04em; font-weight: ${fontWeight("semibold")}; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
79
+ .caption { font-size: ${fontSize("sm")}; line-height: 1.45; color: ${t.textMuted}; }
80
+ :host([size='lg']) .tile { min-block-size: 200px; padding: ${space(6)}; }
81
+ :host([size='lg']) .value { margin-block-start: auto; font-size: 64px; line-height: 1; font-weight: ${LIGHT}; }
82
+ :host([tone='brand']) .tile { background: ${t.brand}; color: ${t.onBrand}; border-color: ${t.brand}; }
70
83
  :host([tone='brand']) a.tile:hover { background: ${t.brandHover}; }
71
84
  :host([tone='brand']) .label, :host([tone='brand']) .caption { color: ${t.onBrand}; }
85
+ @media (max-width: 40rem) { .value { font-size: 2.5rem; } }
72
86
  @media (forced-colors: active) { .tile { border: 1px solid CanvasText; } }
73
87
  `
74
88
  ];
@@ -78,6 +92,7 @@ var ImpaktStatTile = class extends ImpaktElement {
78
92
  <span class="label" part="label">${this.label}</span>
79
93
  <span class="value" part="value">${this.value}</span>
80
94
  ${this.caption ? html`<span class="caption" part="caption">${this.caption}</span>` : nothing}
95
+ ${statusPill(this.status, this.statusTone)}
81
96
  `;
82
97
  return this.href ? html`<a class="tile" href=${this.href} part="tile">${inner}</a>` : html`<div class="tile" part="tile">${inner}</div>`;
83
98
  }
@@ -144,6 +159,7 @@ var ImpaktRow = class extends ImpaktElement {
144
159
  constructor() {
145
160
  super();
146
161
  this.filled = { start: false, end: false };
162
+ this.selected = false;
147
163
  this.heading = "";
148
164
  this.meta = "";
149
165
  this.href = "";
@@ -156,7 +172,8 @@ var ImpaktRow = class extends ImpaktElement {
156
172
  meta: { type: String },
157
173
  href: { type: String },
158
174
  divided: { type: Boolean, reflect: true },
159
- muted: { type: Boolean, reflect: true }
175
+ muted: { type: Boolean, reflect: true },
176
+ selected: { type: Boolean, reflect: true }
160
177
  };
161
178
  }
162
179
  static {
@@ -170,7 +187,8 @@ var ImpaktRow = class extends ImpaktElement {
170
187
  .text { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${space(0.5)}; }
171
188
  .title { font-size: ${fontSize("md")}; font-weight: ${fontWeight("medium")}; color: ${t.text}; }
172
189
  :host([muted]) .title { color: ${t.textMuted}; font-weight: ${fontWeight("regular")}; }
173
- .meta { font-size: ${fontSize("sm")}; color: ${t.textMuted}; }
190
+ /* The meta is a label: the code face where the brand sets its labels in one, as G2 does (36:452, 37:646). */
191
+ .meta { font-family: ${t.fontEyebrow}; font-size: ${fontSize("sm")}; color: ${t.textMuted}; }
174
192
  a { color: inherit; text-decoration: none; }
175
193
  /* The link is stretched over the row, so the row is one target. */
176
194
  a::after { content: ''; position: absolute; inset: 0; border-radius: ${t.radius}; }
@@ -182,6 +200,10 @@ var ImpaktRow = class extends ImpaktElement {
182
200
  /* Controls at the end stay pressable above the stretched link. */
183
201
  .end { position: relative; z-index: 1; }
184
202
  .chevron { flex: none; color: ${t.textMuted}; }
203
+ :host([selected]) .row { padding-inline: ${space(4)}; background: ${t.text}; --impakt-color-text-default: ${INVERSE}; --impakt-color-text-muted: color-mix(in srgb, ${INVERSE} 72%, ${t.text}); --impakt-color-text-inverse: ${t.text}; }
204
+ :host([selected]) :is(.title, .meta, .chevron) { color: ${INVERSE}; }
205
+ :host([selected]) .meta, :host([selected]) .chevron { color: color-mix(in srgb, ${INVERSE} 72%, ${t.text}); }
206
+ @media (forced-colors: active) { :host([selected]) .row { outline: 2px solid Highlight; } }
185
207
  `
186
208
  ];
187
209
  }
@@ -196,7 +218,7 @@ var ImpaktRow = class extends ImpaktElement {
196
218
  }
197
219
  render() {
198
220
  const title = this.href ? html`<a class="title" href=${this.href} part="link">${this.heading}</a>` : html`<span class="title" part="title">${this.heading}</span>`;
199
- return html`<div class="row" part="row">
221
+ return html`<div class="row" part="row" aria-current=${this.selected ? "true" : nothing}>
200
222
  <div class="start ${this.filled.start ? "" : "empty"}"><slot name="start" @slotchange=${this.onSlot}></slot></div>
201
223
  <div class="text">${title}${this.meta ? html`<span class="meta" part="meta">${this.meta}</span>` : nothing}</div>
202
224
  <div class="end ${this.filled.end ? "" : "empty"}"><slot name="end" @slotchange=${this.onSlot}></slot></div>
@@ -236,20 +258,20 @@ var ImpaktFilterChip = class extends ImpaktElement {
236
258
  display: inline-flex;
237
259
  align-items: center;
238
260
  gap: ${space(2)};
239
- min-block-size: 36px;
261
+ min-block-size: 35px;
240
262
  padding: 0 ${space(3.5)};
241
263
  font: inherit;
242
264
  font-size: ${fontSize("sm")};
243
- font-weight: ${fontWeight("medium")};
265
+ font-weight: ${fontWeight("regular")};
244
266
  color: ${t.text};
245
267
  background: ${t.surfaceCard};
246
- border: ${t.borderThin} solid ${t.hairline};
247
- border-radius: 999px;
268
+ border: ${t.borderThin} solid ${t.text};
269
+ border-radius: var(--impakt-radius-pill, calc(${t.radius} * 9999));
248
270
  cursor: pointer;
249
271
  white-space: nowrap;
250
272
  }
251
273
  button:hover:not(:disabled) { background: ${t.surfaceInset}; }
252
- button[aria-pressed='true'] { background: ${t.text}; color: ${t.surfaceCard}; border-color: ${t.text}; }
274
+ button[aria-pressed='true'] { background: ${t.text}; color: ${INVERSE}; border-color: ${t.text}; }
253
275
  button:disabled { cursor: not-allowed; opacity: 0.5; }
254
276
  .count { font-variant-numeric: tabular-nums; color: ${t.textMuted}; }
255
277
  button[aria-pressed='true'] .count { color: inherit; opacity: 0.8; }
@@ -282,4 +304,4 @@ export {
282
304
  ImpaktRow,
283
305
  ImpaktFilterChip
284
306
  };
285
- //# sourceMappingURL=chunk-2D2IMQII.js.map
307
+ //# sourceMappingURL=chunk-BAITBJUC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/rows.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize, touchTarget, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t, token } from '../base/tokens';\nimport { pageLocale } from '../base/locale';\nimport { iconSvg } from './icon';\nimport { statusPill, statusPillStyles, type StatusTone } from './status-pill-style';\n\n/** The colour that reads on the text colour, which a toned band sets; the card otherwise. */\nconst INVERSE = token('color.text.inverse', 'var(--impakt-solid-card, var(--impakt-color-surface-card, #ffffff))');\n\n/** The light weight large numbers are set in, 300 when the theme does not say. */\nconst LIGHT = token('font.weight.light', '300');\n\n/**\n * A count with its name: \"UK 4\", \"Active import jobs 12\". A dashboard shows a\n * row of them.\n *\n * **The name comes before the number in the reading order.** A screen reader\n * says \"UK, 4\", which makes sense heard on its own; \"4, UK\" does not. With\n * `href` the whole tile is one link, named by the label, the value and the\n * caption together.\n *\n * **It is the G2 summary tile** (frames 33:451, 36:473, 37:469, 39:770): white,\n * a 1px ink border, the label in the code face, the figure large and tight\n * (a word works as the figure too, such as \"First audit\"), the note under it,\n * and under the note an optional status pill, such as \"All proven\". The\n * status is words, so it does not rest on its dot's colour.\n *\n * @category content\n * @icon badge\n */\nexport class ImpaktStatTile extends ImpaktElement {\n static properties = {\n label: { type: String },\n value: { type: String },\n caption: { type: String },\n href: { type: String },\n tone: { type: String, reflect: true },\n size: { type: String, reflect: true },\n status: { type: String },\n statusTone: { type: String, attribute: 'status-tone' },\n };\n /** What is counted, such as \"UK\" or \"Active import jobs\". */\n declare label: string;\n /** The count or figure, such as \"4\". */\n declare value: string;\n /** A line under the figure, such as \"3 arriving in the next two weeks\". */\n declare caption: string;\n /** Where the tile goes when it is pressed, such as the list it counts. */\n declare href: string;\n /** `plain` is a quiet tile on a card; `brand` is the one figure a screen leads with. */\n declare tone: 'plain' | 'brand';\n /** `lg` sets the figure larger, for the lead figure. */\n declare size: 'md' | 'lg';\n /** A status under the note, drawn as a pill, such as \"All proven\". */\n declare status: string;\n /** The status's tone. */\n declare statusTone: StatusTone;\n\n constructor() {\n super();\n this.label = '';\n this.value = '';\n this.caption = '';\n this.href = '';\n this.tone = 'plain';\n this.size = 'md';\n this.status = '';\n this.statusTone = 'neutral';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n statusPillStyles,\n css`\n :host { display: block; }\n .tile {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: ${space(2.5)};\n block-size: 100%;\n padding: ${space(5)};\n border: ${t.borderThin} solid ${t.text};\n border-radius: ${t.radius};\n background: ${t.surfaceCard};\n color: ${t.text};\n text-decoration: none;\n }\n a.tile:hover { background: color-mix(in srgb, ${t.surfaceCard}, ${t.text} 4%); }\n .label { font-family: ${t.fontMono}; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('regular')}; color: ${t.textMuted}; }\n /* G2: Archivo SemiBold 52/1.04, -4%. A word fits as well as a number. */\n .value { font-size: var(--impakt-type-stat-size, 3.25rem); line-height: 1.04; letter-spacing: -0.04em; font-weight: ${fontWeight('semibold')}; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }\n .caption { font-size: ${fontSize('sm')}; line-height: 1.45; color: ${t.textMuted}; }\n :host([size='lg']) .tile { min-block-size: 200px; padding: ${space(6)}; }\n :host([size='lg']) .value { margin-block-start: auto; font-size: 64px; line-height: 1; font-weight: ${LIGHT}; }\n :host([tone='brand']) .tile { background: ${t.brand}; color: ${t.onBrand}; border-color: ${t.brand}; }\n :host([tone='brand']) a.tile:hover { background: ${t.brandHover}; }\n :host([tone='brand']) .label, :host([tone='brand']) .caption { color: ${t.onBrand}; }\n @media (max-width: 40rem) { .value { font-size: 2.5rem; } }\n @media (forced-colors: active) { .tile { border: 1px solid CanvasText; } }\n `,\n ];\n\n render(): TemplateResult {\n const inner = html`\n <span class=\"label\" part=\"label\">${this.label}</span>\n <span class=\"value\" part=\"value\">${this.value}</span>\n ${this.caption ? html`<span class=\"caption\" part=\"caption\">${this.caption}</span>` : nothing}\n ${statusPill(this.status, this.statusTone)}\n `;\n return this.href ? html`<a class=\"tile\" href=${this.href} part=\"tile\">${inner}</a>` : html`<div class=\"tile\" part=\"tile\">${inner}</div>`;\n }\n}\n\n/**\n * A date as a small block of month and day: \"DEC 2\". It sits at the start of a\n * row, beside what happens on that date.\n *\n * **The full date is what a screen reader hears.** The short month and day are\n * hidden from it, and the date is read in full in the page's language, such as\n * \"2 December 2026\", because \"DEC 2\" said aloud is ambiguous.\n *\n * @category content\n * @icon calendar\n */\nexport class ImpaktDateTile extends ImpaktElement {\n static properties = {\n date: { type: String },\n tone: { type: String, reflect: true },\n };\n /** The date, as YYYY-MM-DD. */\n declare date: string;\n /** `brand` is filled with the brand colour; `plain` is a quiet tile. */\n declare tone: 'brand' | 'plain';\n\n constructor() {\n super();\n this.date = '';\n this.tone = 'brand';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: inline-block; flex: none; }\n time {\n position: relative;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: 48px;\n block-size: 52px;\n border-radius: ${t.radiusLg};\n background: ${t.brand};\n color: ${t.onBrand};\n line-height: 1;\n }\n :host([tone='plain']) time { background: ${t.surfaceInset}; color: ${t.text}; }\n .month { font-size: 10px; font-weight: ${fontWeight('medium')}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; }\n .day { margin-block-start: ${space(1)}; font-size: 20px; font-weight: ${fontWeight('medium')}; font-variant-numeric: tabular-nums; }\n .sr-only { ${visuallyHidden} }\n @media (forced-colors: active) { time { border: 1px solid CanvasText; } }\n `,\n ];\n\n private parts(): { month: string; day: string; full: string } | null {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(this.date ?? '');\n if (!match) return null;\n // Noon UTC, so no time zone moves the date to the day before or after.\n const when = new Date(Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]), 12));\n if (Number.isNaN(when.getTime())) return null;\n const locale = pageLocale(this);\n const say = (options: Intl.DateTimeFormatOptions) => new Intl.DateTimeFormat(locale, { ...options, timeZone: 'UTC' }).format(when);\n return { month: say({ month: 'short' }).replace('.', ''), day: say({ day: 'numeric' }), full: say({ day: 'numeric', month: 'long', year: 'numeric' }) };\n }\n\n render(): TemplateResult {\n const parts = this.parts();\n if (!parts) return html`${nothing}`;\n return html`<time datetime=${this.date} part=\"tile\">\n <span class=\"month\" aria-hidden=\"true\">${parts.month}</span>\n <span class=\"day\" aria-hidden=\"true\">${parts.day}</span>\n <span class=\"sr-only\">${parts.full}</span>\n </time>`;\n }\n}\n\n/**\n * One line in a list: a title, a line of detail under it, and room at the\n * start and the end. It is the task with its tick, the job that needs\n * attention, the delivery with its date, the setting with its arrow.\n *\n * **With `href` the whole row is one target, without nesting controls in a\n * link.** The title is the link, and it is stretched over the row, so the row\n * can be pressed anywhere. Anything in the `end` slot, such as a button, sits\n * above the stretched link and stays its own control, because a button inside\n * a link is two controls a screen reader cannot tell apart (4.1.2).\n *\n * A chevron is drawn at the end of a row that is a link, as the sign that it\n * goes somewhere. Put rows in an element with `role=\"list\"` and give each\n * `role=\"listitem\"` when they are a list, so a screen reader says how many\n * there are.\n *\n * @category content\n * @icon list\n * @slot start - Before the title: a dot, a date tile, a checkbox.\n * @slot end - After the title: a badge, a button.\n */\nexport class ImpaktRow extends ImpaktElement {\n static properties = {\n heading: { type: String },\n meta: { type: String },\n href: { type: String },\n divided: { type: Boolean, reflect: true },\n muted: { type: Boolean, reflect: true },\n selected: { type: Boolean, reflect: true },\n };\n /** The row's title. */\n declare heading: string;\n /** The line of detail under the title, such as \"CY-2026-00421 · Due 20 Nov 2026\". */\n declare meta: string;\n /** Where the row goes when it is pressed. */\n declare href: string;\n /** Draw a hairline above the row, for rows stacked on a card. */\n declare divided: boolean;\n /** Set the title quieter, for something finished, such as a done task. */\n declare muted: boolean;\n /**\n * The row being shown, such as the open case in a list beside it: an ink\n * fill with the words turned over (the paper in dark), and `aria-current`\n * on the row so it is not said by colour alone (frame 37:656).\n */\n declare selected: boolean;\n\n constructor() {\n super();\n this.selected = false;\n this.heading = '';\n this.meta = '';\n this.href = '';\n this.divided = false;\n this.muted = false;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host { display: block; }\n :host([divided]) .row { border-block-start: ${t.borderThin} solid ${t.hairline}; }\n .row { position: relative; display: flex; align-items: center; gap: ${space(3)}; padding-block: ${space(3)}; }\n .text { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${space(0.5)}; }\n .title { font-size: ${fontSize('md')}; font-weight: ${fontWeight('medium')}; color: ${t.text}; }\n :host([muted]) .title { color: ${t.textMuted}; font-weight: ${fontWeight('regular')}; }\n /* The meta is a label: the code face where the brand sets its labels in one, as G2 does (36:452, 37:646). */\n .meta { font-family: ${t.fontEyebrow}; font-size: ${fontSize('sm')}; color: ${t.textMuted}; }\n a { color: inherit; text-decoration: none; }\n /* The link is stretched over the row, so the row is one target. */\n a::after { content: ''; position: absolute; inset: 0; border-radius: ${t.radius}; }\n a:focus-visible { outline: none; }\n a:focus-visible::after { box-shadow: ${t.focusShadow}; }\n .row:has(a):hover .title { text-decoration: underline; text-underline-offset: 0.2em; }\n .start, .end { flex: none; display: flex; align-items: center; gap: ${space(2)}; }\n .start.empty, .end.empty { display: none; }\n /* Controls at the end stay pressable above the stretched link. */\n .end { position: relative; z-index: 1; }\n .chevron { flex: none; color: ${t.textMuted}; }\n :host([selected]) .row { padding-inline: ${space(4)}; background: ${t.text}; --impakt-color-text-default: ${INVERSE}; --impakt-color-text-muted: color-mix(in srgb, ${INVERSE} 72%, ${t.text}); --impakt-color-text-inverse: ${t.text}; }\n :host([selected]) :is(.title, .meta, .chevron) { color: ${INVERSE}; }\n :host([selected]) .meta, :host([selected]) .chevron { color: color-mix(in srgb, ${INVERSE} 72%, ${t.text}); }\n @media (forced-colors: active) { :host([selected]) .row { outline: 2px solid Highlight; } }\n `,\n ];\n\n private filled = { start: false, end: false };\n\n private onSlot(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n const name = slot.name as 'start' | 'end';\n this.filled = {\n ...this.filled,\n [name]: slot.assignedNodes({ flatten: true }).some((n) => n.nodeType === Node.ELEMENT_NODE || (n.textContent ?? '').trim() !== ''),\n };\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n const title = this.href\n ? html`<a class=\"title\" href=${this.href} part=\"link\">${this.heading}</a>`\n : html`<span class=\"title\" part=\"title\">${this.heading}</span>`;\n return html`<div class=\"row\" part=\"row\" aria-current=${this.selected ? 'true' : nothing}>\n <div class=\"start ${this.filled.start ? '' : 'empty'}\"><slot name=\"start\" @slotchange=${this.onSlot}></slot></div>\n <div class=\"text\">${title}${this.meta ? html`<span class=\"meta\" part=\"meta\">${this.meta}</span>` : nothing}</div>\n <div class=\"end ${this.filled.end ? '' : 'empty'}\"><slot name=\"end\" @slotchange=${this.onSlot}></slot></div>\n ${this.href ? html`<span class=\"chevron\" aria-hidden=\"true\">${iconSvg('chevron-right', '20px')}</span>` : nothing}\n </div>`;\n }\n}\n\n/**\n * A pressable filter: \"UK 4\", \"Completed 27\". A row of them narrows a list.\n *\n * **It is a toggle button.** It carries `aria-pressed`, so a screen reader says\n * whether the filter is on, and it is filled when it is on, so that does not\n * rest on colour alone (1.4.1). When only one filter in a row can be on, the\n * app turns the others off when it hears `impakt-change`.\n *\n * The count is read with the label. Set `count-label` when the number needs its\n * noun to make sense aloud, such as \"4 jobs\".\n *\n * @category action\n * @icon badge\n * @fires {CustomEvent<{ pressed: boolean }>} impakt-change - When the filter is turned on or off.\n */\nexport class ImpaktFilterChip extends ImpaktElement {\n static properties = {\n label: { type: String },\n count: { type: Number },\n countLabel: { type: String, attribute: 'count-label' },\n pressed: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n };\n declare label: string;\n /** How many things the filter would show. Left out when not set. */\n declare count: number | undefined;\n /** The count in words for a screen reader, such as \"4 jobs\". The number alone when empty. */\n declare countLabel: string;\n declare pressed: boolean;\n declare disabled: boolean;\n\n constructor() {\n super();\n this.label = '';\n this.count = undefined;\n this.countLabel = '';\n this.pressed = false;\n this.disabled = false;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('button'),\n css`\n :host { display: inline-block; }\n /* The containing block for the words kept for screen readers, so a control scrolled out of a row cannot widen the page. */\n button {\n ${targetSize}\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: ${space(2)};\n min-block-size: 35px;\n padding: 0 ${space(3.5)};\n font: inherit;\n font-size: ${fontSize('sm')};\n font-weight: ${fontWeight('regular')};\n color: ${t.text};\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid ${t.text};\n border-radius: var(--impakt-radius-pill, calc(${t.radius} * 9999));\n cursor: pointer;\n white-space: nowrap;\n }\n button:hover:not(:disabled) { background: ${t.surfaceInset}; }\n button[aria-pressed='true'] { background: ${t.text}; color: ${INVERSE}; border-color: ${t.text}; }\n button:disabled { cursor: not-allowed; opacity: 0.5; }\n .count { font-variant-numeric: tabular-nums; color: ${t.textMuted}; }\n button[aria-pressed='true'] .count { color: inherit; opacity: 0.8; }\n .sr-only { ${visuallyHidden} }\n @media (forced-colors: active) { button[aria-pressed='true'] { border: 2px solid Highlight; } }\n `,\n ];\n\n private toggle(): void {\n if (this.disabled) return;\n this.pressed = !this.pressed;\n this.dispatchEvent(new CustomEvent('impakt-change', { detail: { pressed: this.pressed }, bubbles: true, composed: true }));\n }\n\n render(): TemplateResult {\n const hasCount = typeof this.count === 'number' && !Number.isNaN(this.count);\n return html`<button type=\"button\" part=\"button\" aria-pressed=${this.pressed ? 'true' : 'false'} ?disabled=${this.disabled} @click=${this.toggle}>\n <span>${this.label}</span>\n ${\n hasCount\n ? this.countLabel\n ? html`<span class=\"count\" aria-hidden=\"true\">${this.count}</span><span class=\"sr-only\">${this.countLabel}</span>`\n : html`<span class=\"count\">${this.count}</span>`\n : nothing\n }\n </button>`;\n }\n}\n\ncustomElements.define('impakt-stat-tile', ImpaktStatTile);\ncustomElements.define('impakt-date-tile', ImpaktDateTile);\ncustomElements.define('impakt-row', ImpaktRow);\ncustomElements.define('impakt-filter-chip', ImpaktFilterChip);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-stat-tile': ImpaktStatTile;\n 'impakt-date-tile': ImpaktDateTile;\n 'impakt-row': ImpaktRow;\n 'impakt-filter-chip': ImpaktFilterChip;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AASxD,IAAM,UAAU,MAAM,sBAAsB,qEAAqE;AAGjH,IAAM,QAAQ,MAAM,qBAAqB,KAAK;AAoBvC,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,QAAQ,EAAE,MAAM,OAAO;AAAA,MACvB,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,IACvD;AAAA;AAAA,EAkBA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,aAAa;AAAA,EACpB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAOS,MAAM,GAAG,CAAC;AAAA;AAAA,iBAEN,MAAM,CAAC,CAAC;AAAA,gBACT,EAAE,UAAU,UAAU,EAAE,IAAI;AAAA,uBACrB,EAAE,MAAM;AAAA,oBACX,EAAE,WAAW;AAAA,eAClB,EAAE,IAAI;AAAA;AAAA;AAAA,oDAG+B,EAAE,WA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