@vtex/admin-ui-system
Advanced tools
Comparing version 0.9.0 to 0.10.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.10.0](https://github.com/vtex/onda/compare/@vtex/admin-ui-system@0.9.0...@vtex/admin-ui-system@0.10.0) (2021-01-26) | ||
### Features | ||
* **alert:** update alert according to the design specifications ([3b44b3d](https://github.com/vtex/onda/commit/3b44b3d619cb339c1919586dffd23a99aaca2dd3)) | ||
# [0.9.0](https://github.com/vtex/onda/compare/@vtex/admin-ui-system@0.8.0...@vtex/admin-ui-system@0.9.0) (2021-01-21) | ||
@@ -8,0 +19,0 @@ |
@@ -200,3 +200,15 @@ 'use strict'; | ||
}; | ||
/** | ||
* Function that helps in the creation of a themeKey with conditional variants | ||
* @param sequence Array<[conditional variant, themeKey accessor]> | ||
*/ | ||
var inlineVariant = function inlineVariant(sequence) { | ||
return sequence.reduce(function (acc, item) { | ||
var invariant = item[0], | ||
modifier = item[1]; | ||
return invariant ? "" + acc + modifier : acc; | ||
}, ''); | ||
}; | ||
var aliases = { | ||
@@ -792,2 +804,3 @@ bg: 'backgroundColor', | ||
exports.hue = hue; | ||
exports.inlineVariant = inlineVariant; | ||
exports.invert = invert; | ||
@@ -794,0 +807,0 @@ exports.isFunction = isFunction; |
@@ -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 r=require("react"),t=e(r),n=e(require("@emotion/css/create-instance")),o=require("@emotion/react"),i=e(require("deepmerge")),a=e(require("@emotion/react/package.json")),s=e(require("lodash.get")),d=e(require("lodash.pick")),c=e(require("lodash.omit")),u=e(require("lodash.merge")),l=e(require("@emotion/is-prop-valid")),p=e(require("tiny-invariant")),f=require("polished");function g(){return(g=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var m=r.createContext({EMOTION_VERSION:a.version,theme:{}}),b=function(){return r.useContext(m)},h="function"==typeof Symbol&&Symbol.for,y=h?Symbol.for("react.element"):60103,v=h?Symbol.for("react.forward_ref"):60103,S={isMergeableObject:function(e){return!!e&&"object"==typeof e&&e.$$typeof!==y&&e.$$typeof!==v},arrayMerge:function(e,r){return r}},x=function(e,r){return i(e,r,S)};function k(e){var r=e.context;return t.createElement(o.ThemeContext.Provider,{value:r.theme},t.createElement(m.Provider,{value:r},e.children))}function B(e){var r=e.theme,n=e.children,o=b(),i="function"==typeof r?g({},o,{theme:r(o.theme)}):x.all({},o,{theme:r});return t.createElement(k,{context:i},n)}x.all=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return i.all(r,S)};var E=function(e){return"function"==typeof e},z=function(e){return 0===Object.keys(e).length&&e.constructor===Object};function I(e,r){var t={};for(var n in e)l(n)&&!r.includes(n)&&(t[n]=e[n]);return t}var R=function(e,r){var t;return g({},e,((t={})[r]=function(e,r){if("number"!=typeof r||r>=0){if("string"==typeof r&&r.startsWith("-")){var t=r.substring(1);return"-"+s(e,t,t)}return s(e,r,r)}var n=Math.abs(r),o=s(e,n,n);return"string"==typeof o?"-"+o:-1*Number(o)},t))},w={bg:"backgroundColor",fontSettings:"fontVariationSettings"},W=[40,52,64].map((function(e){return e+"em"})),T={space:[0,4,8,16,32,64,128,256,512],fontSizes:[12,14,16,20,24,32,48,64,72]},j={marginX:["marginLeft","marginRight"],marginY:["marginTop","marginBottom"],paddingX:["paddingLeft","paddingRight"],paddingY:["paddingTop","paddingBottom"],size:["width","height"]},O=["margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginBlock","marginBlockEnd","marginBlockStart","marginInline","marginInlineEnd","marginInlineStart","top","bottom","left","right"].reduce(R,{}),C={color:"colors",backgroundColor:"colors",borderColor:"colors",caretColor:"colors",columnRuleColor:"colors",opacity:"opacities",transition:"transitions",margin:"space",marginTop:"space",marginRight:"space",marginBottom:"space",marginLeft:"space",marginX:"space",marginY:"space",marginBlock:"space",marginBlockEnd:"space",marginBlockStart:"space",marginInline:"space",marginInlineEnd:"space",marginInlineStart:"space",padding:"space",paddingTop:"space",paddingRight:"space",paddingBottom:"space",paddingLeft:"space",paddingX:"space",paddingY:"space",paddingBlock:"space",paddingBlockEnd:"space",paddingBlockStart:"space",paddingInline:"space",paddingInlineEnd:"space",paddingInlineStart:"space",scrollPadding:"space",scrollPaddingTop:"space",scrollPaddingRight:"space",scrollPaddingBottom:"space",scrollPaddingLeft:"space",scrollPaddingX:"space",scrollPaddingY:"space",inset:"space",insetBlock:"space",insetBlockEnd:"space",insetBlockStart:"space",insetInline:"space",insetInlineEnd:"space",insetInlineStart:"space",top:"space",right:"space",bottom:"space",left:"space",gridGap:"space",gridColumnGap:"space",gridRowGap:"space",gap:"space",columnGap:"space",rowGap:"space",fontFamily:"fonts",fontSize:"fontSizes",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",border:"border",borderTop:"borders",borderRight:"borders",borderBottom:"borders",borderLeft:"borders",borderWidth:"borderWidths",borderStyle:"borderStyles",borderRadius:"radii",borderTopRightRadius:"radii",borderTopLeftRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",borderTopWidth:"borderWidths",borderTopColor:"colors",borderTopStyle:"borderStyles",borderBottomWidth:"borderWidths",borderBottomColor:"colors",borderBottomStyle:"borderStyles",borderLeftWidth:"borderWidths",borderLeftColor:"colors",borderLeftStyle:"borderStyles",borderRightWidth:"borderWidths",borderRightColor:"colors",borderRightStyle:"borderStyles",borderBlock:"borders",borderBlockEnd:"borders",borderBlockEndStyle:"borderStyles",borderBlockEndWidth:"borderWidths",borderBlockStart:"borders",borderBlockStartStyle:"borderStyles",borderBlockStartWidth:"borderWidths",borderBlockStyle:"borderStyles",borderBlockWidth:"borderWidths",borderEndEndRadius:"radii",borderEndStartRadius:"radii",borderInline:"borders",borderInlineEnd:"borders",borderInlineEndStyle:"borderStyles",borderInlineEndWidth:"borderWidths",borderInlineStart:"borders",borderInlineStartStyle:"borderStyles",borderInlineStartWidth:"borderWidths",borderInlineStyle:"borderStyles",borderInlineWidth:"borderWidths",borderStartEndRadius:"radii",borderStartStartRadius:"radii",outlineColor:"colors",boxShadow:"shadows",textShadow:"shadows",zIndex:"zIndices",width:"sizes",minWidth:"sizes",maxWidth:"sizes",height:"sizes",minHeight:"sizes",maxHeight:"sizes",flexBasis:"sizes",size:"sizes",blockSize:"sizes",inlineSize:"sizes",maxBlockSize:"sizes",maxInlineSize:"sizes",minBlockSize:"sizes",minInlineSize:"sizes",fill:"colors",stroke:"colors",fontVariationSettings:"fontSettings",text:"text"},L=function e(r){return void 0===r&&(r={}),function(t){void 0===t&&(t={});var n=g({},T,"theme"in t?t.theme:t),o={},i="function"==typeof r?r(n):r;i.themeKey&&delete(i=g({},s(n,i.themeKey),i)).themeKey;var a=function(e){return function(r){var t={},n=[null].concat((r&&r.breakpoints||W).map((function(e){return"@media screen and (min-width: "+e+")"})));for(var o in e){var i=o,a=e[i];if("function"==typeof a&&(a=a(null!=r?r:{})),null!=a)if(Array.isArray(a))for(var s=0;s<a.slice(0,n.length).length;s++){var d,c=n[s];c?(t[c]=null!==(d=t[c])&&void 0!==d?d:{},null!=a[s]&&(t[c][i]=a[s])):t[i]=a[s]}else t[i]=a}return t}}(i)(n);for(var d in a){var c=a[d],u="function"==typeof c?c(n):c;if(u&&"object"==typeof u)o[d]=e(u)(n);else{var l=d in w?w[d]:d,p=s(n,l in C?C[l]:void 0,s(n,l,{})),f=s(O,l,s)(p,u,u),m=f&&"object"==typeof f;if(m){var b,h=f.default;h?"object"==typeof h?(f=e(h)(n),Object.assign(o,f),delete o[l]):((b={})[l]=h,f=b,Object.assign(o,f)):(f=e(f)(n),Object.assign(o,f),delete o[l])}if(l in j)for(var y=j[l],v=0;v<y.length;v++)o[y[v]]=f;else m||(o[l]=f)}}return o}};function P(e){return n({key:"vtex-admin-ui-"+e})}function q(e){return function(r){return t.createElement(B,{theme:e},r.children)}}function H(e,r){return{stylesOf:function(r){return s(e,r,{})},cn:function(t){var n=L(t)(e);return r.css(n)}}}function M(){var e=b().theme;return(z(e)||!e)&&p(!1),e}var A=function(e,r){var t=s(e,"colors."+r,r);return/^var\(--/.test(t)?t.replace(/^var\(--(\w+)(.*?), /,"").replace(/\)/,""):t},G=function(e,r){return function(t){return f.desaturate(r,A(t,e))}};exports.get=s,exports.pick=d,exports.omit=c,exports.isPropValid=l,exports.alpha=function(e,r){return function(t){return f.rgba(A(t,e),r)}},exports.cleanProps=function(e,r){void 0===r&&(r=[]);var t=I(e,r);return c.apply(void 0,[t].concat(r))},exports.complement=function(e){return function(r){return f.complement(A(r,e))}},exports.createEmotionInstance=P,exports.createSystem=function(e,r){var t=P(r),n=q(e),o=H(e,t);return{emotionInstance:t,ThemeProvider:n,cn:o.cn,stylesOf:o.stylesOf}},exports.createThemeConsumers=H,exports.createThemeProvider=q,exports.darken=function(e,r){return function(t){return f.darken(r,A(t,e))}},exports.desaturate=G,exports.forwardRef=function(e){return t.forwardRef(e)},exports.getColor=A,exports.grayscale=function(e){return G(e,1)},exports.hue=function(e,r){return function(t){return f.setHue(r,A(t,e))}},exports.invert=function(e){return function(r){return f.invert(A(r,e))}},exports.isFunction=E,exports.isObjectEmpty=z,exports.jsxs=function(e){var r=e.children,n=e.component,o=e.props,i=e.element,a=e.ref;return E(r)?r(o):t.createElement(n,g({as:i},o,{ref:a}),null!=r?r:null==o?void 0:o.children)},exports.lighten=function(e,r){return function(t){return f.lighten(r,A(t,e))}},exports.lightness=function(e,r){return function(t){return f.setLightness(r,A(t,e))}},exports.merge=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return u.apply(void 0,[{}].concat(r))},exports.mix=function(e,r,t){return void 0===t&&(t=.5),function(n){return f.mix(t,A(n,e),A(n,r))}},exports.pickHTMLProps=I,exports.rotate=function(e,r){return function(t){return f.adjustHue(r,A(t,e))}},exports.saturate=function(e,r){return function(t){return f.saturate(r,A(t,e))}},exports.saturation=function(e,r){return function(t){return f.setSaturation(r,A(t,e))}},exports.shade=function(e,r){return function(t){return f.shade(r,A(t,e))}},exports.styles=L,exports.tint=function(e,r){return function(t){return f.tint(r,A(t,e))}},exports.transformScale=R,exports.transparentize=function(e,r){return function(t){return f.transparentize(r,A(t,e))}},exports.useResponsiveValue=function(e){return function(e,t){void 0===t&&(t={});var n=M(),o="function"==typeof e?e(n.theme):e,i=function(e){void 0===e&&(e={});var t=M(),n=e.defaultIndex,o=void 0===n?0:n,i=t.theme&&t.theme.breakpoints||W;if("number"!=typeof o)throw new TypeError("Default breakpoint index should be a number. Got: "+o+", "+typeof o);if(o<0||o>i.length-1)throw new RangeError("Default breakpoint index out of range. Theme has "+i.length+" breakpoints, got index "+o);var a=r.useState(o),s=a[0],d=a[1];return r.useEffect((function(){var e=function(){var e=i.filter((function(e){return window.matchMedia("screen and (min-width: "+e+")").matches})).length;s!==e&&d(e)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[i,s]),s}(t);return o[i>=o.length?o.length-1:i]}(Array.isArray(e)?e:[e])},exports.useTheme=M; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("react"),t=e(r),n=e(require("@emotion/css/create-instance")),o=require("@emotion/react"),i=e(require("deepmerge")),a=e(require("@emotion/react/package.json")),s=e(require("lodash.get")),d=e(require("lodash.pick")),c=e(require("lodash.omit")),u=e(require("lodash.merge")),l=e(require("@emotion/is-prop-valid")),p=e(require("tiny-invariant")),f=require("polished");function g(){return(g=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var m=r.createContext({EMOTION_VERSION:a.version,theme:{}}),b=function(){return r.useContext(m)},h="function"==typeof Symbol&&Symbol.for,y=h?Symbol.for("react.element"):60103,v=h?Symbol.for("react.forward_ref"):60103,S={isMergeableObject:function(e){return!!e&&"object"==typeof e&&e.$$typeof!==y&&e.$$typeof!==v},arrayMerge:function(e,r){return r}},x=function(e,r){return i(e,r,S)};function k(e){var r=e.context;return t.createElement(o.ThemeContext.Provider,{value:r.theme},t.createElement(m.Provider,{value:r},e.children))}function B(e){var r=e.theme,n=e.children,o=b(),i="function"==typeof r?g({},o,{theme:r(o.theme)}):x.all({},o,{theme:r});return t.createElement(k,{context:i},n)}x.all=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return i.all(r,S)};var E=function(e){return"function"==typeof e},z=function(e){return 0===Object.keys(e).length&&e.constructor===Object};function I(e,r){var t={};for(var n in e)l(n)&&!r.includes(n)&&(t[n]=e[n]);return t}var R=function(e,r){var t;return g({},e,((t={})[r]=function(e,r){if("number"!=typeof r||r>=0){if("string"==typeof r&&r.startsWith("-")){var t=r.substring(1);return"-"+s(e,t,t)}return s(e,r,r)}var n=Math.abs(r),o=s(e,n,n);return"string"==typeof o?"-"+o:-1*Number(o)},t))},w={bg:"backgroundColor",fontSettings:"fontVariationSettings"},W=[40,52,64].map((function(e){return e+"em"})),T={space:[0,4,8,16,32,64,128,256,512],fontSizes:[12,14,16,20,24,32,48,64,72]},j={marginX:["marginLeft","marginRight"],marginY:["marginTop","marginBottom"],paddingX:["paddingLeft","paddingRight"],paddingY:["paddingTop","paddingBottom"],size:["width","height"]},O=["margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginBlock","marginBlockEnd","marginBlockStart","marginInline","marginInlineEnd","marginInlineStart","top","bottom","left","right"].reduce(R,{}),C={color:"colors",backgroundColor:"colors",borderColor:"colors",caretColor:"colors",columnRuleColor:"colors",opacity:"opacities",transition:"transitions",margin:"space",marginTop:"space",marginRight:"space",marginBottom:"space",marginLeft:"space",marginX:"space",marginY:"space",marginBlock:"space",marginBlockEnd:"space",marginBlockStart:"space",marginInline:"space",marginInlineEnd:"space",marginInlineStart:"space",padding:"space",paddingTop:"space",paddingRight:"space",paddingBottom:"space",paddingLeft:"space",paddingX:"space",paddingY:"space",paddingBlock:"space",paddingBlockEnd:"space",paddingBlockStart:"space",paddingInline:"space",paddingInlineEnd:"space",paddingInlineStart:"space",scrollPadding:"space",scrollPaddingTop:"space",scrollPaddingRight:"space",scrollPaddingBottom:"space",scrollPaddingLeft:"space",scrollPaddingX:"space",scrollPaddingY:"space",inset:"space",insetBlock:"space",insetBlockEnd:"space",insetBlockStart:"space",insetInline:"space",insetInlineEnd:"space",insetInlineStart:"space",top:"space",right:"space",bottom:"space",left:"space",gridGap:"space",gridColumnGap:"space",gridRowGap:"space",gap:"space",columnGap:"space",rowGap:"space",fontFamily:"fonts",fontSize:"fontSizes",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",border:"border",borderTop:"borders",borderRight:"borders",borderBottom:"borders",borderLeft:"borders",borderWidth:"borderWidths",borderStyle:"borderStyles",borderRadius:"radii",borderTopRightRadius:"radii",borderTopLeftRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",borderTopWidth:"borderWidths",borderTopColor:"colors",borderTopStyle:"borderStyles",borderBottomWidth:"borderWidths",borderBottomColor:"colors",borderBottomStyle:"borderStyles",borderLeftWidth:"borderWidths",borderLeftColor:"colors",borderLeftStyle:"borderStyles",borderRightWidth:"borderWidths",borderRightColor:"colors",borderRightStyle:"borderStyles",borderBlock:"borders",borderBlockEnd:"borders",borderBlockEndStyle:"borderStyles",borderBlockEndWidth:"borderWidths",borderBlockStart:"borders",borderBlockStartStyle:"borderStyles",borderBlockStartWidth:"borderWidths",borderBlockStyle:"borderStyles",borderBlockWidth:"borderWidths",borderEndEndRadius:"radii",borderEndStartRadius:"radii",borderInline:"borders",borderInlineEnd:"borders",borderInlineEndStyle:"borderStyles",borderInlineEndWidth:"borderWidths",borderInlineStart:"borders",borderInlineStartStyle:"borderStyles",borderInlineStartWidth:"borderWidths",borderInlineStyle:"borderStyles",borderInlineWidth:"borderWidths",borderStartEndRadius:"radii",borderStartStartRadius:"radii",outlineColor:"colors",boxShadow:"shadows",textShadow:"shadows",zIndex:"zIndices",width:"sizes",minWidth:"sizes",maxWidth:"sizes",height:"sizes",minHeight:"sizes",maxHeight:"sizes",flexBasis:"sizes",size:"sizes",blockSize:"sizes",inlineSize:"sizes",maxBlockSize:"sizes",maxInlineSize:"sizes",minBlockSize:"sizes",minInlineSize:"sizes",fill:"colors",stroke:"colors",fontVariationSettings:"fontSettings",text:"text"},L=function e(r){return void 0===r&&(r={}),function(t){void 0===t&&(t={});var n=g({},T,"theme"in t?t.theme:t),o={},i="function"==typeof r?r(n):r;i.themeKey&&delete(i=g({},s(n,i.themeKey),i)).themeKey;var a=function(e){return function(r){var t={},n=[null].concat((r&&r.breakpoints||W).map((function(e){return"@media screen and (min-width: "+e+")"})));for(var o in e){var i=o,a=e[i];if("function"==typeof a&&(a=a(null!=r?r:{})),null!=a)if(Array.isArray(a))for(var s=0;s<a.slice(0,n.length).length;s++){var d,c=n[s];c?(t[c]=null!==(d=t[c])&&void 0!==d?d:{},null!=a[s]&&(t[c][i]=a[s])):t[i]=a[s]}else t[i]=a}return t}}(i)(n);for(var d in a){var c=a[d],u="function"==typeof c?c(n):c;if(u&&"object"==typeof u)o[d]=e(u)(n);else{var l=d in w?w[d]:d,p=s(n,l in C?C[l]:void 0,s(n,l,{})),f=s(O,l,s)(p,u,u),m=f&&"object"==typeof f;if(m){var b,h=f.default;h?"object"==typeof h?(f=e(h)(n),Object.assign(o,f),delete o[l]):((b={})[l]=h,f=b,Object.assign(o,f)):(f=e(f)(n),Object.assign(o,f),delete o[l])}if(l in j)for(var y=j[l],v=0;v<y.length;v++)o[y[v]]=f;else m||(o[l]=f)}}return o}};function P(e){return n({key:"vtex-admin-ui-"+e})}function q(e){return function(r){return t.createElement(B,{theme:e},r.children)}}function H(e,r){return{stylesOf:function(r){return s(e,r,{})},cn:function(t){var n=L(t)(e);return r.css(n)}}}function M(){var e=b().theme;return(z(e)||!e)&&p(!1),e}var A=function(e,r){var t=s(e,"colors."+r,r);return/^var\(--/.test(t)?t.replace(/^var\(--(\w+)(.*?), /,"").replace(/\)/,""):t},G=function(e,r){return function(t){return f.desaturate(r,A(t,e))}};exports.get=s,exports.pick=d,exports.omit=c,exports.isPropValid=l,exports.alpha=function(e,r){return function(t){return f.rgba(A(t,e),r)}},exports.cleanProps=function(e,r){void 0===r&&(r=[]);var t=I(e,r);return c.apply(void 0,[t].concat(r))},exports.complement=function(e){return function(r){return f.complement(A(r,e))}},exports.createEmotionInstance=P,exports.createSystem=function(e,r){var t=P(r),n=q(e),o=H(e,t);return{emotionInstance:t,ThemeProvider:n,cn:o.cn,stylesOf:o.stylesOf}},exports.createThemeConsumers=H,exports.createThemeProvider=q,exports.darken=function(e,r){return function(t){return f.darken(r,A(t,e))}},exports.desaturate=G,exports.forwardRef=function(e){return t.forwardRef(e)},exports.getColor=A,exports.grayscale=function(e){return G(e,1)},exports.hue=function(e,r){return function(t){return f.setHue(r,A(t,e))}},exports.inlineVariant=function(e){return e.reduce((function(e,r){return r[0]?""+e+r[1]:e}),"")},exports.invert=function(e){return function(r){return f.invert(A(r,e))}},exports.isFunction=E,exports.isObjectEmpty=z,exports.jsxs=function(e){var r=e.children,n=e.component,o=e.props,i=e.element,a=e.ref;return E(r)?r(o):t.createElement(n,g({as:i},o,{ref:a}),null!=r?r:null==o?void 0:o.children)},exports.lighten=function(e,r){return function(t){return f.lighten(r,A(t,e))}},exports.lightness=function(e,r){return function(t){return f.setLightness(r,A(t,e))}},exports.merge=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return u.apply(void 0,[{}].concat(r))},exports.mix=function(e,r,t){return void 0===t&&(t=.5),function(n){return f.mix(t,A(n,e),A(n,r))}},exports.pickHTMLProps=I,exports.rotate=function(e,r){return function(t){return f.adjustHue(r,A(t,e))}},exports.saturate=function(e,r){return function(t){return f.saturate(r,A(t,e))}},exports.saturation=function(e,r){return function(t){return f.setSaturation(r,A(t,e))}},exports.shade=function(e,r){return function(t){return f.shade(r,A(t,e))}},exports.styles=L,exports.tint=function(e,r){return function(t){return f.tint(r,A(t,e))}},exports.transformScale=R,exports.transparentize=function(e,r){return function(t){return f.transparentize(r,A(t,e))}},exports.useResponsiveValue=function(e){return function(e,t){void 0===t&&(t={});var n=M(),o="function"==typeof e?e(n.theme):e,i=function(e){void 0===e&&(e={});var t=M(),n=e.defaultIndex,o=void 0===n?0:n,i=t.theme&&t.theme.breakpoints||W;if("number"!=typeof o)throw new TypeError("Default breakpoint index should be a number. Got: "+o+", "+typeof o);if(o<0||o>i.length-1)throw new RangeError("Default breakpoint index out of range. Theme has "+i.length+" breakpoints, got index "+o);var a=r.useState(o),s=a[0],d=a[1];return r.useEffect((function(){var e=function(){var e=i.filter((function(e){return window.matchMedia("screen and (min-width: "+e+")").matches})).length;s!==e&&d(e)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[i,s]),s}(t);return o[i>=o.length?o.length-1:i]}(Array.isArray(e)?e:[e])},exports.useTheme=M; | ||
//# sourceMappingURL=admin-ui-system.cjs.production.min.js.map |
@@ -196,3 +196,15 @@ import React, { useContext, createContext, useState, useEffect } from 'react'; | ||
}; | ||
/** | ||
* Function that helps in the creation of a themeKey with conditional variants | ||
* @param sequence Array<[conditional variant, themeKey accessor]> | ||
*/ | ||
var inlineVariant = function inlineVariant(sequence) { | ||
return sequence.reduce(function (acc, item) { | ||
var invariant = item[0], | ||
modifier = item[1]; | ||
return invariant ? "" + acc + modifier : acc; | ||
}, ''); | ||
}; | ||
var aliases = { | ||
@@ -771,3 +783,3 @@ bg: 'backgroundColor', | ||
export { alpha, cleanProps, complement, createEmotionInstance, createSystem, createThemeConsumers, createThemeProvider, darken, desaturate, forwardRef, getColor, grayscale, hue, invert, isFunction, isObjectEmpty, jsxs, lighten, lightness, merge$1 as merge, mix, pickHTMLProps, rotate, saturate, saturation, shade, styles, tint, transformScale, transparentize, useResponsiveValue$1 as useResponsiveValue, useTheme }; | ||
export { alpha, cleanProps, complement, createEmotionInstance, createSystem, createThemeConsumers, createThemeProvider, darken, desaturate, forwardRef, getColor, grayscale, hue, inlineVariant, invert, isFunction, isObjectEmpty, jsxs, lighten, lightness, merge$1 as merge, mix, pickHTMLProps, rotate, saturate, saturation, shade, styles, tint, transformScale, transparentize, useResponsiveValue$1 as useResponsiveValue, useTheme }; | ||
//# sourceMappingURL=admin-ui-system.esm.js.map |
@@ -39,1 +39,6 @@ import { ForwardRefRenderFunction } from 'react'; | ||
}; | ||
/** | ||
* Function that helps in the creation of a themeKey with conditional variants | ||
* @param sequence Array<[conditional variant, themeKey accessor]> | ||
*/ | ||
export declare const inlineVariant: (sequence: Array<[boolean, string]>) => string; |
{ | ||
"name": "@vtex/admin-ui-system", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"main": "dist/index.js", | ||
@@ -57,3 +57,3 @@ "module": "dist/admin-ui-system.esm.js", | ||
}, | ||
"gitHead": "80cbb0442e54aaf594a5c3daa54193fc7173a300" | ||
"gitHead": "85de0da9438fd778ef0c392751e25dc72490dc96" | ||
} |
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
272228
4115