Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 11, 2025

This PR removes styled-components usage from the Box component Storybook stories as part of the ongoing migration away from the library.

Changes Made

Created CSS Module for Story Styles

  • Added Box.stories.module.css with equivalent styles for the previous sx prop usage
  • Converted styled-system values to CSS design tokens:
    • borderWidth: 1border-width: var(--borderWidth-thin)
    • borderStyle: 'solid'border-style: solid
    • borderColor: 'border.default'border-color: var(--borderColor-default)
    • p: 3padding: var(--base-size-12)

Updated Story Components

  • Default story: Replaced <Box>Default Box</Box> with <div>Default Box</div>
  • Playground story: Replaced Box usage with dynamic HTML element creation based on the as prop, applying CSS module classes instead of the sx prop
  • Added imports for clsx utility and CSS module classes
  • Removed the sx prop from Playground.args while preserving the as prop functionality

Maintained Compatibility

  • Kept the Box import for component meta definition (required for Storybook)
  • Preserved all existing argTypes configuration
  • Maintained the same visual appearance and interactive functionality

The stories now render identically to before but use CSS modules instead of styled-components, reducing the codebase's dependency on the deprecated styling approach.

Fixes #6577.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link

changeset-bot bot commented Aug 11, 2025

⚠️ No Changeset found

Latest commit: 99163e6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Copilot Copilot AI changed the title [WIP] Update Box.stories.tsx to no longer use styled-components Update Box.stories.tsx to no longer use styled-components Aug 11, 2025
@Copilot Copilot AI requested a review from hectahertz August 11, 2025 17:02
Copilot finished work on behalf of hectahertz August 11, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Box.stories.tsx to no longer use styled-components
2 participants