@cyclone-ui/theme-builder 0.0.4 → 0.0.5
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/CHANGELOG.md +11 -0
- package/dist/index.cjs +1 -1
- package/dist/preprocessor.cjs +1 -1
- package/dist/preprocessor.d.cts +23 -1
- package/dist/preprocessor.d.cts.map +1 -1
- package/dist/preprocessor.d.mts +22 -1
- package/dist/preprocessor.mjs +1 -1
- package/dist/preprocessor.mjs.map +1 -1
- package/package.json +1 -1
- package/src/preprocessor.ts +224 -241
- package/test/preprocessor.spec.ts +170 -191
- package/test/shiki-theme-mapping.spec.ts +24 -27
- package/test/storybook-theme-mapping.spec.ts +29 -29
|
@@ -54,13 +54,13 @@ const token = ($value: string | number): Token => ({ $value });
|
|
|
54
54
|
|
|
55
55
|
const semanticColors = (prefix: string) => ({
|
|
56
56
|
color: {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
emphasis: token(`${prefix}-emphasis`),
|
|
58
|
+
ink: token(`${prefix}-ink`),
|
|
59
|
+
subtlest: token(`${prefix}-subtlest`),
|
|
60
|
+
hairline: token(`${prefix}-hairline`),
|
|
61
|
+
canvas: token(`${prefix}-canvas`),
|
|
62
|
+
elevated: token(`${prefix}-elevated`),
|
|
63
|
+
floating: token(`${prefix}-floating`),
|
|
64
64
|
},
|
|
65
65
|
radius: { md: token(6) }
|
|
66
66
|
});
|
|
@@ -89,30 +89,30 @@ describe("Storybook theme mapping", () => {
|
|
|
89
89
|
|
|
90
90
|
expect(themes.dark).toMatchObject({
|
|
91
91
|
base: "dark",
|
|
92
|
-
colorPrimary: "dark-
|
|
93
|
-
colorSecondary: "dark-
|
|
94
|
-
textColor: "dark-
|
|
95
|
-
textInverseColor: "dark-
|
|
96
|
-
appBg: "dark-
|
|
97
|
-
appContentBg: "dark-
|
|
98
|
-
appPreviewBg: "dark-
|
|
99
|
-
appBorderColor: "dark-
|
|
92
|
+
colorPrimary: "dark-emphasis",
|
|
93
|
+
colorSecondary: "dark-subtlest",
|
|
94
|
+
textColor: "dark-emphasis",
|
|
95
|
+
textInverseColor: "dark-canvas",
|
|
96
|
+
appBg: "dark-canvas",
|
|
97
|
+
appContentBg: "dark-canvas",
|
|
98
|
+
appPreviewBg: "dark-canvas",
|
|
99
|
+
appBorderColor: "dark-hairline",
|
|
100
100
|
appBorderRadius: 6,
|
|
101
|
-
barTextColor: "dark-
|
|
102
|
-
barSelectedColor: "dark-
|
|
103
|
-
barBg: "dark-
|
|
104
|
-
barHoverColor: "dark-
|
|
105
|
-
buttonBg: "dark-
|
|
106
|
-
buttonBorder: "dark-
|
|
107
|
-
inputBg: "dark-
|
|
108
|
-
inputBorder: "dark-
|
|
109
|
-
inputTextColor: "dark-
|
|
101
|
+
barTextColor: "dark-ink",
|
|
102
|
+
barSelectedColor: "dark-emphasis",
|
|
103
|
+
barBg: "dark-floating",
|
|
104
|
+
barHoverColor: "dark-subtlest",
|
|
105
|
+
buttonBg: "dark-elevated",
|
|
106
|
+
buttonBorder: "dark-hairline",
|
|
107
|
+
inputBg: "dark-elevated",
|
|
108
|
+
inputBorder: "dark-hairline",
|
|
109
|
+
inputTextColor: "dark-ink",
|
|
110
110
|
inputBorderRadius: 6,
|
|
111
|
-
booleanBg: "dark-
|
|
112
|
-
booleanSelectedBg: "dark-
|
|
111
|
+
booleanBg: "dark-elevated",
|
|
112
|
+
booleanSelectedBg: "dark-subtlest"
|
|
113
113
|
});
|
|
114
|
-
expect(themes.light.colorPrimary).toBe("light-
|
|
115
|
-
expect(themes.light.textColor).toBe("light-
|
|
116
|
-
expect(themes.light.appBg).toBe("light-
|
|
114
|
+
expect(themes.light.colorPrimary).toBe("light-emphasis");
|
|
115
|
+
expect(themes.light.textColor).toBe("light-emphasis");
|
|
116
|
+
expect(themes.light.appBg).toBe("light-canvas");
|
|
117
117
|
});
|
|
118
118
|
});
|