@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.
Files changed (72) hide show
  1. package/build/components/button-tooltip.d.ts +2 -4
  2. package/build/components/button-tooltip.js +1 -1
  3. package/build/components/button-tooltip.mjs +11 -11
  4. package/build/components/button.d.ts +2 -6
  5. package/build/components/button.js +1 -1
  6. package/build/components/button.mjs +51 -51
  7. package/build/components/card.js +1 -1
  8. package/build/components/card.mjs +22 -22
  9. package/build/components/combobox.d.ts +25 -0
  10. package/build/components/combobox.js +1 -0
  11. package/build/components/combobox.mjs +322 -0
  12. package/build/components/copy-icon-button.js +1 -1
  13. package/build/components/copy-icon-button.mjs +20 -21
  14. package/build/components/datum.js +1 -1
  15. package/build/components/datum.mjs +12 -12
  16. package/build/components/flex.d.ts +13 -9
  17. package/build/components/flex.js +1 -1
  18. package/build/components/flex.mjs +25 -15
  19. package/build/components/footer.d.ts +3 -6
  20. package/build/components/footer.js +1 -1
  21. package/build/components/footer.mjs +33 -33
  22. package/build/components/header.js +1 -1
  23. package/build/components/header.mjs +4 -5
  24. package/build/components/icon-button.d.ts +2 -6
  25. package/build/components/icon-button.js +1 -1
  26. package/build/components/icon-button.mjs +41 -41
  27. package/build/components/input.d.ts +12 -19
  28. package/build/components/input.js +2 -2
  29. package/build/components/input.mjs +122 -147
  30. package/build/components/kakadu-guide-logo.d.ts +2 -4
  31. package/build/components/kakadu-guide-logo.js +1 -1
  32. package/build/components/kakadu-guide-logo.mjs +13 -13
  33. package/build/components/modal.js +1 -1
  34. package/build/components/modal.mjs +65 -66
  35. package/build/components/notice.d.ts +2 -7
  36. package/build/components/notice.js +1 -1
  37. package/build/components/notice.mjs +16 -16
  38. package/build/components/notification.d.ts +2 -1
  39. package/build/components/notification.js +1 -1
  40. package/build/components/notification.mjs +9 -9
  41. package/build/components/popover-menu.js +1 -1
  42. package/build/components/popover-menu.mjs +98 -106
  43. package/build/components/popover.js +1 -1
  44. package/build/components/popover.mjs +1 -1
  45. package/build/components/select.d.ts +12 -0
  46. package/build/components/select.js +1 -0
  47. package/build/components/select.mjs +36 -0
  48. package/build/components/separator.js +1 -1
  49. package/build/components/separator.mjs +25 -25
  50. package/build/components/text-button.d.ts +2 -4
  51. package/build/components/text-button.js +1 -1
  52. package/build/components/text-button.mjs +26 -27
  53. package/build/components/text.d.ts +1 -1
  54. package/build/components/text.js +1 -1
  55. package/build/components/text.mjs +29 -30
  56. package/build/components/theme-setter.d.ts +1 -1
  57. package/build/components/wrapper.d.ts +3 -6
  58. package/build/components/wrapper.js +1 -1
  59. package/build/components/wrapper.mjs +25 -23
  60. package/build/components.css +1 -1
  61. package/build/{focus-trap-react-CcpTuiJi.js → focus-trap-react-CkKg4ubd.js} +5 -5
  62. package/build/{focus-trap-react-DYXrtbDH.mjs → focus-trap-react-DATIi_Ob.mjs} +34 -29
  63. package/build/hooks/use-synchronized-value.d.ts +4 -0
  64. package/build/icons/icon.d.ts +4 -42
  65. package/build/icons/icon.js +1 -1
  66. package/build/icons/icon.mjs +76 -76
  67. package/build/index.d.ts +4 -0
  68. package/build/index.js +1 -1
  69. package/build/index.mjs +248 -241
  70. package/build/use-synchronized-value-D0_rS5Wp.js +1 -0
  71. package/build/use-synchronized-value-XnIpeq1s.mjs +28 -0
  72. package/package.json +3 -1
@@ -1,71 +1,71 @@
1
1
  import { j as e } from "../jsx-runtime-B4hRZ52C.mjs";
2
- import { cx as c } from "@kuma-ui/core";
3
- import l from "../theme.mjs";
4
- import t, { FlexAlignment as n } from "./flex.mjs";
5
- import { Paragraph as s, Span as h } from "./text.mjs";
6
- import u from "./kakadu-logo.mjs";
7
- import p from "./moving-stars.mjs";
8
- import m from "./aria-text.mjs";
9
- import x, { WrapperWidth as j } from "./wrapper.mjs";
10
- const i = "kakadu-components-975968984";
11
- function o(a) {
12
- return !!(a && a.trim() !== "");
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
- var k = /* @__PURE__ */ ((a) => (a.privacyPolicy = "privacyPolicy", a.ethicalGuidelines = "ethicalGuidelines", a.security = "security", a))(k || {});
15
- function K({
16
- width: a = j.page,
14
+ const S = ["privacyPolicy", "ethicalGuidelines", "security"];
15
+ function v({
16
+ width: t = "page",
17
17
  links: r,
18
- className: d
18
+ className: c
19
19
  }) {
20
- return /* @__PURE__ */ e.jsxs(x, { as: "footer", gap: 2, "data-theme": "dark", width: a, className: c(l, "kakadu-components-1574406446", d), children: [
21
- /* @__PURE__ */ e.jsxs(t, { wrap: !0, direction: "row", gap: 4, className: "kakadu-components-783629418", children: [
22
- /* @__PURE__ */ e.jsxs(t, { direction: "column", alignment: n.start, gap: 0.5, children: [
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: i, children: [
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(t, { direction: "column", alignment: n.start, gap: 0.5, children: [
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: i, children: [
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(t, { direction: "column", alignment: n.start, gap: 0.5, children: [
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: i, children: [
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(t, { direction: "column", alignment: n.start, gap: 0.5, children: [
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: i, children: [
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(t, { 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" }) }) })
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(t, { direction: "row", gap: 1, className: c("kakadu-components-2089456404"), children: [
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(m, { children: "Kakadu.no" }),
57
- /* @__PURE__ */ e.jsx(u, { width: 90, className: "kakadu-components-3695148669" })
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(h, { className: "kakadu-components-1125118494", children: [
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(p, {})
65
+ /* @__PURE__ */ e.jsx(u, {})
66
66
  ] });
67
67
  }
68
68
  export {
69
- k as FooterLinkItem,
70
- K as default
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 r=require("../jsx-runtime-BB_1_6y_.js"),o=require("@kuma-ui/core"),s=require("./wrapper.js"),a=require("./flex.js");function u({as:e,className:n,...t}){return r.jsxRuntimeExports.jsx(s.default,{...t,wrap:!0,as:e??"header",direction:"row",alignment:a.FlexAlignment.space_between,className:o.cx("kakadu-components-866714386",n),innerClassName:"kakadu-components-479363365"})}exports.default=u;
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 n from "./wrapper.mjs";
4
- import { FlexAlignment as m } from "./flex.mjs";
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(n, { ...a, wrap: !0, as: e ?? "header", direction: "row", alignment: m.space_between, className: t("kakadu-components-866714386", r), innerClassName: "kakadu-components-479363365" });
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
- u as default
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 enum IconButtonVariant {
5
- default = "default",
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 t=require("../jsx-runtime-BB_1_6y_.js"),s=require("react"),o=require("@kuma-ui/core"),d=require("../icons/icon.js"),g=require("../theme.js"),D=require("./theme-setter.js"),r=require("./button.js"),M=require("./button-tooltip.js"),z=require("./click-ripples.js"),b=require("./hover-gradient.js"),A=require("./skeleton.js"),C=require("./atom.js");var y=(e=>(e.default="default",e.success="success",e.warning="warning",e.danger="danger",e))(y||{});function O({icon:e,variant:u="default",label:p,tooltipPosition:E,href:f,target:q,rel:w,disabled:_,isLoading:k,isSkeleton:c,isSkeletonAnimated:v=!0,className:N,...I}){const j=s.useId(),T=D.useIsDarkMode(),n=f&&!c,[a,B]=s.useState(e),[h,m]=s.useState(!1),R=s.useRef(e),i=s.useRef(null);s.useEffect(()=>{R.current=e},[e]);const l=s.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);s.useEffect(()=>{if(a===e){m(S=>S&&!1);return}m(!0),l(),i.current=setTimeout(()=>{m(!1),B(R.current)},370)},[a,e,l]),s.useEffect(()=>()=>{l()},[l]);const x=!!_||!!k||!!c;return t.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-4096632152",children:[t.jsxRuntimeExports.jsxs(C.default,{...I,as:n?"a":"button",type:n?void 0:"button",href:n?f:void 0,target:n?q:void 0,rel:n?w:void 0,"aria-label":p,"aria-describedby":j,disabled:n?void 0:x,inert:n?x:void 0,className:o.cx(g.buttonResetStyles,g.effectStyles,"kakadu-components-2957737620",u==="default"&&o.cx(r.buttonSecondaryStyles,"kakadu-components-1561784812"),u==="success"&&o.cx(r.buttonSuccessStyles,"kakadu-components-1398421429"),u==="warning"&&o.cx(r.buttonWarningStyles,"kakadu-components-1872098090"),u==="danger"&&o.cx(r.buttonDangerStyles,"kakadu-components-2064536093"),c&&"kakadu-components-2662775151",N),children:[t.jsxRuntimeExports.jsxs("span",{"data-theme":u==="default"?T?"dark":"light":"dark",className:"kakadu-components-3040141419",children:[t.jsxRuntimeExports.jsx(d.default,{width:16,height:16,type:a,className:o.cx(d.iconShadowStyles,"kakadu-components-1562914001",h&&"kakadu-components-2360250719")}),a===e?null:t.jsxRuntimeExports.jsx(d.default,{width:16,height:16,type:e,className:o.cx(d.iconShadowStyles,"kakadu-components-1224061930",h&&"kakadu-components-2519520784")})]}),t.jsxRuntimeExports.jsx(r.ButtonLoader,{isLoading:k,size:14}),t.jsxRuntimeExports.jsx(M.default,{id:j,label:p,position:E}),x?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(z.default,{size:50}),t.jsxRuntimeExports.jsx(b.default,{size:50,className:u==="default"?b.normalBlendStyles:void 0})]})]}),c?t.jsxRuntimeExports.jsx("div",{className:"kakadu-components-3422055155",children:t.jsxRuntimeExports.jsx(A.SkeletonInstance,{width:"100%",height:"100%",isAnimated:v})}):null]})}exports.IconButtonVariant=y;exports.default=O;
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 t } from "../jsx-runtime-B4hRZ52C.mjs";
2
- import { useId as A, useState as j, useRef as y, useEffect as i, useCallback as C } from "react";
3
- import { cx as o } from "@kuma-ui/core";
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 W, buttonDangerStyles as q } from "./button.mjs";
8
- import J from "./button-tooltip.mjs";
9
- import K from "./click-ripples.mjs";
10
- import L, { normalBlendStyles as P } from "./hover-gradient.mjs";
11
- import { SkeletonInstance as Q } from "./skeleton.mjs";
12
- import U from "./atom.mjs";
13
- var X = /* @__PURE__ */ ((e) => (e.default = "default", e.success = "success", e.warning = "warning", e.danger = "danger", e))(X || {});
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: e,
15
+ icon: t,
16
16
  variant: n = "default",
17
17
  label: m,
18
18
  tooltipPosition: w,
19
19
  href: p,
20
- target: N,
21
- rel: v,
22
- disabled: R,
20
+ target: B,
21
+ rel: I,
22
+ disabled: N,
23
23
  isLoading: f,
24
- isSkeleton: r,
25
- isSkeletonAnimated: I = !0,
26
- className: B,
24
+ isSkeleton: a,
25
+ isSkeletonAnimated: R = !0,
26
+ className: v,
27
27
  ...D
28
28
  }) {
29
- const k = A(), T = F(), s = p && !r, [a, z] = j(e), [h, d] = j(!1), x = y(e), c = y(null);
30
- i(() => {
31
- x.current = e;
32
- }, [e]);
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
- i(() => {
37
- if (a === e) {
38
- d((g) => g && !1);
36
+ l(() => {
37
+ if (r === t) {
38
+ i((j) => j && !1);
39
39
  return;
40
40
  }
41
- d(!0), u(), c.current = setTimeout(() => {
42
- d(!1), z(x.current);
41
+ i(!0), u(), c.current = setTimeout(() => {
42
+ i(!1), z(x.current);
43
43
  }, 370);
44
- }, [a, e, u]), i(() => () => {
44
+ }, [r, t, u]), l(() => () => {
45
45
  u();
46
46
  }, [u]);
47
- const l = !!R || !!f || !!r;
48
- return /* @__PURE__ */ t.jsxs("div", { className: "kakadu-components-4096632152", children: [
49
- /* @__PURE__ */ t.jsxs(U, { ...D, as: s ? "a" : "button", type: s ? void 0 : "button", href: s ? p : void 0, target: s ? N : void 0, rel: s ? v : void 0, "aria-label": m, "aria-describedby": k, disabled: s ? void 0 : l, inert: s ? l : void 0, className: o(E, M, "kakadu-components-2957737620", n === "default" && o(H, "kakadu-components-1561784812"), n === "success" && o(O, "kakadu-components-1398421429"), n === "warning" && o(W, "kakadu-components-1872098090"), n === "danger" && o(q, "kakadu-components-2064536093"), r && "kakadu-components-2662775151", B), children: [
50
- /* @__PURE__ */ t.jsxs("span", { "data-theme": n === "default" ? T ? "dark" : "light" : "dark", className: "kakadu-components-3040141419", children: [
51
- /* @__PURE__ */ t.jsx(b, { width: 16, height: 16, type: a, className: o(S, "kakadu-components-1562914001", h && "kakadu-components-2360250719") }),
52
- a === e ? null : /* @__PURE__ */ t.jsx(b, { width: 16, height: 16, type: e, className: o(S, "kakadu-components-1224061930", h && "kakadu-components-2519520784") })
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__ */ t.jsx(G, { isLoading: f, size: 14 }),
55
- /* @__PURE__ */ t.jsx(J, { id: k, label: m, position: w }),
56
- l ? null : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
57
- /* @__PURE__ */ t.jsx(K, { size: 50 }),
58
- /* @__PURE__ */ t.jsx(L, { size: 50, className: n === "default" ? P : void 0 })
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
- r ? /* @__PURE__ */ t.jsx("div", { className: "kakadu-components-3422055155", children: /* @__PURE__ */ t.jsx(Q, { width: "100%", height: "100%", isAnimated: I }) }) : null
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
- X as IconButtonVariant,
66
- ce as default
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 LabelMessageType = Error | ReactNode | string;
5
- type LabelMessageProperties<Key extends string> = ({
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]: LabelMessageType;
11
+ readonly [Property in Key]: InputLabelMessageType;
11
12
  } & {
12
13
  readonly [Property in `${Key}Id`]: string;
13
14
  });
14
- type LabelProperties = HTMLProps<HTMLLabelElement> & LabelMessageProperties<'error'> & LabelMessageProperties<'warning'> & LabelMessageProperties<'information'> & {
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
- type ControllerProperties = Omit<LabelProperties, 'errorId' | 'warningId' | 'attachments'>;
20
- export type SelectOption<Type extends string = string> = {
21
- readonly value: Type;
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<ControllerProperties & HTMLProps<InputType>, 'onChange'> & {
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"),l=require("@kuma-ui/core"),xe=require("../icons/chevron-up.js"),J=require("../icons/icon.js"),K=require("../utilities/copy-to-clipboard.js"),H=require("../theme.js"),de=require("../icons/sparkle.js"),pe=require("./button-tooltip.js"),L=require("./text-button.js"),g=require("./text.js"),me=require("./collapsible.js"),Q=require("./click-ripples.js"),X=require("./hover-gradient.js"),je=require("./notification.js"),ke=require("./notice.js"),fe="kakadu-components-922159086",he="kakadu-components-25448712",w="kakadu-components-1923392328",A="kakadu-components-4056037255",Y=l.cx(A,"kakadu-components-3245407458"),Ee=l.cx(A,"kakadu-components-1117160492"),Re=l.cx(A,"kakadu-components-2261792866");function be({as:f,className:i,...d}){return e.jsxRuntimeExports.jsx(g.Span,{as:f??"span",...d,className:l.cx("kakadu-components-520991867",i)})}function Z({label:f,error:i,errorId:d,warning:u,warningId:R,information:h,informationId:s,footnote:c,attachments:E,className:p,children:v,...m}){const j=!!i,r=!!u,k=!!h,b=!!c;return e.jsxRuntimeExports.jsx("label",{...m,className:l.cx(fe,p),children:e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-3146929190",children:[e.jsxRuntimeExports.jsx(g.Span,{className:l.cx(H.overflowProtectionStyles,he),children:e.jsxRuntimeExports.jsx("span",{children:f})}),e.jsxRuntimeExports.jsxs("span",{className:"kakadu-components-3298764637",children:[v,b?e.jsxRuntimeExports.jsx(be,{className:"kakadu-components-613632806",children:c}):null,E]}),j||r||k?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-2927674627",children:j?e.jsxRuntimeExports.jsx(g.Paragraph,{id:d,className:Y,children:i instanceof Error?i.message:i}):r?e.jsxRuntimeExports.jsx(g.Paragraph,{id:R,className:Ee,children:u instanceof Error?u.message:u}):k?e.jsxRuntimeExports.jsx(g.Paragraph,{id:s,className:Re,children:h instanceof Error?h.message:h}):null}):null]})})}function ye({label:f,options:i,error:d,warning:u,information:R,footnote:h,className:s,onChange:c,...E}){const p=t.useId(),v=`${p}-error`,m=`${p}-warning`,j=`${p}-information`,r=!!d,k=!r&&!!u,b=!r&&!k&&!!R,N=r?v:k?m:b?j:void 0,{value:y}=E,[S,I]=t.useState(""),q=y??S;t.useEffect(()=>{I(typeof y=="string"?y:"")},[y]);const C=t.useCallback(n=>{const{value:B}=n.target;I(B),c==null||c(B,n)},[c]);return e.jsxRuntimeExports.jsxs(Z,{label:f,error:d,errorId:v,warning:u,warningId:m,information:R,informationId:j,footnote:h,children:[e.jsxRuntimeExports.jsx("select",{...E,value:q,"aria-invalid":r,"data-warning":k,"data-information":b,"aria-describedby":N,className:l.cx(w,"kakadu-components-4228384787",s),onChange:C,children:i.map(n=>e.jsxRuntimeExports.jsx("option",{value:n.value,disabled:n.disabled,children:n.label},n.value))}),e.jsxRuntimeExports.jsx(xe.default,{width:14,height:14,className:"kakadu-components-158931186"})]})}const ve=40,V="kakadu-components-4233741488";function ge({type:f,label:i,error:d,warning:u,information:R,footnote:h,suggestion:s,actions:c=[],hasCopyButton:E,hasClearButton:p,isMultiline:v,onChange:m,className:j,...r}){const k=t.useRef(null),b=t.useRef(null),N=t.useRef(null),y=je.useCreateNotification(),S=t.useId(),I=`${S}-error`,q=`${S}-warning`,C=`${S}-information`,{value:n,disabled:B}=r,[ee,F]=t.useState(""),x=n??ee,[te,se]=t.useState(),ne=f==="textarea"||!!v;t.useLayoutEffect(()=>{typeof x=="string"&&N.current&&se(N.current.scrollHeight)},[x]);const T=t.useMemo(()=>typeof x=="string"?`${x} `.split(`
2
- `):[],[x]),ae=t.useMemo(()=>T.length,[T]),_=!!d,$=!_&&!!u,M=!!R,O=_?I:$?q:M?C:void 0;t.useEffect(()=>{F(typeof n=="string"?n:"")},[n]);const W=t.useCallback(a=>{const{value:o}=a.target;F(o),m==null||m(o,a)},[m]),oe=t.useCallback(()=>{typeof x=="string"&&(K.default(x),y({type:ke.NoticeType.success,children:"Copied to clipboard."}))},[x,y]),P=t.useCallback(a=>{var D;const o=b.current??k.current??void 0;if(o){const G=(D=Object.getOwnPropertyDescriptor(o instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,"value"))==null?void 0:D.set;if(G){G.call(o,a);const ue=new Event("input",{bubbles:!0});o.dispatchEvent(ue),o.focus();return}}throw new Error("Unable to set value.")},[]),ce=t.useCallback(()=>{P("")},[P]),[re,le]=t.useState(""),U=!!s&&re!==s,ie=t.useCallback(()=>{if(s){try{P(s)}catch{K.default(s)}le(s)}},[s,P]),z=t.useMemo(()=>c.length,[c]);return e.jsxRuntimeExports.jsxs(Z,{label:i,error:d,errorId:I,warning:u,warningId:q,information:R,informationId:C,footnote:h,attachments:e.jsxRuntimeExports.jsx(me.default,{isCollapsed:!U,children:U?e.jsxRuntimeExports.jsxs("button",{type:"button",className:l.cx(H.buttonResetStyles,H.overflowProtectionStyles,"kakadu-components-2355856341"),onClick:ie,children:[e.jsxRuntimeExports.jsx(pe.default,{label:"Apply suggestion"}),e.jsxRuntimeExports.jsx(de.default,{width:13,height:13,className:"kakadu-components-1021263934"}),e.jsxRuntimeExports.jsx(g.Span,{className:"kakadu-components-1585874956",children:s}),e.jsxRuntimeExports.jsx(Q.default,{className:"kakadu-components-3448565402"}),e.jsxRuntimeExports.jsx(X.default,{})]}):null}),style:{"--button-padding":`calc(${ve*((E?1:0)+(p?1:0)+z)}px + 6px)`},children:[e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-3146929190",children:[ne?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{ref:N,"aria-hidden":!0,className:l.cx(w,j,"kakadu-components-2033521835"),children:[T.map((a,o)=>e.jsxRuntimeExports.jsxs("span",{children:[a,ae>1?e.jsxRuntimeExports.jsx("br",{}):null]},o))," "]}),e.jsxRuntimeExports.jsx("textarea",{...r,ref:b,rows:1,"aria-invalid":_,"data-warning":$,"data-information":M,"aria-describedby":O,value:x,className:l.cx(w,j,"kakadu-components-2119524139"),style:{minHeight:te},onChange:W})]}):e.jsxRuntimeExports.jsx("input",{...r,ref:k,type:f??"text",value:x,"aria-invalid":_,"data-warning":$,"data-information":M,"aria-describedby":O,className:l.cx(w,j),onChange:W}),B?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"})]})]}),E||p||z>0?e.jsxRuntimeExports.jsxs("div",{className:"kakadu-components-131986363",children:[c.map((a,o)=>e.jsxRuntimeExports.jsx(L.default,{iconLeft:a.icon,label:a.label,tooltip:a.label,className:V,onClick:a.onClick},a.label+o)),E?e.jsxRuntimeExports.jsx(L.default,{iconLeft:J.IconType.copy,label:"Copy",tooltip:"Copy",className:V,onClick:oe}):null,p?e.jsxRuntimeExports.jsx(L.default,{iconLeft:J.IconType.times,label:"Clear",tooltip:"Clear",className:V,onClick:ce}):null]}):null]})}exports.Select=ye;exports.default=ge;exports.errorParagraph=Y;
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;