@atomic-ui/blocks 0.0.0-stage → 0.7.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 +77 -2
- package/custom-elements.json +8688 -0
- package/dist/chunk-4JW2CHWS.js +708 -0
- package/dist/chunk-4JW2CHWS.js.map +1 -0
- package/dist/chunk-AFN7IAG2.js +379 -0
- package/dist/chunk-AFN7IAG2.js.map +1 -0
- package/dist/chunk-F4BTXUYP.js +65 -0
- package/dist/chunk-F4BTXUYP.js.map +1 -0
- package/dist/chunk-MYTYMOH6.js +193 -0
- package/dist/chunk-MYTYMOH6.js.map +1 -0
- package/dist/chunk-OTOFULMT.js +465 -0
- package/dist/chunk-OTOFULMT.js.map +1 -0
- package/dist/chunk-PORKVHAX.js +255 -0
- package/dist/chunk-PORKVHAX.js.map +1 -0
- package/dist/chunk-T7U4OPTW.js +413 -0
- package/dist/chunk-T7U4OPTW.js.map +1 -0
- package/dist/chunk-WHENVU5E.js +318 -0
- package/dist/chunk-WHENVU5E.js.map +1 -0
- package/dist/chunk-XHFUTZGU.js +228 -0
- package/dist/chunk-XHFUTZGU.js.map +1 -0
- package/dist/chunk-XJMKAK2I.js +442 -0
- package/dist/chunk-XJMKAK2I.js.map +1 -0
- package/dist/components/card-grid.d.ts +72 -0
- package/dist/components/card-grid.js +7 -0
- package/dist/components/card-grid.js.map +1 -0
- package/dist/components/changelog.d.ts +373 -0
- package/dist/components/changelog.js +16 -0
- package/dist/components/changelog.js.map +1 -0
- package/dist/components/estimator.d.ts +246 -0
- package/dist/components/estimator.js +11 -0
- package/dist/components/estimator.js.map +1 -0
- package/dist/components/marketing.d.ts +342 -0
- package/dist/components/marketing.js +17 -0
- package/dist/components/marketing.js.map +1 -0
- package/dist/components/organisms.d.ts +559 -0
- package/dist/components/organisms.js +23 -0
- package/dist/components/organisms.js.map +1 -0
- package/dist/components/property.d.ts +389 -0
- package/dist/components/property.js +17 -0
- package/dist/components/property.js.map +1 -0
- package/dist/components/scene.d.ts +138 -0
- package/dist/components/scene.js +7 -0
- package/dist/components/scene.js.map +1 -0
- package/dist/components/scrubber.d.ts +86 -0
- package/dist/components/scrubber.js +7 -0
- package/dist/components/scrubber.js.map +1 -0
- package/dist/components/selling.d.ts +409 -0
- package/dist/components/selling.js +23 -0
- package/dist/components/selling.js.map +1 -0
- package/dist/components/site.d.ts +235 -0
- package/dist/components/site.js +11 -0
- package/dist/components/site.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +114 -0
- package/dist/index.js.map +1 -0
- package/dist/standalone/atomic-ui-blocks.js +1229 -0
- package/dist/standalone/atomic-ui-blocks.js.map +7 -0
- package/dist/standalone/index.html +78 -0
- package/package.json +64 -3
- package/scripts/copy-to-product.mjs +59 -0
- package/specimen/index.html +78 -0
package/README.md
CHANGED
|
@@ -1,3 +1,78 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @atomic-ui/blocks
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The section blocks Impakt sites are built from: marketing blocks, property and selling tools, the site frame, scenes and the changelog blocks. They are standard custom elements written in Lit, styled only from design tokens and built to WCAG 2.2 AA, exactly as the product components in [`@atomic-ui/ui`](../ui) are.
|
|
4
|
+
|
|
5
|
+
This package builds on `@atomic-ui/ui`. Every block extends its `ImpaktElement` base, reads its tokens and style fragments, and draws its product components inside itself, such as `impakt-button`, `impakt-nav` and `impakt-select`. Importing this package imports `@atomic-ui/ui` first, so those are defined too. It holds no product components of its own. The split was made in 0.5.0; before it, these blocks were part of `@atomic-ui/ui`, under the same tags.
|
|
6
|
+
|
|
7
|
+
## What is here
|
|
8
|
+
|
|
9
|
+
Thirty-seven blocks.
|
|
10
|
+
|
|
11
|
+
| Group | Blocks |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| Marketing | `impakt-hero`, `impakt-feature-list`, `impakt-quote`, `impakt-stat`, `impakt-announcement`, `impakt-search-bar`, `impakt-media-split`, `impakt-cta-banner`, `impakt-reviews`, `impakt-newsletter`, `impakt-carousel`, `impakt-gallery`, `impakt-logo-cloud`, `impakt-steps`, `impakt-card-grid`, `impakt-video`, `impakt-before-after`, `impakt-sticky-bar` |
|
|
14
|
+
| Property and selling | `impakt-site-plan`, `impakt-mortgage-calculator`, `impakt-stamp-duty-calculator`, `impakt-affordability-calculator`, `impakt-plan-comparison`, `impakt-regulatory-notice`, `impakt-contact-block`, `impakt-location-card`, `impakt-estimator` |
|
|
15
|
+
| The site frame and scenes | `impakt-site-header`, `impakt-site-footer`, `impakt-wordmark`, `impakt-scene`, `impakt-scrubber` |
|
|
16
|
+
| Changelog | `impakt-release-card`, `impakt-release-list`, `impakt-branch-list`, `impakt-check-list`, `impakt-branch-timeline` |
|
|
17
|
+
|
|
18
|
+
The page frame itself, `impakt-page` and `impakt-section`, and the parts a block is built from, such as `impakt-chip`, `impakt-badge` and `impakt-tabs`, are product components and stay in `@atomic-ui/ui`.
|
|
19
|
+
|
|
20
|
+
## How each kind of product uses it
|
|
21
|
+
|
|
22
|
+
### A plain HTML product
|
|
23
|
+
|
|
24
|
+
A product with no build step copies two files into its `public` folder beside the product theme: `atomic-ui.js` from `@atomic-ui/ui` and `atomic-ui-blocks.js` from this package. It loads them in that order:
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<link rel="stylesheet" href="/theme.css">
|
|
28
|
+
<script type="module" src="/atomic-ui.js"></script>
|
|
29
|
+
<script type="module" src="/atomic-ui-blocks.js"></script>
|
|
30
|
+
|
|
31
|
+
<impakt-hero heading="Homes made for the way you live" lead="Two, three and four bedroom homes."></impakt-hero>
|
|
32
|
+
<impakt-card-grid items='[{"heading":"Larkfield Meadows","href":"/meadows"}]'></impakt-card-grid>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The file is `dist/standalone/atomic-ui-blocks.js`, also exported as `@atomic-ui/blocks/standalone`. It is one minified ES module that defines every block when it loads, with its source map beside it. It does not bundle `@atomic-ui/ui` or Lit. It imports both from `./atomic-ui.js`, which `@atomic-ui/ui`'s standalone file exports for it, so the two files must sit in the same folder. A page therefore carries one copy of Lit and of the base, and each product component is defined once, by the file that owns it. At 0.5.0 it is about 150 KB, or 35 KB gzipped, on top of `atomic-ui.js`.
|
|
36
|
+
|
|
37
|
+
To copy it, build the design system and run `pnpm blocks:copy ../impkt-tender` at the root, naming the product's folder, beside `pnpm ui:copy` with the same 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. The copy script warns when `atomic-ui.js` is not in the folder. A product that installs this package from npm can run `npx impakt-blocks-copy . public`.
|
|
38
|
+
|
|
39
|
+
`specimen/index.html` is a page that uses the blocks this way, and the build puts it beside the standalone file as `dist/standalone/index.html`. Copy `theme.css`, its `fonts` and `atomic-ui.js` beside it to open it. The browser suite runs it in light and dark, on a phone and on a desktop.
|
|
40
|
+
|
|
41
|
+
### A React or Vue app
|
|
42
|
+
|
|
43
|
+
The app installs this package beside `@atomic-ui/ui` and the bindings for its framework. The bindings are generated from this package's manifest into a separate entry of the existing binding packages, so an app that uses no blocks never loads them:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
pnpm add @atomic-ui/ui @atomic-ui/blocks @atomic-ui/ui-react
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { Button } from '@atomic-ui/ui-react';
|
|
51
|
+
import { Hero, CardGrid, SiteHeader } from '@atomic-ui/ui-react/blocks';
|
|
52
|
+
|
|
53
|
+
<SiteHeader brand="Larkfield" links={links} actionText="Book a visit" onAction={book} />
|
|
54
|
+
<Hero heading="Homes made for the way you live"><Button slot="actions" href="/homes">See the homes</Button></Hero>
|
|
55
|
+
<CardGrid items={developments} />
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
A Vue app imports the components from `@atomic-ui/ui-vue/blocks`, such as `ImpaktHero` and `ImpaktCardGrid`, and can register them all with `app.use(AtomicUIBlocks)`. The `isCustomElement` setting that treats every `impakt-` tag as a custom element covers the blocks too. Importing either entry also types the blocks' tags, for React 19's JSX and for Vue's `GlobalComponents`. `@atomic-ui/blocks` is an optional peer dependency of both binding packages, so it is installed only by an app that uses the blocks.
|
|
59
|
+
|
|
60
|
+
An Angular app imports this package once and writes the tags under `CUSTOM_ELEMENTS_SCHEMA`. The blocks need no value accessors, because the form fields that do are product components.
|
|
61
|
+
|
|
62
|
+
### Strata
|
|
63
|
+
|
|
64
|
+
Strata's CMS builds its component palette from the manifests. It reads `@atomic-ui/ui/custom-elements.json` and `@atomic-ui/blocks/custom-elements.json` together, and its renderer imports both packages, so a page saved against an earlier version, when the blocks were in `@atomic-ui/ui`, still finds every block under the same tag.
|
|
65
|
+
|
|
66
|
+
## The manifest
|
|
67
|
+
|
|
68
|
+
`pnpm --filter @atomic-ui/blocks manifest` writes `custom-elements.json` with the Custom Elements Manifest analyser, set up as `@atomic-ui/ui`'s is, and the package build runs it too. It is checked in and published, as `@atomic-ui/blocks/custom-elements.json`. The React and Vue bindings and the Storybook are generated from it. A test checks that it defines exactly the 37 blocks and none of `@atomic-ui/ui`'s elements, and that the two manifests together still hold everything the 0.2.0 manifest offered.
|
|
69
|
+
|
|
70
|
+
## What the tests check
|
|
71
|
+
|
|
72
|
+
The suites are the ones `@atomic-ui/ui` has, and each block's tests moved here with it.
|
|
73
|
+
|
|
74
|
+
**`pnpm --filter @atomic-ui/blocks test`** runs in happy-dom. It checks roles, accessible names, keyboard behaviour and what each block works out, runs axe with the rules that mean anything without layout, checks that every built-in word goes through the site's wording, and checks that the package and its standalone file bundle, with `@atomic-ui/ui` imported from `atomic-ui.js` rather than bundled.
|
|
75
|
+
|
|
76
|
+
**`pnpm --filter @atomic-ui/blocks test:browser`** runs the real blocks in Chromium with Playwright, at 1280 by 800, at 320 pixels wide and on a 390 by 844 touch screen. With every block on one page it checks the full axe rule set, that every interactive element is at least 24 by 24 (2.5.8), that nothing scrolls sideways at 320 pixels (1.4.10), that no text is clipped under the text-spacing overrides (1.4.12), and that every control the keyboard reaches draws the focus ring (2.4.7). The specimen suite loads the page a plain HTML product gets, in light and dark, and checks the full axe rule set, that the page loads exactly the two standalone files, that the blocks share one base, one Lit and one definition of each product component with `atomic-ui.js`, and the sizes of the steps and the blocks' targets. It needs Playwright's Chromium, which `pnpm --filter @atomic-ui/ui exec playwright install chromium` downloads.
|
|
77
|
+
|
|
78
|
+
The Storybook in `apps/storybook` has stories for every block under its Blocks section, and checks each with axe in light, in dark and at 320 pixels.
|