You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/rules/documentation.mdc
+44-81Lines changed: 44 additions & 81 deletions
Original file line number
Diff line number
Diff line change
@@ -4,27 +4,15 @@ alwaysApply: false
4
4
---
5
5
# Component Documentation Guidelines
6
6
7
-
This guide outlines the standards and structure for documenting components in the Cube UI Kit. Following these guidelines ensures consistency, clarity, and comprehensive coverage of component features.
- Start with a clear, concise description of what the component is
171
-
- Follow with scenarios where the component should be used
172
-
- Avoid technical implementation details in the introduction
173
-
174
-
### 2. Properties Documentation
175
-
176
-
#### Base Properties
177
-
- If the component uses `filterBaseProps`, don't list base properties individually
178
-
- Instead, include the link: `Supports [Base properties](/base-properties.md)`
179
-
- Exception: Always document the `qa` property if it has special behavior
180
-
181
-
#### Styling Properties
182
-
- Document each `styles` or `*Styles` property separately
183
-
- For each styling property, list all available tasty sub-elements with descriptions. Count only those sub-elements that are mentioned in tasty styles in the root element inside component and can be overrided by passing an object with a specific key (sub-element name) to `styles` property
184
-
- Format: `ElementName` - Description of what this element represents
185
-
186
-
#### Style Properties
187
-
- List all properties that can be used for direct styling (e.g., `width`, `height`, `padding`)
188
-
- These are properties that map to `tasty` styles without using the `styles` prop
189
-
- Use `src/tasty/styles/list.ts` file to understand how it works.
160
+
### Properties
190
161
191
-
#### React Aria Properties
192
-
- Document all React Aria properties with clear descriptions
193
-
- It's acceptable to rewrite React Aria descriptions for clarity
194
-
- Focus on practical usage rather than technical implementation
162
+
- **Props List**: Use `<Controls of={componentStories.Default} />` - DO NOT manually list props if Controls is used
163
+
- **Base Properties**: Link to `/base-properties.md` instead of listing (unless `qa` has special behavior)
164
+
- **Styling Properties**: Document `styles`/`*Styles` props. List sub-elements that can be overridden (check component's tasty styles)
165
+
- **Style Properties**: List direct styling props (`width`, `height`, etc.) - see `src/tasty/styles/list.ts`
166
+
- **React Aria Properties**: Only document if adding clarifications beyond what Controls shows
195
167
196
-
### 3. Examples
168
+
### Examples
197
169
198
-
- Provide practical, real-world examples written in `jsx` code
199
-
- Avoid styling examples unless it demonstrates essential capabilities
200
-
- Each example should have a clear purpose and title
201
-
- Do not use Storybook's Canvas and Story components for interactive examples
202
-
- Each story should describe a usage case
203
-
- The more sophisticated component, the more stories we need to cover all cases
170
+
- **CRITICAL**: Must include JSX code snippets, not just story references
171
+
- Provide real-world examples with clear purpose
172
+
- Avoid pure styling examples unless demonstrating essential capabilities
173
+
- More sophisticated components need more examples to cover all cases
204
174
205
-
### 4. Modifiers
175
+
### Modifiers
206
176
207
-
- Document all available modifiers that can be passed via the `mods` property
208
-
- Explain how each modifier affects the component's appearance or behavior
209
-
- Include any modifier combinations that have special behavior
177
+
- Document all `mods` property values
178
+
- Explain effects on appearance/behavior
179
+
- Note special modifier combinations
210
180
211
-
### 5. Accessibility Section
181
+
### Accessibility
212
182
213
-
- Include keyboard navigation patterns
214
-
- Document screen reader behavior
215
-
- List relevant ARIA properties and their usage
216
-
- Provide guidance on ensuring accessible implementations
183
+
- Keyboard navigation patterns
184
+
- Screen reader behavior
185
+
- Relevant ARIA properties
186
+
- Accessible implementation guidance
217
187
218
-
### 6. Form Integration
188
+
### Form Integration
219
189
220
-
For input components (TextInput, Select, DatePicker, etc.):
221
-
- Don't duplicate field property documentation
222
-
- Include: "This component supports all [Field properties](/field-properties.md) when used within a Form."
190
+
For input components: "This component supports all [Field properties](/field-properties.md) when used within a Form."
@@ -206,7 +204,9 @@ Item supports inline actions that appear on the right side. Use the `Item.Action
206
204
</Item>
207
205
```
208
206
209
-
Actions automatically inherit the parent's `type` prop and adjust their styling accordingly. The component reserves space for actions to prevent content overlap.
207
+
Actions automatically inherit the parent's `type` and `theme` props and adjust their styling accordingly. The component reserves space for actions to prevent content overlap.
208
+
209
+
By default, action buttons are focusable. Use `disableActionsFocus={true}` to prevent them from receiving keyboard focus.
210
210
211
211
#### Show Actions on Hover
212
212
@@ -371,14 +371,15 @@ By default, Item shows an auto tooltip when content overflows.
371
371
## Related Components
372
372
373
373
-[ItemButton](/docs/actions-itembutton--docs) - Interactive button built on Item
374
-
-[Item.Action](/docs/actions-itemaction--docs) - Action button component for inline actions (also available as `ItemButton.Action`, `Menu.Item.Action`, etc.)
375
-
-[Select](/docs/forms-select--docs) - Dropdown selection component using Item
376
-
-[ComboBox](/docs/forms-combobox--docs) - Searchable dropdown component using Item
377
-
-[ListBox](/docs/forms-listbox--docs) - List selection component using Item
378
-
-[FilterListBox](/docs/forms-filterlistbox--docs) - Filterable list component using Item
379
-
-[FilterPicker](/docs/forms-filterpicker--docs) - Filter selection component using Item
374
+
-[ItemAction](/docs/actions-itemaction--docs) - Action button component for inline actions (also available as `Item.Action`, `ItemButton.Action`, `Menu.Item.Action`, etc.)
375
+
-[ItemBadge](/docs/content-itembadge--docs) - Badge component for displaying labels or counts (also available as `Item.Badge`)
376
+
-[Select](/docs/fields-select--docs) - Dropdown selection component using Item
377
+
-[ComboBox](/docs/fields-combobox--docs) - Searchable dropdown component using Item
378
+
-[ListBox](/docs/fields-listbox--docs) - List selection component using Item
379
+
-[FilterListBox](/docs/fields-filterlistbox--docs) - Filterable list component using Item
380
+
-[FilterPicker](/docs/fields-filterpicker--docs) - Filter selection component using Item
380
381
-[Menu](/docs/actions-menu--docs) - Context menu component using Item
381
382
-[CommandMenu](/docs/actions-commandmenu--docs) - Command palette component using Item
382
383
-[Button](/docs/actions-button--docs) - Traditional button component
383
384
-[Link](/docs/navigation-link--docs) - Text link component
384
-
-[Text](/docs/generic-text--docs) - Typography component for simple text
385
+
-[Text](/docs/content-text--docs) - Typography component for simple text
0 commit comments