@fluentui-copilot/react-attachments 0.12.5-hotfix.1 → 0.12.5-hotfix.2
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 +4 -4
- package/CHANGELOG.md +5 -5
- package/lib/AgentTag.js +1 -0
- package/lib/Attachment.js +1 -0
- package/lib/AttachmentList.js +1 -0
- package/lib/AttachmentOverflowMenu.js +1 -0
- package/lib/AttachmentOverflowMenuButton.js +1 -0
- package/lib/AttachmentOverflowMenuItem.js +1 -0
- package/lib/AttachmentTag.js +1 -0
- package/lib/AttachmentTagItem.js +1 -0
- package/lib/AttachmentTagList.js +1 -0
- package/lib/components/AgentTag/AgentTag.js +5 -4
- package/lib/components/AgentTag/AgentTag.types.js +2 -1
- package/lib/components/AgentTag/index.js +1 -0
- package/lib/components/AgentTag/renderAgentTag.js +5 -3
- package/lib/components/AgentTag/useAgentTag.js +9 -7
- package/lib/components/AgentTag/useAgentTagStyles.styles.raw.js +57 -52
- package/lib/components/Attachment/Attachment.js +6 -5
- package/lib/components/Attachment/Attachment.types.js +2 -1
- package/lib/components/Attachment/index.js +1 -0
- package/lib/components/Attachment/renderAttachment.js +31 -36
- package/lib/components/Attachment/useAttachment.js +95 -85
- package/lib/components/Attachment/useAttachmentStyles.styles.raw.js +268 -258
- package/lib/components/AttachmentList/AttachmentList.js +7 -6
- package/lib/components/AttachmentList/AttachmentList.types.js +2 -1
- package/lib/components/AttachmentList/index.js +1 -0
- package/lib/components/AttachmentList/renderAttachmentList.js +25 -25
- package/lib/components/AttachmentList/useAttachmentList.js +124 -113
- package/lib/components/AttachmentList/useAttachmentListContextValues.js +15 -10
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.raw.js +36 -31
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +9 -8
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +2 -1
- package/lib/components/AttachmentOverflowMenu/index.js +1 -0
- package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +13 -8
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +15 -9
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +15 -10
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +6 -5
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +2 -1
- package/lib/components/AttachmentOverflowMenuButton/index.js +1 -0
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +10 -11
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +59 -51
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js +89 -82
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +5 -4
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +2 -1
- package/lib/components/AttachmentOverflowMenuItem/index.js +1 -0
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +8 -9
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +49 -41
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +49 -43
- package/lib/components/AttachmentTag/AttachmentTag.js +7 -5
- package/lib/components/AttachmentTag/AttachmentTag.types.js +2 -1
- package/lib/components/AttachmentTag/index.js +1 -0
- package/lib/components/AttachmentTag/renderAttachmentTag.js +8 -10
- package/lib/components/AttachmentTag/useAttachmentTag.js +11 -9
- package/lib/components/AttachmentTag/useAttachmentTagStyles.styles.raw.js +83 -76
- package/lib/components/AttachmentTagItem/AttachmentTagItem.js +6 -4
- package/lib/components/AttachmentTagItem/AttachmentTagItem.types.js +2 -1
- package/lib/components/AttachmentTagItem/index.js +1 -0
- package/lib/components/AttachmentTagItem/renderAttachmentTagItem.js +8 -10
- package/lib/components/AttachmentTagItem/useAttachmentTagItem.js +11 -9
- package/lib/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.raw.js +27 -23
- package/lib/components/AttachmentTagList/AttachmentTagList.js +8 -6
- package/lib/components/AttachmentTagList/AttachmentTagList.types.js +2 -1
- package/lib/components/AttachmentTagList/index.js +1 -0
- package/lib/components/AttachmentTagList/renderAttachmentTagList.js +9 -7
- package/lib/components/AttachmentTagList/useAttachmentTagList.js +25 -21
- package/lib/components/AttachmentTagList/useAttachmentTagListContextValues.js +11 -8
- package/lib/components/AttachmentTagList/useAttachmentTagListStyles.styles.raw.js +15 -12
- package/lib/components/index.js +1 -0
- package/lib/components/utils/useAttachmentTagSlots.js +52 -45
- package/lib/components/utils/useProgressBarStyles.styles.raw.js +36 -34
- package/lib/contexts/attachmentListContext.js +5 -4
- package/lib/contexts/attachmentOverflowMenuContext.js +5 -4
- package/lib/contexts/attachmentTagListContext.js +3 -2
- package/lib/index.js +1 -0
- package/lib-commonjs/AgentTag.js +1 -0
- package/lib-commonjs/Attachment.js +1 -0
- package/lib-commonjs/AttachmentList.js +1 -0
- package/lib-commonjs/AttachmentOverflowMenu.js +1 -0
- package/lib-commonjs/AttachmentOverflowMenuButton.js +1 -0
- package/lib-commonjs/AttachmentOverflowMenuItem.js +1 -0
- package/lib-commonjs/AttachmentTag.js +1 -0
- package/lib-commonjs/AttachmentTagItem.js +1 -0
- package/lib-commonjs/AttachmentTagList.js +1 -0
- 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 +1 -0
- package/lib-commonjs/components/AgentTag/index.js +1 -0
- 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 +1 -1
- package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.raw.js.map +1 -1
- 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 +1 -0
- package/lib-commonjs/components/Attachment/index.js +1 -0
- 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.raw.js +1 -1
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -1
- 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 +1 -0
- package/lib-commonjs/components/AttachmentList/index.js +1 -0
- 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 +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.raw.js.map +1 -1
- 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 +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/index.js +1 -0
- 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 +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js +1 -0
- 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 +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js.map +1 -1
- 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 +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js +1 -0
- 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.raw.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/AttachmentTag/AttachmentTag.js +1 -1
- package/lib-commonjs/components/AttachmentTag/AttachmentTag.js.map +1 -1
- package/lib-commonjs/components/AttachmentTag/AttachmentTag.types.js +1 -0
- package/lib-commonjs/components/AttachmentTag/index.js +1 -0
- package/lib-commonjs/components/AttachmentTag/renderAttachmentTag.js +1 -1
- package/lib-commonjs/components/AttachmentTag/renderAttachmentTag.js.map +1 -1
- package/lib-commonjs/components/AttachmentTag/useAttachmentTag.js +1 -1
- package/lib-commonjs/components/AttachmentTag/useAttachmentTag.js.map +1 -1
- package/lib-commonjs/components/AttachmentTag/useAttachmentTagStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/AttachmentTag/useAttachmentTagStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.js +1 -1
- package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.types.js +1 -0
- package/lib-commonjs/components/AttachmentTagItem/index.js +1 -0
- package/lib-commonjs/components/AttachmentTagItem/renderAttachmentTagItem.js +1 -1
- package/lib-commonjs/components/AttachmentTagItem/renderAttachmentTagItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItem.js +1 -1
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagList/AttachmentTagList.js +1 -1
- package/lib-commonjs/components/AttachmentTagList/AttachmentTagList.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagList/AttachmentTagList.types.js +1 -0
- package/lib-commonjs/components/AttachmentTagList/index.js +1 -0
- package/lib-commonjs/components/AttachmentTagList/renderAttachmentTagList.js +1 -1
- package/lib-commonjs/components/AttachmentTagList/renderAttachmentTagList.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagList/useAttachmentTagList.js +1 -1
- package/lib-commonjs/components/AttachmentTagList/useAttachmentTagList.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagList/useAttachmentTagListContextValues.js +1 -1
- package/lib-commonjs/components/AttachmentTagList/useAttachmentTagListContextValues.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagList/useAttachmentTagListStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/AttachmentTagList/useAttachmentTagListStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/index.js +1 -0
- package/lib-commonjs/components/utils/useAttachmentTagSlots.js +1 -1
- package/lib-commonjs/components/utils/useAttachmentTagSlots.js.map +1 -1
- package/lib-commonjs/components/utils/useProgressBarStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/utils/useProgressBarStyles.styles.raw.js.map +1 -1
- 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/contexts/attachmentTagListContext.js +1 -1
- package/lib-commonjs/contexts/attachmentTagListContext.js.map +1 -1
- package/lib-commonjs/index.js +1 -0
- package/package.json +4 -4
|
@@ -12,58 +12,66 @@ import { useAttachmentListContext_unstable } from '../../contexts/attachmentList
|
|
|
12
12
|
*
|
|
13
13
|
* @param props - props from this instance of AttachmentOverflowMenuButton
|
|
14
14
|
* @param ref - reference to root HTMLElement of AttachmentOverflowMenuButton
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
}
|
|
15
|
+
*/
|
|
16
|
+
export const useAttachmentOverflowMenuButton_unstable = (props, ref) => {
|
|
17
|
+
const {
|
|
18
|
+
isOverflowing,
|
|
19
|
+
overflowCount,
|
|
20
|
+
overflowButtonRef
|
|
21
|
+
} = useAttachmentOverflowMenuContext_unstable(context => context);
|
|
22
|
+
const {
|
|
23
|
+
numberOfAttachments
|
|
24
|
+
} = useAttachmentListContext_unstable(context => context);
|
|
25
|
+
const fullyOverflowed = overflowCount >= numberOfAttachments;
|
|
26
|
+
const isLoading = !!props.isLoading;
|
|
27
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
28
|
+
const mode = useCopilotMode(props.mode);
|
|
29
|
+
const buttonText = defaultButtonText(props, overflowCount, designVersion, mode, fullyOverflowed);
|
|
30
|
+
return {
|
|
31
|
+
components: {
|
|
32
|
+
root: 'button',
|
|
33
|
+
progress: ProgressBar
|
|
34
|
+
},
|
|
35
|
+
root: slot.always(getIntrinsicElementProps('button', {
|
|
36
|
+
ref: useMergedRefs(ref, overflowButtonRef),
|
|
37
|
+
...props
|
|
38
|
+
}), {
|
|
39
|
+
defaultProps: {
|
|
40
|
+
children: buttonText
|
|
41
|
+
},
|
|
42
|
+
elementType: 'button'
|
|
43
|
+
}),
|
|
44
|
+
progress: slot.always(props.progress, {
|
|
45
|
+
defaultProps: {
|
|
46
|
+
value: undefined,
|
|
47
|
+
shape: 'square',
|
|
48
|
+
thickness: 'large',
|
|
49
|
+
'aria-label': 'Loading'
|
|
50
|
+
},
|
|
51
|
+
elementType: ProgressBar
|
|
52
|
+
}),
|
|
53
|
+
fullyOverflowed,
|
|
54
|
+
isOverflowing,
|
|
55
|
+
overflowCount,
|
|
56
|
+
isLoading,
|
|
57
|
+
designVersion,
|
|
58
|
+
mode
|
|
59
|
+
};
|
|
53
60
|
};
|
|
54
61
|
function defaultButtonText(props, overflowCount, designVersion, copilotMode, fullyOverflowed) {
|
|
55
|
-
|
|
56
|
-
|
|
62
|
+
if (props.children) {
|
|
63
|
+
return props.children;
|
|
64
|
+
}
|
|
65
|
+
if (props.text) {
|
|
66
|
+
if (typeof props.text === 'function') {
|
|
67
|
+
return props.text(overflowCount);
|
|
68
|
+
} else {
|
|
69
|
+
return props.text;
|
|
57
70
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (designVersion === 'next' && fullyOverflowed) {
|
|
66
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, copilotMode === 'canvas' ? /*#__PURE__*/ React.createElement(Attach24Regular, null) : /*#__PURE__*/ React.createElement(Attach20Regular, null), overflowCount);
|
|
67
|
-
}
|
|
68
|
-
return `+${overflowCount}`;
|
|
71
|
+
}
|
|
72
|
+
if (designVersion === 'next' && fullyOverflowed) {
|
|
73
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, copilotMode === 'canvas' ? /*#__PURE__*/React.createElement(Attach24Regular, null) : /*#__PURE__*/React.createElement(Attach20Regular, null), overflowCount);
|
|
74
|
+
}
|
|
75
|
+
return `+${overflowCount}`;
|
|
69
76
|
}
|
|
77
|
+
//# sourceMappingURL=useAttachmentOverflowMenuButton.js.map
|
|
@@ -2,101 +2,108 @@ import { makeResetStyles, makeStyles, mergeClasses, shorthands, slot } from '@fl
|
|
|
2
2
|
import { tokens, typographyStyles } from '@fluentui-copilot/tokens';
|
|
3
3
|
import { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';
|
|
4
4
|
export const attachmentOverflowMenuButtonClassNames = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
root: 'fai-AttachmentOverflowMenuButton',
|
|
6
|
+
progress: 'fai-AttachmentOverflowMenuButton__progress'
|
|
7
7
|
};
|
|
8
8
|
const useRootBaseClassName = makeResetStyles({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
color: tokens.colorNeutralForeground1,
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
backgroundColor: tokens.colorSubtleBackground,
|
|
12
|
+
border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,
|
|
13
|
+
borderRadius: tokens.borderRadiusMedium,
|
|
14
|
+
boxSizing: 'border-box',
|
|
15
|
+
columnGap: tokens.spacingHorizontalSNudge,
|
|
16
|
+
cursor: 'pointer',
|
|
17
|
+
display: 'inline-flex',
|
|
18
|
+
flexWrap: 'nowrap',
|
|
19
|
+
fontFamily: typographyStyles.body1.fontFamily,
|
|
20
|
+
fontSize: typographyStyles.body1.fontSize,
|
|
21
|
+
fontWeight: typographyStyles.body1.fontWeight,
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`,
|
|
24
|
+
verticalAlign: 'middle',
|
|
25
|
+
position: 'relative',
|
|
26
|
+
':hover': {
|
|
16
27
|
cursor: 'pointer',
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
position: 'relative',
|
|
28
|
+
backgroundColor: tokens.colorSubtleBackgroundHover,
|
|
29
|
+
color: tokens.colorNeutralForeground2Hover
|
|
30
|
+
},
|
|
31
|
+
':active': {
|
|
32
|
+
backgroundColor: tokens.colorSubtleBackgroundPressed,
|
|
33
|
+
color: tokens.colorNeutralForeground2Pressed
|
|
34
|
+
},
|
|
35
|
+
'@media (forced-colors: active)': {
|
|
26
36
|
':hover': {
|
|
27
|
-
|
|
28
|
-
backgroundColor: tokens.colorSubtleBackgroundHover,
|
|
29
|
-
color: tokens.colorNeutralForeground2Hover
|
|
37
|
+
backgroundColor: 'HighlightText'
|
|
30
38
|
},
|
|
31
39
|
':active': {
|
|
32
|
-
|
|
33
|
-
color: tokens.colorNeutralForeground2Pressed
|
|
34
|
-
},
|
|
35
|
-
'@media (forced-colors: active)': {
|
|
36
|
-
':hover': {
|
|
37
|
-
backgroundColor: 'HighlightText'
|
|
38
|
-
},
|
|
39
|
-
':active': {
|
|
40
|
-
backgroundColor: 'HighlightText'
|
|
41
|
-
}
|
|
40
|
+
backgroundColor: 'HighlightText'
|
|
42
41
|
}
|
|
42
|
+
}
|
|
43
43
|
});
|
|
44
44
|
const useNextStyles = makeStyles({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
':active': {
|
|
56
|
-
color: tokens.colorNeutralForeground2Pressed,
|
|
57
|
-
backgroundColor: tokens.colorNeutralBackground3Pressed
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
canvas: {
|
|
61
|
-
minHeight: '40px',
|
|
62
|
-
padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`
|
|
63
|
-
},
|
|
64
|
-
sidecar: {
|
|
65
|
-
minHeight: '32px',
|
|
66
|
-
padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`
|
|
67
|
-
},
|
|
68
|
-
fullyOverflowed_canvas: {
|
|
69
|
-
padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalL}`,
|
|
70
|
-
...typographyStyles.subtitle2
|
|
45
|
+
root: {
|
|
46
|
+
borderRadius: tokens.borderRadiusXLarge,
|
|
47
|
+
...shorthands.borderColor(tokens.colorTransparentStroke),
|
|
48
|
+
color: tokens.colorNeutralForeground2,
|
|
49
|
+
backgroundColor: tokens.colorNeutralBackground3,
|
|
50
|
+
':hover': {
|
|
51
|
+
cursor: 'pointer',
|
|
52
|
+
color: tokens.colorNeutralForeground2Hover,
|
|
53
|
+
backgroundColor: tokens.colorNeutralBackground3Hover
|
|
71
54
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
55
|
+
':active': {
|
|
56
|
+
color: tokens.colorNeutralForeground2Pressed,
|
|
57
|
+
backgroundColor: tokens.colorNeutralBackground3Pressed
|
|
75
58
|
}
|
|
59
|
+
},
|
|
60
|
+
canvas: {
|
|
61
|
+
minHeight: '40px',
|
|
62
|
+
padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`
|
|
63
|
+
},
|
|
64
|
+
sidecar: {
|
|
65
|
+
minHeight: '32px',
|
|
66
|
+
padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`
|
|
67
|
+
},
|
|
68
|
+
fullyOverflowed_canvas: {
|
|
69
|
+
padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalL}`,
|
|
70
|
+
...typographyStyles.subtitle2
|
|
71
|
+
},
|
|
72
|
+
fullyOverflowed_sidecar: {
|
|
73
|
+
padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalM}`,
|
|
74
|
+
...typographyStyles.body1Strong
|
|
75
|
+
}
|
|
76
76
|
});
|
|
77
77
|
/**
|
|
78
78
|
* Apply styling to the AttachmentOverflowMenuButton slots based on the state
|
|
79
|
-
*/
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
79
|
+
*/
|
|
80
|
+
export const useAttachmentOverflowMenuButtonStyles_unstable = state => {
|
|
81
|
+
'use no memo';
|
|
82
|
+
|
|
83
|
+
const {
|
|
84
|
+
designVersion,
|
|
85
|
+
mode,
|
|
86
|
+
fullyOverflowed
|
|
87
|
+
} = state;
|
|
88
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
89
|
+
const progressBarStyles = useProgressBarStyles();
|
|
90
|
+
const nextStyles = useNextStyles();
|
|
91
|
+
state.root.className = mergeClasses(attachmentOverflowMenuButtonClassNames.root, rootBaseClassName, designVersion === 'next' && nextStyles.root, designVersion === 'next' && nextStyles[mode], designVersion === 'next' && fullyOverflowed && nextStyles[`fullyOverflowed_${mode}`], state.root.className);
|
|
92
|
+
if (state.progress) {
|
|
93
|
+
state.progress.className = mergeClasses(attachmentOverflowMenuButtonClassNames.progress, progressBarStyles.progress, state.progress.className);
|
|
94
|
+
const bar = slot.optional(state.progress.bar, {
|
|
95
|
+
elementType: 'div',
|
|
96
|
+
renderByDefault: true
|
|
97
|
+
});
|
|
98
|
+
if (bar) {
|
|
99
|
+
if (state.progress.value === undefined) {
|
|
100
|
+
bar.className = mergeClasses(progressBarStyles.indeterminateProgressBar, bar.className);
|
|
101
|
+
} else {
|
|
102
|
+
bar.className = mergeClasses(progressBarStyles.regularProgressBar, bar.className);
|
|
103
|
+
}
|
|
104
|
+
state.progress.bar = bar;
|
|
100
105
|
}
|
|
101
|
-
|
|
106
|
+
}
|
|
107
|
+
return state;
|
|
102
108
|
};
|
|
109
|
+
//# sourceMappingURL=useAttachmentOverflowMenuButtonStyles.styles.raw.js.map
|
|
@@ -2,9 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import { useAttachmentOverflowMenuItem_unstable } from './useAttachmentOverflowMenuItem';
|
|
3
3
|
import { renderAttachmentOverflowMenuItem_unstable } from './renderAttachmentOverflowMenuItem';
|
|
4
4
|
import { useAttachmentOverflowMenuItemStyles_unstable } from './useAttachmentOverflowMenuItemStyles.styles';
|
|
5
|
-
export const AttachmentOverflowMenuItem = /*#__PURE__*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export const AttachmentOverflowMenuItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
6
|
+
const state = useAttachmentOverflowMenuItem_unstable(props, ref);
|
|
7
|
+
useAttachmentOverflowMenuItemStyles_unstable(state);
|
|
8
|
+
return renderAttachmentOverflowMenuItem_unstable(state);
|
|
9
9
|
});
|
|
10
10
|
AttachmentOverflowMenuItem.displayName = 'AttachmentOverflowMenuItem';
|
|
11
|
+
//# sourceMappingURL=AttachmentOverflowMenuItem.js.map
|
|
@@ -2,3 +2,4 @@ export { AttachmentOverflowMenuItem } from './AttachmentOverflowMenuItem';
|
|
|
2
2
|
export { renderAttachmentOverflowMenuItem_unstable } from './renderAttachmentOverflowMenuItem';
|
|
3
3
|
export { useAttachmentOverflowMenuItem_unstable } from './useAttachmentOverflowMenuItem';
|
|
4
4
|
export { attachmentOverflowMenuItemClassNames, useAttachmentOverflowMenuItemStyles_unstable } from './useAttachmentOverflowMenuItemStyles.styles';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-components';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of AttachmentOverflowMenuItem
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
]
|
|
12
|
-
}) : null;
|
|
5
|
+
*/
|
|
6
|
+
export const renderAttachmentOverflowMenuItem_unstable = state => {
|
|
7
|
+
assertSlots(state);
|
|
8
|
+
return !state.isVisible ? /*#__PURE__*/_jsxs(state.root, {
|
|
9
|
+
children: [state.root.children, state.progress && /*#__PURE__*/_jsx(state.progress, {})]
|
|
10
|
+
}) : null;
|
|
13
11
|
};
|
|
12
|
+
//# sourceMappingURL=renderAttachmentOverflowMenuItem.js.map
|
|
@@ -11,46 +11,54 @@ import { useDesignVersion } from '@fluentui-copilot/react-provider';
|
|
|
11
11
|
*
|
|
12
12
|
* @param props - props from this instance of AttachmentOverflowMenuItem
|
|
13
13
|
* @param ref - reference to root HTMLElement of AttachmentOverflowMenuItem
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
*/
|
|
15
|
+
export const useAttachmentOverflowMenuItem_unstable = (props, ref) => {
|
|
16
|
+
'use no memo';
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
imageOnly,
|
|
20
|
+
media
|
|
21
|
+
} = props;
|
|
22
|
+
const menuItemId = useId('attachment-', props.id);
|
|
23
|
+
const isVisible = useIsOverflowItemVisible(menuItemId);
|
|
24
|
+
const {
|
|
25
|
+
onAttachmentDismiss
|
|
26
|
+
} = useAttachmentListContext_unstable(context => context);
|
|
27
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
28
|
+
const root = slot.always({
|
|
29
|
+
ref,
|
|
30
|
+
icon: media,
|
|
31
|
+
secondaryContent: /*#__PURE__*/React.createElement(Dismiss20Regular, null),
|
|
32
|
+
...props,
|
|
33
|
+
id: menuItemId
|
|
34
|
+
}, {
|
|
35
|
+
elementType: MenuItem
|
|
36
|
+
});
|
|
37
|
+
root.onClick = mergeCallbacks(root.onClick, ev => {
|
|
38
|
+
onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
|
|
39
|
+
content: props.children,
|
|
40
|
+
media,
|
|
41
|
+
id: menuItemId
|
|
29
42
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
root,
|
|
51
|
-
progress,
|
|
52
|
-
isVisible,
|
|
53
|
-
imageOnly,
|
|
54
|
-
designVersion
|
|
55
|
-
};
|
|
43
|
+
});
|
|
44
|
+
const progress = slot.optional(props.progress, {
|
|
45
|
+
defaultProps: {
|
|
46
|
+
shape: 'square',
|
|
47
|
+
thickness: 'large',
|
|
48
|
+
'aria-labelledby': props.id
|
|
49
|
+
},
|
|
50
|
+
elementType: ProgressBar
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
components: {
|
|
54
|
+
root: MenuItem,
|
|
55
|
+
progress: ProgressBar
|
|
56
|
+
},
|
|
57
|
+
root,
|
|
58
|
+
progress,
|
|
59
|
+
isVisible,
|
|
60
|
+
imageOnly,
|
|
61
|
+
designVersion
|
|
62
|
+
};
|
|
56
63
|
};
|
|
64
|
+
//# sourceMappingURL=useAttachmentOverflowMenuItem.js.map
|
package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js
CHANGED
|
@@ -1,57 +1,63 @@
|
|
|
1
1
|
import { makeStyles, mergeClasses, slot, tokens } from '@fluentui/react-components';
|
|
2
2
|
import { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';
|
|
3
3
|
export const attachmentOverflowMenuItemClassNames = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
root: 'fai-AttachmentOverflowMenuItem',
|
|
5
|
+
progress: 'fai-AttachmentOverflowMenuItem__progress'
|
|
6
6
|
};
|
|
7
7
|
const FOCUS_VISIBLE_ATTR = 'data-fui-focus-visible';
|
|
8
8
|
const useStyles = makeStyles({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
imageOnly: {
|
|
10
|
+
alignItems: 'center'
|
|
11
|
+
},
|
|
12
|
+
secondaryContent: {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
alignItems: 'center'
|
|
15
|
+
}
|
|
16
16
|
});
|
|
17
17
|
const useNextStyles = makeStyles({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
nextStyles: {
|
|
19
|
+
[`[${FOCUS_VISIBLE_ATTR}]::after`]: {
|
|
20
|
+
borderRadius: tokens.borderRadiusXLarge
|
|
21
|
+
},
|
|
22
|
+
outline: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`
|
|
23
|
+
}
|
|
24
24
|
});
|
|
25
25
|
/**
|
|
26
26
|
* Apply styling to the AttachmentList slots based on the state
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
*/
|
|
28
|
+
export const useAttachmentOverflowMenuItemStyles_unstable = state => {
|
|
29
|
+
'use no memo';
|
|
30
|
+
|
|
31
|
+
const {
|
|
32
|
+
imageOnly,
|
|
33
|
+
designVersion
|
|
34
|
+
} = state;
|
|
35
|
+
const styles = useStyles();
|
|
36
|
+
const nextStyles = useNextStyles();
|
|
37
|
+
const progressBarStyles = useProgressBarStyles();
|
|
38
|
+
state.root.className = mergeClasses(attachmentOverflowMenuItemClassNames.root, imageOnly && styles.imageOnly, designVersion === 'next' && nextStyles.nextStyles, state.root.className);
|
|
39
|
+
const secondaryContent = slot.optional(state.root.secondaryContent, {
|
|
40
|
+
elementType: 'span'
|
|
41
|
+
});
|
|
42
|
+
if (secondaryContent) {
|
|
43
|
+
secondaryContent.className = mergeClasses(styles.secondaryContent, secondaryContent.className);
|
|
44
|
+
state.root.secondaryContent = secondaryContent;
|
|
45
|
+
}
|
|
46
|
+
if (state.progress) {
|
|
47
|
+
state.progress.className = mergeClasses(attachmentOverflowMenuItemClassNames.progress, progressBarStyles.progress, state.progress.className);
|
|
48
|
+
const bar = slot.optional(state.progress.bar, {
|
|
49
|
+
elementType: 'div',
|
|
50
|
+
renderByDefault: true
|
|
36
51
|
});
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
elementType: 'div',
|
|
45
|
-
renderByDefault: true
|
|
46
|
-
});
|
|
47
|
-
if (bar) {
|
|
48
|
-
if (state.progress.value === undefined) {
|
|
49
|
-
bar.className = mergeClasses(progressBarStyles.indeterminateProgressBar, bar.className);
|
|
50
|
-
} else {
|
|
51
|
-
bar.className = mergeClasses(progressBarStyles.regularProgressBar, bar.className);
|
|
52
|
-
}
|
|
53
|
-
state.progress.bar = bar;
|
|
54
|
-
}
|
|
52
|
+
if (bar) {
|
|
53
|
+
if (state.progress.value === undefined) {
|
|
54
|
+
bar.className = mergeClasses(progressBarStyles.indeterminateProgressBar, bar.className);
|
|
55
|
+
} else {
|
|
56
|
+
bar.className = mergeClasses(progressBarStyles.regularProgressBar, bar.className);
|
|
57
|
+
}
|
|
58
|
+
state.progress.bar = bar;
|
|
55
59
|
}
|
|
56
|
-
|
|
60
|
+
}
|
|
61
|
+
return state;
|
|
57
62
|
};
|
|
63
|
+
//# sourceMappingURL=useAttachmentOverflowMenuItemStyles.styles.raw.js.map
|
|
@@ -6,10 +6,12 @@ import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated use new Attachment component exported from \@fluentui-copilot/react-attachments package instead.
|
|
8
8
|
* Deprecated on 4/9/2024.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
*/
|
|
10
|
+
export const AttachmentTag = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
11
|
+
const state = useAttachmentTag_unstable(props, ref);
|
|
12
|
+
useAttachmentTagStyles_unstable(state);
|
|
13
|
+
useCustomStyleHook('useAttachmentTagStyles')(state);
|
|
14
|
+
return renderAttachmentTag_unstable(state);
|
|
14
15
|
});
|
|
15
16
|
AttachmentTag.displayName = 'AttachmentTag';
|
|
17
|
+
//# sourceMappingURL=AttachmentTag.js.map
|
|
@@ -2,3 +2,4 @@ export { AttachmentTag } from './AttachmentTag';
|
|
|
2
2
|
export { renderAttachmentTag_unstable } from './renderAttachmentTag';
|
|
3
3
|
export { useAttachmentTag_unstable } from './useAttachmentTag';
|
|
4
4
|
export { ATTACHMENTTAG_MAXWIDTH, attachmentTagClassNames, useAttachmentTagStyles_unstable, useContentBaseClassName, useIconBaseClassName, useMediaBaseClassName } from './useAttachmentTagStyles.styles';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-components';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of AttachmentTag
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/*#__PURE__*/ _jsx(state.icon, {})
|
|
12
|
-
]
|
|
13
|
-
});
|
|
5
|
+
*/
|
|
6
|
+
export const renderAttachmentTag_unstable = state => {
|
|
7
|
+
assertSlots(state);
|
|
8
|
+
return /*#__PURE__*/_jsxs(state.root, {
|
|
9
|
+
children: [state.media && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.content, {}), /*#__PURE__*/_jsx(state.icon, {})]
|
|
10
|
+
});
|
|
14
11
|
};
|
|
12
|
+
//# sourceMappingURL=renderAttachmentTag.js.map
|