@next-core/brick-kit 2.103.3 → 2.103.4
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 +8 -0
- package/dist/index.bundle.js +28 -1
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +28 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.103.4](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.103.3...@next-core/brick-kit@2.103.4) (2022-01-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @next-core/brick-kit
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [2.103.3](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.103.2...@next-core/brick-kit@2.103.3) (2022-01-20)
|
|
7
15
|
|
|
8
16
|
|
package/dist/index.bundle.js
CHANGED
|
@@ -7070,7 +7070,7 @@
|
|
|
7070
7070
|
presetPalettes.grey;
|
|
7071
7071
|
|
|
7072
7072
|
function getStyleByBaseColors(theme, baseColors, backgroundColor) {
|
|
7073
|
-
return (theme === "dark" ? getDarkStyle : getLightStyle)(getCssVariableDefinitionsByPalettes(generatePalettes(baseColors, theme, backgroundColor)));
|
|
7073
|
+
return (theme === "dark" ? getDarkStyle : getLightStyle)("".concat(getCssVariableDefinitionsByPalettes(generatePalettes(baseColors, theme, backgroundColor)), "\n").concat(getMigratedCssVariableDefinitions(theme, baseColors, backgroundColor)));
|
|
7074
7074
|
}
|
|
7075
7075
|
function getStyleByBrandColor(theme, brandColor) {
|
|
7076
7076
|
return (theme === "dark" ? getDarkStyle : getLightStyle)(getCssVariableDefinitionsByBrand(brandColor));
|
|
@@ -7134,6 +7134,33 @@
|
|
|
7134
7134
|
}
|
|
7135
7135
|
}
|
|
7136
7136
|
|
|
7137
|
+
function getMigratedCssVariableDefinitions(theme, baseColors, backgroundColor) {
|
|
7138
|
+
var migrateMap = {
|
|
7139
|
+
green: "green",
|
|
7140
|
+
red: "red",
|
|
7141
|
+
blue: "blue",
|
|
7142
|
+
orange: "orange",
|
|
7143
|
+
cyan: "cyan",
|
|
7144
|
+
purple: "purple",
|
|
7145
|
+
geekblue: "indigo"
|
|
7146
|
+
};
|
|
7147
|
+
return Object.entries(migrateMap).flatMap(_ref4 => {
|
|
7148
|
+
var [legacyColorName, newColorName] = _ref4;
|
|
7149
|
+
return [" --theme-".concat(legacyColorName, "-color-rgb-channel: ").concat(getRgbChannel(getActualBaseColor(baseColors[newColorName], theme, backgroundColor)), ";"), ...(theme === "dark" ? [] : [" --theme-".concat(legacyColorName, "-color: var(--palette-").concat(newColorName, "-6);"), " --theme-".concat(legacyColorName, "-border-color: var(--palette-").concat(newColorName, "-3);")]), " --theme-".concat(legacyColorName, "-background: var(--palette-").concat(newColorName, "-").concat(theme === "dark" ? 2 : 1, ");"), ""];
|
|
7150
|
+
}).join("\n");
|
|
7151
|
+
}
|
|
7152
|
+
|
|
7153
|
+
function getRgbChannel(color) {
|
|
7154
|
+
return color.match(/[0-9a-fA-F]{2}/g).map(hex => parseInt(hex, 16)).join(", ");
|
|
7155
|
+
}
|
|
7156
|
+
|
|
7157
|
+
function getActualBaseColor(baseColor, theme, backgroundColor) {
|
|
7158
|
+
return theme === "dark" ? generate(baseColor, {
|
|
7159
|
+
theme,
|
|
7160
|
+
backgroundColor
|
|
7161
|
+
})[5] : baseColor;
|
|
7162
|
+
}
|
|
7163
|
+
|
|
7137
7164
|
function applyColorTheme(options) {
|
|
7138
7165
|
var style = [];
|
|
7139
7166
|
var themes = ["light", "dark"];
|