@webstacks/ui 0.1.0
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 +87 -0
- package/dist/index.cjs +4304 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +700 -0
- package/dist/index.d.ts +700 -0
- package/dist/index.js +4023 -0
- package/dist/index.js.map +1 -0
- package/package.json +109 -0
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# @webstacks/ui
|
|
2
|
+
|
|
3
|
+
A shareable React component library built on [shadcn/ui](https://ui.shadcn.com), [Radix UI](https://www.radix-ui.com), and [Tailwind CSS](https://tailwindcss.com).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @webstacks/ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Peer Dependencies
|
|
12
|
+
|
|
13
|
+
This library requires the following peer dependencies in your consuming application:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install react react-dom
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Import components directly from the package:
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Button, Card, CardHeader, CardTitle, CardContent } from "@webstacks/ui";
|
|
25
|
+
|
|
26
|
+
export function MyComponent() {
|
|
27
|
+
return (
|
|
28
|
+
<Card>
|
|
29
|
+
<CardHeader>
|
|
30
|
+
<CardTitle>Hello</CardTitle>
|
|
31
|
+
</CardHeader>
|
|
32
|
+
<CardContent>
|
|
33
|
+
<Button variant="outline">Click me</Button>
|
|
34
|
+
</CardContent>
|
|
35
|
+
</Card>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Styles
|
|
41
|
+
|
|
42
|
+
You must import the CSS in your application's entry point:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import "@webstacks/ui/styles.css";
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Or include the Tailwind CSS variables from `globals.css` in your own Tailwind setup.
|
|
49
|
+
|
|
50
|
+
## Available Components
|
|
51
|
+
|
|
52
|
+
Accordion, Alert, AlertDialog, AspectRatio, Avatar, Badge, Breadcrumb, Button, Calendar, Card, Carousel, Chart, Checkbox, Collapsible, Command, ContextMenu, Dialog, Drawer, DropdownMenu, Form, HoverCard, Input, InputOTP, Label, Menubar, NavigationMenu, Pagination, Popover, Progress, RadioGroup, Resizable, ScrollArea, Select, Separator, Sheet, Sidebar, Skeleton, Slider, Sonner, Switch, Table, Tabs, Textarea, Toast, Toaster, Toggle, ToggleGroup, Tooltip
|
|
53
|
+
|
|
54
|
+
## Hooks
|
|
55
|
+
|
|
56
|
+
- `useToast` / `toast` — Toast notification system
|
|
57
|
+
- `useIsMobile` — Mobile breakpoint detection
|
|
58
|
+
- `useSidebar` — Sidebar state management
|
|
59
|
+
- `useFormField` — Form field context
|
|
60
|
+
|
|
61
|
+
## Utilities
|
|
62
|
+
|
|
63
|
+
- `cn()` — Tailwind class merging utility (clsx + tailwind-merge)
|
|
64
|
+
- `buttonVariants` / `badgeVariants` / `toggleVariants` — CVA variant helpers
|
|
65
|
+
|
|
66
|
+
## Development
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Install dependencies
|
|
70
|
+
npm install
|
|
71
|
+
|
|
72
|
+
# Build the library
|
|
73
|
+
npm run build
|
|
74
|
+
|
|
75
|
+
# Watch mode
|
|
76
|
+
npm run dev
|
|
77
|
+
|
|
78
|
+
# Type check
|
|
79
|
+
npm run typecheck
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Publishing
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npm run build
|
|
86
|
+
npm publish --access public
|
|
87
|
+
```
|