diff --git a/docs/agent/reference-site/INDEX.md b/docs/agent/reference-site/INDEX.md index 8a8f073..a1a8c3f 100644 --- a/docs/agent/reference-site/INDEX.md +++ b/docs/agent/reference-site/INDEX.md @@ -646,7 +646,7 @@ import { Container } from '@intecion/ipal-kit/blocks/rsc' import { TokenPanel } from '@/components/design/TokenPanel' import { i18nConfig } from '@/i18n.config' -// The styleguide: every design token, in the current theme and in dark side by side. Technical page — +// The styleguide: every design token, light and dark side by side. Technical page — // noindex, not in the sitemap (it is not a Pages document), labels are token names (AGENTS.md → Project decisions). export const metadata: Metadata = { robots: { follow: false, index: false }, title: 'Design tokens' } @@ -657,13 +657,13 @@ export default function DesignPage() {

ipal-kit

Design tokens

- src/design/tokens.ts → pnpm tokens → src/design/tokens.css. The left panel follows the page theme; the right one is always dark - (data-theme="dark" on the panel). The bottom row is the inverse scope (data-surface="inverse"). + src/design/tokens.ts → pnpm tokens → src/design/tokens.css. The panels set data-theme="light" and data-theme="dark" + on themselves (the tokens switch on any element); the bottom row is the inverse scope (data-surface="inverse") in the page theme.

- - + +
@@ -682,23 +682,30 @@ export const generateStaticParams = () => i18nConfig.locales.map(({ code }) => ( */ :root { - --ipal-bg: oklch(0.985 0.006 85); - --ipal-primary: oklch(0.47 0.09 160); - --ipal-surface-muted: oklch(0.955 0.012 85); - --ipal-accent: oklch(0.55 0.13 50); - --ipal-link-inverse: oklch(0.82 0.08 160); --ipal-fw-heading: 600; --ipal-radius: 0.25rem; --ipal-radius-card: 0.25rem; } -:root[data-theme="dark"] { +:root, [data-theme="light"] { + --ipal-bg: oklch(0.985 0.006 85); + --ipal-primary: oklch(0.47 0.09 160); + --ipal-surface-muted: oklch(0.955 0.012 85); + --ipal-accent: oklch(0.55 0.13 50); + --ipal-link-inverse: oklch(0.82 0.08 160); + --ipal-primary-inverse: oklch(0.74 0.09 160); + --ipal-primary-inverse-text: oklch(0.18 0.02 160); +} + +:root[data-theme="dark"], [data-theme="dark"] { --ipal-bg: oklch(0.2 0.01 160); --ipal-primary: oklch(0.74 0.09 160); --ipal-surface-muted: oklch(0.25 0.012 160); --ipal-accent: oklch(0.76 0.12 55); --ipal-accent-text: oklch(0.18 0.02 55); --ipal-link-inverse: oklch(0.42 0.09 160); + --ipal-primary-inverse: oklch(0.47 0.09 160); + --ipal-primary-inverse-text: oklch(0.99 0 0); --ipal-primary-text: oklch(0.18 0.02 160); } ``` @@ -719,6 +726,8 @@ export const tokens = defineTokens({ primary: 'oklch(0.47 0.09 160)', // deep sage green — the studio's brand colour (DESIGN.md §2) accent: 'oklch(0.55 0.13 50)', // terracotta, for highlights only 'link-inverse': 'oklch(0.82 0.08 160)', // links and accents on inverted sections + 'primary-inverse': 'oklch(0.74 0.09 160)', // buttons on inverted (dark) sections + 'primary-inverse-text': 'oklch(0.18 0.02 160)', bg: 'oklch(0.985 0.006 85)', // warm paper white 'surface-muted': 'oklch(0.955 0.012 85)', }, @@ -728,6 +737,8 @@ export const tokens = defineTokens({ accent: 'oklch(0.76 0.12 55)', 'accent-text': 'oklch(0.18 0.02 55)', 'link-inverse': 'oklch(0.42 0.09 160)', + 'primary-inverse': 'oklch(0.47 0.09 160)', // inverted sections are light in dark mode + 'primary-inverse-text': 'oklch(0.99 0 0)', bg: 'oklch(0.2 0.01 160)', 'surface-muted': 'oklch(0.25 0.012 160)', }, diff --git a/reference/DESIGN.md b/reference/DESIGN.md index 2cee85c..a1aed5a 100644 --- a/reference/DESIGN.md +++ b/reference/DESIGN.md @@ -16,13 +16,12 @@ sage-green surfaces. Everything else stays quiet. | accent | oklch(0.55 0.13 50) terracotta | oklch(0.76 0.12 55) | star ratings, badges, highlights only | | accent-text | default | oklch(0.18 0.02 55) | text on accent in dark | | link-inverse | oklch(0.82 0.08 160) | oklch(0.42 0.09 160) | links on inverted sections | +| primary-inverse / -text | oklch(0.74 0.09 160) / dark text | oklch(0.47 0.09 160) / white | buttons on inverted sections | | bg | oklch(0.985 0.006 85) warm paper | oklch(0.2 0.01 160) | page | | surface-muted | oklch(0.955 0.012 85) | oklch(0.25 0.012 160) | alternate sections, footer | | secondary, surface, borders, text | default | default | — | -Contrast (`pnpm exec ipal-tokens --report`): 70 of 72 pairs pass. Open: "primary on surface-inverse" -2.75:1 (light) / 2.03:1 (dark), a 3:1 UI-component warning — primary buttons inside inverted sections. -Reported to the token standard (the inverse scope does not re-map primary); not a launch blocker for the reference. +Contrast (`pnpm exec ipal-tokens --report`): 74 of 74 pairs pass, light and dark, the inverse scope included. ## 3. Type Body: Inter 400/500 (`--font-family-body`). Headings: Fraunces 600 (`--font-family-heading`). diff --git a/reference/src/app/(frontend)/[locale]/design/page.tsx b/reference/src/app/(frontend)/[locale]/design/page.tsx index 1d90fd5..020c145 100644 --- a/reference/src/app/(frontend)/[locale]/design/page.tsx +++ b/reference/src/app/(frontend)/[locale]/design/page.tsx @@ -5,7 +5,7 @@ import { Container } from '@intecion/ipal-kit/blocks/rsc' import { TokenPanel } from '@/components/design/TokenPanel' import { i18nConfig } from '@/i18n.config' -// The styleguide: every design token, in the current theme and in dark side by side. Technical page — +// The styleguide: every design token, light and dark side by side. Technical page — // noindex, not in the sitemap (it is not a Pages document), labels are token names (AGENTS.md → Project decisions). export const metadata: Metadata = { robots: { follow: false, index: false }, title: 'Design tokens' } @@ -16,13 +16,13 @@ export default function DesignPage() {

ipal-kit

Design tokens

- src/design/tokens.ts → pnpm tokens → src/design/tokens.css. The left panel follows the page theme; the right one is always dark - (data-theme="dark" on the panel). The bottom row is the inverse scope (data-surface="inverse"). + src/design/tokens.ts → pnpm tokens → src/design/tokens.css. The panels set data-theme="light" and data-theme="dark" + on themselves (the tokens switch on any element); the bottom row is the inverse scope (data-surface="inverse") in the page theme.

- - + +
diff --git a/reference/src/components/design/TokenPanel.tsx b/reference/src/components/design/TokenPanel.tsx index 58c3ed2..5cc0453 100644 --- a/reference/src/components/design/TokenPanel.tsx +++ b/reference/src/components/design/TokenPanel.tsx @@ -6,19 +6,19 @@ const TYPE = ['text-display', 'text-h1', 'text-h2', 'text-h3', 'text-h4', 'text- const RADII = ['rounded-sm', 'rounded-control', 'rounded-card', 'rounded-media', 'rounded-full'] const SHADOWS = ['shadow-sm', 'shadow-md', 'shadow-lg'] -type Props = { dark?: boolean; inverse?: boolean; title: string } +type Props = { inverse?: boolean; theme?: 'dark' | 'light'; title: string } /** * One panel of the styleguide. Swatches read IPAL_TOKENS (`var(--ipal-…)` strings from the plugin), so a new * token appears here with no code change. Inline styles are the one place raw vars are fine: this page shows them. */ -export function TokenPanel({ dark, inverse, title }: Props) { +export function TokenPanel({ inverse, theme, title }: Props) { return (

{title}

diff --git a/reference/src/design/tokens.css b/reference/src/design/tokens.css index 64c75bf..d1a1be7 100644 --- a/reference/src/design/tokens.css +++ b/reference/src/design/tokens.css @@ -4,22 +4,29 @@ */ :root { - --ipal-bg: oklch(0.985 0.006 85); - --ipal-primary: oklch(0.47 0.09 160); - --ipal-surface-muted: oklch(0.955 0.012 85); - --ipal-accent: oklch(0.55 0.13 50); - --ipal-link-inverse: oklch(0.82 0.08 160); --ipal-fw-heading: 600; --ipal-radius: 0.25rem; --ipal-radius-card: 0.25rem; } -:root[data-theme="dark"] { +:root, [data-theme="light"] { + --ipal-bg: oklch(0.985 0.006 85); + --ipal-primary: oklch(0.47 0.09 160); + --ipal-surface-muted: oklch(0.955 0.012 85); + --ipal-accent: oklch(0.55 0.13 50); + --ipal-link-inverse: oklch(0.82 0.08 160); + --ipal-primary-inverse: oklch(0.74 0.09 160); + --ipal-primary-inverse-text: oklch(0.18 0.02 160); +} + +:root[data-theme="dark"], [data-theme="dark"] { --ipal-bg: oklch(0.2 0.01 160); --ipal-primary: oklch(0.74 0.09 160); --ipal-surface-muted: oklch(0.25 0.012 160); --ipal-accent: oklch(0.76 0.12 55); --ipal-accent-text: oklch(0.18 0.02 55); --ipal-link-inverse: oklch(0.42 0.09 160); + --ipal-primary-inverse: oklch(0.47 0.09 160); + --ipal-primary-inverse-text: oklch(0.99 0 0); --ipal-primary-text: oklch(0.18 0.02 160); } diff --git a/reference/src/design/tokens.ts b/reference/src/design/tokens.ts index b6dcf42..a8b2d77 100644 --- a/reference/src/design/tokens.ts +++ b/reference/src/design/tokens.ts @@ -11,6 +11,8 @@ export const tokens = defineTokens({ primary: 'oklch(0.47 0.09 160)', // deep sage green — the studio's brand colour (DESIGN.md §2) accent: 'oklch(0.55 0.13 50)', // terracotta, for highlights only 'link-inverse': 'oklch(0.82 0.08 160)', // links and accents on inverted sections + 'primary-inverse': 'oklch(0.74 0.09 160)', // buttons on inverted (dark) sections + 'primary-inverse-text': 'oklch(0.18 0.02 160)', bg: 'oklch(0.985 0.006 85)', // warm paper white 'surface-muted': 'oklch(0.955 0.012 85)', }, @@ -20,6 +22,8 @@ export const tokens = defineTokens({ accent: 'oklch(0.76 0.12 55)', 'accent-text': 'oklch(0.18 0.02 55)', 'link-inverse': 'oklch(0.42 0.09 160)', + 'primary-inverse': 'oklch(0.47 0.09 160)', // inverted sections are light in dark mode + 'primary-inverse-text': 'oklch(0.99 0 0)', bg: 'oklch(0.2 0.01 160)', 'surface-muted': 'oklch(0.25 0.012 160)', }, diff --git a/reference/src/payload-types.ts b/reference/src/payload-types.ts index ef1c858..3e75de0 100644 --- a/reference/src/payload-types.ts +++ b/reference/src/payload-types.ts @@ -1101,7 +1101,7 @@ export interface PricingBlock { */ export interface EntryListBlock { header?: SectionHeaderData; - collection: 'posts' | 'caseStudies'; + entryCollection: 'posts' | 'caseStudies'; mode?: ('latest' | 'selected') | null; limit?: number | null; entries?: @@ -1895,7 +1895,7 @@ export interface PricingBlockSelect { */ export interface EntryListBlockSelect { header?: T | SectionHeaderDataSelect; - collection?: T; + entryCollection?: T; mode?: T; limit?: T; entries?: T; diff --git a/reference/src/seed/base.ts b/reference/src/seed/base.ts index 45108cf..f4e79f2 100644 --- a/reference/src/seed/base.ts +++ b/reference/src/seed/base.ts @@ -32,10 +32,10 @@ export async function seedBasePages(seed: Seeder) { pageTemplates.services({ blocks }), pageTemplates.contact({ blocks, form: { $form: 'Contact form' } }), // The archive page lists its entries with an entry list block (the editor decides where) - pageTemplates.blogIndex({ blocks, layout: (b) => [b[0], { blockType: 'entryList', collection: 'posts', limit: 9, mode: 'latest', variant: 'cards' }, ...b.slice(1)] }), - { ...pageTemplates.legal('privacyPolicy', { blocks }), noindex: true }, - { ...pageTemplates.legal('termsOfService', { blocks }), noindex: true }, - { ...pageTemplates.cookiePolicy({ blocks }), noindex: true }, + pageTemplates.blogIndex({ blocks, layout: (b) => [b[0], { blockType: 'entryList', entryCollection: 'posts', limit: 9, mode: 'latest', variant: 'cards' }, ...b.slice(1)] }), + pageTemplates.legal('privacyPolicy', { blocks }), + pageTemplates.legal('termsOfService', { blocks }), + pageTemplates.cookiePolicy({ blocks }), pageTemplates.notFound({ blocks }), ]) } diff --git a/reference/src/seed/demo.ts b/reference/src/seed/demo.ts index 9da9fb8..fdd1c0c 100644 --- a/reference/src/seed/demo.ts +++ b/reference/src/seed/demo.ts @@ -169,14 +169,14 @@ export async function seedDemoPages(seed: Seeder, media: Record) const blogIndex = pageTemplates.blogIndex({ blocks, - layout: (b) => [b[0], { blockType: 'entryList', collection: 'posts', limit: 9, mode: 'latest', variant: 'cards' }, ...b.slice(1)], + layout: (b) => [b[0], { blockType: 'entryList', entryCollection: 'posts', limit: 9, mode: 'latest', variant: 'cards' }, ...b.slice(1)], overrides: { cta: contactCta, hero: { header: header(tx('Blog', 'Blog'), tx('O projektowaniu, materiałach i budowie — bez żargonu.', 'On design, materials and building — without the jargon.')), variant: 'page' } }, }) const caseStudiesIndex = { layout: [ { blockType: 'hero', header: header(tx('Realizacje', 'Case studies'), tx('Domy, wnętrza i przebudowy, które zaprojektowaliśmy.', 'Houses, interiors and conversions we designed.')), variant: 'page' }, - { blockType: 'entryList', collection: 'caseStudies', limit: 9, mode: 'latest', variant: 'cards' }, + { blockType: 'entryList', entryCollection: 'caseStudies', limit: 9, mode: 'latest', variant: 'cards' }, { blockType: 'cta', ...contactCta }, ], slug: { en: 'case-studies', pl: 'realizacje' }, @@ -302,8 +302,7 @@ export async function seedDemoPages(seed: Seeder, media: Record) quote, blogIndex, caseStudiesIndex, - { - ...pageTemplates.legal('privacyPolicy', { + pageTemplates.legal('privacyPolicy', { blocks, overrides: { richText: { @@ -315,11 +314,8 @@ export async function seedDemoPages(seed: Seeder, media: Record) variant: 'narrow', }, }, - }), - noindex: true, // policies: noindex (AGENT.md §0c) - }, - { - ...pageTemplates.legal('termsOfService', { + }), + pageTemplates.legal('termsOfService', { blocks, overrides: { richText: { @@ -328,11 +324,8 @@ export async function seedDemoPages(seed: Seeder, media: Record) variant: 'narrow', }, }, - }), - noindex: true, // policies: noindex (AGENT.md §0c) - }, - { - ...pageTemplates.cookiePolicy({ + }), + pageTemplates.cookiePolicy({ blocks, overrides: { richText: { @@ -341,9 +334,7 @@ export async function seedDemoPages(seed: Seeder, media: Record) variant: 'narrow', }, }, - }), - noindex: true, // policies: noindex (AGENT.md §0c) - }, + }), pageTemplates.notFound({ blocks }), showcasePage(media), ]) @@ -351,9 +342,8 @@ export async function seedDemoPages(seed: Seeder, media: Record) await seed.upsertBySlug('posts', POSTS.map((p) => ({ ...pageTemplates.post({ blocks, - // The post template starts with the text; a page hero gives the post its title as the h1 - layout: (b) => [{ blockType: 'hero', header: header(p.title, p.excerpt, tx('Blog', 'Blog')), variant: 'page' }, ...b], - overrides: { cta: contactCta, richText: { content: p.text, tableOfContents: { label: tx('Spis treści', 'Contents'), show: true }, variant: 'narrow' } }, + overrides: { cta: contactCta, hero: { header: header(p.title, p.excerpt, tx('Blog', 'Blog')) }, richText: { content: p.text, tableOfContents: { label: tx('Spis treści', 'Contents'), show: true }, variant: 'narrow' } }, + title: p.title, }), aiSummary: p.excerpt, excerpt: p.excerpt, diff --git a/reference/src/seed/showcase.ts b/reference/src/seed/showcase.ts index ded6996..72b85b1 100644 --- a/reference/src/seed/showcase.ts +++ b/reference/src/seed/showcase.ts @@ -18,7 +18,7 @@ function sample(slug: string, media: Record): Record ({ answer: tx(`Odpowiedź na pytanie ${i}.`, `The answer to question ${i}.`), question: tx(`Pytanie numer ${i}?`, `Question number ${i}?`) })) } case 'featureGrid':