Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
withInfo()(() => (
))
)
.add('Basic', () => (
))
.add('With extra text', () => (
.add('Basic', () => (
I'm body text inside a Box component
{({ isOpen, setIsOpen }) => (
setIsOpen(false)
}
size={select('size', ['m', 'l', 'scale'], 'l')}
zIndex={number('z-index', 1000)}
labelSecondary={text('label secondary', '') || undefined}
labelPrimary={text('label primary', '') || undefined}
isPrimaryButtonDisabled={boolean('isPrimaryButtonDisabled', false)}
onCancel={() => {
alert('cancelled');
setIsOpen(false);
}}
onConfirm={() => {
alert('confirmed');
setIsOpen(false);
}}
>
{boolean('show paragraph 1', true) && (
{text(
<div>
<h2>Controlled example</h2>
<button> this.setState({ isClosed: false })}>
Open
</button>
<button> this.setState({ isClosed: true })}>
Close
</button>
<div>
<div>Some content before</div>
{({ toggle, containerStyles, registerContentNode }) => (
<div>
<div>
<button>Toggle</button>
</div>
<div style="{containerStyles}">
<div>
</div></div></div></div></div>
type: select('Unit type (type)', typeOptions, 'Usd'),
output: select(
'Output decimal name (output)',
decimalOptions,
'million'
),
from: select('Input decimal name (from)', decimalOptions, undefined),
minimumFractionDigits: number(
'minimum number of fraction digits to use (minimumFractionDigits)',
undefined
),
maximumFractionDigits: number(
'minimum number of fraction digits to use (maximumFractionDigits)',
undefined
),
maximumSignificantDigits: number(
'maximum number of significant digits to use (maximumSignificantDigits)',
undefined
),
hideEmpty: text('hide value if empty (hideEmpty)', undefined),
};
const value = text('value', 1000000);
return {value};
},
{
.add('Compact', () => (
{({ number, text, isActive, ...others }) => {
return (
<button size="small" disabled="{isActive}" label="{text}">
);
}}
</button>
.add('Компонент', () => {
const props = {
multiple: boolean('multiple', meta.multiple),
showTooltip: boolean('showTooltip', meta.showTooltip),
tooltipPlacement: select(
'tooltipPlacement',
['top', 'bottom', 'left', 'right'],
meta.tooltipPlacement
),
step: number('step', meta.step),
vertical: boolean('vertical', meta.showTooltip),
disabled: boolean('disabled', meta.showTooltip),
dots: boolean('dots', meta.showTooltip),
min: number('min', meta.min),
max: number('min', meta.max),
marks: {},
pushable: boolean('pushable', meta.showTooltip),
};
return ;
})
.add('Метаданные', form(() => meta))
() => {
return (
<section>
<svg width="{100}" height="{100}">
</svg>
</section>
);
},
{ notes }
min: 0.0,
max: 1.0,
step: 0.05,
};
const colors = [color('colors 0', 'red'), color('colors 1', 'blue')];
const props = {
colors,
start: {
x: number('start x', 0.5, options),
y: number('start y', 0.0, options),
},
end: {
x: number('end x', 0.5, options),
y: number('end y', 1.0, options),
},
locations: [number('locations 0', 0, options), number('locations 1', 1, options)],
};
return (
<>
(