@fluentui-copilot/react-attachments 0.8.1 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +37 -1
- package/CHANGELOG.md +21 -2
- package/dist/index.d.ts +112 -1
- package/lib/Attachment.js +2 -0
- package/lib/Attachment.js.map +1 -0
- package/lib/AttachmentList.js +2 -0
- package/lib/AttachmentList.js.map +1 -0
- package/lib/components/Attachment/Attachment.js +12 -0
- package/lib/components/Attachment/Attachment.js.map +1 -0
- package/lib/components/Attachment/Attachment.types.js +2 -0
- package/lib/components/Attachment/Attachment.types.js.map +1 -0
- package/lib/components/Attachment/index.js +6 -0
- package/lib/components/Attachment/index.js.map +1 -0
- package/lib/components/Attachment/renderAttachment.js +16 -0
- package/lib/components/Attachment/renderAttachment.js.map +1 -0
- package/lib/components/Attachment/useAttachment.js +71 -0
- package/lib/components/Attachment/useAttachment.js.map +1 -0
- package/lib/components/Attachment/useAttachmentStyles.js +82 -0
- package/lib/components/Attachment/useAttachmentStyles.js.map +1 -0
- package/lib/components/AttachmentList/AttachmentList.js +13 -0
- package/lib/components/AttachmentList/AttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/AttachmentList.types.js +2 -0
- package/lib/components/AttachmentList/AttachmentList.types.js.map +1 -0
- package/lib/components/AttachmentList/index.js +6 -0
- package/lib/components/AttachmentList/index.js.map +1 -0
- package/lib/components/AttachmentList/renderAttachmentList.js +14 -0
- package/lib/components/AttachmentList/renderAttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentList.js +74 -0
- package/lib/components/AttachmentList/useAttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentListContextValues.js +13 -0
- package/lib/components/AttachmentList/useAttachmentListContextValues.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.js +14 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.js.map +1 -0
- package/lib/components/index.js +2 -0
- package/lib/components/index.js.map +1 -1
- package/lib/contexts/attachmentListContext.js +8 -0
- package/lib/contexts/attachmentListContext.js.map +1 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Attachment.js +7 -0
- package/lib-commonjs/Attachment.js.map +1 -0
- package/lib-commonjs/AttachmentList.js +7 -0
- package/lib-commonjs/AttachmentList.js.map +1 -0
- package/lib-commonjs/components/Attachment/Attachment.js +21 -0
- package/lib-commonjs/components/Attachment/Attachment.js.map +1 -0
- package/lib-commonjs/components/Attachment/Attachment.types.js +5 -0
- package/lib-commonjs/components/Attachment/Attachment.types.js.map +1 -0
- package/lib-commonjs/components/Attachment/index.js +11 -0
- package/lib-commonjs/components/Attachment/index.js.map +1 -0
- package/lib-commonjs/components/Attachment/renderAttachment.js +28 -0
- package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -0
- package/lib-commonjs/components/Attachment/useAttachment.js +72 -0
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.js +139 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.js +23 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js +5 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/index.js +11 -0
- package/lib-commonjs/components/AttachmentList/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +20 -0
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js +68 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js +20 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.js +30 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.js.map +1 -0
- package/lib-commonjs/components/index.js +2 -0
- package/lib-commonjs/components/index.js.map +1 -1
- package/lib-commonjs/contexts/attachmentListContext.js +28 -0
- package/lib-commonjs/contexts/attachmentListContext.js.map +1 -0
- package/lib-commonjs/index.js +42 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,43 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-attachments",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 03 Apr 2024 22:27:26 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-attachments_v0.8.3",
|
|
7
|
+
"version": "0.8.3",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "tristan.watanabe@gmail.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
13
|
+
"commit": "db2c9191dc03bf477de894b8fb8a6c349147157b",
|
|
14
|
+
"comment": "fix: use getIntrinsicElementProps to replace deprecated getNativeElementProps."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "tristan.watanabe@gmail.com",
|
|
18
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
19
|
+
"commit": "6b759badcb2260ef4901988973ec37e9bed35a1f",
|
|
20
|
+
"comment": "feat: Implement AttachmentList component."
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Wed, 03 Apr 2024 00:23:41 GMT",
|
|
27
|
+
"tag": "@fluentui-copilot/react-attachments_v0.8.2",
|
|
28
|
+
"version": "0.8.2",
|
|
29
|
+
"comments": {
|
|
30
|
+
"patch": [
|
|
31
|
+
{
|
|
32
|
+
"author": "tristan.watanabe@gmail.com",
|
|
33
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
34
|
+
"commit": "42907801f4b0eb4a808729ac00f86380b3e8a5bf",
|
|
35
|
+
"comment": "feat: implement Attachment component."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "Thu, 14 Mar 2024 18:24:19 GMT",
|
|
6
42
|
"tag": "@fluentui-copilot/react-attachments_v0.8.1",
|
|
7
43
|
"version": "0.8.1",
|
|
8
44
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-attachments
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 03 Apr 2024 22:27:26 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.8.3](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.8.3)
|
|
8
|
+
|
|
9
|
+
Wed, 03 Apr 2024 22:27:26 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.8.2..@fluentui-copilot/react-attachments_v0.8.3)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- fix: use getIntrinsicElementProps to replace deprecated getNativeElementProps. ([PR #1509](https://github.com/microsoft/fluentai/pull/1509) by tristan.watanabe@gmail.com)
|
|
15
|
+
- feat: Implement AttachmentList component. ([PR #1488](https://github.com/microsoft/fluentai/pull/1488) by tristan.watanabe@gmail.com)
|
|
16
|
+
|
|
17
|
+
## [0.8.2](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.8.2)
|
|
18
|
+
|
|
19
|
+
Wed, 03 Apr 2024 00:23:41 GMT
|
|
20
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.8.1..@fluentui-copilot/react-attachments_v0.8.2)
|
|
21
|
+
|
|
22
|
+
### Patches
|
|
23
|
+
|
|
24
|
+
- feat: implement Attachment component. ([PR #1466](https://github.com/microsoft/fluentai/pull/1466) by tristan.watanabe@gmail.com)
|
|
25
|
+
|
|
7
26
|
## [0.8.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.8.1)
|
|
8
27
|
|
|
9
|
-
Thu, 14 Mar 2024 18:24:
|
|
28
|
+
Thu, 14 Mar 2024 18:24:19 GMT
|
|
10
29
|
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.8.0..@fluentui-copilot/react-attachments_v0.8.1)
|
|
11
30
|
|
|
12
31
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,78 @@
|
|
|
2
2
|
|
|
3
3
|
import type { ComponentProps } from '@fluentui/react-components';
|
|
4
4
|
import type { ComponentState } from '@fluentui/react-components';
|
|
5
|
+
import type { Context } from '@fluentui/react-context-selector';
|
|
6
|
+
import type { ContextSelector } from '@fluentui/react-context-selector';
|
|
7
|
+
import { FC } from 'react';
|
|
5
8
|
import type { ForwardRefComponent } from '@fluentui/react-components';
|
|
6
|
-
import
|
|
9
|
+
import { Provider } from 'react';
|
|
10
|
+
import { ProviderProps } from 'react';
|
|
11
|
+
import * as React_2 from 'react';
|
|
7
12
|
import type { Slot } from '@fluentui/react-components';
|
|
8
13
|
import type { SlotClassNames } from '@fluentui/react-components';
|
|
9
14
|
|
|
15
|
+
export declare const Attachment: ForwardRefComponent<AttachmentProps>;
|
|
16
|
+
|
|
17
|
+
export declare const attachmentClassNames: SlotClassNames<AttachmentSlots>;
|
|
18
|
+
|
|
19
|
+
declare type AttachmentDismissedData = {
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export declare const AttachmentList: ForwardRefComponent<AttachmentListProps>;
|
|
24
|
+
|
|
25
|
+
export declare const attachmentListClassNames: SlotClassNames<AttachmentListSlots>;
|
|
26
|
+
|
|
27
|
+
export declare const AttachmentListContext: Context<AttachmentListContextValue>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Context shared between AttachmentList and its children components
|
|
31
|
+
*/
|
|
32
|
+
export declare type AttachmentListContextValue = Pick<AttachmentListProps, 'onAttachmentDismiss'>;
|
|
33
|
+
|
|
34
|
+
declare type AttachmentListContextValues = {
|
|
35
|
+
attachmentList: AttachmentListContextValue;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* AttachmentList Props
|
|
40
|
+
*/
|
|
41
|
+
export declare type AttachmentListProps = ComponentProps<Partial<AttachmentListSlots>> & {
|
|
42
|
+
onAttachmentDismiss?: (e: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>, data: AttachmentDismissedData) => void;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export declare const AttachmentListProvider: Provider<AttachmentListContextValue> & FC<ProviderProps<AttachmentListContextValue>>;
|
|
46
|
+
|
|
47
|
+
export declare type AttachmentListSlots = {
|
|
48
|
+
root: Slot<'div'>;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* State used in rendering AttachmentList
|
|
53
|
+
*/
|
|
54
|
+
export declare type AttachmentListState = ComponentState<AttachmentListSlots> & Pick<AttachmentListProps, 'onAttachmentDismiss'>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Attachment Props
|
|
58
|
+
*/
|
|
59
|
+
export declare type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & {
|
|
60
|
+
id: string;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export declare type AttachmentSlots = {
|
|
64
|
+
root: NonNullable<Slot<'div'>>;
|
|
65
|
+
primaryAction: NonNullable<Slot<'button', 'span'>>;
|
|
66
|
+
dismissButton: NonNullable<Slot<'button'>>;
|
|
67
|
+
media?: Slot<'span'>;
|
|
68
|
+
content: NonNullable<Slot<'span'>>;
|
|
69
|
+
dismissIcon: NonNullable<Slot<'span'>>;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* State used in rendering Attachment
|
|
74
|
+
*/
|
|
75
|
+
export declare type AttachmentState = ComponentState<AttachmentSlots>;
|
|
76
|
+
|
|
10
77
|
export declare const AttachmentTag: ForwardRefComponent<AttachmentTagProps>;
|
|
11
78
|
|
|
12
79
|
export declare const attachmentTagClassNames: SlotClassNames<AttachmentTagSlots>;
|
|
@@ -83,6 +150,16 @@ export declare type AttachmentTagSlots = {
|
|
|
83
150
|
*/
|
|
84
151
|
export declare type AttachmentTagState = ComponentState<AttachmentTagSlots>;
|
|
85
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Render the final JSX of Attachment
|
|
155
|
+
*/
|
|
156
|
+
export declare const renderAttachment_unstable: (state: AttachmentState) => JSX.Element;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Render the final JSX of AttachmentList
|
|
160
|
+
*/
|
|
161
|
+
export declare const renderAttachmentList_unstable: (state: AttachmentListState, contextValues: AttachmentListContextValues) => JSX.Element;
|
|
162
|
+
|
|
86
163
|
/**
|
|
87
164
|
* Render the final JSX of AttachmentTag
|
|
88
165
|
*/
|
|
@@ -98,6 +175,40 @@ export declare const renderAttachmentTagItem_unstable: (state: AttachmentTagItem
|
|
|
98
175
|
*/
|
|
99
176
|
export declare const renderAttachmentTagList_unstable: (state: AttachmentTagListState, contextValues: AttachmentTagListContextValues) => JSX.Element;
|
|
100
177
|
|
|
178
|
+
/**
|
|
179
|
+
* Create the state required to render Attachment.
|
|
180
|
+
*
|
|
181
|
+
* The returned state can be modified with hooks such as useAttachmentStyles_unstable,
|
|
182
|
+
* before being passed to renderAttachment_unstable.
|
|
183
|
+
*
|
|
184
|
+
* @param props - props from this instance of Attachment
|
|
185
|
+
* @param ref - reference to root HTMLElement of Attachment
|
|
186
|
+
*/
|
|
187
|
+
export declare const useAttachment_unstable: (props: AttachmentProps, ref: React_2.Ref<HTMLDivElement>) => AttachmentState;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Create the state required to render AttachmentList.
|
|
191
|
+
*
|
|
192
|
+
* The returned state can be modified with hooks such as useAttachmentListStyles_unstable,
|
|
193
|
+
* before being passed to renderAttachmentList_unstable.
|
|
194
|
+
*
|
|
195
|
+
* @param props - props from this instance of AttachmentList
|
|
196
|
+
* @param ref - reference to root HTMLElement of AttachmentList
|
|
197
|
+
*/
|
|
198
|
+
export declare const useAttachmentList_unstable: (props: AttachmentListProps, ref: React_2.Ref<HTMLDivElement>) => AttachmentListState;
|
|
199
|
+
|
|
200
|
+
export declare const useAttachmentListContext_unstable: <T>(selector: ContextSelector<AttachmentListContextValue, T>) => T;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Apply styling to the AttachmentList slots based on the state
|
|
204
|
+
*/
|
|
205
|
+
export declare const useAttachmentListStyles_unstable: (state: AttachmentListState) => AttachmentListState;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Apply styling to the Attachment slots based on the state
|
|
209
|
+
*/
|
|
210
|
+
export declare const useAttachmentStyles_unstable: (state: AttachmentState) => AttachmentState;
|
|
211
|
+
|
|
101
212
|
/**
|
|
102
213
|
* Create the state required to render AttachmentTag.
|
|
103
214
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Attachment.ts"],"sourcesContent":["export * from './components/Attachment/index';\n"],"names":[],"mappings":"AAAA,cAAc,gCAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentList.ts"],"sourcesContent":["export * from './components/AttachmentList/index';\n"],"names":[],"mappings":"AAAA,cAAc,oCAAoC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useAttachment_unstable } from './useAttachment';
|
|
3
|
+
import { renderAttachment_unstable } from './renderAttachment';
|
|
4
|
+
import { useAttachmentStyles_unstable } from './useAttachmentStyles';
|
|
5
|
+
// Attachment component - TODO: add more docs
|
|
6
|
+
export const Attachment = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
|
+
const state = useAttachment_unstable(props, ref);
|
|
8
|
+
useAttachmentStyles_unstable(state);
|
|
9
|
+
return renderAttachment_unstable(state);
|
|
10
|
+
});
|
|
11
|
+
Attachment.displayName = 'Attachment';
|
|
12
|
+
//# sourceMappingURL=Attachment.js.map
|
|
@@ -0,0 +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';\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"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,wBAAwB;AAIrE,6CAA6C;AAC7C,OAAO,MAAMC,2BAAmDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,QAAQP,uBAAuBK,OAAOC;IAE5CJ,6BAA6BK;IAC7B,OAAON,0BAA0BM;AACnC,GAAG;AAEHJ,WAAWK,WAAW,GAAG"}
|
|
@@ -0,0 +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 id: string;\n};\n\n/**\n * State used in rendering Attachment\n */\nexport type AttachmentState = ComponentState<AttachmentSlots>;\n"],"names":[],"mappings":"AAAA,WAqB8D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Attachment';\nexport * from './Attachment.types';\nexport * from './renderAttachment';\nexport * from './useAttachment';\nexport * from './useAttachmentStyles';\n"],"names":[],"mappings":"AAAA,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,kBAAkB;AAChC,cAAc,wBAAwB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from '@fluentui/react-components';
|
|
3
|
+
/**
|
|
4
|
+
* Render the final JSX of Attachment
|
|
5
|
+
*/
|
|
6
|
+
export const renderAttachment_unstable = state => {
|
|
7
|
+
assertSlots(state);
|
|
8
|
+
return /*#__PURE__*/_jsxs(state.root, {
|
|
9
|
+
children: [/*#__PURE__*/_jsxs(state.primaryAction, {
|
|
10
|
+
children: [state.media && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.content, {})]
|
|
11
|
+
}), /*#__PURE__*/_jsx(state.dismissButton, {
|
|
12
|
+
children: /*#__PURE__*/_jsx(state.dismissIcon, {})
|
|
13
|
+
})]
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=renderAttachment.js.map
|
|
@@ -0,0 +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 return (\n <state.root>\n <state.primaryAction>\n {state.media && <state.media />}\n <state.content />\n </state.primaryAction>\n <state.dismissButton>\n <state.dismissIcon />\n </state.dismissButton>\n </state.root>\n );\n};\n"],"names":["assertSlots","renderAttachment_unstable","state","root","primaryAction","media","content","dismissButton","dismissIcon"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,4BAA4B,CAACC;IACxCF,YAA6BE;IAE7B,qBACE,MAACA,MAAMC,IAAI;;0BACT,MAACD,MAAME,aAAa;;oBACjBF,MAAMG,KAAK,kBAAI,KAACH,MAAMG,KAAK;kCAC5B,KAACH,MAAMI,OAAO;;;0BAEhB,KAACJ,MAAMK,aAAa;0BAClB,cAAA,KAACL,MAAMM,WAAW;;;;AAI1B,EAAE"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getIntrinsicElementProps, mergeCallbacks, slot } from '@fluentui/react-components';
|
|
3
|
+
import { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';
|
|
4
|
+
import { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render Attachment.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useAttachmentStyles_unstable,
|
|
9
|
+
* before being passed to renderAttachment_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of Attachment
|
|
12
|
+
* @param ref - reference to root HTMLElement of Attachment
|
|
13
|
+
*/
|
|
14
|
+
export const useAttachment_unstable = (props, ref) => {
|
|
15
|
+
const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);
|
|
16
|
+
const onAttachmentDismiss = useAttachmentListContext_unstable(context => context.onAttachmentDismiss);
|
|
17
|
+
const root = slot.always(getIntrinsicElementProps('div', {
|
|
18
|
+
ref,
|
|
19
|
+
...props
|
|
20
|
+
}), {
|
|
21
|
+
elementType: 'div'
|
|
22
|
+
});
|
|
23
|
+
const primaryAction = slot.always(props.primaryAction, {
|
|
24
|
+
elementType: 'button'
|
|
25
|
+
});
|
|
26
|
+
const dismissButton = slot.always(props.dismissButton, {
|
|
27
|
+
defaultProps: {
|
|
28
|
+
'aria-label': 'Dismiss'
|
|
29
|
+
},
|
|
30
|
+
elementType: 'button'
|
|
31
|
+
});
|
|
32
|
+
dismissButton.onClick = mergeCallbacks(dismissButton.onClick, ev => onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
|
|
33
|
+
id: props.id
|
|
34
|
+
}));
|
|
35
|
+
const media = slot.optional(props.media, {
|
|
36
|
+
elementType: 'span'
|
|
37
|
+
});
|
|
38
|
+
const content = slot.always(props.content, {
|
|
39
|
+
defaultProps: {
|
|
40
|
+
children: props.children
|
|
41
|
+
},
|
|
42
|
+
elementType: 'span'
|
|
43
|
+
});
|
|
44
|
+
const dismissIcon = slot.always(props.dismissIcon, {
|
|
45
|
+
defaultProps: {
|
|
46
|
+
children: /*#__PURE__*/React.createElement(DismissIcon, null)
|
|
47
|
+
},
|
|
48
|
+
elementType: 'span'
|
|
49
|
+
});
|
|
50
|
+
const state = {
|
|
51
|
+
components: {
|
|
52
|
+
root: 'div',
|
|
53
|
+
primaryAction: 'button',
|
|
54
|
+
dismissButton: 'button',
|
|
55
|
+
media: 'span',
|
|
56
|
+
content: 'span',
|
|
57
|
+
dismissIcon: 'span'
|
|
58
|
+
},
|
|
59
|
+
root,
|
|
60
|
+
primaryAction,
|
|
61
|
+
dismissButton,
|
|
62
|
+
media,
|
|
63
|
+
content,
|
|
64
|
+
dismissIcon
|
|
65
|
+
};
|
|
66
|
+
if (state.primaryAction.as === 'span') {
|
|
67
|
+
state.components.primaryAction = 'span';
|
|
68
|
+
}
|
|
69
|
+
return state;
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=useAttachment.js.map
|
|
@@ -0,0 +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 DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\n\n const onAttachmentDismiss = useAttachmentListContext_unstable(context => context.onAttachmentDismiss);\n\n const root = slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\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>) => onAttachmentDismiss?.(ev, { id: props.id }),\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 state: AttachmentState = {\n components: {\n root: 'div',\n primaryAction: 'button',\n dismissButton: 'button',\n media: 'span',\n content: 'span',\n dismissIcon: 'span',\n },\n\n root,\n primaryAction,\n dismissButton,\n media,\n content,\n dismissIcon,\n };\n\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","mergeCallbacks","slot","Dismiss20Regular","Dismiss20Filled","bundleIcon","useAttachmentListContext_unstable","useAttachment_unstable","props","ref","DismissIcon","onAttachmentDismiss","context","root","always","elementType","primaryAction","dismissButton","defaultProps","onClick","ev","id","media","optional","content","children","dismissIcon","state","components","as"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,cAAc,EAAEC,IAAI,QAAQ,6BAA6B;AAC5F,SAASC,gBAAgB,EAAEC,eAAe,EAAEC,UAAU,QAAQ,wBAAwB;AACtF,SAASC,iCAAiC,QAAQ,uCAAuC;AAGzF;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAyB,CAACC,OAAwBC;IAC7D,MAAMC,cAAcL,WAAWD,iBAAiBD;IAEhD,MAAMQ,sBAAsBL,kCAAkCM,CAAAA,UAAWA,QAAQD,mBAAmB;IAEpG,MAAME,OAAOX,KAAKY,MAAM,CACtBd,yBAAyB,OAAO;QAC9BS;QACA,GAAGD,KAAK;IACV,IACA;QAAEO,aAAa;IAAM;IAGvB,MAAMC,gBAAgBd,KAAKY,MAAM,CAACN,MAAMQ,aAAa,EAAE;QACrDD,aAAa;IACf;IAEA,MAAME,gBAAgBf,KAAKY,MAAM,CAACN,MAAMS,aAAa,EAAE;QACrDC,cAAc;YAAE,cAAc;QAAU;QACxCH,aAAa;IACf;IAEAE,cAAcE,OAAO,GAAGlB,eACtBgB,cAAcE,OAAO,EACrB,CAACC,KAAgET,gCAAAA,0CAAAA,oBAAsBS,IAAI;YAAEC,IAAIb,MAAMa,EAAE;QAAC;IAG5G,MAAMC,QAAQpB,KAAKqB,QAAQ,CAACf,MAAMc,KAAK,EAAE;QAAEP,aAAa;IAAO;IAE/D,MAAMS,UAAUtB,KAAKY,MAAM,CAACN,MAAMgB,OAAO,EAAE;QACzCN,cAAc;YACZO,UAAUjB,MAAMiB,QAAQ;QAC1B;QACAV,aAAa;IACf;IAEA,MAAMW,cAAcxB,KAAKY,MAAM,CAACN,MAAMkB,WAAW,EAAE;QACjDR,cAAc;YACZO,wBAAU,oBAACf;QACb;QACAK,aAAa;IACf;IAEA,MAAMY,QAAyB;QAC7BC,YAAY;YACVf,MAAM;YACNG,eAAe;YACfC,eAAe;YACfK,OAAO;YACPE,SAAS;YACTE,aAAa;QACf;QAEAb;QACAG;QACAC;QACAK;QACAE;QACAE;IACF;IAEA,IAAIC,MAAMX,aAAa,CAACa,EAAE,KAAK,QAAQ;QACrCF,MAAMC,UAAU,CAACZ,aAAa,GAAG;IACnC;IAEA,OAAOW;AACT,EAAE"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { createCustomFocusIndicatorStyle, __resetStyles, __styles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';
|
|
2
|
+
export const attachmentClassNames = {
|
|
3
|
+
root: 'fai-Attachment',
|
|
4
|
+
primaryAction: 'fai-Attachment__primaryAction',
|
|
5
|
+
dismissButton: 'fai-Attachment__dismissButton',
|
|
6
|
+
media: 'fai-Attachment__media',
|
|
7
|
+
content: 'fai-Attachment__content',
|
|
8
|
+
dismissIcon: 'fai-Attachment__dismissIcon'
|
|
9
|
+
};
|
|
10
|
+
const ATTACHMENT_MAXWIDTH = '180px';
|
|
11
|
+
const ATTACHMENT_SIZE = '20px';
|
|
12
|
+
const useRootBaseClassName = __resetStyles("rj3sqpg", null, [".rj3sqpg{display:inline-flex;flex-wrap:nowrap;vertical-align:middle;box-sizing:border-box;width:fit-content;}"]);
|
|
13
|
+
const buttonBaseStyles = {
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
backgroundColor: tokens.colorNeutralBackground1,
|
|
16
|
+
border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,
|
|
17
|
+
borderRadius: tokens.borderRadiusMedium,
|
|
18
|
+
boxSizing: 'border-box',
|
|
19
|
+
columnGap: tokens.spacingHorizontalSNudge,
|
|
20
|
+
color: tokens.colorNeutralForeground1,
|
|
21
|
+
cursor: 'pointer',
|
|
22
|
+
display: 'inline-flex',
|
|
23
|
+
flexWrap: 'nowrap',
|
|
24
|
+
justifyContent: 'center',
|
|
25
|
+
...createCustomFocusIndicatorStyle({
|
|
26
|
+
...shorthands.outline(tokens.strokeWidthThick, 'solid', tokens.colorStrokeFocus2),
|
|
27
|
+
zIndex: 1
|
|
28
|
+
}),
|
|
29
|
+
verticalAlign: 'middle'
|
|
30
|
+
};
|
|
31
|
+
const usePrimaryActionBaseClassName = __resetStyles("rftb5h9", "rofiitm", [".rftb5h9{align-items:center;background-color:var(--colorNeutralBackground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);color:var(--colorNeutralForeground1);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;vertical-align:middle;border-top-right-radius:var(--borderRadiusNone);border-bottom-right-radius:var(--borderRadiusNone);border-right-style:none;max-width:calc(180px - 20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS) - var(--spacingHorizontalXS));padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalXS) var(--spacingHorizontalS);}", ".rftb5h9[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}", ".rofiitm{align-items:center;background-color:var(--colorNeutralBackground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);color:var(--colorNeutralForeground1);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;vertical-align:middle;border-top-left-radius:var(--borderRadiusNone);border-bottom-left-radius:var(--borderRadiusNone);border-left-style:none;max-width:calc(180px - 20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS) - var(--spacingHorizontalXS));padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalXS) var(--spacingHorizontalS);}", ".rofiitm[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}"]);
|
|
32
|
+
const usePrimaryActionStyles = __styles({
|
|
33
|
+
button: {
|
|
34
|
+
eoavqd: "f8491dx",
|
|
35
|
+
Jwef8y: "f1h648pw",
|
|
36
|
+
Bi91k9c: "fnwyq0v",
|
|
37
|
+
ecr2s2: "fwdzr64",
|
|
38
|
+
lj723h: "flvvhsy",
|
|
39
|
+
Bqrx1nm: "fq7113v",
|
|
40
|
+
kx9iu6: "fp3oj7s"
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
h: [".f8491dx:hover{cursor:pointer;}", ".f1h648pw:hover{background-color:var(--colorNeutralBackground3Hover);}", ".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}"],
|
|
44
|
+
a: [".fwdzr64:active{background-color:var(--colorNeutralBackground3Pressed);}", ".flvvhsy:active{color:var(--colorNeutralForeground2Pressed);}"],
|
|
45
|
+
m: [["@media (forced-colors: active){.fq7113v:hover{background-color:HighlightText;}}", {
|
|
46
|
+
m: "(forced-colors: active)"
|
|
47
|
+
}], ["@media (forced-colors: active){.fp3oj7s:active{background-color:HighlightText;}}", {
|
|
48
|
+
m: "(forced-colors: active)"
|
|
49
|
+
}]]
|
|
50
|
+
});
|
|
51
|
+
const useDismissButtonBaseClassName = __resetStyles("r1cf2ehf", "rhq1520", {
|
|
52
|
+
r: [".r1cf2ehf{align-items:center;background-color:var(--colorNeutralBackground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);color:var(--colorNeutralForeground1);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;vertical-align:middle;padding:var(--spacingVerticalXS) var(--spacingHorizontalXS) var(--spacingVerticalXS) var(--spacingHorizontalXS);max-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);min-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);border-left-color:var(--colorNeutralStroke1);border-top-left-radius:var(--borderRadiusNone);border-bottom-left-radius:var(--borderRadiusNone);border-top-right-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);}", ".r1cf2ehf[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}", ".r1cf2ehf:hover{cursor:pointer;background-color:var(--colorNeutralBackground3Hover);color:var(--colorNeutralForeground2BrandHover);}", ".r1cf2ehf:hover .fai-Attachment__dismissIcon{color:var(--colorBrandForegroundLinkHover);}", ".r1cf2ehf:active{background-color:var(--colorNeutralBackground3Pressed);color:var(--colorNeutralForeground2BrandPressed);}", ".r1cf2ehf:focus .fai-Attachment__dismissIcon{color:var(--colorNeutralForeground2BrandHover);}", ".rhq1520{align-items:center;background-color:var(--colorNeutralBackground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);box-sizing:border-box;column-gap:var(--spacingHorizontalSNudge);color:var(--colorNeutralForeground1);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;vertical-align:middle;padding:var(--spacingVerticalXS) var(--spacingHorizontalXS) var(--spacingVerticalXS) var(--spacingHorizontalXS);max-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);min-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS))+var(--spacingHorizontalXS);border-right-color:var(--colorNeutralStroke1);border-top-right-radius:var(--borderRadiusNone);border-bottom-right-radius:var(--borderRadiusNone);border-top-left-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);}", ".rhq1520[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}", ".rhq1520:hover{cursor:pointer;background-color:var(--colorNeutralBackground3Hover);color:var(--colorNeutralForeground2BrandHover);}", ".rhq1520:hover .fai-Attachment__dismissIcon{color:var(--colorBrandForegroundLinkHover);}", ".rhq1520:active{background-color:var(--colorNeutralBackground3Pressed);color:var(--colorNeutralForeground2BrandPressed);}", ".rhq1520:focus .fai-Attachment__dismissIcon{color:var(--colorNeutralForeground2BrandHover);}"],
|
|
53
|
+
s: ["@media (forced-colors: active){.r1cf2ehf:hover{background-color:HighlightText;}.r1cf2ehf:active{background-color:HighlightText;}}", "@media (forced-colors: active){.rhq1520:hover{background-color:HighlightText;}.rhq1520:active{background-color:HighlightText;}}"]
|
|
54
|
+
});
|
|
55
|
+
const useMediaBaseClassName = __resetStyles("rz1lum2", null, [".rz1lum2{display:inline-flex;font-size:20px;height:20px;line-height:20px;width:20px;}"]);
|
|
56
|
+
const useContentBaseClassName = __resetStyles("rmt99gk", null, [".rmt99gk{overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);}"]);
|
|
57
|
+
const useDismissIconBaseClassName = __resetStyles("r176grtk", null, [".r176grtk{align-items:center;border-radius:var(--borderRadiusCircular);border:var(--strokeWidthThin) solid var(--colorTransparentStroke);box-sizing:border-box;color:var(--colorNeutralForeground1);display:inline-flex;font-size:20px;height:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingVerticalXXS));justify-content:center;max-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS));min-width:calc(20px + var(--strokeWidthThin) * 2 + var(--spacingHorizontalXXS));padding:calc(var(--spacingVerticalXXS) / 2) calc(var(--spacingHorizontalXXS) / 2);}"]);
|
|
58
|
+
/**
|
|
59
|
+
* Apply styling to the Attachment slots based on the state
|
|
60
|
+
*/
|
|
61
|
+
export const useAttachmentStyles_unstable = state => {
|
|
62
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
63
|
+
const primaryActionBaseClassName = usePrimaryActionBaseClassName();
|
|
64
|
+
const dismissButtonBaseClassName = useDismissButtonBaseClassName();
|
|
65
|
+
const mediaBaseClassName = useMediaBaseClassName();
|
|
66
|
+
const contentBaseClassName = useContentBaseClassName();
|
|
67
|
+
const dismissIconBaseClassName = useDismissIconBaseClassName();
|
|
68
|
+
const primaryActionStyles = usePrimaryActionStyles();
|
|
69
|
+
const {
|
|
70
|
+
primaryAction
|
|
71
|
+
} = state;
|
|
72
|
+
state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);
|
|
73
|
+
state.primaryAction.className = mergeClasses(attachmentClassNames.primaryAction, primaryActionBaseClassName, primaryAction.as !== 'span' && primaryActionStyles.button, state.primaryAction.className);
|
|
74
|
+
state.dismissButton.className = mergeClasses(attachmentClassNames.dismissButton, dismissButtonBaseClassName, state.dismissButton.className);
|
|
75
|
+
if (state.media) {
|
|
76
|
+
state.media.className = mergeClasses(attachmentClassNames.media, mediaBaseClassName, state.media.className);
|
|
77
|
+
}
|
|
78
|
+
state.content.className = mergeClasses(attachmentClassNames.content, contentBaseClassName, state.content.className);
|
|
79
|
+
state.dismissIcon.className = mergeClasses(attachmentClassNames.dismissIcon, dismissIconBaseClassName, state.dismissIcon.className);
|
|
80
|
+
return state;
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=useAttachmentStyles.js.map
|
|
@@ -0,0 +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});\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\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 { 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 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(attachmentClassNames.content, contentBaseClassName, state.content.className);\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","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","useAttachmentStyles_unstable","state","rootBaseClassName","primaryActionBaseClassName","dismissButtonBaseClassName","mediaBaseClassName","contentBaseClassName","dismissIconBaseClassName","primaryActionStyles","className","as"],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useAttachmentList_unstable } from './useAttachmentList';
|
|
3
|
+
import { renderAttachmentList_unstable } from './renderAttachmentList';
|
|
4
|
+
import { useAttachmentListStyles_unstable } from './useAttachmentListStyles';
|
|
5
|
+
import { useAttachmentListContextValues_unstable } from './useAttachmentListContextValues';
|
|
6
|
+
export const AttachmentList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
|
+
const state = useAttachmentList_unstable(props, ref);
|
|
8
|
+
const contextValues = useAttachmentListContextValues_unstable(state);
|
|
9
|
+
useAttachmentListStyles_unstable(state);
|
|
10
|
+
return renderAttachmentList_unstable(state, contextValues);
|
|
11
|
+
});
|
|
12
|
+
AttachmentList.displayName = 'AttachmentList';
|
|
13
|
+
//# sourceMappingURL=AttachmentList.js.map
|
|
@@ -0,0 +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';\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"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,uCAAuC,QAAQ,mCAAmC;AAI3F,OAAO,MAAMC,+BAA2DL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQR,2BAA2BM,OAAOC;IAChD,MAAME,gBAAgBN,wCAAwCK;IAE9DN,iCAAiCM;IAEjC,OAAOP,8BAA8BO,OAAOC;AAC9C,GAAG;AAEHL,eAAeM,WAAW,GAAG"}
|
|
@@ -0,0 +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: string;\n};\n\n/**\n * AttachmentList Props\n */\nexport type AttachmentListProps = ComponentProps<Partial<AttachmentListSlots>> & {\n onAttachmentDismiss?: (\n e: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>,\n data: AttachmentDismissedData,\n ) => void;\n};\n\n/**\n * State used in rendering AttachmentList\n */\nexport type AttachmentListState = ComponentState<AttachmentListSlots> &\n Pick<AttachmentListProps, 'onAttachmentDismiss'>;\n\nexport type AttachmentListContextValues = {\n attachmentList: AttachmentListContextValue;\n};\n"],"names":[],"mappings":"AAAA,WA6BE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './AttachmentList';\nexport * from './AttachmentList.types';\nexport * from './renderAttachmentList';\nexport * from './useAttachmentList';\nexport * from './useAttachmentListStyles';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,4BAA4B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from '@fluentui/react-components';
|
|
3
|
+
import { AttachmentListProvider } from '../../contexts/attachmentListContext';
|
|
4
|
+
/**
|
|
5
|
+
* Render the final JSX of AttachmentList
|
|
6
|
+
*/
|
|
7
|
+
export const renderAttachmentList_unstable = (state, contextValues) => {
|
|
8
|
+
assertSlots(state);
|
|
9
|
+
return /*#__PURE__*/_jsx(AttachmentListProvider, {
|
|
10
|
+
value: contextValues.attachmentList,
|
|
11
|
+
children: /*#__PURE__*/_jsx(state.root, {})
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=renderAttachmentList.js.map
|
|
@@ -0,0 +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","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AACzD,SAASC,sBAAsB,QAAQ,uCAAuC;AAG9E;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEAJ,YAAiCG;IAEjC,qBACE,KAACF;QAAuBI,OAAOD,cAAcE,cAAc;kBACzD,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}
|