@eifi1/ui-kit 0.27.1 → 0.28.1

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.
Files changed (109) hide show
  1. package/README.md +7 -5
  2. package/dist/chart.d.ts +1 -2
  3. package/dist/components/amount-input.d.ts +1 -2
  4. package/dist/components/button-group.d.ts +1 -2
  5. package/dist/components/calculator.d.ts +1 -2
  6. package/dist/components/confirm-dialog.d.ts +1 -2
  7. package/dist/components/copy-button.d.ts +1 -2
  8. package/dist/components/danger-confirm.d.ts +1 -2
  9. package/dist/components/facing-pair.d.ts +1 -2
  10. package/dist/components/file-button.d.ts +1 -2
  11. package/dist/components/file-dropzone.d.ts +1 -2
  12. package/dist/components/form-actions.d.ts +1 -2
  13. package/dist/components/iban-input.d.ts +1 -2
  14. package/dist/components/language-select.d.ts +1 -2
  15. package/dist/components/legal-page.d.ts +267 -0
  16. package/dist/components/legal-page.js +272 -0
  17. package/dist/components/legal-page.js.map +1 -0
  18. package/dist/components/legal.d.ts +70 -87
  19. package/dist/components/legal.js +232 -11
  20. package/dist/components/legal.js.map +1 -1
  21. package/dist/components/money-field.d.ts +1 -2
  22. package/dist/components/number-field.d.ts +1 -2
  23. package/dist/components/number-input.d.ts +1 -2
  24. package/dist/components/numpad-sheet.d.ts +1 -2
  25. package/dist/components/phone-input.d.ts +1 -2
  26. package/dist/components/series-chart.d.ts +1 -2
  27. package/dist/components/settings-fields.d.ts +1 -2
  28. package/dist/components/share-card.d.ts +1 -2
  29. package/dist/components/text-link.d.ts +1 -2
  30. package/dist/components/time-input.d.ts +1 -2
  31. package/dist/components/translation-review.d.ts +2 -1
  32. package/dist/components/translation-review.js.map +1 -1
  33. package/dist/components/ui.d.ts +1 -2
  34. package/dist/feedback/feedback-attachment.d.ts +1 -2
  35. package/dist/feedback/feedback-context.d.ts +1 -2
  36. package/dist/feedback/feedback-crash.d.ts +1 -2
  37. package/dist/feedback/feedback-dialog.d.ts +1 -2
  38. package/dist/feedback/feedback-inbox.d.ts +1 -2
  39. package/dist/feedback/feedback-labels.d.ts +1 -2
  40. package/dist/feedback/feedback-menu.d.ts +1 -2
  41. package/dist/feedback/feedback-record.d.ts +1 -2
  42. package/dist/feedback/feedback-row-detail.d.ts +1 -2
  43. package/dist/feedback/feedback-status-undo.d.ts +1 -2
  44. package/dist/feedback/feedback-submit.d.ts +1 -2
  45. package/dist/feedback/feedback-swipe.d.ts +1 -2
  46. package/dist/feedback/feedback-table.d.ts +1 -2
  47. package/dist/feedback/feedback-thread.d.ts +1 -2
  48. package/dist/feedback.d.ts +1 -2
  49. package/dist/hooks/use-file-drop.d.ts +1 -2
  50. package/dist/hooks/use-noindex.d.ts +26 -0
  51. package/dist/hooks/use-noindex.js +18 -0
  52. package/dist/hooks/use-noindex.js.map +1 -0
  53. package/dist/i18n/defaults.d.ts +1 -2
  54. package/dist/i18n/german.d.ts +1 -2
  55. package/dist/i18n/german.js +95 -1
  56. package/dist/i18n/german.js.map +1 -1
  57. package/dist/i18n/kit-labels.d.ts +1 -2
  58. package/dist/i18n/kit-labels.js.map +1 -1
  59. package/dist/i18n/languages.d.ts +1 -2
  60. package/dist/i18n/locales/de-CH.d.ts +1 -2
  61. package/dist/i18n/locales/en.d.ts +1 -2
  62. package/dist/i18n/locales/es.d.ts +1 -2
  63. package/dist/i18n/locales/es.js +95 -1
  64. package/dist/i18n/locales/es.js.map +1 -1
  65. package/dist/i18n/locales/fr.d.ts +1 -2
  66. package/dist/i18n/locales/fr.js +97 -1
  67. package/dist/i18n/locales/fr.js.map +1 -1
  68. package/dist/i18n/locales/hu.d.ts +1 -2
  69. package/dist/i18n/locales/hu.js +98 -1
  70. package/dist/i18n/locales/hu.js.map +1 -1
  71. package/dist/i18n/locales/it.d.ts +1 -2
  72. package/dist/i18n/locales/it.js +98 -1
  73. package/dist/i18n/locales/it.js.map +1 -1
  74. package/dist/i18n/locales/zh.d.ts +1 -2
  75. package/dist/i18n/locales/zh.js +95 -1
  76. package/dist/i18n/locales/zh.js.map +1 -1
  77. package/dist/i18n/review.d.ts +24 -5
  78. package/dist/i18n/review.js +26 -3
  79. package/dist/i18n/review.js.map +1 -1
  80. package/dist/index.d.ts +5 -4
  81. package/dist/index.js +23 -1
  82. package/dist/index.js.map +1 -1
  83. package/dist/{kit-labels-DQg82eHB.d.ts → kit-labels-Du0uHBq4.d.ts} +342 -4
  84. package/dist/lib/translation-review.d.ts +26 -3
  85. package/dist/lib/translation-review.js +10 -2
  86. package/dist/lib/translation-review.js.map +1 -1
  87. package/dist/rhf/fields.d.ts +1 -2
  88. package/dist/rhf/form.d.ts +1 -2
  89. package/dist/rhf.d.ts +1 -2
  90. package/dist/shell/app-shell.d.ts +1 -2
  91. package/dist/shell/top-bar-brand.d.ts +1 -2
  92. package/dist/shell.d.ts +1 -2
  93. package/dist/wizard/stepper-nav.d.ts +1 -2
  94. package/dist/wizard.d.ts +1 -2
  95. package/package.json +1 -1
  96. package/src/components/legal-page.tsx +601 -0
  97. package/src/components/legal.tsx +540 -46
  98. package/src/components/translation-review.tsx +2 -1
  99. package/src/hooks/use-noindex.ts +37 -0
  100. package/src/i18n/german.ts +91 -0
  101. package/src/i18n/kit-labels.tsx +4 -1
  102. package/src/i18n/locales/es.ts +91 -0
  103. package/src/i18n/locales/fr.ts +93 -0
  104. package/src/i18n/locales/hu.ts +94 -0
  105. package/src/i18n/locales/it.ts +94 -0
  106. package/src/i18n/locales/zh.ts +91 -0
  107. package/src/i18n/review.ts +57 -3
  108. package/src/index.ts +41 -2
  109. package/src/lib/translation-review.ts +43 -4
@@ -0,0 +1,272 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { Fragment as Fragment2, isValidElement, useContext, useMemo } from "react";
4
+ import { ArrowLeft } from "lucide-react";
5
+ import { UiKitProvider, useKitLocale } from "../i18n/kit-labels.js";
6
+ import { useNoIndex } from "../hooks/use-noindex.js";
7
+ import { cn } from "../lib/cn.js";
8
+ import { Checkbox } from "./checkbox.js";
9
+ import {
10
+ LEGAL_HREFS,
11
+ baseLanguage,
12
+ LegalFooter,
13
+ LegalLayout,
14
+ LegalPageContext,
15
+ LegalSection,
16
+ LegalSlotContext,
17
+ LegalText,
18
+ legalOperatorText,
19
+ useLegalLabels,
20
+ warnLegalOnce
21
+ } from "./legal.js";
22
+ import { TextLink } from "./text-link.js";
23
+ import { Button } from "./ui.js";
24
+ const LEGAL_SKELETON = Object.freeze({
25
+ impressum: Object.freeze({
26
+ numbered: false,
27
+ sections: Object.freeze([
28
+ { key: "operator", owner: "kit" },
29
+ { key: "contact", owner: "kit" },
30
+ { key: "disclaimer", owner: "kit" },
31
+ { key: "*", owner: "app" }
32
+ ])
33
+ }),
34
+ privacy: Object.freeze({
35
+ numbered: true,
36
+ sections: Object.freeze([
37
+ { key: "controller", owner: "kit" },
38
+ { key: "data", owner: "app" },
39
+ { key: "legal_basis", owner: "kit+app" },
40
+ { key: "third_parties", owner: "app" },
41
+ { key: "*", owner: "app" },
42
+ { key: "browser", owner: "kit+app" },
43
+ { key: "transfers", owner: "app" },
44
+ { key: "retention", owner: "app" },
45
+ { key: "rights", owner: "kit+app" },
46
+ { key: "contact", owner: "kit" }
47
+ ])
48
+ }),
49
+ terms: Object.freeze({
50
+ numbered: true,
51
+ sections: Object.freeze([
52
+ { key: "scope", owner: "app" },
53
+ { key: "no_advice", owner: "app" },
54
+ { key: "*", owner: "app" },
55
+ { key: "warranty", owner: "kit" },
56
+ { key: "liability", owner: "kit" },
57
+ { key: "changes", owner: "kit" },
58
+ // 0.28.1: which language's version prevails (the operator's `bindingLanguage`).
59
+ { key: "language", owner: "kit" },
60
+ { key: "law", owner: "kit" }
61
+ ])
62
+ })
63
+ });
64
+ function kitSectionsOf(page) {
65
+ return LEGAL_SKELETON[page].sections.filter((s) => s.owner !== "app").map((s) => s.key);
66
+ }
67
+ const PAGES = ["impressum", "privacy", "terms"];
68
+ function appPart(children) {
69
+ if (children === void 0 || children === null || children === false) return null;
70
+ if (typeof children === "string") return /* @__PURE__ */ jsx(LegalText, { text: children }, "app");
71
+ return /* @__PURE__ */ jsx(Fragment2, { children }, "app");
72
+ }
73
+ function LegalKitSection(props) {
74
+ const { section, headingAs, labels: labelsProp } = props;
75
+ const context = useContext(LegalPageContext);
76
+ const labels = useLegalLabels(labelsProp);
77
+ const kitLocale = useKitLocale();
78
+ const page = props.page ?? context?.page ?? onlyPageOf(section);
79
+ const kitSections = kitSectionsOf(page);
80
+ if (!kitSections.includes(section)) {
81
+ throw new Error(
82
+ `LegalKitSection: "${section}" is not one of the kit's sections of the ${page} page (${kitSections.join(", ")}).`
83
+ );
84
+ }
85
+ const entry = labels.sections[page][section];
86
+ const operator = props.operator ? legalOperatorText(props.operator, kitLocale) : context?.operator;
87
+ const fill = (body) => {
88
+ if (typeof body === "string") return body;
89
+ if (!operator) {
90
+ throw new Error(
91
+ `LegalKitSection "${section}" names the operator: render it inside <LegalPage operator={\u2026}>, or pass operator.`
92
+ );
93
+ }
94
+ if (section === "language" && !operator.bindingLanguage) {
95
+ throw new Error(
96
+ `LegalKitSection "language" names the binding language: give the operator a bindingLanguage ("de-CH").`
97
+ );
98
+ }
99
+ return body(operator);
100
+ };
101
+ const app = appPart(props.children);
102
+ let parts;
103
+ if ("lead" in entry) {
104
+ const lead = /* @__PURE__ */ jsx(LegalText, { text: entry.lead }, "lead");
105
+ const tail = /* @__PURE__ */ jsx(LegalText, { text: entry.tail }, "tail");
106
+ if (props.section === "browser") {
107
+ const list = props.entries.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "list-disc space-y-1 ps-5", children: props.entries.map((item, i) => /* @__PURE__ */ jsx("li", { children: item }, i)) }, "entries") : null;
108
+ parts = [lead, list, tail, app];
109
+ } else {
110
+ parts = [lead, app, tail];
111
+ }
112
+ } else {
113
+ parts = [/* @__PURE__ */ jsx(LegalText, { text: fill(entry.body) }, "body"), app];
114
+ }
115
+ return /* @__PURE__ */ jsx(LegalSection, { id: section, heading: entry.title, headingAs, children: /* @__PURE__ */ jsx("div", { className: "space-y-[1lh]", children: parts }) });
116
+ }
117
+ function onlyPageOf(section) {
118
+ const pages = PAGES.filter((p) => kitSectionsOf(p).includes(section));
119
+ if (pages.length === 1) return pages[0];
120
+ throw new Error(
121
+ pages.length === 0 ? `LegalKitSection: "${section}" is not one of the kit's sections.` : `LegalKitSection: "${section}" is on more than one page (${pages.join(", ")}) \u2014 render it inside a LegalPage, or pass page.`
122
+ );
123
+ }
124
+ function flatten(node, path, out) {
125
+ if (node === null || node === void 0 || typeof node === "boolean") return;
126
+ if (isValidElement(node)) {
127
+ if (node.type === Fragment2) {
128
+ flatten(node.props.children, path, out);
129
+ } else {
130
+ out.push({ node, path: path || "/" });
131
+ }
132
+ return;
133
+ }
134
+ if (typeof node === "object" && Symbol.iterator in node) {
135
+ Array.from(node).forEach((child, i) => {
136
+ const step = isValidElement(child) && child.key !== null ? `$${child.key}` : `#${i}`;
137
+ flatten(child, `${path}/${step}`, out);
138
+ });
139
+ return;
140
+ }
141
+ out.push({ node, path: path || "/" });
142
+ }
143
+ function sectionOf(node, page, labels) {
144
+ if (!isValidElement(node)) return null;
145
+ if (node.type === LegalKitSection) {
146
+ const { section } = node.props;
147
+ const entry = labels.sections[page][section];
148
+ return { key: section, heading: entry?.title ?? section };
149
+ }
150
+ if (node.type === LegalSection) {
151
+ const props = node.props;
152
+ return { key: props.id ?? node.key ?? void 0, heading: props.heading };
153
+ }
154
+ return null;
155
+ }
156
+ function slotSections(children, page, labels) {
157
+ const flat = [];
158
+ flatten(children, "", flat);
159
+ const numbered = LEGAL_SKELETON[page].numbered;
160
+ const targets = /* @__PURE__ */ new Map();
161
+ let count = 0;
162
+ const nodes = flat.map(({ node, path }) => {
163
+ const section = sectionOf(node, page, labels);
164
+ if (!section) return /* @__PURE__ */ jsx(Fragment2, { children: node }, path);
165
+ count += 1;
166
+ const number = numbered ? count : void 0;
167
+ if (section.key !== void 0) {
168
+ if (targets.has(section.key)) {
169
+ warnLegalOnce(`two sections of the ${page} page share the key "${section.key}"; {ref:${section.key}} names the first.`);
170
+ } else {
171
+ targets.set(section.key, { number, heading: section.heading });
172
+ }
173
+ }
174
+ return /* @__PURE__ */ jsx(LegalSlotContext.Provider, { value: { id: section.key, number }, children: node }, path);
175
+ });
176
+ return { nodes, targets };
177
+ }
178
+ function LegalPage({
179
+ page,
180
+ operator,
181
+ children,
182
+ header,
183
+ footer,
184
+ homeHref = "/",
185
+ notice,
186
+ onShowBindingLanguage,
187
+ locale: localeProp,
188
+ headingAs = "h1",
189
+ landmark = true,
190
+ noIndex = true,
191
+ className,
192
+ labels: labelsProp
193
+ }) {
194
+ useNoIndex(noIndex);
195
+ const labels = useLegalLabels(labelsProp);
196
+ const locale = useKitLocale(localeProp) ?? "en";
197
+ const operatorText = legalOperatorText(operator, locale);
198
+ const overrides = useMemo(
199
+ () => labelsProp ? { legal: labelsProp } : void 0,
200
+ [labelsProp]
201
+ );
202
+ const { nodes, targets } = slotSections(children, page, labels);
203
+ const context = {
204
+ page,
205
+ operator: operatorText,
206
+ sectionHeading: headingAs === "h1" ? "h2" : "h3",
207
+ targets
208
+ };
209
+ const Main = landmark ? "main" : "div";
210
+ const shownNotice = notice !== void 0 ? notice : page === "privacy" ? labels.notice.privacy : labels.notice.beta;
211
+ const translated = operator.bindingLanguage !== void 0 && baseLanguage(operator.bindingLanguage) !== baseLanguage(locale);
212
+ const translationNote = translated ? /* @__PURE__ */ jsxs("p", { className: "text-sm text-[var(--text-secondary)]", children: [
213
+ labels.translation.note(operatorText),
214
+ onShowBindingLanguage && /* @__PURE__ */ jsxs(Fragment, { children: [
215
+ " ",
216
+ /* @__PURE__ */ jsx(Button, { type: "button", variant: "link", size: "sm", className: "h-auto p-0 align-baseline", onClick: onShowBindingLanguage, children: labels.translation.show(operatorText) })
217
+ ] })
218
+ ] }) : void 0;
219
+ return /* @__PURE__ */ jsx(UiKitProvider, { labels: overrides, children: /* @__PURE__ */ jsxs("div", { className: cn("flex min-h-full flex-col", className), children: [
220
+ header,
221
+ /* @__PURE__ */ jsx(Main, { className: "flex-1", children: /* @__PURE__ */ jsx(LegalPageContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
222
+ LegalLayout,
223
+ {
224
+ back: /* @__PURE__ */ jsx(TextLink, { href: homeHref, icon: ArrowLeft, children: labels.backHome }),
225
+ title: labels.titles[page],
226
+ notice: shownNotice,
227
+ translationNote,
228
+ headingAs,
229
+ children: nodes
230
+ }
231
+ ) }) }),
232
+ footer === void 0 ? /* @__PURE__ */ jsx(LegalFooter, { currentHref: LEGAL_HREFS[page] }) : footer
233
+ ] }) });
234
+ }
235
+ function acceptLabel(labels, termsHref, privacyHref) {
236
+ const template = labels.accept;
237
+ for (const placeholder of ["{terms}", "{privacy}"]) {
238
+ if (!template.includes(placeholder)) warnLegalOnce(`legal.accept has no ${placeholder}: "${template}".`);
239
+ }
240
+ return template.split(/(\{terms\}|\{privacy\})/).filter((part) => part !== "").map(
241
+ (part, i) => part === "{terms}" ? /* @__PURE__ */ jsx(TextLink, { href: termsHref, tone: "primary", children: labels.titles.terms }, i) : part === "{privacy}" ? /* @__PURE__ */ jsx(TextLink, { href: privacyHref, tone: "primary", children: labels.titles.privacy }, i) : part
242
+ );
243
+ }
244
+ function LegalAcceptCheckbox({
245
+ checked,
246
+ onCheckedChange,
247
+ termsHref = LEGAL_HREFS.terms,
248
+ privacyHref = LEGAL_HREFS.privacy,
249
+ labels: labelsProp,
250
+ ref,
251
+ ...rest
252
+ }) {
253
+ const labels = useLegalLabels(labelsProp);
254
+ return /* @__PURE__ */ jsx(
255
+ Checkbox,
256
+ {
257
+ ...rest,
258
+ ref,
259
+ checked,
260
+ onCheckedChange,
261
+ required: true,
262
+ label: acceptLabel(labels, termsHref, privacyHref)
263
+ }
264
+ );
265
+ }
266
+ export {
267
+ LEGAL_SKELETON,
268
+ LegalAcceptCheckbox,
269
+ LegalKitSection,
270
+ LegalPage
271
+ };
272
+ //# sourceMappingURL=legal-page.js.map
@@ -0,0 +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 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 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 \"./ui\";\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 /** 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 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: Exclude<LegalKitSectionKey, \"browser\" | \"legal_basis\" | \"rights\">;\n entries?: never;\n children?: never;\n }\n );\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 parts = [<LegalText key=\"body\" text={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-[var(--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":";AA+L2C,SA0SnC,UA1SmC,KA0SnC,YA1SmC;AA/L3C,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,OACK;AAaP,SAAS,gBAAgB;AACzB,SAAS,cAAc;AAyChB,MAAM,iBAAoE,OAAO,OAAO;AAAA,EAC7F,WAAW,OAAO,OAAO;AAAA,IACvB,UAAU;AAAA,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;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,87 +1,70 @@
1
- import * as react from 'react';
2
- import { ReactNode } from 'react';
3
-
4
- /**
5
- * The legal pages' shell — Imprint, Privacy Policy, Terms — for every app (Marcel,
6
- * 2026-10-02: every app has them; docs/i18n-harmonization.md H10).
7
- *
8
- * keksdose and kastlan each carried the same shell, written twice: a back link, the
9
- * title, a "closed beta, not yet reviewed by a lawyer" notice, sections of heading +
10
- * running text, and kastlan's row of links to the three pages with the current one
11
- * marked. Kurvenschmiede had none. The words stay in each app — they are the app's
12
- * legal statements, reviewed under the `legal` area of the translation review — and
13
- * only the shape moves here.
14
- *
15
- * A CONTENT COLUMN, not a page: keksdose shows its legal pages inside its public
16
- * landing header and footer, kastlan inside `AuthLayout` (`width="wide" card={false}`,
17
- * no title of its own). Both put this inside their chrome; a page-owning layout would
18
- * have fought one of them.
19
- */
20
- interface LegalLabels {
21
- /** The accessible name of {@link LegalLinks}' `<nav>`. */
22
- navLabel: string;
23
- }
24
- declare const DEFAULT_LEGAL_LABELS: LegalLabels;
25
- interface LegalLink {
26
- href: string;
27
- /** "Imprint", "Privacy Policy", "Terms" — the app's words. */
28
- label: ReactNode;
29
- }
30
- interface LegalLinksProps {
31
- links: readonly LegalLink[];
32
- /** The page being shown; its link is marked `aria-current="page"`. Usually the
33
- * router's pathname. */
34
- currentHref?: string;
35
- /** `false` renders the links without the `<nav>` landmark — inside `AuthLayout`'s
36
- * `footer` or `TopBarActionMenu`'s `footer`, which are named `<nav>`s already. The row
37
- * keeps its spacing and `className` either way (0.27.1: it used to return the bare
38
- * links, so in a plain container — Kurvenschmiede's account-menu `<li>` — they ran
39
- * together as "ImpressumDatenschutzerklärungNutz…" and overflowed). Default true. */
40
- nav?: boolean;
41
- labels?: Partial<LegalLabels>;
42
- className?: string;
43
- }
44
- /** The legal pages as a row of quiet links, the one you are on marked (kastlan's
45
- * `LegalLinks`). Wraps on a phone. */
46
- declare function LegalLinks({ links, currentHref, nav, labels: labelsProp, className }: LegalLinksProps): react.JSX.Element;
47
- interface LegalSectionProps {
48
- heading: ReactNode;
49
- /** Running text. Line breaks in it are kept (`white-space: pre-line`), so a
50
- * translation can hold an address or a list as plain lines. */
51
- body?: string;
52
- /** Anything richer than plain text — links, a list — after `body`. */
53
- children?: ReactNode;
54
- /** The section's `id`, for a link to it from elsewhere ("see §4"). */
55
- id?: string;
56
- /** The heading's element. Default `h2`, under the layout's `h1`. */
57
- headingAs?: "h2" | "h3";
58
- }
59
- declare function LegalSection({ heading, body, children, id, headingAs: Heading }: LegalSectionProps): react.JSX.Element;
60
- interface LegalLayoutProps {
61
- /** "Imprint", "Privacy Policy", "Terms". */
62
- title: ReactNode;
63
- /** Above the title — the app's "← Back" link (`<TextLink icon={ArrowLeft}>`), whose
64
- * target differs per app (keksdose's start page, kastlan's sign-in). */
65
- back?: ReactNode;
66
- /**
67
- * A notice under the title, as a warning banner with `role="note"` — page furniture,
68
- * not an alert. Both apps say their legal texts await a lawyer's review; keksdose's
69
- * privacy page says something more precise than the others (its technical sections
70
- * describe running code), so the notice is per page, not per layout.
71
- */
72
- notice?: ReactNode;
73
- /** The sections — {@link LegalSection}s. */
74
- children: ReactNode;
75
- /** The three pages, linked at the end of the column with the current one marked.
76
- * Leave out when the page's chrome already shows them (kastlan's AuthLayout footer). */
77
- links?: readonly LegalLink[];
78
- currentHref?: string;
79
- /** Default `h1`: the page's heading. */
80
- headingAs?: "h1" | "h2";
81
- /** Extra classes on the column — `px-0 py-0` inside a chrome that pads already. */
82
- className?: string;
83
- labels?: Partial<LegalLabels>;
84
- }
85
- declare function LegalLayout({ title, back, notice, children, links, currentHref, headingAs: Heading, className, labels, }: LegalLayoutProps): react.JSX.Element;
86
-
87
- export { DEFAULT_LEGAL_LABELS, type LegalLabels, LegalLayout, type LegalLayoutProps, type LegalLink, LegalLinks, type LegalLinksProps, LegalSection, type LegalSectionProps };
1
+ import 'react';
2
+ export { cm as DEFAULT_LEGAL_LABELS, dm as LEGAL_HREFS, dr as LegalFooter, ds as LegalFooterProps, dt as LegalFramedSectionLabels, du as LegalLabels, dv as LegalLayout, dw as LegalLayoutProps, dx as LegalLink, dy as LegalLinks, dz as LegalLinksProps, dA as LegalOperator, dB as LegalOperatorSectionLabels, dC as LegalOperatorText, eJ as LegalPageContext, eK as LegalPageContextValue, dD as LegalPageKey, eL as LegalRefTarget, dE as LegalSection, dF as LegalSectionProps, eM as LegalSectionSlot, eN as LegalSlotContext, eO as LegalText, dG as LegalTextSectionLabels, eP as baseLanguage, en as legalOperatorText, eQ as resolveLegalRefs, eC as useLegalLabels, eR as warnLegalOnce } from '../kit-labels-Du0uHBq4.js';
3
+ import '../data-table-labels-DUELeXpa.js';
4
+ import './data-table-sort.js';
5
+ import './swipeable-row.js';
6
+ import './mini-calendar.js';
7
+ import './calendar-heatmap.js';
8
+ import './popover.js';
9
+ import './chip.js';
10
+ import 'lucide-react';
11
+ import './field-sync.js';
12
+ import './tooltip.js';
13
+ import '../hooks/use-anchored-rect.js';
14
+ import '../lib/clipping.js';
15
+ import '../wizard/types.js';
16
+ import '../tour/tour.js';
17
+ import '../search/command-palette.js';
18
+ import '../search/global-search.js';
19
+ import '../search/search-index.js';
20
+ import './month-picker.js';
21
+ import './page-contents.js';
22
+ import './series-chart-labels.js';
23
+ import './pie-chart-labels.js';
24
+ import './sparkline.js';
25
+ import './stat-tile.js';
26
+ import './signature-pad.js';
27
+ import './password-strength.js';
28
+ import './swatch-picker.js';
29
+ import './tile-radio.js';
30
+ import './icon-picker.js';
31
+ import './dialog-frame.js';
32
+ import './modal.js';
33
+ import '../hooks/use-search-param-state.js';
34
+ import './measured-grid.js';
35
+ import './user-avatar.js';
36
+ import './status-dot.js';
37
+ import './progress-bar.js';
38
+ import './signed-amount.js';
39
+ import '../shell/topbar-action-menu.js';
40
+ import './menu-item.js';
41
+ import './floating-panel.js';
42
+ import '../hooks/use-authed-src.js';
43
+ import './account-settings-labels.js';
44
+ import './bulk-action-bar.js';
45
+ import './list.js';
46
+ import './breadcrumbs.js';
47
+ import './toast.js';
48
+ import './description-list.js';
49
+ import './line-items.js';
50
+ import './error-boundary.js';
51
+ import './authed-image.js';
52
+ import './image-grid.js';
53
+ import './lightbox.js';
54
+ import './write-lock.js';
55
+ import './account-chips.js';
56
+ import '../lib/format.js';
57
+ import './reauth-dialog.js';
58
+ import './server-wake.js';
59
+ import '../lib/server-wake.js';
60
+ import './translation-review-labels.js';
61
+ import '../lib/translation-review.js';
62
+ import './country-select.js';
63
+ import './inline-edit-field.js';
64
+ import '../lib/iban.js';
65
+ import '../lib/phone.js';
66
+ import './sign-chip.js';
67
+ import './column-mapper.js';
68
+ import '../lib/column-mapping.js';
69
+ import '../lib/table-text.js';
70
+ import './field-parts.js';