@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/display.d.cts
CHANGED
|
@@ -95,4 +95,135 @@ declare function TableView<TRow extends Record<string, unknown> = Record<string,
|
|
|
95
95
|
*/
|
|
96
96
|
declare function StreamingTableView<TRow extends Record<string, unknown> = Record<string, unknown>>(props: StreamingTableViewProps<TRow>): react_jsx_runtime.JSX.Element;
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
/**
|
|
99
|
+
* EmptyState component props schema.
|
|
100
|
+
*
|
|
101
|
+
* Empty-set illustration + title + description + optional CTA.
|
|
102
|
+
* Consumer-driven i18n: caller passes already-localized strings.
|
|
103
|
+
*
|
|
104
|
+
* icon β optional ReactNode / PreactNode passed by the caller
|
|
105
|
+
* title β required heading (h2, consumer-driven i18n)
|
|
106
|
+
* description β optional supporting text
|
|
107
|
+
* action β optional CTA: { label, onClick, variant? }
|
|
108
|
+
*/
|
|
109
|
+
declare const EmptyStatePropsSchema: z.ZodObject<{
|
|
110
|
+
title: z.ZodString;
|
|
111
|
+
description: z.ZodOptional<z.ZodString>;
|
|
112
|
+
action: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
label: z.ZodString;
|
|
114
|
+
variant: z.ZodDefault<z.ZodEnum<["primary", "secondary"]>>;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
label: string;
|
|
117
|
+
variant: "primary" | "secondary";
|
|
118
|
+
}, {
|
|
119
|
+
label: string;
|
|
120
|
+
variant?: "primary" | "secondary" | undefined;
|
|
121
|
+
}>>;
|
|
122
|
+
locale: z.ZodDefault<z.ZodEnum<["en", "fr"]>>;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
locale: "en" | "fr";
|
|
125
|
+
title: string;
|
|
126
|
+
description?: string | undefined;
|
|
127
|
+
action?: {
|
|
128
|
+
label: string;
|
|
129
|
+
variant: "primary" | "secondary";
|
|
130
|
+
} | undefined;
|
|
131
|
+
}, {
|
|
132
|
+
title: string;
|
|
133
|
+
locale?: "en" | "fr" | undefined;
|
|
134
|
+
description?: string | undefined;
|
|
135
|
+
action?: {
|
|
136
|
+
label: string;
|
|
137
|
+
variant?: "primary" | "secondary" | undefined;
|
|
138
|
+
} | undefined;
|
|
139
|
+
}>;
|
|
140
|
+
type EmptyStatePropsSchemaInput = z.input<typeof EmptyStatePropsSchema>;
|
|
141
|
+
type EmptyStatePropsSchemaOutput = z.output<typeof EmptyStatePropsSchema>;
|
|
142
|
+
/**
|
|
143
|
+
* Full EmptyState props including framework-specific node types and callback.
|
|
144
|
+
* `icon` and `action.onClick` are excluded from Zod (functions/nodes are not serializable).
|
|
145
|
+
*
|
|
146
|
+
* Note: action.variant is optional for callers β Zod applies "primary" default at parse time.
|
|
147
|
+
*/
|
|
148
|
+
type EmptyStateProps = Omit<EmptyStatePropsSchemaOutput, "action"> & {
|
|
149
|
+
icon?: any;
|
|
150
|
+
action?: {
|
|
151
|
+
label: string;
|
|
152
|
+
variant?: "primary" | "secondary";
|
|
153
|
+
onClick: () => void;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
declare function validateEmptyStateProps(raw: unknown): EmptyStatePropsSchemaOutput;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Skeleton β cross-runtime loading placeholder (React 19 implementation).
|
|
160
|
+
*
|
|
161
|
+
* Accepts `Record<string, unknown>` for MCP postMessage injection safety.
|
|
162
|
+
* Zod validation narrows before render. Invalid props β accessible error span.
|
|
163
|
+
*
|
|
164
|
+
* Animation "none" is auto-applied when prefers-reduced-motion is set (via
|
|
165
|
+
* Tailwind's animate-pulse which respects the media query natively), or by
|
|
166
|
+
* passing animation="none" explicitly.
|
|
167
|
+
*
|
|
168
|
+
* WCAG-AA:
|
|
169
|
+
* - role="status" + aria-busy="true" on the container
|
|
170
|
+
* - aria-label resolves via t() in EN/FR
|
|
171
|
+
* - aria-hidden="true" on individual line spans (status role covers the group)
|
|
172
|
+
*/
|
|
173
|
+
declare function Skeleton(raw: Record<string, unknown>): react_jsx_runtime.JSX.Element;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Skeleton component props schema.
|
|
177
|
+
*
|
|
178
|
+
* variant β shape of the placeholder:
|
|
179
|
+
* "rect" β rectangular block (default)
|
|
180
|
+
* "circle" β circular avatar / icon placeholder
|
|
181
|
+
* "text" β single or multi-line text placeholder
|
|
182
|
+
*
|
|
183
|
+
* width / height β CSS values (string) or pixels (number).
|
|
184
|
+
* "rect" defaults: width="100%", height=100
|
|
185
|
+
* "circle" defaults: width=height (equal, square rendered as circle)
|
|
186
|
+
* "text" defaults: width="100%", height=16
|
|
187
|
+
*
|
|
188
|
+
* count β number of text line spans (only meaningful for variant="text").
|
|
189
|
+
* Default 1. Ignored for rect/circle.
|
|
190
|
+
*
|
|
191
|
+
* animation β shimmer style:
|
|
192
|
+
* "pulse" β opacity pulse (default)
|
|
193
|
+
* "wave" β left-to-right gradient sweep
|
|
194
|
+
* "none" β static placeholder (auto-selected when prefers-reduced-motion)
|
|
195
|
+
*/
|
|
196
|
+
declare const SkeletonPropsSchema: z.ZodObject<{
|
|
197
|
+
variant: z.ZodDefault<z.ZodEnum<["rect", "circle", "text"]>>;
|
|
198
|
+
width: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
199
|
+
height: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
200
|
+
count: z.ZodDefault<z.ZodNumber>;
|
|
201
|
+
animation: z.ZodDefault<z.ZodEnum<["pulse", "wave", "none"]>>;
|
|
202
|
+
locale: z.ZodDefault<z.ZodEnum<["en", "fr"]>>;
|
|
203
|
+
}, "strip", z.ZodTypeAny, {
|
|
204
|
+
locale: "en" | "fr";
|
|
205
|
+
variant: "text" | "rect" | "circle";
|
|
206
|
+
count: number;
|
|
207
|
+
animation: "none" | "pulse" | "wave";
|
|
208
|
+
width?: string | number | undefined;
|
|
209
|
+
height?: string | number | undefined;
|
|
210
|
+
}, {
|
|
211
|
+
locale?: "en" | "fr" | undefined;
|
|
212
|
+
width?: string | number | undefined;
|
|
213
|
+
variant?: "text" | "rect" | "circle" | undefined;
|
|
214
|
+
count?: number | undefined;
|
|
215
|
+
height?: string | number | undefined;
|
|
216
|
+
animation?: "none" | "pulse" | "wave" | undefined;
|
|
217
|
+
}>;
|
|
218
|
+
type SkeletonProps = z.infer<typeof SkeletonPropsSchema>;
|
|
219
|
+
declare function validateSkeletonProps(raw: unknown): SkeletonProps;
|
|
220
|
+
/**
|
|
221
|
+
* Resolve final width/height CSS values given the variant and raw props.
|
|
222
|
+
* Centralised here so React + Preact runtimes share identical defaults.
|
|
223
|
+
*/
|
|
224
|
+
declare function resolveSkeletonDimensions(variant: SkeletonProps["variant"], width: SkeletonProps["width"], height: SkeletonProps["height"]): {
|
|
225
|
+
widthCss: string;
|
|
226
|
+
heightCss: string;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export { type ColumnDef, type EmptyStateProps, EmptyStatePropsSchema, type EmptyStatePropsSchemaInput, type EmptyStatePropsSchemaOutput, Skeleton, type SkeletonProps, SkeletonPropsSchema, StreamingTableView, type StreamingTableViewProps, TableView, type TableViewProps, TableViewPropsSchema, type TableViewPropsSchemaInput, type TableViewPropsSchemaOutput, resolveSkeletonDimensions, validateEmptyStateProps, validateSkeletonProps, validateTableViewProps };
|
package/dist/display.d.ts
CHANGED
|
@@ -95,4 +95,135 @@ declare function TableView<TRow extends Record<string, unknown> = Record<string,
|
|
|
95
95
|
*/
|
|
96
96
|
declare function StreamingTableView<TRow extends Record<string, unknown> = Record<string, unknown>>(props: StreamingTableViewProps<TRow>): react_jsx_runtime.JSX.Element;
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
/**
|
|
99
|
+
* EmptyState component props schema.
|
|
100
|
+
*
|
|
101
|
+
* Empty-set illustration + title + description + optional CTA.
|
|
102
|
+
* Consumer-driven i18n: caller passes already-localized strings.
|
|
103
|
+
*
|
|
104
|
+
* icon β optional ReactNode / PreactNode passed by the caller
|
|
105
|
+
* title β required heading (h2, consumer-driven i18n)
|
|
106
|
+
* description β optional supporting text
|
|
107
|
+
* action β optional CTA: { label, onClick, variant? }
|
|
108
|
+
*/
|
|
109
|
+
declare const EmptyStatePropsSchema: z.ZodObject<{
|
|
110
|
+
title: z.ZodString;
|
|
111
|
+
description: z.ZodOptional<z.ZodString>;
|
|
112
|
+
action: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
label: z.ZodString;
|
|
114
|
+
variant: z.ZodDefault<z.ZodEnum<["primary", "secondary"]>>;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
label: string;
|
|
117
|
+
variant: "primary" | "secondary";
|
|
118
|
+
}, {
|
|
119
|
+
label: string;
|
|
120
|
+
variant?: "primary" | "secondary" | undefined;
|
|
121
|
+
}>>;
|
|
122
|
+
locale: z.ZodDefault<z.ZodEnum<["en", "fr"]>>;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
locale: "en" | "fr";
|
|
125
|
+
title: string;
|
|
126
|
+
description?: string | undefined;
|
|
127
|
+
action?: {
|
|
128
|
+
label: string;
|
|
129
|
+
variant: "primary" | "secondary";
|
|
130
|
+
} | undefined;
|
|
131
|
+
}, {
|
|
132
|
+
title: string;
|
|
133
|
+
locale?: "en" | "fr" | undefined;
|
|
134
|
+
description?: string | undefined;
|
|
135
|
+
action?: {
|
|
136
|
+
label: string;
|
|
137
|
+
variant?: "primary" | "secondary" | undefined;
|
|
138
|
+
} | undefined;
|
|
139
|
+
}>;
|
|
140
|
+
type EmptyStatePropsSchemaInput = z.input<typeof EmptyStatePropsSchema>;
|
|
141
|
+
type EmptyStatePropsSchemaOutput = z.output<typeof EmptyStatePropsSchema>;
|
|
142
|
+
/**
|
|
143
|
+
* Full EmptyState props including framework-specific node types and callback.
|
|
144
|
+
* `icon` and `action.onClick` are excluded from Zod (functions/nodes are not serializable).
|
|
145
|
+
*
|
|
146
|
+
* Note: action.variant is optional for callers β Zod applies "primary" default at parse time.
|
|
147
|
+
*/
|
|
148
|
+
type EmptyStateProps = Omit<EmptyStatePropsSchemaOutput, "action"> & {
|
|
149
|
+
icon?: any;
|
|
150
|
+
action?: {
|
|
151
|
+
label: string;
|
|
152
|
+
variant?: "primary" | "secondary";
|
|
153
|
+
onClick: () => void;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
declare function validateEmptyStateProps(raw: unknown): EmptyStatePropsSchemaOutput;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Skeleton β cross-runtime loading placeholder (React 19 implementation).
|
|
160
|
+
*
|
|
161
|
+
* Accepts `Record<string, unknown>` for MCP postMessage injection safety.
|
|
162
|
+
* Zod validation narrows before render. Invalid props β accessible error span.
|
|
163
|
+
*
|
|
164
|
+
* Animation "none" is auto-applied when prefers-reduced-motion is set (via
|
|
165
|
+
* Tailwind's animate-pulse which respects the media query natively), or by
|
|
166
|
+
* passing animation="none" explicitly.
|
|
167
|
+
*
|
|
168
|
+
* WCAG-AA:
|
|
169
|
+
* - role="status" + aria-busy="true" on the container
|
|
170
|
+
* - aria-label resolves via t() in EN/FR
|
|
171
|
+
* - aria-hidden="true" on individual line spans (status role covers the group)
|
|
172
|
+
*/
|
|
173
|
+
declare function Skeleton(raw: Record<string, unknown>): react_jsx_runtime.JSX.Element;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Skeleton component props schema.
|
|
177
|
+
*
|
|
178
|
+
* variant β shape of the placeholder:
|
|
179
|
+
* "rect" β rectangular block (default)
|
|
180
|
+
* "circle" β circular avatar / icon placeholder
|
|
181
|
+
* "text" β single or multi-line text placeholder
|
|
182
|
+
*
|
|
183
|
+
* width / height β CSS values (string) or pixels (number).
|
|
184
|
+
* "rect" defaults: width="100%", height=100
|
|
185
|
+
* "circle" defaults: width=height (equal, square rendered as circle)
|
|
186
|
+
* "text" defaults: width="100%", height=16
|
|
187
|
+
*
|
|
188
|
+
* count β number of text line spans (only meaningful for variant="text").
|
|
189
|
+
* Default 1. Ignored for rect/circle.
|
|
190
|
+
*
|
|
191
|
+
* animation β shimmer style:
|
|
192
|
+
* "pulse" β opacity pulse (default)
|
|
193
|
+
* "wave" β left-to-right gradient sweep
|
|
194
|
+
* "none" β static placeholder (auto-selected when prefers-reduced-motion)
|
|
195
|
+
*/
|
|
196
|
+
declare const SkeletonPropsSchema: z.ZodObject<{
|
|
197
|
+
variant: z.ZodDefault<z.ZodEnum<["rect", "circle", "text"]>>;
|
|
198
|
+
width: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
199
|
+
height: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
200
|
+
count: z.ZodDefault<z.ZodNumber>;
|
|
201
|
+
animation: z.ZodDefault<z.ZodEnum<["pulse", "wave", "none"]>>;
|
|
202
|
+
locale: z.ZodDefault<z.ZodEnum<["en", "fr"]>>;
|
|
203
|
+
}, "strip", z.ZodTypeAny, {
|
|
204
|
+
locale: "en" | "fr";
|
|
205
|
+
variant: "text" | "rect" | "circle";
|
|
206
|
+
count: number;
|
|
207
|
+
animation: "none" | "pulse" | "wave";
|
|
208
|
+
width?: string | number | undefined;
|
|
209
|
+
height?: string | number | undefined;
|
|
210
|
+
}, {
|
|
211
|
+
locale?: "en" | "fr" | undefined;
|
|
212
|
+
width?: string | number | undefined;
|
|
213
|
+
variant?: "text" | "rect" | "circle" | undefined;
|
|
214
|
+
count?: number | undefined;
|
|
215
|
+
height?: string | number | undefined;
|
|
216
|
+
animation?: "none" | "pulse" | "wave" | undefined;
|
|
217
|
+
}>;
|
|
218
|
+
type SkeletonProps = z.infer<typeof SkeletonPropsSchema>;
|
|
219
|
+
declare function validateSkeletonProps(raw: unknown): SkeletonProps;
|
|
220
|
+
/**
|
|
221
|
+
* Resolve final width/height CSS values given the variant and raw props.
|
|
222
|
+
* Centralised here so React + Preact runtimes share identical defaults.
|
|
223
|
+
*/
|
|
224
|
+
declare function resolveSkeletonDimensions(variant: SkeletonProps["variant"], width: SkeletonProps["width"], height: SkeletonProps["height"]): {
|
|
225
|
+
widthCss: string;
|
|
226
|
+
heightCss: string;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export { type ColumnDef, type EmptyStateProps, EmptyStatePropsSchema, type EmptyStatePropsSchemaInput, type EmptyStatePropsSchemaOutput, Skeleton, type SkeletonProps, SkeletonPropsSchema, StreamingTableView, type StreamingTableViewProps, TableView, type TableViewProps, TableViewPropsSchema, type TableViewPropsSchemaInput, type TableViewPropsSchemaOutput, resolveSkeletonDimensions, validateEmptyStateProps, validateSkeletonProps, validateTableViewProps };
|
package/dist/display.js
CHANGED
|
@@ -7,6 +7,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
7
7
|
|
|
8
8
|
// src/i18n/strings.ts
|
|
9
9
|
var EN = {
|
|
10
|
+
// βββ Non-forms components ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
10
11
|
"ProgressBar.aria.label": "Progress",
|
|
11
12
|
"ProgressBar.error.invalidProps": "ProgressBar: invalid props",
|
|
12
13
|
"ConfirmDialog.button.confirm": "Confirm",
|
|
@@ -25,9 +26,80 @@ var EN = {
|
|
|
25
26
|
"TokenDisplayOnceModal.warning.once": "This token will only be shown once. Copy it now.",
|
|
26
27
|
"TokenDisplayOnceModal.copied": "Copied",
|
|
27
28
|
"StatusBadge.aria.status": "Status",
|
|
28
|
-
"StatusBadge.error.invalidProps": "StatusBadge: invalid props"
|
|
29
|
+
"StatusBadge.error.invalidProps": "StatusBadge: invalid props",
|
|
30
|
+
"EmptyState.error.invalidProps": "EmptyState: invalid props",
|
|
31
|
+
"Toast.aria.close": "Close notification",
|
|
32
|
+
"Toast.error.invalidProps": "Toast: invalid props",
|
|
33
|
+
"Alert.aria.dismiss": "Dismiss alert",
|
|
34
|
+
"Alert.error.invalidProps": "Alert: invalid props",
|
|
35
|
+
"VirtualList.empty.message": "No items to display",
|
|
36
|
+
"VirtualList.error.invalidProps": "VirtualList: invalid props",
|
|
37
|
+
"Skeleton.aria.label": "Loading",
|
|
38
|
+
"Skeleton.error.invalidProps": "Skeleton: invalid props",
|
|
39
|
+
// βββ Forms β useMosaicForm βββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
40
|
+
"useMosaicForm.error.invalidProps": "useMosaicForm: invalid options",
|
|
41
|
+
// βββ Forms β FormProvider ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
42
|
+
"FormProvider.error.invalidProps": "FormProvider: invalid props",
|
|
43
|
+
// βββ Forms β FormField ββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
44
|
+
"FormField.error.invalidProps": "FormField: invalid props",
|
|
45
|
+
// βββ Forms β ErrorDisplay βββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
46
|
+
"ErrorDisplay.error.required": "This field is required",
|
|
47
|
+
"ErrorDisplay.error.min": "Value is below the minimum",
|
|
48
|
+
"ErrorDisplay.error.max": "Value exceeds the maximum",
|
|
49
|
+
"ErrorDisplay.error.minLength": "Input is too short",
|
|
50
|
+
"ErrorDisplay.error.maxLength": "Input is too long",
|
|
51
|
+
"ErrorDisplay.error.pattern": "Invalid format",
|
|
52
|
+
"ErrorDisplay.error.email": "Enter a valid email address",
|
|
53
|
+
"ErrorDisplay.error.url": "Enter a valid URL",
|
|
54
|
+
"ErrorDisplay.error.generic": "Invalid value",
|
|
55
|
+
// βββ Forms β SubmitButton βββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
56
|
+
"SubmitButton.aria.submit": "Submit form",
|
|
57
|
+
"SubmitButton.state.loading": "Submitting\u2026",
|
|
58
|
+
"SubmitButton.error.invalidProps": "SubmitButton: invalid props",
|
|
59
|
+
// βββ Forms β Input ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
60
|
+
"Input.aria.label": "Input field",
|
|
61
|
+
"Input.error.required": "This field is required",
|
|
62
|
+
"Input.error.invalid": "Invalid value",
|
|
63
|
+
"Input.error.tooLong": "Input is too long",
|
|
64
|
+
"Input.error.tooShort": "Input is too short",
|
|
65
|
+
"Input.error.invalidProps": "Input: invalid props",
|
|
66
|
+
// βββ Forms β Textarea βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
67
|
+
"Textarea.aria.label": "Text area",
|
|
68
|
+
"Textarea.error.required": "This field is required",
|
|
69
|
+
"Textarea.error.tooLong": "Text is too long",
|
|
70
|
+
"Textarea.counter.remaining": "characters remaining",
|
|
71
|
+
"Textarea.error.invalidProps": "Textarea: invalid props",
|
|
72
|
+
// βββ Forms β FieldArray βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
73
|
+
"FieldArray.aria.list": "List of items",
|
|
74
|
+
"FieldArray.aria.addItem": "Add item",
|
|
75
|
+
"FieldArray.aria.removeItem": "Remove item",
|
|
76
|
+
"FieldArray.error.invalidProps": "FieldArray: invalid props",
|
|
77
|
+
// βββ Forms β Checkbox βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
78
|
+
"Checkbox.aria.label": "Checkbox",
|
|
79
|
+
"Checkbox.error.required": "This field must be checked",
|
|
80
|
+
"Checkbox.error.invalidProps": "Checkbox: invalid props",
|
|
81
|
+
// βββ Forms β MultiSelect ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
82
|
+
"MultiSelect.aria.label": "Multi-select field",
|
|
83
|
+
"MultiSelect.aria.removeChip": "Remove",
|
|
84
|
+
"MultiSelect.error.required": "Select at least one option",
|
|
85
|
+
"MultiSelect.error.maxItems": "Maximum number of selections reached",
|
|
86
|
+
"MultiSelect.placeholder": "Select options\u2026",
|
|
87
|
+
"MultiSelect.search.placeholder": "Search\u2026",
|
|
88
|
+
"MultiSelect.empty": "No options available",
|
|
89
|
+
"MultiSelect.error.invalidProps": "MultiSelect: invalid props",
|
|
90
|
+
// βββ Forms β RadioGroup βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
91
|
+
"RadioGroup.aria.label": "Radio group",
|
|
92
|
+
"RadioGroup.error.required": "Select one option",
|
|
93
|
+
"RadioGroup.error.invalidProps": "RadioGroup: invalid props",
|
|
94
|
+
// βββ Forms β Select βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
95
|
+
"Select.placeholder": "Select an option\u2026",
|
|
96
|
+
"Select.search.placeholder": "Search\u2026",
|
|
97
|
+
"Select.empty": "No options available",
|
|
98
|
+
"Select.error.required": "Select an option",
|
|
99
|
+
"Select.error.invalidProps": "Select: invalid props"
|
|
29
100
|
};
|
|
30
101
|
var FR = {
|
|
102
|
+
// βββ Non-forms components ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
31
103
|
"ProgressBar.aria.label": "Progression",
|
|
32
104
|
"ProgressBar.error.invalidProps": "ProgressBar : propri\xE9t\xE9s invalides",
|
|
33
105
|
"ConfirmDialog.button.confirm": "Confirmer",
|
|
@@ -46,7 +118,77 @@ var FR = {
|
|
|
46
118
|
"TokenDisplayOnceModal.warning.once": "Ce jeton ne sera affich\xE9 qu'une seule fois. Copiez-le maintenant.",
|
|
47
119
|
"TokenDisplayOnceModal.copied": "Copi\xE9",
|
|
48
120
|
"StatusBadge.aria.status": "Statut",
|
|
49
|
-
"StatusBadge.error.invalidProps": "StatusBadge : propri\xE9t\xE9s invalides"
|
|
121
|
+
"StatusBadge.error.invalidProps": "StatusBadge : propri\xE9t\xE9s invalides",
|
|
122
|
+
"EmptyState.error.invalidProps": "EmptyState : propri\xE9t\xE9s invalides",
|
|
123
|
+
"Toast.aria.close": "Fermer la notification",
|
|
124
|
+
"Toast.error.invalidProps": "Toast : propri\xE9t\xE9s invalides",
|
|
125
|
+
"Alert.aria.dismiss": "Fermer l'alerte",
|
|
126
|
+
"Alert.error.invalidProps": "Alert : propri\xE9t\xE9s invalides",
|
|
127
|
+
"VirtualList.empty.message": "Aucun \xE9l\xE9ment \xE0 afficher",
|
|
128
|
+
"VirtualList.error.invalidProps": "VirtualList : propri\xE9t\xE9s invalides",
|
|
129
|
+
"Skeleton.aria.label": "Chargement",
|
|
130
|
+
"Skeleton.error.invalidProps": "Skeleton : propri\xE9t\xE9s invalides",
|
|
131
|
+
// βββ Forms β useMosaicForm βββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
132
|
+
"useMosaicForm.error.invalidProps": "useMosaicForm : options invalides",
|
|
133
|
+
// βββ Forms β FormProvider ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
134
|
+
"FormProvider.error.invalidProps": "FormProvider : propri\xE9t\xE9s invalides",
|
|
135
|
+
// βββ Forms β FormField ββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
136
|
+
"FormField.error.invalidProps": "FormField : propri\xE9t\xE9s invalides",
|
|
137
|
+
// βββ Forms β ErrorDisplay βββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
138
|
+
"ErrorDisplay.error.required": "Ce champ est obligatoire",
|
|
139
|
+
"ErrorDisplay.error.min": "La valeur est inf\xE9rieure au minimum",
|
|
140
|
+
"ErrorDisplay.error.max": "La valeur d\xE9passe le maximum",
|
|
141
|
+
"ErrorDisplay.error.minLength": "La saisie est trop courte",
|
|
142
|
+
"ErrorDisplay.error.maxLength": "La saisie est trop longue",
|
|
143
|
+
"ErrorDisplay.error.pattern": "Format invalide",
|
|
144
|
+
"ErrorDisplay.error.email": "Saisissez une adresse e-mail valide",
|
|
145
|
+
"ErrorDisplay.error.url": "Saisissez une URL valide",
|
|
146
|
+
"ErrorDisplay.error.generic": "Valeur invalide",
|
|
147
|
+
// βββ Forms β SubmitButton βββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
148
|
+
"SubmitButton.aria.submit": "Soumettre le formulaire",
|
|
149
|
+
"SubmitButton.state.loading": "Envoi en cours\u2026",
|
|
150
|
+
"SubmitButton.error.invalidProps": "SubmitButton : propri\xE9t\xE9s invalides",
|
|
151
|
+
// βββ Forms β Input ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
152
|
+
"Input.aria.label": "Champ de saisie",
|
|
153
|
+
"Input.error.required": "Ce champ est obligatoire",
|
|
154
|
+
"Input.error.invalid": "Valeur invalide",
|
|
155
|
+
"Input.error.tooLong": "La saisie est trop longue",
|
|
156
|
+
"Input.error.tooShort": "La saisie est trop courte",
|
|
157
|
+
"Input.error.invalidProps": "Input : propri\xE9t\xE9s invalides",
|
|
158
|
+
// βββ Forms β Textarea βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
159
|
+
"Textarea.aria.label": "Zone de texte",
|
|
160
|
+
"Textarea.error.required": "Ce champ est obligatoire",
|
|
161
|
+
"Textarea.error.tooLong": "Le texte est trop long",
|
|
162
|
+
"Textarea.counter.remaining": "caract\xE8res restants",
|
|
163
|
+
"Textarea.error.invalidProps": "Textarea : propri\xE9t\xE9s invalides",
|
|
164
|
+
// βββ Forms β FieldArray βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
165
|
+
"FieldArray.aria.list": "Liste d'\xE9l\xE9ments",
|
|
166
|
+
"FieldArray.aria.addItem": "Ajouter un \xE9l\xE9ment",
|
|
167
|
+
"FieldArray.aria.removeItem": "Supprimer l'\xE9l\xE9ment",
|
|
168
|
+
"FieldArray.error.invalidProps": "FieldArray : propri\xE9t\xE9s invalides",
|
|
169
|
+
// βββ Forms β Checkbox βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
170
|
+
"Checkbox.aria.label": "Case \xE0 cocher",
|
|
171
|
+
"Checkbox.error.required": "Ce champ doit \xEAtre coch\xE9",
|
|
172
|
+
"Checkbox.error.invalidProps": "Checkbox : propri\xE9t\xE9s invalides",
|
|
173
|
+
// βββ Forms β MultiSelect ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
174
|
+
"MultiSelect.aria.label": "Champ de s\xE9lection multiple",
|
|
175
|
+
"MultiSelect.aria.removeChip": "Retirer",
|
|
176
|
+
"MultiSelect.error.required": "S\xE9lectionnez au moins une option",
|
|
177
|
+
"MultiSelect.error.maxItems": "Nombre maximum de s\xE9lections atteint",
|
|
178
|
+
"MultiSelect.placeholder": "S\xE9lectionner des options\u2026",
|
|
179
|
+
"MultiSelect.search.placeholder": "Rechercher\u2026",
|
|
180
|
+
"MultiSelect.empty": "Aucune option disponible",
|
|
181
|
+
"MultiSelect.error.invalidProps": "MultiSelect : propri\xE9t\xE9s invalides",
|
|
182
|
+
// βββ Forms β RadioGroup βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
183
|
+
"RadioGroup.aria.label": "Groupe de boutons radio",
|
|
184
|
+
"RadioGroup.error.required": "S\xE9lectionnez une option",
|
|
185
|
+
"RadioGroup.error.invalidProps": "RadioGroup : propri\xE9t\xE9s invalides",
|
|
186
|
+
// βββ Forms β Select βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
187
|
+
"Select.placeholder": "S\xE9lectionner une option\u2026",
|
|
188
|
+
"Select.search.placeholder": "Rechercher\u2026",
|
|
189
|
+
"Select.empty": "Aucune option disponible",
|
|
190
|
+
"Select.error.required": "S\xE9lectionnez une option",
|
|
191
|
+
"Select.error.invalidProps": "Select : propri\xE9t\xE9s invalides"
|
|
50
192
|
};
|
|
51
193
|
var TABLE = {
|
|
52
194
|
en: EN,
|
|
@@ -244,6 +386,9 @@ function VirtualTable({
|
|
|
244
386
|
{
|
|
245
387
|
"data-virtual": "true",
|
|
246
388
|
ref: scrollRef,
|
|
389
|
+
tabIndex: 0,
|
|
390
|
+
role: "region",
|
|
391
|
+
"aria-label": ariaLabel,
|
|
247
392
|
style: { height: 400, overflow: "auto", position: "relative" },
|
|
248
393
|
children: /* @__PURE__ */ jsxs(
|
|
249
394
|
"table",
|
|
@@ -300,7 +445,126 @@ function VirtualTable({
|
|
|
300
445
|
}
|
|
301
446
|
);
|
|
302
447
|
}
|
|
448
|
+
var EmptyStatePropsSchema = z.object({
|
|
449
|
+
title: z.string().min(1),
|
|
450
|
+
description: z.string().optional(),
|
|
451
|
+
action: z.object({
|
|
452
|
+
label: z.string().min(1),
|
|
453
|
+
variant: z.enum(["primary", "secondary"]).default("primary")
|
|
454
|
+
}).optional(),
|
|
455
|
+
locale: z.enum(["en", "fr"]).default("en")
|
|
456
|
+
});
|
|
457
|
+
function validateEmptyStateProps(raw) {
|
|
458
|
+
return EmptyStatePropsSchema.parse(raw);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// src/components/display/Skeleton.logic.ts
|
|
462
|
+
function getAnimationClass(animation) {
|
|
463
|
+
switch (animation) {
|
|
464
|
+
case "pulse":
|
|
465
|
+
return "animate-pulse";
|
|
466
|
+
case "wave":
|
|
467
|
+
return "skeleton-wave";
|
|
468
|
+
case "none":
|
|
469
|
+
return "";
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
function getVariantClass(variant) {
|
|
473
|
+
switch (variant) {
|
|
474
|
+
case "rect":
|
|
475
|
+
return "rounded-md";
|
|
476
|
+
case "circle":
|
|
477
|
+
return "rounded-full";
|
|
478
|
+
case "text":
|
|
479
|
+
return "rounded";
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
var SKELETON_BG_CLASS = "bg-gray-200 dark:bg-gray-700";
|
|
483
|
+
function textLineKey(index) {
|
|
484
|
+
return `skeleton-line-${index}`;
|
|
485
|
+
}
|
|
486
|
+
function lastLineWidth(index, total, baseWidth) {
|
|
487
|
+
if (total > 1 && index === total - 1) {
|
|
488
|
+
return "75%";
|
|
489
|
+
}
|
|
490
|
+
return baseWidth;
|
|
491
|
+
}
|
|
492
|
+
var SkeletonPropsSchema = z.object({
|
|
493
|
+
variant: z.enum(["rect", "circle", "text"]).default("rect"),
|
|
494
|
+
width: z.union([z.string().min(1), z.number().positive()]).optional(),
|
|
495
|
+
height: z.union([z.string().min(1), z.number().positive()]).optional(),
|
|
496
|
+
count: z.number().int().min(1).max(20).default(1),
|
|
497
|
+
animation: z.enum(["pulse", "wave", "none"]).default("pulse"),
|
|
498
|
+
locale: z.enum(["en", "fr"]).default("en")
|
|
499
|
+
});
|
|
500
|
+
function validateSkeletonProps(raw) {
|
|
501
|
+
return SkeletonPropsSchema.parse(raw);
|
|
502
|
+
}
|
|
503
|
+
function resolveSkeletonDimensions(variant, width, height) {
|
|
504
|
+
const toCss = (v, fallback) => {
|
|
505
|
+
if (v === void 0) return fallback;
|
|
506
|
+
if (typeof v === "number") return `${v}px`;
|
|
507
|
+
return v;
|
|
508
|
+
};
|
|
509
|
+
if (variant === "circle") {
|
|
510
|
+
const size = width !== void 0 ? toCss(width, "40px") : height !== void 0 ? toCss(height, "40px") : "40px";
|
|
511
|
+
return { widthCss: size, heightCss: size };
|
|
512
|
+
}
|
|
513
|
+
if (variant === "text") {
|
|
514
|
+
return {
|
|
515
|
+
widthCss: toCss(width, "100%"),
|
|
516
|
+
heightCss: toCss(height, "16px")
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
return {
|
|
520
|
+
widthCss: toCss(width, "100%"),
|
|
521
|
+
heightCss: toCss(height, "100px")
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
function SkeletonInner({ variant, width, height, count, animation, locale }) {
|
|
525
|
+
const { widthCss, heightCss } = resolveSkeletonDimensions(variant, width, height);
|
|
526
|
+
const animClass = getAnimationClass(animation);
|
|
527
|
+
const variantClass = getVariantClass(variant);
|
|
528
|
+
const ariaLabel = t("Skeleton.aria.label", locale);
|
|
529
|
+
const baseClass = `${SKELETON_BG_CLASS} ${variantClass} ${animClass}`.trim();
|
|
530
|
+
if (variant === "text") {
|
|
531
|
+
return (
|
|
532
|
+
// biome-ignore lint/a11y/useSemanticElements: role="status" is the correct ARIA pattern for loading indicators; <output> conveys form output semantics which is incorrect here
|
|
533
|
+
/* @__PURE__ */ jsx("div", { role: "status", "aria-label": ariaLabel, "aria-busy": "true", className: "flex flex-col gap-2", children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx(
|
|
534
|
+
"span",
|
|
535
|
+
{
|
|
536
|
+
className: `block ${baseClass}`,
|
|
537
|
+
style: {
|
|
538
|
+
width: lastLineWidth(i, count, widthCss),
|
|
539
|
+
height: heightCss
|
|
540
|
+
},
|
|
541
|
+
"aria-hidden": "true"
|
|
542
|
+
},
|
|
543
|
+
textLineKey(i)
|
|
544
|
+
)) })
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
return /* @__PURE__ */ jsx(
|
|
548
|
+
"div",
|
|
549
|
+
{
|
|
550
|
+
role: "status",
|
|
551
|
+
"aria-label": ariaLabel,
|
|
552
|
+
"aria-busy": "true",
|
|
553
|
+
className: `block ${baseClass}`,
|
|
554
|
+
style: { width: widthCss, height: heightCss }
|
|
555
|
+
}
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
function Skeleton(raw) {
|
|
559
|
+
try {
|
|
560
|
+
const props = validateSkeletonProps(raw);
|
|
561
|
+
return /* @__PURE__ */ jsx(SkeletonInner, { ...props });
|
|
562
|
+
} catch {
|
|
563
|
+
const locale = raw.locale === "fr" ? "fr" : "en";
|
|
564
|
+
return /* @__PURE__ */ jsx("span", { role: "alert", className: "text-red-600 text-sm", children: t("Skeleton.error.invalidProps", locale) });
|
|
565
|
+
}
|
|
566
|
+
}
|
|
303
567
|
|
|
304
|
-
export { StreamingTableView, TableView, TableViewPropsSchema, validateTableViewProps };
|
|
568
|
+
export { EmptyStatePropsSchema, Skeleton, SkeletonPropsSchema, StreamingTableView, TableView, TableViewPropsSchema, resolveSkeletonDimensions, validateEmptyStateProps, validateSkeletonProps, validateTableViewProps };
|
|
305
569
|
//# sourceMappingURL=display.js.map
|
|
306
570
|
//# sourceMappingURL=display.js.map
|