@kakadu/components 5.0.4 → 5.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/button.js +1 -1
- package/build/components/button.mjs +1 -1
- package/build/components/card.js +1 -1
- package/build/components/card.mjs +28 -27
- package/build/components/icon-button.js +1 -1
- package/build/components/icon-button.mjs +10 -10
- package/build/components/moving-gradients.js +1 -1
- package/build/components/moving-gradients.mjs +40 -36
- package/build/components/moving-stars.js +1 -1
- package/build/components/moving-stars.mjs +57 -53
- package/build/components/popover-menu.js +1 -1
- package/build/components/popover-menu.mjs +87 -87
- package/build/components/text-button.js +1 -1
- package/build/components/text-button.mjs +1 -1
- package/build/hooks/use-is-in-view.d.ts +6 -0
- package/build/hooks/use-is-in-view.js +1 -0
- package/build/hooks/use-is-in-view.mjs +26 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +1 -1
- package/build/index.mjs +71 -68
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),R=require("react"),c=require("@kuma-ui/core"),b=require("../theme.js"),$=require("../icons/icon.js"),C=require("./spinner.js"),F=require("./moving-gradients.js"),O=require("./moving-stars.js"),P=require("./theme-setter.js"),H=require("./click-ripples.js"),f=require("./hover-gradient.js"),J=require("./button-tooltip.js"),K=require("./aria-text.js"),Q=require("./atom.js"),U=require("./skeleton.js");function v({isLoading:t,size:a,className:s}){return e.jsxRuntimeExports.jsx("div",{className:c.cx("kakadu-components-2832510379",t&&"kakadu-components-4114685569",s),children:e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-920467642",children:e.jsxRuntimeExports.jsx(C.RevealSpinner,{isVisible:t,size:a})})})}const X=["primary","secondary","warning","danger"];function E({icon:t,variant:a="primary",className:s,...r}){return e.jsxRuntimeExports.jsx("div",{...r,className:c.cx("kakadu-components-2658660333",a==="secondary"&&"kakadu-components-3469662110",s),children:typeof t=="string"?e.jsxRuntimeExports.jsx($.default,{width:14,height:14,type:t}):t})}const S="kakadu-components-2550769169",Y="kakadu-components-1998774084",q="kakadu-components-2945752235",g="kakadu-components-1546692192";function Z({ref:t,type:a,variant:s="primary",href:r,target:h,rel:_,disabled:N,className:B,children:n,label:w,tooltip:i,tooltipPosition:M,iconLeft:m,iconRight:x,isLoading:l,isSkeleton:u,isSkeletonAnimated:D=!0,hasMovingGradients:I=!1,movingGradientsCount:p=4,hasMovingStars:T=!1,movingStarsCount:k=10,...G}){const j=R.useId(),y=R.useRef(null),V=P.useIsDarkMode(y),z=a??"button",A=I&&p>0,W=T&&k>0,o=r&&!u,d=!!N||!!l||!!u;return e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-3559664923",children:[e.jsxRuntimeExports.jsxs(Q.default,{...G,reference:t,as:o?"a":"button",type:o?void 0:z,href:o?r:void 0,target:o?h:void 0,rel:o?_:void 0,"aria-describedby":i?j:void 0,disabled:o?void 0:d,inert:o?d:void 0,className:c.cx(b.effectStyles,b.overlayEffectStyles,"kakadu-components-2514848457",!!m&&"kakadu-components-2735110382",!n&&"kakadu-components-3621693630",s==="secondary"&&S,s==="warning"&&q,s==="danger"&&g,u&&"kakadu-components-2662775151",B),children:[m?e.jsxRuntimeExports.jsx(E,{variant:s,icon:m,className:n?"kakadu-components-136489413":void 0}):null,n?e.jsxRuntimeExports.jsx("div",{ref:y,className:"kakadu-components-207477259",children:n}):e.jsxRuntimeExports.jsx(K.default,{children:w}),x?e.jsxRuntimeExports.jsx(E,{variant:s,icon:x,className:n?"kakadu-components-3631501803":void 0}):null,e.jsxRuntimeExports.jsx(v,{isLoading:l}),A&&e.jsxRuntimeExports.jsx(F.default,{opacity:V?.5:.4,maximumGradientsCount:p,className:c.cx("kakadu-components-2055737617",s==="secondary"&&"kakadu-components-2972748387")}),W&&e.jsxRuntimeExports.jsx(O.default,{maximumStarsCount:k,className:"kakadu-components-1226008615"}),d?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(H.default,{size:n?void 0:50}),e.jsxRuntimeExports.jsx(f.default,{size:n?void 0:50,className:s==="secondary"?f.normalBlendStyles:void 0})]}),i?e.jsxRuntimeExports.jsx(J.default,{id:j,label:i,position:M}):null]}),u?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-3422055155",children:e.jsxRuntimeExports.jsx(U.SkeletonInstance,{width:"100%",height:"100%",isAnimated:D})}):null]})}exports.ButtonLoader=v;exports.buttonDangerStyles=g;exports.buttonSecondaryStyles=S;exports.buttonSuccessStyles=Y;exports.buttonVariants=X;exports.buttonWarningStyles=q;exports.default=Z;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),R=require("react"),c=require("@kuma-ui/core"),b=require("../theme.js"),$=require("../icons/icon.js"),C=require("./spinner.js"),F=require("./moving-gradients.js"),O=require("./moving-stars.js"),P=require("./theme-setter.js"),H=require("./click-ripples.js"),f=require("./hover-gradient.js"),J=require("./button-tooltip.js"),K=require("./aria-text.js"),Q=require("./atom.js"),U=require("./skeleton.js");function v({isLoading:t,size:a,className:s}){return e.jsxRuntimeExports.jsx("div",{className:c.cx("kakadu-components-2832510379",t&&"kakadu-components-4114685569",s),children:e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-920467642",children:e.jsxRuntimeExports.jsx(C.RevealSpinner,{isVisible:t,size:a})})})}const X=["primary","secondary","warning","danger"];function E({icon:t,variant:a="primary",className:s,...r}){return e.jsxRuntimeExports.jsx("div",{...r,className:c.cx("kakadu-components-2658660333",a==="secondary"&&"kakadu-components-3469662110",s),children:typeof t=="string"?e.jsxRuntimeExports.jsx($.default,{width:14,height:14,type:t}):t})}const S="kakadu-components-2550769169",Y="kakadu-components-1998774084",q="kakadu-components-2945752235",g="kakadu-components-1546692192";function Z({ref:t,type:a,variant:s="primary",href:r,target:h,rel:_,disabled:N,className:B,children:n,label:w,tooltip:i,tooltipPosition:M,iconLeft:m,iconRight:x,isLoading:l,isSkeleton:u,isSkeletonAnimated:D=!0,hasMovingGradients:I=!1,movingGradientsCount:p=4,hasMovingStars:T=!1,movingStarsCount:k=10,...G}){const j=R.useId(),y=R.useRef(null),V=P.useIsDarkMode(y),z=a??"button",A=I&&p>0,W=T&&k>0,o=r!==void 0&&!u,d=!!N||!!l||!!u;return e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-3559664923",children:[e.jsxRuntimeExports.jsxs(Q.default,{...G,reference:t,as:o?"a":"button",type:o?void 0:z,href:o?r:void 0,target:o?h:void 0,rel:o?_:void 0,"aria-describedby":i?j:void 0,disabled:o?void 0:d,inert:o?d:void 0,className:c.cx(b.effectStyles,b.overlayEffectStyles,"kakadu-components-2514848457",!!m&&"kakadu-components-2735110382",!n&&"kakadu-components-3621693630",s==="secondary"&&S,s==="warning"&&q,s==="danger"&&g,u&&"kakadu-components-2662775151",B),children:[m?e.jsxRuntimeExports.jsx(E,{variant:s,icon:m,className:n?"kakadu-components-136489413":void 0}):null,n?e.jsxRuntimeExports.jsx("div",{ref:y,className:"kakadu-components-207477259",children:n}):e.jsxRuntimeExports.jsx(K.default,{children:w}),x?e.jsxRuntimeExports.jsx(E,{variant:s,icon:x,className:n?"kakadu-components-3631501803":void 0}):null,e.jsxRuntimeExports.jsx(v,{isLoading:l}),A&&e.jsxRuntimeExports.jsx(F.default,{opacity:V?.5:.4,maximumGradientsCount:p,className:c.cx("kakadu-components-2055737617",s==="secondary"&&"kakadu-components-2972748387")}),W&&e.jsxRuntimeExports.jsx(O.default,{maximumStarsCount:k,className:"kakadu-components-1226008615"}),d?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(H.default,{size:n?void 0:50}),e.jsxRuntimeExports.jsx(f.default,{size:n?void 0:50,className:s==="secondary"?f.normalBlendStyles:void 0})]}),i?e.jsxRuntimeExports.jsx(J.default,{id:j,label:i,position:M}):null]}),u?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-3422055155",children:e.jsxRuntimeExports.jsx(U.SkeletonInstance,{width:"100%",height:"100%",isAnimated:D})}):null]})}exports.ButtonLoader=v;exports.buttonDangerStyles=g;exports.buttonSecondaryStyles=S;exports.buttonSuccessStyles=Y;exports.buttonVariants=X;exports.buttonWarningStyles=q;exports.default=Z;
|
|
@@ -54,7 +54,7 @@ function yo({
|
|
|
54
54
|
movingStarsCount: f = 10,
|
|
55
55
|
...M
|
|
56
56
|
}) {
|
|
57
|
-
const x = T(), y = z(null), A = q(y), D = a ?? "button", G = w && k > 0, R = I && f > 0, t = r && !m, u = !!N || !!p || !!m;
|
|
57
|
+
const x = T(), y = z(null), A = q(y), D = a ?? "button", G = w && k > 0, R = I && f > 0, t = r !== void 0 && !m, u = !!N || !!p || !!m;
|
|
58
58
|
return /* @__PURE__ */ o.jsxs("div", { className: "kakadu-components-3559664923", children: [
|
|
59
59
|
/* @__PURE__ */ o.jsxs(U, { ...M, reference: n, as: t ? "a" : "button", type: t ? void 0 : D, href: t ? r : void 0, target: t ? v : void 0, rel: t ? b : void 0, "aria-describedby": d ? x : void 0, disabled: t ? void 0 : u, inert: t ? u : void 0, className: c(C, E, "kakadu-components-2514848457", !!i && "kakadu-components-2735110382", !e && "kakadu-components-3621693630", s === "secondary" && Z, s === "warning" && _, s === "danger" && $, m && "kakadu-components-2662775151", g), children: [
|
|
60
60
|
i ? /* @__PURE__ */ o.jsx(j, { variant: s, icon: i, className: e ? "kakadu-components-136489413" : void 0 }) : null,
|
package/build/components/card.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),a=require("@kuma-ui/core"),f=require("../theme.js"),c=require("../icons/icon.js"),s=require("./flex.js"),n=require("./text.js"),k=require("./click-ripples.js"),i=require("./hover-gradient.js"),R=require("./button.js"),q=require("./atom.js");function E({ref:u,icon:o,title:l,description:d,action:m,href:r,target:x,rel:p,className:j,...h}){const t=r!==void 0;return e.jsxRuntimeExports.jsxs(q.default,{...h,reference:u,as:t?"a":"button",type:t?void 0:"button",href:t?r:void 0,target:t?x:void 0,rel:t?p:void 0,className:a.cx(f.effectStyles,R.buttonSecondaryStyles,"kakadu-components-1387630570",j),children:[e.jsxRuntimeExports.jsxs(s.default,{gap:.5,direction:"column",children:[e.jsxRuntimeExports.jsx(n.Span,{className:"kakadu-components-1301774894",children:e.jsxRuntimeExports.jsxs(s.default,{gap:.5,direction:"row",preset:"start",children:[o?e.jsxRuntimeExports.jsx(c.default,{width:16,height:16,type:o,className:a.cx(c.iconShadowStyles,"kakadu-components-782417605")}):null,l]})}),e.jsxRuntimeExports.jsx(n.Paragraph,{className:"kakadu-components-3061837309",children:d}),e.jsxRuntimeExports.jsx(s.default,{preset:"end",children:e.jsxRuntimeExports.jsx(n.Span,{className:"kakadu-components-777975485",children:m})})]}),e.jsxRuntimeExports.jsx(k.default,{size:250,className:"kakadu-components-2967167444"}),e.jsxRuntimeExports.jsx(i.default,{size:300,className:i.normalBlendStyles})]})}exports.default=E;
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { cx as
|
|
1
|
+
import { j as o } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
+
import { cx as a } from "@kuma-ui/core";
|
|
3
3
|
import { effectStyles as x } from "../theme.mjs";
|
|
4
|
-
import
|
|
4
|
+
import h, { iconShadowStyles as k } from "../icons/icon.mjs";
|
|
5
5
|
import s from "./flex.mjs";
|
|
6
|
-
import { Span as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { buttonSecondaryStyles as
|
|
6
|
+
import { Span as n, Paragraph as j } from "./text.mjs";
|
|
7
|
+
import y from "./click-ripples.mjs";
|
|
8
|
+
import N, { normalBlendStyles as S } from "./hover-gradient.mjs";
|
|
9
|
+
import { buttonSecondaryStyles as v } from "./button.mjs";
|
|
10
10
|
import g from "./atom.mjs";
|
|
11
|
-
function
|
|
12
|
-
ref:
|
|
13
|
-
icon:
|
|
14
|
-
title:
|
|
15
|
-
description:
|
|
16
|
-
action:
|
|
17
|
-
href:
|
|
18
|
-
target:
|
|
19
|
-
rel:
|
|
20
|
-
className:
|
|
11
|
+
function H({
|
|
12
|
+
ref: m,
|
|
13
|
+
icon: r,
|
|
14
|
+
title: i,
|
|
15
|
+
description: c,
|
|
16
|
+
action: d,
|
|
17
|
+
href: t,
|
|
18
|
+
target: l,
|
|
19
|
+
rel: p,
|
|
20
|
+
className: f,
|
|
21
21
|
...u
|
|
22
22
|
}) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
const e = t !== void 0;
|
|
24
|
+
return /* @__PURE__ */ o.jsxs(g, { ...u, reference: m, as: e ? "a" : "button", type: e ? void 0 : "button", href: e ? t : void 0, target: e ? l : void 0, rel: e ? p : void 0, className: a(x, v, "kakadu-components-1387630570", f), children: [
|
|
25
|
+
/* @__PURE__ */ o.jsxs(s, { gap: 0.5, direction: "column", children: [
|
|
26
|
+
/* @__PURE__ */ o.jsx(n, { className: "kakadu-components-1301774894", children: /* @__PURE__ */ o.jsxs(s, { gap: 0.5, direction: "row", preset: "start", children: [
|
|
27
|
+
r ? /* @__PURE__ */ o.jsx(h, { width: 16, height: 16, type: r, className: a(k, "kakadu-components-782417605") }) : null,
|
|
28
|
+
i
|
|
28
29
|
] }) }),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ o.jsx(j, { className: "kakadu-components-3061837309", children: c }),
|
|
31
|
+
/* @__PURE__ */ o.jsx(s, { preset: "end", children: /* @__PURE__ */ o.jsx(n, { className: "kakadu-components-777975485", children: d }) })
|
|
31
32
|
] }),
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ o.jsx(y, { size: 250, className: "kakadu-components-2967167444" }),
|
|
34
|
+
/* @__PURE__ */ o.jsx(N, { size: 300, className: S })
|
|
34
35
|
] });
|
|
35
36
|
}
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
H as default
|
|
38
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),t=require("react"),o=require("@kuma-ui/core"),d=require("../icons/icon.js"),p=require("../theme.js"),D=require("./theme-setter.js"),c=require("./button.js"),M=require("./button-tooltip.js"),z=require("./click-ripples.js"),E=require("./hover-gradient.js"),A=require("./skeleton.js"),C=require("./atom.js"),O=["default","success","warning","danger"];function V({ref:b,icon:s,variant:u="default",label:f,tooltipPosition:g,href:k,target:q,rel:w,disabled:_,isLoading:j,isSkeleton:r,isSkeletonAnimated:v=!0,className:B,...I}){const h=t.useId(),N=D.useIsDarkMode(),n=k&&!r,[a,T]=t.useState(s),[R,m]=t.useState(!1),S=t.useRef(s),i=t.useRef(null);t.useEffect(()=>{S.current=s},[s]);const l=t.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);t.useEffect(()=>{if(a===s){m(y=>y&&!1);return}m(!0),l(),i.current=setTimeout(()=>{m(!1),T(S.current)},370)},[a,s,l]),t.useEffect(()=>()=>{l()},[l]);const x=!!_||!!j||!!r;return e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-4096632152",children:[e.jsxRuntimeExports.jsxs(C.default,{...I,reference:b,as:n?"a":"button",type:n?void 0:"button",href:n?k:void 0,target:n?q:void 0,rel:n?w:void 0,"aria-label":f,"aria-describedby":h,disabled:n?void 0:x,inert:n?x:void 0,className:o.cx(p.buttonResetStyles,p.effectStyles,p.overlayEffectStyles,"kakadu-components-4200638658",u==="default"&&o.cx(c.buttonSecondaryStyles,"kakadu-components-1561784812"),u==="success"&&o.cx(c.buttonSuccessStyles,"kakadu-components-1398421429"),u==="warning"&&o.cx(c.buttonWarningStyles,"kakadu-components-1872098090"),u==="danger"&&o.cx(c.buttonDangerStyles,"kakadu-components-2064536093"),r&&"kakadu-components-2662775151",B),children:[e.jsxRuntimeExports.jsxs("span",{"data-theme":u==="default"?N?"dark":"light":"dark",className:"kakadu-components-3040141419",children:[e.jsxRuntimeExports.jsx(d.default,{width:16,height:16,type:a,className:o.cx(d.iconShadowStyles,"kakadu-components-1562914001",R&&"kakadu-components-2360250719")}),a===s?null:e.jsxRuntimeExports.jsx(d.default,{width:16,height:16,type:s,className:o.cx(d.iconShadowStyles,"kakadu-components-1224061930",R&&"kakadu-components-2519520784")})]}),e.jsxRuntimeExports.jsx(c.ButtonLoader,{isLoading:j,size:14}),e.jsxRuntimeExports.jsx(M.default,{id:h,label:f,position:g}),x?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(z.default,{size:50}),e.jsxRuntimeExports.jsx(E.default,{size:50,className:u==="default"?E.normalBlendStyles:void 0})]})]}),r?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-3422055155",children:e.jsxRuntimeExports.jsx(A.SkeletonInstance,{width:"100%",height:"100%",isAnimated:v})}):null]})}exports.default=V;exports.iconButtonVariants=O;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),t=require("react"),o=require("@kuma-ui/core"),d=require("../icons/icon.js"),p=require("../theme.js"),D=require("./theme-setter.js"),c=require("./button.js"),M=require("./button-tooltip.js"),z=require("./click-ripples.js"),E=require("./hover-gradient.js"),A=require("./skeleton.js"),C=require("./atom.js"),O=["default","success","warning","danger"];function V({ref:b,icon:s,variant:u="default",label:f,tooltipPosition:g,href:k,target:q,rel:w,disabled:_,isLoading:j,isSkeleton:r,isSkeletonAnimated:v=!0,className:B,...I}){const h=t.useId(),N=D.useIsDarkMode(),n=k!==void 0&&!r,[a,T]=t.useState(s),[R,m]=t.useState(!1),S=t.useRef(s),i=t.useRef(null);t.useEffect(()=>{S.current=s},[s]);const l=t.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);t.useEffect(()=>{if(a===s){m(y=>y&&!1);return}m(!0),l(),i.current=setTimeout(()=>{m(!1),T(S.current)},370)},[a,s,l]),t.useEffect(()=>()=>{l()},[l]);const x=!!_||!!j||!!r;return e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-4096632152",children:[e.jsxRuntimeExports.jsxs(C.default,{...I,reference:b,as:n?"a":"button",type:n?void 0:"button",href:n?k:void 0,target:n?q:void 0,rel:n?w:void 0,"aria-label":f,"aria-describedby":h,disabled:n?void 0:x,inert:n?x:void 0,className:o.cx(p.buttonResetStyles,p.effectStyles,p.overlayEffectStyles,"kakadu-components-4200638658",u==="default"&&o.cx(c.buttonSecondaryStyles,"kakadu-components-1561784812"),u==="success"&&o.cx(c.buttonSuccessStyles,"kakadu-components-1398421429"),u==="warning"&&o.cx(c.buttonWarningStyles,"kakadu-components-1872098090"),u==="danger"&&o.cx(c.buttonDangerStyles,"kakadu-components-2064536093"),r&&"kakadu-components-2662775151",B),children:[e.jsxRuntimeExports.jsxs("span",{"data-theme":u==="default"?N?"dark":"light":"dark",className:"kakadu-components-3040141419",children:[e.jsxRuntimeExports.jsx(d.default,{width:16,height:16,type:a,className:o.cx(d.iconShadowStyles,"kakadu-components-1562914001",R&&"kakadu-components-2360250719")}),a===s?null:e.jsxRuntimeExports.jsx(d.default,{width:16,height:16,type:s,className:o.cx(d.iconShadowStyles,"kakadu-components-1224061930",R&&"kakadu-components-2519520784")})]}),e.jsxRuntimeExports.jsx(c.ButtonLoader,{isLoading:j,size:14}),e.jsxRuntimeExports.jsx(M.default,{id:h,label:f,position:g}),x?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(z.default,{size:50}),e.jsxRuntimeExports.jsx(E.default,{size:50,className:u==="default"?E.normalBlendStyles:void 0})]})]}),r?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-3422055155",children:e.jsxRuntimeExports.jsx(A.SkeletonInstance,{width:"100%",height:"100%",isAnimated:v})}):null]})}exports.default=V;exports.iconButtonVariants=O;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useId as C, useState as j, useRef as g, useEffect as
|
|
2
|
+
import { useId as C, useState as j, useRef as g, useEffect as l, useCallback as E } from "react";
|
|
3
3
|
import { cx as s } from "@kuma-ui/core";
|
|
4
4
|
import S, { iconShadowStyles as b } from "../icons/icon.mjs";
|
|
5
5
|
import { buttonResetStyles as M, effectStyles as F, overlayEffectStyles as G } from "../theme.mjs";
|
|
@@ -19,22 +19,22 @@ function ie({
|
|
|
19
19
|
tooltipPosition: B,
|
|
20
20
|
href: p,
|
|
21
21
|
target: I,
|
|
22
|
-
rel:
|
|
23
|
-
disabled:
|
|
22
|
+
rel: v,
|
|
23
|
+
disabled: N,
|
|
24
24
|
isLoading: f,
|
|
25
25
|
isSkeleton: a,
|
|
26
26
|
isSkeletonAnimated: R = !0,
|
|
27
27
|
className: D,
|
|
28
28
|
...T
|
|
29
29
|
}) {
|
|
30
|
-
const k = C(), z = H(), o = p && !a, [r, A] = j(t), [h, i] = j(!1), x = g(t), c = g(null);
|
|
31
|
-
|
|
30
|
+
const k = C(), z = H(), o = p !== void 0 && !a, [r, A] = j(t), [h, i] = j(!1), x = g(t), c = g(null);
|
|
31
|
+
l(() => {
|
|
32
32
|
x.current = t;
|
|
33
33
|
}, [t]);
|
|
34
34
|
const u = E(() => {
|
|
35
35
|
c.current && (clearTimeout(c.current), c.current = null);
|
|
36
36
|
}, []);
|
|
37
|
-
|
|
37
|
+
l(() => {
|
|
38
38
|
if (r === t) {
|
|
39
39
|
i((y) => y && !1);
|
|
40
40
|
return;
|
|
@@ -42,19 +42,19 @@ function ie({
|
|
|
42
42
|
i(!0), u(), c.current = setTimeout(() => {
|
|
43
43
|
i(!1), A(x.current);
|
|
44
44
|
}, 370);
|
|
45
|
-
}, [r, t, u]),
|
|
45
|
+
}, [r, t, u]), l(() => () => {
|
|
46
46
|
u();
|
|
47
47
|
}, [u]);
|
|
48
|
-
const
|
|
48
|
+
const d = !!N || !!f || !!a;
|
|
49
49
|
return /* @__PURE__ */ e.jsxs("div", { className: "kakadu-components-4096632152", children: [
|
|
50
|
-
/* @__PURE__ */ e.jsxs(X, { ...T, reference: w, as: o ? "a" : "button", type: o ? void 0 : "button", href: o ? p : void 0, target: o ? I : void 0, rel: o ?
|
|
50
|
+
/* @__PURE__ */ e.jsxs(X, { ...T, reference: w, as: o ? "a" : "button", type: o ? void 0 : "button", href: o ? p : void 0, target: o ? I : void 0, rel: o ? v : void 0, "aria-label": m, "aria-describedby": k, disabled: o ? void 0 : d, inert: o ? d : void 0, className: s(M, F, G, "kakadu-components-4200638658", n === "default" && s(V, "kakadu-components-1561784812"), n === "success" && s(W, "kakadu-components-1398421429"), n === "warning" && s(q, "kakadu-components-1872098090"), n === "danger" && s(J, "kakadu-components-2064536093"), a && "kakadu-components-2662775151", D), children: [
|
|
51
51
|
/* @__PURE__ */ e.jsxs("span", { "data-theme": n === "default" ? z ? "dark" : "light" : "dark", className: "kakadu-components-3040141419", children: [
|
|
52
52
|
/* @__PURE__ */ e.jsx(S, { width: 16, height: 16, type: r, className: s(b, "kakadu-components-1562914001", h && "kakadu-components-2360250719") }),
|
|
53
53
|
r === t ? null : /* @__PURE__ */ e.jsx(S, { width: 16, height: 16, type: t, className: s(b, "kakadu-components-1224061930", h && "kakadu-components-2519520784") })
|
|
54
54
|
] }),
|
|
55
55
|
/* @__PURE__ */ e.jsx(O, { isLoading: f, size: 14 }),
|
|
56
56
|
/* @__PURE__ */ e.jsx(K, { id: k, label: m, position: B }),
|
|
57
|
-
|
|
57
|
+
d ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
58
58
|
/* @__PURE__ */ e.jsx(L, { size: 50 }),
|
|
59
59
|
/* @__PURE__ */ e.jsx(P, { size: 50, className: n === "default" ? Q : void 0 })
|
|
60
60
|
] })
|
|
@@ -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 V=require("../jsx-runtime-BB_1_6y_.js"),s=require("react"),L=require("@kuma-ui/core"),O=require("../hooks/use-is-in-view.js"),T=require("../hooks/use-is-document-focused.js"),B=["rgb(46, 75, 164)","rgb(58, 125, 159)","rgb(42, 81, 142)","rgb(48, 132, 168)","rgb(45, 64, 157)"];function J(S){return S.map(C=>{var n;const[m,b,X]=((n=C.match(/\d+/g))==null?void 0:n.map(Number))??[];return[m,b,X]})}function K({className:S,colors:C=B,maximumGradientsCount:m=10,speed:b=1,opacity:X=.2}){const n=s.useRef(null),[h,E]=s.useState(),[g,$]=s.useState(0),[p,z]=s.useState(0),q=s.useMemo(()=>J(C),[C]),A=s.useMemo(()=>q.length,[q]),Y=s.useCallback(()=>{const f=Math.random(),y=q[Math.floor(A*f)],r=g*1.25,M=g*.25,v=p*1.25,e=p*.25,t=r*Math.random()-M,o=v*Math.random()-e,i=Math.max(r,v);return{color:y,size:i*f+i/2,opacity:0,speed:Math.max(.1,f/2*b),startPosition:[t,o],currentPosition:[t,o],targetPosition:[r*Math.random()-M,v*Math.random()-e]}},[q,A,g,p,b]),H=O.default(n),W=T.default(),F=s.useRef(!1);return F.current=!H||!W,s.useEffect(()=>{const a=Array.from({length:m}).map(()=>Y());let f=m,y=!1,r;function M(){if(!y){if(!h||F.current){r=requestAnimationFrame(M);return}h.clearRect(0,0,g,p);for(let e=a.length;e;e-=1){const t=a[e-1],[o,i]=t.startPosition,[c,u]=t.currentPosition,[l,d]=t.targetPosition;let x=!0;if(o>l?c>l&&(x=!1):c<l&&(x=!1),i>d?u>d&&(x=!1):u<d&&(x=!1),x){a.splice(e-1,1),f-=1;continue}const _=(o+l)/2-o,D=c-o,G=(i+d)/2-i,N=u-i,R=(D/_+N/G)/2;t.opacity=R>1?2-R:R;const j=t.size/2,I=h.createRadialGradient(c,u,j,c,u,0);if(I.addColorStop(0,`rgba(${t.color.join(",")},0)`),I.addColorStop(1,`rgba(${t.color.join(",")},${t.opacity})`),h.fillStyle=I,h.fillRect(c-j,u-j,t.size,t.size),c!==l){const k=Math.abs(o-l),w=Math.abs(i-d),P=Math.min(1,k/w);c<l?t.currentPosition[0]+=t.speed*P:t.currentPosition[0]-=t.speed*P}if(u!==d){const k=Math.abs(o-l),w=Math.abs(i-d),P=Math.min(1,w/k);u<d?t.currentPosition[1]+=t.speed*P:t.currentPosition[1]-=t.speed*P}}r=requestAnimationFrame(M)}}r=requestAnimationFrame(M);const v=setInterval(()=>{if(F.current)return;let e=m-f;if(e>0)for(;e;)a.push(Y()),e-=1,f+=1},1500);return()=>{y=!0,r&&cancelAnimationFrame(r),clearInterval(v)}},[m,Y,h,g,p,b]),s.useEffect(()=>{if(n.current){const a=n.current.getContext("2d");a&&E(a),$(n.current.offsetWidth),z(n.current.offsetHeight)}},[n]),V.jsxRuntimeExports.jsx("canvas",{ref:n,"aria-hidden":!0,role:"presentation",width:g,height:p,style:{"--opacity":X},className:L.cx("kakadu-components-4131181690",S)})}exports.default=K;
|
|
@@ -1,62 +1,64 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { cx as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { j as K } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
+
import { useRef as H, useState as z, useMemo as S, useCallback as O, useEffect as W } from "react";
|
|
3
|
+
import { cx as Q } from "@kuma-ui/core";
|
|
4
|
+
import T from "../hooks/use-is-in-view.mjs";
|
|
5
|
+
import U from "../hooks/use-is-document-focused.mjs";
|
|
6
|
+
const Z = ["rgb(46, 75, 164)", "rgb(58, 125, 159)", "rgb(42, 81, 142)", "rgb(48, 132, 168)", "rgb(45, 64, 157)"];
|
|
7
|
+
function _(X) {
|
|
8
|
+
return X.map((P) => {
|
|
7
9
|
var n;
|
|
8
|
-
const [f, M, Y] = ((n =
|
|
10
|
+
const [f, M, Y] = ((n = P.match(/\d+/g)) == null ? void 0 : n.map(Number)) ?? [];
|
|
9
11
|
return [f, M, Y];
|
|
10
12
|
});
|
|
11
13
|
}
|
|
12
|
-
function
|
|
14
|
+
function st({
|
|
13
15
|
className: X,
|
|
14
|
-
colors:
|
|
16
|
+
colors: P = Z,
|
|
15
17
|
maximumGradientsCount: f = 10,
|
|
16
18
|
speed: M = 1,
|
|
17
19
|
opacity: Y = 0.2
|
|
18
20
|
}) {
|
|
19
|
-
const n =
|
|
20
|
-
const
|
|
21
|
+
const n = H(null), [m, k] = z(), [h, D] = z(0), [p, $] = z(0), C = S(() => _(P), [P]), E = S(() => C.length, [C]), F = O(() => {
|
|
22
|
+
const d = Math.random(), y = C[Math.floor(E * d)], o = h * 1.25, g = h * 0.25, b = p * 1.25, e = p * 0.25, t = o * Math.random() - g, r = b * Math.random() - e, s = Math.max(o, b);
|
|
21
23
|
return {
|
|
22
24
|
color: y,
|
|
23
|
-
size: s *
|
|
25
|
+
size: s * d + s / 2,
|
|
24
26
|
opacity: 0,
|
|
25
|
-
speed: Math.max(0.1,
|
|
27
|
+
speed: Math.max(0.1, d / 2 * M),
|
|
26
28
|
startPosition: [t, r],
|
|
27
29
|
currentPosition: [t, r],
|
|
28
30
|
targetPosition: [o * Math.random() - g, b * Math.random() - e]
|
|
29
31
|
};
|
|
30
|
-
}, [
|
|
31
|
-
return W(() => {
|
|
32
|
+
}, [C, E, h, p, M]), G = T(n), N = U(), I = H(!1);
|
|
33
|
+
return I.current = !G || !N, W(() => {
|
|
32
34
|
const i = Array.from({
|
|
33
35
|
length: f
|
|
34
|
-
}).map(() =>
|
|
35
|
-
let
|
|
36
|
+
}).map(() => F());
|
|
37
|
+
let d = f, y = !1, o;
|
|
36
38
|
function g() {
|
|
37
39
|
if (!y) {
|
|
38
|
-
if (!m) {
|
|
40
|
+
if (!m || I.current) {
|
|
39
41
|
o = requestAnimationFrame(g);
|
|
40
42
|
return;
|
|
41
43
|
}
|
|
42
44
|
m.clearRect(0, 0, h, p);
|
|
43
45
|
for (let e = i.length; e; e -= 1) {
|
|
44
|
-
const t = i[e - 1], [r, s] = t.startPosition, [a, c] = t.currentPosition, [l,
|
|
46
|
+
const t = i[e - 1], [r, s] = t.startPosition, [a, c] = t.currentPosition, [l, u] = t.targetPosition;
|
|
45
47
|
let v = !0;
|
|
46
|
-
if (r > l ? a > l && (v = !1) : a < l && (v = !1), s >
|
|
47
|
-
i.splice(e - 1, 1),
|
|
48
|
+
if (r > l ? a > l && (v = !1) : a < l && (v = !1), s > u ? c > u && (v = !1) : c < u && (v = !1), v) {
|
|
49
|
+
i.splice(e - 1, 1), d -= 1;
|
|
48
50
|
continue;
|
|
49
51
|
}
|
|
50
|
-
const
|
|
51
|
-
t.opacity =
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
const
|
|
52
|
+
const V = (r + l) / 2 - r, L = a - r, B = (s + u) / 2 - s, J = c - s, j = (L / V + J / B) / 2;
|
|
53
|
+
t.opacity = j > 1 ? 2 - j : j;
|
|
54
|
+
const q = t.size / 2, w = m.createRadialGradient(a, c, q, a, c, 0);
|
|
55
|
+
if (w.addColorStop(0, `rgba(${t.color.join(",")},0)`), w.addColorStop(1, `rgba(${t.color.join(",")},${t.opacity})`), m.fillStyle = w, m.fillRect(a - q, c - q, t.size, t.size), a !== l) {
|
|
56
|
+
const A = Math.abs(r - l), R = Math.abs(s - u), x = Math.min(1, A / R);
|
|
55
57
|
a < l ? t.currentPosition[0] += t.speed * x : t.currentPosition[0] -= t.speed * x;
|
|
56
58
|
}
|
|
57
|
-
if (c !==
|
|
58
|
-
const
|
|
59
|
-
c <
|
|
59
|
+
if (c !== u) {
|
|
60
|
+
const A = Math.abs(r - l), R = Math.abs(s - u), x = Math.min(1, R / A);
|
|
61
|
+
c < u ? t.currentPosition[1] += t.speed * x : t.currentPosition[1] -= t.speed * x;
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
o = requestAnimationFrame(g);
|
|
@@ -64,23 +66,25 @@ function Z({
|
|
|
64
66
|
}
|
|
65
67
|
o = requestAnimationFrame(g);
|
|
66
68
|
const b = setInterval(() => {
|
|
67
|
-
|
|
69
|
+
if (I.current)
|
|
70
|
+
return;
|
|
71
|
+
let e = f - d;
|
|
68
72
|
if (e > 0)
|
|
69
73
|
for (; e; )
|
|
70
|
-
i.push(
|
|
74
|
+
i.push(F()), e -= 1, d += 1;
|
|
71
75
|
}, 1500);
|
|
72
76
|
return () => {
|
|
73
77
|
y = !0, o && cancelAnimationFrame(o), clearInterval(b);
|
|
74
78
|
};
|
|
75
|
-
}, [f,
|
|
79
|
+
}, [f, F, m, h, p, M]), W(() => {
|
|
76
80
|
if (n.current) {
|
|
77
81
|
const i = n.current.getContext("2d");
|
|
78
|
-
i && k(i),
|
|
82
|
+
i && k(i), D(n.current.offsetWidth), $(n.current.offsetHeight);
|
|
79
83
|
}
|
|
80
|
-
}, [n]), /* @__PURE__ */
|
|
84
|
+
}, [n]), /* @__PURE__ */ K.jsx("canvas", { ref: n, "aria-hidden": !0, role: "presentation", width: h, height: p, style: {
|
|
81
85
|
"--opacity": Y
|
|
82
|
-
}, className:
|
|
86
|
+
}, className: Q("kakadu-components-4131181690", X) });
|
|
83
87
|
}
|
|
84
88
|
export {
|
|
85
|
-
|
|
89
|
+
st as default
|
|
86
90
|
};
|
|
@@ -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 T=require("../jsx-runtime-BB_1_6y_.js"),r=require("react"),B=require("@kuma-ui/core"),G=require("../hooks/use-is-in-view.js"),J=require("../hooks/use-is-document-focused.js");function K({color:q,opacity:H,className:W,minimumSize:I=1,maximumSize:A=5,maximumStarsCount:x=50,speed:w=1,hasMask:j=!1}){const e=r.useRef(null),[o,_]=r.useState(),[f,R]=r.useState(0),[d,S]=r.useState(0),y=r.useCallback(()=>{const n=f*1.5,s=f*.25,a=d*1.5,i=d*.25,M=n*Math.random()-s,h=a*Math.random()-i;return{size:Math.max(I,A*Math.random()),opacity:0,speed:Math.max(.1,Math.random()/2*w),startPosition:[M,h],currentPosition:[M,h],targetPosition:[n*Math.random()-s,a*Math.random()-i]}},[f,d,I,A,w]),C=r.useCallback(()=>q??(e.current?getComputedStyle(e.current).color:"#000"),[q,e]),z=G.default(e),D=J.default(),k=r.useRef(!1);return k.current=!z||!D,r.useEffect(()=>{const n=Array.from({length:x}).map(()=>y());let s=x,a=!1,i,M=C();function h(){if(!a){if(!o||k.current){i=requestAnimationFrame(h);return}o.clearRect(0,0,f,d);for(let c=n.length;c;c-=1){const t=n[c-1],[v,p]=t.startPosition,[g,m]=t.currentPosition,[u,l]=t.targetPosition;let P=!0;if(v>u?g>u&&(P=!1):g<u&&(P=!1),p>l?m>l&&(P=!1):m<l&&(P=!1),P){n.splice(c-1,1),s-=1;continue}const O=(v+u)/2-v,V=g-v,$=(p+l)/2-p,N=m-p,X=(V/O+N/$)/2;t.opacity=X>1?2-X:X;const Y=t.size/2;if(o.beginPath(),o.arc(g-Y,m-Y,Y,0,2*Math.PI,!1),o.globalAlpha=t.opacity,o.fillStyle=M,o.fill(),g!==u){const E=Math.abs(v-u),F=Math.abs(p-l),b=Math.min(1,E/F);g<u?t.currentPosition[0]+=t.speed*b:t.currentPosition[0]-=t.speed*b}if(m!==l){const E=Math.abs(v-u),F=Math.abs(p-l),b=Math.min(1,F/E);m<l?t.currentPosition[1]+=t.speed*b:t.currentPosition[1]-=t.speed*b}}i=requestAnimationFrame(h)}}i=requestAnimationFrame(h);const L=setInterval(()=>{if(k.current)return;M=C();let c=x-s;if(c>0)for(;c;)n.push(y()),c-=1,s+=1},500);return()=>{a=!0,i&&cancelAnimationFrame(i),clearInterval(L)}},[x,y,C,o,f,d,w]),r.useEffect(()=>{if(e.current){const n=e.current.getContext("2d");n&&_(n),R(e.current.offsetWidth),S(e.current.offsetHeight);const s=()=>{e.current&&(R(e.current.offsetWidth),S(e.current.offsetHeight))},a=new ResizeObserver(s);return a.observe(e.current),window.addEventListener("resize",s,{passive:!0}),()=>{a.disconnect(),window.removeEventListener("resize",s)}}},[e]),T.jsxRuntimeExports.jsx("canvas",{ref:e,"aria-hidden":!0,role:"presentation",style:{"--color":q,"--opacity":H},className:B.cx("kakadu-components-3366903902",j&&"kakadu-components-4049648322",W),width:f,height:d})}exports.default=K;
|
|
@@ -1,90 +1,94 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { cx as
|
|
4
|
-
|
|
1
|
+
import { j as T } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
+
import { useRef as R, useState as E, useCallback as j, useEffect as z } from "react";
|
|
3
|
+
import { cx as U } from "@kuma-ui/core";
|
|
4
|
+
import Z from "../hooks/use-is-in-view.mjs";
|
|
5
|
+
import _ from "../hooks/use-is-document-focused.mjs";
|
|
6
|
+
function st({
|
|
5
7
|
color: b,
|
|
6
|
-
opacity:
|
|
7
|
-
className:
|
|
8
|
-
minimumSize:
|
|
9
|
-
maximumSize:
|
|
8
|
+
opacity: D,
|
|
9
|
+
className: L,
|
|
10
|
+
minimumSize: k = 1,
|
|
11
|
+
maximumSize: q = 5,
|
|
10
12
|
maximumStarsCount: x = 50,
|
|
11
|
-
speed:
|
|
12
|
-
hasMask:
|
|
13
|
+
speed: w = 1,
|
|
14
|
+
hasMask: S = !1
|
|
13
15
|
}) {
|
|
14
|
-
const
|
|
15
|
-
const n =
|
|
16
|
+
const t = R(null), [s, V] = E(), [u, H] = E(0), [f, W] = E(0), y = j(() => {
|
|
17
|
+
const n = u * 1.5, r = u * 0.25, o = f * 1.5, i = f * 0.25, g = n * Math.random() - r, d = o * Math.random() - i;
|
|
16
18
|
return {
|
|
17
|
-
size: Math.max(
|
|
19
|
+
size: Math.max(k, q * Math.random()),
|
|
18
20
|
opacity: 0,
|
|
19
|
-
speed: Math.max(0.1, Math.random() / 2 *
|
|
21
|
+
speed: Math.max(0.1, Math.random() / 2 * w),
|
|
20
22
|
startPosition: [g, d],
|
|
21
23
|
currentPosition: [g, d],
|
|
22
|
-
targetPosition: [n * Math.random() - r, o * Math.random() -
|
|
24
|
+
targetPosition: [n * Math.random() - r, o * Math.random() - i]
|
|
23
25
|
};
|
|
24
|
-
}, [f,
|
|
25
|
-
return
|
|
26
|
+
}, [u, f, k, q, w]), C = j(() => b ?? (t.current ? getComputedStyle(t.current).color : "#000"), [b, t]), N = Z(t), O = _(), X = R(!1);
|
|
27
|
+
return X.current = !N || !O, z(() => {
|
|
26
28
|
const n = Array.from({
|
|
27
29
|
length: x
|
|
28
|
-
}).map(() =>
|
|
29
|
-
let r = x, o = !1,
|
|
30
|
+
}).map(() => y());
|
|
31
|
+
let r = x, o = !1, i, g = C();
|
|
30
32
|
function d() {
|
|
31
33
|
if (!o) {
|
|
32
|
-
if (!s) {
|
|
33
|
-
|
|
34
|
+
if (!s || X.current) {
|
|
35
|
+
i = requestAnimationFrame(d);
|
|
34
36
|
return;
|
|
35
37
|
}
|
|
36
|
-
s.clearRect(0, 0,
|
|
37
|
-
for (let
|
|
38
|
-
const
|
|
38
|
+
s.clearRect(0, 0, u, f);
|
|
39
|
+
for (let a = n.length; a; a -= 1) {
|
|
40
|
+
const e = n[a - 1], [h, m] = e.startPosition, [p, v] = e.currentPosition, [c, l] = e.targetPosition;
|
|
39
41
|
let M = !0;
|
|
40
|
-
if (h > c ?
|
|
41
|
-
n.splice(
|
|
42
|
+
if (h > c ? p > c && (M = !1) : p < c && (M = !1), m > l ? v > l && (M = !1) : v < l && (M = !1), M) {
|
|
43
|
+
n.splice(a - 1, 1), r -= 1;
|
|
42
44
|
continue;
|
|
43
45
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
if (s.beginPath(), s.arc(
|
|
48
|
-
const
|
|
49
|
-
|
|
46
|
+
const G = (h + c) / 2 - h, J = p - h, K = (m + l) / 2 - m, Q = v - m, Y = (J / G + Q / K) / 2;
|
|
47
|
+
e.opacity = Y > 1 ? 2 - Y : Y;
|
|
48
|
+
const F = e.size / 2;
|
|
49
|
+
if (s.beginPath(), s.arc(p - F, v - F, F, 0, 2 * Math.PI, !1), s.globalAlpha = e.opacity, s.fillStyle = g, s.fill(), p !== c) {
|
|
50
|
+
const I = Math.abs(h - c), A = Math.abs(m - l), P = Math.min(1, I / A);
|
|
51
|
+
p < c ? e.currentPosition[0] += e.speed * P : e.currentPosition[0] -= e.speed * P;
|
|
50
52
|
}
|
|
51
53
|
if (v !== l) {
|
|
52
|
-
const
|
|
53
|
-
v < l ?
|
|
54
|
+
const I = Math.abs(h - c), A = Math.abs(m - l), P = Math.min(1, A / I);
|
|
55
|
+
v < l ? e.currentPosition[1] += e.speed * P : e.currentPosition[1] -= e.speed * P;
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
|
-
|
|
58
|
+
i = requestAnimationFrame(d);
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
i = requestAnimationFrame(d);
|
|
62
|
+
const B = setInterval(() => {
|
|
63
|
+
if (X.current)
|
|
64
|
+
return;
|
|
65
|
+
g = C();
|
|
66
|
+
let a = x - r;
|
|
67
|
+
if (a > 0)
|
|
68
|
+
for (; a; )
|
|
69
|
+
n.push(y()), a -= 1, r += 1;
|
|
66
70
|
}, 500);
|
|
67
71
|
return () => {
|
|
68
|
-
o = !0,
|
|
72
|
+
o = !0, i && cancelAnimationFrame(i), clearInterval(B);
|
|
69
73
|
};
|
|
70
|
-
}, [x,
|
|
71
|
-
if (
|
|
72
|
-
const n =
|
|
73
|
-
n &&
|
|
74
|
+
}, [x, y, C, s, u, f, w]), z(() => {
|
|
75
|
+
if (t.current) {
|
|
76
|
+
const n = t.current.getContext("2d");
|
|
77
|
+
n && V(n), H(t.current.offsetWidth), W(t.current.offsetHeight);
|
|
74
78
|
const r = () => {
|
|
75
|
-
|
|
79
|
+
t.current && (H(t.current.offsetWidth), W(t.current.offsetHeight));
|
|
76
80
|
}, o = new ResizeObserver(r);
|
|
77
|
-
return o.observe(
|
|
81
|
+
return o.observe(t.current), window.addEventListener("resize", r, {
|
|
78
82
|
passive: !0
|
|
79
83
|
}), () => {
|
|
80
84
|
o.disconnect(), window.removeEventListener("resize", r);
|
|
81
85
|
};
|
|
82
86
|
}
|
|
83
|
-
}, [
|
|
87
|
+
}, [t]), /* @__PURE__ */ T.jsx("canvas", { ref: t, "aria-hidden": !0, role: "presentation", style: {
|
|
84
88
|
"--color": b,
|
|
85
|
-
"--opacity":
|
|
86
|
-
}, className:
|
|
89
|
+
"--opacity": D
|
|
90
|
+
}, className: U("kakadu-components-3366903902", S && "kakadu-components-4049648322", L), width: u, height: f });
|
|
87
91
|
}
|
|
88
92
|
export {
|
|
89
|
-
|
|
93
|
+
st as default
|
|
90
94
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),w=require("@kuma-ui/core"),i=require("react"),z=require("../theme.js"),q=require("../icons/icon.js"),A=require("../hooks/use-synchronized-value.js"),R=require("./popover.js"),F=require("./atom.js"),S=require("./text.js"),I=require("./hover-gradient.js"),V=require("./click-ripples.js"),B=require("./separator.js"),T=require("./decorators.js"),N=require("./spinner.js"),_=require("./skeleton.js");function C(){const{value:e,setValue:s}=A.default("isKeyboardNavigating");return i.useMemo(()=>({isKeyboardNavigating:e,setIsKeyboardNavigating:s}),[e,s])}const H="kakadu-components-949294122";function $({isLoading:e,isDisabled:s,label:c,iconLeft:x,iconRight:u,href:m,target:b,shouldCloseOnClick:o=!0,decorators:a=[],submenu:l,className:d,onClick:r,...v}){const{isVisible:y,isPreparingFocus:h,isFocused:n,close:k}=R.usePopoverContext(),{isKeyboardNavigating:j}=C(),f=i.useRef(!0),M=i.useCallback(()=>{f.current=n},[n]),P=i.useCallback(K=>{!j&&!f.current||n&&(r==null||r(K),l?l.show():o&&(k==null||k()))},[j,n,r,l,o,k]),p=!y&&!h||!!e||!!s,E=m!==void 0&&!e,g=i.useMemo(()=>t.jsxRuntimeExports.jsxs(F.default,{as:E?"a":"button",...v,"aria-disabled":E&&p?!0:void 0,type:E?void 0:"button",role:"menuitem",href:e?void 0:m,target:E?b:void 0,inert:E?p:void 0,disabled:E?void 0:p,className:w.cx(z.buttonResetStyles,"kakadu-components-1772835671",n&&"kakadu-components-3160069815",j?"kakadu-components-2254977234":n&&!p&&"kakadu-components-278139688",p&&"kakadu-components-1879666195",d),onClick:p?void 0:P,onPointerDownCapture:p?void 0:M,children:[t.jsxRuntimeExports.jsxs(S.Span,{className:w.cx("kakadu-components-1377252111",e?"kakadu-components-2409458488":p&&"kakadu-components-532828420"),children:[x?e?t.jsxRuntimeExports.jsx(N.default,{size:12}):t.jsxRuntimeExports.jsx(q.default,{width:12,height:12,type:x}):null,t.jsxRuntimeExports.jsxs("span",{className:w.cx("kakadu-components-1590676894",e&&"kakadu-components-743909038"),children:[e?t.jsxRuntimeExports.jsx(_.SkeletonInstance,{"aria-hidden":!0,width:"100%",className:"kakadu-components-3950955262"}):null,t.jsxRuntimeExports.jsx("span",{className:e?"kakadu-components-543569100":void 0,children:c})]}),u?e?x?t.jsxRuntimeExports.jsx(_.SkeletonInstance,{width:12,height:12}):t.jsxRuntimeExports.jsx(N.default,{size:12}):t.jsxRuntimeExports.jsx(q.default,{width:12,height:12,type:u}):null]}),j||p?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(V.default,{isActive:n,size:100}),t.jsxRuntimeExports.jsx(I.default,{isActive:n,size:150,className:I.normalBlendStyles})]})]}),[E,v,p,m,e,b,d,n,j,P,M,x,c,u]);return t.jsxRuntimeExports.jsx(T.default,{decorators:a,children:l?t.jsxRuntimeExports.jsx(D,{menu:l.popoverMenu,className:"kakadu-components-1861176543",children:g}):g})}function G(e){if("type"in e){if(e.type==="separator")return t.jsxRuntimeExports.jsx(B.default,{});if(e.type==="group")return t.jsxRuntimeExports.jsx(S.Span,{className:"kakadu-components-1499037363",children:e.label})}return t.jsxRuntimeExports.jsx($,{...e})}function O({items:e}){const{isFocused:s}=R.usePopoverContext(),[c,x]=i.useState([]),{setIsKeyboardNavigating:u}=C(),m=i.useCallback(o=>{o&&x(a=>a.includes(o)?a:[...a,o])},[]),b=i.useCallback(o=>{s&&(o.currentTarget.focus(),u(!1))},[s,u]);return i.useEffect(()=>{if(!s)return;const o=a=>{const l=c.filter(n=>n.isConnected),d=l.length;if(d===0)return;let r,v=1;const y=document.activeElement;let h=y?l.indexOf(y):-1;switch(h===-1&&(h=0),a.key){case"ArrowUp":v=-1;case"ArrowDown":{r=(h+v+d)%d;break}case"Home":{r=0;break}case"End":{r=d-1,v=-1;break}case"Tab":{u(!0);return}}if(r!==void 0){a.preventDefault(),a.stopPropagation();let n=l[r];if(n){let k=0;const j=f=>"disabled"in f&&f.disabled||"inert"in f&&f.inert;for(;j(n)&&k<d;)r=(r+v+d)%d,n=l[r],k+=1;n&&!j(n)&&(n.focus(),u(!0))}}};return window.addEventListener("keydown",o,{capture:!0}),()=>{window.removeEventListener("keydown",o,{capture:!0})}},[s,c,u]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e.map((o,a)=>t.jsxRuntimeExports.jsx(G,{...o,reference:m,onMouseEnter:b},a))})}function U({items:e,...s}){return t.jsxRuntimeExports.jsx(R.default,{...s,as:"nav",role:"menu",innerClassName:"kakadu-components-3600436535",children:t.jsxRuntimeExports.jsx(O,{items:e})})}function J(e){const s=i.useMemo(()=>({items:e}),[e]),{isVisible:c,show:x,close:u,popover:m}=R.usePopover(U,s);return i.useMemo(()=>({isVisible:c,show:x,close:u,popoverMenu:m}),[c,x,u,m])}function D({menu:e,className:s,children:c}){return t.jsxRuntimeExports.jsxs(R.PopoverContainer,{className:s,children:[c,e]})}exports.dangerPopoverMenuItemStyles=H;exports.default=D;exports.usePopoverMenu=J;
|