naria-ui 0.1.48 → 0.1.49

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.
@@ -27,6 +27,7 @@ export interface props {
27
27
  listWrapper?: string;
28
28
  list?: string;
29
29
  option?: string;
30
+ mobileHeader?: string;
30
31
  };
31
32
  onSelectChange?: any;
32
33
  }
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react");function se(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const d=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(i,s,d.get?d:{enumerable:!0,get:()=>t[s]})}}return i.default=t,Object.freeze(i)}const P=se(l);var V={exports:{}},U={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react");function se(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const d=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(i,s,d.get?d:{enumerable:!0,get:()=>t[s]})}}return i.default=t,Object.freeze(i)}const P=se(l);var V={exports:{}},H={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.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 K;function ie(){if(K)return U;K=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(d,o,f){var g=null;if(f!==void 0&&(g=""+f),o.key!==void 0&&(g=""+o.key),"key"in o){f={};for(var m in o)m!=="key"&&(f[m]=o[m])}else f=o;return o=f.ref,{$$typeof:t,type:d,key:g,ref:o!==void 0?o:null,props:f}}return U.Fragment=i,U.jsx=s,U.jsxs=s,U}var H={};/**
9
+ */var K;function ie(){if(K)return H;K=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(d,o,f){var g=null;if(f!==void 0&&(g=""+f),o.key!==void 0&&(g=""+o.key),"key"in o){f={};for(var h in o)h!=="key"&&(f[h]=o[h])}else f=o;return o=f.ref,{$$typeof:t,type:d,key:g,ref:o!==void 0?o:null,props:f}}return H.Fragment=i,H.jsx=s,H.jsxs=s,H}var U={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,14 +14,14 @@
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 ee;function ce(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case S:return"Profiler";case q:return"StrictMode";case u:return"Suspense";case M:return"SuspenseList";case B:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case W:return"Portal";case G:return(e.displayName||"Context")+".Provider";case L:return(e._context.displayName||"Context")+".Consumer";case z:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return n=e.displayName||null,n!==null?n:t(e.type)||"Memo";case C:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function i(e){return""+e}function s(e){try{i(e);var n=!1}catch{n=!0}if(n){n=console;var c=n.error,r=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return c.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",r),i(e)}}function d(e){if(e===T)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===C)return"<...>";try{var n=t(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function o(){var e=v.A;return e===null?null:e.getOwner()}function f(){return Error("react-stack-top-frame")}function g(e){if(Y.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function m(e,n){function c(){y||(y=!0,console.error("%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://react.dev/link/special-props)",n))}c.isReactWarning=!0,Object.defineProperty(e,"key",{get:c,configurable:!0})}function x(){var e=t(this.type);return D[e]||(D[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function E(e,n,c,r,b,w,X,Z){return c=w.ref,e={$$typeof:I,type:e,key:n,props:w,_owner:b},(c!==void 0?c:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:x}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function $(e,n,c,r,b,w,X,Z){var p=n.children;if(p!==void 0)if(r)if(j(p)){for(r=0;r<p.length;r++)R(p[r]);Object.freeze&&Object.freeze(p)}else console.error("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 R(p);if(Y.call(n,"key")){p=t(e);var A=Object.keys(n).filter(function(oe){return oe!=="key"});r=0<A.length?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}",J[p+r]||(A=0<A.length?"{"+A.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var ee;function ce(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case S:return"Profiler";case q:return"StrictMode";case u:return"Suspense";case M:return"SuspenseList";case B:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case W:return"Portal";case G:return(e.displayName||"Context")+".Provider";case L:return(e._context.displayName||"Context")+".Consumer";case z:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return n=e.displayName||null,n!==null?n:t(e.type)||"Memo";case C:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function i(e){return""+e}function s(e){try{i(e);var n=!1}catch{n=!0}if(n){n=console;var c=n.error,r=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return c.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",r),i(e)}}function d(e){if(e===T)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===C)return"<...>";try{var n=t(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function o(){var e=b.A;return e===null?null:e.getOwner()}function f(){return Error("react-stack-top-frame")}function g(e){if(Y.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function h(e,n){function c(){y||(y=!0,console.error("%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://react.dev/link/special-props)",n))}c.isReactWarning=!0,Object.defineProperty(e,"key",{get:c,configurable:!0})}function x(){var e=t(this.type);return D[e]||(D[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function E(e,n,c,r,v,w,X,Z){return c=w.ref,e={$$typeof:I,type:e,key:n,props:w,_owner:v},(c!==void 0?c:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:x}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function $(e,n,c,r,v,w,X,Z){var p=n.children;if(p!==void 0)if(r)if(j(p)){for(r=0;r<p.length;r++)R(p[r]);Object.freeze&&Object.freeze(p)}else console.error("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 R(p);if(Y.call(n,"key")){p=t(e);var N=Object.keys(n).filter(function(oe){return oe!=="key"});r=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",J[p+r]||(N=0<N.length?"{"+N.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,r,p,A,p),J[p+r]=!0)}if(p=null,c!==void 0&&(s(c),p=""+c),g(n)&&(s(n.key),p=""+n.key),"key"in n){c={};for(var Q in n)Q!=="key"&&(c[Q]=n[Q])}else c=n;return p&&m(c,typeof e=="function"?e.displayName||e.name||"Unknown":e),E(e,p,w,b,o(),c,X,Z)}function R(e){typeof e=="object"&&e!==null&&e.$$typeof===I&&e._store&&(e._store.validated=1)}var h=l,I=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),G=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),v=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,j=Array.isArray,O=console.createTask?console.createTask:function(){return null};h={"react-stack-bottom-frame":function(e){return e()}};var y,D={},N=h["react-stack-bottom-frame"].bind(h,f)(),F=O(d(f)),J={};H.Fragment=T,H.jsx=function(e,n,c,r,b){var w=1e4>v.recentlyCreatedOwnerStacks++;return $(e,n,c,!1,r,b,w?Error("react-stack-top-frame"):N,w?O(d(e)):F)},H.jsxs=function(e,n,c,r,b){var w=1e4>v.recentlyCreatedOwnerStacks++;return $(e,n,c,!0,r,b,w?Error("react-stack-top-frame"):N,w?O(d(e)):F)}}()),H}var re;function le(){return re||(re=1,process.env.NODE_ENV==="production"?V.exports=ie():V.exports=ce()),V.exports}var a=le();const ue=({type:t="button",value:i})=>a.jsx("button",{type:t,children:i}),fe=({type:t="text",placeholder:i,classNames:s={wrapper:"",label:"",input:""},label:d,hasError:o,register:f,name:g,isDisabled:m=!1,autocomplete:x=!1,...E})=>a.jsxs("div",{className:`nariaInputWrapper ${s.wrapper}`,children:[a.jsxs("label",{htmlFor:g,className:`${s.label} ${o&&"nariaInputLabel-error"}`,children:[d,a.jsx("input",{disabled:m,autoComplete:x?"on":"off",id:g,...f,...E,type:t,name:g,className:`${s.input} ${o&&"nariaInput-error"}`,placeholder:i})]}),o&&a.jsx("p",{className:"nariaInputErrorText",children:o})]}),te=t=>P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor",...t},P.createElement("path",{fill:"currentColor",d:"M209.5 369c-9.4 9.4-24.6 9.4-33.9 0L15.5 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143 143-143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-160 160z"})),de=t=>P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor",...t},P.createElement("path",{fill:"currentColor",d:"M7.5 105c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l151 151 151-151c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-151 151 151 151c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-151-151-151 151c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l151-151-151-151z"})),ne=t=>P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",...t},P.createElement("path",{fill:"currentColor",d:"M368 208a160 160 0 1 0 -320 0 160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z"})),pe=()=>{const[t,i]=l.useState(typeof window<"u"?window.innerWidth:0),s=()=>i(typeof window<"u"?window.innerWidth:0);return l.useEffect(()=>(window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)),[t]),t},ae=({classNames:t={wrapper:"",color:""}})=>a.jsxs("svg",{className:`nariaLoading ${t.wrapper}`,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z",stroke:"currentColor",strokeWidth:"6",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("path",{d:"M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762",stroke:"currentColor",strokeWidth:"6",strokeLinecap:"round",strokeLinejoin:"round",className:t.color})]}),ge=()=>{const t=`${window.location.pathname}${window.location.search}`;window.history.replaceState(null,"",t)},me=t=>{window.location.hash=t},he=t=>{const[i,s]=l.useState(!1);return l.useEffect(()=>{const d=o=>{window.location.hash!==t?s(!0):s(!1)};return window.addEventListener("hashchange",d),()=>{window.removeEventListener("hashchange",d)}},[]),i},we=(t,i,s)=>{l.useEffect(()=>{function d(o){i.current&&!i.current.contains(o.target)&&t?.current&&!t?.current.contains(o.target)&&s()}return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[t,s])},ve=({options:t,label:i,hasError:s,title:d,value:o,api:f,selected:g,placeholder:m,disabled:x=!1,pagination:E,optionFilterLabel:$,hasSearch:R=!1,classNames:h={wrapper:"",label:"",title:"",button:"",input:"",listWrapper:"",list:"",option:""},onSelectChange:I})=>{let W=!0;const T=pe(),q=he("#select"),[S,L]=l.useState(!1),[G,z]=l.useState(!0),[u,M]=l.useState(null),[_,C]=l.useState(null),[B,k]=l.useState(""),[v,Y]=l.useState({page:1,pageLabel:"page",size:20,sizeLabel:"size",isLoading:!1}),j=l.useRef(void 0),O=l.useRef(void 0),y=l.useRef(void 0),D=async()=>{if(j?.current)try{const r=await fetch(j?.current);if(!r.ok)throw new Error(`Response status: ${r.status}`);return await r.json()}catch(r){console.error(r.message)}};l.useEffect(()=>()=>{W=!1},[]),l.useEffect(()=>{if(f?.length){if(j.current=f,j.current.includes(E?.pageLabel||"page")){const r=new URL(f);r.searchParams.set(E?.pageLabel||"page",(E?.page||v.page).toString()),r.searchParams.set(E?.sizeLabel||"size",(E?.size||v.size).toString()),j.current=r.href}z(!0),D().then(r=>{W&&(z(!1),C(r))})}},[f,E]),l.useEffect(()=>{if(v.isLoading){if(j.current.includes(E?.pageLabel||"page")){const r=new URL(j.current);r.searchParams.set(E?.pageLabel||"page",v.page.toString()),j.current=r.href}D().then(r=>{W&&(z(!1),Y({...v,isLoading:!1}),C([..._,...r]))})}},[v]),l.useEffect(()=>{T<768&&(S?(me("select"),document.body.style.overflow="hidden",y.current?.focus()):(window.location.hash&&!document.referrer.includes("#")&&ge(),document.body.style.overflow="auto"))},[S]),l.useEffect(()=>{g&&t?.length&&(t?.find(r=>r[i]===g)?M(t?.find(r=>r[i]===g)):M(g))},[g]),l.useEffect(()=>{u&&R&&(o?.length&&_?.find(r=>r[i]===u[i])?k(_?.find(r=>r[i]===u[i])[o]||""):k(u))},[u]),l.useEffect(()=>{q&&L(!1)},[q]),l.useEffect(()=>{t?.length&&C(t)},[t]);const N=()=>{R&&C(t),L(r=>!r)},F=()=>{R&&(C(t),k(typeof u=="string"?u:u?u[o]:"")),L(!1)},J=r=>{R&&(o?.length?k(r[o]):k(r)),M(r),N(),I&&I(r)},e=r=>{if(!u)return"";if(i?.length&&r[i]===u[i]||r===u)return"bg-grey-100"},n=r=>{f?.length&&_?.length&&!v.isLoading&&r.target.offsetHeight+r.target.scrollTop>=r.target.scrollHeight-100&&Y({page:v.page+1,isLoading:!0})},c=r=>{const b=r?.target?.value?.length?t.filter(w=>typeof w=="object"?w[$?.length?$:o].includes(r?.target?.value):w.includes(r?.target?.value)):t;C(b),k(r?.target?.value),S||L(!0)};return we(O,y,F),a.jsxs("div",{className:`nariaSelect ${x?"nariaSelect-disabled":""} ${h?.wrapper}`,"data-prop":"wrapper",children:[a.jsxs("label",{className:`cursor-pointer
22
+ <%s key={someKey} {...props} />`,r,p,N,p),J[p+r]=!0)}if(p=null,c!==void 0&&(s(c),p=""+c),g(n)&&(s(n.key),p=""+n.key),"key"in n){c={};for(var Q in n)Q!=="key"&&(c[Q]=n[Q])}else c=n;return p&&h(c,typeof e=="function"?e.displayName||e.name||"Unknown":e),E(e,p,w,v,o(),c,X,Z)}function R(e){typeof e=="object"&&e!==null&&e.$$typeof===I&&e._store&&(e._store.validated=1)}var m=l,I=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),G=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),b=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,j=Array.isArray,O=console.createTask?console.createTask:function(){return null};m={"react-stack-bottom-frame":function(e){return e()}};var y,D={},A=m["react-stack-bottom-frame"].bind(m,f)(),F=O(d(f)),J={};U.Fragment=T,U.jsx=function(e,n,c,r,v){var w=1e4>b.recentlyCreatedOwnerStacks++;return $(e,n,c,!1,r,v,w?Error("react-stack-top-frame"):A,w?O(d(e)):F)},U.jsxs=function(e,n,c,r,v){var w=1e4>b.recentlyCreatedOwnerStacks++;return $(e,n,c,!0,r,v,w?Error("react-stack-top-frame"):A,w?O(d(e)):F)}}()),U}var re;function le(){return re||(re=1,process.env.NODE_ENV==="production"?V.exports=ie():V.exports=ce()),V.exports}var a=le();const ue=({type:t="button",value:i})=>a.jsx("button",{type:t,children:i}),fe=({type:t="text",placeholder:i,classNames:s={wrapper:"",label:"",input:""},label:d,hasError:o,register:f,name:g,isDisabled:h=!1,autocomplete:x=!1,...E})=>a.jsxs("div",{className:`nariaInputWrapper ${s.wrapper}`,children:[a.jsxs("label",{htmlFor:g,className:`${s.label} ${o&&"nariaInputLabel-error"}`,children:[d,a.jsx("input",{disabled:h,autoComplete:x?"on":"off",id:g,...f,...E,type:t,name:g,className:`${s.input} ${o&&"nariaInput-error"}`,placeholder:i})]}),o&&a.jsx("p",{className:"nariaInputErrorText",children:o})]}),te=t=>P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor",...t},P.createElement("path",{fill:"currentColor",d:"M209.5 369c-9.4 9.4-24.6 9.4-33.9 0L15.5 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143 143-143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-160 160z"})),de=t=>P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor",...t},P.createElement("path",{fill:"currentColor",d:"M7.5 105c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l151 151 151-151c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-151 151 151 151c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-151-151-151 151c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l151-151-151-151z"})),ne=t=>P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",...t},P.createElement("path",{fill:"currentColor",d:"M368 208a160 160 0 1 0 -320 0 160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z"})),pe=()=>{const[t,i]=l.useState(typeof window<"u"?window.innerWidth:0),s=()=>i(typeof window<"u"?window.innerWidth:0);return l.useEffect(()=>(window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)),[t]),t},ae=({classNames:t={wrapper:"",color:""}})=>a.jsxs("svg",{className:`nariaLoading ${t.wrapper}`,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z",stroke:"currentColor",strokeWidth:"6",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("path",{d:"M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762",stroke:"currentColor",strokeWidth:"6",strokeLinecap:"round",strokeLinejoin:"round",className:t.color})]}),ge=()=>{const t=`${window.location.pathname}${window.location.search}`;window.history.replaceState(null,"",t)},me=t=>{window.location.hash=t},he=t=>{const[i,s]=l.useState(!1);return l.useEffect(()=>{const d=o=>{window.location.hash!==t?s(!0):s(!1)};return window.addEventListener("hashchange",d),()=>{window.removeEventListener("hashchange",d)}},[]),i},we=(t,i,s)=>{l.useEffect(()=>{function d(o){i.current&&!i.current.contains(o.target)&&t?.current&&!t?.current.contains(o.target)&&s()}return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[t,s])},be=({options:t,label:i,hasError:s,title:d,value:o,api:f,selected:g,placeholder:h,disabled:x=!1,pagination:E,optionFilterLabel:$,hasSearch:R=!1,classNames:m={wrapper:"",label:"",title:"",button:"",input:"",listWrapper:"",list:"",option:"",mobileHeader:""},onSelectChange:I})=>{let W=!0;const T=pe(),q=he("#select"),[S,L]=l.useState(!1),[G,z]=l.useState(!0),[u,M]=l.useState(null),[_,C]=l.useState(null),[B,k]=l.useState(""),[b,Y]=l.useState({page:1,pageLabel:"page",size:20,sizeLabel:"size",isLoading:!1}),j=l.useRef(void 0),O=l.useRef(void 0),y=l.useRef(void 0),D=async()=>{if(j?.current)try{const r=await fetch(j?.current);if(!r.ok)throw new Error(`Response status: ${r.status}`);return await r.json()}catch(r){console.error(r.message)}};l.useEffect(()=>()=>{W=!1},[]),l.useEffect(()=>{if(f?.length){if(j.current=f,j.current.includes(E?.pageLabel||"page")){const r=new URL(f);r.searchParams.set(E?.pageLabel||"page",(E?.page||b.page).toString()),r.searchParams.set(E?.sizeLabel||"size",(E?.size||b.size).toString()),j.current=r.href}z(!0),D().then(r=>{W&&(z(!1),C(r))})}},[f,E]),l.useEffect(()=>{if(b.isLoading){if(j.current.includes(E?.pageLabel||"page")){const r=new URL(j.current);r.searchParams.set(E?.pageLabel||"page",b.page.toString()),j.current=r.href}D().then(r=>{W&&(z(!1),Y({...b,isLoading:!1}),C([..._,...r]))})}},[b]),l.useEffect(()=>{T<768&&(S?(me("select"),document.body.style.overflow="hidden",y.current?.focus()):(window.location.hash&&!document.referrer.includes("#")&&ge(),document.body.style.overflow="auto"))},[S]),l.useEffect(()=>{g&&t?.length&&(t?.find(r=>r[i]===g)?M(t?.find(r=>r[i]===g)):M(g))},[g]),l.useEffect(()=>{u&&R&&(o?.length&&_?.find(r=>r[i]===u[i])?k(_?.find(r=>r[i]===u[i])[o]||""):k(u))},[u]),l.useEffect(()=>{q&&L(!1)},[q]),l.useEffect(()=>{t?.length&&C(t)},[t]);const A=()=>{R&&C(t),L(r=>!r)},F=()=>{R&&(C(t),k(typeof u=="string"?u:u?u[o]:"")),L(!1)},J=r=>{R&&(o?.length?k(r[o]):k(r)),M(r),A(),I&&I(r)},e=r=>{if(!u)return"";if(i?.length&&r[i]===u[i]||r===u)return"bg-grey-100"},n=r=>{f?.length&&_?.length&&!b.isLoading&&r.target.offsetHeight+r.target.scrollTop>=r.target.scrollHeight-100&&Y({page:b.page+1,isLoading:!0})},c=r=>{const v=r?.target?.value?.length?t.filter(w=>typeof w=="object"?w[$?.length?$:o].includes(r?.target?.value):w.includes(r?.target?.value)):t;C(v),k(r?.target?.value),S||L(!0)};return we(O,y,F),a.jsxs("div",{className:`nariaSelect ${x?"nariaSelect-disabled":""} ${m?.wrapper}`,"data-prop":"wrapper",children:[a.jsxs("label",{className:`cursor-pointer
23
23
  ${s&&"!text-danger-100"}
24
- ${h?.label}`,"data-prop":"label",children:[a.jsx("span",{className:h?.title,"data-prop":"title",children:d}),R?a.jsxs("div",{className:"nariaSearchInput",children:[a.jsx("input",{ref:y,placeholder:m?.length?m:"Select",className:`${u?"text-dark-100":"text-grey-300"}
25
- ${s&&"!border-danger-100 focus:border-danger-100 outline-danger-100"} ${h?.input}`,value:B,disabled:x,type:"text",onClick:N,onChange:c,"data-prop":"input"}),S?a.jsx(ne,{className:"nariaSearchIcon"}):a.jsx(te,{className:`nariaArrowIcon ${S?"nariaArrowIcon-rotate-180":""}`})]}):a.jsxs("button",{type:"button",ref:y,disabled:x,className:`nariaHandler ${u?"text-dark-100":"text-grey-300"}
26
- ${s&&"!border-danger-100 focus:border-danger-100 outline-danger-100"} ${h?.button}`,"data-prop":"button",onClick:N,children:[u?o?.length?u[o]:u:m?.length?m:"Select"," ",a.jsx(te,{className:`nariaArrowIcon ${S?"nariaArrowIcon-rotate-180":""}`})]})]}),S?a.jsx("div",{className:`nariaListWrapper ${T<768?"nariaListWrapper-mobile":""} ${h?.listWrapper}`,"data-prop":"listWrapper",ref:O,children:a.jsx("div",{className:`nariaList ${T<768?"nariaList-mobile":"nariaList-desktop"} ${h?.list}`,"data-prop":"input",onScroll:n,children:f&&G?a.jsx("div",{className:"nariaLoadingWrapper",children:a.jsx(ae,{})}):a.jsxs(a.Fragment,{children:[T<768?a.jsxs("div",{className:"nariaSelectMobileHeader",children:[R?a.jsxs("div",{className:"nariaSearchInput",children:[a.jsx("input",{ref:y,placeholder:m?.length?m:"Select",className:`${u?"text-dark-100":"text-grey-300"}
27
- ${s&&"!border-danger-100 focus:border-danger-100 outline-danger-100"} ${h?.input}`,"data-prop":"input",value:B,disabled:x,type:"text",onChange:c}),a.jsx(ne,{className:"nariaSearchIcon"})]}):void 0,a.jsx("button",{className:"p-3",onClick:F,disabled:x,children:a.jsx(de,{className:"w-6"})})]}):void 0,_?.length?a.jsx(a.Fragment,{children:_?.map((r,b)=>a.jsx("button",{type:"button",onClick:()=>J(r),disabled:x,className:`${h?.option} ${e(r)}`,"data-prop":"option",children:o?.length?r[o]:r},b.toString()))}):a.jsx("div",{children:"No Data"}),v.isLoading?a.jsx("div",{className:"nariaLoadingMoreWrapper",children:a.jsx(ae,{})}):void 0]})})}):void 0,s&&a.jsx("p",{className:"text-xs mt-1 text-danger-100",children:s})]})};function be(t){return t.charAt(0).toUpperCase()+t.slice(1)}exports.Button=ue;exports.Input=fe;exports.Select=ve;exports.capitalize=be;
24
+ ${m?.label}`,"data-prop":"label",children:[a.jsx("span",{className:m?.title,"data-prop":"title",children:d}),R?a.jsxs("div",{className:"nariaSearchInput",children:[a.jsx("input",{ref:y,placeholder:h?.length?h:"Select",className:`${u?"text-dark-100":"text-grey-300"}
25
+ ${s&&"!border-danger-100 focus:border-danger-100 outline-danger-100"} ${m?.input}`,value:B,disabled:x,type:"text",onClick:A,onChange:c,"data-prop":"input"}),S?a.jsx(ne,{className:"nariaSearchIcon"}):a.jsx(te,{className:`nariaArrowIcon ${S?"nariaArrowIcon-rotate-180":""}`})]}):a.jsxs("button",{type:"button",ref:y,disabled:x,className:`nariaHandler ${u?"text-dark-100":"text-grey-300"}
26
+ ${s&&"!border-danger-100 focus:border-danger-100 outline-danger-100"} ${m?.button}`,"data-prop":"button",onClick:A,children:[u?o?.length?u[o]:u:h?.length?h:"Select"," ",a.jsx(te,{className:`nariaArrowIcon ${S?"nariaArrowIcon-rotate-180":""}`})]})]}),S?a.jsx("div",{className:`nariaListWrapper ${T<768?"nariaListWrapper-mobile":""} ${m?.listWrapper}`,"data-prop":"listWrapper",ref:O,children:a.jsx("div",{className:`nariaList ${T<768?"nariaList-mobile":"nariaList-desktop"} ${m?.list}`,"data-prop":"input",onScroll:n,children:f&&G?a.jsx("div",{className:"nariaLoadingWrapper",children:a.jsx(ae,{})}):a.jsxs(a.Fragment,{children:[T<768?a.jsxs("div",{className:`nariaSelectMobileHeader ${m?.mobileHeader}`,"data-prop":"mobileHeader",children:[R?a.jsxs("div",{className:"nariaSearchInput",children:[a.jsx("input",{ref:y,placeholder:h?.length?h:"Select",className:`${u?"text-dark-100":"text-grey-300"}
27
+ ${s&&"!border-danger-100 focus:border-danger-100 outline-danger-100"} ${m?.input}`,"data-prop":"input",value:B,disabled:x,type:"text",onChange:c}),a.jsx(ne,{className:"nariaSearchIcon"})]}):void 0,a.jsx("button",{className:"p-3",onClick:F,disabled:x,children:a.jsx(de,{className:"w-6"})})]}):void 0,_?.length?a.jsx(a.Fragment,{children:_?.map((r,v)=>a.jsx("button",{type:"button",onClick:()=>J(r),disabled:x,className:`${m?.option} ${e(r)}`,"data-prop":"option",children:o?.length?r[o]:r},v.toString()))}):a.jsx("div",{children:"No Data"}),b.isLoading?a.jsx("div",{className:"nariaLoadingMoreWrapper",children:a.jsx(ae,{})}):void 0]})})}):void 0,s&&a.jsx("p",{className:"text-xs mt-1 text-danger-100",children:s})]})};function ve(t){return t.charAt(0).toUpperCase()+t.slice(1)}exports.Button=ue;exports.Input=fe;exports.Select=be;exports.capitalize=ve;
@@ -1,6 +1,6 @@
1
- import * as $ from "react";
1
+ import * as P from "react";
2
2
  import ce, { useState as y, useEffect as x, useRef as ee } from "react";
3
- var G = { exports: {} }, H = {};
3
+ var G = { exports: {} }, U = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.js
@@ -12,15 +12,15 @@ var G = { exports: {} }, H = {};
12
12
  */
13
13
  var re;
14
14
  function le() {
15
- if (re) return H;
15
+ if (re) return U;
16
16
  re = 1;
17
17
  var t = Symbol.for("react.transitional.element"), i = Symbol.for("react.fragment");
18
18
  function c(f, o, u) {
19
19
  var p = null;
20
20
  if (u !== void 0 && (p = "" + u), o.key !== void 0 && (p = "" + o.key), "key" in o) {
21
21
  u = {};
22
- for (var g in o)
23
- g !== "key" && (u[g] = o[g]);
22
+ for (var m in o)
23
+ m !== "key" && (u[m] = o[m]);
24
24
  } else u = o;
25
25
  return o = u.ref, {
26
26
  $$typeof: t,
@@ -30,7 +30,7 @@ function le() {
30
30
  props: u
31
31
  };
32
32
  }
33
- return H.Fragment = i, H.jsx = c, H.jsxs = c, H;
33
+ return U.Fragment = i, U.jsx = c, U.jsxs = c, U;
34
34
  }
35
35
  var J = {};
36
36
  /**
@@ -133,7 +133,7 @@ function ue() {
133
133
  }
134
134
  return e.key !== void 0;
135
135
  }
136
- function g(e, n) {
136
+ function m(e, n) {
137
137
  function s() {
138
138
  L || (L = !0, console.error(
139
139
  "%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://react.dev/link/special-props)",
@@ -198,10 +198,10 @@ function ue() {
198
198
  else j(d);
199
199
  if (D.call(n, "key")) {
200
200
  d = t(e);
201
- var P = Object.keys(n).filter(function(ie) {
201
+ var $ = Object.keys(n).filter(function(ie) {
202
202
  return ie !== "key";
203
203
  });
204
- r = 0 < P.length ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}", V[d + r] || (P = 0 < P.length ? "{" + P.join(": ..., ") + ": ...}" : "{}", console.error(
204
+ r = 0 < $.length ? "{key: someKey, " + $.join(": ..., ") + ": ...}" : "{key: someKey}", V[d + r] || ($ = 0 < $.length ? "{" + $.join(": ..., ") + ": ...}" : "{}", console.error(
205
205
  `A props object containing a "key" prop is being spread into JSX:
206
206
  let props = %s;
207
207
  <%s {...props} />
@@ -210,7 +210,7 @@ React keys must be passed directly to JSX without using spread:
210
210
  <%s key={someKey} {...props} />`,
211
211
  r,
212
212
  d,
213
- P,
213
+ $,
214
214
  d
215
215
  ), V[d + r] = !0);
216
216
  }
@@ -219,7 +219,7 @@ React keys must be passed directly to JSX without using spread:
219
219
  for (var K in n)
220
220
  K !== "key" && (s[K] = n[K]);
221
221
  } else s = n;
222
- return d && g(
222
+ return d && m(
223
223
  s,
224
224
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
225
225
  ), b(
@@ -236,18 +236,18 @@ React keys must be passed directly to JSX without using spread:
236
236
  function j(e) {
237
237
  typeof e == "object" && e !== null && e.$$typeof === W && e._store && (e._store.validated = 1);
238
238
  }
239
- var m = ce, W = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), X = Symbol.for("react.context"), Y = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), B = Symbol.for("react.activity"), S = Symbol.for("react.client.reference"), w = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, D = Object.prototype.hasOwnProperty, R = Array.isArray, N = console.createTask ? console.createTask : function() {
239
+ var g = ce, W = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), X = Symbol.for("react.context"), Y = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), B = Symbol.for("react.activity"), S = Symbol.for("react.client.reference"), w = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, D = Object.prototype.hasOwnProperty, R = Array.isArray, N = console.createTask ? console.createTask : function() {
240
240
  return null;
241
241
  };
242
- m = {
242
+ g = {
243
243
  "react-stack-bottom-frame": function(e) {
244
244
  return e();
245
245
  }
246
246
  };
247
- var L, F = {}, O = m["react-stack-bottom-frame"].bind(
248
- m,
247
+ var L, F = {}, O = g["react-stack-bottom-frame"].bind(
248
+ g,
249
249
  u
250
- )(), U = N(f(u)), V = {};
250
+ )(), H = N(f(u)), V = {};
251
251
  J.Fragment = _, J.jsx = function(e, n, s, r, v) {
252
252
  var h = 1e4 > w.recentlyCreatedOwnerStacks++;
253
253
  return I(
@@ -258,7 +258,7 @@ React keys must be passed directly to JSX without using spread:
258
258
  r,
259
259
  v,
260
260
  h ? Error("react-stack-top-frame") : O,
261
- h ? N(f(e)) : U
261
+ h ? N(f(e)) : H
262
262
  );
263
263
  }, J.jsxs = function(e, n, s, r, v) {
264
264
  var h = 1e4 > w.recentlyCreatedOwnerStacks++;
@@ -270,7 +270,7 @@ React keys must be passed directly to JSX without using spread:
270
270
  r,
271
271
  v,
272
272
  h ? Error("react-stack-top-frame") : O,
273
- h ? N(f(e)) : U
273
+ h ? N(f(e)) : H
274
274
  );
275
275
  };
276
276
  }()), J;
@@ -292,7 +292,7 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
292
292
  hasError: o,
293
293
  register: u,
294
294
  name: p,
295
- isDisabled: g = !1,
295
+ isDisabled: m = !1,
296
296
  autocomplete: E = !1,
297
297
  ...b
298
298
  }) => /* @__PURE__ */ a.jsxs("div", { className: `nariaInputWrapper ${c.wrapper}`, children: [
@@ -306,7 +306,7 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
306
306
  /* @__PURE__ */ a.jsx(
307
307
  "input",
308
308
  {
309
- disabled: g,
309
+ disabled: m,
310
310
  autoComplete: E ? "on" : "off",
311
311
  id: p,
312
312
  ...u,
@@ -321,7 +321,7 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
321
321
  }
322
322
  ),
323
323
  o && /* @__PURE__ */ a.jsx("p", { className: "nariaInputErrorText", children: o })
324
- ] }), ae = (t) => /* @__PURE__ */ $.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", fill: "currentColor", ...t }, /* @__PURE__ */ $.createElement("path", { fill: "currentColor", d: "M209.5 369c-9.4 9.4-24.6 9.4-33.9 0L15.5 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143 143-143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-160 160z" })), fe = (t) => /* @__PURE__ */ $.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", fill: "currentColor", ...t }, /* @__PURE__ */ $.createElement("path", { fill: "currentColor", d: "M7.5 105c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l151 151 151-151c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-151 151 151 151c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-151-151-151 151c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l151-151-151-151z" })), oe = (t) => /* @__PURE__ */ $.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", fill: "currentColor", ...t }, /* @__PURE__ */ $.createElement("path", { fill: "currentColor", d: "M368 208a160 160 0 1 0 -320 0 160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z" })), pe = () => {
324
+ ] }), ae = (t) => /* @__PURE__ */ P.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", fill: "currentColor", ...t }, /* @__PURE__ */ P.createElement("path", { fill: "currentColor", d: "M209.5 369c-9.4 9.4-24.6 9.4-33.9 0L15.5 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143 143-143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-160 160z" })), fe = (t) => /* @__PURE__ */ P.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", fill: "currentColor", ...t }, /* @__PURE__ */ P.createElement("path", { fill: "currentColor", d: "M7.5 105c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l151 151 151-151c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-151 151 151 151c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-151-151-151 151c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l151-151-151-151z" })), oe = (t) => /* @__PURE__ */ P.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", fill: "currentColor", ...t }, /* @__PURE__ */ P.createElement("path", { fill: "currentColor", d: "M368 208a160 160 0 1 0 -320 0 160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z" })), pe = () => {
325
325
  const [t, i] = y(typeof window < "u" ? window.innerWidth : 0), c = () => i(typeof window < "u" ? window.innerWidth : 0);
326
326
  return x(() => (window.addEventListener("resize", c), () => window.removeEventListener("resize", c)), [t]), t;
327
327
  }, se = ({
@@ -392,12 +392,12 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
392
392
  value: o,
393
393
  api: u,
394
394
  selected: p,
395
- placeholder: g,
395
+ placeholder: m,
396
396
  disabled: E = !1,
397
397
  pagination: b,
398
398
  optionFilterLabel: I,
399
399
  hasSearch: j = !1,
400
- classNames: m = {
400
+ classNames: g = {
401
401
  wrapper: "",
402
402
  label: "",
403
403
  title: "",
@@ -405,7 +405,8 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
405
405
  input: "",
406
406
  listWrapper: "",
407
407
  list: "",
408
- option: ""
408
+ option: "",
409
+ mobileHeader: ""
409
410
  },
410
411
  onSelectChange: W
411
412
  }) => {
@@ -468,7 +469,7 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
468
469
  }, [t]);
469
470
  const O = () => {
470
471
  j && k(t), A((r) => !r);
471
- }, U = () => {
472
+ }, H = () => {
472
473
  j && (k(t), S(typeof l == "string" ? l : l ? l[o] : "")), A(!1);
473
474
  }, V = (r) => {
474
475
  j && (o?.length ? S(r[o]) : S(r)), M(r), O(), W && W(r);
@@ -486,10 +487,10 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
486
487
  const v = r?.target?.value?.length ? t.filter((h) => typeof h == "object" ? h[I?.length ? I : o].includes(r?.target?.value) : h.includes(r?.target?.value)) : t;
487
488
  k(v), S(r?.target?.value), C || A(!0);
488
489
  };
489
- return we(N, L, U), /* @__PURE__ */ a.jsxs(
490
+ return we(N, L, H), /* @__PURE__ */ a.jsxs(
490
491
  "div",
491
492
  {
492
- className: `nariaSelect ${E ? "nariaSelect-disabled" : ""} ${m?.wrapper}`,
493
+ className: `nariaSelect ${E ? "nariaSelect-disabled" : ""} ${g?.wrapper}`,
493
494
  "data-prop": "wrapper",
494
495
  children: [
495
496
  /* @__PURE__ */ a.jsxs(
@@ -497,18 +498,18 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
497
498
  {
498
499
  className: `cursor-pointer
499
500
  ${c && "!text-danger-100"}
500
- ${m?.label}`,
501
+ ${g?.label}`,
501
502
  "data-prop": "label",
502
503
  children: [
503
- /* @__PURE__ */ a.jsx("span", { className: m?.title, "data-prop": "title", children: f }),
504
+ /* @__PURE__ */ a.jsx("span", { className: g?.title, "data-prop": "title", children: f }),
504
505
  j ? /* @__PURE__ */ a.jsxs("div", { className: "nariaSearchInput", children: [
505
506
  /* @__PURE__ */ a.jsx(
506
507
  "input",
507
508
  {
508
509
  ref: L,
509
- placeholder: g?.length ? g : "Select",
510
+ placeholder: m?.length ? m : "Select",
510
511
  className: `${l ? "text-dark-100" : "text-grey-300"}
511
- ${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"} ${m?.input}`,
512
+ ${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"} ${g?.input}`,
512
513
  value: B,
513
514
  disabled: E,
514
515
  type: "text",
@@ -535,11 +536,11 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
535
536
  ref: L,
536
537
  disabled: E,
537
538
  className: `nariaHandler ${l ? "text-dark-100" : "text-grey-300"}
538
- ${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"} ${m?.button}`,
539
+ ${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"} ${g?.button}`,
539
540
  "data-prop": "button",
540
541
  onClick: O,
541
542
  children: [
542
- l ? o?.length ? l[o] : l : g?.length ? g : "Select",
543
+ l ? o?.length ? l[o] : l : m?.length ? m : "Select",
543
544
  " ",
544
545
  /* @__PURE__ */ a.jsx(
545
546
  ae,
@@ -556,25 +557,25 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
556
557
  C ? /* @__PURE__ */ a.jsx(
557
558
  "div",
558
559
  {
559
- className: `nariaListWrapper ${_ < 768 ? "nariaListWrapper-mobile" : ""} ${m?.listWrapper}`,
560
+ className: `nariaListWrapper ${_ < 768 ? "nariaListWrapper-mobile" : ""} ${g?.listWrapper}`,
560
561
  "data-prop": "listWrapper",
561
562
  ref: N,
562
563
  children: /* @__PURE__ */ a.jsx(
563
564
  "div",
564
565
  {
565
- className: `nariaList ${_ < 768 ? "nariaList-mobile" : "nariaList-desktop"} ${m?.list}`,
566
+ className: `nariaList ${_ < 768 ? "nariaList-mobile" : "nariaList-desktop"} ${g?.list}`,
566
567
  "data-prop": "input",
567
568
  onScroll: n,
568
569
  children: u && X ? /* @__PURE__ */ a.jsx("div", { className: "nariaLoadingWrapper", children: /* @__PURE__ */ a.jsx(se, {}) }) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
569
- _ < 768 ? /* @__PURE__ */ a.jsxs("div", { className: "nariaSelectMobileHeader", children: [
570
+ _ < 768 ? /* @__PURE__ */ a.jsxs("div", { className: `nariaSelectMobileHeader ${g?.mobileHeader}`, "data-prop": "mobileHeader", children: [
570
571
  j ? /* @__PURE__ */ a.jsxs("div", { className: "nariaSearchInput", children: [
571
572
  /* @__PURE__ */ a.jsx(
572
573
  "input",
573
574
  {
574
575
  ref: L,
575
- placeholder: g?.length ? g : "Select",
576
+ placeholder: m?.length ? m : "Select",
576
577
  className: `${l ? "text-dark-100" : "text-grey-300"}
577
- ${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"} ${m?.input}`,
578
+ ${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"} ${g?.input}`,
578
579
  "data-prop": "input",
579
580
  value: B,
580
581
  disabled: E,
@@ -589,7 +590,7 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
589
590
  }
590
591
  )
591
592
  ] }) : void 0,
592
- /* @__PURE__ */ a.jsx("button", { className: "p-3", onClick: U, disabled: E, children: /* @__PURE__ */ a.jsx(fe, { className: "w-6" }) })
593
+ /* @__PURE__ */ a.jsx("button", { className: "p-3", onClick: H, disabled: E, children: /* @__PURE__ */ a.jsx(fe, { className: "w-6" }) })
593
594
  ] }) : void 0,
594
595
  T?.length ? /* @__PURE__ */ a.jsx(a.Fragment, { children: T?.map((r, v) => /* @__PURE__ */ a.jsx(
595
596
  "button",
@@ -597,7 +598,7 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
597
598
  type: "button",
598
599
  onClick: () => V(r),
599
600
  disabled: E,
600
- className: `${m?.option} ${e(r)}`,
601
+ className: `${g?.option} ${e(r)}`,
601
602
  "data-prop": "option",
602
603
  children: o?.length ? r[o] : r
603
604
  },
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "Mohammad Mehdi Mohammadi",
6
6
  "url": ""
7
7
  },
8
- "version": "0.1.48",
8
+ "version": "0.1.49",
9
9
  "type": "module",
10
10
  "main": "dist/naria-ui.cjs.js",
11
11
  "module": "dist/naria-ui.es.js",