@fluentui/react-avatar 9.8.7 → 9.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/CHANGELOG.md +15 -2
  2. package/lib/components/Avatar/Avatar.types.js.map +1 -1
  3. package/lib/components/Avatar/useAvatarStyles.styles.raw.js +702 -0
  4. package/lib/components/Avatar/useAvatarStyles.styles.raw.js.map +1 -0
  5. package/lib/components/AvatarGroup/useAvatarGroupStyles.styles.raw.js +31 -0
  6. package/lib/components/AvatarGroup/useAvatarGroupStyles.styles.raw.js.map +1 -0
  7. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.raw.js +266 -0
  8. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.raw.js.map +1 -0
  9. package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.raw.js +188 -0
  10. package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.raw.js.map +1 -0
  11. package/lib-commonjs/components/Avatar/Avatar.types.js.map +1 -1
  12. package/lib-commonjs/components/Avatar/useAvatarStyles.styles.raw.js +723 -0
  13. package/lib-commonjs/components/Avatar/useAvatarStyles.styles.raw.js.map +1 -0
  14. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.styles.raw.js +47 -0
  15. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.styles.raw.js.map +1 -0
  16. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.raw.js +282 -0
  17. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.raw.js.map +1 -0
  18. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.raw.js +204 -0
  19. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.raw.js.map +1 -0
  20. package/package.json +5 -5
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.ts"],"sourcesContent":["import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useGroupChildClassName } from '../AvatarGroupItem/useAvatarGroupItemStyles.styles';\nimport { useSizeStyles } from '../Avatar/useAvatarStyles.styles';\nimport type { AvatarGroupPopoverSlots, AvatarGroupPopoverState } from './AvatarGroupPopover.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const avatarGroupPopoverClassNames: SlotClassNames<AvatarGroupPopoverSlots> = {\n root: 'fui-AvatarGroupPopover',\n content: 'fui-AvatarGroupPopover__content',\n popoverSurface: 'fui-AvatarGroupPopover__popoverSurface',\n tooltip: 'fui-AvatarGroupPopover__tooltip',\n triggerButton: 'fui-AvatarGroupPopover__triggerButton',\n};\n\n/**\n * Styles for the content slot.\n */\nconst useContentStyles = makeStyles({\n base: {\n listStyleType: 'none',\n margin: '0',\n padding: '0',\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\n/**\n * Styles for the popoverSurface slot.\n */\nconst usePopoverSurfaceStyles = makeStyles({\n base: {\n maxHeight: '220px',\n minHeight: '80px',\n overflow: 'hidden scroll',\n padding: `${tokens.spacingVerticalS} ${tokens.spacingHorizontalS}`,\n width: '220px',\n },\n});\n\n/**\n * Styles for the triggerButton slot.\n */\nconst useTriggerButtonStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n flexShrink: 0,\n justifyContent: 'center',\n alignItems: 'center',\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n borderRadius: tokens.borderRadiusCircular,\n ...shorthands.borderStyle('solid'),\n padding: '0',\n\n // Match color to Avatar's outline color.\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('CanvasText'),\n },\n },\n\n pie: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n color: 'transparent',\n },\n\n focusIndicator: createCustomFocusIndicatorStyle({\n border: `${tokens.strokeWidthThick} solid ${tokens.colorStrokeFocus2}`,\n outlineStyle: 'none',\n }),\n\n states: {\n '&:hover': {\n color: tokens.colorNeutralForeground1Hover,\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n },\n '&:active': {\n color: tokens.colorNeutralForeground1Pressed,\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n },\n },\n\n selected: {\n color: tokens.colorNeutralForeground1Selected,\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n },\n\n icon12: { fontSize: '12px' },\n icon16: { fontSize: '16px' },\n icon20: { fontSize: '20px' },\n icon24: { fontSize: '24px' },\n icon28: { fontSize: '28px' },\n icon32: { fontSize: '32px' },\n icon48: { fontSize: '48px' },\n caption2Strong: { ...typographyStyles.caption2Strong },\n caption1Strong: { ...typographyStyles.caption1Strong },\n body1Strong: { ...typographyStyles.body1Strong },\n subtitle2: { ...typographyStyles.subtitle2 },\n subtitle1: { ...typographyStyles.subtitle1 },\n title3: { ...typographyStyles.title3 },\n borderThin: { ...shorthands.borderWidth(tokens.strokeWidthThin) },\n borderThick: { ...shorthands.borderWidth(tokens.strokeWidthThick) },\n borderThicker: { ...shorthands.borderWidth(tokens.strokeWidthThicker) },\n borderThickest: { ...shorthands.borderWidth(tokens.strokeWidthThickest) },\n});\n\n/**\n * Apply styling to the AvatarGroupPopover slots based on the state\n */\nexport const useAvatarGroupPopoverStyles_unstable = (state: AvatarGroupPopoverState): AvatarGroupPopoverState => {\n 'use no memo';\n\n const { indicator, size, layout, popoverOpen } = state;\n const sizeStyles = useSizeStyles();\n const triggerButtonStyles = useTriggerButtonStyles();\n const contentStyles = useContentStyles();\n const popoverSurfaceStyles = usePopoverSurfaceStyles();\n const groupChildClassName = useGroupChildClassName(layout, size);\n\n const triggerButtonClasses = [];\n\n if (size < 36) {\n triggerButtonClasses.push(triggerButtonStyles.borderThin);\n } else if (size < 56) {\n triggerButtonClasses.push(triggerButtonStyles.borderThick);\n } else if (size < 72) {\n triggerButtonClasses.push(triggerButtonStyles.borderThicker);\n } else {\n triggerButtonClasses.push(triggerButtonStyles.borderThickest);\n }\n\n if (indicator === 'count') {\n if (size <= 24) {\n triggerButtonClasses.push(triggerButtonStyles.caption2Strong);\n } else if (size <= 28) {\n triggerButtonClasses.push(triggerButtonStyles.caption1Strong);\n } else if (size <= 40) {\n triggerButtonClasses.push(triggerButtonStyles.body1Strong);\n } else if (size <= 56) {\n triggerButtonClasses.push(triggerButtonStyles.subtitle2);\n } else if (size <= 96) {\n triggerButtonClasses.push(triggerButtonStyles.subtitle1);\n } else {\n triggerButtonClasses.push(triggerButtonStyles.title3);\n }\n } else {\n if (size <= 16) {\n triggerButtonClasses.push(triggerButtonStyles.icon12);\n } else if (size <= 24) {\n triggerButtonClasses.push(triggerButtonStyles.icon16);\n } else if (size <= 40) {\n triggerButtonClasses.push(triggerButtonStyles.icon20);\n } else if (size <= 48) {\n triggerButtonClasses.push(triggerButtonStyles.icon24);\n } else if (size <= 56) {\n triggerButtonClasses.push(triggerButtonStyles.icon28);\n } else if (size <= 72) {\n triggerButtonClasses.push(triggerButtonStyles.icon32);\n } else {\n triggerButtonClasses.push(triggerButtonStyles.icon48);\n }\n }\n\n state.triggerButton.className = mergeClasses(\n avatarGroupPopoverClassNames.triggerButton,\n groupChildClassName,\n sizeStyles[size],\n triggerButtonStyles.base,\n layout === 'pie' && triggerButtonStyles.pie,\n triggerButtonStyles.focusIndicator,\n layout !== 'pie' && triggerButtonStyles.states,\n layout !== 'pie' && popoverOpen && triggerButtonStyles.selected,\n ...triggerButtonClasses,\n state.triggerButton.className,\n );\n\n state.content.className = mergeClasses(\n avatarGroupPopoverClassNames.content,\n contentStyles.base,\n state.content.className,\n );\n\n state.popoverSurface.className = mergeClasses(\n avatarGroupPopoverClassNames.popoverSurface,\n popoverSurfaceStyles.base,\n state.popoverSurface.className,\n );\n\n return state;\n};\n"],"names":["createCustomFocusIndicatorStyle","makeStyles","mergeClasses","shorthands","tokens","typographyStyles","useGroupChildClassName","useSizeStyles","avatarGroupPopoverClassNames","root","content","popoverSurface","tooltip","triggerButton","useContentStyles","base","listStyleType","margin","padding","display","flexDirection","usePopoverSurfaceStyles","maxHeight","minHeight","overflow","spacingVerticalS","spacingHorizontalS","width","useTriggerButtonStyles","position","flexShrink","justifyContent","alignItems","color","colorNeutralForeground1","backgroundColor","colorNeutralBackground1","borderColor","colorNeutralStroke1","borderRadius","borderRadiusCircular","borderStyle","pie","colorTransparentBackground","colorTransparentStroke","focusIndicator","border","strokeWidthThick","colorStrokeFocus2","outlineStyle","states","colorNeutralForeground1Hover","colorNeutralBackground1Hover","colorNeutralStroke1Hover","colorNeutralForeground1Pressed","colorNeutralBackground1Pressed","colorNeutralStroke1Pressed","selected","colorNeutralForeground1Selected","colorNeutralBackground1Selected","colorNeutralStroke1Selected","icon12","fontSize","icon16","icon20","icon24","icon28","icon32","icon48","caption2Strong","caption1Strong","body1Strong","subtitle2","subtitle1","title3","borderThin","borderWidth","strokeWidthThin","borderThick","borderThicker","strokeWidthThicker","borderThickest","strokeWidthThickest","useAvatarGroupPopoverStyles_unstable","state","indicator","size","layout","popoverOpen","sizeStyles","triggerButtonStyles","contentStyles","popoverSurfaceStyles","groupChildClassName","triggerButtonClasses","push","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,+BAA+B,QAAQ,0BAA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/Avatar.types.ts"],"sourcesContent":["import { PresenceBadge } from '@fluentui/react-badge';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Sizes for the avatar\n * @deprecated use AvatarSize instead\n */\nexport type AvatarSizes = AvatarSize;\n/**\n * Sizes for the avatar\n */\nexport type AvatarSize = 16 | 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;\n\n/**\n * Shape of the avatar\n */\nexport type AvatarShape = 'circular' | 'square';\n\nexport type AvatarSlots = {\n root: Slot<'span'>;\n\n /**\n * The Avatar's image.\n *\n * Usage e.g.: `image={{ src: '...' }}`\n */\n image?: Slot<'img'>;\n\n /**\n * (optional) Custom initials.\n *\n * It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,\n * using the `getInitials` function.\n *\n * The initials are displayed when there is no image (including while the image is loading).\n */\n initials?: Slot<'span'>;\n\n /**\n * Icon to be displayed when the avatar doesn't have an image or initials.\n *\n * @default `PersonRegular` (the default icon's size depends on the Avatar's size)\n */\n icon?: Slot<'span'>;\n\n /**\n * Badge to show the avatar's presence status.\n */\n badge?: Slot<typeof PresenceBadge>;\n};\n\n/**\n * A specific named color for the Avatar\n */\nexport type AvatarNamedColor =\n | 'dark-red'\n | 'cranberry'\n | 'red'\n | 'pumpkin'\n | 'peach'\n | 'marigold'\n | 'gold'\n | 'brass'\n | 'brown'\n | 'forest'\n | 'seafoam'\n | 'dark-green'\n | 'light-teal'\n | 'teal'\n | 'steel'\n | 'blue'\n | 'royal-blue'\n | 'cornflower'\n | 'navy'\n | 'lavender'\n | 'purple'\n | 'grape'\n | 'lilac'\n | 'pink'\n | 'magenta'\n | 'plum'\n | 'beige'\n | 'mink'\n | 'platinum'\n | 'anchor';\n\n/**\n * Properties for Avatar\n */\nexport type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & {\n /**\n * Optional activity indicator\n * * active: the avatar will be decorated according to activeAppearance\n * * inactive: the avatar will be reduced in size and partially transparent\n * * unset: normal display\n *\n * @default unset\n */\n active?: 'active' | 'inactive' | 'unset';\n\n /**\n * The appearance when `active=\"active\"`\n *\n * @default ring\n */\n activeAppearance?: 'ring' | 'shadow' | 'ring-shadow';\n\n /**\n * The color when displaying either an icon or initials.\n * * neutral (default): gray\n * * brand: color from the brand palette\n * * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)\n * * [AvatarNamedColor]: a specific color from the theme\n *\n * @default neutral\n */\n color?: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;\n\n /**\n * Specify a string to be used instead of the name, to determine which color to use when color=\"colorful\".\n * Use this when a name is not available, but there is another unique identifier that can be used instead.\n */\n idForColor?: string | undefined;\n\n /**\n * The name of the person or entity represented by this Avatar. This should always be provided if it is available.\n *\n * The name is used to determine the initials displayed when there is no image. It is also provided to\n * accessibility tools.\n */\n name?: string;\n\n /**\n * The avatar can have a circular or square shape.\n * @default circular\n */\n shape?: AvatarShape;\n\n /**\n * Size of the avatar in pixels.\n *\n * Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and\n * based on design guidelines for the Avatar control.\n *\n * Note: At size 16, if initials are displayed, only the first initial will be rendered.\n *\n * If a non-supported size is needed, set `size` to the next-smaller supported size, and set `width` and `height`\n * to override the rendered size.\n *\n * For example, to set the avatar to 45px in size:\n * `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`\n *\n * @default 32\n */\n size?: AvatarSize;\n};\n\n/**\n * State used in rendering Avatar\n */\nexport type AvatarState = ComponentState<AvatarSlots> &\n Required<Pick<AvatarProps, 'active' | 'activeAppearance' | 'shape' | 'size'>> & {\n /**\n * The Avatar's color, it matches props.color but with `'colorful'` resolved to a named color\n */\n color: NonNullable<Exclude<AvatarProps['color'], 'colorful'>>;\n\n /**\n * Hidden span to render the active state label for the purposes of including in the aria-labelledby, if needed.\n */\n activeAriaLabelElement?: JSX.Element;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AA6JA;;CAEC"}
1
+ {"version":3,"sources":["../src/components/Avatar/Avatar.types.ts"],"sourcesContent":["import { PresenceBadge } from '@fluentui/react-badge';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Sizes for the avatar\n * @deprecated use AvatarSize instead\n */\nexport type AvatarSizes = AvatarSize;\n/**\n * Sizes for the avatar\n */\nexport type AvatarSize = 16 | 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;\n\n/**\n * Shape of the avatar\n */\nexport type AvatarShape = 'circular' | 'square';\n\nexport type AvatarSlots = {\n root: Slot<'span'>;\n\n /**\n * The Avatar's image.\n *\n * Usage e.g.: `image={{ src: '...' }}`\n */\n image?: Slot<'img'>;\n\n /**\n * (optional) Custom initials.\n *\n * It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,\n * using the `getInitials` function.\n *\n * The initials are displayed when there is no image (including while the image is loading).\n */\n initials?: Slot<'span'>;\n\n /**\n * Icon to be displayed when the avatar doesn't have an image or initials.\n *\n * @default `PersonRegular` (the default icon's size depends on the Avatar's size)\n */\n icon?: Slot<'span'>;\n\n /**\n * Badge to show the avatar's presence status.\n */\n badge?: Slot<typeof PresenceBadge>;\n};\n\n/**\n * A specific named color for the Avatar\n */\nexport type AvatarNamedColor =\n | 'dark-red'\n | 'cranberry'\n | 'red'\n | 'pumpkin'\n | 'peach'\n | 'marigold'\n | 'gold'\n | 'brass'\n | 'brown'\n | 'forest'\n | 'seafoam'\n | 'dark-green'\n | 'light-teal'\n | 'teal'\n | 'steel'\n | 'blue'\n | 'royal-blue'\n | 'cornflower'\n | 'navy'\n | 'lavender'\n | 'purple'\n | 'grape'\n | 'lilac'\n | 'pink'\n | 'magenta'\n | 'plum'\n | 'beige'\n | 'mink'\n | 'platinum'\n | 'anchor';\n\n/**\n * Properties for Avatar\n */\nexport type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & {\n /**\n * Optional activity indicator\n * * active: the avatar will be decorated according to activeAppearance\n * * inactive: the avatar will be reduced in size and partially transparent\n * * unset: normal display\n *\n * @default unset\n */\n active?: 'active' | 'inactive' | 'unset';\n\n /**\n * The appearance when `active=\"active\"`\n *\n * @default ring\n */\n activeAppearance?: 'ring' | 'shadow' | 'ring-shadow';\n\n /**\n * The color when displaying either an icon or initials.\n * * neutral (default): gray\n * * brand: color from the brand palette\n * * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)\n * * [AvatarNamedColor]: a specific color from the theme\n *\n * @default neutral\n */\n color?: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;\n\n /**\n * Specify a string to be used instead of the name, to determine which color to use when color=\"colorful\".\n * Use this when a name is not available, but there is another unique identifier that can be used instead.\n */\n idForColor?: string | undefined;\n\n /**\n * The name of the person or entity represented by this Avatar. This should always be provided if it is available.\n *\n * The name is used to determine the initials displayed when there is no image. It is also provided to\n * accessibility tools.\n */\n name?: string;\n\n /**\n * The avatar can have a circular or square shape.\n * @default circular\n */\n shape?: AvatarShape;\n\n /**\n * Size of the avatar in pixels.\n *\n * Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and\n * based on design guidelines for the Avatar control.\n *\n * Note: At size 16, if initials are displayed, only the first initial will be rendered.\n *\n * If a non-supported size is needed, set `size` to the next-smaller supported size, and set `width` and `height`\n * to override the rendered size.\n *\n * For example, to set the avatar to 45px in size:\n * `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`\n *\n * @default 32\n */\n size?: AvatarSize;\n};\n\n/**\n * State used in rendering Avatar\n */\nexport type AvatarState = ComponentState<AvatarSlots> &\n Required<Pick<AvatarProps, 'active' | 'activeAppearance' | 'shape' | 'size'>> & {\n /**\n * The Avatar's color, it matches props.color but with `'colorful'` resolved to a named color\n */\n color: NonNullable<Exclude<AvatarProps['color'], 'colorful'>>;\n\n /**\n * Hidden span to render the active state label for the purposes of including in the aria-labelledby, if needed.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n activeAriaLabelElement?: JSX.Element;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AA6JA;;CAEC"}