"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

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

var _Flex = require("../Flex");

var _Stack = require("../Stack");

var _Tag = require("../Tag");

var _styles = _interopRequireWildcard(require("./styles"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }

var __jsx = _react["default"].createElement;

var FullTag = function FullTag(_ref) {
  var _ref$variant = _ref.variant,
      variant = _ref$variant === void 0 ? 'subtle' : _ref$variant,
      _ref$variantColor = _ref.variantColor,
      variantColor = _ref$variantColor === void 0 ? 'gray' : _ref$variantColor,
      label = _ref.label,
      subLabel = _ref.subLabel,
      onClose = _ref.onClose,
      rounded = _ref.rounded,
      children = _ref.children,
      rest = (0, _objectWithoutProperties2["default"])(_ref, ["variant", "variantColor", "label", "subLabel", "onClose", "rounded", "children"]);
  // Wrong usage of `variantColor` prop is quite common
  // Let's add a warning hook that validates the passed variantColor
  // useVariantColorWarning('Badge', variantColor);
  var fullTagStyleProps = (0, _styles["default"])({
    color: variantColor,
    variant: variant
  });
  var fullTagLabelStyleProps = (0, _styles.useFullTagLabelStyle)({
    color: variantColor,
    variant: variant
  });
  var fullStyle = {
    h: '56px',
    px: 0,
    overflow: 'hidden' // display: 'flex',

  }; // const iconStyle = {
  //     size: '24px',
  //     // color: 'white',
  // };
  // display: 'inline-block',
  //     px: 1,
  //     textTransform: 'uppercase',
  //     borderRadius: 'sm',
  //     fontWeight: 'bold',
  //     whiteSpace: 'nowrap',
  //     verticalAlign: 'middle',

  return __jsx(_Tag.Tag, (0, _extends2["default"])({
    variantColor: variantColor
  }, fullStyle, {
    rounded: rounded ? 'full' : 'md'
  }, fullTagLabelStyleProps), __jsx(_Flex.Flex, (0, _extends2["default"])({
    align: "center",
    justify: "center"
  }, fullTagStyleProps, {
    // get dark color of variant
    h: "100%",
    w: "56px",
    rounded: rounded ? 'full' : 'md'
  }), children), __jsx(_Stack.Stack, {
    pl: "spacing",
    pr: 8
  }, __jsx(_Tag.TagLabel, {
    mb: 0,
    marginBottom: 0,
    pb: "spacing-sm"
  }, label), subLabel && __jsx(_Tag.TagLabel, {
    fontSize: "xs"
  }, subLabel)), onClose && __jsx(_Tag.TagCloseButton, {
    mr: "spacing-sm",
    onClick: onClose
  }));
};

exports.FullTag = FullTag;
//# sourceMappingURL=FullTag.js.map