"use strict";

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

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

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

var _base = _interopRequireDefault(require("@emotion/styled/base"));

var _css2 = _interopRequireDefault(require("@styled-system/css"));

var _Box = require("../Box");

var _config = require("../Box/config");

/**
 * The selectors are based on [WAI-ARIA state properties](https://www.w3.org/WAI/PF/aria-1.1/states_and_properties) and common CSS Selectors
 */
var hover = '&:hover';
var active = '&:active, &[data-active=true]';
var focus = '&:focus';
var visited = '&:visited';
var even = '&:nth-of-type(even)';
var odd = '&:nth-of-type(odd)';
var disabled = '&:disabled, &:disabled:focus, &:disabled:hover, &[aria-disabled=true], &[aria-disabled=true]:focus, &[aria-disabled=true]:hover';
var checked = '&[aria-checked=true]';
var mixed = '&[aria-checked=mixed]';
var selected = '&[aria-selected=true]';
var invalid = '&[aria-invalid=true]';
var pressed = '&[aria-pressed=true]';
var readOnly = '&[aria-readonly=true], &[readonly]';
var first = '&:first-of-type';
var last = '&:last-of-type';
var expanded = '&[aria-expanded=true]';
var grabbed = '&[aria-grabbed=true]';
var notFirst = '&:not(:first-of-type)';
var notLast = '&:not(:last-of-type)';
var groupHover = '[role=group]:hover &';
/**
 * PseudoBox is an interactive wrapper that composes `Box`
 * and converts common CSS pseudo-selectors to props for ease of styling.
 *
 * For example, to style `:hover` use `_hover`
 *
 * @example
 * ```jsx
 * <PseudoBox _hover={...} _focus={...}/>
 * ```
 */

var PseudoBox = ( /*#__PURE__*/0, _base["default"])(_Box.Box, process.env.NODE_ENV === "production" ? {
  target: "e17hmw0k0"
} : {
  target: "e17hmw0k0",
  label: "PseudoBox"
})(function (_ref) {
  var _css;

  var _after = _ref._after,
      _hoverAfter = _ref._hoverAfter,
      _focus = _ref._focus,
      _selected = _ref._selected,
      _focusWithin = _ref._focusWithin,
      _hover = _ref._hover,
      _invalid = _ref._invalid,
      _active = _ref._active,
      _disabled = _ref._disabled,
      _grabbed = _ref._grabbed,
      _pressed = _ref._pressed,
      _expanded = _ref._expanded,
      _visited = _ref._visited,
      _before = _ref._before,
      _hoverBefore = _ref._hoverBefore,
      _readOnly = _ref._readOnly,
      _first = _ref._first,
      _notFirst = _ref._notFirst,
      _notLast = _ref._notLast,
      _last = _ref._last,
      _placeholder = _ref._placeholder,
      _checked = _ref._checked,
      _groupHover = _ref._groupHover,
      _mixed = _ref._mixed,
      _odd = _ref._odd,
      _even = _ref._even,
      _scrollbar = _ref._scrollbar,
      _track = _ref._track,
      _thumb = _ref._thumb;
  return (0, _css2["default"])((_css = {}, (0, _defineProperty2["default"])(_css, hover, (0, _config.transformAliasProps)(_hover)), (0, _defineProperty2["default"])(_css, focus, (0, _config.transformAliasProps)(_focus)), (0, _defineProperty2["default"])(_css, active, (0, _config.transformAliasProps)(_active)), (0, _defineProperty2["default"])(_css, visited, (0, _config.transformAliasProps)(_visited)), (0, _defineProperty2["default"])(_css, disabled, (0, _config.transformAliasProps)(_disabled)), (0, _defineProperty2["default"])(_css, selected, (0, _config.transformAliasProps)(_selected)), (0, _defineProperty2["default"])(_css, invalid, (0, _config.transformAliasProps)(_invalid)), (0, _defineProperty2["default"])(_css, expanded, (0, _config.transformAliasProps)(_expanded)), (0, _defineProperty2["default"])(_css, grabbed, (0, _config.transformAliasProps)(_grabbed)), (0, _defineProperty2["default"])(_css, readOnly, (0, _config.transformAliasProps)(_readOnly)), (0, _defineProperty2["default"])(_css, first, (0, _config.transformAliasProps)(_first)), (0, _defineProperty2["default"])(_css, notFirst, (0, _config.transformAliasProps)(_notFirst)), (0, _defineProperty2["default"])(_css, notLast, (0, _config.transformAliasProps)(_notLast)), (0, _defineProperty2["default"])(_css, last, (0, _config.transformAliasProps)(_last)), (0, _defineProperty2["default"])(_css, odd, (0, _config.transformAliasProps)(_odd)), (0, _defineProperty2["default"])(_css, even, (0, _config.transformAliasProps)(_even)), (0, _defineProperty2["default"])(_css, mixed, (0, _config.transformAliasProps)(_mixed)), (0, _defineProperty2["default"])(_css, checked, (0, _config.transformAliasProps)(_checked)), (0, _defineProperty2["default"])(_css, pressed, (0, _config.transformAliasProps)(_pressed)), (0, _defineProperty2["default"])(_css, groupHover, (0, _config.transformAliasProps)(_groupHover)), (0, _defineProperty2["default"])(_css, '&:before', (0, _config.transformAliasProps)(_before)), (0, _defineProperty2["default"])(_css, '&:hover:before', (0, _config.transformAliasProps)(_hoverBefore)), (0, _defineProperty2["default"])(_css, '&:after', (0, _config.transformAliasProps)(_after)), (0, _defineProperty2["default"])(_css, '&:hover:after', (0, _config.transformAliasProps)(_hoverAfter)), (0, _defineProperty2["default"])(_css, '&:focus-within', (0, _config.transformAliasProps)(_focusWithin)), (0, _defineProperty2["default"])(_css, '&::placeholder', _placeholder), (0, _defineProperty2["default"])(_css, '&::-webkit-scrollbar', _scrollbar), (0, _defineProperty2["default"])(_css, '&::-webkit-scrollbar-track', _track), (0, _defineProperty2["default"])(_css, '&::-webkit-scrollbar-thumb', _thumb), _css));
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
exports.PseudoBox = PseudoBox;
//# sourceMappingURL=PseudoBox.js.map