-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08e25c8
commit a1aab3d
Showing
15 changed files
with
154 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useContext } from 'react'; | ||
import { ThemeContext } from 'styled-components'; | ||
|
||
import { Box, BoxProps } from '../../primal'; | ||
import { DefaultThemeWithDefaultStyles } from '../../utils'; | ||
|
||
export type Props = BoxProps; | ||
export const Actions = ({ children, ...rest }: Props) => { | ||
const theme = useContext<DefaultThemeWithDefaultStyles>(ThemeContext); | ||
return ( | ||
<Box {...theme.defaultStyles?.cardActions} {...rest}> | ||
{children} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default Actions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useContext } from 'react'; | ||
import { ThemeContext } from 'styled-components'; | ||
|
||
import { Box, BoxProps } from '../../primal'; | ||
import { DefaultThemeWithDefaultStyles } from '../../utils'; | ||
|
||
export type Props = BoxProps; | ||
|
||
export const Card = ({ children, ...rest }: Props) => { | ||
const theme = useContext<DefaultThemeWithDefaultStyles>(ThemeContext); | ||
|
||
return ( | ||
<Box {...theme.defaultStyles?.card} {...rest}> | ||
{children} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default Card; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { useContext } from 'react'; | ||
import { ThemeContext } from 'styled-components'; | ||
|
||
import { Box, BoxProps } from '../../primal'; | ||
import { DefaultThemeWithDefaultStyles } from '../../utils'; | ||
|
||
export type Props = BoxProps; | ||
export const Content = ({ children, ...rest }: Props) => { | ||
const theme = useContext<DefaultThemeWithDefaultStyles>(ThemeContext); | ||
|
||
return ( | ||
<Box {...theme.defaultStyles?.cardContent} {...rest}> | ||
{children} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default Content; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { default as CardAction, Props as CardActionProps } from './Actions'; | ||
import Card, { Props as CardProps } from './Card'; | ||
import { default as CardContent, Props as CardContentProps } from './Content'; | ||
|
||
export { | ||
Card, | ||
CardProps, | ||
CardContent, | ||
CardContentProps, | ||
CardAction, | ||
CardActionProps, | ||
}; | ||
|
||
export default Card; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
|
||
import Button from '../button'; | ||
|
||
import { Card } from './Card'; | ||
|
||
import { CardAction, CardContent } from './index'; | ||
|
||
export default { | ||
title: 'Components / Atoms / Card', | ||
component: Card, | ||
} as ComponentMeta<typeof Card>; | ||
|
||
const Template: ComponentStory<typeof Card> = args => <Card {...args} />; | ||
|
||
export const Basic = Template.bind({}); | ||
|
||
Basic.args = { | ||
children: ( | ||
<> | ||
<CardContent> | ||
<p>Word of the day</p> | ||
<p>be•nev•o•lent</p> | ||
<p>adjective</p> | ||
<p>well meaning and kindly. a benevolent smile</p> | ||
</CardContent> | ||
<CardAction> | ||
<Button size='sm'>Test Button</Button> | ||
</CardAction> | ||
</> | ||
), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters