{"ast":null,"code":"var __jsx = React.createElement;\nimport React from 'react';\nimport { dangerActiveColor, dangerColor, dangerFocusedColor, ellipsis, em, half, primaryActiveColor, primaryColor, primaryFocusedColor, textInvertColor, transitionProps } from '~/utils/style';\nimport RawIcon from '~/components/Icon';\nimport styled from 'styled-components';\nconst height = em(36);\nconst colors = {\n  primary: {\n    default: primaryColor,\n    active: primaryActiveColor,\n    focused: primaryFocusedColor\n  },\n  danger: {\n    default: dangerColor,\n    active: dangerActiveColor,\n    focused: dangerFocusedColor\n  }\n};\nconst Wrapper = styled.a.withConfig({\n  displayName: \"Button__Wrapper\",\n  componentId: \"huj3qe-0\"\n})([\"cursor:pointer;height:\", \";line-height:\", \";border-radius:\", \";background-color:\", \";color:\", \";display:block;text-align:center;\", \" \", \" &:hover,&:focus{background-color:\", \";}&:active{background-color:\", \";}\"], height, height, half(height), props => colors[props.type].default, textInvertColor, transitionProps('background-color'), ellipsis(), props => colors[props.type].focused, props => colors[props.type].active);\nconst Icon = styled(RawIcon).withConfig({\n  displayName: \"Button__Icon\",\n  componentId: \"huj3qe-1\"\n})([\"margin-right:4px;\"]);\n\nconst Button = ({\n  icon,\n  type,\n  children,\n  className,\n  onClick\n}) => __jsx(Wrapper, {\n  className: className,\n  onClick: onClick,\n  type: type || 'primary'\n}, icon && __jsx(Icon, {\n  type: icon\n}), children);\n\nexport default Button;","map":null,"metadata":{},"sourceType":"module"}