UNPKG

@yandex/ui

Version:

Yandex UI components

18 lines (17 loc) 988 B
import { __read } from "tslib"; import React, { useState } from 'react'; import { select, boolean, object } from '@storybook/addon-knobs'; import { Radiobox } from '@yandex-lego/components/Radiobox/desktop/bundle'; export var Playground = function () { var _a = __read(useState('a'), 2), value = _a[0], setValue = _a[1]; var size = select('size', ['m', 's'], 'm'); var view = select('view', ['default', 'outline', ''], 'default'); var theme = view === '' ? select('theme', ['normal', 'pseudo'], 'normal') : null; var options = object('options', [ { label: 'Option A', value: 'a' }, { label: 'Option B', value: 'b' }, { label: 'Option C (disabled)', value: 'c', disabled: true }, ]); var disabled = boolean('disabled', false); return (React.createElement(Radiobox, { disabled: disabled, size: size, theme: theme, view: view, value: value, onChange: function (event) { return setValue(event.target.value); }, options: options })); };