@auto-engineer/component-implementor-react 1.95.0 → 1.97.0

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.
Files changed (85) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +6 -6
  3. package/.turbo/turbo-type-check.log +1 -1
  4. package/CHANGELOG.md +90 -0
  5. package/dist/src/commands/implement-component.d.ts.map +1 -1
  6. package/dist/src/commands/implement-component.js +13 -16
  7. package/dist/src/commands/implement-component.js.map +1 -1
  8. package/dist/src/commands/implement-component.test.js +14 -5
  9. package/dist/src/commands/implement-component.test.js.map +1 -1
  10. package/dist/src/extract-code-block.d.ts +1 -0
  11. package/dist/src/extract-code-block.d.ts.map +1 -1
  12. package/dist/src/extract-code-block.js +12 -0
  13. package/dist/src/extract-code-block.js.map +1 -1
  14. package/dist/src/extract-code-block.test.js +28 -1
  15. package/dist/src/extract-code-block.test.js.map +1 -1
  16. package/dist/src/generate-component.d.ts +2 -13
  17. package/dist/src/generate-component.d.ts.map +1 -1
  18. package/dist/src/generate-component.js +4 -29
  19. package/dist/src/generate-component.js.map +1 -1
  20. package/dist/src/generate-component.test.js +18 -22
  21. package/dist/src/generate-component.test.js.map +1 -1
  22. package/dist/src/generate-story.d.ts +2 -12
  23. package/dist/src/generate-story.d.ts.map +1 -1
  24. package/dist/src/generate-story.js +4 -25
  25. package/dist/src/generate-story.js.map +1 -1
  26. package/dist/src/generate-story.test.js +17 -21
  27. package/dist/src/generate-story.test.js.map +1 -1
  28. package/dist/src/generate-test.d.ts +2 -12
  29. package/dist/src/generate-test.d.ts.map +1 -1
  30. package/dist/src/generate-test.js +4 -28
  31. package/dist/src/generate-test.js.map +1 -1
  32. package/dist/src/generate-test.test.js +17 -6
  33. package/dist/src/generate-test.test.js.map +1 -1
  34. package/dist/src/prompt.d.ts +64 -0
  35. package/dist/src/prompt.d.ts.map +1 -0
  36. package/dist/src/prompt.js +481 -0
  37. package/dist/src/prompt.js.map +1 -0
  38. package/dist/src/prompt.test.d.ts +2 -0
  39. package/dist/src/prompt.test.d.ts.map +1 -0
  40. package/dist/src/prompt.test.js +136 -0
  41. package/dist/src/prompt.test.js.map +1 -0
  42. package/dist/src/reconcile.d.ts +8 -0
  43. package/dist/src/reconcile.d.ts.map +1 -0
  44. package/dist/src/reconcile.js +18 -0
  45. package/dist/src/reconcile.js.map +1 -0
  46. package/dist/src/reconcile.test.d.ts +2 -0
  47. package/dist/src/reconcile.test.d.ts.map +1 -0
  48. package/dist/src/reconcile.test.js +108 -0
  49. package/dist/src/reconcile.test.js.map +1 -0
  50. package/dist/src/run.d.ts +2 -0
  51. package/dist/src/run.d.ts.map +1 -0
  52. package/dist/src/run.js +86 -0
  53. package/dist/src/run.js.map +1 -0
  54. package/dist/src/spec-contract.d.ts +9 -0
  55. package/dist/src/spec-contract.d.ts.map +1 -0
  56. package/dist/src/spec-contract.js +16 -0
  57. package/dist/src/spec-contract.js.map +1 -0
  58. package/dist/tsconfig.tsbuildinfo +1 -1
  59. package/improvement-prompt.md +208 -0
  60. package/inputs/action-button/spec.json +50 -0
  61. package/inputs/command-palette/spec.json +62 -0
  62. package/inputs/data-card/spec.json +59 -0
  63. package/inputs/editable-data-table/spec.json +70 -0
  64. package/inputs/multi-step-form/spec.json +66 -0
  65. package/inputs/notification-center/spec.json +67 -0
  66. package/inputs/search-input/spec.json +62 -0
  67. package/inputs/status-badge/spec.json +46 -0
  68. package/package.json +4 -3
  69. package/scripts/improve.ts +592 -0
  70. package/src/commands/implement-component.test.ts +14 -5
  71. package/src/commands/implement-component.ts +13 -17
  72. package/src/extract-code-block.test.ts +33 -1
  73. package/src/extract-code-block.ts +13 -0
  74. package/src/generate-component.test.ts +22 -26
  75. package/src/generate-component.ts +5 -46
  76. package/src/generate-story.test.ts +17 -21
  77. package/src/generate-story.ts +5 -40
  78. package/src/generate-test.test.ts +22 -7
  79. package/src/generate-test.ts +5 -44
  80. package/src/prompt.test.ts +163 -0
  81. package/src/prompt.ts +581 -0
  82. package/src/reconcile.test.ts +127 -0
  83. package/src/reconcile.ts +27 -0
  84. package/src/run.ts +106 -0
  85. package/src/spec-contract.ts +22 -0
@@ -0,0 +1,208 @@
1
+ # Component Implementor React — Evaluation & Improvement Prompt
2
+
3
+ ## Your Persona
4
+
5
+ You are a **Staff Frontend Engineer and Tech Lead** — the kind who wrote the component library used by 200 engineers, ran the migration from class components to hooks, and has personally blocked PRs for missing ARIA attributes. You've reviewed thousands of component PRs and you can spot a bad prop interface, a fragile test, or a hollow Storybook story in seconds. You've also seen what happens when AI generates code that "looks right" but falls apart under real usage — tests that pass but don't test anything meaningful, components with prop names that don't match the spec, stories that only cover the happy path.
6
+
7
+ You are allergic to:
8
+ - **Props that don't match the spec language** — if the spec says "loading", the prop must be `loading`, not `isLoading` or `showSpinner`. Inconsistency between spec, component, test, and story is the #1 cause of reconciliation failures.
9
+ - **Tests that don't test behavior** — a test that renders the component and asserts it exists is worthless. Every test must simulate what a user does and assert what a user sees.
10
+ - **Missing ARIA roles** — if the test queries `getByRole('button')` and the component renders a `<div onClick>`, it fails. Semantic HTML is non-negotiable.
11
+ - **Stories that only show the default state** — if the spec has 8 styling variants and 3 rendering states, you'd better see at least 10 stories, not 2.
12
+ - **Component/test misalignment** — different export names, different prop names, different ARIA surfaces. This is exactly what the reconciler exists to fix, but if the initial generation is too far off, reconciliation can't save it.
13
+
14
+ When you score, you score like you're signing off on code that ships to production tomorrow. If a junior engineer would come back with questions, the score goes down. If they'd build something wrong because the code was ambiguous, the score goes way down.
15
+
16
+ ---
17
+
18
+ ## What You're Evaluating
19
+
20
+ A **Component Implementor agent** that transforms spec deltas into three files: a React component, a vitest test file, and a Storybook story file, followed by a reconciliation step that aligns the component and story to the tests. You will be given:
21
+
22
+ 1. **The Spec Deltas** (input) — structured arrays of structure, rendering, interaction, and styling requirements.
23
+ 2. **The Generated Component** (output) — the `.tsx` component file.
24
+ 3. **The Generated Test** (output) — the `.test.tsx` vitest file.
25
+ 4. **The Generated Story** (output) — the `.stories.tsx` Storybook file.
26
+ 5. **The Agent's System Prompts** (the prompts to improve) — the instructions each agent received.
27
+
28
+ ---
29
+
30
+ ## Scoring Rubric (100 points total)
31
+
32
+ Score each category independently. Be strict — a score of 90+ means you'd merge this PR without requesting changes.
33
+
34
+ ### 1. Spec Coverage (20 points)
35
+
36
+ Every spec delta string must be traceable to implementation in the component, a test case, and a story. This is the table-stakes check.
37
+
38
+ | Score | Criteria |
39
+ |-------|----------|
40
+ | 20 | Every structure, rendering, interaction, and styling spec is implemented in the component, tested by at least one test case, and demonstrated by at least one story. You can draw a line from each spec string to code in all three files. |
41
+ | 15 | All specs implemented and tested, but 1-3 specs lack a corresponding story. |
42
+ | 10 | Most specs covered but 2-4 specs are missing from the component or tests. |
43
+ | 5 | Multiple specs are missing across component, tests, and stories. |
44
+ | 0 | Majority of specs not covered. |
45
+
46
+ **How to check:** Walk through each spec delta string. For each one, find: (a) the implementation in the component, (b) the test that validates it, (c) the story that demonstrates it. If any is missing, it's a gap.
47
+
48
+ ### 2. Prop Interface Quality (15 points)
49
+
50
+ The props interface is the component's API. It must be tight, correctly typed, and use names that match the spec language exactly.
51
+
52
+ | Score | Criteria |
53
+ |-------|----------|
54
+ | 15 | Props type is exported. Every prop name matches spec language verbatim (spec says "loading" → prop is `loading`). Types are precise (not `any` or overly loose unions). Optional props have sensible defaults. Callback props use correct signatures. All four files (component, test, story, reconciled) use identical prop names. |
55
+ | 12 | Props are well-typed but 1-2 names diverge from spec language, or one optional prop lacks a default. |
56
+ | 8 | Props exist but several names don't match spec language, or types are loose (e.g., `string` where a union of literals is appropriate). |
57
+ | 3 | Props are poorly typed, names are inconsistent across files, or the type is not exported. |
58
+ | 0 | No exported props type, or props are `any`. |
59
+
60
+ **How to check:** Read the spec deltas and note every implied prop (nouns become props: "loading", "variant", "size", "onClick", "disabled"). Then check: Does the component's Props type have that exact name? Does the test pass that exact name? Does the story use that exact name in args?
61
+
62
+ ### 3. Test Quality (20 points)
63
+
64
+ Tests are the source of truth. They must be precise, behavioral, and comprehensive.
65
+
66
+ | Score | Criteria |
67
+ |-------|----------|
68
+ | 20 | One test per spec delta (or more for complex specs). Semantic queries used everywhere (`getByRole`, `getByText`, `getByLabelText`). No `getByTestId`. Mock callbacks use `vi.fn()` with argument assertions. Test descriptions mirror spec language. Each test is isolated. Tests cover both positive and negative cases for interaction specs (e.g., "calls onClick" AND "does not call onClick when disabled"). |
69
+ | 15 | Good tests but 1-2 use `getByTestId` unnecessarily, or 1-2 specs lack negative case coverage. |
70
+ | 10 | Tests exist for most specs but several use implementation-detail queries, or test descriptions are generic rather than mirroring specs. |
71
+ | 5 | Tests are shallow — many just render and check existence without testing behavior. |
72
+ | 0 | Tests are missing or trivial. |
73
+
74
+ **How to check:** For each test: (a) Does the description match a spec string? (b) Does it use semantic queries? (c) Does it assert a user-visible behavior, not an implementation detail? (d) For interaction specs, is there both a "fires" and "doesn't fire when guarded" test?
75
+
76
+ ### 4. Component Quality (15 points)
77
+
78
+ The component must be production-ready — correct semantics, proper accessibility, clean composition.
79
+
80
+ | Score | Criteria |
81
+ |-------|----------|
82
+ | 15 | Semantic HTML used (button, article, nav — not div for everything). ARIA roles match what tests expect. Named export with exported Props type. Tailwind classes for all styling. No dead code. Conditional rendering is clean (not nested ternaries). Event handlers are properly wired. No unnecessary useState. |
83
+ | 12 | Good component but 1-2 semantic HTML opportunities missed (e.g., div instead of button). |
84
+ | 8 | Component works but has semantic issues, missing ARIA attributes, or messy conditional logic. |
85
+ | 3 | Component has structural problems — wrong exports, missing handlers, broken conditionals. |
86
+ | 0 | Component would not render or has fundamental errors. |
87
+
88
+ ### 5. Story Quality (10 points)
89
+
90
+ Stories must cover the full visual surface and serve as documentation.
91
+
92
+ | Score | Criteria |
93
+ |-------|----------|
94
+ | 10 | CSF3 format. Default story present. One story per rendering state (loading, empty, error). One story per styling variant (primary, secondary, destructive). One story per size. Stories use `args` over custom `render`. Story names are descriptive PascalCase. Meta has correct component reference. |
95
+ | 7 | Good stories but missing 2-3 variant/state stories, or some use unnecessary `render` functions. |
96
+ | 4 | Only Default and 1-2 other stories. Major visual states uncovered. |
97
+ | 0 | No stories or stories are broken. |
98
+
99
+ ### 6. Cross-File Alignment (10 points)
100
+
101
+ After reconciliation, the three files must agree perfectly — same exports, same prop names, same ARIA surface.
102
+
103
+ | Score | Criteria |
104
+ |-------|----------|
105
+ | 10 | Component export name matches test import. All prop names identical across component, test, and story. ARIA roles in component match test queries. Text content in component matches test assertions. Story imports and args match component. |
106
+ | 7 | Minor misalignment — 1-2 prop name inconsistencies or one import path issue. |
107
+ | 4 | Multiple misalignments — tests would fail against the component as written. |
108
+ | 0 | Files are fundamentally misaligned — different export names, different prop interfaces. |
109
+
110
+ ### 7. Code Hygiene (10 points)
111
+
112
+ Clean, idiomatic code that follows modern React/TypeScript conventions.
113
+
114
+ | Score | Criteria |
115
+ |-------|----------|
116
+ | 10 | No unused imports. No `any` types. Consistent formatting. No commented-out code. No console.log statements. TypeScript strict-compatible. ESLint-clean patterns (no shadowed variables, no implicit returns in complex functions). Imports are minimal and correct. |
117
+ | 7 | Minor issues — 1-2 unused imports or one loose type. |
118
+ | 4 | Multiple hygiene issues — unused code, `any` types, inconsistent patterns. |
119
+ | 0 | Code is messy — significant dead code, type errors, or formatting issues. |
120
+
121
+ ---
122
+
123
+ ## Output Format
124
+
125
+ Respond with EXACTLY this JSON structure:
126
+
127
+ ```json
128
+ {
129
+ "totalScore": <number 0-100>,
130
+ "categories": {
131
+ "specCoverage": {
132
+ "score": <number>,
133
+ "maxScore": 20,
134
+ "findings": ["<specific finding 1>", "<specific finding 2>"]
135
+ },
136
+ "propInterfaceQuality": {
137
+ "score": <number>,
138
+ "maxScore": 15,
139
+ "findings": ["..."]
140
+ },
141
+ "testQuality": {
142
+ "score": <number>,
143
+ "maxScore": 20,
144
+ "findings": ["..."]
145
+ },
146
+ "componentQuality": {
147
+ "score": <number>,
148
+ "maxScore": 15,
149
+ "findings": ["..."]
150
+ },
151
+ "storyQuality": {
152
+ "score": <number>,
153
+ "maxScore": 10,
154
+ "findings": ["..."]
155
+ },
156
+ "crossFileAlignment": {
157
+ "score": <number>,
158
+ "maxScore": 10,
159
+ "findings": ["..."]
160
+ },
161
+ "codeHygiene": {
162
+ "score": <number>,
163
+ "maxScore": 10,
164
+ "findings": ["..."]
165
+ }
166
+ },
167
+ "promptImprovements": [
168
+ {
169
+ "priority": "critical | high | medium | low",
170
+ "category": "<which scoring category this addresses>",
171
+ "currentBehavior": "<what the prompt currently produces>",
172
+ "desiredBehavior": "<what it should produce instead>",
173
+ "suggestedPromptChange": "<specific text to add, modify, or remove from the system prompt>"
174
+ }
175
+ ]
176
+ }
177
+ ```
178
+
179
+ ## CRITICAL: Generalization & Anti-Leakage Rules
180
+
181
+ You are evaluating against specific component scenarios, but the prompts you are improving must work for ANY component — a button, a data table, a modal dialog, a checkout form, a dashboard widget. The prompts are general-purpose instruction sets. They must never become coupled to the examples they were tested on.
182
+
183
+ **The cardinal sin is component-specific leakage.** If the test input is a button component and you suggest adding "always include a spinner for loading states" — you've leaked that specific component's behavior into a general-purpose prompt. Not every component has a spinner.
184
+
185
+ ### What you MUST NOT do in prompt improvements:
186
+
187
+ 1. **Never reference specific component names** from the test input (e.g., "Button", "Card", "SearchInput"). The prompt must not contain the vocabulary of any specific component.
188
+ 2. **Never reference specific prop names** from the test input (e.g., "variant", "loading", "onClear"). The prompt should describe patterns for handling props, not name specific props.
189
+ 3. **Never add rules that only make sense for one component type** (e.g., "always add a clear button to inputs" — this is a search input concern, not universal).
190
+
191
+ ### What you MUST do instead:
192
+
193
+ 1. **Express improvements as structural patterns.** Bad: "Add a spinner when loading." Good: "For every rendering spec that describes a conditional element, ensure the component has the corresponding conditional render branch and the test asserts both the visible and hidden states."
194
+ 2. **Use abstract categories, not instances.** Bad: "Handle button variants." Good: "For every styling spec that describes variant-dependent classes, derive a union type prop and apply Tailwind classes conditionally per variant value."
195
+ 3. **Test your suggestion mentally.** Before proposing a change, ask: "Would this rule make sense for a data table? A modal? A tooltip?" If the answer is no, the rule is too specific.
196
+
197
+ ---
198
+
199
+ ## Rules for Prompt Improvements
200
+
201
+ 1. **Be surgical** — suggest specific additions/modifications to the system prompt, not vague advice.
202
+ 2. **Prioritize by impact** — `critical` = tests would fail or specs are uncovered. `high` = poor accessibility or broken cross-file alignment. `medium` = missing stories or weak test descriptions. `low` = code hygiene or style.
203
+ 3. **Never suggest removing existing rules** unless they directly cause a scoring failure.
204
+ 4. **Suggest additions as insertable text blocks** — provide the exact wording that should be added to the prompt, including which section (e.g., "Add to RULES in the Tester Agent:" or "Add to QUALITY CHECKLIST in the Frontend Agent:").
205
+ 5. **Maximum 10 improvements per evaluation** — focus on highest-impact changes.
206
+ 6. **Each improvement must map to a specific scoring deduction** — no speculative improvements.
207
+ 7. **Every improvement must pass the generalization test** — zero component-specific vocabulary from the test input.
208
+ 8. **Specify which agent's prompt to modify** — Frontend Agent, Tester Agent, Story Agent, or Reconciler. Each has its own system prompt.
@@ -0,0 +1,50 @@
1
+ {
2
+ "componentName": "ActionButton",
3
+ "specDeltas": {
4
+ "structure": [
5
+ "Renders a <button> element as the root",
6
+ "Contains a leading icon slot before the label content",
7
+ "Contains a trailing icon slot after the label content",
8
+ "Contains a Spinner element that replaces all content when loading",
9
+ "Accepts children as the primary label content",
10
+ "Contains a tooltip wrapper that shows on hover when tooltip prop is provided"
11
+ ],
12
+ "rendering": [
13
+ "Displays children as the button text",
14
+ "Shows the leading icon when leadingIcon prop is provided",
15
+ "Shows the trailing icon when trailingIcon prop is provided",
16
+ "Shows Spinner and hides label and both icons when loading is true",
17
+ "Renders as disabled when disabled is true",
18
+ "Renders as disabled when loading is true",
19
+ "Shows a brief checkmark icon replacing the label on success, then reverts to label after 1.5 seconds",
20
+ "Shows tooltip text on hover after a 300ms delay when tooltip prop is provided",
21
+ "Renders a badge count indicator overlaying the trailing position when badgeCount is greater than zero",
22
+ "Hides the badge indicator when badgeCount is zero or not provided"
23
+ ],
24
+ "interaction": [
25
+ "Calls onClick handler when clicked",
26
+ "Does not call onClick when disabled is true",
27
+ "Does not call onClick when loading is true",
28
+ "Supports keyboard activation via Enter and Space keys",
29
+ "Calls onKeyDown handler when a key is pressed while focused",
30
+ "Focuses the button programmatically when autoFocus is true on mount",
31
+ "Supports ref forwarding for external focus management"
32
+ ],
33
+ "styling": [
34
+ "Applies primary filled style when variant is primary",
35
+ "Applies secondary outlined style when variant is secondary",
36
+ "Applies destructive red style when variant is destructive",
37
+ "Applies ghost transparent style when variant is ghost",
38
+ "Applies link underline style when variant is link",
39
+ "Applies compact padding and small text when size is sm",
40
+ "Applies standard padding and medium text when size is md",
41
+ "Applies generous padding and large text when size is lg",
42
+ "Applies icon-only square aspect ratio when size is icon",
43
+ "Applies full-width layout stretching to container when fullWidth is true",
44
+ "Reduces opacity to 50% when disabled",
45
+ "Applies press-down scale transform on active state",
46
+ "Applies focus-visible ring outline for keyboard navigation",
47
+ "Applies subtle hover brightness change per variant"
48
+ ]
49
+ }
50
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "componentName": "CommandPalette",
3
+ "specDeltas": {
4
+ "structure": [
5
+ "Renders as a modal overlay covering the full viewport with a centered dialog",
6
+ "Contains a search input at the top of the dialog with an auto-focused text field",
7
+ "Contains a scrollable results list below the search input",
8
+ "Results list is divided into named sections with section header labels",
9
+ "Each result item contains an icon, a primary label, an optional description, and an optional keyboard shortcut hint",
10
+ "Contains a footer bar with contextual hint text showing available keyboard shortcuts",
11
+ "Contains a backdrop overlay behind the dialog that dims the page content",
12
+ "Search input contains a search icon on the leading side and a loading spinner on the trailing side when searching"
13
+ ],
14
+ "rendering": [
15
+ "Shows the dialog when open prop is true",
16
+ "Hides the dialog when open prop is false",
17
+ "Displays all items grouped by section when the search query is empty",
18
+ "Filters items by matching the query against the item label and description using fuzzy matching",
19
+ "Shows only sections that have at least one matching item after filtering",
20
+ "Hides sections that have zero matching items",
21
+ "Highlights the matching characters in item labels with a distinct style",
22
+ "Shows a no-results message with the current query when no items match",
23
+ "Shows the loading spinner in the search input when loading is true",
24
+ "Displays the first item as the active highlighted item by default when results appear",
25
+ "Shows the item description text in a muted style below the primary label",
26
+ "Shows the keyboard shortcut hint right-aligned within each item when provided",
27
+ "Shows a recently used section at the top when recentItems prop is provided and query is empty",
28
+ "Updates the footer hint text based on the currently active item"
29
+ ],
30
+ "interaction": [
31
+ "Calls onClose when the backdrop overlay is clicked",
32
+ "Calls onClose when Escape key is pressed",
33
+ "Calls onSelect with the active item when Enter is pressed",
34
+ "Calls onSelect with the clicked item when a result item is clicked",
35
+ "Navigates the active highlight down with ArrowDown key",
36
+ "Navigates the active highlight up with ArrowUp key",
37
+ "Wraps navigation from the last item to the first and first to the last",
38
+ "Scrolls the active item into view when navigating with keyboard",
39
+ "Calls onQueryChange with the current search text when the input changes",
40
+ "Focuses the search input automatically when the dialog opens",
41
+ "Restores focus to the previously focused element when the dialog closes",
42
+ "Traps focus within the dialog while open so Tab cycles between search input and close area",
43
+ "Does not propagate keyboard events to elements behind the backdrop",
44
+ "Calls onClose when the user selects an item by default unless keepOpenOnSelect is true"
45
+ ],
46
+ "styling": [
47
+ "Backdrop uses a semi-transparent dark overlay with backdrop-blur effect",
48
+ "Dialog has rounded-xl corners with a shadow-2xl drop shadow",
49
+ "Dialog is centered horizontally and positioned in the upper third vertically",
50
+ "Dialog has a max-width of 640px and max-height of 60vh",
51
+ "Active item has a distinct highlighted background color",
52
+ "Hovered items have a subtle background different from the active highlight",
53
+ "Section headers use uppercase text with muted color and small font size",
54
+ "Search input has no visible border and uses a large font size for prominence",
55
+ "Keyboard shortcut hints render as inline code-style badges with monospace font",
56
+ "Matching characters in fuzzy search results use bold font weight",
57
+ "Dialog entrance uses a scale-up and fade-in animation",
58
+ "Dialog exit uses a scale-down and fade-out animation",
59
+ "Results list applies a subtle top border separating it from the search input"
60
+ ]
61
+ }
62
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "componentName": "DataCard",
3
+ "specDeltas": {
4
+ "structure": [
5
+ "Renders an <article> element as the root",
6
+ "Contains an optional media region above the header for images or video thumbnails",
7
+ "Contains a header region with title, optional subtitle, and optional action menu",
8
+ "Contains a metadata row below the header for key-value pairs",
9
+ "Contains a content region as the main body accepting children",
10
+ "Contains an optional footer region with primary and secondary action buttons",
11
+ "Contains an optional overlay region for status banners positioned over the media",
12
+ "Action menu renders as a dropdown triggered by a three-dot icon button in the header"
13
+ ],
14
+ "rendering": [
15
+ "Displays the title prop in the header with text truncation after 2 lines",
16
+ "Displays the subtitle prop below the title when provided",
17
+ "Hides the subtitle area entirely when subtitle is not provided",
18
+ "Displays the media element in the media region when media prop is provided",
19
+ "Shows a placeholder gradient background in the media region when media is not provided and showMediaPlaceholder is true",
20
+ "Hides the media region entirely when media is not provided and showMediaPlaceholder is false",
21
+ "Displays metadata items as label-value pairs in a horizontal row",
22
+ "Shows the action menu trigger when menuItems prop has at least one item",
23
+ "Displays footer content with primaryAction and secondaryAction buttons when provided",
24
+ "Hides the footer region when neither primaryAction nor secondaryAction is provided",
25
+ "Shows a Skeleton placeholder for each region when loading is true",
26
+ "Hides all real content and shows only skeletons when loading is true",
27
+ "Shows the overlay banner text positioned over the media region when overlayText is provided",
28
+ "Renders children inside the content region",
29
+ "Shows an empty state message when children are not provided and emptyText is given"
30
+ ],
31
+ "interaction": [
32
+ "Calls onClick handler when the card body is clicked",
33
+ "Does not call onClick when a button or link inside the card is clicked",
34
+ "Does not call onClick when the action menu is interacted with",
35
+ "Applies focusable behavior with tabindex and role when onClick is provided",
36
+ "Supports keyboard activation via Enter when clickable",
37
+ "Calls onMenuItemClick with the item id when a dropdown menu item is selected",
38
+ "Closes the action menu dropdown when clicking outside",
39
+ "Closes the action menu dropdown when pressing Escape",
40
+ "Calls primaryAction.onClick when the primary footer button is clicked",
41
+ "Calls secondaryAction.onClick when the secondary footer button is clicked"
42
+ ],
43
+ "styling": [
44
+ "Applies elevated shadow when variant is elevated",
45
+ "Applies outlined border with no shadow when variant is outlined",
46
+ "Applies flat style with subtle background and no border or shadow when variant is flat",
47
+ "Applies compact spacing with tight padding when size is sm",
48
+ "Applies standard spacing with normal padding when size is md",
49
+ "Applies generous spacing with relaxed padding when size is lg",
50
+ "Applies hover shadow increase when clickable and variant is elevated",
51
+ "Applies hover border color change when clickable and variant is outlined",
52
+ "Applies rounded-lg corners to the card container",
53
+ "Applies overflow-hidden to clip media content at card borders",
54
+ "Applies a semi-transparent dark overlay gradient on the media region when overlayText is present",
55
+ "Overlay text is white and positioned at the bottom-left of the media region",
56
+ "Action menu trigger appears with reduced opacity and becomes full opacity on card hover"
57
+ ]
58
+ }
59
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "componentName": "EditableDataTable",
3
+ "specDeltas": {
4
+ "structure": [
5
+ "Renders a <div> container wrapping a toolbar, table, and pagination footer",
6
+ "Toolbar contains a search input, column visibility toggle dropdown, bulk action bar, and row count display",
7
+ "Table renders a <table> element with <thead> and <tbody> sections",
8
+ "Each header cell contains the column label and a sort indicator icon",
9
+ "Each body row contains data cells matching the column definitions",
10
+ "Editable cells render an inline input that activates on double-click",
11
+ "Contains a checkbox column as the first column for row selection",
12
+ "Header checkbox selects or deselects all visible rows",
13
+ "Bulk action bar appears above the table when at least one row is selected",
14
+ "Pagination footer contains page size selector, page number buttons, and total row count"
15
+ ],
16
+ "rendering": [
17
+ "Displays column headers from the columns prop array in order",
18
+ "Renders one row per item in the data prop array",
19
+ "Shows a skeleton table with shimmer rows when loading is true",
20
+ "Shows an empty state illustration and message when data is empty and loading is false",
21
+ "Shows the empty state message from emptyMessage prop",
22
+ "Displays the sort indicator as ascending arrow when column is sorted ascending",
23
+ "Displays the sort indicator as descending arrow when column is sorted descending",
24
+ "Hides the sort indicator on columns that are not currently sorted",
25
+ "Displays only columns where visible is true in the column definition",
26
+ "Hides columns where visible is false in the column definition",
27
+ "Shows the active search query as highlighted text within matching cells",
28
+ "Shows the bulk action bar with a count of selected rows when selection is non-empty",
29
+ "Hides the bulk action bar when no rows are selected",
30
+ "Displays the current page range and total count in the pagination footer",
31
+ "Renders cell content using the column renderCell function when provided",
32
+ "Falls back to displaying the raw field value when renderCell is not provided",
33
+ "Shows an inline validation error below an editable cell when editValidation returns an error",
34
+ "Shows a saving spinner in the cell being edited during optimistic save"
35
+ ],
36
+ "interaction": [
37
+ "Calls onSort with column id and direction when a sortable header is clicked",
38
+ "Toggles sort direction on repeated clicks of the same header (asc -> desc -> none)",
39
+ "Calls onSearch with the query string when the toolbar search input changes",
40
+ "Debounces onSearch calls by 300ms after the user stops typing",
41
+ "Calls onRowSelect with the row id and selected state when a row checkbox is toggled",
42
+ "Calls onSelectAll with the selected state when the header checkbox is toggled",
43
+ "Activates inline edit mode on a cell when the cell is double-clicked and the column is editable",
44
+ "Commits the edit and calls onCellEdit with row id, column id, and new value when Enter is pressed",
45
+ "Cancels the edit and reverts to the original value when Escape is pressed during inline edit",
46
+ "Commits the edit when the inline input loses focus",
47
+ "Calls onBulkAction with action id and selected row ids when a bulk action button is clicked",
48
+ "Calls onPageChange with the new page number when a pagination button is clicked",
49
+ "Calls onPageSizeChange with the new size when the page size selector changes",
50
+ "Navigates between editable cells with Tab key while in edit mode",
51
+ "Calls onRowClick with the row data when a row is clicked and the click is not on a checkbox or editable cell"
52
+ ],
53
+ "styling": [
54
+ "Applies alternating row background colors for visual separation (striped)",
55
+ "Applies hover background highlight on rows when hoverable is true",
56
+ "Applies selected background highlight on rows that are checked",
57
+ "Applies sticky positioning to the header row so it remains visible on scroll",
58
+ "Applies compact row height and smaller text when density is compact",
59
+ "Applies standard row height when density is normal",
60
+ "Applies relaxed row height with more padding when density is comfortable",
61
+ "Applies a bottom border to each row",
62
+ "Applies a focused ring to the currently editing cell",
63
+ "Applies truncation with ellipsis to cell content that overflows the column width",
64
+ "Applies a right-aligned style to columns where align is right",
65
+ "Applies a center-aligned style to columns where align is center",
66
+ "Applies a muted text style to the pagination and row count footer elements",
67
+ "Bulk action bar has a distinct info-colored background to indicate active selection mode"
68
+ ]
69
+ }
70
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "componentName": "MultiStepForm",
3
+ "specDeltas": {
4
+ "structure": [
5
+ "Renders a container div wrapping a progress stepper, step content area, and navigation footer",
6
+ "Progress stepper displays a horizontal bar with numbered step circles connected by lines",
7
+ "Each step circle contains the step number or a checkmark icon when the step is completed",
8
+ "Step content area renders only the active step's content as provided by the steps prop",
9
+ "Navigation footer contains a Back button, a Next or Submit button, and an optional Skip link",
10
+ "Contains an optional sidebar summary panel that shows a live preview of accumulated form data",
11
+ "Contains a discard confirmation dialog that appears when the user attempts to navigate away with unsaved changes",
12
+ "Each step can contain an optional step-level error alert below the step title"
13
+ ],
14
+ "rendering": [
15
+ "Displays the current step title and optional description above the step content",
16
+ "Shows the step number inside uncompleted step circles in the progress stepper",
17
+ "Shows a checkmark icon inside completed step circles in the progress stepper",
18
+ "Highlights the active step circle with a distinct ring and color",
19
+ "Shows completed step circles with a filled success style",
20
+ "Shows future step circles in a muted disabled style",
21
+ "Shows connecting lines between steps as filled when the preceding step is completed",
22
+ "Shows connecting lines as unfilled when the preceding step is not completed",
23
+ "Renders the Back button as disabled on the first step",
24
+ "Renders a Submit button instead of Next on the final step",
25
+ "Shows the Skip link only when the current step has optional set to true",
26
+ "Shows a loading spinner on the Submit button when submitting is true",
27
+ "Disables all navigation buttons when submitting is true",
28
+ "Shows the sidebar summary panel when showSummary is true and the viewport is wide enough",
29
+ "Hides the sidebar summary panel on narrow viewports regardless of showSummary",
30
+ "Shows the discard confirmation dialog when hasUnsavedChanges is true and the user clicks a navigation link outside the form",
31
+ "Shows a step-level validation error alert when stepErrors contains an error for the current step index",
32
+ "Clears the step-level error when the user modifies any field in the current step"
33
+ ],
34
+ "interaction": [
35
+ "Calls onNext with the current step index when the Next button is clicked and validation passes",
36
+ "Does not advance to the next step when onValidateStep returns errors for the current step",
37
+ "Calls onBack with the current step index when the Back button is clicked",
38
+ "Calls onSkip with the current step index when the Skip link is clicked",
39
+ "Calls onSubmit with the accumulated form data when the Submit button is clicked on the final step",
40
+ "Calls onStepClick with the step index when a completed step circle is clicked to navigate back",
41
+ "Does not allow clicking on future incomplete step circles to jump forward",
42
+ "Calls onDiscard when the user confirms the discard dialog",
43
+ "Calls onCancelDiscard when the user cancels the discard dialog and returns to the form",
44
+ "Focuses the first focusable element in the new step content when transitioning between steps",
45
+ "Supports Ctrl+Enter as a keyboard shortcut to advance to the next step or submit",
46
+ "Calls onStepChange with the new step index whenever the active step changes",
47
+ "Prevents browser back navigation from leaving the form and shows the discard dialog instead when hasUnsavedChanges is true"
48
+ ],
49
+ "styling": [
50
+ "Active step circle has a ring-2 border with a primary color fill",
51
+ "Completed step circles have a success green background with white checkmark",
52
+ "Future step circles have a gray border and muted gray background",
53
+ "Completed connecting lines use a solid primary color",
54
+ "Incomplete connecting lines use a dashed muted gray style",
55
+ "Step content area has a slide-left entrance animation when advancing forward",
56
+ "Step content area has a slide-right entrance animation when navigating backward",
57
+ "Submit button uses primary variant styling",
58
+ "Back button uses ghost variant styling",
59
+ "Skip link uses a text-only muted style with underline on hover",
60
+ "Sidebar summary panel has a subtle background and a left border accent",
61
+ "Discard dialog uses a destructive styling on the confirm button",
62
+ "Step-level error alert uses a destructive banner style with an icon",
63
+ "Progress stepper is horizontally scrollable on narrow viewports when there are many steps"
64
+ ]
65
+ }
66
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "componentName": "NotificationCenter",
3
+ "specDeltas": {
4
+ "structure": [
5
+ "Renders as a popover panel anchored to a trigger button",
6
+ "Trigger button contains a bell icon and an unread count badge",
7
+ "Panel contains a header with a title, a filter tab bar, and a mark-all-read button",
8
+ "Panel contains a scrollable notification list below the header",
9
+ "Each notification item contains an icon, a title, a body preview, a relative timestamp, and an unread dot indicator",
10
+ "Each notification item contains a hover-revealed action menu with mark-read and dismiss buttons",
11
+ "Panel contains a footer with a view-all link and notification preferences link",
12
+ "Panel contains an empty state illustration and message when there are no notifications for the active filter",
13
+ "Notification items are grouped by date sections (Today, Yesterday, Earlier)"
14
+ ],
15
+ "rendering": [
16
+ "Shows the unread badge on the trigger when unreadCount is greater than zero",
17
+ "Hides the unread badge when unreadCount is zero",
18
+ "Displays unread count as 99+ when unreadCount exceeds 99",
19
+ "Shows the panel when open is true",
20
+ "Hides the panel when open is false",
21
+ "Displays notifications filtered by the active tab (all, unread, mentions)",
22
+ "Shows the unread dot indicator on notifications where read is false",
23
+ "Hides the unread dot on notifications where read is true",
24
+ "Displays relative timestamps (just now, 5m ago, 2h ago, yesterday) using the timestamp field",
25
+ "Shows a loading skeleton list when loading is true",
26
+ "Shows the empty state with a filter-specific message when the filtered list is empty",
27
+ "Shows the date section headers (Today, Yesterday, Earlier) based on notification timestamps",
28
+ "Hides date sections that contain no notifications after filtering",
29
+ "Truncates notification body text to two lines with ellipsis overflow",
30
+ "Shows the hover action menu when the user hovers over a notification item",
31
+ "Hides the hover action menu when the cursor leaves the notification item",
32
+ "Applies a pulse animation to the trigger bell icon when a new notification arrives via the onNewNotification callback"
33
+ ],
34
+ "interaction": [
35
+ "Calls onToggle to open or close the panel when the trigger button is clicked",
36
+ "Calls onClose when clicking outside the panel while it is open",
37
+ "Calls onClose when Escape is pressed while the panel is open",
38
+ "Calls onNotificationClick with the notification id when a notification item is clicked",
39
+ "Calls onMarkRead with the notification id when the mark-read action is clicked",
40
+ "Calls onDismiss with the notification id when the dismiss action is clicked",
41
+ "Calls onMarkAllRead when the mark-all-read header button is clicked",
42
+ "Calls onFilterChange with the new tab value when a filter tab is selected",
43
+ "Calls onViewAll when the view-all footer link is clicked",
44
+ "Calls onPreferencesClick when the preferences footer link is clicked",
45
+ "Loads more notifications by calling onLoadMore when the list is scrolled to the bottom",
46
+ "Does not close the panel when interacting with notification action menus",
47
+ "Traps focus within the panel when open and navigates items with ArrowUp and ArrowDown",
48
+ "Marks a notification as read automatically when it is clicked via onNotificationClick"
49
+ ],
50
+ "styling": [
51
+ "Trigger button applies a subtle bounce animation on the bell when a new notification arrives",
52
+ "Unread badge is positioned at the top-right of the trigger with a red background and white text",
53
+ "Panel has a rounded-xl shadow with a fixed width of 400px and max-height of 500px",
54
+ "Panel appears with a slide-down and fade-in animation from the trigger position",
55
+ "Panel disappears with a slide-up and fade-out animation",
56
+ "Active filter tab has a bold text weight and a colored bottom border indicator",
57
+ "Inactive filter tabs have muted text and no bottom border",
58
+ "Unread notification items have a subtle highlighted background",
59
+ "Read notification items have a standard background",
60
+ "Notification timestamps use a muted and small text style",
61
+ "Unread dot indicator is a small colored circle positioned at the leading edge of the item",
62
+ "Hover action menu appears with a short fade-in transition on the trailing side of the item",
63
+ "Date section headers use uppercase small text with extra top margin for visual separation",
64
+ "Mark-all-read button uses a ghost style with muted text that becomes prominent on hover"
65
+ ]
66
+ }
67
+ }