@eifi1/ui-kit 0.51.2 → 0.51.3
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/components/legal-labels.js +2 -1
- package/dist/components/legal-labels.js.map +1 -1
- package/dist/components/legal-page.d.ts +18 -3
- package/dist/components/legal-page.js +9 -0
- package/dist/components/legal-page.js.map +1 -1
- package/dist/components/legal.d.ts +10 -1
- package/dist/components/legal.js +2 -0
- package/dist/components/legal.js.map +1 -1
- package/dist/eslint/index.js +1 -1
- package/dist/i18n/german.js +2 -1
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/locales/en.js +2 -1
- package/dist/i18n/locales/en.js.map +2 -2
- package/dist/i18n/locales/es.js +2 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.js +2 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.js +2 -1
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.js +2 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.js +2 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/review.js +2 -0
- package/dist/i18n/review.js.map +1 -1
- package/package.json +1 -1
- package/src/components/legal-labels.ts +2 -1
- package/src/components/legal-page.tsx +33 -2
- package/src/components/legal.tsx +11 -0
- package/src/i18n/german.ts +2 -1
- package/src/i18n/locales/es.ts +2 -1
- package/src/i18n/locales/fr.ts +2 -1
- package/src/i18n/locales/hu.ts +2 -1
- package/src/i18n/locales/it.ts +2 -1
- package/src/i18n/locales/zh.ts +2 -1
- package/src/i18n/review.ts +2 -0
|
@@ -21,6 +21,7 @@ const DEFAULT_LEGAL_LABELS = {
|
|
|
21
21
|
note: (o) => `This is a translation for your convenience. The ${o.bindingLanguage} version is binding.`,
|
|
22
22
|
show: (o) => `Show the ${o.bindingLanguage} version`
|
|
23
23
|
},
|
|
24
|
+
updated: (date) => `Last updated: ${date}`,
|
|
24
25
|
sections: {
|
|
25
26
|
impressum: {
|
|
26
27
|
operator: {
|
|
@@ -81,7 +82,7 @@ The full postal address is supplied on request to data subjects and supervisory
|
|
|
81
82
|
},
|
|
82
83
|
changes: {
|
|
83
84
|
title: "Changes to these terms",
|
|
84
|
-
body: "
|
|
85
|
+
body: "We may update these terms as the service evolves. We announce a material change at least 30 days before it takes effect, by email and in the app, together with the new text. If you do not agree, you can object or delete your account before that date, and you can export your data until then. If you keep using the service after that date, the changed terms apply."
|
|
85
86
|
},
|
|
86
87
|
language: {
|
|
87
88
|
title: "Language",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/legal-labels.ts"],"sourcesContent":["// The English words of ./legal, in a module with no component code: the English catalogue\n// (src/i18n/defaults.ts) imports them without the component, so `en` loads as one chunk\n// like the other languages (0.34, KS U8). ./legal re-exports them.\n\nimport type { LegalLabels } from \"./legal\";\n\nexport const DEFAULT_LEGAL_LABELS: LegalLabels = {\n navLabel: \"Legal\",\n links: {\n impressum: \"Imprint\",\n privacy: \"Privacy Policy\",\n terms: \"Terms\",\n },\n titles: {\n impressum: \"Imprint\",\n privacy: \"Privacy Policy\",\n terms: \"Terms of Service\",\n },\n backHome: \"Back to home\",\n accept: \"I accept the {terms} and the {privacy}\",\n notice: {\n beta: \"Closed beta. These texts have not been reviewed by a lawyer yet and will be before a public launch.\",\n privacy:\n \"Closed beta. The legal wording below has not been reviewed by a lawyer yet and will be before a public launch. The technical descriptions — what is stored, where, and who can read it — describe what the software actually does today, and are meant to be checked against it.\",\n },\n translation: {\n note: (o) =>\n `This is a translation for your convenience. The ${o.bindingLanguage} version is binding.`,\n show: (o) => `Show the ${o.bindingLanguage} version`,\n },\n sections: {\n impressum: {\n operator: {\n title: \"Operator\",\n body: (o) =>\n `${o.name}\\n${o.postalCode} ${o.city}\\n${o.country}\\n\\nThe full postal address is supplied on request to anyone with a legitimate legal interest; write to the contact address below.`,\n },\n contact: {\n title: \"Contact\",\n body: (o) => `Email: ${o.email}`,\n },\n disclaimer: {\n title: \"Liability for content and links\",\n body: \"This is a private, non-commercial project offered during a closed beta, without warranty. External sites we link to are the responsibility of their respective operators; we have no control over their content.\",\n commercial:\n \"This is a commercial service. Paid plans are sold by our reseller, which acts as the Merchant of Record: it sells the subscription in its own name, takes the payment, issues the invoice and handles VAT, and its terms of sale apply to the purchase. We take care that the content of this service is accurate, but cannot guarantee that it is complete or up to date. External sites we link to are the responsibility of their respective operators; we have no control over their content.\",\n },\n },\n privacy: {\n controller: {\n title: \"Controller\",\n body: (o) =>\n `The party responsible for processing personal data in this service is:\\n${o.name}\\n${o.postalCode} ${o.city}, ${o.country}\\nEmail: ${o.email}\\n\\nThe full postal address is supplied on request to data subjects and supervisory authorities.`,\n },\n legal_basis: {\n title: \"Legal basis\",\n body: \"As the operator is based in Switzerland, processing is governed by the Swiss Federal Act on Data Protection (FADP). Where the EU General Data Protection Regulation (GDPR) applies to you, we rely on the performance of a contract to provide the service (Art. 6(1)(b) GDPR) and our legitimate interest in operating and securing it (Art. 6(1)(f) GDPR).\",\n },\n browser: {\n title: \"What your browser stores\",\n lead: \"No cookies. The app keeps the following in your browser's storage:\",\n tail: \"None of it is used to track you. Entries waiting to be sent are sent to us as soon as they can be; everything else stays on your device. All of it disappears when you clear the site's data, and signing out removes the sign-in tokens.\",\n },\n rights: {\n title: \"Your rights\",\n lead: \"You have the right to access, rectification, erasure, restriction, data portability and objection.\",\n tail: \"If you are in Switzerland you may contact the Federal Data Protection and Information Commissioner (FDPIC); if you are in the EU you may lodge a complaint with your local supervisory authority.\",\n },\n contact: {\n title: \"Contact for data protection\",\n body: (o) => `For any privacy request, contact: ${o.email}`,\n },\n },\n terms: {\n warranty: {\n title: \"No warranty\",\n body: 'The service is provided \"as is\" and \"as available\", without warranties of any kind to the extent permitted by law. As a beta it may contain errors, change, or be interrupted at any time — keep your own backups of important data.',\n },\n liability: {\n title: \"Limitation of liability\",\n body: \"To the extent permitted by applicable law, the operator is not liable for any indirect or consequential damage arising from the use of, or inability to use, the service. Nothing here limits liability that cannot be limited by law.\",\n },\n changes: {\n title: \"Changes to these terms\",\n body: \"
|
|
1
|
+
{"version":3,"sources":["../../src/components/legal-labels.ts"],"sourcesContent":["// The English words of ./legal, in a module with no component code: the English catalogue\n// (src/i18n/defaults.ts) imports them without the component, so `en` loads as one chunk\n// like the other languages (0.34, KS U8). ./legal re-exports them.\n\nimport type { LegalLabels } from \"./legal\";\n\nexport const DEFAULT_LEGAL_LABELS: LegalLabels = {\n navLabel: \"Legal\",\n links: {\n impressum: \"Imprint\",\n privacy: \"Privacy Policy\",\n terms: \"Terms\",\n },\n titles: {\n impressum: \"Imprint\",\n privacy: \"Privacy Policy\",\n terms: \"Terms of Service\",\n },\n backHome: \"Back to home\",\n accept: \"I accept the {terms} and the {privacy}\",\n notice: {\n beta: \"Closed beta. These texts have not been reviewed by a lawyer yet and will be before a public launch.\",\n privacy:\n \"Closed beta. The legal wording below has not been reviewed by a lawyer yet and will be before a public launch. The technical descriptions — what is stored, where, and who can read it — describe what the software actually does today, and are meant to be checked against it.\",\n },\n translation: {\n note: (o) =>\n `This is a translation for your convenience. The ${o.bindingLanguage} version is binding.`,\n show: (o) => `Show the ${o.bindingLanguage} version`,\n },\n updated: (date) => `Last updated: ${date}`,\n sections: {\n impressum: {\n operator: {\n title: \"Operator\",\n body: (o) =>\n `${o.name}\\n${o.postalCode} ${o.city}\\n${o.country}\\n\\nThe full postal address is supplied on request to anyone with a legitimate legal interest; write to the contact address below.`,\n },\n contact: {\n title: \"Contact\",\n body: (o) => `Email: ${o.email}`,\n },\n disclaimer: {\n title: \"Liability for content and links\",\n body: \"This is a private, non-commercial project offered during a closed beta, without warranty. External sites we link to are the responsibility of their respective operators; we have no control over their content.\",\n commercial:\n \"This is a commercial service. Paid plans are sold by our reseller, which acts as the Merchant of Record: it sells the subscription in its own name, takes the payment, issues the invoice and handles VAT, and its terms of sale apply to the purchase. We take care that the content of this service is accurate, but cannot guarantee that it is complete or up to date. External sites we link to are the responsibility of their respective operators; we have no control over their content.\",\n },\n },\n privacy: {\n controller: {\n title: \"Controller\",\n body: (o) =>\n `The party responsible for processing personal data in this service is:\\n${o.name}\\n${o.postalCode} ${o.city}, ${o.country}\\nEmail: ${o.email}\\n\\nThe full postal address is supplied on request to data subjects and supervisory authorities.`,\n },\n legal_basis: {\n title: \"Legal basis\",\n body: \"As the operator is based in Switzerland, processing is governed by the Swiss Federal Act on Data Protection (FADP). Where the EU General Data Protection Regulation (GDPR) applies to you, we rely on the performance of a contract to provide the service (Art. 6(1)(b) GDPR) and our legitimate interest in operating and securing it (Art. 6(1)(f) GDPR).\",\n },\n browser: {\n title: \"What your browser stores\",\n lead: \"No cookies. The app keeps the following in your browser's storage:\",\n tail: \"None of it is used to track you. Entries waiting to be sent are sent to us as soon as they can be; everything else stays on your device. All of it disappears when you clear the site's data, and signing out removes the sign-in tokens.\",\n },\n rights: {\n title: \"Your rights\",\n lead: \"You have the right to access, rectification, erasure, restriction, data portability and objection.\",\n tail: \"If you are in Switzerland you may contact the Federal Data Protection and Information Commissioner (FDPIC); if you are in the EU you may lodge a complaint with your local supervisory authority.\",\n },\n contact: {\n title: \"Contact for data protection\",\n body: (o) => `For any privacy request, contact: ${o.email}`,\n },\n },\n terms: {\n warranty: {\n title: \"No warranty\",\n body: 'The service is provided \"as is\" and \"as available\", without warranties of any kind to the extent permitted by law. As a beta it may contain errors, change, or be interrupted at any time — keep your own backups of important data.',\n },\n liability: {\n title: \"Limitation of liability\",\n body: \"To the extent permitted by applicable law, the operator is not liable for any indirect or consequential damage arising from the use of, or inability to use, the service. Nothing here limits liability that cannot be limited by law.\",\n },\n changes: {\n title: \"Changes to these terms\",\n body: \"We may update these terms as the service evolves. We announce a material change at least 30 days before it takes effect, by email and in the app, together with the new text. If you do not agree, you can object or delete your account before that date, and you can export your data until then. If you keep using the service after that date, the changed terms apply.\",\n },\n language: {\n title: \"Language\",\n body: (o) =>\n `These terms are written in ${o.bindingLanguage}. Translations into other languages are provided for convenience only; where a translation differs, the ${o.bindingLanguage} version prevails.`,\n },\n law: {\n title: \"Governing law\",\n body: (o) =>\n `These terms are governed by Swiss law, excluding its conflict-of-laws rules. As far as legally permissible, the place of jurisdiction is ${o.city} (${o.region}), ${o.country}.`,\n },\n },\n },\n};\n"],"mappings":";AAMO,MAAM,uBAAoC;AAAA,EAC/C,UAAU;AAAA,EACV,OAAO;AAAA,IACL,WAAW;AAAA,IACX,SAAS;AAAA,IACT,OAAO;AAAA,EACT;AAAA,EACA,QAAQ;AAAA,IACN,WAAW;AAAA,IACX,SAAS;AAAA,IACT,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA,aAAa;AAAA,IACX,MAAM,CAAC,MACL,mDAAmD,EAAE,eAAe;AAAA,IACtE,MAAM,CAAC,MAAM,YAAY,EAAE,eAAe;AAAA,EAC5C;AAAA,EACA,SAAS,CAAC,SAAS,iBAAiB,IAAI;AAAA,EACxC,UAAU;AAAA,IACR,WAAW;AAAA,MACT,UAAU;AAAA,QACR,OAAO;AAAA,QACP,MAAM,CAAC,MACL,GAAG,EAAE,IAAI;AAAA,EAAK,EAAE,UAAU,IAAI,EAAE,IAAI;AAAA,EAAK,EAAE,OAAO;AAAA;AAAA;AAAA,MACtD;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM,CAAC,MAAM,UAAU,EAAE,KAAK;AAAA,MAChC;AAAA,MACA,YAAY;AAAA,QACV,OAAO;AAAA,QACP,MAAM;AAAA,QACN,YACE;AAAA,MACJ;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,YAAY;AAAA,QACV,OAAO;AAAA,QACP,MAAM,CAAC,MACL;AAAA,EAA2E,EAAE,IAAI;AAAA,EAAK,EAAE,UAAU,IAAI,EAAE,IAAI,KAAK,EAAE,OAAO;AAAA,SAAY,EAAE,KAAK;AAAA;AAAA;AAAA,MACjJ;AAAA,MACA,aAAa;AAAA,QACX,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM,CAAC,MAAM,qCAAqC,EAAE,KAAK;AAAA,MAC3D;AAAA,IACF;AAAA,IACA,OAAO;AAAA,MACL,UAAU;AAAA,QACR,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,WAAW;AAAA,QACT,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,UAAU;AAAA,QACR,OAAO;AAAA,QACP,MAAM,CAAC,MACL,8BAA8B,EAAE,eAAe,2GAA2G,EAAE,eAAe;AAAA,MAC/K;AAAA,MACA,KAAK;AAAA,QACH,OAAO;AAAA,QACP,MAAM,CAAC,MACL,4IAA4I,EAAE,IAAI,KAAK,EAAE,MAAM,MAAM,EAAE,OAAO;AAAA,MAClL;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -138,6 +138,18 @@ export interface LegalPageProps {
|
|
|
138
138
|
/** Default: the kit's beta notice on the imprint and the terms, its privacy notice on
|
|
139
139
|
* the privacy policy (§3.2). `null` for none. */
|
|
140
140
|
notice?: ReactNode;
|
|
141
|
+
/**
|
|
142
|
+
* 0.51.3: the day this page's text last changed, "YYYY-MM-DD" (legal benchmark
|
|
143
|
+
* 2026-10-29, gap 8). Shown under the title as `legal.updated` — "Last updated:
|
|
144
|
+
* 29 October 2026", "Stand: 29. Oktober 2026" — with the date written out in `locale`,
|
|
145
|
+
* so it follows the page's language like every other kit word, the switch to the
|
|
146
|
+
* binding version included. Left out, no line. One date per page: the imprint, the
|
|
147
|
+
* privacy policy and the terms change on their own days.
|
|
148
|
+
*
|
|
149
|
+
* An app that records which terms someone accepted (keksdose) stores the terms page's
|
|
150
|
+
* date: it is the version the reader saw.
|
|
151
|
+
*/
|
|
152
|
+
updated?: string;
|
|
141
153
|
/**
|
|
142
154
|
* 0.28.1: switches the app to the operator's `bindingLanguage` — the button after the
|
|
143
155
|
* translation note on a page read in another language. Without it the note stands
|
|
@@ -172,6 +184,7 @@ export interface LegalPageProps {
|
|
|
172
184
|
*
|
|
173
185
|
* What it adds to the column:
|
|
174
186
|
* - the title, from `legal.titles`, and "← Back to home" pointing at `homeHref`;
|
|
187
|
+
* - the as-of line under the title, from `updated` (0.51.3);
|
|
175
188
|
* - the default notice per page — the beta notice, or the privacy notice on the privacy
|
|
176
189
|
* policy, whose technical sections describe running code (§3.2, §7.3);
|
|
177
190
|
* - numbers: the privacy and terms sections are "N. Title" in render order, the
|
|
@@ -184,7 +197,7 @@ export interface LegalPageProps {
|
|
|
184
197
|
* (see `children` for what that asks of the tree);
|
|
185
198
|
* - `useNoIndex()`.
|
|
186
199
|
*/
|
|
187
|
-
export declare function LegalPage({ page, operator, children, header, footer, homeHref, notice, onShowBindingLanguage, locale: localeProp, headingAs, landmark, noIndex, className, labels: labelsProp, }: LegalPageProps): import("react").JSX.Element;
|
|
200
|
+
export declare function LegalPage({ page, operator, children, header, footer, homeHref, notice, updated, onShowBindingLanguage, locale: localeProp, headingAs, landmark, noIndex, className, labels: labelsProp, }: LegalPageProps): import("react").JSX.Element;
|
|
188
201
|
export interface LegalAcceptCheckboxProps extends Omit<CheckboxProps, "label" | "checked" | "onCheckedChange" | "required"> {
|
|
189
202
|
checked: boolean;
|
|
190
203
|
onCheckedChange: (checked: boolean) => void;
|
|
@@ -201,8 +214,10 @@ export interface LegalAcceptCheckboxProps extends Omit<CheckboxProps, "label" |
|
|
|
201
214
|
*
|
|
202
215
|
* A REQUIRED kit `Checkbox` — not a Switch: a form answer that waits for the submit
|
|
203
216
|
* button. The app keeps its submit disabled while it is unticked, so there is never a
|
|
204
|
-
* failed attempt and no `error` to show.
|
|
205
|
-
*
|
|
217
|
+
* failed attempt and no `error` to show. The checkbox itself sends nothing and asks for
|
|
218
|
+
* no re-acceptance (Marcel, §2.4). An app that records which terms someone accepted
|
|
219
|
+
* stores, with the account, the terms page's `updated` date — the version the reader
|
|
220
|
+
* saw — on its own (keksdose since 2026-10-29; §3.4).
|
|
206
221
|
*
|
|
207
222
|
* The label is ONE template, `legal.accept`, so a language puts the links where its
|
|
208
223
|
* grammar needs them, articles included — fr "J’accepte les {terms} et la {privacy}",
|
|
@@ -5,6 +5,8 @@ import { ArrowLeft } from "lucide-react";
|
|
|
5
5
|
import { UiKitProvider, useKitLocale } from "../i18n/kit-labels.js";
|
|
6
6
|
import { useNoIndex } from "../hooks/use-noindex.js";
|
|
7
7
|
import { cn } from "../lib/cn.js";
|
|
8
|
+
import { parseIsoDate } from "../lib/dates.js";
|
|
9
|
+
import { formatDate } from "../lib/format.js";
|
|
8
10
|
import { Checkbox } from "./checkbox.js";
|
|
9
11
|
import {
|
|
10
12
|
DEFAULT_LEGAL_LABELS,
|
|
@@ -185,6 +187,7 @@ function LegalPage({
|
|
|
185
187
|
footer,
|
|
186
188
|
homeHref = "/",
|
|
187
189
|
notice,
|
|
190
|
+
updated,
|
|
188
191
|
onShowBindingLanguage,
|
|
189
192
|
locale: localeProp,
|
|
190
193
|
headingAs = "h1",
|
|
@@ -218,6 +221,11 @@ function LegalPage({
|
|
|
218
221
|
/* @__PURE__ */ jsx(Button, { type: "button", variant: "link", size: "sm", className: "h-auto p-0 align-baseline", onClick: onShowBindingLanguage, children: labels.translation.show(operatorText) })
|
|
219
222
|
] })
|
|
220
223
|
] }) : void 0;
|
|
224
|
+
const updatedValid = updated !== void 0 && parseIsoDate(updated) !== null;
|
|
225
|
+
if (updated !== void 0 && !updatedValid) {
|
|
226
|
+
warnLegalOnce(`LegalPage: updated="${updated}" is not a "YYYY-MM-DD" date; no "Last updated" line is shown.`);
|
|
227
|
+
}
|
|
228
|
+
const updatedLine = updatedValid ? /* @__PURE__ */ jsx("time", { dateTime: updated, children: (labels.updated ?? DEFAULT_LEGAL_LABELS.updated)(formatDate(updated, "long", { locale })) }) : void 0;
|
|
221
229
|
return /* @__PURE__ */ jsx(UiKitProvider, { labels: overrides, children: /* @__PURE__ */ jsxs("div", { className: cn("flex min-h-full flex-col", className), children: [
|
|
222
230
|
header,
|
|
223
231
|
/* @__PURE__ */ jsx(Main, { className: "flex-1", children: /* @__PURE__ */ jsx(LegalPageContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
@@ -226,6 +234,7 @@ function LegalPage({
|
|
|
226
234
|
back: /* @__PURE__ */ jsx(TextLink, { href: homeHref, icon: ArrowLeft, children: labels.backHome }),
|
|
227
235
|
title: labels.titles[page],
|
|
228
236
|
notice: shownNotice,
|
|
237
|
+
updated: updatedLine,
|
|
229
238
|
translationNote,
|
|
230
239
|
headingAs,
|
|
231
240
|
children: nodes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/legal-page.tsx"],"sourcesContent":["import { Fragment, isValidElement, useContext, useMemo } from \"react\";\nimport type { ReactNode, Ref } from \"react\";\nimport { ArrowLeft } from \"lucide-react\";\n\nimport { UiKitProvider, useKitLocale } from \"../i18n/kit-labels\";\nimport type { LabelOverride, UiKitLabelOverrides } from \"../i18n/kit-labels\";\nimport { useNoIndex } from \"../hooks/use-noindex\";\nimport { cn } from \"../lib/cn\";\nimport { Checkbox } from \"./checkbox\";\nimport type { CheckboxProps } from \"./checkbox\";\nimport {\n DEFAULT_LEGAL_LABELS,\n LEGAL_HREFS,\n baseLanguage,\n LegalFooter,\n LegalLayout,\n LegalPageContext,\n LegalSection,\n LegalSlotContext,\n LegalText,\n legalOperatorText,\n useLegalLabels,\n warnLegalOnce,\n} from \"./legal\";\nimport type {\n LegalDisclaimerSectionLabels,\n LegalFramedSectionLabels,\n LegalLabels,\n LegalOperator,\n LegalOperatorSectionLabels,\n LegalOperatorText,\n LegalPageContextValue,\n LegalPageKey,\n LegalRefTarget,\n LegalSectionProps,\n LegalTextSectionLabels,\n} from \"./legal\";\nimport { TextLink } from \"./text-link\";\nimport { Button } from \"./button\";\n\n/**\n * The legal pages' frame and the kit's own sections — docs/legal-harmonization.md §3\n * and §4, the 0.28 round. The labels, the column, `LegalSection`, the links and the\n * footer are in `./legal`.\n */\n\n// ── The skeleton (§4.2) ───────────────────────────────────────────────────────\n\n/** Who writes a section: the kit's wording, the app's own, or the kit's wording with an\n * app paragraph in a fixed slot. */\nexport type LegalSectionOwner = \"kit\" | \"app\" | \"kit+app\";\n\nexport interface LegalSkeletonEntry {\n /** The section key — its `id` and its catalogue key. `\"*\"` is the slot where the\n * app's own sections go (zero or more: keksdose's `credits`, `price_pool`, …). */\n key: string;\n owner: LegalSectionOwner;\n}\n\nexport interface LegalSkeletonPage {\n /** Whether the page numbers its sections (\"3. Legal basis\"). The imprint does not. */\n numbered: boolean;\n /** The sections in their order. */\n sections: readonly LegalSkeletonEntry[];\n}\n\n/**\n * The section order every app's legal pages follow (§4.2), as data — so an app's test\n * can assert that its pages do, and so the order lives in one place, not in three apps'\n * reading of a table. `LegalPage` reads `numbered` from it.\n *\n * An app's test, given the section ids its page rendered in order:\n *\n * const fixed = LEGAL_SKELETON.privacy.sections.map((s) => s.key).filter((k) => k !== \"*\");\n * expect(ids.filter((id) => fixed.includes(id))).toEqual(fixed);\n *\n * Every fixed key is there, in the skeleton's order; the ids that are not in it are the\n * app's own sections, which belong where `\"*\"` stands.\n */\nexport const LEGAL_SKELETON: Readonly<Record<LegalPageKey, LegalSkeletonPage>> = Object.freeze({\n impressum: Object.freeze({\n numbered: false,\n sections: Object.freeze([\n { key: \"operator\", owner: \"kit\" },\n { key: \"contact\", owner: \"kit\" },\n { key: \"disclaimer\", owner: \"kit\" },\n { key: \"*\", owner: \"app\" },\n ] as const),\n }),\n privacy: Object.freeze({\n numbered: true,\n sections: Object.freeze([\n { key: \"controller\", owner: \"kit\" },\n { key: \"data\", owner: \"app\" },\n { key: \"legal_basis\", owner: \"kit+app\" },\n { key: \"third_parties\", owner: \"app\" },\n { key: \"*\", owner: \"app\" },\n { key: \"browser\", owner: \"kit+app\" },\n { key: \"transfers\", owner: \"app\" },\n { key: \"retention\", owner: \"app\" },\n { key: \"rights\", owner: \"kit+app\" },\n { key: \"contact\", owner: \"kit\" },\n ] as const),\n }),\n terms: Object.freeze({\n numbered: true,\n sections: Object.freeze([\n { key: \"scope\", owner: \"app\" },\n { key: \"no_advice\", owner: \"app\" },\n { key: \"*\", owner: \"app\" },\n { key: \"warranty\", owner: \"kit\" },\n { key: \"liability\", owner: \"kit\" },\n { key: \"changes\", owner: \"kit\" },\n // 0.28.1: which language's version prevails (the operator's `bindingLanguage`).\n { key: \"language\", owner: \"kit\" },\n { key: \"law\", owner: \"kit\" },\n ] as const),\n }),\n});\n\n/** The sections the kit writes (§4.3), on whichever page they sit. `contact` is on two\n * pages, with two texts; the page decides which. */\nexport type LegalKitSectionKey =\n | \"operator\"\n | \"contact\"\n | \"disclaimer\"\n | \"controller\"\n | \"legal_basis\"\n | \"browser\"\n | \"rights\"\n | \"warranty\"\n | \"liability\"\n | \"changes\"\n | \"language\"\n | \"law\";\n\n/** The kit's sections of one page, in the skeleton's order. */\nfunction kitSectionsOf(page: LegalPageKey): string[] {\n return LEGAL_SKELETON[page].sections.filter((s) => s.owner !== \"app\").map((s) => s.key);\n}\n\nconst PAGES: readonly LegalPageKey[] = [\"impressum\", \"privacy\", \"terms\"];\n\n// ── Kit sections ──────────────────────────────────────────────────────────────\n\ninterface LegalKitSectionBase {\n /** Default: the enclosing {@link LegalPage}'s page — needed outside one, and for\n * `contact` only (it is on two pages). */\n page?: LegalPageKey;\n /** Default: the enclosing {@link LegalPage}'s operator — needed outside one, by the\n * sections that name it (operator, both contacts, controller, law). */\n operator?: LegalOperator;\n /** Default: one level below the page's title (`h2` under an `h1`). */\n headingAs?: \"h2\" | \"h3\";\n labels?: LabelOverride<LegalLabels>;\n}\n\n/**\n * One of the kit's sections, by key. `children` is the app's paragraph where §4.2 says\n * \"kit + app\" — and only there, which the type holds an app to: the other sections'\n * wording is identical in every app, and an app that needs to say more says it in a\n * section of its own. `browser` takes the app's list of what it keeps, as `entries`.\n */\nexport type LegalKitSectionProps = LegalKitSectionBase &\n (\n | {\n section: \"browser\";\n variant?: never;\n /** What this app keeps in the browser, one entry per item — rendered as a `<ul>`\n * between the kit's two sentences. The app's words, in every language it serves. */\n entries: readonly string[];\n /** After the kit's text: what sign-out removes beyond the tokens, what stays. */\n children?: ReactNode;\n }\n | {\n section: \"legal_basis\" | \"rights\";\n variant?: never;\n entries?: never;\n /** `legal_basis`: after the kit's paragraph (consent, where an app relies on\n * it). `rights`: between the list of rights and the supervisory authorities\n * (how to export, how to delete). A plain string keeps its line breaks and has\n * its `{ref:key}` tokens resolved. */\n children?: ReactNode;\n }\n | {\n section: \"disclaimer\";\n /**\n * 0.32.0 (docs/billing-harmonization.md §8, legal decision 7): which disclaimer.\n * `non-commercial` (default) is the beta's \"private, non-commercial project\";\n * `commercial` is for an app that charges, sold through a Merchant of Record —\n * chosen per app, in the release that turns its billing on.\n */\n variant?: LegalDisclaimerVariant;\n entries?: never;\n children?: never;\n }\n | {\n section: Exclude<LegalKitSectionKey, \"browser\" | \"legal_basis\" | \"rights\" | \"disclaimer\">;\n variant?: never;\n entries?: never;\n children?: never;\n }\n );\n\n/** 0.32.0: the imprint disclaimer's two texts — see {@link LegalKitSectionProps}. */\nexport type LegalDisclaimerVariant = \"non-commercial\" | \"commercial\";\n\n/** The app's paragraph: a plain string as running text (line breaks kept, refs\n * resolved), anything else as it is. */\nfunction appPart(children: ReactNode): ReactNode {\n if (children === undefined || children === null || children === false) return null;\n if (typeof children === \"string\") return <LegalText key=\"app\" text={children} />;\n return <Fragment key=\"app\">{children}</Fragment>;\n}\n\n/**\n * One of the kit's sections (§4.3) — `<LegalKitSection section=\"warranty\" />` — with its\n * heading, its `id` (the key: `/terms#warranty`) and, on a numbered page, its number.\n *\n * The words are the kit's, in the `legal` labels, filled in with the operator; an app\n * adds only what §4.2 gives it a slot for. Inside a {@link LegalPage} the page and the\n * operator come from it, so a page reads as its section list:\n *\n * <LegalPage page=\"privacy\" operator={OPERATOR}>\n * <LegalKitSection section=\"controller\" />\n * <LegalSection key=\"data\" heading={t(\"legal.privacy.data.title\")} body={…} />\n * <LegalKitSection section=\"legal_basis\">{t(\"legal.privacy.legal_basis.app\")}</LegalKitSection>\n * …\n * </LegalPage>\n *\n * A key that is not one of the page's kit sections throws, naming the ones that are: it\n * is a typo in code, not a state a user can reach.\n */\nexport function LegalKitSection(props: LegalKitSectionProps) {\n const { section, headingAs, labels: labelsProp } = props;\n const context = useContext(LegalPageContext);\n const labels = useLegalLabels(labelsProp);\n const kitLocale = useKitLocale();\n\n const page = props.page ?? context?.page ?? onlyPageOf(section);\n const kitSections = kitSectionsOf(page);\n if (!kitSections.includes(section)) {\n throw new Error(\n `LegalKitSection: \"${section}\" is not one of the kit's sections of the ${page} page (${kitSections.join(\", \")}).`,\n );\n }\n const entry = (labels.sections[page] as Record<string, SectionLabels>)[section];\n const operator = props.operator ? legalOperatorText(props.operator, kitLocale) : context?.operator;\n const fill = (body: string | ((o: LegalOperatorText) => string)): string => {\n if (typeof body === \"string\") return body;\n if (!operator) {\n throw new Error(\n `LegalKitSection \"${section}\" names the operator: render it inside <LegalPage operator={…}>, or pass operator.`,\n );\n }\n if (section === \"language\" && !operator.bindingLanguage) {\n throw new Error(\n `LegalKitSection \"language\" names the binding language: give the operator a bindingLanguage (\"de-CH\").`,\n );\n }\n return body(operator);\n };\n\n const app = appPart(props.children);\n let parts: ReactNode[];\n if (\"lead\" in entry) {\n const lead = <LegalText key=\"lead\" text={entry.lead} />;\n const tail = <LegalText key=\"tail\" text={entry.tail} />;\n if (props.section === \"browser\") {\n const list =\n props.entries.length > 0 ? (\n <ul key=\"entries\" className=\"list-disc space-y-1 ps-5\">\n {props.entries.map((item, i) => (\n <li key={i}>{item}</li>\n ))}\n </ul>\n ) : null;\n parts = [lead, list, tail, app];\n } else {\n // `rights`: the app's paragraph sits between the rights and the authorities.\n parts = [lead, app, tail];\n }\n } else {\n // The imprint's commercial disclaimer (0.32.0): its own body under the same title.\n const commercial =\n props.section === \"disclaimer\" && props.variant === \"commercial\"\n ? ((entry as LegalDisclaimerSectionLabels).commercial ??\n DEFAULT_LEGAL_LABELS.sections.impressum.disclaimer.commercial)\n : undefined;\n parts = [<LegalText key=\"body\" text={commercial ?? fill(entry.body)} />, app];\n }\n\n return (\n <LegalSection id={section} heading={entry.title} headingAs={headingAs}>\n <div className=\"space-y-[1lh]\">{parts}</div>\n </LegalSection>\n );\n}\n\ntype SectionLabels = LegalTextSectionLabels | LegalOperatorSectionLabels | LegalFramedSectionLabels;\n\n/** The one page a kit section key is on; `contact` is on two, so it needs the page. */\nfunction onlyPageOf(section: string): LegalPageKey {\n const pages = PAGES.filter((p) => kitSectionsOf(p).includes(section));\n if (pages.length === 1) return pages[0];\n throw new Error(\n pages.length === 0\n ? `LegalKitSection: \"${section}\" is not one of the kit's sections.`\n : `LegalKitSection: \"${section}\" is on more than one page (${pages.join(\", \")}) — render it inside a LegalPage, or pass page.`,\n );\n}\n\n// ── The page ──────────────────────────────────────────────────────────────────\n\nexport interface LegalPageProps {\n /** Which page: the title, the default notice, whether the sections are numbered. */\n page: LegalPageKey;\n /** Who runs the app — the values the kit's sections name. The same in every app's\n * three pages; the kit holds none (§5). */\n operator: LegalOperator;\n /**\n * The sections, in reading order: {@link LegalKitSection}s and {@link LegalSection}s.\n *\n * They must be DIRECT children — or inside fragments, or in an array\n * (`SECTIONS.map(…)`). The page reads them before they render, to know every\n * section's number in advance: that is what lets a `{ref:key}` point forward\n * (keksdose's section 2 refers to section 10). A section wrapped in a component of the\n * app's own is invisible to that walk and renders unnumbered, with no key.\n */\n children: ReactNode;\n /** The app's public header — the one a signed-out visitor already sees (keksdose's\n * `LandingHeader`, Kurvenschmiede's `AppTopBar` without the shell). */\n header?: ReactNode;\n /** Default: `<LegalFooter />` with this page marked. `null` for none. */\n footer?: ReactNode;\n /** The back link's target. Default `/`, which takes a signed-in user into the app and\n * a signed-out one to the landing or sign-in page. */\n homeHref?: string;\n /** Default: the kit's beta notice on the imprint and the terms, its privacy notice on\n * the privacy policy (§3.2). `null` for none. */\n notice?: ReactNode;\n /**\n * 0.28.1: switches the app to the operator's `bindingLanguage` — the button after the\n * translation note on a page read in another language. Without it the note stands\n * alone; the app's own language switcher is in its header anyway.\n */\n onShowBindingLanguage?: () => void;\n /** The language the operator's country is named in. Default: the `<UiKitProvider\n * locale>`, else English. */\n locale?: string;\n /** The title's element. Default `h1`; `h2` for a page shown inside another (a\n * preview), whose sections then take `h3`. */\n headingAs?: \"h1\" | \"h2\";\n /** `false` draws the column as a `<div>` instead of `<main>` — for a page embedded in\n * one that has its own `<main>`. Default true. */\n landmark?: boolean;\n /** Default true: {@link useNoIndex}. `false` only where the page is not the page — a\n * preview inside another page. */\n noIndex?: boolean;\n /** On the outermost element (a full-height column). */\n className?: string;\n /** The `legal` labels for this page and everything in it — sections, footer,\n * checkbox — on top of the provider's. */\n labels?: LabelOverride<LegalLabels>;\n}\n\ninterface FlatNode {\n node: ReactNode;\n /** A stable React key from the node's place in the tree the app wrote. */\n path: string;\n}\n\n/** The children as a flat list, arrays and fragments opened — the sections the page can\n * see, in render order. */\nfunction flatten(node: ReactNode, path: string, out: FlatNode[]): void {\n if (node === null || node === undefined || typeof node === \"boolean\") return;\n if (isValidElement(node)) {\n if (node.type === Fragment) {\n flatten((node.props as { children?: ReactNode }).children, path, out);\n } else {\n out.push({ node, path: path || \"/\" });\n }\n return;\n }\n if (typeof node === \"object\" && Symbol.iterator in node) {\n Array.from(node as Iterable<ReactNode>).forEach((child, i) => {\n const step = isValidElement(child) && child.key !== null ? `$${child.key}` : `#${i}`;\n flatten(child, `${path}/${step}`, out);\n });\n return;\n }\n out.push({ node, path: path || \"/\" });\n}\n\n/** A section the walk found: its key (`undefined` when it has none) and heading. */\nfunction sectionOf(\n node: ReactNode,\n page: LegalPageKey,\n labels: LegalLabels,\n): { key: string | undefined; heading: ReactNode } | null {\n if (!isValidElement(node)) return null;\n if (node.type === LegalKitSection) {\n const { section } = node.props as LegalKitSectionProps;\n const entry = (labels.sections[page] as Record<string, SectionLabels | undefined>)[section];\n return { key: section, heading: entry?.title ?? section };\n }\n if (node.type === LegalSection) {\n const props = node.props as LegalSectionProps;\n return { key: props.id ?? node.key ?? undefined, heading: props.heading };\n }\n return null;\n}\n\n/**\n * The page's sections, each in a slot that tells it its key and number, and the map a\n * `{ref:key}` is resolved from — built from the children BEFORE they render.\n */\nfunction slotSections(\n children: ReactNode,\n page: LegalPageKey,\n labels: LegalLabels,\n): { nodes: ReactNode[]; targets: Map<string, LegalRefTarget> } {\n const flat: FlatNode[] = [];\n flatten(children, \"\", flat);\n const numbered = LEGAL_SKELETON[page].numbered;\n const targets = new Map<string, LegalRefTarget>();\n let count = 0;\n const nodes = flat.map(({ node, path }) => {\n const section = sectionOf(node, page, labels);\n if (!section) return <Fragment key={path}>{node}</Fragment>;\n count += 1;\n const number = numbered ? count : undefined;\n if (section.key !== undefined) {\n if (targets.has(section.key)) {\n warnLegalOnce(`two sections of the ${page} page share the key \"${section.key}\"; {ref:${section.key}} names the first.`);\n } else {\n targets.set(section.key, { number, heading: section.heading });\n }\n }\n return (\n <LegalSlotContext.Provider key={path} value={{ id: section.key, number }}>\n {node}\n </LegalSlotContext.Provider>\n );\n });\n return { nodes, targets };\n}\n\n/**\n * A legal page — Imprint, Privacy Policy or Terms — in the frame every app uses (§3.2):\n * the app's public header, the kit's column (back link, title, notice, sections) and the\n * public footer. keksdose's `features/legal/legal-layout.tsx`, the reference: its\n * `LegalPage` drew exactly this around the kit's `LegalLayout`, and kastlan and\n * Kurvenschmiede each drew a different frame (an auth card, the signed-in app shell).\n * Signed-in users see the same frame: the pages are public and outside the app shell.\n *\n * What it adds to the column:\n * - the title, from `legal.titles`, and \"← Back to home\" pointing at `homeHref`;\n * - the default notice per page — the beta notice, or the privacy notice on the privacy\n * policy, whose technical sections describe running code (§3.2, §7.3);\n * - numbers: the privacy and terms sections are \"N. Title\" in render order, the\n * imprint's are not (§4.1). The titles in the catalogues carry no number, so a\n * section added in the middle renumbers the rest instead of leaving them wrong;\n * - ids: every section's `id` is its key (`/privacy#rights`), which keeps\n * Kurvenschmiede's deep links working;\n * - `{ref:key}` in a section's text becomes that section's number, linked — forward\n * references included, since the page knows the order before any section renders\n * (see `children` for what that asks of the tree);\n * - `useNoIndex()`.\n */\nexport function LegalPage({\n page,\n operator,\n children,\n header,\n footer,\n homeHref = \"/\",\n notice,\n onShowBindingLanguage,\n locale: localeProp,\n headingAs = \"h1\",\n landmark = true,\n noIndex = true,\n className,\n labels: labelsProp,\n}: LegalPageProps) {\n useNoIndex(noIndex);\n const labels = useLegalLabels(labelsProp);\n const locale = useKitLocale(localeProp) ?? \"en\";\n // Not memoised: `countryName` keeps one `Intl.DisplayNames` per locale, so naming the\n // country again is a lookup, and the context is rebuilt with the children anyway.\n const operatorText = legalOperatorText(operator, locale);\n const overrides = useMemo<UiKitLabelOverrides | undefined>(\n () => (labelsProp ? { legal: labelsProp } : undefined),\n [labelsProp],\n );\n\n const { nodes, targets } = slotSections(children, page, labels);\n const context: LegalPageContextValue = {\n page,\n operator: operatorText,\n sectionHeading: headingAs === \"h1\" ? \"h2\" : \"h3\",\n targets,\n };\n const Main = landmark ? \"main\" : \"div\";\n const shownNotice =\n notice !== undefined ? notice : page === \"privacy\" ? labels.notice.privacy : labels.notice.beta;\n // 0.28.1 (Marcel): one language is binding and the lawyer reviews that one; a page read\n // in any other says so, with a way to the binding version.\n const translated =\n operator.bindingLanguage !== undefined && baseLanguage(operator.bindingLanguage) !== baseLanguage(locale);\n const translationNote = translated ? (\n <p className=\"text-sm text-secondary\">\n {labels.translation.note(operatorText)}\n {onShowBindingLanguage && (\n <>\n {\" \"}\n <Button type=\"button\" variant=\"link\" size=\"sm\" className=\"h-auto p-0 align-baseline\" onClick={onShowBindingLanguage}>\n {labels.translation.show(operatorText)}\n </Button>\n </>\n )}\n </p>\n ) : undefined;\n\n return (\n <UiKitProvider labels={overrides}>\n <div className={cn(\"flex min-h-full flex-col\", className)}>\n {header}\n <Main className=\"flex-1\">\n <LegalPageContext.Provider value={context}>\n <LegalLayout\n back={\n <TextLink href={homeHref} icon={ArrowLeft}>\n {labels.backHome}\n </TextLink>\n }\n title={labels.titles[page]}\n notice={shownNotice}\n translationNote={translationNote}\n headingAs={headingAs}\n >\n {nodes}\n </LegalLayout>\n </LegalPageContext.Provider>\n </Main>\n {footer === undefined ? <LegalFooter currentHref={LEGAL_HREFS[page]} /> : footer}\n </div>\n </UiKitProvider>\n );\n}\n\n// ── Terms acceptance (§3.4) ───────────────────────────────────────────────────\n\nexport interface LegalAcceptCheckboxProps\n extends Omit<CheckboxProps, \"label\" | \"checked\" | \"onCheckedChange\" | \"required\"> {\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n /** Default `/terms`. */\n termsHref?: string;\n /** Default `/privacy`. */\n privacyHref?: string;\n labels?: LabelOverride<LegalLabels>;\n ref?: Ref<HTMLInputElement>;\n}\n\n/** `legal.accept` with its `{terms}` and `{privacy}` as links named by the page titles.\n * Split, not interpolated: the text between the placeholders is the template's own,\n * to the character — nothing is added around a link. */\nfunction acceptLabel(labels: LegalLabels, termsHref: string, privacyHref: string): ReactNode[] {\n const template = labels.accept;\n for (const placeholder of [\"{terms}\", \"{privacy}\"]) {\n if (!template.includes(placeholder)) warnLegalOnce(`legal.accept has no ${placeholder}: \"${template}\".`);\n }\n return template\n .split(/(\\{terms\\}|\\{privacy\\})/)\n .filter((part) => part !== \"\")\n .map((part, i) =>\n part === \"{terms}\" ? (\n <TextLink key={i} href={termsHref} tone=\"primary\">\n {labels.titles.terms}\n </TextLink>\n ) : part === \"{privacy}\" ? (\n <TextLink key={i} href={privacyHref} tone=\"primary\">\n {labels.titles.privacy}\n </TextLink>\n ) : (\n part\n ),\n );\n}\n\n/**\n * The register page's \"I accept the [Terms of Service] and the [Privacy Policy]\" (§3.4):\n * keksdose's checkbox (features/auth/register-page.tsx), for every app.\n *\n * A REQUIRED kit `Checkbox` — not a Switch: a form answer that waits for the submit\n * button. The app keeps its submit disabled while it is unticked, so there is never a\n * failed attempt and no `error` to show. Nothing is sent to the backend: no stored\n * version, no re-acceptance (Marcel, §2.4).\n *\n * The label is ONE template, `legal.accept`, so a language puts the links where its\n * grammar needs them, articles included — fr \"J’accepte les {terms} et la {privacy}\",\n * it \"Accetto le {terms} e l’{privacy}\" with no space after the elided article. The link\n * texts are the page titles (`legal.titles`), as on the pages themselves.\n */\nexport function LegalAcceptCheckbox({\n checked,\n onCheckedChange,\n termsHref = LEGAL_HREFS.terms,\n privacyHref = LEGAL_HREFS.privacy,\n labels: labelsProp,\n ref,\n ...rest\n}: LegalAcceptCheckboxProps) {\n const labels = useLegalLabels(labelsProp);\n return (\n <Checkbox\n {...rest}\n ref={ref}\n checked={checked}\n onCheckedChange={onCheckedChange}\n required\n label={acceptLabel(labels, termsHref, privacyHref)}\n />\n );\n}\n"],"mappings":";AAmN2C,SAgTnC,UAhTmC,KAgTnC,YAhTmC;AAnN3C,SAAS,YAAAA,WAAU,gBAAgB,YAAY,eAAe;AAE9D,SAAS,iBAAiB;AAE1B,SAAS,eAAe,oBAAoB;AAE5C,SAAS,kBAAkB;AAC3B,SAAS,UAAU;AACnB,SAAS,gBAAgB;AAEzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAcP,SAAS,gBAAgB;AACzB,SAAS,cAAc;AAyChB,MAAM,iBAAoE,OAAO,OAAO;AAAA,EAC7F,WAAW,OA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E,SAAS,cACX,oBAAC,YAAiB,MAAM,aAAa,MAAK,WACvC,iBAAO,OAAO,WADF,CAEf,IAEA;AAAA,EAEJ;AACJ;AAgBO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AAAA,EACA,YAAY,YAAY;AAAA,EACxB,cAAc,YAAY;AAAA,EAC1B,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GAA6B;AAC3B,QAAM,SAAS,eAAe,UAAU;AACxC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAQ;AAAA,MACR,OAAO,YAAY,QAAQ,WAAW,WAAW;AAAA;AAAA,EACnD;AAEJ;","names":["Fragment"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/legal-page.tsx"],"sourcesContent":["import { Fragment, isValidElement, useContext, useMemo } from \"react\";\nimport type { ReactNode, Ref } from \"react\";\nimport { ArrowLeft } from \"lucide-react\";\n\nimport { UiKitProvider, useKitLocale } from \"../i18n/kit-labels\";\nimport type { LabelOverride, UiKitLabelOverrides } from \"../i18n/kit-labels\";\nimport { useNoIndex } from \"../hooks/use-noindex\";\nimport { cn } from \"../lib/cn\";\nimport { parseIsoDate } from \"../lib/dates\";\nimport { formatDate } from \"../lib/format\";\nimport { Checkbox } from \"./checkbox\";\nimport type { CheckboxProps } from \"./checkbox\";\nimport {\n DEFAULT_LEGAL_LABELS,\n LEGAL_HREFS,\n baseLanguage,\n LegalFooter,\n LegalLayout,\n LegalPageContext,\n LegalSection,\n LegalSlotContext,\n LegalText,\n legalOperatorText,\n useLegalLabels,\n warnLegalOnce,\n} from \"./legal\";\nimport type {\n LegalDisclaimerSectionLabels,\n LegalFramedSectionLabels,\n LegalLabels,\n LegalOperator,\n LegalOperatorSectionLabels,\n LegalOperatorText,\n LegalPageContextValue,\n LegalPageKey,\n LegalRefTarget,\n LegalSectionProps,\n LegalTextSectionLabels,\n} from \"./legal\";\nimport { TextLink } from \"./text-link\";\nimport { Button } from \"./button\";\n\n/**\n * The legal pages' frame and the kit's own sections — docs/legal-harmonization.md §3\n * and §4, the 0.28 round. The labels, the column, `LegalSection`, the links and the\n * footer are in `./legal`.\n */\n\n// ── The skeleton (§4.2) ───────────────────────────────────────────────────────\n\n/** Who writes a section: the kit's wording, the app's own, or the kit's wording with an\n * app paragraph in a fixed slot. */\nexport type LegalSectionOwner = \"kit\" | \"app\" | \"kit+app\";\n\nexport interface LegalSkeletonEntry {\n /** The section key — its `id` and its catalogue key. `\"*\"` is the slot where the\n * app's own sections go (zero or more: keksdose's `credits`, `price_pool`, …). */\n key: string;\n owner: LegalSectionOwner;\n}\n\nexport interface LegalSkeletonPage {\n /** Whether the page numbers its sections (\"3. Legal basis\"). The imprint does not. */\n numbered: boolean;\n /** The sections in their order. */\n sections: readonly LegalSkeletonEntry[];\n}\n\n/**\n * The section order every app's legal pages follow (§4.2), as data — so an app's test\n * can assert that its pages do, and so the order lives in one place, not in three apps'\n * reading of a table. `LegalPage` reads `numbered` from it.\n *\n * An app's test, given the section ids its page rendered in order:\n *\n * const fixed = LEGAL_SKELETON.privacy.sections.map((s) => s.key).filter((k) => k !== \"*\");\n * expect(ids.filter((id) => fixed.includes(id))).toEqual(fixed);\n *\n * Every fixed key is there, in the skeleton's order; the ids that are not in it are the\n * app's own sections, which belong where `\"*\"` stands.\n */\nexport const LEGAL_SKELETON: Readonly<Record<LegalPageKey, LegalSkeletonPage>> = Object.freeze({\n impressum: Object.freeze({\n numbered: false,\n sections: Object.freeze([\n { key: \"operator\", owner: \"kit\" },\n { key: \"contact\", owner: \"kit\" },\n { key: \"disclaimer\", owner: \"kit\" },\n { key: \"*\", owner: \"app\" },\n ] as const),\n }),\n privacy: Object.freeze({\n numbered: true,\n sections: Object.freeze([\n { key: \"controller\", owner: \"kit\" },\n { key: \"data\", owner: \"app\" },\n { key: \"legal_basis\", owner: \"kit+app\" },\n { key: \"third_parties\", owner: \"app\" },\n { key: \"*\", owner: \"app\" },\n { key: \"browser\", owner: \"kit+app\" },\n { key: \"transfers\", owner: \"app\" },\n { key: \"retention\", owner: \"app\" },\n { key: \"rights\", owner: \"kit+app\" },\n { key: \"contact\", owner: \"kit\" },\n ] as const),\n }),\n terms: Object.freeze({\n numbered: true,\n sections: Object.freeze([\n { key: \"scope\", owner: \"app\" },\n { key: \"no_advice\", owner: \"app\" },\n { key: \"*\", owner: \"app\" },\n { key: \"warranty\", owner: \"kit\" },\n { key: \"liability\", owner: \"kit\" },\n { key: \"changes\", owner: \"kit\" },\n // 0.28.1: which language's version prevails (the operator's `bindingLanguage`).\n { key: \"language\", owner: \"kit\" },\n { key: \"law\", owner: \"kit\" },\n ] as const),\n }),\n});\n\n/** The sections the kit writes (§4.3), on whichever page they sit. `contact` is on two\n * pages, with two texts; the page decides which. */\nexport type LegalKitSectionKey =\n | \"operator\"\n | \"contact\"\n | \"disclaimer\"\n | \"controller\"\n | \"legal_basis\"\n | \"browser\"\n | \"rights\"\n | \"warranty\"\n | \"liability\"\n | \"changes\"\n | \"language\"\n | \"law\";\n\n/** The kit's sections of one page, in the skeleton's order. */\nfunction kitSectionsOf(page: LegalPageKey): string[] {\n return LEGAL_SKELETON[page].sections.filter((s) => s.owner !== \"app\").map((s) => s.key);\n}\n\nconst PAGES: readonly LegalPageKey[] = [\"impressum\", \"privacy\", \"terms\"];\n\n// ── Kit sections ──────────────────────────────────────────────────────────────\n\ninterface LegalKitSectionBase {\n /** Default: the enclosing {@link LegalPage}'s page — needed outside one, and for\n * `contact` only (it is on two pages). */\n page?: LegalPageKey;\n /** Default: the enclosing {@link LegalPage}'s operator — needed outside one, by the\n * sections that name it (operator, both contacts, controller, law). */\n operator?: LegalOperator;\n /** Default: one level below the page's title (`h2` under an `h1`). */\n headingAs?: \"h2\" | \"h3\";\n labels?: LabelOverride<LegalLabels>;\n}\n\n/**\n * One of the kit's sections, by key. `children` is the app's paragraph where §4.2 says\n * \"kit + app\" — and only there, which the type holds an app to: the other sections'\n * wording is identical in every app, and an app that needs to say more says it in a\n * section of its own. `browser` takes the app's list of what it keeps, as `entries`.\n */\nexport type LegalKitSectionProps = LegalKitSectionBase &\n (\n | {\n section: \"browser\";\n variant?: never;\n /** What this app keeps in the browser, one entry per item — rendered as a `<ul>`\n * between the kit's two sentences. The app's words, in every language it serves. */\n entries: readonly string[];\n /** After the kit's text: what sign-out removes beyond the tokens, what stays. */\n children?: ReactNode;\n }\n | {\n section: \"legal_basis\" | \"rights\";\n variant?: never;\n entries?: never;\n /** `legal_basis`: after the kit's paragraph (consent, where an app relies on\n * it). `rights`: between the list of rights and the supervisory authorities\n * (how to export, how to delete). A plain string keeps its line breaks and has\n * its `{ref:key}` tokens resolved. */\n children?: ReactNode;\n }\n | {\n section: \"disclaimer\";\n /**\n * 0.32.0 (docs/billing-harmonization.md §8, legal decision 7): which disclaimer.\n * `non-commercial` (default) is the beta's \"private, non-commercial project\";\n * `commercial` is for an app that charges, sold through a Merchant of Record —\n * chosen per app, in the release that turns its billing on.\n */\n variant?: LegalDisclaimerVariant;\n entries?: never;\n children?: never;\n }\n | {\n section: Exclude<LegalKitSectionKey, \"browser\" | \"legal_basis\" | \"rights\" | \"disclaimer\">;\n variant?: never;\n entries?: never;\n children?: never;\n }\n );\n\n/** 0.32.0: the imprint disclaimer's two texts — see {@link LegalKitSectionProps}. */\nexport type LegalDisclaimerVariant = \"non-commercial\" | \"commercial\";\n\n/** The app's paragraph: a plain string as running text (line breaks kept, refs\n * resolved), anything else as it is. */\nfunction appPart(children: ReactNode): ReactNode {\n if (children === undefined || children === null || children === false) return null;\n if (typeof children === \"string\") return <LegalText key=\"app\" text={children} />;\n return <Fragment key=\"app\">{children}</Fragment>;\n}\n\n/**\n * One of the kit's sections (§4.3) — `<LegalKitSection section=\"warranty\" />` — with its\n * heading, its `id` (the key: `/terms#warranty`) and, on a numbered page, its number.\n *\n * The words are the kit's, in the `legal` labels, filled in with the operator; an app\n * adds only what §4.2 gives it a slot for. Inside a {@link LegalPage} the page and the\n * operator come from it, so a page reads as its section list:\n *\n * <LegalPage page=\"privacy\" operator={OPERATOR}>\n * <LegalKitSection section=\"controller\" />\n * <LegalSection key=\"data\" heading={t(\"legal.privacy.data.title\")} body={…} />\n * <LegalKitSection section=\"legal_basis\">{t(\"legal.privacy.legal_basis.app\")}</LegalKitSection>\n * …\n * </LegalPage>\n *\n * A key that is not one of the page's kit sections throws, naming the ones that are: it\n * is a typo in code, not a state a user can reach.\n */\nexport function LegalKitSection(props: LegalKitSectionProps) {\n const { section, headingAs, labels: labelsProp } = props;\n const context = useContext(LegalPageContext);\n const labels = useLegalLabels(labelsProp);\n const kitLocale = useKitLocale();\n\n const page = props.page ?? context?.page ?? onlyPageOf(section);\n const kitSections = kitSectionsOf(page);\n if (!kitSections.includes(section)) {\n throw new Error(\n `LegalKitSection: \"${section}\" is not one of the kit's sections of the ${page} page (${kitSections.join(\", \")}).`,\n );\n }\n const entry = (labels.sections[page] as Record<string, SectionLabels>)[section];\n const operator = props.operator ? legalOperatorText(props.operator, kitLocale) : context?.operator;\n const fill = (body: string | ((o: LegalOperatorText) => string)): string => {\n if (typeof body === \"string\") return body;\n if (!operator) {\n throw new Error(\n `LegalKitSection \"${section}\" names the operator: render it inside <LegalPage operator={…}>, or pass operator.`,\n );\n }\n if (section === \"language\" && !operator.bindingLanguage) {\n throw new Error(\n `LegalKitSection \"language\" names the binding language: give the operator a bindingLanguage (\"de-CH\").`,\n );\n }\n return body(operator);\n };\n\n const app = appPart(props.children);\n let parts: ReactNode[];\n if (\"lead\" in entry) {\n const lead = <LegalText key=\"lead\" text={entry.lead} />;\n const tail = <LegalText key=\"tail\" text={entry.tail} />;\n if (props.section === \"browser\") {\n const list =\n props.entries.length > 0 ? (\n <ul key=\"entries\" className=\"list-disc space-y-1 ps-5\">\n {props.entries.map((item, i) => (\n <li key={i}>{item}</li>\n ))}\n </ul>\n ) : null;\n parts = [lead, list, tail, app];\n } else {\n // `rights`: the app's paragraph sits between the rights and the authorities.\n parts = [lead, app, tail];\n }\n } else {\n // The imprint's commercial disclaimer (0.32.0): its own body under the same title.\n const commercial =\n props.section === \"disclaimer\" && props.variant === \"commercial\"\n ? ((entry as LegalDisclaimerSectionLabels).commercial ??\n DEFAULT_LEGAL_LABELS.sections.impressum.disclaimer.commercial)\n : undefined;\n parts = [<LegalText key=\"body\" text={commercial ?? fill(entry.body)} />, app];\n }\n\n return (\n <LegalSection id={section} heading={entry.title} headingAs={headingAs}>\n <div className=\"space-y-[1lh]\">{parts}</div>\n </LegalSection>\n );\n}\n\ntype SectionLabels = LegalTextSectionLabels | LegalOperatorSectionLabels | LegalFramedSectionLabels;\n\n/** The one page a kit section key is on; `contact` is on two, so it needs the page. */\nfunction onlyPageOf(section: string): LegalPageKey {\n const pages = PAGES.filter((p) => kitSectionsOf(p).includes(section));\n if (pages.length === 1) return pages[0];\n throw new Error(\n pages.length === 0\n ? `LegalKitSection: \"${section}\" is not one of the kit's sections.`\n : `LegalKitSection: \"${section}\" is on more than one page (${pages.join(\", \")}) — render it inside a LegalPage, or pass page.`,\n );\n}\n\n// ── The page ──────────────────────────────────────────────────────────────────\n\nexport interface LegalPageProps {\n /** Which page: the title, the default notice, whether the sections are numbered. */\n page: LegalPageKey;\n /** Who runs the app — the values the kit's sections name. The same in every app's\n * three pages; the kit holds none (§5). */\n operator: LegalOperator;\n /**\n * The sections, in reading order: {@link LegalKitSection}s and {@link LegalSection}s.\n *\n * They must be DIRECT children — or inside fragments, or in an array\n * (`SECTIONS.map(…)`). The page reads them before they render, to know every\n * section's number in advance: that is what lets a `{ref:key}` point forward\n * (keksdose's section 2 refers to section 10). A section wrapped in a component of the\n * app's own is invisible to that walk and renders unnumbered, with no key.\n */\n children: ReactNode;\n /** The app's public header — the one a signed-out visitor already sees (keksdose's\n * `LandingHeader`, Kurvenschmiede's `AppTopBar` without the shell). */\n header?: ReactNode;\n /** Default: `<LegalFooter />` with this page marked. `null` for none. */\n footer?: ReactNode;\n /** The back link's target. Default `/`, which takes a signed-in user into the app and\n * a signed-out one to the landing or sign-in page. */\n homeHref?: string;\n /** Default: the kit's beta notice on the imprint and the terms, its privacy notice on\n * the privacy policy (§3.2). `null` for none. */\n notice?: ReactNode;\n /**\n * 0.51.3: the day this page's text last changed, \"YYYY-MM-DD\" (legal benchmark\n * 2026-10-29, gap 8). Shown under the title as `legal.updated` — \"Last updated:\n * 29 October 2026\", \"Stand: 29. Oktober 2026\" — with the date written out in `locale`,\n * so it follows the page's language like every other kit word, the switch to the\n * binding version included. Left out, no line. One date per page: the imprint, the\n * privacy policy and the terms change on their own days.\n *\n * An app that records which terms someone accepted (keksdose) stores the terms page's\n * date: it is the version the reader saw.\n */\n updated?: string;\n /**\n * 0.28.1: switches the app to the operator's `bindingLanguage` — the button after the\n * translation note on a page read in another language. Without it the note stands\n * alone; the app's own language switcher is in its header anyway.\n */\n onShowBindingLanguage?: () => void;\n /** The language the operator's country is named in. Default: the `<UiKitProvider\n * locale>`, else English. */\n locale?: string;\n /** The title's element. Default `h1`; `h2` for a page shown inside another (a\n * preview), whose sections then take `h3`. */\n headingAs?: \"h1\" | \"h2\";\n /** `false` draws the column as a `<div>` instead of `<main>` — for a page embedded in\n * one that has its own `<main>`. Default true. */\n landmark?: boolean;\n /** Default true: {@link useNoIndex}. `false` only where the page is not the page — a\n * preview inside another page. */\n noIndex?: boolean;\n /** On the outermost element (a full-height column). */\n className?: string;\n /** The `legal` labels for this page and everything in it — sections, footer,\n * checkbox — on top of the provider's. */\n labels?: LabelOverride<LegalLabels>;\n}\n\ninterface FlatNode {\n node: ReactNode;\n /** A stable React key from the node's place in the tree the app wrote. */\n path: string;\n}\n\n/** The children as a flat list, arrays and fragments opened — the sections the page can\n * see, in render order. */\nfunction flatten(node: ReactNode, path: string, out: FlatNode[]): void {\n if (node === null || node === undefined || typeof node === \"boolean\") return;\n if (isValidElement(node)) {\n if (node.type === Fragment) {\n flatten((node.props as { children?: ReactNode }).children, path, out);\n } else {\n out.push({ node, path: path || \"/\" });\n }\n return;\n }\n if (typeof node === \"object\" && Symbol.iterator in node) {\n Array.from(node as Iterable<ReactNode>).forEach((child, i) => {\n const step = isValidElement(child) && child.key !== null ? `$${child.key}` : `#${i}`;\n flatten(child, `${path}/${step}`, out);\n });\n return;\n }\n out.push({ node, path: path || \"/\" });\n}\n\n/** A section the walk found: its key (`undefined` when it has none) and heading. */\nfunction sectionOf(\n node: ReactNode,\n page: LegalPageKey,\n labels: LegalLabels,\n): { key: string | undefined; heading: ReactNode } | null {\n if (!isValidElement(node)) return null;\n if (node.type === LegalKitSection) {\n const { section } = node.props as LegalKitSectionProps;\n const entry = (labels.sections[page] as Record<string, SectionLabels | undefined>)[section];\n return { key: section, heading: entry?.title ?? section };\n }\n if (node.type === LegalSection) {\n const props = node.props as LegalSectionProps;\n return { key: props.id ?? node.key ?? undefined, heading: props.heading };\n }\n return null;\n}\n\n/**\n * The page's sections, each in a slot that tells it its key and number, and the map a\n * `{ref:key}` is resolved from — built from the children BEFORE they render.\n */\nfunction slotSections(\n children: ReactNode,\n page: LegalPageKey,\n labels: LegalLabels,\n): { nodes: ReactNode[]; targets: Map<string, LegalRefTarget> } {\n const flat: FlatNode[] = [];\n flatten(children, \"\", flat);\n const numbered = LEGAL_SKELETON[page].numbered;\n const targets = new Map<string, LegalRefTarget>();\n let count = 0;\n const nodes = flat.map(({ node, path }) => {\n const section = sectionOf(node, page, labels);\n if (!section) return <Fragment key={path}>{node}</Fragment>;\n count += 1;\n const number = numbered ? count : undefined;\n if (section.key !== undefined) {\n if (targets.has(section.key)) {\n warnLegalOnce(`two sections of the ${page} page share the key \"${section.key}\"; {ref:${section.key}} names the first.`);\n } else {\n targets.set(section.key, { number, heading: section.heading });\n }\n }\n return (\n <LegalSlotContext.Provider key={path} value={{ id: section.key, number }}>\n {node}\n </LegalSlotContext.Provider>\n );\n });\n return { nodes, targets };\n}\n\n/**\n * A legal page — Imprint, Privacy Policy or Terms — in the frame every app uses (§3.2):\n * the app's public header, the kit's column (back link, title, notice, sections) and the\n * public footer. keksdose's `features/legal/legal-layout.tsx`, the reference: its\n * `LegalPage` drew exactly this around the kit's `LegalLayout`, and kastlan and\n * Kurvenschmiede each drew a different frame (an auth card, the signed-in app shell).\n * Signed-in users see the same frame: the pages are public and outside the app shell.\n *\n * What it adds to the column:\n * - the title, from `legal.titles`, and \"← Back to home\" pointing at `homeHref`;\n * - the as-of line under the title, from `updated` (0.51.3);\n * - the default notice per page — the beta notice, or the privacy notice on the privacy\n * policy, whose technical sections describe running code (§3.2, §7.3);\n * - numbers: the privacy and terms sections are \"N. Title\" in render order, the\n * imprint's are not (§4.1). The titles in the catalogues carry no number, so a\n * section added in the middle renumbers the rest instead of leaving them wrong;\n * - ids: every section's `id` is its key (`/privacy#rights`), which keeps\n * Kurvenschmiede's deep links working;\n * - `{ref:key}` in a section's text becomes that section's number, linked — forward\n * references included, since the page knows the order before any section renders\n * (see `children` for what that asks of the tree);\n * - `useNoIndex()`.\n */\nexport function LegalPage({\n page,\n operator,\n children,\n header,\n footer,\n homeHref = \"/\",\n notice,\n updated,\n onShowBindingLanguage,\n locale: localeProp,\n headingAs = \"h1\",\n landmark = true,\n noIndex = true,\n className,\n labels: labelsProp,\n}: LegalPageProps) {\n useNoIndex(noIndex);\n const labels = useLegalLabels(labelsProp);\n const locale = useKitLocale(localeProp) ?? \"en\";\n // Not memoised: `countryName` keeps one `Intl.DisplayNames` per locale, so naming the\n // country again is a lookup, and the context is rebuilt with the children anyway.\n const operatorText = legalOperatorText(operator, locale);\n const overrides = useMemo<UiKitLabelOverrides | undefined>(\n () => (labelsProp ? { legal: labelsProp } : undefined),\n [labelsProp],\n );\n\n const { nodes, targets } = slotSections(children, page, labels);\n const context: LegalPageContextValue = {\n page,\n operator: operatorText,\n sectionHeading: headingAs === \"h1\" ? \"h2\" : \"h3\",\n targets,\n };\n const Main = landmark ? \"main\" : \"div\";\n const shownNotice =\n notice !== undefined ? notice : page === \"privacy\" ? labels.notice.privacy : labels.notice.beta;\n // 0.28.1 (Marcel): one language is binding and the lawyer reviews that one; a page read\n // in any other says so, with a way to the binding version.\n const translated =\n operator.bindingLanguage !== undefined && baseLanguage(operator.bindingLanguage) !== baseLanguage(locale);\n const translationNote = translated ? (\n <p className=\"text-sm text-secondary\">\n {labels.translation.note(operatorText)}\n {onShowBindingLanguage && (\n <>\n {\" \"}\n <Button type=\"button\" variant=\"link\" size=\"sm\" className=\"h-auto p-0 align-baseline\" onClick={onShowBindingLanguage}>\n {labels.translation.show(operatorText)}\n </Button>\n </>\n )}\n </p>\n ) : undefined;\n // A calendar day, written out in the page's language; `formatDate` reads a bare\n // \"YYYY-MM-DD\" as that day in every zone. A malformed date shows no line rather than a\n // made-up one (\"2026-02-30\" would roll over into March).\n const updatedValid = updated !== undefined && parseIsoDate(updated) !== null;\n if (updated !== undefined && !updatedValid) {\n warnLegalOnce(`LegalPage: updated=\"${updated}\" is not a \"YYYY-MM-DD\" date; no \"Last updated\" line is shown.`);\n }\n const updatedLine = updatedValid ? (\n <time dateTime={updated}>\n {(labels.updated ?? DEFAULT_LEGAL_LABELS.updated!)(formatDate(updated, \"long\", { locale }))}\n </time>\n ) : undefined;\n\n return (\n <UiKitProvider labels={overrides}>\n <div className={cn(\"flex min-h-full flex-col\", className)}>\n {header}\n <Main className=\"flex-1\">\n <LegalPageContext.Provider value={context}>\n <LegalLayout\n back={\n <TextLink href={homeHref} icon={ArrowLeft}>\n {labels.backHome}\n </TextLink>\n }\n title={labels.titles[page]}\n notice={shownNotice}\n updated={updatedLine}\n translationNote={translationNote}\n headingAs={headingAs}\n >\n {nodes}\n </LegalLayout>\n </LegalPageContext.Provider>\n </Main>\n {footer === undefined ? <LegalFooter currentHref={LEGAL_HREFS[page]} /> : footer}\n </div>\n </UiKitProvider>\n );\n}\n\n// ── Terms acceptance (§3.4) ───────────────────────────────────────────────────\n\nexport interface LegalAcceptCheckboxProps\n extends Omit<CheckboxProps, \"label\" | \"checked\" | \"onCheckedChange\" | \"required\"> {\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n /** Default `/terms`. */\n termsHref?: string;\n /** Default `/privacy`. */\n privacyHref?: string;\n labels?: LabelOverride<LegalLabels>;\n ref?: Ref<HTMLInputElement>;\n}\n\n/** `legal.accept` with its `{terms}` and `{privacy}` as links named by the page titles.\n * Split, not interpolated: the text between the placeholders is the template's own,\n * to the character — nothing is added around a link. */\nfunction acceptLabel(labels: LegalLabels, termsHref: string, privacyHref: string): ReactNode[] {\n const template = labels.accept;\n for (const placeholder of [\"{terms}\", \"{privacy}\"]) {\n if (!template.includes(placeholder)) warnLegalOnce(`legal.accept has no ${placeholder}: \"${template}\".`);\n }\n return template\n .split(/(\\{terms\\}|\\{privacy\\})/)\n .filter((part) => part !== \"\")\n .map((part, i) =>\n part === \"{terms}\" ? (\n <TextLink key={i} href={termsHref} tone=\"primary\">\n {labels.titles.terms}\n </TextLink>\n ) : part === \"{privacy}\" ? (\n <TextLink key={i} href={privacyHref} tone=\"primary\">\n {labels.titles.privacy}\n </TextLink>\n ) : (\n part\n ),\n );\n}\n\n/**\n * The register page's \"I accept the [Terms of Service] and the [Privacy Policy]\" (§3.4):\n * keksdose's checkbox (features/auth/register-page.tsx), for every app.\n *\n * A REQUIRED kit `Checkbox` — not a Switch: a form answer that waits for the submit\n * button. The app keeps its submit disabled while it is unticked, so there is never a\n * failed attempt and no `error` to show. The checkbox itself sends nothing and asks for\n * no re-acceptance (Marcel, §2.4). An app that records which terms someone accepted\n * stores, with the account, the terms page's `updated` date — the version the reader\n * saw — on its own (keksdose since 2026-10-29; §3.4).\n *\n * The label is ONE template, `legal.accept`, so a language puts the links where its\n * grammar needs them, articles included — fr \"J’accepte les {terms} et la {privacy}\",\n * it \"Accetto le {terms} e l’{privacy}\" with no space after the elided article. The link\n * texts are the page titles (`legal.titles`), as on the pages themselves.\n */\nexport function LegalAcceptCheckbox({\n checked,\n onCheckedChange,\n termsHref = LEGAL_HREFS.terms,\n privacyHref = LEGAL_HREFS.privacy,\n labels: labelsProp,\n ref,\n ...rest\n}: LegalAcceptCheckboxProps) {\n const labels = useLegalLabels(labelsProp);\n return (\n <Checkbox\n {...rest}\n ref={ref}\n checked={checked}\n onCheckedChange={onCheckedChange}\n required\n label={acceptLabel(labels, termsHref, privacyHref)}\n />\n );\n}\n"],"mappings":";AAqN2C,SA8TnC,UA9TmC,KA8TnC,YA9TmC;AArN3C,SAAS,YAAAA,WAAU,gBAAgB,YAAY,eAAe;AAE9D,SAAS,iBAAiB;AAE1B,SAAS,eAAe,oBAAoB;AAE5C,SAAS,kBAAkB;AAC3B,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AAEzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAcP,SAAS,gBAAgB;AACzB,SAAS,cAAc;AAyChB,MAAM,iBAAoE,OAAO,OAAO;AAAA,EAC7F,WAAW,OAAO,OAAO;AAAA,IACvB,UAAU;AAAA,IACV,UAAU,OAAO,OAAO;AAAA,MACtB,EAAE,KAAK,YAAY,OAAO,MAAM;AAAA,MAChC,EAAE,KAAK,WAAW,OAAO,MAAM;AAAA,MAC/B,EAAE,KAAK,cAAc,OAAO,MAAM;AAAA,MAClC,EAAE,KAAK,KAAK,OAAO,MAAM;AAAA,IAC3B,CAAU;AAAA,EACZ,CAAC;AAAA,EACD,SAAS,OAAO,OAAO;AAAA,IACrB,UAAU;AAAA,IACV,UAAU,OAAO,OAAO;AAAA,MACtB,EAAE,KAAK,cAAc,OAAO,MAAM;AAAA,MAClC,EAAE,KAAK,QAAQ,OAAO,MAAM;AAAA,MAC5B,EAAE,KAAK,eAAe,OAAO,UAAU;AAAA,MACvC,EAAE,KAAK,iBAAiB,OAAO,MAAM;AAAA,MACrC,EAAE,KAAK,KAAK,OAAO,MAAM;AAAA,MACzB,EAA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e,UAAU;AACxC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAQ;AAAA,MACR,OAAO,YAAY,QAAQ,WAAW,WAAW;AAAA;AAAA,EACnD;AAEJ;","names":["Fragment"]}
|
|
@@ -150,6 +150,13 @@ export interface LegalLabels {
|
|
|
150
150
|
note: (o: LegalOperatorText) => string;
|
|
151
151
|
show: (o: LegalOperatorText) => string;
|
|
152
152
|
};
|
|
153
|
+
/**
|
|
154
|
+
* 0.51.3: the as-of line under the title (§3.2), "Last updated: 29 October 2026" —
|
|
155
|
+
* {@link LegalPage}'s `updated`, called with the date already written out in the page's
|
|
156
|
+
* locale. OPTIONAL, as every key added to a namespace an app may annotate: left out,
|
|
157
|
+
* the provider's, then English.
|
|
158
|
+
*/
|
|
159
|
+
updated?: (date: string) => string;
|
|
153
160
|
/** The kit's sections (§4.3), by page and section key. */
|
|
154
161
|
sections: {
|
|
155
162
|
impressum: {
|
|
@@ -335,6 +342,8 @@ export interface LegalLayoutProps {
|
|
|
335
342
|
* than the others (its technical sections describe running code).
|
|
336
343
|
*/
|
|
337
344
|
notice?: ReactNode;
|
|
345
|
+
/** 0.51.3: right under the title — {@link LegalPage}'s "Last updated: …" line. */
|
|
346
|
+
updated?: ReactNode;
|
|
338
347
|
/** 0.28.1: under the title, before the notice — {@link LegalPage}'s note that this
|
|
339
348
|
* page is a translation and which language is binding. */
|
|
340
349
|
translationNote?: ReactNode;
|
|
@@ -350,4 +359,4 @@ export interface LegalLayoutProps {
|
|
|
350
359
|
className?: string;
|
|
351
360
|
labels?: LabelOverride<LegalLabels>;
|
|
352
361
|
}
|
|
353
|
-
export declare function LegalLayout({ title, back, notice, translationNote, children, links, currentHref, headingAs: Heading, className, labels, }: LegalLayoutProps): import("react").JSX.Element;
|
|
362
|
+
export declare function LegalLayout({ title, back, notice, updated, translationNote, children, links, currentHref, headingAs: Heading, className, labels, }: LegalLayoutProps): import("react").JSX.Element;
|
package/dist/components/legal.js
CHANGED
|
@@ -141,6 +141,7 @@ function LegalLayout({
|
|
|
141
141
|
title,
|
|
142
142
|
back,
|
|
143
143
|
notice,
|
|
144
|
+
updated,
|
|
144
145
|
translationNote,
|
|
145
146
|
children,
|
|
146
147
|
links,
|
|
@@ -152,6 +153,7 @@ function LegalLayout({
|
|
|
152
153
|
return /* @__PURE__ */ jsxs("article", { className: cn("mx-auto w-full max-w-3xl px-4 py-12", className), children: [
|
|
153
154
|
back !== void 0 && /* @__PURE__ */ jsx("div", { className: "mb-4 text-sm", children: back }),
|
|
154
155
|
/* @__PURE__ */ jsx(Heading, { className: "text-3xl font-bold tracking-tight break-words text-primary", children: title }),
|
|
156
|
+
updated !== void 0 && updated !== null && /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-muted", children: updated }),
|
|
155
157
|
translationNote !== void 0 && translationNote !== null && /* @__PURE__ */ jsx("div", { className: "mt-3", children: translationNote }),
|
|
156
158
|
notice !== void 0 && notice !== null && /* @__PURE__ */ jsx(AlertBanner, { tone: "warning", role: "note", className: "mt-4", children: notice }),
|
|
157
159
|
/* @__PURE__ */ jsx("div", { className: "mt-8 space-y-8", children }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/legal.tsx"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { MouseEvent, ReactNode } from \"react\";\n\nimport { useKitLabels } from \"../i18n/kit-labels\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { countryName } from \"../lib/countries\";\nimport { AlertBanner } from \"./alert-banner\";\nimport { TextLink } from \"./text-link\";\nimport { DEFAULT_LEGAL_LABELS } from \"./legal-labels\";\n\n/**\n * The legal pages — Imprint, Privacy Policy, Terms — for every app.\n *\n * 0.19 (docs/i18n-harmonization.md H10): keksdose and kastlan each carried the same\n * shell, written twice: a back link, the title, a \"closed beta, not yet reviewed by a\n * lawyer\" notice, sections of heading + running text, and kastlan's row of links to the\n * three pages with the current one marked. That shape moved here; the words stayed in\n * each app.\n *\n * 0.28 (docs/legal-harmonization.md) reverses the second half: the wording that is the\n * same in all three apps is the kit's too, in all seven languages, so there is ONE text\n * to change after the lawyer's review instead of three apps drifting apart sentence by\n * sentence. This module holds the labels (every kit-owned legal word, §4.3/§4.4), the\n * column (`LegalLayout`), the section (`LegalSection`, now numbered and cross-referenced\n * inside a `LegalPage`), the links row and the public footer. The page frame, the\n * kit-owned sections and the terms checkbox are in `./legal-page`.\n *\n * `LegalLayout` stays a CONTENT COLUMN, not a page: before 0.28 keksdose showed it inside\n * its public landing header and footer and kastlan inside `AuthLayout`. `LegalPage` is\n * the frame around it that the contract (§3.2) settled on — keksdose's.\n */\n\n// ── The operator ──────────────────────────────────────────────────────────────\n\n/** The three pages, by the key every app uses for them (§4.1). Kurvenschmiede's\n * `imprint` became `impressum`. */\nexport type LegalPageKey = \"impressum\" | \"privacy\" | \"terms\";\n\n/** The three routes (§3.1): one per page, the language from i18n, no per-language URLs. */\nexport const LEGAL_HREFS: Readonly<Record<LegalPageKey, string>> = Object.freeze({\n impressum: \"/impressum\",\n privacy: \"/privacy\",\n terms: \"/terms\",\n});\n\n/**\n * Who runs the app — the values the kit's legal sections are filled in with (§5).\n *\n * The kit holds NO personal data: every app passes the same values once, to\n * {@link LegalPage}'s `operator`. Plain strings, so the app's config or env can hold them.\n */\nexport interface LegalOperator {\n /** The operator's name, as the imprint prints it. */\n name: string;\n /** \"9470\"-shaped; printed before the city. */\n postalCode: string;\n /** The place — the imprint's address line and the terms' place of jurisdiction. */\n city: string;\n /** The canton or state, abbreviated as the place of jurisdiction writes it: \"SG\". */\n region: string;\n /**\n * ISO 3166-1 alpha-2: \"CH\". A CODE, not a name — the kit names it in the page's\n * language (`Intl.DisplayNames`, see `countryName`), so \"Switzerland\", \"Schweiz\",\n * \"Suisse\" and \"瑞士\" all come from one value.\n */\n country: string;\n /** The contact address the imprint and the privacy policy print. */\n email: string;\n /**\n * The language whose version of the legal texts is BINDING (\"de-CH\"), a BCP 47 code\n * (0.28.1, Marcel 2026-10-05). The lawyer reviews that one; the others are translations\n * for convenience. With it, {@link LegalPage} shows a note on every page read in\n * another language, and the terms' `language` section says which version prevails.\n * Only the language subtag counts: \"de-CH\" and \"de\" are the same language here.\n */\n bindingLanguage?: string;\n}\n\n/**\n * The operator as the kit's texts read it: {@link LegalOperator} with `country` already\n * NAMED in the page's language (\"Schweiz\", not \"CH\").\n *\n * The label functions take this rather than the code so they stay pure string functions\n * of plain values, like every other function label in the kit: a catalogue never calls\n * `Intl`, and a review row can be rendered from placeholders (`{{country}}`).\n */\nexport type LegalOperatorText = Readonly<Record<keyof LegalOperator, string>>;\n\n/** The language subtag of a BCP 47 code, lower-cased: \"de-CH\" → \"de\". */\nexport function baseLanguage(code: string): string {\n return code.split(/[-_]/)[0]!.toLowerCase();\n}\n\nconst languageNamers = new Map<string, Intl.DisplayNames | null>();\n\n/** The name of a language in `locale` — \"Deutsch\", \"German\", \"allemand\", \"德语\" — from its\n * language subtag, so \"de-CH\" is plain \"German\", not \"Swiss High German\". The code itself\n * when the runtime cannot name it. */\nfunction languageName(code: string, locale: string): string {\n let namer = languageNamers.get(locale);\n if (namer === undefined) {\n try {\n namer = new Intl.DisplayNames([locale], { type: \"language\" });\n } catch {\n namer = null;\n }\n languageNamers.set(locale, namer);\n }\n const base = baseLanguage(code);\n try {\n return namer?.of(base) ?? base;\n } catch {\n return base;\n }\n}\n\n/** @internal The operator as the texts read it: its country named in `locale` (English\n * without one — `countryName`'s rule, so an app that set no locale reads English). */\nexport function legalOperatorText(operator: LegalOperator, locale: string = \"en\"): LegalOperatorText {\n return {\n ...operator,\n country: countryName(operator.country, locale),\n bindingLanguage: operator.bindingLanguage ? languageName(operator.bindingLanguage, locale) : \"\",\n };\n}\n\n// ── Labels ────────────────────────────────────────────────────────────────────\n\n/** A kit section whose text is fixed: a heading and one body. */\nexport interface LegalTextSectionLabels {\n title: string;\n body: string;\n}\n\n/**\n * 0.32.0: the imprint's disclaimer, with the body of its COMMERCIAL variant\n * (docs/billing-harmonization.md §8; legal decision 7). The title is the same in both:\n * liability for content and links is the subject either way.\n */\nexport interface LegalDisclaimerSectionLabels extends LegalTextSectionLabels {\n /**\n * The body for `<LegalKitSection section=\"disclaimer\" variant=\"commercial\">`: a paid\n * service sold through a Merchant of Record, which sells in its own name (§2.2), so the\n * \"private, non-commercial … closed beta\" of `body` would be untrue. OPTIONAL, as every\n * key added to a namespace an app may annotate: left out, the provider's, then English.\n */\n commercial?: string;\n}\n\n/** A kit section whose text names the operator (§4.3 `{name}`, `{email}`, …). */\nexport interface LegalOperatorSectionLabels {\n title: string;\n /** Called with the operator, its country already named in the page's language. Line\n * breaks are kept (`white-space: pre-line`): an address is plain lines. */\n body: (operator: LegalOperatorText) => string;\n}\n\n/** A kit section with an app slot (or a list) between its two parts. */\nexport interface LegalFramedSectionLabels {\n title: string;\n /** Before the app's part. */\n lead: string;\n /** After it. */\n tail: string;\n}\n\n/**\n * Every word of the legal pages that is the kit's — docs/legal-harmonization.md §4.3 and\n * §4.4, verbatim. English, British spelling; the other six languages are in the\n * catalogues (`@eifi1/ui-kit/i18n/<code>`).\n *\n * Keys follow the contract: `sections.<page>.<section key>`, the section keys being\n * keksdose's (`legal_basis`, not `legalBasis`), because the same key is the section's\n * `id` (`/privacy#legal_basis`) and the app's own sections sit beside these under the\n * same names in its catalogue. Titles carry NO number: {@link LegalPage} numbers the\n * privacy and terms sections in render order (§4.1).\n */\nexport interface LegalLabels {\n /** The accessible name of {@link LegalLinks}' and {@link LegalFooter}'s `<nav>`. */\n navLabel: string;\n /** The short labels of the three links, everywhere the links appear (§3.3). */\n links: Record<LegalPageKey, string>;\n /** The pages' titles — the `<h1>`, and the links of the terms checkbox. */\n titles: Record<LegalPageKey, string>;\n /** The back link above the title: \"← Back to home\". */\n backHome: string;\n /**\n * The terms checkbox (§3.4) — ONE template with `{terms}` and `{privacy}`, which\n * become the links (named with `titles`). Not a prefix plus a joiner: a language puts\n * the links where its grammar wants them, articles included, and nothing is added\n * around a placeholder — Italian elides, \"e l’{privacy}\", with no space.\n */\n accept: string;\n /** The notice under the title (§3.2): `beta` on the imprint and the terms, `privacy`\n * on the privacy policy. */\n notice: {\n beta: string;\n privacy: string;\n };\n /**\n * 0.28.1: on a page read in another language than the operator's `bindingLanguage` —\n * `note` under the title, `show` on the button that switches to the binding version\n * (when the app passes `onShowBindingLanguage`). `o.bindingLanguage` is the binding\n * language's NAME in the reader's language (\"German\", \"allemand\").\n */\n translation: {\n note: (o: LegalOperatorText) => string;\n show: (o: LegalOperatorText) => string;\n };\n /** The kit's sections (§4.3), by page and section key. */\n sections: {\n impressum: {\n operator: LegalOperatorSectionLabels;\n contact: LegalOperatorSectionLabels;\n /** `body` is the default, non-commercial text; `commercial` the 0.32 variant. */\n disclaimer: LegalDisclaimerSectionLabels;\n };\n privacy: {\n controller: LegalOperatorSectionLabels;\n /** The app's paragraph follows the body (§4.2): consent, where an app relies on it. */\n legal_basis: LegalTextSectionLabels;\n /** `lead`, then the app's entries as a list, then `tail`, then the app's paragraph. */\n browser: LegalFramedSectionLabels;\n /** `lead` (the rights), then the app's paragraph (export, deletion), then `tail`\n * (the supervisory authorities). */\n rights: LegalFramedSectionLabels;\n contact: LegalOperatorSectionLabels;\n };\n terms: {\n warranty: LegalTextSectionLabels;\n liability: LegalTextSectionLabels;\n changes: LegalTextSectionLabels;\n /** 0.28.1: which language's version prevails — `o.bindingLanguage`, named. */\n language: LegalOperatorSectionLabels;\n /** The place of jurisdiction is the operator's `{city} ({region}), {country}`. */\n law: LegalOperatorSectionLabels;\n };\n };\n}\n\n// Defined in ./legal-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_LEGAL_LABELS };\n\n/** The `legal` namespace, resolved: defaults < provider < `labels` prop. The prop may be\n * partial at every depth (`{ titles: { terms: \"…\" } }`), as the provider's is. */\nexport function useLegalLabels(labels?: LabelOverride<LegalLabels>): LegalLabels {\n return useKitLabels(\"legal\", DEFAULT_LEGAL_LABELS, labels);\n}\n\n// ── What a LegalPage tells the sections inside it ─────────────────────────────\n\n/** Where a `{ref:key}` points: the section's number on a numbered page, else its heading. */\nexport interface LegalRefTarget {\n number?: number;\n heading: ReactNode;\n}\n\n/** @internal Set by `LegalPage` around its column; `null` outside one. */\nexport interface LegalPageContextValue {\n page: LegalPageKey;\n /** The operator with its country named — what the kit sections are filled in with. */\n operator: LegalOperatorText;\n /** The heading level of a section that does not choose one: one below the title. */\n sectionHeading: \"h2\" | \"h3\";\n /** Every section's key, in render order — known BEFORE any section renders, so a\n * reference can point forward (keksdose's section 2 refers to section 10). */\n targets: ReadonlyMap<string, LegalRefTarget>;\n}\n\n/** @internal */\nexport const LegalPageContext = createContext<LegalPageContextValue | null>(null);\n\n/** @internal The place `LegalPage` gave one section: its key and its number. Reset to\n * `null` inside a section, so a section nested in another's children takes neither. */\nexport interface LegalSectionSlot {\n id?: string;\n number?: number;\n}\n\n/** @internal */\nexport const LegalSlotContext = createContext<LegalSectionSlot | null>(null);\n\n/** @internal `{ref:retention}`. A key is a section key: letters, digits, `_` and `-`. */\nconst REF_TOKEN = /\\{ref:([A-Za-z0-9_-]+)\\}/g;\n\n/**\n * A development build's console note — never in production (the consumer's bundler\n * makes `import.meta.env.DEV` false) and never under vitest. Optional-chained:\n * `import.meta.env` is a Vite injection, absent under plain Node.\n */\nfunction devWarnings(): boolean {\n return Boolean(import.meta.env?.DEV) && !import.meta.env?.VITEST;\n}\nconst warned = new Set<string>();\n/** @internal Once per message. */\nexport function warnLegalOnce(message: string): void {\n if (!devWarnings() || warned.has(message)) return;\n warned.add(message);\n console.warn(`[ui-kit] ${message}`);\n}\n\n/**\n * `text` with every `{ref:key}` replaced by a link to `#key` that reads the section's\n * number — the words around it stay the app's (\"see section {ref:retention}\", \"siehe\n * Abschnitt {ref:retention}\"), so each language keeps its grammar (§4.1). On the imprint,\n * which is not numbered, the link reads the section's heading instead.\n *\n * Outside a {@link LegalPage} the text is returned as it is: there is no order to count.\n * A key the page has no section for stays visible as the raw token — a broken reference\n * an app test can find (`not.toHaveTextContent(\"{ref:\")`), not a silently wrong number.\n */\nexport function resolveLegalRefs(text: string, page: LegalPageContextValue | null): ReactNode {\n if (!page || !text.includes(\"{ref:\")) return text;\n const out: ReactNode[] = [];\n let last = 0;\n for (const match of text.matchAll(REF_TOKEN)) {\n const at = match.index ?? 0;\n if (at > last) out.push(text.slice(last, at));\n const key = match[1];\n const target = page.targets.get(key);\n if (target) {\n out.push(\n <TextLink key={`${key}@${at}`} href={`#${key}`}>\n {target.number ?? target.heading}\n </TextLink>,\n );\n } else {\n warnLegalOnce(`{ref:${key}} on the ${page.page} page points at no section of it.`);\n out.push(match[0]);\n }\n last = at + match[0].length;\n }\n if (last < text.length) out.push(text.slice(last));\n return out;\n}\n\n/** @internal Running text — one translation string — with its line breaks kept and its\n * `{ref:key}` tokens resolved. */\nexport function LegalText({ text, className }: { text: string; className?: string }) {\n const page = useContext(LegalPageContext);\n // `break-words`: an address, an email or a URL in a translation is one long word, and\n // on a 390px phone it would push the column wider than the screen.\n return <p className={cn(\"whitespace-pre-line break-words\", className)}>{resolveLegalRefs(text, page)}</p>;\n}\n\n// ── Links ─────────────────────────────────────────────────────────────────────\n\nexport interface LegalLink {\n href: string;\n /** \"Imprint\", \"Privacy Policy\", \"Terms\". */\n label: ReactNode;\n}\n\nexport interface LegalLinksProps {\n /** Default (0.28): the three routes, `/impressum`, `/privacy` and `/terms`, with the\n * kit's short link labels (`legal.links`), in the contract's order. */\n links?: readonly LegalLink[];\n /** The page being shown; its link is marked `aria-current=\"page\"`. Usually the\n * router's pathname. */\n currentHref?: string;\n /** `false` renders the links without the `<nav>` landmark — inside `AuthLayout`'s\n * `footer` or `TopBarActionMenu`'s `footer`, which are named `<nav>`s already. The row\n * keeps its spacing and `className` either way (0.27.1: it used to return the bare\n * links, so in a plain container — Kurvenschmiede's account-menu `<li>` — they ran\n * together as \"ImpressumDatenschutzerklärungNutz…\" and overflowed). Default true. */\n nav?: boolean;\n /** Called on a click on any of the links, before it navigates — an account menu closes\n * itself here (0.28.1, keksdose: it had to catch the click on a wrapping `<div>`). */\n onLinkClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n labels?: LabelOverride<LegalLabels>;\n className?: string;\n}\n\n/** The default links: the three routes under the kit's short labels. */\nfunction defaultLinks(labels: LegalLabels): LegalLink[] {\n return ([\"impressum\", \"privacy\", \"terms\"] as const).map((page) => ({\n href: LEGAL_HREFS[page],\n label: labels.links[page],\n }));\n}\n\n/**\n * The legal pages as a row of quiet links, the one you are on marked (kastlan's\n * `LegalLinks`). Wraps on a phone.\n *\n * 0.28: `·` separators between the links, keksdose's footer style, wherever the links\n * appear — the account menu included (§3.3). The dots are `aria-hidden`: a screen reader\n * already hears three links, and \"middle dot\" between them is noise. They are flex items\n * of the row like the links, so the row's gap spaces them evenly.\n */\nexport function LegalLinks({\n links,\n currentHref,\n nav = true,\n onLinkClick,\n labels: labelsProp,\n className,\n}: LegalLinksProps) {\n const labels = useLegalLabels(labelsProp);\n const shown = links ?? defaultLinks(labels);\n const items = shown.flatMap((link, i) => [\n ...(i > 0 ? [<span key={`sep-${link.href}`} aria-hidden=\"true\">·</span>] : []),\n <TextLink key={link.href} href={link.href} tone=\"muted\" current={link.href === currentHref} onClick={onLinkClick}>\n {link.label}\n </TextLink>,\n ]);\n const rowClass = cn(\"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs\", className);\n if (!nav) return <div className={rowClass}>{items}</div>;\n return (\n <nav aria-label={labels.navLabel} className={rowClass}>\n {items}\n </nav>\n );\n}\n\n// ── Footer ────────────────────────────────────────────────────────────────────\n\nexport interface LegalFooterProps {\n /** Under the links, centred — the app's tagline (keksdose: \"Self-hosted household\n * budgeting & bookkeeping.\"). */\n children?: ReactNode;\n /** Default: the three routes with the kit's link labels — see {@link LegalLinks}. */\n links?: readonly LegalLink[];\n /** Marks that link `aria-current=\"page\"`. {@link LegalPage}'s default footer passes\n * its own page. */\n currentHref?: string;\n /**\n * Default true: the footer is a `<footer>`. `false` draws a `<div>` — for a host that is\n * a footer already: `AuthLayout`'s `footer` slot is one, and HTML forbids a footer inside\n * a footer (0.28.1, kastlan). On an `AuthLayout` page the usual choice is simpler still:\n * `footer={<LegalLinks nav={false} />}` with `footerLabel` set to the kit's `navLabel`\n * ({@link useLegalLabels}).\n */\n landmark?: boolean;\n className?: string;\n labels?: LabelOverride<LegalLabels>;\n}\n\n/**\n * The public footer (§3.3): the three links, centred, with their separators, in a\n * `<nav aria-label=\"Legal\">` — on the landing or home page, every signed-out page the app\n * has, the legal pages and the 404. The rule behind it: from every page a signed-out\n * visitor can reach, the three links are one click away.\n *\n * keksdose's `SiteFooter` (features/landing/site-footer.tsx), which carried them on its\n * landing, auth, legal and 404 pages; kastlan and Kurvenschmiede had them on some pages\n * only. Its palette classes (`border-slate-200 bg-white dark:…`) became the surface and\n * border tokens, so it follows the theme like the rest of the kit.\n */\nexport function LegalFooter({ children, links, currentHref, landmark = true, className, labels }: LegalFooterProps) {\n const Root = landmark ? \"footer\" : \"div\";\n return (\n <Root className={cn(\"border-t border-subtle bg-surface\", className)}>\n <div className=\"mx-auto max-w-5xl px-4 py-8 text-sm text-muted\">\n <LegalLinks\n links={links}\n currentHref={currentHref}\n labels={labels}\n className=\"justify-center gap-y-2 text-sm\"\n />\n {children !== undefined && children !== null && <p className=\"mt-4 text-center\">{children}</p>}\n </div>\n </Root>\n );\n}\n\n// ── Section ───────────────────────────────────────────────────────────────────\n\nexport interface LegalSectionProps {\n heading: ReactNode;\n /** Running text. Line breaks in it are kept (`white-space: pre-line`), so a\n * translation can hold an address or a list as plain lines. Inside a\n * {@link LegalPage}, `{ref:key}` becomes the number of section `key`, linked. */\n body?: string;\n /** Anything richer than plain text — links, a list — after `body`. A plain string\n * here has its `{ref:key}` tokens resolved too. */\n children?: ReactNode;\n /**\n * The section's `id`, for a link to it from elsewhere. Inside a {@link LegalPage} it\n * defaults to the element's React `key` — keksdose's\n * `SECTIONS.map((s) => <LegalSection key={s} … />)` gets `id=\"retention\"` with\n * nothing added — and it is the key a `{ref:…}` names.\n */\n id?: string;\n /** The heading's element. Default `h2` under the layout's `h1` (inside a\n * `LegalPage`, one level below its title). */\n headingAs?: \"h2\" | \"h3\";\n}\n\n/**\n * One section: heading and running text.\n *\n * 0.28, inside a {@link LegalPage}: its `id` (the `key` unless given), its number on the\n * privacy policy and the terms (\"3. Legal basis\" — titles carry no number, §4.1), and\n * `{ref:key}` resolution in `body`. Outside one it is exactly the 0.19 section.\n */\nexport function LegalSection({ heading, body, children, id: idProp, headingAs }: LegalSectionProps) {\n const page = useContext(LegalPageContext);\n const slot = useContext(LegalSlotContext);\n const id = idProp ?? slot?.id;\n const number = slot?.number;\n const Heading = headingAs ?? page?.sectionHeading ?? \"h2\";\n return (\n <section id={id} className=\"scroll-mt-20\">\n <Heading className=\"text-lg font-semibold break-words text-primary\">\n {number !== undefined && `${number}. `}\n {heading}\n </Heading>\n <LegalSlotContext.Provider value={null}>\n {body !== undefined && (\n <LegalText text={body} className=\"mt-2 text-sm leading-relaxed text-secondary\" />\n )}\n {children !== undefined && (\n <div className=\"mt-2 text-sm leading-relaxed break-words text-secondary\">\n {typeof children === \"string\" ? resolveLegalRefs(children, page) : children}\n </div>\n )}\n </LegalSlotContext.Provider>\n </section>\n );\n}\n\n// ── Layout ────────────────────────────────────────────────────────────────────\n\nexport interface LegalLayoutProps {\n /** \"Imprint\", \"Privacy Policy\", \"Terms\". */\n title: ReactNode;\n /** Above the title — the app's \"← Back\" link (`<TextLink icon={ArrowLeft}>`). Inside\n * a {@link LegalPage}, \"← Back to home\". */\n back?: ReactNode;\n /**\n * A notice under the title, as a warning banner with `role=\"note\"` — page furniture,\n * not an alert. Per page, not per layout: the privacy page says something more precise\n * than the others (its technical sections describe running code).\n */\n notice?: ReactNode;\n /** 0.28.1: under the title, before the notice — {@link LegalPage}'s note that this\n * page is a translation and which language is binding. */\n translationNote?: ReactNode;\n /** The sections — {@link LegalSection}s. */\n children: ReactNode;\n /** The three pages, linked at the end of the column with the current one marked.\n * Leave out when the page's chrome already shows them (a {@link LegalFooter}). */\n links?: readonly LegalLink[];\n currentHref?: string;\n /** Default `h1`: the page's heading. */\n headingAs?: \"h1\" | \"h2\";\n /** Extra classes on the column — `px-0 py-0` inside a chrome that pads already. */\n className?: string;\n labels?: LabelOverride<LegalLabels>;\n}\n\nexport function LegalLayout({\n title,\n back,\n notice,\n translationNote,\n children,\n links,\n currentHref,\n headingAs: Heading = \"h1\",\n className,\n labels,\n}: LegalLayoutProps) {\n return (\n <article className={cn(\"mx-auto w-full max-w-3xl px-4 py-12\", className)}>\n {back !== undefined && <div className=\"mb-4 text-sm\">{back}</div>}\n <Heading className=\"text-3xl font-bold tracking-tight break-words text-primary\">{title}</Heading>\n {translationNote !== undefined && translationNote !== null && <div className=\"mt-3\">{translationNote}</div>}\n {notice !== undefined && notice !== null && (\n <AlertBanner tone=\"warning\" role=\"note\" className=\"mt-4\">\n {notice}\n </AlertBanner>\n )}\n <div className=\"mt-8 space-y-8\">{children}</div>\n {links !== undefined && links.length > 0 && (\n <LegalLinks links={links} currentHref={currentHref} labels={labels} className=\"mt-12 border-t border-subtle pt-4\" />\n )}\n </article>\n );\n}\n"],"mappings":";AAmUQ,cAmIF,YAnIE;AAnUR,SAAS,eAAe,kBAAkB;AAG1C,SAAS,oBAAoB;AAE7B,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,4BAA4B;AA+B9B,MAAM,cAAsD,OAAO,OAAO;AAAA,EAC/E,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AACT,CAAC;AA8CM,SAAS,aAAa,MAAsB;AACjD,SAAO,KAAK,MAAM,MAAM,EAAE,CAAC,EAAG,YAAY;AAC5C;AAEA,MAAM,iBAAiB,oBAAI,IAAsC;AAKjE,SAAS,aAAa,MAAc,QAAwB;AAC1D,M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AEJ;AAgCO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW,UAAU;AAAA,EACrB;AAAA,EACA;AACF,GAAqB;AACnB,SACE,qBAAC,aAAQ,WAAW,GAAG,uCAAuC,SAAS,GACpE;AAAA,aAAS,UAAa,oBAAC,SAAI,WAAU,gBAAgB,gBAAK;AAAA,IAC3D,oBAAC,WAAQ,WAAU,8DAA8D,iBAAM;AAAA,IACtF,oBAAoB,UAAa,oBAAoB,QAAQ,oBAAC,SAAI,WAAU,QAAQ,2BAAgB;AAAA,IACpG,WAAW,UAAa,WAAW,QAClC,oBAAC,eAAY,MAAK,WAAU,MAAK,QAAO,WAAU,QAC/C,kBACH;AAAA,IAEF,oBAAC,SAAI,WAAU,kBAAkB,UAAS;AAAA,IACzC,UAAU,UAAa,MAAM,SAAS,KACrC,oBAAC,cAAW,OAAc,aAA0B,QAAgB,WAAU,qCAAoC;AAAA,KAEtH;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/legal.tsx"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { MouseEvent, ReactNode } from \"react\";\n\nimport { useKitLabels } from \"../i18n/kit-labels\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { countryName } from \"../lib/countries\";\nimport { AlertBanner } from \"./alert-banner\";\nimport { TextLink } from \"./text-link\";\nimport { DEFAULT_LEGAL_LABELS } from \"./legal-labels\";\n\n/**\n * The legal pages — Imprint, Privacy Policy, Terms — for every app.\n *\n * 0.19 (docs/i18n-harmonization.md H10): keksdose and kastlan each carried the same\n * shell, written twice: a back link, the title, a \"closed beta, not yet reviewed by a\n * lawyer\" notice, sections of heading + running text, and kastlan's row of links to the\n * three pages with the current one marked. That shape moved here; the words stayed in\n * each app.\n *\n * 0.28 (docs/legal-harmonization.md) reverses the second half: the wording that is the\n * same in all three apps is the kit's too, in all seven languages, so there is ONE text\n * to change after the lawyer's review instead of three apps drifting apart sentence by\n * sentence. This module holds the labels (every kit-owned legal word, §4.3/§4.4), the\n * column (`LegalLayout`), the section (`LegalSection`, now numbered and cross-referenced\n * inside a `LegalPage`), the links row and the public footer. The page frame, the\n * kit-owned sections and the terms checkbox are in `./legal-page`.\n *\n * `LegalLayout` stays a CONTENT COLUMN, not a page: before 0.28 keksdose showed it inside\n * its public landing header and footer and kastlan inside `AuthLayout`. `LegalPage` is\n * the frame around it that the contract (§3.2) settled on — keksdose's.\n */\n\n// ── The operator ──────────────────────────────────────────────────────────────\n\n/** The three pages, by the key every app uses for them (§4.1). Kurvenschmiede's\n * `imprint` became `impressum`. */\nexport type LegalPageKey = \"impressum\" | \"privacy\" | \"terms\";\n\n/** The three routes (§3.1): one per page, the language from i18n, no per-language URLs. */\nexport const LEGAL_HREFS: Readonly<Record<LegalPageKey, string>> = Object.freeze({\n impressum: \"/impressum\",\n privacy: \"/privacy\",\n terms: \"/terms\",\n});\n\n/**\n * Who runs the app — the values the kit's legal sections are filled in with (§5).\n *\n * The kit holds NO personal data: every app passes the same values once, to\n * {@link LegalPage}'s `operator`. Plain strings, so the app's config or env can hold them.\n */\nexport interface LegalOperator {\n /** The operator's name, as the imprint prints it. */\n name: string;\n /** \"9470\"-shaped; printed before the city. */\n postalCode: string;\n /** The place — the imprint's address line and the terms' place of jurisdiction. */\n city: string;\n /** The canton or state, abbreviated as the place of jurisdiction writes it: \"SG\". */\n region: string;\n /**\n * ISO 3166-1 alpha-2: \"CH\". A CODE, not a name — the kit names it in the page's\n * language (`Intl.DisplayNames`, see `countryName`), so \"Switzerland\", \"Schweiz\",\n * \"Suisse\" and \"瑞士\" all come from one value.\n */\n country: string;\n /** The contact address the imprint and the privacy policy print. */\n email: string;\n /**\n * The language whose version of the legal texts is BINDING (\"de-CH\"), a BCP 47 code\n * (0.28.1, Marcel 2026-10-05). The lawyer reviews that one; the others are translations\n * for convenience. With it, {@link LegalPage} shows a note on every page read in\n * another language, and the terms' `language` section says which version prevails.\n * Only the language subtag counts: \"de-CH\" and \"de\" are the same language here.\n */\n bindingLanguage?: string;\n}\n\n/**\n * The operator as the kit's texts read it: {@link LegalOperator} with `country` already\n * NAMED in the page's language (\"Schweiz\", not \"CH\").\n *\n * The label functions take this rather than the code so they stay pure string functions\n * of plain values, like every other function label in the kit: a catalogue never calls\n * `Intl`, and a review row can be rendered from placeholders (`{{country}}`).\n */\nexport type LegalOperatorText = Readonly<Record<keyof LegalOperator, string>>;\n\n/** The language subtag of a BCP 47 code, lower-cased: \"de-CH\" → \"de\". */\nexport function baseLanguage(code: string): string {\n return code.split(/[-_]/)[0]!.toLowerCase();\n}\n\nconst languageNamers = new Map<string, Intl.DisplayNames | null>();\n\n/** The name of a language in `locale` — \"Deutsch\", \"German\", \"allemand\", \"德语\" — from its\n * language subtag, so \"de-CH\" is plain \"German\", not \"Swiss High German\". The code itself\n * when the runtime cannot name it. */\nfunction languageName(code: string, locale: string): string {\n let namer = languageNamers.get(locale);\n if (namer === undefined) {\n try {\n namer = new Intl.DisplayNames([locale], { type: \"language\" });\n } catch {\n namer = null;\n }\n languageNamers.set(locale, namer);\n }\n const base = baseLanguage(code);\n try {\n return namer?.of(base) ?? base;\n } catch {\n return base;\n }\n}\n\n/** @internal The operator as the texts read it: its country named in `locale` (English\n * without one — `countryName`'s rule, so an app that set no locale reads English). */\nexport function legalOperatorText(operator: LegalOperator, locale: string = \"en\"): LegalOperatorText {\n return {\n ...operator,\n country: countryName(operator.country, locale),\n bindingLanguage: operator.bindingLanguage ? languageName(operator.bindingLanguage, locale) : \"\",\n };\n}\n\n// ── Labels ────────────────────────────────────────────────────────────────────\n\n/** A kit section whose text is fixed: a heading and one body. */\nexport interface LegalTextSectionLabels {\n title: string;\n body: string;\n}\n\n/**\n * 0.32.0: the imprint's disclaimer, with the body of its COMMERCIAL variant\n * (docs/billing-harmonization.md §8; legal decision 7). The title is the same in both:\n * liability for content and links is the subject either way.\n */\nexport interface LegalDisclaimerSectionLabels extends LegalTextSectionLabels {\n /**\n * The body for `<LegalKitSection section=\"disclaimer\" variant=\"commercial\">`: a paid\n * service sold through a Merchant of Record, which sells in its own name (§2.2), so the\n * \"private, non-commercial … closed beta\" of `body` would be untrue. OPTIONAL, as every\n * key added to a namespace an app may annotate: left out, the provider's, then English.\n */\n commercial?: string;\n}\n\n/** A kit section whose text names the operator (§4.3 `{name}`, `{email}`, …). */\nexport interface LegalOperatorSectionLabels {\n title: string;\n /** Called with the operator, its country already named in the page's language. Line\n * breaks are kept (`white-space: pre-line`): an address is plain lines. */\n body: (operator: LegalOperatorText) => string;\n}\n\n/** A kit section with an app slot (or a list) between its two parts. */\nexport interface LegalFramedSectionLabels {\n title: string;\n /** Before the app's part. */\n lead: string;\n /** After it. */\n tail: string;\n}\n\n/**\n * Every word of the legal pages that is the kit's — docs/legal-harmonization.md §4.3 and\n * §4.4, verbatim. English, British spelling; the other six languages are in the\n * catalogues (`@eifi1/ui-kit/i18n/<code>`).\n *\n * Keys follow the contract: `sections.<page>.<section key>`, the section keys being\n * keksdose's (`legal_basis`, not `legalBasis`), because the same key is the section's\n * `id` (`/privacy#legal_basis`) and the app's own sections sit beside these under the\n * same names in its catalogue. Titles carry NO number: {@link LegalPage} numbers the\n * privacy and terms sections in render order (§4.1).\n */\nexport interface LegalLabels {\n /** The accessible name of {@link LegalLinks}' and {@link LegalFooter}'s `<nav>`. */\n navLabel: string;\n /** The short labels of the three links, everywhere the links appear (§3.3). */\n links: Record<LegalPageKey, string>;\n /** The pages' titles — the `<h1>`, and the links of the terms checkbox. */\n titles: Record<LegalPageKey, string>;\n /** The back link above the title: \"← Back to home\". */\n backHome: string;\n /**\n * The terms checkbox (§3.4) — ONE template with `{terms}` and `{privacy}`, which\n * become the links (named with `titles`). Not a prefix plus a joiner: a language puts\n * the links where its grammar wants them, articles included, and nothing is added\n * around a placeholder — Italian elides, \"e l’{privacy}\", with no space.\n */\n accept: string;\n /** The notice under the title (§3.2): `beta` on the imprint and the terms, `privacy`\n * on the privacy policy. */\n notice: {\n beta: string;\n privacy: string;\n };\n /**\n * 0.28.1: on a page read in another language than the operator's `bindingLanguage` —\n * `note` under the title, `show` on the button that switches to the binding version\n * (when the app passes `onShowBindingLanguage`). `o.bindingLanguage` is the binding\n * language's NAME in the reader's language (\"German\", \"allemand\").\n */\n translation: {\n note: (o: LegalOperatorText) => string;\n show: (o: LegalOperatorText) => string;\n };\n /**\n * 0.51.3: the as-of line under the title (§3.2), \"Last updated: 29 October 2026\" —\n * {@link LegalPage}'s `updated`, called with the date already written out in the page's\n * locale. OPTIONAL, as every key added to a namespace an app may annotate: left out,\n * the provider's, then English.\n */\n updated?: (date: string) => string;\n /** The kit's sections (§4.3), by page and section key. */\n sections: {\n impressum: {\n operator: LegalOperatorSectionLabels;\n contact: LegalOperatorSectionLabels;\n /** `body` is the default, non-commercial text; `commercial` the 0.32 variant. */\n disclaimer: LegalDisclaimerSectionLabels;\n };\n privacy: {\n controller: LegalOperatorSectionLabels;\n /** The app's paragraph follows the body (§4.2): consent, where an app relies on it. */\n legal_basis: LegalTextSectionLabels;\n /** `lead`, then the app's entries as a list, then `tail`, then the app's paragraph. */\n browser: LegalFramedSectionLabels;\n /** `lead` (the rights), then the app's paragraph (export, deletion), then `tail`\n * (the supervisory authorities). */\n rights: LegalFramedSectionLabels;\n contact: LegalOperatorSectionLabels;\n };\n terms: {\n warranty: LegalTextSectionLabels;\n liability: LegalTextSectionLabels;\n changes: LegalTextSectionLabels;\n /** 0.28.1: which language's version prevails — `o.bindingLanguage`, named. */\n language: LegalOperatorSectionLabels;\n /** The place of jurisdiction is the operator's `{city} ({region}), {country}`. */\n law: LegalOperatorSectionLabels;\n };\n };\n}\n\n// Defined in ./legal-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_LEGAL_LABELS };\n\n/** The `legal` namespace, resolved: defaults < provider < `labels` prop. The prop may be\n * partial at every depth (`{ titles: { terms: \"…\" } }`), as the provider's is. */\nexport function useLegalLabels(labels?: LabelOverride<LegalLabels>): LegalLabels {\n return useKitLabels(\"legal\", DEFAULT_LEGAL_LABELS, labels);\n}\n\n// ── What a LegalPage tells the sections inside it ─────────────────────────────\n\n/** Where a `{ref:key}` points: the section's number on a numbered page, else its heading. */\nexport interface LegalRefTarget {\n number?: number;\n heading: ReactNode;\n}\n\n/** @internal Set by `LegalPage` around its column; `null` outside one. */\nexport interface LegalPageContextValue {\n page: LegalPageKey;\n /** The operator with its country named — what the kit sections are filled in with. */\n operator: LegalOperatorText;\n /** The heading level of a section that does not choose one: one below the title. */\n sectionHeading: \"h2\" | \"h3\";\n /** Every section's key, in render order — known BEFORE any section renders, so a\n * reference can point forward (keksdose's section 2 refers to section 10). */\n targets: ReadonlyMap<string, LegalRefTarget>;\n}\n\n/** @internal */\nexport const LegalPageContext = createContext<LegalPageContextValue | null>(null);\n\n/** @internal The place `LegalPage` gave one section: its key and its number. Reset to\n * `null` inside a section, so a section nested in another's children takes neither. */\nexport interface LegalSectionSlot {\n id?: string;\n number?: number;\n}\n\n/** @internal */\nexport const LegalSlotContext = createContext<LegalSectionSlot | null>(null);\n\n/** @internal `{ref:retention}`. A key is a section key: letters, digits, `_` and `-`. */\nconst REF_TOKEN = /\\{ref:([A-Za-z0-9_-]+)\\}/g;\n\n/**\n * A development build's console note — never in production (the consumer's bundler\n * makes `import.meta.env.DEV` false) and never under vitest. Optional-chained:\n * `import.meta.env` is a Vite injection, absent under plain Node.\n */\nfunction devWarnings(): boolean {\n return Boolean(import.meta.env?.DEV) && !import.meta.env?.VITEST;\n}\nconst warned = new Set<string>();\n/** @internal Once per message. */\nexport function warnLegalOnce(message: string): void {\n if (!devWarnings() || warned.has(message)) return;\n warned.add(message);\n console.warn(`[ui-kit] ${message}`);\n}\n\n/**\n * `text` with every `{ref:key}` replaced by a link to `#key` that reads the section's\n * number — the words around it stay the app's (\"see section {ref:retention}\", \"siehe\n * Abschnitt {ref:retention}\"), so each language keeps its grammar (§4.1). On the imprint,\n * which is not numbered, the link reads the section's heading instead.\n *\n * Outside a {@link LegalPage} the text is returned as it is: there is no order to count.\n * A key the page has no section for stays visible as the raw token — a broken reference\n * an app test can find (`not.toHaveTextContent(\"{ref:\")`), not a silently wrong number.\n */\nexport function resolveLegalRefs(text: string, page: LegalPageContextValue | null): ReactNode {\n if (!page || !text.includes(\"{ref:\")) return text;\n const out: ReactNode[] = [];\n let last = 0;\n for (const match of text.matchAll(REF_TOKEN)) {\n const at = match.index ?? 0;\n if (at > last) out.push(text.slice(last, at));\n const key = match[1];\n const target = page.targets.get(key);\n if (target) {\n out.push(\n <TextLink key={`${key}@${at}`} href={`#${key}`}>\n {target.number ?? target.heading}\n </TextLink>,\n );\n } else {\n warnLegalOnce(`{ref:${key}} on the ${page.page} page points at no section of it.`);\n out.push(match[0]);\n }\n last = at + match[0].length;\n }\n if (last < text.length) out.push(text.slice(last));\n return out;\n}\n\n/** @internal Running text — one translation string — with its line breaks kept and its\n * `{ref:key}` tokens resolved. */\nexport function LegalText({ text, className }: { text: string; className?: string }) {\n const page = useContext(LegalPageContext);\n // `break-words`: an address, an email or a URL in a translation is one long word, and\n // on a 390px phone it would push the column wider than the screen.\n return <p className={cn(\"whitespace-pre-line break-words\", className)}>{resolveLegalRefs(text, page)}</p>;\n}\n\n// ── Links ─────────────────────────────────────────────────────────────────────\n\nexport interface LegalLink {\n href: string;\n /** \"Imprint\", \"Privacy Policy\", \"Terms\". */\n label: ReactNode;\n}\n\nexport interface LegalLinksProps {\n /** Default (0.28): the three routes, `/impressum`, `/privacy` and `/terms`, with the\n * kit's short link labels (`legal.links`), in the contract's order. */\n links?: readonly LegalLink[];\n /** The page being shown; its link is marked `aria-current=\"page\"`. Usually the\n * router's pathname. */\n currentHref?: string;\n /** `false` renders the links without the `<nav>` landmark — inside `AuthLayout`'s\n * `footer` or `TopBarActionMenu`'s `footer`, which are named `<nav>`s already. The row\n * keeps its spacing and `className` either way (0.27.1: it used to return the bare\n * links, so in a plain container — Kurvenschmiede's account-menu `<li>` — they ran\n * together as \"ImpressumDatenschutzerklärungNutz…\" and overflowed). Default true. */\n nav?: boolean;\n /** Called on a click on any of the links, before it navigates — an account menu closes\n * itself here (0.28.1, keksdose: it had to catch the click on a wrapping `<div>`). */\n onLinkClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n labels?: LabelOverride<LegalLabels>;\n className?: string;\n}\n\n/** The default links: the three routes under the kit's short labels. */\nfunction defaultLinks(labels: LegalLabels): LegalLink[] {\n return ([\"impressum\", \"privacy\", \"terms\"] as const).map((page) => ({\n href: LEGAL_HREFS[page],\n label: labels.links[page],\n }));\n}\n\n/**\n * The legal pages as a row of quiet links, the one you are on marked (kastlan's\n * `LegalLinks`). Wraps on a phone.\n *\n * 0.28: `·` separators between the links, keksdose's footer style, wherever the links\n * appear — the account menu included (§3.3). The dots are `aria-hidden`: a screen reader\n * already hears three links, and \"middle dot\" between them is noise. They are flex items\n * of the row like the links, so the row's gap spaces them evenly.\n */\nexport function LegalLinks({\n links,\n currentHref,\n nav = true,\n onLinkClick,\n labels: labelsProp,\n className,\n}: LegalLinksProps) {\n const labels = useLegalLabels(labelsProp);\n const shown = links ?? defaultLinks(labels);\n const items = shown.flatMap((link, i) => [\n ...(i > 0 ? [<span key={`sep-${link.href}`} aria-hidden=\"true\">·</span>] : []),\n <TextLink key={link.href} href={link.href} tone=\"muted\" current={link.href === currentHref} onClick={onLinkClick}>\n {link.label}\n </TextLink>,\n ]);\n const rowClass = cn(\"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs\", className);\n if (!nav) return <div className={rowClass}>{items}</div>;\n return (\n <nav aria-label={labels.navLabel} className={rowClass}>\n {items}\n </nav>\n );\n}\n\n// ── Footer ────────────────────────────────────────────────────────────────────\n\nexport interface LegalFooterProps {\n /** Under the links, centred — the app's tagline (keksdose: \"Self-hosted household\n * budgeting & bookkeeping.\"). */\n children?: ReactNode;\n /** Default: the three routes with the kit's link labels — see {@link LegalLinks}. */\n links?: readonly LegalLink[];\n /** Marks that link `aria-current=\"page\"`. {@link LegalPage}'s default footer passes\n * its own page. */\n currentHref?: string;\n /**\n * Default true: the footer is a `<footer>`. `false` draws a `<div>` — for a host that is\n * a footer already: `AuthLayout`'s `footer` slot is one, and HTML forbids a footer inside\n * a footer (0.28.1, kastlan). On an `AuthLayout` page the usual choice is simpler still:\n * `footer={<LegalLinks nav={false} />}` with `footerLabel` set to the kit's `navLabel`\n * ({@link useLegalLabels}).\n */\n landmark?: boolean;\n className?: string;\n labels?: LabelOverride<LegalLabels>;\n}\n\n/**\n * The public footer (§3.3): the three links, centred, with their separators, in a\n * `<nav aria-label=\"Legal\">` — on the landing or home page, every signed-out page the app\n * has, the legal pages and the 404. The rule behind it: from every page a signed-out\n * visitor can reach, the three links are one click away.\n *\n * keksdose's `SiteFooter` (features/landing/site-footer.tsx), which carried them on its\n * landing, auth, legal and 404 pages; kastlan and Kurvenschmiede had them on some pages\n * only. Its palette classes (`border-slate-200 bg-white dark:…`) became the surface and\n * border tokens, so it follows the theme like the rest of the kit.\n */\nexport function LegalFooter({ children, links, currentHref, landmark = true, className, labels }: LegalFooterProps) {\n const Root = landmark ? \"footer\" : \"div\";\n return (\n <Root className={cn(\"border-t border-subtle bg-surface\", className)}>\n <div className=\"mx-auto max-w-5xl px-4 py-8 text-sm text-muted\">\n <LegalLinks\n links={links}\n currentHref={currentHref}\n labels={labels}\n className=\"justify-center gap-y-2 text-sm\"\n />\n {children !== undefined && children !== null && <p className=\"mt-4 text-center\">{children}</p>}\n </div>\n </Root>\n );\n}\n\n// ── Section ───────────────────────────────────────────────────────────────────\n\nexport interface LegalSectionProps {\n heading: ReactNode;\n /** Running text. Line breaks in it are kept (`white-space: pre-line`), so a\n * translation can hold an address or a list as plain lines. Inside a\n * {@link LegalPage}, `{ref:key}` becomes the number of section `key`, linked. */\n body?: string;\n /** Anything richer than plain text — links, a list — after `body`. A plain string\n * here has its `{ref:key}` tokens resolved too. */\n children?: ReactNode;\n /**\n * The section's `id`, for a link to it from elsewhere. Inside a {@link LegalPage} it\n * defaults to the element's React `key` — keksdose's\n * `SECTIONS.map((s) => <LegalSection key={s} … />)` gets `id=\"retention\"` with\n * nothing added — and it is the key a `{ref:…}` names.\n */\n id?: string;\n /** The heading's element. Default `h2` under the layout's `h1` (inside a\n * `LegalPage`, one level below its title). */\n headingAs?: \"h2\" | \"h3\";\n}\n\n/**\n * One section: heading and running text.\n *\n * 0.28, inside a {@link LegalPage}: its `id` (the `key` unless given), its number on the\n * privacy policy and the terms (\"3. Legal basis\" — titles carry no number, §4.1), and\n * `{ref:key}` resolution in `body`. Outside one it is exactly the 0.19 section.\n */\nexport function LegalSection({ heading, body, children, id: idProp, headingAs }: LegalSectionProps) {\n const page = useContext(LegalPageContext);\n const slot = useContext(LegalSlotContext);\n const id = idProp ?? slot?.id;\n const number = slot?.number;\n const Heading = headingAs ?? page?.sectionHeading ?? \"h2\";\n return (\n <section id={id} className=\"scroll-mt-20\">\n <Heading className=\"text-lg font-semibold break-words text-primary\">\n {number !== undefined && `${number}. `}\n {heading}\n </Heading>\n <LegalSlotContext.Provider value={null}>\n {body !== undefined && (\n <LegalText text={body} className=\"mt-2 text-sm leading-relaxed text-secondary\" />\n )}\n {children !== undefined && (\n <div className=\"mt-2 text-sm leading-relaxed break-words text-secondary\">\n {typeof children === \"string\" ? resolveLegalRefs(children, page) : children}\n </div>\n )}\n </LegalSlotContext.Provider>\n </section>\n );\n}\n\n// ── Layout ────────────────────────────────────────────────────────────────────\n\nexport interface LegalLayoutProps {\n /** \"Imprint\", \"Privacy Policy\", \"Terms\". */\n title: ReactNode;\n /** Above the title — the app's \"← Back\" link (`<TextLink icon={ArrowLeft}>`). Inside\n * a {@link LegalPage}, \"← Back to home\". */\n back?: ReactNode;\n /**\n * A notice under the title, as a warning banner with `role=\"note\"` — page furniture,\n * not an alert. Per page, not per layout: the privacy page says something more precise\n * than the others (its technical sections describe running code).\n */\n notice?: ReactNode;\n /** 0.51.3: right under the title — {@link LegalPage}'s \"Last updated: …\" line. */\n updated?: ReactNode;\n /** 0.28.1: under the title, before the notice — {@link LegalPage}'s note that this\n * page is a translation and which language is binding. */\n translationNote?: ReactNode;\n /** The sections — {@link LegalSection}s. */\n children: ReactNode;\n /** The three pages, linked at the end of the column with the current one marked.\n * Leave out when the page's chrome already shows them (a {@link LegalFooter}). */\n links?: readonly LegalLink[];\n currentHref?: string;\n /** Default `h1`: the page's heading. */\n headingAs?: \"h1\" | \"h2\";\n /** Extra classes on the column — `px-0 py-0` inside a chrome that pads already. */\n className?: string;\n labels?: LabelOverride<LegalLabels>;\n}\n\nexport function LegalLayout({\n title,\n back,\n notice,\n updated,\n translationNote,\n children,\n links,\n currentHref,\n headingAs: Heading = \"h1\",\n className,\n labels,\n}: LegalLayoutProps) {\n return (\n <article className={cn(\"mx-auto w-full max-w-3xl px-4 py-12\", className)}>\n {back !== undefined && <div className=\"mb-4 text-sm\">{back}</div>}\n <Heading className=\"text-3xl font-bold tracking-tight break-words text-primary\">{title}</Heading>\n {updated !== undefined && updated !== null && <p className=\"mt-2 text-sm text-muted\">{updated}</p>}\n {translationNote !== undefined && translationNote !== null && <div className=\"mt-3\">{translationNote}</div>}\n {notice !== undefined && notice !== null && (\n <AlertBanner tone=\"warning\" role=\"note\" className=\"mt-4\">\n {notice}\n </AlertBanner>\n )}\n <div className=\"mt-8 space-y-8\">{children}</div>\n {links !== undefined && links.length > 0 && (\n <LegalLinks links={links} currentHref={currentHref} labels={labels} className=\"mt-12 border-t border-subtle pt-4\" />\n )}\n </article>\n );\n}\n"],"mappings":";AA0UQ,cAmIF,YAnIE;AA1UR,SAAS,eAAe,kBAAkB;AAG1C,SAAS,oBAAoB;AAE7B,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,4BAA4B;AA+B9B,MAAM,cAAsD,OAAO,OAAO;AAAA,EAC/E,WAAW;AAAA,EACX,SAAS;AAAA,EACT,O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eAAS,UACR,oBAAC,aAAU,MAAM,MAAM,WAAU,+CAA8C;AAAA,MAEhF,aAAa,UACZ,oBAAC,SAAI,WAAU,2DACZ,iBAAO,aAAa,WAAW,iBAAiB,UAAU,IAAI,IAAI,UACrE;AAAA,OAEJ;AAAA,KACF;AAEJ;AAkCO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW,UAAU;AAAA,EACrB;AAAA,EACA;AACF,GAAqB;AACnB,SACE,qBAAC,aAAQ,WAAW,GAAG,uCAAuC,SAAS,GACpE;AAAA,aAAS,UAAa,oBAAC,SAAI,WAAU,gBAAgB,gBAAK;AAAA,IAC3D,oBAAC,WAAQ,WAAU,8DAA8D,iBAAM;AAAA,IACtF,YAAY,UAAa,YAAY,QAAQ,oBAAC,OAAE,WAAU,2BAA2B,mBAAQ;AAAA,IAC7F,oBAAoB,UAAa,oBAAoB,QAAQ,oBAAC,SAAI,WAAU,QAAQ,2BAAgB;AAAA,IACpG,WAAW,UAAa,WAAW,QAClC,oBAAC,eAAY,MAAK,WAAU,MAAK,QAAO,WAAU,QAC/C,kBACH;AAAA,IAEF,oBAAC,SAAI,WAAU,kBAAkB,UAAS;AAAA,IACzC,UAAU,UAAa,MAAM,SAAS,KACrC,oBAAC,cAAW,OAAc,aAA0B,QAAgB,WAAU,qCAAoC;AAAA,KAEtH;AAEJ;","names":[]}
|
package/dist/eslint/index.js
CHANGED
|
@@ -47,7 +47,7 @@ const roleUtilities = {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
const VERSION = true ? "0.51.
|
|
50
|
+
const VERSION = true ? "0.51.3" : "0.0.0-source";
|
|
51
51
|
const recommended = {
|
|
52
52
|
name: "@eifi1/ui-kit/recommended",
|
|
53
53
|
// Not the tests, as check:tokens skips the kit's: a test names the old class to assert it
|
package/dist/i18n/german.js
CHANGED
|
@@ -886,6 +886,7 @@ function germanLabels(numberLocale) {
|
|
|
886
886
|
note: (o) => `Dies ist eine \xDCbersetzung zu Ihrer Information. Massgebend ist die Fassung auf ${o.bindingLanguage}.`,
|
|
887
887
|
show: (o) => `Fassung auf ${o.bindingLanguage} anzeigen`
|
|
888
888
|
},
|
|
889
|
+
updated: (date) => `Stand: ${date}`,
|
|
889
890
|
sections: {
|
|
890
891
|
impressum: {
|
|
891
892
|
operator: {
|
|
@@ -948,7 +949,7 @@ Die vollst\xE4ndige Postanschrift wird betroffenen Personen und Aufsichtsbeh\xF6
|
|
|
948
949
|
},
|
|
949
950
|
changes: {
|
|
950
951
|
title: "\xC4nderungen dieser Bedingungen",
|
|
951
|
-
body: "
|
|
952
|
+
body: "Wir k\xF6nnen diese Bedingungen im Zuge der Weiterentwicklung des Dienstes anpassen. Wesentliche \xC4nderungen k\xFCndigen wir mindestens 30 Tage vor ihrem Inkrafttreten per E-Mail und in der App an, zusammen mit dem neuen Text. Wenn Sie nicht einverstanden sind, k\xF6nnen Sie vor diesem Datum widersprechen oder Ihr Konto l\xF6schen und bis dahin Ihre Daten exportieren. Nutzen Sie den Dienst nach diesem Datum weiter, gelten die ge\xE4nderten Bedingungen."
|
|
952
953
|
},
|
|
953
954
|
language: {
|
|
954
955
|
title: "Sprache",
|