@equal-experts/kuat-react 0.2.3 → 0.2.5

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/docs/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Agent Documentation
2
+
3
+ This directory contains AI-friendly documentation for the Kuat Design System React library.
4
+
5
+ ## Contents
6
+
7
+ - **[Design System](./design/)** - Colors, typography, spacing, borders
8
+ - [Colours](./design/colours.md) - Brand colors and usage guidelines
9
+ - [Typography](./design/typography.md) - Font scales and text styling
10
+ - [Spacing](./design/spacing.md) - Spacing system and patterns
11
+ - [Borders](./design/borders.md) - Border usage and specifications
12
+ - [Design System Overview](./design/design-system.md) - Complete design system guide
13
+
14
+ - **[Component Guidelines](./components/guidelines.md)** - Component development patterns and best practices
15
+
16
+ - **[Content Guidelines](./content/)** - Content writing guidelines
17
+ - [Content Foundations](./content/content-foundations.md) - Universal content principles
18
+ - [Marketing & Sales](./content/content-marketing-sales.md) - Marketing content guidelines
19
+ - [Product & UX](./content/content-product-ux.md) - Product interface writing
20
+
21
+ ## Purpose
22
+
23
+ These docs are optimized for LLM consumption and provide context for:
24
+ - Understanding the design system
25
+ - Using components correctly
26
+ - Maintaining brand consistency
27
+ - Writing appropriate content
28
+
29
+ ## Version
30
+
31
+ These docs are synchronized with @equal-experts/kuat-react.
32
+
33
+ ## Source
34
+
35
+ Documentation is sourced from the [Kuat monorepo](https://github.com/equal-experts/kuat) and copied during the build process.
@@ -0,0 +1,221 @@
1
+ # Component Development Guidelines
2
+
3
+ ## Adding New Components
4
+
5
+ ### React Components
6
+
7
+ 1. **Install via CLI** (recommended):
8
+ ```bash
9
+ cd packages/kuat-react
10
+ npx shadcn@latest add button
11
+ ```
12
+
13
+ 2. **Manual Installation**:
14
+ - Copy component files to `src/components/ui/[component-name]/`
15
+ - Ensure all dependencies are installed
16
+ - Export from `src/index.ts`
17
+
18
+ ### Vue Components
19
+
20
+ 1. **Install via CLI** (recommended):
21
+ ```bash
22
+ cd packages/kuat-vue
23
+ npx shadcn-vue@latest add button
24
+ ```
25
+
26
+ 2. **Manual Installation**:
27
+ - Copy component files to `src/components/ui/[component-name]/`
28
+ - Ensure all dependencies are installed
29
+ - Export from `src/index.ts`
30
+
31
+ ## Component Structure
32
+
33
+ ### React Component Example
34
+
35
+ ```tsx
36
+ // src/components/ui/button.tsx
37
+ import * as React from "react"
38
+ import { cva, type VariantProps } from "class-variance-authority"
39
+ import { cn } from "@/lib/utils"
40
+
41
+ const buttonVariants = cva(
42
+ "inline-flex items-center justify-center rounded-md text-sm font-medium",
43
+ {
44
+ variants: {
45
+ variant: {
46
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
47
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
48
+ // ...
49
+ },
50
+ size: {
51
+ default: "h-10 px-4 py-2",
52
+ sm: "h-9 rounded-md px-3",
53
+ lg: "h-11 rounded-md px-8",
54
+ // ...
55
+ },
56
+ },
57
+ defaultVariants: {
58
+ variant: "default",
59
+ size: "default",
60
+ },
61
+ }
62
+ )
63
+
64
+ export interface ButtonProps
65
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
66
+ VariantProps<typeof buttonVariants> {}
67
+
68
+ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
69
+ ({ className, variant, size, ...props }, ref) => {
70
+ return (
71
+ <button
72
+ className={cn(buttonVariants({ variant, size, className }))}
73
+ ref={ref}
74
+ {...props}
75
+ />
76
+ )
77
+ }
78
+ )
79
+ Button.displayName = "Button"
80
+
81
+ export { Button, buttonVariants }
82
+ ```
83
+
84
+ ### Vue Component Example
85
+
86
+ ```vue
87
+ <!-- src/components/ui/button/Button.vue -->
88
+ <script setup lang="ts">
89
+ import { computed } from "vue"
90
+ import { cva, type VariantProps } from "class-variance-authority"
91
+ import { cn } from "@/lib/utils"
92
+
93
+ const buttonVariants = cva(/* same as React */)
94
+
95
+ interface Props extends VariantProps<typeof buttonVariants> {
96
+ // additional props
97
+ }
98
+
99
+ const props = withDefaults(defineProps<Props>(), {
100
+ variant: "default",
101
+ size: "default",
102
+ })
103
+
104
+ const classes = computed(() =>
105
+ cn(buttonVariants({ variant: props.variant, size: props.size }))
106
+ )
107
+ </script>
108
+
109
+ <template>
110
+ <button :class="classes" v-bind="$attrs">
111
+ <slot />
112
+ </button>
113
+ </template>
114
+ ```
115
+
116
+ ## Component Requirements
117
+
118
+ ### 1. TypeScript Types
119
+ - All props must be typed
120
+ - Use `VariantProps` for variant-based props
121
+ - Export component types for consumers
122
+
123
+ ### 2. Styling
124
+ - Use Tailwind CSS classes
125
+ - Reference design tokens via CSS variables
126
+ - Use `cn()` for className merging
127
+ - Support variants via `class-variance-authority`
128
+
129
+ ### 3. Accessibility
130
+ - Use semantic HTML
131
+ - Include proper ARIA attributes
132
+ - Support keyboard navigation
133
+ - Test with screen readers
134
+
135
+ ### 4. Exports
136
+ - Export component from package `index.ts`
137
+ - Export types and variants if needed
138
+ - Document component usage
139
+
140
+ ## Variant Patterns
141
+
142
+ ### Using class-variance-authority
143
+
144
+ ```ts
145
+ import { cva } from "class-variance-authority"
146
+
147
+ const componentVariants = cva(
148
+ "base-classes", // Always applied
149
+ {
150
+ variants: {
151
+ variant: {
152
+ default: "variant-classes",
153
+ alternative: "other-classes",
154
+ },
155
+ size: {
156
+ sm: "size-sm-classes",
157
+ md: "size-md-classes",
158
+ lg: "size-lg-classes",
159
+ },
160
+ },
161
+ defaultVariants: {
162
+ variant: "default",
163
+ size: "md",
164
+ },
165
+ }
166
+ )
167
+ ```
168
+
169
+ ## Testing Components
170
+
171
+ When creating components, ensure:
172
+ 1. ✅ All variants work correctly
173
+ 2. ✅ Types are properly exported
174
+ 3. ✅ Component builds without errors
175
+ 4. ✅ Styles match design tokens
176
+ 5. ✅ Accessibility features work
177
+
178
+ ## Naming Conventions
179
+
180
+ - **Components**: PascalCase (e.g., `Button`, `Card`, `Dialog`)
181
+ - **Files**: Match component name (e.g., `Button.tsx`, `Button.vue`)
182
+ - **Variants**: camelCase (e.g., `default`, `destructive`, `outline`)
183
+ - **Props**: camelCase (e.g., `variant`, `size`, `disabled`)
184
+
185
+ ## Common Patterns
186
+
187
+ ### Forwarding Refs (React)
188
+ ```tsx
189
+ const Component = React.forwardRef<HTMLElement, Props>(
190
+ ({ className, ...props }, ref) => {
191
+ return <element ref={ref} className={cn(classes, className)} {...props} />
192
+ }
193
+ )
194
+ Component.displayName = "Component"
195
+ ```
196
+
197
+ ### Slot Usage (Vue)
198
+ ```vue
199
+ <template>
200
+ <div>
201
+ <slot name="header" />
202
+ <slot />
203
+ <slot name="footer" />
204
+ </div>
205
+ </template>
206
+ ```
207
+
208
+ ### Conditional Rendering
209
+ ```tsx
210
+ // React
211
+ {condition && <Component />}
212
+ {condition ? <ComponentA /> : <ComponentB />}
213
+ ```
214
+
215
+ ```vue
216
+ <!-- Vue -->
217
+ <Component v-if="condition" />
218
+ <ComponentA v-if="condition" />
219
+ <ComponentB v-else />
220
+ ```
221
+
@@ -0,0 +1,297 @@
1
+ # Kuat Design System Content Guide
2
+
3
+ **Version:** 1.0 | **Last Updated:** December 2024
4
+
5
+ ---
6
+
7
+ ## Welcome
8
+
9
+ This is the master guide to creating content for the Kuat Design System. Our content guidelines are split into three specialized documents to make them easier to use and maintain.
10
+
11
+ ---
12
+
13
+ ## Getting Started
14
+
15
+ ### 🆕 New to Content Creation?
16
+
17
+ **Start here:**
18
+
19
+ 1. **Read** [`content-foundations.md`](./content-foundations.md) - Universal principles that apply to ALL content
20
+ 2. **Choose your specialization:**
21
+ - Creating marketing, sales, or knowledge content? → [`content-marketing-sales.md`](./content-marketing-sales.md)
22
+ - Writing product UI copy or UX content? → [`content-product-ux.md`](./content-product-ux.md)
23
+
24
+ **All content must align with the foundations.**
25
+
26
+ ---
27
+
28
+ ## Quick Navigation
29
+
30
+ ### I'm Creating...
31
+
32
+ **External-facing content:**
33
+ - Case study → [Marketing guide § Case Studies](./content-marketing-sales.md#case-studies)
34
+ - Blog post → [Marketing guide § Blogs](./content-marketing-sales.md#blogs-external--internal)
35
+ - Playbook or whitepaper → [Marketing guide § Playbooks](./content-marketing-sales.md#playbooks-and-informative-content)
36
+ - Pitch deck → [Marketing guide § Pitch Decks](./content-marketing-sales.md#pitch-decks-and-sales-materials)
37
+ - Social media post → [Marketing guide § Social Media](./content-marketing-sales.md#social-media-external--internal)
38
+
39
+ **Product interface content:**
40
+ - Button label → [Product guide § Actions](./content-product-ux.md#actions-buttons-and-links)
41
+ - Error message → [Product guide § Errors](./content-product-ux.md#errors)
42
+ - Form field → [Product guide § Fields](./content-product-ux.md#fields-forms)
43
+ - Empty state → [Product guide § Empty States](./content-product-ux.md#empty-states)
44
+ - Confirmation dialog → [Product guide § Confirmations](./content-product-ux.md#confirmations)
45
+
46
+ **Internal content:**
47
+ - Internal blog post → [Marketing guide § Internal Communications](./content-marketing-sales.md#internal-communications)
48
+ - Knowledge portal article → [Marketing guide § Internal Communications](./content-marketing-sales.md#internal-communications)
49
+
50
+ ---
51
+
52
+ ### I Need Help With...
53
+
54
+ **Brand and voice:**
55
+ - Core voice principles → [Foundations § Content Voice and Tone](./content-foundations.md#content-voice-and-tone)
56
+ - Tone adaptation → [Foundations § Tone Adaptation Guide](./content-foundations.md#tone-adaptation-guide)
57
+
58
+ **Audience:**
59
+ - Audience targeting → [Foundations § Audience Considerations](./content-foundations.md#audience-considerations)
60
+ - Technical audiences → [Foundations § Technical Audiences](./content-foundations.md#technical-audiences)
61
+ - Business stakeholders → [Foundations § Business Stakeholders](./content-foundations.md#business-stakeholders)
62
+
63
+ **Quality and testing:**
64
+ - Quality checklist → [Foundations § Content Quality Checklist](./content-foundations.md#content-quality-checklist)
65
+ - Common mistakes → [Foundations § Common Anti-Patterns](./content-foundations.md#common-anti-patterns-to-avoid)
66
+ - Testing approach → [Product guide § Test Everything](./content-product-ux.md#5-test-everything)
67
+
68
+ **Writing mechanics:**
69
+ - Grammar and style → [Marketing guide § Writing Best Practices](./content-marketing-sales.md#writing-best-practices)
70
+ - Accessibility → [Product guide § Make It Accessible](./content-product-ux.md#6-make-it-accessible)
71
+
72
+ ---
73
+
74
+ ## The Three Guides
75
+
76
+ ### 📘 Content Foundations
77
+ **File:** [`content-foundations.md`](./content-foundations.md)
78
+
79
+ **Universal guidelines that apply to ALL Kuat Design System content**
80
+
81
+ What's inside:
82
+ - Core voice principles and characteristics
83
+ - Universal content principles
84
+ - Audience considerations
85
+ - Common anti-patterns to avoid
86
+ - Quality tests and checklists
87
+ - Tone adaptation guidance
88
+ - AI content generation guidelines
89
+
90
+ **Who should read this:** Everyone creating content for the Kuat Design System
91
+
92
+ **When to read it:** Before creating any content, and as reference throughout
93
+
94
+ ---
95
+
96
+ ### 📗 Marketing, Sales & Knowledge Content
97
+ **File:** [`content-marketing-sales.md`](./content-marketing-sales.md)
98
+
99
+ **Guidelines for external-facing content that builds awareness and demonstrates expertise**
100
+
101
+ What's inside:
102
+ - Case studies
103
+ - Blogs (external & internal)
104
+ - Playbooks and whitepapers
105
+ - Pitch decks and sales materials
106
+ - Social media content
107
+ - Internal communications
108
+ - Web copy and email marketing
109
+ - Writing best practices
110
+
111
+ **Who should read this:** Marketers, content writers, business development, PR, consultants sharing knowledge
112
+
113
+ **When to read it:** When creating content for external audiences or internal knowledge sharing
114
+
115
+ ---
116
+
117
+ ### 📙 Product & UX Writing
118
+ **File:** [`content-product-ux.md`](./content-product-ux.md)
119
+
120
+ **Practical guide for writing content inside product interfaces**
121
+
122
+ What's inside:
123
+ - Product voice adaptation
124
+ - Foundational principles (audience, task focus, conciseness)
125
+ - Content patterns (buttons, errors, forms, empty states)
126
+ - Mobile considerations
127
+ - Accessibility requirements
128
+ - Testing and iteration
129
+ - Collaboration with designers and developers
130
+
131
+ **Who should read this:** UX writers, product designers, product managers, developers
132
+
133
+ **When to read it:** When creating any content that appears inside a product interface
134
+
135
+ ---
136
+
137
+ ## For AI Agents
138
+
139
+ ### Context Loading Order
140
+
141
+ 1. **Always load first:** [`content-foundations.md`](./content-foundations.md)
142
+ 2. **Then load specialized guide based on content type:**
143
+ - Marketing/sales content → [`content-marketing-sales.md`](./content-marketing-sales.md)
144
+ - Product/UX content → [`content-product-ux.md`](./content-product-ux.md)
145
+ 3. **Reference specific sections as needed**
146
+
147
+ ### Content Type Routing
148
+
149
+ **If user requests:**
150
+ - "case study" → Load foundations + marketing guide
151
+ - "blog post" → Load foundations + marketing guide
152
+ - "button label" → Load foundations + product guide
153
+ - "error message" → Load foundations + product guide
154
+ - "social media post" → Load foundations + marketing guide
155
+ - "tooltip" → Load foundations + product guide
156
+ - "pitch deck" → Load foundations + marketing guide
157
+ - "form field label" → Load foundations + product guide
158
+ - "empty state" → Load foundations + product guide
159
+ - "confirmation dialog" → Load foundations + product guide
160
+ - "playbook" → Load foundations + marketing guide
161
+ - "whitepaper" → Load foundations + marketing guide
162
+
163
+ **If uncertain:**
164
+ - Ask clarifying questions about content type and audience
165
+ - Default to loading foundations only
166
+ - Load specialized guide once content type is clear
167
+
168
+ ### Decision Tree: Which Guide Do I Need?
169
+
170
+ **START:** What are you creating?
171
+
172
+ **Is this content inside a product interface?**
173
+ - YES → [`content-product-ux.md`](./content-product-ux.md)
174
+ - NO → Continue
175
+
176
+ **Is this content for external audiences about our work/expertise?**
177
+ - YES → [`content-marketing-sales.md`](./content-marketing-sales.md)
178
+ - NO → Continue
179
+
180
+ **Is this internal team communication or documentation?**
181
+ - YES → [`content-marketing-sales.md`](./content-marketing-sales.md) (Internal sections)
182
+ - NO → Continue
183
+
184
+ **Still unsure?**
185
+ - Start with foundations document
186
+ - Ask: "Who is the audience and what's the purpose?"
187
+ - Reference the Audience Considerations in foundations
188
+
189
+ ### Quality Checks for AI
190
+
191
+ **Before generating content, verify:**
192
+ 1. ✅ Content type and audience identified
193
+ 2. ✅ Appropriate guide(s) loaded
194
+ 3. ✅ Universal principles from foundations applied
195
+ 4. ✅ Content type-specific guidelines followed
196
+
197
+ **After generating content, check:**
198
+ 1. ✅ Passes quality tests from foundations
199
+ 2. ✅ No anti-patterns present
200
+ 3. ✅ Tone appropriate for audience and context
201
+ 4. ✅ Evidence supports all claims (for marketing content)
202
+ 5. ✅ Concise and action-oriented (for product content)
203
+
204
+ ---
205
+
206
+ ## Document Structure
207
+
208
+ ```
209
+ 📁 Kuat Design System Content Guides
210
+ ├── 📄 README.md (this file)
211
+ │ └── Master index and navigation
212
+
213
+ ├── 📄 content-foundations.md
214
+ │ └── Universal principles (ALL content)
215
+ │ ├── Voice principles
216
+ │ ├── Content principles
217
+ │ ├── Audience considerations
218
+ │ ├── Anti-patterns
219
+ │ ├── Quality tests
220
+ │ └── Tone guidance
221
+
222
+ ├── 📄 content-marketing-sales.md
223
+ │ └── External-facing content
224
+ │ ├── Case studies
225
+ │ ├── Blogs
226
+ │ ├── Playbooks
227
+ │ ├── Pitch decks
228
+ │ ├── Social media
229
+ │ ├── Internal comms
230
+ │ └── Writing best practices
231
+
232
+ └── 📄 content-product-ux.md
233
+ └── Product interface content
234
+ ├── Voice adaptation
235
+ ├── Core principles
236
+ ├── Content patterns
237
+ ├── Mobile guidelines
238
+ ├── Accessibility
239
+ └── Testing approach
240
+ ```
241
+
242
+ ---
243
+
244
+ ## Key Principles (Summary)
245
+
246
+ ### The Kuat Design System Voice
247
+
248
+ **We are:**
249
+ - Clear, direct, and helpful
250
+ - Confident but never arrogant
251
+ - Focused on user needs
252
+ - Consistent and predictable
253
+
254
+ **We are not:**
255
+ - Vague or ambiguous
256
+ - Overly formal or stuffy
257
+ - Marketing-heavy in product UI
258
+ - Technical without clarity
259
+
260
+ ### The Content Formula
261
+
262
+ **For marketing content:**
263
+ `[Clear value] + [specific context] + [evidence/examples] + [actionable takeaways]`
264
+
265
+ **For product content:**
266
+ `[Action] + [Object] + [Benefit if needed]`
267
+
268
+ ### Quality Tests
269
+
270
+ Every piece of content should pass:
271
+ 1. **The Clarity Test** - Can it be understood quickly?
272
+ 2. **The Purpose Test** - Does it serve a clear user need?
273
+ 3. **The Consistency Test** - Does it match our voice?
274
+ 4. **The Accessibility Test** - Does it work for all users?
275
+ 5. **The Context Test** - Is it appropriate for the situation?
276
+
277
+ ---
278
+
279
+ ## Additional Resources
280
+
281
+ - **Design System Overview:** See [../design/design-system.md](../design/design-system.md) for design token usage
282
+ - **Typography Guide:** See [../design/typography.md](../design/typography.md) for text styling
283
+ - **Component Guidelines:** See [../technical/component-guidelines.md](../technical/component-guidelines.md) for component patterns
284
+ - **Usage Guide:** See [../usage-guide.md](../usage-guide.md) for quick reference
285
+
286
+ ---
287
+
288
+ ## What's Next?
289
+
290
+ 1. **Read the foundations** → [`content-foundations.md`](./content-foundations.md)
291
+ 2. **Pick your specialization** → Marketing or Product guide
292
+ 3. **Start creating** → Apply the principles
293
+ 4. **Test and iterate** → Learn from real users
294
+ 5. **Share learnings** → Help improve these guides
295
+
296
+ Welcome to content creation for the Kuat Design System. Let's create great content together! 🚀
297
+