Skip to content

Commit 7ed66db

Browse files
committed
docs(web-react): standardize README code examples #DS-2421
1 parent ebc45d8 commit 7ed66db

File tree

73 files changed

+965
-930
lines changed

Some content is hidden

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

73 files changed

+965
-930
lines changed

.agents/skills/figma-to-spirit/SKILL.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ When analyzing Figma, check if children have `w-full` (full width) or `shrink-0
163163
- **If children do NOT have `w-full`** → Parent should use `alignmentX="left"` to prevent unwanted width expansion
164164
- **Children with both `w-full` AND `max-width`** → Parent uses `alignmentX="stretch"`, child stretches UP TO its max-width constraint
165165

166-
```jsx
166+
```tsx
167167
// WRONG - alignmentX="left" prevents children from filling width even when Figma shows w-full
168168
<Flex direction="vertical" spacing="space-1000" alignmentX="left">
169169
<Box UNSAFE_style={{ maxWidth: "800px" }}>...</Box> {/* Won't stretch to 800px */}
@@ -211,7 +211,7 @@ When analyzing Figma, check if children have `w-full` (full width) or `shrink-0
211211

212212
Heading and Text accept accent colors, but you must use the **full token name** (not short form).
213213

214-
```jsx
214+
```tsx
215215
// WRONG - short form "accent-02" causes TypeScript lint error
216216
<Heading elementType="div" size="xlarge" textColor="accent-02">300K+</Heading>
217217

@@ -230,7 +230,7 @@ When only one breakpoint is provided in Figma:
230230
1. **Identify the breakpoint** - Check Figma frame width (mobile < 768px, tablet 768-1024px, desktop > 1024px)
231231
2. **Add responsive props** for other breakpoints:
232232

233-
```jsx
233+
```tsx
234234
// Grid: reduce columns on smaller screens
235235
<Grid cols={{ mobile: 1, tablet: 2, desktop: 4 }} />
236236

@@ -430,7 +430,7 @@ Before finalizing code:
430430

431431
**CRITICAL: Never substitute icon names with your own choices.**
432432

433-
```jsx
433+
```tsx
434434
// WRONG - Developer substituted "semantically appropriate" icons
435435
<Icon name="shield-dualtone" /> // Was "placeholder" in Figma
436436
<Icon name="folder" /> // Was "placeholder" in Figma
@@ -455,7 +455,7 @@ The rule: If CodeConnect shows `iconName="placeholder"`, your code MUST use `ico
455455

456456
**CRITICAL: Never use deprecated features even if they appear in older Figma files.**
457457

458-
```jsx
458+
```tsx
459459
// WRONG - using deprecated hideOnCollapse prop
460460
<UncontrolledCollapse id="collapse-1" hideOnCollapse>
461461
Content
@@ -505,7 +505,7 @@ All prop values must come from Figma layer data (`get_design_context`, CodeConne
505505
- **Text colors**: Screenshot rendering may not accurately represent color tokens.
506506
- **Sizes**: Component sizes (e.g., Section `size`, Tag `size`) cannot be reliably read from screenshots.
507507

508-
```jsx
508+
```tsx
509509
// WRONG - Guessed backgroundColor from screenshot appearance
510510
<Section backgroundColor="secondary" size="xlarge">
511511
<Heading elementType="h1">Title</Heading>

.agents/skills/figma-to-spirit/components/cards.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Makes a Card interactive by providing a clickable title link that stretches to c
5454

5555
1. **Using Heading with textColor instead of CardLink when Figma shows link styling**
5656

57-
```jsx
57+
```tsx
5858
// WRONG - Figma shows themed/link/primary/state-default color on title
5959
<Card>
6060
<CardMedia>
@@ -86,7 +86,7 @@ Makes a Card interactive by providing a clickable title link that stretches to c
8686

8787
2. **Forgetting isHeading on CardTitle when using CardLink**
8888

89-
```jsx
89+
```tsx
9090
// WRONG - CardTitle without isHeading when it should be a heading
9191
<CardTitle>
9292
<CardLink href="#">Card Title</CardLink>
@@ -100,7 +100,7 @@ Makes a Card interactive by providing a clickable title link that stretches to c
100100

101101
3. **Using regular Link instead of CardLink inside Card**
102102

103-
```jsx
103+
```tsx
104104
// WRONG - Link doesn't provide Card-level click target
105105
<Card>
106106
<CardBody>
@@ -131,7 +131,7 @@ Makes a Card interactive by providing a clickable title link that stretches to c
131131

132132
### Examples
133133

134-
```jsx
134+
```tsx
135135
// Basic Card with link (Figma shows link color on title)
136136
<Card>
137137
<CardMedia>
@@ -191,7 +191,7 @@ Container for Card title content. Can render as a heading or plain container.
191191

192192
### Examples
193193

194-
```jsx
194+
```tsx
195195
// Static Card title (no link)
196196
<CardTitle isHeading headingProps={{ size: 'large' }}>
197197
Static Card Title
@@ -216,7 +216,7 @@ Container for Card description/body text.
216216

217217
### Examples
218218

219-
```jsx
219+
```tsx
220220
<CardDescription>This is the card description text that provides additional context.</CardDescription>
221221
```
222222

@@ -228,7 +228,7 @@ Container for Card description/body text.
228228

229229
When Figma shows a Card WITHOUT link styling on the title:
230230

231-
```jsx
231+
```tsx
232232
<Card>
233233
<CardMedia>
234234
<img src="https://picsum.photos/seed/static/400/300" alt="" />
@@ -246,7 +246,7 @@ When Figma shows a Card WITHOUT link styling on the title:
246246

247247
When Figma shows a Card WITH link color tokens on the title (`themed/link/...`):
248248

249-
```jsx
249+
```tsx
250250
<Card>
251251
<CardMedia>
252252
<img src="https://picsum.photos/seed/clickable/400/300" alt="" />
@@ -264,7 +264,7 @@ When Figma shows a Card WITH link color tokens on the title (`themed/link/...`):
264264

265265
When Figma shows a Card with button actions (not title link):
266266

267-
```jsx
267+
```tsx
268268
<Card>
269269
<CardBody>
270270
<CardTitle isHeading>Card with Actions</CardTitle>
@@ -304,7 +304,7 @@ Container for Card visual content (images, icons, IconBox) in the artwork slot.
304304

305305
When using IconBox inside CardArtwork in a horizontal Card layout, the IconBox stretches to fill the full Card height instead of maintaining its square aspect ratio. This is especially noticeable when the Card has additional content (like CardFooter with buttons) that makes it taller.
306306

307-
```jsx
307+
```tsx
308308
// WRONG - IconBox stretches vertically to fill CardArtwork height
309309
<Card direction="horizontal" isBoxed>
310310
<CardArtwork>
@@ -351,7 +351,7 @@ When using IconBox inside CardArtwork in a horizontal Card layout, the IconBox s
351351

352352
2. **Expecting alignmentX to work on horizontal Cards**
353353

354-
```jsx
354+
```tsx
355355
// WRONG - alignmentX has no effect on horizontal Card
356356
<Card direction="horizontal">
357357
<CardArtwork alignmentX="center">
@@ -371,7 +371,7 @@ When using IconBox inside CardArtwork in a horizontal Card layout, the IconBox s
371371

372372
### Examples
373373

374-
```jsx
374+
```tsx
375375
// Horizontal Card with top-aligned IconBox (most common pattern)
376376
<Card direction="horizontal" isBoxed>
377377
<CardArtwork>

0 commit comments

Comments
 (0)