"use strict";

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

exports.__esModule = true;
exports.Spacing = void 0;

var _style = _interopRequireDefault(require("styled-jsx/style"));

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

var _classnames = _interopRequireDefault(require("classnames"));

var _useTheme = _interopRequireDefault(require("../../hooks/useTheme"));

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

var _jsxRuntime = require("react/jsx-runtime");

// Generated with util/create-component.js
const Spacing = props => {
  const theme = (0, _useTheme.default)();
  const {
    height,
    width,
    className = null,
    ...otherProps
  } = props;

  function handleValue(value) {
    return value ? typeof value === "number" ? `${value * theme.layout.spacingUnit}px` : value : "0px";
  }

  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    "data-testid": "Wps-Spacing",
    ...otherProps,
    className: _style.default.dynamic([["2683636099", [width ? (0, _Flex.getBreakpoints)(width, "xs", handleValue) : "100%", height ? (0, _Flex.getBreakpoints)(height, "xs", handleValue) : "100%", theme.breakpoints.sm.min, width ? (0, _Flex.getBreakpoints)(width, "sm", handleValue) : "100%", height ? (0, _Flex.getBreakpoints)(height, "sm", handleValue) : "100%", theme.breakpoints.md.min, width ? (0, _Flex.getBreakpoints)(width, "md", handleValue) : "100%", height ? (0, _Flex.getBreakpoints)(height, "md", handleValue) : "100%", theme.breakpoints.lg.min, width ? (0, _Flex.getBreakpoints)(width, "lg", handleValue) : "100%", height ? (0, _Flex.getBreakpoints)(height, "lg", handleValue) : "100%", theme.breakpoints.xl.min, width ? (0, _Flex.getBreakpoints)(width, "xl", handleValue) : "100%", height ? (0, _Flex.getBreakpoints)(height, "xl", handleValue) : "100%"]]]) + " " + (otherProps && otherProps.className != null && otherProps.className || (0, _classnames.default)("Wps-Spacing", className) || ""),
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_style.default, {
      id: "2683636099",
      dynamic: [width ? (0, _Flex.getBreakpoints)(width, "xs", handleValue) : "100%", height ? (0, _Flex.getBreakpoints)(height, "xs", handleValue) : "100%", theme.breakpoints.sm.min, width ? (0, _Flex.getBreakpoints)(width, "sm", handleValue) : "100%", height ? (0, _Flex.getBreakpoints)(height, "sm", handleValue) : "100%", theme.breakpoints.md.min, width ? (0, _Flex.getBreakpoints)(width, "md", handleValue) : "100%", height ? (0, _Flex.getBreakpoints)(height, "md", handleValue) : "100%", theme.breakpoints.lg.min, width ? (0, _Flex.getBreakpoints)(width, "lg", handleValue) : "100%", height ? (0, _Flex.getBreakpoints)(height, "lg", handleValue) : "100%", theme.breakpoints.xl.min, width ? (0, _Flex.getBreakpoints)(width, "xl", handleValue) : "100%", height ? (0, _Flex.getBreakpoints)(height, "xl", handleValue) : "100%"],
      children: `.Wps-Spacing.__jsx-style-dynamic-selector{width:${width ? (0, _Flex.getBreakpoints)(width, "xs", handleValue) : "100%"};height:${height ? (0, _Flex.getBreakpoints)(height, "xs", handleValue) : "100%"};}@media only screen and (min-width:${theme.breakpoints.sm.min}){.Wps-Spacing.__jsx-style-dynamic-selector{width:${width ? (0, _Flex.getBreakpoints)(width, "sm", handleValue) : "100%"};height:${height ? (0, _Flex.getBreakpoints)(height, "sm", handleValue) : "100%"};}}@media only screen and (min-width:${theme.breakpoints.md.min}){.Wps-Spacing.__jsx-style-dynamic-selector{width:${width ? (0, _Flex.getBreakpoints)(width, "md", handleValue) : "100%"};height:${height ? (0, _Flex.getBreakpoints)(height, "md", handleValue) : "100%"};}}@media only screen and (min-width:${theme.breakpoints.lg.min}){.Wps-Spacing.__jsx-style-dynamic-selector{width:${width ? (0, _Flex.getBreakpoints)(width, "lg", handleValue) : "100%"};height:${height ? (0, _Flex.getBreakpoints)(height, "lg", handleValue) : "100%"};}}@media only screen and (min-width:${theme.breakpoints.xl.min}){.Wps-Spacing.__jsx-style-dynamic-selector{width:${width ? (0, _Flex.getBreakpoints)(width, "xl", handleValue) : "100%"};height:${height ? (0, _Flex.getBreakpoints)(height, "xl", handleValue) : "100%"};}}`
    })
  });
};

exports.Spacing = Spacing;