@alexgorbatchev/shadcn 0.0.20 → 0.0.21
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 +24 -14
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/dist/{chunk-s46hvhjw.js → chunk-0w6rxpr5.js} +1 -1
- package/dist/{chunk-gabqzfq0.js → chunk-1p7pend8.js} +3 -3
- package/dist/chunk-21wbz345.js +65 -0
- package/dist/{chunk-84ca0dpc.js → chunk-67dkgsm3.js} +1 -1
- package/dist/{chunk-p8qtk151.js → chunk-72qr0gqe.js} +1 -1
- package/dist/{chunk-4drqqqz1.js → chunk-83cckb23.js} +1 -1
- package/dist/{chunk-ztcbee24.js → chunk-9dqspkha.js} +1 -1
- package/dist/{chunk-eq88qk1d.js → chunk-d3ad53et.js} +8 -8
- package/dist/{chunk-h979cxnh.js → chunk-dq7kr5y0.js} +2 -1
- package/dist/{chunk-mrrbycgx.js → chunk-e0gcczqk.js} +1 -1
- package/dist/{chunk-553bzh59.js → chunk-f4c0tg2x.js} +1 -1
- package/dist/{chunk-14qj6w54.js → chunk-f9ha76ap.js} +4 -4
- package/dist/{chunk-ykt5sv7n.js → chunk-gkkbg7rq.js} +1 -1
- package/dist/{chunk-qv19jhdk.js → chunk-k8v9y2dw.js} +1 -1
- package/dist/chunk-kbg2e95b.js +434 -0
- package/dist/chunk-r9qrb6b6.js +54 -0
- package/dist/{chunk-ecmk3vgd.js → chunk-seeed8a2.js} +1 -1
- package/dist/{chunk-d9jbqd99.js → chunk-tynbgc30.js} +1 -1
- package/dist/{chunk-1qhf8gh8.js → chunk-wwyzwptb.js} +1 -1
- package/dist/components/AccountMenu.d.ts +12 -0
- package/dist/components/AppShell.d.ts +23 -0
- package/dist/components/AuthForm.d.ts +18 -0
- package/dist/components/BarList.d.ts +16 -0
- package/dist/components/BillingUsage.d.ts +20 -0
- package/dist/components/Combobox.d.ts +2 -1
- package/dist/components/DashboardLayout.d.ts +18 -0
- package/dist/components/FilterBar.d.ts +20 -0
- package/dist/components/Kanban.d.ts +23 -0
- package/dist/components/Meter.d.ts +9 -0
- package/dist/components/NumberField.d.ts +11 -0
- package/dist/components/PageHeader.d.ts +11 -0
- package/dist/components/SettingsSection.d.ts +16 -0
- package/dist/components/Sidebar.d.ts +2 -1
- package/dist/components/StatCard.d.ts +14 -0
- package/dist/components/StatusTracker.d.ts +16 -0
- package/dist/components/Stepper.d.ts +12 -0
- package/dist/components/TagInput.d.ts +16 -0
- package/dist/components/Toolbar.d.ts +10 -0
- package/dist/components/WorkspaceSwitcher.d.ts +14 -0
- package/dist/components/assistant-ui/elements/ApprovalCard.d.ts +1 -1
- package/dist/components/assistant-ui/elements/CommandPalette.js +3 -3
- package/dist/components/assistant-ui/elements/MessageTiming.d.ts +1 -1
- package/dist/components/assistant-ui/elements/ModelSelector.js +9 -9
- package/dist/components/assistant-ui/elements/ModelSelectorContent.js +8 -8
- package/dist/components/assistant-ui/elements/ModelSelectorEmpty.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorGroup.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorItem.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorList.js +5 -5
- package/dist/components/assistant-ui/elements/ModelSelectorSearch.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorSeparator.js +3 -3
- package/dist/components/assistant-ui/elements/types.d.ts +0 -4
- package/dist/components/assistant-ui/index.js +11 -11
- package/dist/components/assistant-ui/native/AssistantModal.js +3 -3
- package/dist/components/assistant-ui/native/AssistantSidebar.js +3 -3
- package/dist/components/assistant-ui/native/ModelSelector.js +11 -11
- package/dist/components/assistant-ui/native/TaskCard.js +2 -2
- package/dist/components/assistant-ui/native/TaskGroup.js +3 -3
- package/dist/components/assistant-ui/native/Thread.js +2 -2
- package/dist/components/assistant-ui/native/ThreadListSidebar.js +2 -2
- package/dist/components/assistant-ui/native/index.js +17 -17
- package/dist/components/calendar/DatePicker.d.ts +27 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +175 -2
- package/dist/components/chart/AnalyticsChart.d.ts +24 -0
- package/dist/components/chart/index.d.ts +2 -0
- package/dist/components/chart/index.js +88 -0
- package/dist/components/color-picker/ColorPicker.d.ts +14 -0
- package/dist/components/color-picker/index.d.ts +2 -0
- package/dist/components/color-picker/index.js +52 -0
- package/dist/components/command/index.js +1 -1
- package/dist/components/data-grid/DataGrid.d.ts +44 -0
- package/dist/components/data-grid/index.d.ts +2 -0
- package/dist/components/data-grid/index.js +228 -0
- package/dist/components/editor/RichTextEditor.d.ts +14 -0
- package/dist/components/editor/index.d.ts +2 -0
- package/dist/components/editor/index.js +108 -0
- package/dist/components/event-calendar/EventCalendar.d.ts +16 -0
- package/dist/components/event-calendar/EventForm.d.ts +18 -0
- package/dist/components/event-calendar/index.d.ts +4 -0
- package/dist/components/event-calendar/index.js +266 -0
- package/dist/components/file-upload/FileUpload.d.ts +14 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/file-upload/index.js +80 -0
- package/dist/components/gantt/Gantt.d.ts +22 -0
- package/dist/components/gantt/Roadmap.d.ts +18 -0
- package/dist/components/gantt/index.d.ts +4 -0
- package/dist/components/gantt/index.js +357 -0
- package/dist/components/image-crop/ImageCrop.d.ts +10 -0
- package/dist/components/image-crop/index.d.ts +2 -0
- package/dist/components/image-crop/index.js +35 -0
- package/dist/components/tree/Tree.d.ts +16 -0
- package/dist/components/tree/index.d.ts +2 -0
- package/dist/components/tree/index.js +57 -0
- package/dist/event-calendar.css +83 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +1411 -708
- package/dist/options/types.d.ts +5 -0
- package/llms/components/actions/Toolbar.md +89 -0
- package/llms/components/data-display/AnalyticsChart.md +48 -0
- package/llms/components/data-display/BarList.md +50 -0
- package/llms/components/data-display/DataGrid.md +51 -0
- package/llms/components/data-display/Meter.md +74 -0
- package/llms/components/data-display/Sparkline.md +50 -0
- package/llms/components/data-display/StatCard.md +65 -0
- package/llms/components/data-display/StatusTracker.md +51 -0
- package/llms/components/dates/DatePicker.md +97 -0
- package/llms/components/forms/AuthForm.md +70 -0
- package/llms/components/forms/ColorPicker.md +70 -0
- package/llms/components/forms/EventForm.md +66 -0
- package/llms/components/forms/FileUpload.md +55 -0
- package/llms/components/forms/FilterBar.md +34 -0
- package/llms/components/forms/ImageCrop.md +88 -0
- package/llms/components/forms/NumberField.md +94 -0
- package/llms/components/forms/Questionnaire.md +12 -0
- package/llms/components/forms/RichTextEditor.md +62 -0
- package/llms/components/forms/SettingsSection.md +65 -0
- package/llms/components/forms/Stepper.md +85 -0
- package/llms/components/forms/TagInput.md +47 -0
- package/llms/components/layout/AppShell.md +63 -0
- package/llms/components/layout/BillingUsage.md +51 -0
- package/llms/components/layout/DashboardLayout.md +78 -0
- package/llms/components/layout/PageHeader.md +49 -0
- package/llms/components/navigation/AccountMenu.md +42 -0
- package/llms/components/navigation/Tree.md +28 -0
- package/llms/components/navigation/WorkspaceSwitcher.md +48 -0
- package/llms/components/planning/EventCalendar.md +67 -0
- package/llms/components/planning/Gantt.md +66 -0
- package/llms/components/planning/Kanban.md +50 -0
- package/llms/components/planning/Roadmap.md +34 -0
- package/llms/setup.md +24 -14
- package/llms.txt +34 -0
- package/package.json +105 -3
- /package/dist/{chunk-8fcjx3he.js → chunk-az81pc04.js} +0 -0
- /package/dist/{chunk-7pyt4e5t.js → chunk-ghmkxqn5.js} +0 -0
- /package/dist/{chunk-5pvyxayg.js → chunk-m9zsppp2.js} +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# ColorPicker
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/forms/ColorPicker
|
|
4
|
+
Source: src/components/stories/forms/ColorPicker.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/ColorPicker.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { ColorPicker } from "@alexgorbatchev/shadcn/color-picker";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Supporting imports
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { useState } from "react";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Default component
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
ColorPicker
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Default args
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
{ label: "Accent", defaultValue: "#ff0000", onValueChange: fn() }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Examples
|
|
33
|
+
|
|
34
|
+
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.
|
|
35
|
+
|
|
36
|
+
### Default
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
{}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Alpha
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
{
|
|
46
|
+
args: { alpha: true, defaultValue: "#ff000000" }
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Controlled
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
{
|
|
54
|
+
render: (args) => {
|
|
55
|
+
const [value, setValue] = useState("#00ff00");
|
|
56
|
+
return (<>
|
|
57
|
+
<ColorPicker {...args} value={value} onValueChange={setValue}/>
|
|
58
|
+
<output aria-label="Selected color">{value}</output>
|
|
59
|
+
</>);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Disabled
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
{
|
|
68
|
+
args: { disabled: true }
|
|
69
|
+
}
|
|
70
|
+
```
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# EventForm
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/forms/EventForm
|
|
4
|
+
Source: src/components/stories/forms/EventForm.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/EventForm.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { EventForm } from "@alexgorbatchev/shadcn/event-calendar";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Default component
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
EventForm
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Default args
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
{ label: "Edit event", initialValue, onSave: fn(), onCancel: fn() }
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
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.
|
|
29
|
+
|
|
30
|
+
### Default
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
{}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### InvalidRange
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
{
|
|
40
|
+
args: { initialValue: { ...initialValue, end: new Date(2026, 9, 22, 9) } }
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### ServerError
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
{
|
|
48
|
+
args: { onSave: fn(() => Promise.reject(new Error("Could not save."))) }
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### UnknownError
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
{
|
|
56
|
+
args: { onSave: fn(() => Promise.reject("offline")), onCancel: undefined }
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Disabled
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
{
|
|
64
|
+
args: { disabled: true }
|
|
65
|
+
}
|
|
66
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# FileUpload
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/forms/FileUpload
|
|
4
|
+
Source: src/components/stories/forms/FileUpload.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/FileUpload.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { FileUpload } from "@alexgorbatchev/shadcn/file-upload";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Default component
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
FileUpload
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Default args
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
{
|
|
24
|
+
label: "Attachments",
|
|
25
|
+
description: "Text files, up to 10 bytes each.",
|
|
26
|
+
accept: { "text/plain": [".txt"] },
|
|
27
|
+
maxSize: 10,
|
|
28
|
+
onDrop: fn(),
|
|
29
|
+
onDropRejected: fn(),
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Examples
|
|
34
|
+
|
|
35
|
+
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.
|
|
36
|
+
|
|
37
|
+
### Default
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
{}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Rejected
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
{}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Disabled
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
{
|
|
53
|
+
args: { disabled: true }
|
|
54
|
+
}
|
|
55
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# FilterBar
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/forms/FilterBar
|
|
4
|
+
Source: src/components/stories/forms/FilterBar.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/FilterBar.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { FilterBar } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Supporting imports
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { useState } from "react";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Default render
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
() => <Example />
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
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.
|
|
29
|
+
|
|
30
|
+
### Default
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
{}
|
|
34
|
+
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# ImageCrop
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/forms/ImageCrop
|
|
4
|
+
Source: src/components/stories/forms/ImageCrop.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/ImageCrop.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { ImageCrop, cropToCanvas, type Crop } from "@alexgorbatchev/shadcn/image-crop";
|
|
12
|
+
import { Button } from "@alexgorbatchev/shadcn";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Supporting imports
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { useState } from "react";
|
|
19
|
+
import "react-image-crop/dist/ReactCrop.css";
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Default component
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
ImageCrop
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Default args
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
{ onChange: fn(), onComplete: fn() }
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Default render
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
(args) => {
|
|
38
|
+
const [crop, setCrop] = useState<Crop>({ unit: "px", x: 20, y: 20, width: 100, height: 100 });
|
|
39
|
+
return (<ImageCrop {...args} crop={crop} onChange={(pixel, percent) => {
|
|
40
|
+
setCrop(pixel);
|
|
41
|
+
args.onChange(pixel, percent);
|
|
42
|
+
}}>
|
|
43
|
+
<img src={image} alt="Image to crop" width={320} height={240}/>
|
|
44
|
+
</ImageCrop>);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Examples
|
|
49
|
+
|
|
50
|
+
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.
|
|
51
|
+
|
|
52
|
+
### Default
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
{}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Export
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
{
|
|
62
|
+
render: () => {
|
|
63
|
+
const [size, setSize] = useState("");
|
|
64
|
+
return (<>
|
|
65
|
+
<img src={image} alt="Source" width={320} height={240}/>
|
|
66
|
+
<Button onClick={async (event) => {
|
|
67
|
+
const source = event.currentTarget.parentElement?.querySelector("img");
|
|
68
|
+
if (!source)
|
|
69
|
+
return;
|
|
70
|
+
const canvas = document.createElement("canvas");
|
|
71
|
+
await cropToCanvas(source, canvas, { unit: "px", x: 20, y: 20, width: 100, height: 80 });
|
|
72
|
+
setSize(`${canvas.width} × ${canvas.height}`);
|
|
73
|
+
}}>
|
|
74
|
+
Export crop
|
|
75
|
+
</Button>
|
|
76
|
+
<output aria-label="Export dimensions">{size}</output>
|
|
77
|
+
</>);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Disabled
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
{
|
|
86
|
+
args: { disabled: true }
|
|
87
|
+
}
|
|
88
|
+
```
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# NumberField
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/forms/NumberField
|
|
4
|
+
Source: src/components/stories/forms/NumberField.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/NumberField.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { NumberField, NumberFieldGroup, NumberFieldInput, NumberFieldIncrement, NumberFieldDecrement, NumberFieldScrubArea, NumberFieldScrubAreaCursor, Field, FieldLabel, Button } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Supporting imports
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { useState, type ReactElement } from "react";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Default component
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
NumberField
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Default args
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
{ defaultValue: 2, min: 0, max: 5, onValueChange: fn() }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Default render
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
(args) => (<Field>
|
|
36
|
+
<FieldLabel htmlFor="quantity">Quantity</FieldLabel>
|
|
37
|
+
<NumberField {...args} id="quantity">
|
|
38
|
+
<NumberFieldGroup>
|
|
39
|
+
<NumberFieldDecrement aria-label="Decrease quantity"/>
|
|
40
|
+
<NumberFieldInput />
|
|
41
|
+
<NumberFieldIncrement aria-label="Increase quantity"/>
|
|
42
|
+
</NumberFieldGroup>
|
|
43
|
+
</NumberField>
|
|
44
|
+
</Field>)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Examples
|
|
48
|
+
|
|
49
|
+
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.
|
|
50
|
+
|
|
51
|
+
### Default
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
{}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Disabled
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
{
|
|
61
|
+
args: { disabled: true }
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Formatted
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
{
|
|
69
|
+
args: { defaultValue: 2.5, max: 100, step: 0.5, format: { style: "currency", currency: "USD" }, locale: "en-US" }
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### DensityAndScrub
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
{
|
|
77
|
+
render: () => <DensityExample />
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### NativeStateCallbacks
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
{
|
|
85
|
+
render: (args) => (<NumberField {...args} className={() => "gap-2"}>
|
|
86
|
+
<NumberFieldScrubArea className={() => "font-medium"}>Quantity</NumberFieldScrubArea>
|
|
87
|
+
<NumberFieldGroup className={() => "border-input"}>
|
|
88
|
+
<NumberFieldDecrement className={() => "font-medium"} aria-label="Decrease"/>
|
|
89
|
+
<NumberFieldInput className={() => "text-center"} aria-label="Quantity" style={(state) => ({ opacity: state.disabled ? 0.5 : 1 })}/>
|
|
90
|
+
<NumberFieldIncrement className={() => "font-medium"} aria-label="Increase"/>
|
|
91
|
+
</NumberFieldGroup>
|
|
92
|
+
</NumberField>)
|
|
93
|
+
}
|
|
94
|
+
```
|
|
@@ -76,6 +76,18 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
76
76
|
}
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
+
### NativeChoiceKeyboard
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
{}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### ItemArrowNavigation
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
{}
|
|
89
|
+
```
|
|
90
|
+
|
|
79
91
|
### SkippedStatus
|
|
80
92
|
|
|
81
93
|
```tsx
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# RichTextEditor
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/forms/RichTextEditor
|
|
4
|
+
Source: src/components/stories/forms/RichTextEditor.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/RichTextEditor.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { RichTextEditor, useEditor, StarterKit } from "@alexgorbatchev/shadcn/editor";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Default component
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
RichTextEditor
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Default args
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
{ label: "Description" }
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Default render
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
(args) => {
|
|
30
|
+
const editor = useEditor({
|
|
31
|
+
extensions: [StarterKit],
|
|
32
|
+
content: "<p>Initial content</p>",
|
|
33
|
+
immediatelyRender: false,
|
|
34
|
+
editorProps: { attributes: { role: "textbox", "aria-label": args.label, "aria-multiline": "true" } },
|
|
35
|
+
});
|
|
36
|
+
return <RichTextEditor {...args} editor={editor}/>;
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Examples
|
|
41
|
+
|
|
42
|
+
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.
|
|
43
|
+
|
|
44
|
+
### Default
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
{}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### ListsAndItalic
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
{}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Loading
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
{
|
|
60
|
+
render: (args) => <RichTextEditor {...args} editor={null}/>
|
|
61
|
+
}
|
|
62
|
+
```
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# SettingsSection
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/forms/SettingsSection
|
|
4
|
+
Source: src/components/stories/forms/SettingsSection.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/SettingsSection.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { SettingsSection, Field, FieldLabel, Input } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Default component
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
SettingsSection
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Default args
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
{
|
|
24
|
+
title: "Profile settings",
|
|
25
|
+
description: "Keep your details up to date.",
|
|
26
|
+
onSubmit: fn((event) => event.preventDefault()),
|
|
27
|
+
footer: "Changes apply to this workspace.",
|
|
28
|
+
children: (<Field>
|
|
29
|
+
<FieldLabel htmlFor="profile-name">Display name</FieldLabel>
|
|
30
|
+
<Input id="profile-name" name="displayName" required defaultValue="Alex"/>
|
|
31
|
+
</Field>),
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
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.
|
|
38
|
+
|
|
39
|
+
### Default
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
{}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Saving
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
{
|
|
49
|
+
args: { pending: true }
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Destructive
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
{
|
|
57
|
+
args: {
|
|
58
|
+
title: "Delete workspace",
|
|
59
|
+
description: undefined,
|
|
60
|
+
destructive: true,
|
|
61
|
+
saveLabel: "Delete workspace",
|
|
62
|
+
children: "This action permanently removes the workspace.",
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Stepper
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/forms/Stepper
|
|
4
|
+
Source: src/components/stories/forms/Stepper.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/Stepper.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { Stepper, StepperList, StepperTrigger, StepperIndicator, StepperContent } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Default component
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
Stepper
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Default args
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
{ defaultValue: "profile", onValueChange: fn() }
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Default render
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
(args) => (<Stepper {...args}>
|
|
30
|
+
<StepperList aria-label="Onboarding steps">
|
|
31
|
+
<StepperTrigger value="profile">
|
|
32
|
+
<StepperIndicator completed>1</StepperIndicator>Profile
|
|
33
|
+
</StepperTrigger>
|
|
34
|
+
<StepperTrigger value="workspace">
|
|
35
|
+
<StepperIndicator>2</StepperIndicator>Workspace
|
|
36
|
+
</StepperTrigger>
|
|
37
|
+
<StepperTrigger value="review" disabled>
|
|
38
|
+
<StepperIndicator>3</StepperIndicator>Review
|
|
39
|
+
</StepperTrigger>
|
|
40
|
+
</StepperList>
|
|
41
|
+
<StepperContent value="profile">Set up your profile.</StepperContent>
|
|
42
|
+
<StepperContent value="workspace">Configure your workspace.</StepperContent>
|
|
43
|
+
</Stepper>)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Examples
|
|
47
|
+
|
|
48
|
+
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.
|
|
49
|
+
|
|
50
|
+
### Default
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
{}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Vertical
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
{
|
|
60
|
+
args: { orientation: "vertical" }
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### NativeStateCallbacks
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
{
|
|
68
|
+
render: (args) => (<Stepper {...args} className={() => "gap-3"}>
|
|
69
|
+
<StepperList className={() => "gap-2"} aria-label="Steps">
|
|
70
|
+
<StepperTrigger className={() => "font-medium"} value="profile">
|
|
71
|
+
<StepperIndicator className="font-medium">1</StepperIndicator>Profile
|
|
72
|
+
</StepperTrigger>
|
|
73
|
+
<StepperTrigger className={() => "font-medium"} value="workspace">
|
|
74
|
+
Workspace
|
|
75
|
+
</StepperTrigger>
|
|
76
|
+
</StepperList>
|
|
77
|
+
<StepperContent className={() => "p-2"} value="profile">
|
|
78
|
+
Profile details
|
|
79
|
+
</StepperContent>
|
|
80
|
+
<StepperContent className={() => "p-2"} value="workspace">
|
|
81
|
+
Workspace details
|
|
82
|
+
</StepperContent>
|
|
83
|
+
</Stepper>)
|
|
84
|
+
}
|
|
85
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# TagInput
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/forms/TagInput
|
|
4
|
+
Source: src/components/stories/forms/TagInput.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/TagInput.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { TagInput } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Default component
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
TagInput
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Default args
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
{
|
|
24
|
+
label: "Project tags",
|
|
25
|
+
options: ["Design", "Engineering", "Research"],
|
|
26
|
+
defaultValue: ["Design"],
|
|
27
|
+
onValueChange: fn(),
|
|
28
|
+
}
|
|
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
|
+
### Default
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
{}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Disabled
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
{
|
|
45
|
+
args: { disabled: true }
|
|
46
|
+
}
|
|
47
|
+
```
|