@kakadu/components 4.0.8 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("../jsx-runtime-BB_1_6y_.js"),r=require("react"),G=require("../_commonjsHelpers-DGT2Y9Xa.js"),B=require("@kuma-ui/core"),oe=require("../use-synchronized-value-D0_rS5Wp.js"),re=require("../icons/icon.js"),ae=require("../icons/chevron-up.js"),ce=require("./input.js"),D=require("./text.js"),X=require("./flex.js"),le=require("./skeleton.js");var K={exports:{}};const _=new Uint32Array(65536),ie=(t,c)=>{const o=t.length,h=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<h;n++){let m=_[c.charCodeAt(n)];const p=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|~(p|f),f&=p}for(n=o;n--;)_[t.charCodeAt(n)]=0;return x},ue=(t,c)=>{const o=c.length,h=t.length,l=[],i=[],f=Math.ceil(o/32),x=Math.ceil(h/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,h)+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,A=v|e,E=((v|w)&u)+u^u|v|w;let q=e|~(E|u),V=u&E;q>>>31^k&&(i[s/32|0]^=1<<s),V>>>31^w&&(l[s/32|0]^=1<<s),q=q<<1|k,V=V<<1|w,u=V|~(A|q),e=q&A}for(let s=b;s<g;s++)_[t.charCodeAt(s)]=0}let m=0,p=-1;const C=n*32,R=Math.min(32,h-C)+C;for(let e=C;e<R;e++)_[t.charCodeAt(e)]|=1<<e;let O=h;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)&p)+p^p|u|g;let k=m|~(v|p),w=p&v;O+=k>>>h-1&1,O-=w>>>h-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,p=w|~(s|k),m=k&s}for(let e=C;e<R;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?ie(t,c):ue(t,c)},fe=(t,c)=>{let o=1/0,h=0;for(let l=0;l<c.length;l++){const i=J(t,c[l]);i<o&&(o=i,h=l)}return c[h]},de=Object.freeze(Object.defineProperty({__proto__:null,closest:fe,distance:J},Symbol.toStringTag,{value:"Module"})),me=G.getAugmentedNamespace(de);var Y;function he(){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 h=me,l=[],i=[],f={get:function(x,n,m){var p=m&&o&&m.useCollator;if(p){var C=x.length,R=n.length;if(C===0)return R;if(R===0)return C;var O,e,u,b,g;for(u=0;u<R;++u)l[u]=u,i[u]=n.charCodeAt(u);l[R]=R;var s;for(u=0;u<C;++u){for(e=u+1,b=0;b<R;++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 h.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=he();const ve=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 H="kakadu-components-1144794361",P="kakadu-components-2911184744";function xe({isSelected:t,id:c,value:o,label:h,onSelect:l,onHover:i}){const{isKeyboardNavigating:f}=Q(),x=r.useCallback(()=>{l(o)},[l,o]),n=r.useCallback(p=>{f||p.movementX===0&&p.movementY===0||i(o)},[f,i,o]),m=r.useRef(null);return r.useEffect(()=>{const p=m.current;t&&p&&f&&setTimeout(()=>{p.scrollIntoView({behavior:"smooth",block:"nearest"})},0)},[t,f]),j.jsxRuntimeExports.jsx("li",{ref:m,id:c,role:"option","aria-selected":t,tabIndex:-1,className:B.cx(H,"kakadu-components-4130497639",f?"kakadu-components-962373561":"kakadu-components-1109598791"),onClick:x,onMouseMove:n,children:j.jsxRuntimeExports.jsx(D.Span,{className:B.cx(P,typeof h=="string"&&"kakadu-components-154286052"),children:h})})}function be({isLoading:t,id:c,activeOptionId:o,selectedValue:h,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"})},[]),j.jsxRuntimeExports.jsxs("ul",{ref:x,id:c,role:"listbox","aria-label":"Options",tabIndex:-1,className:"kakadu-components-1951042708",children:[l.length===0?t?null:j.jsxRuntimeExports.jsxs(X.default,{"aria-atomic":!0,as:"li",role:"status","aria-live":"polite",direction:"row",preset:"start",gap:.5,className:H,children:[j.jsxRuntimeExports.jsx(re.default,{size:15,type:"exclamationTriangle"}),j.jsxRuntimeExports.jsx(D.Span,{className:P,children:"No results."})]}):l.map((n,m)=>j.jsxRuntimeExports.jsx(xe,{...n,id:n.value===h?o:void 0,isSelected:n.value===h,onSelect:i,onHover:f},T(n)+m)),t?j.jsxRuntimeExports.jsx(X.default,{as:"li",alignment:"center",className:H,children:j.jsxRuntimeExports.jsx(D.Span,{className:P,children:j.jsxRuntimeExports.jsx(le.SkeletonInstance,{width:"100%",height:"1.3em"})})}):null]})}function ge({isLoading:t,label:c,options:o,error:h,warning:l,information:i,footnote:f,className:x,onChange:n,onSelect:m,...p}){const C=r.useRef(null),R=r.useId(),O=r.useId(),[e,u]=r.useState(!1),b=r.useCallback(()=>{u(!0)},[]),g=r.useCallback(a=>{var d;(d=C.current)!=null&&d.contains(a.relatedTarget)||u(!1)},[]),[s,v]=r.useState(!1);r.useEffect(()=>{v(e)},[e]);const[k,w]=r.useState(""),{value:A}=p,[E,q]=r.useState(A),[V,W]=r.useState(A),U=r.useRef(V),I=r.useCallback(a=>{W(a),U.current=a},[]);r.useEffect(()=>{q(A),I(A)},[A,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),q(void 0)},[n]),te=r.useCallback(a=>{var d;(d=C.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),q(a),v(!1)},[o,z]),se=r.useCallback(a=>{I(a)},[I]),S=r.useMemo(()=>E||k.length===0?o:o.filter(a=>{const y=T(a).toLowerCase(),M=k.toLowerCase();return!!(y.includes(M)||M.includes(y)||ve.get(y,M,{useCollator:!0})<=2)}),[E,o,k]);r.useEffect(()=>{!E&&k.length>0&&S.length>0&&!S.some(a=>V===a.value)&&I(S[0].value)},[E,k,S,V,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 M=S.length,$=S.findIndex(N=>N.value===U.current),L=()=>{d.preventDefault(),d.stopPropagation(),d.stopImmediatePropagation()};switch(d.key){case"Enter":{const N=S[$];N&&(L(),F(!0),v(!1),z(N),q(N.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=M-1);break}case"Home":{v(!0),y=0;break}case"End":{v(!0),y=M-1;break}case"Backspace":{S.some(N=>N.value===E)&&(L(),z(void 0),v(!0));break}}if(y!==void 0&&(L(),F(!0),M>0)){const N=S[y%M];N&&I(N.value)}};return window.addEventListener("keydown",a,{capture:!0}),()=>{window.removeEventListener("keydown",a,{capture:!0})}},[e,S,F,v,z,q,s,E,I]),j.jsxRuntimeExports.jsx(ce.default,{...p,ref:C,role:"combobox",autoComplete:"off","aria-controls":R,"aria-expanded":s,"aria-activedescendant":s?O:void 0,label:c,value:k,error:h,warning:l,information:i,footnote:f,attachments:s?j.jsxRuntimeExports.jsx(be,{isLoading:t,id:R,activeOptionId:O,selectedValue:V,options:S,onSelect:ne,onHover:se}):null,className:B.cx(x,"kakadu-components-879486679"),onMouseDown:te,onChange:ee,onBeforeInput:Z,onFocus:b,onBlur:g,children:j.jsxRuntimeExports.jsx(ae.default,{width:14,height:14,className:"kakadu-components-158931186"})})}exports.default=ge;exports.getComboboxOptionString=T;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("../jsx-runtime-BB_1_6y_.js"),o=require("react"),Q=require("../_commonjsHelpers-DGT2Y9Xa.js"),B=require("@kuma-ui/core"),ce=require("../hooks/use-synchronized-value.js"),ae=require("../icons/icon.js"),le=require("../icons/chevron-up.js"),ie=require("./input.js"),H=require("./text.js"),G=require("./flex.js"),ue=require("./skeleton.js");var K={exports:{}};const N=new Uint32Array(65536),fe=(t,a)=>{const r=t.length,m=a.length,l=1<<r-1;let i=-1,f=0,x=r,n=r;for(;n--;)N[t.charCodeAt(n)]|=1<<n;for(n=0;n<m;n++){let d=N[a.charCodeAt(n)];const v=d|f;d|=(d&i)+i^i,f|=~(d|i),i&=d,f&l&&x++,i&l&&x--,f=f<<1|1,i=i<<1|~(v|f),f&=v}for(n=r;n--;)N[t.charCodeAt(n)]=0;return x},de=(t,a)=>{const r=a.length,m=t.length,l=[],i=[],f=Math.ceil(r/32),x=Math.ceil(m/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,k=Math.min(32,m)+b;for(let s=b;s<k;s++)N[t.charCodeAt(s)]|=1<<s;for(let s=0;s<r;s++){const p=N[a.charCodeAt(s)],q=i[s/32|0]>>>s&1,g=l[s/32|0]>>>s&1,A=p|e,j=((p|g)&u)+u^u|p|g;let S=e|~(j|u),_=u&j;S>>>31^q&&(i[s/32|0]^=1<<s),_>>>31^g&&(l[s/32|0]^=1<<s),S=S<<1|q,_=_<<1|g,u=_|~(A|S),e=S&A}for(let s=b;s<k;s++)N[t.charCodeAt(s)]=0}let d=0,v=-1;const y=n*32,R=Math.min(32,m-y)+y;for(let e=y;e<R;e++)N[t.charCodeAt(e)]|=1<<e;let V=m;for(let e=0;e<r;e++){const u=N[a.charCodeAt(e)],b=i[e/32|0]>>>e&1,k=l[e/32|0]>>>e&1,s=u|d,p=((u|k)&v)+v^v|u|k;let q=d|~(p|v),g=v&p;V+=q>>>m-1&1,V-=g>>>m-1&1,q>>>31^b&&(i[e/32|0]^=1<<e),g>>>31^k&&(l[e/32|0]^=1<<e),q=q<<1|b,g=g<<1|k,v=g|~(s|q),d=q&s}for(let e=y;e<R;e++)N[t.charCodeAt(e)]=0;return V},W=(t,a)=>{if(t.length<a.length){const r=a;a=t,t=r}return a.length===0?t.length:t.length<=32?fe(t,a):de(t,a)},me=(t,a)=>{let r=1/0,m=0;for(let l=0;l<a.length;l++){const i=W(t,a[l]);i<r&&(r=i,m=l)}return a[m]},he=Object.freeze(Object.defineProperty({__proto__:null,closest:me,distance:W},Symbol.toStringTag,{value:"Module"})),ve=Q.getAugmentedNamespace(he);var J;function pe(){return J||(J=1,(function(t,a){(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 m=ve,l=[],i=[],f={get:function(x,n,d){var v=d&&r&&d.useCollator;if(v){var y=x.length,R=n.length;if(y===0)return R;if(R===0)return y;var V,e,u,b,k;for(u=0;u<R;++u)l[u]=u,i[u]=n.charCodeAt(u);l[R]=R;var s;for(u=0;u<y;++u){for(e=u+1,b=0;b<R;++b)V=e,s=r.compare(x.charAt(u),String.fromCharCode(i[b]))===0,e=l[b]+(s?0:1),k=V+1,e>k&&(e=k),k=l[b+1]+1,e>k&&(e=k),l[b]=V;l[b]=e}return e}return m.distance(x,n)}};t!==null&&t.exports===a?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 xe=pe();const be=Q.getDefaultExportFromCjs(xe);function Z(){const{value:t,setValue:a}=ce.default("isKeyboardNavigating");return o.useMemo(()=>({isKeyboardNavigating:t,setIsKeyboardNavigating:a}),[t,a])}function T(t){return"text"in t?t.text:t.label}const P="kakadu-components-1144794361",U="kakadu-components-2911184744";function ke({isSelected:t,id:a,value:r,label:m,onSelect:l,onHover:i}){const{isKeyboardNavigating:f}=Z(),x=o.useCallback(()=>{l(r)},[l,r]),n=o.useCallback(v=>{f||v.movementX===0&&v.movementY===0||i(r)},[f,i,r]),d=o.useRef(null);return o.useEffect(()=>{const v=d.current;t&&v&&f&&setTimeout(()=>{v.scrollIntoView({behavior:"smooth",block:"nearest"})},0)},[t,f]),C.jsxRuntimeExports.jsx("li",{ref:d,id:a,role:"option","aria-selected":t,tabIndex:-1,className:B.cx(P,"kakadu-components-4130497639",f?"kakadu-components-962373561":"kakadu-components-1109598791"),onClick:x,onMouseMove:n,children:C.jsxRuntimeExports.jsx(H.Span,{className:B.cx(U,typeof m=="string"&&"kakadu-components-154286052"),children:m})})}function ge({isLoading:t,id:a,activeOptionId:r,selectedValue:m,options:l,onSelect:i,onHover:f}){const x=o.useRef(null);return o.useEffect(()=>{const n=x.current;n&&n.scrollIntoView({behavior:"smooth",block:"nearest"})},[]),C.jsxRuntimeExports.jsxs("ul",{ref:x,id:a,role:"listbox","aria-label":"Options",tabIndex:-1,className:"kakadu-components-1951042708",children:[l.length===0?t?null:C.jsxRuntimeExports.jsxs(G.default,{"aria-atomic":!0,as:"li",role:"status","aria-live":"polite",direction:"row",preset:"start",gap:.5,className:P,children:[C.jsxRuntimeExports.jsx(ae.default,{size:15,type:"exclamationTriangle"}),C.jsxRuntimeExports.jsx(H.Span,{className:U,children:"No results."})]}):l.map((n,d)=>C.jsxRuntimeExports.jsx(ke,{...n,id:n.value===m?r:void 0,isSelected:n.value===m,onSelect:i,onHover:f},T(n)+d)),t?C.jsxRuntimeExports.jsx(G.default,{as:"li",alignment:"center",className:P,children:C.jsxRuntimeExports.jsx(H.Span,{className:U,children:C.jsxRuntimeExports.jsx(ue.SkeletonInstance,{width:"100%",height:"1.3em"})})}):null]})}function we({isLoading:t,label:a,options:r,error:m,warning:l,information:i,footnote:f,className:x,onChange:n,onSelect:d,...v}){const y=o.useRef(null),R=o.useId(),V=o.useId(),[e,u]=o.useState(!1),b=o.useCallback(()=>{u(!0)},[]),k=o.useCallback(c=>{var h;(h=y.current)!=null&&h.contains(c.relatedTarget)||u(!1)},[]),[s,p]=o.useState(!1);o.useEffect(()=>{p(e)},[e]);const[q,g]=o.useState(""),{value:A}=v,[j,S]=o.useState(A),[_,ee]=o.useState(A),X=o.useRef(_),I=o.useCallback(c=>{ee(c),X.current=c},[]);o.useEffect(()=>{S(A),I(A)},[A,I]);const te=o.useCallback(()=>{j&&(g(""),I(void 0))},[j,I]),ne=o.useCallback((c,h)=>{g(c),n==null||n(c,h),p(!0),S(void 0)},[n]),se=o.useCallback(c=>{var h;(h=y.current)!=null&&h.contains(c.target)&&p(!0)},[]),L=o.useCallback(c=>{const h=c==null?void 0:c.value;I(h),c?g(T(c)):(g(""),n==null||n("")),d==null||d(h)},[I,n,d]),oe=o.useCallback(c=>{const h=r.find(w=>w.value===c);L(h),S(c),p(!1)},[r,L]),re=o.useCallback(c=>{I(c)},[I]),D=o.useDeferredValue(q),O=o.useMemo(()=>j||D.length===0?r:r.filter(c=>{const w=T(c).toLowerCase(),M=D.toLowerCase();return!!(w.includes(M)||M.includes(w)||be.get(w,M,{useCollator:!0})<=2)}),[j,r,D]);o.useEffect(()=>{!j&&D.length>0&&O.length>0&&!O.some(c=>_===c.value)&&I(O[0].value)},[j,D,O,_,I]);const{setIsKeyboardNavigating:F}=Z();return o.useEffect(()=>{if(!e)return;const c=h=>{h.movementX===0&&h.movementY===0||F(!1)};return window.addEventListener("mousemove",c,{capture:!0}),()=>{window.removeEventListener("mousemove",c,{capture:!0})}},[e,F]),o.useEffect(()=>{if(!e)return;const c=h=>{var Y;let w;const M=O.length,$=O.findIndex(E=>E.value===X.current),z=()=>{h.preventDefault(),h.stopPropagation(),h.stopImmediatePropagation()};switch(h.key){case"Enter":{const E=O[$];E&&(z(),F(!0),p(!1),L(E),S(E.value));break}case"Escape":{if(s)z(),j?I(void 0):L(void 0),p(!1);else if(j)z(),p(!0),L(void 0);else{z(),u(!1);const E=document.activeElement;E instanceof HTMLElement&&((Y=y.current)!=null&&Y.contains(E))&&E.blur()}return}case"ArrowDown":{w=$+1,p(!0);break}case"ArrowUp":{w=$-1,p(!0),w<0&&(w=M-1);break}case"Home":{p(!0),w=0;break}case"End":{p(!0),w=M-1;break}case"Backspace":{O.some(E=>E.value===j)&&(z(),L(void 0),p(!0));break}}if(w!==void 0&&(z(),F(!0),M>0)){const E=O[w%M];E&&I(E.value)}};return window.addEventListener("keydown",c,{capture:!0}),()=>{window.removeEventListener("keydown",c,{capture:!0})}},[e,O,F,p,L,S,s,j,I]),C.jsxRuntimeExports.jsx(ie.default,{...v,ref:y,role:"combobox",autoComplete:"off","aria-controls":R,"aria-expanded":s,"aria-activedescendant":s?V:void 0,label:a,value:q,error:m,warning:l,information:i,footnote:f,attachments:s?C.jsxRuntimeExports.jsx(ge,{isLoading:t,id:R,activeOptionId:V,selectedValue:_,options:O,onSelect:oe,onHover:re}):null,className:B.cx(x,"kakadu-components-879486679"),onMouseDown:se,onChange:ne,onBeforeInput:te,onFocus:b,onBlur:k,children:C.jsxRuntimeExports.jsx(le.default,{width:14,height:14,className:"kakadu-components-158931186"})})}exports.default=we;exports.getComboboxOptionString=T;
@@ -1,80 +1,80 @@
1
1
  import { j as N } from "../jsx-runtime-B4hRZ52C.mjs";
2
- import { useRef as T, useId as J, 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 P } 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 "../icons/chevron-up.mjs";
8
- import me from "./input.mjs";
9
- import { Span as U } from "./text.mjs";
10
- import Q from "./flex.mjs";
11
- import { SkeletonInstance as he } from "./skeleton.mjs";
12
- var R = { exports: {} };
13
- const _ = new Uint32Array(65536), ve = (t, a) => {
14
- const r = t.length, m = a.length, i = 1 << r - 1;
15
- let c = -1, u = 0, p = r, n = r;
2
+ import { useRef as H, useId as W, useState as R, useCallback as M, useEffect as z, useDeferredValue as ue, useMemo as te } from "react";
3
+ import { g as fe, a as de } from "../_commonjsHelpers-MdHo5S7N.mjs";
4
+ import { cx as U } from "@kuma-ui/core";
5
+ import me from "../hooks/use-synchronized-value.mjs";
6
+ import he from "../icons/icon.mjs";
7
+ import ve from "../icons/chevron-up.mjs";
8
+ import pe from "./input.mjs";
9
+ import { Span as $ } from "./text.mjs";
10
+ import Z from "./flex.mjs";
11
+ import { SkeletonInstance as ge } from "./skeleton.mjs";
12
+ var T = { exports: {} };
13
+ const _ = new Uint32Array(65536), xe = (t, a) => {
14
+ const r = t.length, d = a.length, c = 1 << r - 1;
15
+ let i = -1, u = 0, p = r, n = r;
16
16
  for (; n--; )
17
17
  _[t.charCodeAt(n)] |= 1 << n;
18
- for (n = 0; n < m; n++) {
19
- let d = _[a.charCodeAt(n)];
20
- const h = d | u;
21
- 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;
18
+ for (n = 0; n < d; n++) {
19
+ let f = _[a.charCodeAt(n)];
20
+ const h = f | u;
21
+ f |= (f & i) + i ^ i, u |= ~(f | i), i &= f, u & c && p++, i & c && p--, u = u << 1 | 1, i = i << 1 | ~(h | u), u &= h;
22
22
  }
23
23
  for (n = r; n--; )
24
24
  _[t.charCodeAt(n)] = 0;
25
25
  return p;
26
- }, pe = (t, a) => {
27
- const r = a.length, m = t.length, i = [], c = [], u = Math.ceil(r / 32), p = Math.ceil(m / 32);
26
+ }, be = (t, a) => {
27
+ const r = a.length, d = t.length, c = [], i = [], u = Math.ceil(r / 32), p = Math.ceil(d / 32);
28
28
  for (let e = 0; e < u; e++)
29
- c[e] = -1, i[e] = 0;
29
+ i[e] = -1, c[e] = 0;
30
30
  let n = 0;
31
31
  for (; n < p - 1; n++) {
32
32
  let e = 0, l = -1;
33
- const g = n * 32, x = Math.min(32, m) + g;
33
+ const g = n * 32, x = Math.min(32, d) + g;
34
34
  for (let o = g; o < x; o++)
35
35
  _[t.charCodeAt(o)] |= 1 << o;
36
36
  for (let o = 0; o < r; o++) {
37
- const v = _[a.charCodeAt(o)], b = c[o / 32 | 0] >>> o & 1, k = i[o / 32 | 0] >>> o & 1, q = v | e, y = ((v | k) & l) + l ^ l | v | k;
38
- let V = e | ~(y | l), S = l & y;
39
- V >>> 31 ^ b && (c[o / 32 | 0] ^= 1 << o), S >>> 31 ^ k && (i[o / 32 | 0] ^= 1 << o), V = V << 1 | b, S = S << 1 | k, l = S | ~(q | V), e = V & q;
37
+ const v = _[a.charCodeAt(o)], O = i[o / 32 | 0] >>> o & 1, b = c[o / 32 | 0] >>> o & 1, q = v | e, I = ((v | b) & l) + l ^ l | v | b;
38
+ let E = e | ~(I | l), S = l & I;
39
+ E >>> 31 ^ O && (i[o / 32 | 0] ^= 1 << o), S >>> 31 ^ b && (c[o / 32 | 0] ^= 1 << o), E = E << 1 | O, S = S << 1 | b, l = S | ~(q | E), e = E & q;
40
40
  }
41
41
  for (let o = g; o < x; o++)
42
42
  _[t.charCodeAt(o)] = 0;
43
43
  }
44
- let d = 0, h = -1;
45
- const A = n * 32, O = Math.min(32, m - A) + A;
46
- for (let e = A; e < O; e++)
44
+ let f = 0, h = -1;
45
+ const y = n * 32, A = Math.min(32, d - y) + y;
46
+ for (let e = y; e < A; e++)
47
47
  _[t.charCodeAt(e)] |= 1 << e;
48
- let M = m;
48
+ let C = d;
49
49
  for (let e = 0; e < r; e++) {
50
- 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;
51
- let b = d | ~(v | h), k = h & v;
52
- M += b >>> m - 1 & 1, M -= k >>> m - 1 & 1, b >>> 31 ^ g && (c[e / 32 | 0] ^= 1 << e), k >>> 31 ^ x && (i[e / 32 | 0] ^= 1 << e), b = b << 1 | g, k = k << 1 | x, h = k | ~(o | b), d = b & o;
50
+ const l = _[a.charCodeAt(e)], g = i[e / 32 | 0] >>> e & 1, x = c[e / 32 | 0] >>> e & 1, o = l | f, v = ((l | x) & h) + h ^ h | l | x;
51
+ let O = f | ~(v | h), b = h & v;
52
+ C += O >>> d - 1 & 1, C -= b >>> d - 1 & 1, O >>> 31 ^ g && (i[e / 32 | 0] ^= 1 << e), b >>> 31 ^ x && (c[e / 32 | 0] ^= 1 << e), O = O << 1 | g, b = b << 1 | x, h = b | ~(o | O), f = O & o;
53
53
  }
54
- for (let e = A; e < O; e++)
54
+ for (let e = y; e < A; e++)
55
55
  _[t.charCodeAt(e)] = 0;
56
- return M;
57
- }, ee = (t, a) => {
56
+ return C;
57
+ }, ne = (t, a) => {
58
58
  if (t.length < a.length) {
59
59
  const r = a;
60
60
  a = t, t = r;
61
61
  }
62
- return a.length === 0 ? t.length : t.length <= 32 ? ve(t, a) : pe(t, a);
63
- }, ge = (t, a) => {
64
- let r = 1 / 0, m = 0;
65
- for (let i = 0; i < a.length; i++) {
66
- const c = ee(t, a[i]);
67
- c < r && (r = c, m = i);
62
+ return a.length === 0 ? t.length : t.length <= 32 ? xe(t, a) : be(t, a);
63
+ }, ke = (t, a) => {
64
+ let r = 1 / 0, d = 0;
65
+ for (let c = 0; c < a.length; c++) {
66
+ const i = ne(t, a[c]);
67
+ i < r && (r = i, d = c);
68
68
  }
69
- return a[m];
70
- }, xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
69
+ return a[d];
70
+ }, we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
71
71
  __proto__: null,
72
- closest: ge,
73
- distance: ee
74
- }, Symbol.toStringTag, { value: "Module" })), be = /* @__PURE__ */ ce(xe);
75
- var W;
76
- function ke() {
77
- return W || (W = 1, (function(t, a) {
72
+ closest: ke,
73
+ distance: ne
74
+ }, Symbol.toStringTag, { value: "Module" })), ye = /* @__PURE__ */ fe(we);
75
+ var ee;
76
+ function Ie() {
77
+ return ee || (ee = 1, (function(t, a) {
78
78
  (function() {
79
79
  var r;
80
80
  try {
@@ -82,7 +82,7 @@ function ke() {
82
82
  } catch {
83
83
  console.log("Collator could not be initialized and wouldn't be used");
84
84
  }
85
- var m = be, i = [], c = [], u = {
85
+ var d = ye, c = [], i = [], u = {
86
86
  /**
87
87
  * Calculate levenshtein distance of the two strings.
88
88
  *
@@ -92,82 +92,82 @@ function ke() {
92
92
  * @param [options.useCollator] Use `Intl.Collator` for locale-sensitive string comparison.
93
93
  * @return Integer the levenshtein distance (0 and above).
94
94
  */
95
- get: function(p, n, d) {
96
- var h = d && r && d.useCollator;
95
+ get: function(p, n, f) {
96
+ var h = f && r && f.useCollator;
97
97
  if (h) {
98
- var A = p.length, O = n.length;
99
- if (A === 0) return O;
100
- if (O === 0) return A;
101
- var M, e, l, g, x;
102
- for (l = 0; l < O; ++l)
103
- i[l] = l, c[l] = n.charCodeAt(l);
104
- i[O] = O;
98
+ var y = p.length, A = n.length;
99
+ if (y === 0) return A;
100
+ if (A === 0) return y;
101
+ var C, e, l, g, x;
102
+ for (l = 0; l < A; ++l)
103
+ c[l] = l, i[l] = n.charCodeAt(l);
104
+ c[A] = A;
105
105
  var o;
106
- for (l = 0; l < A; ++l) {
107
- for (e = l + 1, g = 0; g < O; ++g)
108
- 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;
109
- i[g] = e;
106
+ for (l = 0; l < y; ++l) {
107
+ for (e = l + 1, g = 0; g < A; ++g)
108
+ C = e, o = r.compare(p.charAt(l), String.fromCharCode(i[g])) === 0, e = c[g] + (o ? 0 : 1), x = C + 1, e > x && (e = x), x = c[g + 1] + 1, e > x && (e = x), c[g] = C;
109
+ c[g] = e;
110
110
  }
111
111
  return e;
112
112
  }
113
- return m.distance(p, n);
113
+ return d.distance(p, n);
114
114
  }
115
115
  };
116
116
  t !== null && t.exports === a ? t.exports = u : typeof self < "u" && typeof self.postMessage == "function" && typeof self.importScripts == "function" ? self.Levenshtein = u : typeof window < "u" && window !== null && (window.Levenshtein = u);
117
117
  })();
118
- })(R, R.exports)), R.exports;
118
+ })(T, T.exports)), T.exports;
119
119
  }
120
- var we = ke();
121
- const ye = /* @__PURE__ */ le(we);
122
- function te() {
120
+ var Ve = Ie();
121
+ const Ne = /* @__PURE__ */ de(Ve);
122
+ function oe() {
123
123
  const {
124
124
  value: t,
125
125
  setValue: a
126
- } = ue("isKeyboardNavigating");
127
- return Z(() => ({
126
+ } = me("isKeyboardNavigating");
127
+ return te(() => ({
128
128
  isKeyboardNavigating: t,
129
129
  setIsKeyboardNavigating: a
130
130
  }), [t, a]);
131
131
  }
132
- function $(t) {
132
+ function X(t) {
133
133
  return "text" in t ? t.text : t.label;
134
134
  }
135
- const X = "kakadu-components-1144794361", Y = "kakadu-components-2911184744";
136
- function Ie({
135
+ const Y = "kakadu-components-1144794361", G = "kakadu-components-2911184744";
136
+ function Ae({
137
137
  isSelected: t,
138
138
  id: a,
139
139
  value: r,
140
- label: m,
141
- onSelect: i,
142
- onHover: c
140
+ label: d,
141
+ onSelect: c,
142
+ onHover: i
143
143
  }) {
144
144
  const {
145
145
  isKeyboardNavigating: u
146
- } = te(), p = E(() => {
147
- i(r);
148
- }, [i, r]), n = E((h) => {
149
- u || h.movementX === 0 && h.movementY === 0 || c(r);
150
- }, [u, c, r]), d = T(null);
146
+ } = oe(), p = M(() => {
147
+ c(r);
148
+ }, [c, r]), n = M((h) => {
149
+ u || h.movementX === 0 && h.movementY === 0 || i(r);
150
+ }, [u, i, r]), f = H(null);
151
151
  return z(() => {
152
- const h = d.current;
152
+ const h = f.current;
153
153
  t && h && u && setTimeout(() => {
154
154
  h.scrollIntoView({
155
155
  behavior: "smooth",
156
156
  block: "nearest"
157
157
  });
158
158
  }, 0);
159
- }, [t, u]), /* @__PURE__ */ N.jsx("li", { ref: d, id: a, role: "option", "aria-selected": t, tabIndex: -1, className: P(X, "kakadu-components-4130497639", u ? "kakadu-components-962373561" : "kakadu-components-1109598791"), onClick: p, onMouseMove: n, children: /* @__PURE__ */ N.jsx(U, { className: P(Y, typeof m == "string" && "kakadu-components-154286052"), children: m }) });
159
+ }, [t, u]), /* @__PURE__ */ N.jsx("li", { ref: f, id: a, role: "option", "aria-selected": t, tabIndex: -1, className: U(Y, "kakadu-components-4130497639", u ? "kakadu-components-962373561" : "kakadu-components-1109598791"), onClick: p, onMouseMove: n, children: /* @__PURE__ */ N.jsx($, { className: U(G, typeof d == "string" && "kakadu-components-154286052"), children: d }) });
160
160
  }
161
- function Ne({
161
+ function Oe({
162
162
  isLoading: t,
163
163
  id: a,
164
164
  activeOptionId: r,
165
- selectedValue: m,
166
- options: i,
167
- onSelect: c,
165
+ selectedValue: d,
166
+ options: c,
167
+ onSelect: i,
168
168
  onHover: u
169
169
  }) {
170
- const p = T(null);
170
+ const p = H(null);
171
171
  return z(() => {
172
172
  const n = p.current;
173
173
  n && n.scrollIntoView({
@@ -175,85 +175,85 @@ function Ne({
175
175
  block: "nearest"
176
176
  });
177
177
  }, []), /* @__PURE__ */ N.jsxs("ul", { ref: p, id: a, role: "listbox", "aria-label": "Options", tabIndex: -1, className: "kakadu-components-1951042708", children: [
178
- i.length === 0 ? t ? null : /* @__PURE__ */ N.jsxs(Q, { "aria-atomic": !0, as: "li", role: "status", "aria-live": "polite", direction: "row", preset: "start", gap: 0.5, className: X, children: [
179
- /* @__PURE__ */ N.jsx(fe, { size: 15, type: "exclamationTriangle" }),
180
- /* @__PURE__ */ N.jsx(U, { className: Y, children: "No results." })
181
- ] }) : i.map((n, d) => /* @__PURE__ */ N.jsx(
182
- Ie,
178
+ c.length === 0 ? t ? null : /* @__PURE__ */ N.jsxs(Z, { "aria-atomic": !0, as: "li", role: "status", "aria-live": "polite", direction: "row", preset: "start", gap: 0.5, className: Y, children: [
179
+ /* @__PURE__ */ N.jsx(he, { size: 15, type: "exclamationTriangle" }),
180
+ /* @__PURE__ */ N.jsx($, { className: G, children: "No results." })
181
+ ] }) : c.map((n, f) => /* @__PURE__ */ N.jsx(
182
+ Ae,
183
183
  {
184
184
  ...n,
185
- id: n.value === m ? r : void 0,
186
- isSelected: n.value === m,
187
- onSelect: c,
185
+ id: n.value === d ? r : void 0,
186
+ isSelected: n.value === d,
187
+ onSelect: i,
188
188
  onHover: u
189
189
  },
190
- $(n) + d
190
+ X(n) + f
191
191
  )),
192
- t ? /* @__PURE__ */ N.jsx(Q, { as: "li", alignment: "center", className: X, children: /* @__PURE__ */ N.jsx(U, { className: Y, children: /* @__PURE__ */ N.jsx(he, { width: "100%", height: "1.3em" }) }) }) : null
192
+ t ? /* @__PURE__ */ N.jsx(Z, { as: "li", alignment: "center", className: Y, children: /* @__PURE__ */ N.jsx($, { className: G, children: /* @__PURE__ */ N.jsx(ge, { width: "100%", height: "1.3em" }) }) }) : null
193
193
  ] });
194
194
  }
195
- function Le({
195
+ function Ke({
196
196
  isLoading: t,
197
197
  label: a,
198
198
  options: r,
199
- error: m,
200
- warning: i,
201
- information: c,
199
+ error: d,
200
+ warning: c,
201
+ information: i,
202
202
  footnote: u,
203
203
  className: p,
204
204
  onChange: n,
205
- onSelect: d,
205
+ onSelect: f,
206
206
  ...h
207
207
  }) {
208
- const A = T(null), O = J(), M = J(), [e, l] = D(!1), g = E(() => {
208
+ const y = H(null), A = W(), C = W(), [e, l] = R(!1), g = M(() => {
209
209
  l(!0);
210
- }, []), x = E((s) => {
211
- var f;
212
- (f = A.current) != null && f.contains(s.relatedTarget) || l(!1);
213
- }, []), [o, v] = D(!1);
210
+ }, []), x = M((s) => {
211
+ var m;
212
+ (m = y.current) != null && m.contains(s.relatedTarget) || l(!1);
213
+ }, []), [o, v] = R(!1);
214
214
  z(() => {
215
215
  v(e);
216
216
  }, [e]);
217
- const [b, k] = D(""), {
217
+ const [O, b] = R(""), {
218
218
  value: q
219
- } = h, [y, V] = D(q), [S, ne] = D(q), G = T(S), I = E((s) => {
220
- ne(s), G.current = s;
219
+ } = h, [I, E] = R(q), [S, re] = R(q), J = H(S), V = M((s) => {
220
+ re(s), J.current = s;
221
221
  }, []);
222
222
  z(() => {
223
- V(q), I(q);
224
- }, [q, I]);
225
- const oe = E(() => {
226
- y && (k(""), I(void 0));
227
- }, [y, I]), re = E((s, f) => {
228
- k(s), n == null || n(s, f), v(!0), V(void 0);
229
- }, [n]), se = E((s) => {
230
- var f;
231
- (f = A.current) != null && f.contains(s.target) && v(!0);
232
- }, []), L = E((s) => {
233
- const f = s == null ? void 0 : s.value;
234
- I(f), s ? k($(s)) : (k(""), n == null || n("")), d == null || d(f);
235
- }, [I, n, d]), ae = E((s) => {
236
- const f = r.find((w) => w.value === s);
237
- L(f), V(s), v(!1);
238
- }, [r, L]), ie = E((s) => {
239
- I(s);
240
- }, [I]), j = Z(() => y || b.length === 0 ? r : r.filter((s) => {
241
- const w = $(s).toLowerCase(), F = b.toLowerCase();
242
- return !!(w.includes(F) || F.includes(w) || ye.get(w, F, {
223
+ E(q), V(q);
224
+ }, [q, V]);
225
+ const se = M(() => {
226
+ I && (b(""), V(void 0));
227
+ }, [I, V]), ae = M((s, m) => {
228
+ b(s), n == null || n(s, m), v(!0), E(void 0);
229
+ }, [n]), ce = M((s) => {
230
+ var m;
231
+ (m = y.current) != null && m.contains(s.target) && v(!0);
232
+ }, []), L = M((s) => {
233
+ const m = s == null ? void 0 : s.value;
234
+ V(m), s ? b(X(s)) : (b(""), n == null || n("")), f == null || f(m);
235
+ }, [V, n, f]), ie = M((s) => {
236
+ const m = r.find((k) => k.value === s);
237
+ L(m), E(s), v(!1);
238
+ }, [r, L]), le = M((s) => {
239
+ V(s);
240
+ }, [V]), K = ue(O), j = te(() => I || K.length === 0 ? r : r.filter((s) => {
241
+ const k = X(s).toLowerCase(), F = K.toLowerCase();
242
+ return !!(k.includes(F) || F.includes(k) || Ne.get(k, F, {
243
243
  useCollator: !0
244
244
  }) <= 2);
245
- }), [y, r, b]);
245
+ }), [I, r, K]);
246
246
  z(() => {
247
- !y && b.length > 0 && j.length > 0 && !j.some((s) => S === s.value) && I(j[0].value);
248
- }, [y, b, j, S, I]);
247
+ !I && K.length > 0 && j.length > 0 && !j.some((s) => S === s.value) && V(j[0].value);
248
+ }, [I, K, j, S, V]);
249
249
  const {
250
250
  setIsKeyboardNavigating: B
251
- } = te();
251
+ } = oe();
252
252
  return z(() => {
253
253
  if (!e)
254
254
  return;
255
- const s = (f) => {
256
- f.movementX === 0 && f.movementY === 0 || B(!1);
255
+ const s = (m) => {
256
+ m.movementX === 0 && m.movementY === 0 || B(!1);
257
257
  };
258
258
  return window.addEventListener("mousemove", s, {
259
259
  capture: !0
@@ -265,45 +265,54 @@ function Le({
265
265
  }, [e, B]), z(() => {
266
266
  if (!e)
267
267
  return;
268
- const s = (f) => {
269
- let w;
270
- const F = j.length, H = j.findIndex((C) => C.value === G.current), K = () => {
271
- f.preventDefault(), f.stopPropagation(), f.stopImmediatePropagation();
268
+ const s = (m) => {
269
+ var Q;
270
+ let k;
271
+ const F = j.length, P = j.findIndex((w) => w.value === J.current), D = () => {
272
+ m.preventDefault(), m.stopPropagation(), m.stopImmediatePropagation();
272
273
  };
273
- switch (f.key) {
274
+ switch (m.key) {
274
275
  case "Enter": {
275
- const C = j[H];
276
- C && (K(), B(!0), v(!1), L(C), V(C.value));
276
+ const w = j[P];
277
+ w && (D(), B(!0), v(!1), L(w), E(w.value));
277
278
  break;
278
279
  }
279
280
  case "Escape": {
280
- 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());
281
+ if (o)
282
+ D(), I ? V(void 0) : L(void 0), v(!1);
283
+ else if (I)
284
+ D(), v(!0), L(void 0);
285
+ else {
286
+ D(), l(!1);
287
+ const w = document.activeElement;
288
+ w instanceof HTMLElement && ((Q = y.current) != null && Q.contains(w)) && w.blur();
289
+ }
281
290
  return;
282
291
  }
283
292
  case "ArrowDown": {
284
- w = H + 1, v(!0);
293
+ k = P + 1, v(!0);
285
294
  break;
286
295
  }
287
296
  case "ArrowUp": {
288
- w = H - 1, v(!0), w < 0 && (w = F - 1);
297
+ k = P - 1, v(!0), k < 0 && (k = F - 1);
289
298
  break;
290
299
  }
291
300
  case "Home": {
292
- v(!0), w = 0;
301
+ v(!0), k = 0;
293
302
  break;
294
303
  }
295
304
  case "End": {
296
- v(!0), w = F - 1;
305
+ v(!0), k = F - 1;
297
306
  break;
298
307
  }
299
308
  case "Backspace": {
300
- j.some((C) => C.value === y) && (K(), L(void 0), v(!0));
309
+ j.some((w) => w.value === I) && (D(), L(void 0), v(!0));
301
310
  break;
302
311
  }
303
312
  }
304
- if (w !== void 0 && (K(), B(!0), F > 0)) {
305
- const C = j[w % F];
306
- C && I(C.value);
313
+ if (k !== void 0 && (D(), B(!0), F > 0)) {
314
+ const w = j[k % F];
315
+ w && V(w.value);
307
316
  }
308
317
  };
309
318
  return window.addEventListener("keydown", s, {
@@ -313,9 +322,9 @@ function Le({
313
322
  capture: !0
314
323
  });
315
324
  };
316
- }, [e, j, B, v, L, V, o, y, I]), /* @__PURE__ */ N.jsx(me, { ...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__ */ N.jsx(Ne, { isLoading: t, id: O, activeOptionId: M, selectedValue: S, options: j, onSelect: ae, onHover: ie }) : null, className: P(p, "kakadu-components-879486679"), onMouseDown: se, onChange: re, onBeforeInput: oe, onFocus: g, onBlur: x, children: /* @__PURE__ */ N.jsx(de, { width: 14, height: 14, className: "kakadu-components-158931186" }) });
325
+ }, [e, j, B, v, L, E, o, I, V]), /* @__PURE__ */ N.jsx(pe, { ...h, ref: y, role: "combobox", autoComplete: "off", "aria-controls": A, "aria-expanded": o, "aria-activedescendant": o ? C : void 0, label: a, value: O, error: d, warning: c, information: i, footnote: u, attachments: o ? /* @__PURE__ */ N.jsx(Oe, { isLoading: t, id: A, activeOptionId: C, selectedValue: S, options: j, onSelect: ie, onHover: le }) : null, className: U(p, "kakadu-components-879486679"), onMouseDown: ce, onChange: ae, onBeforeInput: se, onFocus: g, onBlur: x, children: /* @__PURE__ */ N.jsx(ve, { width: 14, height: 14, className: "kakadu-components-158931186" }) });
317
326
  }
318
327
  export {
319
- Le as default,
320
- $ as getComboboxOptionString
328
+ Ke as default,
329
+ X as getComboboxOptionString
321
330
  };
@@ -3,6 +3,7 @@ export declare const flexDirections: readonly ["row", "column"];
3
3
  export type FlexDirection = (typeof flexDirections)[number];
4
4
  export declare const flexPresets: readonly ["start", "center", "space-between", "end"];
5
5
  export type FlexPreset = (typeof flexPresets)[number];
6
+ type FlexGap = 0 | 0.25 | 0.375 | 0.5 | 0.75 | 1 | 1.5 | 2 | 2.25 | 3 | 4;
6
7
  export type FlexProperties<Type extends AtomElementType = DefaultAtomElementType> = AtomProperties<Type> & {
7
8
  readonly direction?: FlexDirection;
8
9
  readonly preset?: FlexPreset;
@@ -12,8 +13,10 @@ export type FlexProperties<Type extends AtomElementType = DefaultAtomElementType
12
13
  /** How items are laid out across the cross axis.
13
14
  * @see direction */
14
15
  readonly alignment?: string;
15
- readonly gap?: 0 | 0.25 | 0.375 | 0.5 | 0.75 | 1 | 1.5 | 2 | 2.25 | 3 | 4;
16
+ /** The gap between items. Single value or [row-gap, column-gap]. */
17
+ readonly gap?: FlexGap | [FlexGap, FlexGap];
16
18
  readonly wrap?: boolean;
17
19
  readonly fill?: boolean;
18
20
  };
19
21
  export default function Flex<Type extends AtomElementType = DefaultAtomElementType>({ as, direction, preset, distribution, alignment, gap, wrap, fill, style: inputStyle, className, ...properties }: FlexProperties<Type>): import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../jsx-runtime-BB_1_6y_.js"),f=require("react"),p=require("@kuma-ui/core"),a=require("./atom.js"),x=["row","column"],q=["start","center","space-between","end"];function b({as:c,direction:u="column",preset:n,distribution:o,alignment:t,gap:e=1,wrap:k=!1,fill:m=!1,style:s,className:d,...r}){const l=f.useMemo(()=>({...s,"--distribution":o,"--alignment":t}),[s,o,t]);return i.jsxRuntimeExports.jsx(a.default,{as:c??a.defaultAtomElementType,...r,style:l,className:p.cx("kakadu-components-702604737",u==="column"&&"kakadu-components-1920578034",n==="start"&&"kakadu-components-2628985316",n==="center"&&"kakadu-components-9661990",n==="space-between"&&"kakadu-components-1323551558",n==="end"&&"kakadu-components-1950514053",e===.25&&"kakadu-components-2276234075",e===.375&&"kakadu-components-739568937",e===.5&&"kakadu-components-3438335458",e===.75&&"kakadu-components-3350948469",e===1&&"kakadu-components-3993051137",e===1.5&&"kakadu-components-4186556816",e===2&&"kakadu-components-1435205015",e===2.25&&"kakadu-components-4251546321",e===3&&"kakadu-components-1168734547",e===4&&"kakadu-components-1543861259",k&&"kakadu-components-3545808562",m&&"kakadu-components-3911899222",d)})}exports.default=b;exports.flexDirections=x;exports.flexPresets=q;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("../jsx-runtime-BB_1_6y_.js"),l=require("react"),x=require("@kuma-ui/core"),m=require("./atom.js"),q=["row","column"],w=["start","center","space-between","end"];function r(t){switch(t){case 0:return"0";case .25:return"var(--quarter-gap)";case .375:return"var(--third-gap)";case .5:return"var(--half-gap)";case .75:return"calc(var(--gap) * 0.75)";case 1:return"var(--gap)";case 1.5:return"var(--sesquialteral-gap)";case 2:return"var(--double-gap)";case 2.25:return"calc(var(--gap) * 2.25)";case 3:return"var(--triple-gap)";case 4:return"var(--quadruple-gap)"}}function b({as:t,direction:p="column",preset:a,distribution:n,alignment:s,gap:e=1,wrap:i=!1,fill:d=!1,style:c,className:k,...f}){const[o,u]=l.useMemo(()=>Array.isArray(e)?[r(e[0]),r(e[1])]:[r(e),r(e)],[e]),v=l.useMemo(()=>({...c,"--distribution":n,"--alignment":s,"--row-gap":o,"--column-gap":u}),[c,n,s,o,u]);return g.jsxRuntimeExports.jsx(m.default,{as:t??m.defaultAtomElementType,...f,style:v,className:x.cx("kakadu-components-3023337962",p==="column"&&"kakadu-components-1920578034",a==="start"&&"kakadu-components-2628985316",a==="center"&&"kakadu-components-9661990",a==="space-between"&&"kakadu-components-1323551558",a==="end"&&"kakadu-components-1950514053",i&&"kakadu-components-3545808562",d&&"kakadu-components-3911899222",k)})}exports.default=b;exports.flexDirections=q;exports.flexPresets=w;