overleaf/services/web/frontend/stories/ui/icon-button.stories.tsx
Rebeka Dekany b1c40d05f7 Merge pull request #17568 from overleaf/rd-b5-button-fix
[web] Fix the Button component accessibility label

GitOrigin-RevId: 1d157fca370c5e0425890468d7cad169d0261c23
2024-03-28 09:04:02 +00:00

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