@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.
36 lines (33 loc) • 1.29 kB
JavaScript
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import * as React from "react";
import styled, { css } from "styled-components";
import Button from "../../Button";
import defaultTheme from "../../defaultTheme";
const StyledButton = styled.div.withConfig({
displayName: "ActiveButton__StyledButton",
componentId: "sc-1j3a7nx-0"
})(["&:hover,&:active,&:focus{background:", ";color:", ";transform:none;cursor:default;}", ";"], ({
theme
}) => theme.orbit.backgroundButtonSecondary, ({
theme
}) => theme.orbit.colorTextButtonSecondary, ({
transparent
}) => transparent && css(["&&&{background-color:transparent;}"]));
StyledButton.defaultProps = {
theme: defaultTheme
};
const ActiveButton = ({
children,
transparent,
size
}) => {
return React.createElement(Button, {
type: "secondary",
size: size,
asComponent: props => React.createElement(StyledButton, _extends({}, props, {
type: undefined,
transparent: transparent
}))
}, children);
};
export default ActiveButton;