@flodesk/grain 2.20.1 → 2.20.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/es/components/arrange.js +2 -2
  2. package/es/components/box.js +31 -11
  3. package/es/components/button.js +5 -5
  4. package/es/components/icon-button.js +4 -4
  5. package/es/components/icon-toggle.js +8 -8
  6. package/es/components/icon.js +4 -4
  7. package/es/components/index.js +11 -11
  8. package/es/components/stack.js +4 -4
  9. package/es/components/text-button.js +3 -3
  10. package/es/components/text-input.js +5 -5
  11. package/es/components/text-toggle.js +5 -5
  12. package/es/components/text.js +4 -4
  13. package/es/foundational/index.js +4 -4
  14. package/es/hooks/index.js +1 -1
  15. package/es/hooks/useMedia.js +1 -1
  16. package/es/icons/icon-align-center.js +1 -1
  17. package/es/icons/icon-align-left.js +1 -1
  18. package/es/icons/icon-align-right.js +1 -1
  19. package/es/icons/icon-arrow-down.js +1 -1
  20. package/es/icons/icon-arrow-left.js +1 -1
  21. package/es/icons/icon-arrow-right.js +1 -1
  22. package/es/icons/icon-arrow-up.js +1 -1
  23. package/es/icons/icon-browser.js +1 -1
  24. package/es/icons/icon-chart.js +1 -1
  25. package/es/icons/icon-check.js +1 -1
  26. package/es/icons/icon-chevron-down.js +1 -1
  27. package/es/icons/icon-chevron-horizontal.js +1 -1
  28. package/es/icons/icon-chevron-left.js +1 -1
  29. package/es/icons/icon-chevron-right.js +1 -1
  30. package/es/icons/icon-chevron-up.js +1 -1
  31. package/es/icons/icon-chevron-vertical.js +1 -1
  32. package/es/icons/icon-clip.js +1 -1
  33. package/es/icons/icon-clock.js +1 -1
  34. package/es/icons/icon-crop.js +1 -1
  35. package/es/icons/icon-cross.js +1 -1
  36. package/es/icons/icon-download.js +1 -1
  37. package/es/icons/icon-duplicate.js +1 -1
  38. package/es/icons/icon-ellipsis.js +1 -1
  39. package/es/icons/icon-file.js +1 -1
  40. package/es/icons/icon-folder-add.js +1 -1
  41. package/es/icons/icon-folder.js +1 -1
  42. package/es/icons/icon-gear.js +1 -1
  43. package/es/icons/icon-globe.js +1 -1
  44. package/es/icons/icon-heart.js +1 -1
  45. package/es/icons/icon-image.js +1 -1
  46. package/es/icons/icon-link.js +1 -1
  47. package/es/icons/icon-mail.js +1 -1
  48. package/es/icons/icon-minus.js +1 -1
  49. package/es/icons/icon-monitor.js +1 -1
  50. package/es/icons/icon-pencil.js +1 -1
  51. package/es/icons/icon-phone.js +1 -1
  52. package/es/icons/icon-plus.js +1 -1
  53. package/es/icons/icon-redo.js +1 -1
  54. package/es/icons/icon-search.js +1 -1
  55. package/es/icons/icon-send.js +1 -1
  56. package/es/icons/icon-share.js +1 -1
  57. package/es/icons/icon-smile.js +1 -1
  58. package/es/icons/icon-switch.js +1 -1
  59. package/es/icons/icon-tablet.js +1 -1
  60. package/es/icons/icon-text-align-center.js +1 -1
  61. package/es/icons/icon-text-align-left.js +1 -1
  62. package/es/icons/icon-text-align-right.js +1 -1
  63. package/es/icons/icon-trash.js +1 -1
  64. package/es/icons/icon-type.js +1 -1
  65. package/es/icons/icon-undo.js +1 -1
  66. package/es/icons/icon-upload.js +1 -1
  67. package/es/icons/index.js +51 -51
  68. package/es/index.js +3 -3
  69. package/es/types.js +11 -11
  70. package/es/utilities/helpers.js +5 -5
  71. package/es/utilities/index.js +21 -22
  72. package/es/utilities/responsive.js +13 -14
  73. package/es/utilities/styles.js +13 -13
  74. package/es/variables.js +104 -101
  75. package/package.json +6 -2
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconMail = function IconMail(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconMinus = function IconMinus(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconMonitor = function IconMonitor(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconPencil = function IconPencil(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconPhone = function IconPhone(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconPlus = function IconPlus(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconRedo = function IconRedo(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconSearch = function IconSearch(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconSend = function IconSend(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconShare = function IconShare(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconSmile = function IconSmile(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconSwitch = function IconSwitch(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconTablet = function IconTablet(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconTextAlignCenter = function IconTextAlignCenter(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconTextAlignLeft = function IconTextAlignLeft(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconTextAlignRight = function IconTextAlignRight(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconTrash = function IconTrash(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconType = function IconType(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconUndo = function IconUndo(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconUpload = function IconUpload(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
package/es/icons/index.js CHANGED
@@ -1,51 +1,51 @@
1
- export { default as IconAlignCenter } from "./icon-align-center";
2
- export { default as IconAlignLeft } from "./icon-align-left";
3
- export { default as IconAlignRight } from "./icon-align-right";
4
- export { default as IconArrowDown } from "./icon-arrow-down";
5
- export { default as IconArrowLeft } from "./icon-arrow-left";
6
- export { default as IconArrowRight } from "./icon-arrow-right";
7
- export { default as IconArrowUp } from "./icon-arrow-up";
8
- export { default as IconBrowser } from "./icon-browser";
9
- export { default as IconChart } from "./icon-chart";
10
- export { default as IconCheck } from "./icon-check";
11
- export { default as IconChevronDown } from "./icon-chevron-down";
12
- export { default as IconChevronHorizontal } from "./icon-chevron-horizontal";
13
- export { default as IconChevronLeft } from "./icon-chevron-left";
14
- export { default as IconChevronRight } from "./icon-chevron-right";
15
- export { default as IconChevronUp } from "./icon-chevron-up";
16
- export { default as IconChevronVertical } from "./icon-chevron-vertical";
17
- export { default as IconClip } from "./icon-clip";
18
- export { default as IconClock } from "./icon-clock";
19
- export { default as IconCrop } from "./icon-crop";
20
- export { default as IconCross } from "./icon-cross";
21
- export { default as IconDuplicate } from "./icon-duplicate";
22
- export { default as IconEllipsis } from "./icon-ellipsis";
23
- export { default as IconFile } from "./icon-file";
24
- export { default as IconFolder } from "./icon-folder";
25
- export { default as IconFolderAdd } from "./icon-folder-add";
26
- export { default as IconGear } from "./icon-gear";
27
- export { default as IconGlobe } from "./icon-globe";
28
- export { default as IconHeart } from "./icon-heart";
29
- export { default as IconImage } from "./icon-image";
30
- export { default as IconLink } from "./icon-link";
31
- export { default as IconMail } from "./icon-mail";
32
- export { default as IconMinus } from "./icon-minus";
33
- export { default as IconMonitor } from "./icon-monitor";
34
- export { default as IconPencil } from "./icon-pencil";
35
- export { default as IconPhone } from "./icon-phone";
36
- export { default as IconPlus } from "./icon-plus";
37
- export { default as IconRedo } from "./icon-redo";
38
- export { default as IconSearch } from "./icon-search";
39
- export { default as IconSend } from "./icon-send";
40
- export { default as IconShare } from "./icon-share";
41
- export { default as IconSmile } from "./icon-smile";
42
- export { default as IconSwitch } from "./icon-switch";
43
- export { default as IconTablet } from "./icon-tablet";
44
- export { default as IconTextAlignCenter } from "./icon-text-align-center";
45
- export { default as IconTextAlignLeft } from "./icon-text-align-left";
46
- export { default as IconTextAlignRight } from "./icon-text-align-right";
47
- export { default as IconTrash } from "./icon-trash";
48
- export { default as IconType } from "./icon-type";
49
- export { default as IconUndo } from "./icon-undo";
50
- export { default as IconUpload } from "./icon-upload";
51
- export { default as IconDownload } from "./icon-download";
1
+ export { default as IconAlignCenter } from './icon-align-center';
2
+ export { default as IconAlignLeft } from './icon-align-left';
3
+ export { default as IconAlignRight } from './icon-align-right';
4
+ export { default as IconArrowDown } from './icon-arrow-down';
5
+ export { default as IconArrowLeft } from './icon-arrow-left';
6
+ export { default as IconArrowRight } from './icon-arrow-right';
7
+ export { default as IconArrowUp } from './icon-arrow-up';
8
+ export { default as IconBrowser } from './icon-browser';
9
+ export { default as IconChart } from './icon-chart';
10
+ export { default as IconCheck } from './icon-check';
11
+ export { default as IconChevronDown } from './icon-chevron-down';
12
+ export { default as IconChevronHorizontal } from './icon-chevron-horizontal';
13
+ export { default as IconChevronLeft } from './icon-chevron-left';
14
+ export { default as IconChevronRight } from './icon-chevron-right';
15
+ export { default as IconChevronUp } from './icon-chevron-up';
16
+ export { default as IconChevronVertical } from './icon-chevron-vertical';
17
+ export { default as IconClip } from './icon-clip';
18
+ export { default as IconClock } from './icon-clock';
19
+ export { default as IconCrop } from './icon-crop';
20
+ export { default as IconCross } from './icon-cross';
21
+ export { default as IconDuplicate } from './icon-duplicate';
22
+ export { default as IconEllipsis } from './icon-ellipsis';
23
+ export { default as IconFile } from './icon-file';
24
+ export { default as IconFolder } from './icon-folder';
25
+ export { default as IconFolderAdd } from './icon-folder-add';
26
+ export { default as IconGear } from './icon-gear';
27
+ export { default as IconGlobe } from './icon-globe';
28
+ export { default as IconHeart } from './icon-heart';
29
+ export { default as IconImage } from './icon-image';
30
+ export { default as IconLink } from './icon-link';
31
+ export { default as IconMail } from './icon-mail';
32
+ export { default as IconMinus } from './icon-minus';
33
+ export { default as IconMonitor } from './icon-monitor';
34
+ export { default as IconPencil } from './icon-pencil';
35
+ export { default as IconPhone } from './icon-phone';
36
+ export { default as IconPlus } from './icon-plus';
37
+ export { default as IconRedo } from './icon-redo';
38
+ export { default as IconSearch } from './icon-search';
39
+ export { default as IconSend } from './icon-send';
40
+ export { default as IconShare } from './icon-share';
41
+ export { default as IconSmile } from './icon-smile';
42
+ export { default as IconSwitch } from './icon-switch';
43
+ export { default as IconTablet } from './icon-tablet';
44
+ export { default as IconTextAlignCenter } from './icon-text-align-center';
45
+ export { default as IconTextAlignLeft } from './icon-text-align-left';
46
+ export { default as IconTextAlignRight } from './icon-text-align-right';
47
+ export { default as IconTrash } from './icon-trash';
48
+ export { default as IconType } from './icon-type';
49
+ export { default as IconUndo } from './icon-undo';
50
+ export { default as IconUpload } from './icon-upload';
51
+ export { default as IconDownload } from './icon-download';
package/es/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./components";
2
- export * from "./icons";
3
- export { vars } from "./variables";
1
+ export * from './components';
2
+ export * from './icons';
3
+ export * from './variables';
package/es/types.js CHANGED
@@ -1,23 +1,23 @@
1
1
  import "core-js/modules/es.object.keys.js";
2
- import PropTypes from "prop-types";
3
- import { vars } from "./variables";
2
+ import PropTypes from 'prop-types';
3
+ import { vars } from './variables';
4
4
  export var types = {
5
5
  color: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.colors)), PropTypes.string]),
6
6
  space: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.spaces)), PropTypes.number, PropTypes.string, PropTypes.object]),
7
7
  dimension: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object]),
8
- side: PropTypes.oneOf(["all", "left", "right", "top", "bottom", "x", "y"]),
9
- radius: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.radiuses)), PropTypes.string]),
8
+ side: PropTypes.oneOf(['all', 'left', 'right', 'top', 'bottom', 'x', 'y']),
9
+ radius: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.radii)), PropTypes.string]),
10
10
  shadow: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.shadows)), PropTypes.string]),
11
- position: PropTypes.oneOf(["static", "relative", "fixed", "absolute", "sticky"]),
11
+ position: PropTypes.oneOf(['static', 'relative', 'fixed', 'absolute', 'sticky']),
12
12
  textSize: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.texts)), PropTypes.string, PropTypes.object]),
13
13
  iconSize: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.icons)), PropTypes.number, PropTypes.string]),
14
14
  weight: PropTypes.oneOf(Object.keys(vars.weights)),
15
- textAlign: PropTypes.oneOf(["left", "center", "right"]),
16
- overflow: PropTypes.oneOf(["visible", "hidden", "scroll", "auto"]),
17
- fieldSize: PropTypes.oneOf(["s", "m"]),
15
+ textAlign: PropTypes.oneOf(['left', 'center', 'right']),
16
+ overflow: PropTypes.oneOf(['visible', 'hidden', 'scroll', 'auto']),
17
+ fieldSize: PropTypes.oneOf(['s', 'm']),
18
18
  columns: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
19
- autoFlow: PropTypes.oneOf(["column", "row"]),
20
- gridItemsAlignments: PropTypes.oneOf(["start", "end", "center", "stretch"]),
21
- gridContentPositions: PropTypes.oneOf(["start", "end", "center", "stretch", "space-around", "space-between", "space-evenly"]),
19
+ autoFlow: PropTypes.oneOf(['column', 'row']),
20
+ gridItemsAlignments: PropTypes.oneOf(['start', 'end', 'center', 'stretch']),
21
+ gridContentPositions: PropTypes.oneOf(['start', 'end', 'center', 'stretch', 'space-around', 'space-between', 'space-evenly']),
22
22
  icon: PropTypes.node
23
23
  };
@@ -8,8 +8,8 @@ import "core-js/modules/es.symbol.iterator.js";
8
8
  import "core-js/modules/es.array.iterator.js";
9
9
  import "core-js/modules/es.string.iterator.js";
10
10
  import "core-js/modules/web.dom-collections.iterator.js";
11
- import { grnPrefix } from "../variables";
12
- export var isBrowser = typeof window !== "undefined";
11
+ import { grnPrefix } from '../variables';
12
+ export var isBrowser = typeof window !== 'undefined';
13
13
  export var getCssVarCore = function getCssVarCore(type, value) {
14
14
  return "".concat(grnPrefix).concat(type, "-").concat(value);
15
15
  };
@@ -20,14 +20,14 @@ export var u = function u(amount) {
20
20
  return "calc(var(--grn-unit) * ".concat(amount, ")");
21
21
  };
22
22
  export var isNumber = function isNumber(value) {
23
- return typeof value === "number";
23
+ return typeof value === 'number';
24
24
  };
25
25
  export var isString = function isString(value) {
26
- return typeof value === "string";
26
+ return typeof value === 'string';
27
27
  };
28
28
  export var isArray = function isArray(value) {
29
29
  return Array.isArray(value);
30
30
  };
31
31
  export var isObject = function isObject(value) {
32
- return _typeof(value) === "object";
32
+ return _typeof(value) === 'object';
33
33
  };
@@ -1,22 +1,21 @@
1
- export { getDimension } from "./responsive";
2
- export { getResponsiveDimension } from "./responsive";
3
- export { breakpoints } from "./responsive";
4
- export { getColor } from "./styles";
5
- export { getShadow } from "./styles";
6
- export { getTextSize } from "./responsive";
7
- export { getResponsiveTextSize } from "./responsive";
8
- export { getWeight } from "./styles";
9
- export { getRadius } from "./styles";
10
- export { getTransition } from "./styles";
11
- export { getResponsiveSpace } from "./responsive";
12
- export { getIconSize } from "./styles";
13
- export { getGridColumns } from "./styles";
14
- export { getBorder } from "./styles";
15
- export { isBrowser } from "./helpers";
16
- export { getCssVarCore } from "./helpers";
17
- export { getCssVar } from "./helpers";
18
- export { u } from "./helpers";
19
- export { isNumber } from "./helpers";
20
- export { isString } from "./helpers";
21
- export { isArray } from "./helpers";
22
- export { isObject } from "./helpers";
1
+ export { getDimension } from './responsive';
2
+ export { getResponsiveDimension } from './responsive';
3
+ export { getColor } from './styles';
4
+ export { getShadow } from './styles';
5
+ export { getTextSize } from './responsive';
6
+ export { getResponsiveTextSize } from './responsive';
7
+ export { getWeight } from './styles';
8
+ export { getRadius } from './styles';
9
+ export { getTransition } from './styles';
10
+ export { getResponsiveSpace } from './responsive';
11
+ export { getIconSize } from './styles';
12
+ export { getGridColumns } from './styles';
13
+ export { getBorder } from './styles';
14
+ export { isBrowser } from './helpers';
15
+ export { getCssVarCore } from './helpers';
16
+ export { getCssVar } from './helpers';
17
+ export { u } from './helpers';
18
+ export { isNumber } from './helpers';
19
+ export { isString } from './helpers';
20
+ export { isArray } from './helpers';
21
+ export { isObject } from './helpers';
@@ -24,8 +24,8 @@ import "core-js/modules/web.dom-collections.iterator.js";
24
24
  import "core-js/modules/es.array.slice.js";
25
25
  import "core-js/modules/es.array.from.js";
26
26
  import "core-js/modules/es.regexp.exec.js";
27
- import { getCssVar, isNumber, isString, u, isObject } from ".";
28
- import { varNames, vars } from "../variables";
27
+ import { getCssVar, isNumber, isString, u, isObject } from '.';
28
+ import { vars, varInfo } from '../variables';
29
29
  export var getMediaCss = function getMediaCss(breakpoint, property, value) {
30
30
  var getValue = function getValue(val) {
31
31
  if (val === 0) return val;
@@ -33,28 +33,27 @@ export var getMediaCss = function getMediaCss(breakpoint, property, value) {
33
33
  if (isString(val)) return val;
34
34
  };
35
35
 
36
- if (breakpoint === "default") {
36
+ if (breakpoint === 'default') {
37
37
  return "".concat(property, ": ").concat(getValue(value), ";");
38
38
  }
39
39
 
40
40
  return "\n @media ".concat(breakpoint, " {\n ").concat(property, ": ").concat(getValue(value), ";\n }\n ");
41
41
  };
42
- export var mapObjToMedia = function mapObjToMedia(property, obj, varName) {
43
- var varGroupName = varNames[varName].group;
44
- var varPrefix = varNames[varName].prefix;
42
+ export var mapObjToMedia = function mapObjToMedia(property, obj, type) {
43
+ var varPrefix = varInfo[type].prefix;
45
44
  var declarations = Object.entries(obj).map(function (_ref) {
46
45
  var _ref2 = _slicedToArray(_ref, 2),
47
46
  breakpoint = _ref2[0],
48
47
  value = _ref2[1];
49
48
 
50
- if (value in vars[varGroupName]) {
49
+ if (value in vars[type]) {
51
50
  return getMediaCss(breakpoint, property, getCssVar(varPrefix, value));
52
51
  }
53
52
 
54
53
  return getMediaCss(breakpoint, property, value);
55
54
  }); // reverse array to make sure max-widths correctly override
56
55
 
57
- declarations.reverse().join("");
56
+ declarations.reverse().join('');
58
57
  return declarations;
59
58
  };
60
59
  export var getDimension = function getDimension(dimension) {
@@ -64,7 +63,7 @@ export var getDimension = function getDimension(dimension) {
64
63
  };
65
64
  export var getSpace = function getSpace(value) {
66
65
  if (value in vars.spaces) {
67
- return getCssVar(varNames.space.prefix, value);
66
+ return getCssVar(varInfo.spaces.prefix, value);
68
67
  }
69
68
 
70
69
  if (value === 0) return value;
@@ -75,7 +74,7 @@ export var getResponsiveDimension = function getResponsiveDimension(property, di
75
74
  if (!dimension) return;
76
75
 
77
76
  if (isObject(dimension)) {
78
- return mapObjToMedia(property, dimension, varNames.space.prefix);
77
+ return mapObjToMedia(property, dimension, varInfo.spaces.name);
79
78
  }
80
79
 
81
80
  return "".concat(property, ": ").concat(getDimension(dimension));
@@ -84,24 +83,24 @@ export var getResponsiveSpace = function getResponsiveSpace(property, space) {
84
83
  if (!space) return;
85
84
 
86
85
  if (isObject(space)) {
87
- return mapObjToMedia(property, space, varNames.space.prefix);
86
+ return mapObjToMedia(property, space, varInfo.spaces.name);
88
87
  }
89
88
 
90
89
  return "".concat(property, ": ").concat(getSpace(space));
91
90
  };
92
91
  export var getTextSize = function getTextSize(size) {
93
92
  if (size in vars.texts) {
94
- return getCssVar(varNames.text.prefix, size);
93
+ return getCssVar(varInfo.texts.prefix, size);
95
94
  }
96
95
 
97
96
  if (isString(size)) return size;
98
97
  };
99
98
  export var getResponsiveTextSize = function getResponsiveTextSize(size) {
100
99
  if (!size) return;
101
- var property = "font-size";
100
+ var property = 'font-size';
102
101
 
103
102
  if (isObject(size)) {
104
- return mapObjToMedia(property, size, varNames.text.prefix);
103
+ return mapObjToMedia(property, size, varInfo.texts.name);
105
104
  }
106
105
 
107
106
  return "".concat(property, ": ").concat(getTextSize(size));
@@ -16,34 +16,34 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
16
16
 
17
17
  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; }
18
18
 
19
- import { getCssVar, isNumber, isString, u, isArray } from ".";
20
- import { varNames, vars } from "../variables";
21
- import { getDimension } from "./responsive";
19
+ import { getCssVar, isNumber, isString, u, isArray } from '.';
20
+ import { vars, varInfo } from '../variables';
21
+ import { getDimension } from './responsive';
22
22
 
23
- var allColors = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, vars.colors.baseColors), vars.colors.greys), vars.colors.semanticColors), vars.colors.fades);
23
+ var allColors = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, vars.colors.bases), vars.colors.greys), vars.colors.semantics), vars.colors.fades);
24
24
 
25
25
  export var getColor = function getColor(color) {
26
26
  if (color in allColors) {
27
- return getCssVar(varNames.color.prefix, color);
27
+ return getCssVar(varInfo.colors.prefix, color);
28
28
  }
29
29
 
30
30
  return color;
31
31
  };
32
32
  export var getShadow = function getShadow(shadow) {
33
33
  if (shadow in vars.shadows) {
34
- return getCssVar(varNames.shadow.prefix, shadow);
34
+ return getCssVar(varInfo.shadows.prefix, shadow);
35
35
  }
36
36
 
37
37
  return shadow;
38
38
  };
39
39
  export var getWeight = function getWeight(weight) {
40
40
  if (weight in vars.weights) {
41
- return getCssVar(varNames.weight.prefix, weight);
41
+ return getCssVar(varInfo.weights.prefix, weight);
42
42
  }
43
43
  };
44
44
  export var getRadius = function getRadius(radius) {
45
- if (radius in vars.radiuses) {
46
- return getCssVar(varNames.radius.prefix, radius);
45
+ if (radius in vars.radii) {
46
+ return getCssVar(varInfo.radii.prefix, radius);
47
47
  }
48
48
 
49
49
  if (radius === 0) return radius;
@@ -52,12 +52,12 @@ export var getRadius = function getRadius(radius) {
52
52
  };
53
53
  export var getTransition = function getTransition(transition) {
54
54
  if (transition in vars.transitions) {
55
- return getCssVar(varNames.transition.prefix, transition);
55
+ return getCssVar(varInfo.transitions.prefix, transition);
56
56
  }
57
57
  };
58
58
  export var getIconSize = function getIconSize(size) {
59
59
  if (size in vars.icons) {
60
- return getCssVar(varNames.icon.prefix, size);
60
+ return getCssVar(varInfo.icons.prefix, size);
61
61
  }
62
62
 
63
63
  return getDimension(size);
@@ -67,7 +67,7 @@ export var getGridColumns = function getGridColumns(columns) {
67
67
  if (isArray(columns)) {
68
68
  return columns.map(function (column) {
69
69
  return getDimension(column);
70
- }).join(" ");
70
+ }).join(' ');
71
71
  }
72
72
 
73
73
  if (isString(columns)) return columns;
@@ -87,6 +87,6 @@ export var getBorder = function getBorder(borderSide, borderWidth, borderColor)
87
87
  if (borderSide in borderSides) {
88
88
  return "\n ".concat(borderSides[borderSide].map(function (side) {
89
89
  return "border-".concat(side, "-style: solid");
90
- }).join(";"), ";\n\n border-color: ").concat(getColor(borderColor), ";\n border-width: ").concat(getDimension(borderWidth), ";\n ");
90
+ }).join(';'), ";\n\n border-color: ").concat(getColor(borderColor), ";\n border-width: ").concat(getDimension(borderWidth), ";\n ");
91
91
  }
92
92
  };