@kakadu/components 1.7.11 → 1.7.13
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.d.ts +6 -1
- package/build/components/button-tooltip.js +1 -1
- package/build/components/button-tooltip.mjs +10 -7
- package/build/components/button.d.ts +3 -1
- package/build/components/button.js +1 -1
- package/build/components/button.mjs +37 -36
- package/build/components/card.js +1 -1
- package/build/components/card.mjs +1 -1
- package/build/components/datum.js +1 -1
- package/build/components/datum.mjs +1 -1
- package/build/components/icon-button.d.ts +3 -1
- package/build/components/icon-button.js +1 -1
- package/build/components/icon-button.mjs +25 -24
- package/build/components/input.d.ts +8 -1
- package/build/components/input.js +2 -2
- package/build/components/input.mjs +135 -123
- package/build/components/modal.js +1 -1
- package/build/components/modal.mjs +1 -1
- package/build/components/notice.js +1 -1
- package/build/components/notice.mjs +1 -1
- package/build/components/text-button.d.ts +3 -1
- package/build/components/text-button.js +1 -1
- package/build/components/text-button.mjs +24 -23
- package/build/components.css +1 -1
- package/build/icon-B__SNDvD.js +1 -0
- package/build/{icon-C6X3pQX0.mjs → icon-BscWXhKi.mjs} +53 -31
- package/build/icons/icon.d.ts +1 -0
- package/build/icons/icon.js +1 -1
- package/build/icons/icon.mjs +1 -1
- package/build/icons/select.d.ts +2 -0
- package/build/index.js +1 -1
- package/build/index.mjs +154 -153
- package/package.json +1 -1
- package/build/icon-Dw7yhWuE.js +0 -1
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
export declare enum ButtonTooltipPosition {
|
|
2
|
+
top = "top",
|
|
3
|
+
bottom = "bottom"
|
|
4
|
+
}
|
|
1
5
|
export type ButtonTooltipProperties = {
|
|
2
6
|
readonly label: string;
|
|
7
|
+
readonly position?: ButtonTooltipPosition;
|
|
3
8
|
readonly className?: string;
|
|
4
9
|
};
|
|
5
|
-
export default function ButtonTooltip({ label, className, }: ButtonTooltipProperties): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default function ButtonTooltip({ label, position, className, }: ButtonTooltipProperties): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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 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 r({label:t,position:o="top",className:e}){return n.jsxRuntimeExports.jsx("div",{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-2190282712",o==="top"&&"kakadu-components-2481216458",o==="bottom"&&"kakadu-components-840064340",e),children:t})})}exports.ButtonTooltipPosition=a;exports.default=r;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { cx as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { j as m } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
+
import { cx as n } from "@kuma-ui/core";
|
|
3
|
+
var e = /* @__PURE__ */ ((o) => (o.top = "top", o.bottom = "bottom", o))(e || {});
|
|
4
|
+
function k({
|
|
5
|
+
label: o,
|
|
6
|
+
position: t = "top",
|
|
7
|
+
className: a
|
|
6
8
|
}) {
|
|
7
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ m.jsx("div", { 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-2190282712", t === "top" && "kakadu-components-2481216458", t === "bottom" && "kakadu-components-840064340", a), children: o }) });
|
|
8
10
|
}
|
|
9
11
|
export {
|
|
10
|
-
|
|
12
|
+
e as ButtonTooltipPosition,
|
|
13
|
+
k as default
|
|
11
14
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode, type HTMLProps } from 'react';
|
|
2
2
|
import { type IconType } from '../icons/icon';
|
|
3
|
+
import { type ButtonTooltipPosition } from './button-tooltip';
|
|
3
4
|
export declare enum ButtonVariant {
|
|
4
5
|
primary = "primary",
|
|
5
6
|
secondary = "secondary",
|
|
@@ -13,6 +14,7 @@ export declare const buttonDangerStyles: string;
|
|
|
13
14
|
type BaseButtonProperties = Omit<HTMLProps<HTMLButtonElement>, 'children'> & {
|
|
14
15
|
readonly variant?: ButtonVariant;
|
|
15
16
|
readonly tooltip?: string;
|
|
17
|
+
readonly tooltipPosition?: ButtonTooltipPosition;
|
|
16
18
|
readonly iconLeft?: IconType | ReactNode;
|
|
17
19
|
readonly iconRight?: IconType | ReactNode;
|
|
18
20
|
readonly isLoading?: boolean;
|
|
@@ -28,5 +30,5 @@ export type ButtonProperties = BaseButtonProperties & ({
|
|
|
28
30
|
children?: never;
|
|
29
31
|
label: string;
|
|
30
32
|
});
|
|
31
|
-
export default function Button({ type, variant, href, target, rel, disabled, className, children, label, tooltip, iconLeft, iconRight, isLoading, hasMovingGradients, movingGradientsCount, hasMovingStars, movingStarsCount, ...properties }: ButtonProperties): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export default function Button({ type, variant, href, target, rel, disabled, className, children, label, tooltip, tooltipPosition, iconLeft, iconRight, isLoading, hasMovingGradients, movingGradientsCount, hasMovingStars, movingStarsCount, ...properties }: ButtonProperties): import("react/jsx-runtime").JSX.Element;
|
|
32
34
|
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"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),D=require("react"),a=require("@kuma-ui/core"),T=require("../theme.js"),G=require("../icon-B__SNDvD.js"),I=require("./spinner.js"),z=require("./moving-gradients.js"),W=require("./moving-stars.js"),$=require("./theme-setter.js"),F=require("./click-ripples.js"),k=require("./hover-gradient.js"),O=require("./button-tooltip.js"),P=require("./aria-text.js"),A=require("./atom.js");var y=(s=>(s.primary="primary",s.secondary="secondary",s.warning="warning",s.danger="danger",s))(y||{});function j({icon:s,variant:n="primary",className:o,...r}){return e.jsxRuntimeExports.jsx("div",{...r,className:a.cx("kakadu-components-2658660333",n==="secondary"&&"kakadu-components-3469662110",o),children:typeof s=="string"?e.jsxRuntimeExports.jsx(G.Icon,{width:14,height:14,type:s}):s})}const R="kakadu-components-2244098950",C="kakadu-components-3923184173",S="kakadu-components-317965671",E="kakadu-components-1978976872";function H({type:s,variant:n="primary",href:o,target:r,rel:b,disabled:m,className:f,children:t,label:q,tooltip:i,tooltipPosition:g,iconLeft:u,iconRight:p,isLoading:c,hasMovingGradients:_=!1,movingGradientsCount:x=4,hasMovingStars:v=!1,movingStarsCount:l=10,...N}){const d=D.useRef(null),w=$.useIsDarkMode(d),M=s??"button",h=_&&x>0,B=v&&l>0;return e.jsxRuntimeExports.jsxs(A.default,{...N,as:o?"a":"button",type:o?void 0:M,href:o,target:r,rel:b,disabled:!!m||!!c,className:a.cx(T.effectStyles,"kakadu-components-1897763514",!!u&&"kakadu-components-3652831856",!t&&"kakadu-components-2746167644",n==="secondary"&&R,n==="warning"&&S,n==="danger"&&E,f),children:[u?e.jsxRuntimeExports.jsx(j,{variant:n,icon:u,className:t?"kakadu-components-294089230":void 0}):null,t?e.jsxRuntimeExports.jsx("div",{ref:d,className:"kakadu-components-2618257692",children:t}):e.jsxRuntimeExports.jsx(P.default,{children:q}),p?e.jsxRuntimeExports.jsx(j,{variant:n,icon:p,className:t?"kakadu-components-3127707672":void 0}):null,e.jsxRuntimeExports.jsx("div",{className:a.cx("kakadu-components-1029011626",c&&"kakadu-components-726496666"),children:e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-772420116",children:e.jsxRuntimeExports.jsx(I.RevealSpinner,{isVisible:c})})}),h&&e.jsxRuntimeExports.jsx(z.default,{opacity:w?.4:.3,maximumGradientsCount:x,className:a.cx("kakadu-components-1505766785",n==="secondary"&&"kakadu-components-3712045697")}),B&&e.jsxRuntimeExports.jsx(W.default,{maximumStarsCount:l,className:"kakadu-components-2813474662"}),m?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(F.default,{size:t?void 0:50}),e.jsxRuntimeExports.jsx(k.default,{size:t?void 0:50,className:n==="secondary"?k.normalBlendStyles:void 0})]}),i?e.jsxRuntimeExports.jsx(O.default,{label:i,position:g}):null]})}exports.ButtonVariant=y;exports.buttonDangerStyles=E;exports.buttonSecondaryStyles=R;exports.buttonSuccessStyles=C;exports.buttonWarningStyles=S;exports.default=H;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { j as o } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useRef as
|
|
2
|
+
import { useRef as I } from "react";
|
|
3
3
|
import { cx as t } from "@kuma-ui/core";
|
|
4
|
-
import { effectStyles as
|
|
5
|
-
import { I as
|
|
6
|
-
import { RevealSpinner as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useIsDarkMode as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
var
|
|
4
|
+
import { effectStyles as D } from "../theme.mjs";
|
|
5
|
+
import { I as G } from "../icon-BscWXhKi.mjs";
|
|
6
|
+
import { RevealSpinner as R } from "./spinner.mjs";
|
|
7
|
+
import T from "./moving-gradients.mjs";
|
|
8
|
+
import h from "./moving-stars.mjs";
|
|
9
|
+
import { useIsDarkMode as z } from "./theme-setter.mjs";
|
|
10
|
+
import A from "./click-ripples.mjs";
|
|
11
|
+
import C, { normalBlendStyles as E } from "./hover-gradient.mjs";
|
|
12
|
+
import F from "./button-tooltip.mjs";
|
|
13
|
+
import H from "./aria-text.mjs";
|
|
14
|
+
import W from "./atom.mjs";
|
|
15
|
+
var q = /* @__PURE__ */ ((s) => (s.primary = "primary", s.secondary = "secondary", s.warning = "warning", s.danger = "danger", s))(q || {});
|
|
16
16
|
function x({
|
|
17
17
|
icon: s,
|
|
18
18
|
variant: n = "primary",
|
|
19
19
|
className: a,
|
|
20
20
|
...m
|
|
21
21
|
}) {
|
|
22
|
-
return /* @__PURE__ */ o.jsx("div", { ...m, className: t("kakadu-components-2658660333", n === "secondary" && "kakadu-components-3469662110", a), children: typeof s == "string" ? /* @__PURE__ */ o.jsx(
|
|
22
|
+
return /* @__PURE__ */ o.jsx("div", { ...m, className: t("kakadu-components-2658660333", n === "secondary" && "kakadu-components-3469662110", a), children: typeof s == "string" ? /* @__PURE__ */ o.jsx(G, { width: 14, height: 14, type: s }) : s });
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
function
|
|
24
|
+
const J = "kakadu-components-2244098950", ao = "kakadu-components-3923184173", K = "kakadu-components-317965671", O = "kakadu-components-1978976872";
|
|
25
|
+
function to({
|
|
26
26
|
type: s,
|
|
27
27
|
variant: n = "primary",
|
|
28
28
|
href: a,
|
|
@@ -33,35 +33,36 @@ function ao({
|
|
|
33
33
|
children: e,
|
|
34
34
|
label: j,
|
|
35
35
|
tooltip: d,
|
|
36
|
+
tooltipPosition: S,
|
|
36
37
|
iconLeft: r,
|
|
37
38
|
iconRight: u,
|
|
38
39
|
isLoading: c,
|
|
39
|
-
hasMovingGradients:
|
|
40
|
-
movingGradientsCount:
|
|
41
|
-
hasMovingStars:
|
|
42
|
-
movingStarsCount:
|
|
43
|
-
...
|
|
40
|
+
hasMovingGradients: g = !1,
|
|
41
|
+
movingGradientsCount: i = 4,
|
|
42
|
+
hasMovingStars: N = !1,
|
|
43
|
+
movingStarsCount: l = 10,
|
|
44
|
+
...b
|
|
44
45
|
}) {
|
|
45
|
-
const k =
|
|
46
|
-
return /* @__PURE__ */ o.jsxs(
|
|
46
|
+
const k = I(null), v = z(k), w = s ?? "button", M = g && i > 0, B = N && l > 0;
|
|
47
|
+
return /* @__PURE__ */ o.jsxs(W, { ...b, as: a ? "a" : "button", type: a ? void 0 : w, href: a, target: m, rel: y, disabled: !!p || !!c, className: t(D, "kakadu-components-1897763514", !!r && "kakadu-components-3652831856", !e && "kakadu-components-2746167644", n === "secondary" && J, n === "warning" && K, n === "danger" && O, f), children: [
|
|
47
48
|
r ? /* @__PURE__ */ o.jsx(x, { variant: n, icon: r, className: e ? "kakadu-components-294089230" : void 0 }) : null,
|
|
48
|
-
e ? /* @__PURE__ */ o.jsx("div", { ref: k, className: "kakadu-components-2618257692", children: e }) : /* @__PURE__ */ o.jsx(
|
|
49
|
+
e ? /* @__PURE__ */ o.jsx("div", { ref: k, className: "kakadu-components-2618257692", children: e }) : /* @__PURE__ */ o.jsx(H, { children: j }),
|
|
49
50
|
u ? /* @__PURE__ */ o.jsx(x, { variant: n, icon: u, className: e ? "kakadu-components-3127707672" : void 0 }) : null,
|
|
50
|
-
/* @__PURE__ */ o.jsx("div", { className: t("kakadu-components-1029011626", c && "kakadu-components-726496666"), children: /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-772420116", children: /* @__PURE__ */ o.jsx(
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
/* @__PURE__ */ o.jsx("div", { className: t("kakadu-components-1029011626", c && "kakadu-components-726496666"), children: /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-772420116", children: /* @__PURE__ */ o.jsx(R, { isVisible: c }) }) }),
|
|
52
|
+
M && /* @__PURE__ */ o.jsx(T, { opacity: v ? 0.4 : 0.3, maximumGradientsCount: i, className: t("kakadu-components-1505766785", n === "secondary" && "kakadu-components-3712045697") }),
|
|
53
|
+
B && /* @__PURE__ */ o.jsx(h, { maximumStarsCount: l, className: "kakadu-components-2813474662" }),
|
|
53
54
|
p ? null : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
54
|
-
/* @__PURE__ */ o.jsx(
|
|
55
|
-
/* @__PURE__ */ o.jsx(
|
|
55
|
+
/* @__PURE__ */ o.jsx(A, { size: e ? void 0 : 50 }),
|
|
56
|
+
/* @__PURE__ */ o.jsx(C, { size: e ? void 0 : 50, className: n === "secondary" ? E : void 0 })
|
|
56
57
|
] }),
|
|
57
|
-
d ? /* @__PURE__ */ o.jsx(
|
|
58
|
+
d ? /* @__PURE__ */ o.jsx(F, { label: d, position: S }) : null
|
|
58
59
|
] });
|
|
59
60
|
}
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
q as ButtonVariant,
|
|
63
|
+
O as buttonDangerStyles,
|
|
64
|
+
J as buttonSecondaryStyles,
|
|
65
|
+
ao as buttonSuccessStyles,
|
|
66
|
+
K as buttonWarningStyles,
|
|
67
|
+
to as default
|
|
67
68
|
};
|
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"),a=require("@kuma-ui/core"),j=require("../theme.js"),r=require("../icon-
|
|
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"),j=require("../theme.js"),r=require("../icon-B__SNDvD.js"),t=require("./flex.js"),n=require("./text.js"),k=require("./click-ripples.js"),c=require("./hover-gradient.js"),h=require("./button.js"),R=require("./atom.js");function f({icon:o,title:i,description:u,action:l,href:s,target:m,rel:x,className:d,...p}){return e.jsxRuntimeExports.jsxs(R.default,{...p,as:s?"a":"button",type:s?void 0:"button",href:s,target:m,rel:x,className:a.cx(j.effectStyles,h.buttonSecondaryStyles,"kakadu-components-1387630570",d),children:[e.jsxRuntimeExports.jsxs(t.default,{gap:.5,direction:"column",children:[e.jsxRuntimeExports.jsx(n.Span,{className:"kakadu-components-1301774894",children:e.jsxRuntimeExports.jsxs(t.default,{gap:.5,direction:"row",alignment:t.FlexAlignment.start,children:[o?e.jsxRuntimeExports.jsx(r.Icon,{width:16,height:16,type:o,className:a.cx(r.iconShadowStyles,"kakadu-components-782417605")}):null,i]})}),e.jsxRuntimeExports.jsx(n.Paragraph,{className:"kakadu-components-3061837309",children:u}),e.jsxRuntimeExports.jsx(t.default,{alignment:t.FlexAlignment.end,children:e.jsxRuntimeExports.jsx(n.Span,{className:"kakadu-components-777975485",children:l})})]}),e.jsxRuntimeExports.jsx(k.default,{size:250,className:"kakadu-components-2967167444"}),e.jsxRuntimeExports.jsx(c.default,{size:300,className:c.normalBlendStyles})]})}exports.default=f;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as o } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
2
|
import { cx as t } from "@kuma-ui/core";
|
|
3
3
|
import { effectStyles as u } from "../theme.mjs";
|
|
4
|
-
import { I as k, i as f } from "../icon-
|
|
4
|
+
import { I as k, i as f } from "../icon-BscWXhKi.mjs";
|
|
5
5
|
import a, { FlexAlignment as n } from "./flex.mjs";
|
|
6
6
|
import { Span as m, Paragraph as j } from "./text.mjs";
|
|
7
7
|
import h from "./click-ripples.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),o=require("react"),u=require("../icon-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),o=require("react"),u=require("../icon-B__SNDvD.js"),t=require("./flex.js"),c=require("./text.js"),r=require("./icon-button.js");function x({title:a,value:l,hasCopyButton:p}){const n=o.useRef(null),[s,i]=o.useState(!1),m=o.useCallback(()=>{i(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{i(!1)},2e3)},[]);return e.jsxRuntimeExports.jsxs(t.default,{direction:"row",gap:1.5,alignment:t.FlexAlignment.start,children:[e.jsxRuntimeExports.jsxs(t.default,{fill:!0,gap:.375,alignment:t.FlexAlignment.start,children:[e.jsxRuntimeExports.jsx(c.Span,{className:"kakadu-components-3772513716",children:a}),e.jsxRuntimeExports.jsx(c.Span,{className:"kakadu-components-2497879239",children:l})]}),p?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(r.default,{icon:s?u.IconType.check:u.IconType.copy,label:s?"Kopiert!":"Kopier",variant:s?r.IconButtonVariant.success:r.IconButtonVariant.default,onClick:m})}):null]})}exports.default=x;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
2
|
import { useRef as f, useState as d, useCallback as x } from "react";
|
|
3
|
-
import { a as r } from "../icon-
|
|
3
|
+
import { a as r } from "../icon-BscWXhKi.mjs";
|
|
4
4
|
import s, { FlexAlignment as a } from "./flex.mjs";
|
|
5
5
|
import { Span as i } from "./text.mjs";
|
|
6
6
|
import j, { IconButtonVariant as c } from "./icon-button.mjs";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type HTMLProps } from 'react';
|
|
2
2
|
import { type IconType } from '../icons/icon';
|
|
3
|
+
import { type ButtonTooltipPosition } from './button-tooltip';
|
|
3
4
|
export declare enum IconButtonVariant {
|
|
4
5
|
default = "default",
|
|
5
6
|
success = "success",
|
|
@@ -10,5 +11,6 @@ export type IconButtonProperties = HTMLProps<HTMLButtonElement> & {
|
|
|
10
11
|
readonly icon: IconType;
|
|
11
12
|
readonly variant?: IconButtonVariant;
|
|
12
13
|
readonly label: string;
|
|
14
|
+
readonly tooltipPosition?: ButtonTooltipPosition;
|
|
13
15
|
};
|
|
14
|
-
export default function IconButton({ icon, variant, label, disabled, className, ...properties }: IconButtonProperties): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default function IconButton({ icon, variant, label, tooltipPosition, disabled, 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"),a=require("../icon-
|
|
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"),a=require("../icon-B__SNDvD.js"),k=require("../theme.js"),q=require("./theme-setter.js"),i=require("./button.js"),b=require("./aria-text.js"),w=require("./button-tooltip.js"),_=require("./click-ripples.js"),j=require("./hover-gradient.js");var h=(e=>(e.default="default",e.success="success",e.warning="warning",e.danger="danger",e))(h||{});function T({icon:e,variant:o="default",label:d,tooltipPosition:S,disabled:m,className:R,...g}){const y=q.useIsDarkMode(),[u,E]=s.useState(e),[x,l]=s.useState(!1),p=s.useRef(e),c=s.useRef(null);s.useEffect(()=>{p.current=e},[e]);const r=s.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]);return s.useEffect(()=>{if(u===e){l(f=>f&&!1);return}l(!0),r(),c.current=setTimeout(()=>{l(!1),E(p.current)},370)},[u,e,r]),s.useEffect(()=>()=>{r()},[r]),t.jsxRuntimeExports.jsxs("button",{...g,type:"button",disabled:m,className:n.cx(k.buttonResetStyles,k.effectStyles,"kakadu-components-3515018630",o==="default"&&n.cx(i.buttonSecondaryStyles,"kakadu-components-2089159949"),o==="success"&&n.cx(i.buttonSuccessStyles,"kakadu-components-4088931955"),o==="warning"&&n.cx(i.buttonWarningStyles,"kakadu-components-1450399719"),o==="danger"&&n.cx(i.buttonDangerStyles,"kakadu-components-3594030066"),R),children:[t.jsxRuntimeExports.jsxs("span",{"data-theme":o==="default"?y?"dark":"light":"dark",className:"kakadu-components-2197738751",children:[t.jsxRuntimeExports.jsx(a.Icon,{width:16,height:16,type:u,className:n.cx(a.iconShadowStyles,"kakadu-components-1309118222",x&&"kakadu-components-3602476657")}),u===e?null:t.jsxRuntimeExports.jsx(a.Icon,{width:16,height:16,type:e,className:n.cx(a.iconShadowStyles,"kakadu-components-2883440801",x&&"kakadu-components-1406924214")})]}),t.jsxRuntimeExports.jsx(b.default,{children:d}),t.jsxRuntimeExports.jsx(w.default,{label:d,position:S}),m?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(_.default,{size:50}),t.jsxRuntimeExports.jsx(j.default,{size:50,className:o==="default"?j.normalBlendStyles:void 0})]})]})}exports.IconButtonVariant=h;exports.default=T;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { j as t } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useState as p, useRef as k, useEffect as c, useCallback as
|
|
2
|
+
import { useState as p, useRef as k, useEffect as c, useCallback as b } from "react";
|
|
3
3
|
import { cx as s } from "@kuma-ui/core";
|
|
4
|
-
import { I as h, i as g } from "../icon-
|
|
5
|
-
import { buttonResetStyles as
|
|
6
|
-
import { useIsDarkMode as
|
|
7
|
-
import { buttonSecondaryStyles as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
var
|
|
13
|
-
function
|
|
4
|
+
import { I as h, i as g } from "../icon-BscWXhKi.mjs";
|
|
5
|
+
import { buttonResetStyles as R, effectStyles as N } from "../theme.mjs";
|
|
6
|
+
import { useIsDarkMode as T } from "./theme-setter.mjs";
|
|
7
|
+
import { buttonSecondaryStyles as I, buttonSuccessStyles as D, buttonWarningStyles as z, buttonDangerStyles as C } from "./button.mjs";
|
|
8
|
+
import E from "./aria-text.mjs";
|
|
9
|
+
import M from "./button-tooltip.mjs";
|
|
10
|
+
import A from "./click-ripples.mjs";
|
|
11
|
+
import F, { normalBlendStyles as G } from "./hover-gradient.mjs";
|
|
12
|
+
var H = /* @__PURE__ */ ((e) => (e.default = "default", e.success = "success", e.warning = "warning", e.danger = "danger", e))(H || {});
|
|
13
|
+
function Y({
|
|
14
14
|
icon: e,
|
|
15
15
|
variant: o = "default",
|
|
16
16
|
label: m,
|
|
17
|
+
tooltipPosition: x,
|
|
17
18
|
disabled: l,
|
|
18
|
-
className:
|
|
19
|
-
...
|
|
19
|
+
className: S,
|
|
20
|
+
...y
|
|
20
21
|
}) {
|
|
21
|
-
const
|
|
22
|
+
const j = T(), [r, w] = p(e), [i, a] = p(!1), d = k(e), n = k(null);
|
|
22
23
|
c(() => {
|
|
23
24
|
d.current = e;
|
|
24
25
|
}, [e]);
|
|
25
|
-
const u =
|
|
26
|
+
const u = b(() => {
|
|
26
27
|
n.current && (clearTimeout(n.current), n.current = null);
|
|
27
28
|
}, []);
|
|
28
29
|
return c(() => {
|
|
@@ -31,24 +32,24 @@ function X({
|
|
|
31
32
|
return;
|
|
32
33
|
}
|
|
33
34
|
a(!0), u(), n.current = setTimeout(() => {
|
|
34
|
-
a(!1),
|
|
35
|
+
a(!1), w(d.current);
|
|
35
36
|
}, 370);
|
|
36
37
|
}, [r, e, u]), c(() => () => {
|
|
37
38
|
u();
|
|
38
|
-
}, [u]), /* @__PURE__ */ t.jsxs("button", { ...
|
|
39
|
-
/* @__PURE__ */ t.jsxs("span", { "data-theme": o === "default" ?
|
|
39
|
+
}, [u]), /* @__PURE__ */ t.jsxs("button", { ...y, type: "button", disabled: l, className: s(R, N, "kakadu-components-3515018630", o === "default" && s(I, "kakadu-components-2089159949"), o === "success" && s(D, "kakadu-components-4088931955"), o === "warning" && s(z, "kakadu-components-1450399719"), o === "danger" && s(C, "kakadu-components-3594030066"), S), children: [
|
|
40
|
+
/* @__PURE__ */ t.jsxs("span", { "data-theme": o === "default" ? j ? "dark" : "light" : "dark", className: "kakadu-components-2197738751", children: [
|
|
40
41
|
/* @__PURE__ */ t.jsx(h, { width: 16, height: 16, type: r, className: s(g, "kakadu-components-1309118222", i && "kakadu-components-3602476657") }),
|
|
41
42
|
r === e ? null : /* @__PURE__ */ t.jsx(h, { width: 16, height: 16, type: e, className: s(g, "kakadu-components-2883440801", i && "kakadu-components-1406924214") })
|
|
42
43
|
] }),
|
|
43
|
-
/* @__PURE__ */ t.jsx(
|
|
44
|
-
/* @__PURE__ */ t.jsx(
|
|
44
|
+
/* @__PURE__ */ t.jsx(E, { children: m }),
|
|
45
|
+
/* @__PURE__ */ t.jsx(M, { label: m, position: x }),
|
|
45
46
|
l ? null : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
46
|
-
/* @__PURE__ */ t.jsx(
|
|
47
|
-
/* @__PURE__ */ t.jsx(
|
|
47
|
+
/* @__PURE__ */ t.jsx(A, { size: 50 }),
|
|
48
|
+
/* @__PURE__ */ t.jsx(F, { size: 50, className: o === "default" ? G : void 0 })
|
|
48
49
|
] })
|
|
49
50
|
] });
|
|
50
51
|
}
|
|
51
52
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
H as IconButtonVariant,
|
|
54
|
+
Y as default
|
|
54
55
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ChangeEvent, type HTMLProps, type ReactNode } from 'react';
|
|
2
|
+
import { IconType } from '../icons/icon';
|
|
2
3
|
export declare const errorParagraph: string;
|
|
3
4
|
type LabelProperties = HTMLProps<HTMLLabelElement> & {
|
|
4
5
|
readonly label: string;
|
|
@@ -20,12 +21,18 @@ export type SelectProperties = Omit<ControllerProperties & HTMLProps<HTMLSelectE
|
|
|
20
21
|
};
|
|
21
22
|
export declare function Select({ label, options, error, warning, footnote, className, onChange, ...properties }: SelectProperties): import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
type InputType = HTMLInputElement | HTMLTextAreaElement;
|
|
24
|
+
export type InputAction = {
|
|
25
|
+
icon: IconType;
|
|
26
|
+
label: string;
|
|
27
|
+
onClick: () => void;
|
|
28
|
+
};
|
|
23
29
|
export type InputProperties = Omit<ControllerProperties & HTMLProps<InputType>, 'onChange'> & {
|
|
24
30
|
readonly suggestion?: string;
|
|
31
|
+
readonly actions?: InputAction[];
|
|
25
32
|
readonly hasCopyButton?: boolean;
|
|
26
33
|
readonly hasClearButton?: boolean;
|
|
27
34
|
readonly isMultiline?: boolean;
|
|
28
35
|
readonly onChange?: (value: string, event: ChangeEvent<InputType>) => void;
|
|
29
36
|
};
|
|
30
|
-
export default function Input({ type, label, error, warning, footnote, suggestion, hasCopyButton, hasClearButton, isMultiline, onChange, className, ...properties }: InputProperties): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export default function Input({ type, label, error, warning, footnote, suggestion, actions, hasCopyButton, hasClearButton, isMultiline, onChange, className, ...properties }: InputProperties): import("react/jsx-runtime").JSX.Element;
|
|
31
38
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
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"),u=require("@kuma-ui/core"),
|
|
2
|
-
`):[],[
|
|
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"),u=require("@kuma-ui/core"),re=require("../icons/chevron-up.js"),P=require("../icon-B__SNDvD.js"),U=require("../utilities/copy-to-clipboard.js"),L=require("../theme.js"),ie=require("./button-tooltip.js"),T=require("./text-button.js"),g=require("./text.js"),ue=require("./collapsible.js"),z=require("./click-ripples.js"),D=require("./hover-gradient.js"),xe=require("./notification.js"),pe=require("./notice.js"),de="kakadu-components-922159086",me="kakadu-components-2436386418",I="kakadu-components-1816130686",G="kakadu-components-4056037255",J=u.cx(G,"kakadu-components-3245407458"),je=u.cx(G,"kakadu-components-1117160492");function ke({as:d,className:o,...x}){return e.jsxRuntimeExports.jsx(g.Span,{as:d??"span",...x,className:u.cx("kakadu-components-3574036749",o)})}function K({label:d,error:o,errorId:x,warning:c,warningId:R,footnote:s,attachments:l,className:m,children:j,...b}){const p=!!o,r=!!c,k=!!s;return e.jsxRuntimeExports.jsx("label",{...b,className:u.cx(de,m),children:e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-3146929190",children:[e.jsxRuntimeExports.jsx(g.Span,{className:u.cx(L.overflowProtectionStyles,me),children:e.jsxRuntimeExports.jsx("span",{children:d})}),e.jsxRuntimeExports.jsxs("span",{className:"kakadu-components-3298764637",children:[j,k?e.jsxRuntimeExports.jsx(ke,{className:"kakadu-components-613632806",children:s}):null,l]}),p||r?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-2927674627",children:p?e.jsxRuntimeExports.jsx(g.Paragraph,{id:x,className:J,children:o instanceof Error?o.message:o}):r?e.jsxRuntimeExports.jsx(g.Paragraph,{id:R,className:je,children:c instanceof Error?c.message:c}):null}):null]})})}function fe({label:d,options:o,error:x,warning:c,footnote:R,className:s,onChange:l,...m}){const j=t.useId(),b=`${j}-error`,p=`${j}-warning`,r=!!x,k=!r&&!!c,N=r?b:k?p:void 0,{value:h}=m,[y,v]=t.useState(""),S=h??y;t.useEffect(()=>{v(typeof h=="string"?h:"")},[h]);const _=t.useCallback(f=>{const{value:E}=f.target;v(E),l==null||l(E,f)},[l]);return e.jsxRuntimeExports.jsxs(K,{label:d,error:x,warning:c,footnote:R,children:[e.jsxRuntimeExports.jsx("select",{...m,value:S,"aria-invalid":r,"data-warning":k,"aria-describedby":N,className:u.cx(I,"kakadu-components-4228384787",s),onChange:_,children:o.map(f=>e.jsxRuntimeExports.jsx("option",{value:f.value,children:f.label},f.value))}),e.jsxRuntimeExports.jsx(re.default,{width:14,height:14,className:"kakadu-components-158931186"})]})}const he=40,M="kakadu-components-4233741488";function Ee({type:d,label:o,error:x,warning:c,footnote:R,suggestion:s,actions:l=[],hasCopyButton:m,hasClearButton:j,isMultiline:b,onChange:p,className:r,...k}){const N=t.useRef(null),h=t.useRef(null),y=t.useRef(null),v=xe.useCreateNotification(),S=t.useId(),_=`${S}-error`,f=`${S}-warning`,{value:E,disabled:Q}=k,[X,$]=t.useState(""),i=E??X,[Y,Z]=t.useState(),ee=d==="textarea"||!!b;t.useLayoutEffect(()=>{typeof i=="string"&&y.current&&Z(y.current.scrollHeight)},[i]);const w=t.useMemo(()=>typeof i=="string"?`${i} `.split(`
|
|
2
|
+
`):[],[i]),te=t.useMemo(()=>w.length,[w]),q=!!x,B=!q&&!!c,V=q?_:B?f:void 0;t.useEffect(()=>{$(typeof E=="string"?E:"")},[E]);const H=t.useCallback(n=>{const{value:a}=n.target;$(a),p==null||p(a,n)},[p]),se=t.useCallback(()=>{typeof i=="string"&&(U.default(i),v({type:pe.NoticeType.success,children:"Copied to clipboard."}))},[i,v]),C=t.useCallback(n=>{var O;const a=h.current??N.current??void 0;if(a){const W=(O=Object.getOwnPropertyDescriptor(a instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,"value"))==null?void 0:O.set;if(W){W.call(a,n);const le=new Event("input",{bubbles:!0});a.dispatchEvent(le),a.focus();return}}throw new Error("Unable to set value.")},[]),ne=t.useCallback(()=>{C("")},[C]),[ae,oe]=t.useState(""),A=!!s&&ae!==s,ce=t.useCallback(()=>{if(s){try{C(s)}catch{U.default(s)}oe(s)}},[s,C]),F=t.useMemo(()=>l.length,[l]);return e.jsxRuntimeExports.jsxs(K,{label:o,error:x,warning:c,footnote:R,attachments:e.jsxRuntimeExports.jsx(ue.default,{isCollapsed:!A,children:A?e.jsxRuntimeExports.jsxs("button",{type:"button",className:u.cx(L.buttonResetStyles,L.overflowProtectionStyles,"kakadu-components-2355856341"),onClick:ce,children:[e.jsxRuntimeExports.jsx(ie.default,{label:"Apply suggestion"}),e.jsxRuntimeExports.jsx(P.SparkleSvg,{width:13,height:13,className:"kakadu-components-1021263934"}),e.jsxRuntimeExports.jsx(g.Span,{className:"kakadu-components-1585874956",children:s}),e.jsxRuntimeExports.jsx(z.default,{className:"kakadu-components-3448565402"}),e.jsxRuntimeExports.jsx(D.default,{})]}):null}),style:{"--button-padding":`calc(${he*((m?1:0)+(j?1:0)+F)}px + 6px)`},children:[e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-3146929190",children:[ee?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{ref:y,"aria-hidden":!0,className:u.cx(I,r,"kakadu-components-2033521835"),children:[w.map((n,a)=>e.jsxRuntimeExports.jsxs("span",{children:[n,te>1?e.jsxRuntimeExports.jsx("br",{}):null]},a))," "]}),e.jsxRuntimeExports.jsx("textarea",{...k,ref:h,rows:1,"aria-invalid":q,"data-warning":B,"aria-describedby":V,value:i,className:u.cx(I,r,"kakadu-components-2119524139"),style:{minHeight:Y},onChange:H})]}):e.jsxRuntimeExports.jsx("input",{...k,ref:N,type:d??"text",value:i,"aria-invalid":q,"data-warning":B,"aria-describedby":V,className:u.cx(I,r),onChange:H}),Q?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(z.default,{className:"kakadu-components-616311160"}),e.jsxRuntimeExports.jsx(D.default,{className:"kakadu-components-1962999040"})]})]}),m||j||F>0?e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-131986363",children:[l.map((n,a)=>e.jsxRuntimeExports.jsx(T.default,{iconLeft:n.icon,label:n.label,tooltip:n.label,className:M,onClick:n.onClick},n.label+a)),m?e.jsxRuntimeExports.jsx(T.default,{iconLeft:P.IconType.copy,label:"Copy",tooltip:"Copy",className:M,onClick:se}):null,j?e.jsxRuntimeExports.jsx(T.default,{iconLeft:P.IconType.times,label:"Clear",tooltip:"Clear",className:M,onClick:ne}):null]}):null]})}exports.Select=fe;exports.default=Ee;exports.errorParagraph=J;
|