@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.
- package/es/components/arrange.js +2 -2
- package/es/components/box.js +31 -11
- package/es/components/button.js +5 -5
- package/es/components/icon-button.js +4 -4
- package/es/components/icon-toggle.js +8 -8
- package/es/components/icon.js +4 -4
- package/es/components/index.js +11 -11
- package/es/components/stack.js +4 -4
- package/es/components/text-button.js +3 -3
- package/es/components/text-input.js +5 -5
- package/es/components/text-toggle.js +5 -5
- package/es/components/text.js +4 -4
- package/es/foundational/index.js +4 -4
- package/es/hooks/index.js +1 -1
- package/es/hooks/useMedia.js +1 -1
- package/es/icons/icon-align-center.js +1 -1
- package/es/icons/icon-align-left.js +1 -1
- package/es/icons/icon-align-right.js +1 -1
- package/es/icons/icon-arrow-down.js +1 -1
- package/es/icons/icon-arrow-left.js +1 -1
- package/es/icons/icon-arrow-right.js +1 -1
- package/es/icons/icon-arrow-up.js +1 -1
- package/es/icons/icon-browser.js +1 -1
- package/es/icons/icon-chart.js +1 -1
- package/es/icons/icon-check.js +1 -1
- package/es/icons/icon-chevron-down.js +1 -1
- package/es/icons/icon-chevron-horizontal.js +1 -1
- package/es/icons/icon-chevron-left.js +1 -1
- package/es/icons/icon-chevron-right.js +1 -1
- package/es/icons/icon-chevron-up.js +1 -1
- package/es/icons/icon-chevron-vertical.js +1 -1
- package/es/icons/icon-clip.js +1 -1
- package/es/icons/icon-clock.js +1 -1
- package/es/icons/icon-crop.js +1 -1
- package/es/icons/icon-cross.js +1 -1
- package/es/icons/icon-download.js +1 -1
- package/es/icons/icon-duplicate.js +1 -1
- package/es/icons/icon-ellipsis.js +1 -1
- package/es/icons/icon-file.js +1 -1
- package/es/icons/icon-folder-add.js +1 -1
- package/es/icons/icon-folder.js +1 -1
- package/es/icons/icon-gear.js +1 -1
- package/es/icons/icon-globe.js +1 -1
- package/es/icons/icon-heart.js +1 -1
- package/es/icons/icon-image.js +1 -1
- package/es/icons/icon-link.js +1 -1
- package/es/icons/icon-mail.js +1 -1
- package/es/icons/icon-minus.js +1 -1
- package/es/icons/icon-monitor.js +1 -1
- package/es/icons/icon-pencil.js +1 -1
- package/es/icons/icon-phone.js +1 -1
- package/es/icons/icon-plus.js +1 -1
- package/es/icons/icon-redo.js +1 -1
- package/es/icons/icon-search.js +1 -1
- package/es/icons/icon-send.js +1 -1
- package/es/icons/icon-share.js +1 -1
- package/es/icons/icon-smile.js +1 -1
- package/es/icons/icon-switch.js +1 -1
- package/es/icons/icon-tablet.js +1 -1
- package/es/icons/icon-text-align-center.js +1 -1
- package/es/icons/icon-text-align-left.js +1 -1
- package/es/icons/icon-text-align-right.js +1 -1
- package/es/icons/icon-trash.js +1 -1
- package/es/icons/icon-type.js +1 -1
- package/es/icons/icon-undo.js +1 -1
- package/es/icons/icon-upload.js +1 -1
- package/es/icons/index.js +51 -51
- package/es/index.js +3 -3
- package/es/types.js +11 -11
- package/es/utilities/helpers.js +5 -5
- package/es/utilities/index.js +21 -22
- package/es/utilities/responsive.js +13 -14
- package/es/utilities/styles.js +13 -13
- package/es/variables.js +104 -101
- package/package.json +6 -2
package/es/icons/icon-mail.js
CHANGED
package/es/icons/icon-minus.js
CHANGED
package/es/icons/icon-monitor.js
CHANGED
package/es/icons/icon-pencil.js
CHANGED
package/es/icons/icon-phone.js
CHANGED
package/es/icons/icon-plus.js
CHANGED
package/es/icons/icon-redo.js
CHANGED
package/es/icons/icon-search.js
CHANGED
package/es/icons/icon-send.js
CHANGED
package/es/icons/icon-share.js
CHANGED
package/es/icons/icon-smile.js
CHANGED
package/es/icons/icon-switch.js
CHANGED
package/es/icons/icon-tablet.js
CHANGED
package/es/icons/icon-trash.js
CHANGED
package/es/icons/icon-type.js
CHANGED
package/es/icons/icon-undo.js
CHANGED
package/es/icons/icon-upload.js
CHANGED
package/es/icons/index.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
export { default as IconAlignCenter } from
|
|
2
|
-
export { default as IconAlignLeft } from
|
|
3
|
-
export { default as IconAlignRight } from
|
|
4
|
-
export { default as IconArrowDown } from
|
|
5
|
-
export { default as IconArrowLeft } from
|
|
6
|
-
export { default as IconArrowRight } from
|
|
7
|
-
export { default as IconArrowUp } from
|
|
8
|
-
export { default as IconBrowser } from
|
|
9
|
-
export { default as IconChart } from
|
|
10
|
-
export { default as IconCheck } from
|
|
11
|
-
export { default as IconChevronDown } from
|
|
12
|
-
export { default as IconChevronHorizontal } from
|
|
13
|
-
export { default as IconChevronLeft } from
|
|
14
|
-
export { default as IconChevronRight } from
|
|
15
|
-
export { default as IconChevronUp } from
|
|
16
|
-
export { default as IconChevronVertical } from
|
|
17
|
-
export { default as IconClip } from
|
|
18
|
-
export { default as IconClock } from
|
|
19
|
-
export { default as IconCrop } from
|
|
20
|
-
export { default as IconCross } from
|
|
21
|
-
export { default as IconDuplicate } from
|
|
22
|
-
export { default as IconEllipsis } from
|
|
23
|
-
export { default as IconFile } from
|
|
24
|
-
export { default as IconFolder } from
|
|
25
|
-
export { default as IconFolderAdd } from
|
|
26
|
-
export { default as IconGear } from
|
|
27
|
-
export { default as IconGlobe } from
|
|
28
|
-
export { default as IconHeart } from
|
|
29
|
-
export { default as IconImage } from
|
|
30
|
-
export { default as IconLink } from
|
|
31
|
-
export { default as IconMail } from
|
|
32
|
-
export { default as IconMinus } from
|
|
33
|
-
export { default as IconMonitor } from
|
|
34
|
-
export { default as IconPencil } from
|
|
35
|
-
export { default as IconPhone } from
|
|
36
|
-
export { default as IconPlus } from
|
|
37
|
-
export { default as IconRedo } from
|
|
38
|
-
export { default as IconSearch } from
|
|
39
|
-
export { default as IconSend } from
|
|
40
|
-
export { default as IconShare } from
|
|
41
|
-
export { default as IconSmile } from
|
|
42
|
-
export { default as IconSwitch } from
|
|
43
|
-
export { default as IconTablet } from
|
|
44
|
-
export { default as IconTextAlignCenter } from
|
|
45
|
-
export { default as IconTextAlignLeft } from
|
|
46
|
-
export { default as IconTextAlignRight } from
|
|
47
|
-
export { default as IconTrash } from
|
|
48
|
-
export { default as IconType } from
|
|
49
|
-
export { default as IconUndo } from
|
|
50
|
-
export { default as IconUpload } from
|
|
51
|
-
export { default as IconDownload } from
|
|
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
|
|
2
|
-
export * from
|
|
3
|
-
export
|
|
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
|
|
3
|
-
import { vars } from
|
|
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([
|
|
9
|
-
radius: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.
|
|
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([
|
|
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([
|
|
16
|
-
overflow: PropTypes.oneOf([
|
|
17
|
-
fieldSize: PropTypes.oneOf([
|
|
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([
|
|
20
|
-
gridItemsAlignments: PropTypes.oneOf([
|
|
21
|
-
gridContentPositions: PropTypes.oneOf([
|
|
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
|
};
|
package/es/utilities/helpers.js
CHANGED
|
@@ -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
|
|
12
|
-
export var isBrowser = typeof window !==
|
|
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 ===
|
|
23
|
+
return typeof value === 'number';
|
|
24
24
|
};
|
|
25
25
|
export var isString = function isString(value) {
|
|
26
|
-
return typeof value ===
|
|
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) ===
|
|
32
|
+
return _typeof(value) === 'object';
|
|
33
33
|
};
|
package/es/utilities/index.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
export { getDimension } from
|
|
2
|
-
export { getResponsiveDimension } from
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
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 {
|
|
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 ===
|
|
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,
|
|
43
|
-
var
|
|
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[
|
|
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(
|
|
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,
|
|
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,
|
|
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(
|
|
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 =
|
|
100
|
+
var property = 'font-size';
|
|
102
101
|
|
|
103
102
|
if (isObject(size)) {
|
|
104
|
-
return mapObjToMedia(property, size,
|
|
103
|
+
return mapObjToMedia(property, size, varInfo.texts.name);
|
|
105
104
|
}
|
|
106
105
|
|
|
107
106
|
return "".concat(property, ": ").concat(getTextSize(size));
|
package/es/utilities/styles.js
CHANGED
|
@@ -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 {
|
|
21
|
-
import { getDimension } from
|
|
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.
|
|
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(
|
|
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(
|
|
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(
|
|
41
|
+
return getCssVar(varInfo.weights.prefix, weight);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
export var getRadius = function getRadius(radius) {
|
|
45
|
-
if (radius in vars.
|
|
46
|
-
return getCssVar(
|
|
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(
|
|
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(
|
|
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(
|
|
90
|
+
}).join(';'), ";\n\n border-color: ").concat(getColor(borderColor), ";\n border-width: ").concat(getDimension(borderWidth), ";\n ");
|
|
91
91
|
}
|
|
92
92
|
};
|