Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions packages/ui-components/Common/CircularIcon/index.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@reference "../../styles/index.css";

.icon {
@apply flex
items-center
justify-center
rounded-full
font-semibold
text-white;

&.lg {
@apply h-12
w-12
text-2xl;
}

&.md {
@apply h-10
w-10
text-xl;
}

&.sm {
@apply h-8
w-8;
}
}
18 changes: 18 additions & 0 deletions packages/ui-components/Common/CircularIcon/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Meta as MetaObj, StoryObj } from '@storybook/react';

import CircularIcon from '#ui/Common/CircularIcon';

type Story = StoryObj<typeof CircularIcon>;
type Meta = MetaObj<typeof CircularIcon>;

export const Icons: Story = {
render: () => (
<div className="flex items-center gap-4">
<CircularIcon symbol="B" color="#3b82f6" size="sm" />
<CircularIcon symbol="G" color="#10b981" size="md" />
<CircularIcon symbol="R" color="#ef4444" size="lg" />
</div>
),
};

export default { component: CircularIcon } as Meta;
24 changes: 24 additions & 0 deletions packages/ui-components/Common/CircularIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import classNames from 'classnames';

import styles from './index.module.css';

interface CircularIconProps {
symbol: string;
color: string;
size?: 'lg' | 'md' | 'sm';
}

export default function CircularIcon({
symbol,
color,
size = 'md',
}: CircularIconProps) {
return (
<div
className={classNames(styles.icon, styles[size])}
style={{ backgroundColor: color }}
>
<span>{symbol}</span>
</div>
);
}
Loading