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