Socket
Socket
Sign inDemoInstall

tailwind-merge

Package Overview
Dependencies
Maintainers
1
Versions
276
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwind-merge - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

5

dist/lib/types.d.ts

@@ -9,2 +9,7 @@ export interface Config {

/**
* Prefix added to Tailwind-generated classes
* @see https://tailwindcss.com/docs/configuration#prefix
*/
prefix?: string;
/**
* Theme scales used in classGroups.

@@ -11,0 +16,0 @@ * The keys are the same as in the Tailwind config but the values are sometimes defined more broadly.

2

dist/tailwind-merge.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";function r(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}Object.defineProperty(exports,"__esModule",{value:!0});var e=r(require("hashlru"));function o(){return o=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(r[t]=o[t])}return r},o.apply(this,arguments)}function t(r){var e=function(r){var e=r.theme,o={nextPart:{},validators:[]};return Object.entries(r.classGroups).forEach((function(r){i(r[1],o,r[0],e)})),o}(r);return{getClassGroupId:function(r){var o=r.split("-");return""===o[0]&&1!==o.length&&o.shift(),n(o,e)||function(r){if(l.test(r)){var e=l.exec(r)[1],o=null==e?void 0:e.substring(0,e.indexOf(":"));if(o)return"arbitrary.."+o}}(r)},getConflictingClassGroupIds:function(e){return r.conflictingClassGroups[e]||[]}}}function n(r,e){var o;if(0===r.length)return e.classGroupId;var t=e.nextPart[r[0]],l=t?n(r.slice(1),t):void 0;if(l)return l;if(0!==e.validators.length){var i=r.join("-");return null==(o=e.validators.find((function(r){return(0,r.validator)(i)})))?void 0:o.classGroupId}}var l=/^\[(.+)\]$/;function i(r,e,o,t){r.forEach((function(r){if("string"!=typeof r){if("function"==typeof r)return r.isThemeGetter?void i(r(t),e,o,t):void e.validators.push({validator:r,classGroupId:o});Object.entries(r).forEach((function(r){i(r[1],a(e,r[0]),o,t)}))}else(""===r?e:a(e,r)).classGroupId=o}))}function a(r,e){var o=r;return e.split("-").forEach((function(r){void 0===o.nextPart[r]&&(o.nextPart[r]={nextPart:{},validators:[]}),o=o.nextPart[r]})),o}function s(r){return o({cache:(n=r.cacheSize,n>=1?e.default(n):{get:function(){},set:function(){}})},t(r));var n}var c=/\s+/,d=/:(?![^[]*\])/;function u(r,e){var o=e.getClassGroupId,t=e.getConflictingClassGroupIds,n=new Set;return r.trim().split(c).map((function(r){var e=r.split(d),t=e.pop(),n=t.startsWith("!"),l=n?t.substring(1):t,i=o(l);if(!i)return{isTailwindClass:!1,originalClassName:r};var a=0===e.length?"":e.sort().concat("").join(":");return{isTailwindClass:!0,prefix:n?"!"+a:a,classGroupId:i,originalClassName:r}})).reverse().filter((function(r){if(!r.isTailwindClass)return!0;var e=r.prefix,o=r.classGroupId,l=e+":"+o;return!n.has(l)&&(n.add(l),t(o).forEach((function(r){return n.add(e+":"+r)})),!0)})).reverse().map((function(r){return r.originalClassName})).join(" ")}function p(){for(var r=arguments.length,e=new Array(r),o=0;o<r;o++)e[o]=arguments[o];var t,n,l,i=a;function a(r){var o=e[0],a=e.slice(1).reduce((function(r,e){return e(r)}),o());return t=s(a),n=t.cache.get,l=t.cache.set,i=c,c(r)}function c(r){var e=n(r);if(e)return e;var o=u(r,t);return l(r,o),o}return function(){for(var r,e="",o=0;o<arguments.length;o+=1)(r=arguments[o])&&(e&&(e+=" "),e+=r);return i(e)}}function b(r){var e=function(e){return e[r]||[]};return e.isThemeGetter=!0,e}var f=/^\[(.+)\]$/,g=/^\d+\/\d+$/,m=new Set(["px","full","screen"]),v=/^(\d+)?(xs|sm|md|lg|xl)$/,h=/\d+(%|px|em|rem|vh|vw|pt|pc|in|cm|mm|cap|ch|ex|lh|rlh|vi|vb|vmin|vmax)/,y=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function x(r){return!Number.isNaN(Number(r))||m.has(r)||g.test(r)||w(r)}function w(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return!!o&&(o.startsWith("length:")||h.test(o))}function k(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return!!o&&o.startsWith("size:")}function z(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return!!o&&o.startsWith("position:")}function j(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return!!o&&(o.startsWith("url(")||o.startsWith("url:"))}function C(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return!!o&&(!Number.isNaN(Number(o))||o.startsWith("weight:"))}function G(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return Number.isInteger(Number(o||r))}function A(r){return f.test(r)}function N(){return!0}function I(r){return v.test(r)}function P(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return!!o&&y.test(o)}var S={__proto__:null,isLength:x,isArbitraryLength:w,isArbitrarySize:k,isArbitraryPosition:z,isArbitraryUrl:j,isArbitraryWeight:C,isInteger:G,isArbitraryValue:A,isAny:N,isTshirtSize:I,isArbitraryShadow:P};function W(){var r=b("colors"),e=b("spacing"),o=b("blur"),t=b("brightness"),n=b("borderColor"),l=b("borderRadius"),i=b("borderWidth"),a=b("contrast"),s=b("grayscale"),c=b("hueRotate"),d=b("invert"),u=b("gap"),p=b("gradientColorStops"),f=b("inset"),g=b("margin"),m=b("opacity"),v=b("padding"),h=b("saturate"),y=b("scale"),S=b("sepia"),W=b("skew"),O=b("space"),T=b("translate"),_=function(){return["auto",e]},E=function(){return["",x]},M=function(){return["auto",G]},R=function(){return["","0",A]};return{cacheSize:500,theme:{colors:[N],spacing:[x],blur:["none","",I,w],brightness:[G],borderColor:[r],borderRadius:["none","","full",I,w],borderWidth:E(),contrast:[G],grayscale:R(),hueRotate:[G],invert:R(),gap:[e],gradientColorStops:[r],inset:_(),margin:_(),opacity:[G],padding:[e],saturate:[G],scale:[G],sepia:R(),skew:[G,A],space:[e],translate:[e]},classGroups:{aspect:[{aspect:["auto","square","video",A]}],container:["container"],columns:[{columns:[I]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],[A])}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible"],z:[{z:[x]}],basis:[{basis:[e]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",A]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",G]}],"grid-cols":[{"grid-cols":[N]}],"col-start-end":[{col:["auto",{span:[G]}]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[N]}],"row-start-end":[{row:["auto",{span:[G]}]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",A]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",A]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["start","end","center","between","around","evenly"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["start","end","center","between","around","evenly"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(["start","end","center","between","around","evenly"],["stretch"])}],"place-items":[{"place-items":["start","end","center","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max",e]}],"min-w":[{"min-w":["min","max","fit",x]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[I]},I,w]}],h:[{h:_()}],"min-h":[{"min-h":["min","max","fit",x]}],"max-h":[{"max-h":[e,"min","max","fit"]}],"font-size":[{text:["base",I,w]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",C]}],"font-family":[{font:[N]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",w]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",x]}],"list-style-type":[{list:["none","disc","decimal",A]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[r]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify"]}],"text-color":[{text:[r]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(["solid","dashed","dotted","double","none"],["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",x]}],"underline-offset":[{"underline-offset":["auto",x]}],"text-decoration-color":[{decoration:[r]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:[e]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",w]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap"]}],break:[{break:["normal","words","all"]}],content:[{content:["none",A]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],[z])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",k]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},j]}],"bg-color":[{bg:[r]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[].concat(["solid","dashed","dotted","double","none"],["hidden"])}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:[""].concat(["solid","dashed","dotted","double","none"],["hidden"])}],"outline-offset":[{"outline-offset":[x]}],"outline-w":[{outline:[x]}],"outline-color":[{outline:[r]}],"ring-w":[{ring:E()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[r]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[x]}],"ring-offset-color":[{"ring-offset":[r]}],shadow:[{shadow:["","inner","none",I,P]}],"shadow-color":[{shadow:[N]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[t]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",I,A]}],grayscale:[{grayscale:[s]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[h]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[t]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[h]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"table-layout":[{table:["auto","fixed"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",A]}],duration:[{duration:[G]}],ease:[{ease:["linear","in","out","in-out",A]}],delay:[{delay:[G]}],animate:[{animate:["none","spin","ping","pulse","bounce",A]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[G,A]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[W]}],"skew-y":[{"skew-y":[W]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",A]}],accent:[{accent:["auto",r]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",A]}],"caret-color":[{caret:[r]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":[e]}],"scroll-mx":[{"scroll-mx":[e]}],"scroll-my":[{"scroll-my":[e]}],"scroll-mt":[{"scroll-mt":[e]}],"scroll-mr":[{"scroll-mr":[e]}],"scroll-mb":[{"scroll-mb":[e]}],"scroll-ml":[{"scroll-ml":[e]}],"scroll-p":[{"scroll-p":[e]}],"scroll-px":[{"scroll-px":[e]}],"scroll-py":[{"scroll-py":[e]}],"scroll-pt":[{"scroll-pt":[e]}],"scroll-pr":[{"scroll-pr":[e]}],"scroll-pb":[{"scroll-pb":[e]}],"scroll-pl":[{"scroll-pl":[e]}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",A]}],fill:[{fill:[r]}],"stroke-w":[{stroke:[x]}],stroke:[{stroke:[r]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],"col-start-end":["col-start","col-end"],"row-start-end":["row-start","row-end"],gap:["gap-x","gap-y"],p:["px","py","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-t","rounded-r","rounded-b","rounded-l","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-w":["border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]}}}var O=p(W);function T(r,e){for(var o in e)M(r,o,e[o]);return r}var _=Object.prototype.hasOwnProperty,E=new Set(["string","number","boolean"]);function M(r,e,o){if(_.call(r,e)&&!E.has(typeof o)&&null!==o){if(Array.isArray(o)&&Array.isArray(r[e]))r[e]=r[e].concat(o);else if("object"==typeof o&&"object"==typeof r[e]){if(null===r[e])return void(r[e]=o);for(var t in o)M(r[e],t,o[t])}}else r[e]=o}exports.createTailwindMerge=p,exports.extendTailwindMerge=function(r){for(var e=arguments.length,o=new Array(e>1?e-1:0),t=1;t<e;t++)o[t-1]=arguments[t];return p.apply(void 0,"function"==typeof r?[W,r].concat(o):[function(){return T(W(),r)}].concat(o))},exports.fromTheme=b,exports.getDefaultConfig=W,exports.mergeConfigs=T,exports.twMerge=O,exports.validators=S;
"use strict";function r(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}Object.defineProperty(exports,"__esModule",{value:!0});var e=r(require("hashlru"));function o(){return o=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(r[t]=o[t])}return r},o.apply(this,arguments)}function t(r){var e=function(r){var e=r.theme,o=r.prefix,t={nextPart:{},validators:[]};return function(r,e){return e?r.map((function(r){return[r[0],r[1].map((function(r){return"string"==typeof r?e+r:"object"==typeof r?Object.fromEntries(Object.entries(r).map((function(r){return[e+r[0],r[1]]}))):r}))]})):r}(Object.entries(r.classGroups),o).forEach((function(r){i(r[1],t,r[0],e)})),t}(r);return{getClassGroupId:function(r){var o=r.split("-");return""===o[0]&&1!==o.length&&o.shift(),n(o,e)||function(r){if(l.test(r)){var e=l.exec(r)[1],o=null==e?void 0:e.substring(0,e.indexOf(":"));if(o)return"arbitrary.."+o}}(r)},getConflictingClassGroupIds:function(e){return r.conflictingClassGroups[e]||[]}}}function n(r,e){var o;if(0===r.length)return e.classGroupId;var t=e.nextPart[r[0]],l=t?n(r.slice(1),t):void 0;if(l)return l;if(0!==e.validators.length){var i=r.join("-");return null==(o=e.validators.find((function(r){return(0,r.validator)(i)})))?void 0:o.classGroupId}}var l=/^\[(.+)\]$/;function i(r,e,o,t){r.forEach((function(r){if("string"!=typeof r){if("function"==typeof r)return r.isThemeGetter?void i(r(t),e,o,t):void e.validators.push({validator:r,classGroupId:o});Object.entries(r).forEach((function(r){i(r[1],a(e,r[0]),o,t)}))}else(""===r?e:a(e,r)).classGroupId=o}))}function a(r,e){var o=r;return e.split("-").forEach((function(r){void 0===o.nextPart[r]&&(o.nextPart[r]={nextPart:{},validators:[]}),o=o.nextPart[r]})),o}function s(r){return o({cache:(n=r.cacheSize,n>=1?e.default(n):{get:function(){},set:function(){}})},t(r));var n}var c=/\s+/,d=/:(?![^[]*\])/;function u(r,e){var o=e.getClassGroupId,t=e.getConflictingClassGroupIds,n=new Set;return r.trim().split(c).map((function(r){var e=r.split(d),t=e.pop(),n=t.startsWith("!"),l=n?t.substring(1):t,i=o(l);if(!i)return{isTailwindClass:!1,originalClassName:r};var a=0===e.length?"":e.sort().concat("").join(":");return{isTailwindClass:!0,modifier:n?"!"+a:a,classGroupId:i,originalClassName:r}})).reverse().filter((function(r){if(!r.isTailwindClass)return!0;var e=r.modifier,o=r.classGroupId,l=e+":"+o;return!n.has(l)&&(n.add(l),t(o).forEach((function(r){return n.add(e+":"+r)})),!0)})).reverse().map((function(r){return r.originalClassName})).join(" ")}function p(){for(var r=arguments.length,e=new Array(r),o=0;o<r;o++)e[o]=arguments[o];var t,n,l,i=a;function a(r){var o=e[0],a=e.slice(1).reduce((function(r,e){return e(r)}),o());return t=s(a),n=t.cache.get,l=t.cache.set,i=c,c(r)}function c(r){var e=n(r);if(e)return e;var o=u(r,t);return l(r,o),o}return function(){for(var r,e="",o=0;o<arguments.length;o+=1)(r=arguments[o])&&(e&&(e+=" "),e+=r);return i(e)}}function b(r){var e=function(e){return e[r]||[]};return e.isThemeGetter=!0,e}var f=/^\[(.+)\]$/,g=/^\d+\/\d+$/,m=new Set(["px","full","screen"]),v=/^(\d+)?(xs|sm|md|lg|xl)$/,h=/\d+(%|px|em|rem|vh|vw|pt|pc|in|cm|mm|cap|ch|ex|lh|rlh|vi|vb|vmin|vmax)/,y=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function x(r){return!Number.isNaN(Number(r))||m.has(r)||g.test(r)||w(r)}function w(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return!!o&&(o.startsWith("length:")||h.test(o))}function k(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return!!o&&o.startsWith("size:")}function z(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return!!o&&o.startsWith("position:")}function j(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return!!o&&(o.startsWith("url(")||o.startsWith("url:"))}function C(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return!!o&&(!Number.isNaN(Number(o))||o.startsWith("weight:"))}function G(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return Number.isInteger(Number(o||r))}function A(r){return f.test(r)}function N(){return!0}function I(r){return v.test(r)}function O(r){var e,o=null==(e=f.exec(r))?void 0:e[1];return!!o&&y.test(o)}var P={__proto__:null,isLength:x,isArbitraryLength:w,isArbitrarySize:k,isArbitraryPosition:z,isArbitraryUrl:j,isArbitraryWeight:C,isInteger:G,isArbitraryValue:A,isAny:N,isTshirtSize:I,isArbitraryShadow:O};function S(){var r=b("colors"),e=b("spacing"),o=b("blur"),t=b("brightness"),n=b("borderColor"),l=b("borderRadius"),i=b("borderWidth"),a=b("contrast"),s=b("grayscale"),c=b("hueRotate"),d=b("invert"),u=b("gap"),p=b("gradientColorStops"),f=b("inset"),g=b("margin"),m=b("opacity"),v=b("padding"),h=b("saturate"),y=b("scale"),P=b("sepia"),S=b("skew"),W=b("space"),T=b("translate"),_=function(){return["auto",e]},E=function(){return["",x]},M=function(){return["auto",G]},R=function(){return["","0",A]};return{cacheSize:500,theme:{colors:[N],spacing:[x],blur:["none","",I,w],brightness:[G],borderColor:[r],borderRadius:["none","","full",I,w],borderWidth:E(),contrast:[G],grayscale:R(),hueRotate:[G],invert:R(),gap:[e],gradientColorStops:[r],inset:_(),margin:_(),opacity:[G],padding:[e],saturate:[G],scale:[G],sepia:R(),skew:[G,A],space:[e],translate:[e]},classGroups:{aspect:[{aspect:["auto","square","video",A]}],container:["container"],columns:[{columns:[I]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],[A])}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible"],z:[{z:[x]}],basis:[{basis:[e]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",A]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",G]}],"grid-cols":[{"grid-cols":[N]}],"col-start-end":[{col:["auto",{span:[G]}]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[N]}],"row-start-end":[{row:["auto",{span:[G]}]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",A]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",A]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["start","end","center","between","around","evenly"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["start","end","center","between","around","evenly"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(["start","end","center","between","around","evenly"],["stretch"])}],"place-items":[{"place-items":["start","end","center","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[W]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[W]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max",e]}],"min-w":[{"min-w":["min","max","fit",x]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[I]},I,w]}],h:[{h:_()}],"min-h":[{"min-h":["min","max","fit",x]}],"max-h":[{"max-h":[e,"min","max","fit"]}],"font-size":[{text:["base",I,w]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",C]}],"font-family":[{font:[N]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",w]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",x]}],"list-style-type":[{list:["none","disc","decimal",A]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[r]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify"]}],"text-color":[{text:[r]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(["solid","dashed","dotted","double","none"],["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",x]}],"underline-offset":[{"underline-offset":["auto",x]}],"text-decoration-color":[{decoration:[r]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:[e]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",w]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap"]}],break:[{break:["normal","words","all"]}],content:[{content:["none",A]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],[z])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",k]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},j]}],"bg-color":[{bg:[r]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[].concat(["solid","dashed","dotted","double","none"],["hidden"])}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:[""].concat(["solid","dashed","dotted","double","none"],["hidden"])}],"outline-offset":[{"outline-offset":[x]}],"outline-w":[{outline:[x]}],"outline-color":[{outline:[r]}],"ring-w":[{ring:E()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[r]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[x]}],"ring-offset-color":[{"ring-offset":[r]}],shadow:[{shadow:["","inner","none",I,O]}],"shadow-color":[{shadow:[N]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[t]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",I,A]}],grayscale:[{grayscale:[s]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[h]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[t]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[h]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"table-layout":[{table:["auto","fixed"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",A]}],duration:[{duration:[G]}],ease:[{ease:["linear","in","out","in-out",A]}],delay:[{delay:[G]}],animate:[{animate:["none","spin","ping","pulse","bounce",A]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[G,A]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",A]}],accent:[{accent:["auto",r]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",A]}],"caret-color":[{caret:[r]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":[e]}],"scroll-mx":[{"scroll-mx":[e]}],"scroll-my":[{"scroll-my":[e]}],"scroll-mt":[{"scroll-mt":[e]}],"scroll-mr":[{"scroll-mr":[e]}],"scroll-mb":[{"scroll-mb":[e]}],"scroll-ml":[{"scroll-ml":[e]}],"scroll-p":[{"scroll-p":[e]}],"scroll-px":[{"scroll-px":[e]}],"scroll-py":[{"scroll-py":[e]}],"scroll-pt":[{"scroll-pt":[e]}],"scroll-pr":[{"scroll-pr":[e]}],"scroll-pb":[{"scroll-pb":[e]}],"scroll-pl":[{"scroll-pl":[e]}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",A]}],fill:[{fill:[r]}],"stroke-w":[{stroke:[x]}],stroke:[{stroke:[r]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],"col-start-end":["col-start","col-end"],"row-start-end":["row-start","row-end"],gap:["gap-x","gap-y"],p:["px","py","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-t","rounded-r","rounded-b","rounded-l","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-w":["border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]}}}var W=p(S);function T(r,e){for(var o in e)M(r,o,e[o]);return r}var _=Object.prototype.hasOwnProperty,E=new Set(["string","number","boolean"]);function M(r,e,o){if(_.call(r,e)&&!E.has(typeof o)&&null!==o){if(Array.isArray(o)&&Array.isArray(r[e]))r[e]=r[e].concat(o);else if("object"==typeof o&&"object"==typeof r[e]){if(null===r[e])return void(r[e]=o);for(var t in o)M(r[e],t,o[t])}}else r[e]=o}exports.createTailwindMerge=p,exports.extendTailwindMerge=function(r){for(var e=arguments.length,o=new Array(e>1?e-1:0),t=1;t<e;t++)o[t-1]=arguments[t];return p.apply(void 0,"function"==typeof r?[S,r].concat(o):[function(){return T(S(),r)}].concat(o))},exports.fromTheme=b,exports.getDefaultConfig=S,exports.mergeConfigs=T,exports.twMerge=W,exports.validators=P;
//# sourceMappingURL=tailwind-merge.cjs.production.min.js.map
{
"name": "tailwind-merge",
"version": "1.1.1",
"version": "1.2.0",
"description": "Merge Tailwind CSS classes without style conflicts",

@@ -5,0 +5,0 @@ "keywords": [

<div align="center">
<br />
<a href="https://github.com/dcastil/tailwind-merge">
<!-- AUTOGENERATED START logo-image --><img src="https://github.com/dcastil/tailwind-merge/raw/v1.1.1/assets/logo.svg" alt="tailwind-merge" width="221px" /><!-- AUTOGENERATED END -->
<!-- AUTOGENERATED START logo-image --><img src="https://github.com/dcastil/tailwind-merge/raw/v1.2.0/assets/logo.svg" alt="tailwind-merge" width="221px" /><!-- AUTOGENERATED END -->
</a>

@@ -58,3 +58,3 @@ </div>

tailwind-merge makes sure to override conflicting classes and keeps everything else untouched. In the case of the `MySlightlyModifiedInput`, the input now only renders the classes `border rounded p-3`.
tailwind-merge overrides conflicting classes and keeps everything else untouched. In the case of the `MySlightlyModifiedInput`, the input now only renders the classes `border rounded p-3`.

@@ -90,3 +90,3 @@ ## Features

### Supports prefixes and stacked prefixes
### Supports modifiers and stacked modifiers

@@ -171,4 +171,7 @@ ```ts

cacheSize: 500,
// ↓ Optional prefix from TaiLwind config
prefix: 'tw-',
theme: {
// Theme scales are defined here
// This is not the theme object from your Tailwind config
},

@@ -314,2 +317,3 @@ classGroups: {

const customTwMerge = createTailwindMerge(() => ({
cacheSize: 500,
theme: {},

@@ -316,0 +320,0 @@ classGroups: {

@@ -88,3 +88,3 @@ import { ClassGroupId, Config, ClassGroup, ClassValidator, ThemeObject, ThemeGetter } from './types'

export function createClassMap(config: Config) {
const { theme } = config
const { theme, prefix } = config
const classMap: ClassPartObject = {

@@ -95,3 +95,8 @@ nextPart: {},

Object.entries(config.classGroups).forEach(([classGroupId, classGroup]) => {
const prefixedClassGroupEntries = getPrefixedClassGroupEntries(
Object.entries(config.classGroups),
prefix
)
prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {
processClassesRecursively(classGroup, classMap, classGroupId, theme)

@@ -167,1 +172,28 @@ })

}
function getPrefixedClassGroupEntries(
classGroupEntries: Array<[classGroupId: string, classGroup: ClassGroup]>,
prefix: string | undefined
): Array<[classGroupId: string, classGroup: ClassGroup]> {
if (!prefix) {
return classGroupEntries
}
return classGroupEntries.map(([classGroupId, classGroup]) => {
const prefixedClassGroup = classGroup.map((classDefinition) => {
if (typeof classDefinition === 'string') {
return prefix + classDefinition
}
if (typeof classDefinition === 'object') {
return Object.fromEntries(
Object.entries(classDefinition).map(([key, value]) => [prefix + key, value])
)
}
return classDefinition
})
return [classGroupId, prefixedClassGroup]
})
}

@@ -7,4 +7,4 @@ import { ConfigUtils } from './config-utils'

// I'd prefer to use a negative lookbehind for all supported labels, but lookbheinds don't have good browser support yet. More info: https://caniuse.com/js-regexp-lookbehind
const PREFIX_SEPARATOR_REGEX = /:(?![^[]*\])/
const PREFIX_SEPARATOR = ':'
const MODIFIER_SEPARATOR_REGEX = /:(?![^[]*\])/
const MODIFIER_SEPARATOR = ':'

@@ -16,3 +16,3 @@ export function mergeClassList(classList: string, configUtils: ConfigUtils) {

* Set of classGroupIds in following format:
* `{importantModifier}{variantPrefixes}{classGroupId}`
* `{importantModifier}{variantModifiers}{classGroupId}`
* @example 'float'

@@ -29,4 +29,4 @@ * @example 'hover:focus:bg-color'

.map((originalClassName) => {
const prefixes = originalClassName.split(PREFIX_SEPARATOR_REGEX)
const classNameWithImportantModifier = prefixes.pop()!
const modifiers = originalClassName.split(MODIFIER_SEPARATOR_REGEX)
const classNameWithImportantModifier = modifiers.pop()!

@@ -48,12 +48,14 @@ const hasImportantModifier =

const variantPrefix =
prefixes.length === 0 ? '' : prefixes.sort().concat('').join(PREFIX_SEPARATOR)
const variantModifier =
modifiers.length === 0
? ''
: modifiers.sort().concat('').join(MODIFIER_SEPARATOR)
const fullPrefix = hasImportantModifier
? IMPORTANT_MODIFIER + variantPrefix
: variantPrefix
const fullModifier = hasImportantModifier
? IMPORTANT_MODIFIER + variantModifier
: variantModifier
return {
isTailwindClass: true as const,
prefix: fullPrefix,
modifier: fullModifier,
classGroupId,

@@ -70,5 +72,5 @@ originalClassName,

const { prefix, classGroupId } = parsed
const { modifier, classGroupId } = parsed
const classId = `${prefix}:${classGroupId}`
const classId = `${modifier}:${classGroupId}`

@@ -82,3 +84,3 @@ if (classGroupsInConflict.has(classId)) {

getConflictingClassGroupIds(classGroupId).forEach((group) =>
classGroupsInConflict.add(`${prefix}:${group}`)
classGroupsInConflict.add(`${modifier}:${group}`)
)

@@ -85,0 +87,0 @@

@@ -9,2 +9,7 @@ export interface Config {

/**
* Prefix added to Tailwind-generated classes
* @see https://tailwindcss.com/docs/configuration#prefix
*/
prefix?: string
/**
* Theme scales used in classGroups.

@@ -11,0 +16,0 @@ * The keys are the same as in the Tailwind config but the values are sometimes defined more broadly.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc