@kakadu/components 3.8.1 → 3.10.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/icon-button.js +1 -1
- package/build/components/icon-button.mjs +20 -20
- package/build/components/modal.d.ts +1 -1
- package/build/components/modal.js +1 -1
- package/build/components/modal.mjs +69 -70
- package/build/components/popover-menu.js +1 -1
- package/build/components/popover-menu.mjs +12 -12
- package/build/components/popover.js +1 -1
- package/build/components/skeleton.d.ts +4 -0
- package/build/components/skeleton.js +1 -1
- package/build/components/skeleton.mjs +33 -25
- package/build/components.css +1 -1
- package/build/hooks/use-fetch.d.ts +3 -0
- package/build/hooks/use-fetch.js +1 -1
- package/build/hooks/use-fetch.mjs +113 -90
- package/build/icons/drag.d.ts +2 -0
- package/build/icons/drag.js +1 -0
- package/build/icons/drag.mjs +28 -0
- package/build/icons/icon.d.ts +1 -0
- package/build/icons/icon.js +1 -1
- package/build/icons/icon.mjs +36 -34
- package/build/index.d.ts +2 -0
- package/build/index.js +1 -1
- package/build/index.mjs +135 -132
- package/package.json +1 -1
|
@@ -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
|
|
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,24 +1,24 @@
|
|
|
1
1
|
import { j as t } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useId as A, useState as j, useRef as y, useEffect as
|
|
2
|
+
import { useId as A, useState as j, useRef as y, useEffect as i, useCallback as C } from "react";
|
|
3
3
|
import { cx as o } 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
|
|
7
|
+
import { ButtonLoader as G, buttonSecondaryStyles as H, buttonSuccessStyles as O, buttonWarningStyles as W, buttonDangerStyles as q } from "./button.mjs";
|
|
8
8
|
import J from "./button-tooltip.mjs";
|
|
9
9
|
import K from "./click-ripples.mjs";
|
|
10
|
-
import L, { normalBlendStyles as
|
|
10
|
+
import L, { normalBlendStyles as P } from "./hover-gradient.mjs";
|
|
11
11
|
import { SkeletonInstance as Q } from "./skeleton.mjs";
|
|
12
12
|
import U from "./atom.mjs";
|
|
13
13
|
var X = /* @__PURE__ */ ((e) => (e.default = "default", e.success = "success", e.warning = "warning", e.danger = "danger", e))(X || {});
|
|
14
|
-
function
|
|
14
|
+
function ce({
|
|
15
15
|
icon: e,
|
|
16
16
|
variant: n = "default",
|
|
17
17
|
label: m,
|
|
18
18
|
tooltipPosition: w,
|
|
19
19
|
href: p,
|
|
20
|
-
target:
|
|
21
|
-
rel:
|
|
20
|
+
target: N,
|
|
21
|
+
rel: v,
|
|
22
22
|
disabled: R,
|
|
23
23
|
isLoading: f,
|
|
24
24
|
isSkeleton: r,
|
|
@@ -26,36 +26,36 @@ function ue({
|
|
|
26
26
|
className: B,
|
|
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),
|
|
30
|
-
|
|
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
31
|
x.current = e;
|
|
32
32
|
}, [e]);
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const u = C(() => {
|
|
34
|
+
c.current && (clearTimeout(c.current), c.current = null);
|
|
35
35
|
}, []);
|
|
36
|
-
|
|
36
|
+
i(() => {
|
|
37
37
|
if (a === e) {
|
|
38
38
|
d((g) => g && !1);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
d(!0),
|
|
41
|
+
d(!0), u(), c.current = setTimeout(() => {
|
|
42
42
|
d(!1), z(x.current);
|
|
43
43
|
}, 370);
|
|
44
|
-
}, [a, e,
|
|
45
|
-
|
|
46
|
-
}, [
|
|
47
|
-
const
|
|
44
|
+
}, [a, e, u]), i(() => () => {
|
|
45
|
+
u();
|
|
46
|
+
}, [u]);
|
|
47
|
+
const l = !!R || !!f || !!r;
|
|
48
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 ?
|
|
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
50
|
/* @__PURE__ */ t.jsxs("span", { "data-theme": n === "default" ? T ? "dark" : "light" : "dark", className: "kakadu-components-3040141419", children: [
|
|
51
51
|
/* @__PURE__ */ t.jsx(b, { width: 16, height: 16, type: a, className: o(S, "kakadu-components-1562914001", h && "kakadu-components-2360250719") }),
|
|
52
52
|
a === e ? null : /* @__PURE__ */ t.jsx(b, { width: 16, height: 16, type: e, className: o(S, "kakadu-components-1224061930", h && "kakadu-components-2519520784") })
|
|
53
53
|
] }),
|
|
54
54
|
/* @__PURE__ */ t.jsx(G, { isLoading: f, size: 14 }),
|
|
55
55
|
/* @__PURE__ */ t.jsx(J, { id: k, label: m, position: w }),
|
|
56
|
-
|
|
56
|
+
l ? null : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
57
57
|
/* @__PURE__ */ t.jsx(K, { size: 50 }),
|
|
58
|
-
/* @__PURE__ */ t.jsx(L, { size: 50, className: n === "default" ?
|
|
58
|
+
/* @__PURE__ */ t.jsx(L, { size: 50, className: n === "default" ? P : void 0 })
|
|
59
59
|
] })
|
|
60
60
|
] }),
|
|
61
61
|
r ? /* @__PURE__ */ t.jsx("div", { className: "kakadu-components-3422055155", children: /* @__PURE__ */ t.jsx(Q, { width: "100%", height: "100%", isAnimated: I }) }) : null
|
|
@@ -63,5 +63,5 @@ function ue({
|
|
|
63
63
|
}
|
|
64
64
|
export {
|
|
65
65
|
X as IconButtonVariant,
|
|
66
|
-
|
|
66
|
+
ce as default
|
|
67
67
|
};
|
|
@@ -13,7 +13,7 @@ type ModalProviderProperties<Data = any> = {
|
|
|
13
13
|
export declare function useModalContext<Data = any>(): ModalProviderProperties<Data>;
|
|
14
14
|
export declare function ModalContent<Type extends AtomElementType = DefaultAtomElementType>(properties: FlexProperties<Type>): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export declare function ModalHeading<Type extends AtomElementType = DefaultHeadingElementType>({ as, className, ...properties }: AtomProperties<Type>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare function ModalActions<Type extends AtomElementType = DefaultAtomElementType>({ as,
|
|
16
|
+
export declare function ModalActions<Type extends AtomElementType = DefaultAtomElementType>({ as, ...properties }: FlexProperties<Type>): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export type ModalProperties<Data = any> = {
|
|
18
18
|
readonly root?: HTMLElement | ShadowRoot;
|
|
19
19
|
readonly outerDecorators?: DecoratorType[];
|
|
@@ -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 n=require("../jsx-runtime-BB_1_6y_.js"),e=require("react"),k=require("@kuma-ui/core"),P=require("react-dom"),$=require("../focus-trap-react-CcpTuiJi.js"),B=require("../icons/icon.js"),D=require("./text-button.js"),I=require("./decorators.js"),v=require("./flex.js"),z=require("./atom.js"),C=require("./text.js"),y=e.createContext({isVisible:!1,isInteractive:!1}),{Provider:G}=y;function _(){return e.useContext(y)}function J(){const{isInteractive:s,close:o}=_(),r=e.useCallback(()=>{o==null||o()},[o]);return n.jsxRuntimeExports.jsx("div",{className:"kakadu-components-2566044647",children:n.jsxRuntimeExports.jsx(D.default,{iconLeft:B.IconType.times,label:"Close",disabled:!s,onClick:r})})}function K(s){return n.jsxRuntimeExports.jsx(v.default,{gap:2,...s})}function Q({as:s,className:o,...r}){return n.jsxRuntimeExports.jsx(C.Heading,{...r,as:s??C.defaultHeadingElementType,className:k.cx("kakadu-components-4275938488",o)})}function U({as:s,...o}){return n.jsxRuntimeExports.jsx(v.default,{direction:"row",gap:1,alignment:v.FlexAlignment.end,...o,as:s??z.defaultAtomElementType})}function V({root:s,outerDecorators:o=[],innerDecorators:r=[],label:m,maxWidth:c,className:f,isVisible:a,isFullWidth:l=!1,shouldCloseOnOutsideClick:i=!0,shouldCloseOnEscapePress:d=!0,showCloseButton:L=!0,onClose:p,children:N}){const R=e.useRef(null),M=e.useRef(null),[g,S]=e.useState(!1),[u,x]=e.useState(!1),q=e.useCallback(t=>{R.current=t,x(!1)},[]),E=e.useRef(null),T=e.useCallback(t=>{t&&(E.current=t)},[]),[b,h]=e.useState(a??!1),A=e.useMemo(()=>({isVisible:b,isInteractive:u,setInitialFocus:T,close:q}),[b,u,T,q]);e.useEffect(()=>{a&&(S(!0),h(!0))},[a]),e.useEffect(()=>{if(a){const t=setTimeout(()=>{x(!0)},100);return()=>{clearTimeout(t)}}x(!1)},[a]),e.useEffect(()=>{if(g&&!u){const t=setTimeout(()=>{p==null||p(R.current??void 0),h(!1)},370);return()=>{clearTimeout(t)}}},[g,u,p]),e.useEffect(()=>{const t=M.current;if(a&&i&&t){const j=H=>{t===H.target&&x(!1)};return t.addEventListener("click",j),()=>{t.removeEventListener("click",j)}}},[a,i]),e.useEffect(()=>{if(!a||!d)return;const t=j=>{j.key==="Escape"&&x(!1)};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[a,d]);const F=e.useMemo(()=>({initialFocus:()=>E.current??void 0,onActivate:()=>{var t;return(t=E.current)==null?void 0:t.focus()}}),[]),w=n.jsxRuntimeExports.jsx(I.default,{decorators:o,children:n.jsxRuntimeExports.jsx("div",{"aria-hidden":!u,style:{"--max-width":c?`${c}px`:void 0},className:k.cx("kakadu-components-4119461136",u&&"kakadu-components-2522346797",f),children:n.jsxRuntimeExports.jsx(I.default,{decorators:r,children:n.jsxRuntimeExports.jsx($.focusTrapReactExports.FocusTrap,{active:u,focusTrapOptions:F,children:n.jsxRuntimeExports.jsx("div",{ref:M,className:"kakadu-components-4011815997",children:n.jsxRuntimeExports.jsx("div",{role:"dialog","aria-modal":"true","aria-label":m??"Modal",className:k.cx("kakadu-components-3324483532",l&&"kakadu-components-3799971070",u&&"kakadu-components-968755580"),children:n.jsxRuntimeExports.jsxs(G,{value:A,children:[L?n.jsxRuntimeExports.jsx(J,{}):null,n.jsxRuntimeExports.jsx("div",{className:k.cx("kakadu-components-633990035",l&&"kakadu-components-171969824"),children:N})]})})})})})})});return s?P.createPortal(w,s):w}function X(s,o){const[r,m]=e.useState(!1),c=e.useRef(void 0),f=e.useCallback(async()=>(m(!0),new Promise(i=>{c.current=i})),[]),a=e.useCallback(i=>{var d;m(!1),(d=c.current)==null||d.call(c,i),c.current=void 0},[]),l=e.useMemo(()=>n.jsxRuntimeExports.jsx(s,{...o,isVisible:r,onClose:a}),[s,o,r,a]);return e.useMemo(()=>({isVisible:r,show:f,modal:l}),[r,f,l])}exports.ModalActions=U;exports.ModalContent=K;exports.ModalHeading=Q;exports.default=V;exports.useModal=X;exports.useModalContext=_;
|
|
@@ -1,78 +1,77 @@
|
|
|
1
1
|
import { j as t } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { createContext as q, useRef as
|
|
3
|
-
import { cx as
|
|
2
|
+
import { createContext as q, useRef as j, useState as h, useCallback as f, useMemo as I, useEffect as m, useContext as z } from "react";
|
|
3
|
+
import { cx as w } from "@kuma-ui/core";
|
|
4
4
|
import { createPortal as G } from "react-dom";
|
|
5
5
|
import { f as J } from "../focus-trap-react-DYXrtbDH.mjs";
|
|
6
6
|
import { IconType as K } from "../icons/icon.mjs";
|
|
7
7
|
import Q from "./text-button.mjs";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { defaultAtomElementType as
|
|
11
|
-
import { Heading as
|
|
12
|
-
const
|
|
8
|
+
import b from "./decorators.mjs";
|
|
9
|
+
import A, { FlexAlignment as U } from "./flex.mjs";
|
|
10
|
+
import { defaultAtomElementType as V } from "./atom.mjs";
|
|
11
|
+
import { Heading as X, defaultHeadingElementType as Y } from "./text.mjs";
|
|
12
|
+
const C = q({
|
|
13
13
|
isVisible: !1,
|
|
14
14
|
isInteractive: !1
|
|
15
15
|
}), {
|
|
16
|
-
Provider:
|
|
17
|
-
} =
|
|
18
|
-
function Z() {
|
|
19
|
-
return z(A);
|
|
20
|
-
}
|
|
16
|
+
Provider: Z
|
|
17
|
+
} = C;
|
|
21
18
|
function _() {
|
|
19
|
+
return z(C);
|
|
20
|
+
}
|
|
21
|
+
function W() {
|
|
22
22
|
const {
|
|
23
23
|
isInteractive: n,
|
|
24
24
|
close: o
|
|
25
|
-
} =
|
|
25
|
+
} = _(), s = f(() => {
|
|
26
26
|
o == null || o();
|
|
27
27
|
}, [o]);
|
|
28
28
|
return /* @__PURE__ */ t.jsx("div", { className: "kakadu-components-2566044647", children: /* @__PURE__ */ t.jsx(Q, { iconLeft: K.times, label: "Close", disabled: !n, onClick: s }) });
|
|
29
29
|
}
|
|
30
30
|
function ue(n) {
|
|
31
|
-
return /* @__PURE__ */ t.jsx(
|
|
31
|
+
return /* @__PURE__ */ t.jsx(A, { gap: 2, ...n });
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function de({
|
|
34
34
|
as: n,
|
|
35
35
|
className: o,
|
|
36
36
|
...s
|
|
37
37
|
}) {
|
|
38
|
-
return /* @__PURE__ */ t.jsx(
|
|
38
|
+
return /* @__PURE__ */ t.jsx(X, { ...s, as: n ?? Y, className: w("kakadu-components-4275938488", o) });
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function me({
|
|
41
41
|
as: n,
|
|
42
|
-
|
|
43
|
-
...s
|
|
42
|
+
...o
|
|
44
43
|
}) {
|
|
45
|
-
return /* @__PURE__ */ t.jsx(
|
|
44
|
+
return /* @__PURE__ */ t.jsx(A, { direction: "row", gap: 1, alignment: U.end, ...o, as: n ?? V });
|
|
46
45
|
}
|
|
47
|
-
function
|
|
46
|
+
function fe({
|
|
48
47
|
root: n,
|
|
49
48
|
outerDecorators: o = [],
|
|
50
49
|
innerDecorators: s = [],
|
|
51
|
-
label:
|
|
52
|
-
maxWidth:
|
|
50
|
+
label: p,
|
|
51
|
+
maxWidth: a,
|
|
53
52
|
className: x,
|
|
54
|
-
isVisible:
|
|
55
|
-
isFullWidth:
|
|
53
|
+
isVisible: r,
|
|
54
|
+
isFullWidth: l = !1,
|
|
56
55
|
shouldCloseOnOutsideClick: i = !0,
|
|
57
|
-
shouldCloseOnEscapePress:
|
|
56
|
+
shouldCloseOnEscapePress: u = !0,
|
|
58
57
|
showCloseButton: H = !0,
|
|
59
|
-
onClose:
|
|
58
|
+
onClose: k,
|
|
60
59
|
children: B
|
|
61
60
|
}) {
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
}, []), T =
|
|
61
|
+
const g = j(null), E = j(null), [M, P] = h(!1), [c, d] = h(!1), y = f((e) => {
|
|
62
|
+
g.current = e, d(!1);
|
|
63
|
+
}, []), T = j(null), F = f((e) => {
|
|
65
64
|
e && (T.current = e);
|
|
66
|
-
}, []), [L,
|
|
65
|
+
}, []), [L, N] = h(r ?? !1), D = I(() => ({
|
|
67
66
|
isVisible: L,
|
|
68
67
|
isInteractive: c,
|
|
69
|
-
setInitialFocus:
|
|
68
|
+
setInitialFocus: F,
|
|
70
69
|
close: y
|
|
71
|
-
}), [L, c,
|
|
70
|
+
}), [L, c, F, y]);
|
|
72
71
|
m(() => {
|
|
73
|
-
|
|
74
|
-
}, [
|
|
75
|
-
if (
|
|
72
|
+
r && (P(!0), N(!0));
|
|
73
|
+
}, [r]), m(() => {
|
|
74
|
+
if (r) {
|
|
76
75
|
const e = setTimeout(() => {
|
|
77
76
|
d(!0);
|
|
78
77
|
}, 100);
|
|
@@ -81,67 +80,67 @@ function me({
|
|
|
81
80
|
};
|
|
82
81
|
}
|
|
83
82
|
d(!1);
|
|
84
|
-
}, [
|
|
85
|
-
if (
|
|
83
|
+
}, [r]), m(() => {
|
|
84
|
+
if (M && !c) {
|
|
86
85
|
const e = setTimeout(() => {
|
|
87
|
-
|
|
86
|
+
k == null || k(g.current ?? void 0), N(!1);
|
|
88
87
|
}, 370);
|
|
89
88
|
return () => {
|
|
90
89
|
clearTimeout(e);
|
|
91
90
|
};
|
|
92
91
|
}
|
|
93
|
-
}, [
|
|
94
|
-
const e =
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
92
|
+
}, [M, c, k]), m(() => {
|
|
93
|
+
const e = E.current;
|
|
94
|
+
if (r && i && e) {
|
|
95
|
+
const v = ($) => {
|
|
97
96
|
e === $.target && d(!1);
|
|
98
97
|
};
|
|
99
|
-
return e.addEventListener("click",
|
|
100
|
-
e.removeEventListener("click",
|
|
98
|
+
return e.addEventListener("click", v), () => {
|
|
99
|
+
e.removeEventListener("click", v);
|
|
101
100
|
};
|
|
102
101
|
}
|
|
103
|
-
}, [
|
|
104
|
-
if (!
|
|
102
|
+
}, [r, i]), m(() => {
|
|
103
|
+
if (!r || !u)
|
|
105
104
|
return;
|
|
106
|
-
const e = (
|
|
107
|
-
|
|
105
|
+
const e = (v) => {
|
|
106
|
+
v.key === "Escape" && d(!1);
|
|
108
107
|
};
|
|
109
108
|
return window.addEventListener("keydown", e), () => {
|
|
110
109
|
window.removeEventListener("keydown", e);
|
|
111
110
|
};
|
|
112
|
-
}, [
|
|
111
|
+
}, [r, u]);
|
|
113
112
|
const S = I(() => ({
|
|
114
113
|
initialFocus: () => T.current ?? void 0,
|
|
115
114
|
onActivate: () => {
|
|
116
115
|
var e;
|
|
117
116
|
return (e = T.current) == null ? void 0 : e.focus();
|
|
118
117
|
}
|
|
119
|
-
}), []),
|
|
120
|
-
"--max-width":
|
|
121
|
-
}, className:
|
|
122
|
-
H ? /* @__PURE__ */ t.jsx(
|
|
123
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
118
|
+
}), []), R = /* @__PURE__ */ t.jsx(b, { decorators: o, children: /* @__PURE__ */ t.jsx("div", { "aria-hidden": !c, style: {
|
|
119
|
+
"--max-width": a ? `${a}px` : void 0
|
|
120
|
+
}, className: w("kakadu-components-4119461136", c && "kakadu-components-2522346797", x), children: /* @__PURE__ */ t.jsx(b, { decorators: s, children: /* @__PURE__ */ t.jsx(J.FocusTrap, { active: c, focusTrapOptions: S, children: /* @__PURE__ */ t.jsx("div", { ref: E, className: "kakadu-components-4011815997", children: /* @__PURE__ */ t.jsx("div", { role: "dialog", "aria-modal": "true", "aria-label": p ?? "Modal", className: w("kakadu-components-3324483532", l && "kakadu-components-3799971070", c && "kakadu-components-968755580"), children: /* @__PURE__ */ t.jsxs(Z, { value: D, children: [
|
|
121
|
+
H ? /* @__PURE__ */ t.jsx(W, {}) : null,
|
|
122
|
+
/* @__PURE__ */ t.jsx("div", { className: w("kakadu-components-633990035", l && "kakadu-components-171969824"), children: B })
|
|
124
123
|
] }) }) }) }) }) }) });
|
|
125
|
-
return n ? G(
|
|
124
|
+
return n ? G(R, n) : R;
|
|
126
125
|
}
|
|
127
|
-
function
|
|
128
|
-
const [s,
|
|
129
|
-
|
|
130
|
-
})), []),
|
|
131
|
-
var
|
|
132
|
-
|
|
133
|
-
}, []),
|
|
126
|
+
function pe(n, o) {
|
|
127
|
+
const [s, p] = h(!1), a = j(void 0), x = f(async () => (p(!0), new Promise((i) => {
|
|
128
|
+
a.current = i;
|
|
129
|
+
})), []), r = f((i) => {
|
|
130
|
+
var u;
|
|
131
|
+
p(!1), (u = a.current) == null || u.call(a, i), a.current = void 0;
|
|
132
|
+
}, []), l = I(() => /* @__PURE__ */ t.jsx(n, { ...o, isVisible: s, onClose: r }), [n, o, s, r]);
|
|
134
133
|
return I(() => ({
|
|
135
134
|
isVisible: s,
|
|
136
135
|
show: x,
|
|
137
|
-
modal:
|
|
138
|
-
}), [s, x,
|
|
136
|
+
modal: l
|
|
137
|
+
}), [s, x, l]);
|
|
139
138
|
}
|
|
140
139
|
export {
|
|
141
|
-
|
|
140
|
+
me as ModalActions,
|
|
142
141
|
ue as ModalContent,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
de as ModalHeading,
|
|
143
|
+
fe as default,
|
|
144
|
+
pe as useModal,
|
|
145
|
+
_ as useModalContext
|
|
147
146
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),I=require("@kuma-ui/core"),a=require("react"),N=require("../theme.js"),b=require("../icons/icon.js"),j=require("./popover.js"),S=require("./atom.js"),w=require("./text.js"),y=require("./hover-gradient.js"),_=require("./click-ripples.js"),C=require("./separator.js"),K=require("./decorators.js"),k=new Set;function M(){const[e,n]=a.useState(!1),u=a.useCallback(s=>{n(s);for(const o of k)o(s)},[]);return a.useEffect(()=>{const s=o=>{n(o)};return k.add(s),()=>{k.delete(s)}},[]),a.useMemo(()=>({isKeyboardNavigating:e,setIsKeyboardNavigating:u}),[e,u])}function F({label:e,iconLeft:n,iconRight:u,href:s,shouldCloseOnClick:o=!0,decorators:v=[],submenu:m,className:i,onClick:r,...f}){const{isVisible:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),I=require("@kuma-ui/core"),a=require("react"),N=require("../theme.js"),b=require("../icons/icon.js"),j=require("./popover.js"),S=require("./atom.js"),w=require("./text.js"),y=require("./hover-gradient.js"),_=require("./click-ripples.js"),C=require("./separator.js"),K=require("./decorators.js"),k=new Set;function M(){const[e,n]=a.useState(!1),u=a.useCallback(s=>{n(s);for(const o of k)o(s)},[]);return a.useEffect(()=>{const s=o=>{n(o)};return k.add(s),()=>{k.delete(s)}},[]),a.useMemo(()=>({isKeyboardNavigating:e,setIsKeyboardNavigating:u}),[e,u])}function F({label:e,iconLeft:n,iconRight:u,href:s,shouldCloseOnClick:o=!0,decorators:v=[],submenu:m,className:i,onClick:r,...f}){const{isVisible:d,isPreparingFocus:l,isFocused:c,close:x}=j.usePopoverContext(),{isKeyboardNavigating:p}=M(),E=a.useRef(!0),R=a.useCallback(()=>{E.current=c},[c]),g=a.useCallback(q=>{!p&&!E.current||c&&(r==null||r(q),m?m.show():o&&(x==null||x()))},[p,c,r,m,o,x]),h=a.useMemo(()=>t.jsxRuntimeExports.jsxs(S.default,{as:s?"a":"button",...f,type:s?void 0:"button",role:"menuitem",href:s,inert:!d&&!l,disabled:s?void 0:!d&&!l,className:I.cx(N.buttonResetStyles,"kakadu-components-4075327442",c&&"kakadu-components-3160069815",p?"kakadu-components-2043829669":c&&"kakadu-components-2862719809",i),onClick:g,onPointerDownCapture:R,children:[t.jsxRuntimeExports.jsxs(w.Span,{className:"kakadu-components-1109353535",children:[n?t.jsxRuntimeExports.jsx(b.default,{width:12,height:12,type:n}):null,t.jsxRuntimeExports.jsx("span",{className:"kakadu-components-913703148",children:e}),u?t.jsxRuntimeExports.jsx(b.default,{width:12,height:12,type:u}):null]}),p?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(_.default,{isActive:c,size:100}),t.jsxRuntimeExports.jsx(y.default,{isActive:c,size:150,className:y.normalBlendStyles})]})]}),[s,f,d,l,p,i,g,R,n,e,u,c]);return t.jsxRuntimeExports.jsx(K.default,{decorators:v,children:m?t.jsxRuntimeExports.jsx(P,{menu:m.popoverMenu,className:"kakadu-components-1861176543",children:h}):h})}function A(e){if("type"in e){if(e.type==="separator")return t.jsxRuntimeExports.jsx(C.default,{});if(e.type==="group")return t.jsxRuntimeExports.jsx(w.Span,{className:"kakadu-components-1499037363",children:e.label})}return t.jsxRuntimeExports.jsx(F,{...e})}function D({items:e}){const{isFocused:n}=j.usePopoverContext(),[u,s]=a.useState([]),{setIsKeyboardNavigating:o}=M(),v=a.useCallback(i=>{i&&s(r=>r.includes(i)?r:[...r,i])},[]),m=a.useCallback(i=>{n&&(i.currentTarget.focus(),o(!1))},[n,o]);return a.useEffect(()=>{if(!n)return;const i=r=>{const f=u.filter(p=>p.isConnected),d=f.length;if(d===0)return;let l;const c=document.activeElement;let x=c?f.indexOf(c):-1;switch(x===-1&&(x=0),r.key){case"ArrowDown":{l=(x+1)%d;break}case"ArrowUp":{l=(x-1+d)%d;break}case"Home":{l=0;break}case"End":{l=d-1;break}case"Tab":{o(!0);return}}if(l!==void 0){r.preventDefault(),r.stopPropagation();const p=f[l];p&&(p.focus(),o(!0))}};return window.addEventListener("keydown",i,{capture:!0}),()=>{window.removeEventListener("keydown",i,{capture:!0})}},[n,u,o]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e.map((i,r)=>t.jsxRuntimeExports.jsx(A,{...i,reference:v,onMouseEnter:m},r))})}function T({items:e,...n}){return t.jsxRuntimeExports.jsx(j.default,{...n,as:"nav",role:"menu",innerClassName:"kakadu-components-3600436535",children:t.jsxRuntimeExports.jsx(D,{items:e})})}function z(e){const n=a.useMemo(()=>({items:e}),[e]),{show:u,close:s,popover:o}=j.usePopover(T,n);return a.useMemo(()=>({show:u,close:s,popoverMenu:o}),[u,s,o])}function P({menu:e,className:n,children:u}){return t.jsxRuntimeExports.jsxs(j.PopoverContainer,{className:n,children:[u,e]})}exports.default=P;exports.usePopoverMenu=z;
|
|
@@ -42,17 +42,17 @@ function G({
|
|
|
42
42
|
...f
|
|
43
43
|
}) {
|
|
44
44
|
const {
|
|
45
|
-
isVisible:
|
|
45
|
+
isVisible: m,
|
|
46
46
|
isPreparingFocus: u,
|
|
47
47
|
isFocused: c,
|
|
48
|
-
close:
|
|
48
|
+
close: l
|
|
49
49
|
} = N(), {
|
|
50
50
|
isKeyboardNavigating: d
|
|
51
51
|
} = E(), j = A(!0), h = v(() => {
|
|
52
52
|
j.current = c;
|
|
53
53
|
}, [c]), w = v((S) => {
|
|
54
|
-
!d && !j.current || c && (s == null || s(S), p ? p.show() : r && (
|
|
55
|
-
}, [d, c, s, p, r,
|
|
54
|
+
!d && !j.current || c && (s == null || s(S), p ? p.show() : r && (l == null || l()));
|
|
55
|
+
}, [d, c, s, p, r, l]), y = x(() => /* @__PURE__ */ n.jsxs(R, { as: o ? "a" : "button", ...f, type: o ? void 0 : "button", role: "menuitem", href: o, inert: !m && !u, disabled: o ? void 0 : !m && !u, className: K(C, "kakadu-components-4075327442", c && "kakadu-components-3160069815", d ? "kakadu-components-2043829669" : c && "kakadu-components-2862719809", i), onClick: w, onPointerDownCapture: h, children: [
|
|
56
56
|
/* @__PURE__ */ n.jsxs(M, { className: "kakadu-components-1109353535", children: [
|
|
57
57
|
t ? /* @__PURE__ */ n.jsx(P, { width: 12, height: 12, type: t }) : null,
|
|
58
58
|
/* @__PURE__ */ n.jsx("span", { className: "kakadu-components-913703148", children: e }),
|
|
@@ -62,7 +62,7 @@ function G({
|
|
|
62
62
|
/* @__PURE__ */ n.jsx(T, { isActive: c, size: 100 }),
|
|
63
63
|
/* @__PURE__ */ n.jsx(z, { isActive: c, size: 150, className: L })
|
|
64
64
|
] })
|
|
65
|
-
] }), [o, f,
|
|
65
|
+
] }), [o, f, m, u, d, i, w, h, t, e, a, c]);
|
|
66
66
|
return /* @__PURE__ */ n.jsx(B, { decorators: k, children: p ? /* @__PURE__ */ n.jsx(O, { menu: p.popoverMenu, className: "kakadu-components-1861176543", children: y }) : y });
|
|
67
67
|
}
|
|
68
68
|
function U(e) {
|
|
@@ -90,19 +90,19 @@ function q({
|
|
|
90
90
|
if (!t)
|
|
91
91
|
return;
|
|
92
92
|
const i = (s) => {
|
|
93
|
-
const f = a.filter((d) => d.isConnected),
|
|
94
|
-
if (
|
|
93
|
+
const f = a.filter((d) => d.isConnected), m = f.length;
|
|
94
|
+
if (m === 0)
|
|
95
95
|
return;
|
|
96
96
|
let u;
|
|
97
97
|
const c = document.activeElement;
|
|
98
|
-
let
|
|
99
|
-
switch (
|
|
98
|
+
let l = c ? f.indexOf(c) : -1;
|
|
99
|
+
switch (l === -1 && (l = 0), s.key) {
|
|
100
100
|
case "ArrowDown": {
|
|
101
|
-
u = (
|
|
101
|
+
u = (l + 1) % m;
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
104
|
case "ArrowUp": {
|
|
105
|
-
u = (
|
|
105
|
+
u = (l - 1 + m) % m;
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
case "Home": {
|
|
@@ -110,7 +110,7 @@ function q({
|
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
112
112
|
case "End": {
|
|
113
|
-
u =
|
|
113
|
+
u = m - 1;
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
116
|
case "Tab": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),f=require("@kuma-ui/core"),e=require("react"),K=require("../focus-trap-react-CcpTuiJi.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),f=require("@kuma-ui/core"),e=require("react"),K=require("../focus-trap-react-CcpTuiJi.js"),R=require("./atom.js"),$=e.createContext({isVisible:!1,isPreparingFocus:!1,isFocused:!1}),{Provider:Q}=$;function X(){return e.useContext($)}function Y({as:i,className:s,...o}){return n.jsxRuntimeExports.jsx(R.default,{as:i??R.defaultAtomElementType,...o,className:f.cx("kakadu-components-2845019685",s)})}function Z({as:i,isVisible:s,label:o,shouldCloseOnOutsideClick:d=!0,shouldCloseOnEscapePress:a=!0,children:p,className:u,innerClassName:x,onClose:r,...v}){const I=e.useRef(null),S=e.useRef(null),[q,h]=e.useState(!1),[A,k]=e.useState(!1),[C,H]=e.useState(!1),[c,g]=e.useState(!1),[U,j]=e.useState(!1),M=e.useCallback(t=>{I.current=t,g(!1)},[]),E=e.useRef(null),N=e.useCallback(t=>{t&&(E.current=t)},[]),G=e.useMemo(()=>({initialFocus:()=>E.current??void 0,onPostActivate(){var t;k(!0),h(!1),(t=E.current)==null||t.focus()},clickOutsideDeactivates:d,escapeDeactivates:a,onPostUnpause(){k(!0)},onPause(){k(!1)},onDeactivate(){j(!1),g(!1),k(!1)}}),[d,a]),[L,O]=e.useState(s??!1),J=e.useMemo(()=>({isVisible:L,isPreparingFocus:q,isFocused:A,setInitialFocus:N,close:M}),[L,q,A,N,M]),[l,y]=e.useState("center");return e.useEffect(()=>{const t=S.current;if(t){const P=()=>{const D=t.offsetParent,F=D instanceof HTMLElement?D.getBoundingClientRect():null,V=t.getBoundingClientRect();if(!F){y("center");return}const T=16,_=window.innerWidth-T,b=F.left+F.width/2-V.width/2,z=b+V.width,B=b<T,W=z>_;let m="center";if(B&&W){const w=T-b;m=z-_>w?"right":"left"}else W?m="right":B&&(m="left");y(w=>w===m?w:m)};return P(),window.addEventListener("resize",P),()=>{window.removeEventListener("resize",P)}}},[]),e.useEffect(()=>{s&&(H(!0),O(!0))},[s]),e.useEffect(()=>{if(s){const t=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(t)}}g(!1)},[s]),e.useEffect(()=>{if(!c){j(!1),h(!1);return}h(!0);const t=window.requestAnimationFrame(()=>{j(!0)});return()=>{window.cancelAnimationFrame(t)}},[c]),e.useEffect(()=>{if(C&&!c){const t=setTimeout(()=>{r==null||r(I.current??void 0),O(!1)},370);return()=>{clearTimeout(t)}}},[C,c,r]),n.jsxRuntimeExports.jsx(R.default,{reference:S,as:i??R.defaultAtomElementType,role:"dialog","aria-hidden":!c,"aria-label":o??"Popover",...v,className:f.cx("kakadu-components-3920007758",l==="left"&&"kakadu-components-611400930",l==="right"&&"kakadu-components-944244368",c&&"kakadu-components-1399012551",u),children:n.jsxRuntimeExports.jsxs("div",{className:f.cx("kakadu-components-1118152266",c&&"kakadu-components-231244945"),children:[n.jsxRuntimeExports.jsx("div",{className:f.cx("kakadu-components-1951789226",l==="left"&&"kakadu-components-1495725644",l==="right"&&"kakadu-components-4235689197")}),n.jsxRuntimeExports.jsx(K.focusTrapReactExports.FocusTrap,{active:U,focusTrapOptions:G,children:n.jsxRuntimeExports.jsxs("div",{className:f.cx("kakadu-components-2488426662",x),children:[n.jsxRuntimeExports.jsx(Q,{value:J,children:p}),n.jsxRuntimeExports.jsx("div",{className:f.cx("kakadu-components-3252390100",l==="left"&&"kakadu-components-3754561431",l==="right"&&"kakadu-components-2265262600")})]})})]})})}function ee(i,s){const[o,d]=e.useState(!1),a=e.useRef(void 0),p=e.useCallback(async()=>(d(!0),new Promise(r=>{a.current=r})),[]),u=e.useCallback(r=>{var v;d(!1),(v=a.current)==null||v.call(a,r),a.current=void 0},[]),x=e.useMemo(()=>n.jsxRuntimeExports.jsx(i,{...s,isVisible:o,onClose:u}),[i,s,o,u]);return e.useMemo(()=>({isVisible:o,show:p,close:u,popover:x}),[o,p,u,x])}exports.PopoverContainer=Y;exports.default=Z;exports.usePopover=ee;exports.usePopoverContext=X;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export declare function getDeterministicSkeletonWidth(a: number, b: number, { minimum, maximum }: {
|
|
3
|
+
readonly minimum: number;
|
|
4
|
+
readonly maximum: number;
|
|
5
|
+
}): number;
|
|
2
6
|
type SkeletonProperties = {
|
|
3
7
|
readonly label?: string;
|
|
4
8
|
readonly width?: string | number;
|
|
@@ -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"),l=require("react"),x=require("@kuma-ui/core");function h(u,e,{minimum:t,maximum:o}){const n=u*374761393+e*668265263+2147483647,r=Math.imul(n,1274126177),a=o-t+1;return t+Math.abs(r)%a}function i({label:u,width:e,height:t,className:o,children:n,isAnimated:r=!0,...a}){return s.jsxRuntimeExports.jsx("span",{...a,"aria-label":u,className:x.cx("kakadu-components-4254676273",r&&"kakadu-components-574297718",o),style:{width:e,height:t},children:n??s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:" "})})}const c="kakadu-components-3140855657";function m({label:u,lines:e=1,isAnimated:t=!0}){const o=l.useMemo(()=>{const n=[];if(e<=1)return n;for(let r=1;r<e;r+=1)n.push(s.jsxRuntimeExports.jsx(i,{"aria-hidden":!0,width:"100%",height:"1em",isAnimated:t,className:c},r));return n},[e,t]);return e<1?null:e===1?s.jsxRuntimeExports.jsx(i,{"aria-busy":!0,label:u,width:"100%",height:"1em",isAnimated:t,role:"status",className:c}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[o,s.jsxRuntimeExports.jsx(i,{"aria-busy":!0,label:u,width:"60%",height:"1em",isAnimated:t,role:"status",className:c})]})}exports.SkeletonInstance=i;exports.default=m;exports.getDeterministicSkeletonWidth=h;
|
|
@@ -1,40 +1,48 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { j as s } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
+
import { useMemo as h } from "react";
|
|
3
3
|
import { cx as l } from "@kuma-ui/core";
|
|
4
|
-
function
|
|
5
|
-
|
|
4
|
+
function k(a, t, {
|
|
5
|
+
minimum: e,
|
|
6
|
+
maximum: o
|
|
7
|
+
}) {
|
|
8
|
+
const r = a * 374761393 + t * 668265263 + 2147483647, n = Math.imul(r, 1274126177), u = o - e + 1;
|
|
9
|
+
return e + Math.abs(n) % u;
|
|
10
|
+
}
|
|
11
|
+
function c({
|
|
12
|
+
label: a,
|
|
6
13
|
width: t,
|
|
7
|
-
height:
|
|
14
|
+
height: e,
|
|
8
15
|
className: o,
|
|
9
|
-
children:
|
|
10
|
-
isAnimated:
|
|
11
|
-
...
|
|
16
|
+
children: r,
|
|
17
|
+
isAnimated: n = !0,
|
|
18
|
+
...u
|
|
12
19
|
}) {
|
|
13
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ s.jsx("span", { ...u, "aria-label": a, className: l("kakadu-components-4254676273", n && "kakadu-components-574297718", o), style: {
|
|
14
21
|
width: t,
|
|
15
|
-
height:
|
|
16
|
-
}, children:
|
|
22
|
+
height: e
|
|
23
|
+
}, children: r ?? /* @__PURE__ */ s.jsx(s.Fragment, { children: " " }) });
|
|
17
24
|
}
|
|
18
|
-
const
|
|
25
|
+
const i = "kakadu-components-3140855657";
|
|
19
26
|
function p({
|
|
20
|
-
label:
|
|
27
|
+
label: a,
|
|
21
28
|
lines: t = 1,
|
|
22
|
-
isAnimated:
|
|
29
|
+
isAnimated: e = !0
|
|
23
30
|
}) {
|
|
24
|
-
const o =
|
|
25
|
-
const
|
|
31
|
+
const o = h(() => {
|
|
32
|
+
const r = [];
|
|
26
33
|
if (t <= 1)
|
|
27
|
-
return
|
|
28
|
-
for (let
|
|
29
|
-
|
|
30
|
-
return
|
|
31
|
-
}, [t,
|
|
32
|
-
return t < 1 ? null : t === 1 ? /* @__PURE__ */
|
|
34
|
+
return r;
|
|
35
|
+
for (let n = 1; n < t; n += 1)
|
|
36
|
+
r.push(/* @__PURE__ */ s.jsx(c, { "aria-hidden": !0, width: "100%", height: "1em", isAnimated: e, className: i }, n));
|
|
37
|
+
return r;
|
|
38
|
+
}, [t, e]);
|
|
39
|
+
return t < 1 ? null : t === 1 ? /* @__PURE__ */ s.jsx(c, { "aria-busy": !0, label: a, width: "100%", height: "1em", isAnimated: e, role: "status", className: i }) : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
33
40
|
o,
|
|
34
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ s.jsx(c, { "aria-busy": !0, label: a, width: "60%", height: "1em", isAnimated: e, role: "status", className: i })
|
|
35
42
|
] });
|
|
36
43
|
}
|
|
37
44
|
export {
|
|
38
|
-
|
|
39
|
-
p as default
|
|
45
|
+
c as SkeletonInstance,
|
|
46
|
+
p as default,
|
|
47
|
+
k as getDeterministicSkeletonWidth
|
|
40
48
|
};
|