├── LICENSE
├── README.md
├── dist
└── index.js
├── package.json
├── src
└── index.js
└── yarn.lock
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 rnkids
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Styled System Native
2 |
3 | React Native components for in-line styling, build with styled-components.
4 | Inspired from: styled-system-html
5 |
6 | ## Usage
7 | ```
8 | $ npm i -S styled-system-native
9 | ```
10 | Then styled it like [styled-system](https://styled-system.com/api)
11 | ```jsx
12 | import React from 'react';
13 | import { Text, View, Button } from "styled-system-native";
14 |
15 | const App = () => {
16 | return (
17 |
18 | {console.log("rnkids.github.io")}}
25 | >
26 | Press
27 |
28 |
29 | );
30 | }
31 | export default App;
32 | ```
33 |
34 | Created by rnkids
--------------------------------------------------------------------------------
/dist/index.js:
--------------------------------------------------------------------------------
1 | import e,{useContext as t,createElement as n,Component as r,createContext as i,memo as o,useState as a}from"react";import{View as s,ImageBackground as f,Text as u,Image as c,TextInput as l,ScrollView as d,Picker as h,Switch as p,FlatList as b,SectionList as m,ActivityIndicator as v,Alert as g,Modal as y,StatusBar as w,TouchableOpacity as k,TouchableHighlight as S,TouchableWithoutFeedback as x,KeyboardAvoidingView as C,SafeAreaView as j,Keyboard as O}from"react-native";const I="function"==typeof Symbol&&Symbol.for,R=I?Symbol.for("react.element"):60103,A=I?Symbol.for("react.portal"):60106,P=I?Symbol.for("react.fragment"):60107,$=I?Symbol.for("react.strict_mode"):60108,T=I?Symbol.for("react.profiler"):60114,E=I?Symbol.for("react.provider"):60109,z=I?Symbol.for("react.context"):60110,N=I?Symbol.for("react.async_mode"):60111,_=I?Symbol.for("react.concurrent_mode"):60111,F=I?Symbol.for("react.forward_ref"):60112,U=I?Symbol.for("react.suspense"):60113,D=I?Symbol.for("react.memo"):60115,M=I?Symbol.for("react.lazy"):60116;function q(e){return"object"==typeof e&&null!==e&&e.$$typeof===R}function L(e,t){return e(t={exports:{}},t.exports),t.exports}var B="(".charCodeAt(0),W=")".charCodeAt(0),V="'".charCodeAt(0),H='"'.charCodeAt(0),Y="\\".charCodeAt(0),G="/".charCodeAt(0),X=",".charCodeAt(0),K=":".charCodeAt(0),Z="*".charCodeAt(0),J="u".charCodeAt(0),Q="U".charCodeAt(0),ee="+".charCodeAt(0),te=/^[a-f0-9?-]+$/i,ne=function(e){for(var t,n,r,i,o,a,s,f,u,c=[],l=e,d=0,h=l.charCodeAt(d),p=l.length,b=[{nodes:c}],m=0,v="",g="",y="";d
=48&&t<=57)return!0;var r=e.charCodeAt(2);return t===ue&&r>=48&&r<=57}return n===ue?(t=e.charCodeAt(1))>=48&&t<=57:n>=48&&n<=57}(e))return!1;for((t=e.charCodeAt(i))!==fe&&t!==se||i++;i57);)i+=1;if(t=e.charCodeAt(i),n=e.charCodeAt(i+1),t===ue&&n>=48&&n<=57)for(i+=2;i57);)i+=1;if(t=e.charCodeAt(i),n=e.charCodeAt(i+1),r=e.charCodeAt(i+2),(t===ce||t===le)&&(n>=48&&n<=57||(n===fe||n===se)&&r>=48&&r<=57))for(i+=n===fe||n===se?3:2;i57);)i+=1;return{number:e.slice(0,i),unit:e.slice(i)}},de.walk=re,de.stringify=ae;var he=de,pe=function(e){return"string"==typeof e?me(e):be(e)};function be(e){return e&&"object"==typeof e?ge(e)||ye(e)?e:ve(e)?function(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r":null}},c=function(e,t){return void 0===t&&(t=String),function(n){if("word"!==n.type)return null;var r=n.value.match(e);return null===r?null:t(r[1])}},l=u(function(e){return"space"===e.type}),d=u(function(e){return"div"===e.type&&"/"===e.value}),h=u(function(e){return"div"===e.type&&","===e.value}),p=function(e){return"word"===e.type?e.value:null},b=c(/^(none)$/i),m=c(/^(auto)$/i),v=c(/^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?)$/i,Number),g=c(/^(0$|(?:[+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?)(?=px$))/i,Number),y=c(/^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?(ch|em|ex|rem|vh|vw|vmin|vmax|cm|mm|in|pc|pt))$/i),w=c(/^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?(?:deg|rad))$/i,function(e){return e.toLowerCase()}),k=c(/^([+-]?(?:\d*\.)?\d+(?:e[+-]?\d+)?%)$/i),S=c(/(^-?[_a-z][_a-z0-9-]*$)/i),x=function(e){return"string"!==e.type?null:e.value.replace(/\\([0-9a-f]{1,6})(?:\s|$)/gi,function(e,t){return String.fromCharCode(parseInt(t,16))}).replace(/\\/g,"")},C=function(e){return"word"===e.type&&(s.test(e.value)||e.value in a||"transparent"===e.value)?e.value:"function"===e.type&&f.test(e.value)?he.stringify(e):null},j=c(/^(none|underline|line-through)$/i),O=c(/^(solid|dashed|dotted)$/),I=function(e){var t=e.types,n=void 0===t?[g,y,k]:t,r=e.directions,i=void 0===r?["Top","Right","Bottom","Left"]:r,o=e.prefix,a=void 0===o?"":o,s=e.suffix,f=void 0===s?"":s;return function(e){var t,r=[];for(r.push(e.expect.apply(e,n));r.length<4&&e.hasTokens();)e.expect(l),r.push(e.expect.apply(e,n));e.expectEmpty();var o=r[0],s=r[1],u=void 0===s?o:s,c=r[2],d=void 0===c?o:c,h=r[3],p=void 0===h?u:h,b=function(e){return""+a+i[e]+f};return(t={})[b(0)]=o,t[b(1)]=u,t[b(2)]=d,t[b(3)]=p,t}},R=function(e){var t=e.expect(g),n=e.matches(l)?e.expect(g):t;return e.expectEmpty(),{width:t,height:n}},A=function(e){var t,n,r,i;if(e.matches(b))return e.expectEmpty(),{offset:{width:0,height:0},radius:0,color:"black"};for(var o=!1;e.hasTokens();)o&&e.expect(l),void 0===t&&e.matches(g,y)?(t=e.lastValue,e.expect(l),n=e.expect(g,y),e.saveRewindPoint(),e.matches(l)&&e.matches(g,y)?r=e.lastValue:e.rewind()):void 0===i&&e.matches(C)?i=e.lastValue:e.throw(),o=!0;return void 0===t&&e.throw(),{offset:{width:t,height:n},radius:void 0!==r?r:0,color:void 0!==i?i:"black"}},P=c(/(nowrap|wrap|wrap-reverse)/),$=c(/(row|row-reverse|column|column-reverse)/),T=function(e){var t;if(e.matches(x))t=e.lastValue;else for(t=e.expect(S);e.hasTokens();)e.expect(l),t+=" "+e.expect(S);return e.expectEmpty(),{fontFamily:t}},E=c(/^(normal)$/),z=c(/^(italic)$/),N=c(/^([1-9]00|bold)$/),_=c(/^(small-caps)$/),F=[],U=c(/(flex-(?:start|end)|center|stretch|space-(?:between|around))/),D=c(/(flex-(?:start|end)|center|space-(?:between|around|evenly))/),M=c(/^(solid|double|dotted|dashed)$/),q=function(e){return function(t){var n=t.expect(e);return t.expectEmpty(),n}},L=q(v),B=q(g),W=q(w),V=function(e){return function(t,n){return function(r){var i,o,a,s=r.expect(e);if(r.hasTokens())r.expect(h),a=r.expect(e);else{if(void 0===n)return s;a=n}return r.expectEmpty(),[(i={},i[t+"Y"]=a,i),(o={},o[t+"X"]=s,o)]}}},H=V(v),Y=V(g),G=V(w),X={perspective:L,scale:H("scale"),scaleX:L,scaleY:L,translate:Y("translate",0),translateX:B,translateY:B,rotate:W,rotateX:W,rotateY:W,rotateZ:W,skewX:W,skewY:W,skew:G("skew","0deg")},K=I({types:[C],prefix:"border",suffix:"Color"}),Z=I({directions:["TopLeft","TopRight","BottomRight","BottomLeft"],prefix:"border",suffix:"Radius"}),J=I({prefix:"border",suffix:"Width"}),Q=I({types:[g,y,k,m],prefix:"margin"}),ee=I({prefix:"padding"}),te={background:function(e){return{backgroundColor:e.expect(C)}},border:function(e){var t,n,r;if(e.matches(b))return e.expectEmpty(),{borderWidth:0,borderColor:"black",borderStyle:"solid"};for(var i=0;i<3&&e.hasTokens();)0!==i&&e.expect(l),void 0===t&&e.matches(g,y)?t=e.lastValue:void 0===n&&e.matches(C)?n=e.lastValue:void 0===r&&e.matches(O)?r=e.lastValue:e.throw(),i+=1;return e.expectEmpty(),void 0===t&&(t=1),void 0===n&&(n="black"),void 0===r&&(r="solid"),{borderWidth:t,borderColor:n,borderStyle:r}},borderColor:K,borderRadius:Z,borderWidth:J,boxShadow:function(e){var t=A(e);return{shadowOffset:t.offset,shadowRadius:t.radius,shadowColor:t.color,shadowOpacity:1}},flex:function(e){var t,n,r;if(e.matches(b))return e.expectEmpty(),{flexGrow:0,flexShrink:0,flexBasis:"auto"};if(e.saveRewindPoint(),e.matches(m)&&!e.hasTokens())return{flexGrow:1,flexShrink:1,flexBasis:"auto"};e.rewind();for(var i=0;i<2&&e.hasTokens();)0!==i&&e.expect(l),void 0===t&&e.matches(v)?(t=e.lastValue,e.saveRewindPoint(),e.matches(l)&&e.matches(v)?n=e.lastValue:e.rewind()):void 0===r&&e.matches(g,y,k)?r=e.lastValue:void 0===r&&e.matches(m)?r="auto":e.throw(),i+=1;return e.expectEmpty(),void 0===t&&(t=1),void 0===n&&(n=1),void 0===r&&(r=0),{flexGrow:t,flexShrink:n,flexBasis:r}},flexFlow:function(e){for(var t,n,r=0;r<2&&e.hasTokens();)0!==r&&e.expect(l),void 0===t&&e.matches(P)?t=e.lastValue:void 0===n&&e.matches($)?n=e.lastValue:e.throw(),r+=1;return e.expectEmpty(),void 0===t&&(t="nowrap"),void 0===n&&(n="row"),{flexWrap:t,flexDirection:n}},font:function(e){for(var t,n,r,i,o=0;o<3&&e.hasTokens();){if(e.matches(E));else if(void 0===t&&e.matches(z))t=e.lastValue;else if(void 0===n&&e.matches(N))n=e.lastValue;else{if(void 0!==r||!e.matches(_))break;r=[e.lastValue]}e.expect(l),o+=1}var a=e.expect(g,y);e.matches(d)&&(i=e.expect(g,y)),e.expect(l);var s=T(e);void 0===t&&(t="normal"),void 0===n&&(n="normal"),void 0===r&&(r=F);var f={fontStyle:t,fontWeight:n,fontVariant:r,fontSize:a,fontFamily:s.fontFamily};return void 0!==i&&(f.lineHeight=i),f},fontFamily:T,fontVariant:function(e){return{fontVariant:[e.expect(S)]}},fontWeight:function(e){return{fontWeight:e.expect(p)}},margin:Q,padding:ee,placeContent:function(e){var t,n=e.expect(U);return e.hasTokens()?(e.expect(l),t=e.expect(D)):t="stretch",e.expectEmpty(),{alignContent:n,justifyContent:t}},shadowOffset:function(e){return{shadowOffset:R(e)}},textShadow:function(e){var t=A(e);return{textShadowOffset:t.offset,textShadowRadius:t.radius,textShadowColor:t.color}},textShadowOffset:function(e){return{textShadowOffset:R(e)}},textDecoration:function(e){for(var t,n,r,i=!1;e.hasTokens();){if(i&&e.expect(l),void 0===t&&e.matches(j)){var o=[e.lastValue.toLowerCase()];e.saveRewindPoint(),"none"!==o[0]&&e.matches(l)&&e.matches(j)?(o.push(e.lastValue.toLowerCase()),o.sort().reverse()):e.rewind(),t=o.join(" ")}else void 0===n&&e.matches(M)?n=e.lastValue:void 0===r&&e.matches(C)?r=e.lastValue:e.throw();i=!0}return{textDecorationLine:void 0!==t?t:"none",textDecorationColor:void 0!==r?r:"black",textDecorationStyle:void 0!==n?n:"solid"}},textDecorationLine:function(e){for(var t=[],n=!1;e.hasTokens();)n&&e.expect(l),t.push(e.expect(j).toLowerCase()),n=!0;return t.sort().reverse(),{textDecorationLine:t.join(" ")}},transform:function(e){for(var t=[],n=!1;e.hasTokens();){n&&e.expect(l);var r,i=e.expectFunction(),o=i.functionName,a=X[o](i);Array.isArray(a)||(a=[(r={},r[o]=a,r)]),t=a.concat(t),n=!0}return{transform:t}}};"production"!==process.env.NODE_ENV&&(r=["aspectRatio","elevation","flexGrow","flexShrink","opacity","shadowOpacity","zIndex"]);var ne=null!=r?new RegExp(r.join("|")):null,re=function(){function e(e,t){this.index=0,this.nodes=e,this.functionName=null!=t?t.value:null,this.lastValue=null,this.rewindIndex=-1}var t=e.prototype;return t.hasTokens=function(){return this.index<=this.nodes.length-1},t.SYMBOL_MATCH=function(){if(!this.hasTokens())return null;for(var e=this.nodes[this.index],t=0;tr&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(b,"$1"+e.trim());case 58:return e.trim()+t.replace(b,"$1"+e.trim());default:if(0<1*n&&0f.charCodeAt(8))break;case 115:a=a.replace(f,"-webkit-"+f)+";"+a;break;case 207:case 102:a=a.replace(f,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0h)&&(D=(L=L.replace(" ",":")).length),025?39:97))},ut=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e};function ct(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function lt(e){return"function"==typeof e}var dt=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!function(e){if("object"==typeof e&&null!==e){const t=e.$$typeof;switch(t){case R:const n=e.type;switch(n){case N:case _:case P:case T:case $:case U:return n;default:const e=n&&n.$$typeof;switch(e){case z:case F:case E:return e;default:return t}}case M:case D:case A:return t}}}(e)};function ht(e){return e&&"string"==typeof e.styledComponentId}function pt(e,t){for(var n=0;n=0||(i[n]=e[n]);return i}var yt="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",wt="undefined"!=typeof window&&"HTMLElement"in window,kt="boolean"==typeof SC_DISABLE_SPEEDY&&SC_DISABLE_SPEEDY||"undefined"!=typeof process&&(process.env.REACT_APP_SC_DISABLE_SPEEDY||process.env.SC_DISABLE_SPEEDY)||"production"!==process.env.NODE_ENV,St="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document ``\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to ``, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n"}:{};function xt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0?" Additional arguments: "+n.join(", "):"")):new Error(function(){for(var e=arguments.length<=0?void 0:arguments[0],t=[],n=1,r=arguments.length;n=0;r--){var i=t[r];if(i&&1===i.nodeType&&i.hasAttribute(yt))return i}}(),o=void 0!==i?i.nextSibling:null;r.setAttribute(yt,"active"),r.setAttribute("data-styled-version","5.1.0");var a="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},jt=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)(i<<=1)<0&&xt(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o1<<30)&&xt(16,""+t),$t.set(e,t),Tt.set(t,e),t},Nt=function(e){return Tt.get(e)},_t=function(e,t){t>=Et&&(Et=t+1),$t.set(e,t),Tt.set(t,e)},Ft="style["+yt+'][data-styled-version="5.1.0"]',Ut=new RegExp("^"+yt+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),Dt=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o0&&(u+=e+",")}),r+=""+s+f+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),Vt=Object.freeze([]),Ht=Object.freeze({}),Yt=/^\s*\/\/.*$/gm;e.createContext(),e.createContext(),new Wt;var Gt=function(e){var t,n,r,i=Ht.options,o=Ht.plugins,a=void 0===o?Vt:o,s=new Ce(void 0===i?Ht:i),f=[],u=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,i,o,a,s,f,u,c,l){switch(n){case 1:if(0===c&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(i[0]+r),"";default:return r+(0===l?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}(function(e){f.push(e)}),c=function(e,r,i){return r>0&&-1!==i.slice(0,r).indexOf(n)&&i.slice(r-n.length,r)!==n?"."+t:e};function l(e,i,o,a){void 0===a&&(a="&");var f=e.replace(Yt,""),u=i&&o?o+" "+i+" { "+f+" }":f;return t=a,n=i,r=new RegExp("\\"+n+"\\b","g"),s(o||!i?"":i,u)}return s.use([].concat(a,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(n)>0&&(i[0]=i[0].replace(r,c))},u,function(e){if(-2===e){var t=f;return f=[],t}}])),l.hash=a.length?a.reduce(function(e,t){return t.name||xt(15),ut(e,t.name)},5381).toString():"",l}(),Xt=function(){function e(e,t){var n=this;this.inject=function(e){e.hasNameForId(n.id,n.name)||e.insertRules(n.id,n.name,Gt.apply(void 0,n.stringifyArgs))},this.toString=function(){return xt(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.stringifyArgs=t}return e.prototype.getName=function(){return this.name},e}(),Kt=/([A-Z])/g,Zt=/^ms-/;function Jt(e){return e.replace(Kt,"-$1").toLowerCase().replace(Zt,"-ms-")}var Qt=function(e){return null==e||!1===e||""===e},en=function e(t,n){var r=[];return Object.keys(t).forEach(function(n){if(!Qt(t[n])){if(dt(t[n]))return r.push.apply(r,e(t[n],n)),r;if(lt(t[n]))return r.push(Jt(n)+":",t[n],";"),r;r.push(Jt(n)+": "+(null==(i=t[n])||"boolean"==typeof i||""===i?"":"number"!=typeof i||0===i||n in je?String(i).trim():i+"px")+";")}var i;return r}),n?[n+" {"].concat(r,["}"]):r};function tn(e,t,n){if(Array.isArray(e)){for(var r,i=[],o=0,a=e.length;o 0?(u=w+a,c=r-o[a].length):(u=w,c=y),b.push(["string",m.slice(k,r+1),w,k-y,u,r-c]),y=c,w=u,k=r;break;case xn:Cn.lastIndex=k+1,Cn.test(m),b.push(["at-word",m.slice(k,1+(r=0===Cn.lastIndex?m.length-1:Cn.lastIndex-2)),w,k-y,w,r-y]),k=r;break;case sn:for(r=k,f=!0;m.charCodeAt(r+1)===sn;)r+=1,f=!f;n=m.charCodeAt(r+1),f&&n!==fn&&n!==cn&&n!==un&&n!==dn&&n!==hn&&n!==ln&&(r+=1),b.push(["word",m.slice(k,r+1),w,k-y,w,r-y]),k=r;break;default:n===fn&&m.charCodeAt(k+1)===kn?(0===(r=m.indexOf("*/",k+2)+1)&&(v?r=m.length:S("comment")),(a=(o=(s=m.slice(k,r+1)).split("\n")).length-1)>0?(u=w+a,c=r-o[a].length):(u=w,c=y),b.push(["comment",s,w,k-y,u,r-c]),y=c,w=u,k=r):(jn.lastIndex=k+1,jn.test(m),b.push(["word",m.slice(k,1+(r=0===jn.lastIndex?m.length-1:jn.lastIndex-2)),w,k-y,w,r-y]),k=r)}k++}return b}var Rn={brackets:[36,39],string:[31,39],"at-word":[31,39],comment:[90,39],"{":[32,39],"}":[32,39],":":[1,22],";":[1,22],"(":[1,22],")":[1,22]};function An(e){return"["+e+"m"}var Pn=function(){function e(t,n,r,i,o,a){this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),void 0!==n&&void 0!==r&&(this.line=n,this.column=r),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}var t=e.prototype;return t.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},t.showSourceCode=function(e){var t=this;if(!this.source)return"";var n=this.source;void 0===e&&(e=!1),e&&(n=function(e){var t=In(new Kn(e),{ignoreErrors:!0}),n=[];return t.forEach(function(e){var t=Rn[e[0]];n.push(t?e[1].split(/\r?\n/).map(function(e){return An(t[0])+e+An(t[1])}).join("\n"):e[1])}),n.join("")}(n));var r=n.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),a=String(o).length;return r.slice(i,o).map(function(e,n){var r=i+1+n,o=" "+(" "+r).slice(-a)+" | ";if(r===t.line){var s=o.replace(/\d/g," ")+e.slice(0,t.column-1).replace(/[^\t]/g," ");return">"+o+e+"\n "+s+"^"}return" "+o+e}).join("\n")},t.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},bt(e,[{key:"generated",get:function(){return rn("CssSyntaxError#generated is deprecated. Use input instead."),this.input}}]),e}(),$n={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" "},Tn=function(){function e(e){this.builder=e}var t=e.prototype;return t.stringify=function(e,t){this[e.type](e,t)},t.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},t.comment=function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)},t.decl=function(e,t){var n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)},t.rule=function(e){this.block(e,this.rawValue(e,"selector"))},t.atrule=function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes?this.block(e,n+r):this.builder(n+r+((e.raws.between||"")+(t?";":"")),e)},t.body=function(e){for(var t=e.nodes.length-1;t>0&&"comment"===e.nodes[t].type;)t-=1;for(var n=this.raw(e,"semicolon"),r=0;r0&&void 0!==e.raws.after)return-1!==(t=e.raws.after).indexOf("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t},t.rawBeforeOpen=function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t},t.rawColon=function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t},t.beforeAfter=function(e,t){var n;n=this.raw(e,null,"decl"===e.type?"beforeDecl":"comment"===e.type?"beforeComment":"before"===t?"beforeRule":"beforeClose");for(var r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(-1!==n.indexOf("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var a=0;a0&&this.unclosedBracket(i),t&&r){for(;this.pos>a&&("space"===(e=this.tokens[this.pos][0])||"comment"===e);)this.pos-=1;this.decl(this.tokens.slice(a,this.pos+1))}else this.unknownWord(a)},t.rule=function(e){e.pop();var t=new Ln;this.init(t,e[0][2],e[0][3]),t.raws.between=this.spacesFromEnd(e),this.raw(t,"selector",e),this.current=t},t.decl=function(e){var t=new Nn;this.init(t);var n,r=e[e.length-1];for(";"===r[0]&&(this.semicolon=!0,e.pop()),t.source.end=r[4]?{line:r[4],column:r[5]}:{line:r[2],column:r[3]};"word"!==e[0][0];)t.raws.before+=e.shift()[1];for(t.source.start={line:e[0][2],column:e[0][3]},t.prop="";e.length;){var i=e[0][0];if(":"===i||"space"===i||"comment"===i)break;t.prop+=e.shift()[1]}for(t.raws.between="";e.length;){if(":"===(n=e.shift())[0]){t.raws.between+=n[1];break}t.raws.between+=n[1]}"_"!==t.prop[0]&&"*"!==t.prop[0]||(t.raws.before+=t.prop[0],t.prop=t.prop.slice(1)),t.raws.between+=this.spacesFromStart(e),this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){if("!important"===(n=e[o])[1]){t.important=!0;var a=this.stringFrom(e,o);" !important"!==(a=this.spacesFromEnd(e)+a)&&(t.raws.important=a);break}if("important"===n[1]){for(var s=e.slice(0),f="",u=o;u>0;u--){var c=s[u][0];if(0===f.trim().indexOf("!")&&"space"!==c)break;f=s.pop()[1]+f}0===f.trim().indexOf("!")&&(t.important=!0,t.raws.important=f,e=s)}if("space"!==n[0]&&"comment"!==n[0])break}this.raw(t,"value",e),-1!==t.value.indexOf(":")&&this.checkMissedSemicolon(e)},t.atrule=function(e){var t=new Mn;t.name=e[1].slice(1),""===t.name&&this.unnamedAtrule(t,e),this.init(t,e[2],e[3]);var n=!1,r=!1,i=[];for(this.pos+=1;this.pos=0&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon",n[2],n[3])}},e}();function Un(e,t){if(t&&t.safe)throw new Error('Option safe was removed. Use parser: require("postcss-safe-parser")');var n=new Kn(e,t),r=new Fn(n);try{r.tokenize(),r.loop()}catch(e){throw"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var Dn=function(e){function t(){return e.apply(this,arguments)||this}vt(t,e);var n=t.prototype;return n.push=function(e){return e.parent=this,this.nodes.push(e),this},n.each=function(e){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var t=this.lastEach;if(this.indexes[t]=0,this.nodes){for(var n,r;this.indexes[t]=e&&(this.indexes[n]=t-1);return this},n.removeAll=function(){return this.nodes.forEach(function(e){return e.parent=void 0}),this.nodes=[],this},n.replaceValues=function(e,t,n){return n||(n=t,t={}),this.walkDecls(function(r){t.props&&-1===t.props.indexOf(r.prop)||t.fast&&-1===r.value.indexOf(t.fast)||(r.value=r.value.replace(e,n))}),this},n.every=function(e){return this.nodes.every(e)},n.some=function(e){return this.nodes.some(e)},n.index=function(e){return"number"==typeof e?e:this.nodes.indexOf(e)},n.normalize=function(e,t){var n=this;if("string"==typeof e)e=function e(t){return t.map(function(t){return t.nodes&&(t.nodes=e(t.nodes)),delete t.source,t})}(Un(e).nodes);else if(!Array.isArray(e))if("root"===e.type)e=e.nodes;else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Nn(e)]}else if(e.selector)e=[new Ln(e)];else if(e.name)e=[new Mn(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new _n(e)]}return e.map(function(e){return void 0===e.raws&&(e=n.rebuild(e)),e.parent&&(e=e.clone()),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/[^\s]/g,"")),e.parent=n,e})},n.rebuild=function(e,t){var n,r=this;for(var i in"root"===e.type?n=new Gn:"atrule"===e.type?n=new Mn:"rule"===e.type?n=new Ln:"decl"===e.type?n=new Nn:"comment"===e.type&&(n=new _n),e)"nodes"===i?n.nodes=e.nodes.map(function(e){return r.rebuild(e,n)}):"parent"===i&&t?n.parent=t:e.hasOwnProperty(i)&&(n[i]=e[i]);return n},n.eachInside=function(e){return rn("Container#eachInside is deprecated. Use Container#walk instead."),this.walk(e)},n.eachDecl=function(e,t){return rn("Container#eachDecl is deprecated. Use Container#walkDecls instead."),this.walkDecls(e,t)},n.eachRule=function(e,t){return rn("Container#eachRule is deprecated. Use Container#walkRules instead."),this.walkRules(e,t)},n.eachAtRule=function(e,t){return rn("Container#eachAtRule is deprecated. Use Container#walkAtRules instead."),this.walkAtRules(e,t)},n.eachComment=function(e){return rn("Container#eachComment is deprecated. Use Container#walkComments instead."),this.walkComments(e)},bt(t,[{key:"first",get:function(){if(this.nodes)return this.nodes[0]}},{key:"last",get:function(){if(this.nodes)return this.nodes[this.nodes.length-1]}},{key:"semicolon",get:function(){return rn("Node#semicolon is deprecated. Use Node#raws.semicolon"),this.raws.semicolon},set:function(e){rn("Node#semicolon is deprecated. Use Node#raws.semicolon"),this.raws.semicolon=e}},{key:"after",get:function(){return rn("Node#after is deprecated. Use Node#raws.after"),this.raws.after},set:function(e){rn("Node#after is deprecated. Use Node#raws.after"),this.raws.after=e}}]),t}(zn),Mn=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="atrule",n}vt(t,e);var n=t.prototype;return n.append=function(){var t;this.nodes||(this.nodes=[]);for(var n=arguments.length,r=new Array(n),i=0;i0&&(a-=1):0===a&&-1!==t.indexOf(c)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=c}return(n||""!==i)&&r.push(i.trim()),r},space:function(e){return qn.split(e,[" ","\n","\t"])},comma:function(e){return qn.split(e,[","],!0)}},Ln=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="rule",n.nodes||(n.nodes=[]),n}return vt(t,e),bt(t,[{key:"selectors",get:function(){return qn.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}},{key:"_selector",get:function(){return rn("Rule#_selector is deprecated. Use Rule#raws.selector"),this.raws.selector},set:function(e){rn("Rule#_selector is deprecated. Use Rule#raws.selector"),this.raws.selector=e}}]),t}(Dn),Bn=function(){function e(e,t){if(void 0===t&&(t={}),this.type="warning",this.text=e,t.node&&t.node.source){var n=t.node.positionBy(t);this.line=n.line,this.column=n.column}for(var r in t)this[r]=t[r]}return e.prototype.toString=function(){return this.node?this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},e}(),Wn=function(){function e(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}var t=e.prototype;return t.toString=function(){return this.css},t.warn=function(e,t){void 0===t&&(t={}),t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new Bn(e,t);return this.messages.push(n),n},t.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},bt(e,[{key:"content",get:function(){return this.css}}]),e}();function Vn(e){return"object"==typeof e&&"function"==typeof e.then}var Hn=function(){function e(t,n,r){var i;if(this.stringified=!1,this.processed=!1,"object"==typeof n&&"root"===n.type)i=n;else if(n instanceof e||n instanceof Wn)i=n.root,n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var o=Un;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(e){this.error=e}}this.result=new Wn(t,i,r)}var t=e.prototype;return t.warnings=function(){return this.sync().warnings()},t.toString=function(){return this.css},t.then=function(e,t){return this.async().then(e,t)},t.catch=function(e){return this.async().catch(e)},t.handleError=function(e,t){try{if(this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(t.postcssVersion){var n=t.postcssPlugin,r=t.postcssVersion,i=this.result.processor.version,o=r.split("."),a=i.split(".");(o[0]!==a[0]||parseInt(o[1])>parseInt(a[1]))&&rn("Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below.")}}else e.plugin=t.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}},t.asyncTick=function(e,t){var n=this;if(this.plugin>=this.processor.plugins.length)return this.processed=!0,e();try{var r=this.processor.plugins[this.plugin],i=this.run(r);this.plugin+=1,Vn(i)?i.then(function(){n.asyncTick(e,t)}).catch(function(e){n.handleError(e,r),n.processed=!0,t(e)}):this.asyncTick(e,t)}catch(e){this.processed=!0,t(e)}},t.async=function(){var e=this;return this.processed?new Promise(function(t,n){e.error?n(e.error):t(e.stringify())}):this.processing?this.processing:(this.processing=new Promise(function(t,n){if(e.error)return n(e.error);e.plugin=0,e.asyncTick(t,n)}).then(function(){return e.processed=!0,e.stringify()}),this.processing)},t.sync=function(){var e=this;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw new Error("Use process(css).then(cb) to work with async plugins");if(this.error)throw this.error;return this.result.processor.plugins.forEach(function(t){if(Vn(e.run(t)))throw new Error("Use process(css).then(cb) to work with async plugins")}),this.result},t.run=function(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){throw this.handleError(t,e),t}},t.stringify=function e(){if(this.stringified)return this.result;this.stringified=!0,this.sync();var t=this.result.opts,n=e;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);var r="";return n(this.root,function(e){r+=e}),this.result.css=r,this.result},bt(e,[{key:"processor",get:function(){return this.result.processor}},{key:"opts",get:function(){return this.result.opts}},{key:"css",get:function(){return this.stringify().css}},{key:"content",get:function(){return this.stringify().content}},{key:"map",get:function(){return this.stringify().map}},{key:"root",get:function(){return this.sync().root}},{key:"messages",get:function(){return this.sync().messages}}]),e}(),Yn=function(){function e(e){void 0===e&&(e=[]),this.version="5.2.0",this.plugins=this.normalize(e)}var t=e.prototype;return t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},t.process=function(e,t){return void 0===t&&(t={}),new Hn(this,e,t)},t.normalize=function(e){var t=[];return e.forEach(function(e){if(e.postcss&&(e=e.postcss),"object"==typeof e&&Array.isArray(e.plugins))t=t.concat(e.plugins);else{if("function"!=typeof e)throw new Error(e+" is not a PostCSS plugin");t.push(e)}}),t},e}(),Gn=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="root",n.nodes||(n.nodes=[]),n}vt(t,e);var n=t.prototype;return n.removeChild=function(t){return 0===(t=this.index(t))&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[t].raws.before),e.prototype.removeChild.call(this,t)},n.normalize=function(t,n,r){var i=e.prototype.normalize.call(this,t);return n&&("prepend"===r?this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before:this.first!==n&&i.forEach(function(e){e.raws.before=n.raws.before})),i},n.toResult=function(e){return void 0===e&&(e={}),new Hn(new Yn,this,e).stringify()},n.remove=function(e){rn("Root#remove is deprecated. Use Root#removeChild"),this.removeChild(e)},n.prevMap=function(){return rn("Root#prevMap is deprecated. Use Root#source.input.map"),this.source.input.map},t}(Dn),Xn=0,Kn=function(){function e(e,t){void 0===t&&(t={}),this.css=e.toString(),"\ufeff"!==this.css[0]&&""!==this.css[0]||(this.css=this.css.slice(1)),t.from&&(this.file=/^\w+:\/\//.test(t.from)?t.from:path.resolve(t.from)),this.file||(this.id=" "),this.map&&(this.map.file=this.from)}var t=e.prototype;return t.error=function(e,t,n,r){var i;void 0===r&&(r={});var o=this.origin(t,n);return(i=o?new Pn(e,o.line,o.column,o.source,o.file,r.plugin):new Pn(e,t,n,this.css,this.file,r.plugin)).input={line:t,column:n,source:this.css},this.file&&(i.input.file=this.file),i},t.origin=function(e,t){if(!this.map)return!1;var n=this.map.consumer(),r=n.originalPositionFor({line:e,column:t});if(!r.source)return!1;var i={file:this.mapResolve(r.source),line:r.line,column:r.column},o=n.sourceContentFor(r.source);return o&&(i.source=o),i},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:path.resolve(this.map.consumer().sourceRoot||".",e)},bt(e,[{key:"from",get:function(){return this.file||this.id}}]),e}(),Zn=function(e){function t(){return e.apply(this,arguments)||this}vt(t,e);var n=t.prototype;return n.tokenize=function(){this.tokens=In(this.input,{ignoreErrors:!0})},n.comment=function(e){var t=new _n;this.init(t,e[2],e[3]),t.source.end={line:e[4],column:e[5]};var n=e[1].slice(2);if("*/"===n.slice(-2)&&(n=n.slice(0,-2)),/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var r=n.match(/^(\s*)([^]*[^\s])(\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}},n.unclosedBracket=function(){},n.unknownWord=function(e){var t=this.tokens.slice(e,this.pos+1);this.spaces+=t.map(function(e){return e[1]}).join("")},n.unexpectedClose=function(){this.current.raws.after+="}"},n.doubleColon=function(){},n.unnamedAtrule=function(e){e.name=""},n.precheckMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){var n;for(n=t-1;n>=0&&"word"!==e[n][0];n--);for(n-=1;n>=0;n--)if("space"!==e[n][0]){n+=1;break}var r=e.splice(n,e.length-n);this.decl(r)}},n.checkMissedSemicolon=function(){},n.endFile=function(){for(this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.current.parent;)this.current=this.current.parent,this.current.raws.after=""},t}(Fn),Jn={},Qn=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},er=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function tr(e,t,n){var r=e[n];Qn(t)&&Qn(r)?nr(r,t):e[n]=t}function nr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r52;t=t/52|0)n=ft(t%52)+n;return(ft(t%52)+n).replace(st,"$1-$2")}(ut(5381,r)>>>0);if(!Jn[i]){var o=(t=new Kn(r,void 0),(n=new Zn(t)).tokenize(),n.loop(),n.root),a=[];o.each(function(e){"decl"===e.type?a.push([e.prop,e.value]):"production"!==process.env.NODE_ENV&&"comment"!==e.type&&console.warn("Node of type "+e.type+" not supported as an inline style")});var s=xe(a,["borderRadius","borderWidth","borderColor","borderStyle"]),f=ir.create({generated:s});Jn[i]=f.generated}return Jn[i]},e}())),cr=function(e){return function e(t,n,r){if(void 0===r&&(r=Ht),"string"!=typeof(i=n)&&"function"!=typeof i&&i!==P&&i!==_&&i!==T&&i!==$&&i!==U&&("object"!=typeof i||null===i||i.$$typeof!==M&&i.$$typeof!==D&&i.$$typeof!==E&&i.$$typeof!==z&&i.$$typeof!==F))return xt(1,String(n));var i,o=function(){return t(n,r,function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?r-1:0),o=1;o=0&&i<1?(s=o,f=a):i>=1&&i<2?(s=a,f=o):i>=2&&i<3?(f=o,u=a):i>=3&&i<4?(f=a,u=o):i>=4&&i<5?(s=a,u=o):i>=5&&i<6&&(s=o,u=a);var c=n-o/2;return r(s+c,f+c,u+c)}var kr={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Sr=/^#[a-fA-F0-9]{6}$/,xr=/^#[a-fA-F0-9]{8}$/,Cr=/^#[a-fA-F0-9]{3}$/,jr=/^#[a-fA-F0-9]{4}$/,Or=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,Ir=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,Rr=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,Ar=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,Pr=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function $r(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function Tr(e){return function e(t,n,r){return function(){var i=r.concat(Array.prototype.slice.call(arguments));return i.length>=n?t.apply(this,i):e(t,n,i)}}(e,e.length,[])}function Er(e,t){if("transparent"===t)return t;var n,r=function(e){if("string"!=typeof e)throw new vr(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return kr[t]?"#"+kr[t]:e}(e);if(t.match(Sr))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(xr)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(Cr))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(jr)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=Or.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var o=Ir.exec(t);if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])};var a=Rr.exec(t);if(a){var s="rgb("+wr(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",f=Or.exec(s);if(!f)throw new vr(4,t,s);return{red:parseInt(""+f[1],10),green:parseInt(""+f[2],10),blue:parseInt(""+f[3],10)}}var u=Ar.exec(t);if(u){var c="rgb("+wr(parseInt(""+u[1],10),parseInt(""+u[2],10)/100,parseInt(""+u[3],10)/100)+")",l=Or.exec(c);if(!l)throw new vr(4,t,c);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10),alpha:parseFloat(""+u[4])}}throw new vr(5)}(t);return function(e,t,n,r){if("object"==typeof e)return e.alpha>=1?function(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return Pr("#"+$r(e)+$r(t)+$r(n));if("object"==typeof e&&void 0===t&&void 0===n)return Pr("#"+$r(e.red)+$r(e.green)+$r(e.blue));throw new vr(6)}(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new vr(7)}(lr({},r,{alpha:(n=(100*("number"==typeof r.alpha?r.alpha:1)-100*parseFloat(e))/100,Math.max(0,Math.min(1,n)))}))}var zr=Tr(Er);function Nr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}var _r=o(cr(s)(function(e){return Fr(e)})),Fr=function(e){var t=["alignContent","alignItems","alignSelf","aspectRatio","backfaceVisibility","backgroundColor","borderBottomColor","borderBottomLeftRadius","borderBottomRightRadius","borderBottomWidth","borderColor","borderLeftColor","borderLeftWidth","borderRadius","borderRightColor","borderRightWidth","borderStyle","borderTopColor","borderTopLeftRadius","borderTopRightRadius","borderTopWidth","borderWidth","bottom","color","decomposedMatrix","direction","display","elevation","flex","flexBasis","flexDirection","flexGrow","flexShrink","flexWrap","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","includeFontPadding","justifyContent","left","letterSpacing","lineHeight","margin","marginBottom","marginHorizontal","marginLeft","marginRight","marginTop","marginVertical","maxHeight","maxWidth","minHeight","minWidth","opacity","overflow","overlayColor","padding","paddingBottom","paddingHorizontal","paddingLeft","paddingRight","paddingTop","paddingVertical","position","resizeMode","right","rotation","scaleX","scaleY","shadowColor","shadowOffset","shadowOpacity","shadowRadius","textAlign","textAlignVertical","textDecorationColor","textDecorationLine","textDecorationStyle","textShadowColor","textShadowOffset","textShadowRadius","tintColor","top","transform","transformMatrix","translateX","translateY","width","writingDirection","zIndex","border","boxShadow","flexFlow","font","textShadow","textDecoration","textDecorationLine","transform","bg","size","m","mt","mb","ml","mr","mx","my","p","pt","pb","pl","pr","px","py","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","overflow","transition"];return Object.keys(e).filter(function(e){return t.includes(e)}).filter(function(t){return!0!==e[t]}).filter(function(t){return null!==e[t]}).reduce(function(t,n){return"size"===n?(t.width=e[n],t.height=e[n]):t[function(e){switch(e){case"bg":return"backgroundColor";case"m":return"margin";case"mt":return"marginTop";case"mr":return"marginRight";case"mb":return"marginBottom";case"ml":return"marginLeft";case"mx":return"marginX";case"my":return"marginY";case"p":return"padding";case"pt":return"paddingTop";case"pr":return"paddingRight";case"pb":return"paddingBottom";case"pl":return"paddingLeft";case"px":return"paddingX";case"py":return"paddingY";default:return e}}(n)]=e[n],t},{})},Ur=function(t){var n=t.src,r=Nr(t,["src"]);return e.createElement(_r,n?Object.assign({},{as:f,source:n},r,{style:Object.assign({},{width:"100%",height:"100%"},Fr(r))}):Object.assign({},{as:s},r))},Dr=function(t){return e.createElement(_r,Object.assign({},{as:u},t))},Mr=function(t){var n=t.src,r=Nr(t,["src"]);return e.createElement(_r,n?Object.assign({},{as:c,source:{uri:n}},r):Object.assign({},{as:c},r))},qr=function(t){return e.createElement(_r,Object.assign({},{as:l},t))},Lr=function(t){return e.createElement(_r,Object.assign({},{as:d},t))},Br=function(t){return e.createElement(_r,Object.assign({},{as:h},t))},Wr=function(t){return e.createElement(_r,Object.assign({},{as:p},t))},Vr=function(t){return e.createElement(_r,Object.assign({},{as:b},t,{keyExtractor:function(e,t){return t.toString()}}))},Hr=function(t){return e.createElement(_r,Object.assign({},{as:m},t))},Yr=function(t){return e.createElement(_r,Object.assign({},{as:v},t))},Gr=function(t){return e.createElement(_r,Object.assign({},{as:g},t))},Xr=function(t){return e.createElement(_r,Object.assign({},{as:y},t))},Kr=function(t){return e.createElement(_r,Object.assign({},{as:w},t))},Zr=function(t){return e.createElement(_r,Object.assign({},{as:f},t,{style:Object.assign({},{width:"100%",height:"100%"},Fr(t))}))},Jr=function(t){return e.createElement(_r,Object.assign({},{as:k},t))},Qr=function(t){return e.createElement(_r,Object.assign({},{as:S},t))},ei=function(t){return e.createElement(_r,Object.assign({},{as:x},t))},ti=function(t){return e.createElement(_r,Object.assign({},{as:C},t))},ni=function(t){return e.createElement(_r,Object.assign({},{as:j},t))},ri=function(t){var n=t.children,r=t.color;void 0===r&&(r="darkmagenta");var i=t.fontSize,o=t.fontFamily,a=t.fontWeight;void 0===a&&(a="bold");var s=t.lineHeight,f=t.letterSpacing,u=t.textAlign,c=t.fontStyle,l=t.textShadow,d=t.disabled,h=Nr(t,["children","color","fontSize","fontFamily","fontWeight","lineHeight","letterSpacing","textAlign","fontStyle","textShadow","disabled"]);return e.createElement(_r,Object.assign({},{as:k,flexDirection:"row",justifyContent:"center",alignItems:"center",disabled:d},h),e.Children.map(n,function(t){return q(t)?t:e.createElement(Dr,{opacity:d?.3:1,color:r,fontFamily:o,fontSize:i,fontWeight:a,lineHeight:s,letterSpacing:f,textAlign:u,fontStyle:c,textShadow:l},t)}))},ii=i(),oi=function(t){return e.createElement(ii.Provider,{value:t.value},t.children)},ai=function(){return t(ii)},si=o(function(t){var n=t.onSearch,r=t.ref,i=t.height;void 0===i&&(i=32);var o=t.color;void 0===o&&(o="black");var s=t.borderRadius;void 0===s&&(s=5);var f=t.bg;void 0===f&&(f="white");var u=t.cancelColor;void 0===u&&(u="blue");var c=t.placeholder;void 0===c&&(c="search");var l=Nr(t,["onSearch","ref","height","margin","color","borderRadius","bg","cancelColor","placeholder"]),d=a(""),h=d[0],p=d[1],b=a(!1),m=b[0],v=b[1];return e.createElement(Ur,Object.assign({},{height:i},l,{flexDirection:"row",alignItems:"stretch"}),e.createElement(Ur,{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:s,bg:f},e.createElement(Dr,{color:o?zr(.5,o):"grey",fontSize:22,mb:4}," ⌕ "),e.createElement(qr,{ref:r,value:h,onChangeText:function(e){p(e),n(e)},onFocus:function(){return v(!0)},onBlur:function(){return v(!1)},multiline:!1,placeholder:c,placeholderTextColor:o?zr(.5,o):"grey",backgroundColor:"transparent",flex:1,color:o}),m?e.createElement(Jr,{onPress:function(){p(""),n("")}},e.createElement(Dr,{color:o?zr(.5,o):"grey",fontSize:18}," ⊗ ")):null),m?e.createElement(ri,{onPress:function(){p(""),n(""),O.dismiss(),v(!1)},color:u||"blue",justifyContent:"center",fontSize:20,fontWeight:"200",m:2},"cancel"):null)});export{ai as useValue,oi as Context,Ur as View,Dr as Text,ri as Button,Mr as Image,qr as TextInput,Lr as ScrollView,Br as Picker,Vr as FlatList,Hr as SectionList,Wr as Switch,Yr as ActivityIndicator,Gr as Alert,Xr as Modal,Kr as StatusBar,Zr as ImageBackground,Jr as TouchableOpacity,Qr as TouchableHighlight,ei as TouchableWithoutFeedback,ti as KeyboardAvoidingView,ni as SafeAreaView,si as SearchBar};
2 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "styled-system-native",
3 | "version": "1.1.7",
4 | "description": "css-in-js",
5 | "author": "rnkids",
6 | "license": "MIT",
7 | "source": "src/index.js",
8 | "main": "dist/index.js",
9 | "mangle": {
10 | "regex": "^_"
11 | },
12 | "devDependencies": {
13 | "microbundle": "^0.11.0",
14 | "polished": "^3.5.2",
15 | "react-is-esm": "^16.8.4-alpha.0",
16 | "styled-components-native-esm": "5.1.1"
17 | },
18 | "scripts": {
19 | "build": "microbundle -f es --sourcemap false --jsx React.createElement --globals react,react-native --external react,react-native"
20 | },
21 | "repository": {
22 | "type": "git",
23 | "url": "https://github.com/rnkids/styled-system-native"
24 | },
25 | "keywords": [
26 | "styled-system-native",
27 | "styled-system",
28 | "styled-components",
29 | "css-in-js",
30 | "react-native"
31 | ]
32 | }
33 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { createContext, useContext, memo, useState, } from 'react'
2 | import * as ReactIs from 'react-is-esm';
3 | import styled from 'styled-components-native-esm'
4 | import * as N from 'react-native'
5 | import { transparentize } from 'polished'
6 |
7 | const Box = memo(styled(N.View)(props => _css(props)))
8 |
9 | const _css = p => {
10 | const _a = [
11 | "alignContent",
12 | "alignItems",
13 | "alignSelf",
14 | "aspectRatio",
15 | "backfaceVisibility",
16 | "backgroundColor",
17 | "borderBottomColor",
18 | "borderBottomLeftRadius",
19 | "borderBottomRightRadius",
20 | "borderBottomWidth",
21 | "borderColor",
22 | "borderLeftColor",
23 | "borderLeftWidth",
24 | "borderRadius",
25 | "borderRightColor",
26 | "borderRightWidth",
27 | "borderStyle",
28 | "borderTopColor",
29 | "borderTopLeftRadius",
30 | "borderTopRightRadius",
31 | "borderTopWidth",
32 | "borderWidth",
33 | "bottom",
34 | "color",
35 | "decomposedMatrix",
36 | "direction",
37 | "display",
38 | "elevation",
39 | "flex",
40 | "flexBasis",
41 | "flexDirection",
42 | "flexGrow",
43 | "flexShrink",
44 | "flexWrap",
45 | "fontFamily",
46 | "fontSize",
47 | "fontStyle",
48 | "fontVariant",
49 | "fontWeight",
50 | "height",
51 | "includeFontPadding",
52 | "justifyContent",
53 | "left",
54 | "letterSpacing",
55 | "lineHeight",
56 | "margin",
57 | "marginBottom",
58 | "marginHorizontal",
59 | "marginLeft",
60 | "marginRight",
61 | "marginTop",
62 | "marginVertical",
63 | "maxHeight",
64 | "maxWidth",
65 | "minHeight",
66 | "minWidth",
67 | "opacity",
68 | "overflow",
69 | "overlayColor",
70 | "padding",
71 | "paddingBottom",
72 | "paddingHorizontal",
73 | "paddingLeft",
74 | "paddingRight",
75 | "paddingTop",
76 | "paddingVertical",
77 | "position",
78 | "resizeMode",
79 | "right",
80 | "rotation",
81 | "scaleX",
82 | "scaleY",
83 | "shadowColor",
84 | "shadowOffset",
85 | "shadowOpacity",
86 | "shadowRadius",
87 | "textAlign",
88 | "textAlignVertical",
89 | "textDecorationColor",
90 | "textDecorationLine",
91 | "textDecorationStyle",
92 | "textShadowColor",
93 | "textShadowOffset",
94 | "textShadowRadius",
95 | "tintColor",
96 | "top",
97 | "transform",
98 | "transformMatrix",
99 | "translateX",
100 | "translateY",
101 | "width",
102 | "writingDirection",
103 | "zIndex",
104 | "border",
105 | "boxShadow",
106 | "flexFlow",
107 | "font",
108 | "textShadow",
109 | "textDecoration",
110 | "textDecorationLine",
111 | "transform",
112 | "bg",
113 | "size",
114 | "m", "mt", "mb", "ml", "mr", "mx", "my",
115 | "p", "pt", "pb", "pl", "pr", "px", "py",
116 | "backgroundImage",
117 | "backgroundSize",
118 | "backgroundPosition",
119 | "backgroundRepeat",
120 | "overflow",
121 | "transition"
122 | ]
123 |
124 | const _c = k => {
125 | switch (k) {
126 | case "bg": return "backgroundColor";
127 | case "m": return "margin";
128 | case "mt": return "marginTop";
129 | case "mr": return "marginRight";
130 | case "mb": return "marginBottom";
131 | case "ml": return "marginLeft";
132 | case "mx": return "marginX";
133 | case "my": return "marginY";
134 | case "p": return "padding";
135 | case "pt": return "paddingTop";
136 | case "pr": return "paddingRight";
137 | case "pb": return "paddingBottom";
138 | case "pl": return "paddingLeft";
139 | case "px": return "paddingX";
140 | case "py": return "paddingY";
141 | default: return k;
142 | }
143 | }
144 |
145 | return Object.keys(p)
146 | .filter(key => _a.includes(key))
147 | .filter(key => p[key] !== true)
148 | .filter(key => p[key] !== null)
149 | .reduce((obj, key) => {
150 | if (key === "size") {
151 | obj["width"] = p[key]
152 | obj["height"] = p[key]
153 | } else {
154 | obj[_c(key)] = p[key];
155 | }
156 | return obj;
157 | }, {});
158 | }
159 |
160 | // const View = props => ;
161 | const View = ({ src, ...props }) => src ? :
162 | // const View = ({ src, ...props }) => src ? :
163 |
164 | const Text = props => ;
165 | // const Image = props =>
166 | const Image = ({ src, ...props }) => src ? :
167 |
168 | const TextInput = props =>
169 | const ScrollView = props =>
170 | const Picker = props =>
171 | // const Slider = props =>
172 | const Switch = props =>
173 | const FlatList = props => index.toString()}/>
174 | const SectionList = props =>
175 | const ActivityIndicator = props =>
176 | const Alert = props =>
177 | const Modal = props =>
178 | const StatusBar = props =>
179 |
180 | const ImageBackground = props =>
181 | const TouchableOpacity = props =>
182 | const TouchableHighlight = props =>
183 | const TouchableWithoutFeedback = props =>
184 | const KeyboardAvoidingView = props =>
185 | const SafeAreaView = props =>
186 |
187 | const Button = ({ children, color = "darkmagenta", fontSize, fontFamily, fontWeight = "bold", lineHeight, letterSpacing, textAlign, fontStyle, textShadow, disabled, ...props }) => {
188 | return (
189 |
190 | {React.Children.map(children, child => ReactIs.isElement(child) ? child : {child} )}
201 |
202 | )
203 | }
204 |
205 | //Context
206 | const RCtx = createContext();
207 |
208 | const Context = ({ children, value }) => {children}
209 |
210 | const useValue = () => useContext(RCtx)
211 | //SearchBar
212 |
213 | const SearchBar = memo(({
214 | onSearch,
215 | ref,
216 | height = 32,
217 | margin = 2,
218 | color = "black",
219 | borderRadius = 5,
220 | bg = "white",
221 | cancelColor = "blue",
222 | placeholder = "search",
223 | ...props }) => {
224 | const [value, setValue] = useState("")
225 | const [iconVisible, setIconVisible] = useState(false)
226 | return (
227 |
233 |
241 |
242 | ⌕
243 | {
247 | setValue(text)
248 | onSearch(text)
249 | }}
250 | onFocus={() => setIconVisible(true)}
251 | onBlur={() => setIconVisible(false)}
252 | multiline={false}
253 | placeholder={placeholder}
254 | placeholderTextColor={color ? transparentize(0.5, color) : "grey"}
255 | backgroundColor="transparent"
256 | flex={1}
257 | color={color}
258 | >
259 | {iconVisible ? ( {
260 | setValue("");
261 | onSearch("")
262 | }
263 | }>
264 | ⊗
265 | ) : null}
266 |
267 | {iconVisible ? ( {
269 | setValue("")
270 | onSearch("")
271 | N.Keyboard.dismiss();
272 | setIconVisible(false);
273 | }}
274 | color={cancelColor ? cancelColor : "blue"}
275 | justifyContent="center"
276 | fontSize={20}
277 | fontWeight="200"
278 | m={2}
279 | >cancel ) : null}
280 |
281 | )
282 | })
283 |
284 | export {
285 | useValue,
286 | Context,
287 | View,
288 | Text,
289 | Button,
290 | Image,
291 | TextInput,
292 | ScrollView,
293 | Picker,
294 | FlatList,
295 | SectionList,
296 | Switch,
297 | ActivityIndicator,
298 | Alert,
299 | Modal,
300 | StatusBar,
301 | ImageBackground,
302 | TouchableOpacity,
303 | TouchableHighlight,
304 | TouchableWithoutFeedback,
305 | KeyboardAvoidingView,
306 | SafeAreaView,
307 | SearchBar,
308 | }
--------------------------------------------------------------------------------