@alexgorbatchev/shadcn 0.0.31 → 0.0.32
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/README.md +1 -0
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/{chunk-0ewzb2ax.js → chunk-0kyfh857.js} +1 -1
- package/dist/{chunk-8wfy03bp.js → chunk-6kwf9644.js} +1 -1
- package/dist/{chunk-82e7fbmq.js → chunk-9vyg3854.js} +2 -1
- package/dist/chunk-c6g2rbhv.js +3940 -0
- package/dist/chunk-dzvsjw59.js +200 -0
- package/dist/chunk-tch86q2w.js +6050 -0
- package/dist/{chunk-53q730zs.js → chunk-zdt8xxzy.js} +3 -0
- package/dist/components/Alert.d.ts +1 -1
- package/dist/components/assistant-ui/elements/Chart.js +2 -2
- package/dist/components/assistant-ui/elements/GuardrailNotice.js +2 -2
- package/dist/components/assistant-ui/index.js +4 -4
- package/dist/components/assistant-ui/native/Sources.d.ts +1 -1
- package/dist/components/carousel/index.js +15 -204
- package/dist/components/chart/AnalyticsChart.d.ts +3 -2
- package/dist/components/chart/Chart.d.ts +1 -1
- package/dist/components/chart/index.js +24 -10
- package/dist/components/chart/types.d.ts +1 -0
- package/dist/components/json-render/JsonAccordion.d.ts +3 -0
- package/dist/components/json-render/JsonAlert.d.ts +3 -0
- package/dist/components/json-render/JsonAvatar.d.ts +3 -0
- package/dist/components/json-render/JsonBadge.d.ts +3 -0
- package/dist/components/json-render/JsonButton.d.ts +3 -0
- package/dist/components/json-render/JsonButtonGroup.d.ts +3 -0
- package/dist/components/json-render/JsonCard.d.ts +3 -0
- package/dist/components/json-render/JsonCarousel.d.ts +3 -0
- package/dist/components/json-render/JsonCheckbox.d.ts +3 -0
- package/dist/components/json-render/JsonCollapsible.d.ts +3 -0
- package/dist/components/json-render/JsonDialog.d.ts +3 -0
- package/dist/components/json-render/JsonDrawer.d.ts +3 -0
- package/dist/components/json-render/JsonDropdownMenu.d.ts +3 -0
- package/dist/components/json-render/JsonGrid.d.ts +3 -0
- package/dist/components/json-render/JsonHeading.d.ts +3 -0
- package/dist/components/json-render/JsonImage.d.ts +3 -0
- package/dist/components/json-render/JsonInput.d.ts +3 -0
- package/dist/components/json-render/JsonLink.d.ts +3 -0
- package/dist/components/json-render/JsonPagination.d.ts +3 -0
- package/dist/components/json-render/JsonPopover.d.ts +3 -0
- package/dist/components/json-render/JsonProgress.d.ts +3 -0
- package/dist/components/json-render/JsonRadio.d.ts +3 -0
- package/dist/components/json-render/JsonSelect.d.ts +3 -0
- package/dist/components/json-render/JsonSeparator.d.ts +3 -0
- package/dist/components/json-render/JsonSkeleton.d.ts +3 -0
- package/dist/components/json-render/JsonSlider.d.ts +3 -0
- package/dist/components/json-render/JsonSpinner.d.ts +3 -0
- package/dist/components/json-render/JsonStack.d.ts +3 -0
- package/dist/components/json-render/JsonSwitch.d.ts +3 -0
- package/dist/components/json-render/JsonTable.d.ts +3 -0
- package/dist/components/json-render/JsonTabs.d.ts +3 -0
- package/dist/components/json-render/JsonText.d.ts +3 -0
- package/dist/components/json-render/JsonTextarea.d.ts +3 -0
- package/dist/components/json-render/JsonToggle.d.ts +3 -0
- package/dist/components/json-render/JsonToggleGroup.d.ts +3 -0
- package/dist/components/json-render/JsonTooltip.d.ts +3 -0
- package/dist/components/json-render/catalog.d.ts +548 -0
- package/dist/components/json-render/catalog.js +6 -0
- package/dist/components/json-render/getPaginationRange.d.ts +1 -0
- package/dist/components/json-render/index.d.ts +39 -0
- package/dist/components/json-render/index.js +1254 -0
- package/dist/index.js +569 -4191
- package/licenses/json-render-APACHE-2.0.txt +201 -0
- package/llms/components/data-display/AnalyticsChart.md +34 -0
- package/llms/components/data-display/JsonRender.md +476 -0
- package/llms/components/feedback/Alert.md +20 -4
- package/llms/setup.md +1 -0
- package/llms.txt +1 -0
- package/package.json +19 -1
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
# JsonRender
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/data-display/JsonRender
|
|
4
|
+
Source: src/components/stories/data-display/JsonRender.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/data-display/JsonRender.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { components, componentDefinitions } from "@alexgorbatchev/shadcn/json-render";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Supporting imports
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { useState, type ReactElement } from "react";
|
|
18
|
+
import { createStateStore, defineCatalog, type Spec } from "@json-render/core";
|
|
19
|
+
import { JSONUIProvider, Renderer, defineRegistry } from "@json-render/react";
|
|
20
|
+
import { schema } from "@json-render/react/schema";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Default component
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
JsonExample
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Examples
|
|
30
|
+
|
|
31
|
+
Storybook CSF excerpts. Default args and render apply unless overridden. Local helpers, fixtures, decorators, and providers may be required; these are reference excerpts, not standalone consumer modules. Interaction tests are omitted.
|
|
32
|
+
|
|
33
|
+
### Form
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
{
|
|
37
|
+
args: {
|
|
38
|
+
spec: {
|
|
39
|
+
root: "form",
|
|
40
|
+
elements: {
|
|
41
|
+
form: {
|
|
42
|
+
type: "Stack",
|
|
43
|
+
props: {},
|
|
44
|
+
children: [
|
|
45
|
+
"input",
|
|
46
|
+
"textarea",
|
|
47
|
+
"select",
|
|
48
|
+
"checkbox",
|
|
49
|
+
"radio",
|
|
50
|
+
"switch",
|
|
51
|
+
"slider",
|
|
52
|
+
"toggle",
|
|
53
|
+
"toggles",
|
|
54
|
+
"buttons",
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
input: { type: "Input", props: { label: "Name", value: "Ada" } },
|
|
58
|
+
textarea: { type: "Textarea", props: { label: "Notes", value: "Initial notes" } },
|
|
59
|
+
select: { type: "Select", props: { label: "Plan", options: ["Free", "Pro"], value: "Free" } },
|
|
60
|
+
checkbox: { type: "Checkbox", props: { label: "Agree" } },
|
|
61
|
+
radio: { type: "Radio", props: { label: "Frequency", options: ["Daily", "Weekly"] } },
|
|
62
|
+
switch: { type: "Switch", props: { label: "Notifications" } },
|
|
63
|
+
slider: { type: "Slider", props: { label: "Volume", min: 0, max: 10 } },
|
|
64
|
+
toggle: { type: "Toggle", props: { label: "Bold" } },
|
|
65
|
+
toggles: {
|
|
66
|
+
type: "ToggleGroup",
|
|
67
|
+
props: {
|
|
68
|
+
type: "multiple",
|
|
69
|
+
items: [
|
|
70
|
+
{ label: "Left", value: "left" },
|
|
71
|
+
{ label: "Right", value: "right" },
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
buttons: {
|
|
76
|
+
type: "ButtonGroup",
|
|
77
|
+
props: {
|
|
78
|
+
buttons: [
|
|
79
|
+
{ label: "Day", value: "day" },
|
|
80
|
+
{ label: "Month", value: "month" },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Overlays
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
{
|
|
94
|
+
args: {
|
|
95
|
+
spec: {
|
|
96
|
+
root: "root",
|
|
97
|
+
elements: {
|
|
98
|
+
root: {
|
|
99
|
+
type: "Stack",
|
|
100
|
+
props: {},
|
|
101
|
+
children: ["tabs", "accordion", "collapse", "tooltip", "popover", "dropdown"],
|
|
102
|
+
},
|
|
103
|
+
tabs: {
|
|
104
|
+
type: "Tabs",
|
|
105
|
+
props: {
|
|
106
|
+
tabs: [
|
|
107
|
+
{ value: "one", label: "First tab" },
|
|
108
|
+
{ value: "two", label: "Second tab" },
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
accordion: {
|
|
113
|
+
type: "Accordion",
|
|
114
|
+
props: {
|
|
115
|
+
type: "multiple",
|
|
116
|
+
items: [
|
|
117
|
+
{ title: "Details", content: "Expanded details" },
|
|
118
|
+
{ title: "More", content: "More details" },
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
collapse: { type: "Collapsible", props: { title: "Expand section", defaultOpen: false }, children: ["text"] },
|
|
123
|
+
text: { type: "Text", props: { text: "Collapsed content" } },
|
|
124
|
+
tooltip: { type: "Tooltip", props: { content: "Keyboard help", text: "Help trigger" } },
|
|
125
|
+
popover: { type: "Popover", props: { trigger: "Show popover", content: "Popover content" } },
|
|
126
|
+
dropdown: {
|
|
127
|
+
type: "DropdownMenu",
|
|
128
|
+
props: { label: "Open menu", items: [{ label: "Choose item", value: "item" }] },
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Display
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
{
|
|
140
|
+
args: {
|
|
141
|
+
spec: {
|
|
142
|
+
root: "card",
|
|
143
|
+
elements: {
|
|
144
|
+
card: {
|
|
145
|
+
type: "Card",
|
|
146
|
+
props: { title: "Archive", description: "Rendered from JSON", maxWidth: "full" },
|
|
147
|
+
children: ["grid", "table", "progress", "spinner", "skeleton", "separator", "carousel"],
|
|
148
|
+
},
|
|
149
|
+
grid: {
|
|
150
|
+
type: "Grid",
|
|
151
|
+
props: { columns: 2 },
|
|
152
|
+
children: ["heading", "text", "badge", "alert", "avatar", "image", "link", "button"],
|
|
153
|
+
},
|
|
154
|
+
heading: { type: "Heading", props: { text: "Measurements", level: "h2" } },
|
|
155
|
+
text: { type: "Text", props: { text: "Last updated today", variant: "muted" } },
|
|
156
|
+
badge: { type: "Badge", props: { text: "Ready", variant: "secondary" } },
|
|
157
|
+
alert: { type: "Alert", props: { title: "Synced", message: "All records imported", type: "success" } },
|
|
158
|
+
avatar: { type: "Avatar", props: { name: "Ada Lovelace" } },
|
|
159
|
+
image: {
|
|
160
|
+
type: "Image",
|
|
161
|
+
props: {
|
|
162
|
+
src: new URL("../fixtures/avatar.svg", import.meta.url).href,
|
|
163
|
+
alt: "Profile",
|
|
164
|
+
width: 40,
|
|
165
|
+
height: 40,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
link: { type: "Link", props: { label: "Read documentation", href: "#docs" } },
|
|
169
|
+
button: { type: "Button", props: { label: "Sync records", variant: "secondary" } },
|
|
170
|
+
table: {
|
|
171
|
+
type: "Table",
|
|
172
|
+
props: { caption: "Measurements", columns: ["Day", "Score"], rows: [["Monday", "80"]] },
|
|
173
|
+
},
|
|
174
|
+
progress: { type: "Progress", props: { value: 50, max: 100, label: "Import progress" } },
|
|
175
|
+
spinner: { type: "Spinner", props: { size: "md", label: "Loading records" } },
|
|
176
|
+
skeleton: { type: "Skeleton", props: { width: "100%", height: "20px" } },
|
|
177
|
+
separator: { type: "Separator", props: {} },
|
|
178
|
+
carousel: {
|
|
179
|
+
type: "Carousel",
|
|
180
|
+
props: {
|
|
181
|
+
items: [
|
|
182
|
+
{ title: "First slide", description: "First record" },
|
|
183
|
+
{ title: "Second slide", description: "Second record" },
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### BoundForm
|
|
194
|
+
|
|
195
|
+
```tsx
|
|
196
|
+
{
|
|
197
|
+
args: {
|
|
198
|
+
state: {
|
|
199
|
+
name: "Ada",
|
|
200
|
+
notes: "Initial notes",
|
|
201
|
+
plan: "Free",
|
|
202
|
+
agree: false,
|
|
203
|
+
frequency: "Daily",
|
|
204
|
+
notifications: false,
|
|
205
|
+
volume: 0,
|
|
206
|
+
bold: false,
|
|
207
|
+
position: "left",
|
|
208
|
+
period: "day",
|
|
209
|
+
},
|
|
210
|
+
spec: {
|
|
211
|
+
root: "root",
|
|
212
|
+
elements: {
|
|
213
|
+
root: {
|
|
214
|
+
type: "Stack",
|
|
215
|
+
props: {},
|
|
216
|
+
children: [
|
|
217
|
+
"input",
|
|
218
|
+
"textarea",
|
|
219
|
+
"select",
|
|
220
|
+
"checkbox",
|
|
221
|
+
"radio",
|
|
222
|
+
"switch",
|
|
223
|
+
"slider",
|
|
224
|
+
"toggle",
|
|
225
|
+
"toggles",
|
|
226
|
+
"buttons",
|
|
227
|
+
],
|
|
228
|
+
},
|
|
229
|
+
input: {
|
|
230
|
+
type: "Input",
|
|
231
|
+
props: {
|
|
232
|
+
label: "Name",
|
|
233
|
+
value: { $bindState: "/name" },
|
|
234
|
+
checks: [{ type: "required", message: "Name required" }],
|
|
235
|
+
validateOn: "change",
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
textarea: {
|
|
239
|
+
type: "Textarea",
|
|
240
|
+
props: {
|
|
241
|
+
label: "Notes",
|
|
242
|
+
value: { $bindState: "/notes" },
|
|
243
|
+
checks: [{ type: "required", message: "Notes required" }],
|
|
244
|
+
validateOn: "blur",
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
select: {
|
|
248
|
+
type: "Select",
|
|
249
|
+
props: {
|
|
250
|
+
label: "Plan",
|
|
251
|
+
options: ["Free", "Pro"],
|
|
252
|
+
value: { $bindState: "/plan" },
|
|
253
|
+
checks: [{ type: "required", message: "Plan required" }],
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
checkbox: {
|
|
257
|
+
type: "Checkbox",
|
|
258
|
+
props: {
|
|
259
|
+
label: "Agree",
|
|
260
|
+
checked: { $bindState: "/agree" },
|
|
261
|
+
checks: [{ type: "matches", args: { other: true }, message: "Agreement required" }],
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
radio: {
|
|
265
|
+
type: "Radio",
|
|
266
|
+
props: {
|
|
267
|
+
label: "Frequency",
|
|
268
|
+
options: ["Daily", "Weekly"],
|
|
269
|
+
value: { $bindState: "/frequency" },
|
|
270
|
+
checks: [{ type: "required", message: "Frequency required" }],
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
switch: {
|
|
274
|
+
type: "Switch",
|
|
275
|
+
props: {
|
|
276
|
+
label: "Notifications",
|
|
277
|
+
checked: { $bindState: "/notifications" },
|
|
278
|
+
checks: [{ type: "matches", args: { other: true }, message: "Notification preference required" }],
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
slider: { type: "Slider", props: { label: "Volume", min: 0, max: 10, value: { $bindState: "/volume" } } },
|
|
282
|
+
toggle: { type: "Toggle", props: { label: "Bold", pressed: { $bindState: "/bold" } } },
|
|
283
|
+
toggles: {
|
|
284
|
+
type: "ToggleGroup",
|
|
285
|
+
props: {
|
|
286
|
+
type: "multiple",
|
|
287
|
+
value: { $bindState: "/position" },
|
|
288
|
+
items: [
|
|
289
|
+
{ label: "Left", value: "left" },
|
|
290
|
+
{ label: "Right", value: "right" },
|
|
291
|
+
],
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
buttons: {
|
|
295
|
+
type: "ButtonGroup",
|
|
296
|
+
props: {
|
|
297
|
+
selected: { $bindState: "/period" },
|
|
298
|
+
buttons: [
|
|
299
|
+
{ label: "Day", value: "day" },
|
|
300
|
+
{ label: "Month", value: "month" },
|
|
301
|
+
],
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### MissingBoundValues
|
|
311
|
+
|
|
312
|
+
```tsx
|
|
313
|
+
{
|
|
314
|
+
args: { ...BoundForm.args, state: {} }
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### PaginationAndDialog
|
|
319
|
+
|
|
320
|
+
```tsx
|
|
321
|
+
{
|
|
322
|
+
args: {
|
|
323
|
+
state: { page: 1, show: false, drawer: false },
|
|
324
|
+
spec: {
|
|
325
|
+
root: "root",
|
|
326
|
+
elements: {
|
|
327
|
+
root: { type: "Stack", props: {}, children: ["pagination", "open", "dialog", "openDrawer", "drawer"] },
|
|
328
|
+
pagination: { type: "Pagination", props: { page: { $bindState: "/page" }, totalPages: 20 } },
|
|
329
|
+
open: {
|
|
330
|
+
type: "Button",
|
|
331
|
+
props: { label: "Open dialog" },
|
|
332
|
+
on: { press: { action: "setState", params: { statePath: "/show", value: true } } },
|
|
333
|
+
},
|
|
334
|
+
dialog: {
|
|
335
|
+
type: "Dialog",
|
|
336
|
+
props: { title: "Confirm import", description: "Import your records", openPath: "/show" },
|
|
337
|
+
},
|
|
338
|
+
openDrawer: {
|
|
339
|
+
type: "Button",
|
|
340
|
+
props: { label: "Open drawer" },
|
|
341
|
+
on: { press: { action: "setState", params: { statePath: "/drawer", value: true } } },
|
|
342
|
+
},
|
|
343
|
+
drawer: {
|
|
344
|
+
type: "Drawer",
|
|
345
|
+
props: { title: "Archive details", description: "Stored records", openPath: "/drawer" },
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### TypographyAndPlaceholders
|
|
354
|
+
|
|
355
|
+
```tsx
|
|
356
|
+
{
|
|
357
|
+
args: {
|
|
358
|
+
spec: {
|
|
359
|
+
root: "root",
|
|
360
|
+
elements: {
|
|
361
|
+
root: {
|
|
362
|
+
type: "Stack",
|
|
363
|
+
props: { direction: "horizontal", gap: "lg", align: "center", justify: "between" },
|
|
364
|
+
children: [
|
|
365
|
+
"small",
|
|
366
|
+
"medium",
|
|
367
|
+
"large",
|
|
368
|
+
"empty",
|
|
369
|
+
"placeholder",
|
|
370
|
+
"avatar",
|
|
371
|
+
"spinner",
|
|
372
|
+
"skeleton",
|
|
373
|
+
"progress",
|
|
374
|
+
"separator",
|
|
375
|
+
"table",
|
|
376
|
+
],
|
|
377
|
+
},
|
|
378
|
+
small: {
|
|
379
|
+
type: "Card",
|
|
380
|
+
props: { maxWidth: "sm", centered: true, title: "Small card" },
|
|
381
|
+
children: ["h1", "caption", "alert"],
|
|
382
|
+
},
|
|
383
|
+
medium: {
|
|
384
|
+
type: "Card",
|
|
385
|
+
props: { maxWidth: "md", description: "Medium card" },
|
|
386
|
+
children: ["h3", "lead", "warning"],
|
|
387
|
+
},
|
|
388
|
+
large: { type: "Card", props: { maxWidth: "lg" }, children: ["h4", "code", "info"] },
|
|
389
|
+
empty: { type: "Card", props: {}, children: ["body", "badge"] },
|
|
390
|
+
h1: { type: "Heading", props: { text: "Page heading", level: "h1" } },
|
|
391
|
+
h3: { type: "Heading", props: { text: "Section heading", level: "h3" } },
|
|
392
|
+
h4: { type: "Heading", props: { text: "Detail heading", level: "h4" } },
|
|
393
|
+
caption: { type: "Text", props: { text: "Caption", variant: "caption" } },
|
|
394
|
+
lead: { type: "Text", props: { text: "Lead paragraph", variant: "lead" } },
|
|
395
|
+
code: { type: "Text", props: { text: "const ready = true", variant: "code" } },
|
|
396
|
+
body: { type: "Text", props: { text: "Body paragraph" } },
|
|
397
|
+
badge: { type: "Badge", props: { text: "Default badge" } },
|
|
398
|
+
alert: { type: "Alert", props: { title: "Import failed", type: "error" } },
|
|
399
|
+
warning: { type: "Alert", props: { title: "Warning", type: "warning" } },
|
|
400
|
+
info: { type: "Alert", props: { title: "Default notice" } },
|
|
401
|
+
placeholder: { type: "Image", props: { src: null, alt: "Missing photograph" } },
|
|
402
|
+
avatar: { type: "Avatar", props: { name: "", size: "lg" } },
|
|
403
|
+
spinner: { type: "Spinner", props: { size: "sm" } },
|
|
404
|
+
skeleton: { type: "Skeleton", props: { rounded: true } },
|
|
405
|
+
progress: { type: "Progress", props: { value: 20 } },
|
|
406
|
+
separator: { type: "Separator", props: { orientation: "vertical" } },
|
|
407
|
+
table: { type: "Table", props: { columns: ["Name"], rows: [["Ada"]] } },
|
|
408
|
+
},
|
|
409
|
+
},
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
### InitialSelections
|
|
415
|
+
|
|
416
|
+
```tsx
|
|
417
|
+
{
|
|
418
|
+
args: {
|
|
419
|
+
spec: {
|
|
420
|
+
root: "root",
|
|
421
|
+
elements: {
|
|
422
|
+
root: {
|
|
423
|
+
type: "Grid",
|
|
424
|
+
props: { columns: 1, gap: "sm" },
|
|
425
|
+
children: [
|
|
426
|
+
"buttons",
|
|
427
|
+
"tabs",
|
|
428
|
+
"toggles",
|
|
429
|
+
"pagination",
|
|
430
|
+
"slider",
|
|
431
|
+
"accordion",
|
|
432
|
+
"image",
|
|
433
|
+
"avatar",
|
|
434
|
+
"spinner",
|
|
435
|
+
"button",
|
|
436
|
+
],
|
|
437
|
+
},
|
|
438
|
+
buttons: {
|
|
439
|
+
type: "ButtonGroup",
|
|
440
|
+
props: {
|
|
441
|
+
selected: "month",
|
|
442
|
+
buttons: [
|
|
443
|
+
{ label: "Day view", value: "day" },
|
|
444
|
+
{ label: "Month view", value: "month" },
|
|
445
|
+
],
|
|
446
|
+
},
|
|
447
|
+
},
|
|
448
|
+
tabs: {
|
|
449
|
+
type: "Tabs",
|
|
450
|
+
props: {
|
|
451
|
+
value: "second",
|
|
452
|
+
tabs: [
|
|
453
|
+
{ label: "One", value: "first" },
|
|
454
|
+
{ label: "Two", value: "second" },
|
|
455
|
+
],
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
toggles: { type: "ToggleGroup", props: { value: "", items: [{ label: "Pin", value: "pin" }] } },
|
|
459
|
+
pagination: { type: "Pagination", props: { totalPages: 3 } },
|
|
460
|
+
slider: { type: "Slider", props: { value: 20 } },
|
|
461
|
+
accordion: { type: "Accordion", props: { items: [{ title: "Single details", content: "Single expanded" }] } },
|
|
462
|
+
image: {
|
|
463
|
+
type: "Image",
|
|
464
|
+
props: { src: new URL("../fixtures/avatar.svg", import.meta.url).href, alt: "Small profile" },
|
|
465
|
+
},
|
|
466
|
+
avatar: {
|
|
467
|
+
type: "Avatar",
|
|
468
|
+
props: { name: "Ada", size: "sm", src: new URL("../fixtures/avatar.svg", import.meta.url).href },
|
|
469
|
+
},
|
|
470
|
+
spinner: { type: "Spinner", props: { size: "lg", label: "Large loader" } },
|
|
471
|
+
button: { type: "Button", props: { label: "Delete", variant: "danger", disabled: true } },
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
```
|
|
@@ -26,7 +26,7 @@ Alert
|
|
|
26
26
|
## Story controls
|
|
27
27
|
|
|
28
28
|
```tsx
|
|
29
|
-
{ variant: { control: "select", options: ["default", "destructive"] } }
|
|
29
|
+
{ variant: { control: "select", options: ["default", "destructive", "success", "warning", "info"] } }
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## Default render
|
|
@@ -57,6 +57,22 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
57
57
|
}
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
### Success
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
{
|
|
64
|
+
args: { variant: "success" }
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Info
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
{
|
|
72
|
+
args: { variant: "info" }
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
60
76
|
### Compact
|
|
61
77
|
|
|
62
78
|
```tsx
|
|
@@ -80,14 +96,14 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
80
96
|
}
|
|
81
97
|
```
|
|
82
98
|
|
|
83
|
-
###
|
|
99
|
+
### Warning
|
|
84
100
|
|
|
85
101
|
```tsx
|
|
86
102
|
{
|
|
87
|
-
render: (args) => (<Alert {...args}
|
|
103
|
+
render: (args) => (<Alert {...args} variant="warning">
|
|
88
104
|
<TriangleAlertIcon aria-hidden="true"/>
|
|
89
105
|
<AlertTitle>Subscription expires soon</AlertTitle>
|
|
90
|
-
<AlertDescription
|
|
106
|
+
<AlertDescription>Renew your subscription to keep access.</AlertDescription>
|
|
91
107
|
</Alert>)
|
|
92
108
|
}
|
|
93
109
|
```
|
package/llms/setup.md
CHANGED
|
@@ -52,6 +52,7 @@ Import shared controls and providers from `@alexgorbatchev/shadcn`. Import the f
|
|
|
52
52
|
|
|
53
53
|
| Import path suffix | Components | Install alongside the package |
|
|
54
54
|
| -------------------- | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| `/json-render` | JSON Render component registry and catalog | `bun add @json-render/core@0.21.1 @json-render/react@0.21.1 embla-carousel-react@^8.6.0` |
|
|
55
56
|
| `/chart` | Chart parts, AnalyticsChart, Sparkline, hooks and types | `bun add recharts@3.8.0 cssesc@3.0.0 es-toolkit@1.52.0` |
|
|
56
57
|
| `/calendar` | Calendar, CalendarDayButton, DatePicker, DateRangePicker | `bun add @daypicker/react@^10.0.2` |
|
|
57
58
|
| `/persian-calendar` | PersianCalendar | `bun add @daypicker/persian@^10.0.2 @daypicker/react@^10.0.2` |
|
package/llms.txt
CHANGED
|
@@ -335,6 +335,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
335
335
|
- [DataGrid](./llms/components/data-display/DataGrid.md)
|
|
336
336
|
- [DataGridColumnOptions](./llms/components/data-display/DataGridColumnOptions.md)
|
|
337
337
|
- [Item](./llms/components/data-display/Item.md)
|
|
338
|
+
- [JsonRender](./llms/components/data-display/JsonRender.md)
|
|
338
339
|
- [JsonViewer](./llms/components/data-display/JsonViewer.md)
|
|
339
340
|
- [Kbd](./llms/components/data-display/Kbd.md)
|
|
340
341
|
- [Meter](./llms/components/data-display/Meter.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexgorbatchev/shadcn",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"description": "Sharp, monospace React components with compact and comfortable densities.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -1032,6 +1032,14 @@
|
|
|
1032
1032
|
"./gantt": {
|
|
1033
1033
|
"types": "./dist/components/gantt/index.d.ts",
|
|
1034
1034
|
"import": "./dist/components/gantt/index.js"
|
|
1035
|
+
},
|
|
1036
|
+
"./json-render": {
|
|
1037
|
+
"types": "./dist/components/json-render/index.d.ts",
|
|
1038
|
+
"import": "./dist/components/json-render/index.js"
|
|
1039
|
+
},
|
|
1040
|
+
"./json-render/catalog": {
|
|
1041
|
+
"types": "./dist/components/json-render/catalog.d.ts",
|
|
1042
|
+
"import": "./dist/components/json-render/catalog.js"
|
|
1035
1043
|
}
|
|
1036
1044
|
},
|
|
1037
1045
|
"publishConfig": {
|
|
@@ -1085,6 +1093,8 @@
|
|
|
1085
1093
|
"@headless-tree/core": "1.8.0",
|
|
1086
1094
|
"@headless-tree/react": "1.8.0",
|
|
1087
1095
|
"@hookform/resolvers": "5.9.1",
|
|
1096
|
+
"@json-render/core": "0.21.1",
|
|
1097
|
+
"@json-render/react": "0.21.1",
|
|
1088
1098
|
"@storybook/addon-a11y": "^10.6.1",
|
|
1089
1099
|
"@storybook/addon-docs": "^10.6.1",
|
|
1090
1100
|
"@storybook/addon-vitest": "^10.6.1",
|
|
@@ -1166,6 +1176,8 @@
|
|
|
1166
1176
|
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
|
1167
1177
|
"@headless-tree/core": "^1.8.0",
|
|
1168
1178
|
"@headless-tree/react": "^1.8.0",
|
|
1179
|
+
"@json-render/core": "0.21.1",
|
|
1180
|
+
"@json-render/react": "0.21.1",
|
|
1169
1181
|
"@tanstack/react-table": "9.2.8",
|
|
1170
1182
|
"@tanstack/react-virtual": "^3.14.13",
|
|
1171
1183
|
"@tiptap/core": "^3.32.0",
|
|
@@ -1332,6 +1344,12 @@
|
|
|
1332
1344
|
},
|
|
1333
1345
|
"@types/react-big-calendar": {
|
|
1334
1346
|
"optional": true
|
|
1347
|
+
},
|
|
1348
|
+
"@json-render/core": {
|
|
1349
|
+
"optional": true
|
|
1350
|
+
},
|
|
1351
|
+
"@json-render/react": {
|
|
1352
|
+
"optional": true
|
|
1335
1353
|
}
|
|
1336
1354
|
},
|
|
1337
1355
|
"packageManager": "bun@1.4.2"
|