Skip to content

Commit

Permalink
Tweak styles/story
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepinho committed Jul 31, 2024
1 parent 63d9764 commit f9d6f4e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
27 changes: 7 additions & 20 deletions packages/ui/src/Card/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ import { Card } from '.';
import storiesBg from './storiesBg.png';
import styled from 'styled-components';
import { Text } from '../Text';
import { Tabs } from '../Tabs';
import { useState } from 'react';

const BgWrapper = styled.div`
background: ${props => props.theme.color.base.black};
padding: ${props => props.theme.spacing(20)};
position: relative;
Expand All @@ -20,6 +17,7 @@ const BgWrapper = styled.div`
filter: blur(4px);
position: absolute;
inset: 0;
z-index: -1;
}
`;

Expand All @@ -33,35 +31,24 @@ const meta: Meta<typeof Card> = {
</BgWrapper>
),
],
argTypes: {
as: {
options: ['section', 'div', 'main'],
},
},
};
export default meta;

type Story = StoryObj<typeof Card>;

export const Basic: Story = {
args: {
as: 'div',
as: 'section',
},

render: function Render({ as }) {
const [selectedTab, setSelectedTab] = useState('one');

return (
<Card as={as} title='Card Title'>
<Tabs
value={selectedTab}
onChange={setSelectedTab}
options={[
{
label: 'One',
value: 'one',
},
{
label: 'Two',
value: 'two',
},
]}
/>
<Text p>This is the card content.</Text>
<Text p>Here is some more content.</Text>
</Card>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface CardProps {
title?: string;
}

export const Card = ({ children, as, title }: CardProps) => {
export const Card = ({ children, as = 'section', title }: CardProps) => {
return (
<Root as={as}>
{title && <Title>{title}</Title>}
Expand Down

0 comments on commit f9d6f4e

Please sign in to comment.