Skip to content

Commit

Permalink
fix(Chip): size のデフォルトが Story 上のコードに反映されないように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
uknmr committed Nov 6, 2024
1 parent 369350f commit 124d8c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/smarthr-ui/src/components/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ const chip = tv({
true: 'shr-bg-white/50 shr-text-disabled',
},
},
defaultVariants: {
size: 's',
},
})

export const Chip: FC<Props> = ({ size = 's', disabled, className, ...props }) => {
export const Chip: FC<Props> = ({ size, disabled, className, ...props }) => {
const styles = useMemo(() => chip({ size, disabled, className }), [size, disabled, className])
return <span {...props} className={styles} />
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ export default {
title: 'Data Display(データ表示)/Chip',
component: Chip,
render: (args) => <Chip {...args} />,
argTypes: {
size: {
control: 'select',
},
},
args: {
children: 'ラベル',
},
Expand Down

0 comments on commit 124d8c3

Please sign in to comment.