Skip to content

Commit 3daa5d3

Browse files
Copilothectahertz
andauthored
Update SelectPanel.features stories to no longer use styled-components (#6474)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: hectahertz <[email protected]> Co-authored-by: Hector Garcia <[email protected]>
1 parent e6c7614 commit 3daa5d3

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.ColorCircle {
2+
display: block;
3+
width: 14px;
4+
height: 14px;
5+
border-radius: var(--borderRadius-large);
6+
margin: auto;
7+
border: var(--borderWidth-default) solid;
8+
box-sizing: border-box;
9+
}
10+
11+
.MutedText {
12+
color: var(--fgColor-muted);
13+
display: inline-block;
14+
}

packages/react/src/SelectPanel/SelectPanel.features.stories.tsx

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, {useState, useRef, useEffect} from 'react'
22
import type {Meta, StoryObj} from '@storybook/react-vite'
3-
import Box from '../Box'
43
import {Button} from '../Button'
54
import type {ItemInput, GroupedListProps} from '../deprecated/ActionList/List'
65
import Link from '../Link'
@@ -27,6 +26,7 @@ import Text from '../Text'
2726
import FormControl from '../FormControl'
2827
import {SegmentedControl} from '../SegmentedControl'
2928
import {Stack} from '../Stack'
29+
import classes from './SelectPanel.features.stories.module.css'
3030

3131
const meta: Meta<typeof SelectPanel> = {
3232
title: 'Components/SelectPanel/Features',
@@ -62,15 +62,12 @@ const ErrorMessage: {variant: 'error'; title: string; body: string} = {
6262
function getColorCircle(color: string) {
6363
return function () {
6464
return (
65-
<Box
66-
bg={color}
67-
borderColor={color}
68-
width={14}
69-
height={14}
70-
borderRadius={10}
71-
margin="auto"
72-
borderWidth="1px"
73-
borderStyle="solid"
65+
<div
66+
className={classes.ColorCircle}
67+
style={{
68+
backgroundColor: color,
69+
borderColor: color,
70+
}}
7471
/>
7572
)
7673
}
@@ -530,15 +527,7 @@ export const WithLabelInternally = () => {
530527
<SelectPanel
531528
renderAnchor={({children, ...anchorProps}) => (
532529
<Button {...anchorProps} trailingAction={TriangleDownIcon} aria-haspopup="dialog">
533-
<Box
534-
sx={{
535-
color: 'var(--fgColor-muted)',
536-
display: 'inline-block',
537-
}}
538-
>
539-
Choices:
540-
</Box>{' '}
541-
{children || 'None selected'}
530+
<span className={classes.MutedText}>Choices:</span> {children || 'None selected'}
542531
</Button>
543532
)}
544533
open={open}

0 commit comments

Comments
 (0)