aristid-ds 14.0.0-cdba7e7 → 14.0.0-e6e2929
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/CHANGELOG.md +8 -0
- package/dist/Kit/DataDisplay/Avatar/index.js +1 -1
- package/dist/Kit/DataDisplay/Avatar/types.d.ts +1 -0
- package/dist/Kit/DataDisplay/IdCard/index.js +56 -24
- package/dist/Kit/DataDisplay/IdCard/types.d.ts +1 -1
- package/dist/Kit/DataDisplay/Tag/index.js +10 -10
- package/dist/Kit/Navigation/Header/index.js +8 -8
- package/dist/assets/Avatar.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/chunks/Avatar.BvI60jet.js +47 -0
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/Avatar.N2w2jq_C.js +0 -30
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
- **AutoComplete**:
|
|
7
7
|
- Add `size` property to enable `small`, `middle` and `large` sizes (@fatb38)
|
|
8
8
|
|
|
9
|
+
- **Avatar**:
|
|
10
|
+
- Add new `size` options : `xs`, `s`, `m`, `l`, `xl` (@fatb38)
|
|
11
|
+
|
|
9
12
|
- **ColorPicker**:
|
|
10
13
|
- Add `size` property to enable `small`, `middle` and `large` sizes (@fatb38)
|
|
11
14
|
|
|
@@ -38,6 +41,11 @@
|
|
|
38
41
|
- **All components with a DropDown:**
|
|
39
42
|
- All components using a dropdown inside a `SidePanel` component, will render the dropdown inside the `SidePanel`, to avoid issues with the `closeOnOutsideClick` property of `SidePanel` (@evoiron)
|
|
40
43
|
|
|
44
|
+
- **⚠️ Breaking change - IdCard**:
|
|
45
|
+
- Replacing `size` options (@fatb38)
|
|
46
|
+
- removing `medium` and `large`
|
|
47
|
+
- adding `xs-medium`, `xs-bold`, `s`, `m`, `l`, `xl`
|
|
48
|
+
|
|
41
49
|
### 🐛 Bug Fixes
|
|
42
50
|
|
|
43
51
|
- **Modal:**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as t, K as n } from "../../../chunks/Avatar.
|
|
1
|
+
import { s as t, K as n } from "../../../chunks/Avatar.BvI60jet.js";
|
|
2
2
|
import { jsx as u } from "react/jsx-runtime";
|
|
3
3
|
import { Avatar as c } from "antd";
|
|
4
4
|
import { u as d } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
|
|
@@ -1,37 +1,69 @@
|
|
|
1
1
|
import "../../../assets/index2.css";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as y, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import n from "classnames";
|
|
4
|
-
import { t as
|
|
5
|
-
import { u as
|
|
6
|
-
import { K as
|
|
7
|
-
import { KitTooltip as
|
|
8
|
-
import { T as
|
|
9
|
-
const
|
|
10
|
-
"kit-id-card": "_kit-id-
|
|
11
|
-
},
|
|
12
|
-
|
|
4
|
+
import { t as S } from "../../../chunks/styles.module.shsViPAW.js";
|
|
5
|
+
import { u as T } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
|
|
6
|
+
import { K as v } from "../../../chunks/Avatar.BvI60jet.js";
|
|
7
|
+
import { KitTooltip as d } from "../Tooltip/index.js";
|
|
8
|
+
import { T as h } from "../../../chunks/constants.DINGxt3I.js";
|
|
9
|
+
const D = {
|
|
10
|
+
"kit-id-card": "_kit-id-card_1vabr_2"
|
|
11
|
+
}, m = [
|
|
12
|
+
S["kit-typography-text"],
|
|
13
13
|
"ant-typography",
|
|
14
14
|
"ant-typography-text",
|
|
15
15
|
"ant-typography-ellipsis",
|
|
16
16
|
"ant-typography-ellipsis-single-line"
|
|
17
|
-
],
|
|
18
|
-
|
|
19
|
-
"
|
|
17
|
+
], z = (t) => {
|
|
18
|
+
switch (t) {
|
|
19
|
+
case "xl":
|
|
20
|
+
return "kit-typography-fontSize5";
|
|
21
|
+
case "l":
|
|
22
|
+
return "kit-typography-fontSize6";
|
|
23
|
+
default:
|
|
24
|
+
return "kit-typography-fontSize7";
|
|
25
|
+
}
|
|
26
|
+
}, N = (t) => {
|
|
27
|
+
switch (t) {
|
|
28
|
+
case "xl":
|
|
29
|
+
return "kit-typography-fontSize1";
|
|
30
|
+
case "l":
|
|
31
|
+
return "kit-typography-fontSize2";
|
|
32
|
+
case "m":
|
|
33
|
+
return "kit-typography-fontSize3";
|
|
34
|
+
case "s":
|
|
35
|
+
return "kit-typography-fontSize4";
|
|
36
|
+
case "xs-bold":
|
|
37
|
+
case "xs-medium":
|
|
38
|
+
return "kit-typography-fontSize5";
|
|
39
|
+
}
|
|
40
|
+
}, _ = (t) => {
|
|
41
|
+
switch (t) {
|
|
42
|
+
case "xl":
|
|
43
|
+
case "l":
|
|
44
|
+
return "xl";
|
|
45
|
+
case "m":
|
|
46
|
+
case "s":
|
|
47
|
+
return "l";
|
|
48
|
+
default:
|
|
49
|
+
return "m";
|
|
50
|
+
}
|
|
51
|
+
}, E = (t, r, a, i) => {
|
|
52
|
+
const s = n("kit-id-card-title", ...m, N(r), {
|
|
53
|
+
"ant-typography-bold": r !== "xs-medium",
|
|
20
54
|
"ant-typography-disabled": a
|
|
21
55
|
});
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
const s = n("kit-id-card-description", ...
|
|
25
|
-
"kit-typography-fontSize5": t !== "medium",
|
|
26
|
-
"kit-typography-fontSize7": t === "medium",
|
|
56
|
+
return e("span", { className: s, children: e(d, { title: i ? "" : t, mouseEnterDelay: h, children: e("span", { children: t }) }) });
|
|
57
|
+
}, K = (t, r, a, i) => {
|
|
58
|
+
const s = n("kit-id-card-description", ...m, "ant-typography-regular", z(r), {
|
|
27
59
|
"ant-typography-disabled": a
|
|
28
60
|
});
|
|
29
|
-
return
|
|
30
|
-
},
|
|
31
|
-
const { appId:
|
|
32
|
-
return
|
|
61
|
+
return e("span", { className: s, children: e(d, { title: i ? "" : t, mouseEnterDelay: h, children: e("span", { children: t }) }) });
|
|
62
|
+
}, I = ({ className: t, title: r, description: a, avatarProps: i, size: s = "xs-bold", disabled: o = !1, disableTooltip: p = !1, ...g }) => {
|
|
63
|
+
const { appId: u } = T(), f = n(u, D["kit-id-card"], t), x = i !== void 0, c = r !== void 0, l = a !== void 0, k = c || l;
|
|
64
|
+
return y("div", { className: `${f} id-card-grid`, ...g, children: [x && e("div", { className: "card-avatar", children: e(v, { ...i, size: _(s), disabled: o }) }), k && y("div", { className: "card-info", children: [c && typeof r == "string" ? E(r, s, o, p) : r, l && typeof a == "string" ? K(a, s, o, p) : a] })] });
|
|
33
65
|
};
|
|
34
|
-
|
|
66
|
+
I.displayName = "KitIdCard";
|
|
35
67
|
export {
|
|
36
|
-
|
|
68
|
+
I as KitIdCard
|
|
37
69
|
};
|
|
@@ -4,7 +4,7 @@ import {IKitAvatar} from '../Avatar/types';
|
|
|
4
4
|
|
|
5
5
|
export interface IKitIdCard extends KitHTMLAttributes<HTMLDivElement> {
|
|
6
6
|
avatarProps?: IKitAvatar;
|
|
7
|
-
size?: 'medium' | '
|
|
7
|
+
size?: 'xs-medium' | 'xs-bold' | 's' | 'm' | 'l' | 'xl';
|
|
8
8
|
title?: ReactNode;
|
|
9
9
|
description?: ReactNode;
|
|
10
10
|
disabled?: boolean;
|
|
@@ -16,20 +16,20 @@ const I = {
|
|
|
16
16
|
"kit-tag-group": "_kit-tag-group_6ocqb_111",
|
|
17
17
|
"kit-tag-group-measure": "_kit-tag-group-measure_6ocqb_117",
|
|
18
18
|
"kit-tag-group-container": "_kit-tag-group-container_6ocqb_124"
|
|
19
|
-
}, h = D(({ className: r, closeIcon: s, type:
|
|
19
|
+
}, h = D(({ className: r, closeIcon: s, type: c = "neutral", disabled: i, disableTooltip: a = !1, onClick: p, idCardProps: o, ...d }, u) => {
|
|
20
20
|
const { appId: b } = x(), _ = $(b, I["kit-tag"], r, {
|
|
21
|
-
[`kit-tag-${
|
|
21
|
+
[`kit-tag-${c}`]: c,
|
|
22
22
|
"kit-tag-disabled": i,
|
|
23
23
|
"kit-tag-clickable": p
|
|
24
24
|
});
|
|
25
|
-
return t(z, { tabIndex: i ? M : R, ref: u, ...d, className: _, closeIcon: s ?? t(P, { icon: X }), onClick: p, closable: !!d.onClose, children: t(j, { disabled: i, disableTooltip:
|
|
26
|
-
}), H = ({ tags: r, containerRef: s, measureRef:
|
|
27
|
-
var
|
|
25
|
+
return t(z, { tabIndex: i ? M : R, ref: u, ...d, className: _, closeIcon: s ?? t(P, { icon: X }), onClick: p, closable: !!d.onClose, children: t(j, { disabled: i, disableTooltip: a, avatarProps: o != null && o.avatarProps ? { ...o == null ? void 0 : o.avatarProps, size: "s" } : void 0, description: o == null ? void 0 : o.description }) });
|
|
26
|
+
}), H = ({ tags: r, containerRef: s, measureRef: c, handleCloseTag: i }) => {
|
|
27
|
+
var a;
|
|
28
28
|
const [p, o] = G([]), [d, u] = G(0), [b, _] = G(t(E, {})), v = O(null), { locale: T } = F();
|
|
29
29
|
return L(() => {
|
|
30
30
|
const K = () => {
|
|
31
31
|
var k, g, e;
|
|
32
|
-
const l = s.current, f =
|
|
32
|
+
const l = s.current, f = c.current;
|
|
33
33
|
if (!l || !f)
|
|
34
34
|
return;
|
|
35
35
|
_(W(E, { children: [r.map((n, y) => t(h, { type: n == null ? void 0 : n.type, disabled: n == null ? void 0 : n.disabled, idCardProps: n.idCardProps, onClose: () => {
|
|
@@ -53,20 +53,20 @@ const I = {
|
|
|
53
53
|
return K(), v.current = new ResizeObserver(N), s.current && v.current.observe(s.current), () => {
|
|
54
54
|
v.current && v.current.disconnect(), clearTimeout(m);
|
|
55
55
|
};
|
|
56
|
-
}, [s, i, d, (
|
|
56
|
+
}, [s, i, d, (a = T.General) === null || a === void 0 ? void 0 : a.others, c, r]), {
|
|
57
57
|
measureTags: b,
|
|
58
58
|
visibleTags: p,
|
|
59
59
|
hiddenCount: d
|
|
60
60
|
};
|
|
61
|
-
}, J = ({ tags: r, style: s, className:
|
|
61
|
+
}, J = ({ tags: r, style: s, className: c, handleCloseTag: i, othersTagType: a = "neutral", othersTagDisabled: p }) => {
|
|
62
62
|
var o;
|
|
63
63
|
const d = O(null), u = O(null), { locale: b } = F(), { appId: _ } = x(), [v, T] = G(!1), { measureTags: K, visibleTags: m, hiddenCount: N } = H({ tags: r, containerRef: d, measureRef: u, handleCloseTag: i }), k = () => r.slice(m.length).map((e, l) => {
|
|
64
64
|
var f;
|
|
65
65
|
return t("div", { children: (f = e.idCardProps) === null || f === void 0 ? void 0 : f.description }, l);
|
|
66
|
-
}), g = $(_, I["kit-tag-group"],
|
|
66
|
+
}), g = $(_, I["kit-tag-group"], c);
|
|
67
67
|
return W("div", { className: I["kit-tag-group-container"], children: [W("div", { ref: d, style: s, className: g, children: [m.map((e, l) => t(h, { type: e == null ? void 0 : e.type, disabled: e == null ? void 0 : e.disabled, idCardProps: e.idCardProps, onClose: i ? () => {
|
|
68
68
|
i(l);
|
|
69
|
-
} : void 0 }, l)), N > 0 && t(V, { overlay: k(), children: t(h, { type:
|
|
69
|
+
} : void 0 }, l)), N > 0 && t(V, { overlay: k(), children: t(h, { type: a, disabled: p, disableTooltip: !0, idCardProps: { description: `+${N} ${(o = b.General) === null || o === void 0 ? void 0 : o.others}` }, onClick: () => T(!0) }) }), t(U, { isOpen: v, close: () => T(!1), showCloseIcon: !0, title: "Tags", appElement: document.body, children: t("div", { style: { display: "flex", flexWrap: "wrap", rowGap: "8px" }, children: r.map((e, l) => t(h, { id: `tag-${l}`, type: e == null ? void 0 : e.type, disabled: e == null ? void 0 : e.disabled, idCardProps: e.idCardProps, onClose: i ? () => {
|
|
70
70
|
i(l);
|
|
71
71
|
} : void 0 }, l)) }) })] }), t("div", { ref: u, className: I["kit-tag-group-measure"], "aria-hidden": "true", children: K })] });
|
|
72
72
|
}, Q = J, S = h;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../assets/index34.css";
|
|
2
2
|
import { jsxs as h, jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { u } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
|
|
4
|
-
import
|
|
4
|
+
import _ from "classnames";
|
|
5
5
|
import { KitDropDown as x } from "../DropDown/index.js";
|
|
6
6
|
import { FontAwesomeIcon as O } from "@fortawesome/react-fontawesome";
|
|
7
7
|
import { faGrip as q } from "@fortawesome/free-solid-svg-icons";
|
|
@@ -9,13 +9,13 @@ import { getContrastColor as F } from "../../../utils/functions/index.js";
|
|
|
9
9
|
import { F as I } from "../../../chunks/constants.DINGxt3I.js";
|
|
10
10
|
import { useState as H } from "react";
|
|
11
11
|
import { KitTag as P } from "../../DataDisplay/Tag/index.js";
|
|
12
|
-
import { KitIdCard as
|
|
12
|
+
import { KitIdCard as g } from "../../DataDisplay/IdCard/index.js";
|
|
13
13
|
const R = {
|
|
14
14
|
"kit-header": "_kit-header_4hqaz_2"
|
|
15
15
|
}, T = (a) => ({
|
|
16
16
|
"--kit-header-invert-color": F(a)
|
|
17
17
|
}), j = ({ className: a, children: l, menu: s, logo: e, langSwitcher: o, profile: m, ...i }) => {
|
|
18
|
-
const { appId: p, theme: v } = u(), d =
|
|
18
|
+
const { appId: p, theme: v } = u(), d = _(p, R["kit-header"], {
|
|
19
19
|
"with-menu": s,
|
|
20
20
|
"with-logo": e,
|
|
21
21
|
"with-profile": m,
|
|
@@ -24,10 +24,10 @@ const R = {
|
|
|
24
24
|
return h("div", { style: k, ...i, className: d, children: [s && t(x, { dropdownRender: f, children: t("div", { className: "kit-header-menu", tabIndex: I, children: t(O, { icon: q }) }) }), e && t("div", { className: "kit-header-logo", children: e }), t("div", { className: "kit-header-content", children: l }), h("div", { className: "kit-header-right-items", children: [m, o && t("div", { className: "kit-header-lang", children: o })] })] });
|
|
25
25
|
}, z = ({ logo: a, tagProps: l, profileCardProps: s, profileMenuCardProps: e, complement: o, className: m, menu: i = null, alt: p = "", ...v }) => {
|
|
26
26
|
var d;
|
|
27
|
-
const { appId: f } = u(), [k, K] = H(!1), b =
|
|
27
|
+
const { appId: f } = u(), [k, K] = H(!1), b = _(f, "kit-header-profile", {
|
|
28
28
|
"with-menu": i,
|
|
29
29
|
open: k
|
|
30
|
-
}, m), y =
|
|
30
|
+
}, m), y = _("kit-header-profile-menu-card", {
|
|
31
31
|
clickable: e == null ? void 0 : e.onClick
|
|
32
32
|
}, e == null ? void 0 : e.className), n = s;
|
|
33
33
|
n && n.avatarProps && (n.avatarProps.shape = "square");
|
|
@@ -35,8 +35,8 @@ const R = {
|
|
|
35
35
|
...e,
|
|
36
36
|
className: y
|
|
37
37
|
};
|
|
38
|
-
c && c.avatarProps && (c.avatarProps.shape = "square", c.avatarProps.size = "
|
|
39
|
-
const N = i && i.items, A = (r) => h("div", { className: "kit-header-menu-wrapper", children: [e && t(
|
|
38
|
+
c && c.avatarProps && (c.avatarProps.shape = "square", c.avatarProps.size = "l");
|
|
39
|
+
const N = i && i.items, A = (r) => h("div", { className: "kit-header-menu-wrapper", children: [e && t(g, { ...c }), i && !N && t("div", { role: "separator", className: "ant-dropdown-menu-item-divider" }), N ? r : i] }), w = {
|
|
40
40
|
disabled: !i,
|
|
41
41
|
placement: "bottomRight",
|
|
42
42
|
onOpenChange: (r) => {
|
|
@@ -52,7 +52,7 @@ const R = {
|
|
|
52
52
|
...(d = r.items) !== null && d !== void 0 ? d : []
|
|
53
53
|
]), w.menu = r;
|
|
54
54
|
}
|
|
55
|
-
return t(x, { ...w, children: h("div", { className: b, tabIndex: I, ...v, children: [a && t("img", { className: "kit-header-profile-logo", src: a, alt: p }), l && t(P, { className: "kit-header-profile-tag", ...l }), n && t(
|
|
55
|
+
return t(x, { ...w, children: h("div", { className: b, tabIndex: I, ...v, children: [a && t("img", { className: "kit-header-profile-logo", src: a, alt: p }), l && t(P, { className: "kit-header-profile-tag", ...l }), n && t(g, { ...n }), o && t("div", { className: "kit-header-profile-complement", children: o })] }) });
|
|
56
56
|
}, B = z, D = j;
|
|
57
57
|
D.Profile = B;
|
|
58
58
|
D.displayName = "KitHeader";
|
package/dist/assets/Avatar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! Sass Fairy v1 | (c) roydukkey | https://sass-fairy.com/license */._kit-
|
|
1
|
+
/*! Sass Fairy v1 | (c) roydukkey | https://sass-fairy.com/license */._kit-avatar_22tfj_2{background:var(--general-utilities-main-light)}._kit-avatar_22tfj_2:not(.ant-avatar-image){background:var(--components-Avatar-colors-background-default, var(--general-utilities-main-light));color:var(--components-Avatar-colors-typography-default, var(--general-utilities-main-medium))}._kit-avatar_22tfj_2.kit-avatar-image-fit-cover img{object-fit:cover}._kit-avatar_22tfj_2.kit-avatar-image-fit-contain img{object-fit:contain}._kit-avatar_22tfj_2.kit-avatar-image-fit-fill img{object-fit:fill}._kit-avatar_22tfj_2.ant-avatar-square:not(.kit-avatar-size-xs){border-radius:calc(var(--general-border-radius-s) * 1px)}._kit-avatar-disabled_22tfj_22{--mask-color: #8db1c880}._kit-avatar-disabled_22tfj_22.ant-avatar-icon,._kit-avatar-disabled_22tfj_22.kit-avatar-image-fit-cover,._kit-avatar-disabled_22tfj_22{color:var(--general-utilities-disabled);background-color:var(--general-utilities-neutral-medium)}._kit-avatar-disabled_22tfj_22.ant-avatar-image:after{content:"";z-index:0;position:absolute;top:0;right:0;bottom:0;left:0;background:var(--mask-color)}._kit-avatar-group_22tfj_44.override-last>span:last-child{background:var(--components-AvatarGroup-colors-background-default, var(--general-utilities-main-light));color:var(--components-AvatarGroup-colors-typography-default, var(--components-AvatarGroup-colors-background-default, var(--general-utilities-main-medium)))}._kit-avatar-group_22tfj_44 .ant-avatar{box-shadow:var(--general-utilities-shadow-light)}._kit-avatar-group-disabled_22tfj_52.override-last>span:last-child{color:var(--general-utilities-disabled);background-color:var(--general-utilities-neutral-medium)}
|
package/dist/assets/index2.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! Sass Fairy v1 | (c) roydukkey | https://sass-fairy.com/license */._kit-id-
|
|
1
|
+
/*! Sass Fairy v1 | (c) roydukkey | https://sass-fairy.com/license */._kit-id-card_1vabr_2.id-card-grid{display:grid;grid-template-columns:min-content auto;grid-template-areas:"avatar info"}._kit-id-card_1vabr_2.id-card-grid:has(.card-avatar):has(.card-info){column-gap:calc(var(--general-spacing-xs) * 1px)}._kit-id-card_1vabr_2.id-card-grid .card-avatar{grid-area:avatar;align-self:center}._kit-id-card_1vabr_2.id-card-grid .card-info{grid-area:info;gap:2px;display:flex;flex-direction:column;align-self:center;overflow:hidden}._kit-id-card_1vabr_2.id-card-grid .card-info .kit-id-card-title,._kit-id-card_1vabr_2.id-card-grid .card-info .kit-id-card-description,._kit-id-card_1vabr_2.id-card-grid .card-info .kit-id-card-title span,._kit-id-card_1vabr_2.id-card-grid .card-info .kit-id-card-description span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import "../assets/Avatar.css";
|
|
2
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as _ } from "react";
|
|
4
|
+
import { Avatar as C } from "antd";
|
|
5
|
+
import { u as x } from "./useKitTheme.KSAU-Pdv.js";
|
|
6
|
+
import { getInitials as y, isValidColor as b, getColor as h, isPrimaryColor as j, isSecondaryColor as A, isTertiaryColor as K, getLighterColor as S, getContrastColor as T } from "../utils/functions/index.js";
|
|
7
|
+
import { kitAvatarCssTokens as n } from "../theme/aristid/components/DataDisplay/Avatar/index.js";
|
|
8
|
+
import z from "classnames";
|
|
9
|
+
const m = {
|
|
10
|
+
"kit-avatar": "_kit-avatar_22tfj_2",
|
|
11
|
+
"kit-avatar-disabled": "_kit-avatar-disabled_22tfj_22",
|
|
12
|
+
"kit-avatar-group": "_kit-avatar-group_22tfj_44",
|
|
13
|
+
"kit-avatar-group-disabled": "_kit-avatar-group-disabled_22tfj_52"
|
|
14
|
+
}, N = (t, a) => !t || !b(t) ? null : {
|
|
15
|
+
[n.colors.background.default]: h(t, a),
|
|
16
|
+
[n.colors.typography.default]: j(t) || A(t) || K(t) ? S(t, a) : T(t)
|
|
17
|
+
}, w = (t) => {
|
|
18
|
+
switch (t) {
|
|
19
|
+
case "xl":
|
|
20
|
+
return 48;
|
|
21
|
+
case "l":
|
|
22
|
+
return 40;
|
|
23
|
+
case "m":
|
|
24
|
+
case void 0:
|
|
25
|
+
return 32;
|
|
26
|
+
case "s":
|
|
27
|
+
return 24;
|
|
28
|
+
case "xs":
|
|
29
|
+
return 16;
|
|
30
|
+
default:
|
|
31
|
+
return t;
|
|
32
|
+
}
|
|
33
|
+
}, L = ({ label: t, initialsMaxChars: a, color: i, className: l, style: s, secondaryColorInvert: e = !1, children: u, disabled: v, imageFit: r = "cover", size: o, ...f }) => {
|
|
34
|
+
const { appId: c } = x(), d = w(o), p = _(() => ({ ...s, ...N(i, e) }), [i, e, s]), k = z(c, m["kit-avatar"], l, {
|
|
35
|
+
"kit-avatar-size-xs": o === "xs",
|
|
36
|
+
"kit-avatar-image-fit-cover": r === "cover",
|
|
37
|
+
"kit-avatar-image-fit-contain": r === "contain",
|
|
38
|
+
"kit-avatar-image-fit-fill": r === "fill",
|
|
39
|
+
[m["kit-avatar-disabled"]]: v
|
|
40
|
+
});
|
|
41
|
+
return g(C, { style: p, className: k, ...f, size: d, children: t !== void 0 ? y(t, a) : u });
|
|
42
|
+
};
|
|
43
|
+
L.displayName = "KitAvatar";
|
|
44
|
+
export {
|
|
45
|
+
L as K,
|
|
46
|
+
m as s
|
|
47
|
+
};
|