@kakadu/components 3.3.0 → 3.4.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/button-tooltip.js +1 -1
- package/build/components/button-tooltip.mjs +1 -1
- package/build/components/click-ripples.d.ts +3 -1
- package/build/components/click-ripples.js +1 -1
- package/build/components/click-ripples.mjs +37 -34
- package/build/components/hover-gradient.d.ts +2 -1
- package/build/components/hover-gradient.js +1 -1
- package/build/components/hover-gradient.mjs +38 -33
- package/build/components/popover-menu.js +1 -1
- package/build/components/popover-menu.mjs +26 -26
- package/build/components.css +1 -1
- package/build/icons/document.d.ts +2 -0
- package/build/icons/document.js +1 -0
- package/build/icons/document.mjs +27 -0
- package/build/icons/eye.js +1 -1
- package/build/icons/eye.mjs +4 -4
- package/build/icons/icon.d.ts +2 -0
- package/build/icons/icon.js +1 -1
- package/build/icons/icon.mjs +24 -20
- package/build/icons/package.d.ts +2 -0
- package/build/icons/package.js +1 -0
- package/build/icons/package.mjs +27 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +1 -1
- package/build/index.mjs +66 -62
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),u=require("@kuma-ui/core");var a=(t=>(t.top="top",t.bottom="bottom",t))(a||{});function s({id:t,label:r,position:o="top",className:e}){return n.jsxRuntimeExports.jsx("div",{id:t,role:"tooltip",className:u.cx("kakadu-components-982005200",o==="top"&&"kakadu-components-430823771",o==="bottom"&&"kakadu-components-2189175034",e),children:n.jsxRuntimeExports.jsx("span",{className:u.cx("kakadu-components-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),u=require("@kuma-ui/core");var a=(t=>(t.top="top",t.bottom="bottom",t))(a||{});function s({id:t,label:r,position:o="top",className:e}){return n.jsxRuntimeExports.jsx("div",{id:t,role:"tooltip",className:u.cx("kakadu-components-982005200",o==="top"&&"kakadu-components-430823771",o==="bottom"&&"kakadu-components-2189175034",e),children:n.jsxRuntimeExports.jsx("span",{className:u.cx("kakadu-components-3316581213",o==="top"&&"kakadu-components-2481216458",o==="bottom"&&"kakadu-components-637471806",e),children:r})})}exports.ButtonTooltipPosition=a;exports.default=s;
|
|
@@ -7,7 +7,7 @@ function c({
|
|
|
7
7
|
position: t = "top",
|
|
8
8
|
className: a
|
|
9
9
|
}) {
|
|
10
|
-
return /* @__PURE__ */ m.jsx("div", { id: o, role: "tooltip", className: n("kakadu-components-982005200", t === "top" && "kakadu-components-430823771", t === "bottom" && "kakadu-components-2189175034", a), children: /* @__PURE__ */ m.jsx("span", { className: n("kakadu-components-
|
|
10
|
+
return /* @__PURE__ */ m.jsx("div", { id: o, role: "tooltip", className: n("kakadu-components-982005200", t === "top" && "kakadu-components-430823771", t === "bottom" && "kakadu-components-2189175034", a), children: /* @__PURE__ */ m.jsx("span", { className: n("kakadu-components-3316581213", t === "top" && "kakadu-components-2481216458", t === "bottom" && "kakadu-components-637471806", a), children: e }) });
|
|
11
11
|
}
|
|
12
12
|
export {
|
|
13
13
|
p as ButtonTooltipPosition,
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { type HTMLProps } from 'react';
|
|
2
|
-
export default function ClickRipples({ size, className, ...properties }: HTMLProps<HTMLDivElement>
|
|
2
|
+
export default function ClickRipples({ isActive, size, className, ...properties }: HTMLProps<HTMLDivElement> & {
|
|
3
|
+
readonly isActive?: boolean;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../jsx-runtime-BB_1_6y_.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../jsx-runtime-BB_1_6y_.js"),r=require("react"),w=require("@kuma-ui/core");function v({id:t,x:o,y:i,onEnd:s}){return r.useEffect(()=>{const n=setTimeout(()=>{s(t)},370);return()=>{clearTimeout(n)}},[s,t]),a.jsxRuntimeExports.jsx("div",{style:{top:i,left:o},className:"kakadu-components-3828473824"})}function y({isActive:t=!0,size:o=150,className:i,...s}){const n=r.useRef(null),[p,f]=r.useState([]);r.useEffect(()=>{if(!t)return;const e=u=>{if(n.current){const c=n.current.getBoundingClientRect(),{clientX:l,clientY:d}=u,{left:m,right:E,top:x,bottom:R}=c;l>m&&l<E&&d>x&&d<R&&f(k=>[...k,{id:Date.now()+Math.random()*1e3,x:l-m,y:d-x}])}};return window.addEventListener("pointerdown",e),()=>{window.removeEventListener("pointerdown",e)}},[t]);const j=r.useCallback(e=>{f(u=>u.filter(c=>c.id!==e))},[]);return a.jsxRuntimeExports.jsx("div",{...s,ref:n,style:{"--size":`${o}px`},className:w.cx("kakadu-components-4189236582",i),children:p.map(e=>a.jsxRuntimeExports.jsx(v,{id:e.id,x:e.x,y:e.y,onEnd:j},e.id))})}exports.default=y;
|
|
@@ -1,60 +1,63 @@
|
|
|
1
1
|
import { j as a } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { cx as
|
|
4
|
-
function
|
|
5
|
-
id:
|
|
6
|
-
x:
|
|
2
|
+
import { useRef as E, useState as R, useEffect as p, useCallback as h } from "react";
|
|
3
|
+
import { cx as v } from "@kuma-ui/core";
|
|
4
|
+
function C({
|
|
5
|
+
id: t,
|
|
6
|
+
x: r,
|
|
7
7
|
y: s,
|
|
8
|
-
onEnd:
|
|
8
|
+
onEnd: o
|
|
9
9
|
}) {
|
|
10
10
|
return p(() => {
|
|
11
|
-
const
|
|
12
|
-
t
|
|
11
|
+
const n = setTimeout(() => {
|
|
12
|
+
o(t);
|
|
13
13
|
}, 370);
|
|
14
14
|
return () => {
|
|
15
|
-
clearTimeout(
|
|
15
|
+
clearTimeout(n);
|
|
16
16
|
};
|
|
17
|
-
}, [
|
|
17
|
+
}, [o, t]), /* @__PURE__ */ a.jsx("div", { style: {
|
|
18
18
|
top: s,
|
|
19
|
-
left:
|
|
19
|
+
left: r
|
|
20
20
|
}, className: "kakadu-components-3828473824" });
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
function N({
|
|
23
|
+
isActive: t = !0,
|
|
24
|
+
size: r = 150,
|
|
25
|
+
className: s,
|
|
26
|
+
...o
|
|
26
27
|
}) {
|
|
27
|
-
const
|
|
28
|
+
const n = E(null), [x, d] = R([]);
|
|
28
29
|
p(() => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
if (!t)
|
|
31
|
+
return;
|
|
32
|
+
const e = (i) => {
|
|
33
|
+
if (n.current) {
|
|
34
|
+
const c = n.current.getBoundingClientRect(), {
|
|
35
|
+
clientX: u,
|
|
36
|
+
clientY: l
|
|
37
|
+
} = i, {
|
|
35
38
|
left: m,
|
|
36
|
-
right:
|
|
39
|
+
right: w,
|
|
37
40
|
top: f,
|
|
38
|
-
bottom:
|
|
41
|
+
bottom: j
|
|
39
42
|
} = c;
|
|
40
|
-
|
|
43
|
+
u > m && u < w && l > f && l < j && d((y) => [...y, {
|
|
41
44
|
id: Date.now() + Math.random() * 1e3,
|
|
42
|
-
x:
|
|
43
|
-
y:
|
|
45
|
+
x: u - m,
|
|
46
|
+
y: l - f
|
|
44
47
|
}]);
|
|
45
48
|
}
|
|
46
49
|
};
|
|
47
50
|
return window.addEventListener("pointerdown", e), () => {
|
|
48
51
|
window.removeEventListener("pointerdown", e);
|
|
49
52
|
};
|
|
53
|
+
}, [t]);
|
|
54
|
+
const k = h((e) => {
|
|
55
|
+
d((i) => i.filter((c) => c.id !== e));
|
|
50
56
|
}, []);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
return /* @__PURE__ */ a.jsx("div", { ...s, ref: t, style: {
|
|
55
|
-
"--size": `${n}px`
|
|
56
|
-
}, className: R("kakadu-components-4189236582", o), children: i.map((e) => /* @__PURE__ */ a.jsx(h, { id: e.id, x: e.x, y: e.y, onEnd: x }, e.id)) });
|
|
57
|
+
return /* @__PURE__ */ a.jsx("div", { ...o, ref: n, style: {
|
|
58
|
+
"--size": `${r}px`
|
|
59
|
+
}, className: v("kakadu-components-4189236582", s), children: x.map((e) => /* @__PURE__ */ a.jsx(C, { id: e.id, x: e.x, y: e.y, onEnd: k }, e.id)) });
|
|
57
60
|
}
|
|
58
61
|
export {
|
|
59
|
-
|
|
62
|
+
N as default
|
|
60
63
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type HTMLProps } from 'react';
|
|
2
2
|
export declare const normalBlendStyles: string;
|
|
3
|
-
export default function HoverGradient({ size, className, ...properties }: HTMLProps<HTMLDivElement> & {
|
|
3
|
+
export default function HoverGradient({ isActive, size, className, ...properties }: HTMLProps<HTMLDivElement> & {
|
|
4
|
+
readonly isActive?: boolean;
|
|
4
5
|
readonly size?: number;
|
|
5
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("../jsx-runtime-BB_1_6y_.js"),t=require("react"),p=require("@kuma-ui/core")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("../jsx-runtime-BB_1_6y_.js"),t=require("react"),p=require("@kuma-ui/core"),$="kakadu-components-2608453841";function q({isActive:x=!0,size:k=200,className:E,...g}){const i=t.useRef(null),n=t.useRef(null),[b,s]=t.useState(!1),[o,j]=t.useState();return t.useEffect(()=>{if(!x){s(!1);return}const c=i.current;if(!c)return;n.current||(n.current=c.parentElement);const e=n.current;if(!e)return;const l=m=>{const S=m.target;if(!e.contains(S))return;const y=e.getBoundingClientRect(),{clientX:r,clientY:u}=m,{left:f,right:L,top:d,bottom:R}=y;r>f&&r<L&&u>d&&u<R&&(s(!0),j([r-f,u-d]))},a=()=>{s(!1)};return e.addEventListener("mousemove",l),e.addEventListener("mouseleave",a),()=>{e.removeEventListener("mousemove",l),e.removeEventListener("mouseleave",a)}},[]),v.jsxRuntimeExports.jsx("div",{...g,ref:i,className:p.cx("kakadu-components-1237006455",E),children:o?v.jsxRuntimeExports.jsx("div",{style:{"--size":`${k}px`,"--offset-x":`${o[0]}px`,"--offset-y":`${o[1]}px`},className:p.cx("kakadu-components-611160091",b&&"kakadu-components-3627966847")}):null})}exports.default=q;exports.normalBlendStyles=$;
|
|
@@ -1,48 +1,53 @@
|
|
|
1
1
|
import { j as d } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useRef as p, useState as v, useEffect as
|
|
2
|
+
import { useRef as p, useState as v, useEffect as N } from "react";
|
|
3
3
|
import { cx as x } from "@kuma-ui/core";
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const z = "kakadu-components-2608453841";
|
|
5
|
+
function C({
|
|
6
|
+
isActive: k = !0,
|
|
7
|
+
size: E = 200,
|
|
8
|
+
className: g,
|
|
9
|
+
...L
|
|
9
10
|
}) {
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const i = p(null), t = p(null), [b, n] = v(!1), [s, j] = v();
|
|
12
|
+
return N(() => {
|
|
13
|
+
if (!k) {
|
|
14
|
+
n(!1);
|
|
14
15
|
return;
|
|
15
|
-
|
|
16
|
+
}
|
|
17
|
+
const a = i.current;
|
|
18
|
+
if (!a)
|
|
19
|
+
return;
|
|
20
|
+
t.current || (t.current = a.parentElement);
|
|
16
21
|
const e = t.current;
|
|
17
22
|
if (!e)
|
|
18
23
|
return;
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
if (!e.contains(
|
|
24
|
+
const c = (l) => {
|
|
25
|
+
const y = l.target;
|
|
26
|
+
if (!e.contains(y))
|
|
22
27
|
return;
|
|
23
|
-
const
|
|
24
|
-
clientX:
|
|
25
|
-
clientY:
|
|
26
|
-
} =
|
|
28
|
+
const $ = e.getBoundingClientRect(), {
|
|
29
|
+
clientX: o,
|
|
30
|
+
clientY: r
|
|
31
|
+
} = l, {
|
|
27
32
|
left: m,
|
|
28
|
-
right:
|
|
33
|
+
right: h,
|
|
29
34
|
top: f,
|
|
30
|
-
bottom:
|
|
31
|
-
} =
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
+
bottom: B
|
|
36
|
+
} = $;
|
|
37
|
+
o > m && o < h && r > f && r < B && (n(!0), j([o - m, r - f]));
|
|
38
|
+
}, u = () => {
|
|
39
|
+
n(!1);
|
|
35
40
|
};
|
|
36
|
-
return e.addEventListener("mousemove",
|
|
37
|
-
e.removeEventListener("mousemove",
|
|
41
|
+
return e.addEventListener("mousemove", c), e.addEventListener("mouseleave", u), () => {
|
|
42
|
+
e.removeEventListener("mousemove", c), e.removeEventListener("mouseleave", u);
|
|
38
43
|
};
|
|
39
|
-
}, []), /* @__PURE__ */ d.jsx("div", { ...
|
|
40
|
-
"--size": `${
|
|
41
|
-
"--offset-x": `${
|
|
42
|
-
"--offset-y": `${
|
|
43
|
-
}, className: x("kakadu-components-611160091",
|
|
44
|
+
}, []), /* @__PURE__ */ d.jsx("div", { ...L, ref: i, className: x("kakadu-components-1237006455", g), children: s ? /* @__PURE__ */ d.jsx("div", { style: {
|
|
45
|
+
"--size": `${E}px`,
|
|
46
|
+
"--offset-x": `${s[0]}px`,
|
|
47
|
+
"--offset-y": `${s[1]}px`
|
|
48
|
+
}, className: x("kakadu-components-611160091", b && "kakadu-components-3627966847") }) : null });
|
|
44
49
|
}
|
|
45
50
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
C as default,
|
|
52
|
+
z as normalBlendStyles
|
|
48
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),M=require("@kuma-ui/core"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),M=require("@kuma-ui/core"),c=require("react"),q=require("../theme.js"),R=require("../icons/icon.js"),f=require("./popover.js"),P=require("./atom.js"),h=require("./text.js"),g=require("./hover-gradient.js"),I=require("./click-ripples.js"),N=require("./separator.js"),S=require("./decorators.js"),E=new Set;function y(){const[e,n]=c.useState(!1),r=c.useCallback(s=>{n(s);for(const i of E)i(s)},[]);return c.useEffect(()=>{const s=i=>{n(i)};return E.add(s),()=>{E.delete(s)}},[]),c.useMemo(()=>({isKeyboardNavigating:e,setIsKeyboardNavigating:r}),[e,r])}function _({label:e,iconLeft:n,iconRight:r,href:s,shouldCloseOnClick:i=!0,decorators:v=[],submenu:x,className:u,onClick:o,...j}){const{isVisible:l,isFocused:a,close:p}=f.usePopoverContext(),{isKeyboardNavigating:d}=y(),m=c.useCallback(w=>{a&&(o==null||o(w),x?x.show():i&&(p==null||p()))},[a,o,x,i,p]),k=c.useMemo(()=>t.jsxRuntimeExports.jsxs(P.default,{as:s?"a":"button",...j,type:s?void 0:"button",role:"menuitem",href:s,disabled:s?void 0:!l,className:M.cx(q.buttonResetStyles,"kakadu-components-4075327442",a&&"kakadu-components-3160069815",d?"kakadu-components-2043829669":a&&"kakadu-components-2862719809",u),onClick:m,children:[t.jsxRuntimeExports.jsxs(h.Span,{className:"kakadu-components-1109353535",children:[n?t.jsxRuntimeExports.jsx(R.default,{width:12,height:12,type:n}):null,t.jsxRuntimeExports.jsx("span",{className:"kakadu-components-913703148",children:e}),r?t.jsxRuntimeExports.jsx(R.default,{width:12,height:12,type:r}):null]}),d?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(I.default,{isActive:a,size:100}),t.jsxRuntimeExports.jsx(g.default,{isActive:a,size:150,className:g.normalBlendStyles})]})]}),[s,j,l,d,u,m,n,e,r]);return t.jsxRuntimeExports.jsx(S.default,{decorators:v,children:x?t.jsxRuntimeExports.jsx(b,{menu:x.popoverMenu,className:"kakadu-components-1861176543",children:k}):k})}function K(e){if("type"in e){if(e.type==="separator")return t.jsxRuntimeExports.jsx(N.default,{});if(e.type==="group")return t.jsxRuntimeExports.jsx(h.Span,{className:"kakadu-components-1499037363",children:e.label})}return t.jsxRuntimeExports.jsx(_,{...e})}function C({items:e}){const{isFocused:n}=f.usePopoverContext(),[r,s]=c.useState([]),{setIsKeyboardNavigating:i}=y(),v=c.useCallback(u=>{u&&s(o=>o.includes(u)?o:[...o,u])},[]),x=c.useCallback(u=>{n&&(u.currentTarget.focus(),i(!1))},[n,i]);return c.useEffect(()=>{if(!n)return;const u=o=>{const j=r.filter(m=>m.isConnected),l=j.length;if(l===0)return;let a;const p=document.activeElement;let d=p?j.indexOf(p):-1;switch(d===-1&&(d=0),o.key){case"ArrowDown":{a=(d+1)%l;break}case"ArrowUp":{a=(d-1+l)%l;break}case"Home":{a=0;break}case"End":{a=l-1;break}case"Tab":{i(!0);return}}if(a!==void 0){o.preventDefault(),o.stopPropagation();const m=j[a];m&&(m.focus(),i(!0))}};return window.addEventListener("keydown",u,{capture:!0}),()=>{window.removeEventListener("keydown",u,{capture:!0})}},[n,r,i]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e.map((u,o)=>t.jsxRuntimeExports.jsx(K,{...u,reference:v,onMouseEnter:x},o))})}function A({items:e,...n}){return t.jsxRuntimeExports.jsx(f.default,{...n,as:"nav",role:"menu",innerClassName:"kakadu-components-3600436535",children:t.jsxRuntimeExports.jsx(C,{items:e})})}function F(e){const n=c.useMemo(()=>({items:e}),[e]),{show:r,popover:s}=f.usePopover(A,n);return c.useMemo(()=>({show:r,popoverMenu:s}),[r,s])}function b({menu:e,className:n,children:r}){return t.jsxRuntimeExports.jsxs(f.PopoverContainer,{className:n,children:[r,e]})}exports.default=b;exports.usePopoverMenu=F;
|
|
@@ -3,8 +3,8 @@ import { cx as M } from "@kuma-ui/core";
|
|
|
3
3
|
import { useMemo as v, useState as y, useCallback as x, useEffect as w } from "react";
|
|
4
4
|
import { buttonResetStyles as E } from "../theme.mjs";
|
|
5
5
|
import h from "../icons/icon.mjs";
|
|
6
|
-
import S, { PopoverContainer as K, usePopover as
|
|
7
|
-
import
|
|
6
|
+
import S, { PopoverContainer as K, usePopover as A, usePopoverContext as b } from "./popover.mjs";
|
|
7
|
+
import F from "./atom.mjs";
|
|
8
8
|
import { Span as I } from "./text.mjs";
|
|
9
9
|
import D, { normalBlendStyles as H } from "./hover-gradient.mjs";
|
|
10
10
|
import z from "./click-ripples.mjs";
|
|
@@ -14,12 +14,12 @@ const j = /* @__PURE__ */ new Set();
|
|
|
14
14
|
function N() {
|
|
15
15
|
const [e, t] = y(!1), s = x((o) => {
|
|
16
16
|
t(o);
|
|
17
|
-
for (const
|
|
18
|
-
|
|
17
|
+
for (const c of j)
|
|
18
|
+
c(o);
|
|
19
19
|
}, []);
|
|
20
20
|
return w(() => {
|
|
21
|
-
const o = (
|
|
22
|
-
t(
|
|
21
|
+
const o = (c) => {
|
|
22
|
+
t(c);
|
|
23
23
|
};
|
|
24
24
|
return j.add(o), () => {
|
|
25
25
|
j.delete(o);
|
|
@@ -34,7 +34,7 @@ function R({
|
|
|
34
34
|
iconLeft: t,
|
|
35
35
|
iconRight: s,
|
|
36
36
|
href: o,
|
|
37
|
-
shouldCloseOnClick:
|
|
37
|
+
shouldCloseOnClick: c = !0,
|
|
38
38
|
decorators: k = [],
|
|
39
39
|
submenu: m,
|
|
40
40
|
className: a,
|
|
@@ -43,21 +43,21 @@ function R({
|
|
|
43
43
|
}) {
|
|
44
44
|
const {
|
|
45
45
|
isVisible: u,
|
|
46
|
-
isFocused:
|
|
46
|
+
isFocused: i,
|
|
47
47
|
close: l
|
|
48
48
|
} = b(), {
|
|
49
49
|
isKeyboardNavigating: d
|
|
50
50
|
} = N(), p = x((P) => {
|
|
51
|
-
|
|
52
|
-
}, [
|
|
51
|
+
i && (r == null || r(P), m ? m.show() : c && (l == null || l()));
|
|
52
|
+
}, [i, r, m, c, l]), g = v(() => /* @__PURE__ */ n.jsxs(F, { as: o ? "a" : "button", ...f, type: o ? void 0 : "button", role: "menuitem", href: o, disabled: o ? void 0 : !u, className: M(E, "kakadu-components-4075327442", i && "kakadu-components-3160069815", d ? "kakadu-components-2043829669" : i && "kakadu-components-2862719809", a), onClick: p, children: [
|
|
53
53
|
/* @__PURE__ */ n.jsxs(I, { className: "kakadu-components-1109353535", children: [
|
|
54
54
|
t ? /* @__PURE__ */ n.jsx(h, { width: 12, height: 12, type: t }) : null,
|
|
55
55
|
/* @__PURE__ */ n.jsx("span", { className: "kakadu-components-913703148", children: e }),
|
|
56
56
|
s ? /* @__PURE__ */ n.jsx(h, { width: 12, height: 12, type: s }) : null
|
|
57
57
|
] }),
|
|
58
58
|
d ? null : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
59
|
-
/* @__PURE__ */ n.jsx(
|
|
60
|
-
/* @__PURE__ */ n.jsx(
|
|
59
|
+
/* @__PURE__ */ n.jsx(z, { isActive: i, size: 100 }),
|
|
60
|
+
/* @__PURE__ */ n.jsx(D, { isActive: i, size: 150, className: H })
|
|
61
61
|
] })
|
|
62
62
|
] }), [o, f, u, d, a, p, t, e, s]);
|
|
63
63
|
return /* @__PURE__ */ n.jsx(L, { decorators: k, children: m ? /* @__PURE__ */ n.jsx(U, { menu: m.popoverMenu, className: "kakadu-components-1861176543", children: g }) : g });
|
|
@@ -77,12 +77,12 @@ function B({
|
|
|
77
77
|
const {
|
|
78
78
|
isFocused: t
|
|
79
79
|
} = b(), [s, o] = y([]), {
|
|
80
|
-
setIsKeyboardNavigating:
|
|
80
|
+
setIsKeyboardNavigating: c
|
|
81
81
|
} = N(), k = x((a) => {
|
|
82
82
|
a && o((r) => r.includes(a) ? r : [...r, a]);
|
|
83
83
|
}, []), m = x((a) => {
|
|
84
|
-
t && (a.currentTarget.focus(),
|
|
85
|
-
}, [t,
|
|
84
|
+
t && (a.currentTarget.focus(), c(!1));
|
|
85
|
+
}, [t, c]);
|
|
86
86
|
return w(() => {
|
|
87
87
|
if (!t)
|
|
88
88
|
return;
|
|
@@ -90,35 +90,35 @@ function B({
|
|
|
90
90
|
const f = s.filter((p) => p.isConnected), u = f.length;
|
|
91
91
|
if (u === 0)
|
|
92
92
|
return;
|
|
93
|
-
let
|
|
93
|
+
let i;
|
|
94
94
|
const l = document.activeElement;
|
|
95
95
|
let d = l ? f.indexOf(l) : -1;
|
|
96
96
|
switch (d === -1 && (d = 0), r.key) {
|
|
97
97
|
case "ArrowDown": {
|
|
98
|
-
|
|
98
|
+
i = (d + 1) % u;
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
101
101
|
case "ArrowUp": {
|
|
102
|
-
|
|
102
|
+
i = (d - 1 + u) % u;
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
105
105
|
case "Home": {
|
|
106
|
-
|
|
106
|
+
i = 0;
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
109
|
case "End": {
|
|
110
|
-
|
|
110
|
+
i = u - 1;
|
|
111
111
|
break;
|
|
112
112
|
}
|
|
113
113
|
case "Tab": {
|
|
114
|
-
|
|
114
|
+
c(!0);
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
if (
|
|
118
|
+
if (i !== void 0) {
|
|
119
119
|
r.preventDefault(), r.stopPropagation();
|
|
120
|
-
const p = f[
|
|
121
|
-
p && (p.focus(),
|
|
120
|
+
const p = f[i];
|
|
121
|
+
p && (p.focus(), c(!0));
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
return window.addEventListener("keydown", a, {
|
|
@@ -128,7 +128,7 @@ function B({
|
|
|
128
128
|
capture: !0
|
|
129
129
|
});
|
|
130
130
|
};
|
|
131
|
-
}, [t, s,
|
|
131
|
+
}, [t, s, c]), /* @__PURE__ */ n.jsx(n.Fragment, { children: e.map((a, r) => /* @__PURE__ */ n.jsx(
|
|
132
132
|
T,
|
|
133
133
|
{
|
|
134
134
|
...a,
|
|
@@ -150,7 +150,7 @@ function ne(e) {
|
|
|
150
150
|
}), [e]), {
|
|
151
151
|
show: s,
|
|
152
152
|
popover: o
|
|
153
|
-
} =
|
|
153
|
+
} = A(G, t);
|
|
154
154
|
return v(() => ({
|
|
155
155
|
show: s,
|
|
156
156
|
popoverMenu: o
|