levannta-ui 1.0.16 → 1.0.17
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.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +463 -423
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +11 -11
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(
|
1
|
+
(function(W,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],R):(W=typeof globalThis<"u"?globalThis:W||self,R(W.LevantaUI={},W.React))})(this,function(W,R){"use strict";var ne={exports:{}},X={};/**
|
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 he;function
|
9
|
+
*/var he;function Xe(){if(he)return X;he=1;var o=R,f=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,g=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,C={key:!0,ref:!0,__self:!0,__source:!0};function S(d,u,p){var l,y={},m=null,x=null;p!==void 0&&(m=""+p),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(x=u.ref);for(l in u)i.call(u,l)&&!C.hasOwnProperty(l)&&(y[l]=u[l]);if(d&&d.defaultProps)for(l in u=d.defaultProps,u)y[l]===void 0&&(y[l]=u[l]);return{$$typeof:f,type:d,key:m,ref:x,props:y,_owner:g.current}}return X.Fragment=a,X.jsx=S,X.jsxs=S,X}var J={};/**
|
10
10
|
* @license React
|
11
11
|
* react-jsx-runtime.development.js
|
12
12
|
*
|
@@ -14,20 +14,20 @@
|
|
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 ge;function
|
18
|
-
`+le+e}}var ue=!1,q;{var
|
19
|
-
`),F=
|
20
|
-
`),
|
21
|
-
`+
|
17
|
+
*/var ge;function Je(){return ge||(ge=1,process.env.NODE_ENV!=="production"&&function(){var o=R,f=Symbol.for("react.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),k=Symbol.iterator,L="@@iterator";function b(e){if(e===null||typeof e!="object")return null;var r=k&&e[k]||e[L];return typeof r=="function"?r:null}var D=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];Y("error",e,n)}}function Y(e,r,n){{var s=D.ReactDebugCurrentFrame,h=s.getStackAddendum();h!==""&&(r+="%s",n=n.concat([h]));var E=n.map(function(v){return String(v)});E.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,E)}}var I=!1,te=!1,ae=!1,oe=!1,se=!1,H;H=Symbol.for("react.module.reference");function B(e){return!!(typeof e=="string"||typeof e=="function"||e===i||e===C||se||e===g||e===p||e===l||oe||e===x||I||te||ae||typeof e=="object"&&e!==null&&(e.$$typeof===m||e.$$typeof===y||e.$$typeof===S||e.$$typeof===d||e.$$typeof===u||e.$$typeof===H||e.getModuleId!==void 0))}function j(e,r,n){var s=e.displayName;if(s)return s;var h=r.displayName||r.name||"";return h!==""?n+"("+h+")":n}function O(e){return e.displayName||"Context"}function _(e){if(e==null)return null;if(typeof e.tag=="number"&&w("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 i:return"Fragment";case a:return"Portal";case C:return"Profiler";case g:return"StrictMode";case p:return"Suspense";case l:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return O(r)+".Consumer";case S:var n=e;return O(n._context)+".Provider";case u:return j(e,e.render,"ForwardRef");case y:var s=e.displayName||null;return s!==null?s:_(e.type)||"Memo";case m:{var h=e,E=h._payload,v=h._init;try{return _(v(E))}catch{return null}}}return null}var P=Object.assign,A=0,Z,_e,Ce,Se,Te,Ne,ke;function Oe(){}Oe.__reactDisabledLog=!0;function nr(){{if(A===0){Z=console.log,_e=console.info,Ce=console.warn,Se=console.error,Te=console.group,Ne=console.groupCollapsed,ke=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Oe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}A++}}function tr(){{if(A--,A===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:Z}),info:P({},e,{value:_e}),warn:P({},e,{value:Ce}),error:P({},e,{value:Se}),group:P({},e,{value:Te}),groupCollapsed:P({},e,{value:Ne}),groupEnd:P({},e,{value:ke})})}A<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ie=D.ReactCurrentDispatcher,le;function Q(e,r,n){{if(le===void 0)try{throw Error()}catch(h){var s=h.stack.trim().match(/\n( *(at )?)/);le=s&&s[1]||""}return`
|
18
|
+
`+le+e}}var ue=!1,q;{var ar=typeof WeakMap=="function"?WeakMap:Map;q=new ar}function Pe(e,r){if(!e||ue)return"";{var n=q.get(e);if(n!==void 0)return n}var s;ue=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var E;E=ie.current,ie.current=null,nr();try{if(r){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(M){s=M}Reflect.construct(e,[],v)}else{try{v.call()}catch(M){s=M}e.call(v.prototype)}}else{try{throw Error()}catch(M){s=M}e()}}catch(M){if(M&&s&&typeof M.stack=="string"){for(var c=M.stack.split(`
|
19
|
+
`),F=s.stack.split(`
|
20
|
+
`),T=c.length-1,N=F.length-1;T>=1&&N>=0&&c[T]!==F[N];)N--;for(;T>=1&&N>=0;T--,N--)if(c[T]!==F[N]){if(T!==1||N!==1)do if(T--,N--,N<0||c[T]!==F[N]){var V=`
|
21
|
+
`+c[T].replace(" at new "," at ");return e.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",e.displayName)),typeof e=="function"&&q.set(e,V),V}while(T>=1&&N>=0);break}}}finally{ue=!1,ie.current=E,tr(),Error.prepareStackTrace=h}var K=e?e.displayName||e.name:"",z=K?Q(K):"";return typeof e=="function"&&q.set(e,z),z}function or(e,r,n){return Pe(e,!1)}function sr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function ee(e,r,n){if(e==null)return"";if(typeof e=="function")return Pe(e,sr(e));if(typeof e=="string")return Q(e);switch(e){case p:return Q("Suspense");case l:return Q("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return or(e.render);case y:return ee(e.type,r,n);case m:{var s=e,h=s._payload,E=s._init;try{return ee(E(h),r,n)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,Ie={},De=D.ReactDebugCurrentFrame;function re(e){if(e){var r=e._owner,n=ee(e.type,e._source,r?r.type:null);De.setExtraStackFrame(n)}else De.setExtraStackFrame(null)}function ir(e,r,n,s,h){{var E=Function.call.bind($);for(var v in e)if(E(e,v)){var c=void 0;try{if(typeof e[v]!="function"){var F=Error((s||"React class")+": "+n+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw F.name="Invariant Violation",F}c=e[v](r,v,s,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(T){c=T}c&&!(c instanceof Error)&&(re(h),w("%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).",s||"React class",n,v,typeof c),re(null)),c instanceof Error&&!(c.message in Ie)&&(Ie[c.message]=!0,re(h),w("Failed %s type: %s",n,c.message),re(null))}}}var lr=Array.isArray;function ce(e){return lr(e)}function ur(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function cr(e){try{return Fe(e),!1}catch{return!0}}function Fe(e){return""+e}function Ae(e){if(cr(e))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ur(e)),Fe(e)}var G=D.ReactCurrentOwner,fr={key:!0,ref:!0,__self:!0,__source:!0},Me,Le,fe;fe={};function dr(e){if($.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function vr(e){if($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function mr(e,r){if(typeof e.ref=="string"&&G.current&&r&&G.current.stateNode!==r){var n=_(G.current.type);fe[n]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',_(G.current.type),e.ref),fe[n]=!0)}}function br(e,r){{var n=function(){Me||(Me=!0,w("%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)",r))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function hr(e,r){{var n=function(){Le||(Le=!0,w("%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)",r))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var gr=function(e,r,n,s,h,E,v){var c={$$typeof:f,type:e,key:r,ref:n,props:v,_owner:E};return c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:h}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function pr(e,r,n,s,h){{var E,v={},c=null,F=null;n!==void 0&&(Ae(n),c=""+n),vr(r)&&(Ae(r.key),c=""+r.key),dr(r)&&(F=r.ref,mr(r,h));for(E in r)$.call(r,E)&&!fr.hasOwnProperty(E)&&(v[E]=r[E]);if(e&&e.defaultProps){var T=e.defaultProps;for(E in T)v[E]===void 0&&(v[E]=T[E])}if(c||F){var N=typeof e=="function"?e.displayName||e.name||"Unknown":e;c&&br(v,N),F&&hr(v,N)}return gr(e,c,F,h,s,G.current,v)}}var de=D.ReactCurrentOwner,Ve=D.ReactDebugCurrentFrame;function U(e){if(e){var r=e._owner,n=ee(e.type,e._source,r?r.type:null);Ve.setExtraStackFrame(n)}else Ve.setExtraStackFrame(null)}var ve;ve=!1;function me(e){return typeof e=="object"&&e!==null&&e.$$typeof===f}function We(){{if(de.current){var e=_(de.current.type);if(e)return`
|
22
22
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
23
|
+
Check the render method of \``+e+"`."}return""}}function yr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),n=e.lineNumber;return`
|
24
24
|
|
25
|
-
Check your code at `+r+":"+n+"."}return""}}var
|
25
|
+
Check your code at `+r+":"+n+"."}return""}}var Ye={};function xr(e){{var r=We();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
|
26
26
|
|
27
|
-
Check the top-level render call using <`+n+">.")}return r}}function
|
27
|
+
Check the top-level render call using <`+n+">.")}return r}}function ze(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=xr(r);if(Ye[n])return;Ye[n]=!0;var s="";e&&e._owner&&e._owner!==de.current&&(s=" It was passed a child from "+_(e._owner.type)+"."),U(e),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,s),U(null)}}function Be(e,r){{if(typeof e!="object")return;if(ce(e))for(var n=0;n<e.length;n++){var s=e[n];me(s)&&ze(s,r)}else if(me(e))e._store&&(e._store.validated=!0);else if(e){var h=b(e);if(typeof h=="function"&&h!==e.entries)for(var E=h.call(e),v;!(v=E.next()).done;)me(v.value)&&ze(v.value,r)}}}function jr(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===y))n=r.propTypes;else return;if(n){var s=_(r);ir(n,e.props,"prop",s,e)}else if(r.PropTypes!==void 0&&!ve){ve=!0;var h=_(r);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",h||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Er(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var s=r[n];if(s!=="children"&&s!=="key"){U(e),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),U(null);break}}e.ref!==null&&(U(e),w("Invalid attribute `ref` supplied to `React.Fragment`."),U(null))}}var Ue={};function Ke(e,r,n,s,h,E){{var v=B(e);if(!v){var c="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(c+=" 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 F=yr(h);F?c+=F:c+=We();var T;e===null?T="null":ce(e)?T="array":e!==void 0&&e.$$typeof===f?(T="<"+(_(e.type)||"Unknown")+" />",c=" Did you accidentally export a JSX literal instead of a component?"):T=typeof e,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",T,c)}var N=pr(e,r,n,h,E);if(N==null)return N;if(v){var V=r.children;if(V!==void 0)if(s)if(ce(V)){for(var K=0;K<V.length;K++)Be(V[K],e);Object.freeze&&Object.freeze(V)}else w("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 Be(V,e)}if($.call(r,"key")){var z=_(e),M=Object.keys(r).filter(function(Tr){return Tr!=="key"}),be=M.length>0?"{key: someKey, "+M.join(": ..., ")+": ...}":"{key: someKey}";if(!Ue[z+be]){var Sr=M.length>0?"{"+M.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
|
28
28
|
let props = %s;
|
29
29
|
<%s {...props} />
|
30
30
|
React keys must be passed directly to JSX without using spread:
|
31
31
|
let props = %s;
|
32
|
-
<%s key={someKey} {...props} />`,me,U,_r,U),Be[U+me]=!0}}return e===u?xr(T):yr(T),T}}function jr(e,r,n){return ze(e,r,n,!0)}function Er(e,r,n){return ze(e,r,n,!1)}var wr=Er,Rr=jr;J.Fragment=u,J.jsx=wr,J.jsxs=Rr}()),J}process.env.NODE_ENV==="production"?ne.exports=$e():ne.exports=Xe();var t=ne.exports;function pe(i){var d,a,u="";if(typeof i=="string"||typeof i=="number")u+=i;else if(typeof i=="object")if(Array.isArray(i)){var p=i.length;for(d=0;d<p;d++)i[d]&&(a=pe(i[d]))&&(u&&(u+=" "),u+=a)}else for(a in i)i[a]&&(u&&(u+=" "),u+=a);return u}function Je(){for(var i,d,a=0,u="",p=arguments.length;a<p;a++)(i=arguments[a])&&(d=pe(i))&&(u&&(u+=" "),u+=d);return u}const ye=i=>typeof i=="boolean"?`${i}`:i===0?"0":i,xe=Je,Ke=(i,d)=>a=>{var u;if((d==null?void 0:d.variants)==null)return xe(i,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:p,defaultVariants:k}=d,S=Object.keys(p).map(g=>{const s=a==null?void 0:a[g],y=k==null?void 0:k[g];if(s===null)return null;const v=ye(s)||ye(y);return p[g][v]}),h=a&&Object.entries(a).reduce((g,s)=>{let[y,v]=s;return v===void 0||(g[y]=v),g},{}),c=d==null||(u=d.compoundVariants)===null||u===void 0?void 0:u.reduce((g,s)=>{let{class:y,className:v,...x}=s;return Object.entries(x).every(N=>{let[L,b]=N;return Array.isArray(b)?b.includes({...k,...h}[L]):{...k,...h}[L]===b})?[...g,y,v]:g},[]);return xe(i,S,c,a==null?void 0:a.class,a==null?void 0:a.className)},Sr="",je=Ke("button",{variants:{variant:{outlined:"button-outlined",filled:"button-filled",icon:"button-icon"},color:{primary:"button-color-primary",secondary:"button-color-secondary",error:"button-color-error",clear:"button-color-clear"},size:{sm:"button-size-sm",md:"button-size-md",lg:"button-size-lg",xl:"button-size-xl"},pill:{true:"button-pill"},active:{true:"button-active"},iconLeft:{true:"button-with-icon-left"},iconRight:{true:"button-with-icon-right"},iconLeftJustified:{true:"button-with-icon-left button-with-icon-left-justified"},iconRightJustified:{true:"button-with-icon-right button-with-icon-right-justified"},iconOnly:{true:"button-icon-only"}},defaultVariants:{variant:"filled",color:"primary",size:"md"},compoundVariants:[{variant:"outlined",color:"primary",className:"button-outlined-primary"},{variant:"outlined",color:"secondary",className:"button-outlined-secondary"},{variant:"outlined",color:"error",className:"button-outlined-error"},{variant:"outlined",color:"clear",className:"button-outlined-clear"},{variant:"filled",color:"primary",className:"button-filled-primary"},{variant:"filled",color:"secondary",className:"button-filled-secondary"},{variant:"filled",color:"error",className:"button-filled-error"},{variant:"filled",color:"clear",className:"button-filled-clear"},{variant:"icon",color:"primary",className:"button-icon-primary"},{variant:"icon",color:"secondary",className:"button-icon-secondary"},{variant:"icon",color:"error",className:"button-icon-error"},{variant:"icon",color:"clear",className:"button-icon-clear"}]}),Ee=_.forwardRef(({className:i,variant:d,color:a,size:u,pill:p,active:k,iconLeft:S,iconRight:h,iconLeftJustified:c,iconRightJustified:g,iconOnly:s,width:y,children:v,style:x,...N},L)=>{const b={...x||{},...y?{width:y}:{}};return t.jsxs("button",{className:je({variant:d,color:a,size:u,pill:p,active:k,iconLeft:!!S,iconRight:!!h,iconLeftJustified:!!c,iconRightJustified:!!g,iconOnly:!!s,className:i}),style:b,ref:L,...N,children:[S&&t.jsx("span",{className:"button-icon-left",children:S}),c&&t.jsx("span",{className:"button-icon-left",children:c}),s?t.jsx("span",{children:s}):v,h&&t.jsx("span",{className:"button-icon-right",children:h}),g&&t.jsx("span",{className:"button-icon-right",children:g})]})});Ee.displayName="Button";const Ge=({className:i})=>t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:t.jsx("path",{d:"M8.12 9.29006L12 13.1701L15.88 9.29006C16.27 8.90006 16.9 8.90006 17.29 9.29006C17.68 9.68006 17.68 10.3101 17.29 10.7001L12.7 15.2901C12.31 15.6801 11.68 15.6801 11.29 15.2901L6.7 10.7001C6.31 10.3101 6.31 9.68006 6.7 9.29006C7.09 8.91006 7.73 8.90006 8.12 9.29006Z",fill:"#F9FAFB"})}),He=({icon:i,url:d,label:a,submenu:u,collapsed:p,active:k,activePath:S,isOpen:h,onToggle:c,onExpand:g,onSetActive:s,isMobile:y=!1})=>{const v=u&&u.length>0,x=v&&u.some(b=>b.url===S),N=k||h&&v||x||d===S,L=b=>{if(b.preventDefault(),y&&v){c();return}if(s&&s(d),p&&g){g();return}v&&!p&&c()};return t.jsx("div",{className:`sidebar-item ${h?"open":""} `,children:t.jsxs("div",{className:`sidebar-item-wrapper ${N&&!p?"active":""}`,children:[t.jsxs("a",{href:d,className:`sidebar-link sidebar-collapsed ${N?"active-text":""}`,onClick:L,children:[t.jsx("div",{className:`sidebar-icon ${N?"active-text":""}`,children:i}),(!p||y)&&t.jsxs("div",{className:"sidebar-content",children:[t.jsx("span",{className:"sidebar-label",children:a}),v&&t.jsx("span",{className:"submenu-arrow",children:t.jsx(Ge,{className:`${N?"active-text":""}`})})]})]}),v&&(!p||y)&&t.jsx("div",{className:"submenu",children:u.map((b,D)=>{const w=b.url===S;return t.jsx("a",{href:b.url,className:`submenu-item ${w?"active-text":""}`,onClick:()=>s&&s(b.url),children:t.jsx("span",{className:"submenu-label",children:b.label})},D)})})]})})},Tr="",Ze=({className:i})=>t.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:[t.jsx("circle",{cx:"14",cy:"14",r:"14",fill:"#00F7AA"}),t.jsx("path",{d:"M10.8383 7.82832C10.3833 8.28332 10.3833 9.01832 10.8383 9.47332L15.365 14L10.8383 18.5267C10.3833 18.9817 10.3833 19.7167 10.8383 20.1717C11.2933 20.6267 12.0283 20.6267 12.4833 20.1717L17.8383 14.8167C18.2933 14.3617 18.2933 13.6267 17.8383 13.1717L12.4833 7.81665C12.04 7.37332 11.2933 7.37332 10.8383 7.82832Z",fill:"#002244"})]}),we=()=>t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsxs("g",{className:"hamburger-icon",children:[t.jsx("line",{x1:"4",y1:"6",x2:"20",y2:"6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:"hamburger-line top-line"}),t.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:"hamburger-line middle-line"}),t.jsx("line",{x1:"4",y1:"18",x2:"20",y2:"18",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:"hamburger-line bottom-line"})]})}),Qe=({logo:i,logoCollapsed:d,items:a,logoutIcon:u,onLogout:p,logoutLabel:k="Cerrar sesión",collapsed:S=!1,onToggle:h,activePath:c,onActiveChange:g})=>{const[s,y]=_.useState(S),[v,x]=_.useState(null),[N,L]=_.useState(c),[b,D]=_.useState(!1),[w,Y]=_.useState(!1),[I,te]=_.useState(!1);_.useEffect(()=>{const j=()=>{te(window.innerWidth<=768)};return j(),window.addEventListener("resize",j),()=>{window.removeEventListener("resize",j)}},[]),_.useEffect(()=>{var j;if(c){L(c);const O=a.findIndex(R=>{var P;return R.url===c||((P=R.submenu)==null?void 0:P.some(A=>A.url===c))});O!==-1&&((j=a[O].submenu)!=null&&j.length?x(O):x(null))}},[c,a]);const ae=()=>{y(!s),h&&h()},oe=()=>{var j;if(s)if(y(!1),h&&h(),N){const O=a.findIndex(R=>{var P;return R.url===N||((P=R.submenu)==null?void 0:P.some(A=>A.url===N))});O!==-1&&((j=a[O].submenu)!=null&&j.length)?x(O):x(null)}else x(null)},ie=j=>{x(v===j?null:j),I&&D(!0)},H=j=>{L(j);const O=a.findIndex(R=>{var P;return R.url===j||((P=R.submenu)==null?void 0:P.some(A=>A.url===j))});if(O!==-1){const R=a[O];R.submenu&&R.submenu.length>0?x(O):x(null)}else x(null);g&&g(j),I&&(a.some(P=>{var A;return(A=P.submenu)==null?void 0:A.some(Z=>Z.url===j)})||(Y(!0),setTimeout(()=>{D(!1),Y(!1)},500)))},B=()=>{b?(Y(!0),setTimeout(()=>{D(!1),Y(!1)},500)):D(!0)};return t.jsxs(t.Fragment,{children:[I&&t.jsxs("div",{className:"mobile-navbar",children:[t.jsx("div",{className:"mobile-logo",children:i}),t.jsx("button",{className:`mobile-menu-button ${b?"open":""}`,onClick:B,"aria-label":"Toggle mobile menu",children:t.jsx(we,{})})]}),!I&&t.jsx("button",{className:`mobile-menu-button ${b?"open":""}`,onClick:B,"aria-label":"Toggle mobile menu",style:{display:"none"},children:t.jsx(we,{})}),I&&(b||w)&&t.jsx("div",{className:`sidebar-overlay ${b?"visible":""}`,onClick:B}),t.jsxs("div",{className:`sidebar-wrapper ${b?"mobile-open":""} ${w?"mobile-closing":""}`,children:[t.jsxs("div",{className:`sidebar ${!I&&s?"sidebar-collapsed":""} ${I?"sidebar-mobile":""}`,children:[!I&&t.jsx("div",{className:"sidebar-header",children:t.jsx("div",{className:"sidebar-logo",children:s?t.jsx("span",{className:"logo-text",children:d}):t.jsx("span",{className:"logo-text",children:i})})}),I&&(b||w)&&t.jsxs("div",{className:"mobile-header",children:[t.jsx("div",{className:"mobile-logo-menu",children:i}),t.jsx("button",{className:"mobile-close-button",onClick:B,"aria-label":"Close menu",children:"×"})]}),t.jsx("div",{className:"sidebar-menu",children:a.map((j,O)=>t.jsx(He,{icon:j.icon,url:j.url,label:j.label,submenu:j.submenu,collapsed:s,active:j.active||j.url===N,activePath:N,isOpen:v===O,onToggle:()=>ie(O),onExpand:oe,onSetActive:H,isMobile:I},O))}),p&&t.jsx("div",{className:"sidebar-footer",children:t.jsxs("button",{className:"logout-button",onClick:p,children:[u,!s&&t.jsx("span",{children:k})]})})]}),!I&&t.jsx("button",{className:`sidebar-toggle-icon${s?" collapsed":""}`,onClick:ae,"aria-label":"Toggle sidebar",children:t.jsx(Ze,{})})]})]})},Nr="",qe=({isOpen:i,onClose:d,title:a="",children:u,position:p="right",size:k="medium",enableSwipeToClose:S=!0})=>{const[h,c]=_.useState(!1),g=_.useRef(null),s=_.useRef(0),y=_.useRef(0),v=50,x=()=>{!h&&i&&(c(!0),setTimeout(()=>{c(!1),d()},500))},N=b=>{S&&(s.current=b.touches[0].clientX,y.current=b.touches[0].clientY)},L=b=>{if(!S||!b.changedTouches[0])return;const D=b.changedTouches[0].clientX,w=b.changedTouches[0].clientY,Y=D-s.current,I=w-y.current;(p==="right"&&Y>v||p==="left"&&Y<-v||p==="top"&&I<-v||p==="bottom"&&I>v)&&x()};return _.useEffect(()=>{i&&c(!1)},[i]),_.useEffect(()=>(i&&!h?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i,h]),!i&&!h?null:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`drawer-overlay ${h?"fade-out":"fade-in"}`,onClick:x}),t.jsxs("div",{ref:g,className:`drawer drawer-${p} drawer-${k} ${h?"drawer-closing":"drawer-open"}`,onTouchStart:N,onTouchEnd:L,children:[t.jsxs("div",{className:`drawer-header ${a?"has-title":"no-title"}`,children:[a&&t.jsx("h2",{className:"drawer-title",children:a}),t.jsx("button",{className:"drawer-close",onClick:x,"aria-label":"Cerrar",children:"✕"})]}),t.jsx("div",{className:"drawer-content",children:u})]})]})};V.Button=Ee,V.Drawer=qe,V.Sidebar=Qe,V.buttonVariants=je,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
|
32
|
+
<%s key={someKey} {...props} />`,be,z,Sr,z),Ue[z+be]=!0}}return e===i?Er(N):jr(N),N}}function wr(e,r,n){return Ke(e,r,n,!0)}function Rr(e,r,n){return Ke(e,r,n,!1)}var _r=Rr,Cr=wr;J.Fragment=i,J.jsx=_r,J.jsxs=Cr}()),J}process.env.NODE_ENV==="production"?ne.exports=Xe():ne.exports=Je();var t=ne.exports;function pe(o){var f,a,i="";if(typeof o=="string"||typeof o=="number")i+=o;else if(typeof o=="object")if(Array.isArray(o)){var g=o.length;for(f=0;f<g;f++)o[f]&&(a=pe(o[f]))&&(i&&(i+=" "),i+=a)}else for(a in o)o[a]&&(i&&(i+=" "),i+=a);return i}function $e(){for(var o,f,a=0,i="",g=arguments.length;a<g;a++)(o=arguments[a])&&(f=pe(o))&&(i&&(i+=" "),i+=f);return i}const ye=o=>typeof o=="boolean"?`${o}`:o===0?"0":o,xe=$e,je=(o,f)=>a=>{var i;if((f==null?void 0:f.variants)==null)return xe(o,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:g,defaultVariants:C}=f,S=Object.keys(g).map(p=>{const l=a==null?void 0:a[p],y=C==null?void 0:C[p];if(l===null)return null;const m=ye(l)||ye(y);return g[p][m]}),d=a&&Object.entries(a).reduce((p,l)=>{let[y,m]=l;return m===void 0||(p[y]=m),p},{}),u=f==null||(i=f.compoundVariants)===null||i===void 0?void 0:i.reduce((p,l)=>{let{class:y,className:m,...x}=l;return Object.entries(x).every(k=>{let[L,b]=k;return Array.isArray(b)?b.includes({...C,...d}[L]):{...C,...d}[L]===b})?[...p,y,m]:p},[]);return xe(o,S,u,a==null?void 0:a.class,a==null?void 0:a.className)},Nr="",Ee=je("button",{variants:{variant:{outlined:"button-outlined",filled:"button-filled",icon:"button-icon"},color:{primary:"button-color-primary",secondary:"button-color-secondary",error:"button-color-error",clear:"button-color-clear"},size:{sm:"button-size-sm",md:"button-size-md",lg:"button-size-lg",xl:"button-size-xl"},pill:{true:"button-pill"},active:{true:"button-active"},iconLeft:{true:"button-with-icon-left"},iconRight:{true:"button-with-icon-right"},iconLeftJustified:{true:"button-with-icon-left button-with-icon-left-justified"},iconRightJustified:{true:"button-with-icon-right button-with-icon-right-justified"},iconOnly:{true:"button-icon-only"}},defaultVariants:{variant:"filled",color:"primary",size:"md"},compoundVariants:[{variant:"outlined",color:"primary",className:"button-outlined-primary"},{variant:"outlined",color:"secondary",className:"button-outlined-secondary"},{variant:"outlined",color:"error",className:"button-outlined-error"},{variant:"outlined",color:"clear",className:"button-outlined-clear"},{variant:"filled",color:"primary",className:"button-filled-primary"},{variant:"filled",color:"secondary",className:"button-filled-secondary"},{variant:"filled",color:"error",className:"button-filled-error"},{variant:"filled",color:"clear",className:"button-filled-clear"},{variant:"icon",color:"primary",className:"button-icon-primary"},{variant:"icon",color:"secondary",className:"button-icon-secondary"},{variant:"icon",color:"error",className:"button-icon-error"},{variant:"icon",color:"clear",className:"button-icon-clear"}]}),we=R.forwardRef(({className:o,variant:f,color:a,size:i,pill:g,active:C,iconLeft:S,iconRight:d,iconLeftJustified:u,iconRightJustified:p,iconOnly:l,width:y,children:m,style:x,...k},L)=>{const b={...x||{},...y?{width:y}:{}};return t.jsxs("button",{className:Ee({variant:f,color:a,size:i,pill:g,active:C,iconLeft:!!S,iconRight:!!d,iconLeftJustified:!!u,iconRightJustified:!!p,iconOnly:!!l,className:o}),style:b,ref:L,...k,children:[S&&t.jsx("span",{className:"button-icon-left",children:S}),u&&t.jsx("span",{className:"button-icon-left",children:u}),l?t.jsx("span",{children:l}):m,d&&t.jsx("span",{className:"button-icon-right",children:d}),p&&t.jsx("span",{className:"button-icon-right",children:p})]})});we.displayName="Button";const Ge=({className:o})=>t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,children:t.jsx("path",{d:"M8.12 9.29006L12 13.1701L15.88 9.29006C16.27 8.90006 16.9 8.90006 17.29 9.29006C17.68 9.68006 17.68 10.3101 17.29 10.7001L12.7 15.2901C12.31 15.6801 11.68 15.6801 11.29 15.2901L6.7 10.7001C6.31 10.3101 6.31 9.68006 6.7 9.29006C7.09 8.91006 7.73 8.90006 8.12 9.29006Z",fill:"#F9FAFB"})}),He=({icon:o,url:f,label:a,submenu:i,collapsed:g,active:C,activePath:S,isOpen:d,onToggle:u,onExpand:p,onSetActive:l,isMobile:y=!1})=>{const m=i&&i.length>0,x=m&&i.some(b=>b.url===S),k=C||d&&m||x||f===S,L=b=>{if(b.preventDefault(),y&&m){u();return}if(l&&l(f),g&&p){p();return}m&&!g&&u()};return t.jsx("div",{className:`sidebar-item ${d?"open":""} `,children:t.jsxs("div",{className:`sidebar-item-wrapper ${k&&!g?"active":""}`,children:[t.jsxs("a",{href:f,className:`sidebar-link sidebar-collapsed ${k?"active-text":""}`,onClick:L,children:[t.jsx("div",{className:`sidebar-icon ${k?"active-text":""}`,children:o}),(!g||y)&&t.jsxs("div",{className:"sidebar-content",children:[t.jsx("span",{className:"sidebar-label",children:a}),m&&t.jsx("span",{className:"submenu-arrow",children:t.jsx(Ge,{className:`${k?"active-text":""}`})})]})]}),m&&(!g||y)&&t.jsx("div",{className:"submenu",children:i.map((b,D)=>{const w=b.url===S;return t.jsx("a",{href:b.url,className:`submenu-item ${w?"active-text":""}`,onClick:()=>l&&l(b.url),children:t.jsx("span",{className:"submenu-label",children:b.label})},D)})})]})})},kr="",Ze=({className:o})=>t.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,children:[t.jsx("circle",{cx:"14",cy:"14",r:"14",fill:"#00F7AA"}),t.jsx("path",{d:"M10.8383 7.82832C10.3833 8.28332 10.3833 9.01832 10.8383 9.47332L15.365 14L10.8383 18.5267C10.3833 18.9817 10.3833 19.7167 10.8383 20.1717C11.2933 20.6267 12.0283 20.6267 12.4833 20.1717L17.8383 14.8167C18.2933 14.3617 18.2933 13.6267 17.8383 13.1717L12.4833 7.81665C12.04 7.37332 11.2933 7.37332 10.8383 7.82832Z",fill:"#002244"})]}),Re=()=>t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsxs("g",{className:"hamburger-icon",children:[t.jsx("line",{x1:"4",y1:"6",x2:"20",y2:"6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:"hamburger-line top-line"}),t.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:"hamburger-line middle-line"}),t.jsx("line",{x1:"4",y1:"18",x2:"20",y2:"18",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:"hamburger-line bottom-line"})]})}),Qe=({logo:o,logoCollapsed:f,items:a,logoutIcon:i,onLogout:g,logoutLabel:C="Cerrar sesión",collapsed:S=!1,onToggle:d,activePath:u,onActiveChange:p})=>{const[l,y]=R.useState(S),[m,x]=R.useState(null),[k,L]=R.useState(u),[b,D]=R.useState(!1),[w,Y]=R.useState(!1),[I,te]=R.useState(!1);R.useEffect(()=>{const j=()=>{te(window.innerWidth<=768)};return j(),window.addEventListener("resize",j),()=>{window.removeEventListener("resize",j)}},[]),R.useEffect(()=>{var j;if(u){L(u);const O=a.findIndex(_=>{var P;return _.url===u||((P=_.submenu)==null?void 0:P.some(A=>A.url===u))});O!==-1&&((j=a[O].submenu)!=null&&j.length?x(O):x(null))}},[u,a]);const ae=()=>{y(!l),d&&d()},oe=()=>{var j;if(l)if(y(!1),d&&d(),k){const O=a.findIndex(_=>{var P;return _.url===k||((P=_.submenu)==null?void 0:P.some(A=>A.url===k))});O!==-1&&((j=a[O].submenu)!=null&&j.length)?x(O):x(null)}else x(null)},se=j=>{x(m===j?null:j),I&&D(!0)},H=j=>{L(j);const O=a.findIndex(_=>{var P;return _.url===j||((P=_.submenu)==null?void 0:P.some(A=>A.url===j))});if(O!==-1){const _=a[O];_.submenu&&_.submenu.length>0?x(O):x(null)}else x(null);p&&p(j),I&&(a.some(P=>{var A;return(A=P.submenu)==null?void 0:A.some(Z=>Z.url===j)})||(Y(!0),setTimeout(()=>{D(!1),Y(!1)},500)))},B=()=>{b?(Y(!0),setTimeout(()=>{D(!1),Y(!1)},500)):D(!0)};return t.jsxs(t.Fragment,{children:[I&&t.jsxs("div",{className:"mobile-navbar",children:[t.jsx("div",{className:"mobile-logo",children:o}),t.jsx("button",{className:`mobile-menu-button ${b?"open":""}`,onClick:B,"aria-label":"Toggle mobile menu",children:t.jsx(Re,{})})]}),!I&&t.jsx("button",{className:`mobile-menu-button ${b?"open":""}`,onClick:B,"aria-label":"Toggle mobile menu",style:{display:"none"},children:t.jsx(Re,{})}),I&&(b||w)&&t.jsx("div",{className:`sidebar-overlay ${b?"visible":""}`,onClick:B}),t.jsxs("div",{className:`sidebar-wrapper ${b?"mobile-open":""} ${w?"mobile-closing":""}`,children:[t.jsxs("div",{className:`sidebar ${!I&&l?"sidebar-collapsed":""} ${I?"sidebar-mobile":""}`,children:[!I&&t.jsx("div",{className:"sidebar-header",children:t.jsx("div",{className:"sidebar-logo",children:l?t.jsx("span",{className:"logo-text",children:f}):t.jsx("span",{className:"logo-text",children:o})})}),I&&(b||w)&&t.jsxs("div",{className:"mobile-header",children:[t.jsx("div",{className:"mobile-logo-menu",children:o}),t.jsx("button",{className:"mobile-close-button",onClick:B,"aria-label":"Close menu",children:"×"})]}),t.jsx("div",{className:"sidebar-menu",children:a.map((j,O)=>t.jsx(He,{icon:j.icon,url:j.url,label:j.label,submenu:j.submenu,collapsed:l,active:j.active||j.url===k,activePath:k,isOpen:m===O,onToggle:()=>se(O),onExpand:oe,onSetActive:H,isMobile:I},O))}),g&&t.jsx("div",{className:"sidebar-footer",children:t.jsxs("button",{className:"logout-button",onClick:g,children:[i,!l&&t.jsx("span",{children:C})]})})]}),!I&&t.jsx("button",{className:`sidebar-toggle-icon${l?" collapsed":""}`,onClick:ae,"aria-label":"Toggle sidebar",children:t.jsx(Ze,{})})]})]})},Or="",qe=({isOpen:o,onClose:f,title:a="",children:i,position:g="right",size:C="medium",enableSwipeToClose:S=!0})=>{const[d,u]=R.useState(!1),p=R.useRef(null),l=R.useRef(0),y=R.useRef(0),m=50,x=()=>{!d&&o&&(u(!0),setTimeout(()=>{u(!1),f()},500))},k=b=>{S&&(l.current=b.touches[0].clientX,y.current=b.touches[0].clientY)},L=b=>{if(!S||!b.changedTouches[0])return;const D=b.changedTouches[0].clientX,w=b.changedTouches[0].clientY,Y=D-l.current,I=w-y.current;(g==="right"&&Y>m||g==="left"&&Y<-m||g==="top"&&I<-m||g==="bottom"&&I>m)&&x()};return R.useEffect(()=>{o&&u(!1)},[o]),R.useEffect(()=>(o&&!d?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[o,d]),!o&&!d?null:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`drawer-overlay ${d?"fade-out":"fade-in"}`,onClick:x}),t.jsxs("div",{ref:p,className:`drawer drawer-${g} drawer-${C} ${d?"drawer-closing":"drawer-open"}`,onTouchStart:k,onTouchEnd:L,children:[t.jsxs("div",{className:`drawer-header ${a?"has-title":"no-title"}`,children:[a&&t.jsx("h2",{className:"drawer-title",children:a}),t.jsx("button",{className:"drawer-close",onClick:x,"aria-label":"Cerrar",children:"✕"})]}),t.jsx("div",{className:"drawer-content",children:i})]})]})},Pr="",er=je("modal-container",{variants:{size:{s:"modal-size-s",m:"modal-size-m",l:"modal-size-l"}},defaultVariants:{size:"m"}}),rr=({title:o,children:f,active:a,onClose:i,size:g})=>{const C=R.useRef(null);R.useEffect(()=>{const d=u=>{u.key==="Escape"&&i()};return a&&document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[a,i]);const S=d=>{C.current&&d.target===C.current&&i()};return a?t.jsx("div",{className:"modal-backdrop",ref:C,onClick:S,children:t.jsxs("div",{className:er({size:g}),children:[t.jsxs("div",{className:"modal-header",children:[t.jsx("h2",{children:o}),t.jsx("button",{className:"modal-close",onClick:i,"aria-label":"Cerrar",children:"×"})]}),t.jsx("hr",{className:"modal-divider"}),t.jsx("div",{className:"modal-content",children:f})]})}):null};W.Button=we,W.Drawer=qe,W.Modal=rr,W.Sidebar=Qe,W.buttonVariants=Ee,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|
33
33
|
//# sourceMappingURL=index.umd.js.map
|