@symbo.ls/scratch 3.6.8 → 3.7.0
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/dist/cjs/defaultConfig/animation.js +2 -2
- package/dist/cjs/defaultConfig/cases.js +2 -2
- package/dist/cjs/defaultConfig/color.js +4 -4
- package/dist/cjs/defaultConfig/document.js +2 -2
- package/dist/cjs/defaultConfig/font-family.js +6 -6
- package/dist/cjs/defaultConfig/font.js +2 -2
- package/dist/cjs/defaultConfig/grid.js +2 -2
- package/dist/cjs/defaultConfig/icons.js +4 -4
- package/dist/cjs/defaultConfig/index.js +2 -2
- package/dist/cjs/defaultConfig/media.js +2 -2
- package/dist/cjs/defaultConfig/responsive.js +4 -4
- package/dist/cjs/defaultConfig/sequence.js +2 -2
- package/dist/cjs/defaultConfig/shadow.js +2 -7
- package/dist/cjs/defaultConfig/spacing.js +4 -4
- package/dist/cjs/defaultConfig/svg.js +4 -4
- package/dist/cjs/defaultConfig/templates.js +2 -2
- package/dist/cjs/defaultConfig/theme.js +2 -2
- package/dist/cjs/defaultConfig/timing.js +3 -3
- package/dist/cjs/defaultConfig/typography.js +3 -3
- package/dist/cjs/defaultConfig/unit.js +2 -2
- package/dist/cjs/factory.js +6 -0
- package/dist/cjs/set.js +8 -4
- package/dist/cjs/system/color.js +4 -4
- package/dist/cjs/system/document.js +1 -1
- package/dist/cjs/system/font.js +2 -2
- package/dist/cjs/system/reset.js +2 -2
- package/dist/cjs/system/shadow.js +2 -2
- package/dist/cjs/system/spacing.js +3 -3
- package/dist/cjs/system/svg.js +5 -5
- package/dist/cjs/system/theme.js +4 -4
- package/dist/cjs/system/timing.js +3 -3
- package/dist/cjs/system/typography.js +3 -3
- package/dist/cjs/transforms/index.js +1 -1
- package/dist/cjs/utils/sequence.js +1 -1
- package/dist/cjs/utils/var.js +3 -3
- package/dist/esm/defaultConfig/animation.js +2 -2
- package/dist/esm/defaultConfig/cases.js +2 -2
- package/dist/esm/defaultConfig/color.js +4 -4
- package/dist/esm/defaultConfig/document.js +2 -2
- package/dist/esm/defaultConfig/font-family.js +6 -6
- package/dist/esm/defaultConfig/font.js +2 -2
- package/dist/esm/defaultConfig/grid.js +2 -2
- package/dist/esm/defaultConfig/icons.js +4 -4
- package/dist/esm/defaultConfig/index.js +2 -2
- package/dist/esm/defaultConfig/media.js +2 -2
- package/dist/esm/defaultConfig/responsive.js +4 -4
- package/dist/esm/defaultConfig/sequence.js +2 -2
- package/dist/esm/defaultConfig/shadow.js +2 -7
- package/dist/esm/defaultConfig/spacing.js +6 -6
- package/dist/esm/defaultConfig/svg.js +4 -4
- package/dist/esm/defaultConfig/templates.js +2 -2
- package/dist/esm/defaultConfig/theme.js +2 -2
- package/dist/esm/defaultConfig/timing.js +4 -4
- package/dist/esm/defaultConfig/typography.js +4 -4
- package/dist/esm/defaultConfig/unit.js +2 -2
- package/dist/esm/factory.js +6 -0
- package/dist/esm/set.js +8 -4
- package/dist/esm/system/color.js +4 -4
- package/dist/esm/system/document.js +1 -1
- package/dist/esm/system/font.js +2 -2
- package/dist/esm/system/reset.js +2 -2
- package/dist/esm/system/shadow.js +2 -2
- package/dist/esm/system/spacing.js +3 -3
- package/dist/esm/system/svg.js +5 -5
- package/dist/esm/system/theme.js +4 -4
- package/dist/esm/system/timing.js +3 -3
- package/dist/esm/system/typography.js +3 -3
- package/dist/esm/transforms/index.js +1 -1
- package/dist/esm/utils/sequence.js +1 -1
- package/dist/esm/utils/var.js +3 -3
- package/dist/iife/index.js +335 -325
- package/package.json +3 -3
- package/src/defaultConfig/animation.js +1 -1
- package/src/defaultConfig/cases.js +1 -1
- package/src/defaultConfig/color.js +2 -2
- package/src/defaultConfig/document.js +1 -1
- package/src/defaultConfig/font-family.js +3 -3
- package/src/defaultConfig/font.js +1 -1
- package/src/defaultConfig/grid.js +1 -1
- package/src/defaultConfig/icons.js +2 -2
- package/src/defaultConfig/index.js +1 -1
- package/src/defaultConfig/media.js +1 -1
- package/src/defaultConfig/responsive.js +2 -2
- package/src/defaultConfig/sequence.js +1 -1
- package/src/defaultConfig/shadow.js +1 -6
- package/src/defaultConfig/spacing.js +5 -5
- package/src/defaultConfig/svg.js +2 -2
- package/src/defaultConfig/templates.js +1 -1
- package/src/defaultConfig/theme.js +1 -1
- package/src/defaultConfig/timing.js +3 -3
- package/src/defaultConfig/typography.js +3 -3
- package/src/defaultConfig/unit.js +1 -1
- package/src/factory.js +10 -2
- package/src/set.js +8 -4
- package/src/system/color.js +4 -4
- package/src/system/document.js +1 -1
- package/src/system/font.js +2 -2
- package/src/system/reset.js +2 -2
- package/src/system/shadow.js +2 -2
- package/src/system/spacing.js +3 -3
- package/src/system/svg.js +5 -5
- package/src/system/theme.js +6 -4
- package/src/system/timing.js +3 -3
- package/src/system/typography.js +3 -3
- package/src/transforms/index.js +1 -1
- package/src/utils/sequence.js +1 -1
- package/src/utils/var.js +3 -3
|
@@ -153,7 +153,7 @@ const transformBackgroundImage = (backgroundImage, globalTheme) => {
|
|
|
153
153
|
if ((0, import_utils2.isCSSVar)(v)) return `var(${v})`;
|
|
154
154
|
if (v.includes("url")) return v;
|
|
155
155
|
if (v.includes("gradient")) return resolveColorsInGradient(v, globalTheme);
|
|
156
|
-
else if (CONFIG.
|
|
156
|
+
else if (CONFIG.gradient[backgroundImage]) {
|
|
157
157
|
return {
|
|
158
158
|
backgroundImage: (0, import_system.getMediaColor)(
|
|
159
159
|
backgroundImage,
|
|
@@ -218,7 +218,7 @@ const generateSequencePosition = (sequenceProps, position = 0) => {
|
|
|
218
218
|
};
|
|
219
219
|
const getSequenceValue = (value = "A", sequenceProps) => {
|
|
220
220
|
const CONFIG = (0, import_factory.getActiveConfig)();
|
|
221
|
-
const { UNIT } = CONFIG;
|
|
221
|
+
const { unit: UNIT } = CONFIG;
|
|
222
222
|
if ((0, import_utils.isString)(value) && (0, import_color.isCSSVar)(value)) return `var(${value})`;
|
|
223
223
|
const { sequence, unit = UNIT.default, useVariable } = sequenceProps;
|
|
224
224
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
package/dist/cjs/utils/var.js
CHANGED
|
@@ -38,7 +38,7 @@ const setVariables = (result, key) => {
|
|
|
38
38
|
};
|
|
39
39
|
const applySequenceGlobalVars = (vars, obj, options) => {
|
|
40
40
|
const CONFIG = (0, import_factory.getActiveConfig)();
|
|
41
|
-
const { UNIT } = CONFIG;
|
|
41
|
+
const { unit: UNIT } = CONFIG;
|
|
42
42
|
const unit = obj.unit || UNIT.default;
|
|
43
43
|
const { base, ratio, type } = obj;
|
|
44
44
|
const prefix = "--" + (type && type.replace(".", "-"));
|
|
@@ -53,7 +53,7 @@ const applySequenceGlobalVars = (vars, obj, options) => {
|
|
|
53
53
|
};
|
|
54
54
|
const applySequenceVars = (FACTORY, options = {}) => {
|
|
55
55
|
const CONFIG = (0, import_factory.getActiveConfig)();
|
|
56
|
-
const { UNIT, TIMING, CSS_VARS } = CONFIG;
|
|
56
|
+
const { unit: UNIT, timing: TIMING, CSS_VARS } = CONFIG;
|
|
57
57
|
const unit = FACTORY.unit || UNIT.default;
|
|
58
58
|
const { mediaRegenerate, sequence, scales } = FACTORY;
|
|
59
59
|
if (!mediaRegenerate) {
|
|
@@ -77,7 +77,7 @@ const applySequenceVars = (FACTORY, options = {}) => {
|
|
|
77
77
|
};
|
|
78
78
|
const applyMediaSequenceVars = (FACTORY, media, options = {}) => {
|
|
79
79
|
const CONFIG = (0, import_factory.getActiveConfig)();
|
|
80
|
-
const { UNIT, MEDIA, CSS_VARS } = CONFIG;
|
|
80
|
+
const { unit: UNIT, media: MEDIA, CSS_VARS } = CONFIG;
|
|
81
81
|
const mediaName = media.slice(1);
|
|
82
82
|
const unit = FACTORY.unit || UNIT.default;
|
|
83
83
|
const { mediaRegenerate } = FACTORY;
|
|
@@ -4,15 +4,15 @@ var defaultFont = {
|
|
|
4
4
|
family: "",
|
|
5
5
|
type: ""
|
|
6
6
|
};
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const font_family = {};
|
|
8
|
+
const font_family_types = {
|
|
9
9
|
"sans-serif": "Helvetica, Arial, sans-serif, --system-default",
|
|
10
10
|
serif: "Times New Roman, Georgia, serif, --system-default",
|
|
11
11
|
monospace: "Courier New, monospace, --system-default"
|
|
12
12
|
};
|
|
13
|
-
const
|
|
13
|
+
const font_face = {};
|
|
14
14
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
font_face,
|
|
16
|
+
font_family,
|
|
17
|
+
font_family_types
|
|
18
18
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const breakpoints = {
|
|
2
2
|
screenL: 1920,
|
|
3
3
|
screenM: 1680,
|
|
4
4
|
screenS: 1440,
|
|
@@ -10,7 +10,7 @@ const BREAKPOINTS = {
|
|
|
10
10
|
mobileS: 480,
|
|
11
11
|
mobileXS: 375
|
|
12
12
|
};
|
|
13
|
-
const
|
|
13
|
+
const devices = {
|
|
14
14
|
screenXXL: [2560, 1440],
|
|
15
15
|
screenXL: [2240, 1260],
|
|
16
16
|
screenL: [1920, 1024],
|
|
@@ -25,6 +25,6 @@ const DEVICES = {
|
|
|
25
25
|
mobileXS: [375, 768]
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
breakpoints,
|
|
29
|
+
devices
|
|
30
30
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { sequence } from "./sequence.js";
|
|
2
|
+
import { typography } from "./typography.js";
|
|
3
3
|
const defaultProps = {
|
|
4
|
-
base:
|
|
4
|
+
base: typography.base,
|
|
5
5
|
type: "spacing",
|
|
6
|
-
ratio:
|
|
6
|
+
ratio: sequence.phi,
|
|
7
7
|
range: [-5, 15],
|
|
8
8
|
subSequence: true,
|
|
9
9
|
mediaRegenerate: false,
|
|
@@ -12,7 +12,7 @@ const defaultProps = {
|
|
|
12
12
|
scales: {},
|
|
13
13
|
vars: {}
|
|
14
14
|
};
|
|
15
|
-
const
|
|
15
|
+
const spacing = defaultProps;
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
spacing
|
|
18
18
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sequence } from "./sequence";
|
|
2
2
|
const defaultProps = {
|
|
3
3
|
default: 150,
|
|
4
4
|
base: 150,
|
|
5
5
|
type: "timing",
|
|
6
|
-
ratio:
|
|
6
|
+
ratio: sequence["perfect-fourth"],
|
|
7
7
|
range: [-3, 12],
|
|
8
8
|
mediaRegenerate: false,
|
|
9
9
|
unit: "ms",
|
|
@@ -11,7 +11,7 @@ const defaultProps = {
|
|
|
11
11
|
scales: {},
|
|
12
12
|
vars: {}
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const timing = defaultProps;
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
timing
|
|
17
17
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sequence } from "./sequence.js";
|
|
2
2
|
const defaultProps = {
|
|
3
3
|
browserDefault: 16,
|
|
4
4
|
base: 16,
|
|
5
5
|
type: "font-size",
|
|
6
|
-
ratio:
|
|
6
|
+
ratio: sequence["minor-third"],
|
|
7
7
|
range: [-3, 12],
|
|
8
8
|
h1Matches: 6,
|
|
9
9
|
lineHeight: 1.5,
|
|
@@ -15,7 +15,7 @@ const defaultProps = {
|
|
|
15
15
|
scales: {},
|
|
16
16
|
vars: {}
|
|
17
17
|
};
|
|
18
|
-
const
|
|
18
|
+
const typography = defaultProps;
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
typography
|
|
21
21
|
};
|
package/dist/esm/factory.js
CHANGED
|
@@ -9,10 +9,16 @@ const CSS_VARS = {};
|
|
|
9
9
|
const CSS_MEDIA_VARS = {};
|
|
10
10
|
const _CONF = CONF;
|
|
11
11
|
const _confLower = {};
|
|
12
|
+
const toCamel = (s) => s.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
|
|
13
|
+
const toUpper = (s) => s.replace(/([A-Z])/g, "_$1").toUpperCase();
|
|
12
14
|
for (const key in _CONF) {
|
|
13
15
|
const lower = key.toLowerCase();
|
|
14
16
|
_confLower[lower] = _CONF[key];
|
|
17
|
+
const camel = toCamel(lower);
|
|
18
|
+
if (camel !== lower) _confLower[camel] = _CONF[key];
|
|
15
19
|
if (lower !== key) _confLower[key] = _CONF[key];
|
|
20
|
+
const upper = toUpper(key);
|
|
21
|
+
if (upper !== key) _confLower[upper] = _CONF[key];
|
|
16
22
|
}
|
|
17
23
|
const CONFIG = {
|
|
18
24
|
verbose: false,
|
package/dist/esm/set.js
CHANGED
|
@@ -25,9 +25,11 @@ const VALUE_TRANSFORMERS = {
|
|
|
25
25
|
gradient: setGradient,
|
|
26
26
|
font: setFont,
|
|
27
27
|
font_family: setFontFamily,
|
|
28
|
+
fontfamily: setFontFamily,
|
|
28
29
|
theme: setTheme,
|
|
29
30
|
icons: setSvgIcon,
|
|
30
31
|
semantic_icons: setSameValue,
|
|
32
|
+
semanticicons: setSameValue,
|
|
31
33
|
svg: setSVG,
|
|
32
34
|
svg_data: setSameValue,
|
|
33
35
|
typography: setSameValue,
|
|
@@ -84,6 +86,7 @@ const set = (recivedConfig, options = SET_OPTIONS) => {
|
|
|
84
86
|
globalTheme,
|
|
85
87
|
useDocumentTheme,
|
|
86
88
|
useDefaultConfig,
|
|
89
|
+
semanticIcons,
|
|
87
90
|
SEMANTIC_ICONS,
|
|
88
91
|
semantic_icons,
|
|
89
92
|
files,
|
|
@@ -103,9 +106,10 @@ const set = (recivedConfig, options = SET_OPTIONS) => {
|
|
|
103
106
|
if (globalTheme !== void 0) CONFIG.globalTheme = globalTheme;
|
|
104
107
|
if (recivedConfig.useThemeSuffixedVars !== void 0) CONFIG.useThemeSuffixedVars = recivedConfig.useThemeSuffixedVars;
|
|
105
108
|
if (useDefaultConfig !== void 0) CONFIG.useDefaultConfig = useDefaultConfig;
|
|
106
|
-
const _semanticIcons = SEMANTIC_ICONS || semantic_icons;
|
|
109
|
+
const _semanticIcons = semanticIcons || SEMANTIC_ICONS || semantic_icons;
|
|
107
110
|
if (_semanticIcons !== void 0) {
|
|
108
111
|
CONFIG.semantic_icons = _semanticIcons;
|
|
112
|
+
CONFIG.semanticIcons = CONFIG.semantic_icons;
|
|
109
113
|
CONFIG.SEMANTIC_ICONS = CONFIG.semantic_icons;
|
|
110
114
|
}
|
|
111
115
|
if (CONFIG.verbose) console.log(CONFIG);
|
|
@@ -123,21 +127,21 @@ const set = (recivedConfig, options = SET_OPTIONS) => {
|
|
|
123
127
|
if (lower !== key && keySet.has(lower)) return;
|
|
124
128
|
return setEach(key, config[key]);
|
|
125
129
|
});
|
|
126
|
-
if (config.
|
|
130
|
+
if (config.typography || config.TYPOGRAPHY) {
|
|
127
131
|
try {
|
|
128
132
|
applyTypographySequence();
|
|
129
133
|
} catch (e) {
|
|
130
134
|
if (CONFIG.verbose) console.warn("Error applying typography sequence", e);
|
|
131
135
|
}
|
|
132
136
|
}
|
|
133
|
-
if (config.
|
|
137
|
+
if (config.spacing || config.SPACING) {
|
|
134
138
|
try {
|
|
135
139
|
applySpacingSequence();
|
|
136
140
|
} catch (e) {
|
|
137
141
|
if (CONFIG.verbose) console.warn("Error applying spacing sequence", e);
|
|
138
142
|
}
|
|
139
143
|
}
|
|
140
|
-
if (config.
|
|
144
|
+
if (config.timing || config.TIMING) {
|
|
141
145
|
try {
|
|
142
146
|
applyTimingSequence();
|
|
143
147
|
} catch (e) {
|
package/dist/esm/system/color.js
CHANGED
|
@@ -26,7 +26,7 @@ const getColor = (value, key, config) => {
|
|
|
26
26
|
alpha = parsed.alpha;
|
|
27
27
|
tone = parsed.tone;
|
|
28
28
|
}
|
|
29
|
-
const { COLOR, GRADIENT } = CONFIG;
|
|
29
|
+
const { color: COLOR, gradient: GRADIENT } = CONFIG;
|
|
30
30
|
let val = COLOR[name] || GRADIENT[name];
|
|
31
31
|
if (!val) {
|
|
32
32
|
if (CONFIG.verbose) console.warn("Can't find color ", name);
|
|
@@ -67,7 +67,7 @@ const getMediaColor = (value, globalTheme, config) => {
|
|
|
67
67
|
if (parsed.cssVar) return `var(${parsed.cssVar})`;
|
|
68
68
|
name = parsed.name;
|
|
69
69
|
}
|
|
70
|
-
const { COLOR, GRADIENT } = CONFIG;
|
|
70
|
+
const { color: COLOR, gradient: GRADIENT } = CONFIG;
|
|
71
71
|
const val = COLOR[name] || GRADIENT[name];
|
|
72
72
|
const isObj = isObject(val);
|
|
73
73
|
if (isObj && val.value) return getColor(value, `@${globalTheme}`, config);
|
|
@@ -76,7 +76,7 @@ const getMediaColor = (value, globalTheme, config) => {
|
|
|
76
76
|
else {
|
|
77
77
|
const obj = {};
|
|
78
78
|
for (const mediaName in val) {
|
|
79
|
-
const query = CONFIG.
|
|
79
|
+
const query = CONFIG.media[mediaName.slice(1)];
|
|
80
80
|
const media = "@media " + (query === "print" ? `${query}` : `screen and ${query}`);
|
|
81
81
|
obj[media] = getColor(value, mediaName, config);
|
|
82
82
|
}
|
|
@@ -94,7 +94,7 @@ const setColor = (val, key, suffix) => {
|
|
|
94
94
|
val = getColor(rawRef);
|
|
95
95
|
if (!(val.includes("rgb") || val.includes("var") || val.includes("#"))) {
|
|
96
96
|
const parts = rawRef.split(" ");
|
|
97
|
-
const refColor = CONFIG.
|
|
97
|
+
const refColor = CONFIG.color[parts[0]];
|
|
98
98
|
if (refColor && refColor.value) {
|
|
99
99
|
let rgb2 = refColor.rgb;
|
|
100
100
|
const alpha2 = parts[1] !== void 0 ? parts[1] : "1";
|
|
@@ -3,7 +3,7 @@ import { getActiveConfig } from "../factory.js";
|
|
|
3
3
|
import { getDefaultOrFirstKey } from "../utils";
|
|
4
4
|
const applyDocument = () => {
|
|
5
5
|
const CONFIG = getActiveConfig();
|
|
6
|
-
const { DOCUMENT, FONT_FAMILY, THEME, TYPOGRAPHY } = CONFIG;
|
|
6
|
+
const { document: DOCUMENT, font_family: FONT_FAMILY, theme: THEME, typography: TYPOGRAPHY } = CONFIG;
|
|
7
7
|
return merge(DOCUMENT, {
|
|
8
8
|
theme: THEME.document,
|
|
9
9
|
fontFamily: getDefaultOrFirstKey(FONT_FAMILY),
|
package/dist/esm/system/font.js
CHANGED
|
@@ -34,12 +34,12 @@ const setFont = (val, key) => {
|
|
|
34
34
|
};
|
|
35
35
|
const getFontFamily = (key, factory) => {
|
|
36
36
|
const CONFIG = getActiveConfig();
|
|
37
|
-
const { FONT_FAMILY } = CONFIG;
|
|
37
|
+
const { font_family: FONT_FAMILY } = CONFIG;
|
|
38
38
|
return getDefaultOrFirstKey(factory || FONT_FAMILY, key);
|
|
39
39
|
};
|
|
40
40
|
const setFontFamily = (val, key) => {
|
|
41
41
|
const CONFIG = getActiveConfig();
|
|
42
|
-
const { FONT_FAMILY, FONT_FAMILY_TYPES } = CONFIG;
|
|
42
|
+
const { font_family: FONT_FAMILY, font_family_types: FONT_FAMILY_TYPES } = CONFIG;
|
|
43
43
|
let { value, type } = val;
|
|
44
44
|
if (val.isDefault) FONT_FAMILY.default = key;
|
|
45
45
|
if (isObject(value)) value = arrayzeValue(value);
|
package/dist/esm/system/reset.js
CHANGED
|
@@ -3,7 +3,7 @@ import { getActiveConfig } from "../factory.js";
|
|
|
3
3
|
import { getMediaTheme } from "./theme.js";
|
|
4
4
|
const applyReset = (reset = {}) => {
|
|
5
5
|
const CONFIG = getActiveConfig();
|
|
6
|
-
const { RESET, TYPOGRAPHY, DOCUMENT } = CONFIG;
|
|
6
|
+
const { reset: RESET, typography: TYPOGRAPHY, document: DOCUMENT } = CONFIG;
|
|
7
7
|
if (RESET) {
|
|
8
8
|
if (RESET[":root"]) {
|
|
9
9
|
const configReset = RESET;
|
|
@@ -43,7 +43,7 @@ const applyReset = (reset = {}) => {
|
|
|
43
43
|
height: "100%",
|
|
44
44
|
margin: 0,
|
|
45
45
|
fontFamily: DOCUMENT.fontFamily,
|
|
46
|
-
fontSize: TYPOGRAPHY.base / TYPOGRAPHY.browserDefault + CONFIG.
|
|
46
|
+
fontSize: TYPOGRAPHY.base / TYPOGRAPHY.browserDefault + CONFIG.unit.default,
|
|
47
47
|
...templates,
|
|
48
48
|
...body
|
|
49
49
|
},
|
|
@@ -61,7 +61,7 @@ const getShadow = (value, globalTheme) => {
|
|
|
61
61
|
}
|
|
62
62
|
if (isCSSVar(value)) return `var(${value})`;
|
|
63
63
|
const [name] = isArray(value) ? value : value.split(" ");
|
|
64
|
-
const
|
|
64
|
+
const SHADOW = CONFIG.shadow;
|
|
65
65
|
const val = SHADOW[name];
|
|
66
66
|
const isObj = isObject(val);
|
|
67
67
|
if (!val) {
|
|
@@ -76,7 +76,7 @@ const getShadow = (value, globalTheme) => {
|
|
|
76
76
|
if (isObj) {
|
|
77
77
|
const obj = {};
|
|
78
78
|
for (const mediaName in val) {
|
|
79
|
-
const query = CONFIG.
|
|
79
|
+
const query = CONFIG.media[mediaName.slice(1)];
|
|
80
80
|
const media = "@media " + (query === "print" ? `${query}` : `screen and ${query}`);
|
|
81
81
|
obj[media] = val.value;
|
|
82
82
|
}
|
|
@@ -40,14 +40,14 @@ const checkIfBoxSize = (propertyName) => {
|
|
|
40
40
|
};
|
|
41
41
|
const applySpacingSequence = () => {
|
|
42
42
|
const CONFIG = getActiveConfig();
|
|
43
|
-
const { SPACING } = CONFIG;
|
|
43
|
+
const { spacing: SPACING } = CONFIG;
|
|
44
44
|
generateSequence(SPACING);
|
|
45
45
|
applySequenceVars(SPACING);
|
|
46
46
|
runThroughMedia(SPACING);
|
|
47
47
|
};
|
|
48
48
|
const getSequence = (sequenceProps) => {
|
|
49
49
|
const CONFIG = getActiveConfig();
|
|
50
|
-
const { SPACING } = CONFIG;
|
|
50
|
+
const { spacing: SPACING } = CONFIG;
|
|
51
51
|
if (!sequenceProps || !sequenceProps.sequence) return SPACING;
|
|
52
52
|
const hasGenerated = Object.keys(sequenceProps.sequence).length > 0;
|
|
53
53
|
return hasGenerated ? sequenceProps : generateSequence(sequenceProps);
|
|
@@ -88,7 +88,7 @@ const getSpacingByKey = (value, propertyName = "padding", sequenceProps, fnPrefi
|
|
|
88
88
|
};
|
|
89
89
|
const getSpacingBasedOnRatio = (props, propertyName, val, fnPrefix) => {
|
|
90
90
|
const CONFIG = getActiveConfig();
|
|
91
|
-
const { SPACING } = CONFIG;
|
|
91
|
+
const { spacing: SPACING } = CONFIG;
|
|
92
92
|
let value = val || props[propertyName];
|
|
93
93
|
if (!fnPrefix && isString(value) && value.includes("(")) {
|
|
94
94
|
const fnArr = getFnPrefixAndValue(value);
|
package/dist/esm/system/svg.js
CHANGED
|
@@ -17,21 +17,21 @@ const setSVG = (val, key) => {
|
|
|
17
17
|
};
|
|
18
18
|
const appendSVGSprite = (LIBRARY, options = DEF_OPTIONS) => {
|
|
19
19
|
const CONFIG = getActiveConfig();
|
|
20
|
-
const lib = Object.keys(LIBRARY).length ? {} : CONFIG.
|
|
21
|
-
for (const key in LIBRARY) lib[key] = CONFIG.
|
|
20
|
+
const lib = Object.keys(LIBRARY).length ? {} : CONFIG.svg;
|
|
21
|
+
for (const key in LIBRARY) lib[key] = CONFIG.svg[key];
|
|
22
22
|
appendSVG(lib, options);
|
|
23
23
|
};
|
|
24
24
|
const setSvgIcon = (val, key) => {
|
|
25
25
|
const CONFIG = getActiveConfig();
|
|
26
|
-
if (CONFIG.useIconSprite && !CONFIG.
|
|
26
|
+
if (CONFIG.useIconSprite && !CONFIG.semantic_icons?.[key]) {
|
|
27
27
|
return setSVG(val, key);
|
|
28
28
|
}
|
|
29
29
|
return val;
|
|
30
30
|
};
|
|
31
31
|
const appendSvgIconsSprite = (LIBRARY, options = DEF_OPTIONS) => {
|
|
32
32
|
const CONFIG = getActiveConfig();
|
|
33
|
-
const lib = Object.keys(LIBRARY).length ? {} : CONFIG.
|
|
34
|
-
for (const key in LIBRARY) lib[key] = CONFIG.
|
|
33
|
+
const lib = Object.keys(LIBRARY).length ? {} : CONFIG.icons;
|
|
34
|
+
for (const key in LIBRARY) lib[key] = CONFIG.icons[key];
|
|
35
35
|
appendSVG(lib, options);
|
|
36
36
|
};
|
|
37
37
|
const createSVGSpriteElement = (options = { isRoot: true }) => {
|
package/dist/esm/system/theme.js
CHANGED
|
@@ -26,7 +26,7 @@ const getThemeValue = (theme) => {
|
|
|
26
26
|
const getTheme = (value, modifier) => {
|
|
27
27
|
const CONFIG = getActiveConfig();
|
|
28
28
|
if (CONFIG.useVariable) return getMediaTheme(value, modifier);
|
|
29
|
-
const
|
|
29
|
+
const THEME = CONFIG.theme;
|
|
30
30
|
if (isString(value)) {
|
|
31
31
|
const [theme, subtheme] = value.split(" ");
|
|
32
32
|
const isOurTheme = THEME[theme];
|
|
@@ -97,7 +97,7 @@ const setHelpers = (theme, value) => {
|
|
|
97
97
|
const keys = Object.keys(helpers);
|
|
98
98
|
keys.map((key) => {
|
|
99
99
|
const helper = helpers[key];
|
|
100
|
-
if (isString(helper)) helpers[key] = CONFIG.
|
|
100
|
+
if (isString(helper)) helpers[key] = CONFIG.theme[helper];
|
|
101
101
|
else getThemeValue(helpers[key]);
|
|
102
102
|
return theme;
|
|
103
103
|
});
|
|
@@ -230,7 +230,7 @@ const setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
if (isString(val) && isCSSVar(val)) {
|
|
233
|
-
const
|
|
233
|
+
const THEME = CONFIG.theme;
|
|
234
234
|
const value = THEME[val.slice(2)];
|
|
235
235
|
const getReferenced = getMediaTheme(value, prefers);
|
|
236
236
|
return getReferenced;
|
|
@@ -279,7 +279,7 @@ const getMediaTheme = (value, modifier) => {
|
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
281
|
const [themeName, ...themeModifiers] = isArray(value) ? value : value.split(" ");
|
|
282
|
-
let themeValue = activeConfig.
|
|
282
|
+
let themeValue = activeConfig.theme[themeName];
|
|
283
283
|
if (themeValue && themeModifiers.length) {
|
|
284
284
|
themeValue = findModifier(themeValue, themeModifiers);
|
|
285
285
|
} else if (themeValue && modifier) {
|
|
@@ -7,18 +7,18 @@ import {
|
|
|
7
7
|
} from "../utils";
|
|
8
8
|
const applyTimingSequence = () => {
|
|
9
9
|
const CONFIG = getActiveConfig();
|
|
10
|
-
const { TIMING } = CONFIG;
|
|
10
|
+
const { timing: TIMING } = CONFIG;
|
|
11
11
|
generateSequence(TIMING);
|
|
12
12
|
applySequenceVars(TIMING);
|
|
13
13
|
};
|
|
14
14
|
const getTimingFunction = (value) => {
|
|
15
15
|
const CONFIG = getActiveConfig();
|
|
16
|
-
const { TIMING } = CONFIG;
|
|
16
|
+
const { timing: TIMING } = CONFIG;
|
|
17
17
|
return TIMING[value] || TIMING[toCamelCase(value)] || value;
|
|
18
18
|
};
|
|
19
19
|
const getTimingByKey = (value, property = "timing") => {
|
|
20
20
|
const CONFIG = getActiveConfig();
|
|
21
|
-
const { TIMING } = CONFIG;
|
|
21
|
+
const { timing: TIMING } = CONFIG;
|
|
22
22
|
return getSequenceValuePropertyPair(
|
|
23
23
|
value,
|
|
24
24
|
property,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "../utils";
|
|
10
10
|
const runThroughMedia = (FACTORY) => {
|
|
11
11
|
const CONFIG = getActiveConfig();
|
|
12
|
-
const { TYPOGRAPHY, MEDIA } = CONFIG;
|
|
12
|
+
const { typography: TYPOGRAPHY, media: MEDIA } = CONFIG;
|
|
13
13
|
for (const prop in FACTORY) {
|
|
14
14
|
const isPropMedia = prop.slice(0, 1) === "@";
|
|
15
15
|
const mediaValue = FACTORY[prop];
|
|
@@ -66,7 +66,7 @@ const applyHeadings = (props) => {
|
|
|
66
66
|
};
|
|
67
67
|
const applyTypographySequence = () => {
|
|
68
68
|
const CONFIG = getActiveConfig();
|
|
69
|
-
const { TYPOGRAPHY } = CONFIG;
|
|
69
|
+
const { typography: TYPOGRAPHY } = CONFIG;
|
|
70
70
|
generateSequence(TYPOGRAPHY);
|
|
71
71
|
applyHeadings(TYPOGRAPHY);
|
|
72
72
|
applySequenceVars(TYPOGRAPHY);
|
|
@@ -74,7 +74,7 @@ const applyTypographySequence = () => {
|
|
|
74
74
|
};
|
|
75
75
|
const getFontSizeByKey = (value) => {
|
|
76
76
|
const CONFIG = getActiveConfig();
|
|
77
|
-
const { TYPOGRAPHY } = CONFIG;
|
|
77
|
+
const { typography: TYPOGRAPHY } = CONFIG;
|
|
78
78
|
return getSequenceValuePropertyPair(value, "fontSize", TYPOGRAPHY);
|
|
79
79
|
};
|
|
80
80
|
export {
|
|
@@ -135,7 +135,7 @@ const transformBackgroundImage = (backgroundImage, globalTheme) => {
|
|
|
135
135
|
if (isCSSVar(v)) return `var(${v})`;
|
|
136
136
|
if (v.includes("url")) return v;
|
|
137
137
|
if (v.includes("gradient")) return resolveColorsInGradient(v, globalTheme);
|
|
138
|
-
else if (CONFIG.
|
|
138
|
+
else if (CONFIG.gradient[backgroundImage]) {
|
|
139
139
|
return {
|
|
140
140
|
backgroundImage: getMediaColor(
|
|
141
141
|
backgroundImage,
|