@equal-experts/kuat-react 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 +155 -396
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
# @equal-experts/kuat-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Custom React components and blocks for the Kuat Design System.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Architecture
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
This package provides **custom components** and **blocks** that are unique to Kuat. For standard UI components (Button, Dialog, etc.), install them directly via shadcn CLI with kuat-core theming.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
```
|
|
12
|
+
┌─────────────────────────────────────────────────────┐
|
|
13
|
+
│ Your Application │
|
|
14
|
+
├─────────────────────────────────────────────────────┤
|
|
15
|
+
│ Kuat Blocks (from this package) │
|
|
16
|
+
├─────────────────────────────────────────────────────┤
|
|
17
|
+
│ Kuat Components (from this package) │
|
|
18
|
+
├─────────────────────────────────────────────────────┤
|
|
19
|
+
│ shadcn Components (installed directly) │
|
|
20
|
+
├─────────────────────────────────────────────────────┤
|
|
21
|
+
│ @equal-experts/kuat-core (design tokens) │
|
|
22
|
+
└─────────────────────────────────────────────────────┘
|
|
23
|
+
```
|
|
14
24
|
|
|
15
|
-
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
16
28
|
|
|
17
29
|
```bash
|
|
18
30
|
# Using pnpm (recommended)
|
|
@@ -25,217 +37,100 @@ npm install @equal-experts/kuat-react
|
|
|
25
37
|
yarn add @equal-experts/kuat-react
|
|
26
38
|
```
|
|
27
39
|
|
|
28
|
-
###
|
|
29
|
-
|
|
30
|
-
The library requires React, React DOM, and Radix UI packages as peer dependencies. Install only the packages you need based on which components you use:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
# Required peer dependencies
|
|
34
|
-
pnpm add react react-dom
|
|
35
|
-
|
|
36
|
-
# Install Radix UI packages as needed (examples for common components)
|
|
37
|
-
pnpm add @radix-ui/react-slot @radix-ui/react-dialog @radix-ui/react-dropdown-menu
|
|
38
|
-
|
|
39
|
-
# Optional: Install lucide-react for icons (or use your preferred icon library)
|
|
40
|
-
pnpm add lucide-react
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
**Note:** `@equal-experts/kuat-core` is bundled with this package. You don't need to install it separately when using kuat-react. However, if you want to use design tokens without React components, you can install [`@equal-experts/kuat-core`](https://www.npmjs.com/package/@equal-experts/kuat-core) standalone. See the [kuat-core documentation](https://github.com/equalexperts/kuat-mono/tree/main/packages/kuat-core) for framework-agnostic usage.
|
|
44
|
-
|
|
45
|
-
### Using Design Tokens Without Components
|
|
46
|
-
|
|
47
|
-
If you only need design tokens (CSS variables, Tailwind preset) without React components, install `@equal-experts/kuat-core` instead:
|
|
40
|
+
### Peer Dependencies
|
|
48
41
|
|
|
49
42
|
```bash
|
|
50
|
-
pnpm add @
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Then import the CSS variables and optionally use the Tailwind preset:
|
|
54
|
-
|
|
55
|
-
```typescript
|
|
56
|
-
// Import CSS variables
|
|
57
|
-
import '@equal-experts/kuat-core/variables.css';
|
|
58
|
-
|
|
59
|
-
// Or use as a Tailwind preset
|
|
60
|
-
import kuatPreset from '@equal-experts/kuat-core';
|
|
43
|
+
pnpm add react react-dom @radix-ui/react-slot
|
|
61
44
|
```
|
|
62
45
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
### Recommended: Use Subpath Imports
|
|
66
|
-
|
|
67
|
-
To avoid installing all peer dependencies when you only need specific components, use **subpath imports**. This allows you to import only the components you need and only install their required peer dependencies.
|
|
68
|
-
|
|
69
|
-
**Example: Only using Button**
|
|
46
|
+
---
|
|
70
47
|
|
|
71
|
-
|
|
72
|
-
# Only install peer dependencies for Button
|
|
73
|
-
pnpm add react react-dom @radix-ui/react-slot
|
|
74
|
-
```
|
|
48
|
+
## What's Included
|
|
75
49
|
|
|
76
|
-
|
|
77
|
-
// Import from subpath - only Button and its dependencies are required
|
|
78
|
-
import { Button } from "@equal-experts/kuat-react/button";
|
|
79
|
-
```
|
|
50
|
+
### Custom Components
|
|
80
51
|
|
|
81
|
-
|
|
52
|
+
Components unique to Kuat, not available in shadcn:
|
|
82
53
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
54
|
+
| Component | Description |
|
|
55
|
+
|-----------|-------------|
|
|
56
|
+
| `ButtonGroup` | Groups buttons together with proper styling |
|
|
57
|
+
| `ButtonGroupText` | Text element within a button group |
|
|
58
|
+
| `ButtonGroupSeparator` | Separator between button group items |
|
|
87
59
|
|
|
88
|
-
|
|
60
|
+
### Blocks (Coming Soon)
|
|
89
61
|
|
|
90
|
-
|
|
62
|
+
Pre-built compositions for common patterns:
|
|
91
63
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
64
|
+
| Block | Description |
|
|
65
|
+
|-------|-------------|
|
|
66
|
+
| `KuatHeader` | Brand header with logo, navigation, actions |
|
|
67
|
+
| `KuatFooter` | Brand footer with links and legal |
|
|
68
|
+
| `KuatSearchPattern` | Search input with suggestions |
|
|
96
69
|
|
|
97
|
-
|
|
70
|
+
### Utilities
|
|
98
71
|
|
|
99
|
-
|
|
72
|
+
| Utility | Description |
|
|
73
|
+
|---------|-------------|
|
|
74
|
+
| `cn()` | Class name merger using clsx + tailwind-merge |
|
|
100
75
|
|
|
101
76
|
---
|
|
102
77
|
|
|
103
|
-
## Setup
|
|
78
|
+
## Recommended Setup
|
|
104
79
|
|
|
105
|
-
|
|
80
|
+
For the best experience, combine this package with kuat-core and shadcn:
|
|
106
81
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
#### Install Tailwind CSS v4
|
|
82
|
+
### Step 1: Install Dependencies
|
|
110
83
|
|
|
111
84
|
```bash
|
|
112
|
-
pnpm add -
|
|
85
|
+
pnpm add @equal-experts/kuat-core @equal-experts/kuat-react
|
|
113
86
|
```
|
|
114
87
|
|
|
115
|
-
|
|
88
|
+
### Step 2: Configure Tailwind
|
|
116
89
|
|
|
117
90
|
```typescript
|
|
118
|
-
|
|
91
|
+
// tailwind.config.ts
|
|
92
|
+
import type { Config } from 'tailwindcss';
|
|
93
|
+
import kuatPreset from '@equal-experts/kuat-core';
|
|
119
94
|
|
|
120
|
-
|
|
95
|
+
export default {
|
|
96
|
+
presets: [kuatPreset],
|
|
121
97
|
content: [
|
|
122
|
-
|
|
123
|
-
|
|
98
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
99
|
+
'./node_modules/@equal-experts/kuat-react/**/*.{js,ts,jsx,tsx}',
|
|
124
100
|
],
|
|
125
|
-
|
|
126
|
-
extend: {
|
|
127
|
-
colors: {
|
|
128
|
-
background: "var(--background)",
|
|
129
|
-
foreground: "var(--foreground)",
|
|
130
|
-
primary: {
|
|
131
|
-
DEFAULT: "var(--primary)",
|
|
132
|
-
foreground: "var(--primary-foreground)",
|
|
133
|
-
},
|
|
134
|
-
secondary: {
|
|
135
|
-
DEFAULT: "var(--secondary)",
|
|
136
|
-
foreground: "var(--secondary-foreground)",
|
|
137
|
-
},
|
|
138
|
-
// ... other color tokens from @equal-experts/kuat-core
|
|
139
|
-
},
|
|
140
|
-
borderRadius: {
|
|
141
|
-
lg: "var(--radius)",
|
|
142
|
-
md: "calc(var(--radius) - 2px)",
|
|
143
|
-
sm: "calc(var(--radius) - 4px)",
|
|
144
|
-
},
|
|
145
|
-
fontFamily: {
|
|
146
|
-
sans: ["var(--font-sans)"],
|
|
147
|
-
serif: ["var(--font-serif)"],
|
|
148
|
-
mono: ["var(--font-mono)"],
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
plugins: [],
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
export default config;
|
|
101
|
+
} satisfies Config;
|
|
156
102
|
```
|
|
157
103
|
|
|
158
|
-
|
|
104
|
+
### Step 3: Import Styles
|
|
159
105
|
|
|
160
106
|
```typescript
|
|
161
|
-
//
|
|
162
|
-
import
|
|
163
|
-
import react from "@vitejs/plugin-react";
|
|
164
|
-
import tailwindcss from "@tailwindcss/vite";
|
|
165
|
-
|
|
166
|
-
export default defineConfig({
|
|
167
|
-
plugins: [react(), tailwindcss()],
|
|
168
|
-
});
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### 2. Import Styles
|
|
172
|
-
|
|
173
|
-
Import the Kuat Design System styles in your application's entry point:
|
|
174
|
-
|
|
175
|
-
```typescript
|
|
176
|
-
// main.tsx or App.tsx
|
|
177
|
-
import "@equal-experts/kuat-react/styles";
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
This imports the bundled CSS file which includes all design tokens from `@equal-experts/kuat-core` (no need to install `@equal-experts/kuat-core` separately).
|
|
181
|
-
|
|
182
|
-
**Note:** The styles include:
|
|
183
|
-
- Design tokens from `@equal-experts/kuat-core` (colors, spacing, typography)
|
|
184
|
-
- Tailwind CSS base styles
|
|
185
|
-
- Component-specific styles
|
|
186
|
-
|
|
187
|
-
### 3. (Optional) Configure Fonts
|
|
188
|
-
|
|
189
|
-
The Kuat Design System uses Lexend (sans-serif), Lora (serif), and JetBrains Mono (monospace) fonts. These are loaded via Google Fonts in the core package.
|
|
190
|
-
|
|
191
|
-
If you want to use different fonts or load them differently, you can override the CSS variables:
|
|
192
|
-
|
|
193
|
-
```css
|
|
194
|
-
:root {
|
|
195
|
-
--font-sans: 'Your Sans Font', sans-serif;
|
|
196
|
-
--font-serif: 'Your Serif Font', serif;
|
|
197
|
-
--font-mono: 'Your Mono Font', monospace;
|
|
198
|
-
}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
---
|
|
202
|
-
|
|
203
|
-
## Basic Usage
|
|
204
|
-
|
|
205
|
-
### Import Components
|
|
206
|
-
|
|
207
|
-
You can import components in two ways:
|
|
208
|
-
|
|
209
|
-
**Option 1: Subpath Import (Recommended for single components)**
|
|
210
|
-
|
|
211
|
-
```typescript
|
|
212
|
-
// Import only Button - only requires Button's peer dependencies
|
|
213
|
-
import { Button } from "@equal-experts/kuat-react/button";
|
|
107
|
+
// main.tsx
|
|
108
|
+
import '@equal-experts/kuat-core/variables.css';
|
|
214
109
|
```
|
|
215
110
|
|
|
216
|
-
|
|
111
|
+
### Step 4: Install shadcn Components
|
|
217
112
|
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
|
|
113
|
+
```bash
|
|
114
|
+
npx shadcn@latest init
|
|
115
|
+
npx shadcn@latest add button dialog dropdown-menu
|
|
221
116
|
```
|
|
222
117
|
|
|
223
|
-
### Use
|
|
118
|
+
### Step 5: Use Components Together
|
|
224
119
|
|
|
225
120
|
```tsx
|
|
226
|
-
//
|
|
227
|
-
import {
|
|
121
|
+
// Kuat custom components from this package
|
|
122
|
+
import { ButtonGroup, ButtonGroupText } from '@equal-experts/kuat-react';
|
|
228
123
|
|
|
229
|
-
//
|
|
230
|
-
|
|
124
|
+
// shadcn components from your local installation
|
|
125
|
+
import { Button } from '@/components/ui/button';
|
|
231
126
|
|
|
232
|
-
function
|
|
127
|
+
function Example() {
|
|
233
128
|
return (
|
|
234
|
-
<
|
|
235
|
-
<Button>
|
|
236
|
-
<Button variant="outline">
|
|
129
|
+
<ButtonGroup>
|
|
130
|
+
<Button variant="outline">Edit</Button>
|
|
131
|
+
<Button variant="outline">Save</Button>
|
|
237
132
|
<Button variant="destructive">Delete</Button>
|
|
238
|
-
</
|
|
133
|
+
</ButtonGroup>
|
|
239
134
|
);
|
|
240
135
|
}
|
|
241
136
|
```
|
|
@@ -244,274 +139,138 @@ function App() {
|
|
|
244
139
|
|
|
245
140
|
## Component Examples
|
|
246
141
|
|
|
247
|
-
###
|
|
142
|
+
### ButtonGroup
|
|
248
143
|
|
|
249
|
-
|
|
144
|
+
Groups buttons together with seamless borders:
|
|
250
145
|
|
|
251
146
|
```tsx
|
|
252
|
-
import {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
{/* Disabled */}
|
|
277
|
-
<Button disabled>Disabled</Button>
|
|
278
|
-
|
|
279
|
-
{/* As child (for composition) */}
|
|
280
|
-
<Button asChild>
|
|
281
|
-
<a href="/link">Link Button</a>
|
|
282
|
-
</Button>
|
|
283
|
-
</div>
|
|
284
|
-
);
|
|
285
|
-
}
|
|
147
|
+
import { ButtonGroup } from '@equal-experts/kuat-react';
|
|
148
|
+
import { Button } from '@/components/ui/button';
|
|
149
|
+
|
|
150
|
+
// Horizontal (default)
|
|
151
|
+
<ButtonGroup>
|
|
152
|
+
<Button variant="outline">Left</Button>
|
|
153
|
+
<Button variant="outline">Center</Button>
|
|
154
|
+
<Button variant="outline">Right</Button>
|
|
155
|
+
</ButtonGroup>
|
|
156
|
+
|
|
157
|
+
// Vertical
|
|
158
|
+
<ButtonGroup orientation="vertical">
|
|
159
|
+
<Button variant="outline">Top</Button>
|
|
160
|
+
<Button variant="outline">Middle</Button>
|
|
161
|
+
<Button variant="outline">Bottom</Button>
|
|
162
|
+
</ButtonGroup>
|
|
163
|
+
|
|
164
|
+
// With text label
|
|
165
|
+
<ButtonGroup>
|
|
166
|
+
<ButtonGroupText>Filter:</ButtonGroupText>
|
|
167
|
+
<Button variant="outline">All</Button>
|
|
168
|
+
<Button variant="outline">Active</Button>
|
|
169
|
+
<Button variant="outline">Completed</Button>
|
|
170
|
+
</ButtonGroup>
|
|
286
171
|
```
|
|
287
172
|
|
|
288
|
-
###
|
|
173
|
+
### cn() Utility
|
|
289
174
|
|
|
290
|
-
|
|
175
|
+
Merge class names with Tailwind conflict resolution:
|
|
291
176
|
|
|
292
177
|
```tsx
|
|
293
|
-
import {
|
|
294
|
-
|
|
295
|
-
// ButtonProps includes all standard button HTML attributes
|
|
296
|
-
const CustomButton: React.FC<ButtonProps> = (props) => {
|
|
297
|
-
return <Button {...props} />;
|
|
298
|
-
};
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
---
|
|
302
|
-
|
|
303
|
-
## Styling and Theming
|
|
304
|
-
|
|
305
|
-
### Using Design Tokens
|
|
178
|
+
import { cn } from '@equal-experts/kuat-react';
|
|
306
179
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
```tsx
|
|
310
|
-
function CustomComponent() {
|
|
180
|
+
function MyComponent({ className, ...props }) {
|
|
311
181
|
return (
|
|
312
182
|
<div
|
|
313
|
-
className=
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
</div>
|
|
320
|
-
);
|
|
321
|
-
}
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
### Dark Mode
|
|
325
|
-
|
|
326
|
-
Dark mode is supported via the `.dark` class. Apply it to your root element:
|
|
327
|
-
|
|
328
|
-
```tsx
|
|
329
|
-
// In your root component or HTML
|
|
330
|
-
<html className="dark">
|
|
331
|
-
<body>
|
|
332
|
-
<App />
|
|
333
|
-
</body>
|
|
334
|
-
</html>
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
Or toggle dynamically:
|
|
338
|
-
|
|
339
|
-
```tsx
|
|
340
|
-
import { useState } from "react";
|
|
341
|
-
|
|
342
|
-
function App() {
|
|
343
|
-
const [isDark, setIsDark] = useState(false);
|
|
344
|
-
|
|
345
|
-
return (
|
|
346
|
-
<div className={isDark ? "dark" : ""}>
|
|
347
|
-
<button onClick={() => setIsDark(!isDark)}>
|
|
348
|
-
Toggle theme
|
|
349
|
-
</button>
|
|
350
|
-
{/* Your app */}
|
|
351
|
-
</div>
|
|
183
|
+
className={cn(
|
|
184
|
+
'bg-background text-foreground p-4',
|
|
185
|
+
className
|
|
186
|
+
)}
|
|
187
|
+
{...props}
|
|
188
|
+
/>
|
|
352
189
|
);
|
|
353
190
|
}
|
|
354
191
|
```
|
|
355
192
|
|
|
356
|
-
### Customizing Colors
|
|
357
|
-
|
|
358
|
-
Override CSS variables to customize the theme:
|
|
359
|
-
|
|
360
|
-
```css
|
|
361
|
-
/* In your global CSS file */
|
|
362
|
-
:root {
|
|
363
|
-
--primary: oklch(0.645 0.163 237.5); /* Your primary color */
|
|
364
|
-
--primary-foreground: oklch(1.0 0.0 0.0); /* White */
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
.dark {
|
|
368
|
-
--primary: oklch(0.585 0.145 237.5); /* Darker primary for dark mode */
|
|
369
|
-
--primary-foreground: oklch(1.0 0.0 0.0); /* White */
|
|
370
|
-
}
|
|
371
|
-
```
|
|
372
|
-
|
|
373
193
|
---
|
|
374
194
|
|
|
375
|
-
##
|
|
195
|
+
## Migration Guide
|
|
376
196
|
|
|
377
|
-
|
|
197
|
+
If you were importing standard components from this package, migrate to direct shadcn installation:
|
|
378
198
|
|
|
379
|
-
|
|
199
|
+
### Before (Deprecated)
|
|
380
200
|
|
|
381
201
|
```tsx
|
|
382
|
-
import { Button } from
|
|
383
|
-
import { Link } from "react-router-dom";
|
|
384
|
-
|
|
385
|
-
function NavigationButton() {
|
|
386
|
-
return (
|
|
387
|
-
<Button asChild variant="ghost">
|
|
388
|
-
<Link to="/dashboard">Dashboard</Link>
|
|
389
|
-
</Button>
|
|
390
|
-
);
|
|
391
|
-
}
|
|
202
|
+
import { Button, Dialog, Badge } from '@equal-experts/kuat-react';
|
|
392
203
|
```
|
|
393
204
|
|
|
394
|
-
###
|
|
395
|
-
|
|
396
|
-
Import and use variant functions:
|
|
205
|
+
### After (Recommended)
|
|
397
206
|
|
|
398
207
|
```tsx
|
|
399
|
-
|
|
400
|
-
import {
|
|
208
|
+
// Standard components from your local shadcn installation
|
|
209
|
+
import { Button } from '@/components/ui/button';
|
|
210
|
+
import { Dialog } from '@/components/ui/dialog';
|
|
211
|
+
import { Badge } from '@/components/ui/badge';
|
|
401
212
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
<button
|
|
405
|
-
className={cn(buttonVariants({ variant: "outline", size: "lg" }), className)}
|
|
406
|
-
{...props}
|
|
407
|
-
/>
|
|
408
|
-
);
|
|
409
|
-
}
|
|
213
|
+
// Kuat-specific components from this package
|
|
214
|
+
import { ButtonGroup } from '@equal-experts/kuat-react';
|
|
410
215
|
```
|
|
411
216
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
## Troubleshooting
|
|
415
|
-
|
|
416
|
-
### Styles Not Loading
|
|
417
|
-
|
|
418
|
-
1. **Check import order**: Ensure you import `@equal-experts/kuat-react/styles` before your own styles
|
|
419
|
-
2. **Verify Tailwind config**: Make sure `@equal-experts/kuat-react` is included in your `content` paths
|
|
420
|
-
3. **Check build output**: Ensure the CSS file is being included in your build
|
|
421
|
-
|
|
422
|
-
### TypeScript Errors
|
|
217
|
+
### Migration Steps
|
|
423
218
|
|
|
424
|
-
1.
|
|
425
|
-
2.
|
|
426
|
-
3.
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
1. **Check React version**: Requires React 18.2.0 or higher
|
|
431
|
-
2. **Verify peer dependencies**: Ensure `react` and `react-dom` are installed
|
|
432
|
-
3. **Check console**: Look for runtime errors in the browser console
|
|
219
|
+
1. Ensure `@equal-experts/kuat-core` is installed
|
|
220
|
+
2. Initialize shadcn: `npx shadcn@latest init`
|
|
221
|
+
3. Install needed components: `npx shadcn@latest add button dialog badge`
|
|
222
|
+
4. Update imports to use local components
|
|
223
|
+
5. Keep imports for Kuat-specific components (ButtonGroup, etc.)
|
|
433
224
|
|
|
434
225
|
---
|
|
435
226
|
|
|
436
|
-
##
|
|
227
|
+
## Deprecated Exports
|
|
437
228
|
|
|
438
|
-
|
|
439
|
-
@equal-experts/kuat-react
|
|
440
|
-
├── dist/
|
|
441
|
-
│ ├── index.js # Compiled JavaScript
|
|
442
|
-
│ ├── index.d.ts # TypeScript definitions
|
|
443
|
-
│ └── index.css # Compiled styles
|
|
444
|
-
└── src/
|
|
445
|
-
├── components/ # Component source files
|
|
446
|
-
├── lib/ # Utilities
|
|
447
|
-
└── styles.css # Style source
|
|
448
|
-
```
|
|
229
|
+
The following exports are deprecated and will be removed in the next major version. Install them directly via shadcn CLI instead:
|
|
449
230
|
|
|
450
|
-
|
|
231
|
+
| Component | Replacement |
|
|
232
|
+
|-----------|-------------|
|
|
233
|
+
| `Button` | `npx shadcn@latest add button` |
|
|
234
|
+
| `Accordion` | `npx shadcn@latest add accordion` |
|
|
235
|
+
| `AlertDialog` | `npx shadcn@latest add alert-dialog` |
|
|
236
|
+
| `Badge` | `npx shadcn@latest add badge` |
|
|
451
237
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
- **shadcn/ui Documentation**: [https://ui.shadcn.com](https://ui.shadcn.com)
|
|
455
|
-
- **Tailwind CSS v4**: [https://tailwindcss.com](https://tailwindcss.com)
|
|
456
|
-
- **Radix UI Documentation**: [https://www.radix-ui.com](https://www.radix-ui.com)
|
|
238
|
+
These components are still exported for backward compatibility but will be themed correctly only when using kuat-core.
|
|
457
239
|
|
|
458
240
|
---
|
|
459
241
|
|
|
460
|
-
##
|
|
461
|
-
|
|
462
|
-
The Kuat Design System includes LLM-optimized documentation for AI assistants.
|
|
463
|
-
|
|
464
|
-
### Quick Setup
|
|
465
|
-
|
|
466
|
-
Add this snippet to your existing `.cursorrules`, `CLAUDE.md`, or agent config:
|
|
242
|
+
## TypeScript Support
|
|
467
243
|
|
|
468
|
-
|
|
469
|
-
## Kuat Design System
|
|
470
|
-
|
|
471
|
-
This project uses the Kuat Design System for all UI work.
|
|
472
|
-
|
|
473
|
-
**What it provides:**
|
|
474
|
-
Design tokens, component patterns, layout guidance, and content guidelines for building consistent, accessible interfaces.
|
|
475
|
-
|
|
476
|
-
**When to use it:**
|
|
477
|
-
You MUST reference the Kuat documentation when:
|
|
478
|
-
- Creating or modifying UI components
|
|
479
|
-
- Making color, typography, spacing, or layout decisions
|
|
480
|
-
- Writing user-facing content
|
|
481
|
-
|
|
482
|
-
**How to use it:**
|
|
483
|
-
1. Check the documentation before making design decisions
|
|
484
|
-
2. Follow existing patterns; do not invent new ones
|
|
485
|
-
3. If the documentation doesn't cover your case, ask before proceeding
|
|
244
|
+
All components are fully typed:
|
|
486
245
|
|
|
487
|
-
|
|
488
|
-
|
|
246
|
+
```tsx
|
|
247
|
+
import { ButtonGroup } from '@equal-experts/kuat-react';
|
|
248
|
+
import type { ComponentProps } from 'react';
|
|
489
249
|
|
|
490
|
-
|
|
250
|
+
type ButtonGroupProps = ComponentProps<typeof ButtonGroup>;
|
|
491
251
|
```
|
|
492
252
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
For component patterns, layouts, or content guidelines, clone the docs:
|
|
253
|
+
---
|
|
496
254
|
|
|
497
|
-
|
|
498
|
-
git clone --filter=blob:none --sparse https://github.com/equal-experts/kuat-mono.git
|
|
499
|
-
cd kuat-mono && git sparse-checkout set kuat-docs
|
|
500
|
-
cp -r kuat-docs /path/to/your-project/
|
|
501
|
-
```
|
|
255
|
+
## Dark Mode
|
|
502
256
|
|
|
503
|
-
|
|
257
|
+
Dark mode is supported via the `.dark` class on your root element:
|
|
504
258
|
|
|
505
|
-
|
|
259
|
+
```tsx
|
|
260
|
+
<html className="dark">
|
|
261
|
+
<body>
|
|
262
|
+
<App />
|
|
263
|
+
</body>
|
|
264
|
+
</html>
|
|
265
|
+
```
|
|
506
266
|
|
|
507
|
-
|
|
508
|
-
- "Create a card component" → Agent should reference Kuat docs
|
|
509
|
-
- "What color for the primary button?" → Agent should check docs or use semantic tokens
|
|
510
|
-
- "Add spacing between form fields" → Agent should reference spacing rules
|
|
267
|
+
Components automatically adapt when using kuat-core design tokens.
|
|
511
268
|
|
|
512
269
|
---
|
|
513
270
|
|
|
514
|
-
##
|
|
515
|
-
|
|
516
|
-
For issues, questions, or contributions, please refer to the main repository documentation or open an issue in the project repository.
|
|
271
|
+
## Related Documentation
|
|
517
272
|
|
|
273
|
+
- [Consumer Setup Guide](https://github.com/equalexperts/kuat-mono/blob/master/kuat-docs/setup/consumer-setup.md)
|
|
274
|
+
- [kuat-core Integration](https://github.com/equalexperts/kuat-mono/blob/master/kuat-docs/setup/kuat-core-integration.md)
|
|
275
|
+
- [Component Patterns](https://github.com/equalexperts/kuat-mono/blob/master/kuat-docs/rules/components/patterns.md)
|
|
276
|
+
- [shadcn/ui Documentation](https://ui.shadcn.com)
|