@fluentui/react-avatar 9.5.4 → 9.5.5
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.
- package/CHANGELOG.json +64 -1
- package/CHANGELOG.md +19 -2
- package/lib/Avatar.js +0 -1
- package/lib/Avatar.js.map +1 -1
- package/lib/AvatarGroup.js +0 -1
- package/lib/AvatarGroup.js.map +1 -1
- package/lib/AvatarGroupItem.js +0 -1
- package/lib/AvatarGroupItem.js.map +1 -1
- package/lib/AvatarGroupPopover.js +0 -1
- package/lib/AvatarGroupPopover.js.map +1 -1
- package/lib/components/Avatar/Avatar.js +5 -6
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Avatar/Avatar.types.js +1 -2
- package/lib/components/Avatar/Avatar.types.js.map +1 -1
- package/lib/components/Avatar/index.js +0 -1
- package/lib/components/Avatar/index.js.map +1 -1
- package/lib/components/Avatar/renderAvatar.js +4 -8
- package/lib/components/Avatar/renderAvatar.js.map +1 -1
- package/lib/components/Avatar/useAvatar.js +165 -148
- package/lib/components/Avatar/useAvatar.js.map +1 -1
- package/lib/components/Avatar/useAvatarStyles.styles.js.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.js +6 -8
- package/lib/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.types.js +1 -2
- package/lib/components/AvatarGroup/AvatarGroup.types.js.map +1 -1
- package/lib/components/AvatarGroup/index.js +0 -1
- package/lib/components/AvatarGroup/index.js.map +1 -1
- package/lib/components/AvatarGroup/renderAvatarGroup.js +6 -11
- package/lib/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroup.js +17 -20
- package/lib/components/AvatarGroup/useAvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroupContextValues.js +9 -13
- package/lib/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroupStyles.styles.js.map +1 -1
- package/lib/components/AvatarGroupItem/AvatarGroupItem.js +5 -7
- package/lib/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -1
- package/lib/components/AvatarGroupItem/AvatarGroupItem.types.js +1 -2
- package/lib/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -1
- package/lib/components/AvatarGroupItem/index.js +0 -1
- package/lib/components/AvatarGroupItem/index.js.map +1 -1
- package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js +4 -9
- package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -1
- package/lib/components/AvatarGroupItem/useAvatarGroupItem.js +45 -51
- package/lib/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -1
- package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.js.map +1 -1
- package/lib/components/AvatarGroupPopover/AvatarGroupPopover.js +6 -8
- package/lib/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -1
- package/lib/components/AvatarGroupPopover/AvatarGroupPopover.types.js +0 -1
- package/lib/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -1
- package/lib/components/AvatarGroupPopover/index.js +0 -1
- package/lib/components/AvatarGroupPopover/index.js.map +1 -1
- package/lib/components/AvatarGroupPopover/renderAvatarGroupPopover.js +8 -13
- package/lib/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -1
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopover.js +74 -81
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -1
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +8 -9
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -1
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.js.map +1 -1
- package/lib/contexts/AvatarContext.js +3 -6
- package/lib/contexts/AvatarContext.js.map +1 -1
- package/lib/contexts/AvatarGroupContext.js +2 -4
- package/lib/contexts/AvatarGroupContext.js.map +1 -1
- package/lib/contexts/index.js +0 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/getInitials.js +37 -43
- package/lib/utils/getInitials.js.map +1 -1
- package/lib/utils/index.js +0 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/partitionAvatarGroupItems.js +15 -18
- package/lib/utils/partitionAvatarGroupItems.js.map +1 -1
- package/lib-commonjs/Avatar.js +0 -3
- package/lib-commonjs/Avatar.js.map +1 -1
- package/lib-commonjs/AvatarGroup.js +0 -3
- package/lib-commonjs/AvatarGroup.js.map +1 -1
- package/lib-commonjs/AvatarGroupItem.js +0 -3
- package/lib-commonjs/AvatarGroupItem.js.map +1 -1
- package/lib-commonjs/AvatarGroupPopover.js +0 -3
- package/lib-commonjs/AvatarGroupPopover.js.map +1 -1
- package/lib-commonjs/components/Avatar/Avatar.js +1 -3
- package/lib-commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/Avatar.types.js +0 -3
- package/lib-commonjs/components/Avatar/Avatar.types.js.map +1 -1
- package/lib-commonjs/components/Avatar/index.js +0 -3
- package/lib-commonjs/components/Avatar/index.js.map +1 -1
- package/lib-commonjs/components/Avatar/renderAvatar.js +1 -3
- package/lib-commonjs/components/Avatar/renderAvatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/useAvatar.js +1 -3
- package/lib-commonjs/components/Avatar/useAvatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/useAvatarStyles.styles.js +0 -2
- package/lib-commonjs/components/Avatar/useAvatarStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.js +1 -3
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js +0 -3
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/index.js +0 -3
- package/lib-commonjs/components/AvatarGroup/index.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js +1 -3
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js +1 -3
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupContextValues.js +1 -3
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.styles.js +0 -2
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js +1 -3
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.types.js +0 -3
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/index.js +0 -3
- package/lib-commonjs/components/AvatarGroupItem/index.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js +1 -3
- package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js +1 -3
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.js +0 -2
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.js +1 -3
- package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.types.js +0 -3
- package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/index.js +0 -3
- package/lib-commonjs/components/AvatarGroupPopover/index.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/renderAvatarGroupPopover.js +1 -3
- package/lib-commonjs/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopover.js +1 -3
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +1 -3
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.js +0 -2
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.js.map +1 -1
- package/lib-commonjs/contexts/AvatarContext.js +1 -3
- package/lib-commonjs/contexts/AvatarContext.js.map +1 -1
- package/lib-commonjs/contexts/AvatarGroupContext.js +2 -4
- package/lib-commonjs/contexts/AvatarGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/index.js +0 -3
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/index.js +0 -3
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/getInitials.js +4 -6
- package/lib-commonjs/utils/getInitials.js.map +1 -1
- package/lib-commonjs/utils/index.js +0 -3
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/partitionAvatarGroupItems.js +1 -3
- package/lib-commonjs/utils/partitionAvatarGroupItems.js.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createCustomFocusIndicatorStyle","__styles","mergeClasses","shorthands","tokens","typographyStyles","useGroupChildClassName","useSizeStyles","avatarGroupPopoverClassNames","root","content","popoverSurface","tooltip","triggerButton","useContentStyles","base","dclx09","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","mc9l5x","Beiy3e4","d","usePopoverSurfaceStyles","Bxyxcbc","sshi5w","B68tc82","Bmxbyg5","a9b677","useTriggerButtonStyles","qhf8xq","Bnnss6s","Brf1p80","Bt984gj","sj55zd","De3pzq","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","icvyot","vrafjx","oivjwe","wvpqe5","Bjwas2f","Bn1d65q","Bxeuatn","n51gp8","pie","focusIndicator","Bbcte9g","Bn40d3w","i2cumq","lbo84a","B5gfjzb","u5e7qz","Bbjhlyh","mqozju","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","g9k6zt","states","Bi91k9c","Jwef8y","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","lj723h","ecr2s2","B6oc9vd","ak43y8","wmxk5l","B50zh58","selected","icon12","Be2twd7","icon16","icon20","icon24","icon28","icon32","icon48","caption2Strong","Bahqtrf","Bhrd7zp","Bg96gwp","caption1Strong","body1Strong","subtitle2","subtitle1","title3","borderThin","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","borderThick","borderThicker","borderThickest","m","h","a","useAvatarGroupPopoverStyles_unstable","state","indicator","size","layout","popoverOpen","sizeStyles","triggerButtonStyles","contentStyles","popoverSurfaceStyles","groupChildClassName","triggerButtonClasses","push","className"],"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 ...shorthands.margin('0'),\n ...shorthands.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 ...shorthands.overflow('hidden', 'scroll'),\n ...shorthands.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 ...shorthands.borderRadius(tokens.borderRadiusCircular),\n ...shorthands.borderStyle('solid'),\n ...shorthands.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 ...shorthands.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 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"],"mappings":"AAAA,SAASA,+BAA+B,QAAQ;AAChD,SAAAC,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ;AACrD,SAASC,MAAM,EAAEC,gBAAgB,QAAQ;AACzC,SAASC,sBAAsB,QAAQ;AACvC,SAASC,aAAa,QAAQ;AAI9B,OAAO,MAAMC,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A,CAAoB/D,cAAc,EAClC4D,MAAA,KAAW,SAASG,mBAAA,CAAoBjD,MAAM,EAC9C8C,MAAA,KAAW,SAASC,WAAA,IAAeE,mBAAA,CAAoBpC,QAAQ,KAC5DwC,oBAAA,EACHV,KAAA,CAAMtG,aAAa,CAACkH,SAAS;EAG/BZ,KAAA,CAAMzG,OAAO,CAACqH,SAAS,GAAG7H,YAAA,CACxBM,4BAAA,CAA6BE,OAAO,EACpCgH,aAAA,CAAc3G,IAAI,EAClBoG,KAAA,CAAMzG,OAAO,CAACqH,SAAS;EAGzBZ,KAAA,CAAMxG,cAAc,CAACoH,SAAS,GAAG7H,YAAA,CAC/BM,4BAAA,CAA6BG,cAAc,EAC3CgH,oBAAA,CAAqB5G,IAAI,EACzBoG,KAAA,CAAMxG,cAAc,CAACoH,SAAS;EAGhC,OAAOZ,KAAA;AACT"}
|
|
1
|
+
{"version":3,"names":["createCustomFocusIndicatorStyle","__styles","mergeClasses","shorthands","tokens","typographyStyles","useGroupChildClassName","useSizeStyles","avatarGroupPopoverClassNames","root","content","popoverSurface","tooltip","triggerButton","useContentStyles","base","dclx09","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","mc9l5x","Beiy3e4","d","usePopoverSurfaceStyles","Bxyxcbc","sshi5w","B68tc82","Bmxbyg5","a9b677","useTriggerButtonStyles","qhf8xq","Bnnss6s","Brf1p80","Bt984gj","sj55zd","De3pzq","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","icvyot","vrafjx","oivjwe","wvpqe5","Bjwas2f","Bn1d65q","Bxeuatn","n51gp8","pie","focusIndicator","Bbcte9g","Bn40d3w","i2cumq","lbo84a","B5gfjzb","u5e7qz","Bbjhlyh","mqozju","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","g9k6zt","states","Bi91k9c","Jwef8y","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","lj723h","ecr2s2","B6oc9vd","ak43y8","wmxk5l","B50zh58","selected","icon12","Be2twd7","icon16","icon20","icon24","icon28","icon32","icon48","caption2Strong","Bahqtrf","Bhrd7zp","Bg96gwp","caption1Strong","body1Strong","subtitle2","subtitle1","title3","borderThin","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","borderThick","borderThicker","borderThickest","m","h","a","useAvatarGroupPopoverStyles_unstable","state","indicator","size","layout","popoverOpen","sizeStyles","triggerButtonStyles","contentStyles","popoverSurfaceStyles","groupChildClassName","triggerButtonClasses","push","className"],"sources":["useAvatarGroupPopoverStyles.styles.js"],"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';\nexport const avatarGroupPopoverClassNames = {\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 * Styles for the content slot.\n */ const useContentStyles = makeStyles({\n base: {\n listStyleType: 'none',\n ...shorthands.margin('0'),\n ...shorthands.padding('0'),\n display: 'flex',\n flexDirection: 'column'\n }\n});\n/**\n * Styles for the popoverSurface slot.\n */ const usePopoverSurfaceStyles = makeStyles({\n base: {\n maxHeight: '220px',\n minHeight: '80px',\n ...shorthands.overflow('hidden', 'scroll'),\n ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingHorizontalS),\n width: '220px'\n }\n});\n/**\n * Styles for the triggerButton slot.\n */ const 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 ...shorthands.borderRadius(tokens.borderRadiusCircular),\n ...shorthands.borderStyle('solid'),\n ...shorthands.padding(0),\n // Match color to Avatar's outline color.\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('CanvasText')\n }\n },\n pie: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n color: 'transparent'\n },\n focusIndicator: createCustomFocusIndicatorStyle({\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorStrokeFocus2),\n outlineStyle: 'none'\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 selected: {\n color: tokens.colorNeutralForeground1Selected,\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected)\n },\n icon12: {\n fontSize: '12px'\n },\n icon16: {\n fontSize: '16px'\n },\n icon20: {\n fontSize: '20px'\n },\n icon24: {\n fontSize: '24px'\n },\n icon28: {\n fontSize: '28px'\n },\n icon32: {\n fontSize: '32px'\n },\n icon48: {\n fontSize: '48px'\n },\n caption2Strong: {\n ...typographyStyles.caption2Strong\n },\n caption1Strong: {\n ...typographyStyles.caption1Strong\n },\n body1Strong: {\n ...typographyStyles.body1Strong\n },\n subtitle2: {\n ...typographyStyles.subtitle2\n },\n subtitle1: {\n ...typographyStyles.subtitle1\n },\n title3: {\n ...typographyStyles.title3\n },\n borderThin: {\n ...shorthands.borderWidth(tokens.strokeWidthThin)\n },\n borderThick: {\n ...shorthands.borderWidth(tokens.strokeWidthThick)\n },\n borderThicker: {\n ...shorthands.borderWidth(tokens.strokeWidthThicker)\n },\n borderThickest: {\n ...shorthands.borderWidth(tokens.strokeWidthThickest)\n }\n});\n/**\n * Apply styling to the AvatarGroupPopover slots based on the state\n */ export const useAvatarGroupPopoverStyles_unstable = (state)=>{\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 const triggerButtonClasses = [];\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 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 state.triggerButton.className = mergeClasses(avatarGroupPopoverClassNames.triggerButton, groupChildClassName, sizeStyles[size], triggerButtonStyles.base, layout === 'pie' && triggerButtonStyles.pie, triggerButtonStyles.focusIndicator, layout !== 'pie' && triggerButtonStyles.states, layout !== 'pie' && popoverOpen && triggerButtonStyles.selected, ...triggerButtonClasses, state.triggerButton.className);\n state.content.className = mergeClasses(avatarGroupPopoverClassNames.content, contentStyles.base, state.content.className);\n state.popoverSurface.className = mergeClasses(avatarGroupPopoverClassNames.popoverSurface, popoverSurfaceStyles.base, state.popoverSurface.className);\n return state;\n};\n"],"mappings":"AAAA,SAASA,+BAA+B,QAAQ,yBAAyB;AACzE,SAAAC,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAASC,sBAAsB,QAAQ,oDAAoD;AAC3F,SAASC,aAAa,QAAQ,kCAAkC;AAChE,OAAO,MAAMC,4BAA4B,GAAG;EACxCC,IAAI,EAAE,wBAAwB;EAC9BC,OAAO,EAAE,iCAAiC;EAC1CC,cAAc,EAAE,wCAAwC;EACxDC,OAAO,EAAE,iCAAiC;EAC1CC,aAAa,EAAE;AACnB,CAAC;AACD;AACA;AACA;AAAI,MAAMC,gBAAgB,gBAAGb,QAAA;EAAAc,IAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAQ5B,CAAC;AACF;AACA;AACA;AAAI,MAAMC,uBAAuB,gBAAG3B,QAAA;EAAAc,IAAA;IAAAc,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAX,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAS,MAAA;EAAA;AAAA;EAAAN,CAAA;AAAA,CAQnC,CAAC;AACF;AACA;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B,CAACE,OAAO,EAAEgH,aAAa,CAAC3G,IAAI,EAAEoG,KAAK,CAACzG,OAAO,CAACqH,SAAS,CAAC;EACzHZ,KAAK,CAACxG,cAAc,CAACoH,SAAS,GAAG7H,YAAY,CAACM,4BAA4B,CAACG,cAAc,EAAEgH,oBAAoB,CAAC5G,IAAI,EAAEoG,KAAK,CAACxG,cAAc,CAACoH,SAAS,CAAC;EACrJ,OAAOZ,KAAK;AAChB,CAAC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
const avatarContext =
|
|
2
|
+
const avatarContext = React.createContext(undefined);
|
|
3
3
|
const avatarContextDefaultValue = {};
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export const AvatarContextProvider = avatarContext.Provider;
|
|
6
|
+
*/ export const AvatarContextProvider = avatarContext.Provider;
|
|
8
7
|
var _React_useContext;
|
|
9
8
|
/**
|
|
10
9
|
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export const useAvatarContext = () => (_React_useContext = React.useContext(avatarContext)) !== null && _React_useContext !== void 0 ? _React_useContext : avatarContextDefaultValue;
|
|
13
|
-
//# sourceMappingURL=AvatarContext.js.map
|
|
10
|
+
*/ export const useAvatarContext = ()=>(_React_useContext = React.useContext(avatarContext)) !== null && _React_useContext !== void 0 ? _React_useContext : avatarContextDefaultValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["AvatarContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { AvatarShape, AvatarSize } from '../components/Avatar/Avatar.types';\n\nconst avatarContext = React.createContext<AvatarContextValue | undefined>(undefined);\n\n/**\n * @internal\n */\nexport interface AvatarContextValue {\n shape?: AvatarShape;\n size?: AvatarSize;\n}\n\nconst avatarContextDefaultValue: AvatarContextValue = {};\n\n/**\n * @internal\n */\nexport const AvatarContextProvider = avatarContext.Provider;\n\n/**\n * @internal\n */\nexport const useAvatarContext = () => React.useContext(avatarContext) ?? avatarContextDefaultValue;\n"],"names":["React","avatarContext","createContext","undefined","avatarContextDefaultValue","AvatarContextProvider","Provider","useAvatarContext","useContext"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,MAAMC,gBAAgBD,MAAME,aAAa,CAAiCC;AAU1E,MAAMC,4BAAgD,CAAC;AAEvD;;CAEC,GACD,OAAO,MAAMC,wBAAwBJ,cAAcK,QAAQ,CAAC;IAKtBN;AAHtC;;CAEC,GACD,OAAO,MAAMO,mBAAmB,IAAMP,CAAAA,oBAAAA,MAAMQ,UAAU,CAACP,4BAAjBD,+BAAAA,oBAAmCI,yBAAyB,CAAC"}
|
|
@@ -2,9 +2,7 @@ import { createContext, useContextSelector } from '@fluentui/react-context-selec
|
|
|
2
2
|
/**
|
|
3
3
|
* AvatarGroupContext is provided by AvatarGroup and AvatarGroupPopover. It's consumed by AvatarGroupItem to determine
|
|
4
4
|
* default values of some props.
|
|
5
|
-
*/
|
|
6
|
-
export const AvatarGroupContext = /*#__PURE__*/createContext(undefined);
|
|
5
|
+
*/ export const AvatarGroupContext = createContext(undefined);
|
|
7
6
|
const avatarGroupContextDefaultValue = {};
|
|
8
7
|
export const AvatarGroupProvider = AvatarGroupContext.Provider;
|
|
9
|
-
export const useAvatarGroupContext_unstable = selector
|
|
10
|
-
//# sourceMappingURL=AvatarGroupContext.js.map
|
|
8
|
+
export const useAvatarGroupContext_unstable = (selector)=>useContextSelector(AvatarGroupContext, (ctx = avatarGroupContextDefaultValue)=>selector(ctx));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["AvatarGroupContext.ts"],"sourcesContent":["import { createContext, useContextSelector, ContextSelector } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { AvatarGroupContextValue } from '../AvatarGroup';\n\n/**\n * AvatarGroupContext is provided by AvatarGroup and AvatarGroupPopover. It's consumed by AvatarGroupItem to determine\n * default values of some props.\n */\nexport const AvatarGroupContext: Context<AvatarGroupContextValue> = createContext<AvatarGroupContextValue | undefined>(\n undefined,\n) as Context<AvatarGroupContextValue>;\n\nconst avatarGroupContextDefaultValue: AvatarGroupContextValue = {};\n\nexport const AvatarGroupProvider = AvatarGroupContext.Provider;\n\nexport const useAvatarGroupContext_unstable = <T>(selector: ContextSelector<AvatarGroupContextValue, T>): T =>\n useContextSelector(AvatarGroupContext, (ctx = avatarGroupContextDefaultValue) => selector(ctx));\n"],"names":["createContext","useContextSelector","AvatarGroupContext","undefined","avatarGroupContextDefaultValue","AvatarGroupProvider","Provider","useAvatarGroupContext_unstable","selector","ctx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAyB,mCAAmC;AAItG;;;CAGC,GACD,OAAO,MAAMC,qBAAuDF,cAClEG,WACoC;AAEtC,MAAMC,iCAA0D,CAAC;AAEjE,OAAO,MAAMC,sBAAsBH,mBAAmBI,QAAQ,CAAC;AAE/D,OAAO,MAAMC,iCAAiC,CAAIC,WAChDP,mBAAmBC,oBAAoB,CAACO,MAAML,8BAA8B,GAAKI,SAASC,MAAM"}
|
package/lib/contexts/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './AvatarGroupContext';\nexport * from './AvatarContext';\n"],"names":[],"mappings":"AAAA,cAAc,uBAAuB;AACrC,cAAc,kBAAkB"}
|
package/lib/index.js
CHANGED
|
@@ -4,4 +4,3 @@ export { AvatarGroup, avatarGroupClassNames, renderAvatarGroup_unstable, useAvat
|
|
|
4
4
|
export { AvatarGroupItem, avatarGroupItemClassNames, renderAvatarGroupItem_unstable, useAvatarGroupItemStyles_unstable, useAvatarGroupItem_unstable } from './AvatarGroupItem';
|
|
5
5
|
export { AvatarGroupPopover, avatarGroupPopoverClassNames, renderAvatarGroupPopover_unstable, useAvatarGroupPopoverStyles_unstable, useAvatarGroupPopover_unstable } from './AvatarGroupPopover';
|
|
6
6
|
export { AvatarContextProvider, AvatarGroupProvider, useAvatarContext, useAvatarGroupContext_unstable } from './contexts/index';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export {\n Avatar,\n avatarClassNames,\n renderAvatar_unstable,\n useAvatarStyles_unstable,\n useAvatar_unstable,\n} from './Avatar';\nexport type {\n AvatarNamedColor,\n AvatarProps,\n AvatarSlots,\n AvatarState,\n AvatarShape,\n // eslint-disable-next-line deprecation/deprecation\n AvatarSizes,\n AvatarSize,\n} from './Avatar';\nexport { getInitials, partitionAvatarGroupItems } from './utils/index';\nexport type { PartitionAvatarGroupItems, PartitionAvatarGroupItemsOptions } from './utils/index';\nexport {\n AvatarGroup,\n avatarGroupClassNames,\n renderAvatarGroup_unstable,\n useAvatarGroupContextValues,\n useAvatarGroupStyles_unstable,\n useAvatarGroup_unstable,\n} from './AvatarGroup';\nexport type {\n AvatarGroupProps,\n AvatarGroupSlots,\n AvatarGroupState,\n AvatarGroupContextValue,\n AvatarGroupContextValues,\n} from './AvatarGroup';\nexport {\n AvatarGroupItem,\n avatarGroupItemClassNames,\n renderAvatarGroupItem_unstable,\n useAvatarGroupItemStyles_unstable,\n useAvatarGroupItem_unstable,\n} from './AvatarGroupItem';\nexport type { AvatarGroupItemProps, AvatarGroupItemSlots, AvatarGroupItemState } from './AvatarGroupItem';\nexport {\n AvatarGroupPopover,\n avatarGroupPopoverClassNames,\n renderAvatarGroupPopover_unstable,\n useAvatarGroupPopoverStyles_unstable,\n useAvatarGroupPopover_unstable,\n} from './AvatarGroupPopover';\nexport type { AvatarGroupPopoverProps, AvatarGroupPopoverSlots, AvatarGroupPopoverState } from './AvatarGroupPopover';\nexport {\n AvatarContextProvider,\n AvatarGroupProvider,\n useAvatarContext,\n useAvatarGroupContext_unstable,\n} from './contexts/index';\nexport type { AvatarContextValue } from './contexts/index';\n"],"names":["Avatar","avatarClassNames","renderAvatar_unstable","useAvatarStyles_unstable","useAvatar_unstable","getInitials","partitionAvatarGroupItems","AvatarGroup","avatarGroupClassNames","renderAvatarGroup_unstable","useAvatarGroupContextValues","useAvatarGroupStyles_unstable","useAvatarGroup_unstable","AvatarGroupItem","avatarGroupItemClassNames","renderAvatarGroupItem_unstable","useAvatarGroupItemStyles_unstable","useAvatarGroupItem_unstable","AvatarGroupPopover","avatarGroupPopoverClassNames","renderAvatarGroupPopover_unstable","useAvatarGroupPopoverStyles_unstable","useAvatarGroupPopover_unstable","AvatarContextProvider","AvatarGroupProvider","useAvatarContext","useAvatarGroupContext_unstable"],"mappings":"AAAA,SACEA,MAAM,EACNC,gBAAgB,EAChBC,qBAAqB,EACrBC,wBAAwB,EACxBC,kBAAkB,QACb,WAAW;AAWlB,SAASC,WAAW,EAAEC,yBAAyB,QAAQ,gBAAgB;AAEvE,SACEC,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,6BAA6B,EAC7BC,uBAAuB,QAClB,gBAAgB;AAQvB,SACEC,eAAe,EACfC,yBAAyB,EACzBC,8BAA8B,EAC9BC,iCAAiC,EACjCC,2BAA2B,QACtB,oBAAoB;AAE3B,SACEC,kBAAkB,EAClBC,4BAA4B,EAC5BC,iCAAiC,EACjCC,oCAAoC,EACpCC,8BAA8B,QACzB,uBAAuB;AAE9B,SACEC,qBAAqB,EACrBC,mBAAmB,EACnBC,gBAAgB,EAChBC,8BAA8B,QACzB,mBAAmB"}
|
package/lib/utils/getInitials.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Regular expressions matching characters to ignore when calculating the initials.
|
|
3
3
|
*/ /**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
* Regular expression matching characters within various types of enclosures, including the enclosures themselves
|
|
5
|
+
* so for example, (xyz) [xyz] {xyz} all would be ignored
|
|
6
|
+
*/ const UNWANTED_ENCLOSURES_REGEX = /[\(\[\{][^\)\]\}]*[\)\]\}]/g;
|
|
7
7
|
/**
|
|
8
8
|
* Regular expression matching special ASCII characters except space, plus some unicode special characters.
|
|
9
9
|
* Applies after unwanted enclosures have been removed
|
|
10
|
-
*/
|
|
11
|
-
const UNWANTED_CHARS_REGEX = /[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g;
|
|
10
|
+
*/ const UNWANTED_CHARS_REGEX = /[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g;
|
|
12
11
|
/**
|
|
13
12
|
* Regular expression matching phone numbers. Applied after chars matching UNWANTED_CHARS_REGEX have been removed
|
|
14
13
|
* and number has been trimmed for whitespaces
|
|
15
|
-
*/
|
|
16
|
-
const
|
|
17
|
-
/** Regular expression matching one or more spaces. */
|
|
18
|
-
const MULTIPLE_WHITESPACES_REGEX = /\s+/g;
|
|
14
|
+
*/ const PHONENUMBER_REGEX = /^\d+[\d\s]*(:?ext|x|)\s*\d+$/i;
|
|
15
|
+
/** Regular expression matching one or more spaces. */ const MULTIPLE_WHITESPACES_REGEX = /\s+/g;
|
|
19
16
|
/**
|
|
20
17
|
* Regular expression matching languages for which we currently don't support initials.
|
|
21
18
|
* Arabic: Arabic, Arabic Supplement, Arabic Extended-A.
|
|
@@ -23,32 +20,31 @@ const MULTIPLE_WHITESPACES_REGEX = /\s+/g;
|
|
|
23
20
|
* Japanese: Hiragana, Katakana.
|
|
24
21
|
* CJK: CJK Unified Ideographs Extension A, CJK Unified Ideographs, CJK Compatibility Ideographs,
|
|
25
22
|
* CJK Unified Ideographs Extension B
|
|
26
|
-
*/
|
|
27
|
-
const UNSUPPORTED_TEXT_REGEX = /[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]|[\uD840-\uD869][\uDC00-\uDED6]/;
|
|
23
|
+
*/ const UNSUPPORTED_TEXT_REGEX = /[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]|[\uD840-\uD869][\uDC00-\uDED6]/;
|
|
28
24
|
function getInitialsLatin(displayName, isRtl, firstInitialOnly) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
if (!firstInitialOnly) {
|
|
35
|
-
if (splits.length === 2) {
|
|
36
|
-
initials += splits[1].charAt(0).toUpperCase();
|
|
37
|
-
} else if (splits.length === 3) {
|
|
38
|
-
initials += splits[2].charAt(0).toUpperCase();
|
|
25
|
+
let initials = '';
|
|
26
|
+
const splits = displayName.split(' ');
|
|
27
|
+
if (splits.length !== 0) {
|
|
28
|
+
initials += splits[0].charAt(0).toUpperCase();
|
|
39
29
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
if (!firstInitialOnly) {
|
|
31
|
+
if (splits.length === 2) {
|
|
32
|
+
initials += splits[1].charAt(0).toUpperCase();
|
|
33
|
+
} else if (splits.length === 3) {
|
|
34
|
+
initials += splits[2].charAt(0).toUpperCase();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (isRtl && initials.length > 1) {
|
|
38
|
+
return initials.charAt(1) + initials.charAt(0);
|
|
39
|
+
}
|
|
40
|
+
return initials;
|
|
45
41
|
}
|
|
46
42
|
function cleanupDisplayName(displayName) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
displayName = displayName.replace(UNWANTED_ENCLOSURES_REGEX, '');
|
|
44
|
+
displayName = displayName.replace(UNWANTED_CHARS_REGEX, '');
|
|
45
|
+
displayName = displayName.replace(MULTIPLE_WHITESPACES_REGEX, ' ');
|
|
46
|
+
displayName = displayName.trim();
|
|
47
|
+
return displayName;
|
|
52
48
|
}
|
|
53
49
|
/**
|
|
54
50
|
* Get (up to 2 characters) initials based on display name of the persona.
|
|
@@ -61,16 +57,14 @@ function cleanupDisplayName(displayName) {
|
|
|
61
57
|
* could be derived from the name.
|
|
62
58
|
*
|
|
63
59
|
* @internal
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return getInitialsLatin(displayName, isRtl, options === null || options === void 0 ? void 0 : options.firstInitialOnly);
|
|
60
|
+
*/ export function getInitials(displayName, isRtl, options) {
|
|
61
|
+
if (!displayName) {
|
|
62
|
+
return '';
|
|
63
|
+
}
|
|
64
|
+
displayName = cleanupDisplayName(displayName);
|
|
65
|
+
// For names containing CJK characters, and phone numbers, we don't display initials
|
|
66
|
+
if (UNSUPPORTED_TEXT_REGEX.test(displayName) || !(options === null || options === void 0 ? void 0 : options.allowPhoneInitials) && PHONENUMBER_REGEX.test(displayName)) {
|
|
67
|
+
return '';
|
|
68
|
+
}
|
|
69
|
+
return getInitialsLatin(displayName, isRtl, options === null || options === void 0 ? void 0 : options.firstInitialOnly);
|
|
75
70
|
}
|
|
76
|
-
//# sourceMappingURL=getInitials.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["getInitials.ts"],"sourcesContent":["/**\n * Regular expressions matching characters to ignore when calculating the initials.\n */\n\n/**\n * Regular expression matching characters within various types of enclosures, including the enclosures themselves\n * so for example, (xyz) [xyz] {xyz} all would be ignored\n */\nconst UNWANTED_ENCLOSURES_REGEX: RegExp = /[\\(\\[\\{][^\\)\\]\\}]*[\\)\\]\\}]/g;\n\n/**\n * Regular expression matching special ASCII characters except space, plus some unicode special characters.\n * Applies after unwanted enclosures have been removed\n */\nconst UNWANTED_CHARS_REGEX: RegExp = /[\\0-\\u001F\\!-/:-@\\[-`\\{-\\u00BF\\u0250-\\u036F\\uD800-\\uFFFF]/g;\n\n/**\n * Regular expression matching phone numbers. Applied after chars matching UNWANTED_CHARS_REGEX have been removed\n * and number has been trimmed for whitespaces\n */\nconst PHONENUMBER_REGEX: RegExp = /^\\d+[\\d\\s]*(:?ext|x|)\\s*\\d+$/i;\n\n/** Regular expression matching one or more spaces. */\nconst MULTIPLE_WHITESPACES_REGEX: RegExp = /\\s+/g;\n\n/**\n * Regular expression matching languages for which we currently don't support initials.\n * Arabic: Arabic, Arabic Supplement, Arabic Extended-A.\n * Korean: Hangul Jamo, Hangul Compatibility Jamo, Hangul Jamo Extended-A, Hangul Syllables, Hangul Jamo Extended-B.\n * Japanese: Hiragana, Katakana.\n * CJK: CJK Unified Ideographs Extension A, CJK Unified Ideographs, CJK Compatibility Ideographs,\n * CJK Unified Ideographs Extension B\n */\nconst UNSUPPORTED_TEXT_REGEX: RegExp =\n /[\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF\\u1100-\\u11FF\\u3130-\\u318F\\uA960-\\uA97F\\uAC00-\\uD7AF\\uD7B0-\\uD7FF\\u3040-\\u309F\\u30A0-\\u30FF\\u3400-\\u4DBF\\u4E00-\\u9FFF\\uF900-\\uFAFF]|[\\uD840-\\uD869][\\uDC00-\\uDED6]/;\n\nfunction getInitialsLatin(displayName: string, isRtl: boolean, firstInitialOnly?: boolean): string {\n let initials = '';\n\n const splits: string[] = displayName.split(' ');\n if (splits.length !== 0) {\n initials += splits[0].charAt(0).toUpperCase();\n }\n\n if (!firstInitialOnly) {\n if (splits.length === 2) {\n initials += splits[1].charAt(0).toUpperCase();\n } else if (splits.length === 3) {\n initials += splits[2].charAt(0).toUpperCase();\n }\n }\n\n if (isRtl && initials.length > 1) {\n return initials.charAt(1) + initials.charAt(0);\n }\n\n return initials;\n}\n\nfunction cleanupDisplayName(displayName: string): string {\n displayName = displayName.replace(UNWANTED_ENCLOSURES_REGEX, '');\n displayName = displayName.replace(UNWANTED_CHARS_REGEX, '');\n displayName = displayName.replace(MULTIPLE_WHITESPACES_REGEX, ' ');\n displayName = displayName.trim();\n\n return displayName;\n}\n\n/**\n * Get (up to 2 characters) initials based on display name of the persona.\n *\n * @param displayName - The full name of the person or entity\n * @param isRtl - Whether the display is in RTL\n * @param options - Extra options to control the behavior of getInitials\n *\n * @returns The 1 or 2 character initials based on the name. Or an empty string if no initials\n * could be derived from the name.\n *\n * @internal\n */\nexport function getInitials(\n displayName: string | undefined | null,\n isRtl: boolean,\n options?: {\n /** Should initials be generated from phone numbers (default false) */\n allowPhoneInitials?: boolean;\n\n /** Returns only the first initial */\n firstInitialOnly?: boolean;\n },\n): string {\n if (!displayName) {\n return '';\n }\n\n displayName = cleanupDisplayName(displayName);\n\n // For names containing CJK characters, and phone numbers, we don't display initials\n if (\n UNSUPPORTED_TEXT_REGEX.test(displayName) ||\n (!options?.allowPhoneInitials && PHONENUMBER_REGEX.test(displayName))\n ) {\n return '';\n }\n\n return getInitialsLatin(displayName, isRtl, options?.firstInitialOnly);\n}\n"],"names":["UNWANTED_ENCLOSURES_REGEX","UNWANTED_CHARS_REGEX","PHONENUMBER_REGEX","MULTIPLE_WHITESPACES_REGEX","UNSUPPORTED_TEXT_REGEX","getInitialsLatin","displayName","isRtl","firstInitialOnly","initials","splits","split","length","charAt","toUpperCase","cleanupDisplayName","replace","trim","getInitials","options","test","allowPhoneInitials"],"mappings":"AAAA;;CAEC,GAED;;;CAGC,GACD,MAAMA,4BAAoC;AAE1C;;;CAGC,GACD,MAAMC,uBAA+B;AAErC;;;CAGC,GACD,MAAMC,oBAA4B;AAElC,oDAAoD,GACpD,MAAMC,6BAAqC;AAE3C;;;;;;;CAOC,GACD,MAAMC,yBACJ;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AAAA,KAAAA,IAAAA,QAASX,gBAAgB;AACvE,CAAC"}
|
package/lib/utils/index.js
CHANGED
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { getInitials } from './getInitials';\nexport { partitionAvatarGroupItems } from './partitionAvatarGroupItems';\nexport type { PartitionAvatarGroupItems, PartitionAvatarGroupItemsOptions } from './partitionAvatarGroupItems';\n"],"names":["getInitials","partitionAvatarGroupItems"],"mappings":"AAAA,SAASA,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,yBAAyB,QAAQ,8BAA8B"}
|
|
@@ -4,24 +4,21 @@
|
|
|
4
4
|
* @param options - Configure the partition options
|
|
5
5
|
*
|
|
6
6
|
* @returns Two arrays split into inline items and overflow items based on maxInlineItems.
|
|
7
|
-
*/export const partitionAvatarGroupItems = options
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
*/ export const partitionAvatarGroupItems = (options)=>{
|
|
8
|
+
const { items } = options;
|
|
9
|
+
const isPie = options.layout === 'pie';
|
|
10
|
+
if (isPie) {
|
|
11
|
+
return {
|
|
12
|
+
inlineItems: items.slice(0, 3),
|
|
13
|
+
overflowItems: items.length > 0 ? items : undefined
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
var _options_maxInlineItems;
|
|
17
|
+
const maxInlineItems = (_options_maxInlineItems = options.maxInlineItems) !== null && _options_maxInlineItems !== void 0 ? _options_maxInlineItems : 5;
|
|
18
|
+
const inlineCount = -(maxInlineItems - (items.length > maxInlineItems ? 1 : 0));
|
|
19
|
+
const overflowItems = items.slice(0, inlineCount);
|
|
13
20
|
return {
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
inlineItems: items.slice(inlineCount),
|
|
22
|
+
overflowItems: overflowItems.length > 0 ? overflowItems : undefined
|
|
16
23
|
};
|
|
17
|
-
}
|
|
18
|
-
var _options_maxInlineItems;
|
|
19
|
-
const maxInlineItems = (_options_maxInlineItems = options.maxInlineItems) !== null && _options_maxInlineItems !== void 0 ? _options_maxInlineItems : 5;
|
|
20
|
-
const inlineCount = -(maxInlineItems - (items.length > maxInlineItems ? 1 : 0));
|
|
21
|
-
const overflowItems = items.slice(0, inlineCount);
|
|
22
|
-
return {
|
|
23
|
-
inlineItems: items.slice(inlineCount),
|
|
24
|
-
overflowItems: overflowItems.length > 0 ? overflowItems : undefined
|
|
25
|
-
};
|
|
26
24
|
};
|
|
27
|
-
//# sourceMappingURL=partitionAvatarGroupItems.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["partitionAvatarGroupItems.ts"],"sourcesContent":["export type PartitionAvatarGroupItemsOptions<T> = {\n items: readonly T[];\n layout?: 'spread' | 'stack' | 'pie';\n maxInlineItems?: number;\n};\n\nexport type PartitionAvatarGroupItems<T> = {\n inlineItems: readonly T[];\n overflowItems?: readonly T[];\n};\n\n/**\n * Get the inline items and overflowing items based on the array of AvatarGroupItems needed for AvatarGroup.\n *\n * @param options - Configure the partition options\n *\n * @returns Two arrays split into inline items and overflow items based on maxInlineItems.\n */\nexport const partitionAvatarGroupItems = <T>(\n options: PartitionAvatarGroupItemsOptions<T>,\n): PartitionAvatarGroupItems<T> => {\n const { items } = options;\n const isPie = options.layout === 'pie';\n\n if (isPie) {\n return {\n inlineItems: items.slice(0, 3),\n overflowItems: items.length > 0 ? items : undefined,\n };\n }\n\n const maxInlineItems = options.maxInlineItems ?? 5;\n const inlineCount = -(maxInlineItems - (items.length > maxInlineItems ? 1 : 0));\n const overflowItems = items.slice(0, inlineCount);\n\n return {\n inlineItems: items.slice(inlineCount),\n overflowItems: overflowItems.length > 0 ? overflowItems : undefined,\n };\n};\n"],"names":["partitionAvatarGroupItems","options","items","isPie","layout","inlineItems","slice","overflowItems","length","undefined","maxInlineItems","inlineCount"],"mappings":"AAWA;;;;;;CAMC,GACD,OAAO,MAAMA,4BAA4B,CACvCC,UACiC;IACjC,MAAM,EAAEC,MAAK,EAAE,GAAGD;IAClB,MAAME,QAAQF,QAAQG,MAAM,KAAK;IAEjC,IAAID,OAAO;QACT,OAAO;YACLE,aAAaH,MAAMI,KAAK,CAAC,GAAG;YAC5BC,eAAeL,MAAMM,MAAM,GAAG,IAAIN,QAAQO,SAAS;QACrD;IACF,CAAC;QAEsBR;IAAvB,MAAMS,iBAAiBT,CAAAA,0BAAAA,QAAQS,cAAc,cAAtBT,qCAAAA,0BAA0B,CAAC;IAClD,MAAMU,cAAc,CAAED,CAAAA,iBAAkBR,CAAAA,MAAMM,MAAM,GAAGE,iBAAiB,IAAI,CAAC,AAAD,CAAC;IAC7E,MAAMH,gBAAgBL,MAAMI,KAAK,CAAC,GAAGK;IAErC,OAAO;QACLN,aAAaH,MAAMI,KAAK,CAACK;QACzBJ,eAAeA,cAAcC,MAAM,GAAG,IAAID,gBAAgBE,SAAS;IACrE;AACF,EAAE"}
|
package/lib-commonjs/Avatar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["Avatar.js"],"sourcesContent":["export * from './components/Avatar/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
6
|
_exportStar(require("./components/AvatarGroup/index"), exports);
|
|
7
|
-
//# sourceMappingURL=AvatarGroup.js.map
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=AvatarGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["AvatarGroup.js"],"sourcesContent":["export * from './components/AvatarGroup/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
6
|
_exportStar(require("./components/AvatarGroupItem/index"), exports);
|
|
7
|
-
//# sourceMappingURL=AvatarGroupItem.js.map
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=AvatarGroupItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["AvatarGroupItem.js"],"sourcesContent":["export * from './components/AvatarGroupItem/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
6
|
_exportStar(require("./components/AvatarGroupPopover/index"), exports);
|
|
7
|
-
//# sourceMappingURL=AvatarGroupPopover.js.map
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=AvatarGroupPopover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["AvatarGroupPopover.js"],"sourcesContent":["export * from './components/AvatarGroupPopover/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -18,6 +18,4 @@ const Avatar = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
18
18
|
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useAvatarStyles_unstable')(state);
|
|
19
19
|
return (0, _renderAvatar.renderAvatar_unstable)(state);
|
|
20
20
|
});
|
|
21
|
-
Avatar.displayName = 'Avatar';
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=Avatar.js.map
|
|
21
|
+
Avatar.displayName = 'Avatar';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["Avatar.js"],"sourcesContent":["import * as React from 'react';\nimport { renderAvatar_unstable } from './renderAvatar';\nimport { useAvatar_unstable } from './useAvatar';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useAvatarStyles_unstable } from './useAvatarStyles.styles';\nexport const Avatar = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useAvatar_unstable(props, ref);\n useAvatarStyles_unstable(state);\n useCustomStyleHook_unstable('useAvatarStyles_unstable')(state);\n return renderAvatar_unstable(state);\n});\nAvatar.displayName = 'Avatar';\n"],"names":["Avatar","React","forwardRef","props","ref","state","useAvatar_unstable","useAvatarStyles_unstable","useCustomStyleHook_unstable","renderAvatar_unstable","displayName"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;8BACe;2BACH;qCACS;uCACH;AAClC,MAAMA,SAAS,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IAC/D,MAAMC,QAAQC,IAAAA,6BAAkB,EAACH,OAAOC;IACxCG,IAAAA,+CAAwB,EAACF;IACzBG,IAAAA,gDAA2B,EAAC,4BAA4BH;IACxD,OAAOI,IAAAA,mCAAqB,EAACJ;AACjC;AACAL,OAAOU,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -8,6 +8,3 @@ _exportStar(require("./Avatar"), exports);
|
|
|
8
8
|
_exportStar(require("./renderAvatar"), exports);
|
|
9
9
|
_exportStar(require("./useAvatar"), exports);
|
|
10
10
|
_exportStar(require("./useAvatarStyles.styles"), exports);
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Avatar.types';\nexport * from './Avatar';\nexport * from './renderAvatar';\nexport * from './useAvatar';\nexport * from './useAvatarStyles.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
|
|
@@ -11,6 +11,4 @@ const _reactUtilities = require("@fluentui/react-utilities");
|
|
|
11
11
|
const renderAvatar_unstable = (state)=>{
|
|
12
12
|
const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
|
|
13
13
|
return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root, slots.initials && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.initials, slotProps.initials), slots.icon && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.icon, slotProps.icon), slots.image && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.image, slotProps.image), slots.badge && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.badge, slotProps.badge), state.activeAriaLabelElement);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=renderAvatar.js.map
|
|
14
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["renderAvatar.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nexport const renderAvatar_unstable = (state)=>{\n const { slots , slotProps } = getSlotsNext(state);\n return /*#__PURE__*/ createElement(slots.root, slotProps.root, slots.initials && /*#__PURE__*/ createElement(slots.initials, slotProps.initials), slots.icon && /*#__PURE__*/ createElement(slots.icon, slotProps.icon), slots.image && /*#__PURE__*/ createElement(slots.image, slotProps.image), slots.badge && /*#__PURE__*/ createElement(slots.badge, slotProps.badge), state.activeAriaLabelElement);\n};\n"],"names":["renderAvatar_unstable","state","slots","slotProps","getSlotsNext","createElement","root","initials","icon","image","badge","activeAriaLabelElement"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAErCA;;aAAAA;;iCAFsE;gCACtD;AACtB,MAAMA,wBAAwB,CAACC,QAAQ;IAC1C,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACH;IAC5C,OAAO,WAAW,GAAGI,IAAAA,8BAAa,EAACH,MAAMI,IAAI,EAAEH,UAAUG,IAAI,EAAEJ,MAAMK,QAAQ,IAAI,WAAW,GAAGF,IAAAA,8BAAa,EAACH,MAAMK,QAAQ,EAAEJ,UAAUI,QAAQ,GAAGL,MAAMM,IAAI,IAAI,WAAW,GAAGH,IAAAA,8BAAa,EAACH,MAAMM,IAAI,EAAEL,UAAUK,IAAI,GAAGN,MAAMO,KAAK,IAAI,WAAW,GAAGJ,IAAAA,8BAAa,EAACH,MAAMO,KAAK,EAAEN,UAAUM,KAAK,GAAGP,MAAMQ,KAAK,IAAI,WAAW,GAAGL,IAAAA,8BAAa,EAACH,MAAMQ,KAAK,EAAEP,UAAUO,KAAK,GAAGT,MAAMU,sBAAsB;AAC7Y"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Avatar/useAvatar.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { getInitials } from '../../utils/index';\nimport { PersonRegular } from '@fluentui/react-icons';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAvatarContext } from '../../contexts/AvatarContext';\nexport const DEFAULT_STRINGS = {\n active: 'active',\n inactive: 'inactive'\n};\nexport const useAvatar_unstable = (props, ref) => {\n const {\n dir\n } = useFluent();\n const {\n shape: contextShape,\n size: contextSize\n } = useAvatarContext();\n const {\n name,\n size = contextSize !== null && contextSize !== void 0 ? contextSize : 32,\n shape = contextShape !== null && contextShape !== void 0 ? contextShape : 'circular',\n active = 'unset',\n activeAppearance = 'ring',\n idForColor\n } = props;\n let {\n color = 'neutral'\n } = props;\n // Resolve 'colorful' to a specific color name\n if (color === 'colorful') {\n var _ref;\n color = avatarColors[getHashCode((_ref = idForColor !== null && idForColor !== void 0 ? idForColor : name) !== null && _ref !== void 0 ? _ref : '') % avatarColors.length];\n }\n const baseId = useId('avatar-');\n const root = getNativeElementProps('span', {\n role: 'img',\n id: baseId,\n // aria-label and/or aria-labelledby are resolved below\n ...props,\n ref\n }, /* excludedPropNames: */['name']);\n const [imageHidden, setImageHidden] = React.useState(undefined);\n const image = resolveShorthand(props.image, {\n defaultProps: {\n alt: '',\n role: 'presentation',\n 'aria-hidden': true,\n hidden: imageHidden\n }\n });\n // Hide the image if it fails to load and restore it on a successful load\n if (image) {\n image.onError = mergeCallbacks(image.onError, () => setImageHidden(true));\n image.onLoad = mergeCallbacks(image.onLoad, () => setImageHidden(undefined));\n }\n // Resolve the initials slot, defaulted to getInitials.\n let initials = resolveShorthand(props.initials, {\n required: true,\n defaultProps: {\n children: getInitials(name, dir === 'rtl', {\n firstInitialOnly: size <= 16\n }),\n id: baseId + '__initials'\n }\n });\n // Don't render the initials slot if it's empty\n if (!(initials === null || initials === void 0 ? void 0 : initials.children)) {\n initials = undefined;\n }\n // Render the icon slot *only if* there aren't any initials or image to display\n let icon = undefined;\n if (!initials && (!image || imageHidden)) {\n icon = resolveShorthand(props.icon, {\n required: true,\n defaultProps: {\n children: /*#__PURE__*/React.createElement(PersonRegular, null),\n 'aria-hidden': true\n }\n });\n }\n const badge = resolveShorthand(props.badge, {\n defaultProps: {\n size: getBadgeSize(size),\n id: baseId + '__badge'\n }\n });\n let activeAriaLabelElement;\n // Resolve aria-label and/or aria-labelledby if not provided by the user\n if (!root['aria-label'] && !root['aria-labelledby']) {\n if (name) {\n root['aria-label'] = name;\n // Include the badge in labelledby if it exists\n if (badge) {\n root['aria-labelledby'] = root.id + ' ' + badge.id;\n }\n } else if (initials) {\n // root's aria-label should be the name, but fall back to being labelledby the initials if name is missing\n root['aria-labelledby'] = initials.id + (badge ? ' ' + badge.id : '');\n }\n // Add the active state to the aria label\n if (active === 'active' || active === 'inactive') {\n const activeText = DEFAULT_STRINGS[active];\n if (root['aria-labelledby']) {\n // If using aria-labelledby, render a hidden span and append it to the labelledby\n const activeId = baseId + '__active';\n root['aria-labelledby'] += ' ' + activeId;\n activeAriaLabelElement = /*#__PURE__*/React.createElement(\"span\", {\n hidden: true,\n id: activeId\n }, activeText);\n } else if (root['aria-label']) {\n // Otherwise, just append it to the aria-label\n root['aria-label'] += ' ' + activeText;\n }\n }\n }\n return {\n size,\n shape,\n active,\n activeAppearance,\n activeAriaLabelElement,\n color,\n components: {\n root: 'span',\n initials: 'span',\n icon: 'span',\n image: 'img',\n badge: PresenceBadge\n },\n root,\n initials,\n icon,\n image,\n badge\n };\n};\nconst getBadgeSize = size => {\n if (size >= 96) {\n return 'extra-large';\n } else if (size >= 64) {\n return 'large';\n } else if (size >= 56) {\n return 'medium';\n } else if (size >= 40) {\n return 'small';\n } else if (size >= 28) {\n return 'extra-small';\n } else {\n return 'tiny';\n }\n};\nconst avatarColors = ['dark-red', 'cranberry', 'red', 'pumpkin', 'peach', 'marigold', 'gold', 'brass', 'brown', 'forest', 'seafoam', 'dark-green', 'light-teal', 'teal', 'steel', 'blue', 'royal-blue', 'cornflower', 'navy', 'lavender', 'purple', 'grape', 'lilac', 'pink', 'magenta', 'plum', 'beige', 'mink', 'platinum', 'anchor'];\nconst getHashCode = str => {\n let hashCode = 0;\n for (let len = str.length - 1; len >= 0; len--) {\n const ch = str.charCodeAt(len);\n const shift = len % 8;\n hashCode ^= (ch << shift) + (ch >> 8 - shift); // eslint-disable-line no-bitwise\n }\n\n return hashCode;\n};\n//# sourceMappingURL=useAvatar.js.map"],"names":["DEFAULT_STRINGS","useAvatar_unstable","active","inactive","props","ref","dir","useFluent","shape","contextShape","size","contextSize","useAvatarContext","name","activeAppearance","idForColor","color","_ref","avatarColors","getHashCode","length","baseId","useId","root","getNativeElementProps","role","id","imageHidden","setImageHidden","React","useState","undefined","image","resolveShorthand","defaultProps","alt","hidden","onError","mergeCallbacks","onLoad","initials","required","children","getInitials","firstInitialOnly","icon","createElement","PersonRegular","badge","getBadgeSize","activeAriaLabelElement","activeText","activeId","components","PresenceBadge","str","hashCode","len","ch","charCodeAt","shift"],"mappings":";;;;;;;;;;;IAOaA,eAAe,MAAfA;IAIAC,kBAAkB,MAAlBA;;;6DAXU;gCACwD;uBACnD;4BACE;4BACA;qCACkB;+BACf;AAC1B,MAAMD,kBAAkB;IAC7BE,QAAQ;IACRC,UAAU;AACZ;AACO,MAAMF,qBAAqB,CAACG,OAAOC,MAAQ;IAChD,MAAM,EACJC,IAAG,EACJ,GAAGC,IAAAA,uCAAS;IACb,MAAM,EACJC,OAAOC,aAAY,EACnBC,MAAMC,YAAW,EAClB,GAAGC,IAAAA,+BAAgB;IACpB,MAAM,EACJC,KAAI,EACJH,MAAOC,gBAAgB,IAAI,IAAIA,gBAAgB,KAAK,IAAIA,cAAc,EAAE,CAAA,EACxEH,OAAQC,iBAAiB,IAAI,IAAIA,iBAAiB,KAAK,IAAIA,eAAe,UAAU,CAAA,EACpFP,QAAS,QAAO,EAChBY,kBAAmB,OAAM,EACzBC,WAAU,EACX,GAAGX;IACJ,IAAI,EACFY,OAAQ,UAAS,EAClB,GAAGZ;IACJ,8CAA8C;IAC9C,IAAIY,UAAU,YAAY;QACxB,IAAIC;QACJD,QAAQE,YAAY,CAACC,YAAY,AAACF,CAAAA,OAAOF,eAAe,IAAI,IAAIA,eAAe,KAAK,IAAIA,aAAaF,IAAI,AAAD,MAAO,IAAI,IAAII,SAAS,KAAK,IAAIA,OAAO,EAAE,IAAIC,aAAaE,MAAM,CAAC;IAC5K,CAAC;IACD,MAAMC,SAASC,IAAAA,qBAAK,EAAC;IACrB,MAAMC,OAAOC,IAAAA,qCAAqB,EAAC,QAAQ;QACzCC,MAAM;QACNC,IAAIL;QACJ,uDAAuD;QACvD,GAAGjB,KAAK;QACRC;IACF,GAAG,sBAAsB,GAAE;QAAC;KAAO;IACnC,MAAM,CAACsB,aAAaC,eAAe,GAAGC,OAAMC,QAAQ,CAACC;IACrD,MA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,IAAIA,QAAQ,IAAI;QACrB,OAAO;IACT,OAAO;QACL,OAAO;IACT,CAAC;AACH;AACA,MAAMQ,eAAe;IAAC;IAAY;IAAa;IAAO;IAAW;IAAS;IAAY;IAAQ;IAAS;IAAS;IAAU;IAAW;IAAc;IAAc;IAAQ;IAAS;IAAQ;IAAc;IAAc;IAAQ;IAAY;IAAU;IAAS;IAAS;IAAQ;IAAW;IAAQ;IAAS;IAAQ;IAAY;CAAS;AACvU,MAAMC,cAAcoC,CAAAA,MAAO;IACzB,IAAIC,WAAW;IACf,IAAK,IAAIC,MAAMF,IAAInC,MAAM,GAAG,GAAGqC,OAAO,GAAGA,MAAO;QAC9C,MAAMC,KAAKH,IAAII,UAAU,CAACF;QAC1B,MAAMG,QAAQH,MAAM;QACpBD,YAAY,AAACE,CAAAA,MAAME,KAAI,IAAMF,CAAAA,MAAM,IAAIE,KAAI,GAAI,iCAAiC;IAClF;IAEA,OAAOJ;AACT,GACA,qCAAqC"}
|
|
1
|
+
{"version":3,"sources":["useAvatar.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { getInitials } from '../../utils/index';\nimport { PersonRegular } from '@fluentui/react-icons';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAvatarContext } from '../../contexts/AvatarContext';\nexport const DEFAULT_STRINGS = {\n active: 'active',\n inactive: 'inactive'\n};\nexport const useAvatar_unstable = (props, ref)=>{\n const { dir } = useFluent();\n const { shape: contextShape , size: contextSize } = useAvatarContext();\n const { name , size =contextSize !== null && contextSize !== void 0 ? contextSize : 32 , shape =contextShape !== null && contextShape !== void 0 ? contextShape : 'circular' , active ='unset' , activeAppearance ='ring' , idForColor } = props;\n let { color ='neutral' } = props;\n // Resolve 'colorful' to a specific color name\n if (color === 'colorful') {\n var _ref;\n color = avatarColors[getHashCode((_ref = idForColor !== null && idForColor !== void 0 ? idForColor : name) !== null && _ref !== void 0 ? _ref : '') % avatarColors.length];\n }\n const baseId = useId('avatar-');\n const root = getNativeElementProps('span', {\n role: 'img',\n id: baseId,\n // aria-label and/or aria-labelledby are resolved below\n ...props,\n ref\n }, /* excludedPropNames: */ [\n 'name'\n ]);\n const [imageHidden, setImageHidden] = React.useState(undefined);\n const image = resolveShorthand(props.image, {\n defaultProps: {\n alt: '',\n role: 'presentation',\n 'aria-hidden': true,\n hidden: imageHidden\n }\n });\n // Hide the image if it fails to load and restore it on a successful load\n if (image) {\n image.onError = mergeCallbacks(image.onError, ()=>setImageHidden(true));\n image.onLoad = mergeCallbacks(image.onLoad, ()=>setImageHidden(undefined));\n }\n // Resolve the initials slot, defaulted to getInitials.\n let initials = resolveShorthand(props.initials, {\n required: true,\n defaultProps: {\n children: getInitials(name, dir === 'rtl', {\n firstInitialOnly: size <= 16\n }),\n id: baseId + '__initials'\n }\n });\n // Don't render the initials slot if it's empty\n if (!(initials === null || initials === void 0 ? void 0 : initials.children)) {\n initials = undefined;\n }\n // Render the icon slot *only if* there aren't any initials or image to display\n let icon = undefined;\n if (!initials && (!image || imageHidden)) {\n icon = resolveShorthand(props.icon, {\n required: true,\n defaultProps: {\n children: /*#__PURE__*/ React.createElement(PersonRegular, null),\n 'aria-hidden': true\n }\n });\n }\n const badge = resolveShorthand(props.badge, {\n defaultProps: {\n size: getBadgeSize(size),\n id: baseId + '__badge'\n }\n });\n let activeAriaLabelElement;\n // Resolve aria-label and/or aria-labelledby if not provided by the user\n if (!root['aria-label'] && !root['aria-labelledby']) {\n if (name) {\n root['aria-label'] = name;\n // Include the badge in labelledby if it exists\n if (badge) {\n root['aria-labelledby'] = root.id + ' ' + badge.id;\n }\n } else if (initials) {\n // root's aria-label should be the name, but fall back to being labelledby the initials if name is missing\n root['aria-labelledby'] = initials.id + (badge ? ' ' + badge.id : '');\n }\n // Add the active state to the aria label\n if (active === 'active' || active === 'inactive') {\n const activeText = DEFAULT_STRINGS[active];\n if (root['aria-labelledby']) {\n // If using aria-labelledby, render a hidden span and append it to the labelledby\n const activeId = baseId + '__active';\n root['aria-labelledby'] += ' ' + activeId;\n activeAriaLabelElement = /*#__PURE__*/ React.createElement(\"span\", {\n hidden: true,\n id: activeId\n }, activeText);\n } else if (root['aria-label']) {\n // Otherwise, just append it to the aria-label\n root['aria-label'] += ' ' + activeText;\n }\n }\n }\n return {\n size,\n shape,\n active,\n activeAppearance,\n activeAriaLabelElement,\n color,\n components: {\n root: 'span',\n initials: 'span',\n icon: 'span',\n image: 'img',\n badge: PresenceBadge\n },\n root,\n initials,\n icon,\n image,\n badge\n };\n};\nconst getBadgeSize = (size)=>{\n if (size >= 96) {\n return 'extra-large';\n } else if (size >= 64) {\n return 'large';\n } else if (size >= 56) {\n return 'medium';\n } else if (size >= 40) {\n return 'small';\n } else if (size >= 28) {\n return 'extra-small';\n } else {\n return 'tiny';\n }\n};\nconst avatarColors = [\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];\nconst getHashCode = (str)=>{\n let hashCode = 0;\n for(let len = str.length - 1; len >= 0; len--){\n const ch = str.charCodeAt(len);\n const shift = len % 8;\n hashCode ^= (ch << shift) + (ch >> 8 - shift); // eslint-disable-line no-bitwise\n }\n return hashCode;\n};\n"],"names":["DEFAULT_STRINGS","useAvatar_unstable","active","inactive","props","ref","dir","useFluent","shape","contextShape","size","contextSize","useAvatarContext","name","activeAppearance","idForColor","color","_ref","avatarColors","getHashCode","length","baseId","useId","root","getNativeElementProps","role","id","imageHidden","setImageHidden","React","useState","undefined","image","resolveShorthand","defaultProps","alt","hidden","onError","mergeCallbacks","onLoad","initials","required","children","getInitials","firstInitialOnly","icon","createElement","PersonRegular","badge","getBadgeSize","activeAriaLabelElement","activeText","activeId","components","PresenceBadge","str","hashCode","len","ch","charCodeAt","shift"],"mappings":";;;;;;;;;;;IAOaA,eAAe,MAAfA;IAIAC,kBAAkB,MAAlBA;;;6DAXU;gCACwD;uBACnD;4BACE;4BACA;qCACkB;+BACf;AAC1B,MAAMD,kBAAkB;IAC3BE,QAAQ;IACRC,UAAU;AACd;AACO,MAAMF,qBAAqB,CAACG,OAAOC,MAAM;IAC5C,MAAM,EAAEC,IAAG,EAAG,GAAGC,IAAAA,uCAAS;IAC1B,MAAM,EAAEC,OAAOC,aAAY,EAAGC,MAAMC,YAAW,EAAG,GAAGC,IAAAA,+BAAgB;IACrE,MAAM,EAAEC,KAAI,EAAGH,MAAMC,gBAAgB,IAAI,IAAIA,gBAAgB,KAAK,IAAIA,cAAc,EAAE,CAAA,EAAGH,OAAOC,iBAAiB,IAAI,IAAIA,iBAAiB,KAAK,IAAIA,eAAe,UAAU,CAAA,EAAGP,QAAQ,QAAO,EAAGY,kBAAkB,OAAM,EAAGC,WAAU,EAAG,GAAGX;IAC5O,IAAI,EAAEY,OAAO,UAAS,EAAG,GAAGZ;IAC5B,8CAA8C;IAC9C,IAAIY,UAAU,YAAY;QACtB,IAAIC;QACJD,QAAQE,YAAY,CAACC,YAAY,AAACF,CAAAA,OAAOF,eAAe,IAAI,IAAIA,eAAe,KAAK,IAAIA,aAAaF,IAAI,AAAD,MAAO,IAAI,IAAII,SAAS,KAAK,IAAIA,OAAO,EAAE,IAAIC,aAAaE,MAAM,CAAC;IAC9K,CAAC;IACD,MAAMC,SAASC,IAAAA,qBAAK,EAAC;IACrB,MAAMC,OAAOC,IAAAA,qCAAqB,EAAC,QAAQ;QACvCC,MAAM;QACNC,IAAIL;QACJ,uDAAuD;QACvD,GAAGjB,KAAK;QACRC;IACJ,GAAG,sBAAsB,GAAG;QACxB;KACH;I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