Skip to content

Commit 7c4c1ad

Browse files
committed
style: format and fix docs
1 parent 95a4093 commit 7c4c1ad

File tree

74 files changed

+245
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+245
-225
lines changed

.claude/docs/development.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ bun run svelte dev # Port 6006
115115
### Component Development Process
116116

117117
1. **Component Structure Setup:**
118+
118119
```bash
119120
packages/{framework}/src/components/{component-name}/
120121
├── index.{tsx,ts} # Main export file
@@ -132,6 +133,7 @@ bun run svelte dev # Port 6006
132133
```
133134

134135
2. **Anatomy Definition (Required):**
136+
135137
```ts
136138
// {component}.anatomy.ts
137139
import { createAnatomy } from '@zag-js/anatomy'
@@ -155,6 +157,7 @@ bun run svelte dev # Port 6006
155157
### Story File Requirements
156158

157159
**Naming Convention:**
160+
158161
```ts
159162
// {component}.stories.{tsx,vue,svelte}
160163
export default {
@@ -167,6 +170,7 @@ export const WithField = () => ({ ... })
167170
```
168171

169172
**Story Categories:**
173+
170174
- **Basic**: Default component usage
171175
- **Controlled**: External state management
172176
- **Variants**: Different visual styles
@@ -176,11 +180,13 @@ export const WithField = () => ({ ... })
176180
### Example Development Guidelines
177181

178182
**Example Naming Requirements:**
183+
179184
- Use descriptive, consistent names across frameworks
180185
- Follow existing patterns from similar components
181186
- Include common scenarios (basic, controlled, disabled, invalid)
182187

183188
**Framework Consistency:**
189+
184190
```bash
185191
# All frameworks should have equivalent examples
186192
packages/react/src/components/field/examples/controlled.tsx
@@ -190,13 +196,15 @@ packages/svelte/src/lib/components/field/examples/controlled.svelte
190196
```
191197

192198
**Example Documentation:**
199+
193200
- Update `COMPONENT_EXAMPLES_DIFF.md` when adding examples
194201
- Include description of what the example demonstrates
195202
- Note framework-specific implementation details
196203

197204
### Type System Requirements
198205

199206
**Required Type Exports:**
207+
200208
```ts
201209
// Every component part must export both BaseProps and Props
202210
export interface ComponentRootBaseProps extends UseComponentProps, PolymorphicProps {}
@@ -210,6 +218,7 @@ export type RootEmits = { ... }
210218
### Quality Checklist
211219
212220
**Before Component Completion:**
221+
213222
- [ ] Anatomy file created and exported
214223
- [ ] All component parts have BaseProps and Props types
215224
- [ ] Context provider implemented
@@ -220,6 +229,7 @@ export type RootEmits = { ... }
220229
- [ ] `COMPONENT_EXAMPLES_DIFF.md` updated
221230
222231
**Before Release:**
232+
223233
- [ ] All frameworks have equivalent functionality
224234
- [ ] Examples work identically across frameworks
225235
- [ ] Types generated for website documentation
@@ -228,7 +238,8 @@ export type RootEmits = { ... }
228238
229239
## Website Development
230240
231-
The Ark UI documentation website is built with Next.js and uses several key patterns for content management and documentation generation.
241+
The Ark UI documentation website is built with Next.js and uses several key patterns for content management and
242+
documentation generation.
232243
233244
### Website Structure
234245
@@ -424,4 +435,4 @@ bun run web build
424435

425436
# Generate content (Velite)
426437
bun run web prepare
427-
```
438+
```

.claude/docs/documentation-patterns.md

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ Non-interactive guides with code snippets.
5555
### Examples vs Guides
5656

5757
**Examples Section** - Interactive demos with `<Example id="..." />`:
58+
5859
- Show component behavior through working demos
5960
- Framework-agnostic (shown for all frameworks via tabs)
6061
- Each example has a brief description
6162

6263
**Guides Section** - Non-interactive implementation guidance:
64+
6365
- CSS styling patterns and animations
6466
- Integration guides (Next.js, Remix, router setup)
6567
- Advanced configuration and type safety patterns
@@ -119,11 +121,7 @@ To create a controlled component, manage the state using the `value` and `onValu
119121

120122
The following CSS variables are exposed to the `Component.Positioner`:
121123

122-
\`\`\`css
123-
--reference-width: <pixel-value>;
124-
--available-width: <pixel-value>;
125-
--available-height: <pixel-value>;
126-
\`\`\`
124+
\`\`\`css --reference-width: <pixel-value>; --available-width: <pixel-value>; --available-height: <pixel-value>; \`\`\`
127125
```
128126

129127
### CSS Animations
@@ -133,11 +131,7 @@ The following CSS variables are exposed to the `Component.Positioner`:
133131

134132
Use the `--height` CSS variable to animate content:
135133

136-
\`\`\`css
137-
@keyframes slideDown {
138-
to { height: var(--height); }
139-
}
140-
\`\`\`
134+
\`\`\`css @keyframes slideDown { to { height: var(--height); } } \`\`\`
141135
```
142136

143137
### Framework Integration
@@ -147,11 +141,7 @@ Use the `--height` CSS variable to animate content:
147141

148142
Here's an example using `next/image`:
149143

150-
\`\`\`tsx
151-
import { Component } from '@ark-ui/react/component'
152-
import { getImageProps } from 'next/image'
153-
// ...
154-
\`\`\`
144+
\`\`\`tsx import { Component } from '@ark-ui/react/component' import { getImageProps } from 'next/image' // ... \`\`\`
155145
```
156146

157147
### Router Integration
@@ -164,9 +154,7 @@ Control active state based on URL:
164154
- Set `value` prop to current URL path
165155
- Listen to `onValueChange` and update URL
166156

167-
\`\`\`tsx
168-
// Remix Router example
169-
\`\`\`
157+
\`\`\`tsx // Remix Router example \`\`\`
170158
```
171159

172160
## Formatting
@@ -176,13 +164,9 @@ Control active state based on URL:
176164
Specify language for syntax highlighting:
177165

178166
```markdown
179-
\`\`\`tsx
180-
// TypeScript code
181-
\`\`\`
167+
\`\`\`tsx // TypeScript code \`\`\`
182168

183-
\`\`\`css
184-
/* CSS code */
185-
\`\`\`
169+
\`\`\`css /_ CSS code _/ \`\`\`
186170
```
187171

188172
### Notes and Warnings
@@ -225,17 +209,13 @@ Use kebab-case, descriptive IDs:
225209

226210
## Common Mistakes
227211

228-
❌ Don't include CSS examples in Examples section
229-
✅ Move CSS examples to Guides
212+
❌ Don't include CSS examples in Examples section ✅ Move CSS examples to Guides
230213

231-
❌ Don't include router integration in Examples
232-
✅ Move integration guides to Guides
214+
❌ Don't include router integration in Examples ✅ Move integration guides to Guides
233215

234-
❌ Don't write generic descriptions
235-
✅ Write specific descriptions explaining props/features
216+
❌ Don't write generic descriptions ✅ Write specific descriptions explaining props/features
236217

237-
❌ Don't use code blocks without `<Example>` tags in Examples
238-
✅ Use `<Example>` tags or move to Guides
218+
❌ Don't use code blocks without `<Example>` tags in Examples ✅ Use `<Example>` tags or move to Guides
239219

240220
## Adding to Showcase
241221

@@ -246,6 +226,7 @@ Add projects/design systems built with Ark UI to `website/src/content/showcases.
246226
- Or capture screenshot with Playwright using `networkidle` and `viewport: { width: 1200, height: 630 }`
247227

248228
2. **Add entry** to `showcases.json`:
229+
249230
```json
250231
{
251232
"title": "Project Name",

.claude/docs/framework_patterns.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ When using icons from Lucide in examples, follow these framework-specific import
1212
import { XIcon } from 'lucide-react'
1313

1414
// Usage
15-
<TagsInput.ItemDeleteTrigger>
15+
;<TagsInput.ItemDeleteTrigger>
1616
<XIcon />
1717
</TagsInput.ItemDeleteTrigger>
1818
```
@@ -23,7 +23,7 @@ import { XIcon } from 'lucide-react'
2323
import { XIcon } from 'lucide-solid'
2424

2525
// Usage
26-
<TagsInput.ItemDeleteTrigger>
26+
;<TagsInput.ItemDeleteTrigger>
2727
<XIcon />
2828
</TagsInput.ItemDeleteTrigger>
2929
```
@@ -55,6 +55,7 @@ import { XIcon } from 'lucide-vue-next'
5555
```
5656

5757
**Icon Naming Convention:**
58+
5859
- Always import icons with the `Icon` suffix (e.g., `XIcon`, `CheckIcon`, `ChevronDownIcon`)
5960
- Use the full icon name directly from Lucide (don't rename with `as`)
6061
- This maintains consistency across all framework examples
@@ -97,15 +98,18 @@ Solid.js uses the `<Show>` component for conditional rendering instead of boolea
9798
import { Show } from 'solid-js'
9899

99100
// Preferred: Use Show component
100-
<Show when={isVisible()}>
101+
;<Show when={isVisible()}>
101102
<div>Content to show conditionally</div>
102103
</Show>
103104

104105
// Avoid: Boolean expression rendering
105-
{isVisible() && <div>Content</div>}
106+
{
107+
isVisible() && <div>Content</div>
108+
}
106109
```
107110

108111
**Benefits of `<Show>`:**
112+
109113
- Better performance with reactive updates
110114
- Proper cleanup of nested reactive computations
111115
- More explicit conditional rendering semantics
@@ -161,14 +165,15 @@ useForwardExpose() // Handles complex ref forwarding
161165

162166
## asChild Pattern Implementation
163167

164-
The `asChild` pattern allows replacing a component's root element with a custom element while preserving the component's functionality and props. Each framework implements this pattern differently.
168+
The `asChild` pattern allows replacing a component's root element with a custom element while preserving the component's
169+
functionality and props. Each framework implements this pattern differently.
165170

166171
### React asChild Pattern
167172

168173
```tsx
169174
import { Menu } from '@ark-ui/react/menu'
170175

171-
<Menu.Item value="docs" asChild>
176+
;<Menu.Item value="docs" asChild>
172177
<a href="https://ark-ui.com">Documentation</a>
173178
</Menu.Item>
174179
```
@@ -183,7 +188,14 @@ import { Menu } from '@ark-ui/react/menu'
183188
```tsx
184189
import { Menu } from '@ark-ui/solid/menu'
185190

186-
<Menu.Item value="docs" asChild={(itemProps) => <a href="https://ark-ui.com" {...itemProps()}>Documentation</a>} />
191+
;<Menu.Item
192+
value="docs"
193+
asChild={(itemProps) => (
194+
<a href="https://ark-ui.com" {...itemProps()}>
195+
Documentation
196+
</a>
197+
)}
198+
/>
187199
```
188200

189201
- **Type**: `(props: PropsFn) => JSX.Element`
@@ -231,12 +243,12 @@ import { Menu } from '@ark-ui/vue/menu'
231243

232244
### asChild Pattern Summary
233245

234-
| Framework | Prop Name | Prop Type | Usage Pattern |
235-
|-----------|-----------|-----------|---------------|
236-
| **React** | `asChild` | `boolean` | Boolean flag with children wrapping |
237-
| **Solid** | `asChild` | `(props: PropsFn) => JSX.Element` | Function that receives props function |
238-
| **Vue** | `as-child` | `boolean` | Boolean flag (kebab-case in templates) |
239-
| **Svelte** | `asChild` | `Snippet<[PropsFn]>` | Snippet/template slot with props function |
246+
| Framework | Prop Name | Prop Type | Usage Pattern |
247+
| ---------- | ---------- | --------------------------------- | ----------------------------------------- |
248+
| **React** | `asChild` | `boolean` | Boolean flag with children wrapping |
249+
| **Solid** | `asChild` | `(props: PropsFn) => JSX.Element` | Function that receives props function |
250+
| **Vue** | `as-child` | `boolean` | Boolean flag (kebab-case in templates) |
251+
| **Svelte** | `asChild` | `Snippet<[PropsFn]>` | Snippet/template slot with props function |
240252

241253
### Common Use Cases for asChild
242254

@@ -588,9 +600,11 @@ Svelte requires proper closing tags for non-void HTML elements to avoid ambiguit
588600
```
589601

590602
**Non-void elements that require closing tags:**
603+
591604
- `<textarea>`, `<div>`, `<span>`, `<button>`, `<a>`, `<form>`, etc.
592605

593606
**Void elements that can be self-closing:**
607+
594608
- `<input>`, `<img>`, `<br>`, `<hr>`, `<meta>`, `<link>`, etc.
595609

596610
## Framework-Specific Utilities

.claude/docs/overview.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Ark UI - Project Overview
22

3-
Ark UI is a headless component library for building scalable Design Systems across React, Solid, Svelte, and Vue. Built on top of Zag.js state machines, it provides unstyled, accessible UI components.
3+
Ark UI is a headless component library for building scalable Design Systems across React, Solid, Svelte, and Vue. Built
4+
on top of Zag.js state machines, it provides unstyled, accessible UI components.
45

56
## Project Structure
67

@@ -19,7 +20,8 @@ ark/
1920

2021
## Available Components
2122

22-
- **Form Controls**: Checkbox, Field, Fieldset, Number Input, Password Input, Pin Input, Radio Group, Select, Switch, Tags Input
23+
- **Form Controls**: Checkbox, Field, Fieldset, Number Input, Password Input, Pin Input, Radio Group, Select, Switch,
24+
Tags Input
2325
- **Data Display**: Avatar, Progress, Rating Group, Signature Pad, Toast, Tree View
2426
- **Navigation**: Menu, Pagination, Tabs, Tour
2527
- **Layout**: Accordion, Collapsible, Splitter
@@ -39,7 +41,8 @@ ark/
3941

4042
## Example Development Status
4143

42-
The project tracks component example consistency across frameworks in `COMPONENT_EXAMPLES_DIFF.md`. Key areas needing attention:
44+
The project tracks component example consistency across frameworks in `COMPONENT_EXAMPLES_DIFF.md`. Key areas needing
45+
attention:
4346

4447
### Priority Areas
4548

@@ -69,7 +72,8 @@ When designing components and APIs, we draw inspiration from these leading headl
6972
- **[Base UI](https://mui.com/base-ui/)** - MUI's headless component library with excellent accessibility patterns
7073
- **[Reka UI](https://reka-ui.com/)** - Vue-focused headless components with clean API design
7174
- **[Radix UI](https://radix-ui.com/)** - React primitives with exceptional accessibility and developer experience
72-
- **[React Spectrum](https://react-spectrum.adobe.com/)** - Adobe's design system with robust accessibility and internationalization
75+
- **[React Spectrum](https://react-spectrum.adobe.com/)** - Adobe's design system with robust accessibility and
76+
internationalization
7377

7478
**What to Learn:**
7579

@@ -93,4 +97,4 @@ When designing components and APIs, we draw inspiration from these leading headl
9397
3. Include Storybook stories for components
9498
4. Write tests for component behavior
9599
5. Ensure accessibility compliance
96-
6. Update `COMPONENT_EXAMPLES_DIFF.md` when adding examples
100+
6. Update `COMPONENT_EXAMPLES_DIFF.md` when adding examples

.storybook/styles/password-input.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
[data-scope="password-input"][data-part="root"] {
1+
[data-scope='password-input'][data-part='root'] {
22
max-width: 20rem;
33
width: 100%;
44
display: flex;
55
flex-direction: column;
66
gap: 0.5rem;
77
}
88

9-
[data-scope="password-input"][data-part="control"] {
9+
[data-scope='password-input'][data-part='control'] {
1010
position: relative;
1111
display: flex;
1212
align-items: center;
1313
}
1414

15-
[data-scope="password-input"][data-part="input"] {
15+
[data-scope='password-input'][data-part='input'] {
1616
width: 100%;
1717
height: 100%;
1818
padding: 0.5rem 3rem 0.5rem 0.5rem;
1919
flex: 1;
2020
}
2121

22-
[data-scope="password-input"][data-part="indicator"] {
22+
[data-scope='password-input'][data-part='indicator'] {
2323
display: contents;
2424
}
2525

26-
[data-scope="password-input"][data-part="visibility-trigger"] {
26+
[data-scope='password-input'][data-part='visibility-trigger'] {
2727
position: absolute;
2828
inset-inline-end: 0.4rem;
2929
display: flex;

0 commit comments

Comments
 (0)