@vantageos/mosaic 0.2.2 → 0.3.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.
- package/CHANGELOG.md +145 -0
- package/README.md +193 -0
- package/dist/Alert.schema-LPJE5gFP.d.cts +71 -0
- package/dist/Alert.schema-LPJE5gFP.d.ts +71 -0
- package/dist/ConfirmDialog-B3CQQGmJ.d.cts +34 -0
- package/dist/ConfirmDialog-B3CQQGmJ.d.ts +34 -0
- package/dist/MarkdownRenderer.schema-Rx7kIeVA.d.cts +22 -0
- package/dist/MarkdownRenderer.schema-Rx7kIeVA.d.ts +22 -0
- package/dist/ProgressBar.schema-CdVYx0Wq.d.cts +22 -0
- package/dist/ProgressBar.schema-CdVYx0Wq.d.ts +22 -0
- package/dist/StatusBadge.schema-1tOjB4Ir.d.cts +22 -0
- package/dist/StatusBadge.schema-1tOjB4Ir.d.ts +22 -0
- package/dist/Tabs.schema-BzcEyeq8.d.cts +79 -0
- package/dist/Tabs.schema-BzcEyeq8.d.ts +79 -0
- package/dist/artifacts.cjs +144 -2
- package/dist/artifacts.cjs.map +1 -1
- package/dist/artifacts.d.cts +3 -21
- package/dist/artifacts.d.ts +3 -21
- package/dist/artifacts.js +144 -2
- package/dist/artifacts.js.map +1 -1
- package/dist/confirmation.cjs +168 -2
- package/dist/confirmation.cjs.map +1 -1
- package/dist/confirmation.d.cts +24 -20
- package/dist/confirmation.d.ts +24 -20
- package/dist/confirmation.js +165 -3
- package/dist/confirmation.js.map +1 -1
- package/dist/display.cjs +272 -2
- package/dist/display.cjs.map +1 -1
- package/dist/display.d.cts +132 -1
- package/dist/display.d.ts +132 -1
- package/dist/display.js +267 -3
- package/dist/display.js.map +1 -1
- package/dist/forms.cjs +1415 -0
- package/dist/forms.cjs.map +1 -0
- package/dist/forms.d.cts +159 -0
- package/dist/forms.d.ts +159 -0
- package/dist/forms.js +1334 -0
- package/dist/forms.js.map +1 -0
- package/dist/index-CwXVgtGb.d.cts +917 -0
- package/dist/index-CwXVgtGb.d.ts +917 -0
- package/dist/index.cjs +315 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -6
- package/dist/index.d.ts +11 -6
- package/dist/index.js +304 -3
- package/dist/index.js.map +1 -1
- package/dist/input.cjs +19 -0
- package/dist/input.cjs.map +1 -1
- package/dist/input.d.cts +4 -34
- package/dist/input.d.ts +4 -34
- package/dist/input.js +18 -1
- package/dist/input.js.map +1 -1
- package/dist/media.cjs +144 -2
- package/dist/media.cjs.map +1 -1
- package/dist/media.d.cts +3 -21
- package/dist/media.d.ts +3 -21
- package/dist/media.js +144 -2
- package/dist/media.js.map +1 -1
- package/dist/preact/artifacts.d.ts +39 -1
- package/dist/preact/artifacts.js +234 -0
- package/dist/preact/artifacts.js.map +1 -1
- package/dist/preact/confirmation.d.ts +115 -1
- package/dist/preact/confirmation.js +503 -0
- package/dist/preact/confirmation.js.map +1 -1
- package/dist/preact/display.d.ts +366 -1
- package/dist/preact/display.js +774 -0
- package/dist/preact/display.js.map +1 -1
- package/dist/preact/forms.d.ts +875 -0
- package/dist/preact/forms.js +1326 -0
- package/dist/preact/forms.js.map +1 -0
- package/dist/preact/input.d.ts +88 -1
- package/dist/preact/input.js +194 -0
- package/dist/preact/input.js.map +1 -1
- package/dist/preact/progress.d.ts +35 -1
- package/dist/preact/progress.js +263 -0
- package/dist/preact/progress.js.map +1 -1
- package/dist/progress.cjs +144 -2
- package/dist/progress.cjs.map +1 -1
- package/dist/progress.d.cts +3 -21
- package/dist/progress.d.ts +3 -21
- package/dist/progress.js +144 -2
- package/dist/progress.js.map +1 -1
- package/dist/react/artifacts.cjs +241 -0
- package/dist/react/artifacts.cjs.map +1 -1
- package/dist/react/artifacts.d.cts +20 -1
- package/dist/react/artifacts.d.ts +20 -1
- package/dist/react/artifacts.js +234 -0
- package/dist/react/artifacts.js.map +1 -1
- package/dist/react/confirmation.cjs +513 -0
- package/dist/react/confirmation.cjs.map +1 -1
- package/dist/react/confirmation.d.cts +21 -1
- package/dist/react/confirmation.d.ts +21 -1
- package/dist/react/confirmation.js +503 -0
- package/dist/react/confirmation.js.map +1 -1
- package/dist/react/display.cjs +788 -0
- package/dist/react/display.cjs.map +1 -1
- package/dist/react/display.d.cts +129 -1
- package/dist/react/display.d.ts +129 -1
- package/dist/react/display.js +771 -0
- package/dist/react/display.js.map +1 -1
- package/dist/react/forms.cjs +1387 -0
- package/dist/react/forms.cjs.map +1 -0
- package/dist/react/forms.d.cts +5 -0
- package/dist/react/forms.d.ts +5 -0
- package/dist/react/forms.js +1326 -0
- package/dist/react/forms.js.map +1 -0
- package/dist/react/input.cjs +197 -0
- package/dist/react/input.cjs.map +1 -1
- package/dist/react/input.d.cts +13 -1
- package/dist/react/input.d.ts +13 -1
- package/dist/react/input.js +194 -0
- package/dist/react/input.js.map +1 -1
- package/dist/react/progress.cjs +266 -0
- package/dist/react/progress.cjs.map +1 -1
- package/dist/react/progress.d.cts +17 -1
- package/dist/react/progress.d.ts +17 -1
- package/dist/react/progress.js +263 -0
- package/dist/react/progress.js.map +1 -1
- package/package.json +87 -61
- package/registry.yaml +167 -1
package/dist/preact/display.d.ts
CHANGED
|
@@ -1,2 +1,367 @@
|
|
|
1
|
+
import * as preact from 'preact';
|
|
2
|
+
import { ComponentChildren, h } from 'preact';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { Observable } from 'rxjs';
|
|
1
7
|
|
|
2
|
-
|
|
8
|
+
/**
|
|
9
|
+
* EmptyState component props schema.
|
|
10
|
+
*
|
|
11
|
+
* Empty-set illustration + title + description + optional CTA.
|
|
12
|
+
* Consumer-driven i18n: caller passes already-localized strings.
|
|
13
|
+
*
|
|
14
|
+
* icon — optional ReactNode / PreactNode passed by the caller
|
|
15
|
+
* title — required heading (h2, consumer-driven i18n)
|
|
16
|
+
* description — optional supporting text
|
|
17
|
+
* action — optional CTA: { label, onClick, variant? }
|
|
18
|
+
*/
|
|
19
|
+
declare const EmptyStatePropsSchema: z.ZodObject<{
|
|
20
|
+
title: z.ZodString;
|
|
21
|
+
description: z.ZodOptional<z.ZodString>;
|
|
22
|
+
action: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
label: z.ZodString;
|
|
24
|
+
variant: z.ZodDefault<z.ZodEnum<["primary", "secondary"]>>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
label: string;
|
|
27
|
+
variant: "primary" | "secondary";
|
|
28
|
+
}, {
|
|
29
|
+
label: string;
|
|
30
|
+
variant?: "primary" | "secondary" | undefined;
|
|
31
|
+
}>>;
|
|
32
|
+
locale: z.ZodDefault<z.ZodEnum<["en", "fr"]>>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
title: string;
|
|
35
|
+
locale: "en" | "fr";
|
|
36
|
+
description?: string | undefined;
|
|
37
|
+
action?: {
|
|
38
|
+
label: string;
|
|
39
|
+
variant: "primary" | "secondary";
|
|
40
|
+
} | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
title: string;
|
|
43
|
+
description?: string | undefined;
|
|
44
|
+
action?: {
|
|
45
|
+
label: string;
|
|
46
|
+
variant?: "primary" | "secondary" | undefined;
|
|
47
|
+
} | undefined;
|
|
48
|
+
locale?: "en" | "fr" | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
type EmptyStatePropsSchemaOutput = z.output<typeof EmptyStatePropsSchema>;
|
|
51
|
+
/**
|
|
52
|
+
* Full EmptyState props including framework-specific node types and callback.
|
|
53
|
+
* `icon` and `action.onClick` are excluded from Zod (functions/nodes are not serializable).
|
|
54
|
+
*
|
|
55
|
+
* Note: action.variant is optional for callers — Zod applies "primary" default at parse time.
|
|
56
|
+
*/
|
|
57
|
+
type EmptyStateProps = Omit<EmptyStatePropsSchemaOutput, "action"> & {
|
|
58
|
+
icon?: any;
|
|
59
|
+
action?: {
|
|
60
|
+
label: string;
|
|
61
|
+
variant?: "primary" | "secondary";
|
|
62
|
+
onClick: () => void;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
declare function validateEmptyStateProps(raw: unknown): EmptyStatePropsSchemaOutput;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* EmptyState — cross-runtime empty-set display primitive (Preact 10 implementation).
|
|
69
|
+
*
|
|
70
|
+
* Accepts `Record<string, unknown>` for MCP postMessage injection safety.
|
|
71
|
+
* Zod validation narrows before render. Invalid props → accessible error span.
|
|
72
|
+
*
|
|
73
|
+
* WCAG-AA:
|
|
74
|
+
* - <section aria-label={title}> → role="region" landmark (no Biome lint, correct semantics)
|
|
75
|
+
* - heading hierarchy: h2 (title) — caller manages the h1 context
|
|
76
|
+
* - action button is keyboard-accessible (tab + enter/space)
|
|
77
|
+
*/
|
|
78
|
+
declare function EmptyState(raw: Omit<EmptyStateProps, "locale"> & Partial<Pick<EmptyStateProps, "locale">> & {
|
|
79
|
+
icon?: ComponentChildren;
|
|
80
|
+
}): preact.JSX.Element;
|
|
81
|
+
|
|
82
|
+
/** @jsxRuntime classic */
|
|
83
|
+
/** @jsx h */
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Skeleton — cross-runtime loading placeholder (Preact 10 implementation).
|
|
87
|
+
*
|
|
88
|
+
* Structurally identical to the React runtime; JSX differences:
|
|
89
|
+
* - `class` instead of `className`
|
|
90
|
+
* - Preact h/Fragment imports
|
|
91
|
+
* - No "use client" directive (Preact runs in extension context)
|
|
92
|
+
*
|
|
93
|
+
* WCAG-AA: role="status" + aria-busy="true" + aria-label via t()
|
|
94
|
+
*/
|
|
95
|
+
declare function Skeleton(raw: Record<string, unknown>): h.JSX.Element;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Skeleton component props schema.
|
|
99
|
+
*
|
|
100
|
+
* variant — shape of the placeholder:
|
|
101
|
+
* "rect" → rectangular block (default)
|
|
102
|
+
* "circle" → circular avatar / icon placeholder
|
|
103
|
+
* "text" → single or multi-line text placeholder
|
|
104
|
+
*
|
|
105
|
+
* width / height — CSS values (string) or pixels (number).
|
|
106
|
+
* "rect" defaults: width="100%", height=100
|
|
107
|
+
* "circle" defaults: width=height (equal, square rendered as circle)
|
|
108
|
+
* "text" defaults: width="100%", height=16
|
|
109
|
+
*
|
|
110
|
+
* count — number of text line spans (only meaningful for variant="text").
|
|
111
|
+
* Default 1. Ignored for rect/circle.
|
|
112
|
+
*
|
|
113
|
+
* animation — shimmer style:
|
|
114
|
+
* "pulse" → opacity pulse (default)
|
|
115
|
+
* "wave" → left-to-right gradient sweep
|
|
116
|
+
* "none" → static placeholder (auto-selected when prefers-reduced-motion)
|
|
117
|
+
*/
|
|
118
|
+
declare const SkeletonPropsSchema: z.ZodObject<{
|
|
119
|
+
variant: z.ZodDefault<z.ZodEnum<["rect", "circle", "text"]>>;
|
|
120
|
+
width: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
121
|
+
height: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
122
|
+
count: z.ZodDefault<z.ZodNumber>;
|
|
123
|
+
animation: z.ZodDefault<z.ZodEnum<["pulse", "wave", "none"]>>;
|
|
124
|
+
locale: z.ZodDefault<z.ZodEnum<["en", "fr"]>>;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
variant: "circle" | "rect" | "text";
|
|
127
|
+
locale: "en" | "fr";
|
|
128
|
+
count: number;
|
|
129
|
+
animation: "none" | "pulse" | "wave";
|
|
130
|
+
width?: string | number | undefined;
|
|
131
|
+
height?: string | number | undefined;
|
|
132
|
+
}, {
|
|
133
|
+
variant?: "circle" | "rect" | "text" | undefined;
|
|
134
|
+
locale?: "en" | "fr" | undefined;
|
|
135
|
+
width?: string | number | undefined;
|
|
136
|
+
height?: string | number | undefined;
|
|
137
|
+
count?: number | undefined;
|
|
138
|
+
animation?: "none" | "pulse" | "wave" | undefined;
|
|
139
|
+
}>;
|
|
140
|
+
type SkeletonProps = z.infer<typeof SkeletonPropsSchema>;
|
|
141
|
+
declare function validateSkeletonProps(raw: unknown): SkeletonProps;
|
|
142
|
+
/**
|
|
143
|
+
* Resolve final width/height CSS values given the variant and raw props.
|
|
144
|
+
* Centralised here so React + Preact runtimes share identical defaults.
|
|
145
|
+
*/
|
|
146
|
+
declare function resolveSkeletonDimensions(variant: SkeletonProps["variant"], width: SkeletonProps["width"], height: SkeletonProps["height"]): {
|
|
147
|
+
widthCss: string;
|
|
148
|
+
heightCss: string;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* VirtualList Zod props schema.
|
|
153
|
+
*
|
|
154
|
+
* Runtime functions (renderItem, estimateSize, onRowClick) are excluded from
|
|
155
|
+
* Zod per §18.5 (runtime functions not serialisable). They are typed separately
|
|
156
|
+
* in VirtualListProps<T> below.
|
|
157
|
+
*
|
|
158
|
+
* Serialisable fields validated at render time for safe MCP postMessage injection.
|
|
159
|
+
*/
|
|
160
|
+
declare const VirtualListPropsSchema: z.ZodObject<{
|
|
161
|
+
/** Array of items to render — required, can be empty */
|
|
162
|
+
items: z.ZodArray<z.ZodUnknown, "many">;
|
|
163
|
+
/** Fixed row height in px — mutually exclusive with estimateSize */
|
|
164
|
+
itemHeight: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
/** Variable row height estimator — mutually exclusive with itemHeight */
|
|
166
|
+
estimateSize: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodNumber], z.ZodUnknown>, z.ZodNumber>>;
|
|
167
|
+
/** Row renderer — required (runtime function, excluded from strict Zod parse but validated for presence) */
|
|
168
|
+
renderItem: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnknown, z.ZodNumber], z.ZodUnknown>, z.ZodUnknown>>;
|
|
169
|
+
/** Rows to render outside visible area (default: 5) */
|
|
170
|
+
overscan: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
/** CSS class applied to the scroll container */
|
|
172
|
+
className: z.ZodOptional<z.ZodString>;
|
|
173
|
+
/** Locale for built-in empty state + error messages */
|
|
174
|
+
locale: z.ZodOptional<z.ZodEnum<["en", "fr"]>>;
|
|
175
|
+
/** a11y: when provided, rows become keyboard-activable (role=button + tabIndex=0 + Enter/Space) */
|
|
176
|
+
onRowClick: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnknown, z.ZodNumber], z.ZodUnknown>, z.ZodVoid>>;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
items: unknown[];
|
|
179
|
+
locale?: "en" | "fr" | undefined;
|
|
180
|
+
itemHeight?: number | undefined;
|
|
181
|
+
estimateSize?: ((args_0: number, ...args: unknown[]) => number) | undefined;
|
|
182
|
+
renderItem?: ((args_0: unknown, args_1: number, ...args: unknown[]) => unknown) | undefined;
|
|
183
|
+
overscan?: number | undefined;
|
|
184
|
+
className?: string | undefined;
|
|
185
|
+
onRowClick?: ((args_0: unknown, args_1: number, ...args: unknown[]) => void) | undefined;
|
|
186
|
+
}, {
|
|
187
|
+
items: unknown[];
|
|
188
|
+
locale?: "en" | "fr" | undefined;
|
|
189
|
+
itemHeight?: number | undefined;
|
|
190
|
+
estimateSize?: ((args_0: number, ...args: unknown[]) => number) | undefined;
|
|
191
|
+
renderItem?: ((args_0: unknown, args_1: number, ...args: unknown[]) => unknown) | undefined;
|
|
192
|
+
overscan?: number | undefined;
|
|
193
|
+
className?: string | undefined;
|
|
194
|
+
onRowClick?: ((args_0: unknown, args_1: number, ...args: unknown[]) => void) | undefined;
|
|
195
|
+
}>;
|
|
196
|
+
type VirtualListPropsSchemaOutput = z.output<typeof VirtualListPropsSchema>;
|
|
197
|
+
/**
|
|
198
|
+
* Full typed VirtualList props for JSX consumers.
|
|
199
|
+
* Generic over item type T.
|
|
200
|
+
*/
|
|
201
|
+
type VirtualListProps<T = unknown> = {
|
|
202
|
+
/** Array of items to render */
|
|
203
|
+
items: T[];
|
|
204
|
+
/** Fixed row height in px — use when all rows are the same height */
|
|
205
|
+
itemHeight?: number;
|
|
206
|
+
/** Variable height estimator — use when rows have different heights */
|
|
207
|
+
estimateSize?: (index: number) => number;
|
|
208
|
+
/** Required: renders one item */
|
|
209
|
+
renderItem: (item: T, index: number) => ReactNode;
|
|
210
|
+
/** Called when a row is clicked/activated — triggers a11y role=button + keyboard */
|
|
211
|
+
onRowClick?: (item: T, index: number) => void;
|
|
212
|
+
/** Rows rendered outside viewport (default: 5) */
|
|
213
|
+
overscan?: number;
|
|
214
|
+
/** CSS class applied to the scroll container */
|
|
215
|
+
className?: string;
|
|
216
|
+
/** Locale for built-in strings (default: "en") */
|
|
217
|
+
locale?: "en" | "fr";
|
|
218
|
+
};
|
|
219
|
+
/** Validates serialisable portion of VirtualList props — throws on failure */
|
|
220
|
+
declare function validateVirtualListProps(raw: unknown): VirtualListPropsSchemaOutput;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* VirtualList — generic virtualized list component.
|
|
224
|
+
*
|
|
225
|
+
* Cross-runtime: same file used by React 19 and Preact 10 (via preact/compat alias in tsup).
|
|
226
|
+
* Virtualization: @tanstack/react-virtual v3 (already in mosaic deps via TableView).
|
|
227
|
+
* a11y: WCAG-AA — when onRowClick provided, rows get role=button + tabIndex=0 + Enter/Space.
|
|
228
|
+
* Zod-validated serialisable props; renders role="alert" fallback on failure.
|
|
229
|
+
*
|
|
230
|
+
* API:
|
|
231
|
+
* items: T[] — generic item array
|
|
232
|
+
* itemHeight?: number — fixed px height (mutually exclusive with estimateSize)
|
|
233
|
+
* estimateSize?: (index) => number — variable height estimator
|
|
234
|
+
* renderItem: (item, index) => ReactNode — required row renderer
|
|
235
|
+
* onRowClick?: (item, index) => void — a11y click handler
|
|
236
|
+
* overscan?: number — rows outside viewport (default: 5)
|
|
237
|
+
* className?: string — scroll container class
|
|
238
|
+
* locale?: "en" | "fr" — built-in string locale
|
|
239
|
+
*/
|
|
240
|
+
declare function VirtualList<T = unknown>(props: VirtualListProps<T>): react_jsx_runtime.JSX.Element;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* StatusBadge — cross-runtime status indicator badge (Preact 10 implementation).
|
|
244
|
+
*
|
|
245
|
+
* Accepts `Record<string, unknown>` for MCP postMessage injection safety.
|
|
246
|
+
* Zod validation narrows before render. Invalid props → accessible error span.
|
|
247
|
+
*
|
|
248
|
+
* WCAG-AA:
|
|
249
|
+
* - `<output>` has implicit role="status" per ARIA spec §5.3.17
|
|
250
|
+
* - aria-label from `label` prop (falls back to `status` string)
|
|
251
|
+
* - `lang` attribute set to locale for correct AT language announcement
|
|
252
|
+
*
|
|
253
|
+
* Bilingue: EN/FR strings resolved via t() from i18n/strings — no hardcoded literals.
|
|
254
|
+
*/
|
|
255
|
+
declare function StatusBadge(raw: Record<string, unknown>): preact.JSX.Element;
|
|
256
|
+
|
|
257
|
+
declare const StatusBadgePropsSchema: z.ZodObject<{
|
|
258
|
+
status: z.ZodString;
|
|
259
|
+
variant: z.ZodDefault<z.ZodEnum<["success", "warning", "danger", "info", "neutral"]>>;
|
|
260
|
+
label: z.ZodOptional<z.ZodString>;
|
|
261
|
+
locale: z.ZodEnum<["en", "fr"]>;
|
|
262
|
+
}, "strip", z.ZodTypeAny, {
|
|
263
|
+
variant: "success" | "warning" | "danger" | "info" | "neutral";
|
|
264
|
+
status: string;
|
|
265
|
+
locale: "en" | "fr";
|
|
266
|
+
label?: string | undefined;
|
|
267
|
+
}, {
|
|
268
|
+
status: string;
|
|
269
|
+
locale: "en" | "fr";
|
|
270
|
+
label?: string | undefined;
|
|
271
|
+
variant?: "success" | "warning" | "danger" | "info" | "neutral" | undefined;
|
|
272
|
+
}>;
|
|
273
|
+
type StatusBadgeProps = z.infer<typeof StatusBadgePropsSchema>;
|
|
274
|
+
declare function validateProps(raw: unknown): StatusBadgeProps;
|
|
275
|
+
|
|
276
|
+
type ColumnDef<TRow extends Record<string, unknown> = Record<string, unknown>> = {
|
|
277
|
+
key: string;
|
|
278
|
+
header: string;
|
|
279
|
+
render?: (row: TRow) => ReactNode;
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* Validates the serialisable (non-function) portion of TableView props.
|
|
283
|
+
* The `rows$` Observable and `render` callbacks are not Zod-parseable and
|
|
284
|
+
* must be validated at the call-site type level.
|
|
285
|
+
*/
|
|
286
|
+
declare const TableViewPropsSchema: z.ZodObject<{
|
|
287
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
288
|
+
key: z.ZodString;
|
|
289
|
+
header: z.ZodString;
|
|
290
|
+
}, "strip", z.ZodTypeAny, {
|
|
291
|
+
header: string;
|
|
292
|
+
key: string;
|
|
293
|
+
}, {
|
|
294
|
+
header: string;
|
|
295
|
+
key: string;
|
|
296
|
+
}>, "many">;
|
|
297
|
+
virtualizeThreshold: z.ZodDefault<z.ZodNumber>;
|
|
298
|
+
ariaLabel: z.ZodString;
|
|
299
|
+
locale: z.ZodDefault<z.ZodEnum<["en", "fr"]>>;
|
|
300
|
+
}, "strip", z.ZodTypeAny, {
|
|
301
|
+
locale: "en" | "fr";
|
|
302
|
+
columns: {
|
|
303
|
+
header: string;
|
|
304
|
+
key: string;
|
|
305
|
+
}[];
|
|
306
|
+
virtualizeThreshold: number;
|
|
307
|
+
ariaLabel: string;
|
|
308
|
+
}, {
|
|
309
|
+
columns: {
|
|
310
|
+
header: string;
|
|
311
|
+
key: string;
|
|
312
|
+
}[];
|
|
313
|
+
ariaLabel: string;
|
|
314
|
+
locale?: "en" | "fr" | undefined;
|
|
315
|
+
virtualizeThreshold?: number | undefined;
|
|
316
|
+
}>;
|
|
317
|
+
type TableViewPropsSchemaOutput = z.output<typeof TableViewPropsSchema>;
|
|
318
|
+
/**
|
|
319
|
+
* Props for the static TableView — accepts a plain array of rows.
|
|
320
|
+
* Primary API for already-fetched data (no rxjs required).
|
|
321
|
+
*/
|
|
322
|
+
type TableViewProps<TRow extends Record<string, unknown> = Record<string, unknown>> = {
|
|
323
|
+
columns: ColumnDef<TRow>[];
|
|
324
|
+
rows: Partial<TRow>[];
|
|
325
|
+
virtualizeThreshold?: number;
|
|
326
|
+
ariaLabel: string;
|
|
327
|
+
locale?: "en" | "fr";
|
|
328
|
+
/** v0.2.1+: when provided, rows become keyboard-activable (role=button + tabIndex=0 + Enter/Space). 5-BU ABSOLUTE blocker fix. */
|
|
329
|
+
onRowClick?: (row: TRow, index: number) => void;
|
|
330
|
+
};
|
|
331
|
+
/**
|
|
332
|
+
* Props for StreamingTableView — accepts an RxJS Observable for incremental row appending.
|
|
333
|
+
* Consumers using this variant MUST install rxjs ^7.8.0 in their project.
|
|
334
|
+
*/
|
|
335
|
+
type StreamingTableViewProps<TRow extends Record<string, unknown> = Record<string, unknown>> = {
|
|
336
|
+
columns: ColumnDef<TRow>[];
|
|
337
|
+
rows$: Observable<Partial<TRow>[]>;
|
|
338
|
+
virtualizeThreshold?: number;
|
|
339
|
+
ariaLabel: string;
|
|
340
|
+
locale?: "en" | "fr";
|
|
341
|
+
/** v0.2.1+: same semantics as static TableView. */
|
|
342
|
+
onRowClick?: (row: TRow, index: number) => void;
|
|
343
|
+
};
|
|
344
|
+
declare function validateTableViewProps(raw: unknown): TableViewPropsSchemaOutput;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* TableView — Static rows variant (primary API).
|
|
348
|
+
*
|
|
349
|
+
* Accepts `rows: Row[]` for already-fetched data — no rxjs required.
|
|
350
|
+
* Activates TanStack Virtual v3 windowing when rows.length > virtualizeThreshold.
|
|
351
|
+
* Zod-validates serialisable props; renders role="alert" fallback on failure.
|
|
352
|
+
* Fully accessible: aria-rowcount, aria-label, scope="col".
|
|
353
|
+
*/
|
|
354
|
+
declare function TableView<TRow extends Record<string, unknown> = Record<string, unknown>>(props: TableViewProps<TRow>): react_jsx_runtime.JSX.Element;
|
|
355
|
+
/**
|
|
356
|
+
* StreamingTableView — Streaming rows variant (advanced, opt-in).
|
|
357
|
+
*
|
|
358
|
+
* Pattern 4 Streaming Hydration reference implementation.
|
|
359
|
+
* Consumes an RxJS Observable<Row[]> for incremental row appending.
|
|
360
|
+
* Consumers MUST install rxjs ^7.8.0 in their project.
|
|
361
|
+
* Activates TanStack Virtual v3 windowing when rows.length > virtualizeThreshold.
|
|
362
|
+
* Zod-validates serialisable props; renders role="alert" fallback on failure.
|
|
363
|
+
* Fully accessible: aria-rowcount, aria-label, scope="col".
|
|
364
|
+
*/
|
|
365
|
+
declare function StreamingTableView<TRow extends Record<string, unknown> = Record<string, unknown>>(props: StreamingTableViewProps<TRow>): react_jsx_runtime.JSX.Element;
|
|
366
|
+
|
|
367
|
+
export { EmptyState, type EmptyStateProps, EmptyStatePropsSchema, Skeleton, type SkeletonProps, SkeletonPropsSchema, StatusBadge, type StatusBadgeProps, StatusBadgePropsSchema, StreamingTableView, type StreamingTableViewProps, TableView, type TableViewProps, TableViewPropsSchema, VirtualList, type VirtualListProps, VirtualListPropsSchema, resolveSkeletonDimensions, validateEmptyStateProps, validateSkeletonProps, validateProps as validateStatusBadgeProps, validateTableViewProps, validateVirtualListProps };
|