Docs in English (part 1), seeding guide, Coolify deployment
- Translate to English every doc the code branches did not touch: AGENT.md, developer guide, vibe, CHANGELOG, docs index, module pages, all skills except ipal-seo-check (14 pages follow after the security/SEO merge). Placeholder marker is now [TO FILL: …]; skill resources renamed to section-code.md / nav-code.md. AGENT.md and the ipal-skills pointer block say the docs are in English. - docs/seeding.md: create-only, natural keys, never delete, no users or secrets, empty-field globals, fallbackLocale: false, dry run, backup and restore, production update guard, seeds vs migrations, Coolify Terminal. Seed templates gain --dry-run, the SEED_UPDATE production guard (IPAL_SEED_ALLOW_PROD_UPDATE), skip of edited records and a summary. "Seeding on production" rule block in AGENT.md. - Coolify is the single deployment path (deployment, env, developer guide, ipal-setup): build vs runtime env, migrations on container start (prodMigrations), health check and rolling updates, rollback, backups and restore, DNS/Let's Encrypt/CAA. R2: custom domain needs a Cloudflare zone; default is media served by the app (R2_PUBLIC_URL empty). - docsConsistency: no Polish prose outside code/quoted data (pending pages listed); IPAL_* names may also be read by shipped skill templates. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6e3979bae6
commit
2d9f3e15d4
+83
-81
@@ -1,26 +1,27 @@
|
||||
# Dostępność — widget a11y (WCAG)
|
||||
# Accessibility — a11y widget (WCAG)
|
||||
|
||||
Widget dostępności: pływający przycisk otwierający panel z opcjami dla osób z
|
||||
niepełnosprawnościami (rozmiar tekstu, kontrast, skala szarości, podkreślone
|
||||
linki, czytelna czcionka, wyłączenie animacji, duży kursor).
|
||||
Accessibility widget: a floating button that opens a panel with options for people
|
||||
with disabilities (text size, contrast, grayscale, underlined links, readable font,
|
||||
no animations, big cursor).
|
||||
|
||||
> **OPCJONALNY — nie dodawaj domyślnie.** Widget a11y jest wymagany prawnie
|
||||
> TYLKO dla niektórych stron (podmioty publiczne, część e-commerce/usług objętych
|
||||
> European Accessibility Act). Dla większości stron komercyjnych to OPCJA, nie
|
||||
> obowiązek. Dodawaj GDY klient/projekt tego wymaga — nie na każdej stronie z
|
||||
> automatu. W razie wątpliwości: zapytaj, czy strona podlega wymogom dostępności.
|
||||
> **OPTIONAL — do not add by default.** The a11y widget is legally required
|
||||
> ONLY for some sites (public bodies, some e-commerce/services covered by the
|
||||
> European Accessibility Act). For most commercial sites it is an OPTION, not a
|
||||
> duty. Add it WHEN the client/project requires it — not on every site
|
||||
> automatically. If in doubt: ask whether the site falls under accessibility rules.
|
||||
|
||||
Wzorzec jak CookieBanner: provider + widget, wpinasz raz. Preferencje w cookie
|
||||
(bez flash), stosowane jako atrybuty `data-a11y-*` na `<html>`.
|
||||
Same pattern as CookieBanner: provider + widget, wired once. Preferences live in a
|
||||
cookie (no flash) and are applied as `data-a11y-*` attributes on `<html>`.
|
||||
|
||||
> **Granica plugin/projekt:** plugin dostarcza MECHANIZM (widget, stan, cookie,
|
||||
> atrybuty na html). Projekt dostarcza CSS reagujący na atrybuty — bo style
|
||||
> zależą od designu projektu (kolory, czcionki, Tailwind). Plugin NIE narzuca
|
||||
> stylów, żeby nie kolidować. Gotowy CSS do skopiowania niżej.
|
||||
> **Plugin/project boundary:** the plugin provides the MECHANISM (widget, state,
|
||||
> cookie, attributes on html). The project provides the CSS that reacts to the
|
||||
> attributes — because styles depend on the project design (colors, fonts,
|
||||
> Tailwind). The plugin does NOT impose styles, so nothing clashes. Ready-to-copy
|
||||
> CSS is below.
|
||||
|
||||
---
|
||||
|
||||
## 1. Wpięcie — Provider + Widget
|
||||
## 1. Wiring — Provider + Widget
|
||||
|
||||
```tsx
|
||||
// app/(frontend)/[locale]/layout.tsx
|
||||
@@ -40,19 +41,19 @@ import { AccessibilityProvider, AccessibilityWidget } from '@intecion/ipal-kit/c
|
||||
resetButton: 'a11y-reset',
|
||||
closeButton: 'a11y-close',
|
||||
}}
|
||||
texts={A11Y[locale]} // etykiety per locale; domyślnie ANGIELSKI
|
||||
texts={A11Y[locale]} // labels per locale; ENGLISH by default
|
||||
/>
|
||||
</body>
|
||||
</AccessibilityProvider>
|
||||
```
|
||||
|
||||
Widget jest bez stylów (jak CookieBanner) — classNames dopasowujesz do designu.
|
||||
The widget is unstyled (like CookieBanner) — match the classNames to your design.
|
||||
|
||||
## Etykiety — domyślnie angielski, konfiguracja per locale
|
||||
## Labels — English by default, configured per locale
|
||||
|
||||
Domyślne etykiety są **angielskie** (plugin jest wielojęzyczny, neutralny bazowo).
|
||||
Tłumaczenia trzymasz w projekcie i podajesz zestaw dla aktywnego języka przez
|
||||
`texts` (`A11yTexts`). Plugin pozostaje content-agnostyczny:
|
||||
Default labels are **English** (the plugin is multilingual, neutral at its base).
|
||||
Keep translations in the project and pass the set for the active language through
|
||||
`texts` (`A11yTexts`). The plugin stays content-agnostic:
|
||||
|
||||
```tsx
|
||||
import type { A11yTexts } from '@intecion/ipal-kit/client'
|
||||
@@ -65,56 +66,56 @@ const A11Y: Record<string, A11yTexts> = {
|
||||
<AccessibilityWidget texts={A11Y[locale]} classNames={{ /* … */ }} />
|
||||
```
|
||||
|
||||
Podajesz tylko te klucze, które chcesz nadpisać — reszta spadnie na angielski
|
||||
default. Możesz też trzymać etykiety w zlokalizowanym globalu i czytać je z panelu
|
||||
(spójne z „zarządzanie z panelu"), ale to już decyzja projektu — plugin wymaga
|
||||
tylko `A11yTexts` dla bieżącego locale.
|
||||
Pass only the keys you want to override — the rest falls back to the English
|
||||
default. You can also keep the labels in a localized global and read them from the
|
||||
panel (consistent with "managed from the panel"), but that is a project decision —
|
||||
the plugin only needs `A11yTexts` for the current locale.
|
||||
|
||||
---
|
||||
|
||||
## 2. CSS reagujący na atrybuty (OBOWIĄZKOWE — projekt)
|
||||
## 2. CSS that reacts to the attributes (MANDATORY — project)
|
||||
|
||||
Widget ustawia atrybuty na `<html>`. Bez tego CSS nic się nie dzieje. Skopiuj do
|
||||
globalnego CSS projektu (dostosuj do designu):
|
||||
The widget sets attributes on `<html>`. Without this CSS nothing happens. Copy it
|
||||
into the project's global CSS (adapt it to the design):
|
||||
|
||||
```css
|
||||
/* Rozmiar tekstu */
|
||||
/* Text size */
|
||||
html[data-a11y-text="1"] { font-size: 112.5%; }
|
||||
html[data-a11y-text="2"] { font-size: 125%; }
|
||||
html[data-a11y-text="3"] { font-size: 150%; }
|
||||
|
||||
/* Odstęp między liniami */
|
||||
/* Line spacing */
|
||||
html[data-a11y-line="1"] * { line-height: 1.8 !important; }
|
||||
html[data-a11y-line="2"] * { line-height: 2.2 !important; }
|
||||
|
||||
/* Kontrast wysoki */
|
||||
/* High contrast */
|
||||
html[data-a11y-contrast="high"] {
|
||||
filter: contrast(1.4);
|
||||
}
|
||||
/* Kontrast odwrócony */
|
||||
/* Inverted contrast */
|
||||
html[data-a11y-contrast="inverted"] {
|
||||
filter: invert(1) hue-rotate(180deg);
|
||||
}
|
||||
html[data-a11y-contrast="inverted"] img,
|
||||
html[data-a11y-contrast="inverted"] video {
|
||||
filter: invert(1) hue-rotate(180deg); /* przywróć media */
|
||||
filter: invert(1) hue-rotate(180deg); /* restore media */
|
||||
}
|
||||
|
||||
/* Skala szarości */
|
||||
/* Grayscale */
|
||||
html[data-a11y-grayscale="on"] { filter: grayscale(1); }
|
||||
/* Uwaga: filter na html nie kumuluje się — jeśli łączysz kontrast+szarość,
|
||||
zastosuj na body albo połącz w jednej regule. */
|
||||
/* Note: filter on html does not stack — if you combine contrast+grayscale,
|
||||
apply it on body or merge it into one rule. */
|
||||
|
||||
/* Podkreślone linki */
|
||||
/* Underlined links */
|
||||
html[data-a11y-underline="on"] a { text-decoration: underline !important; }
|
||||
|
||||
/* Czytelna czcionka (podmień na swoją dyslexia-friendly / prostą) */
|
||||
/* Readable font (swap in your own dyslexia-friendly / simple font) */
|
||||
html[data-a11y-font="readable"] * {
|
||||
font-family: Verdana, Tahoma, sans-serif !important;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
/* Wyłączenie animacji */
|
||||
/* No animations */
|
||||
html[data-a11y-motion="reduce"] *,
|
||||
html[data-a11y-motion="reduce"] *::before,
|
||||
html[data-a11y-motion="reduce"] *::after {
|
||||
@@ -123,31 +124,31 @@ html[data-a11y-motion="reduce"] *::after {
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
|
||||
/* Duży kursor */
|
||||
/* Big cursor */
|
||||
html[data-a11y-cursor="big"] * {
|
||||
cursor: url('/cursors/big.svg') 4 4, auto !important;
|
||||
}
|
||||
```
|
||||
|
||||
Dostosuj wartości do projektu (kolory kontrastu, czcionka, kursor). To Twój CSS —
|
||||
plugin tylko ustawia atrybuty.
|
||||
Adapt the values to the project (contrast colors, font, cursor). This is your CSS —
|
||||
the plugin only sets the attributes.
|
||||
|
||||
> **Kontrast + filter:** wiele opcji używa `filter` na `<html>`. CSS `filter` na
|
||||
> jednym elemencie NIE kumuluje wielu wartości z różnych reguł — ostatnia wygrywa.
|
||||
> Jeśli chcesz łączyć (np. szarość + kontrast), zastosuj filtry na `body` z
|
||||
> pełną wartością, albo zbuduj reguły kombinowane. Dla pojedynczych opcji działa
|
||||
> bez problemu.
|
||||
> **Contrast + filter:** several options use `filter` on `<html>`. CSS `filter` on
|
||||
> one element does NOT stack values from different rules — the last one wins.
|
||||
> If you want to combine them (e.g. grayscale + contrast), apply the filters on
|
||||
> `body` with the full value, or build combined rules. Single options work
|
||||
> without issues.
|
||||
|
||||
---
|
||||
|
||||
## 3. Bez flash (SSR) — opcjonalne
|
||||
## 3. No flash (SSR) — optional
|
||||
|
||||
Domyślnie widget stosuje atrybuty po hydratacji (krótki flash przy ładowaniu,
|
||||
jeśli użytkownik miał ustawienia). Żeby tego uniknąć, odczytaj cookie server-side
|
||||
i ustaw atrybuty na `<html>` w SSR:
|
||||
By default the widget applies the attributes after hydration (a short flash on load
|
||||
if the user had settings). To avoid it, read the cookie server-side and set the
|
||||
attributes on `<html>` during SSR:
|
||||
|
||||
```tsx
|
||||
// layout.tsx (server) — odczytaj cookie i ustaw atrybuty od razu
|
||||
// layout.tsx (server) — read the cookie and set the attributes right away
|
||||
import { cookies } from 'next/headers'
|
||||
import { A11Y_COOKIE, parseA11y, a11yAttributes } from '@intecion/ipal-kit'
|
||||
|
||||
@@ -160,15 +161,15 @@ const htmlAttrs = Object.fromEntries(
|
||||
return <html lang={locale} {...htmlAttrs}>...</html>
|
||||
```
|
||||
|
||||
Provider i tak re-aplikuje na kliencie i synchronizuje. To tylko eliminuje flash.
|
||||
The provider re-applies and syncs on the client anyway. This only removes the flash.
|
||||
|
||||
### Stan i atrybuty (`A11yState`)
|
||||
### State and attributes (`A11yState`)
|
||||
|
||||
Cookie `a11y-prefs` (`A11Y_COOKIE`, JSON, `path=/`, `max-age` 1 rok, `samesite=lax`).
|
||||
Helpery `A11Y_COOKIE`, `A11Y_DEFAULT`, `parseA11y`, `serializeA11y`, `a11yAttributes`
|
||||
są w `@intecion/ipal-kit` (nie w `/client`). `A11yState` jako typ jest w obu entry.
|
||||
Cookie `a11y-prefs` (`A11Y_COOKIE`, JSON, `path=/`, `max-age` 1 year, `samesite=lax`).
|
||||
The helpers `A11Y_COOKIE`, `A11Y_DEFAULT`, `parseA11y`, `serializeA11y`, `a11yAttributes`
|
||||
are in `@intecion/ipal-kit` (not in `/client`). The `A11yState` type is in both entries.
|
||||
|
||||
| Klucz stanu | Wartości | Atrybut na `<html>` (brak = domyślne) |
|
||||
| State key | Values | Attribute on `<html>` (none = default) |
|
||||
|---|---|---|
|
||||
| `textSize` | `0`–`3` | `data-a11y-text="1..3"` |
|
||||
| `lineHeight` | `0`–`2` | `data-a11y-line="1..2"` |
|
||||
@@ -181,39 +182,40 @@ są w `@intecion/ipal-kit` (nie w `/client`). `A11yState` jako typ jest w obu en
|
||||
|
||||
---
|
||||
|
||||
## 4. Osobny przycisk otwierający (opcjonalnie)
|
||||
## 4. Separate open button (optional)
|
||||
|
||||
Widget ma wbudowany pływający przycisk. Jeśli chcesz otwierać panel z innego
|
||||
miejsca (np. stopka „Dostępność"), użyj hooka:
|
||||
The widget has a built-in floating button. If you want to open the panel from
|
||||
somewhere else (e.g. an "Accessibility" link in the footer), use the hook:
|
||||
|
||||
```tsx
|
||||
'use client'
|
||||
import { useAccessibility } from '@intecion/ipal-kit/client'
|
||||
// stan otwarcia trzymaj sam, albo rozbuduj widget — hook daje state/set/reset
|
||||
// keep the open state yourself, or extend the widget — the hook gives state/set/reset
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Compliance — kiedy dostępność jest wymagana
|
||||
## 5. Compliance — when accessibility is required
|
||||
|
||||
Dostępność (WCAG) jest wymagana prawnie TYLKO dla części stron:
|
||||
- **Podmioty publiczne** (urzędy, szkoły, instytucje) — ustawa o dostępności cyfrowej
|
||||
- **Duże e-commerce / usługi** objęte European Accessibility Act (2019/882, od 2025)
|
||||
- Strony, gdzie klient sam tego wymaga (polityka firmy, przetarg)
|
||||
Accessibility (WCAG) is legally required ONLY for some sites:
|
||||
- **Public bodies** (government offices, schools, institutions) — the Polish digital accessibility act
|
||||
- **Large e-commerce / services** covered by the European Accessibility Act (2019/882, from 2025)
|
||||
- Sites where the client requires it (company policy, public tender)
|
||||
|
||||
Dla **większości stron komercyjnych** (wizytówka, mała firma, katalog) widget a11y
|
||||
to **opcja, nie obowiązek** — dodawaj gdy klient wymaga, nie z automatu.
|
||||
For **most commercial sites** (business card site, small company, catalog) the a11y
|
||||
widget is **an option, not a duty** — add it when the client requires it, not
|
||||
automatically.
|
||||
|
||||
Gdy dodajesz: widget sam w sobie NIE czyni strony w pełni dostępną — to pomoc dla
|
||||
użytkownika. Pełna dostępność to też semantyczny HTML, alt teksty, nawigacja
|
||||
klawiaturą, kontrast bazowy. Widget uzupełnia, nie zastępuje. Nie sprzedawaj
|
||||
klientowi „mamy widget = jesteśmy zgodni z WCAG". Patrz [dev/PROGRAMISTA.md](dev/PROGRAMISTA.md) §5.
|
||||
When you add it: the widget by itself does NOT make the site fully accessible — it
|
||||
helps the user. Full accessibility also means semantic HTML, alt texts, keyboard
|
||||
navigation, baseline contrast. The widget complements, it does not replace. Do not
|
||||
sell the client "we have a widget = we are WCAG compliant". See [dev/PROGRAMISTA.md](dev/PROGRAMISTA.md) §5.
|
||||
|
||||
## Wyłączenie, nadpisanie, rozszerzenie
|
||||
## Turn off, override, extend
|
||||
|
||||
- **Wyłączenie:** moduł jest opt-in — bez `AccessibilityProvider` / `AccessibilityWidget` nic się nie dzieje
|
||||
(brak opcji w `ipalKit`, brak pól w panelu).
|
||||
- **Nadpisanie:** `classNames` i `texts` widgetu; cały wygląd efektów to CSS projektu.
|
||||
- **Rozszerzenie:** własny UI na `useAccessibility()` (`state`, `set`, `reset`); SSR helpery
|
||||
`parseA11y` / `a11yAttributes` / `serializeA11y` / `A11Y_DEFAULT`. Zestawu opcji (`A11yState`) obecnie
|
||||
nie da się rozszerzyć bez zmian w pluginie.
|
||||
- **Turn off:** the module is opt-in — without `AccessibilityProvider` / `AccessibilityWidget` nothing happens
|
||||
(no option in `ipalKit`, no fields in the panel).
|
||||
- **Override:** the widget's `classNames` and `texts`; the whole look of the effects is project CSS.
|
||||
- **Extend:** your own UI on `useAccessibility()` (`state`, `set`, `reset`); SSR helpers
|
||||
`parseA11y` / `a11yAttributes` / `serializeA11y` / `A11Y_DEFAULT`. The option set (`A11yState`) currently
|
||||
cannot be extended without changes in the plugin.
|
||||
|
||||
Reference in New Issue
Block a user