-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor/card
- Loading branch information
Showing
24 changed files
with
1,652 additions
and
981 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,55 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { Button } from './Button' | ||
|
||
const meta: Meta<typeof Button> = { | ||
title: 'Components/Buttons/Button', | ||
component: Button, | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof Button> | ||
|
||
export const Elevated: Story = { | ||
args: { | ||
onClick: () => {}, | ||
variant: 'elevated', | ||
label: 'Home', | ||
}, | ||
decorators: [], | ||
} | ||
|
||
export const Filled: Story = { | ||
args: { | ||
onClick: () => {}, | ||
variant: 'filled', | ||
label: 'Home', | ||
}, | ||
decorators: [], | ||
} | ||
|
||
export const FilledTonal: Story = { | ||
args: { | ||
onClick: () => {}, | ||
variant: 'filled-tonal', | ||
label: 'Home', | ||
}, | ||
decorators: [], | ||
} | ||
|
||
export const Outlined: Story = { | ||
args: { | ||
onClick: () => {}, | ||
variant: 'outlined', | ||
label: 'Home', | ||
}, | ||
decorators: [], | ||
} | ||
|
||
export const Text: Story = { | ||
args: { | ||
onClick: () => {}, | ||
variant: 'text', | ||
label: 'Home', | ||
}, | ||
decorators: [], | ||
} |
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,49 @@ | ||
import React from 'react' | ||
import clsx from 'clsx' | ||
|
||
type IButtonVariants = | ||
| 'elevated' | ||
| 'filled' | ||
| 'filled-tonal' | ||
| 'outlined' | ||
| 'text' | ||
|
||
export type ButtonProps = { | ||
onClick: () => void | ||
variant: IButtonVariants | ||
label: string | ||
dataCy?: string | ||
fullWidth?: boolean | ||
} | ||
|
||
export const Button = ({ | ||
onClick, | ||
variant, | ||
label, | ||
fullWidth, | ||
dataCy, | ||
}: ButtonProps) => { | ||
return ( | ||
<button | ||
data-cy={dataCy} | ||
onClick={onClick} | ||
className={clsx( | ||
'rounded-full text-sm w-fit font-medium px-5 py-2 shadow-elevation-0', | ||
{ | ||
'text-primary shadow-elevation-1 hover:bg-primary/8 hover:shadow-elevation-2 focus:shadow-elevation-1': | ||
variant === 'elevated', | ||
'text-on-primary bg-primary hover:brightness-108 hover:saturate-108': | ||
variant === 'filled', | ||
'text-on-secondary-container bg-secondary-container hover:brightness-108 hover:saturate-108': | ||
variant === 'filled-tonal', | ||
'text-primary border border-outline bg-surface hover:brightness-108 hover:saturate-108': | ||
variant === 'outlined', | ||
'text-primary hover:bg-primary/8': variant === 'text', | ||
'block w-full': fullWidth, | ||
} | ||
)} | ||
> | ||
{label} | ||
</button> | ||
) | ||
} |
Oops, something went wrong.