UNPKG

@yandex/ui

Version:

Yandex UI components

13 lines (12 loc) 894 B
import { __read } from "tslib"; import React, { useRef, useState } from 'react'; import { Popup } from '@yandex-lego/components/Popup/desktop/bundle'; import { Button } from '@yandex-lego/components/Button/desktop/bundle'; export var Nonvisual = function () { var _a = __read(useState(false), 2), visible = _a[0], setVisible = _a[1]; var anchorRef = useRef(null); return (React.createElement("div", { style: { display: 'flex' } }, React.createElement(Button, { onClick: function () { return setVisible(!visible); }, innerRef: anchorRef, view: "default", size: "m" }, "Open popup"), React.createElement(Popup, { hasTail: true, target: "anchor", anchor: anchorRef, direction: "bottom", view: "default", nonvisual: true, visible: visible }, React.createElement("div", { style: { padding: 8, fontFamily: 'var(--control-font-family)' } }, "Nonvisual")))); };