@fluentui-copilot/react-attachments 0.8.0 → 0.8.2
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 +86 -0
- package/lib/Attachment.js +2 -0
- package/lib/Attachment.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 +73 -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/AttachmentTag/useAttachmentTag.js +5 -48
- package/lib/components/AttachmentTag/useAttachmentTag.js.map +1 -1
- package/lib/components/AttachmentTag/useAttachmentTagStyles.js +16 -4
- package/lib/components/AttachmentTag/useAttachmentTagStyles.js.map +1 -1
- package/lib/components/AttachmentTagItem/AttachmentTagItem.js +0 -1
- package/lib/components/AttachmentTagItem/AttachmentTagItem.js.map +1 -1
- package/lib/components/AttachmentTagItem/AttachmentTagItem.types.js +1 -2
- package/lib/components/AttachmentTagItem/AttachmentTagItem.types.js.map +1 -1
- package/lib/components/AttachmentTagItem/renderAttachmentTagItem.js +4 -3
- package/lib/components/AttachmentTagItem/renderAttachmentTagItem.js.map +1 -1
- package/lib/components/AttachmentTagItem/useAttachmentTagItem.js +9 -17
- package/lib/components/AttachmentTagItem/useAttachmentTagItem.js.map +1 -1
- package/lib/components/AttachmentTagItem/useAttachmentTagItemStyles.js +17 -9
- package/lib/components/AttachmentTagItem/useAttachmentTagItemStyles.js.map +1 -1
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/utils/useAttachmentTagSlots.js +62 -0
- package/lib/components/utils/useAttachmentTagSlots.js.map +1 -0
- package/lib/index.js +2 -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/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 +74 -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/AttachmentTag/useAttachmentTag.js +5 -45
- package/lib-commonjs/components/AttachmentTag/useAttachmentTag.js.map +1 -1
- package/lib-commonjs/components/AttachmentTag/useAttachmentTagStyles.js +12 -0
- package/lib-commonjs/components/AttachmentTag/useAttachmentTagStyles.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.types.js +0 -2
- package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.types.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/renderAttachmentTagItem.js +7 -2
- package/lib-commonjs/components/AttachmentTagItem/renderAttachmentTagItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItem.js +9 -16
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItemStyles.js +18 -8
- package/lib-commonjs/components/AttachmentTagItem/useAttachmentTagItemStyles.js.map +1 -1
- package/lib-commonjs/components/index.js +1 -0
- package/lib-commonjs/components/index.js.map +1 -1
- package/lib-commonjs/components/utils/useAttachmentTagSlots.js +62 -0
- package/lib-commonjs/components/utils/useAttachmentTagSlots.js.map +1 -0
- package/lib-commonjs/index.js +32 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +1 -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, 03 Apr 2024 00:23:26 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-attachments_v0.8.2",
|
|
7
|
+
"version": "0.8.2",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "tristan.watanabe@gmail.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
13
|
+
"commit": "42907801f4b0eb4a808729ac00f86380b3e8a5bf",
|
|
14
|
+
"comment": "feat: implement Attachment component."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 14 Mar 2024 18:24:19 GMT",
|
|
21
|
+
"tag": "@fluentui-copilot/react-attachments_v0.8.1",
|
|
22
|
+
"version": "0.8.1",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "tristan.watanabe@gmail.com",
|
|
27
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
28
|
+
"commit": "14ce40ddbee4d35f3f4bcf03521d60715b03d59c",
|
|
29
|
+
"comment": "feat: implement AttachmentTagItem component."
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Wed, 13 Mar 2024 18:01:50 GMT",
|
|
6
36
|
"tag": "@fluentui-copilot/react-attachments_v0.8.0",
|
|
7
37
|
"version": "0.8.0",
|
|
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, 03 Apr 2024 00:23:26 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.8.2](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.8.2)
|
|
8
|
+
|
|
9
|
+
Wed, 03 Apr 2024 00:23:26 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.8.1..@fluentui-copilot/react-attachments_v0.8.2)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- feat: implement Attachment component. ([PR #1466](https://github.com/microsoft/fluentai/pull/1466) by tristan.watanabe@gmail.com)
|
|
15
|
+
|
|
16
|
+
## [0.8.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.8.1)
|
|
17
|
+
|
|
18
|
+
Thu, 14 Mar 2024 18:24:19 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.8.0..@fluentui-copilot/react-attachments_v0.8.1)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- feat: implement AttachmentTagItem component. ([PR #1435](https://github.com/microsoft/fluentai/pull/1435) by tristan.watanabe@gmail.com)
|
|
24
|
+
|
|
7
25
|
## [0.8.0](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.8.0)
|
|
8
26
|
|
|
9
|
-
Wed, 13 Mar 2024 18:
|
|
27
|
+
Wed, 13 Mar 2024 18:01:50 GMT
|
|
10
28
|
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentai/attachments_v0.7.1..@fluentui-copilot/react-attachments_v0.8.0)
|
|
11
29
|
|
|
12
30
|
### Minor changes
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,29 @@ import * as React_2 from 'react';
|
|
|
7
7
|
import type { Slot } from '@fluentui/react-components';
|
|
8
8
|
import type { SlotClassNames } from '@fluentui/react-components';
|
|
9
9
|
|
|
10
|
+
export declare const Attachment: ForwardRefComponent<AttachmentProps>;
|
|
11
|
+
|
|
12
|
+
export declare const attachmentClassNames: SlotClassNames<AttachmentSlots>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Attachment Props
|
|
16
|
+
*/
|
|
17
|
+
export declare type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> & {};
|
|
18
|
+
|
|
19
|
+
export declare type AttachmentSlots = {
|
|
20
|
+
root: NonNullable<Slot<'div'>>;
|
|
21
|
+
primaryAction: NonNullable<Slot<'button', 'span'>>;
|
|
22
|
+
dismissButton: NonNullable<Slot<'button'>>;
|
|
23
|
+
media?: Slot<'span'>;
|
|
24
|
+
content: NonNullable<Slot<'span'>>;
|
|
25
|
+
dismissIcon: NonNullable<Slot<'span'>>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* State used in rendering Attachment
|
|
30
|
+
*/
|
|
31
|
+
export declare type AttachmentState = ComponentState<AttachmentSlots>;
|
|
32
|
+
|
|
10
33
|
export declare const AttachmentTag: ForwardRefComponent<AttachmentTagProps>;
|
|
11
34
|
|
|
12
35
|
export declare const attachmentTagClassNames: SlotClassNames<AttachmentTagSlots>;
|
|
@@ -16,6 +39,27 @@ export declare type AttachmentTagDismissedData = {
|
|
|
16
39
|
media?: AttachmentTagProps['media'];
|
|
17
40
|
};
|
|
18
41
|
|
|
42
|
+
export declare const AttachmentTagItem: ForwardRefComponent<AttachmentTagItemProps>;
|
|
43
|
+
|
|
44
|
+
export declare const attachmentTagItemClassNames: SlotClassNames<AttachmentTagItemSlots>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* AttachmentTagItem Props
|
|
48
|
+
*/
|
|
49
|
+
export declare type AttachmentTagItemProps = ComponentProps<Partial<AttachmentTagItemSlots>>;
|
|
50
|
+
|
|
51
|
+
export declare type AttachmentTagItemSlots = {
|
|
52
|
+
root: NonNullable<Slot<'div'>>;
|
|
53
|
+
media?: Slot<'span'>;
|
|
54
|
+
content: NonNullable<Slot<'span'>>;
|
|
55
|
+
icon: NonNullable<Slot<'span'>>;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* State used in rendering AttachmentTagItem
|
|
60
|
+
*/
|
|
61
|
+
export declare type AttachmentTagItemState = ComponentState<AttachmentTagItemSlots>;
|
|
62
|
+
|
|
19
63
|
export declare const AttachmentTagList: ForwardRefComponent<AttachmentTagListProps>;
|
|
20
64
|
|
|
21
65
|
export declare const attachmentTagListClassNames: SlotClassNames<AttachmentTagListSlots>;
|
|
@@ -62,16 +106,42 @@ export declare type AttachmentTagSlots = {
|
|
|
62
106
|
*/
|
|
63
107
|
export declare type AttachmentTagState = ComponentState<AttachmentTagSlots>;
|
|
64
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Render the final JSX of Attachment
|
|
111
|
+
*/
|
|
112
|
+
export declare const renderAttachment_unstable: (state: AttachmentState) => JSX.Element;
|
|
113
|
+
|
|
65
114
|
/**
|
|
66
115
|
* Render the final JSX of AttachmentTag
|
|
67
116
|
*/
|
|
68
117
|
export declare const renderAttachmentTag_unstable: (state: AttachmentTagState) => JSX.Element;
|
|
69
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Render the final JSX of AttachmentTagItem
|
|
121
|
+
*/
|
|
122
|
+
export declare const renderAttachmentTagItem_unstable: (state: AttachmentTagItemState) => JSX.Element;
|
|
123
|
+
|
|
70
124
|
/**
|
|
71
125
|
* Render the final JSX of AttachmentTagList
|
|
72
126
|
*/
|
|
73
127
|
export declare const renderAttachmentTagList_unstable: (state: AttachmentTagListState, contextValues: AttachmentTagListContextValues) => JSX.Element;
|
|
74
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Create the state required to render Attachment.
|
|
131
|
+
*
|
|
132
|
+
* The returned state can be modified with hooks such as useAttachmentStyles_unstable,
|
|
133
|
+
* before being passed to renderAttachment_unstable.
|
|
134
|
+
*
|
|
135
|
+
* @param props - props from this instance of Attachment
|
|
136
|
+
* @param ref - reference to root HTMLElement of Attachment
|
|
137
|
+
*/
|
|
138
|
+
export declare const useAttachment_unstable: (props: AttachmentProps, ref: React_2.Ref<HTMLElement>) => AttachmentState;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Apply styling to the Attachment slots based on the state
|
|
142
|
+
*/
|
|
143
|
+
export declare const useAttachmentStyles_unstable: (state: AttachmentState) => AttachmentState;
|
|
144
|
+
|
|
75
145
|
/**
|
|
76
146
|
* Create the state required to render AttachmentTag.
|
|
77
147
|
*
|
|
@@ -83,6 +153,22 @@ export declare const renderAttachmentTagList_unstable: (state: AttachmentTagList
|
|
|
83
153
|
*/
|
|
84
154
|
export declare const useAttachmentTag_unstable: (props: AttachmentTagProps, ref: React_2.Ref<HTMLElement>) => AttachmentTagState;
|
|
85
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Create the state required to render AttachmentTagItem.
|
|
158
|
+
*
|
|
159
|
+
* The returned state can be modified with hooks such as useAttachmentTagItemStyles_unstable,
|
|
160
|
+
* before being passed to renderAttachmentTagItem_unstable.
|
|
161
|
+
*
|
|
162
|
+
* @param props - props from this instance of AttachmentTagItem
|
|
163
|
+
* @param ref - reference to root HTMLElement of AttachmentTagItem
|
|
164
|
+
*/
|
|
165
|
+
export declare const useAttachmentTagItem_unstable: (props: AttachmentTagItemProps, ref: React_2.Ref<HTMLElement>) => AttachmentTagItemState;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Apply styling to the AttachmentTagItem slots based on the state
|
|
169
|
+
*/
|
|
170
|
+
export declare const useAttachmentTagItemStyles_unstable: (state: AttachmentTagItemState) => AttachmentTagItemState;
|
|
171
|
+
|
|
86
172
|
/**
|
|
87
173
|
* Create the state required to render AttachmentTagList.
|
|
88
174
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Attachment.ts"],"sourcesContent":["export * from './components/Attachment/index';\n"],"names":[],"mappings":"AAAA,cAAc,gCAAgC"}
|
|
@@ -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\n/**\n * State used in rendering Attachment\n */\nexport type AttachmentState = ComponentState<AttachmentSlots>;\n"],"names":[],"mappings":"AAAA,WAmB8D"}
|
|
@@ -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,73 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getNativeElementProps, mergeCallbacks, slot } from '@fluentui/react-components';
|
|
3
|
+
import { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';
|
|
4
|
+
import { useAttachmentTagListContext_unstable } from '../../contexts/attachmentTagListContext';
|
|
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
|
+
//TODO: replace with context from to be created AttachmentList component
|
|
17
|
+
const onAttachmentTagDismiss = useAttachmentTagListContext_unstable(context => context.onAttachmentTagDismiss);
|
|
18
|
+
const root = slot.always(getNativeElementProps('div', {
|
|
19
|
+
ref,
|
|
20
|
+
...props
|
|
21
|
+
}), {
|
|
22
|
+
elementType: 'div'
|
|
23
|
+
});
|
|
24
|
+
const primaryAction = slot.always(props.primaryAction, {
|
|
25
|
+
elementType: 'button'
|
|
26
|
+
});
|
|
27
|
+
const dismissButton = slot.always(props.dismissButton, {
|
|
28
|
+
defaultProps: {
|
|
29
|
+
'aria-label': 'Dismiss'
|
|
30
|
+
},
|
|
31
|
+
elementType: 'button'
|
|
32
|
+
});
|
|
33
|
+
dismissButton.onClick = mergeCallbacks(dismissButton.onClick, ev => onAttachmentTagDismiss === null || onAttachmentTagDismiss === void 0 ? void 0 : onAttachmentTagDismiss(ev, {
|
|
34
|
+
content: props.children,
|
|
35
|
+
media: props.media
|
|
36
|
+
}));
|
|
37
|
+
const media = slot.optional(props.media, {
|
|
38
|
+
elementType: 'span'
|
|
39
|
+
});
|
|
40
|
+
const content = slot.always(props.content, {
|
|
41
|
+
defaultProps: {
|
|
42
|
+
children: props.children
|
|
43
|
+
},
|
|
44
|
+
elementType: 'span'
|
|
45
|
+
});
|
|
46
|
+
const dismissIcon = slot.always(props.dismissIcon, {
|
|
47
|
+
defaultProps: {
|
|
48
|
+
children: /*#__PURE__*/React.createElement(DismissIcon, null)
|
|
49
|
+
},
|
|
50
|
+
elementType: 'span'
|
|
51
|
+
});
|
|
52
|
+
const state = {
|
|
53
|
+
components: {
|
|
54
|
+
root: 'div',
|
|
55
|
+
primaryAction: 'button',
|
|
56
|
+
dismissButton: 'button',
|
|
57
|
+
media: 'span',
|
|
58
|
+
content: 'span',
|
|
59
|
+
dismissIcon: 'span'
|
|
60
|
+
},
|
|
61
|
+
root,
|
|
62
|
+
primaryAction,
|
|
63
|
+
dismissButton,
|
|
64
|
+
media,
|
|
65
|
+
content,
|
|
66
|
+
dismissIcon
|
|
67
|
+
};
|
|
68
|
+
if (state.primaryAction.as === 'span') {
|
|
69
|
+
state.components.primaryAction = 'span';
|
|
70
|
+
}
|
|
71
|
+
return state;
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=useAttachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, slot } from '@fluentui/react-components';\nimport { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';\nimport { useAttachmentTagListContext_unstable } from '../../contexts/attachmentTagListContext';\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<HTMLElement>): AttachmentState => {\n const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\n //TODO: replace with context from to be created AttachmentList component\n const onAttachmentTagDismiss = useAttachmentTagListContext_unstable(context => context.onAttachmentTagDismiss);\n\n const root = slot.always(\n getNativeElementProps('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>) =>\n onAttachmentTagDismiss?.(ev, { content: props.children, media: props.media }),\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","getNativeElementProps","mergeCallbacks","slot","Dismiss20Regular","Dismiss20Filled","bundleIcon","useAttachmentTagListContext_unstable","useAttachment_unstable","props","ref","DismissIcon","onAttachmentTagDismiss","context","root","always","elementType","primaryAction","dismissButton","defaultProps","onClick","ev","content","children","media","optional","dismissIcon","state","components","as"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,cAAc,EAAEC,IAAI,QAAQ,6BAA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A,IAAIC,MAAMV,aAAa,CAACY,EAAE,KAAK,QAAQ;QACrCF,MAAMC,UAAU,CAACX,aAAa,GAAG;IACnC;IAEA,OAAOU;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("r1u26nio", null, [".r1u26nio{display:inline-flex;flex-wrap:nowrap;vertical-align:middle;box-sizing:border-box;width:fit-content;max-width:180px;}"]);
|
|
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("r19jnv3a", null, [".r19jnv3a{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 maxWidth: ATTACHMENT_MAXWIDTH,\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 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","maxWidth","buttonBaseStyles","alignItems","backgroundColor","colorNeutralBackground1","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","columnGap","spacingHorizontalSNudge","color","colorNeutralForeground1","cursor","justifyContent","outline","strokeWidthThick","colorStrokeFocus2","zIndex","usePrimaryActionBaseClassName","borderTopRightRadius","borderRadiusNone","borderBottomRightRadius","borderRightStyle","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":"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,UAAUR;AACZ;AAEA,MAAMS,mBAAsC;IAC1CC,YAAY;IACZC,iBAAiBpB,OAAOqB,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEtB,OAAOuB,eA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IAAI,CAACgF,SAAS,GAAGrF,aAAaI,qBAAqBC,IAAI,EAAEyE,mBAAmBD,MAAMxE,IAAI,CAACgF,SAAS;IACtGR,MAAMvE,aAAa,CAAC+E,SAAS,GAAGrF,aAC9BI,qBAAqBE,aAAa,EAClCyE,4BACAzE,cAAcgF,EAAE,KAAK,UAAUF,oBAAoBlC,MAAM,EACzD2B,MAAMvE,aAAa,CAAC+E,SAAS;IAE/BR,MAAMtE,aAAa,CAAC8E,SAAS,GAAGrF,aAC9BI,qBAAqBG,aAAa,EAClCyE,4BACAH,MAAMtE,aAAa,CAAC8E,SAAS;IAE/B,IAAIR,MAAMrE,KAAK,EAAE;QACfqE,MAAMrE,KAAK,CAAC6E,SAAS,GAAGrF,aAAaI,qBAAqBI,KAAK,EAAEyE,oBAAoBJ,MAAMrE,KAAK,CAAC6E,SAAS;IAC5G;IACAR,MAAMpE,OAAO,CAAC4E,SAAS,GAAGrF,aAAaI,qBAAqBK,OAAO,EAAEyE,sBAAsBL,MAAMpE,OAAO,CAAC4E,SAAS;IAClHR,MAAMnE,WAAW,CAAC2E,SAAS,GAAGrF,aAC5BI,qBAAqBM,WAAW,EAChCyE,0BACAN,MAAMnE,WAAW,CAAC2E,SAAS;IAG7B,OAAOR;AACT,EAAE"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getNativeElementProps, mergeCallbacks, slot } from '@fluentui/react-components';
|
|
3
|
-
import { useHasParentContext } from '@fluentui/react-context-selector';
|
|
4
|
-
import { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';
|
|
5
|
-
import { useAttachmentTagListContext_unstable } from '../../contexts/attachmentTagListContext';
|
|
6
|
-
import { AttachmentTagListContext } from '../../contexts/attachmentTagListContext';
|
|
1
|
+
import { useAttachmentTagSlots } from '../utils/useAttachmentTagSlots';
|
|
7
2
|
/**
|
|
8
3
|
* Create the state required to render AttachmentTag.
|
|
9
4
|
*
|
|
@@ -14,51 +9,13 @@ import { AttachmentTagListContext } from '../../contexts/attachmentTagListContex
|
|
|
14
9
|
* @param ref - reference to root HTMLElement of AttachmentTag
|
|
15
10
|
*/
|
|
16
11
|
export const useAttachmentTag_unstable = (props, ref) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
children,
|
|
20
|
-
role
|
|
21
|
-
} = props;
|
|
22
|
-
const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);
|
|
23
|
-
const hasParentContext = useHasParentContext(AttachmentTagListContext);
|
|
24
|
-
const rootRole = role !== null && role !== void 0 ? role : hasParentContext ? 'menuitem' : undefined;
|
|
25
|
-
const root = slot.always(getNativeElementProps('button', {
|
|
26
|
-
ref,
|
|
27
|
-
...props,
|
|
28
|
-
role: rootRole
|
|
29
|
-
}), {
|
|
30
|
-
elementType: 'button'
|
|
31
|
-
});
|
|
32
|
-
root.onClick = mergeCallbacks(root.onClick, ev => onAttachmentTagDismiss === null || onAttachmentTagDismiss === void 0 ? void 0 : onAttachmentTagDismiss(ev, {
|
|
33
|
-
content: children,
|
|
34
|
-
media
|
|
35
|
-
}));
|
|
36
|
-
const media = slot.optional(props.media, {
|
|
37
|
-
elementType: 'span'
|
|
38
|
-
});
|
|
39
|
-
const content = slot.always(props.content, {
|
|
40
|
-
defaultProps: {
|
|
41
|
-
children
|
|
42
|
-
},
|
|
43
|
-
elementType: 'span'
|
|
44
|
-
});
|
|
45
|
-
const icon = slot.always(props.icon, {
|
|
46
|
-
defaultProps: {
|
|
47
|
-
children: /*#__PURE__*/React.createElement(DismissIcon, null)
|
|
48
|
-
},
|
|
49
|
-
elementType: 'span'
|
|
50
|
-
});
|
|
51
|
-
return {
|
|
52
|
-
components: {
|
|
12
|
+
return useAttachmentTagSlots(props, ref, {
|
|
13
|
+
elementType: {
|
|
53
14
|
root: 'button',
|
|
54
15
|
media: 'span',
|
|
55
16
|
content: 'span',
|
|
56
17
|
icon: 'span'
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
media,
|
|
60
|
-
content,
|
|
61
|
-
icon
|
|
62
|
-
};
|
|
18
|
+
}
|
|
19
|
+
});
|
|
63
20
|
};
|
|
64
21
|
//# sourceMappingURL=useAttachmentTag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTag.tsx"],"sourcesContent":["import * as React from 'react';\
|
|
1
|
+
{"version":3,"sources":["useAttachmentTag.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { useAttachmentTagSlots } from '../utils/useAttachmentTagSlots';\nimport type { AttachmentTagProps, AttachmentTagState } from './AttachmentTag.types';\n\n/**\n * Create the state required to render AttachmentTag.\n *\n * The returned state can be modified with hooks such as useAttachmentTagStyles_unstable,\n * before being passed to renderAttachmentTag_unstable.\n *\n * @param props - props from this instance of AttachmentTag\n * @param ref - reference to root HTMLElement of AttachmentTag\n */\nexport const useAttachmentTag_unstable = (\n props: AttachmentTagProps,\n ref: React.Ref<HTMLElement>,\n): AttachmentTagState => {\n return useAttachmentTagSlots(props, ref, {\n elementType: { root: 'button', media: 'span', content: 'span', icon: 'span' },\n });\n};\n"],"names":["useAttachmentTagSlots","useAttachmentTag_unstable","props","ref","elementType","root","media","content","icon"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,iCAAiC;AAGvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,OAAOH,sBAAsBE,OAAOC,KAAK;QACvCC,aAAa;YAAEC,MAAM;YAAUC,OAAO;YAAQC,SAAS;YAAQC,MAAM;QAAO;IAC9E;AACF,EAAE"}
|
|
@@ -5,12 +5,24 @@ export const attachmentTagClassNames = {
|
|
|
5
5
|
content: 'fai-AttachmentTag__content',
|
|
6
6
|
icon: 'fai-AttachmentTag__icon'
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export const ATTACHMENTTAG_MAXWIDTH = '180px';
|
|
9
12
|
const ATTACHMENTTAG_SIZE = '20px';
|
|
10
13
|
const useRootBaseClassName = __resetStyles("r1km3emv", "r21ecva", [".r1km3emv{color:var(--colorNeutralForeground1);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);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;max-width:180px;padding:var(--spacingVerticalXS) var(--spacingHorizontalXS) var(--spacingVerticalXS) var(--spacingHorizontalS);vertical-align:middle;}", ".r1km3emv:hover{border-color:var(--colorNeutralStroke1Hover);}", ".r1km3emv:hover .fai-AttachmentTag__icon{color:var(--colorBrandForegroundLinkHover);}", ".r1km3emv:hover:active{border-color:var(--colorNeutralStroke1Pressed);}", ".r1km3emv:hover:active .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandPressed);}", ".r1km3emv:focus .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandHover);}", ".r1km3emv:focus:active .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandPressed);}", ".r21ecva{color:var(--colorNeutralForeground1);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);cursor:pointer;display:inline-flex;flex-wrap:nowrap;justify-content:center;max-width:180px;padding:var(--spacingVerticalXS) var(--spacingHorizontalS) var(--spacingVerticalXS) var(--spacingHorizontalXS);vertical-align:middle;}", ".r21ecva:hover{border-color:var(--colorNeutralStroke1Hover);}", ".r21ecva:hover .fai-AttachmentTag__icon{color:var(--colorBrandForegroundLinkHover);}", ".r21ecva:hover:active{border-color:var(--colorNeutralStroke1Pressed);}", ".r21ecva:hover:active .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandPressed);}", ".r21ecva:focus .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandHover);}", ".r21ecva:focus:active .fai-AttachmentTag__icon{color:var(--colorNeutralForeground2BrandPressed);}"]);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export const useMediaBaseClassName = __resetStyles("r19jnv3a", null, [".r19jnv3a{font-size:20px;height:20px;line-height:20px;width:20px;}"]);
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export 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);}"]);
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export const useIconBaseClassName = __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);}"]);
|
|
14
26
|
/**
|
|
15
27
|
* Apply styling to the AttachmentTag slots based on the state
|
|
16
28
|
*/
|