UNPKG

@gravity-ui/uikit

Version:

Gravity UI base styling and components

21 lines (20 loc) 1.56 kB
'use client'; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ActionsPanel = void 0; const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const icons_1 = require("@gravity-ui/icons"); const Button_1 = require("../Button/index.js"); const Icon_1 = require("../Icon/index.js"); const Text_1 = require("../Text/index.js"); const cn_1 = require("../utils/cn.js"); const CollapseActions_1 = require("./components/CollapseActions.js"); const i18n_1 = tslib_1.__importDefault(require("./i18n/index.js")); require("./ActionsPanel.css"); const b = (0, cn_1.block)('actions-panel'); const ActionsPanel = ({ className, actions, onClose, renderNote, noteClassName, qa, maxRowActions, }) => { return ((0, jsx_runtime_1.jsxs)("div", { className: b(null, className), "data-qa": qa, children: [typeof renderNote === 'function' && ((0, jsx_runtime_1.jsx)(Text_1.Text, { className: b('note-wrapper', noteClassName), as: "div", color: "light-primary", variant: "subheader-2", ellipsis: true, children: renderNote() })), (0, jsx_runtime_1.jsx)(CollapseActions_1.CollapseActions, { actions: actions, maxRowActions: maxRowActions }), typeof onClose === 'function' && ((0, jsx_runtime_1.jsx)(Button_1.Button, { view: "flat-contrast", size: "m", onClick: onClose, className: b('button-close'), "aria-label": (0, i18n_1.default)('label_close'), children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { data: icons_1.Xmark }, "icon") }))] })); }; exports.ActionsPanel = ActionsPanel; //# sourceMappingURL=ActionsPanel.js.map