@kakadu/components 3.10.1 → 3.11.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.
@@ -11,9 +11,10 @@ type SkeletonProperties = {
11
11
  readonly isAnimated?: boolean;
12
12
  } & HTMLAttributes<HTMLDivElement>;
13
13
  export declare function SkeletonInstance({ label, width, height, className, children, isAnimated, ...parameters }: SkeletonProperties): import("react/jsx-runtime").JSX.Element;
14
- export default function Skeleton({ label, lines, isAnimated, }: {
14
+ export default function Skeleton({ label, lines, isDeterministic, isAnimated, }: {
15
15
  readonly label?: string;
16
16
  readonly lines?: number;
17
+ readonly isDeterministic?: boolean;
17
18
  readonly isAnimated?: boolean;
18
19
  }): import("react/jsx-runtime").JSX.Element | null;
19
20
  export {};
@@ -1 +1 @@
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
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),x=require("react"),l=require("@kuma-ui/core");function c(o,e,{minimum:t,maximum:s}){const a=o*374761393+e*668265263+2147483647,u=Math.imul(a,1274126177),r=s-t+1;return t+Math.abs(u)%r}function i({label:o,width:e,height:t,className:s,children:a,isAnimated:u=!0,...r}){return n.jsxRuntimeExports.jsx("span",{...r,"aria-label":o,className:l.cx("kakadu-components-4254676273",u&&"kakadu-components-574297718",s),style:{width:e,height:t},children:a??n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:" "})})}const m="kakadu-components-3140855657";function h({label:o,lines:e=1,isDeterministic:t=!1,isAnimated:s=!0}){const a=x.useMemo(()=>{const u=[];if(e<=1)return u;for(let r=1;r<e;r+=1)u.push(n.jsxRuntimeExports.jsx(i,{"aria-hidden":!0,width:t?`${c(r,e,{minimum:90,maximum:100})}%`:"100%",height:"1em",isAnimated:s,className:m},r));return u},[e,t,s]);return e<1?null:e===1?n.jsxRuntimeExports.jsx(i,{"aria-busy":!0,label:o,width:"100%",height:"1em",isAnimated:s,role:"status",className:m}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[a,n.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=h;exports.getDeterministicSkeletonWidth=c;
@@ -1,48 +1,55 @@
1
1
  import { j as s } from "../jsx-runtime-B4hRZ52C.mjs";
2
- import { useMemo as h } from "react";
3
- import { cx as l } from "@kuma-ui/core";
4
- function k(a, t, {
2
+ import { useMemo as l } from "react";
3
+ import { cx as i } from "@kuma-ui/core";
4
+ function h(o, t, {
5
5
  minimum: e,
6
- maximum: o
6
+ maximum: r
7
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;
8
+ const u = o * 374761393 + t * 668265263 + 2147483647, n = Math.imul(u, 1274126177), a = r - e + 1;
9
+ return e + Math.abs(n) % a;
10
10
  }
11
- function c({
12
- label: a,
11
+ function m({
12
+ label: o,
13
13
  width: t,
14
14
  height: e,
15
- className: o,
16
- children: r,
15
+ className: r,
16
+ children: u,
17
17
  isAnimated: n = !0,
18
- ...u
18
+ ...a
19
19
  }) {
20
- return /* @__PURE__ */ s.jsx("span", { ...u, "aria-label": a, className: l("kakadu-components-4254676273", n && "kakadu-components-574297718", o), style: {
20
+ return /* @__PURE__ */ s.jsx("span", { ...a, "aria-label": o, className: i("kakadu-components-4254676273", n && "kakadu-components-574297718", r), style: {
21
21
  width: t,
22
22
  height: e
23
- }, children: r ?? /* @__PURE__ */ s.jsx(s.Fragment, { children: " " }) });
23
+ }, children: u ?? /* @__PURE__ */ s.jsx(s.Fragment, { children: " " }) });
24
24
  }
25
- const i = "kakadu-components-3140855657";
26
- function p({
27
- label: a,
25
+ const c = "kakadu-components-3140855657";
26
+ function k({
27
+ label: o,
28
28
  lines: t = 1,
29
- isAnimated: e = !0
29
+ isDeterministic: e = !1,
30
+ isAnimated: r = !0
30
31
  }) {
31
- const o = h(() => {
32
- const r = [];
32
+ const u = l(() => {
33
+ const n = [];
33
34
  if (t <= 1)
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: [
40
- o,
41
- /* @__PURE__ */ s.jsx(c, { "aria-busy": !0, label: a, width: "60%", height: "1em", isAnimated: e, role: "status", className: i })
35
+ return n;
36
+ for (let a = 1; a < t; a += 1)
37
+ n.push(/* @__PURE__ */ s.jsx(m, { "aria-hidden": !0, width: e ? `${h(a, t, {
38
+ minimum: 90,
39
+ maximum: 100
40
+ })}%` : "100%", height: "1em", isAnimated: r, className: c }, a));
41
+ return n;
42
+ }, [t, e, r]);
43
+ return t < 1 ? null : t === 1 ? /* @__PURE__ */ s.jsx(m, { "aria-busy": !0, label: o, width: "100%", height: "1em", isAnimated: r, role: "status", className: c }) : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
44
+ u,
45
+ /* @__PURE__ */ s.jsx(m, { "aria-busy": !0, label: o, width: e ? `${h(t, t, {
46
+ minimum: 50,
47
+ maximum: 60
48
+ })}%` : "60%", height: "1em", isAnimated: r, role: "status", className: c })
42
49
  ] });
43
50
  }
44
51
  export {
45
- c as SkeletonInstance,
46
- p as default,
47
- k as getDeterministicSkeletonWidth
52
+ m as SkeletonInstance,
53
+ k as default,
54
+ h as getDeterministicSkeletonWidth
48
55
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kakadu/components",
3
- "version": "3.10.1",
3
+ "version": "3.11.0",
4
4
  "description": "Kakadu components library",
5
5
  "license": "MIT",
6
6
  "main": "./build/index.js",