UNPKG

@kiwicom/orbit-components

Version:

Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.

28 lines (26 loc) 1.05 kB
import * as React from "react"; import styled from "styled-components"; import defaultTheme from "../defaultTheme"; import { StyledButtonLink } from "../ButtonLink"; import { StyledButton } from "../Button"; import { borderRadius, rtlSpacing } from "../utils/rtl"; const StyledButtonGroup = styled.div.withConfig({ displayName: "ButtonGroup__StyledButtonGroup", componentId: "sc-82hrp5-0" })(["display:flex;", ",", "{border-radius:0;margin:", ";:first-child{border-radius:", ";}:last-child{border-radius:", ";margin:0;}}"], StyledButtonLink, StyledButton, ({ theme }) => rtlSpacing(theme.orbit.marginButtonGroup), ({ theme }) => borderRadius(`${theme.orbit.borderRadiusNormal} 0 0 ${theme.orbit.borderRadiusNormal}`), ({ theme }) => borderRadius(`0 ${theme.orbit.borderRadiusNormal} ${theme.orbit.borderRadiusNormal} 0`)); StyledButtonGroup.defaultProps = { theme: defaultTheme }; const ButtonGroup = ({ children, dataTest }) => React.createElement(StyledButtonGroup, { "data-test": dataTest }, children); export default ButtonGroup;