- DESIGN_TOKENS.md: Complete rewrite to document --sumi-* token system - APP_SHELL.md: Update layout shell docs (glass bg, backdrop-blur, z-index) - DESIGN_DIRECTION.md: Update aesthetic direction to SUMI philosophy - .storybook/preview.tsx: Remove deleted CSS imports, update bg colors - eslint.config.js: Update color rule message from Kodo to SUMI tokens - tailwind.config.ts: Fix comment referencing deleted design-tokens.css Co-authored-by: Cursor <cursoragent@cursor.com>
1 line
2.3 KiB
JavaScript
1 line
2.3 KiB
JavaScript
import{R as S,a as u,j as t}from"./vendor-react-Dkpvlwai.js";import{d as s}from"./index-jE2AGx2y.js";const A=S.forwardRef(({src:l,alt:n="Avatar",fallback:h,size:r="md",status:d,badge:e,className:m="",onClick:i},b)=>{const[c,x]=u.useState(!1),[w,g]=u.useState(!1),p={xs:"w-6 h-6 text-[10px]",sm:"w-8 h-8 text-xs",md:"w-10 h-10 text-sm",lg:"w-12 h-12 text-base",xl:"w-16 h-16 text-lg","2xl":"w-24 h-24 text-xl","3xl":"w-32 h-32 text-2xl"},f={online:"bg-success",offline:"bg-muted",away:"bg-warning",idle:"bg-warning",busy:"bg-destructive",dnd:"bg-destructive"},v={xs:"w-1.5 h-1.5 border",sm:"w-2 h-2 border",md:"w-2.5 h-2.5 border-2",lg:"w-3 h-3 border-2",xl:"w-4 h-4 border-2","2xl":"w-5 h-5 border-4","3xl":"w-6 h-6 border-4"},j={primary:"bg-primary text-primary-foreground",destructive:"bg-destructive text-destructive-foreground",success:"bg-success text-success-foreground"},y={xs:"w-2.5 h-2.5 text-[6px]",sm:"w-3 h-3 text-[7px]",md:"w-4 h-4 text-[8px]",lg:"w-4.5 h-4.5 text-[9px]",xl:"w-5 h-5 text-[10px]","2xl":"w-6 h-6 text-xs","3xl":"w-8 h-8 text-sm"},N={xs:"w-1.5 h-1.5",sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3",xl:"w-3.5 h-3.5","2xl":"w-4 h-4","3xl":"w-5 h-5"},C=(a=>{if(!a)return"?";const o=a.trim().split(" ");return o.length>=2?(o[0][0]+o[o.length-1][0]).toUpperCase():a.substring(0,2).toUpperCase()})(h||n),E=!l||w;return t.jsxs("div",{ref:b,className:s("relative inline-block active:scale-95 transition-transform",m,i?"cursor-pointer":""),onClick:i,children:[t.jsx("div",{className:s(p[r],"rounded-full overflow-hidden bg-card border border-border flex items-center justify-center relative"),children:E?t.jsx("span",{className:"font-bold text-muted-foreground",children:C}):t.jsxs(t.Fragment,{children:[!c&&t.jsx("div",{className:"absolute inset-0 rounded-full bg-muted animate-pulse","aria-hidden":"true"}),t.jsx("img",{src:l,alt:n,onLoad:()=>x(!0),onError:()=>{g(!0),x(!0)},className:s("w-full h-full object-cover transition-opacity duration-200",c?"opacity-100":"opacity-0")})]})}),d&&t.jsx("span",{className:s("absolute bottom-0 right-0 rounded-full border-background",f[d],v[r])}),e&&t.jsx("span",{className:s("absolute -top-0.5 -right-0.5 rounded-full border-2 border-background flex items-center justify-center font-bold leading-none",j[e.color??"primary"],e.dot?N[r]:y[r]),children:!e.dot&&e.count!=null?e.count:null})]})});A.displayName="Avatar";export{A};
|