@kakadu/components 6.1.1 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/aria-text.d.ts +2 -1
- package/build/components/box.d.ts +2 -1
- package/build/components/button-tooltip.d.ts +2 -1
- package/build/components/button.d.ts +3 -3
- package/build/components/button.js +1 -1
- package/build/components/button.mjs +27 -25
- package/build/components/card.d.ts +2 -2
- package/build/components/click-ripples.d.ts +2 -2
- package/build/components/click-ripples.js +1 -1
- package/build/components/click-ripples.mjs +50 -45
- package/build/components/collapsible.d.ts +2 -2
- package/build/components/combobox.d.ts +2 -2
- package/build/components/combobox.js +1 -1
- package/build/components/combobox.mjs +161 -159
- package/build/components/copy-icon-button.d.ts +2 -1
- package/build/components/datum.d.ts +2 -2
- package/build/components/dot.d.ts +2 -2
- package/build/components/flex.d.ts +2 -1
- package/build/components/footer.d.ts +2 -2
- package/build/components/gauge.d.ts +2 -1
- package/build/components/header.d.ts +2 -1
- package/build/components/hover-gradient.d.ts +2 -2
- package/build/components/hover-gradient.js +1 -1
- package/build/components/hover-gradient.mjs +48 -35
- package/build/components/icon-button.d.ts +2 -2
- package/build/components/input.d.ts +3 -3
- package/build/components/input.js +2 -2
- package/build/components/input.mjs +21 -21
- package/build/components/logos/akt-logo.d.ts +2 -2
- package/build/components/logos/amedia-logo.d.ts +2 -2
- package/build/components/logos/bankaxept-logo.d.ts +2 -2
- package/build/components/logos/bankid-logo.d.ts +2 -2
- package/build/components/logos/dnb-logo.d.ts +2 -2
- package/build/components/logos/entur-logo.d.ts +2 -2
- package/build/components/logos/gjensidige-logo.d.ts +2 -2
- package/build/components/logos/kakadu-academy-logo.d.ts +2 -2
- package/build/components/logos/kakadu-guide-icon.d.ts +2 -1
- package/build/components/logos/kakadu-guide-logo.d.ts +3 -3
- package/build/components/logos/kakadu-index-logo.d.ts +2 -2
- package/build/components/logos/kakadu-logo.d.ts +2 -2
- package/build/components/logos/kakadu-play-logo.d.ts +2 -2
- package/build/components/logos/kolumbus-logo.d.ts +2 -2
- package/build/components/logos/nordea-logo.d.ts +2 -2
- package/build/components/logos/norsk-tipping-logo.d.ts +2 -2
- package/build/components/logos/ruter-logo.d.ts +2 -2
- package/build/components/logos/senteret-for-et-aldersvennlig-norge-logo.d.ts +2 -2
- package/build/components/logos/sparebank1-logo.d.ts +2 -2
- package/build/components/logos/sparebanken-norge-logo.d.ts +2 -2
- package/build/components/logos/sto-logo.d.ts +2 -2
- package/build/components/logos/storebrand-logo.d.ts +2 -2
- package/build/components/modal.d.ts +6 -6
- package/build/components/modal.js +1 -1
- package/build/components/modal.mjs +86 -85
- package/build/components/moving-gradients.js +1 -1
- package/build/components/moving-gradients.mjs +80 -70
- package/build/components/moving-stars.js +1 -1
- package/build/components/moving-stars.mjs +77 -74
- package/build/components/notice.d.ts +2 -2
- package/build/components/notification.d.ts +8 -6
- package/build/components/notification.js +1 -1
- package/build/components/notification.mjs +87 -71
- package/build/components/popover-menu.d.ts +3 -3
- package/build/components/popover-menu.js +1 -1
- package/build/components/popover-menu.mjs +131 -129
- package/build/components/popover.d.ts +4 -4
- package/build/components/popover.js +1 -1
- package/build/components/popover.mjs +82 -73
- package/build/components/revealer.d.ts +2 -2
- package/build/components/select.d.ts +2 -2
- package/build/components/separator.d.ts +5 -5
- package/build/components/skeleton.d.ts +3 -2
- package/build/components/spinner.d.ts +3 -2
- package/build/components/text-button.d.ts +2 -2
- package/build/components/text.d.ts +9 -8
- package/build/components/theme-setter.d.ts +2 -2
- package/build/components/veil.d.ts +2 -1
- package/build/components/wrapper.d.ts +2 -2
- package/build/components.css +1 -1
- package/build/hooks/use-is-document-focused.js +1 -1
- package/build/hooks/use-is-document-focused.mjs +30 -14
- package/build/icons/anchor-down.d.ts +2 -2
- package/build/icons/anchor-up.d.ts +2 -2
- package/build/icons/arrow-down.d.ts +2 -2
- package/build/icons/arrow-left.d.ts +2 -2
- package/build/icons/arrow-right.d.ts +2 -2
- package/build/icons/arrow-up.d.ts +2 -2
- package/build/icons/caret-down.d.ts +2 -2
- package/build/icons/caret-left.d.ts +2 -2
- package/build/icons/caret-right.d.ts +2 -2
- package/build/icons/caret-up.d.ts +2 -2
- package/build/icons/check.d.ts +2 -2
- package/build/icons/chevron-down.d.ts +2 -2
- package/build/icons/chevron-left.d.ts +2 -2
- package/build/icons/chevron-right.d.ts +2 -2
- package/build/icons/chevron-up.d.ts +2 -2
- package/build/icons/chrome-browser-logo.d.ts +2 -2
- package/build/icons/cog.d.ts +2 -2
- package/build/icons/copy.d.ts +2 -2
- package/build/icons/document.d.ts +2 -2
- package/build/icons/dots.d.ts +2 -2
- package/build/icons/drag.d.ts +2 -2
- package/build/icons/edge-browser-logo.d.ts +2 -2
- package/build/icons/edit.d.ts +2 -2
- package/build/icons/exclamation-triangle.d.ts +2 -2
- package/build/icons/external.d.ts +2 -2
- package/build/icons/eye.d.ts +2 -2
- package/build/icons/icon.d.ts +2 -2
- package/build/icons/information.d.ts +2 -2
- package/build/icons/kakadu-guide-glyph.d.ts +2 -2
- package/build/icons/kakadu-guide-icon.d.ts +2 -2
- package/build/icons/menu.d.ts +2 -2
- package/build/icons/package.d.ts +2 -2
- package/build/icons/plus.d.ts +2 -2
- package/build/icons/select.d.ts +2 -2
- package/build/icons/share.d.ts +2 -2
- package/build/icons/sparkle.d.ts +2 -2
- package/build/icons/test.d.ts +2 -2
- package/build/icons/times.d.ts +2 -2
- package/build/icons/trash.d.ts +2 -2
- package/build/icons/trend-up.d.ts +2 -2
- package/build/index.d.ts +2 -0
- package/build/index.js +1 -1
- package/build/index.mjs +19 -17
- package/build/theme.d.ts +2 -1
- package/build/utilities/listeners.d.ts +5 -0
- package/build/utilities/listeners.js +1 -0
- package/build/utilities/listeners.mjs +16 -0
- package/package.json +16 -22
|
@@ -1,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;
|
|
@@ -26,9 +26,9 @@ function we({
|
|
|
26
26
|
warning: c,
|
|
27
27
|
warningId: x,
|
|
28
28
|
information: r,
|
|
29
|
-
informationId:
|
|
29
|
+
informationId: C,
|
|
30
30
|
footnote: a,
|
|
31
|
-
attachments:
|
|
31
|
+
attachments: S,
|
|
32
32
|
className: p,
|
|
33
33
|
children: u,
|
|
34
34
|
...k
|
|
@@ -39,9 +39,9 @@ function we({
|
|
|
39
39
|
/* @__PURE__ */ e.jsxs("span", { className: "kakadu-components-3298764637", children: [
|
|
40
40
|
u,
|
|
41
41
|
f ? /* @__PURE__ */ e.jsx(Be, { className: "kakadu-components-613632806", children: a }) : null,
|
|
42
|
-
|
|
42
|
+
S
|
|
43
43
|
] }),
|
|
44
|
-
j || i || b ? /* @__PURE__ */ e.jsx("div", { className: "kakadu-components-2927674627", children: j ? /* @__PURE__ */ e.jsx(M, { id: m, className: Se, children: l instanceof Error ? l.message : l }) : i ? /* @__PURE__ */ e.jsx(M, { id: x, className: Ee, children: c instanceof Error ? c.message : c }) : b ? /* @__PURE__ */ e.jsx(M, { id:
|
|
44
|
+
j || i || b ? /* @__PURE__ */ e.jsx("div", { className: "kakadu-components-2927674627", children: j ? /* @__PURE__ */ e.jsx(M, { id: m, className: Se, children: l instanceof Error ? l.message : l }) : i ? /* @__PURE__ */ e.jsx(M, { id: x, className: Ee, children: c instanceof Error ? c.message : c }) : b ? /* @__PURE__ */ e.jsx(M, { id: C, className: Ie, children: r instanceof Error ? r.message : r }) : null }) : null
|
|
45
45
|
] }) });
|
|
46
46
|
}
|
|
47
47
|
const Le = 40, A = "kakadu-components-4233741488";
|
|
@@ -52,9 +52,9 @@ function Ge({
|
|
|
52
52
|
error: c,
|
|
53
53
|
warning: x,
|
|
54
54
|
information: r,
|
|
55
|
-
footnote:
|
|
55
|
+
footnote: C,
|
|
56
56
|
suggestion: a,
|
|
57
|
-
attachments:
|
|
57
|
+
attachments: S,
|
|
58
58
|
actions: p = [],
|
|
59
59
|
hasCopyButton: u,
|
|
60
60
|
hasClearButton: k,
|
|
@@ -62,20 +62,20 @@ function Ge({
|
|
|
62
62
|
onChange: i,
|
|
63
63
|
children: b,
|
|
64
64
|
className: f,
|
|
65
|
-
...
|
|
65
|
+
...y
|
|
66
66
|
}) {
|
|
67
67
|
const O = P(null), W = P(null), E = P(null), z = Ne(), I = fe(), D = `${I}-error`, G = `${I}-warning`, U = `${I}-information`, {
|
|
68
|
-
value:
|
|
68
|
+
value: g,
|
|
69
69
|
disabled: ae
|
|
70
|
-
} =
|
|
70
|
+
} = y, [se, q] = T(""), s = g ?? se, [oe, le] = T(), ce = l === "textarea" || !!j;
|
|
71
71
|
he(() => {
|
|
72
72
|
typeof s == "string" && E.current && le(E.current.scrollHeight);
|
|
73
73
|
}, [s]);
|
|
74
74
|
const B = H(() => typeof s == "string" ? `${s} `.split(`
|
|
75
|
-
`) : [], [s]), re = H(() => B.length, [B]),
|
|
75
|
+
`) : [], [s]), re = H(() => B.length, [B]), N = !!c, w = !N && !!x, L = !!r, J = N ? D : w ? G : L ? U : void 0;
|
|
76
76
|
xe(() => {
|
|
77
|
-
q(typeof
|
|
78
|
-
}, [
|
|
77
|
+
q(typeof g == "string" ? g : "");
|
|
78
|
+
}, [g]);
|
|
79
79
|
const K = h((n) => {
|
|
80
80
|
const {
|
|
81
81
|
value: t
|
|
@@ -86,7 +86,7 @@ function Ge({
|
|
|
86
86
|
type: "success",
|
|
87
87
|
children: "Copied to clipboard."
|
|
88
88
|
}));
|
|
89
|
-
}, [s, z]),
|
|
89
|
+
}, [s, z]), v = h((n) => {
|
|
90
90
|
var Y;
|
|
91
91
|
const t = W.current ?? O.current ?? void 0;
|
|
92
92
|
if (t) {
|
|
@@ -102,18 +102,18 @@ function Ge({
|
|
|
102
102
|
}
|
|
103
103
|
throw new Error("Unable to set value.");
|
|
104
104
|
}, []), de = h(() => {
|
|
105
|
-
|
|
106
|
-
}, [
|
|
105
|
+
v("");
|
|
106
|
+
}, [v]), [me, pe] = T(""), Q = !!a && me !== a, ue = h(() => {
|
|
107
107
|
if (a) {
|
|
108
108
|
try {
|
|
109
|
-
|
|
109
|
+
v(a);
|
|
110
110
|
} catch {
|
|
111
111
|
_(a);
|
|
112
112
|
}
|
|
113
113
|
pe(a);
|
|
114
114
|
}
|
|
115
|
-
}, [a,
|
|
116
|
-
return /* @__PURE__ */ e.jsxs(we, { ref: d, label: m, error: c, errorId: D, warning: x, warningId: G, information: r, informationId: U, footnote:
|
|
115
|
+
}, [a, v]), X = H(() => p.length, [p]);
|
|
116
|
+
return /* @__PURE__ */ e.jsxs(we, { ref: d, label: m, error: c, errorId: D, warning: x, warningId: G, information: r, informationId: U, footnote: C, attachments: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
117
117
|
/* @__PURE__ */ e.jsx(ge, { isCollapsed: !Q, children: Q ? /* @__PURE__ */ e.jsxs("button", { type: "button", className: o(je, te, "kakadu-components-4141839293"), onClick: ue, children: [
|
|
118
118
|
/* @__PURE__ */ e.jsx(ye, { label: "Apply suggestion" }),
|
|
119
119
|
/* @__PURE__ */ e.jsx(be, { width: 13, height: 13, className: "kakadu-components-1417828741" }),
|
|
@@ -121,7 +121,7 @@ function Ge({
|
|
|
121
121
|
/* @__PURE__ */ e.jsx(ee, { className: "kakadu-components-2744733744" }),
|
|
122
122
|
/* @__PURE__ */ e.jsx(ne, {})
|
|
123
123
|
] }) : null }),
|
|
124
|
-
|
|
124
|
+
S
|
|
125
125
|
] }), style: {
|
|
126
126
|
"--button-padding": `calc(${Le * ((u ? 1 : 0) + (k ? 1 : 0) + X)}px + 6px)`
|
|
127
127
|
}, children: [
|
|
@@ -137,10 +137,10 @@ function Ge({
|
|
|
137
137
|
)),
|
|
138
138
|
" "
|
|
139
139
|
] }),
|
|
140
|
-
/* @__PURE__ */ e.jsx("textarea", { ...
|
|
140
|
+
/* @__PURE__ */ e.jsx("textarea", { ...y, ref: W, rows: y.rows ?? 1, "aria-invalid": N, "data-warning": w, "data-information": L, "aria-describedby": J, value: s, className: o($, f, "kakadu-components-2119524139"), style: {
|
|
141
141
|
minHeight: oe
|
|
142
142
|
}, onChange: K })
|
|
143
|
-
] }) : /* @__PURE__ */ e.jsx("input", { ...
|
|
143
|
+
] }) : /* @__PURE__ */ e.jsx("input", { ...y, ref: O, type: l ?? "text", value: s, "aria-invalid": N, "data-warning": w, "data-information": L, "aria-describedby": J, className: o($, f), onChange: K }),
|
|
144
144
|
ae ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
145
145
|
/* @__PURE__ */ e.jsx(ee, { className: "kakadu-components-616311160" }),
|
|
146
146
|
/* @__PURE__ */ e.jsx(ne, { className: "kakadu-components-1962999040" })
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function AktLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function AktLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function AmediaLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function AmediaLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function BankAxeptLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function BankAxeptLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function BankIdLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function BankIdLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function DnbLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function DnbLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function EnturLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function EnturLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function GjensidigeLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function GjensidigeLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function KakaduAcademyLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function KakaduAcademyLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export declare function KakaduGuideLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export declare function KakaduGuideLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
3
3
|
export declare const kakaduGuideLogoVariants: readonly ["default", "flat"];
|
|
4
4
|
export type KakaduGuideLogoVariant = (typeof kakaduGuideLogoVariants)[number];
|
|
5
5
|
export default function KakaduGuideLogo({ variant, height, }: {
|
|
6
6
|
readonly variant?: KakaduGuideLogoVariant;
|
|
7
7
|
readonly height?: number;
|
|
8
|
-
}):
|
|
8
|
+
}): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function KakaduIndexLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function KakaduIndexLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function KakaduLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function KakaduLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function KakaduPlayLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function KakaduPlayLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function KolumbusLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function KolumbusLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function NordeaLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function NordeaLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function NorskTippingLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function NorskTippingLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function RuterLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function RuterLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function SenteretForEtAldersvennligNorgeLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function SenteretForEtAldersvennligNorgeLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function Sparebank1LogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function Sparebank1LogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function SparebankenNorgeLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function SparebankenNorgeLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function StoLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function StoLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function StorebrandLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function StorebrandLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentType, type ReactNode } from 'react';
|
|
1
|
+
import React, { type ComponentType, type ReactNode } from 'react';
|
|
2
2
|
import { type DecoratorType } from './decorators';
|
|
3
3
|
import { type FlexProperties } from './flex';
|
|
4
4
|
import { type AtomProperties, type AtomElementType, type DefaultAtomElementType } from './atom';
|
|
@@ -11,9 +11,9 @@ type ModalProviderProperties<Data = any> = {
|
|
|
11
11
|
close?: (data?: Data) => void;
|
|
12
12
|
};
|
|
13
13
|
export declare function useModalContext<Data = any>(): ModalProviderProperties<Data>;
|
|
14
|
-
export declare function ModalContent<Type extends AtomElementType = DefaultAtomElementType>(properties: FlexProperties<Type>):
|
|
15
|
-
export declare function ModalHeading<Type extends AtomElementType = DefaultHeadingElementType>({ as, className, ...properties }: AtomProperties<Type>):
|
|
16
|
-
export declare function ModalActions<Type extends AtomElementType = DefaultAtomElementType>({ as, ...properties }: FlexProperties<Type>):
|
|
14
|
+
export declare function ModalContent<Type extends AtomElementType = DefaultAtomElementType>(properties: FlexProperties<Type>): React.JSX.Element;
|
|
15
|
+
export declare function ModalHeading<Type extends AtomElementType = DefaultHeadingElementType>({ as, className, ...properties }: AtomProperties<Type>): React.JSX.Element;
|
|
16
|
+
export declare function ModalActions<Type extends AtomElementType = DefaultAtomElementType>({ as, ...properties }: FlexProperties<Type>): React.JSX.Element;
|
|
17
17
|
export type ModalProperties<Data = any> = {
|
|
18
18
|
readonly root?: HTMLElement | ShadowRoot;
|
|
19
19
|
readonly outerDecorators?: DecoratorType[];
|
|
@@ -30,11 +30,11 @@ export type ModalProperties<Data = any> = {
|
|
|
30
30
|
readonly children?: ReactNode;
|
|
31
31
|
};
|
|
32
32
|
type ModalBaseProperties<ModalResult> = Omit<ModalProperties<ModalResult>, 'isVisible' | 'onClose'>;
|
|
33
|
-
export default function Modal<Data = any>({ root, outerDecorators, innerDecorators, label, maxWidth, className, isVisible, isFullWidth, shouldCloseOnOutsideClick, shouldCloseOnEscapePress, showCloseButton, onClose, children, }: ModalProperties<Data>):
|
|
33
|
+
export default function Modal<Data = any>({ root, outerDecorators, innerDecorators, label, maxWidth, className, isVisible, isFullWidth, shouldCloseOnOutsideClick, shouldCloseOnEscapePress, showCloseButton, onClose, children, }: ModalProperties<Data>): React.JSX.Element | null;
|
|
34
34
|
export declare function useModal<ModalResult, ModalProperties = ModalBaseProperties<ModalResult>>(ModalComponent: ComponentType<ModalProperties>, properties?: ModalProperties): {
|
|
35
35
|
isVisible: boolean;
|
|
36
36
|
show: () => Promise<ModalResult | undefined>;
|
|
37
37
|
close: (result?: ModalResult) => void;
|
|
38
|
-
modal:
|
|
38
|
+
modal: React.JSX.Element | null;
|
|
39
39
|
};
|
|
40
40
|
export {};
|
|
@@ -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 o=require("../jsx-runtime-BB_1_6y_.js"),e=require("react"),E=require("@kuma-ui/core"),P=require("react-dom"),$=require("../focus-trap-react-B7f3iC5h.js"),B=require("../utilities/listeners.js"),D=require("./text-button.js"),T=require("./decorators.js"),_=require("./flex.js"),K=require("./atom.js"),y=require("./text.js"),z=B.default(s=>{window.addEventListener("keydown",s)},s=>{window.removeEventListener("keydown",s)}),S=e.createContext({isVisible:!1,isInteractive:!1}),{Provider:G}=S;function L(){return e.useContext(S)}function J(){const{isInteractive:s,close:r}=L(),a=e.useCallback(()=>{r==null||r()},[r]);return o.jsxRuntimeExports.jsx("div",{className:"kakadu-components-2566044647",children:o.jsxRuntimeExports.jsx(D.default,{iconLeft:"times",label:"Close",disabled:!s,onClick:a})})}function Q(s){return o.jsxRuntimeExports.jsx(_.default,{gap:2,...s})}function U({as:s,className:r,...a}){return o.jsxRuntimeExports.jsx(y.Heading,{...a,as:s??y.defaultHeadingElementType,className:E.cx("kakadu-components-4275938488",r)})}function V({as:s,...r}){return o.jsxRuntimeExports.jsx(_.default,{direction:"row",gap:1,preset:"end",...r,as:s??K.defaultAtomElementType})}function X({root:s,outerDecorators:r=[],innerDecorators:a=[],label:k,maxWidth:c,className:f,isVisible:n,isFullWidth:i=!1,shouldCloseOnOutsideClick:x=!0,shouldCloseOnEscapePress:m=!0,showCloseButton:v=!0,onClose:l,children:d}){const R=e.useRef(null),p=e.useRef(null),[q,N]=e.useState(!1),[u,j]=e.useState(!1),w=e.useCallback(t=>{R.current=t,j(!1)},[]),M=e.useRef(null),g=e.useCallback(t=>{t&&(M.current=t)},[]),[b,h]=e.useState(n??!1),A=e.useMemo(()=>({isVisible:b,isInteractive:u,setInitialFocus:g,close:w}),[b,u,g,w]);e.useEffect(()=>{if(n){const t=setTimeout(()=>{j(!0)},100);return()=>{clearTimeout(t)}}j(!1)},[n]),e.useEffect(()=>{n&&(N(!0),h(!0))},[n]),e.useEffect(()=>{const t=p.current;if(n&&x&&t){const I=H=>{t===H.target&&j(!1)};return t.addEventListener("click",I),()=>{t.removeEventListener("click",I)}}},[n,x]),e.useEffect(()=>{if(!(!n||!m))return z(t=>{t.key==="Escape"&&j(!1)})},[n,m]),e.useEffect(()=>{if(q&&!u){const t=setTimeout(()=>{h(!1),l==null||l(R.current??void 0)},370);return()=>{clearTimeout(t)}}},[q,u,l]);const F=e.useMemo(()=>({initialFocus:()=>M.current??void 0,onActivate:()=>{var t;return(t=M.current)==null?void 0:t.focus()}}),[]);if(!b)return null;const C=o.jsxRuntimeExports.jsx(T.default,{decorators:r,children:o.jsxRuntimeExports.jsx("div",{"aria-hidden":!u,style:{"--max-width":c?`${c}px`:void 0},className:E.cx("kakadu-components-4119461136",u&&"kakadu-components-2522346797",f),children:o.jsxRuntimeExports.jsx(T.default,{decorators:a,children:o.jsxRuntimeExports.jsx($.focusTrapReactExports.FocusTrap,{active:u,focusTrapOptions:F,children:o.jsxRuntimeExports.jsx("div",{ref:p,className:"kakadu-components-4011815997",children:o.jsxRuntimeExports.jsx("div",{role:"dialog","aria-modal":"true","aria-label":k??"Modal",className:E.cx("kakadu-components-3324483532",i&&"kakadu-components-3799971070",u&&"kakadu-components-968755580"),children:o.jsxRuntimeExports.jsxs(G,{value:A,children:[v?o.jsxRuntimeExports.jsx(J,{}):null,o.jsxRuntimeExports.jsx("div",{className:E.cx("kakadu-components-633990035",i&&"kakadu-components-171969824"),children:d})]})})})})})})});return s?P.createPortal(C,s):C}function Y(s,r){const[a,k]=e.useState(!1),[c,f]=e.useState(!1),n=e.useRef(void 0),i=e.useRef(void 0),x=e.useCallback(async()=>(i.current=void 0,k(!0),f(!0),new Promise(d=>{n.current=d})),[]),m=e.useCallback(d=>{i.current=d,f(!1)},[]),v=e.useCallback(d=>{var p;const R=d??i.current;i.current=void 0,(p=n.current)==null||p.call(n,R),n.current=void 0,k(!1),f(!1)},[]),l=e.useMemo(()=>a?o.jsxRuntimeExports.jsx(s,{...r,isVisible:c,onClose:v}):null,[a,s,r,c,v]);return e.useMemo(()=>({isVisible:c,show:x,close:m,modal:l}),[c,x,m,l])}exports.ModalActions=V;exports.ModalContent=Q;exports.ModalHeading=U;exports.default=X;exports.useModal=Y;exports.useModalContext=L;
|
|
@@ -1,55 +1,60 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { cx as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { f as
|
|
6
|
-
import
|
|
1
|
+
import { j as o } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
+
import { createContext as $, useRef as j, useState as w, useCallback as d, useMemo as E, useEffect as v, useContext as q } from "react";
|
|
3
|
+
import { cx as T } from "@kuma-ui/core";
|
|
4
|
+
import { createPortal as z } from "react-dom";
|
|
5
|
+
import { f as G } from "../focus-trap-react-Dr3BYLw6.mjs";
|
|
6
|
+
import J from "../utilities/listeners.mjs";
|
|
7
|
+
import Q from "./text-button.mjs";
|
|
7
8
|
import A from "./decorators.mjs";
|
|
8
9
|
import H from "./flex.mjs";
|
|
9
|
-
import { defaultAtomElementType as
|
|
10
|
-
import { Heading as
|
|
11
|
-
const
|
|
10
|
+
import { defaultAtomElementType as U } from "./atom.mjs";
|
|
11
|
+
import { Heading as V, defaultHeadingElementType as X } from "./text.mjs";
|
|
12
|
+
const Y = J((t) => {
|
|
13
|
+
window.addEventListener("keydown", t);
|
|
14
|
+
}, (t) => {
|
|
15
|
+
window.removeEventListener("keydown", t);
|
|
16
|
+
}), B = $({
|
|
12
17
|
isVisible: !1,
|
|
13
18
|
isInteractive: !1
|
|
14
19
|
}), {
|
|
15
|
-
Provider:
|
|
20
|
+
Provider: Z
|
|
16
21
|
} = B;
|
|
17
|
-
function
|
|
18
|
-
return
|
|
22
|
+
function _() {
|
|
23
|
+
return q(B);
|
|
19
24
|
}
|
|
20
|
-
function
|
|
25
|
+
function W() {
|
|
21
26
|
const {
|
|
22
|
-
isInteractive:
|
|
23
|
-
close:
|
|
24
|
-
} =
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
isInteractive: t,
|
|
28
|
+
close: r
|
|
29
|
+
} = _(), s = d(() => {
|
|
30
|
+
r == null || r();
|
|
31
|
+
}, [r]);
|
|
32
|
+
return /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-2566044647", children: /* @__PURE__ */ o.jsx(Q, { iconLeft: "times", label: "Close", disabled: !t, onClick: s }) });
|
|
28
33
|
}
|
|
29
|
-
function
|
|
30
|
-
return /* @__PURE__ */
|
|
34
|
+
function le(t) {
|
|
35
|
+
return /* @__PURE__ */ o.jsx(H, { gap: 2, ...t });
|
|
31
36
|
}
|
|
32
|
-
function
|
|
33
|
-
as:
|
|
34
|
-
className:
|
|
35
|
-
...
|
|
37
|
+
function de({
|
|
38
|
+
as: t,
|
|
39
|
+
className: r,
|
|
40
|
+
...s
|
|
36
41
|
}) {
|
|
37
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ o.jsx(V, { ...s, as: t ?? X, className: T("kakadu-components-4275938488", r) });
|
|
38
43
|
}
|
|
39
|
-
function
|
|
40
|
-
as:
|
|
41
|
-
...
|
|
44
|
+
function fe({
|
|
45
|
+
as: t,
|
|
46
|
+
...r
|
|
42
47
|
}) {
|
|
43
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ o.jsx(H, { direction: "row", gap: 1, preset: "end", ...r, as: t ?? U });
|
|
44
49
|
}
|
|
45
|
-
function
|
|
46
|
-
root:
|
|
47
|
-
outerDecorators:
|
|
48
|
-
innerDecorators:
|
|
49
|
-
label:
|
|
50
|
+
function me({
|
|
51
|
+
root: t,
|
|
52
|
+
outerDecorators: r = [],
|
|
53
|
+
innerDecorators: s = [],
|
|
54
|
+
label: h,
|
|
50
55
|
maxWidth: c,
|
|
51
56
|
className: f,
|
|
52
|
-
isVisible:
|
|
57
|
+
isVisible: n,
|
|
53
58
|
isFullWidth: i = !1,
|
|
54
59
|
shouldCloseOnOutsideClick: m = !0,
|
|
55
60
|
shouldCloseOnEscapePress: p = !0,
|
|
@@ -57,18 +62,18 @@ function le({
|
|
|
57
62
|
onClose: u,
|
|
58
63
|
children: l
|
|
59
64
|
}) {
|
|
60
|
-
const M = j(null), x = j(null), [
|
|
65
|
+
const M = j(null), x = j(null), [R, P] = w(!1), [a, k] = w(!1), L = d((e) => {
|
|
61
66
|
M.current = e, k(!1);
|
|
62
|
-
}, []),
|
|
63
|
-
e && (
|
|
64
|
-
}, []), [y,
|
|
67
|
+
}, []), g = j(null), N = d((e) => {
|
|
68
|
+
e && (g.current = e);
|
|
69
|
+
}, []), [y, b] = w(n ?? !1), D = E(() => ({
|
|
65
70
|
isVisible: y,
|
|
66
71
|
isInteractive: a,
|
|
67
|
-
setInitialFocus:
|
|
68
|
-
close:
|
|
69
|
-
}), [y, a,
|
|
72
|
+
setInitialFocus: N,
|
|
73
|
+
close: L
|
|
74
|
+
}), [y, a, N, L]);
|
|
70
75
|
v(() => {
|
|
71
|
-
if (
|
|
76
|
+
if (n) {
|
|
72
77
|
const e = setTimeout(() => {
|
|
73
78
|
k(!0);
|
|
74
79
|
}, 100);
|
|
@@ -77,65 +82,61 @@ function le({
|
|
|
77
82
|
};
|
|
78
83
|
}
|
|
79
84
|
k(!1);
|
|
80
|
-
}, [
|
|
81
|
-
|
|
82
|
-
}, [
|
|
85
|
+
}, [n]), v(() => {
|
|
86
|
+
n && (P(!0), b(!0));
|
|
87
|
+
}, [n]), v(() => {
|
|
83
88
|
const e = x.current;
|
|
84
|
-
if (
|
|
85
|
-
const
|
|
86
|
-
e ===
|
|
89
|
+
if (n && m && e) {
|
|
90
|
+
const C = (S) => {
|
|
91
|
+
e === S.target && k(!1);
|
|
87
92
|
};
|
|
88
|
-
return e.addEventListener("click",
|
|
89
|
-
e.removeEventListener("click",
|
|
93
|
+
return e.addEventListener("click", C), () => {
|
|
94
|
+
e.removeEventListener("click", C);
|
|
90
95
|
};
|
|
91
96
|
}
|
|
92
|
-
}, [
|
|
93
|
-
if (!
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
window.removeEventListener("keydown", e);
|
|
100
|
-
};
|
|
101
|
-
}, [t, p]), v(() => {
|
|
102
|
-
if (L && !a) {
|
|
97
|
+
}, [n, m]), v(() => {
|
|
98
|
+
if (!(!n || !p))
|
|
99
|
+
return Y((e) => {
|
|
100
|
+
e.key === "Escape" && k(!1);
|
|
101
|
+
});
|
|
102
|
+
}, [n, p]), v(() => {
|
|
103
|
+
if (R && !a) {
|
|
103
104
|
const e = setTimeout(() => {
|
|
104
|
-
|
|
105
|
+
b(!1), u == null || u(M.current ?? void 0);
|
|
105
106
|
}, 370);
|
|
106
107
|
return () => {
|
|
107
108
|
clearTimeout(e);
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
|
-
}, [
|
|
111
|
-
const
|
|
112
|
-
initialFocus: () =>
|
|
111
|
+
}, [R, a, u]);
|
|
112
|
+
const K = E(() => ({
|
|
113
|
+
initialFocus: () => g.current ?? void 0,
|
|
113
114
|
onActivate: () => {
|
|
114
115
|
var e;
|
|
115
|
-
return (e =
|
|
116
|
+
return (e = g.current) == null ? void 0 : e.focus();
|
|
116
117
|
}
|
|
117
118
|
}), []);
|
|
118
119
|
if (!y)
|
|
119
120
|
return null;
|
|
120
|
-
const
|
|
121
|
+
const F = /* @__PURE__ */ o.jsx(A, { decorators: r, children: /* @__PURE__ */ o.jsx("div", { "aria-hidden": !a, style: {
|
|
121
122
|
"--max-width": c ? `${c}px` : void 0
|
|
122
|
-
}, className:
|
|
123
|
-
I ? /* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
123
|
+
}, className: T("kakadu-components-4119461136", a && "kakadu-components-2522346797", f), children: /* @__PURE__ */ o.jsx(A, { decorators: s, children: /* @__PURE__ */ o.jsx(G.FocusTrap, { active: a, focusTrapOptions: K, children: /* @__PURE__ */ o.jsx("div", { ref: x, className: "kakadu-components-4011815997", children: /* @__PURE__ */ o.jsx("div", { role: "dialog", "aria-modal": "true", "aria-label": h ?? "Modal", className: T("kakadu-components-3324483532", i && "kakadu-components-3799971070", a && "kakadu-components-968755580"), children: /* @__PURE__ */ o.jsxs(Z, { value: D, children: [
|
|
124
|
+
I ? /* @__PURE__ */ o.jsx(W, {}) : null,
|
|
125
|
+
/* @__PURE__ */ o.jsx("div", { className: T("kakadu-components-633990035", i && "kakadu-components-171969824"), children: l })
|
|
125
126
|
] }) }) }) }) }) }) });
|
|
126
|
-
return
|
|
127
|
+
return t ? z(F, t) : F;
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
-
const [
|
|
130
|
-
|
|
129
|
+
function pe(t, r) {
|
|
130
|
+
const [s, h] = w(!1), [c, f] = w(!1), n = j(void 0), i = j(void 0), m = d(async () => (i.current = void 0, h(!0), f(!0), new Promise((l) => {
|
|
131
|
+
n.current = l;
|
|
131
132
|
})), []), p = d((l) => {
|
|
132
133
|
i.current = l, f(!1);
|
|
133
134
|
}, []), I = d((l) => {
|
|
134
135
|
var x;
|
|
135
136
|
const M = l ?? i.current;
|
|
136
|
-
i.current = void 0, (x =
|
|
137
|
-
}, []), u =
|
|
138
|
-
return
|
|
137
|
+
i.current = void 0, (x = n.current) == null || x.call(n, M), n.current = void 0, h(!1), f(!1);
|
|
138
|
+
}, []), u = E(() => s ? /* @__PURE__ */ o.jsx(t, { ...r, isVisible: c, onClose: I }) : null, [s, t, r, c, I]);
|
|
139
|
+
return E(() => ({
|
|
139
140
|
isVisible: c,
|
|
140
141
|
show: m,
|
|
141
142
|
close: p,
|
|
@@ -143,10 +144,10 @@ function de(o, s) {
|
|
|
143
144
|
}), [c, m, p, u]);
|
|
144
145
|
}
|
|
145
146
|
export {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
fe as ModalActions,
|
|
148
|
+
le as ModalContent,
|
|
149
|
+
de as ModalHeading,
|
|
150
|
+
me as default,
|
|
151
|
+
pe as useModal,
|
|
152
|
+
_ as useModalContext
|
|
152
153
|
};
|