@kakadu/components 3.11.1 → 3.13.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/notice.d.ts +1 -0
- package/build/components/notice.js +1 -1
- package/build/components/notice.mjs +15 -15
- package/build/components/popover-menu.d.ts +1 -0
- package/build/components/popover-menu.js +1 -1
- package/build/components/popover-menu.mjs +22 -20
- package/build/components/skeleton.d.ts +3 -3
- package/build/components/skeleton.js +1 -1
- package/build/components/skeleton.mjs +26 -24
- package/build/components.css +1 -1
- package/build/hooks/use-fetch.d.ts +2 -0
- package/build/icons/icon.d.ts +26 -25
- package/build/icons/icon.js +1 -1
- package/build/icons/icon.mjs +86 -84
- package/build/icons/information.d.ts +2 -0
- package/build/icons/information.js +1 -0
- package/build/icons/information.mjs +27 -0
- package/build/index.d.ts +54 -50
- package/build/index.js +1 -1
- package/build/index.mjs +159 -154
- package/build/theme.js +1 -1
- package/build/theme.mjs +1 -1
- package/build/utilities/clamp.d.ts +1 -0
- package/build/utilities/clamp.js +1 -0
- package/build/utilities/clamp.mjs +6 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),t=require("@kuma-ui/core"),c=require("../icons/icon.js"),p=require("./text.js");var r=(n=>(n.default="default",n.success="success",n.information="information",n.warning="warning",n.danger="danger",n))(r||{});function j({type:n="default",icon:a,className:u,children:o,...i}){const d=n==="success",m=n==="information",k=n==="warning",l=n==="danger",s=!!a,x=!!o;return e.jsxRuntimeExports.jsxs("aside",{...i,className:t.cx("kakadu-components-925362255",s&&"kakadu-components-2945174293",d&&(s?"kakadu-components-2585123369":"kakadu-components-1387450724"),m&&(s?"kakadu-components-3663522234":"kakadu-components-728842914"),k&&(s?"kakadu-components-3502407303":"kakadu-components-1612824642"),l&&(s?"kakadu-components-314765189":"kakadu-components-4209515987"),u),children:[e.jsxRuntimeExports.jsx("div",{"data-theme":"dark",className:t.cx("kakadu-components-3327291559",s&&"kakadu-components-3906762683"),children:a&&e.jsxRuntimeExports.jsx(c.default,{width:14,height:14,type:a,className:c.iconShadowStyles})}),e.jsxRuntimeExports.jsx(p.Span,{className:"kakadu-components-1969958615",children:x?o:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:" "})})]})}exports.NoticeType=r;exports.default=j;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { cx as
|
|
3
|
-
import
|
|
4
|
-
import { Span as
|
|
5
|
-
var h = /* @__PURE__ */ ((
|
|
6
|
-
function
|
|
7
|
-
type:
|
|
1
|
+
import { j as s } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
+
import { cx as e } from "@kuma-ui/core";
|
|
3
|
+
import l, { iconShadowStyles as p } from "../icons/icon.mjs";
|
|
4
|
+
import { Span as f } from "./text.mjs";
|
|
5
|
+
var h = /* @__PURE__ */ ((n) => (n.default = "default", n.success = "success", n.information = "information", n.warning = "warning", n.danger = "danger", n))(h || {});
|
|
6
|
+
function S({
|
|
7
|
+
type: n = "default",
|
|
8
8
|
icon: o,
|
|
9
|
-
className:
|
|
10
|
-
children:
|
|
11
|
-
...
|
|
9
|
+
className: r,
|
|
10
|
+
children: t,
|
|
11
|
+
...c
|
|
12
12
|
}) {
|
|
13
|
-
const
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
13
|
+
const m = n === "success", d = n === "information", k = n === "warning", i = n === "danger", a = !!o, u = !!t;
|
|
14
|
+
return /* @__PURE__ */ s.jsxs("aside", { ...c, className: e("kakadu-components-925362255", a && "kakadu-components-2945174293", m && (a ? "kakadu-components-2585123369" : "kakadu-components-1387450724"), d && (a ? "kakadu-components-3663522234" : "kakadu-components-728842914"), k && (a ? "kakadu-components-3502407303" : "kakadu-components-1612824642"), i && (a ? "kakadu-components-314765189" : "kakadu-components-4209515987"), r), children: [
|
|
15
|
+
/* @__PURE__ */ s.jsx("div", { "data-theme": "dark", className: e("kakadu-components-3327291559", a && "kakadu-components-3906762683"), children: o && /* @__PURE__ */ s.jsx(l, { width: 14, height: 14, type: o, className: p }) }),
|
|
16
|
+
/* @__PURE__ */ s.jsx(f, { className: "kakadu-components-1969958615", children: u ? t : /* @__PURE__ */ s.jsx(s.Fragment, { children: " " }) })
|
|
17
17
|
] });
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
20
20
|
h as NoticeType,
|
|
21
|
-
|
|
21
|
+
S as default
|
|
22
22
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type MouseEvent, type ReactNode, type Ref } from 'react';
|
|
2
2
|
import { type IconType } from '../icons/icon';
|
|
3
3
|
import { type DecoratorType } from './decorators';
|
|
4
|
+
export declare const dangerPopoverMenuItemStyles: string;
|
|
4
5
|
type PopoverMenuItemElementType = HTMLButtonElement | HTMLAnchorElement;
|
|
5
6
|
export type PopoverMenuItemProperties = {
|
|
6
7
|
type: 'separator';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),q=require("@kuma-ui/core"),a=require("react"),N=require("../theme.js"),y=require("../icons/icon.js"),j=require("./popover.js"),S=require("./atom.js"),w=require("./text.js"),b=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])}const F="kakadu-components-3931722929";function A({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),g=a.useCallback(()=>{E.current=c},[c]),R=a.useCallback(I=>{!p&&!E.current||c&&(r==null||r(I),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:q.cx(N.buttonResetStyles,"kakadu-components-1567150544",c&&"kakadu-components-3160069815",p?"kakadu-components-2254977234":c&&"kakadu-components-278139688",i),onClick:R,onPointerDownCapture:g,children:[t.jsxRuntimeExports.jsxs(w.Span,{className:"kakadu-components-1109353535",children:[n?t.jsxRuntimeExports.jsx(y.default,{width:12,height:12,type:n}):null,t.jsxRuntimeExports.jsx("span",{className:"kakadu-components-913703148",children:e}),u?t.jsxRuntimeExports.jsx(y.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(b.default,{isActive:c,size:150,className:b.normalBlendStyles})]})]}),[s,f,d,l,p,i,R,g,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 D(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(A,{...e})}function T({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(D,{...i,reference:v,onMouseEnter:m},r))})}function z({items:e,...n}){return t.jsxRuntimeExports.jsx(j.default,{...n,as:"nav",role:"menu",innerClassName:"kakadu-components-3600436535",children:t.jsxRuntimeExports.jsx(T,{items:e})})}function H(e){const n=a.useMemo(()=>({items:e}),[e]),{show:u,close:s,popover:o}=j.usePopover(z,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.dangerPopoverMenuItemStyles=F;exports.default=P;exports.usePopoverMenu=H;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as n } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
2
|
import { cx as K } from "@kuma-ui/core";
|
|
3
|
-
import { useMemo as x, useState as
|
|
3
|
+
import { useMemo as x, useState as I, useCallback as v, useEffect as b, useRef as A } from "react";
|
|
4
4
|
import { buttonResetStyles as C } from "../theme.mjs";
|
|
5
5
|
import P from "../icons/icon.mjs";
|
|
6
6
|
import D, { PopoverContainer as F, usePopover as H, usePopoverContext as N } from "./popover.mjs";
|
|
@@ -12,12 +12,12 @@ import V from "./separator.mjs";
|
|
|
12
12
|
import B from "./decorators.mjs";
|
|
13
13
|
const g = /* @__PURE__ */ new Set();
|
|
14
14
|
function E() {
|
|
15
|
-
const [e, t] =
|
|
15
|
+
const [e, t] = I(!1), a = v((o) => {
|
|
16
16
|
t(o);
|
|
17
17
|
for (const r of g)
|
|
18
18
|
r(o);
|
|
19
19
|
}, []);
|
|
20
|
-
return
|
|
20
|
+
return b(() => {
|
|
21
21
|
const o = (r) => {
|
|
22
22
|
t(r);
|
|
23
23
|
};
|
|
@@ -29,6 +29,7 @@ function E() {
|
|
|
29
29
|
setIsKeyboardNavigating: a
|
|
30
30
|
}), [e, a]);
|
|
31
31
|
}
|
|
32
|
+
const se = "kakadu-components-3931722929";
|
|
32
33
|
function G({
|
|
33
34
|
label: e,
|
|
34
35
|
iconLeft: t,
|
|
@@ -36,7 +37,7 @@ function G({
|
|
|
36
37
|
href: o,
|
|
37
38
|
shouldCloseOnClick: r = !0,
|
|
38
39
|
decorators: k = [],
|
|
39
|
-
submenu:
|
|
40
|
+
submenu: l,
|
|
40
41
|
className: i,
|
|
41
42
|
onClick: s,
|
|
42
43
|
...f
|
|
@@ -45,14 +46,14 @@ function G({
|
|
|
45
46
|
isVisible: m,
|
|
46
47
|
isPreparingFocus: u,
|
|
47
48
|
isFocused: c,
|
|
48
|
-
close:
|
|
49
|
+
close: p
|
|
49
50
|
} = N(), {
|
|
50
51
|
isKeyboardNavigating: d
|
|
51
52
|
} = E(), j = A(!0), h = v(() => {
|
|
52
53
|
j.current = c;
|
|
53
|
-
}, [c]),
|
|
54
|
-
!d && !j.current || c && (s == null || s(S),
|
|
55
|
-
}, [d, c, s,
|
|
54
|
+
}, [c]), y = v((S) => {
|
|
55
|
+
!d && !j.current || c && (s == null || s(S), l ? l.show() : r && (p == null || p()));
|
|
56
|
+
}, [d, c, s, l, r, p]), w = 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-1567150544", c && "kakadu-components-3160069815", d ? "kakadu-components-2254977234" : c && "kakadu-components-278139688", i), onClick: y, onPointerDownCapture: h, children: [
|
|
56
57
|
/* @__PURE__ */ n.jsxs(M, { className: "kakadu-components-1109353535", children: [
|
|
57
58
|
t ? /* @__PURE__ */ n.jsx(P, { width: 12, height: 12, type: t }) : null,
|
|
58
59
|
/* @__PURE__ */ n.jsx("span", { className: "kakadu-components-913703148", children: e }),
|
|
@@ -62,8 +63,8 @@ function G({
|
|
|
62
63
|
/* @__PURE__ */ n.jsx(T, { isActive: c, size: 100 }),
|
|
63
64
|
/* @__PURE__ */ n.jsx(z, { isActive: c, size: 150, className: L })
|
|
64
65
|
] })
|
|
65
|
-
] }), [o, f, m, u, d, i,
|
|
66
|
-
return /* @__PURE__ */ n.jsx(B, { decorators: k, children:
|
|
66
|
+
] }), [o, f, m, u, d, i, y, h, t, e, a, c]);
|
|
67
|
+
return /* @__PURE__ */ n.jsx(B, { decorators: k, children: l ? /* @__PURE__ */ n.jsx(O, { menu: l.popoverMenu, className: "kakadu-components-1861176543", children: w }) : w });
|
|
67
68
|
}
|
|
68
69
|
function U(e) {
|
|
69
70
|
if ("type" in e) {
|
|
@@ -79,14 +80,14 @@ function q({
|
|
|
79
80
|
}) {
|
|
80
81
|
const {
|
|
81
82
|
isFocused: t
|
|
82
|
-
} = N(), [a, o] =
|
|
83
|
+
} = N(), [a, o] = I([]), {
|
|
83
84
|
setIsKeyboardNavigating: r
|
|
84
85
|
} = E(), k = v((i) => {
|
|
85
86
|
i && o((s) => s.includes(i) ? s : [...s, i]);
|
|
86
|
-
}, []),
|
|
87
|
+
}, []), l = v((i) => {
|
|
87
88
|
t && (i.currentTarget.focus(), r(!1));
|
|
88
89
|
}, [t, r]);
|
|
89
|
-
return
|
|
90
|
+
return b(() => {
|
|
90
91
|
if (!t)
|
|
91
92
|
return;
|
|
92
93
|
const i = (s) => {
|
|
@@ -95,14 +96,14 @@ function q({
|
|
|
95
96
|
return;
|
|
96
97
|
let u;
|
|
97
98
|
const c = document.activeElement;
|
|
98
|
-
let
|
|
99
|
-
switch (
|
|
99
|
+
let p = c ? f.indexOf(c) : -1;
|
|
100
|
+
switch (p === -1 && (p = 0), s.key) {
|
|
100
101
|
case "ArrowDown": {
|
|
101
|
-
u = (
|
|
102
|
+
u = (p + 1) % m;
|
|
102
103
|
break;
|
|
103
104
|
}
|
|
104
105
|
case "ArrowUp": {
|
|
105
|
-
u = (
|
|
106
|
+
u = (p - 1 + m) % m;
|
|
106
107
|
break;
|
|
107
108
|
}
|
|
108
109
|
case "Home": {
|
|
@@ -136,7 +137,7 @@ function q({
|
|
|
136
137
|
{
|
|
137
138
|
...i,
|
|
138
139
|
reference: k,
|
|
139
|
-
onMouseEnter:
|
|
140
|
+
onMouseEnter: l
|
|
140
141
|
},
|
|
141
142
|
s
|
|
142
143
|
)) });
|
|
@@ -147,7 +148,7 @@ function J({
|
|
|
147
148
|
}) {
|
|
148
149
|
return /* @__PURE__ */ n.jsx(D, { ...t, as: "nav", role: "menu", innerClassName: "kakadu-components-3600436535", children: /* @__PURE__ */ n.jsx(q, { items: e }) });
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
+
function ae(e) {
|
|
151
152
|
const t = x(() => ({
|
|
152
153
|
items: e
|
|
153
154
|
}), [e]), {
|
|
@@ -172,6 +173,7 @@ function O({
|
|
|
172
173
|
] });
|
|
173
174
|
}
|
|
174
175
|
export {
|
|
176
|
+
se as dangerPopoverMenuItemStyles,
|
|
175
177
|
O as default,
|
|
176
|
-
|
|
178
|
+
ae as usePopoverMenu
|
|
177
179
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AtomElementType, type AtomProperties } from './atom';
|
|
2
2
|
export declare function getDeterministicSkeletonWidth(a: number, b: number, { minimum, maximum }: {
|
|
3
3
|
readonly minimum: number;
|
|
4
4
|
readonly maximum: number;
|
|
@@ -9,8 +9,8 @@ type SkeletonProperties = {
|
|
|
9
9
|
readonly height?: string | number;
|
|
10
10
|
readonly className?: string;
|
|
11
11
|
readonly isAnimated?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare function SkeletonInstance({ label, width, height, className, children, isAnimated, ...
|
|
12
|
+
};
|
|
13
|
+
export declare function SkeletonInstance<Type extends AtomElementType = 'span'>({ as, label, width, height, className, children, isAnimated, ...properties }: SkeletonProperties & AtomProperties<Type>): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default function Skeleton({ label, lines, isDeterministic, isAnimated, }: {
|
|
15
15
|
readonly label?: string;
|
|
16
16
|
readonly lines?: 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 r=require("../jsx-runtime-BB_1_6y_.js"),l=require("react"),h=require("@kuma-ui/core"),d=require("./atom.js");function c(o,e,{minimum:t,maximum:s}){const a=o*374761393+e*668265263+2147483647,u=Math.imul(a,1274126177),n=s-t+1;return t+Math.abs(u)%n}function i({as:o,label:e,width:t,height:s,className:a,children:u,isAnimated:n=!0,...x}){return r.jsxRuntimeExports.jsx(d.default,{...x,as:o??"span","aria-label":e,className:h.cx("kakadu-components-4254676273",n&&"kakadu-components-574297718",a),style:{width:t,height:s},children:u??r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:" "})})}const m="kakadu-components-3140855657";function j({label:o,lines:e=1,isDeterministic:t=!1,isAnimated:s=!0}){const a=l.useMemo(()=>{const u=[];if(e<=1)return u;for(let n=1;n<e;n+=1)u.push(r.jsxRuntimeExports.jsx(i,{"aria-hidden":!0,width:t?`${c(n,e,{minimum:90,maximum:100})}%`:"100%",height:"1em",isAnimated:s,className:m},n));return u},[e,t,s]);return e<1?null:e===1?r.jsxRuntimeExports.jsx(i,{"aria-busy":!0,label:o,width:"100%",height:"1em",isAnimated:s,role:"status",className:m}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[a,r.jsxRuntimeExports.jsx(i,{"aria-busy":!0,label:o,width:t?`${c(e,e,{minimum:50,maximum:60})}%`:"60%",height:"1em",isAnimated:s,role:"status",className:m})]})}exports.SkeletonInstance=i;exports.default=j;exports.getDeterministicSkeletonWidth=c;
|
|
@@ -1,48 +1,50 @@
|
|
|
1
1
|
import { j as s } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
2
|
import { useMemo as l } from "react";
|
|
3
|
-
import { cx as
|
|
4
|
-
|
|
3
|
+
import { cx as f } from "@kuma-ui/core";
|
|
4
|
+
import d from "./atom.mjs";
|
|
5
|
+
function h(n, t, {
|
|
5
6
|
minimum: e,
|
|
6
7
|
maximum: r
|
|
7
8
|
}) {
|
|
8
|
-
const u =
|
|
9
|
-
return e + Math.abs(
|
|
9
|
+
const u = n * 374761393 + t * 668265263 + 2147483647, o = Math.imul(u, 1274126177), a = r - e + 1;
|
|
10
|
+
return e + Math.abs(o) % a;
|
|
10
11
|
}
|
|
11
12
|
function m({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
as: n,
|
|
14
|
+
label: t,
|
|
15
|
+
width: e,
|
|
16
|
+
height: r,
|
|
17
|
+
className: u,
|
|
18
|
+
children: o,
|
|
19
|
+
isAnimated: a = !0,
|
|
20
|
+
...i
|
|
19
21
|
}) {
|
|
20
|
-
return /* @__PURE__ */ s.jsx(
|
|
21
|
-
width:
|
|
22
|
-
height:
|
|
23
|
-
}, children:
|
|
22
|
+
return /* @__PURE__ */ s.jsx(d, { ...i, as: n ?? "span", "aria-label": t, className: f("kakadu-components-4254676273", a && "kakadu-components-574297718", u), style: {
|
|
23
|
+
width: e,
|
|
24
|
+
height: r
|
|
25
|
+
}, children: o ?? /* @__PURE__ */ s.jsx(s.Fragment, { children: " " }) });
|
|
24
26
|
}
|
|
25
27
|
const c = "kakadu-components-3140855657";
|
|
26
|
-
function
|
|
27
|
-
label:
|
|
28
|
+
function g({
|
|
29
|
+
label: n,
|
|
28
30
|
lines: t = 1,
|
|
29
31
|
isDeterministic: e = !1,
|
|
30
32
|
isAnimated: r = !0
|
|
31
33
|
}) {
|
|
32
34
|
const u = l(() => {
|
|
33
|
-
const
|
|
35
|
+
const o = [];
|
|
34
36
|
if (t <= 1)
|
|
35
|
-
return
|
|
37
|
+
return o;
|
|
36
38
|
for (let a = 1; a < t; a += 1)
|
|
37
|
-
|
|
39
|
+
o.push(/* @__PURE__ */ s.jsx(m, { "aria-hidden": !0, width: e ? `${h(a, t, {
|
|
38
40
|
minimum: 90,
|
|
39
41
|
maximum: 100
|
|
40
42
|
})}%` : "100%", height: "1em", isAnimated: r, className: c }, a));
|
|
41
|
-
return
|
|
43
|
+
return o;
|
|
42
44
|
}, [t, e, r]);
|
|
43
|
-
return t < 1 ? null : t === 1 ? /* @__PURE__ */ s.jsx(m, { "aria-busy": !0, label:
|
|
45
|
+
return t < 1 ? null : t === 1 ? /* @__PURE__ */ s.jsx(m, { "aria-busy": !0, label: n, width: "100%", height: "1em", isAnimated: r, role: "status", className: c }) : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
44
46
|
u,
|
|
45
|
-
/* @__PURE__ */ s.jsx(m, { "aria-busy": !0, label:
|
|
47
|
+
/* @__PURE__ */ s.jsx(m, { "aria-busy": !0, label: n, width: e ? `${h(t, t, {
|
|
46
48
|
minimum: 50,
|
|
47
49
|
maximum: 60
|
|
48
50
|
})}%` : "60%", height: "1em", isAnimated: r, role: "status", className: c })
|
|
@@ -50,6 +52,6 @@ function k({
|
|
|
50
52
|
}
|
|
51
53
|
export {
|
|
52
54
|
m as SkeletonInstance,
|
|
53
|
-
|
|
55
|
+
g as default,
|
|
54
56
|
h as getDeterministicSkeletonWidth
|
|
55
57
|
};
|