"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.CardSection = void 0;

var _react = _interopRequireDefault(require("react"));

var _styledComponents = _interopRequireWildcard(require("styled-components"));

var _branding = require("../../../../mixins/branding");

var _box = require("../../../../primitives/box");

var _behaviors = require("../../../behaviors");

var _card = require("../card.css-rules");

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

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); }

var commonStyles = (0, _styledComponents.css)(["border-bottom:solid 1px ", ";&:last-of-type{border-bottom:none;}"], (0, _branding.getPaletteColor)('greyscale-light'));
var SectionBox = (0, _styledComponents["default"])(_box.Box).withConfig({
  displayName: "SectionBox",
  componentId: "sc-157zeye-0"
})(["", ""], commonStyles);
var SectionButton = (0, _styledComponents["default"])(_behaviors.UnstyledButton).withConfig({
  displayName: "SectionButton",
  componentId: "sc-157zeye-1"
})(["display:block;width:100%;", " &:hover{background:", ";}&:first-child{border-radius:", " ", " 0 0;}&:last-child{border-radius:0 0 ", " ", ";}"], commonStyles, (0, _branding.getPaletteColor)('background'), _card.getCardBorderRadius, _card.getCardBorderRadius, _card.getCardBorderRadius, _card.getCardBorderRadius);

var CardSection = function CardSection(props) {
  return props.onClick ? /*#__PURE__*/_react["default"].createElement(SectionButton, _extends({}, props, {
    insetFocus: true
  })) : /*#__PURE__*/_react["default"].createElement(SectionBox, props);
};

exports.CardSection = CardSection;