UNPKG

@yandex/ui

Version:

Yandex UI components

43 lines (42 loc) 1.84 kB
import { __read } from "tslib"; import React, { useState } from 'react'; import { select, boolean, object } from '@storybook/addon-knobs'; import { RadioButton } from '@yandex-lego/components/RadioButton/desktop/bundle'; import { Icon } from '@yandex-lego/components/Icon/bundle'; export var Playground = function () { var _a = __read(useState('b'), 2), value = _a[0], setValue = _a[1]; var size = select('size', ['s', 'm', 'l'], 'm'); var view = select('view', ['default', ''], 'default'); var disabled = boolean('disabled', false); var options = object('options', [ { value: 'a', children: 'Option A', }, { value: 'b', children: React.createElement(Icon, { type: "filter", style: { width: 12 } }), }, { value: 'c', children: (React.createElement(React.Fragment, null, React.createElement(Icon, { glyph: "type-check", style: { width: 16, marginRight: 4 } }), "Option C")), }, { value: 'd', children: (React.createElement(React.Fragment, null, "Option D (", React.createElement("b", null, "disabled"), ")")), disabled: true, }, { value: 'e', children: (React.createElement(React.Fragment, null, "Option E", React.createElement(Icon, { glyph: "type-check", style: { width: 16, marginLeft: 4 } }))), }, ]); return (React.createElement(RadioButton, { size: size, view: view, disabled: disabled, options: options, value: value, onChange: function (event) { return setValue(event.target.value); }, "aria-label": "\u0420\u0430\u0434\u0438\u043E\u0433\u0440\u0443\u043F\u043F\u0430" })); };