@krizaka/ui 4.0.0 → 4.2.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/analysis-report.d.ts +44 -2
- package/dist/analysis-report.js +34 -13
- package/dist/analysis-report.js.map +1 -1
- package/dist/{chunk-54WTUZWE.js → chunk-6GTZVF77.js} +1 -1
- package/dist/chunk-6GTZVF77.js.map +1 -0
- package/dist/filter-bar.d.ts +3 -3
- package/dist/media-gallery.d.ts +3 -3
- package/dist/media-player.d.ts +3 -3
- package/dist/native.d.ts +8 -0
- package/dist/native.js +8 -0
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.d.ts +1 -1
- package/dist/nav-bar.js +1 -1
- package/dist/{schema-DgjBz7-8.d.ts → schema-CL7t7xqb.d.ts} +1 -1
- package/dist/shop.d.ts +2 -2
- package/dist/site-cahier.d.ts +52 -39
- package/dist/site-cahier.js +18 -2
- package/dist/site-cahier.js.map +1 -1
- package/dist/site-footer.d.ts +10 -92
- package/dist/site-footer.js +19 -3
- package/dist/site-footer.js.map +1 -1
- package/dist/sites-iJkCPeiH.d.ts +170 -0
- package/dist/sites.d.ts +14 -0
- package/dist/sites.js.map +1 -1
- package/package.json +6 -5
- package/registry/account-settings.json +1 -1
- package/registry/analysis-report.json +51 -5
- package/registry/app-frame.json +1 -1
- package/registry/examples/account-settings/patterns.js +1 -1
- package/registry/examples/account-settings/patterns.tsx +1 -1
- package/registry/examples/analysis-report/authenticity.d.ts +4 -0
- package/registry/examples/analysis-report/authenticity.js +50 -0
- package/registry/examples/analysis-report/authenticity.tsx +33 -0
- package/registry/examples/analysis-report/lease-review.d.ts +4 -0
- package/registry/examples/analysis-report/lease-review.js +51 -0
- package/registry/examples/analysis-report/lease-review.tsx +33 -0
- package/registry/examples/markdown/wide-table.js +1 -1
- package/registry/examples/markdown/wide-table.tsx +1 -1
- package/registry/examples/site-footer/configured.js +2 -2
- package/registry/examples/site-footer/configured.tsx +2 -2
- package/registry/examples/site-footer/socials.d.ts +4 -0
- package/registry/examples/site-footer/socials.js +25 -0
- package/registry/examples/site-footer/socials.tsx +22 -0
- package/registry/index.json +13 -10
- package/registry/map.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/nav-bar.json +1 -1
- package/registry/rail-nav.json +1 -1
- package/registry/shop.json +1 -1
- package/registry/site-footer.json +15 -4
- package/registry/sites.json +4 -2
- package/dist/chunk-54WTUZWE.js.map +0 -1
- package/dist/sites-A5cNWG2Z.d.ts +0 -73
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AnalysisReport, type AnalysisReportLabels } from "@krizaka/ui/analysis-report";
|
|
2
|
+
|
|
3
|
+
// The words come from the app's messages (demo wording here).
|
|
4
|
+
const labels: AnalysisReportLabels = {
|
|
5
|
+
status: { inconsistent: "Not compliant", attention: "To check", unverified: "Not applicable", consistent: "Respected" },
|
|
6
|
+
findings: "Findings", mayIndicate: "May indicate", location: "Where:", evidence: "Evidence", details: "Details",
|
|
7
|
+
limits: "What this report did not examine", nextSteps: "Next steps", provenance: "Provenance",
|
|
8
|
+
model: "Ruleset", runId: "Run", duration: "Duration", version: "Version",
|
|
9
|
+
copyJson: "Copy JSON", copyMarkdown: "Copy Markdown", copied: "Copied", streaming: "Findings are arriving", noFindings: "No finding.",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default function AnalysisReportLeaseReview() {
|
|
13
|
+
return (
|
|
14
|
+
<AnalysisReport
|
|
15
|
+
labels={labels}
|
|
16
|
+
title="Lease review"
|
|
17
|
+
summary="One clause goes against the Civil Code; two others are worth a second look."
|
|
18
|
+
status="inconsistent"
|
|
19
|
+
folded={["consistent", "unverified"]}
|
|
20
|
+
provenanceFolded
|
|
21
|
+
hideActions
|
|
22
|
+
findings={[
|
|
23
|
+
{ id: "1", status: "inconsistent", title: "Deposit requested", quote: "The tenant pays a deposit of one month's rent on signing.", reference: { label: "C.c.Q., art. 1904, al. 1", href: "https://www.legisquebec.gouv.qc.ca/en/document/cs/CCQ-1991" }, location: "clause 6" },
|
|
24
|
+
{ id: "2", status: "attention", title: "Notice to change the rent", quote: "The landlord may revise the rent with a notice of 30 days.", reference: { label: "C.c.Q., art. 1942" }, location: "clause 9" },
|
|
25
|
+
{ id: "3", status: "consistent", title: "Term of the lease", quote: "The lease runs for twelve months from July 1.", reference: { label: "C.c.Q., art. 1851" } },
|
|
26
|
+
{ id: "4", status: "unverified", title: "Parking space", observation: "The lease does not mention a parking space." },
|
|
27
|
+
]}
|
|
28
|
+
limits={["The building's by-laws were not provided."]}
|
|
29
|
+
nextSteps={["Ask the landlord to remove the deposit clause."]}
|
|
30
|
+
provenance={{ model: "lease-rules", runId: "run_5c20be", version: "2026.11" }}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -14,7 +14,7 @@ Identifiers stay whole; move through the table with the arrow keys after focusin
|
|
|
14
14
|
|
|
15
15
|
A long word: documentationidentifierswithoutanynaturalbreakopportunitiesstillfitonthephone.
|
|
16
16
|
|
|
17
|
-
- A long URL: [https://example.com/documentation/reference/identifierswithoutanynaturalbreakopportunities](https://example.com
|
|
17
|
+
- A long URL: [https://example.com/documentation/reference/identifierswithoutanynaturalbreakopportunities](https://example.com)
|
|
18
18
|
|
|
19
19
|
\`\`\`text
|
|
20
20
|
profile-photo-check account-access-review upload-retry-policy discovery-manifest-signature
|
|
@@ -11,7 +11,7 @@ Identifiers stay whole; move through the table with the arrow keys after focusin
|
|
|
11
11
|
|
|
12
12
|
A long word: documentationidentifierswithoutanynaturalbreakopportunitiesstillfitonthephone.
|
|
13
13
|
|
|
14
|
-
- A long URL: [https://example.com/documentation/reference/identifierswithoutanynaturalbreakopportunities](https://example.com
|
|
14
|
+
- A long URL: [https://example.com/documentation/reference/identifierswithoutanynaturalbreakopportunities](https://example.com)
|
|
15
15
|
|
|
16
16
|
\`\`\`text
|
|
17
17
|
profile-photo-check account-access-review upload-retry-policy discovery-manifest-signature
|
|
@@ -18,7 +18,7 @@ var settings = {
|
|
|
18
18
|
showVersion: true,
|
|
19
19
|
links: [{ labelKey: "footer.privacy", href: "#privacy" }]
|
|
20
20
|
},
|
|
21
|
-
social: ["
|
|
21
|
+
social: ["instagram"]
|
|
22
22
|
};
|
|
23
23
|
var messages = {
|
|
24
24
|
"footer.label": "Footer",
|
|
@@ -30,7 +30,7 @@ var messages = {
|
|
|
30
30
|
"footer.privacy": "Privacy"
|
|
31
31
|
};
|
|
32
32
|
function SiteFooterConfigured() {
|
|
33
|
-
const socials = [{ id: "
|
|
33
|
+
const socials = [{ id: "instagram", label: "Instagram", url: "https://www.instagram.com/krizakahq" }];
|
|
34
34
|
const config = resolveFooterSettings(settings, (key) => messages[key] ?? key, socials);
|
|
35
35
|
return /* @__PURE__ */ jsx(SiteFooter, { current: "verikora", labels: familyLabels.en, version: "1.2.3", config });
|
|
36
36
|
}
|
|
@@ -17,7 +17,7 @@ const settings: FooterSettings = {
|
|
|
17
17
|
showVersion: true,
|
|
18
18
|
links: [{ labelKey: "footer.privacy", href: "#privacy" }],
|
|
19
19
|
},
|
|
20
|
-
social: ["
|
|
20
|
+
social: ["instagram"],
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const messages: Record<string, string> = {
|
|
@@ -31,7 +31,7 @@ const messages: Record<string, string> = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export default function SiteFooterConfigured() {
|
|
34
|
-
const socials = [{ id: "
|
|
34
|
+
const socials = [{ id: "instagram", label: "Instagram", url: "https://www.instagram.com/krizakahq" }];
|
|
35
35
|
const config = resolveFooterSettings(settings, (key) => messages[key] ?? key, socials);
|
|
36
36
|
return <SiteFooter current="verikora" labels={familyLabels.en} version="1.2.3" config={config} />;
|
|
37
37
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/site-footer/socials.tsx
|
|
4
|
+
import { SiteFooter } from "@krizaka/ui/site-footer";
|
|
5
|
+
import { familyLabels } from "@krizaka/ui/sites";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var org = {
|
|
8
|
+
brand: { name: "Krizaka" },
|
|
9
|
+
footer: {
|
|
10
|
+
line: { fr: "Une entreprise de Technologies Krizaka \xB7 Fait \xE0 Montr\xE9al", en: "A Technologies Krizaka company \xB7 Made in Montr\xE9al" },
|
|
11
|
+
legal: [{ id: "privacy", label: { fr: "Confidentialit\xE9", en: "Privacy" }, url: { fr: "#privacy", en: "#privacy" } }]
|
|
12
|
+
},
|
|
13
|
+
links: {
|
|
14
|
+
social: [
|
|
15
|
+
{ id: "instagram", label: "Instagram", url: "https://www.instagram.com/krizakahq" },
|
|
16
|
+
{ id: "youtube", label: "YouTube", url: "https://www.youtube.com/@krizakahq" }
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function SiteFooterSocials() {
|
|
21
|
+
return /* @__PURE__ */ jsx(SiteFooter, { current: "verikora", tone: "cahier", labels: familyLabels.en, org, version: "1.2.3" });
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
SiteFooterSocials as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SiteFooter } from "@krizaka/ui/site-footer";
|
|
2
|
+
import { familyLabels } from "@krizaka/ui/sites";
|
|
3
|
+
|
|
4
|
+
// The company's accounts come from the org (`org.links.social` of `@krizaka/org`, a footer never types an address):
|
|
5
|
+
// each known account (Instagram, YouTube) is drawn as its icon, named for screen readers.
|
|
6
|
+
const org = {
|
|
7
|
+
brand: { name: "Krizaka" },
|
|
8
|
+
footer: {
|
|
9
|
+
line: { fr: "Une entreprise de Technologies Krizaka · Fait à Montréal", en: "A Technologies Krizaka company · Made in Montréal" },
|
|
10
|
+
legal: [{ id: "privacy", label: { fr: "Confidentialité", en: "Privacy" }, url: { fr: "#privacy", en: "#privacy" } }],
|
|
11
|
+
},
|
|
12
|
+
links: {
|
|
13
|
+
social: [
|
|
14
|
+
{ id: "instagram", label: "Instagram", url: "https://www.instagram.com/krizakahq" },
|
|
15
|
+
{ id: "youtube", label: "YouTube", url: "https://www.youtube.com/@krizakahq" },
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default function SiteFooterSocials() {
|
|
21
|
+
return <SiteFooter current="verikora" tone="cahier" labels={familyLabels.en} org={org} version="1.2.3" />;
|
|
22
|
+
}
|
package/registry/index.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krizaka/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"templatePurposes": {
|
|
5
5
|
"convince": {
|
|
6
6
|
"title": "Convince",
|
|
@@ -936,7 +936,7 @@
|
|
|
936
936
|
}
|
|
937
937
|
},
|
|
938
938
|
"examples": {
|
|
939
|
-
"web":
|
|
939
|
+
"web": 4,
|
|
940
940
|
"native": 1
|
|
941
941
|
},
|
|
942
942
|
"dependencies": [
|
|
@@ -1004,7 +1004,7 @@
|
|
|
1004
1004
|
"native": 0
|
|
1005
1005
|
},
|
|
1006
1006
|
"dependencies": [
|
|
1007
|
-
"@krizaka/tokens@^4.
|
|
1007
|
+
"@krizaka/tokens@^4.2.0"
|
|
1008
1008
|
],
|
|
1009
1009
|
"registryDependencies": [
|
|
1010
1010
|
"account-menu",
|
|
@@ -4008,7 +4008,7 @@
|
|
|
4008
4008
|
"native": 2
|
|
4009
4009
|
},
|
|
4010
4010
|
"dependencies": [
|
|
4011
|
-
"@krizaka/tokens@^4.
|
|
4011
|
+
"@krizaka/tokens@^4.2.0",
|
|
4012
4012
|
"@protomaps/basemaps@5.7.2",
|
|
4013
4013
|
"tailwind-variants@^3.3.1"
|
|
4014
4014
|
],
|
|
@@ -4421,7 +4421,7 @@
|
|
|
4421
4421
|
"native": 0
|
|
4422
4422
|
},
|
|
4423
4423
|
"dependencies": [
|
|
4424
|
-
"@krizaka/tokens@^4.
|
|
4424
|
+
"@krizaka/tokens@^4.2.0",
|
|
4425
4425
|
"radix-ui@^1.8.1",
|
|
4426
4426
|
"tailwind-variants@^3.3.1"
|
|
4427
4427
|
],
|
|
@@ -5289,7 +5289,7 @@
|
|
|
5289
5289
|
"native": 0
|
|
5290
5290
|
},
|
|
5291
5291
|
"dependencies": [
|
|
5292
|
-
"@krizaka/tokens@^4.
|
|
5292
|
+
"@krizaka/tokens@^4.2.0",
|
|
5293
5293
|
"radix-ui@^1.8.1",
|
|
5294
5294
|
"tailwind-variants@^3.3.1"
|
|
5295
5295
|
],
|
|
@@ -5736,7 +5736,7 @@
|
|
|
5736
5736
|
"native": 0
|
|
5737
5737
|
},
|
|
5738
5738
|
"dependencies": [
|
|
5739
|
-
"@krizaka/tokens@^4.
|
|
5739
|
+
"@krizaka/tokens@^4.2.0",
|
|
5740
5740
|
"zod@^4.6.7"
|
|
5741
5741
|
],
|
|
5742
5742
|
"registryDependencies": [
|
|
@@ -5952,11 +5952,12 @@
|
|
|
5952
5952
|
}
|
|
5953
5953
|
},
|
|
5954
5954
|
"examples": {
|
|
5955
|
-
"web":
|
|
5955
|
+
"web": 7,
|
|
5956
5956
|
"native": 0
|
|
5957
5957
|
},
|
|
5958
5958
|
"dependencies": [
|
|
5959
|
-
"@krizaka/
|
|
5959
|
+
"@krizaka/icons@^0.10.0",
|
|
5960
|
+
"@krizaka/tokens@^4.2.0",
|
|
5960
5961
|
"radix-ui@^1.8.1",
|
|
5961
5962
|
"tailwind-variants@^3.3.1"
|
|
5962
5963
|
],
|
|
@@ -5991,7 +5992,9 @@
|
|
|
5991
5992
|
"native": 0
|
|
5992
5993
|
},
|
|
5993
5994
|
"dependencies": [],
|
|
5994
|
-
"registryDependencies": [
|
|
5995
|
+
"registryDependencies": [
|
|
5996
|
+
"site-footer"
|
|
5997
|
+
]
|
|
5995
5998
|
},
|
|
5996
5999
|
{
|
|
5997
6000
|
"name": "skeleton",
|
package/registry/map.json
CHANGED
package/registry/markdown.json
CHANGED
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"description": "Nine columns of long identifiers, a host-labelled generated chip, long prose and scrolling code.",
|
|
156
156
|
"path": "examples/markdown/wide-table.tsx",
|
|
157
157
|
"module": "@krizaka/ui/registry/examples/markdown/wide-table",
|
|
158
|
-
"code": "import { Markdown } from \"@krizaka/ui/markdown\";\n\nconst text = `## Generated reference\n\nIdentifiers stay whole; move through the table with the arrow keys after focusing its frame.\n\n| Identifier | Profile | Account | Upload | Review | Delivery | Presence | Discovery | Queue |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- |\n| \\`profile-photo-check\\` | \\`profile-photo-check\\` | \\`account-access-review\\` | \\`upload-retry-policy\\` | \\`review-pending-items\\` | \\`delivery-status-check\\` | \\`presence-channel-join\\` | \\`discovery-manifest-signature\\` | \\`queue-priority-update\\` |\n| \\`account-access-review\\` | \\`profile-photo-check\\`, \\`profile-photo-refresh\\` | \\`account-session-refresh\\` | \\`upload-content-validation\\` | \\`review-assignment-update\\` | \\`delivery-receipt-confirm\\` | \\`presence-heartbeat-renewal\\` | \\`discovery-address-allowlist\\` | \\`queue-backoff-duration-for-background-upload-retry-policy\\` |\n\nA long word: documentationidentifierswithoutanynaturalbreakopportunitiesstillfitonthephone.\n\n- A long URL: [https://example.com/documentation/reference/identifierswithoutanynaturalbreakopportunities](https://example.com
|
|
158
|
+
"code": "import { Markdown } from \"@krizaka/ui/markdown\";\n\nconst text = `## Generated reference\n\nIdentifiers stay whole; move through the table with the arrow keys after focusing its frame.\n\n| Identifier | Profile | Account | Upload | Review | Delivery | Presence | Discovery | Queue |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- |\n| \\`profile-photo-check\\` | \\`profile-photo-check\\` | \\`account-access-review\\` | \\`upload-retry-policy\\` | \\`review-pending-items\\` | \\`delivery-status-check\\` | \\`presence-channel-join\\` | \\`discovery-manifest-signature\\` | \\`queue-priority-update\\` |\n| \\`account-access-review\\` | \\`profile-photo-check\\`, \\`profile-photo-refresh\\` | \\`account-session-refresh\\` | \\`upload-content-validation\\` | \\`review-assignment-update\\` | \\`delivery-receipt-confirm\\` | \\`presence-heartbeat-renewal\\` | \\`discovery-address-allowlist\\` | \\`queue-backoff-duration-for-background-upload-retry-policy\\` |\n\nA long word: documentationidentifierswithoutanynaturalbreakopportunitiesstillfitonthephone.\n\n- A long URL: [https://example.com/documentation/reference/identifierswithoutanynaturalbreakopportunities](https://example.com)\n\n\\`\\`\\`text\nprofile-photo-check account-access-review upload-retry-policy discovery-manifest-signature\n\\`\\`\\`\n`;\n\nexport default function MarkdownWideTable() {\n return <Markdown generated generatedLabel=\"Generated\" className=\"max-w-full\">{text}</Markdown>;\n}\n"
|
|
159
159
|
}
|
|
160
160
|
]
|
|
161
161
|
},
|
package/registry/nav-bar.json
CHANGED
package/registry/rail-nav.json
CHANGED
package/registry/shop.json
CHANGED
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"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.",
|
|
46
46
|
"Pass the version the site runs (`version`, `env=\"DEV\"` on a dev environment) and the language switch and theme toggle in `controls`.",
|
|
47
47
|
"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.",
|
|
48
|
+
"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.",
|
|
48
49
|
"Pass the words translated: `labels={familyLabels[locale]}` from `@krizaka/ui/sites`."
|
|
49
50
|
],
|
|
50
51
|
"accessibility": {
|
|
@@ -53,6 +54,7 @@
|
|
|
53
54
|
"A `footer` landmark; the family is a `nav` named by `labels.family`, each group a list named by its heading.",
|
|
54
55
|
"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.",
|
|
55
56
|
"The current site says `aria-current=\"true\"` and “You are here” to screen readers; a status is written, never only a colour.",
|
|
57
|
+
"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.",
|
|
56
58
|
"The marks are decorative: every site's name is written beside its mark."
|
|
57
59
|
]
|
|
58
60
|
},
|
|
@@ -274,7 +276,15 @@
|
|
|
274
276
|
"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.",
|
|
275
277
|
"path": "examples/site-footer/configured.tsx",
|
|
276
278
|
"module": "@krizaka/ui/registry/examples/site-footer/configured",
|
|
277
|
-
"code": "import { type FooterSettings, resolveFooterSettings, SiteFooter } from \"@krizaka/ui/site-footer\";\nimport { familyLabels } from \"@krizaka/ui/sites\";\n\n// The footer as the admin configured it: settings stored by the app (message keys, the org's socials by id),\n// resolved with the app's messages, then drawn as real columns and one legal line that names the company once.\nconst settings: FooterSettings = {\n labelKey: \"footer.label\",\n columns: [\n { id: \"product\", titleKey: \"footer.product\", links: [{ labelKey: \"footer.pricing\", href: \"#pricing\" }] },\n { id: \"help\", titleKey: \"footer.help\", links: [{ labelKey: \"footer.contact\", href: \"#contact\" }] },\n { id: \"krizaka\", titleKey: \"footer.krizaka\", links: [{ label: \"Krizaka\", href: \"https://www.krizaka.com\", external: true }] },\n ],\n legal: {\n legalName: \"Technologies Krizaka Inc.\",\n neq: \"1182652231\",\n city: \"Montréal (Québec)\",\n showVersion: true,\n links: [{ labelKey: \"footer.privacy\", href: \"#privacy\" }],\n },\n social: [\"
|
|
279
|
+
"code": "import { type FooterSettings, resolveFooterSettings, SiteFooter } from \"@krizaka/ui/site-footer\";\nimport { familyLabels } from \"@krizaka/ui/sites\";\n\n// The footer as the admin configured it: settings stored by the app (message keys, the org's socials by id),\n// resolved with the app's messages, then drawn as real columns and one legal line that names the company once.\nconst settings: FooterSettings = {\n labelKey: \"footer.label\",\n columns: [\n { id: \"product\", titleKey: \"footer.product\", links: [{ labelKey: \"footer.pricing\", href: \"#pricing\" }] },\n { id: \"help\", titleKey: \"footer.help\", links: [{ labelKey: \"footer.contact\", href: \"#contact\" }] },\n { id: \"krizaka\", titleKey: \"footer.krizaka\", links: [{ label: \"Krizaka\", href: \"https://www.krizaka.com\", external: true }] },\n ],\n legal: {\n legalName: \"Technologies Krizaka Inc.\",\n neq: \"1182652231\",\n city: \"Montréal (Québec)\",\n showVersion: true,\n links: [{ labelKey: \"footer.privacy\", href: \"#privacy\" }],\n },\n social: [\"instagram\"],\n};\n\nconst messages: Record<string, string> = {\n \"footer.label\": \"Footer\",\n \"footer.product\": \"Verikora\",\n \"footer.pricing\": \"Pricing\",\n \"footer.help\": \"Help\",\n \"footer.contact\": \"Contact\",\n \"footer.krizaka\": \"By Krizaka\",\n \"footer.privacy\": \"Privacy\",\n};\n\nexport default function SiteFooterConfigured() {\n const socials = [{ id: \"instagram\", label: \"Instagram\", url: \"https://www.instagram.com/krizakahq\" }];\n const config = resolveFooterSettings(settings, (key) => messages[key] ?? key, socials);\n return <SiteFooter current=\"verikora\" labels={familyLabels.en} version=\"1.2.3\" config={config} />;\n}\n"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"name": "socials",
|
|
283
|
+
"title": "With the company's accounts",
|
|
284
|
+
"description": "`org.links.social` of `@krizaka/org`: Instagram drawn as its icon at the end of the last line, named « Instagram » for screen readers.",
|
|
285
|
+
"path": "examples/site-footer/socials.tsx",
|
|
286
|
+
"module": "@krizaka/ui/registry/examples/site-footer/socials",
|
|
287
|
+
"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"
|
|
278
288
|
},
|
|
279
289
|
{
|
|
280
290
|
"name": "docs",
|
|
@@ -362,15 +372,16 @@
|
|
|
362
372
|
},
|
|
363
373
|
{
|
|
364
374
|
"path": "site-footer/meta.ts",
|
|
365
|
-
"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 \"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 \"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: \"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"
|
|
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"
|
|
366
376
|
},
|
|
367
377
|
{
|
|
368
378
|
"path": "site-footer/site-footer.tsx",
|
|
369
|
-
"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 { 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 },\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\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={atHome ? \"page\" : isCurrent ? \"true\" : undefined}\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 {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 {social && social.length > 0 && <div className={s.legal()}>{social.map((x) => configured({ label: x.label, href: x.href, external: true }))}</div>}\n {controls && <div className={s.controls()}>{controls}</div>}\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"
|
|
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\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={atHome ? \"page\" : isCurrent ? \"true\" : undefined}\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"
|
|
370
380
|
}
|
|
371
381
|
],
|
|
372
382
|
"dependencies": [
|
|
373
|
-
"@krizaka/
|
|
383
|
+
"@krizaka/icons@^0.10.0",
|
|
384
|
+
"@krizaka/tokens@^4.2.0",
|
|
374
385
|
"radix-ui@^1.8.1",
|
|
375
386
|
"tailwind-variants@^3.3.1"
|
|
376
387
|
],
|
package/registry/sites.json
CHANGED
|
@@ -99,11 +99,13 @@
|
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
"path": "sites/sites.ts",
|
|
102
|
-
"content": "// Server-safe: plain data. The Krizaka family — every site Krizaka runs, once. The family switcher of the bar\n// (`NavBar.Family`) and the common footer (`SiteFooter`) both read it, so adding a site is one release of this package:\n// every bar and every footer of the family follow.\n//\n// The words of the family (a site's one line, the groups, the statuses, the footer's signature) are brand data, written\n// here in English and French (`familyLabels`) — a site passes the set of its locale, or its own translation.\n\n/** A site of the family. */\nexport type SiteId = \"krizaka\" | \"sovkora\" | \"verikora\" | \"folioviv\" | \"ui\" | \"java\" | \"ts\" | \"motion\" | \"github\";\n\n/** What a site is: the company, a product, or an open-source project. It chooses the footer's signature line. */\nexport type SiteKind = \"company\" | \"product\" | \"open-source\";\n\n/**\n * `released`: open to visit. `upcoming`: announced, not released yet (said \"Coming soon\"). `construction`: under\n * construction — nothing offered (a QA-only app may run; the public page says so). `development`: being built in the\n * open, with a dev site (said \"In development\"). A site with none yet would use its repository as its address.\n */\nexport type SiteStatus = \"released\" | \"upcoming\" | \"construction\" | \"development\";\n\n/** The groups of the family, in reading order: Krizaka · Products · Open source · GitHub. */\nexport type SiteGroup = \"krizaka\" | \"products\" | \"open-source\" | \"github\";\n\n/** The mark a site wears: a brand of `ProductLogo` (Krizaka UI and Krizaka Java wear Krizaka's), or GitHub's. */\nexport type SiteMark = \"krizaka\" | \"sovkora\" | \"verikora\" | \"folioviv\" | \"github\";\n\nexport interface Site {\n readonly id: SiteId;\n /** The name, never translated. */\n readonly name: string;\n /** The address of the site (its home). */\n readonly url: string;\n /** The address without the scheme, as people say it (`ui.krizaka.com`). */\n readonly host: string;\n readonly kind: SiteKind;\n readonly group: SiteGroup;\n readonly status: SiteStatus;\n readonly mark: SiteMark;\n /** The repository the site is built from. */\n readonly repo: string;\n}\n\n/** The address as a person reads it: the host, and the path when there is one (`github.com/krizaka`). */\nconst hostOf = (url: string): string => {\n const { host, pathname } = new URL(url);\n return pathname === \"/\" ? host : host + pathname;\n};\nconst site = (s: Omit<Site, \"host\">): Site => ({ ...s, host: hostOf(s.url) });\n\n/** Every site of the family, in reading order (the group order, then the order inside each group). */\nexport const sites: readonly Site[] = [\n site({ id: \"krizaka\", name: \"Krizaka\", url: \"https://www.krizaka.com\", kind: \"company\", group: \"krizaka\", status: \"released\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-com\" }),\n site({ id: \"sovkora\", name: \"Sovkora\", url: \"https://www.sovkora.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"sovkora\", repo: \"https://github.com/krizaka/sovkora\" }),\n site({ id: \"verikora\", name: \"Verikora\", url: \"https://www.verikora.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"verikora\", repo: \"https://github.com/krizaka/verikora\" }),\n site({ id: \"folioviv\", name: \"Folioviv\", url: \"https://www.folioviv.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"folioviv\", repo: \"https://github.com/krizaka/folioviv\" }),\n site({ id: \"ui\", name: \"Krizaka UI\", url: \"https://ui.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-ui\" }),\n site({ id: \"java\", name: \"Krizaka Java\", url: \"https://java.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-java\" }),\n site({ id: \"ts\", name: \"Krizaka TypeScript\", url: \"https://ts.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-ts\" }),\n // The family lab: built in the open, served at lab.krizaka.com; what proves itself there moves into Krizaka UI.\n site({ id: \"motion\", name: \"Krizaka Lab\", url: \"https://lab.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-lab\" }),\n site({ id: \"github\", name: \"GitHub\", url: \"https://github.com/krizaka\", kind: \"open-source\", group: \"github\", status: \"released\", mark: \"github\", repo: \"https://github.com/krizaka\" }),\n];\n\n/** The groups, in reading order. */\nexport const siteGroups: readonly SiteGroup[] = [\"krizaka\", \"products\", \"open-source\", \"github\"];\n\n/** A site by id. */\nexport function siteById(id: SiteId): Site {\n const found = sites.find((s) => s.id === id);\n if (!found) throw new Error(`Unknown Krizaka site \"${id}\".`);\n return found;\n}\n\n/** The family grouped, in reading order: `[{ group, sites }]`, empty groups left out. */\nexport function sitesByGroup(): { group: SiteGroup; sites: Site[] }[] {\n return siteGroups.map((group) => ({ group, sites: sites.filter((s) => s.group === group) })).filter((g) => g.sites.length > 0);\n}\n\n/** The languages the family's words are written in. */\nexport type SiteLocale = \"en\" | \"fr\";\n\n/** The company's own pages, the footer's « Krizaka » column (the brand's home is the signature line's link). */\nexport type CompanyLinkId = \"story\" | \"blog\" | \"contact\";\nexport const companyLinks: readonly { id: CompanyLinkId; url: Record<SiteLocale, string> }[] = [\n { id: \"story\", url: { en: \"https://www.krizaka.com/story\", fr: \"https://www.krizaka.com/fr/story\" } },\n { id: \"blog\", url: { en: \"https://blog.krizaka.com\", fr: \"https://blog.krizaka.com\" } },\n { id: \"contact\", url: { en: \"https://www.krizaka.com/contact\", fr: \"https://www.krizaka.com/fr/contact\" } },\n];\n\n/** The words of the family: the switcher, the footer, each site's one line. */\nexport interface FamilyLabels {\n /** The family's name: the switcher's navigation and its button, the footer's navigation (“Krizaka family”). */\n family: string;\n /** The heading of each group. */\n groups: Record<SiteGroup, string>;\n /** The badge of a site that is not released. */\n status: Record<Exclude<SiteStatus, \"released\">, string>;\n /** Says which site is the current one (“You are here”). */\n current: string;\n /** One line per site: what it is. */\n descriptions: Record<SiteId, string>;\n /** The footer's signature, by the kind of the current site (“A Krizaka product”). */\n signature: Record<SiteKind, string>;\n /** The footer's place line (“Made in Montréal”). */\n place: string;\n /** The accessible name of the version (“Version”). */\n version: string;\n /** The language of these words: the company links open in it. @default \"en\" */\n lang?: SiteLocale;\n /** The company's pages in the footer's « Krizaka » column. @default the English words */\n company?: Record<CompanyLinkId, string>;\n}\n\n/** The family's words in English and French. Pass `familyLabels[locale]`, or your own translation of the same shape. */\nexport const familyLabels: Record<SiteLocale, FamilyLabels> = {\n en: {\n family: \"Krizaka family\",\n groups: { krizaka: \"Krizaka\", products: \"Products\", \"open-source\": \"Open source\", github: \"GitHub\" },\n status: { upcoming: \"Coming soon\", construction: \"Under construction\", development: \"In development\" },\n current: \"You are here\",\n descriptions: {\n krizaka: \"The company: our products, our open source, our story.\",\n sovkora: \"Sovereign AI on your own servers: chat, documents, images and video — and the engine under the other products.\",\n verikora: \"Verikora reads your leases, contracts and invoices.\",\n folioviv: \"Running a shop in Québec, for less — Loi 25 by design.\",\n ui: \"Components, tokens, icons and charts — web and React Native.\",\n java: \"Spring Boot building blocks on Maven Central.\",\n ts: \"TypeScript backend building blocks on npm.\",\n motion: \"The family lab: the kit's motion, played live with its knobs.\",\n github: \"Every repository, in the open.\",\n },\n signature: { company: \"A Krizaka company\", product: \"A Krizaka product\", \"open-source\": \"A Krizaka open-source project\" },\n place: \"Made in Montréal\",\n version: \"Version\",\n lang: \"en\",\n company: { story: \"Our story\", blog: \"Blog\", contact: \"Contact us\" },\n },\n fr: {\n family: \"Famille Krizaka\",\n groups: { krizaka: \"Krizaka\", products: \"Produits\", \"open-source\": \"Open source\", github: \"GitHub\" },\n status: { upcoming: \"Bientôt\", construction: \"En construction\", development: \"En développement\" },\n current: \"Vous êtes ici\",\n descriptions: {\n krizaka: \"La compagnie : nos produits, notre open source, notre histoire.\",\n sovkora: \"L’IA souveraine sur vos propres serveurs : conversation, documents, images et vidéo — et le moteur des autres produits.\",\n verikora: \"Verikora lit vos baux, contrats et factures.\",\n folioviv: \"Tenir une boutique au Québec, pour moins cher — Loi 25 dès la conception.\",\n ui: \"Composants, jetons, icônes et graphiques — web et React Native.\",\n java: \"Des briques Spring Boot sur Maven Central.\",\n ts: \"Des briques backend TypeScript sur npm.\",\n motion: \"Le labo du mouvement : le mouvement du kit, joué en direct, avec ses réglages.\",\n github: \"Tous les dépôts, au grand jour.\",\n },\n signature: { company: \"Une compagnie Krizaka\", product: \"Un produit Krizaka\", \"open-source\": \"Un projet open source de Krizaka\" },\n place: \"Fait à Montréal\",\n version: \"Version\",\n lang: \"fr\",\n company: { story: \"Notre histoire\", blog: \"Blogue\", contact: \"Nous écrire\" },\n },\n};\n\n/**\n * What the footer and the bar read from `@krizaka/org` (the organisation's public facts, one validated JSON): the brand's\n * name, the footer line and the legal links, each in both languages. Structural: the whole `Org` of `@krizaka/org` fits.\n */\nexport interface OrgFacts {\n brand: { name: string };\n /**\n * Every name of the family (`org.family` of `@krizaka/org`, krizaka/krizaka-internal#754): when given, the footer reads\n * the names and addresses here, never from this package's registry — the company « Krizaka », products by their own\n * name, libraries « Krizaka <X> ».\n */\n family?: readonly OrgFamilyEntry[];\n footer: {\n /** « Une entreprise de Technologies Krizaka · Fait à Montréal ». */\n line: Record<SiteLocale, string>;\n legal: readonly { id: string; label: Record<SiteLocale, string>; url: Record<SiteLocale, string> }[];\n };\n}\n\n/** One entry of `org.family` (`@krizaka/org`), the part the footer reads. */\nexport interface OrgFamilyEntry {\n id: string;\n name: string;\n group: SiteGroup;\n status: SiteStatus;\n url: string;\n}\n\n/** The family's words with the organisation's facts in them: the place line is the org's, not a copy. */\nexport function orgFamilyLabels(org: OrgFacts, locale: SiteLocale): FamilyLabels {\n return { ...familyLabels[locale], place: org.footer.line[locale] };\n}\n"
|
|
102
|
+
"content": "// Server-safe: plain data. The Krizaka family — every site Krizaka runs, once. The family switcher of the bar\n// (`NavBar.Family`) and the common footer (`SiteFooter`) both read it, so adding a site is one release of this package:\n// every bar and every footer of the family follow.\n//\n// The words of the family (a site's one line, the groups, the statuses, the footer's signature) are brand data, written\n// here in English and French (`familyLabels`) — a site passes the set of its locale, or its own translation.\n\nimport type { OrgSocialLink } from \"../site-footer/footer-config\";\n\n/** A site of the family. */\nexport type SiteId = \"krizaka\" | \"sovkora\" | \"verikora\" | \"folioviv\" | \"ui\" | \"java\" | \"ts\" | \"motion\" | \"github\";\n\n/** What a site is: the company, a product, or an open-source project. It chooses the footer's signature line. */\nexport type SiteKind = \"company\" | \"product\" | \"open-source\";\n\n/**\n * `released`: open to visit. `upcoming`: announced, not released yet (said \"Coming soon\"). `construction`: under\n * construction — nothing offered (a QA-only app may run; the public page says so). `development`: being built in the\n * open, with a dev site (said \"In development\"). A site with none yet would use its repository as its address.\n */\nexport type SiteStatus = \"released\" | \"upcoming\" | \"construction\" | \"development\";\n\n/** The groups of the family, in reading order: Krizaka · Products · Open source · GitHub. */\nexport type SiteGroup = \"krizaka\" | \"products\" | \"open-source\" | \"github\";\n\n/** The mark a site wears: a brand of `ProductLogo` (Krizaka UI and Krizaka Java wear Krizaka's), or GitHub's. */\nexport type SiteMark = \"krizaka\" | \"sovkora\" | \"verikora\" | \"folioviv\" | \"github\";\n\nexport interface Site {\n readonly id: SiteId;\n /** The name, never translated. */\n readonly name: string;\n /** The address of the site (its home). */\n readonly url: string;\n /** The address without the scheme, as people say it (`ui.krizaka.com`). */\n readonly host: string;\n readonly kind: SiteKind;\n readonly group: SiteGroup;\n readonly status: SiteStatus;\n readonly mark: SiteMark;\n /** The repository the site is built from. */\n readonly repo: string;\n}\n\n/** The address as a person reads it: the host, and the path when there is one (`github.com/krizaka`). */\nconst hostOf = (url: string): string => {\n const { host, pathname } = new URL(url);\n return pathname === \"/\" ? host : host + pathname;\n};\nconst site = (s: Omit<Site, \"host\">): Site => ({ ...s, host: hostOf(s.url) });\n\n/** Every site of the family, in reading order (the group order, then the order inside each group). */\nexport const sites: readonly Site[] = [\n site({ id: \"krizaka\", name: \"Krizaka\", url: \"https://www.krizaka.com\", kind: \"company\", group: \"krizaka\", status: \"released\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-com\" }),\n site({ id: \"sovkora\", name: \"Sovkora\", url: \"https://www.sovkora.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"sovkora\", repo: \"https://github.com/krizaka/sovkora\" }),\n site({ id: \"verikora\", name: \"Verikora\", url: \"https://www.verikora.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"verikora\", repo: \"https://github.com/krizaka/verikora\" }),\n site({ id: \"folioviv\", name: \"Folioviv\", url: \"https://www.folioviv.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"folioviv\", repo: \"https://github.com/krizaka/folioviv\" }),\n site({ id: \"ui\", name: \"Krizaka UI\", url: \"https://ui.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-ui\" }),\n site({ id: \"java\", name: \"Krizaka Java\", url: \"https://java.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-java\" }),\n site({ id: \"ts\", name: \"Krizaka TypeScript\", url: \"https://ts.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-ts\" }),\n // The family lab: built in the open, served at lab.krizaka.com; what proves itself there moves into Krizaka UI.\n site({ id: \"motion\", name: \"Krizaka Lab\", url: \"https://lab.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-lab\" }),\n site({ id: \"github\", name: \"GitHub\", url: \"https://github.com/krizaka\", kind: \"open-source\", group: \"github\", status: \"released\", mark: \"github\", repo: \"https://github.com/krizaka\" }),\n];\n\n/** The groups, in reading order. */\nexport const siteGroups: readonly SiteGroup[] = [\"krizaka\", \"products\", \"open-source\", \"github\"];\n\n/** A site by id. */\nexport function siteById(id: SiteId): Site {\n const found = sites.find((s) => s.id === id);\n if (!found) throw new Error(`Unknown Krizaka site \"${id}\".`);\n return found;\n}\n\n/** The family grouped, in reading order: `[{ group, sites }]`, empty groups left out. */\nexport function sitesByGroup(): { group: SiteGroup; sites: Site[] }[] {\n return siteGroups.map((group) => ({ group, sites: sites.filter((s) => s.group === group) })).filter((g) => g.sites.length > 0);\n}\n\n/** The languages the family's words are written in. */\nexport type SiteLocale = \"en\" | \"fr\";\n\n/** The company's own pages, the footer's « Krizaka » column (the brand's home is the signature line's link). */\nexport type CompanyLinkId = \"story\" | \"blog\" | \"contact\";\nexport const companyLinks: readonly { id: CompanyLinkId; url: Record<SiteLocale, string> }[] = [\n { id: \"story\", url: { en: \"https://www.krizaka.com/story\", fr: \"https://www.krizaka.com/fr/story\" } },\n { id: \"blog\", url: { en: \"https://blog.krizaka.com\", fr: \"https://blog.krizaka.com\" } },\n { id: \"contact\", url: { en: \"https://www.krizaka.com/contact\", fr: \"https://www.krizaka.com/fr/contact\" } },\n];\n\n/** The words of the family: the switcher, the footer, each site's one line. */\nexport interface FamilyLabels {\n /** The family's name: the switcher's navigation and its button, the footer's navigation (“Krizaka family”). */\n family: string;\n /** The heading of each group. */\n groups: Record<SiteGroup, string>;\n /** The badge of a site that is not released. */\n status: Record<Exclude<SiteStatus, \"released\">, string>;\n /** Says which site is the current one (“You are here”). */\n current: string;\n /** One line per site: what it is. */\n descriptions: Record<SiteId, string>;\n /** The footer's signature, by the kind of the current site (“A Krizaka product”). */\n signature: Record<SiteKind, string>;\n /** The footer's place line (“Made in Montréal”). */\n place: string;\n /** The accessible name of the version (“Version”). */\n version: string;\n /** The language of these words: the company links open in it. @default \"en\" */\n lang?: SiteLocale;\n /** The company's pages in the footer's « Krizaka » column. @default the English words */\n company?: Record<CompanyLinkId, string>;\n}\n\n/** The family's words in English and French. Pass `familyLabels[locale]`, or your own translation of the same shape. */\nexport const familyLabels: Record<SiteLocale, FamilyLabels> = {\n en: {\n family: \"Krizaka family\",\n groups: { krizaka: \"Krizaka\", products: \"Products\", \"open-source\": \"Open source\", github: \"GitHub\" },\n status: { upcoming: \"Coming soon\", construction: \"Under construction\", development: \"In development\" },\n current: \"You are here\",\n descriptions: {\n krizaka: \"The company: our products, our open source, our story.\",\n sovkora: \"Sovereign AI on your own servers: chat, documents, images and video — and the engine under the other products.\",\n verikora: \"Verikora reads your leases, contracts and invoices.\",\n folioviv: \"Running a shop in Québec, for less — Loi 25 by design.\",\n ui: \"Components, tokens, icons and charts — web and React Native.\",\n java: \"Spring Boot building blocks on Maven Central.\",\n ts: \"TypeScript backend building blocks on npm.\",\n motion: \"The family lab: the kit's motion, played live with its knobs.\",\n github: \"Every repository, in the open.\",\n },\n signature: { company: \"A Krizaka company\", product: \"A Krizaka product\", \"open-source\": \"A Krizaka open-source project\" },\n place: \"Made in Montréal\",\n version: \"Version\",\n lang: \"en\",\n company: { story: \"Our story\", blog: \"Blog\", contact: \"Contact us\" },\n },\n fr: {\n family: \"Famille Krizaka\",\n groups: { krizaka: \"Krizaka\", products: \"Produits\", \"open-source\": \"Open source\", github: \"GitHub\" },\n status: { upcoming: \"Bientôt\", construction: \"En construction\", development: \"En développement\" },\n current: \"Vous êtes ici\",\n descriptions: {\n krizaka: \"La compagnie : nos produits, notre open source, notre histoire.\",\n sovkora: \"L’IA souveraine sur vos propres serveurs : conversation, documents, images et vidéo — et le moteur des autres produits.\",\n verikora: \"Verikora lit vos baux, contrats et factures.\",\n folioviv: \"Tenir une boutique au Québec, pour moins cher — Loi 25 dès la conception.\",\n ui: \"Composants, jetons, icônes et graphiques — web et React Native.\",\n java: \"Des briques Spring Boot sur Maven Central.\",\n ts: \"Des briques backend TypeScript sur npm.\",\n motion: \"Le labo du mouvement : le mouvement du kit, joué en direct, avec ses réglages.\",\n github: \"Tous les dépôts, au grand jour.\",\n },\n signature: { company: \"Une compagnie Krizaka\", product: \"Un produit Krizaka\", \"open-source\": \"Un projet open source de Krizaka\" },\n place: \"Fait à Montréal\",\n version: \"Version\",\n lang: \"fr\",\n company: { story: \"Notre histoire\", blog: \"Blogue\", contact: \"Nous écrire\" },\n },\n};\n\n/**\n * What the footer and the bar read from `@krizaka/org` (the organisation's public facts, one validated JSON): the brand's\n * name, the footer line and the legal links, each in both languages. Structural: the whole `Org` of `@krizaka/org` fits.\n */\nexport interface OrgFacts {\n brand: { name: string };\n /**\n * The company's own accounts elsewhere (`org.links.social` of `@krizaka/org` ≥ 1.1.0): the footer draws each one as its\n * icon, linked to the address given here — never typed in a site. Optional so an older `org` still fits.\n */\n links?: { social: readonly OrgSocialLink[] };\n /**\n * Every name of the family (`org.family` of `@krizaka/org`, krizaka/krizaka-internal#754): when given, the footer reads\n * the names and addresses here, never from this package's registry — the company « Krizaka », products by their own\n * name, libraries « Krizaka <X> ».\n */\n family?: readonly OrgFamilyEntry[];\n footer: {\n /** « Une entreprise de Technologies Krizaka · Fait à Montréal ». */\n line: Record<SiteLocale, string>;\n legal: readonly { id: string; label: Record<SiteLocale, string>; url: Record<SiteLocale, string> }[];\n };\n}\n\n/** One entry of `org.family` (`@krizaka/org`), the part the footer reads. */\nexport interface OrgFamilyEntry {\n id: string;\n name: string;\n group: SiteGroup;\n status: SiteStatus;\n url: string;\n}\n\n/** The family's words with the organisation's facts in them: the place line is the org's, not a copy. */\nexport function orgFamilyLabels(org: OrgFacts, locale: SiteLocale): FamilyLabels {\n return { ...familyLabels[locale], place: org.footer.line[locale] };\n}\n"
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
105
|
"dependencies": [],
|
|
106
|
-
"registryDependencies": [
|
|
106
|
+
"registryDependencies": [
|
|
107
|
+
"site-footer"
|
|
108
|
+
],
|
|
107
109
|
"demo": {
|
|
108
110
|
"path": "examples/sites/family.tsx",
|
|
109
111
|
"content": "import { familyLabels, sitesByGroup } from \"@krizaka/ui/sites\";\n\n// The family as data: every site of Krizaka, grouped as the bar's switcher and the footer show it. A new site is one\n// release of @krizaka/ui — every bar and every footer follow.\nexport default function SitesFamily() {\n const t = familyLabels.en;\n return (\n <div className=\"grid w-full max-w-xl gap-5 sm:grid-cols-2\">\n {sitesByGroup().map(({ group, sites }) => (\n <section key={group} aria-label={t.groups[group]} className=\"grid content-start gap-2\">\n <h3 className=\"text-[11px] font-semibold uppercase tracking-wider text-fg-secondary\">{t.groups[group]}</h3>\n <ul className=\"grid gap-2\">\n {sites.map((site) => (\n <li key={site.id} className=\"rounded-xl border border-border-subtle bg-surface-1 p-3\">\n <a href={site.url} className=\"text-sm font-semibold text-fg\">{site.name}</a>\n <span className=\"ml-2 font-mono text-xs text-fg-secondary\">{site.host}</span>\n {site.status !== \"released\" && (\n <span className=\"ml-2 rounded-full bg-surface-3 px-1.5 text-[10px] font-semibold uppercase text-fg-secondary\">\n {t.status[site.status]}\n </span>\n )}\n <p className=\"mt-1 text-xs text-fg-secondary\">{t.descriptions[site.id]}</p>\n </li>\n ))}\n </ul>\n </section>\n ))}\n </div>\n );\n}\n"
|