UNPKG

@yandex/ui

Version:

Yandex UI components

19 lines (18 loc) 1.19 kB
import { __read } from "tslib"; import React, { useState } from 'react'; import { withAutoFocus } from '@yandex-lego/components/withAutoFocus'; import { Button } from '@yandex-lego/components/Button/Button.bundle/desktop'; import { Textinput } from '@yandex-lego/components/Textinput/Textinput.bundle/desktop'; var InputWithAutoFocus = withAutoFocus(Textinput); export var Default = function () { var _a = __read(useState(false), 2), isFocused = _a[0], setIsFocused = _a[1]; return (React.createElement(React.Fragment, null, React.createElement(Button, { onClick: function () { return setIsFocused(true); }, view: "action", size: "m" }, " \u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0444\u043E\u043A\u0443\u0441 "), " \u00A0", React.createElement(Button, { onClick: function () { return setIsFocused(false); }, view: "default", size: "m" }, " \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u043E\u043A\u0443\u0441 "), " ", React.createElement("br", null), " ", React.createElement("br", null), React.createElement(InputWithAutoFocus, { view: "default", focused: isFocused, size: "m" }))); };