sate-lib 1.6.0 → 1.7.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
export declare function getInitials(name?: string): string;
|
|
3
|
-
type AvatarSize = "small" | "medium" | "large";
|
|
3
|
+
type AvatarSize = "small" | "medium" | "large" | "xLarge";
|
|
4
4
|
type AvatarShape = "circle" | "rounded" | "map";
|
|
5
5
|
export interface AvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
src?: string;
|
|
@@ -8,6 +8,7 @@ export interface AvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
8
8
|
name?: string;
|
|
9
9
|
size?: AvatarSize;
|
|
10
10
|
shape?: AvatarShape;
|
|
11
|
+
border?: boolean;
|
|
11
12
|
}
|
|
12
|
-
export declare function Avatar({ src, alt, name, size, shape, className, ...rest }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function Avatar({ src, alt, name, size, shape, border, className, ...rest }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useState as r}from"react";import t from"./avatar.styles.module.js";function a(e){if(!e)return"";let r=e.trim().replace(/\s+/g," "),t=r.includes(" ")?r.split(" "):r.split(/(?=[A-Z])/);return 0===(t=t.filter(Boolean)).length?"":1===t.length?t[0].substring(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function l({src:l,alt:i,name:o,size:n="medium",shape:s="circle",border:m=!1,className:c,...d}){let[g,p]=r(!1);return e("div",{className:[t.root,t[n],t[s],m&&t.border,c].filter(Boolean).join(" "),"aria-label":i||o,role:"img",...d,children:o?e("span",{className:t.text,children:a(o)}):e("img",{src:l,alt:i,className:`${t.img} ${g?t.loaded:""}`,draggable:!1,loading:"lazy",decoding:"async",onLoad:()=>p(!0)})})}export{l as Avatar,a as getInitials};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./avatar.styles_module.css";let e={root:"root-z1zGW9",circle:"circle-_D9Cad",rounded:"rounded-A84AyB",large:"large-fhVn0F",medium:"medium-uo9z2T",small:"small-UDXZu6",img:"img-u6Ny24",loaded:"loaded-oROsLo",map:"map-gwcJ1m",text:"text-sZ9yIf"};export{e as default};
|
|
1
|
+
import"./avatar.styles_module.css";let e={root:"root-z1zGW9",circle:"circle-_D9Cad",rounded:"rounded-A84AyB",xlarge:"xlarge-H_7tVO",large:"large-fhVn0F",medium:"medium-uo9z2T",small:"small-UDXZu6",border:"border-bUYfnV",xLarge:"xLarge-Dyb1PW",img:"img-u6Ny24",loaded:"loaded-oROsLo",map:"map-gwcJ1m",text:"text-sZ9yIf"};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.root-z1zGW9{display:inline-flex;position:relative;overflow:hidden}.circle-_D9Cad{border-radius:50%}.rounded-A84AyB{border-radius:.25rem}.large-fhVn0F{width:2.5rem;height:2.5rem}.medium-uo9z2T{width:2.3rem;height:2.3rem}.small-UDXZu6{width:2rem;height:2rem}.img-u6Ny24{object-fit:cover;z-index:1;opacity:0;width:100%;height:100%;transition:opacity .2s;position:relative}.loaded-oROsLo{opacity:1}.map-gwcJ1m:before{content:"";z-index:0;background:currentColor;position:absolute;inset:0;mask:url("data:image/svg+xml;utf8,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 34 42%27><path d=%27M32 16.5c0 13.5-15 24-15 24S2 30 2 16.5a15 15 0 0 1 30 0Z%27 fill=%27%23fff%27/></svg>") 50%/contain no-repeat}.map-gwcJ1m .img-u6Ny24{border-radius:50%;width:60%;height:60%;position:absolute;top:4px;left:50%;transform:translate(-50%)}.text-sZ9yIf{width:100%;height:100%;padding:var(--spacing-size-4,.25rem);color:#fff;background:var(--color-background-neutral,#ccc);font-family:var(--typescale-display-font-secondary,"Golos UI");font-size:var(--typescale-body-default-emphasis-font-size,.875rem);font-weight:500;line-height:var(--typescale-body-default-emphasis-line-height,1.25rem);letter-spacing:var(--typescale-body-default-emphasis-letter-spacing,0);justify-content:center;align-items:center;display:flex}
|
|
1
|
+
.root-z1zGW9{display:inline-flex;position:relative;overflow:hidden}.circle-_D9Cad{border-radius:50%}.rounded-A84AyB{border-radius:.25rem}.xlarge-H_7tVO{width:4rem;height:4rem}.large-fhVn0F{width:2.5rem;height:2.5rem}.medium-uo9z2T{width:2.3rem;height:2.3rem}.small-UDXZu6{width:2rem;height:2rem}.border-bUYfnV{border-style:solid;border-color:var(--color-background-screen,#fdfdf9)}.xLarge-Dyb1PW.border-bUYfnV{border-width:4.8px}.large-fhVn0F.border-bUYfnV{border-width:3px}.medium-uo9z2T.border-bUYfnV{border-width:2.4px}.small-UDXZu6.border-bUYfnV{border-width:2px}.img-u6Ny24{object-fit:cover;z-index:1;opacity:0;width:100%;height:100%;transition:opacity .2s;position:relative}.loaded-oROsLo{opacity:1}.map-gwcJ1m:before{content:"";z-index:0;background:currentColor;position:absolute;inset:0;mask:url("data:image/svg+xml;utf8,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 34 42%27><path d=%27M32 16.5c0 13.5-15 24-15 24S2 30 2 16.5a15 15 0 0 1 30 0Z%27 fill=%27%23fff%27/></svg>") 50%/contain no-repeat}.map-gwcJ1m .img-u6Ny24{border-radius:50%;width:60%;height:60%;position:absolute;top:4px;left:50%;transform:translate(-50%)}.text-sZ9yIf{width:100%;height:100%;padding:var(--spacing-size-4,.25rem);color:#fff;background:var(--color-background-neutral,#ccc);font-family:var(--typescale-display-font-secondary,"Golos UI");font-size:var(--typescale-body-default-emphasis-font-size,.875rem);font-weight:500;line-height:var(--typescale-body-default-emphasis-line-height,1.25rem);letter-spacing:var(--typescale-body-default-emphasis-letter-spacing,0);justify-content:center;align-items:center;display:flex}
|