An open source design system that's fully customizable and agent ready
TypeScript
feat(Avatar): add shape prop (circle | rounded | square) for non-circular form factors (#4205) (#4327)
Ojas Mutreja68384067dd46
diff --git a/.changeset/avatar-shape-prop-xkvw.md b/.changeset/avatar-shape-prop-xkvw.mdnew file mode 100644index 0000000000..4e75287c23--- /dev/null+++ b/.changeset/avatar-shape-prop-xkvw.md@@ -0,0 +1,7 @@+---+'@astryxdesign/core': patch+---++[feat] add shape prop ('circle' | 'rounded' | 'square') to Avatar for non-circular form factors (#4205)++@HelloOjasMutrejadiff --git a/packages/core/src/Avatar/Avatar.doc.mjs b/packages/core/src/Avatar/Avatar.doc.mjsindex dfc627ea07..fc261f17bc 100644--- a/packages/core/src/Avatar/Avatar.doc.mjs+++ b/packages/core/src/Avatar/Avatar.doc.mjs@@ -19,7 +19,7 @@ export const docs = {{guidance: true, description: 'Give every interactive avatar (href or onClick) a name or alt. It is the control\'s accessible name, and it warns in development when it is missing.'},{guidance: false, description: 'Rely on a status label to name an interactive avatar. "Online" says nothing about where the link goes.'},{guidance: false, description: 'Use Avatar for logos, product images, or anything that isn\'t a person or team. Use an image or icon instead.'},- {guidance: false, description: 'Force a square or custom shape. Avatars are always circular to stay consistent across the system.'},+ {guidance: false, description: 'Use xstyle or className to override shape. Use the shape prop instead so themes can control it globally.'},],anatomy: [{name: 'Photo', required: false, description: 'The profile image, loaded from the src URL. Shown when available.'},@@ -30,13 +30,17 @@ export const docs = {},theming: {targets: [- {className: 'astryx-avatar', visualProps: ['size']},+ {className: 'astryx-avatar', visualProps: ['size', 'shape']},{className: 'astryx-avatar-fallback', visualProps: ['size']},{className: 'astryx-avatar-status-dot', visualProps: ['variant']},{className: 'astryx-avatar-status-dot-glyph', visualProps: ['shape']},],vars: [{name: '--_avatar-group-overlap', description: 'Negative inline offset applied to every avatar after the first when avatars are stacked in an AvatarGroup. Set from the group size; a more negative value tightens the stack.', default: 'set at runtime from the group avatar size (px)', private: true},+ {name: '--_avatar-radius', description: 'Border radius of the avatar wrapper, content, focus ring, and the AvatarGroupOverflow "+N" chip. Set per shape variant by shapeStyles.', default: 'var(--radius-full)', private: true},+ ],+ derived: [+ {property: 'borderRadius', vars: ['--_avatar-radius']},],},description: 'Displays a user avatar with image, initials fallback, and optional status indicator.',@@ -67,6 +71,12 @@ export const docs = {description: "Avatar size. Use a named size ('xsm' 20px, 'sm' 24px, 'md' 36px, 'lg' 48px, 'xl' 128px) or a numeric pixel value. Avatar shares Icon's abbreviated scale, but its tiers are larger because avatars align with media rather than glyphs. Inside an AvatarGroup the group's size wins and this prop is ignored.",default: "'md'",},+ {+ name: 'shape',+ type: "'circle' | 'rounded' | 'square'",+ description: "Shape variant of the avatar. 'circle' (default) stays fully round. 'rounded' uses the element radius token so it matches UI corner rounding and can be set globally via theme. 'square' has no radius. Status dot positioning adapts automatically: 4-o'clock on circle, bottom-right corner on rounded/square.",+ default: "'circle'",+ },{name: 'status',type: 'ReactNode',diff --git a/packages/core/src/Avatar/Avatar.test.tsx b/packages/core/src/Avatar/Avatar.test.tsxindex c382581934..63d116e913 100644--- a/packages/core/src/Avatar/Avatar.test.tsx+++ b/packages/core/src/Avatar/Avatar.test.tsx@@ -6,6 +6,7 @@ import {act, render, screen, fireEvent} from '@testing-library/react';import userEvent from '@testing-library/user-event';import {Avatar} from './Avatar';import {AvatarStatusDot} from './AvatarStatusDot';+import {AvatarGroup} from '../AvatarGroup';describe('Avatar', () => {it('exposes role="img" with the name as accessible name', () => {@@ -416,6 +417,85 @@ describe('Avatar', () => {expect(img).toHaveAttribute('src', 'https://example.com/ada.jpg');});+ it('renders without error for all shape variants', () => {+ const shapes = ['circle', 'rounded', 'square'] as const;+ for (const shape of shapes) {+ const {unmount} = render(+ <Avatar+ name="Ana Thomas"+ shape={shape}+ data-testid={`avatar-${shape}`}+ />,+ );+ expect(screen.getByTestId(`avatar-${shape}`)).toBeInTheDocument();+ unmount();+ }+ });++ it('defaults to circle shape (no shape prop)', () => {+ render(<Avatar name="Lee" data-testid="avatar-default" />);+ // Should still render with role="img" using the name as the accessible label.+ expect(screen.getByRole('img', {name: 'Lee'})).toBeInTheDocument();+ });++ it('renders status dot for all shape variants', () => {+ const shapes = ['circle', 'rounded', 'square'] as const;+ const StatusDot = () => <span data-testid="status-dot" />;+ for (const shape of shapes) {+ const {unmount} = render(+ <Avatar+ name="Ana"+ shape={shape}+ status={<StatusDot />}+ data-testid={`avatar-${shape}-status`}+ />,+ );+ expect(screen.getByTestId('status-dot')).toBeInTheDocument();+ unmount();+ }+ });++ it('applies shapeStyles to wrapper when rendered inside AvatarGroup', () => {+ render(+ <AvatarGroup>+ <Avatar name="Alice" shape="rounded" data-testid="group-avatar" />+ </AvatarGroup>,+ );+ expect(screen.getByTestId('group-avatar')).toBeInTheDocument();+ });++ it("an AvatarGroup's shape overrides an individual Avatar's own shape prop, matching how size already works", () => {+ render(+ <AvatarGroup shape="square">+ <Avatar name="Alice" shape="rounded" data-testid="group-avatar" />+ </AvatarGroup>,+ );+ expect(screen.getByTestId('group-avatar')).toHaveAttribute(+ 'data-shape',+ 'square',+ );+ });++ it("an Avatar's own shape prop applies outside any AvatarGroup", () => {+ render(<Avatar name="Ana" shape="rounded" data-testid="solo-avatar" />);+ expect(screen.getByTestId('solo-avatar')).toHaveAttribute(+ 'data-shape',+ 'rounded',+ );+ });++ it('defaults to circle shape inside an AvatarGroup with no explicit shape', () => {+ render(+ <AvatarGroup>+ <Avatar name="Alice" shape="square" data-testid="group-avatar" />+ </AvatarGroup>,+ );+ expect(screen.getByTestId('group-avatar')).toHaveAttribute(+ 'data-shape',+ 'circle',+ );+ });+// --- Name tooltip (tooltip?: string | boolean) ---describe('name tooltip', () => {const originalShowPopover = HTMLElement.prototype.showPopover;diff --git a/packages/core/src/Avatar/Avatar.tsx b/packages/core/src/Avatar/Avatar.tsxindex 3e68db711a..fa94ce0904 100644--- a/packages/core/src/Avatar/Avatar.tsx+++ b/packages/core/src/Avatar/Avatar.tsx@@ -97,6 +97,11 @@ type AvatarNumericSize =*/export type AvatarSize = AvatarNamedSize | AvatarNumericSize;+/**+ * Avatar shape options+ */+export type AvatarShape = 'circle' | 'rounded' | 'square';+/*** Resolves named sizes to their numeric pixel values*/@@ -118,6 +123,25 @@ export function resolveSize(size: AvatarSize): number {}}+// Sets one local custom property rather than `borderRadius` directly, so+// every clipping/ring surface that needs the shape's radius (the wrapper,+// the interactive focus ring, the content div that actually clips via+// `overflow: hidden`, and AvatarGroupOverflow's "+N" indicator) reads the+// same value instead of each hardcoding its own borderRadius independently.+// A theme override only has to reach this one property, not fight the+// per-surface StyleX class order to change the shape everywhere at once.+export const shapeStyles = stylex.create({+ circle: {+ '--_avatar-radius': radiusVars['--radius-full'],+ },+ rounded: {+ '--_avatar-radius': radiusVars['--radius-element'],+ },+ square: {+ '--_avatar-radius': radiusVars['--radius-none'],+ },+});+/*** Base styles for the avatar* Uses a wrapper/content structure so status isn't clipped by overflow:hidden@@ -127,10 +151,10 @@ const styles = stylex.create({position: 'relative',display: 'inline-flex',flexShrink: 0,- // The wrapper carries the avatar's box as well as its radius, so a theme- // rule on the `.astryx-avatar` target reaches both: the size the `size`- // visual prop selects on is set here, and the content below fills it.- borderRadius: radiusVars['--radius-full'],+ // Reads the shape variant's `--_avatar-radius` (set by `shapeStyles`+ // below) rather than a hardcoded value, so `shape` actually changes the+ // wrapper's own radius instead of only the content div's clip.+ borderRadius: 'var(--_avatar-radius)',},content: {display: 'flex',@@ -138,9 +162,14 @@ const styles = stylex.create({justifyContent: 'center',width: '100%',height: '100%',- borderRadius: radiusVars['--radius-full'],overflow: 'hidden',userSelect: 'none',+ // The content div is the one that actually clips (via overflow: hidden+ // above), so it needs its own border-radius matching the wrapper's.+ // It inherits `--_avatar-radius` from the wrapper, since custom+ // properties cascade to descendants even though border-radius itself+ // does not.+ borderRadius: 'var(--_avatar-radius)',},image: {width: '100%',@@ -167,9 +196,6 @@ const styles = stylex.create({status: {position: 'absolute',},- // Visible focus ring for the name-tooltip tab stop, matching the repo-wide- // focus-visible outline treatment (see Timestamp, Token, Thumbnail). Only- // applied when a tooltip is active so keyboard users can reveal it.// Reset the intrinsic styling of the interactive element (<a>/<button>) so it// is a transparent, correctly-sized wrapper around the avatar visuals. The// element carries the focus-visible accent ring for keyboard users.@@ -187,8 +213,9 @@ const styles = stylex.create({default: 'pointer',':is(:disabled,[aria-disabled="true"])': 'default',},- // Match the avatar's circular shape so the focus ring hugs it.- borderRadius: radiusVars['--radius-full'],+ // Match the avatar's shape (via `--_avatar-radius`) so the focus ring+ // hugs it, whichever shape variant is in effect.+ borderRadius: 'var(--_avatar-radius)',},});@@ -207,7 +234,7 @@ const dynamicStyles = stylex.create({fontSize: (size: number) => ({fontSize: `${size * INITIALS_FONT_SIZE_RATIO}px`,}),- statusPosition: (size: number) => ({+ statusPositionCircle: (size: number) => ({bottom: size * CIRCLE_EDGE_OFFSET_RATIO,insetInlineEnd: size * CIRCLE_EDGE_OFFSET_RATIO,// `insetInlineEnd` anchors to the right edge in LTR / left in RTL, so the@@ -217,13 +244,23 @@ const dynamicStyles = stylex.create({':is([dir="rtl"] *)': 'translate(-50%, 50%)',},}),+ statusPositionCorner: {+ bottom: 0,+ insetInlineEnd: 0,+ // Same RTL mirroring as statusPositionCircle above: insetInlineEnd+ // anchors to the right edge in LTR / left in RTL, so the outward push+ // must flip sign too.+ transform: {+ default: 'translate(25%, 25%)',+ ':is([dir="rtl"] *)': 'translate(-25%, 25%)',+ },+ },});const BORDER_WIDTH = 2;const groupStyles = stylex.create({ring: {- borderRadius: radiusVars['--radius-full'],borderWidth: BORDER_WIDTH,borderStyle: 'solid',borderColor: colorVars['--color-background-surface'],@@ -276,6 +313,14 @@ export interface AvatarProps extends BaseProps<HTMLDivElement> {* @default 'md'*/size?: AvatarSize;+ /**+ * Shape variant of the avatar.+ * - 'circle': Full circle (default)+ * - 'rounded': Rounded square+ * - 'square': Sharp square+ * @default 'circle'+ */+ shape?: AvatarShape;/*** The primary image source for the avatar.*/@@ -479,6 +524,7 @@ export function Avatar({fallbackSrc,name,size = 'md',+ shape = 'circle',src,status,tooltip = true,@@ -538,6 +584,7 @@ export function Avatar({: undefined;const avatarGroup = useAvatarGroup();const resolvedSize = avatarGroup?.size ?? size;+ const resolvedShape = avatarGroup?.shape ?? shape;const numericSize = useMemo(() => resolveSize(resolvedSize), [resolvedSize]);// Resolve the tooltip content:@@ -723,7 +770,9 @@ export function Avatar({<div{...stylex.props(styles.status,- dynamicStyles.statusPosition(numericSize),+ resolvedShape === 'circle'+ ? dynamicStyles.statusPositionCircle(numericSize)+ : dynamicStyles.statusPositionCorner,)}>{status}</div>@@ -736,7 +785,7 @@ export function Avatar({// tooltip tab-stop focus ring all live here so the interactive// `<a>`/`<button>` and the static `<div>` carry the exact same box.const rootStylexProps = mergeProps(- themeProps('avatar', {size: resolvedSize}),+ themeProps('avatar', {size: resolvedSize, shape: resolvedShape}),focusOutlineProps.focusVisible(styles.wrapper,dynamicStyles.size(numericSize),@@ -744,6 +793,7 @@ export function Avatar({avatarGroup && groupStyles.ring,avatarGroup && groupStyles.overlap,avatarGroup && groupDynamicStyles.overlap(-avatarGroup.overlap),+ shapeStyles[resolvedShape],xstyle,),className,diff --git a/packages/core/src/Avatar/index.ts b/packages/core/src/Avatar/index.tsindex b3d6d30ff3..9382359ec6 100644--- a/packages/core/src/Avatar/index.ts+++ b/packages/core/src/Avatar/index.ts@@ -5,7 +5,7 @@/*** @file index.ts* @input Imports Avatar component and types from Avatar.tsx, AvatarStatusDot from AvatarStatusDot.tsx- * @output Exports Avatar, AvatarProps, AvatarSize, AvatarStatusDot, AvatarStatusDotProps, AvatarStatusDotVariant+ * @output Exports Avatar, AvatarProps, AvatarSize, AvatarShape, resolveSize, AvatarStatusDot, AvatarStatusDotProps, AvatarStatusDotVariant* @position Component entry point; re-exported by /packages/core/src/index.ts** SYNC: When modified, update this header and /packages/core/src/Avatar/Avatar.doc.mjs@@ -38,7 +38,7 @@ export interface AvatarStatusDotVariantMap {}export {Avatar, resolveSize} from './Avatar';-export type {AvatarProps, AvatarSize} from './Avatar';+export type {AvatarProps, AvatarSize, AvatarShape} from './Avatar';export {AvatarStatusDot} from './AvatarStatusDot';export type {AvatarStatusDotProps,diff --git a/packages/core/src/AvatarGroup/AvatarGroup.doc.mjs b/packages/core/src/AvatarGroup/AvatarGroup.doc.mjsindex 73742c0564..6b1ea01c1f 100644--- a/packages/core/src/AvatarGroup/AvatarGroup.doc.mjs+++ b/packages/core/src/AvatarGroup/AvatarGroup.doc.mjs@@ -25,8 +25,8 @@ export const docs = {},theming: {targets: [- {className: 'astryx-avatar-group', visualProps: ['size']},- {className: 'astryx-avatar-group-overflow', visualProps: ['size']},+ {className: 'astryx-avatar-group', visualProps: ['size', 'shape']},+ {className: 'astryx-avatar-group-overflow', visualProps: ['size', 'shape']},],},description: 'Stacked avatar display with overlapping layout and optional overflow indicator. Children are Avatar elements.',@@ -52,6 +52,12 @@ export const docs = {"Size applied to all avatars via context. This wins over each child Avatar's own size prop, including when it is left at the default, so set the size here rather than on the children.",default: "'md'",},+ {+ name: 'shape',+ type: "'circle' | 'rounded' | 'square'",+ description: "Shape applied to all avatars via context, overriding each avatar's own shape prop. Also applied to AvatarGroupOverflow's \"+N\" indicator.",+ default: "'circle'",+ },{name: 'ref',type: 'React.Ref<HTMLDivElement>',diff --git a/packages/core/src/AvatarGroup/AvatarGroup.test.tsx b/packages/core/src/AvatarGroup/AvatarGroup.test.tsxindex ec7a042a40..f24a5b3cc7 100644--- a/packages/core/src/AvatarGroup/AvatarGroup.test.tsx+++ b/packages/core/src/AvatarGroup/AvatarGroup.test.tsx@@ -118,6 +118,30 @@ describe('AvatarGroupOverflow', () => {expect(overflow).toHaveAttribute('data-size', 'lg');});+ it('applies the group shape to the overflow chip, matching its avatars', () => {+ render(+ <AvatarGroup shape="square">+ <Avatar name="Alice" />+ <AvatarGroupOverflow count={5} />+ </AvatarGroup>,+ );++ const overflow = screen.getByLabelText('5 more');+ expect(overflow).toHaveAttribute('data-shape', 'square');+ });++ it('defaults the overflow chip to circle shape with no explicit AvatarGroup shape', () => {+ render(+ <AvatarGroup>+ <Avatar name="Alice" />+ <AvatarGroupOverflow count={5} />+ </AvatarGroup>,+ );++ const overflow = screen.getByLabelText('5 more');+ expect(overflow).toHaveAttribute('data-shape', 'circle');+ });+it('renders as button when onClick is provided', () => {render(<AvatarGroup>diff --git a/packages/core/src/AvatarGroup/AvatarGroup.tsx b/packages/core/src/AvatarGroup/AvatarGroup.tsxindex d5ef43e622..aaf28752f1 100644--- a/packages/core/src/AvatarGroup/AvatarGroup.tsx+++ b/packages/core/src/AvatarGroup/AvatarGroup.tsx@@ -26,7 +26,7 @@import {useId, useMemo, useState, type ReactNode} from 'react';import type {BaseProps} from '../BaseProps';-import {resolveSize, type AvatarSize} from '../Avatar';+import {resolveSize, type AvatarShape, type AvatarSize} from '../Avatar';import * as stylex from '@stylexjs/stylex';import {mergeProps} from '../utils';import {composeEventHandlers} from '../utils/composeEventHandlers';@@ -55,6 +55,13 @@ export interface AvatarGroupProps extends BaseProps<HTMLDivElement> {* @default 'md'*/size?: AvatarSize;+ /**+ * Shape applied to all avatars via context, overriding each avatar's own+ * `shape` prop so a group stays visually uniform. Also applied to the+ * `AvatarGroupOverflow` "+N" indicator, so it matches the group.+ * @default 'circle'+ */+ shape?: AvatarShape;/*** Test ID for integration testing.*/@@ -89,6 +96,7 @@ const styles = stylex.create({export function AvatarGroup({children,size = 'md',+ shape = 'circle','data-testid': testId,'aria-label': ariaLabelFromProps,'aria-describedby': ariaDescribedByFromProps,@@ -106,8 +114,8 @@ export function AvatarGroup({const overlap = Math.round(numericSize * OVERLAP_RATIO);const contextValue = useMemo(- () => ({size, overlap, numericSize}),- [size, overlap, numericSize],+ () => ({size, shape, overlap, numericSize}),+ [size, shape, overlap, numericSize],);// The keyboard hint and roving tab stop only make sense once the group has@@ -152,7 +160,7 @@ export function AvatarGroup({onKeyDown={composeEventHandlers(onKeyDown, handleKeyDown)}onFocus={composeEventHandlers(onFocus, handleFocus)}{...mergeProps(- themeProps('avatar-group', {size}),+ themeProps('avatar-group', {size, shape}),stylex.props(styles.root, xstyle),className,style,diff --git a/packages/core/src/AvatarGroup/AvatarGroupContext.ts b/packages/core/src/AvatarGroup/AvatarGroupContext.tsindex 9ec37a73ae..8380f8b430 100644--- a/packages/core/src/AvatarGroup/AvatarGroupContext.ts+++ b/packages/core/src/AvatarGroup/AvatarGroupContext.ts@@ -9,16 +9,18 @@*/import {createContext, use} from 'react';-import type {AvatarSize} from '../Avatar';+import type {AvatarShape, AvatarSize} from '../Avatar';export interface AvatarGroupContextValue {size: AvatarSize;+ shape: AvatarShape;overlap: number;numericSize: number;}-export const AvatarGroupContext =- createContext<AvatarGroupContextValue | null>(null);+export const AvatarGroupContext = createContext<AvatarGroupContextValue | null>(+ null,+);AvatarGroupContext.displayName = 'AvatarGroupContext';export function useAvatarGroup(): AvatarGroupContextValue | null {diff --git a/packages/core/src/AvatarGroup/AvatarGroupOverflow.tsx b/packages/core/src/AvatarGroup/AvatarGroupOverflow.tsxindex 441274fe7f..f84a0b1722 100644--- a/packages/core/src/AvatarGroup/AvatarGroupOverflow.tsx+++ b/packages/core/src/AvatarGroup/AvatarGroupOverflow.tsx@@ -20,9 +20,9 @@ import {typographyVars,typeScaleVars,fontWeightVars,- radiusVars,spacingVars,} from '../theme/tokens.stylex';+import {shapeStyles} from '../Avatar/Avatar';import {mergeProps} from '../utils';import {resolveSize} from '../Avatar';import {useAvatarGroup} from './AvatarGroupContext';@@ -65,7 +65,10 @@ const styles = stylex.create({display: 'inline-flex',alignItems: 'center',justifyContent: 'center',- borderRadius: radiusVars['--radius-full'],+ // Reads the shape variant's `--_avatar-radius` (set via `shapeStyles`,+ // shared with Avatar) so the overflow indicator matches the group's+ // shape instead of always staying a circle.+ borderRadius: 'var(--_avatar-radius)',// Use opaque background to prevent avatar bleed-throughbackgroundColor: colorVars['--color-background-surface'],color: colorVars['--color-text-secondary'],@@ -166,6 +169,7 @@ export function AvatarGroupOverflow({const t = useTranslator();const group = useAvatarGroup();const size = group?.size ?? 'md';+ const shape = group?.shape ?? 'circle';const numericSize = group?.numericSize ?? resolveSize('md');const overlap = group?.overlap ?? 0;@@ -186,7 +190,7 @@ export function AvatarGroupOverflow({aria-label={label}data-avatar-item=""{...mergeProps(- themeProps('avatar-group-overflow', {size}),+ themeProps('avatar-group-overflow', {size, shape}),focusOutlineProps.focusVisible(styles.base,styles.button,@@ -194,6 +198,7 @@ export function AvatarGroupOverflow({dynamicStyles.size(numericSize),dynamicStyles.fontSize(numericSize),dynamicStyles.overlap(-overlap),+ shapeStyles[shape],xstyle,),className,@@ -210,13 +215,14 @@ export function AvatarGroupOverflow({{...rest}aria-label={label}{...mergeProps(- themeProps('avatar-group-overflow', {size}),+ themeProps('avatar-group-overflow', {size, shape}),stylex.props(styles.base,styles.overlap,dynamicStyles.size(numericSize),dynamicStyles.fontSize(numericSize),dynamicStyles.overlap(-overlap),+ shapeStyles[shape],xstyle,),className,diff --git a/packages/core/src/theme/derivedVarRegistry.test.ts b/packages/core/src/theme/derivedVarRegistry.test.tsindex 892bf64ee7..f09aa223c8 100644--- a/packages/core/src/theme/derivedVarRegistry.test.ts+++ b/packages/core/src/theme/derivedVarRegistry.test.ts@@ -213,6 +213,7 @@ function discoverComponents(): ComponentInfo[] {// ---------------------------------------------------------------------------const DIR_TO_REGISTRY_KEY: Record<string, string> = {+ Avatar: 'avatar',Banner: 'banner',Button: 'button',Card: 'card',diff --git a/packages/core/src/theme/derivedVarRegistry.ts b/packages/core/src/theme/derivedVarRegistry.tsindex 2282dd43a0..7474bffb05 100644--- a/packages/core/src/theme/derivedVarRegistry.ts+++ b/packages/core/src/theme/derivedVarRegistry.ts@@ -43,6 +43,7 @@ export interface DerivedVarEntry {* entries share the same property.*/export const derivedVarRegistry: Record<string, DerivedVarEntry[]> = {+ avatar: [{property: 'borderRadius', vars: ['--_avatar-radius']}],banner: [{property: 'borderRadius', vars: ['--_banner-radius']}],button: [{property: 'borderRadius', vars: ['--_button-radius']}],card: [