File tree Expand file tree Collapse file tree 3 files changed +69
-0
lines changed
packages/ui-components/Common/CircularIcon Expand file tree Collapse file tree 3 files changed +69
-0
lines changed Original file line number Diff line number Diff line change 1+ @reference "../../styles/index.css" ;
2+
3+ .icon {
4+ @apply flex
5+ items-center
6+ justify-center
7+ rounded-full
8+ font-semibold
9+ text-white;
10+
11+ & .lg {
12+ @apply h-12
13+ w-12
14+ text-2xl;
15+ }
16+
17+ & .md {
18+ @apply h-10
19+ w-10
20+ text-xl;
21+ }
22+
23+ & .sm {
24+ @apply h-8
25+ w-8;
26+ }
27+ }
Original file line number Diff line number Diff line change 1+ import type { Meta as MetaObj , StoryObj } from '@storybook/react' ;
2+
3+ import CircularIcon from '#ui/Common/CircularIcon' ;
4+
5+ type Story = StoryObj < typeof CircularIcon > ;
6+ type Meta = MetaObj < typeof CircularIcon > ;
7+
8+ export const Icons : Story = {
9+ render : ( ) => (
10+ < div style = { { display : 'flex' , gap : '16px' , alignItems : 'center' } } >
11+ < CircularIcon symbol = "B" color = "#3b82f6" size = "sm" />
12+ < CircularIcon symbol = "G" color = "#10b981" size = "md" />
13+ < CircularIcon symbol = "R" color = "#ef4444" size = "lg" />
14+ </ div >
15+ ) ,
16+ } ;
17+
18+ export default { component : CircularIcon } as Meta ;
Original file line number Diff line number Diff line change 1+ import classNames from 'classnames' ;
2+
3+ import styles from './index.module.css' ;
4+
5+ interface CircularIconProps {
6+ symbol : string ;
7+ color : string ;
8+ size ?: 'lg' | 'md' | 'sm' ;
9+ }
10+
11+ export default function CircularIcon ( {
12+ symbol,
13+ color,
14+ size = 'md' ,
15+ } : CircularIconProps ) {
16+ return (
17+ < div
18+ className = { classNames ( styles . icon , styles [ size ] ) }
19+ style = { { backgroundColor : color } }
20+ >
21+ < span > { symbol } </ span >
22+ </ div >
23+ ) ;
24+ }
You can’t perform that action at this time.
0 commit comments