css-in-props 3.8.9 → 3.14.1
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/README.md +6 -22
- package/dist/cjs/{props/defaults.js → defaults.js} +2 -2
- package/dist/cjs/index.js +19 -2
- package/dist/cjs/package.json +4 -0
- package/dist/cjs/props/animation.js +16 -80
- package/dist/cjs/props/block.js +71 -89
- package/dist/cjs/props/font.js +8 -7
- package/dist/cjs/props/index.js +0 -32
- package/dist/cjs/props/misc.js +9 -8
- package/dist/cjs/props/position.js +17 -14
- package/dist/cjs/props/theme.js +73 -70
- package/dist/cjs/props/timing.js +11 -11
- package/dist/cjs/registry.js +39 -0
- package/dist/cjs/set.js +1 -1
- package/dist/cjs/transform.js +80 -0
- package/index.js +1 -0
- package/package.json +13 -15
- package/src/index.js +4 -4
- package/src/props/animation.js +28 -23
- package/src/props/block.js +49 -57
- package/src/props/flex.js +4 -5
- package/src/props/index.js +18 -19
- package/src/props/misc.js +10 -3
- package/src/props/theme.js +10 -7
- package/src/set.js +11 -4
- package/src/transform/executors.js +60 -52
- package/src/transform/index.js +2 -2
- package/src/transform/transformers.js +85 -23
- package/dist/cjs/_transform.js +0 -30
- package/dist/cjs/props/flex.js +0 -45
- package/dist/cjs/props/grid.js +0 -39
- package/dist/cjs/transform/executors.js +0 -124
- package/dist/cjs/transform/index.js +0 -19
- package/dist/cjs/transform/transformers.js +0 -107
- package/dist/esm/_transform.js +0 -10
- package/dist/esm/emotion.js +0 -9
- package/dist/esm/index.js +0 -4
- package/dist/esm/props/animation.js +0 -101
- package/dist/esm/props/block.js +0 -171
- package/dist/esm/props/defaults.js +0 -321
- package/dist/esm/props/flex.js +0 -25
- package/dist/esm/props/font.js +0 -16
- package/dist/esm/props/grid.js +0 -19
- package/dist/esm/props/index.js +0 -35
- package/dist/esm/props/misc.js +0 -15
- package/dist/esm/props/position.js +0 -31
- package/dist/esm/props/theme.js +0 -134
- package/dist/esm/props/timing.js +0 -26
- package/dist/esm/set.js +0 -9
- package/dist/esm/transform/executors.js +0 -104
- package/dist/esm/transform/index.js +0 -2
- package/dist/esm/transform/transformers.js +0 -87
- package/dist/iife/index.js +0 -1084
- package/src/_transform.js +0 -10
- package/src/emotion.js +0 -9
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
const DEFAULT_CSS_PROPERTIES_LIST = /* @__PURE__ */ new Set([
|
|
2
|
-
"accentColor",
|
|
3
|
-
"alignContent",
|
|
4
|
-
"alignItems",
|
|
5
|
-
"alignSelf",
|
|
6
|
-
"alignmentBaseline",
|
|
7
|
-
"all",
|
|
8
|
-
"animation",
|
|
9
|
-
"animationDelay",
|
|
10
|
-
"animationDirection",
|
|
11
|
-
"animationDuration",
|
|
12
|
-
"animationFillMode",
|
|
13
|
-
"animationIterationCount",
|
|
14
|
-
"animationName",
|
|
15
|
-
"animationPlayState",
|
|
16
|
-
"animationTimingFunction",
|
|
17
|
-
"appearance",
|
|
18
|
-
"aspectRatio",
|
|
19
|
-
"backdropFilter",
|
|
20
|
-
"backfaceVisibility",
|
|
21
|
-
"background",
|
|
22
|
-
"backgroundAttachment",
|
|
23
|
-
"backgroundBlendMode",
|
|
24
|
-
"backgroundClip",
|
|
25
|
-
"backgroundColor",
|
|
26
|
-
"backgroundImage",
|
|
27
|
-
"backgroundOrigin",
|
|
28
|
-
"backgroundPosition",
|
|
29
|
-
"backgroundPositionX",
|
|
30
|
-
"backgroundPositionY",
|
|
31
|
-
"backgroundRepeat",
|
|
32
|
-
"backgroundRepeatX",
|
|
33
|
-
"backgroundRepeatY",
|
|
34
|
-
"backgroundSize",
|
|
35
|
-
"baselineShift",
|
|
36
|
-
"blockSize",
|
|
37
|
-
"border",
|
|
38
|
-
"borderBlock",
|
|
39
|
-
"borderBlockColor",
|
|
40
|
-
"borderBlockEnd",
|
|
41
|
-
"borderBlockEndColor",
|
|
42
|
-
"borderBlockEndStyle",
|
|
43
|
-
"borderBlockEndWidth",
|
|
44
|
-
"borderBlockStart",
|
|
45
|
-
"borderBlockStartColor",
|
|
46
|
-
"borderBlockStartStyle",
|
|
47
|
-
"borderBlockStartWidth",
|
|
48
|
-
"borderBlockStyle",
|
|
49
|
-
"borderBlockWidth",
|
|
50
|
-
"borderBottom",
|
|
51
|
-
"borderBottomColor",
|
|
52
|
-
"borderBottomLeftRadius",
|
|
53
|
-
"borderBottomRightRadius",
|
|
54
|
-
"borderBottomStyle",
|
|
55
|
-
"borderBottomWidth",
|
|
56
|
-
"borderCollapse",
|
|
57
|
-
"borderColor",
|
|
58
|
-
"borderImage",
|
|
59
|
-
"borderImageOutset",
|
|
60
|
-
"borderImageRepeat",
|
|
61
|
-
"borderImageSlice",
|
|
62
|
-
"borderImageSource",
|
|
63
|
-
"borderImageWidth",
|
|
64
|
-
"borderLeft",
|
|
65
|
-
"borderLeftColor",
|
|
66
|
-
"borderLeftStyle",
|
|
67
|
-
"borderLeftWidth",
|
|
68
|
-
"borderRadius",
|
|
69
|
-
"borderRight",
|
|
70
|
-
"borderRightColor",
|
|
71
|
-
"borderRightStyle",
|
|
72
|
-
"borderRightWidth",
|
|
73
|
-
"borderSpacing",
|
|
74
|
-
"borderStyle",
|
|
75
|
-
"borderTop",
|
|
76
|
-
"borderTopColor",
|
|
77
|
-
"borderTopLeftRadius",
|
|
78
|
-
"borderTopRightRadius",
|
|
79
|
-
"borderTopStyle",
|
|
80
|
-
"borderTopWidth",
|
|
81
|
-
"borderWidth",
|
|
82
|
-
"bottom",
|
|
83
|
-
"boxDecorationBreak",
|
|
84
|
-
"boxShadow",
|
|
85
|
-
"boxSizing",
|
|
86
|
-
"breakAfter",
|
|
87
|
-
"breakBefore",
|
|
88
|
-
"breakInside",
|
|
89
|
-
"captionSide",
|
|
90
|
-
"caretColor",
|
|
91
|
-
"clear",
|
|
92
|
-
"clip",
|
|
93
|
-
"clipPath",
|
|
94
|
-
"color",
|
|
95
|
-
"colorAdjust",
|
|
96
|
-
"colorInterpolation",
|
|
97
|
-
"colorInterpolationFilters",
|
|
98
|
-
"colorRendering",
|
|
99
|
-
"columnCount",
|
|
100
|
-
"columnFill",
|
|
101
|
-
"columnGap",
|
|
102
|
-
"columnRule",
|
|
103
|
-
"columnRuleColor",
|
|
104
|
-
"columnRuleStyle",
|
|
105
|
-
"columnRuleWidth",
|
|
106
|
-
"columnSpan",
|
|
107
|
-
"columnWidth",
|
|
108
|
-
"columns",
|
|
109
|
-
"contain",
|
|
110
|
-
"content",
|
|
111
|
-
"counterIncrement",
|
|
112
|
-
"counterReset",
|
|
113
|
-
"cursor",
|
|
114
|
-
"direction",
|
|
115
|
-
"display",
|
|
116
|
-
"emptyCells",
|
|
117
|
-
"filter",
|
|
118
|
-
"flex",
|
|
119
|
-
"flexBasis",
|
|
120
|
-
"flexDirection",
|
|
121
|
-
"flexFlow",
|
|
122
|
-
"flexGrow",
|
|
123
|
-
"flexShrink",
|
|
124
|
-
"flexWrap",
|
|
125
|
-
"float",
|
|
126
|
-
"font",
|
|
127
|
-
"fontFamily",
|
|
128
|
-
"fontFeatureSettings",
|
|
129
|
-
"fontKerning",
|
|
130
|
-
"fontLanguageOverride",
|
|
131
|
-
"fontSize",
|
|
132
|
-
"fontSizeAdjust",
|
|
133
|
-
"fontStretch",
|
|
134
|
-
"fontStyle",
|
|
135
|
-
"fontVariant",
|
|
136
|
-
"fontVariantAlternates",
|
|
137
|
-
"fontVariantCaps",
|
|
138
|
-
"fontVariantEastAsian",
|
|
139
|
-
"fontVariantNumeric",
|
|
140
|
-
"fontVariantPosition",
|
|
141
|
-
"fontWeight",
|
|
142
|
-
"fontVariationSettings",
|
|
143
|
-
"fontSynthesis",
|
|
144
|
-
"forcedColorAdjust",
|
|
145
|
-
"gap",
|
|
146
|
-
"grid",
|
|
147
|
-
"gridArea",
|
|
148
|
-
"gridAutoColumns",
|
|
149
|
-
"gridAutoFlow",
|
|
150
|
-
"gridAutoRows",
|
|
151
|
-
"gridColumn",
|
|
152
|
-
"gridColumnEnd",
|
|
153
|
-
"gridColumnGap",
|
|
154
|
-
"gridColumnStart",
|
|
155
|
-
"gridGap",
|
|
156
|
-
"gridRow",
|
|
157
|
-
"gridRowEnd",
|
|
158
|
-
"gridRowGap",
|
|
159
|
-
"gridRowStart",
|
|
160
|
-
"gridTemplate",
|
|
161
|
-
"gridTemplateAreas",
|
|
162
|
-
"gridTemplateColumns",
|
|
163
|
-
"gridTemplateRows",
|
|
164
|
-
"height",
|
|
165
|
-
"hyphens",
|
|
166
|
-
"imageOrientation",
|
|
167
|
-
"imageRendering",
|
|
168
|
-
"imeMode",
|
|
169
|
-
"inset",
|
|
170
|
-
"insetBlock",
|
|
171
|
-
"insetBlockEnd",
|
|
172
|
-
"insetBlockStart",
|
|
173
|
-
"insetInline",
|
|
174
|
-
"insetInlineEnd",
|
|
175
|
-
"insetInlineStart",
|
|
176
|
-
"initialLetter",
|
|
177
|
-
"isolation",
|
|
178
|
-
"justifyContent",
|
|
179
|
-
"justifyItems",
|
|
180
|
-
"justifySelf",
|
|
181
|
-
"left",
|
|
182
|
-
"letterSpacing",
|
|
183
|
-
"lineBreak",
|
|
184
|
-
"lineClamp",
|
|
185
|
-
"lineHeight",
|
|
186
|
-
"listStyle",
|
|
187
|
-
"listStyleImage",
|
|
188
|
-
"listStylePosition",
|
|
189
|
-
"listStyleType",
|
|
190
|
-
"margin",
|
|
191
|
-
"marginBottom",
|
|
192
|
-
"marginLeft",
|
|
193
|
-
"marginRight",
|
|
194
|
-
"marginTop",
|
|
195
|
-
"marginBlock",
|
|
196
|
-
"marginBlockEnd",
|
|
197
|
-
"marginBlockStart",
|
|
198
|
-
"marginInline",
|
|
199
|
-
"marginInlineEnd",
|
|
200
|
-
"marginInlineStart",
|
|
201
|
-
"mask",
|
|
202
|
-
"maskBorder",
|
|
203
|
-
"maskBorderImage",
|
|
204
|
-
"maskBorderOutset",
|
|
205
|
-
"maskBorderRepeat",
|
|
206
|
-
"maskBorderSlice",
|
|
207
|
-
"maskBorderSource",
|
|
208
|
-
"maskBorderWidth",
|
|
209
|
-
"maskClip",
|
|
210
|
-
"maskComposite",
|
|
211
|
-
"maskImage",
|
|
212
|
-
"maskOrigin",
|
|
213
|
-
"maskPosition",
|
|
214
|
-
"maskRepeat",
|
|
215
|
-
"maskSize",
|
|
216
|
-
"maskType",
|
|
217
|
-
"maxBlockSize",
|
|
218
|
-
"maxHeight",
|
|
219
|
-
"maxInlineSize",
|
|
220
|
-
"maxWidth",
|
|
221
|
-
"minBlockSize",
|
|
222
|
-
"minHeight",
|
|
223
|
-
"minInlineSize",
|
|
224
|
-
"minWidth",
|
|
225
|
-
"mixBlendMode",
|
|
226
|
-
"objectFit",
|
|
227
|
-
"objectPosition",
|
|
228
|
-
"objectViewBox",
|
|
229
|
-
"offset",
|
|
230
|
-
"offsetDistance",
|
|
231
|
-
"offsetPath",
|
|
232
|
-
"offsetRotate",
|
|
233
|
-
"opacity",
|
|
234
|
-
"order",
|
|
235
|
-
"orientation",
|
|
236
|
-
"outline",
|
|
237
|
-
"outlineColor",
|
|
238
|
-
"outlineOffset",
|
|
239
|
-
"outlineStyle",
|
|
240
|
-
"outlineWidth",
|
|
241
|
-
"overflow",
|
|
242
|
-
"overflowAnchor",
|
|
243
|
-
"overflowClip",
|
|
244
|
-
"overflowScrolling",
|
|
245
|
-
"overflowWrap",
|
|
246
|
-
"overflowX",
|
|
247
|
-
"overflowY",
|
|
248
|
-
"padding",
|
|
249
|
-
"paddingBottom",
|
|
250
|
-
"paddingLeft",
|
|
251
|
-
"paddingRight",
|
|
252
|
-
"paddingTop",
|
|
253
|
-
"pageBreakAfter",
|
|
254
|
-
"pageBreakBefore",
|
|
255
|
-
"pageBreakInside",
|
|
256
|
-
"paintOrder",
|
|
257
|
-
"perspective",
|
|
258
|
-
"perspectiveOrigin",
|
|
259
|
-
"placeContent",
|
|
260
|
-
"placeItems",
|
|
261
|
-
"placeSelf",
|
|
262
|
-
"pointerEvents",
|
|
263
|
-
"position",
|
|
264
|
-
"resize",
|
|
265
|
-
"right",
|
|
266
|
-
"rotate",
|
|
267
|
-
"rowGap",
|
|
268
|
-
"scrollBehavior",
|
|
269
|
-
"scrollPadding",
|
|
270
|
-
"scrollSnapAlign",
|
|
271
|
-
"scrollSnapType",
|
|
272
|
-
"scrollbarColor",
|
|
273
|
-
"scrollbarWidth",
|
|
274
|
-
"shapeImageThreshold",
|
|
275
|
-
"shapeMargin",
|
|
276
|
-
"shapeOutside",
|
|
277
|
-
"tabSize",
|
|
278
|
-
"tableLayout",
|
|
279
|
-
"textAlign",
|
|
280
|
-
"textAlignLast",
|
|
281
|
-
"textDecoration",
|
|
282
|
-
"textDecorationColor",
|
|
283
|
-
"textDecorationLine",
|
|
284
|
-
"textDecorationSkipInk",
|
|
285
|
-
"textDecorationStyle",
|
|
286
|
-
"textDecorationThickness",
|
|
287
|
-
"textIndent",
|
|
288
|
-
"textOverflow",
|
|
289
|
-
"textShadow",
|
|
290
|
-
"textTransform",
|
|
291
|
-
"textUnderlineOffset",
|
|
292
|
-
"top",
|
|
293
|
-
"transform",
|
|
294
|
-
"transformOrigin",
|
|
295
|
-
"transformStyle",
|
|
296
|
-
"transition",
|
|
297
|
-
"transitionDelay",
|
|
298
|
-
"transitionDuration",
|
|
299
|
-
"transitionProperty",
|
|
300
|
-
"transitionTimingFunction",
|
|
301
|
-
"translate",
|
|
302
|
-
"translateX",
|
|
303
|
-
"translateY",
|
|
304
|
-
"translateZ",
|
|
305
|
-
"unicodeBidi",
|
|
306
|
-
"userSelect",
|
|
307
|
-
"verticalAlign",
|
|
308
|
-
"visibility",
|
|
309
|
-
"whiteSpace",
|
|
310
|
-
"widows",
|
|
311
|
-
"width",
|
|
312
|
-
"willChange",
|
|
313
|
-
"wordBreak",
|
|
314
|
-
"wordSpacing",
|
|
315
|
-
"wordWrap",
|
|
316
|
-
"writingMode",
|
|
317
|
-
"zIndex"
|
|
318
|
-
]);
|
|
319
|
-
export {
|
|
320
|
-
DEFAULT_CSS_PROPERTIES_LIST
|
|
321
|
-
};
|
package/dist/esm/props/flex.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { isString } from "@domql/utils";
|
|
2
|
-
const FLEX_PROPS = {
|
|
3
|
-
flow: (value, el) => {
|
|
4
|
-
const { props } = el;
|
|
5
|
-
const { reverse } = props;
|
|
6
|
-
if (!isString(value)) return;
|
|
7
|
-
let [direction, wrap] = (value || "row").split(" ");
|
|
8
|
-
if (value.startsWith("x") || value === "row") direction = "row";
|
|
9
|
-
if (value.startsWith("y") || value === "column") direction = "column";
|
|
10
|
-
return {
|
|
11
|
-
display: "flex",
|
|
12
|
-
flexFlow: (direction || "") + (!direction.includes("-reverse") && reverse ? "-reverse" : "") + " " + (wrap || "")
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
wrap: (value, { props }) => {
|
|
16
|
-
return { display: "flex", flexWrap: value };
|
|
17
|
-
},
|
|
18
|
-
align: (value, { props }) => {
|
|
19
|
-
const [alignItems, justifyContent] = value.split(" ");
|
|
20
|
-
return { display: "flex", alignItems, justifyContent };
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
FLEX_PROPS
|
|
25
|
-
};
|
package/dist/esm/props/font.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { getFontSizeByKey, getFontFamily } from "@symbo.ls/scratch";
|
|
2
|
-
const FONT_PROPS = {
|
|
3
|
-
fontSize: (value) => {
|
|
4
|
-
return getFontSizeByKey(value) || value;
|
|
5
|
-
},
|
|
6
|
-
fontFamily: (value) => ({
|
|
7
|
-
fontFamily: getFontFamily(value) || value
|
|
8
|
-
}),
|
|
9
|
-
fontWeight: (value) => ({
|
|
10
|
-
fontWeight: value,
|
|
11
|
-
fontVariationSettings: '"wght" ' + value
|
|
12
|
-
})
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
FONT_PROPS
|
|
16
|
-
};
|
package/dist/esm/props/grid.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const GRID_PROPS = {
|
|
2
|
-
area: (value) => ({ gridArea: value }),
|
|
3
|
-
template: (value) => ({ gridTemplate: value }),
|
|
4
|
-
templateAreas: (value) => ({ gridTemplateAreas: value }),
|
|
5
|
-
column: (value) => ({ gridColumn: value }),
|
|
6
|
-
columns: (value) => ({ gridTemplateColumns: value }),
|
|
7
|
-
templateColumns: (value) => ({ gridTemplateColumns: value }),
|
|
8
|
-
autoColumns: (value) => ({ gridAutoColumns: value }),
|
|
9
|
-
columnStart: (value) => ({ gridColumnStart: value }),
|
|
10
|
-
row: (value) => ({ gridRow: value }),
|
|
11
|
-
rows: (value) => ({ gridTemplateRows: value }),
|
|
12
|
-
templateRows: (value) => ({ gridTemplateRows: value }),
|
|
13
|
-
autoRows: (value) => ({ gridAutoRows: value }),
|
|
14
|
-
rowStart: (value) => ({ gridRowStart: value }),
|
|
15
|
-
autoFlow: (value) => ({ gridAutoFlow: value })
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
GRID_PROPS
|
|
19
|
-
};
|
package/dist/esm/props/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ANIMATION_PROPS } from "./animation";
|
|
2
|
-
import { BLOCK_PROPS } from "./block";
|
|
3
|
-
import { FONT_PROPS } from "./font";
|
|
4
|
-
import { MISC_PROPS } from "./misc";
|
|
5
|
-
import { POSITION_PROPS } from "./position";
|
|
6
|
-
import { THEME_PROPS } from "./theme";
|
|
7
|
-
import { TIMING_PROPS } from "./timing";
|
|
8
|
-
import { FLEX_PROPS } from "./flex";
|
|
9
|
-
import { GRID_PROPS } from "./grid";
|
|
10
|
-
export * from "./animation";
|
|
11
|
-
export * from "./block";
|
|
12
|
-
export * from "./font";
|
|
13
|
-
export * from "./misc";
|
|
14
|
-
export * from "./position";
|
|
15
|
-
export * from "./theme";
|
|
16
|
-
export * from "./timing";
|
|
17
|
-
export * from "./flex";
|
|
18
|
-
export * from "./grid";
|
|
19
|
-
const CSS_PROPS_REGISTRY = {
|
|
20
|
-
...ANIMATION_PROPS,
|
|
21
|
-
...BLOCK_PROPS,
|
|
22
|
-
...FONT_PROPS,
|
|
23
|
-
...MISC_PROPS,
|
|
24
|
-
...MISC_PROPS,
|
|
25
|
-
...POSITION_PROPS,
|
|
26
|
-
...THEME_PROPS,
|
|
27
|
-
...TIMING_PROPS,
|
|
28
|
-
...FLEX_PROPS,
|
|
29
|
-
...GRID_PROPS
|
|
30
|
-
};
|
|
31
|
-
var props_default = CSS_PROPS_REGISTRY;
|
|
32
|
-
export {
|
|
33
|
-
CSS_PROPS_REGISTRY,
|
|
34
|
-
props_default as default
|
|
35
|
-
};
|
package/dist/esm/props/misc.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const MISC_PROPS = {
|
|
2
|
-
overflow: (value) => ({
|
|
3
|
-
overflow: value,
|
|
4
|
-
scrollBehavior: "smooth"
|
|
5
|
-
}),
|
|
6
|
-
cursor: (value, el, s, ctx) => {
|
|
7
|
-
if (!value) return;
|
|
8
|
-
const file = ctx.files && ctx.files[value];
|
|
9
|
-
if (file && file.content) value = `url(${file.content.src})`;
|
|
10
|
-
return { cursor: value };
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
MISC_PROPS
|
|
15
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { getSpacingByKey } from "@symbo.ls/scratch";
|
|
2
|
-
const POSITION_PROPS = {
|
|
3
|
-
inset: (val, el) => {
|
|
4
|
-
if (el.call("isNumber", val)) return { inset: val };
|
|
5
|
-
if (!el.call("isString", val)) return;
|
|
6
|
-
return { inset: val.split(" ").map((v) => getSpacingByKey(v, "k").k).join(" ") };
|
|
7
|
-
},
|
|
8
|
-
left: (val) => getSpacingByKey(val, "left"),
|
|
9
|
-
top: (val) => getSpacingByKey(val, "top"),
|
|
10
|
-
right: (val) => getSpacingByKey(val, "right"),
|
|
11
|
-
bottom: (val) => getSpacingByKey(val, "bottom"),
|
|
12
|
-
verticalInset: (val) => {
|
|
13
|
-
if (typeof val !== "string") return;
|
|
14
|
-
const vi = val.split(" ").map((v) => getSpacingByKey(v, "k").k);
|
|
15
|
-
return {
|
|
16
|
-
top: vi[0],
|
|
17
|
-
bottom: vi[1] || vi[0]
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
horizontalInset: (val) => {
|
|
21
|
-
if (typeof val !== "string") return;
|
|
22
|
-
const vi = val.split(" ").map((v) => getSpacingByKey(v, "k").k);
|
|
23
|
-
return {
|
|
24
|
-
left: vi[0],
|
|
25
|
-
right: vi[1] || vi[0]
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
POSITION_PROPS
|
|
31
|
-
};
|
package/dist/esm/props/theme.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getMediaTheme,
|
|
3
|
-
getMediaColor,
|
|
4
|
-
transformTextStroke,
|
|
5
|
-
transformShadow,
|
|
6
|
-
transformBoxShadow,
|
|
7
|
-
transformBorder,
|
|
8
|
-
transformBackgroundImage,
|
|
9
|
-
resolveColorsInGradient,
|
|
10
|
-
transformSizeRatio
|
|
11
|
-
} from "@symbo.ls/scratch";
|
|
12
|
-
import { isDefined, isString } from "@domql/utils";
|
|
13
|
-
const getSystemGlobalTheme = ({ context, state }) => {
|
|
14
|
-
const theme = state?.root?.globalTheme || context.designSystem?.globalTheme;
|
|
15
|
-
return theme === "auto" ? null : theme;
|
|
16
|
-
};
|
|
17
|
-
const THEME_PROPS = {
|
|
18
|
-
theme: (val, element) => {
|
|
19
|
-
const { props } = element;
|
|
20
|
-
if (!val) return;
|
|
21
|
-
if (props.themeModifier) {
|
|
22
|
-
return getMediaTheme(val, `@${props.themeModifier}`);
|
|
23
|
-
}
|
|
24
|
-
return getMediaTheme(val);
|
|
25
|
-
},
|
|
26
|
-
color: (val, element) => {
|
|
27
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
28
|
-
if (!val) return;
|
|
29
|
-
return {
|
|
30
|
-
color: getMediaColor(val, globalTheme)
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
background: (val, element) => {
|
|
34
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
35
|
-
if (!val) return;
|
|
36
|
-
if (isString(val) && val.includes("gradient")) {
|
|
37
|
-
return { background: resolveColorsInGradient(val, globalTheme) };
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
background: getMediaColor(val, globalTheme)
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
backgroundColor: (val, element) => {
|
|
44
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
45
|
-
if (!val) return;
|
|
46
|
-
return {
|
|
47
|
-
backgroundColor: getMediaColor(val, globalTheme)
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
backgroundImage: (val, element, s, ctx) => {
|
|
51
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
52
|
-
if (!val) return;
|
|
53
|
-
const file = ctx.files && ctx.files[val];
|
|
54
|
-
if (file && file.content) val = file.content.src;
|
|
55
|
-
return {
|
|
56
|
-
backgroundImage: transformBackgroundImage(val, globalTheme)
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
|
-
textStroke: (val) => ({
|
|
60
|
-
WebkitTextStroke: transformTextStroke(val)
|
|
61
|
-
}),
|
|
62
|
-
outline: (val) => ({
|
|
63
|
-
outline: transformBorder(val)
|
|
64
|
-
}),
|
|
65
|
-
outlineOffset: (val, { props }) => transformSizeRatio("outlineOffset", val, props),
|
|
66
|
-
border: (val) => ({
|
|
67
|
-
border: transformBorder(val)
|
|
68
|
-
}),
|
|
69
|
-
borderColor: (val, element) => {
|
|
70
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
71
|
-
if (!val) return;
|
|
72
|
-
return {
|
|
73
|
-
borderColor: getMediaColor(val, globalTheme)
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
borderTopColor: (val, element) => {
|
|
77
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
78
|
-
if (!val) return;
|
|
79
|
-
return { borderTopColor: getMediaColor(val, globalTheme) };
|
|
80
|
-
},
|
|
81
|
-
borderBottomColor: (val, element) => {
|
|
82
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
83
|
-
if (!val) return;
|
|
84
|
-
return { borderBottomColor: getMediaColor(val, globalTheme) };
|
|
85
|
-
},
|
|
86
|
-
borderLeftColor: (val, element) => {
|
|
87
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
88
|
-
if (!val) return;
|
|
89
|
-
return { borderLeftColor: getMediaColor(val, globalTheme) };
|
|
90
|
-
},
|
|
91
|
-
borderRightColor: (val, element) => {
|
|
92
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
93
|
-
if (!val) return;
|
|
94
|
-
return { borderRightColor: getMediaColor(val, globalTheme) };
|
|
95
|
-
},
|
|
96
|
-
borderLeft: (val) => ({
|
|
97
|
-
borderLeft: transformBorder(val)
|
|
98
|
-
}),
|
|
99
|
-
borderTop: (val) => ({
|
|
100
|
-
borderTop: transformBorder(val)
|
|
101
|
-
}),
|
|
102
|
-
borderRight: (val) => ({
|
|
103
|
-
borderRight: transformBorder(val)
|
|
104
|
-
}),
|
|
105
|
-
borderBottom: (val) => ({
|
|
106
|
-
borderBottom: transformBorder(val)
|
|
107
|
-
}),
|
|
108
|
-
shadow: (val, element) => {
|
|
109
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
110
|
-
if (!val) return;
|
|
111
|
-
return {
|
|
112
|
-
boxShadow: transformShadow(val, globalTheme)
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
|
-
boxShadow: (val, element) => {
|
|
116
|
-
if (!isString(val)) return;
|
|
117
|
-
const [value, hasImportant] = val.split("!importan");
|
|
118
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
119
|
-
const important = hasImportant ? " !important" : "";
|
|
120
|
-
return {
|
|
121
|
-
boxShadow: transformBoxShadow(value.trim(), globalTheme) + important
|
|
122
|
-
};
|
|
123
|
-
},
|
|
124
|
-
textShadow: (val, { context }) => ({
|
|
125
|
-
textShadow: transformBoxShadow(val, context.designSystem.globalTheme)
|
|
126
|
-
}),
|
|
127
|
-
columnRule: (val) => ({
|
|
128
|
-
columnRule: transformBorder(val)
|
|
129
|
-
})
|
|
130
|
-
};
|
|
131
|
-
export {
|
|
132
|
-
THEME_PROPS,
|
|
133
|
-
getSystemGlobalTheme
|
|
134
|
-
};
|
package/dist/esm/props/timing.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getTimingFunction,
|
|
3
|
-
splitTransition,
|
|
4
|
-
transformDuration
|
|
5
|
-
} from "@symbo.ls/scratch";
|
|
6
|
-
const TIMING_PROPS = {
|
|
7
|
-
transition: (val) => ({
|
|
8
|
-
transition: splitTransition(val)
|
|
9
|
-
}),
|
|
10
|
-
transitionDuration: (val) => ({
|
|
11
|
-
transitionDuration: transformDuration(val)
|
|
12
|
-
}),
|
|
13
|
-
transitionDelay: (val) => ({
|
|
14
|
-
transitionDelay: transformDuration(val)
|
|
15
|
-
}),
|
|
16
|
-
transitionTimingFunction: (val) => ({
|
|
17
|
-
transitionTimingFunction: getTimingFunction(val)
|
|
18
|
-
}),
|
|
19
|
-
transitionProperty: (val) => ({
|
|
20
|
-
transitionProperty: val,
|
|
21
|
-
willChange: val
|
|
22
|
-
})
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
TIMING_PROPS
|
|
26
|
-
};
|
package/dist/esm/set.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { transformClassname } from "./_transform";
|
|
2
|
-
import { transformEmotion } from "./emotion";
|
|
3
|
-
const setClassname = (props, emotionCss) => {
|
|
4
|
-
const transform = transformClassname(props);
|
|
5
|
-
return transformEmotion(transform, emotionCss);
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
setClassname
|
|
9
|
-
};
|