/
sdds
/
plasma
Обзор
Документация
Войти
/
sdds
/
plasma
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
dev
utils/plasma-sb-utils/src/components/NumberInput/NumberInput.tsx
50 строк
1 KB
Krivonos Aleksandr
feat(plasma-new-hope): add layout-related props to NumberInput
13 мар 2026, 12:37
13 мар 2026, 12:37
21181b1
Код
Авторство
О чём код?
import React from 'react'; import { disableProps, getConfigVariations } from '../../helpers'; import { createMeta } from './meta'; import { createDefaultStory, createDisplayWithoutValueStory } from './stories'; type CreateStoriesProps = { component: any; componentConfig: any; disablePropsList?: string[]; defaultArgs?: {}; additionalArgTypes?: {}; }; export const getNumberInputStories = (config: CreateStoriesProps) => { const { component, componentConfig, ...rest } = config; const numberInputConfig = getConfigVariations(componentConfig); const meta = createMeta({ component, componentConfig: numberInputConfig, ...rest, }); const DefaultStoryComponent = createDefaultStory(component); const DisplayWithoutValueStoryComponent = createDisplayWithoutValueStory(component); const Default = { argsTypes: { ...rest.additionalArgTypes, ...disableProps(['displayWithoutValue']), }, render: (args: any) => <DefaultStoryComponent {...args} />, }; const DisplayWithoutValue = { args: { displayWithoutValue: 'increment', }, render: (args: any) => <DisplayWithoutValueStoryComponent {...args} />, }; return { meta, Default, DisplayWithoutValue, }; };