@fluentui-copilot/react-attachments 0.9.2 → 0.9.4
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 +31 -1
- package/CHANGELOG.md +20 -2
- package/dist/index.d.ts +37 -8
- package/lib/components/Attachment/Attachment.types.js.map +1 -1
- package/lib/components/Attachment/renderAttachment.js +11 -3
- package/lib/components/Attachment/renderAttachment.js.map +1 -1
- package/lib/components/Attachment/useAttachment.js +32 -8
- package/lib/components/Attachment/useAttachment.js.map +1 -1
- package/lib/components/Attachment/useAttachmentStyles.js +29 -4
- package/lib/components/Attachment/useAttachmentStyles.js.map +1 -1
- package/lib/components/AttachmentList/AttachmentList.types.js.map +1 -1
- package/lib/components/AttachmentList/renderAttachmentList.js +30 -3
- package/lib/components/AttachmentList/renderAttachmentList.js.map +1 -1
- package/lib/components/AttachmentList/useAttachmentList.js +79 -11
- package/lib/components/AttachmentList/useAttachmentList.js.map +1 -1
- package/lib/components/AttachmentList/useAttachmentListContextValues.js +4 -2
- package/lib/components/AttachmentList/useAttachmentListContextValues.js.map +1 -1
- package/lib/components/AttachmentList/useAttachmentListStyles.js +9 -1
- package/lib/components/AttachmentList/useAttachmentListStyles.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +1 -1
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +23 -3
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js +23 -5
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +4 -2
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +32 -9
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js +21 -5
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js.map +1 -1
- package/lib/components/utils/useProgressBarStyles.js +54 -0
- package/lib/components/utils/useProgressBarStyles.js.map +1 -0
- package/lib/contexts/attachmentListContext.js +2 -1
- package/lib/contexts/attachmentListContext.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Attachment/Attachment.types.js.map +1 -1
- package/lib-commonjs/components/Attachment/renderAttachment.js +8 -2
- package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachment.js +28 -8
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachmentStyles.js +34 -4
- package/lib-commonjs/components/Attachment/useAttachmentStyles.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +29 -1
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js +80 -10
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js +3 -2
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.js +9 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +2 -3
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +19 -2
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js +24 -6
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +6 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +29 -8
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js +20 -4
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js.map +1 -1
- package/lib-commonjs/components/utils/useProgressBarStyles.js +103 -0
- package/lib-commonjs/components/utils/useProgressBarStyles.js.map +1 -0
- package/lib-commonjs/contexts/attachmentListContext.js +2 -1
- package/lib-commonjs/contexts/attachmentListContext.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +3 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,37 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-attachments",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Wed,
|
|
5
|
+
"date": "Wed, 15 May 2024 23:57:19 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-attachments_v0.9.4",
|
|
7
|
+
"version": "0.9.4",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "tristan.watanabe@gmail.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
13
|
+
"commit": "719196b7226ff5fae1136731498443024039da0a",
|
|
14
|
+
"comment": "refactor: AttachmentList now has overflow built in."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 14 May 2024 00:38:55 GMT",
|
|
21
|
+
"tag": "@fluentui-copilot/react-attachments_v0.9.3",
|
|
22
|
+
"version": "0.9.3",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "tristan.watanabe@gmail.com",
|
|
27
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
28
|
+
"commit": "c8ce565a74aac1a6837a4d7c19bf42264da2eb6e",
|
|
29
|
+
"comment": "feat: add progress slot to Attachment, AttachmentOverflowMenuButton and AttachmentOverflowMenuItem."
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Wed, 08 May 2024 22:10:20 GMT",
|
|
6
36
|
"tag": "@fluentui-copilot/react-attachments_v0.9.2",
|
|
7
37
|
"version": "0.9.2",
|
|
8
38
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-attachments
|
|
2
2
|
|
|
3
|
-
This log was last generated on Wed,
|
|
3
|
+
This log was last generated on Wed, 15 May 2024 23:57:19 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.9.4](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.9.4)
|
|
8
|
+
|
|
9
|
+
Wed, 15 May 2024 23:57:19 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.9.3..@fluentui-copilot/react-attachments_v0.9.4)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- refactor: AttachmentList now has overflow built in. ([PR #1616](https://github.com/microsoft/fluentai/pull/1616) by tristan.watanabe@gmail.com)
|
|
15
|
+
|
|
16
|
+
## [0.9.3](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.9.3)
|
|
17
|
+
|
|
18
|
+
Tue, 14 May 2024 00:38:55 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.9.2..@fluentui-copilot/react-attachments_v0.9.3)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- feat: add progress slot to Attachment, AttachmentOverflowMenuButton and AttachmentOverflowMenuItem. ([PR #1581](https://github.com/microsoft/fluentai/pull/1581) by tristan.watanabe@gmail.com)
|
|
24
|
+
|
|
7
25
|
## [0.9.2](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.9.2)
|
|
8
26
|
|
|
9
|
-
Wed, 08 May 2024 22:
|
|
27
|
+
Wed, 08 May 2024 22:10:20 GMT
|
|
10
28
|
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.9.1..@fluentui-copilot/react-attachments_v0.9.2)
|
|
11
29
|
|
|
12
30
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { MenuItem } from '@fluentui/react-components';
|
|
|
11
11
|
import type { MenuProps } from '@fluentui/react-components';
|
|
12
12
|
import type { MenuSlots } from '@fluentui/react-components';
|
|
13
13
|
import type { MenuState } from '@fluentui/react-components';
|
|
14
|
+
import type { ProgressBar } from '@fluentui/react-components';
|
|
14
15
|
import { Provider } from 'react';
|
|
15
16
|
import { ProviderProps } from 'react';
|
|
16
17
|
import * as React_2 from 'react';
|
|
@@ -21,8 +22,10 @@ export declare const Attachment: ForwardRefComponent<AttachmentProps>;
|
|
|
21
22
|
|
|
22
23
|
export declare const attachmentClassNames: SlotClassNames<AttachmentSlots>;
|
|
23
24
|
|
|
24
|
-
declare type AttachmentDismissedData = {
|
|
25
|
-
|
|
25
|
+
export declare type AttachmentDismissedData = {
|
|
26
|
+
content?: AttachmentProps['children'];
|
|
27
|
+
media?: AttachmentProps['media'];
|
|
28
|
+
id?: string;
|
|
26
29
|
};
|
|
27
30
|
|
|
28
31
|
export declare const AttachmentList: ForwardRefComponent<AttachmentListProps>;
|
|
@@ -34,7 +37,7 @@ export declare const AttachmentListContext: Context<AttachmentListContextValue>;
|
|
|
34
37
|
/**
|
|
35
38
|
* Context shared between AttachmentList and its children components
|
|
36
39
|
*/
|
|
37
|
-
export declare type AttachmentListContextValue = Pick<
|
|
40
|
+
export declare type AttachmentListContextValue = Pick<AttachmentListState, 'onAttachmentDismiss' | 'shouldUseOverflow'>;
|
|
38
41
|
|
|
39
42
|
declare type AttachmentListContextValues = {
|
|
40
43
|
attachmentList: AttachmentListContextValue;
|
|
@@ -45,18 +48,31 @@ declare type AttachmentListContextValues = {
|
|
|
45
48
|
*/
|
|
46
49
|
export declare type AttachmentListProps = ComponentProps<Partial<AttachmentListSlots>> & {
|
|
47
50
|
onAttachmentDismiss?: (e: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>, data: AttachmentDismissedData) => void;
|
|
51
|
+
overflowMenuProps?: Omit<AttachmentOverflowMenuProps, 'children'>;
|
|
52
|
+
/**
|
|
53
|
+
* The maximum number of attachments to display before the overflow button is shown even if there is
|
|
54
|
+
* enough space available to show more.
|
|
55
|
+
* If not set, the overflow functionality will be disabled.
|
|
56
|
+
* @default undefined
|
|
57
|
+
*/
|
|
58
|
+
maxVisibleAttachments?: number;
|
|
48
59
|
};
|
|
49
60
|
|
|
50
61
|
export declare const AttachmentListProvider: Provider<AttachmentListContextValue> & FC<ProviderProps<AttachmentListContextValue>>;
|
|
51
62
|
|
|
52
63
|
export declare type AttachmentListSlots = {
|
|
53
64
|
root: Slot<'div'>;
|
|
65
|
+
overflowMenuButton: Slot<'span'>;
|
|
66
|
+
overflowMenuItem: Slot<'span'>;
|
|
54
67
|
};
|
|
55
68
|
|
|
56
69
|
/**
|
|
57
70
|
* State used in rendering AttachmentList
|
|
58
71
|
*/
|
|
59
|
-
export declare type AttachmentListState = ComponentState<AttachmentListSlots> & Pick<AttachmentListProps, 'onAttachmentDismiss'
|
|
72
|
+
export declare type AttachmentListState = ComponentState<AttachmentListSlots> & Pick<AttachmentListProps, 'onAttachmentDismiss' | 'overflowMenuProps'> & {
|
|
73
|
+
attachments: AttachmentProps[];
|
|
74
|
+
shouldUseOverflow: boolean;
|
|
75
|
+
};
|
|
60
76
|
|
|
61
77
|
export declare const AttachmentOverflowMenu: React_2.FC<AttachmentOverflowMenuProps>;
|
|
62
78
|
|
|
@@ -67,16 +83,25 @@ export declare const attachmentOverflowMenuButtonClassNames: SlotClassNames<Atta
|
|
|
67
83
|
/**
|
|
68
84
|
* AttachmentOverflowMenuButton Props
|
|
69
85
|
*/
|
|
70
|
-
export declare type AttachmentOverflowMenuButtonProps = ComponentProps<Partial<AttachmentOverflowMenuButtonSlots
|
|
86
|
+
export declare type AttachmentOverflowMenuButtonProps = ComponentProps<Partial<AttachmentOverflowMenuButtonSlots>> & {
|
|
87
|
+
/**
|
|
88
|
+
* Toggle prop to indicate that there are Attachments in the overflow menu that's currently loading.
|
|
89
|
+
* Setting this to true will show an indeterminate progress bar on the button.
|
|
90
|
+
* @default false
|
|
91
|
+
*/
|
|
92
|
+
isLoading?: boolean;
|
|
93
|
+
text?: string | ((overflowCount: number) => React.ReactNode);
|
|
94
|
+
};
|
|
71
95
|
|
|
72
96
|
export declare type AttachmentOverflowMenuButtonSlots = {
|
|
73
97
|
root: NonNullable<Slot<'button'>>;
|
|
98
|
+
progress: NonNullable<Slot<typeof ProgressBar>>;
|
|
74
99
|
};
|
|
75
100
|
|
|
76
101
|
/**
|
|
77
102
|
* State used in rendering AttachmentOverflowMenuButton
|
|
78
103
|
*/
|
|
79
|
-
export declare type AttachmentOverflowMenuButtonState = ComponentState<AttachmentOverflowMenuButtonSlots> & Pick<AttachmentOverflowMenuState, 'isOverflowing' | 'overflowCount'>;
|
|
104
|
+
export declare type AttachmentOverflowMenuButtonState = ComponentState<AttachmentOverflowMenuButtonSlots> & Pick<AttachmentOverflowMenuState, 'isOverflowing' | 'overflowCount'> & Pick<AttachmentOverflowMenuButtonProps, 'isLoading'>;
|
|
80
105
|
|
|
81
106
|
export declare const AttachmentOverflowMenuContext: Context<AttachmentOverflowMenuContextValue>;
|
|
82
107
|
|
|
@@ -100,6 +125,7 @@ export declare type AttachmentOverflowMenuItemProps = ComponentProps<Partial<Att
|
|
|
100
125
|
|
|
101
126
|
export declare type AttachmentOverflowMenuItemSlots = {
|
|
102
127
|
root: NonNullable<Slot<typeof MenuItem>>;
|
|
128
|
+
progress?: Slot<typeof ProgressBar>;
|
|
103
129
|
};
|
|
104
130
|
|
|
105
131
|
/**
|
|
@@ -131,7 +157,6 @@ export declare type AttachmentOverflowMenuState = MenuState & {
|
|
|
131
157
|
* Attachment Props
|
|
132
158
|
*/
|
|
133
159
|
export declare type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & {
|
|
134
|
-
id: string;
|
|
135
160
|
imageOnly?: boolean;
|
|
136
161
|
};
|
|
137
162
|
|
|
@@ -142,12 +167,16 @@ export declare type AttachmentSlots = {
|
|
|
142
167
|
media?: Slot<'span'>;
|
|
143
168
|
content: NonNullable<Slot<'span'>>;
|
|
144
169
|
dismissIcon: NonNullable<Slot<'span'>>;
|
|
170
|
+
progress?: Slot<typeof ProgressBar>;
|
|
145
171
|
};
|
|
146
172
|
|
|
147
173
|
/**
|
|
148
174
|
* State used in rendering Attachment
|
|
149
175
|
*/
|
|
150
|
-
export declare type AttachmentState = ComponentState<AttachmentSlots> & Pick<AttachmentProps, 'imageOnly'
|
|
176
|
+
export declare type AttachmentState = ComponentState<AttachmentSlots> & Required<Pick<AttachmentProps, 'id'>> & Pick<AttachmentProps, 'imageOnly'> & {
|
|
177
|
+
isLoading: boolean;
|
|
178
|
+
shouldUseOverflow: boolean;
|
|
179
|
+
};
|
|
151
180
|
|
|
152
181
|
/**
|
|
153
182
|
* @deprecated use new Attachment component exported from \@fluentui-copilot/react-attachments package instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Attachment.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type AttachmentSlots = {\n root: NonNullable<Slot<'div'>>;\n primaryAction: NonNullable<Slot<'button', 'span'>>;\n dismissButton: NonNullable<Slot<'button'>>;\n media?: Slot<'span'>;\n content: NonNullable<Slot<'span'>>;\n dismissIcon: NonNullable<Slot<'span'>>;\n};\n\n/**\n * Attachment Props\n */\nexport type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & {\n
|
|
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 primaryAction: NonNullable<Slot<'button', 'span'>>;\n dismissButton: NonNullable<Slot<'button'>>;\n media?: Slot<'span'>;\n content: NonNullable<Slot<'span'>>;\n dismissIcon: NonNullable<Slot<'span'>>;\n progress?: Slot<typeof ProgressBar>;\n};\n\n/**\n * Attachment Props\n */\nexport type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & {\n imageOnly?: boolean;\n};\n\n/**\n * State used in rendering Attachment\n */\nexport type AttachmentState = ComponentState<AttachmentSlots> &\n Required<Pick<AttachmentProps, 'id'>> &\n Pick<AttachmentProps, 'imageOnly'> & {\n isLoading: boolean;\n shouldUseOverflow: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAmBA;;CAEC,GACD,WAKI"}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
-
import { assertSlots } from '@fluentui/react-components';
|
|
2
|
+
import { OverflowItem, assertSlots } from '@fluentui/react-components';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of Attachment
|
|
5
5
|
*/
|
|
6
6
|
export const renderAttachment_unstable = state => {
|
|
7
7
|
assertSlots(state);
|
|
8
|
-
|
|
8
|
+
const {
|
|
9
|
+
id,
|
|
10
|
+
shouldUseOverflow
|
|
11
|
+
} = state;
|
|
12
|
+
const attachment = /*#__PURE__*/_jsxs(state.root, {
|
|
9
13
|
children: [/*#__PURE__*/_jsxs(state.primaryAction, {
|
|
10
|
-
children: [state.media && !state.imageOnly && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.content, {})]
|
|
14
|
+
children: [state.media && !state.imageOnly && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.content, {}), state.progress && /*#__PURE__*/_jsx(state.progress, {})]
|
|
11
15
|
}), /*#__PURE__*/_jsx(state.dismissButton, {
|
|
12
16
|
children: /*#__PURE__*/_jsx(state.dismissIcon, {})
|
|
13
17
|
})]
|
|
14
18
|
});
|
|
19
|
+
return shouldUseOverflow ? /*#__PURE__*/_jsx(OverflowItem, {
|
|
20
|
+
id: id,
|
|
21
|
+
children: attachment
|
|
22
|
+
}, id) : attachment;
|
|
15
23
|
};
|
|
16
24
|
//# sourceMappingURL=renderAttachment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderAttachment.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { AttachmentState, AttachmentSlots } from './Attachment.types';\n\n/**\n * Render the final JSX of Attachment\n */\nexport const renderAttachment_unstable = (state: AttachmentState) => {\n assertSlots<AttachmentSlots>(state);\n\n
|
|
1
|
+
{"version":3,"sources":["renderAttachment.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { OverflowItem, assertSlots } from '@fluentui/react-components';\nimport type { AttachmentState, AttachmentSlots } from './Attachment.types';\n\n/**\n * Render the final JSX of Attachment\n */\nexport const renderAttachment_unstable = (state: AttachmentState) => {\n assertSlots<AttachmentSlots>(state);\n const { id, shouldUseOverflow } = state;\n\n const attachment = (\n <state.root>\n <state.primaryAction>\n {state.media && !state.imageOnly && <state.media />}\n <state.content />\n {state.progress && <state.progress />}\n </state.primaryAction>\n <state.dismissButton>\n <state.dismissIcon />\n </state.dismissButton>\n </state.root>\n );\n return shouldUseOverflow ? (\n <OverflowItem id={id} key={id}>\n {attachment}\n </OverflowItem>\n ) : (\n attachment\n );\n};\n"],"names":["OverflowItem","assertSlots","renderAttachment_unstable","state","id","shouldUseOverflow","attachment","root","primaryAction","media","imageOnly","content","progress","dismissButton","dismissIcon"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,YAAY,EAAEC,WAAW,QAAQ,6BAA6B;AAGvE;;CAEC,GACD,OAAO,MAAMC,4BAA4B,CAACC;IACxCF,YAA6BE;IAC7B,MAAM,EAAEC,EAAE,EAAEC,iBAAiB,EAAE,GAAGF;IAElC,MAAMG,2BACJ,MAACH,MAAMI,IAAI;;0BACT,MAACJ,MAAMK,aAAa;;oBACjBL,MAAMM,KAAK,IAAI,CAACN,MAAMO,SAAS,kBAAI,KAACP,MAAMM,KAAK;kCAChD,KAACN,MAAMQ,OAAO;oBACbR,MAAMS,QAAQ,kBAAI,KAACT,MAAMS,QAAQ;;;0BAEpC,KAACT,MAAMU,aAAa;0BAClB,cAAA,KAACV,MAAMW,WAAW;;;;IAIxB,OAAOT,kCACL,KAACL;QAAaI,IAAIA;kBACfE;OADwBF,MAI3BE;AAEJ,EAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { getIntrinsicElementProps, mergeCallbacks, slot } from '@fluentui/react-components';
|
|
2
|
+
import { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';
|
|
3
3
|
import { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';
|
|
4
4
|
import { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';
|
|
5
5
|
/**
|
|
@@ -13,13 +13,20 @@ import { useAttachmentListContext_unstable } from '../../contexts/attachmentList
|
|
|
13
13
|
*/
|
|
14
14
|
export const useAttachment_unstable = (props, ref) => {
|
|
15
15
|
const {
|
|
16
|
+
children,
|
|
16
17
|
imageOnly
|
|
17
18
|
} = props;
|
|
18
19
|
const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);
|
|
19
|
-
const
|
|
20
|
+
const {
|
|
21
|
+
onAttachmentDismiss,
|
|
22
|
+
shouldUseOverflow
|
|
23
|
+
} = useAttachmentListContext_unstable(context => context);
|
|
24
|
+
const attachmentId = useId('attachment-', props.id);
|
|
25
|
+
const isLoading = !!props.progress;
|
|
20
26
|
const root = slot.always(getIntrinsicElementProps('div', {
|
|
21
27
|
ref,
|
|
22
|
-
...props
|
|
28
|
+
...props,
|
|
29
|
+
id: attachmentId
|
|
23
30
|
}), {
|
|
24
31
|
elementType: 'div'
|
|
25
32
|
});
|
|
@@ -32,9 +39,13 @@ export const useAttachment_unstable = (props, ref) => {
|
|
|
32
39
|
},
|
|
33
40
|
elementType: 'button'
|
|
34
41
|
});
|
|
35
|
-
dismissButton.onClick = mergeCallbacks(dismissButton.onClick, ev =>
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
dismissButton.onClick = mergeCallbacks(dismissButton.onClick, ev => {
|
|
43
|
+
onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
|
|
44
|
+
content: children,
|
|
45
|
+
media,
|
|
46
|
+
id: attachmentId
|
|
47
|
+
});
|
|
48
|
+
});
|
|
38
49
|
const media = slot.optional(props.media, {
|
|
39
50
|
elementType: 'span'
|
|
40
51
|
});
|
|
@@ -50,14 +61,24 @@ export const useAttachment_unstable = (props, ref) => {
|
|
|
50
61
|
},
|
|
51
62
|
elementType: 'span'
|
|
52
63
|
});
|
|
64
|
+
const progress = slot.optional(props.progress, {
|
|
65
|
+
defaultProps: {
|
|
66
|
+
shape: 'square',
|
|
67
|
+
thickness: 'large',
|
|
68
|
+
'aria-labelledby': props.id
|
|
69
|
+
},
|
|
70
|
+
elementType: ProgressBar
|
|
71
|
+
});
|
|
53
72
|
const state = {
|
|
73
|
+
id: attachmentId,
|
|
54
74
|
components: {
|
|
55
75
|
root: 'div',
|
|
56
76
|
primaryAction: 'button',
|
|
57
77
|
dismissButton: 'button',
|
|
58
78
|
media: 'span',
|
|
59
79
|
content: 'span',
|
|
60
|
-
dismissIcon: 'span'
|
|
80
|
+
dismissIcon: 'span',
|
|
81
|
+
progress: ProgressBar
|
|
61
82
|
},
|
|
62
83
|
root,
|
|
63
84
|
primaryAction,
|
|
@@ -65,7 +86,10 @@ export const useAttachment_unstable = (props, ref) => {
|
|
|
65
86
|
media,
|
|
66
87
|
content,
|
|
67
88
|
dismissIcon,
|
|
68
|
-
|
|
89
|
+
progress,
|
|
90
|
+
imageOnly,
|
|
91
|
+
isLoading,
|
|
92
|
+
shouldUseOverflow
|
|
69
93
|
};
|
|
70
94
|
if (state.primaryAction.as === 'span') {
|
|
71
95
|
state.components.primaryAction = 'span';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, mergeCallbacks, slot } from '@fluentui/react-components';\nimport { Dismiss20Regular, Dismiss20Filled, bundleIcon } 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 { imageOnly } = props;\n const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\n
|
|
1
|
+
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss20Regular, Dismiss20Filled, bundleIcon } 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 } = props;\n const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\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': 'Dismiss' },\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: <DismissIcon />,\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 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","Dismiss20Regular","Dismiss20Filled","bundleIcon","useAttachmentListContext_unstable","useAttachment_unstable","props","ref","children","imageOnly","DismissIcon","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,WAAW,EAAEC,wBAAwB,EAAEC,cAAc,EAAEC,IAAI,EAAEC,KAAK,QAAQ,6BAA6B;AAChH,SAASC,gBAAgB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AAK6B,QAAQ,CAACtB,MAAMW,QAAQ,EAAE;QAC7CM,cAAc;YACZO,OAAO;YACPC,WAAW;YACX,mBAAmBzB,MAAMS,EAAE;QAC7B;QACAK,aAAaxB;IACf;IAEA,MAAMoC,QAAyB;QAC7BjB,IAAID;QACJmB,YAAY;YACVf,MAAM;YACNG,eAAe;YACfC,eAAe;YACfK,OAAO;YACPD,SAAS;YACTG,aAAa;YACbZ,UAAUrB;QACZ;QAEAsB;QACAG;QACAC;QACAK;QACAD;QACAG;QACAZ;QACAR;QACAO;QACAJ;IACF;IAEA,IAAIoB,MAAMX,aAAa,CAACa,EAAE,KAAK,QAAQ;QACrCF,MAAMC,UAAU,CAACZ,aAAa,GAAG;IACnC;IAEA,OAAOW;AACT,EAAE"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { createCustomFocusIndicatorStyle, __resetStyles, __styles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';
|
|
1
|
+
import { createCustomFocusIndicatorStyle, __resetStyles, __styles, mergeClasses, shorthands, slot, tokens, typographyStyles } from '@fluentui/react-components';
|
|
2
|
+
import { useProgressBarStyles } from '../utils/useProgressBarStyles';
|
|
2
3
|
export const attachmentClassNames = {
|
|
3
4
|
root: 'fai-Attachment',
|
|
4
5
|
primaryAction: 'fai-Attachment__primaryAction',
|
|
5
6
|
dismissButton: 'fai-Attachment__dismissButton',
|
|
6
7
|
media: 'fai-Attachment__media',
|
|
7
8
|
content: 'fai-Attachment__content',
|
|
8
|
-
dismissIcon: 'fai-Attachment__dismissIcon'
|
|
9
|
+
dismissIcon: 'fai-Attachment__dismissIcon',
|
|
10
|
+
progress: 'fai-Attachment__progress'
|
|
9
11
|
};
|
|
10
12
|
const ATTACHMENT_MAXWIDTH = '180px';
|
|
11
13
|
const ATTACHMENT_SIZE = '20px';
|
|
12
|
-
const useRootBaseClassName = __resetStyles("
|
|
14
|
+
const useRootBaseClassName = __resetStyles("r16wonf3", null, [".r16wonf3{display:inline-flex;flex-wrap:nowrap;vertical-align:middle;box-sizing:border-box;width:fit-content;align-self:end;position:relative;}"]);
|
|
13
15
|
const buttonBaseStyles = {
|
|
14
16
|
alignItems: 'center',
|
|
15
17
|
backgroundColor: tokens.colorNeutralBackground1,
|
|
@@ -68,6 +70,13 @@ const useImageOnlyStyles = __styles({
|
|
|
68
70
|
}, {
|
|
69
71
|
d: [".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".fez10in{line-height:0;}"]
|
|
70
72
|
});
|
|
73
|
+
export const useOverflowStyles = __styles({
|
|
74
|
+
overflow: {
|
|
75
|
+
a9b677: "fly5x3f"
|
|
76
|
+
}
|
|
77
|
+
}, {
|
|
78
|
+
d: [".fly5x3f{width:100%;}"]
|
|
79
|
+
});
|
|
71
80
|
/**
|
|
72
81
|
* Apply styling to the Attachment slots based on the state
|
|
73
82
|
*/
|
|
@@ -78,6 +87,7 @@ export const useAttachmentStyles_unstable = state => {
|
|
|
78
87
|
const mediaBaseClassName = useMediaBaseClassName();
|
|
79
88
|
const contentBaseClassName = useContentBaseClassName();
|
|
80
89
|
const dismissIconBaseClassName = useDismissIconBaseClassName();
|
|
90
|
+
const progressBarStyles = useProgressBarStyles();
|
|
81
91
|
const primaryActionStyles = usePrimaryActionStyles();
|
|
82
92
|
const imageOnlyStyles = useImageOnlyStyles();
|
|
83
93
|
const {
|
|
@@ -85,13 +95,28 @@ export const useAttachmentStyles_unstable = state => {
|
|
|
85
95
|
primaryAction
|
|
86
96
|
} = state;
|
|
87
97
|
state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);
|
|
88
|
-
state.primaryAction.className = mergeClasses(attachmentClassNames.primaryAction, primaryActionBaseClassName, primaryAction.as !== 'span' && primaryActionStyles.button, imageOnly && imageOnlyStyles.primaryAction, state.primaryAction.className);
|
|
98
|
+
state.primaryAction.className = mergeClasses(attachmentClassNames.primaryAction, primaryActionBaseClassName, primaryAction.as !== 'span' && !state.isLoading && primaryActionStyles.button, imageOnly && imageOnlyStyles.primaryAction, state.primaryAction.className);
|
|
89
99
|
state.dismissButton.className = mergeClasses(attachmentClassNames.dismissButton, dismissButtonBaseClassName, state.dismissButton.className);
|
|
90
100
|
if (state.media) {
|
|
91
101
|
state.media.className = mergeClasses(attachmentClassNames.media, mediaBaseClassName, state.media.className);
|
|
92
102
|
}
|
|
93
103
|
state.content.className = mergeClasses(attachmentClassNames.content, contentBaseClassName, imageOnly && imageOnlyStyles.content, state.content.className);
|
|
94
104
|
state.dismissIcon.className = mergeClasses(attachmentClassNames.dismissIcon, dismissIconBaseClassName, state.dismissIcon.className);
|
|
105
|
+
if (state.progress) {
|
|
106
|
+
state.progress.className = mergeClasses(attachmentClassNames.progress, progressBarStyles.progress, state.progress.className);
|
|
107
|
+
const bar = slot.optional(state.progress.bar, {
|
|
108
|
+
elementType: 'div',
|
|
109
|
+
renderByDefault: true
|
|
110
|
+
});
|
|
111
|
+
if (bar) {
|
|
112
|
+
if (state.progress.value === undefined) {
|
|
113
|
+
bar.className = mergeClasses(progressBarStyles.indeterminateProgressBar, bar.className);
|
|
114
|
+
} else {
|
|
115
|
+
bar.className = mergeClasses(progressBarStyles.regularProgressBar, bar.className);
|
|
116
|
+
}
|
|
117
|
+
state.progress.bar = bar;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
95
120
|
return state;
|
|
96
121
|
};
|
|
97
122
|
//# sourceMappingURL=useAttachmentStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentStyles.ts"],"sourcesContent":["import {\n createCustomFocusIndicatorStyle,\n makeResetStyles,\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\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};\n\nconst ATTACHMENT_MAXWIDTH = '180px';\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});\n\nconst buttonBaseStyles: GriffelResetStyle = {\n alignItems: 'center',\n backgroundColor: tokens.colorNeutralBackground1,\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 ...shorthands.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.colorNeutralBackground3Hover,\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\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.colorNeutralBackground3Hover,\n color: tokens.colorNeutralForeground2BrandHover,\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorBrandForegroundLinkHover,\n },\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\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 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 ...shorthands.padding(0),\n },\n content: {\n lineHeight: 0,\n },\n});\n\n/**\n * Apply styling to the Attachment slots based on the state\n */\nexport const useAttachmentStyles_unstable = (state: AttachmentState): AttachmentState => {\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 primaryActionStyles = usePrimaryActionStyles();\n const imageOnlyStyles = useImageOnlyStyles();\n const { imageOnly, primaryAction } = state;\n\n state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);\n state.primaryAction.className = mergeClasses(\n attachmentClassNames.primaryAction,\n primaryActionBaseClassName,\n primaryAction.as !== 'span' && primaryActionStyles.button,\n imageOnly && imageOnlyStyles.primaryAction,\n state.primaryAction.className,\n );\n state.dismissButton.className = mergeClasses(\n attachmentClassNames.dismissButton,\n dismissButtonBaseClassName,\n state.dismissButton.className,\n );\n if (state.media) {\n state.media.className = mergeClasses(attachmentClassNames.media, mediaBaseClassName, state.media.className);\n }\n state.content.className = mergeClasses(\n attachmentClassNames.content,\n contentBaseClassName,\n imageOnly && imageOnlyStyles.content,\n state.content.className,\n );\n state.dismissIcon.className = mergeClasses(\n attachmentClassNames.dismissIcon,\n dismissIconBaseClassName,\n state.dismissIcon.className,\n );\n\n return state;\n};\n"],"names":["createCustomFocusIndicatorStyle","makeResetStyles","makeStyles","mergeClasses","shorthands","tokens","typographyStyles","attachmentClassNames","root","primaryAction","dismissButton","media","content","dismissIcon","ATTACHMENT_MAXWIDTH","ATTACHMENT_SIZE","useRootBaseClassName","display","flexWrap","verticalAlign","boxSizing","width","alignSelf","buttonBaseStyles","alignItems","backgroundColor","colorNeutralBackground1","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","colorNeutralBackground3Hover","colorNeutralForeground2Hover","colorNeutralBackground3Pressed","colorNeutralForeground2Pressed","useDismissButtonBaseClassName","minWidth","borderLeftColor","borderTopLeftRadius","borderBottomLeftRadius","colorNeutralForeground2BrandHover","colorBrandForegroundLinkHover","colorNeutralForeground2BrandPressed","useMediaBaseClassName","fontSize","height","lineHeight","useContentBaseClassName","overflowX","textOverflow","whiteSpace","body1","useDismissIconBaseClassName","borderRadiusCircular","colorTransparentStroke","spacingVerticalXXS","useImageOnlyStyles","useAttachmentStyles_unstable","state","rootBaseClassName","primaryActionBaseClassName","dismissButtonBaseClassName","mediaBaseClassName","contentBaseClassName","dismissIconBaseClassName","primaryActionStyles","imageOnlyStyles","imageOnly","className","as"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,+BAA+B,EAC/BC,eAAe,EACfC,UAAU,EACVC,YAAY,EACZC,UAAU,EACVC,MAAM,EACNC,gBAAgB,QACX,6BAA6B;AAIpC,OAAO,MAAMC,uBAAwD;IACnEC,MAAM;IACNC,eAAe;IACfC,eAAe;IACfC,OAAO;IACPC,SAAS;IACTC,aAAa;AACf,EAAE;AAEF,MAAMC,sBAAsB;AAC5B,MAAMC,kBAAkB;AAExB,MAAMC,uBAAuBf,gBAAgB;IAC3CgB,SAAS;IACTC,UAAU;IACVC,eAAe;IACfC,WAAW;IACXC,OAAO;IACPC,WAAW;AACb;AAEA,MAAMC,mBAAsC;IAC1CC,YAAY;IACZC,iBAAiBpB,OAAOqB,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEtB,OAAOuB,eAAe,CAAC,OAAO,EAAEvB,OAAOwB,mBAAmB,CAAC,CAAC;IACvEC,cAAczB,OAAO0B,kBAAkB;IACvCX,WAAW;IACXY,WAAW3B,OAAO4B,uBAAuB;IACzCC,OAAO7B,OAAO8B,uBAAuB;IACrCC,QAAQ;IACRnB,SAAS;IACTC,UAAU;IACVmB,gBAAgB;IAChB,GAAGrC,gCAAgC;QACjC,GAAGI,WAAWkC,OAAO,CAACjC,OAAOkC,gBAAgB,EAAE,SAASlC,OAAOmC,iBAAiB,CAAC;QACjFC,QAAQ;IACV,EAAE;IACFtB,eAAe;AACjB;AAEA,MAAMuB,gCAAgCzC,gBAAgB;IACpD,GAAGsB,gBAAgB;IACnBoB,sBAAsBtC,OAAOuC,gBAAgB;IAC7CC,yBAAyBxC,OAAOu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E,aAAa,CAACkF,SAAS,GAAGzF,aAC9BI,qBAAqBG,aAAa,EAClC2E,4BACAH,MAAMxE,aAAa,CAACkF,SAAS;IAE/B,IAAIV,MAAMvE,KAAK,EAAE;QACfuE,MAAMvE,KAAK,CAACiF,SAAS,GAAGzF,aAAaI,qBAAqBI,KAAK,EAAE2E,oBAAoBJ,MAAMvE,KAAK,CAACiF,SAAS;IAC5G;IACAV,MAAMtE,OAAO,CAACgF,SAAS,GAAGzF,aACxBI,qBAAqBK,OAAO,EAC5B2E,sBACAI,aAAaD,gBAAgB9E,OAAO,EACpCsE,MAAMtE,OAAO,CAACgF,SAAS;IAEzBV,MAAMrE,WAAW,CAAC+E,SAAS,GAAGzF,aAC5BI,qBAAqBM,WAAW,EAChC2E,0BACAN,MAAMrE,WAAW,CAAC+E,SAAS;IAG7B,OAAOV;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["useAttachmentStyles.ts"],"sourcesContent":["import {\n createCustomFocusIndicatorStyle,\n makeResetStyles,\n makeStyles,\n mergeClasses,\n shorthands,\n slot,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles';\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 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.colorNeutralBackground1,\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 ...shorthands.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.colorNeutralBackground3Hover,\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\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.colorNeutralBackground3Hover,\n color: tokens.colorNeutralForeground2BrandHover,\n [`& .${attachmentClassNames.dismissIcon}`]: {\n color: tokens.colorBrandForegroundLinkHover,\n },\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\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 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 ...shorthands.padding(0),\n },\n content: {\n lineHeight: 0,\n },\n});\n\nexport const useOverflowStyles = makeStyles({\n overflow: {\n width: '100%',\n },\n});\n\n/**\n * Apply styling to the Attachment slots based on the state\n */\nexport const useAttachmentStyles_unstable = (state: AttachmentState): AttachmentState => {\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 { imageOnly, primaryAction } = state;\n\n state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);\n state.primaryAction.className = mergeClasses(\n attachmentClassNames.primaryAction,\n primaryActionBaseClassName,\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 state.dismissButton.className,\n );\n if (state.media) {\n state.media.className = mergeClasses(attachmentClassNames.media, mediaBaseClassName, state.media.className);\n }\n state.content.className = mergeClasses(\n attachmentClassNames.content,\n contentBaseClassName,\n imageOnly && imageOnlyStyles.content,\n state.content.className,\n );\n state.dismissIcon.className = mergeClasses(\n attachmentClassNames.dismissIcon,\n dismissIconBaseClassName,\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","shorthands","slot","tokens","typographyStyles","useProgressBarStyles","attachmentClassNames","root","primaryAction","dismissButton","media","content","dismissIcon","progress","ATTACHMENT_MAXWIDTH","ATTACHMENT_SIZE","useRootBaseClassName","display","flexWrap","verticalAlign","boxSizing","width","alignSelf","position","buttonBaseStyles","alignItems","backgroundColor","colorNeutralBackground1","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","colorNeutralBackground3Hover","colorNeutralForeground2Hover","colorNeutralBackground3Pressed","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","useAttachmentStyles_unstable","state","rootBaseClassName","primaryActionBaseClassName","dismissButtonBaseClassName","mediaBaseClassName","contentBaseClassName","dismissIconBaseClassName","progressBarStyles","primaryActionStyles","imageOnlyStyles","imageOnly","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,UAAU,EACVC,IAAI,EACJC,MAAM,EACNC,gBAAgB,QACX,6BAA6B;AACpC,SAASC,oBAAoB,QAAQ,gCAAgC;AAIrE,OAAO,MAAMC,uBAAwD;IACnEC,MAAM;IACNC,eAAe;IACfC,eAAe;IACfC,OAAO;IACPC,SAAS;IACTC,aAAa;IACbC,UAAU;AACZ,EAAE;AAEF,MAAMC,sBAAsB;AAC5B,MAAMC,kBAAkB;AAExB,MAAMC,uBAAuBlB,gBAAgB;IAC3CmB,SAAS;IACTC,UAAU;IACVC,eAAe;IACfC,WAAW;IACXC,OAAO;IACPC,WAAW;IACXC,UAAU;AACZ;AAEA,MAAMC,mBAAsC;IAC1CC,YAAY;IACZC,iBAAiBvB,OAAOwB,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEzB,OAAO0B,eAAe,CAAC,OAAO,EAAE1B,OAAO2B,mBAAmB,CAAC,CAAC;IACvEC,cAAc5B,OAAO6B,kBAAkB;IACvCZ,WAAW;IACXa,WAAW9B,OAAO+B,uBAAuB;IACzCC,OAAOhC,OAAOiC,uBAAuB;IACrCC,QAAQ;IACRpB,SAAS;IACTC,UAAU;IACVoB,gBAAgB;IAChB,GAAGzC,gCAAgC;QACjC,GAAGI,WAAWsC,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AAW;gBACtCL,IAAIH,SAAS,GAAGhG,aAAa4F,kBAAkBa,wBAAwB,EAAEN,IAAIH,SAAS;YACxF,OAAO;gBACLG,IAAIH,SAAS,GAAGhG,aAAa4F,kBAAkBc,kBAAkB,EAAEP,IAAIH,SAAS;YAClF;YACAX,MAAMxE,QAAQ,CAACsF,GAAG,GAAGA;QACvB;IACF;IAEA,OAAOd;AACT,EAAE"}
|
|
@@ -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';\n\nexport type AttachmentListSlots = {\n root: Slot<'div'>;\n};\n\nexport type AttachmentDismissedData = {\n id
|
|
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 overflowMenuButton: Slot<'span'>;\n overflowMenuItem: 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 onAttachmentDismiss?: (\n e: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>,\n data: AttachmentDismissedData,\n ) => void;\n overflowMenuProps?: Omit<AttachmentOverflowMenuProps, 'children'>;\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 attachments: AttachmentProps[];\n shouldUseOverflow: boolean;\n };\n\nexport type AttachmentListContextValues = {\n attachmentList: AttachmentListContextValue;\n};\n"],"names":[],"rangeMappings":"","mappings":"AA4CA,WAEE"}
|
|
@@ -1,14 +1,41 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { createElement as _createElement } from "@fluentui/react-jsx-runtime";
|
|
3
|
+
import { MenuList, MenuPopover, Overflow, assertSlots } from '@fluentui/react-components';
|
|
3
4
|
import { AttachmentListProvider } from '../../contexts/attachmentListContext';
|
|
5
|
+
import { AttachmentOverflowMenu } from '../AttachmentOverflowMenu';
|
|
6
|
+
import { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';
|
|
4
7
|
/**
|
|
5
8
|
* Render the final JSX of AttachmentList
|
|
6
9
|
*/
|
|
7
10
|
export const renderAttachmentList_unstable = (state, contextValues) => {
|
|
8
11
|
assertSlots(state);
|
|
12
|
+
const {
|
|
13
|
+
attachments,
|
|
14
|
+
overflowMenuProps,
|
|
15
|
+
root,
|
|
16
|
+
shouldUseOverflow
|
|
17
|
+
} = state;
|
|
9
18
|
return /*#__PURE__*/_jsx(AttachmentListProvider, {
|
|
10
19
|
value: contextValues.attachmentList,
|
|
11
|
-
children: /*#__PURE__*/_jsx(
|
|
20
|
+
children: shouldUseOverflow ? /*#__PURE__*/_jsx(Overflow, {
|
|
21
|
+
ref: root.ref,
|
|
22
|
+
children: /*#__PURE__*/_jsxs(state.root, {
|
|
23
|
+
children: [root.children, /*#__PURE__*/_jsxs(AttachmentOverflowMenu, {
|
|
24
|
+
positioning: 'above',
|
|
25
|
+
...overflowMenuProps,
|
|
26
|
+
children: [/*#__PURE__*/_jsx(state.overflowMenuButton, {}), /*#__PURE__*/_jsx(MenuPopover, {
|
|
27
|
+
children: /*#__PURE__*/_jsx(MenuList, {
|
|
28
|
+
children: attachments.map(attachment => {
|
|
29
|
+
return /*#__PURE__*/_createElement(AttachmentOverflowMenuItem, {
|
|
30
|
+
...attachment,
|
|
31
|
+
key: attachment.id
|
|
32
|
+
});
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
})]
|
|
36
|
+
})]
|
|
37
|
+
})
|
|
38
|
+
}) : /*#__PURE__*/_jsx(state.root, {})
|
|
12
39
|
});
|
|
13
40
|
};
|
|
14
41
|
//# sourceMappingURL=renderAttachmentList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderAttachmentList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport { AttachmentListProvider } from '../../contexts/attachmentListContext';\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\n return (\n <AttachmentListProvider value={contextValues.attachmentList}>\n <state.root />\n </AttachmentListProvider>\n );\n};\n"],"names":["assertSlots","AttachmentListProvider","renderAttachmentList_unstable","state","contextValues","value","attachmentList","
|
|
1
|
+
{"version":3,"sources":["renderAttachmentList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { MenuList, MenuPopover, Overflow, assertSlots } from '@fluentui/react-components';\nimport { AttachmentListProvider } from '../../contexts/attachmentListContext';\nimport { AttachmentOverflowMenu } from '../AttachmentOverflowMenu';\nimport { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';\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 { attachments, overflowMenuProps, root, shouldUseOverflow } = state;\n\n return (\n <AttachmentListProvider value={contextValues.attachmentList}>\n {shouldUseOverflow ? (\n <Overflow ref={root.ref}>\n <state.root>\n {root.children}\n <AttachmentOverflowMenu positioning={'above'} {...overflowMenuProps}>\n <state.overflowMenuButton />\n <MenuPopover>\n <MenuList>\n {attachments.map(attachment => {\n return <AttachmentOverflowMenuItem {...attachment} key={attachment.id} />;\n })}\n </MenuList>\n </MenuPopover>\n </AttachmentOverflowMenu>\n </state.root>\n </Overflow>\n ) : (\n <state.root />\n )}\n </AttachmentListProvider>\n );\n};\n"],"names":["MenuList","MenuPopover","Overflow","assertSlots","AttachmentListProvider","AttachmentOverflowMenu","AttachmentOverflowMenuItem","renderAttachmentList_unstable","state","contextValues","attachments","overflowMenuProps","root","shouldUseOverflow","value","attachmentList","ref","children","positioning","overflowMenuButton","map","attachment","key","id"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;;AAEjD,SAASA,QAAQ,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,6BAA6B;AAC1F,SAASC,sBAAsB,QAAQ,uCAAuC;AAC9E,SAASC,sBAAsB,QAAQ,4BAA4B;AACnE,SAASC,0BAA0B,QAAQ,gCAAgC;AAG3E;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEAN,YAAiCK;IACjC,MAAM,EAAEE,WAAW,EAAEC,iBAAiB,EAAEC,IAAI,EAAEC,iBAAiB,EAAE,GAAGL;IAEpE,qBACE,KAACJ;QAAuBU,OAAOL,cAAcM,cAAc;kBACxDF,kCACC,KAACX;YAASc,KAAKJ,KAAKI,GAAG;sBACrB,cAAA,MAACR,MAAMI,IAAI;;oBACRA,KAAKK,QAAQ;kCACd,MAACZ;wBAAuBa,aAAa;wBAAU,GAAGP,iBAAiB;;0CACjE,KAACH,MAAMW,kBAAkB;0CACzB,KAAClB;0CACC,cAAA,KAACD;8CACEU,YAAYU,GAAG,CAACC,CAAAA;wCACf,qBAAO,eAACf;4CAA4B,GAAGe,UAAU;4CAAEC,KAAKD,WAAWE,EAAE;;oCACvE;;;;;;;2BAOV,KAACf,MAAMI,IAAI;;AAInB,EAAE"}
|