@cosmicdrift/kumiko-renderer 0.328.0 → 0.329.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/dist/app/action-form-shim.d.ts +14 -0
  2. package/{src/app/action-form-shim.ts → dist/app/action-form-shim.js} +26 -46
  3. package/dist/app/app-features-context.d.ts +8 -0
  4. package/dist/app/app-features-context.js +16 -0
  5. package/dist/app/column-renderers.d.ts +30 -0
  6. package/dist/app/column-renderers.js +34 -0
  7. package/dist/app/config-edit-shim.d.ts +11 -0
  8. package/{src/app/config-edit-shim.ts → dist/app/config-edit-shim.js} +12 -25
  9. package/dist/app/content-editors.d.ts +38 -0
  10. package/dist/app/content-editors.js +26 -0
  11. package/dist/app/content-preview.d.ts +11 -0
  12. package/dist/app/content-preview.js +30 -0
  13. package/dist/app/custom-screens.d.ts +11 -0
  14. package/dist/app/custom-screens.js +20 -0
  15. package/dist/app/dashboard-body.d.ts +16 -0
  16. package/dist/app/dashboard-body.js +11 -0
  17. package/dist/app/extension-form-submit.d.ts +32 -0
  18. package/dist/app/extension-form-submit.js +73 -0
  19. package/dist/app/extension-sections.d.ts +72 -0
  20. package/dist/app/extension-sections.js +34 -0
  21. package/dist/app/feature-schema.d.ts +4 -0
  22. package/{src/app/feature-schema.ts → dist/app/feature-schema.js} +12 -22
  23. package/dist/app/form-schema.d.ts +4 -0
  24. package/dist/app/form-schema.js +85 -0
  25. package/dist/app/kumiko-screen.d.ts +43 -0
  26. package/dist/app/kumiko-screen.js +2206 -0
  27. package/dist/app/layout-fields.d.ts +3 -0
  28. package/dist/app/layout-fields.js +20 -0
  29. package/dist/app/list-facets.d.ts +48 -0
  30. package/dist/app/list-facets.js +185 -0
  31. package/dist/app/nav.d.ts +61 -0
  32. package/dist/app/nav.js +139 -0
  33. package/dist/app/projection-detail-shim.d.ts +8 -0
  34. package/dist/app/projection-detail-shim.js +71 -0
  35. package/dist/app/projection-list-shim.d.ts +13 -0
  36. package/{src/app/projection-list-shim.ts → dist/app/projection-list-shim.js} +26 -41
  37. package/dist/app/qn.d.ts +7 -0
  38. package/{src/app/qn.ts → dist/app/qn.js} +9 -11
  39. package/dist/app/qualify-screen-id.d.ts +2 -0
  40. package/{src/app/qualify-screen-id.ts → dist/app/qualify-screen-id.js} +5 -6
  41. package/dist/app/reference-facet-bridge.d.ts +10 -0
  42. package/dist/app/reference-facet-bridge.js +22 -0
  43. package/dist/app/return-to.d.ts +31 -0
  44. package/dist/app/return-to.js +188 -0
  45. package/dist/app/row-actions.d.ts +77 -0
  46. package/dist/app/row-actions.js +416 -0
  47. package/dist/app/screen-access.d.ts +8 -0
  48. package/dist/app/screen-access.js +48 -0
  49. package/dist/app/secret-mint-body.d.ts +10 -0
  50. package/dist/app/secret-mint-body.js +140 -0
  51. package/dist/app/secrets-edit-body.d.ts +8 -0
  52. package/dist/app/secrets-edit-body.js +76 -0
  53. package/dist/app/use-embedded-screen.d.ts +6 -0
  54. package/dist/app/use-embedded-screen.js +19 -0
  55. package/dist/app/variable-chips.d.ts +7 -0
  56. package/dist/app/variable-chips.js +16 -0
  57. package/dist/app/write-failed-error.d.ts +6 -0
  58. package/dist/app/write-failed-error.js +21 -0
  59. package/dist/components/embedded-list-field.d.ts +10 -0
  60. package/dist/components/embedded-list-field.js +259 -0
  61. package/dist/components/grid-cell-for-field.d.ts +25 -0
  62. package/dist/components/grid-cell-for-field.js +31 -0
  63. package/dist/components/multi-select-checkboxes.d.ts +14 -0
  64. package/dist/components/multi-select-checkboxes.js +36 -0
  65. package/dist/components/reference-create-dialog.d.ts +13 -0
  66. package/dist/components/reference-create-dialog.js +46 -0
  67. package/dist/components/related-list-section.d.ts +25 -0
  68. package/dist/components/related-list-section.js +273 -0
  69. package/dist/components/render-edit-action-button.d.ts +22 -0
  70. package/dist/components/render-edit-action-button.js +43 -0
  71. package/dist/components/render-edit-logic.d.ts +6 -0
  72. package/dist/components/render-edit-logic.js +63 -0
  73. package/dist/components/render-edit-types.d.ts +209 -0
  74. package/dist/components/render-edit-types.js +1 -0
  75. package/dist/components/render-edit.d.ts +6 -0
  76. package/dist/components/render-edit.js +1169 -0
  77. package/dist/components/render-field.d.ts +38 -0
  78. package/dist/components/render-field.js +544 -0
  79. package/dist/components/render-list.d.ts +117 -0
  80. package/dist/components/render-list.js +232 -0
  81. package/dist/components/write-form-section.d.ts +17 -0
  82. package/dist/components/write-form-section.js +104 -0
  83. package/dist/context/dispatcher-context.d.ts +10 -0
  84. package/{src/context/dispatcher-context.tsx → dist/context/dispatcher-context.js} +16 -29
  85. package/dist/context/draft-storage-context.d.ts +12 -0
  86. package/dist/context/draft-storage-context.js +18 -0
  87. package/dist/context/user-roles-context.d.ts +7 -0
  88. package/{src/context/user-roles-context.tsx → dist/context/user-roles-context.js} +7 -15
  89. package/dist/format-when.d.ts +1 -0
  90. package/{src/format-when.ts → dist/format-when.js} +7 -7
  91. package/dist/hooks/reference-limits.d.ts +3 -0
  92. package/{src/hooks/reference-limits.ts → dist/hooks/reference-limits.js} +0 -1
  93. package/dist/hooks/use-ai-text.d.ts +52 -0
  94. package/dist/hooks/use-ai-text.js +90 -0
  95. package/dist/hooks/use-disclosure.d.ts +7 -0
  96. package/dist/hooks/use-disclosure.js +8 -0
  97. package/dist/hooks/use-form.d.ts +7 -0
  98. package/dist/hooks/use-form.js +36 -0
  99. package/dist/hooks/use-list-url-state.d.ts +43 -0
  100. package/dist/hooks/use-list-url-state.js +131 -0
  101. package/dist/hooks/use-mutation.d.ts +9 -0
  102. package/dist/hooks/use-mutation.js +37 -0
  103. package/dist/hooks/use-query.d.ts +14 -0
  104. package/dist/hooks/use-query.js +118 -0
  105. package/dist/hooks/use-reference-lookup.d.ts +14 -0
  106. package/dist/hooks/use-reference-lookup.js +63 -0
  107. package/dist/hooks/use-store.d.ts +3 -0
  108. package/dist/hooks/use-store.js +38 -0
  109. package/dist/hooks/use-stream-handler.d.ts +14 -0
  110. package/dist/hooks/use-stream-handler.js +93 -0
  111. package/dist/i18n-defaults.d.ts +2 -0
  112. package/dist/i18n-defaults.js +201 -0
  113. package/dist/i18n.d.ts +64 -0
  114. package/dist/i18n.js +166 -0
  115. package/dist/index.d.ts +77 -0
  116. package/dist/index.js +55 -0
  117. package/dist/inside-drawer.d.ts +2 -0
  118. package/{src/inside-drawer.ts → dist/inside-drawer.js} +2 -5
  119. package/dist/page-header-slot.d.ts +2 -0
  120. package/{src/page-header-slot.ts → dist/page-header-slot.js} +2 -5
  121. package/dist/primitives.d.ts +1355 -0
  122. package/dist/primitives.js +73 -0
  123. package/dist/screen-fills-height.d.ts +3 -0
  124. package/dist/screen-fills-height.js +3 -0
  125. package/dist/share-links.d.ts +4 -0
  126. package/dist/share-links.js +11 -0
  127. package/dist/sort-by-accessor.d.ts +5 -0
  128. package/dist/sort-by-accessor.js +16 -0
  129. package/dist/sse/live-events.d.ts +23 -0
  130. package/dist/sse/live-events.js +28 -0
  131. package/dist/tokens.d.ts +83 -0
  132. package/dist/tokens.js +80 -0
  133. package/package.json +16 -9
  134. package/src/__tests__/error-i18n-defaults.test.ts +0 -82
  135. package/src/__tests__/format-when.test.ts +0 -12
  136. package/src/__tests__/i18n.test.tsx +0 -283
  137. package/src/__tests__/merge-search-params-into-initial.test.ts +0 -525
  138. package/src/__tests__/qn.test.ts +0 -83
  139. package/src/__tests__/share-links.test.ts +0 -26
  140. package/src/__tests__/sort-by-accessor.test.ts +0 -48
  141. package/src/__tests__/stringify-nav-params.test.ts +0 -33
  142. package/src/__tests__/use-list-url-state.test.tsx +0 -250
  143. package/src/app/__tests__/action-form-field-labels.test.tsx +0 -92
  144. package/src/app/__tests__/action-form-shim.test.ts +0 -137
  145. package/src/app/__tests__/build-list-query-payload.test.ts +0 -107
  146. package/src/app/__tests__/config-edit-shim.test.ts +0 -57
  147. package/src/app/__tests__/content-editors.test.tsx +0 -128
  148. package/src/app/__tests__/content-preview.test.tsx +0 -184
  149. package/src/app/__tests__/entity-edit-create-search-params.test.tsx +0 -236
  150. package/src/app/__tests__/entity-edit-fill-height.test.tsx +0 -118
  151. package/src/app/__tests__/entity-edit-jsonb-embedded-submit.test.tsx +0 -239
  152. package/src/app/__tests__/entity-list-create-singleton.test.tsx +0 -128
  153. package/src/app/__tests__/entity-list-row-action-entity-target.test.tsx +0 -424
  154. package/src/app/__tests__/entity-list-row-action-icon.test.tsx +0 -248
  155. package/src/app/__tests__/entity-list-row-action-kumiko-actions-view.test.tsx +0 -162
  156. package/src/app/__tests__/entity-list-row-action-refetch.test.tsx +0 -401
  157. package/src/app/__tests__/entity-list-screen-padding.test.tsx +0 -128
  158. package/src/app/__tests__/feature-schema.test.ts +0 -40
  159. package/src/app/__tests__/form-schema.test.ts +0 -247
  160. package/src/app/__tests__/list-daterange-facet.test.ts +0 -165
  161. package/src/app/__tests__/list-filter-facets.test.tsx +0 -521
  162. package/src/app/__tests__/nav.test.ts +0 -198
  163. package/src/app/__tests__/projection-detail-actions.test.tsx +0 -719
  164. package/src/app/__tests__/projection-detail-reference-field.test.tsx +0 -165
  165. package/src/app/__tests__/projection-detail-shim.test.ts +0 -188
  166. package/src/app/__tests__/projection-detail-singleton.test.tsx +0 -191
  167. package/src/app/__tests__/projection-list-bad-shape.test.tsx +0 -152
  168. package/src/app/__tests__/projection-list-reference-column.test.tsx +0 -219
  169. package/src/app/__tests__/projection-list-search-sort.test.tsx +0 -212
  170. package/src/app/__tests__/qualified-names.test.ts +0 -37
  171. package/src/app/__tests__/return-to.test.ts +0 -396
  172. package/src/app/__tests__/row-actions-navigate-tab.test.ts +0 -223
  173. package/src/app/__tests__/row-default-edit-action.test.tsx +0 -324
  174. package/src/app/__tests__/screen-access-allows.test.ts +0 -34
  175. package/src/app/__tests__/secret-mint-body.test.tsx +0 -404
  176. package/src/app/__tests__/variable-chips.test.tsx +0 -70
  177. package/src/app/app-features-context.tsx +0 -25
  178. package/src/app/column-renderers.tsx +0 -68
  179. package/src/app/content-editors.tsx +0 -85
  180. package/src/app/content-preview.tsx +0 -67
  181. package/src/app/custom-screens.tsx +0 -29
  182. package/src/app/dashboard-body.tsx +0 -33
  183. package/src/app/extension-form-submit.tsx +0 -123
  184. package/src/app/extension-sections.tsx +0 -111
  185. package/src/app/form-schema.ts +0 -91
  186. package/src/app/kumiko-screen.tsx +0 -3801
  187. package/src/app/layout-fields.ts +0 -31
  188. package/src/app/list-facets.ts +0 -259
  189. package/src/app/nav.tsx +0 -258
  190. package/src/app/projection-detail-shim.ts +0 -86
  191. package/src/app/reference-facet-bridge.tsx +0 -58
  192. package/src/app/return-to.tsx +0 -234
  193. package/src/app/row-actions.ts +0 -640
  194. package/src/app/screen-access.ts +0 -63
  195. package/src/app/secret-mint-body.tsx +0 -259
  196. package/src/app/secrets-edit-body.tsx +0 -194
  197. package/src/app/use-embedded-screen.ts +0 -27
  198. package/src/app/variable-chips.tsx +0 -39
  199. package/src/app/write-failed-error.ts +0 -27
  200. package/src/components/__tests__/embedded-list-field.test.tsx +0 -531
  201. package/src/components/__tests__/multi-select-checkboxes.test.tsx +0 -162
  202. package/src/components/__tests__/related-list-section-empty-state.test.tsx +0 -143
  203. package/src/components/__tests__/related-list-section.test.tsx +0 -1733
  204. package/src/components/__tests__/render-edit-action-button.test.tsx +0 -205
  205. package/src/components/__tests__/render-edit-hidden-section.test.tsx +0 -128
  206. package/src/components/__tests__/render-edit-logic.test.ts +0 -314
  207. package/src/components/__tests__/render-edit-screen-description.test.tsx +0 -152
  208. package/src/components/__tests__/render-edit-submit-actions.test.tsx +0 -460
  209. package/src/components/__tests__/render-field-app-locale.test.tsx +0 -142
  210. package/src/components/__tests__/render-field-enum-option.test.tsx +0 -99
  211. package/src/components/__tests__/render-field-icon-derivation.test.tsx +0 -119
  212. package/src/components/__tests__/render-field-json-format.test.tsx +0 -164
  213. package/src/components/__tests__/render-field-money-embedded-list-consistency.test.tsx +0 -212
  214. package/src/components/__tests__/render-field-money-roundtrip.test.tsx +0 -217
  215. package/src/components/__tests__/render-field-number-grouping.test.tsx +0 -76
  216. package/src/components/__tests__/render-field-number-unit.test.tsx +0 -227
  217. package/src/components/__tests__/render-field-password-format.test.tsx +0 -101
  218. package/src/components/__tests__/render-field-select-display.test.tsx +0 -134
  219. package/src/components/__tests__/render-field-unit-format.test.tsx +0 -107
  220. package/src/components/__tests__/render-field-unsupported-types.test.tsx +0 -195
  221. package/src/components/__tests__/render-list-toolbar-icon-only.test.tsx +0 -146
  222. package/src/components/__tests__/write-form-section.test.tsx +0 -375
  223. package/src/components/embedded-list-field.tsx +0 -354
  224. package/src/components/grid-cell-for-field.tsx +0 -88
  225. package/src/components/multi-select-checkboxes.tsx +0 -93
  226. package/src/components/reference-create-dialog.tsx +0 -91
  227. package/src/components/related-list-section.tsx +0 -491
  228. package/src/components/render-edit-action-button.tsx +0 -109
  229. package/src/components/render-edit-logic.ts +0 -85
  230. package/src/components/render-edit-types.ts +0 -226
  231. package/src/components/render-edit.tsx +0 -1871
  232. package/src/components/render-field.tsx +0 -951
  233. package/src/components/render-list.tsx +0 -593
  234. package/src/components/write-form-section.tsx +0 -198
  235. package/src/context/draft-storage-context.tsx +0 -39
  236. package/src/hooks/__tests__/use-ai-text.test.tsx +0 -177
  237. package/src/hooks/__tests__/use-disclosure.test.tsx +0 -25
  238. package/src/hooks/__tests__/use-form.test.tsx +0 -65
  239. package/src/hooks/__tests__/use-mutation.test.tsx +0 -77
  240. package/src/hooks/__tests__/use-query.test.tsx +0 -149
  241. package/src/hooks/__tests__/use-stream-handler.test.tsx +0 -107
  242. package/src/hooks/use-ai-text.ts +0 -172
  243. package/src/hooks/use-disclosure.ts +0 -20
  244. package/src/hooks/use-form.ts +0 -78
  245. package/src/hooks/use-list-url-state.ts +0 -207
  246. package/src/hooks/use-mutation.ts +0 -61
  247. package/src/hooks/use-query.ts +0 -166
  248. package/src/hooks/use-reference-lookup.ts +0 -76
  249. package/src/hooks/use-store.ts +0 -48
  250. package/src/hooks/use-stream-handler.ts +0 -134
  251. package/src/i18n-defaults.ts +0 -240
  252. package/src/i18n.tsx +0 -286
  253. package/src/index.ts +0 -279
  254. package/src/primitives.tsx +0 -1567
  255. package/src/screen-fills-height.ts +0 -3
  256. package/src/share-links.ts +0 -12
  257. package/src/sort-by-accessor.ts +0 -20
  258. package/src/sse/live-events.tsx +0 -56
  259. package/src/tokens.tsx +0 -170
@@ -0,0 +1,1355 @@
1
+ import type { ConfigCascade, ConfigScope, ConfigValueSource } from "@cosmicdrift/kumiko-framework/engine";
2
+ import type { FieldIconKey, FormWidth, IconKey, NavIconKey, SelectOptionTone } from "@cosmicdrift/kumiko-framework/ui-types";
3
+ import type { FieldIssue, ListColumnViewModel, ListRowViewModel, RuntimeRenderer } from "@cosmicdrift/kumiko-headless";
4
+ import { type ComponentType, type FormEvent, type KeyboardEvent, type ReactNode, type Ref } from "react";
5
+ export type { RuntimeRenderer };
6
+ /** Escape hatch for `data-*` test hooks (e.g. an E2E selector) that don't
7
+ * warrant a dedicated typed prop. Web merges these onto the rendered
8
+ * element; native impls ignore it (precedent: `className`). */
9
+ export type DataAttributes = Readonly<Record<`data-${string}`, string>>;
10
+ /** Structural marker a top-level `actions` node can carry so DefaultForm's
11
+ * sticky-footer split (fw#1918) treats it as the pinned primary action even
12
+ * though it isn't a `Button` with `type="submit"` — e.g. RenderEdit's
13
+ * footer-slot mount, whose actual rendered button is opaque app code the
14
+ * split can't inspect (see `ScreenSlots.footerPrimary`). */
15
+ export declare const STICKY_PRIMARY_ACTION_PROP: "kumikoStickyPrimaryAction";
16
+ export type StickyPrimaryActionMarker = Partial<Record<typeof STICKY_PRIMARY_ACTION_PROP, boolean>>;
17
+ /** Standard-Button. `loading` zeigt einen Spinner statt der Children
18
+ * und sollte mit `disabled` kombiniert werden, wenn die Action wirklich
19
+ * blockiert bis das Loading durch ist (z.B. async submit). Native-
20
+ * Impls können den Spinner als Activity-Indicator rendern. */
21
+ export type ButtonProps = {
22
+ readonly type?: "button" | "submit";
23
+ readonly onClick?: () => void | Promise<void>;
24
+ readonly disabled?: boolean;
25
+ /** Spinner statt Children rendern. Caller sollte `disabled` mit-
26
+ * setzen wenn die Action blockiert bis das Loading abgeschlossen
27
+ * ist (verhindert Double-Submit). */
28
+ readonly loading?: boolean;
29
+ /** Semantic class — default="primary". Custom impls decide what this
30
+ * becomes visually; the renderers use "primary" for Save, "danger" for
31
+ * Delete, "secondary" for a Confirm state, "link" for inline actions in
32
+ * running text (no background, underline), "danger-ghost" for a
33
+ * destructive action as red text instead of a red fill, "ghost" for a
34
+ * low-emphasis primary-colored text action beside a filled primary. */
35
+ readonly variant?: "primary" | "secondary" | "danger" | "link" | "danger-ghost" | "ghost";
36
+ /** Größe — default="md". "sm" für kompakte Inline-Aktionen (Toolbar,
37
+ * Listen-Zeilen), "icon" für quadratische Icon-only-Buttons. */
38
+ readonly size?: "sm" | "md" | "icon";
39
+ /** Barrierefreies Label — Pflicht bei icon-only-Buttons (children ist nur
40
+ * ein Icon/Zeichen), sonst hat der Button keinen zugänglichen Namen. */
41
+ readonly ariaLabel?: string;
42
+ /** Tooltip — web renders the native `title` attribute, native impls may ignore it. */
43
+ readonly title?: string;
44
+ /** Toggle state for toggle buttons — web sets `aria-pressed`; leave unset for plain buttons. */
45
+ readonly pressed?: boolean;
46
+ /** Breite — default="auto" (inhaltsbreit). "full" streckt CTA-Buttons auf
47
+ * die Container-Breite (Karten/Panels). Andere Breiten sind Layout-Sache
48
+ * des Containers, kein Button-Prop (Kit hält arbiträres Sizing draußen). */
49
+ readonly width?: "full" | "auto";
50
+ /** Optional for icon-only buttons (`size="icon"` with a resolved `icon`)
51
+ * — the icon carries the content then, `ariaLabel` the accessible name.
52
+ * Required in practice otherwise: without children and without `icon`
53
+ * the button stays empty. */
54
+ readonly children?: ReactNode;
55
+ readonly testId?: string;
56
+ /** Layout extras — Web merges via cn(), native impls ignore it
57
+ * (precedent: LinkProps.className). */
58
+ readonly className?: string;
59
+ /** DOM ref on the button — escape hatch for cases that need more than
60
+ * a click (e.g. binding a drop-target handler). Web forwards it, native
61
+ * impls ignore it (no native equivalent). */
62
+ readonly ref?: Ref<HTMLButtonElement>;
63
+ /** Icon before the label. */
64
+ readonly icon?: NavIconKey;
65
+ /** Icon after the label (e.g. "Continue →"). */
66
+ readonly iconEnd?: NavIconKey;
67
+ readonly dataAttributes?: DataAttributes;
68
+ };
69
+ /** Navigations-Link. `variant="button"` rendert die Button-Optik auf einem
70
+ * semantischen Anchor (z.B. „Zum Login" nach Reset-Success), `muted` den
71
+ * dezenten Sekundär-Link. Interne SPA-Navigation läuft über den Browser-
72
+ * Default (History-Integration liegt beim Nav-Layer, nicht am Primitive). */
73
+ export type LinkProps = {
74
+ readonly href: string;
75
+ readonly variant?: "default" | "button" | "muted";
76
+ /** `_blank` makes the web impl set `rel="noopener noreferrer"` unless
77
+ * `rel` is set explicitly. */
78
+ readonly target?: "_blank" | "_self" | "_parent" | "_top";
79
+ readonly rel?: string;
80
+ /** Layout-Zusätze (self-center, text-xs) — Web merged via cn(),
81
+ * Native-Impls ignorieren es (Präzedenz: CardProps.className). */
82
+ readonly className?: string;
83
+ readonly children: ReactNode;
84
+ readonly testId?: string;
85
+ readonly dataAttributes?: DataAttributes;
86
+ };
87
+ /** Banner für inline-Message ODER Page-State (z.B. "Loading…",
88
+ * "Screen not found"). `padded` setzt einen Außenabstand damit der
89
+ * Banner nicht edge-to-edge an den Main-Border klebt — relevant
90
+ * seit `<main>` kein eigenes Padding mehr hat. */
91
+ export type BannerProps = {
92
+ /** "error" for alerts (conflict, network error), "info" for neutral
93
+ * placeholders (not-found, loading), "loading" for load states, "warning"
94
+ * for a non-blocking but attention-grabbing notice (e.g. secretMint's
95
+ * "this is shown only once"). */
96
+ readonly variant?: "error" | "info" | "loading" | "warning";
97
+ readonly children: ReactNode;
98
+ /** Optional — weitere Knöpfe/Elemente rechts vom Text (z.B. "Neu
99
+ * laden"). Inline, nicht als eigener Block. */
100
+ readonly actions?: ReactNode;
101
+ /** Setzt einen Außenabstand um den Banner — für Page-States wo der
102
+ * Banner alleine im Main rendert (KumikoScreen "not-found",
103
+ * "loading", etc.). Web fügt p-6 als Margin um den Banner. */
104
+ readonly padded?: boolean;
105
+ readonly testId?: string;
106
+ /** Set when a `<Field>` wraps this Banner as its control (no actual
107
+ * input exists for the label to target — see render-field.tsx's
108
+ * unsupported-field-type fallback, #1834). The web implementation uses
109
+ * it to derive `role="group"` + `aria-labelledby`, not `htmlFor`: a
110
+ * `<label for>` on a non-labelable element like a `<div>` is inert for
111
+ * screen readers. */
112
+ readonly id?: string;
113
+ };
114
+ export type FieldProps = {
115
+ readonly id: string;
116
+ readonly label: string;
117
+ readonly required?: boolean;
118
+ readonly issues?: readonly FieldIssue[];
119
+ readonly labelAppendix?: ReactNode;
120
+ readonly fieldAppendix?: ReactNode;
121
+ readonly children: ReactNode;
122
+ /** Label-Layout. `stacked` (Default): Label über dem Control. `inline`:
123
+ * Control + Label nebeneinander (Box links, Label rechts) — für
124
+ * Checkbox/Switch-Felder (boolean), wie das shadcn-Muster. */
125
+ readonly layout?: "stacked" | "inline";
126
+ /** Collapses the visible label to `sr-only` — stays associated via
127
+ * `htmlFor` (no separate `aria-label` needed). For tables/grids whose
128
+ * column header already carries the label for each row. */
129
+ readonly hideLabel?: boolean;
130
+ /** Marks the field as edited relative to its saved value — the label row
131
+ * shows a "changed" marker. Set only in edit mode for fields present in
132
+ * the form's change set. */
133
+ readonly changed?: boolean;
134
+ readonly testId?: string;
135
+ };
136
+ /** Discriminated union — jede Input-Sorte hat ihre eigene value/onChange
137
+ * Signatur. Custom-Impls dispatchen intern, rendern anders (Toggle
138
+ * statt Checkbox), oder nur einzelne kinds unterschiedlich. */
139
+ export type InputProps = {
140
+ readonly kind: "text";
141
+ readonly id: string;
142
+ readonly name: string;
143
+ readonly value: string;
144
+ readonly onChange: (v: string) => void;
145
+ readonly disabled?: boolean;
146
+ readonly required?: boolean;
147
+ readonly hasError?: boolean;
148
+ /** Hint-Text wenn das Feld leer ist. Used für Search-Inputs in
149
+ * Toolbars ("Suchen…") wo kein Label sinnvoll ist. */
150
+ readonly placeholder?: string;
151
+ /** Browser-Autofill / Native-Keyboard-Hint. Web setzt das auf
152
+ * `<input autocomplete=...>`, Native auf `textContentType`. */
153
+ readonly autoComplete?: string;
154
+ /** `data-testid` aufs echte `<input>` — App-Tests adressieren das
155
+ * Element direkt (getByTestId + readOnly/disabled-Assertions). */
156
+ readonly testId?: string;
157
+ /** Read-only Input (z.B. gewürfelter Free-Tier-Slug). Nicht `disabled`
158
+ * — bleibt fokussier-/kopierbar. */
159
+ readonly readOnly?: boolean;
160
+ /** Closed FieldIconKey vocabulary (FIELD_ICONS registry, renderer-web). */
161
+ readonly icon?: FieldIconKey;
162
+ readonly dataAttributes?: DataAttributes;
163
+ /** Raw keydown access (e.g. Enter-to-submit at the field instead of
164
+ * the surrounding Form). Web forwards it, native impls ignore it
165
+ * (precedent: `ButtonProps.ref`). */
166
+ readonly onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
167
+ } | {
168
+ readonly kind: "email";
169
+ readonly id: string;
170
+ readonly name: string;
171
+ readonly value: string;
172
+ readonly onChange: (v: string) => void;
173
+ readonly disabled?: boolean;
174
+ readonly required?: boolean;
175
+ readonly hasError?: boolean;
176
+ readonly placeholder?: string;
177
+ /** Default "email". Apps die "username" wollen (Login-Form mit
178
+ * Username-or-Email) reichen das durch. */
179
+ readonly autoComplete?: string;
180
+ readonly testId?: string;
181
+ } | {
182
+ readonly kind: "password";
183
+ readonly id: string;
184
+ readonly name: string;
185
+ readonly value: string;
186
+ readonly onChange: (v: string) => void;
187
+ readonly disabled?: boolean;
188
+ readonly required?: boolean;
189
+ readonly hasError?: boolean;
190
+ /** Hint text shown when the field is empty (analog to kind:"text"). */
191
+ readonly placeholder?: string;
192
+ /** "current-password" für Login, "new-password" für Reset/Signup —
193
+ * Browser-Password-Manager nutzen das für die Speicherentscheidung.
194
+ * Native: textContentType="password" / "newPassword". */
195
+ readonly autoComplete?: "current-password" | "new-password";
196
+ readonly testId?: string;
197
+ } | {
198
+ readonly kind: "number";
199
+ readonly id: string;
200
+ readonly name: string;
201
+ readonly value: number | "";
202
+ readonly onChange: (v: number | undefined) => void;
203
+ readonly disabled?: boolean;
204
+ readonly required?: boolean;
205
+ readonly hasError?: boolean;
206
+ /** Hint text shown when the field is empty (analog to kind:"text"). */
207
+ readonly placeholder?: string;
208
+ readonly testId?: string;
209
+ /** Closed FieldIconKey vocabulary (FIELD_ICONS registry, renderer-web). */
210
+ readonly icon?: FieldIconKey;
211
+ /** `<input step>`. "any" disables the native stepMismatch constraint
212
+ * (needed for decimal fields — integer fields leave this unset). */
213
+ readonly step?: number | "any";
214
+ /** Resolved display suffix (static or from a sibling field) — never
215
+ * part of the numeric value. */
216
+ readonly unit?: string;
217
+ } | {
218
+ readonly kind: "range";
219
+ readonly id: string;
220
+ readonly name: string;
221
+ readonly value: number;
222
+ readonly onChange: (v: number) => void;
223
+ readonly min: number;
224
+ readonly max: number;
225
+ readonly step?: number;
226
+ readonly disabled?: boolean;
227
+ readonly required?: boolean;
228
+ readonly hasError?: boolean;
229
+ } | {
230
+ readonly kind: "boolean";
231
+ readonly id: string;
232
+ readonly name: string;
233
+ readonly value: boolean;
234
+ readonly onChange: (v: boolean) => void;
235
+ readonly disabled?: boolean;
236
+ readonly required?: boolean;
237
+ readonly hasError?: boolean;
238
+ } | {
239
+ readonly kind: "file" | "image";
240
+ readonly id: string;
241
+ readonly name: string;
242
+ /** FileRef-UUID (gespeicherte Datei) oder null (kein Upload). */
243
+ readonly value: string | null;
244
+ readonly onChange: (fileId: string | null) => void;
245
+ readonly disabled?: boolean;
246
+ readonly required?: boolean;
247
+ readonly hasError?: boolean;
248
+ /** Erlaubte Extensions/MIME (z.B. ["jpg","png"]) → `accept`-Attribut. */
249
+ readonly accept?: readonly string[];
250
+ readonly maxSize?: string;
251
+ /** Für den Upload-POST `/api/files` — der Endpoint prüft maxSize/accept
252
+ * gegen die Field-Def von (entityType, fieldName). */
253
+ readonly entityType?: string;
254
+ readonly fieldName?: string;
255
+ /** Only for kind:"image" — variant name for the preview
256
+ * (`/api/files/:id/variant/:name`). Absent → the original. */
257
+ readonly imageVariant?: string;
258
+ /** Only for kind:"image" — forwarded to the file input's `capture`
259
+ * attribute so a phone opens the camera instead of the file picker. */
260
+ readonly capture?: "environment" | "user";
261
+ } | {
262
+ readonly kind: "date";
263
+ readonly id: string;
264
+ readonly name: string;
265
+ readonly value: string;
266
+ readonly onChange: (v: string | undefined) => void;
267
+ /** Locale für Anzeige UND Eingabe-Parsing. Default = Browser-Locale
268
+ * via navigator.language. Apps mit eigenem LocaleResolver können
269
+ * ihren current locale durchreichen. */
270
+ readonly locale?: string;
271
+ /** Datumsgrenzen als ISO `yyyy-mm-dd` — begrenzen Picker (Jahres-
272
+ * Dropdown-Range + ausgegraute Tage). */
273
+ readonly min?: string;
274
+ readonly max?: string;
275
+ readonly disabled?: boolean;
276
+ readonly required?: boolean;
277
+ readonly hasError?: boolean;
278
+ } | {
279
+ readonly kind: "select";
280
+ readonly id: string;
281
+ readonly name: string;
282
+ readonly value: string;
283
+ readonly onChange: (v: string) => void;
284
+ /** Erlaubte Werte. Leeres Array → Dropdown ohne Optionen, ein
285
+ * required Field ist dann nicht erfüllbar (Author-Hinweis, nicht
286
+ * Endnutzer). String-Form für statische Listen (Wert == Label),
287
+ * {value,label}-Form für DB-getragene Refs (Tier 2.7e-3). */
288
+ readonly options: readonly string[] | readonly {
289
+ readonly value: string;
290
+ readonly label: string;
291
+ /** Second line under the label; shown by `radioVariant="card"`. */
292
+ readonly description?: string;
293
+ }[];
294
+ readonly disabled?: boolean;
295
+ readonly required?: boolean;
296
+ readonly hasError?: boolean;
297
+ /** `"card"` renders the radio group as bordered cards with label plus
298
+ * optional description per option and always uses the radio group,
299
+ * regardless of option count or `display`. Default `"list"`. */
300
+ readonly radioVariant?: "list" | "card";
301
+ /** Requested presentation. `"radio"` renders the options as a visible
302
+ * radio group (WAI-ARIA radiogroup, one click per choice),
303
+ * `"dropdown"` renders the combobox. Omitted = the implementation
304
+ * decides; the web impl keeps its short-option-set heuristic. Custom
305
+ * impls may ignore it — it is a request, not a contract. */
306
+ readonly display?: "radio" | "dropdown";
307
+ } | ({
308
+ readonly kind: "combobox";
309
+ readonly id: string;
310
+ readonly name: string;
311
+ readonly options: readonly {
312
+ readonly value: string;
313
+ readonly label: string;
314
+ }[];
315
+ readonly disabled?: boolean;
316
+ readonly required?: boolean;
317
+ readonly hasError?: boolean;
318
+ readonly placeholder?: string;
319
+ readonly searchPlaceholder?: string;
320
+ readonly emptyText?: string;
321
+ /** Tier 2.7e Remote-Search: gesetzt = Combobox läuft im Remote-
322
+ * Mode (cmdk-Local-Filter aus, Search-Input ruft onSearchChange
323
+ * debounced an den Caller). */
324
+ readonly onSearchChange?: (q: string) => void;
325
+ readonly loading?: boolean;
326
+ /** Fixed "+ createLabel" footer row that fires instead of
327
+ * selecting an option — omit for the plain select-existing
328
+ * combobox (kumiko-framework#1681). */
329
+ readonly onCreate?: () => void;
330
+ readonly createLabel?: string;
331
+ } & ({
332
+ readonly multiple?: false;
333
+ readonly value: string;
334
+ readonly onChange: (v: string) => void;
335
+ } | {
336
+ readonly multiple: true;
337
+ readonly value: readonly string[];
338
+ readonly onChange: (v: readonly string[]) => void;
339
+ })) | {
340
+ readonly kind: "money";
341
+ readonly id: string;
342
+ readonly name: string;
343
+ /** Internal-Format: Cents/Minor-Units als Integer (z.B. 1299 für
344
+ * 12,99 EUR). Renderer übersetzt fürs UI in Major-Units mit
345
+ * Locale-formatierten Dezimalstellen. Empty-State = `""`. */
346
+ readonly value: number | "";
347
+ readonly onChange: (v: number | undefined) => void;
348
+ /** ISO-4217 Currency-Code, z.B. "EUR" / "USD" / "CHF". Default
349
+ * "EUR". Renderer zeigt das Symbol als Suffix und formatiert die
350
+ * Decimal-Stellen entsprechend (EUR/USD/CHF haben 2, JPY hat 0). */
351
+ readonly currency?: string;
352
+ /** Locale für Zahlen-Formatierung. Default "de-DE" (Komma als
353
+ * Dezimaltrenner). Apps mit eigenem LocaleResolver können ihren
354
+ * current locale durchreichen. */
355
+ readonly locale?: string;
356
+ readonly disabled?: boolean;
357
+ readonly required?: boolean;
358
+ readonly hasError?: boolean;
359
+ } | {
360
+ readonly kind: "timestamp";
361
+ readonly id: string;
362
+ readonly name: string;
363
+ /** ISO-8601 Datetime-String. UTC-Instant mit `Z`
364
+ * ("2026-04-25T13:45:00Z") oder Wall-Clock ohne Offset
365
+ * ("2026-04-25T13:45", nur bei wallClock). Empty-State = `""`.
366
+ * Web rendert getrennte Datums- (tippbar + Kalender) und
367
+ * Uhrzeit-Eingabe und konvertiert. */
368
+ readonly value: string;
369
+ readonly onChange: (v: string | undefined) => void;
370
+ /** true = locatedTimestamp (Wall-Clock ohne Offset, Server
371
+ * validiert z.iso.datetime({local:true})). false/undefined =
372
+ * UTC-Instant, onChange MUSS mit `Z`-Suffix emittieren. */
373
+ readonly wallClock?: boolean;
374
+ /** Locale für Anzeige UND Eingabe-Parsing des Datums-Teils.
375
+ * Default = Browser-Locale. */
376
+ readonly locale?: string;
377
+ /** Datumsgrenzen als ISO-Datetime — begrenzen den Kalender auf
378
+ * Tages-Granularität. */
379
+ readonly min?: string;
380
+ readonly max?: string;
381
+ readonly disabled?: boolean;
382
+ readonly required?: boolean;
383
+ readonly hasError?: boolean;
384
+ } | {
385
+ readonly kind: "locatedTimestamp";
386
+ readonly id: string;
387
+ readonly name: string;
388
+ /** Located-Timestamp-Wert: Wall-Clock `at` (ohne Offset) + IANA-`tz`.
389
+ * `utc` ist beim Read da (server-berechnet) und wird beim Write
390
+ * ignoriert. Empty-State = `""`. onChange emittiert `{ at, tz }`. */
391
+ readonly value: {
392
+ readonly at: string;
393
+ readonly tz: string;
394
+ readonly utc?: string;
395
+ } | "";
396
+ readonly onChange: (v: {
397
+ readonly at: string;
398
+ readonly tz: string;
399
+ } | undefined) => void;
400
+ /** Locale für den Datums-Teil. Default = Browser-Locale. */
401
+ readonly locale?: string;
402
+ /** Datumsgrenzen als ISO-Datetime — begrenzen den Kalender. */
403
+ readonly min?: string;
404
+ readonly max?: string;
405
+ readonly disabled?: boolean;
406
+ readonly required?: boolean;
407
+ readonly hasError?: boolean;
408
+ } | {
409
+ readonly kind: "tz";
410
+ readonly id: string;
411
+ readonly name: string;
412
+ /** IANA zone name, e.g. "Europe/Berlin". Empty-state = "". */
413
+ readonly value: string;
414
+ readonly onChange: (v: string | undefined) => void;
415
+ readonly disabled?: boolean;
416
+ readonly required?: boolean;
417
+ readonly hasError?: boolean;
418
+ } | {
419
+ readonly kind: "textarea";
420
+ readonly id: string;
421
+ readonly name: string;
422
+ readonly value: string;
423
+ readonly onChange: (v: string) => void;
424
+ /** Visible rows. Acts as a minimum height — the field starts this tall
425
+ * and still grows with its content. Omitted, the default primitive
426
+ * falls back to its own floor (#2677). */
427
+ readonly rows?: number;
428
+ readonly disabled?: boolean;
429
+ readonly required?: boolean;
430
+ readonly hasError?: boolean;
431
+ /** Hint text shown when the field is empty (analog to kind:"text"). */
432
+ readonly placeholder?: string;
433
+ /** Read-only Textarea. Nicht `disabled` — bleibt fokussier-/
434
+ * kopierbar (analog zu kind:"text"). */
435
+ readonly readOnly?: boolean;
436
+ /** Ctrl/Cmd+Enter submits instead of inserting a newline. Plain
437
+ * Enter still inserts a newline. */
438
+ readonly onSubmitShortcut?: () => void;
439
+ readonly dataAttributes?: DataAttributes;
440
+ /** Raw keydown access (e.g. plain-Enter-submits/Shift+Enter-newline at
441
+ * the field instead of the surrounding Form). Composes with
442
+ * `onSubmitShortcut` — both fire on the same keystroke when set. Web
443
+ * forwards it, native impls ignore it (precedent: `ButtonProps.ref`). */
444
+ readonly onKeyDown?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;
445
+ };
446
+ export type DataTableSortDir = "asc" | "desc";
447
+ export type DataTableSort = {
448
+ readonly field: string;
449
+ readonly dir: DataTableSortDir;
450
+ };
451
+ export type DataTableRowActionMode = "adaptive" | "inline";
452
+ export type DataTableRowAction = {
453
+ /** Stable id für aria-labels und data-testids. */
454
+ readonly id: string;
455
+ /** Translated Label. */
456
+ readonly label: string;
457
+ /** Visual style — "danger" renders the red variant in the default
458
+ * primitive. Whether it also forces a confirm dialog is governed by
459
+ * `confirmRequired` (falls back to `style === "danger"` when unset). */
460
+ readonly style?: "primary" | "secondary" | "danger";
461
+ /** Translated Confirm-Prompt (Description im Dialog) — wenn gesetzt,
462
+ * öffnet ein Modal vor der Ausführung. Bei style=danger ohne expliziten
463
+ * confirm sollte der Renderer einen generischen Default zeigen. */
464
+ readonly confirm?: string;
465
+ /** Translated Confirm-Button-Label im Dialog. Default = `label`
466
+ * (Action-Label wird wiederverwendet). */
467
+ readonly confirmLabel?: string;
468
+ /** Overrides the default "danger implies a confirm dialog" rule. Schema-driven
469
+ * navigate/drawer actions set it to false: the colour marks the action as
470
+ * destructive, but the target form is the confirmation. */
471
+ readonly confirmRequired?: boolean;
472
+ /** Wird mit der ListRowViewModel der geklickten Row aufgerufen. Async
473
+ * erlaubt — der Renderer kann während der Promise-Resolution einen
474
+ * Loading-State auf dem Button zeigen. */
475
+ readonly onTrigger: (row: ListRowViewModel) => Promise<void> | void;
476
+ /** Conditional Visibility pro Row (z.B. "Start" nur wenn status==="scheduled"). */
477
+ readonly isVisible?: (row: ListRowViewModel) => boolean;
478
+ /** This action is what a click on the row does. The card layout drops it
479
+ * from the row menu, since the whole card is already the tap target. */
480
+ readonly rowClick?: boolean;
481
+ /** Resolved icon (author `RowAction.icon` or the id-derived default) —
482
+ * drives both the icon-left-of-text render and the icon-only collapse
483
+ * rule (see `shouldRenderActionsIconOnly`). */
484
+ readonly icon?: IconKey;
485
+ };
486
+ /** Teil-C action-icon collapse rule: a group of more than two actions where
487
+ * every member carries an icon renders icon-only instead of wall-to-wall
488
+ * text buttons; any icon-less member keeps the whole group on text so it
489
+ * doesn't fall apart visually mid-group. */
490
+ export declare function shouldRenderActionsIconOnly(actions: readonly {
491
+ readonly icon?: IconKey;
492
+ }[]): boolean;
493
+ export type DataTableFacet = {
494
+ /** Entity-Feldname (= URL-State-Key + payload.filters[].field). */
495
+ readonly field: string;
496
+ /** Translated Button-Label ("Status", "Active"). */
497
+ readonly label: string;
498
+ /** Auswählbare Werte mit Anzeige-Label. value = roher Filterwert
499
+ * (select-option / "true"|"false"), als String transportiert. */
500
+ readonly options: readonly {
501
+ readonly value: string;
502
+ readonly label: string;
503
+ }[];
504
+ };
505
+ export type DataTableDateRangeFacet = {
506
+ /** The facet's namespace (its date field) — a key, not a filter value. */
507
+ readonly field: string;
508
+ /** Translated label ("When"). */
509
+ readonly label: string;
510
+ readonly from: string;
511
+ readonly to: string;
512
+ };
513
+ export type DataTableProps = {
514
+ readonly columns: readonly ListColumnViewModel[];
515
+ readonly rows: readonly ListRowViewModel[];
516
+ readonly onRowClick?: (row: ListRowViewModel) => void;
517
+ /** Aktuelle Sortierung (oder null = unsorted). Wenn columns ein
518
+ * `sortable: true`-Feld haben und onSortChange gesetzt ist, rendert
519
+ * der Renderer Click-Header mit Asc/Desc-Indikator. Ohne onSortChange
520
+ * bleibt die Header-Click-Mechanik aus, columns.sortable ist dann nur
521
+ * semantischer Hinweis. */
522
+ readonly sort?: DataTableSort | null;
523
+ /** Wird gerufen mit dem nächsten Sort-State nach einem Header-Klick.
524
+ * 3-State-Toggle (Convention): asc → desc → null. Caller setzt damit
525
+ * seinen URL-State / Query-Param und triggert ein refetch. */
526
+ readonly onSortChange?: (next: DataTableSort | null) => void;
527
+ /** Pro-Row-Aktionen — eine Spalte am rechten Rand mit Inline-Buttons
528
+ * (≤2 Aktionen) oder Kebab-Dropdown (>2). Caller liefert Resolved-
529
+ * Form (Labels + onTrigger schon verdrahtet); DataTable kümmert
530
+ * sich nur um Render + Confirm-Dialog. */
531
+ readonly rowActions?: readonly DataTableRowAction[];
532
+ /** How the row-action column renders:
533
+ * - `"adaptive"` (default): with `onRowClick` all actions go in the kebab;
534
+ * without it the primary action is a link button and the rest go in the
535
+ * kebab (a single action gets no kebab).
536
+ * - `"inline"`: ALWAYS inline buttons, left-aligned, even with >2 (no
537
+ * kebab). Actions then sit at the same x-position across all rows
538
+ * (no drifting with label width) and all lists in an app look alike. */
539
+ readonly rowActionMode?: DataTableRowActionMode;
540
+ /** Custom Empty-State-Inhalt (z. B. Icon + Heading + CTA-Button).
541
+ * Default-Renderer rahmt ihn in einer dashed-border Box. */
542
+ readonly emptyState?: ReactNode;
543
+ /** Optionaler Titel-Slot ganz links der Toolbar — Screen-Titel
544
+ * ("Items", "Bestellungen"). Web rendert als font-medium Heading. */
545
+ readonly toolbarTitle?: ReactNode;
546
+ /** Toolbar-Slot mittig (typisch Search-Input). Renderer entscheidet
547
+ * das Layout — Web spreizt das Element als flex-1 mit max-Breite,
548
+ * Native könnte es als Header-Suchleiste rendern. */
549
+ readonly toolbarStart?: ReactNode;
550
+ /** Toolbar-Slot rechts (typisch + Neu Button, Filter, View-Switch).
551
+ * Web zieht den Cluster mit ml-auto an die rechte Kante. */
552
+ readonly toolbarEnd?: ReactNode;
553
+ /** Faceted-Filter-Dropdowns (select/boolean-Felder) — der Renderer
554
+ * setzt sie neben das Search-Input. Leer/undefined → keine Filter. */
555
+ readonly filterFacets?: readonly DataTableFacet[];
556
+ /** Aktuell ausgewählte Werte je Facet-Feld (vom URL-State). */
557
+ readonly filterValues?: Readonly<Record<string, readonly string[]>>;
558
+ /** Toggle eines Facet-Werts → Caller schreibt URL-State + refetch. */
559
+ readonly onFilterChange?: (field: string, values: readonly string[]) => void;
560
+ /** Reset-Button: löscht alle aktiven Facets. Renderer zeigt ihn nur
561
+ * wenn mindestens ein Facet aktiv ist. */
562
+ readonly onFilterReset?: () => void;
563
+ /** Time-range filters beside the facet dropdowns (fw#3104). */
564
+ readonly dateRangeFacets?: readonly DataTableDateRangeFacet[];
565
+ /** One bound changed ("" clears it) → caller writes URL state + refetch. */
566
+ readonly onDateRangeChange?: (field: string, bound: "from" | "to", value: string) => void;
567
+ /** Pagination-State + Callback. Wenn gesetzt, rendert der Renderer
568
+ * einen Pager unter der Tabelle (Web: Footer-Bar mit ← 1 ... N →).
569
+ * total/limit/page sind 1-basiert für die UI; Server-Translation
570
+ * zu offset = (page-1)*limit liegt beim Caller. Wenn page > total/limit
571
+ * würde, soll der Caller das vorab clampen. */
572
+ readonly pager?: {
573
+ readonly page: number;
574
+ readonly limit: number;
575
+ readonly total: number;
576
+ readonly onPageChange: (next: number) => void;
577
+ /** Offered page sizes; with `onPageSizeChange` the footer shows a
578
+ * "N pro Seite" select. */
579
+ readonly pageSizeOptions?: readonly number[];
580
+ readonly onPageSizeChange?: (next: number) => void;
581
+ };
582
+ /** Hint at the left of the toolbar (relatedList tab description). */
583
+ readonly toolbarDescription?: string;
584
+ /** Noun for the footer count ("1–19 of 19 leases", "1 position"),
585
+ * resolved for the given count. Omitted = generic "entries" wording. */
586
+ readonly itemNoun?: (count: number) => string;
587
+ /** Infinite-Scroll Callback. Wenn gesetzt, rendert der Renderer einen
588
+ * Bottom-Sentinel und ruft `onReachEnd` wenn der ins Viewport rückt
589
+ * (Web: IntersectionObserver). Caller verwaltet accumulation +
590
+ * cursor + hasMore. `loadingMore=true` zeigt einen Spinner unter
591
+ * der Tabelle solange die nächste Page lädt. Inkompatibel mit
592
+ * `pager` — entweder Pager ODER Infinite-Scroll, nicht beides. */
593
+ readonly onReachEnd?: () => void;
594
+ readonly loadingMore?: boolean;
595
+ /** Wenn false und onReachEnd gesetzt, rendert der Renderer einen
596
+ * "Ende der Liste"-Hinweis statt des Sentinels. Default true. */
597
+ readonly hasMore?: boolean;
598
+ readonly testId?: string;
599
+ /** Wires an edit path into a component column-renderer: `DataTableCell`
600
+ * passes this down as `ColumnRendererProps.onChange` for that cell,
601
+ * bound to `(rowId, column.field)`. Renderers without a component
602
+ * renderer (format-spec, type-default) ignore it — read-only stays
603
+ * read-only unless the column has a custom renderer that reads
604
+ * `onChange`. */
605
+ readonly onCellChange?: (rowId: string, field: string, value: unknown) => void;
606
+ /** Overrides the row `data-testid` (default `row-${row.id}`) — for a
607
+ * screen that already has its own DOM-test/e2e naming scheme. */
608
+ readonly getRowTestId?: (row: ListRowViewModel) => string;
609
+ /** Overrides the cell `data-testid` (default `cell-${row.id}-${field}`). */
610
+ readonly getCellTestId?: (row: ListRowViewModel, field: string) => string;
611
+ /** Drops the table's own rounded/border/card background — for a host
612
+ * that already provides the surrounding boundary (a tab panel, fw#2722)
613
+ * and would otherwise show a card nested inside that boundary. Default
614
+ * false: unchanged card-framed table. */
615
+ readonly chromeless?: boolean;
616
+ /** Fills the available height of its flex container and scrolls rows
617
+ * internally instead of growing with row count — for a host that would
618
+ * otherwise have a long table stretch the whole page, or a short table
619
+ * leave dead space below it (a tab panel, fw#2722). Requires the same
620
+ * flex-fill chain FormProps.fillHeight sets up above it; without that
621
+ * ancestor chain this collapses to zero height (Web: `flex-1 min-h-0`
622
+ * has no effect outside a sized flex-col ancestor). When true the table
623
+ * also takes the full board layout: the wrapper fills its container
624
+ * (`h-full`), toolbar and footer (pager or entry count) stay pinned
625
+ * outside the scrolling body, no card frame and no outer padding.
626
+ * Default false: unchanged document-flow table that grows with its
627
+ * content, pager below the last row. */
628
+ readonly scrollBody?: boolean;
629
+ /** Uses the shared screen padding (wider bottom inset) instead of the
630
+ * table's symmetric embedded inset — for a table that IS the screen body
631
+ * (entityList/projectionList), so a list screen ends at the same footer
632
+ * distance as a form or custom screen (fw#2640). Hosts set this or
633
+ * `scrollBody`, not both: the wider bottom inset competes with
634
+ * `scrollBody`'s flex-fill height budget.
635
+ * Default false: unchanged symmetric inset for an embedded table. */
636
+ readonly screenPadding?: boolean;
637
+ };
638
+ /** Cell type for one column of an embedded-list field. Mirrors
639
+ * EmbeddedListCellViewModel["type"] from `@cosmicdrift/kumiko-headless`. */
640
+ export type EmbeddedListCellType = "text" | "number" | "boolean" | "date" | "money" | "decimal" | "select" | "reference" | "timestamp";
641
+ /** One column of an embedded-list table (one entry per key of the source
642
+ * EmbeddedFieldDef's `schema`). */
643
+ export type EmbeddedListColumn = {
644
+ readonly field: string;
645
+ readonly label: string;
646
+ readonly type: EmbeddedListCellType;
647
+ readonly required: boolean;
648
+ /** Read-only, value supplied by the caller (already computed from
649
+ * sibling cells) — not directly user-editable. */
650
+ readonly derived: boolean;
651
+ /** Only for `type: "select"`. */
652
+ readonly options?: readonly string[];
653
+ readonly optionLabels?: Readonly<Record<string, string>>;
654
+ /** Only for `type: "reference"` — pre-fetched by the caller, ONE query
655
+ * per column shared across every row (not one query per cell). */
656
+ readonly referenceOptions?: readonly {
657
+ readonly value: string;
658
+ readonly label: string;
659
+ }[];
660
+ readonly referenceLoading?: boolean;
661
+ };
662
+ /** One entry of an embedded-list totals row (e.g. an invoice's total
663
+ * amount, summed across all rows by the caller). */
664
+ export type EmbeddedListTotal = {
665
+ readonly field: string;
666
+ readonly label: string;
667
+ readonly value: number;
668
+ };
669
+ /** Row-array + totals table for a `createEmbeddedListField` (invoice-
670
+ * positions-style) field — structurally too different from `Input`'s
671
+ * value/onChange union to fit there, so it's its own primitive, same as
672
+ * `DataTable`. Controlled: the caller (the eventual form-field wrapper)
673
+ * computes rows/derived values/issue groups and wires every callback;
674
+ * this primitive only renders and reports interaction. */
675
+ export type EmbeddedListInputProps = {
676
+ readonly id: string;
677
+ readonly columns: readonly EmbeddedListColumn[];
678
+ readonly rows: readonly Readonly<Record<string, unknown>>[];
679
+ readonly totals?: readonly EmbeddedListTotal[];
680
+ /** Currency for money cells and the totals row — one value for the whole
681
+ * list (currency lives on the head aggregate, not the row). Web impl
682
+ * falls back to "EUR" when absent. */
683
+ readonly currency?: string;
684
+ /** Whole-list read-only (e.g. a released invoice) — hides row-mutation
685
+ * affordances and disables every cell. */
686
+ readonly disabled?: boolean;
687
+ readonly minItems?: number;
688
+ readonly maxItems?: number;
689
+ /** Shown under the whole list (e.g. under the totals row). */
690
+ readonly listIssues?: readonly FieldIssue[];
691
+ /** Keyed by row index. */
692
+ readonly rowIssues?: Readonly<Record<number, readonly FieldIssue[]>>;
693
+ /** Keyed `${rowIndex}.${field}`. */
694
+ readonly cellIssues?: Readonly<Record<string, readonly FieldIssue[]>>;
695
+ readonly onCellChange: (rowIndex: number, field: string, value: unknown) => void;
696
+ readonly onAddRow: () => void;
697
+ readonly onRemoveRow: (rowIndex: number) => void;
698
+ readonly onDuplicateRow: (rowIndex: number) => void;
699
+ readonly onMoveRow: (fromIndex: number, toIndex: number) => void;
700
+ /** Tab/newline-delimited clipboard paste starting at (rowIndex,
701
+ * columnIndex) — parsed to a 2D string grid by the Web impl (paste
702
+ * events are a browser-only concept); undefined caller = no paste
703
+ * handling wired up. */
704
+ readonly onPasteCells?: (rowIndex: number, columnIndex: number, grid: readonly (readonly string[])[]) => void;
705
+ readonly addLabel: string;
706
+ readonly removeLabel: string;
707
+ readonly duplicateLabel: string;
708
+ readonly moveUpLabel: string;
709
+ readonly moveDownLabel: string;
710
+ readonly emptyLabel: string;
711
+ readonly emptyCtaLabel: string;
712
+ readonly testId?: string;
713
+ };
714
+ export type { FormWidth };
715
+ /** One entry of a form's "on this page" navigation: `id` matches the
716
+ * `SectionProps.id` of the section it scrolls to. */
717
+ export type FormSectionNavItem = {
718
+ readonly id: string;
719
+ readonly title: string;
720
+ };
721
+ /** Submit wrapper. Web: `<form onSubmit>`, native: a View that triggers an
722
+ * onSubmit callback via button press. `onSubmit` gets an abstract
723
+ * signature (no FormEvent) so native impls can fill it meaningfully.
724
+ *
725
+ * `title`: slot in the card header. `actions`: optional slot for the
726
+ * primary form actions (Save, Cancel) — renders as a footer row at the
727
+ * end of the card (normal document flow). Native impls may render the
728
+ * same slot as a bottom bar instead. */
729
+ export type FormProps = {
730
+ readonly onSubmit: (e?: FormEvent) => void;
731
+ readonly children: ReactNode;
732
+ readonly title?: ReactNode;
733
+ /** Optionaler muted Untertitel unter dem Titel (z.B. "Add a new item to
734
+ * your catalog") — gibt dem Form-Header Kontext statt nur ein Label. */
735
+ readonly subtitle?: ReactNode;
736
+ readonly actions?: ReactNode;
737
+ /** Secondary, record-related actions — rendered on the left on desktop,
738
+ * on their own row below the primary action on a narrow viewport. */
739
+ readonly secondaryActions?: ReactNode;
740
+ readonly testId?: string;
741
+ /** Max width of the form container. Default "full" — see FormWidth
742
+ * (`packages/types/src/screen.ts`, EditLayout.width). Native impls may
743
+ * ignore this prop (no width constraint there). */
744
+ readonly width?: FormWidth;
745
+ /** Pins `actions` to the viewport bottom on narrow screens (`<640px`)
746
+ * instead of normal document flow, so it stays reachable when a virtual
747
+ * keyboard shrinks the visible viewport (fw#1918). Desktop/tablet
748
+ * unaffected. Native impls may ignore this prop (already bottom-bar by
749
+ * convention there). */
750
+ readonly stickyActions?: boolean;
751
+ /** Extra content rendered above the card, inside the same page padding
752
+ * the card itself sits in — for a host that needs its own header region
753
+ * (title/metrics/tabs) to share the form's left padding and width
754
+ * instead of rendering as unpadded siblings before it. Native impls may
755
+ * ignore this prop. */
756
+ readonly headerRegion?: ReactNode;
757
+ /** Compact content on the right of the form title, same row — status
758
+ * chips or allowance badges that belong to the screen, not to a field.
759
+ * Native impls may ignore this prop. */
760
+ readonly titleAction?: ReactNode;
761
+ /** Sizes the form to fill its container's height (instead of the page's
762
+ * natural content height) so a single scrolling child — a lone
763
+ * relatedList tab's table — can scroll internally instead of stretching
764
+ * the whole page (fw#2722). Set by RenderEdit for a lone relatedList tab
765
+ * section and for screens that fill the shell height (together with
766
+ * `stickyActions`: sections scroll, footer stays pinned without
767
+ * `position: fixed`); every other caller leaves it unset and keeps normal
768
+ * document-flow height. Native impls may ignore this prop (already a
769
+ * bounded viewport there). */
770
+ readonly fillHeight?: boolean;
771
+ /** Drops the surrounding card (bg/border/rounded, title/subtitle block,
772
+ * footer border) so sections+footer render as siblings of `headerRegion`
773
+ * on the page background instead of inside a nested card — a tabbed
774
+ * projectionDetail's tab content is a sibling of the head card, not its
775
+ * child (bedienkonzept A1), so it must look like a standalone screen
776
+ * instead of a form embedded in another card. Default false: unchanged
777
+ * card chrome. Native impls may ignore this prop (no card chrome there
778
+ * to begin with). */
779
+ readonly chromeless?: boolean;
780
+ /** Set by RenderEdit for entityEdit/actionForm screens that fill the shell
781
+ * height: the form renders without a surrounding card, in a padded scroll
782
+ * surface with a fixed-width form column. Requires `fillHeight`; projection
783
+ * detail screens (which also fill the height) do not set it. Native impls
784
+ * may ignore this prop. */
785
+ readonly screenForm?: boolean;
786
+ /** Number of unsaved changes, shown in the pinned footer. Omitted in create
787
+ * mode and when nothing changed — the footer then shows no status. */
788
+ readonly unsavedCount?: number;
789
+ /** Drawer-hosted forms: context box above the fields. */
790
+ readonly summary?: {
791
+ readonly title: string;
792
+ readonly subtitle?: string;
793
+ };
794
+ /** Titled sections for the "on this page" navigation next to a
795
+ * `screenForm`. The web impl shows it only with three or more entries. */
796
+ readonly sectionNav?: readonly FormSectionNavItem[];
797
+ /** Leading column next to the scroll surface of a `screenForm` (wizard step
798
+ * navigation). Native impls may ignore this prop. */
799
+ readonly sideRail?: ReactNode;
800
+ };
801
+ /** Titled Gruppe von Feldern. Web: `<fieldset>` + `<legend>`, Native:
802
+ * View mit Header-Text. Native-Impls können den Title als Accordion
803
+ * oder Collapsible rendern. */
804
+ export type SectionProps = {
805
+ /** DOM id — the scroll target of a form's "on this page" navigation. */
806
+ readonly id?: string;
807
+ /** Optional — ohne Titel rendert die Section nur die Gruppierung
808
+ * (kein Header). RenderEdit lässt ihn weg, wenn er den Screen-Titel
809
+ * der Action-Bar 1:1 wiederholen würde. */
810
+ readonly title?: string;
811
+ /** Optionaler muted Untertitel unter dem Titel — gibt der Section
812
+ * Kontext statt nur ein Label (analog FormProps.subtitle). */
813
+ readonly subtitle?: ReactNode;
814
+ readonly children: ReactNode;
815
+ /** Rendered top-right in the title row — never a footer. A
816
+ * title-less/subtitle-less Section still draws the row when `actions`
817
+ * is set, so a hideTitle tabs-Section with actions isn't stranded. */
818
+ readonly actions?: ReactNode;
819
+ /** "destructive" marks the Section as a warning/danger area (e.g. account
820
+ * deletion, restrict processing) — border color only, no content change.
821
+ * Default "default" (normal card border). */
822
+ readonly variant?: "default" | "destructive";
823
+ readonly testId?: string;
824
+ /** Rendered left of the title, `text-muted-foreground`, same optical
825
+ * size as the title. No effect without a `title` — an icon alone would
826
+ * have nothing to sit next to. */
827
+ readonly icon?: IconKey;
828
+ };
829
+ /** Chromeless flex-fill layout host — no title, no card frame, no padding,
830
+ * just a container that sizes to its content and, once the ancestor chain
831
+ * is height-constrained, shrinks so one scrolling child can scroll
832
+ * internally instead of the page growing (fw#2722, height fw#2778). Web:
833
+ * `<div className="flex min-h-0 flex-col">`. Native: Views are
834
+ * already flex-column and the parent is already a bounded viewport there,
835
+ * so a native impl may render this as a bare Fragment. Used only as the
836
+ * terminal link in `RenderEdit`'s `fillHeight` chain (`RelatedListSection`'s
837
+ * `hideTitle` branch) — `Section`/`Card` were rejected here because both
838
+ * carry title/padding/border chrome this spot doesn't want and would double
839
+ * up with the table's own padding. */
840
+ export type FillContainerProps = {
841
+ readonly children: ReactNode;
842
+ readonly testId?: string;
843
+ /** Claims the remaining height of the flex chain (`flex-1`) instead of
844
+ * sizing to its content, so a footer inside the child sits at the bottom
845
+ * edge even with few rows. Set only when the screen fills the shell
846
+ * height. */
847
+ readonly grow?: boolean;
848
+ };
849
+ /** Columns-basiertes Layout. Web: CSS grid, Native: Flex-Wrap mit
850
+ * Width-%, oder react-native-grid. Jedes direkte Child kann eine
851
+ * `GridCell`-Wrapping bekommen für span-Kontrolle.
852
+ *
853
+ * `columns: "auto"` opts out of the N-column stretch layout entirely —
854
+ * children keep their own content width and wrap onto new lines (e.g. a
855
+ * metrics band of self-sized tiles, or an inline label+badge row) instead
856
+ * of being stretched into equal-width tracks. `GridCell` span-wrapping is
857
+ * meaningless in this mode and should be skipped. */
858
+ export type GridProps = {
859
+ readonly columns: number | "auto";
860
+ readonly children: ReactNode;
861
+ readonly testId?: string;
862
+ /** Rows visible before the grid becomes vertically scrollable. Omitted =
863
+ * the grid grows with its content and never scrolls. Ignored when
864
+ * `columns` is "auto". */
865
+ readonly maxRows?: number;
866
+ /** Fields flow left to right in wrapping rows sized by `GridCell.width`
867
+ * instead of equal-width tracks (screen forms and drawers). */
868
+ readonly flow?: boolean;
869
+ };
870
+ /** Width class of a field cell inside a `flow` grid: sized by what the field holds. */
871
+ export type FieldCellWidth = "text" | "number" | "money" | "date" | "select" | "full" | "auto";
872
+ /** Span-Wrapper für ein Kind innerhalb eines Grid. Web: `style={{gridColumn: span N}}`,
873
+ * Native: eigenes Width-Rechnen. */
874
+ export type GridCellProps = {
875
+ readonly span?: number;
876
+ /** Only read inside a `flow` grid. */
877
+ readonly width?: FieldCellWidth;
878
+ readonly children: ReactNode;
879
+ };
880
+ /** Semantischer Text. Variants bilden Standard-Typografie-Rollen ab —
881
+ * `body` ist Default, `small` für sekundäre Labels, `code` für inline
882
+ * monospace (entityId, screen-id), `required-mark` für das Sternchen
883
+ * hinter Labels, `muted` für gedimmten Fließtext (text-sm muted-
884
+ * foreground). Custom-Impls mappen auf ihren TypeScale. */
885
+ export type TextProps = {
886
+ readonly variant?: "body" | "small" | "code" | "required-mark" | "muted";
887
+ readonly children: ReactNode;
888
+ readonly testId?: string;
889
+ };
890
+ /** Heading mit zwei Rollen — `page` als Page-Titel (Web: h1), `section`
891
+ * als Sub-Header über einer Group (Web: h2 mit uppercase + muted).
892
+ * Native-Impls mappen auf `<Text>` mit entsprechendem fontWeight/Size. */
893
+ export type HeadingProps = {
894
+ readonly variant?: "page" | "section";
895
+ readonly children: ReactNode;
896
+ readonly testId?: string;
897
+ };
898
+ /** Modal-Dialog für Bestätigungen oder kompakte Sub-Forms. Web rendert
899
+ * Radix-Dialog (Focus-Trap, Esc-Schließen, Overlay-Click); Native
900
+ * würde ein Native-Modal nutzen. Apps öffnen den Dialog über einen
901
+ * External-State (`open` + `onOpenChange`); Confirm-Action läuft
902
+ * durch `onConfirm`, Cancel klappt zu via `onOpenChange(false)`.
903
+ *
904
+ * Variant `danger` markiert destruktive Bestätigungen visuell
905
+ * (rote Confirm-Button-Klasse), `default` für neutrale Dialoge. */
906
+ export type DialogProps = {
907
+ readonly open: boolean;
908
+ readonly onOpenChange: (open: boolean) => void;
909
+ readonly title: string;
910
+ /** Optional Beschreibung — typisch ein Satz der die Konsequenz
911
+ * erklärt ("Diese Aktion lässt sich nicht rückgängig machen."). */
912
+ readonly description?: string;
913
+ /** Confirm-Button-Label. Default kommt aus i18n
914
+ * (`kumiko.dialog.confirm`). */
915
+ readonly confirmLabel?: string;
916
+ /** Cancel-Button-Label. Default `kumiko.dialog.cancel`. */
917
+ readonly cancelLabel?: string;
918
+ /** `default` = Confirm primary, `danger` = Confirm danger. */
919
+ readonly variant?: "default" | "danger";
920
+ /** Which button takes focus on open. Default: Confirm for a bare dialog,
921
+ * the browser/Radix default when `children` are present. `"cancel"` for
922
+ * dialogs where the safe choice must be the one Enter triggers. */
923
+ readonly initialFocus?: "confirm" | "cancel";
924
+ /** Wird gefeuert wenn der User Confirm drückt. Async-Funktion ist
925
+ * ok — Dialog setzt automatisch loading-State, ruft danach
926
+ * onOpenChange(false). */
927
+ readonly onConfirm: () => void | Promise<void>;
928
+ /** Optional zusätzlicher Inhalt zwischen description und Buttons
929
+ * (z.B. ein Input wenn der Dialog auch Eingaben sammelt). */
930
+ readonly children?: ReactNode;
931
+ readonly testId?: string;
932
+ };
933
+ /** Bare content shell for hosting an existing self-contained form/widget
934
+ * (own submit/cancel buttons) inside a modal overlay — unlike `Dialog`,
935
+ * it renders no footer buttons of its own. Web renders the same
936
+ * focus-trapped Radix overlay as `Dialog`, just without the button row. */
937
+ export type ModalProps = {
938
+ readonly open: boolean;
939
+ readonly onOpenChange: (open: boolean) => void;
940
+ /** Screen-reader-only accessible title (required by the underlying
941
+ * dialog primitive) — not shown visually since the hosted content
942
+ * is expected to render its own heading. */
943
+ readonly title: string;
944
+ readonly children: ReactNode;
945
+ readonly testId?: string;
946
+ };
947
+ /** Side panel for hosting an existing self-contained form/widget (own
948
+ * submit/cancel buttons) without leaving the underlying screen — e.g. a
949
+ * toolbar action's `kind: "drawer"` mounts an actionForm here instead of
950
+ * navigating to a full page (fw#2225). Same "bare content shell, no
951
+ * footer buttons of its own" contract as `Modal`, slide-in instead of
952
+ * centered overlay. */
953
+ export type DrawerProps = {
954
+ readonly open: boolean;
955
+ readonly onOpenChange: (open: boolean) => void;
956
+ readonly title?: string;
957
+ readonly children: ReactNode;
958
+ readonly testId?: string;
959
+ };
960
+ /** Image lightbox — full-size preview on click. Web renders Radix overlay;
961
+ * trigger (thumbnail) and open state live in the app. */
962
+ export type LightboxProps = {
963
+ readonly open: boolean;
964
+ readonly onOpenChange: (open: boolean) => void;
965
+ readonly src: string;
966
+ readonly alt: string;
967
+ readonly testId?: string;
968
+ };
969
+ /** Source-badge for one cascade step (User / Tenant / System / …).
970
+ * Used inline next to a config value to indicate where it came from.
971
+ * Requires a LocaleProvider above it (labels run through useTranslation)
972
+ * — createKumikoApp wires one; standalone consumers must wrap. */
973
+ export type ConfigSourceBadgeProps = {
974
+ readonly source: ConfigValueSource;
975
+ /** Scope of the hosting screen. Non-system screens collapse sources
976
+ * ABOVE their scope (system-row/app-override/computed) into the neutral
977
+ * default badge — operator internals stay invisible to tenants, same
978
+ * rule as ConfigCascadeView's toDisplayLevels. */
979
+ readonly screenScope?: ConfigScope;
980
+ };
981
+ /** Collapsible cascade-view for a config-edit field. Split into two slots
982
+ * (#429): "trigger" is the collapsed ▶ + source + value line for the label
983
+ * row; "panel" is the expanded cascade + reset shown below the input. In
984
+ * split mode the screen owns the `expanded` state (both slots share it);
985
+ * without `slot` the component renders both with its own state. */
986
+ export type ConfigCascadeViewProps = {
987
+ readonly cascade: ConfigCascade;
988
+ readonly screenScope: ConfigScope;
989
+ readonly onReset?: (key: string, scope: ConfigScope) => void;
990
+ readonly qualifiedKey?: string;
991
+ readonly slot?: "trigger" | "panel";
992
+ readonly expanded?: boolean;
993
+ readonly onToggle?: () => void;
994
+ };
995
+ /** Card-Slots — benannte Inhalts-Regionen, alle optional. Neue Slots später =
996
+ * rein additiv → Consumer müssen NIE migriert werden. `header` ist der Escape-
997
+ * Hatch: ein roher Knoten ersetzt den Default-Header (title/subtitle/
998
+ * headerActions) komplett, wenn die Convenience-Slots nicht reichen. */
999
+ export type CardSlots = {
1000
+ readonly header?: ReactNode;
1001
+ readonly title?: ReactNode;
1002
+ readonly subtitle?: ReactNode;
1003
+ /** Free-form block content left of `headerActions`, below title/subtitle —
1004
+ * for a host-supplied header (projectionDetail `slots.header`) that must
1005
+ * share the action row instead of pushing actions into a row of their own. */
1006
+ readonly headerContent?: ReactNode;
1007
+ /** Rechtsbündiger Header-Slot (Range-Umschalter, Filter, Badge …). */
1008
+ readonly headerActions?: ReactNode;
1009
+ /** Footer-Inhalt, abgehoben (border-t). Default rechtsbündig. */
1010
+ readonly footer?: ReactNode;
1011
+ };
1012
+ /** Card-Options — Verhalten/Optik, ebenfalls additiv erweiterbar. */
1013
+ export type CardOptions = {
1014
+ /** Body-Padding (px-6 py-6). false = randlos (Tabelle/eigene Tiles). Default true. */
1015
+ readonly padded?: boolean;
1016
+ /** Eckenradius. Default "xl" (= Entity-Card). */
1017
+ readonly radius?: "lg" | "xl";
1018
+ /** Footer abgehoben mit border-t + bg-muted/30. Default true. */
1019
+ readonly footerBordered?: boolean;
1020
+ /** Joins the ancestor fillHeight flex chain (fw#2722/#2778 — a tabs-mode
1021
+ * relatedList table sizing to the panel instead of the page) instead of
1022
+ * normal document-flow height. Default false. */
1023
+ readonly fillHeight?: boolean;
1024
+ };
1025
+ /** Generische Card-Chrome (border/bg/radius/shadow + Header/Body/Footer) als
1026
+ * Primitive — eine Quelle für alle Card-Flächen, statt pro App nachgebaut.
1027
+ * Slot- + Options-basiert, damit der Contract stabil bleibt. */
1028
+ export type CardProps = {
1029
+ readonly slots?: CardSlots;
1030
+ readonly options?: CardOptions;
1031
+ /** Body-Inhalt (Normalfall; Header/Footer kommen über slots). */
1032
+ readonly children?: ReactNode;
1033
+ readonly className?: string;
1034
+ readonly testId?: string;
1035
+ readonly dataAttributes?: DataAttributes;
1036
+ };
1037
+ /** Determinate progress bar (e.g. wizard step progress). `value` is a
1038
+ * 0..1 fraction, not a percentage — implementations scale for display.
1039
+ * `tone` controls the fill color; omitted defaults to "default" (backward
1040
+ * compatible with callers predating this field). */
1041
+ export type ProgressTone = "default" | "success" | "warn" | "danger";
1042
+ export type ProgressProps = {
1043
+ readonly value: number;
1044
+ readonly tone?: ProgressTone;
1045
+ readonly ariaLabel?: string;
1046
+ readonly testId?: string;
1047
+ };
1048
+ /** Wizard step overview — numbered chips, one per step label, with the
1049
+ * active step highlighted. With `onStepSelect`, completed steps (index
1050
+ * below `currentIndex`) become buttons for going back; forward jumps stay
1051
+ * impossible because step-jump validation is a separate concern
1052
+ * (kumiko-framework#1966). Implementations render a
1053
+ * narrow-viewport fallback showing `compactLabel` instead (caller
1054
+ * supplies it pre-translated, e.g. "Step 2 of 5 · Industry") — which of
1055
+ * the two is visible is a responsive layout choice owned by the
1056
+ * implementation, not this contract. */
1057
+ export type StepBarProps = {
1058
+ readonly steps: readonly string[];
1059
+ readonly currentIndex: number;
1060
+ readonly compactLabel: string;
1061
+ readonly onStepSelect?: (index: number) => void;
1062
+ /** "label" (default) swaps the step row for `compactLabel` on narrow
1063
+ * viewports; "steps" keeps the row there too — for short wizards whose
1064
+ * labels fit a phone and whose done steps must stay tappable. */
1065
+ readonly narrowLayout?: "label" | "steps";
1066
+ /** "vertical" renders a step rail (from `lg`, with `compactLabel` as the
1067
+ * single line below it) instead of the chip row. Default "horizontal". */
1068
+ readonly orientation?: "horizontal" | "vertical";
1069
+ /** Vertical only: rail heading ("Step 4 of 6") and optional description. */
1070
+ readonly heading?: string;
1071
+ readonly description?: string;
1072
+ readonly testId?: string;
1073
+ readonly compactTestId?: string;
1074
+ };
1075
+ /** Wraps a single wizard step so it stays mounted but inert while off-
1076
+ * screen — `hidden` visually hides it, and implementations that have a
1077
+ * native constraint-validation concept (web: `<fieldset disabled>`, spec-
1078
+ * guaranteed to also bar descendants from participating) must bar it too,
1079
+ * or a `type="submit"` step-advance button triggers the browser's
1080
+ * full-form check against fields on unvisited, unfocusable steps
1081
+ * (kumiko-framework#1976). Implementations without that concept can gate
1082
+ * on `hidden` alone. */
1083
+ export type WizardStepGroupProps = {
1084
+ readonly hidden: boolean;
1085
+ /** Pads the step content (tab panels sit full-bleed under the tab strip). */
1086
+ readonly inset?: boolean;
1087
+ readonly children: ReactNode;
1088
+ };
1089
+ /** Tab strip for a projectionDetail `layout.mode: "tabs"`. Renders only the
1090
+ * strip, not the content — the caller mounts the active section separately.
1091
+ * Keyboard/ARIA (role=tablist/tab, arrow-key navigation) is the
1092
+ * implementation's job. */
1093
+ export type TabsProps = {
1094
+ readonly items: readonly {
1095
+ readonly id: string;
1096
+ readonly label: string;
1097
+ /** Shown dimmed after the label (e.g. an open-items count). Omit for
1098
+ * tabs without a counter. */
1099
+ readonly count?: number;
1100
+ }[];
1101
+ readonly activeId: string;
1102
+ readonly onSelect: (id: string) => void;
1103
+ readonly testId?: string;
1104
+ };
1105
+ export type StatusTone = "ok" | "warn" | "bad" | "critical" | "muted";
1106
+ /** Status pill. `value` is the raw column value — tone-mapping is the app's job. */
1107
+ export type StatusBadgeProps = {
1108
+ readonly value: string;
1109
+ readonly tone?: StatusTone;
1110
+ readonly testId?: string;
1111
+ };
1112
+ export declare function statusToneForOptionTone(tone: SelectOptionTone): StatusTone;
1113
+ export declare function statusToneForValue(value: string): StatusTone | undefined;
1114
+ /** Compact label/value tile (record-detail metrics band). `testId` is the
1115
+ * tile's own id — the impl derives `${testId}-label`/`${testId}-value` for
1116
+ * the two rendered nodes, so a caller only ever needs to know the base id. */
1117
+ export type MetricProps = {
1118
+ readonly label: string;
1119
+ readonly value: string;
1120
+ readonly testId?: string;
1121
+ /** Click handler — set when the metric declares a `navigate` target
1122
+ * (see `MetricSpec`). Omitted for a plain, non-interactive metric. */
1123
+ readonly onPress?: () => void;
1124
+ };
1125
+ /** Structured JSON display (audit payload/metadata, job logs, unsupported
1126
+ * jsonb/embedded field fallback). Takes the raw value, not a pre-stringified
1127
+ * one — the implementation owns `JSON.stringify` (and must not throw on
1128
+ * circular refs / BigInt / other non-serializable input). `indent` mirrors
1129
+ * `JSON.stringify`'s space-count param, default 2. */
1130
+ export type JsonViewProps = {
1131
+ readonly value: unknown;
1132
+ readonly indent?: number;
1133
+ readonly testId?: string;
1134
+ };
1135
+ /** Band above the tabs of a record detail: optional subtitle line plus the
1136
+ * metrics as a definition list. `children` are `Metric` tiles. */
1137
+ export type MetricBandProps = {
1138
+ readonly subtitle?: ReactNode;
1139
+ readonly children: ReactNode;
1140
+ readonly testId?: string;
1141
+ };
1142
+ /** Page title area rendered by the app shell's header instead of inside the
1143
+ * screen: `title` replaces the last breadcrumb, `status` sits right after it,
1144
+ * `actions` at the right edge. Renders nothing itself; without a shell slot
1145
+ * (see `usePageHeaderSlotAvailable`) callers keep their previous placement. */
1146
+ export type PageHeaderProps = {
1147
+ readonly title?: string;
1148
+ readonly status?: ReactNode;
1149
+ readonly actions?: ReactNode;
1150
+ };
1151
+ /** One item in an `ActionOverflowMenu` (A7: header/row actions beyond the
1152
+ * primary one collapse into this menu instead of a wall of buttons). */
1153
+ export type ActionMenuItemSpec = {
1154
+ readonly id: string;
1155
+ readonly label: string;
1156
+ /** Icon name, resolved by the implementation (same names as row actions). */
1157
+ readonly icon?: IconKey;
1158
+ readonly disabled?: boolean;
1159
+ readonly variant?: "default" | "danger";
1160
+ readonly onSelect: () => void;
1161
+ };
1162
+ export type ActionOverflowMenuProps = {
1163
+ readonly items: readonly ActionMenuItemSpec[];
1164
+ /** aria-label for the three-dots trigger. */
1165
+ readonly label: string;
1166
+ readonly testId?: string;
1167
+ };
1168
+ /** One revealed value on a `secretMint` screen's confirm phase (fw#2548). */
1169
+ export type SecretRevealValue = {
1170
+ readonly label: string;
1171
+ readonly value: string;
1172
+ readonly copyable: boolean;
1173
+ readonly multiline: boolean;
1174
+ /** Render `value` as a scannable QR code instead of monospaced text — for
1175
+ * an otpauth://-style enrollment URI. Platforms without a QR-capable
1176
+ * SecretReveal primitive fall back to the monospaced display. */
1177
+ readonly qr?: boolean;
1178
+ };
1179
+ /** One-time secret reveal — mint-form confirm phase. Renders each value
1180
+ * monospaced (multiline splits it one line per entry, for recovery codes),
1181
+ * with a per-value copy control when `copyable`. */
1182
+ export type SecretRevealProps = {
1183
+ readonly values: readonly SecretRevealValue[];
1184
+ readonly copyLabel: string;
1185
+ readonly copiedLabel: string;
1186
+ readonly testId?: string;
1187
+ };
1188
+ /** Thumb-reach action row for custom screens: pinned to the bottom edge on
1189
+ * narrow viewports (above the device's safe-area inset), inline otherwise.
1190
+ * `children` are the forward actions and share the remaining width; `back`
1191
+ * renders an icon-only back control in front of them. */
1192
+ export type StickyActionBarProps = {
1193
+ readonly children: ReactNode;
1194
+ readonly back?: {
1195
+ readonly onBack: () => void;
1196
+ readonly label: string;
1197
+ };
1198
+ readonly testId?: string;
1199
+ };
1200
+ /** Copies `text` to the clipboard; the label flips to `copiedLabel` once
1201
+ * the platform confirmed the write. */
1202
+ export type CopyButtonProps = {
1203
+ readonly text: string;
1204
+ readonly label: string;
1205
+ readonly copiedLabel: string;
1206
+ readonly variant?: "primary" | "secondary";
1207
+ /** Layout extras — web merges via cn(), native impls ignore it. */
1208
+ readonly className?: string;
1209
+ readonly testId?: string;
1210
+ };
1211
+ /** Hands `text` to another app. "whatsapp" opens a WhatsApp chat prefilled
1212
+ * with the text (to `phone` when given, otherwise the contact picker);
1213
+ * "system" opens the platform share sheet and renders nothing where the
1214
+ * platform has none. */
1215
+ export type ShareButtonProps = {
1216
+ readonly text: string;
1217
+ readonly label: string;
1218
+ readonly variant?: "primary" | "secondary";
1219
+ /** Layout extras — web merges via cn(), native impls ignore it. */
1220
+ readonly className?: string;
1221
+ readonly testId?: string;
1222
+ } & ({
1223
+ readonly target: "whatsapp";
1224
+ readonly phone?: string;
1225
+ } | {
1226
+ readonly target: "system";
1227
+ readonly title?: string;
1228
+ readonly url?: string;
1229
+ });
1230
+ export type PromoPanelAction = {
1231
+ readonly label: string;
1232
+ readonly href: string;
1233
+ readonly testId?: string;
1234
+ } | {
1235
+ readonly label: string;
1236
+ readonly onClick: () => void;
1237
+ readonly testId?: string;
1238
+ };
1239
+ /** Offer surface for upsells (e.g. "create an account"): its own tinted
1240
+ * panel with eyebrow, headline, benefit content and one call to action, so
1241
+ * an offer never reads like an info or error banner. */
1242
+ export type PromoPanelProps = {
1243
+ readonly title: string;
1244
+ readonly eyebrow?: string;
1245
+ readonly children?: ReactNode;
1246
+ readonly action?: PromoPanelAction;
1247
+ readonly testId?: string;
1248
+ };
1249
+ export type CorePrimitives = {
1250
+ readonly Button: ComponentType<ButtonProps>;
1251
+ readonly Banner: ComponentType<BannerProps>;
1252
+ readonly Field: ComponentType<FieldProps>;
1253
+ readonly Input: ComponentType<InputProps>;
1254
+ readonly DataTable: ComponentType<DataTableProps>;
1255
+ /** Optional (unlike the other Core-Primitives) so existing partial
1256
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
1257
+ * a new primitive shouldn't force every test double to grow a stub. */
1258
+ readonly EmbeddedListInput?: ComponentType<EmbeddedListInputProps>;
1259
+ readonly Form: ComponentType<FormProps>;
1260
+ readonly Section: ComponentType<SectionProps>;
1261
+ readonly Card: ComponentType<CardProps>;
1262
+ readonly Grid: ComponentType<GridProps>;
1263
+ readonly GridCell: ComponentType<GridCellProps>;
1264
+ readonly Text: ComponentType<TextProps>;
1265
+ readonly Heading: ComponentType<HeadingProps>;
1266
+ readonly Dialog: ComponentType<DialogProps>;
1267
+ readonly Modal: ComponentType<ModalProps>;
1268
+ /** Optional (unlike the other Core-Primitives) so existing partial
1269
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
1270
+ * a new primitive shouldn't force every test double to grow a stub. */
1271
+ readonly Drawer?: ComponentType<DrawerProps>;
1272
+ readonly Lightbox: ComponentType<LightboxProps>;
1273
+ readonly ConfigSourceBadge: ComponentType<ConfigSourceBadgeProps>;
1274
+ readonly ConfigCascadeView: ComponentType<ConfigCascadeViewProps>;
1275
+ readonly Link: ComponentType<LinkProps>;
1276
+ /** Optional (unlike the other Core-Primitives) so existing partial
1277
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
1278
+ * a new primitive shouldn't force every test double to grow a stub. */
1279
+ readonly Progress?: ComponentType<ProgressProps>;
1280
+ /** Optional (unlike the other Core-Primitives) so existing partial
1281
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
1282
+ * a new primitive shouldn't force every test double to grow a stub. */
1283
+ readonly StepBar?: ComponentType<StepBarProps>;
1284
+ /** Optional (unlike the other Core-Primitives) so existing partial
1285
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
1286
+ * a new primitive shouldn't force every test double to grow a stub. */
1287
+ readonly WizardStepGroup?: ComponentType<WizardStepGroupProps>;
1288
+ /** Optional (unlike the other Core-Primitives) so existing partial
1289
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
1290
+ * a new primitive shouldn't force every test double to grow a stub. */
1291
+ readonly Tabs?: ComponentType<TabsProps>;
1292
+ /** Optional (unlike the other Core-Primitives) so existing partial
1293
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
1294
+ * a new primitive shouldn't force every test double to grow a stub. */
1295
+ readonly StatusBadge?: ComponentType<StatusBadgeProps>;
1296
+ /** Optional (unlike the other Core-Primitives) so existing partial
1297
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
1298
+ * a new primitive shouldn't force every test double to grow a stub. */
1299
+ readonly Metric?: ComponentType<MetricProps>;
1300
+ /** Optional (unlike the other Core-Primitives) so existing partial
1301
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
1302
+ * a new primitive shouldn't force every test double to grow a stub. */
1303
+ readonly JsonView?: ComponentType<JsonViewProps>;
1304
+ /** Optional (unlike the other Core-Primitives) so existing partial
1305
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
1306
+ * a new primitive shouldn't force every test double to grow a stub. */
1307
+ readonly FillContainer?: ComponentType<FillContainerProps>;
1308
+ /** Optional — additive rollout, see StickyActionBar. Without it, header
1309
+ * content stays where the screen always rendered it. */
1310
+ readonly PageHeader?: ComponentType<PageHeaderProps>;
1311
+ /** Optional — additive rollout, see StickyActionBar. */
1312
+ readonly MetricBand?: ComponentType<MetricBandProps>;
1313
+ /** Optional: without an implementation, callers with >2 header/row
1314
+ * actions fall back to today's all-buttons-inline rendering (A7). */
1315
+ readonly ActionOverflowMenu?: ComponentType<ActionOverflowMenuProps>;
1316
+ /** Optional (unlike the other Core-Primitives) so existing partial
1317
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
1318
+ * a new primitive shouldn't force every test double to grow a stub. */
1319
+ readonly SecretReveal?: ComponentType<SecretRevealProps>;
1320
+ /** Optional (unlike the other Core-Primitives) so existing partial
1321
+ * CorePrimitives mocks in tests keep compiling — additive rollout of
1322
+ * a new primitive shouldn't force every test double to grow a stub. */
1323
+ readonly StickyActionBar?: ComponentType<StickyActionBarProps>;
1324
+ /** Optional — additive rollout, see StickyActionBar. */
1325
+ readonly CopyButton?: ComponentType<CopyButtonProps>;
1326
+ /** Optional — additive rollout, see StickyActionBar. */
1327
+ readonly ShareButton?: ComponentType<ShareButtonProps>;
1328
+ /** Optional — additive rollout, see StickyActionBar. */
1329
+ readonly PromoPanel?: ComponentType<PromoPanelProps>;
1330
+ };
1331
+ /** Offene Extension-Zone für App-eigene Primitives. Devs erweitern
1332
+ * dieses Interface via TypeScript Module-Augmentation:
1333
+ *
1334
+ * declare module "@cosmicdrift/kumiko-renderer" {
1335
+ * interface AppPrimitives {
1336
+ * Chip: ComponentType<ChipProps>;
1337
+ * Accordion: ComponentType<AccordionProps>;
1338
+ * }
1339
+ * }
1340
+ *
1341
+ * Nach der Augmentation tauchen die Keys in `PrimitivesRegistry`,
1342
+ * `createKumikoApp({ primitives: { Chip, Accordion } })`, und
1343
+ * `usePrimitives().Chip` auf — TypeScript-gestützt. Kumikos eigene
1344
+ * Components nutzen ausschließlich `CorePrimitives`; App-Primitives
1345
+ * sind ausschließlich für Dev-Code (Custom-Screens, Shell, eigene
1346
+ * Components). */
1347
+ export interface AppPrimitives {
1348
+ }
1349
+ export type PrimitivesRegistry = CorePrimitives & AppPrimitives;
1350
+ export type PrimitivesProviderProps = {
1351
+ readonly children: ReactNode;
1352
+ readonly value: PrimitivesRegistry;
1353
+ };
1354
+ export declare function PrimitivesProvider({ children, value }: PrimitivesProviderProps): ReactNode;
1355
+ export declare function usePrimitives(): PrimitivesRegistry;