@xstyled/core
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -6,2 +6,13 @@ # Change Log | ||
## [2.4.1](https://github.com/gregberge/xstyled/tree/master/packages/core/compare/v2.4.0...v2.4.1) (2021-03-29) | ||
### Bug Fixes | ||
* **styled:** fix nested states ([#221](https://github.com/gregberge/xstyled/tree/master/packages/core/issues/221)) ([78fac38](https://github.com/gregberge/xstyled/tree/master/packages/core/commit/78fac380e996ed93ca99020de668df2e52ccb318)) | ||
# [2.4.0](https://github.com/gregberge/xstyled/tree/master/packages/core/compare/v2.3.0...v2.4.0) (2021-03-28) | ||
@@ -8,0 +19,0 @@ |
@@ -244,5 +244,5 @@ 'use strict'; | ||
var PROP_CHAR = "[-\\w]"; // prop value consists of non-semis unless backslash-escaped. | ||
var PROP_CHAR = "[-\\w]"; // prop value consists of non-semis and no curly braces unless backslash-escaped. | ||
var VALUE_CHAR = "(?:\\\\.|[^\\\\;])"; // prettier-ignore | ||
var VALUE_CHAR = "(?:\\\\.|[^\\\\;{}])"; // prettier-ignore | ||
@@ -249,0 +249,0 @@ var PROP_PATT = "(" + PROP_CHAR + "+)" + // capture prop name |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@xstyled/system"),r=require("@xstyled/util");function o(e){return t.getBreakpoints({theme:e})}function n(){var t=e.useState("undefined"==typeof window?null:window.innerWidth),r=t[0],o=t[1];return e.useEffect((function(){function e(){o(window.innerWidth)}return window.addEventListener("resize",e),o(window.innerWidth),function(){return window.removeEventListener("resize",e)}}),[]),r}function i(){return["&&{",t.system,"}"]}i.meta=t.system.meta;var u=function(e){return function(t){var r=Number(t);return e(Number.isNaN(r)?t:r)}},a=/\s+/,l=function(e){return function(t){var r=t.split(a);return function(t){return r.map((function(r){return e(r)(t)})).join(" ")}}},c=/\s*,\s*/,s=function(e){return function(t){var r=t.split(c);return function(t){return r.map((function(r){return e(r)(t)})).join(",")}}},d=u(t.getInset),f=u(t.getSpace),g=l(f),m=u(t.getBorder),h=u(t.getBorderWidth),p=l(h),v=u(t.getSize),w=l(t.getBorderStyle),y={margin:g,"margin-top":f,"margin-bottom":f,"margin-left":f,"margin-right":f,padding:g,"padding-top":f,"padding-bottom":f,"padding-left":f,"padding-right":f,gap:g,"grid-gap":g,"row-gap":f,"grid-row-gap":f,"column-gap":f,"grid-column-gap":f,color:t.getColor,"background-color":t.getColor,"border-color":t.getColor,"border-top-color":t.getColor,"border-right-color":t.getColor,"border-bottom-color":t.getColor,"border-left-color":t.getColor,"outline-color":t.getColor,fill:t.getColor,stroke:t.getColor,"border-radius":l(u(t.getRadius)),"border-top-left-radius":l(u(t.getRadius)),"border-top-right-radius":l(u(t.getRadius)),"border-bottom-right-radius":l(u(t.getRadius)),"border-bottom-left-radius":l(u(t.getRadius)),border:m,"border-top":m,"border-right":m,"border-bottom":m,"border-left":m,"border-width":p,"border-top-width":h,"border-right-width":h,"border-bottom-width":h,"border-left-width":h,"outline-width":h,"border-style":w,"border-top-style":t.getBorderStyle,"border-right-style":t.getBorderStyle,"border-bottom-style":t.getBorderStyle,"border-left-style":t.getBorderStyle,"outline-style":t.getBorderStyle,"box-shadow":s(t.getShadow),"text-shadow":s(t.getShadow),width:v,height:v,"max-width":v,"max-height":v,"min-width":v,"min-height":v,"mask-size":s(v),"z-index":u(t.getZIndex),"font-family":t.getFont,"font-size":u(t.getFontSize),"line-height":u(t.getLineHeight),"font-weight":t.getFontWeight,"letter-spacing":u(t.getLetterSpacing),transition:t.getTransition,"transition-duration":t.getDuration,"animation-duration":t.getDuration,animation:t.getAnimation,top:d,right:d,bottom:d,left:d,"animation-timing-function":t.getTimingFunction,"transition-timing-function":t.getTimingFunction,transform:t.getTransform,"transition-property":t.getTransitionProperty},b=function(e){return function(r){return function(o){var n=e(t.getBreakpoints(o),r);return null===n?"0":n||r}}},x={"min-width":b(t.getBreakpointMin),"max-width":b(t.getBreakpointMax)},C=new RegExp("(?:([-\\w]+)(\\s*:\\s*)(?=\\S)((?:\\\\.|[^\\\\;])*?)(\\s*!important)?(\\s*;)|(@media\\b\\s*)(?=\\S)([^{]+?)(\\s*\\{))","gs"),S=new RegExp("(\\(\\s*)([-\\w]+)(\\s*:\\s*)([^\\)]*?)(\\s*\\))","gs");function M(){return(M=Object.assign||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 E(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)t.indexOf(r=i[o])>=0||(n[r]=e[r]);return n}var k=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(".")},B=function(e){return"--"+e.replace(/\./g,"-")},j=function(e,t){return"var("+B(e)+", "+t+")"},T=function(e,t){return e+": "+t+";"};function O(e,t,o,n){void 0===o&&(o=Object.keys(e));var i=Array.isArray(e)?[]:{};for(var u in o){var a=o[u],l=e[a],c=k(n,a);r.obj(l)?i[a]=O(l,t,Object.keys(l),c):r.string(l)?i[a]=j(c,l):r.func(l)&&(i[a]=j(c,r.cascade(l,{theme:t})))}return i}function _(e,t,o,n,i){for(var u in void 0===o&&(o=Object.keys(e)),void 0===i&&(i={value:""}),o){var a=o[u],l=e[a],c=k(n,a);r.obj(l)?_(l,t,Object.keys(l),c,i):r.string(l)?i.value+=T(B(c),l):r.func(l)&&(i.value+=T(B(c),r.cascade(l,{theme:t})))}return i.value}var I="xstyled-color-mode",L="undefined"!=typeof window&&function(){try{var e="xstyled-test-key";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}()?{get:function(){return window.localStorage.getItem(I)},set:function(e){window.localStorage.setItem(I,e)},clear:function(){return window.localStorage.removeItem(I)}}:{get:function(){return null},set:function(){},clear:function(){}},P=function(e){return"xstyled-color-mode-"+e},q=["light","dark"],R=function(e){return"(prefers-color-scheme: "+e+")"};function z(e){return Boolean(e&&e.colors&&e.colors.modes)}function F(e){return Boolean(e&&(void 0===e.useCustomProperties||e.useCustomProperties))}function N(e){return e.initialColorModeName||"default"}function W(e){var t=[];for(var r in e)t=[].concat(t,Object.keys(e[r]));return t}var A="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;function D(t,r){var o=(void 0===r?{}:r).target,n=function(t){var r=e.useMemo((function(){return function(e){return Boolean(e&&(void 0===e.useColorSchemeMediaQuery||e.useColorSchemeMediaQuery))}(t)?q.map((function(e){if(!z(t))return null;if(!t.colors.modes[e])return null;var r=function(e){if("undefined"==typeof window||void 0===window.matchMedia)return null;var t=R(e);return window.matchMedia(t)}(e);return r?{mode:e,mql:r}:null})).filter(Boolean):[]}),[t]),o=e.useState((function(){var e=r.find((function(e){return e.mql.matches}));return e?e.mode:null})),n=o[0],i=o[1];return e.useEffect((function(){var e=r.map((function(e){var t=e.mode,r=e.mql,o=function(e){i(e.matches?t:function(e){return e===t?null:t})};return r.addEventListener("change",o),function(){return r.removeEventListener("change",o)}}));return function(){return e.forEach((function(e){return e()}))}})),n}(t),i=function(e){return e.defaultColorModeName||N(e)}(t),u=N(t),a=e.useState((function(){return z(t)?i:null})),l=a[0],c=a[1],s=F(t),d=e.useRef(!1),f=e.useCallback((function(e){d.current=!0,c(e)}),[]);return A((function(){if(z(t)){var e=L.get();l!==(e||n||i)&&c(e||n||i)}}),[]),A((function(){d.current&&(l?L.set(l):L.clear())}),[l]),A((function(){if(!L.get()){var e=n||i;e!==l&&c(e)}}),[l,n,i]),A((function(){if(l&&s&&(L.get()||u!==l)){var e=P(l),t=o||document.body;return t.classList.add(e),function(){t.classList.remove(e)}}}),[s,o,l,u]),[l,f]}function Q(t,r){var o=e.useState(r)[0],n=e.useMemo((function(){if(!o)return null;if(!F(t))return null;if(!z(t))return t;var e=t.colors,r=e.modes,n=E(e,["modes"]),i=W(r);return M({},t,{colors:M({},n,O(n,t,i,"xstyled-colors"),{modes:r}),__rawColors:t.colors})}),[o,t]),i=e.useMemo((function(){return r?F(t)?null:z(t)?r===N(t)?M({},t,{__colorMode:r}):M({},t,{colors:M({},t.colors,t.colors.modes[r]),__colorMode:r,__rawColors:t.colors}):t:null}),[t,r]);return n||i}var H=e.createContext(null);function G(e){var t=(void 0===e?{}:e).target;return"(function() { try {\n var mode = localStorage.getItem('"+I+"');\n if (mode) "+(void 0===t?"document.body":t)+".classList.add('xstyled-color-mode-' + mode);\n } catch (e) {} })();"}exports.ColorModeContext=H,exports.createBox=i,exports.createColorModeProvider=function(t){var r=t.ThemeContext,o=t.ThemeProvider,n=t.ColorModeStyle;return function(t){var i=t.children,u=t.target,a=t.targetSelector,l=e.useContext(r);if(!l)throw new Error("[ColorModeProvider] requires ThemeProvider upper in the tree");var c=D(l,{target:u}),s=Q(l,c[0]);return e.createElement(e.Fragment,null,e.createElement(n,{targetSelector:a}),e.createElement(o,{theme:s},e.createElement(H.Provider,{value:c},i)))}},exports.createColorStyles=function(e,t){var r=(void 0===t?{}:t).targetSelector,o=void 0===r?"body":r;if(!z(e))return null;var n=e.colors,i=n.modes,u=E(n,["modes"]),a=W(i),l=_(u,e,a,"xstyled-colors");function c(t){var r=function(e,t){return M({},e,{colors:M({},e.colors,e.colors.modes[t])})}(e,t),o=r.colors,n=o.modes;return _(M({},E(o,["modes"]),n[t]),r,a,"xstyled-colors")}return!1!==e.useColorSchemeMediaQuery&&q.forEach((function(e){if(i[e]){var t="@media "+R(e);l+=t+"{"+c(e)+"}"}})),[N(e)].concat(Object.keys(i)).forEach((function(e){var t="&."+P(e);l+=t+"{"+c(e)+"}"})),o+"{"+l+"}"},exports.getColorModeInitScriptElement=function(t){return e.createElement("script",{key:"xstyled-color-mode-init",dangerouslySetInnerHTML:{__html:G(t)}})},exports.getColorModeInitScriptTag=function(e){return"<script>"+G(e)+"<\/script>"},exports.propGetters=y,exports.transform=function(e){if("string"!=typeof e)return e;for(var t,r=0,o=[],n=function(){var n=t[1],i=t[2],u=t[3],a=t[4],l=t[5],c=t[6],s=t[7],d=t[8];if(c)o.push(e.slice(r,t.index)),o.push(c),function(e){for(var t,r=0,o=[],n=function(){var n=t[1],i=t[2],u=t[3],a=t[4],l=t[5],c=x[i];c&&(o.push(e.slice(r,t.index)),o.push((function(e){return""+n+i+u+c(a)(e)+l})),r=t.index+t[0].length)};t=S.exec(e);)n();return o.push(e.slice(r,e.length)),o}(s).forEach((function(e){return o.push(e)})),o.push(d),r=t.index+t[0].length;else{var f=y[n];f&&(o.push(e.slice(r,t.index)),o.push((function(e){return""+n+i+f(u)(e)+(a||"")+l})),r=t.index+t[0].length)}};t=C.exec(e);)n();return o.push(e.slice(r,e.length)),o},exports.useColorMode=function(){var t=e.useContext(H);if(!t)throw new Error("[useColorMode] requires the ColorModeProvider component");return t},exports.useColorModeState=D,exports.useColorModeTheme=Q,exports.useThemeBreakpoint=function(t){var r=o(t),i=n();return e.useMemo((function(){return Object.keys(r).reverse().find((function(e){return null!==i&&i>r[e]}))||null}),[r,i])},exports.useThemeBreakpoints=o,exports.useThemeDown=function(e,t){var r=function(e,t){var r=o(e)[t];return 0===r?null:r-.02}(e,t),i=n();return null!==i&&null!==r&&i<r},exports.useThemeUp=function(e,t){var r=function(e,t){var r=o(e)[t];return 0===r?null:r}(e,t),i=n();return null!==i&&null!==r&&i>=r},exports.useViewportWidth=n; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@xstyled/system"),r=require("@xstyled/util");function o(e){return t.getBreakpoints({theme:e})}function n(){var t=e.useState("undefined"==typeof window?null:window.innerWidth),r=t[0],o=t[1];return e.useEffect((function(){function e(){o(window.innerWidth)}return window.addEventListener("resize",e),o(window.innerWidth),function(){return window.removeEventListener("resize",e)}}),[]),r}function i(){return["&&{",t.system,"}"]}i.meta=t.system.meta;var u=function(e){return function(t){var r=Number(t);return e(Number.isNaN(r)?t:r)}},a=/\s+/,l=function(e){return function(t){var r=t.split(a);return function(t){return r.map((function(r){return e(r)(t)})).join(" ")}}},c=/\s*,\s*/,s=function(e){return function(t){var r=t.split(c);return function(t){return r.map((function(r){return e(r)(t)})).join(",")}}},d=u(t.getInset),f=u(t.getSpace),g=l(f),m=u(t.getBorder),h=u(t.getBorderWidth),p=l(h),v=u(t.getSize),w=l(t.getBorderStyle),y={margin:g,"margin-top":f,"margin-bottom":f,"margin-left":f,"margin-right":f,padding:g,"padding-top":f,"padding-bottom":f,"padding-left":f,"padding-right":f,gap:g,"grid-gap":g,"row-gap":f,"grid-row-gap":f,"column-gap":f,"grid-column-gap":f,color:t.getColor,"background-color":t.getColor,"border-color":t.getColor,"border-top-color":t.getColor,"border-right-color":t.getColor,"border-bottom-color":t.getColor,"border-left-color":t.getColor,"outline-color":t.getColor,fill:t.getColor,stroke:t.getColor,"border-radius":l(u(t.getRadius)),"border-top-left-radius":l(u(t.getRadius)),"border-top-right-radius":l(u(t.getRadius)),"border-bottom-right-radius":l(u(t.getRadius)),"border-bottom-left-radius":l(u(t.getRadius)),border:m,"border-top":m,"border-right":m,"border-bottom":m,"border-left":m,"border-width":p,"border-top-width":h,"border-right-width":h,"border-bottom-width":h,"border-left-width":h,"outline-width":h,"border-style":w,"border-top-style":t.getBorderStyle,"border-right-style":t.getBorderStyle,"border-bottom-style":t.getBorderStyle,"border-left-style":t.getBorderStyle,"outline-style":t.getBorderStyle,"box-shadow":s(t.getShadow),"text-shadow":s(t.getShadow),width:v,height:v,"max-width":v,"max-height":v,"min-width":v,"min-height":v,"mask-size":s(v),"z-index":u(t.getZIndex),"font-family":t.getFont,"font-size":u(t.getFontSize),"line-height":u(t.getLineHeight),"font-weight":t.getFontWeight,"letter-spacing":u(t.getLetterSpacing),transition:t.getTransition,"transition-duration":t.getDuration,"animation-duration":t.getDuration,animation:t.getAnimation,top:d,right:d,bottom:d,left:d,"animation-timing-function":t.getTimingFunction,"transition-timing-function":t.getTimingFunction,transform:t.getTransform,"transition-property":t.getTransitionProperty},b=function(e){return function(r){return function(o){var n=e(t.getBreakpoints(o),r);return null===n?"0":n||r}}},x={"min-width":b(t.getBreakpointMin),"max-width":b(t.getBreakpointMax)},C=new RegExp("(?:([-\\w]+)(\\s*:\\s*)(?=\\S)((?:\\\\.|[^\\\\;{}])*?)(\\s*!important)?(\\s*;)|(@media\\b\\s*)(?=\\S)([^{]+?)(\\s*\\{))","gs"),S=new RegExp("(\\(\\s*)([-\\w]+)(\\s*:\\s*)([^\\)]*?)(\\s*\\))","gs");function M(){return(M=Object.assign||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 E(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)t.indexOf(r=i[o])>=0||(n[r]=e[r]);return n}var k=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(".")},B=function(e){return"--"+e.replace(/\./g,"-")},j=function(e,t){return"var("+B(e)+", "+t+")"},T=function(e,t){return e+": "+t+";"};function O(e,t,o,n){void 0===o&&(o=Object.keys(e));var i=Array.isArray(e)?[]:{};for(var u in o){var a=o[u],l=e[a],c=k(n,a);r.obj(l)?i[a]=O(l,t,Object.keys(l),c):r.string(l)?i[a]=j(c,l):r.func(l)&&(i[a]=j(c,r.cascade(l,{theme:t})))}return i}function _(e,t,o,n,i){for(var u in void 0===o&&(o=Object.keys(e)),void 0===i&&(i={value:""}),o){var a=o[u],l=e[a],c=k(n,a);r.obj(l)?_(l,t,Object.keys(l),c,i):r.string(l)?i.value+=T(B(c),l):r.func(l)&&(i.value+=T(B(c),r.cascade(l,{theme:t})))}return i.value}var I="xstyled-color-mode",L="undefined"!=typeof window&&function(){try{var e="xstyled-test-key";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}()?{get:function(){return window.localStorage.getItem(I)},set:function(e){window.localStorage.setItem(I,e)},clear:function(){return window.localStorage.removeItem(I)}}:{get:function(){return null},set:function(){},clear:function(){}},P=function(e){return"xstyled-color-mode-"+e},q=["light","dark"],R=function(e){return"(prefers-color-scheme: "+e+")"};function z(e){return Boolean(e&&e.colors&&e.colors.modes)}function F(e){return Boolean(e&&(void 0===e.useCustomProperties||e.useCustomProperties))}function N(e){return e.initialColorModeName||"default"}function W(e){var t=[];for(var r in e)t=[].concat(t,Object.keys(e[r]));return t}var A="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;function D(t,r){var o=(void 0===r?{}:r).target,n=function(t){var r=e.useMemo((function(){return function(e){return Boolean(e&&(void 0===e.useColorSchemeMediaQuery||e.useColorSchemeMediaQuery))}(t)?q.map((function(e){if(!z(t))return null;if(!t.colors.modes[e])return null;var r=function(e){if("undefined"==typeof window||void 0===window.matchMedia)return null;var t=R(e);return window.matchMedia(t)}(e);return r?{mode:e,mql:r}:null})).filter(Boolean):[]}),[t]),o=e.useState((function(){var e=r.find((function(e){return e.mql.matches}));return e?e.mode:null})),n=o[0],i=o[1];return e.useEffect((function(){var e=r.map((function(e){var t=e.mode,r=e.mql,o=function(e){i(e.matches?t:function(e){return e===t?null:t})};return r.addEventListener("change",o),function(){return r.removeEventListener("change",o)}}));return function(){return e.forEach((function(e){return e()}))}})),n}(t),i=function(e){return e.defaultColorModeName||N(e)}(t),u=N(t),a=e.useState((function(){return z(t)?i:null})),l=a[0],c=a[1],s=F(t),d=e.useRef(!1),f=e.useCallback((function(e){d.current=!0,c(e)}),[]);return A((function(){if(z(t)){var e=L.get();l!==(e||n||i)&&c(e||n||i)}}),[]),A((function(){d.current&&(l?L.set(l):L.clear())}),[l]),A((function(){if(!L.get()){var e=n||i;e!==l&&c(e)}}),[l,n,i]),A((function(){if(l&&s&&(L.get()||u!==l)){var e=P(l),t=o||document.body;return t.classList.add(e),function(){t.classList.remove(e)}}}),[s,o,l,u]),[l,f]}function Q(t,r){var o=e.useState(r)[0],n=e.useMemo((function(){if(!o)return null;if(!F(t))return null;if(!z(t))return t;var e=t.colors,r=e.modes,n=E(e,["modes"]),i=W(r);return M({},t,{colors:M({},n,O(n,t,i,"xstyled-colors"),{modes:r}),__rawColors:t.colors})}),[o,t]),i=e.useMemo((function(){return r?F(t)?null:z(t)?r===N(t)?M({},t,{__colorMode:r}):M({},t,{colors:M({},t.colors,t.colors.modes[r]),__colorMode:r,__rawColors:t.colors}):t:null}),[t,r]);return n||i}var H=e.createContext(null);function G(e){var t=(void 0===e?{}:e).target;return"(function() { try {\n var mode = localStorage.getItem('"+I+"');\n if (mode) "+(void 0===t?"document.body":t)+".classList.add('xstyled-color-mode-' + mode);\n } catch (e) {} })();"}exports.ColorModeContext=H,exports.createBox=i,exports.createColorModeProvider=function(t){var r=t.ThemeContext,o=t.ThemeProvider,n=t.ColorModeStyle;return function(t){var i=t.children,u=t.target,a=t.targetSelector,l=e.useContext(r);if(!l)throw new Error("[ColorModeProvider] requires ThemeProvider upper in the tree");var c=D(l,{target:u}),s=Q(l,c[0]);return e.createElement(e.Fragment,null,e.createElement(n,{targetSelector:a}),e.createElement(o,{theme:s},e.createElement(H.Provider,{value:c},i)))}},exports.createColorStyles=function(e,t){var r=(void 0===t?{}:t).targetSelector,o=void 0===r?"body":r;if(!z(e))return null;var n=e.colors,i=n.modes,u=E(n,["modes"]),a=W(i),l=_(u,e,a,"xstyled-colors");function c(t){var r=function(e,t){return M({},e,{colors:M({},e.colors,e.colors.modes[t])})}(e,t),o=r.colors,n=o.modes;return _(M({},E(o,["modes"]),n[t]),r,a,"xstyled-colors")}return!1!==e.useColorSchemeMediaQuery&&q.forEach((function(e){if(i[e]){var t="@media "+R(e);l+=t+"{"+c(e)+"}"}})),[N(e)].concat(Object.keys(i)).forEach((function(e){var t="&."+P(e);l+=t+"{"+c(e)+"}"})),o+"{"+l+"}"},exports.getColorModeInitScriptElement=function(t){return e.createElement("script",{key:"xstyled-color-mode-init",dangerouslySetInnerHTML:{__html:G(t)}})},exports.getColorModeInitScriptTag=function(e){return"<script>"+G(e)+"<\/script>"},exports.propGetters=y,exports.transform=function(e){if("string"!=typeof e)return e;for(var t,r=0,o=[],n=function(){var n=t[1],i=t[2],u=t[3],a=t[4],l=t[5],c=t[6],s=t[7],d=t[8];if(c)o.push(e.slice(r,t.index)),o.push(c),function(e){for(var t,r=0,o=[],n=function(){var n=t[1],i=t[2],u=t[3],a=t[4],l=t[5],c=x[i];c&&(o.push(e.slice(r,t.index)),o.push((function(e){return""+n+i+u+c(a)(e)+l})),r=t.index+t[0].length)};t=S.exec(e);)n();return o.push(e.slice(r,e.length)),o}(s).forEach((function(e){return o.push(e)})),o.push(d),r=t.index+t[0].length;else{var f=y[n];f&&(o.push(e.slice(r,t.index)),o.push((function(e){return""+n+i+f(u)(e)+(a||"")+l})),r=t.index+t[0].length)}};t=C.exec(e);)n();return o.push(e.slice(r,e.length)),o},exports.useColorMode=function(){var t=e.useContext(H);if(!t)throw new Error("[useColorMode] requires the ColorModeProvider component");return t},exports.useColorModeState=D,exports.useColorModeTheme=Q,exports.useThemeBreakpoint=function(t){var r=o(t),i=n();return e.useMemo((function(){return Object.keys(r).reverse().find((function(e){return null!==i&&i>r[e]}))||null}),[r,i])},exports.useThemeBreakpoints=o,exports.useThemeDown=function(e,t){var r=function(e,t){var r=o(e)[t];return 0===r?null:r-.02}(e,t),i=n();return null!==i&&null!==r&&i<r},exports.useThemeUp=function(e,t){var r=function(e,t){var r=o(e)[t];return 0===r?null:r}(e,t),i=n();return null!==i&&null!==r&&i>=r},exports.useViewportWidth=n; | ||
//# sourceMappingURL=core.cjs.production.min.js.map |
@@ -240,5 +240,5 @@ import { useState, useEffect, useMemo, useRef, useCallback, createContext, useContext, createElement, useLayoutEffect, Fragment } from 'react'; | ||
var PROP_CHAR = "[-\\w]"; // prop value consists of non-semis unless backslash-escaped. | ||
var PROP_CHAR = "[-\\w]"; // prop value consists of non-semis and no curly braces unless backslash-escaped. | ||
var VALUE_CHAR = "(?:\\\\.|[^\\\\;])"; // prettier-ignore | ||
var VALUE_CHAR = "(?:\\\\.|[^\\\\;{}])"; // prettier-ignore | ||
@@ -245,0 +245,0 @@ var PROP_PATT = "(" + PROP_CHAR + "+)" + // capture prop name |
{ | ||
"name": "@xstyled/core", | ||
"description": "xstyled core utilities.", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"sideEffects": false, | ||
@@ -29,3 +29,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "100a013443f8330caaa94615c9ecf93a0ac2ec0b" | ||
"gitHead": "b5028a3ea627ff60f15d69e5c9737ee6e78ca388" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
215237