wealth/packages/island/src/atoms/avatar/variants.ts

29 lines
927 B
TypeScript
Raw Normal View History

import { cva } from 'class-variance-authority';
/** The placeholder is the username's first letter in white on `action-primary`. */
export const avatarVariants = cva(
'relative flex-none overflow-hidden rounded-full bg-action-primary text-text-on-action',
{
variants: {
size: {
/** Compact rows and the top bar. */
sm: 'size-8',
/** Post headers, subscription cards, list rows. */
md: 'size-10',
/** Sheet and checkout headers. */
lg: 'size-14',
/** The channel profile header. */
xl: 'size-20',
/** The profile photo field. */
'2xl': 'size-24',
},
/** An account that can't be used, such as a suspended creator's own avatar: no brand colour. */
muted: {
true: 'bg-surface-sunken text-text-secondary grayscale',
false: '',
},
},
defaultVariants: { size: 'md', muted: false },
},
);