@kakadu/components 6.1.1 → 6.3.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/aria-text.d.ts +2 -1
- package/build/components/box.d.ts +2 -1
- package/build/components/button-tooltip.d.ts +2 -1
- package/build/components/button.d.ts +3 -3
- package/build/components/button.js +1 -1
- package/build/components/button.mjs +27 -25
- package/build/components/card.d.ts +2 -2
- package/build/components/click-ripples.d.ts +2 -2
- package/build/components/click-ripples.js +1 -1
- package/build/components/click-ripples.mjs +50 -45
- package/build/components/collapsible.d.ts +2 -2
- package/build/components/combobox.d.ts +2 -2
- package/build/components/combobox.js +1 -1
- package/build/components/combobox.mjs +161 -159
- package/build/components/copy-icon-button.d.ts +2 -1
- package/build/components/datum.d.ts +2 -2
- package/build/components/dot.d.ts +2 -2
- package/build/components/flex.d.ts +2 -1
- package/build/components/footer.d.ts +2 -2
- package/build/components/gauge.d.ts +2 -1
- package/build/components/header.d.ts +2 -1
- package/build/components/hover-gradient.d.ts +2 -2
- package/build/components/hover-gradient.js +1 -1
- package/build/components/hover-gradient.mjs +48 -35
- package/build/components/icon-button.d.ts +2 -2
- package/build/components/input.d.ts +3 -3
- package/build/components/input.js +2 -2
- package/build/components/input.mjs +21 -21
- package/build/components/logos/akt-logo.d.ts +2 -2
- package/build/components/logos/amedia-logo.d.ts +2 -2
- package/build/components/logos/bankaxept-logo.d.ts +2 -2
- package/build/components/logos/bankid-logo.d.ts +2 -2
- package/build/components/logos/dnb-logo.d.ts +2 -2
- package/build/components/logos/entur-logo.d.ts +2 -2
- package/build/components/logos/gjensidige-logo.d.ts +2 -2
- package/build/components/logos/kakadu-academy-logo.d.ts +2 -2
- package/build/components/logos/kakadu-guide-icon.d.ts +2 -1
- package/build/components/logos/kakadu-guide-logo.d.ts +3 -3
- package/build/components/logos/kakadu-index-logo.d.ts +2 -2
- package/build/components/logos/kakadu-logo.d.ts +2 -2
- package/build/components/logos/kakadu-play-logo.d.ts +2 -2
- package/build/components/logos/kolumbus-logo.d.ts +2 -2
- package/build/components/logos/nordea-logo.d.ts +2 -2
- package/build/components/logos/norsk-tipping-logo.d.ts +2 -2
- package/build/components/logos/ruter-logo.d.ts +2 -2
- package/build/components/logos/senteret-for-et-aldersvennlig-norge-logo.d.ts +2 -2
- package/build/components/logos/sparebank1-logo.d.ts +2 -2
- package/build/components/logos/sparebanken-norge-logo.d.ts +2 -2
- package/build/components/logos/sto-logo.d.ts +2 -2
- package/build/components/logos/storebrand-logo.d.ts +2 -2
- package/build/components/modal.d.ts +6 -6
- package/build/components/modal.js +1 -1
- package/build/components/modal.mjs +86 -85
- package/build/components/moving-gradients.js +1 -1
- package/build/components/moving-gradients.mjs +80 -70
- package/build/components/moving-stars.js +1 -1
- package/build/components/moving-stars.mjs +77 -74
- package/build/components/notice.d.ts +2 -2
- package/build/components/notification.d.ts +8 -6
- package/build/components/notification.js +1 -1
- package/build/components/notification.mjs +87 -71
- package/build/components/popover-menu.d.ts +3 -3
- package/build/components/popover-menu.js +1 -1
- package/build/components/popover-menu.mjs +131 -129
- package/build/components/popover.d.ts +4 -4
- package/build/components/popover.js +1 -1
- package/build/components/popover.mjs +82 -73
- package/build/components/revealer.d.ts +2 -2
- package/build/components/select.d.ts +2 -2
- package/build/components/separator.d.ts +5 -5
- package/build/components/skeleton.d.ts +3 -2
- package/build/components/spinner.d.ts +3 -2
- package/build/components/text-button.d.ts +2 -2
- package/build/components/text.d.ts +9 -8
- package/build/components/theme-setter.d.ts +2 -2
- package/build/components/veil.d.ts +2 -1
- package/build/components/wrapper.d.ts +2 -2
- package/build/components.css +1 -1
- package/build/hooks/use-is-document-focused.js +1 -1
- package/build/hooks/use-is-document-focused.mjs +30 -14
- package/build/icons/anchor-down.d.ts +2 -2
- package/build/icons/anchor-up.d.ts +2 -2
- package/build/icons/arrow-down.d.ts +2 -2
- package/build/icons/arrow-left.d.ts +2 -2
- package/build/icons/arrow-right.d.ts +2 -2
- package/build/icons/arrow-up.d.ts +2 -2
- package/build/icons/caret-down.d.ts +2 -2
- package/build/icons/caret-left.d.ts +2 -2
- package/build/icons/caret-right.d.ts +2 -2
- package/build/icons/caret-up.d.ts +2 -2
- package/build/icons/check.d.ts +2 -2
- package/build/icons/chevron-down.d.ts +2 -2
- package/build/icons/chevron-left.d.ts +2 -2
- package/build/icons/chevron-right.d.ts +2 -2
- package/build/icons/chevron-up.d.ts +2 -2
- package/build/icons/chrome-browser-logo.d.ts +2 -2
- package/build/icons/cog.d.ts +2 -2
- package/build/icons/copy.d.ts +2 -2
- package/build/icons/document.d.ts +2 -2
- package/build/icons/dots.d.ts +2 -2
- package/build/icons/drag.d.ts +2 -2
- package/build/icons/edge-browser-logo.d.ts +2 -2
- package/build/icons/edit.d.ts +2 -2
- package/build/icons/exclamation-triangle.d.ts +2 -2
- package/build/icons/external.d.ts +2 -2
- package/build/icons/eye.d.ts +2 -2
- package/build/icons/icon.d.ts +2 -2
- package/build/icons/information.d.ts +2 -2
- package/build/icons/kakadu-guide-glyph.d.ts +2 -2
- package/build/icons/kakadu-guide-icon.d.ts +2 -2
- package/build/icons/menu.d.ts +2 -2
- package/build/icons/package.d.ts +2 -2
- package/build/icons/plus.d.ts +2 -2
- package/build/icons/select.d.ts +2 -2
- package/build/icons/share.d.ts +2 -2
- package/build/icons/sparkle.d.ts +2 -2
- package/build/icons/test.d.ts +2 -2
- package/build/icons/times.d.ts +2 -2
- package/build/icons/trash.d.ts +2 -2
- package/build/icons/trend-up.d.ts +2 -2
- package/build/index.d.ts +2 -0
- package/build/index.js +1 -1
- package/build/index.mjs +19 -17
- package/build/theme.d.ts +2 -1
- package/build/utilities/listeners.d.ts +5 -0
- package/build/utilities/listeners.js +1 -0
- package/build/utilities/listeners.mjs +16 -0
- package/package.json +16 -22
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type AtomElementType, type AtomProperties } from './atom';
|
|
2
3
|
export declare const ariaTextStyles: string;
|
|
3
4
|
type AriaTextProperties<Type extends AtomElementType = 'span'> = AtomProperties<Type>;
|
|
4
|
-
export default function AriaText<Type extends AtomElementType = 'span'>({ as, className, ...properties }: AriaTextProperties<Type>):
|
|
5
|
+
export default function AriaText<Type extends AtomElementType = 'span'>({ as, className, ...properties }: AriaTextProperties<Type>): React.JSX.Element;
|
|
5
6
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type DefaultAtomElementType, type AtomElementType, type AtomProperties } from './atom';
|
|
2
3
|
type BoxProperties<Type extends AtomElementType = DefaultAtomElementType> = AtomProperties<Type>;
|
|
3
|
-
export default function Box<Type extends AtomElementType = DefaultAtomElementType>({ as, className, ...properties }: BoxProperties<Type>):
|
|
4
|
+
export default function Box<Type extends AtomElementType = DefaultAtomElementType>({ as, className, ...properties }: BoxProperties<Type>): React.JSX.Element;
|
|
4
5
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
export declare const buttonTooltipPositions: readonly ["top", "bottom"];
|
|
2
3
|
export type ButtonTooltipPosition = (typeof buttonTooltipPositions)[number];
|
|
3
4
|
export type ButtonTooltipProperties = {
|
|
@@ -6,4 +7,4 @@ export type ButtonTooltipProperties = {
|
|
|
6
7
|
readonly position?: ButtonTooltipPosition;
|
|
7
8
|
readonly className?: string;
|
|
8
9
|
};
|
|
9
|
-
export default function ButtonTooltip({ id, label, position, className, }: ButtonTooltipProperties):
|
|
10
|
+
export default function ButtonTooltip({ id, label, position, className, }: ButtonTooltipProperties): React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type ReactNode, type HTMLProps } from 'react';
|
|
1
|
+
import React, { type ReactNode, type HTMLProps } from 'react';
|
|
2
2
|
import { type IconType } from '../icons/icon';
|
|
3
3
|
import { type ButtonTooltipPosition } from './button-tooltip';
|
|
4
4
|
export declare function ButtonLoader({ isLoading, size, className, }: {
|
|
5
5
|
readonly isLoading?: boolean;
|
|
6
6
|
readonly size?: number;
|
|
7
7
|
readonly className?: string;
|
|
8
|
-
}):
|
|
8
|
+
}): React.JSX.Element;
|
|
9
9
|
export declare const buttonVariants: readonly ["primary", "secondary", "warning", "danger"];
|
|
10
10
|
export type ButtonVariant = (typeof buttonVariants)[number];
|
|
11
11
|
export declare const buttonSecondaryStyles: string;
|
|
@@ -33,5 +33,5 @@ export type ButtonProperties = BaseButtonProperties & ({
|
|
|
33
33
|
children?: never;
|
|
34
34
|
label: string;
|
|
35
35
|
});
|
|
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):
|
|
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): React.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"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),b=require("react"),c=require("@kuma-ui/core"),f=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"),v=require("./hover-gradient.js"),J=require("./button-tooltip.js"),K=require("./aria-text.js"),Q=require("./atom.js"),U=require("./skeleton.js");function h({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 S({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 q="kakadu-components-2550769169",Y="kakadu-components-1998774084",g="kakadu-components-2945752235",N="kakadu-components-1546692192";function Z({ref:t,type:a,variant:s="primary",href:r,target:_,rel:B,disabled:w,className:T,children:n,label:D,tooltip:i,tooltipPosition:I,iconLeft:m,iconRight:l,isLoading:x,isSkeleton:u,isSkeletonAnimated:M=!0,hasMovingGradients:G=!1,movingGradientsCount:p=4,hasMovingStars:V=!1,movingStarsCount:k=10,...z}){const j=b.useId(),y=b.useRef(null),A=P.useIsDarkTheme(y),W=a??"button",R=G&&p>0,E=V&&k>0,o=r!==void 0&&!u,d=!!w||!!x||!!u;return e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-3559664923",children:[e.jsxRuntimeExports.jsxs(Q.default,{...z,reference:t,as:o?"a":"button",type:o?void 0:W,href:o?r:void 0,target:o?_:void 0,rel:o?B:void 0,"aria-describedby":i?j:void 0,disabled:o?void 0:d,inert:o?d:void 0,className:c.cx(f.effectStyles,f.overlayEffectStyles,"kakadu-components-2514848457",!!m&&"kakadu-components-2735110382",!n&&"kakadu-components-3621693630",s==="secondary"&&q,s==="warning"&&g,s==="danger"&&N,u&&"kakadu-components-2662775151",T),children:[m?e.jsxRuntimeExports.jsx(S,{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:D}),l?e.jsxRuntimeExports.jsx(S,{variant:s,icon:l,className:n?"kakadu-components-3631501803":void 0}):null,e.jsxRuntimeExports.jsx(h,{isLoading:x}),R||E?e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-2836016662",children:[R&&e.jsxRuntimeExports.jsx(F.default,{opacity:A?.5:.4,maximumGradientsCount:p,className:c.cx("kakadu-components-1191635212",s==="secondary"&&"kakadu-components-3653612936")}),E&&e.jsxRuntimeExports.jsx(O.default,{maximumStarsCount:k,className:"kakadu-components-2551727666"})]}):null,d?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(H.default,{size:n?void 0:50}),e.jsxRuntimeExports.jsx(v.default,{size:n?void 0:50,className:s==="secondary"?v.normalBlendStyles:void 0})]}),i?e.jsxRuntimeExports.jsx(J.default,{id:j,label:i,position:I}):null]}),u?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-3422055155",children:e.jsxRuntimeExports.jsx(U.SkeletonInstance,{width:"100%",height:"100%",isAnimated:M})}):null]})}exports.ButtonLoader=h;exports.buttonDangerStyles=N;exports.buttonSecondaryStyles=q;exports.buttonSuccessStyles=Y;exports.buttonVariants=X;exports.buttonWarningStyles=g;exports.default=Z;
|
|
@@ -15,61 +15,63 @@ import U from "./atom.mjs";
|
|
|
15
15
|
import { SkeletonInstance as X } from "./skeleton.mjs";
|
|
16
16
|
function Y({
|
|
17
17
|
isLoading: n,
|
|
18
|
-
size:
|
|
18
|
+
size: t,
|
|
19
19
|
className: s
|
|
20
20
|
}) {
|
|
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:
|
|
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: t }) }) });
|
|
22
22
|
}
|
|
23
23
|
const fo = ["primary", "secondary", "warning", "danger"];
|
|
24
|
-
function
|
|
24
|
+
function b({
|
|
25
25
|
icon: n,
|
|
26
|
-
variant:
|
|
26
|
+
variant: t = "primary",
|
|
27
27
|
className: s,
|
|
28
28
|
...r
|
|
29
29
|
}) {
|
|
30
|
-
return /* @__PURE__ */ o.jsx("div", { ...r, className: c("kakadu-components-2658660333",
|
|
30
|
+
return /* @__PURE__ */ o.jsx("div", { ...r, className: c("kakadu-components-2658660333", t === "secondary" && "kakadu-components-3469662110", s), children: typeof n == "string" ? /* @__PURE__ */ o.jsx(V, { width: 14, height: 14, type: n }) : n });
|
|
31
31
|
}
|
|
32
32
|
const Z = "kakadu-components-2550769169", xo = "kakadu-components-1998774084", _ = "kakadu-components-2945752235", $ = "kakadu-components-1546692192";
|
|
33
33
|
function yo({
|
|
34
34
|
ref: n,
|
|
35
|
-
type:
|
|
35
|
+
type: t,
|
|
36
36
|
variant: s = "primary",
|
|
37
37
|
href: r,
|
|
38
|
-
target:
|
|
39
|
-
rel:
|
|
40
|
-
disabled:
|
|
41
|
-
className:
|
|
38
|
+
target: h,
|
|
39
|
+
rel: N,
|
|
40
|
+
disabled: g,
|
|
41
|
+
className: S,
|
|
42
42
|
children: e,
|
|
43
|
-
label:
|
|
43
|
+
label: B,
|
|
44
44
|
tooltip: d,
|
|
45
|
-
tooltipPosition:
|
|
45
|
+
tooltipPosition: w,
|
|
46
46
|
iconLeft: i,
|
|
47
47
|
iconRight: l,
|
|
48
48
|
isLoading: p,
|
|
49
49
|
isSkeleton: m,
|
|
50
|
-
isSkeletonAnimated:
|
|
51
|
-
hasMovingGradients:
|
|
50
|
+
isSkeletonAnimated: I = !0,
|
|
51
|
+
hasMovingGradients: T = !1,
|
|
52
52
|
movingGradientsCount: k = 4,
|
|
53
|
-
hasMovingStars:
|
|
53
|
+
hasMovingStars: A = !1,
|
|
54
54
|
movingStarsCount: f = 10,
|
|
55
|
-
...
|
|
55
|
+
...D
|
|
56
56
|
}) {
|
|
57
|
-
const x = R(), y = z(null),
|
|
57
|
+
const x = R(), y = z(null), M = q(y), G = t ?? "button", j = T && k > 0, v = A && f > 0, a = r !== void 0 && !m, u = !!g || !!p || !!m;
|
|
58
58
|
return /* @__PURE__ */ o.jsxs("div", { className: "kakadu-components-3559664923", children: [
|
|
59
|
-
/* @__PURE__ */ o.jsxs(U, { ...
|
|
60
|
-
i ? /* @__PURE__ */ o.jsx(
|
|
61
|
-
e ? /* @__PURE__ */ o.jsx("div", { ref: y, className: "kakadu-components-207477259", children: e }) : /* @__PURE__ */ o.jsx(Q, { children:
|
|
62
|
-
l ? /* @__PURE__ */ o.jsx(
|
|
59
|
+
/* @__PURE__ */ o.jsxs(U, { ...D, reference: n, as: a ? "a" : "button", type: a ? void 0 : G, href: a ? r : void 0, target: a ? h : void 0, rel: a ? N : void 0, "aria-describedby": d ? x : void 0, disabled: a ? void 0 : u, inert: a ? 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", S), children: [
|
|
60
|
+
i ? /* @__PURE__ */ o.jsx(b, { variant: s, icon: i, className: e ? "kakadu-components-136489413" : void 0 }) : null,
|
|
61
|
+
e ? /* @__PURE__ */ o.jsx("div", { ref: y, className: "kakadu-components-207477259", children: e }) : /* @__PURE__ */ o.jsx(Q, { children: B }),
|
|
62
|
+
l ? /* @__PURE__ */ o.jsx(b, { variant: s, icon: l, className: e ? "kakadu-components-3631501803" : void 0 }) : null,
|
|
63
63
|
/* @__PURE__ */ o.jsx(Y, { isLoading: p }),
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
j || v ? /* @__PURE__ */ o.jsxs("div", { className: "kakadu-components-2836016662", children: [
|
|
65
|
+
j && /* @__PURE__ */ o.jsx(H, { opacity: M ? 0.5 : 0.4, maximumGradientsCount: k, className: c("kakadu-components-1191635212", s === "secondary" && "kakadu-components-3653612936") }),
|
|
66
|
+
v && /* @__PURE__ */ o.jsx(W, { maximumStarsCount: f, className: "kakadu-components-2551727666" })
|
|
67
|
+
] }) : null,
|
|
66
68
|
u ? null : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
67
69
|
/* @__PURE__ */ o.jsx(J, { size: e ? void 0 : 50 }),
|
|
68
70
|
/* @__PURE__ */ o.jsx(K, { size: e ? void 0 : 50, className: s === "secondary" ? O : void 0 })
|
|
69
71
|
] }),
|
|
70
|
-
d ? /* @__PURE__ */ o.jsx(P, { id: x, label: d, position:
|
|
72
|
+
d ? /* @__PURE__ */ o.jsx(P, { id: x, label: d, position: w }) : null
|
|
71
73
|
] }),
|
|
72
|
-
m ? /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-3422055155", children: /* @__PURE__ */ o.jsx(X, { width: "100%", height: "100%", isAnimated:
|
|
74
|
+
m ? /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-3422055155", children: /* @__PURE__ */ o.jsx(X, { width: "100%", height: "100%", isAnimated: I }) }) : null
|
|
73
75
|
] });
|
|
74
76
|
}
|
|
75
77
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HTMLProps } from 'react';
|
|
1
|
+
import React, { type HTMLProps } from 'react';
|
|
2
2
|
import { type IconType } from '../icons/icon';
|
|
3
3
|
export type CardProperties = HTMLProps<HTMLButtonElement> & {
|
|
4
4
|
readonly icon?: IconType;
|
|
@@ -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({ ref, icon, title, description, action, href, target, rel, className, ...properties }: CardProperties):
|
|
9
|
+
export default function Card({ ref, icon, title, description, action, href, target, rel, className, ...properties }: CardProperties): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HTMLProps } from 'react';
|
|
1
|
+
import React, { type HTMLProps } from 'react';
|
|
2
2
|
export default function ClickRipples({ isActive, size, className, ...properties }: HTMLProps<HTMLDivElement> & {
|
|
3
3
|
readonly isActive?: boolean;
|
|
4
|
-
}):
|
|
4
|
+
}): React.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 f=require("../jsx-runtime-BB_1_6y_.js"),r=require("react"),R=require("@kuma-ui/core"),v=require("../hooks/use-is-in-view.js"),q=require("../utilities/listeners.js");function y({id:e,x:o,y:u,onEnd:i}){return r.useEffect(()=>{const n=setTimeout(()=>{i(e)},370);return()=>{clearTimeout(n)}},[i,e]),f.jsxRuntimeExports.jsx("div",{style:{top:u,left:o},className:"kakadu-components-3828473824"})}const b=q.default(e=>{window.addEventListener("pointerdown",e,{passive:!0})},e=>{window.removeEventListener("pointerdown",e)});function g({isActive:e=!0,size:o=150,className:u,...i}){const n=r.useRef(null),c=v.default(n),[x,l]=r.useState([]);r.useEffect(()=>{if(!e||!c){l([]);return}return b(t=>{if(n.current){const a=n.current.getBoundingClientRect(),{clientX:s,clientY:d}=t,{left:m,right:j,top:p,bottom:k}=a;s>m&&s<j&&d>p&&d<k&&l(E=>[...E,{id:Date.now()+Math.random()*1e3,x:s-m,y:d-p}])}})},[e,c]);const w=r.useCallback(t=>{l(a=>a.filter(s=>s.id!==t))},[]);return f.jsxRuntimeExports.jsx("div",{...i,ref:n,style:{"--size":`${o}px`},className:R.cx("kakadu-components-4189236582",u),children:c?x.map(t=>f.jsxRuntimeExports.jsx(y,{id:t.id,x:t.x,y:t.y,onEnd:w},t.id)):null})}exports.default=g;
|
|
@@ -1,65 +1,70 @@
|
|
|
1
1
|
import { j as m } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { cx as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { useRef as y, useState as E, useEffect as p, useCallback as R } from "react";
|
|
3
|
+
import { cx as h } from "@kuma-ui/core";
|
|
4
|
+
import C from "../hooks/use-is-in-view.mjs";
|
|
5
|
+
import L from "../utilities/listeners.mjs";
|
|
6
|
+
function b({
|
|
7
|
+
id: e,
|
|
8
|
+
x: s,
|
|
9
|
+
y: i,
|
|
9
10
|
onEnd: o
|
|
10
11
|
}) {
|
|
11
|
-
return
|
|
12
|
-
const
|
|
13
|
-
o(
|
|
12
|
+
return p(() => {
|
|
13
|
+
const n = setTimeout(() => {
|
|
14
|
+
o(e);
|
|
14
15
|
}, 370);
|
|
15
16
|
return () => {
|
|
16
|
-
clearTimeout(
|
|
17
|
+
clearTimeout(n);
|
|
17
18
|
};
|
|
18
|
-
}, [o,
|
|
19
|
-
top:
|
|
20
|
-
left:
|
|
19
|
+
}, [o, e]), /* @__PURE__ */ m.jsx("div", { style: {
|
|
20
|
+
top: i,
|
|
21
|
+
left: s
|
|
21
22
|
}, className: "kakadu-components-3828473824" });
|
|
22
23
|
}
|
|
24
|
+
const g = L((e) => {
|
|
25
|
+
window.addEventListener("pointerdown", e, {
|
|
26
|
+
passive: !0
|
|
27
|
+
});
|
|
28
|
+
}, (e) => {
|
|
29
|
+
window.removeEventListener("pointerdown", e);
|
|
30
|
+
});
|
|
23
31
|
function V({
|
|
24
|
-
isActive:
|
|
25
|
-
size:
|
|
26
|
-
className:
|
|
32
|
+
isActive: e = !0,
|
|
33
|
+
size: s = 150,
|
|
34
|
+
className: i,
|
|
27
35
|
...o
|
|
28
36
|
}) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
if (!
|
|
32
|
-
|
|
37
|
+
const n = y(null), c = C(n), [x, u] = E([]);
|
|
38
|
+
p(() => {
|
|
39
|
+
if (!e || !c) {
|
|
40
|
+
u([]);
|
|
33
41
|
return;
|
|
34
42
|
}
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
clientX:
|
|
39
|
-
clientY:
|
|
40
|
-
} =
|
|
41
|
-
left:
|
|
42
|
-
right:
|
|
43
|
-
top:
|
|
44
|
-
bottom:
|
|
45
|
-
} =
|
|
46
|
-
|
|
43
|
+
return g((t) => {
|
|
44
|
+
if (n.current) {
|
|
45
|
+
const a = n.current.getBoundingClientRect(), {
|
|
46
|
+
clientX: r,
|
|
47
|
+
clientY: l
|
|
48
|
+
} = t, {
|
|
49
|
+
left: d,
|
|
50
|
+
right: k,
|
|
51
|
+
top: f,
|
|
52
|
+
bottom: j
|
|
53
|
+
} = a;
|
|
54
|
+
r > d && r < k && l > f && l < j && u((v) => [...v, {
|
|
47
55
|
id: Date.now() + Math.random() * 1e3,
|
|
48
|
-
x:
|
|
49
|
-
y:
|
|
56
|
+
x: r - d,
|
|
57
|
+
y: l - f
|
|
50
58
|
}]);
|
|
51
59
|
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, [n, i]);
|
|
57
|
-
const k = v((e) => {
|
|
58
|
-
c((u) => u.filter((l) => l.id !== e));
|
|
60
|
+
});
|
|
61
|
+
}, [e, c]);
|
|
62
|
+
const w = R((t) => {
|
|
63
|
+
u((a) => a.filter((r) => r.id !== t));
|
|
59
64
|
}, []);
|
|
60
|
-
return /* @__PURE__ */ m.jsx("div", { ...o, ref:
|
|
61
|
-
"--size": `${
|
|
62
|
-
}, className:
|
|
65
|
+
return /* @__PURE__ */ m.jsx("div", { ...o, ref: n, style: {
|
|
66
|
+
"--size": `${s}px`
|
|
67
|
+
}, className: h("kakadu-components-4189236582", i), children: c ? x.map((t) => /* @__PURE__ */ m.jsx(b, { id: t.id, x: t.x, y: t.y, onEnd: w }, t.id)) : null });
|
|
63
68
|
}
|
|
64
69
|
export {
|
|
65
70
|
V as default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ElementType } from 'react';
|
|
1
|
+
import React, { type ElementType } from 'react';
|
|
2
2
|
import { type AtomProperties } from './atom';
|
|
3
3
|
export default function Collapsible<Type extends ElementType = 'div'>({ as, isCollapsed, transitionDuration, children, className, ...properties }: AtomProperties<Type> & {
|
|
4
4
|
readonly isCollapsed?: boolean;
|
|
5
5
|
readonly transitionDuration?: number;
|
|
6
|
-
}):
|
|
6
|
+
}): React.JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ChangeEvent, type HTMLProps, type ReactNode } from 'react';
|
|
1
|
+
import React, { type ChangeEvent, type HTMLProps, type ReactNode } from 'react';
|
|
2
2
|
import { type InputType, type InputLabelControllerProperties } from './input';
|
|
3
3
|
export type ComboboxOption<Type = string> = {
|
|
4
4
|
readonly value: Type;
|
|
@@ -25,4 +25,4 @@ export type ComboboxProperties<Type = string> = Omit<InputLabelControllerPropert
|
|
|
25
25
|
readonly onChange?: (value: string, event?: ChangeEvent<InputType>) => void;
|
|
26
26
|
readonly onSelect?: (value?: Type) => void;
|
|
27
27
|
};
|
|
28
|
-
export default function Combobox<Type = string>({ isLoading, shouldFilterOptions, label, options, error, warning, information, footnote, className, onChange, onSelect, ...properties }: ComboboxProperties<Type>):
|
|
28
|
+
export default function Combobox<Type = string>({ isLoading, shouldFilterOptions, label, options, error, warning, information, footnote, className, onChange, onSelect, ...properties }: ComboboxProperties<Type>): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../jsx-runtime-BB_1_6y_.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../jsx-runtime-BB_1_6y_.js"),t=require("react"),_=require("@kuma-ui/core"),se=require("../hooks/use-synchronized-value.js"),ne=require("../icons/icon.js"),oe=require("../icons/chevron-up.js"),ae=require("../utilities/search.js"),X=require("../utilities/listeners.js"),re=require("./input.js"),K=require("./text.js"),U=require("./flex.js"),ue=require("./skeleton.js"),ce=X.default(s=>{window.addEventListener("mousemove",s,{capture:!0})},s=>{window.removeEventListener("mousemove",s,{capture:!0})}),ie=X.default(s=>{window.addEventListener("keydown",s,{capture:!0})},s=>{window.removeEventListener("keydown",s,{capture:!0})});function Y(){const{value:s,setValue:x}=se.default("isKeyboardNavigating");return t.useMemo(()=>({isKeyboardNavigating:s,setIsKeyboardNavigating:x}),[s,x])}function O(s){return"text"in s?s.text:s.label}const B="kakadu-components-1144794361",D="kakadu-components-2911184744";function le({isSelected:s,id:x,value:b,label:a,onSelect:k,onHover:E}){const{isKeyboardNavigating:p}=Y(),j=t.useCallback(()=>{k(b)},[k,b]),l=t.useCallback(f=>{p||f.movementX===0&&f.movementY===0||E(b)},[p,E,b]),r=t.useRef(null);return t.useEffect(()=>{const f=r.current;s&&f&&p&&setTimeout(()=>{f.scrollIntoView({behavior:"smooth",block:"nearest"})},0)},[s,p]),i.jsxRuntimeExports.jsx("li",{ref:r,id:x,role:"option","aria-selected":s,tabIndex:-1,className:_.cx(B,"kakadu-components-4130497639",p?"kakadu-components-962373561":"kakadu-components-1109598791"),onClick:j,onMouseMove:l,children:i.jsxRuntimeExports.jsx(K.Span,{className:_.cx(D,typeof a=="string"&&"kakadu-components-154286052"),children:a})})}function de({isLoading:s,id:x,activeOptionId:b,selectedValue:a,options:k,onSelect:E,onHover:p}){const j=t.useRef(null);return t.useEffect(()=>{const l=j.current;l&&l.scrollIntoView({behavior:"smooth",block:"nearest"})},[]),i.jsxRuntimeExports.jsxs("ul",{ref:j,id:x,role:"listbox","aria-label":"Options",tabIndex:-1,className:"kakadu-components-3718330689",children:[k.length===0?s?null:i.jsxRuntimeExports.jsxs(U.default,{"aria-atomic":!0,as:"li",role:"status","aria-live":"polite",direction:"row",preset:"start",gap:.5,className:B,children:[i.jsxRuntimeExports.jsx(ne.default,{size:15,type:"exclamationTriangle"}),i.jsxRuntimeExports.jsx(K.Span,{className:D,children:"No results."})]}):k.map((l,r)=>i.jsxRuntimeExports.jsx(le,{...l,id:l.value===a?b:void 0,isSelected:l.value===a,onSelect:E,onHover:p},O(l)+r)),s?i.jsxRuntimeExports.jsx(U.default,{as:"li",alignment:"center",className:B,children:i.jsxRuntimeExports.jsx(K.Span,{className:_.cx(D,"kakadu-components-2015848015"),children:i.jsxRuntimeExports.jsx(ue.SkeletonInstance,{width:"100%",height:"1.3em"})})}):null]})}function fe({isLoading:s,shouldFilterOptions:x=!0,label:b,options:a,error:k,warning:E,information:p,footnote:j,className:l,onChange:r,onSelect:f,...T}){const S=t.useRef(null),F=t.useId(),H=t.useId(),[g,C]=t.useState(!1),$=t.useCallback(()=>{C(!0)},[]),G=t.useCallback(e=>{var n;(n=S.current)!=null&&n.contains(e.relatedTarget)||C(!1)},[]),[y,u]=t.useState(!1);t.useEffect(()=>{u(g)},[g]);const[P,w]=t.useState(""),{value:v}=T,[m,N]=t.useState(v),[q,J]=t.useState(v),A=t.useRef(q),c=t.useCallback(e=>{J(e),A.current=e},[]);t.useEffect(()=>{N(v),c(v)},[v,c]),t.useEffect(()=>{const e=a.find(n=>n.value===v);e?w(O(e)):v===void 0&&w("")},[a,v]);const Q=t.useCallback(()=>{m&&(w(""),c(void 0))},[m,c]),W=t.useCallback((e,n)=>{w(e),r==null||r(e,n),u(!0),N(void 0)},[r]),Z=t.useCallback(e=>{var n;(n=S.current)!=null&&n.contains(e.target)&&u(!0)},[]),h=t.useCallback(e=>{const n=e==null?void 0:e.value;c(n),e?w(O(e)):(w(""),r==null||r("")),f==null||f(n)},[c,r,f]),ee=t.useCallback(e=>{const n=a.find(I=>I.value===e);h(n),N(e),u(!1)},[a,h]),te=t.useCallback(e=>{c(e)},[c]),M=t.useDeferredValue(P),d=t.useMemo(()=>!x||m?a:ae.default(M,a,O),[x,m,a,M]);t.useEffect(()=>{!m&&M.length>0&&d.length>0&&!d.some(e=>q===e.value)&&c(d[0].value)},[m,M,d,q,c]);const{setIsKeyboardNavigating:V}=Y();return t.useEffect(()=>{if(g)return ce(e=>{e.movementX===0&&e.movementY===0||V(!1)})},[g,V]),t.useEffect(()=>{if(g)return ie(e=>{var z;let n;const I=d.length,L=d.findIndex(o=>o.value===A.current),R=()=>{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()};switch(e.key){case"Enter":{const o=d[L];o&&(R(),V(!0),u(!1),h(o),N(o.value));break}case"Escape":{if(y)R(),m?c(void 0):h(void 0),u(!1);else if(m)R(),u(!0),h(void 0);else{R(),C(!1);const o=document.activeElement;o instanceof HTMLElement&&((z=S.current)!=null&&z.contains(o))&&o.blur()}return}case"ArrowDown":{n=L+1,u(!0);break}case"ArrowUp":{n=L-1,u(!0),n<0&&(n=I-1);break}case"Home":{u(!0),n=0;break}case"End":{u(!0),n=I-1;break}case"Backspace":{d.some(o=>o.value===m)&&(R(),h(void 0),u(!0));break}}if(n!==void 0&&(R(),V(!0),I>0)){const o=d[n%I];o&&c(o.value)}})},[g,d,V,u,h,N,y,m,c]),i.jsxRuntimeExports.jsx(re.default,{...T,ref:S,role:"combobox",autoComplete:"off","aria-controls":F,"aria-expanded":y,"aria-activedescendant":y?H:void 0,label:b,value:P,error:k,warning:E,information:p,footnote:j,attachments:y?i.jsxRuntimeExports.jsx(de,{isLoading:s,id:F,activeOptionId:H,selectedValue:q,options:d,onSelect:ee,onHover:te}):null,className:_.cx(l,"kakadu-components-879486679"),onMouseDown:Z,onChange:W,onBeforeInput:Q,onFocus:$,onBlur:G,children:i.jsxRuntimeExports.jsx(oe.default,{width:14,height:14,className:"kakadu-components-158931186"})})}exports.default=fe;exports.getComboboxOptionString=O;
|