vueless 1.5.1-beta.4 → 1.5.1-beta.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/package.json +2 -2
- package/utils/node/vuelessConfig.d.ts +1 -1
- package/utils/node/vuelessConfig.js +3 -1
- package/utils/ui.ts +10 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "1.5.1-beta.
|
|
3
|
+
"version": "1.5.1-beta.5",
|
|
4
4
|
"description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
|
|
5
5
|
"author": "Johnny Grid <hello@vueless.com> (https://vueless.com)",
|
|
6
6
|
"homepage": "https://vueless.com",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@tailwindcss/postcss": "^4.2.4",
|
|
36
36
|
"@tailwindcss/vite": "^4.2.4",
|
|
37
37
|
"@types/lodash-es": "^4.17.12",
|
|
38
|
-
"cva": "
|
|
38
|
+
"cva": "1.0.0-beta.10",
|
|
39
39
|
"lodash-es": "^4.18.1",
|
|
40
40
|
"rolldown": "^1.1.5",
|
|
41
41
|
"svgo": "^4.0.1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function getVuelessConfig(basePath?: string): Promise<Object>;
|
|
2
2
|
export let vuelessConfig: {};
|
|
3
|
-
export const cx: import("cva").CX
|
|
3
|
+
export const cx: import("cva").CX<import("cva").ClassValue>;
|
|
4
4
|
export const getMergedConfig: ({ defaultConfig, globalConfig, propsConfig, unstyled }: {
|
|
5
5
|
defaultConfig: any;
|
|
6
6
|
globalConfig: any;
|
|
@@ -2,7 +2,8 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { cwd } from "node:process";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
|
-
import {
|
|
5
|
+
import { cx as cvaCx } from "cva";
|
|
6
|
+
import { defineConfig } from "cva/config";
|
|
6
7
|
import { merge } from "lodash-es";
|
|
7
8
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
8
9
|
|
|
@@ -57,6 +58,7 @@ const twMerge = extendTailwindMerge(
|
|
|
57
58
|
* – remove all Vueless nested component names ({U...} strings) from the class list string.
|
|
58
59
|
*/
|
|
59
60
|
export const { cx } = defineConfig({
|
|
61
|
+
cx: cvaCx,
|
|
60
62
|
hooks: {
|
|
61
63
|
onComplete: (classNames) => twMerge(classNames).replace(NESTED_COMPONENT_PATTERN_REG_EXP, ""),
|
|
62
64
|
},
|
package/utils/ui.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { merge } from "lodash-es";
|
|
2
|
-
import {
|
|
2
|
+
import { cx as cvaCx } from "cva";
|
|
3
|
+
import { defineConfig } from "cva/config";
|
|
3
4
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
5
|
|
|
5
6
|
import { isCSR, isSSR } from "./helper";
|
|
@@ -7,6 +8,7 @@ import { createGetMergedConfig } from "./node/mergeConfigs";
|
|
|
7
8
|
import { COMPONENT_NAME as U_ICON } from "../ui.image-icon/constants";
|
|
8
9
|
import { ICON_NON_PROPS_DEFAULTS, TAILWIND_MERGE_EXTENSION } from "../constants";
|
|
9
10
|
|
|
11
|
+
import type { CVAVariantShape } from "cva";
|
|
10
12
|
import type {
|
|
11
13
|
Config,
|
|
12
14
|
UnknownObject,
|
|
@@ -75,6 +77,7 @@ export const {
|
|
|
75
77
|
compose,
|
|
76
78
|
cva: classVarianceAuthority,
|
|
77
79
|
} = defineConfig({
|
|
80
|
+
cx: cvaCx,
|
|
78
81
|
hooks: {
|
|
79
82
|
onComplete: (classNames) => twMerge(classNames),
|
|
80
83
|
},
|
|
@@ -83,7 +86,12 @@ export const {
|
|
|
83
86
|
export const getMergedConfig = createGetMergedConfig(cx) as GetMergedConfig;
|
|
84
87
|
|
|
85
88
|
/* This allows skipping some CVA config keys in vueless config. */
|
|
86
|
-
export const cva = ({
|
|
89
|
+
export const cva = ({
|
|
90
|
+
base = "",
|
|
91
|
+
variants = {} as CVAVariantShape,
|
|
92
|
+
compoundVariants = [],
|
|
93
|
+
defaultVariants = {},
|
|
94
|
+
}) =>
|
|
87
95
|
classVarianceAuthority({
|
|
88
96
|
base,
|
|
89
97
|
variants,
|