react-select-rohit10 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,16 +1,29 @@
1
- # React + Vite
1
+ # React Select Component
2
2
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3
+ An async, searchable Select component for React with support for **single select** and **multi-select** modes.
4
4
 
5
- Currently, two official plugins are available:
5
+ Built with:
6
+ - React
7
+ - TypeScript
8
+ - Keyboard navigation
9
+ - Controlled & uncontrolled usage
6
10
 
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
11
+ ---
9
12
 
10
- ## React Compiler
13
+ ## Features
11
14
 
12
- The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
15
+ - Search with debounce
16
+ - Keyboard navigation
17
+ - Single & multi-select support
18
+ - Controlled and uncontrolled modes
19
+ - ustom option rendering
20
+ - ustom selected value (chip) rendering
21
+ - Infinite scroll support
13
22
 
14
- ## Expanding the ESLint configuration
15
23
 
16
- If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
24
+ ---
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ npm install react-select-rohit10
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";const m=require("react");var H={exports:{}},Y={};var K;function ne(){if(K)return Y;K=1;var o=Symbol.for("react.transitional.element"),h=Symbol.for("react.fragment");function E(_,c,f){var p=null;if(f!==void 0&&(p=""+f),c.key!==void 0&&(p=""+c.key),"key"in c){f={};for(var R in c)R!=="key"&&(f[R]=c[R])}else f=c;return c=f.ref,{$$typeof:o,type:_,key:p,ref:c!==void 0?c:null,props:f}}return Y.Fragment=h,Y.jsx=E,Y.jsxs=E,Y}var $={};var ee;function ae(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&(function(){function o(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===U?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case y:return"Profiler";case k:return"StrictMode";case B:return"Suspense";case L:return"SuspenseList";case Z: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 g:return"Portal";case F:return e.displayName||"Context";case S:return(e._context.displayName||"Context")+".Consumer";case P:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case W:return r=e.displayName||null,r!==null?r:o(e.type)||"Memo";case C:r=e._payload,e=e._init;try{return o(e(r))}catch{}}return null}function h(e){return""+e}function E(e){try{h(e);var r=!1}catch{r=!0}if(r){r=console;var n=r.error,a=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",a),h(e)}}function _(e){if(e===u)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===C)return"<...>";try{var r=o(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function c(){var e=x.A;return e===null?null:e.getOwner()}function f(){return Error("react-stack-top-frame")}function p(e){if(V.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function R(e,r){function n(){M||(M=!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)",r))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function i(){var e=o(this.type);return z[e]||(z[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 Q(e,r,n,a,w,D){var s=n.ref;return e={$$typeof:I,type:e,key:r,props:n,_owner:a},(s!==void 0?s:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:i}):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:w}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:D}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function O(e,r,n,a,w,D){var s=r.children;if(s!==void 0)if(a)if(q(s)){for(a=0;a<s.length;a++)N(s[a]);Object.freeze&&Object.freeze(s)}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 N(s);if(V.call(r,"key")){s=o(e);var v=Object.keys(r).filter(function(l){return l!=="key"});a=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",X[s+a]||(v=0<v.length?"{"+v.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";const m=require("react");var Q={exports:{}},I={};var ee;function ne(){if(ee)return I;ee=1;var l=Symbol.for("react.transitional.element"),h=Symbol.for("react.fragment");function E(_,c,f){var p=null;if(f!==void 0&&(p=""+f),c.key!==void 0&&(p=""+c.key),"key"in c){f={};for(var R in c)R!=="key"&&(f[R]=c[R])}else f=c;return c=f.ref,{$$typeof:l,type:_,key:p,ref:c!==void 0?c:null,props:f}}return I.Fragment=h,I.jsx=E,I.jsxs=E,I}var F={};var re;function ae(){return re||(re=1,process.env.NODE_ENV!=="production"&&(function(){function l(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===D?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case d:return"Fragment";case k:return"Profiler";case T:return"StrictMode";case Z:return"Suspense";case U:return"SuspenseList";case K: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 g:return"Portal";case W:return e.displayName||"Context";case y:return(e._context.displayName||"Context")+".Consumer";case P:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return r=e.displayName||null,r!==null?r:l(e.type)||"Memo";case C:r=e._payload,e=e._init;try{return l(e(r))}catch{}}return null}function h(e){return""+e}function E(e){try{h(e);var r=!1}catch{r=!0}if(r){r=console;var n=r.error,a=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",a),h(e)}}function _(e){if(e===d)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===C)return"<...>";try{var r=l(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function c(){var e=S.A;return e===null?null:e.getOwner()}function f(){return Error("react-stack-top-frame")}function p(e){if(q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function R(e,r){function n(){z||(z=!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)",r))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function u(){var e=l(this.type);return J[e]||(J[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 B(e,r,n,a,j,Y){var s=n.ref;return e={$$typeof:L,type:e,key:r,props:n,_owner:a},(s!==void 0?s:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:u}):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:j}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function O(e,r,n,a,j,Y){var s=r.children;if(s!==void 0)if(a)if(M(s)){for(a=0;a<s.length;a++)N(s[a]);Object.freeze&&Object.freeze(s)}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 N(s);if(q.call(r,"key")){s=l(e);var v=Object.keys(r).filter(function(o){return o!=="key"});a=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",H[s+a]||(v=0<v.length?"{"+v.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,a,s,v,s),X[s+a]=!0)}if(s=null,n!==void 0&&(E(n),s=""+n),p(r)&&(E(r.key),s=""+r.key),"key"in r){n={};for(var t in r)t!=="key"&&(n[t]=r[t])}else n=r;return s&&R(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),Q(e,s,n,c(),w,D)}function N(e){A(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===C&&(e._payload.status==="fulfilled"?A(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function A(e){return typeof e=="object"&&e!==null&&e.$$typeof===I}var T=m,I=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),F=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),U=Symbol.for("react.client.reference"),x=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,q=Array.isArray,j=console.createTask?console.createTask:function(){return null};T={react_stack_bottom_frame:function(e){return e()}};var M,z={},J=T.react_stack_bottom_frame.bind(T,f)(),G=j(_(f)),X={};$.Fragment=u,$.jsx=function(e,r,n){var a=1e4>x.recentlyCreatedOwnerStacks++;return O(e,r,n,!1,a?Error("react-stack-top-frame"):J,a?j(_(e)):G)},$.jsxs=function(e,r,n){var a=1e4>x.recentlyCreatedOwnerStacks++;return O(e,r,n,!0,a?Error("react-stack-top-frame"):J,a?j(_(e)):G)}})()),$}var re;function se(){return re||(re=1,process.env.NODE_ENV==="production"?H.exports=ne():H.exports=ae()),H.exports}var d=se();function oe({event:o,open:h,options:E,highlightedIndex:_,setHighlightedIndex:c,onSelect:f,closeDropdown:p,userNavigatedRef:R}){if(h){if(o.key==="ArrowDown"&&(o.preventDefault(),R.current=!0,c(i=>Math.min(i+1,E.length-1))),o.key==="ArrowUp"&&(o.preventDefault(),R.current=!0,c(i=>Math.max(i-1,0))),o.key==="Enter"){o.preventDefault();const i=E[_];i&&f(i)}o.key==="Escape"&&p()}}function le({options:o=[],value:h,onChange:E,onClear:_,onSearch:c,onReachEnd:f,isLoading:p=!1,hasMoreOptions:R=!1,isMultipleAllowed:i=!0,placeholder:Q,renderOption:O,renderChipValue:N}){const A=h!==void 0,[T,I]=m.useState(i?[]:null),g=A?h:T;let u;i?Array.isArray(g)?u=g:u=[]:Array.isArray(g)?u=null:u=g??null;function k(t){A||I(t),E?.(t)}const[y,S]=m.useState(!1),[F,P]=m.useState(0),[B,L]=m.useState(""),W=m.useRef(null),C=m.useRef(null),Z=m.useRef(null),U=m.useRef(null),x=m.useRef(!1),V=m.useRef(!1),q=i?u:u?[u]:[],j=q.length>0,M=()=>S(!1),z=()=>S(t=>!t),J=t=>oe({event:t,open:y,options:o,highlightedIndex:F,setHighlightedIndex:P,onSelect:e,closeDropdown:M,userNavigatedRef:V}),G=t=>{t.stopPropagation(),k(i?[]:null),_?.()},X=t=>{const l=t.target.value;L(l),clearTimeout(U.current),U.current=setTimeout(()=>c?.(l.trim()),300)};m.useEffect(()=>{function t(l){W.current?.contains(l.target)||S(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]),m.useEffect(()=>{y||(L(""),P(0),c?.(""))},[y]);function e(t){if(!i){k(t),S(!1);return}const l=u.some(b=>b.id===t.id);k(l?u.filter(b=>b.id!==t.id):[...u,t])}function r(t){return l=>{l.stopPropagation(),k(u.filter(b=>b.id!==t.id))}}function n(t){if(!R||x.current)return;const l=t.currentTarget;l.scrollTop+l.clientHeight>=l.scrollHeight-5&&(x.current=!0,f?.())}function a({selected:t,highlighted:l}){return`select-option ${t?"selected":""} ${l?"highlighted":""}`}function w(){return j?q.map(t=>d.jsxs("span",{className:"chip",children:[N?N(t):t.label,i&&d.jsx("button",{className:"chip-remove",onClick:r(t),children:"×"})]},t.id)):d.jsx("span",{className:"placeholder",children:Q})}function D(){return o.map((t,l)=>{const b=i?u.some(te=>te.id===t.id):u?.id===t.id;return d.jsx("li",{className:a({selected:b,highlighted:l===F}),onMouseEnter:()=>P(l),onClick:()=>e(t),children:O?O(t,{selected:b}):t.label},t.id)})}function s(){return p?d.jsx("li",{className:"select-loading",children:"Loading…"}):!p&&o.length===0?d.jsx("li",{className:"select-empty",children:"No results"}):null}function v(){return y?d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:C,className:"select-search",value:B,onChange:X}),d.jsxs("ul",{ref:Z,className:"select-dropdown",onScroll:n,children:[D(),s()]})]}):null}return d.jsxs("div",{ref:W,className:"select-wrapper",tabIndex:0,onKeyDown:J,children:[d.jsxs("div",{className:"select-trigger",onClick:z,children:[d.jsx("div",{className:"chips",children:w()}),j&&d.jsx("button",{className:"clear-btn",onClick:G,children:"Clear"})]}),v()]})}module.exports=le;
6
+ <%s key={someKey} {...props} />`,a,s,v,s),H[s+a]=!0)}if(s=null,n!==void 0&&(E(n),s=""+n),p(r)&&(E(r.key),s=""+r.key),"key"in r){n={};for(var t in r)t!=="key"&&(n[t]=r[t])}else n=r;return s&&R(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),B(e,s,n,c(),j,Y)}function N(e){A(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===C&&(e._payload.status==="fulfilled"?A(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function A(e){return typeof e=="object"&&e!==null&&e.$$typeof===L}var b=m,L=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),W=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),S=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,M=Array.isArray,x=console.createTask?console.createTask:function(){return null};b={react_stack_bottom_frame:function(e){return e()}};var z,J={},G=b.react_stack_bottom_frame.bind(b,f)(),X=x(_(f)),H={};F.Fragment=d,F.jsx=function(e,r,n){var a=1e4>S.recentlyCreatedOwnerStacks++;return O(e,r,n,!1,a?Error("react-stack-top-frame"):G,a?x(_(e)):X)},F.jsxs=function(e,r,n){var a=1e4>S.recentlyCreatedOwnerStacks++;return O(e,r,n,!0,a?Error("react-stack-top-frame"):G,a?x(_(e)):X)}})()),F}var te;function se(){return te||(te=1,process.env.NODE_ENV==="production"?Q.exports=ne():Q.exports=ae()),Q.exports}var i=se();function oe({event:l,open:h,options:E,highlightedIndex:_,setHighlightedIndex:c,onSelect:f,closeDropdown:p,userNavigatedRef:R}){if(h){if(l.key==="ArrowDown"&&(l.preventDefault(),R.current=!0,c(u=>Math.min(u+1,E.length-1))),l.key==="ArrowUp"&&(l.preventDefault(),R.current=!0,c(u=>Math.max(u-1,0))),l.key==="Enter"){l.preventDefault();const u=E[_];u&&f(u)}l.key==="Escape"&&p()}}function le({options:l,value:h,onChange:E,onClear:_,onSearch:c,onReachEnd:f,isLoading:p=!1,hasMoreOptions:R=!1,isMultipleAllowed:u=!0,placeholder:B,renderOption:O,renderChipValue:N}){const A=h!==void 0,[b,L]=m.useState(u?[]:null),g=A?h:b;let d;u?d=Array.isArray(g)?g:[]:d=Array.isArray(g)?null:g??null;function T(t){A||L(t),E?.(t)}const[k,y]=m.useState(!1),[W,P]=m.useState(0),[Z,U]=m.useState(""),V=m.useRef(null),C=m.useRef(null),K=m.useRef(null),D=m.useRef(null),S=m.useRef(!1),q=m.useRef(!1),M=u?d:d?[d]:[],x=M.length>0,z=()=>y(!1),J=()=>y(t=>!t),G=t=>oe({event:t,open:k,options:l,highlightedIndex:W,setHighlightedIndex:P,onSelect:e,closeDropdown:z,userNavigatedRef:q}),X=t=>{t.stopPropagation(),T(u?[]:null),_?.()},H=t=>{const o=t.target.value;U(o),D.current!==null&&clearTimeout(D.current),D.current=window.setTimeout(()=>{c?.(o.trim())},300)};m.useEffect(()=>{function t(o){V.current?.contains(o.target)||y(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]),m.useEffect(()=>{k||(U(""),P(0),c?.(""))},[k,c]);function e(t){if(!u){T(t),y(!1);return}const o=d,w=o.some($=>$.id===t.id);T(w?o.filter($=>$.id!==t.id):[...o,t])}function r(t){return o=>{o.stopPropagation(),T(d.filter(w=>w.id!==t.id))}}function n(t){if(!R||S.current)return;const o=t.currentTarget;o.scrollTop+o.clientHeight>=o.scrollHeight-5&&(S.current=!0,f?.())}function a({selected:t,highlighted:o}){return`select-option ${t?"selected":""} ${o?"highlighted":""}`}function j(){return x?i.jsx(i.Fragment,{children:M.map(t=>i.jsxs("span",{className:"chip",children:[N?N(t):t.label,u&&i.jsx("button",{className:"chip-remove",onClick:r(t),children:"×"})]},t.id))}):i.jsx("span",{className:"placeholder",children:B})}function Y(){return l.map((t,o)=>{const w=u?d.some($=>$.id===t.id):d?.id===t.id;return i.jsx("li",{className:a({selected:w,highlighted:o===W}),onMouseEnter:()=>P(o),onClick:()=>e(t),children:O?O(t,{selected:w}):t.label},t.id)})}function s(){return p?i.jsx("li",{className:"select-loading",children:"Loading…"}):!p&&l.length===0?i.jsx("li",{className:"select-empty",children:"No results"}):null}function v(){return k?i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:C,className:"select-search",value:Z,onChange:H}),i.jsxs("ul",{ref:K,className:"select-dropdown",onScroll:n,children:[Y(),s()]})]}):null}return i.jsxs("div",{ref:V,className:"select-wrapper",tabIndex:0,onKeyDown:G,children:[i.jsxs("div",{className:"select-trigger",onClick:J,children:[i.jsx("div",{className:"chips",children:j()}),x&&i.jsx("button",{className:"clear-btn",onClick:X,children:"Clear"})]}),v()]})}module.exports=le;
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import oe, { useState as H, useRef as w, useEffect as ee } from "react";
2
- var Q = { exports: {} }, Y = {};
3
- var re;
1
+ import oe, { useState as Q, useRef as S, useEffect as re } from "react";
2
+ var B = { exports: {} }, I = {};
3
+ var te;
4
4
  function se() {
5
- if (re) return Y;
6
- re = 1;
7
- var s = /* @__PURE__ */ Symbol.for("react.transitional.element"), h = /* @__PURE__ */ Symbol.for("react.fragment");
5
+ if (te) return I;
6
+ te = 1;
7
+ var l = /* @__PURE__ */ Symbol.for("react.transitional.element"), h = /* @__PURE__ */ Symbol.for("react.fragment");
8
8
  function m(_, c, f) {
9
9
  var p = null;
10
10
  if (f !== void 0 && (p = "" + f), c.key !== void 0 && (p = "" + c.key), "key" in c) {
@@ -13,57 +13,57 @@ function se() {
13
13
  E !== "key" && (f[E] = c[E]);
14
14
  } else f = c;
15
15
  return c = f.ref, {
16
- $$typeof: s,
16
+ $$typeof: l,
17
17
  type: _,
18
18
  key: p,
19
19
  ref: c !== void 0 ? c : null,
20
20
  props: f
21
21
  };
22
22
  }
23
- return Y.Fragment = h, Y.jsx = m, Y.jsxs = m, Y;
23
+ return I.Fragment = h, I.jsx = m, I.jsxs = m, I;
24
24
  }
25
- var $ = {};
26
- var te;
25
+ var F = {};
26
+ var ne;
27
27
  function le() {
28
- return te || (te = 1, process.env.NODE_ENV !== "production" && (function() {
29
- function s(e) {
28
+ return ne || (ne = 1, process.env.NODE_ENV !== "production" && (function() {
29
+ function l(e) {
30
30
  if (e == null) return null;
31
31
  if (typeof e == "function")
32
- return e.$$typeof === U ? null : e.displayName || e.name || null;
32
+ return e.$$typeof === D ? null : e.displayName || e.name || null;
33
33
  if (typeof e == "string") return e;
34
34
  switch (e) {
35
- case u:
35
+ case d:
36
36
  return "Fragment";
37
- case k:
37
+ case T:
38
38
  return "Profiler";
39
39
  case g:
40
40
  return "StrictMode";
41
- case Z:
41
+ case K:
42
42
  return "Suspense";
43
- case L:
43
+ case U:
44
44
  return "SuspenseList";
45
- case K:
45
+ case ee:
46
46
  return "Activity";
47
47
  }
48
48
  if (typeof e == "object")
49
49
  switch (typeof e.tag == "number" && console.error(
50
50
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
51
51
  ), e.$$typeof) {
52
- case T:
52
+ case b:
53
53
  return "Portal";
54
- case F:
54
+ case W:
55
55
  return e.displayName || "Context";
56
- case y:
56
+ case k:
57
57
  return (e._context.displayName || "Context") + ".Consumer";
58
58
  case P:
59
59
  var r = e.render;
60
60
  return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
61
- case W:
62
- return r = e.displayName || null, r !== null ? r : s(e.type) || "Memo";
61
+ case V:
62
+ return r = e.displayName || null, r !== null ? r : l(e.type) || "Memo";
63
63
  case C:
64
64
  r = e._payload, e = e._init;
65
65
  try {
66
- return s(e(r));
66
+ return l(e(r));
67
67
  } catch {
68
68
  }
69
69
  }
@@ -90,25 +90,25 @@ function le() {
90
90
  }
91
91
  }
92
92
  function _(e) {
93
- if (e === u) return "<>";
93
+ if (e === d) return "<>";
94
94
  if (typeof e == "object" && e !== null && e.$$typeof === C)
95
95
  return "<...>";
96
96
  try {
97
- var r = s(e);
97
+ var r = l(e);
98
98
  return r ? "<" + r + ">" : "<...>";
99
99
  } catch {
100
100
  return "<...>";
101
101
  }
102
102
  }
103
103
  function c() {
104
- var e = x.A;
104
+ var e = y.A;
105
105
  return e === null ? null : e.getOwner();
106
106
  }
107
107
  function f() {
108
108
  return Error("react-stack-top-frame");
109
109
  }
110
110
  function p(e) {
111
- if (V.call(e, "key")) {
111
+ if (M.call(e, "key")) {
112
112
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
113
113
  if (r && r.isReactWarning) return !1;
114
114
  }
@@ -116,7 +116,7 @@ function le() {
116
116
  }
117
117
  function E(e, r) {
118
118
  function n() {
119
- q || (q = !0, console.error(
119
+ z || (z = !0, console.error(
120
120
  "%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)",
121
121
  r
122
122
  ));
@@ -126,23 +126,23 @@ function le() {
126
126
  configurable: !0
127
127
  });
128
128
  }
129
- function i() {
130
- var e = s(this.type);
131
- return z[e] || (z[e] = !0, console.error(
129
+ function u() {
130
+ var e = l(this.type);
131
+ return J[e] || (J[e] = !0, console.error(
132
132
  "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."
133
133
  )), e = this.props.ref, e !== void 0 ? e : null;
134
134
  }
135
- function B(e, r, n, a, j, D) {
135
+ function Z(e, r, n, a, j, Y) {
136
136
  var o = n.ref;
137
137
  return e = {
138
- $$typeof: I,
138
+ $$typeof: L,
139
139
  type: e,
140
140
  key: r,
141
141
  props: n,
142
142
  _owner: a
143
143
  }, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
144
144
  enumerable: !1,
145
- get: i
145
+ get: u
146
146
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
147
147
  configurable: !1,
148
148
  enumerable: !1,
@@ -162,14 +162,14 @@ function le() {
162
162
  configurable: !1,
163
163
  enumerable: !1,
164
164
  writable: !0,
165
- value: D
165
+ value: Y
166
166
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
167
167
  }
168
- function O(e, r, n, a, j, D) {
168
+ function O(e, r, n, a, j, Y) {
169
169
  var o = r.children;
170
170
  if (o !== void 0)
171
171
  if (a)
172
- if (M(o)) {
172
+ if (q(o)) {
173
173
  for (a = 0; a < o.length; a++)
174
174
  N(o[a]);
175
175
  Object.freeze && Object.freeze(o);
@@ -178,12 +178,12 @@ function le() {
178
178
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
179
179
  );
180
180
  else N(o);
181
- if (V.call(r, "key")) {
182
- o = s(e);
183
- var R = Object.keys(r).filter(function(l) {
184
- return l !== "key";
181
+ if (M.call(r, "key")) {
182
+ o = l(e);
183
+ var R = Object.keys(r).filter(function(s) {
184
+ return s !== "key";
185
185
  });
186
- a = 0 < R.length ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}", X[o + a] || (R = 0 < R.length ? "{" + R.join(": ..., ") + ": ...}" : "{}", console.error(
186
+ a = 0 < R.length ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}", H[o + a] || (R = 0 < R.length ? "{" + R.join(": ..., ") + ": ...}" : "{}", console.error(
187
187
  `A props object containing a "key" prop is being spread into JSX:
188
188
  let props = %s;
189
189
  <%s {...props} />
@@ -194,7 +194,7 @@ React keys must be passed directly to JSX without using spread:
194
194
  o,
195
195
  R,
196
196
  o
197
- ), X[o + a] = !0);
197
+ ), H[o + a] = !0);
198
198
  }
199
199
  if (o = null, n !== void 0 && (m(n), o = "" + n), p(r) && (m(r.key), o = "" + r.key), "key" in r) {
200
200
  n = {};
@@ -204,63 +204,63 @@ React keys must be passed directly to JSX without using spread:
204
204
  return o && E(
205
205
  n,
206
206
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
207
- ), B(
207
+ ), Z(
208
208
  e,
209
209
  o,
210
210
  n,
211
211
  c(),
212
212
  j,
213
- D
213
+ Y
214
214
  );
215
215
  }
216
216
  function N(e) {
217
217
  A(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === C && (e._payload.status === "fulfilled" ? A(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
218
218
  }
219
219
  function A(e) {
220
- return typeof e == "object" && e !== null && e.$$typeof === I;
220
+ return typeof e == "object" && e !== null && e.$$typeof === L;
221
221
  }
222
- var b = oe, I = /* @__PURE__ */ Symbol.for("react.transitional.element"), T = /* @__PURE__ */ Symbol.for("react.portal"), u = /* @__PURE__ */ Symbol.for("react.fragment"), g = /* @__PURE__ */ Symbol.for("react.strict_mode"), k = /* @__PURE__ */ Symbol.for("react.profiler"), y = /* @__PURE__ */ Symbol.for("react.consumer"), F = /* @__PURE__ */ Symbol.for("react.context"), P = /* @__PURE__ */ Symbol.for("react.forward_ref"), Z = /* @__PURE__ */ Symbol.for("react.suspense"), L = /* @__PURE__ */ Symbol.for("react.suspense_list"), W = /* @__PURE__ */ Symbol.for("react.memo"), C = /* @__PURE__ */ Symbol.for("react.lazy"), K = /* @__PURE__ */ Symbol.for("react.activity"), U = /* @__PURE__ */ Symbol.for("react.client.reference"), x = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, M = Array.isArray, S = console.createTask ? console.createTask : function() {
222
+ var v = oe, L = /* @__PURE__ */ Symbol.for("react.transitional.element"), b = /* @__PURE__ */ Symbol.for("react.portal"), d = /* @__PURE__ */ Symbol.for("react.fragment"), g = /* @__PURE__ */ Symbol.for("react.strict_mode"), T = /* @__PURE__ */ Symbol.for("react.profiler"), k = /* @__PURE__ */ Symbol.for("react.consumer"), W = /* @__PURE__ */ Symbol.for("react.context"), P = /* @__PURE__ */ Symbol.for("react.forward_ref"), K = /* @__PURE__ */ Symbol.for("react.suspense"), U = /* @__PURE__ */ Symbol.for("react.suspense_list"), V = /* @__PURE__ */ Symbol.for("react.memo"), C = /* @__PURE__ */ Symbol.for("react.lazy"), ee = /* @__PURE__ */ Symbol.for("react.activity"), D = /* @__PURE__ */ Symbol.for("react.client.reference"), y = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, q = Array.isArray, x = console.createTask ? console.createTask : function() {
223
223
  return null;
224
224
  };
225
- b = {
225
+ v = {
226
226
  react_stack_bottom_frame: function(e) {
227
227
  return e();
228
228
  }
229
229
  };
230
- var q, z = {}, J = b.react_stack_bottom_frame.bind(
231
- b,
230
+ var z, J = {}, G = v.react_stack_bottom_frame.bind(
231
+ v,
232
232
  f
233
- )(), G = S(_(f)), X = {};
234
- $.Fragment = u, $.jsx = function(e, r, n) {
235
- var a = 1e4 > x.recentlyCreatedOwnerStacks++;
233
+ )(), X = x(_(f)), H = {};
234
+ F.Fragment = d, F.jsx = function(e, r, n) {
235
+ var a = 1e4 > y.recentlyCreatedOwnerStacks++;
236
236
  return O(
237
237
  e,
238
238
  r,
239
239
  n,
240
240
  !1,
241
- a ? Error("react-stack-top-frame") : J,
242
- a ? S(_(e)) : G
241
+ a ? Error("react-stack-top-frame") : G,
242
+ a ? x(_(e)) : X
243
243
  );
244
- }, $.jsxs = function(e, r, n) {
245
- var a = 1e4 > x.recentlyCreatedOwnerStacks++;
244
+ }, F.jsxs = function(e, r, n) {
245
+ var a = 1e4 > y.recentlyCreatedOwnerStacks++;
246
246
  return O(
247
247
  e,
248
248
  r,
249
249
  n,
250
250
  !0,
251
- a ? Error("react-stack-top-frame") : J,
252
- a ? S(_(e)) : G
251
+ a ? Error("react-stack-top-frame") : G,
252
+ a ? x(_(e)) : X
253
253
  );
254
254
  };
255
- })()), $;
255
+ })()), F;
256
256
  }
257
- var ne;
257
+ var ae;
258
258
  function ce() {
259
- return ne || (ne = 1, process.env.NODE_ENV === "production" ? Q.exports = se() : Q.exports = le()), Q.exports;
259
+ return ae || (ae = 1, process.env.NODE_ENV === "production" ? B.exports = se() : B.exports = le()), B.exports;
260
260
  }
261
- var d = ce();
261
+ var i = ce();
262
262
  function ue({
263
- event: s,
263
+ event: l,
264
264
  open: h,
265
265
  options: m,
266
266
  highlightedIndex: _,
@@ -270,20 +270,20 @@ function ue({
270
270
  userNavigatedRef: E
271
271
  }) {
272
272
  if (h) {
273
- if (s.key === "ArrowDown" && (s.preventDefault(), E.current = !0, c(
274
- (i) => Math.min(i + 1, m.length - 1)
275
- )), s.key === "ArrowUp" && (s.preventDefault(), E.current = !0, c(
276
- (i) => Math.max(i - 1, 0)
277
- )), s.key === "Enter") {
278
- s.preventDefault();
279
- const i = m[_];
280
- i && f(i);
273
+ if (l.key === "ArrowDown" && (l.preventDefault(), E.current = !0, c(
274
+ (u) => Math.min(u + 1, m.length - 1)
275
+ )), l.key === "ArrowUp" && (l.preventDefault(), E.current = !0, c(
276
+ (u) => Math.max(u - 1, 0)
277
+ )), l.key === "Enter") {
278
+ l.preventDefault();
279
+ const u = m[_];
280
+ u && f(u);
281
281
  }
282
- s.key === "Escape" && p();
282
+ l.key === "Escape" && p();
283
283
  }
284
284
  }
285
285
  function fe({
286
- options: s = [],
286
+ options: l,
287
287
  value: h,
288
288
  onChange: m,
289
289
  onClear: _,
@@ -291,157 +291,173 @@ function fe({
291
291
  onReachEnd: f,
292
292
  isLoading: p = !1,
293
293
  hasMoreOptions: E = !1,
294
- isMultipleAllowed: i = !0,
295
- placeholder: B,
294
+ isMultipleAllowed: u = !0,
295
+ placeholder: Z,
296
296
  renderOption: O,
297
297
  renderChipValue: N
298
298
  }) {
299
- const A = h !== void 0, [b, I] = H(
300
- i ? [] : null
301
- ), T = A ? h : b;
302
- let u;
303
- i ? Array.isArray(T) ? u = T : u = [] : Array.isArray(T) ? u = null : u = T ?? null;
299
+ const A = h !== void 0, [v, L] = Q(u ? [] : null), b = A ? h : v;
300
+ let d;
301
+ u ? d = Array.isArray(b) ? b : [] : d = Array.isArray(b) ? null : b ?? null;
304
302
  function g(t) {
305
- A || I(t), m?.(t);
303
+ A || L(t), m?.(t);
306
304
  }
307
- const [k, y] = H(!1), [F, P] = H(0), [Z, L] = H(""), W = w(null), C = w(null), K = w(null), U = w(null), x = w(!1), V = w(!1), M = i ? u : u ? [u] : [], S = M.length > 0, q = () => y(!1), z = () => y((t) => !t), J = (t) => ue({
305
+ const [T, k] = Q(!1), [W, P] = Q(0), [K, U] = Q(""), V = S(null), C = S(null), ee = S(null), D = S(null), y = S(!1), M = S(!1), q = u ? d : d ? [d] : [], x = q.length > 0, z = () => k(!1), J = () => k((t) => !t), G = (t) => ue({
308
306
  event: t,
309
- open: k,
310
- options: s,
311
- highlightedIndex: F,
307
+ open: T,
308
+ options: l,
309
+ highlightedIndex: W,
312
310
  setHighlightedIndex: P,
313
311
  onSelect: e,
314
- closeDropdown: q,
315
- userNavigatedRef: V
316
- }), G = (t) => {
317
- t.stopPropagation(), g(i ? [] : null), _?.();
318
- }, X = (t) => {
319
- const l = t.target.value;
320
- L(l), clearTimeout(U.current), U.current = setTimeout(
321
- () => c?.(l.trim()),
322
- 300
323
- );
312
+ closeDropdown: z,
313
+ userNavigatedRef: M
314
+ }), X = (t) => {
315
+ t.stopPropagation(), g(u ? [] : null), _?.();
316
+ }, H = (t) => {
317
+ const s = t.target.value;
318
+ U(s), D.current !== null && clearTimeout(D.current), D.current = window.setTimeout(() => {
319
+ c?.(s.trim());
320
+ }, 300);
324
321
  };
325
- ee(() => {
326
- function t(l) {
327
- W.current?.contains(l.target) || y(!1);
322
+ re(() => {
323
+ function t(s) {
324
+ V.current?.contains(
325
+ s.target
326
+ ) || k(!1);
328
327
  }
329
- return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
330
- }, []), ee(() => {
331
- k || (L(""), P(0), c?.(""));
332
- }, [k]);
328
+ return document.addEventListener(
329
+ "mousedown",
330
+ t
331
+ ), () => document.removeEventListener(
332
+ "mousedown",
333
+ t
334
+ );
335
+ }, []), re(() => {
336
+ T || (U(""), P(0), c?.(""));
337
+ }, [T, c]);
333
338
  function e(t) {
334
- if (!i) {
335
- g(t), y(!1);
339
+ if (!u) {
340
+ g(t), k(!1);
336
341
  return;
337
342
  }
338
- const l = u.some(
339
- (v) => v.id === t.id
343
+ const s = d, w = s.some(
344
+ ($) => $.id === t.id
340
345
  );
341
346
  g(
342
- l ? u.filter(
343
- (v) => v.id !== t.id
344
- ) : [...u, t]
347
+ w ? s.filter(
348
+ ($) => $.id !== t.id
349
+ ) : [...s, t]
345
350
  );
346
351
  }
347
352
  function r(t) {
348
- return (l) => {
349
- l.stopPropagation(), g(
350
- u.filter(
351
- (v) => v.id !== t.id
353
+ return (s) => {
354
+ s.stopPropagation(), g(
355
+ d.filter(
356
+ (w) => w.id !== t.id
352
357
  )
353
358
  );
354
359
  };
355
360
  }
356
361
  function n(t) {
357
- if (!E || x.current) return;
358
- const l = t.currentTarget;
359
- l.scrollTop + l.clientHeight >= l.scrollHeight - 5 && (x.current = !0, f?.());
362
+ if (!E || y.current)
363
+ return;
364
+ const s = t.currentTarget;
365
+ s.scrollTop + s.clientHeight >= s.scrollHeight - 5 && (y.current = !0, f?.());
360
366
  }
361
- function a({ selected: t, highlighted: l }) {
362
- return `select-option ${t ? "selected" : ""} ${l ? "highlighted" : ""}`;
367
+ function a({
368
+ selected: t,
369
+ highlighted: s
370
+ }) {
371
+ return `select-option ${t ? "selected" : ""} ${s ? "highlighted" : ""}`;
363
372
  }
364
373
  function j() {
365
- return S ? M.map((t) => /* @__PURE__ */ d.jsxs("span", { className: "chip", children: [
366
- N ? N(t) : t.label,
367
- i && /* @__PURE__ */ d.jsx(
368
- "button",
369
- {
370
- className: "chip-remove",
371
- onClick: r(t),
372
- children: "×"
373
- }
374
- )
375
- ] }, t.id)) : /* @__PURE__ */ d.jsx("span", { className: "placeholder", children: B });
374
+ return x ? /* @__PURE__ */ i.jsx(i.Fragment, { children: q.map((t) => /* @__PURE__ */ i.jsxs(
375
+ "span",
376
+ {
377
+ className: "chip",
378
+ children: [
379
+ N ? N(t) : t.label,
380
+ u && /* @__PURE__ */ i.jsx(
381
+ "button",
382
+ {
383
+ className: "chip-remove",
384
+ onClick: r(t),
385
+ children: "×"
386
+ }
387
+ )
388
+ ]
389
+ },
390
+ t.id
391
+ )) }) : /* @__PURE__ */ i.jsx("span", { className: "placeholder", children: Z });
376
392
  }
377
- function D() {
378
- return s.map((t, l) => {
379
- const v = i ? u.some(
380
- (ae) => ae.id === t.id
381
- ) : u?.id === t.id;
382
- return /* @__PURE__ */ d.jsx(
393
+ function Y() {
394
+ return l.map((t, s) => {
395
+ const w = u ? d.some(
396
+ ($) => $.id === t.id
397
+ ) : d?.id === t.id;
398
+ return /* @__PURE__ */ i.jsx(
383
399
  "li",
384
400
  {
385
401
  className: a({
386
- selected: v,
387
- highlighted: l === F
402
+ selected: w,
403
+ highlighted: s === W
388
404
  }),
389
- onMouseEnter: () => P(l),
405
+ onMouseEnter: () => P(s),
390
406
  onClick: () => e(t),
391
- children: O ? O(t, { selected: v }) : t.label
407
+ children: O ? O(t, { selected: w }) : t.label
392
408
  },
393
409
  t.id
394
410
  );
395
411
  });
396
412
  }
397
413
  function o() {
398
- return p ? /* @__PURE__ */ d.jsx("li", { className: "select-loading", children: "Loading…" }) : !p && s.length === 0 ? /* @__PURE__ */ d.jsx("li", { className: "select-empty", children: "No results" }) : null;
414
+ return p ? /* @__PURE__ */ i.jsx("li", { className: "select-loading", children: "Loading…" }) : !p && l.length === 0 ? /* @__PURE__ */ i.jsx("li", { className: "select-empty", children: "No results" }) : null;
399
415
  }
400
416
  function R() {
401
- return k ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
402
- /* @__PURE__ */ d.jsx(
417
+ return T ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
418
+ /* @__PURE__ */ i.jsx(
403
419
  "input",
404
420
  {
405
421
  ref: C,
406
422
  className: "select-search",
407
- value: Z,
408
- onChange: X
423
+ value: K,
424
+ onChange: H
409
425
  }
410
426
  ),
411
- /* @__PURE__ */ d.jsxs(
427
+ /* @__PURE__ */ i.jsxs(
412
428
  "ul",
413
429
  {
414
- ref: K,
430
+ ref: ee,
415
431
  className: "select-dropdown",
416
432
  onScroll: n,
417
433
  children: [
418
- D(),
434
+ Y(),
419
435
  o()
420
436
  ]
421
437
  }
422
438
  )
423
439
  ] }) : null;
424
440
  }
425
- return /* @__PURE__ */ d.jsxs(
441
+ return /* @__PURE__ */ i.jsxs(
426
442
  "div",
427
443
  {
428
- ref: W,
444
+ ref: V,
429
445
  className: "select-wrapper",
430
446
  tabIndex: 0,
431
- onKeyDown: J,
447
+ onKeyDown: G,
432
448
  children: [
433
- /* @__PURE__ */ d.jsxs(
449
+ /* @__PURE__ */ i.jsxs(
434
450
  "div",
435
451
  {
436
452
  className: "select-trigger",
437
- onClick: z,
453
+ onClick: J,
438
454
  children: [
439
- /* @__PURE__ */ d.jsx("div", { className: "chips", children: j() }),
440
- S && /* @__PURE__ */ d.jsx(
455
+ /* @__PURE__ */ i.jsx("div", { className: "chips", children: j() }),
456
+ x && /* @__PURE__ */ i.jsx(
441
457
  "button",
442
458
  {
443
459
  className: "clear-btn",
444
- onClick: G,
460
+ onClick: X,
445
461
  children: "Clear"
446
462
  }
447
463
  )
package/package.json CHANGED
@@ -1,18 +1,25 @@
1
1
  {
2
2
  "name": "react-select-rohit10",
3
- "version": "1.0.2",
4
- "license": "MIT",
5
- "type": "module",
3
+ "version": "1.0.3",
6
4
  "description": "Async searchable select component with single and multi-select support",
5
+ "license": "MIT",
7
6
  "keywords": [
8
7
  "react",
9
8
  "select",
10
9
  "async",
11
10
  "multiselect"
12
11
  ],
13
- "main": "dist/index.cjs",
14
- "module": "dist/index.js",
15
- "types": "types/index.d.ts",
12
+ "type": "module",
13
+ "main": "./dist/index.cjs",
14
+ "module": "./dist/index.js",
15
+ "types": "./types/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/index.js",
19
+ "require": "./dist/index.cjs",
20
+ "types": "./types/index.d.ts"
21
+ }
22
+ },
16
23
  "files": [
17
24
  "dist",
18
25
  "types"
@@ -34,6 +41,8 @@
34
41
  "eslint-plugin-react-hooks": "^7.0.1",
35
42
  "eslint-plugin-react-refresh": "^0.4.24",
36
43
  "globals": "^16.5.0",
44
+ "ts-node": "^10.9.2",
45
+ "typescript": "^5.9.3",
37
46
  "vite": "^7.2.4"
38
47
  }
39
48
  }
package/types/index.d.ts CHANGED
@@ -1,77 +1,41 @@
1
1
  import * as React from "react";
2
2
 
3
-
4
3
  export interface SelectOption {
5
4
  id: string | number;
6
5
  label: string;
7
- [key: string]: any;
8
6
  }
9
7
 
10
8
  export interface RenderOptionMeta {
11
9
  selected: boolean;
12
10
  }
13
11
 
14
- export interface SelectProps<
15
- T extends SelectOption = SelectOption
16
- > {
17
- /** List of available options */
18
- options: T[];
19
-
20
- /**
21
- * Controlled value
22
- * - single: T | null
23
- * - multiple: T[]
24
- */
25
- value?: T | T[] | null;
12
+ export interface SelectProps {
13
+ options: SelectOption[];
26
14
 
27
- /**
28
- * Fired on selection change
29
- * Matches single / multiple mode automatically
30
- */
31
- onChange?: (value: T | T[] | null) => void;
15
+ value?: SelectOption | SelectOption[] | null;
16
+ onChange?: (
17
+ value: SelectOption | SelectOption[] | null
18
+ ) => void;
32
19
 
33
- /** Clear selection callback */
34
20
  onClear?: () => void;
35
-
36
- /** Search callback (debounced internally) */
37
21
  onSearch?: (query: string) => void;
38
-
39
- /** Triggered when dropdown scroll reaches end */
40
22
  onReachEnd?: () => void;
41
23
 
42
- /** Loading state */
43
24
  isLoading?: boolean;
44
-
45
- /** Whether more options are available */
46
25
  hasMoreOptions?: boolean;
47
-
48
- /** Enable multi-select mode */
49
26
  isMultipleAllowed?: boolean;
50
27
 
51
- /** Placeholder text */
52
28
  placeholder?: string;
53
29
 
54
- /**
55
- * Custom option renderer
56
- */
57
30
  renderOption?: (
58
- option: T,
31
+ option: SelectOption,
59
32
  meta: RenderOptionMeta
60
33
  ) => React.ReactNode;
61
34
 
62
- /**
63
- * Custom selected value renderer (chips)
64
- */
65
- renderChipValue?: (option: T) => React.ReactNode;
35
+ renderChipValue?: (
36
+ option: SelectOption
37
+ ) => React.ReactNode;
66
38
  }
67
39
 
68
- /**
69
- * Select component
70
- */
71
- declare const Select: <
72
- T extends SelectOption = SelectOption
73
- >(
74
- props: SelectProps<T>
75
- ) => React.ReactElement;
76
-
40
+ declare const Select: React.FC<SelectProps>;
77
41
  export default Select;