teacss 0.2.0-alpha.10 → 0.2.0-alpha.11
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/dist/index.cjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +2 -6
package/dist/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
8
8
|
|
|
9
9
|
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
10
10
|
|
|
11
|
-
function
|
|
11
|
+
function T(...n){return tailwindMerge.twMerge(clsx.clsx(n))}var m=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,l=clsx.clsx,V=(n,r)=>t=>{if(r?.variants==null)return l(n,t?.class,t?.className);let{variants:p,defaultVariants:s}=r,d=Object.keys(p).map(e=>{let a=t?.[e],o=s?.[e];if(a===null)return null;let i=m(a)||m(o);return p[e][i]}),c=t&&Object.entries(t).reduce((e,[a,o])=>(o===void 0||(e[a]=o),e),{}),u=r?.compoundVariants?.reduce((e,{class:a,className:o,...i})=>Object.entries(i).every(([C,f])=>Array.isArray(f)?f.includes({...s,...c}[C]):{...s,...c}[C]===f)?[...e,a,o]:e,[]);return l(n,d,u,t?.class,t?.className)};
|
|
12
12
|
|
|
13
13
|
Object.defineProperty(exports, "cn", {
|
|
14
14
|
enumerable: true,
|
|
@@ -16,4 +16,4 @@ Object.defineProperty(exports, "cn", {
|
|
|
16
16
|
});
|
|
17
17
|
exports.cva = V;
|
|
18
18
|
exports.cx = l;
|
|
19
|
-
exports.cxm =
|
|
19
|
+
exports.cxm = T;
|
package/dist/index.d.mts
CHANGED
|
@@ -17,7 +17,7 @@ type OmitUndefined<T> = T extends undefined ? never : T;
|
|
|
17
17
|
type StringToBoolean<T> = T extends "true" | "false" ? boolean : T;
|
|
18
18
|
|
|
19
19
|
declare function cxm(...inputs: ClassValue[]): string;
|
|
20
|
-
type
|
|
20
|
+
type CxVariantProps<Component extends (...args: any) => any> = Omit<OmitUndefined<Parameters<Component>[0]>, "class" | "className">;
|
|
21
21
|
type CxOptions = Parameters<typeof clsx>;
|
|
22
22
|
type CxReturn = ReturnType<typeof clsx>;
|
|
23
23
|
declare const cx: typeof clsx;
|
|
@@ -36,4 +36,4 @@ type Config<T> = T extends ConfigSchema ? {
|
|
|
36
36
|
type Props<T> = T extends ConfigSchema ? ConfigVariants<T> & ClassProp : ClassProp;
|
|
37
37
|
declare const cva: <T>(base?: ClassValue, config?: Config<T>) => (props?: Props<T>) => string;
|
|
38
38
|
|
|
39
|
-
export { type CxOptions, type CxReturn, type
|
|
39
|
+
export { type CxOptions, type CxReturn, type CxVariantProps, cva, cx, cxm };
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ type OmitUndefined<T> = T extends undefined ? never : T;
|
|
|
17
17
|
type StringToBoolean<T> = T extends "true" | "false" ? boolean : T;
|
|
18
18
|
|
|
19
19
|
declare function cxm(...inputs: ClassValue[]): string;
|
|
20
|
-
type
|
|
20
|
+
type CxVariantProps<Component extends (...args: any) => any> = Omit<OmitUndefined<Parameters<Component>[0]>, "class" | "className">;
|
|
21
21
|
type CxOptions = Parameters<typeof clsx>;
|
|
22
22
|
type CxReturn = ReturnType<typeof clsx>;
|
|
23
23
|
declare const cx: typeof clsx;
|
|
@@ -36,4 +36,4 @@ type Config<T> = T extends ConfigSchema ? {
|
|
|
36
36
|
type Props<T> = T extends ConfigSchema ? ConfigVariants<T> & ClassProp : ClassProp;
|
|
37
37
|
declare const cva: <T>(base?: ClassValue, config?: Config<T>) => (props?: Props<T>) => string;
|
|
38
38
|
|
|
39
|
-
export { type CxOptions, type CxReturn, type
|
|
39
|
+
export { type CxOptions, type CxReturn, type CxVariantProps, cva, cx, cxm };
|
package/dist/index.mjs
CHANGED
|
@@ -2,6 +2,6 @@ export { default as cn } from 'classnames';
|
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function T(...n){return twMerge(clsx(n))}var m=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,l=clsx,V=(n,r)=>t=>{if(r?.variants==null)return l(n,t?.class,t?.className);let{variants:p,defaultVariants:s}=r,d=Object.keys(p).map(e=>{let a=t?.[e],o=s?.[e];if(a===null)return null;let i=m(a)||m(o);return p[e][i]}),c=t&&Object.entries(t).reduce((e,[a,o])=>(o===void 0||(e[a]=o),e),{}),u=r?.compoundVariants?.reduce((e,{class:a,className:o,...i})=>Object.entries(i).every(([C,f])=>Array.isArray(f)?f.includes({...s,...c}[C]):{...s,...c}[C]===f)?[...e,a,o]:e,[]);return l(n,d,u,t?.class,t?.className)};
|
|
6
6
|
|
|
7
|
-
export { V as cva, l as cx,
|
|
7
|
+
export { V as cva, l as cx, T as cxm };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teacss",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Teacss aims to provide a one-stop solution for writing stylesheet.",
|
|
6
6
|
"author": "Billgo <hi@billgo.me>",
|
|
@@ -63,11 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"./*": "./*"
|
|
65
65
|
},
|
|
66
|
-
"files": [
|
|
67
|
-
"dist",
|
|
68
|
-
"types",
|
|
69
|
-
"README.md"
|
|
70
|
-
],
|
|
66
|
+
"files": ["dist", "types", "README.md"],
|
|
71
67
|
"scripts": {
|
|
72
68
|
"prepublishOnly": "bun run build",
|
|
73
69
|
"build": "bunx rimraf dist && bun run build:esm && bun run build:bun && rollup -c",
|