Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 11, 2025

This PR removes styled-components usage from packages/react/src/DialogV1/Dialog.stories.tsx as part of the ongoing migration away from styled-components.

Changes Made

  • Removed Box component usage: Replaced <Box sx={{mb: 3}}> and <Box p={3}> with custom <div> elements
  • Created CSS module: Added Dialog.stories.module.css with appropriate styles using design tokens
  • Added clsx for className combination: Imported and used clsx for combining CSS classes
  • Updated imports: Removed Box from imports and added clsx and CSS module imports

Migration Details

Before:

import {Box, Text} from '..'

<Box sx={{mb: 3}}>
  <Banner ... />
</Box>
<Box p={3}>
  <Text>Some content</Text>
</Box>

After:

import {Text} from '..'
import {clsx} from 'clsx'
import classes from './Dialog.stories.module.css'

<div className={clsx(classes.BannerContainer)}>
  <Banner ... />
</div>
<div className={clsx(classes.ContentContainer)}>
  <Text>Some content</Text>
</div>

The CSS module uses design tokens for consistent spacing:

.BannerContainer {
  margin-bottom: var(--base-size-24);
}

.ContentContainer {
  padding: var(--base-size-24);
}

Testing

The story continues to work exactly as before with proper styling and functionality. Screenshots show the component renders correctly with the deprecation warning banner and dialog functionality intact.

DialogV1 story working

Dialog opened successfully

Fixes #6569.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link

changeset-bot bot commented Aug 11, 2025

⚠️ No Changeset found

Latest commit: ed05637

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 Dialog.stories.tsx to no longer use styled-components Update Dialog.stories.tsx to no longer use styled-components Aug 11, 2025
@Copilot Copilot AI requested a review from hectahertz August 11, 2025 16:59
Copilot finished work on behalf of hectahertz August 11, 2025 16:59
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 Dialog.stories.tsx to no longer use styled-components
2 participants