@kakadu/components 6.14.1 → 6.16.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/avatar.d.ts +13 -0
- package/build/components/avatar.js +1 -0
- package/build/components/avatar.mjs +47 -0
- package/build/components/button-tooltip.js +1 -1
- package/build/components/button-tooltip.mjs +6 -6
- package/build/components/code.d.ts +3 -1
- package/build/components/code.js +4 -4
- package/build/components/code.mjs +367 -363
- package/build/components/input.d.ts +1 -0
- package/build/components/input.js +2 -2
- package/build/components/input.mjs +2 -1
- package/build/components/modal.js +1 -1
- package/build/components/modal.mjs +1 -1
- package/build/components/popover.js +1 -1
- package/build/components/popover.mjs +1 -1
- package/build/components/theme-setter.d.ts +1 -1
- package/build/components.css +1 -1
- package/build/focus-trap-react-4An60CdH.js +9 -0
- package/build/{focus-trap-react-D4ushEjf.mjs → focus-trap-react-Df_V17Wb.mjs} +259 -261
- package/build/hooks/use-local-storage.js +1 -1
- package/build/hooks/use-local-storage.mjs +60 -70
- package/build/index.d.ts +4 -0
- package/build/index.js +1 -1
- package/build/index.mjs +271 -266
- package/build/utilities/string-to-hex-color.d.ts +3 -0
- package/build/utilities/string-to-hex-color.js +1 -0
- package/build/utilities/string-to-hex-color.mjs +24 -0
- package/package.json +10 -10
- package/build/focus-trap-react-D0ZxGVUk.js +0 -9
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { type HTMLProps } from 'react';
|
|
2
|
+
export type AvatarProperties = Omit<HTMLProps<HTMLDivElement>, 'name' | 'size'> & {
|
|
3
|
+
readonly isSkeleton?: boolean;
|
|
4
|
+
readonly isSkeletonAnimated?: boolean;
|
|
5
|
+
readonly size?: number;
|
|
6
|
+
} & ({
|
|
7
|
+
readonly name?: string;
|
|
8
|
+
readonly initials?: never;
|
|
9
|
+
} | {
|
|
10
|
+
readonly initials?: string;
|
|
11
|
+
readonly name?: never;
|
|
12
|
+
});
|
|
13
|
+
export default function Avatar({ isSkeleton, isSkeletonAnimated, size, initials: inputInitials, name, onClick, className, children, style, ...properties }: AvatarProperties): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../jsx-runtime-CZa898vN.js"),b=require("react"),l=require("@kuma-ui/core"),h=require("../utilities/string-to-hex-color.js"),c=require("../theme.js"),q=require("./atom.js"),g=require("./skeleton.js"),y=require("./button-tooltip.js");function R({isSkeleton:d,isSkeletonAnimated:x,size:r=24,initials:o,name:e,onClick:t,className:m,children:p,style:f,...j}){const n=b.useMemo(()=>{if(o)return o;if(e){const i=e.trim();if(i){const u=i.split(/\s+/);return u.length>1?`${u[0][0]}${u[1][0]}`.toUpperCase():i.slice(0,2).toUpperCase()}}return"?"},[o,e]),a=o??e??"",v=t&&e;return s.jsxRuntimeExports.jsx("div",{...j,style:{"--size":`${r}px`,"--border-radius":"var(--size)",...f},className:l.cx("kakadu-components-2703973972",m),children:d?s.jsxRuntimeExports.jsx(g.SkeletonInstance,{width:r,height:r,isAnimated:x}):s.jsxRuntimeExports.jsxs(q.default,{as:t?"button":"div",type:t?"button":void 0,role:t?void 0:"img","aria-label":n==="?"?"Unknown":e??(t?void 0:n),style:{backgroundColor:a?h.default(a):void 0},className:l.cx(c.buttonResetStyles,c.overlayEffectStyles,"kakadu-components-1744768831",!t&&"kakadu-components-3156772819"),onClick:t,children:[v?s.jsxRuntimeExports.jsx(y.default,{label:e}):null,s.jsxRuntimeExports.jsx("span",{children:n}),p]})})}exports.default=R;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { j as r } from "../jsx-runtime-z6PQ6F3d.mjs";
|
|
2
|
+
import { useMemo as h } from "react";
|
|
3
|
+
import { cx as d } from "@kuma-ui/core";
|
|
4
|
+
import b from "../utilities/string-to-hex-color.mjs";
|
|
5
|
+
import { buttonResetStyles as j, overlayEffectStyles as g } from "../theme.mjs";
|
|
6
|
+
import y from "./atom.mjs";
|
|
7
|
+
import { SkeletonInstance as k } from "./skeleton.mjs";
|
|
8
|
+
import A from "./button-tooltip.mjs";
|
|
9
|
+
function B({
|
|
10
|
+
isSkeleton: p,
|
|
11
|
+
isSkeletonAnimated: l,
|
|
12
|
+
size: s = 24,
|
|
13
|
+
initials: e,
|
|
14
|
+
name: t,
|
|
15
|
+
onClick: o,
|
|
16
|
+
className: f,
|
|
17
|
+
children: u,
|
|
18
|
+
style: c,
|
|
19
|
+
...x
|
|
20
|
+
}) {
|
|
21
|
+
const i = h(() => {
|
|
22
|
+
if (e)
|
|
23
|
+
return e;
|
|
24
|
+
if (t) {
|
|
25
|
+
const a = t.trim();
|
|
26
|
+
if (a) {
|
|
27
|
+
const m = a.split(/\s+/);
|
|
28
|
+
return m.length > 1 ? `${m[0][0]}${m[1][0]}`.toUpperCase() : a.slice(0, 2).toUpperCase();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return "?";
|
|
32
|
+
}, [e, t]), n = e ?? t ?? "", v = o && t;
|
|
33
|
+
return /* @__PURE__ */ r.jsx("div", { ...x, style: {
|
|
34
|
+
"--size": `${s}px`,
|
|
35
|
+
"--border-radius": "var(--size)",
|
|
36
|
+
...c
|
|
37
|
+
}, className: d("kakadu-components-2703973972", f), children: p ? /* @__PURE__ */ r.jsx(k, { width: s, height: s, isAnimated: l }) : /* @__PURE__ */ r.jsxs(y, { as: o ? "button" : "div", type: o ? "button" : void 0, role: o ? void 0 : "img", "aria-label": i === "?" ? "Unknown" : t ?? (o ? void 0 : i), style: {
|
|
38
|
+
backgroundColor: n ? b(n) : void 0
|
|
39
|
+
}, className: d(j, g, "kakadu-components-1744768831", !o && "kakadu-components-3156772819"), onClick: o, children: [
|
|
40
|
+
v ? /* @__PURE__ */ r.jsx(A, { label: t }) : null,
|
|
41
|
+
/* @__PURE__ */ r.jsx("span", { children: i }),
|
|
42
|
+
u
|
|
43
|
+
] }) });
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
B as default
|
|
47
|
+
};
|
|
@@ -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-CZa898vN.js"),u=require("@kuma-ui/core"),a=["top","bottom"];function c({id:t,label:e,position:o="top",className:n}){return s.jsxRuntimeExports.jsx("div",{id:t,"aria-label":t?e:void 0,role:"tooltip",className:u.cx("kakadu-components-3121583645",o==="top"&&"kakadu-components-430823771",o==="bottom"&&"kakadu-components-2189175034",n),children:s.jsxRuntimeExports.jsx("span",{className:u.cx("kakadu-components-3787062640",o==="top"&&"kakadu-components-2481216458",o==="bottom"&&"kakadu-components-637471806",n),children:e})})}exports.buttonTooltipPositions=a;exports.default=c;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { cx as
|
|
1
|
+
import { j as m } from "../jsx-runtime-z6PQ6F3d.mjs";
|
|
2
|
+
import { cx as p } from "@kuma-ui/core";
|
|
3
3
|
const c = ["top", "bottom"];
|
|
4
4
|
function k({
|
|
5
|
-
id:
|
|
6
|
-
label:
|
|
5
|
+
id: t,
|
|
6
|
+
label: a,
|
|
7
7
|
position: o = "top",
|
|
8
|
-
className:
|
|
8
|
+
className: n
|
|
9
9
|
}) {
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ m.jsx("div", { id: t, "aria-label": t ? a : void 0, role: "tooltip", className: p("kakadu-components-3121583645", o === "top" && "kakadu-components-430823771", o === "bottom" && "kakadu-components-2189175034", n), children: /* @__PURE__ */ m.jsx("span", { className: p("kakadu-components-3787062640", o === "top" && "kakadu-components-2481216458", o === "bottom" && "kakadu-components-637471806", n), children: a }) });
|
|
11
11
|
}
|
|
12
12
|
export {
|
|
13
13
|
c as buttonTooltipPositions,
|
|
@@ -8,12 +8,14 @@ type CodeProperties = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
|
8
8
|
readonly isBlock?: false;
|
|
9
9
|
readonly isSkeleton?: undefined;
|
|
10
10
|
readonly isSkeletonAnimated?: undefined;
|
|
11
|
+
readonly label?: undefined;
|
|
11
12
|
readonly footnote?: undefined;
|
|
12
13
|
} | {
|
|
13
14
|
readonly isBlock: true;
|
|
14
15
|
readonly isSkeleton?: boolean;
|
|
15
16
|
readonly isSkeletonAnimated?: boolean;
|
|
17
|
+
readonly label?: ReactNode;
|
|
16
18
|
readonly footnote?: ReactNode;
|
|
17
19
|
});
|
|
18
|
-
export default function Code({ language, footnote, isBlock, isSkeleton, isSkeletonAnimated, children, className, innerClassName, ...properties }: CodeProperties): React.JSX.Element;
|
|
20
|
+
export default function Code({ language, label, footnote, isBlock, isSkeleton, isSkeletonAnimated, children, className, innerClassName, ...properties }: CodeProperties): React.JSX.Element;
|
|
19
21
|
export {};
|