Socket
Socket
Sign inDemoInstall

@fower/core

Package Overview
Dependencies
Maintainers
2
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fower/core - npm Package Compare versions

Comparing version 1.84.0 to 1.85.0

1

dist/core.cjs.development.js

@@ -986,2 +986,3 @@ 'use strict';

}
propValue = typeof propValue === 'function' ? propValue(this.props) : propValue;
var breakpoints = this.config.theme.breakpoints;

@@ -988,0 +989,0 @@ var parsed = cssObjectProcessor.parse(propValue, breakpoints);

2

dist/core.cjs.production.min.js

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

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("deepmerge")),r=require("@fower/utils"),o=e(require("string-hash")),i=require("@fower/color-helper"),n=require("@fower/css-object-processor");function s(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key))?i:String(i),o)}var i}function a(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function u(e,t){if(null==e)return{};var r,o,i={},n=Object.keys(e);for(o=0;o<n.length;o++)t.indexOf(r=n[o])>=0||(i[r]=e[r]);return i}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function p(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return c(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var d=function(){function e(){var e=this;this.config={unit:"px",objectPropKeys:["css"],inline:!1,important:!1,mode:{currentMode:"light",autoDarkMode:{enabled:!1,mappings:{white:"black",black:"white",50:"900",100:"800",200:"700",300:"600",400:"500",500:"400",600:"300",700:"200",800:"100",900:"50"}},modeList:["light","dark"],classPrefix:""},prefix:"",pseudos:["active","checked","disabled","enabled","default","empty","focus","focus-within","invalid","hover","link","visited","first-child","last-child","after","before","placeholder","selection"],theme:{breakpoints:{},colors:{},spacings:{}},plugins:[]},this.atomCache=new Map,this.getAtomIds=function(){return Array.from(e.atomCache.keys())},this.compositions=new Map,this.getConfig=function(){return e.config},this.setConfig=function(r,o){void 0===o&&(o="deepmerge"),"replace"===o?e.config=r:"merge"===o?e.config=l({},e.config,r):(e.config=t(e.config,r),r.objectPropKeys&&(e.config.objectPropKeys=r.objectPropKeys))},this.getTheme=function(){return e.config.theme},this.setTheme=function(r){e.config.theme=t(e.config.theme||{},r)},this.getMode=function(){var t;return(null==(t=e.config.mode)?void 0:t.currentMode)||""},this.setMode=function(t){if(r.isBrowser){var o=e.config.mode.currentMode;o&&document.documentElement.classList.remove(o),t&&document.documentElement.classList.add(t),localStorage.setItem("fower-mode",t),e.setConfig({mode:{currentMode:t}})}},this.use=function(){var t;(t=e.config.plugins).push.apply(t,arguments)},this.addAtom=function(t,r){var o={isMatch:function(e){return"string"==typeof t?e===t:t instanceof RegExp&&t.test(e)},handleAtom:"function"==typeof r?r:function(e){return e.style=r,e}};return e.use(o),o},this.composeAtom=function(t,r){e.compositions.set(t,r)}}return a(e,[{key:"theme",get:function(){return this.config.theme}}]),e}(),f=new d,h=["pseudoPrefix","childSelector","important"],m=["colorPostfix"],y=["excludedProps"],g=/^(m[xytrbl]?-?|p[xytrbl]?|gap[xy]?|space[xy]?|top-?|right-?|bottom-?|left-?|[wh]|square|circle|min[hw]|max[hw]|opacity|delay|duration|translate[xyz]|scale[xy]?|rotate[xy]?|skew[xy]?|text|zIndex-?|leading|stroke|fontWeight|outlineOffset|order|flex(Grow|Shrink|Basis)?|(row|column)?Gap|gridTemplateColumns|border(Top|Right|Bottom|Left)?|rounded(Top(Left|Right)?|Right|Bottom(Left|Right)?|Left)?)(-?\d+[a-z]*?|-auto)$/i,v=function(){function e(e,t){var r=this;void 0===t&&(t=!0),this.options=e,this.autoSetId=t,this.props={},this.propKeys=[],this.value="",this.id="",this.type="",this.setId=function(){var e=r.meta,t=r.key,i=r.value,n=e.important,s=u(e,h),a=Object.values(s).sort();n&&a.push("i");var l="";return e.global?(l=o(JSON.stringify(i)).toString(),r.id=l,l):(l="boolean"==typeof i&&!0===i?t:Array.isArray(i)?t+"-"+i.join("-"):"function"==typeof i?t+"-"+i(r.props):t+"-"+String(i),a.length&&(l=l+"--"+a.join("--")),l=l.replace(/[#()"']/g,"").replace(".","_").replace(/\%/g,"p").replace(/\s+/g,"-"),r.isFalsyPropValue&&(l+="--false"),e.childSelector&&(l=e.childSelector+"-"+l),l=/^[a-zA-Z0-9-_]+$/.test(l)?l:"css-"+o(l),r.id=l,l)},this.propKey=e.propKey,this.propValue=e.propValue,this.propKeys=[this.propKey],this.key=e.key||this.propKey,this.value=e.value||this.propValue,this.style=e.style||{},this.props=e.props||{},this.handled=this.getInitialHandled(),this.isValid=this.getIsValid(),this.inserted=!1,this.meta=l({},e.meta)||{},this.type=e.type||"",this.preprocessAtom()}var t=e.prototype;return t.preprocessAtom=function(){var e=this.postfixPreprocessor();return this.autoSetId&&this.setId(),e},t.postfixPreprocessor=function(){var e=f.config,t=e.pseudos,r=void 0===t?[]:t,o=e.mode.modeList,i=this.propKey,n=this.propValue,s=Object.keys(e.theme.breakpoints),a=o||[],l=r,u="--("+s.join("|")+")",c="--("+a.join("|")+")",p="--("+l.join("|")+")",d=new RegExp(c),h=new RegExp(p),m=new RegExp(u),y=/--[told](\d{1,2}|100)($|--)/i;if(y.test(n)){var g=n.split("--"),v=g[1];this.value=g[0],this.meta.colorPostfix=v}var b=d.test(i),k=h.test(i),j=m.test(i),x=/--i/i.test(i),A=y.test(i),S=/--\$\w+/i.test(i);if(!(b||k||j||x||A))return this.digitPreprocessor();var P,w=i.split("--");if(this.key=w[0],b&&(this.meta.mode=w.find((function(e){return a.includes(e)}))),k){var O=w.find((function(e){return l.includes(e)}));this.meta.pseudoPrefix=["after","before","placeholder","selection"].includes(O)?"::":":",this.meta.pseudo=O}if(j){var C=w.find((function(e){return s.includes(e)}));this.meta.breakpoint=C}return x&&(this.meta.important=!!w.find((function(e){return"i"===e}))),A&&(this.meta.colorPostfix=w.find((function(e){return y.test("--"+e)}))),S&&(this.meta.parentClass=null==(P=w.find((function(e){return e.startsWith("$")})))?void 0:P.replace(/^\$/,"")),this.digitPreprocessor(),this},t.digitPreprocessor=function(){if(!g.test(this.key))return this;var e=f.config.theme.spacings,t=/^([a-z]+)(\d+)$/i.test(this.key),r=this.key.toString(),o=r.match(/^([a-z]+)(\d+)$/i)||r.match(/^([a-z]*)-(-?\d+[a-z]*?)$/i)||r.match(/^([a-z]+)-(auto)$/i);if(!o)return this;var i=o[2];return this.key=o[1],this.value=t?e[""+i.toLowerCase()]:i,this},t.getInitialHandled=function(){return this.options.handled?this.options.handled:!!this.isFalsyPropValue||!!y.includes(this.propKey)},t.getIsValid=function(){return!this.isFalsyPropValue&&!y.includes(this.propKey)},a(e,[{key:"isValueProp",get:function(){return"string"==typeof this.propValue||"number"==typeof this.propValue}},{key:"styleKeys",get:function(){return Object.keys(this.style||{}).join("-")}},{key:"styleKeysHash",get:function(){var e=u(this.meta,m);return Object.keys(this.style||{}).join("-")+JSON.stringify(e)}},{key:"isFalsyPropValue",get:function(){return null==this.propValue||"boolean"==typeof this.propValue&&!this.propValue}},{key:"isTruePropValue",get:function(){return"boolean"==typeof this.propValue&&this.propValue}}]),e}(),b=new(function(){function e(){var e;this.$style=null,this.cssString="",this.ssrAtomIds=null,r.isBrowser&&(this.$style=null==(e=globalThis.document)||null==e.querySelector?void 0:e.querySelector("[data-fower]"))}var t=e.prototype;return t.createStyleElement=function(){var e=document.createElement("style");return e.dataset.fower="",document.head.append(e),e},t.getSsrAtomIds=function(){var e,t;return this.$style?this.ssrAtomIds?this.ssrAtomIds:(null==(e=this.$style)||null==(t=e.dataset.fower)?void 0:t.split(","))||[]:[]},t.insertStyleToHtml=function(e){if(r.isBrowser){this.$style||(this.$style=this.createStyleElement());for(var t,o=p(e);!(t=o()).done;){var i=t.value;try{this.$style.sheet.insertRule(i)}catch(e){console.warn(e)}}}},t.insertStyles=function(e){if(void 0===e&&(e=[]),e.length)return r.isBrowser?this.insertStyleToHtml(e):void(this.cssString=this.cssString+" "+e.join(" "))},t.getStyle=function(){return this.cssString},e}()),k=/(-columns|(^|[^e]-)padding|[^t]-spacing|l-align|rows|(^|(^border|[dkmnptx]|le|ne)-)width|^border|tom|[ek]-start|(o|[^e]-du)ration|us|(^|[^tv]-)left|(^|-)top|tance|rgin|e-offset|(er|g|n|t)-block|(^|[^tv]-)right|basis|[gnt]-inline|gap|(^|[^e]-)height|ness|(^|[^p]-)inset|[ek]-end|elay|tline|ve|dent|-rotate|n-rule|(c|ck|d|ne|t)-size)$/,j=["color","backgroundColor","borderColor"],x=["children","onClick","onChange","onBlur","id","className","style","title","tabIndex","placeholder","href","src","contentEditable","defaultChecked","defaultValue"],A=function(){function e(e){var t,r;void 0===e&&(e={}),this.props=e,this.atoms=[],this.data={},this.getClassNameById=function(e){return f.config.prefix+e},this.traverseProps(e),null!=(t=f.config.mode)&&null!=(r=t.autoDarkMode)&&r.enabled&&this.createAutoDarkModeAtom()}var t=e.prototype;return t.traverseProps=function(e){if(!r.isEmptyObj(e)){for(var t,o=this.config,i=o.pseudos,n=void 0===i?[]:i,s=o.mode.modeList,a=o.theme.breakpoints||{},u=Object.keys(a),c=s||[],d=n,h=e.excludedProps,m=void 0===h?[]:h,y=Object.entries(e),g=p(this.plugins);!(t=g()).done;){var b=t.value;b.init&&b.init(e)}for(var k=0,j=y;k<j.length;k++){var A,S=j[k],P=S[0],w=S[1];if(!m.includes(P)&&!x.includes(P)&&this.isValidProp(P,w))if(null!=(A=this.config.objectPropKeys)&&A.includes(P))this.parseObjectProp(w,{});else{if(P.startsWith("_")){var O=P.replace(/^_/,""),C=Array.isArray(w)?w.reduce((function(e,t){var r;return l({},e,((r={})[t]=!0,r))}),{}):w;if(c.includes(O)){this.parseObjectProp(C,{mode:O});continue}if(u.includes(O)){this.parseObjectProp(C,{breakpoint:a[O]});continue}if(d.includes(O)){this.parseObjectProp(C,{pseudoPrefix:":",pseudo:O});continue}}if(!Array.isArray(w)||/^bgGradient[XY].*/i.test(P)&&!Array.isArray(w[0])){var K=f.compositions.get(P);if(K){this.parseObjectProp(K,{});var V=new v({propKey:P,propValue:w,props:this.props});V.handled=!0,V.style={},this.addAtom(V)}else{var I=new v({propKey:P,propValue:w,props:this.props},!1);try{this.mutateAtom(I),I.handled&&this.addAtom(I)}catch(e){continue}}}else this.parseResponsiveValue(P,w)}}for(var M,R=p(this.plugins);!(M=R()).done;){var T=M.value;T.afterAtomStyleCreate&&T.afterAtomStyleCreate(this)}}},t.getAutoDarkModeAtom=function(e){var t;if(e.meta.mode)return null;if(!e.style)return null;var o=Object.entries(e.style);if(null==o||!o.length)return null;var i,n={},s=f.config,a=s.mode.autoDarkMode.mappings,u=s.theme.colors,c=o[0],p=c[0],d=c[1];if(!j.includes(p))return null;if(!u[d])return null;var h=(d.match(/^([a-z]+)(\d+)$/i)||[])[2];if(!1===a[d])return null;var m="color"===p,y="backgroundColor"===p,g="borderColor"===p;return u[i=a[e.propKey]?a[e.propKey]:a[d]?a[d]:d.replace(h,a[h])]?(m?(n.propKey=i,n.type="color"):y?(n.propKey="bg"+r.upFirst(i),n.type="backgroundColor"):g&&(n.propKey="border"+r.upFirst(i),n.type="borderColor"),n.propValue=!0):m?(n.propKey="color",n.propValue=i):y?(n.propKey="bg",n.propValue=i):g&&(n.propKey="borderColor",n.propValue=i),n.style=((t={})[p]=i,t),new v(l({},n,{props:this.props,meta:l({},e.meta,{mode:"dark"})}))},t.createAutoDarkModeAtom=function(){for(var e,t=this,r=function(){var r,o=e.value;if(!o.isValid||"dark"===(null==(r=o.meta)?void 0:r.mode)||!j.includes(o.type))return"continue";if(t.atoms.find((function(e){return o.type===e.type&&"dark"===e.meta.mode&&!Reflect.has(e.meta,"pseudo")&&!Reflect.has(e.meta,"childSelector")})))return"continue";var i=t.getAutoDarkModeAtom(o);if(!i)return"continue";var n=f.atomCache.get(i.id);t.addAtom(n||i)},o=p(this.atoms);!(e=o()).done;)r()},t.formatCssValue=function(e,t){if(!k.test(e))return t;var o;if(r.isPercentNumber(String(t)))return String(t).replace("p","%");if(!r.isNumber(t))return t;if((o=Number(t))<1&&o>0)return 100*o+"%";var i=f.config;return"none"!==i.unit?i.transformUnit?i.transformUnit(o):t+f.config.unit:o},t.styleToString=function(e,t){var o=this,n=t.important,s=t.colorPostfix;return Object.entries(e).reduce((function(e,t){var a=t[0],l=t[1];a=a.replace(/\-\-.+/,"");var u=r.jsKeyToCssKey(a),c=n?" !important":"",p=f.theme.colors;try{return e+(u+": ")+(l=s?i.formatColor((null==p?void 0:p[l])||l,s):o.formatCssValue(u,(null==p?void 0:p[l])||l))+c+";"}catch(e){return""}}),"")},t.addAtom=function(e){var t,r,o;e.props=this.props,e.id||e.setId(),f.atomCache.get(e.id)||f.atomCache.set(e.id,e);for(var i,n=b.getSsrAtomIds(),s=((null==(t=this.config.theme)?void 0:t.colors)||{}).modes,a=0,u=Object.entries(void 0===s?{}:s);a<u.length;a++){var c=u[a],p=c[0],d=c[1];if(e.style){var h=Object.entries(e.style);if(h.length){var m=h[0],y=m[0],g=d[m[1]];if(g){var v="--"+p,k=JSON.parse(JSON.stringify(e));k.key=e.key+v,k.id=e.id+v,k.meta=l({mode:p},e.meta),k.style[y]=g,n.includes(k.id)&&(k.inserted=!0),this.atoms.push(k)}}}}if(n.includes(e.id)&&(e.inserted=!0),null!=(r=f.config.mode)&&null!=(o=r.autoDarkMode)&&o.enabled&&"color"===e.type&&"dark"!==(null==(i=e.meta)?void 0:i.mode)&&!Reflect.has(e.meta,"pseudo")){var j=this.atoms.findIndex((function(t){var r;return"color"===t.type&&"dark"!==(null==(r=t.meta)?void 0:r.mode)&&!Reflect.has(e.meta,"childSelector")&&!Reflect.has(e.meta,"pseudo")}));j>-1&&(this.atoms[j]=l({},this.atoms[j],{isValid:!1}))}this.atoms.push(e)},t.isValidProp=function(e,t){var r;return!!(null!=(r=this.config.objectPropKeys)&&r.includes(e)||e.startsWith("_")||Array.isArray(t)||["string","boolean","number","undefined","function"].includes(typeof t))},t.mutateAtom=function(e){for(var t,r=p(this.plugins);!(t=r()).done;){var o=t.value;null!=o.isMatch&&o.isMatch(e.key,this)&&(e.id||e.setId(),"function"==typeof e.value&&(e.value=e.value(this.props)),o.beforeHandleAtom&&(e=o.beforeHandleAtom(e,this)))}(Object.values(e.meta||{}).length||Object.values(e.style||{}).length)&&(e.id||e.setId());var i=f.atomCache.get(e.id);if(i)throw i.propKeys.includes(e.propKey)||i.propKeys.push(e.propKey),this.addAtom(i),new Error("atom is cached, add to this.atoms directly, no need to mutate");if(e.handled)throw this.addAtom(e),new Error("atom is handled, add to this.atoms directly ,no need to mutate");for(var n,s=p(this.plugins);!(n=s()).done;){var a=n.value;if(null!=a.isMatch&&a.isMatch(e.key,this)){a.handleAtom&&(e=null==a.handleAtom?void 0:a.handleAtom(e,this)),e.handled=!0;break}}},t.parseResponsiveValue=function(e,t){var r=Object.keys(this.config.theme.breakpoints),o=t.reduce((function(t,o,i){var n;return l({},t,((n={})[e+(0===i?"":"--"+r[i-1])]=o,n))}),{});this.parseObjectProp(o)},t.parseObjectProp=function(e,t){void 0===t&&(t={});for(var r,o=p(n.parse(e,this.config.theme.breakpoints));!(r=o()).done;){var i=r.value,s=i.selector,a=i.selectorType,u=i.style,c=Object.entries(u);if(c.length){var d=c[0],h={propKey:d[0],propValue:d[1],props:this.props,meta:l({},t)};if(u&&Object.keys(u).length&&(h.style=u),"pseudo"===a&&h.meta){var m=s.match(/(:+)(.+)/)||[],y=m[2];h.meta.pseudoPrefix=m[1],h.meta.pseudo=y}"child"===a&&h.meta&&(h.meta.childSelector=s),"sibling"===a&&h.meta&&(h.meta.siblingSelector=s);var g=new v(h,!1);try{this.mutateAtom(g)}catch(e){continue}g.style&&Object.keys(g.style).length||(g.handled=!0);var b=f.atomCache.get(g.id);this.addAtom(b||g)}}},t.makeResponsiveStyle=function(e,t){return"@media (min-width: "+this.config.theme.breakpoints[e]+") {"+t+"}"},t.getClassNames=function(){var e=this,t=[];this.atoms.reduce((function(r,o){if(!o.style||!Object.keys(o.style).length)return r;var i=r.findIndex((function(e){return e.styleKeysHash===o.styleKeysHash}));if(!o.isValid)return r;var n=e.getClassNameById(o.id);return-1===i?(t.push(n),r=[].concat(r,[o])):(r.splice(i,1,o),t.splice(i,1,n)),r}),[]);var r,o=this.props.className,i=(void 0===o?"":o).split(/\s+/).filter((function(e){return!t.includes(e)&&!!e}));return t=t.concat(i),this.hasResponsive&&(r=t).push.apply(r,Object.keys(this.config.theme.breakpoints).map((function(e){return"r-"+e}))),t},t.toStyle=function(){var e=this;return this.atoms.reduce((function(t,o){if(!o.isValid)return t;var i=f.theme.colors,n=Object.entries(o.style).reduce((function(t,o){var n,s=o[0],a=o[1],u=e.formatCssValue(r.jsKeyToCssKey(s),i[a]||a);return l({},t,((n={})[s]=u,n))}),{});return l({},t,n)}),{})},t.toRules=function(e){void 0===e&&(e=!1);for(var t,o=this.config.mode.classPrefix,i=void 0===o?"":o,n=[],s=Object.keys(this.config.theme.breakpoints),a=p(this.atoms);!(t=a()).done;){var l=t.value,u="",c=l.id,d=l.style,f=void 0===d?{}:d,h=l.meta;if(l.isValid&&!r.isEmptyObj(f)){var m=h.pseudo,y=h.pseudoPrefix,g=h.mode,v=h.breakpoint,b=void 0===v?"":v,k=h.childSelector,j=h.siblingSelector,x=h.parentClass;if(e||!l.inserted){l.inserted=!0;var A=this.getClassNameById(c),S=h.global?h.global:"."+A;if(g&&(S="."+i+g+" "+S),j&&(S=""+S+j),m){var P=y+m;x?S="."+x+P+" "+S:S+=P}k?S=b?S+"."+s.slice(0,s.indexOf(b)+1).map((function(e){return"r-"+e})).join(".")+" "+k:S+" "+k:b&&(S=S+"."+s.slice(0,s.indexOf(b)+1).map((function(e){return"r-"+e})).join(".")),u=S+" { "+this.styleToString(f,l.meta)+" }",b&&(u=this.makeResponsiveStyle(b,u)),n.push(u)}}}return n},t.getParsedProps=function(){var e=this,t=this.props,o=this.atoms;return r.isEmptyObj(t)?{}:Object.entries(t).reduce((function(t,r){var i=r[0],n=r[1];return/.*--(\d+)?[a-z]+$/i.test(i)||o.find((function(t){return[t.propKey,t.key,t.id].concat(e.config.objectPropKeys||[]).includes(i)||t.propKeys.includes(i)}))||(t[i]=n),t}),{})},t.insertRules=function(){var e=this.toRules();b.insertStyles(e)},a(e,[{key:"uniqueClassName",get:function(){return r.objectToClassName(Object.keys(this.props))}},{key:"hasResponsive",get:function(){return this.atoms.some((function(e){return!!e.meta.breakpoint}))}},{key:"store",get:function(){return f}},{key:"config",get:function(){return f.config}},{key:"plugins",get:function(){return f.config.plugins}}]),e}();function S(e){for(var t=Object.entries(e),r=new A({}),o=0,i=t;o<i.length;o++){var n=i[o],s=n[0],a=n[1],l=new v({propKey:s,propValue:a,value:a,meta:{global:s},style:a});r.addAtom(l)}r.insertRules()}S({"*, ::before, ::after":{borderWidth:0,borderStyle:"solid",borderColor:"#e5e5e5",boxSizing:"border-box"}});var P=f.setConfig,w=f.getConfig,O=f.setTheme,C=f.getTheme,K=f.setMode,V=f.getMode,I=f.addAtom,M=f.composeAtom;exports.Atom=v,exports.Parser=A,exports.Store=d,exports.addAtom=I,exports.composeAtom=M,exports.createStyle=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o=t.reduce((function(e,t){var r;return l({},e,"string"==typeof t?((r={})[t]=!0,r):{css:t})}),{}),i=new A(o),n=i.toStyle();return n},exports.css=function(){for(var e,t,o=arguments.length,i=new Array(o),n=0;n<o;n++)i[n]=arguments[n];if(!i.length)return"";var s=new A(r.argsToProps(i,null==(e=f.config)||null==(t=e.objectPropKeys)?void 0:t[0]));return s.insertRules(),s.getClassNames().join(" ")},exports.digitReg=g,exports.getConfig=w,exports.getMode=V,exports.getTheme=C,exports.injectGlobalStyle=S,exports.isAtomicArgsValid=function(e){var t=r.argsToProps([e]),o=new A(t).getParsedProps();return!Object.keys(o).length},exports.keyframes=function(e,t){var o=Object.entries(e).reduce((function(e,t){var o=t[0],i=Object.entries(t[1]).reduce((function(e,t){var o=t[1];return e+(r.jsKeyToCssKey(t[0])+": ")+o+";"}),"");return e+(r.jsKeyToCssKey(o)+" {")+i+"}"}),""),i=t||"keyframes-"+r.hash(JSON.stringify(e));return b.insertStyles(["\n @keyframes "+i+" {\n "+o+"\n }\n "]),i},exports.setConfig=P,exports.setMode=K,exports.setTheme=O,exports.store=f,exports.styleSheet=b;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("deepmerge")),r=require("@fower/utils"),o=e(require("string-hash")),i=require("@fower/color-helper"),n=require("@fower/css-object-processor");function s(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key))?i:String(i),o)}var i}function a(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function u(e,t){if(null==e)return{};var r,o,i={},n=Object.keys(e);for(o=0;o<n.length;o++)t.indexOf(r=n[o])>=0||(i[r]=e[r]);return i}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function p(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return c(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var d=function(){function e(){var e=this;this.config={unit:"px",objectPropKeys:["css"],inline:!1,important:!1,mode:{currentMode:"light",autoDarkMode:{enabled:!1,mappings:{white:"black",black:"white",50:"900",100:"800",200:"700",300:"600",400:"500",500:"400",600:"300",700:"200",800:"100",900:"50"}},modeList:["light","dark"],classPrefix:""},prefix:"",pseudos:["active","checked","disabled","enabled","default","empty","focus","focus-within","invalid","hover","link","visited","first-child","last-child","after","before","placeholder","selection"],theme:{breakpoints:{},colors:{},spacings:{}},plugins:[]},this.atomCache=new Map,this.getAtomIds=function(){return Array.from(e.atomCache.keys())},this.compositions=new Map,this.getConfig=function(){return e.config},this.setConfig=function(r,o){void 0===o&&(o="deepmerge"),"replace"===o?e.config=r:"merge"===o?e.config=l({},e.config,r):(e.config=t(e.config,r),r.objectPropKeys&&(e.config.objectPropKeys=r.objectPropKeys))},this.getTheme=function(){return e.config.theme},this.setTheme=function(r){e.config.theme=t(e.config.theme||{},r)},this.getMode=function(){var t;return(null==(t=e.config.mode)?void 0:t.currentMode)||""},this.setMode=function(t){if(r.isBrowser){var o=e.config.mode.currentMode;o&&document.documentElement.classList.remove(o),t&&document.documentElement.classList.add(t),localStorage.setItem("fower-mode",t),e.setConfig({mode:{currentMode:t}})}},this.use=function(){var t;(t=e.config.plugins).push.apply(t,arguments)},this.addAtom=function(t,r){var o={isMatch:function(e){return"string"==typeof t?e===t:t instanceof RegExp&&t.test(e)},handleAtom:"function"==typeof r?r:function(e){return e.style=r,e}};return e.use(o),o},this.composeAtom=function(t,r){e.compositions.set(t,r)}}return a(e,[{key:"theme",get:function(){return this.config.theme}}]),e}(),f=new d,h=["pseudoPrefix","childSelector","important"],m=["colorPostfix"],y=["excludedProps"],g=/^(m[xytrbl]?-?|p[xytrbl]?|gap[xy]?|space[xy]?|top-?|right-?|bottom-?|left-?|[wh]|square|circle|min[hw]|max[hw]|opacity|delay|duration|translate[xyz]|scale[xy]?|rotate[xy]?|skew[xy]?|text|zIndex-?|leading|stroke|fontWeight|outlineOffset|order|flex(Grow|Shrink|Basis)?|(row|column)?Gap|gridTemplateColumns|border(Top|Right|Bottom|Left)?|rounded(Top(Left|Right)?|Right|Bottom(Left|Right)?|Left)?)(-?\d+[a-z]*?|-auto)$/i,v=function(){function e(e,t){var r=this;void 0===t&&(t=!0),this.options=e,this.autoSetId=t,this.props={},this.propKeys=[],this.value="",this.id="",this.type="",this.setId=function(){var e=r.meta,t=r.key,i=r.value,n=e.important,s=u(e,h),a=Object.values(s).sort();n&&a.push("i");var l="";return e.global?(l=o(JSON.stringify(i)).toString(),r.id=l,l):(l="boolean"==typeof i&&!0===i?t:Array.isArray(i)?t+"-"+i.join("-"):"function"==typeof i?t+"-"+i(r.props):t+"-"+String(i),a.length&&(l=l+"--"+a.join("--")),l=l.replace(/[#()"']/g,"").replace(".","_").replace(/\%/g,"p").replace(/\s+/g,"-"),r.isFalsyPropValue&&(l+="--false"),e.childSelector&&(l=e.childSelector+"-"+l),l=/^[a-zA-Z0-9-_]+$/.test(l)?l:"css-"+o(l),r.id=l,l)},this.propKey=e.propKey,this.propValue=e.propValue,this.propKeys=[this.propKey],this.key=e.key||this.propKey,this.value=e.value||this.propValue,this.style=e.style||{},this.props=e.props||{},this.handled=this.getInitialHandled(),this.isValid=this.getIsValid(),this.inserted=!1,this.meta=l({},e.meta)||{},this.type=e.type||"",this.preprocessAtom()}var t=e.prototype;return t.preprocessAtom=function(){var e=this.postfixPreprocessor();return this.autoSetId&&this.setId(),e},t.postfixPreprocessor=function(){var e=f.config,t=e.pseudos,r=void 0===t?[]:t,o=e.mode.modeList,i=this.propKey,n=this.propValue,s=Object.keys(e.theme.breakpoints),a=o||[],l=r,u="--("+s.join("|")+")",c="--("+a.join("|")+")",p="--("+l.join("|")+")",d=new RegExp(c),h=new RegExp(p),m=new RegExp(u),y=/--[told](\d{1,2}|100)($|--)/i;if(y.test(n)){var g=n.split("--"),v=g[1];this.value=g[0],this.meta.colorPostfix=v}var b=d.test(i),k=h.test(i),j=m.test(i),x=/--i/i.test(i),A=y.test(i),S=/--\$\w+/i.test(i);if(!(b||k||j||x||A))return this.digitPreprocessor();var P,w=i.split("--");if(this.key=w[0],b&&(this.meta.mode=w.find((function(e){return a.includes(e)}))),k){var O=w.find((function(e){return l.includes(e)}));this.meta.pseudoPrefix=["after","before","placeholder","selection"].includes(O)?"::":":",this.meta.pseudo=O}if(j){var C=w.find((function(e){return s.includes(e)}));this.meta.breakpoint=C}return x&&(this.meta.important=!!w.find((function(e){return"i"===e}))),A&&(this.meta.colorPostfix=w.find((function(e){return y.test("--"+e)}))),S&&(this.meta.parentClass=null==(P=w.find((function(e){return e.startsWith("$")})))?void 0:P.replace(/^\$/,"")),this.digitPreprocessor(),this},t.digitPreprocessor=function(){if(!g.test(this.key))return this;var e=f.config.theme.spacings,t=/^([a-z]+)(\d+)$/i.test(this.key),r=this.key.toString(),o=r.match(/^([a-z]+)(\d+)$/i)||r.match(/^([a-z]*)-(-?\d+[a-z]*?)$/i)||r.match(/^([a-z]+)-(auto)$/i);if(!o)return this;var i=o[2];return this.key=o[1],this.value=t?e[""+i.toLowerCase()]:i,this},t.getInitialHandled=function(){return this.options.handled?this.options.handled:!!this.isFalsyPropValue||!!y.includes(this.propKey)},t.getIsValid=function(){return!this.isFalsyPropValue&&!y.includes(this.propKey)},a(e,[{key:"isValueProp",get:function(){return"string"==typeof this.propValue||"number"==typeof this.propValue}},{key:"styleKeys",get:function(){return Object.keys(this.style||{}).join("-")}},{key:"styleKeysHash",get:function(){var e=u(this.meta,m);return Object.keys(this.style||{}).join("-")+JSON.stringify(e)}},{key:"isFalsyPropValue",get:function(){return null==this.propValue||"boolean"==typeof this.propValue&&!this.propValue}},{key:"isTruePropValue",get:function(){return"boolean"==typeof this.propValue&&this.propValue}}]),e}(),b=new(function(){function e(){var e;this.$style=null,this.cssString="",this.ssrAtomIds=null,r.isBrowser&&(this.$style=null==(e=globalThis.document)||null==e.querySelector?void 0:e.querySelector("[data-fower]"))}var t=e.prototype;return t.createStyleElement=function(){var e=document.createElement("style");return e.dataset.fower="",document.head.append(e),e},t.getSsrAtomIds=function(){var e,t;return this.$style?this.ssrAtomIds?this.ssrAtomIds:(null==(e=this.$style)||null==(t=e.dataset.fower)?void 0:t.split(","))||[]:[]},t.insertStyleToHtml=function(e){if(r.isBrowser){this.$style||(this.$style=this.createStyleElement());for(var t,o=p(e);!(t=o()).done;){var i=t.value;try{this.$style.sheet.insertRule(i)}catch(e){console.warn(e)}}}},t.insertStyles=function(e){if(void 0===e&&(e=[]),e.length)return r.isBrowser?this.insertStyleToHtml(e):void(this.cssString=this.cssString+" "+e.join(" "))},t.getStyle=function(){return this.cssString},e}()),k=/(-columns|(^|[^e]-)padding|[^t]-spacing|l-align|rows|(^|(^border|[dkmnptx]|le|ne)-)width|^border|tom|[ek]-start|(o|[^e]-du)ration|us|(^|[^tv]-)left|(^|-)top|tance|rgin|e-offset|(er|g|n|t)-block|(^|[^tv]-)right|basis|[gnt]-inline|gap|(^|[^e]-)height|ness|(^|[^p]-)inset|[ek]-end|elay|tline|ve|dent|-rotate|n-rule|(c|ck|d|ne|t)-size)$/,j=["color","backgroundColor","borderColor"],x=["children","onClick","onChange","onBlur","id","className","style","title","tabIndex","placeholder","href","src","contentEditable","defaultChecked","defaultValue"],A=function(){function e(e){var t,r;void 0===e&&(e={}),this.props=e,this.atoms=[],this.data={},this.getClassNameById=function(e){return f.config.prefix+e},this.traverseProps(e),null!=(t=f.config.mode)&&null!=(r=t.autoDarkMode)&&r.enabled&&this.createAutoDarkModeAtom()}var t=e.prototype;return t.traverseProps=function(e){if(!r.isEmptyObj(e)){for(var t,o=this.config,i=o.pseudos,n=void 0===i?[]:i,s=o.mode.modeList,a=o.theme.breakpoints||{},u=Object.keys(a),c=s||[],d=n,h=e.excludedProps,m=void 0===h?[]:h,y=Object.entries(e),g=p(this.plugins);!(t=g()).done;){var b=t.value;b.init&&b.init(e)}for(var k=0,j=y;k<j.length;k++){var A,S=j[k],P=S[0],w=S[1];if(!m.includes(P)&&!x.includes(P)&&this.isValidProp(P,w))if(null!=(A=this.config.objectPropKeys)&&A.includes(P))this.parseObjectProp(w,{});else{if(P.startsWith("_")){var O=P.replace(/^_/,""),C=Array.isArray(w)?w.reduce((function(e,t){var r;return l({},e,((r={})[t]=!0,r))}),{}):w;if(c.includes(O)){this.parseObjectProp(C,{mode:O});continue}if(u.includes(O)){this.parseObjectProp(C,{breakpoint:a[O]});continue}if(d.includes(O)){this.parseObjectProp(C,{pseudoPrefix:":",pseudo:O});continue}}if(!Array.isArray(w)||/^bgGradient[XY].*/i.test(P)&&!Array.isArray(w[0])){var K=f.compositions.get(P);if(K){this.parseObjectProp(K,{});var V=new v({propKey:P,propValue:w,props:this.props});V.handled=!0,V.style={},this.addAtom(V)}else{var I=new v({propKey:P,propValue:w,props:this.props},!1);try{this.mutateAtom(I),I.handled&&this.addAtom(I)}catch(e){continue}}}else this.parseResponsiveValue(P,w)}}for(var M,R=p(this.plugins);!(M=R()).done;){var T=M.value;T.afterAtomStyleCreate&&T.afterAtomStyleCreate(this)}}},t.getAutoDarkModeAtom=function(e){var t;if(e.meta.mode)return null;if(!e.style)return null;var o=Object.entries(e.style);if(null==o||!o.length)return null;var i,n={},s=f.config,a=s.mode.autoDarkMode.mappings,u=s.theme.colors,c=o[0],p=c[0],d=c[1];if(!j.includes(p))return null;if(!u[d])return null;var h=(d.match(/^([a-z]+)(\d+)$/i)||[])[2];if(!1===a[d])return null;var m="color"===p,y="backgroundColor"===p,g="borderColor"===p;return u[i=a[e.propKey]?a[e.propKey]:a[d]?a[d]:d.replace(h,a[h])]?(m?(n.propKey=i,n.type="color"):y?(n.propKey="bg"+r.upFirst(i),n.type="backgroundColor"):g&&(n.propKey="border"+r.upFirst(i),n.type="borderColor"),n.propValue=!0):m?(n.propKey="color",n.propValue=i):y?(n.propKey="bg",n.propValue=i):g&&(n.propKey="borderColor",n.propValue=i),n.style=((t={})[p]=i,t),new v(l({},n,{props:this.props,meta:l({},e.meta,{mode:"dark"})}))},t.createAutoDarkModeAtom=function(){for(var e,t=this,r=function(){var r,o=e.value;if(!o.isValid||"dark"===(null==(r=o.meta)?void 0:r.mode)||!j.includes(o.type))return"continue";if(t.atoms.find((function(e){return o.type===e.type&&"dark"===e.meta.mode&&!Reflect.has(e.meta,"pseudo")&&!Reflect.has(e.meta,"childSelector")})))return"continue";var i=t.getAutoDarkModeAtom(o);if(!i)return"continue";var n=f.atomCache.get(i.id);t.addAtom(n||i)},o=p(this.atoms);!(e=o()).done;)r()},t.formatCssValue=function(e,t){if(!k.test(e))return t;var o;if(r.isPercentNumber(String(t)))return String(t).replace("p","%");if(!r.isNumber(t))return t;if((o=Number(t))<1&&o>0)return 100*o+"%";var i=f.config;return"none"!==i.unit?i.transformUnit?i.transformUnit(o):t+f.config.unit:o},t.styleToString=function(e,t){var o=this,n=t.important,s=t.colorPostfix;return Object.entries(e).reduce((function(e,t){var a=t[0],l=t[1];a=a.replace(/\-\-.+/,"");var u=r.jsKeyToCssKey(a),c=n?" !important":"",p=f.theme.colors;try{return e+(u+": ")+(l=s?i.formatColor((null==p?void 0:p[l])||l,s):o.formatCssValue(u,(null==p?void 0:p[l])||l))+c+";"}catch(e){return""}}),"")},t.addAtom=function(e){var t,r,o;e.props=this.props,e.id||e.setId(),f.atomCache.get(e.id)||f.atomCache.set(e.id,e);for(var i,n=b.getSsrAtomIds(),s=((null==(t=this.config.theme)?void 0:t.colors)||{}).modes,a=0,u=Object.entries(void 0===s?{}:s);a<u.length;a++){var c=u[a],p=c[0],d=c[1];if(e.style){var h=Object.entries(e.style);if(h.length){var m=h[0],y=m[0],g=d[m[1]];if(g){var v="--"+p,k=JSON.parse(JSON.stringify(e));k.key=e.key+v,k.id=e.id+v,k.meta=l({mode:p},e.meta),k.style[y]=g,n.includes(k.id)&&(k.inserted=!0),this.atoms.push(k)}}}}if(n.includes(e.id)&&(e.inserted=!0),null!=(r=f.config.mode)&&null!=(o=r.autoDarkMode)&&o.enabled&&"color"===e.type&&"dark"!==(null==(i=e.meta)?void 0:i.mode)&&!Reflect.has(e.meta,"pseudo")){var j=this.atoms.findIndex((function(t){var r;return"color"===t.type&&"dark"!==(null==(r=t.meta)?void 0:r.mode)&&!Reflect.has(e.meta,"childSelector")&&!Reflect.has(e.meta,"pseudo")}));j>-1&&(this.atoms[j]=l({},this.atoms[j],{isValid:!1}))}this.atoms.push(e)},t.isValidProp=function(e,t){var r;return!!(null!=(r=this.config.objectPropKeys)&&r.includes(e)||e.startsWith("_")||Array.isArray(t)||["string","boolean","number","undefined","function"].includes(typeof t))},t.mutateAtom=function(e){for(var t,r=p(this.plugins);!(t=r()).done;){var o=t.value;null!=o.isMatch&&o.isMatch(e.key,this)&&(e.id||e.setId(),"function"==typeof e.value&&(e.value=e.value(this.props)),o.beforeHandleAtom&&(e=o.beforeHandleAtom(e,this)))}(Object.values(e.meta||{}).length||Object.values(e.style||{}).length)&&(e.id||e.setId());var i=f.atomCache.get(e.id);if(i)throw i.propKeys.includes(e.propKey)||i.propKeys.push(e.propKey),this.addAtom(i),new Error("atom is cached, add to this.atoms directly, no need to mutate");if(e.handled)throw this.addAtom(e),new Error("atom is handled, add to this.atoms directly ,no need to mutate");for(var n,s=p(this.plugins);!(n=s()).done;){var a=n.value;if(null!=a.isMatch&&a.isMatch(e.key,this)){a.handleAtom&&(e=null==a.handleAtom?void 0:a.handleAtom(e,this)),e.handled=!0;break}}},t.parseResponsiveValue=function(e,t){var r=Object.keys(this.config.theme.breakpoints),o=t.reduce((function(t,o,i){var n;return l({},t,((n={})[e+(0===i?"":"--"+r[i-1])]=o,n))}),{});this.parseObjectProp(o)},t.parseObjectProp=function(e,t){void 0===t&&(t={}),e="function"==typeof e?e(this.props):e;for(var r,o=p(n.parse(e,this.config.theme.breakpoints));!(r=o()).done;){var i=r.value,s=i.selector,a=i.selectorType,u=i.style,c=Object.entries(u);if(c.length){var d=c[0],h={propKey:d[0],propValue:d[1],props:this.props,meta:l({},t)};if(u&&Object.keys(u).length&&(h.style=u),"pseudo"===a&&h.meta){var m=s.match(/(:+)(.+)/)||[],y=m[2];h.meta.pseudoPrefix=m[1],h.meta.pseudo=y}"child"===a&&h.meta&&(h.meta.childSelector=s),"sibling"===a&&h.meta&&(h.meta.siblingSelector=s);var g=new v(h,!1);try{this.mutateAtom(g)}catch(e){continue}g.style&&Object.keys(g.style).length||(g.handled=!0);var b=f.atomCache.get(g.id);this.addAtom(b||g)}}},t.makeResponsiveStyle=function(e,t){return"@media (min-width: "+this.config.theme.breakpoints[e]+") {"+t+"}"},t.getClassNames=function(){var e=this,t=[];this.atoms.reduce((function(r,o){if(!o.style||!Object.keys(o.style).length)return r;var i=r.findIndex((function(e){return e.styleKeysHash===o.styleKeysHash}));if(!o.isValid)return r;var n=e.getClassNameById(o.id);return-1===i?(t.push(n),r=[].concat(r,[o])):(r.splice(i,1,o),t.splice(i,1,n)),r}),[]);var r,o=this.props.className,i=(void 0===o?"":o).split(/\s+/).filter((function(e){return!t.includes(e)&&!!e}));return t=t.concat(i),this.hasResponsive&&(r=t).push.apply(r,Object.keys(this.config.theme.breakpoints).map((function(e){return"r-"+e}))),t},t.toStyle=function(){var e=this;return this.atoms.reduce((function(t,o){if(!o.isValid)return t;var i=f.theme.colors,n=Object.entries(o.style).reduce((function(t,o){var n,s=o[0],a=o[1],u=e.formatCssValue(r.jsKeyToCssKey(s),i[a]||a);return l({},t,((n={})[s]=u,n))}),{});return l({},t,n)}),{})},t.toRules=function(e){void 0===e&&(e=!1);for(var t,o=this.config.mode.classPrefix,i=void 0===o?"":o,n=[],s=Object.keys(this.config.theme.breakpoints),a=p(this.atoms);!(t=a()).done;){var l=t.value,u="",c=l.id,d=l.style,f=void 0===d?{}:d,h=l.meta;if(l.isValid&&!r.isEmptyObj(f)){var m=h.pseudo,y=h.pseudoPrefix,g=h.mode,v=h.breakpoint,b=void 0===v?"":v,k=h.childSelector,j=h.siblingSelector,x=h.parentClass;if(e||!l.inserted){l.inserted=!0;var A=this.getClassNameById(c),S=h.global?h.global:"."+A;if(g&&(S="."+i+g+" "+S),j&&(S=""+S+j),m){var P=y+m;x?S="."+x+P+" "+S:S+=P}k?S=b?S+"."+s.slice(0,s.indexOf(b)+1).map((function(e){return"r-"+e})).join(".")+" "+k:S+" "+k:b&&(S=S+"."+s.slice(0,s.indexOf(b)+1).map((function(e){return"r-"+e})).join(".")),u=S+" { "+this.styleToString(f,l.meta)+" }",b&&(u=this.makeResponsiveStyle(b,u)),n.push(u)}}}return n},t.getParsedProps=function(){var e=this,t=this.props,o=this.atoms;return r.isEmptyObj(t)?{}:Object.entries(t).reduce((function(t,r){var i=r[0],n=r[1];return/.*--(\d+)?[a-z]+$/i.test(i)||o.find((function(t){return[t.propKey,t.key,t.id].concat(e.config.objectPropKeys||[]).includes(i)||t.propKeys.includes(i)}))||(t[i]=n),t}),{})},t.insertRules=function(){var e=this.toRules();b.insertStyles(e)},a(e,[{key:"uniqueClassName",get:function(){return r.objectToClassName(Object.keys(this.props))}},{key:"hasResponsive",get:function(){return this.atoms.some((function(e){return!!e.meta.breakpoint}))}},{key:"store",get:function(){return f}},{key:"config",get:function(){return f.config}},{key:"plugins",get:function(){return f.config.plugins}}]),e}();function S(e){for(var t=Object.entries(e),r=new A({}),o=0,i=t;o<i.length;o++){var n=i[o],s=n[0],a=n[1],l=new v({propKey:s,propValue:a,value:a,meta:{global:s},style:a});r.addAtom(l)}r.insertRules()}S({"*, ::before, ::after":{borderWidth:0,borderStyle:"solid",borderColor:"#e5e5e5",boxSizing:"border-box"}});var P=f.setConfig,w=f.getConfig,O=f.setTheme,C=f.getTheme,K=f.setMode,V=f.getMode,I=f.addAtom,M=f.composeAtom;exports.Atom=v,exports.Parser=A,exports.Store=d,exports.addAtom=I,exports.composeAtom=M,exports.createStyle=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o=t.reduce((function(e,t){var r;return l({},e,"string"==typeof t?((r={})[t]=!0,r):{css:t})}),{}),i=new A(o),n=i.toStyle();return n},exports.css=function(){for(var e,t,o=arguments.length,i=new Array(o),n=0;n<o;n++)i[n]=arguments[n];if(!i.length)return"";var s=new A(r.argsToProps(i,null==(e=f.config)||null==(t=e.objectPropKeys)?void 0:t[0]));return s.insertRules(),s.getClassNames().join(" ")},exports.digitReg=g,exports.getConfig=w,exports.getMode=V,exports.getTheme=C,exports.injectGlobalStyle=S,exports.isAtomicArgsValid=function(e){var t=r.argsToProps([e]),o=new A(t).getParsedProps();return!Object.keys(o).length},exports.keyframes=function(e,t){var o=Object.entries(e).reduce((function(e,t){var o=t[0],i=Object.entries(t[1]).reduce((function(e,t){var o=t[1];return e+(r.jsKeyToCssKey(t[0])+": ")+o+";"}),"");return e+(r.jsKeyToCssKey(o)+" {")+i+"}"}),""),i=t||"keyframes-"+r.hash(JSON.stringify(e));return b.insertStyles(["\n @keyframes "+i+" {\n "+o+"\n }\n "]),i},exports.setConfig=P,exports.setMode=K,exports.setTheme=O,exports.store=f,exports.styleSheet=b;
//# sourceMappingURL=core.cjs.production.min.js.map

@@ -980,2 +980,3 @@ import deepmerge from 'deepmerge';

}
propValue = typeof propValue === 'function' ? propValue(this.props) : propValue;
var breakpoints = this.config.theme.breakpoints;

@@ -982,0 +983,0 @@ var parsed = parse(propValue, breakpoints);

{
"name": "@fower/core",
"version": "1.84.0",
"version": "1.85.0",
"license": "MIT",

@@ -20,6 +20,6 @@ "main": "dist/index.js",

"string-hash": "^1.1.3",
"@fower/atomic-props": "1.84.0",
"@fower/utils": "1.84.0",
"@fower/css-object-processor": "1.84.0",
"@fower/color-helper": "1.84.0"
"@fower/atomic-props": "1.85.0",
"@fower/utils": "1.85.0",
"@fower/color-helper": "1.85.0",
"@fower/css-object-processor": "1.85.0"
},

@@ -26,0 +26,0 @@ "devDependencies": {

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

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