Commit 84bee65
committed
Atomic migration: Merge CalloutCTA into Callout with optional CTA slot
## Simplification
**Before:** Two components (Callout + CalloutCTA) forced "which one?" decision
**After:** One Callout component with optional `<slot name="cta">` composition
## Implementation
### Callout.astro
- Add CTA section styling (CVA variants matching parent callout)
- Add conditional `{Astro.slots.has('cta')}` rendering
- Maintain all existing props/variants
- Zero breaking changes for Callout-only usage
### Migration (23 instances)
- statsbomb.mdx: 2 CalloutCTA → Callout with CTA slot
- callout-cta-demo.astro: 10 CalloutCTA → Callout (+ demo page renamed to callout-demo.astro)
- Callout.stories.ts: Added 3 CTA slot examples
### Cleanup
- Delete src/components/CalloutCTA.astro (wrapper component no longer needed)
- Rename callout-cta-demo.astro → callout-demo.astro
- Delete GITHUB-SETTINGS-CHECKLIST.md (completed manual task)
### Documentation
- CLAUDE.md: Update component examples and forbidden patterns
- README.md: Update repo structure and story points
- Callout.stories.ts: Add CTA slot examples (PrimaryWithCTA, SecondaryWithCTA, WarningWithCTA)
## Usage Patterns
**Without CTA slot (information only):**
```astro
<Callout variant="primary" title="Insight" icon="lightbulb">
<Body>Making illegal states unrepresentable...</Body>
</Callout>
```
**With CTA slot (dedicated action section):**
```astro
<Callout variant="secondary" title="Dive Deeper" icon="code">
<Body>ANTLR grammar, XState machines...</Body>
<Fragment slot="cta">
<Button variant="ghost" size="sm" href="#">View Appendix →</Button>
</Fragment>
</Callout>
```
## Cognitive Overhead Reduction
- ✅ One component to learn (not two)
- ✅ Composition pattern (slots) instead of wrapper
- ✅ Simpler mental model: "Need CTA? Add slot!"
- ✅ Atomic migration (zero CalloutCTA references remain)
## Complexity: 11 story points
- Callout.astro update: 3 points
- Migrate 23 instances: 5 points
- Update documentation: 2 points
- Cleanup + verification: 1 point1 parent 9ef014c commit 84bee65
File tree
8 files changed
+154
-278
lines changed- src
- components
- pages
- portfolio
8 files changed
+154
-278
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
| 419 | + | |
419 | 420 | | |
420 | 421 | | |
421 | 422 | | |
422 | 423 | | |
423 | | - | |
| 424 | + | |
424 | 425 | | |
425 | 426 | | |
426 | 427 | | |
| |||
479 | 480 | | |
480 | 481 | | |
481 | 482 | | |
482 | | - | |
| 483 | + | |
483 | 484 | | |
484 | 485 | | |
485 | 486 | | |
| |||
557 | 558 | | |
558 | 559 | | |
559 | 560 | | |
560 | | - | |
| 561 | + | |
561 | 562 | | |
562 | 563 | | |
563 | 564 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
48 | 79 | | |
49 | 80 | | |
50 | 81 | | |
| |||
88 | 119 | | |
89 | 120 | | |
90 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
91 | 128 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
This file was deleted.
0 commit comments