/
sdds
/
plasma
Обзор
Документация
Войти
/
sdds
/
plasma
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
dev
utils/plasma-sb-utils/src/components/Button/Button.tsx
62 строки
1 KB
Бычек Илья Александрович
fix(*): add custom to sdds-insol icon
25 ноя 2025, 11:23
25 ноя 2025, 11:23
157c918
Код
Авторство
О чём код?
import React from 'react'; import { disableProps, getConfigVariations } from '../../helpers'; import { createMeta } from './meta'; import { createDefaultStory } from './stories'; type CreateStoriesProps = { component: any; componentConfig: any; title?: string; disablePropsList?: string[]; defaultArgs?: {}; additionalArgTypes?: {}; additionalComponents: { Counter: any; Icon?: any; }; }; export const getButtonStories = (config: CreateStoriesProps) => { const { component, componentConfig, additionalComponents, ...rest } = config; const { Counter, Icon } = additionalComponents; const buttonConfig = getConfigVariations(componentConfig); const meta = createMeta({ component, componentConfig: buttonConfig, ...rest, }); const DefaultStoryComponent = createDefaultStory(component, { Counter, Icon }); const Default = { render: (args: any) => <DefaultStoryComponent {...args} />, args: { value: '', }, argTypes: { ...disableProps(['value']), }, }; const WithValue = { render: (args: any) => <DefaultStoryComponent {...args} />, args: { enableContentLeft: false, enableCounter: false, value: 'Value', }, argTypes: { ...disableProps(['enableContentRight']), }, }; return { meta, Default, WithValue, }; };