@equal-experts/kuat-react 0.13.1 → 0.14.0-beta.1
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 +49 -49
- package/agent-docs/AGENTS.md +2 -2
- package/agent-docs/README.md +1 -1
- package/agent-docs/bundle-manifest.json +12 -20
- package/agent-docs/components/components.manifest.json +3 -0
- package/agent-docs/external/kuat-agent-rules/reference/accessibility/README.md +7 -0
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/foundations → reference/accessibility}/accessibility.md +12 -10
- package/agent-docs/external/kuat-agent-rules/reference/brand/README.md +9 -0
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/foundations → reference/brand}/brand.md +21 -11
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/foundations → reference/brand}/logo.md +5 -4
- package/agent-docs/external/kuat-agent-rules/reference/brand/voice-and-tone.md +166 -0
- package/agent-docs/external/kuat-agent-rules/reference/content/README.md +12 -0
- package/agent-docs/external/kuat-agent-rules/reference/content/formatting.md +120 -0
- package/agent-docs/external/kuat-agent-rules/reference/content/numbers.md +87 -0
- package/agent-docs/external/kuat-agent-rules/reference/content/punctuation.md +94 -0
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/foundations → reference}/content/writing-style.md +7 -2
- package/agent-docs/external/kuat-agent-rules/reference/design-language/README.md +11 -0
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/foundations/design → reference/design-language}/borders.md +3 -2
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/foundations/design → reference/design-language}/colours.md +38 -10
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/foundations/design → reference/design-language}/design-language.md +11 -10
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/foundations/design → reference/design-language}/spacing.md +4 -3
- package/agent-docs/external/kuat-agent-rules/reference/design-language/tokens/README.md +29 -0
- package/agent-docs/external/kuat-agent-rules/reference/design-language/tokens/colors.tokens.json +84 -0
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/foundations/design → reference/design-language}/typography.md +5 -4
- package/agent-docs/external/kuat-agent-rules/reference/media-types/web-marketing/README.md +10 -0
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/marketing → reference/media-types/web-marketing}/content/README.md +2 -2
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/marketing → reference/media-types/web-marketing}/content/blog-posts.md +1 -5
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/marketing → reference/media-types/web-marketing}/content/marketing-content.md +2 -6
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/marketing → reference/media-types/web-marketing}/content/seo.md +2 -6
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/marketing → reference/media-types/web-marketing}/emails.md +3 -9
- package/agent-docs/external/kuat-agent-rules/reference/media-types/web-marketing/patterns/README.md +7 -0
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/marketing/scenarios → reference/media-types/web-marketing/patterns}/marketing-pages.md +3 -3
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/marketing → reference/media-types/web-marketing}/website.md +7 -22
- package/agent-docs/external/kuat-agent-rules/reference/media-types/web-product/README.md +16 -0
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product → reference/media-types/web-product}/accessibility.md +2 -12
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product → reference/media-types/web-product}/component-decision-tree.md +3 -18
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product → reference/media-types/web-product}/component-registry.md +3 -22
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product → reference/media-types/web-product}/content/README.md +2 -2
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product → reference/media-types/web-product}/content/actions.md +1 -7
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product → reference/media-types/web-product}/content/confirmations.md +0 -6
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product → reference/media-types/web-product}/content/empty-states.md +0 -6
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product → reference/media-types/web-product}/content/errors.md +0 -6
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product → reference/media-types/web-product}/content/forms.md +1 -7
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product → reference/media-types/web-product}/content/product-content.md +1 -11
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product → reference/media-types/web-product}/design.md +6 -36
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product → reference/media-types/web-product}/emails.md +3 -9
- package/agent-docs/external/kuat-agent-rules/reference/media-types/web-product/patterns/README.md +10 -0
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product/scenarios → reference/media-types/web-product/patterns}/authentication.md +3 -3
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product/scenarios → reference/media-types/web-product/patterns}/dashboards.md +2 -2
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product/scenarios → reference/media-types/web-product/patterns}/documentation.md +3 -3
- package/agent-docs/external/kuat-agent-rules/{kuat-docs/rules/types/web/product/scenarios → reference/media-types/web-product/patterns}/forms.md +3 -3
- package/agent-docs/kuat-docs/rules/README.md +37 -30
- package/agent-docs/kuat-docs/rules/design/layouts.md +1 -1
- package/agent-docs/kuat-docs/rules/scenarios/README.md +1 -1
- package/agent-docs/manifest.json +3 -3
- package/agent-docs/rules/LOADING-consumer.md +5 -5
- package/dist/components/ui/carousel/carousel.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/LOADING.md +0 -166
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/content/README.md +0 -28
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/content/formatting.md +0 -93
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/content/numbers.md +0 -69
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/content/punctuation.md +0 -75
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/content/voice-and-tone.md +0 -263
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/design/README.md +0 -28
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/marketing/scenarios/README.md +0 -18
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/DEPRECATIONS.md +0 -28
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/README.md +0 -65
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/review-checklist.md +0 -57
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/review-context.md +0 -44
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/scenarios/README.md +0 -82
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/technical.md +0 -488
|
@@ -1,488 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
scope: type
|
|
3
|
-
platform: web_product
|
|
4
|
-
prerequisites: foundations
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Technical Guidelines
|
|
8
|
-
|
|
9
|
-
Technical setup and integration guide for Equal Experts web applications using the Kuat Design System.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
**Prerequisites:** Load [foundations](../../../foundations/) first.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Quick reference
|
|
18
|
-
|
|
19
|
-
- **Stack:** Application → Kuat Blocks → Kuat custom components → shadcn components → kuat-core (tokens, theme).
|
|
20
|
-
- **Priority:** Prefer Kuat Blocks, then Kuat components, then shadcn; custom build only when none fit.
|
|
21
|
-
- **Setup:** Install `@equal-experts/kuat-core`; preset Tailwind; import `kuat-core/variables.css`; init shadcn (Slate, CSS vars); add components as needed.
|
|
22
|
-
- **Theming:** CSS variables from kuat-core; dark mode via class or media; persist preference in localStorage if needed.
|
|
23
|
-
- **Tokens:** Use Tailwind utilities and CSS variables from design tokens; avoid hardcoded colours/spacing.
|
|
24
|
-
- **Rules (app consumers):** Agent rules are bundled in `@equal-experts/kuat-react` / `kuat-vue` at `agent-docs/` — version matches the installed package. See [consumption-architecture.md](../../../../setup/consumption-architecture.md).
|
|
25
|
-
- **Component usage:** Resolve IDs via [component-registry.md](./component-registry.md); canonical guides in package or overlay `components/`.
|
|
26
|
-
|
|
27
|
-
*Full detail follows.*
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Consumer setup (applications)
|
|
32
|
-
|
|
33
|
-
For step-by-step install in a new app, prefer the **package README** (`@equal-experts/kuat-react`) and bundled `agent-docs/AGENTS.md` after install. This file summarises the stack; duplicate setup prose is intentionally reduced.
|
|
34
|
-
|
|
35
|
-
Override bundled rules with a `kuat-agent-docs` git clone only when you need slides, marketing, or bleeding-edge upstream guidance (`KUAT_RULES_PATH`).
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Overview
|
|
40
|
-
|
|
41
|
-
The Kuat Design System uses a layered architecture:
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
┌─────────────────────────────────────────────────────┐
|
|
45
|
-
│ Your Application │
|
|
46
|
-
├─────────────────────────────────────────────────────┤
|
|
47
|
-
│ Kuat Blocks (Header, Footer, etc.) │ ← From kuat-react/vue
|
|
48
|
-
├─────────────────────────────────────────────────────┤
|
|
49
|
-
│ Kuat Custom Components (ButtonGroup) │ ← From kuat-react/vue
|
|
50
|
-
├─────────────────────────────────────────────────────┤
|
|
51
|
-
│ shadcn Components (Button, Dialog, etc.) │ ← Installed directly
|
|
52
|
-
├─────────────────────────────────────────────────────┤
|
|
53
|
-
│ kuat-core (Design Tokens, Theme) │ ← Foundation
|
|
54
|
-
└─────────────────────────────────────────────────────┘
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
**Component Priority:**
|
|
58
|
-
1. **Kuat Blocks** - Pre-built compositions for common patterns
|
|
59
|
-
2. **Kuat Components** - Custom components not in shadcn (e.g., ButtonGroup)
|
|
60
|
-
3. **shadcn Components** - Standard UI components themed by kuat-core
|
|
61
|
-
4. **Custom Build** - Only when none of the above fit
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## Quick Start (React)
|
|
66
|
-
|
|
67
|
-
### Step 1: Install kuat-core
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
pnpm add @equal-experts/kuat-core
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Step 2: Configure Tailwind CSS
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
// tailwind.config.ts
|
|
77
|
-
import type { Config } from 'tailwindcss';
|
|
78
|
-
import kuatPreset from '@equal-experts/kuat-core';
|
|
79
|
-
|
|
80
|
-
export default {
|
|
81
|
-
presets: [kuatPreset],
|
|
82
|
-
content: [
|
|
83
|
-
'./src/**/*.{js,ts,jsx,tsx}',
|
|
84
|
-
'./node_modules/@equal-experts/kuat-react/**/*.{js,ts,jsx,tsx}',
|
|
85
|
-
],
|
|
86
|
-
} satisfies Config;
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Step 3: Import Design Tokens
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
// main.tsx or App.tsx
|
|
93
|
-
import '@equal-experts/kuat-core/variables.css';
|
|
94
|
-
import './styles.css'; // Your app styles
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Step 4: Initialize shadcn
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
npx shadcn@latest init
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
When prompted, use these settings:
|
|
104
|
-
- Style: Default
|
|
105
|
-
- Base color: Slate
|
|
106
|
-
- CSS variables: Yes
|
|
107
|
-
- Tailwind config: tailwind.config.ts
|
|
108
|
-
- Components path: src/components
|
|
109
|
-
- Utils path: src/lib/utils
|
|
110
|
-
|
|
111
|
-
### Step 5: Install shadcn Components
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
# Install components as needed
|
|
115
|
-
npx shadcn@latest add button
|
|
116
|
-
npx shadcn@latest add dialog
|
|
117
|
-
npx shadcn@latest add dropdown-menu
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Step 6: Install Kuat Custom Components (Optional)
|
|
121
|
-
|
|
122
|
-
If you need Kuat-specific components like ButtonGroup:
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
pnpm add @equal-experts/kuat-react
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
```tsx
|
|
129
|
-
// Only import custom components, not standard ones
|
|
130
|
-
import { ButtonGroup, ButtonGroupText } from '@equal-experts/kuat-react';
|
|
131
|
-
import { Button } from '@/components/ui/button'; // Your shadcn copy
|
|
132
|
-
|
|
133
|
-
function Example() {
|
|
134
|
-
return (
|
|
135
|
-
<ButtonGroup>
|
|
136
|
-
<Button>Option A</Button>
|
|
137
|
-
<Button>Option B</Button>
|
|
138
|
-
<Button>Option C</Button>
|
|
139
|
-
</ButtonGroup>
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## Quick Start (Vue)
|
|
147
|
-
|
|
148
|
-
### Step 1: Install kuat-core
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
pnpm add @equal-experts/kuat-core
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Step 2: Configure Tailwind CSS
|
|
155
|
-
|
|
156
|
-
```typescript
|
|
157
|
-
// tailwind.config.ts
|
|
158
|
-
import type { Config } from 'tailwindcss';
|
|
159
|
-
import kuatPreset from '@equal-experts/kuat-core';
|
|
160
|
-
|
|
161
|
-
export default {
|
|
162
|
-
presets: [kuatPreset],
|
|
163
|
-
content: [
|
|
164
|
-
'./src/**/*.{vue,js,ts}',
|
|
165
|
-
'./node_modules/@equal-experts/kuat-vue/**/*.{vue,js,ts}',
|
|
166
|
-
],
|
|
167
|
-
} satisfies Config;
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### Step 3: Import Design Tokens
|
|
171
|
-
|
|
172
|
-
```typescript
|
|
173
|
-
// main.ts
|
|
174
|
-
import '@equal-experts/kuat-core/variables.css';
|
|
175
|
-
import './style.css';
|
|
176
|
-
import { createApp } from 'vue';
|
|
177
|
-
import App from './App.vue';
|
|
178
|
-
|
|
179
|
-
createApp(App).mount('#app');
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Step 4: Initialize shadcn-vue
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
npx shadcn-vue@latest init
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### Step 5: Install shadcn-vue Components
|
|
189
|
-
|
|
190
|
-
```bash
|
|
191
|
-
npx shadcn-vue@latest add button
|
|
192
|
-
npx shadcn-vue@latest add dialog
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Step 6: Install Kuat Custom Components (Optional)
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
pnpm add @equal-experts/kuat-vue
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
```vue
|
|
202
|
-
<script setup lang="ts">
|
|
203
|
-
import { ButtonGroup, ButtonGroupText } from '@equal-experts/kuat-vue';
|
|
204
|
-
import { Button } from '@/components/ui/button';
|
|
205
|
-
</script>
|
|
206
|
-
|
|
207
|
-
<template>
|
|
208
|
-
<ButtonGroup>
|
|
209
|
-
<Button>Option A</Button>
|
|
210
|
-
<Button>Option B</Button>
|
|
211
|
-
</ButtonGroup>
|
|
212
|
-
</template>
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
## Project Structure
|
|
218
|
-
|
|
219
|
-
After setup, your project should look like:
|
|
220
|
-
|
|
221
|
-
```
|
|
222
|
-
your-project/
|
|
223
|
-
├── src/
|
|
224
|
-
│ ├── components/
|
|
225
|
-
│ │ └── ui/ # shadcn components (installed directly)
|
|
226
|
-
│ │ ├── button.tsx
|
|
227
|
-
│ │ ├── dialog.tsx
|
|
228
|
-
│ │ └── ...
|
|
229
|
-
│ ├── lib/
|
|
230
|
-
│ │ └── utils.ts # cn() utility from shadcn
|
|
231
|
-
│ ├── App.tsx
|
|
232
|
-
│ └── main.tsx
|
|
233
|
-
├── tailwind.config.ts # Uses kuatPreset
|
|
234
|
-
├── components.json # shadcn CLI config
|
|
235
|
-
└── package.json
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
---
|
|
239
|
-
|
|
240
|
-
## Framework Integration Guides
|
|
241
|
-
|
|
242
|
-
### Next.js (App Router)
|
|
243
|
-
|
|
244
|
-
**tailwind.config.ts**
|
|
245
|
-
|
|
246
|
-
```typescript
|
|
247
|
-
import type { Config } from 'tailwindcss';
|
|
248
|
-
import kuatPreset from '@equal-experts/kuat-core';
|
|
249
|
-
|
|
250
|
-
export default {
|
|
251
|
-
presets: [kuatPreset],
|
|
252
|
-
content: [
|
|
253
|
-
'./app/**/*.{js,ts,jsx,tsx,mdx}',
|
|
254
|
-
'./components/**/*.{js,ts,jsx,tsx,mdx}',
|
|
255
|
-
],
|
|
256
|
-
} satisfies Config;
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
**app/layout.tsx**
|
|
260
|
-
|
|
261
|
-
```tsx
|
|
262
|
-
import '@equal-experts/kuat-core/variables.css';
|
|
263
|
-
import './globals.css';
|
|
264
|
-
|
|
265
|
-
export default function RootLayout({
|
|
266
|
-
children,
|
|
267
|
-
}: {
|
|
268
|
-
children: React.ReactNode;
|
|
269
|
-
}) {
|
|
270
|
-
return (
|
|
271
|
-
<html lang="en">
|
|
272
|
-
<body className="bg-background text-foreground min-h-screen">
|
|
273
|
-
{children}
|
|
274
|
-
</body>
|
|
275
|
-
</html>
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
### Vite + React
|
|
281
|
-
|
|
282
|
-
**vite.config.ts**
|
|
283
|
-
|
|
284
|
-
```typescript
|
|
285
|
-
import { defineConfig } from 'vite';
|
|
286
|
-
import react from '@vitejs/plugin-react';
|
|
287
|
-
import tailwindcss from '@tailwindcss/vite';
|
|
288
|
-
|
|
289
|
-
export default defineConfig({
|
|
290
|
-
plugins: [react(), tailwindcss()],
|
|
291
|
-
});
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
**src/main.tsx**
|
|
295
|
-
|
|
296
|
-
```tsx
|
|
297
|
-
import React from 'react';
|
|
298
|
-
import ReactDOM from 'react-dom/client';
|
|
299
|
-
import '@equal-experts/kuat-core/variables.css';
|
|
300
|
-
import './index.css';
|
|
301
|
-
import App from './App';
|
|
302
|
-
|
|
303
|
-
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
304
|
-
<React.StrictMode>
|
|
305
|
-
<App />
|
|
306
|
-
</React.StrictMode>
|
|
307
|
-
);
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
### Vite + Vue
|
|
311
|
-
|
|
312
|
-
**vite.config.ts**
|
|
313
|
-
|
|
314
|
-
```typescript
|
|
315
|
-
import { defineConfig } from 'vite';
|
|
316
|
-
import vue from '@vitejs/plugin-vue';
|
|
317
|
-
import tailwindcss from '@tailwindcss/vite';
|
|
318
|
-
|
|
319
|
-
export default defineConfig({
|
|
320
|
-
plugins: [vue(), tailwindcss()],
|
|
321
|
-
});
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
**src/main.ts**
|
|
325
|
-
|
|
326
|
-
```typescript
|
|
327
|
-
import { createApp } from 'vue';
|
|
328
|
-
import '@equal-experts/kuat-core/variables.css';
|
|
329
|
-
import './style.css';
|
|
330
|
-
import App from './App.vue';
|
|
331
|
-
|
|
332
|
-
createApp(App).mount('#app');
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
---
|
|
336
|
-
|
|
337
|
-
## Theming
|
|
338
|
-
|
|
339
|
-
shadcn components are automatically themed when you:
|
|
340
|
-
|
|
341
|
-
1. Import `@equal-experts/kuat-core/variables.css`
|
|
342
|
-
2. Use the kuat Tailwind preset
|
|
343
|
-
|
|
344
|
-
The CSS variables from kuat-core provide:
|
|
345
|
-
- Brand colors (EE Blue, Transform Teal, etc.)
|
|
346
|
-
- Typography (Lexend, JetBrains Mono, Lora)
|
|
347
|
-
- Spacing scale (8-point grid)
|
|
348
|
-
- Border radius values
|
|
349
|
-
- Light/dark mode support
|
|
350
|
-
|
|
351
|
-
### Dark Mode
|
|
352
|
-
|
|
353
|
-
Apply the `.dark` class to your root element:
|
|
354
|
-
|
|
355
|
-
```tsx
|
|
356
|
-
<html className="dark">
|
|
357
|
-
<body>
|
|
358
|
-
<App />
|
|
359
|
-
</body>
|
|
360
|
-
</html>
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
Or toggle dynamically:
|
|
364
|
-
|
|
365
|
-
```typescript
|
|
366
|
-
document.documentElement.classList.toggle('dark');
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
### Persisting User Preference
|
|
370
|
-
|
|
371
|
-
```typescript
|
|
372
|
-
const THEME_KEY = 'kuat-theme';
|
|
373
|
-
|
|
374
|
-
function initTheme() {
|
|
375
|
-
const saved = localStorage.getItem(THEME_KEY);
|
|
376
|
-
|
|
377
|
-
if (saved === 'dark') {
|
|
378
|
-
document.documentElement.classList.add('dark');
|
|
379
|
-
} else if (saved === 'light') {
|
|
380
|
-
document.documentElement.classList.remove('dark');
|
|
381
|
-
} else {
|
|
382
|
-
// Use system preference
|
|
383
|
-
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
384
|
-
document.documentElement.classList.toggle('dark', prefersDark);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
function setTheme(theme: 'light' | 'dark' | 'system') {
|
|
389
|
-
localStorage.setItem(THEME_KEY, theme);
|
|
390
|
-
|
|
391
|
-
if (theme === 'dark') {
|
|
392
|
-
document.documentElement.classList.add('dark');
|
|
393
|
-
} else if (theme === 'light') {
|
|
394
|
-
document.documentElement.classList.remove('dark');
|
|
395
|
-
} else {
|
|
396
|
-
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
397
|
-
document.documentElement.classList.toggle('dark', prefersDark);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
```
|
|
401
|
-
|
|
402
|
-
---
|
|
403
|
-
|
|
404
|
-
## Design Token Reference
|
|
405
|
-
|
|
406
|
-
### Available CSS Variables
|
|
407
|
-
|
|
408
|
-
```css
|
|
409
|
-
/* Semantic Colors */
|
|
410
|
-
--background, --foreground
|
|
411
|
-
--primary, --primary-foreground
|
|
412
|
-
--secondary, --secondary-foreground
|
|
413
|
-
--muted, --muted-foreground
|
|
414
|
-
--accent, --accent-foreground
|
|
415
|
-
--destructive, --destructive-foreground
|
|
416
|
-
--card, --card-foreground
|
|
417
|
-
--popover, --popover-foreground
|
|
418
|
-
--border, --input, --ring
|
|
419
|
-
|
|
420
|
-
/* Sidebar Colors */
|
|
421
|
-
--sidebar, --sidebar-foreground
|
|
422
|
-
--sidebar-primary, --sidebar-primary-foreground
|
|
423
|
-
--sidebar-accent, --sidebar-accent-foreground
|
|
424
|
-
--sidebar-border, --sidebar-ring
|
|
425
|
-
|
|
426
|
-
/* Brand Colors (full palettes) */
|
|
427
|
-
--ee-blue-50 through --ee-blue-950
|
|
428
|
-
--tech-blue-50 through --tech-blue-950
|
|
429
|
-
--transform-teal-50 through --transform-teal-950
|
|
430
|
-
--equal-ember-50 through --equal-ember-950
|
|
431
|
-
|
|
432
|
-
/* Typography */
|
|
433
|
-
--font-sans, --font-serif, --font-mono
|
|
434
|
-
|
|
435
|
-
/* Layout */
|
|
436
|
-
--radius, --spacing, --tracking-normal
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
### Tailwind Utility Classes
|
|
440
|
-
|
|
441
|
-
```html
|
|
442
|
-
<!-- Colors -->
|
|
443
|
-
<div class="bg-background text-foreground">
|
|
444
|
-
<div class="bg-primary text-primary-foreground">
|
|
445
|
-
<div class="bg-sidebar text-sidebar-foreground">
|
|
446
|
-
<div class="border-border">
|
|
447
|
-
|
|
448
|
-
<!-- Border Radius -->
|
|
449
|
-
<div class="rounded-sm"> <!-- Small -->
|
|
450
|
-
<div class="rounded-md"> <!-- Medium -->
|
|
451
|
-
<div class="rounded-lg"> <!-- Large -->
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
---
|
|
455
|
-
|
|
456
|
-
## Troubleshooting
|
|
457
|
-
|
|
458
|
-
### Components not styled correctly
|
|
459
|
-
|
|
460
|
-
1. Verify `@equal-experts/kuat-core/variables.css` is imported before other styles
|
|
461
|
-
2. Check that `kuatPreset` is in your Tailwind config `presets` array
|
|
462
|
-
3. Ensure shadcn components are in the Tailwind `content` paths
|
|
463
|
-
|
|
464
|
-
### TypeScript errors
|
|
465
|
-
|
|
466
|
-
1. Ensure `@types/react` (React) or `vue` (Vue) are installed
|
|
467
|
-
2. Set `moduleResolution` to `bundler` or `node16` in tsconfig
|
|
468
|
-
|
|
469
|
-
### Dark mode not working
|
|
470
|
-
|
|
471
|
-
1. Verify `.dark` class is applied to `<html>` or a parent element
|
|
472
|
-
2. Check that CSS variables are imported
|
|
473
|
-
|
|
474
|
-
### Build errors
|
|
475
|
-
|
|
476
|
-
1. Check Node version: Requires Node.js 18 or higher
|
|
477
|
-
2. Verify package versions: Ensure Tailwind CSS v4 is installed
|
|
478
|
-
3. Clear caches: Run `rm -rf node_modules && pnpm install`
|
|
479
|
-
|
|
480
|
-
---
|
|
481
|
-
|
|
482
|
-
## Related Documentation
|
|
483
|
-
|
|
484
|
-
- [Design Rules](./design.md) - Layout and visual design
|
|
485
|
-
- [Component Decision Tree](./component-decision-tree.md) - Component selection
|
|
486
|
-
- [Component registry](./component-registry.md) - Stable IDs → package/overlay guides
|
|
487
|
-
- [consumption-architecture.md](../../../../setup/consumption-architecture.md) - Entry points and npm bundling
|
|
488
|
-
- [Examples](./examples/) - Illustrative patterns only ([DEPRECATIONS.md](./DEPRECATIONS.md))
|