@yandex/ui
Version:
Yandex UI components
17 lines (16 loc) • 1.33 kB
JavaScript
import { __read } from "tslib";
import React, { useRef, useState } from 'react';
import { Button } from '@yandex-lego/components/Button/desktop/bundle';
import { Text } from '@yandex-lego/components/Text/bundle';
import { Icon } from '@yandex-lego/components/Icon/bundle';
import { Dropdown } from '@yandex-lego/components/Dropdown/desktop';
import { SampleMenu } from './SampleMenu';
export var Arrow = function () {
var anchor = useRef(null);
var _a = __read(useState(false), 2), visible = _a[0], setVisible = _a[1];
return (React.createElement(React.Fragment, null,
React.createElement(Text, { as: "h2", typography: "headline-l" }, "\u041F\u0440\u0438\u043C\u0435\u0440 \u0441\u043E \u0438\u043A\u043E\u043D\u043A\u043E\u0439 \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0435"),
React.createElement("div", null,
React.createElement(Dropdown, { onVisibleChange: function (isVisible) { return setVisible(isVisible); }, trigger: "click", view: "default", hasTail: true, content: React.createElement(SampleMenu, null) },
React.createElement(Button, { innerRef: anchor, theme: "normal", size: "s", iconRight: function (className) { return (React.createElement(Icon, { direction: visible ? 'top' : 'bottom', glyph: "type-arrow", className: className })); } }, "Click me")))));
};