@kakadu/components 4.6.2 → 4.6.3
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.d.ts +1 -1
- package/build/components/button.js +1 -1
- package/build/components/button.mjs +56 -55
- package/build/components/card.d.ts +1 -1
- package/build/components/card.js +1 -1
- package/build/components/card.mjs +28 -27
- package/build/components/icon-button.d.ts +1 -1
- package/build/components/icon-button.js +1 -1
- package/build/components/icon-button.mjs +32 -31
- package/build/components/text-button.d.ts +1 -1
- package/build/components/text-button.js +1 -1
- package/build/components/text-button.mjs +37 -36
- package/package.json +1 -1
|
@@ -33,5 +33,5 @@ export type ButtonProperties = BaseButtonProperties & ({
|
|
|
33
33
|
children?: never;
|
|
34
34
|
label: string;
|
|
35
35
|
});
|
|
36
|
-
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;
|
|
36
|
+
export default function Button({ ref, 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;
|
|
37
37
|
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"),
|
|
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,82 +1,83 @@
|
|
|
1
1
|
import { j as o } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useId as
|
|
3
|
-
import { cx as
|
|
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
|
|
2
|
+
import { useId as T, useRef as z } from "react";
|
|
3
|
+
import { cx as c } from "@kuma-ui/core";
|
|
4
|
+
import { effectStyles as C, overlayEffectStyles as E } from "../theme.mjs";
|
|
5
|
+
import V from "../icons/icon.mjs";
|
|
6
|
+
import { RevealSpinner as F } from "./spinner.mjs";
|
|
7
|
+
import H from "./moving-gradients.mjs";
|
|
8
|
+
import W from "./moving-stars.mjs";
|
|
9
|
+
import { useIsDarkMode as q } from "./theme-setter.mjs";
|
|
10
|
+
import J from "./click-ripples.mjs";
|
|
11
|
+
import K, { normalBlendStyles as O } from "./hover-gradient.mjs";
|
|
12
|
+
import P from "./button-tooltip.mjs";
|
|
13
|
+
import Q from "./aria-text.mjs";
|
|
14
|
+
import U from "./atom.mjs";
|
|
15
|
+
import { SkeletonInstance as X } from "./skeleton.mjs";
|
|
16
|
+
function Y({
|
|
17
17
|
isLoading: n,
|
|
18
|
-
size:
|
|
19
|
-
className:
|
|
18
|
+
size: a,
|
|
19
|
+
className: s
|
|
20
20
|
}) {
|
|
21
|
-
return /* @__PURE__ */ o.jsx("div", { className:
|
|
21
|
+
return /* @__PURE__ */ o.jsx("div", { className: c("kakadu-components-2832510379", n && "kakadu-components-4114685569", s), children: /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-920467642", children: /* @__PURE__ */ o.jsx(F, { isVisible: n, size: a }) }) });
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const fo = ["primary", "secondary", "warning", "danger"];
|
|
24
24
|
function j({
|
|
25
25
|
icon: n,
|
|
26
|
-
variant:
|
|
27
|
-
className:
|
|
28
|
-
...
|
|
26
|
+
variant: a = "primary",
|
|
27
|
+
className: s,
|
|
28
|
+
...r
|
|
29
29
|
}) {
|
|
30
|
-
return /* @__PURE__ */ o.jsx("div", { ...
|
|
30
|
+
return /* @__PURE__ */ o.jsx("div", { ...r, className: c("kakadu-components-2658660333", a === "secondary" && "kakadu-components-3469662110", s), children: typeof n == "string" ? /* @__PURE__ */ o.jsx(V, { width: 14, height: 14, type: n }) : n });
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
function
|
|
34
|
-
|
|
32
|
+
const Z = "kakadu-components-2550769169", xo = "kakadu-components-1998774084", _ = "kakadu-components-2945752235", $ = "kakadu-components-1546692192";
|
|
33
|
+
function yo({
|
|
34
|
+
ref: n,
|
|
35
|
+
type: a,
|
|
35
36
|
variant: s = "primary",
|
|
36
|
-
href:
|
|
37
|
-
target:
|
|
38
|
-
rel:
|
|
39
|
-
disabled:
|
|
40
|
-
className:
|
|
37
|
+
href: r,
|
|
38
|
+
target: v,
|
|
39
|
+
rel: b,
|
|
40
|
+
disabled: N,
|
|
41
|
+
className: g,
|
|
41
42
|
children: e,
|
|
42
|
-
label:
|
|
43
|
+
label: h,
|
|
43
44
|
tooltip: d,
|
|
44
|
-
tooltipPosition:
|
|
45
|
+
tooltipPosition: S,
|
|
45
46
|
iconLeft: i,
|
|
46
47
|
iconRight: l,
|
|
47
48
|
isLoading: p,
|
|
48
|
-
isSkeleton:
|
|
49
|
-
isSkeletonAnimated:
|
|
50
|
-
hasMovingGradients:
|
|
49
|
+
isSkeleton: m,
|
|
50
|
+
isSkeletonAnimated: B = !0,
|
|
51
|
+
hasMovingGradients: w = !1,
|
|
51
52
|
movingGradientsCount: k = 4,
|
|
52
|
-
hasMovingStars:
|
|
53
|
+
hasMovingStars: I = !1,
|
|
53
54
|
movingStarsCount: f = 10,
|
|
54
|
-
...
|
|
55
|
+
...M
|
|
55
56
|
}) {
|
|
56
|
-
const x =
|
|
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
58
|
return /* @__PURE__ */ o.jsxs("div", { className: "kakadu-components-3559664923", children: [
|
|
58
|
-
/* @__PURE__ */ o.jsxs(
|
|
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: [
|
|
59
60
|
i ? /* @__PURE__ */ o.jsx(j, { variant: s, icon: i, className: e ? "kakadu-components-136489413" : void 0 }) : null,
|
|
60
|
-
e ? /* @__PURE__ */ o.jsx("div", { ref: y, className: "kakadu-components-207477259", children: e }) : /* @__PURE__ */ o.jsx(
|
|
61
|
+
e ? /* @__PURE__ */ o.jsx("div", { ref: y, className: "kakadu-components-207477259", children: e }) : /* @__PURE__ */ o.jsx(Q, { children: h }),
|
|
61
62
|
l ? /* @__PURE__ */ o.jsx(j, { variant: s, icon: l, className: e ? "kakadu-components-3631501803" : void 0 }) : null,
|
|
62
|
-
/* @__PURE__ */ o.jsx(
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
/* @__PURE__ */ o.jsx(Y, { isLoading: p }),
|
|
64
|
+
G && /* @__PURE__ */ o.jsx(H, { opacity: A ? 0.5 : 0.4, maximumGradientsCount: k, className: c("kakadu-components-2055737617", s === "secondary" && "kakadu-components-2972748387") }),
|
|
65
|
+
R && /* @__PURE__ */ o.jsx(W, { maximumStarsCount: f, className: "kakadu-components-1226008615" }),
|
|
65
66
|
u ? null : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
66
|
-
/* @__PURE__ */ o.jsx(
|
|
67
|
-
/* @__PURE__ */ o.jsx(
|
|
67
|
+
/* @__PURE__ */ o.jsx(J, { size: e ? void 0 : 50 }),
|
|
68
|
+
/* @__PURE__ */ o.jsx(K, { size: e ? void 0 : 50, className: s === "secondary" ? O : void 0 })
|
|
68
69
|
] }),
|
|
69
|
-
d ? /* @__PURE__ */ o.jsx(
|
|
70
|
+
d ? /* @__PURE__ */ o.jsx(P, { id: x, label: d, position: S }) : null
|
|
70
71
|
] }),
|
|
71
|
-
|
|
72
|
+
m ? /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-3422055155", children: /* @__PURE__ */ o.jsx(X, { width: "100%", height: "100%", isAnimated: B }) }) : null
|
|
72
73
|
] });
|
|
73
74
|
}
|
|
74
75
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
Y as ButtonLoader,
|
|
77
|
+
$ as buttonDangerStyles,
|
|
78
|
+
Z as buttonSecondaryStyles,
|
|
79
|
+
xo as buttonSuccessStyles,
|
|
80
|
+
fo as buttonVariants,
|
|
81
|
+
_ as buttonWarningStyles,
|
|
82
|
+
yo as default
|
|
82
83
|
};
|
|
@@ -6,4 +6,4 @@ export type CardProperties = HTMLProps<HTMLButtonElement> & {
|
|
|
6
6
|
readonly description: string;
|
|
7
7
|
readonly action: string;
|
|
8
8
|
};
|
|
9
|
-
export default function Card({ icon, title, description, action, href, target, rel, className, ...properties }: CardProperties): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default function Card({ ref, icon, title, description, action, href, target, rel, className, ...properties }: CardProperties): import("react/jsx-runtime").JSX.Element;
|
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"),r=require("@kuma-ui/core"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),r=require("@kuma-ui/core"),k=require("../theme.js"),a=require("../icons/icon.js"),s=require("./flex.js"),n=require("./text.js"),f=require("./click-ripples.js"),c=require("./hover-gradient.js"),h=require("./button.js"),R=require("./atom.js");function q({ref:u,icon:o,title:i,description:l,action:m,href:t,target:x,rel:d,className:p,...j}){return e.jsxRuntimeExports.jsxs(R.default,{...j,reference:u,as:t?"a":"button",type:t?void 0:"button",href:t,target:x,rel:d,className:r.cx(k.effectStyles,h.buttonSecondaryStyles,"kakadu-components-1387630570",p),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(a.default,{width:16,height:16,type:o,className:r.cx(a.iconShadowStyles,"kakadu-components-782417605")}):null,i]})}),e.jsxRuntimeExports.jsx(n.Paragraph,{className:"kakadu-components-3061837309",children:l}),e.jsxRuntimeExports.jsx(s.default,{preset:"end",children:e.jsxRuntimeExports.jsx(n.Span,{className:"kakadu-components-777975485",children:m})})]}),e.jsxRuntimeExports.jsx(f.default,{size:250,className:"kakadu-components-2967167444"}),e.jsxRuntimeExports.jsx(c.default,{size:300,className:c.normalBlendStyles})]})}exports.default=q;
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { effectStyles as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { Span as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { buttonSecondaryStyles as
|
|
10
|
-
import
|
|
11
|
-
function
|
|
1
|
+
import { j as e } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
+
import { cx as r } from "@kuma-ui/core";
|
|
3
|
+
import { effectStyles as x } from "../theme.mjs";
|
|
4
|
+
import f, { iconShadowStyles as k } from "../icons/icon.mjs";
|
|
5
|
+
import s from "./flex.mjs";
|
|
6
|
+
import { Span as a, Paragraph as j } from "./text.mjs";
|
|
7
|
+
import h from "./click-ripples.mjs";
|
|
8
|
+
import y, { normalBlendStyles as N } from "./hover-gradient.mjs";
|
|
9
|
+
import { buttonSecondaryStyles as S } from "./button.mjs";
|
|
10
|
+
import g from "./atom.mjs";
|
|
11
|
+
function G({
|
|
12
|
+
ref: n,
|
|
12
13
|
icon: t,
|
|
13
14
|
title: m,
|
|
14
|
-
description:
|
|
15
|
-
action:
|
|
16
|
-
href:
|
|
17
|
-
target:
|
|
18
|
-
rel:
|
|
19
|
-
className:
|
|
20
|
-
...
|
|
15
|
+
description: i,
|
|
16
|
+
action: c,
|
|
17
|
+
href: o,
|
|
18
|
+
target: p,
|
|
19
|
+
rel: l,
|
|
20
|
+
className: d,
|
|
21
|
+
...u
|
|
21
22
|
}) {
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
t ? /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ e.jsxs(g, { ...u, reference: n, as: o ? "a" : "button", type: o ? void 0 : "button", href: o, target: p, rel: l, className: r(x, S, "kakadu-components-1387630570", d), children: [
|
|
24
|
+
/* @__PURE__ */ e.jsxs(s, { gap: 0.5, direction: "column", children: [
|
|
25
|
+
/* @__PURE__ */ e.jsx(a, { className: "kakadu-components-1301774894", children: /* @__PURE__ */ e.jsxs(s, { gap: 0.5, direction: "row", preset: "start", children: [
|
|
26
|
+
t ? /* @__PURE__ */ e.jsx(f, { width: 16, height: 16, type: t, className: r(k, "kakadu-components-782417605") }) : null,
|
|
26
27
|
m
|
|
27
28
|
] }) }),
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ e.jsx(j, { className: "kakadu-components-3061837309", children: i }),
|
|
30
|
+
/* @__PURE__ */ e.jsx(s, { preset: "end", children: /* @__PURE__ */ e.jsx(a, { className: "kakadu-components-777975485", children: c }) })
|
|
30
31
|
] }),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ e.jsx(h, { size: 250, className: "kakadu-components-2967167444" }),
|
|
33
|
+
/* @__PURE__ */ e.jsx(y, { size: 300, className: N })
|
|
33
34
|
] });
|
|
34
35
|
}
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
G as default
|
|
37
38
|
};
|
|
@@ -12,4 +12,4 @@ export type IconButtonProperties = HTMLProps<HTMLButtonElement> & {
|
|
|
12
12
|
readonly isSkeleton?: boolean;
|
|
13
13
|
readonly isSkeletonAnimated?: boolean;
|
|
14
14
|
};
|
|
15
|
-
export default function IconButton({ icon, variant, label, tooltipPosition, href, target, rel, disabled, isLoading, isSkeleton, isSkeletonAnimated, className, ...properties }: IconButtonProperties): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default function IconButton({ ref, icon, variant, label, tooltipPosition, href, target, rel, 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 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"),
|
|
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,36 +1,37 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useId as
|
|
2
|
+
import { useId as C, useState as j, useRef as g, useEffect as d, 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
|
-
import { buttonResetStyles as
|
|
6
|
-
import { useIsDarkMode as
|
|
7
|
-
import { ButtonLoader as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { SkeletonInstance as
|
|
12
|
-
import
|
|
13
|
-
const
|
|
14
|
-
function
|
|
5
|
+
import { buttonResetStyles as M, effectStyles as F, overlayEffectStyles as G } from "../theme.mjs";
|
|
6
|
+
import { useIsDarkMode as H } from "./theme-setter.mjs";
|
|
7
|
+
import { ButtonLoader as O, buttonSecondaryStyles as V, buttonSuccessStyles as W, buttonWarningStyles as q, buttonDangerStyles as J } from "./button.mjs";
|
|
8
|
+
import K from "./button-tooltip.mjs";
|
|
9
|
+
import L from "./click-ripples.mjs";
|
|
10
|
+
import P, { normalBlendStyles as Q } from "./hover-gradient.mjs";
|
|
11
|
+
import { SkeletonInstance as U } from "./skeleton.mjs";
|
|
12
|
+
import X from "./atom.mjs";
|
|
13
|
+
const ue = ["default", "success", "warning", "danger"];
|
|
14
|
+
function ie({
|
|
15
|
+
ref: w,
|
|
15
16
|
icon: t,
|
|
16
17
|
variant: n = "default",
|
|
17
18
|
label: m,
|
|
18
|
-
tooltipPosition:
|
|
19
|
+
tooltipPosition: B,
|
|
19
20
|
href: p,
|
|
20
|
-
target:
|
|
21
|
-
rel:
|
|
22
|
-
disabled:
|
|
21
|
+
target: I,
|
|
22
|
+
rel: N,
|
|
23
|
+
disabled: v,
|
|
23
24
|
isLoading: f,
|
|
24
25
|
isSkeleton: a,
|
|
25
|
-
isSkeletonAnimated:
|
|
26
|
-
className:
|
|
27
|
-
...
|
|
26
|
+
isSkeletonAnimated: R = !0,
|
|
27
|
+
className: D,
|
|
28
|
+
...T
|
|
28
29
|
}) {
|
|
29
|
-
const k =
|
|
30
|
+
const k = C(), z = H(), o = p && !a, [r, A] = j(t), [h, i] = j(!1), x = g(t), c = g(null);
|
|
30
31
|
d(() => {
|
|
31
32
|
x.current = t;
|
|
32
33
|
}, [t]);
|
|
33
|
-
const u =
|
|
34
|
+
const u = E(() => {
|
|
34
35
|
c.current && (clearTimeout(c.current), c.current = null);
|
|
35
36
|
}, []);
|
|
36
37
|
d(() => {
|
|
@@ -39,29 +40,29 @@ function ue({
|
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
42
|
i(!0), u(), c.current = setTimeout(() => {
|
|
42
|
-
i(!1),
|
|
43
|
+
i(!1), A(x.current);
|
|
43
44
|
}, 370);
|
|
44
45
|
}, [r, t, u]), d(() => () => {
|
|
45
46
|
u();
|
|
46
47
|
}, [u]);
|
|
47
|
-
const l = !!
|
|
48
|
+
const l = !!v || !!f || !!a;
|
|
48
49
|
return /* @__PURE__ */ e.jsxs("div", { className: "kakadu-components-4096632152", children: [
|
|
49
|
-
/* @__PURE__ */ e.jsxs(
|
|
50
|
-
/* @__PURE__ */ e.jsxs("span", { "data-theme": n === "default" ?
|
|
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 ? N : void 0, "aria-label": m, "aria-describedby": k, disabled: o ? void 0 : l, inert: o ? l : 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
|
+
/* @__PURE__ */ e.jsxs("span", { "data-theme": n === "default" ? z ? "dark" : "light" : "dark", className: "kakadu-components-3040141419", children: [
|
|
51
52
|
/* @__PURE__ */ e.jsx(S, { width: 16, height: 16, type: r, className: s(b, "kakadu-components-1562914001", h && "kakadu-components-2360250719") }),
|
|
52
53
|
r === t ? null : /* @__PURE__ */ e.jsx(S, { width: 16, height: 16, type: t, className: s(b, "kakadu-components-1224061930", h && "kakadu-components-2519520784") })
|
|
53
54
|
] }),
|
|
54
|
-
/* @__PURE__ */ e.jsx(
|
|
55
|
-
/* @__PURE__ */ e.jsx(
|
|
55
|
+
/* @__PURE__ */ e.jsx(O, { isLoading: f, size: 14 }),
|
|
56
|
+
/* @__PURE__ */ e.jsx(K, { id: k, label: m, position: B }),
|
|
56
57
|
l ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
57
|
-
/* @__PURE__ */ e.jsx(
|
|
58
|
-
/* @__PURE__ */ e.jsx(
|
|
58
|
+
/* @__PURE__ */ e.jsx(L, { size: 50 }),
|
|
59
|
+
/* @__PURE__ */ e.jsx(P, { size: 50, className: n === "default" ? Q : void 0 })
|
|
59
60
|
] })
|
|
60
61
|
] }),
|
|
61
|
-
a ? /* @__PURE__ */ e.jsx("div", { className: "kakadu-components-3422055155", children: /* @__PURE__ */ e.jsx(
|
|
62
|
+
a ? /* @__PURE__ */ e.jsx("div", { className: "kakadu-components-3422055155", children: /* @__PURE__ */ e.jsx(U, { width: "100%", height: "100%", isAnimated: R }) }) : null
|
|
62
63
|
] });
|
|
63
64
|
}
|
|
64
65
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
ie as default,
|
|
67
|
+
ue as iconButtonVariants
|
|
67
68
|
};
|
|
@@ -19,5 +19,5 @@ export type TextButtonProperties = BaseTextButtonProperties & ({
|
|
|
19
19
|
children?: never;
|
|
20
20
|
label: string;
|
|
21
21
|
});
|
|
22
|
-
export default function TextButton({ iconLeft, iconRight, variant, tooltip, tooltipPosition, href, target, rel, disabled, hasUnderline, isSkeleton, isSkeletonAnimated, className, children, label, ...properties }: TextButtonProperties): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export default function TextButton({ ref, iconLeft, iconRight, variant, tooltip, tooltipPosition, href, target, rel, disabled, hasUnderline, isSkeleton, isSkeletonAnimated, className, children, label, ...properties }: TextButtonProperties): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
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"),a=require("@kuma-ui/core"),c=require("../icons/icon.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"),c=require("../icons/icon.js"),_=require("./flex.js"),f=require("./text.js"),h=require("./click-ripples.js"),l=require("./hover-gradient.js"),b=require("./button-tooltip.js"),N=require("./aria-text.js"),g=require("./atom.js"),w=require("./skeleton.js"),S=["primary","delete"],T="kakadu-components-356806024";function z({ref:m,iconLeft:n,iconRight:o,variant:d="primary",tooltip:x,tooltipPosition:p,href:i,target:j,rel:k,disabled:E,hasUnderline:v=!0,isSkeleton:u,isSkeletonAnimated:R=!0,className:y,children:t,label:B,...q}){const r=!!E||!!u,s=i&&!u;return e.jsxRuntimeExports.jsxs("div",{className:a.cx("kakadu-components-989891841",t&&(n||o)?a.cx(!!n&&"kakadu-components-497190725",!!o&&"kakadu-components-3729381008"):"kakadu-components-3866032606"),children:[e.jsxRuntimeExports.jsxs(g.default,{...q,reference:m,as:s?"a":"button",type:s?void 0:"button",href:s?i:void 0,target:s?j:void 0,rel:s?k:void 0,disabled:s?void 0:r,inert:s?r:void 0,className:a.cx(f.textShadowStyles,"kakadu-components-4279134239",d==="delete"&&T,u&&"kakadu-components-2662775151",y),children:[e.jsxRuntimeExports.jsxs(_.default,{direction:"row",gap:.5,preset:"center",children:[n?e.jsxRuntimeExports.jsx("div",{className:a.cx("kakadu-components-743909038",t?"kakadu-components-1285017646":"kakadu-components-1475172827"),children:typeof n=="string"?e.jsxRuntimeExports.jsx(c.default,{width:14,height:14,type:n}):n}):null,t?e.jsxRuntimeExports.jsx("span",{className:a.cx("kakadu-components-743909038",v&&"kakadu-components-2703794515"),children:t}):e.jsxRuntimeExports.jsx(N.default,{children:B}),o?e.jsxRuntimeExports.jsx("div",{className:a.cx("kakadu-components-743909038",t?"kakadu-components-2421728947":"kakadu-components-1475172827"),children:typeof o=="string"?e.jsxRuntimeExports.jsx(c.default,{width:14,height:14,type:o}):o}):null]}),e.jsxRuntimeExports.jsxs("span",{className:"kakadu-components-1970948853",children:[r?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(h.default,{size:t?void 0:50}),e.jsxRuntimeExports.jsx(l.default,{size:t?void 0:50,className:l.normalBlendStyles})]}),x?e.jsxRuntimeExports.jsx(b.default,{label:x,position:p}):null]})]}),u?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-1970948853",children:e.jsxRuntimeExports.jsx(w.SkeletonInstance,{width:"100%",height:"100%",isAnimated:R})}):null]})}exports.default=z;exports.textButtonVariants=S;
|
|
@@ -1,53 +1,54 @@
|
|
|
1
1
|
import { j as o } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
2
|
import { cx as n } from "@kuma-ui/core";
|
|
3
3
|
import p from "../icons/icon.mjs";
|
|
4
|
-
import
|
|
5
|
-
import { textShadowStyles as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { SkeletonInstance as
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
|
|
4
|
+
import N from "./flex.mjs";
|
|
5
|
+
import { textShadowStyles as b } from "./text.mjs";
|
|
6
|
+
import w from "./click-ripples.mjs";
|
|
7
|
+
import A, { normalBlendStyles as g } from "./hover-gradient.mjs";
|
|
8
|
+
import T from "./button-tooltip.mjs";
|
|
9
|
+
import z from "./aria-text.mjs";
|
|
10
|
+
import C from "./atom.mjs";
|
|
11
|
+
import { SkeletonInstance as D } from "./skeleton.mjs";
|
|
12
|
+
const P = ["primary", "delete"], F = "kakadu-components-356806024";
|
|
13
|
+
function Q({
|
|
14
|
+
ref: i,
|
|
15
|
+
iconLeft: t,
|
|
15
16
|
iconRight: s,
|
|
16
|
-
variant:
|
|
17
|
+
variant: u = "primary",
|
|
17
18
|
tooltip: d,
|
|
18
|
-
tooltipPosition:
|
|
19
|
+
tooltipPosition: k,
|
|
19
20
|
href: l,
|
|
20
|
-
target:
|
|
21
|
-
rel:
|
|
22
|
-
disabled:
|
|
23
|
-
hasUnderline:
|
|
24
|
-
isSkeleton:
|
|
25
|
-
isSkeletonAnimated:
|
|
26
|
-
className:
|
|
27
|
-
children:
|
|
21
|
+
target: c,
|
|
22
|
+
rel: x,
|
|
23
|
+
disabled: j,
|
|
24
|
+
hasUnderline: v = !0,
|
|
25
|
+
isSkeleton: r,
|
|
26
|
+
isSkeletonAnimated: B = !0,
|
|
27
|
+
className: f,
|
|
28
|
+
children: e,
|
|
28
29
|
label: y,
|
|
29
|
-
...
|
|
30
|
+
...h
|
|
30
31
|
}) {
|
|
31
|
-
const
|
|
32
|
-
return /* @__PURE__ */ o.jsxs("div", { className: n("kakadu-components-989891841",
|
|
33
|
-
/* @__PURE__ */ o.jsxs(
|
|
34
|
-
/* @__PURE__ */ o.jsxs(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
s ? /* @__PURE__ */ o.jsx("div", { className: n("kakadu-components-743909038",
|
|
32
|
+
const m = !!j || !!r, a = l && !r;
|
|
33
|
+
return /* @__PURE__ */ o.jsxs("div", { className: n("kakadu-components-989891841", e && (t || s) ? n(!!t && "kakadu-components-497190725", !!s && "kakadu-components-3729381008") : "kakadu-components-3866032606"), children: [
|
|
34
|
+
/* @__PURE__ */ o.jsxs(C, { ...h, reference: i, as: a ? "a" : "button", type: a ? void 0 : "button", href: a ? l : void 0, target: a ? c : void 0, rel: a ? x : void 0, disabled: a ? void 0 : m, inert: a ? m : void 0, className: n(b, "kakadu-components-4279134239", u === "delete" && F, r && "kakadu-components-2662775151", f), children: [
|
|
35
|
+
/* @__PURE__ */ o.jsxs(N, { direction: "row", gap: 0.5, preset: "center", children: [
|
|
36
|
+
t ? /* @__PURE__ */ o.jsx("div", { className: n("kakadu-components-743909038", e ? "kakadu-components-1285017646" : "kakadu-components-1475172827"), children: typeof t == "string" ? /* @__PURE__ */ o.jsx(p, { width: 14, height: 14, type: t }) : t }) : null,
|
|
37
|
+
e ? /* @__PURE__ */ o.jsx("span", { className: n("kakadu-components-743909038", v && "kakadu-components-2703794515"), children: e }) : /* @__PURE__ */ o.jsx(z, { children: y }),
|
|
38
|
+
s ? /* @__PURE__ */ o.jsx("div", { className: n("kakadu-components-743909038", e ? "kakadu-components-2421728947" : "kakadu-components-1475172827"), children: typeof s == "string" ? /* @__PURE__ */ o.jsx(p, { width: 14, height: 14, type: s }) : s }) : null
|
|
38
39
|
] }),
|
|
39
40
|
/* @__PURE__ */ o.jsxs("span", { className: "kakadu-components-1970948853", children: [
|
|
40
|
-
|
|
41
|
-
/* @__PURE__ */ o.jsx(
|
|
42
|
-
/* @__PURE__ */ o.jsx(
|
|
41
|
+
m ? null : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
42
|
+
/* @__PURE__ */ o.jsx(w, { size: e ? void 0 : 50 }),
|
|
43
|
+
/* @__PURE__ */ o.jsx(A, { size: e ? void 0 : 50, className: g })
|
|
43
44
|
] }),
|
|
44
|
-
d ? /* @__PURE__ */ o.jsx(
|
|
45
|
+
d ? /* @__PURE__ */ o.jsx(T, { label: d, position: k }) : null
|
|
45
46
|
] })
|
|
46
47
|
] }),
|
|
47
|
-
|
|
48
|
+
r ? /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-1970948853", children: /* @__PURE__ */ o.jsx(D, { width: "100%", height: "100%", isAnimated: B }) }) : null
|
|
48
49
|
] });
|
|
49
50
|
}
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
Q as default,
|
|
53
|
+
P as textButtonVariants
|
|
53
54
|
};
|