enerdot-front-system 0.0.8 → 0.0.10
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/README.md +18 -2
- package/dist/index.cjs.js +425 -97
- package/dist/index.es.js +1533 -658
- package/dist/lib/components/ButtonFilter/Button.d.ts +6 -0
- package/dist/lib/components/ButtonFilter/CustomFilter.d.ts +13 -0
- package/dist/lib/components/ButtonFilter/index.d.ts +14 -0
- package/dist/lib/components/ButtonFilter/index.style.d.ts +8 -0
- package/dist/lib/components/Divider/index.d.ts +6 -0
- package/dist/lib/components/IconButton/OnlyIconButton.d.ts +3 -0
- package/dist/lib/components/IconButton/OnlyIconWhButton.d.ts +3 -0
- package/dist/lib/components/IconButton/PrimaryButton.d.ts +3 -0
- package/dist/lib/components/IconButton/SecondaryButton.d.ts +3 -0
- package/dist/lib/components/IconButton/TertiaryButton.d.ts +3 -0
- package/dist/lib/components/IconButton/common.d.ts +50 -0
- package/dist/lib/components/IconButton/index.d.ts +9 -0
- package/dist/lib/components/IconWithButton/index.d.ts +8 -0
- package/dist/lib/components/Inputs/Input.d.ts +15 -0
- package/dist/lib/components/Inputs/SearchInput.d.ts +7 -0
- package/dist/lib/components/Svg/arrow/ArrowDown.d.ts +5 -0
- package/dist/lib/components/Svg/arrow/ArrowUp.d.ts +5 -0
- package/dist/lib/hooks/useElementSize.d.ts +2 -0
- package/dist/lib/hooks/useTooltip.d.ts +2 -0
- package/dist/lib/index.d.ts +7 -0
- package/dist/lib/utils/input.d.ts +6 -0
- package/dist/lib/utils/throttle.d.ts +1 -0
- package/dist/lib/utils/validate.d.ts +14 -0
- package/package.json +5 -4
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react"),Ar=require("styled-components"),Ir=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function Wr(e){if(e&&typeof e=="object"&&"default"in e)return e;const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(o,i,l.get?l:{enumerable:!0,get:()=>e[i]})}}return o.default=e,Object.freeze(o)}const zr=Wr(B),g=Ir(Ar);function Lr(e){if(e.__esModule)return e;var o=e.default;if(typeof o=="function"){var i=function l(){return this instanceof l?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};i.prototype=o.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(l){var d=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(i,l,d.get?d:{enumerable:!0,get:function(){return e[l]}})}),i}var ne={exports:{}},q={};const Xe=Lr(zr);/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Ne;function Mr(){if(Ne)return q;Ne=1;var e=Xe,o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,d=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(f,p,v){var b,y={},w=null,k=null;v!==void 0&&(w=""+v),p.key!==void 0&&(w=""+p.key),p.ref!==void 0&&(k=p.ref);for(b in p)l.call(p,b)&&!a.hasOwnProperty(b)&&(y[b]=p[b]);if(f&&f.defaultProps)for(b in p=f.defaultProps,p)y[b]===void 0&&(y[b]=p[b]);return{$$typeof:o,type:f,key:w,ref:k,props:y,_owner:d.current}}return q.Fragment=i,q.jsx=u,q.jsxs=u,q}var J={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,133 +14,133 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`)
|
|
21
|
-
`+
|
|
17
|
+
*/var Ye;function Vr(){return Ye||(Ye=1,process.env.NODE_ENV!=="production"&&function(){var e=Xe,o=Symbol.for("react.element"),i=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),F=Symbol.iterator,E="@@iterator";function O(r){if(r===null||typeof r!="object")return null;var n=F&&r[F]||r[E];return typeof n=="function"?n:null}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(r){{for(var n=arguments.length,c=new Array(n>1?n-1:0),h=1;h<n;h++)c[h-1]=arguments[h];L("error",r,c)}}function L(r,n,c){{var h=_.ReactDebugCurrentFrame,x=h.getStackAddendum();x!==""&&(n+="%s",c=c.concat([x]));var j=c.map(function($){return String($)});j.unshift("Warning: "+n),Function.prototype.apply.call(console[r],console,j)}}var ae=!1,Z=!1,Q=!1,se=!1,M=!1,le;le=Symbol.for("react.module.reference");function sr(r){return!!(typeof r=="string"||typeof r=="function"||r===l||r===a||M||r===d||r===v||r===b||se||r===k||ae||Z||Q||typeof r=="object"&&r!==null&&(r.$$typeof===w||r.$$typeof===y||r.$$typeof===u||r.$$typeof===f||r.$$typeof===p||r.$$typeof===le||r.getModuleId!==void 0))}function lr(r,n,c){var h=r.displayName;if(h)return h;var x=n.displayName||n.name||"";return x!==""?c+"("+x+")":c}function ve(r){return r.displayName||"Context"}function A(r){if(r==null)return null;if(typeof r.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case l:return"Fragment";case i:return"Portal";case a:return"Profiler";case d:return"StrictMode";case v:return"Suspense";case b:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case f:var n=r;return ve(n)+".Consumer";case u:var c=r;return ve(c._context)+".Provider";case p:return lr(r,r.render,"ForwardRef");case y:var h=r.displayName||null;return h!==null?h:A(r.type)||"Memo";case w:{var x=r,j=x._payload,$=x._init;try{return A($(j))}catch{return null}}}return null}var I=Object.assign,Y=0,ye,xe,we,je,ke,Re,Ee;function Ce(){}Ce.__reactDisabledLog=!0;function cr(){{if(Y===0){ye=console.log,xe=console.info,we=console.warn,je=console.error,ke=console.group,Re=console.groupCollapsed,Ee=console.groupEnd;var r={configurable:!0,enumerable:!0,value:Ce,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}Y++}}function dr(){{if(Y--,Y===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},r,{value:ye}),info:I({},r,{value:xe}),warn:I({},r,{value:we}),error:I({},r,{value:je}),group:I({},r,{value:ke}),groupCollapsed:I({},r,{value:Re}),groupEnd:I({},r,{value:Ee})})}Y<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ce=_.ReactCurrentDispatcher,de;function ee(r,n,c){{if(de===void 0)try{throw Error()}catch(x){var h=x.stack.trim().match(/\n( *(at )?)/);de=h&&h[1]||""}return`
|
|
18
|
+
`+de+r}}var ue=!1,re;{var ur=typeof WeakMap=="function"?WeakMap:Map;re=new ur}function Se(r,n){if(!r||ue)return"";{var c=re.get(r);if(c!==void 0)return c}var h;ue=!0;var x=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var j;j=ce.current,ce.current=null,cr();try{if(n){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(P){h=P}Reflect.construct(r,[],$)}else{try{$.call()}catch(P){h=P}r.call($.prototype)}}else{try{throw Error()}catch(P){h=P}r()}}catch(P){if(P&&h&&typeof P.stack=="string"){for(var m=P.stack.split(`
|
|
19
|
+
`),T=h.stack.split(`
|
|
20
|
+
`),R=m.length-1,S=T.length-1;R>=1&&S>=0&&m[R]!==T[S];)S--;for(;R>=1&&S>=0;R--,S--)if(m[R]!==T[S]){if(R!==1||S!==1)do if(R--,S--,S<0||m[R]!==T[S]){var D=`
|
|
21
|
+
`+m[R].replace(" at new "," at ");return r.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",r.displayName)),typeof r=="function"&&re.set(r,D),D}while(R>=1&&S>=0);break}}}finally{ue=!1,ce.current=j,dr(),Error.prepareStackTrace=x}var N=r?r.displayName||r.name:"",W=N?ee(N):"";return typeof r=="function"&&re.set(r,W),W}function fr(r,n,c){return Se(r,!1)}function hr(r){var n=r.prototype;return!!(n&&n.isReactComponent)}function te(r,n,c){if(r==null)return"";if(typeof r=="function")return Se(r,hr(r));if(typeof r=="string")return ee(r);switch(r){case v:return ee("Suspense");case b:return ee("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case p:return fr(r.render);case y:return te(r.type,n,c);case w:{var h=r,x=h._payload,j=h._init;try{return te(j(x),n,c)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,_e={},Fe=_.ReactDebugCurrentFrame;function oe(r){if(r){var n=r._owner,c=te(r.type,r._source,n?n.type:null);Fe.setExtraStackFrame(c)}else Fe.setExtraStackFrame(null)}function pr(r,n,c,h,x){{var j=Function.call.bind(U);for(var $ in r)if(j(r,$)){var m=void 0;try{if(typeof r[$]!="function"){var T=Error((h||"React class")+": "+c+" type `"+$+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[$]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}m=r[$](n,$,h,c,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){m=R}m&&!(m instanceof Error)&&(oe(x),C("%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).",h||"React class",c,$,typeof m),oe(null)),m instanceof Error&&!(m.message in _e)&&(_e[m.message]=!0,oe(x),C("Failed %s type: %s",c,m.message),oe(null))}}}var gr=Array.isArray;function fe(r){return gr(r)}function br(r){{var n=typeof Symbol=="function"&&Symbol.toStringTag,c=n&&r[Symbol.toStringTag]||r.constructor.name||"Object";return c}}function mr(r){try{return Te(r),!1}catch{return!0}}function Te(r){return""+r}function Oe(r){if(mr(r))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",br(r)),Te(r)}var Pe=_.ReactCurrentOwner,$r={key:!0,ref:!0,__self:!0,__source:!0},De,Be;function vr(r){if(U.call(r,"ref")){var n=Object.getOwnPropertyDescriptor(r,"ref").get;if(n&&n.isReactWarning)return!1}return r.ref!==void 0}function yr(r){if(U.call(r,"key")){var n=Object.getOwnPropertyDescriptor(r,"key").get;if(n&&n.isReactWarning)return!1}return r.key!==void 0}function xr(r,n){typeof r.ref=="string"&&Pe.current}function wr(r,n){{var c=function(){De||(De=!0,C("%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)",n))};c.isReactWarning=!0,Object.defineProperty(r,"key",{get:c,configurable:!0})}}function jr(r,n){{var c=function(){Be||(Be=!0,C("%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)",n))};c.isReactWarning=!0,Object.defineProperty(r,"ref",{get:c,configurable:!0})}}var kr=function(r,n,c,h,x,j,$){var m={$$typeof:o,type:r,key:n,ref:c,props:$,_owner:j};return m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(m,"_self",{configurable:!1,enumerable:!1,writable:!1,value:h}),Object.defineProperty(m,"_source",{configurable:!1,enumerable:!1,writable:!1,value:x}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m};function Rr(r,n,c,h,x){{var j,$={},m=null,T=null;c!==void 0&&(Oe(c),m=""+c),yr(n)&&(Oe(n.key),m=""+n.key),vr(n)&&(T=n.ref,xr(n,x));for(j in n)U.call(n,j)&&!$r.hasOwnProperty(j)&&($[j]=n[j]);if(r&&r.defaultProps){var R=r.defaultProps;for(j in R)$[j]===void 0&&($[j]=R[j])}if(m||T){var S=typeof r=="function"?r.displayName||r.name||"Unknown":r;m&&wr($,S),T&&jr($,S)}return kr(r,m,T,x,h,Pe.current,$)}}var he=_.ReactCurrentOwner,Ae=_.ReactDebugCurrentFrame;function V(r){if(r){var n=r._owner,c=te(r.type,r._source,n?n.type:null);Ae.setExtraStackFrame(c)}else Ae.setExtraStackFrame(null)}var pe;pe=!1;function ge(r){return typeof r=="object"&&r!==null&&r.$$typeof===o}function Ie(){{if(he.current){var r=A(he.current.type);if(r)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+
|
|
23
|
+
Check the render method of \``+r+"`."}return""}}function Er(r){return""}var We={};function Cr(r){{var n=Ie();if(!n){var c=typeof r=="string"?r:r.displayName||r.name;c&&(n=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+c+">.")}return n}}function ze(r,n){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var c=Cr(n);if(We[c])return;We[c]=!0;var h="";r&&r._owner&&r._owner!==he.current&&(h=" It was passed a child from "+A(r._owner.type)+"."),V(r),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',c,h),V(null)}}function Le(r,n){{if(typeof r!="object")return;if(fe(r))for(var c=0;c<r.length;c++){var h=r[c];ge(h)&&ze(h,n)}else if(ge(r))r._store&&(r._store.validated=!0);else if(r){var x=O(r);if(typeof x=="function"&&x!==r.entries)for(var j=x.call(r),$;!($=j.next()).done;)ge($.value)&&ze($.value,n)}}}function Sr(r){{var n=r.type;if(n==null||typeof n=="string")return;var c;if(typeof n=="function")c=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===p||n.$$typeof===y))c=n.propTypes;else return;if(c){var h=A(n);pr(c,r.props,"prop",h,r)}else if(n.PropTypes!==void 0&&!pe){pe=!0;var x=A(n);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",x||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _r(r){{for(var n=Object.keys(r.props),c=0;c<n.length;c++){var h=n[c];if(h!=="children"&&h!=="key"){V(r),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",h),V(null);break}}r.ref!==null&&(V(r),C("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}var Me={};function Ve(r,n,c,h,x,j){{var $=sr(r);if(!$){var m="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(m+=" 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 T=Er();T?m+=T:m+=Ie();var R;r===null?R="null":fe(r)?R="array":r!==void 0&&r.$$typeof===o?(R="<"+(A(r.type)||"Unknown")+" />",m=" Did you accidentally export a JSX literal instead of a component?"):R=typeof r,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,m)}var S=Rr(r,n,c,x,j);if(S==null)return S;if($){var D=n.children;if(D!==void 0)if(h)if(fe(D)){for(var N=0;N<D.length;N++)Le(D[N],r);Object.freeze&&Object.freeze(D)}else C("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 Le(D,r)}if(U.call(n,"key")){var W=A(r),P=Object.keys(n).filter(function(Br){return Br!=="key"}),be=P.length>0?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}";if(!Me[W+be]){var Dr=P.length>0?"{"+P.join(": ..., ")+": ...}":"{}";C(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
30
|
+
<%s key={someKey} {...props} />`,be,W,Dr,W),Me[W+be]=!0}}return r===l?_r(S):Sr(S),S}}function Fr(r,n,c){return Ve(r,n,c,!0)}function Tr(r,n,c){return Ve(r,n,c,!1)}var Or=Tr,Pr=Fr;J.Fragment=l,J.jsx=Or,J.jsxs=Pr}()),J}var Ue;function Nr(){return Ue||(Ue=1,process.env.NODE_ENV==="production"?ne.exports=Mr():ne.exports=Vr()),ne.exports}var s=Nr();const t={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"},z={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"]}},H={full:5,round:.8,no:0},G={primary:{$mainColor:t.blue600,$hoverColor:t.blue700,$activeColor:t.white,$disabledColor:t.blue200},green:{$mainColor:t.green300,$hoverColor:t.green400,$activeColor:t.white,$disabledColor:t.green50},red:{$mainColor:t.red300,$hoverColor:t.red400,$activeColor:t.white,$disabledColor:t.red50},orange:{$mainColor:t.orange300,$hoverColor:t.orange400,$activeColor:t.white,$disabledColor:t.orange50},yellow:{$mainColor:t.yellow300,$hoverColor:t.yellow400,$activeColor:t.white,$disabledColor:t.yellow50},gray:{$mainColor:t.gray900,$hoverColor:t.black,$activeColor:t.black,$disabledColor:t.gray300}},qe=e=>{const{children:o,baseColor:i="primary",level:l="small",borderRadius:d="round",pl:a=2,pr:u=2,width:f="fit-content",...p}=e,{height:v,fontSize:b,fontWeights:y}=z[l],w=H[d],k=G[i];return s.jsx(Yr,{$borderRadius:w,$height:v,$fontSize:b,$fontWeights:y,$pl:a,$pr:u,$width:f,...k,...p,children:o})},Yr=g.default.button`
|
|
31
31
|
display: flex;
|
|
32
32
|
align-items: center;
|
|
33
33
|
justify-content: center;
|
|
34
34
|
transition: 0.1s linear;
|
|
35
35
|
transition-property: background-color, border-color;
|
|
36
36
|
cursor: pointer;
|
|
37
|
-
width: ${({$width:
|
|
37
|
+
width: ${({$width:e})=>e};
|
|
38
38
|
|
|
39
|
-
color: ${
|
|
40
|
-
font-size: ${({$fontSize:
|
|
41
|
-
font-weight: ${({$fontWeights:
|
|
42
|
-
border-radius: ${({$borderRadius:
|
|
43
|
-
padding-right: ${({$pr:
|
|
44
|
-
padding-left: ${({$pl:
|
|
45
|
-
height: ${({$height:
|
|
46
|
-
background-color: ${({$mainColor:
|
|
39
|
+
color: ${t.white};
|
|
40
|
+
font-size: ${({$fontSize:e})=>e}rem;
|
|
41
|
+
font-weight: ${({$fontWeights:e})=>e[0]};
|
|
42
|
+
border-radius: ${({$borderRadius:e})=>e}rem;
|
|
43
|
+
padding-right: ${({$pr:e})=>e}rem;
|
|
44
|
+
padding-left: ${({$pl:e})=>e}rem;
|
|
45
|
+
height: ${({$height:e})=>e}px;
|
|
46
|
+
background-color: ${({$mainColor:e})=>e};
|
|
47
47
|
|
|
48
48
|
&:hover:not([disabled]) {
|
|
49
|
-
background-color: ${({$hoverColor:
|
|
50
|
-
font-weight: ${({$fontWeights:
|
|
49
|
+
background-color: ${({$hoverColor:e})=>e};
|
|
50
|
+
font-weight: ${({$fontWeights:e})=>e[1]};
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
&:disabled {
|
|
54
|
-
background-color: ${({$disabledColor:
|
|
54
|
+
background-color: ${({$disabledColor:e})=>e};
|
|
55
55
|
}
|
|
56
|
-
`,
|
|
56
|
+
`,Ur=e=>{const{children:o,baseColor:i="primary",level:l="small",borderRadius:d="round",pl:a=2,pr:u=2,width:f="fit-content",isSelected:p,...v}=e,{height:b,fontSize:y,fontWeights:w}=z[l],k=H[d],F=G[i];return s.jsx(qr,{$borderRadius:k,$height:b,$fontSize:y,$fontWeights:w,$pl:a,$pr:u,$width:f,$isSelected:p,...F,...v,children:o})},qr=g.default.button`
|
|
57
57
|
display: flex;
|
|
58
58
|
align-items: center;
|
|
59
59
|
justify-content: center;
|
|
60
60
|
transition: 0.1s linear;
|
|
61
61
|
transition-property: border-color, color, background-color;
|
|
62
62
|
cursor: pointer;
|
|
63
|
-
width: ${({$width:
|
|
63
|
+
width: ${({$width:e})=>e};
|
|
64
64
|
|
|
65
|
-
background-color: ${({$isSelected:
|
|
66
|
-
color: ${({$mainColor:
|
|
65
|
+
background-color: ${({$isSelected:e,$mainColor:o})=>e?o:t.white};
|
|
66
|
+
color: ${({$mainColor:e,$isSelected:o})=>o?t.white:e};
|
|
67
67
|
|
|
68
|
-
border: 1px solid ${({$mainColor:
|
|
69
|
-
font-size: ${({$fontSize:
|
|
70
|
-
font-weight: ${({$fontWeights:
|
|
71
|
-
border-radius: ${({$borderRadius:
|
|
72
|
-
padding-right: ${({$pr:
|
|
73
|
-
padding-left: ${({$pl:
|
|
74
|
-
height: ${({$height:
|
|
68
|
+
border: 1px solid ${({$mainColor:e})=>e};
|
|
69
|
+
font-size: ${({$fontSize:e})=>e}rem;
|
|
70
|
+
font-weight: ${({$fontWeights:e})=>e[0]};
|
|
71
|
+
border-radius: ${({$borderRadius:e})=>e}rem;
|
|
72
|
+
padding-right: ${({$pr:e})=>e}rem;
|
|
73
|
+
padding-left: ${({$pl:e})=>e}rem;
|
|
74
|
+
height: ${({$height:e})=>e}px;
|
|
75
75
|
|
|
76
76
|
&:hover:not([disabled]) {
|
|
77
|
-
color: ${({$hoverColor:
|
|
78
|
-
border: 1px solid ${({$hoverColor:
|
|
79
|
-
font-weight: ${({$fontWeights:
|
|
80
|
-
background-color: ${
|
|
77
|
+
color: ${({$hoverColor:e})=>e};
|
|
78
|
+
border: 1px solid ${({$hoverColor:e})=>e};
|
|
79
|
+
font-weight: ${({$fontWeights:e})=>e[1]};
|
|
80
|
+
background-color: ${t.white};
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
&:disabled {
|
|
84
|
-
color: ${({$disabledColor:
|
|
85
|
-
background-color: ${
|
|
86
|
-
border: 1px solid ${({$disabledColor:
|
|
84
|
+
color: ${({$disabledColor:e})=>e};
|
|
85
|
+
background-color: ${t.white};
|
|
86
|
+
border: 1px solid ${({$disabledColor:e})=>e};
|
|
87
87
|
}
|
|
88
|
-
`,
|
|
88
|
+
`,Jr=e=>{const{children:o,baseColor:i="gray",level:l="small",borderRadius:d="round",pl:a=2,pr:u=2,width:f="fit-content",...p}=e,{height:v,fontSize:b,fontWeights:y}=z[l],w=H[d],k=G[i];return s.jsx(Hr,{$borderRadius:w,$height:v,$fontSize:b,$fontWeights:y,$pl:a,$pr:u,$width:f,...k,...p,children:o})},Hr=g.default.button`
|
|
89
89
|
display: flex;
|
|
90
90
|
align-items: center;
|
|
91
91
|
justify-content: center;
|
|
92
92
|
transition: 0.1s linear;
|
|
93
93
|
transition-property: border-color, color;
|
|
94
94
|
cursor: pointer;
|
|
95
|
-
width: ${({$width:
|
|
96
|
-
|
|
97
|
-
background-color: ${
|
|
98
|
-
color: ${({$mainColor:
|
|
99
|
-
border: 1px solid ${
|
|
100
|
-
font-size: ${({$fontSize:
|
|
101
|
-
font-weight: ${({$fontWeights:
|
|
102
|
-
border-radius: ${({$borderRadius:
|
|
103
|
-
padding-right: ${({$pr:
|
|
104
|
-
padding-left: ${({$pl:
|
|
105
|
-
height: ${({$height:
|
|
95
|
+
width: ${({$width:e})=>e};
|
|
96
|
+
|
|
97
|
+
background-color: ${t.white};
|
|
98
|
+
color: ${({$mainColor:e})=>e};
|
|
99
|
+
border: 1px solid ${t.gray400};
|
|
100
|
+
font-size: ${({$fontSize:e})=>e}rem;
|
|
101
|
+
font-weight: ${({$fontWeights:e})=>e[0]};
|
|
102
|
+
border-radius: ${({$borderRadius:e})=>e}rem;
|
|
103
|
+
padding-right: ${({$pr:e})=>e}rem;
|
|
104
|
+
padding-left: ${({$pl:e})=>e}rem;
|
|
105
|
+
height: ${({$height:e})=>e}px;
|
|
106
106
|
|
|
107
107
|
&:hover:not([disabled]) {
|
|
108
|
-
color: ${({$hoverColor:
|
|
109
|
-
border: 1px solid ${
|
|
110
|
-
font-weight: ${({$fontWeights:
|
|
108
|
+
color: ${({$hoverColor:e})=>e};
|
|
109
|
+
border: 1px solid ${t.gray600};
|
|
110
|
+
font-weight: ${({$fontWeights:e})=>e[1]};
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
&:disabled {
|
|
114
|
-
color: ${({$disabledColor:
|
|
115
|
-
border: 1px solid ${
|
|
114
|
+
color: ${({$disabledColor:e})=>e};
|
|
115
|
+
border: 1px solid ${t.gray300};
|
|
116
116
|
}
|
|
117
|
-
`,
|
|
117
|
+
`,Gr=e=>{const{children:o,baseColor:i="gray",level:l="small",borderRadius:d="round",pl:a=2,pr:u=2,width:f="fit-content",isSelected:p,...v}=e,{height:b,fontSize:y,fontWeights:w}=z[l],k=H[d],F=G[i];return s.jsx(Kr,{$borderRadius:k,$height:b,$fontSize:y,$fontWeights:w,$pl:a,$pr:u,$width:f,$isSelected:p,...F,...v,children:o})},Kr=g.default.button`
|
|
118
118
|
display: flex;
|
|
119
119
|
align-items: center;
|
|
120
120
|
justify-content: center;
|
|
121
121
|
transition: 0.1s linear;
|
|
122
122
|
transition-property: border-color, color;
|
|
123
123
|
cursor: pointer;
|
|
124
|
-
width: ${({$width:
|
|
124
|
+
width: ${({$width:e})=>e};
|
|
125
125
|
|
|
126
|
-
background-color: ${
|
|
127
|
-
color: ${
|
|
126
|
+
background-color: ${t.white};
|
|
127
|
+
color: ${t.black};
|
|
128
128
|
border: none;
|
|
129
|
-
font-size: ${({$fontSize:
|
|
130
|
-
font-weight: ${({$fontWeights:
|
|
131
|
-
border-radius: ${({$borderRadius:
|
|
132
|
-
padding-right: ${({$pr:
|
|
133
|
-
padding-left: ${({$pl:
|
|
134
|
-
height: ${({$height:
|
|
129
|
+
font-size: ${({$fontSize:e})=>e}rem;
|
|
130
|
+
font-weight: ${({$fontWeights:e})=>e[0]};
|
|
131
|
+
border-radius: ${({$borderRadius:e})=>e}rem;
|
|
132
|
+
padding-right: ${({$pr:e})=>e}rem;
|
|
133
|
+
padding-left: ${({$pl:e})=>e}rem;
|
|
134
|
+
height: ${({$height:e})=>e}px;
|
|
135
135
|
|
|
136
136
|
&:hover:not([disabled]) {
|
|
137
|
-
font-weight: ${({$fontWeights:
|
|
137
|
+
font-weight: ${({$fontWeights:e})=>e[1]};
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
&:disabled {
|
|
141
|
-
color: ${({$disabledColor:
|
|
141
|
+
color: ${({$disabledColor:e})=>e};
|
|
142
142
|
}
|
|
143
|
-
`,
|
|
143
|
+
`,Ze=e=>{const{theme:o="primary",...i}=e;switch(o){case"primary":return s.jsx(qe,{...i});case"secondary":return s.jsx(Ur,{...i});case"tertiary":return s.jsx(Jr,{...i});case"text":return s.jsx(Gr,{...i});default:return s.jsx(qe,{...i})}},Xr=e=>{const[o,i]=B.useState(!1);return B.useEffect(()=>{function l(d){e.current&&d.target instanceof HTMLElement&&!e.current.contains(d.target)&&i(!1)}return document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l)}},[e,i]),[o,i]},me=({id:e,checked:o,name:i,required:l,children:d,disabled:a,onClickBox:u,...f})=>{const p=()=>u==null?void 0:u({name:i,checked:!o}),v=a?!1:o;return s.jsxs(Zr,{$disabled:a,onClick:p,children:[s.jsx("input",{id:e,type:"checkbox",name:i,checked:v,required:l,disabled:a,readOnly:!0,...f}),s.jsx(et,{htmlFor:e,disabled:a,children:v&&s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10",viewBox:"0 0 14 10",fill:"none",children:s.jsx("path",{d:"M1.5 5.30252L5.16667 9L12.5 1",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})}),d&&s.jsx(Qr,{onClick:p,htmlFor:e,$disabled:a,children:d})]})},Zr=g.default.button`
|
|
144
144
|
/* 드래그 방지 */
|
|
145
145
|
-webkit-user-select: none;
|
|
146
146
|
-moz-user-select: none;
|
|
@@ -150,6 +150,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
150
150
|
align-items: center;
|
|
151
151
|
gap: 0.8rem;
|
|
152
152
|
flex: 1;
|
|
153
|
+
cursor: ${e=>!e.$disabled&&"pointer"};
|
|
153
154
|
input[type="checkbox"] {
|
|
154
155
|
display: none;
|
|
155
156
|
padding: 0;
|
|
@@ -160,36 +161,36 @@ React keys must be passed directly to JSX without using spread:
|
|
|
160
161
|
}
|
|
161
162
|
input[type="checkbox"] + label {
|
|
162
163
|
display: flex;
|
|
163
|
-
cursor: ${
|
|
164
|
+
cursor: ${e=>!e.$disabled&&"pointer"};
|
|
164
165
|
position: relative;
|
|
165
166
|
width: 18px;
|
|
166
167
|
height: 18px;
|
|
167
|
-
border: 1.5px solid ${
|
|
168
|
+
border: 1.5px solid ${t.gray300};
|
|
168
169
|
border-radius: 0.4rem;
|
|
169
|
-
background-color: ${
|
|
170
|
+
background-color: ${t.white};
|
|
170
171
|
margin-left: 0.3rem;
|
|
171
172
|
margin-right: 0.3rem;
|
|
172
173
|
}
|
|
173
174
|
input[type="checkbox"]:checked + label {
|
|
174
|
-
border: 1.5px solid ${
|
|
175
|
-
background-color: ${
|
|
175
|
+
border: 1.5px solid ${t.blue600};
|
|
176
|
+
background-color: ${t.blue600};
|
|
176
177
|
}
|
|
177
|
-
`,
|
|
178
|
+
`,Qr=g.default.label`
|
|
178
179
|
white-space: nowrap;
|
|
179
180
|
display: flex;
|
|
180
181
|
align-items: center;
|
|
181
|
-
cursor: ${({$disabled:
|
|
182
|
+
cursor: ${({$disabled:e})=>!e&&"pointer"};
|
|
182
183
|
font-size: 1.8rem;
|
|
183
184
|
font-weight: 500;
|
|
184
185
|
line-height: 135%;
|
|
185
186
|
font-style: normal;
|
|
186
|
-
color: ${({$disabled:
|
|
187
|
-
`,
|
|
187
|
+
color: ${({$disabled:e})=>e?t.gray500:t.gray900};
|
|
188
|
+
`,et=g.default.label`
|
|
188
189
|
display: flex;
|
|
189
190
|
align-items: center;
|
|
190
191
|
justify-content: center;
|
|
191
|
-
cursor: ${
|
|
192
|
-
|
|
192
|
+
cursor: ${e=>!e.disabled&&"pointer"};
|
|
193
|
+
`,$e=e=>{const{onClick:o,disabled:i,label:l,name:d,checked:a}=e,u=p=>o==null?void 0:o(p.target.checked,d),f=i?!1:a;return s.jsxs(rt,{children:[s.jsx(tt,{type:"radio",name:d,checked:f,onChange:u,disabled:i}),s.jsx(ot,{$checked:f,$disabled:i,children:f&&s.jsx(nt,{})}),l&&s.jsx(it,{$checked:f,$disabled:i,children:l})]})},rt=g.default.label`
|
|
193
194
|
/* 드래그 방지 */
|
|
194
195
|
-webkit-user-select: none;
|
|
195
196
|
-moz-user-select: none;
|
|
@@ -201,33 +202,33 @@ React keys must be passed directly to JSX without using spread:
|
|
|
201
202
|
width: auto;
|
|
202
203
|
gap: 0.8rem;
|
|
203
204
|
cursor: pointer;
|
|
204
|
-
`,
|
|
205
|
+
`,tt=g.default.input`
|
|
205
206
|
display: none;
|
|
206
|
-
`,
|
|
207
|
+
`,ot=g.default.div`
|
|
207
208
|
display: flex;
|
|
208
209
|
align-items: center;
|
|
209
210
|
justify-content: center;
|
|
210
211
|
width: 11px;
|
|
211
212
|
height: 11px;
|
|
212
213
|
padding: 3px;
|
|
213
|
-
border: 2px solid ${
|
|
214
|
+
border: 2px solid ${t.blue600};
|
|
214
215
|
border-radius: 100%;
|
|
215
|
-
background-color: ${
|
|
216
|
+
background-color: ${t.white};
|
|
216
217
|
|
|
217
|
-
${({$checked:
|
|
218
|
-
border: 1px solid ${
|
|
218
|
+
${({$checked:e})=>!e&&`
|
|
219
|
+
border: 1px solid ${t.gray400};
|
|
219
220
|
width: 13px;
|
|
220
221
|
height: 13px;
|
|
221
222
|
`}
|
|
222
223
|
|
|
223
|
-
${({$disabled:
|
|
224
|
-
border: 1px solid ${
|
|
225
|
-
background-color: ${
|
|
224
|
+
${({$disabled:e,$checked:o})=>e&&!o&&`
|
|
225
|
+
border: 1px solid ${t.gray300};
|
|
226
|
+
background-color: ${t.gray100};
|
|
226
227
|
width: 13px;
|
|
227
228
|
height: 13px;
|
|
228
229
|
`}
|
|
229
|
-
`,
|
|
230
|
-
background-color: ${
|
|
230
|
+
`,nt=g.default.div`
|
|
231
|
+
background-color: ${t.blue600};
|
|
231
232
|
border-radius: 100%;
|
|
232
233
|
width: 100%;
|
|
233
234
|
height: 100%;
|
|
@@ -244,14 +245,341 @@ React keys must be passed directly to JSX without using spread:
|
|
|
244
245
|
transform: scale(0);
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
|
-
`,
|
|
248
|
+
`,it=g.default.div`
|
|
248
249
|
white-space: nowrap;
|
|
249
250
|
font-size: 1.8rem;
|
|
250
251
|
font-weight: 500;
|
|
251
252
|
line-height: 135%;
|
|
252
|
-
color: ${({$disabled:
|
|
253
|
+
color: ${({$disabled:e,$checked:o})=>e&&!o?t.gray400:t.gray800};
|
|
253
254
|
transition: color 150ms;
|
|
254
|
-
`,
|
|
255
|
+
`,Qe=({size:e=24,color:o})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:s.jsx("path",{d:"M6 9L12 15L18 9",stroke:o||t.gray800,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),er=({size:e=24,color:o})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:s.jsx("path",{d:"M6 15L12 9L18 15",stroke:o||t.gray800,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),rr=e=>{const{children:o,baseColor:i="gray",level:l="small",borderRadius:d="round",width:a="fit-content",isOpen:u,isSelected:f,...p}=e,{height:v,fontSize:b,fontWeights:y}=z[l],w=H[d],k=at[l],F=G[i];return s.jsx(st,{$borderRadius:w,$height:v,$fontSize:b,$fontWeights:y,$pl:k.default,$pr:k.iconSide,$width:a,$isOpen:u,$isSelected:f,...F,...p,children:o})},at={small:{default:1.6,iconSide:.8},medium:{default:2,iconSide:1.2},large:{default:2,iconSide:1.6}},st=g.default.button`
|
|
256
|
+
display: flex;
|
|
257
|
+
align-items: center;
|
|
258
|
+
justify-content: center;
|
|
259
|
+
transition: 0.1s linear;
|
|
260
|
+
transition-property: border-color, color;
|
|
261
|
+
cursor: pointer;
|
|
262
|
+
width: ${({$width:e})=>e};
|
|
263
|
+
gap: 1.2rem;
|
|
264
|
+
|
|
265
|
+
background-color: ${({$isSelected:e})=>e?t.blue600:t.white};
|
|
266
|
+
color: ${({$mainColor:e,$isSelected:o})=>o?t.white:e};
|
|
267
|
+
border: 1px solid
|
|
268
|
+
${({$isOpen:e})=>e?t.blue600:t.gray400};
|
|
269
|
+
font-size: ${({$fontSize:e})=>e}rem;
|
|
270
|
+
font-weight: ${({$fontWeights:e})=>e[0]};
|
|
271
|
+
border-radius: ${({$borderRadius:e})=>e}rem;
|
|
272
|
+
padding-right: ${({$pr:e})=>e}rem;
|
|
273
|
+
padding-left: ${({$pl:e})=>e}rem;
|
|
274
|
+
height: ${({$height:e})=>e}px;
|
|
275
|
+
|
|
276
|
+
&:hover:not([disabled]) {
|
|
277
|
+
color: ${({$hoverColor:e,$isSelected:o})=>o?t.white:e};
|
|
278
|
+
border-color: ${({$isOpen:e})=>e?t.blue600:t.gray600};
|
|
279
|
+
font-weight: ${({$fontWeights:e})=>e[1]};
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
&:disabled {
|
|
283
|
+
color: ${({$disabledColor:e})=>e};
|
|
284
|
+
border-color: ${t.gray300};
|
|
285
|
+
}
|
|
286
|
+
`,tr=g.default.div`
|
|
287
|
+
position: relative;
|
|
288
|
+
height: fit-content;
|
|
289
|
+
`,or=g.default.div`
|
|
290
|
+
display: flex;
|
|
291
|
+
flex-direction: column;
|
|
292
|
+
z-index: 1;
|
|
293
|
+
position: absolute;
|
|
294
|
+
background-color: ${t.white};
|
|
295
|
+
top: ${({$top:e})=>e+.8}rem;
|
|
296
|
+
box-shadow: 0px 0px 24px 0px rgba(109, 113, 125, 0.2);
|
|
297
|
+
border-radius: 1.2rem;
|
|
298
|
+
min-width: ${({$width:e})=>e??300}px;
|
|
299
|
+
max-height: 510px;
|
|
300
|
+
overflow-y: auto;
|
|
301
|
+
::-webkit-scrollbar {
|
|
302
|
+
display: none;
|
|
303
|
+
}
|
|
304
|
+
`,ie=g.default.button`
|
|
305
|
+
display: flex;
|
|
306
|
+
flex: 1;
|
|
307
|
+
padding: 1.2rem;
|
|
308
|
+
color: ${({$isSelected:e})=>e?t.blue600:t.gray900};
|
|
309
|
+
font-size: 1.8rem;
|
|
310
|
+
font-weight: 500;
|
|
311
|
+
line-height: 135%;
|
|
312
|
+
cursor: pointer;
|
|
313
|
+
|
|
314
|
+
&:hover:not([disabled]) {
|
|
315
|
+
background-color: ${t.blue100};
|
|
316
|
+
}
|
|
317
|
+
`,lt=({title:e,level:o="medium",type:i="checkbox",options:l=[],values:d=[],onChange:a,isAllChecked:u,allCheckText:f="전체선택"})=>{const p=B.useRef(null),[v,b]=Xr(p),{height:y}=z[o],w=d.length===0,k=l==null?void 0:l.map(E=>{const O=d.some(_=>_.value===E.value);switch(i){case"checkbox":{const _=()=>{if(O){const C=d.filter(L=>L.value!==E.value);return a==null?void 0:a(C)}else return a==null?void 0:a([...d,E])};return s.jsx(ie,{onClick:_,children:s.jsx(me,{checked:O,children:E.label})})}case"radio":{const _=()=>{a==null||a([E])};return s.jsx(ie,{onClick:_,children:s.jsx($e,{checked:O,label:E.label})})}case"select":{const _=()=>(b(!1),O?a==null?void 0:a([]):a==null?void 0:a([E]));return s.jsx(ie,{onClick:_,$isSelected:O,children:E.label})}}});if(u&&i==="checkbox"){const E=(l==null?void 0:l.length)===(d==null?void 0:d.length),O=()=>E?a==null?void 0:a([]):a==null?void 0:a(l);k.unshift(s.jsx(ie,{onClick:O,children:s.jsx(me,{checked:E,children:f})}))}const F=()=>b(E=>!E);return s.jsxs(tr,{ref:p,children:[s.jsxs(rr,{isSelected:!w,onClick:F,borderRadius:"full",isOpen:v,level:o,children:[e,v?s.jsx(er,{color:!w&&t.white}):s.jsx(Qe,{color:!w&&t.white})]}),v&&s.jsx(or,{$top:y/10,children:k})]})},ct=({title:e,isSelected:o,level:i="medium",tooltipWidth:l,children:d,isOpen:a,onOpenFilter:u,onCloseFilter:f})=>{const{height:p}=z[i],v=()=>a?f():u();return s.jsxs(tr,{children:[s.jsxs(rr,{isSelected:o,onClick:v,borderRadius:"full",isOpen:a,level:i,children:[e,a?s.jsx(er,{color:o&&t.white}):s.jsx(Qe,{color:o&&t.white})]}),a&&s.jsx(or,{$width:l,$top:p/10,children:d})]})},dt=({size:e=1,direction:o="row"})=>s.jsx(ut,{$size:e,$direction:o}),ut=g.default.div`
|
|
318
|
+
display: flex;
|
|
319
|
+
flex-direction: ${({$direction:e})=>e};
|
|
320
|
+
|
|
321
|
+
${({$direction:e,$size:o})=>e==="row"?`
|
|
322
|
+
border-bottom: ${o}px solid ${t.gray300};
|
|
323
|
+
`:`
|
|
324
|
+
border-right: ${o}px solid ${t.gray300};
|
|
325
|
+
`}
|
|
326
|
+
`,K={small:{padding:.4},medium:{padding:1.2},large:{padding:1.6}},X={primary:{$mainColor:t.blue600,$hoverColor:t.blue700,$activeColor:t.white},green:{$mainColor:t.green300,$hoverColor:t.green400,$activeColor:t.white},red:{$mainColor:t.red300,$hoverColor:t.red400,$activeColor:t.white},orange:{$mainColor:t.orange300,$hoverColor:t.orange400,$activeColor:t.white},yellow:{$mainColor:t.yellow300,$hoverColor:t.yellow400,$activeColor:t.white},black:{$mainColor:t.gray900,$hoverColor:t.gray700,$activeColor:t.gray700}},ft=e=>{const{children:o,baseColor:i="gray",level:l="small",isRound:d=.8,...a}=e,{padding:u}=K[l],f=X[i];return s.jsx(ht,{$isRound:d,$padding:u,...f,...a,children:o})},ht=g.default.button`
|
|
327
|
+
display: flex;
|
|
328
|
+
align-items: center;
|
|
329
|
+
justify-content: center;
|
|
330
|
+
transition: 0.1s linear;
|
|
331
|
+
transition-property: border-color, color;
|
|
332
|
+
cursor: pointer;
|
|
333
|
+
|
|
334
|
+
border: none;
|
|
335
|
+
border-radius: ${({$isRound:e})=>e?"100%":"0.8rem"};
|
|
336
|
+
padding: ${({$padding:e})=>e}rem;
|
|
337
|
+
|
|
338
|
+
&:disabled {
|
|
339
|
+
opacity: 0.3;
|
|
340
|
+
}
|
|
341
|
+
`,pt=e=>{const{children:o,baseColor:i="gray",level:l="small",isRound:d=.8,...a}=e,{padding:u}=K[l],f=X[i];return s.jsx(gt,{$isRound:d,$padding:u,...f,...a,children:o})},gt=g.default.button`
|
|
342
|
+
display: flex;
|
|
343
|
+
align-items: center;
|
|
344
|
+
justify-content: center;
|
|
345
|
+
transition: 0.1s linear;
|
|
346
|
+
transition-property: border-color, color;
|
|
347
|
+
cursor: pointer;
|
|
348
|
+
|
|
349
|
+
background-color: ${t.white+66};
|
|
350
|
+
|
|
351
|
+
border: none;
|
|
352
|
+
border-radius: ${({$isRound:e})=>e?"100%":"0.8rem"};
|
|
353
|
+
padding: ${({$padding:e})=>e}rem;
|
|
354
|
+
|
|
355
|
+
&:hover:not([disabled]) {
|
|
356
|
+
background-color: ${t.white+66};
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
&:disabled {
|
|
360
|
+
opacity: 0.3;
|
|
361
|
+
}
|
|
362
|
+
`,Je=e=>{const{children:o,baseColor:i="primary",level:l="small",isRound:d=!1,...a}=e,{padding:u}=K[l],f=X[i];return s.jsx(bt,{$isRound:d,$padding:u,...f,...a,children:o})},bt=g.default.button`
|
|
363
|
+
display: flex;
|
|
364
|
+
align-items: center;
|
|
365
|
+
justify-content: center;
|
|
366
|
+
transition: 0.1s linear;
|
|
367
|
+
transition-property: background-color, border-color;
|
|
368
|
+
cursor: pointer;
|
|
369
|
+
|
|
370
|
+
border-radius: ${({$isRound:e})=>e?"100%":"0.8rem"};
|
|
371
|
+
padding: ${({$padding:e})=>e}rem;
|
|
372
|
+
background-color: ${({$mainColor:e})=>e};
|
|
373
|
+
|
|
374
|
+
&:hover:not([disabled]) {
|
|
375
|
+
background-color: ${({$hoverColor:e})=>e};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
&:disabled {
|
|
379
|
+
opacity: 0.3;
|
|
380
|
+
}
|
|
381
|
+
`,mt=e=>{const{children:o,baseColor:i="primary",level:l="small",isRound:d=!1,...a}=e,{padding:u}=K[l],f=X[i];return s.jsx($t,{$isRound:d,$padding:u,...f,...a,children:o})},$t=g.default.button`
|
|
382
|
+
display: flex;
|
|
383
|
+
align-items: center;
|
|
384
|
+
justify-content: center;
|
|
385
|
+
transition: 0.1s linear;
|
|
386
|
+
transition-property: border-color, color;
|
|
387
|
+
cursor: pointer;
|
|
388
|
+
|
|
389
|
+
background-color: ${t.white};
|
|
390
|
+
border: 1px solid ${({$mainColor:e})=>e};
|
|
391
|
+
border-radius: ${({$isRound:e})=>e?"100%":"0.8rem"};
|
|
392
|
+
padding: ${({$padding:e})=>e}rem;
|
|
393
|
+
|
|
394
|
+
&:hover:not([disabled]) {
|
|
395
|
+
color: ${({$hoverColor:e})=>e};
|
|
396
|
+
border: 1px solid ${({$hoverColor:e})=>e};
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
&:disabled {
|
|
400
|
+
opacity: 0.3;
|
|
401
|
+
}
|
|
402
|
+
`,vt=e=>{const{children:o,baseColor:i="primary",level:l="small",isRound:d=!1,...a}=e,{padding:u}=K[l],f=X[i];return s.jsx(yt,{$isRound:d,$padding:u,...f,...a,children:o})},yt=g.default.button`
|
|
403
|
+
display: flex;
|
|
404
|
+
align-items: center;
|
|
405
|
+
justify-content: center;
|
|
406
|
+
transition: 0.1s linear;
|
|
407
|
+
transition-property: border-color, color;
|
|
408
|
+
cursor: pointer;
|
|
409
|
+
|
|
410
|
+
background-color: ${t.white};
|
|
411
|
+
border: 1px solid ${t.gray400};
|
|
412
|
+
border-radius: ${({$isRound:e})=>e?"100%":"0.8rem"};
|
|
413
|
+
padding: ${({$padding:e})=>e}rem;
|
|
414
|
+
|
|
415
|
+
&:hover:not([disabled]) {
|
|
416
|
+
color: ${({$hoverColor:e})=>e};
|
|
417
|
+
border: 1px solid ${t.gray600};
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
&:disabled {
|
|
421
|
+
opacity: 0.3;
|
|
422
|
+
}
|
|
423
|
+
`,xt=e=>{const{theme:o="primary",...i}=e;switch(o){case"primary":return s.jsx(Je,{...i});case"secondary":return s.jsx(mt,{...i});case"tertiary":return s.jsx(vt,{...i});case"onlyIcon":return s.jsx(ft,{...i});case"onlyIconWh":return s.jsx(pt,{...i});default:return s.jsx(Je,{...i})}},wt=({children:e,iconPosition:o="right",icon:i,level:l="small",...d})=>{const a=o==="right",u=jt[l];return s.jsxs(Ze,{...d,pl:a?u.default:u.iconSide,pr:a?u.iconSide:u.default,level:l,children:[!a&&s.jsx(He,{$isRight:a,$disabled:d.disabled,children:i}),e,a&&s.jsx(He,{$isRight:a,$disabled:d.disabled,children:i})]})},He=g.default.div`
|
|
424
|
+
display: flex;
|
|
425
|
+
align-items: center;
|
|
426
|
+
justify-content: center;
|
|
427
|
+
margin-left: ${({$isRight:e})=>e&&.4}rem;
|
|
428
|
+
margin-right: ${({$isRight:e})=>!e&&.4}rem;
|
|
429
|
+
gap: 0.4rem;
|
|
430
|
+
opacity: ${({$disabled:e})=>e?.3:1};
|
|
431
|
+
`,jt={small:{default:1.6,iconSide:.8},medium:{default:2,iconSide:1.2},large:{default:2,iconSide:1.6}},kt=(e,o=600)=>{let i;return function(){i||(i=setTimeout(()=>{i=null,e()},o))}},nr=(e,o)=>{const[i,l]=B.useState({width:void 0,height:void 0}),d=B.useMemo(()=>kt(()=>{if(e!=null&&e.current){const{width:a,height:u}=e.current.getBoundingClientRect();(i.width!==a||i.height!==u)&&l({width:a,height:u})}},50),[e,i.height,i.width]);return B.useEffect(()=>{const a=new ResizeObserver(()=>d());return e!=null&&e.current&&a.observe(e.current),d(),()=>{a.disconnect()}},[d,e,o]),[i.width,i.height]},Rt=/^\d+$/,Et=/^-?\d+(\.\d+)?$/,Ge=e=>Rt.test(e),Ct=e=>Et.test(String(Number(e))),Ke=({targetValue:e,min:o,max:i})=>{const l=Number(e||0),d=o!==void 0,a=i!==void 0,u=d?l>=o:!0,f=a?l<=i:!0;return u&&f},St=({e,min:o,max:i})=>{var u,f,p,v,b;const l=Ge(e.target.value)||Ct(e.target.value),a=((f=(u=e==null?void 0:e.target)==null?void 0:u.value)==null?void 0:f[0])==="-"&&(o===void 0||o<0);if(l){if(!Ke({targetValue:e.target.value,min:o,max:i}))return!1}else if(a){const y=Ke({targetValue:e.target.value,min:o,max:i}),w=((p=e==null?void 0:e.target)==null?void 0:p.value)==="-",k=(v=e==null?void 0:e.target)==null?void 0:v.value.substring(1);if((!Ge(k)||!y)&&!w)return!1}else if((b=e==null?void 0:e.target)!=null&&b.value)return!1;return!0},_t=({unit:e,type:o,onChange:i,min:l,max:d,width:a,label:u,level:f="large",value:p,disabled:v,errorMessage:b,successMessage:y,guideMessage:w,required:k,onCancel:F,...E})=>{const[O,_]=B.useState(!1),C=B.useRef(null),[L]=nr(C,[e,O]),ae=!!p||p===0,Z=o==="number",Q=f==="small",se=M=>{Z&&!St({e:M,min:l,max:d})||i==null||i(M)};return s.jsxs(Bt,{$width:a,children:[u&&s.jsxs(Wt,{$gap:.4,children:[k&&s.jsx(zt,{children:"*"}),u]}),s.jsxs(Ft,{children:[s.jsx(Dt,{type:Z?"text":o,onChange:se,$isSmall:Q,$pr:L?L/10:2+(O&&F&&2.4),value:ae?p:"",disabled:v,$isError:!!b,$isSuccess:!!y,onFocus:()=>_(!0),onBlur:()=>_(!1),...E}),(e||O)&&s.jsxs(At,{$isSmall:Q,ref:C,children:[O&&F&&s.jsx(It,{$isRight:!0,onClick:()=>F(E==null?void 0:E.name),onMouseDown:M=>M.preventDefault(),children:s.jsx(Lt,{children:s.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsxs("g",{id:"Frame 48096259",children:[s.jsx("circle",{id:"Ellipse 52",cx:"9",cy:"9",r:"9",fill:"#DADEE5"}),s.jsx("path",{id:"Vector",d:"M5 5L13 13",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),s.jsx("path",{id:"Vector_2",d:"M13 5L5 13",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]})})})}),e]})]}),b&&s.jsx(Tt,{children:b}),y&&s.jsx(Ot,{children:y}),w&&s.jsx(Pt,{children:w})]})},Ft=g.default.span`
|
|
432
|
+
display: flex;
|
|
433
|
+
position: relative;
|
|
434
|
+
`,Tt=g.default.label`
|
|
435
|
+
color: ${t.red300};
|
|
436
|
+
font-size: 1.2rem;
|
|
437
|
+
padding: 0 0.8rem;
|
|
438
|
+
`,Ot=g.default.label`
|
|
439
|
+
color: ${t.green300};
|
|
440
|
+
font-size: 1.2rem;
|
|
441
|
+
padding: 0 0.8rem;
|
|
442
|
+
`,Pt=g.default.label`
|
|
443
|
+
color: ${t.gray700};
|
|
444
|
+
font-size: 1.2rem;
|
|
445
|
+
padding: 0 0.8rem;
|
|
446
|
+
`,Dt=g.default.input`
|
|
447
|
+
font-family: "Pretendard";
|
|
448
|
+
width: auto;
|
|
449
|
+
font-size: 1.6rem;
|
|
450
|
+
font-weight: 400;
|
|
451
|
+
padding: 0 1.2rem;
|
|
452
|
+
|
|
453
|
+
width: 100%;
|
|
454
|
+
|
|
455
|
+
outline: none;
|
|
456
|
+
color: ${t.gray800};
|
|
457
|
+
border-radius: 0.8rem;
|
|
458
|
+
|
|
459
|
+
transition: border 0.2s linear;
|
|
460
|
+
|
|
461
|
+
background-color: ${t.white};
|
|
462
|
+
caret-color: ${t.blue600};
|
|
463
|
+
border: 1px solid
|
|
464
|
+
${({$isError:e,$isSuccess:o})=>e?t.red300:o?t.green300:t.gray200};
|
|
465
|
+
|
|
466
|
+
&:focus {
|
|
467
|
+
border: 1px solid ${t.blue600};
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
&::placeholder {
|
|
471
|
+
color: ${t.gray500};
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
&:disabled {
|
|
475
|
+
background-color: ${t.gray100};
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
font-size: ${({$isSmall:e})=>e?1.6:1.8}rem;
|
|
479
|
+
|
|
480
|
+
${({$isSmall:e})=>e?ir:ar}
|
|
481
|
+
|
|
482
|
+
padding-right: ${({$pr:e})=>e}rem;
|
|
483
|
+
`,Bt=g.default.div`
|
|
484
|
+
display: flex;
|
|
485
|
+
flex-direction: column;
|
|
486
|
+
width: auto;
|
|
487
|
+
gap: 0.4rem;
|
|
488
|
+
font-size: 1.6rem;
|
|
489
|
+
color: ${t.gray900};
|
|
490
|
+
flex: 1;
|
|
491
|
+
width: ${({$width:e})=>e??"100%"};
|
|
492
|
+
`,At=g.default.div`
|
|
493
|
+
position: absolute;
|
|
494
|
+
display: flex;
|
|
495
|
+
align-items: center;
|
|
496
|
+
right: 0;
|
|
497
|
+
|
|
498
|
+
font-size: ${({$isSmall:e})=>e?1.4:1.6}rem;
|
|
499
|
+
${({$isSmall:e})=>e?ir:ar};
|
|
500
|
+
|
|
501
|
+
padding-left: 0.8rem;
|
|
502
|
+
gap: 0.4rem;
|
|
503
|
+
`,It=g.default.div`
|
|
504
|
+
cursor: pointer;
|
|
505
|
+
`,ir=`
|
|
506
|
+
padding: 0 1.2rem;
|
|
507
|
+
height: 3.2rem;
|
|
508
|
+
`,ar=`
|
|
509
|
+
padding: 0 1.2rem;
|
|
510
|
+
height: 4.8rem;
|
|
511
|
+
`,Wt=g.default.div`
|
|
512
|
+
display: flex;
|
|
513
|
+
gap: ${({$gap:e})=>e}rem;
|
|
514
|
+
`,zt=g.default.div`
|
|
515
|
+
color: ${t.red300};
|
|
516
|
+
`,Lt=g.default.div`
|
|
517
|
+
display: flex;
|
|
518
|
+
flex: 1;
|
|
519
|
+
flex-direction: column;
|
|
520
|
+
align-items: center;
|
|
521
|
+
justify-content: center;
|
|
522
|
+
padding: 0.4rem;
|
|
523
|
+
`,Mt=({width:e,level:o="large",value:i,disabled:l,onCancel:d,...a})=>{const[u,f]=B.useState(!1),p=B.useRef(null),v=B.useRef(null),[b]=nr(p),y=o==="small";return s.jsxs(Vt,{$isSmall:y,$width:e,children:[s.jsx(Nt,{ref:p,children:s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("g",{id:"ic/search",children:s.jsx("path",{id:"Vector",d:"M21 21L15 15M3 10C3 10.9193 3.18106 11.8295 3.53284 12.6788C3.88463 13.5281 4.40024 14.2997 5.05025 14.9497C5.70026 15.5998 6.47194 16.1154 7.32122 16.4672C8.1705 16.8189 9.08075 17 10 17C10.9193 17 11.8295 16.8189 12.6788 16.4672C13.5281 16.1154 14.2997 15.5998 14.9497 14.9497C15.5998 14.2997 16.1154 13.5281 16.4672 12.6788C16.8189 11.8295 17 10.9193 17 10C17 9.08075 16.8189 8.1705 16.4672 7.32122C16.1154 6.47194 15.5998 5.70026 14.9497 5.05025C14.2997 4.40024 13.5281 3.88463 12.6788 3.53284C11.8295 3.18106 10.9193 3 10 3C9.08075 3 8.1705 3.18106 7.32122 3.53284C6.47194 3.88463 5.70026 4.40024 5.05025 5.05025C4.40024 5.70026 3.88463 6.47194 3.53284 7.32122C3.18106 8.1705 3 9.08075 3 10Z",stroke:"#A3A8B4","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})})}),s.jsx(Ut,{ref:v,onFocus:()=>f(!0),onBlur:()=>f(!1),type:"text",value:i,disabled:l,$paddingLeft:b?b/10:void 0,$paddingRight:1.2+(u&&d&&3.2),$isSmall:y,...a}),u&&d&&s.jsx(Yt,{$isRight:!0,onClick:()=>d(a==null?void 0:a.name),onMouseDown:w=>w.preventDefault(),children:s.jsx(qt,{children:s.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsxs("g",{id:"Frame 48096259",children:[s.jsx("circle",{id:"Ellipse 52",cx:"9",cy:"9",r:"9",fill:"#DADEE5"}),s.jsx("path",{id:"Vector",d:"M5 5L13 13",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),s.jsx("path",{id:"Vector_2",d:"M13 5L5 13",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]})})})})]})},Vt=g.default.div`
|
|
524
|
+
display: flex;
|
|
525
|
+
position: relative;
|
|
526
|
+
height: ${({$isSmall:e})=>e?3.2:4.8}rem;
|
|
527
|
+
width: ${({$width:e})=>e??"100%"};
|
|
528
|
+
`,Nt=g.default.div`
|
|
529
|
+
position: absolute;
|
|
530
|
+
display: flex;
|
|
531
|
+
align-items: center;
|
|
532
|
+
justify-content: center;
|
|
533
|
+
left: 0;
|
|
534
|
+
padding: 0rem 0.4rem 0rem 1.2rem;
|
|
535
|
+
top: 50%;
|
|
536
|
+
transform: translateY(-50%);
|
|
537
|
+
`,Yt=g.default.div`
|
|
538
|
+
position: absolute;
|
|
539
|
+
right: 0;
|
|
540
|
+
padding: 0rem 1.2rem 0rem 0.4rem;
|
|
541
|
+
top: 50%;
|
|
542
|
+
transform: translateY(-50%);
|
|
543
|
+
cursor: pointer;
|
|
544
|
+
`,Ut=g.default.input`
|
|
545
|
+
font-family: "Pretendard";
|
|
546
|
+
width: auto;
|
|
547
|
+
font-size: ${({$isSmall:e})=>e?"1.6rem":"1.8rem"};
|
|
548
|
+
font-weight: 400;
|
|
549
|
+
flex: 1;
|
|
550
|
+
padding-left: ${({$paddingLeft:e})=>e}rem;
|
|
551
|
+
padding-right: ${({$paddingRight:e})=>e}rem;
|
|
552
|
+
outline: none;
|
|
553
|
+
color: ${t.gray900};
|
|
554
|
+
background-color: ${t.white};
|
|
555
|
+
border-radius: 0.8rem;
|
|
556
|
+
caret-color: ${t.blue600};
|
|
557
|
+
transition: 0.2s linear;
|
|
558
|
+
transition-property: background-color, border-color;
|
|
559
|
+
width: 100%;
|
|
560
|
+
|
|
561
|
+
border: 1px solid ${t.gray400};
|
|
562
|
+
|
|
563
|
+
&:focus {
|
|
564
|
+
border-color: ${t.blue600};
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
&::placeholder {
|
|
568
|
+
color: ${t.gray400};
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
&:disabled {
|
|
572
|
+
background-color: ${t.gray50};
|
|
573
|
+
color: ${t.gray300};
|
|
574
|
+
}
|
|
575
|
+
`,qt=g.default.div`
|
|
576
|
+
display: flex;
|
|
577
|
+
flex: 1;
|
|
578
|
+
flex-direction: column;
|
|
579
|
+
align-items: center;
|
|
580
|
+
justify-content: center;
|
|
581
|
+
padding: 0.4rem;
|
|
582
|
+
`,Jt=({options:e,value:o,onClick:i,disabled:l})=>{const d=e.map(a=>{const u=a.value===o.value,f=()=>i(a);return s.jsx($e,{checked:u,label:a.label,name:a.value,onClick:f,disabled:l},a.value)});return s.jsx(Ht,{gap:2,children:d})},Ht=g.default.div`
|
|
255
583
|
display: flex;
|
|
256
|
-
gap: ${
|
|
257
|
-
`;exports.Button=
|
|
584
|
+
gap: ${e=>e.gap}rem;
|
|
585
|
+
`;exports.Button=Ze;exports.ButtonFilter=lt;exports.Checkbox=me;exports.CustomButtonFilter=ct;exports.Divider=dt;exports.IconButton=xt;exports.IconWithButton=wt;exports.Input=_t;exports.RadioButton=$e;exports.RadioButtons=Jt;exports.SearchInput=Mt;exports.themeColors=t;
|