@yandex/ui
Version:
Yandex UI components
14 lines (13 loc) • 912 B
JavaScript
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 View = function () {
var scopeRef = useRef(null);
var anchorRef = useRef(null);
var _a = __read(useState(false), 2), visible1 = _a[0], setVisible1 = _a[1];
return (React.createElement("div", { ref: scopeRef },
React.createElement(Button, { onClick: function () { return setVisible1(!visible1); }, innerRef: anchorRef, view: "default", size: "m" }, "Open popup"),
React.createElement(Popup, { hasTail: true, target: "anchor", anchor: anchorRef, direction: "bottom", view: "default", visible: visible1, scope: scopeRef },
React.createElement("div", { style: { padding: 8, fontFamily: 'var(--control-font-family)' } }, "Default"))));
};