@middag-io/react 0.51.1 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist-lib/{DateField-lPZsiWfC.js → DateField-CduB6lUv.js} +21 -23
  2. package/dist-lib/{DateRangeField-B7zWB48D.js → DateRangeField-DlA_9i4w.js} +17 -13
  3. package/dist-lib/{FormField-BGqAQLtX.js → FormField-CDdY7-md.js} +2090 -2054
  4. package/dist-lib/{FormPanelBlock-CGgA83Mu.js → FormPanelBlock-zo8tCgtS.js} +1 -2
  5. package/dist-lib/base/blocks/CardGridBlock.d.ts.map +1 -1
  6. package/dist-lib/base/blocks/DenseTableBlock.d.ts.map +1 -1
  7. package/dist-lib/base/blocks/EmptyStateBlock.d.ts.map +1 -1
  8. package/dist-lib/base/blocks/FormPanelBlock.d.ts.map +1 -1
  9. package/dist-lib/base/blocks/MetricCardBlock.d.ts.map +1 -1
  10. package/dist-lib/base/form/FormField.d.ts +8 -1
  11. package/dist-lib/base/form/FormField.d.ts.map +1 -1
  12. package/dist-lib/base/form/fields/DateField.d.ts +1 -1
  13. package/dist-lib/base/form/fields/DateField.d.ts.map +1 -1
  14. package/dist-lib/base/form/fields/DateRangeField.d.ts +3 -1
  15. package/dist-lib/base/form/fields/DateRangeField.d.ts.map +1 -1
  16. package/dist-lib/base/form/fields/MultiSelectField.d.ts +3 -1
  17. package/dist-lib/base/form/fields/MultiSelectField.d.ts.map +1 -1
  18. package/dist-lib/base/form/fields/RadioField.d.ts +3 -1
  19. package/dist-lib/base/form/fields/RadioField.d.ts.map +1 -1
  20. package/dist-lib/base/form/fields/RatingField.d.ts +3 -1
  21. package/dist-lib/base/form/fields/RatingField.d.ts.map +1 -1
  22. package/dist-lib/base/form/fields/SliderField.d.ts +3 -1
  23. package/dist-lib/base/form/fields/SliderField.d.ts.map +1 -1
  24. package/dist-lib/base/form/fields/TagsField.d.ts.map +1 -1
  25. package/dist-lib/base/partials/DataTable/cell-renderers.d.ts.map +1 -1
  26. package/dist-lib/base/partials/DataTable/index.d.ts.map +1 -1
  27. package/dist-lib/base/partials/DataTable/types.d.ts +2 -2
  28. package/dist-lib/base/partials/DataTable/types.d.ts.map +1 -1
  29. package/dist-lib/base/partials/EmptyPlaceholder/index.d.ts.map +1 -1
  30. package/dist-lib/base/shell/BasicShell.d.ts +12 -1
  31. package/dist-lib/base/shell/BasicShell.d.ts.map +1 -1
  32. package/dist-lib/base/shell/BasicShell.js +126 -111
  33. package/dist-lib/base/shell/partials/InlineEditablePanel.js +193 -176
  34. package/dist-lib/base/shell/partials/InspectorContext.js +1 -1
  35. package/dist-lib/base/theme/tailwind-theme.css +13 -5
  36. package/dist-lib/base/theme/theme-bridge.css +8 -0
  37. package/dist-lib/base/theme/themes/classic.css +15 -11
  38. package/dist-lib/base/theme/tokens.css +36 -10
  39. package/dist-lib/base/utils/php-wire.d.ts +33 -0
  40. package/dist-lib/base/utils/php-wire.d.ts.map +1 -0
  41. package/dist-lib/base/utils/php-wire.js +19 -0
  42. package/dist-lib/chunks/{subpath-DjkzcIPp.js → subpath-Bb5vw3A_.js} +21 -23
  43. package/dist-lib/chunks/{subpath-fEhy6n_U.js → subpath-CZB5_RY7.js} +2 -0
  44. package/dist-lib/chunks/subpath-DVHs9lfh.js +29 -0
  45. package/dist-lib/contracts/block-data/data-display.d.ts +12 -287
  46. package/dist-lib/contracts/block-data/data-display.d.ts.map +1 -1
  47. package/dist-lib/contracts/block-data/interactive.d.ts +14 -22
  48. package/dist-lib/contracts/block-data/interactive.d.ts.map +1 -1
  49. package/dist-lib/contracts/block-data/shared.d.ts +2 -17
  50. package/dist-lib/contracts/block-data/shared.d.ts.map +1 -1
  51. package/dist-lib/contracts/generated/index.d.ts +2 -2
  52. package/dist-lib/contracts/generated/schemas.d.ts +1584 -192
  53. package/dist-lib/contracts/generated/schemas.d.ts.map +1 -1
  54. package/dist-lib/contracts/generated/types.d.ts +288 -8
  55. package/dist-lib/contracts/generated/types.d.ts.map +1 -1
  56. package/dist-lib/contracts/page-contract-schema.d.ts +15 -0
  57. package/dist-lib/contracts/page-contract-schema.d.ts.map +1 -1
  58. package/dist-lib/i18n/I18nProvider.js +1 -1
  59. package/dist-lib/i18n/instance.js +1 -1
  60. package/dist-lib/i18n/locales/en/ui.json +1 -0
  61. package/dist-lib/i18n/locales/pt-BR/ui.json +1 -0
  62. package/dist-lib/i18n/register-strings.js +1 -1
  63. package/dist-lib/index.d.ts +2 -2
  64. package/dist-lib/index.d.ts.map +1 -1
  65. package/dist-lib/lib/hooks/use-prefers-reduced-motion.d.ts +6 -0
  66. package/dist-lib/lib/hooks/use-prefers-reduced-motion.d.ts.map +1 -0
  67. package/dist-lib/lib/hooks/use-prefers-reduced-motion.js +21 -0
  68. package/dist-lib/middag-react.css +1 -1
  69. package/dist-lib/middag-react.js +10407 -10012
  70. package/dist-lib/primitives/reui/badge.d.ts +5 -0
  71. package/dist-lib/primitives/reui/badge.d.ts.map +1 -1
  72. package/dist-lib/primitives/reui/badge.js +14 -14
  73. package/dist-lib/primitives/reui/sidebar.d.ts.map +1 -1
  74. package/dist-lib/primitives/reui/sidebar.js +46 -34
  75. package/docs/public/schemas/fragment.json +1258 -19
  76. package/docs/public/schemas/page-contract.json +1258 -19
  77. package/docs/public/schemas/shared-props.json +1258 -19
  78. package/package.json +6 -1
  79. package/src/base/blocks/CardGridBlock.tsx +10 -2
  80. package/src/base/blocks/DenseTableBlock.tsx +18 -11
  81. package/src/base/blocks/DetailPanelBlock.tsx +1 -1
  82. package/src/base/blocks/EmptyStateBlock.tsx +5 -1
  83. package/src/base/blocks/FormPanelBlock.tsx +0 -1
  84. package/src/base/blocks/MetricCardBlock.tsx +9 -2
  85. package/src/base/form/FormField.tsx +40 -7
  86. package/src/base/form/fields/DateField.tsx +3 -3
  87. package/src/base/form/fields/DateRangeField.tsx +19 -14
  88. package/src/base/form/fields/MultiSelectField.tsx +9 -8
  89. package/src/base/form/fields/RadioField.tsx +4 -0
  90. package/src/base/form/fields/RatingField.tsx +4 -0
  91. package/src/base/form/fields/SliderField.tsx +4 -1
  92. package/src/base/form/fields/TagsField.tsx +3 -0
  93. package/src/base/partials/DataTable/cell-renderers.tsx +23 -12
  94. package/src/base/partials/DataTable/index.tsx +5 -2
  95. package/src/base/partials/DataTable/types.ts +2 -5
  96. package/src/base/partials/DetailSection/index.tsx +2 -2
  97. package/src/base/partials/EmptyPlaceholder/index.tsx +7 -3
  98. package/src/base/partials/MarkdownContent/index.tsx +1 -1
  99. package/src/base/shell/BasicShell.tsx +47 -8
  100. package/src/base/shell/partials/InspectorContext.tsx +1 -1
  101. package/src/base/theme/tailwind-theme.css +13 -5
  102. package/src/base/theme/theme-bridge.css +8 -0
  103. package/src/base/theme/themes/classic.css +15 -11
  104. package/src/base/theme/tokens.css +36 -10
  105. package/src/base/utils/php-wire.ts +54 -0
  106. package/src/contracts/block-data/data-display.ts +46 -337
  107. package/src/contracts/block-data/interactive.ts +18 -23
  108. package/src/contracts/block-data/shared.ts +2 -14
  109. package/src/contracts/generated/index.ts +2 -2
  110. package/src/contracts/generated/schemas.ts +312 -9
  111. package/src/contracts/generated/types.ts +314 -8
  112. package/src/i18n/locales/en/ui.json +1 -0
  113. package/src/i18n/locales/pt-BR/ui.json +1 -0
  114. package/src/lib/hooks/use-prefers-reduced-motion.ts +32 -0
  115. package/src/primitives/reui/badge.tsx +19 -14
  116. package/src/primitives/reui/sidebar.tsx +30 -3
  117. package/src/theme.css +11 -5
  118. package/dist-lib/chunks/subpath-DoiyWIYV.js +0 -25
@@ -2,342 +2,51 @@
2
2
  * Data display block types — read-only blocks that present information.
3
3
  *
4
4
  * Includes DenseTable, MetricCard, EmptyState, StatusStrip, DetailPanel,
5
- * ActivityTimeline, MarkdownPanel, CardGrid, and LinkList.
5
+ * ActivityTimeline, MarkdownPanel, CardGrid, LinkList and Chart.
6
+ *
7
+ * GENERATED from middag-php-ui (the canonical wire contract: PHP schema-only
8
+ * value objects → JSON Schema → these types). This module re-exports them under
9
+ * the stable public names. Open enums (variants, tones, formats, intents) are
10
+ * typed as their known values or any other string; PHP may send an empty map
11
+ * as `[]` (rows, filters), so consumers normalise at the block boundary (see
12
+ * `@/base/utils/php-wire`).
6
13
  */
7
14
 
8
- import type { ConditionalAction, ExecutableAction } from "./actions";
9
- import type { EmptyStateDef, EntityRef } from "./shared";
10
-
11
- // ── DenseTableBlock ──────────────────────────────────────────────────────────
12
-
13
- /** Display format for `timestamp` column values. Defaults to "relative". */
14
- export type TimestampFormat = "relative" | "datetime" | "date" | "time" | "iso";
15
-
16
- export interface DenseTableColumnDef {
17
- key: string;
18
- label: string;
19
- sortable?: boolean;
20
- searchable?: boolean;
21
- variant?:
22
- | "text"
23
- | "status"
24
- | "badge"
25
- | "boolean"
26
- | "timestamp"
27
- | "link"
28
- | "rich_status"
29
- | "html"
30
- | "link_group"
31
- | "annotated"
32
- | "progress";
33
- /** Display format for `variant: "timestamp"` columns. Defaults to "relative". */
34
- timestampFormat?: TimestampFormat;
35
- /** URL pattern for link columns. Interpolated per row (e.g. "/organizations/{organizationId}"). */
36
- href?: string;
37
- /** Entity reference for link resolution via PageContract.entities map. */
38
- entity?: EntityRef;
39
- minWidth?: number;
40
- /**
41
- * Cap in pixels. Longer content is clipped to one line with an ellipsis, and
42
- * the full value stays in the DOM as the cell's `title`.
43
- *
44
- * Without a cap a column grows until the widest value fits, so a single long
45
- * row can push the table past the width of the page. Capping in the column
46
- * keeps the value intact — selectable, searchable by the browser, readable on
47
- * hover — where trimming it in the data would not.
48
- */
49
- maxWidth?: number;
50
- /**
51
- * Status value → semantic intent, for `variant: "status"` and `"badge"`.
52
- *
53
- * Those variants resolve their colour by looking the displayed text up in a
54
- * built-in English map, so a translated label matches nothing and every row
55
- * renders neutral. Supplying the mapping for the labels this column actually
56
- * shows is what lets a localized status column keep its colours. Keys are
57
- * matched case-insensitively.
58
- */
59
- statusMap?: Record<string, StatusIntent>;
60
- }
61
-
62
- /** Semantic intents a status cell can resolve to. */
63
- export type StatusIntent = "success" | "warning" | "destructive" | "secondary" | "info" | "default";
64
-
65
- export interface DenseTablePagination {
66
- page: number;
67
- perPage: number;
68
- total: number;
69
- lastPage: number;
70
- }
71
-
72
- export interface DenseTableSort {
73
- column: string | null;
74
- direction: "asc" | "desc" | null;
75
- }
76
-
77
- export interface DenseTableFilterDef {
78
- key: string;
79
- label: string;
80
- type: "select" | "multiselect" | "date_range";
81
- options?: Array<{ value: string; label: string }>;
82
- }
83
-
84
- // ── Rich column value types ─────────────────────────────────────────────────
85
-
86
- export interface RichStatusValue {
87
- label: string;
88
- appearance: "success" | "warning" | "danger" | "info" | "neutral";
89
- icon?: string;
90
- }
91
-
92
- /** Structured value for the `annotated` column variant. */
93
- export interface AnnotatedValue {
94
- /** Primary text. */
95
- text: string;
96
- /** Optional prefix badge (colored square with 1-2 characters). */
97
- badge?: { label: string; color: string };
98
- /** Optional secondary text (rendered in muted mono below the primary text). */
99
- sublabel?: string;
100
- /** Semantic color applied to the primary text. */
101
- appearance?: "success" | "warning" | "danger" | "info" | "neutral";
102
- }
103
-
104
- /** Structured value for the `progress` column variant. */
105
- export interface ProgressValue {
106
- /** Current value. */
107
- value: number;
108
- /** Maximum value the bar represents. Defaults to 100. */
109
- max?: number;
110
- /** Label shown beside the bar. Defaults to the computed percentage (e.g. "75%"). */
111
- label?: string;
112
- /** Semantic color applied to the bar fill. Defaults to the primary color. */
113
- appearance?: "success" | "warning" | "danger" | "info" | "neutral";
114
- }
115
-
116
- export interface LinkGroupItem {
117
- icon: string;
118
- href: string | null;
119
- label: string;
120
- external?: boolean;
121
- }
122
-
123
- export interface DenseTableBlockData {
124
- columns: DenseTableColumnDef[];
125
- rows: Record<string, unknown>[];
126
- pagination: DenseTablePagination;
127
- sort: DenseTableSort;
128
- filters: {
129
- available: DenseTableFilterDef[];
130
- applied: Record<string, string | string[]>;
131
- };
132
- /** URL pattern for row click navigation. Interpolated per row (e.g. "/organizations/{id}"). */
133
- rowHref?: string;
134
- rowActions?: ConditionalAction[];
135
- bulkActions?: ExecutableAction[];
136
- searchPlaceholder?: string;
137
- emptyState?: EmptyStateDef;
138
- /**
139
- * The toolbar's "save as view" control.
140
- *
141
- * Absent, the control does not render — it has no meaning on a table whose
142
- * page has nowhere to keep a view. Present, it fires this action, and the
143
- * page decides what saving means: the table knows the current query, but not
144
- * that views exist.
145
- *
146
- * `saveViewActive` fills the star, for pages where the control toggles rather
147
- * than only creates.
148
- */
149
- saveViewAction?: ExecutableAction;
150
- saveViewActive?: boolean;
151
- }
152
-
153
- // ── MetricCardBlock ──────────────────────────────────────────────────────────
154
-
155
- export interface MetricCardBlockData {
156
- value: string | number;
157
- delta?: string;
158
- deltaDirection?: "positive" | "negative" | "neutral";
159
- label: string;
160
- icon?: string;
161
- href?: string;
162
- locale?: string;
163
- compact?: boolean;
164
- }
165
-
166
- // ── EmptyStateBlock ──────────────────────────────────────────────────────────
167
-
168
- export type EmptyStateVariant = "first-use" | "no-results" | "error" | "permission";
169
-
170
- export interface EmptyStateBlockData {
171
- variant?: EmptyStateVariant;
172
- icon?: string;
173
- /** URL to a Lottie JSON animation. When provided, replaces the icon with an animated illustration. */
174
- lottieUrl?: string;
175
- description: string;
176
- cta?: {
177
- label: string;
178
- href?: string;
179
- method?: "get" | "post";
180
- };
181
- ctaSecondary?: {
182
- label: string;
183
- href: string;
184
- };
185
- }
186
-
187
- // ── StatusStripBlock ─────────────────────────────────────────────────────────
188
-
189
- export type StatusStripTone = "success" | "warning" | "danger" | "neutral";
190
- export type StatusItemAppearance = "success" | "warning" | "danger" | "info" | "neutral";
191
-
192
- export interface StatusStripItem {
193
- key: string;
194
- label: string;
195
- value: string;
196
- appearance: StatusItemAppearance;
197
- tooltip?: string;
198
- href?: string;
199
- }
200
-
201
- export interface StatusStripBlockData {
202
- score?: number;
203
- tone?: StatusStripTone;
204
- items: StatusStripItem[];
205
- }
206
-
207
- // ── DetailPanelBlock ─────────────────────────────────────────────────────────
208
-
209
- export interface DetailPanelFieldDef {
210
- key: string;
211
- label: string;
212
- value: string | number | boolean | null;
213
- kind?: "text" | "status" | "timestamp" | "boolean" | "link" | "code" | "email";
214
- copyable?: boolean;
215
- href?: string;
216
- /**
217
- * Entity link for this field value.
218
- * Unlike DenseTable (where entity.id is a field name in the row), here
219
- * entity.id is the actual entity ID value (e.g. 1, "abc") because
220
- * DetailPanel fields carry inline values, not tabular rows.
221
- */
222
- entity?: { type: string; id: string | number };
223
- }
224
-
225
- export interface DetailPanelSectionDef {
226
- id: string;
227
- title: string;
228
- fields: DetailPanelFieldDef[];
229
- defaultCollapsed?: boolean;
230
- actions?: ExecutableAction[];
231
- }
232
-
233
- export interface DetailPanelBlockData {
234
- sections: DetailPanelSectionDef[];
235
- columns?: 1 | 2;
236
- }
237
-
238
- // ── ActivityTimelineBlock ────────────────────────────────────────────────────
239
-
240
- export interface ActivityTimelineEntry {
241
- id: string;
242
- actor: string;
243
- actorHref?: string;
244
- action: string;
245
- detail?: string;
246
- icon: string;
247
- color: "success" | "info" | "warning" | "destructive" | "neutral";
248
- timestamp: number;
249
- /**
250
- * Optional read/acknowledge affordance. When `markReadHref` is present
251
- * the block renders a "mark as read" action that POSTs to it; `read` reflects
252
- * the current acknowledged state (a read entry hides the action / dims). Both
253
- * are additive and optional — entries without them render unchanged.
254
- */
255
- read?: boolean;
256
- markReadHref?: string;
257
- }
258
-
259
- export interface ActivityTimelineBlockData {
260
- groups: Array<{
261
- label: string;
262
- entries: ActivityTimelineEntry[];
263
- }>;
264
- hasMore?: boolean;
265
- loadMoreHref?: string;
266
- limit?: number;
267
- }
268
-
269
- // ── MarkdownPanelBlock ───────────────────────────────────────────────────────
270
-
271
- export interface MarkdownPanelBlockData {
272
- content: string;
273
- maxHeight?: number;
274
- }
275
-
276
- // ── CardGridBlock ───────────────────────────────────────────────────────────
277
-
278
- export interface CardGridColumnDef {
279
- key: string;
280
- label: string;
281
- kind?: "text" | "status" | "badge" | "boolean" | "timestamp" | "number";
282
- }
283
-
284
- export interface CardGridBlockData {
285
- columns: CardGridColumnDef[];
286
- rows: Record<string, unknown>[];
287
- variant?: "default" | "store" | "connector";
288
- emptyState?: EmptyStateDef;
289
- /** URL pattern for an edit shortcut icon on each card. Interpolated per row (e.g. "/stores/{id}/edit"). */
290
- editHref?: string;
291
- /** Per-card action buttons (e.g. delete), rendered alongside the edit shortcut. */
292
- rowActions?: ConditionalAction[];
293
- }
294
-
295
- // ── LinkListBlock ───────────────────────────────────────────────────────────
296
-
297
- export interface LinkListItem {
298
- label: string;
299
- href: string | null;
300
- icon?: string;
301
- description?: string;
302
- external?: boolean;
303
- /**
304
- * Short text pinned to the right of the row — a count, a total, a shortcut.
305
- *
306
- * A facet list reads as two columns: what it is on the left, how many on the
307
- * right. Folded into the label it becomes part of the name and the eye has to
308
- * parse each row to find the number.
309
- */
310
- trailing?: string;
311
- /**
312
- * Marks the row as the current selection, drawn as a filled background.
313
- *
314
- * A list that filters something needs to say which entry is doing it. Without
315
- * this the only way to state it is inside the label text, which reads as part
316
- * of the name rather than as state.
317
- */
318
- active?: boolean;
319
- }
320
-
321
- export interface LinkListBlockData {
322
- items: LinkListItem[];
323
- }
324
-
325
- // ── ChartBlock (free) ────────────────────────────────────────────────────────
326
-
327
- export interface ChartSeries {
328
- /** Field key on each data row this series plots. */
329
- key: string;
330
- /** Human-facing series label. */
331
- label: string;
332
- /** Optional CSS color token, e.g. "var(--chart-1)". */
333
- color?: string;
334
- }
335
-
336
- export interface ChartBlockData {
337
- chartType: "line" | "bar" | "area";
338
- /** Field key on each data row used for the x-axis category. */
339
- categoryKey: string;
340
- series: ChartSeries[];
341
- data: Record<string, unknown>[];
342
- options?: { showLegend?: boolean; showGrid?: boolean };
343
- }
15
+ import type { StatusStripItem } from "@/contracts/generated";
16
+
17
+ export type {
18
+ ActivityTimelineBlockData,
19
+ ActivityTimelineEntry,
20
+ AnnotatedValue,
21
+ CardGridBlockData,
22
+ CardGridColumnDef,
23
+ CardGridVariant,
24
+ ChartBlockData,
25
+ ChartSeries,
26
+ DeltaDirection,
27
+ DenseTableBlockData,
28
+ DenseTableColumnDef,
29
+ DenseTableFilterDef,
30
+ DenseTablePagination,
31
+ DenseTableSort,
32
+ DetailPanelBlockData,
33
+ DetailPanelFieldDef,
34
+ DetailPanelSectionDef,
35
+ EmptyStateBlockData,
36
+ EmptyStateVariant,
37
+ LinkGroupItem,
38
+ LinkListBlockData,
39
+ LinkListItem,
40
+ MarkdownPanelBlockData,
41
+ MetricCardBlockData,
42
+ ProgressValue,
43
+ RichStatusValue,
44
+ StatusIntent,
45
+ StatusStripBlockData,
46
+ StatusStripItem,
47
+ StatusStripTone,
48
+ TimestampFormat,
49
+ } from "@/contracts/generated";
50
+
51
+ /** Semantic appearance of a status-strip item. */
52
+ export type StatusItemAppearance = StatusStripItem["appearance"];
@@ -1,34 +1,29 @@
1
1
  /**
2
2
  * Interactive block types — blocks with user interaction beyond read-only display.
3
3
  *
4
- * Community tier: ActionGrid + Tabs. The Pro interactive blocks
5
- * (SentenceBuilder, ConditionTree, FlowEditor, FormBuilder, KanbanBoard) ship as
6
- * generated types in @middag-io/react-pro (sourced from Middag\Core\Ui).
4
+ * Community tier: ActionGrid + Tabs, GENERATED from middag-php-ui and re-exported
5
+ * under the stable public names. The extended interactive blocks ship as
6
+ * generated types in their own package.
7
7
  */
8
8
 
9
- import type { ActionBase } from "./actions";
9
+ import type {
10
+ ActionGridBlockData as WireActionGridBlockData,
11
+ ActionGridItem as WireActionGridItem,
12
+ } from "@/contracts/generated";
10
13
 
11
- // ── ActionGridBlock ─────────────────────────────────────────────────────────
14
+ import type { ActionConfirmation } from "./actions";
12
15
 
13
- /** A card in the action grid: the canonical Action plus card presentation. */
14
- export interface ActionGridItem extends ActionBase {
15
- title: string;
16
- description: string;
17
- }
18
-
19
- export interface ActionGridBlockData {
20
- items: ActionGridItem[];
21
- flash?: { success: boolean; message: string } | null;
22
- }
23
-
24
- // ── TabsBlock ────────────────────────────────────────────────────────────────
16
+ export type { TabsBlockData } from "@/contracts/generated";
25
17
 
26
18
  /**
27
- * Composite block: organizes inner blocks into tabs. Tab items are the wire
28
- * `Tab` VO produced by middag-php-ui (`{ id, label, blocks }`); `defaultTab`
29
- * selects the initially-open tab by `id`.
19
+ * A card in the action grid: the generated wire item (the canonical Action plus
20
+ * `title` and `description`) with the client confirmation overlay.
30
21
  */
31
- export interface TabsBlockData {
32
- tabs: import("@/contracts/generated").Tab[];
33
- defaultTab?: string;
22
+ export interface ActionGridItem extends Omit<WireActionGridItem, "confirmation"> {
23
+ confirmation?: ActionConfirmation;
34
24
  }
25
+
26
+ /** The generated action-grid payload, with the overlaid items. */
27
+ export type ActionGridBlockData = Omit<WireActionGridBlockData, "items"> & {
28
+ items: ActionGridItem[];
29
+ };
@@ -8,13 +8,7 @@
8
8
 
9
9
  // ── EntityRef (shared by columns and fields that link to navigable entities) ─
10
10
 
11
- /** Reference to a navigable entity. Resolved via PageContract.entities map. */
12
- export interface EntityRef {
13
- /** Entity type key (matches a key in PageContract.entities). */
14
- type: string;
15
- /** Field name in the row/record that contains the entity's ID value. */
16
- id: string;
17
- }
11
+ export type { EntityRef } from "@/contracts/generated";
18
12
 
19
13
  // ── Form conditions & validation ────────────────────────────────────────────
20
14
 
@@ -35,10 +29,4 @@ export interface FormFieldEntityOption {
35
29
 
36
30
  // ── Empty state (shared by blocks with empty states) ────────────────────────
37
31
 
38
- /** Shared empty state configuration used by blocks with empty states. */
39
- export interface EmptyStateDef {
40
- icon?: string;
41
- title?: string;
42
- description?: string;
43
- cta?: { label: string; href: string };
44
- }
32
+ export type { EmptyStateDef } from "@/contracts/generated";
@@ -7,9 +7,9 @@
7
7
  * Regenerate: npm run gen:contracts
8
8
  * Drift gate: npm run gen:contracts:check
9
9
  *
10
- * @source middag-io/middag-php-ui@v1.14.0 schema/{page-contract.json,fragment.json,shared-props.json}
10
+ * @source middag-io/middag-php-ui@v2.0.0-rc.2 schema/{page-contract.json,fragment.json,shared-props.json}
11
11
  * @contract-version 2
12
- * @hash ed3b25557c7c82c7
12
+ * @hash 78e6ca38e09436d5
13
13
  */
14
14
  export * from "./types.js";
15
15
  export { pageContractSchemaCore, fragmentSchemaCore, sharedPropsSchemaCore } from "./schemas.js";