@fluentui-copilot/react-attachments 0.13.1 → 0.13.3

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 (133) hide show
  1. package/CHANGELOG.json +36 -0
  2. package/CHANGELOG.md +20 -1
  3. package/lib/AgentTag.js +0 -1
  4. package/lib/Attachment.js +0 -1
  5. package/lib/AttachmentList.js +0 -1
  6. package/lib/AttachmentOverflowMenu.js +0 -1
  7. package/lib/AttachmentOverflowMenuButton.js +0 -1
  8. package/lib/AttachmentOverflowMenuItem.js +0 -1
  9. package/lib/components/AgentTag/AgentTag.js +4 -5
  10. package/lib/components/AgentTag/AgentTag.types.js +1 -2
  11. package/lib/components/AgentTag/index.js +0 -1
  12. package/lib/components/AgentTag/renderAgentTag.js +3 -5
  13. package/lib/components/AgentTag/useAgentTag.js +7 -9
  14. package/lib/components/AgentTag/useAgentTagStyles.styles.raw.js +66 -0
  15. package/lib/components/AgentTag/useAgentTagStyles.styles.raw.js.map +1 -0
  16. package/lib/components/Attachment/Attachment.js +5 -6
  17. package/lib/components/Attachment/Attachment.types.js +1 -2
  18. package/lib/components/Attachment/index.js +0 -1
  19. package/lib/components/Attachment/renderAttachment.js +36 -31
  20. package/lib/components/Attachment/useAttachment.js +85 -95
  21. package/lib/components/Attachment/useAttachmentStyles.styles.raw.js +317 -0
  22. package/lib/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -0
  23. package/lib/components/AttachmentList/AttachmentList.js +6 -7
  24. package/lib/components/AttachmentList/AttachmentList.types.js +1 -2
  25. package/lib/components/AttachmentList/index.js +0 -1
  26. package/lib/components/AttachmentList/renderAttachmentList.js +25 -25
  27. package/lib/components/AttachmentList/useAttachmentList.js +113 -124
  28. package/lib/components/AttachmentList/useAttachmentListContextValues.js +10 -15
  29. package/lib/components/AttachmentList/useAttachmentListStyles.styles.raw.js +44 -0
  30. package/lib/components/AttachmentList/useAttachmentListStyles.styles.raw.js.map +1 -0
  31. package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +8 -9
  32. package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +1 -2
  33. package/lib/components/AttachmentOverflowMenu/index.js +0 -1
  34. package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +8 -13
  35. package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +9 -15
  36. package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +10 -15
  37. package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +5 -6
  38. package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +1 -2
  39. package/lib/components/AttachmentOverflowMenuButton/index.js +0 -1
  40. package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +11 -10
  41. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +51 -59
  42. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js +102 -0
  43. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js.map +1 -0
  44. package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +4 -5
  45. package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +1 -2
  46. package/lib/components/AttachmentOverflowMenuItem/index.js +0 -1
  47. package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +9 -8
  48. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +41 -49
  49. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +57 -0
  50. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
  51. package/lib/components/index.js +0 -1
  52. package/lib/components/utils/useProgressBarStyles.styles.raw.js +42 -0
  53. package/lib/components/utils/useProgressBarStyles.styles.raw.js.map +1 -0
  54. package/lib/contexts/attachmentListContext.js +4 -5
  55. package/lib/contexts/attachmentOverflowMenuContext.js +4 -5
  56. package/lib/index.js +0 -1
  57. package/lib-commonjs/AgentTag.js +0 -1
  58. package/lib-commonjs/Attachment.js +0 -1
  59. package/lib-commonjs/AttachmentList.js +0 -1
  60. package/lib-commonjs/AttachmentOverflowMenu.js +0 -1
  61. package/lib-commonjs/AttachmentOverflowMenuButton.js +0 -1
  62. package/lib-commonjs/AttachmentOverflowMenuItem.js +0 -1
  63. package/lib-commonjs/components/AgentTag/AgentTag.js +1 -1
  64. package/lib-commonjs/components/AgentTag/AgentTag.js.map +1 -1
  65. package/lib-commonjs/components/AgentTag/AgentTag.types.js +0 -1
  66. package/lib-commonjs/components/AgentTag/index.js +0 -1
  67. package/lib-commonjs/components/AgentTag/renderAgentTag.js +1 -1
  68. package/lib-commonjs/components/AgentTag/renderAgentTag.js.map +1 -1
  69. package/lib-commonjs/components/AgentTag/useAgentTag.js +1 -1
  70. package/lib-commonjs/components/AgentTag/useAgentTag.js.map +1 -1
  71. package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.raw.js +82 -0
  72. package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.raw.js.map +1 -0
  73. package/lib-commonjs/components/Attachment/Attachment.js +1 -1
  74. package/lib-commonjs/components/Attachment/Attachment.js.map +1 -1
  75. package/lib-commonjs/components/Attachment/Attachment.types.js +0 -1
  76. package/lib-commonjs/components/Attachment/index.js +0 -1
  77. package/lib-commonjs/components/Attachment/renderAttachment.js +1 -1
  78. package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -1
  79. package/lib-commonjs/components/Attachment/useAttachment.js +1 -1
  80. package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -1
  81. package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js +336 -0
  82. package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -0
  83. package/lib-commonjs/components/AttachmentList/AttachmentList.js +1 -1
  84. package/lib-commonjs/components/AttachmentList/AttachmentList.js.map +1 -1
  85. package/lib-commonjs/components/AttachmentList/AttachmentList.types.js +0 -1
  86. package/lib-commonjs/components/AttachmentList/index.js +0 -1
  87. package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +1 -1
  88. package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -1
  89. package/lib-commonjs/components/AttachmentList/useAttachmentList.js +1 -1
  90. package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -1
  91. package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js +1 -1
  92. package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js.map +1 -1
  93. package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.raw.js +60 -0
  94. package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.raw.js.map +1 -0
  95. package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +1 -1
  96. package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js.map +1 -1
  97. package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +0 -1
  98. package/lib-commonjs/components/AttachmentOverflowMenu/index.js +0 -1
  99. package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +1 -1
  100. package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js.map +1 -1
  101. package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +1 -1
  102. package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js.map +1 -1
  103. package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +1 -1
  104. package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map +1 -1
  105. package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +1 -1
  106. package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -1
  107. package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +0 -1
  108. package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js +0 -1
  109. package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +1 -1
  110. package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -1
  111. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +1 -1
  112. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
  113. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js +118 -0
  114. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js.map +1 -0
  115. package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +1 -1
  116. package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js.map +1 -1
  117. package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +0 -1
  118. package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js +0 -1
  119. package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +1 -1
  120. package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -1
  121. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +1 -1
  122. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -1
  123. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +73 -0
  124. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
  125. package/lib-commonjs/components/index.js +0 -1
  126. package/lib-commonjs/components/utils/useProgressBarStyles.styles.raw.js +50 -0
  127. package/lib-commonjs/components/utils/useProgressBarStyles.styles.raw.js.map +1 -0
  128. package/lib-commonjs/contexts/attachmentListContext.js +1 -1
  129. package/lib-commonjs/contexts/attachmentListContext.js.map +1 -1
  130. package/lib-commonjs/contexts/attachmentOverflowMenuContext.js +1 -1
  131. package/lib-commonjs/contexts/attachmentOverflowMenuContext.js.map +1 -1
  132. package/lib-commonjs/index.js +0 -1
  133. package/package.json +10 -10
package/CHANGELOG.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "@fluentui-copilot/react-attachments",
3
3
  "entries": [
4
+ {
5
+ "date": "Thu, 17 Jul 2025 17:47:35 GMT",
6
+ "tag": "@fluentui-copilot/react-attachments_v0.13.3",
7
+ "version": "0.13.3",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "hochelmartin@gmail.com",
12
+ "package": "@fluentui-copilot/react-attachments",
13
+ "commit": "fef5160c07333e8d9996952a305b34e357604919",
14
+ "comment": "feat: enable griffel raw styles"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Tue, 01 Jul 2025 14:45:27 GMT",
21
+ "tag": "@fluentui-copilot/react-attachments_v0.13.2",
22
+ "version": "0.13.2",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "jiangemma@microsoft.com",
27
+ "package": "@fluentui-copilot/react-attachments",
28
+ "commit": "c9607d83ec7c4f592e563a391e0e7fa87af24929",
29
+ "comment": "Bump v9 to ^9.66.0"
30
+ },
31
+ {
32
+ "author": "jiangemma@microsoft.com",
33
+ "package": "@fluentui-copilot/react-attachments",
34
+ "commit": "93c39ced303a2ffdb20764a1d1a1595a12b4ae27",
35
+ "comment": "chore: Bump v9 to 9.66.0 dependency deduplication followup"
36
+ }
37
+ ]
38
+ }
39
+ },
4
40
  {
5
41
  "date": "Thu, 12 Jun 2025 17:50:57 GMT",
6
42
  "tag": "@fluentui-copilot/react-attachments_v0.13.0",
package/CHANGELOG.md CHANGED
@@ -1,9 +1,28 @@
1
1
  # Change Log - @fluentui-copilot/react-attachments
2
2
 
3
- This log was last generated on Thu, 12 Jun 2025 17:50:57 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 17 Jul 2025 17:47:35 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [0.13.3](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.13.3)
8
+
9
+ Thu, 17 Jul 2025 17:47:35 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.13.2..@fluentui-copilot/react-attachments_v0.13.3)
11
+
12
+ ### Patches
13
+
14
+ - feat: enable griffel raw styles ([PR #3227](https://github.com/microsoft/fluentai/pull/3227) by hochelmartin@gmail.com)
15
+
16
+ ## [0.13.2](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.13.2)
17
+
18
+ Tue, 01 Jul 2025 14:45:27 GMT
19
+ [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.13.0..@fluentui-copilot/react-attachments_v0.13.2)
20
+
21
+ ### Patches
22
+
23
+ - Bump v9 to ^9.66.0 ([PR #3169](https://github.com/microsoft/fluentai/pull/3169) by jiangemma@microsoft.com)
24
+ - chore: Bump v9 to 9.66.0 dependency deduplication followup ([PR #3176](https://github.com/microsoft/fluentai/pull/3176) by jiangemma@microsoft.com)
25
+
7
26
  ## [0.13.0](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.13.0)
8
27
 
9
28
  Thu, 12 Jun 2025 17:50:57 GMT
package/lib/AgentTag.js CHANGED
@@ -1,2 +1 @@
1
1
  export { AgentTag, renderAgentTag_unstable, useAgentTag_unstable, agentTagClassNames, useAgentTagStyles_unstable } from './components/AgentTag/index';
2
- //# sourceMappingURL=AgentTag.js.map
package/lib/Attachment.js CHANGED
@@ -1,2 +1 @@
1
1
  export { Attachment, attachmentClassNames, renderAttachment_unstable, useAttachmentStyles_unstable, useAttachment_unstable, useOverflowStyles } from './components/Attachment/index';
2
- //# sourceMappingURL=Attachment.js.map
@@ -1,2 +1 @@
1
1
  export { AttachmentList, attachmentListClassNames, renderAttachmentList_unstable, useAttachmentListStyles_unstable, useAttachmentList_unstable } from './components/AttachmentList/index';
2
- //# sourceMappingURL=AttachmentList.js.map
@@ -1,2 +1 @@
1
1
  export { AttachmentOverflowMenu, renderAttachmentOverflowMenu_unstable, useAttachmentOverflowMenuContextValues_unstable, useAttachmentOverflowMenu_unstable } from './components/AttachmentOverflowMenu/index';
2
- //# sourceMappingURL=AttachmentOverflowMenu.js.map
@@ -1,2 +1 @@
1
1
  export { AttachmentOverflowMenuButton, attachmentOverflowMenuButtonClassNames, renderAttachmentOverflowMenuButton_unstable, useAttachmentOverflowMenuButtonStyles_unstable, useAttachmentOverflowMenuButton_unstable } from './components/AttachmentOverflowMenuButton/index';
2
- //# sourceMappingURL=AttachmentOverflowMenuButton.js.map
@@ -1,2 +1 @@
1
1
  export { AttachmentOverflowMenuItem, attachmentOverflowMenuItemClassNames, renderAttachmentOverflowMenuItem_unstable, useAttachmentOverflowMenuItemStyles_unstable, useAttachmentOverflowMenuItem_unstable } from './components/AttachmentOverflowMenuItem/index';
2
- //# sourceMappingURL=AttachmentOverflowMenuItem.js.map
@@ -3,10 +3,9 @@ import { useAgentTag_unstable } from './useAgentTag';
3
3
  import { renderAgentTag_unstable } from './renderAgentTag';
4
4
  import { useAgentTagStyles_unstable } from './useAgentTagStyles.styles';
5
5
  // AgentTag component - TODO: add more docs
6
- export const AgentTag = /*#__PURE__*/React.forwardRef((props, ref) => {
7
- const state = useAgentTag_unstable(props, ref);
8
- useAgentTagStyles_unstable(state);
9
- return renderAgentTag_unstable(state);
6
+ export const AgentTag = /*#__PURE__*/ React.forwardRef((props, ref)=>{
7
+ const state = useAgentTag_unstable(props, ref);
8
+ useAgentTagStyles_unstable(state);
9
+ return renderAgentTag_unstable(state);
10
10
  });
11
11
  AgentTag.displayName = 'AgentTag';
12
- //# sourceMappingURL=AgentTag.js.map
@@ -1,4 +1,3 @@
1
1
  /**
2
2
  * State used in rendering AgentTag
3
- */export {};
4
- //# sourceMappingURL=AgentTag.types.js.map
3
+ */ export { };
@@ -2,4 +2,3 @@ export { AgentTag } from './AgentTag';
2
2
  export { renderAgentTag_unstable } from './renderAgentTag';
3
3
  export { useAgentTag_unstable } from './useAgentTag';
4
4
  export { agentTagClassNames, useAgentTagStyles_unstable } from './useAgentTagStyles.styles';
5
- //# sourceMappingURL=index.js.map
@@ -1,8 +1,6 @@
1
- import { renderAttachment_unstable } from '../Attachment';
1
+ import { renderAttachment_unstable } from '../Attachment';
2
2
  /**
3
3
  * Render the final JSX of AgentTag
4
- */
5
- export const renderAgentTag_unstable = state => {
6
- return renderAttachment_unstable(state);
4
+ */ export const renderAgentTag_unstable = (state)=>{
5
+ return renderAttachment_unstable(state);
7
6
  };
8
- //# sourceMappingURL=renderAgentTag.js.map
@@ -8,13 +8,11 @@ import { useAttachment_unstable } from '..';
8
8
  *
9
9
  * @param props - props from this instance of AgentTag
10
10
  * @param ref - reference to root HTMLElement of AgentTag
11
- */
12
- export const useAgentTag_unstable = (props, ref) => {
13
- const state = useAttachment_unstable({
14
- ...props,
15
- dismissOnly: true,
16
- designVersion: 'next'
17
- }, ref);
18
- return state;
11
+ */ export const useAgentTag_unstable = (props, ref)=>{
12
+ const state = useAttachment_unstable({
13
+ ...props,
14
+ dismissOnly: true,
15
+ designVersion: 'next'
16
+ }, ref);
17
+ return state;
19
18
  };
20
- //# sourceMappingURL=useAgentTag.js.map
@@ -0,0 +1,66 @@
1
+ import { makeStyles, mergeClasses } from '@fluentui/react-components';
2
+ import { useAttachmentStyles_unstable } from '..';
3
+ import { tokens, typographyStyles } from '@fluentui-copilot/tokens';
4
+ export const agentTagClassNames = {
5
+ root: 'fai-AgentTag',
6
+ primaryAction: 'fai-AgentTag__primaryAction',
7
+ dismissIcon: 'fai-AgentTag__dismissIcon',
8
+ dismissButton: 'fai-AgentTag__dismissButton',
9
+ media: 'fai-AgentTag__media',
10
+ content: 'fai-AgentTag__content',
11
+ progress: 'fai-AgentTag__progress'
12
+ };
13
+ const useMediaStyles = makeStyles({
14
+ canvas: {
15
+ width: '24px',
16
+ height: '24px'
17
+ },
18
+ sidecar: {
19
+ width: '20px',
20
+ height: '20px'
21
+ }
22
+ });
23
+ const useContentStyles = makeStyles({
24
+ canvas: {
25
+ ...typographyStyles.subtitle2,
26
+ color: tokens.colorNeutralForeground2
27
+ },
28
+ sidecar: {
29
+ ...typographyStyles.body1Strong,
30
+ color: tokens.colorNeutralForeground2
31
+ }
32
+ });
33
+ const useDismissButtonStyles = makeStyles({
34
+ canvas: {
35
+ borderRadius: tokens.borderRadius2XL,
36
+ paddingLeft: tokens.spacingHorizontalL,
37
+ paddingRight: tokens.spacingHorizontalM
38
+ },
39
+ sidecar: {
40
+ paddingLeft: tokens.spacingHorizontalM,
41
+ paddingRight: tokens.spacingHorizontalS,
42
+ borderRadius: tokens.borderRadiusXLarge
43
+ }
44
+ });
45
+ /**
46
+ * Apply styling to the AgentTag slots based on the state
47
+ */ export const useAgentTagStyles_unstable = (state)=>{
48
+ 'use no memo';
49
+ const { mode } = state;
50
+ const contentStyles = useContentStyles();
51
+ const dismissButtonStyles = useDismissButtonStyles();
52
+ const mediaStyles = useMediaStyles();
53
+ state.root.className = mergeClasses(agentTagClassNames.root, state.root.className);
54
+ state.primaryAction.className = mergeClasses(agentTagClassNames.primaryAction, state.primaryAction.className);
55
+ state.dismissIcon.className = mergeClasses(agentTagClassNames.dismissIcon, state.dismissIcon.className);
56
+ state.dismissButton.className = mergeClasses(agentTagClassNames.dismissButton, dismissButtonStyles[mode], state.dismissButton.className);
57
+ if (state.media) {
58
+ state.media.className = mergeClasses(agentTagClassNames.media, mediaStyles[mode], state.media.className);
59
+ }
60
+ state.content.className = mergeClasses(agentTagClassNames.content, contentStyles[mode], state.content.className);
61
+ if (state.progress) {
62
+ state.progress.className = mergeClasses(agentTagClassNames.progress, state.progress.className);
63
+ }
64
+ useAttachmentStyles_unstable(state);
65
+ return state;
66
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useAgentTagStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-components';\nimport type { AgentTagSlots, AgentTagState } from './AgentTag.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\nimport { useAttachmentStyles_unstable } from '..';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\n\nexport const agentTagClassNames: SlotClassNames<AgentTagSlots> = {\n root: 'fai-AgentTag',\n primaryAction: 'fai-AgentTag__primaryAction',\n dismissIcon: 'fai-AgentTag__dismissIcon',\n dismissButton: 'fai-AgentTag__dismissButton',\n media: 'fai-AgentTag__media',\n content: 'fai-AgentTag__content',\n progress: 'fai-AgentTag__progress',\n};\n\nconst useMediaStyles = makeStyles({\n canvas: {\n width: '24px',\n height: '24px',\n },\n sidecar: { width: '20px', height: '20px' },\n});\n\nconst useContentStyles = makeStyles({\n canvas: {\n ...typographyStyles.subtitle2,\n color: tokens.colorNeutralForeground2,\n },\n sidecar: {\n ...typographyStyles.body1Strong,\n color: tokens.colorNeutralForeground2,\n },\n});\n\nconst useDismissButtonStyles = makeStyles({\n canvas: {\n borderRadius: tokens.borderRadius2XL,\n paddingLeft: tokens.spacingHorizontalL,\n paddingRight: tokens.spacingHorizontalM,\n },\n sidecar: {\n paddingLeft: tokens.spacingHorizontalM,\n paddingRight: tokens.spacingHorizontalS,\n borderRadius: tokens.borderRadiusXLarge,\n },\n});\n\n/**\n * Apply styling to the AgentTag slots based on the state\n */\nexport const useAgentTagStyles_unstable = (state: AgentTagState): AgentTagState => {\n 'use no memo';\n\n const { mode } = state;\n\n const contentStyles = useContentStyles();\n const dismissButtonStyles = useDismissButtonStyles();\n const mediaStyles = useMediaStyles();\n\n state.root.className = mergeClasses(agentTagClassNames.root, state.root.className);\n\n state.primaryAction.className = mergeClasses(agentTagClassNames.primaryAction, state.primaryAction.className);\n\n state.dismissIcon.className = mergeClasses(agentTagClassNames.dismissIcon, state.dismissIcon.className);\n\n state.dismissButton.className = mergeClasses(\n agentTagClassNames.dismissButton,\n dismissButtonStyles[mode],\n state.dismissButton.className,\n );\n\n if (state.media) {\n state.media.className = mergeClasses(agentTagClassNames.media, mediaStyles[mode], state.media.className);\n }\n\n state.content.className = mergeClasses(agentTagClassNames.content, contentStyles[mode], state.content.className);\n\n if (state.progress) {\n state.progress.className = mergeClasses(agentTagClassNames.progress, state.progress.className);\n }\n\n useAttachmentStyles_unstable(state);\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","useAttachmentStyles_unstable","tokens","typographyStyles","agentTagClassNames","root","primaryAction","dismissIcon","dismissButton","media","content","progress","useMediaStyles","canvas","width","height","sidecar","useContentStyles","subtitle2","color","colorNeutralForeground2","body1Strong","useDismissButtonStyles","borderRadius","borderRadius2XL","paddingLeft","spacingHorizontalL","paddingRight","spacingHorizontalM","spacingHorizontalS","borderRadiusXLarge","useAgentTagStyles_unstable","state","mode","contentStyles","dismissButtonStyles","mediaStyles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,QAAQ,6BAA6B;AAGtE,SAASC,4BAA4B,QAAQ,KAAK;AAClD,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,2BAA2B;AAEpE,OAAO,MAAMC,qBAAoD;IAC/DC,MAAM;IACNC,eAAe;IACfC,aAAa;IACbC,eAAe;IACfC,OAAO;IACPC,SAAS;IACTC,UAAU;AACZ,EAAE;AAEF,MAAMC,iBAAiBb,WAAW;IAChCc,QAAQ;QACNC,OAAO;QACPC,QAAQ;IACV;IACAC,SAAS;QAAEF,OAAO;QAAQC,QAAQ;IAAO;AAC3C;AAEA,MAAME,mBAAmBlB,WAAW;IAClCc,QAAQ;QACN,GAAGV,iBAAiBe,SAAS;QAC7BC,OAAOjB,OAAOkB,uBAAuB;IACvC;IACAJ,SAAS;QACP,GAAGb,iBAAiBkB,WAAW;QAC/BF,OAAOjB,OAAOkB,uBAAuB;IACvC;AACF;AAEA,MAAME,yBAAyBvB,WAAW;IACxCc,QAAQ;QACNU,cAAcrB,OAAOsB,eAAe;QACpCC,aAAavB,OAAOwB,kBAAkB;QACtCC,cAAczB,OAAO0B,kBAAkB;IACzC;IACAZ,SAAS;QACPS,aAAavB,OAAO0B,kBAAkB;QACtCD,cAAczB,OAAO2B,kBAAkB;QACvCN,cAAcrB,OAAO4B,kBAAkB;IACzC;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzC;IAEA,MAAM,EAAEC,IAAI,EAAE,GAAGD;IAEjB,MAAME,gBAAgBjB;IACtB,MAAMkB,sBAAsBb;IAC5B,MAAMc,cAAcxB;IAEpBoB,MAAM3B,IAAI,CAACgC,SAAS,GAAGrC,aAAaI,mBAAmBC,IAAI,EAAE2B,MAAM3B,IAAI,CAACgC,SAAS;IAEjFL,MAAM1B,aAAa,CAAC+B,SAAS,GAAGrC,aAAaI,mBAAmBE,aAAa,EAAE0B,MAAM1B,aAAa,CAAC+B,SAAS;IAE5GL,MAAMzB,WAAW,CAAC8B,SAAS,GAAGrC,aAAaI,mBAAmBG,WAAW,EAAEyB,MAAMzB,WAAW,CAAC8B,SAAS;IAEtGL,MAAMxB,aAAa,CAAC6B,SAAS,GAAGrC,aAC9BI,mBAAmBI,aAAa,EAChC2B,mBAAmB,CAACF,KAAK,EACzBD,MAAMxB,aAAa,CAAC6B,SAAS;IAG/B,IAAIL,MAAMvB,KAAK,EAAE;QACfuB,MAAMvB,KAAK,CAAC4B,SAAS,GAAGrC,aAAaI,mBAAmBK,KAAK,EAAE2B,WAAW,CAACH,KAAK,EAAED,MAAMvB,KAAK,CAAC4B,SAAS;IACzG;IAEAL,MAAMtB,OAAO,CAAC2B,SAAS,GAAGrC,aAAaI,mBAAmBM,OAAO,EAAEwB,aAAa,CAACD,KAAK,EAAED,MAAMtB,OAAO,CAAC2B,SAAS;IAE/G,IAAIL,MAAMrB,QAAQ,EAAE;QAClBqB,MAAMrB,QAAQ,CAAC0B,SAAS,GAAGrC,aAAaI,mBAAmBO,QAAQ,EAAEqB,MAAMrB,QAAQ,CAAC0B,SAAS;IAC/F;IAEApC,6BAA6B+B;IAE7B,OAAOA;AACT,EAAE"}
@@ -4,11 +4,10 @@ import { renderAttachment_unstable } from './renderAttachment';
4
4
  import { useAttachmentStyles_unstable } from './useAttachmentStyles.styles';
5
5
  import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
6
6
  // Attachment component - TODO: add more docs
7
- export const Attachment = /*#__PURE__*/React.forwardRef((props, ref) => {
8
- const state = useAttachment_unstable(props, ref);
9
- useAttachmentStyles_unstable(state);
10
- useCustomStyleHook('useAttachmentStyles')(state);
11
- return renderAttachment_unstable(state);
7
+ export const Attachment = /*#__PURE__*/ React.forwardRef((props, ref)=>{
8
+ const state = useAttachment_unstable(props, ref);
9
+ useAttachmentStyles_unstable(state);
10
+ useCustomStyleHook('useAttachmentStyles')(state);
11
+ return renderAttachment_unstable(state);
12
12
  });
13
13
  Attachment.displayName = 'Attachment';
14
- //# sourceMappingURL=Attachment.js.map
@@ -1,4 +1,3 @@
1
1
  /**
2
2
  * State used in rendering Attachment
3
- */export {};
4
- //# sourceMappingURL=Attachment.types.js.map
3
+ */ export { };
@@ -2,4 +2,3 @@ export { Attachment } from './Attachment';
2
2
  export { renderAttachment_unstable } from './renderAttachment';
3
3
  export { useAttachment_unstable } from './useAttachment';
4
4
  export { attachmentClassNames, useAttachmentStyles_unstable, useOverflowStyles } from './useAttachmentStyles.styles';
5
- //# sourceMappingURL=index.js.map
@@ -1,37 +1,42 @@
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 { OverflowItem, assertSlots } from '@fluentui/react-components';
3
3
  /**
4
4
  * Render the final JSX of Attachment
5
- */
6
- export const renderAttachment_unstable = state => {
7
- const {
8
- id,
9
- shouldUseOverflow,
10
- designVersion,
11
- dismissOnly
12
- } = state;
13
- const attachment = designVersion === 'next' && dismissOnly ? renderDismissOnly(state) : renderAttachment(state);
14
- return shouldUseOverflow ? /*#__PURE__*/_jsx(OverflowItem, {
15
- id: id,
16
- children: attachment
17
- }, id) : attachment;
5
+ */ export const renderAttachment_unstable = (state)=>{
6
+ const { id, shouldUseOverflow, designVersion, dismissOnly } = state;
7
+ const attachment = designVersion === 'next' && dismissOnly ? renderDismissOnly(state) : renderAttachment(state);
8
+ return shouldUseOverflow ? /*#__PURE__*/ _jsx(OverflowItem, {
9
+ id: id,
10
+ children: attachment
11
+ }, id) : attachment;
18
12
  };
19
- const renderAttachment = state => {
20
- assertSlots(state);
21
- return /*#__PURE__*/_jsxs(state.root, {
22
- children: [/*#__PURE__*/_jsxs(state.primaryAction, {
23
- children: [state.media && !state.imageOnly && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.content, {}), state.progress && /*#__PURE__*/_jsx(state.progress, {})]
24
- }), /*#__PURE__*/_jsx(state.dismissButton, {
25
- children: /*#__PURE__*/_jsx(state.dismissIcon, {})
26
- })]
27
- });
13
+ const renderAttachment = (state)=>{
14
+ assertSlots(state);
15
+ return /*#__PURE__*/ _jsxs(state.root, {
16
+ children: [
17
+ /*#__PURE__*/ _jsxs(state.primaryAction, {
18
+ children: [
19
+ state.media && !state.imageOnly && /*#__PURE__*/ _jsx(state.media, {}),
20
+ /*#__PURE__*/ _jsx(state.content, {}),
21
+ state.progress && /*#__PURE__*/ _jsx(state.progress, {})
22
+ ]
23
+ }),
24
+ /*#__PURE__*/ _jsx(state.dismissButton, {
25
+ children: /*#__PURE__*/ _jsx(state.dismissIcon, {})
26
+ })
27
+ ]
28
+ });
28
29
  };
29
- const renderDismissOnly = state => {
30
- assertSlots(state);
31
- return /*#__PURE__*/_jsx(state.root, {
32
- children: /*#__PURE__*/_jsxs(state.dismissButton, {
33
- children: [state.media && !state.imageOnly && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.content, {}), state.progress && /*#__PURE__*/_jsx(state.progress, {}), /*#__PURE__*/_jsx(state.dismissIcon, {})]
34
- })
35
- });
30
+ const renderDismissOnly = (state)=>{
31
+ assertSlots(state);
32
+ return /*#__PURE__*/ _jsx(state.root, {
33
+ children: /*#__PURE__*/ _jsxs(state.dismissButton, {
34
+ children: [
35
+ state.media && !state.imageOnly && /*#__PURE__*/ _jsx(state.media, {}),
36
+ /*#__PURE__*/ _jsx(state.content, {}),
37
+ state.progress && /*#__PURE__*/ _jsx(state.progress, {}),
38
+ /*#__PURE__*/ _jsx(state.dismissIcon, {})
39
+ ]
40
+ })
41
+ });
36
42
  };
37
- //# sourceMappingURL=renderAttachment.js.map
@@ -11,100 +11,90 @@ import { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provid
11
11
  *
12
12
  * @param props - props from this instance of Attachment
13
13
  * @param ref - reference to root HTMLElement of Attachment
14
- */
15
- export const useAttachment_unstable = (props, ref) => {
16
- const {
17
- children,
18
- imageOnly,
19
- size = 'medium',
20
- dismissOnly = false
21
- } = props;
22
- const {
23
- onAttachmentDismiss,
24
- shouldUseOverflow
25
- } = useAttachmentListContext_unstable(context => context);
26
- const attachmentId = useId('attachment-', props.id);
27
- const isLoading = !!props.progress;
28
- const mode = useCopilotMode(props.mode);
29
- const designVersion = useDesignVersion(props.designVersion);
30
- const root = slot.always(getIntrinsicElementProps('div', {
31
- ref,
32
- ...props,
33
- id: attachmentId
34
- }), {
35
- elementType: 'div'
36
- });
37
- const primaryAction = slot.always(props.primaryAction, {
38
- defaultProps: {
39
- as: dismissOnly ? 'span' : undefined
40
- },
41
- elementType: 'button'
42
- });
43
- const dismissButton = slot.always(props.dismissButton, {
44
- defaultProps: {
45
- 'aria-label': 'Remove attachment'
46
- },
47
- elementType: 'button'
48
- });
49
- dismissButton.onClick = mergeCallbacks(dismissButton.onClick, ev => {
50
- onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
51
- content: children,
52
- media,
53
- id: attachmentId
14
+ */ export const useAttachment_unstable = (props, ref)=>{
15
+ const { children, imageOnly, size = 'medium', dismissOnly = false } = props;
16
+ const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable((context)=>context);
17
+ const attachmentId = useId('attachment-', props.id);
18
+ const isLoading = !!props.progress;
19
+ const mode = useCopilotMode(props.mode);
20
+ const designVersion = useDesignVersion(props.designVersion);
21
+ const root = slot.always(getIntrinsicElementProps('div', {
22
+ ref,
23
+ ...props,
24
+ id: attachmentId
25
+ }), {
26
+ elementType: 'div'
54
27
  });
55
- });
56
- const media = slot.optional(props.media, {
57
- elementType: 'span'
58
- });
59
- const content = slot.always(props.content, {
60
- defaultProps: {
61
- children: props.children
62
- },
63
- elementType: 'span'
64
- });
65
- const dismissIcon = slot.always(props.dismissIcon, {
66
- defaultProps: {
67
- children: size === 'small' ? /*#__PURE__*/React.createElement(Dismiss12Regular, null) : /*#__PURE__*/React.createElement(Dismiss20Regular, null)
68
- },
69
- elementType: 'span'
70
- });
71
- const progress = slot.optional(props.progress, {
72
- defaultProps: {
73
- shape: 'square',
74
- thickness: 'large',
75
- 'aria-labelledby': props.id
76
- },
77
- elementType: ProgressBar
78
- });
79
- const state = {
80
- id: attachmentId,
81
- size,
82
- components: {
83
- root: 'div',
84
- primaryAction: 'button',
85
- dismissButton: 'button',
86
- media: 'span',
87
- content: 'span',
88
- dismissIcon: 'span',
89
- progress: ProgressBar
90
- },
91
- root,
92
- primaryAction,
93
- dismissButton,
94
- media,
95
- content,
96
- dismissIcon,
97
- progress,
98
- imageOnly,
99
- isLoading,
100
- shouldUseOverflow,
101
- mode,
102
- designVersion,
103
- dismissOnly
104
- };
105
- if (state.primaryAction.as === 'span') {
106
- state.components.primaryAction = 'span';
107
- }
108
- return state;
28
+ const primaryAction = slot.always(props.primaryAction, {
29
+ defaultProps: {
30
+ as: dismissOnly ? 'span' : undefined
31
+ },
32
+ elementType: 'button'
33
+ });
34
+ const dismissButton = slot.always(props.dismissButton, {
35
+ defaultProps: {
36
+ 'aria-label': 'Remove attachment'
37
+ },
38
+ elementType: 'button'
39
+ });
40
+ dismissButton.onClick = mergeCallbacks(dismissButton.onClick, (ev)=>{
41
+ onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
42
+ content: children,
43
+ media,
44
+ id: attachmentId
45
+ });
46
+ });
47
+ const media = slot.optional(props.media, {
48
+ elementType: 'span'
49
+ });
50
+ const content = slot.always(props.content, {
51
+ defaultProps: {
52
+ children: props.children
53
+ },
54
+ elementType: 'span'
55
+ });
56
+ const dismissIcon = slot.always(props.dismissIcon, {
57
+ defaultProps: {
58
+ children: size === 'small' ? /*#__PURE__*/ React.createElement(Dismiss12Regular, null) : /*#__PURE__*/ React.createElement(Dismiss20Regular, null)
59
+ },
60
+ elementType: 'span'
61
+ });
62
+ const progress = slot.optional(props.progress, {
63
+ defaultProps: {
64
+ shape: 'square',
65
+ thickness: 'large',
66
+ 'aria-labelledby': props.id
67
+ },
68
+ elementType: ProgressBar
69
+ });
70
+ const state = {
71
+ id: attachmentId,
72
+ size,
73
+ components: {
74
+ root: 'div',
75
+ primaryAction: 'button',
76
+ dismissButton: 'button',
77
+ media: 'span',
78
+ content: 'span',
79
+ dismissIcon: 'span',
80
+ progress: ProgressBar
81
+ },
82
+ root,
83
+ primaryAction,
84
+ dismissButton,
85
+ media,
86
+ content,
87
+ dismissIcon,
88
+ progress,
89
+ imageOnly,
90
+ isLoading,
91
+ shouldUseOverflow,
92
+ mode,
93
+ designVersion,
94
+ dismissOnly
95
+ };
96
+ if (state.primaryAction.as === 'span') {
97
+ state.components.primaryAction = 'span';
98
+ }
99
+ return state;
109
100
  };
110
- //# sourceMappingURL=useAttachment.js.map