import ICONS from './icons' import DefaultButton from './DefaultButton.vue' const icons = Object.keys(ICONS) export default { title: 'The Design system/Buttons/Default button', component: DefaultButton, tags: ['autodocs'], args: { isDisabled: false, isLoading: false, isError: false, isShowTooltip: false, isActive: false, label: 'Добавить', size: 'M', color: '', colorDisabled: '', colorHover: '', }, argTypes: { type: { description: 'Вариант внешнего вида кнопки', control: { type: 'radio' }, options: ['primary', 'secondary', 'tertiary'], defaultValue: 'primary', }, isDisabled: { options: [true, false], control: { type: 'boolean' }, }, icon: { options: ['', ...icons], control: { type: 'select' }, }, size: { description: 'Вариант размера кнопки', options: ['M', 'S'], control: { type: 'radio' }, }, }, } const Template = (args: any) => ({ props: Object.keys(args), render() { const table = 'display: grid; gap: 30px 15px; grid-template-columns: 10% repeat(7, min-content); align-items: center; justify-items: center;' const title = 'text-align: center; margin:0 0 5px; font-size: 14px; line-height: 16px; color: #585B69; font-weight: 400;' const plate = 'display: flex; flex-direction: column; align-items: center; width: min-content; padding: 10px;' return (
Primary M
Default
Disable
Error
With icon
Icon
Disabled
Error
Secondary M
Disable
Disable
Error
With icon
Icon
Disabled
Error
Tertiary M
Disable
Disable
Error
With icon
Icon
Disabled
Error
Critical M
Default
Disable
Error
With icon
Icon
Disabled
Error
Primary S
Default
Disable
Error
With icon
Icon
Disabled
Error
Secondary S
Disable
Disable
Error
With icon
Icon
Disabled
Error
Tertiary S
Disable
Disable
Error
With icon
Icon
Disabled
Error
Critical S
Default
Disable
Error
With icon
Icon
Disabled
Error
) }, }) export const Primary = Template.bind({}) const TooltipTemplate = (args: any) => ({ render() { return (
Проверка на максимальную ширину с тултипом

Пропс `label` и `isShowTooltip` захардкоржены

) }, }) export const Tooltip = TooltipTemplate.bind({}) const ActionTemplate = (args: any) => ({ render() { return (
Кнопка с дополнительным действием
{}, positionCorrectingX: -53, }} />
) }, }) export const Action = ActionTemplate.bind({}) const SlotTemplate = (args: any) => ({ render() { return (
Кнопка с правым слотом
<> } />
) }, }) export const Slot = SlotTemplate.bind({})