-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Styled inline since I'll need to rewrite in TailwindCSS anyways
- Loading branch information
1 parent
7eb3113
commit 23e881f
Showing
2 changed files
with
59 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { Chip } from 'src/views/components/common/Chip/Chip'; | ||
|
||
const meta = { | ||
title: 'Components/Common/Chip', | ||
component: Chip, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
label: { control: 'text' }, | ||
}, | ||
} satisfies Meta<typeof Chip>; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
label: 'QR', | ||
}, | ||
}; |
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,35 @@ | ||
import classNames from 'classnames'; | ||
import React from 'react'; | ||
import Text from '../Text/Text'; | ||
import styles from './Chip.module.scss'; | ||
|
||
|
||
export const flags = ["WR", "QR", "GC", "CD", "E", "II"] | ||
|
||
interface Props { | ||
label: string; | ||
} | ||
|
||
/** | ||
* A reusable chip component that follows the design system of the extension. | ||
* @returns | ||
*/ | ||
export function Chip({ | ||
label | ||
}: React.PropsWithChildren<Props>): JSX.Element { | ||
return ( | ||
<Text as = {'div'} variant = 'h4' | ||
style = {{ | ||
display: "inline-flex", | ||
minWidth: "21px", | ||
padding: "1px 4px", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
gap: "10px", | ||
borderRadius: "8px", | ||
background: "#FFD600", //Yellow | ||
}}> | ||
{label} | ||
</Text> | ||
); | ||
} |