"use strict";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

/*
Copyright 2021 Q-CTRL. All rights reserved.

Licensed under the Q-CTRL Terms of service (the "License"). Unauthorized
copying or use of this file, via any medium, is strictly prohibited.
Proprietary and confidential. You may not use this file except in compliance
with the License. You may obtain a copy of the License at

     https://q-ctrl.com/terms

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS. See the
License for the specific language.
*/
var plugin = require("tailwindcss/plugin"); // Tokens


var colors = require("./tokens/colors");

var _require = require("./tokens/typography"),
    fontFamilies = _require.fontFamilies,
    fontSizes = _require.fontSizes,
    lineHeights = _require.lineHeights,
    letterSpacing = _require.letterSpacing,
    textOrientations = _require.textOrientations,
    writingModes = _require.writingModes,
    textShadow = _require.textShadow;

var spacing = require("./tokens/spacing");

var _require2 = require("./tokens/sizing"),
    minWidths = _require2.minWidths,
    maxWidths = _require2.maxWidths,
    widths = _require2.widths,
    minHeights = _require2.minHeights,
    maxHeights = _require2.maxHeights,
    heights = _require2.heights,
    aspectRatios = _require2.aspectRatios,
    iconSizes = _require2.iconSizes,
    triangleSizes = _require2.triangleSizes;

var _require3 = require("./tokens/transition"),
    durations = _require3.durations,
    timingFunctions = _require3.timingFunctions;

var _require4 = require("./tokens/background"),
    backgroundSize = _require4.backgroundSize,
    backgroundImage = _require4.backgroundImage,
    gradientOpacity = _require4.gradientOpacity,
    gradientStopPosition = _require4.gradientStopPosition;

var _require5 = require("./tokens/transform"),
    rotate = _require5.rotate;

var opacity = require("./tokens/opacity");

var boxShadows = require("./tokens/boxShadow");

var _require6 = require("./tokens/border"),
    borderWidth = _require6.borderWidth,
    borderRadius = _require6.borderRadius; // Official Tailwind Plugins


var tailwindcssTypographyPlugin = require("@tailwindcss/typography");

var tailwindcssAspectRatioPlugin = require("@tailwindcss/aspect-ratio");

var tailwindcssLineClampPlugin = require("@tailwindcss/line-clamp"); // 3rd party plugins


var tailwindcssDebugScreensPlugin = require("tailwindcss-debug-screens"); //https://github.com/jorenvanhee/tailwindcss-debug-screens
// Plugins


var generalBase = require("./plugins/base/general");

var formsBase = require("./plugins/base/forms");

var typographyBase = require("./plugins/base/typography");

var markdownBase = require("./plugins/base/markdown");

var scrollbarsUtilities = require("./plugins/utilities/scrollbars");

var spacerUtilities = require("./plugins/utilities/spacers");

var iconUtilities = require("./plugins/utilities/icons");

var triangleUtilities = require("./plugins/utilities/triangles");

var maskUtilities = require("./plugins/utilities/mask");

var backgroundUtilities = require("./plugins/utilities/background");

var backgroundImageUtilities = require("./plugins/utilities/backgroundImage");

var gradientUtilities = require("./plugins/utilities/gradient");

var textOrientationUtilities = require("./plugins/utilities/textOrientation");

var textShadowUtilities = require("./plugins/utilities/textShadow");

var buttonComponents = require("./plugins/components/buttons");

var inputComponents = require("./plugins/components/input");

var inputGroupComponents = require("./plugins/components/inputGroup");

var radioButtonComponents = require("./plugins/components/radioButton"); // Variants


var _require7 = require("./plugins/variants/groupVariants"),
    groupDisabledVariants = _require7.groupDisabledVariants;

var _require8 = require("./plugins/variants/stateVariants"),
    errorVariants = _require8.errorVariants,
    groupErrorVariants = _require8.groupErrorVariants,
    successVariants = _require8.successVariants,
    groupSuccessVariants = _require8.groupSuccessVariants;

module.exports = plugin(function (options) {
  tailwindcssTypographyPlugin(options);
  tailwindcssAspectRatioPlugin.handler(options);
  tailwindcssLineClampPlugin.handler(options);
  generalBase(options);
  formsBase(options);
  typographyBase(options);
  markdownBase(options);
  scrollbarsUtilities(options);
  spacerUtilities(options);
  iconUtilities(options);
  triangleUtilities(options);
  maskUtilities(options);
  backgroundUtilities(options);
  backgroundImageUtilities(options);
  gradientUtilities(options);
  textOrientationUtilities(options);
  textShadowUtilities.handler(options);
  buttonComponents(options);
  inputComponents(options);
  inputGroupComponents(options);
  radioButtonComponents(options);
  groupDisabledVariants.handler(options);
  errorVariants.handler(options);
  groupErrorVariants.handler(options);
  successVariants.handler(options);
  groupSuccessVariants.handler(options);
  tailwindcssDebugScreensPlugin(options);
}, {
  darkMode: "class",
  theme: _objectSpread(_objectSpread({
    colors: colors
  }, spacing), {}, {
    borderColor: function borderColor(theme) {
      return _objectSpread(_objectSpread({}, theme("colors")), {}, {
        DEFAULT: theme("colors.gray.300", "currentColor")
      });
    },
    borderWidth: borderWidth,
    borderRadius: borderRadius,
    ringOpacity: opacity,
    boxShadow: boxShadows,
    fontFamily: fontFamilies,
    fontSize: fontSizes,
    letterSpacing: letterSpacing,
    textOrientation: textOrientations,
    textShadow: textShadow,
    writingMode: writingModes,
    iconSize: iconSizes,
    triangleSize: triangleSizes,
    // aspectRatio: aspectRatios,
    extend: {
      screens: {
        sm: "640px",
        md: "768px",
        lg: "1024px",
        xl: "1280px"
      },
      margin: {
        "1/4": "25%",
        "1/2": "50%",
        "3/4": "75%",
        full: "100%"
      },
      padding: {
        "1/4": "25%",
        "1/2": "50%",
        "3/4": "75%",
        full: "100%"
      },
      minHeight: minHeights,
      maxHeight: maxHeights,
      minWidth: minWidths,
      maxWidth: maxWidths,
      height: heights,
      width: widths,
      lineHeight: lineHeights,
      lineClamp: {
        1: "1",
        2: "2",
        3: "3",
        4: "4",
        5: "5",
        6: "6",
        7: "7",
        8: "8",
        9: "9",
        10: "10"
      },
      listStyleType: {
        asterix: '"*"',
        circle: "circle",
        "decimal-leading-zero": "decimal-leading-zero",
        "lower-latin": "lower-latin",
        "lower-roman": "lower-roman",
        "upper-latin": "upper-latin",
        "upper-roman": "upper-roman"
      },
      gridTemplateColumns: {
        16: "repeat(16, minmax(0, 1fr))",
        24: "repeat(24, minmax(0, 1fr))"
      },
      backgroundSize: backgroundSize,
      backgroundImage: backgroundImage,
      gradientStopPosition: gradientStopPosition,
      gradientOpacity: gradientOpacity,
      opacity: opacity,
      rotate: rotate,
      transitionDuration: durations,
      transitionDelay: durations,
      transitionTimingFunction: timingFunctions,
      aspectRatio: {
        1: '1',
        2: '2',
        3: '3',
        4: '4',
        5: '5',
        6: '6',
        7: '7',
        8: '8',
        9: '9',
        10: '10',
        11: '11',
        12: '12',
        13: '13',
        14: '14',
        15: '15',
        16: '16'
      }
    }
  }),
  variants: {
    backgroundClip: ["responsive"],
    backgroundColor: ["responsive", "odd", "even", "first", "last", "hover", "focus", "active", "disabled", "focus-within", "group-focus", "group-hover", "group-disabled", "checked"],
    backgroundOpacity: ["responsive", "odd", "even", "first", "last", "hover", "focus", "active", "disabled", "focus-within", "group-focus", "group-hover"],
    backgroundSize: ["responsive", "hover", "focus", "group-hover"],
    backgroundImage: ["responsive", "hover", "focus", "active", "disabled", "focus-within", "group-focus", "group-hover", "checked"],
    gradientColorStops: ["responsive", "hover", "focus", "group-hover"],
    borderColor: ["responsive", "odd", "even", "first", "last", "hover", "focus", "active", "disabled", "focus-within", "group-focus", "group-hover", "group-disabled"],
    borderOpacity: ["responsive", "odd", "even", "first", "last", "hover", "focus", "active", "disabled", "focus-within", "group-focus", "group-hover"],
    triangleSize: ["responsive", "hover"],
    textColor: ["responsive", "odd", "even", "first", "last", "hover", "focus", "active", "disabled", "focus-within", "group-focus", "group-hover", "group-disabled", "visited"],
    textOpacity: ["responsive", "odd", "even", "first", "last", "hover", "focus", "active", "disabled", "focus-within", "group-focus", "group-hover"],
    textShadow: ["responsive", "hover", "focus", "disabled", "focus-within", "group-focus", "group-hover"],
    textOrientation: ["responsive"],
    lineClamp: ["responsive", "hover"],
    opacity: ["responsive", "hover", "focus", "disabled", "focus-within", "group-focus", "group-hover"],
    boxShadow: ["responsive", "hover", "focus", "disabled", "focus-within", "group-focus", "group-hover"],
    mask: ["responsive", "hover"],
    transform: ["responsive"],
    scale: ["responsive", "hover", "focus", "group-hover"],
    rotate: ["responsive", "hover", "focus", "group-hover"],
    translate: ["responsive", "hover", "focus", "group-hover"],
    skew: ["responsive", "hover", "focus", "group-hover"],
    mixBlendMode: ["responsive", "hover", "group-hover"],
    backgroundBlendMode: ["responsive", "hover", "group-hover"],
    isolation: ["responsive", "hover", "group-hover"],
    margin: ["responsive"],
    padding: ["responsive"],
    spacers: ["responsive"],
    position: ["responsive"],
    inset: ["responsive", "hover", "group-hover"],
    width: ["responsive"],
    iconSize: ["responsive"],
    zIndex: ["responsive", "hover", "group-hover"],
    wordBreak: ["responsive", "group-hover"],
    textOverflow: ["responsive", "group-hover"],
    aspectRatio: ["responsive", "hover"]
  },
  corePlugins: {
    gradientColorStops: false,
    backgroundImage: false
  }
});