mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-12 10:33:32 -05:00
b1c40d05f7
[web] Fix the Button component accessibility label GitOrigin-RevId: 1d157fca370c5e0425890468d7cad169d0261c23
43 lines
931 B
TypeScript
43 lines
931 B
TypeScript
import IconButton from '@/features/ui/components/bootstrap-5/icon-button'
|
|
import type { Meta } from '@storybook/react'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
type Args = React.ComponentProps<typeof IconButton>
|
|
|
|
export const Icon = (args: Args) => {
|
|
const { t } = useTranslation()
|
|
|
|
return <IconButton accessibilityLabel={t('add')} disabled {...args} />
|
|
}
|
|
|
|
const meta: Meta<typeof IconButton> = {
|
|
title: 'Shared / Components / Bootstrap 5 / IconButton',
|
|
component: IconButton,
|
|
args: {
|
|
disabled: false,
|
|
icon: 'add',
|
|
isLoading: false,
|
|
},
|
|
argTypes: {
|
|
size: {
|
|
control: 'radio',
|
|
options: ['small', 'default', 'large'],
|
|
},
|
|
variant: {
|
|
control: 'radio',
|
|
options: [
|
|
'primary',
|
|
'secondary',
|
|
'ghost',
|
|
'danger',
|
|
'danger-ghost',
|
|
'premium',
|
|
],
|
|
},
|
|
},
|
|
parameters: {
|
|
bootstrap5: true,
|
|
},
|
|
}
|
|
|
|
export default meta
|