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