tailwind-variants 2.1.0 → 3.0.0
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/README.md +8 -1
- package/dist/chunk-7L2KNZGU.cjs +1 -0
- package/dist/chunk-GQLG7IS2.js +1 -0
- package/dist/chunk-IFWU2MEM.js +1 -0
- package/dist/chunk-WBJQ6REG.cjs +1 -0
- package/dist/config.d.ts +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -330
- package/dist/index.js +1 -1
- package/dist/lite.cjs +1 -0
- package/dist/lite.d.ts +12 -0
- package/dist/lite.js +1 -0
- package/dist/types.d.ts +340 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +21 -3
- package/dist/utils.js +1 -1
- package/package.json +34 -24
- package/dist/chunk-2DBF3ZSA.js +0 -1
- package/dist/chunk-3PHVNOBC.cjs +0 -1
- package/dist/chunk-B6QK5R63.cjs +0 -1
- package/dist/chunk-HK3UQQ6K.js +0 -1
- package/dist/cn.cjs +0 -1
- package/dist/cn.js +0 -1
package/README.md
CHANGED
|
@@ -58,7 +58,14 @@ npm i tailwind-merge
|
|
|
58
58
|
pnpm add tailwind-merge
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
>
|
|
61
|
+
> **💡 Lite mode (v3):** For smaller bundle size and faster runtime without conflict resolution, use the `/lite` import:
|
|
62
|
+
> ```js
|
|
63
|
+
> import {tv} from "tailwind-variants/lite";
|
|
64
|
+
> ```
|
|
65
|
+
|
|
66
|
+
> **⚠️ Upgrading?**
|
|
67
|
+
> - From v2 to v3: See the [v3 migration guide](./MIGRATION-V3.md)
|
|
68
|
+
> - From v1 to v2: See the [v2 migration guide](./MIGRATION-V2.md)
|
|
62
69
|
|
|
63
70
|
2. Usage:
|
|
64
71
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var y=/\s+/g,a=t=>typeof t!="string"||!t?t:t.replace(y," ").trim(),u=(...t)=>{let r=[],n=e=>{if(!e&&e!==0&&e!==0n)return;if(Array.isArray(e)){for(let s=0,o=e.length;s<o;s++)n(e[s]);return}let f=typeof e;if(f==="string"||f==="number"||f==="bigint"){if(f==="number"&&e!==e)return;r.push(String(e));}else if(f==="object"){let s=Object.keys(e);for(let o=0,i=s.length;o<i;o++){let l=s[o];e[l]&&r.push(l);}}};for(let e=0,f=t.length;e<f;e++){let s=t[e];s!=null&&n(s);}return r.length>0?a(r.join(" ")):void 0},h=t=>t===false?"false":t===true?"true":t===0?"0":t,x=t=>{if(!t||typeof t!="object")return true;for(let r in t)return false;return true},k=(t,r)=>{if(t===r)return true;if(!t||!r)return false;let n=Object.keys(t),e=Object.keys(r);if(n.length!==e.length)return false;for(let f=0;f<n.length;f++){let s=n[f];if(!e.includes(s)||t[s]!==r[s])return false}return true},A=t=>t===true||t===false,d=(t,r)=>{for(let n in r)if(Object.prototype.hasOwnProperty.call(r,n)){let e=r[n];n in t?t[n]=u(t[n],e):t[n]=e;}return t},c=(t,r)=>{for(let n=0;n<t.length;n++){let e=t[n];Array.isArray(e)?c(e,r):e&&r.push(e);}};function O(t){let r=[];return c(t,r),r}var g=(...t)=>{let r=[];c(t,r);let n=[];for(let e=0;e<r.length;e++)r[e]&&n.push(r[e]);return n},p=(t,r)=>{let n={};for(let e in t){let f=t[e];if(e in r){let s=r[e];Array.isArray(f)||Array.isArray(s)?n[e]=g(s,f):typeof f=="object"&&typeof s=="object"&&f&&s?n[e]=p(f,s):n[e]=s+" "+f;}else n[e]=f;}for(let e in r)e in t||(n[e]=r[e]);return n};exports.a=a;exports.b=u;exports.c=h;exports.d=x;exports.e=k;exports.f=A;exports.g=d;exports.h=c;exports.i=O;exports.j=g;exports.k=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var y=/\s+/g,a=t=>typeof t!="string"||!t?t:t.replace(y," ").trim(),u=(...t)=>{let r=[],n=e=>{if(!e&&e!==0&&e!==0n)return;if(Array.isArray(e)){for(let s=0,o=e.length;s<o;s++)n(e[s]);return}let f=typeof e;if(f==="string"||f==="number"||f==="bigint"){if(f==="number"&&e!==e)return;r.push(String(e));}else if(f==="object"){let s=Object.keys(e);for(let o=0,i=s.length;o<i;o++){let l=s[o];e[l]&&r.push(l);}}};for(let e=0,f=t.length;e<f;e++){let s=t[e];s!=null&&n(s);}return r.length>0?a(r.join(" ")):void 0},h=t=>t===false?"false":t===true?"true":t===0?"0":t,x=t=>{if(!t||typeof t!="object")return true;for(let r in t)return false;return true},k=(t,r)=>{if(t===r)return true;if(!t||!r)return false;let n=Object.keys(t),e=Object.keys(r);if(n.length!==e.length)return false;for(let f=0;f<n.length;f++){let s=n[f];if(!e.includes(s)||t[s]!==r[s])return false}return true},A=t=>t===true||t===false,d=(t,r)=>{for(let n in r)if(Object.prototype.hasOwnProperty.call(r,n)){let e=r[n];n in t?t[n]=u(t[n],e):t[n]=e;}return t},c=(t,r)=>{for(let n=0;n<t.length;n++){let e=t[n];Array.isArray(e)?c(e,r):e&&r.push(e);}};function O(t){let r=[];return c(t,r),r}var g=(...t)=>{let r=[];c(t,r);let n=[];for(let e=0;e<r.length;e++)r[e]&&n.push(r[e]);return n},p=(t,r)=>{let n={};for(let e in t){let f=t[e];if(e in r){let s=r[e];Array.isArray(f)||Array.isArray(s)?n[e]=g(s,f):typeof f=="object"&&typeof s=="object"&&f&&s?n[e]=p(f,s):n[e]=s+" "+f;}else n[e]=f;}for(let e in r)e in t||(n[e]=r[e]);return n};export{a,u as b,h as c,x as d,k as e,A as f,d as g,c as h,O as i,g as j,p as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {k,b,d,e,g,j,c,a}from'./chunk-GQLG7IS2.js';var Q={twMerge:true,twMergeConfig:{},responsiveVariants:false};function ne(){let b=null,w={},A=false;return {get cachedTwMerge(){return b},set cachedTwMerge(u){b=u;},get cachedTwMergeConfig(){return w},set cachedTwMergeConfig(u){w=u;},get didTwMergeConfigChange(){return A},set didTwMergeConfigChange(u){A=u;},reset(){b=null,w={},A=false;}}}var S=ne();var le=b$1=>{let w=(u,$)=>{let{extend:c$1=null,slots:M={},variants:q={},compoundVariants:L=[],compoundSlots:v=[],defaultVariants:U={}}=u,d$1={...Q,...$},x=c$1?.base?b(c$1.base,u?.base):u?.base,p=c$1?.variants&&!d(c$1.variants)?k(q,c$1.variants):q,E=c$1?.defaultVariants&&!d(c$1.defaultVariants)?{...c$1.defaultVariants,...U}:U;!d(d$1.twMergeConfig)&&!e(d$1.twMergeConfig,S.cachedTwMergeConfig)&&(S.didTwMergeConfigChange=true,S.cachedTwMergeConfig=d$1.twMergeConfig);let N=d(c$1?.slots),O=d(M)?{}:{base:b(u?.base,N&&c$1?.base),...M},j$1=N?O:g({...c$1?.slots},d(O)?{base:u?.base}:O),T=d(c$1?.compoundVariants)?L:j(c$1?.compoundVariants,L),y=h=>{if(d(p)&&d(M)&&N)return b$1(x,h?.class,h?.className)(d$1);if(T&&!Array.isArray(T))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof T}`);if(v&&!Array.isArray(v))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof v}`);let Y=(t,e,n=[],a$1)=>{let r=n;if(typeof e=="string"){let i=a(e).split(" ");for(let l=0;l<i.length;l++)r.push(`${t}:${i[l]}`);}else if(Array.isArray(e))for(let s=0;s<e.length;s++)r.push(`${t}:${e[s]}`);else if(typeof e=="object"&&typeof a$1=="string"&&a$1 in e){let s=e[a$1];if(s&&typeof s=="string"){let l=a(s).split(" "),f=[];for(let o=0;o<l.length;o++)f.push(`${t}:${l[o]}`);r[a$1]=r[a$1]?r[a$1].concat(f):f;}else if(Array.isArray(s)&&s.length>0){let i=[];for(let l=0;l<s.length;l++)i.push(`${t}:${s[l]}`);r[a$1]=i;}}return r},W=(t,e=p,n=null,a=null)=>{let r=e[t];if(!r||d(r))return null;let s=a?.[t]??h?.[t];if(s===null)return null;let i=c(s),l=Array.isArray(d$1.responsiveVariants)&&d$1.responsiveVariants.length>0||d$1.responsiveVariants===true,f=E?.[t],o=[];if(typeof i=="object"&&l)for(let[C,H]of Object.entries(i)){let te=r[H];if(C==="initial"){f=H;continue}Array.isArray(d$1.responsiveVariants)&&!d$1.responsiveVariants.includes(C)||(o=Y(C,te,o,n));}let V=i!=null&&typeof i!="object"?i:c(f),m=r[V||"false"];return typeof o=="object"&&typeof n=="string"&&o[n]?g(o,m):o.length>0?(o.push(m),n==="base"?o.join(" "):o):m},Z=()=>{if(!p)return null;let t=Object.keys(p),e=[];for(let n=0;n<t.length;n++){let a=W(t[n],p);a&&e.push(a);}return e},_=(t,e)=>{if(!p||typeof p!="object")return null;let n=[];for(let a in p){let r=W(a,p,t,e),s=t==="base"&&typeof r=="string"?r:r&&r[t];s&&n.push(s);}return n},z={};for(let t in h){let e=h[t];e!==void 0&&(z[t]=e);}let D=(t,e)=>{let n=typeof h?.[t]=="object"?{[t]:h[t]?.initial}:{};return {...E,...z,...n,...e}},G=(t=[],e)=>{let n=[],a=t.length;for(let r=0;r<a;r++){let{class:s,className:i,...l}=t[r],f=true,o=D(null,e);for(let V in l){let m=l[V],C=o[V];if(Array.isArray(m)){if(!m.includes(C)){f=false;break}}else {if((m==null||m===false)&&(C==null||C===false))continue;if(C!==m){f=false;break}}}f&&(s&&n.push(s),i&&n.push(i));}return n},K=t=>{let e=G(T,t);if(!Array.isArray(e))return e;let n={},a=b$1;for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="string")n.base=a(n.base,s)(d$1);else if(typeof s=="object")for(let i in s)n[i]=a(n[i],s[i])(d$1);}return n},ee=t=>{if(v.length<1)return null;let e={},n=D(null,t);for(let a=0;a<v.length;a++){let{slots:r=[],class:s,className:i,...l}=v[a];if(!d(l)){let f=true;for(let o in l){let V=n[o],m=l[o];if(V===void 0||(Array.isArray(m)?!m.includes(V):m!==V)){f=false;break}}if(!f)continue}for(let f=0;f<r.length;f++){let o=r[f];e[o]||(e[o]=[]),e[o].push([s,i]);}}return e};if(!d(M)||!N){let t={};if(typeof j$1=="object"&&!d(j$1)){let e=b$1;for(let n in j$1)t[n]=a=>{let r=K(a),s=ee(a);return e(j$1[n],_(n,a),r?r[n]:void 0,s?s[n]:void 0,a?.class,a?.className)(d$1)};}return t}return b$1(x,Z(),G(T),h?.class,h?.className)(d$1)},X=()=>{if(!(!p||typeof p!="object"))return Object.keys(p)};return y.variantKeys=X(),y.extend=c$1,y.base=x,y.slots=j$1,y.variants=p,y.defaultVariants=E,y.compoundSlots=v,y.compoundVariants=T,y};return {tv:w,createTV:u=>($,c)=>w($,c?k(u,c):u)}};export{Q as a,S as b,le as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk7L2KNZGU_cjs=require('./chunk-7L2KNZGU.cjs');var Q={twMerge:true,twMergeConfig:{},responsiveVariants:false};function ne(){let b=null,w={},A=false;return {get cachedTwMerge(){return b},set cachedTwMerge(u){b=u;},get cachedTwMergeConfig(){return w},set cachedTwMergeConfig(u){w=u;},get didTwMergeConfigChange(){return A},set didTwMergeConfigChange(u){A=u;},reset(){b=null,w={},A=false;}}}var S=ne();var le=b=>{let w=(u,$)=>{let{extend:c=null,slots:M={},variants:q={},compoundVariants:L=[],compoundSlots:v=[],defaultVariants:U={}}=u,d={...Q,...$},x=c?.base?chunk7L2KNZGU_cjs.b(c.base,u?.base):u?.base,p=c?.variants&&!chunk7L2KNZGU_cjs.d(c.variants)?chunk7L2KNZGU_cjs.k(q,c.variants):q,E=c?.defaultVariants&&!chunk7L2KNZGU_cjs.d(c.defaultVariants)?{...c.defaultVariants,...U}:U;!chunk7L2KNZGU_cjs.d(d.twMergeConfig)&&!chunk7L2KNZGU_cjs.e(d.twMergeConfig,S.cachedTwMergeConfig)&&(S.didTwMergeConfigChange=true,S.cachedTwMergeConfig=d.twMergeConfig);let N=chunk7L2KNZGU_cjs.d(c?.slots),O=chunk7L2KNZGU_cjs.d(M)?{}:{base:chunk7L2KNZGU_cjs.b(u?.base,N&&c?.base),...M},j=N?O:chunk7L2KNZGU_cjs.g({...c?.slots},chunk7L2KNZGU_cjs.d(O)?{base:u?.base}:O),T=chunk7L2KNZGU_cjs.d(c?.compoundVariants)?L:chunk7L2KNZGU_cjs.j(c?.compoundVariants,L),y=h=>{if(chunk7L2KNZGU_cjs.d(p)&&chunk7L2KNZGU_cjs.d(M)&&N)return b(x,h?.class,h?.className)(d);if(T&&!Array.isArray(T))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof T}`);if(v&&!Array.isArray(v))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof v}`);let Y=(t,e,n=[],a)=>{let r=n;if(typeof e=="string"){let i=chunk7L2KNZGU_cjs.a(e).split(" ");for(let l=0;l<i.length;l++)r.push(`${t}:${i[l]}`);}else if(Array.isArray(e))for(let s=0;s<e.length;s++)r.push(`${t}:${e[s]}`);else if(typeof e=="object"&&typeof a=="string"&&a in e){let s=e[a];if(s&&typeof s=="string"){let l=chunk7L2KNZGU_cjs.a(s).split(" "),f=[];for(let o=0;o<l.length;o++)f.push(`${t}:${l[o]}`);r[a]=r[a]?r[a].concat(f):f;}else if(Array.isArray(s)&&s.length>0){let i=[];for(let l=0;l<s.length;l++)i.push(`${t}:${s[l]}`);r[a]=i;}}return r},W=(t,e=p,n=null,a=null)=>{let r=e[t];if(!r||chunk7L2KNZGU_cjs.d(r))return null;let s=a?.[t]??h?.[t];if(s===null)return null;let i=chunk7L2KNZGU_cjs.c(s),l=Array.isArray(d.responsiveVariants)&&d.responsiveVariants.length>0||d.responsiveVariants===true,f=E?.[t],o=[];if(typeof i=="object"&&l)for(let[C,H]of Object.entries(i)){let te=r[H];if(C==="initial"){f=H;continue}Array.isArray(d.responsiveVariants)&&!d.responsiveVariants.includes(C)||(o=Y(C,te,o,n));}let V=i!=null&&typeof i!="object"?i:chunk7L2KNZGU_cjs.c(f),m=r[V||"false"];return typeof o=="object"&&typeof n=="string"&&o[n]?chunk7L2KNZGU_cjs.g(o,m):o.length>0?(o.push(m),n==="base"?o.join(" "):o):m},Z=()=>{if(!p)return null;let t=Object.keys(p),e=[];for(let n=0;n<t.length;n++){let a=W(t[n],p);a&&e.push(a);}return e},_=(t,e)=>{if(!p||typeof p!="object")return null;let n=[];for(let a in p){let r=W(a,p,t,e),s=t==="base"&&typeof r=="string"?r:r&&r[t];s&&n.push(s);}return n},z={};for(let t in h){let e=h[t];e!==void 0&&(z[t]=e);}let D=(t,e)=>{let n=typeof h?.[t]=="object"?{[t]:h[t]?.initial}:{};return {...E,...z,...n,...e}},G=(t=[],e)=>{let n=[],a=t.length;for(let r=0;r<a;r++){let{class:s,className:i,...l}=t[r],f=true,o=D(null,e);for(let V in l){let m=l[V],C=o[V];if(Array.isArray(m)){if(!m.includes(C)){f=false;break}}else {if((m==null||m===false)&&(C==null||C===false))continue;if(C!==m){f=false;break}}}f&&(s&&n.push(s),i&&n.push(i));}return n},K=t=>{let e=G(T,t);if(!Array.isArray(e))return e;let n={},a=b;for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="string")n.base=a(n.base,s)(d);else if(typeof s=="object")for(let i in s)n[i]=a(n[i],s[i])(d);}return n},ee=t=>{if(v.length<1)return null;let e={},n=D(null,t);for(let a=0;a<v.length;a++){let{slots:r=[],class:s,className:i,...l}=v[a];if(!chunk7L2KNZGU_cjs.d(l)){let f=true;for(let o in l){let V=n[o],m=l[o];if(V===void 0||(Array.isArray(m)?!m.includes(V):m!==V)){f=false;break}}if(!f)continue}for(let f=0;f<r.length;f++){let o=r[f];e[o]||(e[o]=[]),e[o].push([s,i]);}}return e};if(!chunk7L2KNZGU_cjs.d(M)||!N){let t={};if(typeof j=="object"&&!chunk7L2KNZGU_cjs.d(j)){let e=b;for(let n in j)t[n]=a=>{let r=K(a),s=ee(a);return e(j[n],_(n,a),r?r[n]:void 0,s?s[n]:void 0,a?.class,a?.className)(d)};}return t}return b(x,Z(),G(T),h?.class,h?.className)(d)},X=()=>{if(!(!p||typeof p!="object"))return Object.keys(p)};return y.variantKeys=X(),y.extend=c,y.base=x,y.slots=j,y.variants=p,y.defaultVariants=E,y.compoundSlots=v,y.compoundVariants=T,y};return {tv:w,createTV:u=>($,c)=>w($,c?chunk7L2KNZGU_cjs.k(u,c):u)}};exports.a=Q;exports.b=S;exports.c=le;
|
package/dist/config.d.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkWBJQ6REG_cjs=require('./chunk-WBJQ6REG.cjs'),chunk7L2KNZGU_cjs=require('./chunk-7L2KNZGU.cjs'),tailwindMerge=require('tailwind-merge');var f=e=>chunk7L2KNZGU_cjs.d(e)?tailwindMerge.twMerge:tailwindMerge.extendTailwindMerge({...e,extend:{theme:e.theme,classGroups:e.classGroups,conflictingClassGroupModifiers:e.conflictingClassGroupModifiers,conflictingClassGroups:e.conflictingClassGroups,...e.extend}}),i=(...e)=>a=>{let t=chunk7L2KNZGU_cjs.b(e);return !t||!a.twMerge?t:((!chunkWBJQ6REG_cjs.b.cachedTwMerge||chunkWBJQ6REG_cjs.b.didTwMergeConfigChange)&&(chunkWBJQ6REG_cjs.b.didTwMergeConfigChange=false,chunkWBJQ6REG_cjs.b.cachedTwMerge=f(chunkWBJQ6REG_cjs.b.cachedTwMergeConfig)),chunkWBJQ6REG_cjs.b.cachedTwMerge(t)||void 0)};var {createTV:C,tv:T}=chunkWBJQ6REG_cjs.c(i);Object.defineProperty(exports,"defaultConfig",{enumerable:true,get:function(){return chunkWBJQ6REG_cjs.a}});Object.defineProperty(exports,"cnBase",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.b}});exports.cn=i;exports.createTV=C;exports.tv=T;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,340 +1,13 @@
|
|
|
1
|
-
import type {ClassNameValue as ClassValue} from "tailwind-merge";
|
|
2
|
-
|
|
3
1
|
import {TVConfig, TWMConfig} from "./config";
|
|
2
|
+
import {CnOptions, CnReturn, TV} from "./types";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
* ----------------------------------------
|
|
7
|
-
* Base Types
|
|
8
|
-
* ----------------------------------------
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export type {ClassValue};
|
|
12
|
-
|
|
13
|
-
export type ClassProp<V extends unknown = ClassValue> =
|
|
14
|
-
| {class?: V; className?: never}
|
|
15
|
-
| {class?: never; className?: V};
|
|
16
|
-
|
|
17
|
-
type TVBaseName = "base";
|
|
18
|
-
|
|
19
|
-
type TVScreens = "initial";
|
|
20
|
-
|
|
21
|
-
type TVSlots = Record<string, ClassValue> | undefined;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* ----------------------------------------------------------------------
|
|
25
|
-
* Utils
|
|
26
|
-
* ----------------------------------------------------------------------
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
export type OmitUndefined<T> = T extends undefined ? never : T;
|
|
30
|
-
|
|
31
|
-
export type StringToBoolean<T> = T extends "true" | "false" ? boolean : T;
|
|
32
|
-
|
|
33
|
-
export type CnOptions = ClassValue[];
|
|
34
|
-
|
|
35
|
-
export type CnReturn = string | undefined;
|
|
4
|
+
export * from "./types";
|
|
36
5
|
|
|
37
6
|
export declare const cnBase: <T extends CnOptions>(...classes: T) => CnReturn;
|
|
38
7
|
|
|
39
8
|
export declare const cn: <T extends CnOptions>(...classes: T) => (config?: TWMConfig) => CnReturn;
|
|
40
9
|
|
|
41
|
-
// compare if the value is true or array of values
|
|
42
|
-
export type isTrueOrArray<T> = T extends true | unknown[] ? true : false;
|
|
43
|
-
|
|
44
|
-
export type WithInitialScreen<T extends Array<string>> = ["initial", ...T];
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* ----------------------------------------------------------------------
|
|
48
|
-
* TV Types
|
|
49
|
-
* ----------------------------------------------------------------------
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
type TVSlotsWithBase<S extends TVSlots, B extends ClassValue> = B extends undefined
|
|
53
|
-
? keyof S
|
|
54
|
-
: keyof S | TVBaseName;
|
|
55
|
-
|
|
56
|
-
type SlotsClassValue<S extends TVSlots, B extends ClassValue> = {
|
|
57
|
-
[K in TVSlotsWithBase<S, B>]?: ClassValue;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
type TVVariantsDefault<S extends TVSlots, B extends ClassValue> = S extends undefined
|
|
61
|
-
? {}
|
|
62
|
-
: {
|
|
63
|
-
[key: string]: {
|
|
64
|
-
[key: string]: S extends TVSlots ? SlotsClassValue<S, B> | ClassValue : ClassValue;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export type TVVariants<
|
|
69
|
-
S extends TVSlots | undefined,
|
|
70
|
-
B extends ClassValue | undefined = undefined,
|
|
71
|
-
EV extends TVVariants<ES> | undefined = undefined,
|
|
72
|
-
ES extends TVSlots | undefined = undefined,
|
|
73
|
-
> = EV extends undefined
|
|
74
|
-
? TVVariantsDefault<S, B>
|
|
75
|
-
:
|
|
76
|
-
| {
|
|
77
|
-
[K in keyof EV]: {
|
|
78
|
-
[K2 in keyof EV[K]]: S extends TVSlots
|
|
79
|
-
? SlotsClassValue<S, B> | ClassValue
|
|
80
|
-
: ClassValue;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
| TVVariantsDefault<S, B>;
|
|
84
|
-
|
|
85
|
-
export type TVCompoundVariants<
|
|
86
|
-
V extends TVVariants<S>,
|
|
87
|
-
S extends TVSlots,
|
|
88
|
-
B extends ClassValue,
|
|
89
|
-
EV extends TVVariants<ES>,
|
|
90
|
-
ES extends TVSlots,
|
|
91
|
-
> = Array<
|
|
92
|
-
{
|
|
93
|
-
[K in keyof V | keyof EV]?:
|
|
94
|
-
| (K extends keyof V ? StringToBoolean<keyof V[K]> : never)
|
|
95
|
-
| (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never)
|
|
96
|
-
| (K extends keyof V ? StringToBoolean<keyof V[K]>[] : never);
|
|
97
|
-
} & ClassProp<SlotsClassValue<S, B> | ClassValue>
|
|
98
|
-
>;
|
|
99
|
-
|
|
100
|
-
export type TVCompoundSlots<
|
|
101
|
-
V extends TVVariants<S>,
|
|
102
|
-
S extends TVSlots,
|
|
103
|
-
B extends ClassValue,
|
|
104
|
-
> = Array<
|
|
105
|
-
V extends undefined
|
|
106
|
-
? {
|
|
107
|
-
slots: Array<TVSlotsWithBase<S, B>>;
|
|
108
|
-
} & ClassProp
|
|
109
|
-
: {
|
|
110
|
-
slots: Array<TVSlotsWithBase<S, B>>;
|
|
111
|
-
} & {
|
|
112
|
-
[K in keyof V]?: StringToBoolean<keyof V[K]> | StringToBoolean<keyof V[K]>[];
|
|
113
|
-
} & ClassProp
|
|
114
|
-
>;
|
|
115
|
-
|
|
116
|
-
export type TVDefaultVariants<
|
|
117
|
-
V extends TVVariants<S>,
|
|
118
|
-
S extends TVSlots,
|
|
119
|
-
EV extends TVVariants<ES>,
|
|
120
|
-
ES extends TVSlots,
|
|
121
|
-
> = {
|
|
122
|
-
[K in keyof V | keyof EV]?:
|
|
123
|
-
| (K extends keyof V ? StringToBoolean<keyof V[K]> : never)
|
|
124
|
-
| (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
export type TVScreenPropsValue<V extends TVVariants<S>, S extends TVSlots, K extends keyof V> = {
|
|
128
|
-
[Screen in TVScreens]?: StringToBoolean<keyof V[K]>;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
export type TVProps<
|
|
132
|
-
V extends TVVariants<S>,
|
|
133
|
-
S extends TVSlots,
|
|
134
|
-
EV extends TVVariants<ES>,
|
|
135
|
-
ES extends TVSlots,
|
|
136
|
-
> = EV extends undefined
|
|
137
|
-
? V extends undefined
|
|
138
|
-
? ClassProp<ClassValue>
|
|
139
|
-
: {
|
|
140
|
-
[K in keyof V]?: StringToBoolean<keyof V[K]> | undefined;
|
|
141
|
-
} & ClassProp<ClassValue>
|
|
142
|
-
: V extends undefined
|
|
143
|
-
? {
|
|
144
|
-
[K in keyof EV]?: StringToBoolean<keyof EV[K]> | undefined;
|
|
145
|
-
} & ClassProp<ClassValue>
|
|
146
|
-
: {
|
|
147
|
-
[K in keyof V | keyof EV]?:
|
|
148
|
-
| (K extends keyof V ? StringToBoolean<keyof V[K]> : never)
|
|
149
|
-
| (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never)
|
|
150
|
-
| undefined;
|
|
151
|
-
} & ClassProp<ClassValue>;
|
|
152
|
-
|
|
153
|
-
export type TVVariantKeys<V extends TVVariants<S>, S extends TVSlots> = V extends Object
|
|
154
|
-
? Array<keyof V>
|
|
155
|
-
: undefined;
|
|
156
|
-
|
|
157
|
-
export type TVReturnProps<
|
|
158
|
-
V extends TVVariants<S>,
|
|
159
|
-
S extends TVSlots,
|
|
160
|
-
B extends ClassValue,
|
|
161
|
-
EV extends TVVariants<ES>,
|
|
162
|
-
ES extends TVSlots,
|
|
163
|
-
// @ts-expect-error
|
|
164
|
-
E extends TVReturnType = undefined,
|
|
165
|
-
> = {
|
|
166
|
-
extend: E;
|
|
167
|
-
base: B;
|
|
168
|
-
slots: S;
|
|
169
|
-
variants: V;
|
|
170
|
-
defaultVariants: TVDefaultVariants<V, S, EV, ES>;
|
|
171
|
-
compoundVariants: TVCompoundVariants<V, S, B, EV, ES>;
|
|
172
|
-
compoundSlots: TVCompoundSlots<V, S, B>;
|
|
173
|
-
variantKeys: TVVariantKeys<V, S>;
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
type HasSlots<S extends TVSlots, ES extends TVSlots> = S extends undefined
|
|
177
|
-
? ES extends undefined
|
|
178
|
-
? false
|
|
179
|
-
: true
|
|
180
|
-
: true;
|
|
181
|
-
|
|
182
|
-
export type TVReturnType<
|
|
183
|
-
V extends TVVariants<S>,
|
|
184
|
-
S extends TVSlots,
|
|
185
|
-
B extends ClassValue,
|
|
186
|
-
EV extends TVVariants<ES>,
|
|
187
|
-
ES extends TVSlots,
|
|
188
|
-
// @ts-expect-error
|
|
189
|
-
E extends TVReturnType = undefined,
|
|
190
|
-
> = {
|
|
191
|
-
(props?: TVProps<V, S, EV, ES>): HasSlots<S, ES> extends true
|
|
192
|
-
? {
|
|
193
|
-
[K in keyof (ES extends undefined ? {} : ES)]: (
|
|
194
|
-
slotProps?: TVProps<V, S, EV, ES>,
|
|
195
|
-
) => string;
|
|
196
|
-
} & {
|
|
197
|
-
[K in keyof (S extends undefined ? {} : S)]: (slotProps?: TVProps<V, S, EV, ES>) => string;
|
|
198
|
-
} & {
|
|
199
|
-
[K in TVSlotsWithBase<{}, B>]: (slotProps?: TVProps<V, S, EV, ES>) => string;
|
|
200
|
-
}
|
|
201
|
-
: string;
|
|
202
|
-
} & TVReturnProps<V, S, B, EV, ES, E>;
|
|
203
|
-
|
|
204
|
-
export type TV = {
|
|
205
|
-
<
|
|
206
|
-
V extends TVVariants<S, B, EV>,
|
|
207
|
-
CV extends TVCompoundVariants<V, S, B, EV, ES>,
|
|
208
|
-
DV extends TVDefaultVariants<V, S, EV, ES>,
|
|
209
|
-
B extends ClassValue = undefined,
|
|
210
|
-
S extends TVSlots = undefined,
|
|
211
|
-
// @ts-expect-error
|
|
212
|
-
E extends TVReturnType = TVReturnType<
|
|
213
|
-
V,
|
|
214
|
-
S,
|
|
215
|
-
B,
|
|
216
|
-
// @ts-expect-error
|
|
217
|
-
EV extends undefined ? {} : EV,
|
|
218
|
-
// @ts-expect-error
|
|
219
|
-
ES extends undefined ? {} : ES
|
|
220
|
-
>,
|
|
221
|
-
EV extends TVVariants<ES, B, E["variants"], ES> = E["variants"],
|
|
222
|
-
ES extends TVSlots = E["slots"] extends TVSlots ? E["slots"] : undefined,
|
|
223
|
-
>(
|
|
224
|
-
options: {
|
|
225
|
-
/**
|
|
226
|
-
* Extend allows for easy composition of components.
|
|
227
|
-
* @see https://www.tailwind-variants.org/docs/composing-components
|
|
228
|
-
*/
|
|
229
|
-
extend?: E;
|
|
230
|
-
/**
|
|
231
|
-
* Base allows you to set a base class for a component.
|
|
232
|
-
*/
|
|
233
|
-
base?: B;
|
|
234
|
-
/**
|
|
235
|
-
* Slots allow you to separate a component into multiple parts.
|
|
236
|
-
* @see https://www.tailwind-variants.org/docs/slots
|
|
237
|
-
*/
|
|
238
|
-
slots?: S;
|
|
239
|
-
/**
|
|
240
|
-
* Variants allow you to create multiple versions of the same component.
|
|
241
|
-
* @see https://www.tailwind-variants.org/docs/variants#adding-variants
|
|
242
|
-
*/
|
|
243
|
-
variants?: V;
|
|
244
|
-
/**
|
|
245
|
-
* Compound variants allow you to apply classes to multiple variants at once.
|
|
246
|
-
* @see https://www.tailwind-variants.org/docs/variants#compound-variants
|
|
247
|
-
*/
|
|
248
|
-
compoundVariants?: CV;
|
|
249
|
-
/**
|
|
250
|
-
* Compound slots allow you to apply classes to multiple slots at once.
|
|
251
|
-
*/
|
|
252
|
-
compoundSlots?: TVCompoundSlots<V, S, B>;
|
|
253
|
-
/**
|
|
254
|
-
* Default variants allow you to set default variants for a component.
|
|
255
|
-
* @see https://www.tailwind-variants.org/docs/variants#default-variants
|
|
256
|
-
*/
|
|
257
|
-
defaultVariants?: DV;
|
|
258
|
-
},
|
|
259
|
-
/**
|
|
260
|
-
* The config object allows you to modify the default configuration.
|
|
261
|
-
* @see https://www.tailwind-variants.org/docs/api-reference#config-optional
|
|
262
|
-
*/
|
|
263
|
-
config?: TVConfig,
|
|
264
|
-
): TVReturnType<V, S, B, EV, ES, E>;
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
export type CreateTV = {
|
|
268
|
-
<
|
|
269
|
-
V extends TVVariants<S, B, EV>,
|
|
270
|
-
CV extends TVCompoundVariants<V, S, B, EV, ES>,
|
|
271
|
-
DV extends TVDefaultVariants<V, S, EV, ES>,
|
|
272
|
-
B extends ClassValue = undefined,
|
|
273
|
-
S extends TVSlots = undefined,
|
|
274
|
-
// @ts-expect-error
|
|
275
|
-
E extends TVReturnType = TVReturnType<
|
|
276
|
-
V,
|
|
277
|
-
S,
|
|
278
|
-
B,
|
|
279
|
-
// @ts-expect-error
|
|
280
|
-
EV extends undefined ? {} : EV,
|
|
281
|
-
// @ts-expect-error
|
|
282
|
-
ES extends undefined ? {} : ES
|
|
283
|
-
>,
|
|
284
|
-
EV extends TVVariants<ES, B, E["variants"], ES> = E["variants"],
|
|
285
|
-
ES extends TVSlots = E["slots"] extends TVSlots ? E["slots"] : undefined,
|
|
286
|
-
>(
|
|
287
|
-
options: {
|
|
288
|
-
/**
|
|
289
|
-
* Extend allows for easy composition of components.
|
|
290
|
-
* @see https://www.tailwind-variants.org/docs/composing-components
|
|
291
|
-
*/
|
|
292
|
-
extend?: E;
|
|
293
|
-
/**
|
|
294
|
-
* Base allows you to set a base class for a component.
|
|
295
|
-
*/
|
|
296
|
-
base?: B;
|
|
297
|
-
/**
|
|
298
|
-
* Slots allow you to separate a component into multiple parts.
|
|
299
|
-
* @see https://www.tailwind-variants.org/docs/slots
|
|
300
|
-
*/
|
|
301
|
-
slots?: S;
|
|
302
|
-
/**
|
|
303
|
-
* Variants allow you to create multiple versions of the same component.
|
|
304
|
-
* @see https://www.tailwind-variants.org/docs/variants#adding-variants
|
|
305
|
-
*/
|
|
306
|
-
variants?: V;
|
|
307
|
-
/**
|
|
308
|
-
* Compound variants allow you to apply classes to multiple variants at once.
|
|
309
|
-
* @see https://www.tailwind-variants.org/docs/variants#compound-variants
|
|
310
|
-
*/
|
|
311
|
-
compoundVariants?: CV;
|
|
312
|
-
/**
|
|
313
|
-
* Compound slots allow you to apply classes to multiple slots at once.
|
|
314
|
-
*/
|
|
315
|
-
compoundSlots?: TVCompoundSlots<V, S, B>;
|
|
316
|
-
/**
|
|
317
|
-
* Default variants allow you to set default variants for a component.
|
|
318
|
-
* @see https://www.tailwind-variants.org/docs/variants#default-variants
|
|
319
|
-
*/
|
|
320
|
-
defaultVariants?: DV;
|
|
321
|
-
},
|
|
322
|
-
/**
|
|
323
|
-
* The config object allows you to modify the default configuration.
|
|
324
|
-
* @see https://www.tailwind-variants.org/docs/api-reference#config-optional
|
|
325
|
-
*/
|
|
326
|
-
config?: TVConfig,
|
|
327
|
-
): TVReturnType<V, S, B, EV, ES, E>;
|
|
328
|
-
};
|
|
329
|
-
|
|
330
10
|
// main function
|
|
331
11
|
export declare const tv: TV;
|
|
332
12
|
|
|
333
|
-
export declare function createTV(config: TVConfig):
|
|
334
|
-
|
|
335
|
-
export declare const defaultConfig: TVConfig;
|
|
336
|
-
|
|
337
|
-
export type VariantProps<Component extends (...args: any) => any> = Omit<
|
|
338
|
-
OmitUndefined<Parameters<Component>[0]>,
|
|
339
|
-
"class" | "className"
|
|
340
|
-
>;
|
|
13
|
+
export declare function createTV(config: TVConfig): TV;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {c,b as b$1}from'./chunk-IFWU2MEM.js';export{a as defaultConfig}from'./chunk-IFWU2MEM.js';import {b,d}from'./chunk-GQLG7IS2.js';export{b as cnBase}from'./chunk-GQLG7IS2.js';import {twMerge,extendTailwindMerge}from'tailwind-merge';var f=e=>d(e)?twMerge:extendTailwindMerge({...e,extend:{theme:e.theme,classGroups:e.classGroups,conflictingClassGroupModifiers:e.conflictingClassGroupModifiers,conflictingClassGroups:e.conflictingClassGroups,...e.extend}}),i=(...e)=>a=>{let t=b(e);return !t||!a.twMerge?t:((!b$1.cachedTwMerge||b$1.didTwMergeConfigChange)&&(b$1.didTwMergeConfigChange=false,b$1.cachedTwMerge=f(b$1.cachedTwMergeConfig)),b$1.cachedTwMerge(t)||void 0)};var {createTV:C,tv:T}=c(i);export{i as cn,C as createTV,T as tv};
|
package/dist/lite.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkWBJQ6REG_cjs=require('./chunk-WBJQ6REG.cjs'),chunk7L2KNZGU_cjs=require('./chunk-7L2KNZGU.cjs');var o=(...e)=>a=>chunk7L2KNZGU_cjs.b(e)||void 0,{createTV:p,tv:m}=chunkWBJQ6REG_cjs.c(o);Object.defineProperty(exports,"defaultConfig",{enumerable:true,get:function(){return chunkWBJQ6REG_cjs.a}});Object.defineProperty(exports,"cn",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.b}});Object.defineProperty(exports,"cnBase",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.b}});exports.cnAdapter=o;exports.createTV=p;exports.tv=m;
|
package/dist/lite.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {CnOptions, CnReturn, TVLite} from "./types";
|
|
2
|
+
|
|
3
|
+
export * from "./types";
|
|
4
|
+
|
|
5
|
+
export declare const cnBase: <T extends CnOptions>(...classes: T) => CnReturn;
|
|
6
|
+
|
|
7
|
+
export declare const cn: <T extends CnOptions>(...classes: T) => CnReturn;
|
|
8
|
+
|
|
9
|
+
// main function
|
|
10
|
+
export declare const tv: TVLite;
|
|
11
|
+
|
|
12
|
+
export declare function createTV(): TVLite;
|
package/dist/lite.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c}from'./chunk-IFWU2MEM.js';export{a as defaultConfig}from'./chunk-IFWU2MEM.js';import {b}from'./chunk-GQLG7IS2.js';export{b as cn,b as cnBase}from'./chunk-GQLG7IS2.js';var o=(...e)=>a=>b(e)||void 0,{createTV:p,tv:m}=c(o);export{o as cnAdapter,p as createTV,m as tv};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import type {ClassNameValue as ClassValue} from "tailwind-merge";
|
|
2
|
+
|
|
3
|
+
import {TVConfig} from "./config";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* ----------------------------------------
|
|
7
|
+
* Base Types
|
|
8
|
+
* ----------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export type {ClassValue};
|
|
12
|
+
|
|
13
|
+
export type ClassProp<V extends unknown = ClassValue> =
|
|
14
|
+
| {class?: V; className?: never}
|
|
15
|
+
| {class?: never; className?: V};
|
|
16
|
+
|
|
17
|
+
type TVBaseName = "base";
|
|
18
|
+
|
|
19
|
+
type TVScreens = "initial";
|
|
20
|
+
|
|
21
|
+
type TVSlots = Record<string, ClassValue> | undefined;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* ----------------------------------------------------------------------
|
|
25
|
+
* Utils
|
|
26
|
+
* ----------------------------------------------------------------------
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
export type OmitUndefined<T> = T extends undefined ? never : T;
|
|
30
|
+
|
|
31
|
+
export type StringToBoolean<T> = T extends "true" | "false" ? boolean : T;
|
|
32
|
+
|
|
33
|
+
type CnClassValue =
|
|
34
|
+
| string
|
|
35
|
+
| number
|
|
36
|
+
| bigint
|
|
37
|
+
| boolean
|
|
38
|
+
| null
|
|
39
|
+
| undefined
|
|
40
|
+
| CnClassDictionary
|
|
41
|
+
| CnClassArray;
|
|
42
|
+
|
|
43
|
+
interface CnClassDictionary {
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface CnClassArray extends Array<CnClassValue> {}
|
|
48
|
+
|
|
49
|
+
export type CnOptions = CnClassValue[];
|
|
50
|
+
|
|
51
|
+
export type CnReturn = string | undefined;
|
|
52
|
+
|
|
53
|
+
// compare if the value is true or array of values
|
|
54
|
+
export type isTrueOrArray<T> = T extends true | unknown[] ? true : false;
|
|
55
|
+
|
|
56
|
+
export type WithInitialScreen<T extends Array<string>> = ["initial", ...T];
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* ----------------------------------------------------------------------
|
|
60
|
+
* TV Types
|
|
61
|
+
* ----------------------------------------------------------------------
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
type TVSlotsWithBase<S extends TVSlots, B extends ClassValue> = B extends undefined
|
|
65
|
+
? keyof S
|
|
66
|
+
: keyof S | TVBaseName;
|
|
67
|
+
|
|
68
|
+
type SlotsClassValue<S extends TVSlots, B extends ClassValue> = {
|
|
69
|
+
[K in TVSlotsWithBase<S, B>]?: ClassValue;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
type TVVariantsDefault<S extends TVSlots, B extends ClassValue> = S extends undefined
|
|
73
|
+
? {}
|
|
74
|
+
: {
|
|
75
|
+
[key: string]: {
|
|
76
|
+
[key: string]: S extends TVSlots ? SlotsClassValue<S, B> | ClassValue : ClassValue;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type TVVariants<
|
|
81
|
+
S extends TVSlots | undefined,
|
|
82
|
+
B extends ClassValue | undefined = undefined,
|
|
83
|
+
EV extends TVVariants<ES> | undefined = undefined,
|
|
84
|
+
ES extends TVSlots | undefined = undefined,
|
|
85
|
+
> = EV extends undefined
|
|
86
|
+
? TVVariantsDefault<S, B>
|
|
87
|
+
:
|
|
88
|
+
| {
|
|
89
|
+
[K in keyof EV]: {
|
|
90
|
+
[K2 in keyof EV[K]]: S extends TVSlots
|
|
91
|
+
? SlotsClassValue<S, B> | ClassValue
|
|
92
|
+
: ClassValue;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
| TVVariantsDefault<S, B>;
|
|
96
|
+
|
|
97
|
+
export type TVCompoundVariants<
|
|
98
|
+
V extends TVVariants<S>,
|
|
99
|
+
S extends TVSlots,
|
|
100
|
+
B extends ClassValue,
|
|
101
|
+
EV extends TVVariants<ES>,
|
|
102
|
+
ES extends TVSlots,
|
|
103
|
+
> = Array<
|
|
104
|
+
{
|
|
105
|
+
[K in keyof V | keyof EV]?:
|
|
106
|
+
| (K extends keyof V ? StringToBoolean<keyof V[K]> : never)
|
|
107
|
+
| (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never)
|
|
108
|
+
| (K extends keyof V ? StringToBoolean<keyof V[K]>[] : never);
|
|
109
|
+
} & ClassProp<SlotsClassValue<S, B> | ClassValue>
|
|
110
|
+
>;
|
|
111
|
+
|
|
112
|
+
export type TVCompoundSlots<
|
|
113
|
+
V extends TVVariants<S>,
|
|
114
|
+
S extends TVSlots,
|
|
115
|
+
B extends ClassValue,
|
|
116
|
+
> = Array<
|
|
117
|
+
V extends undefined
|
|
118
|
+
? {
|
|
119
|
+
slots: Array<TVSlotsWithBase<S, B>>;
|
|
120
|
+
} & ClassProp
|
|
121
|
+
: {
|
|
122
|
+
slots: Array<TVSlotsWithBase<S, B>>;
|
|
123
|
+
} & {
|
|
124
|
+
[K in keyof V]?: StringToBoolean<keyof V[K]> | StringToBoolean<keyof V[K]>[];
|
|
125
|
+
} & ClassProp
|
|
126
|
+
>;
|
|
127
|
+
|
|
128
|
+
export type TVDefaultVariants<
|
|
129
|
+
V extends TVVariants<S>,
|
|
130
|
+
S extends TVSlots,
|
|
131
|
+
EV extends TVVariants<ES>,
|
|
132
|
+
ES extends TVSlots,
|
|
133
|
+
> = {
|
|
134
|
+
[K in keyof V | keyof EV]?:
|
|
135
|
+
| (K extends keyof V ? StringToBoolean<keyof V[K]> : never)
|
|
136
|
+
| (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export type TVScreenPropsValue<V extends TVVariants<S>, S extends TVSlots, K extends keyof V> = {
|
|
140
|
+
[Screen in TVScreens]?: StringToBoolean<keyof V[K]>;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export type TVProps<
|
|
144
|
+
V extends TVVariants<S>,
|
|
145
|
+
S extends TVSlots,
|
|
146
|
+
EV extends TVVariants<ES>,
|
|
147
|
+
ES extends TVSlots,
|
|
148
|
+
> = EV extends undefined
|
|
149
|
+
? V extends undefined
|
|
150
|
+
? ClassProp<ClassValue>
|
|
151
|
+
: {
|
|
152
|
+
[K in keyof V]?: StringToBoolean<keyof V[K]> | undefined;
|
|
153
|
+
} & ClassProp<ClassValue>
|
|
154
|
+
: V extends undefined
|
|
155
|
+
? {
|
|
156
|
+
[K in keyof EV]?: StringToBoolean<keyof EV[K]> | undefined;
|
|
157
|
+
} & ClassProp<ClassValue>
|
|
158
|
+
: {
|
|
159
|
+
[K in keyof V | keyof EV]?:
|
|
160
|
+
| (K extends keyof V ? StringToBoolean<keyof V[K]> : never)
|
|
161
|
+
| (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never)
|
|
162
|
+
| undefined;
|
|
163
|
+
} & ClassProp<ClassValue>;
|
|
164
|
+
|
|
165
|
+
export type TVVariantKeys<V extends TVVariants<S>, S extends TVSlots> = V extends Object
|
|
166
|
+
? Array<keyof V>
|
|
167
|
+
: undefined;
|
|
168
|
+
|
|
169
|
+
export type TVReturnProps<
|
|
170
|
+
V extends TVVariants<S>,
|
|
171
|
+
S extends TVSlots,
|
|
172
|
+
B extends ClassValue,
|
|
173
|
+
EV extends TVVariants<ES>,
|
|
174
|
+
ES extends TVSlots,
|
|
175
|
+
// @ts-expect-error
|
|
176
|
+
E extends TVReturnType = undefined,
|
|
177
|
+
> = {
|
|
178
|
+
extend: E;
|
|
179
|
+
base: B;
|
|
180
|
+
slots: S;
|
|
181
|
+
variants: V;
|
|
182
|
+
defaultVariants: TVDefaultVariants<V, S, EV, ES>;
|
|
183
|
+
compoundVariants: TVCompoundVariants<V, S, B, EV, ES>;
|
|
184
|
+
compoundSlots: TVCompoundSlots<V, S, B>;
|
|
185
|
+
variantKeys: TVVariantKeys<V, S>;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
type HasSlots<S extends TVSlots, ES extends TVSlots> = S extends undefined
|
|
189
|
+
? ES extends undefined
|
|
190
|
+
? false
|
|
191
|
+
: true
|
|
192
|
+
: true;
|
|
193
|
+
|
|
194
|
+
export type TVReturnType<
|
|
195
|
+
V extends TVVariants<S>,
|
|
196
|
+
S extends TVSlots,
|
|
197
|
+
B extends ClassValue,
|
|
198
|
+
EV extends TVVariants<ES>,
|
|
199
|
+
ES extends TVSlots,
|
|
200
|
+
// @ts-expect-error
|
|
201
|
+
E extends TVReturnType = undefined,
|
|
202
|
+
> = {
|
|
203
|
+
(props?: TVProps<V, S, EV, ES>): HasSlots<S, ES> extends true
|
|
204
|
+
? {
|
|
205
|
+
[K in keyof (ES extends undefined ? {} : ES)]: (
|
|
206
|
+
slotProps?: TVProps<V, S, EV, ES>,
|
|
207
|
+
) => string;
|
|
208
|
+
} & {
|
|
209
|
+
[K in keyof (S extends undefined ? {} : S)]: (slotProps?: TVProps<V, S, EV, ES>) => string;
|
|
210
|
+
} & {
|
|
211
|
+
[K in TVSlotsWithBase<{}, B>]: (slotProps?: TVProps<V, S, EV, ES>) => string;
|
|
212
|
+
}
|
|
213
|
+
: string;
|
|
214
|
+
} & TVReturnProps<V, S, B, EV, ES, E>;
|
|
215
|
+
|
|
216
|
+
export type TV = {
|
|
217
|
+
<
|
|
218
|
+
V extends TVVariants<S, B, EV>,
|
|
219
|
+
CV extends TVCompoundVariants<V, S, B, EV, ES>,
|
|
220
|
+
DV extends TVDefaultVariants<V, S, EV, ES>,
|
|
221
|
+
B extends ClassValue = undefined,
|
|
222
|
+
S extends TVSlots = undefined,
|
|
223
|
+
// @ts-expect-error
|
|
224
|
+
E extends TVReturnType = TVReturnType<
|
|
225
|
+
V,
|
|
226
|
+
S,
|
|
227
|
+
B,
|
|
228
|
+
// @ts-expect-error
|
|
229
|
+
EV extends undefined ? {} : EV,
|
|
230
|
+
// @ts-expect-error
|
|
231
|
+
ES extends undefined ? {} : ES
|
|
232
|
+
>,
|
|
233
|
+
EV extends TVVariants<ES, B, E["variants"], ES> = E["variants"],
|
|
234
|
+
ES extends TVSlots = E["slots"] extends TVSlots ? E["slots"] : undefined,
|
|
235
|
+
>(
|
|
236
|
+
options: {
|
|
237
|
+
/**
|
|
238
|
+
* Extend allows for easy composition of components.
|
|
239
|
+
* @see https://www.tailwind-variants.org/docs/composing-components
|
|
240
|
+
*/
|
|
241
|
+
extend?: E;
|
|
242
|
+
/**
|
|
243
|
+
* Base allows you to set a base class for a component.
|
|
244
|
+
*/
|
|
245
|
+
base?: B;
|
|
246
|
+
/**
|
|
247
|
+
* Slots allow you to separate a component into multiple parts.
|
|
248
|
+
* @see https://www.tailwind-variants.org/docs/slots
|
|
249
|
+
*/
|
|
250
|
+
slots?: S;
|
|
251
|
+
/**
|
|
252
|
+
* Variants allow you to create multiple versions of the same component.
|
|
253
|
+
* @see https://www.tailwind-variants.org/docs/variants#adding-variants
|
|
254
|
+
*/
|
|
255
|
+
variants?: V;
|
|
256
|
+
/**
|
|
257
|
+
* Compound variants allow you to apply classes to multiple variants at once.
|
|
258
|
+
* @see https://www.tailwind-variants.org/docs/variants#compound-variants
|
|
259
|
+
*/
|
|
260
|
+
compoundVariants?: CV;
|
|
261
|
+
/**
|
|
262
|
+
* Compound slots allow you to apply classes to multiple slots at once.
|
|
263
|
+
*/
|
|
264
|
+
compoundSlots?: TVCompoundSlots<V, S, B>;
|
|
265
|
+
/**
|
|
266
|
+
* Default variants allow you to set default variants for a component.
|
|
267
|
+
* @see https://www.tailwind-variants.org/docs/variants#default-variants
|
|
268
|
+
*/
|
|
269
|
+
defaultVariants?: DV;
|
|
270
|
+
},
|
|
271
|
+
/**
|
|
272
|
+
* The config object allows you to modify the default configuration.
|
|
273
|
+
* @see https://www.tailwind-variants.org/docs/api-reference#config-optional
|
|
274
|
+
*/
|
|
275
|
+
config?: TVConfig,
|
|
276
|
+
): TVReturnType<V, S, B, EV, ES, E>;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export type TVLite = {
|
|
280
|
+
<
|
|
281
|
+
V extends TVVariants<S, B, EV>,
|
|
282
|
+
CV extends TVCompoundVariants<V, S, B, EV, ES>,
|
|
283
|
+
DV extends TVDefaultVariants<V, S, EV, ES>,
|
|
284
|
+
B extends ClassValue = undefined,
|
|
285
|
+
S extends TVSlots = undefined,
|
|
286
|
+
// @ts-expect-error
|
|
287
|
+
E extends TVReturnType = TVReturnType<
|
|
288
|
+
V,
|
|
289
|
+
S,
|
|
290
|
+
B,
|
|
291
|
+
// @ts-expect-error
|
|
292
|
+
EV extends undefined ? {} : EV,
|
|
293
|
+
// @ts-expect-error
|
|
294
|
+
ES extends undefined ? {} : ES
|
|
295
|
+
>,
|
|
296
|
+
EV extends TVVariants<ES, B, E["variants"], ES> = E["variants"],
|
|
297
|
+
ES extends TVSlots = E["slots"] extends TVSlots ? E["slots"] : undefined,
|
|
298
|
+
>(options: {
|
|
299
|
+
/**
|
|
300
|
+
* Extend allows for easy composition of components.
|
|
301
|
+
* @see https://www.tailwind-variants.org/docs/composing-components
|
|
302
|
+
*/
|
|
303
|
+
extend?: E;
|
|
304
|
+
/**
|
|
305
|
+
* Base allows you to set a base class for a component.
|
|
306
|
+
*/
|
|
307
|
+
base?: B;
|
|
308
|
+
/**
|
|
309
|
+
* Slots allow you to separate a component into multiple parts.
|
|
310
|
+
* @see https://www.tailwind-variants.org/docs/slots
|
|
311
|
+
*/
|
|
312
|
+
slots?: S;
|
|
313
|
+
/**
|
|
314
|
+
* Variants allow you to create multiple versions of the same component.
|
|
315
|
+
* @see https://www.tailwind-variants.org/docs/variants#adding-variants
|
|
316
|
+
*/
|
|
317
|
+
variants?: V;
|
|
318
|
+
/**
|
|
319
|
+
* Compound variants allow you to apply classes to multiple variants at once.
|
|
320
|
+
* @see https://www.tailwind-variants.org/docs/variants#compound-variants
|
|
321
|
+
*/
|
|
322
|
+
compoundVariants?: CV;
|
|
323
|
+
/**
|
|
324
|
+
* Compound slots allow you to apply classes to multiple slots at once.
|
|
325
|
+
*/
|
|
326
|
+
compoundSlots?: TVCompoundSlots<V, S, B>;
|
|
327
|
+
/**
|
|
328
|
+
* Default variants allow you to set default variants for a component.
|
|
329
|
+
* @see https://www.tailwind-variants.org/docs/variants#default-variants
|
|
330
|
+
*/
|
|
331
|
+
defaultVariants?: DV;
|
|
332
|
+
}): TVReturnType<V, S, B, EV, ES, E>;
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
export declare const defaultConfig: TVConfig;
|
|
336
|
+
|
|
337
|
+
export type VariantProps<Component extends (...args: any) => any> = Omit<
|
|
338
|
+
OmitUndefined<Parameters<Component>[0]>,
|
|
339
|
+
"class" | "className"
|
|
340
|
+
>;
|
package/dist/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk7L2KNZGU_cjs=require('./chunk-7L2KNZGU.cjs');Object.defineProperty(exports,"cn",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.b}});Object.defineProperty(exports,"falsyToString",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.c}});Object.defineProperty(exports,"flat",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.h}});Object.defineProperty(exports,"flatArray",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.i}});Object.defineProperty(exports,"flatMergeArrays",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.j}});Object.defineProperty(exports,"isBoolean",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.f}});Object.defineProperty(exports,"isEmptyObject",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.d}});Object.defineProperty(exports,"isEqual",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.e}});Object.defineProperty(exports,"joinObjects",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.g}});Object.defineProperty(exports,"mergeObjects",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.k}});Object.defineProperty(exports,"removeExtraSpaces",{enumerable:true,get:function(){return chunk7L2KNZGU_cjs.a}});
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,15 +1,33 @@
|
|
|
1
|
+
import {TWMConfig} from "./config";
|
|
2
|
+
import {CnOptions, CnReturn} from "./types";
|
|
3
|
+
|
|
1
4
|
export declare const falsyToString: <T>(value: T) => T | string;
|
|
2
5
|
|
|
3
6
|
export declare const isEmptyObject: (obj: unknown) => boolean;
|
|
4
7
|
|
|
5
|
-
export declare const flatArray: <T
|
|
8
|
+
export declare const flatArray: <T>(array: unknown[]) => T[];
|
|
6
9
|
|
|
7
|
-
export declare const flatMergeArrays: <T
|
|
10
|
+
export declare const flatMergeArrays: <T>(...arrays: unknown[][]) => T[];
|
|
8
11
|
|
|
9
|
-
export declare const mergeObjects:
|
|
12
|
+
export declare const mergeObjects: <T extends object, U extends object>(
|
|
13
|
+
obj1: T,
|
|
14
|
+
obj2: U,
|
|
15
|
+
) => Record<string, unknown>;
|
|
10
16
|
|
|
11
17
|
export declare const removeExtraSpaces: (str: string) => string;
|
|
12
18
|
|
|
13
19
|
export declare const isEqual: (obj1: object, obj2: object) => boolean;
|
|
14
20
|
|
|
15
21
|
export declare const isBoolean: (value: unknown) => boolean;
|
|
22
|
+
|
|
23
|
+
export declare const joinObjects: <
|
|
24
|
+
T extends Record<string, unknown>,
|
|
25
|
+
U extends Record<string, unknown>,
|
|
26
|
+
>(
|
|
27
|
+
obj1: T,
|
|
28
|
+
obj2: U,
|
|
29
|
+
) => T & U;
|
|
30
|
+
|
|
31
|
+
export declare const flat: <T>(arr: unknown[], target: T[]) => void;
|
|
32
|
+
|
|
33
|
+
export declare const cn: <T extends CnOptions>(...classes: T) => (config?: TWMConfig) => CnReturn;
|
package/dist/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as falsyToString,
|
|
1
|
+
export{b as cn,c as falsyToString,h as flat,i as flatArray,j as flatMergeArrays,f as isBoolean,d as isEmptyObject,e as isEqual,g as joinObjects,k as mergeObjects,a as removeExtraSpaces}from'./chunk-GQLG7IS2.js';
|
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwind-variants",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "🦄 Tailwindcss first-class variant API",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"tailwindcss",
|
|
7
|
+
"classes",
|
|
8
|
+
"responsive",
|
|
9
|
+
"variants",
|
|
10
|
+
"styled",
|
|
11
|
+
"styles"
|
|
12
|
+
],
|
|
5
13
|
"author": "Junior Garcia <jrgarciadev@gmail.com>",
|
|
6
14
|
"license": "MIT",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"access": "public"
|
|
9
|
-
},
|
|
10
15
|
"repository": {
|
|
11
16
|
"type": "git",
|
|
12
17
|
"url": "https://github.com/heroui-inc/tailwind-variants"
|
|
@@ -15,14 +20,37 @@
|
|
|
15
20
|
"url": "https://github.com/heroui-inc/tailwind-variants/issues"
|
|
16
21
|
},
|
|
17
22
|
"type": "module",
|
|
18
|
-
"main": "dist/index.cjs",
|
|
19
|
-
"
|
|
23
|
+
"main": "./dist/index.cjs",
|
|
24
|
+
"module": "./dist/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.js",
|
|
30
|
+
"require": "./dist/index.cjs"
|
|
31
|
+
},
|
|
32
|
+
"./lite": {
|
|
33
|
+
"types": "./dist/lite.d.ts",
|
|
34
|
+
"import": "./dist/lite.js",
|
|
35
|
+
"require": "./dist/lite.cjs"
|
|
36
|
+
},
|
|
37
|
+
"./utils": {
|
|
38
|
+
"types": "./dist/utils.d.ts",
|
|
39
|
+
"import": "./dist/utils.js",
|
|
40
|
+
"require": "./dist/utils.cjs"
|
|
41
|
+
},
|
|
42
|
+
"./dist/*": "./dist/*",
|
|
43
|
+
"./package.json": "./package.json"
|
|
44
|
+
},
|
|
20
45
|
"sideEffects": false,
|
|
21
46
|
"files": [
|
|
22
47
|
"dist",
|
|
23
48
|
"README.md",
|
|
24
49
|
"LICENSE"
|
|
25
50
|
],
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
26
54
|
"scripts": {
|
|
27
55
|
"dev": "tsup --watch",
|
|
28
56
|
"build": "tsup && node copy-types.cjs",
|
|
@@ -87,26 +115,8 @@
|
|
|
87
115
|
"optional": true
|
|
88
116
|
}
|
|
89
117
|
},
|
|
90
|
-
"keywords": [
|
|
91
|
-
"tailwindcss",
|
|
92
|
-
"classes",
|
|
93
|
-
"responsive",
|
|
94
|
-
"variants",
|
|
95
|
-
"styled",
|
|
96
|
-
"styles"
|
|
97
|
-
],
|
|
98
118
|
"engines": {
|
|
99
119
|
"node": ">=16.x",
|
|
100
120
|
"pnpm": ">=7.x"
|
|
101
|
-
},
|
|
102
|
-
"module": "dist/index.js",
|
|
103
|
-
"exports": {
|
|
104
|
-
".": {
|
|
105
|
-
"types": "./dist/index.d.ts",
|
|
106
|
-
"import": "./dist/index.js",
|
|
107
|
-
"require": "./dist/index.cjs"
|
|
108
|
-
},
|
|
109
|
-
"./dist/*": "./dist/*",
|
|
110
|
-
"./package.json": "./package.json"
|
|
111
121
|
}
|
|
112
122
|
}
|
package/dist/chunk-2DBF3ZSA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a,c}from'./chunk-HK3UQQ6K.js';var r=null,s=null,p=async()=>r||s||(s=import('tailwind-merge').then(t=>(r=t,t)).catch(()=>null),s),m=t=>n=>{if(s&&!r)return n;if(r){let{twMerge:e,extendTailwindMerge:l}=r;return (c(t)?e:l({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}))(n)}try{let{twMerge:e,extendTailwindMerge:l}=a("tailwind-merge");return r={twMerge:e,extendTailwindMerge:l},(c(t)?e:l({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}))(n)}catch{return p(),n}};export{m as a};
|
package/dist/chunk-3PHVNOBC.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkB6QK5R63_cjs=require('./chunk-B6QK5R63.cjs');var r=null,s=null,p=async()=>r||s||(s=import('tailwind-merge').then(t=>(r=t,t)).catch(()=>null),s),m=t=>n=>{if(s&&!r)return n;if(r){let{twMerge:e,extendTailwindMerge:l}=r;return (chunkB6QK5R63_cjs.c(t)?e:l({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}))(n)}try{let{twMerge:e,extendTailwindMerge:l}=chunkB6QK5R63_cjs.a("tailwind-merge");return r={twMerge:e,extendTailwindMerge:l},(chunkB6QK5R63_cjs.c(t)?e:l({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}))(n)}catch{return p(),n}};exports.a=m;
|
package/dist/chunk-B6QK5R63.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var u=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var y=e=>e===false?"false":e===true?"true":e===0?"0":e,p=e=>{if(!e||typeof e!="object")return true;for(let t in e)return false;return true},g=(e,t)=>{if(e===t)return true;if(!e||!t)return false;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return false;for(let s=0;s<n.length;s++){let f=n[s];if(!r.includes(f)||e[f]!==t[f])return false}return true},x=e=>e===true||e===false;function o(e,t){for(let n=0;n<e.length;n++){let r=e[n];Array.isArray(r)?o(r,t):t.push(r);}}function A(e){let t=[];return o(e,t),t}var i=(...e)=>{let t=[];o(e,t);let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},c=(e,t)=>{let n={};for(let r in e){let s=e[r];if(r in t){let f=t[r];Array.isArray(s)||Array.isArray(f)?n[r]=i(f,s):typeof s=="object"&&typeof f=="object"&&s&&f?n[r]=c(s,f):n[r]=f+" "+s;}else n[r]=s;}for(let r in t)r in e||(n[r]=t[r]);return n},l=/\s+/g,h=e=>!e||typeof e!="string"?e:e.replace(l," ").trim();exports.a=u;exports.b=y;exports.c=p;exports.d=g;exports.e=x;exports.f=A;exports.g=i;exports.h=c;exports.i=h;
|
package/dist/chunk-HK3UQQ6K.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var u=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var y=e=>e===false?"false":e===true?"true":e===0?"0":e,p=e=>{if(!e||typeof e!="object")return true;for(let t in e)return false;return true},g=(e,t)=>{if(e===t)return true;if(!e||!t)return false;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return false;for(let s=0;s<n.length;s++){let f=n[s];if(!r.includes(f)||e[f]!==t[f])return false}return true},x=e=>e===true||e===false;function o(e,t){for(let n=0;n<e.length;n++){let r=e[n];Array.isArray(r)?o(r,t):t.push(r);}}function A(e){let t=[];return o(e,t),t}var i=(...e)=>{let t=[];o(e,t);let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},c=(e,t)=>{let n={};for(let r in e){let s=e[r];if(r in t){let f=t[r];Array.isArray(s)||Array.isArray(f)?n[r]=i(f,s):typeof s=="object"&&typeof f=="object"&&s&&f?n[r]=c(s,f):n[r]=f+" "+s;}else n[r]=s;}for(let r in t)r in e||(n[r]=t[r]);return n},l=/\s+/g,h=e=>!e||typeof e!="string"?e:e.replace(l," ").trim();export{u as a,y as b,p as c,g as d,x as e,A as f,i as g,c as h,h as i};
|
package/dist/cn.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunk3PHVNOBC_cjs=require('./chunk-3PHVNOBC.cjs');require('./chunk-B6QK5R63.cjs');Object.defineProperty(exports,"createTwMerge",{enumerable:true,get:function(){return chunk3PHVNOBC_cjs.a}});
|
package/dist/cn.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as createTwMerge}from'./chunk-2DBF3ZSA.js';import'./chunk-HK3UQQ6K.js';
|