@fluentui-copilot/react-attachments 0.13.2 → 0.13.4
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 +31 -1
- package/CHANGELOG.md +20 -2
- package/lib/AgentTag.js +0 -1
- package/lib/Attachment.js +0 -1
- package/lib/AttachmentList.js +0 -1
- package/lib/AttachmentOverflowMenu.js +0 -1
- package/lib/AttachmentOverflowMenuButton.js +0 -1
- package/lib/AttachmentOverflowMenuItem.js +0 -1
- package/lib/components/AgentTag/AgentTag.js +4 -5
- package/lib/components/AgentTag/AgentTag.types.js +1 -2
- package/lib/components/AgentTag/index.js +0 -1
- package/lib/components/AgentTag/renderAgentTag.js +3 -5
- package/lib/components/AgentTag/useAgentTag.js +7 -9
- package/lib/components/AgentTag/useAgentTagStyles.styles.raw.js +66 -0
- package/lib/components/AgentTag/useAgentTagStyles.styles.raw.js.map +1 -0
- package/lib/components/Attachment/Attachment.js +5 -6
- package/lib/components/Attachment/Attachment.types.js +1 -2
- package/lib/components/Attachment/index.js +0 -1
- package/lib/components/Attachment/renderAttachment.js +36 -31
- package/lib/components/Attachment/useAttachment.js +85 -95
- package/lib/components/Attachment/useAttachmentStyles.styles.js +25 -17
- package/lib/components/Attachment/useAttachmentStyles.styles.js.map +1 -1
- package/lib/components/Attachment/useAttachmentStyles.styles.raw.js +328 -0
- package/lib/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -0
- package/lib/components/AttachmentList/AttachmentList.js +6 -7
- package/lib/components/AttachmentList/AttachmentList.types.js +1 -2
- package/lib/components/AttachmentList/index.js +0 -1
- package/lib/components/AttachmentList/renderAttachmentList.js +25 -25
- package/lib/components/AttachmentList/useAttachmentList.js +113 -124
- package/lib/components/AttachmentList/useAttachmentListContextValues.js +10 -15
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.raw.js +44 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.raw.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +8 -9
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +1 -2
- package/lib/components/AttachmentOverflowMenu/index.js +0 -1
- package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +8 -13
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +9 -15
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +10 -15
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +5 -6
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +1 -2
- package/lib/components/AttachmentOverflowMenuButton/index.js +0 -1
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +11 -10
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +51 -59
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js +102 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +4 -5
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +1 -2
- package/lib/components/AttachmentOverflowMenuItem/index.js +0 -1
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +9 -8
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +41 -49
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js +11 -3
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +59 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
- package/lib/components/index.js +0 -1
- package/lib/components/utils/useProgressBarStyles.styles.raw.js +42 -0
- package/lib/components/utils/useProgressBarStyles.styles.raw.js.map +1 -0
- package/lib/contexts/attachmentListContext.js +4 -5
- package/lib/contexts/attachmentOverflowMenuContext.js +4 -5
- package/lib/index.js +0 -1
- package/lib-commonjs/AgentTag.js +0 -1
- package/lib-commonjs/Attachment.js +0 -1
- package/lib-commonjs/AttachmentList.js +0 -1
- package/lib-commonjs/AttachmentOverflowMenu.js +0 -1
- package/lib-commonjs/AttachmentOverflowMenuButton.js +0 -1
- package/lib-commonjs/AttachmentOverflowMenuItem.js +0 -1
- package/lib-commonjs/components/AgentTag/AgentTag.js +1 -1
- package/lib-commonjs/components/AgentTag/AgentTag.js.map +1 -1
- package/lib-commonjs/components/AgentTag/AgentTag.types.js +0 -1
- package/lib-commonjs/components/AgentTag/index.js +0 -1
- package/lib-commonjs/components/AgentTag/renderAgentTag.js +1 -1
- package/lib-commonjs/components/AgentTag/renderAgentTag.js.map +1 -1
- package/lib-commonjs/components/AgentTag/useAgentTag.js +1 -1
- package/lib-commonjs/components/AgentTag/useAgentTag.js.map +1 -1
- package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.raw.js +82 -0
- package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/Attachment/Attachment.js +1 -1
- package/lib-commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/Attachment.types.js +0 -1
- package/lib-commonjs/components/Attachment/index.js +0 -1
- package/lib-commonjs/components/Attachment/renderAttachment.js +1 -1
- package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachment.js +1 -1
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js +53 -33
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js +347 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.js +1 -1
- package/lib-commonjs/components/AttachmentList/AttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js +0 -1
- package/lib-commonjs/components/AttachmentList/index.js +0 -1
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +1 -1
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.raw.js +60 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +0 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/index.js +0 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +0 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js +0 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js +118 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +0 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js +0 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js +13 -2
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +75 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/index.js +0 -1
- package/lib-commonjs/components/utils/useProgressBarStyles.styles.raw.js +50 -0
- package/lib-commonjs/components/utils/useProgressBarStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/contexts/attachmentListContext.js +1 -1
- package/lib-commonjs/contexts/attachmentListContext.js.map +1 -1
- package/lib-commonjs/contexts/attachmentOverflowMenuContext.js +1 -1
- package/lib-commonjs/contexts/attachmentOverflowMenuContext.js.map +1 -1
- package/lib-commonjs/index.js +0 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentStyles.styles.ts"],"sourcesContent":["import {\n createCustomFocusIndicatorStyle,\n makeResetStyles,\n makeStyles,\n mergeClasses,\n slot,\n typographyStyles,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\nimport type { AttachmentSlots, AttachmentState } from './Attachment.types';\nimport type { GriffelResetStyle, SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentClassNames: SlotClassNames<AttachmentSlots> = {\n root: 'fai-Attachment',\n primaryAction: 'fai-Attachment__primaryAction',\n dismissButton: 'fai-Attachment__dismissButton',\n media: 'fai-Attachment__media',\n content: 'fai-Attachment__content',\n dismissIcon: 'fai-Attachment__dismissIcon',\n progress: 'fai-Attachment__progress',\n};\n\nconst ATTACHMENT_MAXWIDTH = '180px';\nconst SMALL_ATTACHMENT_SIZE = '16px';\nconst ATTACHMENT_SIZE = '20px';\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n flexWrap: 'nowrap',\n verticalAlign: 'middle',\n boxSizing: 'border-box',\n width: 'fit-content',\n alignSelf: 'end',\n position: 'relative',\n});\n\nconst buttonBaseStyles: GriffelResetStyle = {\n alignItems: 'center',\n backgroundColor: tokens.colorSubtleBackground,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n columnGap: tokens.spacingHorizontalSNudge,\n color: tokens.colorNeutralForeground1,\n cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n justifyContent: 'center',\n ...createCustomFocusIndicatorStyle({\n outline: `${tokens.strokeWidthThick} solid ${tokens.colorStrokeFocus2}`,\n outlineOffset: `calc(${tokens.strokeWidthThick} * -1)`,\n zIndex: 1,\n }),\n verticalAlign: 'middle',\n};\n\nconst usePrimaryActionBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n borderTopRightRadius: tokens.borderRadiusNone,\n borderBottomRightRadius: tokens.borderRadiusNone,\n borderRightStyle: 'none',\n maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS} - ${tokens.spacingHorizontalXS})`,\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`,\n});\n\nconst usePrimaryActionStyles = makeStyles({\n button: {\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n color: tokens.colorNeutralForeground2Pressed,\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n },\n});\n\nconst useDismissButtonBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS}`,\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n\n // divider:\n borderLeftColor: tokens.colorNeutralStroke1,\n borderTopLeftRadius: tokens.borderRadiusNone,\n borderBottomLeftRadius: tokens.borderRadiusNone,\n\n borderTopRightRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground2BrandHover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n});\n\nconst useDismissButtonCurrentStyles = makeStyles({\n root: {\n ':hover': {\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorBrandForegroundLinkHover,\n },\n },\n },\n});\n\nconst useMediaBaseClassName = makeResetStyles({\n alignItems: 'center',\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: ATTACHMENT_SIZE,\n lineHeight: ATTACHMENT_SIZE,\n width: ATTACHMENT_SIZE,\n});\n\nconst useContentBaseClassName = makeResetStyles({\n overflowX: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n ...typographyStyles.body1,\n});\n\nconst useDismissIconBaseClassName = makeResetStyles({\n alignItems: 'center',\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n justifyContent: 'center',\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n padding: `calc(${tokens.spacingVerticalXXS} / 2) calc(${tokens.spacingHorizontalXXS} / 2)`,\n});\n\nconst useDismissIconNextStyles = makeStyles({\n dismissOnly: {\n ':hover': {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n ':active': {\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n});\n\nconst useImageOnlyStyles = makeStyles({\n primaryAction: {\n padding: 0,\n },\n content: {\n lineHeight: 0,\n },\n});\n\nexport const useOverflowStyles = makeStyles({\n overflow: {\n maxWidth: '100%',\n width: '100%',\n },\n});\n\nconst useSmallStyles = makeStyles({\n primaryAction: {\n maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS} - ${tokens.spacingHorizontalXS})`,\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalSNudge} ${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalSNudge}`,\n },\n media: {\n fontSize: SMALL_ATTACHMENT_SIZE,\n height: SMALL_ATTACHMENT_SIZE,\n lineHeight: SMALL_ATTACHMENT_SIZE,\n width: SMALL_ATTACHMENT_SIZE,\n },\n content: {\n ...typographyStyles.caption1,\n },\n dismissButton: {\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalXXS}`,\n maxWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n minWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n },\n dismissIcon: {\n fontSize: SMALL_ATTACHMENT_SIZE,\n height: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n maxWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n },\n});\n\nconst usePrimaryActionNextStyles = makeStyles({\n root: {\n borderTopLeftRadius: tokens.borderRadiusXLarge,\n borderBottomLeftRadius: tokens.borderRadiusXLarge,\n },\n canvas: {\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`,\n minHeight: '40px',\n },\n\n sidecar: {\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`,\n minHeight: '32px',\n },\n});\n\nconst useDismissButtonNextStyles = makeStyles({\n root: {\n borderTopRightRadius: tokens.borderRadiusXLarge,\n borderBottomRightRadius: tokens.borderRadiusXLarge,\n ':hover': {\n color: tokens.colorNeutralForeground2,\n },\n ':active': {\n color: tokens.colorNeutralForeground2Pressed,\n },\n\n borderLeftColor: tokens.colorNeutralStroke1,\n borderLeftWidth: tokens.strokeWidthThin,\n borderLeftStyle: 'solid',\n },\n withPrimary: {\n ':hover': {\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorNeutralForeground2,\n },\n },\n ':active': {\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n canvas: {\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`,\n minHeight: '40px',\n width: '40px',\n },\n sidecar: {\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalMNudge}`,\n minHeight: '32px',\n width: '32px',\n },\n dismissOnly: {\n borderRadius: tokens.borderRadiusXLarge,\n width: 'unset',\n borderLeftColor: tokens.colorTransparentStroke,\n backgroundColor: tokens.colorNeutralBackground3,\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n },\n});\n\nconst usePrimaryDismissNextStyles = makeStyles({\n sharedStyles: {\n border: 'none',\n backgroundColor: tokens.colorNeutralBackground3,\n },\n sharedInteractiveStyles: {\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground3Hover,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n },\n },\n});\n\nconst useRootNextStyles = makeStyles({\n root: {\n outline: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n borderRadius: tokens.borderRadiusXLarge,\n },\n});\n\nconst useFocusStyles = makeStyles({\n primaryActionButton: createCustomFocusIndicatorStyle({\n borderTopRightRadius: tokens.borderRadiusNone,\n borderBottomRightRadius: tokens.borderRadiusNone,\n }),\n\n dismissButton: createCustomFocusIndicatorStyle({\n borderTopLeftRadius: tokens.borderRadiusNone,\n borderBottomLeftRadius: tokens.borderRadiusNone,\n }),\n});\n\n/**\n * Apply styling to the Attachment slots based on the state\n */\nexport const useAttachmentStyles_unstable = (state: AttachmentState): AttachmentState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const primaryActionBaseClassName = usePrimaryActionBaseClassName();\n const dismissButtonBaseClassName = useDismissButtonBaseClassName();\n const dismissButtonCurrentStyles = useDismissButtonCurrentStyles();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const dismissIconBaseClassName = useDismissIconBaseClassName();\n const dismissIconNextStyles = useDismissIconNextStyles();\n const progressBarStyles = useProgressBarStyles();\n const primaryActionStyles = usePrimaryActionStyles();\n const imageOnlyStyles = useImageOnlyStyles();\n const smallStyles = useSmallStyles();\n const primaryActionNextStyles = usePrimaryActionNextStyles();\n const dismissButtonNextStyles = useDismissButtonNextStyles();\n const primaryDismissNextStyles = usePrimaryDismissNextStyles();\n const rootNextStyles = useRootNextStyles();\n const focusStyles = useFocusStyles();\n const { imageOnly, primaryAction, size, mode, designVersion, dismissOnly } = state;\n\n state.root.className = mergeClasses(\n attachmentClassNames.root,\n rootBaseClassName,\n designVersion === 'next' && rootNextStyles.root,\n state.root.className,\n );\n state.primaryAction.className = mergeClasses(\n attachmentClassNames.primaryAction,\n primaryActionBaseClassName,\n size === 'small' && smallStyles.primaryAction,\n primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button,\n imageOnly && imageOnlyStyles.primaryAction,\n designVersion === 'next' && primaryDismissNextStyles.sharedStyles,\n designVersion === 'next' &&\n primaryAction.as !== 'span' &&\n !state.isLoading &&\n primaryDismissNextStyles.sharedInteractiveStyles,\n designVersion === 'next' && primaryActionNextStyles.root,\n designVersion === 'next' && primaryActionNextStyles[mode],\n focusStyles.primaryActionButton,\n state.primaryAction.className,\n );\n state.dismissButton.className = mergeClasses(\n attachmentClassNames.dismissButton,\n dismissButtonBaseClassName,\n designVersion === 'current' && dismissButtonCurrentStyles.root,\n size === 'small' && smallStyles.dismissButton,\n designVersion === 'next' && primaryDismissNextStyles.sharedStyles,\n designVersion === 'next' && primaryDismissNextStyles.sharedInteractiveStyles,\n designVersion === 'next' && dismissButtonNextStyles.root,\n designVersion === 'next' && dismissButtonNextStyles[mode],\n designVersion === 'next' && dismissOnly && dismissButtonNextStyles.dismissOnly,\n designVersion === 'next' && !dismissOnly && dismissButtonNextStyles.withPrimary,\n focusStyles.dismissButton,\n state.dismissButton.className,\n );\n if (state.media) {\n state.media.className = mergeClasses(\n attachmentClassNames.media,\n mediaBaseClassName,\n size === 'small' && smallStyles.media,\n state.media.className,\n );\n }\n state.content.className = mergeClasses(\n attachmentClassNames.content,\n contentBaseClassName,\n size === 'small' && smallStyles.content,\n imageOnly && imageOnlyStyles.content,\n state.content.className,\n );\n state.dismissIcon.className = mergeClasses(\n attachmentClassNames.dismissIcon,\n dismissIconBaseClassName,\n size === 'small' && smallStyles.dismissIcon,\n designVersion === 'next' && dismissOnly && dismissIconNextStyles.dismissOnly,\n state.dismissIcon.className,\n );\n\n if (state.progress) {\n state.progress.className = mergeClasses(\n attachmentClassNames.progress,\n progressBarStyles.progress,\n state.progress.className,\n );\n\n const bar = slot.optional(state.progress.bar, { elementType: 'div', renderByDefault: true });\n if (bar) {\n if (state.progress.value === undefined) {\n bar.className = mergeClasses(progressBarStyles.indeterminateProgressBar, bar.className);\n } else {\n bar.className = mergeClasses(progressBarStyles.regularProgressBar, bar.className);\n }\n state.progress.bar = bar;\n }\n }\n\n return state;\n};\n"],"names":["createCustomFocusIndicatorStyle","makeResetStyles","makeStyles","mergeClasses","slot","typographyStyles","tokens","useProgressBarStyles","attachmentClassNames","root","primaryAction","dismissButton","media","content","dismissIcon","progress","ATTACHMENT_MAXWIDTH","SMALL_ATTACHMENT_SIZE","ATTACHMENT_SIZE","useRootBaseClassName","display","flexWrap","verticalAlign","boxSizing","width","alignSelf","position","buttonBaseStyles","alignItems","backgroundColor","colorSubtleBackground","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","columnGap","spacingHorizontalSNudge","color","colorNeutralForeground1","cursor","justifyContent","outline","strokeWidthThick","colorStrokeFocus2","outlineOffset","zIndex","usePrimaryActionBaseClassName","borderTopRightRadius","borderRadiusNone","borderBottomRightRadius","borderRightStyle","maxWidth","spacingHorizontalXXS","spacingHorizontalXS","padding","spacingVerticalXS","spacingHorizontalS","usePrimaryActionStyles","button","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","useDismissButtonBaseClassName","minWidth","borderLeftColor","borderTopLeftRadius","borderBottomLeftRadius","colorNeutralForeground2BrandHover","colorNeutralForeground2BrandPressed","useDismissButtonCurrentStyles","colorBrandForegroundLinkHover","useMediaBaseClassName","fontSize","height","lineHeight","useContentBaseClassName","overflowX","textOverflow","whiteSpace","body1","useDismissIconBaseClassName","borderRadiusCircular","colorTransparentStroke","spacingVerticalXXS","useDismissIconNextStyles","dismissOnly","useImageOnlyStyles","useOverflowStyles","overflow","useSmallStyles","caption1","usePrimaryActionNextStyles","borderRadiusXLarge","canvas","spacingVerticalNone","minHeight","sidecar","useDismissButtonNextStyles","colorNeutralForeground2","borderLeftWidth","borderLeftStyle","withPrimary","spacingHorizontalMNudge","colorNeutralBackground3","usePrimaryDismissNextStyles","sharedStyles","sharedInteractiveStyles","colorNeutralBackground3Hover","colorNeutralBackground3Pressed","useRootNextStyles","useFocusStyles","primaryActionButton","useAttachmentStyles_unstable","state","rootBaseClassName","primaryActionBaseClassName","dismissButtonBaseClassName","dismissButtonCurrentStyles","mediaBaseClassName","contentBaseClassName","dismissIconBaseClassName","dismissIconNextStyles","progressBarStyles","primaryActionStyles","imageOnlyStyles","smallStyles","primaryActionNextStyles","dismissButtonNextStyles","primaryDismissNextStyles","rootNextStyles","focusStyles","imageOnly","size","mode","designVersion","className","as","isLoading","bar","optional","elementType","renderByDefault","value","undefined","indeterminateProgressBar","regularProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,+BAA+B,EAC/BC,eAAe,EACfC,UAAU,EACVC,YAAY,EACZC,IAAI,EACJC,gBAAgB,QACX,6BAA6B;AACpC,SAASC,MAAM,QAAQ,2BAA2B;AAClD,SAASC,oBAAoB,QAAQ,uCAAuC;AAI5E,OAAO,MAAMC,uBAAwD;I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tG,OAAO,CAAC4H,SAAS;IAEzBtB,MAAMrG,WAAW,CAAC2H,SAAS,GAAGtI,aAC5BK,qBAAqBM,WAAW,EAChC4G,0BACAY,SAAS,WAAWP,YAAYjH,WAAW,EAC3C0H,kBAAkB,UAAUjD,eAAeoC,sBAAsBpC,WAAW,EAC5E4B,MAAMrG,WAAW,CAAC2H,SAAS;IAG7B,IAAItB,MAAMpG,QAAQ,EAAE;QAClBoG,MAAMpG,QAAQ,CAAC0H,SAAS,GAAGtI,aACzBK,qBAAqBO,QAAQ,EAC7B6G,kBAAkB7G,QAAQ,EAC1BoG,MAAMpG,QAAQ,CAAC0H,SAAS;QAG1B,MAAMG,MAAMxI,KAAKyI,QAAQ,CAAC1B,MAAMpG,QAAQ,CAAC6H,GAAG,EAAE;YAAEE,aAAa;YAAOC,iBAAiB;QAAK;QAC1F,IAAIH,KAAK;YACP,IAAIzB,MAAMpG,QAAQ,CAACiI,KAAK,KAAKC,WAAW;gBACtCL,IAAIH,SAAS,GAAGtI,aAAayH,kBAAkBsB,wBAAwB,EAAEN,IAAIH,SAAS;YACxF,OAAO;gBACLG,IAAIH,SAAS,GAAGtI,aAAayH,kBAAkBuB,kBAAkB,EAAEP,IAAIH,SAAS;YAClF;YACAtB,MAAMpG,QAAQ,CAAC6H,GAAG,GAAGA;QACvB;IACF;IAEA,OAAOzB;AACT,EAAE"}
|
|
@@ -4,12 +4,11 @@ import { renderAttachmentList_unstable } from './renderAttachmentList';
|
|
|
4
4
|
import { useAttachmentListStyles_unstable } from './useAttachmentListStyles.styles';
|
|
5
5
|
import { useAttachmentListContextValues_unstable } from './useAttachmentListContextValues';
|
|
6
6
|
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
7
|
-
export const AttachmentList = /*#__PURE__*/React.forwardRef((props, ref)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
export const AttachmentList = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
8
|
+
const state = useAttachmentList_unstable(props, ref);
|
|
9
|
+
const contextValues = useAttachmentListContextValues_unstable(state);
|
|
10
|
+
useAttachmentListStyles_unstable(state);
|
|
11
|
+
useCustomStyleHook('useAttachmentListStyles')(state);
|
|
12
|
+
return renderAttachmentList_unstable(state, contextValues);
|
|
13
13
|
});
|
|
14
14
|
AttachmentList.displayName = 'AttachmentList';
|
|
15
|
-
//# sourceMappingURL=AttachmentList.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=AttachmentList.types.js.map
|
|
1
|
+
export { };
|
|
@@ -2,4 +2,3 @@ export { AttachmentList } from './AttachmentList';
|
|
|
2
2
|
export { renderAttachmentList_unstable } from './renderAttachmentList';
|
|
3
3
|
export { useAttachmentList_unstable } from './useAttachmentList';
|
|
4
4
|
export { attachmentListClassNames, useAttachmentListStyles_unstable } from './useAttachmentListStyles.styles';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { Overflow, assertSlots } from '@fluentui/react-components';
|
|
3
3
|
import { AttachmentListProvider } from '../../contexts/attachmentListContext';
|
|
4
4
|
import { AttachmentOverflowMenu } from '../AttachmentOverflowMenu';
|
|
5
5
|
/**
|
|
6
6
|
* Render the final JSX of AttachmentList
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
*/ export const renderAttachmentList_unstable = (state, contextValues)=>{
|
|
8
|
+
assertSlots(state);
|
|
9
|
+
const { overflowMenuProps, root, shouldUseOverflow } = state;
|
|
10
|
+
return /*#__PURE__*/ _jsx(AttachmentListProvider, {
|
|
11
|
+
value: contextValues.attachmentList,
|
|
12
|
+
children: shouldUseOverflow && state.overflowMenuButton && state.menuList && state.menuPopover ? /*#__PURE__*/ _jsx(Overflow, {
|
|
13
|
+
ref: root.ref,
|
|
14
|
+
children: /*#__PURE__*/ _jsxs(state.root, {
|
|
15
|
+
children: [
|
|
16
|
+
root.children,
|
|
17
|
+
/*#__PURE__*/ _jsxs(AttachmentOverflowMenu, {
|
|
18
|
+
positioning: 'above',
|
|
19
|
+
...overflowMenuProps,
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ _jsx(state.overflowMenuButton, {}),
|
|
22
|
+
/*#__PURE__*/ _jsx(state.menuPopover, {
|
|
23
|
+
children: /*#__PURE__*/ _jsx(state.menuList, {})
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
}) : /*#__PURE__*/ _jsx(state.root, {})
|
|
30
|
+
});
|
|
30
31
|
};
|
|
31
|
-
//# sourceMappingURL=renderAttachmentList.js.map
|
|
@@ -16,130 +16,119 @@ import { useDesignVersion } from '@fluentui-copilot/react-provider';
|
|
|
16
16
|
*
|
|
17
17
|
* @param props - props from this instance of AttachmentList
|
|
18
18
|
* @param ref - reference to root HTMLElement of AttachmentList
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var _findLastFocusable;
|
|
57
|
-
(_findLastFocusable = findLastFocusable(innerRef.current)) === null || _findLastFocusable === void 0 ? void 0 : _findLastFocusable.focus();
|
|
58
|
-
}, 0);
|
|
19
|
+
*/ export const useAttachmentList_unstable = (props, ref)=>{
|
|
20
|
+
const { children, maxVisibleAttachments, onAttachmentDismiss, overflowMenuProps } = props;
|
|
21
|
+
const innerRef = React.useRef(null);
|
|
22
|
+
const [setTimeout] = useTimeout();
|
|
23
|
+
const { targetDocument } = useFluent();
|
|
24
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
25
|
+
const { findNextFocusable, findPrevFocusable, findLastFocusable } = useFocusFinders();
|
|
26
|
+
const handleAttachmentDismiss = useEventCallback((e, data)=>{
|
|
27
|
+
var _innerRef_current;
|
|
28
|
+
if (!onAttachmentDismiss) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
onAttachmentDismiss(e, data);
|
|
32
|
+
// set focus after attachment dismiss
|
|
33
|
+
const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
|
|
34
|
+
if ((_innerRef_current = innerRef.current) === null || _innerRef_current === void 0 ? void 0 : _innerRef_current.contains(activeElement)) {
|
|
35
|
+
// focus on next attachment only if the active element is within the current attachment list
|
|
36
|
+
const next = findNextFocusable(activeElement, {
|
|
37
|
+
container: innerRef.current
|
|
38
|
+
});
|
|
39
|
+
if (next) {
|
|
40
|
+
// focus on the overflow button if the next focusable element is the overflow button.
|
|
41
|
+
// if overflow button is removed from the DOM, focus on the last focusable element in the attachment list.
|
|
42
|
+
if (next.classList.contains(attachmentOverflowMenuButtonClassNames.root)) {
|
|
43
|
+
setTimeout(()=>{
|
|
44
|
+
var _findLastFocusable;
|
|
45
|
+
(_findLastFocusable = findLastFocusable(innerRef.current)) === null || _findLastFocusable === void 0 ? void 0 : _findLastFocusable.focus();
|
|
46
|
+
}, 0);
|
|
47
|
+
} else {
|
|
48
|
+
next.focus();
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
const prev = findPrevFocusable(activeElement === null || activeElement === void 0 ? void 0 : activeElement.parentElement, {
|
|
52
|
+
container: innerRef.current
|
|
53
|
+
});
|
|
54
|
+
prev === null || prev === void 0 ? void 0 : prev.focus();
|
|
55
|
+
}
|
|
59
56
|
} else {
|
|
60
|
-
|
|
57
|
+
// Handles keyboard focus when attachment removed is in the overflow menu. Also handles focus when the overflow button is removed from the DOM.
|
|
58
|
+
setTimeout(()=>{
|
|
59
|
+
var _findLastFocusable;
|
|
60
|
+
(_findLastFocusable = findLastFocusable(innerRef.current)) === null || _findLastFocusable === void 0 ? void 0 : _findLastFocusable.focus();
|
|
61
|
+
}, 0);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
const styles = useOverflowStyles();
|
|
65
|
+
const resolvedChildren = useOverflowMaxVisibleItems({
|
|
66
|
+
children,
|
|
67
|
+
maxVisibleItems: maxVisibleAttachments,
|
|
68
|
+
overflowClassName: styles.overflow
|
|
69
|
+
});
|
|
70
|
+
const attachmentOverflowMenuItems = React.useMemo(()=>{
|
|
71
|
+
if (resolvedChildren && Array.isArray(resolvedChildren)) {
|
|
72
|
+
return resolvedChildren.filter((child)=>/*#__PURE__*/ React.isValidElement(child)).map((child)=>child.props).map((attachment)=>{
|
|
73
|
+
const dismissButton = slot.optional(attachment.dismissButton, {
|
|
74
|
+
elementType: 'button'
|
|
75
|
+
});
|
|
76
|
+
return /*#__PURE__*/ React.createElement(AttachmentOverflowMenuItem, {
|
|
77
|
+
...attachment,
|
|
78
|
+
key: attachment.id,
|
|
79
|
+
onClick: dismissButton === null || dismissButton === void 0 ? void 0 : dismissButton.onClick
|
|
80
|
+
});
|
|
81
|
+
});
|
|
61
82
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
overflowMenuButton: 'span'
|
|
114
|
-
},
|
|
115
|
-
root: slot.always(getIntrinsicElementProps('div', {
|
|
116
|
-
'aria-label': 'Attachments',
|
|
117
|
-
ref: useMergedRefs(ref, innerRef),
|
|
118
|
-
role: 'toolbar',
|
|
119
|
-
...arrowNavigationProps,
|
|
120
|
-
...props,
|
|
121
|
-
children: resolvedChildren
|
|
122
|
-
}), {
|
|
123
|
-
elementType: 'div'
|
|
124
|
-
}),
|
|
125
|
-
menuList: slot.optional(props.menuList, {
|
|
126
|
-
defaultProps: {
|
|
127
|
-
children: attachmentOverflowMenuItems
|
|
128
|
-
},
|
|
129
|
-
elementType: MenuList,
|
|
130
|
-
renderByDefault: true
|
|
131
|
-
}),
|
|
132
|
-
menuPopover: slot.optional(props.menuPopover, {
|
|
133
|
-
elementType: MenuPopover,
|
|
134
|
-
renderByDefault: true
|
|
135
|
-
}),
|
|
136
|
-
overflowMenuButton: slot.optional(props.overflowMenuButton, {
|
|
137
|
-
defaultProps: {
|
|
138
|
-
children: /*#__PURE__*/React.createElement(AttachmentOverflowMenuButton, null)
|
|
139
|
-
},
|
|
140
|
-
elementType: 'span',
|
|
141
|
-
renderByDefault: true
|
|
142
|
-
})
|
|
143
|
-
};
|
|
83
|
+
return [];
|
|
84
|
+
}, [
|
|
85
|
+
resolvedChildren
|
|
86
|
+
]);
|
|
87
|
+
const arrowNavigationProps = useArrowNavigationGroup({
|
|
88
|
+
circular: true,
|
|
89
|
+
axis: 'both',
|
|
90
|
+
memorizeCurrent: true
|
|
91
|
+
});
|
|
92
|
+
const shouldUseOverflow = maxVisibleAttachments !== undefined;
|
|
93
|
+
return {
|
|
94
|
+
designVersion,
|
|
95
|
+
onAttachmentDismiss: handleAttachmentDismiss,
|
|
96
|
+
shouldUseOverflow,
|
|
97
|
+
numberOfAttachments: resolvedChildren.length,
|
|
98
|
+
overflowMenuProps,
|
|
99
|
+
components: {
|
|
100
|
+
root: 'div',
|
|
101
|
+
menuList: MenuList,
|
|
102
|
+
menuPopover: MenuPopover,
|
|
103
|
+
overflowMenuButton: 'span'
|
|
104
|
+
},
|
|
105
|
+
root: slot.always(getIntrinsicElementProps('div', {
|
|
106
|
+
'aria-label': 'Attachments',
|
|
107
|
+
ref: useMergedRefs(ref, innerRef),
|
|
108
|
+
role: 'toolbar',
|
|
109
|
+
...arrowNavigationProps,
|
|
110
|
+
...props,
|
|
111
|
+
children: resolvedChildren
|
|
112
|
+
}), {
|
|
113
|
+
elementType: 'div'
|
|
114
|
+
}),
|
|
115
|
+
menuList: slot.optional(props.menuList, {
|
|
116
|
+
defaultProps: {
|
|
117
|
+
children: attachmentOverflowMenuItems
|
|
118
|
+
},
|
|
119
|
+
elementType: MenuList,
|
|
120
|
+
renderByDefault: true
|
|
121
|
+
}),
|
|
122
|
+
menuPopover: slot.optional(props.menuPopover, {
|
|
123
|
+
elementType: MenuPopover,
|
|
124
|
+
renderByDefault: true
|
|
125
|
+
}),
|
|
126
|
+
overflowMenuButton: slot.optional(props.overflowMenuButton, {
|
|
127
|
+
defaultProps: {
|
|
128
|
+
children: /*#__PURE__*/ React.createElement(AttachmentOverflowMenuButton, null)
|
|
129
|
+
},
|
|
130
|
+
elementType: 'span',
|
|
131
|
+
renderByDefault: true
|
|
132
|
+
})
|
|
133
|
+
};
|
|
144
134
|
};
|
|
145
|
-
//# sourceMappingURL=useAttachmentList.js.map
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
export function useAttachmentListContextValues_unstable(state) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
return {
|
|
14
|
-
attachmentList
|
|
15
|
-
};
|
|
2
|
+
const { numberOfAttachments, onAttachmentDismiss, shouldUseOverflow } = state;
|
|
3
|
+
// This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
|
|
4
|
+
const attachmentList = {
|
|
5
|
+
numberOfAttachments,
|
|
6
|
+
onAttachmentDismiss,
|
|
7
|
+
shouldUseOverflow
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
attachmentList
|
|
11
|
+
};
|
|
16
12
|
}
|
|
17
|
-
//# sourceMappingURL=useAttachmentListContextValues.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const attachmentListClassNames = {
|
|
4
|
+
root: 'fai-AttachmentList',
|
|
5
|
+
menuList: 'fai-AttachmentList__menuList',
|
|
6
|
+
menuPopover: 'fai-AttachmentList__menuPopover',
|
|
7
|
+
overflowMenuButton: 'fai-AttachmentList__overflowMenuButton'
|
|
8
|
+
};
|
|
9
|
+
const useRootBaseClassName = makeResetStyles({
|
|
10
|
+
columnGap: tokens.spacingHorizontalSNudge,
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'row',
|
|
13
|
+
flexShrink: 0,
|
|
14
|
+
flexWrap: 'wrap',
|
|
15
|
+
rowGap: tokens.spacingVerticalXS
|
|
16
|
+
});
|
|
17
|
+
const useOverflowMenuButtonBaseClassName = makeResetStyles({
|
|
18
|
+
display: 'inline-flex'
|
|
19
|
+
});
|
|
20
|
+
const useOverflowMenuPopoverNextStyles = makeStyles({
|
|
21
|
+
borderRadius: {
|
|
22
|
+
borderRadius: tokens.borderRadius4XL
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Apply styling to the AttachmentList slots based on the state
|
|
27
|
+
*/ export const useAttachmentListStyles_unstable = (state)=>{
|
|
28
|
+
'use no memo';
|
|
29
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
30
|
+
const overflowMenuButtonClassName = useOverflowMenuButtonBaseClassName();
|
|
31
|
+
const overflowMenuPopoverNextStyles = useOverflowMenuPopoverNextStyles();
|
|
32
|
+
const { designVersion } = state;
|
|
33
|
+
state.root.className = mergeClasses(attachmentListClassNames.root, rootBaseClassName, state.root.className);
|
|
34
|
+
if (state.menuList) {
|
|
35
|
+
state.menuList.className = mergeClasses(attachmentListClassNames.menuList, state.menuList.className);
|
|
36
|
+
}
|
|
37
|
+
if (state.menuPopover) {
|
|
38
|
+
state.menuPopover.className = mergeClasses(attachmentListClassNames.menuPopover, designVersion === 'next' && overflowMenuPopoverNextStyles.borderRadius, state.menuPopover.className);
|
|
39
|
+
}
|
|
40
|
+
if (state.overflowMenuButton) {
|
|
41
|
+
state.overflowMenuButton.className = mergeClasses(attachmentListClassNames.overflowMenuButton, overflowMenuButtonClassName, state.overflowMenuButton.className);
|
|
42
|
+
}
|
|
43
|
+
return state;
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentListStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { AttachmentListSlots, AttachmentListState } from './AttachmentList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentListClassNames: SlotClassNames<AttachmentListSlots> = {\n root: 'fai-AttachmentList',\n menuList: 'fai-AttachmentList__menuList',\n menuPopover: 'fai-AttachmentList__menuPopover',\n overflowMenuButton: 'fai-AttachmentList__overflowMenuButton',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n columnGap: tokens.spacingHorizontalSNudge,\n display: 'flex',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'wrap',\n rowGap: tokens.spacingVerticalXS,\n});\n\nconst useOverflowMenuButtonBaseClassName = makeResetStyles({\n display: 'inline-flex',\n});\n\nconst useOverflowMenuPopoverNextStyles = makeStyles({\n borderRadius: {\n borderRadius: tokens.borderRadius4XL,\n },\n});\n\n/**\n * Apply styling to the AttachmentList slots based on the state\n */\nexport const useAttachmentListStyles_unstable = (state: AttachmentListState): AttachmentListState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const overflowMenuButtonClassName = useOverflowMenuButtonBaseClassName();\n const overflowMenuPopoverNextStyles = useOverflowMenuPopoverNextStyles();\n const { designVersion } = state;\n\n state.root.className = mergeClasses(attachmentListClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.menuList) {\n state.menuList.className = mergeClasses(attachmentListClassNames.menuList, state.menuList.className);\n }\n if (state.menuPopover) {\n state.menuPopover.className = mergeClasses(\n attachmentListClassNames.menuPopover,\n designVersion === 'next' && overflowMenuPopoverNextStyles.borderRadius,\n state.menuPopover.className,\n );\n }\n\n if (state.overflowMenuButton) {\n state.overflowMenuButton.className = mergeClasses(\n attachmentListClassNames.overflowMenuButton,\n overflowMenuButtonClassName,\n state.overflowMenuButton.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","attachmentListClassNames","root","menuList","menuPopover","overflowMenuButton","useRootBaseClassName","columnGap","spacingHorizontalSNudge","display","flexDirection","flexShrink","flexWrap","rowGap","spacingVerticalXS","useOverflowMenuButtonBaseClassName","useOverflowMenuPopoverNextStyles","borderRadius","borderRadius4XL","useAttachmentListStyles_unstable","state","rootBaseClassName","overflowMenuButtonClassName","overflowMenuPopoverNextStyles","designVersion","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,6BAA6B;AACvF,SAASC,MAAM,QAAQ,2BAA2B;AAIlD,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;IACNC,UAAU;IACVC,aAAa;IACbC,oBAAoB;AACtB,EAAE;AAEF,MAAMC,uBAAuBT,gBAAgB;IAC3CU,WAAWP,OAAOQ,uBAAuB;IACzCC,SAAS;IACTC,eAAe;IACfC,YAAY;IACZC,UAAU;IACVC,QAAQb,OAAOc,iBAAiB;AAClC;AAEA,MAAMC,qCAAqClB,gBAAgB;IACzDY,SAAS;AACX;AAEA,MAAMO,mCAAmClB,WAAW;IAClDmB,cAAc;QACZA,cAAcjB,OAAOkB,eAAe;IACtC;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C;IAEA,MAAMC,oBAAoBf;IAC1B,MAAMgB,8BAA8BP;IACpC,MAAMQ,gCAAgCP;IACtC,MAAM,EAAEQ,aAAa,EAAE,GAAGJ;IAE1BA,MAAMlB,IAAI,CAACuB,SAAS,GAAG1B,aAAaE,yBAAyBC,IAAI,EAAEmB,mBAAmBD,MAAMlB,IAAI,CAACuB,SAAS;IAE1G,IAAIL,MAAMjB,QAAQ,EAAE;QAClBiB,MAAMjB,QAAQ,CAACsB,SAAS,GAAG1B,aAAaE,yBAAyBE,QAAQ,EAAEiB,MAAMjB,QAAQ,CAACsB,SAAS;IACrG;IACA,IAAIL,MAAMhB,WAAW,EAAE;QACrBgB,MAAMhB,WAAW,CAACqB,SAAS,GAAG1B,aAC5BE,yBAAyBG,WAAW,EACpCoB,kBAAkB,UAAUD,8BAA8BN,YAAY,EACtEG,MAAMhB,WAAW,CAACqB,SAAS;IAE/B;IAEA,IAAIL,MAAMf,kBAAkB,EAAE;QAC5Be,MAAMf,kBAAkB,CAACoB,SAAS,GAAG1B,aACnCE,yBAAyBI,kBAAkB,EAC3CiB,6BACAF,MAAMf,kBAAkB,CAACoB,SAAS;IAEtC;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -2,14 +2,13 @@ import { useAttachmentOverflowMenu_unstable } from './useAttachmentOverflowMenu'
|
|
|
2
2
|
import { renderAttachmentOverflowMenu_unstable } from './renderAttachmentOverflowMenu';
|
|
3
3
|
import { useAttachmentOverflowMenuContextValues_unstable } from './useAttachmentOverflowMenuContextValues';
|
|
4
4
|
import { useMenuContextValues_unstable } from '@fluentui/react-components';
|
|
5
|
-
export const AttachmentOverflowMenu = props
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
export const AttachmentOverflowMenu = (props)=>{
|
|
6
|
+
const state = useAttachmentOverflowMenu_unstable(props);
|
|
7
|
+
const menuContextValues = useMenuContextValues_unstable(state);
|
|
8
|
+
const attachmentOverflowMenuContextValues = useAttachmentOverflowMenuContextValues_unstable(state);
|
|
9
|
+
return renderAttachmentOverflowMenu_unstable(state, {
|
|
10
|
+
menuContextValues,
|
|
11
|
+
attachmentOverflowMenuContextValues
|
|
12
|
+
});
|
|
13
13
|
};
|
|
14
14
|
AttachmentOverflowMenu.displayName = 'AttachmentOverflowMenu';
|
|
15
|
-
//# sourceMappingURL=AttachmentOverflowMenu.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=AttachmentOverflowMenu.types.js.map
|
|
1
|
+
export { };
|
|
@@ -2,4 +2,3 @@ export { AttachmentOverflowMenu } from './AttachmentOverflowMenu';
|
|
|
2
2
|
export { renderAttachmentOverflowMenu_unstable } from './renderAttachmentOverflowMenu';
|
|
3
3
|
export { useAttachmentOverflowMenu_unstable } from './useAttachmentOverflowMenu';
|
|
4
4
|
export { useAttachmentOverflowMenuContextValues_unstable } from './useAttachmentOverflowMenuContextValues';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots, renderMenu_unstable } from '@fluentui/react-components';
|
|
3
3
|
import { AttachmentOverflowMenuProvider } from '../../contexts/attachmentOverflowMenuContext';
|
|
4
4
|
/**
|
|
5
5
|
* Render the final JSX of AttachmentOverflowMenu
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return state.isOverflowing ? /*#__PURE__*/_jsx(AttachmentOverflowMenuProvider, {
|
|
14
|
-
value: attachmentOverflowMenuContextValues.attachmentOverflowMenu,
|
|
15
|
-
children: renderMenu_unstable(state, menuContextValues)
|
|
16
|
-
}) : null;
|
|
6
|
+
*/ export const renderAttachmentOverflowMenu_unstable = (state, contextValues)=>{
|
|
7
|
+
const { menuContextValues, attachmentOverflowMenuContextValues } = contextValues;
|
|
8
|
+
assertSlots(state);
|
|
9
|
+
return state.isOverflowing ? /*#__PURE__*/ _jsx(AttachmentOverflowMenuProvider, {
|
|
10
|
+
value: attachmentOverflowMenuContextValues.attachmentOverflowMenu,
|
|
11
|
+
children: renderMenu_unstable(state, menuContextValues)
|
|
12
|
+
}) : null;
|
|
17
13
|
};
|
|
18
|
-
//# sourceMappingURL=renderAttachmentOverflowMenu.js.map
|
|
@@ -6,19 +6,13 @@ import { useMenu_unstable, useOverflowMenu } from '@fluentui/react-components';
|
|
|
6
6
|
* before being passed to renderAttachmentOverflowMenu_unstable.
|
|
7
7
|
*
|
|
8
8
|
* @param props - props from this instance of AttachmentOverflowMenu
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
...menuState,
|
|
19
|
-
isOverflowing,
|
|
20
|
-
overflowButtonRef,
|
|
21
|
-
overflowCount
|
|
22
|
-
};
|
|
9
|
+
*/ export const useAttachmentOverflowMenu_unstable = (props)=>{
|
|
10
|
+
const menuState = useMenu_unstable(props);
|
|
11
|
+
const { isOverflowing, ref: overflowButtonRef, overflowCount } = useOverflowMenu();
|
|
12
|
+
return {
|
|
13
|
+
...menuState,
|
|
14
|
+
isOverflowing,
|
|
15
|
+
overflowButtonRef,
|
|
16
|
+
overflowCount
|
|
17
|
+
};
|
|
23
18
|
};
|
|
24
|
-
//# sourceMappingURL=useAttachmentOverflowMenu.js.map
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
export function useAttachmentOverflowMenuContextValues_unstable(state) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
return {
|
|
14
|
-
attachmentOverflowMenu
|
|
15
|
-
};
|
|
2
|
+
const { isOverflowing, overflowButtonRef, overflowCount } = state;
|
|
3
|
+
// This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
|
|
4
|
+
const attachmentOverflowMenu = {
|
|
5
|
+
isOverflowing,
|
|
6
|
+
overflowButtonRef,
|
|
7
|
+
overflowCount
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
attachmentOverflowMenu
|
|
11
|
+
};
|
|
16
12
|
}
|
|
17
|
-
//# sourceMappingURL=useAttachmentOverflowMenuContextValues.js.map
|