@arbor-education/design-system.components 0.10.0 → 0.11.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/.claude/agent-memory/blanche-designspert/MEMORY.md +64 -0
- package/.claude/agent-memory/blanche-designspert/token-review-patterns.md +29 -0
- package/.claude/agent-memory/dorothy-fact-checker/MEMORY.md +129 -0
- package/.claude/agent-memory/rose-storybookspert/MEMORY.md +29 -0
- package/.claude/agent-memory/rose-storybookspert/patterns.md +132 -0
- package/.claude/agent-memory/sophia-componentspert/MEMORY.md +14 -0
- package/.claude/agent-memory/sophia-componentspert/components.md +367 -0
- package/.claude/agents/blanche-designspert.md +150 -0
- package/.claude/agents/dorothy-fact-checker.md +145 -0
- package/.claude/agents/rose-storybookspert.md +148 -0
- package/.claude/agents/sophia-componentspert.md +133 -0
- package/.claude/component-library.md +1107 -0
- package/.claude/design-assessment-daily-attendance-2026-04-10.md +566 -0
- package/.claude/figma-assessment-7154-58899.md +404 -0
- package/.claude/figma-assessment-UKQfcxnT4rlHHNuiumt4o1-11086-97537.md +392 -0
- package/.claude/figma-assessment-UKQfcxnT4rlHHNuiumt4o1-551-41974.md +474 -0
- package/.claude/figma-assessment-UKQfcxnT4rlHHNuiumt4o1-551-43094.md +462 -0
- package/.claude/figma-assessment-fcFK4CGzkz2fVyY3koX8ZE-7154-59061.md +440 -0
- package/.claude/migration-report-custom-report-writer-2026-02-19.md +591 -0
- package/.claude/skills/analyze-design/README.md +295 -0
- package/.claude/skills/analyze-design/SKILL.md +741 -0
- package/.claude/skills/create-page/README.md +246 -0
- package/.claude/skills/create-page/SKILL.md +634 -0
- package/.claude/skills/create-page/design-analysis-template.md +333 -0
- package/.claude/skills/create-page/page-template.scss +118 -0
- package/.claude/skills/create-page/page-template.tsx +230 -0
- package/.claude/skills/map-legacy/README.md +87 -0
- package/.claude/skills/map-legacy/SKILL.md +465 -0
- package/.claude/skills/migrate-page/README.md +125 -0
- package/.claude/skills/migrate-page/SKILL.md +374 -0
- package/.github/CODEOWNERS +1 -0
- package/.github/pull_request_template.md +39 -0
- package/CHANGELOG.md +14 -0
- package/CLAUDE.md +31 -0
- package/CONTRIBUTING.md +191 -0
- package/README.md +110 -20
- package/dist/components/table/DSDefaultColDef.js +2 -2
- package/dist/components/table/DSDefaultColDef.js.map +1 -1
- package/dist/components/table/Table.d.ts +5 -29
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/Table.js +12 -22
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.stories.d.ts +4 -0
- package/dist/components/table/Table.stories.d.ts.map +1 -1
- package/dist/components/table/Table.stories.js +163 -28
- package/dist/components/table/Table.stories.js.map +1 -1
- package/dist/components/table/Table.test.js +109 -8
- package/dist/components/table/Table.test.js.map +1 -1
- package/dist/components/table/TableSettingsContext.d.ts +13 -0
- package/dist/components/table/TableSettingsContext.d.ts.map +1 -0
- package/dist/components/table/TableSettingsContext.js +15 -0
- package/dist/components/table/TableSettingsContext.js.map +1 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.d.ts +3 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.js +12 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.js.map +1 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.test.d.ts +2 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.test.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.test.js +65 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.test.js.map +1 -0
- package/dist/components/table/tableConsts.d.ts +7 -0
- package/dist/components/table/tableConsts.d.ts.map +1 -0
- package/dist/components/table/tableConsts.js +8 -0
- package/dist/components/table/tableConsts.js.map +1 -0
- package/dist/components/table/{BulkActionsDropdown.d.ts → tableControls/BulkActionsDropdown.d.ts} +1 -1
- package/dist/components/table/tableControls/BulkActionsDropdown.d.ts.map +1 -0
- package/dist/components/table/{BulkActionsDropdown.js → tableControls/BulkActionsDropdown.js} +3 -3
- package/dist/components/table/tableControls/BulkActionsDropdown.js.map +1 -0
- package/dist/components/table/{HideColumnsDropdown.d.ts → tableControls/HideColumnsDropdown.d.ts} +1 -2
- package/dist/components/table/tableControls/HideColumnsDropdown.d.ts.map +1 -0
- package/dist/components/table/{HideColumnsDropdown.js → tableControls/HideColumnsDropdown.js} +2 -2
- package/dist/components/table/tableControls/HideColumnsDropdown.js.map +1 -0
- package/dist/components/table/tableControls/TableControls.d.ts +23 -0
- package/dist/components/table/tableControls/TableControls.d.ts.map +1 -0
- package/dist/components/table/tableControls/TableControls.js +21 -0
- package/dist/components/table/tableControls/TableControls.js.map +1 -0
- package/dist/components/table/tableControls/TableControls.test.d.ts +2 -0
- package/dist/components/table/tableControls/TableControls.test.d.ts.map +1 -0
- package/dist/components/table/tableControls/TableControls.test.js +124 -0
- package/dist/components/table/tableControls/TableControls.test.js.map +1 -0
- package/dist/components/table/tableControls/TableSettingsDropdown.d.ts.map +1 -0
- package/dist/components/table/{TableSettingsDropdown.js → tableControls/TableSettingsDropdown.js} +7 -6
- package/dist/components/table/tableControls/TableSettingsDropdown.js.map +1 -0
- package/dist/components/table/useTableSettings.d.ts +1 -1
- package/dist/components/table/useTableSettings.d.ts.map +1 -1
- package/dist/components/table/useTableSettings.js +1 -1
- package/dist/components/table/useTableSettings.js.map +1 -1
- package/dist/index.css +19 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/setAgGridLicenseKey.js +1 -1
- package/package.json +1 -1
- package/src/components/table/DSDefaultColDef.ts +2 -2
- package/src/components/table/Table.stories.tsx +202 -35
- package/src/components/table/Table.test.tsx +134 -8
- package/src/components/table/Table.tsx +12 -22
- package/src/components/table/TableSettingsContext.ts +15 -0
- package/src/components/table/cellRenderers/CheckboxCellRenderer.test.tsx +74 -0
- package/src/components/table/cellRenderers/CheckboxCellRenderer.tsx +28 -0
- package/src/components/table/table.scss +23 -1
- package/src/components/table/tableConsts.ts +6 -0
- package/src/components/table/{BulkActionsDropdown.tsx → tableControls/BulkActionsDropdown.tsx} +2 -2
- package/src/components/table/{HideColumnsDropdown.tsx → tableControls/HideColumnsDropdown.tsx} +2 -2
- package/src/components/table/tableControls/TableControls.test.tsx +150 -0
- package/src/components/table/tableControls/TableControls.tsx +143 -0
- package/src/components/table/{TableSettingsDropdown.tsx → tableControls/TableSettingsDropdown.tsx} +2 -1
- package/src/components/table/useTableSettings.ts +1 -1
- package/src/index.ts +1 -0
- package/src/utils/setAgGridLicenseKey.ts +1 -1
- package/dist/components/table/BulkActionsDropdown.d.ts.map +0 -1
- package/dist/components/table/BulkActionsDropdown.js.map +0 -1
- package/dist/components/table/HideColumnsDropdown.d.ts.map +0 -1
- package/dist/components/table/HideColumnsDropdown.js.map +0 -1
- package/dist/components/table/TableSettingsDropdown.d.ts.map +0 -1
- package/dist/components/table/TableSettingsDropdown.js.map +0 -1
- /package/dist/components/table/{TableSettingsDropdown.d.ts → tableControls/TableSettingsDropdown.d.ts} +0 -0
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-page
|
|
3
|
+
description: Generate React pages from Figma designs by composing existing design system components. Converts Figma layouts into production-ready pages using Arbor components.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create Page from Figma Design
|
|
7
|
+
|
|
8
|
+
AROOOOO HUNNI!! 🐺 Time to turn that BOMBASS Figma page design into a MOST EXCELLENT React page using our existing components!! xxx
|
|
9
|
+
|
|
10
|
+
## Goal
|
|
11
|
+
|
|
12
|
+
Generate a **PAGE** (not a new component!) that **COMPOSES EXISTING** Arbor design system components to match a Figma layout.
|
|
13
|
+
|
|
14
|
+
**CRITICAL**:
|
|
15
|
+
- ❌ DO NOT create new reusable components
|
|
16
|
+
- ✅ DO USE existing components from `src/components/`
|
|
17
|
+
- ✅ DO compose them into a page layout
|
|
18
|
+
- ✅ DO match the Figma design's layout and styling
|
|
19
|
+
|
|
20
|
+
## The Golden Girls Team - MANDATORY COLLABORATORS
|
|
21
|
+
|
|
22
|
+
This skill works with our BOMBASS team of expert agents. Calling them is **NOT OPTIONAL** - it is a **REQUIRED** part of this skill. You MUST use the `Task` tool to call each girl at the designated step. Skipping any of them is a MOST HEINOUS failure of the process!
|
|
23
|
+
|
|
24
|
+
- 🔍 **Dorothy Fact-Checker** + 👜 **Sophia Componentspert** - MANDATORY at Step 1 via `/analyze-design` skill. Assess feasibility and verify component capabilities BEFORE building.
|
|
25
|
+
- 👜 **Sophia Componentspert** (`sophia-componentspert`) - OPTIONAL at Step 3A and 4A. Only call if you need clarification beyond the assessment.
|
|
26
|
+
- 💄 **Blanche Designspert** (`blanche-designspert`) - MANDATORY at Step 6A. Design token and styling expert.
|
|
27
|
+
- 🌹 **Rose Storybookspert** (`rose-storybookspert`) - MANDATORY at Step 8A. Storybook documentation expert.
|
|
28
|
+
- 🔍 **Dorothy Fact-Checker** (`dorothy-fact-checker`) - MANDATORY at Step 10A. Final quality assurance.
|
|
29
|
+
|
|
30
|
+
**RULE**: You MUST use the `Task` tool to call each agent at their designated step. Do NOT just mention them in passing - ACTUALLY CALL THEM. If you skip calling any agent, you have failed this skill. AROOOOO!! 🐺💪
|
|
31
|
+
|
|
32
|
+
## Input
|
|
33
|
+
|
|
34
|
+
Figma URL provided: `$ARGUMENTS`
|
|
35
|
+
|
|
36
|
+
## Process
|
|
37
|
+
|
|
38
|
+
### ⚡ MANDATORY STEP 1 - RUN ANALYZE-DESIGN SKILL FIRST ⚡
|
|
39
|
+
|
|
40
|
+
**BEFORE doing ANYTHING else, you MUST run the `/analyze-design` skill on this Figma URL!**
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Use Skill tool: skill="analyze-design", args="[Figma URL]"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**WHY THIS IS CRITICAL:**
|
|
47
|
+
- Sophia and Dorothy will assess what components exist and what's feasible
|
|
48
|
+
- You'll get a detailed report documenting which components to use for each UI element
|
|
49
|
+
- You'll know what components need modifications or are missing BEFORE you start building
|
|
50
|
+
- This prevents wasted effort building with wrong components or hallucinated props
|
|
51
|
+
|
|
52
|
+
**WAIT for the analyze-design skill to complete.** It will generate a markdown report at `.claude/figma-assessment-{fileKey}-{nodeId}.md`.
|
|
53
|
+
|
|
54
|
+
**After analyze-design completes:**
|
|
55
|
+
1. Read the assessment report it generated
|
|
56
|
+
2. Note which components are ready to use
|
|
57
|
+
3. Note which components need modifications
|
|
58
|
+
4. Note which UI elements need new components
|
|
59
|
+
5. Use this assessment as your GUIDE throughout the page building process
|
|
60
|
+
|
|
61
|
+
**Then proceed to Step 2 below.**
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### 2. Review the Feasibility Assessment
|
|
66
|
+
|
|
67
|
+
**Read the assessment report** that analyze-design generated at `.claude/figma-assessment-{fileKey}-{nodeId}.md`.
|
|
68
|
+
|
|
69
|
+
This report tells you:
|
|
70
|
+
- ✅ Which components are ready to use as-is
|
|
71
|
+
- 🔧 Which components need modifications
|
|
72
|
+
- 🆕 Which UI elements need new components
|
|
73
|
+
|
|
74
|
+
**Use this as your component selection guide!** Don't guess at components - follow Sophia and Dorothy's verified recommendations from the assessment.
|
|
75
|
+
|
|
76
|
+
### 3. Explore Component Details (If Needed)
|
|
77
|
+
|
|
78
|
+
If you need more detail beyond what's in the assessment:
|
|
79
|
+
|
|
80
|
+
1. **Read the public API**: Use `Read` tool on `src/index.ts` to see all exported components
|
|
81
|
+
2. **Examine component details**: Use `Read` tool to check component props and usage from:
|
|
82
|
+
- Component TypeScript files to see available props
|
|
83
|
+
- Story files (`.stories.tsx`) to see usage examples
|
|
84
|
+
- Test files (`.test.tsx`) to understand component behavior
|
|
85
|
+
|
|
86
|
+
**BUT**: The assessment already did most of this work! Only do additional research if you need specific prop details not covered in the report.
|
|
87
|
+
|
|
88
|
+
### ⚡ STEP 3A - CALL SOPHIA ONLY IF NEEDED ⚡
|
|
89
|
+
|
|
90
|
+
**The analyze-design skill already called Sophia!** Her component recommendations are in the assessment report.
|
|
91
|
+
|
|
92
|
+
**ONLY call Sophia again if:**
|
|
93
|
+
- You need clarification on a specific component prop not covered in the assessment
|
|
94
|
+
- You encounter an edge case during implementation that wasn't in the original design
|
|
95
|
+
- You need guidance on a component interaction not documented
|
|
96
|
+
|
|
97
|
+
If you do need to call her:
|
|
98
|
+
|
|
99
|
+
Call Sophia with:
|
|
100
|
+
- The Figma screenshot/design context you gathered
|
|
101
|
+
- A list of all UI elements you identified in the design
|
|
102
|
+
- Ask her: which existing Arbor components should be used for each element, and what are their key props/APIs
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Task tool: subagent_type="sophia-componentspert"
|
|
106
|
+
prompt: "I'm building a page from a Figma design. Here's what I see in the design: [describe elements]. Which existing Arbor components should I use for each? Please detail their props and any usage gotchas."
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**WAIT for Sophia's response before continuing.** Her guidance shapes ALL subsequent decisions.
|
|
110
|
+
|
|
111
|
+
After Sophia responds, **SHARE HER WISDOM WITH THE USER** like this:
|
|
112
|
+
|
|
113
|
+
> 👜 **Sophia says:** _[relay Sophia's key component recommendations in her voice - she's warm, knowledgeable, a bit extra. e.g. "Listen pussycat, for that search bar you'll definitely want `FormField` with `inputType="text"` - don't even think about a raw input! And for those badges? `Pill` is your girl! Here's what I'd use for each element..."]_
|
|
114
|
+
|
|
115
|
+
Then list the component decisions you're going with, so the user can see what Sophia recommended.
|
|
116
|
+
|
|
117
|
+
**Example workflow**:
|
|
118
|
+
```typescript
|
|
119
|
+
// 1. Read src/index.ts to see what's available:
|
|
120
|
+
export { Button } from './components/button/Button';
|
|
121
|
+
export { FormField } from './components/formField/FormField';
|
|
122
|
+
export { TextInput } from './components/formField/inputs/TextInput';
|
|
123
|
+
export { Table } from './components/table/Table';
|
|
124
|
+
// ... etc
|
|
125
|
+
|
|
126
|
+
// 2. Then read specific component files for props:
|
|
127
|
+
// Read src/components/button/Button.tsx to see ButtonProps
|
|
128
|
+
// Read src/components/formField/FormField.tsx to see FormFieldProps
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Available Arbor components** (from `src/index.ts`):
|
|
132
|
+
- `Heading` - ALL headings (use instead of `<h1>`, `<h2>`, etc.)
|
|
133
|
+
- `Section` - Page sections (use instead of raw `<section>`)
|
|
134
|
+
- `Button` - Buttons and CTAs
|
|
135
|
+
- `FormField` - Self-contained form fields (label + input together)
|
|
136
|
+
- `TextInput`, `NumberInput`, `TextArea` - Form inputs (used via FormField)
|
|
137
|
+
- `SelectDropdown`, `ColourPickerDropdown` - Dropdown inputs
|
|
138
|
+
- `RadioButtonInput` - Radio buttons
|
|
139
|
+
- `Fieldset` - Fieldset grouping with legend
|
|
140
|
+
- `Card` - Card containers
|
|
141
|
+
- `Table` - Data tables (AG Grid wrapper)
|
|
142
|
+
- `Modal`, `ModalManager` - Modal dialogs
|
|
143
|
+
- `Slideover`, `SlideoverManager` - Slide-out panels
|
|
144
|
+
- `Pill`, `Tag` - Tags and badges
|
|
145
|
+
- `Icon` - Icons
|
|
146
|
+
- `Tooltip`, `TooltipWrapper` - Tooltips
|
|
147
|
+
- `Tabs` - Tab navigation
|
|
148
|
+
- `Dropdown` - Dropdown menus
|
|
149
|
+
- `Separator` - Dividers
|
|
150
|
+
|
|
151
|
+
### 4. Map Figma Design to Existing Components
|
|
152
|
+
|
|
153
|
+
**Use the assessment report as your guide!** The report already mapped Figma elements to components.
|
|
154
|
+
|
|
155
|
+
For each Figma element:
|
|
156
|
+
1. Check the assessment - what component did Sophia recommend?
|
|
157
|
+
2. Note the props mentioned in the assessment
|
|
158
|
+
3. Plan how to style/position it
|
|
159
|
+
4. Determine what content it should have
|
|
160
|
+
|
|
161
|
+
**This step should be FAST** because analyze-design already did the heavy lifting!
|
|
162
|
+
|
|
163
|
+
### 🚨 HANDLING MISSING COMPONENTS - PLACEHOLDER SVG PATTERN 🚨
|
|
164
|
+
|
|
165
|
+
When the analyze-design assessment identifies a UI element that has **NO matching Arbor component** (marked 🆕 in the report), **DO NOT**:
|
|
166
|
+
- ❌ Skip the element entirely (leaves gaps in the layout)
|
|
167
|
+
- ❌ Build a new reusable component from scratch (out of scope for this skill!)
|
|
168
|
+
- ❌ Use a raw `<div>` with no visual indicator (confusing and invisible to reviewers)
|
|
169
|
+
|
|
170
|
+
**DO** use an inline **Placeholder SVG** to represent the missing component visually:
|
|
171
|
+
|
|
172
|
+
```tsx
|
|
173
|
+
{/*
|
|
174
|
+
⚠️ MISSING COMPONENT PLACEHOLDER
|
|
175
|
+
Component: [ComponentName e.g. "ProgressTracker"]
|
|
176
|
+
Reason: No matching Arbor component exists for this Figma element.
|
|
177
|
+
Figma element: [Figma layer name e.g. "Progress Bar / States"]
|
|
178
|
+
TODO: Replace this placeholder once the component is built in the design system.
|
|
179
|
+
*/}
|
|
180
|
+
<svg
|
|
181
|
+
role="img"
|
|
182
|
+
aria-label="[ComponentName] placeholder - component not yet available in design system"
|
|
183
|
+
width="100%"
|
|
184
|
+
height="80"
|
|
185
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
186
|
+
>
|
|
187
|
+
<rect width="100%" height="100%" fill="#f5f5f5" rx="4" />
|
|
188
|
+
<rect
|
|
189
|
+
x="2"
|
|
190
|
+
y="2"
|
|
191
|
+
width="calc(100% - 4px)"
|
|
192
|
+
height="76"
|
|
193
|
+
fill="none"
|
|
194
|
+
stroke="#cccccc"
|
|
195
|
+
strokeWidth="2"
|
|
196
|
+
strokeDasharray="8 4"
|
|
197
|
+
rx="3"
|
|
198
|
+
/>
|
|
199
|
+
<text
|
|
200
|
+
x="50%"
|
|
201
|
+
y="42%"
|
|
202
|
+
textAnchor="middle"
|
|
203
|
+
dominantBaseline="middle"
|
|
204
|
+
fill="#888888"
|
|
205
|
+
fontSize="13"
|
|
206
|
+
fontWeight="600"
|
|
207
|
+
fontFamily="sans-serif"
|
|
208
|
+
>
|
|
209
|
+
[ComponentName]
|
|
210
|
+
</text>
|
|
211
|
+
<text
|
|
212
|
+
x="50%"
|
|
213
|
+
y="65%"
|
|
214
|
+
textAnchor="middle"
|
|
215
|
+
dominantBaseline="middle"
|
|
216
|
+
fill="#aaaaaa"
|
|
217
|
+
fontSize="11"
|
|
218
|
+
fontFamily="sans-serif"
|
|
219
|
+
>
|
|
220
|
+
Component not yet available in design system
|
|
221
|
+
</text>
|
|
222
|
+
</svg>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**Placeholder SVG rules**:
|
|
226
|
+
- `role="img"` + descriptive `aria-label` → accessible and findable in tests
|
|
227
|
+
- `height` should approximate the Figma element's visual height (use the screenshot as reference)
|
|
228
|
+
- `width="100%"` so it fills its container like the real component would
|
|
229
|
+
- `strokeDasharray` dashed border makes it instantly recognisable as a placeholder in Storybook/browser
|
|
230
|
+
- The `TODO` comment is CRITICAL - it tells devs exactly what needs building
|
|
231
|
+
|
|
232
|
+
**In the Output Summary** (Step 10), clearly list every placeholder you used:
|
|
233
|
+
```
|
|
234
|
+
⚠️ PLACEHOLDERS USED (components not yet in design system):
|
|
235
|
+
- ProgressTracker: used in the course completion section
|
|
236
|
+
- RichTextEditor: used in the notes section
|
|
237
|
+
These need real implementations before the page is production-ready.
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### ⚡ STEP 4A - CALL SOPHIA AGAIN ONLY IF NEEDED ⚡
|
|
241
|
+
|
|
242
|
+
**You should rarely need this** since the assessment already covered component selection.
|
|
243
|
+
|
|
244
|
+
If you encounter ANY component you are unsure about during mapping that WASN'T covered in the assessment, **USE THE `Task` tool** to launch `sophia-componentspert`. Do NOT guess at component APIs.
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
Task tool: subagent_type="sophia-componentspert"
|
|
248
|
+
prompt: "I need to use [ComponentName] for [use case]. What are the correct props? Are there any usage patterns or gotchas I should know about?"
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Then relay Sophia's answer to the user:
|
|
252
|
+
|
|
253
|
+
> 👜 **Sophia clarifies:** _[Sophia's prop guidance in her warm, knowledgeable voice]_
|
|
254
|
+
|
|
255
|
+
**Mapping Strategy**:
|
|
256
|
+
- Figma Button → `<Button variant="primary|secondary|..." />`
|
|
257
|
+
- Figma Heading/Title → `<Heading level={1|2|3|4}>` (NOT raw `<h1>`, `<h2>`)
|
|
258
|
+
- Figma Section/Container → `<Section title="..." headingLevel={2}>` (NOT raw `<section>`)
|
|
259
|
+
- Figma Text Input → `<FormField inputType="text" inputProps={{...}} />` (self-contained!)
|
|
260
|
+
- Figma Number Input → `<FormField inputType="number" inputProps={{...}} />`
|
|
261
|
+
- Figma Select/Dropdown → `<FormField inputType="selectDropdown" inputProps={{...}} />`
|
|
262
|
+
- Figma Card → `<Card>...</Card>`
|
|
263
|
+
- Figma Table → `<Table data={...} columns={...} />`
|
|
264
|
+
- Figma Tag/Badge → `<Pill>` or `<Tag>`
|
|
265
|
+
- Figma Icon → `<Icon name="..." size={24} />`
|
|
266
|
+
- Figma Modal → `<Modal>...</Modal>`
|
|
267
|
+
- Figma Divider → `<Separator />`
|
|
268
|
+
- Plain paragraph text → `<p>` (but use `<Heading>` for titles!)
|
|
269
|
+
- **🆕 Missing component (no Arbor equivalent)** → Inline placeholder SVG (see "Handling Missing Components" section above!)
|
|
270
|
+
|
|
271
|
+
**IMPORTANT**: If Code Connect mappings exist, USE THEM! Don't reinvent the wheel, hunni! 🐺
|
|
272
|
+
|
|
273
|
+
### 5. Generate Page File
|
|
274
|
+
|
|
275
|
+
Create a page component that's composed with EXISTING components.
|
|
276
|
+
|
|
277
|
+
**Reference**: See `page-template.tsx` in this skill directory for a complete example structure.
|
|
278
|
+
|
|
279
|
+
**Key Structure Elements**:
|
|
280
|
+
- Import existing design system components using path aliases
|
|
281
|
+
- Define page props interface (className, callbacks, initial data)
|
|
282
|
+
- State management for interactive elements (forms, loading, errors)
|
|
283
|
+
- Event handlers for user interactions
|
|
284
|
+
- Semantic HTML structure (header, main, footer)
|
|
285
|
+
- Compose existing components according to Figma layout
|
|
286
|
+
|
|
287
|
+
**Page File Requirements**:
|
|
288
|
+
- Import ALL components from existing design system using path aliases
|
|
289
|
+
- Use semantic HTML structure (`header`, `main`, `section`, `footer`)
|
|
290
|
+
- Add state management for interactive elements (forms, toggles, etc.)
|
|
291
|
+
- Use proper TypeScript types
|
|
292
|
+
- Add JSDoc comments explaining the page purpose
|
|
293
|
+
- Keep layout logic in the page, styling in SCSS
|
|
294
|
+
|
|
295
|
+
### 6. Generate Page Styles (SCSS)
|
|
296
|
+
|
|
297
|
+
Create styles that match the Figma layout using design tokens.
|
|
298
|
+
|
|
299
|
+
**Reference**: See `page-template.scss` in this skill directory for a complete example structure.
|
|
300
|
+
|
|
301
|
+
**Key Styling Elements**:
|
|
302
|
+
- Page container with max-width and centering
|
|
303
|
+
- Section styles using BEM naming (`.page-name__section`)
|
|
304
|
+
- Flexbox/Grid layouts matching Figma design
|
|
305
|
+
- Design tokens for all colors, spacing, typography
|
|
306
|
+
- Responsive breakpoints (@media queries)
|
|
307
|
+
|
|
308
|
+
**SCSS Requirements**:
|
|
309
|
+
- Import `../../tokens.scss` for design tokens
|
|
310
|
+
- Use design tokens for ALL styling (colors, spacing, typography)
|
|
311
|
+
- Use BEM-like naming: `.page-name__section--modifier`
|
|
312
|
+
- Match Figma layout with flexbox/grid
|
|
313
|
+
- Add responsive breakpoints if needed
|
|
314
|
+
- NO hardcoded colors/spacing - use tokens!
|
|
315
|
+
|
|
316
|
+
### ⚡ MANDATORY STEP 6A - CALL BLANCHE DESIGNSPERT NOW ⚡
|
|
317
|
+
|
|
318
|
+
**YOU MUST USE THE `Task` tool RIGHT NOW** to launch the `blanche-designspert` agent. This is NOT optional. Do NOT move to step 7 without doing this.
|
|
319
|
+
|
|
320
|
+
Blanche will ensure you're using the right tokens (component tokens > semantic tokens > base tokens) and following proper CSS class naming patterns. She will catch any hardcoded values, wrong token tiers, or naming convention violations.
|
|
321
|
+
|
|
322
|
+
```
|
|
323
|
+
Task tool: subagent_type="blanche-designspert"
|
|
324
|
+
prompt: "I've just created a SCSS file for a new page. Please review the styling for correct design token usage and CSS naming conventions. Here is the SCSS: [paste your generated SCSS]"
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
After Blanche responds, **SHARE HER VERDICT WITH THE USER** before making any corrections:
|
|
328
|
+
|
|
329
|
+
> 💄 **Blanche says:** _[relay Blanche's styling feedback in her voice - she's glamorous, exacting, and absolutely will not tolerate a hardcoded hex value. e.g. "Sugah, that `#ff0000` has GOT to go - use `--color-semantic-error-500` like the sophisticated design system we are! And darling, those spacing values? $space-4 and $space-8 are RIGHT THERE waiting for you..."]_
|
|
330
|
+
|
|
331
|
+
List any corrections you're making based on her feedback, then apply them.
|
|
332
|
+
|
|
333
|
+
**Apply ALL of Blanche's feedback before continuing.** Do NOT skip her corrections.
|
|
334
|
+
|
|
335
|
+
### 7. Generate Test File
|
|
336
|
+
|
|
337
|
+
Create tests for the page:
|
|
338
|
+
|
|
339
|
+
```typescript
|
|
340
|
+
import { render, screen } from '@testing-library/react';
|
|
341
|
+
import '@testing-library/jest-dom/vitest';
|
|
342
|
+
import { PageName } from './PageName';
|
|
343
|
+
|
|
344
|
+
describe('PageName', () => {
|
|
345
|
+
it('renders the page title', () => {
|
|
346
|
+
render(<PageName />);
|
|
347
|
+
expect(screen.getByText('Page Title')).toBeInTheDocument();
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
it('renders action buttons', () => {
|
|
351
|
+
render(<PageName />);
|
|
352
|
+
expect(screen.getByRole('button', { name: /action button/i })).toBeInTheDocument();
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
it('renders form fields', () => {
|
|
356
|
+
render(<PageName />);
|
|
357
|
+
expect(screen.getByLabelText(/name/i)).toBeInTheDocument();
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
// Add tests for interactions
|
|
361
|
+
it('handles form submission', () => {
|
|
362
|
+
// Test form logic
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
**Test Requirements**:
|
|
368
|
+
- Use React Testing Library
|
|
369
|
+
- Import `@testing-library/jest-dom/vitest`
|
|
370
|
+
- Use accessible queries (`getByRole`, `getByLabelText`)
|
|
371
|
+
- Test page renders correctly
|
|
372
|
+
- Test interactive elements work
|
|
373
|
+
- Avoid testIds
|
|
374
|
+
|
|
375
|
+
### 8. Generate Storybook Story
|
|
376
|
+
|
|
377
|
+
### ⚡ MANDATORY STEP 8A - CALL ROSE STORYBOOKSPERT NOW ⚡
|
|
378
|
+
|
|
379
|
+
**YOU MUST USE THE `Task` tool RIGHT NOW** to launch the `rose-storybookspert` agent. Do NOT write the story file yourself. Rose is the expert here - let her do it!
|
|
380
|
+
|
|
381
|
+
```
|
|
382
|
+
Task tool: subagent_type="rose-storybookspert"
|
|
383
|
+
prompt: "I've created a new page component called [PageName]. Please create a comprehensive Storybook story file for it. Here is the component: [paste your generated TSX]. The file should go at [path/to/PageName.stories.tsx]."
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
After Rose responds, **SHARE A PREVIEW OF HER STORY WITH THE USER**:
|
|
387
|
+
|
|
388
|
+
> 🌹 **Rose says:** _[relay Rose's story rationale and highlights in her warm storytelling voice - she loves explaining WHY she chose each story variant, and she gets genuinely excited about good documentation. e.g. "Oh, this page has such a beautiful story to tell! I've written a Default story so you can see it in its natural state, a WithLoadingState story because every page deserves to be seen mid-journey, and a WithError story because even mistakes deserve to be documented with care..."]_
|
|
389
|
+
|
|
390
|
+
Then show the user the story file Rose has crafted before writing it to disk.
|
|
391
|
+
|
|
392
|
+
**Use Rose's output as the story file.** Do NOT just use the basic template below - that's just a reference.
|
|
393
|
+
|
|
394
|
+
Basic story structure (Rose will enhance this significantly):
|
|
395
|
+
|
|
396
|
+
```typescript
|
|
397
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
398
|
+
import { PageName } from './PageName';
|
|
399
|
+
|
|
400
|
+
const meta: Meta<typeof PageName> = {
|
|
401
|
+
title: 'Pages/PageName',
|
|
402
|
+
component: PageName,
|
|
403
|
+
parameters: {
|
|
404
|
+
layout: 'fullscreen', // Pages typically use fullscreen
|
|
405
|
+
},
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
export default meta;
|
|
409
|
+
type Story = StoryObj<typeof meta>;
|
|
410
|
+
|
|
411
|
+
export const Default: Story = {
|
|
412
|
+
args: {},
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
export const WithData: Story = {
|
|
416
|
+
args: {
|
|
417
|
+
// Mock data if needed
|
|
418
|
+
},
|
|
419
|
+
};
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
### 9. File Organization
|
|
423
|
+
|
|
424
|
+
**Where to put page files**:
|
|
425
|
+
|
|
426
|
+
Option A - In consumer app (NOT the component library):
|
|
427
|
+
```
|
|
428
|
+
app/src/pages/pageName/
|
|
429
|
+
├── PageName.tsx
|
|
430
|
+
├── PageName.test.tsx
|
|
431
|
+
├── PageName.stories.tsx
|
|
432
|
+
└── pageName.scss
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
Option B - In component library examples/demo:
|
|
436
|
+
```
|
|
437
|
+
src/examples/pages/pageName/
|
|
438
|
+
├── PageName.tsx
|
|
439
|
+
├── PageName.test.tsx
|
|
440
|
+
├── PageName.stories.tsx
|
|
441
|
+
└── pageName.scss
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
**IMPORTANT**: Pages are typically NOT added to the component library's public API (`src/index.ts`). They're application-level code that USES the library!
|
|
445
|
+
|
|
446
|
+
### 10. Quality Checks
|
|
447
|
+
|
|
448
|
+
Run these commands:
|
|
449
|
+
|
|
450
|
+
```bash
|
|
451
|
+
# Type check
|
|
452
|
+
yarn check-types
|
|
453
|
+
|
|
454
|
+
# Lint SCSS
|
|
455
|
+
yarn style-lint
|
|
456
|
+
|
|
457
|
+
# Run tests
|
|
458
|
+
yarn test
|
|
459
|
+
|
|
460
|
+
# View in Storybook (if story created)
|
|
461
|
+
yarn storybook
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
**CRITICAL**: All checks must pass! 100% test pass rate hunni!! 🐺
|
|
465
|
+
|
|
466
|
+
### ⚡ MANDATORY STEP 10A - CALL DOROTHY FACT-CHECKER NOW ⚡
|
|
467
|
+
|
|
468
|
+
**YOU MUST USE THE `Task` tool RIGHT NOW** to launch the `dorothy-fact-checker` agent. This is the FINAL quality gate. Do NOT tell the user the work is done without Dorothy's sign-off.
|
|
469
|
+
|
|
470
|
+
```
|
|
471
|
+
Task tool: subagent_type="dorothy-fact-checker"
|
|
472
|
+
prompt: "I've just finished creating a page from a Figma design. Please verify all the following: (1) all files actually exist on disk [list file paths], (2) tests pass with 100% pass rate, (3) tests are meaningful not placeholders, (4) components are used with correct props, (5) no 'any' types used, (6) styling follows token conventions."
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
Dorothy will check:
|
|
476
|
+
- Confirm all files were actually created (page, styles, tests, stories)
|
|
477
|
+
- Verify tests pass with 100% pass rate
|
|
478
|
+
- Check that tests are meaningful and not just placeholders
|
|
479
|
+
- Ensure components are used properly with correct props
|
|
480
|
+
- Validate that styling follows conventions
|
|
481
|
+
- Confirm no 'any' types are used
|
|
482
|
+
- Give you the HONEST truth about the quality of the work!
|
|
483
|
+
|
|
484
|
+
After Dorothy responds, **SHARE HER VERDICT WITH THE USER IN FULL**. Dorothy's honesty is a feature, not a bug - don't sanitise it:
|
|
485
|
+
|
|
486
|
+
> 🔍 **Dorothy says:** _[relay Dorothy's fact-check verdict in her no-nonsense, straight-talking voice - she has seen things. She doesn't sugarcoat. e.g. "Alright, I've checked the work. The page file EXISTS, which is a good start. The tests? Three of them are fine, but 'handles form submission' is just an empty shell and I won't pretend otherwise. The SCSS has one hardcoded value that Blanche apparently missed. Fix those two things and we're golden."]_
|
|
487
|
+
|
|
488
|
+
List every issue Dorothy raised, confirm which ones you're fixing, then fix them before presenting the final summary.
|
|
489
|
+
|
|
490
|
+
**Fix ALL issues Dorothy identifies before giving the final summary to the user.**
|
|
491
|
+
|
|
492
|
+
## Design Token Mapping
|
|
493
|
+
|
|
494
|
+
We don't use sass vars, we use css vars.
|
|
495
|
+
Map Figma variables to `src/tokens.scss`:
|
|
496
|
+
|
|
497
|
+
**Colors**:
|
|
498
|
+
We have base tokens for colours e.g.:
|
|
499
|
+
- Brand colors → `--color-brand-500`
|
|
500
|
+
- Semantic colors → `--color-semantic-{semantic}-500`
|
|
501
|
+
But we also have component specific tokens that should take priority:
|
|
502
|
+
- Component specific colors → `--{component}-{state}-color-{usage}`
|
|
503
|
+
- e.g. text colour for form field text in an error state → `--form-field-text-error-color-text`
|
|
504
|
+
- Border colors → `--{component}-focus-color-border`
|
|
505
|
+
|
|
506
|
+
**Spacing**:
|
|
507
|
+
- Gaps/margins/padding → `$space-{scale}` (e.g., `$space-4`, `$space-8`)
|
|
508
|
+
|
|
509
|
+
**Typography**:
|
|
510
|
+
- Headings → `$text-heading-{level}-{property}`
|
|
511
|
+
- Body text → `$text-body-{property}`
|
|
512
|
+
- Font weights → `$text-{style}-weight`
|
|
513
|
+
|
|
514
|
+
**Layout**:
|
|
515
|
+
- Border radius → `$border-radius-{size}`
|
|
516
|
+
- Shadows → Check if shadow tokens exist
|
|
517
|
+
|
|
518
|
+
## Component Usage Tips
|
|
519
|
+
|
|
520
|
+
**CRITICAL**: Use Arbor components, NOT raw HTML elements!
|
|
521
|
+
|
|
522
|
+
### Headings - Use `Heading` component
|
|
523
|
+
```typescript
|
|
524
|
+
// DON'T use raw <h1>, <h2>, etc.
|
|
525
|
+
<Heading level={1}>Page Title</Heading>
|
|
526
|
+
<Heading level={2}>Section Title</Heading>
|
|
527
|
+
<Heading level={3}>Subsection</Heading>
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
### Sections - Use `Section` component
|
|
531
|
+
```typescript
|
|
532
|
+
// DON'T use raw <section>
|
|
533
|
+
<Section
|
|
534
|
+
title="Section Title"
|
|
535
|
+
headingLevel={2}
|
|
536
|
+
buttonText="Action" // Optional button in header
|
|
537
|
+
buttonOnClick={handleClick}
|
|
538
|
+
collapsible={false} // Optional collapsible
|
|
539
|
+
>
|
|
540
|
+
{/* Section content */}
|
|
541
|
+
</Section>
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
### Forms - Use `FormField` (self-contained)
|
|
545
|
+
```typescript
|
|
546
|
+
// FormField includes BOTH label AND input!
|
|
547
|
+
<FormField
|
|
548
|
+
label="Email"
|
|
549
|
+
id="email"
|
|
550
|
+
inputType="text" // 'text' | 'textarea' | 'number' | 'colourPicker' | 'selectDropdown'
|
|
551
|
+
errorText={error} // Error message
|
|
552
|
+
fieldDescription="Help text" // Optional description
|
|
553
|
+
inputProps={{
|
|
554
|
+
value: email,
|
|
555
|
+
onChange: (e) => setEmail(e.target.value),
|
|
556
|
+
placeholder: 'Enter email',
|
|
557
|
+
}}
|
|
558
|
+
/>
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
### Buttons
|
|
562
|
+
```typescript
|
|
563
|
+
<Button
|
|
564
|
+
variant="primary" // 'primary' | 'secondary' | 'tertiary' | 'primary-destructive' | 'secondary-destructive' | 'text-link' | 'dropdown'
|
|
565
|
+
onClick={handleClick}
|
|
566
|
+
disabled={isLoading}
|
|
567
|
+
>
|
|
568
|
+
Click Me
|
|
569
|
+
</Button>
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### Tables
|
|
573
|
+
```typescript
|
|
574
|
+
<Table
|
|
575
|
+
data={rows}
|
|
576
|
+
columns={columnDefs}
|
|
577
|
+
// Check Table component for all props
|
|
578
|
+
/>
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
**ALWAYS check component prop types before using!** Use `Read` tool on `src/index.ts` to see available components, then read component files for props!
|
|
582
|
+
|
|
583
|
+
## Output Summary
|
|
584
|
+
|
|
585
|
+
After generation, provide:
|
|
586
|
+
|
|
587
|
+
1. ✅ **Page file created**: Path to PageName.tsx
|
|
588
|
+
2. ✅ **Components used**: List of all design system components imported
|
|
589
|
+
3. ✅ **Layout structure**: Brief description of page sections
|
|
590
|
+
4. ✅ **Design tokens**: Colors/spacing tokens used
|
|
591
|
+
5. ✅ **Tests created**: Path to test file
|
|
592
|
+
6. ✅ **Quality checks**: Results of type check, lint, tests
|
|
593
|
+
7. ✅ **Next steps**:
|
|
594
|
+
- How to integrate into app
|
|
595
|
+
- Where to add routing
|
|
596
|
+
- Any manual tweaks needed
|
|
597
|
+
8. ✅ **Visual comparison**: Note any differences from Figma design
|
|
598
|
+
9. ⚠️ **Placeholder SVGs used** (if any): List every missing component that was replaced with a placeholder SVG, e.g.:
|
|
599
|
+
```
|
|
600
|
+
⚠️ PLACEHOLDERS USED (components not yet in design system):
|
|
601
|
+
- ProgressTracker: used in the course header section (~80px tall)
|
|
602
|
+
- RichTextEditor: used in the notes/description section (~200px tall)
|
|
603
|
+
These SVG placeholders mark where real components need to be built.
|
|
604
|
+
Replace each <svg role="img" aria-label="[ComponentName] placeholder..."> when the component is ready.
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
## Important Notes
|
|
608
|
+
|
|
609
|
+
- **DON'T create new components** - use existing ones! 🐺
|
|
610
|
+
- **DO explore components first** - read their props and examples
|
|
611
|
+
- **DO use Code Connect mappings** if available
|
|
612
|
+
- **DO use design tokens** for all styling
|
|
613
|
+
- **DO match Figma layout** with proper spacing/alignment
|
|
614
|
+
- **DON'T add pages to src/index.ts** - they're app-level, not library exports
|
|
615
|
+
- **DO keep it simple** - compose, don't reinvent
|
|
616
|
+
- This codebase serves millions of users - be careful!
|
|
617
|
+
- Use yarn (NOT npm)
|
|
618
|
+
- 100% test pass rate or we AROOOOO in protest!! 🐺💪
|
|
619
|
+
|
|
620
|
+
## Example Flow
|
|
621
|
+
|
|
622
|
+
1. User provides Figma URL
|
|
623
|
+
2. Fetch design → See it has a form with submit button and data table
|
|
624
|
+
3. Explore components → Find FormField, TextInput, Button, Table
|
|
625
|
+
4. Map design:
|
|
626
|
+
- Form section → FormField + TextInput components
|
|
627
|
+
- Submit button → Button component (primary variant)
|
|
628
|
+
- Data table → Table component
|
|
629
|
+
5. Generate page that imports and uses these components
|
|
630
|
+
6. Style layout to match Figma using design tokens
|
|
631
|
+
7. Add tests, run quality checks
|
|
632
|
+
8. Output: "Here's your page that uses FormField, TextInput, Button, and Table!"
|
|
633
|
+
|
|
634
|
+
AROOOOO LET'S COMPOSE SOME BOMBASS PAGES HUNNI!! xxx 💪🏍️✨
|