Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 11, 2025

This PR removes styled-components usage from the TreeView.stories.tsx file by migrating the Box component with sx prop to a custom component using CSS modules.

Changes Made

  • Removed Box import: Eliminated the import of the deprecated Box component
  • Added CSS module: Created TreeView.stories.module.css with a .Container class that provides max-width: 400px styling
  • Replaced Box with div: Changed the story decorator from <Box sx={{maxWidth: 400}}> to <div className={clsx(styles.Container)}>
  • Added clsx import: Imported clsx for proper className handling following the project's patterns

Before

import Box from '../Box'

const meta: Meta = {
  decorators: [
    Story => (
      <Box sx={{maxWidth: 400}}>
        <Story />
      </Box>
    ),
  ],
}

After

import {clsx} from 'clsx'
import styles from './TreeView.stories.module.css'

const meta: Meta = {
  decorators: [
    Story => (
      <div className={clsx(styles.Container)}>
        <Story />
      </div>
    ),
  ],
}

The functionality remains identical - the TreeView story is still wrapped with a container that has a maximum width of 400px, but now uses CSS modules instead of styled-components. All builds, tests, and Storybook compilation pass successfully.

Fixes #6564.


💬 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: 7a37312

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