@fluentui-copilot/react-attachments 0.12.3 → 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.
Files changed (216) hide show
  1. package/CHANGELOG.json +67 -1
  2. package/CHANGELOG.md +30 -2
  3. package/dist/index.d.ts +11 -5
  4. package/lib/AgentTag.js +0 -1
  5. package/lib/Attachment.js +0 -1
  6. package/lib/AttachmentList.js +0 -1
  7. package/lib/AttachmentOverflowMenu.js +0 -1
  8. package/lib/AttachmentOverflowMenuButton.js +0 -1
  9. package/lib/AttachmentOverflowMenuItem.js +0 -1
  10. package/lib/AttachmentTag.js +0 -1
  11. package/lib/AttachmentTagItem.js +0 -1
  12. package/lib/AttachmentTagList.js +0 -1
  13. package/lib/components/AgentTag/AgentTag.js +4 -5
  14. package/lib/components/AgentTag/AgentTag.types.js +1 -2
  15. package/lib/components/AgentTag/index.js +0 -1
  16. package/lib/components/AgentTag/renderAgentTag.js +3 -5
  17. package/lib/components/AgentTag/useAgentTag.js +7 -9
  18. package/lib/components/AgentTag/useAgentTagStyles.styles.raw.js +66 -0
  19. package/lib/components/AgentTag/useAgentTagStyles.styles.raw.js.map +1 -0
  20. package/lib/components/Attachment/Attachment.js +5 -6
  21. package/lib/components/Attachment/Attachment.types.js +1 -2
  22. package/lib/components/Attachment/index.js +0 -1
  23. package/lib/components/Attachment/renderAttachment.js +36 -31
  24. package/lib/components/Attachment/useAttachment.js +85 -95
  25. package/lib/components/Attachment/useAttachmentStyles.styles.js +34 -12
  26. package/lib/components/Attachment/useAttachmentStyles.styles.js.map +1 -1
  27. package/lib/components/Attachment/useAttachmentStyles.styles.raw.js +317 -0
  28. package/lib/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -0
  29. package/lib/components/AttachmentList/AttachmentList.js +6 -7
  30. package/lib/components/AttachmentList/AttachmentList.types.js +1 -2
  31. package/lib/components/AttachmentList/AttachmentList.types.js.map +1 -1
  32. package/lib/components/AttachmentList/index.js +0 -1
  33. package/lib/components/AttachmentList/renderAttachmentList.js +25 -25
  34. package/lib/components/AttachmentList/useAttachmentList.js +113 -123
  35. package/lib/components/AttachmentList/useAttachmentList.js.map +1 -1
  36. package/lib/components/AttachmentList/useAttachmentListContextValues.js +10 -13
  37. package/lib/components/AttachmentList/useAttachmentListContextValues.js.map +1 -1
  38. package/lib/components/AttachmentList/useAttachmentListStyles.styles.raw.js +44 -0
  39. package/lib/components/AttachmentList/useAttachmentListStyles.styles.raw.js.map +1 -0
  40. package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +8 -9
  41. package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +1 -2
  42. package/lib/components/AttachmentOverflowMenu/index.js +0 -1
  43. package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +8 -13
  44. package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +9 -15
  45. package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +10 -15
  46. package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +5 -6
  47. package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +1 -2
  48. package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -1
  49. package/lib/components/AttachmentOverflowMenuButton/index.js +0 -1
  50. package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +11 -10
  51. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +57 -45
  52. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
  53. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +37 -25
  54. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -1
  55. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js +102 -0
  56. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js.map +1 -0
  57. package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +4 -5
  58. package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +1 -2
  59. package/lib/components/AttachmentOverflowMenuItem/index.js +0 -1
  60. package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +9 -8
  61. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +41 -49
  62. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +57 -0
  63. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
  64. package/lib/components/AttachmentTag/AttachmentTag.js +5 -7
  65. package/lib/components/AttachmentTag/AttachmentTag.types.js +1 -2
  66. package/lib/components/AttachmentTag/index.js +0 -1
  67. package/lib/components/AttachmentTag/renderAttachmentTag.js +10 -8
  68. package/lib/components/AttachmentTag/useAttachmentTag.js +9 -11
  69. package/lib/components/AttachmentTag/useAttachmentTagStyles.styles.raw.js +98 -0
  70. package/lib/components/AttachmentTag/useAttachmentTagStyles.styles.raw.js.map +1 -0
  71. package/lib/components/AttachmentTagItem/AttachmentTagItem.js +4 -6
  72. package/lib/components/AttachmentTagItem/AttachmentTagItem.types.js +1 -2
  73. package/lib/components/AttachmentTagItem/index.js +0 -1
  74. package/lib/components/AttachmentTagItem/renderAttachmentTagItem.js +10 -8
  75. package/lib/components/AttachmentTagItem/useAttachmentTagItem.js +9 -11
  76. package/lib/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.raw.js +34 -0
  77. package/lib/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.raw.js.map +1 -0
  78. package/lib/components/AttachmentTagList/AttachmentTagList.js +6 -8
  79. package/lib/components/AttachmentTagList/AttachmentTagList.types.js +1 -2
  80. package/lib/components/AttachmentTagList/index.js +0 -1
  81. package/lib/components/AttachmentTagList/renderAttachmentTagList.js +7 -9
  82. package/lib/components/AttachmentTagList/useAttachmentTagList.js +21 -25
  83. package/lib/components/AttachmentTagList/useAttachmentTagListContextValues.js +8 -11
  84. package/lib/components/AttachmentTagList/useAttachmentTagListStyles.styles.raw.js +21 -0
  85. package/lib/components/AttachmentTagList/useAttachmentTagListStyles.styles.raw.js.map +1 -0
  86. package/lib/components/index.js +0 -1
  87. package/lib/components/utils/useAttachmentTagSlots.js +45 -52
  88. package/lib/components/utils/useProgressBarStyles.styles.raw.js +42 -0
  89. package/lib/components/utils/useProgressBarStyles.styles.raw.js.map +1 -0
  90. package/lib/contexts/attachmentListContext.js +4 -4
  91. package/lib/contexts/attachmentListContext.js.map +1 -1
  92. package/lib/contexts/attachmentOverflowMenuContext.js +4 -5
  93. package/lib/contexts/attachmentTagListContext.js +2 -3
  94. package/lib/index.js +0 -1
  95. package/lib-commonjs/AgentTag.js +0 -1
  96. package/lib-commonjs/Attachment.js +0 -1
  97. package/lib-commonjs/AttachmentList.js +0 -1
  98. package/lib-commonjs/AttachmentOverflowMenu.js +0 -1
  99. package/lib-commonjs/AttachmentOverflowMenuButton.js +0 -1
  100. package/lib-commonjs/AttachmentOverflowMenuItem.js +0 -1
  101. package/lib-commonjs/AttachmentTag.js +0 -1
  102. package/lib-commonjs/AttachmentTagItem.js +0 -1
  103. package/lib-commonjs/AttachmentTagList.js +0 -1
  104. package/lib-commonjs/components/AgentTag/AgentTag.js +1 -1
  105. package/lib-commonjs/components/AgentTag/AgentTag.js.map +1 -1
  106. package/lib-commonjs/components/AgentTag/AgentTag.types.js +0 -1
  107. package/lib-commonjs/components/AgentTag/index.js +0 -1
  108. package/lib-commonjs/components/AgentTag/renderAgentTag.js +1 -1
  109. package/lib-commonjs/components/AgentTag/renderAgentTag.js.map +1 -1
  110. package/lib-commonjs/components/AgentTag/useAgentTag.js +1 -1
  111. package/lib-commonjs/components/AgentTag/useAgentTag.js.map +1 -1
  112. package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.raw.js +82 -0
  113. package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.raw.js.map +1 -0
  114. package/lib-commonjs/components/Attachment/Attachment.js +1 -1
  115. package/lib-commonjs/components/Attachment/Attachment.js.map +1 -1
  116. package/lib-commonjs/components/Attachment/Attachment.types.js +0 -1
  117. package/lib-commonjs/components/Attachment/index.js +0 -1
  118. package/lib-commonjs/components/Attachment/renderAttachment.js +1 -1
  119. package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -1
  120. package/lib-commonjs/components/Attachment/useAttachment.js +1 -1
  121. package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -1
  122. package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js +52 -26
  123. package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js.map +1 -1
  124. package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js +336 -0
  125. package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -0
  126. package/lib-commonjs/components/AttachmentList/AttachmentList.js +1 -1
  127. package/lib-commonjs/components/AttachmentList/AttachmentList.js.map +1 -1
  128. package/lib-commonjs/components/AttachmentList/AttachmentList.types.js +0 -1
  129. package/lib-commonjs/components/AttachmentList/AttachmentList.types.js.map +1 -1
  130. package/lib-commonjs/components/AttachmentList/index.js +0 -1
  131. package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +1 -1
  132. package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -1
  133. package/lib-commonjs/components/AttachmentList/useAttachmentList.js +2 -1
  134. package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -1
  135. package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js +3 -2
  136. package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js.map +1 -1
  137. package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.raw.js +60 -0
  138. package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.raw.js.map +1 -0
  139. package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +1 -1
  140. package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js.map +1 -1
  141. package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +0 -1
  142. package/lib-commonjs/components/AttachmentOverflowMenu/index.js +0 -1
  143. package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +1 -1
  144. package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js.map +1 -1
  145. package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +1 -1
  146. package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js.map +1 -1
  147. package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +1 -1
  148. package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map +1 -1
  149. package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +1 -1
  150. package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -1
  151. package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +0 -1
  152. package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -1
  153. package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js +0 -1
  154. package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +1 -1
  155. package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -1
  156. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +26 -4
  157. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
  158. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +57 -26
  159. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -1
  160. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js +118 -0
  161. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js.map +1 -0
  162. package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +1 -1
  163. package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js.map +1 -1
  164. package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +0 -1
  165. package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js +0 -1
  166. package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +1 -1
  167. package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -1
  168. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +1 -1
  169. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -1
  170. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +73 -0
  171. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
  172. package/lib-commonjs/components/AttachmentTag/AttachmentTag.js +1 -1
  173. package/lib-commonjs/components/AttachmentTag/AttachmentTag.js.map +1 -1
  174. package/lib-commonjs/components/AttachmentTag/AttachmentTag.types.js +0 -1
  175. package/lib-commonjs/components/AttachmentTag/index.js +0 -1
  176. package/lib-commonjs/components/AttachmentTag/renderAttachmentTag.js +1 -1
  177. package/lib-commonjs/components/AttachmentTag/renderAttachmentTag.js.map +1 -1
  178. package/lib-commonjs/components/AttachmentTag/useAttachmentTag.js +1 -1
  179. package/lib-commonjs/components/AttachmentTag/useAttachmentTag.js.map +1 -1
  180. package/lib-commonjs/components/AttachmentTag/useAttachmentTagStyles.styles.raw.js +118 -0
  181. package/lib-commonjs/components/AttachmentTag/useAttachmentTagStyles.styles.raw.js.map +1 -0
  182. package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.js +1 -1
  183. package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.js.map +1 -1
  184. package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.types.js +0 -1
  185. package/lib-commonjs/components/AttachmentTagItem/index.js +0 -1
  186. package/lib-commonjs/components/AttachmentTagItem/renderAttachmentTagItem.js +1 -1
  187. package/lib-commonjs/components/AttachmentTagItem/renderAttachmentTagItem.js.map +1 -1
  188. package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItem.js +1 -1
  189. package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItem.js.map +1 -1
  190. package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.raw.js +50 -0
  191. package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.raw.js.map +1 -0
  192. package/lib-commonjs/components/AttachmentTagList/AttachmentTagList.js +1 -1
  193. package/lib-commonjs/components/AttachmentTagList/AttachmentTagList.js.map +1 -1
  194. package/lib-commonjs/components/AttachmentTagList/AttachmentTagList.types.js +0 -1
  195. package/lib-commonjs/components/AttachmentTagList/index.js +0 -1
  196. package/lib-commonjs/components/AttachmentTagList/renderAttachmentTagList.js +1 -1
  197. package/lib-commonjs/components/AttachmentTagList/renderAttachmentTagList.js.map +1 -1
  198. package/lib-commonjs/components/AttachmentTagList/useAttachmentTagList.js +1 -1
  199. package/lib-commonjs/components/AttachmentTagList/useAttachmentTagList.js.map +1 -1
  200. package/lib-commonjs/components/AttachmentTagList/useAttachmentTagListContextValues.js +1 -1
  201. package/lib-commonjs/components/AttachmentTagList/useAttachmentTagListContextValues.js.map +1 -1
  202. package/lib-commonjs/components/AttachmentTagList/useAttachmentTagListStyles.styles.raw.js +37 -0
  203. package/lib-commonjs/components/AttachmentTagList/useAttachmentTagListStyles.styles.raw.js.map +1 -0
  204. package/lib-commonjs/components/index.js +0 -1
  205. package/lib-commonjs/components/utils/useAttachmentTagSlots.js +1 -1
  206. package/lib-commonjs/components/utils/useAttachmentTagSlots.js.map +1 -1
  207. package/lib-commonjs/components/utils/useProgressBarStyles.styles.raw.js +50 -0
  208. package/lib-commonjs/components/utils/useProgressBarStyles.styles.raw.js.map +1 -0
  209. package/lib-commonjs/contexts/attachmentListContext.js +3 -2
  210. package/lib-commonjs/contexts/attachmentListContext.js.map +1 -1
  211. package/lib-commonjs/contexts/attachmentOverflowMenuContext.js +1 -1
  212. package/lib-commonjs/contexts/attachmentOverflowMenuContext.js.map +1 -1
  213. package/lib-commonjs/contexts/attachmentTagListContext.js +1 -1
  214. package/lib-commonjs/contexts/attachmentTagListContext.js.map +1 -1
  215. package/lib-commonjs/index.js +0 -1
  216. package/package.json +7 -11
@@ -1,6 +1,9 @@
1
+ import * as React from 'react';
1
2
  import { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';
2
3
  import { ProgressBar, getIntrinsicElementProps, slot, useMergedRefs } from '@fluentui/react-components';
3
4
  import { useAttachmentOverflowMenuContext_unstable } from '../../contexts/attachmentOverflowMenuContext';
5
+ import { Attach20Regular, Attach24Regular } from '@fluentui/react-icons';
6
+ import { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';
4
7
  /**
5
8
  * Create the state required to render AttachmentOverflowMenuButton.
6
9
  *
@@ -9,49 +12,58 @@ import { useAttachmentOverflowMenuContext_unstable } from '../../contexts/attach
9
12
  *
10
13
  * @param props - props from this instance of AttachmentOverflowMenuButton
11
14
  * @param ref - reference to root HTMLElement of AttachmentOverflowMenuButton
12
- */
13
- export const useAttachmentOverflowMenuButton_unstable = (props, ref) => {
14
- const {
15
- children,
16
- text
17
- } = props;
18
- const {
19
- isOverflowing,
20
- overflowCount,
21
- overflowButtonRef
22
- } = useAttachmentOverflowMenuContext_unstable(context => context);
23
- const isLoading = !!props.isLoading;
24
- const designVersion = useDesignVersion(props.designVersion);
25
- const mode = useCopilotMode(props.mode);
26
- const processedText = children !== null && children !== void 0 ? children : typeof text === 'function' ? text(overflowCount) : text;
27
- return {
28
- components: {
29
- root: 'button',
30
- progress: ProgressBar
31
- },
32
- root: slot.always(getIntrinsicElementProps('button', {
33
- ref: useMergedRefs(ref, overflowButtonRef),
34
- ...props
35
- }), {
36
- defaultProps: {
37
- children: processedText !== null && processedText !== void 0 ? processedText : `+${overflowCount}`
38
- },
39
- elementType: 'button'
40
- }),
41
- progress: slot.always(props.progress, {
42
- defaultProps: {
43
- value: undefined,
44
- shape: 'square',
45
- thickness: 'large',
46
- 'aria-label': 'Loading'
47
- },
48
- elementType: ProgressBar
49
- }),
50
- isOverflowing,
51
- overflowCount,
52
- isLoading,
53
- designVersion,
54
- mode
55
- };
15
+ */ export const useAttachmentOverflowMenuButton_unstable = (props, ref)=>{
16
+ const { isOverflowing, overflowCount, overflowButtonRef } = useAttachmentOverflowMenuContext_unstable((context)=>context);
17
+ const { numberOfAttachments } = useAttachmentListContext_unstable((context)=>context);
18
+ const fullyOverflowed = overflowCount >= numberOfAttachments;
19
+ const isLoading = !!props.isLoading;
20
+ const designVersion = useDesignVersion(props.designVersion);
21
+ const mode = useCopilotMode(props.mode);
22
+ const buttonText = defaultButtonText(props, overflowCount, designVersion, mode, fullyOverflowed);
23
+ return {
24
+ components: {
25
+ root: 'button',
26
+ progress: ProgressBar
27
+ },
28
+ root: slot.always(getIntrinsicElementProps('button', {
29
+ ref: useMergedRefs(ref, overflowButtonRef),
30
+ ...props
31
+ }), {
32
+ defaultProps: {
33
+ children: buttonText
34
+ },
35
+ elementType: 'button'
36
+ }),
37
+ progress: slot.always(props.progress, {
38
+ defaultProps: {
39
+ value: undefined,
40
+ shape: 'square',
41
+ thickness: 'large',
42
+ 'aria-label': 'Loading'
43
+ },
44
+ elementType: ProgressBar
45
+ }),
46
+ fullyOverflowed,
47
+ isOverflowing,
48
+ overflowCount,
49
+ isLoading,
50
+ designVersion,
51
+ mode
52
+ };
56
53
  };
57
- //# sourceMappingURL=useAttachmentOverflowMenuButton.js.map
54
+ function defaultButtonText(props, overflowCount, designVersion, copilotMode, fullyOverflowed) {
55
+ if (props.children) {
56
+ return props.children;
57
+ }
58
+ if (props.text) {
59
+ if (typeof props.text === 'function') {
60
+ return props.text(overflowCount);
61
+ } else {
62
+ return props.text;
63
+ }
64
+ }
65
+ if (designVersion === 'next' && fullyOverflowed) {
66
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, copilotMode === 'canvas' ? /*#__PURE__*/ React.createElement(Attach24Regular, null) : /*#__PURE__*/ React.createElement(Attach20Regular, null), overflowCount);
67
+ }
68
+ return `+${overflowCount}`;
69
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["useAttachmentOverflowMenuButton.ts"],"sourcesContent":["import { 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';\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 { children, text } = props;\n const { isOverflowing, overflowCount, overflowButtonRef } = useAttachmentOverflowMenuContext_unstable(\n context => context,\n );\n const isLoading = !!props.isLoading;\n\n const designVersion = useDesignVersion(props.designVersion);\n const mode = useCopilotMode(props.mode);\n\n const processedText = children ?? (typeof text === 'function' ? text(overflowCount) : text);\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 { defaultProps: { children: processedText ?? `+${overflowCount}` }, elementType: 'button' },\n ),\n progress: slot.always(props.progress, {\n defaultProps: { value: undefined, shape: 'square', thickness: 'large', 'aria-label': 'Loading' },\n elementType: ProgressBar,\n }),\n isOverflowing,\n overflowCount,\n isLoading,\n designVersion,\n mode,\n };\n};\n"],"names":["useCopilotMode","useDesignVersion","ProgressBar","getIntrinsicElementProps","slot","useMergedRefs","useAttachmentOverflowMenuContext_unstable","useAttachmentOverflowMenuButton_unstable","props","ref","children","text","isOverflowing","overflowCount","overflowButtonRef","context","isLoading","designVersion","mode","processedText","components","root","progress","always","defaultProps","elementType","value","undefined","shape","thickness"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,cAAc,EAAEC,gBAAgB,QAAQ,mCAAmC;AACpF,SAASC,WAAW,EAAEC,wBAAwB,EAAEC,IAAI,EAAEC,aAAa,QAAQ,6BAA6B;AACxG,SAASC,yCAAyC,QAAQ,+CAA+C;AAMzG;;;;;;;;CAQC,GACD,OAAO,MAAMC,2CAA2C,CACtDC,OACAC;IAEA,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGH;IAC3B,MAAM,EAAEI,aAAa,EAAEC,aAAa,EAAEC,iBAAiB,EAAE,GAAGR,0CAC1DS,CAAAA,UAAWA;IAEb,MAAMC,YAAY,CAAC,CAACR,MAAMQ,SAAS;IAEnC,MAAMC,gBAAgBhB,iBAAiBO,MAAMS,aAAa;IAC1D,MAAMC,OAAOlB,eAAeQ,MAAMU,IAAI;IAEtC,MAAMC,gBAAgBT,qBAAAA,sBAAAA,WAAa,OAAOC,SAAS,aAAaA,KAAKE,iBAAiBF;IACtF,OAAO;QACLS,YAAY;YACVC,MAAM;YACNC,UAAUpB;QACZ;QACAmB,MAAMjB,KAAKmB,MAAM,CACfpB,yBAAyB,UAAU;YACjCM,KAAKJ,cAAcI,KAAKK;YACxB,GAAGN,KAAK;QACV,IACA;YAAEgB,cAAc;gBAAEd,UAAUS,0BAAAA,2BAAAA,gBAAiB,CAAC,CAAC,EAAEN,cAAc,CAAC;YAAC;YAAGY,aAAa;QAAS;QAE5FH,UAAUlB,KAAKmB,MAAM,CAACf,MAAMc,QAAQ,EAAE;YACpCE,cAAc;gBAAEE,OAAOC;gBAAWC,OAAO;gBAAUC,WAAW;gBAAS,cAAc;YAAU;YAC/FJ,aAAavB;QACf;QACAU;QACAC;QACAG;QACAC;QACAC;IACF;AACF,EAAE"}
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":["React","useCopilotMode","useDesignVersion","ProgressBar","getIntrinsicElementProps","slot","useMergedRefs","useAttachmentOverflowMenuContext_unstable","Attach20Regular","Attach24Regular","useAttachmentListContext_unstable","useAttachmentOverflowMenuButton_unstable","props","ref","isOverflowing","overflowCount","overflowButtonRef","context","numberOfAttachments","fullyOverflowed","isLoading","designVersion","mode","buttonText","defaultButtonText","components","root","progress","always","defaultProps","children","elementType","value","undefined","shape","thickness","copilotMode","text"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,mCAAmC;AACpF,SAASC,WAAW,EAAEC,wBAAwB,EAAEC,IAAI,EAAEC,aAAa,QAAQ,6BAA6B;AACxG,SAASC,yCAAyC,QAAQ,+CAA+C;AAKzG,SAASC,eAAe,EAAEC,eAAe,QAAQ,wBAAwB;AACzE,SAASC,iCAAiC,QAAQ,uCAAuC;AAEzF;;;;;;;;CAQC,GACD,OAAO,MAAMC,2CAA2C,CACtDC,OACAC;IAEA,MAAM,EAAEC,aAAa,EAAEC,aAAa,EAAEC,iBAAiB,EAAE,GAAGT,0CAC1DU,CAAAA,UAAWA;IAEb,MAAM,EAAEC,mBAAmB,EAAE,GAAGR,kCAAkCO,CAAAA,UAAWA;IAE7E,MAAME,kBAAkBJ,iBAAiBG;IACzC,MAAME,YAAY,CAAC,CAACR,MAAMQ,SAAS;IAEnC,MAAMC,gBAAgBnB,iBAAiBU,MAAMS,aAAa;IAC1D,MAAMC,OAAOrB,eAAeW,MAAMU,IAAI;IAEtC,MAAMC,aAAaC,kBAAkBZ,OAAOG,eAAeM,eAAeC,MAAMH;IAEhF,OAAO;QACLM,YAAY;YACVC,MAAM;YACNC,UAAUxB;QACZ;QACAuB,MAAMrB,KAAKuB,MAAM,CACfxB,yBAAyB,UAAU;YACjCS,KAAKP,cAAcO,KAAKG;YACxB,GAAGJ,KAAK;QACV,IACA;YACEiB,cAAc;gBACZC,UAAUP;YACZ;YACAQ,aAAa;QACf;QAEFJ,UAAUtB,KAAKuB,MAAM,CAAChB,MAAMe,QAAQ,EAAE;YACpCE,cAAc;gBAAEG,OAAOC;gBAAWC,OAAO;gBAAUC,WAAW;gBAAS,cAAc;YAAU;YAC/FJ,aAAa5B;QACf;QACAgB;QACAL;QACAC;QACAK;QACAC;QACAC;IACF;AACF,EAAE;AAEF,SAASE,kBACPZ,KAAwC,EACxCG,aAAqB,EACrBM,aAA6C,EAC7Ce,WAAgC,EAChCjB,eAAwB;IAExB,IAAIP,MAAMkB,QAAQ,EAAE;QAClB,OAAOlB,MAAMkB,QAAQ;IACvB;IAEA,IAAIlB,MAAMyB,IAAI,EAAE;QACd,IAAI,OAAOzB,MAAMyB,IAAI,KAAK,YAAY;YACpC,OAAOzB,MAAMyB,IAAI,CAACtB;QACpB,OAAO;YACL,OAAOH,MAAMyB,IAAI;QACnB;IACF;IAEA,IAAIhB,kBAAkB,UAAUF,iBAAiB;QAC/C,qBACE,0CACGiB,gBAAgB,yBAAW,oBAAC3B,uCAAqB,oBAACD,wBAClDO;IAGP;IAEA,OAAO,CAAC,CAAC,EAAEA,cAAc,CAAC;AAC5B"}
@@ -1,5 +1,5 @@
1
- import { __resetStyles, __styles, mergeClasses, slot, typographyStyles } from '@fluentui/react-components';
2
- import { tokens } from '@fluentui-copilot/tokens';
1
+ import { __resetStyles, __styles, mergeClasses, shorthands, slot } from '@fluentui/react-components';
2
+ import { tokens, typographyStyles } from '@fluentui-copilot/tokens';
3
3
  import { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';
4
4
  export const attachmentOverflowMenuButtonClassNames = {
5
5
  root: 'fai-AttachmentOverflowMenuButton',
@@ -16,23 +16,10 @@ const useNextStyles = __styles({
16
16
  Btl43ni: 0,
17
17
  B7oj6ja: 0,
18
18
  Dimara: "f1kijzfu",
19
- Bgfg5da: 0,
20
- B9xav0g: 0,
21
- oivjwe: 0,
22
- Bn0qgzm: 0,
23
- B4g9neb: 0,
24
- zhjwy3: 0,
25
- wvpqe5: 0,
26
- ibv6hh: 0,
27
- u1mtju: 0,
28
- h3c5rm: 0,
29
- vrafjx: 0,
30
- Bekrc4i: 0,
31
- i8vvqc: 0,
32
- g2u3we: 0,
33
- icvyot: 0,
34
- B4j52fo: 0,
35
- irswps: "f3bhgqh",
19
+ g2u3we: "fghlq4f",
20
+ h3c5rm: ["f1gn591s", "fjscplz"],
21
+ B9xav0g: "fb073pr",
22
+ zhjwy3: ["fjscplz", "f1gn591s"],
36
23
  sj55zd: "fkfq4zb",
37
24
  De3pzq: "f16xq7d1",
38
25
  eoavqd: "f8491dx",
@@ -56,17 +43,41 @@ const useNextStyles = __styles({
56
43
  z189sj: 0,
57
44
  z8tnut: 0,
58
45
  B0ocmuz: "f1nm7172"
46
+ },
47
+ fullyOverflowed_canvas: {
48
+ Byoj8tv: 0,
49
+ uwmqm3: 0,
50
+ z189sj: 0,
51
+ z8tnut: 0,
52
+ B0ocmuz: "fuva4e2",
53
+ Bahqtrf: "fk6fouc",
54
+ Be2twd7: "fod5ikn",
55
+ Bhrd7zp: "fl43uef",
56
+ Bg96gwp: "f1anucx2"
57
+ },
58
+ fullyOverflowed_sidecar: {
59
+ Byoj8tv: 0,
60
+ uwmqm3: 0,
61
+ z189sj: 0,
62
+ z8tnut: 0,
63
+ B0ocmuz: "ffysxzw",
64
+ Bahqtrf: "fk6fouc",
65
+ Be2twd7: "fkhj508",
66
+ Bhrd7zp: "fl43uef",
67
+ Bg96gwp: "f1i3iumi"
59
68
  }
60
69
  }, {
61
70
  d: [[".f1kijzfu{border-radius:var(--borderRadiusXLarge);}", {
62
71
  p: -1
63
- }], [".f3bhgqh{border:none;}", {
64
- p: -2
65
- }], ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".f16xq7d1{background-color:var(--colorNeutralBackground3);}", ".f1w5jphr{min-height:40px;}", [".f1nm7172{padding:var(--spacingVerticalNone) var(--spacingHorizontalS);}", {
72
+ }], ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".f16xq7d1{background-color:var(--colorNeutralBackground3);}", ".f1w5jphr{min-height:40px;}", [".f1nm7172{padding:var(--spacingVerticalNone) var(--spacingHorizontalS);}", {
66
73
  p: -1
67
74
  }], ".f1nxs5xn{min-height:32px;}", [".f1nm7172{padding:var(--spacingVerticalNone) var(--spacingHorizontalS);}", {
68
75
  p: -1
69
- }]],
76
+ }], [".fuva4e2{padding:var(--spacingVerticalNone) var(--spacingHorizontalL);}", {
77
+ p: -1
78
+ }], ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f1anucx2{line-height:var(--lineHeightBase450);}", [".ffysxzw{padding:var(--spacingVerticalNone) var(--spacingHorizontalM);}", {
79
+ p: -1
80
+ }], ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"],
70
81
  h: [".f8491dx:hover{cursor:pointer;}", ".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}", ".f1h648pw:hover{background-color:var(--colorNeutralBackground3Hover);}"],
71
82
  a: [".flvvhsy:active{color:var(--colorNeutralForeground2Pressed);}", ".fwdzr64:active{background-color:var(--colorNeutralBackground3Pressed);}"]
72
83
  });
@@ -78,12 +89,13 @@ export const useAttachmentOverflowMenuButtonStyles_unstable = state => {
78
89
 
79
90
  const {
80
91
  designVersion,
81
- mode
92
+ mode,
93
+ fullyOverflowed
82
94
  } = state;
83
95
  const rootBaseClassName = useRootBaseClassName();
84
96
  const progressBarStyles = useProgressBarStyles();
85
97
  const nextStyles = useNextStyles();
86
- state.root.className = mergeClasses(attachmentOverflowMenuButtonClassNames.root, rootBaseClassName, designVersion === 'next' && nextStyles.root, designVersion === 'next' && nextStyles[mode], state.root.className);
98
+ state.root.className = mergeClasses(attachmentOverflowMenuButtonClassNames.root, rootBaseClassName, designVersion === 'next' && nextStyles.root, designVersion === 'next' && nextStyles[mode], designVersion === 'next' && fullyOverflowed && nextStyles[`fullyOverflowed_${mode}`], state.root.className);
87
99
  if (state.progress) {
88
100
  state.progress.className = mergeClasses(attachmentOverflowMenuButtonClassNames.progress, progressBarStyles.progress, state.progress.className);
89
101
  const bar = slot.optional(state.progress.bar, {
@@ -1 +1 @@
1
- {"version":3,"sources":["useAttachmentOverflowMenuButtonStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, slot, typographyStyles } from '@fluentui/react-components';\nimport { tokens } 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 border: 'none',\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});\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 } = 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 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":["makeResetStyles","makeStyles","mergeClasses","slot","typographyStyles","tokens","useProgressBarStyles","attachmentOverflowMenuButtonClassNames","root","progress","useRootBaseClassName","color","colorNeutralForeground1","alignItems","backgroundColor","colorSubtleBackground","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","boxSizing","columnGap","spacingHorizontalSNudge","cursor","display","flexWrap","fontFamily","body1","fontSize","fontWeight","justifyContent","padding","spacingVerticalXS","spacingHorizontalS","verticalAlign","position","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","useNextStyles","borderRadiusXLarge","colorNeutralForeground2","colorNeutralBackground3","colorNeutralBackground3Hover","colorNeutralBackground3Pressed","canvas","minHeight","spacingVerticalNone","sidecar","useAttachmentOverflowMenuButtonStyles_unstable","state","designVersion","mode","rootBaseClassName","progressBarStyles","nextStyles","className","bar","optional","elementType","renderByDefault","value","undefined","indeterminateProgressBar","regularProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,6BAA6B;AAC/G,SAASC,MAAM,QAAQ,2BAA2B;AAClD,SAASC,oBAAoB,QAAQ,uCAAuC;AAO5E,OAAO,MAAMC,yCAA4F;IACvGC,MAAM;IACNC,UAAU;AACZ,EAAE;AAEF,MAAMC,uBAAuBV,gBAAgB;IAC3CW,OAAON,OAAOO,uBAAuB;IACrCC,YAAY;IACZC,iBAAiBT,OAAOU,qBAAqB;IAC7CC,QAAQ,CAAC,EAAEX,OAAOY,eAAe,CAAC,OAAO,EAAEZ,OAAOa,mBAAmB,CAAC,CAAC;IACvEC,cAAcd,OAAOe,kBAAkB;IACvCC,WAAW;IACXC,WAAWjB,OAAOkB,uBAAuB;IACzCC,QAAQ;IACRC,SAAS;IACTC,UAAU;IACVC,YAAYvB,iBAAiBwB,KAAK,CAACD,UA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1B,MAAM8C,oBAAoBlD;IAC1B,MAAMmD,aAAahB;IAEnBW,MAAM5C,IAAI,CAACkD,SAAS,GAAGxD,aACrBK,uCAAuCC,IAAI,EAC3C+C,mBACAF,kBAAkB,UAAUI,WAAWjD,IAAI,EAC3C6C,kBAAkB,UAAUI,UAAU,CAACH,KAAK,EAC5CF,MAAM5C,IAAI,CAACkD,SAAS;IAGtB,IAAIN,MAAM3C,QAAQ,EAAE;QAClB2C,MAAM3C,QAAQ,CAACiD,SAAS,GAAGxD,aACzBK,uCAAuCE,QAAQ,EAC/C+C,kBAAkB/C,QAAQ,EAC1B2C,MAAM3C,QAAQ,CAACiD,SAAS;QAG1B,MAAMC,MAAMxD,KAAKyD,QAAQ,CAACR,MAAM3C,QAAQ,CAACkD,GAAG,EAAE;YAAEE,aAAa;YAAOC,iBAAiB;QAAK;QAC1F,IAAIH,KAAK;YACP,IAAIP,MAAM3C,QAAQ,CAACsD,KAAK,KAAKC,WAAW;gBACtCL,IAAID,SAAS,GAAGxD,aAAasD,kBAAkBS,wBAAwB,EAAEN,IAAID,SAAS;YACxF,OAAO;gBACLC,IAAID,SAAS,GAAGxD,aAAasD,kBAAkBU,kBAAkB,EAAEP,IAAID,SAAS;YAClF;YACAN,MAAM3C,QAAQ,CAACkD,GAAG,GAAGA;QACvB;IACF;IAEA,OAAOP;AACT,EAAE"}
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":["makeResetStyles","makeStyles","mergeClasses","shorthands","slot","tokens","typographyStyles","useProgressBarStyles","attachmentOverflowMenuButtonClassNames","root","progress","useRootBaseClassName","color","colorNeutralForeground1","alignItems","backgroundColor","colorSubtleBackground","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","boxSizing","columnGap","spacingHorizontalSNudge","cursor","display","flexWrap","fontFamily","body1","fontSize","fontWeight","justifyContent","padding","spacingVerticalXS","spacingHorizontalS","verticalAlign","position","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","useNextStyles","borderRadiusXLarge","borderColor","colorTransparentStroke","colorNeutralForeground2","colorNeutralBackground3","colorNeutralBackground3Hover","colorNeutralBackground3Pressed","canvas","minHeight","spacingVerticalNone","sidecar","fullyOverflowed_canvas","spacingHorizontalL","subtitle2","fullyOverflowed_sidecar","spacingHorizontalM","body1Strong","useAttachmentOverflowMenuButtonStyles_unstable","state","designVersion","mode","fullyOverflowed","rootBaseClassName","progressBarStyles","nextStyles","className","bar","optional","elementType","renderByDefault","value","undefined","indeterminateProgressBar","regularProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,EAAEC,UAAU,EAAEC,IAAI,QAAQ,6BAA6B;AACzG,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,2BAA2B;AACpE,SAASC,oBAAoB,QAAQ,uCAAuC;AAO5E,OAAO,MAAMC,yCAA4F;IACvGC,MAAM;IACNC,UAAU;AACZ,EAAE;AAEF,MAAMC,uBAAuBX,gBAAgB;IAC3CY,OAAOP,OAAOQ,uBAAuB;IACrCC,YAAY;IACZC,iBAAiBV,OAAOW,qBAAqB;IAC7CC,QAAQ,CAAC,EAAEZ,OAAOa,eAAe,CAAC,OAAO,EAAEb,OAAOc,mBAAmB,CAAC,CAAC;IACvEC,cAAcf,OAAOgB,kBAAkB;IACvCC,WAAW;IACXC,WAAWlB,OAAOmB,uBAAuB;IACzCC,QAAQ;IACRC,SAAS;IACTC,UAAU;IACVC,YAAYtB,iBAAiBuB,KAAK,CAACD,UAAU;IAC7CE,UAAUxB,iBAAiBuB,KAAK,CAACC,QAAQ;IACzCC,YAAYzB,iBAAiBuB,KAAK,CAACE,UAAU;IAC7CC,gBAAgB;IAChBC,SAAS,CAAC,EAAE5B,OAAO6B,iB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import { tokens, typographyStyles } from '@fluentui-copilot/tokens';
3
+ import { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';
4
+ export const attachmentOverflowMenuButtonClassNames = {
5
+ root: 'fai-AttachmentOverflowMenuButton',
6
+ progress: 'fai-AttachmentOverflowMenuButton__progress'
7
+ };
8
+ const useRootBaseClassName = makeResetStyles({
9
+ color: tokens.colorNeutralForeground1,
10
+ alignItems: 'center',
11
+ backgroundColor: tokens.colorSubtleBackground,
12
+ border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,
13
+ borderRadius: tokens.borderRadiusMedium,
14
+ boxSizing: 'border-box',
15
+ columnGap: tokens.spacingHorizontalSNudge,
16
+ cursor: 'pointer',
17
+ display: 'inline-flex',
18
+ flexWrap: 'nowrap',
19
+ fontFamily: typographyStyles.body1.fontFamily,
20
+ fontSize: typographyStyles.body1.fontSize,
21
+ fontWeight: typographyStyles.body1.fontWeight,
22
+ justifyContent: 'center',
23
+ padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`,
24
+ verticalAlign: 'middle',
25
+ position: 'relative',
26
+ ':hover': {
27
+ cursor: 'pointer',
28
+ backgroundColor: tokens.colorSubtleBackgroundHover,
29
+ color: tokens.colorNeutralForeground2Hover
30
+ },
31
+ ':active': {
32
+ backgroundColor: tokens.colorSubtleBackgroundPressed,
33
+ color: tokens.colorNeutralForeground2Pressed
34
+ },
35
+ '@media (forced-colors: active)': {
36
+ ':hover': {
37
+ backgroundColor: 'HighlightText'
38
+ },
39
+ ':active': {
40
+ backgroundColor: 'HighlightText'
41
+ }
42
+ }
43
+ });
44
+ const useNextStyles = makeStyles({
45
+ root: {
46
+ borderRadius: tokens.borderRadiusXLarge,
47
+ ...shorthands.borderColor(tokens.colorTransparentStroke),
48
+ color: tokens.colorNeutralForeground2,
49
+ backgroundColor: tokens.colorNeutralBackground3,
50
+ ':hover': {
51
+ cursor: 'pointer',
52
+ color: tokens.colorNeutralForeground2Hover,
53
+ backgroundColor: tokens.colorNeutralBackground3Hover
54
+ },
55
+ ':active': {
56
+ color: tokens.colorNeutralForeground2Pressed,
57
+ backgroundColor: tokens.colorNeutralBackground3Pressed
58
+ }
59
+ },
60
+ canvas: {
61
+ minHeight: '40px',
62
+ padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`
63
+ },
64
+ sidecar: {
65
+ minHeight: '32px',
66
+ padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalS}`
67
+ },
68
+ fullyOverflowed_canvas: {
69
+ padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalL}`,
70
+ ...typographyStyles.subtitle2
71
+ },
72
+ fullyOverflowed_sidecar: {
73
+ padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalM}`,
74
+ ...typographyStyles.body1Strong
75
+ }
76
+ });
77
+ /**
78
+ * Apply styling to the AttachmentOverflowMenuButton slots based on the state
79
+ */ export const useAttachmentOverflowMenuButtonStyles_unstable = (state)=>{
80
+ 'use no memo';
81
+ const { designVersion, mode, fullyOverflowed } = state;
82
+ const rootBaseClassName = useRootBaseClassName();
83
+ const progressBarStyles = useProgressBarStyles();
84
+ const nextStyles = useNextStyles();
85
+ state.root.className = mergeClasses(attachmentOverflowMenuButtonClassNames.root, rootBaseClassName, designVersion === 'next' && nextStyles.root, designVersion === 'next' && nextStyles[mode], designVersion === 'next' && fullyOverflowed && nextStyles[`fullyOverflowed_${mode}`], state.root.className);
86
+ if (state.progress) {
87
+ state.progress.className = mergeClasses(attachmentOverflowMenuButtonClassNames.progress, progressBarStyles.progress, state.progress.className);
88
+ const bar = slot.optional(state.progress.bar, {
89
+ elementType: 'div',
90
+ renderByDefault: true
91
+ });
92
+ if (bar) {
93
+ if (state.progress.value === undefined) {
94
+ bar.className = mergeClasses(progressBarStyles.indeterminateProgressBar, bar.className);
95
+ } else {
96
+ bar.className = mergeClasses(progressBarStyles.regularProgressBar, bar.className);
97
+ }
98
+ state.progress.bar = bar;
99
+ }
100
+ }
101
+ return state;
102
+ };
@@ -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":["makeResetStyles","makeStyles","mergeClasses","shorthands","slot","tokens","typographyStyles","useProgressBarStyles","attachmentOverflowMenuButtonClassNames","root","progress","useRootBaseClassName","color","colorNeutralForeground1","alignItems","backgroundColor","colorSubtleBackground","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","boxSizing","columnGap","spacingHorizontalSNudge","cursor","display","flexWrap","fontFamily","body1","fontSize","fontWeight","justifyContent","padding","spacingVerticalXS","spacingHorizontalS","verticalAlign","position","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","useNextStyles","borderRadiusXLarge","borderColor","colorTransparentStroke","colorNeutralForeground2","colorNeutralBackground3","colorNeutralBackground3Hover","colorNeutralBackground3Pressed","canvas","minHeight","spacingVerticalNone","sidecar","fullyOverflowed_canvas","spacingHorizontalL","subtitle2","fullyOverflowed_sidecar","spacingHorizontalM","body1Strong","useAttachmentOverflowMenuButtonStyles_unstable","state","designVersion","mode","fullyOverflowed","rootBaseClassName","progressBarStyles","nextStyles","className","bar","optional","elementType","renderByDefault","value","undefined","indeterminateProgressBar","regularProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,EAAEC,UAAU,EAAEC,IAAI,QAAQ,6BAA6B;AACzG,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,2BAA2B;AACpE,SAASC,oBAAoB,QAAQ,uCAAuC;AAO5E,OAAO,MAAMC,yCAA4F;IACvGC,MAAM;IACNC,UAAU;AACZ,EAAE;AAEF,MAAMC,uBAAuBX,gBAAgB;IAC3CY,OAAOP,OAAOQ,uBAAuB;IACrCC,YAAY;IACZC,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OC,iBAAiB;QAAK;QAC1F,IAAIH,KAAK;YACP,IAAIR,MAAMnD,QAAQ,CAAC+D,KAAK,KAAKC,WAAW;gBACtCL,IAAID,SAAS,GAAGlE,aAAagE,kBAAkBS,wBAAwB,EAAEN,IAAID,SAAS;YACxF,OAAO;gBACLC,IAAID,SAAS,GAAGlE,aAAagE,kBAAkBU,kBAAkB,EAAEP,IAAID,SAAS;YAClF;YACAP,MAAMnD,QAAQ,CAAC2D,GAAG,GAAGA;QACvB;IACF;IAEA,OAAOR;AACT,EAAE"}
@@ -2,10 +2,9 @@ import * as React from 'react';
2
2
  import { useAttachmentOverflowMenuItem_unstable } from './useAttachmentOverflowMenuItem';
3
3
  import { renderAttachmentOverflowMenuItem_unstable } from './renderAttachmentOverflowMenuItem';
4
4
  import { useAttachmentOverflowMenuItemStyles_unstable } from './useAttachmentOverflowMenuItemStyles.styles';
5
- export const AttachmentOverflowMenuItem = /*#__PURE__*/React.forwardRef((props, ref) => {
6
- const state = useAttachmentOverflowMenuItem_unstable(props, ref);
7
- useAttachmentOverflowMenuItemStyles_unstable(state);
8
- return renderAttachmentOverflowMenuItem_unstable(state);
5
+ export const AttachmentOverflowMenuItem = /*#__PURE__*/ React.forwardRef((props, ref)=>{
6
+ const state = useAttachmentOverflowMenuItem_unstable(props, ref);
7
+ useAttachmentOverflowMenuItemStyles_unstable(state);
8
+ return renderAttachmentOverflowMenuItem_unstable(state);
9
9
  });
10
10
  AttachmentOverflowMenuItem.displayName = 'AttachmentOverflowMenuItem';
11
- //# sourceMappingURL=AttachmentOverflowMenuItem.js.map
@@ -1,4 +1,3 @@
1
1
  /**
2
2
  * State used in rendering AttachmentOverflowMenuItem
3
- */export {};
4
- //# sourceMappingURL=AttachmentOverflowMenuItem.types.js.map
3
+ */ export { };
@@ -2,4 +2,3 @@ export { AttachmentOverflowMenuItem } from './AttachmentOverflowMenuItem';
2
2
  export { renderAttachmentOverflowMenuItem_unstable } from './renderAttachmentOverflowMenuItem';
3
3
  export { useAttachmentOverflowMenuItem_unstable } from './useAttachmentOverflowMenuItem';
4
4
  export { attachmentOverflowMenuItemClassNames, useAttachmentOverflowMenuItemStyles_unstable } from './useAttachmentOverflowMenuItemStyles.styles';
5
- //# sourceMappingURL=index.js.map
@@ -1,12 +1,13 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
2
  import { assertSlots } from '@fluentui/react-components';
3
3
  /**
4
4
  * Render the final JSX of AttachmentOverflowMenuItem
5
- */
6
- export const renderAttachmentOverflowMenuItem_unstable = state => {
7
- assertSlots(state);
8
- return !state.isVisible ? /*#__PURE__*/_jsxs(state.root, {
9
- children: [state.root.children, state.progress && /*#__PURE__*/_jsx(state.progress, {})]
10
- }) : null;
5
+ */ export const renderAttachmentOverflowMenuItem_unstable = (state)=>{
6
+ assertSlots(state);
7
+ return !state.isVisible ? /*#__PURE__*/ _jsxs(state.root, {
8
+ children: [
9
+ state.root.children,
10
+ state.progress && /*#__PURE__*/ _jsx(state.progress, {})
11
+ ]
12
+ }) : null;
11
13
  };
12
- //# sourceMappingURL=renderAttachmentOverflowMenuItem.js.map
@@ -11,54 +11,46 @@ import { useDesignVersion } from '@fluentui-copilot/react-provider';
11
11
  *
12
12
  * @param props - props from this instance of AttachmentOverflowMenuItem
13
13
  * @param ref - reference to root HTMLElement of AttachmentOverflowMenuItem
14
- */
15
- export const useAttachmentOverflowMenuItem_unstable = (props, ref) => {
16
- 'use no memo';
17
-
18
- const {
19
- imageOnly,
20
- media
21
- } = props;
22
- const menuItemId = useId('attachment-', props.id);
23
- const isVisible = useIsOverflowItemVisible(menuItemId);
24
- const {
25
- onAttachmentDismiss
26
- } = useAttachmentListContext_unstable(context => context);
27
- const designVersion = useDesignVersion(props.designVersion);
28
- const root = slot.always({
29
- ref,
30
- icon: media,
31
- secondaryContent: /*#__PURE__*/React.createElement(Dismiss20Regular, null),
32
- ...props,
33
- id: menuItemId
34
- }, {
35
- elementType: MenuItem
36
- });
37
- root.onClick = mergeCallbacks(root.onClick, ev => {
38
- onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
39
- content: props.children,
40
- media,
41
- id: menuItemId
14
+ */ export const useAttachmentOverflowMenuItem_unstable = (props, ref)=>{
15
+ 'use no memo';
16
+ const { imageOnly, media } = props;
17
+ const menuItemId = useId('attachment-', props.id);
18
+ const isVisible = useIsOverflowItemVisible(menuItemId);
19
+ const { onAttachmentDismiss } = useAttachmentListContext_unstable((context)=>context);
20
+ const designVersion = useDesignVersion(props.designVersion);
21
+ const root = slot.always({
22
+ ref,
23
+ icon: media,
24
+ secondaryContent: /*#__PURE__*/ React.createElement(Dismiss20Regular, null),
25
+ ...props,
26
+ id: menuItemId
27
+ }, {
28
+ elementType: MenuItem
42
29
  });
43
- });
44
- const progress = slot.optional(props.progress, {
45
- defaultProps: {
46
- shape: 'square',
47
- thickness: 'large',
48
- 'aria-labelledby': props.id
49
- },
50
- elementType: ProgressBar
51
- });
52
- return {
53
- components: {
54
- root: MenuItem,
55
- progress: ProgressBar
56
- },
57
- root,
58
- progress,
59
- isVisible,
60
- imageOnly,
61
- designVersion
62
- };
30
+ root.onClick = mergeCallbacks(root.onClick, (ev)=>{
31
+ onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
32
+ content: props.children,
33
+ media,
34
+ id: menuItemId
35
+ });
36
+ });
37
+ const progress = slot.optional(props.progress, {
38
+ defaultProps: {
39
+ shape: 'square',
40
+ thickness: 'large',
41
+ 'aria-labelledby': props.id
42
+ },
43
+ elementType: ProgressBar
44
+ });
45
+ return {
46
+ components: {
47
+ root: MenuItem,
48
+ progress: ProgressBar
49
+ },
50
+ root,
51
+ progress,
52
+ isVisible,
53
+ imageOnly,
54
+ designVersion
55
+ };
63
56
  };
64
- //# sourceMappingURL=useAttachmentOverflowMenuItem.js.map
@@ -0,0 +1,57 @@
1
+ import { makeStyles, mergeClasses, slot, tokens } from '@fluentui/react-components';
2
+ import { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';
3
+ export const attachmentOverflowMenuItemClassNames = {
4
+ root: 'fai-AttachmentOverflowMenuItem',
5
+ progress: 'fai-AttachmentOverflowMenuItem__progress'
6
+ };
7
+ const FOCUS_VISIBLE_ATTR = 'data-fui-focus-visible';
8
+ const useStyles = makeStyles({
9
+ imageOnly: {
10
+ alignItems: 'center'
11
+ },
12
+ secondaryContent: {
13
+ display: 'flex',
14
+ alignItems: 'center'
15
+ }
16
+ });
17
+ const useNextStyles = makeStyles({
18
+ nextStyles: {
19
+ [`[${FOCUS_VISIBLE_ATTR}]::after`]: {
20
+ borderRadius: tokens.borderRadiusXLarge
21
+ },
22
+ outline: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`
23
+ }
24
+ });
25
+ /**
26
+ * Apply styling to the AttachmentList slots based on the state
27
+ */ export const useAttachmentOverflowMenuItemStyles_unstable = (state)=>{
28
+ 'use no memo';
29
+ const { imageOnly, designVersion } = state;
30
+ const styles = useStyles();
31
+ const nextStyles = useNextStyles();
32
+ const progressBarStyles = useProgressBarStyles();
33
+ state.root.className = mergeClasses(attachmentOverflowMenuItemClassNames.root, imageOnly && styles.imageOnly, designVersion === 'next' && nextStyles.nextStyles, state.root.className);
34
+ const secondaryContent = slot.optional(state.root.secondaryContent, {
35
+ elementType: 'span'
36
+ });
37
+ if (secondaryContent) {
38
+ secondaryContent.className = mergeClasses(styles.secondaryContent, secondaryContent.className);
39
+ state.root.secondaryContent = secondaryContent;
40
+ }
41
+ if (state.progress) {
42
+ state.progress.className = mergeClasses(attachmentOverflowMenuItemClassNames.progress, progressBarStyles.progress, state.progress.className);
43
+ const bar = slot.optional(state.progress.bar, {
44
+ elementType: 'div',
45
+ renderByDefault: true
46
+ });
47
+ if (bar) {
48
+ if (state.progress.value === undefined) {
49
+ bar.className = mergeClasses(progressBarStyles.indeterminateProgressBar, bar.className);
50
+ } else {
51
+ bar.className = mergeClasses(progressBarStyles.regularProgressBar, bar.className);
52
+ }
53
+ state.progress.bar = bar;
54
+ }
55
+ }
56
+ return state;
57
+ };