@fluentui-copilot/react-attachments 0.12.4 → 0.12.5-hotfix.1
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 +46 -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/AttachmentTag.js +0 -1
- package/lib/AttachmentTagItem.js +0 -1
- package/lib/AttachmentTagList.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 +34 -12
- package/lib/components/Attachment/useAttachmentStyles.styles.js.map +1 -1
- package/lib/components/Attachment/useAttachmentStyles.styles.raw.js +317 -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.raw.js +57 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
- package/lib/components/AttachmentTag/AttachmentTag.js +5 -7
- package/lib/components/AttachmentTag/AttachmentTag.types.js +1 -2
- package/lib/components/AttachmentTag/index.js +0 -1
- package/lib/components/AttachmentTag/renderAttachmentTag.js +10 -8
- package/lib/components/AttachmentTag/useAttachmentTag.js +9 -11
- package/lib/components/AttachmentTag/useAttachmentTagStyles.styles.raw.js +98 -0
- package/lib/components/AttachmentTag/useAttachmentTagStyles.styles.raw.js.map +1 -0
- package/lib/components/AttachmentTagItem/AttachmentTagItem.js +4 -6
- package/lib/components/AttachmentTagItem/AttachmentTagItem.types.js +1 -2
- package/lib/components/AttachmentTagItem/index.js +0 -1
- package/lib/components/AttachmentTagItem/renderAttachmentTagItem.js +10 -8
- package/lib/components/AttachmentTagItem/useAttachmentTagItem.js +9 -11
- package/lib/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.raw.js +34 -0
- package/lib/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.raw.js.map +1 -0
- package/lib/components/AttachmentTagList/AttachmentTagList.js +6 -8
- package/lib/components/AttachmentTagList/AttachmentTagList.types.js +1 -2
- package/lib/components/AttachmentTagList/index.js +0 -1
- package/lib/components/AttachmentTagList/renderAttachmentTagList.js +7 -9
- package/lib/components/AttachmentTagList/useAttachmentTagList.js +21 -25
- package/lib/components/AttachmentTagList/useAttachmentTagListContextValues.js +8 -11
- package/lib/components/AttachmentTagList/useAttachmentTagListStyles.styles.raw.js +21 -0
- package/lib/components/AttachmentTagList/useAttachmentTagListStyles.styles.raw.js.map +1 -0
- package/lib/components/index.js +0 -1
- package/lib/components/utils/useAttachmentTagSlots.js +45 -52
- 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/contexts/attachmentTagListContext.js +2 -3
- 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/AttachmentTag.js +0 -1
- package/lib-commonjs/AttachmentTagItem.js +0 -1
- package/lib-commonjs/AttachmentTagList.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 +52 -26
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js +336 -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.raw.js +73 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
- 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 +0 -1
- package/lib-commonjs/components/AttachmentTag/index.js +0 -1
- 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 +118 -0
- package/lib-commonjs/components/AttachmentTag/useAttachmentTagStyles.styles.raw.js.map +1 -0
- 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 +0 -1
- package/lib-commonjs/components/AttachmentTagItem/index.js +0 -1
- 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 +50 -0
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.raw.js.map +1 -0
- 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 +0 -1
- package/lib-commonjs/components/AttachmentTagList/index.js +0 -1
- 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 +37 -0
- package/lib-commonjs/components/AttachmentTagList/useAttachmentTagListStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/index.js +0 -1
- 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 +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/contexts/attachmentTagListContext.js +1 -1
- package/lib-commonjs/contexts/attachmentTagListContext.js.map +1 -1
- package/lib-commonjs/index.js +0 -1
- package/package.json +5 -9
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
attachmentClassNames: function() {
|
|
13
|
+
return attachmentClassNames;
|
|
14
|
+
},
|
|
15
|
+
useAttachmentStyles_unstable: function() {
|
|
16
|
+
return useAttachmentStyles_unstable;
|
|
17
|
+
},
|
|
18
|
+
useOverflowStyles: function() {
|
|
19
|
+
return useOverflowStyles;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
23
|
+
const _tokens = require("@fluentui-copilot/tokens");
|
|
24
|
+
const _useProgressBarStylesstyles = require("../utils/useProgressBarStyles.styles");
|
|
25
|
+
const attachmentClassNames = {
|
|
26
|
+
root: 'fai-Attachment',
|
|
27
|
+
primaryAction: 'fai-Attachment__primaryAction',
|
|
28
|
+
dismissButton: 'fai-Attachment__dismissButton',
|
|
29
|
+
media: 'fai-Attachment__media',
|
|
30
|
+
content: 'fai-Attachment__content',
|
|
31
|
+
dismissIcon: 'fai-Attachment__dismissIcon',
|
|
32
|
+
progress: 'fai-Attachment__progress'
|
|
33
|
+
};
|
|
34
|
+
const ATTACHMENT_MAXWIDTH = '180px';
|
|
35
|
+
const SMALL_ATTACHMENT_SIZE = '16px';
|
|
36
|
+
const ATTACHMENT_SIZE = '20px';
|
|
37
|
+
const useRootBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
38
|
+
display: 'inline-flex',
|
|
39
|
+
flexWrap: 'nowrap',
|
|
40
|
+
verticalAlign: 'middle',
|
|
41
|
+
boxSizing: 'border-box',
|
|
42
|
+
width: 'fit-content',
|
|
43
|
+
alignSelf: 'end',
|
|
44
|
+
position: 'relative'
|
|
45
|
+
});
|
|
46
|
+
const buttonBaseStyles = {
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
backgroundColor: _tokens.tokens.colorSubtleBackground,
|
|
49
|
+
border: `${_tokens.tokens.strokeWidthThin} solid ${_tokens.tokens.colorNeutralStroke1}`,
|
|
50
|
+
borderRadius: _tokens.tokens.borderRadiusMedium,
|
|
51
|
+
boxSizing: 'border-box',
|
|
52
|
+
columnGap: _tokens.tokens.spacingHorizontalSNudge,
|
|
53
|
+
color: _tokens.tokens.colorNeutralForeground1,
|
|
54
|
+
cursor: 'pointer',
|
|
55
|
+
display: 'inline-flex',
|
|
56
|
+
flexWrap: 'nowrap',
|
|
57
|
+
justifyContent: 'center',
|
|
58
|
+
...(0, _reactcomponents.createCustomFocusIndicatorStyle)({
|
|
59
|
+
outline: `${_tokens.tokens.strokeWidthThick} solid ${_tokens.tokens.colorStrokeFocus2}`,
|
|
60
|
+
zIndex: 1
|
|
61
|
+
}),
|
|
62
|
+
verticalAlign: 'middle'
|
|
63
|
+
};
|
|
64
|
+
const usePrimaryActionBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
65
|
+
...buttonBaseStyles,
|
|
66
|
+
borderTopRightRadius: _tokens.tokens.borderRadiusNone,
|
|
67
|
+
borderBottomRightRadius: _tokens.tokens.borderRadiusNone,
|
|
68
|
+
borderRightStyle: 'none',
|
|
69
|
+
maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${ATTACHMENT_SIZE} + ${_tokens.tokens.strokeWidthThin} * 2 + ${_tokens.tokens.spacingHorizontalXXS} - ${_tokens.tokens.spacingHorizontalXS})`,
|
|
70
|
+
padding: `${_tokens.tokens.spacingVerticalXS} ${_tokens.tokens.spacingHorizontalS} ${_tokens.tokens.spacingVerticalXS} ${_tokens.tokens.spacingHorizontalS}`
|
|
71
|
+
});
|
|
72
|
+
const usePrimaryActionStyles = (0, _reactcomponents.makeStyles)({
|
|
73
|
+
button: {
|
|
74
|
+
':hover': {
|
|
75
|
+
cursor: 'pointer',
|
|
76
|
+
backgroundColor: _tokens.tokens.colorSubtleBackgroundHover,
|
|
77
|
+
color: _tokens.tokens.colorNeutralForeground2Hover
|
|
78
|
+
},
|
|
79
|
+
':active': {
|
|
80
|
+
backgroundColor: _tokens.tokens.colorSubtleBackgroundPressed,
|
|
81
|
+
color: _tokens.tokens.colorNeutralForeground2Pressed
|
|
82
|
+
},
|
|
83
|
+
'@media (forced-colors: active)': {
|
|
84
|
+
':hover': {
|
|
85
|
+
backgroundColor: 'HighlightText'
|
|
86
|
+
},
|
|
87
|
+
':active': {
|
|
88
|
+
backgroundColor: 'HighlightText'
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
const useDismissButtonBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
94
|
+
...buttonBaseStyles,
|
|
95
|
+
padding: `${_tokens.tokens.spacingVerticalXS} ${_tokens.tokens.spacingHorizontalXS} ${_tokens.tokens.spacingVerticalXS} ${_tokens.tokens.spacingHorizontalXS}`,
|
|
96
|
+
maxWidth: `calc(${ATTACHMENT_SIZE} + ${_tokens.tokens.strokeWidthThin} * 2 + ${_tokens.tokens.spacingHorizontalXXS}) + ${_tokens.tokens.spacingHorizontalXS}`,
|
|
97
|
+
minWidth: `calc(${ATTACHMENT_SIZE} + ${_tokens.tokens.strokeWidthThin} * 2 + ${_tokens.tokens.spacingHorizontalXXS}) + ${_tokens.tokens.spacingHorizontalXS}`,
|
|
98
|
+
// divider:
|
|
99
|
+
borderLeftColor: _tokens.tokens.colorNeutralStroke1,
|
|
100
|
+
borderTopLeftRadius: _tokens.tokens.borderRadiusNone,
|
|
101
|
+
borderBottomLeftRadius: _tokens.tokens.borderRadiusNone,
|
|
102
|
+
borderTopRightRadius: _tokens.tokens.borderRadiusMedium,
|
|
103
|
+
borderBottomRightRadius: _tokens.tokens.borderRadiusMedium,
|
|
104
|
+
':hover': {
|
|
105
|
+
cursor: 'pointer',
|
|
106
|
+
backgroundColor: _tokens.tokens.colorSubtleBackgroundHover,
|
|
107
|
+
color: _tokens.tokens.colorNeutralForeground2BrandHover
|
|
108
|
+
},
|
|
109
|
+
':active': {
|
|
110
|
+
backgroundColor: _tokens.tokens.colorSubtleBackgroundPressed,
|
|
111
|
+
color: _tokens.tokens.colorNeutralForeground2BrandPressed
|
|
112
|
+
},
|
|
113
|
+
'@media (forced-colors: active)': {
|
|
114
|
+
':hover': {
|
|
115
|
+
backgroundColor: 'HighlightText'
|
|
116
|
+
},
|
|
117
|
+
':active': {
|
|
118
|
+
backgroundColor: 'HighlightText'
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
const useDismissButtonCurrentStyles = (0, _reactcomponents.makeStyles)({
|
|
123
|
+
root: {
|
|
124
|
+
':hover': {
|
|
125
|
+
[`& .${attachmentClassNames.dismissIcon}`]: {
|
|
126
|
+
color: _tokens.tokens.colorBrandForegroundLinkHover
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
const useMediaBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
132
|
+
alignItems: 'center',
|
|
133
|
+
display: 'inline-flex',
|
|
134
|
+
fontSize: ATTACHMENT_SIZE,
|
|
135
|
+
height: ATTACHMENT_SIZE,
|
|
136
|
+
lineHeight: ATTACHMENT_SIZE,
|
|
137
|
+
width: ATTACHMENT_SIZE
|
|
138
|
+
});
|
|
139
|
+
const useContentBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
140
|
+
overflowX: 'hidden',
|
|
141
|
+
textOverflow: 'ellipsis',
|
|
142
|
+
whiteSpace: 'nowrap',
|
|
143
|
+
..._reactcomponents.typographyStyles.body1
|
|
144
|
+
});
|
|
145
|
+
const useDismissIconBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
146
|
+
alignItems: 'center',
|
|
147
|
+
borderRadius: _tokens.tokens.borderRadiusCircular,
|
|
148
|
+
border: `${_tokens.tokens.strokeWidthThin} solid ${_tokens.tokens.colorTransparentStroke}`,
|
|
149
|
+
boxSizing: 'border-box',
|
|
150
|
+
color: _tokens.tokens.colorNeutralForeground1,
|
|
151
|
+
display: 'inline-flex',
|
|
152
|
+
fontSize: ATTACHMENT_SIZE,
|
|
153
|
+
height: `calc(${ATTACHMENT_SIZE} + ${_tokens.tokens.strokeWidthThin} * 2 + ${_tokens.tokens.spacingVerticalXXS})`,
|
|
154
|
+
justifyContent: 'center',
|
|
155
|
+
maxWidth: `calc(${ATTACHMENT_SIZE} + ${_tokens.tokens.strokeWidthThin} * 2 + ${_tokens.tokens.spacingHorizontalXXS})`,
|
|
156
|
+
minWidth: `calc(${ATTACHMENT_SIZE} + ${_tokens.tokens.strokeWidthThin} * 2 + ${_tokens.tokens.spacingHorizontalXXS})`,
|
|
157
|
+
padding: `calc(${_tokens.tokens.spacingVerticalXXS} / 2) calc(${_tokens.tokens.spacingHorizontalXXS} / 2)`
|
|
158
|
+
});
|
|
159
|
+
const useDismissIconNextStyles = (0, _reactcomponents.makeStyles)({
|
|
160
|
+
dismissOnly: {
|
|
161
|
+
':hover': {
|
|
162
|
+
color: _tokens.tokens.colorNeutralForeground2BrandHover
|
|
163
|
+
},
|
|
164
|
+
':active': {
|
|
165
|
+
color: _tokens.tokens.colorNeutralForeground2BrandPressed
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
const useImageOnlyStyles = (0, _reactcomponents.makeStyles)({
|
|
170
|
+
primaryAction: {
|
|
171
|
+
padding: 0
|
|
172
|
+
},
|
|
173
|
+
content: {
|
|
174
|
+
lineHeight: 0
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
const useOverflowStyles = (0, _reactcomponents.makeStyles)({
|
|
178
|
+
overflow: {
|
|
179
|
+
maxWidth: '100%',
|
|
180
|
+
width: '100%'
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
const useSmallStyles = (0, _reactcomponents.makeStyles)({
|
|
184
|
+
primaryAction: {
|
|
185
|
+
maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${SMALL_ATTACHMENT_SIZE} + ${_tokens.tokens.strokeWidthThin} * 2 + ${_tokens.tokens.spacingHorizontalXXS} - ${_tokens.tokens.spacingHorizontalXS})`,
|
|
186
|
+
padding: `${_tokens.tokens.spacingVerticalXXS} ${_tokens.tokens.spacingHorizontalSNudge} ${_tokens.tokens.spacingVerticalXXS} ${_tokens.tokens.spacingHorizontalSNudge}`
|
|
187
|
+
},
|
|
188
|
+
media: {
|
|
189
|
+
fontSize: SMALL_ATTACHMENT_SIZE,
|
|
190
|
+
height: SMALL_ATTACHMENT_SIZE,
|
|
191
|
+
lineHeight: SMALL_ATTACHMENT_SIZE,
|
|
192
|
+
width: SMALL_ATTACHMENT_SIZE
|
|
193
|
+
},
|
|
194
|
+
content: {
|
|
195
|
+
..._reactcomponents.typographyStyles.caption1
|
|
196
|
+
},
|
|
197
|
+
dismissButton: {
|
|
198
|
+
padding: `${_tokens.tokens.spacingVerticalXXS} ${_tokens.tokens.spacingHorizontalXXS}`,
|
|
199
|
+
maxWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${_tokens.tokens.strokeWidthThin} * 2 + ${_tokens.tokens.spacingHorizontalXXS}) + ${_tokens.tokens.spacingHorizontalXS}`,
|
|
200
|
+
minWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${_tokens.tokens.strokeWidthThin} * 2 + ${_tokens.tokens.spacingHorizontalXXS}) + ${_tokens.tokens.spacingHorizontalXS}`
|
|
201
|
+
},
|
|
202
|
+
dismissIcon: {
|
|
203
|
+
fontSize: SMALL_ATTACHMENT_SIZE,
|
|
204
|
+
height: `calc(${SMALL_ATTACHMENT_SIZE} + ${_tokens.tokens.strokeWidthThin} * 2 + ${_tokens.tokens.spacingVerticalXXS})`,
|
|
205
|
+
maxWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${_tokens.tokens.strokeWidthThin} * 2 + ${_tokens.tokens.spacingHorizontalXXS})`,
|
|
206
|
+
minWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${_tokens.tokens.strokeWidthThin} * 2 + ${_tokens.tokens.spacingHorizontalXXS})`
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
const usePrimaryActionNextStyles = (0, _reactcomponents.makeStyles)({
|
|
210
|
+
root: {
|
|
211
|
+
borderTopLeftRadius: _tokens.tokens.borderRadiusXLarge,
|
|
212
|
+
borderBottomLeftRadius: _tokens.tokens.borderRadiusXLarge
|
|
213
|
+
},
|
|
214
|
+
canvas: {
|
|
215
|
+
padding: `${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalS}`,
|
|
216
|
+
minHeight: '40px'
|
|
217
|
+
},
|
|
218
|
+
sidecar: {
|
|
219
|
+
padding: `${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalS}`,
|
|
220
|
+
minHeight: '32px'
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
const useDismissButtonNextStyles = (0, _reactcomponents.makeStyles)({
|
|
224
|
+
root: {
|
|
225
|
+
borderTopRightRadius: _tokens.tokens.borderRadiusXLarge,
|
|
226
|
+
borderBottomRightRadius: _tokens.tokens.borderRadiusXLarge,
|
|
227
|
+
':hover': {
|
|
228
|
+
color: _tokens.tokens.colorNeutralForeground2
|
|
229
|
+
},
|
|
230
|
+
':active': {
|
|
231
|
+
color: _tokens.tokens.colorNeutralForeground2Pressed
|
|
232
|
+
},
|
|
233
|
+
borderLeftColor: _tokens.tokens.colorNeutralStroke1,
|
|
234
|
+
borderLeftWidth: _tokens.tokens.strokeWidthThin,
|
|
235
|
+
borderLeftStyle: 'solid'
|
|
236
|
+
},
|
|
237
|
+
withPrimary: {
|
|
238
|
+
':hover': {
|
|
239
|
+
[`& .${attachmentClassNames.dismissIcon}`]: {
|
|
240
|
+
color: _tokens.tokens.colorNeutralForeground2
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
':active': {
|
|
244
|
+
[`& .${attachmentClassNames.dismissIcon}`]: {
|
|
245
|
+
color: _tokens.tokens.colorNeutralForeground2Pressed
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
canvas: {
|
|
250
|
+
padding: `${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalS}`,
|
|
251
|
+
minHeight: '40px',
|
|
252
|
+
width: '40px'
|
|
253
|
+
},
|
|
254
|
+
sidecar: {
|
|
255
|
+
padding: `${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalMNudge}`,
|
|
256
|
+
minHeight: '32px',
|
|
257
|
+
width: '32px'
|
|
258
|
+
},
|
|
259
|
+
dismissOnly: {
|
|
260
|
+
borderRadius: _tokens.tokens.borderRadiusXLarge,
|
|
261
|
+
width: 'unset',
|
|
262
|
+
borderLeftColor: _tokens.tokens.colorTransparentStroke,
|
|
263
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3,
|
|
264
|
+
':hover': {
|
|
265
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3
|
|
266
|
+
},
|
|
267
|
+
':active': {
|
|
268
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
const usePrimaryDismissNextStyles = (0, _reactcomponents.makeStyles)({
|
|
273
|
+
sharedStyles: {
|
|
274
|
+
border: 'none',
|
|
275
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3,
|
|
276
|
+
':hover': {
|
|
277
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3Hover
|
|
278
|
+
},
|
|
279
|
+
':active': {
|
|
280
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3Pressed
|
|
281
|
+
},
|
|
282
|
+
':focus-visible': {
|
|
283
|
+
borderRadius: _tokens.tokens.borderRadiusLarge
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
const useRootNextStyles = (0, _reactcomponents.makeStyles)({
|
|
288
|
+
root: {
|
|
289
|
+
outline: `${_tokens.tokens.strokeWidthThin} solid ${_tokens.tokens.colorTransparentStroke}`,
|
|
290
|
+
borderRadius: _tokens.tokens.borderRadiusXLarge
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
const useAttachmentStyles_unstable = (state)=>{
|
|
294
|
+
'use no memo';
|
|
295
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
296
|
+
const primaryActionBaseClassName = usePrimaryActionBaseClassName();
|
|
297
|
+
const dismissButtonBaseClassName = useDismissButtonBaseClassName();
|
|
298
|
+
const dismissButtonCurrentStyles = useDismissButtonCurrentStyles();
|
|
299
|
+
const mediaBaseClassName = useMediaBaseClassName();
|
|
300
|
+
const contentBaseClassName = useContentBaseClassName();
|
|
301
|
+
const dismissIconBaseClassName = useDismissIconBaseClassName();
|
|
302
|
+
const dismissIconNextStyles = useDismissIconNextStyles();
|
|
303
|
+
const progressBarStyles = (0, _useProgressBarStylesstyles.useProgressBarStyles)();
|
|
304
|
+
const primaryActionStyles = usePrimaryActionStyles();
|
|
305
|
+
const imageOnlyStyles = useImageOnlyStyles();
|
|
306
|
+
const smallStyles = useSmallStyles();
|
|
307
|
+
const primaryActionNextStyles = usePrimaryActionNextStyles();
|
|
308
|
+
const dismissButtonNextStyles = useDismissButtonNextStyles();
|
|
309
|
+
const primaryDismissNextStyles = usePrimaryDismissNextStyles();
|
|
310
|
+
const rootNextStyles = useRootNextStyles();
|
|
311
|
+
const { imageOnly, primaryAction, size, mode, designVersion, dismissOnly } = state;
|
|
312
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.root, rootBaseClassName, designVersion === 'next' && rootNextStyles.root, state.root.className);
|
|
313
|
+
state.primaryAction.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.primaryAction, primaryActionBaseClassName, size === 'small' && smallStyles.primaryAction, primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button, imageOnly && imageOnlyStyles.primaryAction, designVersion === 'next' && primaryDismissNextStyles.sharedStyles, designVersion === 'next' && primaryActionNextStyles.root, designVersion === 'next' && primaryActionNextStyles[mode], state.primaryAction.className);
|
|
314
|
+
state.dismissButton.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.dismissButton, dismissButtonBaseClassName, designVersion === 'current' && dismissButtonCurrentStyles.root, size === 'small' && smallStyles.dismissButton, designVersion === 'next' && primaryDismissNextStyles.sharedStyles, designVersion === 'next' && dismissButtonNextStyles.root, designVersion === 'next' && dismissButtonNextStyles[mode], designVersion === 'next' && dismissOnly && dismissButtonNextStyles.dismissOnly, designVersion === 'next' && !dismissOnly && dismissButtonNextStyles.withPrimary, state.dismissButton.className);
|
|
315
|
+
if (state.media) {
|
|
316
|
+
state.media.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.media, mediaBaseClassName, size === 'small' && smallStyles.media, state.media.className);
|
|
317
|
+
}
|
|
318
|
+
state.content.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.content, contentBaseClassName, size === 'small' && smallStyles.content, imageOnly && imageOnlyStyles.content, state.content.className);
|
|
319
|
+
state.dismissIcon.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.dismissIcon, dismissIconBaseClassName, size === 'small' && smallStyles.dismissIcon, designVersion === 'next' && dismissOnly && dismissIconNextStyles.dismissOnly, state.dismissIcon.className);
|
|
320
|
+
if (state.progress) {
|
|
321
|
+
state.progress.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.progress, progressBarStyles.progress, state.progress.className);
|
|
322
|
+
const bar = _reactcomponents.slot.optional(state.progress.bar, {
|
|
323
|
+
elementType: 'div',
|
|
324
|
+
renderByDefault: true
|
|
325
|
+
});
|
|
326
|
+
if (bar) {
|
|
327
|
+
if (state.progress.value === undefined) {
|
|
328
|
+
bar.className = (0, _reactcomponents.mergeClasses)(progressBarStyles.indeterminateProgressBar, bar.className);
|
|
329
|
+
} else {
|
|
330
|
+
bar.className = (0, _reactcomponents.mergeClasses)(progressBarStyles.regularProgressBar, bar.className);
|
|
331
|
+
}
|
|
332
|
+
state.progress.bar = bar;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return state;
|
|
336
|
+
};
|
|
@@ -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 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 ':hover': {\n backgroundColor: tokens.colorNeutralBackground3Hover,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n },\n ':focus-visible': {\n borderRadius: tokens.borderRadiusLarge,\n },\n },\n});\n\nconst useRootNextStyles = makeStyles({\n root: {\n outline: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n borderRadius: tokens.borderRadiusXLarge,\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 { 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' && primaryActionNextStyles.root,\n designVersion === 'next' && primaryActionNextStyles[mode],\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' && dismissButtonNextStyles.root,\n designVersion === 'next' && dismissButtonNextStyles[mode],\n designVersion === 'next' && dismissOnly && dismissButtonNextStyles.dismissOnly,\n designVersion === 'next' && !dismissOnly && dismissButtonNextStyles.withPrimary,\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":["attachmentClassNames","useAttachmentStyles_unstable","useOverflowStyles","root","primaryAction","dismissButton","media","content","dismissIcon","progress","ATTACHMENT_MAXWIDTH","SMALL_ATTACHMENT_SIZE","ATTACHMENT_SIZE","useRootBaseClassName","makeResetStyles","display","flexWrap","verticalAlign","boxSizing","width","alignSelf","position","buttonBaseStyles","alignItems","backgroundColor","tokens","colorSubtleBackground","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","columnGap","spacingHorizontalSNudge","color","colorNeutralForeground1","cursor","justifyContent","createCustomFocusIndicatorStyle","outline","strokeWidthThick","colorStrokeFocus2","zIndex","usePrimaryActionBaseClassName","borderTopRightRadius","borderRadiusNone","borderBottomRightRadius","borderRightStyle","maxWidth","spacingHorizontalXXS","spacingHorizontalXS","padding","spacingVerticalXS","spacingHorizontalS","usePrimaryActionStyles","makeStyles","button","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","useDismissButtonBaseClassName","minWidth","borderLeftColor","borderTopLeftRadius","borderBottomLeftRadius","colorNeutralForeground2BrandHover","colorNeutralForeground2BrandPressed","useDismissButtonCurrentStyles","colorBrandForegroundLinkHover","useMediaBaseClassName","fontSize","height","lineHeight","useContentBaseClassName","overflowX","textOverflow","whiteSpace","typographyStyles","body1","useDismissIconBaseClassName","borderRadiusCircular","colorTransparentStroke","spacingVerticalXXS","useDismissIconNextStyles","dismissOnly","useImageOnlyStyles","overflow","useSmallStyles","caption1","usePrimaryActionNextStyles","borderRadiusXLarge","canvas","spacingVerticalNone","minHeight","sidecar","useDismissButtonNextStyles","colorNeutralForeground2","borderLeftWidth","borderLeftStyle","withPrimary","spacingHorizontalMNudge","colorNeutralBackground3","usePrimaryDismissNextStyles","sharedStyles","colorNeutralBackground3Hover","colorNeutralBackground3Pressed","borderRadiusLarge","useRootNextStyles","state","rootBaseClassName","primaryActionBaseClassName","dismissButtonBaseClassName","dismissButtonCurrentStyles","mediaBaseClassName","contentBaseClassName","dismissIconBaseClassName","dismissIconNextStyles","progressBarStyles","useProgressBarStyles","primaryActionStyles","imageOnlyStyles","smallStyles","primaryActionNextStyles","dismissButtonNextStyles","primaryDismissNextStyles","rootNextStyles","imageOnly","size","mode","designVersion","className","mergeClasses","as","isLoading","bar","slot","optional","elementType","renderByDefault","value","undefined","indeterminateProgressBar","regularProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAaaA,oBAAAA;eAAAA;;IAwSAC,4BAAAA;eAAAA;;IA/HAC,iBAAAA;eAAAA;;;iCA/KN;wBACgB;4CACc;AAI9B,MAAMF,uBAAwD;IACnEG,MAAM;IACNC,eAAe;IACfC,eAAe;IACfC,OAAO;IACPC,SAAS;IACTC,aAAa;IACbC,UAAU;AACZ;AAEA,MAAMC,sBAAsB;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MpG,QAAQ,CAAC8H,GAAG,GAAGA;QACvB;IACF;IAEA,OAAO1B;AACT"}
|
|
@@ -22,4 +22,4 @@ const AttachmentList = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
22
22
|
(0, _reactprovider.useCustomStyleHook)('useAttachmentListStyles')(state);
|
|
23
23
|
return (0, _renderAttachmentList.renderAttachmentList_unstable)(state, contextValues);
|
|
24
24
|
});
|
|
25
|
-
AttachmentList.displayName = 'AttachmentList';
|
|
25
|
+
AttachmentList.displayName = 'AttachmentList';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AttachmentList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentList_unstable } from './useAttachmentList';\nimport { renderAttachmentList_unstable } from './renderAttachmentList';\nimport { useAttachmentListStyles_unstable } from './useAttachmentListStyles.styles';\nimport { useAttachmentListContextValues_unstable } from './useAttachmentListContextValues';\nimport type { AttachmentListProps } from './AttachmentList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\nexport const AttachmentList: ForwardRefComponent<AttachmentListProps> = React.forwardRef((props, ref) => {\n const state = useAttachmentList_unstable(props, ref);\n const contextValues = useAttachmentListContextValues_unstable(state);\n\n useAttachmentListStyles_unstable(state);\n useCustomStyleHook('useAttachmentListStyles')(state);\n\n return renderAttachmentList_unstable(state, contextValues);\n});\n\nAttachmentList.displayName = 'AttachmentList';\n"],"names":["AttachmentList","React","forwardRef","props","state","useAttachmentList_unstable","contextValues","useAttachmentListContextValues_unstable","useAttachmentListStyles_unstable","useCustomStyleHook","renderAttachmentList_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;;iEATU;mCACoB;sCACG;+CACG;gDACO;+BAGrB;AAE5B,MAAMA,iBAAAA,WAAAA,
|
|
1
|
+
{"version":3,"sources":["AttachmentList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentList_unstable } from './useAttachmentList';\nimport { renderAttachmentList_unstable } from './renderAttachmentList';\nimport { useAttachmentListStyles_unstable } from './useAttachmentListStyles.styles';\nimport { useAttachmentListContextValues_unstable } from './useAttachmentListContextValues';\nimport type { AttachmentListProps } from './AttachmentList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\nexport const AttachmentList: ForwardRefComponent<AttachmentListProps> = React.forwardRef((props, ref) => {\n const state = useAttachmentList_unstable(props, ref);\n const contextValues = useAttachmentListContextValues_unstable(state);\n\n useAttachmentListStyles_unstable(state);\n useCustomStyleHook('useAttachmentListStyles')(state);\n\n return renderAttachmentList_unstable(state, contextValues);\n});\n\nAttachmentList.displayName = 'AttachmentList';\n"],"names":["AttachmentList","React","forwardRef","props","ref","state","useAttachmentList_unstable","contextValues","useAttachmentListContextValues_unstable","useAttachmentListStyles_unstable","useCustomStyleHook","renderAttachmentList_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;;iEATU;mCACoB;sCACG;+CACG;gDACO;+BAGrB;AAE5B,MAAMA,iBAAAA,WAAAA,GAA2DC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQC,IAAAA,6CAAAA,EAA2BH,OAAOC;IAChD,MAAMG,gBAAgBC,IAAAA,uEAAAA,EAAwCH;IAE9DI,IAAAA,+DAAAA,EAAiCJ;IACjCK,IAAAA,iCAAAA,EAAmB,2BAA2BL;IAE9C,OAAOM,IAAAA,mDAAAA,EAA8BN,OAAOE;AAC9C;AAEAP,eAAeY,WAAW,GAAG"}
|
|
@@ -29,4 +29,3 @@ const _AttachmentList = require("./AttachmentList");
|
|
|
29
29
|
const _renderAttachmentList = require("./renderAttachmentList");
|
|
30
30
|
const _useAttachmentList = require("./useAttachmentList");
|
|
31
31
|
const _useAttachmentListStylesstyles = require("./useAttachmentListStyles.styles");
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderAttachmentList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Overflow, assertSlots } from '@fluentui/react-components';\nimport { AttachmentListProvider } from '../../contexts/attachmentListContext';\nimport { AttachmentOverflowMenu } from '../AttachmentOverflowMenu';\nimport type { AttachmentListState, AttachmentListSlots, AttachmentListContextValues } from './AttachmentList.types';\n\n/**\n * Render the final JSX of AttachmentList\n */\nexport const renderAttachmentList_unstable = (\n state: AttachmentListState,\n contextValues: AttachmentListContextValues,\n) => {\n assertSlots<AttachmentListSlots>(state);\n const { overflowMenuProps, root, shouldUseOverflow } = state;\n\n return (\n <AttachmentListProvider value={contextValues.attachmentList}>\n {shouldUseOverflow && state.overflowMenuButton && state.menuList && state.menuPopover ? (\n <Overflow ref={root.ref}>\n <state.root>\n {root.children}\n <AttachmentOverflowMenu positioning={'above'} {...overflowMenuProps}>\n <state.overflowMenuButton />\n <state.menuPopover>\n <state.menuList />\n </state.menuPopover>\n </AttachmentOverflowMenu>\n </state.root>\n </Overflow>\n ) : (\n <state.root />\n )}\n </AttachmentListProvider>\n );\n};\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["renderAttachmentList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Overflow, assertSlots } from '@fluentui/react-components';\nimport { AttachmentListProvider } from '../../contexts/attachmentListContext';\nimport { AttachmentOverflowMenu } from '../AttachmentOverflowMenu';\nimport type { AttachmentListState, AttachmentListSlots, AttachmentListContextValues } from './AttachmentList.types';\n\n/**\n * Render the final JSX of AttachmentList\n */\nexport const renderAttachmentList_unstable = (\n state: AttachmentListState,\n contextValues: AttachmentListContextValues,\n) => {\n assertSlots<AttachmentListSlots>(state);\n const { overflowMenuProps, root, shouldUseOverflow } = state;\n\n return (\n <AttachmentListProvider value={contextValues.attachmentList}>\n {shouldUseOverflow && state.overflowMenuButton && state.menuList && state.menuPopover ? (\n <Overflow ref={root.ref}>\n <state.root>\n {root.children}\n <AttachmentOverflowMenu positioning={'above'} {...overflowMenuProps}>\n <state.overflowMenuButton />\n <state.menuPopover>\n <state.menuList />\n </state.menuPopover>\n </AttachmentOverflowMenu>\n </state.root>\n </Overflow>\n ) : (\n <state.root />\n )}\n </AttachmentListProvider>\n );\n};\n"],"names":["renderAttachmentList_unstable","state","contextValues","assertSlots","overflowMenuProps","root","shouldUseOverflow","_jsx","AttachmentListProvider","value","attachmentList","overflowMenuButton","menuList","menuPopover","Overflow","ref","_jsxs","children","AttachmentOverflowMenu","positioning"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;4BAVb;iCAEsC;uCACC;wCACA;AAMhC,MAAMA,gCAAgC,CAC3CC,OACAC;IAEAC,IAAAA,4BAAAA,EAAiCF;IACjC,MAAM,EAAEG,iBAAiB,EAAEC,IAAI,EAAEC,iBAAiB,EAAE,GAAGL;IAEvD,OAAA,WAAA,GACEM,IAAAA,eAAA,EAACC,6CAAAA,EAAAA;QAAuBC,OAAOP,cAAcQ,cAAc;kBACxDJ,qBAAqBL,MAAMU,kBAAkB,IAAIV,MAAMW,QAAQ,IAAIX,MAAMY,WAAW,GAAA,WAAA,GACnFN,IAAAA,eAAA,EAACO,yBAAAA,EAAAA;YAASC,KAAKV,KAAKU,GAAG;sBACrB,WAAA,GAAAC,IAAAA,gBAAA,EAACf,MAAMI,IAAI,EAAA;;oBACRA,KAAKY,QAAQ;kCACdD,IAAAA,gBAAA,EAACE,8CAAAA,EAAAA;wBAAuBC,aAAa;wBAAU,GAAGf,iBAAiB;;0CACjEG,IAAAA,eAAA,EAACN,MAAMU,kBAAkB,EAAA,CAAA;0CACzBJ,IAAAA,eAAA,EAACN,MAAMY,WAAW,EAAA;0CAChB,WAAA,GAAAN,IAAAA,eAAA,EAACN,MAAMW,QAAQ,EAAA,CAAA;;;;;;2BAMvBL,IAAAA,eAAA,EAACN,MAAMI,IAAI,EAAA,CAAA;;AAInB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n MenuList,\n MenuPopover,\n getIntrinsicElementProps,\n slot,\n useArrowNavigationGroup,\n useEventCallback,\n useFocusFinders,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useTimeout } from '@fluentui/react-utilities';\nimport { useOverflowMaxVisibleItems } from '@fluentui-copilot/react-utilities';\nimport { useOverflowStyles } from '../Attachment';\nimport { AttachmentOverflowMenuButton } from '../AttachmentOverflowMenuButton';\nimport { attachmentOverflowMenuButtonClassNames } from '../AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles';\nimport { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport type { AttachmentListProps, AttachmentListState } from './AttachmentList.types';\nimport type { AttachmentProps } from '../Attachment/Attachment.types';\n\n/**\n * Create the state required to render AttachmentList.\n *\n * The returned state can be modified with hooks such as useAttachmentListStyles_unstable,\n * before being passed to renderAttachmentList_unstable.\n *\n * @param props - props from this instance of AttachmentList\n * @param ref - reference to root HTMLElement of AttachmentList\n */\nexport const useAttachmentList_unstable = (\n props: AttachmentListProps,\n ref: React.Ref<HTMLDivElement>,\n): AttachmentListState => {\n const { children, maxVisibleAttachments, onAttachmentDismiss, overflowMenuProps } = props;\n const innerRef = React.useRef<HTMLDivElement>(null);\n const [setTimeout] = useTimeout();\n const { targetDocument } = useFluent();\n\n const designVersion = useDesignVersion(props.designVersion);\n const { findNextFocusable, findPrevFocusable, findLastFocusable } = useFocusFinders();\n const handleAttachmentDismiss: AttachmentListState['onAttachmentDismiss'] = useEventCallback((e, data) => {\n if (!onAttachmentDismiss) {\n return;\n }\n\n onAttachmentDismiss(e, data);\n\n // set focus after attachment dismiss\n const activeElement = targetDocument?.activeElement;\n if (innerRef.current?.contains(activeElement as HTMLElement)) {\n // focus on next attachment only if the active element is within the current attachment list\n const next = findNextFocusable(activeElement as HTMLElement, { container: innerRef.current });\n if (next) {\n // focus on the overflow button if the next focusable element is the overflow button.\n // if overflow button is removed from the DOM, focus on the last focusable element in the attachment list.\n if (next.classList.contains(attachmentOverflowMenuButtonClassNames.root)) {\n setTimeout(() => {\n findLastFocusable(innerRef.current as HTMLElement)?.focus();\n }, 0);\n } else {\n next.focus();\n }\n } else {\n const prev = findPrevFocusable(activeElement?.parentElement as HTMLElement, { container: innerRef.current });\n prev?.focus();\n }\n } else {\n // Handles keyboard focus when attachment removed is in the overflow menu. Also handles focus when the overflow button is removed from the DOM.\n setTimeout(() => {\n findLastFocusable(innerRef.current as HTMLElement)?.focus();\n }, 0);\n }\n });\n\n const styles = useOverflowStyles();\n const resolvedChildren = useOverflowMaxVisibleItems({\n children,\n maxVisibleItems: maxVisibleAttachments,\n overflowClassName: styles.overflow,\n });\n\n const attachmentOverflowMenuItems = React.useMemo(() => {\n if (resolvedChildren && Array.isArray(resolvedChildren)) {\n return resolvedChildren\n .filter(child => React.isValidElement(child))\n .map(child => (child as React.ReactElement).props)\n .map((attachment: AttachmentProps) => {\n const dismissButton = slot.optional(attachment.dismissButton, { elementType: 'button' });\n return (\n <AttachmentOverflowMenuItem\n {...attachment}\n key={attachment.id}\n onClick={dismissButton?.onClick as AttachmentProps['onClick']}\n />\n );\n });\n }\n return [];\n }, [resolvedChildren]);\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: true,\n axis: 'both',\n memorizeCurrent: true,\n });\n\n const shouldUseOverflow = maxVisibleAttachments !== undefined;\n\n return {\n designVersion,\n onAttachmentDismiss: handleAttachmentDismiss,\n shouldUseOverflow,\n numberOfAttachments: resolvedChildren.length,\n overflowMenuProps,\n components: {\n root: 'div',\n menuList: MenuList,\n menuPopover: MenuPopover,\n overflowMenuButton: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n 'aria-label': 'Attachments',\n ref: useMergedRefs(ref, innerRef),\n role: 'toolbar',\n ...arrowNavigationProps,\n ...props,\n children: resolvedChildren,\n }),\n { elementType: 'div' },\n ),\n menuList: slot.optional(props.menuList, {\n defaultProps: { children: attachmentOverflowMenuItems },\n elementType: MenuList,\n renderByDefault: true,\n }),\n menuPopover: slot.optional(props.menuPopover, { elementType: MenuPopover, renderByDefault: true }),\n overflowMenuButton: slot.optional(props.overflowMenuButton, {\n defaultProps: { children: <AttachmentOverflowMenuButton /> },\n elementType: 'span',\n renderByDefault: true,\n }),\n };\n};\n"],"names":["children","maxVisibleAttachments","props","onAttachmentDismiss","setTimeout","targetDocument","designVersion","overflowMenuProps","findNextFocusable","innerRef","useDesignVersion","next","container","useEventCallback","e","data","findLastFocusable","current","_innerRef_current","contains","activeElement","prev","root","_findLastFocusable","focus","findPrevFocusable","parentElement","styles","useOverflowStyles","overflowClassName","attachmentOverflowMenuItems","resolvedChildren","child","React","isValidElement","attachment","onClick","useMemo","Array","isArray","filter","map","elementType","circular","createElement","AttachmentOverflowMenuItem","axis","memorizeCurrent","id","dismissButton","shouldUseOverflow","numberOfAttachments","components","MenuPopover","handleAttachmentDismiss","useMergedRefs","arrowNavigationProps","menuList","slot","defaultProps","MenuList","renderByDefault","menuPopover","optional","overflowMenuButton"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAmCUA;;;eAAAA;;;;iEAnCa;iCAUhB;qCACyC;gCACrB;iCACgB;4BACT;8CACW;6DACU;4CACZ;+BACV;AAiB/B,MAAQA,6BAAUC,CAAqBC,OAAEC;UACzC,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AA,CAAA;YACAN,oBAASO,MAAAC,OAAA,CAAAR,mBAAA;YACX,OAAGA,iBAAAS,MAAA,CAAAR,CAAAA,QAAA,WAAA,GAAAC,OAAAC,cAAA,CAAAF,QAAAS,GAAA,CAAAT,CAAAA,QAAAA,MAAA9B,KAAA,EAAAuC,GAAA,CAAAN,CAAAA;gBAACJ,MAAAA,gBAAAA,qBAAAA,CAAAA,QAAAA,CAAAA,WAAAA,aAAAA,EAAAA;oBAAiBW,aAAA;gBAErB;gBACEC,OAAAA,WAAU,GAAAV,OAAAW,aAAA,CAAAC,sDAAA,EAAA;oBACVC,GAAAA,UAAM;oBACNC,KAAAA,WAAiBC,EAAA;oBACnBZ,SAAAa,kBAAA,QAAAA,kBAAA,KAAA,IAAA,KAAA,IAAAA,cAAAb,OAAA;gBAEA;YAEA;;eAEEjC,EAAAA;;;KACA+C;UACAC,uBAAqBpB,IAAAA,wCAAuB,EAAA;kBAC5CxB;cACA6C;yBACQ;;8BAEOC,0BAAAA;;;6BAGEC;;6BAGRC,iBAAmB9C,MAAAA;;oBAErB+C;kBACH;sBACAxD,yBAAU+B;yBAEZsB,4BAAA;gCAAe;;cAEjBI,qBAAAA,CAAAA,MAAUC,CAAAA,IAAAA,yCAA4B,EAAA,OAAE;0BACtCC;mDAAgB3D,EAAAA,KAAU8B;kBAA4B;mCACzC8B;oBACbC;sBACF9B;YACA+B;yBAAgDpB;;kBAAgDgB,qBAAA,CAAAK,QAAA,CAAA7D,MAAAuD,QAAA,EAAA;0BAChGO;0BACEL;;yBAA2DC,yBAAA;6BAC3DlB;;qBAEFgB,qBAAA,CAAAK,QAAA,CAAA7D,MAAA4D,WAAA,EAAA;YACFpB,aAAAW,4BAAA;YACAQ,iBAAA"}
|
|
1
|
+
{"version":3,"sources":["useAttachmentList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n MenuList,\n MenuPopover,\n getIntrinsicElementProps,\n slot,\n useArrowNavigationGroup,\n useEventCallback,\n useFocusFinders,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useTimeout } from '@fluentui/react-utilities';\nimport { useOverflowMaxVisibleItems } from '@fluentui-copilot/react-utilities';\nimport { useOverflowStyles } from '../Attachment';\nimport { AttachmentOverflowMenuButton } from '../AttachmentOverflowMenuButton';\nimport { attachmentOverflowMenuButtonClassNames } from '../AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles';\nimport { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport type { AttachmentListProps, AttachmentListState } from './AttachmentList.types';\nimport type { AttachmentProps } from '../Attachment/Attachment.types';\n\n/**\n * Create the state required to render AttachmentList.\n *\n * The returned state can be modified with hooks such as useAttachmentListStyles_unstable,\n * before being passed to renderAttachmentList_unstable.\n *\n * @param props - props from this instance of AttachmentList\n * @param ref - reference to root HTMLElement of AttachmentList\n */\nexport const useAttachmentList_unstable = (\n props: AttachmentListProps,\n ref: React.Ref<HTMLDivElement>,\n): AttachmentListState => {\n const { children, maxVisibleAttachments, onAttachmentDismiss, overflowMenuProps } = props;\n const innerRef = React.useRef<HTMLDivElement>(null);\n const [setTimeout] = useTimeout();\n const { targetDocument } = useFluent();\n\n const designVersion = useDesignVersion(props.designVersion);\n const { findNextFocusable, findPrevFocusable, findLastFocusable } = useFocusFinders();\n const handleAttachmentDismiss: AttachmentListState['onAttachmentDismiss'] = useEventCallback((e, data) => {\n if (!onAttachmentDismiss) {\n return;\n }\n\n onAttachmentDismiss(e, data);\n\n // set focus after attachment dismiss\n const activeElement = targetDocument?.activeElement;\n if (innerRef.current?.contains(activeElement as HTMLElement)) {\n // focus on next attachment only if the active element is within the current attachment list\n const next = findNextFocusable(activeElement as HTMLElement, { container: innerRef.current });\n if (next) {\n // focus on the overflow button if the next focusable element is the overflow button.\n // if overflow button is removed from the DOM, focus on the last focusable element in the attachment list.\n if (next.classList.contains(attachmentOverflowMenuButtonClassNames.root)) {\n setTimeout(() => {\n findLastFocusable(innerRef.current as HTMLElement)?.focus();\n }, 0);\n } else {\n next.focus();\n }\n } else {\n const prev = findPrevFocusable(activeElement?.parentElement as HTMLElement, { container: innerRef.current });\n prev?.focus();\n }\n } else {\n // Handles keyboard focus when attachment removed is in the overflow menu. Also handles focus when the overflow button is removed from the DOM.\n setTimeout(() => {\n findLastFocusable(innerRef.current as HTMLElement)?.focus();\n }, 0);\n }\n });\n\n const styles = useOverflowStyles();\n const resolvedChildren = useOverflowMaxVisibleItems({\n children,\n maxVisibleItems: maxVisibleAttachments,\n overflowClassName: styles.overflow,\n });\n\n const attachmentOverflowMenuItems = React.useMemo(() => {\n if (resolvedChildren && Array.isArray(resolvedChildren)) {\n return resolvedChildren\n .filter(child => React.isValidElement(child))\n .map(child => (child as React.ReactElement).props)\n .map((attachment: AttachmentProps) => {\n const dismissButton = slot.optional(attachment.dismissButton, { elementType: 'button' });\n return (\n <AttachmentOverflowMenuItem\n {...attachment}\n key={attachment.id}\n onClick={dismissButton?.onClick as AttachmentProps['onClick']}\n />\n );\n });\n }\n return [];\n }, [resolvedChildren]);\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: true,\n axis: 'both',\n memorizeCurrent: true,\n });\n\n const shouldUseOverflow = maxVisibleAttachments !== undefined;\n\n return {\n designVersion,\n onAttachmentDismiss: handleAttachmentDismiss,\n shouldUseOverflow,\n numberOfAttachments: resolvedChildren.length,\n overflowMenuProps,\n components: {\n root: 'div',\n menuList: MenuList,\n menuPopover: MenuPopover,\n overflowMenuButton: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n 'aria-label': 'Attachments',\n ref: useMergedRefs(ref, innerRef),\n role: 'toolbar',\n ...arrowNavigationProps,\n ...props,\n children: resolvedChildren,\n }),\n { elementType: 'div' },\n ),\n menuList: slot.optional(props.menuList, {\n defaultProps: { children: attachmentOverflowMenuItems },\n elementType: MenuList,\n renderByDefault: true,\n }),\n menuPopover: slot.optional(props.menuPopover, { elementType: MenuPopover, renderByDefault: true }),\n overflowMenuButton: slot.optional(props.overflowMenuButton, {\n defaultProps: { children: <AttachmentOverflowMenuButton /> },\n elementType: 'span',\n renderByDefault: true,\n }),\n };\n};\n"],"names":["useAttachmentList_unstable","props","ref","children","maxVisibleAttachments","onAttachmentDismiss","overflowMenuProps","innerRef","React","useRef","setTimeout","useTimeout","targetDocument","useFluent","designVersion","useDesignVersion","findNextFocusable","findPrevFocusable","findLastFocusable","useFocusFinders","handleAttachmentDismiss","useEventCallback","e","data","activeElement","current","contains","next","container","classList","attachmentOverflowMenuButtonClassNames","root","focus","prev","parentElement","styles","useOverflowStyles","resolvedChildren","useOverflowMaxVisibleItems","maxVisibleItems","overflowClassName","overflow","attachmentOverflowMenuItems","useMemo","Array","isArray","filter","child","isValidElement","map","attachment","dismissButton","slot","optional","elementType","createElement","AttachmentOverflowMenuItem","key","id","onClick","arrowNavigationProps","useArrowNavigationGroup","circular","axis","memorizeCurrent","shouldUseOverflow","undefined","numberOfAttachments","length","components","menuList","MenuList","menuPopover","MenuPopover","overflowMenuButton","always","getIntrinsicElementProps","useMergedRefs","role","defaultProps","renderByDefault","AttachmentOverflowMenuButton"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA+BaA;;;eAAAA;;;;iEA/BU;iCAUhB;qCACyC;gCACrB;iCACgB;4BACT;8CACW;6DACU;4CACZ;+BACV;AAa1B,MAAMA,6BAA6B,CACxCC,OACAC;IAEA,MAAM,EAAEC,QAAQ,EAAEC,qBAAqB,EAAEC,mBAAmB,EAAEC,iBAAiB,EAAE,GAAGL;IACpF,MAAMM,WAAWC,OAAMC,MAAM,CAAiB;IAC9C,MAAM,CAACC,WAAW,GAAGC,IAA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bC,oBAAoB;QACtB;QACA3C,MAAMqB,qBAAAA,CAAKuB,MAAM,CACfC,IAAAA,yCAAAA,EAAyB,OAAO;YAC9B,cAAc;YACd1E,KAAK2E,IAAAA,8BAAAA,EAAc3E,KAAKK;YACxBuE,MAAM;YACN,GAAGlB,oBAAoB;YACvB,GAAG3D,KAAK;YACRE,UAAUkC;QACZ,IACA;YAAEiB,aAAa;QAAM;QAEvBgB,UAAUlB,qBAAAA,CAAKC,QAAQ,CAACpD,MAAMqE,QAAQ,EAAE;YACtCS,cAAc;gBAAE5E,UAAUuC;YAA4B;YACtDY,aAAaiB,yBAAAA;YACbS,iBAAiB;QACnB;QACAR,aAAapB,qBAAAA,CAAKC,QAAQ,CAACpD,MAAMuE,WAAW,EAAE;YAAElB,aAAamB,4BAAAA;YAAaO,iBAAiB;QAAK;QAChGN,oBAAoBtB,qBAAAA,CAAKC,QAAQ,CAACpD,MAAMyE,kBAAkB,EAAE;YAC1DK,cAAc;gBAAE5E,UAAAA,WAAAA,GAAUK,OAAA+C,aAAA,CAAC0B,0DAAAA,EAAAA;YAAgC;YAC3D3B,aAAa;YACb0B,iBAAiB;QACnB;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentListContextValues.ts"],"sourcesContent":["import type { AttachmentListContextValues, AttachmentListState } from './AttachmentList.types';\n\nexport function useAttachmentListContextValues_unstable(state: AttachmentListState): AttachmentListContextValues {\n const { numberOfAttachments, onAttachmentDismiss, shouldUseOverflow } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", there is no sense to memoize it\n const attachmentList = {\n numberOfAttachments,\n onAttachmentDismiss,\n shouldUseOverflow,\n };\n\n return { attachmentList };\n}\n"],"names":["useAttachmentListContextValues_unstable","state","numberOfAttachments","onAttachmentDismiss","
|
|
1
|
+
{"version":3,"sources":["useAttachmentListContextValues.ts"],"sourcesContent":["import type { AttachmentListContextValues, AttachmentListState } from './AttachmentList.types';\n\nexport function useAttachmentListContextValues_unstable(state: AttachmentListState): AttachmentListContextValues {\n const { numberOfAttachments, onAttachmentDismiss, shouldUseOverflow } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", there is no sense to memoize it\n const attachmentList = {\n numberOfAttachments,\n onAttachmentDismiss,\n shouldUseOverflow,\n };\n\n return { attachmentList };\n}\n"],"names":["useAttachmentListContextValues_unstable","state","numberOfAttachments","onAttachmentDismiss","shouldUseOverflow","attachmentList"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,wCAAwCC,KAA0B;IAChF,MAAM,EAAEC,mBAAmB,EAAEC,mBAAmB,EAAEC,iBAAiB,EAAE,GAAGH;IAExE,mGAAmG;IACnG,MAAMI,iBAAiB;QACrBH;QACAC;QACAC;IACF;IAEA,OAAO;QAAEC;IAAe;AAC1B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
attachmentListClassNames: function() {
|
|
13
|
+
return attachmentListClassNames;
|
|
14
|
+
},
|
|
15
|
+
useAttachmentListStyles_unstable: function() {
|
|
16
|
+
return useAttachmentListStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _tokens = require("@fluentui-copilot/tokens");
|
|
21
|
+
const attachmentListClassNames = {
|
|
22
|
+
root: 'fai-AttachmentList',
|
|
23
|
+
menuList: 'fai-AttachmentList__menuList',
|
|
24
|
+
menuPopover: 'fai-AttachmentList__menuPopover',
|
|
25
|
+
overflowMenuButton: 'fai-AttachmentList__overflowMenuButton'
|
|
26
|
+
};
|
|
27
|
+
const useRootBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
28
|
+
columnGap: _tokens.tokens.spacingHorizontalSNudge,
|
|
29
|
+
display: 'flex',
|
|
30
|
+
flexDirection: 'row',
|
|
31
|
+
flexShrink: 0,
|
|
32
|
+
flexWrap: 'wrap',
|
|
33
|
+
rowGap: _tokens.tokens.spacingVerticalXS
|
|
34
|
+
});
|
|
35
|
+
const useOverflowMenuButtonBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
36
|
+
display: 'inline-flex'
|
|
37
|
+
});
|
|
38
|
+
const useOverflowMenuPopoverNextStyles = (0, _reactcomponents.makeStyles)({
|
|
39
|
+
borderRadius: {
|
|
40
|
+
borderRadius: _tokens.tokens.borderRadius4XL
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const useAttachmentListStyles_unstable = (state)=>{
|
|
44
|
+
'use no memo';
|
|
45
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
46
|
+
const overflowMenuButtonClassName = useOverflowMenuButtonBaseClassName();
|
|
47
|
+
const overflowMenuPopoverNextStyles = useOverflowMenuPopoverNextStyles();
|
|
48
|
+
const { designVersion } = state;
|
|
49
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.root, rootBaseClassName, state.root.className);
|
|
50
|
+
if (state.menuList) {
|
|
51
|
+
state.menuList.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.menuList, state.menuList.className);
|
|
52
|
+
}
|
|
53
|
+
if (state.menuPopover) {
|
|
54
|
+
state.menuPopover.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.menuPopover, designVersion === 'next' && overflowMenuPopoverNextStyles.borderRadius, state.menuPopover.className);
|
|
55
|
+
}
|
|
56
|
+
if (state.overflowMenuButton) {
|
|
57
|
+
state.overflowMenuButton.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.overflowMenuButton, overflowMenuButtonClassName, state.overflowMenuButton.className);
|
|
58
|
+
}
|
|
59
|
+
return state;
|
|
60
|
+
};
|
|
@@ -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":["attachmentListClassNames","useAttachmentListStyles_unstable","root","menuList","menuPopover","overflowMenuButton","useRootBaseClassName","makeResetStyles","columnGap","tokens","spacingHorizontalSNudge","display","flexDirection","flexShrink","flexWrap","rowGap","spacingVerticalXS","useOverflowMenuButtonBaseClassName","useOverflowMenuPopoverNextStyles","makeStyles","borderRadius","borderRadius4XL","state","rootBaseClassName","overflowMenuButtonClassName","overflowMenuPopoverNextStyles","designVersion","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,wBAAAA;eAAAA;;IA6BAC,gCAAAA;eAAAA;;;iCAlC6C;wBACnC;AAIhB,MAAMD,2BAAgE;IAC3EE,MAAM;IACNC,UAAU;IACVC,aAAa;IACbC,oBAAoB;AACtB;AAEA,MAAMC,uBAAuBC,IAAAA,gCAAAA,EAAgB;IAC3CC,WAAWC,cAAAA,CAAOC,uBAAuB;IACzCC,SAAS;IACTC,eAAe;IACfC,YAAY;IACZC,UAAU;IACVC,QAAQN,cAAAA,CAAOO,iBAAiB;AAClC;AAEA,MAAMC,qCAAqCV,IAAAA,gCAAAA,EAAgB;IACzDI,SAAS;AACX;AAEA,MAAMO,mCAAmCC,IAAAA,2BAAAA,EAAW;IAClDC,cAAc;QACZA,cAAcX,cAAAA,CAAOY,eAAe;IACtC;AACF;AAKO,MAAMpB,mCAAmC,CAACqB;IAC/C;IAEA,MAAMC,oBAAoBjB;IAC1B,MAAMkB,8BAA8BP;IACpC,MAAMQ,gCAAgCP;IACtC,MAAM,EAAEQ,aAAa,EAAE,GAAGJ;IAE1BA,MAAMpB,IAAI,CAACyB,SAAS,GAAGC,IAAAA,6BAAAA,EAAa5B,yBAAyBE,IAAI,EAAEqB,mBAAmBD,MAAMpB,IAAI,CAACyB,SAAS;IAE1G,IAAIL,MAAMnB,QAAQ,EAAE;QAClBmB,MAAMnB,QAAQ,CAACwB,SAAS,GAAGC,IAAAA,6BAAAA,EAAa5B,yBAAyBG,QAAQ,EAAEmB,MAAMnB,QAAQ,CAACwB,SAAS;IACrG;IACA,IAAIL,MAAMlB,WAAW,EAAE;QACrBkB,MAAMlB,WAAW,CAACuB,SAAS,GAAGC,IAAAA,6BAAAA,EAC5B5B,yBAAyBI,WAAW,EACpCsB,kBAAkB,UAAUD,8BAA8BL,YAAY,EACtEE,MAAMlB,WAAW,CAACuB,SAAS;IAE/B;IAEA,IAAIL,MAAMjB,kBAAkB,EAAE;QAC5BiB,MAAMjB,kBAAkB,CAACsB,SAAS,GAAGC,IAAAA,6BAAAA,EACnC5B,yBAAyBK,kBAAkB,EAC3CmB,6BACAF,MAAMjB,kBAAkB,CAACsB,SAAS;IAEtC;IAEA,OAAOL;AACT"}
|
|
@@ -21,4 +21,4 @@ const AttachmentOverflowMenu = (props)=>{
|
|
|
21
21
|
attachmentOverflowMenuContextValues
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
-
AttachmentOverflowMenu.displayName = 'AttachmentOverflowMenu';
|
|
24
|
+
AttachmentOverflowMenu.displayName = 'AttachmentOverflowMenu';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AttachmentOverflowMenu.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { useAttachmentOverflowMenu_unstable } from './useAttachmentOverflowMenu';\nimport { renderAttachmentOverflowMenu_unstable } from './renderAttachmentOverflowMenu';\nimport { useAttachmentOverflowMenuContextValues_unstable } from './useAttachmentOverflowMenuContextValues';\nimport { useMenuContextValues_unstable } from '@fluentui/react-components';\nimport type { AttachmentOverflowMenuProps } from './AttachmentOverflowMenu.types';\n\nexport const AttachmentOverflowMenu: React.FC<AttachmentOverflowMenuProps> = props => {\n const state = useAttachmentOverflowMenu_unstable(props);\n const menuContextValues = useMenuContextValues_unstable(state);\n const attachmentOverflowMenuContextValues = useAttachmentOverflowMenuContextValues_unstable(state);\n\n return renderAttachmentOverflowMenu_unstable(state, { menuContextValues, attachmentOverflowMenuContextValues });\n};\n\nAttachmentOverflowMenu.displayName = 'AttachmentOverflowMenu';\n"],"names":["AttachmentOverflowMenu","props","state","useAttachmentOverflowMenu_unstable","menuContextValues","useMenuContextValues_unstable","attachmentOverflowMenuContextValues","useAttachmentOverflowMenuContextValues_unstable","renderAttachmentOverflowMenu_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAOaA;;;eAAAA;;;2CANsC;8CACG;wDACU;iCAClB;AAGvC,MAAMA,yBAAgEC,CAAAA;
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenu.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { useAttachmentOverflowMenu_unstable } from './useAttachmentOverflowMenu';\nimport { renderAttachmentOverflowMenu_unstable } from './renderAttachmentOverflowMenu';\nimport { useAttachmentOverflowMenuContextValues_unstable } from './useAttachmentOverflowMenuContextValues';\nimport { useMenuContextValues_unstable } from '@fluentui/react-components';\nimport type { AttachmentOverflowMenuProps } from './AttachmentOverflowMenu.types';\n\nexport const AttachmentOverflowMenu: React.FC<AttachmentOverflowMenuProps> = props => {\n const state = useAttachmentOverflowMenu_unstable(props);\n const menuContextValues = useMenuContextValues_unstable(state);\n const attachmentOverflowMenuContextValues = useAttachmentOverflowMenuContextValues_unstable(state);\n\n return renderAttachmentOverflowMenu_unstable(state, { menuContextValues, attachmentOverflowMenuContextValues });\n};\n\nAttachmentOverflowMenu.displayName = 'AttachmentOverflowMenu';\n"],"names":["AttachmentOverflowMenu","props","state","useAttachmentOverflowMenu_unstable","menuContextValues","useMenuContextValues_unstable","attachmentOverflowMenuContextValues","useAttachmentOverflowMenuContextValues_unstable","renderAttachmentOverflowMenu_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAOaA;;;eAAAA;;;2CANsC;8CACG;wDACU;iCAClB;AAGvC,MAAMA,yBAAgEC,CAAAA;IAC3E,MAAMC,QAAQC,IAAAA,6DAAAA,EAAmCF;IACjD,MAAMG,oBAAoBC,IAAAA,8CAAAA,EAA8BH;IACxD,MAAMI,sCAAsCC,IAAAA,uFAAAA,EAAgDL;IAE5F,OAAOM,IAAAA,mEAAAA,EAAsCN,OAAO;QAAEE;QAAmBE;IAAoC;AAC/G;AAEAN,uBAAuBS,WAAW,GAAG"}
|