@kakadu/components 6.1.0 → 6.2.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/collapsible.d.ts +2 -2
- package/build/components/combobox.d.ts +2 -2
- 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/footer.js +1 -1
- package/build/components/footer.mjs +20 -20
- 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/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/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.d.ts +4 -4
- 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/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/theme.d.ts +2 -1
- 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,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,6 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type IconButtonProperties } from './icon-button';
|
|
2
3
|
export default function CopyIconButton({ label, copiedLabel, value, onClick, ...properties }: {
|
|
3
4
|
readonly label?: string;
|
|
4
5
|
readonly copiedLabel?: string;
|
|
5
6
|
readonly value: string;
|
|
6
|
-
} & Omit<IconButtonProperties, 'icon' | 'label' | 'variant'>):
|
|
7
|
+
} & Omit<IconButtonProperties, 'icon' | 'label' | 'variant'>): React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
2
|
export type DatumProperties = {
|
|
3
3
|
readonly title: ReactNode;
|
|
4
4
|
readonly value: string;
|
|
5
5
|
readonly hasCopyButton?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export default function Datum({ title, value, hasCopyButton }: DatumProperties):
|
|
7
|
+
export default function Datum({ title, value, hasCopyButton }: DatumProperties): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type HTMLProps } from 'react';
|
|
2
|
-
export default function Dot({ className }: HTMLProps<HTMLSpanElement>):
|
|
1
|
+
import React, { type HTMLProps } from 'react';
|
|
2
|
+
export default function Dot({ className }: HTMLProps<HTMLSpanElement>): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type AtomElementType, type AtomProperties, type DefaultAtomElementType } from './atom';
|
|
2
3
|
export declare const flexDirections: readonly ["row", "row-reverse", "column", "column-reverse"];
|
|
3
4
|
export type FlexDirection = (typeof flexDirections)[number];
|
|
@@ -18,5 +19,5 @@ export type FlexProperties<Type extends AtomElementType = DefaultAtomElementType
|
|
|
18
19
|
readonly wrap?: boolean;
|
|
19
20
|
readonly fill?: boolean;
|
|
20
21
|
};
|
|
21
|
-
export default function Flex<Type extends AtomElementType = DefaultAtomElementType>({ as, direction, preset, distribution, alignment, gap, wrap, fill, style: inputStyle, className, ...properties }: FlexProperties<Type>):
|
|
22
|
+
export default function Flex<Type extends AtomElementType = DefaultAtomElementType>({ as, direction, preset, distribution, alignment, gap, wrap, fill, style: inputStyle, className, ...properties }: FlexProperties<Type>): React.JSX.Element;
|
|
22
23
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HTMLAttributeAnchorTarget, type ReactNode } from 'react';
|
|
1
|
+
import React, { type HTMLAttributeAnchorTarget, type ReactNode } from 'react';
|
|
2
2
|
import { type WrapperWidth } from './wrapper';
|
|
3
3
|
export declare const footerSections: readonly ["services", "results", "about", "compliance"];
|
|
4
4
|
export declare const footerSectionLinks: {
|
|
@@ -33,5 +33,5 @@ export type FooterProperties = {
|
|
|
33
33
|
readonly sections?: FooterSections;
|
|
34
34
|
readonly className?: string;
|
|
35
35
|
};
|
|
36
|
-
export default function Footer({ width, sections: inputSections, attribution, className, }: FooterProperties):
|
|
36
|
+
export default function Footer({ width, sections: inputSections, attribution, className, }: FooterProperties): React.JSX.Element;
|
|
37
37
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../jsx-runtime-BB_1_6y_.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../jsx-runtime-BB_1_6y_.js"),b=require("react"),y=require("@kuma-ui/core"),S=require("../theme.js"),l=require("./flex.js"),k=require("./text.js"),w=require("./logos/kakadu-logo.js"),N=require("./aria-text.js"),q=require("./wrapper.js"),_="kakadu-components-975968984",x=["services","results","about","compliance"],E={services:["kakaduGuide","kakaduPlay"],results:["caseStudies","impactMeasurement"],about:["ourStory","contact"],compliance:["privacyPolicy","ethicalGuidelines","status"]},P={services:{text:"Services",links:{kakaduGuide:{text:"Kakadu Guide",href:"https://guide.kakadu.no"},kakaduPlay:{text:"Kakadu Play",href:"https://play.kakadu.no"}}},results:{text:"Results",links:{caseStudies:{text:"Case studies",href:"https://utforsk.kakadu.no/case-studies"},impactMeasurement:{text:"Impact measurement",href:"https://utforsk.kakadu.no/impact-measurement"}}},about:{text:"About us",links:{ourStory:{text:"Our story",href:"https://utforsk.kakadu.no/our-story"},contact:{text:"Contact",href:"https://utforsk.kakadu.no/kontakt-oss"}}},compliance:{text:"Compliance",links:{privacyPolicy:{text:"Privacy policy",href:"https://utforsk.kakadu.no/personvernerklaering"},ethicalGuidelines:{text:"Ethical guidelines",href:"https://utforsk.kakadu.no/etiske-retningslinjer"},status:{text:"Status",href:"https://kakadu.instatus.com",rel:"noopener noreferrer",target:"_blank"}}}};function p(e,r,u){if(u!==!1&&(u==null?void 0:u.index)!==void 0)return u.index;const t=r.indexOf(e);return t===-1?r.length+1:t+1}function R(e,r={},u=[]){var d,m,f,h;const t=new Set([...Object.keys(r),...Object.keys(e)]),a=[];for(const i of t){const o=e[i];if(o===!1)continue;const j=(o==null?void 0:o.text)??((d=r[i])==null?void 0:d.text),g=(o==null?void 0:o.href)??((m=r[i])==null?void 0:m.href);j===void 0||g===void 0||a.push({key:i,text:j,href:g,rel:(o==null?void 0:o.rel)??((f=r[i])==null?void 0:f.rel),target:(o==null?void 0:o.target)??((h=r[i])==null?void 0:h.target)})}const n=new Set(a.map(i=>i.key)),c=u.filter(i=>n.has(i));return a.toSorted((i,o)=>p(i.key,c,e[i.key])-p(o.key,c,e[o.key]))}function L(e){const r=x.filter(t=>(e==null?void 0:e[t])!==!1),u=[];for(const t of x){if((e==null?void 0:e[t])===!1)continue;const a=P[t],n=e==null?void 0:e[t];u.push({key:t,title:(n==null?void 0:n.text)??a.text,links:R((n==null?void 0:n.links)??{},a.links,E[t]),index:p(t,r,n)})}for(const[t,a]of Object.entries(e??{})){if(x.includes(t)||a===!1)continue;const n=R(a.links??{});n.length===0&&a.text===void 0||u.push({key:t,title:a.text??t,links:n,index:p(t,r,a)})}return u.toSorted((t,a)=>t.index-a.index)}function M({width:e="page",sections:r,attribution:u,className:t}){const a=b.useMemo(()=>L(r),[r]);return s.jsxRuntimeExports.jsxs(q.default,{as:"footer",gap:2,width:e,className:y.cx("kakadu-components-3130980543",t),children:[s.jsxRuntimeExports.jsxs(l.default,{wrap:!0,"data-theme":"dark",direction:"row",gap:4,className:y.cx(S.default,"kakadu-components-82784222"),children:[a.map(n=>n.links.length>0?s.jsxRuntimeExports.jsxs(l.default,{direction:"column",preset:"start",gap:.5,children:[s.jsxRuntimeExports.jsx(k.Paragraph,{children:s.jsxRuntimeExports.jsx("strong",{children:n.title})}),s.jsxRuntimeExports.jsx(k.Paragraph,{as:"ul",className:_,children:n.links.map(c=>s.jsxRuntimeExports.jsx("li",{children:s.jsxRuntimeExports.jsx("a",{href:c.href,rel:c.rel,target:c.target,children:c.text})},c.key))})]},n.key):null),s.jsxRuntimeExports.jsx(l.default,{fill:!0,className:"kakadu-components-3520395370",children:s.jsxRuntimeExports.jsx("a",{href:"https://businessnorway.com/companies/kakadu-ignite-as",target:"_blank",rel:"noopener noreferrer",className:"kakadu-components-3521477705",children:s.jsxRuntimeExports.jsx("img",{alt:"Made in Norway",src:"https://components.kakadu.no/images/made-in-norway.png",width:76,className:"kakadu-components-2329568054"})})})]}),s.jsxRuntimeExports.jsxs(l.default,{wrap:!0,"data-theme":"dark",direction:"row-reverse",gap:2,alignment:"flex-end",distribution:"space-between",className:S.default,children:[u?s.jsxRuntimeExports.jsx(k.Span,{className:"kakadu-components-1667529929",children:u}):null,s.jsxRuntimeExports.jsxs(l.default,{fill:!0,direction:"row",gap:1,alignment:"center",children:[s.jsxRuntimeExports.jsxs("a",{href:"https://kakadu.no",children:[s.jsxRuntimeExports.jsx(N.default,{children:"Kakadu"}),s.jsxRuntimeExports.jsx(w.default,{width:90,className:"kakadu-components-3103582715"})]}),s.jsxRuntimeExports.jsxs(k.Span,{className:"kakadu-components-250962410",children:["© ",new Date().getFullYear()," Kakadu Ignite AS"]})]})]})]})}exports.default=M;exports.footerSectionLinks=E;exports.footerSections=x;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { j as a } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useMemo as
|
|
2
|
+
import { useMemo as N } from "react";
|
|
3
3
|
import { cx as y } from "@kuma-ui/core";
|
|
4
|
-
import
|
|
4
|
+
import j from "../theme.mjs";
|
|
5
5
|
import u from "./flex.mjs";
|
|
6
|
-
import { Paragraph as
|
|
6
|
+
import { Paragraph as S, Span as w } from "./text.mjs";
|
|
7
7
|
import P from "./logos/kakadu-logo.mjs";
|
|
8
8
|
import G from "./aria-text.mjs";
|
|
9
9
|
import K from "./wrapper.mjs";
|
|
10
|
-
const L = "kakadu-components-975968984",
|
|
10
|
+
const L = "kakadu-components-975968984", d = ["services", "results", "about", "compliance"], O = {
|
|
11
11
|
services: ["kakaduGuide", "kakaduPlay"],
|
|
12
12
|
results: ["caseStudies", "impactMeasurement"],
|
|
13
13
|
about: ["ourStory", "contact"],
|
|
@@ -78,14 +78,14 @@ function k(e, r, i) {
|
|
|
78
78
|
const t = r.indexOf(e);
|
|
79
79
|
return t === -1 ? r.length + 1 : t + 1;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
var
|
|
81
|
+
function b(e, r = {}, i = []) {
|
|
82
|
+
var m, p, f, h;
|
|
83
83
|
const t = /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(e)]), s = [];
|
|
84
84
|
for (const c of t) {
|
|
85
85
|
const o = e[c];
|
|
86
86
|
if (o === !1)
|
|
87
87
|
continue;
|
|
88
|
-
const x = (o == null ? void 0 : o.text) ?? ((
|
|
88
|
+
const x = (o == null ? void 0 : o.text) ?? ((m = r[c]) == null ? void 0 : m.text), g = (o == null ? void 0 : o.href) ?? ((p = r[c]) == null ? void 0 : p.href);
|
|
89
89
|
x === void 0 || g === void 0 || s.push({
|
|
90
90
|
key: c,
|
|
91
91
|
text: x,
|
|
@@ -98,22 +98,22 @@ function w(e, r = {}, i = []) {
|
|
|
98
98
|
return s.toSorted((c, o) => k(c.key, l, e[c.key]) - k(o.key, l, e[o.key]));
|
|
99
99
|
}
|
|
100
100
|
function M(e) {
|
|
101
|
-
const r =
|
|
102
|
-
for (const t of
|
|
101
|
+
const r = d.filter((t) => (e == null ? void 0 : e[t]) !== !1), i = [];
|
|
102
|
+
for (const t of d) {
|
|
103
103
|
if ((e == null ? void 0 : e[t]) === !1)
|
|
104
104
|
continue;
|
|
105
105
|
const s = I[t], n = e == null ? void 0 : e[t];
|
|
106
106
|
i.push({
|
|
107
107
|
key: t,
|
|
108
108
|
title: (n == null ? void 0 : n.text) ?? s.text,
|
|
109
|
-
links:
|
|
109
|
+
links: b((n == null ? void 0 : n.links) ?? {}, s.links, O[t]),
|
|
110
110
|
index: k(t, r, n)
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
for (const [t, s] of Object.entries(e ?? {})) {
|
|
114
|
-
if (
|
|
114
|
+
if (d.includes(t) || s === !1)
|
|
115
115
|
continue;
|
|
116
|
-
const n =
|
|
116
|
+
const n = b(s.links ?? {});
|
|
117
117
|
n.length === 0 && s.text === void 0 || i.push({
|
|
118
118
|
key: t,
|
|
119
119
|
title: s.text ?? t,
|
|
@@ -129,23 +129,23 @@ function Y({
|
|
|
129
129
|
attribution: i,
|
|
130
130
|
className: t
|
|
131
131
|
}) {
|
|
132
|
-
const s =
|
|
132
|
+
const s = N(() => M(r), [r]);
|
|
133
133
|
return /* @__PURE__ */ a.jsxs(K, { as: "footer", gap: 2, width: e, className: y("kakadu-components-3130980543", t), children: [
|
|
134
|
-
/* @__PURE__ */ a.jsxs(u, { wrap: !0, "data-theme": "dark", direction: "row", gap: 4, className: y(
|
|
134
|
+
/* @__PURE__ */ a.jsxs(u, { wrap: !0, "data-theme": "dark", direction: "row", gap: 4, className: y(j, "kakadu-components-82784222"), children: [
|
|
135
135
|
s.map((n) => n.links.length > 0 ? /* @__PURE__ */ a.jsxs(u, { direction: "column", preset: "start", gap: 0.5, children: [
|
|
136
|
-
/* @__PURE__ */ a.jsx(
|
|
137
|
-
/* @__PURE__ */ a.jsx(
|
|
136
|
+
/* @__PURE__ */ a.jsx(S, { children: /* @__PURE__ */ a.jsx("strong", { children: n.title }) }),
|
|
137
|
+
/* @__PURE__ */ a.jsx(S, { as: "ul", className: L, children: n.links.map((l) => /* @__PURE__ */ a.jsx("li", { children: /* @__PURE__ */ a.jsx("a", { href: l.href, rel: l.rel, target: l.target, children: l.text }) }, l.key)) })
|
|
138
138
|
] }, n.key) : null),
|
|
139
139
|
/* @__PURE__ */ a.jsx(u, { fill: !0, className: "kakadu-components-3520395370", children: /* @__PURE__ */ a.jsx("a", { href: "https://businessnorway.com/companies/kakadu-ignite-as", target: "_blank", rel: "noopener noreferrer", className: "kakadu-components-3521477705", children: /* @__PURE__ */ a.jsx("img", { alt: "Made in Norway", src: "https://components.kakadu.no/images/made-in-norway.png", width: 76, className: "kakadu-components-2329568054" }) }) })
|
|
140
140
|
] }),
|
|
141
|
-
/* @__PURE__ */ a.jsxs(u, { wrap: !0, direction: "row-reverse", gap: 2, alignment: "flex-end", distribution: "space-between", children: [
|
|
142
|
-
i ? /* @__PURE__ */ a.jsx(
|
|
141
|
+
/* @__PURE__ */ a.jsxs(u, { wrap: !0, "data-theme": "dark", direction: "row-reverse", gap: 2, alignment: "flex-end", distribution: "space-between", className: j, children: [
|
|
142
|
+
i ? /* @__PURE__ */ a.jsx(w, { className: "kakadu-components-1667529929", children: i }) : null,
|
|
143
143
|
/* @__PURE__ */ a.jsxs(u, { fill: !0, direction: "row", gap: 1, alignment: "center", children: [
|
|
144
144
|
/* @__PURE__ */ a.jsxs("a", { href: "https://kakadu.no", children: [
|
|
145
145
|
/* @__PURE__ */ a.jsx(G, { children: "Kakadu" }),
|
|
146
146
|
/* @__PURE__ */ a.jsx(P, { width: 90, className: "kakadu-components-3103582715" })
|
|
147
147
|
] }),
|
|
148
|
-
/* @__PURE__ */ a.jsxs(
|
|
148
|
+
/* @__PURE__ */ a.jsxs(w, { className: "kakadu-components-250962410", children: [
|
|
149
149
|
"© ",
|
|
150
150
|
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
151
151
|
" Kakadu Ignite AS"
|
|
@@ -157,5 +157,5 @@ function Y({
|
|
|
157
157
|
export {
|
|
158
158
|
Y as default,
|
|
159
159
|
O as footerSectionLinks,
|
|
160
|
-
|
|
160
|
+
d as footerSections
|
|
161
161
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
export type GaugeProperties = {
|
|
2
3
|
readonly label: string;
|
|
3
4
|
readonly size?: 'small' | 'medium' | 'large';
|
|
4
5
|
readonly percentage?: number;
|
|
5
6
|
readonly isAnimated?: boolean;
|
|
6
7
|
};
|
|
7
|
-
export default function Gauge({ label, size, percentage, isAnimated, }: GaugeProperties):
|
|
8
|
+
export default function Gauge({ label, size, percentage, isAnimated, }: GaugeProperties): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type WrapperProperties } from './wrapper';
|
|
2
3
|
import { type AtomElementType, type DefaultAtomElementType } from './atom';
|
|
3
|
-
export default function Header<Type extends AtomElementType = DefaultAtomElementType>({ as, className, ...properties }: WrapperProperties<Type>):
|
|
4
|
+
export default function Header<Type extends AtomElementType = DefaultAtomElementType>({ as, className, ...properties }: WrapperProperties<Type>): React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type HTMLProps } from 'react';
|
|
1
|
+
import React, { type HTMLProps } from 'react';
|
|
2
2
|
export declare const normalBlendStyles: string;
|
|
3
3
|
export default function HoverGradient({ isActive, size, className, ...properties }: HTMLProps<HTMLDivElement> & {
|
|
4
4
|
readonly isActive?: boolean;
|
|
5
5
|
readonly size?: number;
|
|
6
|
-
}):
|
|
6
|
+
}): React.JSX.Element;
|
|
@@ -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
|
import { type ButtonTooltipPosition } from './button-tooltip';
|
|
4
4
|
export declare const iconButtonVariants: readonly ["default", "success", "warning", "danger"];
|
|
@@ -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({ ref, icon, variant, label, tooltipPosition, href, target, rel, disabled, isLoading, isSkeleton, isSkeletonAnimated, className, ...properties }: IconButtonProperties):
|
|
15
|
+
export default function IconButton({ ref, icon, variant, label, tooltipPosition, href, target, rel, disabled, isLoading, isSkeleton, isSkeletonAnimated, className, ...properties }: IconButtonProperties): React.JSX.Element;
|
|
@@ -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 IconType } from '../icons/icon';
|
|
3
3
|
export declare const inputStyles: string;
|
|
4
4
|
export declare const errorParagraph: string;
|
|
@@ -17,7 +17,7 @@ type InputLabelProperties = HTMLProps<HTMLLabelElement> & InputLabelMessagePrope
|
|
|
17
17
|
readonly footnote?: ReactNode;
|
|
18
18
|
readonly attachments?: ReactNode;
|
|
19
19
|
};
|
|
20
|
-
export declare function InputLabel({ label, error, errorId, warning, warningId, information, informationId, footnote, attachments, className, children, ...properties }: InputLabelProperties):
|
|
20
|
+
export declare function InputLabel({ label, error, errorId, warning, warningId, information, informationId, footnote, attachments, className, children, ...properties }: InputLabelProperties): React.JSX.Element;
|
|
21
21
|
export type InputLabelControllerProperties = Omit<InputLabelProperties, 'errorId' | 'warningId' | 'attachments' | 'onClick' | 'onMouseDown' | 'onMouseUp' | 'onChange' | 'onFocus' | 'onBlur' | 'onInput' | 'onBeforeInput'>;
|
|
22
22
|
export type InputType = HTMLInputElement | HTMLTextAreaElement;
|
|
23
23
|
export type InputAction = {
|
|
@@ -34,5 +34,5 @@ export type InputProperties = Omit<InputLabelControllerProperties & Omit<HTMLPro
|
|
|
34
34
|
readonly isMultiline?: boolean;
|
|
35
35
|
readonly onChange?: (value: string, event: ChangeEvent<InputType>) => void;
|
|
36
36
|
};
|
|
37
|
-
export default function Input({ ref, type, label, error, warning, information, footnote, suggestion, attachments, actions, hasCopyButton, hasClearButton, isMultiline, onChange, children, className, ...properties }: InputProperties):
|
|
37
|
+
export default function Input({ ref, type, label, error, warning, information, footnote, suggestion, attachments, actions, hasCopyButton, hasClearButton, isMultiline, onChange, children, className, ...properties }: InputProperties): React.JSX.Element;
|
|
38
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"),r=require("@kuma-ui/core"),Q=require("../utilities/copy-to-clipboard.js"),M=require("../theme.js"),me=require("../icons/sparkle.js"),de=require("./button-tooltip.js"),
|
|
2
|
-
`):[],[o]),re=t.useMemo(()=>P.length,[P]),
|
|
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"),r=require("@kuma-ui/core"),Q=require("../utilities/copy-to-clipboard.js"),M=require("../theme.js"),me=require("../icons/sparkle.js"),de=require("./button-tooltip.js"),B=require("./text-button.js"),x=require("./text.js"),je=require("./collapsible.js"),X=require("./click-ripples.js"),Y=require("./hover-gradient.js"),ke=require("./notification.js"),fe="kakadu-components-922159086",he="kakadu-components-25448712",v="kakadu-components-3185985134",T="kakadu-components-4056037255",Z=r.cx(T,"kakadu-components-3245407458"),Ee=r.cx(T,"kakadu-components-1117160492"),Re=r.cx(T,"kakadu-components-821835704");function be({as:p,className:c,...m}){return e.jsxRuntimeExports.jsx(x.Span,{as:p??"span",...m,className:r.cx("kakadu-components-520991867",c)})}function ee({label:p,error:c,errorId:m,warning:l,warningId:h,information:i,informationId:S,footnote:a,attachments:C,className:d,children:j,...k}){const E=!!c,u=!!l,R=!!i,f=!!a;return e.jsxRuntimeExports.jsx("label",{...k,className:r.cx(fe,d),children:e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-3146929190",children:[e.jsxRuntimeExports.jsx(x.Span,{className:r.cx(M.overflowProtectionStyles,he),children:e.jsxRuntimeExports.jsx("span",{children:p})}),e.jsxRuntimeExports.jsxs("span",{className:"kakadu-components-3298764637",children:[j,f?e.jsxRuntimeExports.jsx(be,{className:"kakadu-components-613632806",children:a}):null,C]}),E||u||R?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-2927674627",children:E?e.jsxRuntimeExports.jsx(x.Paragraph,{id:m,className:Z,children:c instanceof Error?c.message:c}):u?e.jsxRuntimeExports.jsx(x.Paragraph,{id:h,className:Ee,children:l instanceof Error?l.message:l}):R?e.jsxRuntimeExports.jsx(x.Paragraph,{id:S,className:Re,children:i instanceof Error?i.message:i}):null}):null]})})}const ge=40,L="kakadu-components-4233741488";function ye({ref:p,type:c,label:m,error:l,warning:h,information:i,footnote:S,suggestion:a,attachments:C,actions:d=[],hasCopyButton:j,hasClearButton:k,isMultiline:E,onChange:u,children:R,className:f,...b}){const $=t.useRef(null),H=t.useRef(null),q=t.useRef(null),A=ke.useCreateNotification(),I=t.useId(),F=`${I}-error`,V=`${I}-warning`,O=`${I}-information`,{value:g,disabled:te}=b,[se,W]=t.useState(""),o=g??se,[ne,ae]=t.useState(),oe=c==="textarea"||!!E;t.useLayoutEffect(()=>{typeof o=="string"&&q.current&&ae(q.current.scrollHeight)},[o]);const P=t.useMemo(()=>typeof o=="string"?`${o} `.split(`
|
|
2
|
+
`):[],[o]),re=t.useMemo(()=>P.length,[P]),y=!!l,_=!y&&!!h,w=!!i,z=y?F:_?V:w?O:void 0;t.useEffect(()=>{W(typeof g=="string"?g:"")},[g]);const D=t.useCallback(s=>{const{value:n}=s.target;W(n),u==null||u(n,s)},[u]),ce=t.useCallback(()=>{typeof o=="string"&&(Q.default(o),A({type:"success",children:"Copied to clipboard."}))},[o,A]),N=t.useCallback(s=>{var J;const n=H.current??$.current??void 0;if(n){const K=(J=Object.getOwnPropertyDescriptor(n instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,"value"))==null?void 0:J.set;if(K){K.call(n,s);const pe=new Event("input",{bubbles:!0});n.dispatchEvent(pe),n.focus();return}}throw new Error("Unable to set value.")},[]),le=t.useCallback(()=>{N("")},[N]),[ie,ue]=t.useState(""),G=!!a&&ie!==a,xe=t.useCallback(()=>{if(a){try{N(a)}catch{Q.default(a)}ue(a)}},[a,N]),U=t.useMemo(()=>d.length,[d]);return e.jsxRuntimeExports.jsxs(ee,{ref:p,label:m,error:l,errorId:F,warning:h,warningId:V,information:i,informationId:O,footnote:S,attachments:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(je.default,{isCollapsed:!G,children:G?e.jsxRuntimeExports.jsxs("button",{type:"button",className:r.cx(M.buttonResetStyles,M.overflowProtectionStyles,"kakadu-components-4141839293"),onClick:xe,children:[e.jsxRuntimeExports.jsx(de.default,{label:"Apply suggestion"}),e.jsxRuntimeExports.jsx(me.default,{width:13,height:13,className:"kakadu-components-1417828741"}),e.jsxRuntimeExports.jsx(x.Span,{className:"kakadu-components-1384720019",children:a}),e.jsxRuntimeExports.jsx(X.default,{className:"kakadu-components-2744733744"}),e.jsxRuntimeExports.jsx(Y.default,{})]}):null}),C]}),style:{"--button-padding":`calc(${ge*((j?1:0)+(k?1:0)+U)}px + 6px)`},children:[e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-3146929190",children:[oe?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{ref:q,"aria-hidden":!0,className:r.cx(v,f,"kakadu-components-2033521835"),children:[P.map((s,n)=>e.jsxRuntimeExports.jsxs("span",{children:[s,re>1?e.jsxRuntimeExports.jsx("br",{}):null]},n))," "]}),e.jsxRuntimeExports.jsx("textarea",{...b,ref:H,rows:b.rows??1,"aria-invalid":y,"data-warning":_,"data-information":w,"aria-describedby":z,value:o,className:r.cx(v,f,"kakadu-components-2119524139"),style:{minHeight:ne},onChange:D})]}):e.jsxRuntimeExports.jsx("input",{...b,ref:$,type:c??"text",value:o,"aria-invalid":y,"data-warning":_,"data-information":w,"aria-describedby":z,className:r.cx(v,f),onChange:D}),te?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(X.default,{className:"kakadu-components-616311160"}),e.jsxRuntimeExports.jsx(Y.default,{className:"kakadu-components-1962999040"})]})]}),j||k||U>0?e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-131986363",children:[d.map((s,n)=>e.jsxRuntimeExports.jsx(B.default,{iconLeft:s.icon,label:s.label,tooltip:s.label,className:L,onClick:s.onClick},s.label+n)),j?e.jsxRuntimeExports.jsx(B.default,{iconLeft:"copy",label:"Copy",tooltip:"Copy",className:L,onClick:ce}):null,k?e.jsxRuntimeExports.jsx(B.default,{iconLeft:"times",label:"Clear",tooltip:"Clear",className:L,onClick:le}):null]}):null,R]})}exports.InputLabel=ee;exports.default=ye;exports.errorParagraph=Z;exports.inputStyles=v;
|