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