zent
Version:
一套前端设计语言和基于React的实现
13 lines (12 loc) • 736 B
JavaScript
import { __assign, __rest } from "tslib";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import cx from 'classnames';
import { Button } from '../button';
import Icon from '../icon';
import { DropdownContext } from './DropdownContext';
export var DropdownButton = function (_a) {
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
return (_jsx(DropdownContext.Consumer, { children: function (visible) { return (_jsxs(Button, __assign({ className: cx(className, 'zent-dropdown-button', {
'zent-dropdown-button--active': visible,
}) }, props, { children: [children, _jsx(Icon, { type: "down" }, void 0)] }), void 0)); } }, void 0));
};