@arbor-css/core 0.0.141 → 0.0.143
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/cli/run.js +1 -1
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/validate.d.ts +2 -14
- package/dist/cli/validate.d.ts.map +1 -1
- package/dist/cli/validate.js +13 -201
- package/dist/cli/validate.js.map +1 -1
- package/dist/cli/validate.test.js +20 -3
- package/dist/cli/validate.test.js.map +1 -1
- package/dist/getStructuredTokensMap.test.js +3 -3
- package/dist/getStructuredTokensMap.test.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/presets/arborPreset/preset.d.ts +184 -46
- package/dist/presets/arborPreset/preset.d.ts.map +1 -1
- package/dist/presets/arborPreset/preset.test.js +1 -1
- package/dist/presets/arborPreset/preset.test.js.map +1 -1
- package/dist/presets/basicPreset/mixins.d.ts +140 -35
- package/dist/presets/basicPreset/mixins.d.ts.map +1 -1
- package/dist/presets/basicPreset/preset.d.ts +120 -30
- package/dist/presets/basicPreset/preset.d.ts.map +1 -1
- package/dist/presets/v2/index.d.ts +3 -0
- package/dist/presets/v2/index.d.ts.map +1 -0
- package/dist/presets/v2/index.js +3 -0
- package/dist/presets/v2/index.js.map +1 -0
- package/dist/presets/v2/preset.d.ts +2680 -0
- package/dist/presets/v2/preset.d.ts.map +1 -0
- package/dist/presets/v2/preset.js +403 -0
- package/dist/presets/v2/preset.js.map +1 -0
- package/dist/presets/v2/preset.test.d.ts +2 -0
- package/dist/presets/v2/preset.test.d.ts.map +1 -0
- package/dist/presets/v2/preset.test.js +118 -0
- package/dist/presets/v2/preset.test.js.map +1 -0
- package/dist/presets/v2/schema/global.d.ts +159 -0
- package/dist/presets/v2/schema/global.d.ts.map +1 -0
- package/dist/presets/v2/schema/global.js +158 -0
- package/dist/presets/v2/schema/global.js.map +1 -0
- package/dist/presets/v2/schema/intents.d.ts +41 -0
- package/dist/presets/v2/schema/intents.d.ts.map +1 -0
- package/dist/presets/v2/schema/intents.js +42 -0
- package/dist/presets/v2/schema/intents.js.map +1 -0
- package/dist/presets/v2/schema/schema.d.ts +745 -0
- package/dist/presets/v2/schema/schema.d.ts.map +1 -0
- package/dist/presets/v2/schema/schema.js +155 -0
- package/dist/presets/v2/schema/schema.js.map +1 -0
- package/dist/presets/v2/schema/semantics.d.ts +195 -0
- package/dist/presets/v2/schema/semantics.d.ts.map +1 -0
- package/dist/presets/v2/schema/semantics.js +73 -0
- package/dist/presets/v2/schema/semantics.js.map +1 -0
- package/dist/presets/v2/values/color/color.d.ts +25 -0
- package/dist/presets/v2/values/color/color.d.ts.map +1 -0
- package/dist/presets/v2/values/color/color.js +16 -0
- package/dist/presets/v2/values/color/color.js.map +1 -0
- package/dist/presets/v2/values/color/compile.d.ts +50 -0
- package/dist/presets/v2/values/color/compile.d.ts.map +1 -0
- package/dist/presets/v2/values/color/compile.js +77 -0
- package/dist/presets/v2/values/color/compile.js.map +1 -0
- package/dist/presets/v2/values/color/compile.test.d.ts +2 -0
- package/dist/presets/v2/values/color/compile.test.d.ts.map +1 -0
- package/dist/presets/v2/values/color/compile.test.js +195 -0
- package/dist/presets/v2/values/color/compile.test.js.map +1 -0
- package/dist/presets/v2/values/color/index.d.ts +5 -0
- package/dist/presets/v2/values/color/index.d.ts.map +1 -0
- package/dist/presets/v2/values/color/index.js +5 -0
- package/dist/presets/v2/values/color/index.js.map +1 -0
- package/dist/presets/v2/values/color/ranges.d.ts +75 -0
- package/dist/presets/v2/values/color/ranges.d.ts.map +1 -0
- package/dist/presets/v2/values/color/ranges.js +128 -0
- package/dist/presets/v2/values/color/ranges.js.map +1 -0
- package/dist/presets/v2/values/color/schemes.d.ts +16 -0
- package/dist/presets/v2/values/color/schemes.d.ts.map +1 -0
- package/dist/presets/v2/values/color/schemes.js +15 -0
- package/dist/presets/v2/values/color/schemes.js.map +1 -0
- package/dist/presets/v2/values/intents.d.ts +819 -0
- package/dist/presets/v2/values/intents.d.ts.map +1 -0
- package/dist/presets/v2/values/intents.js +318 -0
- package/dist/presets/v2/values/intents.js.map +1 -0
- package/dist/presets/v2/values/semantics.d.ts +731 -0
- package/dist/presets/v2/values/semantics.d.ts.map +1 -0
- package/dist/presets/v2/values/semantics.js +181 -0
- package/dist/presets/v2/values/semantics.js.map +1 -0
- package/dist/presets/v2/values/shadow/index.d.ts +21 -0
- package/dist/presets/v2/values/shadow/index.d.ts.map +1 -0
- package/dist/presets/v2/values/shadow/index.js +62 -0
- package/dist/presets/v2/values/shadow/index.js.map +1 -0
- package/dist/presets/v2/values/spacing/index.d.ts +20 -0
- package/dist/presets/v2/values/spacing/index.d.ts.map +1 -0
- package/dist/presets/v2/values/spacing/index.js +42 -0
- package/dist/presets/v2/values/spacing/index.js.map +1 -0
- package/dist/presets/v2/values/types.d.ts +7 -0
- package/dist/presets/v2/values/types.d.ts.map +1 -0
- package/dist/presets/v2/values/types.js +2 -0
- package/dist/presets/v2/values/types.js.map +1 -0
- package/dist/presets/v2/values/typography/index.d.ts +25 -0
- package/dist/presets/v2/values/typography/index.d.ts.map +1 -0
- package/dist/presets/v2/values/typography/index.js +46 -0
- package/dist/presets/v2/values/typography/index.js.map +1 -0
- package/dist/util/tokenRegex.d.ts +6 -0
- package/dist/util/tokenRegex.d.ts.map +1 -0
- package/dist/util/tokenRegex.js +14 -0
- package/dist/util/tokenRegex.js.map +1 -0
- package/dist/util/tokenValidation.d.ts +29 -0
- package/dist/util/tokenValidation.d.ts.map +1 -0
- package/dist/util/tokenValidation.js +328 -0
- package/dist/util/tokenValidation.js.map +1 -0
- package/dist/util/tokenValidation.test.d.ts +2 -0
- package/dist/util/tokenValidation.test.d.ts.map +1 -0
- package/dist/util/tokenValidation.test.js +87 -0
- package/dist/util/tokenValidation.test.js.map +1 -0
- package/package.json +14 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.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,UAAU,CAAC,UAAU,CAAC,CAC7B,CAAC"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { createModeSchema } from '@arbor-css/modes';
|
|
2
|
+
import { global } from './global.js';
|
|
3
|
+
import { boxIntents, textAndFontIntents, visualIntents } from './intents.js';
|
|
4
|
+
import { colorRangeSemantic, colorsSemantics, shadowSemantic, } from './semantics.js';
|
|
5
|
+
export const modeSchema = (config) => createModeSchema({
|
|
6
|
+
global,
|
|
7
|
+
/* Color */
|
|
8
|
+
tint: colorRangeSemantic,
|
|
9
|
+
gray: colorRangeSemantic,
|
|
10
|
+
color: colorsSemantics(config.colorNames),
|
|
11
|
+
/* Shape */
|
|
12
|
+
sp: {
|
|
13
|
+
$root: 'spacing',
|
|
14
|
+
xs: 'spacing',
|
|
15
|
+
sm: 'spacing',
|
|
16
|
+
md: 'spacing',
|
|
17
|
+
lg: 'spacing',
|
|
18
|
+
xl: 'spacing',
|
|
19
|
+
},
|
|
20
|
+
rd: {
|
|
21
|
+
$root: 'border-radius',
|
|
22
|
+
xs: 'border-radius',
|
|
23
|
+
sm: 'border-radius',
|
|
24
|
+
md: 'border-radius',
|
|
25
|
+
lg: 'border-radius',
|
|
26
|
+
xl: 'border-radius',
|
|
27
|
+
full: 'border-radius',
|
|
28
|
+
},
|
|
29
|
+
lw: {
|
|
30
|
+
$root: 'border-width',
|
|
31
|
+
sm: 'border-width',
|
|
32
|
+
md: 'border-width',
|
|
33
|
+
lg: 'border-width',
|
|
34
|
+
},
|
|
35
|
+
/* Shadow */
|
|
36
|
+
shadow: {
|
|
37
|
+
$root: 'shadow',
|
|
38
|
+
none: shadowSemantic,
|
|
39
|
+
sm: shadowSemantic,
|
|
40
|
+
md: shadowSemantic,
|
|
41
|
+
lg: shadowSemantic,
|
|
42
|
+
xl: shadowSemantic,
|
|
43
|
+
},
|
|
44
|
+
/* Text */
|
|
45
|
+
fs: {
|
|
46
|
+
$root: 'font-size',
|
|
47
|
+
sm: 'font-size',
|
|
48
|
+
md: 'font-size',
|
|
49
|
+
lg: 'font-size',
|
|
50
|
+
},
|
|
51
|
+
fw: {
|
|
52
|
+
$root: 'font-weight',
|
|
53
|
+
normal: 'font-weight',
|
|
54
|
+
bold: 'font-weight',
|
|
55
|
+
},
|
|
56
|
+
lh: {
|
|
57
|
+
$root: 'line-height',
|
|
58
|
+
tight: 'line-height',
|
|
59
|
+
normal: 'line-height',
|
|
60
|
+
loose: 'line-height',
|
|
61
|
+
},
|
|
62
|
+
ls: {
|
|
63
|
+
$root: 'letter-spacing',
|
|
64
|
+
tight: 'letter-spacing',
|
|
65
|
+
normal: 'letter-spacing',
|
|
66
|
+
loose: 'letter-spacing',
|
|
67
|
+
},
|
|
68
|
+
/* Animation */
|
|
69
|
+
dur: {
|
|
70
|
+
$root: 'duration',
|
|
71
|
+
short: 'duration',
|
|
72
|
+
medium: 'duration',
|
|
73
|
+
long: 'duration',
|
|
74
|
+
},
|
|
75
|
+
ease: {
|
|
76
|
+
$root: 'easing-function',
|
|
77
|
+
tight: 'easing-function',
|
|
78
|
+
medium: 'easing-function',
|
|
79
|
+
loose: 'easing-function',
|
|
80
|
+
in: {
|
|
81
|
+
$root: 'easing-function',
|
|
82
|
+
tight: 'easing-function',
|
|
83
|
+
medium: 'easing-function',
|
|
84
|
+
loose: 'easing-function',
|
|
85
|
+
},
|
|
86
|
+
out: {
|
|
87
|
+
$root: 'easing-function',
|
|
88
|
+
tight: 'easing-function',
|
|
89
|
+
medium: 'easing-function',
|
|
90
|
+
loose: 'easing-function',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
/* Intents */
|
|
94
|
+
fg: {
|
|
95
|
+
$root: 'color',
|
|
96
|
+
light: 'color',
|
|
97
|
+
ink: 'color',
|
|
98
|
+
gray: {
|
|
99
|
+
$root: 'color',
|
|
100
|
+
light: 'color',
|
|
101
|
+
ink: 'color',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
bg: {
|
|
105
|
+
$root: 'color',
|
|
106
|
+
paper: 'color',
|
|
107
|
+
wash: 'color',
|
|
108
|
+
light: 'color',
|
|
109
|
+
bold: 'color',
|
|
110
|
+
gray: {
|
|
111
|
+
$root: 'color',
|
|
112
|
+
paper: 'color',
|
|
113
|
+
wash: 'color',
|
|
114
|
+
light: 'color',
|
|
115
|
+
bold: 'color',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
action: {
|
|
119
|
+
p: boxIntents,
|
|
120
|
+
rd: 'border-radius',
|
|
121
|
+
text: textAndFontIntents,
|
|
122
|
+
primary: visualIntents,
|
|
123
|
+
secondary: visualIntents,
|
|
124
|
+
ambient: visualIntents,
|
|
125
|
+
config: {
|
|
126
|
+
roundness: 'scalar',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
surface: {
|
|
130
|
+
p: boxIntents,
|
|
131
|
+
rd: 'border-radius',
|
|
132
|
+
text: textAndFontIntents,
|
|
133
|
+
primary: visualIntents,
|
|
134
|
+
secondary: visualIntents,
|
|
135
|
+
ambient: visualIntents,
|
|
136
|
+
config: {
|
|
137
|
+
roundness: 'scalar',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
control: {
|
|
141
|
+
p: boxIntents,
|
|
142
|
+
rd: 'border-radius',
|
|
143
|
+
text: textAndFontIntents,
|
|
144
|
+
...visualIntents,
|
|
145
|
+
config: {
|
|
146
|
+
roundness: 'scalar',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
prose: {
|
|
150
|
+
primary: textAndFontIntents,
|
|
151
|
+
secondary: textAndFontIntents,
|
|
152
|
+
ambient: textAndFontIntents,
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/presets/v2/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OA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AAE,OAAO;YACd,IAAI,EAAE,OAAO;SACb;KACD;IAED,MAAM,EAAE;QACP,CAAC,EAAE,UAAU;QACb,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,aAAa;QACxB,OAAO,EAAE,aAAa;QAEtB,MAAM,EAAE;YACP,SAAS,EAAE,QAAQ;SACnB;KACD;IACD,OAAO,EAAE;QACR,CAAC,EAAE,UAAU;QACb,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,aAAa;QACxB,OAAO,EAAE,aAAa;QAEtB,MAAM,EAAE;YACP,SAAS,EAAE,QAAQ;SACnB;KACD;IACD,OAAO,EAAE;QACR,CAAC,EAAE,UAAU;QACb,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,kBAAkB;QACxB,GAAG,aAAa;QAEhB,MAAM,EAAE;YACP,SAAS,EAAE,QAAQ;SACnB;KACD;IACD,KAAK,EAAE;QACN,OAAO,EAAE,kBAAkB;QAC3B,SAAS,EAAE,kBAAkB;QAC7B,OAAO,EAAE,kBAAkB;KAC3B;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
export declare const shadowSemantic: {
|
|
2
|
+
$root: {
|
|
3
|
+
purpose: "shadow";
|
|
4
|
+
description: string;
|
|
5
|
+
};
|
|
6
|
+
x: {
|
|
7
|
+
purpose: "shadow-x";
|
|
8
|
+
description: "Horizontal offset of the shadow";
|
|
9
|
+
};
|
|
10
|
+
y: {
|
|
11
|
+
purpose: "shadow-y";
|
|
12
|
+
description: "Vertical offset of the shadow";
|
|
13
|
+
};
|
|
14
|
+
blur: {
|
|
15
|
+
purpose: "shadow-blur";
|
|
16
|
+
description: "Blur radius of the shadow";
|
|
17
|
+
};
|
|
18
|
+
spread: {
|
|
19
|
+
purpose: "shadow-spread";
|
|
20
|
+
description: "Spread radius of the shadow";
|
|
21
|
+
};
|
|
22
|
+
color: {
|
|
23
|
+
purpose: "shadow-color";
|
|
24
|
+
description: "Color of the shadow";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const colorRangeSemantic: {
|
|
28
|
+
$root: {
|
|
29
|
+
purpose: "color";
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
paper: {
|
|
33
|
+
purpose: "color";
|
|
34
|
+
description: "The lightest color in the range";
|
|
35
|
+
};
|
|
36
|
+
wash: {
|
|
37
|
+
purpose: "color";
|
|
38
|
+
description: "A light color in the range, lighter than the base color";
|
|
39
|
+
};
|
|
40
|
+
light: {
|
|
41
|
+
purpose: "color";
|
|
42
|
+
description: "A light color in the range, lighter than the base color";
|
|
43
|
+
};
|
|
44
|
+
mid: {
|
|
45
|
+
purpose: "color";
|
|
46
|
+
description: "A mid-tone color in the range, similar to the base color";
|
|
47
|
+
};
|
|
48
|
+
heavy: {
|
|
49
|
+
purpose: "color";
|
|
50
|
+
description: "A dark color in the range, darker than the base color";
|
|
51
|
+
};
|
|
52
|
+
ink: {
|
|
53
|
+
purpose: "color";
|
|
54
|
+
description: "The darkest color in the range, usually used for text and other high-contrast elements";
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export declare const colorRangeWithGraySemantic: {
|
|
58
|
+
gray: {
|
|
59
|
+
$root: {
|
|
60
|
+
purpose: "color";
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
paper: {
|
|
64
|
+
purpose: "color";
|
|
65
|
+
description: "The lightest color in the range";
|
|
66
|
+
};
|
|
67
|
+
wash: {
|
|
68
|
+
purpose: "color";
|
|
69
|
+
description: "A light color in the range, lighter than the base color";
|
|
70
|
+
};
|
|
71
|
+
light: {
|
|
72
|
+
purpose: "color";
|
|
73
|
+
description: "A light color in the range, lighter than the base color";
|
|
74
|
+
};
|
|
75
|
+
mid: {
|
|
76
|
+
purpose: "color";
|
|
77
|
+
description: "A mid-tone color in the range, similar to the base color";
|
|
78
|
+
};
|
|
79
|
+
heavy: {
|
|
80
|
+
purpose: "color";
|
|
81
|
+
description: "A dark color in the range, darker than the base color";
|
|
82
|
+
};
|
|
83
|
+
ink: {
|
|
84
|
+
purpose: "color";
|
|
85
|
+
description: "The darkest color in the range, usually used for text and other high-contrast elements";
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
$root: {
|
|
89
|
+
purpose: "color";
|
|
90
|
+
description: string;
|
|
91
|
+
};
|
|
92
|
+
paper: {
|
|
93
|
+
purpose: "color";
|
|
94
|
+
description: "The lightest color in the range";
|
|
95
|
+
};
|
|
96
|
+
wash: {
|
|
97
|
+
purpose: "color";
|
|
98
|
+
description: "A light color in the range, lighter than the base color";
|
|
99
|
+
};
|
|
100
|
+
light: {
|
|
101
|
+
purpose: "color";
|
|
102
|
+
description: "A light color in the range, lighter than the base color";
|
|
103
|
+
};
|
|
104
|
+
mid: {
|
|
105
|
+
purpose: "color";
|
|
106
|
+
description: "A mid-tone color in the range, similar to the base color";
|
|
107
|
+
};
|
|
108
|
+
heavy: {
|
|
109
|
+
purpose: "color";
|
|
110
|
+
description: "A dark color in the range, darker than the base color";
|
|
111
|
+
};
|
|
112
|
+
ink: {
|
|
113
|
+
purpose: "color";
|
|
114
|
+
description: "The darkest color in the range, usually used for text and other high-contrast elements";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
export declare const colorsSemantics: <TColorName extends string>(colorNames: TColorName[]) => Record<TColorName, {
|
|
118
|
+
gray: {
|
|
119
|
+
$root: {
|
|
120
|
+
purpose: "color";
|
|
121
|
+
description: string;
|
|
122
|
+
};
|
|
123
|
+
paper: {
|
|
124
|
+
purpose: "color";
|
|
125
|
+
description: "The lightest color in the range";
|
|
126
|
+
};
|
|
127
|
+
wash: {
|
|
128
|
+
purpose: "color";
|
|
129
|
+
description: "A light color in the range, lighter than the base color";
|
|
130
|
+
};
|
|
131
|
+
light: {
|
|
132
|
+
purpose: "color";
|
|
133
|
+
description: "A light color in the range, lighter than the base color";
|
|
134
|
+
};
|
|
135
|
+
mid: {
|
|
136
|
+
purpose: "color";
|
|
137
|
+
description: "A mid-tone color in the range, similar to the base color";
|
|
138
|
+
};
|
|
139
|
+
heavy: {
|
|
140
|
+
purpose: "color";
|
|
141
|
+
description: "A dark color in the range, darker than the base color";
|
|
142
|
+
};
|
|
143
|
+
ink: {
|
|
144
|
+
purpose: "color";
|
|
145
|
+
description: "The darkest color in the range, usually used for text and other high-contrast elements";
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
$root: {
|
|
149
|
+
purpose: "color";
|
|
150
|
+
description: string;
|
|
151
|
+
};
|
|
152
|
+
paper: {
|
|
153
|
+
purpose: "color";
|
|
154
|
+
description: "The lightest color in the range";
|
|
155
|
+
};
|
|
156
|
+
wash: {
|
|
157
|
+
purpose: "color";
|
|
158
|
+
description: "A light color in the range, lighter than the base color";
|
|
159
|
+
};
|
|
160
|
+
light: {
|
|
161
|
+
purpose: "color";
|
|
162
|
+
description: "A light color in the range, lighter than the base color";
|
|
163
|
+
};
|
|
164
|
+
mid: {
|
|
165
|
+
purpose: "color";
|
|
166
|
+
description: "A mid-tone color in the range, similar to the base color";
|
|
167
|
+
};
|
|
168
|
+
heavy: {
|
|
169
|
+
purpose: "color";
|
|
170
|
+
description: "A dark color in the range, darker than the base color";
|
|
171
|
+
};
|
|
172
|
+
ink: {
|
|
173
|
+
purpose: "color";
|
|
174
|
+
description: "The darkest color in the range, usually used for text and other high-contrast elements";
|
|
175
|
+
};
|
|
176
|
+
}>;
|
|
177
|
+
export interface ModeColorRangeSchema {
|
|
178
|
+
$root: 'color';
|
|
179
|
+
paper: 'color';
|
|
180
|
+
wash: 'color';
|
|
181
|
+
light: 'color';
|
|
182
|
+
mid: 'color';
|
|
183
|
+
heavy: 'color';
|
|
184
|
+
ink: 'color';
|
|
185
|
+
gray: {
|
|
186
|
+
$root: 'color';
|
|
187
|
+
paper: 'color';
|
|
188
|
+
wash: 'color';
|
|
189
|
+
light: 'color';
|
|
190
|
+
mid: 'color';
|
|
191
|
+
heavy: 'color';
|
|
192
|
+
ink: 'color';
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=semantics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantics.d.ts","sourceRoot":"","sources":["../../../../src/presets/v2/schema/semantics.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;CAyBzB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8B7B,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGtC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,UAAU,SAAS,MAAM,EACxD,YAAY,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKxB,CAAC;AAcF,MAAM,WAAW,oBAAoB;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IAEb,IAAI,EAAE;QACL,KAAK,EAAE,OAAO,CAAC;QACf,KAAK,EAAE,OAAO,CAAC;QACf,IAAI,EAAE,OAAO,CAAC;QACd,KAAK,EAAE,OAAO,CAAC;QACf,GAAG,EAAE,OAAO,CAAC;QACb,KAAK,EAAE,OAAO,CAAC;QACf,GAAG,EAAE,OAAO,CAAC;KACb,CAAC;CACF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { createModeSchema } from '@arbor-css/modes';
|
|
2
|
+
export const shadowSemantic = createModeSchema({
|
|
3
|
+
$root: {
|
|
4
|
+
purpose: 'shadow',
|
|
5
|
+
description: 'Full shadow value, can be passed to "box-shadow"',
|
|
6
|
+
},
|
|
7
|
+
x: {
|
|
8
|
+
purpose: 'shadow-x',
|
|
9
|
+
description: 'Horizontal offset of the shadow',
|
|
10
|
+
},
|
|
11
|
+
y: {
|
|
12
|
+
purpose: 'shadow-y',
|
|
13
|
+
description: 'Vertical offset of the shadow',
|
|
14
|
+
},
|
|
15
|
+
blur: {
|
|
16
|
+
purpose: 'shadow-blur',
|
|
17
|
+
description: 'Blur radius of the shadow',
|
|
18
|
+
},
|
|
19
|
+
spread: {
|
|
20
|
+
purpose: 'shadow-spread',
|
|
21
|
+
description: 'Spread radius of the shadow',
|
|
22
|
+
},
|
|
23
|
+
color: {
|
|
24
|
+
purpose: 'shadow-color',
|
|
25
|
+
description: 'Color of the shadow',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
export const colorRangeSemantic = createModeSchema({
|
|
29
|
+
$root: {
|
|
30
|
+
purpose: 'color',
|
|
31
|
+
description: 'The base color of the range',
|
|
32
|
+
},
|
|
33
|
+
paper: {
|
|
34
|
+
purpose: 'color',
|
|
35
|
+
description: 'The lightest color in the range',
|
|
36
|
+
},
|
|
37
|
+
wash: {
|
|
38
|
+
purpose: 'color',
|
|
39
|
+
description: 'A light color in the range, lighter than the base color',
|
|
40
|
+
},
|
|
41
|
+
light: {
|
|
42
|
+
purpose: 'color',
|
|
43
|
+
description: 'A light color in the range, lighter than the base color',
|
|
44
|
+
},
|
|
45
|
+
mid: {
|
|
46
|
+
purpose: 'color',
|
|
47
|
+
description: 'A mid-tone color in the range, similar to the base color',
|
|
48
|
+
},
|
|
49
|
+
heavy: {
|
|
50
|
+
purpose: 'color',
|
|
51
|
+
description: 'A dark color in the range, darker than the base color',
|
|
52
|
+
},
|
|
53
|
+
ink: {
|
|
54
|
+
purpose: 'color',
|
|
55
|
+
description: 'The darkest color in the range, usually used for text and other high-contrast elements',
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
export const colorRangeWithGraySemantic = {
|
|
59
|
+
...colorRangeSemantic,
|
|
60
|
+
gray: colorRangeSemantic,
|
|
61
|
+
};
|
|
62
|
+
export const colorsSemantics = (colorNames) => {
|
|
63
|
+
return createModeSchema({
|
|
64
|
+
palette: createColorPaletteSemantics(colorNames),
|
|
65
|
+
}).palette;
|
|
66
|
+
};
|
|
67
|
+
function createColorPaletteSemantics(colorNames) {
|
|
68
|
+
return colorNames.reduce((acc, colorName) => {
|
|
69
|
+
acc[colorName] = colorRangeWithGraySemantic;
|
|
70
|
+
return acc;
|
|
71
|
+
}, {});
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=semantics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantics.js","sourceRoot":"","sources":["../../../../src/presets/v2/schema/semantics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;IAC9C,KAAK,EAAE;QACN,OAAO,EAAE,QAAQ;QACjB,WAAW,EAAE,kDAAkD;KAC/D;IACD,CAAC,EAAE;QACF,OAAO,EAAE,UAAU;QACnB,WAAW,EAAE,iCAAiC;KAC9C;IACD,CAAC,EAAE;QACF,OAAO,EAAE,UAAU;QACnB,WAAW,EAAE,+BAA+B;KAC5C;IACD,IAAI,EAAE;QACL,OAAO,EAAE,aAAa;QACtB,WAAW,EAAE,2BAA2B;KACxC;IACD,MAAM,EAAE;QACP,OAAO,EAAE,eAAe;QACxB,WAAW,EAAE,6BAA6B;KAC1C;IACD,KAAK,EAAE;QACN,OAAO,EAAE,cAAc;QACvB,WAAW,EAAE,qBAAqB;KAClC;CACD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;IAClD,KAAK,EAAE;QACN,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,6BAA6B;KAC1C;IACD,KAAK,EAAE;QACN,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,iCAAiC;KAC9C;IACD,IAAI,EAAE;QACL,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,yDAAyD;KACtE;IACD,KAAK,EAAE;QACN,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,yDAAyD;KACtE;IACD,GAAG,EAAE;QACJ,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,0DAA0D;KACvE;IACD,KAAK,EAAE;QACN,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,uDAAuD;KACpE;IACD,GAAG,EAAE;QACJ,OAAO,EAAE,OAAO;QAChB,WAAW,EACV,wFAAwF;KACzF;CACD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACzC,GAAG,kBAAkB;IACrB,IAAI,EAAE,kBAAkB;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAC9B,UAAwB,EACvB,EAAE;IACH,OAAO,gBAAgB,CAAC;QACvB,OAAO,EAAE,2BAA2B,CAAC,UAAU,CAAC;KAChD,CAAC,CAAC,OAAO,CAAC;AACZ,CAAC,CAAC;AAEF,SAAS,2BAA2B,CACnC,UAAwB;IAExB,OAAO,UAAU,CAAC,MAAM,CACvB,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE;QAClB,GAAG,CAAC,SAAS,CAAC,GAAG,0BAA0B,CAAC;QAC5C,OAAO,GAAG,CAAC;IACZ,CAAC,EACD,EAA2D,CAC3D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Css, CssResolutionContext } from '@arbor-css/css-eval';
|
|
2
|
+
export interface OklchCssRepresentation {
|
|
3
|
+
l: Css;
|
|
4
|
+
c: Css;
|
|
5
|
+
h: Css;
|
|
6
|
+
from?: Css;
|
|
7
|
+
compiled: Css;
|
|
8
|
+
/**
|
|
9
|
+
* Prints the CSS value of the color equation, including all
|
|
10
|
+
* calculations and variable references - fully dynamic.
|
|
11
|
+
*/
|
|
12
|
+
printDynamic(context: CssResolutionContext): string;
|
|
13
|
+
/**
|
|
14
|
+
* Uses the equation and provided context to compute a static
|
|
15
|
+
* OKLCH color string with calculations and references resolved.
|
|
16
|
+
*/
|
|
17
|
+
printComputed(context: CssResolutionContext): string;
|
|
18
|
+
}
|
|
19
|
+
export declare function oklchBuilder(impl: () => {
|
|
20
|
+
from?: Css;
|
|
21
|
+
l: Css;
|
|
22
|
+
c: Css;
|
|
23
|
+
h: Css;
|
|
24
|
+
}): OklchCssRepresentation;
|
|
25
|
+
//# sourceMappingURL=color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../../src/presets/v2/values/color/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,GAAG,EACH,oBAAoB,EAGpB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,sBAAsB;IACtC,CAAC,EAAE,GAAG,CAAC;IACP,CAAC,EAAE,GAAG,CAAC;IACP,CAAC,EAAE,GAAG,CAAC;IACP,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,GAAG,CAAC;IAEd;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAAC;IACpD;;;OAGG;IACH,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAAC;CACrD;AAED,wBAAgB,YAAY,CAC3B,IAAI,EAAE,MAAM;IACX,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,CAAC,EAAE,GAAG,CAAC;IACP,CAAC,EAAE,GAAG,CAAC;IACP,CAAC,EAAE,GAAG,CAAC;CACP,GACC,sBAAsB,CAmBxB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { css, printCss, resolveCss, } from '@arbor-css/css-eval';
|
|
2
|
+
export function oklchBuilder(impl) {
|
|
3
|
+
const equations = impl();
|
|
4
|
+
const compiled = css `oklch(${equations.from ? `from ${equations.from} ` : ''}calc(${equations.l}) calc(${equations.c}) calc(${equations.h}))`;
|
|
5
|
+
return {
|
|
6
|
+
...equations,
|
|
7
|
+
compiled: css `oklch(${equations.from ? `from ${equations.from} ` : ''}calc(${equations.l}) calc(${equations.c}) calc(${equations.h}))`,
|
|
8
|
+
printDynamic() {
|
|
9
|
+
return printCss(compiled);
|
|
10
|
+
},
|
|
11
|
+
printComputed(context) {
|
|
12
|
+
return resolveCss(compiled, context);
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=color.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../../../../src/presets/v2/values/color/color.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,GAAG,EAGH,QAAQ,EACR,UAAU,GACV,MAAM,qBAAqB,CAAC;AAqB7B,MAAM,UAAU,YAAY,CAC3B,IAKC;IAED,MAAM,SAAS,GAAG,IAAI,EAAE,CAAC;IAEzB,MAAM,QAAQ,GAAG,GAAG,CAAA,SACnB,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAC9C,QAAQ,SAAS,CAAC,CAAC,UAAU,SAAS,CAAC,CAAC,UAAU,SAAS,CAAC,CAAC,IAAI,CAAC;IAElE,OAAO;QACN,GAAG,SAAS;QACZ,QAAQ,EAAE,GAAG,CAAA,SACZ,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAC9C,QAAQ,SAAS,CAAC,CAAC,UAAU,SAAS,CAAC,CAAC,UAAU,SAAS,CAAC,CAAC,IAAI;QACjE,YAAY;YACX,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC3B,CAAC;QACD,aAAa,CAAC,OAA6B;YAC1C,OAAO,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACtC,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CssInterpolation } from '@arbor-css/css-eval';
|
|
2
|
+
import { GlobalTokens } from '../../schema/global.js';
|
|
3
|
+
import { ColorRangeConfig, CompiledColorRange, DefaultRangeName } from './ranges.js';
|
|
4
|
+
import { SchemeDefinition } from './schemes.js';
|
|
5
|
+
export type CompiledColorRangeWithNeutral<TRangeStepNames extends string = DefaultRangeName> = CompiledColorRange<TRangeStepNames> & {
|
|
6
|
+
/**
|
|
7
|
+
* An automatically-generated neutral range derived from
|
|
8
|
+
* the color range.
|
|
9
|
+
*/
|
|
10
|
+
gray: CompiledColorRange<TRangeStepNames>;
|
|
11
|
+
};
|
|
12
|
+
export type CompiledColorRanges<TRangeNames extends string, TRangeStepNames extends string = DefaultRangeName> = {
|
|
13
|
+
[K in TRangeNames]: CompiledColorRangeWithNeutral<TRangeStepNames>;
|
|
14
|
+
};
|
|
15
|
+
export type CompiledColors<TRangeNames extends string, TRangeStepNames extends string = DefaultRangeName> = CompiledColorRanges<TRangeNames, TRangeStepNames>;
|
|
16
|
+
export type CompiledColorRangeConfig<TRangeStepNames extends string> = ColorRangeConfig<TRangeStepNames> & {
|
|
17
|
+
neutralSaturation?: CssInterpolation;
|
|
18
|
+
hueShift?: CssInterpolation;
|
|
19
|
+
};
|
|
20
|
+
export interface CompileColorsOptions<TRangeNames extends string, TRangeStepNames extends string = DefaultRangeName> {
|
|
21
|
+
ranges: Record<TRangeNames, CompiledColorRangeConfig<TRangeStepNames>>;
|
|
22
|
+
schemes?: {
|
|
23
|
+
light?: SchemeDefinition<ColorRangeConfig<TRangeStepNames>, TRangeStepNames>;
|
|
24
|
+
dark?: SchemeDefinition<ColorRangeConfig<TRangeStepNames>, TRangeStepNames>;
|
|
25
|
+
};
|
|
26
|
+
invertLightDark?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Given an input set of color range configurations (hue, saturation)
|
|
30
|
+
* and, optionally, specific calculations to handle light/dark schemes,
|
|
31
|
+
* produces a single set of compiled color ranges which incorporates
|
|
32
|
+
* light-dark logic to select the appropriate color in each scheme
|
|
33
|
+
*/
|
|
34
|
+
export declare function compileColors<TRangeNames extends string, TRangeStepNames extends string = DefaultRangeName>({ ranges, schemes: userSchemes, invertLightDark, }: CompileColorsOptions<TRangeNames, TRangeStepNames>, $: GlobalTokens): CompiledColors<TRangeNames, TRangeStepNames>;
|
|
35
|
+
/**
|
|
36
|
+
* Compile a single color range.
|
|
37
|
+
*/
|
|
38
|
+
export declare function compileSingleColor(
|
|
39
|
+
/**
|
|
40
|
+
* Provide CSS property values for the dynamic inputs
|
|
41
|
+
* of your color range.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* {
|
|
45
|
+
* hue: 'var(--my-hue)',
|
|
46
|
+
* saturation: 'var(--my-saturation)',
|
|
47
|
+
* }
|
|
48
|
+
*/
|
|
49
|
+
range: CompiledColorRangeConfig<string>, tokens: GlobalTokens): CompiledColorRangeWithNeutral<string>;
|
|
50
|
+
//# sourceMappingURL=compile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../src/presets/v2/values/color/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAElB,gBAAgB,EAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGN,gBAAgB,EAChB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,6BAA6B,CACxC,eAAe,SAAS,MAAM,GAAG,gBAAgB,IAC9C,kBAAkB,CAAC,eAAe,CAAC,GAAG;IACzC;;;OAG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EAAE,eAAe,CAAC,CAuC9C;AAmCD;;GAEG;AACH,wBAAgB,kBAAkB;AACjC;;;;;;;;;GASG;AACH,KAAK,EAAE,wBAAwB,CAAC,MAAM,CAAC,EACvC,MAAM,EAAE,YAAY,yCAUpB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { css } from '@arbor-css/css-eval';
|
|
2
|
+
import { createNeutralDerivedRange, } from './ranges.js';
|
|
3
|
+
import { defaultDarkScheme, defaultLightScheme, } from './schemes.js';
|
|
4
|
+
/**
|
|
5
|
+
* Given an input set of color range configurations (hue, saturation)
|
|
6
|
+
* and, optionally, specific calculations to handle light/dark schemes,
|
|
7
|
+
* produces a single set of compiled color ranges which incorporates
|
|
8
|
+
* light-dark logic to select the appropriate color in each scheme
|
|
9
|
+
*/
|
|
10
|
+
export function compileColors({ ranges, schemes: userSchemes, invertLightDark = false, }, $) {
|
|
11
|
+
const schemes = {
|
|
12
|
+
light: userSchemes?.light ??
|
|
13
|
+
defaultLightScheme,
|
|
14
|
+
dark: userSchemes?.dark ??
|
|
15
|
+
defaultDarkScheme,
|
|
16
|
+
};
|
|
17
|
+
const colors = Object.keys(ranges).reduce((colorsAcc, rangeName) => {
|
|
18
|
+
const rangeConfig = {
|
|
19
|
+
// default values
|
|
20
|
+
hueShift: 2,
|
|
21
|
+
neutralSaturation: 0.15,
|
|
22
|
+
...ranges[rangeName],
|
|
23
|
+
};
|
|
24
|
+
const uncompiledLight = schemes.light.getColorRange(rangeConfig, $.color);
|
|
25
|
+
const uncompiledDark = schemes.dark.getColorRange(rangeConfig, $.color);
|
|
26
|
+
const combined = toLightDarkCompiled(invertLightDark ? uncompiledDark : uncompiledLight, invertLightDark ? uncompiledLight : uncompiledDark, $.color, { neutralSaturation: rangeConfig.neutralSaturation });
|
|
27
|
+
colorsAcc[rangeName] = combined;
|
|
28
|
+
return colorsAcc;
|
|
29
|
+
}, {});
|
|
30
|
+
return colors;
|
|
31
|
+
}
|
|
32
|
+
function toLightDarkCompiled(light, dark, $, options = {}) {
|
|
33
|
+
const result = {};
|
|
34
|
+
for (const key in light) {
|
|
35
|
+
const lightColor = light[key];
|
|
36
|
+
const darkColor = dark[key];
|
|
37
|
+
result[key] =
|
|
38
|
+
css `light-dark(${lightColor.equation.compiled}, ${darkColor.equation.compiled})`;
|
|
39
|
+
}
|
|
40
|
+
const lightNeutral = createNeutralDerivedRange(light, $, {
|
|
41
|
+
saturationFactor: options.neutralSaturation ?? 0.15,
|
|
42
|
+
});
|
|
43
|
+
const darkNeutral = createNeutralDerivedRange(dark, $, {
|
|
44
|
+
saturationFactor: options.neutralSaturation ?? 0.15,
|
|
45
|
+
});
|
|
46
|
+
const neutralResult = {};
|
|
47
|
+
for (const key in lightNeutral) {
|
|
48
|
+
const lightColor = lightNeutral[key];
|
|
49
|
+
const darkColor = darkNeutral[key];
|
|
50
|
+
neutralResult[key] =
|
|
51
|
+
css `light-dark(${lightColor.equation.compiled}, ${darkColor.equation.compiled})`;
|
|
52
|
+
}
|
|
53
|
+
result.gray = neutralResult;
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Compile a single color range.
|
|
58
|
+
*/
|
|
59
|
+
export function compileSingleColor(
|
|
60
|
+
/**
|
|
61
|
+
* Provide CSS property values for the dynamic inputs
|
|
62
|
+
* of your color range.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* {
|
|
66
|
+
* hue: 'var(--my-hue)',
|
|
67
|
+
* saturation: 'var(--my-saturation)',
|
|
68
|
+
* }
|
|
69
|
+
*/
|
|
70
|
+
range, tokens) {
|
|
71
|
+
return compileColors({
|
|
72
|
+
ranges: {
|
|
73
|
+
dynamic: range,
|
|
74
|
+
},
|
|
75
|
+
}, tokens).dynamic;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=compile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../../../../src/presets/v2/values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;AACH,KAAuC,EACvC,MAAoB;IAEpB,OAAO,aAAa,CACnB;QACC,MAAM,EAAE;YACP,OAAO,EAAE,KAAK;SACd;KACD,EACD,MAAM,CACN,CAAC,OAAO,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.test.d.ts","sourceRoot":"","sources":["../../../../../src/presets/v2/values/color/compile.test.ts"],"names":[],"mappings":""}
|