@sth87/shadcn-design-system 0.2.3 → 0.2.4
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/AI_README.md +131 -131
- package/README.md +547 -547
- package/dist/AI_CONTEXT.md +2506 -2506
- package/dist/cjs/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/cjs/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/cjs/components/DatePicker/RangePicker.cjs +1 -1
- package/dist/cjs/components/DatePicker/TimePicker.cjs +1 -1
- package/dist/cjs/components/Table/TableFilter/data-table-date-filter.cjs +1 -1
- package/dist/cjs/components/Table/TableFilter/data-table-filter-popover.cjs +1 -1
- package/dist/cjs/components/Table/TableFilter/data-table-slider-filter.cjs +1 -1
- package/dist/cjs/components/Table/data-table-pagination.cjs +1 -1
- package/dist/cjs/components/Table/data-table-toolbar.cjs +1 -1
- package/dist/cjs/components/Table/data-table-view-options.cjs +1 -1
- package/dist/cjs/components/Table/data-table.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/node_modules/.pnpm/{@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1 → @dnd-kit_core@6.3.1_react-d_4aa55f773ec51751575225d6fce068db}/node_modules/@dnd-kit/core/dist/core.esm.cjs +1 -1
- package/dist/cjs/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@d_3f5c0d7c14b28ec4620c9987407d5443/node_modules/@dnd-kit/sortable/dist/sortable.esm.cjs +1 -0
- package/dist/cjs/packages/ui/src/components/table.cjs +1 -1
- package/dist/cjs/styles/index.css +1 -1
- package/dist/cjs/utils/data-table.cjs +1 -1
- package/dist/cjs/utils/parsers.cjs +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +6 -6
- package/dist/esm/components/DatePicker/DatePicker.js +13 -13
- package/dist/esm/components/DatePicker/RangePicker.js +14 -14
- package/dist/esm/components/DatePicker/TimePicker.js +30 -30
- package/dist/esm/components/Table/TableFilter/data-table-date-filter.js +2 -2
- package/dist/esm/components/Table/TableFilter/data-table-filter-popover.js +12 -12
- package/dist/esm/components/Table/TableFilter/data-table-slider-filter.js +11 -11
- package/dist/esm/components/Table/data-table-pagination.js +36 -27
- package/dist/esm/components/Table/data-table-toolbar.js +1 -1
- package/dist/esm/components/Table/data-table-view-options.js +5 -5
- package/dist/esm/components/Table/data-table.js +147 -81
- package/dist/esm/index.js +248 -248
- package/dist/esm/node_modules/.pnpm/{@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1 → @dnd-kit_core@6.3.1_react-d_4aa55f773ec51751575225d6fce068db}/node_modules/@dnd-kit/core/dist/core.esm.js +2 -2
- package/dist/esm/node_modules/.pnpm/{@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1 → @dnd-kit_sortable@10.0.0_@d_3f5c0d7c14b28ec4620c9987407d5443}/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +2 -2
- package/dist/esm/packages/ui/src/components/table.js +20 -6
- package/dist/esm/styles/index.css +1 -1
- package/dist/esm/utils/data-table.js +16 -11
- package/dist/esm/utils/parsers.js +1 -1
- package/dist/types/components/Table/data-table-pagination.d.ts +10 -1
- package/dist/types/components/Table/data-table-pagination.d.ts.map +1 -1
- package/dist/types/components/Table/data-table.d.ts +45 -2
- package/dist/types/components/Table/data-table.d.ts.map +1 -1
- package/dist/types/utils/data-table.d.ts.map +1 -1
- package/package.json +321 -321
- package/dist/cjs/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/@dnd-kit/sortable/dist/sortable.esm.cjs +0 -1
- /package/dist/cjs/node_modules/.pnpm/{@dnd-kit_accessibility@3.1.1_react@19.1.1 → @dnd-kit_accessibility@3.1.1_react@19.2.1}/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{@dnd-kit_utilities@3.2.2_react@19.1.1 → @dnd-kit_utilities@3.2.2_react@19.2.1}/node_modules/@dnd-kit/utilities/dist/utilities.esm.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{nuqs@2.8.0_next@15.5.9_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1 → nuqs@2.8.4_next@15.5.23_rea_b8bebf39e603255296dd521522e101e2}/node_modules/nuqs/dist/server.cjs +0 -0
- /package/dist/esm/node_modules/.pnpm/{@dnd-kit_accessibility@3.1.1_react@19.1.1 → @dnd-kit_accessibility@3.1.1_react@19.2.1}/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{@dnd-kit_utilities@3.2.2_react@19.1.1 → @dnd-kit_utilities@3.2.2_react@19.2.1}/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{nuqs@2.8.0_next@15.5.9_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1 → nuqs@2.8.4_next@15.5.23_rea_b8bebf39e603255296dd521522e101e2}/node_modules/nuqs/dist/server.js +0 -0
package/README.md
CHANGED
|
@@ -1,547 +1,547 @@
|
|
|
1
|
-
# shadcn design-system
|
|
2
|
-
|
|
3
|
-
A modern, fully-typed React design system built on top of **shadcn/ui** with enhanced features, TypeScript, TailwindCSS, and Radix UI primitives.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@sth87/shadcn-design-system)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
|
|
8
|
-
## 📚 Documentation
|
|
9
|
-
|
|
10
|
-
- 📖 **[Storybook](https://design-system-sth-kappa.vercel.app)** - Interactive component documentation
|
|
11
|
-
- 📦 **[NPM Package](https://www.npmjs.com/package/@sth87/shadcn-design-system)** - Latest package on npm
|
|
12
|
-
|
|
13
|
-
## 🤖 AI Skills
|
|
14
|
-
|
|
15
|
-
Add this design system skill to your AI Agent so it can automatically recognize components, props, and usage patterns:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npx skills add https://github.com/sonth87/design-system/tree/main/skills/shadcn-design-system --skill shadcn-design-system
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Once added, the AI Agent can:
|
|
22
|
-
- Know exactly how to import and use each component
|
|
23
|
-
- Generate code with correct props, types, and examples
|
|
24
|
-
- Understand design tokens, hooks, and utilities in this design system
|
|
25
|
-
|
|
26
|
-
> See full reference at [docs/SKILL.md](docs/SKILL.md)
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## 📦 Installation
|
|
31
|
-
|
|
32
|
-
SDS bundles all its dependencies for easy installation:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# npm
|
|
36
|
-
npm install @sth87/shadcn-design-system
|
|
37
|
-
|
|
38
|
-
# yarn
|
|
39
|
-
yarn add @sth87/shadcn-design-system
|
|
40
|
-
|
|
41
|
-
# pnpm
|
|
42
|
-
pnpm add @sth87/shadcn-design-system
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
That's it! All other dependencies (motion, date-fns, lucide-react, tailwindcss, etc.) are automatically installed.
|
|
46
|
-
|
|
47
|
-
See [INSTALLATION.md](./INSTALLATION.md) for detailed installation guide.
|
|
48
|
-
|
|
49
|
-
## 🚀 Quick Start
|
|
50
|
-
|
|
51
|
-
### 1. Import CSS
|
|
52
|
-
|
|
53
|
-
Import the design system CSS in your app entry point:
|
|
54
|
-
|
|
55
|
-
```tsx
|
|
56
|
-
// main.tsx or App.tsx
|
|
57
|
-
import "@sth87/shadcn-design-system/theme.css";
|
|
58
|
-
import "@sth87/shadcn-design-system/index.css";
|
|
59
|
-
import "@sth87/shadcn-design-system/animation.css";
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### 2. Use Components
|
|
63
|
-
|
|
64
|
-
```tsx
|
|
65
|
-
import { useState } from "react";
|
|
66
|
-
import Button from "@sth87/shadcn-design-system/button";
|
|
67
|
-
import Dialog from "@sth87/shadcn-design-system/dialog";
|
|
68
|
-
|
|
69
|
-
function App() {
|
|
70
|
-
const [open, setOpen] = useState(false);
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<div>
|
|
74
|
-
<Button variant="default">Click me</Button>
|
|
75
|
-
<Dialog
|
|
76
|
-
open={open}
|
|
77
|
-
onOpenChange={setOpen}
|
|
78
|
-
trigger={<Button>Open Dialog</Button>}
|
|
79
|
-
title="Welcome"
|
|
80
|
-
description="This is an enhanced dialog component"
|
|
81
|
-
footer={
|
|
82
|
-
<div className="flex gap-2 justify-end w-full">
|
|
83
|
-
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
84
|
-
Cancel
|
|
85
|
-
</Button>
|
|
86
|
-
<Button>Confirm</Button>
|
|
87
|
-
</div>
|
|
88
|
-
}
|
|
89
|
-
>
|
|
90
|
-
<p>Dialog content goes here</p>
|
|
91
|
-
</Dialog>
|
|
92
|
-
</div>
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## 📚 Component Import
|
|
98
|
-
|
|
99
|
-
## Recommended Subpath Imports
|
|
100
|
-
|
|
101
|
-
Use subpath imports for all application code. The root package import is still supported for backward compatibility, but it is considered legacy because it can make Vite dev prebundles much heavier.
|
|
102
|
-
|
|
103
|
-
### Quick Examples
|
|
104
|
-
|
|
105
|
-
```tsx
|
|
106
|
-
import Button from "@sth87/shadcn-design-system/button";
|
|
107
|
-
import Dialog from "@sth87/shadcn-design-system/dialog";
|
|
108
|
-
import { DataTable } from "@sth87/shadcn-design-system/table";
|
|
109
|
-
import { Toaster, toast } from "@sth87/shadcn-design-system/toast";
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Component Import Matrix
|
|
113
|
-
|
|
114
|
-
| Subpath | Public exports | Canonical import |
|
|
115
|
-
|---|---|---|
|
|
116
|
-
| `accordion` | Accordion | `import Accordion from "@sth87/shadcn-design-system/accordion";` |
|
|
117
|
-
| `avatar` | Avatar | `import { Avatar } from "@sth87/shadcn-design-system/avatar";` |
|
|
118
|
-
| `badge` | Badge | `import Badge from "@sth87/shadcn-design-system/badge";` |
|
|
119
|
-
| `breadcrumb` | Breadcrumb | `import Breadcrumb from "@sth87/shadcn-design-system/breadcrumb";` |
|
|
120
|
-
| `button` | Button, ButtonGroup | `import Button, { ButtonGroup } from "@sth87/shadcn-design-system/button";` |
|
|
121
|
-
| `calendar` | Calendar, CalendarDayButton | `import { Calendar, CalendarDayButton } from "@sth87/shadcn-design-system/calendar";` |
|
|
122
|
-
| `carousel` | Carousel, CarouselSlide | `import { Carousel, CarouselSlide } from "@sth87/shadcn-design-system/carousel";` |
|
|
123
|
-
| `checkbox` | Checkbox | `import Checkbox from "@sth87/shadcn-design-system/checkbox";` |
|
|
124
|
-
| `collapsible` | Collapsible | `import Collapsible from "@sth87/shadcn-design-system/collapsible";` |
|
|
125
|
-
| `command` | Command | `import { Command } from "@sth87/shadcn-design-system/command";` |
|
|
126
|
-
| `contextmenu` | ContextMenu | `import { ContextMenu } from "@sth87/shadcn-design-system/contextmenu";` |
|
|
127
|
-
| `cropper` | Cropper, CropperTool, useCropper, useCropperTool | `import { Cropper, CropperTool, useCropper } from "@sth87/shadcn-design-system/cropper";` |
|
|
128
|
-
| `datepicker` | DatePicker, RangePicker, TimePicker | `import { DatePicker, RangePicker, TimePicker } from "@sth87/shadcn-design-system/datepicker";` |
|
|
129
|
-
| `dialog` | Dialog | `import Dialog from "@sth87/shadcn-design-system/dialog";` |
|
|
130
|
-
| `dropdownmenu` | DropdownMenu | `import { DropdownMenu } from "@sth87/shadcn-design-system/dropdownmenu";` |
|
|
131
|
-
| `floatlabel` | FloatingLabel | `import { FloatingLabel } from "@sth87/shadcn-design-system/floatlabel";` |
|
|
132
|
-
| `glass` | Glass | `import Glass from "@sth87/shadcn-design-system/glass";` |
|
|
133
|
-
| `imageviewer` | ImageViewer, ImageViewerImage, ImageViewerGroup | `import ImageViewer, { ImageViewerImage, ImageViewerGroup } from "@sth87/shadcn-design-system/imageviewer";` |
|
|
134
|
-
| `input` | Input | `import Input from "@sth87/shadcn-design-system/input";` |
|
|
135
|
-
| `inputotp` | InputOTP | `import InputOTP from "@sth87/shadcn-design-system/inputotp";` |
|
|
136
|
-
| `interactive` | Cursor, CursorFollow, CursorProvider | `import { Cursor, CursorFollow, CursorProvider } from "@sth87/shadcn-design-system/interactive";` |
|
|
137
|
-
| `label` | Label | `import { Label } from "@sth87/shadcn-design-system/label";` |
|
|
138
|
-
| `marquee` | Marquee | `import { Marquee } from "@sth87/shadcn-design-system/marquee";` |
|
|
139
|
-
| `masonry` | Masonry, MasonryComponent, MasonryRoot | `import { Masonry, MasonryComponent, MasonryRoot } from "@sth87/shadcn-design-system/masonry";` |
|
|
140
|
-
| `pagination` | Pagination | `import { Pagination } from "@sth87/shadcn-design-system/pagination";` |
|
|
141
|
-
| `popover` | Popover | `import Popover from "@sth87/shadcn-design-system/popover";` |
|
|
142
|
-
| `qrcode` | QRCode, QrCode, useQRCode | `import { QRCode, QrCode, useQRCode } from "@sth87/shadcn-design-system/qrcode";` |
|
|
143
|
-
| `radio` | Radio | `import Radio from "@sth87/shadcn-design-system/radio";` |
|
|
144
|
-
| `rate` | Rate | `import Rate from "@sth87/shadcn-design-system/rate";` |
|
|
145
|
-
| `resizable` | Resizable, ResizablePanelGroup, ResizablePanel | `import Resizable, { ResizablePanelGroup, ResizablePanel } from "@sth87/shadcn-design-system/resizable";` |
|
|
146
|
-
| `scrollarea` | ScrollArea | `import ScrollArea from "@sth87/shadcn-design-system/scrollarea";` |
|
|
147
|
-
| `select` | Select | `import Select from "@sth87/shadcn-design-system/select";` |
|
|
148
|
-
| `separator` | Separator | `import Separator from "@sth87/shadcn-design-system/separator";` |
|
|
149
|
-
| `sheet` | Sheet | `import Sheet from "@sth87/shadcn-design-system/sheet";` |
|
|
150
|
-
| `sidebar` | Sidebar, SidebarProvider, useSidebar | `import Sidebar, { SidebarProvider, useSidebar } from "@sth87/shadcn-design-system/sidebar";` |
|
|
151
|
-
| `skeleton` | Skeleton | `import Skeleton from "@sth87/shadcn-design-system/skeleton";` |
|
|
152
|
-
| `slider` | Slider | `import Slider from "@sth87/shadcn-design-system/slider";` |
|
|
153
|
-
| `stepper` | Stepper, useStepper | `import { Stepper, useStepper } from "@sth87/shadcn-design-system/stepper";` |
|
|
154
|
-
| `switch` | Switch | `import Switch from "@sth87/shadcn-design-system/switch";` |
|
|
155
|
-
| `table` | DataTable, DataTableColumnHeader, DataTablePagination | `import { DataTable, DataTableColumnHeader, DataTablePagination } from "@sth87/shadcn-design-system/table";` |
|
|
156
|
-
| `tabs` | Tabs | `import Tabs from "@sth87/shadcn-design-system/tabs";` |
|
|
157
|
-
| `textarea` | Textarea | `import Textarea from "@sth87/shadcn-design-system/textarea";` |
|
|
158
|
-
| `timegridview` | TimeGridView | `import { TimeGridView } from "@sth87/shadcn-design-system/timegridview";` |
|
|
159
|
-
| `toast` | Toaster, toast, Toast | `import { Toaster, toast, Toast } from "@sth87/shadcn-design-system/toast";` |
|
|
160
|
-
| `toggle` | Toggle | `import Toggle from "@sth87/shadcn-design-system/toggle";` |
|
|
161
|
-
| `tooltip` | Tooltip | `import { Tooltip } from "@sth87/shadcn-design-system/tooltip";` |
|
|
162
|
-
| `tour` | Tour | `import { Tour } from "@sth87/shadcn-design-system/tour";` |
|
|
163
|
-
| `treeselect` | TreeSelect, TreeView | `import { TreeSelect, TreeView } from "@sth87/shadcn-design-system/treeselect";` |
|
|
164
|
-
| `upload` | Upload | `import { Upload } from "@sth87/shadcn-design-system/upload";` |
|
|
165
|
-
| `wheelcolumn` | WheelColumn | `import { WheelColumn } from "@sth87/shadcn-design-system/wheelcolumn";` |
|
|
166
|
-
|
|
167
|
-
### Text Animation, Hooks, Utilities
|
|
168
|
-
|
|
169
|
-
```tsx
|
|
170
|
-
import { BlurText, RotatingText, CircularText, FlipWords, GradientText, RollingText, ShimmeringText, SplittingText, TextGenerateEffect, TextHoverEffect, TextPressure, TypingText, WritingText } from "@sth87/shadcn-design-system/textanimation";
|
|
171
|
-
import { useDataTable } from "@sth87/shadcn-design-system/use-data-table";
|
|
172
|
-
import { cn } from "@sth87/shadcn-design-system/utils";
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### Legacy Root Import
|
|
176
|
-
|
|
177
|
-
```tsx
|
|
178
|
-
// Legacy only. Prefer subpath imports in new code.
|
|
179
|
-
import { Button, Dialog, DataTable, Toaster } from "@sth87/shadcn-design-system";
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## 🎨 Theme Configuration
|
|
183
|
-
|
|
184
|
-
### CSS Variables
|
|
185
|
-
|
|
186
|
-
The design system uses CSS variables for theming. Customize colors in your global CSS:
|
|
187
|
-
|
|
188
|
-
```css
|
|
189
|
-
:root {
|
|
190
|
-
/* Light mode */
|
|
191
|
-
--background: 0 0% 100%;
|
|
192
|
-
--foreground: 222.2 84% 4.9%;
|
|
193
|
-
--primary: 221.2 83.2% 53.3%;
|
|
194
|
-
--primary-foreground: 210 40% 98%;
|
|
195
|
-
--secondary: 210 40% 96.1%;
|
|
196
|
-
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
197
|
-
--muted: 210 40% 96.1%;
|
|
198
|
-
--muted-foreground: 215.4 16.3% 46.9%;
|
|
199
|
-
--accent: 210 40% 96.1%;
|
|
200
|
-
--accent-foreground: 222.2 47.4% 11.2%;
|
|
201
|
-
--destructive: 0 84.2% 60.2%;
|
|
202
|
-
--destructive-foreground: 210 40% 98%;
|
|
203
|
-
--border: 214.3 31.8% 91.4%;
|
|
204
|
-
--input: 214.3 31.8% 91.4%;
|
|
205
|
-
--ring: 221.2 83.2% 53.3%;
|
|
206
|
-
--radius: 0.5rem;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.dark {
|
|
210
|
-
/* Dark mode */
|
|
211
|
-
--background: 222.2 84% 4.9%;
|
|
212
|
-
--foreground: 210 40% 98%;
|
|
213
|
-
--primary: 217.2 91.2% 59.8%;
|
|
214
|
-
--primary-foreground: 222.2 47.4% 11.2%;
|
|
215
|
-
/* ... other dark mode variables */
|
|
216
|
-
}
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### Dark Mode
|
|
220
|
-
|
|
221
|
-
Toggle dark mode by adding/removing the `dark` class on the root element:
|
|
222
|
-
|
|
223
|
-
```tsx
|
|
224
|
-
// Toggle dark mode
|
|
225
|
-
document.documentElement.classList.toggle("dark");
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
## 🧩 Available Components
|
|
229
|
-
|
|
230
|
-
### Form Components
|
|
231
|
-
|
|
232
|
-
- **Button** - Primary, secondary, outline, ghost, and destructive variants
|
|
233
|
-
- **Input** - Text, password, email with label support
|
|
234
|
-
- **Checkbox** - Accessible checkbox with label
|
|
235
|
-
- **Radio** - Radio button groups
|
|
236
|
-
- **Switch** - Toggle switch component
|
|
237
|
-
- **Select** - Dropdown select with search
|
|
238
|
-
- **Textarea** - Multi-line text input
|
|
239
|
-
- **Slider** - Range slider component
|
|
240
|
-
- **InputOTP** - One-time password input
|
|
241
|
-
|
|
242
|
-
### Data Display
|
|
243
|
-
|
|
244
|
-
- **Avatar** - User profile pictures with fallback
|
|
245
|
-
- **Badge** - Status badges and labels
|
|
246
|
-
- **Calendar** - Date calendar picker
|
|
247
|
-
- **DatePicker** - Date selection with range support
|
|
248
|
-
- **Toast** - Notification toasts
|
|
249
|
-
- **Tooltip** - Hover tooltips
|
|
250
|
-
- **Skeleton** - Loading skeletons
|
|
251
|
-
|
|
252
|
-
### Layout & Navigation
|
|
253
|
-
|
|
254
|
-
- **Dialog** - Modal dialogs
|
|
255
|
-
- **Sheet** - Side sheet/drawer
|
|
256
|
-
- **Tabs** - Tab navigation
|
|
257
|
-
- **Sidebar** - Navigation sidebar
|
|
258
|
-
- **Breadcrumb** - Breadcrumb navigation
|
|
259
|
-
- **Separator** - Visual dividers
|
|
260
|
-
- **ScrollArea** - Custom scrollbars
|
|
261
|
-
- **Collapsible** - Expandable sections
|
|
262
|
-
|
|
263
|
-
### Overlay
|
|
264
|
-
|
|
265
|
-
- **Popover** - Floating popovers
|
|
266
|
-
- **Glass** - Glassmorphism effect component
|
|
267
|
-
|
|
268
|
-
### Utility
|
|
269
|
-
|
|
270
|
-
- **Theme** - Theme utilities and showcase
|
|
271
|
-
- **FloatLabel** - Floating label for inputs
|
|
272
|
-
|
|
273
|
-
## 🎯 Usage Examples
|
|
274
|
-
|
|
275
|
-
### Button Component
|
|
276
|
-
|
|
277
|
-
```tsx
|
|
278
|
-
import Button from "@sth87/shadcn-design-system/button";
|
|
279
|
-
|
|
280
|
-
<Button variant="default" size="md">
|
|
281
|
-
Default Button
|
|
282
|
-
</Button>
|
|
283
|
-
|
|
284
|
-
<Button variant="outline" size="lg">
|
|
285
|
-
Outline Button
|
|
286
|
-
</Button>
|
|
287
|
-
|
|
288
|
-
<Button variant="solid" color="destructive">
|
|
289
|
-
Destructive Button
|
|
290
|
-
</Button>
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### Dialog Component
|
|
294
|
-
|
|
295
|
-
The Dialog component is enhanced with additional features beyond shadcn/ui:
|
|
296
|
-
|
|
297
|
-
```tsx
|
|
298
|
-
import Dialog from "@sth87/shadcn-design-system/dialog";
|
|
299
|
-
import Button from "@sth87/shadcn-design-system/button";
|
|
300
|
-
import { useState } from "react";
|
|
301
|
-
|
|
302
|
-
function MyComponent() {
|
|
303
|
-
const [open, setOpen] = useState(false);
|
|
304
|
-
|
|
305
|
-
return (
|
|
306
|
-
// Simple dialog with trigger
|
|
307
|
-
<Dialog
|
|
308
|
-
open={open}
|
|
309
|
-
onOpenChange={setOpen}
|
|
310
|
-
trigger={<Button>Open Dialog</Button>}
|
|
311
|
-
title="Dialog Title"
|
|
312
|
-
description="Dialog description"
|
|
313
|
-
footer={
|
|
314
|
-
<div className="flex gap-2 justify-end w-full">
|
|
315
|
-
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
316
|
-
Cancel
|
|
317
|
-
</Button>
|
|
318
|
-
<Button onClick={() => setOpen(false)}>Save Changes</Button>
|
|
319
|
-
</div>
|
|
320
|
-
}
|
|
321
|
-
>
|
|
322
|
-
<p className="text-sm text-muted-foreground">Dialog content goes here</p>
|
|
323
|
-
</Dialog>
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
**Enhanced Dialog Features:**
|
|
329
|
-
|
|
330
|
-
- **Variants**: `dialog`, `confirm`, `alert`, `info`, `warning`
|
|
331
|
-
- **Sizes**: `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`, `4xl`, `full`
|
|
332
|
-
- **Positions**: `center`, `top`, `bottom`, `left`, `right`, `top-left`, `top-right`, `bottom-left`, `bottom-right`
|
|
333
|
-
- **Animations**: `bounce`, `slide-up`, `slide-down`, `slide-left`, `slide-right`, `zoom-in`, `zoom-out`, `flip`, `glow`, `spec`
|
|
334
|
-
- **Scroll Options**: `stickyHeader`, `stickyFooter`, `scrollable`
|
|
335
|
-
|
|
336
|
-
```tsx
|
|
337
|
-
// Confirm dialog variant
|
|
338
|
-
<Dialog
|
|
339
|
-
variant="confirm"
|
|
340
|
-
trigger={<Button>Confirm Action</Button>}
|
|
341
|
-
title="Confirm Action"
|
|
342
|
-
description="Are you sure you want to proceed?"
|
|
343
|
-
onConfirm={() => console.log("Confirmed")}
|
|
344
|
-
onCancel={() => console.log("Cancelled")}
|
|
345
|
-
/>
|
|
346
|
-
|
|
347
|
-
// Alert dialog variant
|
|
348
|
-
<Dialog
|
|
349
|
-
variant="alert"
|
|
350
|
-
trigger={<Button>Show Alert</Button>}
|
|
351
|
-
title="Warning"
|
|
352
|
-
description="This action cannot be undone"
|
|
353
|
-
onConfirm={() => console.log("Acknowledged")}
|
|
354
|
-
confirmText="I Understand"
|
|
355
|
-
/>
|
|
356
|
-
|
|
357
|
-
// Dialog with custom position and animation
|
|
358
|
-
<Dialog
|
|
359
|
-
position="right"
|
|
360
|
-
animation="slide-left"
|
|
361
|
-
size="lg"
|
|
362
|
-
trigger={<Button>Side Panel</Button>}
|
|
363
|
-
title="Settings"
|
|
364
|
-
>
|
|
365
|
-
<div className="space-y-4">
|
|
366
|
-
{/* Settings content */}
|
|
367
|
-
</div>
|
|
368
|
-
</Dialog>
|
|
369
|
-
|
|
370
|
-
// Scrollable dialog with sticky header/footer
|
|
371
|
-
<Dialog
|
|
372
|
-
stickyHeader
|
|
373
|
-
stickyFooter
|
|
374
|
-
trigger={<Button>Long Content</Button>}
|
|
375
|
-
title="Scrollable Dialog"
|
|
376
|
-
footer={
|
|
377
|
-
<div className="flex gap-2 justify-end w-full">
|
|
378
|
-
<Button variant="outline">Cancel</Button>
|
|
379
|
-
<Button>Save</Button>
|
|
380
|
-
</div>
|
|
381
|
-
}
|
|
382
|
-
>
|
|
383
|
-
<div className="space-y-4">
|
|
384
|
-
{Array.from({ length: 20 }).map((_, i) => (
|
|
385
|
-
<div key={i} className="p-4 border rounded">
|
|
386
|
-
Section {i + 1}
|
|
387
|
-
</div>
|
|
388
|
-
))}
|
|
389
|
-
</div>
|
|
390
|
-
</Dialog>
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
**Standalone Usage (without trigger prop):**
|
|
394
|
-
|
|
395
|
-
```tsx
|
|
396
|
-
function MyComponent() {
|
|
397
|
-
const [open, setOpen] = useState(false);
|
|
398
|
-
|
|
399
|
-
return (
|
|
400
|
-
<>
|
|
401
|
-
<Button onClick={() => setOpen(true)}>Open</Button>
|
|
402
|
-
|
|
403
|
-
<Dialog
|
|
404
|
-
open={open}
|
|
405
|
-
onOpenChange={setOpen}
|
|
406
|
-
title="Standalone Dialog"
|
|
407
|
-
description="Dialog without trigger prop"
|
|
408
|
-
>
|
|
409
|
-
<p>Content here</p>
|
|
410
|
-
</Dialog>
|
|
411
|
-
</>
|
|
412
|
-
);
|
|
413
|
-
}
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
### DatePicker Component
|
|
417
|
-
|
|
418
|
-
Enhanced DatePicker with range and time selection:
|
|
419
|
-
|
|
420
|
-
```tsx
|
|
421
|
-
import { DatePicker } from "@sth87/shadcn-design-system/datepicker";
|
|
422
|
-
import { useState } from "react";
|
|
423
|
-
|
|
424
|
-
function MyComponent() {
|
|
425
|
-
const [date, setDate] = useState<Date>();
|
|
426
|
-
|
|
427
|
-
return (
|
|
428
|
-
<DatePicker selected={date} onSelect={setDate} placeholder="Pick a date" />
|
|
429
|
-
);
|
|
430
|
-
}
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
### Toast Notifications
|
|
434
|
-
|
|
435
|
-
```tsx
|
|
436
|
-
import { toast, Toaster } from "@sth87/shadcn-design-system/toast";
|
|
437
|
-
|
|
438
|
-
function App() {
|
|
439
|
-
return (
|
|
440
|
-
<>
|
|
441
|
-
<Button onClick={() => toast.success("Success message!")}>
|
|
442
|
-
Show Toast
|
|
443
|
-
</Button>
|
|
444
|
-
<Button onClick={() => toast.error("Error message!")}>Show Error</Button>
|
|
445
|
-
<Button onClick={() => toast.info("Info message!")}>Show Info</Button>
|
|
446
|
-
<Toaster />
|
|
447
|
-
</>
|
|
448
|
-
);
|
|
449
|
-
}
|
|
450
|
-
```
|
|
451
|
-
|
|
452
|
-
## 🎨 Styling & Customization
|
|
453
|
-
|
|
454
|
-
### Using CSS Variables
|
|
455
|
-
|
|
456
|
-
```tsx
|
|
457
|
-
// Override specific component styles
|
|
458
|
-
<Button
|
|
459
|
-
style={
|
|
460
|
-
{
|
|
461
|
-
"--primary": "200 100% 50%",
|
|
462
|
-
"--primary-foreground": "0 0% 100%",
|
|
463
|
-
} as React.CSSProperties
|
|
464
|
-
}
|
|
465
|
-
>
|
|
466
|
-
Custom Styled Button
|
|
467
|
-
</Button>
|
|
468
|
-
```
|
|
469
|
-
|
|
470
|
-
### Class Names
|
|
471
|
-
|
|
472
|
-
All components accept `className` prop for custom styling:
|
|
473
|
-
|
|
474
|
-
```tsx
|
|
475
|
-
<Button className="custom-button-class">
|
|
476
|
-
Styled Button
|
|
477
|
-
</Button>
|
|
478
|
-
|
|
479
|
-
<Dialog
|
|
480
|
-
className="custom-dialog-class"
|
|
481
|
-
headerClassName="custom-header"
|
|
482
|
-
contentClassName="custom-content"
|
|
483
|
-
footerClassName="custom-footer"
|
|
484
|
-
trigger={<Button>Custom Styled Dialog</Button>}
|
|
485
|
-
title="Custom Dialog"
|
|
486
|
-
>
|
|
487
|
-
<p>Content with custom styling</p>
|
|
488
|
-
</Dialog>
|
|
489
|
-
```
|
|
490
|
-
|
|
491
|
-
### Variants with CVA
|
|
492
|
-
|
|
493
|
-
Components use `class-variance-authority` for variant management:
|
|
494
|
-
|
|
495
|
-
```tsx
|
|
496
|
-
<Button variant="outline" size="lg" className="w-full">
|
|
497
|
-
Full Width Button
|
|
498
|
-
</Button>
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
## 🔧 Development
|
|
502
|
-
|
|
503
|
-
```bash
|
|
504
|
-
# Install dependencies
|
|
505
|
-
pnpm install
|
|
506
|
-
|
|
507
|
-
# Start Storybook
|
|
508
|
-
pnpm dev
|
|
509
|
-
|
|
510
|
-
# Build library
|
|
511
|
-
pnpm build
|
|
512
|
-
|
|
513
|
-
# Run linting
|
|
514
|
-
pnpm lint
|
|
515
|
-
```
|
|
516
|
-
|
|
517
|
-
## 📖 Documentation
|
|
518
|
-
|
|
519
|
-
For detailed documentation and interactive examples, visit our [Storybook](https://design-system-sth-kappa.vercel.app/).
|
|
520
|
-
|
|
521
|
-
## 🤝 Contributing
|
|
522
|
-
|
|
523
|
-
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
524
|
-
|
|
525
|
-
## 📄 License
|
|
526
|
-
|
|
527
|
-
MIT © Skyline
|
|
528
|
-
|
|
529
|
-
## 🙏 Credits
|
|
530
|
-
|
|
531
|
-
This design system is built on top of [shadcn/ui](https://ui.shadcn.com/), enhancing it with:
|
|
532
|
-
|
|
533
|
-
- Additional component variants and sizes
|
|
534
|
-
- Enhanced animation support with Motion
|
|
535
|
-
- Extended theming capabilities
|
|
536
|
-
- Custom components like DatePicker with range/time support
|
|
537
|
-
- Improved Dialog with positions, animations, and scroll options
|
|
538
|
-
|
|
539
|
-
Built with:
|
|
540
|
-
|
|
541
|
-
- [shadcn/ui](https://ui.shadcn.com/) - Base component library
|
|
542
|
-
- [Radix UI](https://www.radix-ui.com/) - Unstyled, accessible primitives
|
|
543
|
-
- [TailwindCSS](https://tailwindcss.com/) - Utility-first CSS framework
|
|
544
|
-
- [Motion](https://motion.dev/) - Animation library
|
|
545
|
-
- [date-fns](https://date-fns.org/) - Date utility library
|
|
546
|
-
- [Lucide React](https://lucide.dev/) - Beautiful icon set
|
|
547
|
-
- [React Day Picker](https://react-day-picker.js.org/) - Date picker component
|
|
1
|
+
# shadcn design-system
|
|
2
|
+
|
|
3
|
+
A modern, fully-typed React design system built on top of **shadcn/ui** with enhanced features, TypeScript, TailwindCSS, and Radix UI primitives.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@sth87/shadcn-design-system)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## 📚 Documentation
|
|
9
|
+
|
|
10
|
+
- 📖 **[Storybook](https://design-system-sth-kappa.vercel.app)** - Interactive component documentation
|
|
11
|
+
- 📦 **[NPM Package](https://www.npmjs.com/package/@sth87/shadcn-design-system)** - Latest package on npm
|
|
12
|
+
|
|
13
|
+
## 🤖 AI Skills
|
|
14
|
+
|
|
15
|
+
Add this design system skill to your AI Agent so it can automatically recognize components, props, and usage patterns:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx skills add https://github.com/sonth87/design-system/tree/main/skills/shadcn-design-system --skill shadcn-design-system
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Once added, the AI Agent can:
|
|
22
|
+
- Know exactly how to import and use each component
|
|
23
|
+
- Generate code with correct props, types, and examples
|
|
24
|
+
- Understand design tokens, hooks, and utilities in this design system
|
|
25
|
+
|
|
26
|
+
> See full reference at [docs/SKILL.md](docs/SKILL.md)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 📦 Installation
|
|
31
|
+
|
|
32
|
+
SDS bundles all its dependencies for easy installation:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# npm
|
|
36
|
+
npm install @sth87/shadcn-design-system
|
|
37
|
+
|
|
38
|
+
# yarn
|
|
39
|
+
yarn add @sth87/shadcn-design-system
|
|
40
|
+
|
|
41
|
+
# pnpm
|
|
42
|
+
pnpm add @sth87/shadcn-design-system
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
That's it! All other dependencies (motion, date-fns, lucide-react, tailwindcss, etc.) are automatically installed.
|
|
46
|
+
|
|
47
|
+
See [INSTALLATION.md](./INSTALLATION.md) for detailed installation guide.
|
|
48
|
+
|
|
49
|
+
## 🚀 Quick Start
|
|
50
|
+
|
|
51
|
+
### 1. Import CSS
|
|
52
|
+
|
|
53
|
+
Import the design system CSS in your app entry point:
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
// main.tsx or App.tsx
|
|
57
|
+
import "@sth87/shadcn-design-system/theme.css";
|
|
58
|
+
import "@sth87/shadcn-design-system/index.css";
|
|
59
|
+
import "@sth87/shadcn-design-system/animation.css";
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 2. Use Components
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { useState } from "react";
|
|
66
|
+
import Button from "@sth87/shadcn-design-system/button";
|
|
67
|
+
import Dialog from "@sth87/shadcn-design-system/dialog";
|
|
68
|
+
|
|
69
|
+
function App() {
|
|
70
|
+
const [open, setOpen] = useState(false);
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<div>
|
|
74
|
+
<Button variant="default">Click me</Button>
|
|
75
|
+
<Dialog
|
|
76
|
+
open={open}
|
|
77
|
+
onOpenChange={setOpen}
|
|
78
|
+
trigger={<Button>Open Dialog</Button>}
|
|
79
|
+
title="Welcome"
|
|
80
|
+
description="This is an enhanced dialog component"
|
|
81
|
+
footer={
|
|
82
|
+
<div className="flex gap-2 justify-end w-full">
|
|
83
|
+
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
84
|
+
Cancel
|
|
85
|
+
</Button>
|
|
86
|
+
<Button>Confirm</Button>
|
|
87
|
+
</div>
|
|
88
|
+
}
|
|
89
|
+
>
|
|
90
|
+
<p>Dialog content goes here</p>
|
|
91
|
+
</Dialog>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## 📚 Component Import
|
|
98
|
+
|
|
99
|
+
## Recommended Subpath Imports
|
|
100
|
+
|
|
101
|
+
Use subpath imports for all application code. The root package import is still supported for backward compatibility, but it is considered legacy because it can make Vite dev prebundles much heavier.
|
|
102
|
+
|
|
103
|
+
### Quick Examples
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
import Button from "@sth87/shadcn-design-system/button";
|
|
107
|
+
import Dialog from "@sth87/shadcn-design-system/dialog";
|
|
108
|
+
import { DataTable } from "@sth87/shadcn-design-system/table";
|
|
109
|
+
import { Toaster, toast } from "@sth87/shadcn-design-system/toast";
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Component Import Matrix
|
|
113
|
+
|
|
114
|
+
| Subpath | Public exports | Canonical import |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| `accordion` | Accordion | `import Accordion from "@sth87/shadcn-design-system/accordion";` |
|
|
117
|
+
| `avatar` | Avatar | `import { Avatar } from "@sth87/shadcn-design-system/avatar";` |
|
|
118
|
+
| `badge` | Badge | `import Badge from "@sth87/shadcn-design-system/badge";` |
|
|
119
|
+
| `breadcrumb` | Breadcrumb | `import Breadcrumb from "@sth87/shadcn-design-system/breadcrumb";` |
|
|
120
|
+
| `button` | Button, ButtonGroup | `import Button, { ButtonGroup } from "@sth87/shadcn-design-system/button";` |
|
|
121
|
+
| `calendar` | Calendar, CalendarDayButton | `import { Calendar, CalendarDayButton } from "@sth87/shadcn-design-system/calendar";` |
|
|
122
|
+
| `carousel` | Carousel, CarouselSlide | `import { Carousel, CarouselSlide } from "@sth87/shadcn-design-system/carousel";` |
|
|
123
|
+
| `checkbox` | Checkbox | `import Checkbox from "@sth87/shadcn-design-system/checkbox";` |
|
|
124
|
+
| `collapsible` | Collapsible | `import Collapsible from "@sth87/shadcn-design-system/collapsible";` |
|
|
125
|
+
| `command` | Command | `import { Command } from "@sth87/shadcn-design-system/command";` |
|
|
126
|
+
| `contextmenu` | ContextMenu | `import { ContextMenu } from "@sth87/shadcn-design-system/contextmenu";` |
|
|
127
|
+
| `cropper` | Cropper, CropperTool, useCropper, useCropperTool | `import { Cropper, CropperTool, useCropper } from "@sth87/shadcn-design-system/cropper";` |
|
|
128
|
+
| `datepicker` | DatePicker, RangePicker, TimePicker | `import { DatePicker, RangePicker, TimePicker } from "@sth87/shadcn-design-system/datepicker";` |
|
|
129
|
+
| `dialog` | Dialog | `import Dialog from "@sth87/shadcn-design-system/dialog";` |
|
|
130
|
+
| `dropdownmenu` | DropdownMenu | `import { DropdownMenu } from "@sth87/shadcn-design-system/dropdownmenu";` |
|
|
131
|
+
| `floatlabel` | FloatingLabel | `import { FloatingLabel } from "@sth87/shadcn-design-system/floatlabel";` |
|
|
132
|
+
| `glass` | Glass | `import Glass from "@sth87/shadcn-design-system/glass";` |
|
|
133
|
+
| `imageviewer` | ImageViewer, ImageViewerImage, ImageViewerGroup | `import ImageViewer, { ImageViewerImage, ImageViewerGroup } from "@sth87/shadcn-design-system/imageviewer";` |
|
|
134
|
+
| `input` | Input | `import Input from "@sth87/shadcn-design-system/input";` |
|
|
135
|
+
| `inputotp` | InputOTP | `import InputOTP from "@sth87/shadcn-design-system/inputotp";` |
|
|
136
|
+
| `interactive` | Cursor, CursorFollow, CursorProvider | `import { Cursor, CursorFollow, CursorProvider } from "@sth87/shadcn-design-system/interactive";` |
|
|
137
|
+
| `label` | Label | `import { Label } from "@sth87/shadcn-design-system/label";` |
|
|
138
|
+
| `marquee` | Marquee | `import { Marquee } from "@sth87/shadcn-design-system/marquee";` |
|
|
139
|
+
| `masonry` | Masonry, MasonryComponent, MasonryRoot | `import { Masonry, MasonryComponent, MasonryRoot } from "@sth87/shadcn-design-system/masonry";` |
|
|
140
|
+
| `pagination` | Pagination | `import { Pagination } from "@sth87/shadcn-design-system/pagination";` |
|
|
141
|
+
| `popover` | Popover | `import Popover from "@sth87/shadcn-design-system/popover";` |
|
|
142
|
+
| `qrcode` | QRCode, QrCode, useQRCode | `import { QRCode, QrCode, useQRCode } from "@sth87/shadcn-design-system/qrcode";` |
|
|
143
|
+
| `radio` | Radio | `import Radio from "@sth87/shadcn-design-system/radio";` |
|
|
144
|
+
| `rate` | Rate | `import Rate from "@sth87/shadcn-design-system/rate";` |
|
|
145
|
+
| `resizable` | Resizable, ResizablePanelGroup, ResizablePanel | `import Resizable, { ResizablePanelGroup, ResizablePanel } from "@sth87/shadcn-design-system/resizable";` |
|
|
146
|
+
| `scrollarea` | ScrollArea | `import ScrollArea from "@sth87/shadcn-design-system/scrollarea";` |
|
|
147
|
+
| `select` | Select | `import Select from "@sth87/shadcn-design-system/select";` |
|
|
148
|
+
| `separator` | Separator | `import Separator from "@sth87/shadcn-design-system/separator";` |
|
|
149
|
+
| `sheet` | Sheet | `import Sheet from "@sth87/shadcn-design-system/sheet";` |
|
|
150
|
+
| `sidebar` | Sidebar, SidebarProvider, useSidebar | `import Sidebar, { SidebarProvider, useSidebar } from "@sth87/shadcn-design-system/sidebar";` |
|
|
151
|
+
| `skeleton` | Skeleton | `import Skeleton from "@sth87/shadcn-design-system/skeleton";` |
|
|
152
|
+
| `slider` | Slider | `import Slider from "@sth87/shadcn-design-system/slider";` |
|
|
153
|
+
| `stepper` | Stepper, useStepper | `import { Stepper, useStepper } from "@sth87/shadcn-design-system/stepper";` |
|
|
154
|
+
| `switch` | Switch | `import Switch from "@sth87/shadcn-design-system/switch";` |
|
|
155
|
+
| `table` | DataTable, DataTableColumnHeader, DataTablePagination | `import { DataTable, DataTableColumnHeader, DataTablePagination } from "@sth87/shadcn-design-system/table";` |
|
|
156
|
+
| `tabs` | Tabs | `import Tabs from "@sth87/shadcn-design-system/tabs";` |
|
|
157
|
+
| `textarea` | Textarea | `import Textarea from "@sth87/shadcn-design-system/textarea";` |
|
|
158
|
+
| `timegridview` | TimeGridView | `import { TimeGridView } from "@sth87/shadcn-design-system/timegridview";` |
|
|
159
|
+
| `toast` | Toaster, toast, Toast | `import { Toaster, toast, Toast } from "@sth87/shadcn-design-system/toast";` |
|
|
160
|
+
| `toggle` | Toggle | `import Toggle from "@sth87/shadcn-design-system/toggle";` |
|
|
161
|
+
| `tooltip` | Tooltip | `import { Tooltip } from "@sth87/shadcn-design-system/tooltip";` |
|
|
162
|
+
| `tour` | Tour | `import { Tour } from "@sth87/shadcn-design-system/tour";` |
|
|
163
|
+
| `treeselect` | TreeSelect, TreeView | `import { TreeSelect, TreeView } from "@sth87/shadcn-design-system/treeselect";` |
|
|
164
|
+
| `upload` | Upload | `import { Upload } from "@sth87/shadcn-design-system/upload";` |
|
|
165
|
+
| `wheelcolumn` | WheelColumn | `import { WheelColumn } from "@sth87/shadcn-design-system/wheelcolumn";` |
|
|
166
|
+
|
|
167
|
+
### Text Animation, Hooks, Utilities
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
import { BlurText, RotatingText, CircularText, FlipWords, GradientText, RollingText, ShimmeringText, SplittingText, TextGenerateEffect, TextHoverEffect, TextPressure, TypingText, WritingText } from "@sth87/shadcn-design-system/textanimation";
|
|
171
|
+
import { useDataTable } from "@sth87/shadcn-design-system/use-data-table";
|
|
172
|
+
import { cn } from "@sth87/shadcn-design-system/utils";
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Legacy Root Import
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
// Legacy only. Prefer subpath imports in new code.
|
|
179
|
+
import { Button, Dialog, DataTable, Toaster } from "@sth87/shadcn-design-system";
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## 🎨 Theme Configuration
|
|
183
|
+
|
|
184
|
+
### CSS Variables
|
|
185
|
+
|
|
186
|
+
The design system uses CSS variables for theming. Customize colors in your global CSS:
|
|
187
|
+
|
|
188
|
+
```css
|
|
189
|
+
:root {
|
|
190
|
+
/* Light mode */
|
|
191
|
+
--background: 0 0% 100%;
|
|
192
|
+
--foreground: 222.2 84% 4.9%;
|
|
193
|
+
--primary: 221.2 83.2% 53.3%;
|
|
194
|
+
--primary-foreground: 210 40% 98%;
|
|
195
|
+
--secondary: 210 40% 96.1%;
|
|
196
|
+
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
197
|
+
--muted: 210 40% 96.1%;
|
|
198
|
+
--muted-foreground: 215.4 16.3% 46.9%;
|
|
199
|
+
--accent: 210 40% 96.1%;
|
|
200
|
+
--accent-foreground: 222.2 47.4% 11.2%;
|
|
201
|
+
--destructive: 0 84.2% 60.2%;
|
|
202
|
+
--destructive-foreground: 210 40% 98%;
|
|
203
|
+
--border: 214.3 31.8% 91.4%;
|
|
204
|
+
--input: 214.3 31.8% 91.4%;
|
|
205
|
+
--ring: 221.2 83.2% 53.3%;
|
|
206
|
+
--radius: 0.5rem;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.dark {
|
|
210
|
+
/* Dark mode */
|
|
211
|
+
--background: 222.2 84% 4.9%;
|
|
212
|
+
--foreground: 210 40% 98%;
|
|
213
|
+
--primary: 217.2 91.2% 59.8%;
|
|
214
|
+
--primary-foreground: 222.2 47.4% 11.2%;
|
|
215
|
+
/* ... other dark mode variables */
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Dark Mode
|
|
220
|
+
|
|
221
|
+
Toggle dark mode by adding/removing the `dark` class on the root element:
|
|
222
|
+
|
|
223
|
+
```tsx
|
|
224
|
+
// Toggle dark mode
|
|
225
|
+
document.documentElement.classList.toggle("dark");
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## 🧩 Available Components
|
|
229
|
+
|
|
230
|
+
### Form Components
|
|
231
|
+
|
|
232
|
+
- **Button** - Primary, secondary, outline, ghost, and destructive variants
|
|
233
|
+
- **Input** - Text, password, email with label support
|
|
234
|
+
- **Checkbox** - Accessible checkbox with label
|
|
235
|
+
- **Radio** - Radio button groups
|
|
236
|
+
- **Switch** - Toggle switch component
|
|
237
|
+
- **Select** - Dropdown select with search
|
|
238
|
+
- **Textarea** - Multi-line text input
|
|
239
|
+
- **Slider** - Range slider component
|
|
240
|
+
- **InputOTP** - One-time password input
|
|
241
|
+
|
|
242
|
+
### Data Display
|
|
243
|
+
|
|
244
|
+
- **Avatar** - User profile pictures with fallback
|
|
245
|
+
- **Badge** - Status badges and labels
|
|
246
|
+
- **Calendar** - Date calendar picker
|
|
247
|
+
- **DatePicker** - Date selection with range support
|
|
248
|
+
- **Toast** - Notification toasts
|
|
249
|
+
- **Tooltip** - Hover tooltips
|
|
250
|
+
- **Skeleton** - Loading skeletons
|
|
251
|
+
|
|
252
|
+
### Layout & Navigation
|
|
253
|
+
|
|
254
|
+
- **Dialog** - Modal dialogs
|
|
255
|
+
- **Sheet** - Side sheet/drawer
|
|
256
|
+
- **Tabs** - Tab navigation
|
|
257
|
+
- **Sidebar** - Navigation sidebar
|
|
258
|
+
- **Breadcrumb** - Breadcrumb navigation
|
|
259
|
+
- **Separator** - Visual dividers
|
|
260
|
+
- **ScrollArea** - Custom scrollbars
|
|
261
|
+
- **Collapsible** - Expandable sections
|
|
262
|
+
|
|
263
|
+
### Overlay
|
|
264
|
+
|
|
265
|
+
- **Popover** - Floating popovers
|
|
266
|
+
- **Glass** - Glassmorphism effect component
|
|
267
|
+
|
|
268
|
+
### Utility
|
|
269
|
+
|
|
270
|
+
- **Theme** - Theme utilities and showcase
|
|
271
|
+
- **FloatLabel** - Floating label for inputs
|
|
272
|
+
|
|
273
|
+
## 🎯 Usage Examples
|
|
274
|
+
|
|
275
|
+
### Button Component
|
|
276
|
+
|
|
277
|
+
```tsx
|
|
278
|
+
import Button from "@sth87/shadcn-design-system/button";
|
|
279
|
+
|
|
280
|
+
<Button variant="default" size="md">
|
|
281
|
+
Default Button
|
|
282
|
+
</Button>
|
|
283
|
+
|
|
284
|
+
<Button variant="outline" size="lg">
|
|
285
|
+
Outline Button
|
|
286
|
+
</Button>
|
|
287
|
+
|
|
288
|
+
<Button variant="solid" color="destructive">
|
|
289
|
+
Destructive Button
|
|
290
|
+
</Button>
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Dialog Component
|
|
294
|
+
|
|
295
|
+
The Dialog component is enhanced with additional features beyond shadcn/ui:
|
|
296
|
+
|
|
297
|
+
```tsx
|
|
298
|
+
import Dialog from "@sth87/shadcn-design-system/dialog";
|
|
299
|
+
import Button from "@sth87/shadcn-design-system/button";
|
|
300
|
+
import { useState } from "react";
|
|
301
|
+
|
|
302
|
+
function MyComponent() {
|
|
303
|
+
const [open, setOpen] = useState(false);
|
|
304
|
+
|
|
305
|
+
return (
|
|
306
|
+
// Simple dialog with trigger
|
|
307
|
+
<Dialog
|
|
308
|
+
open={open}
|
|
309
|
+
onOpenChange={setOpen}
|
|
310
|
+
trigger={<Button>Open Dialog</Button>}
|
|
311
|
+
title="Dialog Title"
|
|
312
|
+
description="Dialog description"
|
|
313
|
+
footer={
|
|
314
|
+
<div className="flex gap-2 justify-end w-full">
|
|
315
|
+
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
316
|
+
Cancel
|
|
317
|
+
</Button>
|
|
318
|
+
<Button onClick={() => setOpen(false)}>Save Changes</Button>
|
|
319
|
+
</div>
|
|
320
|
+
}
|
|
321
|
+
>
|
|
322
|
+
<p className="text-sm text-muted-foreground">Dialog content goes here</p>
|
|
323
|
+
</Dialog>
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
**Enhanced Dialog Features:**
|
|
329
|
+
|
|
330
|
+
- **Variants**: `dialog`, `confirm`, `alert`, `info`, `warning`
|
|
331
|
+
- **Sizes**: `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`, `4xl`, `full`
|
|
332
|
+
- **Positions**: `center`, `top`, `bottom`, `left`, `right`, `top-left`, `top-right`, `bottom-left`, `bottom-right`
|
|
333
|
+
- **Animations**: `bounce`, `slide-up`, `slide-down`, `slide-left`, `slide-right`, `zoom-in`, `zoom-out`, `flip`, `glow`, `spec`
|
|
334
|
+
- **Scroll Options**: `stickyHeader`, `stickyFooter`, `scrollable`
|
|
335
|
+
|
|
336
|
+
```tsx
|
|
337
|
+
// Confirm dialog variant
|
|
338
|
+
<Dialog
|
|
339
|
+
variant="confirm"
|
|
340
|
+
trigger={<Button>Confirm Action</Button>}
|
|
341
|
+
title="Confirm Action"
|
|
342
|
+
description="Are you sure you want to proceed?"
|
|
343
|
+
onConfirm={() => console.log("Confirmed")}
|
|
344
|
+
onCancel={() => console.log("Cancelled")}
|
|
345
|
+
/>
|
|
346
|
+
|
|
347
|
+
// Alert dialog variant
|
|
348
|
+
<Dialog
|
|
349
|
+
variant="alert"
|
|
350
|
+
trigger={<Button>Show Alert</Button>}
|
|
351
|
+
title="Warning"
|
|
352
|
+
description="This action cannot be undone"
|
|
353
|
+
onConfirm={() => console.log("Acknowledged")}
|
|
354
|
+
confirmText="I Understand"
|
|
355
|
+
/>
|
|
356
|
+
|
|
357
|
+
// Dialog with custom position and animation
|
|
358
|
+
<Dialog
|
|
359
|
+
position="right"
|
|
360
|
+
animation="slide-left"
|
|
361
|
+
size="lg"
|
|
362
|
+
trigger={<Button>Side Panel</Button>}
|
|
363
|
+
title="Settings"
|
|
364
|
+
>
|
|
365
|
+
<div className="space-y-4">
|
|
366
|
+
{/* Settings content */}
|
|
367
|
+
</div>
|
|
368
|
+
</Dialog>
|
|
369
|
+
|
|
370
|
+
// Scrollable dialog with sticky header/footer
|
|
371
|
+
<Dialog
|
|
372
|
+
stickyHeader
|
|
373
|
+
stickyFooter
|
|
374
|
+
trigger={<Button>Long Content</Button>}
|
|
375
|
+
title="Scrollable Dialog"
|
|
376
|
+
footer={
|
|
377
|
+
<div className="flex gap-2 justify-end w-full">
|
|
378
|
+
<Button variant="outline">Cancel</Button>
|
|
379
|
+
<Button>Save</Button>
|
|
380
|
+
</div>
|
|
381
|
+
}
|
|
382
|
+
>
|
|
383
|
+
<div className="space-y-4">
|
|
384
|
+
{Array.from({ length: 20 }).map((_, i) => (
|
|
385
|
+
<div key={i} className="p-4 border rounded">
|
|
386
|
+
Section {i + 1}
|
|
387
|
+
</div>
|
|
388
|
+
))}
|
|
389
|
+
</div>
|
|
390
|
+
</Dialog>
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
**Standalone Usage (without trigger prop):**
|
|
394
|
+
|
|
395
|
+
```tsx
|
|
396
|
+
function MyComponent() {
|
|
397
|
+
const [open, setOpen] = useState(false);
|
|
398
|
+
|
|
399
|
+
return (
|
|
400
|
+
<>
|
|
401
|
+
<Button onClick={() => setOpen(true)}>Open</Button>
|
|
402
|
+
|
|
403
|
+
<Dialog
|
|
404
|
+
open={open}
|
|
405
|
+
onOpenChange={setOpen}
|
|
406
|
+
title="Standalone Dialog"
|
|
407
|
+
description="Dialog without trigger prop"
|
|
408
|
+
>
|
|
409
|
+
<p>Content here</p>
|
|
410
|
+
</Dialog>
|
|
411
|
+
</>
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
### DatePicker Component
|
|
417
|
+
|
|
418
|
+
Enhanced DatePicker with range and time selection:
|
|
419
|
+
|
|
420
|
+
```tsx
|
|
421
|
+
import { DatePicker } from "@sth87/shadcn-design-system/datepicker";
|
|
422
|
+
import { useState } from "react";
|
|
423
|
+
|
|
424
|
+
function MyComponent() {
|
|
425
|
+
const [date, setDate] = useState<Date>();
|
|
426
|
+
|
|
427
|
+
return (
|
|
428
|
+
<DatePicker selected={date} onSelect={setDate} placeholder="Pick a date" />
|
|
429
|
+
);
|
|
430
|
+
}
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
### Toast Notifications
|
|
434
|
+
|
|
435
|
+
```tsx
|
|
436
|
+
import { toast, Toaster } from "@sth87/shadcn-design-system/toast";
|
|
437
|
+
|
|
438
|
+
function App() {
|
|
439
|
+
return (
|
|
440
|
+
<>
|
|
441
|
+
<Button onClick={() => toast.success("Success message!")}>
|
|
442
|
+
Show Toast
|
|
443
|
+
</Button>
|
|
444
|
+
<Button onClick={() => toast.error("Error message!")}>Show Error</Button>
|
|
445
|
+
<Button onClick={() => toast.info("Info message!")}>Show Info</Button>
|
|
446
|
+
<Toaster />
|
|
447
|
+
</>
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
## 🎨 Styling & Customization
|
|
453
|
+
|
|
454
|
+
### Using CSS Variables
|
|
455
|
+
|
|
456
|
+
```tsx
|
|
457
|
+
// Override specific component styles
|
|
458
|
+
<Button
|
|
459
|
+
style={
|
|
460
|
+
{
|
|
461
|
+
"--primary": "200 100% 50%",
|
|
462
|
+
"--primary-foreground": "0 0% 100%",
|
|
463
|
+
} as React.CSSProperties
|
|
464
|
+
}
|
|
465
|
+
>
|
|
466
|
+
Custom Styled Button
|
|
467
|
+
</Button>
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
### Class Names
|
|
471
|
+
|
|
472
|
+
All components accept `className` prop for custom styling:
|
|
473
|
+
|
|
474
|
+
```tsx
|
|
475
|
+
<Button className="custom-button-class">
|
|
476
|
+
Styled Button
|
|
477
|
+
</Button>
|
|
478
|
+
|
|
479
|
+
<Dialog
|
|
480
|
+
className="custom-dialog-class"
|
|
481
|
+
headerClassName="custom-header"
|
|
482
|
+
contentClassName="custom-content"
|
|
483
|
+
footerClassName="custom-footer"
|
|
484
|
+
trigger={<Button>Custom Styled Dialog</Button>}
|
|
485
|
+
title="Custom Dialog"
|
|
486
|
+
>
|
|
487
|
+
<p>Content with custom styling</p>
|
|
488
|
+
</Dialog>
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
### Variants with CVA
|
|
492
|
+
|
|
493
|
+
Components use `class-variance-authority` for variant management:
|
|
494
|
+
|
|
495
|
+
```tsx
|
|
496
|
+
<Button variant="outline" size="lg" className="w-full">
|
|
497
|
+
Full Width Button
|
|
498
|
+
</Button>
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
## 🔧 Development
|
|
502
|
+
|
|
503
|
+
```bash
|
|
504
|
+
# Install dependencies
|
|
505
|
+
pnpm install
|
|
506
|
+
|
|
507
|
+
# Start Storybook
|
|
508
|
+
pnpm dev
|
|
509
|
+
|
|
510
|
+
# Build library
|
|
511
|
+
pnpm build
|
|
512
|
+
|
|
513
|
+
# Run linting
|
|
514
|
+
pnpm lint
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
## 📖 Documentation
|
|
518
|
+
|
|
519
|
+
For detailed documentation and interactive examples, visit our [Storybook](https://design-system-sth-kappa.vercel.app/).
|
|
520
|
+
|
|
521
|
+
## 🤝 Contributing
|
|
522
|
+
|
|
523
|
+
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
524
|
+
|
|
525
|
+
## 📄 License
|
|
526
|
+
|
|
527
|
+
MIT © Skyline
|
|
528
|
+
|
|
529
|
+
## 🙏 Credits
|
|
530
|
+
|
|
531
|
+
This design system is built on top of [shadcn/ui](https://ui.shadcn.com/), enhancing it with:
|
|
532
|
+
|
|
533
|
+
- Additional component variants and sizes
|
|
534
|
+
- Enhanced animation support with Motion
|
|
535
|
+
- Extended theming capabilities
|
|
536
|
+
- Custom components like DatePicker with range/time support
|
|
537
|
+
- Improved Dialog with positions, animations, and scroll options
|
|
538
|
+
|
|
539
|
+
Built with:
|
|
540
|
+
|
|
541
|
+
- [shadcn/ui](https://ui.shadcn.com/) - Base component library
|
|
542
|
+
- [Radix UI](https://www.radix-ui.com/) - Unstyled, accessible primitives
|
|
543
|
+
- [TailwindCSS](https://tailwindcss.com/) - Utility-first CSS framework
|
|
544
|
+
- [Motion](https://motion.dev/) - Animation library
|
|
545
|
+
- [date-fns](https://date-fns.org/) - Date utility library
|
|
546
|
+
- [Lucide React](https://lucide.dev/) - Beautiful icon set
|
|
547
|
+
- [React Day Picker](https://react-day-picker.js.org/) - Date picker component
|