vueless 0.0.73 → 0.0.74
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/package.json +1 -1
- package/preset.tailwind/index.js +6 -5
- package/service.ui/index.js +10 -6
- package/ui.navigation-stepper/index.vue +2 -2
- package/web-types.json +1 -1
package/package.json
CHANGED
package/preset.tailwind/index.js
CHANGED
|
@@ -2,8 +2,9 @@ import colors from "tailwindcss/colors.js";
|
|
|
2
2
|
import forms from "@tailwindcss/forms";
|
|
3
3
|
import vuelessConfig from "../../../vueless.config.js";
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
5
|
+
export const GRAY_COLORS = ["slate", "gray", "zinc", "neutral", "stone"];
|
|
6
|
+
export const GRAYSCALE_BRAND_COLOR = "grayscale";
|
|
7
|
+
export const BRAND_COLORS = [
|
|
7
8
|
"brand",
|
|
8
9
|
"red",
|
|
9
10
|
"orange",
|
|
@@ -33,10 +34,10 @@ export function vuelessPreset() {
|
|
|
33
34
|
const brandColor = twColorWithOpacity("--color-brand");
|
|
34
35
|
const { brand, gray } = vuelessConfig;
|
|
35
36
|
|
|
36
|
-
let brandPalette =
|
|
37
|
-
let grayPalette =
|
|
37
|
+
let brandPalette = BRAND_COLORS.includes(brand) ? colors[brand] : colors.green;
|
|
38
|
+
let grayPalette = GRAY_COLORS.includes(gray) ? colors[gray] : colors.zinc;
|
|
38
39
|
|
|
39
|
-
if (brand ===
|
|
40
|
+
if (brand === GRAYSCALE_BRAND_COLOR) {
|
|
40
41
|
brandPalette = grayPalette;
|
|
41
42
|
}
|
|
42
43
|
|
package/service.ui/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { merge } from "lodash-es";
|
|
|
2
2
|
import { defineConfig } from "cva";
|
|
3
3
|
import { twMerge } from "tailwind-merge";
|
|
4
4
|
import colors from "tailwindcss/colors";
|
|
5
|
-
import {
|
|
5
|
+
import { BRAND_COLORS, GRAY_COLORS, GRAYSCALE_BRAND_COLOR } from "../preset.tailwind";
|
|
6
6
|
import vuelessConfig from "../../../vueless.config.js";
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -105,7 +105,7 @@ export default class UIServiceDefault {
|
|
|
105
105
|
// TODO: This should be rewrote to support all set of brand colors (not only one).
|
|
106
106
|
setBrandColor(brandColor) {
|
|
107
107
|
function getBrandColor(color, grayColor, brandColors) {
|
|
108
|
-
if (color ===
|
|
108
|
+
if (color === GRAYSCALE_BRAND_COLOR) {
|
|
109
109
|
return grayColor;
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -116,9 +116,9 @@ export default class UIServiceDefault {
|
|
|
116
116
|
return grayColors.includes(color) ? colors[color][900] : colors.zinc[900];
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
const grayColor = getGrayColor(gray,
|
|
120
|
-
const localBrandColor = getBrandColor(brandColor, grayColor,
|
|
121
|
-
const globalBrandColor = getBrandColor(brand, grayColor,
|
|
119
|
+
const grayColor = getGrayColor(gray, GRAY_COLORS);
|
|
120
|
+
const localBrandColor = getBrandColor(brandColor, grayColor, BRAND_COLORS);
|
|
121
|
+
const globalBrandColor = getBrandColor(brand, grayColor, BRAND_COLORS);
|
|
122
122
|
|
|
123
123
|
const style = document.createElement("style");
|
|
124
124
|
const rgb = UIServiceDefault.convertHexInRgb(localBrandColor || globalBrandColor || grayColor);
|
|
@@ -167,7 +167,11 @@ export default class UIServiceDefault {
|
|
|
167
167
|
*/
|
|
168
168
|
static get(defaultConfig, name) {
|
|
169
169
|
return {
|
|
170
|
-
default: merge(
|
|
170
|
+
default: merge(
|
|
171
|
+
defaultConfig.defaultVariants,
|
|
172
|
+
brand === GRAYSCALE_BRAND_COLOR && { color: GRAYSCALE_BRAND_COLOR },
|
|
173
|
+
globalComponentConfig[name]?.defaultVariants,
|
|
174
|
+
),
|
|
171
175
|
};
|
|
172
176
|
}
|
|
173
177
|
}
|
|
@@ -46,7 +46,7 @@ import colors from "tailwindcss/colors";
|
|
|
46
46
|
|
|
47
47
|
import UHeader from "../ui.text-header";
|
|
48
48
|
import UIService from "../service.ui";
|
|
49
|
-
import {
|
|
49
|
+
import { GRAY_COLORS } from "../preset.tailwind";
|
|
50
50
|
|
|
51
51
|
import { UStepper } from "./constants/index";
|
|
52
52
|
import defaultConfig from "./configs/default.config";
|
|
@@ -112,7 +112,7 @@ const { wrapperAttrs, titleAttrs, stepperAttrs, ringAttrs, countAttrs, gradientA
|
|
|
112
112
|
const setStepperColor = computed(() => {
|
|
113
113
|
return colors[props.color]
|
|
114
114
|
? colors[props.color][500]
|
|
115
|
-
:
|
|
115
|
+
: GRAY_COLORS.includes(props.color)
|
|
116
116
|
? colors[props.color][900]
|
|
117
117
|
: colors.zinc[900];
|
|
118
118
|
});
|