@atomic-ui/ui 0.2.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/README.md +88 -105
  2. package/custom-elements.json +6370 -15469
  3. package/dist/base/FieldElement.d.ts +14 -3
  4. package/dist/base/{ImpktElement.d.ts → ImpaktElement.d.ts} +2 -2
  5. package/dist/base/scroll-lock.d.ts +2 -0
  6. package/dist/base/styles.d.ts +31 -5
  7. package/dist/base/tokens.d.ts +1 -1
  8. package/dist/base/tone.d.ts +20 -0
  9. package/dist/chunk-2YRTFWW2.js +26 -0
  10. package/dist/chunk-2YRTFWW2.js.map +1 -0
  11. package/dist/{chunk-7BSZPUE3.js → chunk-3EF4T242.js} +7 -7
  12. package/dist/chunk-3EF4T242.js.map +1 -0
  13. package/dist/{chunk-KFD4O7VA.js → chunk-5Y3HYRCU.js} +7 -7
  14. package/dist/chunk-5Y3HYRCU.js.map +1 -0
  15. package/dist/{chunk-7AJN2TIS.js → chunk-5ZQVL3V2.js} +29 -12
  16. package/dist/chunk-5ZQVL3V2.js.map +1 -0
  17. package/dist/{chunk-NCASAXQT.js → chunk-A7YBFS4H.js} +15 -15
  18. package/dist/chunk-A7YBFS4H.js.map +1 -0
  19. package/dist/{chunk-E2VBUWJ4.js → chunk-ACQ4KYPR.js} +9 -9
  20. package/dist/chunk-ACQ4KYPR.js.map +1 -0
  21. package/dist/{chunk-OMJMUFOW.js → chunk-DE3INTHZ.js} +6 -6
  22. package/dist/chunk-DE3INTHZ.js.map +1 -0
  23. package/dist/chunk-EJD6LT7E.js +161 -0
  24. package/dist/chunk-EJD6LT7E.js.map +1 -0
  25. package/dist/{chunk-XJXCTGDR.js → chunk-EJSX4WCD.js} +9 -9
  26. package/dist/chunk-EJSX4WCD.js.map +1 -0
  27. package/dist/chunk-FMSC7J7J.js +76 -0
  28. package/dist/chunk-FMSC7J7J.js.map +1 -0
  29. package/dist/{chunk-R67PDFKE.js → chunk-FWR6SEIA.js} +33 -33
  30. package/dist/chunk-FWR6SEIA.js.map +1 -0
  31. package/dist/{chunk-FFCIY7NM.js → chunk-GJPHQLLN.js} +8 -8
  32. package/dist/chunk-GJPHQLLN.js.map +1 -0
  33. package/dist/{chunk-OLLZFNO6.js → chunk-HNBG2POR.js} +7 -7
  34. package/dist/chunk-HNBG2POR.js.map +1 -0
  35. package/dist/{chunk-E3XJK7MY.js → chunk-HNZQ7LM4.js} +13 -11
  36. package/dist/chunk-HNZQ7LM4.js.map +1 -0
  37. package/dist/{chunk-3IQ73WNW.js → chunk-I54DOEZB.js} +9 -7
  38. package/dist/chunk-I54DOEZB.js.map +1 -0
  39. package/dist/{chunk-QB2KMV6S.js → chunk-PANH23MF.js} +12 -12
  40. package/dist/chunk-PANH23MF.js.map +1 -0
  41. package/dist/{chunk-UCHJCUYI.js → chunk-PYVUQNFQ.js} +39 -13
  42. package/dist/chunk-PYVUQNFQ.js.map +1 -0
  43. package/dist/{chunk-GQDUHZE3.js → chunk-Q54FX3SY.js} +8 -8
  44. package/dist/chunk-Q54FX3SY.js.map +1 -0
  45. package/dist/{chunk-WFKSOM6O.js → chunk-QBORJTS4.js} +68 -44
  46. package/dist/chunk-QBORJTS4.js.map +1 -0
  47. package/dist/{chunk-TGT7J4EG.js → chunk-RXX4CN5J.js} +7 -7
  48. package/dist/chunk-RXX4CN5J.js.map +1 -0
  49. package/dist/{chunk-XEJMFFIM.js → chunk-SV77SN6P.js} +8 -8
  50. package/dist/chunk-SV77SN6P.js.map +1 -0
  51. package/dist/chunk-TAZZLOUY.js +328 -0
  52. package/dist/chunk-TAZZLOUY.js.map +1 -0
  53. package/dist/{chunk-7OXTZJR4.js → chunk-TRZO5CHU.js} +7 -7
  54. package/dist/chunk-TRZO5CHU.js.map +1 -0
  55. package/dist/{chunk-EDSZI227.js → chunk-UPOTBKKK.js} +12 -9
  56. package/dist/chunk-UPOTBKKK.js.map +1 -0
  57. package/dist/{chunk-26O27BQS.js → chunk-WP5WJ4V5.js} +6 -6
  58. package/dist/chunk-WP5WJ4V5.js.map +1 -0
  59. package/dist/{chunk-YD6IZ2C5.js → chunk-WS5AUJ35.js} +7 -7
  60. package/dist/chunk-WS5AUJ35.js.map +1 -0
  61. package/dist/{chunk-HYPPG4NF.js → chunk-WWYYNR3Z.js} +93 -53
  62. package/dist/chunk-WWYYNR3Z.js.map +1 -0
  63. package/dist/{chunk-NKTMMJYD.js → chunk-XU2XODVH.js} +9 -8
  64. package/dist/chunk-XU2XODVH.js.map +1 -0
  65. package/dist/{chunk-D6C7XEY4.js → chunk-YR6T73GY.js} +24 -12
  66. package/dist/chunk-YR6T73GY.js.map +1 -0
  67. package/dist/{chunk-OB7WULFK.js → chunk-YYYQPKQ7.js} +24 -24
  68. package/dist/chunk-YYYQPKQ7.js.map +1 -0
  69. package/dist/{chunk-FJRHZA3C.js → chunk-Z45LY6BT.js} +9 -9
  70. package/dist/chunk-Z45LY6BT.js.map +1 -0
  71. package/dist/{chunk-6YYAOKNI.js → chunk-ZQBEFP2O.js} +7 -7
  72. package/dist/chunk-ZQBEFP2O.js.map +1 -0
  73. package/dist/chunk-ZS7RPXCT.js +47 -0
  74. package/dist/chunk-ZS7RPXCT.js.map +1 -0
  75. package/dist/components/accordion.d.ts +3 -3
  76. package/dist/components/accordion.js +4 -4
  77. package/dist/components/alert.d.ts +3 -3
  78. package/dist/components/alert.js +4 -4
  79. package/dist/components/app-ui.d.ts +47 -31
  80. package/dist/components/app-ui.js +21 -20
  81. package/dist/components/badge.d.ts +37 -0
  82. package/dist/components/badge.js +9 -0
  83. package/dist/components/blocks.d.ts +37 -74
  84. package/dist/components/blocks.js +10 -13
  85. package/dist/components/button.d.ts +3 -3
  86. package/dist/components/button.js +5 -5
  87. package/dist/components/checkbox-group.d.ts +2 -2
  88. package/dist/components/checkbox-group.js +5 -5
  89. package/dist/components/checkbox.d.ts +2 -2
  90. package/dist/components/checkbox.js +5 -5
  91. package/dist/components/chip.d.ts +58 -0
  92. package/dist/components/chip.js +8 -0
  93. package/dist/components/date-input.d.ts +2 -2
  94. package/dist/components/date-input.js +5 -5
  95. package/dist/components/dialog.d.ts +18 -3
  96. package/dist/components/dialog.js +5 -4
  97. package/dist/components/fieldset.d.ts +3 -3
  98. package/dist/components/fieldset.js +4 -4
  99. package/dist/components/grid.d.ts +3 -3
  100. package/dist/components/grid.js +4 -4
  101. package/dist/components/help.d.ts +3 -3
  102. package/dist/components/help.js +4 -4
  103. package/dist/components/icon.d.ts +3 -3
  104. package/dist/components/icon.js +4 -4
  105. package/dist/components/journey.d.ts +30 -16
  106. package/dist/components/journey.js +15 -15
  107. package/dist/components/layout.d.ts +9 -9
  108. package/dist/components/layout.js +10 -10
  109. package/dist/components/link.d.ts +3 -3
  110. package/dist/components/link.js +5 -5
  111. package/dist/components/list.d.ts +3 -3
  112. package/dist/components/list.js +4 -4
  113. package/dist/components/media.d.ts +8 -8
  114. package/dist/components/media.js +8 -8
  115. package/dist/components/navigation.d.ts +5 -5
  116. package/dist/components/navigation.js +7 -7
  117. package/dist/components/page.d.ts +5 -5
  118. package/dist/components/page.js +6 -6
  119. package/dist/components/price.d.ts +3 -3
  120. package/dist/components/price.js +4 -4
  121. package/dist/components/progress.d.ts +3 -3
  122. package/dist/components/progress.js +4 -4
  123. package/dist/components/radio-group.d.ts +2 -2
  124. package/dist/components/radio-group.js +5 -5
  125. package/dist/components/select.d.ts +2 -2
  126. package/dist/components/select.js +5 -5
  127. package/dist/components/summary-list.d.ts +3 -3
  128. package/dist/components/summary-list.js +4 -4
  129. package/dist/components/table.d.ts +97 -5
  130. package/dist/components/table.js +6 -4
  131. package/dist/components/text-input.d.ts +2 -2
  132. package/dist/components/text-input.js +5 -5
  133. package/dist/components/textarea.d.ts +2 -2
  134. package/dist/components/textarea.js +5 -5
  135. package/dist/index.d.ts +47 -40
  136. package/dist/index.js +206 -269
  137. package/dist/standalone/atomic-ui.js +1928 -0
  138. package/dist/standalone/atomic-ui.js.map +7 -0
  139. package/dist/standalone/index.html +173 -0
  140. package/package.json +19 -7
  141. package/scripts/copy-to-product.mjs +52 -0
  142. package/specimen/index.html +173 -0
  143. package/dist/chunk-26O27BQS.js.map +0 -1
  144. package/dist/chunk-2CFVV2NZ.js +0 -494
  145. package/dist/chunk-2CFVV2NZ.js.map +0 -1
  146. package/dist/chunk-3IQ73WNW.js.map +0 -1
  147. package/dist/chunk-4X723QBD.js +0 -361
  148. package/dist/chunk-4X723QBD.js.map +0 -1
  149. package/dist/chunk-6YYAOKNI.js.map +0 -1
  150. package/dist/chunk-7AJN2TIS.js.map +0 -1
  151. package/dist/chunk-7BSZPUE3.js.map +0 -1
  152. package/dist/chunk-7OXTZJR4.js.map +0 -1
  153. package/dist/chunk-7XEPNEVQ.js +0 -264
  154. package/dist/chunk-7XEPNEVQ.js.map +0 -1
  155. package/dist/chunk-D6C7XEY4.js.map +0 -1
  156. package/dist/chunk-E2VBUWJ4.js.map +0 -1
  157. package/dist/chunk-E3XJK7MY.js.map +0 -1
  158. package/dist/chunk-EDSZI227.js.map +0 -1
  159. package/dist/chunk-FFCIY7NM.js.map +0 -1
  160. package/dist/chunk-FJRHZA3C.js.map +0 -1
  161. package/dist/chunk-GQDUHZE3.js.map +0 -1
  162. package/dist/chunk-HYPPG4NF.js.map +0 -1
  163. package/dist/chunk-J4JULXUG.js +0 -249
  164. package/dist/chunk-J4JULXUG.js.map +0 -1
  165. package/dist/chunk-KFD4O7VA.js.map +0 -1
  166. package/dist/chunk-MVEFM5QI.js +0 -195
  167. package/dist/chunk-MVEFM5QI.js.map +0 -1
  168. package/dist/chunk-NCASAXQT.js.map +0 -1
  169. package/dist/chunk-NKTMMJYD.js.map +0 -1
  170. package/dist/chunk-OB7WULFK.js.map +0 -1
  171. package/dist/chunk-OHDPGIJ3.js +0 -428
  172. package/dist/chunk-OHDPGIJ3.js.map +0 -1
  173. package/dist/chunk-OLLZFNO6.js.map +0 -1
  174. package/dist/chunk-OMJMUFOW.js.map +0 -1
  175. package/dist/chunk-QB2KMV6S.js.map +0 -1
  176. package/dist/chunk-R67PDFKE.js.map +0 -1
  177. package/dist/chunk-RZSZQMSE.js +0 -236
  178. package/dist/chunk-RZSZQMSE.js.map +0 -1
  179. package/dist/chunk-TGT7J4EG.js.map +0 -1
  180. package/dist/chunk-UCHJCUYI.js.map +0 -1
  181. package/dist/chunk-UHLRXI6J.js +0 -453
  182. package/dist/chunk-UHLRXI6J.js.map +0 -1
  183. package/dist/chunk-UNVL3CNM.js +0 -725
  184. package/dist/chunk-UNVL3CNM.js.map +0 -1
  185. package/dist/chunk-WDDWWCHN.js +0 -104
  186. package/dist/chunk-WDDWWCHN.js.map +0 -1
  187. package/dist/chunk-WFKSOM6O.js.map +0 -1
  188. package/dist/chunk-XEJMFFIM.js.map +0 -1
  189. package/dist/chunk-XJXCTGDR.js.map +0 -1
  190. package/dist/chunk-YD6IZ2C5.js.map +0 -1
  191. package/dist/chunk-YK5QI57J.js +0 -396
  192. package/dist/chunk-YK5QI57J.js.map +0 -1
  193. package/dist/components/changelog.d.ts +0 -386
  194. package/dist/components/changelog.js +0 -25
  195. package/dist/components/estimator.d.ts +0 -246
  196. package/dist/components/estimator.js +0 -16
  197. package/dist/components/marketing.d.ts +0 -370
  198. package/dist/components/marketing.js +0 -21
  199. package/dist/components/marketing.js.map +0 -1
  200. package/dist/components/organisms.d.ts +0 -559
  201. package/dist/components/organisms.js +0 -25
  202. package/dist/components/organisms.js.map +0 -1
  203. package/dist/components/property.d.ts +0 -389
  204. package/dist/components/property.js +0 -20
  205. package/dist/components/property.js.map +0 -1
  206. package/dist/components/scene.d.ts +0 -138
  207. package/dist/components/scene.js +0 -8
  208. package/dist/components/scene.js.map +0 -1
  209. package/dist/components/scrubber.d.ts +0 -86
  210. package/dist/components/scrubber.js +0 -8
  211. package/dist/components/scrubber.js.map +0 -1
  212. package/dist/components/selling.d.ts +0 -407
  213. package/dist/components/selling.js +0 -25
  214. package/dist/components/selling.js.map +0 -1
  215. package/dist/components/site.d.ts +0 -283
  216. package/dist/components/site.js +0 -20
  217. package/dist/components/site.js.map +0 -1
  218. /package/dist/components/{changelog.js.map → badge.js.map} +0 -0
  219. /package/dist/components/{estimator.js.map → chip.js.map} +0 -0
package/README.md CHANGED
@@ -1,161 +1,144 @@
1
1
  # @atomic-ui/ui
2
2
 
3
- Standard custom elements, styled only from design tokens, built to WCAG 2.2 AA.
3
+ Standard custom elements, styled only from design tokens, built to WCAG 2.2 AA: the product components every Impakt product uses, and the shared base every element builds on.
4
4
 
5
- One implementation in Lit; React, Vue and Angular get thin wrappers rather than their
6
- own components, because an accessible component is mostly behaviour — focus management,
7
- roving tabindex, live-region timing — and behaviour written three times is wrong in
8
- three different ways ([ADR 0004](https://github.com/matthill8286/strata/blob/main/docs/decisions/0004-lit-plus-wrappers.md)).
5
+ The blocks Strata builds sites from, such as the hero, the calculators, the site header and footer and the changelog blocks, are in [`@atomic-ui/strata`](../strata), which builds on this package. They moved there in 0.5.0, under the same tags.
6
+
7
+ There is one implementation, in Lit. React, Vue and Angular get thin bindings rather than their own components, because an accessible component is mostly behaviour, such as focus management, roving tabindex and live-region timing, and behaviour written three times is wrong in three different ways ([ADR 0004](https://github.com/matthill8286/strata/blob/main/docs/decisions/0004-lit-plus-wrappers.md)).
8
+
9
+ ## How each kind of product uses it
10
+
11
+ ### A plain HTML product
12
+
13
+ A product with no build step copies one file, `atomic-ui.js`, into its `public` folder beside the product theme, and loads it once:
9
14
 
10
15
  ```html
11
- <link rel="stylesheet" href="@atomic-ui/design-tokens/dist/tokens.css" />
12
- <script type="module">import '@atomic-ui/ui';</script>
16
+ <link rel="stylesheet" href="/theme.css">
17
+ <script type="module" src="/atomic-ui.js"></script>
13
18
 
14
- <impkt-text-input label="Postcode" description="As on your statement" autocomplete="postal-code"></impkt-text-input>
15
- <impkt-button variant="primary">Get my price</impkt-button>
19
+ <impakt-text-input label="Postcode" description="As on your statement" autocomplete="postal-code"></impakt-text-input>
20
+ <impakt-table caption="Open cases" stack columns='[{"key":"ref","label":"Reference","sortable":true}]' rows='[{"ref":"HB-1042"}]'></impakt-table>
21
+ <impakt-button variant="primary">Save and continue</impakt-button>
16
22
  ```
17
23
 
18
- In React, from `@atomic-ui/ui-react`:
24
+ The file is `dist/standalone/atomic-ui.js`, also exported as `@atomic-ui/ui/standalone`. It is one minified ES module holding Lit and every element, and it defines every element when it loads. Its source map sits beside it. At 0.5.0 it is about 160 KB, or 40 KB gzipped. It also exports what this package exports, and Lit's `LitElement`, `html`, `css`, `svg`, `nothing`, `noChange`, `unsafeCSS` and `render`, so that `atomic-ui-strata.js` from `@atomic-ui/strata`, loaded after it from the same folder, imports the base, the product components and Lit from it instead of carrying a second copy. A product that uses the Strata blocks copies both files.
25
+
26
+ To copy it, build the design system and run `pnpm ui:copy ../impkt-tender` at the root, naming the product's folder. A second argument names a folder other than `public`. The first line of the copy names the version and the design system's commit. To update it, build again and run the same command. A product that installs this package from npm can run `npx impakt-ui-copy . public`.
27
+
28
+ `specimen/index.html` is a page that uses the app components this way, and the build puts it beside the standalone file as `dist/standalone/index.html`. Copy `theme.css` and its `fonts` beside it to open it. The browser suite runs it in light and dark, on a phone and on a desktop.
29
+
30
+ The product theme gives the components the products' colours in light and in dark. Without it, a page loads the tokens itself, as below.
31
+
32
+ ### A React, Vue or Angular app
33
+
34
+ The app installs this package and the bindings for its framework, and imports the components from the bindings: [`@atomic-ui/ui-react`](../ui-react), [`@atomic-ui/ui-vue`](../ui-vue) or [`@atomic-ui/ui-angular`](../ui-angular).
19
35
 
20
36
  ```tsx
21
37
  <TextInput label="Postcode" autocomplete="postal-code" onChange={(e) => set(e.detail.value)} />
22
- <RadioGroup label="Any returns?" options={[{ value: 'yes', label: 'Yes' }]} />
38
+ <Table caption="Open cases" columns={columns} rows={rows} stack onSort={(e) => sortBy(e.detail)} />
39
+ ```
40
+
41
+ Each binding is thin, and each exists for a different reason. React needs typed events, and before React 19 it needed properties set rather than attributes. Vue needs the `.` prefix hidden and prop types. Angular needs `ControlValueAccessor` directives, without which a reactive form containing one of these controls silently never receives a value. The React and Vue bindings are generated from this package's manifest, so they cover every element. They are generated from `@atomic-ui/strata`'s manifest too, into a separate entry, `@atomic-ui/ui-react/strata` and `@atomic-ui/ui-vue/strata`.
42
+
43
+ ### The tokens
44
+
45
+ Every component reads `--impakt-*` custom properties. The product theme sets them, or an app writes them for its own brand with `@atomic-ui/design-tokens`:
46
+
47
+ ```ts
48
+ import { BrandInputsSchema, deriveTokens, toStylesheet } from '@atomic-ui/design-tokens';
49
+
50
+ const brand = BrandInputsSchema.parse(myBrandInputs);
51
+ const style = document.createElement('style');
52
+ style.textContent = toStylesheet(deriveTokens(brand), { fonts: brand.font.webFonts });
53
+ document.head.append(style);
23
54
  ```
24
55
 
25
56
  ## What is here
26
57
 
27
- Seventy-six elements.
58
+ Fifty-two elements.
28
59
 
29
60
  | Group | Elements |
30
61
  | --- | --- |
31
- | The page frame | `impkt-page`, `impkt-section` |
32
- | Layout and type | `impkt-grid`, `impkt-stack`, `impkt-card`, `impkt-heading`, `impkt-text`, `impkt-divider`, `impkt-spacer`, `impkt-visually-hidden` |
33
- | Navigation and actions | `impkt-nav`, `impkt-breadcrumbs`, `impkt-button`, `impkt-link` |
34
- | Marketing blocks | `impkt-hero`, `impkt-feature-list`, `impkt-card-grid`, `impkt-quote`, `impkt-stat`, `impkt-badge` |
35
- | Organisms | `impkt-carousel`, `impkt-gallery`, `impkt-logo-cloud`, `impkt-steps`, `impkt-media-split`, `impkt-cta-banner`, `impkt-reviews`, `impkt-newsletter` |
36
- | App | `impkt-drawer`, `impkt-toast`, `impkt-menu`, `impkt-pagination`, `impkt-avatar`, `impkt-avatar-group`, `impkt-empty-state`, `impkt-slot-picker` |
37
- | Property | `impkt-site-plan`, `impkt-mortgage-calculator`, `impkt-before-after`, `impkt-sticky-bar`, `impkt-location-card` |
38
- | Journeys | `impkt-address-lookup`, `impkt-error-summary`, `impkt-file-upload`, `impkt-money-input`, `impkt-range-input`, `impkt-task-list` |
39
- | Selling | `impkt-plan-comparison`, `impkt-video`, `impkt-regulatory-notice`, `impkt-stamp-duty-calculator`, `impkt-affordability-calculator`, `impkt-contact-block` |
40
- | Form controls | `impkt-text-input`, `impkt-textarea`, `impkt-select`, `impkt-checkbox`, `impkt-checkbox-group`, `impkt-radio-group`, `impkt-date-input`, `impkt-fieldset` |
41
- | Feedback | `impkt-alert`, `impkt-dialog` |
42
- | Content | `impkt-summary-list`, `impkt-table`, `impkt-accordion`, `impkt-tabs`, `impkt-progress`, `impkt-price` |
43
- | Media | `impkt-image`, `impkt-logo`, `impkt-icon`, `impkt-document-link` |
44
-
45
- **A layout puts `impkt-page` at its root.** It gives a page the brand's page width
46
- (`layout.page-width`), its side margins on a phone, tablet and desktop
47
- (`layout.margin.*`), the header, main and footer landmarks, and a Skip to content link.
48
- Without it a page runs edge to edge. `impkt-section` is a band across the whole width
49
- of the screen with the content kept to the page width inside it.
62
+ | Actions and navigation | `impakt-button`, `impakt-link`, `impakt-help`, `impakt-nav`, `impakt-breadcrumbs`, `impakt-menu`, `impakt-pagination` |
63
+ | Forms | `impakt-text-input`, `impakt-textarea`, `impakt-select`, `impakt-checkbox`, `impakt-checkbox-group`, `impakt-radio-group`, `impakt-date-input`, `impakt-fieldset`, `impakt-money-input`, `impakt-range-input`, `impakt-address-lookup`, `impakt-file-upload`, `impakt-error-summary`, `impakt-slot-picker` |
64
+ | Feedback | `impakt-alert`, `impakt-dialog`, `impakt-drawer`, `impakt-toast`, `impakt-progress`, `impakt-empty-state`, `impakt-badge`, `impakt-chip` |
65
+ | Content | `impakt-table`, `impakt-summary-list`, `impakt-accordion`, `impakt-tabs`, `impakt-task-list` |
66
+ | Layout | `impakt-page`, `impakt-section`, `impakt-stack`, `impakt-grid`, `impakt-card`, `impakt-divider`, `impakt-spacer`, `impakt-visually-hidden` |
67
+ | Type and media | `impakt-heading`, `impakt-text`, `impakt-list`, `impakt-price`, `impakt-icon`, `impakt-image`, `impakt-logo`, `impakt-document-link`, `impakt-avatar`, `impakt-avatar-group` |
68
+
69
+ It also exports the shared base that `@atomic-ui/strata` and an app's own elements build on: `ImpaktElement` and `FieldElement`, the tokens (`t`, `token`, `space`, `type` and the rest), the style fragments that carry the accessibility guarantees (`focusRing`, `targetSize`, `touchTarget`, `visuallyHidden`, `hideOn`), the wording and locale lookups (`say`, `pageLocale`), the scroll lock, the icons, and the tones (`Tone`, `toneOf`) the chip shares with the changelog blocks.
70
+
71
+ **A layout puts `impakt-page` at its root.** It gives a page the brand's page width (`layout.page-width`), its side margins on a phone, tablet and desktop (`layout.margin.*`), the header, main and footer landmarks, and a Skip to content link. Without it a page runs edge to edge. `impakt-section` is a band across the whole width of the screen with the content kept to the page width inside it. A product page with its own layout can leave both out.
50
72
 
51
73
  **Everything sits on one set of scales,** derived from the brand:
52
74
 
53
75
  - **Space** in quarter steps of the brand's base unit: `space(1)` is 4px, `space(4)` 16px, `space(12)` 48px, with half steps at the small end. Every gap, padding and margin is one of them, so things line up.
54
- - **Type** from `xs` (12px) to `6xl` (60px) against a 16px base, each size with its own line height (`type('xl')` sets both). Display sizes are drawn slightly tighter and move with the brand's ratio.
76
+ - **Type** from `xs` (12px) to `6xl` (60px) against a 16px base, each size with its own line height (`type('xl')` sets both). Display sizes are drawn slightly tighter and move with the brand's ratio. The app components use nothing below `sm`, which is 14px.
55
77
  - **Radii** from `xs` to `3xl` in steps of the brand's base, and **shadows** from `xs` to `xl`, tinted with the text colour.
56
78
  - **Hairlines** (`t.hairline`, `t.rule`) are the text colour at 10% and 15%, for card rings and quiet borders. Form controls keep the contrast-checked border, because their edges must be visible (1.4.11).
57
79
 
58
- Controls share sizes: a button and a field are both 40px tall at the default size, 32px small and 48px large.
80
+ Controls share sizes: a button and a field are both 40px tall at the default size, 32px small and 48px large. On a touch screen the controls of the app components are at least 44 by 44 pixels, as the design guide sets; the `touchTarget` style fragment applies it by pointer rather than by width.
59
81
 
60
- **Icons come from one set**, `ICONS`, drawn on a 24 by 24 grid in the current text
61
- colour, so every icon matches the line weight of the ones beside it. An icon is
62
- decorative unless it is given a `label`.
82
+ **Icons come from one set**, `ICONS`, drawn on a 24 by 24 grid in the current text colour, so every icon matches the line weight of the ones beside it. An icon is decorative unless it is given a `label`.
63
83
 
64
- Bindings: [`@atomic-ui/ui-react`](../ui-react), [`@atomic-ui/ui-vue`](../ui-vue),
65
- [`@atomic-ui/ui-angular`](../ui-angular). Each is thin and each exists for a different
66
- reason — React needs property binding and typed events, Vue needs the `.` prefix hidden
67
- and prop types, and Angular needs `ControlValueAccessor` directives, without which a
68
- reactive form containing one of these controls silently never receives a value.
84
+ ## The app components
85
+
86
+ These are the parts the products' app screens use most, and the browser suite holds them to the app standard on a phone and a desktop, in light and dark.
87
+
88
+ - **`impakt-table`** has a caption for its name and scrolls inside a focusable region when it is too wide. A column with `sortable` gets a button for its heading, the sorted column carries `aria-sort`, and pressing it fires `impakt-sort`; the table sorts its own rows unless `manual-sort` is set. `selectable` gives each row a checkbox named by its first cell, `selected` holds the chosen ids, and changes fire `impakt-selection`. `stack` draws each row as a card on a narrow screen. With no rows it says `empty-text`, or shows the `empty` slot. A child with `slot="cell:{row id}:{column key}"` is drawn in that cell.
89
+ - **`impakt-tabs`** follow the ARIA tabs pattern, with the arrow keys, Home and End. They stay on one row and scroll the chosen tab into view; `two-rows` lays more than four tabs out in two rows on a narrow screen. A child whose `slot` is a tab's id is that tab's panel. The chosen tab is kept when the tabs are given again, as a React render does.
90
+ - **`impakt-toast`** is said through a live region that is on the page first. It never takes the page's clicks, stays up while it has a button, and closes on Escape or Dismiss.
91
+ - **`impakt-dialog`** and **`impakt-drawer`** are native modal dialogs, so focus is trapped and returned and Escape closes them. The page behind does not scroll. A drawer fills a phone's screen, and so does a dialog with `phone-full-screen`.
92
+ - **`impakt-menu`**, **`impakt-pagination`**, **`impakt-file-upload`**, **`impakt-error-summary`**, **`impakt-date-input`** and **`impakt-money-input`** work from the keyboard, are labelled, and say their errors. Focusing any form element focuses its control, which is how the error summary's links reach a field.
69
93
 
70
94
  ## The decisions worth knowing
71
95
 
72
- **Nothing names a colour.** Components read `var(--impkt-*)` with a fallback, so a brand
73
- is a content publish rather than a rebuild, and a missing token stylesheet is an
74
- annoyance rather than a blank page.
96
+ **Nothing names a colour.** Components read `var(--impakt-*)` with a fallback, so a brand is a content publish rather than a rebuild, and a missing token stylesheet is an annoyance rather than a blank page.
75
97
 
76
- **The focus ring and the minimum target size are locked tokens.** A brand cannot reach
77
- them. The ring is two-tone — light inside dark — so it stays visible on any surface a
78
- partner can produce, and it carries a transparent `outline` behind the `box-shadow`
79
- because Windows High Contrast Mode drops shadows entirely.
98
+ **The focus ring and the minimum target size are locked tokens.** A brand cannot reach them. The ring is two-tone, light inside dark, so it stays visible on any surface a partner can produce, and it carries a transparent `outline` behind the `box-shadow` because Windows High Contrast Mode drops shadows entirely.
80
99
 
81
- **A busy button is not a disabled button.** `disabled` removes an element from the tab
82
- order, so a keyboard user who just pressed it is thrown to the top of the document at
83
- the moment something starts happening. Busy keeps focus, reports `aria-disabled` and
84
- `aria-busy`, and blocks activation in the handler.
100
+ **A busy button is not a disabled button.** `disabled` removes an element from the tab order, so a keyboard user who just pressed it is thrown to the top of the document at the moment something starts happening. Busy keeps focus, reports `aria-disabled` and `aria-busy`, and blocks activation in the handler.
85
101
 
86
- **The error live region exists before there is an error.** A region inserted together
87
- with its content is announced inconsistently, and the inconsistency is per screen
88
- reader — so it passes local testing and fails for users.
102
+ **The error live region exists before there is an error.** A region inserted together with its content is announced inconsistently, and the inconsistency is per screen reader, so it passes local testing and fails for users.
89
103
 
90
- **`aria-describedby` never crosses a shadow boundary**, which is why a field renders its
91
- own label, description, control and error in one shadow root rather than slotting the
92
- input from outside.
104
+ **`aria-describedby` never crosses a shadow boundary**, which is why a field renders its own label, description, control and error in one shadow root rather than slotting the input from outside.
93
105
 
94
- **Native elements wherever one exists.** The radio group is the clearest case: a set of
95
- `<input type="radio">` sharing a name already has roving tabindex, arrow keys that wrap,
96
- Home and End, and the right announcement everywhere. Reimplementing that is the most
97
- commonly attempted and most commonly botched widget in any design system.
106
+ **Native elements wherever one exists.** The radio group is the clearest case: a set of `<input type="radio">` sharing a name already has roving tabindex, arrow keys that wrap, Home and End, and the right announcement everywhere. Reimplementing that is the most commonly attempted and most commonly botched widget in any design system.
98
107
 
99
108
  ## What the tests actually check
100
109
 
101
110
  Two suites, split by what each can honestly measure.
102
111
 
103
- **`pnpm --filter @atomic-ui/ui test`** runs in happy-dom, which has no layout engine. It
104
- checks what breaks in practice — roles, accessible names, the `describedby`
105
- relationships resolved to the text a screen reader would read, keyboard behaviour, form
106
- association — and axe is restricted to the rules that mean anything without layout.
107
- Running the full rule set here would report passes for colour-contrast and target-size
108
- that axe never evaluated.
112
+ `@atomic-ui/strata` runs the same two suites over its blocks.
113
+
114
+ **`pnpm --filter @atomic-ui/ui test`** runs in happy-dom, which has no layout engine. It checks what breaks in practice: roles, accessible names, the `describedby` relationships resolved to the text a screen reader would read, keyboard behaviour and form association. axe is restricted to the rules that mean anything without layout. Running the full rule set here would report passes for colour contrast and target size that axe never evaluated. It also checks that nothing in the 0.2.0 manifest has gone, apart from the 37 blocks that moved to `@atomic-ui/strata`, whose own test checks the two manifests together.
109
115
 
110
- **`pnpm --filter @atomic-ui/ui test:browser`** runs the real library in Chromium, bundled
111
- with esbuild and styled by the real token stylesheet. It answers everything the first
112
- suite cannot:
116
+ **`pnpm --filter @atomic-ui/ui test:browser`** runs the real library in Chromium. It answers everything the first suite cannot:
113
117
 
114
118
  - the **full** axe rule set, colour contrast and target size included
115
- - every interactive element at 24×24 (2.5.8), with the criterion's inline-link
116
- exemption applied narrowly and a second test keeping it narrow
117
- - no sideways scrolling at 320px (1.4.10 — which is also 1280px at 400% zoom)
119
+ - every interactive element at 24 by 24 (2.5.8), with the criterion's inline-link exemption applied narrowly and a second test keeping it narrow
120
+ - no sideways scrolling at 320px (1.4.10, which is also 1280px at 400% zoom)
118
121
  - nothing clipped under the text-spacing overrides (1.4.12)
119
122
  - a focus ring that renders, and a boundary that survives forced-colours mode
120
- - the dialog actually being modal: `:modal` matches, Escape closes it, focus returns
121
- to the opener, and a non-dismissible dialog refuses Escape
123
+ - the dialog actually being modal: `:modal` matches, Escape closes it, focus returns to the opener, and a non-dismissible dialog refuses Escape
124
+
125
+ The `app.spec.ts` suite loads the specimen page with the built theme and the standalone file, as a plain HTML product does, at 1280 by 800 and on a 390 by 844 touch screen, in light and dark. It checks the full axe rule set, no sideways scrolling, no text below 14px, fields of at least 16px, touch targets of at least 44px, and the keyboard, focus and announcement behaviour of each app component.
122
126
 
123
127
  Between the two, no criterion is reported as passing without being evaluated.
124
128
 
125
129
  ## The manifest
126
130
 
127
- `pnpm --filter @atomic-ui/ui manifest` emits `custom-elements.json` — the intermediate
128
- the CMS palette is ultimately generated from. It is checked in so the conversion is
129
- runnable from a fresh clone; the artefact actually *reviewed* is
130
- [@atomic-ui/ui-manifest](../ui-manifest/README.md)'s `manifest.json`, which is small
131
- enough to read as a diff.
131
+ `pnpm --filter @atomic-ui/ui manifest` writes `custom-elements.json`, and the package build runs it too. It is one of the two sources the CMS palette is generated from, with `@atomic-ui/strata`'s, and the React and Vue bindings are generated from it. It is checked in so it can be read from a fresh clone, and it is published, as `@atomic-ui/ui/custom-elements.json`. Strata's publish gate checks pages against it, so an element, attribute, property, event or slot can be added but never removed or renamed.
132
132
 
133
- Two tags the Custom Elements Manifest spec has no place for — `@category` and `@icon` —
134
- are captured by a plugin in `custom-elements-manifest.config.mjs`, so they live on the
135
- component rather than in a lookup table somewhere else.
133
+ Two tags the Custom Elements Manifest spec has no place for, `@category` and `@icon`, are captured by a plugin in `custom-elements-manifest.config.mjs`, so they live on the component rather than in a lookup table somewhere else. Each event's `@fires` tag names the type of its detail, which the bindings use for their event types.
136
134
 
137
135
  ## Not here yet
138
136
 
139
137
  Stated plainly, because a component library that looks finished is how gaps ship.
140
138
 
141
- - **No manual audit.** Automated checking catches perhaps a third of real issues and
142
- judges none of them — whether alt text is useful, whether an error message makes
143
- sense, whether the reading order tells a story. A screen-reader pass happens before
144
- any brand launches, and nothing here substitutes for it.
145
- - **One browser.** The browser suite runs Chromium. Firefox and WebKit differ most in
146
- exactly the places this library leans on the platform — `showModal`, `:focus-visible`,
147
- forced colours — so they are worth adding before launch.
148
- - **Server rendering is untested.** Declarative Shadow DOM works, the framework
149
- integrations are uneven, and an SSR'd page can show unstyled content until hydration.
150
- Behind a form this is tolerable; a marketing page would feel it.
151
- - **Composition-level criteria are deliberately elsewhere.** Consistent help (3.2.6),
152
- redundant entry (3.3.7) and heading order across a page are properties of a page or a
153
- journey, not of a component — they are checked in Strata at publish
154
- ([ADR 0009](https://github.com/matthill8286/strata/blob/main/docs/decisions/0009-wcag-is-an-authoring-gate.md)). The browser
155
- suite found a heading-order failure in its own gallery, which is a fair illustration:
156
- every component was correct and the page was still wrong.
157
-
158
- The Grid component supplies one to four columns or either sidebar arrangement. Each
159
- column has a named slot. It stacks below 40rem of available container width, preserving
160
- column order. The designer offers these as draggable layout presets and prevents
161
- removing an occupied column.
139
+ - **No manual audit.** Automated checking catches perhaps a third of real issues and judges none of them: whether alt text is useful, whether an error message makes sense, whether the reading order tells a story. A screen-reader pass happens before any brand launches, and nothing here substitutes for it.
140
+ - **One browser.** The browser suite runs Chromium. Firefox and WebKit differ most in exactly the places this library leans on the platform, such as `showModal`, `:focus-visible` and forced colours, so they are worth adding before launch.
141
+ - **Server rendering is untested.** Declarative Shadow DOM works, the framework integrations are uneven, and a server-rendered page can show unstyled content until hydration. Behind a form this is tolerable; a marketing page would feel it.
142
+ - **Composition-level criteria are deliberately elsewhere.** Consistent help (3.2.6), redundant entry (3.3.7) and heading order across a page are properties of a page or a journey, not of a component, and they are checked in Strata at publish ([ADR 0009](https://github.com/matthill8286/strata/blob/main/docs/decisions/0009-wcag-is-an-authoring-gate.md)). The browser suite found a heading-order failure in its own gallery, which is a fair illustration: every component was correct and the page was still wrong.
143
+
144
+ The Grid component supplies one to four columns or either sidebar arrangement. Each column has a named slot. It stacks below 40rem of available container width, preserving column order. The designer offers these as draggable layout presets and prevents removing an occupied column.