Merge claude/block-library-fixes: block fixes from the visual test, tokens on any element

The seven block fixes from the reference site's first visual test (entryList field
entryCollection: Mongoose reserves 'collection'; contact, hero, CMSLink, templates),
plus claude/design-tokens-build d6675d2: data-theme switches tokens on any element
(LIGHT_SELECTOR / DARK_SELECTOR), primary-inverse / primary-inverse-text roles in
the contrast report, theme.md one-icon note, ipal-form formClasses.ts on token
utilities. No conflicts; one Unreleased CHANGELOG section.

Merge addition: AGENT.md names primary-inverse-text next to primary-inverse.
This commit is contained in:
Radosław Smoliński
2026-10-29 15:10:34 +01:00
27 changed files with 258 additions and 103 deletions
+3 -2
View File
@@ -895,7 +895,8 @@ Every site uses the same `--ipal-*` token names and Tailwind utilities; only the
`rounded-card`, `shadow-sm`, `max-w-container`, `duration-fast ease-out`. **Never** hex, `bg-[#…]`, `var(--color-…)`,
or `dark:` for colours (the roles switch with `data-theme` themselves). `dark:` only for non-colour differences.
- **Inverted section:** `<Section>` with `settings.background = inverted` → `bg-inverse` + `data-surface="inverse"`;
content inside keeps `text-fg` / `text-link` (the scope re-maps them).
content inside keeps `text-fg` / `text-link` / `bg-primary` (the scope re-maps them; a dark brand primary needs
`primary-inverse` / `primary-inverse-text` in `tokens.ts` — the contrast report says when; default: the brand primary). `data-theme="dark"` on any element = a dark panel.
- Fonts via `next/font` with `variable: '--font-family-body'` / `'--font-family-heading'` on `<html>` (not
`--font-body`: a `var()` cycle with the `font-body` utility). Max 2 families.
- Values a CSS variable can't reach (`next/og`, e-mail, `theme-color`): `resolveColors(tokens)` from `@/design/tokens`.
@@ -1043,7 +1044,7 @@ project → **plugin gap**, not a copy.
| `next.config` | `buildImagesConfig`, `buildSecurityHeaders` (`csp`), `buildCsp`, `buildCspHeaders`, `buildAdminCsp` / `buildAdminCspHeaders`, `buildUploadSecurityHeaders`, `withSecurityConfig` (hides `X-Powered-By`) | storage.md, security.md |
| CSP reports, nonces | `createCspReportRoute` (`parseCspReports`, type `CspViolation`), `createProxy({ csp })` + `<SiteProviders nonce>` (dynamic pages only), `createCspNonce`, `CSP_NONCE_HEADER`, `buildReportingEndpoints`, `cspHeaderKey`, `DEFAULT_CSP_REPORT_GROUP`; types `BuildAdminCspArgs`, `CspDirective`, `CspSources`, `CreateCspReportRouteArgs`, `WithSecurityConfigOptions` | security.md |
| Fluid typography and spacing | `fluid.css` / `fluid-wide.css` (`--ipal-*` variables); your own sizes: `fluidClamp`, `FLUID_SCALE`, `FLUID_RANGES` | design-tokens.md |
| Brand colours, fonts, radii, motion, dark mode | `tokens.css` + `tailwind.css`, `src/design/tokens.ts` (`defineTokens`, types `TokensInput`, `ColorInput`, `ColorRole`), `pnpm exec ipal-tokens` (`--check`, `--report`, `--warn-only`); building blocks `tokensToCss`, `defaultTokensCss`, `contrastReport` (`ContrastRow`), `contrastRatio`, `parseColor`, `resolveColors`, `IPAL_TOKENS`, `ipalVar`, `IpalTokenName`, `IPAL_BREAKPOINTS`, `COLOR_DEFAULTS`, `STATIC_DEFAULTS`, `FLUID_TOKENS`, `INVERSE_SCOPE`, `LEGACY_DARK_ROLES`, `DARK_SELECTOR`, `INVERSE_SELECTOR`, `RemValue`, `FluidRange` | design-tokens.md |
| Brand colours, fonts, radii, motion, dark mode | `tokens.css` + `tailwind.css`, `src/design/tokens.ts` (`defineTokens`, types `TokensInput`, `ColorInput`, `ColorRole`), `pnpm exec ipal-tokens` (`--check`, `--report`, `--warn-only`); building blocks `tokensToCss`, `defaultTokensCss`, `contrastReport` (`ContrastRow`), `contrastRatio`, `parseColor`, `resolveColors`, `IPAL_TOKENS`, `ipalVar`, `IpalTokenName`, `IPAL_BREAKPOINTS`, `COLOR_DEFAULTS`, `STATIC_DEFAULTS`, `FLUID_TOKENS`, `INVERSE_SCOPE`, `LEGACY_DARK_ROLES`, `LIGHT_SELECTOR`, `DARK_SELECTOR`, `INVERSE_SELECTOR`, `RemValue`, `FluidRange` | design-tokens.md |
| Accessibility widget CSS | `@intecion/ipal-kit/a11y.css` (works through the tokens) | accessibility.md |
**Consent, analytics, operations**
@@ -1,29 +1,36 @@
// src/components/forms/formClasses.ts — the ONLY place forms are styled. Every
// panel form (RenderForm / BuilderForm) uses it. Values = the project's design
// tokens (DESIGN.md); the plugin ships no styles. Delete keys you don't need.
// panel form (RenderForm / BuilderForm) uses it. Design-token utilities only
// (node_modules/@intecion/ipal-kit/docs/design-tokens.md): a brand changes
// src/design/tokens.ts, never this file. Delete keys you don't need.
import type { BuilderFormClassNames } from '@intecion/ipal-kit/client'
import { buttonClass } from '@intecion/ipal-kit/blocks/rsc'
const control =
'w-full rounded-control border border-border-strong bg-surface px-3 py-2 text-fg placeholder:text-fg-muted ' +
'transition-colors duration-fast ease-out focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus ' +
'aria-invalid:border-danger'
export const formClasses: BuilderFormClassNames = {
form: 'grid gap-6',
progress: 'text-sm text-muted', // "Step 1 of 3"
progress: 'text-sm text-fg-muted', // "Step 1 of 3"
step: 'grid gap-4',
stepTitle: 'text-h3 font-semibold',
stepDescription: 'text-muted',
stepTitle: 'text-h4',
stepDescription: 'text-fg-muted',
fields: 'grid grid-cols-12 gap-4',
field: 'col-span-12',
fieldHalf: 'md:col-span-6', // width ≤ 50 in the panel
label: 'mb-1 block font-medium',
input: 'w-full rounded-md border border-border px-3 py-2',
textarea: 'w-full rounded-md border border-border px-3 py-2',
select: 'w-full rounded-md border border-border px-3 py-2',
label: 'mb-1 block font-medium text-fg-strong',
input: control,
textarea: control,
select: control,
checkboxLabel: 'flex items-start gap-2',
choices: 'grid gap-2', // radio / checkbox group <fieldset>
legend: 'mb-1 font-medium',
legend: 'mb-1 font-medium text-fg-strong',
choice: 'flex items-center gap-2',
error: 'mt-1 text-sm text-danger',
formError: 'text-danger',
actions: 'flex gap-3',
back: 'btn btn-secondary', // same classes as Button.tsx variants
submit: 'btn btn-primary',
success: 'rounded-md bg-surface p-6',
formError: 'rounded-control bg-danger-surface p-4 text-danger',
actions: 'flex flex-wrap gap-3',
back: buttonClass('secondary'), // the same looks as the section buttons
submit: buttonClass('primary'),
success: 'rounded-card bg-success-surface p-6 text-success',
}
@@ -759,7 +759,7 @@ CSS: `@intecion/ipal-kit/tokens.css` (neutral `--ipal-*` defaults, light/dark, `
| `ipalVar(name, fallback?)` | `@intecion/ipal-kit/tokens`, `@intecion/ipal-kit` | `var(--ipal-<name>[, fallback])`. |
| `IPAL_BREAKPOINTS` | `@intecion/ipal-kit/tokens`, `@intecion/ipal-kit` | `{ sm: 40, md: 48, lg: 64, xl: 80, '2xl': 96 }` (rem) — for `sizes=` / `matchMedia`. |
| `COLOR_DEFAULTS`, `STATIC_DEFAULTS`, `FLUID_TOKENS`, `INVERSE_SCOPE`, `LEGACY_DARK_ROLES` | `@intecion/ipal-kit/tokens` | The catalogue: colour defaults per theme, theme-independent defaults, fluid names, inverse re-map, the old `-dark` twins. |
| `DARK_SELECTOR`, `INVERSE_SELECTOR` | `@intecion/ipal-kit/tokens` | `:root[data-theme="dark"]`, `[data-surface="inverse"]`. |
| `LIGHT_SELECTOR`, `DARK_SELECTOR`, `INVERSE_SELECTOR` | `@intecion/ipal-kit/tokens` | `:root, [data-theme="light"]`, `:root[data-theme="dark"], [data-theme="dark"]` (a theme on any element), `[data-surface="inverse"]`. |
**Types:** `TokensInput`, `IpalTokenName` (root, `/tokens`), `ColorInput`, `ColorRole`, `ContrastRow`, `FluidRange`, `RemValue` (`/tokens`).