// // Copyright 2022 DXOS.org // import { type Meta } from '@storybook/react-vite'; import React, { type PropsWithChildren } from 'react'; import { type ChromaticPalette, type Size } from '@dxos/ui-types'; import { hexToFallback } from '@dxos/util'; import { withTheme } from '../../testing'; import { Avatar, type AvatarAnimation, type AvatarStatus, type AvatarVariant } from './Avatar'; type StoryArgs = PropsWithChildren<{ id?: string; imgSrc?: string; fallbackText?: string; label?: string; description?: string; status?: AvatarStatus; variant?: AvatarVariant; animation?: AvatarAnimation; size?: Size; hue?: ChromaticPalette; }>; const DefaultStory = (props: StoryArgs) => { const { id = '20970b563fc49b5bb194a6ffdff376031a3a11f9481360c071c3fed87874106b', status, size = 12, variant = 'circle', label = 'Alice', description = 'Online', fallbackText = '', animation, imgSrc, } = props; const { emoji, hue } = hexToFallback(id); return (