@maker-ui/css
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -142,3 +142,4 @@ 'use strict'; | ||
/** | ||
* JSX that supports responsive arrays and the `breakpoints` prop | ||
* JSX that supports responsive arrays and the `breakpoints` prop. Uses normal | ||
* React.createElement if `breakpoints` and `css` are undefined.. | ||
* | ||
@@ -158,3 +159,3 @@ * @remarks | ||
return react.jsx.apply(void 0, [type, parseProps(props)].concat(children)); | ||
return typeof (props == null ? void 0 : props.css) !== 'undefined' || typeof (props == null ? void 0 : props.breakpoints) !== 'undefined' ? react.jsx.apply(void 0, [type, parseProps(props)].concat(children)) : React.createElement.apply(void 0, [type, props].concat(children)); | ||
}; | ||
@@ -161,0 +162,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),t=require("@emotion/react"),n=(e=require("deepmerge"))&&"object"==typeof e&&"default"in e?e.default:e,o=function(e){return isNaN(e)?e:e+"px"},i=["768px","960px","1440px"],a=function e(r,t){return function(a){for(var s={},u=t||(null==a?void 0:a.breakpoints)||i,c=function(e,r){for(var t={},i=0,a=Object.entries(e);i<a.length;i++){var s=a[i],u=s[0],c=s[1];if(null!==c)if(Array.isArray(c)){t[u]=c[0];for(var f=0;f<c.length-1;f++){var l,p,v,b="@media screen and (min-width: "+o(r[f])+")";t[b]?t=n(t,((p={})[b]=((l={})[u]=c[f+1],l),p)):t[b]=((v={})[u]=c[f+1],v)}}else t[u]=c}return t}(r,u),f=0,l=Object.entries(c);f<l.length;f++){var p=l[f],v=p[0],b=p[1],d="function"==typeof b?b(a):b;s[v]=d&&"object"==typeof d?e(d,u)(a):d}return s}};function s(e){if(!e||!e.css)return e;var r={};for(var t in e)"css"!==t&&"breakpoints"!==t&&(r[t]=e[t]);return r.css=a(e.css,e.breakpoints),r}exports.Global=function(e){return r.createElement(t.Global,{styles:a(e.styles,e.breakpoints)})},exports.jsx=function(e,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return t.jsx.apply(void 0,[e,s(r)].concat(o))}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),t=require("@emotion/react"),n=(e=require("deepmerge"))&&"object"==typeof e&&"default"in e?e.default:e,o=function(e){return isNaN(e)?e:e+"px"},i=["768px","960px","1440px"],a=function e(r,t){return function(a){for(var s={},c=t||(null==a?void 0:a.breakpoints)||i,u=function(e,r){for(var t={},i=0,a=Object.entries(e);i<a.length;i++){var s=a[i],c=s[0],u=s[1];if(null!==u)if(Array.isArray(u)){t[c]=u[0];for(var l=0;l<u.length-1;l++){var f,p,v,d="@media screen and (min-width: "+o(r[l])+")";t[d]?t=n(t,((p={})[d]=((f={})[c]=u[l+1],f),p)):t[d]=((v={})[c]=u[l+1],v)}}else t[c]=u}return t}(r,c),l=0,f=Object.entries(u);l<f.length;l++){var p=f[l],v=p[0],d=p[1],b="function"==typeof d?d(a):d;s[v]=b&&"object"==typeof b?e(b,c)(a):b}return s}};function s(e){if(!e||!e.css)return e;var r={};for(var t in e)"css"!==t&&"breakpoints"!==t&&(r[t]=e[t]);return r.css=a(e.css,e.breakpoints),r}exports.Global=function(e){return r.createElement(t.Global,{styles:a(e.styles,e.breakpoints)})},exports.jsx=function(e,n){for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];return void 0!==(null==n?void 0:n.css)||void 0!==(null==n?void 0:n.breakpoints)?t.jsx.apply(void 0,[e,s(n)].concat(i)):r.createElement.apply(void 0,[e,n].concat(i))}; | ||
//# sourceMappingURL=css.cjs.production.min.js.map |
@@ -136,3 +136,4 @@ import { createElement } from 'react'; | ||
/** | ||
* JSX that supports responsive arrays and the `breakpoints` prop | ||
* JSX that supports responsive arrays and the `breakpoints` prop. Uses normal | ||
* React.createElement if `breakpoints` and `css` are undefined.. | ||
* | ||
@@ -152,3 +153,3 @@ * @remarks | ||
return jsx$1.apply(void 0, [type, parseProps(props)].concat(children)); | ||
return typeof (props == null ? void 0 : props.css) !== 'undefined' || typeof (props == null ? void 0 : props.breakpoints) !== 'undefined' ? jsx$1.apply(void 0, [type, parseProps(props)].concat(children)) : createElement.apply(void 0, [type, props].concat(children)); | ||
}; | ||
@@ -155,0 +156,0 @@ |
@@ -1,4 +0,5 @@ | ||
import * as React from 'react'; | ||
/// <reference types="react" /> | ||
/** | ||
* JSX that supports responsive arrays and the `breakpoints` prop | ||
* JSX that supports responsive arrays and the `breakpoints` prop. Uses normal | ||
* React.createElement if `breakpoints` and `css` are undefined.. | ||
* | ||
@@ -11,2 +12,2 @@ * @remarks | ||
*/ | ||
export declare const jsx: <P extends {}>(type: React.ElementType<P>, props: React.Attributes & P, ...children: React.ReactNode[]) => React.ReactElement<P, string | React.JSXElementConstructor<any>>; | ||
export declare const jsx: <P extends {}>(type: import("react").ElementType<P>, props: import("react").Attributes & P, ...children: React.ReactNode[]) => import("react").ReactElement<P, string | import("react").JSXElementConstructor<any>>; |
{ | ||
"name": "@maker-ui/css", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"author": "Mike Darche <mike@newcreative.io>", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -1,2 +0,2 @@ | ||
import * as React from 'react' | ||
import { createElement } from 'react' | ||
import { jsx as emotionJsx, Interpolation } from '@emotion/react' | ||
@@ -30,3 +30,4 @@ | ||
/** | ||
* JSX that supports responsive arrays and the `breakpoints` prop | ||
* JSX that supports responsive arrays and the `breakpoints` prop. Uses normal | ||
* React.createElement if `breakpoints` and `css` are undefined.. | ||
* | ||
@@ -44,2 +45,5 @@ * @remarks | ||
...children: React.ReactNode[] | ||
) => emotionJsx(type, parseProps(props), ...children) | ||
) => | ||
typeof props?.css !== 'undefined' || typeof props?.breakpoints !== 'undefined' | ||
? emotionJsx(type, parseProps(props), ...children) | ||
: createElement(type, props, ...children) |
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
49331
743