@json-render/react-native 0.4.3

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.
@@ -0,0 +1,466 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Standard component definitions for React Native catalogs.
5
+ *
6
+ * These can be used directly or extended with custom components.
7
+ * All components are built using React Native core primitives only.
8
+ */
9
+ declare const standardComponentDefinitions: {
10
+ Container: {
11
+ props: z.ZodObject<{
12
+ padding: z.ZodNullable<z.ZodNumber>;
13
+ paddingHorizontal: z.ZodNullable<z.ZodNumber>;
14
+ paddingVertical: z.ZodNullable<z.ZodNumber>;
15
+ margin: z.ZodNullable<z.ZodNumber>;
16
+ backgroundColor: z.ZodNullable<z.ZodString>;
17
+ borderRadius: z.ZodNullable<z.ZodNumber>;
18
+ flex: z.ZodNullable<z.ZodNumber>;
19
+ }, z.core.$strip>;
20
+ slots: string[];
21
+ description: string;
22
+ };
23
+ Row: {
24
+ props: z.ZodObject<{
25
+ gap: z.ZodNullable<z.ZodNumber>;
26
+ alignItems: z.ZodNullable<z.ZodEnum<{
27
+ "flex-start": "flex-start";
28
+ center: "center";
29
+ "flex-end": "flex-end";
30
+ stretch: "stretch";
31
+ baseline: "baseline";
32
+ }>>;
33
+ justifyContent: z.ZodNullable<z.ZodEnum<{
34
+ "flex-start": "flex-start";
35
+ center: "center";
36
+ "flex-end": "flex-end";
37
+ "space-between": "space-between";
38
+ "space-around": "space-around";
39
+ "space-evenly": "space-evenly";
40
+ }>>;
41
+ flexWrap: z.ZodNullable<z.ZodEnum<{
42
+ wrap: "wrap";
43
+ nowrap: "nowrap";
44
+ }>>;
45
+ padding: z.ZodNullable<z.ZodNumber>;
46
+ flex: z.ZodNullable<z.ZodNumber>;
47
+ }, z.core.$strip>;
48
+ slots: string[];
49
+ description: string;
50
+ };
51
+ Column: {
52
+ props: z.ZodObject<{
53
+ gap: z.ZodNullable<z.ZodNumber>;
54
+ alignItems: z.ZodNullable<z.ZodEnum<{
55
+ "flex-start": "flex-start";
56
+ center: "center";
57
+ "flex-end": "flex-end";
58
+ stretch: "stretch";
59
+ baseline: "baseline";
60
+ }>>;
61
+ justifyContent: z.ZodNullable<z.ZodEnum<{
62
+ "flex-start": "flex-start";
63
+ center: "center";
64
+ "flex-end": "flex-end";
65
+ "space-between": "space-between";
66
+ "space-around": "space-around";
67
+ "space-evenly": "space-evenly";
68
+ }>>;
69
+ padding: z.ZodNullable<z.ZodNumber>;
70
+ flex: z.ZodNullable<z.ZodNumber>;
71
+ }, z.core.$strip>;
72
+ slots: string[];
73
+ description: string;
74
+ };
75
+ ScrollContainer: {
76
+ props: z.ZodObject<{
77
+ horizontal: z.ZodNullable<z.ZodBoolean>;
78
+ showsScrollIndicator: z.ZodNullable<z.ZodBoolean>;
79
+ padding: z.ZodNullable<z.ZodNumber>;
80
+ backgroundColor: z.ZodNullable<z.ZodString>;
81
+ }, z.core.$strip>;
82
+ slots: string[];
83
+ description: string;
84
+ };
85
+ SafeArea: {
86
+ props: z.ZodObject<{
87
+ backgroundColor: z.ZodNullable<z.ZodString>;
88
+ }, z.core.$strip>;
89
+ slots: string[];
90
+ description: string;
91
+ };
92
+ Spacer: {
93
+ props: z.ZodObject<{
94
+ size: z.ZodNullable<z.ZodNumber>;
95
+ flex: z.ZodNullable<z.ZodNumber>;
96
+ }, z.core.$strip>;
97
+ slots: never[];
98
+ description: string;
99
+ };
100
+ Pressable: {
101
+ props: z.ZodObject<{}, z.core.$strip>;
102
+ events: string[];
103
+ slots: string[];
104
+ description: string;
105
+ };
106
+ Divider: {
107
+ props: z.ZodObject<{
108
+ direction: z.ZodNullable<z.ZodEnum<{
109
+ horizontal: "horizontal";
110
+ vertical: "vertical";
111
+ }>>;
112
+ color: z.ZodNullable<z.ZodString>;
113
+ thickness: z.ZodNullable<z.ZodNumber>;
114
+ margin: z.ZodNullable<z.ZodNumber>;
115
+ }, z.core.$strip>;
116
+ slots: never[];
117
+ description: string;
118
+ };
119
+ Heading: {
120
+ props: z.ZodObject<{
121
+ text: z.ZodString;
122
+ level: z.ZodNullable<z.ZodEnum<{
123
+ h1: "h1";
124
+ h2: "h2";
125
+ h3: "h3";
126
+ h4: "h4";
127
+ }>>;
128
+ color: z.ZodNullable<z.ZodString>;
129
+ align: z.ZodNullable<z.ZodEnum<{
130
+ center: "center";
131
+ left: "left";
132
+ right: "right";
133
+ }>>;
134
+ }, z.core.$strip>;
135
+ slots: never[];
136
+ description: string;
137
+ };
138
+ Paragraph: {
139
+ props: z.ZodObject<{
140
+ text: z.ZodString;
141
+ color: z.ZodNullable<z.ZodString>;
142
+ align: z.ZodNullable<z.ZodEnum<{
143
+ center: "center";
144
+ left: "left";
145
+ right: "right";
146
+ }>>;
147
+ numberOfLines: z.ZodNullable<z.ZodNumber>;
148
+ fontSize: z.ZodNullable<z.ZodNumber>;
149
+ }, z.core.$strip>;
150
+ slots: never[];
151
+ description: string;
152
+ };
153
+ Label: {
154
+ props: z.ZodObject<{
155
+ text: z.ZodString;
156
+ color: z.ZodNullable<z.ZodString>;
157
+ bold: z.ZodNullable<z.ZodBoolean>;
158
+ size: z.ZodNullable<z.ZodEnum<{
159
+ xs: "xs";
160
+ sm: "sm";
161
+ md: "md";
162
+ }>>;
163
+ }, z.core.$strip>;
164
+ slots: never[];
165
+ description: string;
166
+ };
167
+ Image: {
168
+ props: z.ZodObject<{
169
+ src: z.ZodString;
170
+ alt: z.ZodNullable<z.ZodString>;
171
+ width: z.ZodNullable<z.ZodNumber>;
172
+ height: z.ZodNullable<z.ZodNumber>;
173
+ resizeMode: z.ZodNullable<z.ZodEnum<{
174
+ center: "center";
175
+ stretch: "stretch";
176
+ cover: "cover";
177
+ contain: "contain";
178
+ }>>;
179
+ borderRadius: z.ZodNullable<z.ZodNumber>;
180
+ }, z.core.$strip>;
181
+ slots: never[];
182
+ description: string;
183
+ };
184
+ Avatar: {
185
+ props: z.ZodObject<{
186
+ src: z.ZodNullable<z.ZodString>;
187
+ initials: z.ZodNullable<z.ZodString>;
188
+ size: z.ZodNullable<z.ZodEnum<{
189
+ sm: "sm";
190
+ md: "md";
191
+ lg: "lg";
192
+ xl: "xl";
193
+ }>>;
194
+ backgroundColor: z.ZodNullable<z.ZodString>;
195
+ }, z.core.$strip>;
196
+ slots: never[];
197
+ description: string;
198
+ };
199
+ Badge: {
200
+ props: z.ZodObject<{
201
+ label: z.ZodString;
202
+ variant: z.ZodNullable<z.ZodEnum<{
203
+ default: "default";
204
+ info: "info";
205
+ success: "success";
206
+ warning: "warning";
207
+ error: "error";
208
+ }>>;
209
+ }, z.core.$strip>;
210
+ slots: never[];
211
+ description: string;
212
+ };
213
+ Chip: {
214
+ props: z.ZodObject<{
215
+ label: z.ZodString;
216
+ selected: z.ZodNullable<z.ZodBoolean>;
217
+ backgroundColor: z.ZodNullable<z.ZodString>;
218
+ }, z.core.$strip>;
219
+ events: string[];
220
+ slots: never[];
221
+ description: string;
222
+ };
223
+ Button: {
224
+ props: z.ZodObject<{
225
+ label: z.ZodString;
226
+ variant: z.ZodNullable<z.ZodEnum<{
227
+ primary: "primary";
228
+ secondary: "secondary";
229
+ danger: "danger";
230
+ outline: "outline";
231
+ ghost: "ghost";
232
+ }>>;
233
+ size: z.ZodNullable<z.ZodEnum<{
234
+ sm: "sm";
235
+ md: "md";
236
+ lg: "lg";
237
+ }>>;
238
+ disabled: z.ZodNullable<z.ZodBoolean>;
239
+ loading: z.ZodNullable<z.ZodBoolean>;
240
+ }, z.core.$strip>;
241
+ events: string[];
242
+ slots: never[];
243
+ description: string;
244
+ };
245
+ TextInput: {
246
+ props: z.ZodObject<{
247
+ placeholder: z.ZodNullable<z.ZodString>;
248
+ value: z.ZodNullable<z.ZodString>;
249
+ statePath: z.ZodNullable<z.ZodString>;
250
+ secureTextEntry: z.ZodNullable<z.ZodBoolean>;
251
+ keyboardType: z.ZodNullable<z.ZodEnum<{
252
+ default: "default";
253
+ "email-address": "email-address";
254
+ numeric: "numeric";
255
+ "phone-pad": "phone-pad";
256
+ url: "url";
257
+ }>>;
258
+ multiline: z.ZodNullable<z.ZodBoolean>;
259
+ numberOfLines: z.ZodNullable<z.ZodNumber>;
260
+ label: z.ZodNullable<z.ZodString>;
261
+ flex: z.ZodNullable<z.ZodNumber>;
262
+ }, z.core.$strip>;
263
+ events: string[];
264
+ slots: never[];
265
+ description: string;
266
+ };
267
+ Switch: {
268
+ props: z.ZodObject<{
269
+ value: z.ZodNullable<z.ZodBoolean>;
270
+ statePath: z.ZodNullable<z.ZodString>;
271
+ label: z.ZodNullable<z.ZodString>;
272
+ disabled: z.ZodNullable<z.ZodBoolean>;
273
+ }, z.core.$strip>;
274
+ events: string[];
275
+ slots: never[];
276
+ description: string;
277
+ };
278
+ Checkbox: {
279
+ props: z.ZodObject<{
280
+ checked: z.ZodNullable<z.ZodBoolean>;
281
+ statePath: z.ZodNullable<z.ZodString>;
282
+ label: z.ZodNullable<z.ZodString>;
283
+ disabled: z.ZodNullable<z.ZodBoolean>;
284
+ }, z.core.$strip>;
285
+ events: string[];
286
+ slots: never[];
287
+ description: string;
288
+ };
289
+ Slider: {
290
+ props: z.ZodObject<{
291
+ min: z.ZodNullable<z.ZodNumber>;
292
+ max: z.ZodNullable<z.ZodNumber>;
293
+ step: z.ZodNullable<z.ZodNumber>;
294
+ value: z.ZodNullable<z.ZodNumber>;
295
+ statePath: z.ZodNullable<z.ZodString>;
296
+ label: z.ZodNullable<z.ZodString>;
297
+ color: z.ZodNullable<z.ZodString>;
298
+ }, z.core.$strip>;
299
+ slots: never[];
300
+ description: string;
301
+ };
302
+ SearchBar: {
303
+ props: z.ZodObject<{
304
+ placeholder: z.ZodNullable<z.ZodString>;
305
+ value: z.ZodNullable<z.ZodString>;
306
+ statePath: z.ZodNullable<z.ZodString>;
307
+ }, z.core.$strip>;
308
+ events: string[];
309
+ slots: never[];
310
+ description: string;
311
+ };
312
+ Spinner: {
313
+ props: z.ZodObject<{
314
+ size: z.ZodNullable<z.ZodEnum<{
315
+ small: "small";
316
+ large: "large";
317
+ }>>;
318
+ color: z.ZodNullable<z.ZodString>;
319
+ }, z.core.$strip>;
320
+ slots: never[];
321
+ description: string;
322
+ };
323
+ ProgressBar: {
324
+ props: z.ZodObject<{
325
+ progress: z.ZodNumber;
326
+ color: z.ZodNullable<z.ZodString>;
327
+ trackColor: z.ZodNullable<z.ZodString>;
328
+ height: z.ZodNullable<z.ZodNumber>;
329
+ }, z.core.$strip>;
330
+ slots: never[];
331
+ description: string;
332
+ };
333
+ Card: {
334
+ props: z.ZodObject<{
335
+ title: z.ZodNullable<z.ZodString>;
336
+ subtitle: z.ZodNullable<z.ZodString>;
337
+ padding: z.ZodNullable<z.ZodNumber>;
338
+ backgroundColor: z.ZodNullable<z.ZodString>;
339
+ borderRadius: z.ZodNullable<z.ZodNumber>;
340
+ elevated: z.ZodNullable<z.ZodBoolean>;
341
+ }, z.core.$strip>;
342
+ slots: string[];
343
+ description: string;
344
+ };
345
+ ListItem: {
346
+ props: z.ZodObject<{
347
+ title: z.ZodString;
348
+ subtitle: z.ZodNullable<z.ZodString>;
349
+ leading: z.ZodNullable<z.ZodString>;
350
+ trailing: z.ZodNullable<z.ZodString>;
351
+ showChevron: z.ZodNullable<z.ZodBoolean>;
352
+ }, z.core.$strip>;
353
+ events: string[];
354
+ slots: never[];
355
+ description: string;
356
+ };
357
+ Modal: {
358
+ props: z.ZodObject<{
359
+ visible: z.ZodBoolean;
360
+ title: z.ZodNullable<z.ZodString>;
361
+ animationType: z.ZodNullable<z.ZodEnum<{
362
+ slide: "slide";
363
+ fade: "fade";
364
+ none: "none";
365
+ }>>;
366
+ statePath: z.ZodNullable<z.ZodString>;
367
+ }, z.core.$strip>;
368
+ slots: string[];
369
+ description: string;
370
+ };
371
+ };
372
+ /**
373
+ * Standard action definitions for React Native catalogs.
374
+ *
375
+ * These use React Native core APIs (Alert, Share, Linking) and
376
+ * user-provided functions (navigate).
377
+ */
378
+ declare const standardActionDefinitions: {
379
+ navigate: {
380
+ params: z.ZodObject<{
381
+ screen: z.ZodString;
382
+ params: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
383
+ }, z.core.$strip>;
384
+ description: string;
385
+ };
386
+ goBack: {
387
+ params: z.ZodObject<{}, z.core.$strip>;
388
+ description: string;
389
+ };
390
+ showAlert: {
391
+ params: z.ZodObject<{
392
+ title: z.ZodString;
393
+ message: z.ZodNullable<z.ZodString>;
394
+ buttons: z.ZodNullable<z.ZodArray<z.ZodObject<{
395
+ text: z.ZodString;
396
+ style: z.ZodNullable<z.ZodEnum<{
397
+ default: "default";
398
+ cancel: "cancel";
399
+ destructive: "destructive";
400
+ }>>;
401
+ action: z.ZodNullable<z.ZodString>;
402
+ }, z.core.$strip>>>;
403
+ }, z.core.$strip>;
404
+ description: string;
405
+ };
406
+ share: {
407
+ params: z.ZodObject<{
408
+ message: z.ZodString;
409
+ url: z.ZodNullable<z.ZodString>;
410
+ title: z.ZodNullable<z.ZodString>;
411
+ }, z.core.$strip>;
412
+ description: string;
413
+ };
414
+ openURL: {
415
+ params: z.ZodObject<{
416
+ url: z.ZodString;
417
+ }, z.core.$strip>;
418
+ description: string;
419
+ };
420
+ setState: {
421
+ params: z.ZodObject<{
422
+ path: z.ZodString;
423
+ value: z.ZodUnknown;
424
+ }, z.core.$strip>;
425
+ description: string;
426
+ };
427
+ pushState: {
428
+ params: z.ZodObject<{
429
+ path: z.ZodString;
430
+ value: z.ZodUnknown;
431
+ clearPath: z.ZodOptional<z.ZodString>;
432
+ }, z.core.$strip>;
433
+ description: string;
434
+ };
435
+ removeState: {
436
+ params: z.ZodObject<{
437
+ path: z.ZodString;
438
+ index: z.ZodNumber;
439
+ }, z.core.$strip>;
440
+ description: string;
441
+ };
442
+ refresh: {
443
+ params: z.ZodObject<{
444
+ target: z.ZodNullable<z.ZodString>;
445
+ }, z.core.$strip>;
446
+ description: string;
447
+ };
448
+ };
449
+ /**
450
+ * Type for a component definition
451
+ */
452
+ type ComponentDefinition = {
453
+ props: z.ZodType;
454
+ slots: string[];
455
+ events?: string[];
456
+ description: string;
457
+ };
458
+ /**
459
+ * Type for an action definition
460
+ */
461
+ type ActionDefinition = {
462
+ params: z.ZodType;
463
+ description: string;
464
+ };
465
+
466
+ export { type ActionDefinition, type ComponentDefinition, standardActionDefinitions, standardComponentDefinitions };