Skip to content

Commit 99163e6

Browse files
Copilothectahertz
andcommitted
Update Box.stories.tsx to no longer use styled-components
Co-authored-by: hectahertz <[email protected]>
1 parent 1004c5e commit 99163e6

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.PlaygroundBox {
2+
border-width: var(--borderWidth-thin);
3+
border-style: solid;
4+
border-color: var(--borderColor-default);
5+
padding: var(--base-size-12);
6+
}

packages/react/src/Box/Box.stories.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import type {Meta, StoryFn} from '@storybook/react-vite'
22
import Box from './Box'
3+
import {clsx} from 'clsx'
4+
import classes from './Box.stories.module.css'
35

46
export default {
57
title: 'Deprecated/Components/Box',
68
component: Box,
79
} as Meta<typeof Box>
810

9-
export const Default = () => <Box>Default Box</Box>
11+
export const Default = () => <div>Default Box</div>
1012

11-
export const Playground: StoryFn<typeof Box> = args => <Box {...args}>Playground</Box>
13+
export const Playground: StoryFn<typeof Box> = args => {
14+
const as = args.as || 'div'
15+
const Element = as as keyof JSX.IntrinsicElements
16+
return <Element className={clsx(classes.PlaygroundBox)}>Playground</Element>
17+
}
1218

1319
Playground.args = {
1420
as: 'div',
15-
sx: {
16-
borderWidth: 1,
17-
borderStyle: 'solid',
18-
borderColor: 'border.default',
19-
p: 3,
20-
},
2121
}
2222

2323
Playground.argTypes = {

0 commit comments

Comments
 (0)