@fluentui-copilot/react-attachments 0.10.7 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +29 -0
- package/CHANGELOG.md +15 -1
- package/dist/index.d.ts +10 -5
- package/lib/components/Attachment/Attachment.js +2 -0
- package/lib/components/Attachment/Attachment.js.map +1 -1
- package/lib/components/Attachment/Attachment.types.js.map +1 -1
- package/lib/components/Attachment/useAttachment.js +6 -1
- package/lib/components/Attachment/useAttachment.js.map +1 -1
- package/lib/components/Attachment/useAttachmentStyles.styles.js +51 -4
- package/lib/components/Attachment/useAttachmentStyles.styles.js.map +1 -1
- package/lib/components/AttachmentList/AttachmentList.js +2 -0
- package/lib/components/AttachmentList/AttachmentList.js.map +1 -1
- package/lib/components/AttachmentList/AttachmentList.types.js.map +1 -1
- package/lib/components/AttachmentList/renderAttachmentList.js +4 -14
- package/lib/components/AttachmentList/renderAttachmentList.js.map +1 -1
- package/lib/components/AttachmentList/useAttachmentList.js +23 -5
- package/lib/components/AttachmentList/useAttachmentList.js.map +1 -1
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.js +10 -1
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +2 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +6 -1
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +39 -2
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -1
- package/lib/components/AttachmentTag/useAttachmentTagStyles.styles.js +2 -1
- package/lib/components/AttachmentTag/useAttachmentTagStyles.styles.js.map +1 -1
- package/lib/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.js +2 -1
- package/lib/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.js.map +1 -1
- package/lib/components/AttachmentTagList/useAttachmentTagListStyles.styles.js +2 -1
- package/lib/components/AttachmentTagList/useAttachmentTagListStyles.styles.js.map +1 -1
- package/lib/components/utils/useProgressBarStyles.styles.js +5 -5
- package/lib/components/utils/useProgressBarStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Attachment/Attachment.js +2 -0
- package/lib-commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/Attachment.types.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachment.js +6 -1
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js +88 -9
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/AttachmentList.js +2 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +4 -13
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js +22 -4
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.js +8 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +2 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +6 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +47 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AttachmentTag/useAttachmentTagStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItemStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagList/useAttachmentTagListStyles.styles.js.map +1 -1
- package/lib-commonjs/components/utils/useProgressBarStyles.styles.js +4 -4
- package/lib-commonjs/components/utils/useProgressBarStyles.styles.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-attachments",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Thu, 20 Mar 2025 17:00:44 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-attachments_v0.11.0",
|
|
7
|
+
"version": "0.11.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "tristan.watanabe@gmail.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
13
|
+
"commit": "acea64a0cbcc519d30a93b74d7a4711fd78618c7",
|
|
14
|
+
"comment": "feat: menuList and menuPopover are now dedicated slots to allow for customizability."
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"patch": [
|
|
18
|
+
{
|
|
19
|
+
"author": "owcampbe@microsoft.com",
|
|
20
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
21
|
+
"commit": "20c56b1c4a0f93db76fc8b348ccb86b563c364d6",
|
|
22
|
+
"comment": "feat: Add support for customStyleHooks to Attachment, AttachmentList, and AttachmentOverflowMenuButton."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"author": "makotom@microsoft.com",
|
|
26
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
27
|
+
"commit": "9958f308833b5b38dd8afdaf5505f87aca5d3961",
|
|
28
|
+
"comment": "chore: Updating imports of tokens to be imported from @fluentui-copilot/tokens instead of from @fluentui/react-components."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
4
33
|
{
|
|
5
34
|
"date": "Tue, 18 Feb 2025 22:28:02 GMT",
|
|
6
35
|
"tag": "@fluentui-copilot/react-attachments_v0.10.6",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-attachments
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 20 Mar 2025 17:00:44 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.11.0](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.11.0)
|
|
8
|
+
|
|
9
|
+
Thu, 20 Mar 2025 17:00:44 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.10.6..@fluentui-copilot/react-attachments_v0.11.0)
|
|
11
|
+
|
|
12
|
+
### Minor changes
|
|
13
|
+
|
|
14
|
+
- feat: menuList and menuPopover are now dedicated slots to allow for customizability. ([PR #2727](https://github.com/microsoft/fluentai/pull/2727) by tristan.watanabe@gmail.com)
|
|
15
|
+
|
|
16
|
+
### Patches
|
|
17
|
+
|
|
18
|
+
- feat: Add support for customStyleHooks to Attachment, AttachmentList, and AttachmentOverflowMenuButton. ([PR #2786](https://github.com/microsoft/fluentai/pull/2786) by owcampbe@microsoft.com)
|
|
19
|
+
- chore: Updating imports of tokens to be imported from @fluentui-copilot/tokens instead of from @fluentui/react-components. ([PR #2745](https://github.com/microsoft/fluentai/pull/2745) by makotom@microsoft.com)
|
|
20
|
+
|
|
7
21
|
## [0.10.6](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.10.6)
|
|
8
22
|
|
|
9
23
|
Tue, 18 Feb 2025 22:28:02 GMT
|
package/dist/index.d.ts
CHANGED
|
@@ -4,10 +4,14 @@ import type { ComponentProps } from '@fluentui/react-components';
|
|
|
4
4
|
import type { ComponentState } from '@fluentui/react-components';
|
|
5
5
|
import type { Context } from '@fluentui/react-context-selector';
|
|
6
6
|
import type { ContextSelector } from '@fluentui/react-context-selector';
|
|
7
|
+
import { CopilotMode } from '@fluentui-copilot/react-provider';
|
|
8
|
+
import { DesignVersion } from '@fluentui-copilot/react-provider';
|
|
7
9
|
import { FC } from 'react';
|
|
8
10
|
import type { ForwardRefComponent } from '@fluentui/react-components';
|
|
9
11
|
import type { MenuContextValues } from '@fluentui/react-components';
|
|
10
12
|
import type { MenuItem } from '@fluentui/react-components';
|
|
13
|
+
import type { MenuList } from '@fluentui/react-components';
|
|
14
|
+
import type { MenuPopover } from '@fluentui/react-components';
|
|
11
15
|
import type { MenuProps } from '@fluentui/react-components';
|
|
12
16
|
import type { MenuSlots } from '@fluentui/react-components';
|
|
13
17
|
import type { MenuState } from '@fluentui/react-components';
|
|
@@ -68,6 +72,8 @@ export declare const AttachmentListProvider: Provider<AttachmentListContextValue
|
|
|
68
72
|
|
|
69
73
|
export declare type AttachmentListSlots = {
|
|
70
74
|
root: Slot<'div'>;
|
|
75
|
+
menuList?: Slot<typeof MenuList>;
|
|
76
|
+
menuPopover?: Slot<typeof MenuPopover>;
|
|
71
77
|
/**
|
|
72
78
|
* An AttachmentList has an overflow menu when `maxVisibleAttachments` is exceeded.
|
|
73
79
|
* Adding a custom button for the overflow menu is supported.
|
|
@@ -79,7 +85,6 @@ export declare type AttachmentListSlots = {
|
|
|
79
85
|
* State used in rendering AttachmentList
|
|
80
86
|
*/
|
|
81
87
|
export declare type AttachmentListState = ComponentState<AttachmentListSlots> & Pick<AttachmentListProps, 'onAttachmentDismiss' | 'overflowMenuProps'> & {
|
|
82
|
-
attachments: AttachmentProps[];
|
|
83
88
|
shouldUseOverflow: boolean;
|
|
84
89
|
};
|
|
85
90
|
|
|
@@ -92,7 +97,7 @@ export declare const attachmentOverflowMenuButtonClassNames: SlotClassNames<Atta
|
|
|
92
97
|
/**
|
|
93
98
|
* AttachmentOverflowMenuButton Props
|
|
94
99
|
*/
|
|
95
|
-
export declare type AttachmentOverflowMenuButtonProps = ComponentProps<Partial<AttachmentOverflowMenuButtonSlots>> & {
|
|
100
|
+
export declare type AttachmentOverflowMenuButtonProps = ComponentProps<Partial<AttachmentOverflowMenuButtonSlots>> & CopilotMode & DesignVersion & {
|
|
96
101
|
/**
|
|
97
102
|
* Toggle prop to indicate that there are Attachments in the overflow menu that's currently loading.
|
|
98
103
|
* Setting this to true will show an indeterminate progress bar on the button.
|
|
@@ -110,7 +115,7 @@ export declare type AttachmentOverflowMenuButtonSlots = {
|
|
|
110
115
|
/**
|
|
111
116
|
* State used in rendering AttachmentOverflowMenuButton
|
|
112
117
|
*/
|
|
113
|
-
export declare type AttachmentOverflowMenuButtonState = ComponentState<AttachmentOverflowMenuButtonSlots> & Pick<AttachmentOverflowMenuState, 'isOverflowing' | 'overflowCount'> & Pick<AttachmentOverflowMenuButtonProps, 'isLoading'>;
|
|
118
|
+
export declare type AttachmentOverflowMenuButtonState = ComponentState<AttachmentOverflowMenuButtonSlots> & Pick<AttachmentOverflowMenuState, 'isOverflowing' | 'overflowCount'> & Pick<AttachmentOverflowMenuButtonProps, 'isLoading'> & Pick<Required<AttachmentOverflowMenuButtonProps>, 'designVersion' | 'mode'>;
|
|
114
119
|
|
|
115
120
|
export declare const AttachmentOverflowMenuContext: Context<AttachmentOverflowMenuContextValue>;
|
|
116
121
|
|
|
@@ -165,7 +170,7 @@ export declare type AttachmentOverflowMenuState = MenuState & {
|
|
|
165
170
|
/**
|
|
166
171
|
* Attachment Props
|
|
167
172
|
*/
|
|
168
|
-
export declare type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & {
|
|
173
|
+
export declare type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & CopilotMode & DesignVersion & {
|
|
169
174
|
/**
|
|
170
175
|
* Use this prop if an attachment has no text content.
|
|
171
176
|
*
|
|
@@ -211,7 +216,7 @@ export declare type AttachmentSlots = {
|
|
|
211
216
|
/**
|
|
212
217
|
* State used in rendering Attachment
|
|
213
218
|
*/
|
|
214
|
-
export declare type AttachmentState = ComponentState<AttachmentSlots> & Required<Pick<AttachmentProps, 'id' | 'size'>> & Pick<AttachmentProps, 'imageOnly'> & {
|
|
219
|
+
export declare type AttachmentState = ComponentState<AttachmentSlots> & Required<Pick<AttachmentProps, 'id' | 'size' | 'designVersion' | 'mode'>> & Pick<AttachmentProps, 'imageOnly'> & {
|
|
215
220
|
isLoading: boolean;
|
|
216
221
|
shouldUseOverflow: boolean;
|
|
217
222
|
};
|
|
@@ -2,10 +2,12 @@ import * as React from 'react';
|
|
|
2
2
|
import { useAttachment_unstable } from './useAttachment';
|
|
3
3
|
import { renderAttachment_unstable } from './renderAttachment';
|
|
4
4
|
import { useAttachmentStyles_unstable } from './useAttachmentStyles.styles';
|
|
5
|
+
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
5
6
|
// Attachment component - TODO: add more docs
|
|
6
7
|
export const Attachment = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
8
|
const state = useAttachment_unstable(props, ref);
|
|
8
9
|
useAttachmentStyles_unstable(state);
|
|
10
|
+
useCustomStyleHook('useAttachmentStyles')(state);
|
|
9
11
|
return renderAttachment_unstable(state);
|
|
10
12
|
});
|
|
11
13
|
Attachment.displayName = 'Attachment';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Attachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachment_unstable } from './useAttachment';\nimport { renderAttachment_unstable } from './renderAttachment';\nimport { useAttachmentStyles_unstable } from './useAttachmentStyles.styles';\nimport type { AttachmentProps } from './Attachment.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// Attachment component - TODO: add more docs\nexport const Attachment: ForwardRefComponent<AttachmentProps> = React.forwardRef((props, ref) => {\n const state = useAttachment_unstable(props, ref);\n\n useAttachmentStyles_unstable(state);\n return renderAttachment_unstable(state);\n});\n\nAttachment.displayName = 'Attachment';\n"],"names":["React","useAttachment_unstable","renderAttachment_unstable","useAttachmentStyles_unstable","Attachment","forwardRef","props","ref","state","displayName"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["Attachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachment_unstable } from './useAttachment';\nimport { renderAttachment_unstable } from './renderAttachment';\nimport { useAttachmentStyles_unstable } from './useAttachmentStyles.styles';\nimport type { AttachmentProps } from './Attachment.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\n// Attachment component - TODO: add more docs\nexport const Attachment: ForwardRefComponent<AttachmentProps> = React.forwardRef((props, ref) => {\n const state = useAttachment_unstable(props, ref);\n\n useAttachmentStyles_unstable(state);\n useCustomStyleHook('useAttachmentStyles')(state);\n\n return renderAttachment_unstable(state);\n});\n\nAttachment.displayName = 'Attachment';\n"],"names":["React","useAttachment_unstable","renderAttachment_unstable","useAttachmentStyles_unstable","useCustomStyleHook","Attachment","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,+BAA+B;AAG5E,SAASC,kBAAkB,QAAQ,mCAAmC;AAEtE,6CAA6C;AAC7C,OAAO,MAAMC,2BAAmDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,QAAQR,uBAAuBM,OAAOC;IAE5CL,6BAA6BM;IAC7BL,mBAAmB,uBAAuBK;IAE1C,OAAOP,0BAA0BO;AACnC,GAAG;AAEHJ,WAAWK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Attachment.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, ProgressBar, Slot } from '@fluentui/react-components';\n\nexport type AttachmentSlots = {\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Attachments support a primary action.\n */\n primaryAction: NonNullable<Slot<'button', 'span'>>;\n\n /**\n * Attachments have a dismiss button.\n */\n dismissButton: NonNullable<Slot<'button'>>;\n\n /**\n * Attachments can include an image or other media.\n */\n media?: Slot<'span'>;\n\n /**\n * The content of the attachment.\n */\n content: NonNullable<Slot<'span'>>;\n\n /**\n * The icon that renders for the `dismissButton`.\n */\n dismissIcon: NonNullable<Slot<'span'>>;\n\n /**\n * An attachment supports a progress bar, which can display the attachment's upload progress.\n */\n progress?: Slot<typeof ProgressBar>;\n};\n\n/**\n * Attachment Props\n */\nexport type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & {\n
|
|
1
|
+
{"version":3,"sources":["Attachment.types.ts"],"sourcesContent":["import type { CopilotMode, DesignVersion } from '@fluentui-copilot/react-provider';\nimport type { ComponentProps, ComponentState, ProgressBar, Slot } from '@fluentui/react-components';\n\nexport type AttachmentSlots = {\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Attachments support a primary action.\n */\n primaryAction: NonNullable<Slot<'button', 'span'>>;\n\n /**\n * Attachments have a dismiss button.\n */\n dismissButton: NonNullable<Slot<'button'>>;\n\n /**\n * Attachments can include an image or other media.\n */\n media?: Slot<'span'>;\n\n /**\n * The content of the attachment.\n */\n content: NonNullable<Slot<'span'>>;\n\n /**\n * The icon that renders for the `dismissButton`.\n */\n dismissIcon: NonNullable<Slot<'span'>>;\n\n /**\n * An attachment supports a progress bar, which can display the attachment's upload progress.\n */\n progress?: Slot<typeof ProgressBar>;\n};\n\n/**\n * Attachment Props\n */\nexport type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> &\n CopilotMode &\n DesignVersion & {\n /**\n * Use this prop if an attachment has no text content.\n *\n * @default false\n */\n imageOnly?: boolean;\n\n /**\n * An attachment supports different sizes.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium';\n };\n\n/**\n * State used in rendering Attachment\n */\nexport type AttachmentState = ComponentState<AttachmentSlots> &\n Required<Pick<AttachmentProps, 'id' | 'size' | 'designVersion' | 'mode'>> &\n Pick<AttachmentProps, 'imageOnly'> & {\n isLoading: boolean;\n shouldUseOverflow: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AA0DA;;CAEC,GACD,WAKI"}
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';
|
|
3
3
|
import { Dismiss12Regular, Dismiss20Regular } from '@fluentui/react-icons';
|
|
4
4
|
import { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';
|
|
5
|
+
import { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';
|
|
5
6
|
/**
|
|
6
7
|
* Create the state required to render Attachment.
|
|
7
8
|
*
|
|
@@ -23,6 +24,8 @@ export const useAttachment_unstable = (props, ref) => {
|
|
|
23
24
|
} = useAttachmentListContext_unstable(context => context);
|
|
24
25
|
const attachmentId = useId('attachment-', props.id);
|
|
25
26
|
const isLoading = !!props.progress;
|
|
27
|
+
const mode = useCopilotMode(props.mode);
|
|
28
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
26
29
|
const root = slot.always(getIntrinsicElementProps('div', {
|
|
27
30
|
ref,
|
|
28
31
|
...props,
|
|
@@ -90,7 +93,9 @@ export const useAttachment_unstable = (props, ref) => {
|
|
|
90
93
|
progress,
|
|
91
94
|
imageOnly,
|
|
92
95
|
isLoading,
|
|
93
|
-
shouldUseOverflow
|
|
96
|
+
shouldUseOverflow,
|
|
97
|
+
mode,
|
|
98
|
+
designVersion
|
|
94
99
|
};
|
|
95
100
|
if (state.primaryAction.as === 'span') {
|
|
96
101
|
state.components.primaryAction = 'span';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss12Regular, Dismiss20Regular } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps, AttachmentState } from './Attachment.types';\n\n/**\n * Create the state required to render Attachment.\n *\n * The returned state can be modified with hooks such as useAttachmentStyles_unstable,\n * before being passed to renderAttachment_unstable.\n *\n * @param props - props from this instance of Attachment\n * @param ref - reference to root HTMLElement of Attachment\n */\nexport const useAttachment_unstable = (props: AttachmentProps, ref: React.Ref<HTMLDivElement>): AttachmentState => {\n const { children, imageOnly, size = 'medium' } = props;\n const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable(context => context);\n const attachmentId = useId('attachment-', props.id);\n const isLoading = !!props.progress;\n\n const root = slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n id: attachmentId,\n }),\n { elementType: 'div' },\n );\n\n const primaryAction = slot.always(props.primaryAction, {\n elementType: 'button',\n });\n\n const dismissButton = slot.always(props.dismissButton, {\n defaultProps: { 'aria-label': 'Remove attachment' },\n elementType: 'button',\n });\n\n dismissButton.onClick = mergeCallbacks(\n dismissButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n (ev: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n onAttachmentDismiss?.(ev, { content: children, media, id: attachmentId });\n },\n );\n\n const media = slot.optional(props.media, { elementType: 'span' });\n\n const content = slot.always(props.content, {\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n });\n\n const dismissIcon = slot.always(props.dismissIcon, {\n defaultProps: {\n children: size === 'small' ? <Dismiss12Regular /> : <Dismiss20Regular />,\n },\n elementType: 'span',\n });\n\n const progress = slot.optional(props.progress, {\n defaultProps: {\n shape: 'square',\n thickness: 'large',\n 'aria-labelledby': props.id,\n },\n elementType: ProgressBar,\n });\n\n const state: AttachmentState = {\n id: attachmentId,\n size,\n components: {\n root: 'div',\n primaryAction: 'button',\n dismissButton: 'button',\n media: 'span',\n content: 'span',\n dismissIcon: 'span',\n progress: ProgressBar,\n },\n\n root,\n primaryAction,\n dismissButton,\n media,\n content,\n dismissIcon,\n progress,\n imageOnly,\n isLoading,\n shouldUseOverflow,\n };\n\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n\n return state;\n};\n"],"names":["React","ProgressBar","getIntrinsicElementProps","mergeCallbacks","slot","useId","Dismiss12Regular","Dismiss20Regular","useAttachmentListContext_unstable","useAttachment_unstable","props","ref","children","imageOnly","size","onAttachmentDismiss","shouldUseOverflow","context","attachmentId","id","isLoading","progress","root","always","elementType","primaryAction","dismissButton","defaultProps","onClick","ev","content","media","optional","dismissIcon","shape","thickness","state","components","as"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss12Regular, Dismiss20Regular } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps, AttachmentState } from './Attachment.types';\nimport { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';\n\n/**\n * Create the state required to render Attachment.\n *\n * The returned state can be modified with hooks such as useAttachmentStyles_unstable,\n * before being passed to renderAttachment_unstable.\n *\n * @param props - props from this instance of Attachment\n * @param ref - reference to root HTMLElement of Attachment\n */\nexport const useAttachment_unstable = (props: AttachmentProps, ref: React.Ref<HTMLDivElement>): AttachmentState => {\n const { children, imageOnly, size = 'medium' } = props;\n const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable(context => context);\n const attachmentId = useId('attachment-', props.id);\n const isLoading = !!props.progress;\n\n const mode = useCopilotMode(props.mode);\n const designVersion = useDesignVersion(props.designVersion);\n\n const root = slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n id: attachmentId,\n }),\n { elementType: 'div' },\n );\n\n const primaryAction = slot.always(props.primaryAction, {\n elementType: 'button',\n });\n\n const dismissButton = slot.always(props.dismissButton, {\n defaultProps: { 'aria-label': 'Remove attachment' },\n elementType: 'button',\n });\n\n dismissButton.onClick = mergeCallbacks(\n dismissButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n (ev: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n onAttachmentDismiss?.(ev, { content: children, media, id: attachmentId });\n },\n );\n\n const media = slot.optional(props.media, { elementType: 'span' });\n\n const content = slot.always(props.content, {\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n });\n\n const dismissIcon = slot.always(props.dismissIcon, {\n defaultProps: {\n children: size === 'small' ? <Dismiss12Regular /> : <Dismiss20Regular />,\n },\n elementType: 'span',\n });\n\n const progress = slot.optional(props.progress, {\n defaultProps: {\n shape: 'square',\n thickness: 'large',\n 'aria-labelledby': props.id,\n },\n elementType: ProgressBar,\n });\n\n const state: AttachmentState = {\n id: attachmentId,\n size,\n components: {\n root: 'div',\n primaryAction: 'button',\n dismissButton: 'button',\n media: 'span',\n content: 'span',\n dismissIcon: 'span',\n progress: ProgressBar,\n },\n\n root,\n primaryAction,\n dismissButton,\n media,\n content,\n dismissIcon,\n progress,\n imageOnly,\n isLoading,\n shouldUseOverflow,\n mode,\n designVersion,\n };\n\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n\n return state;\n};\n"],"names":["React","ProgressBar","getIntrinsicElementProps","mergeCallbacks","slot","useId","Dismiss12Regular","Dismiss20Regular","useAttachmentListContext_unstable","useCopilotMode","useDesignVersion","useAttachment_unstable","props","ref","children","imageOnly","size","onAttachmentDismiss","shouldUseOverflow","context","attachmentId","id","isLoading","progress","mode","designVersion","root","always","elementType","primaryAction","dismissButton","defaultProps","onClick","ev","content","media","optional","dismissIcon","shape","thickness","state","components","as"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,WAAW,EAAEC,wBAAwB,EAAEC,cAAc,EAAEC,IAAI,EAAEC,KAAK,QAAQ,6BAA6B;AAChH,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,wBAAwB;AAC3E,SAASC,iCAAiC,QAAQ,uCAAuC;AAEzF,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,mCAAmC;AAEpF;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAyB,CAACC,OAAwBC;IAC7D,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,OAAO,QAAQ,EAAE,GAAGJ;IACjD,MAAM,EAAEK,mBAAmB,EAAEC,iBAAiB,EAAE,GAAGV,kCAAkCW,CAAAA,UAAWA;IAChG,MAAMC,eAAef,MAAM,eAAeO,MAAMS,EAAE;IAClD,MAAMC,YAAY,CAAC,CAACV,MAAMW,QAAQ;IAElC,MAAMC,OAAOf,eAAeG,MAAMY,IAAI;IACtC,MAAMC,gBAAgBf,iBAAiBE,MAAMa,aAAa;IAE1D,MAAMC,OAAOtB,KAAKuB,MAAM,CACtBzB,yBAAyB,OAAO;QAC9BW;QACA,GAAGD,KAAK;QACRS,IAAID;IACN,IACA;QAAEQ,aAAa;IAAM;IAGvB,MAAMC,gBAAgBzB,KAAKuB,MAAM,CAACf,MAAMiB,aAAa,EAAE;QACrDD,aAAa;IACf;IAEA,MAAME,gBAAgB1B,KAAKuB,MAAM,CAACf,MAAMkB,aAAa,EAAE;QACrDC,cAAc;YAAE,cAAc;QAAoB;QAClDH,aAAa;IACf;IAEAE,cAAcE,OAAO,GAAG7B,eACtB2B,cAAcE,OAAO,EACrB,CAACC;QACChB,gCAAAA,0CAAAA,oBAAsBgB,IAAI;YAAEC,SAASpB;YAAUqB;YAAOd,IAAID;QAAa;IACzE;IAGF,MAAMe,QAAQ/B,KAAKgC,QAAQ,CAACxB,MAAMuB,KAAK,EAAE;QAAEP,aAAa;IAAO;IAE/D,MAAMM,UAAU9B,KAAKuB,MAAM,CAACf,MAAMsB,OAAO,EAAE;QACzCH,cAAc;YACZjB,UAAUF,MAAME,QAAQ;QAC1B;QACAc,aAAa;IACf;IAEA,MAAMS,cAAcjC,KAAKuB,MAAM,CAACf,MAAMyB,WAAW,EAAE;QACjDN,cAAc;YACZjB,UAAUE,SAAS,wBAAU,oBAACV,wCAAsB,oBAACC;QACvD;QACAqB,aAAa;IACf;IAEA,MAAML,WAAWnB,KAAKgC,QAAQ,CAACxB,MAAMW,QAAQ,EAAE;QAC7CQ,cAAc;YACZO,OAAO;YACPC,WAAW;YACX,mBAAmB3B,MAAMS,EAAE;QAC7B;QACAO,aAAa3B;IACf;IAEA,MAAMuC,QAAyB;QAC7BnB,IAAID;QACJJ;QACAyB,YAAY;YACVf,MAAM;YACNG,eAAe;YACfC,eAAe;YACfK,OAAO;YACPD,SAAS;YACTG,aAAa;YACbd,UAAUtB;QACZ;QAEAyB;QACAG;QACAC;QACAK;QACAD;QACAG;QACAd;QACAR;QACAO;QACAJ;QACAM;QACAC;IACF;IAEA,IAAIe,MAAMX,aAAa,CAACa,EAAE,KAAK,QAAQ;QACrCF,MAAMC,UAAU,CAACZ,aAAa,GAAG;IACnC;IAEA,OAAOW;AACT,EAAE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { createCustomFocusIndicatorStyle, __resetStyles, __styles, mergeClasses, slot,
|
|
1
|
+
import { createCustomFocusIndicatorStyle, __resetStyles, __styles, mergeClasses, slot, typographyStyles } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
2
3
|
import { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';
|
|
3
4
|
export const attachmentClassNames = {
|
|
4
5
|
root: 'fai-Attachment',
|
|
@@ -125,6 +126,48 @@ const useSmallStyles = __styles({
|
|
|
125
126
|
p: -1
|
|
126
127
|
}], ".fatynhj{max-width:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);}", ".fydhda{min-width:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);}", ".fzi9ji0{height:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingVerticalXXS));}", ".f11qte0n{max-width:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS));}", ".fy1a5sw{min-width:calc(16px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS));}"]
|
|
127
128
|
});
|
|
129
|
+
const usePrimaryActionNextStyles = __styles({
|
|
130
|
+
root: {
|
|
131
|
+
Btl43ni: ["f8yange", "f1el4m67"],
|
|
132
|
+
Beyfa6y: ["fc7yr5o", "fnivh3a"]
|
|
133
|
+
},
|
|
134
|
+
canvas: {
|
|
135
|
+
Byoj8tv: 0,
|
|
136
|
+
uwmqm3: 0,
|
|
137
|
+
z189sj: 0,
|
|
138
|
+
z8tnut: 0,
|
|
139
|
+
B0ocmuz: "fpi12dx"
|
|
140
|
+
},
|
|
141
|
+
sidecar: {
|
|
142
|
+
Byoj8tv: 0,
|
|
143
|
+
uwmqm3: 0,
|
|
144
|
+
z189sj: 0,
|
|
145
|
+
z8tnut: 0,
|
|
146
|
+
B0ocmuz: "fgucwci"
|
|
147
|
+
}
|
|
148
|
+
}, {
|
|
149
|
+
d: [".f8yange{border-top-left-radius:var(--borderRadiusXLarge);}", ".f1el4m67{border-top-right-radius:var(--borderRadiusXLarge);}", ".fc7yr5o{border-bottom-left-radius:var(--borderRadiusXLarge);}", ".fnivh3a{border-bottom-right-radius:var(--borderRadiusXLarge);}", [".fpi12dx{padding:calc(var(--spacingVerticalS) - var(--strokeWidthThin)) var(--spacingHorizontalS) calc(var(--spacingVerticalS) - var(--strokeWidthThin)) var(--spacingHorizontalS);}", {
|
|
150
|
+
p: -1
|
|
151
|
+
}], [".fgucwci{padding:calc(var(--spacingVerticalXS) - var(--strokeWidthThin)) var(--spacingHorizontalS) calc(var(--spacingVerticalXS) - var(--strokeWidthThin)) var(--spacingHorizontalS);}", {
|
|
152
|
+
p: -1
|
|
153
|
+
}]]
|
|
154
|
+
});
|
|
155
|
+
const useDismissButtonNextStyles = __styles({
|
|
156
|
+
root: {
|
|
157
|
+
B7oj6ja: ["f1el4m67", "f8yange"],
|
|
158
|
+
Bbmb7ep: ["fnivh3a", "fc7yr5o"]
|
|
159
|
+
},
|
|
160
|
+
canvas: {
|
|
161
|
+
Bqenvij: "fbhnoac",
|
|
162
|
+
a9b677: "feqmc2u"
|
|
163
|
+
},
|
|
164
|
+
sidecar: {
|
|
165
|
+
Bqenvij: "f1d2rq10",
|
|
166
|
+
a9b677: "f1szoe96"
|
|
167
|
+
}
|
|
168
|
+
}, {
|
|
169
|
+
d: [".f1el4m67{border-top-right-radius:var(--borderRadiusXLarge);}", ".f8yange{border-top-left-radius:var(--borderRadiusXLarge);}", ".fnivh3a{border-bottom-right-radius:var(--borderRadiusXLarge);}", ".fc7yr5o{border-bottom-left-radius:var(--borderRadiusXLarge);}", ".fbhnoac{height:40px;}", ".feqmc2u{width:40px;}", ".f1d2rq10{height:32px;}", ".f1szoe96{width:32px;}"]
|
|
170
|
+
});
|
|
128
171
|
/**
|
|
129
172
|
* Apply styling to the Attachment slots based on the state
|
|
130
173
|
*/
|
|
@@ -141,14 +184,18 @@ export const useAttachmentStyles_unstable = state => {
|
|
|
141
184
|
const primaryActionStyles = usePrimaryActionStyles();
|
|
142
185
|
const imageOnlyStyles = useImageOnlyStyles();
|
|
143
186
|
const smallStyles = useSmallStyles();
|
|
187
|
+
const primaryActionNextStyles = usePrimaryActionNextStyles();
|
|
188
|
+
const dismissButtonNextStyles = useDismissButtonNextStyles();
|
|
144
189
|
const {
|
|
145
190
|
imageOnly,
|
|
146
191
|
primaryAction,
|
|
147
|
-
size
|
|
192
|
+
size,
|
|
193
|
+
mode,
|
|
194
|
+
designVersion
|
|
148
195
|
} = state;
|
|
149
196
|
state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);
|
|
150
|
-
state.primaryAction.className = mergeClasses(attachmentClassNames.primaryAction, primaryActionBaseClassName, size === 'small' && smallStyles.primaryAction, primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button, imageOnly && imageOnlyStyles.primaryAction, state.primaryAction.className);
|
|
151
|
-
state.dismissButton.className = mergeClasses(attachmentClassNames.dismissButton, dismissButtonBaseClassName, size === 'small' && smallStyles.dismissButton, state.dismissButton.className);
|
|
197
|
+
state.primaryAction.className = mergeClasses(attachmentClassNames.primaryAction, primaryActionBaseClassName, size === 'small' && smallStyles.primaryAction, primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button, imageOnly && imageOnlyStyles.primaryAction, designVersion === 'next' && primaryActionNextStyles.root, designVersion === 'next' && primaryActionNextStyles[mode], state.primaryAction.className);
|
|
198
|
+
state.dismissButton.className = mergeClasses(attachmentClassNames.dismissButton, dismissButtonBaseClassName, size === 'small' && smallStyles.dismissButton, designVersion === 'next' && dismissButtonNextStyles.root, designVersion === 'next' && dismissButtonNextStyles[mode], state.dismissButton.className);
|
|
152
199
|
if (state.media) {
|
|
153
200
|
state.media.className = mergeClasses(attachmentClassNames.media, mediaBaseClassName, size === 'small' && smallStyles.media, state.media.className);
|
|
154
201
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentStyles.styles.ts"],"sourcesContent":["import {\n createCustomFocusIndicatorStyle,\n makeResetStyles,\n makeStyles,\n mergeClasses,\n slot,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\nimport type { AttachmentSlots, AttachmentState } from './Attachment.types';\nimport type { GriffelResetStyle, SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentClassNames: SlotClassNames<AttachmentSlots> = {\n root: 'fai-Attachment',\n primaryAction: 'fai-Attachment__primaryAction',\n dismissButton: 'fai-Attachment__dismissButton',\n media: 'fai-Attachment__media',\n content: 'fai-Attachment__content',\n dismissIcon: 'fai-Attachment__dismissIcon',\n progress: 'fai-Attachment__progress',\n};\n\nconst ATTACHMENT_MAXWIDTH = '180px';\nconst SMALL_ATTACHMENT_SIZE = '16px';\nconst ATTACHMENT_SIZE = '20px';\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n flexWrap: 'nowrap',\n verticalAlign: 'middle',\n boxSizing: 'border-box',\n width: 'fit-content',\n alignSelf: 'end',\n position: 'relative',\n});\n\nconst buttonBaseStyles: GriffelResetStyle = {\n alignItems: 'center',\n backgroundColor: tokens.colorSubtleBackground,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n columnGap: tokens.spacingHorizontalSNudge,\n color: tokens.colorNeutralForeground1,\n cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n justifyContent: 'center',\n ...createCustomFocusIndicatorStyle({\n outline: `${tokens.strokeWidthThick} solid ${tokens.colorStrokeFocus2}`,\n zIndex: 1,\n }),\n verticalAlign: 'middle',\n};\n\nconst usePrimaryActionBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n borderTopRightRadius: tokens.borderRadiusNone,\n borderBottomRightRadius: tokens.borderRadiusNone,\n borderRightStyle: 'none',\n maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS} - ${tokens.spacingHorizontalXS})`,\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`,\n});\n\nconst usePrimaryActionStyles = makeStyles({\n button: {\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n color: tokens.colorNeutralForeground2Pressed,\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n },\n});\n\nconst useDismissButtonBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS}`,\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n\n // divider:\n borderLeftColor: tokens.colorNeutralStroke1,\n borderTopLeftRadius: tokens.borderRadiusNone,\n borderBottomLeftRadius: tokens.borderRadiusNone,\n\n borderTopRightRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground2BrandHover,\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorBrandForegroundLinkHover,\n },\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n ':focus': {\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n});\n\nconst useMediaBaseClassName = makeResetStyles({\n alignItems: 'center',\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: ATTACHMENT_SIZE,\n lineHeight: ATTACHMENT_SIZE,\n width: ATTACHMENT_SIZE,\n});\n\nconst useContentBaseClassName = makeResetStyles({\n overflowX: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n ...typographyStyles.body1,\n});\n\nconst useDismissIconBaseClassName = makeResetStyles({\n alignItems: 'center',\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n justifyContent: 'center',\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n padding: `calc(${tokens.spacingVerticalXXS} / 2) calc(${tokens.spacingHorizontalXXS} / 2)`,\n});\n\nconst useImageOnlyStyles = makeStyles({\n primaryAction: {\n padding: 0,\n },\n content: {\n lineHeight: 0,\n },\n});\n\nexport const useOverflowStyles = makeStyles({\n overflow: {\n maxWidth: '100%',\n width: '100%',\n },\n});\n\nconst useSmallStyles = makeStyles({\n primaryAction: {\n maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS} - ${tokens.spacingHorizontalXS})`,\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalSNudge} ${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalSNudge}`,\n },\n media: {\n fontSize: SMALL_ATTACHMENT_SIZE,\n height: SMALL_ATTACHMENT_SIZE,\n lineHeight: SMALL_ATTACHMENT_SIZE,\n width: SMALL_ATTACHMENT_SIZE,\n },\n content: {\n ...typographyStyles.caption1,\n },\n dismissButton: {\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalXXS}`,\n maxWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n minWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n },\n dismissIcon: {\n fontSize: SMALL_ATTACHMENT_SIZE,\n height: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n maxWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n },\n});\n\n/**\n * Apply styling to the Attachment slots based on the state\n */\nexport const useAttachmentStyles_unstable = (state: AttachmentState): AttachmentState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const primaryActionBaseClassName = usePrimaryActionBaseClassName();\n const dismissButtonBaseClassName = useDismissButtonBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const dismissIconBaseClassName = useDismissIconBaseClassName();\n const progressBarStyles = useProgressBarStyles();\n const primaryActionStyles = usePrimaryActionStyles();\n const imageOnlyStyles = useImageOnlyStyles();\n const smallStyles = useSmallStyles();\n const { imageOnly, primaryAction, size } = state;\n\n state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);\n state.primaryAction.className = mergeClasses(\n attachmentClassNames.primaryAction,\n primaryActionBaseClassName,\n size === 'small' && smallStyles.primaryAction,\n primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button,\n imageOnly && imageOnlyStyles.primaryAction,\n state.primaryAction.className,\n );\n state.dismissButton.className = mergeClasses(\n attachmentClassNames.dismissButton,\n dismissButtonBaseClassName,\n size === 'small' && smallStyles.dismissButton,\n state.dismissButton.className,\n );\n if (state.media) {\n state.media.className = mergeClasses(\n attachmentClassNames.media,\n mediaBaseClassName,\n size === 'small' && smallStyles.media,\n state.media.className,\n );\n }\n state.content.className = mergeClasses(\n attachmentClassNames.content,\n contentBaseClassName,\n size === 'small' && smallStyles.content,\n imageOnly && imageOnlyStyles.content,\n state.content.className,\n );\n state.dismissIcon.className = mergeClasses(\n attachmentClassNames.dismissIcon,\n dismissIconBaseClassName,\n size === 'small' && smallStyles.dismissIcon,\n state.dismissIcon.className,\n );\n\n if (state.progress) {\n state.progress.className = mergeClasses(\n attachmentClassNames.progress,\n progressBarStyles.progress,\n state.progress.className,\n );\n\n const bar = slot.optional(state.progress.bar, { elementType: 'div', renderByDefault: true });\n if (bar) {\n if (state.progress.value === undefined) {\n bar.className = mergeClasses(progressBarStyles.indeterminateProgressBar, bar.className);\n } else {\n bar.className = mergeClasses(progressBarStyles.regularProgressBar, bar.className);\n }\n state.progress.bar = bar;\n }\n }\n\n return state;\n};\n"],"names":["createCustomFocusIndicatorStyle","makeResetStyles","makeStyles","mergeClasses","slot","tokens","typographyStyles","useProgressBarStyles","attachmentClassNames","root","primaryAction","dismissButton","media","content","dismissIcon","progress","ATTACHMENT_MAXWIDTH","SMALL_ATTACHMENT_SIZE","ATTACHMENT_SIZE","useRootBaseClassName","display","flexWrap","verticalAlign","boxSizing","width","alignSelf","position","buttonBaseStyles","alignItems","backgroundColor","colorSubtleBackground","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","columnGap","spacingHorizontalSNudge","color","colorNeutralForeground1","cursor","justifyContent","outline","strokeWidthThick","colorStrokeFocus2","zIndex","usePrimaryActionBaseClassName","borderTopRightRadius","borderRadiusNone","borderBottomRightRadius","borderRightStyle","maxWidth","spacingHorizontalXXS","spacingHorizontalXS","padding","spacingVerticalXS","spacingHorizontalS","usePrimaryActionStyles","button","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","useDismissButtonBaseClassName","minWidth","borderLeftColor","borderTopLeftRadius","borderBottomLeftRadius","colorNeutralForeground2BrandHover","colorBrandForegroundLinkHover","colorNeutralForeground2BrandPressed","useMediaBaseClassName","fontSize","height","lineHeight","useContentBaseClassName","overflowX","textOverflow","whiteSpace","body1","useDismissIconBaseClassName","borderRadiusCircular","colorTransparentStroke","spacingVerticalXXS","useImageOnlyStyles","useOverflowStyles","overflow","useSmallStyles","caption1","useAttachmentStyles_unstable","state","rootBaseClassName","primaryActionBaseClassName","dismissButtonBaseClassName","mediaBaseClassName","contentBaseClassName","dismissIconBaseClassName","progressBarStyles","primaryActionStyles","imageOnlyStyles","smallStyles","imageOnly","size","className","as","isLoading","bar","optional","elementType","renderByDefault","value","undefined","indeterminateProgressBar","regularProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,+BAA+B,EAC/BC,eAAe,EACfC,UAAU,EACVC,YAAY,EACZC,IAAI,EACJC,MAAM,EACNC,gBAAgB,QACX,6BAA6B;AACpC,SAASC,oBAAoB,QAAQ,uCAAuC;AAI5E,OAAO,MAAMC,uBAAwD;IACn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,MAAM3E,QAAQ,CAAC2F,GAAG,GAAGA;QACvB;IACF;IAEA,OAAOhB;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["useAttachmentStyles.styles.ts"],"sourcesContent":["import {\n createCustomFocusIndicatorStyle,\n makeResetStyles,\n makeStyles,\n mergeClasses,\n slot,\n typographyStyles,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\nimport type { AttachmentSlots, AttachmentState } from './Attachment.types';\nimport type { GriffelResetStyle, SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentClassNames: SlotClassNames<AttachmentSlots> = {\n root: 'fai-Attachment',\n primaryAction: 'fai-Attachment__primaryAction',\n dismissButton: 'fai-Attachment__dismissButton',\n media: 'fai-Attachment__media',\n content: 'fai-Attachment__content',\n dismissIcon: 'fai-Attachment__dismissIcon',\n progress: 'fai-Attachment__progress',\n};\n\nconst ATTACHMENT_MAXWIDTH = '180px';\nconst SMALL_ATTACHMENT_SIZE = '16px';\nconst ATTACHMENT_SIZE = '20px';\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n flexWrap: 'nowrap',\n verticalAlign: 'middle',\n boxSizing: 'border-box',\n width: 'fit-content',\n alignSelf: 'end',\n position: 'relative',\n});\n\nconst buttonBaseStyles: GriffelResetStyle = {\n alignItems: 'center',\n backgroundColor: tokens.colorSubtleBackground,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n columnGap: tokens.spacingHorizontalSNudge,\n color: tokens.colorNeutralForeground1,\n cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n justifyContent: 'center',\n ...createCustomFocusIndicatorStyle({\n outline: `${tokens.strokeWidthThick} solid ${tokens.colorStrokeFocus2}`,\n zIndex: 1,\n }),\n verticalAlign: 'middle',\n};\n\nconst usePrimaryActionBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n borderTopRightRadius: tokens.borderRadiusNone,\n borderBottomRightRadius: tokens.borderRadiusNone,\n borderRightStyle: 'none',\n maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS} - ${tokens.spacingHorizontalXS})`,\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS}`,\n});\n\nconst usePrimaryActionStyles = makeStyles({\n button: {\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n color: tokens.colorNeutralForeground2Pressed,\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n },\n});\n\nconst useDismissButtonBaseClassName = makeResetStyles({\n ...buttonBaseStyles,\n\n padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS} ${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS}`,\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n\n // divider:\n borderLeftColor: tokens.colorNeutralStroke1,\n borderTopLeftRadius: tokens.borderRadiusNone,\n borderBottomLeftRadius: tokens.borderRadiusNone,\n\n borderTopRightRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground2BrandHover,\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorBrandForegroundLinkHover,\n },\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n ':focus': {\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n});\n\nconst useMediaBaseClassName = makeResetStyles({\n alignItems: 'center',\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: ATTACHMENT_SIZE,\n lineHeight: ATTACHMENT_SIZE,\n width: ATTACHMENT_SIZE,\n});\n\nconst useContentBaseClassName = makeResetStyles({\n overflowX: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n ...typographyStyles.body1,\n});\n\nconst useDismissIconBaseClassName = makeResetStyles({\n alignItems: 'center',\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n display: 'inline-flex',\n fontSize: ATTACHMENT_SIZE,\n height: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n justifyContent: 'center',\n maxWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n padding: `calc(${tokens.spacingVerticalXXS} / 2) calc(${tokens.spacingHorizontalXXS} / 2)`,\n});\n\nconst useImageOnlyStyles = makeStyles({\n primaryAction: {\n padding: 0,\n },\n content: {\n lineHeight: 0,\n },\n});\n\nexport const useOverflowStyles = makeStyles({\n overflow: {\n maxWidth: '100%',\n width: '100%',\n },\n});\n\nconst useSmallStyles = makeStyles({\n primaryAction: {\n maxWidth: `calc(${ATTACHMENT_MAXWIDTH} - ${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS} - ${tokens.spacingHorizontalXS})`,\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalSNudge} ${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalSNudge}`,\n },\n media: {\n fontSize: SMALL_ATTACHMENT_SIZE,\n height: SMALL_ATTACHMENT_SIZE,\n lineHeight: SMALL_ATTACHMENT_SIZE,\n width: SMALL_ATTACHMENT_SIZE,\n },\n content: {\n ...typographyStyles.caption1,\n },\n dismissButton: {\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalXXS}`,\n maxWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n minWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS}) + ${tokens.spacingHorizontalXS}`,\n },\n dismissIcon: {\n fontSize: SMALL_ATTACHMENT_SIZE,\n height: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingVerticalXXS})`,\n maxWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n minWidth: `calc(${SMALL_ATTACHMENT_SIZE} + ${tokens.strokeWidthThin} * 2 + ${tokens.spacingHorizontalXXS})`,\n },\n});\n\nconst usePrimaryActionNextStyles = makeStyles({\n root: {\n borderTopLeftRadius: tokens.borderRadiusXLarge,\n borderBottomLeftRadius: tokens.borderRadiusXLarge,\n },\n canvas: {\n padding: `calc(${tokens.spacingVerticalS} - ${tokens.strokeWidthThin}) ${tokens.spacingHorizontalS} calc(${tokens.spacingVerticalS} - ${tokens.strokeWidthThin}) ${tokens.spacingHorizontalS}`,\n },\n\n sidecar: {\n padding: `calc(${tokens.spacingVerticalXS} - ${tokens.strokeWidthThin}) ${tokens.spacingHorizontalS} calc(${tokens.spacingVerticalXS} - ${tokens.strokeWidthThin}) ${tokens.spacingHorizontalS}`,\n },\n});\n\nconst useDismissButtonNextStyles = makeStyles({\n root: {\n borderTopRightRadius: tokens.borderRadiusXLarge,\n borderBottomRightRadius: tokens.borderRadiusXLarge,\n },\n canvas: {\n height: '40px',\n width: '40px',\n },\n sidecar: {\n height: '32px',\n width: '32px',\n },\n});\n\n/**\n * Apply styling to the Attachment slots based on the state\n */\nexport const useAttachmentStyles_unstable = (state: AttachmentState): AttachmentState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const primaryActionBaseClassName = usePrimaryActionBaseClassName();\n const dismissButtonBaseClassName = useDismissButtonBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const dismissIconBaseClassName = useDismissIconBaseClassName();\n const progressBarStyles = useProgressBarStyles();\n const primaryActionStyles = usePrimaryActionStyles();\n const imageOnlyStyles = useImageOnlyStyles();\n const smallStyles = useSmallStyles();\n const primaryActionNextStyles = usePrimaryActionNextStyles();\n const dismissButtonNextStyles = useDismissButtonNextStyles();\n const { imageOnly, primaryAction, size, mode, designVersion } = state;\n\n state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);\n state.primaryAction.className = mergeClasses(\n attachmentClassNames.primaryAction,\n primaryActionBaseClassName,\n size === 'small' && smallStyles.primaryAction,\n primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button,\n imageOnly && imageOnlyStyles.primaryAction,\n designVersion === 'next' && primaryActionNextStyles.root,\n designVersion === 'next' && primaryActionNextStyles[mode],\n state.primaryAction.className,\n );\n state.dismissButton.className = mergeClasses(\n attachmentClassNames.dismissButton,\n dismissButtonBaseClassName,\n size === 'small' && smallStyles.dismissButton,\n designVersion === 'next' && dismissButtonNextStyles.root,\n designVersion === 'next' && dismissButtonNextStyles[mode],\n state.dismissButton.className,\n );\n if (state.media) {\n state.media.className = mergeClasses(\n attachmentClassNames.media,\n mediaBaseClassName,\n size === 'small' && smallStyles.media,\n state.media.className,\n );\n }\n state.content.className = mergeClasses(\n attachmentClassNames.content,\n contentBaseClassName,\n size === 'small' && smallStyles.content,\n imageOnly && imageOnlyStyles.content,\n state.content.className,\n );\n state.dismissIcon.className = mergeClasses(\n attachmentClassNames.dismissIcon,\n dismissIconBaseClassName,\n size === 'small' && smallStyles.dismissIcon,\n state.dismissIcon.className,\n );\n\n if (state.progress) {\n state.progress.className = mergeClasses(\n attachmentClassNames.progress,\n progressBarStyles.progress,\n state.progress.className,\n );\n\n const bar = slot.optional(state.progress.bar, { elementType: 'div', renderByDefault: true });\n if (bar) {\n if (state.progress.value === undefined) {\n bar.className = mergeClasses(progressBarStyles.indeterminateProgressBar, bar.className);\n } else {\n bar.className = mergeClasses(progressBarStyles.regularProgressBar, bar.className);\n }\n state.progress.bar = bar;\n }\n }\n\n return state;\n};\n"],"names":["createCustomFocusIndicatorStyle","makeResetStyles","makeStyles","mergeClasses","slot","typographyStyles","tokens","useProgressBarStyles","attachmentClassNames","root","primaryAction","dismissButton","media","content","dismissIcon","progress","ATTACHMENT_MAXWIDTH","SMALL_ATTACHMENT_SIZE","ATTACHMENT_SIZE","useRootBaseClassName","display","flexWrap","verticalAlign","boxSizing","width","alignSelf","position","buttonBaseStyles","alignItems","backgroundColor","colorSubtleBackground","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","columnGap","spacingHorizontalSNudge","color","colorNeutralForeground1","cursor","justifyContent","outline","strokeWidthThick","colorStrokeFocus2","zIndex","usePrimaryActionBaseClassName","borderTopRightRadius","borderRadiusNone","borderBottomRightRadius","borderRightStyle","maxWidth","spacingHorizontalXXS","spacingHorizontalXS","padding","spacingVerticalXS","spacingHorizontalS","usePrimaryActionStyles","button","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","useDismissButtonBaseClassName","minWidth","borderLeftColor","borderTopLeftRadius","borderBottomLeftRadius","colorNeutralForeground2BrandHover","colorBrandForegroundLinkHover","colorNeutralForeground2BrandPressed","useMediaBaseClassName","fontSize","height","lineHeight","useContentBaseClassName","overflowX","textOverflow","whiteSpace","body1","useDismissIconBaseClassName","borderRadiusCircular","colorTransparentStroke","spacingVerticalXXS","useImageOnlyStyles","useOverflowStyles","overflow","useSmallStyles","caption1","usePrimaryActionNextStyles","borderRadiusXLarge","canvas","spacingVerticalS","sidecar","useDismissButtonNextStyles","useAttachmentStyles_unstable","state","rootBaseClassName","primaryActionBaseClassName","dismissButtonBaseClassName","mediaBaseClassName","contentBaseClassName","dismissIconBaseClassName","progressBarStyles","primaryActionStyles","imageOnlyStyles","smallStyles","primaryActionNextStyles","dismissButtonNextStyles","imageOnly","size","mode","designVersion","className","as","isLoading","bar","optional","elementType","renderByDefault","value","undefined","indeterminateProgressBar","regularProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,+BAA+B,EAC/BC,eAAe,EACfC,UAAU,EACVC,YAAY,EACZC,IAAI,EACJC,gBAAgB,QACX,6BAA6B;AACpC,SAASC,MAAM,QAAQ,2BAA2B;AAClD,SAASC,oBAAoB,QAAQ,uCAAuC;AAI5E,OAAO,MAAMC,uBAAwD;IACnEC,MAAM;IACNC,eAAe;IACfC,eAAe;IACfC,OAAO;IACPC,SAAS;IACTC,aAAa;IACbC,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IjB,MAAMpF,KAAK,EAAE;QACfoF,MAAMpF,KAAK,CAACqG,SAAS,GAAG9G,aACtBK,qBAAqBI,KAAK,EAC1BwF,oBACAU,SAAS,WAAWJ,YAAY9F,KAAK,EACrCoF,MAAMpF,KAAK,CAACqG,SAAS;IAEzB;IACAjB,MAAMnF,OAAO,CAACoG,SAAS,GAAG9G,aACxBK,qBAAqBK,OAAO,EAC5BwF,sBACAS,SAAS,WAAWJ,YAAY7F,OAAO,EACvCgG,aAAaJ,gBAAgB5F,OAAO,EACpCmF,MAAMnF,OAAO,CAACoG,SAAS;IAEzBjB,MAAMlF,WAAW,CAACmG,SAAS,GAAG9G,aAC5BK,qBAAqBM,WAAW,EAChCwF,0BACAQ,SAAS,WAAWJ,YAAY5F,WAAW,EAC3CkF,MAAMlF,WAAW,CAACmG,SAAS;IAG7B,IAAIjB,MAAMjF,QAAQ,EAAE;QAClBiF,MAAMjF,QAAQ,CAACkG,SAAS,GAAG9G,aACzBK,qBAAqBO,QAAQ,EAC7BwF,kBAAkBxF,QAAQ,EAC1BiF,MAAMjF,QAAQ,CAACkG,SAAS;QAG1B,MAAMG,MAAMhH,KAAKiH,QAAQ,CAACrB,MAAMjF,QAAQ,CAACqG,GAAG,EAAE;YAAEE,aAAa;YAAOC,iBAAiB;QAAK;QAC1F,IAAIH,KAAK;YACP,IAAIpB,MAAMjF,QAAQ,CAACyG,KAAK,KAAKC,WAAW;gBACtCL,IAAIH,SAAS,GAAG9G,aAAaoG,kBAAkBmB,wBAAwB,EAAEN,IAAIH,SAAS;YACxF,OAAO;gBACLG,IAAIH,SAAS,GAAG9G,aAAaoG,kBAAkBoB,kBAAkB,EAAEP,IAAIH,SAAS;YAClF;YACAjB,MAAMjF,QAAQ,CAACqG,GAAG,GAAGA;QACvB;IACF;IAEA,OAAOpB;AACT,EAAE"}
|
|
@@ -3,10 +3,12 @@ import { useAttachmentList_unstable } from './useAttachmentList';
|
|
|
3
3
|
import { renderAttachmentList_unstable } from './renderAttachmentList';
|
|
4
4
|
import { useAttachmentListStyles_unstable } from './useAttachmentListStyles.styles';
|
|
5
5
|
import { useAttachmentListContextValues_unstable } from './useAttachmentListContextValues';
|
|
6
|
+
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
6
7
|
export const AttachmentList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
8
|
const state = useAttachmentList_unstable(props, ref);
|
|
8
9
|
const contextValues = useAttachmentListContextValues_unstable(state);
|
|
9
10
|
useAttachmentListStyles_unstable(state);
|
|
11
|
+
useCustomStyleHook('useAttachmentListStyles')(state);
|
|
10
12
|
return renderAttachmentList_unstable(state, contextValues);
|
|
11
13
|
});
|
|
12
14
|
AttachmentList.displayName = 'AttachmentList';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AttachmentList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentList_unstable } from './useAttachmentList';\nimport { renderAttachmentList_unstable } from './renderAttachmentList';\nimport { useAttachmentListStyles_unstable } from './useAttachmentListStyles.styles';\nimport { useAttachmentListContextValues_unstable } from './useAttachmentListContextValues';\nimport type { AttachmentListProps } from './AttachmentList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const AttachmentList: ForwardRefComponent<AttachmentListProps> = React.forwardRef((props, ref) => {\n const state = useAttachmentList_unstable(props, ref);\n const contextValues = useAttachmentListContextValues_unstable(state);\n\n useAttachmentListStyles_unstable(state);\n\n return renderAttachmentList_unstable(state, contextValues);\n});\n\nAttachmentList.displayName = 'AttachmentList';\n"],"names":["React","useAttachmentList_unstable","renderAttachmentList_unstable","useAttachmentListStyles_unstable","useAttachmentListContextValues_unstable","AttachmentList","forwardRef","props","ref","state","contextValues","displayName"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["AttachmentList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentList_unstable } from './useAttachmentList';\nimport { renderAttachmentList_unstable } from './renderAttachmentList';\nimport { useAttachmentListStyles_unstable } from './useAttachmentListStyles.styles';\nimport { useAttachmentListContextValues_unstable } from './useAttachmentListContextValues';\nimport type { AttachmentListProps } from './AttachmentList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\nexport const AttachmentList: ForwardRefComponent<AttachmentListProps> = React.forwardRef((props, ref) => {\n const state = useAttachmentList_unstable(props, ref);\n const contextValues = useAttachmentListContextValues_unstable(state);\n\n useAttachmentListStyles_unstable(state);\n useCustomStyleHook('useAttachmentListStyles')(state);\n\n return renderAttachmentList_unstable(state, contextValues);\n});\n\nAttachmentList.displayName = 'AttachmentList';\n"],"names":["React","useAttachmentList_unstable","renderAttachmentList_unstable","useAttachmentListStyles_unstable","useAttachmentListContextValues_unstable","useCustomStyleHook","AttachmentList","forwardRef","props","ref","state","contextValues","displayName"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,mCAAmC;AACpF,SAASC,uCAAuC,QAAQ,mCAAmC;AAG3F,SAASC,kBAAkB,QAAQ,mCAAmC;AAEtE,OAAO,MAAMC,+BAA2DN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQT,2BAA2BO,OAAOC;IAChD,MAAME,gBAAgBP,wCAAwCM;IAE9DP,iCAAiCO;IACjCL,mBAAmB,2BAA2BK;IAE9C,OAAOR,8BAA8BQ,OAAOC;AAC9C,GAAG;AAEHL,eAAeM,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AttachmentList.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { AttachmentListContextValue } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps } from '../Attachment';\nimport type { AttachmentOverflowMenuProps } from '../AttachmentOverflowMenu';\n\nexport type AttachmentListSlots = {\n root: Slot<'div'>;\n\n /**\n * An AttachmentList has an overflow menu when `maxVisibleAttachments` is exceeded.\n * Adding a custom button for the overflow menu is supported.\n */\n overflowMenuButton: Slot<'span'>;\n};\n\nexport type AttachmentDismissedData = {\n content?: AttachmentProps['children'];\n media?: AttachmentProps['media'];\n id?: string;\n};\n\n/**\n * AttachmentList Props\n */\nexport type AttachmentListProps = ComponentProps<Partial<AttachmentListSlots>> & {\n /**\n * Callback fired when an attachment is dismissed.\n */\n onAttachmentDismiss?: (\n e: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>,\n data: AttachmentDismissedData,\n ) => void;\n\n /**\n * Props that will be passed to the overflow menu.\n */\n overflowMenuProps?: Omit<AttachmentOverflowMenuProps, 'children'>;\n\n /**\n * The maximum number of attachments to display before the overflow button is shown even if there is\n * enough space available to show more.\n * If not set, the overflow functionality will be disabled.\n * @default undefined\n */\n maxVisibleAttachments?: number;\n};\n\n/**\n * State used in rendering AttachmentList\n */\nexport type AttachmentListState = ComponentState<AttachmentListSlots> &\n Pick<AttachmentListProps, 'onAttachmentDismiss' | 'overflowMenuProps'> & {\n
|
|
1
|
+
{"version":3,"sources":["AttachmentList.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, MenuList, MenuPopover, Slot } from '@fluentui/react-components';\nimport type { AttachmentListContextValue } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps } from '../Attachment';\nimport type { AttachmentOverflowMenuProps } from '../AttachmentOverflowMenu';\n\nexport type AttachmentListSlots = {\n root: Slot<'div'>;\n menuList?: Slot<typeof MenuList>;\n menuPopover?: Slot<typeof MenuPopover>;\n\n /**\n * An AttachmentList has an overflow menu when `maxVisibleAttachments` is exceeded.\n * Adding a custom button for the overflow menu is supported.\n */\n overflowMenuButton: Slot<'span'>;\n};\n\nexport type AttachmentDismissedData = {\n content?: AttachmentProps['children'];\n media?: AttachmentProps['media'];\n id?: string;\n};\n\n/**\n * AttachmentList Props\n */\nexport type AttachmentListProps = ComponentProps<Partial<AttachmentListSlots>> & {\n /**\n * Callback fired when an attachment is dismissed.\n */\n onAttachmentDismiss?: (\n e: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>,\n data: AttachmentDismissedData,\n ) => void;\n\n /**\n * Props that will be passed to the overflow menu.\n */\n overflowMenuProps?: Omit<AttachmentOverflowMenuProps, 'children'>;\n\n /**\n * The maximum number of attachments to display before the overflow button is shown even if there is\n * enough space available to show more.\n * If not set, the overflow functionality will be disabled.\n * @default undefined\n */\n maxVisibleAttachments?: number;\n};\n\n/**\n * State used in rendering AttachmentList\n */\nexport type AttachmentListState = ComponentState<AttachmentListSlots> &\n Pick<AttachmentListProps, 'onAttachmentDismiss' | 'overflowMenuProps'> & {\n shouldUseOverflow: boolean;\n };\n\nexport type AttachmentListContextValues = {\n attachmentList: AttachmentListContextValue;\n};\n"],"names":[],"rangeMappings":"","mappings":"AAyDA,WAEE"}
|
|
@@ -1,37 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { MenuList, MenuPopover, Overflow, assertSlots } from '@fluentui/react-components';
|
|
2
|
+
import { Overflow, assertSlots } from '@fluentui/react-components';
|
|
4
3
|
import { AttachmentListProvider } from '../../contexts/attachmentListContext';
|
|
5
4
|
import { AttachmentOverflowMenu } from '../AttachmentOverflowMenu';
|
|
6
|
-
import { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';
|
|
7
5
|
/**
|
|
8
6
|
* Render the final JSX of AttachmentList
|
|
9
7
|
*/
|
|
10
8
|
export const renderAttachmentList_unstable = (state, contextValues) => {
|
|
11
9
|
assertSlots(state);
|
|
12
10
|
const {
|
|
13
|
-
attachments,
|
|
14
11
|
overflowMenuProps,
|
|
15
12
|
root,
|
|
16
13
|
shouldUseOverflow
|
|
17
14
|
} = state;
|
|
18
15
|
return /*#__PURE__*/_jsx(AttachmentListProvider, {
|
|
19
16
|
value: contextValues.attachmentList,
|
|
20
|
-
children: shouldUseOverflow && state.overflowMenuButton ? /*#__PURE__*/_jsx(Overflow, {
|
|
17
|
+
children: shouldUseOverflow && state.overflowMenuButton && state.menuList && state.menuPopover ? /*#__PURE__*/_jsx(Overflow, {
|
|
21
18
|
ref: root.ref,
|
|
22
19
|
children: /*#__PURE__*/_jsxs(state.root, {
|
|
23
20
|
children: [root.children, /*#__PURE__*/_jsxs(AttachmentOverflowMenu, {
|
|
24
21
|
positioning: 'above',
|
|
25
22
|
...overflowMenuProps,
|
|
26
|
-
children: [/*#__PURE__*/_jsx(state.overflowMenuButton, {}), /*#__PURE__*/_jsx(
|
|
27
|
-
children: /*#__PURE__*/_jsx(
|
|
28
|
-
children: attachments.map(attachment => {
|
|
29
|
-
return /*#__PURE__*/_createElement(AttachmentOverflowMenuItem, {
|
|
30
|
-
...attachment,
|
|
31
|
-
key: attachment.id
|
|
32
|
-
});
|
|
33
|
-
})
|
|
34
|
-
})
|
|
23
|
+
children: [/*#__PURE__*/_jsx(state.overflowMenuButton, {}), /*#__PURE__*/_jsx(state.menuPopover, {
|
|
24
|
+
children: /*#__PURE__*/_jsx(state.menuList, {})
|
|
35
25
|
})]
|
|
36
26
|
})]
|
|
37
27
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderAttachmentList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport {
|
|
1
|
+
{"version":3,"sources":["renderAttachmentList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Overflow, assertSlots } from '@fluentui/react-components';\nimport { AttachmentListProvider } from '../../contexts/attachmentListContext';\nimport { AttachmentOverflowMenu } from '../AttachmentOverflowMenu';\nimport type { AttachmentListState, AttachmentListSlots, AttachmentListContextValues } from './AttachmentList.types';\n\n/**\n * Render the final JSX of AttachmentList\n */\nexport const renderAttachmentList_unstable = (\n state: AttachmentListState,\n contextValues: AttachmentListContextValues,\n) => {\n assertSlots<AttachmentListSlots>(state);\n const { overflowMenuProps, root, shouldUseOverflow } = state;\n\n return (\n <AttachmentListProvider value={contextValues.attachmentList}>\n {shouldUseOverflow && state.overflowMenuButton && state.menuList && state.menuPopover ? (\n <Overflow ref={root.ref}>\n <state.root>\n {root.children}\n <AttachmentOverflowMenu positioning={'above'} {...overflowMenuProps}>\n <state.overflowMenuButton />\n <state.menuPopover>\n <state.menuList />\n </state.menuPopover>\n </AttachmentOverflowMenu>\n </state.root>\n </Overflow>\n ) : (\n <state.root />\n )}\n </AttachmentListProvider>\n );\n};\n"],"names":["Overflow","assertSlots","AttachmentListProvider","AttachmentOverflowMenu","renderAttachmentList_unstable","state","contextValues","overflowMenuProps","root","shouldUseOverflow","value","attachmentList","overflowMenuButton","menuList","menuPopover","ref","children","positioning"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,QAAQ,EAAEC,WAAW,QAAQ,6BAA6B;AACnE,SAASC,sBAAsB,QAAQ,uCAAuC;AAC9E,SAASC,sBAAsB,QAAQ,4BAA4B;AAGnE;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEAL,YAAiCI;IACjC,MAAM,EAAEE,iBAAiB,EAAEC,IAAI,EAAEC,iBAAiB,EAAE,GAAGJ;IAEvD,qBACE,KAACH;QAAuBQ,OAAOJ,cAAcK,cAAc;kBACxDF,qBAAqBJ,MAAMO,kBAAkB,IAAIP,MAAMQ,QAAQ,IAAIR,MAAMS,WAAW,iBACnF,KAACd;YAASe,KAAKP,KAAKO,GAAG;sBACrB,cAAA,MAACV,MAAMG,IAAI;;oBACRA,KAAKQ,QAAQ;kCACd,MAACb;wBAAuBc,aAAa;wBAAU,GAAGV,iBAAiB;;0CACjE,KAACF,MAAMO,kBAAkB;0CACzB,KAACP,MAAMS,WAAW;0CAChB,cAAA,KAACT,MAAMQ,QAAQ;;;;;;2BAMvB,KAACR,MAAMG,IAAI;;AAInB,EAAE"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { getIntrinsicElementProps, slot, useArrowNavigationGroup, useEventCallback, useFocusFinders, useMergedRefs } from '@fluentui/react-components';
|
|
2
|
+
import { MenuList, MenuPopover, getIntrinsicElementProps, slot, useArrowNavigationGroup, useEventCallback, useFocusFinders, useMergedRefs } from '@fluentui/react-components';
|
|
3
3
|
import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
|
|
4
4
|
import { useTimeout } from '@fluentui/react-utilities';
|
|
5
5
|
import { useOverflowMaxVisibleItems } from '@fluentui-copilot/react-utilities';
|
|
6
6
|
import { useOverflowStyles } from '../Attachment';
|
|
7
7
|
import { AttachmentOverflowMenuButton } from '../AttachmentOverflowMenuButton';
|
|
8
8
|
import { attachmentOverflowMenuButtonClassNames } from '../AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles';
|
|
9
|
+
import { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';
|
|
9
10
|
/**
|
|
10
11
|
* Create the state required to render AttachmentList.
|
|
11
12
|
*
|
|
@@ -32,7 +33,6 @@ export const useAttachmentList_unstable = (props, ref) => {
|
|
|
32
33
|
findPrevFocusable,
|
|
33
34
|
findLastFocusable
|
|
34
35
|
} = useFocusFinders();
|
|
35
|
-
const [attachments, setAttachments] = React.useState([]);
|
|
36
36
|
const handleAttachmentDismiss = useEventCallback((e, data) => {
|
|
37
37
|
var _innerRef_current;
|
|
38
38
|
if (!onAttachmentDismiss) {
|
|
@@ -77,10 +77,16 @@ export const useAttachmentList_unstable = (props, ref) => {
|
|
|
77
77
|
maxVisibleItems: maxVisibleAttachments,
|
|
78
78
|
overflowClassName: styles.overflow
|
|
79
79
|
});
|
|
80
|
-
React.
|
|
80
|
+
const attachmentOverflowMenuItems = React.useMemo(() => {
|
|
81
81
|
if (resolvedChildren && Array.isArray(resolvedChildren)) {
|
|
82
|
-
|
|
82
|
+
return resolvedChildren.filter(child => /*#__PURE__*/React.isValidElement(child)).map(child => child.props).map(attachment => {
|
|
83
|
+
return /*#__PURE__*/React.createElement(AttachmentOverflowMenuItem, {
|
|
84
|
+
...attachment,
|
|
85
|
+
key: attachment.id
|
|
86
|
+
});
|
|
87
|
+
});
|
|
83
88
|
}
|
|
89
|
+
return [];
|
|
84
90
|
}, [resolvedChildren]);
|
|
85
91
|
const arrowNavigationProps = useArrowNavigationGroup({
|
|
86
92
|
circular: true,
|
|
@@ -89,12 +95,13 @@ export const useAttachmentList_unstable = (props, ref) => {
|
|
|
89
95
|
});
|
|
90
96
|
const shouldUseOverflow = maxVisibleAttachments !== undefined;
|
|
91
97
|
return {
|
|
92
|
-
attachments,
|
|
93
98
|
onAttachmentDismiss: handleAttachmentDismiss,
|
|
94
99
|
shouldUseOverflow,
|
|
95
100
|
overflowMenuProps,
|
|
96
101
|
components: {
|
|
97
102
|
root: 'div',
|
|
103
|
+
menuList: MenuList,
|
|
104
|
+
menuPopover: MenuPopover,
|
|
98
105
|
overflowMenuButton: 'span'
|
|
99
106
|
},
|
|
100
107
|
root: slot.always(getIntrinsicElementProps('div', {
|
|
@@ -107,6 +114,17 @@ export const useAttachmentList_unstable = (props, ref) => {
|
|
|
107
114
|
}), {
|
|
108
115
|
elementType: 'div'
|
|
109
116
|
}),
|
|
117
|
+
menuList: slot.optional(props.menuList, {
|
|
118
|
+
defaultProps: {
|
|
119
|
+
children: attachmentOverflowMenuItems
|
|
120
|
+
},
|
|
121
|
+
elementType: MenuList,
|
|
122
|
+
renderByDefault: true
|
|
123
|
+
}),
|
|
124
|
+
menuPopover: slot.optional(props.menuPopover, {
|
|
125
|
+
elementType: MenuPopover,
|
|
126
|
+
renderByDefault: true
|
|
127
|
+
}),
|
|
110
128
|
overflowMenuButton: slot.optional(props.overflowMenuButton, {
|
|
111
129
|
defaultProps: {
|
|
112
130
|
children: /*#__PURE__*/React.createElement(AttachmentOverflowMenuButton, null)
|