@kakadu/components 6.10.0 → 6.11.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.
- package/build/components/aria-text.js +1 -1
- package/build/components/aria-text.mjs +1 -1
- package/build/components/box.js +1 -1
- package/build/components/box.mjs +1 -1
- package/build/components/button-tooltip.js +1 -1
- package/build/components/button-tooltip.mjs +1 -1
- package/build/components/button.js +1 -1
- package/build/components/button.mjs +60 -60
- package/build/components/card.js +1 -1
- package/build/components/card.mjs +1 -1
- package/build/components/checkbox.js +1 -1
- package/build/components/checkbox.mjs +1 -1
- package/build/components/click-ripples.js +1 -1
- package/build/components/click-ripples.mjs +1 -1
- package/build/components/code.d.ts +8 -0
- package/build/components/code.js +5 -0
- package/build/components/code.mjs +5712 -0
- package/build/components/collapsible.js +1 -1
- package/build/components/collapsible.mjs +1 -1
- package/build/components/combobox.js +1 -1
- package/build/components/combobox.mjs +90 -79
- package/build/components/copy-icon-button.js +1 -1
- package/build/components/copy-icon-button.mjs +1 -1
- package/build/components/datum.js +1 -1
- package/build/components/datum.mjs +1 -1
- package/build/components/decorators.js +1 -1
- package/build/components/decorators.mjs +1 -1
- package/build/components/dot.js +1 -1
- package/build/components/dot.mjs +1 -1
- package/build/components/flags.js +1 -1
- package/build/components/flags.mjs +1 -1
- package/build/components/flex.js +1 -1
- package/build/components/flex.mjs +1 -1
- package/build/components/footer.js +1 -1
- package/build/components/footer.mjs +1 -1
- package/build/components/gauge.js +1 -1
- package/build/components/gauge.mjs +1 -1
- package/build/components/header.js +1 -1
- package/build/components/header.mjs +1 -1
- package/build/components/hover-gradient.js +1 -1
- package/build/components/hover-gradient.mjs +1 -1
- package/build/components/icon-button.js +1 -1
- package/build/components/icon-button.mjs +2 -2
- package/build/components/input.js +1 -1
- package/build/components/input.mjs +1 -1
- package/build/components/logos/akt-logo.js +1 -1
- package/build/components/logos/akt-logo.mjs +1 -1
- package/build/components/logos/amedia-logo.js +1 -1
- package/build/components/logos/amedia-logo.mjs +1 -1
- package/build/components/logos/bankaxept-logo.js +1 -1
- package/build/components/logos/bankaxept-logo.mjs +1 -1
- package/build/components/logos/bankid-logo.js +1 -1
- package/build/components/logos/bankid-logo.mjs +1 -1
- package/build/components/logos/dnb-logo.js +1 -1
- package/build/components/logos/dnb-logo.mjs +1 -1
- package/build/components/logos/entur-logo.js +1 -1
- package/build/components/logos/entur-logo.mjs +1 -1
- package/build/components/logos/gjensidige-logo.js +1 -1
- package/build/components/logos/gjensidige-logo.mjs +1 -1
- package/build/components/logos/kakadu-academy-logo.js +1 -1
- package/build/components/logos/kakadu-academy-logo.mjs +1 -1
- package/build/components/logos/kakadu-guide-icon.js +1 -1
- package/build/components/logos/kakadu-guide-icon.mjs +1 -1
- package/build/components/logos/kakadu-guide-logo.js +1 -1
- package/build/components/logos/kakadu-guide-logo.mjs +1 -1
- package/build/components/logos/kakadu-index-logo.js +1 -1
- package/build/components/logos/kakadu-index-logo.mjs +1 -1
- package/build/components/logos/kakadu-logo.js +1 -1
- package/build/components/logos/kakadu-logo.mjs +1 -1
- package/build/components/logos/kakadu-play-logo.js +1 -1
- package/build/components/logos/kakadu-play-logo.mjs +1 -1
- package/build/components/logos/kolumbus-logo.js +1 -1
- package/build/components/logos/kolumbus-logo.mjs +1 -1
- package/build/components/logos/nordea-logo.js +1 -1
- package/build/components/logos/nordea-logo.mjs +1 -1
- package/build/components/logos/norsk-tipping-logo.js +1 -1
- package/build/components/logos/norsk-tipping-logo.mjs +1 -1
- package/build/components/logos/ruter-logo.js +1 -1
- package/build/components/logos/ruter-logo.mjs +1 -1
- package/build/components/logos/senteret-for-et-aldersvennlig-norge-logo.js +1 -1
- package/build/components/logos/senteret-for-et-aldersvennlig-norge-logo.mjs +1 -1
- package/build/components/logos/sparebank1-logo.js +1 -1
- package/build/components/logos/sparebank1-logo.mjs +1 -1
- package/build/components/logos/sparebanken-norge-logo.js +1 -1
- package/build/components/logos/sparebanken-norge-logo.mjs +1 -1
- package/build/components/logos/sto-logo.js +1 -1
- package/build/components/logos/sto-logo.mjs +1 -1
- package/build/components/logos/storebrand-logo.js +1 -1
- package/build/components/logos/storebrand-logo.mjs +1 -1
- package/build/components/modal.js +1 -1
- package/build/components/modal.mjs +2 -2
- package/build/components/moving-gradients.js +1 -1
- package/build/components/moving-gradients.mjs +1 -1
- package/build/components/moving-stars.js +1 -1
- package/build/components/moving-stars.mjs +1 -1
- package/build/components/notice.js +1 -1
- package/build/components/notice.mjs +1 -1
- package/build/components/notification.js +1 -1
- package/build/components/notification.mjs +1 -1
- package/build/components/popover-menu.js +1 -1
- package/build/components/popover-menu.mjs +1 -1
- package/build/components/popover.js +1 -1
- package/build/components/popover.mjs +2 -2
- package/build/components/revealer.js +1 -1
- package/build/components/revealer.mjs +1 -1
- package/build/components/select.js +1 -1
- package/build/components/select.mjs +1 -1
- package/build/components/separator.js +1 -1
- package/build/components/separator.mjs +1 -1
- package/build/components/skeleton.js +1 -1
- package/build/components/skeleton.mjs +1 -1
- package/build/components/spinner.js +1 -1
- package/build/components/spinner.mjs +1 -1
- package/build/components/text-button.js +1 -1
- package/build/components/text-button.mjs +1 -1
- package/build/components/text.js +1 -1
- package/build/components/text.mjs +2 -2
- package/build/components/theme-setter.js +1 -1
- package/build/components/theme-setter.mjs +1 -1
- package/build/components/veil.js +1 -1
- package/build/components/veil.mjs +1 -1
- package/build/components/wrapper.js +1 -1
- package/build/components/wrapper.mjs +1 -1
- package/build/components.css +1 -1
- package/build/{focus-trap-react-B7f3iC5h.js → focus-trap-react-D0ZxGVUk.js} +3 -3
- package/build/{focus-trap-react-Dr3BYLw6.mjs → focus-trap-react-D4ushEjf.mjs} +86 -85
- package/build/hooks/use-fetch.d.ts +3 -3
- package/build/hooks/use-fetch.js +1 -1
- package/build/hooks/use-fetch.mjs +77 -75
- package/build/icons/anchor-down.js +1 -1
- package/build/icons/anchor-down.mjs +1 -1
- package/build/icons/anchor-up.js +1 -1
- package/build/icons/anchor-up.mjs +1 -1
- package/build/icons/arrow-down.js +1 -1
- package/build/icons/arrow-down.mjs +1 -1
- package/build/icons/arrow-left.js +1 -1
- package/build/icons/arrow-left.mjs +1 -1
- package/build/icons/arrow-right.js +1 -1
- package/build/icons/arrow-right.mjs +1 -1
- package/build/icons/arrow-up.js +1 -1
- package/build/icons/arrow-up.mjs +1 -1
- package/build/icons/caret-down.js +1 -1
- package/build/icons/caret-down.mjs +1 -1
- package/build/icons/caret-left.js +1 -1
- package/build/icons/caret-left.mjs +1 -1
- package/build/icons/caret-right.js +1 -1
- package/build/icons/caret-right.mjs +1 -1
- package/build/icons/caret-up.js +1 -1
- package/build/icons/caret-up.mjs +1 -1
- package/build/icons/check.js +1 -1
- package/build/icons/check.mjs +1 -1
- package/build/icons/chevron-down.js +1 -1
- package/build/icons/chevron-down.mjs +1 -1
- package/build/icons/chevron-left.js +1 -1
- package/build/icons/chevron-left.mjs +1 -1
- package/build/icons/chevron-right.js +1 -1
- package/build/icons/chevron-right.mjs +1 -1
- package/build/icons/chevron-up.js +1 -1
- package/build/icons/chevron-up.mjs +1 -1
- package/build/icons/chrome-browser-logo.js +1 -1
- package/build/icons/chrome-browser-logo.mjs +1 -1
- package/build/icons/cog.js +1 -1
- package/build/icons/cog.mjs +1 -1
- package/build/icons/copy.js +1 -1
- package/build/icons/copy.mjs +1 -1
- package/build/icons/document.js +1 -1
- package/build/icons/document.mjs +1 -1
- package/build/icons/dots.js +1 -1
- package/build/icons/dots.mjs +1 -1
- package/build/icons/drag.js +1 -1
- package/build/icons/drag.mjs +1 -1
- package/build/icons/edge-browser-logo.js +1 -1
- package/build/icons/edge-browser-logo.mjs +1 -1
- package/build/icons/edit.js +1 -1
- package/build/icons/edit.mjs +1 -1
- package/build/icons/exclamation-triangle.js +1 -1
- package/build/icons/exclamation-triangle.mjs +1 -1
- package/build/icons/external.js +1 -1
- package/build/icons/external.mjs +1 -1
- package/build/icons/eye.js +1 -1
- package/build/icons/eye.mjs +1 -1
- package/build/icons/icon.js +1 -1
- package/build/icons/icon.mjs +1 -1
- package/build/icons/information.js +1 -1
- package/build/icons/information.mjs +1 -1
- package/build/icons/kakadu-guide-glyph.js +1 -1
- package/build/icons/kakadu-guide-glyph.mjs +1 -1
- package/build/icons/kakadu-guide-icon.js +1 -1
- package/build/icons/kakadu-guide-icon.mjs +1 -1
- package/build/icons/menu.js +1 -1
- package/build/icons/menu.mjs +1 -1
- package/build/icons/package.js +1 -1
- package/build/icons/package.mjs +1 -1
- package/build/icons/plus.js +1 -1
- package/build/icons/plus.mjs +1 -1
- package/build/icons/reload.js +1 -1
- package/build/icons/reload.mjs +1 -1
- package/build/icons/select.js +1 -1
- package/build/icons/select.mjs +1 -1
- package/build/icons/share.js +1 -1
- package/build/icons/share.mjs +1 -1
- package/build/icons/sparkle.js +1 -1
- package/build/icons/sparkle.mjs +1 -1
- package/build/icons/test.js +1 -1
- package/build/icons/test.mjs +1 -1
- package/build/icons/thumbs-down.js +1 -1
- package/build/icons/thumbs-down.mjs +1 -1
- package/build/icons/thumbs-up.js +1 -1
- package/build/icons/thumbs-up.mjs +1 -1
- package/build/icons/times.js +1 -1
- package/build/icons/times.mjs +1 -1
- package/build/icons/trash.js +1 -1
- package/build/icons/trash.mjs +1 -1
- package/build/icons/trend-up.js +1 -1
- package/build/icons/trend-up.mjs +1 -1
- package/build/index.d.ts +2 -0
- package/build/index.js +1 -1
- package/build/index.mjs +242 -239
- package/build/jsx-runtime-CZa898vN.js +22 -0
- package/build/{jsx-runtime-B4hRZ52C.mjs → jsx-runtime-z6PQ6F3d.mjs} +111 -97
- package/build/theme.js +1 -1
- package/build/theme.mjs +1 -1
- package/package.json +22 -21
- package/build/jsx-runtime-BB_1_6y_.js +0 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../jsx-runtime-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../jsx-runtime-CZa898vN.js"),u=require("react"),j=require("@kuma-ui/core"),k=require("./atom.js");function q({as:m,isCollapsed:e=!0,transitionDuration:n=.37,children:r,className:f,...l}){const c=u.useRef(null),[d,a]=u.useState(),[s,o]=u.useState(!!r);return u.useEffect(()=>{r&&o(!0)},[r]),u.useEffect(()=>{if(e){if(a(0),s){let t;const x=setTimeout(()=>{t=requestAnimationFrame(()=>{o(!1)})},n*1e3);return()=>{clearTimeout(x),cancelAnimationFrame(t)}}}else if(s){const t=c.current;t&&a(t.scrollHeight??0)}else o(!0)},[e,s,n]),s?i.jsxRuntimeExports.jsx(k.default,{as:m??"div",...l,"aria-hidden":e,style:{height:d,opacity:e?0:1,"--transition-duration":`${n}s`},className:j.cx("kakadu-components-2460436620",e&&"kakadu-components-512418581",f),children:i.jsxRuntimeExports.jsx("div",{ref:c,className:"kakadu-components-3857562328",children:r})}):null}exports.default=q;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("../jsx-runtime-CZa898vN.js"),e=require("react"),_=require("@kuma-ui/core"),se=require("../hooks/use-synchronized-value.js"),ne=require("../icons/icon.js"),re=require("../icons/chevron-up.js"),oe=require("../utilities/search.js"),Y=require("../utilities/listeners.js"),ae=require("./input.js"),T=require("./text.js"),X=require("./flex.js"),ce=require("./skeleton.js"),ue=Y.default(n=>{window.addEventListener("mousemove",n,{capture:!0})},n=>{window.removeEventListener("mousemove",n,{capture:!0})}),ie=Y.default(n=>{window.addEventListener("keydown",n,{capture:!0})},n=>{window.removeEventListener("keydown",n,{capture:!0})});function F(){const{value:n,setValue:d}=se.default("isKeyboardNavigating");return e.useMemo(()=>({isKeyboardNavigating:n,setIsKeyboardNavigating:d}),[n,d])}function q(n){return"text"in n?n.text:n.label}const B="kakadu-components-1144794361",D="kakadu-components-2911184744";function le({ref:n,isSelected:d,id:V,value:o,label:k,onSelect:j,onHover:w}){const{isKeyboardNavigating:m}=F(),I=e.useCallback(()=>{j(o)},[j,o]),u=e.useCallback(r=>{m||r.movementX===0&&r.movementY===0||w(o)},[m,w,o]),b=e.useRef(null);e.useEffect(()=>{const r=b.current;d&&r&&m&&setTimeout(()=>{r.scrollIntoView({behavior:"smooth",block:"nearest"})},0)},[d,m]);const a=e.useCallback(r=>{b.current=r,n&&(n.current=r)},[n]);return f.jsxRuntimeExports.jsx("li",{ref:a,id:V,role:"option","aria-selected":d,tabIndex:-1,className:_.cx(B,"kakadu-components-4130497639",m?"kakadu-components-962373561":"kakadu-components-1109598791"),onClick:I,onMouseMove:u,children:f.jsxRuntimeExports.jsx(T.Span,{className:_.cx(D,typeof k=="string"&&"kakadu-components-154286052"),children:k})})}function fe({isLoading:n,id:d,activeOptionId:V,selectedValue:o,options:k,onSelect:j,onHover:w}){const m=e.useRef(null);e.useEffect(()=>{const a=m.current;a&&a.scrollIntoView({behavior:"smooth",block:"nearest"})},[]);const I=e.useRef(null),{isKeyboardNavigating:u}=F(),b=e.useRef(u);return b.current=u,e.useLayoutEffect(()=>{const a=m.current;if(a&&k.length>0){if(b.current){const r=I.current;if(r){r.scrollIntoView({block:"nearest"});return}}a.scrollTo({top:0})}},[k]),f.jsxRuntimeExports.jsxs("ul",{ref:m,id:d,role:"listbox","aria-label":"Options",tabIndex:-1,className:"kakadu-components-3718330689",children:[k.length===0?n?null:f.jsxRuntimeExports.jsxs(X.default,{"aria-atomic":!0,as:"li",role:"status","aria-live":"polite",direction:"row",preset:"start",gap:.5,className:B,children:[f.jsxRuntimeExports.jsx(ne.default,{size:15,type:"exclamationTriangle"}),f.jsxRuntimeExports.jsx(T.Span,{className:D,children:"No results."})]}):k.map((a,r)=>f.jsxRuntimeExports.jsx(le,{...a,ref:a.value===o?I:void 0,id:a.value===o?V:void 0,isSelected:a.value===o,onSelect:j,onHover:w},q(a)+r)),n?f.jsxRuntimeExports.jsx(X.default,{as:"li",alignment:"center",className:B,children:f.jsxRuntimeExports.jsx(T.Span,{className:_.cx(D,"kakadu-components-2015848015"),children:f.jsxRuntimeExports.jsx(ce.SkeletonInstance,{width:"100%",height:"1.3em"})})}):null]})}function de({isLoading:n,shouldFilterOptions:d=!0,label:V,options:o,error:k,warning:j,information:w,footnote:m,className:I,onChange:u,onSelect:b,...a}){const r=e.useRef(null),H=e.useId(),P=e.useId(),[R,K]=e.useState(!1),$=e.useCallback(()=>{K(!0)},[]),G=e.useCallback(t=>{var s;(s=r.current)!=null&&s.contains(t.relatedTarget)||K(!1)},[]),[E,i]=e.useState(!1);e.useEffect(()=>{i(R)},[R]),e.useEffect(()=>{var s;if(!E)return;const t=(s=r.current)==null?void 0:s.control;return()=>{t==null||t.scrollIntoView({behavior:"smooth",block:"nearest"})}},[E]);const[A,y]=e.useState(""),{value:p}=a,[v,O]=e.useState(p),[C,J]=e.useState(p),z=e.useRef(C),l=e.useCallback(t=>{J(t),z.current=t},[]);e.useEffect(()=>{O(p),l(p)},[p,l]),e.useEffect(()=>{if(p===void 0)return;const t=o.find(s=>s.value===p);t&&y(q(t))},[o,p]),e.useEffect(()=>{p===void 0&&y("")},[p]);const Q=e.useCallback(()=>{v&&(y(""),l(void 0))},[v,l]),W=e.useCallback((t,s)=>{y(t),u==null||u(t,s),i(!0),O(void 0)},[u]),Z=e.useCallback(t=>{var s;(s=r.current)!=null&&s.contains(t.target)&&i(!0)},[]),g=e.useCallback(t=>{const s=t==null?void 0:t.value;l(s),t?y(q(t)):(y(""),u==null||u("")),b==null||b(s)},[l,u,b]),ee=e.useCallback(t=>{const s=o.find(N=>N.value===t);g(s),O(t),i(!1)},[o,g]),te=e.useCallback(t=>{l(t)},[l]),M=e.useDeferredValue(A),x=e.useMemo(()=>!d||v?o:oe.default(M,o,q),[d,v,o,M]);e.useEffect(()=>{!v&&M.length>0&&x.length>0&&!x.some(t=>C===t.value)&&l(x[0].value)},[v,M,x,C,l]);const{setIsKeyboardNavigating:S}=F();return e.useEffect(()=>{if(R)return ue(t=>{t.movementX===0&&t.movementY===0||S(!1)})},[R,S]),e.useEffect(()=>{if(R)return ie(t=>{var U;let s;const N=x.length,L=x.findIndex(c=>c.value===z.current),h=()=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()};switch(t.key){case"Enter":{const c=x[L];c&&(h(),S(!0),i(!1),g(c),O(c.value));break}case"Escape":{if(E)h(),v?l(void 0):g(void 0),i(!1);else if(v)h(),i(!0),g(void 0);else{h(),K(!1);const c=document.activeElement;c instanceof HTMLElement&&((U=r.current)!=null&&U.contains(c))&&c.blur()}return}case"ArrowDown":{h(),E&&(s=L+1),i(!0);break}case"ArrowUp":{h(),E&&(s=L-1,s<0&&(s=N-1)),i(!0);break}case"Home":{i(!0),s=0;break}case"End":{i(!0),s=N-1;break}case"Backspace":{x.some(c=>c.value===v)&&(h(),g(void 0),i(!0));break}}if(s!==void 0&&(h(),S(!0),N>0)){const c=x[s%N];c&&l(c.value)}})},[R,x,S,i,g,O,E,v,l]),f.jsxRuntimeExports.jsx(ae.default,{...a,ref:r,role:"combobox",autoComplete:"off","aria-controls":H,"aria-expanded":E,"aria-activedescendant":E?P:void 0,label:V,value:A,error:k,warning:j,information:w,footnote:m,attachments:E?f.jsxRuntimeExports.jsx(fe,{isLoading:n,id:H,activeOptionId:P,selectedValue:C,options:x,onSelect:ee,onHover:te}):null,className:_.cx(I,"kakadu-components-1230689972"),onMouseDown:Z,onChange:W,onBeforeInput:Q,onFocus:$,onBlur:G,children:f.jsxRuntimeExports.jsx(re.default,{width:14,height:14,className:"kakadu-components-158931186"})})}exports.default=de;exports.getComboboxOptionString=q;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as l } from "../jsx-runtime-
|
|
2
|
-
import { useRef as L, useId as Q, useState as S, useCallback as d, useEffect as
|
|
1
|
+
import { j as l } from "../jsx-runtime-z6PQ6F3d.mjs";
|
|
2
|
+
import { useRef as L, useId as Q, useState as S, useCallback as d, useEffect as x, useDeferredValue as ce, useMemo as Z, useLayoutEffect as ie } from "react";
|
|
3
3
|
import { cx as T } from "@kuma-ui/core";
|
|
4
4
|
import ue from "../hooks/use-synchronized-value.mjs";
|
|
5
5
|
import le from "../icons/icon.mjs";
|
|
@@ -10,43 +10,43 @@ import fe from "./input.mjs";
|
|
|
10
10
|
import { Span as P } from "./text.mjs";
|
|
11
11
|
import W from "./flex.mjs";
|
|
12
12
|
import { SkeletonInstance as ve } from "./skeleton.mjs";
|
|
13
|
-
const pe = _((
|
|
14
|
-
window.addEventListener("mousemove",
|
|
13
|
+
const pe = _((r) => {
|
|
14
|
+
window.addEventListener("mousemove", r, {
|
|
15
15
|
capture: !0
|
|
16
16
|
});
|
|
17
|
-
}, (
|
|
18
|
-
window.removeEventListener("mousemove",
|
|
17
|
+
}, (r) => {
|
|
18
|
+
window.removeEventListener("mousemove", r, {
|
|
19
19
|
capture: !0
|
|
20
20
|
});
|
|
21
|
-
}), be = _((
|
|
22
|
-
window.addEventListener("keydown",
|
|
21
|
+
}), be = _((r) => {
|
|
22
|
+
window.addEventListener("keydown", r, {
|
|
23
23
|
capture: !0
|
|
24
24
|
});
|
|
25
|
-
}, (
|
|
26
|
-
window.removeEventListener("keydown",
|
|
25
|
+
}, (r) => {
|
|
26
|
+
window.removeEventListener("keydown", r, {
|
|
27
27
|
capture: !0
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
function X() {
|
|
31
31
|
const {
|
|
32
|
-
value:
|
|
32
|
+
value: r,
|
|
33
33
|
setValue: m
|
|
34
34
|
} = ue("isKeyboardNavigating");
|
|
35
35
|
return Z(() => ({
|
|
36
|
-
isKeyboardNavigating:
|
|
36
|
+
isKeyboardNavigating: r,
|
|
37
37
|
setIsKeyboardNavigating: m
|
|
38
|
-
}), [
|
|
38
|
+
}), [r, m]);
|
|
39
39
|
}
|
|
40
|
-
function F(
|
|
41
|
-
return "text" in
|
|
40
|
+
function F(r) {
|
|
41
|
+
return "text" in r ? r.text : r.label;
|
|
42
42
|
}
|
|
43
43
|
const z = "kakadu-components-1144794361", U = "kakadu-components-2911184744";
|
|
44
44
|
function ke({
|
|
45
|
-
ref:
|
|
45
|
+
ref: r,
|
|
46
46
|
isSelected: m,
|
|
47
47
|
id: K,
|
|
48
48
|
value: o,
|
|
49
|
-
label:
|
|
49
|
+
label: h,
|
|
50
50
|
onSelect: y,
|
|
51
51
|
onHover: N
|
|
52
52
|
}) {
|
|
@@ -54,13 +54,13 @@ function ke({
|
|
|
54
54
|
isKeyboardNavigating: f
|
|
55
55
|
} = X(), V = d(() => {
|
|
56
56
|
y(o);
|
|
57
|
-
}, [y, o]), c = d((
|
|
58
|
-
f ||
|
|
57
|
+
}, [y, o]), c = d((n) => {
|
|
58
|
+
f || n.movementX === 0 && n.movementY === 0 || N(o);
|
|
59
59
|
}, [f, N, o]), p = L(null);
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
m &&
|
|
63
|
-
|
|
60
|
+
x(() => {
|
|
61
|
+
const n = p.current;
|
|
62
|
+
m && n && f && setTimeout(() => {
|
|
63
|
+
n.scrollIntoView({
|
|
64
64
|
behavior: "smooth",
|
|
65
65
|
block: "nearest"
|
|
66
66
|
});
|
|
@@ -68,24 +68,24 @@ function ke({
|
|
|
68
68
|
}, [m, f]);
|
|
69
69
|
const s = d(
|
|
70
70
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
71
|
-
(
|
|
72
|
-
p.current =
|
|
71
|
+
(n) => {
|
|
72
|
+
p.current = n, r && (r.current = n);
|
|
73
73
|
},
|
|
74
|
-
[
|
|
74
|
+
[r]
|
|
75
75
|
);
|
|
76
|
-
return /* @__PURE__ */ l.jsx("li", { ref: s, id: K, role: "option", "aria-selected": m, tabIndex: -1, className: T(z, "kakadu-components-4130497639", f ? "kakadu-components-962373561" : "kakadu-components-1109598791"), onClick: V, onMouseMove: c, children: /* @__PURE__ */ l.jsx(P, { className: T(U, typeof
|
|
76
|
+
return /* @__PURE__ */ l.jsx("li", { ref: s, id: K, role: "option", "aria-selected": m, tabIndex: -1, className: T(z, "kakadu-components-4130497639", f ? "kakadu-components-962373561" : "kakadu-components-1109598791"), onClick: V, onMouseMove: c, children: /* @__PURE__ */ l.jsx(P, { className: T(U, typeof h == "string" && "kakadu-components-154286052"), children: h }) });
|
|
77
77
|
}
|
|
78
78
|
function xe({
|
|
79
|
-
isLoading:
|
|
79
|
+
isLoading: r,
|
|
80
80
|
id: m,
|
|
81
81
|
activeOptionId: K,
|
|
82
82
|
selectedValue: o,
|
|
83
|
-
options:
|
|
83
|
+
options: h,
|
|
84
84
|
onSelect: y,
|
|
85
85
|
onHover: N
|
|
86
86
|
}) {
|
|
87
87
|
const f = L(null);
|
|
88
|
-
|
|
88
|
+
x(() => {
|
|
89
89
|
const s = f.current;
|
|
90
90
|
s && s.scrollIntoView({
|
|
91
91
|
behavior: "smooth",
|
|
@@ -97,11 +97,11 @@ function xe({
|
|
|
97
97
|
} = X(), p = L(c);
|
|
98
98
|
return p.current = c, ie(() => {
|
|
99
99
|
const s = f.current;
|
|
100
|
-
if (s &&
|
|
100
|
+
if (s && h.length > 0) {
|
|
101
101
|
if (p.current) {
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
104
|
-
|
|
102
|
+
const n = V.current;
|
|
103
|
+
if (n) {
|
|
104
|
+
n.scrollIntoView({
|
|
105
105
|
block: "nearest"
|
|
106
106
|
});
|
|
107
107
|
return;
|
|
@@ -111,11 +111,11 @@ function xe({
|
|
|
111
111
|
top: 0
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
}, [
|
|
115
|
-
|
|
114
|
+
}, [h]), /* @__PURE__ */ l.jsxs("ul", { ref: f, id: m, role: "listbox", "aria-label": "Options", tabIndex: -1, className: "kakadu-components-3718330689", children: [
|
|
115
|
+
h.length === 0 ? r ? null : /* @__PURE__ */ l.jsxs(W, { "aria-atomic": !0, as: "li", role: "status", "aria-live": "polite", direction: "row", preset: "start", gap: 0.5, className: z, children: [
|
|
116
116
|
/* @__PURE__ */ l.jsx(le, { size: 15, type: "exclamationTriangle" }),
|
|
117
117
|
/* @__PURE__ */ l.jsx(P, { className: U, children: "No results." })
|
|
118
|
-
] }) :
|
|
118
|
+
] }) : h.map((s, n) => /* @__PURE__ */ l.jsx(
|
|
119
119
|
ke,
|
|
120
120
|
{
|
|
121
121
|
...s,
|
|
@@ -125,17 +125,17 @@ function xe({
|
|
|
125
125
|
onSelect: y,
|
|
126
126
|
onHover: N
|
|
127
127
|
},
|
|
128
|
-
F(s) +
|
|
128
|
+
F(s) + n
|
|
129
129
|
)),
|
|
130
|
-
|
|
130
|
+
r ? /* @__PURE__ */ l.jsx(W, { as: "li", alignment: "center", className: z, children: /* @__PURE__ */ l.jsx(P, { className: T(U, "kakadu-components-2015848015"), children: /* @__PURE__ */ l.jsx(ve, { width: "100%", height: "1.3em" }) }) }) : null
|
|
131
131
|
] });
|
|
132
132
|
}
|
|
133
133
|
function Me({
|
|
134
|
-
isLoading:
|
|
134
|
+
isLoading: r,
|
|
135
135
|
shouldFilterOptions: m = !0,
|
|
136
136
|
label: K,
|
|
137
137
|
options: o,
|
|
138
|
-
error:
|
|
138
|
+
error: h,
|
|
139
139
|
warning: y,
|
|
140
140
|
information: N,
|
|
141
141
|
footnote: f,
|
|
@@ -144,110 +144,121 @@ function Me({
|
|
|
144
144
|
onSelect: p,
|
|
145
145
|
...s
|
|
146
146
|
}) {
|
|
147
|
-
const
|
|
147
|
+
const n = L(null), Y = Q(), q = Q(), [j, H] = S(!1), $ = d(() => {
|
|
148
148
|
H(!0);
|
|
149
149
|
}, []), ee = d((e) => {
|
|
150
|
-
var
|
|
151
|
-
(
|
|
152
|
-
}, []), [
|
|
153
|
-
|
|
150
|
+
var t;
|
|
151
|
+
(t = n.current) != null && t.contains(e.relatedTarget) || H(!1);
|
|
152
|
+
}, []), [g, i] = S(!1);
|
|
153
|
+
x(() => {
|
|
154
154
|
i(j);
|
|
155
|
-
}, [j])
|
|
155
|
+
}, [j]), x(() => {
|
|
156
|
+
var t;
|
|
157
|
+
if (!g)
|
|
158
|
+
return;
|
|
159
|
+
const e = (t = n.current) == null ? void 0 : t.control;
|
|
160
|
+
return () => {
|
|
161
|
+
e == null || e.scrollIntoView({
|
|
162
|
+
behavior: "smooth",
|
|
163
|
+
block: "nearest"
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
}, [g]);
|
|
156
167
|
const [C, E] = S(""), {
|
|
157
168
|
value: b
|
|
158
169
|
} = s, [k, M] = S(b), [B, te] = S(b), G = L(B), u = d((e) => {
|
|
159
170
|
te(e), G.current = e;
|
|
160
171
|
}, []);
|
|
161
|
-
|
|
172
|
+
x(() => {
|
|
162
173
|
M(b), u(b);
|
|
163
|
-
}, [b, u]),
|
|
174
|
+
}, [b, u]), x(() => {
|
|
164
175
|
if (b === void 0)
|
|
165
176
|
return;
|
|
166
|
-
const e = o.find((
|
|
177
|
+
const e = o.find((t) => t.value === b);
|
|
167
178
|
e && E(F(e));
|
|
168
|
-
}, [o, b]),
|
|
179
|
+
}, [o, b]), x(() => {
|
|
169
180
|
b === void 0 && E("");
|
|
170
181
|
}, [b]);
|
|
171
|
-
const
|
|
182
|
+
const re = d(() => {
|
|
172
183
|
k && (E(""), u(void 0));
|
|
173
|
-
}, [k, u]),
|
|
174
|
-
E(e), c == null || c(e,
|
|
184
|
+
}, [k, u]), ne = d((e, t) => {
|
|
185
|
+
E(e), c == null || c(e, t), i(!0), M(void 0);
|
|
175
186
|
}, [c]), oe = d((e) => {
|
|
176
|
-
var
|
|
177
|
-
(
|
|
187
|
+
var t;
|
|
188
|
+
(t = n.current) != null && t.contains(e.target) && i(!0);
|
|
178
189
|
}, []), I = d((e) => {
|
|
179
|
-
const
|
|
180
|
-
u(
|
|
190
|
+
const t = e == null ? void 0 : e.value;
|
|
191
|
+
u(t), e ? E(F(e)) : (E(""), c == null || c("")), p == null || p(t);
|
|
181
192
|
}, [u, c, p]), se = d((e) => {
|
|
182
|
-
const
|
|
183
|
-
I(
|
|
193
|
+
const t = o.find((O) => O.value === e);
|
|
194
|
+
I(t), M(e), i(!1);
|
|
184
195
|
}, [o, I]), ae = d((e) => {
|
|
185
196
|
u(e);
|
|
186
197
|
}, [u]), D = ce(C), v = Z(() => !m || k ? o : me(D, o, F), [m, k, o, D]);
|
|
187
|
-
|
|
198
|
+
x(() => {
|
|
188
199
|
!k && D.length > 0 && v.length > 0 && !v.some((e) => B === e.value) && u(v[0].value);
|
|
189
200
|
}, [k, D, v, B, u]);
|
|
190
201
|
const {
|
|
191
202
|
setIsKeyboardNavigating: R
|
|
192
203
|
} = X();
|
|
193
|
-
return
|
|
204
|
+
return x(() => {
|
|
194
205
|
if (j)
|
|
195
206
|
return pe((e) => {
|
|
196
207
|
e.movementX === 0 && e.movementY === 0 || R(!1);
|
|
197
208
|
});
|
|
198
|
-
}, [j, R]),
|
|
209
|
+
}, [j, R]), x(() => {
|
|
199
210
|
if (j)
|
|
200
211
|
return be((e) => {
|
|
201
212
|
var J;
|
|
202
|
-
let
|
|
203
|
-
const O = v.length, A = v.findIndex((a) => a.value === G.current),
|
|
213
|
+
let t;
|
|
214
|
+
const O = v.length, A = v.findIndex((a) => a.value === G.current), w = () => {
|
|
204
215
|
e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
|
|
205
216
|
};
|
|
206
217
|
switch (e.key) {
|
|
207
218
|
case "Enter": {
|
|
208
219
|
const a = v[A];
|
|
209
|
-
a && (
|
|
220
|
+
a && (w(), R(!0), i(!1), I(a), M(a.value));
|
|
210
221
|
break;
|
|
211
222
|
}
|
|
212
223
|
case "Escape": {
|
|
213
|
-
if (
|
|
214
|
-
|
|
224
|
+
if (g)
|
|
225
|
+
w(), k ? u(void 0) : I(void 0), i(!1);
|
|
215
226
|
else if (k)
|
|
216
|
-
|
|
227
|
+
w(), i(!0), I(void 0);
|
|
217
228
|
else {
|
|
218
|
-
|
|
229
|
+
w(), H(!1);
|
|
219
230
|
const a = document.activeElement;
|
|
220
|
-
a instanceof HTMLElement && ((J =
|
|
231
|
+
a instanceof HTMLElement && ((J = n.current) != null && J.contains(a)) && a.blur();
|
|
221
232
|
}
|
|
222
233
|
return;
|
|
223
234
|
}
|
|
224
235
|
case "ArrowDown": {
|
|
225
|
-
|
|
236
|
+
w(), g && (t = A + 1), i(!0);
|
|
226
237
|
break;
|
|
227
238
|
}
|
|
228
239
|
case "ArrowUp": {
|
|
229
|
-
|
|
240
|
+
w(), g && (t = A - 1, t < 0 && (t = O - 1)), i(!0);
|
|
230
241
|
break;
|
|
231
242
|
}
|
|
232
243
|
case "Home": {
|
|
233
|
-
i(!0),
|
|
244
|
+
i(!0), t = 0;
|
|
234
245
|
break;
|
|
235
246
|
}
|
|
236
247
|
case "End": {
|
|
237
|
-
i(!0),
|
|
248
|
+
i(!0), t = O - 1;
|
|
238
249
|
break;
|
|
239
250
|
}
|
|
240
251
|
case "Backspace": {
|
|
241
|
-
v.some((a) => a.value === k) && (
|
|
252
|
+
v.some((a) => a.value === k) && (w(), I(void 0), i(!0));
|
|
242
253
|
break;
|
|
243
254
|
}
|
|
244
255
|
}
|
|
245
|
-
if (
|
|
246
|
-
const a = v[
|
|
256
|
+
if (t !== void 0 && (w(), R(!0), O > 0)) {
|
|
257
|
+
const a = v[t % O];
|
|
247
258
|
a && u(a.value);
|
|
248
259
|
}
|
|
249
260
|
});
|
|
250
|
-
}, [j, v, R, i, I, M,
|
|
261
|
+
}, [j, v, R, i, I, M, g, k, u]), /* @__PURE__ */ l.jsx(fe, { ...s, ref: n, role: "combobox", autoComplete: "off", "aria-controls": Y, "aria-expanded": g, "aria-activedescendant": g ? q : void 0, label: K, value: C, error: h, warning: y, information: N, footnote: f, attachments: g ? /* @__PURE__ */ l.jsx(xe, { isLoading: r, id: Y, activeOptionId: q, selectedValue: B, options: v, onSelect: se, onHover: ae }) : null, className: T(V, "kakadu-components-1230689972"), onMouseDown: oe, onChange: ne, onBeforeInput: re, onFocus: $, onBlur: ee, children: /* @__PURE__ */ l.jsx(de, { width: 14, height: 14, className: "kakadu-components-158931186" }) });
|
|
251
262
|
}
|
|
252
263
|
export {
|
|
253
264
|
Me as default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("../jsx-runtime-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("../jsx-runtime-CZa898vN.js"),o=require("react"),p=require("../utilities/copy-to-clipboard.js"),f=require("./icon-button.js");function m({label:i="Kopier",copiedLabel:n="Kopiert!",value:r,onClick:e,...c}){const t=o.useRef(null),[u,s]=o.useState(!1),a=o.useCallback(l=>{p.default(r),s(!0),t.current&&clearTimeout(t.current),e==null||e(l),t.current=setTimeout(()=>{s(!1)},2e3)},[r,e]);return d.jsxRuntimeExports.jsx(f.default,{...c,icon:u?"check":"copy",label:u?n:i,variant:u?"success":"default",onClick:a})}exports.default=m;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as a } from "../jsx-runtime-
|
|
1
|
+
import { j as a } from "../jsx-runtime-z6PQ6F3d.mjs";
|
|
2
2
|
import { useRef as f, useState as m, useCallback as l } from "react";
|
|
3
3
|
import d from "../utilities/copy-to-clipboard.mjs";
|
|
4
4
|
import x from "./icon-button.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-CZa898vN.js"),s=require("./flex.js"),n=require("./text.js"),u=require("./copy-icon-button.js");function i({title:r,value:t,hasCopyButton:o}){return e.jsxRuntimeExports.jsxs(s.default,{direction:"row",gap:1.5,preset:"start",children:[e.jsxRuntimeExports.jsxs(s.default,{fill:!0,gap:.375,preset:"start",children:[e.jsxRuntimeExports.jsx(n.Span,{className:"kakadu-components-3772513716",children:r}),e.jsxRuntimeExports.jsx(n.Span,{className:"kakadu-components-2497879239",children:t})]}),o?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(u.default,{value:t})}):null]})}exports.default=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../jsx-runtime-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../jsx-runtime-CZa898vN.js");function n({decorators:e,children:t}){return e.length===0?t:e.reduceRight((u,r)=>i.jsxRuntimeExports.jsx(r,{children:u}),t)}exports.default=n;
|
package/build/components/dot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-CZa898vN.js"),r=require("@kuma-ui/core");function s({className:e}){return t.jsxRuntimeExports.jsx("span",{className:r.cx("kakadu-components-2022754336",e),children:"•"})}exports.default=s;
|
package/build/components/dot.mjs
CHANGED