@fluentui-copilot/react-attachments 0.0.0-nightly-20251010-0406-7df7c6d1.1 → 0.0.0-nightly-20251013-0406-7c7739c8.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 +3 -3
- package/CHANGELOG.md +4 -4
- package/dist/index.d.ts +379 -0
- package/lib/AgentTag.js +1 -0
- package/lib/AgentTag.js.map +1 -0
- package/lib/Attachment.js +1 -0
- package/lib/Attachment.js.map +1 -0
- package/lib/AttachmentList.js +1 -0
- package/lib/AttachmentList.js.map +1 -0
- package/lib/AttachmentOverflowMenu.js +1 -0
- package/lib/AttachmentOverflowMenu.js.map +1 -0
- package/lib/AttachmentOverflowMenuButton.js +1 -0
- package/lib/AttachmentOverflowMenuButton.js.map +1 -0
- package/lib/AttachmentOverflowMenuItem.js +1 -0
- package/lib/AttachmentOverflowMenuItem.js.map +1 -0
- package/lib/components/AgentTag/AgentTag.js +11 -0
- package/lib/components/AgentTag/AgentTag.js.map +1 -0
- package/lib/components/AgentTag/AgentTag.types.js +3 -0
- package/lib/components/AgentTag/AgentTag.types.js.map +1 -0
- package/lib/components/AgentTag/index.js +4 -0
- package/lib/components/AgentTag/index.js.map +1 -0
- package/lib/components/AgentTag/renderAgentTag.js +6 -0
- package/lib/components/AgentTag/renderAgentTag.js.map +1 -0
- package/lib/components/AgentTag/useAgentTag.js +18 -0
- package/lib/components/AgentTag/useAgentTag.js.map +1 -0
- package/lib/components/AgentTag/useAgentTagStyles.styles.js +95 -0
- package/lib/components/AgentTag/useAgentTagStyles.styles.js.map +1 -0
- 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 +13 -0
- package/lib/components/Attachment/Attachment.js.map +1 -0
- package/lib/components/Attachment/Attachment.types.js +3 -0
- package/lib/components/Attachment/Attachment.types.js.map +1 -0
- package/lib/components/Attachment/index.js +4 -0
- package/lib/components/Attachment/index.js.map +1 -0
- package/lib/components/Attachment/renderAttachment.js +42 -0
- package/lib/components/Attachment/renderAttachment.js.map +1 -0
- package/lib/components/Attachment/useAttachment.js +103 -0
- package/lib/components/Attachment/useAttachment.js.map +1 -0
- package/lib/components/Attachment/useAttachmentStyles.styles.js +348 -0
- package/lib/components/Attachment/useAttachmentStyles.styles.js.map +1 -0
- package/lib/components/Attachment/useAttachmentStyles.styles.raw.js +328 -0
- package/lib/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -0
- package/lib/components/AttachmentList/AttachmentList.js +14 -0
- package/lib/components/AttachmentList/AttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/AttachmentList.types.js +1 -0
- package/lib/components/AttachmentList/AttachmentList.types.js.map +1 -0
- package/lib/components/AttachmentList/index.js +4 -0
- package/lib/components/AttachmentList/index.js.map +1 -0
- package/lib/components/AttachmentList/renderAttachmentList.js +31 -0
- package/lib/components/AttachmentList/renderAttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentList.js +134 -0
- package/lib/components/AttachmentList/useAttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentListContextValues.js +12 -0
- package/lib/components/AttachmentList/useAttachmentListContextValues.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.js +48 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.js.map +1 -0
- 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 +14 -0
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +1 -0
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/index.js +4 -0
- package/lib/components/AttachmentOverflowMenu/index.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +13 -0
- package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +18 -0
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +12 -0
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +12 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +3 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/index.js +4 -0
- package/lib/components/AttachmentOverflowMenuButton/index.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +15 -0
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +69 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +116 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -0
- 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 +10 -0
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +3 -0
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/index.js +4 -0
- package/lib/components/AttachmentOverflowMenuItem/index.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +13 -0
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +56 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js +84 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +59 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
- package/lib/components/index.js +5 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/utils/useProgressBarStyles.styles.js +54 -0
- package/lib/components/utils/useProgressBarStyles.styles.js.map +1 -0
- 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 +9 -0
- package/lib/contexts/attachmentListContext.js.map +1 -0
- package/lib/contexts/attachmentOverflowMenuContext.js +9 -0
- package/lib/contexts/attachmentOverflowMenuContext.js.map +1 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib-commonjs/AgentTag.js +28 -0
- package/lib-commonjs/AgentTag.js.map +1 -0
- package/lib-commonjs/Attachment.js +31 -0
- package/lib-commonjs/Attachment.js.map +1 -0
- package/lib-commonjs/AttachmentList.js +28 -0
- package/lib-commonjs/AttachmentList.js.map +1 -0
- package/lib-commonjs/AttachmentOverflowMenu.js +25 -0
- package/lib-commonjs/AttachmentOverflowMenu.js.map +1 -0
- package/lib-commonjs/AttachmentOverflowMenuButton.js +28 -0
- package/lib-commonjs/AttachmentOverflowMenuButton.js.map +1 -0
- package/lib-commonjs/AttachmentOverflowMenuItem.js +28 -0
- package/lib-commonjs/AttachmentOverflowMenuItem.js.map +1 -0
- package/lib-commonjs/components/AgentTag/AgentTag.js +21 -0
- package/lib-commonjs/components/AgentTag/AgentTag.js.map +1 -0
- package/lib-commonjs/components/AgentTag/AgentTag.types.js +6 -0
- package/lib-commonjs/components/AgentTag/AgentTag.types.js.map +1 -0
- package/lib-commonjs/components/AgentTag/index.js +31 -0
- package/lib-commonjs/components/AgentTag/index.js.map +1 -0
- package/lib-commonjs/components/AgentTag/renderAgentTag.js +14 -0
- package/lib-commonjs/components/AgentTag/renderAgentTag.js.map +1 -0
- package/lib-commonjs/components/AgentTag/useAgentTag.js +19 -0
- package/lib-commonjs/components/AgentTag/useAgentTag.js.map +1 -0
- package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.js +145 -0
- package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.js.map +1 -0
- 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 +23 -0
- package/lib-commonjs/components/Attachment/Attachment.js.map +1 -0
- package/lib-commonjs/components/Attachment/Attachment.types.js +6 -0
- package/lib-commonjs/components/Attachment/Attachment.types.js.map +1 -0
- package/lib-commonjs/components/Attachment/index.js +34 -0
- package/lib-commonjs/components/Attachment/index.js.map +1 -0
- package/lib-commonjs/components/Attachment/renderAttachment.js +50 -0
- package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -0
- package/lib-commonjs/components/Attachment/useAttachment.js +105 -0
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js +550 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js +347 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.js +25 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js +4 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/index.js +31 -0
- package/lib-commonjs/components/AttachmentList/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +39 -0
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js +137 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js +22 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.js +67 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.js.map +1 -0
- 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 +24 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +4 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/index.js +28 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +21 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +21 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +22 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +23 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +6 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js +31 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +23 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +72 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +178 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -0
- 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 +21 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +6 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js +31 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +21 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +59 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js +109 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +75 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/index.js +92 -0
- package/lib-commonjs/components/index.js.map +1 -0
- package/lib-commonjs/components/utils/useProgressBarStyles.styles.js +103 -0
- package/lib-commonjs/components/utils/useProgressBarStyles.styles.js.map +1 -0
- 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 +30 -0
- package/lib-commonjs/contexts/attachmentListContext.js.map +1 -0
- package/lib-commonjs/contexts/attachmentOverflowMenuContext.js +30 -0
- package/lib-commonjs/contexts/attachmentOverflowMenuContext.js.map +1 -0
- package/lib-commonjs/index.js +122 -0
- package/lib-commonjs/index.js.map +1 -0
- package/package.json +4 -4
package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useAttachmentOverflowMenuButton_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useAttachmentOverflowMenuButton_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
14
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
15
|
+
const _attachmentOverflowMenuContext = require("../../contexts/attachmentOverflowMenuContext");
|
|
16
|
+
const _reacticons = require("@fluentui/react-icons");
|
|
17
|
+
const _attachmentListContext = require("../../contexts/attachmentListContext");
|
|
18
|
+
const useAttachmentOverflowMenuButton_unstable = (props, ref)=>{
|
|
19
|
+
const { isOverflowing, overflowCount, overflowButtonRef } = (0, _attachmentOverflowMenuContext.useAttachmentOverflowMenuContext_unstable)((context)=>context);
|
|
20
|
+
const { numberOfAttachments } = (0, _attachmentListContext.useAttachmentListContext_unstable)((context)=>context);
|
|
21
|
+
const fullyOverflowed = overflowCount >= numberOfAttachments;
|
|
22
|
+
const isLoading = !!props.isLoading;
|
|
23
|
+
const designVersion = (0, _reactprovider.useDesignVersion)(props.designVersion);
|
|
24
|
+
const mode = (0, _reactprovider.useCopilotMode)(props.mode);
|
|
25
|
+
const buttonText = defaultButtonText(props, overflowCount, designVersion, mode, fullyOverflowed);
|
|
26
|
+
return {
|
|
27
|
+
components: {
|
|
28
|
+
root: 'button',
|
|
29
|
+
progress: _reactcomponents.ProgressBar
|
|
30
|
+
},
|
|
31
|
+
root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('button', {
|
|
32
|
+
ref: (0, _reactcomponents.useMergedRefs)(ref, overflowButtonRef),
|
|
33
|
+
...props
|
|
34
|
+
}), {
|
|
35
|
+
defaultProps: {
|
|
36
|
+
children: buttonText
|
|
37
|
+
},
|
|
38
|
+
elementType: 'button'
|
|
39
|
+
}),
|
|
40
|
+
progress: _reactcomponents.slot.always(props.progress, {
|
|
41
|
+
defaultProps: {
|
|
42
|
+
value: undefined,
|
|
43
|
+
shape: 'square',
|
|
44
|
+
thickness: 'large',
|
|
45
|
+
'aria-label': 'Loading'
|
|
46
|
+
},
|
|
47
|
+
elementType: _reactcomponents.ProgressBar
|
|
48
|
+
}),
|
|
49
|
+
fullyOverflowed,
|
|
50
|
+
isOverflowing,
|
|
51
|
+
overflowCount,
|
|
52
|
+
isLoading,
|
|
53
|
+
designVersion,
|
|
54
|
+
mode
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
function defaultButtonText(props, overflowCount, designVersion, copilotMode, fullyOverflowed) {
|
|
58
|
+
if (props.children) {
|
|
59
|
+
return props.children;
|
|
60
|
+
}
|
|
61
|
+
if (props.text) {
|
|
62
|
+
if (typeof props.text === 'function') {
|
|
63
|
+
return props.text(overflowCount);
|
|
64
|
+
} else {
|
|
65
|
+
return props.text;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (designVersion === 'next' && fullyOverflowed) {
|
|
69
|
+
return /*#__PURE__*/ _react.createElement(_react.Fragment, null, copilotMode === 'canvas' ? /*#__PURE__*/ _react.createElement(_reacticons.Attach24Regular, null) : /*#__PURE__*/ _react.createElement(_reacticons.Attach20Regular, null), overflowCount);
|
|
70
|
+
}
|
|
71
|
+
return `+${overflowCount}`;
|
|
72
|
+
}
|
package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { CopilotMode, DesignVersion } from '@fluentui-copilot/react-provider';\nimport { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';\nimport { ProgressBar, getIntrinsicElementProps, slot, useMergedRefs } from '@fluentui/react-components';\nimport { useAttachmentOverflowMenuContext_unstable } from '../../contexts/attachmentOverflowMenuContext';\nimport type {\n AttachmentOverflowMenuButtonProps,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton.types';\nimport { Attach20Regular, Attach24Regular } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\n\n/**\n * Create the state required to render AttachmentOverflowMenuButton.\n *\n * The returned state can be modified with hooks such as useAttachmentOverflowMenuButtonStyles_unstable,\n * before being passed to renderAttachmentOverflowMenuButton_unstable.\n *\n * @param props - props from this instance of AttachmentOverflowMenuButton\n * @param ref - reference to root HTMLElement of AttachmentOverflowMenuButton\n */\nexport const useAttachmentOverflowMenuButton_unstable = (\n props: AttachmentOverflowMenuButtonProps,\n ref: React.Ref<HTMLButtonElement>,\n): AttachmentOverflowMenuButtonState => {\n const { isOverflowing, overflowCount, overflowButtonRef } = useAttachmentOverflowMenuContext_unstable(\n context => context,\n );\n const { numberOfAttachments } = useAttachmentListContext_unstable(context => context);\n\n const fullyOverflowed = overflowCount >= numberOfAttachments;\n const isLoading = !!props.isLoading;\n\n const designVersion = useDesignVersion(props.designVersion);\n const mode = useCopilotMode(props.mode);\n\n const buttonText = defaultButtonText(props, overflowCount, designVersion, mode, fullyOverflowed);\n\n return {\n components: {\n root: 'button',\n progress: ProgressBar,\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref: useMergedRefs(ref, overflowButtonRef),\n ...props,\n }),\n {\n defaultProps: {\n children: buttonText,\n },\n elementType: 'button',\n },\n ),\n progress: slot.always(props.progress, {\n defaultProps: { value: undefined, shape: 'square', thickness: 'large', 'aria-label': 'Loading' },\n elementType: ProgressBar,\n }),\n fullyOverflowed,\n isOverflowing,\n overflowCount,\n isLoading,\n designVersion,\n mode,\n };\n};\n\nfunction defaultButtonText(\n props: AttachmentOverflowMenuButtonProps,\n overflowCount: number,\n designVersion: DesignVersion['designVersion'],\n copilotMode: CopilotMode['mode'],\n fullyOverflowed: boolean,\n) {\n if (props.children) {\n return props.children;\n }\n\n if (props.text) {\n if (typeof props.text === 'function') {\n return props.text(overflowCount);\n } else {\n return props.text;\n }\n }\n\n if (designVersion === 'next' && fullyOverflowed) {\n return (\n <>\n {copilotMode === 'canvas' ? <Attach24Regular /> : <Attach20Regular />}\n {overflowCount}\n </>\n );\n }\n\n return `+${overflowCount}`;\n}\n"],"names":["useAttachmentOverflowMenuButton_unstable","props","ref","isOverflowing","overflowCount","overflowButtonRef","useAttachmentOverflowMenuContext_unstable","context","numberOfAttachments","useAttachmentListContext_unstable","fullyOverflowed","isLoading","designVersion","useDesignVersion","mode","useCopilotMode","buttonText","defaultButtonText","components","root","progress","ProgressBar","slot","always","getIntrinsicElementProps","useMergedRefs","defaultProps","children","elementType","value","undefined","shape","thickness","copilotMode","text","React","createElement","Fragment","Attach24Regular","Attach20Regular"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAqBaA;;;eAAAA;;;;iEArBU;+BAE0B;iCAC0B;+CACjB;4BAKT;uCACC;AAW3C,MAAMA,2CAA2C,CACtDC,OACAC;IAEA,MAAM,EAAEC,aAAa,EAAEC,aAAa,EAAEC,iBAAiB,EAAE,GAAGC,IAAAA,wEAAAA,EAC1DC,CAAAA,UAAWA;IAEb,MAAM,EAAEC,mBAAmB,EAAE,GAAGC,IAAAA,wDAAAA,EAAkCF,CAAAA,UAAWA;IAE7E,MAAMG,kBAAkBN,iBAAiBI;IACzC,MAAMG,YAAY,CAAC,CAACV,MAAMU,SAAS;IAEnC,MAAMC,gBAAgBC,IAAAA,+BAAAA,EAAiBZ,MAAMW,aAAa;IAC1D,MAAME,OAAOC,IAAAA,6BAAAA,EAAed,MAAMa,IAAI;IAEtC,MAAME,aAAaC,kBAAkBhB,OAAOG,eAAeQ,eAAeE,MAAMJ;IAEhF,OAAO;QACLQ,YAAY;YACVC,MAAM;YACNC,UAAUC,4BAAAA;QACZ;QACAF,MAAMG,qBAAAA,CAAKC,MAAM,CACfC,IAAAA,yCAAAA,EAAyB,UAAU;YACjCtB,KAAKuB,IAAAA,8BAAAA,EAAcvB,KAAKG;YACxB,GAAGJ,KAAK;QACV,IACA;YACEyB,cAAc;gBACZC,UAAUX;YACZ;YACAY,aAAa;QACf;QAEFR,UAAUE,qBAAAA,CAAKC,MAAM,CAACtB,MAAMmB,QAAQ,EAAE;YACpCM,cAAc;gBAAEG,OAAOC;gBAAWC,OAAO;gBAAUC,WAAW;gBAAS,cAAc;YAAU;YAC/FJ,aAAaP,4BAAAA;QACf;QACAX;QACAP;QACAC;QACAO;QACAC;QACAE;IACF;AACF;AAEA,SAASG,kBACPhB,KAAwC,EACxCG,aAAqB,EACrBQ,aAA6C,EAC7CqB,WAAgC,EAChCvB,eAAwB;IAExB,IAAIT,MAAM0B,QAAQ,EAAE;QAClB,OAAO1B,MAAM0B,QAAQ;IACvB;IAEA,IAAI1B,MAAMiC,IAAI,EAAE;QACd,IAAI,OAAOjC,MAAMiC,IAAI,KAAK,YAAY;YACpC,OAAOjC,MAAMiC,IAAI,CAAC9B;QACpB,OAAO;YACL,OAAOH,MAAMiC,IAAI;QACnB;IACF;IAEA,IAAItB,kBAAkB,UAAUF,iBAAiB;QAC/C,OAAA,WAAA,GACEyB,OAAAC,aAAA,CAAAD,OAAAE,QAAA,EAAA,MACGJ,gBAAgB,WAAA,WAAA,GAAWE,OAAAC,aAAA,CAACE,2BAAAA,EAAAA,QAAAA,WAAAA,GAAqBH,OAAAC,aAAA,CAACG,2BAAAA,EAAAA,OAClDnC;IAGP;IAEA,OAAO,CAAC,CAAC,EAAEA,cAAc,CAAC;AAC5B"}
|
|
@@ -0,0 +1,178 @@
|
|
|
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
|
+
attachmentOverflowMenuButtonClassNames: function() {
|
|
13
|
+
return attachmentOverflowMenuButtonClassNames;
|
|
14
|
+
},
|
|
15
|
+
useAttachmentOverflowMenuButtonStyles_unstable: function() {
|
|
16
|
+
return useAttachmentOverflowMenuButtonStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _useProgressBarStylesstyles = require("../utils/useProgressBarStyles.styles");
|
|
21
|
+
const attachmentOverflowMenuButtonClassNames = {
|
|
22
|
+
root: 'fai-AttachmentOverflowMenuButton',
|
|
23
|
+
progress: 'fai-AttachmentOverflowMenuButton__progress'
|
|
24
|
+
};
|
|
25
|
+
const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("r1o7ejxu", null, {
|
|
26
|
+
r: [
|
|
27
|
+
".r1o7ejxu{color:var(--colorNeutralForeground1);align-items:center;background-color:var(--colorSubtleBackground);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);cursor:pointer;display:inline-flex;flex-wrap:nowrap;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);justify-content:center;padding:var(--spacingVerticalXS) var(--spacingHorizontalS);vertical-align:middle;position:relative;}",
|
|
28
|
+
".r1o7ejxu:hover{cursor:pointer;background-color:var(--colorSubtleBackgroundHover);color:var(--colorNeutralForeground2Hover);}",
|
|
29
|
+
".r1o7ejxu:active{background-color:var(--colorSubtleBackgroundPressed);color:var(--colorNeutralForeground2Pressed);}"
|
|
30
|
+
],
|
|
31
|
+
s: [
|
|
32
|
+
"@media (forced-colors: active){.r1o7ejxu:hover{background-color:HighlightText;}.r1o7ejxu:active{background-color:HighlightText;}}"
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
const useNextStyles = (0, _reactcomponents.__styles)({
|
|
36
|
+
root: {
|
|
37
|
+
Beyfa6y: 0,
|
|
38
|
+
Bbmb7ep: 0,
|
|
39
|
+
Btl43ni: 0,
|
|
40
|
+
B7oj6ja: 0,
|
|
41
|
+
Dimara: "f1kijzfu",
|
|
42
|
+
g2u3we: "fghlq4f",
|
|
43
|
+
h3c5rm: [
|
|
44
|
+
"f1gn591s",
|
|
45
|
+
"fjscplz"
|
|
46
|
+
],
|
|
47
|
+
B9xav0g: "fb073pr",
|
|
48
|
+
zhjwy3: [
|
|
49
|
+
"fjscplz",
|
|
50
|
+
"f1gn591s"
|
|
51
|
+
],
|
|
52
|
+
sj55zd: "fkfq4zb",
|
|
53
|
+
De3pzq: "f16xq7d1",
|
|
54
|
+
eoavqd: "f8491dx",
|
|
55
|
+
Bi91k9c: "fnwyq0v",
|
|
56
|
+
Jwef8y: "f1h648pw",
|
|
57
|
+
lj723h: "flvvhsy",
|
|
58
|
+
ecr2s2: "fwdzr64"
|
|
59
|
+
},
|
|
60
|
+
canvas: {
|
|
61
|
+
sshi5w: "f1w5jphr",
|
|
62
|
+
Byoj8tv: 0,
|
|
63
|
+
uwmqm3: 0,
|
|
64
|
+
z189sj: 0,
|
|
65
|
+
z8tnut: 0,
|
|
66
|
+
B0ocmuz: "f1nm7172"
|
|
67
|
+
},
|
|
68
|
+
sidecar: {
|
|
69
|
+
sshi5w: "f1nxs5xn",
|
|
70
|
+
Byoj8tv: 0,
|
|
71
|
+
uwmqm3: 0,
|
|
72
|
+
z189sj: 0,
|
|
73
|
+
z8tnut: 0,
|
|
74
|
+
B0ocmuz: "f1nm7172"
|
|
75
|
+
},
|
|
76
|
+
fullyOverflowed_canvas: {
|
|
77
|
+
Byoj8tv: 0,
|
|
78
|
+
uwmqm3: 0,
|
|
79
|
+
z189sj: 0,
|
|
80
|
+
z8tnut: 0,
|
|
81
|
+
B0ocmuz: "fuva4e2",
|
|
82
|
+
Bahqtrf: "fk6fouc",
|
|
83
|
+
Be2twd7: "fod5ikn",
|
|
84
|
+
Bhrd7zp: "fl43uef",
|
|
85
|
+
Bg96gwp: "f1anucx2"
|
|
86
|
+
},
|
|
87
|
+
fullyOverflowed_sidecar: {
|
|
88
|
+
Byoj8tv: 0,
|
|
89
|
+
uwmqm3: 0,
|
|
90
|
+
z189sj: 0,
|
|
91
|
+
z8tnut: 0,
|
|
92
|
+
B0ocmuz: "ffysxzw",
|
|
93
|
+
Bahqtrf: "fk6fouc",
|
|
94
|
+
Be2twd7: "fkhj508",
|
|
95
|
+
Bhrd7zp: "fl43uef",
|
|
96
|
+
Bg96gwp: "f1i3iumi"
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
d: [
|
|
100
|
+
[
|
|
101
|
+
".f1kijzfu{border-radius:var(--borderRadiusXLarge);}",
|
|
102
|
+
{
|
|
103
|
+
p: -1
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
".fghlq4f{border-top-color:var(--colorTransparentStroke);}",
|
|
107
|
+
".f1gn591s{border-right-color:var(--colorTransparentStroke);}",
|
|
108
|
+
".fjscplz{border-left-color:var(--colorTransparentStroke);}",
|
|
109
|
+
".fb073pr{border-bottom-color:var(--colorTransparentStroke);}",
|
|
110
|
+
".fkfq4zb{color:var(--colorNeutralForeground2);}",
|
|
111
|
+
".f16xq7d1{background-color:var(--colorNeutralBackground3);}",
|
|
112
|
+
".f1w5jphr{min-height:40px;}",
|
|
113
|
+
[
|
|
114
|
+
".f1nm7172{padding:var(--spacingVerticalNone) var(--spacingHorizontalS);}",
|
|
115
|
+
{
|
|
116
|
+
p: -1
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
".f1nxs5xn{min-height:32px;}",
|
|
120
|
+
[
|
|
121
|
+
".f1nm7172{padding:var(--spacingVerticalNone) var(--spacingHorizontalS);}",
|
|
122
|
+
{
|
|
123
|
+
p: -1
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
[
|
|
127
|
+
".fuva4e2{padding:var(--spacingVerticalNone) var(--spacingHorizontalL);}",
|
|
128
|
+
{
|
|
129
|
+
p: -1
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
".fk6fouc{font-family:var(--fontFamilyBase);}",
|
|
133
|
+
".fod5ikn{font-size:var(--fontSizeBase400);}",
|
|
134
|
+
".fl43uef{font-weight:var(--fontWeightSemibold);}",
|
|
135
|
+
".f1anucx2{line-height:var(--lineHeightBase450);}",
|
|
136
|
+
[
|
|
137
|
+
".ffysxzw{padding:var(--spacingVerticalNone) var(--spacingHorizontalM);}",
|
|
138
|
+
{
|
|
139
|
+
p: -1
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
".fkhj508{font-size:var(--fontSizeBase300);}",
|
|
143
|
+
".f1i3iumi{line-height:var(--lineHeightBase300);}"
|
|
144
|
+
],
|
|
145
|
+
h: [
|
|
146
|
+
".f8491dx:hover{cursor:pointer;}",
|
|
147
|
+
".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}",
|
|
148
|
+
".f1h648pw:hover{background-color:var(--colorNeutralBackground3Hover);}"
|
|
149
|
+
],
|
|
150
|
+
a: [
|
|
151
|
+
".flvvhsy:active{color:var(--colorNeutralForeground2Pressed);}",
|
|
152
|
+
".fwdzr64:active{background-color:var(--colorNeutralBackground3Pressed);}"
|
|
153
|
+
]
|
|
154
|
+
});
|
|
155
|
+
const useAttachmentOverflowMenuButtonStyles_unstable = (state)=>{
|
|
156
|
+
'use no memo';
|
|
157
|
+
const { designVersion, mode, fullyOverflowed } = state;
|
|
158
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
159
|
+
const progressBarStyles = (0, _useProgressBarStylesstyles.useProgressBarStyles)();
|
|
160
|
+
const nextStyles = useNextStyles();
|
|
161
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(attachmentOverflowMenuButtonClassNames.root, rootBaseClassName, designVersion === 'next' && nextStyles.root, designVersion === 'next' && nextStyles[mode], designVersion === 'next' && fullyOverflowed && nextStyles[`fullyOverflowed_${mode}`], state.root.className);
|
|
162
|
+
if (state.progress) {
|
|
163
|
+
state.progress.className = (0, _reactcomponents.mergeClasses)(attachmentOverflowMenuButtonClassNames.progress, progressBarStyles.progress, state.progress.className);
|
|
164
|
+
const bar = _reactcomponents.slot.optional(state.progress.bar, {
|
|
165
|
+
elementType: 'div',
|
|
166
|
+
renderByDefault: true
|
|
167
|
+
});
|
|
168
|
+
if (bar) {
|
|
169
|
+
if (state.progress.value === undefined) {
|
|
170
|
+
bar.className = (0, _reactcomponents.mergeClasses)(progressBarStyles.indeterminateProgressBar, bar.className);
|
|
171
|
+
} else {
|
|
172
|
+
bar.className = (0, _reactcomponents.mergeClasses)(progressBarStyles.regularProgressBar, bar.className);
|
|
173
|
+
}
|
|
174
|
+
state.progress.bar = bar;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return state;
|
|
178
|
+
}; //# sourceMappingURL=useAttachmentOverflowMenuButtonStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuButtonStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, shorthands, slot } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\nimport type {\n AttachmentOverflowMenuButtonSlots,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentOverflowMenuButtonClassNames: SlotClassNames<AttachmentOverflowMenuButtonSlots> = {\n root: 'fai-AttachmentOverflowMenuButton',\n progress: 'fai-AttachmentOverflowMenuButton__progress',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\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 cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n fontFamily: typographyStyles.body1.fontFamily,\n fontSize: typographyStyles.body1.fontSize,\n fontWeight: typographyStyles.body1.fontWeight,\n justifyContent: 'center',\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`,\n verticalAlign: 'middle',\n position: 'relative',\n\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\nconst useNextStyles = makeStyles({\n root: {\n borderRadius: tokens.borderRadiusXLarge,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n color: tokens.colorNeutralForeground2,\n backgroundColor: tokens.colorNeutralBackground3,\n ':hover': {\n cursor: 'pointer',\n color: tokens.colorNeutralForeground2Hover,\n backgroundColor: tokens.colorNeutralBackground3Hover,\n },\n ':active': {\n color: tokens.colorNeutralForeground2Pressed,\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n },\n },\n canvas: {\n minHeight: '40px',\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`,\n },\n sidecar: {\n minHeight: '32px',\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`,\n },\n fullyOverflowed_canvas: {\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalL}`,\n ...typographyStyles.subtitle2,\n },\n fullyOverflowed_sidecar: {\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalM}`,\n ...typographyStyles.body1Strong,\n },\n});\n\n/**\n * Apply styling to the AttachmentOverflowMenuButton slots based on the state\n */\nexport const useAttachmentOverflowMenuButtonStyles_unstable = (\n state: AttachmentOverflowMenuButtonState,\n): AttachmentOverflowMenuButtonState => {\n 'use no memo';\n\n const { designVersion, mode, fullyOverflowed } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const progressBarStyles = useProgressBarStyles();\n const nextStyles = useNextStyles();\n\n state.root.className = mergeClasses(\n attachmentOverflowMenuButtonClassNames.root,\n rootBaseClassName,\n designVersion === 'next' && nextStyles.root,\n designVersion === 'next' && nextStyles[mode],\n designVersion === 'next' && fullyOverflowed && nextStyles[`fullyOverflowed_${mode}`],\n state.root.className,\n );\n\n if (state.progress) {\n state.progress.className = mergeClasses(\n attachmentOverflowMenuButtonClassNames.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":["attachmentOverflowMenuButtonClassNames","state","root","progress","useRootBaseClassName","makeResetStyles","color","alignItems","border","strokeWidthThin","borderRadius","boxSizing","columnGap","cursor","display","flexWrap","fontFamily","fontSize","typographyStyles","body1","fontWeight","justifyContent","padding","verticalAlign","position","Bi91k9c","backgroundColor","uwmqm3","z189sj","z8tnut","useNextStyles","borderColor","Byoj8tv","canvas","minHeight","B0ocmuz","sidecar","Bg96gwp","p","fullyOverflowed_sidecar","body1Strong","fullyOverflowed","className","progressBarStyles","bar","mergeClasses","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IASaA,sCAAAA;eAAAA;;IAqGTC,8CACED;eADFC;;;iCA9GgE;4CAE/B;AAO9B,MAAMD,yCAA4F;UACvGE;cACAC;AACF;AAEA,MAAMC,uBAAuBC,IAAAA,8BAAAA,EAAAA,YAAgB,MAAA;OAC3CC;QAAAA;QAAqC;QAAA;KAAA;OACrCC;QAAAA;KAAY;;MAEZC,gBAAkBC,IAAAA,yBAAAA,EAAAA;UAClBC;QACAC,SAAAA;QACAC,SAAAA;QACAC,SAAQ;QACRC,SAAS;QACTC,QAAAA;QACAC,QAAAA;QACAC,QAAAA;YAAAA;YAAUC;SAAiBC;QAC3BC,SAAAA;QACAC,QAAAA;YAAAA;YAAgB;SAAA;QAChBC,QAAAA;QACAC,QAAAA;QACAC,QAAAA;QAEAC,SAAA;gBACEZ;gBACAa;gBACApB;;YAEF;gBACEoB;iBACApB;QACFqB,QAAA;QACAC,QAAA;gBACE;iBACEF;;aAEF;gBACEA;iBACF;QACFC,QAAA;QACFC,QAAA;QAEAC,QAAMC;QACJ5B,SAAM;;4BAEU6B;iBACdzB;gBACAoB;gBACA;gBACEb;iBACAP;iBACAoB;iBACF;iBACA;iBACEpB;;6BAEF;QACF0B,SAAA;QACAC,QAAQ;gBACNC;gBACAZ;QACFa,SAAA;QACAC,SAAS;iBACPF;iBACAZ;QACFe,SAAA;;;;;;YAG+B;gBAC/BC,GAAA,CAAA;;SACAC;QAAAA;QAAyB;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;YAAA;YAAA;oBACvBjB;;;;QACoBkB;YAAAA;YAAW;gBACjCF,GAAA,CAAA;YACF;SAAA;QAAA;YAAA;YAAA;gBAEAA,GAAA,CAAA;;;;;;;;;;gBAGAA,GAAA,CAAA;;SAGE;QAAA;QAAA;KAAA;OAEA;QAAA;QAA6BG;QAAoBxC;KAAAA;OAEjD;QAAA;QAA0BG;KAAAA;;MAcxBH,iDACED,CAAAA;;yBAKwF,MAC1F,iBACMC;8BAEGG;8BACDsC,IAAAA,gDAAyBC;uBAC/Bb;cACA7B,CAAAA,SAAME,GAAAA,IAAAA,6BAAeyC,EAAAA,uCAAAA,IAAAA,EAAAA,mBAAAA,kBAAAA,UAAAA,WAAAA,IAAAA,EAAAA,kBAAAA,UAAAA,UAAAA,CAAAA,KAAAA,EAAAA,kBAAAA,UAAAA,mBAAAA,UAAAA,CAAAA,CAAAA,gBAAAA,EAAAA,KAAAA,CAAAA,CAAAA,EAAAA,MAAAA,IAAAA,CAAAA,SAAAA;cACvBzC,QAAA,EAAA;QACFF,MAAAE,QAAA,CAAAuC,SAAA,GAAAG,IAAAA,6BAAA,EAAA7C,uCAAAG,QAAA,EAAAwC,kBAAAxC,QAAA,EAAAF,MAAAE,QAAA,CAAAuC,SAAA;QAEA,MAAAE,MAAO3C,qBAAAA,CAAAA,QAAAA,CAAAA,MAAAA,QAAAA,CAAAA,GAAAA,EAAAA;YACP6C,aAAA"}
|
|
@@ -0,0 +1,118 @@
|
|
|
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
|
+
attachmentOverflowMenuButtonClassNames: function() {
|
|
13
|
+
return attachmentOverflowMenuButtonClassNames;
|
|
14
|
+
},
|
|
15
|
+
useAttachmentOverflowMenuButtonStyles_unstable: function() {
|
|
16
|
+
return useAttachmentOverflowMenuButtonStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _tokens = require("@fluentui-copilot/tokens");
|
|
21
|
+
const _useProgressBarStylesstyles = require("../utils/useProgressBarStyles.styles");
|
|
22
|
+
const attachmentOverflowMenuButtonClassNames = {
|
|
23
|
+
root: 'fai-AttachmentOverflowMenuButton',
|
|
24
|
+
progress: 'fai-AttachmentOverflowMenuButton__progress'
|
|
25
|
+
};
|
|
26
|
+
const useRootBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
27
|
+
color: _tokens.tokens.colorNeutralForeground1,
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
backgroundColor: _tokens.tokens.colorSubtleBackground,
|
|
30
|
+
border: `${_tokens.tokens.strokeWidthThin} solid ${_tokens.tokens.colorNeutralStroke1}`,
|
|
31
|
+
borderRadius: _tokens.tokens.borderRadiusMedium,
|
|
32
|
+
boxSizing: 'border-box',
|
|
33
|
+
columnGap: _tokens.tokens.spacingHorizontalSNudge,
|
|
34
|
+
cursor: 'pointer',
|
|
35
|
+
display: 'inline-flex',
|
|
36
|
+
flexWrap: 'nowrap',
|
|
37
|
+
fontFamily: _tokens.typographyStyles.body1.fontFamily,
|
|
38
|
+
fontSize: _tokens.typographyStyles.body1.fontSize,
|
|
39
|
+
fontWeight: _tokens.typographyStyles.body1.fontWeight,
|
|
40
|
+
justifyContent: 'center',
|
|
41
|
+
padding: `${_tokens.tokens.spacingVerticalXS} ${_tokens.tokens.spacingHorizontalS}`,
|
|
42
|
+
verticalAlign: 'middle',
|
|
43
|
+
position: 'relative',
|
|
44
|
+
':hover': {
|
|
45
|
+
cursor: 'pointer',
|
|
46
|
+
backgroundColor: _tokens.tokens.colorSubtleBackgroundHover,
|
|
47
|
+
color: _tokens.tokens.colorNeutralForeground2Hover
|
|
48
|
+
},
|
|
49
|
+
':active': {
|
|
50
|
+
backgroundColor: _tokens.tokens.colorSubtleBackgroundPressed,
|
|
51
|
+
color: _tokens.tokens.colorNeutralForeground2Pressed
|
|
52
|
+
},
|
|
53
|
+
'@media (forced-colors: active)': {
|
|
54
|
+
':hover': {
|
|
55
|
+
backgroundColor: 'HighlightText'
|
|
56
|
+
},
|
|
57
|
+
':active': {
|
|
58
|
+
backgroundColor: 'HighlightText'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const useNextStyles = (0, _reactcomponents.makeStyles)({
|
|
63
|
+
root: {
|
|
64
|
+
borderRadius: _tokens.tokens.borderRadiusXLarge,
|
|
65
|
+
..._reactcomponents.shorthands.borderColor(_tokens.tokens.colorTransparentStroke),
|
|
66
|
+
color: _tokens.tokens.colorNeutralForeground2,
|
|
67
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3,
|
|
68
|
+
':hover': {
|
|
69
|
+
cursor: 'pointer',
|
|
70
|
+
color: _tokens.tokens.colorNeutralForeground2Hover,
|
|
71
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3Hover
|
|
72
|
+
},
|
|
73
|
+
':active': {
|
|
74
|
+
color: _tokens.tokens.colorNeutralForeground2Pressed,
|
|
75
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3Pressed
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
canvas: {
|
|
79
|
+
minHeight: '40px',
|
|
80
|
+
padding: `${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalS}`
|
|
81
|
+
},
|
|
82
|
+
sidecar: {
|
|
83
|
+
minHeight: '32px',
|
|
84
|
+
padding: `${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalS}`
|
|
85
|
+
},
|
|
86
|
+
fullyOverflowed_canvas: {
|
|
87
|
+
padding: `${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalL}`,
|
|
88
|
+
..._tokens.typographyStyles.subtitle2
|
|
89
|
+
},
|
|
90
|
+
fullyOverflowed_sidecar: {
|
|
91
|
+
padding: `${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalM}`,
|
|
92
|
+
..._tokens.typographyStyles.body1Strong
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
const useAttachmentOverflowMenuButtonStyles_unstable = (state)=>{
|
|
96
|
+
'use no memo';
|
|
97
|
+
const { designVersion, mode, fullyOverflowed } = state;
|
|
98
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
99
|
+
const progressBarStyles = (0, _useProgressBarStylesstyles.useProgressBarStyles)();
|
|
100
|
+
const nextStyles = useNextStyles();
|
|
101
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(attachmentOverflowMenuButtonClassNames.root, rootBaseClassName, designVersion === 'next' && nextStyles.root, designVersion === 'next' && nextStyles[mode], designVersion === 'next' && fullyOverflowed && nextStyles[`fullyOverflowed_${mode}`], state.root.className);
|
|
102
|
+
if (state.progress) {
|
|
103
|
+
state.progress.className = (0, _reactcomponents.mergeClasses)(attachmentOverflowMenuButtonClassNames.progress, progressBarStyles.progress, state.progress.className);
|
|
104
|
+
const bar = _reactcomponents.slot.optional(state.progress.bar, {
|
|
105
|
+
elementType: 'div',
|
|
106
|
+
renderByDefault: true
|
|
107
|
+
});
|
|
108
|
+
if (bar) {
|
|
109
|
+
if (state.progress.value === undefined) {
|
|
110
|
+
bar.className = (0, _reactcomponents.mergeClasses)(progressBarStyles.indeterminateProgressBar, bar.className);
|
|
111
|
+
} else {
|
|
112
|
+
bar.className = (0, _reactcomponents.mergeClasses)(progressBarStyles.regularProgressBar, bar.className);
|
|
113
|
+
}
|
|
114
|
+
state.progress.bar = bar;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return state;
|
|
118
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuButtonStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, shorthands, slot } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\nimport type {\n AttachmentOverflowMenuButtonSlots,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentOverflowMenuButtonClassNames: SlotClassNames<AttachmentOverflowMenuButtonSlots> = {\n root: 'fai-AttachmentOverflowMenuButton',\n progress: 'fai-AttachmentOverflowMenuButton__progress',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\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 cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n fontFamily: typographyStyles.body1.fontFamily,\n fontSize: typographyStyles.body1.fontSize,\n fontWeight: typographyStyles.body1.fontWeight,\n justifyContent: 'center',\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`,\n verticalAlign: 'middle',\n position: 'relative',\n\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\nconst useNextStyles = makeStyles({\n root: {\n borderRadius: tokens.borderRadiusXLarge,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n color: tokens.colorNeutralForeground2,\n backgroundColor: tokens.colorNeutralBackground3,\n ':hover': {\n cursor: 'pointer',\n color: tokens.colorNeutralForeground2Hover,\n backgroundColor: tokens.colorNeutralBackground3Hover,\n },\n ':active': {\n color: tokens.colorNeutralForeground2Pressed,\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n },\n },\n canvas: {\n minHeight: '40px',\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`,\n },\n sidecar: {\n minHeight: '32px',\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`,\n },\n fullyOverflowed_canvas: {\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalL}`,\n ...typographyStyles.subtitle2,\n },\n fullyOverflowed_sidecar: {\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalM}`,\n ...typographyStyles.body1Strong,\n },\n});\n\n/**\n * Apply styling to the AttachmentOverflowMenuButton slots based on the state\n */\nexport const useAttachmentOverflowMenuButtonStyles_unstable = (\n state: AttachmentOverflowMenuButtonState,\n): AttachmentOverflowMenuButtonState => {\n 'use no memo';\n\n const { designVersion, mode, fullyOverflowed } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const progressBarStyles = useProgressBarStyles();\n const nextStyles = useNextStyles();\n\n state.root.className = mergeClasses(\n attachmentOverflowMenuButtonClassNames.root,\n rootBaseClassName,\n designVersion === 'next' && nextStyles.root,\n designVersion === 'next' && nextStyles[mode],\n designVersion === 'next' && fullyOverflowed && nextStyles[`fullyOverflowed_${mode}`],\n state.root.className,\n );\n\n if (state.progress) {\n state.progress.className = mergeClasses(\n attachmentOverflowMenuButtonClassNames.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":["attachmentOverflowMenuButtonClassNames","useAttachmentOverflowMenuButtonStyles_unstable","root","progress","useRootBaseClassName","makeResetStyles","color","tokens","colorNeutralForeground1","alignItems","backgroundColor","colorSubtleBackground","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","boxSizing","columnGap","spacingHorizontalSNudge","cursor","display","flexWrap","fontFamily","typographyStyles","body1","fontSize","fontWeight","justifyContent","padding","spacingVerticalXS","spacingHorizontalS","verticalAlign","position","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","useNextStyles","makeStyles","borderRadiusXLarge","shorthands","borderColor","colorTransparentStroke","colorNeutralForeground2","colorNeutralBackground3","colorNeutralBackground3Hover","colorNeutralBackground3Pressed","canvas","minHeight","spacingVerticalNone","sidecar","fullyOverflowed_canvas","spacingHorizontalL","subtitle2","fullyOverflowed_sidecar","spacingHorizontalM","body1Strong","state","designVersion","mode","fullyOverflowed","rootBaseClassName","progressBarStyles","useProgressBarStyles","nextStyles","className","mergeClasses","bar","slot","optional","elementType","renderByDefault","value","undefined","indeterminateProgressBar","regularProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "AttachmentOverflowMenuItem", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return AttachmentOverflowMenuItem;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useAttachmentOverflowMenuItem = require("./useAttachmentOverflowMenuItem");
|
|
14
|
+
const _renderAttachmentOverflowMenuItem = require("./renderAttachmentOverflowMenuItem");
|
|
15
|
+
const _useAttachmentOverflowMenuItemStylesstyles = require("./useAttachmentOverflowMenuItemStyles.styles");
|
|
16
|
+
const AttachmentOverflowMenuItem = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
17
|
+
const state = (0, _useAttachmentOverflowMenuItem.useAttachmentOverflowMenuItem_unstable)(props, ref);
|
|
18
|
+
(0, _useAttachmentOverflowMenuItemStylesstyles.useAttachmentOverflowMenuItemStyles_unstable)(state);
|
|
19
|
+
return (0, _renderAttachmentOverflowMenuItem.renderAttachmentOverflowMenuItem_unstable)(state);
|
|
20
|
+
});
|
|
21
|
+
AttachmentOverflowMenuItem.displayName = 'AttachmentOverflowMenuItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenuItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentOverflowMenuItem_unstable } from './useAttachmentOverflowMenuItem';\nimport { renderAttachmentOverflowMenuItem_unstable } from './renderAttachmentOverflowMenuItem';\nimport type { AttachmentOverflowMenuItemProps } from './AttachmentOverflowMenuItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useAttachmentOverflowMenuItemStyles_unstable } from './useAttachmentOverflowMenuItemStyles.styles';\nexport const AttachmentOverflowMenuItem: ForwardRefComponent<AttachmentOverflowMenuItemProps> = React.forwardRef(\n (props, ref) => {\n const state = useAttachmentOverflowMenuItem_unstable(props, ref);\n useAttachmentOverflowMenuItemStyles_unstable(state);\n\n return renderAttachmentOverflowMenuItem_unstable(state);\n },\n);\n\nAttachmentOverflowMenuItem.displayName = 'AttachmentOverflowMenuItem';\n"],"names":["AttachmentOverflowMenuItem","React","forwardRef","props","ref","state","useAttachmentOverflowMenuItem_unstable","useAttachmentOverflowMenuItemStyles_unstable","renderAttachmentOverflowMenuItem_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAMaA;;;eAAAA;;;;iEANU;+CACgC;kDACG;2DAGG;AACtD,MAAMA,6BAAAA,WAAAA,GAAmFC,OAAMC,UAAU,CAC9G,CAACC,OAAOC;IACN,MAAMC,QAAQC,IAAAA,qEAAAA,EAAuCH,OAAOC;IAC5DG,IAAAA,uFAAAA,EAA6CF;IAE7C,OAAOG,IAAAA,2EAAAA,EAA0CH;AACnD;AAGFL,2BAA2BS,WAAW,GAAG"}
|
package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenuItem.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, MenuItem, ProgressBar, Slot } from '@fluentui/react-components';\nimport type { AttachmentProps } from '../Attachment';\nimport type { DesignVersion } from '@fluentui-copilot/react-provider';\n\nexport type AttachmentOverflowMenuItemSlots = {\n root: NonNullable<Slot<typeof MenuItem>>;\n progress?: Slot<typeof ProgressBar>;\n};\n\n/**\n * AttachmentOverflowMenuItem Props\n */\nexport type AttachmentOverflowMenuItemProps = ComponentProps<Partial<AttachmentOverflowMenuItemSlots>> &\n DesignVersion &\n Pick<AttachmentProps, 'id' | 'media' | 'imageOnly'>;\n\n/**\n * State used in rendering AttachmentOverflowMenuItem\n */\nexport type AttachmentOverflowMenuItemState = ComponentState<AttachmentOverflowMenuItemSlots> &\n Pick<AttachmentOverflowMenuItemProps, 'imageOnly' | 'designVersion'> & {\n isVisible: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAgBA;;CAEC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
AttachmentOverflowMenuItem: function() {
|
|
13
|
+
return _AttachmentOverflowMenuItem.AttachmentOverflowMenuItem;
|
|
14
|
+
},
|
|
15
|
+
attachmentOverflowMenuItemClassNames: function() {
|
|
16
|
+
return _useAttachmentOverflowMenuItemStylesstyles.attachmentOverflowMenuItemClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderAttachmentOverflowMenuItem_unstable: function() {
|
|
19
|
+
return _renderAttachmentOverflowMenuItem.renderAttachmentOverflowMenuItem_unstable;
|
|
20
|
+
},
|
|
21
|
+
useAttachmentOverflowMenuItemStyles_unstable: function() {
|
|
22
|
+
return _useAttachmentOverflowMenuItemStylesstyles.useAttachmentOverflowMenuItemStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
useAttachmentOverflowMenuItem_unstable: function() {
|
|
25
|
+
return _useAttachmentOverflowMenuItem.useAttachmentOverflowMenuItem_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _AttachmentOverflowMenuItem = require("./AttachmentOverflowMenuItem");
|
|
29
|
+
const _renderAttachmentOverflowMenuItem = require("./renderAttachmentOverflowMenuItem");
|
|
30
|
+
const _useAttachmentOverflowMenuItem = require("./useAttachmentOverflowMenuItem");
|
|
31
|
+
const _useAttachmentOverflowMenuItemStylesstyles = require("./useAttachmentOverflowMenuItemStyles.styles");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { AttachmentOverflowMenuItem } from './AttachmentOverflowMenuItem';\nexport type { AttachmentOverflowMenuItemProps, AttachmentOverflowMenuItemSlots, AttachmentOverflowMenuItemState } from './AttachmentOverflowMenuItem.types';\nexport { renderAttachmentOverflowMenuItem_unstable } from './renderAttachmentOverflowMenuItem';\nexport { useAttachmentOverflowMenuItem_unstable } from './useAttachmentOverflowMenuItem';\nexport { attachmentOverflowMenuItemClassNames, useAttachmentOverflowMenuItemStyles_unstable } from './useAttachmentOverflowMenuItemStyles.styles';\n"],"names":["AttachmentOverflowMenuItem","attachmentOverflowMenuItemClassNames","renderAttachmentOverflowMenuItem_unstable","useAttachmentOverflowMenuItemStyles_unstable","useAttachmentOverflowMenuItem_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,0BAA0B;eAA1BA,sDAA0B;;IAI1BC,oCAAoC;eAApCA,+EAAoC;;IAFpCC,yCAAyC;eAAzCA,2EAAyC;;IAEHC,4CAA4C;eAA5CA,uFAA4C;;IADlFC,sCAAsC;eAAtCA,qEAAsC;;;4CAHJ;kDAEe;+CACH;2DAC4C"}
|
package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderAttachmentOverflowMenuItem_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderAttachmentOverflowMenuItem_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
13
|
+
const renderAttachmentOverflowMenuItem_unstable = (state)=>{
|
|
14
|
+
(0, _reactcomponents.assertSlots)(state);
|
|
15
|
+
return !state.isVisible ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
16
|
+
children: [
|
|
17
|
+
state.root.children,
|
|
18
|
+
state.progress && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.progress, {})
|
|
19
|
+
]
|
|
20
|
+
}) : null;
|
|
21
|
+
};
|
package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderAttachmentOverflowMenuItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { JSXElement } from '@fluentui/react-components';\nimport type {\n AttachmentOverflowMenuItemState,\n AttachmentOverflowMenuItemSlots,\n} from './AttachmentOverflowMenuItem.types';\n\n/**\n * Render the final JSX of AttachmentOverflowMenuItem\n */\nexport const renderAttachmentOverflowMenuItem_unstable = (\n state: AttachmentOverflowMenuItemState,\n): JSXElement | null => {\n assertSlots<AttachmentOverflowMenuItemSlots>(state);\n\n return !state.isVisible ? (\n <state.root>\n {state.root.children}\n {state.progress && <state.progress />}\n </state.root>\n ) : null;\n};\n"],"names":["renderAttachmentOverflowMenuItem_unstable","state","assertSlots","isVisible","_jsxs","root","children","progress","_jsx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;4BAZb;iCAE4B;AAUrB,MAAMA,4CAA4C,CACvDC;IAEAC,IAAAA,4BAAAA,EAA6CD;IAE7C,OAAO,CAACA,MAAME,SAAS,GAAA,WAAA,GACrBC,IAAAA,gBAAA,EAACH,MAAMI,IAAI,EAAA;;YACRJ,MAAMI,IAAI,CAACC,QAAQ;YACnBL,MAAMM,QAAQ,IAAA,WAAA,GAAIC,IAAAA,eAAA,EAACP,MAAMM,QAAQ,EAAA,CAAA;;SAElC;AACN"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useAttachmentOverflowMenuItem_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useAttachmentOverflowMenuItem_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
+
const _reacticons = require("@fluentui/react-icons");
|
|
15
|
+
const _attachmentListContext = require("../../contexts/attachmentListContext");
|
|
16
|
+
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
17
|
+
const useAttachmentOverflowMenuItem_unstable = (props, ref)=>{
|
|
18
|
+
'use no memo';
|
|
19
|
+
const { imageOnly, media } = props;
|
|
20
|
+
const menuItemId = (0, _reactcomponents.useId)('attachment-', props.id);
|
|
21
|
+
const isVisible = (0, _reactcomponents.useIsOverflowItemVisible)(menuItemId);
|
|
22
|
+
const { onAttachmentDismiss } = (0, _attachmentListContext.useAttachmentListContext_unstable)((context)=>context);
|
|
23
|
+
const designVersion = (0, _reactprovider.useDesignVersion)(props.designVersion);
|
|
24
|
+
const root = _reactcomponents.slot.always({
|
|
25
|
+
ref,
|
|
26
|
+
icon: media,
|
|
27
|
+
secondaryContent: /*#__PURE__*/ _react.createElement(_reacticons.Dismiss20Regular, null),
|
|
28
|
+
...props,
|
|
29
|
+
id: menuItemId
|
|
30
|
+
}, {
|
|
31
|
+
elementType: _reactcomponents.MenuItem
|
|
32
|
+
});
|
|
33
|
+
root.onClick = (0, _reactcomponents.mergeCallbacks)(root.onClick, (ev)=>{
|
|
34
|
+
onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
|
|
35
|
+
content: props.children,
|
|
36
|
+
media,
|
|
37
|
+
id: menuItemId
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
const progress = _reactcomponents.slot.optional(props.progress, {
|
|
41
|
+
defaultProps: {
|
|
42
|
+
shape: 'square',
|
|
43
|
+
thickness: 'large',
|
|
44
|
+
'aria-labelledby': props.id
|
|
45
|
+
},
|
|
46
|
+
elementType: _reactcomponents.ProgressBar
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
components: {
|
|
50
|
+
root: _reactcomponents.MenuItem,
|
|
51
|
+
progress: _reactcomponents.ProgressBar
|
|
52
|
+
},
|
|
53
|
+
root,
|
|
54
|
+
progress,
|
|
55
|
+
isVisible,
|
|
56
|
+
imageOnly,
|
|
57
|
+
designVersion
|
|
58
|
+
};
|
|
59
|
+
};
|
package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n MenuItem,\n ProgressBar,\n mergeCallbacks,\n slot,\n useId,\n useIsOverflowItemVisible,\n} from '@fluentui/react-components';\nimport { Dismiss20Regular } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type {\n AttachmentOverflowMenuItemProps,\n AttachmentOverflowMenuItemState,\n} from './AttachmentOverflowMenuItem.types';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\n\n/**\n * Create the state required to render AttachmentOverflowMenuItem.\n *\n * The returned state can be modified with hooks such as useAttachmentOverflowMenuItemStyles_unstable,\n * before being passed to renderAttachmentOverflowMenuItem_unstable.\n *\n * @param props - props from this instance of AttachmentOverflowMenuItem\n * @param ref - reference to root HTMLElement of AttachmentOverflowMenuItem\n */\nexport const useAttachmentOverflowMenuItem_unstable = (\n props: AttachmentOverflowMenuItemProps,\n ref: React.Ref<HTMLDivElement>,\n): AttachmentOverflowMenuItemState => {\n 'use no memo';\n\n const { imageOnly, media } = props;\n const menuItemId = useId('attachment-', props.id);\n const isVisible = useIsOverflowItemVisible(menuItemId);\n const { onAttachmentDismiss } = useAttachmentListContext_unstable(context => context);\n const designVersion = useDesignVersion(props.designVersion);\n\n const root = slot.always(\n { ref, icon: media, secondaryContent: <Dismiss20Regular />, ...props, id: menuItemId },\n { elementType: MenuItem },\n );\n root.onClick = mergeCallbacks(root.onClick, ev => {\n onAttachmentDismiss?.(ev, { content: props.children, media, id: menuItemId });\n });\n\n const progress = slot.optional(props.progress, {\n defaultProps: {\n shape: 'square',\n thickness: 'large',\n 'aria-labelledby': props.id,\n },\n elementType: ProgressBar,\n });\n\n return {\n components: {\n root: MenuItem,\n progress: ProgressBar,\n },\n root,\n progress,\n isVisible,\n imageOnly,\n designVersion,\n };\n};\n"],"names":["useAttachmentOverflowMenuItem_unstable","props","ref","imageOnly","media","menuItemId","useId","id","isVisible","useIsOverflowItemVisible","onAttachmentDismiss","useAttachmentListContext_unstable","context","designVersion","useDesignVersion","root","slot","always","icon","secondaryContent","React","createElement","Dismiss20Regular","elementType","MenuItem","onClick","mergeCallbacks","ev","content","children","progress","optional","defaultProps","shape","thickness","ProgressBar","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA0BaA;;;eAAAA;;;;iEA1BU;iCAQhB;4BAC0B;uCACiB;+BAKjB;AAW1B,MAAMA,yCAAyC,CACpDC,OACAC;IAEA;IAEA,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IAC7B,MAAMI,aAAaC,IAAAA,sBAAAA,EAAM,eAAeL,MAAMM,EAAE;IAChD,MAAMC,YAAYC,IAAAA,yCAAAA,EAAyBJ;IAC3C,MAAM,EAAEK,mBAAmB,EAAE,GAAGC,IAAAA,wDAAAA,EAAkCC,CAAAA,UAAWA;IAC7E,MAAMC,gBAAgBC,IAAAA,+BAAAA,EAAiBb,MAAMY,aAAa;IAE1D,MAAME,OAAOC,qBAAAA,CAAKC,MAAM,CACtB;QAAEf;QAAKgB,MAAMd;QAAOe,kBAAAA,WAAAA,GAAkBC,OAAAC,aAAA,CAACC,4BAAAA,EAAAA;QAAqB,GAAGrB,KAAK;QAAEM,IAAIF;IAAW,GACrF;QAAEkB,aAAaC,yBAAAA;IAAS;IAE1BT,KAAKU,OAAO,GAAGC,IAAAA,+BAAAA,EAAeX,KAAKU,OAAO,EAAEE,CAAAA;QAC1CjB,wBAAAA,QAAAA,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAsBiB,IAAI;YAAEC,SAAS3B,MAAM4B,QAAQ;YAAEzB;YAAOG,IAAIF;QAAW;IAC7E;IAEA,MAAMyB,WAAWd,qBAAAA,CAAKe,QAAQ,CAAC9B,MAAM6B,QAAQ,EAAE;QAC7CE,cAAc;YACZC,OAAO;YACPC,WAAW;YACX,mBAAmBjC,MAAMM,EAAE;QAC7B;QACAgB,aAAaY,4BAAAA;IACf;IAEA,OAAO;QACLC,YAAY;YACVrB,MAAMS,yBAAAA;YACNM,UAAUK,4BAAAA;QACZ;QACApB;QACAe;QACAtB;QACAL;QACAU;IACF;AACF"}
|