Skip to content

[Task] Implement Radio Button #49

@soroushm

Description

@soroushm

Task Description ✏️

Implement the Radio component as part of the design system epic #40.
Radio provides a consistent toggle control for selecting a single option within a group. It will consume theme tokens for colors, spacing, and sizing, support controlled checked state, disabled state, and custom icons.

Acceptance Criteria ✅

  • Radio component implemented.
  • Supports controlled checked state.
  • Supports disabled prop.
  • Supports color prop (default, primary, secondary, error, info, success, warning) mapped to theme tokens.
  • Supports size prop (small, medium) mapped to theme spacing and icon sizes.
  • Supports custom icon and checkedIcon props for unchecked and checked visuals.
  • Supports id, required, and inputProps for accessibility and forms.
  • Supports onChange callback for state changes.
  • Renders children or label text correctly associated with the input.
  • Unit tests verify checked state, disabled state, color, size, icon rendering, and onChange behavior.
  • Storybook stories demonstrate all states (checked, unchecked, disabled) and color/size/icon variations.
  • No raw CSS values — all styles derived from theme tokens.
  • Code passes linting, typing, and CI checks.

Dependencies 🔗

No response

Definition of Ready (DoR) 📋

  • Task is independent and scoped to the Radio component.
  • Base primitive and theme tokens are implemented and available.
  • Props to be supported by Radio are agreed upon (checked, disabled, color, size, icon, checkedIcon, id, required, inputProps, onChange).

Definition of Done (DoD) 🏁

  • Radio component implemented with controlled checked support.
  • Color, size, checked, disabled, and icons work correctly.
  • onChange fires correctly for user interaction.
  • Unit tests cover all states and props.
  • Storybook stories demonstrate all states, sizes, colors, and icons.
  • Code reviewed, linted, typed, and passes CI checks.
  • Documentation updated in Storybook for Radio usage.
  • Component is ready for reuse across the design system.

Additional Notes or Resources 📎

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions