diff --git a/src/components/common/Badge/index.tsx b/src/components/common/Badge/index.tsx index 7417460..786915b 100644 --- a/src/components/common/Badge/index.tsx +++ b/src/components/common/Badge/index.tsx @@ -1,7 +1,7 @@ import './styles.scss'; import clsx from 'clsx'; -import React, { FC, ReactNode } from 'react'; +import React, { FC, HTMLAttributes, ReactNode } from 'react'; import { Icon, IconName } from '~/components/common/Icon'; import { useCombinedPropsWithKit } from '~/hooks'; @@ -20,7 +20,9 @@ export enum BadgeColor { PURPLE = 'purple', } -export interface BadgeProps { +type AllowedDivProps = Pick, 'className' | 'style'>; + +export interface BadgeProps extends AllowedDivProps { children: ReactNode; color: BadgeColor; icon?: IconName; @@ -28,14 +30,17 @@ export interface BadgeProps { } export const Badge: FC = props => { - const { children, color, icon, filled } = useCombinedPropsWithKit({ + const { children, color, icon, filled, className, style } = useCombinedPropsWithKit({ name: 'Badge', props, }); + return ( -
+
{icon !== undefined && } -

{children}

+

+ {children} +

); }; diff --git a/src/components/form/Checkbox/index.tsx b/src/components/form/Checkbox/index.tsx index 097f078..34d6605 100644 --- a/src/components/form/Checkbox/index.tsx +++ b/src/components/form/Checkbox/index.tsx @@ -1,18 +1,20 @@ import clsx from 'clsx'; -import React, { useId } from 'react'; +import React, { ReactNode, useId } from 'react'; import { Icon } from '~/components/common/Icon'; import { useCombinedPropsWithKit } from '~/hooks'; import styles from './styles.module.scss'; -export interface CheckboxProps extends React.AllHTMLAttributes { - label?: string; +export interface CheckboxProps extends Omit, 'label'> { + label?: string | ReactNode | null; + borderColor?: string; + checkedColor?: string; onChange?: (e: React.ChangeEvent) => void; } export const Checkbox = React.forwardRef((props, ref) => { - const { label, className, ...inputProps } = useCombinedPropsWithKit({ + const { label, className, checkedColor, borderColor, ...inputProps } = useCombinedPropsWithKit({ name: 'Checkbox', props, }); @@ -21,7 +23,11 @@ export const Checkbox = React.forwardRef((props const checkboxId = `checkbox-${id}`; return ( -