@atomic-ui/ui 0.10.1 → 0.12.1

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 (210) hide show
  1. package/custom-elements.json +9631 -6026
  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-4MMRBNW7.js +104 -0
  14. package/dist/chunk-4MMRBNW7.js.map +1 -0
  15. package/dist/{chunk-5OJAJA3U.js → chunk-5HCWL2YD.js} +6 -4
  16. package/dist/{chunk-5OJAJA3U.js.map → chunk-5HCWL2YD.js.map} +1 -1
  17. package/dist/{chunk-AG4EP3OY.js → chunk-5IGBH4GL.js} +8 -6
  18. package/dist/{chunk-AG4EP3OY.js.map → chunk-5IGBH4GL.js.map} +1 -1
  19. package/dist/{chunk-AL4IUSML.js → chunk-5OYQZWP2.js} +5 -3
  20. package/dist/{chunk-AL4IUSML.js.map → chunk-5OYQZWP2.js.map} +1 -1
  21. package/dist/chunk-5PRB7P7N.js +167 -0
  22. package/dist/chunk-5PRB7P7N.js.map +1 -0
  23. package/dist/chunk-6CDQSHVW.js +21 -0
  24. package/dist/chunk-6CDQSHVW.js.map +1 -0
  25. package/dist/{chunk-MLKNZL5J.js → chunk-6J22I7F6.js} +14 -12
  26. package/dist/chunk-6J22I7F6.js.map +1 -0
  27. package/dist/chunk-72WNCCDC.js +136 -0
  28. package/dist/chunk-72WNCCDC.js.map +1 -0
  29. package/dist/chunk-7UI3OBXL.js +104 -0
  30. package/dist/chunk-7UI3OBXL.js.map +1 -0
  31. package/dist/{chunk-D6NET2VB.js → chunk-ALFE35FS.js} +30 -3
  32. package/dist/chunk-ALFE35FS.js.map +1 -0
  33. package/dist/chunk-AYINRYNC.js +184 -0
  34. package/dist/chunk-AYINRYNC.js.map +1 -0
  35. package/dist/{chunk-2D2IMQII.js → chunk-BAYSDP44.js} +52 -30
  36. package/dist/chunk-BAYSDP44.js.map +1 -0
  37. package/dist/{chunk-2EP3IV3G.js → chunk-BGHAANTP.js} +22 -8
  38. package/dist/chunk-BGHAANTP.js.map +1 -0
  39. package/dist/{chunk-OJO62KRX.js → chunk-CFCFKLTN.js} +85 -10
  40. package/dist/chunk-CFCFKLTN.js.map +1 -0
  41. package/dist/{chunk-UFPI4I2Y.js → chunk-CQT3VPYK.js} +8 -29
  42. package/dist/chunk-CQT3VPYK.js.map +1 -0
  43. package/dist/{chunk-AURT72IC.js → chunk-DXLEYNID.js} +13 -7
  44. package/dist/chunk-DXLEYNID.js.map +1 -0
  45. package/dist/{chunk-L4CIBOGK.js → chunk-EKPTMRBG.js} +5 -3
  46. package/dist/{chunk-L4CIBOGK.js.map → chunk-EKPTMRBG.js.map} +1 -1
  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-QPOM7W3D.js +104 -0
  74. package/dist/chunk-QPOM7W3D.js.map +1 -0
  75. package/dist/{chunk-FU3CEHBS.js → chunk-R6PBY3YN.js} +6 -4
  76. package/dist/{chunk-FU3CEHBS.js.map → chunk-R6PBY3YN.js.map} +1 -1
  77. package/dist/{chunk-TJOYBDKS.js → chunk-R6YMSJR7.js} +65 -36
  78. package/dist/chunk-R6YMSJR7.js.map +1 -0
  79. package/dist/{chunk-ZEIV5X3U.js → chunk-SOYKSPPX.js} +73 -23
  80. package/dist/chunk-SOYKSPPX.js.map +1 -0
  81. package/dist/{chunk-NKMJMVZP.js → chunk-T52CUOCJ.js} +5 -3
  82. package/dist/{chunk-NKMJMVZP.js.map → chunk-T52CUOCJ.js.map} +1 -1
  83. package/dist/chunk-UBNCJROR.js +294 -0
  84. package/dist/chunk-UBNCJROR.js.map +1 -0
  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.d.ts +6 -0
  159. package/dist/components/select.js +4 -3
  160. package/dist/components/shell.js +4 -3
  161. package/dist/components/source.d.ts +68 -0
  162. package/dist/components/source.js +10 -0
  163. package/dist/components/source.js.map +1 -0
  164. package/dist/components/status-pill-style.d.ts +16 -0
  165. package/dist/components/status-pill-style.js +15 -0
  166. package/dist/components/status-pill-style.js.map +1 -0
  167. package/dist/components/status.d.ts +66 -0
  168. package/dist/components/status.js +10 -0
  169. package/dist/components/status.js.map +1 -0
  170. package/dist/components/summary-list.js +3 -2
  171. package/dist/components/switch.js +4 -3
  172. package/dist/components/table.d.ts +19 -0
  173. package/dist/components/table.js +4 -3
  174. package/dist/components/text-input.js +5 -4
  175. package/dist/components/textarea.d.ts +5 -0
  176. package/dist/components/textarea.js +4 -3
  177. package/dist/components/tool-card.d.ts +107 -0
  178. package/dist/components/tool-card.js +11 -0
  179. package/dist/components/tool-card.js.map +1 -0
  180. package/dist/components/tool-kit-tokens.d.ts +25 -0
  181. package/dist/components/tool-kit-tokens.js +8 -0
  182. package/dist/components/tool-kit-tokens.js.map +1 -0
  183. package/dist/index.d.ts +11 -0
  184. package/dist/index.js +116 -70
  185. package/dist/standalone/atomic-ui.js +2030 -692
  186. package/dist/standalone/atomic-ui.js.map +4 -4
  187. package/package.json +2 -2
  188. package/dist/chunk-2D2IMQII.js.map +0 -1
  189. package/dist/chunk-2EP3IV3G.js.map +0 -1
  190. package/dist/chunk-2ZF3J7OO.js.map +0 -1
  191. package/dist/chunk-3T7J66Z2.js.map +0 -1
  192. package/dist/chunk-7UWJXPR3.js +0 -97
  193. package/dist/chunk-7UWJXPR3.js.map +0 -1
  194. package/dist/chunk-A4M3A4SZ.js.map +0 -1
  195. package/dist/chunk-AURT72IC.js.map +0 -1
  196. package/dist/chunk-AYKYHZGQ.js +0 -108
  197. package/dist/chunk-AYKYHZGQ.js.map +0 -1
  198. package/dist/chunk-D6NET2VB.js.map +0 -1
  199. package/dist/chunk-DN5YZFSG.js.map +0 -1
  200. package/dist/chunk-MLKNZL5J.js.map +0 -1
  201. package/dist/chunk-MOO63SHZ.js.map +0 -1
  202. package/dist/chunk-OJO62KRX.js.map +0 -1
  203. package/dist/chunk-ONED3PUB.js.map +0 -1
  204. package/dist/chunk-OZGKK3N5.js.map +0 -1
  205. package/dist/chunk-QU3U2CS2.js +0 -144
  206. package/dist/chunk-QU3U2CS2.js.map +0 -1
  207. package/dist/chunk-TJOYBDKS.js.map +0 -1
  208. package/dist/chunk-UFPI4I2Y.js.map +0 -1
  209. package/dist/chunk-V7EB7Q2M.js.map +0 -1
  210. package/dist/chunk-ZEIV5X3U.js.map +0 -1
@@ -80,126 +80,6 @@ var spaceAround = css`
80
80
  :host([space-below='2xl']) { margin-block-end: clamp(${space(14)}, 8vw, ${space(28)}); }
81
81
  `;
82
82
 
83
- // packages/ui/src/base/styles.ts
84
- import { css as css2, unsafeCSS as unsafeCSS2 } from "lit";
85
- var focusRing = css2`
86
- :host(:focus-visible),
87
- :host(:not([disabled])) :focus-visible {
88
- outline: 2px solid transparent;
89
- outline-offset: ${t.focusOffset};
90
- box-shadow: ${t.focusShadow};
91
- }
92
- `;
93
- var targetSize = css2`
94
- min-block-size: ${t.targetMin};
95
- min-inline-size: ${t.targetMin};
96
- `;
97
- var visuallyHidden = css2`
98
- position: absolute;
99
- inline-size: 1px;
100
- block-size: 1px;
101
- margin: -1px;
102
- padding: 0;
103
- overflow: hidden;
104
- clip-path: inset(50%);
105
- white-space: nowrap;
106
- border: 0;
107
- `;
108
- var reducedMotion = css2`
109
- @media (prefers-reduced-motion: reduce) {
110
- :host,
111
- :host *,
112
- :host *::before,
113
- :host *::after {
114
- animation-duration: 0.01ms !important;
115
- animation-iteration-count: 1 !important;
116
- transition-duration: 0.01ms !important;
117
- scroll-behavior: auto !important;
118
- }
119
- }
120
- `;
121
- var base = css2`
122
- :host {
123
- box-sizing: border-box;
124
- font-family: ${t.fontBody};
125
- color: ${t.text};
126
- }
127
- :host([hidden]) {
128
- display: none !important;
129
- }
130
- *,
131
- *::before,
132
- *::after {
133
- box-sizing: inherit;
134
- }
135
- `;
136
- var touchTarget = (selector) => (
137
- // Under :host, so it outweighs the component's own rule for the same control whatever the order.
138
- unsafeCSS2(`@media (pointer: coarse) { :host :is(${selector}) { min-block-size: 44px; min-inline-size: 44px; } }`)
139
- );
140
- var hideOn = css2`
141
- @media (max-width: 40rem) { :host([hide-on='phone']) { display: none !important; } }
142
- @media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none !important; } }
143
- `;
144
-
145
- // packages/ui/src/base/say.ts
146
- var WORDING = Symbol.for("strata.wording");
147
- function say(english, values) {
148
- const words = globalThis[WORDING]?.words;
149
- const chosen = words?.[english];
150
- const text = typeof chosen === "string" && chosen.trim() ? chosen : english;
151
- return values ? text.replace(/\{(\w+)\}/g, (whole, name) => name in values ? String(values[name]) : whole) : text;
152
- }
153
-
154
- // packages/ui/src/base/ImpaktElement.ts
155
- import { LitElement, css as css3 } from "lit";
156
- var counter = 0;
157
- var ImpaktElement = class extends LitElement {
158
- constructor() {
159
- super(...arguments);
160
- /**
161
- * A unique id for this instance, for `aria-describedby` and friends.
162
- *
163
- * Generated once in the constructor rather than in `render`, because an id
164
- * that changes between renders breaks the relationship it exists to express
165
- * — and it breaks it silently, since the markup still looks correct.
166
- */
167
- this.uid = `impakt-${counter += 1}`;
168
- }
169
- static {
170
- this.styles = [base, reducedMotion, css3``];
171
- }
172
- id_(part) {
173
- return `${this.uid}-${part}`;
174
- }
175
- /** @ignore */
176
- connectedCallback() {
177
- super.connectedCallback();
178
- this.sayDefaults();
179
- }
180
- /**
181
- * The words a component ships with, in the page's language (ADR 0026).
182
- *
183
- * Defaults stay plain English in the constructor, so the component manifest
184
- * still sees them (a prop with no default is read as required). When the
185
- * element joins the page, each word it holds is looked up in the site's
186
- * wording; anything that is not one of Strata's own words, such as a page's
187
- * own text or a variant name, is left exactly as it is.
188
- *
189
- * @ignore
190
- */
191
- sayDefaults() {
192
- const props = this.constructor.elementProperties;
193
- const self = this;
194
- for (const name of props.keys()) {
195
- const value = self[name];
196
- if (typeof value !== "string" || !value) continue;
197
- const said = say(value);
198
- if (said !== value) self[name] = said;
199
- }
200
- }
201
- };
202
-
203
83
  export {
204
84
  token,
205
85
  t,
@@ -208,15 +88,6 @@ export {
208
88
  fontSize,
209
89
  lineHeight,
210
90
  fontWeight,
211
- spaceAround,
212
- focusRing,
213
- targetSize,
214
- visuallyHidden,
215
- reducedMotion,
216
- base,
217
- touchTarget,
218
- hideOn,
219
- say,
220
- ImpaktElement
91
+ spaceAround
221
92
  };
222
- //# sourceMappingURL=chunk-V7EB7Q2M.js.map
93
+ //# sourceMappingURL=chunk-JTCTQBAX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/base/tokens.ts"],"sourcesContent":["/**\n * Token helpers.\n *\n * Components never name a colour, a size or a radius. They name a token, and a\n * brand decides what it holds — which is what makes a rebrand a content\n * publish rather than a rebuild\n * ([ADR 0005](https://github.com/matthill8286/strata/blob/main/docs/decisions/0005-design-tokens.md)).\n *\n * Every reference carries a fallback so that a component dropped onto a page\n * with no token stylesheet still renders something legible. An unstyled\n * component is indistinguishable from a broken one, and the fallback is what\n * keeps a missing stylesheet a visible annoyance rather than a blank screen.\n *\n * These return `CSSResult` rather than strings. Lit's `css` tag refuses plain\n * interpolated strings, which is a deliberate guard against injecting\n * attacker-controlled text into a stylesheet; `unsafeCSS` is the documented\n * way past it and is safe here because every value is a literal in this file,\n * never anything authored or fetched.\n */\nimport { css, unsafeCSS, type CSSResult } from 'lit';\n\n/** `color.brand.default` → `var(--impakt-color-brand-default, <fallback>)`. */\nexport const token = (path: string, fallback: string): CSSResult => unsafeCSS(`var(--impakt-${path.replace(/\\./g, '-')}, ${fallback})`);\n\nexport const t = {\n brand: token('color.brand.default', '#1f4ed8'),\n brandHover: token('color.brand.hover', '#1b45be'),\n brandActive: token('color.brand.active', '#183ba4'),\n brandSubtle: token('color.brand.subtle', '#e4eafa'),\n onBrand: token('color.text.on-brand', '#ffffff'),\n\n surfaceCard: token('color.surface.card', '#ffffff'),\n surfaceInset: token('color.surface.inset', '#f4f4f4'),\n surfaceSubtle: token('color.surface.subtle', '#e4eafa'),\n\n text: token('color.text.default', '#1a1a1a'),\n textMuted: token('color.text.muted', '#717171'),\n textPlaceholder: token('color.text.placeholder', '#767676'),\n textHeading: token('color.text.heading', '#1f4ed8'),\n link: token('color.text.link', '#1f4ed8'),\n linkHover: token('color.text.link-hover', '#193ead'),\n\n border: token('color.border.default', '#929292'),\n borderStrong: token('color.border.strong', '#818181'),\n\n danger: token('color.status.danger.default', '#c8102e'),\n dangerText: token('color.status.danger.text', '#c8102e'),\n dangerSubtle: token('color.status.danger.subtle', '#f8e2e6'),\n warning: token('color.status.warning.default', '#b45309'),\n warningText: token('color.status.warning.text', '#b45309'),\n warningSubtle: token('color.status.warning.subtle', '#f6eae1'),\n success: token('color.status.success.default', '#047857'),\n successText: token('color.status.success.text', '#047857'),\n successSubtle: token('color.status.success.subtle', '#e0f0ea'),\n info: token('color.status.info.default', '#1f4ed8'),\n infoText: token('color.status.info.text', '#1f4ed8'),\n infoSubtle: token('color.status.info.subtle', '#e4eafa'),\n\n fontBody: token('font.family.body', 'system-ui, sans-serif'),\n fontHeading: token('font.family.heading', 'system-ui, sans-serif'),\n /** Code-like labels: hashes, branches, version lines. */\n fontMono: token('font.family.mono', 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'),\n /** The small line above a heading: the body face, or the code face for a brand that asks. */\n fontEyebrow: token('font.family.eyebrow', 'inherit'),\n\n focusShadow: token('focus.ring.shadow', '0 0 0 2px #ffffff, 0 0 0 4px #1a1a1a'),\n focusOffset: token('focus.ring.offset', '2px'),\n\n targetMin: token('target.min', '24px'),\n\n radiusSm: token('radius.sm', '2px'),\n radius: token('radius.md', '4px'),\n radiusLg: token('radius.lg', '8px'),\n\n borderThin: token('border.width.thin', '1px'),\n borderThick: token('border.width.thick', '2px'),\n\n radiusXs: token('radius.xs', '2px'),\n radiusXl: token('radius.xl', '12px'),\n radius2xl: token('radius.2xl', '16px'),\n\n /** Hairline borders and rings, from the text colour, so they suit any surface. */\n hairline: unsafeCSS('color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 10%, transparent)'),\n rule: unsafeCSS('color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 15%, transparent)'),\n /** A wash of the text colour, for hover and pressed states on quiet controls. */\n wash: unsafeCSS('color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 5%, transparent)'),\n /** The brand at a fifth, for focus halos round fields. */\n brandHalo: unsafeCSS('color-mix(in srgb, var(--impakt-color-brand-default, #1f4ed8) 22%, transparent)'),\n\n shadowXs: token('shadow.xs', '0 1px 2px 0 rgb(0 0 0 / 0.05)'),\n shadowSm: token('shadow.sm', '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)'),\n shadowMd: token('shadow.md', '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)'),\n shadowLg: token('shadow.lg', '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)'),\n shadowXl: token('shadow.xl', '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)'),\n\n trackingTight: token('font.tracking.tight', '-0.02em'),\n trackingWide: token('font.tracking.wide', '0.06em'),\n} as const;\n\n/**\n * A size on the type scale with its own line height, so text drawn at\n * `type('xl')` has the leading that size reads best at.\n */\nexport const type = (name: string): CSSResult =>\n unsafeCSS(`font-size: var(--impakt-font-size-${name}, 1rem); line-height: var(--impakt-font-leading-${name}, 1.5);`);\n\n/** `space(3)` → `space.3`, `space(0.5)` → `space.0-5`. Spacing is always a token, never a number. */\nexport const space = (step: number): CSSResult => token(`space.${String(step).replace('.', '-')}`, `${step * 4}px`);\n/** `font.size.lg` → the custom property. */\nexport const fontSize = (name: string): CSSResult => token(`font.size.${name}`, '1rem');\nexport const lineHeight = (name: string): CSSResult => token(`font.line-height.${name}`, '1.5');\nexport const fontWeight = (name: string): CSSResult => token(`font.weight.${name}`, '400');\n\n/**\n * Space above and below a section, from the spacing scale: `none`, `sm`,\n * `md`, `lg` or `xl`, set by `space-above` and `space-below`. A section names\n * a step rather than a size, so a page keeps the brand's rhythm.\n */\nexport const spaceAround: CSSResult = css`\n :host([space-above='sm']) { margin-block-start: ${space(2)}; }\n :host([space-above='md']) { margin-block-start: ${space(4)}; }\n :host([space-above='lg']) { margin-block-start: ${space(6)}; }\n :host([space-above='xl']) { margin-block-start: ${space(8)}; }\n :host([space-above='2xl']) { margin-block-start: clamp(${space(14)}, 8vw, ${space(28)}); }\n :host([space-below='sm']) { margin-block-end: ${space(2)}; }\n :host([space-below='md']) { margin-block-end: ${space(4)}; }\n :host([space-below='lg']) { margin-block-end: ${space(6)}; }\n :host([space-below='xl']) { margin-block-end: ${space(8)}; }\n :host([space-below='2xl']) { margin-block-end: clamp(${space(14)}, 8vw, ${space(28)}); }\n`;\n"],"mappings":";AAmBA,SAAS,KAAK,iBAAiC;AAGxC,IAAM,QAAQ,CAAC,MAAc,aAAgC,UAAU,gBAAgB,KAAK,QAAQ,OAAO,GAAG,CAAC,KAAK,QAAQ,GAAG;AAE/H,IAAM,IAAI;AAAA,EACf,OAAO,MAAM,uBAAuB,SAAS;AAAA,EAC7C,YAAY,MAAM,qBAAqB,SAAS;AAAA,EAChD,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,SAAS,MAAM,uBAAuB,SAAS;AAAA,EAE/C,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,cAAc,MAAM,uBAAuB,SAAS;AAAA,EACpD,eAAe,MAAM,wBAAwB,SAAS;AAAA,EAEtD,MAAM,MAAM,sBAAsB,SAAS;AAAA,EAC3C,WAAW,MAAM,oBAAoB,SAAS;AAAA,EAC9C,iBAAiB,MAAM,0BAA0B,SAAS;AAAA,EAC1D,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,MAAM,MAAM,mBAAmB,SAAS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OYQZWP2.js";
4
4
  import {
5
5
  ImpaktElement,
6
6
  focusRing,
7
+ visuallyHidden
8
+ } from "./chunk-72WNCCDC.js";
9
+ import {
7
10
  fontWeight,
8
11
  space,
9
- t,
10
- visuallyHidden
11
- } from "./chunk-V7EB7Q2M.js";
12
+ t
13
+ } from "./chunk-JTCTQBAX.js";
12
14
 
13
15
  // packages/ui/src/components/link.ts
14
16
  import { html, css, nothing } from "lit";
@@ -75,4 +77,4 @@ customElements.define("impakt-link", ImpaktLink);
75
77
  export {
76
78
  ImpaktLink
77
79
  };
78
- //# sourceMappingURL=chunk-ZL3JFUIE.js.map
80
+ //# sourceMappingURL=chunk-K5QFVLCI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/link.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, visuallyHidden } from '../base/styles';\nimport { fontWeight, space, t } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/**\n * A link.\n *\n * **A new tab is always announced.** When `external` is set, the accessible\n * name gains \"opens in a new tab\" — not as a tooltip, which no screen reader\n * reads, and not as an icon alone, which carries no text. An unannounced new\n * tab breaks the back button for someone who cannot see that the window\n * changed, and that is what 3.2.5 is about.\n *\n * **It is underlined.** 1.4.1 Use of Colour: a link distinguished from body\n * text only by being a different colour is not distinguished at all for a\n * reader who cannot tell the two colours apart.\n\n *\n * @category action\n * @icon link\n * @slot - The link text.\n */\nexport class ImpaktLink extends ImpaktElement {\n static properties = {\n href: { type: String },\n external: { type: Boolean, reflect: true },\n externalText: { type: String, attribute: 'external-text' },\n variant: { type: String, reflect: true },\n icon: { type: String },\n };\n\n declare href: string;\n declare external: boolean;\n declare externalText: string;\n /** In a sentence, or on its own line as a call to action, bolder and with an arrow. */\n declare variant: 'inline' | 'standalone';\n /** An icon after the words. A standalone link has an arrow unless it says otherwise. */\n declare icon:\n | 'none'\n | 'arrow-right'\n | 'arrow-left'\n | 'chevron-right'\n | 'chevron-down'\n | 'check'\n | 'close'\n | 'menu'\n | 'plus'\n | 'minus'\n | 'search'\n | 'external'\n | 'download'\n | 'home'\n | 'phone'\n | 'mail'\n | 'map-pin'\n | 'calendar'\n | 'clock'\n | 'user'\n | 'star'\n | 'heart'\n | 'shield'\n | 'leaf'\n | 'sun'\n | 'bolt'\n | 'key'\n | 'info'\n | 'warning'\n | 'document'\n | 'pound'\n | 'chat'\n | 'grid'\n | 'clipboard'\n | 'map-pinned'\n | 'users'\n | 'radio'\n | 'settings'\n | 'log-out'\n | 'arrow-up-right'\n | 'more'\n | 'upload'\n | 'image'\n | 'lock'\n | 'eye'\n | 'trash'\n | 'pencil'\n | 'qr-code'\n | 'battery';\n\n constructor() {\n super();\n this.href = '';\n this.external = false;\n this.externalText = 'opens in a new tab';\n this.variant = 'inline';\n this.icon = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host {\n display: inline;\n }\n a {\n color: ${t.link};\n text-decoration: underline;\n text-underline-offset: 0.2em;\n border-radius: ${t.radiusSm};\n }\n a:hover {\n color: ${t.linkHover};\n }\n :host([variant='standalone']) { display: inline-block; }\n :host([variant='standalone']) a { display: inline-flex; align-items: center; gap: ${space(1)}; font-weight: ${fontWeight('semibold')}; text-decoration-thickness: 1px; }\n :host([variant='standalone']) a:hover .icon { transform: translateX(2px); }\n .icon { flex: none; transition: transform 120ms ease-in-out; }\n .sr-only {\n ${visuallyHidden}\n }\n `,\n ];\n\n render(): TemplateResult {\n return html`\n <a\n part=\"link\"\n href=${this.href || nothing}\n target=${this.external ? '_blank' : nothing}\n rel=${this.external ? 'noopener noreferrer' : nothing}\n >\n <slot></slot>${iconSvg(this.icon !== 'none' ? this.icon : this.variant === 'standalone' ? (this.external ? 'external' : 'arrow-right') : undefined, '1em')}${this.external ? html`<span class=\"sr-only\"> (${this.externalText})</span>` : nothing}\n </a>\n `;\n }\n}\n\ncustomElements.define('impakt-link', ImpaktLink);\n\ndecl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P;AACF;AAEA,eAAe,OAAO,eAAe,UAAU;","names":[]}
1
+ {"version":3,"sources":["../src/components/link.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, visuallyHidden } from '../base/styles';\nimport { fontWeight, space, t } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/**\n * A link.\n *\n * **A new tab is always announced.** When `external` is set, the accessible\n * name gains \"opens in a new tab\" — not as a tooltip, which no screen reader\n * reads, and not as an icon alone, which carries no text. An unannounced new\n * tab breaks the back button for someone who cannot see that the window\n * changed, and that is what 3.2.5 is about.\n *\n * **It is underlined.** 1.4.1 Use of Colour: a link distinguished from body\n * text only by being a different colour is not distinguished at all for a\n * reader who cannot tell the two colours apart.\n\n *\n * @category action\n * @icon link\n * @slot - The link text.\n */\nexport class ImpaktLink extends ImpaktElement {\n static properties = {\n href: { type: String },\n external: { type: Boolean, reflect: true },\n externalText: { type: String, attribute: 'external-text' },\n variant: { type: String, reflect: true },\n icon: { type: String },\n };\n\n declare href: string;\n declare external: boolean;\n declare externalText: string;\n /** In a sentence, or on its own line as a call to action, bolder and with an arrow. */\n declare variant: 'inline' | 'standalone';\n /** An icon after the words. A standalone link has an arrow unless it says otherwise. */\n declare icon:\n | 'none'\n | 'arrow-right'\n | 'arrow-left'\n | 'chevron-right'\n | 'chevron-down'\n | 'check'\n | 'close'\n | 'menu'\n | 'plus'\n | 'minus'\n | 'search'\n | 'external'\n | 'download'\n | 'home'\n | 'phone'\n | 'mail'\n | 'map-pin'\n | 'calendar'\n | 'clock'\n | 'user'\n | 'star'\n | 'heart'\n | 'shield'\n | 'leaf'\n | 'sun'\n | 'bolt'\n | 'key'\n | 'info'\n | 'warning'\n | 'document'\n | 'pound'\n | 'chat'\n | 'grid'\n | 'clipboard'\n | 'map-pinned'\n | 'users'\n | 'radio'\n | 'settings'\n | 'log-out'\n | 'arrow-up-right'\n | 'more'\n | 'upload'\n | 'image'\n | 'lock'\n | 'eye'\n | 'trash'\n | 'pencil'\n | 'qr-code'\n | 'battery';\n\n constructor() {\n super();\n this.href = '';\n this.external = false;\n this.externalText = 'opens in a new tab';\n this.variant = 'inline';\n this.icon = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host {\n display: inline;\n }\n a {\n color: ${t.link};\n text-decoration: underline;\n text-underline-offset: 0.2em;\n border-radius: ${t.radiusSm};\n }\n a:hover {\n color: ${t.linkHover};\n }\n :host([variant='standalone']) { display: inline-block; }\n :host([variant='standalone']) a { display: inline-flex; align-items: center; gap: ${space(1)}; font-weight: ${fontWeight('semibold')}; text-decoration-thickness: 1px; }\n :host([variant='standalone']) a:hover .icon { transform: translateX(2px); }\n .icon { flex: none; transition: transform 120ms ease-in-out; }\n .sr-only {\n ${visuallyHidden}\n }\n `,\n ];\n\n render(): TemplateResult {\n return html`\n <a\n part=\"link\"\n href=${this.href || nothing}\n target=${this.external ? '_blank' : nothing}\n rel=${this.external ? 'noopener noreferrer' : nothing}\n >\n <slot></slot>${iconSvg(this.icon !== 'none' ? this.icon : this.variant === 'standalone' ? (this.external ? 'external' : 'arrow-right') : undefined, '1em')}${this.external ? html`<span class=\"sr-only\"> (${this.externalText})</span>` : nothing}\n </a>\n `;\n }\n}\n\ncustomElements.define('impakt-link', ImpaktLink);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-link': ImpaktLink;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAwBjD,IAAM,aAAN,cAAyB,cAAc;AAAA,EAC5C;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,UAAU,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACzC,cAAc,EAAE,MAAM,QAAQ,WAAW,gBAAgB;AAAA,MACzD,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACvC,MAAM,EAAE,MAAM,OAAO;AAAA,IACvB;AAAA;AAAA,EA2DA,cAAc;AACZ,UAAM;AACN,SAAK,OAAO;AACZ,SAAK,WAAW;AAChB,SAAK,eAAe;AACpB,SAAK,UAAU;AACf,SAAK,OAAO;AAAA,EACd;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA,MACA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAKa,EAAE,IAAI;AAAA;AAAA;AAAA,yBAGE,EAAE,QAAQ;AAAA;AAAA;AAAA,iBAGlB,EAAE,SAAS;AAAA;AAAA;AAAA,0FAG8D,MAAM,CAAC,CAAC,kBAAkB,WAAW,UAAU,CAAC;AAAA;AAAA;AAAA;AAAA,UAIhI,cAAc;AAAA;AAAA;AAAA,IAGtB;AAAA;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA;AAAA;AAAA,eAGI,KAAK,QAAQ,OAAO;AAAA,iBAClB,KAAK,WAAW,WAAW,OAAO;AAAA,cACrC,KAAK,WAAW,wBAAwB,OAAO;AAAA;AAAA,uBAEtC,QAAQ,KAAK,SAAS,SAAS,KAAK,OAAO,KAAK,YAAY,eAAgB,KAAK,WAAW,aAAa,gBAAiB,QAAW,KAAK,CAAC,GAAG,KAAK,WAAW,+BAA+B,KAAK,YAAY,aAAa,OAAO;AAAA;AAAA;AAAA,EAGvP;AACF;AAEA,eAAe,OAAO,eAAe,UAAU;","names":[]}
@@ -3,17 +3,19 @@ import {
3
3
  } from "./chunk-UNGAG44M.js";
4
4
  import {
5
5
  iconSvg
6
- } from "./chunk-AL4IUSML.js";
6
+ } from "./chunk-5OYQZWP2.js";
7
7
  import {
8
8
  ImpaktElement,
9
9
  focusRing,
10
+ touchTarget,
11
+ visuallyHidden
12
+ } from "./chunk-72WNCCDC.js";
13
+ import {
10
14
  fontSize,
11
15
  fontWeight,
12
16
  space,
13
- t,
14
- touchTarget,
15
- visuallyHidden
16
- } from "./chunk-V7EB7Q2M.js";
17
+ t
18
+ } from "./chunk-JTCTQBAX.js";
17
19
 
18
20
  // packages/ui/src/components/table.ts
19
21
  import { html, css, nothing } from "lit";
@@ -21,6 +23,7 @@ var ImpaktTable = class extends ImpaktElement {
21
23
  static {
22
24
  this.properties = {
23
25
  caption: { type: String },
26
+ captionHidden: { type: Boolean, reflect: true, attribute: "caption-hidden" },
24
27
  columns: { type: Array },
25
28
  rows: { type: Array },
26
29
  sortKey: { type: String, attribute: "sort-key", reflect: true },
@@ -32,12 +35,14 @@ var ImpaktTable = class extends ImpaktElement {
32
35
  stack: { type: Boolean, reflect: true },
33
36
  emptyText: { type: String, attribute: "empty-text" },
34
37
  selectAllText: { type: String, attribute: "select-all-text" },
35
- selectRowText: { type: String, attribute: "select-row-text" }
38
+ selectRowText: { type: String, attribute: "select-row-text" },
39
+ look: { type: String, reflect: true }
36
40
  };
37
41
  }
38
42
  constructor() {
39
43
  super();
40
44
  this.caption = "";
45
+ this.captionHidden = false;
41
46
  this.columns = [];
42
47
  this.rows = [];
43
48
  this.sortKey = "";
@@ -50,6 +55,7 @@ var ImpaktTable = class extends ImpaktElement {
50
55
  this.emptyText = "Nothing to show";
51
56
  this.selectAllText = "Select all rows";
52
57
  this.selectRowText = "Select {row}";
58
+ this.look = "plain";
53
59
  }
54
60
  static {
55
61
  this.styles = [
@@ -89,6 +95,46 @@ var ImpaktTable = class extends ImpaktElement {
89
95
  tbody th {
90
96
  font-weight: ${fontWeight("semibold")};
91
97
  }
98
+ /* Boxed: a white panel with an ink border, mono capitals for the headings and an ink rule under them. */
99
+ :host([look='boxed']) .scroller {
100
+ background: ${t.surfaceCard};
101
+ border: ${t.borderThin} solid ${t.text};
102
+ }
103
+ :host([look='boxed']) caption {
104
+ padding: ${space(4)} ${space(4)} ${space(2)};
105
+ }
106
+ /* The caption still names the table for a screen reader when the design shows none. */
107
+ :host([caption-hidden]) caption {
108
+ position: absolute;
109
+ inline-size: 1px;
110
+ block-size: 1px;
111
+ overflow: hidden;
112
+ clip-path: inset(50%);
113
+ white-space: nowrap;
114
+ }
115
+ :host([look='boxed']) tbody th {
116
+ font-weight: ${fontWeight("regular")};
117
+ }
118
+ .mono {
119
+ font-family: ${t.fontMono};
120
+ }
121
+ :host([look='boxed']) thead th {
122
+ font-family: ${t.fontMono};
123
+ font-size: 11px;
124
+ font-weight: ${fontWeight("medium")};
125
+ letter-spacing: 0.06em;
126
+ text-transform: uppercase;
127
+ color: ${t.textMuted};
128
+ background: transparent;
129
+ border-block-end-color: ${t.text};
130
+ }
131
+ :host([look='boxed']) :is(th, td) {
132
+ padding-inline: ${space(4)};
133
+ border-block-end-color: var(--impakt-color-line-soft, #dcdcd8);
134
+ }
135
+ :host([look='boxed']) tbody tr:last-child > * {
136
+ border-block-end: 0;
137
+ }
92
138
  .numeric {
93
139
  /* A figure read across a line break is a different figure. */
94
140
  white-space: nowrap;
@@ -189,7 +235,7 @@ var ImpaktTable = class extends ImpaktElement {
189
235
  }
190
236
  thead .sort {
191
237
  border: ${t.borderThin} solid ${t.rule};
192
- border-radius: 999px;
238
+ border-radius: var(--impakt-radius-pill, calc(${t.radius} * 9999));
193
239
  padding-inline: ${space(3)};
194
240
  background: ${t.surfaceCard};
195
241
  }
@@ -314,7 +360,7 @@ var ImpaktTable = class extends ImpaktElement {
314
360
  @change=${(e) => this.choose([key], e.target.checked)} /></label></td>` : nothing}
315
361
  ${columns.map((c, j) => {
316
362
  const value = html`<span class="label" aria-hidden="true">${c.label}</span><span class="value"><slot name=${`cell:${key}:${c.key}`}>${row[c.key] ?? ""}</slot></span>`;
317
- return j === 0 ? html`<th scope="row" role="rowheader" id=${`${this.uid}-r${i}`}>${value}</th>` : html`<td role="cell" class=${c.numeric ? "numeric" : ""}>${value}</td>`;
363
+ return j === 0 ? html`<th scope="row" role="rowheader" class=${c.mono ? "mono" : ""} id=${`${this.uid}-r${i}`}>${value}</th>` : html`<td role="cell" class=${[c.numeric ? "numeric" : "", c.mono ? "mono" : ""].join(" ").trim()}>${value}</td>`;
318
364
  })}
319
365
  </tr>
320
366
  `
@@ -330,4 +376,4 @@ customElements.define("impakt-table", ImpaktTable);
330
376
  export {
331
377
  ImpaktTable
332
378
  };
333
- //# sourceMappingURL=chunk-DN5YZFSG.js.map
379
+ //# sourceMappingURL=chunk-KE6WCXQP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/table.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { pageLocale } from '../base/locale';\nimport { focusRing, touchTarget, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\nimport { iconSvg } from './icon';\n\nexport interface TableColumn {\n key: string;\n label: string;\n numeric?: boolean;\n /** Let the rows be sorted by this column. Its heading becomes a button. */\n sortable?: boolean;\n /** Set the column's cells in the mono face, for codes such as \"H1\". */\n mono?: boolean;\n}\n\n/** Which way a sorted column runs, in the words `aria-sort` uses. */\nexport type SortDirection = 'ascending' | 'descending';\n\n/**\n * A data table — a plan comparison, a payment schedule, a list of cases.\n *\n * **The caption is required.** It is the table's name, and a page with three\n * unnamed tables is a page a screen-reader user has to read in full to tell\n * apart. Visually it can be the heading they would have written anyway.\n *\n * **It scrolls, and the scroller is focusable.** A wide table cannot reflow to\n * 320px without becoming unreadable, so it scrolls horizontally — and a region\n * that scrolls must be reachable by keyboard, or a keyboard user simply cannot\n * see the right-hand columns. `tabindex=\"0\"` with a role and a name is the\n * established fix, and the name is why the role is there: a bare focusable div\n * announces nothing.\n *\n * **Or it stacks.** With `stack`, a narrow table turns each row into a card,\n * with each value under the name of its column, so a phone reads a list of\n * cases rather than scrolling a grid. The table keeps its roles written out,\n * because some browsers drop a table's meaning once it is no longer drawn as one.\n *\n * **Sorting is announced.** A sortable column's heading is a button, and the\n * column the rows are sorted by carries `aria-sort`, so a screen reader says\n * \"Opened, sorted descending\" rather than leaving the order to be guessed. The\n * table sorts its own rows unless `manual-sort` says the app does it, as an app\n * that pages its rows on the server must.\n *\n * **Rows can be chosen.** With `selectable`, each row has a checkbox named by\n * the row's first cell, and the heading has one for every row. A row is known by\n * its `id`, or by the key `row-key` names.\n *\n * A cell can hold more than words: give the table a child with\n * `slot=\"cell:{row id}:{column key}\"`, such as a badge, and it is drawn in that\n * cell. With no rows the table says `empty-text`, or shows a child with\n * `slot=\"empty\"`.\n *\n * @category content\n * @icon table\n * @slot empty - What to show when there are no rows, in place of the empty text.\n * @fires {CustomEvent<{ key: string; direction: SortDirection }>} impakt-sort - When a column heading is pressed to sort the rows.\n * @fires {CustomEvent<{ selected: string[] }>} impakt-selection - When rows are chosen or let go. The ids are in detail.selected.\n */\nexport class ImpaktTable extends ImpaktElement {\n static properties = {\n caption: { type: String },\n captionHidden: { type: Boolean, reflect: true, attribute: 'caption-hidden' },\n columns: { type: Array },\n rows: { type: Array },\n sortKey: { type: String, attribute: 'sort-key', reflect: true },\n sortDirection: { type: String, attribute: 'sort-direction', reflect: true },\n manualSort: { type: Boolean, attribute: 'manual-sort' },\n selectable: { type: Boolean, reflect: true },\n selected: { type: Array },\n rowKey: { type: String, attribute: 'row-key' },\n stack: { type: Boolean, reflect: true },\n emptyText: { type: String, attribute: 'empty-text' },\n selectAllText: { type: String, attribute: 'select-all-text' },\n selectRowText: { type: String, attribute: 'select-row-text' },\n look: { type: String, reflect: true },\n };\n\n declare caption: string;\n /** Hides the caption from sight; it still names the table for a screen reader. */\n declare captionHidden: boolean;\n declare columns: TableColumn[];\n declare rows: Array<Record<string, string>>;\n /** The key of the column the rows are sorted by. Empty leaves them in the order given. */\n declare sortKey: string;\n declare sortDirection: SortDirection;\n /** The app sorts the rows itself, on `impakt-sort`. The table only shows which column and which way. */\n declare manualSort: boolean;\n /** Each row has a checkbox, and the heading one for every row. */\n declare selectable: boolean;\n /** The ids of the chosen rows. */\n declare selected: string[];\n /** The key in each row that tells rows apart. */\n declare rowKey: string;\n /** On a narrow screen, draw each row as a card rather than scroll the table sideways. */\n declare stack: boolean;\n /** What the table says when it has no rows. */\n declare emptyText: string;\n /** The name of the checkbox that chooses every row. */\n declare selectAllText: string;\n /** The name of each row's checkbox, with `{row}` for the row's first cell. */\n declare selectRowText: string;\n /**\n * `plain` is the table on the page. `boxed` is the G2 table in a tool: a\n * white panel with a 1px ink border, headings in capitals in the code face at\n * 11px, and an ink rule under them (frame 21:1527).\n */\n declare look: 'plain' | 'boxed';\n\n constructor() {\n super();\n this.caption = '';\n this.captionHidden = false;\n this.columns = [];\n this.rows = [];\n this.sortKey = '';\n this.sortDirection = 'ascending';\n this.manualSort = false;\n this.selectable = false;\n this.selected = [];\n this.rowKey = 'id';\n this.stack = false;\n this.emptyText = 'Nothing to show';\n this.selectAllText = 'Select all rows';\n this.selectRowText = 'Select {row}';\n this.look = 'plain';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('.sort, .pick label'),\n css`\n :host {\n display: block;\n }\n :host([stack]) {\n container-type: inline-size;\n }\n .scroller {\n overflow-x: auto;\n }\n table {\n inline-size: 100%;\n border-collapse: collapse;\n font-size: ${fontSize('md')};\n }\n caption {\n text-align: start;\n font-weight: ${fontWeight('semibold')};\n padding-block-end: ${space(2)};\n }\n th,\n td {\n text-align: start;\n padding: ${space(3)};\n border-block-end: ${t.borderThin} solid ${t.rule};\n }\n thead th {\n font-weight: ${fontWeight('semibold')};\n background: ${t.surfaceInset};\n }\n tbody th {\n font-weight: ${fontWeight('semibold')};\n }\n /* Boxed: a white panel with an ink border, mono capitals for the headings and an ink rule under them. */\n :host([look='boxed']) .scroller {\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid ${t.text};\n }\n :host([look='boxed']) caption {\n padding: ${space(4)} ${space(4)} ${space(2)};\n }\n /* The caption still names the table for a screen reader when the design shows none. */\n :host([caption-hidden]) caption {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n :host([look='boxed']) tbody th {\n font-weight: ${fontWeight('regular')};\n }\n .mono {\n font-family: ${t.fontMono};\n }\n :host([look='boxed']) thead th {\n font-family: ${t.fontMono};\n font-size: 11px;\n font-weight: ${fontWeight('medium')};\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: ${t.textMuted};\n background: transparent;\n border-block-end-color: ${t.text};\n }\n :host([look='boxed']) :is(th, td) {\n padding-inline: ${space(4)};\n border-block-end-color: var(--impakt-color-line-soft, #dcdcd8);\n }\n :host([look='boxed']) tbody tr:last-child > * {\n border-block-end: 0;\n }\n .numeric {\n /* A figure read across a line break is a different figure. */\n white-space: nowrap;\n text-align: end;\n font-variant-numeric: tabular-nums;\n }\n th.sortable {\n padding: ${space(1)};\n }\n .sort {\n display: inline-flex;\n align-items: center;\n gap: ${space(1)};\n min-block-size: ${t.targetMin};\n padding: ${space(2)};\n font: inherit;\n color: inherit;\n background: none;\n border: 0;\n border-radius: ${t.radius};\n cursor: pointer;\n }\n .sort:hover {\n background: ${t.wash};\n }\n .numeric .sort {\n flex-direction: row-reverse;\n }\n .arrow {\n display: inline-flex;\n color: ${t.textMuted};\n transition: transform 140ms ease-in-out;\n }\n [aria-sort] .arrow {\n color: inherit;\n }\n [aria-sort='ascending'] .arrow {\n transform: rotate(180deg);\n }\n :not([aria-sort]) > .sort .arrow {\n opacity: 0.45;\n }\n .pick {\n inline-size: 1%;\n padding-block: 0;\n padding-inline-end: 0;\n }\n .pick label {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-block-size: ${t.targetMin};\n min-inline-size: ${t.targetMin};\n cursor: pointer;\n }\n .pick input {\n inline-size: 20px;\n block-size: 20px;\n margin: 0;\n accent-color: ${t.brand};\n cursor: pointer;\n }\n tr.chosen > * {\n background: ${t.brandSubtle};\n }\n .empty {\n padding-block: ${space(6)};\n text-align: center;\n color: ${t.textMuted};\n }\n .label {\n display: none;\n }\n .visually-hidden {\n ${visuallyHidden}\n }\n /* Stacked: each row a card, each value under its column's name. */\n @container (max-width: 36rem) {\n table, tbody, tr, tbody th, tbody td {\n display: block;\n }\n thead tr {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: ${space(1)};\n margin-block-end: ${space(3)};\n }\n thead th {\n display: none;\n padding: 0;\n border: 0;\n background: none;\n }\n thead th.sortable, thead th.pick {\n display: block;\n inline-size: auto;\n }\n thead .sort {\n border: ${t.borderThin} solid ${t.rule};\n border-radius: var(--impakt-radius-pill, calc(${t.radius} * 9999));\n padding-inline: ${space(3)};\n background: ${t.surfaceCard};\n }\n tbody tr {\n position: relative;\n margin-block-end: ${space(3)};\n padding: ${space(3)} ${space(4)};\n border: ${t.borderThin} solid ${t.rule};\n border-radius: ${t.radiusXl};\n background: ${t.surfaceCard};\n }\n tbody tr.chosen {\n background: ${t.brandSubtle};\n }\n tr.chosen > * {\n background: none;\n }\n tbody th, tbody td {\n display: grid;\n grid-template-columns: minmax(6rem, 38%) minmax(0, 1fr);\n gap: ${space(3)};\n padding: ${space(1.5)} 0;\n border: 0;\n text-align: start;\n white-space: normal;\n }\n tbody td.numeric {\n text-align: start;\n }\n tbody .pick {\n display: block;\n position: absolute;\n inset-block-start: ${space(1)};\n inset-inline-end: ${space(1)};\n inline-size: auto;\n padding: 0;\n }\n tbody tr:has(.pick) > th {\n padding-inline-end: ${space(10)};\n }\n .label {\n display: block;\n font-size: ${fontSize('sm')};\n font-weight: ${fontWeight('semibold')};\n color: ${t.textMuted};\n }\n .empty {\n display: block;\n border: 0;\n }\n }\n `,\n ];\n\n private keyOf(row: Record<string, string>, index: number): string {\n const key = row?.[this.rowKey];\n return key === undefined || key === null || key === '' ? String(index) : String(key);\n }\n\n /** The rows in the order they are drawn: as given, or sorted by the chosen column. */\n private ordered(): Array<{ row: Record<string, string>; key: string }> {\n const rows = (this.rows ?? []).map((row, i) => ({ row, key: this.keyOf(row, i) }));\n const column = (this.columns ?? []).find((c) => c.key === this.sortKey && c.sortable);\n if (!column || this.manualSort) return rows;\n const way = this.sortDirection === 'descending' ? -1 : 1;\n const locale = pageLocale(this);\n const figure = (v: unknown) => Number(String(v ?? '').replace(/[^\\d.-]/g, '')) || 0;\n return rows.sort((a, b) => {\n const x = a.row[column.key] ?? '';\n const y = b.row[column.key] ?? '';\n const order = column.numeric ? figure(x) - figure(y) : String(x).localeCompare(String(y), locale, { numeric: true, sensitivity: 'base' });\n return order * way;\n });\n }\n\n private sortBy(key: string): void {\n const direction: SortDirection = this.sortKey === key && this.sortDirection === 'ascending' ? 'descending' : 'ascending';\n this.sortKey = key;\n this.sortDirection = direction;\n this.dispatchEvent(new CustomEvent('impakt-sort', { detail: { key, direction }, bubbles: true, composed: true }));\n }\n\n private choose(keys: string[], on: boolean): void {\n const now = new Set(this.selected ?? []);\n for (const key of keys) {\n if (on) now.add(key);\n else now.delete(key);\n }\n this.selected = [...now];\n this.dispatchEvent(new CustomEvent('impakt-selection', { detail: { selected: this.selected }, bubbles: true, composed: true }));\n }\n\n private heading(c: TableColumn): TemplateResult {\n const sorted = c.sortable && c.key === this.sortKey;\n const classes = [c.numeric ? 'numeric' : '', c.sortable ? 'sortable' : ''].filter(Boolean).join(' ');\n if (!c.sortable) return html`<th scope=\"col\" role=\"columnheader\" class=${classes}>${c.label}</th>`;\n return html`<th scope=\"col\" role=\"columnheader\" class=${classes} aria-sort=${sorted ? this.sortDirection : nothing}>\n <button class=\"sort\" type=\"button\" part=\"sort\" @click=${() => this.sortBy(c.key)}>${c.label}<span class=\"arrow\" aria-hidden=\"true\">${iconSvg('chevron-down', '16px')}</span></button>\n </th>`;\n }\n\n render(): TemplateResult {\n const columns = this.columns ?? [];\n const rows = this.ordered();\n const chosen = new Set(this.selected ?? []);\n const every = rows.length > 0 && rows.every((r) => chosen.has(r.key));\n const some = !every && rows.some((r) => chosen.has(r.key));\n return html`\n <div class=\"scroller\" part=\"scroller\" tabindex=\"0\" role=\"region\" aria-label=${this.caption || nothing}>\n <table part=\"table\" role=\"table\">\n ${this.caption ? html`<caption part=\"caption\">${this.caption}</caption>` : nothing}\n <thead role=\"rowgroup\">\n <tr role=\"row\">\n ${\n this.selectable\n ? html`<th scope=\"col\" role=\"columnheader\" class=\"pick\"><label><input type=\"checkbox\" aria-label=${this.selectAllText} .checked=${every} .indeterminate=${some} ?disabled=${!rows.length}\n @change=${(e: Event) =>\n this.choose(\n rows.map((r) => r.key),\n (e.target as HTMLInputElement).checked,\n )} /></label></th>`\n : nothing\n }\n ${columns.map((c) => this.heading(c))}\n </tr>\n </thead>\n <tbody role=\"rowgroup\">\n ${\n rows.length\n ? rows.map(\n ({ row, key }, i) => html`\n <tr role=\"row\" class=${chosen.has(key) ? 'chosen' : ''} part=\"row\">\n ${\n this.selectable\n ? html`<td role=\"cell\" class=\"pick\"><label><input type=\"checkbox\" aria-label=${this.selectRowText.replace('{row}', String(row[columns[0]?.key ?? ''] ?? key))} .checked=${chosen.has(key)}\n @change=${(e: Event) => this.choose([key], (e.target as HTMLInputElement).checked)} /></label></td>`\n : nothing\n }\n ${columns.map((c, j) => {\n const value = html`<span class=\"label\" aria-hidden=\"true\">${c.label}</span><span class=\"value\"><slot name=${`cell:${key}:${c.key}`}>${row[c.key] ?? ''}</slot></span>`;\n // The first cell of each row is a row header, so a screen\n // reader announces \"Delivery charge, £250\" rather than\n // reading a bare number with no idea what it belongs to.\n return j === 0\n ? html`<th scope=\"row\" role=\"rowheader\" class=${c.mono ? 'mono' : ''} id=${`${this.uid}-r${i}`}>${value}</th>`\n : html`<td role=\"cell\" class=${[c.numeric ? 'numeric' : '', c.mono ? 'mono' : ''].join(' ').trim()}>${value}</td>`;\n })}\n </tr>\n `,\n )\n : html`<tr role=\"row\"><td role=\"cell\" class=\"empty\" colspan=${columns.length + (this.selectable ? 1 : 0) || 1}><slot name=\"empty\">${this.emptyText}</slot></td></tr>`\n }\n </tbody>\n </table>\n </div>\n `;\n }\n}\n\ncustomElements.define('impakt-table', ImpaktTable);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-table': ImpaktTable;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAS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AAE,UAAU,YAAY,IAAI,EAAE,OAAO,SAAS,EAAE,EAAE,KAAK,GAAG,EAAE,KAAK,CAAC,IAAI,KAAK;AAAA,MAC/G,CAAC,CAAC;AAAA;AAAA;AAAA,IAGF,IACA,4DAA4D,QAAQ,UAAU,KAAK,aAAa,IAAI,MAAM,CAAC,uBAAuB,KAAK,SAAS,mBACtJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAKV;AACF;AAEA,eAAe,OAAO,gBAAgB,WAAW;","names":[]}
@@ -0,0 +1,75 @@
1
+ import {
2
+ kit
3
+ } from "./chunk-XX6JZW5N.js";
4
+ import {
5
+ ImpaktElement,
6
+ visuallyHidden
7
+ } from "./chunk-72WNCCDC.js";
8
+ import {
9
+ t
10
+ } from "./chunk-JTCTQBAX.js";
11
+
12
+ // packages/ui/src/components/redaction.ts
13
+ import { css, html } from "lit";
14
+ var ImpaktRedaction = class extends ImpaktElement {
15
+ static {
16
+ this.properties = {
17
+ label: { type: String },
18
+ look: { type: String, reflect: true },
19
+ redactedText: { type: String, attribute: "redacted-text" }
20
+ };
21
+ }
22
+ constructor() {
23
+ super();
24
+ this.label = "";
25
+ this.look = "solid";
26
+ this.redactedText = "Redacted";
27
+ }
28
+ static {
29
+ this.styles = [
30
+ ...ImpaktElement.styles,
31
+ css`
32
+ :host {
33
+ display: inline;
34
+ }
35
+ .tag {
36
+ position: relative;
37
+ display: inline-block;
38
+ padding: 1px 8px;
39
+ font-family: ${t.fontMono};
40
+ font-size: ${kit.small};
41
+ font-weight: ${kit.medium};
42
+ line-height: 1.4;
43
+ white-space: nowrap;
44
+ color: ${kit.onInverse};
45
+ background: ${kit.inverse};
46
+ border: 1px solid ${kit.inverse};
47
+ border-radius: 0;
48
+ user-select: none;
49
+ }
50
+ :host([look='outline']) .tag {
51
+ color: ${t.text};
52
+ background: ${t.surfaceCard};
53
+ border-color: ${t.text};
54
+ }
55
+ .visually-hidden {
56
+ ${visuallyHidden}
57
+ }
58
+ @media (forced-colors: active) {
59
+ .tag {
60
+ border-color: CanvasText;
61
+ }
62
+ }
63
+ `
64
+ ];
65
+ }
66
+ render() {
67
+ return html`<span class="tag" part="tag"><span class="visually-hidden">${this.redactedText}: </span>${this.label}</span>`;
68
+ }
69
+ };
70
+ customElements.define("impakt-redaction", ImpaktRedaction);
71
+
72
+ export {
73
+ ImpaktRedaction
74
+ };
75
+ //# sourceMappingURL=chunk-LBHTXY7K.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/redaction.ts"],"sourcesContent":["/**\n * An inline tag that stands in for withheld text.\n */\nimport { css, html, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { visuallyHidden } from '../base/styles';\nimport { t } from '../base/tokens';\nimport { kit } from './tool-kit-tokens';\n\n/**\n * Stands in for text that has been withheld, such as a third party's name or a\n * phone number, and says what kind of thing it was.\n *\n * **It never holds the original.** There is no property, attribute or slot for\n * the withheld value, so it cannot reach the page, the accessibility tree or a\n * copy and paste. It takes only `label`, the kind of thing removed, and a\n * screen reader hears \"Redacted: Phone number\".\n *\n * `look=\"outline\"` is the quieter tag for a list of redactions beside the text.\n *\n * Figma: Subject Access `37:656`; dark `48:756`.\n *\n * @category content\n * @icon text\n * @csspart tag - The tag.\n */\nexport class ImpaktRedaction extends ImpaktElement {\n static properties = {\n label: { type: String },\n look: { type: String, reflect: true },\n redactedText: { type: String, attribute: 'redacted-text' },\n };\n\n /** What kind of thing was withheld: \"Third party name\", \"Phone number\". */\n declare label: string;\n /** `solid` in running text, `outline` in a list. */\n declare look: 'solid' | 'outline';\n /** The word a screen reader hears first. */\n declare redactedText: string;\n\n constructor() {\n super();\n this.label = '';\n this.look = 'solid';\n this.redactedText = 'Redacted';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host {\n display: inline;\n }\n .tag {\n position: relative;\n display: inline-block;\n padding: 1px 8px;\n font-family: ${t.fontMono};\n font-size: ${kit.small};\n font-weight: ${kit.medium};\n line-height: 1.4;\n white-space: nowrap;\n color: ${kit.onInverse};\n background: ${kit.inverse};\n border: 1px solid ${kit.inverse};\n border-radius: 0;\n user-select: none;\n }\n :host([look='outline']) .tag {\n color: ${t.text};\n background: ${t.surfaceCard};\n border-color: ${t.text};\n }\n .visually-hidden {\n ${visuallyHidden}\n }\n @media (forced-colors: active) {\n .tag {\n border-color: CanvasText;\n }\n }\n `,\n ];\n\n render(): TemplateResult {\n return html`<span class=\"tag\" part=\"tag\"><span class=\"visually-hidden\">${this.redactedText}: </span>${this.label}</span>`;\n }\n}\n\ncustomElements.define('impakt-redaction', ImpaktRedaction);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-redaction': ImpaktRedaction;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,KAAK,YAAiC;AAuBxC,IAAM,kBAAN,cAA8B,cAAc;AAAA,EACjD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,cAAc,EAAE,MAAM,QAAQ,WAAW,gBAAgB;AAAA,IAC3D;AAAA;AAAA,EASA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,eAAe;AAAA,EACtB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAQmB,EAAE,QAAQ;AAAA,qBACZ,IAAI,KAAK;AAAA,uBACP,IAAI,MAAM;AAAA;AAAA;AAAA,iBAGhB,IAAI,SAAS;AAAA,sBACR,IAAI,OAAO;AAAA,4BACL,IAAI,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,iBAKtB,EAAE,IAAI;AAAA,sBACD,EAAE,WAAW;AAAA,wBACX,EAAE,IAAI;AAAA;AAAA;AAAA,UAGpB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQtB;AAAA;AAAA,EAEA,SAAyB;AACvB,WAAO,kEAAkE,KAAK,YAAY,YAAY,KAAK,KAAK;AAAA,EAClH;AACF;AAEA,eAAe,OAAO,oBAAoB,eAAe;","names":[]}
@@ -1,15 +1,19 @@
1
1
  import {
2
2
  ImpaktElement,
3
+ focusRing,
4
+ say,
5
+ visuallyHidden
6
+ } from "./chunk-72WNCCDC.js";
7
+ import {
3
8
  fontSize,
4
9
  fontWeight,
5
- say,
6
10
  space,
7
- t,
8
- visuallyHidden
9
- } from "./chunk-V7EB7Q2M.js";
11
+ t
12
+ } from "./chunk-JTCTQBAX.js";
10
13
 
11
14
  // packages/ui/src/components/progress.ts
12
- import { html, css, nothing } from "lit";
15
+ import { html, css, nothing, unsafeCSS } from "lit";
16
+ var LINE_SOFT = unsafeCSS("var(--impakt-color-line-soft, #dcdcd8)");
13
17
  var ImpaktProgress = class extends ImpaktElement {
14
18
  static {
15
19
  this.properties = {
@@ -17,7 +21,8 @@ var ImpaktProgress = class extends ImpaktElement {
17
21
  current: { type: String },
18
22
  label: { type: String },
19
23
  look: { type: String, reflect: true },
20
- hideLabels: { type: Boolean, attribute: "hide-labels", reflect: true }
24
+ hideLabels: { type: Boolean, attribute: "hide-labels", reflect: true },
25
+ doneText: { type: String, attribute: "done-text" }
21
26
  };
22
27
  }
23
28
  constructor() {
@@ -27,10 +32,12 @@ var ImpaktProgress = class extends ImpaktElement {
27
32
  this.label = "Progress";
28
33
  this.look = "steps";
29
34
  this.hideLabels = false;
35
+ this.doneText = "";
30
36
  }
31
37
  static {
32
38
  this.styles = [
33
39
  ...ImpaktElement.styles,
40
+ focusRing,
34
41
  css`
35
42
  :host {
36
43
  display: block;
@@ -84,7 +91,7 @@ var ImpaktProgress = class extends ImpaktElement {
84
91
  inset-inline: 0;
85
92
  inset-block-start: 0;
86
93
  block-size: 5px;
87
- border-radius: 999px;
94
+ border-radius: var(--impakt-radius-pill, calc(${t.radius} * 9999));
88
95
  background: ${t.border};
89
96
  }
90
97
  :host([look='bars']) li[data-state='done']::before {
@@ -100,19 +107,91 @@ var ImpaktProgress = class extends ImpaktElement {
100
107
  :host([hide-labels]) .name {
101
108
  ${visuallyHidden}
102
109
  }
110
+ /* Stages: numbered names on a soft rule, the current one underlined in the ink. */
111
+ :host([look='stages']) nav {
112
+ overflow-x: auto;
113
+ scrollbar-width: thin;
114
+ }
115
+ :host([look='stages']) ol {
116
+ gap: ${space(8)};
117
+ inline-size: max-content;
118
+ min-inline-size: 100%;
119
+ box-shadow: inset 0 -1px 0 ${LINE_SOFT};
120
+ }
121
+ :host([look='stages']) li {
122
+ flex: none;
123
+ padding: 0;
124
+ border: 0;
125
+ font-size: ${fontSize("md")};
126
+ font-weight: ${fontWeight("regular")};
127
+ color: ${t.textMuted};
128
+ white-space: nowrap;
129
+ }
130
+ :host([look='stages']) .stage {
131
+ display: inline-flex;
132
+ align-items: baseline;
133
+ gap: ${space(2)};
134
+ min-block-size: 24px;
135
+ padding-block: ${space(3)};
136
+ border-block-end: 3px solid transparent;
137
+ color: inherit;
138
+ text-decoration: none;
139
+ }
140
+ :host([look='stages']) .num {
141
+ font-family: ${t.fontMono};
142
+ font-size: ${fontSize("sm")};
143
+ }
144
+ :host([look='stages']) li[data-state='done'] .num {
145
+ color: ${t.text};
146
+ }
147
+ :host([look='stages']) li[data-state='current'] {
148
+ color: ${t.text};
149
+ }
150
+ :host([look='stages']) li[data-state='current'] .stage {
151
+ border-block-end-color: ${t.text};
152
+ }
153
+ :host([look='stages']) a.stage:hover .name {
154
+ text-decoration: underline;
155
+ text-underline-offset: 0.2em;
156
+ }
157
+ @media (forced-colors: active) {
158
+ :host([look='stages']) li[data-state='current'] .stage { border-block-end-color: CanvasText; }
159
+ }
103
160
  /* Below 30rem the labels stop fitting; the position in words is the part
104
161
  that has to survive, so the list collapses to bars and the current
105
162
  step's name. */
106
163
  @media (max-width: 30rem) {
107
- li:not([data-state='current']) .name {
164
+ :host(:not([look='stages'])) li:not([data-state='current']) .name {
108
165
  ${visuallyHidden}
109
166
  }
110
167
  }
111
168
  `
112
169
  ];
113
170
  }
171
+ renderStages(index) {
172
+ const done = this.doneText || say("done");
173
+ const linked = this.steps.some((step) => step.href);
174
+ return html`
175
+ <nav part="nav" aria-label=${this.label} tabindex=${linked ? nothing : "0"}>
176
+ <ol part="list">
177
+ ${this.steps.map((step, i) => {
178
+ const state = i < index ? "done" : i === index ? "current" : "todo";
179
+ const n = String(i + 1).padStart(2, "0");
180
+ const inner = html`<span class="num" part="step-number">${state === "done" ? html`<span aria-hidden="true">✓ </span>` : nothing}${n}</span>
181
+ <span class="name" part="step-label">${step.label}</span>${state === "done" ? html`<span class="sr-only">, ${done}</span>` : nothing}`;
182
+ return html`
183
+ <li part="step step-${state}" data-state=${state}>
184
+ ${step.href ? html`<a class="stage" href=${step.href} aria-current=${state === "current" ? "step" : nothing}>${inner}</a>` : html`<span class="stage" aria-current=${state === "current" ? "step" : nothing}>${inner}</span>`}
185
+ </li>
186
+ `;
187
+ })}
188
+ </ol>
189
+ </nav>
190
+ `;
191
+ }
114
192
  render() {
115
193
  const index = this.steps.findIndex((s) => s.id === this.current);
194
+ if (this.look === "stages") return this.renderStages(index);
116
195
  return html`
117
196
  <nav part="nav" aria-label=${this.label}>
118
197
  <ol part="list">
@@ -135,4 +214,4 @@ customElements.define("impakt-progress", ImpaktProgress);
135
214
  export {
136
215
  ImpaktProgress
137
216
  };
138
- //# sourceMappingURL=chunk-OZGKK3N5.js.map
217
+ //# sourceMappingURL=chunk-LP4RTYTL.js.map