tailwind-variants 2.0.1 → 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 CHANGED
@@ -58,7 +58,14 @@ npm i tailwind-merge
58
58
  pnpm add tailwind-merge
59
59
  ```
60
60
 
61
- > **⚠️ Upgrading from v1?** Please read the [migration guide](./MIGRATION-V2.md) for breaking changes and performance improvements.
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
@@ -19,3 +19,5 @@ export type TWMConfig = {
19
19
  };
20
20
 
21
21
  export type TVConfig = TWMConfig;
22
+
23
+ export declare const defaultConfig: TVConfig;
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkSEUVYOWD_cjs=require('./chunk-SEUVYOWD.cjs'),chunk7H22QZCA_cjs=require('./chunk-7H22QZCA.cjs');var st={twMerge:true,twMergeConfig:{},responsiveVariants:false},x=(...l)=>{let u=[];X(l,u);let t="";for(let d=0;d<u.length;d++)u[d]&&(t&&(t+=" "),t+=u[d]);return t||void 0};function X(l,u){for(let t=0;t<l.length;t++){let d=l[t];Array.isArray(d)?X(d,u):d&&u.push(d);}}var P=null,B={},F=false,S=(...l)=>u=>{let t=x(l);return !t||!u.twMerge?t:((!P||F)&&(F=false,P=chunkSEUVYOWD_cjs.a(B)),P(t)||void 0)},Q=(l,u)=>{for(let t in u)t in l?l[t]=x(l[t],u[t]):l[t]=u[t];return l},rt=(l,u)=>{let{extend:t=null,slots:d={},variants:R={},compoundVariants:q=[],compoundSlots:A=[],defaultVariants:L={}}=l,m={...st,...u},M=t?.base?x(t.base,l?.base):l?.base,y=t?.variants&&!chunk7H22QZCA_cjs.b(t.variants)?chunk7H22QZCA_cjs.g(R,t.variants):R,T=t?.defaultVariants&&!chunk7H22QZCA_cjs.b(t.defaultVariants)?{...t.defaultVariants,...L}:L;!chunk7H22QZCA_cjs.b(m.twMergeConfig)&&!chunk7H22QZCA_cjs.c(m.twMergeConfig,B)&&(F=true,B=m.twMergeConfig);let j=chunk7H22QZCA_cjs.b(t?.slots),$=chunk7H22QZCA_cjs.b(d)?{}:{base:x(l?.base,j&&t?.base),...d},N=j?$:Q({...t?.slots},chunk7H22QZCA_cjs.b($)?{base:l?.base}:$),w=chunk7H22QZCA_cjs.b(t?.compoundVariants)?q:chunk7H22QZCA_cjs.f(t?.compoundVariants,q),V=b=>{if(chunk7H22QZCA_cjs.b(y)&&chunk7H22QZCA_cjs.b(d)&&j)return S(M,b?.class,b?.className)(m);if(w&&!Array.isArray(w))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof w}`);if(A&&!Array.isArray(A))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof A}`);let Z=(n,e,s=[],o)=>{let a=s;if(typeof e=="string"){let c=chunk7H22QZCA_cjs.h(e).split(" ");for(let f=0;f<c.length;f++)a.push(`${n}:${c[f]}`);}else if(Array.isArray(e))for(let r=0;r<e.length;r++)a.push(`${n}:${e[r]}`);else if(typeof e=="object"&&typeof o=="string"&&o in e){let r=e[o];if(r&&typeof r=="string"){let f=chunk7H22QZCA_cjs.h(r).split(" "),p=[];for(let i=0;i<f.length;i++)p.push(`${n}:${f[i]}`);a[o]=a[o]?a[o].concat(p):p;}else if(Array.isArray(r)&&r.length>0){let c=[];for(let f=0;f<r.length;f++)c.push(`${n}:${r[f]}`);a[o]=c;}}return a},U=(n,e=y,s=null,o=null)=>{let a=e[n];if(!a||chunk7H22QZCA_cjs.b(a))return null;let r=o?.[n]??b?.[n];if(r===null)return null;let c=chunk7H22QZCA_cjs.a(r),f=Array.isArray(m.responsiveVariants)&&m.responsiveVariants.length>0||m.responsiveVariants===true,p=T?.[n],i=[];if(typeof c=="object"&&f)for(let[C,G]of Object.entries(c)){let nt=a[G];if(C==="initial"){p=G;continue}Array.isArray(m.responsiveVariants)&&!m.responsiveVariants.includes(C)||(i=Z(C,nt,i,s));}let v=c!=null&&typeof c!="object"?c:chunk7H22QZCA_cjs.a(p),h=a[v||"false"];return typeof i=="object"&&typeof s=="string"&&i[s]?Q(i,h):i.length>0?(i.push(h),s==="base"?i.join(" "):i):h},_=()=>{if(!y)return null;let n=Object.keys(y),e=[];for(let s=0;s<n.length;s++){let o=U(n[s],y);o&&e.push(o);}return e},K=(n,e)=>{if(!y||typeof y!="object")return null;let s=[];for(let o in y){let a=U(o,y,n,e),r=n==="base"&&typeof a=="string"?a:a&&a[n];r&&s.push(r);}return s},W={};for(let n in b){let e=b[n];e!==void 0&&(W[n]=e);}let z=(n,e)=>{let s=typeof b?.[n]=="object"?{[n]:b[n]?.initial}:{};return {...T,...W,...s,...e}},D=(n=[],e)=>{let s=[],o=n.length;for(let a=0;a<o;a++){let{class:r,className:c,...f}=n[a],p=true,i=z(null,e);for(let v in f){let h=f[v],C=i[v];if(Array.isArray(h)){if(!h.includes(C)){p=false;break}}else {if((h==null||h===false)&&(C==null||C===false))continue;if(C!==h){p=false;break}}}p&&(r&&s.push(r),c&&s.push(c));}return s},tt=n=>{let e=D(w,n);if(!Array.isArray(e))return e;let s={},o=S;for(let a=0;a<e.length;a++){let r=e[a];if(typeof r=="string")s.base=o(s.base,r)(m);else if(typeof r=="object")for(let c in r)s[c]=o(s[c],r[c])(m);}return s},et=n=>{if(A.length<1)return null;let e={},s=z(null,n);for(let o=0;o<A.length;o++){let{slots:a=[],class:r,className:c,...f}=A[o];if(!chunk7H22QZCA_cjs.b(f)){let p=true;for(let i in f){let v=s[i],h=f[i];if(v===void 0||(Array.isArray(h)?!h.includes(v):h!==v)){p=false;break}}if(!p)continue}for(let p=0;p<a.length;p++){let i=a[p];e[i]||(e[i]=[]),e[i].push([r,c]);}}return e};if(!chunk7H22QZCA_cjs.b(d)||!j){let n={};if(typeof N=="object"&&!chunk7H22QZCA_cjs.b(N)){let e=S;for(let s in N)n[s]=o=>{let a=tt(o),r=et(o);return e(N[s],K(s,o),a?a[s]:void 0,r?r[s]:void 0,o?.class,o?.className)(m)};}return n}return S(M,_(),D(w),b?.class,b?.className)(m)},Y=()=>{if(!(!y||typeof y!="object"))return Object.keys(y)};return V.variantKeys=Y(),V.extend=t,V.base=M,V.slots=N,V.variants=y,V.defaultVariants=T,V.compoundSlots=A,V.compoundVariants=w,V},it=l=>(u,t)=>rt(u,t?chunk7H22QZCA_cjs.g(l,t):l);exports.cn=S;exports.cnBase=x;exports.createTV=it;exports.defaultConfig=st;exports.tv=rt;
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): CreateTV;
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-RFCF2RNL.js';import {b,g,c,f,a as a$1,h}from'./chunk-LK3VBVBE.js';var st={twMerge:true,twMergeConfig:{},responsiveVariants:false},x=(...l)=>{let u=[];X(l,u);let t="";for(let d=0;d<u.length;d++)u[d]&&(t&&(t+=" "),t+=u[d]);return t||void 0};function X(l,u){for(let t=0;t<l.length;t++){let d=l[t];Array.isArray(d)?X(d,u):d&&u.push(d);}}var P=null,B={},F=false,S=(...l)=>u=>{let t=x(l);return !t||!u.twMerge?t:((!P||F)&&(F=false,P=a(B)),P(t)||void 0)},Q=(l,u)=>{for(let t in u)t in l?l[t]=x(l[t],u[t]):l[t]=u[t];return l},rt=(l,u)=>{let{extend:t=null,slots:d={},variants:R={},compoundVariants:q=[],compoundSlots:A=[],defaultVariants:L={}}=l,m={...st,...u},M=t?.base?x(t.base,l?.base):l?.base,y=t?.variants&&!b(t.variants)?g(R,t.variants):R,T=t?.defaultVariants&&!b(t.defaultVariants)?{...t.defaultVariants,...L}:L;!b(m.twMergeConfig)&&!c(m.twMergeConfig,B)&&(F=true,B=m.twMergeConfig);let j=b(t?.slots),$=b(d)?{}:{base:x(l?.base,j&&t?.base),...d},N=j?$:Q({...t?.slots},b($)?{base:l?.base}:$),w=b(t?.compoundVariants)?q:f(t?.compoundVariants,q),V=b$1=>{if(b(y)&&b(d)&&j)return S(M,b$1?.class,b$1?.className)(m);if(w&&!Array.isArray(w))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof w}`);if(A&&!Array.isArray(A))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof A}`);let Z=(n,e,s=[],o)=>{let a=s;if(typeof e=="string"){let c=h(e).split(" ");for(let f=0;f<c.length;f++)a.push(`${n}:${c[f]}`);}else if(Array.isArray(e))for(let r=0;r<e.length;r++)a.push(`${n}:${e[r]}`);else if(typeof e=="object"&&typeof o=="string"&&o in e){let r=e[o];if(r&&typeof r=="string"){let f=h(r).split(" "),p=[];for(let i=0;i<f.length;i++)p.push(`${n}:${f[i]}`);a[o]=a[o]?a[o].concat(p):p;}else if(Array.isArray(r)&&r.length>0){let c=[];for(let f=0;f<r.length;f++)c.push(`${n}:${r[f]}`);a[o]=c;}}return a},U=(n,e=y,s=null,o=null)=>{let a=e[n];if(!a||b(a))return null;let r=o?.[n]??b$1?.[n];if(r===null)return null;let c=a$1(r),f=Array.isArray(m.responsiveVariants)&&m.responsiveVariants.length>0||m.responsiveVariants===true,p=T?.[n],i=[];if(typeof c=="object"&&f)for(let[C,G]of Object.entries(c)){let nt=a[G];if(C==="initial"){p=G;continue}Array.isArray(m.responsiveVariants)&&!m.responsiveVariants.includes(C)||(i=Z(C,nt,i,s));}let v=c!=null&&typeof c!="object"?c:a$1(p),h=a[v||"false"];return typeof i=="object"&&typeof s=="string"&&i[s]?Q(i,h):i.length>0?(i.push(h),s==="base"?i.join(" "):i):h},_=()=>{if(!y)return null;let n=Object.keys(y),e=[];for(let s=0;s<n.length;s++){let o=U(n[s],y);o&&e.push(o);}return e},K=(n,e)=>{if(!y||typeof y!="object")return null;let s=[];for(let o in y){let a=U(o,y,n,e),r=n==="base"&&typeof a=="string"?a:a&&a[n];r&&s.push(r);}return s},W={};for(let n in b$1){let e=b$1[n];e!==void 0&&(W[n]=e);}let z=(n,e)=>{let s=typeof b$1?.[n]=="object"?{[n]:b$1[n]?.initial}:{};return {...T,...W,...s,...e}},D=(n=[],e)=>{let s=[],o=n.length;for(let a=0;a<o;a++){let{class:r,className:c,...f}=n[a],p=true,i=z(null,e);for(let v in f){let h=f[v],C=i[v];if(Array.isArray(h)){if(!h.includes(C)){p=false;break}}else {if((h==null||h===false)&&(C==null||C===false))continue;if(C!==h){p=false;break}}}p&&(r&&s.push(r),c&&s.push(c));}return s},tt=n=>{let e=D(w,n);if(!Array.isArray(e))return e;let s={},o=S;for(let a=0;a<e.length;a++){let r=e[a];if(typeof r=="string")s.base=o(s.base,r)(m);else if(typeof r=="object")for(let c in r)s[c]=o(s[c],r[c])(m);}return s},et=n=>{if(A.length<1)return null;let e={},s=z(null,n);for(let o=0;o<A.length;o++){let{slots:a=[],class:r,className:c,...f}=A[o];if(!b(f)){let p=true;for(let i in f){let v=s[i],h=f[i];if(v===void 0||(Array.isArray(h)?!h.includes(v):h!==v)){p=false;break}}if(!p)continue}for(let p=0;p<a.length;p++){let i=a[p];e[i]||(e[i]=[]),e[i].push([r,c]);}}return e};if(!b(d)||!j){let n={};if(typeof N=="object"&&!b(N)){let e=S;for(let s in N)n[s]=o=>{let a=tt(o),r=et(o);return e(N[s],K(s,o),a?a[s]:void 0,r?r[s]:void 0,o?.class,o?.className)(m)};}return n}return S(M,_(),D(w),b$1?.class,b$1?.className)(m)},Y=()=>{if(!(!y||typeof y!="object"))return Object.keys(y)};return V.variantKeys=Y(),V.extend=t,V.base=M,V.slots=N,V.variants=y,V.defaultVariants=T,V.compoundSlots=A,V.compoundVariants=w,V},it=l=>(u,t)=>rt(u,t?g(l,t):l);export{S as cn,x as cnBase,it as createTV,st as defaultConfig,rt as tv};
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};
@@ -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 chunk7H22QZCA_cjs=require('./chunk-7H22QZCA.cjs');Object.defineProperty(exports,"falsyToString",{enumerable:true,get:function(){return chunk7H22QZCA_cjs.a}});Object.defineProperty(exports,"flatArray",{enumerable:true,get:function(){return chunk7H22QZCA_cjs.e}});Object.defineProperty(exports,"flatMergeArrays",{enumerable:true,get:function(){return chunk7H22QZCA_cjs.f}});Object.defineProperty(exports,"isBoolean",{enumerable:true,get:function(){return chunk7H22QZCA_cjs.d}});Object.defineProperty(exports,"isEmptyObject",{enumerable:true,get:function(){return chunk7H22QZCA_cjs.b}});Object.defineProperty(exports,"isEqual",{enumerable:true,get:function(){return chunk7H22QZCA_cjs.c}});Object.defineProperty(exports,"mergeObjects",{enumerable:true,get:function(){return chunk7H22QZCA_cjs.g}});Object.defineProperty(exports,"removeExtraSpaces",{enumerable:true,get:function(){return chunk7H22QZCA_cjs.h}});
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 extends unknown[]>(array: T) => T;
8
+ export declare const flatArray: <T>(array: unknown[]) => T[];
6
9
 
7
- export declare const flatMergeArrays: <T extends unknown[]>(...arrays: T[]) => T;
10
+ export declare const flatMergeArrays: <T>(...arrays: unknown[][]) => T[];
8
11
 
9
- export declare const mergeObjects: (obj1: unknown, obj2: unknown) => unknown;
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{a as falsyToString,e as flatArray,f as flatMergeArrays,d as isBoolean,b as isEmptyObject,c as isEqual,g as mergeObjects,h as removeExtraSpaces}from'./chunk-LK3VBVBE.js';
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": "2.0.1",
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
- "types": "dist/index.d.ts",
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
  }
@@ -1 +0,0 @@
1
- 'use strict';var u=e=>e===false?"false":e===true?"true":e===0?"0":e,a=e=>{if(!e||typeof e!="object")return true;for(let r in e)return false;return true},y=(e,r)=>{if(e===r)return true;if(!e||!r)return false;let n=Object.keys(e),t=Object.keys(r);if(n.length!==t.length)return false;for(let s=0;s<n.length;s++){let f=n[s];if(!t.includes(f)||e[f]!==r[f])return false}return true},p=e=>e===true||e===false;function o(e,r){for(let n=0;n<e.length;n++){let t=e[n];Array.isArray(t)?o(t,r):r.push(t);}}function g(e){let r=[];return o(e,r),r}var i=(...e)=>{let r=[];o(e,r);let n=[];for(let t=0;t<r.length;t++)r[t]&&n.push(r[t]);return n},c=(e,r)=>{let n={};for(let t in e){let s=e[t];if(t in r){let f=r[t];Array.isArray(s)||Array.isArray(f)?n[t]=i(f,s):typeof s=="object"&&typeof f=="object"&&s&&f?n[t]=c(s,f):n[t]=f+" "+s;}else n[t]=s;}for(let t in r)t in e||(n[t]=r[t]);return n},l=/\s+/g,x=e=>!e||typeof e!="string"?e:e.replace(l," ").trim();exports.a=u;exports.b=a;exports.c=y;exports.d=p;exports.e=g;exports.f=i;exports.g=c;exports.h=x;
@@ -1 +0,0 @@
1
- var u=e=>e===false?"false":e===true?"true":e===0?"0":e,a=e=>{if(!e||typeof e!="object")return true;for(let r in e)return false;return true},y=(e,r)=>{if(e===r)return true;if(!e||!r)return false;let n=Object.keys(e),t=Object.keys(r);if(n.length!==t.length)return false;for(let s=0;s<n.length;s++){let f=n[s];if(!t.includes(f)||e[f]!==r[f])return false}return true},p=e=>e===true||e===false;function o(e,r){for(let n=0;n<e.length;n++){let t=e[n];Array.isArray(t)?o(t,r):r.push(t);}}function g(e){let r=[];return o(e,r),r}var i=(...e)=>{let r=[];o(e,r);let n=[];for(let t=0;t<r.length;t++)r[t]&&n.push(r[t]);return n},c=(e,r)=>{let n={};for(let t in e){let s=e[t];if(t in r){let f=r[t];Array.isArray(s)||Array.isArray(f)?n[t]=i(f,s):typeof s=="object"&&typeof f=="object"&&s&&f?n[t]=c(s,f):n[t]=f+" "+s;}else n[t]=s;}for(let t in r)t in e||(n[t]=r[t]);return n},l=/\s+/g,x=e=>!e||typeof e!="string"?e:e.replace(l," ").trim();export{u as a,a as b,y as c,p as d,g as e,i as f,c as g,x as h};
@@ -1 +0,0 @@
1
- import {b}from'./chunk-LK3VBVBE.js';import {twMerge,extendTailwindMerge}from'tailwind-merge';var p=s=>b(s)?twMerge:extendTailwindMerge({...s,extend:{theme:s.theme,classGroups:s.classGroups,conflictingClassGroupModifiers:s.conflictingClassGroupModifiers,conflictingClassGroups:s.conflictingClassGroups,...s.extend}});export{p as a};
@@ -1 +0,0 @@
1
- 'use strict';var chunk7H22QZCA_cjs=require('./chunk-7H22QZCA.cjs'),tailwindMerge=require('tailwind-merge');var p=s=>chunk7H22QZCA_cjs.b(s)?tailwindMerge.twMerge:tailwindMerge.extendTailwindMerge({...s,extend:{theme:s.theme,classGroups:s.classGroups,conflictingClassGroupModifiers:s.conflictingClassGroupModifiers,conflictingClassGroups:s.conflictingClassGroups,...s.extend}});exports.a=p;
package/dist/cn.cjs DELETED
@@ -1 +0,0 @@
1
- 'use strict';var chunkSEUVYOWD_cjs=require('./chunk-SEUVYOWD.cjs');require('./chunk-7H22QZCA.cjs');Object.defineProperty(exports,"createTwMerge",{enumerable:true,get:function(){return chunkSEUVYOWD_cjs.a}});
package/dist/cn.js DELETED
@@ -1 +0,0 @@
1
- export{a as createTwMerge}from'./chunk-RFCF2RNL.js';import'./chunk-LK3VBVBE.js';