@eifi1/ui-kit 0.36.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,9 +50,9 @@ export interface DeviceResetSettingProps extends Omit<SettingsSectionProps, "anc
50
50
  * - **Live, no reload** (decision 10): each registered store resets through its own
51
51
  * setter; the card stays where it is.
52
52
  *
53
- * The app adds the catalogue entry, `{ id: "device_reset", group: "appearance", anchor:
54
- * DEVICE_RESET_ANCHOR, title, keywords }` (`title` and `keywords` from these labels), last
55
- * in its appearance group: inside a `SettingsLayout`, `SettingsSection` throws in
56
- * development without it.
53
+ * The app adds the catalogue entry, `{ id, group: "appearance", anchor: DEVICE_RESET_ANCHOR,
54
+ * title, keywords }` (the id in its catalogue's own style, e.g. `device_reset` or
55
+ * `deviceReset`; `title` and `keywords` from these labels), last in its appearance group:
56
+ * inside a `SettingsLayout`, `SettingsSection` throws in development without it.
57
57
  */
58
58
  export declare function DeviceResetSetting({ description, labels: labelsProp, onReset, ...rest }: DeviceResetSettingProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/settings/device-reset-setting.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { useKitLabels, type LabelOverride } from \"../i18n/kit-labels\";\nimport { resetDeviceSettings } from \"../lib/device-settings\";\nimport { Button } from \"../components/button\";\nimport { useConfirm } from \"../components/confirm-dialog\";\nimport { toast } from \"../components/toast\";\nimport { SettingsSection, type SettingsSectionProps } from \"./settings-section\";\nimport { DEFAULT_DEVICE_RESET_LABELS } from \"./device-reset-setting-labels\";\n\n/* ── Labels ──────────────────────────────────────────────────────────────── */\n\n/** Every string {@link DeviceResetSetting} renders — the `deviceReset` namespace of\n * `<UiKitProvider labels>`, overridable per instance through `labels`\n * (docs/settings-harmonization.md §11.3). The confirm's Cancel is `confirmDialog.cancel`. */\nexport interface DeviceResetLabels {\n /** The card's title, and the app's catalogue entry's. */\n title: string;\n /** The line under it: what goes back, and that the account is not touched. */\n description: string;\n /** The button that asks first. */\n action: string;\n /** The question it asks. */\n confirmTitle: string;\n /** What goes, what follows the account again, and what stays. */\n confirmBody: string;\n /** The button that answers it. */\n confirmAction: string;\n /** The toast once it is done. */\n done: string;\n /** For the app's catalogue entry (`keywords`); the card never reads it. */\n keywords: string;\n}\n\n// Defined in ./device-reset-setting-labels, which holds no component code.\nexport { DEFAULT_DEVICE_RESET_LABELS };\n\n/* ── The card ────────────────────────────────────────────────────────────── */\n\n/** The card's DOM id: its catalogue entry's `anchor`, the `?focus=` target. */\nexport const DEVICE_RESET_ANCHOR = \"settings-device-reset\";\n\n// `onReset` is the card's own: the DOM's form-reset handler never fires on a div.\nexport interface DeviceResetSettingProps\n extends Omit<SettingsSectionProps, \"anchor\" | \"title\" | \"description\" | \"children\" | \"onReset\"> {\n /** The app's sentence after the kit's description: what of its own goes back, and what\n * stays (keksdose: the date format, the feature set and the gestures go; presentation\n * mode and the home position stay). */\n description?: ReactNode;\n labels?: LabelOverride<DeviceResetLabels>;\n /** Runs after the reset and before the toast, with the keys reset or removed. */\n onReset?: (keys: string[]) => void;\n}\n\n/**\n * \"Reset this device's settings\" (docs/settings-harmonization.md §11): the LAST card of\n * the appearance group. It puts this device's appearance — theme, palette, language, text\n * size, contrast and the app's own appearance choices — and its views — table views, the\n * sidebar, folded groups, saved filters — back to what a new device gets, through\n * {@link resetDeviceSettings}. The account, the sign-in, the session and anything waiting\n * to be sent are never touched: they never join the registry.\n *\n * - **A confirm, not an undo** (§11.2 decision 9): `useConfirm` in the neutral tone,\n * then a toast. An app mounts a `ConfirmProvider` and a `Toaster` already.\n * - **Not a commit**: nothing is written to the account, so a demo or a lapsed plan's\n * write lock does not disable it (decision 3).\n * - **Live, no reload** (decision 10): each registered store resets through its own\n * setter; the card stays where it is.\n *\n * The app adds the catalogue entry, `{ id: \"device_reset\", group: \"appearance\", anchor:\n * DEVICE_RESET_ANCHOR, title, keywords }` (`title` and `keywords` from these labels), last\n * in its appearance group: inside a `SettingsLayout`, `SettingsSection` throws in\n * development without it.\n */\nexport function DeviceResetSetting({\n description,\n labels: labelsProp,\n onReset,\n ...rest\n}: DeviceResetSettingProps) {\n const labels = useKitLabels(\"deviceReset\", DEFAULT_DEVICE_RESET_LABELS, labelsProp);\n const confirm = useConfirm();\n\n const reset = async () => {\n const ok = await confirm({\n title: labels.confirmTitle,\n body: labels.confirmBody,\n confirmLabel: labels.confirmAction,\n tone: \"neutral\",\n });\n if (!ok) return;\n const keys = resetDeviceSettings();\n onReset?.(keys);\n toast.success(labels.done);\n };\n\n return (\n <SettingsSection\n {...rest}\n anchor={DEVICE_RESET_ANCHOR}\n title={labels.title}\n description={\n description != null ? (\n <>\n {labels.description} {description}\n </>\n ) : (\n labels.description\n )\n }\n >\n <div>\n <Button variant=\"secondary\" onClick={() => void reset()}>\n {labels.action}\n </Button>\n </div>\n </SettingsSection>\n );\n}\n"],"mappings":";AAuGU,mBASF,KATE;AArGV,SAAS,oBAAwC;AACjD,SAAS,2BAA2B;AACpC,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,aAAa;AACtB,SAAS,uBAAkD;AAC3D,SAAS,mCAAmC;AAgCrC,MAAM,sBAAsB;AAkC5B,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GAA4B;AAC1B,QAAM,SAAS,aAAa,eAAe,6BAA6B,UAAU;AAClF,QAAM,UAAU,WAAW;AAE3B,QAAM,QAAQ,YAAY;AACxB,UAAM,KAAK,MAAM,QAAQ;AAAA,MACvB,OAAO,OAAO;AAAA,MACd,MAAM,OAAO;AAAA,MACb,cAAc,OAAO;AAAA,MACrB,MAAM;AAAA,IACR,CAAC;AACD,QAAI,CAAC,GAAI;AACT,UAAM,OAAO,oBAAoB;AACjC,cAAU,IAAI;AACd,UAAM,QAAQ,OAAO,IAAI;AAAA,EAC3B;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,QAAQ;AAAA,MACR,OAAO,OAAO;AAAA,MACd,aACE,eAAe,OACb,iCACG;AAAA,eAAO;AAAA,QAAY;AAAA,QAAE;AAAA,SACxB,IAEA,OAAO;AAAA,MAIX,8BAAC,SACC,8BAAC,UAAO,SAAQ,aAAY,SAAS,MAAM,KAAK,MAAM,GACnD,iBAAO,QACV,GACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/settings/device-reset-setting.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { useKitLabels, type LabelOverride } from \"../i18n/kit-labels\";\nimport { resetDeviceSettings } from \"../lib/device-settings\";\nimport { Button } from \"../components/button\";\nimport { useConfirm } from \"../components/confirm-dialog\";\nimport { toast } from \"../components/toast\";\nimport { SettingsSection, type SettingsSectionProps } from \"./settings-section\";\nimport { DEFAULT_DEVICE_RESET_LABELS } from \"./device-reset-setting-labels\";\n\n/* ── Labels ──────────────────────────────────────────────────────────────── */\n\n/** Every string {@link DeviceResetSetting} renders — the `deviceReset` namespace of\n * `<UiKitProvider labels>`, overridable per instance through `labels`\n * (docs/settings-harmonization.md §11.3). The confirm's Cancel is `confirmDialog.cancel`. */\nexport interface DeviceResetLabels {\n /** The card's title, and the app's catalogue entry's. */\n title: string;\n /** The line under it: what goes back, and that the account is not touched. */\n description: string;\n /** The button that asks first. */\n action: string;\n /** The question it asks. */\n confirmTitle: string;\n /** What goes, what follows the account again, and what stays. */\n confirmBody: string;\n /** The button that answers it. */\n confirmAction: string;\n /** The toast once it is done. */\n done: string;\n /** For the app's catalogue entry (`keywords`); the card never reads it. */\n keywords: string;\n}\n\n// Defined in ./device-reset-setting-labels, which holds no component code.\nexport { DEFAULT_DEVICE_RESET_LABELS };\n\n/* ── The card ────────────────────────────────────────────────────────────── */\n\n/** The card's DOM id: its catalogue entry's `anchor`, the `?focus=` target. */\nexport const DEVICE_RESET_ANCHOR = \"settings-device-reset\";\n\n// `onReset` is the card's own: the DOM's form-reset handler never fires on a div.\nexport interface DeviceResetSettingProps\n extends Omit<SettingsSectionProps, \"anchor\" | \"title\" | \"description\" | \"children\" | \"onReset\"> {\n /** The app's sentence after the kit's description: what of its own goes back, and what\n * stays (keksdose: the date format, the feature set and the gestures go; presentation\n * mode and the home position stay). */\n description?: ReactNode;\n labels?: LabelOverride<DeviceResetLabels>;\n /** Runs after the reset and before the toast, with the keys reset or removed. */\n onReset?: (keys: string[]) => void;\n}\n\n/**\n * \"Reset this device's settings\" (docs/settings-harmonization.md §11): the LAST card of\n * the appearance group. It puts this device's appearance — theme, palette, language, text\n * size, contrast and the app's own appearance choices — and its views — table views, the\n * sidebar, folded groups, saved filters — back to what a new device gets, through\n * {@link resetDeviceSettings}. The account, the sign-in, the session and anything waiting\n * to be sent are never touched: they never join the registry.\n *\n * - **A confirm, not an undo** (§11.2 decision 9): `useConfirm` in the neutral tone,\n * then a toast. An app mounts a `ConfirmProvider` and a `Toaster` already.\n * - **Not a commit**: nothing is written to the account, so a demo or a lapsed plan's\n * write lock does not disable it (decision 3).\n * - **Live, no reload** (decision 10): each registered store resets through its own\n * setter; the card stays where it is.\n *\n * The app adds the catalogue entry, `{ id, group: \"appearance\", anchor: DEVICE_RESET_ANCHOR,\n * title, keywords }` (the id in its catalogue's own style, e.g. `device_reset` or\n * `deviceReset`; `title` and `keywords` from these labels), last in its appearance group:\n * inside a `SettingsLayout`, `SettingsSection` throws in development without it.\n */\nexport function DeviceResetSetting({\n description,\n labels: labelsProp,\n onReset,\n ...rest\n}: DeviceResetSettingProps) {\n const labels = useKitLabels(\"deviceReset\", DEFAULT_DEVICE_RESET_LABELS, labelsProp);\n const confirm = useConfirm();\n\n const reset = async () => {\n const ok = await confirm({\n title: labels.confirmTitle,\n body: labels.confirmBody,\n confirmLabel: labels.confirmAction,\n tone: \"neutral\",\n });\n if (!ok) return;\n const keys = resetDeviceSettings();\n onReset?.(keys);\n toast.success(labels.done);\n };\n\n return (\n <SettingsSection\n {...rest}\n anchor={DEVICE_RESET_ANCHOR}\n title={labels.title}\n description={\n description != null ? (\n <>\n {labels.description} {description}\n </>\n ) : (\n labels.description\n )\n }\n >\n <div>\n <Button variant=\"secondary\" onClick={() => void reset()}>\n {labels.action}\n </Button>\n </div>\n </SettingsSection>\n );\n}\n"],"mappings":";AAuGU,mBASF,KATE;AArGV,SAAS,oBAAwC;AACjD,SAAS,2BAA2B;AACpC,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,aAAa;AACtB,SAAS,uBAAkD;AAC3D,SAAS,mCAAmC;AAgCrC,MAAM,sBAAsB;AAkC5B,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GAA4B;AAC1B,QAAM,SAAS,aAAa,eAAe,6BAA6B,UAAU;AAClF,QAAM,UAAU,WAAW;AAE3B,QAAM,QAAQ,YAAY;AACxB,UAAM,KAAK,MAAM,QAAQ;AAAA,MACvB,OAAO,OAAO;AAAA,MACd,MAAM,OAAO;AAAA,MACb,cAAc,OAAO;AAAA,MACrB,MAAM;AAAA,IACR,CAAC;AACD,QAAI,CAAC,GAAI;AACT,UAAM,OAAO,oBAAoB;AACjC,cAAU,IAAI;AACd,UAAM,QAAQ,OAAO,IAAI;AAAA,EAC3B;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,QAAQ;AAAA,MACR,OAAO,OAAO;AAAA,MACd,aACE,eAAe,OACb,iCACG;AAAA,eAAO;AAAA,QAAY;AAAA,QAAE;AAAA,SACxB,IAEA,OAAO;AAAA,MAIX,8BAAC,SACC,8BAAC,UAAO,SAAQ,aAAY,SAAS,MAAM,KAAK,MAAM,GACnD,iBAAO,QACV,GACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eifi1/ui-kit",
3
- "version": "0.36.0",
3
+ "version": "0.37.0",
4
4
  "type": "module",
5
5
  "description": "App-agnostic shared design system: domain-free React components, theme and tokens.",
6
6
  "_sideEffects": "The barrel (src/index.ts) re-exports EVERY component, including components/chart, which statically imports recharts. Without this field a bundler must assume each of those modules has side effects, so it cannot drop the unused ones: importing a Button from '@eifi1/ui-kit' dragged all 433KB of recharts into the consumer's ENTRY chunk, and Keksdose was preloading it on every page load, login included. Nothing in src/ imports for side effects (no bare imports, no CSS imports from JS, no module-level global writes) — the token stylesheet is its own './tokens.css' export — so this is safe. CSS is still listed so any future stylesheet survives. Re-checked when `flag-icons` left `dependencies` and tsup started emitting a `\"use client\"` banner: neither touches this. The flag stylesheet was never imported from JS in the first place (that was the finding), and a directive prologue is a string literal every bundler lifts out before it decides whether a module is inert.",
@@ -232,7 +232,7 @@ export function useInlineHint(hint: ReactNode, withHelp = false): ReactNode {
232
232
  *
233
233
  * - `hint` is the fact, the caption under the field, on its `aria-describedby`;
234
234
  * - `help` is the help, a {@link HelpPopover} "?" on the label line (an unlabelled
235
- * field's at its end edge, as a hint's), named "About <label>" (`common.aboutField`,
235
+ * field's at its end edge, as a hint's), named "About “<label>”" (`common.aboutField`,
236
236
  * from the label's text, else the `aria-label`, else `common.help`). Pass a
237
237
  * `HelpPopover` as `help` to name it yourself ("What do the statuses mean?").
238
238
  *
@@ -245,7 +245,7 @@ export interface FieldHelpProps {
245
245
  /**
246
246
  * Help the field is usable without — why it exists, how to choose, what the options
247
247
  * mean — behind the field's one "?" on its label line: a {@link HelpPopover} named
248
- * "About <label>" that opens on a tap (round 0.36, docs/text-size-harmonization.md §4).
248
+ * "About “<label>”" that opens on a tap (round 0.36, docs/text-size-harmonization.md §4).
249
249
  * Pass a `HelpPopover` to name it yourself. `hint` stays the visible fact: with `help`
250
250
  * set it is the caption under the field at every size, a `FieldHint` included.
251
251
  */
@@ -253,7 +253,7 @@ export interface FieldHelpProps {
253
253
  }
254
254
 
255
255
  /**
256
- * The "?" for a field's `help` — the field's own name, "About <label>", in the reader's
256
+ * The "?" for a field's `help` — the field's own name, "About “<label>”", in the reader's
257
257
  * language. A component so that a field without `help` asks the labels nothing.
258
258
  */
259
259
  function FieldHelp({ name, children }: { name: ReactNode; children: ReactNode }) {
@@ -265,7 +265,7 @@ function FieldHelp({ name, children }: { name: ReactNode; children: ReactNode })
265
265
  /**
266
266
  * A field's `help` as the "?" for its label line, or `undefined` when there is none. A
267
267
  * {@link HelpPopover} is used as it is (it carries its own name); anything else is put
268
- * in one named "About <name>" — `name` is the field's label, else its `aria-label`.
268
+ * in one named "About “<name>”" — `name` is the field's label, else its `aria-label`.
269
269
  */
270
270
  export function fieldHelpMark(help: ReactNode, name: ReactNode): ReactNode | undefined {
271
271
  if (!hasContent(help)) return undefined;
@@ -45,7 +45,7 @@ const HELP_WIDTH: RemLength = "20rem";
45
45
  * **On a field: its `help`** (0.36, round 0.36 decision 1). Every kit field that takes a
46
46
  * `hint` takes a `help` beside it, and the `@eifi1/ui-kit/rhf` bindings too: pass the
47
47
  * help's words and the field draws this "?" on its label line (an unlabelled one at its
48
- * end edge, outside the box), named "About <label>" — or pass a HelpPopover to name it
48
+ * end edge, outside the box), named "About “<label>”" — or pass a HelpPopover to name it
49
49
  * yourself. `hint` stays the FACT, printed under the field; while `help` is set a
50
50
  * FieldHint there draws no "?" of its own, so the field has one. Passed as `hint`, as in
51
51
  * 0.34, it still rides the label line. It also stands on its own, beside a heading or a
@@ -30,7 +30,7 @@ import type { CommitScope } from "./write-lock";
30
30
 
31
31
  /** The props both fields take and this engine reads. */
32
32
  export interface NumericFieldProps extends FieldHelpProps {
33
- /** What names the `help` "?" — "About <label>" — with the `aria-label`. */
33
+ /** What names the `help` "?" — "About “<label>”" — with the `aria-label`. */
34
34
  label?: ReactNode;
35
35
  hint?: ReactNode;
36
36
  error?: ReactNode;
@@ -5,7 +5,9 @@
5
5
  // The table itself is role-utilities.generated.ts, re-rendered from tokens.css's
6
6
  // `@theme inline` block by scripts/gen-role-utilities.mjs with the parser below; the
7
7
  // check fails while it is stale. So tokens.css stays the source: a role that gains a
8
- // utility there is flagged in the kit and in the apps from the next release on.
8
+ // utility there is flagged in the kit and in the apps from the next release on. The
9
+ // README's role-utility table (scripts/gen-styling-inventory.mjs) reads the block with
10
+ // the same parser since 0.37, so the README, the check and the plugin cannot disagree.
9
11
  //
10
12
  // This module imports NOTHING, and its TypeScript is erasable only (no enum, no
11
13
  // namespace, no parameter property): the check imports it from source under Node's type
@@ -43,20 +45,74 @@ export type RoleUtilityTable = {
43
45
  readonly [P in RoleProperty]: Readonly<Record<string, readonly string[]>>;
44
46
  };
45
47
 
48
+ /** One `--<namespace>-<name>: <value>;` of the `@theme inline` block. */
49
+ export interface ThemeInlineDeclaration {
50
+ /** The theme variable without its dashes: `text-color-muted`, `ring-width-focus`. */
51
+ variable: string;
52
+ /** The property whose namespace it is in; `null` for a namespace ROLE_NAMESPACES lacks. */
53
+ property: RoleProperty | null;
54
+ /** The name after the namespace, `muted`; `null` with `property`. */
55
+ name: string | null;
56
+ /** The utility it makes: `text-muted`, `ring-focus` (a width is `ring-*` like a colour). */
57
+ utility: string | null;
58
+ /** The token the value reads, `--text-muted`; `null` unless the value is a bare `var()`. */
59
+ token: string | null;
60
+ /** The value as written, trimmed. */
61
+ value: string;
62
+ }
63
+
64
+ /** The `@theme inline` block: where it stands, and every declaration in it in block order. */
65
+ export interface ThemeInlineBlock {
66
+ /** Its first and one-past-last offset in `stripCssComments(css)`, not in `css`. */
67
+ start: number;
68
+ end: number;
69
+ declarations: ThemeInlineDeclaration[];
70
+ }
71
+
72
+ /** `css` without its comments: a declaration commented out is not one. */
73
+ export function stripCssComments(css: string): string {
74
+ return css.replace(/\/\*[\s\S]*?\*\//g, "");
75
+ }
76
+
77
+ const PROPERTIES = Object.keys(ROLE_NAMESPACES) as RoleProperty[];
78
+
79
+ /**
80
+ * tokens.css's `@theme inline` block, read once for every reader: the table below, and
81
+ * the README's (scripts/gen-styling-inventory.mjs), which fails on a `property: null`
82
+ * where the table leaves it out. `null` when there is no such block — the role utilities
83
+ * are gone, or this parser is. Theme blocks hold only declarations, so the first `}`
84
+ * closes it; no namespace is another's prefix, so the first that fits is the one.
85
+ */
86
+ export function parseThemeInline(css: string): ThemeInlineBlock | null {
87
+ const block = /@theme\s+inline\s*\{([^}]*)\}/.exec(stripCssComments(css));
88
+ if (!block) return null;
89
+ const declarations = [...block[1].matchAll(/--([a-z0-9-]+)\s*:\s*([^;]+);/g)].map(([, variable, raw]) => {
90
+ const value = raw.trim();
91
+ const property = PROPERTIES.find((p) => variable.startsWith(`${ROLE_NAMESPACES[p]}-`)) ?? null;
92
+ const name = property && variable.slice(ROLE_NAMESPACES[property].length + 1);
93
+ return {
94
+ variable,
95
+ property,
96
+ name,
97
+ utility: property && `${property.replace(/-width$/, "")}-${name}`,
98
+ token: /^var\((--[a-z0-9-]+)\)$/.exec(value)?.[1] ?? null,
99
+ value,
100
+ };
101
+ });
102
+ return { start: block.index, end: block.index + block[0].length, declarations };
103
+ }
104
+
46
105
  /**
47
106
  * The table `tokens.css` declares: every `--<namespace>-<name>: var(--<token>)` in its
48
- * `@theme inline` block, in block order. `null` when there is no such block — the role
49
- * utilities are gone, or this parser is.
107
+ * `@theme inline` block, in block order, each property present (in ROLE_NAMESPACES' order)
108
+ * even when it has none. `null` when there is no such block.
50
109
  */
51
110
  export function roleUtilitiesFromCss(css: string): RoleUtilityTable | null {
52
- const theme = /@theme inline\s*\{([^}]*)\}/.exec(css.replace(/\/\*[\s\S]*?\*\//g, ""))?.[1];
53
- if (theme === undefined) return null;
54
- const table = {} as Record<RoleProperty, Record<string, string[]>>;
55
- for (const prop of Object.keys(ROLE_NAMESPACES) as RoleProperty[]) {
56
- const names: Record<string, string[]> = {};
57
- const declared = new RegExp(`--${ROLE_NAMESPACES[prop]}-([a-z0-9-]+)\\s*:\\s*var\\((--[a-z0-9-]+)\\)`, "g");
58
- for (const [, name, token] of theme.matchAll(declared)) (names[token] ??= []).push(name);
59
- table[prop] = names;
111
+ const block = parseThemeInline(css);
112
+ if (!block) return null;
113
+ const table = Object.fromEntries(PROPERTIES.map((p) => [p, {}])) as Record<RoleProperty, Record<string, string[]>>;
114
+ for (const { property, name, token } of block.declarations) {
115
+ if (property && name && token) (table[property][token] ??= []).push(name);
60
116
  }
61
117
  return table;
62
118
  }
@@ -170,9 +170,10 @@ export interface CommonLabels {
170
170
  /** Read after a link that opens a new tab (`<Button href external>`, TextLink):
171
171
  * nothing else tells a screen reader the page is about to change tabs. */
172
172
  opensInNewTab: string;
173
- /** The name of a field's `help` "?" and its panel (round 0.36): "About <field>", the
174
- * field's label as the argument — "About Jerk shape". A `HelpPopover` passed as
175
- * `help` keeps its own name. */
173
+ /** The name of a field's `help` "?" and its panel (round 0.36): "About “<field>”", the
174
+ * field's label as the argument, quoted so a capitalised label reads as a name — "About
175
+ * “Jerk shape”" (round 0.37; the other locales quoted it already). A `HelpPopover`
176
+ * passed as `help` keeps its own name. */
176
177
  aboutField: (field: string) => string;
177
178
  /** …and of a `help` "?" on a field with no label and no `aria-label` to name it by. */
178
179
  help: string;
@@ -37,7 +37,7 @@ export const DEFAULT_COMMON_LABELS: CommonLabels = {
37
37
  fieldValue: (field, value) => `${field}: ${value}`,
38
38
  dismiss: "Dismiss",
39
39
  opensInNewTab: "opens in a new tab",
40
- aboutField: (field) => `About ${field}`,
40
+ aboutField: (field) => `About “${field}”`,
41
41
  help: "Help",
42
42
  };
43
43
 
@@ -8,7 +8,7 @@ import type { ReactNode } from "react";
8
8
  * to find (an icon), so the caller falls back to a name of its own.
9
9
  *
10
10
  * Package-private — not re-exported from the barrel. StatTile names its sparkline by it;
11
- * a field names its `help` "?" by it ("About <label>", round 0.36).
11
+ * a field names its `help` "?" by it ("About “<label>”", round 0.36).
12
12
  */
13
13
  export function plainText(node: ReactNode): string | undefined {
14
14
  const walk = (n: ReactNode): string => {
@@ -119,7 +119,7 @@ export interface RhfFieldBaseProps<
119
119
  * `help` it is that caption at every size. */
120
120
  hint?: ReactNode;
121
121
  /** Help the field is usable without — why, how to choose — behind the field's one
122
- * "?" after the label: a `HelpPopover` named "About <label>" (round 0.36,
122
+ * "?" after the label: a `HelpPopover` named "About “<label>”" (round 0.36,
123
123
  * docs/text-size-harmonization.md §4); pass a `HelpPopover` to name it yourself.
124
124
  * `hint` stays the visible fact under the field. */
125
125
  help?: ReactNode;
@@ -67,10 +67,10 @@ export interface DeviceResetSettingProps
67
67
  * - **Live, no reload** (decision 10): each registered store resets through its own
68
68
  * setter; the card stays where it is.
69
69
  *
70
- * The app adds the catalogue entry, `{ id: "device_reset", group: "appearance", anchor:
71
- * DEVICE_RESET_ANCHOR, title, keywords }` (`title` and `keywords` from these labels), last
72
- * in its appearance group: inside a `SettingsLayout`, `SettingsSection` throws in
73
- * development without it.
70
+ * The app adds the catalogue entry, `{ id, group: "appearance", anchor: DEVICE_RESET_ANCHOR,
71
+ * title, keywords }` (the id in its catalogue's own style, e.g. `device_reset` or
72
+ * `deviceReset`; `title` and `keywords` from these labels), last in its appearance group:
73
+ * inside a `SettingsLayout`, `SettingsSection` throws in development without it.
74
74
  */
75
75
  export function DeviceResetSetting({
76
76
  description,