enerdot-front-system 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +143 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +983 -0
- package/package.json +6 -2
- package/dist/index.cjs.js +0 -143
- package/dist/index.es.js +0 -820
- /package/dist/{styles → theme}/color.style.d.ts +0 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const br=require("react"),yr=require("styled-components"),mr=r=>r&&typeof r=="object"&&"default"in r?r:{default:r};function $r(r){if(r&&typeof r=="object"&&"default"in r)return r;const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const c in r)if(c!=="default"){const d=Object.getOwnPropertyDescriptor(r,c);Object.defineProperty(s,c,d.get?d:{enumerable:!0,get:()=>r[c]})}}return s.default=r,Object.freeze(s)}const Er=$r(br),q=mr(yr);function Rr(r){if(r.__esModule)return r;var s=r.default;if(typeof s=="function"){var c=function d(){return this instanceof d?Reflect.construct(s,arguments,this.constructor):s.apply(this,arguments)};c.prototype=s.prototype}else c={};return Object.defineProperty(c,"__esModule",{value:!0}),Object.keys(r).forEach(function(d){var y=Object.getOwnPropertyDescriptor(r,d);Object.defineProperty(c,d,y.get?y:{enumerable:!0,get:function(){return r[d]}})}),c}var N={exports:{}},Y={};const De=Rr(Er);/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var xe;function _r(){if(xe)return Y;xe=1;var r=De,s=Symbol.for("react.element"),c=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,y=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,F={key:!0,ref:!0,__self:!0,__source:!0};function C(m,v,_){var p,b={},$=null,S=null;_!==void 0&&($=""+_),v.key!==void 0&&($=""+v.key),v.ref!==void 0&&(S=v.ref);for(p in v)d.call(v,p)&&!F.hasOwnProperty(p)&&(b[p]=v[p]);if(m&&m.defaultProps)for(p in v=m.defaultProps,v)b[p]===void 0&&(b[p]=v[p]);return{$$typeof:s,type:m,key:$,ref:S,props:b,_owner:y.current}}return Y.Fragment=c,Y.jsx=C,Y.jsxs=C,Y}var z={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Oe;function wr(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&function(){var r=De,s=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),D=Symbol.iterator,ke="@@iterator";function Ae(e){if(e===null||typeof e!="object")return null;var t=D&&e[D]||e[ke];return typeof t=="function"?t:null}var k=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];Be("error",e,n)}}function Be(e,t,n){{var o=k.ReactDebugCurrentFrame,u=o.getStackAddendum();u!==""&&(t+="%s",n=n.concat([u]));var f=n.map(function(l){return String(l)});f.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,f)}}var We=!1,Ie=!1,Ye=!1,ze=!1,Me=!1,oe;oe=Symbol.for("react.module.reference");function Le(e){return!!(typeof e=="string"||typeof e=="function"||e===d||e===F||Me||e===y||e===_||e===p||ze||e===S||We||Ie||Ye||typeof e=="object"&&e!==null&&(e.$$typeof===$||e.$$typeof===b||e.$$typeof===C||e.$$typeof===m||e.$$typeof===v||e.$$typeof===oe||e.getModuleId!==void 0))}function Ve(e,t,n){var o=e.displayName;if(o)return o;var u=t.displayName||t.name||"";return u!==""?n+"("+u+")":n}function ae(e){return e.displayName||"Context"}function O(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case d:return"Fragment";case c:return"Portal";case F:return"Profiler";case y:return"StrictMode";case _:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m:var t=e;return ae(t)+".Consumer";case C:var n=e;return ae(n._context)+".Provider";case v:return Ve(e,e.render,"ForwardRef");case b:var o=e.displayName||null;return o!==null?o:O(e.type)||"Memo";case $:{var u=e,f=u._payload,l=u._init;try{return O(l(f))}catch{return null}}}return null}var T=Object.assign,W=0,ie,le,se,ue,ce,fe,de;function ve(){}ve.__reactDisabledLog=!0;function Ue(){{if(W===0){ie=console.log,le=console.info,se=console.warn,ue=console.error,ce=console.group,fe=console.groupCollapsed,de=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}}function Ne(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:T({},e,{value:ie}),info:T({},e,{value:le}),warn:T({},e,{value:se}),error:T({},e,{value:ue}),group:T({},e,{value:ce}),groupCollapsed:T({},e,{value:fe}),groupEnd:T({},e,{value:de})})}W<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var X=k.ReactCurrentDispatcher,H;function M(e,t,n){{if(H===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);H=o&&o[1]||""}return`
|
|
18
|
+
`+H+e}}var Z=!1,L;{var qe=typeof WeakMap=="function"?WeakMap:Map;L=new qe}function pe(e,t){if(!e||Z)return"";{var n=L.get(e);if(n!==void 0)return n}var o;Z=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=X.current,X.current=null,Ue();try{if(t){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(w){o=w}Reflect.construct(e,[],l)}else{try{l.call()}catch(w){o=w}e.call(l.prototype)}}else{try{throw Error()}catch(w){o=w}e()}}catch(w){if(w&&o&&typeof w.stack=="string"){for(var a=w.stack.split(`
|
|
19
|
+
`),R=o.stack.split(`
|
|
20
|
+
`),g=a.length-1,h=R.length-1;g>=1&&h>=0&&a[g]!==R[h];)h--;for(;g>=1&&h>=0;g--,h--)if(a[g]!==R[h]){if(g!==1||h!==1)do if(g--,h--,h<0||a[g]!==R[h]){var j=`
|
|
21
|
+
`+a[g].replace(" at new "," at ");return e.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,j),j}while(g>=1&&h>=0);break}}}finally{Z=!1,X.current=f,Ne(),Error.prepareStackTrace=u}var B=e?e.displayName||e.name:"",P=B?M(B):"";return typeof e=="function"&&L.set(e,P),P}function Je(e,t,n){return pe(e,!1)}function Ke(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function V(e,t,n){if(e==null)return"";if(typeof e=="function")return pe(e,Ke(e));if(typeof e=="string")return M(e);switch(e){case _:return M("Suspense");case p:return M("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return Je(e.render);case b:return V(e.type,t,n);case $:{var o=e,u=o._payload,f=o._init;try{return V(f(u),t,n)}catch{}}}return""}var I=Object.prototype.hasOwnProperty,ge={},he=k.ReactDebugCurrentFrame;function U(e){if(e){var t=e._owner,n=V(e.type,e._source,t?t.type:null);he.setExtraStackFrame(n)}else he.setExtraStackFrame(null)}function Ge(e,t,n,o,u){{var f=Function.call.bind(I);for(var l in e)if(f(e,l)){var a=void 0;try{if(typeof e[l]!="function"){var R=Error((o||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}a=e[l](t,l,o,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(g){a=g}a&&!(a instanceof Error)&&(U(u),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",n,l,typeof a),U(null)),a instanceof Error&&!(a.message in ge)&&(ge[a.message]=!0,U(u),E("Failed %s type: %s",n,a.message),U(null))}}}var Xe=Array.isArray;function Q(e){return Xe(e)}function He(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,n=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function Ze(e){try{return be(e),!1}catch{return!0}}function be(e){return""+e}function ye(e){if(Ze(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(e)),be(e)}var me=k.ReactCurrentOwner,Qe={key:!0,ref:!0,__self:!0,__source:!0},$e,Ee;function er(e){if(I.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function rr(e){if(I.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function tr(e,t){typeof e.ref=="string"&&me.current}function nr(e,t){{var n=function(){$e||($e=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function or(e,t){{var n=function(){Ee||(Ee=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var ar=function(e,t,n,o,u,f,l){var a={$$typeof:s,type:e,key:t,ref:n,props:l,_owner:f};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ir(e,t,n,o,u){{var f,l={},a=null,R=null;n!==void 0&&(ye(n),a=""+n),rr(t)&&(ye(t.key),a=""+t.key),er(t)&&(R=t.ref,tr(t,u));for(f in t)I.call(t,f)&&!Qe.hasOwnProperty(f)&&(l[f]=t[f]);if(e&&e.defaultProps){var g=e.defaultProps;for(f in g)l[f]===void 0&&(l[f]=g[f])}if(a||R){var h=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&nr(l,h),R&&or(l,h)}return ar(e,a,R,u,o,me.current,l)}}var ee=k.ReactCurrentOwner,Re=k.ReactDebugCurrentFrame;function A(e){if(e){var t=e._owner,n=V(e.type,e._source,t?t.type:null);Re.setExtraStackFrame(n)}else Re.setExtraStackFrame(null)}var re;re=!1;function te(e){return typeof e=="object"&&e!==null&&e.$$typeof===s}function _e(){{if(ee.current){var e=O(ee.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function lr(e){return""}var we={};function sr(e){{var t=_e();if(!t){var n=typeof e=="string"?e:e.displayName||e.name;n&&(t=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+n+">.")}return t}}function Ce(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=sr(t);if(we[n])return;we[n]=!0;var o="";e&&e._owner&&e._owner!==ee.current&&(o=" It was passed a child from "+O(e._owner.type)+"."),A(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,o),A(null)}}function Fe(e,t){{if(typeof e!="object")return;if(Q(e))for(var n=0;n<e.length;n++){var o=e[n];te(o)&&Ce(o,t)}else if(te(e))e._store&&(e._store.validated=!0);else if(e){var u=Ae(e);if(typeof u=="function"&&u!==e.entries)for(var f=u.call(e),l;!(l=f.next()).done;)te(l.value)&&Ce(l.value,t)}}}function ur(e){{var t=e.type;if(t==null||typeof t=="string")return;var n;if(typeof t=="function")n=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===v||t.$$typeof===b))n=t.propTypes;else return;if(n){var o=O(t);Ge(n,e.props,"prop",o,e)}else if(t.PropTypes!==void 0&&!re){re=!0;var u=O(t);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function cr(e){{for(var t=Object.keys(e.props),n=0;n<t.length;n++){var o=t[n];if(o!=="children"&&o!=="key"){A(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),A(null);break}}e.ref!==null&&(A(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var Se={};function je(e,t,n,o,u,f){{var l=Le(e);if(!l){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var R=lr();R?a+=R:a+=_e();var g;e===null?g="null":Q(e)?g="array":e!==void 0&&e.$$typeof===s?(g="<"+(O(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):g=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",g,a)}var h=ir(e,t,n,u,f);if(h==null)return h;if(l){var j=t.children;if(j!==void 0)if(o)if(Q(j)){for(var B=0;B<j.length;B++)Fe(j[B],e);Object.freeze&&Object.freeze(j)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(j,e)}if(I.call(t,"key")){var P=O(e),w=Object.keys(t).filter(function(hr){return hr!=="key"}),ne=w.length>0?"{key: someKey, "+w.join(": ..., ")+": ...}":"{key: someKey}";if(!Se[P+ne]){var gr=w.length>0?"{"+w.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,ne,P,gr,P),Se[P+ne]=!0}}return e===d?cr(h):ur(h),h}}function fr(e,t,n){return je(e,t,n,!0)}function dr(e,t,n){return je(e,t,n,!1)}var vr=dr,pr=fr;z.Fragment=d,z.jsx=vr,z.jsxs=pr}()),z}var Te;function Cr(){return Te||(Te=1,process.env.NODE_ENV==="production"?N.exports=_r():N.exports=wr()),N.exports}var x=Cr();const i={white:"#FFFFFF",black:"#222222",gray50:"#FBFBFB",gray100:"#F7F8F9",gray200:"#EBEDF2",gray300:"#DADEE5",gray400:"#C6CBD3",gray500:"#BABFC9",gray600:"#A3A8B4",gray700:"#8A8F9D",gray800:"#6D717D",gray900:"#4A515D",blue100:"#F1F5FE",blue200:"#CEDBFF",blue300:"#A7BFFF",blue400:"#7EA1FF",blue500:"#5884FF",blue600:"#3369FF",blue700:"#2B59D9",blue800:"#244BB5",blue900:"#1D3C91",red50:"#FFF1EF",red100:"#FFACAD",red200:"#FF8182",red300:"#FA4549",red400:"#CF222E",red500:"#82071E",orange50:"#FFF1E5",orange100:"#FFD0AA",orange200:"#FFB37D",orange300:"#FF8E40",orange400:"#E16F24",orange500:"#953800",green50:"#EFFDEE",green100:"#8AE3A1",green200:"#4DD470",green300:"#1CB854",green400:"#149E53",green500:"#086A49",yellow50:"#FEF9E6",yellow100:"#FADD78",yellow200:"#F7CC33",yellow300:"#F7B200",yellow400:"#CB9D26",yellow500:"#956B00"},J={small:{height:32,fontSize:1.6,fontWeights:["400","500","700"]},medium:{height:40,fontSize:1.8,fontWeights:["500","500","700"]},large:{height:48,fontSize:2,fontWeights:["700","700","700"]}},K={full:5,round:.8,no:0},G={primary:{$mainColor:i.blue600,$hoverColor:i.blue700,$activeColor:i.white,$disabledColor:i.blue200},green:{$mainColor:i.green300,$hoverColor:i.green400,$activeColor:i.white,$disabledColor:i.green50},red:{$mainColor:i.red300,$hoverColor:i.red400,$activeColor:i.white,$disabledColor:i.red50},orange:{$mainColor:i.orange300,$hoverColor:i.orange400,$activeColor:i.white,$disabledColor:i.orange50},yellow:{$mainColor:i.yellow300,$hoverColor:i.yellow400,$activeColor:i.white,$disabledColor:i.yellow50},gray:{$mainColor:i.gray900,$hoverColor:i.black,$activeColor:i.black,$disabledColor:i.gray300}},Pe=r=>{const{children:s,baseColor:c="primary",level:d="small",borderRadius:y="round",pl:F=2,pr:C=2,width:m="fit-content",...v}=r,{height:_,fontSize:p,fontWeights:b}=J[d],$=K[y],S=G[c];return x.jsx(Fr,{$borderRadius:$,$height:_,$fontSize:p,$fontWeights:b,$pl:F,$pr:C,$width:m,...S,...v,children:s})},Fr=q.default.button`
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
transition: 0.1s linear;
|
|
35
|
+
transition-property: background-color, border-color;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
width: ${({$width:r})=>r};
|
|
38
|
+
|
|
39
|
+
color: ${i.white};
|
|
40
|
+
font-size: ${({$fontSize:r})=>r}rem;
|
|
41
|
+
font-weight: ${({$fontWeights:r})=>r[0]};
|
|
42
|
+
border-radius: ${({$borderRadius:r})=>r}rem;
|
|
43
|
+
padding-right: ${({$pr:r})=>r}rem;
|
|
44
|
+
padding-left: ${({$pl:r})=>r}rem;
|
|
45
|
+
height: ${({$height:r})=>r}px;
|
|
46
|
+
background-color: ${({$mainColor:r})=>r};
|
|
47
|
+
|
|
48
|
+
&:hover:not([disabled]) {
|
|
49
|
+
background-color: ${({$hoverColor:r})=>r};
|
|
50
|
+
font-weight: ${({$fontWeights:r})=>r[1]};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:disabled {
|
|
54
|
+
background-color: ${({$disabledColor:r})=>r};
|
|
55
|
+
}
|
|
56
|
+
`,Sr=r=>{const{children:s,baseColor:c="primary",level:d="small",borderRadius:y="round",pl:F=2,pr:C=2,width:m="fit-content",isSelected:v,..._}=r,{height:p,fontSize:b,fontWeights:$}=J[d],S=K[y],D=G[c];return x.jsx(jr,{$borderRadius:S,$height:p,$fontSize:b,$fontWeights:$,$pl:F,$pr:C,$width:m,$isSelected:v,...D,..._,children:s})},jr=q.default.button`
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
transition: 0.1s linear;
|
|
61
|
+
transition-property: border-color, color, background-color;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
width: ${({$width:r})=>r};
|
|
64
|
+
|
|
65
|
+
background-color: ${({$isSelected:r,$mainColor:s})=>r?s:i.white};
|
|
66
|
+
color: ${({$mainColor:r,$isSelected:s})=>s?i.white:r};
|
|
67
|
+
|
|
68
|
+
border: 1px solid ${({$mainColor:r})=>r};
|
|
69
|
+
font-size: ${({$fontSize:r})=>r}rem;
|
|
70
|
+
font-weight: ${({$fontWeights:r})=>r[0]};
|
|
71
|
+
border-radius: ${({$borderRadius:r})=>r}rem;
|
|
72
|
+
padding-right: ${({$pr:r})=>r}rem;
|
|
73
|
+
padding-left: ${({$pl:r})=>r}rem;
|
|
74
|
+
height: ${({$height:r})=>r}px;
|
|
75
|
+
|
|
76
|
+
&:hover:not([disabled]) {
|
|
77
|
+
color: ${({$hoverColor:r})=>r};
|
|
78
|
+
border: 1px solid ${({$hoverColor:r})=>r};
|
|
79
|
+
font-weight: ${({$fontWeights:r})=>r[1]};
|
|
80
|
+
background-color: ${i.white};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&:disabled {
|
|
84
|
+
color: ${({$disabledColor:r})=>r};
|
|
85
|
+
border: 1px solid ${({$disabledColor:r})=>r};
|
|
86
|
+
}
|
|
87
|
+
`,xr=r=>{const{children:s,baseColor:c="gray",level:d="small",borderRadius:y="round",pl:F=2,pr:C=2,width:m="fit-content",...v}=r,{height:_,fontSize:p,fontWeights:b}=J[d],$=K[y],S=G[c];return x.jsx(Or,{$borderRadius:$,$height:_,$fontSize:p,$fontWeights:b,$pl:F,$pr:C,$width:m,...S,...v,children:s})},Or=q.default.button`
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
transition: 0.1s linear;
|
|
92
|
+
transition-property: border-color, color;
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
width: ${({$width:r})=>r};
|
|
95
|
+
|
|
96
|
+
background-color: ${i.white};
|
|
97
|
+
color: ${({$mainColor:r})=>r};
|
|
98
|
+
border: 1px solid ${i.gray400};
|
|
99
|
+
font-size: ${({$fontSize:r})=>r}rem;
|
|
100
|
+
font-weight: ${({$fontWeights:r})=>r[0]};
|
|
101
|
+
border-radius: ${({$borderRadius:r})=>r}rem;
|
|
102
|
+
padding-right: ${({$pr:r})=>r}rem;
|
|
103
|
+
padding-left: ${({$pl:r})=>r}rem;
|
|
104
|
+
height: ${({$height:r})=>r}px;
|
|
105
|
+
|
|
106
|
+
&:hover:not([disabled]) {
|
|
107
|
+
color: ${({$hoverColor:r})=>r};
|
|
108
|
+
border: 1px solid ${i.gray600};
|
|
109
|
+
font-weight: ${({$fontWeights:r})=>r[1]};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&:disabled {
|
|
113
|
+
color: ${({$disabledColor:r})=>r};
|
|
114
|
+
border: 1px solid ${i.gray300};
|
|
115
|
+
}
|
|
116
|
+
`,Tr=r=>{const{children:s,baseColor:c="gray",level:d="small",borderRadius:y="round",pl:F=2,pr:C=2,width:m="fit-content",isSelected:v,..._}=r,{height:p,fontSize:b,fontWeights:$}=J[d],S=K[y],D=G[c];return x.jsx(Pr,{$borderRadius:S,$height:p,$fontSize:b,$fontWeights:$,$pl:F,$pr:C,$width:m,$isSelected:v,...D,..._,children:s})},Pr=q.default.button`
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
transition: 0.1s linear;
|
|
121
|
+
transition-property: border-color, color;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
width: ${({$width:r})=>r};
|
|
124
|
+
|
|
125
|
+
background-color: ${i.white};
|
|
126
|
+
color: ${({$mainColor:r,$isSelected:s})=>s?i.black:r};
|
|
127
|
+
border: none;
|
|
128
|
+
font-size: ${({$fontSize:r})=>r}rem;
|
|
129
|
+
font-weight: ${({$fontWeights:r})=>r[0]};
|
|
130
|
+
border-radius: ${({$borderRadius:r})=>r}rem;
|
|
131
|
+
padding-right: ${({$pr:r})=>r}rem;
|
|
132
|
+
padding-left: ${({$pl:r})=>r}rem;
|
|
133
|
+
height: ${({$height:r})=>r}px;
|
|
134
|
+
|
|
135
|
+
&:hover:not([disabled]) {
|
|
136
|
+
color: ${({$hoverColor:r})=>r};
|
|
137
|
+
font-weight: ${({$fontWeights:r})=>r[1]};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&:disabled {
|
|
141
|
+
color: ${({$disabledColor:r})=>r};
|
|
142
|
+
}
|
|
143
|
+
`,Dr=r=>{const{theme:s="primary",...c}=r;switch(s){case"primary":return x.jsx(Pe,{...c});case"secondary":return x.jsx(Sr,{...c});case"tertiary":return x.jsx(xr,{...c});case"text":return x.jsx(Tr,{...c});default:return x.jsx(Pe,{...c})}};exports.Button=Dr;exports.themeColors=i;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from '
|
|
1
|
+
export { default as Button } from './components/Button';
|
|
2
|
+
export * from './theme/color.style';
|