@krizaka/ui 4.5.0 → 4.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.
- package/dist/account-settings.js +56 -43
- package/dist/account-settings.js.map +1 -1
- package/dist/{chunk-CZHPWLNW.js → chunk-WKQ5CB3I.js} +18 -5
- package/dist/chunk-WKQ5CB3I.js.map +1 -0
- package/dist/columns.js +3 -1
- package/dist/columns.js.map +1 -1
- package/dist/comparison-table.js +3 -3
- package/dist/comparison-table.js.map +1 -1
- package/dist/filter-bar.d.ts +3 -3
- package/dist/kind-config-editor.js +1 -1
- package/dist/nav-bar.d.ts +1 -1
- package/dist/notification-preferences.js +1 -1
- package/dist/router.js +2 -2
- package/dist/router.js.map +1 -1
- package/dist/schema-form.js +1 -1
- package/dist/shop-composer.d.ts +2 -2
- package/dist/site-cahier.d.ts +2 -0
- package/dist/site-cahier.js +2 -1
- package/dist/site-cahier.js.map +1 -1
- package/dist/site-footer.d.ts +52 -6
- package/dist/site-footer.js +98 -60
- package/dist/site-footer.js.map +1 -1
- package/dist/{sites-iJkCPeiH.d.ts → sites-BPshUouf.d.ts} +2 -2
- package/dist/switch.d.ts +25 -3
- package/dist/switch.js +1 -1
- package/dist/virtual.d.ts +3 -3
- package/package.json +11 -11
- package/registry/app-frame.json +1 -1
- package/registry/columns.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/examples/site-footer/family.d.ts +4 -0
- package/registry/examples/site-footer/family.js +25 -0
- package/registry/examples/site-footer/family.tsx +28 -0
- package/registry/examples/switch/row.d.ts +4 -0
- package/registry/examples/switch/row.js +14 -0
- package/registry/examples/switch/row.tsx +13 -0
- package/registry/index.json +9 -9
- package/registry/map.json +1 -1
- package/registry/nav-bar.json +1 -1
- package/registry/rail-nav.json +1 -1
- package/registry/router.json +1 -1
- package/registry/shop.json +1 -1
- package/registry/site-footer.json +306 -5
- package/registry/switch.json +43 -6
- package/dist/chunk-CZHPWLNW.js.map +0 -1
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"`variant=\"docs\"` — under documentation pages: the same three lines on the documentation's width.",
|
|
29
29
|
"`variant=\"app\"` — inside a signed-in product or an admin console: the last line only (signature, version, legal), rendered once by the layout.",
|
|
30
30
|
"`config` — the footer as the app's admin configured it (`FooterSettings` in `@krizaka/settings`, resolved by `resolveFooterSettings`): at most four columns of at most six links, then one legal line `legalName · NEQ · city`, the version when `showVersion`, the legal links, the org's socials. `footerSettingsProblems` is the admin form's validation.",
|
|
31
|
+
"`FamilyFooter` — the developer sites (ui., lab., java., ts., rust.): pass `footer={footerFor(siteId)}` (`@krizaka/org` ≥ 1.4.0); the org says which family groups, accounts, source link, licence, legal links and version line the site shows. The library never fetches.",
|
|
31
32
|
"With `MarketingLayout`'s `footer` slot, under a bar of `@krizaka/ui/nav-bar` with `NavBar.Family`."
|
|
32
33
|
],
|
|
33
34
|
"whenNotToUse": [
|
|
@@ -65,8 +66,145 @@
|
|
|
65
66
|
],
|
|
66
67
|
"web": {
|
|
67
68
|
"entry": "@krizaka/ui/site-footer",
|
|
68
|
-
"import": "import { SiteFooter, SiteFooterColumn, SiteFooterLink, resolveFooterSettings, footerSettingsProblems, FOOTER_LIMITS } from \"@krizaka/ui/site-footer\";",
|
|
69
|
+
"import": "import { FamilyFooter, SiteFooter, SiteFooterColumn, SiteFooterLink, resolveFooterSettings, footerSettingsProblems, FOOTER_LIMITS } from \"@krizaka/ui/site-footer\";",
|
|
69
70
|
"props": [
|
|
71
|
+
{
|
|
72
|
+
"component": "FamilyFooter",
|
|
73
|
+
"description": "The family footer of a developer site: the shared three lines, from the org's selection.",
|
|
74
|
+
"props": [
|
|
75
|
+
{
|
|
76
|
+
"name": "current",
|
|
77
|
+
"type": "SiteId",
|
|
78
|
+
"default": null,
|
|
79
|
+
"description": "The site this footer belongs to: marked in the family.",
|
|
80
|
+
"required": true
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "footer",
|
|
84
|
+
"type": "FamilyFooterData",
|
|
85
|
+
"default": null,
|
|
86
|
+
"description": "`footerFor(siteId)` of `@krizaka/org`.",
|
|
87
|
+
"required": true
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "labels",
|
|
91
|
+
"type": "FamilyLabels",
|
|
92
|
+
"default": null,
|
|
93
|
+
"description": "The family's words, translated (`familyLabels[locale]`).",
|
|
94
|
+
"required": true
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "sourceLabel",
|
|
98
|
+
"type": "string",
|
|
99
|
+
"default": null,
|
|
100
|
+
"description": "« Source code » / « Code source », translated.",
|
|
101
|
+
"required": true
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "brand",
|
|
105
|
+
"type": "string",
|
|
106
|
+
"default": "Krizaka",
|
|
107
|
+
"description": "The company's name for the mark's accessible name.",
|
|
108
|
+
"required": false
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "children",
|
|
112
|
+
"type": "ReactNode",
|
|
113
|
+
"default": null,
|
|
114
|
+
"description": "The site's own link groups (`SiteFooter.Column`), on the first line.",
|
|
115
|
+
"required": false
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "controls",
|
|
119
|
+
"type": "ReactNode",
|
|
120
|
+
"default": null,
|
|
121
|
+
"description": "The host's controls at the end of the last line: the language switch, the theme toggle.",
|
|
122
|
+
"required": false
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "env",
|
|
126
|
+
"type": "string",
|
|
127
|
+
"default": null,
|
|
128
|
+
"description": "The environment, when it is not production (`DEV`).",
|
|
129
|
+
"required": false
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "extra",
|
|
133
|
+
"type": "ReactNode",
|
|
134
|
+
"default": null,
|
|
135
|
+
"description": "Extra links at the start of the legal group (a changelog link, for instance).",
|
|
136
|
+
"required": false
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "linkAs",
|
|
140
|
+
"type": "LinkComponent",
|
|
141
|
+
"default": "a",
|
|
142
|
+
"description": "The app's router link for the config's internal links (Next's `Link`).",
|
|
143
|
+
"required": false
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "path",
|
|
147
|
+
"type": "string",
|
|
148
|
+
"default": null,
|
|
149
|
+
"description": "The path of the page being read on this site (`/en/story`, `/blog/…`): the company link that points to this very\npage says so (`aria-current=\"page\"`) and a click on it scrolls to the top instead of reloading.",
|
|
150
|
+
"required": false
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "products",
|
|
154
|
+
"type": "readonly SiteId[]",
|
|
155
|
+
"default": null,
|
|
156
|
+
"description": "Only these products in the Products group (the current site always kept). Omit it to list every product.",
|
|
157
|
+
"required": false
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"name": "variant",
|
|
161
|
+
"type": "\"docs\" | \"app\" | \"site\"",
|
|
162
|
+
"default": "docs",
|
|
163
|
+
"description": "`site` — every public site. `docs` — the same under documentation, on its width. `app` — inside a signed-in product:\nthe last line only; render it once, in the layout.",
|
|
164
|
+
"required": false
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "version",
|
|
168
|
+
"type": "string",
|
|
169
|
+
"default": null,
|
|
170
|
+
"description": "The version the site runs (`1.2.3`); shown only when the footer's selection says so.",
|
|
171
|
+
"required": false
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"component": "FamilyFooter.Column",
|
|
177
|
+
"description": "One of the site's own link groups, inline on the first line: its heading, then its links.",
|
|
178
|
+
"props": [
|
|
179
|
+
{
|
|
180
|
+
"name": "title",
|
|
181
|
+
"type": "string",
|
|
182
|
+
"default": null,
|
|
183
|
+
"description": "The group's heading (“Docs”) — passed translated.",
|
|
184
|
+
"required": true
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"component": "FamilyFooter.Link",
|
|
190
|
+
"description": "A link of the footer.",
|
|
191
|
+
"props": [
|
|
192
|
+
{
|
|
193
|
+
"name": "active",
|
|
194
|
+
"type": "boolean",
|
|
195
|
+
"default": null,
|
|
196
|
+
"description": "The current page: `aria-current=\"page\"`.",
|
|
197
|
+
"required": false
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "asChild",
|
|
201
|
+
"type": "boolean",
|
|
202
|
+
"default": null,
|
|
203
|
+
"description": "Renders your router's `<Link>`.",
|
|
204
|
+
"required": false
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
},
|
|
70
208
|
{
|
|
71
209
|
"component": "SiteFooter",
|
|
72
210
|
"description": "The footer of a Krizaka site or app: at most three lines — its links, the family, then signature · version · legal.",
|
|
@@ -113,6 +251,13 @@
|
|
|
113
251
|
"description": "Shows the family on the second line, folded on a phone. The links to the other sites live on krizaka.com only\n(founder rule, 2026-10-30): every other site and its documentation opts in on purpose, none by default.",
|
|
114
252
|
"required": false
|
|
115
253
|
},
|
|
254
|
+
{
|
|
255
|
+
"name": "groups",
|
|
256
|
+
"type": "readonly SiteGroup[]",
|
|
257
|
+
"default": null,
|
|
258
|
+
"description": "Only these groups of the family, in reading order (`footerFor(id).groups` of `@krizaka/org`). Omit it to draw them all.",
|
|
259
|
+
"required": false
|
|
260
|
+
},
|
|
116
261
|
{
|
|
117
262
|
"name": "labels",
|
|
118
263
|
"type": "FamilyLabels",
|
|
@@ -286,6 +431,14 @@
|
|
|
286
431
|
"module": "@krizaka/ui/registry/examples/site-footer/socials",
|
|
287
432
|
"code": "import { SiteFooter } from \"@krizaka/ui/site-footer\";\nimport { familyLabels } from \"@krizaka/ui/sites\";\n\n// The company's accounts come from the org (`org.links.social` of `@krizaka/org`, a footer never types an address):\n// each known account (Instagram, YouTube) is drawn as its icon, named for screen readers.\nconst org = {\n brand: { name: \"Krizaka\" },\n footer: {\n line: { fr: \"Une entreprise de Technologies Krizaka · Fait à Montréal\", en: \"A Technologies Krizaka company · Made in Montréal\" },\n legal: [{ id: \"privacy\", label: { fr: \"Confidentialité\", en: \"Privacy\" }, url: { fr: \"#privacy\", en: \"#privacy\" } }],\n },\n links: {\n social: [\n { id: \"instagram\", label: \"Instagram\", url: \"https://www.instagram.com/krizakahq\" },\n { id: \"youtube\", label: \"YouTube\", url: \"https://www.youtube.com/@krizakahq\" },\n ],\n },\n};\n\nexport default function SiteFooterSocials() {\n return <SiteFooter current=\"verikora\" tone=\"cahier\" labels={familyLabels.en} org={org} version=\"1.2.3\" />;\n}\n"
|
|
288
433
|
},
|
|
434
|
+
{
|
|
435
|
+
"name": "family",
|
|
436
|
+
"title": "A developer site (from the org JSON)",
|
|
437
|
+
"description": "`FamilyFooter` with `footerFor(\"ui\")` of `@krizaka/org`: the site's own links, the family, then the source code, the licence, the legal links, the accounts and the version — what each developer site shows is the org's selection.",
|
|
438
|
+
"path": "examples/site-footer/family.tsx",
|
|
439
|
+
"module": "@krizaka/ui/registry/examples/site-footer/family",
|
|
440
|
+
"code": "import { FamilyFooter, type FamilyFooterData } from \"@krizaka/ui/site-footer\";\nimport { familyLabels } from \"@krizaka/ui/sites\";\n\n// A developer site (ui.krizaka.com): the footer is what `footerFor(\"ui\")` of `@krizaka/org` returns — pass it as is.\n// The block places the family, the source code, the licence, the legal links, the accounts and the version; the site adds its own links.\nconst footer: FamilyFooterData = {\n id: \"ui\",\n groups: [\n { group: \"products\", entries: [{ id: \"verikora\", name: \"Verikora\", group: \"products\", status: \"released\", url: \"https://www.verikora.com\" }] },\n { group: \"open-source\", entries: [{ id: \"ui\", name: \"Krizaka UI\", group: \"open-source\", status: \"released\", url: \"https://ui.krizaka.com\" }] },\n ],\n social: [{ id: \"instagram\", label: \"Instagram\", url: \"https://www.instagram.com/krizakahq\" }],\n source: \"https://github.com/krizaka/krizaka-ui\",\n license: \"Apache-2.0\",\n legal: [{ id: \"privacy\", label: { fr: \"Confidentialité\", en: \"Privacy\" }, url: { fr: \"#privacy\", en: \"#privacy\" } }],\n line: { fr: \"Une entreprise de Technologies Krizaka · Fait à Montréal\", en: \"A Technologies Krizaka company · Made in Montréal\" },\n version: true,\n};\n\nexport default function SiteFooterFamily() {\n return (\n <FamilyFooter footer={footer} current=\"ui\" labels={familyLabels.en} sourceLabel=\"Source code\" version=\"2.0.0\">\n <FamilyFooter.Column title=\"Docs\">\n <FamilyFooter.Link href=\"#components\">Components</FamilyFooter.Link>\n </FamilyFooter.Column>\n </FamilyFooter>\n );\n}\n"
|
|
441
|
+
},
|
|
289
442
|
{
|
|
290
443
|
"name": "docs",
|
|
291
444
|
"title": "Under documentation",
|
|
@@ -362,26 +515,30 @@
|
|
|
362
515
|
"path": "meta.ts",
|
|
363
516
|
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"columns\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"copy-button\"\n | \"money-input\"\n | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"waveform\"\n | \"proposal\"\n | \"qr-code\"\n | \"identity-card\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Sovkora Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the thirteen domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"abuse\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
364
517
|
},
|
|
518
|
+
{
|
|
519
|
+
"path": "site-footer/family-footer.tsx",
|
|
520
|
+
"content": "// The footer of the developer sites (ui. · lab. · java. · ts. · rust.): ONE block that reads what a site shows from the\n// org JSON (`footerFor(siteId)` of `@krizaka/org` ≥ 1.4.0) and places it — the family, the source code, the licence, the\n// legal links, the socials, the version. The library does not fetch and types no word of the content: it takes the\n// resolved footer as a prop; the host passes only its own links (`children`), its version and its controls.\nimport * as React from \"react\";\n\nimport type { FamilyLabels, OrgFamilyEntry, SiteGroup, SiteId, SiteLocale } from \"../sites/sites\";\nimport type { OrgSocialLink } from \"./footer-config\";\nimport { SiteFooter, SiteFooterColumn, SiteFooterLink, type SiteFooterProps } from \"./site-footer\";\n\n/** What `footerFor(siteId)` of `@krizaka/org` returns, structurally: the whole `ResolvedFooter` fits. */\nexport interface FamilyFooterData {\n id: string;\n groups: readonly { group: SiteGroup; entries: readonly OrgFamilyEntry[] }[];\n social: readonly OrgSocialLink[];\n /** The site's source-code address; `null` shows none. */\n source: string | null;\n /** The licence's name (`Apache-2.0`); `null` shows none. */\n license: string | null;\n legal: readonly { id: string; label: Record<SiteLocale, string>; url: Record<SiteLocale, string> }[];\n line: Record<SiteLocale, string>;\n /** Whether the version line shows (when the host passes `version`). */\n version: boolean;\n}\n\nexport type FamilyFooterProps = Omit<SiteFooterProps, \"current\" | \"org\" | \"legal\" | \"groups\" | \"family\" | \"config\" | \"version\" | \"labels\" | \"tone\"> & {\n /** `footerFor(siteId)` of `@krizaka/org`. */\n footer: FamilyFooterData;\n /** The site this footer belongs to: marked in the family. */\n current: SiteId;\n /** The family's words, translated (`familyLabels[locale]`). */\n labels: FamilyLabels;\n /** « Source code » / « Code source », translated. */\n sourceLabel: string;\n /** The version the site runs (`1.2.3`); shown only when the footer's selection says so. */\n version?: string;\n /** The company's name for the mark's accessible name. @default \"Krizaka\" */\n brand?: string;\n /** Extra links at the start of the legal group (a changelog link, for instance). */\n extra?: React.ReactNode;\n};\n\n/** The family footer of a developer site: the shared three lines, from the org's selection. */\nexport function FamilyFooter({ footer, current, labels, sourceLabel, version, brand = \"Krizaka\", extra, variant = \"docs\", children, ...props }: FamilyFooterProps) {\n const lang = labels.lang ?? \"en\";\n const entries = footer.groups.flatMap((g) => g.entries);\n const org = {\n brand: { name: brand },\n links: { social: footer.social },\n family: entries,\n footer: { line: footer.line, legal: footer.legal },\n };\n return (\n <SiteFooter\n {...props}\n current={current}\n tone=\"cahier\"\n variant={variant}\n labels={labels}\n org={org}\n family\n groups={footer.groups.map((g) => g.group)}\n version={footer.version ? version : undefined}\n legal={\n <>\n {footer.source && (\n <SiteFooterLink href={footer.source} target=\"_blank\" rel=\"noopener noreferrer\">\n {sourceLabel}\n </SiteFooterLink>\n )}\n {footer.license && <span>{footer.license}</span>}\n {extra}\n {footer.legal.map((l) => (\n <SiteFooterLink key={l.id} href={l.url[lang]}>\n {l.label[lang]}\n </SiteFooterLink>\n ))}\n </>\n }\n >\n {children}\n </SiteFooter>\n );\n}\n\nFamilyFooter.Column = SiteFooterColumn;\nFamilyFooter.Link = SiteFooterLink;\n"
|
|
521
|
+
},
|
|
365
522
|
{
|
|
366
523
|
"path": "site-footer/footer-config.ts",
|
|
367
524
|
"content": "// The footer as the admin configures it (krizaka-internal#591): the settings an app stores (`@krizaka/settings`, audited)\n// — words as message keys, so FR and EN come from the app's catalogues — and the resolved config `SiteFooter` draws.\n// Pure: no React, no fetch. The structure is the design rule (founder, 2026-11-01): a few short columns, then one legal\n// line that names the company once.\nimport type { SiteStatus } from \"../sites/sites\";\n\n/** At most four columns of at most six links: past that a footer is a sitemap, and nobody reads it. */\nexport const FOOTER_LIMITS = { columns: 4, links: 6, legalLinks: 4 } as const;\n\n/** A status said once, on a column's heading (never on each link). */\nexport type FooterStatus = Exclude<SiteStatus, \"released\">;\n\n/** A link, its words resolved. `external`: it leaves this site (a plain `<a>`, never the router). */\nexport type FooterLink = { label: string; href: string; external?: boolean };\n\n/** A column, its words resolved. */\nexport type FooterColumn = { id: string; title: string; status?: FooterStatus; links: readonly FooterLink[] };\n\n/** The legal line: who publishes the site, once — `legalName · NEQ … · city`, then the version and the legal links. */\nexport type FooterLegal = {\n legalName: string;\n /** The Québec enterprise number, shown as the publisher's legal identity (`NEQ 1182652231`). */\n neq?: string;\n city: string;\n showVersion: boolean;\n /** Where the version leads (the release's page), when it is a link. */\n versionHref?: string;\n links: readonly FooterLink[];\n};\n\n/** What `SiteFooter` draws from `config`: the columns, then the legal line and the socials. */\nexport type SiteFooterConfig = {\n /** The name of the columns' navigation (« Pied de page » / « Footer »). */\n label: string;\n columns: readonly FooterColumn[];\n legal: FooterLegal;\n social?: readonly { id: string; label: string; href: string }[];\n};\n\n/** A stored link: a message key (`labelKey`) or a proper noun the same in every language (`label`: « Verikora », « GitHub »). */\nexport type FooterLinkSetting = ({ labelKey: string; label?: never } | { label: string; labelKey?: never }) & {\n href: string;\n external?: boolean;\n};\n\n/** The footer as an app stores it in its settings. */\nexport type FooterSettings = {\n labelKey: string;\n columns: readonly { id: string; titleKey: string; status?: FooterStatus; links: readonly FooterLinkSetting[] }[];\n legal: { legalName: string; neq?: string; city: string; showVersion: boolean; versionHref?: string; links: readonly FooterLinkSetting[] };\n /** The ids of the org's social links (`@krizaka/org`) to show; their addresses are the org's, never typed here. */\n social?: readonly string[];\n};\n\n/** A social link of the org (`@krizaka/org` `links.social`). */\nexport type OrgSocialLink = { id: string; label: string; url: string };\n\nconst link = (l: FooterLinkSetting, t: (key: string) => string): FooterLink => ({\n label: l.labelKey === undefined ? l.label! : t(l.labelKey),\n href: l.href,\n ...(l.external ? { external: true } : {}),\n});\n\n/** The settings, their words read from the app's messages (`t`) and the socials from the org's list. */\nexport function resolveFooterSettings(\n settings: FooterSettings,\n t: (key: string) => string,\n social: readonly OrgSocialLink[] = [],\n): SiteFooterConfig {\n const shown = (settings.social ?? []).flatMap((id) => social.filter((s) => s.id === id));\n return {\n label: t(settings.labelKey),\n columns: settings.columns.map((c) => ({\n id: c.id,\n title: t(c.titleKey),\n ...(c.status ? { status: c.status } : {}),\n links: c.links.map((l) => link(l, t)),\n })),\n legal: { ...settings.legal, links: settings.legal.links.map((l) => link(l, t)) },\n ...(shown.length > 0 ? { social: shown.map((s) => ({ id: s.id, label: s.label, href: s.url })) } : {}),\n };\n}\n\n/**\n * What is wrong with a footer's settings — the admin's form refuses to save while the list is not empty: too many\n * columns or links, a link twice, an empty column, an `http:` or a development address, a malformed NEQ.\n */\nexport function footerSettingsProblems(settings: FooterSettings): string[] {\n return [...limitProblems(settings), ...linkProblems(settings), ...legalProblems(settings)];\n}\n\nfunction limitProblems(settings: FooterSettings): string[] {\n const problems: string[] = [];\n if (settings.columns.length > FOOTER_LIMITS.columns) problems.push(`at most ${FOOTER_LIMITS.columns} columns`);\n if (settings.legal.links.length > FOOTER_LIMITS.legalLinks) problems.push(`at most ${FOOTER_LIMITS.legalLinks} legal links`);\n for (const c of settings.columns) {\n if (c.links.length === 0) problems.push(`column ${c.id}: no link`);\n if (c.links.length > FOOTER_LIMITS.links) problems.push(`column ${c.id}: at most ${FOOTER_LIMITS.links} links`);\n }\n return problems;\n}\n\nfunction hrefProblems(where: string, l: { href: string; external?: boolean }): string[] {\n const problems: string[] = [];\n if (/^http:/i.test(l.href)) problems.push(`${where}: ${l.href} is not https`);\n if (/^https?:\\/\\/dev\\./i.test(l.href)) problems.push(`${where}: ${l.href} is a development host`);\n if (l.external && !/^[a-z][a-z0-9+.-]*:/i.test(l.href)) problems.push(`${where}: ${l.href} is external but relative`);\n return problems;\n}\n\nfunction linkProblems(settings: FooterSettings): string[] {\n const problems: string[] = [];\n const seen = new Set<string>();\n const all = [...settings.columns.flatMap((c) => c.links.map((l) => ({ where: c.id, l }))), ...settings.legal.links.map((l) => ({ where: \"legal\", l }))];\n for (const { where, l } of all) {\n if (seen.has(l.href)) problems.push(`${where}: ${l.href} is already in the footer`);\n seen.add(l.href);\n problems.push(...hrefProblems(where, l));\n }\n return problems;\n}\n\nfunction legalProblems(settings: FooterSettings): string[] {\n const problems: string[] = [];\n if (settings.legal.neq !== undefined && !/^\\d{10}$/.test(settings.legal.neq)) problems.push(\"legal: the NEQ has ten digits\");\n if (settings.legal.legalName.trim() === \"\") problems.push(\"legal: the legal name is required\");\n return problems;\n}\n"
|
|
368
525
|
},
|
|
369
526
|
{
|
|
370
527
|
"path": "site-footer/index.ts",
|
|
371
|
-
"content": "/** @krizaka/ui/site-footer — `SiteFooter` (with `.Column`, `.Link`), `SiteFooterColumn`, `SiteFooterLink`, `siteFooter`. Client. */\nexport {\n FOOTER_LIMITS,\n type FooterColumn,\n type FooterLegal,\n type FooterLink,\n type FooterLinkSetting,\n type FooterSettings,\n footerSettingsProblems,\n type FooterStatus,\n type OrgSocialLink,\n resolveFooterSettings,\n type SiteFooterConfig,\n} from \"./footer-config\";\nexport {\n SiteFooter,\n siteFooter,\n SiteFooterColumn,\n type SiteFooterColumnProps,\n SiteFooterLink,\n type SiteFooterLinkProps,\n type SiteFooterProps,\n} from \"./site-footer\";\n"
|
|
528
|
+
"content": "/** @krizaka/ui/site-footer — `FamilyFooter` (the developer sites' block, from `footerFor`), `SiteFooter` (with `.Column`, `.Link`), `SiteFooterColumn`, `SiteFooterLink`, `siteFooter`. Client. */\nexport { FamilyFooter, type FamilyFooterData, type FamilyFooterProps } from \"./family-footer\";\nexport {\n FOOTER_LIMITS,\n type FooterColumn,\n type FooterLegal,\n type FooterLink,\n type FooterLinkSetting,\n type FooterSettings,\n footerSettingsProblems,\n type FooterStatus,\n type OrgSocialLink,\n resolveFooterSettings,\n type SiteFooterConfig,\n} from \"./footer-config\";\nexport {\n SiteFooter,\n siteFooter,\n SiteFooterColumn,\n type SiteFooterColumnProps,\n SiteFooterLink,\n type SiteFooterLinkProps,\n type SiteFooterProps,\n} from \"./site-footer\";\n"
|
|
372
529
|
},
|
|
373
530
|
{
|
|
374
531
|
"path": "site-footer/meta.ts",
|
|
375
|
-
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Site footer\",\n summary:\n \"The footer of every Krizaka site and app, compact: at most three lines on a desktop. The site's own links, the family grouped inline (names from `org.family`; shown on krizaka.com, opt-in elsewhere), then the signature, version, legal links and the host's controls.\",\n status: \"beta\",\n category: \"navigation\",\n domain: \"navigation-shell\",\n platforms: \"web\",\n parity: { native: { status: \"n/a\", reason: \"A site's footer; an app has none.\" }, desktop: { status: \"n/a\", reason: \"A public site's page, not a window of the Mac app.\" } },\n whenToUse: [\n \"The bottom of every page of every Krizaka site — www, blog, ui., java., ts., lab. (`tone=\\\"cahier\\\"`) and the products' sites (`tone=\\\"product\\\"`): pass `org` from `@krizaka/org`, so every name, address, signature and legal link is the org's.\",\n \"`variant=\\\"docs\\\"` — under documentation pages: the same three lines on the documentation's width.\",\n \"`variant=\\\"app\\\"` — inside a signed-in product or an admin console: the last line only (signature, version, legal), rendered once by the layout.\",\n \"`config` — the footer as the app's admin configured it (`FooterSettings` in `@krizaka/settings`, resolved by `resolveFooterSettings`): at most four columns of at most six links, then one legal line `legalName · NEQ · city`, the version when `showVersion`, the legal links, the org's socials. `footerSettingsProblems` is the admin form's validation.\",\n \"With `MarketingLayout`'s `footer` slot, under a bar of `@krizaka/ui/nav-bar` with `NavBar.Family`.\",\n ],\n whenNotToUse: [\n { when: \"Twice on one page: a page that already sits under a layout's footer renders none of its own (one `contentinfo` per page).\", use: \"marketing-layout\" },\n { when: \"To list the family in the bar.\", use: \"nav-bar\" },\n ],\n bestPractices: [\n \"Pass `org` (`org` of `@krizaka/org`): the family's names come from `org.family` — the company « Krizaka », products by their own name, libraries « Krizaka <X> » — and the signature is `org.footer.line`. Never type a family name or the legal line in a site.\",\n \"One or two own groups (`SiteFooter.Column` + `SiteFooter.Link`), a handful of links: what a reader looks for at the bottom (docs, pricing, download, source). Never a link the family line already holds — another site, the story, the blog, contact.\",\n \"Pass the version the site runs (`version`, `env=\\\"DEV\\\"` on a dev environment) and the language switch and theme toggle in `controls`.\",\n \"With `config`, name the company once: the legal line is the publisher's identity; no « A Technologies Krizaka company » beside it, no column that repeats the bar, no newsletter form, no package version, no development host.\",\n \"The company's accounts are the org's (`org.links.social`; with `config`, the ids the admin picked, resolved by `resolveFooterSettings`): each is drawn as its icon from `@krizaka/icons` (`instagram`) beside the legal links, never typed in a site. An account with no glyph stays a text link.\",\n \"Pass the words translated: `labels={familyLabels[locale]}` from `@krizaka/ui/sites`.\",\n ],\n accessibility: {\n keyboard: [],\n notes: [\n \"A `footer` landmark; the family is a `nav` named by `labels.family`, each group a list named by its heading.\",\n \"On a phone each family group is a native `<details>` (keyboard and screen readers for free, 44 px targets); on a desktop it stays open as one line.\",\n \"The current site says `aria-current=\\\"true\\\"` and “You are here” to screen readers; a status is written, never only a colour.\",\n \"A social account is a link named by the account (« Instagram », written for screen readers) around a decorative icon; it opens in a new tab (`rel=\\\"noopener noreferrer\\\"`), shows the 2 px focus ring and only changes colour on hover.\",\n \"The marks are decorative: every site's name is written beside its mark.\",\n ],\n },\n related: [\"sites\", \"nav-bar\", \"marketing-layout\"],\n web: {\n imports: [\"SiteFooter\", \"SiteFooterColumn\", \"SiteFooterLink\", \"resolveFooterSettings\", \"footerSettingsProblems\", \"FOOTER_LIMITS\"],\n examples: [\n { name: \"product\", title: \"A product\", description: \"www.verikora.com: its links on one line, the family on the second, then the org's line, `DEV · v1.2.3`, the legal links and the language switch.\" },\n { name: \"company\", title: \"The company (Cahier)\", description: \"www.krizaka.com, `tone=\\\"cahier\\\"`: no own links needed, the family and the signature line.\" },\n { name: \"app\", title: \"In a signed-in app\", description: \"`variant=\\\"app\\\"`: one slim line — the org's line, `DEV · v1.2.3`, the legal links.\" },\n { name: \"configured\", title: \"Configured by the admin\", description: \"`config` from the app's settings: three columns (the product, help, by Krizaka), then `Technologies Krizaka Inc. · NEQ … · Montréal (Québec)`, `v1.2.3`, the legal links and GitHub.\" },\n { name: \"socials\", title: \"With the company's accounts\", description: \"`org.links.social` of `@krizaka/org`: Instagram drawn as its icon at the end of the last line, named « Instagram » for screen readers.\" },\n { name: \"docs\", title: \"Under documentation\", description: \"`variant=\\\"docs\\\"`: the same three lines on the documentation's width.\" },\n { name: \"open-source-fr\", title: \"Open source, in French\", description: \"ui.krizaka.com in French, `tone=\\\"cahier\\\"`: « Une entreprise de Technologies Krizaka · Fait à Montréal », the version of the packages.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
532
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Site footer\",\n summary:\n \"The footer of every Krizaka site and app, compact: at most three lines on a desktop. The site's own links, the family grouped inline (names from `org.family`; shown on krizaka.com, opt-in elsewhere), then the signature, version, legal links and the host's controls.\",\n status: \"beta\",\n category: \"navigation\",\n domain: \"navigation-shell\",\n platforms: \"web\",\n parity: { native: { status: \"n/a\", reason: \"A site's footer; an app has none.\" }, desktop: { status: \"n/a\", reason: \"A public site's page, not a window of the Mac app.\" } },\n whenToUse: [\n \"The bottom of every page of every Krizaka site — www, blog, ui., java., ts., lab. (`tone=\\\"cahier\\\"`) and the products' sites (`tone=\\\"product\\\"`): pass `org` from `@krizaka/org`, so every name, address, signature and legal link is the org's.\",\n \"`variant=\\\"docs\\\"` — under documentation pages: the same three lines on the documentation's width.\",\n \"`variant=\\\"app\\\"` — inside a signed-in product or an admin console: the last line only (signature, version, legal), rendered once by the layout.\",\n \"`config` — the footer as the app's admin configured it (`FooterSettings` in `@krizaka/settings`, resolved by `resolveFooterSettings`): at most four columns of at most six links, then one legal line `legalName · NEQ · city`, the version when `showVersion`, the legal links, the org's socials. `footerSettingsProblems` is the admin form's validation.\",\n \"`FamilyFooter` — the developer sites (ui., lab., java., ts., rust.): pass `footer={footerFor(siteId)}` (`@krizaka/org` ≥ 1.4.0); the org says which family groups, accounts, source link, licence, legal links and version line the site shows. The library never fetches.\",\n \"With `MarketingLayout`'s `footer` slot, under a bar of `@krizaka/ui/nav-bar` with `NavBar.Family`.\",\n ],\n whenNotToUse: [\n { when: \"Twice on one page: a page that already sits under a layout's footer renders none of its own (one `contentinfo` per page).\", use: \"marketing-layout\" },\n { when: \"To list the family in the bar.\", use: \"nav-bar\" },\n ],\n bestPractices: [\n \"Pass `org` (`org` of `@krizaka/org`): the family's names come from `org.family` — the company « Krizaka », products by their own name, libraries « Krizaka <X> » — and the signature is `org.footer.line`. Never type a family name or the legal line in a site.\",\n \"One or two own groups (`SiteFooter.Column` + `SiteFooter.Link`), a handful of links: what a reader looks for at the bottom (docs, pricing, download, source). Never a link the family line already holds — another site, the story, the blog, contact.\",\n \"Pass the version the site runs (`version`, `env=\\\"DEV\\\"` on a dev environment) and the language switch and theme toggle in `controls`.\",\n \"With `config`, name the company once: the legal line is the publisher's identity; no « A Technologies Krizaka company » beside it, no column that repeats the bar, no newsletter form, no package version, no development host.\",\n \"The company's accounts are the org's (`org.links.social`; with `config`, the ids the admin picked, resolved by `resolveFooterSettings`): each is drawn as its icon from `@krizaka/icons` (`instagram`) beside the legal links, never typed in a site. An account with no glyph stays a text link.\",\n \"Pass the words translated: `labels={familyLabels[locale]}` from `@krizaka/ui/sites`.\",\n ],\n accessibility: {\n keyboard: [],\n notes: [\n \"A `footer` landmark; the family is a `nav` named by `labels.family`, each group a list named by its heading.\",\n \"On a phone each family group is a native `<details>` (keyboard and screen readers for free, 44 px targets); on a desktop it stays open as one line.\",\n \"The current site says `aria-current=\\\"true\\\"` and “You are here” to screen readers; a status is written, never only a colour.\",\n \"A social account is a link named by the account (« Instagram », written for screen readers) around a decorative icon; it opens in a new tab (`rel=\\\"noopener noreferrer\\\"`), shows the 2 px focus ring and only changes colour on hover.\",\n \"The marks are decorative: every site's name is written beside its mark.\",\n ],\n },\n related: [\"sites\", \"nav-bar\", \"marketing-layout\"],\n web: {\n imports: [\"FamilyFooter\", \"SiteFooter\", \"SiteFooterColumn\", \"SiteFooterLink\", \"resolveFooterSettings\", \"footerSettingsProblems\", \"FOOTER_LIMITS\"],\n examples: [\n { name: \"product\", title: \"A product\", description: \"www.verikora.com: its links on one line, the family on the second, then the org's line, `DEV · v1.2.3`, the legal links and the language switch.\" },\n { name: \"company\", title: \"The company (Cahier)\", description: \"www.krizaka.com, `tone=\\\"cahier\\\"`: no own links needed, the family and the signature line.\" },\n { name: \"app\", title: \"In a signed-in app\", description: \"`variant=\\\"app\\\"`: one slim line — the org's line, `DEV · v1.2.3`, the legal links.\" },\n { name: \"configured\", title: \"Configured by the admin\", description: \"`config` from the app's settings: three columns (the product, help, by Krizaka), then `Technologies Krizaka Inc. · NEQ … · Montréal (Québec)`, `v1.2.3`, the legal links and GitHub.\" },\n { name: \"socials\", title: \"With the company's accounts\", description: \"`org.links.social` of `@krizaka/org`: Instagram drawn as its icon at the end of the last line, named « Instagram » for screen readers.\" },\n { name: \"family\", title: \"A developer site (from the org JSON)\", description: \"`FamilyFooter` with `footerFor(\\\"ui\\\")` of `@krizaka/org`: the site's own links, the family, then the source code, the licence, the legal links, the accounts and the version — what each developer site shows is the org's selection.\" },\n { name: \"docs\", title: \"Under documentation\", description: \"`variant=\\\"docs\\\"`: the same three lines on the documentation's width.\" },\n { name: \"open-source-fr\", title: \"Open source, in French\", description: \"ui.krizaka.com in French, `tone=\\\"cahier\\\"`: « Une entreprise de Technologies Krizaka · Fait à Montréal », the version of the packages.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
376
533
|
},
|
|
377
534
|
{
|
|
378
535
|
"path": "site-footer/site-footer.tsx",
|
|
379
|
-
"content": "// Client (the mark holds an id). The footer shared by every site and app of the Krizaka family — compact (founder,\n// 2026-10-30, krizaka/krizaka-internal#754: « des footers de 10 lignes »): at most three lines on a desktop —\n// 1. the site's own links, each group inline (`Docs Get started · Components`);\n// 2. the family, grouped inline (Products · Open source · Krizaka), names read from `org.family` of `@krizaka/org`;\n// 3. one line: the mark and the org's signature, the version, the legal links, the host's controls (language, theme).\n// On a phone the family's groups fold (`<details>`), the rest wraps. `variant=\"app\"` keeps line 3 only. Same structure on\n// the Cahier sites and the products (`tone`). No link twice, no site block, no names typed here when `org` is given.\nimport { InstagramIcon, YoutubeIcon } from \"@krizaka/icons\";\nimport { Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\n// ProductLogo, not KrizakaLogo: one import path keeps every mark in one shared chunk (KrizakaLogo alone split it: +871 B gzip on the typical page).\nimport type { LinkComponent } from \"../block-link\";\nimport { ProductLogo } from \"../marks/ProductLogo\";\nimport { columnStatus, familyGroups, orgIdOf } from \"../sites/family-groups\";\nimport { companyLinks, type FamilyLabels, familyLabels, type OrgFacts, siteById, type SiteId, type SiteStatus } from \"../sites/sites\";\nimport type { FooterLink, SiteFooterConfig } from \"./footer-config\";\n\nexport const siteFooter = tv({\n slots: {\n root: \"w-full border-t border-border-subtle bg-surface-0 text-fg\",\n inner:\n \"mx-auto grid w-full max-w-[calc(var(--kz-page-max,72rem)_+_2*var(--kz-page-gutter,clamp(16px,3.2vw,32px)))] grid-cols-[minmax(0,1fr)] gap-3 px-[var(--kz-page-gutter,clamp(16px,3.2vw,32px))] py-6\",\n row: \"flex min-w-0 flex-wrap items-baseline gap-x-6 gap-y-2\",\n family: \"grid min-w-0 grid-cols-[minmax(0,1fr)] gap-1 lg:flex lg:flex-wrap lg:items-baseline lg:gap-x-6 lg:gap-y-2\",\n group:\n \"group/fold min-w-0 lg:[&::details-content]:[content-visibility:visible] lg:[&::details-content]:contents lg:[&>summary]:pointer-events-none lg:inline-flex lg:items-baseline lg:gap-2\",\n summary:\n \"flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md text-xs font-semibold text-fg-secondary [&::-webkit-details-marker]:hidden \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring lg:inline lg:min-h-0 lg:cursor-default\",\n chevron: \"size-4 shrink-0 transition-transform group-open/fold:rotate-180 motion-reduce:transition-none lg:hidden\",\n column: \"inline-flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1\",\n title: \"text-xs font-semibold text-fg-secondary\",\n note: \"font-normal\",\n list: \"flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1 pb-2 lg:pb-0\",\n link:\n \"inline-flex min-h-6 min-w-0 items-center rounded-md text-sm [overflow-wrap:anywhere] text-fg-secondary no-underline transition-colors hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current=page]:text-fg aria-[current=page]:font-semibold aria-[current=true]:text-fg aria-[current=true]:font-semibold\",\n bottom: \"flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-fg-secondary\",\n signature:\n \"inline-flex items-center gap-2 rounded-md font-medium text-fg no-underline hover:text-fg-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n version:\n \"rounded-sm border border-border-subtle bg-surface-2 px-2 py-0.5 font-mono text-[11px] text-fg-secondary\",\n legal: \"flex flex-wrap items-center gap-x-4 gap-y-2\",\n controls: \"flex flex-wrap items-center gap-2 sm:ml-auto\",\n // `config`: real columns — two on a phone, side by side from `sm`, each a heading over a stacked list.\n columns: \"grid min-w-0 grid-cols-2 gap-x-6 gap-y-6 pb-2 sm:grid-flow-col sm:grid-cols-none sm:auto-cols-[minmax(0,13rem)] sm:gap-x-10\",\n stack: \"flex min-w-0 flex-col gap-2\",\n stackList: \"flex min-w-0 flex-col gap-1\",\n identity: \"text-fg-secondary\",\n // The accounts drawn as their icon (the name stays for screen readers): colour change only on hover, never movement.\n socials: \"flex flex-wrap items-center gap-x-3 gap-y-2\",\n social:\n \"inline-flex min-h-6 min-w-6 items-center justify-center rounded-md text-fg-secondary no-underline transition-colors hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n variants: {\n // `site`: the three lines. `docs`: the same on the documentation's width. `app`: line 3 only, inside a signed-in product.\n variant: {\n site: {},\n docs: {\n inner: \"max-w-[calc(var(--kz-page-max-docs,88rem)_+_2*var(--kz-page-gutter,clamp(16px,3.2vw,32px)))]\",\n },\n app: {\n root: \"bg-transparent\",\n inner: \"py-3\",\n },\n },\n // `product`: the products' plain Krizaka UI. `cahier`: the Cahier sites (www, blog, ui., java., ts., lab.) — the\n // headings in the Cahier's hand; the structure is the same.\n tone: {\n product: {},\n cahier: {\n title: \"font-[family-name:var(--kz-font-display,inherit)] italic\",\n summary: \"font-[family-name:var(--kz-font-display,inherit)] italic\",\n },\n },\n },\n defaultVariants: { variant: \"site\", tone: \"product\" },\n});\n\nconst bare = (p: string) => p.replace(/^\\/(en|fr)(?=\\/|$)/, \"\").replace(/\\/+$/, \"\") || \"/\";\n\n/** Is `href` (an absolute family address) the page `path` of the site at `siteUrl`? Locale prefix and trailing slash do not count. */\nfunction isThisPage(href: string, siteUrl: string, path: string): boolean {\n try {\n const target = new URL(href);\n return target.host === new URL(siteUrl).host && bare(target.pathname) === bare(path.split(/[?#]/)[0]!);\n } catch {\n return false;\n }\n}\n\n/** The link to the page you are on: no reload, back to the top (the browser would otherwise keep or restore the scroll). */\nfunction backToTop(event: React.MouseEvent<HTMLAnchorElement>) {\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.button !== 0) return;\n event.preventDefault();\n window.scrollTo({ top: 0, behavior: \"auto\" });\n}\n\ntype Tone = \"product\" | \"cahier\";\nconst ToneContext = React.createContext<Tone>(\"product\");\n\nexport type SiteFooterProps = Omit<React.ComponentProps<\"footer\">, \"children\"> & {\n /** The site this footer belongs to (`@krizaka/ui/sites`): marked in the family, its address for `path`. */\n current: SiteId;\n /**\n * The family's words, passed translated: `familyLabels.fr` from `@krizaka/ui/sites`, or your own of the same shape.\n * @default familyLabels.en\n */\n labels?: FamilyLabels;\n /** The site's own link groups (`SiteFooter.Column`), on the first line. */\n children?: React.ReactNode;\n /** The version the site runs (`1.2.3`, shown `v1.2.3`). */\n version?: string;\n /** The environment, when it is not production (`DEV`). */\n env?: string;\n /**\n * The path of the page being read on this site (`/en/story`, `/blog/…`): the company link that points to this very\n * page says so (`aria-current=\"page\"`) and a click on it scrolls to the top instead of reloading.\n */\n path?: string;\n /**\n * Shows the family on the second line, folded on a phone. The links to the other sites live on krizaka.com only\n * (founder rule, 2026-10-30): every other site and its documentation opts in on purpose, none by default.\n * @default current === \"krizaka\" (and never in `variant=\"app\"`)\n */\n family?: boolean;\n /** Only these products in the Products group (the current site always kept). Omit it to list every product. */\n products?: readonly SiteId[];\n /**\n * The organisation's public facts (`org` of `@krizaka/org`) — pass them on every site. The names and addresses of the\n * family are then `org.family`, the signature is `org.footer.line` (« Une entreprise de Technologies Krizaka · Fait à\n * Montréal », the same everywhere) and, without `legal`, the legal links are `org.footer.legal`.\n */\n org?: OrgFacts;\n /** The legal links, when not the org's (`SiteFooter.Link`s). */\n legal?: React.ReactNode;\n /** The host's controls at the end of the last line: the language switch, the theme toggle. */\n controls?: React.ReactNode;\n /**\n * `site` — every public site. `docs` — the same under documentation, on its width. `app` — inside a signed-in product:\n * the last line only; render it once, in the layout.\n * @default \"site\"\n */\n variant?: \"site\" | \"docs\" | \"app\";\n /** `cahier` on the Cahier sites (www, blog, ui., java., ts., lab.), `product` in the products. @default \"product\" */\n tone?: Tone;\n /**\n * The footer as the admin configured it (`resolveFooterSettings` of the app's settings): its columns, then one legal\n * line — `legalName · NEQ … · city`, the version when `showVersion`, the legal links, the socials. With it the family\n * is not drawn (the columns hold what the site wants) and the org's signature gives way to the legal identity.\n */\n config?: SiteFooterConfig;\n /** The app's router link for the config's internal links (Next's `Link`). @default \"a\" */\n linkAs?: LinkComponent;\n};\n\nfunction currentMark(atHome: boolean, isCurrent: boolean): \"page\" | \"true\" | undefined {\n if (atHome) return \"page\";\n return isCurrent ? \"true\" : undefined;\n}\n\nconst NO_STATUS = { shared: null, exceptions: new Map<string, Exclude<SiteStatus, \"released\">>() } as const;\n\n/** The footer of a Krizaka site or app: at most three lines — its links, the family, then signature · version · legal. */\nexport function SiteFooter({\n current,\n labels = familyLabels.en,\n children,\n version,\n env,\n path,\n legal: legalProp,\n controls,\n org,\n family: familyProp,\n products,\n variant = \"site\",\n tone = \"product\",\n config,\n linkAs,\n className,\n ...props\n}: SiteFooterProps) {\n const id = React.useId();\n const s = siteFooter({ variant, tone });\n const slim = variant === \"app\";\n const family = !slim && (familyProp ?? (current === \"krizaka\" && !config));\n const site = siteById(current);\n const krizaka = siteById(\"krizaka\");\n const currentId = orgIdOf(current);\n const tag = [env, version && `v${version.replace(/^v/, \"\")}`].filter(Boolean).join(\" · \");\n const own = !slim && React.Children.toArray(children).length > 0;\n const lang = labels.lang ?? \"en\";\n const company = labels.company ?? familyLabels.en.company!;\n const legal =\n legalProp ??\n (org && (\n <>\n {org.footer.legal.map((l) => (\n <SiteFooterLink key={l.id} href={l.url[lang]}>\n {l.label[lang]}\n </SiteFooterLink>\n ))}\n </>\n ));\n const here = (href: string) => path !== undefined && isThisPage(href, site.url, path);\n const productIds = products?.map(orgIdOf);\n // Products · Open source (GitHub closes it) · Krizaka (the company's pages; its home is the signature's link).\n const groups = familyGroups(org);\n const columns = [\n ...groups\n .filter((g) => g.group === \"products\")\n .map((g) => ({ ...g, entries: productIds ? g.entries.filter((e) => productIds.includes(e.id) || e.id === currentId) : g.entries })),\n { group: \"open-source\" as const, entries: groups.filter((g) => g.group === \"open-source\" || g.group === \"github\").flatMap((g) => g.entries) },\n ];\n const companyEntries = companyLinks.map((l) => ({ id: l.id, name: company[l.id], url: l.url[lang] }));\n return (\n <ToneContext.Provider value={tone}>\n <footer className={s.root({ className })} {...props}>\n <div className={s.inner()}>\n {own && <div className={s.row()}>{children}</div>}\n {config && !slim && <ConfigColumns s={s} config={config} id={id} labels={labels} linkAs={linkAs} path={path} />}\n {family && (\n <nav aria-label={labels.family} className={s.family()}>\n {[\n ...columns.map((c) => ({ key: c.group, title: labels.groups[c.group], entries: c.entries, ...columnStatus(c.entries) })),\n { key: \"krizaka\" as const, title: labels.groups.krizaka, entries: companyEntries, ...NO_STATUS },\n ]\n .filter((c) => c.entries.length > 0)\n .map((c) => (\n <details key={c.key} className={s.group()}>\n <summary className={s.summary()}>\n <span>\n <span id={`${id}-${c.key}`}>{c.title}</span>\n {c.shared && (\n <span className={s.note()}>\n <span aria-hidden=\"true\"> · </span>\n {labels.status[c.shared]}\n </span>\n )}\n </span>\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" className={s.chevron()}>\n <path d=\"M4 6l4 4 4-4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </summary>\n <ul aria-labelledby={`${id}-${c.key}`} className={s.list()}>\n {c.entries.map((e) => {\n const isCompany = c.key === \"krizaka\";\n const atHome = isCompany && here(e.url);\n const exception = c.exceptions.get(e.id);\n const isCurrent = !isCompany && e.id === currentId;\n return (\n <li key={e.id}>\n <a\n href={e.url}\n aria-current={currentMark(atHome, isCurrent)}\n onClick={atHome ? backToTop : undefined}\n className={s.link()}\n >\n {e.name}\n {exception && <span className={s.note()}> ({labels.status[exception]})</span>}\n {isCurrent && <span className=\"sr-only\"> ({labels.current})</span>}\n </a>\n </li>\n );\n })}\n </ul>\n </details>\n ))}\n </nav>\n )}\n {config ? (\n <ConfigBottom s={s} config={config} krizaka={krizaka.url} brand={org?.brand.name ?? \"Krizaka\"} tag={tag} env={env} versionLabel={labels.version} linkAs={linkAs} path={path} controls={controls} />\n ) : (\n <div className={s.bottom()}>\n <a href={krizaka.url} className={s.signature()}>\n <ProductLogo id=\"krizaka\" size={18} animated={false} />\n {org ? org.footer.line[lang] : `${labels.signature[site.kind]} · ${labels.place}`}\n </a>\n {tag && (\n <span className={s.version()}>\n <span className=\"sr-only\">{labels.version} </span>\n {tag}\n </span>\n )}\n {legal && <div className={s.legal()}>{legal}</div>}\n <FooterSocials s={s} links={(org?.links?.social ?? []).map((x) => ({ id: x.id, label: x.label, href: x.url }))} />\n {controls && <div className={s.controls()}>{controls}</div>}\n </div>\n )}\n </div>\n </footer>\n </ToneContext.Provider>\n );\n}\n\nconst isCurrent = (l: FooterLink, path?: string) => path !== undefined && !l.external && bare(l.href.split(/[?#]/)[0]!) === bare(path.split(/[?#]/)[0]!);\n\n/** The configured bottom line: the mark beside the legal identity, the version, the legal links and the socials. */\nfunction ConfigBottom({\n s,\n config,\n krizaka,\n brand,\n tag,\n env,\n versionLabel,\n linkAs,\n path,\n controls,\n}: Readonly<{\n s: ReturnType<typeof siteFooter>;\n config: SiteFooterConfig;\n krizaka: string;\n brand: string;\n tag: string;\n env?: string;\n versionLabel: string;\n linkAs?: LinkComponent;\n path?: string;\n controls?: React.ReactNode;\n}>) {\n const { legal, social } = config;\n const configured = (l: FooterLink) => <ConfigLink key={l.href} link={l} linkAs={linkAs} current={isCurrent(l, path)} />;\n const shown = legal.showVersion ? tag : env;\n const identity = [legal.legalName, legal.neq && `NEQ ${legal.neq}`, legal.city].filter(Boolean).join(\" · \");\n const versionText = (\n <>\n <span className=\"sr-only\">{versionLabel} </span>\n {shown}\n </>\n );\n return (\n <div className={s.bottom()}>\n {/* The company named once: its mark (home) beside its legal identity — never a second « by Technologies Krizaka ». */}\n <a href={krizaka} className={s.signature()} aria-label={brand}>\n <ProductLogo id=\"krizaka\" size={18} animated={false} />\n </a>\n <span className={s.identity()}>{identity}</span>\n {shown &&\n (legal.showVersion && legal.versionHref ? (\n <a href={legal.versionHref} className={s.version({ className: \"no-underline hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\" })}>\n {versionText}\n </a>\n ) : (\n <span className={s.version()}>{versionText}</span>\n ))}\n {legal.links.length > 0 && <div className={s.legal()}>{legal.links.map(configured)}</div>}\n <FooterSocials s={s} links={social ?? []} />\n {controls && <div className={s.controls()}>{controls}</div>}\n </div>\n );\n}\n\n/** Icons of the accounts a glyph exists for; any other account stays a text link. */\nconst SOCIAL_ICONS: Readonly<Partial<Record<string, typeof InstagramIcon>>> = { instagram: InstagramIcon, youtube: YoutubeIcon };\n\n/** The company's accounts: each is its icon (decorative) in a link named by the account, opening in a new tab. */\nfunction FooterSocials({ s, links }: Readonly<{ s: ReturnType<typeof siteFooter>; links: readonly { id: string; label: string; href: string }[] }>) {\n if (links.length === 0) return null;\n return (\n <div className={s.socials()}>\n {links.map((x) => {\n const Icon = SOCIAL_ICONS[x.id];\n return (\n <a key={x.id} href={x.href} target=\"_blank\" rel=\"noopener noreferrer\" className={Icon ? s.social() : s.link()}>\n {Icon && <Icon size={20} />}\n {Icon ? <span className=\"sr-only\">{x.label}</span> : x.label}\n </a>\n );\n })}\n </div>\n );\n}\n\n/** The admin-configured columns: a title (and status) over a list of links. */\nfunction ConfigColumns({\n s,\n config,\n id,\n labels,\n linkAs,\n path,\n}: Readonly<{ s: ReturnType<typeof siteFooter>; config: SiteFooterConfig; id: string; labels: FamilyLabels; linkAs?: LinkComponent; path?: string }>) {\n if (config.columns.length === 0) return null;\n return (\n <nav aria-label={config.label} className={s.columns()}>\n {config.columns.map((c) => (\n <div key={c.id} className={s.stack()}>\n <p id={`${id}-c-${c.id}`} className={s.title()}>\n {c.title}\n {c.status && (\n <span className={s.note()}>\n <span aria-hidden=\"true\"> · </span>\n {labels.status[c.status]}\n </span>\n )}\n </p>\n <ul aria-labelledby={`${id}-c-${c.id}`} className={s.stackList()}>\n {c.links.map((l) => (\n <li key={l.href}>\n <ConfigLink link={l} linkAs={linkAs} current={isCurrent(l, path)} />\n </li>\n ))}\n </ul>\n </div>\n ))}\n </nav>\n );\n}\n\n/** A configured link: the router's link inside the site, a plain `<a>` when it leaves it. */\nfunction ConfigLink({ link, linkAs, current }: Readonly<{ link: FooterLink; linkAs?: LinkComponent; current: boolean }>) {\n const s = siteFooter();\n const Comp = (link.external || !linkAs ? \"a\" : linkAs) as React.ElementType;\n return (\n <Comp href={link.href} className={s.link()} aria-current={current ? \"page\" : undefined}>\n {link.label}\n </Comp>\n );\n}\n\nexport type SiteFooterColumnProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The group's heading (“Docs”) — passed translated. */\n title: string;\n /** Its links (`SiteFooter.Link`). */\n children: React.ReactNode;\n};\n\n/** One of the site's own link groups, inline on the first line: its heading, then its links. */\nexport function SiteFooterColumn({ title, children, className, ...props }: SiteFooterColumnProps) {\n const id = React.useId();\n const tone = React.useContext(ToneContext);\n // A group with no link is not a group: only a heading over nothing.\n if (React.Children.toArray(children).length === 0) return null;\n const s = siteFooter({ tone });\n return (\n <div className={s.column({ className })} {...props}>\n <p id={id} className={s.title()}>\n {title}\n </p>\n <ul aria-labelledby={id} className={s.list({ className: \"pb-0\" })}>\n {React.Children.toArray(children).map((child, i) => <li key={i}>{child}</li>)}\n </ul>\n </div>\n );\n}\n\nexport type SiteFooterLinkProps = React.ComponentProps<\"a\"> & {\n /** The current page: `aria-current=\"page\"`. */\n active?: boolean;\n /** Renders your router's `<Link>`. */\n asChild?: boolean;\n};\n\n/** A link of the footer. */\nexport function SiteFooterLink({ active, asChild, className, ...props }: SiteFooterLinkProps) {\n const s = siteFooter();\n const Comp = asChild ? Slot.Root : \"a\";\n return <Comp aria-current={active ? \"page\" : undefined} className={s.link({ className })} {...props} />;\n}\n\nSiteFooter.Column = SiteFooterColumn;\nSiteFooter.Link = SiteFooterLink;\n"
|
|
536
|
+
"content": "// Client (the mark holds an id). The footer shared by every site and app of the Krizaka family — compact (founder,\n// 2026-10-30, krizaka/krizaka-internal#754: « des footers de 10 lignes »): at most three lines on a desktop —\n// 1. the site's own links, each group inline (`Docs Get started · Components`);\n// 2. the family, grouped inline (Products · Open source · Krizaka), names read from `org.family` of `@krizaka/org`;\n// 3. one line: the mark and the org's signature, the version, the legal links, the host's controls (language, theme).\n// On a phone the family's groups fold (`<details>`), the rest wraps. `variant=\"app\"` keeps line 3 only. Same structure on\n// the Cahier sites and the products (`tone`). No link twice, no site block, no names typed here when `org` is given.\nimport { InstagramIcon, YoutubeIcon } from \"@krizaka/icons\";\nimport { Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\n// ProductLogo, not KrizakaLogo: one import path keeps every mark in one shared chunk (KrizakaLogo alone split it: +871 B gzip on the typical page).\nimport type { LinkComponent } from \"../block-link\";\nimport { ProductLogo } from \"../marks/ProductLogo\";\nimport { columnStatus, familyGroups, orgIdOf } from \"../sites/family-groups\";\nimport { companyLinks, type FamilyLabels, familyLabels, type OrgFacts, siteById, type SiteGroup, type SiteId, type SiteStatus } from \"../sites/sites\";\nimport type { FooterLink, SiteFooterConfig } from \"./footer-config\";\n\nexport const siteFooter = tv({\n slots: {\n root: \"w-full border-t border-border-subtle bg-surface-0 text-fg\",\n inner:\n \"mx-auto grid w-full max-w-[calc(var(--kz-page-max,72rem)_+_2*var(--kz-page-gutter,clamp(16px,3.2vw,32px)))] grid-cols-[minmax(0,1fr)] gap-3 px-[var(--kz-page-gutter,clamp(16px,3.2vw,32px))] py-6\",\n row: \"flex min-w-0 flex-wrap items-baseline gap-x-6 gap-y-2\",\n family: \"grid min-w-0 grid-cols-[minmax(0,1fr)] gap-1 lg:flex lg:flex-wrap lg:items-baseline lg:gap-x-6 lg:gap-y-2\",\n group:\n \"group/fold min-w-0 lg:[&::details-content]:[content-visibility:visible] lg:[&::details-content]:contents lg:[&>summary]:pointer-events-none lg:inline-flex lg:items-baseline lg:gap-2\",\n summary:\n \"flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md text-xs font-semibold text-fg-secondary [&::-webkit-details-marker]:hidden \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring lg:inline lg:min-h-0 lg:cursor-default\",\n chevron: \"size-4 shrink-0 transition-transform group-open/fold:rotate-180 motion-reduce:transition-none lg:hidden\",\n column: \"inline-flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1\",\n title: \"text-xs font-semibold text-fg-secondary\",\n note: \"font-normal\",\n list: \"flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1 pb-2 lg:pb-0\",\n link:\n \"inline-flex min-h-6 min-w-0 items-center rounded-md text-sm [overflow-wrap:anywhere] text-fg-secondary no-underline transition-colors hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current=page]:text-fg aria-[current=page]:font-semibold aria-[current=true]:text-fg aria-[current=true]:font-semibold\",\n bottom: \"flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-fg-secondary\",\n signature:\n \"inline-flex items-center gap-2 rounded-md font-medium text-fg no-underline hover:text-fg-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n version:\n \"rounded-sm border border-border-subtle bg-surface-2 px-2 py-0.5 font-mono text-[11px] text-fg-secondary\",\n legal: \"flex flex-wrap items-center gap-x-4 gap-y-2\",\n controls: \"flex flex-wrap items-center gap-2 sm:ml-auto\",\n // `config`: real columns — two on a phone, side by side from `sm`, each a heading over a stacked list.\n columns: \"grid min-w-0 grid-cols-2 gap-x-6 gap-y-6 pb-2 sm:grid-flow-col sm:grid-cols-none sm:auto-cols-[minmax(0,13rem)] sm:gap-x-10\",\n stack: \"flex min-w-0 flex-col gap-2\",\n stackList: \"flex min-w-0 flex-col gap-1\",\n identity: \"text-fg-secondary\",\n // The accounts drawn as their icon (the name stays for screen readers): colour change only on hover, never movement.\n socials: \"flex flex-wrap items-center gap-x-3 gap-y-2\",\n social:\n \"inline-flex min-h-6 min-w-6 items-center justify-center rounded-md text-fg-secondary no-underline transition-colors hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n variants: {\n // `site`: the three lines. `docs`: the same on the documentation's width. `app`: line 3 only, inside a signed-in product.\n variant: {\n site: {},\n docs: {\n inner: \"max-w-[calc(var(--kz-page-max-docs,88rem)_+_2*var(--kz-page-gutter,clamp(16px,3.2vw,32px)))]\",\n },\n app: {\n root: \"bg-transparent\",\n inner: \"py-3\",\n },\n },\n // `product`: the products' plain Krizaka UI. `cahier`: the Cahier sites (www, blog, ui., java., ts., lab.) — the\n // headings in the Cahier's hand; the structure is the same.\n tone: {\n product: {},\n cahier: {\n title: \"font-[family-name:var(--kz-font-display,inherit)] italic\",\n summary: \"font-[family-name:var(--kz-font-display,inherit)] italic\",\n },\n },\n },\n defaultVariants: { variant: \"site\", tone: \"product\" },\n});\n\nconst bare = (p: string) => p.replace(/^\\/(en|fr)(?=\\/|$)/, \"\").replace(/\\/+$/, \"\") || \"/\";\n\n/** Is `href` (an absolute family address) the page `path` of the site at `siteUrl`? Locale prefix and trailing slash do not count. */\nfunction isThisPage(href: string, siteUrl: string, path: string): boolean {\n try {\n const target = new URL(href);\n return target.host === new URL(siteUrl).host && bare(target.pathname) === bare(path.split(/[?#]/)[0]!);\n } catch {\n return false;\n }\n}\n\n/** The link to the page you are on: no reload, back to the top (the browser would otherwise keep or restore the scroll). */\nfunction backToTop(event: React.MouseEvent<HTMLAnchorElement>) {\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.button !== 0) return;\n event.preventDefault();\n window.scrollTo({ top: 0, behavior: \"auto\" });\n}\n\ntype Tone = \"product\" | \"cahier\";\nconst ToneContext = React.createContext<Tone>(\"product\");\n\nexport type SiteFooterProps = Omit<React.ComponentProps<\"footer\">, \"children\"> & {\n /** The site this footer belongs to (`@krizaka/ui/sites`): marked in the family, its address for `path`. */\n current: SiteId;\n /**\n * The family's words, passed translated: `familyLabels.fr` from `@krizaka/ui/sites`, or your own of the same shape.\n * @default familyLabels.en\n */\n labels?: FamilyLabels;\n /** The site's own link groups (`SiteFooter.Column`), on the first line. */\n children?: React.ReactNode;\n /** The version the site runs (`1.2.3`, shown `v1.2.3`). */\n version?: string;\n /** The environment, when it is not production (`DEV`). */\n env?: string;\n /**\n * The path of the page being read on this site (`/en/story`, `/blog/…`): the company link that points to this very\n * page says so (`aria-current=\"page\"`) and a click on it scrolls to the top instead of reloading.\n */\n path?: string;\n /**\n * Shows the family on the second line, folded on a phone. The links to the other sites live on krizaka.com only\n * (founder rule, 2026-10-30): every other site and its documentation opts in on purpose, none by default.\n * @default current === \"krizaka\" (and never in `variant=\"app\"`)\n */\n family?: boolean;\n /** Only these groups of the family, in reading order (`footerFor(id).groups` of `@krizaka/org`). Omit it to draw them all. */\n groups?: readonly SiteGroup[];\n /** Only these products in the Products group (the current site always kept). Omit it to list every product. */\n products?: readonly SiteId[];\n /**\n * The organisation's public facts (`org` of `@krizaka/org`) — pass them on every site. The names and addresses of the\n * family are then `org.family`, the signature is `org.footer.line` (« Une entreprise de Technologies Krizaka · Fait à\n * Montréal », the same everywhere) and, without `legal`, the legal links are `org.footer.legal`.\n */\n org?: OrgFacts;\n /** The legal links, when not the org's (`SiteFooter.Link`s). */\n legal?: React.ReactNode;\n /** The host's controls at the end of the last line: the language switch, the theme toggle. */\n controls?: React.ReactNode;\n /**\n * `site` — every public site. `docs` — the same under documentation, on its width. `app` — inside a signed-in product:\n * the last line only; render it once, in the layout.\n * @default \"site\"\n */\n variant?: \"site\" | \"docs\" | \"app\";\n /** `cahier` on the Cahier sites (www, blog, ui., java., ts., lab.), `product` in the products. @default \"product\" */\n tone?: Tone;\n /**\n * The footer as the admin configured it (`resolveFooterSettings` of the app's settings): its columns, then one legal\n * line — `legalName · NEQ … · city`, the version when `showVersion`, the legal links, the socials. With it the family\n * is not drawn (the columns hold what the site wants) and the org's signature gives way to the legal identity.\n */\n config?: SiteFooterConfig;\n /** The app's router link for the config's internal links (Next's `Link`). @default \"a\" */\n linkAs?: LinkComponent;\n};\n\nfunction currentMark(atHome: boolean, isCurrent: boolean): \"page\" | \"true\" | undefined {\n if (atHome) return \"page\";\n return isCurrent ? \"true\" : undefined;\n}\n\nconst NO_STATUS = { shared: null, exceptions: new Map<string, Exclude<SiteStatus, \"released\">>() } as const;\n\n/** The footer of a Krizaka site or app: at most three lines — its links, the family, then signature · version · legal. */\nexport function SiteFooter({\n current,\n labels = familyLabels.en,\n children,\n version,\n env,\n path,\n legal: legalProp,\n controls,\n org,\n family: familyProp,\n products,\n groups: only,\n variant = \"site\",\n tone = \"product\",\n config,\n linkAs,\n className,\n ...props\n}: SiteFooterProps) {\n const id = React.useId();\n const s = siteFooter({ variant, tone });\n const slim = variant === \"app\";\n const family = !slim && (familyProp ?? (current === \"krizaka\" && !config));\n const site = siteById(current);\n const krizaka = siteById(\"krizaka\");\n const currentId = orgIdOf(current);\n const tag = [env, version && `v${version.replace(/^v/, \"\")}`].filter(Boolean).join(\" · \");\n const own = !slim && React.Children.toArray(children).length > 0;\n const lang = labels.lang ?? \"en\";\n const company = labels.company ?? familyLabels.en.company!;\n const legal =\n legalProp ??\n (org && (\n <>\n {org.footer.legal.map((l) => (\n <SiteFooterLink key={l.id} href={l.url[lang]}>\n {l.label[lang]}\n </SiteFooterLink>\n ))}\n </>\n ));\n const here = (href: string) => path !== undefined && isThisPage(href, site.url, path);\n const productIds = products?.map(orgIdOf);\n // Products · Open source (GitHub closes it) · Krizaka (the company's pages; its home is the signature's link).\n const groups = familyGroups(org);\n const columns = [\n ...groups\n .filter((g) => g.group === \"products\")\n .map((g) => ({ ...g, entries: productIds ? g.entries.filter((e) => productIds.includes(e.id) || e.id === currentId) : g.entries })),\n { group: \"open-source\" as const, entries: groups.filter((g) => g.group === \"open-source\" || g.group === \"github\").flatMap((g) => g.entries) },\n ];\n const companyEntries = companyLinks.map((l) => ({ id: l.id, name: company[l.id], url: l.url[lang] }));\n return (\n <ToneContext.Provider value={tone}>\n <footer className={s.root({ className })} {...props}>\n <div className={s.inner()}>\n {own && <div className={s.row()}>{children}</div>}\n {config && !slim && <ConfigColumns s={s} config={config} id={id} labels={labels} linkAs={linkAs} path={path} />}\n {family && (\n <nav aria-label={labels.family} className={s.family()}>\n {[\n ...columns.map((c) => ({ key: c.group, title: labels.groups[c.group], entries: c.entries, ...columnStatus(c.entries) })),\n { key: \"krizaka\" as const, title: labels.groups.krizaka, entries: companyEntries, ...NO_STATUS },\n ]\n .filter((c) => c.entries.length > 0 && (!only || only.includes(c.key) || (c.key === \"open-source\" && only.includes(\"github\"))))\n .map((c) => (\n <details key={c.key} className={s.group()}>\n <summary className={s.summary()}>\n <span>\n <span id={`${id}-${c.key}`}>{c.title}</span>\n {c.shared && (\n <span className={s.note()}>\n <span aria-hidden=\"true\"> · </span>\n {labels.status[c.shared]}\n </span>\n )}\n </span>\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" className={s.chevron()}>\n <path d=\"M4 6l4 4 4-4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </summary>\n <ul aria-labelledby={`${id}-${c.key}`} className={s.list()}>\n {c.entries.map((e) => {\n const isCompany = c.key === \"krizaka\";\n const atHome = isCompany && here(e.url);\n const exception = c.exceptions.get(e.id);\n const isCurrent = !isCompany && e.id === currentId;\n return (\n <li key={e.id}>\n <a\n href={e.url}\n aria-current={currentMark(atHome, isCurrent)}\n onClick={atHome ? backToTop : undefined}\n className={s.link()}\n >\n {e.name}\n {exception && <span className={s.note()}> ({labels.status[exception]})</span>}\n {isCurrent && <span className=\"sr-only\"> ({labels.current})</span>}\n </a>\n </li>\n );\n })}\n </ul>\n </details>\n ))}\n </nav>\n )}\n {config ? (\n <ConfigBottom s={s} config={config} krizaka={krizaka.url} brand={org?.brand.name ?? \"Krizaka\"} tag={tag} env={env} versionLabel={labels.version} linkAs={linkAs} path={path} controls={controls} />\n ) : (\n <div className={s.bottom()}>\n <a href={krizaka.url} className={s.signature()}>\n <ProductLogo id=\"krizaka\" size={18} animated={false} />\n {org ? org.footer.line[lang] : `${labels.signature[site.kind]} · ${labels.place}`}\n </a>\n {tag && (\n <span className={s.version()}>\n <span className=\"sr-only\">{labels.version} </span>\n {tag}\n </span>\n )}\n {legal && <div className={s.legal()}>{legal}</div>}\n <FooterSocials s={s} links={(org?.links?.social ?? []).map((x) => ({ id: x.id, label: x.label, href: x.url }))} />\n {controls && <div className={s.controls()}>{controls}</div>}\n </div>\n )}\n </div>\n </footer>\n </ToneContext.Provider>\n );\n}\n\nconst isCurrent = (l: FooterLink, path?: string) => path !== undefined && !l.external && bare(l.href.split(/[?#]/)[0]!) === bare(path.split(/[?#]/)[0]!);\n\n/** The configured bottom line: the mark beside the legal identity, the version, the legal links and the socials. */\nfunction ConfigBottom({\n s,\n config,\n krizaka,\n brand,\n tag,\n env,\n versionLabel,\n linkAs,\n path,\n controls,\n}: Readonly<{\n s: ReturnType<typeof siteFooter>;\n config: SiteFooterConfig;\n krizaka: string;\n brand: string;\n tag: string;\n env?: string;\n versionLabel: string;\n linkAs?: LinkComponent;\n path?: string;\n controls?: React.ReactNode;\n}>) {\n const { legal, social } = config;\n const configured = (l: FooterLink) => <ConfigLink key={l.href} link={l} linkAs={linkAs} current={isCurrent(l, path)} />;\n const shown = legal.showVersion ? tag : env;\n const identity = [legal.legalName, legal.neq && `NEQ ${legal.neq}`, legal.city].filter(Boolean).join(\" · \");\n const versionText = (\n <>\n <span className=\"sr-only\">{versionLabel} </span>\n {shown}\n </>\n );\n return (\n <div className={s.bottom()}>\n {/* The company named once: its mark (home) beside its legal identity — never a second « by Technologies Krizaka ». */}\n <a href={krizaka} className={s.signature()} aria-label={brand}>\n <ProductLogo id=\"krizaka\" size={18} animated={false} />\n </a>\n <span className={s.identity()}>{identity}</span>\n {shown &&\n (legal.showVersion && legal.versionHref ? (\n <a href={legal.versionHref} className={s.version({ className: \"no-underline hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\" })}>\n {versionText}\n </a>\n ) : (\n <span className={s.version()}>{versionText}</span>\n ))}\n {legal.links.length > 0 && <div className={s.legal()}>{legal.links.map(configured)}</div>}\n <FooterSocials s={s} links={social ?? []} />\n {controls && <div className={s.controls()}>{controls}</div>}\n </div>\n );\n}\n\n/** Icons of the accounts a glyph exists for; any other account stays a text link. */\nconst SOCIAL_ICONS: Readonly<Partial<Record<string, typeof InstagramIcon>>> = { instagram: InstagramIcon, youtube: YoutubeIcon };\n\n/** The company's accounts: each is its icon (decorative) in a link named by the account, opening in a new tab. */\nfunction FooterSocials({ s, links }: Readonly<{ s: ReturnType<typeof siteFooter>; links: readonly { id: string; label: string; href: string }[] }>) {\n if (links.length === 0) return null;\n return (\n <div className={s.socials()}>\n {links.map((x) => {\n const Icon = SOCIAL_ICONS[x.id];\n return (\n <a key={x.id} href={x.href} target=\"_blank\" rel=\"noopener noreferrer\" className={Icon ? s.social() : s.link()}>\n {Icon && <Icon size={20} />}\n {Icon ? <span className=\"sr-only\">{x.label}</span> : x.label}\n </a>\n );\n })}\n </div>\n );\n}\n\n/** The admin-configured columns: a title (and status) over a list of links. */\nfunction ConfigColumns({\n s,\n config,\n id,\n labels,\n linkAs,\n path,\n}: Readonly<{ s: ReturnType<typeof siteFooter>; config: SiteFooterConfig; id: string; labels: FamilyLabels; linkAs?: LinkComponent; path?: string }>) {\n if (config.columns.length === 0) return null;\n return (\n <nav aria-label={config.label} className={s.columns()}>\n {config.columns.map((c) => (\n <div key={c.id} className={s.stack()}>\n <p id={`${id}-c-${c.id}`} className={s.title()}>\n {c.title}\n {c.status && (\n <span className={s.note()}>\n <span aria-hidden=\"true\"> · </span>\n {labels.status[c.status]}\n </span>\n )}\n </p>\n <ul aria-labelledby={`${id}-c-${c.id}`} className={s.stackList()}>\n {c.links.map((l) => (\n <li key={l.href}>\n <ConfigLink link={l} linkAs={linkAs} current={isCurrent(l, path)} />\n </li>\n ))}\n </ul>\n </div>\n ))}\n </nav>\n );\n}\n\n/** A configured link: the router's link inside the site, a plain `<a>` when it leaves it. */\nfunction ConfigLink({ link, linkAs, current }: Readonly<{ link: FooterLink; linkAs?: LinkComponent; current: boolean }>) {\n const s = siteFooter();\n const Comp = (link.external || !linkAs ? \"a\" : linkAs) as React.ElementType;\n return (\n <Comp href={link.href} className={s.link()} aria-current={current ? \"page\" : undefined}>\n {link.label}\n </Comp>\n );\n}\n\nexport type SiteFooterColumnProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The group's heading (“Docs”) — passed translated. */\n title: string;\n /** Its links (`SiteFooter.Link`). */\n children: React.ReactNode;\n};\n\n/** One of the site's own link groups, inline on the first line: its heading, then its links. */\nexport function SiteFooterColumn({ title, children, className, ...props }: SiteFooterColumnProps) {\n const id = React.useId();\n const tone = React.useContext(ToneContext);\n // A group with no link is not a group: only a heading over nothing.\n if (React.Children.toArray(children).length === 0) return null;\n const s = siteFooter({ tone });\n return (\n <div className={s.column({ className })} {...props}>\n <p id={id} className={s.title()}>\n {title}\n </p>\n <ul aria-labelledby={id} className={s.list({ className: \"pb-0\" })}>\n {React.Children.toArray(children).map((child, i) => <li key={i}>{child}</li>)}\n </ul>\n </div>\n );\n}\n\nexport type SiteFooterLinkProps = React.ComponentProps<\"a\"> & {\n /** The current page: `aria-current=\"page\"`. */\n active?: boolean;\n /** Renders your router's `<Link>`. */\n asChild?: boolean;\n};\n\n/** A link of the footer. */\nexport function SiteFooterLink({ active, asChild, className, ...props }: SiteFooterLinkProps) {\n const s = siteFooter();\n const Comp = asChild ? Slot.Root : \"a\";\n return <Comp aria-current={active ? \"page\" : undefined} className={s.link({ className })} {...props} />;\n}\n\nSiteFooter.Column = SiteFooterColumn;\nSiteFooter.Link = SiteFooterLink;\n"
|
|
380
537
|
}
|
|
381
538
|
],
|
|
382
539
|
"dependencies": [
|
|
383
540
|
"@krizaka/icons@^0.10.0",
|
|
384
|
-
"@krizaka/tokens@^4.
|
|
541
|
+
"@krizaka/tokens@^4.6.0",
|
|
385
542
|
"radix-ui@^1.8.1",
|
|
386
543
|
"tailwind-variants@^3.3.1"
|
|
387
544
|
],
|
|
@@ -393,6 +550,143 @@
|
|
|
393
550
|
"content": "import { SiteFooter } from \"@krizaka/ui/site-footer\";\nimport { familyLabels } from \"@krizaka/ui/sites\";\n\n// A product's footer (www.verikora.com), three lines: its own links, the family grouped, then the signature, the version,\n// the legal links and the host's controls. In a real site pass `org` from `@krizaka/org`: the names, the signature line\n// and the legal links are then the org's, never typed here.\nexport default function SiteFooterProduct() {\n return (\n <SiteFooter\n current=\"verikora\"\n labels={familyLabels.en}\n env=\"DEV\"\n version=\"1.2.3\"\n legal={\n <>\n <SiteFooter.Link href=\"#privacy\">Privacy</SiteFooter.Link>\n <SiteFooter.Link href=\"#terms\">Terms</SiteFooter.Link>\n </>\n }\n controls={\n <SiteFooter.Link href=\"#fr\" lang=\"fr\">\n Français\n </SiteFooter.Link>\n }\n >\n <SiteFooter.Column title=\"Verikora\">\n <SiteFooter.Link href=\"#download\">Download</SiteFooter.Link>\n <SiteFooter.Link href=\"#docs\">Documentation</SiteFooter.Link>\n <SiteFooter.Link href=\"#pricing\">Pricing</SiteFooter.Link>\n <SiteFooter.Link href=\"https://github.com/krizaka/verikora\">Source code</SiteFooter.Link>\n </SiteFooter.Column>\n </SiteFooter>\n );\n}\n"
|
|
394
551
|
},
|
|
395
552
|
"props": [
|
|
553
|
+
{
|
|
554
|
+
"component": "FamilyFooter",
|
|
555
|
+
"description": "The family footer of a developer site: the shared three lines, from the org's selection.",
|
|
556
|
+
"props": [
|
|
557
|
+
{
|
|
558
|
+
"name": "current",
|
|
559
|
+
"type": "SiteId",
|
|
560
|
+
"default": null,
|
|
561
|
+
"description": "The site this footer belongs to: marked in the family.",
|
|
562
|
+
"required": true
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"name": "footer",
|
|
566
|
+
"type": "FamilyFooterData",
|
|
567
|
+
"default": null,
|
|
568
|
+
"description": "`footerFor(siteId)` of `@krizaka/org`.",
|
|
569
|
+
"required": true
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"name": "labels",
|
|
573
|
+
"type": "FamilyLabels",
|
|
574
|
+
"default": null,
|
|
575
|
+
"description": "The family's words, translated (`familyLabels[locale]`).",
|
|
576
|
+
"required": true
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
"name": "sourceLabel",
|
|
580
|
+
"type": "string",
|
|
581
|
+
"default": null,
|
|
582
|
+
"description": "« Source code » / « Code source », translated.",
|
|
583
|
+
"required": true
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"name": "brand",
|
|
587
|
+
"type": "string",
|
|
588
|
+
"default": "Krizaka",
|
|
589
|
+
"description": "The company's name for the mark's accessible name.",
|
|
590
|
+
"required": false
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
"name": "children",
|
|
594
|
+
"type": "ReactNode",
|
|
595
|
+
"default": null,
|
|
596
|
+
"description": "The site's own link groups (`SiteFooter.Column`), on the first line.",
|
|
597
|
+
"required": false
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"name": "controls",
|
|
601
|
+
"type": "ReactNode",
|
|
602
|
+
"default": null,
|
|
603
|
+
"description": "The host's controls at the end of the last line: the language switch, the theme toggle.",
|
|
604
|
+
"required": false
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
"name": "env",
|
|
608
|
+
"type": "string",
|
|
609
|
+
"default": null,
|
|
610
|
+
"description": "The environment, when it is not production (`DEV`).",
|
|
611
|
+
"required": false
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"name": "extra",
|
|
615
|
+
"type": "ReactNode",
|
|
616
|
+
"default": null,
|
|
617
|
+
"description": "Extra links at the start of the legal group (a changelog link, for instance).",
|
|
618
|
+
"required": false
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
"name": "linkAs",
|
|
622
|
+
"type": "LinkComponent",
|
|
623
|
+
"default": "a",
|
|
624
|
+
"description": "The app's router link for the config's internal links (Next's `Link`).",
|
|
625
|
+
"required": false
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"name": "path",
|
|
629
|
+
"type": "string",
|
|
630
|
+
"default": null,
|
|
631
|
+
"description": "The path of the page being read on this site (`/en/story`, `/blog/…`): the company link that points to this very\npage says so (`aria-current=\"page\"`) and a click on it scrolls to the top instead of reloading.",
|
|
632
|
+
"required": false
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
"name": "products",
|
|
636
|
+
"type": "readonly SiteId[]",
|
|
637
|
+
"default": null,
|
|
638
|
+
"description": "Only these products in the Products group (the current site always kept). Omit it to list every product.",
|
|
639
|
+
"required": false
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"name": "variant",
|
|
643
|
+
"type": "\"docs\" | \"app\" | \"site\"",
|
|
644
|
+
"default": "docs",
|
|
645
|
+
"description": "`site` — every public site. `docs` — the same under documentation, on its width. `app` — inside a signed-in product:\nthe last line only; render it once, in the layout.",
|
|
646
|
+
"required": false
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
"name": "version",
|
|
650
|
+
"type": "string",
|
|
651
|
+
"default": null,
|
|
652
|
+
"description": "The version the site runs (`1.2.3`); shown only when the footer's selection says so.",
|
|
653
|
+
"required": false
|
|
654
|
+
}
|
|
655
|
+
]
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"component": "FamilyFooter.Column",
|
|
659
|
+
"description": "One of the site's own link groups, inline on the first line: its heading, then its links.",
|
|
660
|
+
"props": [
|
|
661
|
+
{
|
|
662
|
+
"name": "title",
|
|
663
|
+
"type": "string",
|
|
664
|
+
"default": null,
|
|
665
|
+
"description": "The group's heading (“Docs”) — passed translated.",
|
|
666
|
+
"required": true
|
|
667
|
+
}
|
|
668
|
+
]
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"component": "FamilyFooter.Link",
|
|
672
|
+
"description": "A link of the footer.",
|
|
673
|
+
"props": [
|
|
674
|
+
{
|
|
675
|
+
"name": "active",
|
|
676
|
+
"type": "boolean",
|
|
677
|
+
"default": null,
|
|
678
|
+
"description": "The current page: `aria-current=\"page\"`.",
|
|
679
|
+
"required": false
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
"name": "asChild",
|
|
683
|
+
"type": "boolean",
|
|
684
|
+
"default": null,
|
|
685
|
+
"description": "Renders your router's `<Link>`.",
|
|
686
|
+
"required": false
|
|
687
|
+
}
|
|
688
|
+
]
|
|
689
|
+
},
|
|
396
690
|
{
|
|
397
691
|
"component": "SiteFooter",
|
|
398
692
|
"description": "The footer of a Krizaka site or app: at most three lines — its links, the family, then signature · version · legal.",
|
|
@@ -439,6 +733,13 @@
|
|
|
439
733
|
"description": "Shows the family on the second line, folded on a phone. The links to the other sites live on krizaka.com only\n(founder rule, 2026-10-30): every other site and its documentation opts in on purpose, none by default.",
|
|
440
734
|
"required": false
|
|
441
735
|
},
|
|
736
|
+
{
|
|
737
|
+
"name": "groups",
|
|
738
|
+
"type": "readonly SiteGroup[]",
|
|
739
|
+
"default": null,
|
|
740
|
+
"description": "Only these groups of the family, in reading order (`footerFor(id).groups` of `@krizaka/org`). Omit it to draw them all.",
|
|
741
|
+
"required": false
|
|
742
|
+
},
|
|
442
743
|
{
|
|
443
744
|
"name": "labels",
|
|
444
745
|
"type": "FamilyLabels",
|