@kakadu/components 3.15.5 → 4.0.1
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 +2 -4
- package/build/components/button-tooltip.js +1 -1
- package/build/components/button-tooltip.mjs +11 -11
- package/build/components/button.d.ts +2 -6
- package/build/components/button.js +1 -1
- package/build/components/button.mjs +51 -51
- package/build/components/card.js +1 -1
- package/build/components/card.mjs +22 -22
- package/build/components/combobox.d.ts +25 -0
- package/build/components/combobox.js +1 -0
- package/build/components/combobox.mjs +322 -0
- package/build/components/copy-icon-button.js +1 -1
- package/build/components/copy-icon-button.mjs +20 -21
- package/build/components/datum.js +1 -1
- package/build/components/datum.mjs +12 -12
- package/build/components/flex.d.ts +13 -9
- package/build/components/flex.js +1 -1
- package/build/components/flex.mjs +25 -15
- package/build/components/footer.d.ts +3 -6
- package/build/components/footer.js +1 -1
- package/build/components/footer.mjs +33 -33
- package/build/components/header.js +1 -1
- package/build/components/header.mjs +4 -5
- package/build/components/icon-button.d.ts +2 -6
- package/build/components/icon-button.js +1 -1
- package/build/components/icon-button.mjs +41 -41
- package/build/components/input.d.ts +12 -19
- package/build/components/input.js +2 -2
- package/build/components/input.mjs +122 -147
- package/build/components/kakadu-guide-logo.d.ts +2 -4
- package/build/components/kakadu-guide-logo.js +1 -1
- package/build/components/kakadu-guide-logo.mjs +13 -13
- package/build/components/modal.js +1 -1
- package/build/components/modal.mjs +65 -66
- package/build/components/notice.d.ts +2 -7
- package/build/components/notice.js +1 -1
- package/build/components/notice.mjs +16 -16
- package/build/components/notification.d.ts +2 -1
- package/build/components/notification.js +1 -1
- package/build/components/notification.mjs +9 -9
- package/build/components/popover-menu.js +1 -1
- package/build/components/popover-menu.mjs +98 -106
- package/build/components/popover.js +1 -1
- package/build/components/popover.mjs +1 -1
- package/build/components/select.d.ts +12 -0
- package/build/components/select.js +1 -0
- package/build/components/select.mjs +36 -0
- package/build/components/separator.js +1 -1
- package/build/components/separator.mjs +25 -25
- package/build/components/text-button.d.ts +2 -4
- package/build/components/text-button.js +1 -1
- package/build/components/text-button.mjs +26 -27
- package/build/components/text.d.ts +1 -1
- package/build/components/text.js +1 -1
- package/build/components/text.mjs +29 -30
- package/build/components/theme-setter.d.ts +1 -1
- package/build/components/wrapper.d.ts +3 -6
- package/build/components/wrapper.js +1 -1
- package/build/components/wrapper.mjs +25 -23
- package/build/components.css +1 -1
- package/build/{focus-trap-react-CcpTuiJi.js → focus-trap-react-CkKg4ubd.js} +5 -5
- package/build/{focus-trap-react-DYXrtbDH.mjs → focus-trap-react-DATIi_Ob.mjs} +34 -29
- package/build/hooks/use-synchronized-value.d.ts +4 -0
- package/build/icons/icon.d.ts +4 -42
- package/build/icons/icon.js +1 -1
- package/build/icons/icon.mjs +76 -76
- package/build/index.d.ts +4 -0
- package/build/index.js +1 -1
- package/build/index.mjs +248 -241
- package/build/use-synchronized-value-D0_rS5Wp.js +1 -0
- package/build/use-synchronized-value-XnIpeq1s.mjs +28 -0
- package/package.json +3 -1
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { cx as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Paragraph as s, Span as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const
|
|
11
|
-
function o(
|
|
12
|
-
return !!(
|
|
2
|
+
import { cx as i } from "@kuma-ui/core";
|
|
3
|
+
import d from "../theme.mjs";
|
|
4
|
+
import a from "./flex.mjs";
|
|
5
|
+
import { Paragraph as s, Span as l } from "./text.mjs";
|
|
6
|
+
import h from "./kakadu-logo.mjs";
|
|
7
|
+
import u from "./moving-stars.mjs";
|
|
8
|
+
import p from "./aria-text.mjs";
|
|
9
|
+
import m from "./wrapper.mjs";
|
|
10
|
+
const n = "kakadu-components-975968984";
|
|
11
|
+
function o(t) {
|
|
12
|
+
return !!(t && t.trim() !== "");
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
width:
|
|
14
|
+
const S = ["privacyPolicy", "ethicalGuidelines", "security"];
|
|
15
|
+
function v({
|
|
16
|
+
width: t = "page",
|
|
17
17
|
links: r,
|
|
18
|
-
className:
|
|
18
|
+
className: c
|
|
19
19
|
}) {
|
|
20
|
-
return /* @__PURE__ */ e.jsxs(
|
|
21
|
-
/* @__PURE__ */ e.jsxs(
|
|
22
|
-
/* @__PURE__ */ e.jsxs(
|
|
20
|
+
return /* @__PURE__ */ e.jsxs(m, { as: "footer", gap: 2, "data-theme": "dark", width: t, className: i(d, "kakadu-components-1574406446", c), children: [
|
|
21
|
+
/* @__PURE__ */ e.jsxs(a, { wrap: !0, direction: "row", gap: 4, className: "kakadu-components-783629418", children: [
|
|
22
|
+
/* @__PURE__ */ e.jsxs(a, { direction: "column", preset: "start", gap: 0.5, children: [
|
|
23
23
|
/* @__PURE__ */ e.jsx(s, { children: /* @__PURE__ */ e.jsx("strong", { children: "Products" }) }),
|
|
24
|
-
/* @__PURE__ */ e.jsxs(s, { as: "ul", className:
|
|
24
|
+
/* @__PURE__ */ e.jsxs(s, { as: "ul", className: n, children: [
|
|
25
25
|
/* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("a", { href: "https://guide.kakadu.no", children: "Kakadu Guide" }) }),
|
|
26
26
|
/* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("a", { href: "https://utforsk.kakadu.no/kakadu-start", children: "Kakadu Kolibri" }) })
|
|
27
27
|
] })
|
|
28
28
|
] }),
|
|
29
|
-
/* @__PURE__ */ e.jsxs(
|
|
29
|
+
/* @__PURE__ */ e.jsxs(a, { direction: "column", preset: "start", gap: 0.5, children: [
|
|
30
30
|
/* @__PURE__ */ e.jsx(s, { children: /* @__PURE__ */ e.jsx("strong", { children: "Results" }) }),
|
|
31
|
-
/* @__PURE__ */ e.jsxs(s, { as: "ul", className:
|
|
31
|
+
/* @__PURE__ */ e.jsxs(s, { as: "ul", className: n, children: [
|
|
32
32
|
/* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("a", { href: "https://utforsk.kakadu.no", children: "Case studies" }) }),
|
|
33
33
|
/* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("a", { href: "https://utforsk.kakadu.no", children: "Impact measurement" }) })
|
|
34
34
|
] })
|
|
35
35
|
] }),
|
|
36
|
-
/* @__PURE__ */ e.jsxs(
|
|
36
|
+
/* @__PURE__ */ e.jsxs(a, { direction: "column", preset: "start", gap: 0.5, children: [
|
|
37
37
|
/* @__PURE__ */ e.jsx(s, { children: /* @__PURE__ */ e.jsx("strong", { children: "About us" }) }),
|
|
38
|
-
/* @__PURE__ */ e.jsxs(s, { as: "ul", className:
|
|
38
|
+
/* @__PURE__ */ e.jsxs(s, { as: "ul", className: n, children: [
|
|
39
39
|
/* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("a", { href: "https://utforsk.kakadu.no", children: "Our story" }) }),
|
|
40
40
|
/* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("a", { href: "https://utforsk.kakadu.no/kontakt-oss", children: "Contact" }) }),
|
|
41
41
|
/* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("a", { target: "_blank", rel: "noopener noreferrer", href: "https://kakadu.instatus.com", children: "Status" }) })
|
|
42
42
|
] })
|
|
43
43
|
] }),
|
|
44
|
-
/* @__PURE__ */ e.jsxs(
|
|
44
|
+
/* @__PURE__ */ e.jsxs(a, { direction: "column", preset: "start", gap: 0.5, children: [
|
|
45
45
|
/* @__PURE__ */ e.jsx(s, { children: /* @__PURE__ */ e.jsx("strong", { children: "Compliance" }) }),
|
|
46
|
-
/* @__PURE__ */ e.jsxs(s, { as: "ul", className:
|
|
46
|
+
/* @__PURE__ */ e.jsxs(s, { as: "ul", className: n, children: [
|
|
47
47
|
/* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("a", { href: o(r == null ? void 0 : r.privacyPolicy) ? r.privacyPolicy : "https://utforsk.kakadu.no/personvernerklaering", children: "Privacy policy" }) }),
|
|
48
48
|
/* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("a", { href: o(r == null ? void 0 : r.ethicalGuidelines) ? r.ethicalGuidelines : "https://utforsk.kakadu.no/etiske-retningslinjer", children: "Ethical guidelines" }) }),
|
|
49
49
|
/* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("a", { href: o(r == null ? void 0 : r.security) ? r.security : "https://utforsk.kakadu.no/personvernerklaering", children: "Security" }) })
|
|
50
50
|
] })
|
|
51
51
|
] }),
|
|
52
|
-
/* @__PURE__ */ e.jsx(
|
|
52
|
+
/* @__PURE__ */ e.jsx(a, { fill: !0, className: "kakadu-components-3520395370", children: /* @__PURE__ */ e.jsx("a", { href: "https://businessnorway.com/made-in-norway", target: "_blank", rel: "noopener noreferrer", className: "kakadu-components-3521477705", children: /* @__PURE__ */ e.jsx("img", { alt: "Made in Norway", src: "https://cdn.prod.website-files.com/65a686387a785640fecc9b9d/68f09646a6d6e62b6839c38c_made_in_norway_logo.png", width: 76, className: "kakadu-components-2329568054" }) }) })
|
|
53
53
|
] }),
|
|
54
|
-
/* @__PURE__ */ e.jsxs(
|
|
54
|
+
/* @__PURE__ */ e.jsxs(a, { direction: "row", gap: 1, className: i("kakadu-components-2089456404"), children: [
|
|
55
55
|
/* @__PURE__ */ e.jsxs("a", { href: "https://kakadu.no", children: [
|
|
56
|
-
/* @__PURE__ */ e.jsx(
|
|
57
|
-
/* @__PURE__ */ e.jsx(
|
|
56
|
+
/* @__PURE__ */ e.jsx(p, { children: "Kakadu.no" }),
|
|
57
|
+
/* @__PURE__ */ e.jsx(h, { width: 90, className: "kakadu-components-3695148669" })
|
|
58
58
|
] }),
|
|
59
|
-
/* @__PURE__ */ e.jsxs(
|
|
59
|
+
/* @__PURE__ */ e.jsxs(l, { className: "kakadu-components-1125118494", children: [
|
|
60
60
|
"© ",
|
|
61
61
|
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
62
62
|
" Kakadu Ignite AS"
|
|
63
63
|
] })
|
|
64
64
|
] }),
|
|
65
|
-
/* @__PURE__ */ e.jsx(
|
|
65
|
+
/* @__PURE__ */ e.jsx(u, {})
|
|
66
66
|
] });
|
|
67
67
|
}
|
|
68
68
|
export {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
v as default,
|
|
70
|
+
S as footerLinkItems
|
|
71
71
|
};
|
|
@@ -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 s=require("../jsx-runtime-BB_1_6y_.js"),n=require("@kuma-ui/core"),a=require("./wrapper.js");function o({as:e,className:r,...t}){return s.jsxRuntimeExports.jsx(a.default,{...t,wrap:!0,as:e??"header",direction:"row",preset:"space-between",className:n.cx("kakadu-components-866714386",r),innerClassName:"kakadu-components-479363365"})}exports.default=o;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { j as o } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
2
|
import { cx as t } from "@kuma-ui/core";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
function u({
|
|
3
|
+
import s from "./wrapper.mjs";
|
|
4
|
+
function i({
|
|
6
5
|
as: e,
|
|
7
6
|
className: r,
|
|
8
7
|
...a
|
|
9
8
|
}) {
|
|
10
|
-
return /* @__PURE__ */ o.jsx(
|
|
9
|
+
return /* @__PURE__ */ o.jsx(s, { ...a, wrap: !0, as: e ?? "header", direction: "row", preset: "space-between", className: t("kakadu-components-866714386", r), innerClassName: "kakadu-components-479363365" });
|
|
11
10
|
}
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
i as default
|
|
14
13
|
};
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { type HTMLProps } from 'react';
|
|
2
2
|
import { type IconType } from '../icons/icon';
|
|
3
3
|
import { type ButtonTooltipPosition } from './button-tooltip';
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
success = "success",
|
|
7
|
-
warning = "warning",
|
|
8
|
-
danger = "danger"
|
|
9
|
-
}
|
|
4
|
+
export declare const iconButtonVariants: readonly ["default", "success", "warning", "danger"];
|
|
5
|
+
export type IconButtonVariant = (typeof iconButtonVariants)[number];
|
|
10
6
|
export type IconButtonProperties = HTMLProps<HTMLButtonElement> & {
|
|
11
7
|
readonly icon: IconType;
|
|
12
8
|
readonly variant?: IconButtonVariant;
|
|
@@ -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 e=require("../jsx-runtime-BB_1_6y_.js"),t=require("react"),o=require("@kuma-ui/core"),d=require("../icons/icon.js"),b=require("../theme.js"),T=require("./theme-setter.js"),c=require("./button.js"),D=require("./button-tooltip.js"),M=require("./click-ripples.js"),y=require("./hover-gradient.js"),z=require("./skeleton.js"),A=require("./atom.js"),C=["default","success","warning","danger"];function O({icon:s,variant:u="default",label:p,tooltipPosition:E,href:f,target:g,rel:q,disabled:w,isLoading:k,isSkeleton:r,isSkeletonAnimated:_=!0,className:B,...v}){const j=t.useId(),I=T.useIsDarkMode(),n=f&&!r,[a,N]=t.useState(s),[h,m]=t.useState(!1),R=t.useRef(s),i=t.useRef(null);t.useEffect(()=>{R.current=s},[s]);const l=t.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);t.useEffect(()=>{if(a===s){m(S=>S&&!1);return}m(!0),l(),i.current=setTimeout(()=>{m(!1),N(R.current)},370)},[a,s,l]),t.useEffect(()=>()=>{l()},[l]);const x=!!w||!!k||!!r;return e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-4096632152",children:[e.jsxRuntimeExports.jsxs(A.default,{...v,as:n?"a":"button",type:n?void 0:"button",href:n?f:void 0,target:n?g:void 0,rel:n?q:void 0,"aria-label":p,"aria-describedby":j,disabled:n?void 0:x,inert:n?x:void 0,className:o.cx(b.buttonResetStyles,b.effectStyles,"kakadu-components-2957737620",u==="default"&&o.cx(c.buttonSecondaryStyles,"kakadu-components-1561784812"),u==="success"&&o.cx(c.buttonSuccessStyles,"kakadu-components-1398421429"),u==="warning"&&o.cx(c.buttonWarningStyles,"kakadu-components-1872098090"),u==="danger"&&o.cx(c.buttonDangerStyles,"kakadu-components-2064536093"),r&&"kakadu-components-2662775151",B),children:[e.jsxRuntimeExports.jsxs("span",{"data-theme":u==="default"?I?"dark":"light":"dark",className:"kakadu-components-3040141419",children:[e.jsxRuntimeExports.jsx(d.default,{width:16,height:16,type:a,className:o.cx(d.iconShadowStyles,"kakadu-components-1562914001",h&&"kakadu-components-2360250719")}),a===s?null:e.jsxRuntimeExports.jsx(d.default,{width:16,height:16,type:s,className:o.cx(d.iconShadowStyles,"kakadu-components-1224061930",h&&"kakadu-components-2519520784")})]}),e.jsxRuntimeExports.jsx(c.ButtonLoader,{isLoading:k,size:14}),e.jsxRuntimeExports.jsx(D.default,{id:j,label:p,position:E}),x?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(M.default,{size:50}),e.jsxRuntimeExports.jsx(y.default,{size:50,className:u==="default"?y.normalBlendStyles:void 0})]})]}),r?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-3422055155",children:e.jsxRuntimeExports.jsx(z.SkeletonInstance,{width:"100%",height:"100%",isAnimated:_})}):null]})}exports.default=O;exports.iconButtonVariants=C;
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useId as A, useState as
|
|
3
|
-
import { cx as
|
|
1
|
+
import { j as e } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
+
import { useId as A, useState as y, useRef as g, useEffect as l, useCallback as C } from "react";
|
|
3
|
+
import { cx as s } from "@kuma-ui/core";
|
|
4
4
|
import b, { iconShadowStyles as S } from "../icons/icon.mjs";
|
|
5
5
|
import { buttonResetStyles as E, effectStyles as M } from "../theme.mjs";
|
|
6
6
|
import { useIsDarkMode as F } from "./theme-setter.mjs";
|
|
7
|
-
import { ButtonLoader as G, buttonSecondaryStyles as H, buttonSuccessStyles as O, buttonWarningStyles as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { SkeletonInstance as
|
|
12
|
-
import
|
|
13
|
-
|
|
7
|
+
import { ButtonLoader as G, buttonSecondaryStyles as H, buttonSuccessStyles as O, buttonWarningStyles as V, buttonDangerStyles as W } from "./button.mjs";
|
|
8
|
+
import q from "./button-tooltip.mjs";
|
|
9
|
+
import J from "./click-ripples.mjs";
|
|
10
|
+
import K, { normalBlendStyles as L } from "./hover-gradient.mjs";
|
|
11
|
+
import { SkeletonInstance as P } from "./skeleton.mjs";
|
|
12
|
+
import Q from "./atom.mjs";
|
|
13
|
+
const re = ["default", "success", "warning", "danger"];
|
|
14
14
|
function ce({
|
|
15
|
-
icon:
|
|
15
|
+
icon: t,
|
|
16
16
|
variant: n = "default",
|
|
17
17
|
label: m,
|
|
18
18
|
tooltipPosition: w,
|
|
19
19
|
href: p,
|
|
20
|
-
target:
|
|
21
|
-
rel:
|
|
22
|
-
disabled:
|
|
20
|
+
target: B,
|
|
21
|
+
rel: I,
|
|
22
|
+
disabled: N,
|
|
23
23
|
isLoading: f,
|
|
24
|
-
isSkeleton:
|
|
25
|
-
isSkeletonAnimated:
|
|
26
|
-
className:
|
|
24
|
+
isSkeleton: a,
|
|
25
|
+
isSkeletonAnimated: R = !0,
|
|
26
|
+
className: v,
|
|
27
27
|
...D
|
|
28
28
|
}) {
|
|
29
|
-
const k = A(), T = F(),
|
|
30
|
-
|
|
31
|
-
x.current =
|
|
32
|
-
}, [
|
|
29
|
+
const k = A(), T = F(), o = p && !a, [r, z] = y(t), [h, i] = y(!1), x = g(t), c = g(null);
|
|
30
|
+
l(() => {
|
|
31
|
+
x.current = t;
|
|
32
|
+
}, [t]);
|
|
33
33
|
const u = C(() => {
|
|
34
34
|
c.current && (clearTimeout(c.current), c.current = null);
|
|
35
35
|
}, []);
|
|
36
|
-
|
|
37
|
-
if (
|
|
38
|
-
|
|
36
|
+
l(() => {
|
|
37
|
+
if (r === t) {
|
|
38
|
+
i((j) => j && !1);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
i(!0), u(), c.current = setTimeout(() => {
|
|
42
|
+
i(!1), z(x.current);
|
|
43
43
|
}, 370);
|
|
44
|
-
}, [
|
|
44
|
+
}, [r, t, u]), l(() => () => {
|
|
45
45
|
u();
|
|
46
46
|
}, [u]);
|
|
47
|
-
const
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
47
|
+
const d = !!N || !!f || !!a;
|
|
48
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "kakadu-components-4096632152", children: [
|
|
49
|
+
/* @__PURE__ */ e.jsxs(Q, { ...D, as: o ? "a" : "button", type: o ? void 0 : "button", href: o ? p : void 0, target: o ? B : void 0, rel: o ? I : void 0, "aria-label": m, "aria-describedby": k, disabled: o ? void 0 : d, inert: o ? d : void 0, className: s(E, M, "kakadu-components-2957737620", n === "default" && s(H, "kakadu-components-1561784812"), n === "success" && s(O, "kakadu-components-1398421429"), n === "warning" && s(V, "kakadu-components-1872098090"), n === "danger" && s(W, "kakadu-components-2064536093"), a && "kakadu-components-2662775151", v), children: [
|
|
50
|
+
/* @__PURE__ */ e.jsxs("span", { "data-theme": n === "default" ? T ? "dark" : "light" : "dark", className: "kakadu-components-3040141419", children: [
|
|
51
|
+
/* @__PURE__ */ e.jsx(b, { width: 16, height: 16, type: r, className: s(S, "kakadu-components-1562914001", h && "kakadu-components-2360250719") }),
|
|
52
|
+
r === t ? null : /* @__PURE__ */ e.jsx(b, { width: 16, height: 16, type: t, className: s(S, "kakadu-components-1224061930", h && "kakadu-components-2519520784") })
|
|
53
53
|
] }),
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ e.jsx(G, { isLoading: f, size: 14 }),
|
|
55
|
+
/* @__PURE__ */ e.jsx(q, { id: k, label: m, position: w }),
|
|
56
|
+
d ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
57
|
+
/* @__PURE__ */ e.jsx(J, { size: 50 }),
|
|
58
|
+
/* @__PURE__ */ e.jsx(K, { size: 50, className: n === "default" ? L : void 0 })
|
|
59
59
|
] })
|
|
60
60
|
] }),
|
|
61
|
-
|
|
61
|
+
a ? /* @__PURE__ */ e.jsx("div", { className: "kakadu-components-3422055155", children: /* @__PURE__ */ e.jsx(P, { width: "100%", height: "100%", isAnimated: R }) }) : null
|
|
62
62
|
] });
|
|
63
63
|
}
|
|
64
64
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
ce as default,
|
|
66
|
+
re as iconButtonVariants
|
|
67
67
|
};
|
|
@@ -1,45 +1,38 @@
|
|
|
1
1
|
import { type ChangeEvent, type HTMLProps, type ReactNode } from 'react';
|
|
2
|
-
import { IconType } from '../icons/icon';
|
|
2
|
+
import { type IconType } from '../icons/icon';
|
|
3
|
+
export declare const inputStyles: string;
|
|
3
4
|
export declare const errorParagraph: string;
|
|
4
|
-
type
|
|
5
|
-
type
|
|
5
|
+
type InputLabelMessageType = Error | ReactNode | string;
|
|
6
|
+
type InputLabelMessageProperties<Key extends string> = ({
|
|
6
7
|
readonly [Property in Key]?: undefined;
|
|
7
8
|
} & {
|
|
8
9
|
readonly [Property in `${Key}Id`]?: undefined;
|
|
9
10
|
}) | ({
|
|
10
|
-
readonly [Property in Key]:
|
|
11
|
+
readonly [Property in Key]: InputLabelMessageType;
|
|
11
12
|
} & {
|
|
12
13
|
readonly [Property in `${Key}Id`]: string;
|
|
13
14
|
});
|
|
14
|
-
type
|
|
15
|
+
type InputLabelProperties = HTMLProps<HTMLLabelElement> & InputLabelMessageProperties<'error'> & InputLabelMessageProperties<'warning'> & InputLabelMessageProperties<'information'> & {
|
|
15
16
|
readonly label: string;
|
|
16
17
|
readonly footnote?: ReactNode;
|
|
17
18
|
readonly attachments?: ReactNode;
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
-
export type
|
|
21
|
-
|
|
22
|
-
readonly label: ReactNode | string;
|
|
23
|
-
readonly disabled?: boolean;
|
|
24
|
-
};
|
|
25
|
-
export type SelectProperties<Type extends string = string> = Omit<ControllerProperties & HTMLProps<HTMLSelectElement>, 'onChange'> & {
|
|
26
|
-
readonly options: Array<SelectOption<Type>>;
|
|
27
|
-
readonly onChange?: (value: Type, event: ChangeEvent<HTMLSelectElement>) => void;
|
|
28
|
-
};
|
|
29
|
-
export declare function Select<Type extends string = string>({ label, options, error, warning, information, footnote, className, onChange, ...properties }: SelectProperties<Type>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
type InputType = HTMLInputElement | HTMLTextAreaElement;
|
|
20
|
+
export declare function InputLabel({ label, error, errorId, warning, warningId, information, informationId, footnote, attachments, className, children, ...properties }: InputLabelProperties): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export type InputLabelControllerProperties = Omit<InputLabelProperties, 'errorId' | 'warningId' | 'attachments' | 'onClick' | 'onMouseDown' | 'onMouseUp' | 'onChange' | 'onFocus' | 'onBlur' | 'onInput' | 'onBeforeInput'>;
|
|
22
|
+
export type InputType = HTMLInputElement | HTMLTextAreaElement;
|
|
31
23
|
export type InputAction = {
|
|
32
24
|
icon: IconType;
|
|
33
25
|
label: string;
|
|
34
26
|
onClick: () => void;
|
|
35
27
|
};
|
|
36
|
-
export type InputProperties = Omit<
|
|
28
|
+
export type InputProperties = Omit<InputLabelControllerProperties & Omit<HTMLProps<InputType>, 'ref'>, 'onChange'> & {
|
|
37
29
|
readonly suggestion?: string;
|
|
30
|
+
readonly attachments?: ReactNode;
|
|
38
31
|
readonly actions?: InputAction[];
|
|
39
32
|
readonly hasCopyButton?: boolean;
|
|
40
33
|
readonly hasClearButton?: boolean;
|
|
41
34
|
readonly isMultiline?: boolean;
|
|
42
35
|
readonly onChange?: (value: string, event: ChangeEvent<InputType>) => void;
|
|
43
36
|
};
|
|
44
|
-
export default function Input({ type, label, error, warning, information, footnote, suggestion, actions, hasCopyButton, hasClearButton, isMultiline, onChange, className, ...properties }: InputProperties): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export default function Input({ ref, type, label, error, warning, information, footnote, suggestion, attachments, actions, hasCopyButton, hasClearButton, isMultiline, onChange, className, ...properties }: InputProperties): import("react/jsx-runtime").JSX.Element;
|
|
45
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"),
|
|
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"),K=require("../utilities/copy-to-clipboard.js"),L=require("../theme.js"),pe=require("../icons/sparkle.js"),me=require("./button-tooltip.js"),B=require("./text-button.js"),p=require("./text.js"),de=require("./collapsible.js"),Q=require("./click-ripples.js"),X=require("./hover-gradient.js"),je=require("./notification.js"),ke="kakadu-components-922159086",fe="kakadu-components-25448712",N="kakadu-components-1923392328",M="kakadu-components-4056037255",Y=r.cx(M,"kakadu-components-3245407458"),he=r.cx(M,"kakadu-components-1117160492"),Ee=r.cx(M,"kakadu-components-2261792866");function Re({as:m,className:c,...d}){return e.jsxRuntimeExports.jsx(p.Span,{as:m??"span",...d,className:r.cx("kakadu-components-520991867",c)})}function Z({label:m,error:c,errorId:d,warning:l,warningId:E,information:i,informationId:v,footnote:a,attachments:S,className:j,children:k,...f}){const R=!!c,u=!!l,x=!!i,h=!!a;return e.jsxRuntimeExports.jsx("label",{...f,className:r.cx(ke,j),children:e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-3146929190",children:[e.jsxRuntimeExports.jsx(p.Span,{className:r.cx(L.overflowProtectionStyles,fe),children:e.jsxRuntimeExports.jsx("span",{children:m})}),e.jsxRuntimeExports.jsxs("span",{className:"kakadu-components-3298764637",children:[k,h?e.jsxRuntimeExports.jsx(Re,{className:"kakadu-components-613632806",children:a}):null,S]}),R||u||x?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-2927674627",children:R?e.jsxRuntimeExports.jsx(p.Paragraph,{id:d,className:Y,children:c instanceof Error?c.message:c}):u?e.jsxRuntimeExports.jsx(p.Paragraph,{id:E,className:he,children:l instanceof Error?l.message:l}):x?e.jsxRuntimeExports.jsx(p.Paragraph,{id:v,className:Ee,children:i instanceof Error?i.message:i}):null}):null]})})}const be=40,w="kakadu-components-4233741488";function ge({ref:m,type:c,label:d,error:l,warning:E,information:i,footnote:v,suggestion:a,attachments:S,actions:j=[],hasCopyButton:k,hasClearButton:f,isMultiline:R,onChange:u,className:x,...h}){const T=t.useRef(null),$=t.useRef(null),C=t.useRef(null),H=je.useCreateNotification(),q=t.useId(),A=`${q}-error`,F=`${q}-warning`,V=`${q}-information`,{value:b,disabled:ee}=h,[te,O]=t.useState(""),o=b??te,[se,ne]=t.useState(),ae=c==="textarea"||!!R;t.useLayoutEffect(()=>{typeof o=="string"&&C.current&&ne(C.current.scrollHeight)},[o]);const I=t.useMemo(()=>typeof o=="string"?`${o} `.split(`
|
|
2
|
+
`):[],[o]),oe=t.useMemo(()=>I.length,[I]),g=!!l,P=!g&&!!E,_=!!i,W=g?A:P?F:_?V:void 0;t.useEffect(()=>{O(typeof b=="string"?b:"")},[b]);const z=t.useCallback(s=>{const{value:n}=s.target;O(n),u==null||u(n,s)},[u]),re=t.useCallback(()=>{typeof o=="string"&&(K.default(o),H({type:"success",children:"Copied to clipboard."}))},[o,H]),y=t.useCallback(s=>{var U;const n=$.current??T.current??void 0;if(n){const J=(U=Object.getOwnPropertyDescriptor(n instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,"value"))==null?void 0:U.set;if(J){J.call(n,s);const xe=new Event("input",{bubbles:!0});n.dispatchEvent(xe),n.focus();return}}throw new Error("Unable to set value.")},[]),ce=t.useCallback(()=>{y("")},[y]),[le,ie]=t.useState(""),D=!!a&&le!==a,ue=t.useCallback(()=>{if(a){try{y(a)}catch{K.default(a)}ie(a)}},[a,y]),G=t.useMemo(()=>j.length,[j]);return e.jsxRuntimeExports.jsxs(Z,{ref:m,label:d,error:l,errorId:A,warning:E,warningId:F,information:i,informationId:V,footnote:v,attachments:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(de.default,{isCollapsed:!D,children:D?e.jsxRuntimeExports.jsxs("button",{type:"button",className:r.cx(L.buttonResetStyles,L.overflowProtectionStyles,"kakadu-components-4141839293"),onClick:ue,children:[e.jsxRuntimeExports.jsx(me.default,{label:"Apply suggestion"}),e.jsxRuntimeExports.jsx(pe.default,{width:13,height:13,className:"kakadu-components-1417828741"}),e.jsxRuntimeExports.jsx(p.Span,{className:"kakadu-components-1384720019",children:a}),e.jsxRuntimeExports.jsx(Q.default,{className:"kakadu-components-2744733744"}),e.jsxRuntimeExports.jsx(X.default,{})]}):null}),S]}),style:{"--button-padding":`calc(${be*((k?1:0)+(f?1:0)+G)}px + 6px)`},children:[e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-3146929190",children:[ae?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{ref:C,"aria-hidden":!0,className:r.cx(N,x,"kakadu-components-2033521835"),children:[I.map((s,n)=>e.jsxRuntimeExports.jsxs("span",{children:[s,oe>1?e.jsxRuntimeExports.jsx("br",{}):null]},n))," "]}),e.jsxRuntimeExports.jsx("textarea",{...h,ref:$,rows:1,"aria-invalid":g,"data-warning":P,"data-information":_,"aria-describedby":W,value:o,className:r.cx(N,x,"kakadu-components-2119524139"),style:{minHeight:se},onChange:z})]}):e.jsxRuntimeExports.jsx("input",{...h,ref:T,type:c??"text",value:o,"aria-invalid":g,"data-warning":P,"data-information":_,"aria-describedby":W,className:r.cx(N,x),onChange:z}),ee?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Q.default,{className:"kakadu-components-616311160"}),e.jsxRuntimeExports.jsx(X.default,{className:"kakadu-components-1962999040"})]})]}),k||f||G>0?e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-131986363",children:[j.map((s,n)=>e.jsxRuntimeExports.jsx(B.default,{iconLeft:s.icon,label:s.label,tooltip:s.label,className:w,onClick:s.onClick},s.label+n)),k?e.jsxRuntimeExports.jsx(B.default,{iconLeft:"copy",label:"Copy",tooltip:"Copy",className:w,onClick:re}):null,f?e.jsxRuntimeExports.jsx(B.default,{iconLeft:"times",label:"Clear",tooltip:"Clear",className:w,onClick:ce}):null]}):null]})}exports.InputLabel=Z;exports.default=ge;exports.errorParagraph=Y;exports.inputStyles=N;
|