UNPKG

@age/quantum

Version:
48 lines (41 loc) 2.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _propTypes = _interopRequireDefault(require("prop-types")); var _styledComponents = _interopRequireDefault(require("styled-components")); var _theme = require("../../shared/theme"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var ActionButton = _styledComponents.default.a.withConfig({ displayName: "ActionButton", componentId: "r0oz6v-0" })(["cursor:pointer;font-weight:normal;outline:none;text-align:center;text-decoration:none;transition:color 0.2s ease-in-out,background-color 0.2s ease-in-out,border 0.2s ease-in-out;user-select:none;white-space:nowrap;border-radius:4px;", ""], function (_ref) { var _ref$theme = _ref.theme, _ref$theme$colors$pri = _ref$theme.colors.primary, primary100 = _ref$theme$colors$pri[100], primary700 = _ref$theme$colors$pri[700], _ref$theme$spacing = _ref$theme.spacing, xxxsmall = _ref$theme$spacing.xxxsmall, xxsmall = _ref$theme$spacing.xxsmall, xsmall = _ref$theme$spacing.xsmall, medium = _ref$theme$spacing.medium; return "\n border: ".concat(xxxsmall, "px solid transparent;\n margin: 0 ").concat(xxsmall, "px;\n padding: ").concat(xsmall, "px ").concat(medium, "px;\n color: ").concat(primary700, ";\n\n &[aria-disabled=true] {\n display: none;\n }\n\n &[aria-disabled=false] {\n :hover,\n :focus {\n background-color: ").concat(primary100, ";\n border: 2px solid ").concat(primary700, ";\n }\n }\n "); }); ActionButton.propTypes = { onClick: _propTypes.default.func, tabIndex: _propTypes.default.number, theme: _propTypes.default.shape({ colors: _propTypes.default.object, spacing: _propTypes.default.object }) }; ActionButton.defaultProps = { onClick: function onClick() {}, theme: { colors: _theme.colors, spacing: _theme.spacing } }; var _default = ActionButton; exports.default = _default;