@fluentui-copilot/react-attachments 0.9.2 → 0.9.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 +16 -1
- package/CHANGELOG.md +11 -2
- package/dist/index.d.ts +16 -3
- package/lib/components/Attachment/Attachment.types.js.map +1 -1
- package/lib/components/Attachment/renderAttachment.js +1 -1
- package/lib/components/Attachment/renderAttachment.js.map +1 -1
- package/lib/components/Attachment/useAttachment.js +15 -3
- package/lib/components/Attachment/useAttachment.js.map +1 -1
- package/lib/components/Attachment/useAttachmentStyles.js +22 -4
- package/lib/components/Attachment/useAttachmentStyles.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +1 -1
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +15 -3
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js +23 -5
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +4 -2
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +12 -2
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js +21 -5
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js.map +1 -1
- package/lib/components/utils/useProgressBarStyles.js +54 -0
- package/lib/components/utils/useProgressBarStyles.js.map +1 -0
- package/lib-commonjs/components/Attachment/Attachment.types.js.map +1 -1
- package/lib-commonjs/components/Attachment/renderAttachment.js +2 -1
- package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachment.js +14 -2
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachmentStyles.js +22 -4
- package/lib-commonjs/components/Attachment/useAttachmentStyles.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +2 -2
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +14 -2
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js +24 -6
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +6 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +11 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js +20 -4
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js.map +1 -1
- package/lib-commonjs/components/utils/useProgressBarStyles.js +103 -0
- package/lib-commonjs/components/utils/useProgressBarStyles.js.map +1 -0
- package/package.json +2 -1
package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js
CHANGED
|
@@ -17,10 +17,11 @@ _export(exports, {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _useProgressBarStyles = require("../utils/useProgressBarStyles");
|
|
20
21
|
const attachmentOverflowMenuItemClassNames = {
|
|
21
|
-
root: 'fai-AttachmentOverflowMenuItem'
|
|
22
|
+
root: 'fai-AttachmentOverflowMenuItem',
|
|
23
|
+
progress: 'fai-AttachmentOverflowMenuItem__progress'
|
|
22
24
|
};
|
|
23
|
-
const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("r0", null, []);
|
|
24
25
|
const useStyles = (0, _reactcomponents.__styles)({
|
|
25
26
|
imageOnly: {
|
|
26
27
|
Bt984gj: "f122n59"
|
|
@@ -32,8 +33,23 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
32
33
|
});
|
|
33
34
|
const useAttachmentOverflowMenuItemStyles_unstable = (state)=>{
|
|
34
35
|
const { imageOnly } = state;
|
|
35
|
-
const rootBaseClassName = useRootBaseClassName();
|
|
36
36
|
const styles = useStyles();
|
|
37
|
-
|
|
37
|
+
const progressBarStyles = (0, _useProgressBarStyles.useProgressBarStyles)();
|
|
38
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(attachmentOverflowMenuItemClassNames.root, imageOnly && styles.imageOnly, state.root.className);
|
|
39
|
+
if (state.progress) {
|
|
40
|
+
state.progress.className = (0, _reactcomponents.mergeClasses)(attachmentOverflowMenuItemClassNames.progress, progressBarStyles.progress, state.progress.className);
|
|
41
|
+
const bar = _reactcomponents.slot.optional(state.progress.bar, {
|
|
42
|
+
elementType: 'div',
|
|
43
|
+
renderByDefault: true
|
|
44
|
+
});
|
|
45
|
+
if (bar) {
|
|
46
|
+
if (state.progress.value === undefined) {
|
|
47
|
+
bar.className = (0, _reactcomponents.mergeClasses)(progressBarStyles.indeterminateProgressBar, bar.className);
|
|
48
|
+
} else {
|
|
49
|
+
bar.className = (0, _reactcomponents.mergeClasses)(progressBarStyles.regularProgressBar, bar.className);
|
|
50
|
+
}
|
|
51
|
+
state.progress.bar = bar;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
38
54
|
return state;
|
|
39
55
|
}; //# sourceMappingURL=useAttachmentOverflowMenuItemStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentOverflowMenuItemStyles.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuItemStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, slot } from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles';\nimport type {\n AttachmentOverflowMenuItemSlots,\n AttachmentOverflowMenuItemState,\n} from './AttachmentOverflowMenuItem.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentOverflowMenuItemClassNames: SlotClassNames<AttachmentOverflowMenuItemSlots> = {\n root: 'fai-AttachmentOverflowMenuItem',\n progress: 'fai-AttachmentOverflowMenuItem__progress',\n};\n\nconst useStyles = makeStyles({\n imageOnly: {\n alignItems: 'center',\n },\n});\n\n/**\n * Apply styling to the AttachmentList slots based on the state\n */\nexport const useAttachmentOverflowMenuItemStyles_unstable = (\n state: AttachmentOverflowMenuItemState,\n): AttachmentOverflowMenuItemState => {\n const { imageOnly } = state;\n const styles = useStyles();\n const progressBarStyles = useProgressBarStyles();\n\n state.root.className = mergeClasses(\n attachmentOverflowMenuItemClassNames.root,\n imageOnly && styles.imageOnly,\n state.root.className,\n );\n\n if (state.progress) {\n state.progress.className = mergeClasses(\n attachmentOverflowMenuItemClassNames.progress,\n progressBarStyles.progress,\n state.progress.className,\n );\n\n const bar = slot.optional(state.progress.bar, { elementType: 'div', renderByDefault: true });\n if (bar) {\n if (state.progress.value === undefined) {\n bar.className = mergeClasses(progressBarStyles.indeterminateProgressBar, bar.className);\n } else {\n bar.className = mergeClasses(progressBarStyles.regularProgressBar, bar.className);\n }\n state.progress.bar = bar;\n }\n }\n\n return state;\n};\n"],"names":["attachmentOverflowMenuItemClassNames","progressBarStyles","useProgressBarStyles","root","progress","useStyles","makeStyles","imageOnly","alignItems","d","state","styles","bar","renderByDefault","className","mergeClasses","undefined","indeterminateProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAQaA,oCAAAA;eAAAA;;IAmBLC,4CAAoBC;eAApBD;;;iCA3B+B;sCACF;AAO9B,MAAMD,uCAAwF;UACnGG;cACAC;AACF;AAEA,MAAMC,YAAYC,IAAAA,yBAAAA,EAAAA;eAChBC;iBACEC;;AAEJ,GAAA;IAEAC,GAAA;QAAA;KAAA;;AAQE,MAAMR,+CAAoBC,CAAAA;UAE1BQ,EAMAH,SAAIG;UAOFC,SAAMC;8BAAuDV,IAAAA,0CAAA;cAAOW,CAAAA,SAAAA,GAAAA,IAAAA,6BAAiB,EAAAb,qCAAAG,IAAA,EAAAI,aAAAI,OAAAJ,SAAA,EAAAG,MAAAP,IAAA,CAAAW,SAAA;cAAKV,QAAA,EAAA;cAC1FA,QAAS,CAAAU,SAAA,GAAAC,IAAAA,6BAAA,EAAAf,qCAAAI,QAAA,EAAAH,kBAAAG,QAAA,EAAAM,MAAAN,QAAA,CAAAU,SAAA;oBACHJ,qBAAAA,CAAAA,QAAMN,CAAQM,MAAMN,QAAKY,CAAAA,GAAAA,EAAAA;yBAC3BJ;6BACK;;iBAEP;sBACAF,QAAMN,CAAAA,KAAY,KAAGQ,WAAAA;gBACvBA,IAAAE,SAAA,GAAAC,IAAAA,6BAAA,EAAAd,kBAAAgB,wBAAA,EAAAL,IAAAE,SAAA;YACF,OAAA;gBAEAF,IAAOF,SAAAA,GAAAA,IAAAA,6BAAAA,EAAAA,kBAAAA,kBAAAA,EAAAA,IAAAA,SAAAA;YACP"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useProgressBarStyles", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useProgressBarStyles;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
12
|
+
const indeterminateProgressBarReducedMotion = {
|
|
13
|
+
'0%': {
|
|
14
|
+
opacity: '.2'
|
|
15
|
+
},
|
|
16
|
+
'50%': {
|
|
17
|
+
opacity: '1'
|
|
18
|
+
},
|
|
19
|
+
'100%': {
|
|
20
|
+
opacity: '.2'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const useProgressBarStyles = (0, _reactcomponents.__styles)({
|
|
24
|
+
progress: {
|
|
25
|
+
a9b677: "fly5x3f",
|
|
26
|
+
qhf8xq: "f1euv43f",
|
|
27
|
+
B5kzvoi: "f1yab3r1",
|
|
28
|
+
oyh7mz: [
|
|
29
|
+
"f1vgc2s3",
|
|
30
|
+
"f1e31b4d"
|
|
31
|
+
],
|
|
32
|
+
j35jbq: [
|
|
33
|
+
"f1e31b4d",
|
|
34
|
+
"f1vgc2s3"
|
|
35
|
+
],
|
|
36
|
+
Bqenvij: "f6ywr7j",
|
|
37
|
+
Beyfa6y: [
|
|
38
|
+
"f16jpd5f",
|
|
39
|
+
"f1aa9q02"
|
|
40
|
+
],
|
|
41
|
+
Bbmb7ep: [
|
|
42
|
+
"f1aa9q02",
|
|
43
|
+
"f16jpd5f"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
regularProgressBar: {
|
|
47
|
+
Bqenvij: "f1l02sjl",
|
|
48
|
+
Bcmaq0h: "fx7worf"
|
|
49
|
+
},
|
|
50
|
+
indeterminateProgressBar: {
|
|
51
|
+
Bqenvij: "f1l02sjl",
|
|
52
|
+
De3pzq: "f1c21dwh",
|
|
53
|
+
Bcmaq0h: "f1hxqsn5",
|
|
54
|
+
B3ks32h: "f2xo07b",
|
|
55
|
+
B3vm3ge: "f1f2ih6z",
|
|
56
|
+
Gqtpxc: "f7h4d4t",
|
|
57
|
+
vr3tzx: "f32r5lb"
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
d: [
|
|
61
|
+
".fly5x3f{width:100%;}",
|
|
62
|
+
".f1euv43f{position:absolute;}",
|
|
63
|
+
".f1yab3r1{bottom:0;}",
|
|
64
|
+
".f1vgc2s3{left:0;}",
|
|
65
|
+
".f1e31b4d{right:0;}",
|
|
66
|
+
".f6ywr7j{height:4px;}",
|
|
67
|
+
".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}",
|
|
68
|
+
".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}",
|
|
69
|
+
".f1l02sjl{height:100%;}",
|
|
70
|
+
".fx7worf{background-image:linear-gradient(90deg, var(--fai-colorBrandFlair1) 35%, var(--fai-colorBrandFlair2) 70%, var(--fai-colorBrandFlair3) 92%);}",
|
|
71
|
+
".f1c21dwh{background-color:var(--colorTransparentBackground);}",
|
|
72
|
+
".f1hxqsn5{background-image:linear-gradient(90deg, rgba(0,0,0,0) 0%, var(--fai-colorBrandFlair1) 35%, var(--fai-colorBrandFlair2) 70%, var(--fai-colorBrandFlair3) 92%, rgba(0,0,0,0));}"
|
|
73
|
+
],
|
|
74
|
+
m: [
|
|
75
|
+
[
|
|
76
|
+
"@media screen and (prefers-reduced-motion: reduce){.f2xo07b{max-width:100%;}}",
|
|
77
|
+
{
|
|
78
|
+
m: "screen and (prefers-reduced-motion: reduce)"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
"@media screen and (prefers-reduced-motion: reduce){.f1f2ih6z{animation-iteration-count:infinite;}}",
|
|
83
|
+
{
|
|
84
|
+
m: "screen and (prefers-reduced-motion: reduce)"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
[
|
|
88
|
+
"@media screen and (prefers-reduced-motion: reduce){.f7h4d4t{animation-duration:3s;}}",
|
|
89
|
+
{
|
|
90
|
+
m: "screen and (prefers-reduced-motion: reduce)"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
[
|
|
94
|
+
"@media screen and (prefers-reduced-motion: reduce){.f32r5lb{animation-name:ftc26vs;}}",
|
|
95
|
+
{
|
|
96
|
+
m: "screen and (prefers-reduced-motion: reduce)"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
],
|
|
100
|
+
k: [
|
|
101
|
+
"@keyframes ftc26vs{0%{opacity:.2;}50%{opacity:1;}100%{opacity:.2;}}"
|
|
102
|
+
]
|
|
103
|
+
}); //# sourceMappingURL=useProgressBarStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useProgressBarStyles.ts"],"sourcesContent":["import { makeStyles, tokens } from '@fluentui/react-components';\nimport { tokens as copilotTokens } from '@fluentui-copilot/tokens';\n\nconst indeterminateProgressBarReducedMotion = {\n '0%': {\n opacity: '.2', // matches indeterminate bar width\n },\n '50%': {\n opacity: '1',\n },\n '100%': {\n opacity: '.2',\n },\n};\n\n/**\n * @internal\n */\nexport const useProgressBarStyles = makeStyles({\n progress: {\n width: '100%',\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n height: '4px',\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n },\n regularProgressBar: {\n height: '100%',\n backgroundImage: `linear-gradient(90deg, ${copilotTokens.colorBrandFlair1} 35%, ${copilotTokens.colorBrandFlair2} 70%, ${copilotTokens.colorBrandFlair3} 92%)`,\n },\n indeterminateProgressBar: {\n height: '100%',\n backgroundColor: tokens.colorTransparentBackground,\n backgroundImage: `linear-gradient(90deg, rgba(0,0,0,0) 0%, ${copilotTokens.colorBrandFlair1} 35%, ${copilotTokens.colorBrandFlair2} 70%, ${copilotTokens.colorBrandFlair3} 92%, rgba(0,0,0,0))`,\n '@media screen and (prefers-reduced-motion: reduce)': {\n maxWidth: '100%',\n animationIterationCount: 'infinite',\n animationDuration: '3s',\n animationName: indeterminateProgressBarReducedMotion,\n },\n },\n});\n"],"names":["progress","indeterminateProgressBarReducedMotion","opacity","__styles","width","position","bottom","left","right","height","borderBottomLeftRadius","borderBottomRightRadius","tokens","Bbmb7ep","backgroundImage","Bcmaq0h","backgroundColor","maxWidth","animationIterationCount","animationDuration","animationName","d"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAmBEA;;;eAAAA;;;iCAnByB;AAG3B,MAAMC,wCAAwC;UAC5C;iBACEC;;WAEF;iBACEA;;YAEF;iBACEA;;AAEJ;AAMEF,MAAAA,uBAAUG,IAAAA,yBAAA,EAAA;cACRC;gBACAC;gBACAC;iBACAC;gBACAC;YAAAA;YAAO;SAAA;gBACPC;YAAAA;YAAQ;SAAA;iBACRC;iBACAC;YAAAA;YAAAA;SAAyBC;QAC3BC,SAAA;YAAA;YAAA;SAAA;;wBAEU;iBACRC;QACFC,SAAA;;8BAEU;iBACRC;gBACAF;iBACA;iBACEG;iBACAC;gBACAC;gBACAC;;;IAGNC,GAAG;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-attachments",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "A set of components related to attaching files in Copilot experiences.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@fluentui-copilot/react-provider": "^0.8.2",
|
|
16
|
+
"@fluentui-copilot/tokens": "^0.3.2",
|
|
16
17
|
"@swc/helpers": "^0.5.1"
|
|
17
18
|
},
|
|
18
19
|
"peerDependencies": {
|