@kakadu/components 4.0.5 → 4.0.6

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.
@@ -0,0 +1 @@
1
+ "use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function c(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var o=e.default;if(typeof o=="function"){var t=function r(){return this instanceof r?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};t.prototype=o.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var u=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,u.get?u:{enumerable:!0,get:function(){return e[r]}})}),t}exports.getAugmentedNamespace=c;exports.getDefaultExportFromCjs=n;
@@ -0,0 +1,26 @@
1
+ function n(e) {
2
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3
+ }
4
+ function c(e) {
5
+ if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
6
+ var o = e.default;
7
+ if (typeof o == "function") {
8
+ var t = function r() {
9
+ return this instanceof r ? Reflect.construct(o, arguments, this.constructor) : o.apply(this, arguments);
10
+ };
11
+ t.prototype = o.prototype;
12
+ } else t = {};
13
+ return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
14
+ var u = Object.getOwnPropertyDescriptor(e, r);
15
+ Object.defineProperty(t, r, u.get ? u : {
16
+ enumerable: !0,
17
+ get: function() {
18
+ return e[r];
19
+ }
20
+ });
21
+ }), t;
22
+ }
23
+ export {
24
+ n as a,
25
+ c as g
26
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("../jsx-runtime-BB_1_6y_.js"),o=require("react"),H=require("../focus-trap-react-CkKg4ubd.js"),X=require("@kuma-ui/core"),re=require("../use-synchronized-value-D0_rS5Wp.js"),ae=require("../icons/icon.js"),ce=require("./input.js"),$=require("./text.js"),Y=require("./flex.js"),ie=require("./skeleton.js");var z={exports:{}};const M=new Uint32Array(65536),le=(t,c)=>{const r=t.length,p=c.length,i=1<<r-1;let l=-1,f=0,x=r,n=r;for(;n--;)M[t.charCodeAt(n)]|=1<<n;for(n=0;n<p;n++){let m=M[c.charCodeAt(n)];const v=m|f;m|=(m&l)+l^l,f|=~(m|l),l&=m,f&i&&x++,l&i&&x--,f=f<<1|1,l=l<<1|~(v|f),f&=v}for(n=r;n--;)M[t.charCodeAt(n)]=0;return x},ue=(t,c)=>{const r=c.length,p=t.length,i=[],l=[],f=Math.ceil(r/32),x=Math.ceil(p/32);for(let e=0;e<f;e++)l[e]=-1,i[e]=0;let n=0;for(;n<x-1;n++){let e=0,u=-1;const b=n*32,g=Math.min(32,p)+b;for(let s=b;s<g;s++)M[t.charCodeAt(s)]|=1<<s;for(let s=0;s<r;s++){const h=M[c.charCodeAt(s)],k=l[s/32|0]>>>s&1,w=i[s/32|0]>>>s&1,N=h|e,E=((h|w)&u)+u^u|h|w;let O=e|~(E|u),A=u&E;O>>>31^k&&(l[s/32|0]^=1<<s),A>>>31^w&&(i[s/32|0]^=1<<s),O=O<<1|k,A=A<<1|w,u=A|~(N|O),e=O&N}for(let s=b;s<g;s++)M[t.charCodeAt(s)]=0}let m=0,v=-1;const R=n*32,C=Math.min(32,p-R)+R;for(let e=R;e<C;e++)M[t.charCodeAt(e)]|=1<<e;let q=p;for(let e=0;e<r;e++){const u=M[c.charCodeAt(e)],b=l[e/32|0]>>>e&1,g=i[e/32|0]>>>e&1,s=u|m,h=((u|g)&v)+v^v|u|g;let k=m|~(h|v),w=v&h;q+=k>>>p-1&1,q-=w>>>p-1&1,k>>>31^b&&(l[e/32|0]^=1<<e),w>>>31^g&&(i[e/32|0]^=1<<e),k=k<<1|b,w=w<<1|g,v=w|~(s|k),m=k&s}for(let e=R;e<C;e++)M[t.charCodeAt(e)]=0;return q},J=(t,c)=>{if(t.length<c.length){const r=c;c=t,t=r}return c.length===0?t.length:t.length<=32?le(t,c):ue(t,c)},fe=(t,c)=>{let r=1/0,p=0;for(let i=0;i<c.length;i++){const l=J(t,c[i]);l<r&&(r=l,p=i)}return c[p]},de=Object.freeze(Object.defineProperty({__proto__:null,closest:fe,distance:J},Symbol.toStringTag,{value:"Module"})),me=H.getAugmentedNamespace(de);var G;function pe(){return G||(G=1,(function(t,c){(function(){var r;try{r=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null}catch{console.log("Collator could not be initialized and wouldn't be used")}var p=me,i=[],l=[],f={get:function(x,n,m){var v=m&&r&&m.useCollator;if(v){var R=x.length,C=n.length;if(R===0)return C;if(C===0)return R;var q,e,u,b,g;for(u=0;u<C;++u)i[u]=u,l[u]=n.charCodeAt(u);i[C]=C;var s;for(u=0;u<R;++u){for(e=u+1,b=0;b<C;++b)q=e,s=r.compare(x.charAt(u),String.fromCharCode(l[b]))===0,e=i[b]+(s?0:1),g=q+1,e>g&&(e=g),g=i[b+1]+1,e>g&&(e=g),i[b]=q;i[b]=e}return e}return p.distance(x,n)}};t!==null&&t.exports===c?t.exports=f:typeof self<"u"&&typeof self.postMessage=="function"&&typeof self.importScripts=="function"?self.Levenshtein=f:typeof window<"u"&&window!==null&&(window.Levenshtein=f)})()})(z,z.exports)),z.exports}var ve=pe();const he=H.getDefaultExportFromCjs(ve);function Q(){const{value:t,setValue:c}=re.useSynchronizedValue("isKeyboardNavigating");return o.useMemo(()=>({isKeyboardNavigating:t,setIsKeyboardNavigating:c}),[t,c])}function L(t){return"text"in t?t.text:t.label}const B="kakadu-components-1144794361",P="kakadu-components-2911184744";function xe({isSelected:t,id:c,value:r,label:p,onSelect:i,onHover:l}){const{isKeyboardNavigating:f}=Q(),x=o.useCallback(()=>{i(r)},[i,r]),n=o.useCallback(v=>{f||v.movementX===0&&v.movementY===0||l(r)},[f,l,r]),m=o.useRef(null);return o.useEffect(()=>{const v=m.current;t&&v&&f&&setTimeout(()=>{v.scrollIntoView({behavior:"smooth",block:"nearest"})},0)},[t,f]),j.jsxRuntimeExports.jsx("li",{ref:m,id:c,role:"option","aria-selected":t,tabIndex:-1,className:X.cx(B,"kakadu-components-4130497639",f?"kakadu-components-962373561":"kakadu-components-1109598791"),onClick:x,onMouseMove:n,children:j.jsxRuntimeExports.jsx($.Span,{className:X.cx(P,typeof p=="string"&&"kakadu-components-154286052"),children:p})})}function be({isLoading:t,id:c,activeOptionId:r,selectedValue:p,options:i,onSelect:l,onHover:f}){const x=o.useRef(null);return o.useEffect(()=>{const n=x.current;n&&n.scrollIntoView({behavior:"smooth",block:"nearest"})},[]),j.jsxRuntimeExports.jsxs("ul",{ref:x,id:c,role:"listbox","aria-label":"Options",className:"kakadu-components-1951042708",children:[i.length===0?t?null:j.jsxRuntimeExports.jsxs(Y.default,{"aria-atomic":!0,as:"li",role:"status","aria-live":"polite",direction:"row",preset:"start",gap:.5,className:B,children:[j.jsxRuntimeExports.jsx(ae.default,{size:15,type:"exclamationTriangle"}),j.jsxRuntimeExports.jsx($.Span,{className:P,children:"No results."})]}):i.map((n,m)=>j.jsxRuntimeExports.jsx(xe,{...n,id:n.value===p?r:void 0,isSelected:n.value===p,onSelect:l,onHover:f},L(n)+m)),t?j.jsxRuntimeExports.jsx(Y.default,{as:"li",alignment:"center",className:B,children:j.jsxRuntimeExports.jsx($.Span,{className:P,children:j.jsxRuntimeExports.jsx(ie.SkeletonInstance,{width:"100%",height:"1.3em"})})}):null]})}function ge({isLoading:t,label:c,options:r,error:p,warning:i,information:l,footnote:f,className:x,onChange:n,onSelect:m,...v}){const R=o.useRef(null),C=o.useId(),q=o.useId(),[e,u]=o.useState(!1),b=o.useCallback(()=>{u(!0)},[]),g=o.useCallback(a=>{var d;(d=R.current)!=null&&d.contains(a.relatedTarget)||u(!1)},[]),[s,h]=o.useState(!1);o.useEffect(()=>{h(e)},[e]);const[k,w]=o.useState(""),{value:N}=v,[E,O]=o.useState(N),[A,W]=o.useState(N),U=o.useRef(A),I=o.useCallback(a=>{W(a),U.current=a},[]);o.useEffect(()=>{O(N),I(N)},[N,I]);const Z=o.useCallback(()=>{E&&(w(""),I(void 0))},[E,I]),ee=o.useCallback((a,d)=>{w(a),n==null||n(a,d),h(!0),O(void 0)},[n]),te=o.useCallback(a=>{var d;(d=R.current)!=null&&d.contains(a.target)&&h(!0)},[]),T=o.useCallback(a=>{const d=a==null?void 0:a.value;I(d),a?w(L(a)):(w(""),n==null||n("")),m==null||m(d)},[I,n,m]),ne=o.useCallback(a=>{const d=r.find(y=>y.value===a);T(d),O(a),h(!1)},[r,T]),se=o.useCallback(a=>{I(a)},[I]),S=o.useMemo(()=>E||k.length===0?r:r.filter(a=>{const y=L(a).toLowerCase(),_=k.toLowerCase();return!!(y.includes(_)||_.includes(y)||he.get(y,_,{useCollator:!0})<=2)}),[E,r,k]);o.useEffect(()=>{!E&&k.length>0&&S.length>0&&!S.some(a=>A===a.value)&&I(S[0].value)},[E,k,S,A,I]);const{setIsKeyboardNavigating:F}=Q();o.useEffect(()=>{if(!e)return;const a=d=>{d.movementX===0&&d.movementY===0||F(!1)};return window.addEventListener("mousemove",a,{capture:!0}),()=>{window.removeEventListener("mousemove",a,{capture:!0})}},[e,F]),o.useEffect(()=>{if(!e)return;const a=d=>{let y;const _=S.length,K=S.findIndex(V=>V.value===U.current),D=()=>{d.preventDefault(),d.stopPropagation(),d.stopImmediatePropagation()};switch(d.key){case"Enter":{const V=S[K];V&&(D(),F(!0),h(!1),T(V),O(V.value));break}case"Escape":{s?(D(),E?I(void 0):T(void 0),h(!1)):E?(D(),h(!0),T(void 0)):(D(),u(!1),d.target instanceof HTMLInputElement&&d.target.blur());return}case"ArrowDown":{y=K+1,h(!0);break}case"ArrowUp":{y=K-1,h(!0),y<0&&(y=_-1);break}case"Home":{h(!0),y=0;break}case"End":{h(!0),y=_-1;break}case"Backspace":{S.some(V=>V.value===E)&&(D(),T(void 0),h(!0));break}}if(y!==void 0&&(D(),F(!0),_>0)){const V=S[y%_];V&&I(V.value)}};return window.addEventListener("keydown",a,{capture:!0}),()=>{window.removeEventListener("keydown",a,{capture:!0})}},[e,S,F,h,T,O,s,E,I]);const oe=o.useMemo(()=>({clickOutsideDeactivates:!0,returnFocusOnDeactivate:!1,escapeDeactivates:!1}),[]);return j.jsxRuntimeExports.jsx(H.focusTrapReactExports.FocusTrap,{active:s,focusTrapOptions:oe,children:j.jsxRuntimeExports.jsx(ce.default,{...v,ref:R,role:"combobox",autoComplete:"off","aria-controls":C,"aria-expanded":s,"aria-activedescendant":s?q:void 0,label:c,value:k,error:p,warning:i,information:l,footnote:f,attachments:s?j.jsxRuntimeExports.jsx(be,{isLoading:t,id:C,activeOptionId:q,selectedValue:A,options:S,onSelect:ne,onHover:se}):null,className:x,onMouseDown:te,onChange:ee,onBeforeInput:Z,onFocus:b,onBlur:g})})}exports.default=ge;exports.getComboboxOptionString=L;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const R=require("../jsx-runtime-BB_1_6y_.js"),r=require("react"),G=require("../_commonjsHelpers-DGT2Y9Xa.js"),U=require("@kuma-ui/core"),oe=require("../use-synchronized-value-D0_rS5Wp.js"),re=require("../icons/icon.js"),ae=require("./input.js"),B=require("./text.js"),X=require("./flex.js"),ce=require("./skeleton.js");var K={exports:{}};const _=new Uint32Array(65536),le=(t,c)=>{const o=t.length,p=c.length,l=1<<o-1;let i=-1,f=0,x=o,n=o;for(;n--;)_[t.charCodeAt(n)]|=1<<n;for(n=0;n<p;n++){let m=_[c.charCodeAt(n)];const h=m|f;m|=(m&i)+i^i,f|=~(m|i),i&=m,f&l&&x++,i&l&&x--,f=f<<1|1,i=i<<1|~(h|f),f&=h}for(n=o;n--;)_[t.charCodeAt(n)]=0;return x},ie=(t,c)=>{const o=c.length,p=t.length,l=[],i=[],f=Math.ceil(o/32),x=Math.ceil(p/32);for(let e=0;e<f;e++)i[e]=-1,l[e]=0;let n=0;for(;n<x-1;n++){let e=0,u=-1;const b=n*32,g=Math.min(32,p)+b;for(let s=b;s<g;s++)_[t.charCodeAt(s)]|=1<<s;for(let s=0;s<o;s++){const v=_[c.charCodeAt(s)],k=i[s/32|0]>>>s&1,w=l[s/32|0]>>>s&1,M=v|e,E=((v|w)&u)+u^u|v|w;let S=e|~(E|u),A=u&E;S>>>31^k&&(i[s/32|0]^=1<<s),A>>>31^w&&(l[s/32|0]^=1<<s),S=S<<1|k,A=A<<1|w,u=A|~(M|S),e=S&M}for(let s=b;s<g;s++)_[t.charCodeAt(s)]=0}let m=0,h=-1;const j=n*32,C=Math.min(32,p-j)+j;for(let e=j;e<C;e++)_[t.charCodeAt(e)]|=1<<e;let O=p;for(let e=0;e<o;e++){const u=_[c.charCodeAt(e)],b=i[e/32|0]>>>e&1,g=l[e/32|0]>>>e&1,s=u|m,v=((u|g)&h)+h^h|u|g;let k=m|~(v|h),w=h&v;O+=k>>>p-1&1,O-=w>>>p-1&1,k>>>31^b&&(i[e/32|0]^=1<<e),w>>>31^g&&(l[e/32|0]^=1<<e),k=k<<1|b,w=w<<1|g,h=w|~(s|k),m=k&s}for(let e=j;e<C;e++)_[t.charCodeAt(e)]=0;return O},J=(t,c)=>{if(t.length<c.length){const o=c;c=t,t=o}return c.length===0?t.length:t.length<=32?le(t,c):ie(t,c)},ue=(t,c)=>{let o=1/0,p=0;for(let l=0;l<c.length;l++){const i=J(t,c[l]);i<o&&(o=i,p=l)}return c[p]},fe=Object.freeze(Object.defineProperty({__proto__:null,closest:ue,distance:J},Symbol.toStringTag,{value:"Module"})),de=G.getAugmentedNamespace(fe);var Y;function me(){return Y||(Y=1,(function(t,c){(function(){var o;try{o=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null}catch{console.log("Collator could not be initialized and wouldn't be used")}var p=de,l=[],i=[],f={get:function(x,n,m){var h=m&&o&&m.useCollator;if(h){var j=x.length,C=n.length;if(j===0)return C;if(C===0)return j;var O,e,u,b,g;for(u=0;u<C;++u)l[u]=u,i[u]=n.charCodeAt(u);l[C]=C;var s;for(u=0;u<j;++u){for(e=u+1,b=0;b<C;++b)O=e,s=o.compare(x.charAt(u),String.fromCharCode(i[b]))===0,e=l[b]+(s?0:1),g=O+1,e>g&&(e=g),g=l[b+1]+1,e>g&&(e=g),l[b]=O;l[b]=e}return e}return p.distance(x,n)}};t!==null&&t.exports===c?t.exports=f:typeof self<"u"&&typeof self.postMessage=="function"&&typeof self.importScripts=="function"?self.Levenshtein=f:typeof window<"u"&&window!==null&&(window.Levenshtein=f)})()})(K,K.exports)),K.exports}var pe=me();const he=G.getDefaultExportFromCjs(pe);function Q(){const{value:t,setValue:c}=oe.useSynchronizedValue("isKeyboardNavigating");return r.useMemo(()=>({isKeyboardNavigating:t,setIsKeyboardNavigating:c}),[t,c])}function T(t){return"text"in t?t.text:t.label}const D="kakadu-components-1144794361",H="kakadu-components-2911184744";function ve({isSelected:t,id:c,value:o,label:p,onSelect:l,onHover:i}){const{isKeyboardNavigating:f}=Q(),x=r.useCallback(()=>{l(o)},[l,o]),n=r.useCallback(h=>{f||h.movementX===0&&h.movementY===0||i(o)},[f,i,o]),m=r.useRef(null);return r.useEffect(()=>{const h=m.current;t&&h&&f&&setTimeout(()=>{h.scrollIntoView({behavior:"smooth",block:"nearest"})},0)},[t,f]),R.jsxRuntimeExports.jsx("li",{ref:m,id:c,role:"option","aria-selected":t,tabIndex:-1,className:U.cx(D,"kakadu-components-4130497639",f?"kakadu-components-962373561":"kakadu-components-1109598791"),onClick:x,onMouseMove:n,children:R.jsxRuntimeExports.jsx(B.Span,{className:U.cx(H,typeof p=="string"&&"kakadu-components-154286052"),children:p})})}function xe({isLoading:t,id:c,activeOptionId:o,selectedValue:p,options:l,onSelect:i,onHover:f}){const x=r.useRef(null);return r.useEffect(()=>{const n=x.current;n&&n.scrollIntoView({behavior:"smooth",block:"nearest"})},[]),R.jsxRuntimeExports.jsxs("ul",{ref:x,id:c,role:"listbox","aria-label":"Options",tabIndex:-1,className:"kakadu-components-1951042708",children:[l.length===0?t?null:R.jsxRuntimeExports.jsxs(X.default,{"aria-atomic":!0,as:"li",role:"status","aria-live":"polite",direction:"row",preset:"start",gap:.5,className:D,children:[R.jsxRuntimeExports.jsx(re.default,{size:15,type:"exclamationTriangle"}),R.jsxRuntimeExports.jsx(B.Span,{className:H,children:"No results."})]}):l.map((n,m)=>R.jsxRuntimeExports.jsx(ve,{...n,id:n.value===p?o:void 0,isSelected:n.value===p,onSelect:i,onHover:f},T(n)+m)),t?R.jsxRuntimeExports.jsx(X.default,{as:"li",alignment:"center",className:D,children:R.jsxRuntimeExports.jsx(B.Span,{className:H,children:R.jsxRuntimeExports.jsx(ce.SkeletonInstance,{width:"100%",height:"1.3em"})})}):null]})}function be({isLoading:t,label:c,options:o,error:p,warning:l,information:i,footnote:f,className:x,onChange:n,onSelect:m,...h}){const j=r.useRef(null),C=r.useId(),O=r.useId(),[e,u]=r.useState(!1),b=r.useCallback(()=>{u(!0)},[]),g=r.useCallback(a=>{var d;(d=j.current)!=null&&d.contains(a.relatedTarget)||u(!1)},[]),[s,v]=r.useState(!1);r.useEffect(()=>{v(e)},[e]);const[k,w]=r.useState(""),{value:M}=h,[E,S]=r.useState(M),[A,W]=r.useState(M),P=r.useRef(A),I=r.useCallback(a=>{W(a),P.current=a},[]);r.useEffect(()=>{S(M),I(M)},[M,I]);const Z=r.useCallback(()=>{E&&(w(""),I(void 0))},[E,I]),ee=r.useCallback((a,d)=>{w(a),n==null||n(a,d),v(!0),S(void 0)},[n]),te=r.useCallback(a=>{var d;(d=j.current)!=null&&d.contains(a.target)&&v(!0)},[]),z=r.useCallback(a=>{const d=a==null?void 0:a.value;I(d),a?w(T(a)):(w(""),n==null||n("")),m==null||m(d)},[I,n,m]),ne=r.useCallback(a=>{const d=o.find(y=>y.value===a);z(d),S(a),v(!1)},[o,z]),se=r.useCallback(a=>{I(a)},[I]),q=r.useMemo(()=>E||k.length===0?o:o.filter(a=>{const y=T(a).toLowerCase(),N=k.toLowerCase();return!!(y.includes(N)||N.includes(y)||he.get(y,N,{useCollator:!0})<=2)}),[E,o,k]);r.useEffect(()=>{!E&&k.length>0&&q.length>0&&!q.some(a=>A===a.value)&&I(q[0].value)},[E,k,q,A,I]);const{setIsKeyboardNavigating:F}=Q();return r.useEffect(()=>{if(!e)return;const a=d=>{d.movementX===0&&d.movementY===0||F(!1)};return window.addEventListener("mousemove",a,{capture:!0}),()=>{window.removeEventListener("mousemove",a,{capture:!0})}},[e,F]),r.useEffect(()=>{if(!e)return;const a=d=>{let y;const N=q.length,$=q.findIndex(V=>V.value===P.current),L=()=>{d.preventDefault(),d.stopPropagation(),d.stopImmediatePropagation()};switch(d.key){case"Enter":{const V=q[$];V&&(L(),F(!0),v(!1),z(V),S(V.value));break}case"Escape":{s?(L(),E?I(void 0):z(void 0),v(!1)):E?(L(),v(!0),z(void 0)):(L(),u(!1),d.target instanceof HTMLInputElement&&d.target.blur());return}case"ArrowDown":{y=$+1,v(!0);break}case"ArrowUp":{y=$-1,v(!0),y<0&&(y=N-1);break}case"Home":{v(!0),y=0;break}case"End":{v(!0),y=N-1;break}case"Backspace":{q.some(V=>V.value===E)&&(L(),z(void 0),v(!0));break}}if(y!==void 0&&(L(),F(!0),N>0)){const V=q[y%N];V&&I(V.value)}};return window.addEventListener("keydown",a,{capture:!0}),()=>{window.removeEventListener("keydown",a,{capture:!0})}},[e,q,F,v,z,S,s,E,I]),R.jsxRuntimeExports.jsx(ae.default,{...h,ref:j,role:"combobox",autoComplete:"off","aria-controls":C,"aria-expanded":s,"aria-activedescendant":s?O:void 0,label:c,value:k,error:p,warning:l,information:i,footnote:f,attachments:s?R.jsxRuntimeExports.jsx(xe,{isLoading:t,id:C,activeOptionId:O,selectedValue:A,options:q,onSelect:ne,onHover:se}):null,className:x,onMouseDown:te,onChange:ee,onBeforeInput:Z,onFocus:b,onBlur:g})}exports.default=be;exports.getComboboxOptionString=T;
@@ -1,79 +1,79 @@
1
- import { j as O } from "../jsx-runtime-B4hRZ52C.mjs";
2
- import { useRef as B, useId as J, useState as K, useCallback as E, useEffect as q, useMemo as P } from "react";
3
- import { g as le, a as ue, f as fe } from "../focus-trap-react-DATIi_Ob.mjs";
4
- import { cx as Q } from "@kuma-ui/core";
5
- import { u as de } from "../use-synchronized-value-XnIpeq1s.mjs";
6
- import me from "../icons/icon.mjs";
7
- import ve from "./input.mjs";
8
- import { Span as $ } from "./text.mjs";
9
- import W from "./flex.mjs";
10
- import { SkeletonInstance as he } from "./skeleton.mjs";
1
+ import { j as V } from "../jsx-runtime-B4hRZ52C.mjs";
2
+ import { useRef as T, useId as G, useState as D, useCallback as E, useEffect as z, useMemo as Z } from "react";
3
+ import { g as ce, a as le } from "../_commonjsHelpers-MdHo5S7N.mjs";
4
+ import { cx as J } from "@kuma-ui/core";
5
+ import { u as ue } from "../use-synchronized-value-XnIpeq1s.mjs";
6
+ import fe from "../icons/icon.mjs";
7
+ import de from "./input.mjs";
8
+ import { Span as P } from "./text.mjs";
9
+ import Q from "./flex.mjs";
10
+ import { SkeletonInstance as me } from "./skeleton.mjs";
11
11
  var R = { exports: {} };
12
- const S = new Uint32Array(65536), pe = (t, a) => {
13
- const r = t.length, m = a.length, c = 1 << r - 1;
14
- let i = -1, u = 0, p = r, n = r;
12
+ const _ = new Uint32Array(65536), he = (t, a) => {
13
+ const r = t.length, m = a.length, i = 1 << r - 1;
14
+ let c = -1, u = 0, p = r, n = r;
15
15
  for (; n--; )
16
- S[t.charCodeAt(n)] |= 1 << n;
16
+ _[t.charCodeAt(n)] |= 1 << n;
17
17
  for (n = 0; n < m; n++) {
18
- let d = S[a.charCodeAt(n)];
19
- const v = d | u;
20
- d |= (d & i) + i ^ i, u |= ~(d | i), i &= d, u & c && p++, i & c && p--, u = u << 1 | 1, i = i << 1 | ~(v | u), u &= v;
18
+ let d = _[a.charCodeAt(n)];
19
+ const h = d | u;
20
+ d |= (d & c) + c ^ c, u |= ~(d | c), c &= d, u & i && p++, c & i && p--, u = u << 1 | 1, c = c << 1 | ~(h | u), u &= h;
21
21
  }
22
22
  for (n = r; n--; )
23
- S[t.charCodeAt(n)] = 0;
23
+ _[t.charCodeAt(n)] = 0;
24
24
  return p;
25
- }, ge = (t, a) => {
26
- const r = a.length, m = t.length, c = [], i = [], u = Math.ceil(r / 32), p = Math.ceil(m / 32);
25
+ }, ve = (t, a) => {
26
+ const r = a.length, m = t.length, i = [], c = [], u = Math.ceil(r / 32), p = Math.ceil(m / 32);
27
27
  for (let e = 0; e < u; e++)
28
- i[e] = -1, c[e] = 0;
28
+ c[e] = -1, i[e] = 0;
29
29
  let n = 0;
30
30
  for (; n < p - 1; n++) {
31
31
  let e = 0, l = -1;
32
32
  const g = n * 32, x = Math.min(32, m) + g;
33
33
  for (let o = g; o < x; o++)
34
- S[t.charCodeAt(o)] |= 1 << o;
34
+ _[t.charCodeAt(o)] |= 1 << o;
35
35
  for (let o = 0; o < r; o++) {
36
- const h = S[a.charCodeAt(o)], b = i[o / 32 | 0] >>> o & 1, w = c[o / 32 | 0] >>> o & 1, D = h | e, y = ((h | w) & l) + l ^ l | h | w;
37
- let N = e | ~(y | l), F = l & y;
38
- N >>> 31 ^ b && (i[o / 32 | 0] ^= 1 << o), F >>> 31 ^ w && (c[o / 32 | 0] ^= 1 << o), N = N << 1 | b, F = F << 1 | w, l = F | ~(D | N), e = N & D;
36
+ const v = _[a.charCodeAt(o)], b = c[o / 32 | 0] >>> o & 1, w = i[o / 32 | 0] >>> o & 1, q = v | e, y = ((v | w) & l) + l ^ l | v | w;
37
+ let N = e | ~(y | l), S = l & y;
38
+ N >>> 31 ^ b && (c[o / 32 | 0] ^= 1 << o), S >>> 31 ^ w && (i[o / 32 | 0] ^= 1 << o), N = N << 1 | b, S = S << 1 | w, l = S | ~(q | N), e = N & q;
39
39
  }
40
40
  for (let o = g; o < x; o++)
41
- S[t.charCodeAt(o)] = 0;
41
+ _[t.charCodeAt(o)] = 0;
42
42
  }
43
- let d = 0, v = -1;
44
- const A = n * 32, V = Math.min(32, m - A) + A;
45
- for (let e = A; e < V; e++)
46
- S[t.charCodeAt(e)] |= 1 << e;
43
+ let d = 0, h = -1;
44
+ const A = n * 32, O = Math.min(32, m - A) + A;
45
+ for (let e = A; e < O; e++)
46
+ _[t.charCodeAt(e)] |= 1 << e;
47
47
  let M = m;
48
48
  for (let e = 0; e < r; e++) {
49
- const l = S[a.charCodeAt(e)], g = i[e / 32 | 0] >>> e & 1, x = c[e / 32 | 0] >>> e & 1, o = l | d, h = ((l | x) & v) + v ^ v | l | x;
50
- let b = d | ~(h | v), w = v & h;
51
- M += b >>> m - 1 & 1, M -= w >>> m - 1 & 1, b >>> 31 ^ g && (i[e / 32 | 0] ^= 1 << e), w >>> 31 ^ x && (c[e / 32 | 0] ^= 1 << e), b = b << 1 | g, w = w << 1 | x, v = w | ~(o | b), d = b & o;
49
+ const l = _[a.charCodeAt(e)], g = c[e / 32 | 0] >>> e & 1, x = i[e / 32 | 0] >>> e & 1, o = l | d, v = ((l | x) & h) + h ^ h | l | x;
50
+ let b = d | ~(v | h), w = h & v;
51
+ M += b >>> m - 1 & 1, M -= w >>> m - 1 & 1, b >>> 31 ^ g && (c[e / 32 | 0] ^= 1 << e), w >>> 31 ^ x && (i[e / 32 | 0] ^= 1 << e), b = b << 1 | g, w = w << 1 | x, h = w | ~(o | b), d = b & o;
52
52
  }
53
- for (let e = A; e < V; e++)
54
- S[t.charCodeAt(e)] = 0;
53
+ for (let e = A; e < O; e++)
54
+ _[t.charCodeAt(e)] = 0;
55
55
  return M;
56
56
  }, ee = (t, a) => {
57
57
  if (t.length < a.length) {
58
58
  const r = a;
59
59
  a = t, t = r;
60
60
  }
61
- return a.length === 0 ? t.length : t.length <= 32 ? pe(t, a) : ge(t, a);
62
- }, xe = (t, a) => {
61
+ return a.length === 0 ? t.length : t.length <= 32 ? he(t, a) : ve(t, a);
62
+ }, pe = (t, a) => {
63
63
  let r = 1 / 0, m = 0;
64
- for (let c = 0; c < a.length; c++) {
65
- const i = ee(t, a[c]);
66
- i < r && (r = i, m = c);
64
+ for (let i = 0; i < a.length; i++) {
65
+ const c = ee(t, a[i]);
66
+ c < r && (r = c, m = i);
67
67
  }
68
68
  return a[m];
69
- }, be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
69
+ }, ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
70
70
  __proto__: null,
71
- closest: xe,
71
+ closest: pe,
72
72
  distance: ee
73
- }, Symbol.toStringTag, { value: "Module" })), we = /* @__PURE__ */ le(be);
74
- var Z;
75
- function ke() {
76
- return Z || (Z = 1, (function(t, a) {
73
+ }, Symbol.toStringTag, { value: "Module" })), xe = /* @__PURE__ */ ce(ge);
74
+ var W;
75
+ function be() {
76
+ return W || (W = 1, (function(t, a) {
77
77
  (function() {
78
78
  var r;
79
79
  try {
@@ -81,7 +81,7 @@ function ke() {
81
81
  } catch {
82
82
  console.log("Collator could not be initialized and wouldn't be used");
83
83
  }
84
- var m = we, c = [], i = [], u = {
84
+ var m = xe, i = [], c = [], u = {
85
85
  /**
86
86
  * Calculate levenshtein distance of the two strings.
87
87
  *
@@ -92,20 +92,20 @@ function ke() {
92
92
  * @return Integer the levenshtein distance (0 and above).
93
93
  */
94
94
  get: function(p, n, d) {
95
- var v = d && r && d.useCollator;
96
- if (v) {
97
- var A = p.length, V = n.length;
98
- if (A === 0) return V;
99
- if (V === 0) return A;
95
+ var h = d && r && d.useCollator;
96
+ if (h) {
97
+ var A = p.length, O = n.length;
98
+ if (A === 0) return O;
99
+ if (O === 0) return A;
100
100
  var M, e, l, g, x;
101
- for (l = 0; l < V; ++l)
102
- c[l] = l, i[l] = n.charCodeAt(l);
103
- c[V] = V;
101
+ for (l = 0; l < O; ++l)
102
+ i[l] = l, c[l] = n.charCodeAt(l);
103
+ i[O] = O;
104
104
  var o;
105
105
  for (l = 0; l < A; ++l) {
106
- for (e = l + 1, g = 0; g < V; ++g)
107
- M = e, o = r.compare(p.charAt(l), String.fromCharCode(i[g])) === 0, e = c[g] + (o ? 0 : 1), x = M + 1, e > x && (e = x), x = c[g + 1] + 1, e > x && (e = x), c[g] = M;
108
- c[g] = e;
106
+ for (e = l + 1, g = 0; g < O; ++g)
107
+ M = e, o = r.compare(p.charAt(l), String.fromCharCode(c[g])) === 0, e = i[g] + (o ? 0 : 1), x = M + 1, e > x && (e = x), x = i[g + 1] + 1, e > x && (e = x), i[g] = M;
108
+ i[g] = e;
109
109
  }
110
110
  return e;
111
111
  }
@@ -116,143 +116,143 @@ function ke() {
116
116
  })();
117
117
  })(R, R.exports)), R.exports;
118
118
  }
119
- var ye = ke();
120
- const Ie = /* @__PURE__ */ ue(ye);
119
+ var we = be();
120
+ const ke = /* @__PURE__ */ le(we);
121
121
  function te() {
122
122
  const {
123
123
  value: t,
124
124
  setValue: a
125
- } = de("isKeyboardNavigating");
126
- return P(() => ({
125
+ } = ue("isKeyboardNavigating");
126
+ return Z(() => ({
127
127
  isKeyboardNavigating: t,
128
128
  setIsKeyboardNavigating: a
129
129
  }), [t, a]);
130
130
  }
131
- function U(t) {
131
+ function $(t) {
132
132
  return "text" in t ? t.text : t.label;
133
133
  }
134
- const X = "kakadu-components-1144794361", Y = "kakadu-components-2911184744";
135
- function Oe({
134
+ const U = "kakadu-components-1144794361", X = "kakadu-components-2911184744";
135
+ function ye({
136
136
  isSelected: t,
137
137
  id: a,
138
138
  value: r,
139
139
  label: m,
140
- onSelect: c,
141
- onHover: i
140
+ onSelect: i,
141
+ onHover: c
142
142
  }) {
143
143
  const {
144
144
  isKeyboardNavigating: u
145
145
  } = te(), p = E(() => {
146
- c(r);
147
- }, [c, r]), n = E((v) => {
148
- u || v.movementX === 0 && v.movementY === 0 || i(r);
149
- }, [u, i, r]), d = B(null);
150
- return q(() => {
151
- const v = d.current;
152
- t && v && u && setTimeout(() => {
153
- v.scrollIntoView({
146
+ i(r);
147
+ }, [i, r]), n = E((h) => {
148
+ u || h.movementX === 0 && h.movementY === 0 || c(r);
149
+ }, [u, c, r]), d = T(null);
150
+ return z(() => {
151
+ const h = d.current;
152
+ t && h && u && setTimeout(() => {
153
+ h.scrollIntoView({
154
154
  behavior: "smooth",
155
155
  block: "nearest"
156
156
  });
157
157
  }, 0);
158
- }, [t, u]), /* @__PURE__ */ O.jsx("li", { ref: d, id: a, role: "option", "aria-selected": t, tabIndex: -1, className: Q(X, "kakadu-components-4130497639", u ? "kakadu-components-962373561" : "kakadu-components-1109598791"), onClick: p, onMouseMove: n, children: /* @__PURE__ */ O.jsx($, { className: Q(Y, typeof m == "string" && "kakadu-components-154286052"), children: m }) });
158
+ }, [t, u]), /* @__PURE__ */ V.jsx("li", { ref: d, id: a, role: "option", "aria-selected": t, tabIndex: -1, className: J(U, "kakadu-components-4130497639", u ? "kakadu-components-962373561" : "kakadu-components-1109598791"), onClick: p, onMouseMove: n, children: /* @__PURE__ */ V.jsx(P, { className: J(X, typeof m == "string" && "kakadu-components-154286052"), children: m }) });
159
159
  }
160
- function Ae({
160
+ function Ie({
161
161
  isLoading: t,
162
162
  id: a,
163
163
  activeOptionId: r,
164
164
  selectedValue: m,
165
- options: c,
166
- onSelect: i,
165
+ options: i,
166
+ onSelect: c,
167
167
  onHover: u
168
168
  }) {
169
- const p = B(null);
170
- return q(() => {
169
+ const p = T(null);
170
+ return z(() => {
171
171
  const n = p.current;
172
172
  n && n.scrollIntoView({
173
173
  behavior: "smooth",
174
174
  block: "nearest"
175
175
  });
176
- }, []), /* @__PURE__ */ O.jsxs("ul", { ref: p, id: a, role: "listbox", "aria-label": "Options", className: "kakadu-components-1951042708", children: [
177
- c.length === 0 ? t ? null : /* @__PURE__ */ O.jsxs(W, { "aria-atomic": !0, as: "li", role: "status", "aria-live": "polite", direction: "row", preset: "start", gap: 0.5, className: X, children: [
178
- /* @__PURE__ */ O.jsx(me, { size: 15, type: "exclamationTriangle" }),
179
- /* @__PURE__ */ O.jsx($, { className: Y, children: "No results." })
180
- ] }) : c.map((n, d) => /* @__PURE__ */ O.jsx(
181
- Oe,
176
+ }, []), /* @__PURE__ */ V.jsxs("ul", { ref: p, id: a, role: "listbox", "aria-label": "Options", tabIndex: -1, className: "kakadu-components-1951042708", children: [
177
+ i.length === 0 ? t ? null : /* @__PURE__ */ V.jsxs(Q, { "aria-atomic": !0, as: "li", role: "status", "aria-live": "polite", direction: "row", preset: "start", gap: 0.5, className: U, children: [
178
+ /* @__PURE__ */ V.jsx(fe, { size: 15, type: "exclamationTriangle" }),
179
+ /* @__PURE__ */ V.jsx(P, { className: X, children: "No results." })
180
+ ] }) : i.map((n, d) => /* @__PURE__ */ V.jsx(
181
+ ye,
182
182
  {
183
183
  ...n,
184
184
  id: n.value === m ? r : void 0,
185
185
  isSelected: n.value === m,
186
- onSelect: i,
186
+ onSelect: c,
187
187
  onHover: u
188
188
  },
189
- U(n) + d
189
+ $(n) + d
190
190
  )),
191
- t ? /* @__PURE__ */ O.jsx(W, { as: "li", alignment: "center", className: X, children: /* @__PURE__ */ O.jsx($, { className: Y, children: /* @__PURE__ */ O.jsx(he, { width: "100%", height: "1.3em" }) }) }) : null
191
+ t ? /* @__PURE__ */ V.jsx(Q, { as: "li", alignment: "center", className: U, children: /* @__PURE__ */ V.jsx(P, { className: X, children: /* @__PURE__ */ V.jsx(me, { width: "100%", height: "1.3em" }) }) }) : null
192
192
  ] });
193
193
  }
194
- function _e({
194
+ function qe({
195
195
  isLoading: t,
196
196
  label: a,
197
197
  options: r,
198
198
  error: m,
199
- warning: c,
200
- information: i,
199
+ warning: i,
200
+ information: c,
201
201
  footnote: u,
202
202
  className: p,
203
203
  onChange: n,
204
204
  onSelect: d,
205
- ...v
205
+ ...h
206
206
  }) {
207
- const A = B(null), V = J(), M = J(), [e, l] = K(!1), g = E(() => {
207
+ const A = T(null), O = G(), M = G(), [e, l] = D(!1), g = E(() => {
208
208
  l(!0);
209
209
  }, []), x = E((s) => {
210
210
  var f;
211
211
  (f = A.current) != null && f.contains(s.relatedTarget) || l(!1);
212
- }, []), [o, h] = K(!1);
213
- q(() => {
214
- h(e);
212
+ }, []), [o, v] = D(!1);
213
+ z(() => {
214
+ v(e);
215
215
  }, [e]);
216
- const [b, w] = K(""), {
217
- value: D
218
- } = v, [y, N] = K(D), [F, ne] = K(D), G = B(F), I = E((s) => {
219
- ne(s), G.current = s;
216
+ const [b, w] = D(""), {
217
+ value: q
218
+ } = h, [y, N] = D(q), [S, ne] = D(q), Y = T(S), I = E((s) => {
219
+ ne(s), Y.current = s;
220
220
  }, []);
221
- q(() => {
222
- N(D), I(D);
223
- }, [D, I]);
221
+ z(() => {
222
+ N(q), I(q);
223
+ }, [q, I]);
224
224
  const oe = E(() => {
225
225
  y && (w(""), I(void 0));
226
226
  }, [y, I]), re = E((s, f) => {
227
- w(s), n == null || n(s, f), h(!0), N(void 0);
227
+ w(s), n == null || n(s, f), v(!0), N(void 0);
228
228
  }, [n]), se = E((s) => {
229
229
  var f;
230
- (f = A.current) != null && f.contains(s.target) && h(!0);
231
- }, []), _ = E((s) => {
230
+ (f = A.current) != null && f.contains(s.target) && v(!0);
231
+ }, []), L = E((s) => {
232
232
  const f = s == null ? void 0 : s.value;
233
- I(f), s ? w(U(s)) : (w(""), n == null || n("")), d == null || d(f);
233
+ I(f), s ? w($(s)) : (w(""), n == null || n("")), d == null || d(f);
234
234
  }, [I, n, d]), ae = E((s) => {
235
235
  const f = r.find((k) => k.value === s);
236
- _(f), N(s), h(!1);
237
- }, [r, _]), ce = E((s) => {
236
+ L(f), N(s), v(!1);
237
+ }, [r, L]), ie = E((s) => {
238
238
  I(s);
239
- }, [I]), j = P(() => y || b.length === 0 ? r : r.filter((s) => {
240
- const k = U(s).toLowerCase(), T = b.toLowerCase();
241
- return !!(k.includes(T) || T.includes(k) || Ie.get(k, T, {
239
+ }, [I]), j = Z(() => y || b.length === 0 ? r : r.filter((s) => {
240
+ const k = $(s).toLowerCase(), F = b.toLowerCase();
241
+ return !!(k.includes(F) || F.includes(k) || ke.get(k, F, {
242
242
  useCollator: !0
243
243
  }) <= 2);
244
244
  }), [y, r, b]);
245
- q(() => {
246
- !y && b.length > 0 && j.length > 0 && !j.some((s) => F === s.value) && I(j[0].value);
247
- }, [y, b, j, F, I]);
245
+ z(() => {
246
+ !y && b.length > 0 && j.length > 0 && !j.some((s) => S === s.value) && I(j[0].value);
247
+ }, [y, b, j, S, I]);
248
248
  const {
249
- setIsKeyboardNavigating: z
249
+ setIsKeyboardNavigating: B
250
250
  } = te();
251
- q(() => {
251
+ return z(() => {
252
252
  if (!e)
253
253
  return;
254
254
  const s = (f) => {
255
- f.movementX === 0 && f.movementY === 0 || z(!1);
255
+ f.movementX === 0 && f.movementY === 0 || B(!1);
256
256
  };
257
257
  return window.addEventListener("mousemove", s, {
258
258
  capture: !0
@@ -261,47 +261,47 @@ function _e({
261
261
  capture: !0
262
262
  });
263
263
  };
264
- }, [e, z]), q(() => {
264
+ }, [e, B]), z(() => {
265
265
  if (!e)
266
266
  return;
267
267
  const s = (f) => {
268
268
  let k;
269
- const T = j.length, H = j.findIndex((C) => C.value === G.current), L = () => {
269
+ const F = j.length, H = j.findIndex((C) => C.value === Y.current), K = () => {
270
270
  f.preventDefault(), f.stopPropagation(), f.stopImmediatePropagation();
271
271
  };
272
272
  switch (f.key) {
273
273
  case "Enter": {
274
274
  const C = j[H];
275
- C && (L(), z(!0), h(!1), _(C), N(C.value));
275
+ C && (K(), B(!0), v(!1), L(C), N(C.value));
276
276
  break;
277
277
  }
278
278
  case "Escape": {
279
- o ? (L(), y ? I(void 0) : _(void 0), h(!1)) : y ? (L(), h(!0), _(void 0)) : (L(), l(!1), f.target instanceof HTMLInputElement && f.target.blur());
279
+ o ? (K(), y ? I(void 0) : L(void 0), v(!1)) : y ? (K(), v(!0), L(void 0)) : (K(), l(!1), f.target instanceof HTMLInputElement && f.target.blur());
280
280
  return;
281
281
  }
282
282
  case "ArrowDown": {
283
- k = H + 1, h(!0);
283
+ k = H + 1, v(!0);
284
284
  break;
285
285
  }
286
286
  case "ArrowUp": {
287
- k = H - 1, h(!0), k < 0 && (k = T - 1);
287
+ k = H - 1, v(!0), k < 0 && (k = F - 1);
288
288
  break;
289
289
  }
290
290
  case "Home": {
291
- h(!0), k = 0;
291
+ v(!0), k = 0;
292
292
  break;
293
293
  }
294
294
  case "End": {
295
- h(!0), k = T - 1;
295
+ v(!0), k = F - 1;
296
296
  break;
297
297
  }
298
298
  case "Backspace": {
299
- j.some((C) => C.value === y) && (L(), _(void 0), h(!0));
299
+ j.some((C) => C.value === y) && (K(), L(void 0), v(!0));
300
300
  break;
301
301
  }
302
302
  }
303
- if (k !== void 0 && (L(), z(!0), T > 0)) {
304
- const C = j[k % T];
303
+ if (k !== void 0 && (K(), B(!0), F > 0)) {
304
+ const C = j[k % F];
305
305
  C && I(C.value);
306
306
  }
307
307
  };
@@ -312,15 +312,9 @@ function _e({
312
312
  capture: !0
313
313
  });
314
314
  };
315
- }, [e, j, z, h, _, N, o, y, I]);
316
- const ie = P(() => ({
317
- clickOutsideDeactivates: !0,
318
- returnFocusOnDeactivate: !1,
319
- escapeDeactivates: !1
320
- }), []);
321
- return /* @__PURE__ */ O.jsx(fe.FocusTrap, { active: o, focusTrapOptions: ie, children: /* @__PURE__ */ O.jsx(ve, { ...v, ref: A, role: "combobox", autoComplete: "off", "aria-controls": V, "aria-expanded": o, "aria-activedescendant": o ? M : void 0, label: a, value: b, error: m, warning: c, information: i, footnote: u, attachments: o ? /* @__PURE__ */ O.jsx(Ae, { isLoading: t, id: V, activeOptionId: M, selectedValue: F, options: j, onSelect: ae, onHover: ce }) : null, className: p, onMouseDown: se, onChange: re, onBeforeInput: oe, onFocus: g, onBlur: x }) });
315
+ }, [e, j, B, v, L, N, o, y, I]), /* @__PURE__ */ V.jsx(de, { ...h, ref: A, role: "combobox", autoComplete: "off", "aria-controls": O, "aria-expanded": o, "aria-activedescendant": o ? M : void 0, label: a, value: b, error: m, warning: i, information: c, footnote: u, attachments: o ? /* @__PURE__ */ V.jsx(Ie, { isLoading: t, id: O, activeOptionId: M, selectedValue: S, options: j, onSelect: ae, onHover: ie }) : null, className: p, onMouseDown: se, onChange: re, onBeforeInput: oe, onFocus: g, onBlur: x });
322
316
  }
323
317
  export {
324
- _e as default,
325
- U as getComboboxOptionString
318
+ qe as default,
319
+ $ as getComboboxOptionString
326
320
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../jsx-runtime-BB_1_6y_.js"),e=require("react"),k=require("@kuma-ui/core"),P=require("react-dom"),$=require("../focus-trap-react-CkKg4ubd.js"),B=require("./text-button.js"),T=require("./decorators.js"),I=require("./flex.js"),D=require("./atom.js"),C=require("./text.js"),y=e.createContext({isVisible:!1,isInteractive:!1}),{Provider:z}=y;function _(){return e.useContext(y)}function G(){const{isInteractive:n,close:o}=_(),r=e.useCallback(()=>{o==null||o()},[o]);return s.jsxRuntimeExports.jsx("div",{className:"kakadu-components-2566044647",children:s.jsxRuntimeExports.jsx(B.default,{iconLeft:"times",label:"Close",disabled:!n,onClick:r})})}function J(n){return s.jsxRuntimeExports.jsx(I.default,{gap:2,...n})}function K({as:n,className:o,...r}){return s.jsxRuntimeExports.jsx(C.Heading,{...r,as:n??C.defaultHeadingElementType,className:k.cx("kakadu-components-4275938488",o)})}function Q({as:n,...o}){return s.jsxRuntimeExports.jsx(I.default,{direction:"row",gap:1,preset:"end",...o,as:n??D.defaultAtomElementType})}function U({root:n,outerDecorators:o=[],innerDecorators:r=[],label:f,maxWidth:c,className:m,isVisible:a,isFullWidth:l=!1,shouldCloseOnOutsideClick:i=!0,shouldCloseOnEscapePress:d=!0,showCloseButton:L=!0,onClose:p,children:N}){const v=e.useRef(null),R=e.useRef(null),[M,S]=e.useState(!1),[u,x]=e.useState(!1),b=e.useCallback(t=>{v.current=t,x(!1)},[]),E=e.useRef(null),g=e.useCallback(t=>{t&&(E.current=t)},[]),[h,q]=e.useState(a??!1),A=e.useMemo(()=>({isVisible:h,isInteractive:u,setInitialFocus:g,close:b}),[h,u,g,b]);e.useEffect(()=>{a&&(S(!0),q(!0))},[a]),e.useEffect(()=>{if(a){const t=setTimeout(()=>{x(!0)},100);return()=>{clearTimeout(t)}}x(!1)},[a]),e.useEffect(()=>{if(M&&!u){const t=setTimeout(()=>{p==null||p(v.current??void 0),q(!1)},370);return()=>{clearTimeout(t)}}},[M,u,p]),e.useEffect(()=>{const t=R.current;if(a&&i&&t){const j=H=>{t===H.target&&x(!1)};return t.addEventListener("click",j),()=>{t.removeEventListener("click",j)}}},[a,i]),e.useEffect(()=>{if(!a||!d)return;const t=j=>{j.key==="Escape"&&x(!1)};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[a,d]);const F=e.useMemo(()=>({initialFocus:()=>E.current??void 0,onActivate:()=>{var t;return(t=E.current)==null?void 0:t.focus()}}),[]),w=s.jsxRuntimeExports.jsx(T.default,{decorators:o,children:s.jsxRuntimeExports.jsx("div",{"aria-hidden":!u,style:{"--max-width":c?`${c}px`:void 0},className:k.cx("kakadu-components-4119461136",u&&"kakadu-components-2522346797",m),children:s.jsxRuntimeExports.jsx(T.default,{decorators:r,children:s.jsxRuntimeExports.jsx($.focusTrapReactExports.FocusTrap,{active:u,focusTrapOptions:F,children:s.jsxRuntimeExports.jsx("div",{ref:R,className:"kakadu-components-4011815997",children:s.jsxRuntimeExports.jsx("div",{role:"dialog","aria-modal":"true","aria-label":f??"Modal",className:k.cx("kakadu-components-3324483532",l&&"kakadu-components-3799971070",u&&"kakadu-components-968755580"),children:s.jsxRuntimeExports.jsxs(z,{value:A,children:[L?s.jsxRuntimeExports.jsx(G,{}):null,s.jsxRuntimeExports.jsx("div",{className:k.cx("kakadu-components-633990035",l&&"kakadu-components-171969824"),children:N})]})})})})})})});return n?P.createPortal(w,n):w}function V(n,o){const[r,f]=e.useState(!1),c=e.useRef(void 0),m=e.useCallback(async()=>(f(!0),new Promise(i=>{c.current=i})),[]),a=e.useCallback(i=>{var d;f(!1),(d=c.current)==null||d.call(c,i),c.current=void 0},[]),l=e.useMemo(()=>s.jsxRuntimeExports.jsx(n,{...o,isVisible:r,onClose:a}),[n,o,r,a]);return e.useMemo(()=>({isVisible:r,show:m,modal:l}),[r,m,l])}exports.ModalActions=Q;exports.ModalContent=J;exports.ModalHeading=K;exports.default=U;exports.useModal=V;exports.useModalContext=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../jsx-runtime-BB_1_6y_.js"),e=require("react"),k=require("@kuma-ui/core"),P=require("react-dom"),$=require("../focus-trap-react-B7f3iC5h.js"),B=require("./text-button.js"),T=require("./decorators.js"),I=require("./flex.js"),D=require("./atom.js"),C=require("./text.js"),y=e.createContext({isVisible:!1,isInteractive:!1}),{Provider:z}=y;function _(){return e.useContext(y)}function G(){const{isInteractive:n,close:o}=_(),r=e.useCallback(()=>{o==null||o()},[o]);return s.jsxRuntimeExports.jsx("div",{className:"kakadu-components-2566044647",children:s.jsxRuntimeExports.jsx(B.default,{iconLeft:"times",label:"Close",disabled:!n,onClick:r})})}function J(n){return s.jsxRuntimeExports.jsx(I.default,{gap:2,...n})}function K({as:n,className:o,...r}){return s.jsxRuntimeExports.jsx(C.Heading,{...r,as:n??C.defaultHeadingElementType,className:k.cx("kakadu-components-4275938488",o)})}function Q({as:n,...o}){return s.jsxRuntimeExports.jsx(I.default,{direction:"row",gap:1,preset:"end",...o,as:n??D.defaultAtomElementType})}function U({root:n,outerDecorators:o=[],innerDecorators:r=[],label:f,maxWidth:c,className:m,isVisible:a,isFullWidth:l=!1,shouldCloseOnOutsideClick:i=!0,shouldCloseOnEscapePress:d=!0,showCloseButton:L=!0,onClose:p,children:N}){const v=e.useRef(null),R=e.useRef(null),[M,S]=e.useState(!1),[u,x]=e.useState(!1),b=e.useCallback(t=>{v.current=t,x(!1)},[]),E=e.useRef(null),g=e.useCallback(t=>{t&&(E.current=t)},[]),[h,q]=e.useState(a??!1),A=e.useMemo(()=>({isVisible:h,isInteractive:u,setInitialFocus:g,close:b}),[h,u,g,b]);e.useEffect(()=>{a&&(S(!0),q(!0))},[a]),e.useEffect(()=>{if(a){const t=setTimeout(()=>{x(!0)},100);return()=>{clearTimeout(t)}}x(!1)},[a]),e.useEffect(()=>{if(M&&!u){const t=setTimeout(()=>{p==null||p(v.current??void 0),q(!1)},370);return()=>{clearTimeout(t)}}},[M,u,p]),e.useEffect(()=>{const t=R.current;if(a&&i&&t){const j=H=>{t===H.target&&x(!1)};return t.addEventListener("click",j),()=>{t.removeEventListener("click",j)}}},[a,i]),e.useEffect(()=>{if(!a||!d)return;const t=j=>{j.key==="Escape"&&x(!1)};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[a,d]);const F=e.useMemo(()=>({initialFocus:()=>E.current??void 0,onActivate:()=>{var t;return(t=E.current)==null?void 0:t.focus()}}),[]),w=s.jsxRuntimeExports.jsx(T.default,{decorators:o,children:s.jsxRuntimeExports.jsx("div",{"aria-hidden":!u,style:{"--max-width":c?`${c}px`:void 0},className:k.cx("kakadu-components-4119461136",u&&"kakadu-components-2522346797",m),children:s.jsxRuntimeExports.jsx(T.default,{decorators:r,children:s.jsxRuntimeExports.jsx($.focusTrapReactExports.FocusTrap,{active:u,focusTrapOptions:F,children:s.jsxRuntimeExports.jsx("div",{ref:R,className:"kakadu-components-4011815997",children:s.jsxRuntimeExports.jsx("div",{role:"dialog","aria-modal":"true","aria-label":f??"Modal",className:k.cx("kakadu-components-3324483532",l&&"kakadu-components-3799971070",u&&"kakadu-components-968755580"),children:s.jsxRuntimeExports.jsxs(z,{value:A,children:[L?s.jsxRuntimeExports.jsx(G,{}):null,s.jsxRuntimeExports.jsx("div",{className:k.cx("kakadu-components-633990035",l&&"kakadu-components-171969824"),children:N})]})})})})})})});return n?P.createPortal(w,n):w}function V(n,o){const[r,f]=e.useState(!1),c=e.useRef(void 0),m=e.useCallback(async()=>(f(!0),new Promise(i=>{c.current=i})),[]),a=e.useCallback(i=>{var d;f(!1),(d=c.current)==null||d.call(c,i),c.current=void 0},[]),l=e.useMemo(()=>s.jsxRuntimeExports.jsx(n,{...o,isVisible:r,onClose:a}),[n,o,r,a]);return e.useMemo(()=>({isVisible:r,show:m,modal:l}),[r,m,l])}exports.ModalActions=Q;exports.ModalContent=J;exports.ModalHeading=K;exports.default=U;exports.useModal=V;exports.useModalContext=_;
@@ -2,7 +2,7 @@ import { j as t } from "../jsx-runtime-B4hRZ52C.mjs";
2
2
  import { createContext as q, useRef as j, useState as h, useCallback as f, useMemo as I, useEffect as m, useContext as z } from "react";
3
3
  import { cx as w } from "@kuma-ui/core";
4
4
  import { createPortal as G } from "react-dom";
5
- import { f as J } from "../focus-trap-react-DATIi_Ob.mjs";
5
+ import { f as J } from "../focus-trap-react-Dr3BYLw6.mjs";
6
6
  import K from "./text-button.mjs";
7
7
  import F from "./decorators.mjs";
8
8
  import C from "./flex.mjs";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),f=require("@kuma-ui/core"),e=require("react"),K=require("../focus-trap-react-CkKg4ubd.js"),R=require("./atom.js"),$=e.createContext({isVisible:!1,isPreparingFocus:!1,isFocused:!1}),{Provider:Q}=$;function X(){return e.useContext($)}function Y({as:i,className:s,...o}){return n.jsxRuntimeExports.jsx(R.default,{as:i??R.defaultAtomElementType,...o,className:f.cx("kakadu-components-2845019685",s)})}function Z({as:i,isVisible:s,label:o,shouldCloseOnOutsideClick:d=!0,shouldCloseOnEscapePress:a=!0,children:p,className:u,innerClassName:x,onClose:r,...v}){const I=e.useRef(null),S=e.useRef(null),[q,h]=e.useState(!1),[A,k]=e.useState(!1),[C,H]=e.useState(!1),[c,g]=e.useState(!1),[U,j]=e.useState(!1),M=e.useCallback(t=>{I.current=t,g(!1)},[]),E=e.useRef(null),N=e.useCallback(t=>{t&&(E.current=t)},[]),G=e.useMemo(()=>({initialFocus:()=>E.current??void 0,onPostActivate(){var t;k(!0),h(!1),(t=E.current)==null||t.focus()},clickOutsideDeactivates:d,escapeDeactivates:a,onPostUnpause(){k(!0)},onPause(){k(!1)},onDeactivate(){j(!1),g(!1),k(!1)}}),[d,a]),[L,O]=e.useState(s??!1),J=e.useMemo(()=>({isVisible:L,isPreparingFocus:q,isFocused:A,setInitialFocus:N,close:M}),[L,q,A,N,M]),[l,y]=e.useState("center");return e.useEffect(()=>{const t=S.current;if(t){const P=()=>{const D=t.offsetParent,F=D instanceof HTMLElement?D.getBoundingClientRect():null,V=t.getBoundingClientRect();if(!F){y("center");return}const T=16,_=window.innerWidth-T,b=F.left+F.width/2-V.width/2,z=b+V.width,B=b<T,W=z>_;let m="center";if(B&&W){const w=T-b;m=z-_>w?"right":"left"}else W?m="right":B&&(m="left");y(w=>w===m?w:m)};return P(),window.addEventListener("resize",P),()=>{window.removeEventListener("resize",P)}}},[]),e.useEffect(()=>{s&&(H(!0),O(!0))},[s]),e.useEffect(()=>{if(s){const t=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(t)}}g(!1)},[s]),e.useEffect(()=>{if(!c){j(!1),h(!1);return}h(!0);const t=window.requestAnimationFrame(()=>{j(!0)});return()=>{window.cancelAnimationFrame(t)}},[c]),e.useEffect(()=>{if(C&&!c){const t=setTimeout(()=>{r==null||r(I.current??void 0),O(!1)},370);return()=>{clearTimeout(t)}}},[C,c,r]),n.jsxRuntimeExports.jsx(R.default,{reference:S,as:i??R.defaultAtomElementType,role:"dialog","aria-hidden":!c,"aria-label":o??"Popover",...v,className:f.cx("kakadu-components-3920007758",l==="left"&&"kakadu-components-611400930",l==="right"&&"kakadu-components-944244368",c&&"kakadu-components-1399012551",u),children:n.jsxRuntimeExports.jsxs("div",{className:f.cx("kakadu-components-1118152266",c&&"kakadu-components-231244945"),children:[n.jsxRuntimeExports.jsx("div",{className:f.cx("kakadu-components-1951789226",l==="left"&&"kakadu-components-1495725644",l==="right"&&"kakadu-components-4235689197")}),n.jsxRuntimeExports.jsx(K.focusTrapReactExports.FocusTrap,{active:U,focusTrapOptions:G,children:n.jsxRuntimeExports.jsxs("div",{className:f.cx("kakadu-components-2488426662",x),children:[n.jsxRuntimeExports.jsx(Q,{value:J,children:p}),n.jsxRuntimeExports.jsx("div",{className:f.cx("kakadu-components-3252390100",l==="left"&&"kakadu-components-3754561431",l==="right"&&"kakadu-components-2265262600")})]})})]})})}function ee(i,s){const[o,d]=e.useState(!1),a=e.useRef(void 0),p=e.useCallback(async()=>(d(!0),new Promise(r=>{a.current=r})),[]),u=e.useCallback(r=>{var v;d(!1),(v=a.current)==null||v.call(a,r),a.current=void 0},[]),x=e.useMemo(()=>n.jsxRuntimeExports.jsx(i,{...s,isVisible:o,onClose:u}),[i,s,o,u]);return e.useMemo(()=>({isVisible:o,show:p,close:u,popover:x}),[o,p,u,x])}exports.PopoverContainer=Y;exports.default=Z;exports.usePopover=ee;exports.usePopoverContext=X;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),f=require("@kuma-ui/core"),e=require("react"),K=require("../focus-trap-react-B7f3iC5h.js"),R=require("./atom.js"),$=e.createContext({isVisible:!1,isPreparingFocus:!1,isFocused:!1}),{Provider:Q}=$;function X(){return e.useContext($)}function Y({as:i,className:s,...o}){return n.jsxRuntimeExports.jsx(R.default,{as:i??R.defaultAtomElementType,...o,className:f.cx("kakadu-components-2845019685",s)})}function Z({as:i,isVisible:s,label:o,shouldCloseOnOutsideClick:d=!0,shouldCloseOnEscapePress:a=!0,children:p,className:u,innerClassName:x,onClose:r,...v}){const I=e.useRef(null),S=e.useRef(null),[q,h]=e.useState(!1),[A,k]=e.useState(!1),[C,H]=e.useState(!1),[c,g]=e.useState(!1),[U,j]=e.useState(!1),M=e.useCallback(t=>{I.current=t,g(!1)},[]),E=e.useRef(null),N=e.useCallback(t=>{t&&(E.current=t)},[]),G=e.useMemo(()=>({initialFocus:()=>E.current??void 0,onPostActivate(){var t;k(!0),h(!1),(t=E.current)==null||t.focus()},clickOutsideDeactivates:d,escapeDeactivates:a,onPostUnpause(){k(!0)},onPause(){k(!1)},onDeactivate(){j(!1),g(!1),k(!1)}}),[d,a]),[L,O]=e.useState(s??!1),J=e.useMemo(()=>({isVisible:L,isPreparingFocus:q,isFocused:A,setInitialFocus:N,close:M}),[L,q,A,N,M]),[l,y]=e.useState("center");return e.useEffect(()=>{const t=S.current;if(t){const P=()=>{const D=t.offsetParent,F=D instanceof HTMLElement?D.getBoundingClientRect():null,V=t.getBoundingClientRect();if(!F){y("center");return}const T=16,_=window.innerWidth-T,b=F.left+F.width/2-V.width/2,z=b+V.width,B=b<T,W=z>_;let m="center";if(B&&W){const w=T-b;m=z-_>w?"right":"left"}else W?m="right":B&&(m="left");y(w=>w===m?w:m)};return P(),window.addEventListener("resize",P),()=>{window.removeEventListener("resize",P)}}},[]),e.useEffect(()=>{s&&(H(!0),O(!0))},[s]),e.useEffect(()=>{if(s){const t=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(t)}}g(!1)},[s]),e.useEffect(()=>{if(!c){j(!1),h(!1);return}h(!0);const t=window.requestAnimationFrame(()=>{j(!0)});return()=>{window.cancelAnimationFrame(t)}},[c]),e.useEffect(()=>{if(C&&!c){const t=setTimeout(()=>{r==null||r(I.current??void 0),O(!1)},370);return()=>{clearTimeout(t)}}},[C,c,r]),n.jsxRuntimeExports.jsx(R.default,{reference:S,as:i??R.defaultAtomElementType,role:"dialog","aria-hidden":!c,"aria-label":o??"Popover",...v,className:f.cx("kakadu-components-3920007758",l==="left"&&"kakadu-components-611400930",l==="right"&&"kakadu-components-944244368",c&&"kakadu-components-1399012551",u),children:n.jsxRuntimeExports.jsxs("div",{className:f.cx("kakadu-components-1118152266",c&&"kakadu-components-231244945"),children:[n.jsxRuntimeExports.jsx("div",{className:f.cx("kakadu-components-1951789226",l==="left"&&"kakadu-components-1495725644",l==="right"&&"kakadu-components-4235689197")}),n.jsxRuntimeExports.jsx(K.focusTrapReactExports.FocusTrap,{active:U,focusTrapOptions:G,children:n.jsxRuntimeExports.jsxs("div",{className:f.cx("kakadu-components-2488426662",x),children:[n.jsxRuntimeExports.jsx(Q,{value:J,children:p}),n.jsxRuntimeExports.jsx("div",{className:f.cx("kakadu-components-3252390100",l==="left"&&"kakadu-components-3754561431",l==="right"&&"kakadu-components-2265262600")})]})})]})})}function ee(i,s){const[o,d]=e.useState(!1),a=e.useRef(void 0),p=e.useCallback(async()=>(d(!0),new Promise(r=>{a.current=r})),[]),u=e.useCallback(r=>{var v;d(!1),(v=a.current)==null||v.call(a,r),a.current=void 0},[]),x=e.useMemo(()=>n.jsxRuntimeExports.jsx(i,{...s,isVisible:o,onClose:u}),[i,s,o,u]);return e.useMemo(()=>({isVisible:o,show:p,close:u,popover:x}),[o,p,u,x])}exports.PopoverContainer=Y;exports.default=Z;exports.usePopover=ee;exports.usePopoverContext=X;
@@ -1,7 +1,7 @@
1
1
  import { j as s } from "../jsx-runtime-B4hRZ52C.mjs";
2
2
  import { cx as f } from "@kuma-ui/core";
3
3
  import { createContext as ee, useRef as F, useState as r, useCallback as P, useMemo as j, useEffect as p, useContext as te } from "react";
4
- import { f as se } from "../focus-trap-react-DATIi_Ob.mjs";
4
+ import { f as se } from "../focus-trap-react-Dr3BYLw6.mjs";
5
5
  import K, { defaultAtomElementType as Q } from "./atom.mjs";
6
6
  const X = ee({
7
7
  isVisible: !1,