@eifi1/ui-kit 0.49.0 → 0.50.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 (166) hide show
  1. package/README.md +12 -8
  2. package/dist/admin/user-roster.d.ts +16 -10
  3. package/dist/admin/user-roster.js +7 -3
  4. package/dist/admin/user-roster.js.map +1 -1
  5. package/dist/auth/verify-email.d.ts +9 -1
  6. package/dist/auth/verify-email.js +3 -1
  7. package/dist/auth/verify-email.js.map +1 -1
  8. package/dist/components/amount-input.d.ts +2 -1
  9. package/dist/components/amount-input.js +3 -2
  10. package/dist/components/amount-input.js.map +1 -1
  11. package/dist/components/autocomplete.js +14 -0
  12. package/dist/components/autocomplete.js.map +1 -1
  13. package/dist/components/combobox-core.js +1 -0
  14. package/dist/components/combobox-core.js.map +1 -1
  15. package/dist/components/combobox-suggestions.js +1 -0
  16. package/dist/components/combobox-suggestions.js.map +1 -1
  17. package/dist/components/combobox.js +3 -1
  18. package/dist/components/combobox.js.map +1 -1
  19. package/dist/components/currency-select.d.ts +28 -2
  20. package/dist/components/currency-select.js +56 -10
  21. package/dist/components/currency-select.js.map +1 -1
  22. package/dist/components/data-table-mobile.d.ts +11 -2
  23. package/dist/components/data-table-mobile.js +62 -8
  24. package/dist/components/data-table-mobile.js.map +1 -1
  25. package/dist/components/data-table-row.d.ts +1 -1
  26. package/dist/components/data-table-row.js.map +1 -1
  27. package/dist/components/data-table.js +3 -1
  28. package/dist/components/data-table.js.map +1 -1
  29. package/dist/components/dropdown.js +1 -0
  30. package/dist/components/dropdown.js.map +1 -1
  31. package/dist/components/full-bleed-dialog.js +1 -0
  32. package/dist/components/full-bleed-dialog.js.map +1 -1
  33. package/dist/components/inline-entity-combobox.js +12 -0
  34. package/dist/components/inline-entity-combobox.js.map +1 -1
  35. package/dist/components/modal.js +1 -0
  36. package/dist/components/modal.js.map +1 -1
  37. package/dist/components/number-input.d.ts +2 -1
  38. package/dist/components/number-input.js +6 -2
  39. package/dist/components/number-input.js.map +1 -1
  40. package/dist/components/numpad-sheet.js +2 -0
  41. package/dist/components/numpad-sheet.js.map +1 -1
  42. package/dist/components/picker-sheet.js +2 -0
  43. package/dist/components/picker-sheet.js.map +1 -1
  44. package/dist/components/popover.js +1 -0
  45. package/dist/components/popover.js.map +1 -1
  46. package/dist/eslint/index.js +1 -1
  47. package/dist/i18n/defaults.js +2 -0
  48. package/dist/i18n/defaults.js.map +1 -1
  49. package/dist/i18n/german.js +14 -1
  50. package/dist/i18n/german.js.map +1 -1
  51. package/dist/i18n/kit-labels.d.ts +3 -0
  52. package/dist/i18n/kit-labels.js.map +1 -1
  53. package/dist/i18n/locales/en.js +16 -1
  54. package/dist/i18n/locales/en.js.map +3 -3
  55. package/dist/i18n/locales/es.js +14 -1
  56. package/dist/i18n/locales/es.js.map +1 -1
  57. package/dist/i18n/locales/fr.js +14 -1
  58. package/dist/i18n/locales/fr.js.map +1 -1
  59. package/dist/i18n/locales/hu.js +14 -1
  60. package/dist/i18n/locales/hu.js.map +1 -1
  61. package/dist/i18n/locales/it.js +14 -1
  62. package/dist/i18n/locales/it.js.map +1 -1
  63. package/dist/i18n/locales/zh.js +14 -1
  64. package/dist/i18n/locales/zh.js.map +1 -1
  65. package/dist/i18n/review.js +1 -0
  66. package/dist/i18n/review.js.map +1 -1
  67. package/dist/lib/data-attributes.d.ts +11 -0
  68. package/dist/lib/data-attributes.js +10 -0
  69. package/dist/lib/data-attributes.js.map +1 -0
  70. package/dist/lib/format.d.ts +1 -0
  71. package/dist/lib/format.js +2 -0
  72. package/dist/lib/format.js.map +1 -1
  73. package/dist/lib/minus.d.ts +10 -0
  74. package/dist/lib/minus.js.map +1 -1
  75. package/dist/lib/quiet-focus.d.ts +4 -0
  76. package/dist/lib/quiet-focus.js +19 -0
  77. package/dist/lib/quiet-focus.js.map +1 -0
  78. package/dist/testing/index.d.ts +1 -0
  79. package/dist/testing/index.js +4 -0
  80. package/dist/testing/index.js.map +1 -1
  81. package/dist/testing/react.d.ts +25 -0
  82. package/dist/testing/react.js +19 -0
  83. package/dist/testing/react.js.map +1 -0
  84. package/dist/testing/tour.d.ts +31 -0
  85. package/dist/testing/tour.js +12 -0
  86. package/dist/testing/tour.js.map +1 -0
  87. package/dist/tour/tour-dock.d.ts +42 -0
  88. package/dist/tour/tour-dock.js +80 -0
  89. package/dist/tour/tour-dock.js.map +1 -0
  90. package/dist/tour/tour-engine.d.ts +12 -0
  91. package/dist/tour/tour-engine.js +31 -0
  92. package/dist/tour/tour-engine.js.map +1 -0
  93. package/dist/tour/tour-gates.d.ts +71 -0
  94. package/dist/tour/tour-gates.js +114 -0
  95. package/dist/tour/tour-gates.js.map +1 -0
  96. package/dist/tour/tour-guide-button.d.ts +27 -0
  97. package/dist/tour/tour-guide-button.js +45 -0
  98. package/dist/tour/tour-guide-button.js.map +1 -0
  99. package/dist/tour/tour-guide-labels.d.ts +8 -0
  100. package/dist/tour/tour-guide-labels.js +9 -0
  101. package/dist/tour/tour-guide-labels.js.map +1 -0
  102. package/dist/tour/tour-labels.js +9 -1
  103. package/dist/tour/tour-labels.js.map +1 -1
  104. package/dist/tour/tour.d.ts +144 -9
  105. package/dist/tour/tour.js +598 -59
  106. package/dist/tour/tour.js.map +1 -1
  107. package/dist/tour/use-tour-url-sync.d.ts +7 -2
  108. package/dist/tour/use-tour-url-sync.js +27 -1
  109. package/dist/tour/use-tour-url-sync.js.map +1 -1
  110. package/dist/tour.d.ts +2 -0
  111. package/dist/tour.js +3 -0
  112. package/dist/tour.js.map +1 -1
  113. package/dist/wizard/stepper-nav.js +15 -2
  114. package/dist/wizard/stepper-nav.js.map +1 -1
  115. package/dist/wizard/types.d.ts +11 -0
  116. package/dist/wizard/types.js.map +1 -1
  117. package/dist/wizard/use-wizard.js +11 -5
  118. package/dist/wizard/use-wizard.js.map +1 -1
  119. package/package.json +9 -1
  120. package/src/admin/user-roster.tsx +22 -12
  121. package/src/auth/verify-email.tsx +10 -0
  122. package/src/components/amount-input.tsx +5 -4
  123. package/src/components/autocomplete.tsx +20 -0
  124. package/src/components/combobox-core.tsx +2 -0
  125. package/src/components/combobox-suggestions.tsx +2 -0
  126. package/src/components/combobox.tsx +5 -1
  127. package/src/components/currency-select.tsx +95 -6
  128. package/src/components/data-table-mobile.tsx +99 -8
  129. package/src/components/data-table-row.tsx +1 -0
  130. package/src/components/data-table.tsx +9 -1
  131. package/src/components/dropdown.tsx +2 -0
  132. package/src/components/full-bleed-dialog.tsx +3 -0
  133. package/src/components/inline-entity-combobox.tsx +17 -0
  134. package/src/components/modal.tsx +3 -0
  135. package/src/components/number-input.tsx +8 -3
  136. package/src/components/numpad-sheet.tsx +4 -0
  137. package/src/components/picker-sheet.tsx +4 -0
  138. package/src/components/popover.tsx +2 -0
  139. package/src/i18n/defaults.ts +2 -0
  140. package/src/i18n/german.ts +13 -0
  141. package/src/i18n/kit-labels.tsx +3 -0
  142. package/src/i18n/locales/es.ts +13 -0
  143. package/src/i18n/locales/fr.ts +13 -0
  144. package/src/i18n/locales/hu.ts +13 -0
  145. package/src/i18n/locales/it.ts +13 -0
  146. package/src/i18n/locales/zh.ts +13 -0
  147. package/src/i18n/review.ts +1 -0
  148. package/src/lib/data-attributes.ts +14 -0
  149. package/src/lib/format.ts +2 -0
  150. package/src/lib/minus.ts +10 -0
  151. package/src/lib/quiet-focus.ts +32 -0
  152. package/src/testing/index.ts +8 -0
  153. package/src/testing/react.ts +59 -0
  154. package/src/testing/tour.ts +41 -0
  155. package/src/tour/tour-dock.ts +132 -0
  156. package/src/tour/tour-engine.ts +41 -0
  157. package/src/tour/tour-gates.ts +195 -0
  158. package/src/tour/tour-guide-button.tsx +64 -0
  159. package/src/tour/tour-guide-labels.ts +15 -0
  160. package/src/tour/tour-labels.ts +8 -0
  161. package/src/tour/tour.tsx +989 -86
  162. package/src/tour/use-tour-url-sync.ts +43 -4
  163. package/src/tour.ts +3 -0
  164. package/src/wizard/stepper-nav.tsx +23 -3
  165. package/src/wizard/types.ts +12 -0
  166. package/src/wizard/use-wizard.ts +16 -9
@@ -85,6 +85,7 @@ const KIT_LABEL_SAMPLES = {
85
85
  "file.size": [[25e5]],
86
86
  "wizard.step": [[2, 4]],
87
87
  "tour.step": [[2, 4]],
88
+ "tour.backToStep": [["{{title}}"]],
88
89
  "globalSearch.shortcut": [["{{keys}}"]],
89
90
  "pieChart.slice": [["{{label}}", "{{value}}", "{{percent}}"]],
90
91
  "sparkline.rising": [["{{first}}", "{{last}}"]],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/i18n/review.ts"],"sourcesContent":["import { legalOperatorText } from \"../components/legal\";\nimport type { LegalOperator, LegalOperatorText } from \"../components/legal\";\nimport type { UiKitLabels } from \"./kit-labels\";\n\n/**\n * The kit's words as a flat `key → text` list, for an app's translation review.\n *\n * keksdose reviews its own locale bundles on its /translations page — one verdict per\n * locale and key, stored with the text the reviewer saw, so a later change re-opens it.\n * The kit's words appear on the same screens but live in TypeScript, not in the app's\n * bundles, and 143 of them are functions (`(count) => \"3 results\"`; 0.28.0, every one\n * listed in {@link KIT_LABEL_SAMPLES}), which a bundle flattener skips. This turns a\n * label tree into rows that page can join on.\n *\n * - A string label is one row under its dot path: `common.close`. An array of words\n * (weekday names) is one row per entry: `miniCalendar.weekdays.0`.\n * - A function label is called with fixed samples. Text arguments are i18next-style\n * placeholders (`{{name}}`), so a translation that drops one is caught by the same\n * placeholder check the app runs on its own strings. Counts are real numbers, twice\n * where the wording may depend on them — 1 and 3 — so a reviewer sees singular and\n * plural. The key names the sample: `combobox.resultCount(1)`,\n * `shareCard.removeConfirm(name)`, `serverWake.waking()`.\n * - The legal sections that name the operator (0.28) take one object; its sample is a\n * placeholder per field and the key calls it `operator`:\n * `legal.sections.privacy.controller.body(operator)`. Pass the app's operator in\n * `options` and those rows read the real sentence — same keys — so the lawyer\n * reviewing the `legal` area reads what the page says:\n *\n * kitLabelStrings(UI_KIT_LABELS_DE_CH, { operator: OPERATOR, locale: \"de-CH\" })\n *\n * Keys depend only on the samples, never on the locale, so the rows of `de-CH` and of the\n * English reference line up key by key. Pass exactly the tree the app hands\n * `UiKitProvider` — its overrides included — and review what users see:\n *\n * kitLabelStrings(UI_KIT_LABELS_DE_CH) // the rows for de-CH\n * kitLabelStrings(DEFAULT_UI_KIT_LABELS) // the English reference\n *\n * A label that throws on its sample becomes a row starting with \"⚠\", so one broken\n * override shows up on the page instead of taking the page down.\n */\nexport function kitLabelStrings(labels: UiKitLabels, options: KitLabelStringsOptions = {}): Record<string, string> {\n const out: Record<string, string> = {};\n const operator = options.operator && legalOperatorText(options.operator, options.locale);\n const walk = (node: unknown, path: string) => {\n if (typeof node === \"string\") {\n out[path] = node;\n } else if (typeof node === \"function\") {\n for (const args of KIT_LABEL_SAMPLES[path] ?? [[]]) {\n // The key is the SAMPLE's (`…body(operator)`), whatever the label is called with,\n // so rows with and without the app's operator join on the same keys.\n const called = operator ? args.map((arg) => (arg === LEGAL_OPERATOR_SAMPLE ? operator : arg)) : args;\n out[`${path}(${args.map(sampleName).filter((a) => a !== \"\").join(\", \")})`] = render(\n node as (...args: unknown[]) => unknown,\n called,\n );\n }\n } else if (node !== null && typeof node === \"object\") {\n for (const [key, value] of Object.entries(node)) walk(value, path ? `${path}.${key}` : key);\n }\n };\n walk(labels, \"\");\n return out;\n}\n\nexport interface KitLabelStringsOptions {\n /**\n * The app's operator (0.28): the legal sections that name it — the imprint's operator\n * and contact, the controller, the privacy contact, the governing law — are rendered\n * with the real values instead of `{{name}}`-style placeholders, so a reviewer (the\n * lawyer, under the `legal` area) reads the sentence the page shows. The keys do not\n * change: `legal.sections.impressum.operator.body(operator)` either way.\n */\n operator?: LegalOperator;\n /** The language the operator's country is named in — the locale these rows are\n * for (\"de-CH\" → \"Schweiz\"). Default English. */\n locale?: string;\n}\n\nfunction render(label: (...args: unknown[]) => unknown, args: readonly unknown[]): string {\n try {\n return String(label(...args));\n } catch (error) {\n return `⚠ ${error instanceof Error ? error.message : String(error)}`;\n }\n}\n\n/** How a sample argument is written in the key: a placeholder by its name, a number as\n * itself, an empty string as `\"\"`, a missing optional argument not at all. */\nfunction sampleName(arg: unknown): string {\n if (arg === undefined) return \"\";\n if (arg === LEGAL_OPERATOR_SAMPLE) return \"operator\";\n if (typeof arg === \"string\") return /^\\{\\{(\\w+)\\}\\}$/.exec(arg)?.[1] ?? JSON.stringify(arg);\n return String(arg);\n}\n\nconst one = [[1], [3]] as const;\n\n/**\n * The legal sections' operator (0.28) as placeholders, one per field — so a translation\n * that drops the city or the email is caught by the same check as a dropped `{{name}}`\n * anywhere else. Named `operator` in the key; {@link kitLabelStrings}' `operator` option\n * swaps the app's real values in for it.\n */\nconst LEGAL_OPERATOR_SAMPLE: LegalOperatorText = Object.freeze({\n name: \"{{name}}\",\n postalCode: \"{{postalCode}}\",\n city: \"{{city}}\",\n region: \"{{region}}\",\n country: \"{{country}}\",\n email: \"{{email}}\",\n bindingLanguage: \"{{bindingLanguage}}\",\n});\nconst operatorSample = [[LEGAL_OPERATOR_SAMPLE]] as const;\n\n/**\n * The sample arguments of every function label in {@link UiKitLabels}, by dot path.\n * `src/i18n/__tests__/review.test.ts` fails when a function label has no entry here, so\n * a new one cannot ship un-reviewable.\n */\nexport const KIT_LABEL_SAMPLES: Readonly<Record<string, readonly (readonly unknown[])[]>> = {\n \"common.fieldValue\": [[\"{{field}}\", \"{{value}}\"]],\n \"common.aboutField\": [[\"{{field}}\"]],\n \"dataTable.filterResults\": [\n [1, 1],\n [3, 12],\n ],\n \"dataTable.sortedAscending\": [[\"{{column}}\"]],\n \"dataTable.sortedDescending\": [[\"{{column}}\"]],\n \"dataTable.sortCleared\": [[\"{{column}}\"]],\n \"dataTable.pageChanged\": [[2, 5]],\n \"dataTable.pageRange\": [[1, 25, 1240]],\n \"dataTable.rowCount\": [[1], [1240]],\n \"dataTable.columnsCount\": [[3, 8]],\n \"dataTable.filterColumn\": [\n [\"{{column}}\", false],\n [\"{{column}}\", true],\n ],\n \"miniCalendar.day\": [[\"{{date}}\"]],\n \"miniCalendar.startSelected\": [[\"{{date}}\"]],\n \"miniCalendar.rangeSelected\": [[\"{{from}}\", \"{{to}}\"]],\n \"calendarHeatmap.day\": [[\"{{date}}\", \"{{value}}\"]],\n \"calendarHeatmap.truncated\": one,\n \"monthPicker.month\": [[\"{{monthYear}}\"]],\n \"combobox.create\": [[\"{{query}}\"]],\n \"combobox.selectedCount\": one,\n \"combobox.resultCount\": one,\n \"combobox.minChars\": one,\n \"multiSelect.selectedCount\": one,\n \"chipInput.added\": [[\"{{value}}\"]],\n \"chipInput.removed\": [[\"{{value}}\"]],\n \"chipInput.atLimit\": one,\n \"chipInput.duplicate\": [[\"{{value}}\"]],\n \"tabs.remove\": [[\"{{tab}}\"]],\n \"appShell.toggleGroup\": [[\"{{group}}\"]],\n \"topBar.role\": [[\"{{role}}\"]],\n \"topBar.languageCurrent\": [[\"{{name}}\"]],\n \"file.size\": [[2_500_000]],\n \"wizard.step\": [[2, 4]],\n \"tour.step\": [[2, 4]],\n \"globalSearch.shortcut\": [[\"{{keys}}\"]],\n \"pieChart.slice\": [[\"{{label}}\", \"{{value}}\", \"{{percent}}\"]],\n \"sparkline.rising\": [[\"{{first}}\", \"{{last}}\"]],\n \"sparkline.falling\": [[\"{{first}}\", \"{{last}}\"]],\n \"sparkline.flat\": [[\"{{value}}\"]],\n \"sparkline.single\": [[\"{{value}}\"]],\n \"sparkline.named\": [[\"{{name}}\", \"{{summary}}\"]],\n \"statTile.increase\": [[\"{{amount}}\"]],\n \"statTile.decrease\": [[\"{{amount}}\"]],\n \"statTile.better\": [[\"{{change}}\"]],\n \"statTile.worse\": [[\"{{change}}\"]],\n \"signaturePad.viewTyped\": [[\"{{name}}\"]],\n \"passwordStrength.announcement\": [[\"{{level}}\"]],\n \"passwordStrength.ruleLength\": [[12]],\n \"passwordStrength.optional\": [[\"{{rule}}\"]],\n \"passwordStrength.tooLong\": [[72]],\n \"dangerConfirm.phrase\": [[\"{{phrase}}\"]],\n \"dangerConfirm.needsPhrase\": [[\"{{phrase}}\"]],\n \"iconPicker.resultCount\": one,\n \"filePicker.rejectedType\": [[\"{{name}}\"]],\n \"filePicker.rejectedTypeOnly\": [[\"{{accept}}\", \"{{name}}\"]],\n \"filePicker.rejectedSize\": [[\"{{name}}\", \"{{maxSize}}\"]],\n \"filePicker.rejectedCount\": [\n [\"{{name}}\", 1],\n [\"{{name}}\", 3],\n ],\n \"filePicker.rejectedInvalid\": [[\"{{name}}\"]],\n \"filePicker.rejectedMany\": one,\n \"filePicker.rejectedPick\": one,\n \"filePicker.selected\": [\n [1, \"{{firstName}}\"],\n [3, \"{{firstName}}\"],\n ],\n \"filePicker.remove\": [[\"{{name}}\"]],\n \"filePicker.removed\": [[\"{{name}}\"]],\n \"filePicker.hint\": [[\"{{accept}}\"], [\"\"]],\n \"measuredGrid.removeRow\": [[3]],\n \"measuredGrid.cell\": [[\"{{column}}\", 3]],\n \"measuredGrid.lineError\": [[3]],\n \"measuredGrid.points\": one,\n \"measuredGrid.problems\": one,\n \"feedbackAttachment.attachmentRemoveFile\": [[\"{{name}}\"]],\n \"feedbackAttachment.attachmentLimit\": one,\n \"feedbackAttachment.attachmentUploadFailed\": [[\"{{name}}\"]],\n \"feedbackComposer.sendHint\": [[\"{{modifier}}\"]],\n \"feedbackDialog.submitHint\": [[true], [false]],\n \"feedbackToast.attachmentTooMany\": one,\n \"feedbackToast.statusChanged\": [[\"{{status}}\", \"{{title}}\"]],\n \"feedbackToast.statusRestored\": [[\"{{status}}\", \"{{title}}\"]],\n \"feedbackPage.userFallback\": [[42]],\n // A real value, not a placeholder: the chip upper-cases what it is given, and\n // \"{{ENVIRONMENT}}\" would read as a placeholder of that name.\n \"feedbackPage.environment\": [[\"dev\"]],\n \"feedbackPage.reworkChip\": one,\n \"feedbackDetail.download\": [[\"{{name}}\"]],\n \"feedbackDetail.resolvedAt\": [[\"{{date}}\"]],\n \"feedbackPublic.total\": one,\n \"feedbackPublic.comments\": one,\n \"feedbackPublic.votes\": one,\n \"feedbackPublic.filedBy\": [[\"{{name}}\"]],\n \"feedbackPublic.page\": [[3]],\n \"accountSettings.passkeys.renameItem\": [[\"{{name}}\"]],\n \"accountSettings.passkeys.renameField\": [[\"{{name}}\"]],\n \"accountSettings.passkeys.deleteItem\": [[\"{{name}}\"]],\n \"accountSettings.passkeys.deleteConfirm\": [[\"{{name}}\"]],\n \"accountSettings.passkeys.created\": [[\"{{date}}\"]],\n \"accountSettings.passkeys.lastUsed\": [[\"{{date}}\"]],\n \"confirmDialog.typed\": [[\"{{text}}\"]],\n \"floatingPanel.badge\": one,\n \"bulkActionBar.selected\": one,\n \"form.submitShortcut\": [[true], [false]],\n \"lineItems.remove\": [[3]],\n \"lineItems.confirmRemove\": [[3]],\n \"lineItems.row\": [[3]],\n \"lineItems.cell\": [[\"{{column}}\", 3]],\n \"progressBar.overLimit\": [[\"{{amount}}\"]],\n \"signedAmount.positive\": [[\"{{amount}}\"]],\n \"signedAmount.negative\": [[\"{{amount}}\"]],\n \"errorBoundary.reportedAs\": [[\"{{reference}}\"]],\n \"authedImage.failedImage\": [[\"{{alt}}\"]],\n \"imageGrid.item\": [[2, 5]],\n \"imageGrid.actions\": [[\"{{name}}\"]],\n \"lightbox.counter\": [[2, 5]],\n \"lightbox.position\": [[2, 5]],\n \"shareCard.roleOf\": [[\"{{name}}\"]],\n \"shareCard.teamHint\": [[\"{{name}}\"]],\n \"shareCard.removeConfirm\": [[\"{{name}}\"]],\n \"shareCard.revokePendingConfirm\": [[\"{{name}}\"]],\n \"serverWake.waking\": [[\"{{appName}}\"], [undefined]],\n \"translationReview.filterCount\": [\n [\"{{status}}\", 1],\n [\"{{status}}\", 3],\n ],\n \"translationReview.placeholdersOnly\": one,\n \"translationReview.progress\": [\n [1, 1],\n [3, 12],\n ],\n \"translationReview.localeProgress\": [[3, 12]],\n \"translationReview.placeholderMismatch\": [[\"{{reference}}\", \"{{text}}\"]],\n \"translationReview.lastApproved\": [[\"{{name}}\", \"{{date}}\"]],\n \"translationReview.lastFlagged\": [[\"{{name}}\", \"{{date}}\"]],\n \"translationReview.scope\": [[\"{{areas}}\"]],\n \"translationReview.exportCorrections\": [[0], [1], [3]],\n \"translationReview.approvedToast\": one,\n \"translationReview.clearedToast\": one,\n \"translationReview.groupCount\": [\n [1, 12],\n [3, 12],\n ],\n \"translationReview.approveGroup\": one,\n \"translationReview.confirmGroup\": [\n [1, \"{{group}}\"],\n [3, \"{{group}}\"],\n ],\n \"characterCount.count\": [[12, 80]],\n \"characterCount.remaining\": one,\n \"inlineEdit.edit\": [[\"{{label}}\"]],\n \"ibanInput.country\": [[\"{{code}}\"]],\n \"ibanInput.length\": [[20, 21]],\n \"signChip.direction\": [[\"{{current}}\", \"{{next}}\"]],\n \"signChip.switchTo\": [[\"{{next}}\"]],\n \"rowActions.actionsFor\": [[\"{{name}}\"]],\n \"rowActions.confirmTitle\": [[\"{{action}}\", \"{{name}}\"], [\"{{action}}\"]],\n \"columnMapper.readError\": [[\"{{name}}\"]],\n \"columnMapper.summary\": [\n [1, 1],\n [3, 12],\n ],\n \"columnMapper.unreadCount\": one,\n \"columnMapper.unreadLine\": [[3]],\n \"columnMapper.unreadMore\": one,\n \"columnMapper.columnN\": [[3]],\n \"columnMapper.roleOf\": [[\"{{column}}\"]],\n \"columnMapper.requiredRole\": [[\"{{role}}\"]],\n \"columnMapper.requiredRoleShort\": [[\"{{role}}\"]],\n \"columnMapper.previewOf\": [\n [1, 12],\n [10, 250],\n ],\n \"columnMapper.oneOf\": [[\"{{roles}}\"]],\n \"columnMapper.missing\": [[\"{{roles}}\"]],\n \"legal.sections.impressum.operator.body\": operatorSample,\n \"legal.sections.impressum.contact.body\": operatorSample,\n \"legal.sections.privacy.controller.body\": operatorSample,\n \"legal.sections.privacy.contact.body\": operatorSample,\n \"legal.sections.terms.law.body\": operatorSample,\n // 0.28.1: the binding language, named in the reader's language.\n \"legal.sections.terms.language.body\": operatorSample,\n \"legal.translation.note\": operatorSample,\n \"legal.translation.show\": operatorSample,\n // 0.29.0: the sign-in and sign-up parts (docs/auth-harmonization.md).\n \"signIn.tagHint\": [[\"{{taggedAddress}}\"]],\n \"register.emailTagUse\": [[\"{{address}}\"]],\n \"forgotPassword.sent\": [[\"{{email}}\"]],\n \"resetPassword.intro\": [[\"{{email}}\"]],\n \"verifyEmail.resendIn\": [[30]],\n \"acceptInvitation.joined\": [[\"{{name}}\"]],\n \"companySwitcher.current\": [[\"{{name}}\"]],\n // 0.30.0: the user administration and the account's own settings\n // (docs/user-admin-harmonization.md). `rateLimited` with and without a wait.\n \"signIn.recoveryCodeHint\": [[16]],\n \"signIn.rateLimited\": [[], [30], [300]],\n \"register.rateLimited\": [[], [30], [300]],\n \"forgotPassword.rateLimited\": [[], [30], [300]],\n \"resetPassword.rateLimited\": [[], [30], [300]],\n \"verifyEmail.rateLimited\": [[], [30], [300]],\n \"emailChange.emailTagUse\": [[\"{{address}}\"]],\n \"emailChange.pending\": [[\"{{newEmail}}\"]],\n \"emailChange.pendingHint\": [[\"{{currentEmail}}\"]],\n \"emailChange.confirmed\": [[\"{{email}}\"]],\n \"emailChange.rateLimited\": [[], [30], [300]],\n \"sessions.lastActive\": [[\"{{when}}\"]],\n \"sessions.ip\": [[\"{{address}}\"]],\n \"sessions.revokeItem\": [[\"{{device}}\"]],\n \"notifications.quietDescription\": [[false], [true], [false, true], [true, true]],\n \"notifications.quietZone\": [[\"{{zone}}\"]],\n \"notifications.bellUnread\": one,\n \"notifications.iosInstall\": [[\"{{app}}\"]],\n \"notifications.testSent\": one,\n \"notifications.explainerBody\": [[\"{{app}}\"]],\n \"notifications.added\": [[\"{{date}}\"]],\n \"notifications.lastDelivery\": [[\"{{date}}\"]],\n \"notifications.failures\": one,\n \"notifications.removeItem\": [[\"{{device}}\"]],\n \"notifications.unsubscribeAbout\": [[\"{{type}}\"]],\n \"notifications.stopAll\": [[\"{{app}}\"]],\n \"notifications.stoppedAll\": [[\"{{app}}\"]],\n \"deleteAccount.afterDays\": [[1], [30]],\n \"deleteAccount.handOver\": [[1], [3]],\n \"deleteAccount.lastAdminOf\": [[\"{{companies}}\"]],\n \"deleteAccount.rateLimited\": [[], [30], [300]],\n \"dataExport.rateLimited\": [[], [30], [300]],\n \"userRoster.actionsFor\": [[\"{{name}}\"]],\n \"roleSelect.roleOf\": [[\"{{name}}\"]],\n \"roleSelect.unavailable\": [[\"{{role}}\", \"{{reason}}\"]],\n \"adminActionLog.by\": [[\"{{actor}}\"]],\n \"adminActionLog.filteredTo\": [[\"{{target}}\"]],\n \"adminActionLog.filterBy\": [[\"{{target}}\"]],\n // 0.45.0 (admin §9.4): a company rename that logged both names.\n \"adminActionLog.renamedFromTo\": [[\"{{from}}\", \"{{to}}\"]],\n \"transferOwnership.title\": [[\"{{name}}\"]],\n \"transferOwnership.unavailable\": [[\"{{account}}\", \"{{reason}}\"]],\n \"invitations.sent\": [[\"{{date}}\"]],\n \"invitations.expires\": [[\"{{date}}\"]],\n \"invitations.invitedBy\": [[\"{{name}}\"]],\n \"invitations.resend\": [[\"{{email}}\"]],\n \"invitations.revoke\": [[\"{{email}}\"]],\n \"invitations.linkReady\": [[\"{{email}}\"]],\n \"invitations.notSent\": [[\"{{email}}\"]],\n \"accountState.deletionOn\": [[\"{{date}}\"]],\n // 0.31.0: the settings shell, the landing page and the demo\n // (docs/settings-harmonization.md, docs/landing-demo-harmonization.md). An optional\n // argument both given and left out: the subject without an app name, the refusal\n // without a `Retry-After`.\n \"settings.noMatches\": [[\"{{query}}\"]],\n \"settings.matchCount\": one,\n \"landing.accessSubject\": [[\"{{app}}\"], [undefined]],\n \"demo.rateLimited\": [[], [1], [3]],\n \"demo.hoursLeft\": [\n [1, 1],\n [3, 12],\n ],\n \"demo.minutesLeft\": one,\n // 0.32.0: the subscription parts (docs/billing-harmonization.md §7). A trial or a grant\n // ending today, tomorrow and in five days; the guest's notice with and without the\n // item's name.\n \"billing.choose\": [[\"{{plan}}\"]],\n \"billing.upgrade\": [[\"{{plan}}\"]],\n \"billing.downgrade\": [[\"{{plan}}\"]],\n \"billing.trialEnding\": [[0], [1], [5]],\n \"billing.grantEnding\": [[0], [1], [5]],\n \"billing.guestReadOnly\": [[\"{{item}}\"], [undefined]],\n \"billing.usage\": [[\"{{used}}\", \"{{limit}}\"]],\n \"billing.contactSubject\": [[\"{{dimension}}\"]],\n \"billing.waitingChanges\": one,\n // 0.33.0: the limit's figure line (§14.11) and the operator's plan parts (§14.12).\n \"billing.limitUsageLine\": [[\"{{dimension}}\", \"{{used}}\", \"{{limit}}\"]],\n // 0.39: PlanSwitchConfirm's two lines with figures (§15.2.10).\n \"billing.switchFromTo\": [[\"{{from}}\", \"{{to}}\"]],\n \"billing.switchNextCharge\": [[\"{{date}}\"]],\n // 0.42 (§16): the buyer's name, or none once they are gone; the cancel's period end.\n \"billing.buyerHolds\": [[\"{{buyer}}\"], [undefined]],\n \"billing.paymentFailedAskBuyer\": [[\"{{buyer}}\"], [undefined]],\n \"billing.cancelConfirmBody\": [[\"{{date}}\"]],\n \"billing.portalOpensNewTab\": [[\"{{provider}}\", \"{{app}}\"], [\"{{provider}}\", undefined]],\n \"planChange.current\": [[\"{{plan}}\"]],\n \"planChange.changed\": [[\"{{from}}\", \"{{to}}\"]],\n \"planChange.set\": [[\"{{to}}\"]],\n \"planChange.untilDone\": [[\"{{date}}\"]],\n \"planChange.usageOf\": [[\"{{used}}\", \"{{limit}}\", \"{{dimension}}\"]],\n // 0.42.0 (docs/admin-harmonization.md §3.1): the menu row's count, the 403 page's app,\n // the users tile's new accounts.\n \"adminArea.waiting\": one,\n // 0.45.0 (admin §9.3.4): an IconButton's name with its waiting count.\n \"adminArea.waitingLabel\": [[\"{{label}}\", 1], [\"{{label}}\", 3]],\n // 0.45.0 (admin §9.2.4): the test mail's transport, masked address and limiter.\n \"mailTestCard.transport\": [[\"{{backend}}\"]],\n \"mailTestCard.sent\": [[\"{{address}}\"]],\n \"mailTestCard.rateLimited\": [[], [30], [300]],\n \"adminArea.forbiddenBody\": [[\"{{app}}\"]],\n \"adminArea.tiles.usersNew\": one,\n // 0.42.0 (docs/top-bar-harmonization.md §3.1): the sync indicator's counts, its time, the\n // state joined to its hint or to the app's scope; the dev plan and the role to go back to.\n \"topBarParts.sync.blocked\": one,\n \"topBarParts.sync.pending\": one,\n \"topBarParts.sync.syncedAt\": [[\"{{time}}\"]],\n \"topBarParts.sync.withHint\": [[\"{{state}}\", \"{{hint}}\"]],\n \"topBarParts.sync.scoped\": [[\"{{scope}}\", \"{{state}}\"]],\n \"topBarParts.sync.waitingShort\": one,\n \"topBarParts.dev.plan\": [[\"{{plan}}\"]],\n \"topBarParts.dev.backTo\": [[\"{{role}}\"]],\n // 0.43.0 (docs/tours-harmonization.md §3, §8): the tours page's counts, its group\n // option, the completion day and a reset's day and reason.\n \"tourCatalogue.groupAll\": one,\n \"tourCatalogue.groupOption\": [[\"{{group}}\", 1], [\"{{group}}\", 3]],\n \"tourCatalogue.stateAll\": one,\n \"tourCatalogue.stateTodo\": one,\n \"tourCatalogue.stateDone\": one,\n \"tourCatalogue.showing\": [[3, 16]],\n \"tourCatalogue.resetOn\": [[\"{{date}}\", \"{{reason}}\"]],\n \"tourCatalogue.points\": one,\n \"tourCatalogue.steps\": one,\n \"tourCatalogue.duration\": one,\n \"tourCatalogue.completedOn\": [[\"{{date}}\"]],\n // 0.45.0 (docs/local-first-harmonization.md §1.6): the sign-out question's count, in\n // both word sets.\n \"signOutPending.lost\": one,\n \"signOutPending.kept\": one,\n};\n"],"mappings":";AAAA,SAAS,yBAAyB;AAwC3B,SAAS,gBAAgB,QAAqB,UAAkC,CAAC,GAA2B;AACjH,QAAM,MAA8B,CAAC;AACrC,QAAM,WAAW,QAAQ,YAAY,kBAAkB,QAAQ,UAAU,QAAQ,MAAM;AACvF,QAAM,OAAO,CAAC,MAAe,SAAiB;AAC5C,QAAI,OAAO,SAAS,UAAU;AAC5B,UAAI,IAAI,IAAI;AAAA,IACd,WAAW,OAAO,SAAS,YAAY;AACrC,iBAAW,QAAQ,kBAAkB,IA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BAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,0BAA0B;AAAA,EAC1B,6BAA6B,CAAC,CAAC,UAAU,CAAC;AAAA;AAAA;AAAA,EAG1C,uBAAuB;AAAA,EACvB,uBAAuB;AACzB;","names":[]}
1
+ {"version":3,"sources":["../../src/i18n/review.ts"],"sourcesContent":["import { legalOperatorText } from \"../components/legal\";\nimport type { LegalOperator, LegalOperatorText } from \"../components/legal\";\nimport type { UiKitLabels } from \"./kit-labels\";\n\n/**\n * The kit's words as a flat `key → text` list, for an app's translation review.\n *\n * keksdose reviews its own locale bundles on its /translations page — one verdict per\n * locale and key, stored with the text the reviewer saw, so a later change re-opens it.\n * The kit's words appear on the same screens but live in TypeScript, not in the app's\n * bundles, and 143 of them are functions (`(count) => \"3 results\"`; 0.28.0, every one\n * listed in {@link KIT_LABEL_SAMPLES}), which a bundle flattener skips. This turns a\n * label tree into rows that page can join on.\n *\n * - A string label is one row under its dot path: `common.close`. An array of words\n * (weekday names) is one row per entry: `miniCalendar.weekdays.0`.\n * - A function label is called with fixed samples. Text arguments are i18next-style\n * placeholders (`{{name}}`), so a translation that drops one is caught by the same\n * placeholder check the app runs on its own strings. Counts are real numbers, twice\n * where the wording may depend on them — 1 and 3 — so a reviewer sees singular and\n * plural. The key names the sample: `combobox.resultCount(1)`,\n * `shareCard.removeConfirm(name)`, `serverWake.waking()`.\n * - The legal sections that name the operator (0.28) take one object; its sample is a\n * placeholder per field and the key calls it `operator`:\n * `legal.sections.privacy.controller.body(operator)`. Pass the app's operator in\n * `options` and those rows read the real sentence — same keys — so the lawyer\n * reviewing the `legal` area reads what the page says:\n *\n * kitLabelStrings(UI_KIT_LABELS_DE_CH, { operator: OPERATOR, locale: \"de-CH\" })\n *\n * Keys depend only on the samples, never on the locale, so the rows of `de-CH` and of the\n * English reference line up key by key. Pass exactly the tree the app hands\n * `UiKitProvider` — its overrides included — and review what users see:\n *\n * kitLabelStrings(UI_KIT_LABELS_DE_CH) // the rows for de-CH\n * kitLabelStrings(DEFAULT_UI_KIT_LABELS) // the English reference\n *\n * A label that throws on its sample becomes a row starting with \"⚠\", so one broken\n * override shows up on the page instead of taking the page down.\n */\nexport function kitLabelStrings(labels: UiKitLabels, options: KitLabelStringsOptions = {}): Record<string, string> {\n const out: Record<string, string> = {};\n const operator = options.operator && legalOperatorText(options.operator, options.locale);\n const walk = (node: unknown, path: string) => {\n if (typeof node === \"string\") {\n out[path] = node;\n } else if (typeof node === \"function\") {\n for (const args of KIT_LABEL_SAMPLES[path] ?? [[]]) {\n // The key is the SAMPLE's (`…body(operator)`), whatever the label is called with,\n // so rows with and without the app's operator join on the same keys.\n const called = operator ? args.map((arg) => (arg === LEGAL_OPERATOR_SAMPLE ? operator : arg)) : args;\n out[`${path}(${args.map(sampleName).filter((a) => a !== \"\").join(\", \")})`] = render(\n node as (...args: unknown[]) => unknown,\n called,\n );\n }\n } else if (node !== null && typeof node === \"object\") {\n for (const [key, value] of Object.entries(node)) walk(value, path ? `${path}.${key}` : key);\n }\n };\n walk(labels, \"\");\n return out;\n}\n\nexport interface KitLabelStringsOptions {\n /**\n * The app's operator (0.28): the legal sections that name it — the imprint's operator\n * and contact, the controller, the privacy contact, the governing law — are rendered\n * with the real values instead of `{{name}}`-style placeholders, so a reviewer (the\n * lawyer, under the `legal` area) reads the sentence the page shows. The keys do not\n * change: `legal.sections.impressum.operator.body(operator)` either way.\n */\n operator?: LegalOperator;\n /** The language the operator's country is named in — the locale these rows are\n * for (\"de-CH\" → \"Schweiz\"). Default English. */\n locale?: string;\n}\n\nfunction render(label: (...args: unknown[]) => unknown, args: readonly unknown[]): string {\n try {\n return String(label(...args));\n } catch (error) {\n return `⚠ ${error instanceof Error ? error.message : String(error)}`;\n }\n}\n\n/** How a sample argument is written in the key: a placeholder by its name, a number as\n * itself, an empty string as `\"\"`, a missing optional argument not at all. */\nfunction sampleName(arg: unknown): string {\n if (arg === undefined) return \"\";\n if (arg === LEGAL_OPERATOR_SAMPLE) return \"operator\";\n if (typeof arg === \"string\") return /^\\{\\{(\\w+)\\}\\}$/.exec(arg)?.[1] ?? JSON.stringify(arg);\n return String(arg);\n}\n\nconst one = [[1], [3]] as const;\n\n/**\n * The legal sections' operator (0.28) as placeholders, one per field — so a translation\n * that drops the city or the email is caught by the same check as a dropped `{{name}}`\n * anywhere else. Named `operator` in the key; {@link kitLabelStrings}' `operator` option\n * swaps the app's real values in for it.\n */\nconst LEGAL_OPERATOR_SAMPLE: LegalOperatorText = Object.freeze({\n name: \"{{name}}\",\n postalCode: \"{{postalCode}}\",\n city: \"{{city}}\",\n region: \"{{region}}\",\n country: \"{{country}}\",\n email: \"{{email}}\",\n bindingLanguage: \"{{bindingLanguage}}\",\n});\nconst operatorSample = [[LEGAL_OPERATOR_SAMPLE]] as const;\n\n/**\n * The sample arguments of every function label in {@link UiKitLabels}, by dot path.\n * `src/i18n/__tests__/review.test.ts` fails when a function label has no entry here, so\n * a new one cannot ship un-reviewable.\n */\nexport const KIT_LABEL_SAMPLES: Readonly<Record<string, readonly (readonly unknown[])[]>> = {\n \"common.fieldValue\": [[\"{{field}}\", \"{{value}}\"]],\n \"common.aboutField\": [[\"{{field}}\"]],\n \"dataTable.filterResults\": [\n [1, 1],\n [3, 12],\n ],\n \"dataTable.sortedAscending\": [[\"{{column}}\"]],\n \"dataTable.sortedDescending\": [[\"{{column}}\"]],\n \"dataTable.sortCleared\": [[\"{{column}}\"]],\n \"dataTable.pageChanged\": [[2, 5]],\n \"dataTable.pageRange\": [[1, 25, 1240]],\n \"dataTable.rowCount\": [[1], [1240]],\n \"dataTable.columnsCount\": [[3, 8]],\n \"dataTable.filterColumn\": [\n [\"{{column}}\", false],\n [\"{{column}}\", true],\n ],\n \"miniCalendar.day\": [[\"{{date}}\"]],\n \"miniCalendar.startSelected\": [[\"{{date}}\"]],\n \"miniCalendar.rangeSelected\": [[\"{{from}}\", \"{{to}}\"]],\n \"calendarHeatmap.day\": [[\"{{date}}\", \"{{value}}\"]],\n \"calendarHeatmap.truncated\": one,\n \"monthPicker.month\": [[\"{{monthYear}}\"]],\n \"combobox.create\": [[\"{{query}}\"]],\n \"combobox.selectedCount\": one,\n \"combobox.resultCount\": one,\n \"combobox.minChars\": one,\n \"multiSelect.selectedCount\": one,\n \"chipInput.added\": [[\"{{value}}\"]],\n \"chipInput.removed\": [[\"{{value}}\"]],\n \"chipInput.atLimit\": one,\n \"chipInput.duplicate\": [[\"{{value}}\"]],\n \"tabs.remove\": [[\"{{tab}}\"]],\n \"appShell.toggleGroup\": [[\"{{group}}\"]],\n \"topBar.role\": [[\"{{role}}\"]],\n \"topBar.languageCurrent\": [[\"{{name}}\"]],\n \"file.size\": [[2_500_000]],\n \"wizard.step\": [[2, 4]],\n \"tour.step\": [[2, 4]],\n \"tour.backToStep\": [[\"{{title}}\"]],\n \"globalSearch.shortcut\": [[\"{{keys}}\"]],\n \"pieChart.slice\": [[\"{{label}}\", \"{{value}}\", \"{{percent}}\"]],\n \"sparkline.rising\": [[\"{{first}}\", \"{{last}}\"]],\n \"sparkline.falling\": [[\"{{first}}\", \"{{last}}\"]],\n \"sparkline.flat\": [[\"{{value}}\"]],\n \"sparkline.single\": [[\"{{value}}\"]],\n \"sparkline.named\": [[\"{{name}}\", \"{{summary}}\"]],\n \"statTile.increase\": [[\"{{amount}}\"]],\n \"statTile.decrease\": [[\"{{amount}}\"]],\n \"statTile.better\": [[\"{{change}}\"]],\n \"statTile.worse\": [[\"{{change}}\"]],\n \"signaturePad.viewTyped\": [[\"{{name}}\"]],\n \"passwordStrength.announcement\": [[\"{{level}}\"]],\n \"passwordStrength.ruleLength\": [[12]],\n \"passwordStrength.optional\": [[\"{{rule}}\"]],\n \"passwordStrength.tooLong\": [[72]],\n \"dangerConfirm.phrase\": [[\"{{phrase}}\"]],\n \"dangerConfirm.needsPhrase\": [[\"{{phrase}}\"]],\n \"iconPicker.resultCount\": one,\n \"filePicker.rejectedType\": [[\"{{name}}\"]],\n \"filePicker.rejectedTypeOnly\": [[\"{{accept}}\", \"{{name}}\"]],\n \"filePicker.rejectedSize\": [[\"{{name}}\", \"{{maxSize}}\"]],\n \"filePicker.rejectedCount\": [\n [\"{{name}}\", 1],\n [\"{{name}}\", 3],\n ],\n \"filePicker.rejectedInvalid\": [[\"{{name}}\"]],\n \"filePicker.rejectedMany\": one,\n \"filePicker.rejectedPick\": one,\n \"filePicker.selected\": [\n [1, \"{{firstName}}\"],\n [3, \"{{firstName}}\"],\n ],\n \"filePicker.remove\": [[\"{{name}}\"]],\n \"filePicker.removed\": [[\"{{name}}\"]],\n \"filePicker.hint\": [[\"{{accept}}\"], [\"\"]],\n \"measuredGrid.removeRow\": [[3]],\n \"measuredGrid.cell\": [[\"{{column}}\", 3]],\n \"measuredGrid.lineError\": [[3]],\n \"measuredGrid.points\": one,\n \"measuredGrid.problems\": one,\n \"feedbackAttachment.attachmentRemoveFile\": [[\"{{name}}\"]],\n \"feedbackAttachment.attachmentLimit\": one,\n \"feedbackAttachment.attachmentUploadFailed\": [[\"{{name}}\"]],\n \"feedbackComposer.sendHint\": [[\"{{modifier}}\"]],\n \"feedbackDialog.submitHint\": [[true], [false]],\n \"feedbackToast.attachmentTooMany\": one,\n \"feedbackToast.statusChanged\": [[\"{{status}}\", \"{{title}}\"]],\n \"feedbackToast.statusRestored\": [[\"{{status}}\", \"{{title}}\"]],\n \"feedbackPage.userFallback\": [[42]],\n // A real value, not a placeholder: the chip upper-cases what it is given, and\n // \"{{ENVIRONMENT}}\" would read as a placeholder of that name.\n \"feedbackPage.environment\": [[\"dev\"]],\n \"feedbackPage.reworkChip\": one,\n \"feedbackDetail.download\": [[\"{{name}}\"]],\n \"feedbackDetail.resolvedAt\": [[\"{{date}}\"]],\n \"feedbackPublic.total\": one,\n \"feedbackPublic.comments\": one,\n \"feedbackPublic.votes\": one,\n \"feedbackPublic.filedBy\": [[\"{{name}}\"]],\n \"feedbackPublic.page\": [[3]],\n \"accountSettings.passkeys.renameItem\": [[\"{{name}}\"]],\n \"accountSettings.passkeys.renameField\": [[\"{{name}}\"]],\n \"accountSettings.passkeys.deleteItem\": [[\"{{name}}\"]],\n \"accountSettings.passkeys.deleteConfirm\": [[\"{{name}}\"]],\n \"accountSettings.passkeys.created\": [[\"{{date}}\"]],\n \"accountSettings.passkeys.lastUsed\": [[\"{{date}}\"]],\n \"confirmDialog.typed\": [[\"{{text}}\"]],\n \"floatingPanel.badge\": one,\n \"bulkActionBar.selected\": one,\n \"form.submitShortcut\": [[true], [false]],\n \"lineItems.remove\": [[3]],\n \"lineItems.confirmRemove\": [[3]],\n \"lineItems.row\": [[3]],\n \"lineItems.cell\": [[\"{{column}}\", 3]],\n \"progressBar.overLimit\": [[\"{{amount}}\"]],\n \"signedAmount.positive\": [[\"{{amount}}\"]],\n \"signedAmount.negative\": [[\"{{amount}}\"]],\n \"errorBoundary.reportedAs\": [[\"{{reference}}\"]],\n \"authedImage.failedImage\": [[\"{{alt}}\"]],\n \"imageGrid.item\": [[2, 5]],\n \"imageGrid.actions\": [[\"{{name}}\"]],\n \"lightbox.counter\": [[2, 5]],\n \"lightbox.position\": [[2, 5]],\n \"shareCard.roleOf\": [[\"{{name}}\"]],\n \"shareCard.teamHint\": [[\"{{name}}\"]],\n \"shareCard.removeConfirm\": [[\"{{name}}\"]],\n \"shareCard.revokePendingConfirm\": [[\"{{name}}\"]],\n \"serverWake.waking\": [[\"{{appName}}\"], [undefined]],\n \"translationReview.filterCount\": [\n [\"{{status}}\", 1],\n [\"{{status}}\", 3],\n ],\n \"translationReview.placeholdersOnly\": one,\n \"translationReview.progress\": [\n [1, 1],\n [3, 12],\n ],\n \"translationReview.localeProgress\": [[3, 12]],\n \"translationReview.placeholderMismatch\": [[\"{{reference}}\", \"{{text}}\"]],\n \"translationReview.lastApproved\": [[\"{{name}}\", \"{{date}}\"]],\n \"translationReview.lastFlagged\": [[\"{{name}}\", \"{{date}}\"]],\n \"translationReview.scope\": [[\"{{areas}}\"]],\n \"translationReview.exportCorrections\": [[0], [1], [3]],\n \"translationReview.approvedToast\": one,\n \"translationReview.clearedToast\": one,\n \"translationReview.groupCount\": [\n [1, 12],\n [3, 12],\n ],\n \"translationReview.approveGroup\": one,\n \"translationReview.confirmGroup\": [\n [1, \"{{group}}\"],\n [3, \"{{group}}\"],\n ],\n \"characterCount.count\": [[12, 80]],\n \"characterCount.remaining\": one,\n \"inlineEdit.edit\": [[\"{{label}}\"]],\n \"ibanInput.country\": [[\"{{code}}\"]],\n \"ibanInput.length\": [[20, 21]],\n \"signChip.direction\": [[\"{{current}}\", \"{{next}}\"]],\n \"signChip.switchTo\": [[\"{{next}}\"]],\n \"rowActions.actionsFor\": [[\"{{name}}\"]],\n \"rowActions.confirmTitle\": [[\"{{action}}\", \"{{name}}\"], [\"{{action}}\"]],\n \"columnMapper.readError\": [[\"{{name}}\"]],\n \"columnMapper.summary\": [\n [1, 1],\n [3, 12],\n ],\n \"columnMapper.unreadCount\": one,\n \"columnMapper.unreadLine\": [[3]],\n \"columnMapper.unreadMore\": one,\n \"columnMapper.columnN\": [[3]],\n \"columnMapper.roleOf\": [[\"{{column}}\"]],\n \"columnMapper.requiredRole\": [[\"{{role}}\"]],\n \"columnMapper.requiredRoleShort\": [[\"{{role}}\"]],\n \"columnMapper.previewOf\": [\n [1, 12],\n [10, 250],\n ],\n \"columnMapper.oneOf\": [[\"{{roles}}\"]],\n \"columnMapper.missing\": [[\"{{roles}}\"]],\n \"legal.sections.impressum.operator.body\": operatorSample,\n \"legal.sections.impressum.contact.body\": operatorSample,\n \"legal.sections.privacy.controller.body\": operatorSample,\n \"legal.sections.privacy.contact.body\": operatorSample,\n \"legal.sections.terms.law.body\": operatorSample,\n // 0.28.1: the binding language, named in the reader's language.\n \"legal.sections.terms.language.body\": operatorSample,\n \"legal.translation.note\": operatorSample,\n \"legal.translation.show\": operatorSample,\n // 0.29.0: the sign-in and sign-up parts (docs/auth-harmonization.md).\n \"signIn.tagHint\": [[\"{{taggedAddress}}\"]],\n \"register.emailTagUse\": [[\"{{address}}\"]],\n \"forgotPassword.sent\": [[\"{{email}}\"]],\n \"resetPassword.intro\": [[\"{{email}}\"]],\n \"verifyEmail.resendIn\": [[30]],\n \"acceptInvitation.joined\": [[\"{{name}}\"]],\n \"companySwitcher.current\": [[\"{{name}}\"]],\n // 0.30.0: the user administration and the account's own settings\n // (docs/user-admin-harmonization.md). `rateLimited` with and without a wait.\n \"signIn.recoveryCodeHint\": [[16]],\n \"signIn.rateLimited\": [[], [30], [300]],\n \"register.rateLimited\": [[], [30], [300]],\n \"forgotPassword.rateLimited\": [[], [30], [300]],\n \"resetPassword.rateLimited\": [[], [30], [300]],\n \"verifyEmail.rateLimited\": [[], [30], [300]],\n \"emailChange.emailTagUse\": [[\"{{address}}\"]],\n \"emailChange.pending\": [[\"{{newEmail}}\"]],\n \"emailChange.pendingHint\": [[\"{{currentEmail}}\"]],\n \"emailChange.confirmed\": [[\"{{email}}\"]],\n \"emailChange.rateLimited\": [[], [30], [300]],\n \"sessions.lastActive\": [[\"{{when}}\"]],\n \"sessions.ip\": [[\"{{address}}\"]],\n \"sessions.revokeItem\": [[\"{{device}}\"]],\n \"notifications.quietDescription\": [[false], [true], [false, true], [true, true]],\n \"notifications.quietZone\": [[\"{{zone}}\"]],\n \"notifications.bellUnread\": one,\n \"notifications.iosInstall\": [[\"{{app}}\"]],\n \"notifications.testSent\": one,\n \"notifications.explainerBody\": [[\"{{app}}\"]],\n \"notifications.added\": [[\"{{date}}\"]],\n \"notifications.lastDelivery\": [[\"{{date}}\"]],\n \"notifications.failures\": one,\n \"notifications.removeItem\": [[\"{{device}}\"]],\n \"notifications.unsubscribeAbout\": [[\"{{type}}\"]],\n \"notifications.stopAll\": [[\"{{app}}\"]],\n \"notifications.stoppedAll\": [[\"{{app}}\"]],\n \"deleteAccount.afterDays\": [[1], [30]],\n \"deleteAccount.handOver\": [[1], [3]],\n \"deleteAccount.lastAdminOf\": [[\"{{companies}}\"]],\n \"deleteAccount.rateLimited\": [[], [30], [300]],\n \"dataExport.rateLimited\": [[], [30], [300]],\n \"userRoster.actionsFor\": [[\"{{name}}\"]],\n \"roleSelect.roleOf\": [[\"{{name}}\"]],\n \"roleSelect.unavailable\": [[\"{{role}}\", \"{{reason}}\"]],\n \"adminActionLog.by\": [[\"{{actor}}\"]],\n \"adminActionLog.filteredTo\": [[\"{{target}}\"]],\n \"adminActionLog.filterBy\": [[\"{{target}}\"]],\n // 0.45.0 (admin §9.4): a company rename that logged both names.\n \"adminActionLog.renamedFromTo\": [[\"{{from}}\", \"{{to}}\"]],\n \"transferOwnership.title\": [[\"{{name}}\"]],\n \"transferOwnership.unavailable\": [[\"{{account}}\", \"{{reason}}\"]],\n \"invitations.sent\": [[\"{{date}}\"]],\n \"invitations.expires\": [[\"{{date}}\"]],\n \"invitations.invitedBy\": [[\"{{name}}\"]],\n \"invitations.resend\": [[\"{{email}}\"]],\n \"invitations.revoke\": [[\"{{email}}\"]],\n \"invitations.linkReady\": [[\"{{email}}\"]],\n \"invitations.notSent\": [[\"{{email}}\"]],\n \"accountState.deletionOn\": [[\"{{date}}\"]],\n // 0.31.0: the settings shell, the landing page and the demo\n // (docs/settings-harmonization.md, docs/landing-demo-harmonization.md). An optional\n // argument both given and left out: the subject without an app name, the refusal\n // without a `Retry-After`.\n \"settings.noMatches\": [[\"{{query}}\"]],\n \"settings.matchCount\": one,\n \"landing.accessSubject\": [[\"{{app}}\"], [undefined]],\n \"demo.rateLimited\": [[], [1], [3]],\n \"demo.hoursLeft\": [\n [1, 1],\n [3, 12],\n ],\n \"demo.minutesLeft\": one,\n // 0.32.0: the subscription parts (docs/billing-harmonization.md §7). A trial or a grant\n // ending today, tomorrow and in five days; the guest's notice with and without the\n // item's name.\n \"billing.choose\": [[\"{{plan}}\"]],\n \"billing.upgrade\": [[\"{{plan}}\"]],\n \"billing.downgrade\": [[\"{{plan}}\"]],\n \"billing.trialEnding\": [[0], [1], [5]],\n \"billing.grantEnding\": [[0], [1], [5]],\n \"billing.guestReadOnly\": [[\"{{item}}\"], [undefined]],\n \"billing.usage\": [[\"{{used}}\", \"{{limit}}\"]],\n \"billing.contactSubject\": [[\"{{dimension}}\"]],\n \"billing.waitingChanges\": one,\n // 0.33.0: the limit's figure line (§14.11) and the operator's plan parts (§14.12).\n \"billing.limitUsageLine\": [[\"{{dimension}}\", \"{{used}}\", \"{{limit}}\"]],\n // 0.39: PlanSwitchConfirm's two lines with figures (§15.2.10).\n \"billing.switchFromTo\": [[\"{{from}}\", \"{{to}}\"]],\n \"billing.switchNextCharge\": [[\"{{date}}\"]],\n // 0.42 (§16): the buyer's name, or none once they are gone; the cancel's period end.\n \"billing.buyerHolds\": [[\"{{buyer}}\"], [undefined]],\n \"billing.paymentFailedAskBuyer\": [[\"{{buyer}}\"], [undefined]],\n \"billing.cancelConfirmBody\": [[\"{{date}}\"]],\n \"billing.portalOpensNewTab\": [[\"{{provider}}\", \"{{app}}\"], [\"{{provider}}\", undefined]],\n \"planChange.current\": [[\"{{plan}}\"]],\n \"planChange.changed\": [[\"{{from}}\", \"{{to}}\"]],\n \"planChange.set\": [[\"{{to}}\"]],\n \"planChange.untilDone\": [[\"{{date}}\"]],\n \"planChange.usageOf\": [[\"{{used}}\", \"{{limit}}\", \"{{dimension}}\"]],\n // 0.42.0 (docs/admin-harmonization.md §3.1): the menu row's count, the 403 page's app,\n // the users tile's new accounts.\n \"adminArea.waiting\": one,\n // 0.45.0 (admin §9.3.4): an IconButton's name with its waiting count.\n \"adminArea.waitingLabel\": [[\"{{label}}\", 1], [\"{{label}}\", 3]],\n // 0.45.0 (admin §9.2.4): the test mail's transport, masked address and limiter.\n \"mailTestCard.transport\": [[\"{{backend}}\"]],\n \"mailTestCard.sent\": [[\"{{address}}\"]],\n \"mailTestCard.rateLimited\": [[], [30], [300]],\n \"adminArea.forbiddenBody\": [[\"{{app}}\"]],\n \"adminArea.tiles.usersNew\": one,\n // 0.42.0 (docs/top-bar-harmonization.md §3.1): the sync indicator's counts, its time, the\n // state joined to its hint or to the app's scope; the dev plan and the role to go back to.\n \"topBarParts.sync.blocked\": one,\n \"topBarParts.sync.pending\": one,\n \"topBarParts.sync.syncedAt\": [[\"{{time}}\"]],\n \"topBarParts.sync.withHint\": [[\"{{state}}\", \"{{hint}}\"]],\n \"topBarParts.sync.scoped\": [[\"{{scope}}\", \"{{state}}\"]],\n \"topBarParts.sync.waitingShort\": one,\n \"topBarParts.dev.plan\": [[\"{{plan}}\"]],\n \"topBarParts.dev.backTo\": [[\"{{role}}\"]],\n // 0.43.0 (docs/tours-harmonization.md §3, §8): the tours page's counts, its group\n // option, the completion day and a reset's day and reason.\n \"tourCatalogue.groupAll\": one,\n \"tourCatalogue.groupOption\": [[\"{{group}}\", 1], [\"{{group}}\", 3]],\n \"tourCatalogue.stateAll\": one,\n \"tourCatalogue.stateTodo\": one,\n \"tourCatalogue.stateDone\": one,\n \"tourCatalogue.showing\": [[3, 16]],\n \"tourCatalogue.resetOn\": [[\"{{date}}\", \"{{reason}}\"]],\n \"tourCatalogue.points\": one,\n \"tourCatalogue.steps\": one,\n \"tourCatalogue.duration\": one,\n \"tourCatalogue.completedOn\": [[\"{{date}}\"]],\n // 0.45.0 (docs/local-first-harmonization.md §1.6): the sign-out question's count, in\n // both word sets.\n \"signOutPending.lost\": one,\n \"signOutPending.kept\": one,\n};\n"],"mappings":";AAAA,SAAS,yBAAyB;AAwC3B,SAAS,gBAAgB,QAAqB,UAAkC,CAAC,GAA2B;AACjH,QAAM,MAA8B,CAAC;AACrC,QAAM,WAAW,QAAQ,YAAY,kBAAkB,QAAQ,UAAU,QAAQ,MAAM;AACvF,QAAM,OAAO,CAAC,MAAe,SAAiB;AAC5C,QAAI,OAAO,SAAS,UAAU;AAC5B,UAAI,IAAI,IAAI;AAAA,IACd,WAAW,OAAO,SAAS,YAAY;AACrC,iBAAW,QAAQ,kBAAkB,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG;AAGlD,cAAM,SAAS,WAAW,KAAK,IAAI,CAAC,QAAS,QAAQ,wBAAwB,WAAW,GAAI,IAA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CAAC,CAAC,UAAU,CAAC;AAAA;AAAA;AAAA,EAG1C,uBAAuB;AAAA,EACvB,uBAAuB;AACzB;","names":[]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A component's `data-*` props, for its root element (0.50, keksdose): `data-tour`,
3
+ * `data-testid` and the like reach the DOM even when the props are not spread there
4
+ * whole. TypeScript does not check hyphenated JSX attributes, so without this a
5
+ * `data-tour` on such a component vanished without an error.
6
+ */
7
+ export type DataAttributes = {
8
+ [attribute: `data-${string}`]: string | number | boolean | undefined;
9
+ };
10
+ /** Only the `data-*` entries of `props`. */
11
+ export declare function dataAttributes(props: object): DataAttributes;
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ function dataAttributes(props) {
3
+ const out = {};
4
+ for (const [k, v] of Object.entries(props)) if (k.startsWith("data-")) out[k] = v;
5
+ return out;
6
+ }
7
+ export {
8
+ dataAttributes
9
+ };
10
+ //# sourceMappingURL=data-attributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/data-attributes.ts"],"sourcesContent":["/**\n * A component's `data-*` props, for its root element (0.50, keksdose): `data-tour`,\n * `data-testid` and the like reach the DOM even when the props are not spread there\n * whole. TypeScript does not check hyphenated JSX attributes, so without this a\n * `data-tour` on such a component vanished without an error.\n */\nexport type DataAttributes = { [attribute: `data-${string}`]: string | number | boolean | undefined };\n\n/** Only the `data-*` entries of `props`. */\nexport function dataAttributes(props: object): DataAttributes {\n const out: DataAttributes = {};\n for (const [k, v] of Object.entries(props)) if (k.startsWith(\"data-\")) out[k as `data-${string}`] = v;\n return out;\n}\n"],"mappings":";AASO,SAAS,eAAe,OAA+B;AAC5D,QAAM,MAAsB,CAAC;AAC7B,aAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,KAAK,EAAG,KAAI,EAAE,WAAW,OAAO,EAAG,KAAI,CAAqB,IAAI;AACpG,SAAO;AACT;","names":[]}
@@ -1,5 +1,6 @@
1
1
  import { type MinusStyle } from "./minus.js";
2
2
  export type { MinusStyle } from "./minus.js";
3
+ export { formatWithMinus } from "./minus.js";
3
4
  /**
4
5
  * Number, money, percentage, date and relative-time formatting — `Intl`, in one place,
5
6
  * for the figures an app prints OUTSIDE a kit component.
@@ -4,6 +4,7 @@ import { useKitLocale, useKitTimeZone } from "../i18n/kit-labels.js";
4
4
  import { parseIsoDate } from "./dates.js";
5
5
  import { formatWithMinus } from "./minus.js";
6
6
  import { roundHalfAway } from "./round.js";
7
+ import { formatWithMinus as formatWithMinus2 } from "./minus.js";
7
8
  const EMPTY_FORMATTED_VALUE = "\u2014";
8
9
  const UNIT_SEPARATOR = "\u202F";
9
10
  const numberFormatters = /* @__PURE__ */ new Map();
@@ -211,6 +212,7 @@ export {
211
212
  formatNumber,
212
213
  formatPercent,
213
214
  formatRelativeTime,
215
+ formatWithMinus2 as formatWithMinus,
214
216
  roundToCurrency,
215
217
  toDate,
216
218
  useKitFormat
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/format.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useKitLocale, useKitTimeZone } from \"../i18n/kit-labels\";\nimport { parseIsoDate } from \"./dates\";\nimport { formatWithMinus, type MinusStyle } from \"./minus\";\nimport { roundHalfAway } from \"./round\";\n\nexport type { MinusStyle } from \"./minus\";\n\n/**\n * Number, money, percentage, date and relative-time formatting — `Intl`, in one place,\n * for the figures an app prints OUTSIDE a kit component.\n *\n * Each app grew its own: kastlan's `utils/formatters.ts` (a Swiss-pinned\n * `formatNumber`/`formatCurrency`, a date-fns `formatDate`, and a `formatRelativeTime`\n * whose \"5m ago\" / \"3h ago\" / \"2d ago\" stayed English in every language), its tenancy\n * `format.ts` (`formatChf`, a `formatPct` gluing a \"+\" onto `toFixed(2)`), keksdose's\n * own set. Every one of them is `Intl` with a locale bolted on, so the only thing\n * worth sharing is the locale — and the kit already has one, the provider's.\n *\n * The plain functions take a `locale` (none: the runtime default, as every `Intl` API\n * reads `undefined`). Inside a component, {@link useKitFormat} hands back the same\n * functions bound to the `<UiKitProvider locale>`, so a page formats exactly like the\n * kit components on it.\n *\n * A missing value — `null`, `undefined`, an unparseable date — formats as `empty`\n * (default \"—\", the dash `StatTile` shows for no value), never as \"NaN\" or \"Invalid\n * Date\". A number may also arrive as a numeric STRING (0.49, KIT-2) — \"1850.00\", \"-12.5\",\n * \"0\": a Decimal field off a Python API — and is formatted like the number. Anything\n * else (a non-numeric string, an object, `NaN`, ±`Infinity`) prints `empty` too, but is\n * a bug upstream rather than a gap in the data, so a development build says so on the\n * console, once per call site. Zero is a figure: `0` and `\"0\"` print \"CHF 0.00\", never\n * the dash.\n *\n * A negative figure carries the typographic minus, U+2212 (0.49, KIT-1), in every\n * locale — `Intl` writes a hyphen in most. `minus: \"ascii\"` for text a machine reads\n * back (a CSV, the clipboard).\n */\n\n/** What every formatter here prints for a missing value, unless told otherwise. */\nexport const EMPTY_FORMATTED_VALUE = \"—\";\n\n/** Fraction digits: a number pins both the minimum and the maximum (`2` → \"3.10\");\n * an object sets them apart (a meter reading, 1–3). */\nexport type FormatDigits = number | { min?: number; max?: number };\n\ninterface BaseOptions {\n /** BCP 47 tag. Left out: the runtime default (the hook: the provider's). */\n locale?: string;\n /** Printed for a missing value. Default {@link EMPTY_FORMATTED_VALUE}. */\n empty?: string;\n}\n\n/** The options every number formatter shares (money and percent carry their own unit). */\nexport interface FormatNumberBaseOptions extends BaseOptions {\n digits?: FormatDigits;\n /** Compact notation: 12 400 → \"12K\". */\n compact?: boolean;\n /** `\"exceptZero\"` for a change (\"+3\", \"−3\", \"0\"). Default: the minus only. */\n signDisplay?: Intl.NumberFormatOptions[\"signDisplay\"];\n /** Any further `Intl.NumberFormat` options, merged over the ones above. */\n options?: Intl.NumberFormatOptions;\n /**\n * The minus sign of a negative figure (0.49, KIT-1). `\"typographic\"` (default):\n * U+2212, as wide as \"+\" and the digits, as `SignedAmount` prints it — in every\n * locale, also where `Intl` writes a hyphen. `\"ascii\"`: U+002D, for an export a\n * machine parses back (a CSV download, the clipboard) — there, also pass\n * `options: { useGrouping: false }` or write the raw number.\n */\n minus?: MinusStyle;\n}\n\n/** The options {@link formatNumber} takes: the shared ones plus a free-text `unit`. */\nexport interface FormatNumberOptions extends FormatNumberBaseOptions {\n /**\n * A unit printed after the figure, joined by a narrow no-break space (U+202F):\n * \"3.400 N\", \"12 kg\", \"4,5 m²\". lenkbank (P8) prints forces, masses and lengths in\n * every table and summary, and each call site glued `${n} N` together with a plain\n * space — which wraps the \"N\" onto the next line in a narrow column and reads loose\n * beside the digit grouping. The narrow no-break space is the SI brochure's and the\n * Swiss typesetting rule's separator between value and unit, and it never breaks.\n *\n * Free text, not `Intl`'s `style: \"unit\"`: that one only knows the ECMA-402\n * sanctioned units (no \"N\", no \"kN\", no \"m³/h\"), so an app would still be gluing.\n * A missing value prints `empty` ALONE — \"— N\" says there is a newton-shaped\n * nothing, which is noise in a column that already heads its unit.\n */\n unit?: string;\n}\n\n/** Narrow no-break space (U+202F): between a figure and its {@link FormatNumberOptions.unit}. */\nconst UNIT_SEPARATOR = \"\\u202F\";\n\nexport interface FormatMoneyOptions extends FormatNumberBaseOptions {\n /** `\"symbol\"` (default), `\"narrowSymbol\"`, `\"code\"` (\"CHF 12.00\") or `\"name\"`. */\n currencyDisplay?: Intl.NumberFormatOptions[\"currencyDisplay\"];\n}\n\nexport interface FormatPercentOptions extends FormatNumberBaseOptions {\n /**\n * `true` (default): `value` is a RATIO, as `Intl` and `StatTile`'s percent delta read\n * it — `0.12` is 12 %. `false`: it is already a percentage — `12` is 12 %\n * (kastlan's rent `change_pct`).\n */\n ratio?: boolean;\n}\n\n// One formatter per option set: a table formats the same way thousands of times, and\n// constructing an Intl formatter is the expensive part.\nconst numberFormatters = new Map<string, Intl.NumberFormat>();\nfunction numberFormatter(locale: string | undefined, options: Intl.NumberFormatOptions): Intl.NumberFormat {\n const key = `${locale ?? \"\"}|${JSON.stringify(options)}`;\n let f = numberFormatters.get(key);\n if (!f) {\n f = new Intl.NumberFormat(locale, options);\n numberFormatters.set(key, f);\n }\n return f;\n}\n\nfunction digitOptions(digits: FormatDigits | undefined): Intl.NumberFormatOptions {\n if (digits === undefined) return {};\n if (typeof digits === \"number\") return { minimumFractionDigits: digits, maximumFractionDigits: digits };\n return {\n ...(digits.min !== undefined ? { minimumFractionDigits: digits.min } : null),\n ...(digits.max !== undefined ? { maximumFractionDigits: digits.max } : null),\n };\n}\n\nfunction numberOptions(o: FormatNumberBaseOptions): Intl.NumberFormatOptions {\n return {\n ...digitOptions(o.digits),\n ...(o.compact ? { notation: \"compact\" } : null),\n ...(o.signDisplay ? { signDisplay: o.signDisplay } : null),\n ...o.options,\n };\n}\n\n/**\n * What the number formatters take (0.49, KIT-2): a number, a numeric string (\"1850.00\",\n * \"-12.5\", \"1e3\" — what a Decimal arrives as in JSON), or `null` / `undefined` for no\n * value. A string is read with `Number()`, so a figure with more significant digits than\n * a double holds (about 15–17) is printed as its nearest double.\n */\nexport type FormattableNumber = number | string | null | undefined;\n\n/** A plain decimal: optional sign, digits with an optional point, an optional exponent.\n * No grouping marks, no decimal comma, no currency — those are formatted text, and\n * reading them back is a locale's guess. */\nconst NUMERIC_STRING = /^[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][+-]?\\d+)?$/;\n\n/** The kit's dev switch, as `lib/logger.ts` reads it: a development build, never a\n * production one (the consumer's bundler makes `import.meta.env.DEV` false) and never\n * under vitest. Read per call so a test can switch it on with `vi.stubEnv`. */\nfunction devWarnings(): boolean {\n return Boolean(import.meta.env?.DEV) && !import.meta.env?.VITEST;\n}\n\nconst warnedSites = new Set<string>();\n/** This module's own frames, skipped to find the caller (\"Object.formatMoney\" is a\n * `useKitFormat` wrapper). */\nconst OWN_FRAME = /\\b(?:formatNumber|formatMoney|formatPercent|toFormattable|warnInvalid|callSite)\\b/;\n\n/** The first stack frame outside the formatters: where the bad value was passed. */\nfunction callSite(): string {\n const frames = (new Error().stack ?? \"\").split(\"\\n\").slice(1);\n return frames.find((frame) => !OWN_FRAME.test(frame))?.trim() ?? \"\";\n}\n\nfunction describeValue(value: unknown): string {\n if (typeof value === \"number\" || typeof value === \"bigint\" || typeof value === \"boolean\") return String(value);\n try {\n return JSON.stringify(value) ?? String(value);\n } catch {\n return Object.prototype.toString.call(value);\n }\n}\n\n/** A development build's console note about an invalid value — once per call site. */\nfunction warnInvalid(fn: string, value: unknown): void {\n if (!devWarnings()) return;\n const site = callSite();\n const key = `${fn}|${site || typeof value}`;\n if (warnedSites.has(key)) return;\n warnedSites.add(key);\n const type = Array.isArray(value) ? \"array\" : typeof value;\n console.warn(\n `[ui-kit] ${fn} got ${describeValue(value)} (${type}), which is not a number: printed the empty value. ` +\n \"Pass a number, a numeric string, or null/undefined for a missing value.\" +\n (site ? `\\n at ${site.replace(/^at /, \"\")}` : \"\"),\n );\n}\n\n/**\n * `value` as a finite number to format, or `undefined` to print `empty`. `null` and\n * `undefined` are a missing value and pass quietly; anything that is neither a finite\n * number nor a numeric string is an invalid one — ±Infinity included (lenkbank, adopting\n * 0.13: a division by zero upstream; \"∞\" in a money column reads like data) — and a\n * development build warns. `-0` is folded into `0`: zero carries no sign.\n */\nfunction toFormattable(fn: string, value: unknown): number | undefined {\n if (value === null || value === undefined) return undefined;\n let n: number | undefined;\n if (typeof value === \"number\") n = value;\n else if (typeof value === \"string\" && NUMERIC_STRING.test(value.trim())) n = Number(value.trim());\n if (n === undefined || !Number.isFinite(n)) {\n warnInvalid(fn, value);\n return undefined;\n }\n return n + 0;\n}\n\n/** A number in `locale`: \"1,234.5\", \"1.234,5\", \"1’234.5\" — with `unit`, \"3.400 N\". */\nexport function formatNumber(value: FormattableNumber, options: FormatNumberOptions = {}): string {\n const n = toFormattable(\"formatNumber\", value);\n if (n === undefined) return options.empty ?? EMPTY_FORMATTED_VALUE;\n const figure = formatWithMinus(numberFormatter(options.locale, numberOptions(options)), n, options.minus);\n return options.unit ? `${figure}${UNIT_SEPARATOR}${options.unit}` : figure;\n}\n\n/** An amount of `currency` (ISO 4217) in `locale`: \"CHF 1’234.50\", \"1.234,50 €\". */\nexport function formatMoney(value: FormattableNumber, currency: string, options: FormatMoneyOptions = {}): string {\n const n = toFormattable(\"formatMoney\", value);\n if (n === undefined) return options.empty ?? EMPTY_FORMATTED_VALUE;\n const formatter = numberFormatter(options.locale, {\n style: \"currency\",\n currency,\n ...(options.currencyDisplay ? { currencyDisplay: options.currencyDisplay } : null),\n ...numberOptions(options),\n });\n return formatWithMinus(formatter, n, options.minus);\n}\n\n/** A percentage in `locale` (\"12%\", \"12 %\", \"+1.25%\"). See {@link FormatPercentOptions.ratio}\n * for what `value` means. Default digits: at most one. */\nexport function formatPercent(value: FormattableNumber, options: FormatPercentOptions = {}): string {\n const n = toFormattable(\"formatPercent\", value);\n if (n === undefined) return options.empty ?? EMPTY_FORMATTED_VALUE;\n const ratio = options.ratio === false ? n / 100 : n;\n const formatter = numberFormatter(options.locale, {\n style: \"percent\",\n ...(options.digits === undefined ? { maximumFractionDigits: 1 } : null),\n ...numberOptions(options),\n });\n return formatWithMinus(formatter, ratio, options.minus);\n}\n\n/* ── Dates ─────────────────────────────────────────────────────────────────── */\n\n/**\n * The shapes a date is printed in, each a set of `Intl.DateTimeFormat` options:\n * - `short` / `medium` / `long` / `full` — the date alone, at that `dateStyle`\n * (\"08/07/2026\", \"8 Jul 2026\", \"8 July 2026\", \"Wednesday, 8 July 2026\" in en-GB).\n * - `dateTime` — medium date and short time: a timestamp (\"8 Jul 2026, 14:05\").\n * - `time` — the short time alone (\"14:05\").\n * - `monthYear` — \"July 2026\".\n *\n * Or pass `Intl.DateTimeFormatOptions` for anything else. A date-fns PATTERN\n * (\"dd.MM.yyyy\") is deliberately not accepted: a pattern is one locale's order baked\n * into a string, which is how an English page ends up with German dates.\n */\nexport type FormatDateStyle = \"short\" | \"medium\" | \"long\" | \"full\" | \"dateTime\" | \"time\" | \"monthYear\";\n\nconst DATE_STYLES: Record<FormatDateStyle, Intl.DateTimeFormatOptions> = {\n short: { dateStyle: \"short\" },\n medium: { dateStyle: \"medium\" },\n long: { dateStyle: \"long\" },\n full: { dateStyle: \"full\" },\n dateTime: { dateStyle: \"medium\", timeStyle: \"short\" },\n time: { timeStyle: \"short\" },\n monthYear: { month: \"long\", year: \"numeric\" },\n};\n\nexport interface FormatDateOptions extends BaseOptions {\n /** An IANA zone (\"Europe/Zurich\") for a timestamp. Left out: the device's. A bare\n * \"YYYY-MM-DD\" ignores it: a calendar day is the day it names in every zone. */\n timeZone?: string;\n}\n\n/** A bare ISO calendar day, `\"YYYY-MM-DD\"`. */\nconst BARE_ISO_DAY = /^\\d{4}-\\d{2}-\\d{2}$/;\n\n/** What {@link formatDate} and {@link formatRelativeTime} accept. */\nexport type DateInput = string | number | Date | null | undefined;\n\n/**\n * `value` as a Date, or null. A bare \"YYYY-MM-DD\" is a CALENDAR day and is read on the\n * local calendar (`parseIsoDate`) — `new Date(\"2026-07-08\")` is UTC midnight, which is\n * the 7th anywhere west of Greenwich. Anything else (a full ISO timestamp, epoch\n * milliseconds, a Date) is an instant and goes through `Date` as is.\n */\nexport function toDate(value: DateInput): Date | null {\n if (value === null || value === undefined || value === \"\") return null;\n if (typeof value === \"string\" && BARE_ISO_DAY.test(value)) return parseIsoDate(value);\n const d = value instanceof Date ? value : new Date(value);\n return Number.isNaN(d.getTime()) ? null : d;\n}\n\nconst dateFormatters = new Map<string, Intl.DateTimeFormat>();\nfunction dateFormatter(locale: string | undefined, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n const key = `${locale ?? \"\"}|${JSON.stringify(options)}`;\n let f = dateFormatters.get(key);\n if (!f) {\n f = new Intl.DateTimeFormat(locale, options);\n dateFormatters.set(key, f);\n }\n return f;\n}\n\n/**\n * A date or timestamp in `locale`. Takes an ISO date (\"2026-07-08\", read on the local\n * calendar), an ISO timestamp (\"2026-07-08T14:05:00Z\"), epoch milliseconds or a Date.\n * `style` defaults to `medium`; see {@link FormatDateStyle}.\n *\n * `formatIsoDate` (`@eifi1/ui-kit/dates`) remains for a plain \"YYYY-MM-DD\" with an\n * explicit locale; this is its superset for timestamps and the named styles.\n */\nexport function formatDate(\n value: DateInput,\n style: FormatDateStyle | Intl.DateTimeFormatOptions = \"medium\",\n options: FormatDateOptions = {},\n): string {\n const d = toDate(value);\n if (!d) return options.empty ?? EMPTY_FORMATTED_VALUE;\n const base = typeof style === \"string\" ? DATE_STYLES[style] : style;\n // A bare \"YYYY-MM-DD\" is a calendar day, which has no zone: it is the day it names\n // wherever it is read, so a `timeZone` (in `options` or the style) never moves it — the\n // device's local midnight shown in a zone west of it was the day before (round 0.45, N9).\n if (typeof value === \"string\" && BARE_ISO_DAY.test(value)) {\n const day = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));\n return dateFormatter(options.locale, { ...base, timeZone: \"UTC\" }).format(day);\n }\n return dateFormatter(options.locale, options.timeZone ? { ...base, timeZone: options.timeZone } : base).format(d);\n}\n\nexport interface FormatRelativeTimeOptions extends BaseOptions {\n /** The zone of the date printed past `absoluteAfterDays` (0.46). Left out: the\n * device's. */\n timeZone?: string;\n /** The moment it is measured from. Default: now. */\n now?: DateInput;\n /** `\"auto\"` (default): \"yesterday\", \"now\", \"next week\". `\"always\"`: \"1 day ago\". */\n numeric?: Intl.RelativeTimeFormatNumeric;\n /** `\"long\"` (default) \"3 hours ago\", `\"short\"` \"3 hr. ago\", `\"narrow\"` \"3h ago\". */\n style?: Intl.RelativeTimeFormatStyle;\n /**\n * Past this many days either way, print the date instead ({@link formatDate} in\n * `absoluteStyle`) — kastlan's feed switches to the date after a week, because \"5\n * weeks ago\" makes a reader do sums. Default: never.\n */\n absoluteAfterDays?: number;\n /** The style of that date. Default `medium`. */\n absoluteStyle?: FormatDateStyle | Intl.DateTimeFormatOptions;\n}\n\nconst SECOND = 1000;\nconst MINUTE = 60 * SECOND;\nconst HOUR = 60 * MINUTE;\nconst DAY = 24 * HOUR;\n\n/** [the largest |difference| a unit is used for, the unit, its length]. */\nconst RELATIVE_STEPS: Array<[number, Intl.RelativeTimeFormatUnit, number]> = [\n [45 * SECOND, \"second\", SECOND],\n [45 * MINUTE, \"minute\", MINUTE],\n [22 * HOUR, \"hour\", HOUR],\n [6.5 * DAY, \"day\", DAY],\n [26 * DAY, \"week\", 7 * DAY],\n [320 * DAY, \"month\", 30.44 * DAY],\n [Infinity, \"year\", 365.25 * DAY],\n];\n\nconst relativeFormatters = new Map<string, Intl.RelativeTimeFormat>();\nfunction relativeFormatter(\n locale: string | undefined,\n numeric: Intl.RelativeTimeFormatNumeric,\n style: Intl.RelativeTimeFormatStyle,\n): Intl.RelativeTimeFormat {\n const key = `${locale ?? \"\"}|${numeric}|${style}`;\n let f = relativeFormatters.get(key);\n if (!f) {\n f = new Intl.RelativeTimeFormat(locale, { numeric, style });\n relativeFormatters.set(key, f);\n }\n return f;\n}\n\n/**\n * How long ago (or until) `value` is, in `locale`'s words, through\n * `Intl.RelativeTimeFormat`: \"3 hours ago\", \"vor 3 Stunden\", \"il y a 3 heures\",\n * \"in 2 days\", and under 45 seconds \"now\". The unit is picked by size — seconds,\n * minutes, hours, days, weeks, months, years — and the count is rounded.\n */\nexport function formatRelativeTime(value: DateInput, options: FormatRelativeTimeOptions = {}): string {\n const d = toDate(value);\n if (!d) return options.empty ?? EMPTY_FORMATTED_VALUE;\n const now = toDate(options.now ?? new Date()) ?? new Date();\n const diff = d.getTime() - now.getTime();\n const abs = Math.abs(diff);\n if (options.absoluteAfterDays !== undefined && abs > options.absoluteAfterDays * DAY) {\n return formatDate(d, options.absoluteStyle ?? \"medium\", options);\n }\n const rtf = relativeFormatter(options.locale, options.numeric ?? \"auto\", options.style ?? \"long\");\n const [, unit, size] = RELATIVE_STEPS.find(([limit]) => abs < limit)!;\n // Under 45 seconds is \"now\" rather than \"12 seconds ago\": a feed that ticks through\n // the seconds is noise, and nothing reads a timestamp to the second.\n const count = unit === \"second\" ? 0 : Math.round(diff / size);\n // `+ 0` folds -0 into 0: `format(-0, …)` says \"0 seconds ago\" instead of \"now\".\n return rtf.format(count + 0, unit);\n}\n\n/* ── Bound to the provider ─────────────────────────────────────────────────── */\n\ntype WithoutLocale<T> = Omit<T, \"locale\"> & { locale?: string };\n\n/** What {@link useKitFormat} returns: the formatters above with the provider's locale\n * as their default (an explicit `locale` in the options still wins). */\nexport interface KitFormat {\n /** The locale they format in — the provider's, or `undefined` (runtime default). */\n locale: string | undefined;\n formatNumber: (value: FormattableNumber, options?: WithoutLocale<FormatNumberOptions>) => string;\n formatMoney: (value: FormattableNumber, currency: string, options?: WithoutLocale<FormatMoneyOptions>) => string;\n formatPercent: (value: FormattableNumber, options?: WithoutLocale<FormatPercentOptions>) => string;\n formatDate: (\n value: DateInput,\n style?: FormatDateStyle | Intl.DateTimeFormatOptions,\n options?: WithoutLocale<FormatDateOptions>,\n ) => string;\n formatRelativeTime: (value: DateInput, options?: WithoutLocale<FormatRelativeTimeOptions>) => string;\n}\n\n/**\n * The formatters, bound to the `<UiKitProvider locale>` (or to `locale`, which wins\n * over it — the same precedence as a component's `locale` prop):\n *\n * const { formatMoney, formatRelativeTime } = useKitFormat();\n * formatMoney(row.balance, \"CHF\");\n */\nexport function useKitFormat(locale?: string): KitFormat {\n const kitLocale = useKitLocale(locale);\n // 0.46 (§10.3): the provider's `timeZone` for timestamps; a call's own wins, and a bare\n // \"YYYY-MM-DD\" ignores it (formatDate).\n const timeZone = useKitTimeZone();\n return useMemo<KitFormat>(\n () => ({\n locale: kitLocale,\n formatNumber: (value, options) => formatNumber(value, { locale: kitLocale, ...options }),\n formatMoney: (value, currency, options) => formatMoney(value, currency, { locale: kitLocale, ...options }),\n formatPercent: (value, options) => formatPercent(value, { locale: kitLocale, ...options }),\n formatDate: (value, style, options) => formatDate(value, style, { locale: kitLocale, timeZone, ...options }),\n formatRelativeTime: (value, options) => formatRelativeTime(value, { locale: kitLocale, timeZone, ...options }),\n }),\n [kitLocale, timeZone],\n );\n}\n\n/* ── Currency minor units ──────────────────────────────────────────────────── */\n\n/**\n * The decimals a currency is written with — its minor unit: CHF and EUR 2, JPY 0,\n * KWD 3 — from `Intl`, or `undefined` for a code `Intl` does not accept. The rule\n * AmountInput settles a typed figure by, for a host that needs it outside the field.\n */\nexport function currencyMinorDigits(currency: string | null | undefined): number | undefined {\n if (!currency) return undefined;\n try {\n return new Intl.NumberFormat(\"en\", { style: \"currency\", currency }).resolvedOptions().maximumFractionDigits;\n } catch {\n return undefined;\n }\n}\n\n/** The options form of {@link roundToCurrency}'s third argument. */\nexport interface RoundToCurrencyOptions {\n /** Decimals to round to, whatever the currency — the plain `digits` argument. */\n digits?: number;\n /**\n * Decimals for a currency `Intl` cannot resolve — no code yet (`null`, `\"\"`), or a\n * malformed one (\"EURO\", \"€\"). Left out, such a value comes back unchanged, as\n * before. Note that `Intl` resolves ANY well-formed three-letter code, a made-up\n * \"XYZ\" included (to 2), so this is the case of a missing or broken code, not of a\n * rare currency.\n */\n fallbackDigits?: number;\n}\n\n/**\n * `value` rounded to the currency's minor unit (or to `digits`), half away from zero,\n * in decimal arithmetic: 93.4213 CHF → 93.42, 1.005 EUR → 1.01 (`Math.round(1.005 *\n * 100)` is 100, since 1.005 is 1.00499… in binary). A non-finite value, or a currency\n * `Intl` does not know without `digits`, comes back unchanged (keksdose live #356: an\n * FX estimate set into an AmountInput showed four decimals) — unless the options form\n * gives `fallbackDigits`: `roundToCurrency(v, code, { fallbackDigits: 2 })` rounds a\n * figure whose currency is not chosen yet to cents rather than leaving 0.1 + 0.2 as is.\n * A finite value never comes back NaN or -0, however small or large (BUG-11):\n * 0.1 + 0.2 - 0.3 → 0, -0.004 → 0.\n */\nexport function roundToCurrency(\n value: number,\n currency: string | null | undefined,\n digits?: number | RoundToCurrencyOptions,\n): number {\n const options = typeof digits === \"object\" && digits !== null ? digits : { digits };\n const places = options.digits ?? currencyMinorDigits(currency) ?? options.fallbackDigits;\n if (places === undefined) return value;\n return roundHalfAway(value, places);\n}\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,cAAc,sBAAsB;AA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 {"version":3,"sources":["../../src/lib/format.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useKitLocale, useKitTimeZone } from \"../i18n/kit-labels\";\nimport { parseIsoDate } from \"./dates\";\nimport { formatWithMinus, type MinusStyle } from \"./minus\";\nimport { roundHalfAway } from \"./round\";\n\nexport type { MinusStyle } from \"./minus\";\n// 0.50 (KIT-1 follow-up): the kit's minus for an app's OWN `Intl.NumberFormat` wrapper.\nexport { formatWithMinus } from \"./minus\";\n\n/**\n * Number, money, percentage, date and relative-time formatting — `Intl`, in one place,\n * for the figures an app prints OUTSIDE a kit component.\n *\n * Each app grew its own: kastlan's `utils/formatters.ts` (a Swiss-pinned\n * `formatNumber`/`formatCurrency`, a date-fns `formatDate`, and a `formatRelativeTime`\n * whose \"5m ago\" / \"3h ago\" / \"2d ago\" stayed English in every language), its tenancy\n * `format.ts` (`formatChf`, a `formatPct` gluing a \"+\" onto `toFixed(2)`), keksdose's\n * own set. Every one of them is `Intl` with a locale bolted on, so the only thing\n * worth sharing is the locale — and the kit already has one, the provider's.\n *\n * The plain functions take a `locale` (none: the runtime default, as every `Intl` API\n * reads `undefined`). Inside a component, {@link useKitFormat} hands back the same\n * functions bound to the `<UiKitProvider locale>`, so a page formats exactly like the\n * kit components on it.\n *\n * A missing value — `null`, `undefined`, an unparseable date — formats as `empty`\n * (default \"—\", the dash `StatTile` shows for no value), never as \"NaN\" or \"Invalid\n * Date\". A number may also arrive as a numeric STRING (0.49, KIT-2) — \"1850.00\", \"-12.5\",\n * \"0\": a Decimal field off a Python API — and is formatted like the number. Anything\n * else (a non-numeric string, an object, `NaN`, ±`Infinity`) prints `empty` too, but is\n * a bug upstream rather than a gap in the data, so a development build says so on the\n * console, once per call site. Zero is a figure: `0` and `\"0\"` print \"CHF 0.00\", never\n * the dash.\n *\n * A negative figure carries the typographic minus, U+2212 (0.49, KIT-1), in every\n * locale — `Intl` writes a hyphen in most. `minus: \"ascii\"` for text a machine reads\n * back (a CSV, the clipboard).\n */\n\n/** What every formatter here prints for a missing value, unless told otherwise. */\nexport const EMPTY_FORMATTED_VALUE = \"—\";\n\n/** Fraction digits: a number pins both the minimum and the maximum (`2` → \"3.10\");\n * an object sets them apart (a meter reading, 1–3). */\nexport type FormatDigits = number | { min?: number; max?: number };\n\ninterface BaseOptions {\n /** BCP 47 tag. Left out: the runtime default (the hook: the provider's). */\n locale?: string;\n /** Printed for a missing value. Default {@link EMPTY_FORMATTED_VALUE}. */\n empty?: string;\n}\n\n/** The options every number formatter shares (money and percent carry their own unit). */\nexport interface FormatNumberBaseOptions extends BaseOptions {\n digits?: FormatDigits;\n /** Compact notation: 12 400 → \"12K\". */\n compact?: boolean;\n /** `\"exceptZero\"` for a change (\"+3\", \"−3\", \"0\"). Default: the minus only. */\n signDisplay?: Intl.NumberFormatOptions[\"signDisplay\"];\n /** Any further `Intl.NumberFormat` options, merged over the ones above. */\n options?: Intl.NumberFormatOptions;\n /**\n * The minus sign of a negative figure (0.49, KIT-1). `\"typographic\"` (default):\n * U+2212, as wide as \"+\" and the digits, as `SignedAmount` prints it — in every\n * locale, also where `Intl` writes a hyphen. `\"ascii\"`: U+002D, for an export a\n * machine parses back (a CSV download, the clipboard) — there, also pass\n * `options: { useGrouping: false }` or write the raw number.\n */\n minus?: MinusStyle;\n}\n\n/** The options {@link formatNumber} takes: the shared ones plus a free-text `unit`. */\nexport interface FormatNumberOptions extends FormatNumberBaseOptions {\n /**\n * A unit printed after the figure, joined by a narrow no-break space (U+202F):\n * \"3.400 N\", \"12 kg\", \"4,5 m²\". lenkbank (P8) prints forces, masses and lengths in\n * every table and summary, and each call site glued `${n} N` together with a plain\n * space — which wraps the \"N\" onto the next line in a narrow column and reads loose\n * beside the digit grouping. The narrow no-break space is the SI brochure's and the\n * Swiss typesetting rule's separator between value and unit, and it never breaks.\n *\n * Free text, not `Intl`'s `style: \"unit\"`: that one only knows the ECMA-402\n * sanctioned units (no \"N\", no \"kN\", no \"m³/h\"), so an app would still be gluing.\n * A missing value prints `empty` ALONE — \"— N\" says there is a newton-shaped\n * nothing, which is noise in a column that already heads its unit.\n */\n unit?: string;\n}\n\n/** Narrow no-break space (U+202F): between a figure and its {@link FormatNumberOptions.unit}. */\nconst UNIT_SEPARATOR = \"\\u202F\";\n\nexport interface FormatMoneyOptions extends FormatNumberBaseOptions {\n /** `\"symbol\"` (default), `\"narrowSymbol\"`, `\"code\"` (\"CHF 12.00\") or `\"name\"`. */\n currencyDisplay?: Intl.NumberFormatOptions[\"currencyDisplay\"];\n}\n\nexport interface FormatPercentOptions extends FormatNumberBaseOptions {\n /**\n * `true` (default): `value` is a RATIO, as `Intl` and `StatTile`'s percent delta read\n * it — `0.12` is 12 %. `false`: it is already a percentage — `12` is 12 %\n * (kastlan's rent `change_pct`).\n */\n ratio?: boolean;\n}\n\n// One formatter per option set: a table formats the same way thousands of times, and\n// constructing an Intl formatter is the expensive part.\nconst numberFormatters = new Map<string, Intl.NumberFormat>();\nfunction numberFormatter(locale: string | undefined, options: Intl.NumberFormatOptions): Intl.NumberFormat {\n const key = `${locale ?? \"\"}|${JSON.stringify(options)}`;\n let f = numberFormatters.get(key);\n if (!f) {\n f = new Intl.NumberFormat(locale, options);\n numberFormatters.set(key, f);\n }\n return f;\n}\n\nfunction digitOptions(digits: FormatDigits | undefined): Intl.NumberFormatOptions {\n if (digits === undefined) return {};\n if (typeof digits === \"number\") return { minimumFractionDigits: digits, maximumFractionDigits: digits };\n return {\n ...(digits.min !== undefined ? { minimumFractionDigits: digits.min } : null),\n ...(digits.max !== undefined ? { maximumFractionDigits: digits.max } : null),\n };\n}\n\nfunction numberOptions(o: FormatNumberBaseOptions): Intl.NumberFormatOptions {\n return {\n ...digitOptions(o.digits),\n ...(o.compact ? { notation: \"compact\" } : null),\n ...(o.signDisplay ? { signDisplay: o.signDisplay } : null),\n ...o.options,\n };\n}\n\n/**\n * What the number formatters take (0.49, KIT-2): a number, a numeric string (\"1850.00\",\n * \"-12.5\", \"1e3\" — what a Decimal arrives as in JSON), or `null` / `undefined` for no\n * value. A string is read with `Number()`, so a figure with more significant digits than\n * a double holds (about 15–17) is printed as its nearest double.\n */\nexport type FormattableNumber = number | string | null | undefined;\n\n/** A plain decimal: optional sign, digits with an optional point, an optional exponent.\n * No grouping marks, no decimal comma, no currency — those are formatted text, and\n * reading them back is a locale's guess. */\nconst NUMERIC_STRING = /^[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][+-]?\\d+)?$/;\n\n/** The kit's dev switch, as `lib/logger.ts` reads it: a development build, never a\n * production one (the consumer's bundler makes `import.meta.env.DEV` false) and never\n * under vitest. Read per call so a test can switch it on with `vi.stubEnv`. */\nfunction devWarnings(): boolean {\n return Boolean(import.meta.env?.DEV) && !import.meta.env?.VITEST;\n}\n\nconst warnedSites = new Set<string>();\n/** This module's own frames, skipped to find the caller (\"Object.formatMoney\" is a\n * `useKitFormat` wrapper). */\nconst OWN_FRAME = /\\b(?:formatNumber|formatMoney|formatPercent|toFormattable|warnInvalid|callSite)\\b/;\n\n/** The first stack frame outside the formatters: where the bad value was passed. */\nfunction callSite(): string {\n const frames = (new Error().stack ?? \"\").split(\"\\n\").slice(1);\n return frames.find((frame) => !OWN_FRAME.test(frame))?.trim() ?? \"\";\n}\n\nfunction describeValue(value: unknown): string {\n if (typeof value === \"number\" || typeof value === \"bigint\" || typeof value === \"boolean\") return String(value);\n try {\n return JSON.stringify(value) ?? String(value);\n } catch {\n return Object.prototype.toString.call(value);\n }\n}\n\n/** A development build's console note about an invalid value — once per call site. */\nfunction warnInvalid(fn: string, value: unknown): void {\n if (!devWarnings()) return;\n const site = callSite();\n const key = `${fn}|${site || typeof value}`;\n if (warnedSites.has(key)) return;\n warnedSites.add(key);\n const type = Array.isArray(value) ? \"array\" : typeof value;\n console.warn(\n `[ui-kit] ${fn} got ${describeValue(value)} (${type}), which is not a number: printed the empty value. ` +\n \"Pass a number, a numeric string, or null/undefined for a missing value.\" +\n (site ? `\\n at ${site.replace(/^at /, \"\")}` : \"\"),\n );\n}\n\n/**\n * `value` as a finite number to format, or `undefined` to print `empty`. `null` and\n * `undefined` are a missing value and pass quietly; anything that is neither a finite\n * number nor a numeric string is an invalid one — ±Infinity included (lenkbank, adopting\n * 0.13: a division by zero upstream; \"∞\" in a money column reads like data) — and a\n * development build warns. `-0` is folded into `0`: zero carries no sign.\n */\nfunction toFormattable(fn: string, value: unknown): number | undefined {\n if (value === null || value === undefined) return undefined;\n let n: number | undefined;\n if (typeof value === \"number\") n = value;\n else if (typeof value === \"string\" && NUMERIC_STRING.test(value.trim())) n = Number(value.trim());\n if (n === undefined || !Number.isFinite(n)) {\n warnInvalid(fn, value);\n return undefined;\n }\n return n + 0;\n}\n\n/** A number in `locale`: \"1,234.5\", \"1.234,5\", \"1’234.5\" — with `unit`, \"3.400 N\". */\nexport function formatNumber(value: FormattableNumber, options: FormatNumberOptions = {}): string {\n const n = toFormattable(\"formatNumber\", value);\n if (n === undefined) return options.empty ?? EMPTY_FORMATTED_VALUE;\n const figure = formatWithMinus(numberFormatter(options.locale, numberOptions(options)), n, options.minus);\n return options.unit ? `${figure}${UNIT_SEPARATOR}${options.unit}` : figure;\n}\n\n/** An amount of `currency` (ISO 4217) in `locale`: \"CHF 1’234.50\", \"1.234,50 €\". */\nexport function formatMoney(value: FormattableNumber, currency: string, options: FormatMoneyOptions = {}): string {\n const n = toFormattable(\"formatMoney\", value);\n if (n === undefined) return options.empty ?? EMPTY_FORMATTED_VALUE;\n const formatter = numberFormatter(options.locale, {\n style: \"currency\",\n currency,\n ...(options.currencyDisplay ? { currencyDisplay: options.currencyDisplay } : null),\n ...numberOptions(options),\n });\n return formatWithMinus(formatter, n, options.minus);\n}\n\n/** A percentage in `locale` (\"12%\", \"12 %\", \"+1.25%\"). See {@link FormatPercentOptions.ratio}\n * for what `value` means. Default digits: at most one. */\nexport function formatPercent(value: FormattableNumber, options: FormatPercentOptions = {}): string {\n const n = toFormattable(\"formatPercent\", value);\n if (n === undefined) return options.empty ?? EMPTY_FORMATTED_VALUE;\n const ratio = options.ratio === false ? n / 100 : n;\n const formatter = numberFormatter(options.locale, {\n style: \"percent\",\n ...(options.digits === undefined ? { maximumFractionDigits: 1 } : null),\n ...numberOptions(options),\n });\n return formatWithMinus(formatter, ratio, options.minus);\n}\n\n/* ── Dates ─────────────────────────────────────────────────────────────────── */\n\n/**\n * The shapes a date is printed in, each a set of `Intl.DateTimeFormat` options:\n * - `short` / `medium` / `long` / `full` — the date alone, at that `dateStyle`\n * (\"08/07/2026\", \"8 Jul 2026\", \"8 July 2026\", \"Wednesday, 8 July 2026\" in en-GB).\n * - `dateTime` — medium date and short time: a timestamp (\"8 Jul 2026, 14:05\").\n * - `time` — the short time alone (\"14:05\").\n * - `monthYear` — \"July 2026\".\n *\n * Or pass `Intl.DateTimeFormatOptions` for anything else. A date-fns PATTERN\n * (\"dd.MM.yyyy\") is deliberately not accepted: a pattern is one locale's order baked\n * into a string, which is how an English page ends up with German dates.\n */\nexport type FormatDateStyle = \"short\" | \"medium\" | \"long\" | \"full\" | \"dateTime\" | \"time\" | \"monthYear\";\n\nconst DATE_STYLES: Record<FormatDateStyle, Intl.DateTimeFormatOptions> = {\n short: { dateStyle: \"short\" },\n medium: { dateStyle: \"medium\" },\n long: { dateStyle: \"long\" },\n full: { dateStyle: \"full\" },\n dateTime: { dateStyle: \"medium\", timeStyle: \"short\" },\n time: { timeStyle: \"short\" },\n monthYear: { month: \"long\", year: \"numeric\" },\n};\n\nexport interface FormatDateOptions extends BaseOptions {\n /** An IANA zone (\"Europe/Zurich\") for a timestamp. Left out: the device's. A bare\n * \"YYYY-MM-DD\" ignores it: a calendar day is the day it names in every zone. */\n timeZone?: string;\n}\n\n/** A bare ISO calendar day, `\"YYYY-MM-DD\"`. */\nconst BARE_ISO_DAY = /^\\d{4}-\\d{2}-\\d{2}$/;\n\n/** What {@link formatDate} and {@link formatRelativeTime} accept. */\nexport type DateInput = string | number | Date | null | undefined;\n\n/**\n * `value` as a Date, or null. A bare \"YYYY-MM-DD\" is a CALENDAR day and is read on the\n * local calendar (`parseIsoDate`) — `new Date(\"2026-07-08\")` is UTC midnight, which is\n * the 7th anywhere west of Greenwich. Anything else (a full ISO timestamp, epoch\n * milliseconds, a Date) is an instant and goes through `Date` as is.\n */\nexport function toDate(value: DateInput): Date | null {\n if (value === null || value === undefined || value === \"\") return null;\n if (typeof value === \"string\" && BARE_ISO_DAY.test(value)) return parseIsoDate(value);\n const d = value instanceof Date ? value : new Date(value);\n return Number.isNaN(d.getTime()) ? null : d;\n}\n\nconst dateFormatters = new Map<string, Intl.DateTimeFormat>();\nfunction dateFormatter(locale: string | undefined, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n const key = `${locale ?? \"\"}|${JSON.stringify(options)}`;\n let f = dateFormatters.get(key);\n if (!f) {\n f = new Intl.DateTimeFormat(locale, options);\n dateFormatters.set(key, f);\n }\n return f;\n}\n\n/**\n * A date or timestamp in `locale`. Takes an ISO date (\"2026-07-08\", read on the local\n * calendar), an ISO timestamp (\"2026-07-08T14:05:00Z\"), epoch milliseconds or a Date.\n * `style` defaults to `medium`; see {@link FormatDateStyle}.\n *\n * `formatIsoDate` (`@eifi1/ui-kit/dates`) remains for a plain \"YYYY-MM-DD\" with an\n * explicit locale; this is its superset for timestamps and the named styles.\n */\nexport function formatDate(\n value: DateInput,\n style: FormatDateStyle | Intl.DateTimeFormatOptions = \"medium\",\n options: FormatDateOptions = {},\n): string {\n const d = toDate(value);\n if (!d) return options.empty ?? EMPTY_FORMATTED_VALUE;\n const base = typeof style === \"string\" ? DATE_STYLES[style] : style;\n // A bare \"YYYY-MM-DD\" is a calendar day, which has no zone: it is the day it names\n // wherever it is read, so a `timeZone` (in `options` or the style) never moves it — the\n // device's local midnight shown in a zone west of it was the day before (round 0.45, N9).\n if (typeof value === \"string\" && BARE_ISO_DAY.test(value)) {\n const day = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));\n return dateFormatter(options.locale, { ...base, timeZone: \"UTC\" }).format(day);\n }\n return dateFormatter(options.locale, options.timeZone ? { ...base, timeZone: options.timeZone } : base).format(d);\n}\n\nexport interface FormatRelativeTimeOptions extends BaseOptions {\n /** The zone of the date printed past `absoluteAfterDays` (0.46). Left out: the\n * device's. */\n timeZone?: string;\n /** The moment it is measured from. Default: now. */\n now?: DateInput;\n /** `\"auto\"` (default): \"yesterday\", \"now\", \"next week\". `\"always\"`: \"1 day ago\". */\n numeric?: Intl.RelativeTimeFormatNumeric;\n /** `\"long\"` (default) \"3 hours ago\", `\"short\"` \"3 hr. ago\", `\"narrow\"` \"3h ago\". */\n style?: Intl.RelativeTimeFormatStyle;\n /**\n * Past this many days either way, print the date instead ({@link formatDate} in\n * `absoluteStyle`) — kastlan's feed switches to the date after a week, because \"5\n * weeks ago\" makes a reader do sums. Default: never.\n */\n absoluteAfterDays?: number;\n /** The style of that date. Default `medium`. */\n absoluteStyle?: FormatDateStyle | Intl.DateTimeFormatOptions;\n}\n\nconst SECOND = 1000;\nconst MINUTE = 60 * SECOND;\nconst HOUR = 60 * MINUTE;\nconst DAY = 24 * HOUR;\n\n/** [the largest |difference| a unit is used for, the unit, its length]. */\nconst RELATIVE_STEPS: Array<[number, Intl.RelativeTimeFormatUnit, number]> = [\n [45 * SECOND, \"second\", SECOND],\n [45 * MINUTE, \"minute\", MINUTE],\n [22 * HOUR, \"hour\", HOUR],\n [6.5 * DAY, \"day\", DAY],\n [26 * DAY, \"week\", 7 * DAY],\n [320 * DAY, \"month\", 30.44 * DAY],\n [Infinity, \"year\", 365.25 * DAY],\n];\n\nconst relativeFormatters = new Map<string, Intl.RelativeTimeFormat>();\nfunction relativeFormatter(\n locale: string | undefined,\n numeric: Intl.RelativeTimeFormatNumeric,\n style: Intl.RelativeTimeFormatStyle,\n): Intl.RelativeTimeFormat {\n const key = `${locale ?? \"\"}|${numeric}|${style}`;\n let f = relativeFormatters.get(key);\n if (!f) {\n f = new Intl.RelativeTimeFormat(locale, { numeric, style });\n relativeFormatters.set(key, f);\n }\n return f;\n}\n\n/**\n * How long ago (or until) `value` is, in `locale`'s words, through\n * `Intl.RelativeTimeFormat`: \"3 hours ago\", \"vor 3 Stunden\", \"il y a 3 heures\",\n * \"in 2 days\", and under 45 seconds \"now\". The unit is picked by size — seconds,\n * minutes, hours, days, weeks, months, years — and the count is rounded.\n */\nexport function formatRelativeTime(value: DateInput, options: FormatRelativeTimeOptions = {}): string {\n const d = toDate(value);\n if (!d) return options.empty ?? EMPTY_FORMATTED_VALUE;\n const now = toDate(options.now ?? new Date()) ?? new Date();\n const diff = d.getTime() - now.getTime();\n const abs = Math.abs(diff);\n if (options.absoluteAfterDays !== undefined && abs > options.absoluteAfterDays * DAY) {\n return formatDate(d, options.absoluteStyle ?? \"medium\", options);\n }\n const rtf = relativeFormatter(options.locale, options.numeric ?? \"auto\", options.style ?? \"long\");\n const [, unit, size] = RELATIVE_STEPS.find(([limit]) => abs < limit)!;\n // Under 45 seconds is \"now\" rather than \"12 seconds ago\": a feed that ticks through\n // the seconds is noise, and nothing reads a timestamp to the second.\n const count = unit === \"second\" ? 0 : Math.round(diff / size);\n // `+ 0` folds -0 into 0: `format(-0, …)` says \"0 seconds ago\" instead of \"now\".\n return rtf.format(count + 0, unit);\n}\n\n/* ── Bound to the provider ─────────────────────────────────────────────────── */\n\ntype WithoutLocale<T> = Omit<T, \"locale\"> & { locale?: string };\n\n/** What {@link useKitFormat} returns: the formatters above with the provider's locale\n * as their default (an explicit `locale` in the options still wins). */\nexport interface KitFormat {\n /** The locale they format in — the provider's, or `undefined` (runtime default). */\n locale: string | undefined;\n formatNumber: (value: FormattableNumber, options?: WithoutLocale<FormatNumberOptions>) => string;\n formatMoney: (value: FormattableNumber, currency: string, options?: WithoutLocale<FormatMoneyOptions>) => string;\n formatPercent: (value: FormattableNumber, options?: WithoutLocale<FormatPercentOptions>) => string;\n formatDate: (\n value: DateInput,\n style?: FormatDateStyle | Intl.DateTimeFormatOptions,\n options?: WithoutLocale<FormatDateOptions>,\n ) => string;\n formatRelativeTime: (value: DateInput, options?: WithoutLocale<FormatRelativeTimeOptions>) => string;\n}\n\n/**\n * The formatters, bound to the `<UiKitProvider locale>` (or to `locale`, which wins\n * over it — the same precedence as a component's `locale` prop):\n *\n * const { formatMoney, formatRelativeTime } = useKitFormat();\n * formatMoney(row.balance, \"CHF\");\n */\nexport function useKitFormat(locale?: string): KitFormat {\n const kitLocale = useKitLocale(locale);\n // 0.46 (§10.3): the provider's `timeZone` for timestamps; a call's own wins, and a bare\n // \"YYYY-MM-DD\" ignores it (formatDate).\n const timeZone = useKitTimeZone();\n return useMemo<KitFormat>(\n () => ({\n locale: kitLocale,\n formatNumber: (value, options) => formatNumber(value, { locale: kitLocale, ...options }),\n formatMoney: (value, currency, options) => formatMoney(value, currency, { locale: kitLocale, ...options }),\n formatPercent: (value, options) => formatPercent(value, { locale: kitLocale, ...options }),\n formatDate: (value, style, options) => formatDate(value, style, { locale: kitLocale, timeZone, ...options }),\n formatRelativeTime: (value, options) => formatRelativeTime(value, { locale: kitLocale, timeZone, ...options }),\n }),\n [kitLocale, timeZone],\n );\n}\n\n/* ── Currency minor units ──────────────────────────────────────────────────── */\n\n/**\n * The decimals a currency is written with — its minor unit: CHF and EUR 2, JPY 0,\n * KWD 3 — from `Intl`, or `undefined` for a code `Intl` does not accept. The rule\n * AmountInput settles a typed figure by, for a host that needs it outside the field.\n */\nexport function currencyMinorDigits(currency: string | null | undefined): number | undefined {\n if (!currency) return undefined;\n try {\n return new Intl.NumberFormat(\"en\", { style: \"currency\", currency }).resolvedOptions().maximumFractionDigits;\n } catch {\n return undefined;\n }\n}\n\n/** The options form of {@link roundToCurrency}'s third argument. */\nexport interface RoundToCurrencyOptions {\n /** Decimals to round to, whatever the currency — the plain `digits` argument. */\n digits?: number;\n /**\n * Decimals for a currency `Intl` cannot resolve — no code yet (`null`, `\"\"`), or a\n * malformed one (\"EURO\", \"€\"). Left out, such a value comes back unchanged, as\n * before. Note that `Intl` resolves ANY well-formed three-letter code, a made-up\n * \"XYZ\" included (to 2), so this is the case of a missing or broken code, not of a\n * rare currency.\n */\n fallbackDigits?: number;\n}\n\n/**\n * `value` rounded to the currency's minor unit (or to `digits`), half away from zero,\n * in decimal arithmetic: 93.4213 CHF → 93.42, 1.005 EUR → 1.01 (`Math.round(1.005 *\n * 100)` is 100, since 1.005 is 1.00499… in binary). A non-finite value, or a currency\n * `Intl` does not know without `digits`, comes back unchanged (keksdose live #356: an\n * FX estimate set into an AmountInput showed four decimals) — unless the options form\n * gives `fallbackDigits`: `roundToCurrency(v, code, { fallbackDigits: 2 })` rounds a\n * figure whose currency is not chosen yet to cents rather than leaving 0.1 + 0.2 as is.\n * A finite value never comes back NaN or -0, however small or large (BUG-11):\n * 0.1 + 0.2 - 0.3 → 0, -0.004 → 0.\n */\nexport function roundToCurrency(\n value: number,\n currency: string | null | undefined,\n digits?: number | RoundToCurrencyOptions,\n): number {\n const options = typeof digits === \"object\" && digits !== null ? digits : { digits };\n const places = options.digits ?? currencyMinorDigits(currency) ?? options.fallbackDigits;\n if (places === undefined) return value;\n return roundHalfAway(value, places);\n}\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,cAAc,sBAAsB;AAC7C,SAAS,oBAAoB;AAC7B,SAAS,uBAAwC;AACjD,SAAS,qBAAqB;AAI9B,SAAS,mBAAAA,wBAAuB;AAiCzB,MAAM,wBAAwB;AAmDrC,MAAM,iBAAiB;AAkBvB,MAAM,mBAAmB,oBAAI,IAA+B;AAC5D,SAAS,gBAAgB,QAA4B,SAAsD;AACzG,QAAM,MAAM,GAAG,UAAU,EAAE,IAAI,KAAK,UAAU,OAAO,CAAC;AACtD,MAAI,IAAI,iBAAiB,IAAI,GAAG;AAChC,MAAI,CAAC,GAAG;AACN,QAAI,IAAI,KAAK,aAAa,QAAQ,OAAO;AACzC,qBAAiB,IAAI,KAAK,CAAC;AAAA,EAC7B;AACA,SAAO;AACT;AAEA,SAAS,aAAa,QAA4D;AAChF,MAAI,WAAW,OAAW,QAAO,CA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,YAAY,cAAc,OAAO,EAAE,QAAQ,WAAW,GAAG,QAAQ,CAAC;AAAA,MACzF,YAAY,CAAC,OAAO,OAAO,YAAY,WAAW,OAAO,OAAO,EAAE,QAAQ,WAAW,UAAU,GAAG,QAAQ,CAAC;AAAA,MAC3G,oBAAoB,CAAC,OAAO,YAAY,mBAAmB,OAAO,EAAE,QAAQ,WAAW,UAAU,GAAG,QAAQ,CAAC;AAAA,IAC/G;AAAA,IACA,CAAC,WAAW,QAAQ;AAAA,EACtB;AACF;AASO,SAAS,oBAAoB,UAAyD;AAC3F,MAAI,CAAC,SAAU,QAAO;AACtB,MAAI;AACF,WAAO,IAAI,KAAK,aAAa,MAAM,EAAE,OAAO,YAAY,SAAS,CAAC,EAAE,gBAAgB,EAAE;AAAA,EACxF,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AA2BO,SAAS,gBACd,OACA,UACA,QACQ;AACR,QAAM,UAAU,OAAO,WAAW,YAAY,WAAW,OAAO,SAAS,EAAE,OAAO;AAClF,QAAM,SAAS,QAAQ,UAAU,oBAAoB,QAAQ,KAAK,QAAQ;AAC1E,MAAI,WAAW,OAAW,QAAO;AACjC,SAAO,cAAc,OAAO,MAAM;AACpC;","names":["formatWithMinus"]}
@@ -18,5 +18,15 @@ export declare const TYPOGRAPHIC_MINUS = "\u2212";
18
18
  * `Intl` marks as a minus are touched — a hyphen inside a currency's name
19
19
  * ("Bosnia-Herzegovina convertible marks") stays — and only when the text holds the
20
20
  * other sign at all, so a positive figure costs no `formatToParts`.
21
+ *
22
+ * Public since 0.50 (the KIT-1 follow-up): an app that keeps its OWN `Intl.NumberFormat`
23
+ * wrapper (a currency with app-specific digits, a quantity) calls it in place of
24
+ * `formatter.format(value)`, so its negatives match the kit's "−". Where the wrapper only
25
+ * re-states `formatMoney` / `formatNumber`, route it through those instead.
26
+ *
27
+ * @example
28
+ * const eur = new Intl.NumberFormat("en", { style: "currency", currency: "EUR" });
29
+ * formatWithMinus(eur, -150); // "−€150.00"
30
+ * formatWithMinus(eur, -150, "ascii"); // "-€150.00", for a CSV
21
31
  */
22
32
  export declare function formatWithMinus(formatter: Intl.NumberFormat, value: number, minus?: MinusStyle): string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/minus.ts"],"sourcesContent":["/**\n * The one minus sign (0.49, KIT-1). `Intl.NumberFormat` writes a negative with the\n * HYPHEN-MINUS (U+002D) in nearly every locale — en, de-CH, fr, it, es, hu, zh — and\n * with the typographic MINUS SIGN (U+2212) in a few (sv, fi). The kit prints U+2212\n * everywhere, as `SignedAmount` always has: it is as wide as \"+\" and the tabular\n * digits, so a column of signed figures lines up, and it does not break a line the way\n * a hyphen may.\n *\n * `\"ascii\"` is the other way round, for text a machine reads back — a CSV, the\n * clipboard: every minus becomes U+002D, whatever the locale wrote, so `Number()` and a\n * spreadsheet parse it.\n */\nexport type MinusStyle = \"typographic\" | \"ascii\";\n\n/** U+2212 MINUS SIGN. */\nexport const TYPOGRAPHIC_MINUS = \"\\u2212\";\n\n/** The parts `formatToParts` writes a minus in (the exponent's, under `notation:\n * \"scientific\"`, too). */\nconst MINUS_PARTS: ReadonlySet<string> = new Set([\"minusSign\", \"exponentMinusSign\"]);\n\n/**\n * `formatter.format(value)` with every minus sign in `minus` style. Only the parts\n * `Intl` marks as a minus are touched — a hyphen inside a currency's name\n * (\"Bosnia-Herzegovina convertible marks\") stays — and only when the text holds the\n * other sign at all, so a positive figure costs no `formatToParts`.\n */\nexport function formatWithMinus(\n formatter: Intl.NumberFormat,\n value: number,\n minus: MinusStyle = \"typographic\",\n): string {\n const text = formatter.format(value);\n const [wanted, other] = minus === \"ascii\" ? [\"-\", TYPOGRAPHIC_MINUS] : [TYPOGRAPHIC_MINUS, \"-\"];\n if (!text.includes(other)) return text;\n return formatter\n .formatToParts(value)\n .map((part) => (MINUS_PARTS.has(part.type) ? wanted : part.value))\n .join(\"\");\n}\n"],"mappings":";AAeO,MAAM,oBAAoB;AAIjC,MAAM,cAAmC,oBAAI,IAAI,CAAC,aAAa,mBAAmB,CAAC;AAQ5E,SAAS,gBACd,WACA,OACA,QAAoB,eACZ;AACR,QAAM,OAAO,UAAU,OAAO,KAAK;AACnC,QAAM,CAAC,QAAQ,KAAK,IAAI,UAAU,UAAU,CAAC,KAAK,iBAAiB,IAAI,CAAC,mBAAmB,GAAG;AAC9F,MAAI,CAAC,KAAK,SAAS,KAAK,EAAG,QAAO;AAClC,SAAO,UACJ,cAAc,KAAK,EACnB,IAAI,CAAC,SAAU,YAAY,IAAI,KAAK,IAAI,IAAI,SAAS,KAAK,KAAM,EAChE,KAAK,EAAE;AACZ;","names":[]}
1
+ {"version":3,"sources":["../../src/lib/minus.ts"],"sourcesContent":["/**\n * The one minus sign (0.49, KIT-1). `Intl.NumberFormat` writes a negative with the\n * HYPHEN-MINUS (U+002D) in nearly every locale — en, de-CH, fr, it, es, hu, zh — and\n * with the typographic MINUS SIGN (U+2212) in a few (sv, fi). The kit prints U+2212\n * everywhere, as `SignedAmount` always has: it is as wide as \"+\" and the tabular\n * digits, so a column of signed figures lines up, and it does not break a line the way\n * a hyphen may.\n *\n * `\"ascii\"` is the other way round, for text a machine reads back — a CSV, the\n * clipboard: every minus becomes U+002D, whatever the locale wrote, so `Number()` and a\n * spreadsheet parse it.\n */\nexport type MinusStyle = \"typographic\" | \"ascii\";\n\n/** U+2212 MINUS SIGN. */\nexport const TYPOGRAPHIC_MINUS = \"\\u2212\";\n\n/** The parts `formatToParts` writes a minus in (the exponent's, under `notation:\n * \"scientific\"`, too). */\nconst MINUS_PARTS: ReadonlySet<string> = new Set([\"minusSign\", \"exponentMinusSign\"]);\n\n/**\n * `formatter.format(value)` with every minus sign in `minus` style. Only the parts\n * `Intl` marks as a minus are touched — a hyphen inside a currency's name\n * (\"Bosnia-Herzegovina convertible marks\") stays — and only when the text holds the\n * other sign at all, so a positive figure costs no `formatToParts`.\n *\n * Public since 0.50 (the KIT-1 follow-up): an app that keeps its OWN `Intl.NumberFormat`\n * wrapper (a currency with app-specific digits, a quantity) calls it in place of\n * `formatter.format(value)`, so its negatives match the kit's \"−\". Where the wrapper only\n * re-states `formatMoney` / `formatNumber`, route it through those instead.\n *\n * @example\n * const eur = new Intl.NumberFormat(\"en\", { style: \"currency\", currency: \"EUR\" });\n * formatWithMinus(eur, -150); // \"−€150.00\"\n * formatWithMinus(eur, -150, \"ascii\"); // \"-€150.00\", for a CSV\n */\nexport function formatWithMinus(\n formatter: Intl.NumberFormat,\n value: number,\n minus: MinusStyle = \"typographic\",\n): string {\n const text = formatter.format(value);\n const [wanted, other] = minus === \"ascii\" ? [\"-\", TYPOGRAPHIC_MINUS] : [TYPOGRAPHIC_MINUS, \"-\"];\n if (!text.includes(other)) return text;\n return formatter\n .formatToParts(value)\n .map((part) => (MINUS_PARTS.has(part.type) ? wanted : part.value))\n .join(\"\");\n}\n"],"mappings":";AAeO,MAAM,oBAAoB;AAIjC,MAAM,cAAmC,oBAAI,IAAI,CAAC,aAAa,mBAAmB,CAAC;AAkB5E,SAAS,gBACd,WACA,OACA,QAAoB,eACZ;AACR,QAAM,OAAO,UAAU,OAAO,KAAK;AACnC,QAAM,CAAC,QAAQ,KAAK,IAAI,UAAU,UAAU,CAAC,KAAK,iBAAiB,IAAI,CAAC,mBAAmB,GAAG;AAC9F,MAAI,CAAC,KAAK,SAAS,KAAK,EAAG,QAAO;AAClC,SAAO,UACJ,cAAc,KAAK,EACnB,IAAI,CAAC,SAAU,YAAY,IAAI,KAAK,IAAI,IAAI,SAAS,KAAK,KAAM,EAChE,KAAK,EAAE;AACZ;","names":[]}
@@ -0,0 +1,4 @@
1
+ /** `el.focus(options)`, telling the kit's open-on-focus pickers not to open. */
2
+ export declare function focusQuietly(el: HTMLElement, options?: FocusOptions): void;
3
+ /** True while `el` is being focused by {@link focusQuietly}. */
4
+ export declare function isQuietFocus(el: Element): boolean;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ let quiet = null;
3
+ function focusQuietly(el, options) {
4
+ const before = quiet;
5
+ quiet = el;
6
+ try {
7
+ el.focus(options);
8
+ } finally {
9
+ quiet = before;
10
+ }
11
+ }
12
+ function isQuietFocus(el) {
13
+ return quiet === el;
14
+ }
15
+ export {
16
+ focusQuietly,
17
+ isQuietFocus
18
+ };
19
+ //# sourceMappingURL=quiet-focus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/quiet-focus.ts"],"sourcesContent":["/**\n * Focus that is not a request to open anything (0.50.1, keksdose B1).\n *\n * A guided tour focuses a field step's first control on arrival (tours §11.8). The kit's\n * pickers that open their list on focus — Combobox (and the category pickers built on it),\n * Autocomplete, InlineEntityCombobox — opened it then too, and the list, a later layer\n * (§11.6), covered the tour card with its Next and \"Leave empty\".\n *\n * {@link focusQuietly} marks the element for the length of its synchronous `focus()` call;\n * a picker's `onFocus` asks {@link isQuietFocus} and, when it is, takes the focus without\n * opening. React dispatches `onFocus` inside the native `focusin`, which `focus()` fires\n * synchronously, so the mark is seen by exactly that focus and by no later one. A click or\n * Tab of the person's own opens as before; from a quiet focus, ArrowDown, typing or a click\n * opens the list.\n */\nlet quiet: Element | null = null;\n\n/** `el.focus(options)`, telling the kit's open-on-focus pickers not to open. */\nexport function focusQuietly(el: HTMLElement, options?: FocusOptions): void {\n const before = quiet;\n quiet = el;\n try {\n el.focus(options);\n } finally {\n quiet = before;\n }\n}\n\n/** True while `el` is being focused by {@link focusQuietly}. */\nexport function isQuietFocus(el: Element): boolean {\n return quiet === el;\n}\n"],"mappings":";AAeA,IAAI,QAAwB;AAGrB,SAAS,aAAa,IAAiB,SAA8B;AAC1E,QAAM,SAAS;AACf,UAAQ;AACR,MAAI;AACF,OAAG,MAAM,OAAO;AAAA,EAClB,UAAE;AACA,YAAQ;AAAA,EACV;AACF;AAGO,SAAS,aAAa,IAAsB;AACjD,SAAO,UAAU;AACnB;","names":[]}
@@ -1,2 +1,3 @@
1
1
  export { KIT_CSS_VARIABLES, declaredCustomProperties, undeclaredCssVariables, type UndeclaredCssVariablesOptions, } from "./css-variables.js";
2
2
  export { setViewportWidth, stubResizeObserver, stubViewportWidth, viewportMatchMedia, type ResizeObserverStub, type StubbedBoxSize, type ViewportOptions, } from "./viewport.js";
3
+ export { tourStepContext, type TestTourStepContext, type TourStepContextOptions, type TourStepVia, } from "./tour.js";
@@ -10,12 +10,16 @@ import {
10
10
  stubViewportWidth,
11
11
  viewportMatchMedia
12
12
  } from "./viewport.js";
13
+ import {
14
+ tourStepContext
15
+ } from "./tour.js";
13
16
  export {
14
17
  KIT_CSS_VARIABLES,
15
18
  declaredCustomProperties,
16
19
  setViewportWidth,
17
20
  stubResizeObserver,
18
21
  stubViewportWidth,
22
+ tourStepContext,
19
23
  undeclaredCssVariables,
20
24
  viewportMatchMedia
21
25
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/testing/index.ts"],"sourcesContent":["// `@eifi1/ui-kit/testing` — helpers an app runs from its OWN test suite (0.33).\n//\n// Not part of the main barrel: nothing here renders, and an app's production bundle has\n// no business carrying it. Browser-safe like the rest of the kit (no `node:fs`): each\n// helper takes texts, so an app collects them with `import.meta.glob` or `node:fs`, as\n// its setup allows. The first content is the guard against undeclared CSS custom\n// properties (docs/colour-roles-harmonization.md §8).\nexport {\n KIT_CSS_VARIABLES,\n declaredCustomProperties,\n undeclaredCssVariables,\n type UndeclaredCssVariablesOptions,\n} from \"./css-variables\";\n// 0.34 (refactor audit 2026-10, TST-10): the environment jsdom lacks — a `matchMedia`\n// that answers from a viewport width (right at every text size) and a `ResizeObserver`\n// the test drives. Framework-free: each returns its own undo. 0.35: `setViewportWidth`,\n// a live resize of the stub in force — its lists flip and fire `change` (keksdose).\nexport {\n setViewportWidth,\n stubResizeObserver,\n stubViewportWidth,\n viewportMatchMedia,\n type ResizeObserverStub,\n type StubbedBoxSize,\n type ViewportOptions,\n} from \"./viewport\";\n"],"mappings":";AAOA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAKP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;","names":[]}
1
+ {"version":3,"sources":["../../src/testing/index.ts"],"sourcesContent":["// `@eifi1/ui-kit/testing` — helpers an app runs from its OWN test suite (0.33).\n//\n// Not part of the main barrel: nothing here renders, and an app's production bundle has\n// no business carrying it. Browser-safe like the rest of the kit (no `node:fs`): each\n// helper takes texts, so an app collects them with `import.meta.glob` or `node:fs`, as\n// its setup allows. The first content is the guard against undeclared CSS custom\n// properties (docs/colour-roles-harmonization.md §8).\nexport {\n KIT_CSS_VARIABLES,\n declaredCustomProperties,\n undeclaredCssVariables,\n type UndeclaredCssVariablesOptions,\n} from \"./css-variables\";\n// 0.34 (refactor audit 2026-10, TST-10): the environment jsdom lacks — a `matchMedia`\n// that answers from a viewport width (right at every text size) and a `ResizeObserver`\n// the test drives. Framework-free: each returns its own undo. 0.35: `setViewportWidth`,\n// a live resize of the stub in force — its lists flip and fire `change` (keksdose).\nexport {\n setViewportWidth,\n stubResizeObserver,\n stubViewportWidth,\n viewportMatchMedia,\n type ResizeObserverStub,\n type StubbedBoxSize,\n type ViewportOptions,\n} from \"./viewport\";\n// 0.50.1 (keksdose N4): a valid `TourStepContext` for a test that calls a step's\n// `beforeStep` or `when` itself — `beforeStep!(tourStepContext())`.\nexport {\n tourStepContext,\n type TestTourStepContext,\n type TourStepContextOptions,\n type TourStepVia,\n} from \"./tour\";\n"],"mappings":";AAOA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAKP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAGP;AAAA,EACE;AAAA,OAIK;","names":[]}
@@ -0,0 +1,25 @@
1
+ /** The words of the row's "⋯" button, when the app's tests render translated kit labels. */
2
+ export interface RowMenuLabels {
3
+ /** The button's name on a row with no `name`. Default "Actions". */
4
+ actions?: string;
5
+ /** The button's name given the row's. Default `Actions for ${name}`. */
6
+ actionsFor?: (name: string) => string;
7
+ }
8
+ /**
9
+ * Open a row's "⋯" menu and find one of its actions — the entry, unclicked, so a test can
10
+ * check it (locked, described) before it clicks it.
11
+ *
12
+ * `row` is the row's name as the app gave it to `RowActions` / `rowActionsColumn` /
13
+ * `UserRoster` ("Actions for <row>"); `undefined` takes the FIRST "⋯" on the page, named
14
+ * or not. Since 0.49 (KIT-12) a `tone: "danger"` action lives in that menu rather than as
15
+ * an icon in the row, and at Large text every action does.
16
+ *
17
+ * The entries are BUTTONS in a dialog popover named like the "⋯" button — not `menuitem`s:
18
+ * `getByRole("menuitem")` finds nothing there. A danger action asks for confirmation once
19
+ * clicked (an `alertdialog`), unless the app turned that off.
20
+ *
21
+ * @example
22
+ * fireEvent.click(await rowMenuAction("Ada Example", "Delete"));
23
+ * fireEvent.click(await screen.findByRole("button", { name: "Confirm" }));
24
+ */
25
+ export declare function rowMenuAction(row: string | undefined, action: string | RegExp, labels?: RowMenuLabels): Promise<HTMLElement>;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { fireEvent, screen, within } from "@testing-library/react";
3
+ const ACTIONS = "Actions";
4
+ const ACTIONS_FOR = (name) => `Actions for ${name}`;
5
+ async function rowMenuAction(row, action, labels = {}) {
6
+ const actions = labels.actions ?? ACTIONS;
7
+ const actionsFor = labels.actionsFor ?? ACTIONS_FOR;
8
+ const [before, after] = actionsFor("\0").split("\0");
9
+ const anyRow = (name) => name === actions || name.length > before.length + after.length && name.startsWith(before) && name.endsWith(after);
10
+ const trigger = (await screen.findAllByRole("button", { name: row === void 0 ? anyRow : actionsFor(row) }))[0];
11
+ fireEvent.click(trigger);
12
+ const title = trigger.getAttribute("aria-label") ?? trigger.textContent ?? "";
13
+ const menu = await screen.findByRole("dialog", { name: title });
14
+ return within(menu).getByRole("button", { name: action });
15
+ }
16
+ export {
17
+ rowMenuAction
18
+ };
19
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/testing/react.ts"],"sourcesContent":["import { fireEvent, screen, within } from \"@testing-library/react\";\n\n// `@eifi1/ui-kit/testing/react` (0.50) — helpers that drive the kit's components through\n// Testing Library, from an app's own test suite.\n//\n// A sibling of `@eifi1/ui-kit/testing`, not part of it: that entry is pure (it reaches no\n// package, so it runs under node or jsdom alike), and this one needs\n// `@testing-library/react`, an optional peer only a test suite installs. Neither is part of\n// the barrel, so an app's production bundle never carries either.\n\n/** The words of the row's \"⋯\" button, when the app's tests render translated kit labels. */\nexport interface RowMenuLabels {\n /** The button's name on a row with no `name`. Default \"Actions\". */\n actions?: string;\n /** The button's name given the row's. Default `Actions for ${name}`. */\n actionsFor?: (name: string) => string;\n}\n\n// The kit's English defaults (DEFAULT_ROW_ACTIONS_LABELS, and the user roster's), written\n// out rather than imported: the label module's type import would walk this entry into the\n// components. src/testing/__tests__/react.test.tsx holds them equal.\nconst ACTIONS = \"Actions\";\nconst ACTIONS_FOR = (name: string) => `Actions for ${name}`;\n\n/**\n * Open a row's \"⋯\" menu and find one of its actions — the entry, unclicked, so a test can\n * check it (locked, described) before it clicks it.\n *\n * `row` is the row's name as the app gave it to `RowActions` / `rowActionsColumn` /\n * `UserRoster` (\"Actions for <row>\"); `undefined` takes the FIRST \"⋯\" on the page, named\n * or not. Since 0.49 (KIT-12) a `tone: \"danger\"` action lives in that menu rather than as\n * an icon in the row, and at Large text every action does.\n *\n * The entries are BUTTONS in a dialog popover named like the \"⋯\" button — not `menuitem`s:\n * `getByRole(\"menuitem\")` finds nothing there. A danger action asks for confirmation once\n * clicked (an `alertdialog`), unless the app turned that off.\n *\n * @example\n * fireEvent.click(await rowMenuAction(\"Ada Example\", \"Delete\"));\n * fireEvent.click(await screen.findByRole(\"button\", { name: \"Confirm\" }));\n */\nexport async function rowMenuAction(\n row: string | undefined,\n action: string | RegExp,\n labels: RowMenuLabels = {},\n): Promise<HTMLElement> {\n const actions = labels.actions ?? ACTIONS;\n const actionsFor = labels.actionsFor ?? ACTIONS_FOR;\n // Any row's name: the words around the name, whatever the language puts first.\n const [before, after] = actionsFor(\"\\u0000\").split(\"\\u0000\");\n const anyRow = (name: string) =>\n name === actions ||\n (name.length > before.length + after.length && name.startsWith(before) && name.endsWith(after));\n const trigger = (await screen.findAllByRole(\"button\", { name: row === undefined ? anyRow : actionsFor(row) }))[0];\n fireEvent.click(trigger);\n const title = trigger.getAttribute(\"aria-label\") ?? trigger.textContent ?? \"\";\n const menu = await screen.findByRole(\"dialog\", { name: title });\n return within(menu).getByRole(\"button\", { name: action });\n}\n"],"mappings":";AAAA,SAAS,WAAW,QAAQ,cAAc;AAqB1C,MAAM,UAAU;AAChB,MAAM,cAAc,CAAC,SAAiB,eAAe,IAAI;AAmBzD,eAAsB,cACpB,KACA,QACA,SAAwB,CAAC,GACH;AACtB,QAAM,UAAU,OAAO,WAAW;AAClC,QAAM,aAAa,OAAO,cAAc;AAExC,QAAM,CAAC,QAAQ,KAAK,IAAI,WAAW,IAAQ,EAAE,MAAM,IAAQ;AAC3D,QAAM,SAAS,CAAC,SACd,SAAS,WACR,KAAK,SAAS,OAAO,SAAS,MAAM,UAAU,KAAK,WAAW,MAAM,KAAK,KAAK,SAAS,KAAK;AAC/F,QAAM,WAAW,MAAM,OAAO,cAAc,UAAU,EAAE,MAAM,QAAQ,SAAY,SAAS,WAAW,GAAG,EAAE,CAAC,GAAG,CAAC;AAChH,YAAU,MAAM,OAAO;AACvB,QAAM,QAAQ,QAAQ,aAAa,YAAY,KAAK,QAAQ,eAAe;AAC3E,QAAM,OAAO,MAAM,OAAO,WAAW,UAAU,EAAE,MAAM,MAAM,CAAC;AAC9D,SAAO,OAAO,IAAI,EAAE,UAAU,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1D;","names":[]}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * 0.50.1 (keksdose N4): a `TourStepContext` for a test that calls a step's `beforeStep` or
3
+ * `when` itself. 0.50 gave both the context, so `beforeStep!()` is a type error;
4
+ * `beforeStep!(tourStepContext())` is the drop-in.
5
+ *
6
+ * Spelled out here rather than imported from the tour module, so `@eifi1/ui-kit/testing`
7
+ * still reaches no package (the tour module reaches React); the kit's own test pins that it
8
+ * is assignable to `TourStepContext`.
9
+ */
10
+ /** How a step is entered: `TourStepContext["via"]`. */
11
+ export type TourStepVia = "start" | "at" | "next" | "back" | "goto";
12
+ /** The shape of `TourStepContext` (`@eifi1/ui-kit/tour`). */
13
+ export interface TestTourStepContext {
14
+ gate(key: string): boolean | undefined;
15
+ via: TourStepVia;
16
+ }
17
+ export interface TourStepContextOptions {
18
+ /** How the step is entered. Default `"start"`. */
19
+ via?: TourStepVia;
20
+ /**
21
+ * The published gates, as the form would publish them: `{ "txn.transfer": true }`. A key
22
+ * left out answers `undefined` (nobody publishes it). Default: none.
23
+ */
24
+ gates?: Readonly<Record<string, boolean | undefined>>;
25
+ }
26
+ /**
27
+ * A valid step context: `via: "start"` and no gates published, unless `options` say
28
+ * otherwise. `step.beforeStep!(tourStepContext())`, `step.when!(tourStepContext({ gates:
29
+ * { "txn.transfer": true } }))`, `tourStepContext({ via: "at" })` for a "Guide me" entry.
30
+ */
31
+ export declare function tourStepContext(options?: TourStepContextOptions): TestTourStepContext;