@soroush.tech/styled-system 5.1.6
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/LICENSE +26 -0
- package/README.md +150 -0
- package/dist/background-B-jql3jb.mjs +16 -0
- package/dist/background-wugr6cG7.cjs +21 -0
- package/dist/background.cjs +7 -0
- package/dist/background.d.cts +2 -0
- package/dist/background.d.mts +2 -0
- package/dist/background.mjs +2 -0
- package/dist/border-Dder4Dhp.mjs +131 -0
- package/dist/border-UuT-fTpy.cjs +136 -0
- package/dist/border.cjs +7 -0
- package/dist/border.d.cts +2 -0
- package/dist/border.d.mts +2 -0
- package/dist/border.mjs +2 -0
- package/dist/color-BNs17Gw-.cjs +22 -0
- package/dist/color-CGmMe8yP.mjs +17 -0
- package/dist/color.cjs +7 -0
- package/dist/color.d.cts +2 -0
- package/dist/color.d.mts +2 -0
- package/dist/color.mjs +2 -0
- package/dist/core.cjs +144 -0
- package/dist/core.d.cts +2 -0
- package/dist/core.d.mts +2 -0
- package/dist/core.mjs +138 -0
- package/dist/css-nzeM_Xnf.cjs +231 -0
- package/dist/css-rLZ9Oeye.mjs +214 -0
- package/dist/css.cjs +9 -0
- package/dist/css.d.cts +12 -0
- package/dist/css.d.mts +12 -0
- package/dist/css.mjs +2 -0
- package/dist/flexbox-CFkO6PrP.cjs +22 -0
- package/dist/flexbox-XQnlnfa4.mjs +18 -0
- package/dist/flexbox.cjs +7 -0
- package/dist/flexbox.d.cts +2 -0
- package/dist/flexbox.d.mts +2 -0
- package/dist/flexbox.mjs +2 -0
- package/dist/grid-Bpk-QjhF.mjs +41 -0
- package/dist/grid-CpvRIng4.cjs +47 -0
- package/dist/grid.cjs +7 -0
- package/dist/grid.d.cts +2 -0
- package/dist/grid.d.mts +2 -0
- package/dist/grid.mjs +2 -0
- package/dist/index-50KH4Mo7.d.cts +8 -0
- package/dist/index-8PSQ0vkP.d.cts +15 -0
- package/dist/index-9ZhIewzy.d.mts +6 -0
- package/dist/index-BBTVE4EM.d.mts +15 -0
- package/dist/index-BS9GuhQN.d.cts +6 -0
- package/dist/index-BoMacn6F.d.cts +6 -0
- package/dist/index-Bx7IxKu-.d.mts +6 -0
- package/dist/index-C13YRARN.d.mts +6 -0
- package/dist/index-C3_fScux.d.mts +8 -0
- package/dist/index-CX2jWEGJ.d.mts +6 -0
- package/dist/index-CarHCWLQ.d.cts +6 -0
- package/dist/index-Ce09s0FQ.d.cts +6 -0
- package/dist/index-CrUx2vIP.d.mts +6 -0
- package/dist/index-CsS_gcI9.d.mts +6 -0
- package/dist/index-D3t1Lyte.d.mts +6 -0
- package/dist/index-D8EyRZ5p.d.cts +62 -0
- package/dist/index-D8EyRZ5p.d.mts +62 -0
- package/dist/index-DPWkvooj.d.mts +6 -0
- package/dist/index-DVR6hZCd.d.cts +6 -0
- package/dist/index-DZaFk5pk.d.cts +6 -0
- package/dist/index-J3PebPto.d.mts +6 -0
- package/dist/index-Nc-10syf.d.cts +6 -0
- package/dist/index-j3E1mxCg.d.cts +6 -0
- package/dist/index-z86wOHTb.d.cts +6 -0
- package/dist/index.cjs +185 -0
- package/dist/index.d.cts +281 -0
- package/dist/index.d.mts +281 -0
- package/dist/index.mjs +98 -0
- package/dist/layout-B1-2dfQ9.cjs +48 -0
- package/dist/layout-TqD8vcEl.mjs +42 -0
- package/dist/layout.cjs +7 -0
- package/dist/layout.d.cts +2 -0
- package/dist/layout.d.mts +2 -0
- package/dist/layout.mjs +2 -0
- package/dist/position-jf6VlRyR.mjs +42 -0
- package/dist/position-zWvCE4hD.cjs +48 -0
- package/dist/position.cjs +7 -0
- package/dist/position.d.cts +2 -0
- package/dist/position.d.mts +2 -0
- package/dist/position.mjs +2 -0
- package/dist/presets-DjaCx0dm.mjs +16 -0
- package/dist/presets-DlUVOAIL.cjs +21 -0
- package/dist/props.cjs +23 -0
- package/dist/props.d.cts +5 -0
- package/dist/props.d.mts +5 -0
- package/dist/props.mjs +21 -0
- package/dist/shadow-Bp7lx_41.mjs +14 -0
- package/dist/shadow-BrDnaQQl.cjs +18 -0
- package/dist/shadow.cjs +7 -0
- package/dist/shadow.d.cts +2 -0
- package/dist/shadow.d.mts +2 -0
- package/dist/shadow.mjs +2 -0
- package/dist/should-forward-prop.cjs +47 -0
- package/dist/should-forward-prop.d.cts +6 -0
- package/dist/should-forward-prop.d.mts +6 -0
- package/dist/should-forward-prop.mjs +18 -0
- package/dist/space-C14uiNpw.cjs +139 -0
- package/dist/space-CNrX-zoo.mjs +122 -0
- package/dist/space.cjs +9 -0
- package/dist/space.d.cts +2 -0
- package/dist/space.d.mts +2 -0
- package/dist/space.mjs +2 -0
- package/dist/theme-get.cjs +10 -0
- package/dist/theme-get.d.cts +6 -0
- package/dist/theme-get.d.mts +6 -0
- package/dist/theme-get.mjs +5 -0
- package/dist/typography-CptBXSy0.mjs +38 -0
- package/dist/typography-DD_eWLLx.cjs +42 -0
- package/dist/typography.cjs +7 -0
- package/dist/typography.d.cts +2 -0
- package/dist/typography.d.mts +2 -0
- package/dist/typography.mjs +2 -0
- package/dist/variant-CWUfe1Cc.mjs +22 -0
- package/dist/variant-ChsBzwrI.cjs +45 -0
- package/dist/variant.cjs +10 -0
- package/dist/variant.d.cts +2 -0
- package/dist/variant.d.mts +2 -0
- package/dist/variant.mjs +2 -0
- package/package.json +255 -0
package/dist/props.d.cts
ADDED
package/dist/props.d.mts
ADDED
package/dist/props.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { t as all } from "./presets-DjaCx0dm.mjs";
|
|
2
|
+
//#region src/props/props.ts
|
|
3
|
+
const regex = new RegExp(`^(${all.propNames.join("|")})$`);
|
|
4
|
+
const omit = (props) => {
|
|
5
|
+
const next = {};
|
|
6
|
+
for (const key in props) {
|
|
7
|
+
if (regex.test(key)) continue;
|
|
8
|
+
next[key] = props[key];
|
|
9
|
+
}
|
|
10
|
+
return next;
|
|
11
|
+
};
|
|
12
|
+
const pick = (props) => {
|
|
13
|
+
const next = {};
|
|
14
|
+
for (const key in props) {
|
|
15
|
+
if (!regex.test(key)) continue;
|
|
16
|
+
next[key] = props[key];
|
|
17
|
+
}
|
|
18
|
+
return next;
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { omit, pick };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { system } from "./core.mjs";
|
|
2
|
+
//#region src/shadow/shadow.ts
|
|
3
|
+
const shadow = system({
|
|
4
|
+
boxShadow: {
|
|
5
|
+
property: "boxShadow",
|
|
6
|
+
scale: "shadows"
|
|
7
|
+
},
|
|
8
|
+
textShadow: {
|
|
9
|
+
property: "textShadow",
|
|
10
|
+
scale: "shadows"
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { shadow as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/shadow/shadow.ts
|
|
2
|
+
const shadow = require("./core.cjs").system({
|
|
3
|
+
boxShadow: {
|
|
4
|
+
property: "boxShadow",
|
|
5
|
+
scale: "shadows"
|
|
6
|
+
},
|
|
7
|
+
textShadow: {
|
|
8
|
+
property: "textShadow",
|
|
9
|
+
scale: "shadows"
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
//#endregion
|
|
13
|
+
Object.defineProperty(exports, "shadow", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function() {
|
|
16
|
+
return shadow;
|
|
17
|
+
}
|
|
18
|
+
});
|
package/dist/shadow.cjs
ADDED
package/dist/shadow.mjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
//#region \0rolldown/runtime.js
|
|
6
|
+
var __create = Object.create;
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
|
+
key = keys[i];
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: ((k) => from[k]).bind(null, key),
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
//#endregion
|
|
27
|
+
const require_presets = require("./presets-DlUVOAIL.cjs");
|
|
28
|
+
let _emotion_is_prop_valid = require("@emotion/is-prop-valid");
|
|
29
|
+
_emotion_is_prop_valid = __toESM(_emotion_is_prop_valid, 1);
|
|
30
|
+
//#region src/should-forward-prop/should-forward-prop.ts
|
|
31
|
+
const memoize = (fn) => {
|
|
32
|
+
const cache = Object.create(null);
|
|
33
|
+
return (key) => {
|
|
34
|
+
if (!(key in cache)) cache[key] = fn(key);
|
|
35
|
+
return cache[key];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
const props = require_presets.all.propNames;
|
|
39
|
+
const createShouldForwardProp = (propNames) => {
|
|
40
|
+
const regex = new RegExp(`^(${propNames.join("|")})$`);
|
|
41
|
+
return memoize((prop) => (0, _emotion_is_prop_valid.default)(prop) && !regex.test(prop));
|
|
42
|
+
};
|
|
43
|
+
var should_forward_prop_default = createShouldForwardProp(props);
|
|
44
|
+
//#endregion
|
|
45
|
+
exports.createShouldForwardProp = createShouldForwardProp;
|
|
46
|
+
exports.default = should_forward_prop_default;
|
|
47
|
+
exports.props = props;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/should-forward-prop/should-forward-prop.d.ts
|
|
2
|
+
declare const props: string[];
|
|
3
|
+
declare const createShouldForwardProp: (propNames: string[]) => ((prop: string) => boolean);
|
|
4
|
+
declare const _default: (prop: string) => boolean;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { createShouldForwardProp, _default as default, props };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/should-forward-prop/should-forward-prop.d.ts
|
|
2
|
+
declare const props: string[];
|
|
3
|
+
declare const createShouldForwardProp: (propNames: string[]) => ((prop: string) => boolean);
|
|
4
|
+
declare const _default: (prop: string) => boolean;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { createShouldForwardProp, _default as default, props };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { t as all } from "./presets-DjaCx0dm.mjs";
|
|
2
|
+
import isPropValid from "@emotion/is-prop-valid";
|
|
3
|
+
//#region src/should-forward-prop/should-forward-prop.ts
|
|
4
|
+
const memoize = (fn) => {
|
|
5
|
+
const cache = Object.create(null);
|
|
6
|
+
return (key) => {
|
|
7
|
+
if (!(key in cache)) cache[key] = fn(key);
|
|
8
|
+
return cache[key];
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
const props = all.propNames;
|
|
12
|
+
const createShouldForwardProp = (propNames) => {
|
|
13
|
+
const regex = new RegExp(`^(${propNames.join("|")})$`);
|
|
14
|
+
return memoize((prop) => isPropValid(prop) && !regex.test(prop));
|
|
15
|
+
};
|
|
16
|
+
var should_forward_prop_default = createShouldForwardProp(props);
|
|
17
|
+
//#endregion
|
|
18
|
+
export { createShouldForwardProp, should_forward_prop_default as default, props };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
const require_core = require("./core.cjs");
|
|
2
|
+
//#region src/space/space.ts
|
|
3
|
+
const spaceScale = [
|
|
4
|
+
0,
|
|
5
|
+
4,
|
|
6
|
+
8,
|
|
7
|
+
16,
|
|
8
|
+
32,
|
|
9
|
+
64,
|
|
10
|
+
128,
|
|
11
|
+
256,
|
|
12
|
+
512
|
|
13
|
+
];
|
|
14
|
+
const isNumber = (n) => typeof n === "number" && !isNaN(n);
|
|
15
|
+
const getMargin = (n, scale) => {
|
|
16
|
+
if (!isNumber(n)) return require_core.get(scale, n, n);
|
|
17
|
+
const isNegative = n < 0;
|
|
18
|
+
const absolute = Math.abs(n);
|
|
19
|
+
const value = require_core.get(scale, absolute, absolute);
|
|
20
|
+
if (!isNumber(value)) return isNegative ? "-" + value : value;
|
|
21
|
+
return value * (isNegative ? -1 : 1);
|
|
22
|
+
};
|
|
23
|
+
const marginConfig = {
|
|
24
|
+
margin: {
|
|
25
|
+
property: "margin",
|
|
26
|
+
scale: "space",
|
|
27
|
+
transform: getMargin,
|
|
28
|
+
defaultScale: spaceScale
|
|
29
|
+
},
|
|
30
|
+
marginTop: {
|
|
31
|
+
property: "marginTop",
|
|
32
|
+
scale: "space",
|
|
33
|
+
transform: getMargin,
|
|
34
|
+
defaultScale: spaceScale
|
|
35
|
+
},
|
|
36
|
+
marginRight: {
|
|
37
|
+
property: "marginRight",
|
|
38
|
+
scale: "space",
|
|
39
|
+
transform: getMargin,
|
|
40
|
+
defaultScale: spaceScale
|
|
41
|
+
},
|
|
42
|
+
marginBottom: {
|
|
43
|
+
property: "marginBottom",
|
|
44
|
+
scale: "space",
|
|
45
|
+
transform: getMargin,
|
|
46
|
+
defaultScale: spaceScale
|
|
47
|
+
},
|
|
48
|
+
marginLeft: {
|
|
49
|
+
property: "marginLeft",
|
|
50
|
+
scale: "space",
|
|
51
|
+
transform: getMargin,
|
|
52
|
+
defaultScale: spaceScale
|
|
53
|
+
},
|
|
54
|
+
marginX: {
|
|
55
|
+
properties: ["marginLeft", "marginRight"],
|
|
56
|
+
scale: "space",
|
|
57
|
+
transform: getMargin,
|
|
58
|
+
defaultScale: spaceScale
|
|
59
|
+
},
|
|
60
|
+
marginY: {
|
|
61
|
+
properties: ["marginTop", "marginBottom"],
|
|
62
|
+
scale: "space",
|
|
63
|
+
transform: getMargin,
|
|
64
|
+
defaultScale: spaceScale
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
marginConfig.m = marginConfig.margin;
|
|
68
|
+
marginConfig.mt = marginConfig.marginTop;
|
|
69
|
+
marginConfig.mr = marginConfig.marginRight;
|
|
70
|
+
marginConfig.mb = marginConfig.marginBottom;
|
|
71
|
+
marginConfig.ml = marginConfig.marginLeft;
|
|
72
|
+
marginConfig.mx = marginConfig.marginX;
|
|
73
|
+
marginConfig.my = marginConfig.marginY;
|
|
74
|
+
const paddingConfig = {
|
|
75
|
+
padding: {
|
|
76
|
+
property: "padding",
|
|
77
|
+
scale: "space",
|
|
78
|
+
defaultScale: spaceScale
|
|
79
|
+
},
|
|
80
|
+
paddingTop: {
|
|
81
|
+
property: "paddingTop",
|
|
82
|
+
scale: "space",
|
|
83
|
+
defaultScale: spaceScale
|
|
84
|
+
},
|
|
85
|
+
paddingRight: {
|
|
86
|
+
property: "paddingRight",
|
|
87
|
+
scale: "space",
|
|
88
|
+
defaultScale: spaceScale
|
|
89
|
+
},
|
|
90
|
+
paddingBottom: {
|
|
91
|
+
property: "paddingBottom",
|
|
92
|
+
scale: "space",
|
|
93
|
+
defaultScale: spaceScale
|
|
94
|
+
},
|
|
95
|
+
paddingLeft: {
|
|
96
|
+
property: "paddingLeft",
|
|
97
|
+
scale: "space",
|
|
98
|
+
defaultScale: spaceScale
|
|
99
|
+
},
|
|
100
|
+
paddingX: {
|
|
101
|
+
properties: ["paddingLeft", "paddingRight"],
|
|
102
|
+
scale: "space",
|
|
103
|
+
defaultScale: spaceScale
|
|
104
|
+
},
|
|
105
|
+
paddingY: {
|
|
106
|
+
properties: ["paddingTop", "paddingBottom"],
|
|
107
|
+
scale: "space",
|
|
108
|
+
defaultScale: spaceScale
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
paddingConfig.p = paddingConfig.padding;
|
|
112
|
+
paddingConfig.pt = paddingConfig.paddingTop;
|
|
113
|
+
paddingConfig.pr = paddingConfig.paddingRight;
|
|
114
|
+
paddingConfig.pb = paddingConfig.paddingBottom;
|
|
115
|
+
paddingConfig.pl = paddingConfig.paddingLeft;
|
|
116
|
+
paddingConfig.px = paddingConfig.paddingX;
|
|
117
|
+
paddingConfig.py = paddingConfig.paddingY;
|
|
118
|
+
const margin = require_core.system(marginConfig);
|
|
119
|
+
const padding = require_core.system(paddingConfig);
|
|
120
|
+
const space = require_core.compose(margin, padding);
|
|
121
|
+
//#endregion
|
|
122
|
+
Object.defineProperty(exports, "margin", {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
get: function() {
|
|
125
|
+
return margin;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
Object.defineProperty(exports, "padding", {
|
|
129
|
+
enumerable: true,
|
|
130
|
+
get: function() {
|
|
131
|
+
return padding;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
Object.defineProperty(exports, "space", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function() {
|
|
137
|
+
return space;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { compose, get, system } from "./core.mjs";
|
|
2
|
+
//#region src/space/space.ts
|
|
3
|
+
const spaceScale = [
|
|
4
|
+
0,
|
|
5
|
+
4,
|
|
6
|
+
8,
|
|
7
|
+
16,
|
|
8
|
+
32,
|
|
9
|
+
64,
|
|
10
|
+
128,
|
|
11
|
+
256,
|
|
12
|
+
512
|
|
13
|
+
];
|
|
14
|
+
const isNumber = (n) => typeof n === "number" && !isNaN(n);
|
|
15
|
+
const getMargin = (n, scale) => {
|
|
16
|
+
if (!isNumber(n)) return get(scale, n, n);
|
|
17
|
+
const isNegative = n < 0;
|
|
18
|
+
const absolute = Math.abs(n);
|
|
19
|
+
const value = get(scale, absolute, absolute);
|
|
20
|
+
if (!isNumber(value)) return isNegative ? "-" + value : value;
|
|
21
|
+
return value * (isNegative ? -1 : 1);
|
|
22
|
+
};
|
|
23
|
+
const marginConfig = {
|
|
24
|
+
margin: {
|
|
25
|
+
property: "margin",
|
|
26
|
+
scale: "space",
|
|
27
|
+
transform: getMargin,
|
|
28
|
+
defaultScale: spaceScale
|
|
29
|
+
},
|
|
30
|
+
marginTop: {
|
|
31
|
+
property: "marginTop",
|
|
32
|
+
scale: "space",
|
|
33
|
+
transform: getMargin,
|
|
34
|
+
defaultScale: spaceScale
|
|
35
|
+
},
|
|
36
|
+
marginRight: {
|
|
37
|
+
property: "marginRight",
|
|
38
|
+
scale: "space",
|
|
39
|
+
transform: getMargin,
|
|
40
|
+
defaultScale: spaceScale
|
|
41
|
+
},
|
|
42
|
+
marginBottom: {
|
|
43
|
+
property: "marginBottom",
|
|
44
|
+
scale: "space",
|
|
45
|
+
transform: getMargin,
|
|
46
|
+
defaultScale: spaceScale
|
|
47
|
+
},
|
|
48
|
+
marginLeft: {
|
|
49
|
+
property: "marginLeft",
|
|
50
|
+
scale: "space",
|
|
51
|
+
transform: getMargin,
|
|
52
|
+
defaultScale: spaceScale
|
|
53
|
+
},
|
|
54
|
+
marginX: {
|
|
55
|
+
properties: ["marginLeft", "marginRight"],
|
|
56
|
+
scale: "space",
|
|
57
|
+
transform: getMargin,
|
|
58
|
+
defaultScale: spaceScale
|
|
59
|
+
},
|
|
60
|
+
marginY: {
|
|
61
|
+
properties: ["marginTop", "marginBottom"],
|
|
62
|
+
scale: "space",
|
|
63
|
+
transform: getMargin,
|
|
64
|
+
defaultScale: spaceScale
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
marginConfig.m = marginConfig.margin;
|
|
68
|
+
marginConfig.mt = marginConfig.marginTop;
|
|
69
|
+
marginConfig.mr = marginConfig.marginRight;
|
|
70
|
+
marginConfig.mb = marginConfig.marginBottom;
|
|
71
|
+
marginConfig.ml = marginConfig.marginLeft;
|
|
72
|
+
marginConfig.mx = marginConfig.marginX;
|
|
73
|
+
marginConfig.my = marginConfig.marginY;
|
|
74
|
+
const paddingConfig = {
|
|
75
|
+
padding: {
|
|
76
|
+
property: "padding",
|
|
77
|
+
scale: "space",
|
|
78
|
+
defaultScale: spaceScale
|
|
79
|
+
},
|
|
80
|
+
paddingTop: {
|
|
81
|
+
property: "paddingTop",
|
|
82
|
+
scale: "space",
|
|
83
|
+
defaultScale: spaceScale
|
|
84
|
+
},
|
|
85
|
+
paddingRight: {
|
|
86
|
+
property: "paddingRight",
|
|
87
|
+
scale: "space",
|
|
88
|
+
defaultScale: spaceScale
|
|
89
|
+
},
|
|
90
|
+
paddingBottom: {
|
|
91
|
+
property: "paddingBottom",
|
|
92
|
+
scale: "space",
|
|
93
|
+
defaultScale: spaceScale
|
|
94
|
+
},
|
|
95
|
+
paddingLeft: {
|
|
96
|
+
property: "paddingLeft",
|
|
97
|
+
scale: "space",
|
|
98
|
+
defaultScale: spaceScale
|
|
99
|
+
},
|
|
100
|
+
paddingX: {
|
|
101
|
+
properties: ["paddingLeft", "paddingRight"],
|
|
102
|
+
scale: "space",
|
|
103
|
+
defaultScale: spaceScale
|
|
104
|
+
},
|
|
105
|
+
paddingY: {
|
|
106
|
+
properties: ["paddingTop", "paddingBottom"],
|
|
107
|
+
scale: "space",
|
|
108
|
+
defaultScale: spaceScale
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
paddingConfig.p = paddingConfig.padding;
|
|
112
|
+
paddingConfig.pt = paddingConfig.paddingTop;
|
|
113
|
+
paddingConfig.pr = paddingConfig.paddingRight;
|
|
114
|
+
paddingConfig.pb = paddingConfig.paddingBottom;
|
|
115
|
+
paddingConfig.pl = paddingConfig.paddingLeft;
|
|
116
|
+
paddingConfig.px = paddingConfig.paddingX;
|
|
117
|
+
paddingConfig.py = paddingConfig.paddingY;
|
|
118
|
+
const margin = system(marginConfig);
|
|
119
|
+
const padding = system(paddingConfig);
|
|
120
|
+
const space = compose(margin, padding);
|
|
121
|
+
//#endregion
|
|
122
|
+
export { padding as n, space as r, margin as t };
|
package/dist/space.cjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_space = require("./space-C14uiNpw.cjs");
|
|
6
|
+
exports.default = require_space.space;
|
|
7
|
+
exports.margin = require_space.margin;
|
|
8
|
+
exports.padding = require_space.padding;
|
|
9
|
+
exports.space = require_space.space;
|
package/dist/space.d.cts
ADDED
package/dist/space.d.mts
ADDED
package/dist/space.mjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_core = require("./core.cjs");
|
|
6
|
+
//#region src/theme-get/theme-get.ts
|
|
7
|
+
const themeGet = (path, fallback = null) => (props) => require_core.get(props.theme, path, fallback);
|
|
8
|
+
//#endregion
|
|
9
|
+
exports.default = themeGet;
|
|
10
|
+
exports.themeGet = themeGet;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { system } from "./core.mjs";
|
|
2
|
+
const typography = system({
|
|
3
|
+
fontFamily: {
|
|
4
|
+
property: "fontFamily",
|
|
5
|
+
scale: "fonts"
|
|
6
|
+
},
|
|
7
|
+
fontSize: {
|
|
8
|
+
property: "fontSize",
|
|
9
|
+
scale: "fontSizes",
|
|
10
|
+
defaultScale: [
|
|
11
|
+
12,
|
|
12
|
+
14,
|
|
13
|
+
16,
|
|
14
|
+
20,
|
|
15
|
+
24,
|
|
16
|
+
32,
|
|
17
|
+
48,
|
|
18
|
+
64,
|
|
19
|
+
72
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
fontWeight: {
|
|
23
|
+
property: "fontWeight",
|
|
24
|
+
scale: "fontWeights"
|
|
25
|
+
},
|
|
26
|
+
lineHeight: {
|
|
27
|
+
property: "lineHeight",
|
|
28
|
+
scale: "lineHeights"
|
|
29
|
+
},
|
|
30
|
+
letterSpacing: {
|
|
31
|
+
property: "letterSpacing",
|
|
32
|
+
scale: "letterSpacings"
|
|
33
|
+
},
|
|
34
|
+
textAlign: true,
|
|
35
|
+
fontStyle: true
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { typography as t };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const typography = require("./core.cjs").system({
|
|
2
|
+
fontFamily: {
|
|
3
|
+
property: "fontFamily",
|
|
4
|
+
scale: "fonts"
|
|
5
|
+
},
|
|
6
|
+
fontSize: {
|
|
7
|
+
property: "fontSize",
|
|
8
|
+
scale: "fontSizes",
|
|
9
|
+
defaultScale: [
|
|
10
|
+
12,
|
|
11
|
+
14,
|
|
12
|
+
16,
|
|
13
|
+
20,
|
|
14
|
+
24,
|
|
15
|
+
32,
|
|
16
|
+
48,
|
|
17
|
+
64,
|
|
18
|
+
72
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
fontWeight: {
|
|
22
|
+
property: "fontWeight",
|
|
23
|
+
scale: "fontWeights"
|
|
24
|
+
},
|
|
25
|
+
lineHeight: {
|
|
26
|
+
property: "lineHeight",
|
|
27
|
+
scale: "lineHeights"
|
|
28
|
+
},
|
|
29
|
+
letterSpacing: {
|
|
30
|
+
property: "letterSpacing",
|
|
31
|
+
scale: "letterSpacings"
|
|
32
|
+
},
|
|
33
|
+
textAlign: true,
|
|
34
|
+
fontStyle: true
|
|
35
|
+
});
|
|
36
|
+
//#endregion
|
|
37
|
+
Object.defineProperty(exports, "typography", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function() {
|
|
40
|
+
return typography;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_typography = require("./typography-DD_eWLLx.cjs");
|
|
6
|
+
exports.default = require_typography.typography;
|
|
7
|
+
exports.typography = require_typography.typography;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createParser, get } from "./core.mjs";
|
|
2
|
+
import { t as css } from "./css-rLZ9Oeye.mjs";
|
|
3
|
+
//#region src/variant/variant.ts
|
|
4
|
+
const variant = (options = {}) => {
|
|
5
|
+
const { scale, prop = "variant", variants = {}, key } = options;
|
|
6
|
+
const useCss = Object.keys(variants).length > 0;
|
|
7
|
+
const sx = ((value, scaleArg, props) => useCss ? css(get(scaleArg, value, null))(props?.theme) : get(scaleArg, value, null));
|
|
8
|
+
sx.scale = scale || key;
|
|
9
|
+
sx.defaults = variants;
|
|
10
|
+
return createParser({ [prop]: sx });
|
|
11
|
+
};
|
|
12
|
+
const buttonStyle = variant({ key: "buttons" });
|
|
13
|
+
const textStyle = variant({
|
|
14
|
+
key: "textStyles",
|
|
15
|
+
prop: "textStyle"
|
|
16
|
+
});
|
|
17
|
+
const colorStyle = variant({
|
|
18
|
+
key: "colorStyles",
|
|
19
|
+
prop: "colors"
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
export { variant as i, colorStyle as n, textStyle as r, buttonStyle as t };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const require_core = require("./core.cjs");
|
|
2
|
+
const require_css = require("./css-nzeM_Xnf.cjs");
|
|
3
|
+
//#region src/variant/variant.ts
|
|
4
|
+
const variant = (options = {}) => {
|
|
5
|
+
const { scale, prop = "variant", variants = {}, key } = options;
|
|
6
|
+
const useCss = Object.keys(variants).length > 0;
|
|
7
|
+
const sx = ((value, scaleArg, props) => useCss ? require_css.css(require_core.get(scaleArg, value, null))(props?.theme) : require_core.get(scaleArg, value, null));
|
|
8
|
+
sx.scale = scale || key;
|
|
9
|
+
sx.defaults = variants;
|
|
10
|
+
return require_core.createParser({ [prop]: sx });
|
|
11
|
+
};
|
|
12
|
+
const buttonStyle = variant({ key: "buttons" });
|
|
13
|
+
const textStyle = variant({
|
|
14
|
+
key: "textStyles",
|
|
15
|
+
prop: "textStyle"
|
|
16
|
+
});
|
|
17
|
+
const colorStyle = variant({
|
|
18
|
+
key: "colorStyles",
|
|
19
|
+
prop: "colors"
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
Object.defineProperty(exports, "buttonStyle", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return buttonStyle;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "colorStyle", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function() {
|
|
31
|
+
return colorStyle;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "textStyle", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function() {
|
|
37
|
+
return textStyle;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "variant", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function() {
|
|
43
|
+
return variant;
|
|
44
|
+
}
|
|
45
|
+
});
|
package/dist/variant.cjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_variant = require("./variant-ChsBzwrI.cjs");
|
|
6
|
+
exports.buttonStyle = require_variant.buttonStyle;
|
|
7
|
+
exports.colorStyle = require_variant.colorStyle;
|
|
8
|
+
exports.default = require_variant.variant;
|
|
9
|
+
exports.textStyle = require_variant.textStyle;
|
|
10
|
+
exports.variant = require_variant.variant;
|