naria-ui 0.1.49 → 0.1.51

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.
@@ -1,6 +1,16 @@
1
- import { default as React, FC } from 'react';
1
+ import { default as React, FC, ReactNode } from 'react';
2
2
  export interface props extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
3
3
  type?: "button" | "submit";
4
+ classNames?: {
5
+ button: string;
6
+ loading: {
7
+ wrapper: string;
8
+ color: string;
9
+ };
10
+ };
4
11
  value: string;
12
+ isLoading?: boolean;
13
+ isDisabled?: boolean;
14
+ icon?: ReactNode;
5
15
  }
6
16
  export declare const Button: FC<props>;
@@ -5,6 +5,7 @@ export interface props {
5
5
  wrapper?: string;
6
6
  label?: string;
7
7
  input?: string;
8
+ errorText?: string;
8
9
  };
9
10
  placeholder: string;
10
11
  label: string;
@@ -27,6 +27,7 @@ export interface props {
27
27
  listWrapper?: string;
28
28
  list?: string;
29
29
  option?: string;
30
+ optionActive?: string;
30
31
  mobileHeader?: string;
31
32
  };
32
33
  onSelectChange?: any;
package/dist/light.css ADDED
@@ -0,0 +1 @@
1
+ .test{color:red}.test.x{background-color:#ff0}.test .y{color:blue}
@@ -0,0 +1,9 @@
1
+ .test {
2
+ color: red;
3
+ &.x {
4
+ background-color: yellow;
5
+ }
6
+ & .y {
7
+ color: blue;
8
+ }
9
+ }
@@ -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:{}},H={};/**
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 o in t)if(o!=="default"){const d=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(i,o,d.get?d:{enumerable:!0,get:()=>t[o]})}}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 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={};/**
9
+ */var ee;function ie(){if(ee)return H;ee=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function o(d,s,u){var p=null;if(u!==void 0&&(p=""+u),s.key!==void 0&&(p=""+s.key),"key"in s){u={};for(var h in s)h!=="key"&&(u[h]=s[h])}else u=s;return s=u.ref,{$$typeof:t,type:d,key:p,ref:s!==void 0?s:null,props:u}}return H.Fragment=i,H.jsx=o,H.jsxs=o,H}var U={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,14 +14,13 @@
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=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:
17
+ */var re;function ce(){return re||(re=1,process.env.NODE_ENV!=="production"&&function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===T?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case R:return"Profiler";case B:return"StrictMode";case f:return"Suspense";case M:return"SuspenseList";case q: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 O: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 o(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===k)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===C)return"<...>";try{var n=t(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function s(){var e=v.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function p(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(){L||(L=!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 E(){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 x(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:E}):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 N(e,n,c,r,b,w,X,Z){var m=n.children;if(m!==void 0)if(r)if(j(m)){for(r=0;r<m.length;r++)S(m[r]);Object.freeze&&Object.freeze(m)}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 S(m);if(Y.call(n,"key")){m=t(e);var $=Object.keys(n).filter(function(oe){return oe!=="key"});r=0<$.length?"{key: someKey, "+$.join(": ..., ")+": ...}":"{key: someKey}",J[m+r]||($=0<$.length?"{"+$.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,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
- ${s&&"!text-danger-100"}
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;
22
+ <%s key={someKey} {...props} />`,r,m,$,m),J[m+r]=!0)}if(m=null,c!==void 0&&(o(c),m=""+c),p(n)&&(o(n.key),m=""+n.key),"key"in n){c={};for(var Q in n)Q!=="key"&&(c[Q]=n[Q])}else c=n;return m&&h(c,typeof e=="function"?e.displayName||e.name||"Unknown":e),x(e,m,w,b,s(),c,X,Z)}function S(e){typeof e=="object"&&e!==null&&e.$$typeof===I&&e._store&&(e._store.validated=1)}var g=l,I=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),G=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),T=Symbol.for("react.client.reference"),v=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,j=Array.isArray,y=console.createTask?console.createTask:function(){return null};g={"react-stack-bottom-frame":function(e){return e()}};var L,D={},A=g["react-stack-bottom-frame"].bind(g,u)(),F=y(d(u)),J={};U.Fragment=k,U.jsx=function(e,n,c,r,b){var w=1e4>v.recentlyCreatedOwnerStacks++;return N(e,n,c,!1,r,b,w?Error("react-stack-top-frame"):A,w?y(d(e)):F)},U.jsxs=function(e,n,c,r,b){var w=1e4>v.recentlyCreatedOwnerStacks++;return N(e,n,c,!0,r,b,w?Error("react-stack-top-frame"):A,w?y(d(e)):F)}}()),U}var te;function le(){return te||(te=1,process.env.NODE_ENV==="production"?V.exports=ie():V.exports=ce()),V.exports}var a=le();const K=({classNames:t={wrapper:"",color:""}})=>a.jsxs("svg",{className:`nariaLoading ${t.wrapper}`,"data-prop":"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,"data-prop":"color"})]}),ue=({type:t="button",classNames:i={button:"",loading:{wrapper:"",color:""}},value:o,icon:d=null,isLoading:s=!1,isDisabled:u=!1,...p})=>a.jsxs("button",{type:t,disabled:u,...p,className:`nariaButton ${u?"nariaButton-disabled":""} ${i?.button}`,"data-prop":"button",children:[s?a.jsx(K,{classNames:{wrapper:i.loading.wrapper,color:i.loading.color},"data-prop-wrapper":"wrapper","data-prop-color":"color"}):d,o]}),de=({type:t="text",placeholder:i,classNames:o={wrapper:"",label:"",input:"",errorText:""},label:d,hasError:s,register:u,name:p,isDisabled:h=!1,autocomplete:E=!1,...x})=>a.jsxs("div",{className:`nariaInputWrapper ${o.wrapper}`,"data-prop":"wrapper",children:[a.jsxs("label",{htmlFor:p,className:`${o.label} ${s&&"nariaInputLabel-error"}`,"data-prop":"label",children:[d,a.jsx("input",{disabled:h,autoComplete:E?"on":"off",id:p,...u,...x,type:t,name:p,className:`${o.input} ${s&&"nariaInput-error"}`,placeholder:i,"data-prop":"input"})]}),s&&a.jsx("p",{className:`nariaInputErrorText ${o?.errorText}`,"data-prop":"errorText",children:s})]}),ne=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"})),fe=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"})),ae=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),o=()=>i(typeof window<"u"?window.innerWidth:0);return l.useEffect(()=>(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)),[t]),t},ge=()=>{const t=`${window.location.pathname}${window.location.search}`;window.history.replaceState(null,"",t)},me=t=>{window.location.hash=t},he=t=>{const[i,o]=l.useState(!1);return l.useEffect(()=>{const d=s=>{window.location.hash!==t?o(!0):o(!1)};return window.addEventListener("hashchange",d),()=>{window.removeEventListener("hashchange",d)}},[]),i},we=(t,i,o)=>{l.useEffect(()=>{function d(s){i.current&&!i.current.contains(s.target)&&t?.current&&!t?.current.contains(s.target)&&o()}return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[t,o])},ve=({options:t,label:i,hasError:o,title:d,value:s,api:u,selected:p,placeholder:h,disabled:E=!1,pagination:x,optionFilterLabel:N,hasSearch:S=!1,classNames:g={wrapper:"",label:"",title:"",button:"",input:"",listWrapper:"",list:"",option:"",optionActive:"",mobileHeader:""},onSelectChange:I})=>{let W=!0;const k=pe(),B=he("#select"),[R,O]=l.useState(!1),[G,z]=l.useState(!0),[f,M]=l.useState(null),[_,C]=l.useState(null),[q,T]=l.useState(""),[v,Y]=l.useState({page:1,pageLabel:"page",size:20,sizeLabel:"size",isLoading:!1}),j=l.useRef(void 0),y=l.useRef(void 0),L=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(u?.length){if(j.current=u,j.current.includes(x?.pageLabel||"page")){const r=new URL(u);r.searchParams.set(x?.pageLabel||"page",(x?.page||v.page).toString()),r.searchParams.set(x?.sizeLabel||"size",(x?.size||v.size).toString()),j.current=r.href}z(!0),D().then(r=>{W&&(z(!1),C(r))})}},[u,x]),l.useEffect(()=>{if(v.isLoading){if(j.current.includes(x?.pageLabel||"page")){const r=new URL(j.current);r.searchParams.set(x?.pageLabel||"page",v.page.toString()),j.current=r.href}D().then(r=>{W&&(z(!1),Y({...v,isLoading:!1}),C([..._,...r]))})}},[v]),l.useEffect(()=>{k<768&&(R?(me("select"),document.body.style.overflow="hidden",L.current?.focus()):(window.location.hash&&!document.referrer.includes("#")&&ge(),document.body.style.overflow="auto"))},[R]),l.useEffect(()=>{p&&t?.length&&(t?.find(r=>r[i]===p)?M(t?.find(r=>r[i]===p)):M(p))},[p]),l.useEffect(()=>{f&&S&&(s?.length&&_?.find(r=>r[i]===f[i])?T(_?.find(r=>r[i]===f[i])[s]||""):T(f))},[f]),l.useEffect(()=>{B&&O(!1)},[B]),l.useEffect(()=>{t?.length&&C(t)},[t]);const A=()=>{S&&C(t),O(r=>!r)},F=()=>{S&&(C(t),T(typeof f=="string"?f:f?f[s]:"")),O(!1)},J=r=>{S&&(s?.length?T(r[s]):T(r)),M(r),A(),I&&I(r)},e=r=>{if(!f)return"";if(i?.length&&r[i]===f[i])return`nariaSelectOption-active ${g?.optionActive}`;if(r===f)return`nariaSelectOption-active ${g?.optionActive}`},n=r=>{u?.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[N?.length?N:s].includes(r?.target?.value):w.includes(r?.target?.value)):t;C(b),T(r?.target?.value),R||O(!0)};return we(y,L,F),a.jsxs("div",{className:`nariaSelect ${E?"nariaSelect-disabled":""} ${g?.wrapper}`,"data-prop":"wrapper",children:[a.jsxs("label",{className:`${o&&"!text-danger-100"}
23
+ ${g?.label}`,"data-prop":"label",children:[a.jsx("span",{className:g?.title,"data-prop":"title",children:d}),S?a.jsxs("div",{className:"nariaSearchInput",children:[a.jsx("input",{ref:L,placeholder:h?.length?h:"Select",className:`${f?"text-dark-100":"text-grey-300"}
24
+ ${o&&"!border-danger-100 focus:border-danger-100 outline-danger-100"} ${g?.input}`,value:q,disabled:E,type:"text",onClick:A,onChange:c,"data-prop":"input"}),R?a.jsx(ae,{className:"nariaSearchIcon"}):a.jsx(ne,{className:`nariaArrowIcon ${R?"nariaArrowIcon-rotate-180":""}`})]}):a.jsxs("button",{type:"button",ref:L,disabled:E,className:`nariaHandler ${f?"text-dark-100":"text-grey-300"}
25
+ ${o&&"!border-danger-100 focus:border-danger-100 outline-danger-100"} ${g?.button}`,"data-prop":"button",onClick:A,children:[f?s?.length?f[s]:f:h?.length?h:"Select"," ",a.jsx(ne,{className:`nariaArrowIcon ${R?"nariaArrowIcon-rotate-180":""}`})]})]}),R?a.jsx("div",{className:`nariaListWrapper ${k<768?"nariaListWrapper-mobile":""} ${g?.listWrapper}`,"data-prop":"listWrapper",ref:y,children:a.jsx("div",{className:`nariaList ${k<768?"nariaList-mobile":"nariaList-desktop"} ${g?.list}`,"data-prop":"input",onScroll:n,children:u&&G?a.jsx("div",{className:"nariaLoadingWrapper",children:a.jsx(K,{})}):a.jsxs(a.Fragment,{children:[k<768?a.jsxs("div",{className:`nariaSelectMobileHeader ${g?.mobileHeader}`,"data-prop":"mobileHeader",children:[S?a.jsxs("div",{className:"nariaSearchInput",children:[a.jsx("input",{ref:L,placeholder:h?.length?h:"Select",className:`${f?"text-dark-100":"text-grey-300"}
26
+ ${o&&"!border-danger-100 focus:border-danger-100 outline-danger-100"} ${g?.input}`,"data-prop":"input",value:q,disabled:E,type:"text",onChange:c}),a.jsx(ae,{className:"nariaSearchIcon"})]}):void 0,a.jsx("button",{className:"p-3",onClick:F,disabled:E,children:a.jsx(fe,{className:"w-6"})})]}):void 0,_?.length?a.jsx(a.Fragment,{children:_?.map((r,b)=>a.jsx("button",{type:"button",onClick:()=>J(r),disabled:E,className:`nariaSelectOption ${g?.option} ${e(r)}`,"data-prop":"option","data-prop-active":"optionActive",children:s?.length?r[s]:r},b.toString()))}):a.jsx("div",{children:"No Data"}),v.isLoading?a.jsx("div",{className:"nariaLoadingMoreWrapper",children:a.jsx(K,{})}):void 0]})})}):void 0,o&&a.jsx("p",{className:"text-xs mt-1 text-danger-100",children:o})]})};function be(t){return t.charAt(0).toUpperCase()+t.slice(1)}exports.Button=ue;exports.Input=de;exports.Select=ve;exports.capitalize=be;
package/dist/naria-ui.css CHANGED
@@ -1 +1 @@
1
- .nariaLoading{animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.nariaSelect{position:relative}.nariaSelect .nariaListWrapper{overflow:hidden}.nariaSelect .nariaListWrapper.nariaListWrapper-mobile{position:fixed;top:0;right:0;height:100%;width:100%;z-index:97}.nariaSelect .nariaList{display:flex;flex-direction:column;width:100%;z-index:99;position:relative;overflow:auto}.nariaSelect .nariaList.nariaList-mobile{position:relative;height:100%}.nariaSelect .nariaList.nariaList-desktop{position:absolute;animation:fadeInTranslateY .3s ease-out forwards;max-height:150px}.nariaSelect .nariaList .nariaLoadingWrapper{padding:24px 0;display:flex;justify-content:center}.nariaSelect .nariaList .nariaLoadingMoreWrapper{position:sticky;bottom:0;text-align:center;width:100%}.nariaSelect .nariaList .nariaLoadingMoreWrapper .nariaLoading{width:20px}.nariaSelect .nariaList .nariaSelectMobileHeader{position:sticky;top:0;justify-content:end;display:flex}.nariaSelect .nariaList .nariaSelectMobileHeader .nariaSearchInput{flex-grow:1}.nariaSelect .nariaSearchInput{position:relative;display:flex}.nariaSelect .nariaSearchInput input{width:100%}.nariaSelect .nariaSearchInput .nariaArrowIcon,.nariaSelect .nariaSearchInput .nariaSearchIcon{position:absolute;bottom:0;margin-top:auto;margin-bottom:auto;top:0;right:0;width:12px;height:12px;z-index:1}.nariaSelect .nariaHandler{position:relative;display:flex;gap:4px;width:100%;align-items:center;justify-content:space-between}.nariaSelect .nariaHandler .nariaArrowIcon{width:12px;height:12px;transition:transform .4s;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0)}.nariaSelect .nariaHandler .nariaArrowIcon.nariaArrowIcon-rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}html[dir=rtl] .nariaSelect .nariaSearchInput .nariaArrowIcon,html[dir=rtl] .nariaSelect .nariaSearchInput .nariaSearchIcon{left:0;right:auto}@keyframes fadeInTranslateY{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
1
+ .nariaButton{display:flex;align-items:center;width:100%}.nariaButton .nariaLoading{width:14px;height:14px}.nariaLoading{animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.nariaSelect{position:relative}.nariaSelect .nariaListWrapper{overflow:hidden}.nariaSelect .nariaListWrapper.nariaListWrapper-mobile{position:fixed;top:0;right:0;height:100%;width:100%;z-index:97}.nariaSelect .nariaList{display:flex;flex-direction:column;width:100%;z-index:99;position:relative;overflow:auto}.nariaSelect .nariaList.nariaList-mobile{position:relative;height:100%}.nariaSelect .nariaList.nariaList-desktop{position:absolute;animation:fadeInTranslateY .3s ease-out forwards;max-height:150px}.nariaSelect .nariaList .nariaLoadingWrapper{padding:24px 0;display:flex;justify-content:center}.nariaSelect .nariaList .nariaLoadingMoreWrapper{position:sticky;bottom:0;text-align:center;width:100%}.nariaSelect .nariaList .nariaLoadingMoreWrapper .nariaLoading{width:20px}.nariaSelect .nariaList .nariaSelectMobileHeader{position:sticky;top:0;justify-content:end;display:flex;gap:8px}.nariaSelect .nariaList .nariaSelectMobileHeader .nariaSearchInput{flex-grow:1}.nariaSelect .nariaSearchInput{position:relative;display:flex}.nariaSelect .nariaSearchInput input{width:100%}.nariaSelect .nariaSearchInput .nariaArrowIcon,.nariaSelect .nariaSearchInput .nariaSearchIcon{position:absolute;bottom:0;margin-top:auto;margin-bottom:auto;top:0;right:0;width:12px;height:12px;z-index:1}.nariaSelect .nariaHandler{position:relative;display:flex;gap:4px;width:100%;align-items:center;justify-content:space-between}.nariaSelect .nariaHandler .nariaArrowIcon{width:12px;height:12px;transition:transform .4s;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0)}.nariaSelect .nariaHandler .nariaArrowIcon.nariaArrowIcon-rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}html[dir=rtl] .nariaSelect .nariaSearchInput .nariaArrowIcon,html[dir=rtl] .nariaSelect .nariaSearchInput .nariaSearchIcon{left:0;right:auto}@keyframes fadeInTranslateY{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@@ -1,5 +1,5 @@
1
1
  import * as P from "react";
2
- import ce, { useState as y, useEffect as x, useRef as ee } from "react";
2
+ import le, { useState as A, useEffect as x, useRef as ee } from "react";
3
3
  var G = { exports: {} }, U = {};
4
4
  /**
5
5
  * @license React
@@ -10,29 +10,29 @@ var G = { exports: {} }, U = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var re;
14
- function le() {
15
- if (re) return U;
16
- re = 1;
13
+ var te;
14
+ function ce() {
15
+ if (te) return U;
16
+ te = 1;
17
17
  var t = Symbol.for("react.transitional.element"), i = Symbol.for("react.fragment");
18
- function c(f, o, u) {
19
- var p = null;
20
- if (u !== void 0 && (p = "" + u), o.key !== void 0 && (p = "" + o.key), "key" in o) {
21
- u = {};
18
+ function s(d, o, c) {
19
+ var f = null;
20
+ if (c !== void 0 && (f = "" + c), o.key !== void 0 && (f = "" + o.key), "key" in o) {
21
+ c = {};
22
22
  for (var m in o)
23
- m !== "key" && (u[m] = o[m]);
24
- } else u = o;
25
- return o = u.ref, {
23
+ m !== "key" && (c[m] = o[m]);
24
+ } else c = o;
25
+ return o = c.ref, {
26
26
  $$typeof: t,
27
- type: f,
28
- key: p,
27
+ type: d,
28
+ key: f,
29
29
  ref: o !== void 0 ? o : null,
30
- props: u
30
+ props: c
31
31
  };
32
32
  }
33
- return U.Fragment = i, U.jsx = c, U.jsxs = c, U;
33
+ return U.Fragment = i, U.jsx = s, U.jsxs = s, U;
34
34
  }
35
- var J = {};
35
+ var B = {};
36
36
  /**
37
37
  * @license React
38
38
  * react-jsx-runtime.development.js
@@ -42,26 +42,26 @@ var J = {};
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
44
  */
45
- var te;
45
+ var ne;
46
46
  function ue() {
47
- return te || (te = 1, process.env.NODE_ENV !== "production" && function() {
47
+ return ne || (ne = 1, process.env.NODE_ENV !== "production" && function() {
48
48
  function t(e) {
49
49
  if (e == null) return null;
50
50
  if (typeof e == "function")
51
- return e.$$typeof === S ? null : e.displayName || e.name || null;
51
+ return e.$$typeof === T ? null : e.displayName || e.name || null;
52
52
  if (typeof e == "string") return e;
53
53
  switch (e) {
54
- case _:
54
+ case k:
55
55
  return "Fragment";
56
56
  case C:
57
57
  return "Profiler";
58
- case q:
58
+ case J:
59
59
  return "StrictMode";
60
- case l:
60
+ case u:
61
61
  return "Suspense";
62
62
  case M:
63
63
  return "SuspenseList";
64
- case B:
64
+ case q:
65
65
  return "Activity";
66
66
  }
67
67
  if (typeof e == "object")
@@ -72,14 +72,14 @@ function ue() {
72
72
  return "Portal";
73
73
  case X:
74
74
  return (e.displayName || "Context") + ".Provider";
75
- case A:
75
+ case O:
76
76
  return (e._context.displayName || "Context") + ".Consumer";
77
77
  case Y:
78
78
  var n = e.render;
79
79
  return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
80
- case T:
80
+ case _:
81
81
  return n = e.displayName || null, n !== null ? n : t(e.type) || "Memo";
82
- case k:
82
+ case S:
83
83
  n = e._payload, e = e._init;
84
84
  try {
85
85
  return t(e(n));
@@ -91,7 +91,7 @@ function ue() {
91
91
  function i(e) {
92
92
  return "" + e;
93
93
  }
94
- function c(e) {
94
+ function s(e) {
95
95
  try {
96
96
  i(e);
97
97
  var n = !1;
@@ -100,17 +100,17 @@ function ue() {
100
100
  }
101
101
  if (n) {
102
102
  n = console;
103
- var s = n.error, r = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
104
- return s.call(
103
+ var l = n.error, r = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
104
+ return l.call(
105
105
  n,
106
106
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
107
  r
108
108
  ), i(e);
109
109
  }
110
110
  }
111
- function f(e) {
112
- if (e === _) return "<>";
113
- if (typeof e == "object" && e !== null && e.$$typeof === k)
111
+ function d(e) {
112
+ if (e === k) return "<>";
113
+ if (typeof e == "object" && e !== null && e.$$typeof === S)
114
114
  return "<...>";
115
115
  try {
116
116
  var n = t(e);
@@ -123,10 +123,10 @@ function ue() {
123
123
  var e = w.A;
124
124
  return e === null ? null : e.getOwner();
125
125
  }
126
- function u() {
126
+ function c() {
127
127
  return Error("react-stack-top-frame");
128
128
  }
129
- function p(e) {
129
+ function f(e) {
130
130
  if (D.call(e, "key")) {
131
131
  var n = Object.getOwnPropertyDescriptor(e, "key").get;
132
132
  if (n && n.isReactWarning) return !1;
@@ -134,14 +134,14 @@ function ue() {
134
134
  return e.key !== void 0;
135
135
  }
136
136
  function m(e, n) {
137
- function s() {
137
+ function l() {
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)",
140
140
  n
141
141
  ));
142
142
  }
143
- s.isReactWarning = !0, Object.defineProperty(e, "key", {
144
- get: s,
143
+ l.isReactWarning = !0, Object.defineProperty(e, "key", {
144
+ get: l,
145
145
  configurable: !0
146
146
  });
147
147
  }
@@ -151,14 +151,14 @@ function ue() {
151
151
  "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."
152
152
  )), e = this.props.ref, e !== void 0 ? e : null;
153
153
  }
154
- function b(e, n, s, r, v, h, Z, Q) {
155
- return s = h.ref, e = {
154
+ function b(e, n, l, r, v, h, Z, Q) {
155
+ return l = h.ref, e = {
156
156
  $$typeof: W,
157
157
  type: e,
158
158
  key: n,
159
159
  props: h,
160
160
  _owner: v
161
- }, (s !== void 0 ? s : null) !== null ? Object.defineProperty(e, "ref", {
161
+ }, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
162
162
  enumerable: !1,
163
163
  get: E
164
164
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
@@ -183,25 +183,25 @@ function ue() {
183
183
  value: Q
184
184
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
185
185
  }
186
- function I(e, n, s, r, v, h, Z, Q) {
187
- var d = n.children;
188
- if (d !== void 0)
186
+ function I(e, n, l, r, v, h, Z, Q) {
187
+ var g = n.children;
188
+ if (g !== void 0)
189
189
  if (r)
190
- if (R(d)) {
191
- for (r = 0; r < d.length; r++)
192
- j(d[r]);
193
- Object.freeze && Object.freeze(d);
190
+ if (R(g)) {
191
+ for (r = 0; r < g.length; r++)
192
+ j(g[r]);
193
+ Object.freeze && Object.freeze(g);
194
194
  } else
195
195
  console.error(
196
196
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
197
  );
198
- else j(d);
198
+ else j(g);
199
199
  if (D.call(n, "key")) {
200
- d = t(e);
201
- var $ = Object.keys(n).filter(function(ie) {
200
+ g = t(e);
201
+ var N = Object.keys(n).filter(function(ie) {
202
202
  return ie !== "key";
203
203
  });
204
- r = 0 < $.length ? "{key: someKey, " + $.join(": ..., ") + ": ...}" : "{key: someKey}", V[d + r] || ($ = 0 < $.length ? "{" + $.join(": ..., ") + ": ...}" : "{}", console.error(
204
+ r = 0 < N.length ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}", V[g + r] || (N = 0 < N.length ? "{" + N.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} />
@@ -209,26 +209,26 @@ React keys must be passed directly to JSX without using spread:
209
209
  let props = %s;
210
210
  <%s key={someKey} {...props} />`,
211
211
  r,
212
- d,
213
- $,
214
- d
215
- ), V[d + r] = !0);
212
+ g,
213
+ N,
214
+ g
215
+ ), V[g + r] = !0);
216
216
  }
217
- if (d = null, s !== void 0 && (c(s), d = "" + s), p(n) && (c(n.key), d = "" + n.key), "key" in n) {
218
- s = {};
217
+ if (g = null, l !== void 0 && (s(l), g = "" + l), f(n) && (s(n.key), g = "" + n.key), "key" in n) {
218
+ l = {};
219
219
  for (var K in n)
220
- K !== "key" && (s[K] = n[K]);
221
- } else s = n;
222
- return d && m(
223
- s,
220
+ K !== "key" && (l[K] = n[K]);
221
+ } else l = n;
222
+ return g && m(
223
+ l,
224
224
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
225
225
  ), b(
226
226
  e,
227
- d,
227
+ g,
228
228
  h,
229
229
  v,
230
230
  o(),
231
- s,
231
+ l,
232
232
  Z,
233
233
  Q
234
234
  );
@@ -236,95 +236,51 @@ 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 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() {
239
+ var p = le, W = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), J = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), O = Symbol.for("react.consumer"), X = Symbol.for("react.context"), Y = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), q = Symbol.for("react.activity"), T = Symbol.for("react.client.reference"), w = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, D = Object.prototype.hasOwnProperty, R = Array.isArray, $ = console.createTask ? console.createTask : function() {
240
240
  return null;
241
241
  };
242
- g = {
242
+ p = {
243
243
  "react-stack-bottom-frame": function(e) {
244
244
  return e();
245
245
  }
246
246
  };
247
- var L, F = {}, O = g["react-stack-bottom-frame"].bind(
248
- g,
249
- u
250
- )(), H = N(f(u)), V = {};
251
- J.Fragment = _, J.jsx = function(e, n, s, r, v) {
247
+ var L, F = {}, y = p["react-stack-bottom-frame"].bind(
248
+ p,
249
+ c
250
+ )(), H = $(d(c)), V = {};
251
+ B.Fragment = k, B.jsx = function(e, n, l, r, v) {
252
252
  var h = 1e4 > w.recentlyCreatedOwnerStacks++;
253
253
  return I(
254
254
  e,
255
255
  n,
256
- s,
256
+ l,
257
257
  !1,
258
258
  r,
259
259
  v,
260
- h ? Error("react-stack-top-frame") : O,
261
- h ? N(f(e)) : H
260
+ h ? Error("react-stack-top-frame") : y,
261
+ h ? $(d(e)) : H
262
262
  );
263
- }, J.jsxs = function(e, n, s, r, v) {
263
+ }, B.jsxs = function(e, n, l, r, v) {
264
264
  var h = 1e4 > w.recentlyCreatedOwnerStacks++;
265
265
  return I(
266
266
  e,
267
267
  n,
268
- s,
268
+ l,
269
269
  !0,
270
270
  r,
271
271
  v,
272
- h ? Error("react-stack-top-frame") : O,
273
- h ? N(f(e)) : H
272
+ h ? Error("react-stack-top-frame") : y,
273
+ h ? $(d(e)) : H
274
274
  );
275
275
  };
276
- }()), J;
276
+ }()), B;
277
277
  }
278
- var ne;
278
+ var ae;
279
279
  function de() {
280
- return ne || (ne = 1, process.env.NODE_ENV === "production" ? G.exports = le() : G.exports = ue()), G.exports;
280
+ return ae || (ae = 1, process.env.NODE_ENV === "production" ? G.exports = ce() : G.exports = ue()), G.exports;
281
281
  }
282
282
  var a = de();
283
- const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button", { type: t, children: i }), xe = ({
284
- type: t = "text",
285
- placeholder: i,
286
- classNames: c = {
287
- wrapper: "",
288
- label: "",
289
- input: ""
290
- },
291
- label: f,
292
- hasError: o,
293
- register: u,
294
- name: p,
295
- isDisabled: m = !1,
296
- autocomplete: E = !1,
297
- ...b
298
- }) => /* @__PURE__ */ a.jsxs("div", { className: `nariaInputWrapper ${c.wrapper}`, children: [
299
- /* @__PURE__ */ a.jsxs(
300
- "label",
301
- {
302
- htmlFor: p,
303
- className: `${c.label} ${o && "nariaInputLabel-error"}`,
304
- children: [
305
- f,
306
- /* @__PURE__ */ a.jsx(
307
- "input",
308
- {
309
- disabled: m,
310
- autoComplete: E ? "on" : "off",
311
- id: p,
312
- ...u,
313
- ...b,
314
- type: t,
315
- name: p,
316
- className: `${c.input} ${o && "nariaInput-error"}`,
317
- placeholder: i
318
- }
319
- )
320
- ]
321
- }
322
- ),
323
- o && /* @__PURE__ */ a.jsx("p", { className: "nariaInputErrorText", children: o })
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
- const [t, i] = y(typeof window < "u" ? window.innerWidth : 0), c = () => i(typeof window < "u" ? window.innerWidth : 0);
326
- return x(() => (window.addEventListener("resize", c), () => window.removeEventListener("resize", c)), [t]), t;
327
- }, se = ({
283
+ const re = ({
328
284
  classNames: t = {
329
285
  wrapper: "",
330
286
  color: ""
@@ -333,6 +289,7 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
333
289
  "svg",
334
290
  {
335
291
  className: `nariaLoading ${t.wrapper}`,
292
+ "data-prop": "wrapper",
336
293
  viewBox: "0 0 64 64",
337
294
  fill: "none",
338
295
  xmlns: "http://www.w3.org/2000/svg",
@@ -355,49 +312,127 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
355
312
  strokeWidth: "6",
356
313
  strokeLinecap: "round",
357
314
  strokeLinejoin: "round",
358
- className: t.color
315
+ className: t.color,
316
+ "data-prop": "color"
359
317
  }
360
318
  )
361
319
  ]
362
320
  }
363
- ), ge = () => {
321
+ ), be = ({
322
+ type: t = "button",
323
+ classNames: i = {
324
+ button: "",
325
+ loading: {
326
+ wrapper: "",
327
+ color: ""
328
+ }
329
+ },
330
+ value: s,
331
+ icon: d = null,
332
+ isLoading: o = !1,
333
+ isDisabled: c = !1,
334
+ ...f
335
+ }) => /* @__PURE__ */ a.jsxs(
336
+ "button",
337
+ {
338
+ type: t,
339
+ disabled: c,
340
+ ...f,
341
+ className: `nariaButton ${c ? "nariaButton-disabled" : ""} ${i?.button}`,
342
+ "data-prop": "button",
343
+ children: [
344
+ o ? /* @__PURE__ */ a.jsx(re, { classNames: {
345
+ wrapper: i.loading.wrapper,
346
+ color: i.loading.color
347
+ }, "data-prop-wrapper": "wrapper", "data-prop-color": "color" }) : d,
348
+ s
349
+ ]
350
+ }
351
+ ), xe = ({
352
+ type: t = "text",
353
+ placeholder: i,
354
+ classNames: s = {
355
+ wrapper: "",
356
+ label: "",
357
+ input: "",
358
+ errorText: ""
359
+ },
360
+ label: d,
361
+ hasError: o,
362
+ register: c,
363
+ name: f,
364
+ isDisabled: m = !1,
365
+ autocomplete: E = !1,
366
+ ...b
367
+ }) => /* @__PURE__ */ a.jsxs("div", { className: `nariaInputWrapper ${s.wrapper}`, "data-prop": "wrapper", children: [
368
+ /* @__PURE__ */ a.jsxs(
369
+ "label",
370
+ {
371
+ htmlFor: f,
372
+ className: `${s.label} ${o && "nariaInputLabel-error"}`,
373
+ "data-prop": "label",
374
+ children: [
375
+ d,
376
+ /* @__PURE__ */ a.jsx(
377
+ "input",
378
+ {
379
+ disabled: m,
380
+ autoComplete: E ? "on" : "off",
381
+ id: f,
382
+ ...c,
383
+ ...b,
384
+ type: t,
385
+ name: f,
386
+ className: `${s.input} ${o && "nariaInput-error"}`,
387
+ placeholder: i,
388
+ "data-prop": "input"
389
+ }
390
+ )
391
+ ]
392
+ }
393
+ ),
394
+ o && /* @__PURE__ */ a.jsx("p", { className: `nariaInputErrorText ${s?.errorText}`, "data-prop": "errorText", children: o })
395
+ ] }), oe = (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" })), se = (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 = () => {
396
+ const [t, i] = A(typeof window < "u" ? window.innerWidth : 0), s = () => i(typeof window < "u" ? window.innerWidth : 0);
397
+ return x(() => (window.addEventListener("resize", s), () => window.removeEventListener("resize", s)), [t]), t;
398
+ }, ge = () => {
364
399
  const t = `${window.location.pathname}${window.location.search}`;
365
400
  window.history.replaceState(null, "", t);
366
401
  }, me = (t) => {
367
402
  window.location.hash = t;
368
403
  }, he = (t) => {
369
- const [i, c] = y(!1);
404
+ const [i, s] = A(!1);
370
405
  return x(() => {
371
- const f = (o) => {
372
- window.location.hash !== t ? c(!0) : c(!1);
406
+ const d = (o) => {
407
+ window.location.hash !== t ? s(!0) : s(!1);
373
408
  };
374
- return window.addEventListener("hashchange", f), () => {
375
- window.removeEventListener("hashchange", f);
409
+ return window.addEventListener("hashchange", d), () => {
410
+ window.removeEventListener("hashchange", d);
376
411
  };
377
412
  }, []), i;
378
- }, we = (t, i, c) => {
413
+ }, we = (t, i, s) => {
379
414
  x(() => {
380
- function f(o) {
381
- i.current && !i.current.contains(o.target) && t?.current && !t?.current.contains(o.target) && c();
415
+ function d(o) {
416
+ i.current && !i.current.contains(o.target) && t?.current && !t?.current.contains(o.target) && s();
382
417
  }
383
- return document.addEventListener("mousedown", f), () => {
384
- document.removeEventListener("mousedown", f);
418
+ return document.addEventListener("mousedown", d), () => {
419
+ document.removeEventListener("mousedown", d);
385
420
  };
386
- }, [t, c]);
421
+ }, [t, s]);
387
422
  }, Ee = ({
388
423
  options: t,
389
424
  label: i,
390
- hasError: c,
391
- title: f,
425
+ hasError: s,
426
+ title: d,
392
427
  value: o,
393
- api: u,
394
- selected: p,
428
+ api: c,
429
+ selected: f,
395
430
  placeholder: m,
396
431
  disabled: E = !1,
397
432
  pagination: b,
398
433
  optionFilterLabel: I,
399
434
  hasSearch: j = !1,
400
- classNames: g = {
435
+ classNames: p = {
401
436
  wrapper: "",
402
437
  label: "",
403
438
  title: "",
@@ -406,18 +441,19 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
406
441
  listWrapper: "",
407
442
  list: "",
408
443
  option: "",
444
+ optionActive: "",
409
445
  mobileHeader: ""
410
446
  },
411
447
  onSelectChange: W
412
448
  }) => {
413
449
  let z = !0;
414
- const _ = pe(), q = he("#select"), [C, A] = y(!1), [X, Y] = y(!0), [l, M] = y(null), [T, k] = y(null), [B, S] = y(""), [w, D] = y({
450
+ const k = pe(), J = he("#select"), [C, O] = A(!1), [X, Y] = A(!0), [u, M] = A(null), [_, S] = A(null), [q, T] = A(""), [w, D] = A({
415
451
  page: 1,
416
452
  pageLabel: "page",
417
453
  size: 20,
418
454
  sizeLabel: "size",
419
455
  isLoading: !1
420
- }), R = ee(void 0), N = ee(void 0), L = ee(void 0), F = async () => {
456
+ }), R = ee(void 0), $ = ee(void 0), L = ee(void 0), F = async () => {
421
457
  if (R?.current)
422
458
  try {
423
459
  const r = await fetch(R?.current);
@@ -431,16 +467,16 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
431
467
  x(() => () => {
432
468
  z = !1;
433
469
  }, []), x(() => {
434
- if (u?.length) {
435
- if (R.current = u, R.current.includes(b?.pageLabel || "page")) {
436
- const r = new URL(u);
470
+ if (c?.length) {
471
+ if (R.current = c, R.current.includes(b?.pageLabel || "page")) {
472
+ const r = new URL(c);
437
473
  r.searchParams.set(b?.pageLabel || "page", (b?.page || w.page).toString()), r.searchParams.set(b?.sizeLabel || "size", (b?.size || w.size).toString()), R.current = r.href;
438
474
  }
439
475
  Y(!0), F().then((r) => {
440
- z && (Y(!1), k(r));
476
+ z && (Y(!1), S(r));
441
477
  });
442
478
  }
443
- }, [u, b]), x(() => {
479
+ }, [c, b]), x(() => {
444
480
  if (w.isLoading) {
445
481
  if (R.current.includes(b?.pageLabel || "page")) {
446
482
  const r = new URL(R.current);
@@ -450,81 +486,82 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
450
486
  z && (Y(!1), D({
451
487
  ...w,
452
488
  isLoading: !1
453
- }), k([
454
- ...T,
489
+ }), S([
490
+ ..._,
455
491
  ...r
456
492
  ]));
457
493
  });
458
494
  }
459
495
  }, [w]), x(() => {
460
- _ < 768 && (C ? (me("select"), document.body.style.overflow = "hidden", L.current?.focus()) : (window.location.hash && !document.referrer.includes("#") && ge(), document.body.style.overflow = "auto"));
496
+ k < 768 && (C ? (me("select"), document.body.style.overflow = "hidden", L.current?.focus()) : (window.location.hash && !document.referrer.includes("#") && ge(), document.body.style.overflow = "auto"));
461
497
  }, [C]), x(() => {
462
- p && t?.length && (t?.find((r) => r[i] === p) ? M(t?.find((r) => r[i] === p)) : M(p));
463
- }, [p]), x(() => {
464
- l && j && (o?.length && T?.find((r) => r[i] === l[i]) ? S(T?.find((r) => r[i] === l[i])[o] || "") : S(l));
465
- }, [l]), x(() => {
466
- q && A(!1);
467
- }, [q]), x(() => {
468
- t?.length && k(t);
498
+ f && t?.length && (t?.find((r) => r[i] === f) ? M(t?.find((r) => r[i] === f)) : M(f));
499
+ }, [f]), x(() => {
500
+ u && j && (o?.length && _?.find((r) => r[i] === u[i]) ? T(_?.find((r) => r[i] === u[i])[o] || "") : T(u));
501
+ }, [u]), x(() => {
502
+ J && O(!1);
503
+ }, [J]), x(() => {
504
+ t?.length && S(t);
469
505
  }, [t]);
470
- const O = () => {
471
- j && k(t), A((r) => !r);
506
+ const y = () => {
507
+ j && S(t), O((r) => !r);
472
508
  }, H = () => {
473
- j && (k(t), S(typeof l == "string" ? l : l ? l[o] : "")), A(!1);
509
+ j && (S(t), T(typeof u == "string" ? u : u ? u[o] : "")), O(!1);
474
510
  }, V = (r) => {
475
- j && (o?.length ? S(r[o]) : S(r)), M(r), O(), W && W(r);
511
+ j && (o?.length ? T(r[o]) : T(r)), M(r), y(), W && W(r);
476
512
  }, e = (r) => {
477
- if (!l)
513
+ if (!u)
478
514
  return "";
479
- if (i?.length && r[i] === l[i] || r === l)
480
- return "bg-grey-100";
515
+ if (i?.length && r[i] === u[i])
516
+ return `nariaSelectOption-active ${p?.optionActive}`;
517
+ if (r === u)
518
+ return `nariaSelectOption-active ${p?.optionActive}`;
481
519
  }, n = (r) => {
482
- u?.length && T?.length && !w.isLoading && r.target.offsetHeight + r.target.scrollTop >= r.target.scrollHeight - 100 && D({
520
+ c?.length && _?.length && !w.isLoading && r.target.offsetHeight + r.target.scrollTop >= r.target.scrollHeight - 100 && D({
483
521
  page: w.page + 1,
484
522
  isLoading: !0
485
523
  });
486
- }, s = (r) => {
524
+ }, l = (r) => {
487
525
  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;
488
- k(v), S(r?.target?.value), C || A(!0);
526
+ S(v), T(r?.target?.value), C || O(!0);
489
527
  };
490
- return we(N, L, H), /* @__PURE__ */ a.jsxs(
528
+ return we($, L, H), /* @__PURE__ */ a.jsxs(
491
529
  "div",
492
530
  {
493
- className: `nariaSelect ${E ? "nariaSelect-disabled" : ""} ${g?.wrapper}`,
531
+ className: `nariaSelect ${E ? "nariaSelect-disabled" : ""} ${p?.wrapper}`,
494
532
  "data-prop": "wrapper",
495
533
  children: [
496
534
  /* @__PURE__ */ a.jsxs(
497
535
  "label",
498
536
  {
499
- className: `cursor-pointer
500
- ${c && "!text-danger-100"}
501
- ${g?.label}`,
537
+ className: `${s && "!text-danger-100"}
538
+ ${p?.label}`,
502
539
  "data-prop": "label",
503
540
  children: [
504
- /* @__PURE__ */ a.jsx("span", { className: g?.title, "data-prop": "title", children: f }),
541
+ /* @__PURE__ */ a.jsx("span", { className: p?.title, "data-prop": "title", children: d }),
505
542
  j ? /* @__PURE__ */ a.jsxs("div", { className: "nariaSearchInput", children: [
506
543
  /* @__PURE__ */ a.jsx(
507
544
  "input",
508
545
  {
509
546
  ref: L,
510
547
  placeholder: m?.length ? m : "Select",
511
- className: `${l ? "text-dark-100" : "text-grey-300"}
512
- ${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"} ${g?.input}`,
513
- value: B,
548
+ className: `${u ? "text-dark-100" : "text-grey-300"}
549
+ ${s && "!border-danger-100 focus:border-danger-100 outline-danger-100"} ${p?.input}`,
550
+ value: q,
514
551
  disabled: E,
515
552
  type: "text",
516
- onClick: O,
517
- onChange: s,
553
+ onClick: y,
554
+ onChange: l,
518
555
  "data-prop": "input"
519
556
  }
520
557
  ),
521
558
  C ? /* @__PURE__ */ a.jsx(
522
- oe,
559
+ se,
523
560
  {
524
561
  className: "nariaSearchIcon"
525
562
  }
526
563
  ) : /* @__PURE__ */ a.jsx(
527
- ae,
564
+ oe,
528
565
  {
529
566
  className: `nariaArrowIcon ${C ? "nariaArrowIcon-rotate-180" : ""}`
530
567
  }
@@ -535,15 +572,15 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
535
572
  type: "button",
536
573
  ref: L,
537
574
  disabled: E,
538
- className: `nariaHandler ${l ? "text-dark-100" : "text-grey-300"}
539
- ${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"} ${g?.button}`,
575
+ className: `nariaHandler ${u ? "text-dark-100" : "text-grey-300"}
576
+ ${s && "!border-danger-100 focus:border-danger-100 outline-danger-100"} ${p?.button}`,
540
577
  "data-prop": "button",
541
- onClick: O,
578
+ onClick: y,
542
579
  children: [
543
- l ? o?.length ? l[o] : l : m?.length ? m : "Select",
580
+ u ? o?.length ? u[o] : u : m?.length ? m : "Select",
544
581
  " ",
545
582
  /* @__PURE__ */ a.jsx(
546
- ae,
583
+ oe,
547
584
  {
548
585
  className: `nariaArrowIcon ${C ? "nariaArrowIcon-rotate-180" : ""}`
549
586
  }
@@ -557,60 +594,68 @@ const be = ({ type: t = "button", value: i }) => /* @__PURE__ */ a.jsx("button",
557
594
  C ? /* @__PURE__ */ a.jsx(
558
595
  "div",
559
596
  {
560
- className: `nariaListWrapper ${_ < 768 ? "nariaListWrapper-mobile" : ""} ${g?.listWrapper}`,
597
+ className: `nariaListWrapper ${k < 768 ? "nariaListWrapper-mobile" : ""} ${p?.listWrapper}`,
561
598
  "data-prop": "listWrapper",
562
- ref: N,
599
+ ref: $,
563
600
  children: /* @__PURE__ */ a.jsx(
564
601
  "div",
565
602
  {
566
- className: `nariaList ${_ < 768 ? "nariaList-mobile" : "nariaList-desktop"} ${g?.list}`,
603
+ className: `nariaList ${k < 768 ? "nariaList-mobile" : "nariaList-desktop"} ${p?.list}`,
567
604
  "data-prop": "input",
568
605
  onScroll: n,
569
- children: u && X ? /* @__PURE__ */ a.jsx("div", { className: "nariaLoadingWrapper", children: /* @__PURE__ */ a.jsx(se, {}) }) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
570
- _ < 768 ? /* @__PURE__ */ a.jsxs("div", { className: `nariaSelectMobileHeader ${g?.mobileHeader}`, "data-prop": "mobileHeader", children: [
571
- j ? /* @__PURE__ */ a.jsxs("div", { className: "nariaSearchInput", children: [
572
- /* @__PURE__ */ a.jsx(
573
- "input",
574
- {
575
- ref: L,
576
- placeholder: m?.length ? m : "Select",
577
- className: `${l ? "text-dark-100" : "text-grey-300"}
578
- ${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"} ${g?.input}`,
579
- "data-prop": "input",
580
- value: B,
581
- disabled: E,
582
- type: "text",
583
- onChange: s
584
- }
585
- ),
586
- /* @__PURE__ */ a.jsx(
587
- oe,
588
- {
589
- className: "nariaSearchIcon"
590
- }
591
- )
592
- ] }) : void 0,
593
- /* @__PURE__ */ a.jsx("button", { className: "p-3", onClick: H, disabled: E, children: /* @__PURE__ */ a.jsx(fe, { className: "w-6" }) })
594
- ] }) : void 0,
595
- T?.length ? /* @__PURE__ */ a.jsx(a.Fragment, { children: T?.map((r, v) => /* @__PURE__ */ a.jsx(
606
+ children: c && X ? /* @__PURE__ */ a.jsx("div", { className: "nariaLoadingWrapper", children: /* @__PURE__ */ a.jsx(re, {}) }) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
607
+ k < 768 ? /* @__PURE__ */ a.jsxs(
608
+ "div",
609
+ {
610
+ className: `nariaSelectMobileHeader ${p?.mobileHeader}`,
611
+ "data-prop": "mobileHeader",
612
+ children: [
613
+ j ? /* @__PURE__ */ a.jsxs("div", { className: "nariaSearchInput", children: [
614
+ /* @__PURE__ */ a.jsx(
615
+ "input",
616
+ {
617
+ ref: L,
618
+ placeholder: m?.length ? m : "Select",
619
+ className: `${u ? "text-dark-100" : "text-grey-300"}
620
+ ${s && "!border-danger-100 focus:border-danger-100 outline-danger-100"} ${p?.input}`,
621
+ "data-prop": "input",
622
+ value: q,
623
+ disabled: E,
624
+ type: "text",
625
+ onChange: l
626
+ }
627
+ ),
628
+ /* @__PURE__ */ a.jsx(
629
+ se,
630
+ {
631
+ className: "nariaSearchIcon"
632
+ }
633
+ )
634
+ ] }) : void 0,
635
+ /* @__PURE__ */ a.jsx("button", { className: "p-3", onClick: H, disabled: E, children: /* @__PURE__ */ a.jsx(fe, { className: "w-6" }) })
636
+ ]
637
+ }
638
+ ) : void 0,
639
+ _?.length ? /* @__PURE__ */ a.jsx(a.Fragment, { children: _?.map((r, v) => /* @__PURE__ */ a.jsx(
596
640
  "button",
597
641
  {
598
642
  type: "button",
599
643
  onClick: () => V(r),
600
644
  disabled: E,
601
- className: `${g?.option} ${e(r)}`,
645
+ className: `nariaSelectOption ${p?.option} ${e(r)}`,
602
646
  "data-prop": "option",
647
+ "data-prop-active": "optionActive",
603
648
  children: o?.length ? r[o] : r
604
649
  },
605
650
  v.toString()
606
651
  )) }) : /* @__PURE__ */ a.jsx("div", { children: "No Data" }),
607
- w.isLoading ? /* @__PURE__ */ a.jsx("div", { className: "nariaLoadingMoreWrapper", children: /* @__PURE__ */ a.jsx(se, {}) }) : void 0
652
+ w.isLoading ? /* @__PURE__ */ a.jsx("div", { className: "nariaLoadingMoreWrapper", children: /* @__PURE__ */ a.jsx(re, {}) }) : void 0
608
653
  ] })
609
654
  }
610
655
  )
611
656
  }
612
657
  ) : void 0,
613
- c && /* @__PURE__ */ a.jsx("p", { className: "text-xs mt-1 text-danger-100", children: c })
658
+ s && /* @__PURE__ */ a.jsx("p", { className: "text-xs mt-1 text-danger-100", children: s })
614
659
  ]
615
660
  }
616
661
  );
package/package.json CHANGED
@@ -5,19 +5,18 @@
5
5
  "name": "Mohammad Mehdi Mohammadi",
6
6
  "url": ""
7
7
  },
8
- "version": "0.1.49",
8
+ "version": "0.1.51",
9
9
  "type": "module",
10
- "main": "dist/naria-ui.cjs.js",
11
- "module": "dist/naria-ui.es.js",
12
- "types": "dist/index.d.ts",
10
+ "main": "./dist/naria-ui.cjs.js",
11
+ "module": "./dist/naria-ui.es.js",
12
+ "types": "./dist/index.d.ts",
13
13
  "exports": {
14
14
  ".": {
15
15
  "types": "./dist/index.d.ts",
16
16
  "import": "./dist/naria-ui.es.js",
17
17
  "require": "./dist/naria-ui.cjs.js"
18
18
  },
19
- "./dist/*.css": "./dist/*.css",
20
- "./assets/*.css": "./assets/*.css"
19
+ "./*": "./*"
21
20
  },
22
21
  "files": [
23
22
  "dist"
@@ -30,7 +29,8 @@
30
29
  "build": "vite build",
31
30
  "tsc": "tsc -p tsconfig.build.json",
32
31
  "lint": "eslint .",
33
- "preview": "vite preview"
32
+ "preview": "vite preview",
33
+ "sass-prod": "sass --no-source-map --style=compressed public"
34
34
  },
35
35
  "dependencies": {
36
36
  "vite-plugin-svgr": "^4.5.0"