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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.73",
3
+ "version": "0.0.74",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -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 grayColors = ["slate", "gray", "zinc", "neutral", "stone"];
6
- export const brandColors = [
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 = brandColors.includes(brand) ? colors[brand] : colors.green;
37
- let grayPalette = grayColors.includes(gray) ? colors[gray] : colors.zinc;
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 === "grayscale") {
40
+ if (brand === GRAYSCALE_BRAND_COLOR) {
40
41
  brandPalette = grayPalette;
41
42
  }
42
43
 
@@ -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 { brandColors, grayColors } from "../preset.tailwind";
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 === "grayscale") {
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, grayColors);
120
- const localBrandColor = getBrandColor(brandColor, grayColor, brandColors);
121
- const globalBrandColor = getBrandColor(brand, grayColor, brandColors);
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(defaultConfig.defaultVariants, globalComponentConfig[name]?.defaultVariants),
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 { grayColors } from "../preset.tailwind";
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
- : grayColors.includes(props.color)
115
+ : GRAY_COLORS.includes(props.color)
116
116
  ? colors[props.color][900]
117
117
  : colors.zinc[900];
118
118
  });
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.73",
4
+ "version": "0.0.74",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",