@json-render/shadcn 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +198 -0
- package/dist/catalog.d.mts +501 -0
- package/dist/catalog.d.ts +501 -0
- package/dist/catalog.js +428 -0
- package/dist/catalog.js.map +1 -0
- package/dist/catalog.mjs +7 -0
- package/dist/catalog.mjs.map +1 -0
- package/dist/chunk-VZQBPEYT.mjs +404 -0
- package/dist/chunk-VZQBPEYT.mjs.map +1 -0
- package/dist/index.d.mts +65 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.js +2946 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2520 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
// src/catalog.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var shadcnComponentDefinitions = {
|
|
4
|
+
// ==========================================================================
|
|
5
|
+
// Layout Components
|
|
6
|
+
// ==========================================================================
|
|
7
|
+
Card: {
|
|
8
|
+
props: z.object({
|
|
9
|
+
title: z.string().nullable(),
|
|
10
|
+
description: z.string().nullable(),
|
|
11
|
+
maxWidth: z.enum(["sm", "md", "lg", "full"]).nullable(),
|
|
12
|
+
centered: z.boolean().nullable()
|
|
13
|
+
}),
|
|
14
|
+
slots: ["default"],
|
|
15
|
+
description: "Container card for content sections. Use for forms/content boxes, NOT for page headers.",
|
|
16
|
+
example: { title: "Overview", description: "Your account summary" }
|
|
17
|
+
},
|
|
18
|
+
Stack: {
|
|
19
|
+
props: z.object({
|
|
20
|
+
direction: z.enum(["horizontal", "vertical"]).nullable(),
|
|
21
|
+
gap: z.enum(["none", "sm", "md", "lg"]).nullable(),
|
|
22
|
+
align: z.enum(["start", "center", "end", "stretch"]).nullable(),
|
|
23
|
+
justify: z.enum(["start", "center", "end", "between", "around"]).nullable()
|
|
24
|
+
}),
|
|
25
|
+
slots: ["default"],
|
|
26
|
+
description: "Flex container for layouts",
|
|
27
|
+
example: { direction: "vertical", gap: "md" }
|
|
28
|
+
},
|
|
29
|
+
Grid: {
|
|
30
|
+
props: z.object({
|
|
31
|
+
columns: z.number().nullable(),
|
|
32
|
+
gap: z.enum(["sm", "md", "lg"]).nullable()
|
|
33
|
+
}),
|
|
34
|
+
slots: ["default"],
|
|
35
|
+
description: "Grid layout (1-6 columns)",
|
|
36
|
+
example: { columns: 3, gap: "md" }
|
|
37
|
+
},
|
|
38
|
+
Separator: {
|
|
39
|
+
props: z.object({
|
|
40
|
+
orientation: z.enum(["horizontal", "vertical"]).nullable()
|
|
41
|
+
}),
|
|
42
|
+
description: "Visual separator line"
|
|
43
|
+
},
|
|
44
|
+
Tabs: {
|
|
45
|
+
props: z.object({
|
|
46
|
+
tabs: z.array(
|
|
47
|
+
z.object({
|
|
48
|
+
label: z.string(),
|
|
49
|
+
value: z.string()
|
|
50
|
+
})
|
|
51
|
+
),
|
|
52
|
+
defaultValue: z.string().nullable(),
|
|
53
|
+
value: z.string().nullable()
|
|
54
|
+
}),
|
|
55
|
+
slots: ["default"],
|
|
56
|
+
events: ["change"],
|
|
57
|
+
description: "Tab navigation. Use { $bindState } on value for active tab binding."
|
|
58
|
+
},
|
|
59
|
+
Accordion: {
|
|
60
|
+
props: z.object({
|
|
61
|
+
items: z.array(
|
|
62
|
+
z.object({
|
|
63
|
+
title: z.string(),
|
|
64
|
+
content: z.string()
|
|
65
|
+
})
|
|
66
|
+
),
|
|
67
|
+
type: z.enum(["single", "multiple"]).nullable()
|
|
68
|
+
}),
|
|
69
|
+
description: "Collapsible sections. Items as [{title, content}]. Type 'single' (default) or 'multiple'."
|
|
70
|
+
},
|
|
71
|
+
Collapsible: {
|
|
72
|
+
props: z.object({
|
|
73
|
+
title: z.string(),
|
|
74
|
+
defaultOpen: z.boolean().nullable()
|
|
75
|
+
}),
|
|
76
|
+
slots: ["default"],
|
|
77
|
+
description: "Collapsible section with trigger. Children render inside."
|
|
78
|
+
},
|
|
79
|
+
Dialog: {
|
|
80
|
+
props: z.object({
|
|
81
|
+
title: z.string(),
|
|
82
|
+
description: z.string().nullable(),
|
|
83
|
+
openPath: z.string()
|
|
84
|
+
}),
|
|
85
|
+
slots: ["default"],
|
|
86
|
+
description: "Modal dialog. Set openPath to a boolean state path. Use setState to toggle."
|
|
87
|
+
},
|
|
88
|
+
Drawer: {
|
|
89
|
+
props: z.object({
|
|
90
|
+
title: z.string(),
|
|
91
|
+
description: z.string().nullable(),
|
|
92
|
+
openPath: z.string()
|
|
93
|
+
}),
|
|
94
|
+
slots: ["default"],
|
|
95
|
+
description: "Bottom sheet drawer. Set openPath to a boolean state path. Use setState to toggle."
|
|
96
|
+
},
|
|
97
|
+
Carousel: {
|
|
98
|
+
props: z.object({
|
|
99
|
+
items: z.array(
|
|
100
|
+
z.object({
|
|
101
|
+
title: z.string().nullable(),
|
|
102
|
+
description: z.string().nullable()
|
|
103
|
+
})
|
|
104
|
+
)
|
|
105
|
+
}),
|
|
106
|
+
description: "Horizontally scrollable carousel of cards."
|
|
107
|
+
},
|
|
108
|
+
// ==========================================================================
|
|
109
|
+
// Data Display Components
|
|
110
|
+
// ==========================================================================
|
|
111
|
+
Table: {
|
|
112
|
+
props: z.object({
|
|
113
|
+
columns: z.array(z.string()),
|
|
114
|
+
rows: z.array(z.array(z.string())),
|
|
115
|
+
caption: z.string().nullable()
|
|
116
|
+
}),
|
|
117
|
+
description: 'Data table. columns: header labels. rows: 2D array of cell strings, e.g. [["Alice","admin"],["Bob","user"]].',
|
|
118
|
+
example: {
|
|
119
|
+
columns: ["Name", "Role"],
|
|
120
|
+
rows: [
|
|
121
|
+
["Alice", "Admin"],
|
|
122
|
+
["Bob", "User"]
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
Heading: {
|
|
127
|
+
props: z.object({
|
|
128
|
+
text: z.string(),
|
|
129
|
+
level: z.enum(["h1", "h2", "h3", "h4"]).nullable()
|
|
130
|
+
}),
|
|
131
|
+
description: "Heading text (h1-h4)",
|
|
132
|
+
example: { text: "Welcome", level: "h1" }
|
|
133
|
+
},
|
|
134
|
+
Text: {
|
|
135
|
+
props: z.object({
|
|
136
|
+
text: z.string(),
|
|
137
|
+
variant: z.enum(["body", "caption", "muted", "lead", "code"]).nullable()
|
|
138
|
+
}),
|
|
139
|
+
description: "Paragraph text",
|
|
140
|
+
example: { text: "Hello, world!" }
|
|
141
|
+
},
|
|
142
|
+
Image: {
|
|
143
|
+
props: z.object({
|
|
144
|
+
src: z.string().nullable(),
|
|
145
|
+
alt: z.string(),
|
|
146
|
+
width: z.number().nullable(),
|
|
147
|
+
height: z.number().nullable()
|
|
148
|
+
}),
|
|
149
|
+
description: "Image component. Renders an img tag when src is provided, otherwise a placeholder."
|
|
150
|
+
},
|
|
151
|
+
Avatar: {
|
|
152
|
+
props: z.object({
|
|
153
|
+
src: z.string().nullable(),
|
|
154
|
+
name: z.string(),
|
|
155
|
+
size: z.enum(["sm", "md", "lg"]).nullable()
|
|
156
|
+
}),
|
|
157
|
+
description: "User avatar with fallback initials",
|
|
158
|
+
example: { name: "Jane Doe", size: "md" }
|
|
159
|
+
},
|
|
160
|
+
Badge: {
|
|
161
|
+
props: z.object({
|
|
162
|
+
text: z.string(),
|
|
163
|
+
variant: z.enum(["default", "secondary", "destructive", "outline"]).nullable()
|
|
164
|
+
}),
|
|
165
|
+
description: "Status badge",
|
|
166
|
+
example: { text: "Active", variant: "default" }
|
|
167
|
+
},
|
|
168
|
+
Alert: {
|
|
169
|
+
props: z.object({
|
|
170
|
+
title: z.string(),
|
|
171
|
+
message: z.string().nullable(),
|
|
172
|
+
type: z.enum(["info", "success", "warning", "error"]).nullable()
|
|
173
|
+
}),
|
|
174
|
+
description: "Alert banner",
|
|
175
|
+
example: {
|
|
176
|
+
title: "Note",
|
|
177
|
+
message: "Your changes have been saved.",
|
|
178
|
+
type: "success"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
Progress: {
|
|
182
|
+
props: z.object({
|
|
183
|
+
value: z.number(),
|
|
184
|
+
max: z.number().nullable(),
|
|
185
|
+
label: z.string().nullable()
|
|
186
|
+
}),
|
|
187
|
+
description: "Progress bar (value 0-100)",
|
|
188
|
+
example: { value: 65, max: 100, label: "Upload progress" }
|
|
189
|
+
},
|
|
190
|
+
Skeleton: {
|
|
191
|
+
props: z.object({
|
|
192
|
+
width: z.string().nullable(),
|
|
193
|
+
height: z.string().nullable(),
|
|
194
|
+
rounded: z.boolean().nullable()
|
|
195
|
+
}),
|
|
196
|
+
description: "Loading placeholder skeleton"
|
|
197
|
+
},
|
|
198
|
+
Spinner: {
|
|
199
|
+
props: z.object({
|
|
200
|
+
size: z.enum(["sm", "md", "lg"]).nullable(),
|
|
201
|
+
label: z.string().nullable()
|
|
202
|
+
}),
|
|
203
|
+
description: "Loading spinner indicator"
|
|
204
|
+
},
|
|
205
|
+
Tooltip: {
|
|
206
|
+
props: z.object({
|
|
207
|
+
content: z.string(),
|
|
208
|
+
text: z.string()
|
|
209
|
+
}),
|
|
210
|
+
description: "Hover tooltip. Shows content on hover over text."
|
|
211
|
+
},
|
|
212
|
+
Popover: {
|
|
213
|
+
props: z.object({
|
|
214
|
+
trigger: z.string(),
|
|
215
|
+
content: z.string()
|
|
216
|
+
}),
|
|
217
|
+
description: "Popover that appears on click of trigger."
|
|
218
|
+
},
|
|
219
|
+
// ==========================================================================
|
|
220
|
+
// Form Input Components
|
|
221
|
+
// ==========================================================================
|
|
222
|
+
Input: {
|
|
223
|
+
props: z.object({
|
|
224
|
+
label: z.string(),
|
|
225
|
+
name: z.string(),
|
|
226
|
+
type: z.enum(["text", "email", "password", "number"]).nullable(),
|
|
227
|
+
placeholder: z.string().nullable(),
|
|
228
|
+
value: z.string().nullable(),
|
|
229
|
+
checks: z.array(
|
|
230
|
+
z.object({
|
|
231
|
+
type: z.string(),
|
|
232
|
+
message: z.string(),
|
|
233
|
+
args: z.record(z.string(), z.unknown()).optional()
|
|
234
|
+
})
|
|
235
|
+
).nullable()
|
|
236
|
+
}),
|
|
237
|
+
events: ["submit", "focus", "blur"],
|
|
238
|
+
description: "Text input field. Use { $bindState } on value for two-way binding. Use checks for validation (e.g. required, email, minLength).",
|
|
239
|
+
example: {
|
|
240
|
+
label: "Email",
|
|
241
|
+
name: "email",
|
|
242
|
+
type: "email",
|
|
243
|
+
placeholder: "you@example.com"
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
Textarea: {
|
|
247
|
+
props: z.object({
|
|
248
|
+
label: z.string(),
|
|
249
|
+
name: z.string(),
|
|
250
|
+
placeholder: z.string().nullable(),
|
|
251
|
+
rows: z.number().nullable(),
|
|
252
|
+
value: z.string().nullable(),
|
|
253
|
+
checks: z.array(
|
|
254
|
+
z.object({
|
|
255
|
+
type: z.string(),
|
|
256
|
+
message: z.string(),
|
|
257
|
+
args: z.record(z.string(), z.unknown()).optional()
|
|
258
|
+
})
|
|
259
|
+
).nullable()
|
|
260
|
+
}),
|
|
261
|
+
description: "Multi-line text input. Use { $bindState } on value for binding. Use checks for validation."
|
|
262
|
+
},
|
|
263
|
+
Select: {
|
|
264
|
+
props: z.object({
|
|
265
|
+
label: z.string(),
|
|
266
|
+
name: z.string(),
|
|
267
|
+
options: z.array(z.string()),
|
|
268
|
+
placeholder: z.string().nullable(),
|
|
269
|
+
value: z.string().nullable(),
|
|
270
|
+
checks: z.array(
|
|
271
|
+
z.object({
|
|
272
|
+
type: z.string(),
|
|
273
|
+
message: z.string(),
|
|
274
|
+
args: z.record(z.string(), z.unknown()).optional()
|
|
275
|
+
})
|
|
276
|
+
).nullable()
|
|
277
|
+
}),
|
|
278
|
+
events: ["change"],
|
|
279
|
+
description: "Dropdown select input. Use { $bindState } on value for binding. Use checks for validation."
|
|
280
|
+
},
|
|
281
|
+
Checkbox: {
|
|
282
|
+
props: z.object({
|
|
283
|
+
label: z.string(),
|
|
284
|
+
name: z.string(),
|
|
285
|
+
checked: z.boolean().nullable()
|
|
286
|
+
}),
|
|
287
|
+
events: ["change"],
|
|
288
|
+
description: "Checkbox input. Use { $bindState } on checked for binding."
|
|
289
|
+
},
|
|
290
|
+
Radio: {
|
|
291
|
+
props: z.object({
|
|
292
|
+
label: z.string(),
|
|
293
|
+
name: z.string(),
|
|
294
|
+
options: z.array(z.string()),
|
|
295
|
+
value: z.string().nullable()
|
|
296
|
+
}),
|
|
297
|
+
events: ["change"],
|
|
298
|
+
description: "Radio button group. Use { $bindState } on value for binding."
|
|
299
|
+
},
|
|
300
|
+
Switch: {
|
|
301
|
+
props: z.object({
|
|
302
|
+
label: z.string(),
|
|
303
|
+
name: z.string(),
|
|
304
|
+
checked: z.boolean().nullable()
|
|
305
|
+
}),
|
|
306
|
+
events: ["change"],
|
|
307
|
+
description: "Toggle switch. Use { $bindState } on checked for binding."
|
|
308
|
+
},
|
|
309
|
+
Slider: {
|
|
310
|
+
props: z.object({
|
|
311
|
+
label: z.string().nullable(),
|
|
312
|
+
min: z.number().nullable(),
|
|
313
|
+
max: z.number().nullable(),
|
|
314
|
+
step: z.number().nullable(),
|
|
315
|
+
value: z.number().nullable()
|
|
316
|
+
}),
|
|
317
|
+
events: ["change"],
|
|
318
|
+
description: "Range slider input. Use { $bindState } on value for binding."
|
|
319
|
+
},
|
|
320
|
+
// ==========================================================================
|
|
321
|
+
// Action Components
|
|
322
|
+
// ==========================================================================
|
|
323
|
+
Button: {
|
|
324
|
+
props: z.object({
|
|
325
|
+
label: z.string(),
|
|
326
|
+
variant: z.enum(["primary", "secondary", "danger"]).nullable(),
|
|
327
|
+
disabled: z.boolean().nullable()
|
|
328
|
+
}),
|
|
329
|
+
events: ["press"],
|
|
330
|
+
description: "Clickable button. Bind on.press for handler.",
|
|
331
|
+
example: { label: "Submit", variant: "primary" }
|
|
332
|
+
},
|
|
333
|
+
Link: {
|
|
334
|
+
props: z.object({
|
|
335
|
+
label: z.string(),
|
|
336
|
+
href: z.string()
|
|
337
|
+
}),
|
|
338
|
+
events: ["press"],
|
|
339
|
+
description: "Anchor link. Bind on.press for click handler."
|
|
340
|
+
},
|
|
341
|
+
DropdownMenu: {
|
|
342
|
+
props: z.object({
|
|
343
|
+
label: z.string(),
|
|
344
|
+
items: z.array(
|
|
345
|
+
z.object({
|
|
346
|
+
label: z.string(),
|
|
347
|
+
value: z.string()
|
|
348
|
+
})
|
|
349
|
+
),
|
|
350
|
+
value: z.string().nullable()
|
|
351
|
+
}),
|
|
352
|
+
events: ["select"],
|
|
353
|
+
description: "Dropdown menu with trigger button and selectable items. Use { $bindState } on value for selected item binding."
|
|
354
|
+
},
|
|
355
|
+
Toggle: {
|
|
356
|
+
props: z.object({
|
|
357
|
+
label: z.string(),
|
|
358
|
+
pressed: z.boolean().nullable(),
|
|
359
|
+
variant: z.enum(["default", "outline"]).nullable()
|
|
360
|
+
}),
|
|
361
|
+
events: ["change"],
|
|
362
|
+
description: "Toggle button. Use { $bindState } on pressed for state binding."
|
|
363
|
+
},
|
|
364
|
+
ToggleGroup: {
|
|
365
|
+
props: z.object({
|
|
366
|
+
items: z.array(
|
|
367
|
+
z.object({
|
|
368
|
+
label: z.string(),
|
|
369
|
+
value: z.string()
|
|
370
|
+
})
|
|
371
|
+
),
|
|
372
|
+
type: z.enum(["single", "multiple"]).nullable(),
|
|
373
|
+
value: z.string().nullable()
|
|
374
|
+
}),
|
|
375
|
+
events: ["change"],
|
|
376
|
+
description: "Group of toggle buttons. Type 'single' (default) or 'multiple'. Use { $bindState } on value."
|
|
377
|
+
},
|
|
378
|
+
ButtonGroup: {
|
|
379
|
+
props: z.object({
|
|
380
|
+
buttons: z.array(
|
|
381
|
+
z.object({
|
|
382
|
+
label: z.string(),
|
|
383
|
+
value: z.string()
|
|
384
|
+
})
|
|
385
|
+
),
|
|
386
|
+
selected: z.string().nullable()
|
|
387
|
+
}),
|
|
388
|
+
events: ["change"],
|
|
389
|
+
description: "Segmented button group. Use { $bindState } on selected for selected value."
|
|
390
|
+
},
|
|
391
|
+
Pagination: {
|
|
392
|
+
props: z.object({
|
|
393
|
+
totalPages: z.number(),
|
|
394
|
+
page: z.number().nullable()
|
|
395
|
+
}),
|
|
396
|
+
events: ["change"],
|
|
397
|
+
description: "Page navigation. Use { $bindState } on page for current page number."
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
export {
|
|
402
|
+
shadcnComponentDefinitions
|
|
403
|
+
};
|
|
404
|
+
//# sourceMappingURL=chunk-VZQBPEYT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/catalog.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// =============================================================================\n// shadcn/ui Component Definitions\n// =============================================================================\n\n/**\n * shadcn/ui component definitions for json-render catalogs.\n *\n * These can be used directly or extended with custom components.\n * All components are built using Radix UI primitives + Tailwind CSS.\n */\nexport const shadcnComponentDefinitions = {\n // ==========================================================================\n // Layout Components\n // ==========================================================================\n\n Card: {\n props: z.object({\n title: z.string().nullable(),\n description: z.string().nullable(),\n maxWidth: z.enum([\"sm\", \"md\", \"lg\", \"full\"]).nullable(),\n centered: z.boolean().nullable(),\n }),\n slots: [\"default\"],\n description:\n \"Container card for content sections. Use for forms/content boxes, NOT for page headers.\",\n example: { title: \"Overview\", description: \"Your account summary\" },\n },\n\n Stack: {\n props: z.object({\n direction: z.enum([\"horizontal\", \"vertical\"]).nullable(),\n gap: z.enum([\"none\", \"sm\", \"md\", \"lg\"]).nullable(),\n align: z.enum([\"start\", \"center\", \"end\", \"stretch\"]).nullable(),\n justify: z\n .enum([\"start\", \"center\", \"end\", \"between\", \"around\"])\n .nullable(),\n }),\n slots: [\"default\"],\n description: \"Flex container for layouts\",\n example: { direction: \"vertical\", gap: \"md\" },\n },\n\n Grid: {\n props: z.object({\n columns: z.number().nullable(),\n gap: z.enum([\"sm\", \"md\", \"lg\"]).nullable(),\n }),\n slots: [\"default\"],\n description: \"Grid layout (1-6 columns)\",\n example: { columns: 3, gap: \"md\" },\n },\n\n Separator: {\n props: z.object({\n orientation: z.enum([\"horizontal\", \"vertical\"]).nullable(),\n }),\n description: \"Visual separator line\",\n },\n\n Tabs: {\n props: z.object({\n tabs: z.array(\n z.object({\n label: z.string(),\n value: z.string(),\n }),\n ),\n defaultValue: z.string().nullable(),\n value: z.string().nullable(),\n }),\n slots: [\"default\"],\n events: [\"change\"],\n description:\n \"Tab navigation. Use { $bindState } on value for active tab binding.\",\n },\n\n Accordion: {\n props: z.object({\n items: z.array(\n z.object({\n title: z.string(),\n content: z.string(),\n }),\n ),\n type: z.enum([\"single\", \"multiple\"]).nullable(),\n }),\n description:\n \"Collapsible sections. Items as [{title, content}]. Type 'single' (default) or 'multiple'.\",\n },\n\n Collapsible: {\n props: z.object({\n title: z.string(),\n defaultOpen: z.boolean().nullable(),\n }),\n slots: [\"default\"],\n description: \"Collapsible section with trigger. Children render inside.\",\n },\n\n Dialog: {\n props: z.object({\n title: z.string(),\n description: z.string().nullable(),\n openPath: z.string(),\n }),\n slots: [\"default\"],\n description:\n \"Modal dialog. Set openPath to a boolean state path. Use setState to toggle.\",\n },\n\n Drawer: {\n props: z.object({\n title: z.string(),\n description: z.string().nullable(),\n openPath: z.string(),\n }),\n slots: [\"default\"],\n description:\n \"Bottom sheet drawer. Set openPath to a boolean state path. Use setState to toggle.\",\n },\n\n Carousel: {\n props: z.object({\n items: z.array(\n z.object({\n title: z.string().nullable(),\n description: z.string().nullable(),\n }),\n ),\n }),\n description: \"Horizontally scrollable carousel of cards.\",\n },\n\n // ==========================================================================\n // Data Display Components\n // ==========================================================================\n\n Table: {\n props: z.object({\n columns: z.array(z.string()),\n rows: z.array(z.array(z.string())),\n caption: z.string().nullable(),\n }),\n description:\n 'Data table. columns: header labels. rows: 2D array of cell strings, e.g. [[\"Alice\",\"admin\"],[\"Bob\",\"user\"]].',\n example: {\n columns: [\"Name\", \"Role\"],\n rows: [\n [\"Alice\", \"Admin\"],\n [\"Bob\", \"User\"],\n ],\n },\n },\n\n Heading: {\n props: z.object({\n text: z.string(),\n level: z.enum([\"h1\", \"h2\", \"h3\", \"h4\"]).nullable(),\n }),\n description: \"Heading text (h1-h4)\",\n example: { text: \"Welcome\", level: \"h1\" },\n },\n\n Text: {\n props: z.object({\n text: z.string(),\n variant: z.enum([\"body\", \"caption\", \"muted\", \"lead\", \"code\"]).nullable(),\n }),\n description: \"Paragraph text\",\n example: { text: \"Hello, world!\" },\n },\n\n Image: {\n props: z.object({\n src: z.string().nullable(),\n alt: z.string(),\n width: z.number().nullable(),\n height: z.number().nullable(),\n }),\n description:\n \"Image component. Renders an img tag when src is provided, otherwise a placeholder.\",\n },\n\n Avatar: {\n props: z.object({\n src: z.string().nullable(),\n name: z.string(),\n size: z.enum([\"sm\", \"md\", \"lg\"]).nullable(),\n }),\n description: \"User avatar with fallback initials\",\n example: { name: \"Jane Doe\", size: \"md\" },\n },\n\n Badge: {\n props: z.object({\n text: z.string(),\n variant: z\n .enum([\"default\", \"secondary\", \"destructive\", \"outline\"])\n .nullable(),\n }),\n description: \"Status badge\",\n example: { text: \"Active\", variant: \"default\" },\n },\n\n Alert: {\n props: z.object({\n title: z.string(),\n message: z.string().nullable(),\n type: z.enum([\"info\", \"success\", \"warning\", \"error\"]).nullable(),\n }),\n description: \"Alert banner\",\n example: {\n title: \"Note\",\n message: \"Your changes have been saved.\",\n type: \"success\",\n },\n },\n\n Progress: {\n props: z.object({\n value: z.number(),\n max: z.number().nullable(),\n label: z.string().nullable(),\n }),\n description: \"Progress bar (value 0-100)\",\n example: { value: 65, max: 100, label: \"Upload progress\" },\n },\n\n Skeleton: {\n props: z.object({\n width: z.string().nullable(),\n height: z.string().nullable(),\n rounded: z.boolean().nullable(),\n }),\n description: \"Loading placeholder skeleton\",\n },\n\n Spinner: {\n props: z.object({\n size: z.enum([\"sm\", \"md\", \"lg\"]).nullable(),\n label: z.string().nullable(),\n }),\n description: \"Loading spinner indicator\",\n },\n\n Tooltip: {\n props: z.object({\n content: z.string(),\n text: z.string(),\n }),\n description: \"Hover tooltip. Shows content on hover over text.\",\n },\n\n Popover: {\n props: z.object({\n trigger: z.string(),\n content: z.string(),\n }),\n description: \"Popover that appears on click of trigger.\",\n },\n\n // ==========================================================================\n // Form Input Components\n // ==========================================================================\n\n Input: {\n props: z.object({\n label: z.string(),\n name: z.string(),\n type: z.enum([\"text\", \"email\", \"password\", \"number\"]).nullable(),\n placeholder: z.string().nullable(),\n value: z.string().nullable(),\n checks: z\n .array(\n z.object({\n type: z.string(),\n message: z.string(),\n args: z.record(z.string(), z.unknown()).optional(),\n }),\n )\n .nullable(),\n }),\n events: [\"submit\", \"focus\", \"blur\"],\n description:\n \"Text input field. Use { $bindState } on value for two-way binding. Use checks for validation (e.g. required, email, minLength).\",\n example: {\n label: \"Email\",\n name: \"email\",\n type: \"email\",\n placeholder: \"you@example.com\",\n },\n },\n\n Textarea: {\n props: z.object({\n label: z.string(),\n name: z.string(),\n placeholder: z.string().nullable(),\n rows: z.number().nullable(),\n value: z.string().nullable(),\n checks: z\n .array(\n z.object({\n type: z.string(),\n message: z.string(),\n args: z.record(z.string(), z.unknown()).optional(),\n }),\n )\n .nullable(),\n }),\n description:\n \"Multi-line text input. Use { $bindState } on value for binding. Use checks for validation.\",\n },\n\n Select: {\n props: z.object({\n label: z.string(),\n name: z.string(),\n options: z.array(z.string()),\n placeholder: z.string().nullable(),\n value: z.string().nullable(),\n checks: z\n .array(\n z.object({\n type: z.string(),\n message: z.string(),\n args: z.record(z.string(), z.unknown()).optional(),\n }),\n )\n .nullable(),\n }),\n events: [\"change\"],\n description:\n \"Dropdown select input. Use { $bindState } on value for binding. Use checks for validation.\",\n },\n\n Checkbox: {\n props: z.object({\n label: z.string(),\n name: z.string(),\n checked: z.boolean().nullable(),\n }),\n events: [\"change\"],\n description: \"Checkbox input. Use { $bindState } on checked for binding.\",\n },\n\n Radio: {\n props: z.object({\n label: z.string(),\n name: z.string(),\n options: z.array(z.string()),\n value: z.string().nullable(),\n }),\n events: [\"change\"],\n description: \"Radio button group. Use { $bindState } on value for binding.\",\n },\n\n Switch: {\n props: z.object({\n label: z.string(),\n name: z.string(),\n checked: z.boolean().nullable(),\n }),\n events: [\"change\"],\n description: \"Toggle switch. Use { $bindState } on checked for binding.\",\n },\n\n Slider: {\n props: z.object({\n label: z.string().nullable(),\n min: z.number().nullable(),\n max: z.number().nullable(),\n step: z.number().nullable(),\n value: z.number().nullable(),\n }),\n events: [\"change\"],\n description: \"Range slider input. Use { $bindState } on value for binding.\",\n },\n\n // ==========================================================================\n // Action Components\n // ==========================================================================\n\n Button: {\n props: z.object({\n label: z.string(),\n variant: z.enum([\"primary\", \"secondary\", \"danger\"]).nullable(),\n disabled: z.boolean().nullable(),\n }),\n events: [\"press\"],\n description: \"Clickable button. Bind on.press for handler.\",\n example: { label: \"Submit\", variant: \"primary\" },\n },\n\n Link: {\n props: z.object({\n label: z.string(),\n href: z.string(),\n }),\n events: [\"press\"],\n description: \"Anchor link. Bind on.press for click handler.\",\n },\n\n DropdownMenu: {\n props: z.object({\n label: z.string(),\n items: z.array(\n z.object({\n label: z.string(),\n value: z.string(),\n }),\n ),\n value: z.string().nullable(),\n }),\n events: [\"select\"],\n description:\n \"Dropdown menu with trigger button and selectable items. Use { $bindState } on value for selected item binding.\",\n },\n\n Toggle: {\n props: z.object({\n label: z.string(),\n pressed: z.boolean().nullable(),\n variant: z.enum([\"default\", \"outline\"]).nullable(),\n }),\n events: [\"change\"],\n description:\n \"Toggle button. Use { $bindState } on pressed for state binding.\",\n },\n\n ToggleGroup: {\n props: z.object({\n items: z.array(\n z.object({\n label: z.string(),\n value: z.string(),\n }),\n ),\n type: z.enum([\"single\", \"multiple\"]).nullable(),\n value: z.string().nullable(),\n }),\n events: [\"change\"],\n description:\n \"Group of toggle buttons. Type 'single' (default) or 'multiple'. Use { $bindState } on value.\",\n },\n\n ButtonGroup: {\n props: z.object({\n buttons: z.array(\n z.object({\n label: z.string(),\n value: z.string(),\n }),\n ),\n selected: z.string().nullable(),\n }),\n events: [\"change\"],\n description:\n \"Segmented button group. Use { $bindState } on selected for selected value.\",\n },\n\n Pagination: {\n props: z.object({\n totalPages: z.number(),\n page: z.number().nullable(),\n }),\n events: [\"change\"],\n description:\n \"Page navigation. Use { $bindState } on page for current page number.\",\n },\n};\n\n// =============================================================================\n// Types\n// =============================================================================\n\n/**\n * Type for a component definition\n */\nexport type ComponentDefinition = {\n props: z.ZodType;\n slots?: string[];\n events?: string[];\n description: string;\n example?: Record<string, unknown>;\n};\n\n/**\n * Infer the props type for a shadcn component by name.\n * Derives the TypeScript type directly from the Zod schema,\n * so component implementations stay in sync with catalog definitions.\n *\n * @example\n * ```ts\n * type CardProps = ShadcnProps<\"Card\">;\n * // { title: string | null; description: string | null; ... }\n * ```\n */\nexport type ShadcnProps<K extends keyof typeof shadcnComponentDefinitions> =\n z.output<(typeof shadcnComponentDefinitions)[K][\"props\"]>;\n"],"mappings":";AAAA,SAAS,SAAS;AAYX,IAAM,6BAA6B;AAAA;AAAA;AAAA;AAAA,EAKxC,MAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,MACd,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,MAC3B,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,MACjC,UAAU,EAAE,KAAK,CAAC,MAAM,MAAM,MAAM,MAAM,CAAC,EAAE,SAAS;AAAA,MACtD,UAAU,EAAE,QAAQ,EAAE,SAAS;AAAA,IACjC,CAAC;AAAA,IACD,OAAO,CAAC,SAAS;AAAA,IACjB,aACE;AAAA,IACF,SAAS,EAAE,OAAO,YAAY,aAAa,uBAAuB;AAAA,EACpE;AAAA,EAEA,OAAO;AAAA,IACL,OAAO,EAAE,OAAO;AAAA,MACd,WAAW,EAAE,KAAK,CAAC,cAAc,UAAU,CAAC,EAAE,SAAS;AAAA,MACvD,KAAK,EAAE,KAAK,CAAC,QAAQ,MAAM,MAAM,IAAI,CAAC,EAAE,SAAS;AAAA,MACjD,OAAO,EAAE,KAAK,CAAC,SAAS,UAAU,OAAO,SAAS,C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,EAEA,YAAY;AAAA,IACV,OAAO,EAAE,OAAO;AAAA,MACd,YAAY,EAAE,OAAO;AAAA,MACrB,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,IAC5B,CAAC;AAAA,IACD,QAAQ,CAAC,QAAQ;AAAA,IACjB,aACE;AAAA,EACJ;AACF;","names":[]}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { BaseComponentProps } from '@json-render/react';
|
|
3
|
+
import { ShadcnProps } from './catalog.mjs';
|
|
4
|
+
export { ComponentDefinition, shadcnComponentDefinitions } from './catalog.mjs';
|
|
5
|
+
import 'zod';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Standard shadcn/ui component implementations.
|
|
9
|
+
*
|
|
10
|
+
* Pass to `defineRegistry()` from `@json-render/react` to create a
|
|
11
|
+
* component registry for rendering JSON specs with shadcn/ui components.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { defineRegistry } from "@json-render/react";
|
|
16
|
+
* import { shadcnComponents } from "@json-render/shadcn";
|
|
17
|
+
*
|
|
18
|
+
* const { registry } = defineRegistry(catalog, {
|
|
19
|
+
* components: {
|
|
20
|
+
* Card: shadcnComponents.Card,
|
|
21
|
+
* Button: shadcnComponents.Button,
|
|
22
|
+
* },
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare const shadcnComponents: {
|
|
27
|
+
Card: ({ props, children }: BaseComponentProps<ShadcnProps<"Card">>) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
Stack: ({ props, children }: BaseComponentProps<ShadcnProps<"Stack">>) => react_jsx_runtime.JSX.Element;
|
|
29
|
+
Grid: ({ props, children }: BaseComponentProps<ShadcnProps<"Grid">>) => react_jsx_runtime.JSX.Element;
|
|
30
|
+
Separator: ({ props }: BaseComponentProps<ShadcnProps<"Separator">>) => react_jsx_runtime.JSX.Element;
|
|
31
|
+
Tabs: ({ props, children, bindings, emit, }: BaseComponentProps<ShadcnProps<"Tabs">>) => react_jsx_runtime.JSX.Element;
|
|
32
|
+
Accordion: ({ props }: BaseComponentProps<ShadcnProps<"Accordion">>) => react_jsx_runtime.JSX.Element;
|
|
33
|
+
Collapsible: ({ props, children, }: BaseComponentProps<ShadcnProps<"Collapsible">>) => react_jsx_runtime.JSX.Element;
|
|
34
|
+
Dialog: ({ props, children }: BaseComponentProps<ShadcnProps<"Dialog">>) => react_jsx_runtime.JSX.Element;
|
|
35
|
+
Drawer: ({ props, children }: BaseComponentProps<ShadcnProps<"Drawer">>) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
Carousel: ({ props }: BaseComponentProps<ShadcnProps<"Carousel">>) => react_jsx_runtime.JSX.Element;
|
|
37
|
+
Table: ({ props }: BaseComponentProps<ShadcnProps<"Table">>) => react_jsx_runtime.JSX.Element;
|
|
38
|
+
Heading: ({ props }: BaseComponentProps<ShadcnProps<"Heading">>) => react_jsx_runtime.JSX.Element;
|
|
39
|
+
Text: ({ props }: BaseComponentProps<ShadcnProps<"Text">>) => react_jsx_runtime.JSX.Element;
|
|
40
|
+
Image: ({ props }: BaseComponentProps<ShadcnProps<"Image">>) => react_jsx_runtime.JSX.Element;
|
|
41
|
+
Avatar: ({ props }: BaseComponentProps<ShadcnProps<"Avatar">>) => react_jsx_runtime.JSX.Element;
|
|
42
|
+
Badge: ({ props }: BaseComponentProps<ShadcnProps<"Badge">>) => react_jsx_runtime.JSX.Element;
|
|
43
|
+
Alert: ({ props }: BaseComponentProps<ShadcnProps<"Alert">>) => react_jsx_runtime.JSX.Element;
|
|
44
|
+
Progress: ({ props }: BaseComponentProps<ShadcnProps<"Progress">>) => react_jsx_runtime.JSX.Element;
|
|
45
|
+
Skeleton: ({ props }: BaseComponentProps<ShadcnProps<"Skeleton">>) => react_jsx_runtime.JSX.Element;
|
|
46
|
+
Spinner: ({ props }: BaseComponentProps<ShadcnProps<"Spinner">>) => react_jsx_runtime.JSX.Element;
|
|
47
|
+
Tooltip: ({ props }: BaseComponentProps<ShadcnProps<"Tooltip">>) => react_jsx_runtime.JSX.Element;
|
|
48
|
+
Popover: ({ props }: BaseComponentProps<ShadcnProps<"Popover">>) => react_jsx_runtime.JSX.Element;
|
|
49
|
+
Input: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Input">>) => react_jsx_runtime.JSX.Element;
|
|
50
|
+
Textarea: ({ props, bindings, }: BaseComponentProps<ShadcnProps<"Textarea">>) => react_jsx_runtime.JSX.Element;
|
|
51
|
+
Select: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Select">>) => react_jsx_runtime.JSX.Element;
|
|
52
|
+
Checkbox: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Checkbox">>) => react_jsx_runtime.JSX.Element;
|
|
53
|
+
Radio: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Radio">>) => react_jsx_runtime.JSX.Element;
|
|
54
|
+
Switch: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Switch">>) => react_jsx_runtime.JSX.Element;
|
|
55
|
+
Slider: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Slider">>) => react_jsx_runtime.JSX.Element;
|
|
56
|
+
Button: ({ props, emit }: BaseComponentProps<ShadcnProps<"Button">>) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
Link: ({ props, on }: BaseComponentProps<ShadcnProps<"Link">>) => react_jsx_runtime.JSX.Element;
|
|
58
|
+
DropdownMenu: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"DropdownMenu">>) => react_jsx_runtime.JSX.Element;
|
|
59
|
+
Toggle: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Toggle">>) => react_jsx_runtime.JSX.Element;
|
|
60
|
+
ToggleGroup: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"ToggleGroup">>) => react_jsx_runtime.JSX.Element;
|
|
61
|
+
ButtonGroup: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"ButtonGroup">>) => react_jsx_runtime.JSX.Element;
|
|
62
|
+
Pagination: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Pagination">>) => react_jsx_runtime.JSX.Element;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export { ShadcnProps, shadcnComponents };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { BaseComponentProps } from '@json-render/react';
|
|
3
|
+
import { ShadcnProps } from './catalog.js';
|
|
4
|
+
export { ComponentDefinition, shadcnComponentDefinitions } from './catalog.js';
|
|
5
|
+
import 'zod';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Standard shadcn/ui component implementations.
|
|
9
|
+
*
|
|
10
|
+
* Pass to `defineRegistry()` from `@json-render/react` to create a
|
|
11
|
+
* component registry for rendering JSON specs with shadcn/ui components.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { defineRegistry } from "@json-render/react";
|
|
16
|
+
* import { shadcnComponents } from "@json-render/shadcn";
|
|
17
|
+
*
|
|
18
|
+
* const { registry } = defineRegistry(catalog, {
|
|
19
|
+
* components: {
|
|
20
|
+
* Card: shadcnComponents.Card,
|
|
21
|
+
* Button: shadcnComponents.Button,
|
|
22
|
+
* },
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare const shadcnComponents: {
|
|
27
|
+
Card: ({ props, children }: BaseComponentProps<ShadcnProps<"Card">>) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
Stack: ({ props, children }: BaseComponentProps<ShadcnProps<"Stack">>) => react_jsx_runtime.JSX.Element;
|
|
29
|
+
Grid: ({ props, children }: BaseComponentProps<ShadcnProps<"Grid">>) => react_jsx_runtime.JSX.Element;
|
|
30
|
+
Separator: ({ props }: BaseComponentProps<ShadcnProps<"Separator">>) => react_jsx_runtime.JSX.Element;
|
|
31
|
+
Tabs: ({ props, children, bindings, emit, }: BaseComponentProps<ShadcnProps<"Tabs">>) => react_jsx_runtime.JSX.Element;
|
|
32
|
+
Accordion: ({ props }: BaseComponentProps<ShadcnProps<"Accordion">>) => react_jsx_runtime.JSX.Element;
|
|
33
|
+
Collapsible: ({ props, children, }: BaseComponentProps<ShadcnProps<"Collapsible">>) => react_jsx_runtime.JSX.Element;
|
|
34
|
+
Dialog: ({ props, children }: BaseComponentProps<ShadcnProps<"Dialog">>) => react_jsx_runtime.JSX.Element;
|
|
35
|
+
Drawer: ({ props, children }: BaseComponentProps<ShadcnProps<"Drawer">>) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
Carousel: ({ props }: BaseComponentProps<ShadcnProps<"Carousel">>) => react_jsx_runtime.JSX.Element;
|
|
37
|
+
Table: ({ props }: BaseComponentProps<ShadcnProps<"Table">>) => react_jsx_runtime.JSX.Element;
|
|
38
|
+
Heading: ({ props }: BaseComponentProps<ShadcnProps<"Heading">>) => react_jsx_runtime.JSX.Element;
|
|
39
|
+
Text: ({ props }: BaseComponentProps<ShadcnProps<"Text">>) => react_jsx_runtime.JSX.Element;
|
|
40
|
+
Image: ({ props }: BaseComponentProps<ShadcnProps<"Image">>) => react_jsx_runtime.JSX.Element;
|
|
41
|
+
Avatar: ({ props }: BaseComponentProps<ShadcnProps<"Avatar">>) => react_jsx_runtime.JSX.Element;
|
|
42
|
+
Badge: ({ props }: BaseComponentProps<ShadcnProps<"Badge">>) => react_jsx_runtime.JSX.Element;
|
|
43
|
+
Alert: ({ props }: BaseComponentProps<ShadcnProps<"Alert">>) => react_jsx_runtime.JSX.Element;
|
|
44
|
+
Progress: ({ props }: BaseComponentProps<ShadcnProps<"Progress">>) => react_jsx_runtime.JSX.Element;
|
|
45
|
+
Skeleton: ({ props }: BaseComponentProps<ShadcnProps<"Skeleton">>) => react_jsx_runtime.JSX.Element;
|
|
46
|
+
Spinner: ({ props }: BaseComponentProps<ShadcnProps<"Spinner">>) => react_jsx_runtime.JSX.Element;
|
|
47
|
+
Tooltip: ({ props }: BaseComponentProps<ShadcnProps<"Tooltip">>) => react_jsx_runtime.JSX.Element;
|
|
48
|
+
Popover: ({ props }: BaseComponentProps<ShadcnProps<"Popover">>) => react_jsx_runtime.JSX.Element;
|
|
49
|
+
Input: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Input">>) => react_jsx_runtime.JSX.Element;
|
|
50
|
+
Textarea: ({ props, bindings, }: BaseComponentProps<ShadcnProps<"Textarea">>) => react_jsx_runtime.JSX.Element;
|
|
51
|
+
Select: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Select">>) => react_jsx_runtime.JSX.Element;
|
|
52
|
+
Checkbox: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Checkbox">>) => react_jsx_runtime.JSX.Element;
|
|
53
|
+
Radio: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Radio">>) => react_jsx_runtime.JSX.Element;
|
|
54
|
+
Switch: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Switch">>) => react_jsx_runtime.JSX.Element;
|
|
55
|
+
Slider: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Slider">>) => react_jsx_runtime.JSX.Element;
|
|
56
|
+
Button: ({ props, emit }: BaseComponentProps<ShadcnProps<"Button">>) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
Link: ({ props, on }: BaseComponentProps<ShadcnProps<"Link">>) => react_jsx_runtime.JSX.Element;
|
|
58
|
+
DropdownMenu: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"DropdownMenu">>) => react_jsx_runtime.JSX.Element;
|
|
59
|
+
Toggle: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Toggle">>) => react_jsx_runtime.JSX.Element;
|
|
60
|
+
ToggleGroup: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"ToggleGroup">>) => react_jsx_runtime.JSX.Element;
|
|
61
|
+
ButtonGroup: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"ButtonGroup">>) => react_jsx_runtime.JSX.Element;
|
|
62
|
+
Pagination: ({ props, bindings, emit, }: BaseComponentProps<ShadcnProps<"Pagination">>) => react_jsx_runtime.JSX.Element;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export { ShadcnProps, shadcnComponents };
|