@atomic-ui/ui 0.1.7 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -95
- package/custom-elements.json +25364 -0
- package/dist/base/FieldElement.d.ts +11 -0
- package/dist/base/ImpktElement.d.ts +14 -0
- package/dist/base/locale.d.ts +8 -0
- package/dist/base/say.d.ts +1 -0
- package/dist/base/scroll-lock.d.ts +2 -0
- package/dist/base/styles.d.ts +25 -6
- package/dist/base/tokens.d.ts +5 -1
- package/dist/chunk-2YRTFWW2.js +26 -0
- package/dist/chunk-2YRTFWW2.js.map +1 -0
- package/dist/{chunk-X7IPZPTG.js → chunk-37PA72FC.js} +34 -19
- package/dist/chunk-37PA72FC.js.map +1 -0
- package/dist/chunk-3IGNZTJU.js +14 -0
- package/dist/chunk-3IGNZTJU.js.map +1 -0
- package/dist/{chunk-NTNXHLTM.js → chunk-3KO55PZK.js} +47 -2
- package/dist/chunk-3KO55PZK.js.map +1 -0
- package/dist/chunk-3RE4H2XO.js +53 -0
- package/dist/chunk-3RE4H2XO.js.map +1 -0
- package/dist/{chunk-5EA4IDUD.js → chunk-46BYUQ5A.js} +2 -2
- package/dist/{chunk-WECSVHIM.js → chunk-4OYHT4BN.js} +7 -3
- package/dist/chunk-4OYHT4BN.js.map +1 -0
- package/dist/{chunk-4HU4Y23Q.js → chunk-55DK75QF.js} +6 -4
- package/dist/chunk-55DK75QF.js.map +1 -0
- package/dist/{chunk-XVKEM5JY.js → chunk-5QSTXIPG.js} +2 -2
- package/dist/{chunk-QCNT7D5V.js → chunk-7P4Z4CLK.js} +63 -20
- package/dist/chunk-7P4Z4CLK.js.map +1 -0
- package/dist/{chunk-GSCVG2ER.js → chunk-APJ5JGRW.js} +3 -3
- package/dist/chunk-AUVIOU5G.js +522 -0
- package/dist/chunk-AUVIOU5G.js.map +1 -0
- package/dist/{chunk-6ICOJPMD.js → chunk-CUUBAETM.js} +4 -3
- package/dist/chunk-CUUBAETM.js.map +1 -0
- package/dist/{chunk-NQKYHILD.js → chunk-DAH7RLW3.js} +3 -3
- package/dist/{chunk-OB7LC6NJ.js → chunk-DJEZW7AC.js} +2 -2
- package/dist/{chunk-XJP45LFA.js → chunk-DKZ425AM.js} +15 -5
- package/dist/chunk-DKZ425AM.js.map +1 -0
- package/dist/{chunk-GO2IBRFP.js → chunk-F4YQWKK2.js} +7 -4
- package/dist/chunk-F4YQWKK2.js.map +1 -0
- package/dist/chunk-FVCM4WHD.js +328 -0
- package/dist/chunk-FVCM4WHD.js.map +1 -0
- package/dist/chunk-GBRML4RF.js +264 -0
- package/dist/chunk-GBRML4RF.js.map +1 -0
- package/dist/{chunk-ZQJD4YEJ.js → chunk-HXINWP3V.js} +42 -13
- package/dist/chunk-HXINWP3V.js.map +1 -0
- package/dist/{chunk-T6L3USBZ.js → chunk-IOBSIAHB.js} +23 -11
- package/dist/chunk-IOBSIAHB.js.map +1 -0
- package/dist/{chunk-7Y6UCSUS.js → chunk-IZOTGWWI.js} +5 -5
- package/dist/chunk-IZOTGWWI.js.map +1 -0
- package/dist/{chunk-MLVUMCQ2.js → chunk-J2FACXYI.js} +14 -5
- package/dist/chunk-J2FACXYI.js.map +1 -0
- package/dist/{chunk-VTFCTWSX.js → chunk-KKJEEKL2.js} +33 -7
- package/dist/chunk-KKJEEKL2.js.map +1 -0
- package/dist/{chunk-HWWA27DN.js → chunk-KMCGX76Y.js} +2 -2
- package/dist/{chunk-2YQA3VBY.js → chunk-NKMVICB5.js} +4 -2
- package/dist/chunk-NKMVICB5.js.map +1 -0
- package/dist/{chunk-ZBLTU67D.js → chunk-OFLMG6RN.js} +15 -11
- package/dist/chunk-OFLMG6RN.js.map +1 -0
- package/dist/{chunk-CMAU4DSB.js → chunk-P6GDMZK4.js} +5 -5
- package/dist/chunk-P6GDMZK4.js.map +1 -0
- package/dist/{chunk-MOEMFL4K.js → chunk-PO6FCAIS.js} +5 -5
- package/dist/chunk-PO6FCAIS.js.map +1 -0
- package/dist/chunk-PWLZFGS3.js +494 -0
- package/dist/chunk-PWLZFGS3.js.map +1 -0
- package/dist/chunk-QJIB36DM.js +249 -0
- package/dist/chunk-QJIB36DM.js.map +1 -0
- package/dist/{chunk-TPF4MOMF.js → chunk-R7FKGFW6.js} +7 -4
- package/dist/chunk-R7FKGFW6.js.map +1 -0
- package/dist/{chunk-ZGAOMRYD.js → chunk-RWWRTURA.js} +3 -3
- package/dist/{chunk-QDNI54ON.js → chunk-RYBY35QE.js} +10 -8
- package/dist/chunk-RYBY35QE.js.map +1 -0
- package/dist/chunk-S7F5VKWU.js +453 -0
- package/dist/chunk-S7F5VKWU.js.map +1 -0
- package/dist/chunk-T5W3FDSF.js +396 -0
- package/dist/chunk-T5W3FDSF.js.map +1 -0
- package/dist/{chunk-BTGCUONV.js → chunk-TCXKZDMR.js} +2 -2
- package/dist/{chunk-C36CZRHK.js → chunk-WGPB3QQU.js} +43 -13
- package/dist/chunk-WGPB3QQU.js.map +1 -0
- package/dist/{chunk-G6OVKNL7.js → chunk-XPCU4KUY.js} +5 -4
- package/dist/chunk-XPCU4KUY.js.map +1 -0
- package/dist/chunk-YRYZUYY7.js +236 -0
- package/dist/chunk-YRYZUYY7.js.map +1 -0
- package/dist/{chunk-7BIQ3K6H.js → chunk-ZOTAAYO5.js} +12 -2
- package/dist/chunk-ZOTAAYO5.js.map +1 -0
- package/dist/components/accordion.js +2 -2
- package/dist/components/alert.js +2 -2
- package/dist/components/app-ui.d.ts +28 -12
- package/dist/components/app-ui.js +6 -4
- package/dist/components/blocks.d.ts +28 -2
- package/dist/components/blocks.js +3 -3
- package/dist/components/button.d.ts +7 -0
- package/dist/components/button.js +3 -3
- package/dist/components/changelog.d.ts +386 -0
- package/dist/components/changelog.js +25 -0
- package/dist/components/changelog.js.map +1 -0
- package/dist/components/checkbox-group.js +3 -3
- package/dist/components/checkbox.js +3 -3
- package/dist/components/date-input.js +3 -3
- package/dist/components/dialog.d.ts +15 -0
- package/dist/components/dialog.js +3 -2
- package/dist/components/estimator.d.ts +246 -0
- package/dist/components/estimator.js +16 -0
- package/dist/components/estimator.js.map +1 -0
- package/dist/components/fieldset.js +2 -2
- package/dist/components/grid.js +2 -2
- package/dist/components/help.js +2 -2
- package/dist/components/icon.d.ts +2 -0
- package/dist/components/icon.js +2 -2
- package/dist/components/journey.d.ts +447 -0
- package/dist/components/journey.js +22 -0
- package/dist/components/journey.js.map +1 -0
- package/dist/components/layout.d.ts +24 -0
- package/dist/components/layout.js +2 -2
- package/dist/components/link.js +3 -3
- package/dist/components/list.d.ts +50 -0
- package/dist/components/list.js +8 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/marketing.d.ts +1 -1
- package/dist/components/marketing.js +3 -3
- package/dist/components/media.d.ts +10 -0
- package/dist/components/media.js +2 -2
- package/dist/components/navigation.d.ts +16 -0
- package/dist/components/navigation.js +3 -3
- package/dist/components/organisms.d.ts +13 -1
- package/dist/components/organisms.js +3 -3
- package/dist/components/page.js +2 -2
- package/dist/components/price.d.ts +1 -1
- package/dist/components/price.js +3 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/property.d.ts +1 -1
- package/dist/components/property.js +4 -3
- package/dist/components/radio-group.js +3 -3
- package/dist/components/scene.d.ts +138 -0
- package/dist/components/scene.js +8 -0
- package/dist/components/scene.js.map +1 -0
- package/dist/components/scrubber.d.ts +86 -0
- package/dist/components/scrubber.js +8 -0
- package/dist/components/scrubber.js.map +1 -0
- package/dist/components/select.js +3 -3
- package/dist/components/selling.d.ts +409 -0
- package/dist/components/selling.js +25 -0
- package/dist/components/selling.js.map +1 -0
- package/dist/components/site.d.ts +283 -0
- package/dist/components/site.js +20 -0
- package/dist/components/site.js.map +1 -0
- package/dist/components/summary-list.js +2 -2
- package/dist/components/table.d.ts +94 -2
- package/dist/components/table.js +4 -2
- package/dist/components/text-input.js +3 -3
- package/dist/components/textarea.d.ts +13 -0
- package/dist/components/textarea.js +3 -3
- package/dist/index.d.ts +10 -2
- package/dist/index.js +135 -55
- package/dist/standalone/atomic-ui.js +3134 -0
- package/dist/standalone/atomic-ui.js.map +7 -0
- package/dist/standalone/index.html +174 -0
- package/package.json +26 -7
- package/scripts/copy-to-product.mjs +52 -0
- package/specimen/index.html +174 -0
- package/dist/chunk-2YQA3VBY.js.map +0 -1
- package/dist/chunk-4HU4Y23Q.js.map +0 -1
- package/dist/chunk-6ICOJPMD.js.map +0 -1
- package/dist/chunk-7BIQ3K6H.js.map +0 -1
- package/dist/chunk-7Y6UCSUS.js.map +0 -1
- package/dist/chunk-C36CZRHK.js.map +0 -1
- package/dist/chunk-CMAU4DSB.js.map +0 -1
- package/dist/chunk-G6OVKNL7.js.map +0 -1
- package/dist/chunk-GO2IBRFP.js.map +0 -1
- package/dist/chunk-MLVUMCQ2.js.map +0 -1
- package/dist/chunk-MOEMFL4K.js.map +0 -1
- package/dist/chunk-NTNXHLTM.js.map +0 -1
- package/dist/chunk-QCNT7D5V.js.map +0 -1
- package/dist/chunk-QDNI54ON.js.map +0 -1
- package/dist/chunk-T6L3USBZ.js.map +0 -1
- package/dist/chunk-TPF4MOMF.js.map +0 -1
- package/dist/chunk-VTFCTWSX.js.map +0 -1
- package/dist/chunk-VWNBB7FW.js +0 -104
- package/dist/chunk-VWNBB7FW.js.map +0 -1
- package/dist/chunk-WECSVHIM.js.map +0 -1
- package/dist/chunk-X7IPZPTG.js.map +0 -1
- package/dist/chunk-XJP45LFA.js.map +0 -1
- package/dist/chunk-ZBLTU67D.js.map +0 -1
- package/dist/chunk-ZQJD4YEJ.js.map +0 -1
- /package/dist/{chunk-5EA4IDUD.js.map → chunk-46BYUQ5A.js.map} +0 -0
- /package/dist/{chunk-XVKEM5JY.js.map → chunk-5QSTXIPG.js.map} +0 -0
- /package/dist/{chunk-GSCVG2ER.js.map → chunk-APJ5JGRW.js.map} +0 -0
- /package/dist/{chunk-NQKYHILD.js.map → chunk-DAH7RLW3.js.map} +0 -0
- /package/dist/{chunk-OB7LC6NJ.js.map → chunk-DJEZW7AC.js.map} +0 -0
- /package/dist/{chunk-HWWA27DN.js.map → chunk-KMCGX76Y.js.map} +0 -0
- /package/dist/{chunk-ZGAOMRYD.js.map → chunk-RWWRTURA.js.map} +0 -0
- /package/dist/{chunk-BTGCUONV.js.map → chunk-TCXKZDMR.js.map} +0 -0
package/README.md
CHANGED
|
@@ -2,158 +2,145 @@
|
|
|
2
2
|
|
|
3
3
|
Standard custom elements, styled only from design tokens, built to WCAG 2.2 AA.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
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)).
|
|
6
|
+
|
|
7
|
+
## How each kind of product uses it
|
|
8
|
+
|
|
9
|
+
### A plain HTML product
|
|
10
|
+
|
|
11
|
+
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
12
|
|
|
10
13
|
```html
|
|
11
|
-
<link rel="stylesheet" href="
|
|
12
|
-
<script type="module"
|
|
14
|
+
<link rel="stylesheet" href="/theme.css">
|
|
15
|
+
<script type="module" src="/atomic-ui.js"></script>
|
|
13
16
|
|
|
14
17
|
<impkt-text-input label="Postcode" description="As on your statement" autocomplete="postal-code"></impkt-text-input>
|
|
15
|
-
<impkt-
|
|
18
|
+
<impkt-table caption="Open cases" stack columns='[{"key":"ref","label":"Reference","sortable":true}]' rows='[{"ref":"HB-1042"}]'></impkt-table>
|
|
19
|
+
<impkt-button variant="primary">Save and continue</impkt-button>
|
|
16
20
|
```
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
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.3.0 it is about 300 KB, or 72 KB gzipped.
|
|
23
|
+
|
|
24
|
+
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 impkt-ui-copy . public`.
|
|
25
|
+
|
|
26
|
+
`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.
|
|
27
|
+
|
|
28
|
+
The product theme gives the components the products' colours in light and in dark. Without it, a page loads the tokens itself, as below.
|
|
29
|
+
|
|
30
|
+
### A React, Vue or Angular app
|
|
31
|
+
|
|
32
|
+
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
33
|
|
|
20
34
|
```tsx
|
|
21
35
|
<TextInput label="Postcode" autocomplete="postal-code" onChange={(e) => set(e.detail.value)} />
|
|
22
|
-
<
|
|
36
|
+
<Table caption="Open cases" columns={columns} rows={rows} stack onSort={(e) => sortBy(e.detail)} />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
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.
|
|
40
|
+
|
|
41
|
+
### The tokens
|
|
42
|
+
|
|
43
|
+
Every component reads `--impkt-*` custom properties. The product theme sets them, or an app writes them for its own brand with `@atomic-ui/design-tokens`:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { BrandInputsSchema, deriveTokens, toStylesheet } from '@atomic-ui/design-tokens';
|
|
47
|
+
|
|
48
|
+
const brand = BrandInputsSchema.parse(myBrandInputs);
|
|
49
|
+
const style = document.createElement('style');
|
|
50
|
+
style.textContent = toStylesheet(deriveTokens(brand), { fonts: brand.font.webFonts });
|
|
51
|
+
document.head.append(style);
|
|
23
52
|
```
|
|
24
53
|
|
|
25
54
|
## What is here
|
|
26
55
|
|
|
27
|
-
|
|
56
|
+
Eighty-nine elements.
|
|
28
57
|
|
|
29
58
|
| Group | Elements |
|
|
30
59
|
| --- | --- |
|
|
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` |
|
|
60
|
+
| The page frame | `impkt-page`, `impkt-section`, `impkt-site-header`, `impkt-site-footer`, `impkt-wordmark` |
|
|
61
|
+
| Layout and type | `impkt-grid`, `impkt-stack`, `impkt-card`, `impkt-heading`, `impkt-text`, `impkt-list`, `impkt-divider`, `impkt-spacer`, `impkt-visually-hidden` |
|
|
62
|
+
| Navigation and actions | `impkt-nav`, `impkt-breadcrumbs`, `impkt-button`, `impkt-link`, `impkt-chip`, `impkt-search-bar` |
|
|
63
|
+
| Marketing blocks | `impkt-hero`, `impkt-feature-list`, `impkt-card-grid`, `impkt-quote`, `impkt-stat`, `impkt-badge`, `impkt-announcement` |
|
|
64
|
+
| Organisms | `impkt-carousel`, `impkt-gallery`, `impkt-logo-cloud`, `impkt-steps`, `impkt-media-split`, `impkt-cta-banner`, `impkt-reviews`, `impkt-newsletter`, `impkt-scene`, `impkt-scrubber` |
|
|
36
65
|
| App | `impkt-drawer`, `impkt-toast`, `impkt-menu`, `impkt-pagination`, `impkt-avatar`, `impkt-avatar-group`, `impkt-empty-state`, `impkt-slot-picker` |
|
|
37
66
|
| Property | `impkt-site-plan`, `impkt-mortgage-calculator`, `impkt-before-after`, `impkt-sticky-bar`, `impkt-location-card` |
|
|
67
|
+
| Journeys | `impkt-address-lookup`, `impkt-error-summary`, `impkt-file-upload`, `impkt-money-input`, `impkt-range-input`, `impkt-task-list`, `impkt-estimator` |
|
|
68
|
+
| Selling | `impkt-plan-comparison`, `impkt-video`, `impkt-regulatory-notice`, `impkt-stamp-duty-calculator`, `impkt-affordability-calculator`, `impkt-contact-block` |
|
|
38
69
|
| Form controls | `impkt-text-input`, `impkt-textarea`, `impkt-select`, `impkt-checkbox`, `impkt-checkbox-group`, `impkt-radio-group`, `impkt-date-input`, `impkt-fieldset` |
|
|
39
|
-
| Feedback | `impkt-alert`, `impkt-dialog` |
|
|
70
|
+
| Feedback | `impkt-alert`, `impkt-dialog`, `impkt-help` |
|
|
40
71
|
| Content | `impkt-summary-list`, `impkt-table`, `impkt-accordion`, `impkt-tabs`, `impkt-progress`, `impkt-price` |
|
|
41
72
|
| Media | `impkt-image`, `impkt-logo`, `impkt-icon`, `impkt-document-link` |
|
|
73
|
+
| Changelog | `impkt-release-card`, `impkt-release-list`, `impkt-branch-list`, `impkt-check-list`, `impkt-branch-timeline` |
|
|
42
74
|
|
|
43
|
-
**A layout puts `impkt-page` at its root.** It gives a page the brand's page width
|
|
44
|
-
(`layout.page-width`), its side margins on a phone, tablet and desktop
|
|
45
|
-
(`layout.margin.*`), the header, main and footer landmarks, and a Skip to content link.
|
|
46
|
-
Without it a page runs edge to edge. `impkt-section` is a band across the whole width
|
|
47
|
-
of the screen with the content kept to the page width inside it.
|
|
75
|
+
**A layout puts `impkt-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. `impkt-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.
|
|
48
76
|
|
|
49
77
|
**Everything sits on one set of scales,** derived from the brand:
|
|
50
78
|
|
|
51
79
|
- **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.
|
|
52
|
-
- **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.
|
|
80
|
+
- **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.
|
|
53
81
|
- **Radii** from `xs` to `3xl` in steps of the brand's base, and **shadows** from `xs` to `xl`, tinted with the text colour.
|
|
54
82
|
- **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).
|
|
55
83
|
|
|
56
|
-
Controls share sizes: a button and a field are both 40px tall at the default size, 32px small and 48px large.
|
|
84
|
+
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.
|
|
57
85
|
|
|
58
|
-
**Icons come from one set**, `ICONS`, drawn on a 24 by 24 grid in the current text
|
|
59
|
-
colour, so every icon matches the line weight of the ones beside it. An icon is
|
|
60
|
-
decorative unless it is given a `label`.
|
|
86
|
+
**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`.
|
|
61
87
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
88
|
+
## The app components
|
|
89
|
+
|
|
90
|
+
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.
|
|
91
|
+
|
|
92
|
+
- **`impkt-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 `impkt-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 `impkt-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.
|
|
93
|
+
- **`impkt-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.
|
|
94
|
+
- **`impkt-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.
|
|
95
|
+
- **`impkt-dialog`** and **`impkt-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`.
|
|
96
|
+
- **`impkt-menu`**, **`impkt-pagination`**, **`impkt-file-upload`**, **`impkt-error-summary`**, **`impkt-date-input`** and **`impkt-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.
|
|
67
97
|
|
|
68
98
|
## The decisions worth knowing
|
|
69
99
|
|
|
70
|
-
**Nothing names a colour.** Components read `var(--impkt-*)` with a fallback, so a brand
|
|
71
|
-
is a content publish rather than a rebuild, and a missing token stylesheet is an
|
|
72
|
-
annoyance rather than a blank page.
|
|
100
|
+
**Nothing names a colour.** Components read `var(--impkt-*)` 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.
|
|
73
101
|
|
|
74
|
-
**The focus ring and the minimum target size are locked tokens.** A brand cannot reach
|
|
75
|
-
them. The ring is two-tone — light inside dark — so it stays visible on any surface a
|
|
76
|
-
partner can produce, and it carries a transparent `outline` behind the `box-shadow`
|
|
77
|
-
because Windows High Contrast Mode drops shadows entirely.
|
|
102
|
+
**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.
|
|
78
103
|
|
|
79
|
-
**A busy button is not a disabled button.** `disabled` removes an element from the tab
|
|
80
|
-
order, so a keyboard user who just pressed it is thrown to the top of the document at
|
|
81
|
-
the moment something starts happening. Busy keeps focus, reports `aria-disabled` and
|
|
82
|
-
`aria-busy`, and blocks activation in the handler.
|
|
104
|
+
**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.
|
|
83
105
|
|
|
84
|
-
**The error live region exists before there is an error.** A region inserted together
|
|
85
|
-
with its content is announced inconsistently, and the inconsistency is per screen
|
|
86
|
-
reader — so it passes local testing and fails for users.
|
|
106
|
+
**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.
|
|
87
107
|
|
|
88
|
-
**`aria-describedby` never crosses a shadow boundary**, which is why a field renders its
|
|
89
|
-
own label, description, control and error in one shadow root rather than slotting the
|
|
90
|
-
input from outside.
|
|
108
|
+
**`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.
|
|
91
109
|
|
|
92
|
-
**Native elements wherever one exists.** The radio group is the clearest case: a set of
|
|
93
|
-
`<input type="radio">` sharing a name already has roving tabindex, arrow keys that wrap,
|
|
94
|
-
Home and End, and the right announcement everywhere. Reimplementing that is the most
|
|
95
|
-
commonly attempted and most commonly botched widget in any design system.
|
|
110
|
+
**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.
|
|
96
111
|
|
|
97
112
|
## What the tests actually check
|
|
98
113
|
|
|
99
114
|
Two suites, split by what each can honestly measure.
|
|
100
115
|
|
|
101
|
-
**`pnpm --filter @atomic-ui/ui test`** runs in happy-dom, which has no layout engine. It
|
|
102
|
-
checks what breaks in practice — roles, accessible names, the `describedby`
|
|
103
|
-
relationships resolved to the text a screen reader would read, keyboard behaviour, form
|
|
104
|
-
association — and axe is restricted to the rules that mean anything without layout.
|
|
105
|
-
Running the full rule set here would report passes for colour-contrast and target-size
|
|
106
|
-
that axe never evaluated.
|
|
116
|
+
**`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.
|
|
107
117
|
|
|
108
|
-
**`pnpm --filter @atomic-ui/ui test:browser`** runs the real library in Chromium
|
|
109
|
-
with esbuild and styled by the real token stylesheet. It answers everything the first
|
|
110
|
-
suite cannot:
|
|
118
|
+
**`pnpm --filter @atomic-ui/ui test:browser`** runs the real library in Chromium. It answers everything the first suite cannot:
|
|
111
119
|
|
|
112
120
|
- the **full** axe rule set, colour contrast and target size included
|
|
113
|
-
- every interactive element at 24
|
|
114
|
-
|
|
115
|
-
- no sideways scrolling at 320px (1.4.10 — which is also 1280px at 400% zoom)
|
|
121
|
+
- 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
|
|
122
|
+
- no sideways scrolling at 320px (1.4.10, which is also 1280px at 400% zoom)
|
|
116
123
|
- nothing clipped under the text-spacing overrides (1.4.12)
|
|
117
124
|
- a focus ring that renders, and a boundary that survives forced-colours mode
|
|
118
|
-
- the dialog actually being modal: `:modal` matches, Escape closes it, focus returns
|
|
119
|
-
|
|
125
|
+
- the dialog actually being modal: `:modal` matches, Escape closes it, focus returns to the opener, and a non-dismissible dialog refuses Escape
|
|
126
|
+
|
|
127
|
+
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.
|
|
120
128
|
|
|
121
129
|
Between the two, no criterion is reported as passing without being evaluated.
|
|
122
130
|
|
|
123
131
|
## The manifest
|
|
124
132
|
|
|
125
|
-
`pnpm --filter @atomic-ui/ui manifest`
|
|
126
|
-
the CMS palette is ultimately generated from. It is checked in so the conversion is
|
|
127
|
-
runnable from a fresh clone; the artefact actually *reviewed* is
|
|
128
|
-
[@atomic-ui/ui-manifest](../ui-manifest/README.md)'s `manifest.json`, which is small
|
|
129
|
-
enough to read as a diff.
|
|
133
|
+
`pnpm --filter @atomic-ui/ui manifest` writes `custom-elements.json`, and the package build runs it too. It is the source the CMS palette is generated from, 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.
|
|
130
134
|
|
|
131
|
-
Two tags the Custom Elements Manifest spec has no place for
|
|
132
|
-
are captured by a plugin in `custom-elements-manifest.config.mjs`, so they live on the
|
|
133
|
-
component rather than in a lookup table somewhere else.
|
|
135
|
+
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.
|
|
134
136
|
|
|
135
137
|
## Not here yet
|
|
136
138
|
|
|
137
139
|
Stated plainly, because a component library that looks finished is how gaps ship.
|
|
138
140
|
|
|
139
|
-
- **No manual audit.** Automated checking catches perhaps a third of real issues and
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
forced colours — so they are worth adding before launch.
|
|
146
|
-
- **Server rendering is untested.** Declarative Shadow DOM works, the framework
|
|
147
|
-
integrations are uneven, and an SSR'd page can show unstyled content until hydration.
|
|
148
|
-
Behind a form this is tolerable; a marketing page would feel it.
|
|
149
|
-
- **Composition-level criteria are deliberately elsewhere.** Consistent help (3.2.6),
|
|
150
|
-
redundant entry (3.3.7) and heading order across a page are properties of a page or a
|
|
151
|
-
journey, not of a component — they are checked in Strata at publish
|
|
152
|
-
([ADR 0009](../../docs/decisions/0009-wcag-is-an-authoring-gate.md)). The browser
|
|
153
|
-
suite found a heading-order failure in its own gallery, which is a fair illustration:
|
|
154
|
-
every component was correct and the page was still wrong.
|
|
155
|
-
|
|
156
|
-
The Grid component supplies one to four columns or either sidebar arrangement. Each
|
|
157
|
-
column has a named slot. It stacks below 40rem of available container width, preserving
|
|
158
|
-
column order. The designer offers these as draggable layout presets and prevents
|
|
159
|
-
removing an occupied column.
|
|
141
|
+
- **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.
|
|
142
|
+
- **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.
|
|
143
|
+
- **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.
|
|
144
|
+
- **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.
|
|
145
|
+
|
|
146
|
+
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.
|