@alexgorbatchev/shadcn 0.0.104 → 0.0.105
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/dist/{chunk-e1hkq1mw.js → chunk-19bkeafb.js} +616 -480
- package/dist/{chunk-p8bdmafq.js → chunk-j7fvvgyp.js} +2 -2
- package/dist/components/ActionBar.d.ts +31 -0
- package/dist/components/ErrorSummary.d.ts +21 -0
- package/dist/components/Outline.d.ts +20 -0
- package/dist/components/json-render/JsonDropdownMenu.d.ts +4 -0
- package/dist/components/json-render/JsonForm.d.ts +90 -0
- package/dist/components/json-render/catalog.js +1 -1
- package/dist/components/json-render/index.d.ts +2 -0
- package/dist/components/json-render/index.js +485 -227
- package/dist/index.d.ts +5 -0
- package/dist/index.js +15 -1
- package/dist/prototype.js +1 -1
- package/llms/components/data-display/JsonRenderForm.md +99 -0
- package/llms/components/feedback/ErrorSummary.md +46 -0
- package/llms/components/layout/ActionBar.md +65 -0
- package/llms/components/navigation/Outline.md +42 -0
- package/llms.txt +4 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,11 @@ export { useDropTarget } from "./hooks/useDropTarget.js";
|
|
|
36
36
|
export type { IDragDropItem, IDragSourceOptions, IDragSource, IDropTargetOptions, IDropTarget, } from "./drag-drop/types.js";
|
|
37
37
|
export { EmptyState } from "./components/EmptyState.js";
|
|
38
38
|
export { PageMessage } from "./components/PageMessage.js";
|
|
39
|
+
export { ActionBar, ActionBarRow } from "./components/ActionBar.js";
|
|
40
|
+
export type { IActionBarProps, IActionBarRowProps } from "./components/ActionBar.js";
|
|
41
|
+
export { ErrorSummary, ErrorSummaryItem } from "./components/ErrorSummary.js";
|
|
42
|
+
export type { IErrorSummaryProps, IErrorSummaryItemProps } from "./components/ErrorSummary.js";
|
|
43
|
+
export { Outline, OutlineSection, OutlineItem } from "./components/Outline.js";
|
|
39
44
|
export { DataViewer, formatDataLabel } from "./components/DataViewer.js";
|
|
40
45
|
export type { DataViewerProps } from "./components/DataViewer.js";
|
|
41
46
|
export { JsonViewer } from "./components/JsonViewer.js";
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,13 @@ import {
|
|
|
17
17
|
OptionCard2,
|
|
18
18
|
EmptyState3,
|
|
19
19
|
PageMessage2,
|
|
20
|
+
ActionBar2,
|
|
21
|
+
ActionBarRow2,
|
|
22
|
+
ErrorSummary2,
|
|
23
|
+
ErrorSummaryItem2,
|
|
24
|
+
Outline2,
|
|
25
|
+
OutlineSection2,
|
|
26
|
+
OutlineItem2,
|
|
20
27
|
formatDataLabel2,
|
|
21
28
|
DataViewer2,
|
|
22
29
|
JsonViewer2,
|
|
@@ -173,7 +180,7 @@ import {
|
|
|
173
180
|
StatusTracker2,
|
|
174
181
|
DashboardLayout2,
|
|
175
182
|
BillingUsage2
|
|
176
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-19bkeafb.js";
|
|
177
184
|
import {
|
|
178
185
|
Combobox2,
|
|
179
186
|
ComboboxValue2,
|
|
@@ -488,6 +495,8 @@ export {
|
|
|
488
495
|
AccordionItem2 as AccordionItem,
|
|
489
496
|
AccordionTrigger2 as AccordionTrigger,
|
|
490
497
|
AccountMenu2 as AccountMenu,
|
|
498
|
+
ActionBar2 as ActionBar,
|
|
499
|
+
ActionBarRow2 as ActionBarRow,
|
|
491
500
|
ActionsMenu2 as ActionsMenu,
|
|
492
501
|
ActionsMenuContextContent2 as ActionsMenuContextContent,
|
|
493
502
|
ActionsMenuContextTarget2 as ActionsMenuContextTarget,
|
|
@@ -644,6 +653,8 @@ export {
|
|
|
644
653
|
EmptyMedia2 as EmptyMedia,
|
|
645
654
|
EmptyState3 as EmptyState,
|
|
646
655
|
EmptyTitle2 as EmptyTitle,
|
|
656
|
+
ErrorSummary2 as ErrorSummary,
|
|
657
|
+
ErrorSummaryItem2 as ErrorSummaryItem,
|
|
647
658
|
Field2 as Field,
|
|
648
659
|
FieldContent2 as FieldContent,
|
|
649
660
|
FieldDescription2 as FieldDescription,
|
|
@@ -755,6 +766,9 @@ export {
|
|
|
755
766
|
OptionCard2 as OptionCard,
|
|
756
767
|
OptionCardGroup2 as OptionCardGroup,
|
|
757
768
|
OptionSelect2 as OptionSelect,
|
|
769
|
+
Outline2 as Outline,
|
|
770
|
+
OutlineItem2 as OutlineItem,
|
|
771
|
+
OutlineSection2 as OutlineSection,
|
|
758
772
|
PageHeader2 as PageHeader,
|
|
759
773
|
PageIntro2 as PageIntro,
|
|
760
774
|
PageMessage2 as PageMessage,
|
package/dist/prototype.js
CHANGED
|
@@ -2051,7 +2051,7 @@ var program = new Command;
|
|
|
2051
2051
|
// package.json
|
|
2052
2052
|
var package_default = {
|
|
2053
2053
|
name: "@alexgorbatchev/shadcn",
|
|
2054
|
-
version: "0.0.
|
|
2054
|
+
version: "0.0.105",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# JsonRenderForm
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/data-display/JsonRenderForm
|
|
4
|
+
Source: src/components/stories/data-display/JsonRenderForm.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/data-display/JsonRenderForm.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { Button } from "@alexgorbatchev/shadcn";
|
|
12
|
+
import { components, componentDefinitions, JsonFormProvider, stripRequiredMark, useJsonReveal, type JsonFormMode } from "@alexgorbatchev/shadcn/json-render";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Supporting imports
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { useEffect, useState, type ReactElement } from "react";
|
|
19
|
+
import { createStateStore, defineCatalog, type Spec } from "@json-render/core";
|
|
20
|
+
import { JSONUIProvider, Renderer, defineRegistry } from "@json-render/react";
|
|
21
|
+
import { schema } from "@json-render/react/schema";
|
|
22
|
+
import { z } from "zod";
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Default component
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
JsonFormExample
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Examples
|
|
32
|
+
|
|
33
|
+
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.
|
|
34
|
+
|
|
35
|
+
### RequiredAndMessages
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
{
|
|
39
|
+
args: {
|
|
40
|
+
spec: answerSpec,
|
|
41
|
+
state: { answers: { company: "", notes: "", plan: "", frequency: "", agree: false, alerts: false, volume: 0 } },
|
|
42
|
+
errors: { "/answers/company": "Company name: Enter a name" },
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### LockedKeepsReadingControls
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
{
|
|
51
|
+
args: { spec: answerSpec, state: { answers }, mode: "locked" }
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### ReadOnlyValues
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
{
|
|
59
|
+
args: { spec: answerSpec, state: { answers }, mode: "values" }
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### DropdownMenuChoice
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
{
|
|
67
|
+
args: { spec: answerSpec, state: { answers: {} } }
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### RevealOpensHidingContainers
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
{
|
|
75
|
+
args: {
|
|
76
|
+
reveal: ["inSection", "inTab"],
|
|
77
|
+
spec: {
|
|
78
|
+
root: "tabs",
|
|
79
|
+
elements: {
|
|
80
|
+
tabs: {
|
|
81
|
+
type: "Tabs",
|
|
82
|
+
props: {
|
|
83
|
+
tabs: [
|
|
84
|
+
{ value: "overview", label: "Overview" },
|
|
85
|
+
{ value: "decide", label: "Decide" },
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
children: ["overview", "decide"],
|
|
89
|
+
},
|
|
90
|
+
overview: { type: "Text", props: { text: "Overview panel" } },
|
|
91
|
+
decide: { type: "Stack", props: {}, children: ["inTab", "section"] },
|
|
92
|
+
inTab: { type: "RevealProbe", props: { name: "inTab" } },
|
|
93
|
+
section: { type: "Collapsible", props: { title: "Advanced" }, children: ["inSection"] },
|
|
94
|
+
inSection: { type: "RevealProbe", props: { name: "inSection" } },
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# ErrorSummary
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/feedback/ErrorSummary
|
|
4
|
+
Source: src/components/stories/feedback/ErrorSummary.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/feedback/ErrorSummary.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { ErrorSummary, ErrorSummaryItem } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Default component
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
ErrorSummary
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
### Default
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
{
|
|
28
|
+
args: {
|
|
29
|
+
title: "2 answers needed",
|
|
30
|
+
children: (<>
|
|
31
|
+
<ErrorSummaryItem onSelect={goToDescription}>
|
|
32
|
+
Describe the company in one sentence: Describe the company
|
|
33
|
+
</ErrorSummaryItem>
|
|
34
|
+
<ErrorSummaryItem onSelect={goToDeadline}>Launch deadline: Enter a deadline</ErrorSummaryItem>
|
|
35
|
+
</>),
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### NestedHeading
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
{
|
|
44
|
+
args: { ...Default.args, headingLevel: 3 }
|
|
45
|
+
}
|
|
46
|
+
```
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# ActionBar
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/layout/ActionBar
|
|
4
|
+
Source: src/components/stories/layout/ActionBar.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/layout/ActionBar.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { ActionBar, ActionBarRow, Button } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Default component
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
ActionBar
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
### AtRest
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
{
|
|
28
|
+
args: { progress: 7 / 11, role: "region", "aria-label": "Hand back Round 1", children: <Rows /> }
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### OneRowWithoutWrapping
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
{
|
|
36
|
+
args: {
|
|
37
|
+
children: (<ActionBarRow justify="between" align="end" wrap={false}>
|
|
38
|
+
<span>7 of 11</span>
|
|
39
|
+
<Button type="button">I’m done</Button>
|
|
40
|
+
</ActionBarRow>),
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### StuckToTheBottom
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
{
|
|
49
|
+
args: { sticky: true, stuck: true, surface: "card", progress: 2, children: <Rows /> },
|
|
50
|
+
decorators: [
|
|
51
|
+
(Story) => (<div data-testid="scroller" className="h-48 overflow-auto bg-card" data-scroll="intentional">
|
|
52
|
+
<div className="h-96">Content above the bar</div>
|
|
53
|
+
<Story />
|
|
54
|
+
</div>),
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### WithoutMeter
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
{
|
|
63
|
+
args: { progress: undefined, children: <Rows /> }
|
|
64
|
+
}
|
|
65
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Outline
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/navigation/Outline
|
|
4
|
+
Source: src/components/stories/navigation/Outline.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/navigation/Outline.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { Outline, OutlineItem, OutlineSection } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Default component
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
Outline
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
### Default
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
{
|
|
28
|
+
args: {
|
|
29
|
+
className: "max-w-72",
|
|
30
|
+
children: (<>
|
|
31
|
+
<OutlineSection title="Basics" meta="2 of 3 answered">
|
|
32
|
+
<OutlineItem label="Company name" state="Answered" onSelect={fn()}/>
|
|
33
|
+
<OutlineItem label="Describe the company in one sentence" state="Not answered" onSelect={fn()}/>
|
|
34
|
+
<OutlineItem label="Primary audience" state="Answered" onSelect={fn()}/>
|
|
35
|
+
</OutlineSection>
|
|
36
|
+
<OutlineSection title="Voice">
|
|
37
|
+
<OutlineItem label="Technical jargon" onSelect={goToJargon}/>
|
|
38
|
+
</OutlineSection>
|
|
39
|
+
</>),
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
package/llms.txt
CHANGED
|
@@ -350,6 +350,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
350
350
|
- [ImageZoomToggle](./llms/components/data-display/ImageZoomToggle.md): Import from `@alexgorbatchev/shadcn/image-viewer`. A two-option toggle for ImageViewer and ImageComparison zoom that consumers place in a header or toolbar. "Fit to screen" and "Original size" are pressed-state toggles with constant names, so assistive technology announces the active zoom through `aria-pressed`. Original size sets zoom `1`; other numeric zooms, such as 150% from the ImageViewer zoom bar, press neither option. `label` names the group (default "Zoom"); `size`, `orientation`, `layout`, `disabled`, and `density` follow ToggleGroup.
|
|
351
351
|
- [Item](./llms/components/data-display/Item.md)
|
|
352
352
|
- [JsonRender](./llms/components/data-display/JsonRender.md)
|
|
353
|
+
- [JsonRenderForm](./llms/components/data-display/JsonRenderForm.md)
|
|
353
354
|
- [JsonViewer](./llms/components/data-display/JsonViewer.md)
|
|
354
355
|
- [Kbd](./llms/components/data-display/Kbd.md)
|
|
355
356
|
- [Meter](./llms/components/data-display/Meter.md)
|
|
@@ -381,6 +382,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
381
382
|
- [Alert](./llms/components/feedback/Alert.md)
|
|
382
383
|
- [Empty](./llms/components/feedback/Empty.md)
|
|
383
384
|
- [EmptyState](./llms/components/feedback/EmptyState.md)
|
|
385
|
+
- [ErrorSummary](./llms/components/feedback/ErrorSummary.md)
|
|
384
386
|
- [PageMessage](./llms/components/feedback/PageMessage.md)
|
|
385
387
|
- [Progress](./llms/components/feedback/Progress.md)
|
|
386
388
|
- [Skeleton](./llms/components/feedback/Skeleton.md)
|
|
@@ -425,6 +427,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
425
427
|
## layout
|
|
426
428
|
|
|
427
429
|
- [Accordion](./llms/components/layout/Accordion.md)
|
|
430
|
+
- [ActionBar](./llms/components/layout/ActionBar.md)
|
|
428
431
|
- [AppShell](./llms/components/layout/AppShell.md)
|
|
429
432
|
- [AspectRatio](./llms/components/layout/AspectRatio.md)
|
|
430
433
|
- [BillingUsage](./llms/components/layout/BillingUsage.md)
|
|
@@ -459,6 +462,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
459
462
|
- [DropdownMenu](./llms/components/navigation/DropdownMenu.md)
|
|
460
463
|
- [Menubar](./llms/components/navigation/Menubar.md)
|
|
461
464
|
- [NavigationMenu](./llms/components/navigation/NavigationMenu.md)
|
|
465
|
+
- [Outline](./llms/components/navigation/Outline.md)
|
|
462
466
|
- [Pagination](./llms/components/navigation/Pagination.md)
|
|
463
467
|
- [Sidebar](./llms/components/navigation/Sidebar.md)
|
|
464
468
|
- [Tabs](./llms/components/navigation/Tabs.md)
|