"use strict";

/*
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.
*/
// Utilities
var _require = require("../utilities/convertNumber"),
    rem = _require.rem;
/*
Spacings:
Overrides Tailwind's default spacing system generating `.m-*`, `.p-*`
Spacing as also used as the basis for frames, stacks and inlines
*/


var spacing = {
  px: "1px",
  "0": "0",
  "0.5": rem(2),
  "1": rem(4),
  "1.5": rem(6),
  "2": rem(8),
  "2.5": rem(10),
  "3": rem(12),
  "3.5": rem(14),
  "4": rem(16),
  "4.5": rem(18),
  "5": rem(20),
  "6": rem(24),
  "7": rem(28),
  "8": rem(32),
  "9": rem(36),
  "10": rem(40),
  "11": rem(44),
  "12": rem(48),
  "13": rem(52),
  "14": rem(56),
  "15": rem(60),
  "16": rem(64),
  "18": rem(72),
  "20": rem(80),
  "24": rem(96),
  "28": rem(112),
  "32": rem(128),
  "36": rem(144),
  "40": rem(160),
  "48": rem(192),
  "56": rem(224),
  "60": rem(240),
  "64": rem(256),
  "72": rem(288),
  "80": rem(320),
  "96": rem(384)
};
var spacer = {
  "0": "0",
  "1": spacing["1"],
  "2": spacing["2"],
  "3": spacing["4"],
  "4": spacing["8"],
  "5": spacing["12"],
  "6": spacing["18"],
  "7": spacing["24"],
  "8": spacing["28"]
};
/*
Frames:
Applies padding to around a box, this is similar to .p* but uses a restricted scale that's easier to use.
Typically used for modals, sidebar, content areas etc.
*/

var frame = {
  "2xs": rem(4),
  xs: rem(8),
  sm: rem(12),
  md: rem(16),
  lg: rem(24),
  xl: rem(48),
  "2xl": rem(72),
  "3xl": rem(112)
};
var borderFrame = {
  "2xs": rem(3),
  xs: rem(7),
  sm: rem(11),
  md: rem(15),
  lg: rem(23),
  xl: rem(47),
  "2xl": rem(71),
  "3xl": rem(111)
};
/*
Frame Squash:
Applies padding to a box where px > py
This is typically used for buttons, inputs etc.
*/

var squash = {
  xs: "".concat(rem(2), " ").concat(rem(12)),
  sm: "".concat(rem(2), " ").concat(rem(14)),
  md: "".concat(rem(4), " ").concat(rem(16)),
  lg: "".concat(rem(8), " ").concat(rem(20)),
  xl: "".concat(rem(8), " ").concat(rem(24)),
  '2xl': "".concat(rem(16), " ").concat(rem(32))
};
var borderSquash = {
  xs: "".concat(rem(1), " ").concat(rem(11)),
  sm: "".concat(rem(1), " ").concat(rem(13)),
  md: "".concat(rem(3), " ").concat(rem(15)),
  lg: "".concat(rem(7), " ").concat(rem(19)),
  xl: "".concat(rem(7), " ").concat(rem(23)),
  '2xl': "".concat(rem(15), " ").concat(rem(31))
};
/*
Frame Stretch:
Applies padding to a box where py > px
This is typically used for tables, menu items etc.
*/

var stretch = {
  xs: "".concat(rem(8), " ").concat(rem(4)),
  sm: "".concat(rem(12), " ").concat(rem(8)),
  md: "".concat(rem(24), " ").concat(rem(16)),
  lg: "".concat(rem(32), " ").concat(rem(24))
};
var borderStretch = {
  xs: "".concat(rem(7), " ").concat(rem(3)),
  sm: "".concat(rem(11), " ").concat(rem(7)),
  md: "".concat(rem(23), " ").concat(rem(15)),
  lg: "".concat(rem(31), " ").concat(rem(23))
};
/*
Stacks:
Applies margin spacing below elements
Used for vertically spacing content.
*/

var stack = {
  "2xs": rem(2),
  xs: rem(2),
  sm: rem(8),
  md: rem(16),
  lg: rem(32),
  xl: rem(48),
  "2xl": rem(72),
  "3xl": rem(112)
};
/*
Inlines:
Applies margin spacing to the left or right of an element.
Used for horizontally spacing content, and example would be buttons in a toolbar.
*/

var inline = {
  "2xs": rem(2),
  xs: rem(4),
  sm: rem(8),
  md: rem(16),
  lg: rem(24),
  xl: rem(48)
};
module.exports = {
  spacing: spacing,
  spacer: spacer,
  frame: frame,
  borderFrame: borderFrame,
  squash: squash,
  borderSquash: borderSquash,
  stretch: stretch,
  borderStretch: borderStretch,
  stack: stack,
  inline: inline
};