@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
1 lines • 2.16 kB
Source Map (JSON)
{"version":3,"file":"avatar-group.cjs","names":["component","useRootComponentProps","useAvatarGroup","AvatarPropsContext","styled","Avatar"],"sources":["../../../../src/components/avatar/avatar-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { AvatarStyle } from \"./avatar.style\"\nimport type { UseAvatarGroupProps } from \"./use-avatar-group\"\nimport { useMemo } from \"react\"\nimport { styled } from \"../../core\"\nimport {\n Avatar,\n AvatarPropsContext,\n component,\n useRootComponentProps,\n} from \"./avatar\"\nimport { useAvatarGroup } from \"./use-avatar-group\"\n\nexport interface AvatarGroupRootProps\n extends HTMLStyledProps,\n ThemeProps<AvatarStyle>,\n UseAvatarGroupProps {}\n\n/**\n * `Avatar` is a component that displays a profile picture or an icon with initials representing a user.\n *\n * @see https://yamada-ui.com/docs/components/avatar\n */\nexport const AvatarGroupRoot = component<\"div\", AvatarGroupRootProps>(\n (props) => {\n const [, { colorScheme, size, variant, shape, ...rest }] =\n useRootComponentProps(props, \"group\", {\n transferProps: [\"variant\", \"colorScheme\", \"size\", \"shape\"],\n })\n const { children, excess, getRootProps } = useAvatarGroup(rest)\n const context = useMemo(\n () => ({ colorScheme, size, variant, shape }),\n [variant, size, colorScheme, shape],\n )\n\n return (\n <AvatarPropsContext value={context}>\n <styled.div {...getRootProps()}>\n {excess > 0 ? <Avatar fallback={`+${excess}`} /> : null}\n {children}\n </styled.div>\n </AvatarPropsContext>\n )\n },\n \"group\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,MAAa,kBAAkBA,0BAC5B,UAAU;CACT,MAAM,GAAG,EAAE,aAAa,MAAM,SAAS,MAAO,GAAG,UAC/CC,qCAAsB,OAAO,SAAS,EACpC,eAAe;EAAC;EAAW;EAAe;EAAQ;EAAQ,EAC3D,CAAC;CACJ,MAAM,EAAE,UAAU,QAAQ,iBAAiBC,wCAAe,KAAK;AAM/D,QACE,2CAACC;EAAmB,iCALb;GAAE;GAAa;GAAM;GAAS;GAAO,GAC5C;GAAC;GAAS;GAAM;GAAa;GAAM,CACpC;YAIG,4CAACC,uBAAO;GAAI,GAAI,cAAc;cAC3B,SAAS,IAAI,2CAACC,yBAAO,UAAU,IAAI,WAAY,GAAG,MAClD;IACU;GACM;GAGzB,QACD,EAAE"}