From d570a351197f93243ef5654a253968723887a8bd Mon Sep 17 00:00:00 2001 From: Whatsaaaa Date: Mon, 16 Nov 2026 12:13:32 +0100 Subject: [PATCH] Move both sample apps to design-system 0.8.0 and drop covered workarounds --- react-checkout/package.json | 2 +- react-checkout/pnpm-lock.yaml | 10 +-- react-checkout/pnpm-workspace.yaml | 2 +- react-checkout/src/styles.css | 52 +++++++------- react-checkout/vite.config.ts | 13 +++- vue-event-registration/package.json | 2 +- vue-event-registration/pnpm-lock.yaml | 10 +-- vue-event-registration/pnpm-workspace.yaml | 2 +- vue-event-registration/src/styles.css | 70 ++++++++----------- vue-event-registration/src/ui/SummaryList.vue | 11 ++- vue-event-registration/vite.config.ts | 13 +++- 11 files changed, 96 insertions(+), 91 deletions(-) diff --git a/react-checkout/package.json b/react-checkout/package.json index ba7efd0..8355187 100644 --- a/react-checkout/package.json +++ b/react-checkout/package.json @@ -17,7 +17,7 @@ "@formisch/react": "^1.2.0", "@hono/node-server": "^2.1.7", "@valibot/i18n": "^1.3.0", - "@whatsaaaa/design-system": "^0.6.1", + "@whatsaaaa/design-system": "^0.8.0", "@whatsaaaa/form-builder-affects": "0.2.2-rc.0", "@whatsaaaa/form-builder-react": "1.0.0-rc.0", "@whatsaaaa/form-builder-schema": "1.0.0-rc.0", diff --git a/react-checkout/pnpm-lock.yaml b/react-checkout/pnpm-lock.yaml index 14484ce..735baee 100644 --- a/react-checkout/pnpm-lock.yaml +++ b/react-checkout/pnpm-lock.yaml @@ -18,8 +18,8 @@ importers: specifier: ^1.3.0 version: 1.3.0(valibot@1.5.0(typescript@7.0.2)) '@whatsaaaa/design-system': - specifier: ^0.6.1 - version: 0.6.1 + specifier: ^0.8.0 + version: 0.8.0 '@whatsaaaa/form-builder-affects': specifier: 0.2.2-rc.0 version: 0.2.2-rc.0(@whatsaaaa/form-builder-schema@1.0.0-rc.0(valibot@1.5.0(typescript@7.0.2)))(valibot@1.5.0(typescript@7.0.2)) @@ -741,8 +741,8 @@ packages: '@vitest/spy@5.1.0': resolution: {integrity: sha512-2DPO5OMHWKrBngC+fCmTQqemNF0gidRhp3lxbBmRhW+M1XJrfgPpqNqWVevXtn2f2ufD5ZaR1B6B641aAlcX5A==} - '@whatsaaaa/design-system@0.6.1': - resolution: {integrity: sha512-Cnf6DJXhR/lq0hHCtgbwTBEYimvgbnZWh/O0mrsGA0ScUM+YHsTWxu58+dMVugFobvwSgvizT7E3ne7TdFlZvA==} + '@whatsaaaa/design-system@0.8.0': + resolution: {integrity: sha512-d2D1z83IraVF0fkYgVgeimad30SS064NChanaLUDnBinZwL20SSS8v0Z8w5sLabEHjzqmwiO6P01qyucmhWgfg==} engines: {node: ^22.18.0 || >=24.12.0} peerDependencies: tailwindcss: ^4.3.5 @@ -1678,7 +1678,7 @@ snapshots: '@vitest/spy@5.1.0': {} - '@whatsaaaa/design-system@0.6.1': + '@whatsaaaa/design-system@0.8.0': dependencies: '@terrazzo/token-types': 2.10.0 diff --git a/react-checkout/pnpm-workspace.yaml b/react-checkout/pnpm-workspace.yaml index 7ebc1d5..78487b0 100644 --- a/react-checkout/pnpm-workspace.yaml +++ b/react-checkout/pnpm-workspace.yaml @@ -4,4 +4,4 @@ minimumReleaseAgeExclude: - '@whatsaaaa/form-builder-schema@1.0.0-rc.0' - '@whatsaaaa/form-builder-react@1.0.0-rc.0' - '@whatsaaaa/form-builder-affects@0.2.2-rc.0' - - '@whatsaaaa/design-system@0.6.1' + - '@whatsaaaa/design-system@0.8.0' diff --git a/react-checkout/src/styles.css b/react-checkout/src/styles.css index 864c39d..24ac4f8 100644 --- a/react-checkout/src/styles.css +++ b/react-checkout/src/styles.css @@ -7,21 +7,11 @@ @import '@whatsaaaa/design-system/index.css'; -:root { - /* - * The space between the window's edge and what is in it: the tab bar's own, so the edges of the - * form line up with the brand on the left and with the links on the right. - */ - --page-gutter: var(--ws-space-20); -} - -@media (width < 64rem) { - :root { - --page-gutter: var(--ws-space-16); - } -} - -/* The window: as tall as the screen, as wide as the form. Its content scrolls inside it. */ +/* + * The window: as tall as the screen, as wide as the form. Its content scrolls inside it. The form + * stands off the window's edge by the tab bar's own padding, so its edges line up with the brand + * on the left and with the links on the right. + */ body { padding: var(--ws-space-20); @@ -29,7 +19,7 @@ body { .page { max-width: calc( - var(--ws-size-content) + 2 * var(--page-gutter) + 2 * + var(--ws-size-content) + 2 * var(--ws-space-20) + 2 * var(--ws-border-width-thin) ); height: calc(100dvh - 2 * var(--ws-space-20)); @@ -41,7 +31,7 @@ body { } .page__content { - padding: var(--ws-space-40) var(--page-gutter) var(--ws-space-48); + padding: var(--ws-space-40) var(--ws-space-20) var(--ws-space-48); } /* On a narrow screen the window grows with the form, and the page scrolls. */ @@ -51,6 +41,10 @@ body { } .page { + max-width: calc( + var(--ws-size-content) + 2 * var(--ws-space-16) + 2 * + var(--ws-border-width-thin) + ); height: auto; min-height: calc(100dvh - 2 * var(--ws-space-12)); } @@ -59,8 +53,9 @@ body { overflow: visible; } + /* The gutter of a phone, where the tab bar starts its brand. */ .page__content { - padding-block: var(--ws-space-24) var(--ws-space-40); + padding: var(--ws-space-24) var(--ws-space-16) var(--ws-space-40); } } @@ -217,11 +212,11 @@ body { .field__error::before { flex: none; - width: var(--ws-space-16); + width: var(--ws-size-icon); height: 1lh; content: ''; background: var(--ws-color-danger); - mask: var(--ws-icon-danger) center / var(--ws-space-16) no-repeat; + mask: var(--ws-icon-danger) center / var(--ws-size-icon) no-repeat; } .input { @@ -323,8 +318,8 @@ body { } .choice__input::before { - width: 1rem; - height: 1rem; + width: var(--ws-size-icon); + height: var(--ws-size-icon); content: ''; background: var(--ws-color-on-interactive); mask: var(--ws-icon-check) center / contain no-repeat; @@ -448,10 +443,17 @@ body { column-gap: var(--ws-space-40); } -@media (width < 64rem) { +/* Fields share a row from 40rem up, and the page's columns from 64rem up. */ +@media (width < 40rem) { .row__cell { grid-column: 1 / -1; } +} + +@media (width < 64rem) { + .row--sections > .row__cell { + grid-column: 1 / -1; + } /* * Stacked, the columns are sections like the others, and are set off from each other the same @@ -555,11 +557,11 @@ body { .notice__title::before, .notice__message::before { flex: none; - width: var(--ws-space-16); + width: var(--ws-size-icon); height: 1lh; content: ''; background: var(--ws-color-tip); - mask: var(--ws-icon-check) center / var(--ws-space-16) no-repeat; + mask: var(--ws-icon-check) center / var(--ws-size-icon) no-repeat; } .notice--error { diff --git a/react-checkout/vite.config.ts b/react-checkout/vite.config.ts index 4a9b504..2ed9e40 100644 --- a/react-checkout/vite.config.ts +++ b/react-checkout/vite.config.ts @@ -1,13 +1,15 @@ import { keysInitScript } from '@whatsaaaa/design-system/shortcuts' import { themeInitScript } from '@whatsaaaa/design-system/theme' +import { themeColorMeta } from '@whatsaaaa/design-system/theme/meta' import react from '@vitejs/plugin-react' import type { Plugin } from 'vite' import { defineConfig } from 'vitest/config' /** - * The design system's head scripts, inline in the before the stylesheet: a remembered - * theme and a remembered "keys off" apply before the first paint. They come from the installed - * package, so they stay in step with it. + * The design system's head tags, in the before the stylesheet: the two theme-color tags, + * so the page as it is sent colors the browser's bars, and the head scripts, inline, so a + * remembered theme and a remembered "keys off" apply before the first paint. They come from the + * installed package, so they stay in step with it. */ function designSystemHead(): Plugin { return { @@ -16,6 +18,11 @@ function designSystemHead(): Plugin { // before Vite adds the stylesheet and the app's script at the end of the order: 'pre', handler: () => [ + ...themeColorMeta.map((attrs) => ({ + tag: 'meta', + attrs: { ...attrs }, + injectTo: 'head' as const, + })), { tag: 'script', children: themeInitScript, injectTo: 'head' }, { tag: 'script', children: keysInitScript, injectTo: 'head' }, ], diff --git a/vue-event-registration/package.json b/vue-event-registration/package.json index ad06806..950be2e 100644 --- a/vue-event-registration/package.json +++ b/vue-event-registration/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@formisch/vue": "^1.2.0", - "@whatsaaaa/design-system": "^0.6.1", + "@whatsaaaa/design-system": "^0.8.0", "@whatsaaaa/form-builder-affects": "0.2.2-rc.0", "@whatsaaaa/form-builder-schema": "1.0.0-rc.0", "@whatsaaaa/form-builder-vue": "1.0.0-rc.0", diff --git a/vue-event-registration/pnpm-lock.yaml b/vue-event-registration/pnpm-lock.yaml index 055e8dc..419e9b2 100644 --- a/vue-event-registration/pnpm-lock.yaml +++ b/vue-event-registration/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^1.2.0 version: 1.2.0(typescript@6.0.3)(valibot@1.5.0(typescript@6.0.3))(vue@3.5.45(typescript@6.0.3)) '@whatsaaaa/design-system': - specifier: ^0.6.1 - version: 0.6.1(vue@3.5.45(typescript@6.0.3)) + specifier: ^0.8.0 + version: 0.8.0(vue@3.5.45(typescript@6.0.3)) '@whatsaaaa/form-builder-affects': specifier: 0.2.2-rc.0 version: 0.2.2-rc.0(@whatsaaaa/form-builder-schema@1.0.0-rc.0(valibot@1.5.0(typescript@6.0.3)))(valibot@1.5.0(typescript@6.0.3)) @@ -530,8 +530,8 @@ packages: vue: optional: true - '@whatsaaaa/design-system@0.6.1': - resolution: {integrity: sha512-Cnf6DJXhR/lq0hHCtgbwTBEYimvgbnZWh/O0mrsGA0ScUM+YHsTWxu58+dMVugFobvwSgvizT7E3ne7TdFlZvA==} + '@whatsaaaa/design-system@0.8.0': + resolution: {integrity: sha512-d2D1z83IraVF0fkYgVgeimad30SS064NChanaLUDnBinZwL20SSS8v0Z8w5sLabEHjzqmwiO6P01qyucmhWgfg==} engines: {node: ^22.18.0 || >=24.12.0} peerDependencies: tailwindcss: ^4.3.5 @@ -1760,7 +1760,7 @@ snapshots: typescript: 6.0.3 vue: 3.5.45(typescript@6.0.3) - '@whatsaaaa/design-system@0.6.1(vue@3.5.45(typescript@6.0.3))': + '@whatsaaaa/design-system@0.8.0(vue@3.5.45(typescript@6.0.3))': dependencies: '@terrazzo/token-types': 2.10.0 optionalDependencies: diff --git a/vue-event-registration/pnpm-workspace.yaml b/vue-event-registration/pnpm-workspace.yaml index 4a9d06c..97bcef2 100644 --- a/vue-event-registration/pnpm-workspace.yaml +++ b/vue-event-registration/pnpm-workspace.yaml @@ -2,4 +2,4 @@ minimumReleaseAgeExclude: - '@whatsaaaa/form-builder-schema@1.0.0-rc.0' - '@whatsaaaa/form-builder-vue@1.0.0-rc.0' - '@whatsaaaa/form-builder-affects@0.2.2-rc.0' - - '@whatsaaaa/design-system@0.6.1' + - '@whatsaaaa/design-system@0.8.0' diff --git a/vue-event-registration/src/styles.css b/vue-event-registration/src/styles.css index a46a541..153a061 100644 --- a/vue-event-registration/src/styles.css +++ b/vue-event-registration/src/styles.css @@ -7,23 +7,11 @@ @import '@whatsaaaa/design-system/index.css'; -:root { - /* - * The space between the window's edge and what is in it: the tab bar's own, so the edges of the - * form line up with the brand on the left and with the links on the right. - */ - --page-gutter: var(--ws-space-20); - /* A calendar for the date picker's button, drawn as a mask like the design system's icons. */ - --icon-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='1.5 1.25 13 13' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='3.5' width='11' height='10' rx='1.5'/%3E%3Cpath d='M2.5 6.5h11M5.5 2v3M10.5 2v3'/%3E%3C/svg%3E"); -} - -@media (width < 64rem) { - :root { - --page-gutter: var(--ws-space-16); - } -} - -/* The window: as tall as the screen, as wide as the form. Its content scrolls inside it. */ +/* + * The window: as tall as the screen, as wide as the form. Its content scrolls inside it. The form + * stands off the window's edge by the tab bar's own padding, so its edges line up with the brand + * on the left and with the links on the right. + */ body { padding: var(--ws-space-20); @@ -31,7 +19,7 @@ body { .page { max-width: calc( - var(--ws-size-content) + 2 * var(--page-gutter) + 2 * + var(--ws-size-content) + 2 * var(--ws-space-20) + 2 * var(--ws-border-width-thin) ); height: calc(100dvh - 2 * var(--ws-space-20)); @@ -43,7 +31,7 @@ body { } .page__content { - padding: var(--ws-space-40) var(--page-gutter) var(--ws-space-48); + padding: var(--ws-space-40) var(--ws-space-20) var(--ws-space-48); } /* On a narrow screen the window grows with the form, and the page scrolls. */ @@ -53,6 +41,10 @@ body { } .page { + max-width: calc( + var(--ws-size-content) + 2 * var(--ws-space-16) + 2 * + var(--ws-border-width-thin) + ); height: auto; min-height: calc(100dvh - 2 * var(--ws-space-12)); } @@ -61,8 +53,9 @@ body { overflow: visible; } + /* The gutter of a phone, where the tab bar starts its brand. */ .page__content { - padding-block: var(--ws-space-24) var(--ws-space-40); + padding: var(--ws-space-24) var(--ws-space-16) var(--ws-space-40); } } @@ -185,8 +178,8 @@ body { } .steps__item--done .steps__number::before { - width: 1rem; - height: 1rem; + width: var(--ws-size-icon); + height: var(--ws-size-icon); content: ''; background: currentColor; mask: var(--ws-icon-check) center / contain no-repeat; @@ -242,11 +235,11 @@ body { .field__error::before { flex: none; - width: var(--ws-space-16); + width: var(--ws-size-icon); height: 1lh; content: ''; background: var(--ws-color-danger); - mask: var(--ws-icon-danger) center / var(--ws-space-16) no-repeat; + mask: var(--ws-icon-danger) center / var(--ws-size-icon) no-repeat; } .input { @@ -270,13 +263,13 @@ body { /* The date picker's button, drawn like the select's arrow: in the system's color, on the field's padding. */ .input::-webkit-calendar-picker-indicator { - width: var(--ws-space-16); - height: var(--ws-space-16); + width: var(--ws-size-icon); + height: var(--ws-size-icon); margin: 0; padding: 0; cursor: pointer; background: var(--ws-color-text-secondary); - mask: var(--icon-calendar) center / contain no-repeat; + mask: var(--ws-icon-calendar) center / contain no-repeat; } .input--multiline { @@ -359,8 +352,8 @@ body { } .choice__input::before { - width: 1rem; - height: 1rem; + width: var(--ws-size-icon); + height: var(--ws-size-icon); content: ''; background: var(--ws-color-on-interactive); mask: var(--ws-icon-check) center / contain no-repeat; @@ -479,7 +472,7 @@ body { min-width: 0; } -@media (width < 64rem) { +@media (width < 40rem) { .row__cell { grid-column: 1 / -1; } @@ -553,13 +546,7 @@ body { text-decoration-thickness: var(--ws-border-width-medium); } -/* Summary */ - -.summary { - display: flex; - flex-direction: column; - gap: var(--ws-space-24); -} +/* Summary: a ws-pairs-group, so its sections share one term column. */ .summary__title { margin-bottom: var(--ws-space-8); @@ -569,6 +556,11 @@ body { text-transform: uppercase; } +/* The group has no gap of its own: a section stands off the one before it by its title's margin. */ +.summary > .ws-pairs + .summary__title { + margin-top: var(--ws-space-24); +} + /* Notices */ .notice { @@ -588,11 +580,11 @@ body { /* The title says what happened, and the icon of its status goes before its first line. */ .notice__title::before { flex: none; - width: var(--ws-space-16); + width: var(--ws-size-icon); height: 1lh; content: ''; background: var(--ws-color-tip); - mask: var(--ws-icon-check) center / var(--ws-space-16) no-repeat; + mask: var(--ws-icon-check) center / var(--ws-size-icon) no-repeat; } .notice--error { diff --git a/vue-event-registration/src/ui/SummaryList.vue b/vue-event-registration/src/ui/SummaryList.vue index 8c3237b..64187ae 100644 --- a/vue-event-registration/src/ui/SummaryList.vue +++ b/vue-event-registration/src/ui/SummaryList.vue @@ -14,12 +14,9 @@ function piecesOf(value: string) { diff --git a/vue-event-registration/vite.config.ts b/vue-event-registration/vite.config.ts index 1c35be6..e7feadc 100644 --- a/vue-event-registration/vite.config.ts +++ b/vue-event-registration/vite.config.ts @@ -1,13 +1,15 @@ import { keysInitScript } from '@whatsaaaa/design-system/shortcuts' import { themeInitScript } from '@whatsaaaa/design-system/theme' +import { themeColorMeta } from '@whatsaaaa/design-system/theme/meta' import vue from '@vitejs/plugin-vue' import type { Plugin } from 'vite' import { defineConfig } from 'vitest/config' /** - * The design system's head scripts, inline in the before the stylesheet: a remembered - * theme and a remembered "keys off" apply before the first paint. They come from the installed - * package, so they stay in step with it. + * The design system's head tags, in the before the stylesheet: the two theme-color tags, + * so the page as it is sent colors the browser's bars, and the head scripts, inline, so a + * remembered theme and a remembered "keys off" apply before the first paint. They come from the + * installed package, so they stay in step with it. */ function designSystemHead(): Plugin { return { @@ -16,6 +18,11 @@ function designSystemHead(): Plugin { // before Vite adds the stylesheet and the app's script at the end of the order: 'pre', handler: () => [ + ...themeColorMeta.map((attrs) => ({ + tag: 'meta', + attrs: { ...attrs }, + injectTo: 'head' as const, + })), { tag: 'script', children: themeInitScript, injectTo: 'head' }, { tag: 'script', children: keysInitScript, injectTo: 'head' }, ],