Skip to content

fix(spacer): complete atom review#165

Merged
egdev6 merged 2 commits into
mainfrom
fix/spacer-review-complete
May 17, 2026
Merged

fix(spacer): complete atom review#165
egdev6 merged 2 commits into
mainfrom
fix/spacer-review-complete

Conversation

@egdev6
Copy link
Copy Markdown
Member

@egdev6 egdev6 commented May 17, 2026

Summary

Completes the Spacer atom review checklist.

Closes #135

Type of change

  • 🧩 New component
  • 🐛 Bug fix
  • 🎨 Design tokens
  • ♿ Accessibility
  • 🏗️ Infrastructure
  • 📚 Documentation

Component checklist (skip if not applicable)

  • Follows the 5-file structure (types.ts, use*.ts, Component.tsx, index.ts, *.stories.tsx)
  • CVA variants defined in types.ts, not inline
  • No hardcoded colors — uses tokens from theme.css
  • No any types — TypeScript strict
  • ARIA attributes present and correct
  • Keyboard navigable (Tab, Enter, Escape where applicable)
  • Dark mode works correctly
  • Storybook stories cover: default, variants, states (hover, focus, disabled)
  • Tests added or updated

How to test

  1. pnpm test -- src/components/atoms/spacer/Spacer.test.tsx
  2. pnpm exec tsc --noEmit
  3. pnpm exec biome check src/components/atoms/spacer
  4. pnpm run storybook-build
  5. Open Storybook and verify the Spacer stories show invisible spacing between visible markers.

Screenshots / recordings (if applicable)

Not included.

Notes for reviewer

  • Spacer is intentionally invisible. Stories visualize the distance between surrounding markers, not the spacer element itself.
  • Keyboard navigation is not applicable because Spacer is non-interactive and aria-hidden by default.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes the Spacer atom review by migrating it from inline-style spacing to token-based Tailwind/CVA-driven spacing, adding a clearer axis/size API while keeping legacy directional overrides, and rounding it out with tests and updated Storybook examples.

Changes:

  • Reworked Spacer to render spacing via Tailwind classes computed by useSpacer (axis/size + spaceX/spaceY overrides) and default aria-hidden behavior.
  • Added a typed spacing scale map + CVA variants in types.ts to keep spacing aligned with the design-token scale.
  • Added unit/component tests and refreshed Storybook stories to visualize spacing between markers.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/components/atoms/spacer/useSpacer.ts Computes resolved spacing (axis/size + overrides) and returns merged className + ariaHidden.
src/components/atoms/spacer/types.ts Introduces CVA variants and a constrained, token-aligned spacing scale type.
src/components/atoms/spacer/Spacer.tsx Switches Spacer rendering to class-based layout and applies aria-hidden.
src/components/atoms/spacer/Spacer.test.tsx Adds tests for hook logic and component aria-hidden / className behavior.
src/components/atoms/spacer/Spacer.stories.tsx Updates stories to demonstrate default, axis variants, and legacy overrides via markers.
src/components/atoms/spacer/index.ts Updates exports to match named Spacer export.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/atoms/spacer/types.ts
@egdev6 egdev6 merged commit c57bc2a into main May 17, 2026
6 checks passed
@egdev6 egdev6 deleted the fix/spacer-review-complete branch May 17, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

atom: Spacer — review and complete

2 participants