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.

33 lines (30 loc) 1.58 kB
import * as React from "react"; import styled, { css } from "styled-components"; import defaultTheme from "../defaultTheme"; import { borderRadius, rtlSpacing } from "../utils/rtl"; import { StyledButtonPrimitive } from "../primitives/ButtonPrimitive"; import mq from "../utils/mediaQuery"; var 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;}}", ";"], StyledButtonPrimitive, function (_ref) { var theme = _ref.theme; return rtlSpacing(theme.orbit.marginButtonGroup); }, borderRadius("6px 0 0 6px"), borderRadius("0 6px 6px 0"), mq.tablet(css(["", "{:first-child{border-radius:", ";}:last-child{border-radius:", ";}}"], StyledButtonPrimitive, function (_ref2) { var theme = _ref2.theme; return borderRadius("".concat(theme.orbit.borderRadiusNormal, " 0 0 ").concat(theme.orbit.borderRadiusNormal)); }, function (_ref3) { var theme = _ref3.theme; return borderRadius("0 ".concat(theme.orbit.borderRadiusNormal, " ").concat(theme.orbit.borderRadiusNormal, " 0")); }))); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 StyledButtonGroup.defaultProps = { theme: defaultTheme }; var ButtonGroup = function ButtonGroup(_ref4) { var children = _ref4.children, dataTest = _ref4.dataTest; return /*#__PURE__*/React.createElement(StyledButtonGroup, { "data-test": dataTest }, children); }; export default ButtonGroup;