@atomic-ui/blocks 0.0.0-stage → 0.6.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 (61) hide show
  1. package/README.md +77 -2
  2. package/custom-elements.json +8688 -0
  3. package/dist/chunk-4JW2CHWS.js +708 -0
  4. package/dist/chunk-4JW2CHWS.js.map +1 -0
  5. package/dist/chunk-AFN7IAG2.js +379 -0
  6. package/dist/chunk-AFN7IAG2.js.map +1 -0
  7. package/dist/chunk-F4BTXUYP.js +65 -0
  8. package/dist/chunk-F4BTXUYP.js.map +1 -0
  9. package/dist/chunk-MYTYMOH6.js +193 -0
  10. package/dist/chunk-MYTYMOH6.js.map +1 -0
  11. package/dist/chunk-OTOFULMT.js +465 -0
  12. package/dist/chunk-OTOFULMT.js.map +1 -0
  13. package/dist/chunk-PORKVHAX.js +255 -0
  14. package/dist/chunk-PORKVHAX.js.map +1 -0
  15. package/dist/chunk-T7U4OPTW.js +413 -0
  16. package/dist/chunk-T7U4OPTW.js.map +1 -0
  17. package/dist/chunk-WHENVU5E.js +318 -0
  18. package/dist/chunk-WHENVU5E.js.map +1 -0
  19. package/dist/chunk-XHFUTZGU.js +228 -0
  20. package/dist/chunk-XHFUTZGU.js.map +1 -0
  21. package/dist/chunk-XJMKAK2I.js +442 -0
  22. package/dist/chunk-XJMKAK2I.js.map +1 -0
  23. package/dist/components/card-grid.d.ts +72 -0
  24. package/dist/components/card-grid.js +7 -0
  25. package/dist/components/card-grid.js.map +1 -0
  26. package/dist/components/changelog.d.ts +373 -0
  27. package/dist/components/changelog.js +16 -0
  28. package/dist/components/changelog.js.map +1 -0
  29. package/dist/components/estimator.d.ts +246 -0
  30. package/dist/components/estimator.js +11 -0
  31. package/dist/components/estimator.js.map +1 -0
  32. package/dist/components/marketing.d.ts +342 -0
  33. package/dist/components/marketing.js +17 -0
  34. package/dist/components/marketing.js.map +1 -0
  35. package/dist/components/organisms.d.ts +559 -0
  36. package/dist/components/organisms.js +23 -0
  37. package/dist/components/organisms.js.map +1 -0
  38. package/dist/components/property.d.ts +389 -0
  39. package/dist/components/property.js +17 -0
  40. package/dist/components/property.js.map +1 -0
  41. package/dist/components/scene.d.ts +138 -0
  42. package/dist/components/scene.js +7 -0
  43. package/dist/components/scene.js.map +1 -0
  44. package/dist/components/scrubber.d.ts +86 -0
  45. package/dist/components/scrubber.js +7 -0
  46. package/dist/components/scrubber.js.map +1 -0
  47. package/dist/components/selling.d.ts +409 -0
  48. package/dist/components/selling.js +23 -0
  49. package/dist/components/selling.js.map +1 -0
  50. package/dist/components/site.d.ts +235 -0
  51. package/dist/components/site.js +11 -0
  52. package/dist/components/site.js.map +1 -0
  53. package/dist/index.d.ts +21 -0
  54. package/dist/index.js +114 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/standalone/atomic-ui-blocks.js +1229 -0
  57. package/dist/standalone/atomic-ui-blocks.js.map +7 -0
  58. package/dist/standalone/index.html +78 -0
  59. package/package.json +64 -3
  60. package/scripts/copy-to-product.mjs +59 -0
  61. package/specimen/index.html +78 -0
@@ -0,0 +1,78 @@
1
+ <!doctype html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Impakt blocks in a plain HTML product</title>
7
+ <!--
8
+ A plain HTML product needs three files beside this page: theme.css from
9
+ @atomic-ui/theme (pnpm theme:copy), atomic-ui.js from @atomic-ui/ui
10
+ (pnpm ui:copy) and atomic-ui-blocks.js from @atomic-ui/blocks
11
+ (pnpm blocks:copy). atomic-ui.js defines the product components and carries
12
+ Lit; atomic-ui-blocks.js imports both from it and defines the blocks, so it
13
+ is loaded second, from the same folder.
14
+ -->
15
+ <link rel="stylesheet" href="theme.css">
16
+ <script type="module" src="atomic-ui.js"></script>
17
+ <script type="module" src="atomic-ui-blocks.js"></script>
18
+ <style>
19
+ main { max-width: 1040px; margin: 0 auto; padding: var(--ik-space-6) var(--ik-gutter) var(--ik-space-12); }
20
+ section { margin-bottom: var(--ik-space-8); }
21
+ .lede { color: var(--ik-ink-muted); max-width: 60ch; margin: 0 0 var(--ik-space-6); }
22
+ .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ik-space-4); }
23
+ @media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
24
+ </style>
25
+ </head>
26
+ <body>
27
+ <a class="ik-skip" href="#main">Skip to the content</a>
28
+ <header>
29
+ <impakt-site-header id="site-header" brand="Larkfield" action-text="Book a visit" action-href="#visit" links='[{"label":"Homes","href":"#homes"},{"label":"Buying","href":"#buying"},{"label":"Contact","href":"#contact"}]'></impakt-site-header>
30
+ </header>
31
+ <main id="main" class="ik-main">
32
+ <h1>Impakt blocks</h1>
33
+ <p class="lede">the section blocks Impakt sites are built from, on a plain HTML page with the product theme, the components file and the blocks file.</p>
34
+
35
+ <section aria-labelledby="h-hero">
36
+ <h2 id="h-hero">A hero</h2>
37
+ <impakt-hero eyebrow="Larkfield Meadows" heading="Homes made for the way you live" level="2" lead="Two, three and four bedroom homes beside twelve acres of parkland.">
38
+ <impakt-button slot="actions" variant="primary" href="#homes">See the homes</impakt-button>
39
+ </impakt-hero>
40
+ </section>
41
+
42
+ <section aria-labelledby="h-steps" class="grid2">
43
+ <div class="card">
44
+ <h2 id="h-steps">Steps</h2>
45
+ <impakt-steps orientation="vertical" heading-level="3" items='[{"heading":"Shipped","text":"Left Yokohama on 3 November.","meta":"Done"},{"heading":"At sea","text":"About five weeks."},{"heading":"Customs","text":"We clear it for you."}]'></impakt-steps>
46
+ </div>
47
+ <div class="card">
48
+ <h2>A stat and a quote</h2>
49
+ <impakt-stat figure="36" label="years" note="Building in Kent since 1987"></impakt-stat>
50
+ <impakt-quote quote="The house was ready the day they said it would be." person="Amira Hassan" about="Bought in 2025"></impakt-quote>
51
+ </div>
52
+ </section>
53
+
54
+ <section aria-labelledby="h-cards">
55
+ <h2 id="h-cards">Cards</h2>
56
+ <impakt-card-grid columns="two" items='[{"heading":"Larkfield Meadows","text":"Family homes near Ashford.","href":"#meadows","badge":"Selling now"},{"heading":"Larkfield Quay","text":"Flats by the water.","href":"#quay"}]'></impakt-card-grid>
57
+ </section>
58
+
59
+ <section aria-labelledby="h-money">
60
+ <h2 id="h-money">What it would cost</h2>
61
+ <div class="grid2">
62
+ <impakt-mortgage-calculator price="385000" deposit-percent="10" rate="4.5" years="30" heading-level="3"></impakt-mortgage-calculator>
63
+ <impakt-stamp-duty-calculator price="385000" buyer="first-time" heading-level="3"></impakt-stamp-duty-calculator>
64
+ </div>
65
+ </section>
66
+
67
+ <section aria-labelledby="h-visit">
68
+ <h2 id="h-visit">A call to action</h2>
69
+ <impakt-cta-banner id="visit" heading="Come and see the show home" lead="Open every day from 10am to 5pm." heading-level="3">
70
+ <impakt-button slot="actions" href="#contact" variant="secondary">Plan your visit</impakt-button>
71
+ </impakt-cta-banner>
72
+ </section>
73
+ </main>
74
+ <footer>
75
+ <impakt-site-footer brand="Larkfield" legal="© 2026 Larkfield Homes." columns='[{"heading":"Homes","links":[{"label":"Meadows","href":"#meadows"}]},{"heading":"Company","links":[{"label":"About","href":"#about"},{"label":"Contact","href":"#contact"}]}]'></impakt-site-footer>
76
+ </footer>
77
+ </body>
78
+ </html>
package/package.json CHANGED
@@ -1,6 +1,67 @@
1
1
  {
2
2
  "name": "@atomic-ui/blocks",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.6.0",
4
+ "description": "The section blocks Impakt sites are built from: marketing blocks, property and selling tools, the site frame and the changelog blocks, as standard custom elements built on @atomic-ui/ui to WCAG 2.2 AA.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/matthill8286/impkt-design-system.git",
8
+ "directory": "packages/blocks"
9
+ },
10
+ "type": "module",
11
+ "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js"
17
+ },
18
+ "./components/*": {
19
+ "types": "./dist/components/*.d.ts",
20
+ "import": "./dist/components/*.js"
21
+ },
22
+ "./standalone": {
23
+ "types": "./dist/index.d.ts",
24
+ "default": "./dist/standalone/atomic-ui-blocks.js"
25
+ },
26
+ "./custom-elements.json": "./custom-elements.json",
27
+ "./package.json": "./package.json"
28
+ },
29
+ "bin": {
30
+ "impakt-blocks-copy": "./scripts/copy-to-product.mjs"
31
+ },
32
+ "dependencies": {
33
+ "lit": "^3.3.3",
34
+ "@atomic-ui/ui": "^0.6.0"
35
+ },
36
+ "devDependencies": {
37
+ "@types/node": "^20.14.0",
38
+ "axe-core": "^4.14.0",
39
+ "happy-dom": "^21.0.4",
40
+ "typescript": "^5.5.0",
41
+ "vitest": "^2.0.0",
42
+ "@playwright/test": "^1.46.0",
43
+ "esbuild": "^0.21.5",
44
+ "@custom-elements-manifest/analyzer": "^0.11.0",
45
+ "@atomic-ui/design-tokens": "^0.6.0"
46
+ },
47
+ "customElements": "custom-elements.json",
48
+ "files": [
49
+ "dist",
50
+ "README.md",
51
+ "custom-elements.json",
52
+ "scripts/copy-to-product.mjs",
53
+ "specimen"
54
+ ],
55
+ "publishConfig": {
56
+ "registry": "https://registry.npmjs.org",
57
+ "access": "public"
58
+ },
59
+ "scripts": {
60
+ "build": "custom-elements-manifest analyze && tsc -p tsconfig.json",
61
+ "typecheck": "tsc -p tsconfig.json",
62
+ "test": "vitest run",
63
+ "test:browser": "playwright test",
64
+ "manifest": "custom-elements-manifest analyze",
65
+ "standalone": "node scripts/standalone.mjs"
66
+ }
6
67
  }
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Copy the standalone blocks file into a plain HTML product.
4
+ *
5
+ * pnpm blocks:copy ../impkt-tender
6
+ * node packages/blocks/scripts/copy-to-product.mjs /path/to/product [public folder]
7
+ *
8
+ * Copies dist/standalone/atomic-ui-blocks.js and its source map into the product's public
9
+ * folder, which is `public` unless a second argument names another. The first line
10
+ * of the copy names the version and the design system's commit, so anyone can see
11
+ * which blocks a product carries. It replaces the build's own first line rather
12
+ * than adding one, so the source map still lines up. Build first with `pnpm build`.
13
+ *
14
+ * The blocks file imports @atomic-ui/ui and Lit from `atomic-ui.js` beside it, so
15
+ * the product also copies that, with `pnpm ui:copy`, into the same folder. This
16
+ * warns when it is not there.
17
+ */
18
+ import { execFileSync } from 'node:child_process';
19
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
20
+ import { basename, dirname, join, resolve } from 'node:path';
21
+ import { fileURLToPath } from 'node:url';
22
+
23
+ const root = join(dirname(fileURLToPath(import.meta.url)), '..');
24
+ const [product, folder = 'public'] = process.argv.slice(2);
25
+ if (!product) {
26
+ console.error('Use: copy-to-product.mjs <product folder> [public folder]');
27
+ process.exit(1);
28
+ }
29
+
30
+ const built = join(root, 'dist', 'standalone', 'atomic-ui-blocks.js');
31
+ if (!existsSync(built)) {
32
+ console.error('There is no dist/standalone/atomic-ui-blocks.js. Run pnpm build first.');
33
+ process.exit(1);
34
+ }
35
+
36
+ const { version } = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));
37
+ // The commit is the design system's own, so it is read only in a checkout of it, not in an installed package.
38
+ const inRepository = basename(dirname(root)) === 'packages' && existsSync(join(root, '..', '..', 'pnpm-workspace.yaml'));
39
+ let commit = inRepository ? 'uncommitted' : 'as published';
40
+ if (inRepository) try {
41
+ commit = execFileSync('git', ['rev-parse', '--short', 'HEAD'], { cwd: root, encoding: 'utf8' }).trim();
42
+ const dirty = execFileSync('git', ['status', '--porcelain', '--', '.'], { cwd: root, encoding: 'utf8' }).trim();
43
+ if (dirty) commit += ' with uncommitted changes';
44
+ } catch {
45
+ // git is not installed: the version is enough.
46
+ }
47
+
48
+ // pnpm runs a root script from the repository root, so a relative path is read from where it was typed.
49
+ const target = resolve(process.env.INIT_CWD ?? process.cwd(), product, folder);
50
+ if (!existsSync(target)) mkdirSync(target, { recursive: true });
51
+ const source = readFileSync(built, 'utf8');
52
+ const rest = source.slice(source.indexOf('\n') + 1);
53
+ const first = `/* Copied from matthill8286/impkt-design-system, @atomic-ui/blocks version ${version}, commit ${commit}. Load atomic-ui.js from @atomic-ui/ui first, from the same folder. To update, build the design system and run pnpm ui:copy and pnpm blocks:copy again. */\n`;
54
+ writeFileSync(join(target, 'atomic-ui-blocks.js'), first + rest);
55
+ writeFileSync(join(target, 'atomic-ui-blocks.js.map'), readFileSync(`${built}.map`));
56
+ if (!existsSync(join(target, 'atomic-ui.js'))) {
57
+ console.warn(`There is no atomic-ui.js in ${target}. The blocks import @atomic-ui/ui from it, so run pnpm ui:copy with the same folder too.`);
58
+ }
59
+ console.log(`copied @atomic-ui/blocks ${version} (${commit}) to ${join(target, 'atomic-ui-blocks.js')} and its source map`);
@@ -0,0 +1,78 @@
1
+ <!doctype html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Impakt blocks in a plain HTML product</title>
7
+ <!--
8
+ A plain HTML product needs three files beside this page: theme.css from
9
+ @atomic-ui/theme (pnpm theme:copy), atomic-ui.js from @atomic-ui/ui
10
+ (pnpm ui:copy) and atomic-ui-blocks.js from @atomic-ui/blocks
11
+ (pnpm blocks:copy). atomic-ui.js defines the product components and carries
12
+ Lit; atomic-ui-blocks.js imports both from it and defines the blocks, so it
13
+ is loaded second, from the same folder.
14
+ -->
15
+ <link rel="stylesheet" href="theme.css">
16
+ <script type="module" src="atomic-ui.js"></script>
17
+ <script type="module" src="atomic-ui-blocks.js"></script>
18
+ <style>
19
+ main { max-width: 1040px; margin: 0 auto; padding: var(--ik-space-6) var(--ik-gutter) var(--ik-space-12); }
20
+ section { margin-bottom: var(--ik-space-8); }
21
+ .lede { color: var(--ik-ink-muted); max-width: 60ch; margin: 0 0 var(--ik-space-6); }
22
+ .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ik-space-4); }
23
+ @media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
24
+ </style>
25
+ </head>
26
+ <body>
27
+ <a class="ik-skip" href="#main">Skip to the content</a>
28
+ <header>
29
+ <impakt-site-header id="site-header" brand="Larkfield" action-text="Book a visit" action-href="#visit" links='[{"label":"Homes","href":"#homes"},{"label":"Buying","href":"#buying"},{"label":"Contact","href":"#contact"}]'></impakt-site-header>
30
+ </header>
31
+ <main id="main" class="ik-main">
32
+ <h1>Impakt blocks</h1>
33
+ <p class="lede">the section blocks Impakt sites are built from, on a plain HTML page with the product theme, the components file and the blocks file.</p>
34
+
35
+ <section aria-labelledby="h-hero">
36
+ <h2 id="h-hero">A hero</h2>
37
+ <impakt-hero eyebrow="Larkfield Meadows" heading="Homes made for the way you live" level="2" lead="Two, three and four bedroom homes beside twelve acres of parkland.">
38
+ <impakt-button slot="actions" variant="primary" href="#homes">See the homes</impakt-button>
39
+ </impakt-hero>
40
+ </section>
41
+
42
+ <section aria-labelledby="h-steps" class="grid2">
43
+ <div class="card">
44
+ <h2 id="h-steps">Steps</h2>
45
+ <impakt-steps orientation="vertical" heading-level="3" items='[{"heading":"Shipped","text":"Left Yokohama on 3 November.","meta":"Done"},{"heading":"At sea","text":"About five weeks."},{"heading":"Customs","text":"We clear it for you."}]'></impakt-steps>
46
+ </div>
47
+ <div class="card">
48
+ <h2>A stat and a quote</h2>
49
+ <impakt-stat figure="36" label="years" note="Building in Kent since 1987"></impakt-stat>
50
+ <impakt-quote quote="The house was ready the day they said it would be." person="Amira Hassan" about="Bought in 2025"></impakt-quote>
51
+ </div>
52
+ </section>
53
+
54
+ <section aria-labelledby="h-cards">
55
+ <h2 id="h-cards">Cards</h2>
56
+ <impakt-card-grid columns="two" items='[{"heading":"Larkfield Meadows","text":"Family homes near Ashford.","href":"#meadows","badge":"Selling now"},{"heading":"Larkfield Quay","text":"Flats by the water.","href":"#quay"}]'></impakt-card-grid>
57
+ </section>
58
+
59
+ <section aria-labelledby="h-money">
60
+ <h2 id="h-money">What it would cost</h2>
61
+ <div class="grid2">
62
+ <impakt-mortgage-calculator price="385000" deposit-percent="10" rate="4.5" years="30" heading-level="3"></impakt-mortgage-calculator>
63
+ <impakt-stamp-duty-calculator price="385000" buyer="first-time" heading-level="3"></impakt-stamp-duty-calculator>
64
+ </div>
65
+ </section>
66
+
67
+ <section aria-labelledby="h-visit">
68
+ <h2 id="h-visit">A call to action</h2>
69
+ <impakt-cta-banner id="visit" heading="Come and see the show home" lead="Open every day from 10am to 5pm." heading-level="3">
70
+ <impakt-button slot="actions" href="#contact" variant="secondary">Plan your visit</impakt-button>
71
+ </impakt-cta-banner>
72
+ </section>
73
+ </main>
74
+ <footer>
75
+ <impakt-site-footer brand="Larkfield" legal="© 2026 Larkfield Homes." columns='[{"heading":"Homes","links":[{"label":"Meadows","href":"#meadows"}]},{"heading":"Company","links":[{"label":"About","href":"#about"},{"label":"Contact","href":"#contact"}]}]'></impakt-site-footer>
76
+ </footer>
77
+ </body>
78
+ </html>