Skip to content

Commit

Permalink
Merge pull request #457 from pixiv/toshusai/add-active-state
Browse files Browse the repository at this point in the history
feat: Implemented active state for Button, IconButton, and DropdownSelector.
  • Loading branch information
toshusai authored Feb 8, 2024
2 parents 73024d7 + 230135f commit 5c78abc
Show file tree
Hide file tree
Showing 16 changed files with 653 additions and 688 deletions.
5 changes: 5 additions & 0 deletions docs/src/pages/@charcoal-ui/react/Button/apiData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ export const apiData: Omit<
type: toEnum(sizes),
default: '"M"',
},
isActive: {
description: 'ボタンの押下状態',
type: 'boolean',
default: 'false',
},
}
10 changes: 10 additions & 0 deletions docs/src/pages/@charcoal-ui/react/Button/sections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,14 @@ export const sections: PreviewSection<ButtonProps>[] = [
children: variant,
})),
},
{
title: 'isActive',
previewMetas: variants.map((variant) => ({
props: {
variant,
isActive: true,
},
children: variant,
})),
},
]
5 changes: 5 additions & 0 deletions docs/src/pages/@charcoal-ui/react/IconButton/apiData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ export const apiData: Omit<
description: 'スタイルの種類',
type: '"Default" | "Overlay"',
},
isActive: {
description: 'ボタンの押下状態',
type: 'boolean',
default: 'false',
},
}
21 changes: 21 additions & 0 deletions docs/src/pages/@charcoal-ui/react/IconButton/sections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,25 @@ export const sections: PreviewSection<IconButtonProps>[] = [
},
],
},
{
title: 'isActive',
previewMetas: [
{
children: undefined,
props: {
icon: '24/Add',
variant: 'Default',
isActive: true,
},
},
{
children: undefined,
props: {
icon: '24/Add',
variant: 'Overlay',
isActive: true,
},
},
],
},
]
Loading

0 comments on commit 5c78abc

Please sign in to comment.