@kakadu/components 3.3.0 → 3.5.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/button.d.ts +2 -1
- package/build/components/button.js +1 -1
- package/build/components/button.mjs +46 -45
- 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/icon-button.d.ts +2 -1
- package/build/components/icon-button.js +1 -1
- package/build/components/icon-button.mjs +19 -18
- package/build/components/popover-menu.js +1 -1
- package/build/components/popover-menu.mjs +26 -26
- package/build/components/text-button.d.ts +2 -1
- package/build/components/text-button.js +1 -1
- package/build/components/text-button.mjs +26 -25
- 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,
|
|
@@ -24,6 +24,7 @@ type BaseButtonProperties = Omit<HTMLProps<HTMLButtonElement>, 'children'> & {
|
|
|
24
24
|
readonly iconRight?: IconType | ReactNode;
|
|
25
25
|
readonly isLoading?: boolean;
|
|
26
26
|
readonly isSkeleton?: boolean;
|
|
27
|
+
readonly isSkeletonAnimated?: boolean;
|
|
27
28
|
readonly hasMovingGradients?: boolean;
|
|
28
29
|
readonly movingGradientsCount?: number;
|
|
29
30
|
readonly hasMovingStars?: boolean;
|
|
@@ -36,5 +37,5 @@ export type ButtonProperties = BaseButtonProperties & ({
|
|
|
36
37
|
children?: never;
|
|
37
38
|
label: string;
|
|
38
39
|
});
|
|
39
|
-
export default function Button({ type, variant, href, target, rel, disabled, className, children, label, tooltip, tooltipPosition, iconLeft, iconRight, isLoading, isSkeleton, hasMovingGradients, movingGradientsCount, hasMovingStars, movingStarsCount, ...properties }: ButtonProperties): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export default function Button({ type, variant, href, target, rel, disabled, className, children, label, tooltip, tooltipPosition, iconLeft, iconRight, isLoading, isSkeleton, isSkeletonAnimated, hasMovingGradients, movingGradientsCount, hasMovingStars, movingStarsCount, ...properties }: ButtonProperties): import("react/jsx-runtime").JSX.Element;
|
|
40
41
|
export {};
|
|
@@ -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"),u=require("@kuma-ui/core"),$=require("../theme.js"),
|
|
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"),u=require("@kuma-ui/core"),$=require("../theme.js"),C=require("../icons/icon.js"),F=require("./spinner.js"),O=require("./moving-gradients.js"),P=require("./moving-stars.js"),H=require("./theme-setter.js"),J=require("./click-ripples.js"),E=require("./hover-gradient.js"),K=require("./button-tooltip.js"),Q=require("./aria-text.js"),U=require("./atom.js"),X=require("./skeleton.js");function f({isLoading:s,size:n,className:o}){return e.jsxRuntimeExports.jsx("div",{className:u.cx("kakadu-components-2832510379",s&&"kakadu-components-4114685569",o),children:e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-920467642",children:e.jsxRuntimeExports.jsx(F.RevealSpinner,{isVisible:s,size:n})})})}var v=(s=>(s.primary="primary",s.secondary="secondary",s.warning="warning",s.danger="danger",s))(v||{});function b({icon:s,variant:n="primary",className:o,...c}){return e.jsxRuntimeExports.jsx("div",{...c,className:u.cx("kakadu-components-2658660333",n==="secondary"&&"kakadu-components-3469662110",o),children:typeof s=="string"?e.jsxRuntimeExports.jsx(C.default,{width:14,height:14,type:s}):s})}const S="kakadu-components-2244098950",Y="kakadu-components-3923184173",g="kakadu-components-317965671",q="kakadu-components-1978976872";function Z({type:s,variant:n="primary",href:o,target:c,rel:h,disabled:_,className:N,children:t,label:w,tooltip:i,tooltipPosition:B,iconLeft:m,iconRight:d,isLoading:x,isSkeleton:r,isSkeletonAnimated:M=!0,hasMovingGradients:D=!1,movingGradientsCount:l=4,hasMovingStars:I=!1,movingStarsCount:p=10,...T}){const k=R.useId(),j=R.useRef(null),G=H.useIsDarkMode(j),z=s??"button",A=D&&l>0,W=I&&p>0,a=o&&!r,y=!!_||!!x||!!r;return e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-3559664923",children:[e.jsxRuntimeExports.jsxs(U.default,{...T,as:a?"a":"button",type:a?void 0:z,href:a?o:void 0,target:a?c:void 0,rel:a?h:void 0,"aria-describedby":i?k:void 0,disabled:a?void 0:y,className:u.cx($.effectStyles,"kakadu-components-3709284365",!!m&&"kakadu-components-2735110382",!t&&"kakadu-components-3621693630",n==="secondary"&&S,n==="warning"&&g,n==="danger"&&q,r&&"kakadu-components-2662775151",N),children:[m?e.jsxRuntimeExports.jsx(b,{variant:n,icon:m,className:t?"kakadu-components-136489413":void 0}):null,t?e.jsxRuntimeExports.jsx("div",{ref:j,className:"kakadu-components-207477259",children:t}):e.jsxRuntimeExports.jsx(Q.default,{children:w}),d?e.jsxRuntimeExports.jsx(b,{variant:n,icon:d,className:t?"kakadu-components-3631501803":void 0}):null,e.jsxRuntimeExports.jsx(f,{isLoading:x}),A&&e.jsxRuntimeExports.jsx(O.default,{opacity:G?.4:.3,maximumGradientsCount:l,className:u.cx("kakadu-components-2055737617",n==="secondary"&&"kakadu-components-2972748387")}),W&&e.jsxRuntimeExports.jsx(P.default,{maximumStarsCount:p,className:"kakadu-components-1226008615"}),y?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(J.default,{size:t?void 0:50}),e.jsxRuntimeExports.jsx(E.default,{size:t?void 0:50,className:n==="secondary"?E.normalBlendStyles:void 0})]}),i?e.jsxRuntimeExports.jsx(K.default,{id:k,label:i,position:B}):null]}),r?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-3422055155",children:e.jsxRuntimeExports.jsx(X.SkeletonInstance,{width:"100%",height:"100%",isAnimated:M})}):null]})}exports.ButtonLoader=f;exports.ButtonVariant=v;exports.buttonDangerStyles=q;exports.buttonSecondaryStyles=S;exports.buttonSuccessStyles=Y;exports.buttonWarningStyles=g;exports.default=Z;
|
|
@@ -1,81 +1,82 @@
|
|
|
1
1
|
import { j as o } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useId as
|
|
2
|
+
import { useId as R, useRef as T } from "react";
|
|
3
3
|
import { cx as m } from "@kuma-ui/core";
|
|
4
|
-
import { effectStyles as
|
|
5
|
-
import
|
|
6
|
-
import { RevealSpinner as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useIsDarkMode as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { SkeletonInstance as
|
|
16
|
-
function
|
|
4
|
+
import { effectStyles as z } from "../theme.mjs";
|
|
5
|
+
import C from "../icons/icon.mjs";
|
|
6
|
+
import { RevealSpinner as E } from "./spinner.mjs";
|
|
7
|
+
import F from "./moving-gradients.mjs";
|
|
8
|
+
import H from "./moving-stars.mjs";
|
|
9
|
+
import { useIsDarkMode as W } from "./theme-setter.mjs";
|
|
10
|
+
import q from "./click-ripples.mjs";
|
|
11
|
+
import J, { normalBlendStyles as K } from "./hover-gradient.mjs";
|
|
12
|
+
import O from "./button-tooltip.mjs";
|
|
13
|
+
import P from "./aria-text.mjs";
|
|
14
|
+
import Q from "./atom.mjs";
|
|
15
|
+
import { SkeletonInstance as U } from "./skeleton.mjs";
|
|
16
|
+
function X({
|
|
17
17
|
isLoading: s,
|
|
18
18
|
size: n,
|
|
19
19
|
className: a
|
|
20
20
|
}) {
|
|
21
|
-
return /* @__PURE__ */ o.jsx("div", { className: m("kakadu-components-2832510379", s && "kakadu-components-4114685569", a), children: /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-920467642", children: /* @__PURE__ */ o.jsx(
|
|
21
|
+
return /* @__PURE__ */ o.jsx("div", { className: m("kakadu-components-2832510379", s && "kakadu-components-4114685569", a), children: /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-920467642", children: /* @__PURE__ */ o.jsx(E, { isVisible: s, size: n }) }) });
|
|
22
22
|
}
|
|
23
|
-
var
|
|
23
|
+
var Y = /* @__PURE__ */ ((s) => (s.primary = "primary", s.secondary = "secondary", s.warning = "warning", s.danger = "danger", s))(Y || {});
|
|
24
24
|
function j({
|
|
25
25
|
icon: s,
|
|
26
26
|
variant: n = "primary",
|
|
27
27
|
className: a,
|
|
28
|
-
...
|
|
28
|
+
...d
|
|
29
29
|
}) {
|
|
30
|
-
return /* @__PURE__ */ o.jsx("div", { ...
|
|
30
|
+
return /* @__PURE__ */ o.jsx("div", { ...d, className: m("kakadu-components-2658660333", n === "secondary" && "kakadu-components-3469662110", a), children: typeof s == "string" ? /* @__PURE__ */ o.jsx(C, { width: 14, height: 14, type: s }) : s });
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
function
|
|
32
|
+
const Z = "kakadu-components-2244098950", ko = "kakadu-components-3923184173", _ = "kakadu-components-317965671", $ = "kakadu-components-1978976872";
|
|
33
|
+
function xo({
|
|
34
34
|
type: s,
|
|
35
35
|
variant: n = "primary",
|
|
36
36
|
href: a,
|
|
37
|
-
target:
|
|
37
|
+
target: d,
|
|
38
38
|
rel: v,
|
|
39
39
|
disabled: b,
|
|
40
40
|
className: g,
|
|
41
41
|
children: e,
|
|
42
42
|
label: N,
|
|
43
|
-
tooltip:
|
|
43
|
+
tooltip: c,
|
|
44
44
|
tooltipPosition: h,
|
|
45
45
|
iconLeft: i,
|
|
46
|
-
iconRight:
|
|
47
|
-
isLoading:
|
|
46
|
+
iconRight: u,
|
|
47
|
+
isLoading: p,
|
|
48
48
|
isSkeleton: r,
|
|
49
|
-
|
|
49
|
+
isSkeletonAnimated: S = !0,
|
|
50
|
+
hasMovingGradients: w = !1,
|
|
50
51
|
movingGradientsCount: l = 4,
|
|
51
|
-
hasMovingStars:
|
|
52
|
+
hasMovingStars: B = !1,
|
|
52
53
|
movingStarsCount: k = 10,
|
|
53
|
-
...
|
|
54
|
+
...I
|
|
54
55
|
}) {
|
|
55
|
-
const x =
|
|
56
|
+
const x = R(), f = T(null), M = W(f), A = s ?? "button", D = w && l > 0, G = B && k > 0, t = a && !r, y = !!b || !!p || !!r;
|
|
56
57
|
return /* @__PURE__ */ o.jsxs("div", { className: "kakadu-components-3559664923", children: [
|
|
57
|
-
/* @__PURE__ */ o.jsxs(
|
|
58
|
+
/* @__PURE__ */ o.jsxs(Q, { ...I, as: t ? "a" : "button", type: t ? void 0 : A, href: t ? a : void 0, target: t ? d : void 0, rel: t ? v : void 0, "aria-describedby": c ? x : void 0, disabled: t ? void 0 : y, className: m(z, "kakadu-components-3709284365", !!i && "kakadu-components-2735110382", !e && "kakadu-components-3621693630", n === "secondary" && Z, n === "warning" && _, n === "danger" && $, r && "kakadu-components-2662775151", g), children: [
|
|
58
59
|
i ? /* @__PURE__ */ o.jsx(j, { variant: n, icon: i, className: e ? "kakadu-components-136489413" : void 0 }) : null,
|
|
59
|
-
e ? /* @__PURE__ */ o.jsx("div", { ref: f, className: "kakadu-components-207477259", children: e }) : /* @__PURE__ */ o.jsx(
|
|
60
|
-
|
|
61
|
-
/* @__PURE__ */ o.jsx(
|
|
62
|
-
D && /* @__PURE__ */ o.jsx(
|
|
63
|
-
|
|
60
|
+
e ? /* @__PURE__ */ o.jsx("div", { ref: f, className: "kakadu-components-207477259", children: e }) : /* @__PURE__ */ o.jsx(P, { children: N }),
|
|
61
|
+
u ? /* @__PURE__ */ o.jsx(j, { variant: n, icon: u, className: e ? "kakadu-components-3631501803" : void 0 }) : null,
|
|
62
|
+
/* @__PURE__ */ o.jsx(X, { isLoading: p }),
|
|
63
|
+
D && /* @__PURE__ */ o.jsx(F, { opacity: M ? 0.4 : 0.3, maximumGradientsCount: l, className: m("kakadu-components-2055737617", n === "secondary" && "kakadu-components-2972748387") }),
|
|
64
|
+
G && /* @__PURE__ */ o.jsx(H, { maximumStarsCount: k, className: "kakadu-components-1226008615" }),
|
|
64
65
|
y ? null : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
65
|
-
/* @__PURE__ */ o.jsx(
|
|
66
|
-
/* @__PURE__ */ o.jsx(
|
|
66
|
+
/* @__PURE__ */ o.jsx(q, { size: e ? void 0 : 50 }),
|
|
67
|
+
/* @__PURE__ */ o.jsx(J, { size: e ? void 0 : 50, className: n === "secondary" ? K : void 0 })
|
|
67
68
|
] }),
|
|
68
|
-
|
|
69
|
+
c ? /* @__PURE__ */ o.jsx(O, { id: x, label: c, position: h }) : null
|
|
69
70
|
] }),
|
|
70
|
-
r ? /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-3422055155", children: /* @__PURE__ */ o.jsx(
|
|
71
|
+
r ? /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-3422055155", children: /* @__PURE__ */ o.jsx(U, { width: "100%", height: "100%", isAnimated: S }) }) : null
|
|
71
72
|
] });
|
|
72
73
|
}
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
X as ButtonLoader,
|
|
76
|
+
Y as ButtonVariant,
|
|
77
|
+
$ as buttonDangerStyles,
|
|
78
|
+
Z as buttonSecondaryStyles,
|
|
79
|
+
ko as buttonSuccessStyles,
|
|
80
|
+
_ as buttonWarningStyles,
|
|
81
|
+
xo as default
|
|
81
82
|
};
|
|
@@ -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
|
};
|
|
@@ -14,5 +14,6 @@ export type IconButtonProperties = HTMLProps<HTMLButtonElement> & {
|
|
|
14
14
|
readonly tooltipPosition?: ButtonTooltipPosition;
|
|
15
15
|
readonly isLoading?: boolean;
|
|
16
16
|
readonly isSkeleton?: boolean;
|
|
17
|
+
readonly isSkeletonAnimated?: boolean;
|
|
17
18
|
};
|
|
18
|
-
export default function IconButton({ icon, variant, label, tooltipPosition, disabled, isLoading, isSkeleton, className, ...properties }: IconButtonProperties): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default function IconButton({ icon, variant, label, tooltipPosition, disabled, isLoading, isSkeleton, isSkeletonAnimated, className, ...properties }: IconButtonProperties): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),s=require("react"),n=require("@kuma-ui/core"),i=require("../icons/icon.js"),R=require("../theme.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),s=require("react"),n=require("@kuma-ui/core"),i=require("../icons/icon.js"),R=require("../theme.js"),I=require("./theme-setter.js"),u=require("./button.js"),T=require("./button-tooltip.js"),B=require("./click-ripples.js"),S=require("./hover-gradient.js"),D=require("./skeleton.js");var b=(e=>(e.default="default",e.success="success",e.warning="warning",e.danger="danger",e))(b||{});function M({icon:e,variant:o="default",label:m,tooltipPosition:g,disabled:y,isLoading:x,isSkeleton:l,isSkeletonAnimated:E=!0,className:q,...w}){const p=s.useId(),_=I.useIsDarkMode(),[r,N]=s.useState(e),[k,d]=s.useState(!1),f=s.useRef(e),c=s.useRef(null);s.useEffect(()=>{f.current=e},[e]);const a=s.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]);s.useEffect(()=>{if(r===e){d(h=>h&&!1);return}d(!0),a(),c.current=setTimeout(()=>{d(!1),N(f.current)},370)},[r,e,a]),s.useEffect(()=>()=>{a()},[a]);const j=!!y||!!x||!!l;return t.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-4096632152",children:[t.jsxRuntimeExports.jsxs("button",{...w,type:"button","aria-label":m,"aria-describedby":p,disabled:j,className:n.cx(R.buttonResetStyles,R.effectStyles,"kakadu-components-1951951921",o==="default"&&n.cx(u.buttonSecondaryStyles,"kakadu-components-1561784812"),o==="success"&&n.cx(u.buttonSuccessStyles,"kakadu-components-1398421429"),o==="warning"&&n.cx(u.buttonWarningStyles,"kakadu-components-1872098090"),o==="danger"&&n.cx(u.buttonDangerStyles,"kakadu-components-2064536093"),l&&"kakadu-components-2662775151",q),children:[t.jsxRuntimeExports.jsxs("span",{"data-theme":o==="default"?_?"dark":"light":"dark",className:"kakadu-components-3040141419",children:[t.jsxRuntimeExports.jsx(i.default,{width:16,height:16,type:r,className:n.cx(i.iconShadowStyles,"kakadu-components-1562914001",k&&"kakadu-components-2360250719")}),r===e?null:t.jsxRuntimeExports.jsx(i.default,{width:16,height:16,type:e,className:n.cx(i.iconShadowStyles,"kakadu-components-1224061930",k&&"kakadu-components-2519520784")})]}),t.jsxRuntimeExports.jsx(u.ButtonLoader,{isLoading:x,size:14}),t.jsxRuntimeExports.jsx(T.default,{id:p,label:m,position:g}),j?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(B.default,{size:50}),t.jsxRuntimeExports.jsx(S.default,{size:50,className:o==="default"?S.normalBlendStyles:void 0})]})]}),l?t.jsxRuntimeExports.jsx("div",{className:"kakadu-components-3422055155",children:t.jsxRuntimeExports.jsx(D.SkeletonInstance,{width:"100%",height:"100%",isAnimated:E})}):null]})}exports.IconButtonVariant=b;exports.default=M;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { j as s } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useId as
|
|
2
|
+
import { useId as D, useState as x, useRef as g, useEffect as l, useCallback as T } from "react";
|
|
3
3
|
import { cx as t } from "@kuma-ui/core";
|
|
4
4
|
import j, { iconShadowStyles as y } from "../icons/icon.mjs";
|
|
5
|
-
import { buttonResetStyles as
|
|
6
|
-
import { useIsDarkMode as
|
|
7
|
-
import { ButtonLoader as
|
|
5
|
+
import { buttonResetStyles as z, effectStyles as C } from "../theme.mjs";
|
|
6
|
+
import { useIsDarkMode as E } from "./theme-setter.mjs";
|
|
7
|
+
import { ButtonLoader as M, buttonSecondaryStyles as v, buttonSuccessStyles as A, buttonWarningStyles as F, buttonDangerStyles as G } from "./button.mjs";
|
|
8
8
|
import H from "./button-tooltip.mjs";
|
|
9
9
|
import P from "./click-ripples.mjs";
|
|
10
10
|
import W, { normalBlendStyles as q } from "./hover-gradient.mjs";
|
|
11
|
-
import { SkeletonInstance as
|
|
12
|
-
var
|
|
13
|
-
function
|
|
11
|
+
import { SkeletonInstance as J } from "./skeleton.mjs";
|
|
12
|
+
var K = /* @__PURE__ */ ((e) => (e.default = "default", e.success = "success", e.warning = "warning", e.danger = "danger", e))(K || {});
|
|
13
|
+
function se({
|
|
14
14
|
icon: e,
|
|
15
15
|
variant: o = "default",
|
|
16
16
|
label: d,
|
|
@@ -18,14 +18,15 @@ function ee({
|
|
|
18
18
|
disabled: b,
|
|
19
19
|
isLoading: m,
|
|
20
20
|
isSkeleton: u,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
isSkeletonAnimated: w = !0,
|
|
22
|
+
className: N,
|
|
23
|
+
...R
|
|
23
24
|
}) {
|
|
24
|
-
const i =
|
|
25
|
+
const i = D(), I = E(), [n, B] = x(e), [p, c] = x(!1), f = g(e), a = g(null);
|
|
25
26
|
l(() => {
|
|
26
27
|
f.current = e;
|
|
27
28
|
}, [e]);
|
|
28
|
-
const r =
|
|
29
|
+
const r = T(() => {
|
|
29
30
|
a.current && (clearTimeout(a.current), a.current = null);
|
|
30
31
|
}, []);
|
|
31
32
|
l(() => {
|
|
@@ -34,29 +35,29 @@ function ee({
|
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
c(!0), r(), a.current = setTimeout(() => {
|
|
37
|
-
c(!1),
|
|
38
|
+
c(!1), B(f.current);
|
|
38
39
|
}, 370);
|
|
39
40
|
}, [n, e, r]), l(() => () => {
|
|
40
41
|
r();
|
|
41
42
|
}, [r]);
|
|
42
43
|
const k = !!b || !!m || !!u;
|
|
43
44
|
return /* @__PURE__ */ s.jsxs("div", { className: "kakadu-components-4096632152", children: [
|
|
44
|
-
/* @__PURE__ */ s.jsxs("button", { ...
|
|
45
|
-
/* @__PURE__ */ s.jsxs("span", { "data-theme": o === "default" ?
|
|
45
|
+
/* @__PURE__ */ s.jsxs("button", { ...R, type: "button", "aria-label": d, "aria-describedby": i, disabled: k, className: t(z, C, "kakadu-components-1951951921", o === "default" && t(v, "kakadu-components-1561784812"), o === "success" && t(A, "kakadu-components-1398421429"), o === "warning" && t(F, "kakadu-components-1872098090"), o === "danger" && t(G, "kakadu-components-2064536093"), u && "kakadu-components-2662775151", N), children: [
|
|
46
|
+
/* @__PURE__ */ s.jsxs("span", { "data-theme": o === "default" ? I ? "dark" : "light" : "dark", className: "kakadu-components-3040141419", children: [
|
|
46
47
|
/* @__PURE__ */ s.jsx(j, { width: 16, height: 16, type: n, className: t(y, "kakadu-components-1562914001", p && "kakadu-components-2360250719") }),
|
|
47
48
|
n === e ? null : /* @__PURE__ */ s.jsx(j, { width: 16, height: 16, type: e, className: t(y, "kakadu-components-1224061930", p && "kakadu-components-2519520784") })
|
|
48
49
|
] }),
|
|
49
|
-
/* @__PURE__ */ s.jsx(
|
|
50
|
+
/* @__PURE__ */ s.jsx(M, { isLoading: m, size: 14 }),
|
|
50
51
|
/* @__PURE__ */ s.jsx(H, { id: i, label: d, position: S }),
|
|
51
52
|
k ? null : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
52
53
|
/* @__PURE__ */ s.jsx(P, { size: 50 }),
|
|
53
54
|
/* @__PURE__ */ s.jsx(W, { size: 50, className: o === "default" ? q : void 0 })
|
|
54
55
|
] })
|
|
55
56
|
] }),
|
|
56
|
-
u ? /* @__PURE__ */ s.jsx("div", { className: "kakadu-components-3422055155", children: /* @__PURE__ */ s.jsx(
|
|
57
|
+
u ? /* @__PURE__ */ s.jsx("div", { className: "kakadu-components-3422055155", children: /* @__PURE__ */ s.jsx(J, { width: "100%", height: "100%", isAnimated: w }) }) : null
|
|
57
58
|
] });
|
|
58
59
|
}
|
|
59
60
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
K as IconButtonVariant,
|
|
62
|
+
se as default
|
|
62
63
|
};
|
|
@@ -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;
|