@webstacks/ui 0.3.1 → 0.4.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 CHANGED
@@ -1,53 +1,89 @@
1
1
  # @webstacks/ui
2
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).
3
+ A React implementation of the Webstacks Design System — built on [Radix UI](https://www.radix-ui.com), [Tailwind CSS](https://tailwindcss.com), and [shadcn/ui](https://ui.shadcn.com).
4
4
 
5
- ## Installation
5
+ ## Getting started
6
+
7
+ To install `@webstacks/ui` in your project, run the following command:
6
8
 
7
9
  ```bash
8
10
  npm install @webstacks/ui
9
11
  ```
10
12
 
11
- ## Peer Dependencies
12
-
13
- This library requires the following peer dependencies in your consuming application:
13
+ If you prefer Yarn or pnpm:
14
14
 
15
15
  ```bash
16
- npm install react react-dom
16
+ yarn add @webstacks/ui
17
+ # or
18
+ pnpm add @webstacks/ui
17
19
  ```
18
20
 
21
+ This package includes:
22
+
23
+ - **Components** — all UI primitives and layout components
24
+ - **Design tokens** — color primitives, semantic tokens, and shadcn variable bridge
25
+ - **Fonts** — Saans and TT Interphases Pro Mono font files and `@font-face` declarations
26
+ - **Typography** — a full type scale with semantic font variables
27
+
19
28
  ## Usage
20
29
 
21
30
  Import components directly from the package:
22
31
 
23
32
  ```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
- );
33
+ import { Button } from "@webstacks/ui";
34
+
35
+ function App() {
36
+ return <Button>Hello world</Button>;
37
37
  }
38
38
  ```
39
39
 
40
- ### Styles
40
+ At the root of your application, wrap your content with the `BaseStyles` component. This injects all design tokens, fonts, color primitives, and base styles:
41
+
42
+ ```tsx
43
+ import { BaseStyles } from "@webstacks/ui";
44
+
45
+ function RootLayout({ children }) {
46
+ return <BaseStyles>{children}</BaseStyles>;
47
+ }
48
+ ```
49
+
50
+ ### Color mode
51
+
52
+ `BaseStyles` accepts a `colorMode` prop to control light/dark theming:
53
+
54
+ ```tsx
55
+ // Force light mode (default)
56
+ <BaseStyles colorMode="light">
57
+
58
+ // Force dark mode
59
+ <BaseStyles colorMode="dark">
60
+
61
+ // Follow system preference
62
+ <BaseStyles colorMode="auto">
63
+ ```
64
+
65
+ ### Alternative: manual CSS import
41
66
 
42
- You must import the CSS in your application's entry point:
67
+ If you prefer not to use `BaseStyles`, you can import the styles directly in your entry point:
43
68
 
44
69
  ```tsx
45
70
  import "@webstacks/ui/styles.css";
46
71
  ```
47
72
 
48
- Or include the Tailwind CSS variables from `globals.css` in your own Tailwind setup.
73
+ ## Components
74
+
75
+ ### Layout
76
+
77
+ - **Box** — versatile layout primitive with padding, margin, background, border, and border-radius props
78
+ - **Grid** / **GridColumn** — 12-column grid with responsive columns and gap control
79
+ - **Stack** — one-dimensional flex layout with direction, gap, alignment, and justification
49
80
 
50
- ## Available Components
81
+ ### Typography
82
+
83
+ - **Heading** — semantic heading component (h1–h6) with size, weight, stretch, and letter-spacing variants
84
+ - **Text** — body text component with size (100–700), variant, weight, and alignment
85
+
86
+ ### UI Primitives
51
87
 
52
88
  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
89
 
@@ -61,7 +97,7 @@ Accordion, Alert, AlertDialog, AspectRatio, Avatar, Badge, Breadcrumb, Button, C
61
97
  ## Utilities
62
98
 
63
99
  - `cn()` — Tailwind class merging utility (clsx + tailwind-merge)
64
- - `buttonVariants` / `badgeVariants` / `toggleVariants` — CVA variant helpers
100
+ - `buttonVariants` / `badgeVariants` / `toggleVariants` / `boxVariants` / `headingVariants` / `textVariants` — CVA variant helpers
65
101
 
66
102
  ## Development
67
103
 
@@ -75,6 +111,9 @@ npm run build
75
111
  # Watch mode
76
112
  npm run dev
77
113
 
114
+ # Preview all components
115
+ npm run dev:preview
116
+
78
117
  # Type check
79
118
  npm run typecheck
80
119
  ```
@@ -82,6 +121,10 @@ npm run typecheck
82
121
  ## Publishing
83
122
 
84
123
  ```bash
85
- npm run build
124
+ npm version patch # or minor / major
86
125
  npm publish --access public
87
126
  ```
127
+
128
+ ## License
129
+
130
+ MIT
Binary file
Binary file
Binary file
Binary file
Binary file