UNPKG

@redocly/theme

Version:

Shared UI components lib

38 lines (34 loc) 1.35 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ButtonGroup = ButtonGroup; const react_1 = __importDefault(require("react")); const styled_components_1 = __importDefault(require("styled-components")); function ButtonGroup(props) { const { variant = 'outlined', className = '', children, size = 'medium' } = props; return (react_1.default.createElement(ButtonGroupWrapper, { "data-component-name": "Button/ButtonGroup", className: `button-group-${variant} button-group-size-${size} ${className}` }, children)); } const ButtonGroupWrapper = styled_components_1.default.div ` display: flex; line-height: var(--button-line-height); .button { border-radius: 0; } & > .button:first-child, *:first-child > .button { border-top-left-radius: var(--button-border-radius); border-bottom-left-radius: var(--button-border-radius); } & > .button:last-child, *:last-child > .button { border-top-right-radius: var(--button-border-radius); border-bottom-right-radius: var(--button-border-radius); } & > .button:not(:first-child), *:not(:first-child) > .button { border-left: none; } `; //# sourceMappingURL=ButtonGroup.js.map