@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
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
attachmentClassNames: function() {
|
|
13
|
+
return attachmentClassNames;
|
|
14
|
+
},
|
|
15
|
+
useAttachmentStyles_unstable: function() {
|
|
16
|
+
return useAttachmentStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const attachmentClassNames = {
|
|
21
|
+
root: 'fai-Attachment',
|
|
22
|
+
primaryAction: 'fai-Attachment__primaryAction',
|
|
23
|
+
dismissButton: 'fai-Attachment__dismissButton',
|
|
24
|
+
media: 'fai-Attachment__media',
|
|
25
|
+
content: 'fai-Attachment__content',
|
|
26
|
+
dismissIcon: 'fai-Attachment__dismissIcon'
|
|
27
|
+
};
|
|
28
|
+
const ATTACHMENT_MAXWIDTH = '180px';
|
|
29
|
+
const ATTACHMENT_SIZE = '20px';
|
|
30
|
+
const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("r1u26nio", null, [
|
|
31
|
+
".r1u26nio{display:inline-flex;flex-wrap:nowrap;vertical-align:middle;box-sizing:border-box;width:fit-content;max-width:180px;}"
|
|
32
|
+
]);
|
|
33
|
+
const buttonBaseStyles = {
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
backgroundColor: _reactcomponents.tokens.colorNeutralBackground1,
|
|
36
|
+
border: `${_reactcomponents.tokens.strokeWidthThin} solid ${_reactcomponents.tokens.colorNeutralStroke1}`,
|
|
37
|
+
borderRadius: _reactcomponents.tokens.borderRadiusMedium,
|
|
38
|
+
boxSizing: 'border-box',
|
|
39
|
+
columnGap: _reactcomponents.tokens.spacingHorizontalSNudge,
|
|
40
|
+
color: _reactcomponents.tokens.colorNeutralForeground1,
|
|
41
|
+
cursor: 'pointer',
|
|
42
|
+
display: 'inline-flex',
|
|
43
|
+
flexWrap: 'nowrap',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
...(0, _reactcomponents.createCustomFocusIndicatorStyle)({
|
|
46
|
+
..._reactcomponents.shorthands.outline(_reactcomponents.tokens.strokeWidthThick, 'solid', _reactcomponents.tokens.colorStrokeFocus2),
|
|
47
|
+
zIndex: 1
|
|
48
|
+
}),
|
|
49
|
+
verticalAlign: 'middle'
|
|
50
|
+
};
|
|
51
|
+
const usePrimaryActionBaseClassName = (0, _reactcomponents.__resetStyles)("rftb5h9", "rofiitm", [
|
|
52
|
+
".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);}",
|
|
53
|
+
".rftb5h9[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}",
|
|
54
|
+
".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);}",
|
|
55
|
+
".rofiitm[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}"
|
|
56
|
+
]);
|
|
57
|
+
const usePrimaryActionStyles = (0, _reactcomponents.__styles)({
|
|
58
|
+
button: {
|
|
59
|
+
eoavqd: "f8491dx",
|
|
60
|
+
Jwef8y: "f1h648pw",
|
|
61
|
+
Bi91k9c: "fnwyq0v",
|
|
62
|
+
ecr2s2: "fwdzr64",
|
|
63
|
+
lj723h: "flvvhsy",
|
|
64
|
+
Bqrx1nm: "fq7113v",
|
|
65
|
+
kx9iu6: "fp3oj7s"
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
h: [
|
|
69
|
+
".f8491dx:hover{cursor:pointer;}",
|
|
70
|
+
".f1h648pw:hover{background-color:var(--colorNeutralBackground3Hover);}",
|
|
71
|
+
".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}"
|
|
72
|
+
],
|
|
73
|
+
a: [
|
|
74
|
+
".fwdzr64:active{background-color:var(--colorNeutralBackground3Pressed);}",
|
|
75
|
+
".flvvhsy:active{color:var(--colorNeutralForeground2Pressed);}"
|
|
76
|
+
],
|
|
77
|
+
m: [
|
|
78
|
+
[
|
|
79
|
+
"@media (forced-colors: active){.fq7113v:hover{background-color:HighlightText;}}",
|
|
80
|
+
{
|
|
81
|
+
m: "(forced-colors: active)"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
[
|
|
85
|
+
"@media (forced-colors: active){.fp3oj7s:active{background-color:HighlightText;}}",
|
|
86
|
+
{
|
|
87
|
+
m: "(forced-colors: active)"
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
const useDismissButtonBaseClassName = (0, _reactcomponents.__resetStyles)("r1cf2ehf", "rhq1520", {
|
|
93
|
+
r: [
|
|
94
|
+
".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);}",
|
|
95
|
+
".r1cf2ehf[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}",
|
|
96
|
+
".r1cf2ehf:hover{cursor:pointer;background-color:var(--colorNeutralBackground3Hover);color:var(--colorNeutralForeground2BrandHover);}",
|
|
97
|
+
".r1cf2ehf:hover .fai-Attachment__dismissIcon{color:var(--colorBrandForegroundLinkHover);}",
|
|
98
|
+
".r1cf2ehf:active{background-color:var(--colorNeutralBackground3Pressed);color:var(--colorNeutralForeground2BrandPressed);}",
|
|
99
|
+
".r1cf2ehf:focus .fai-Attachment__dismissIcon{color:var(--colorNeutralForeground2BrandHover);}",
|
|
100
|
+
".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);}",
|
|
101
|
+
".rhq1520[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);outline-style:solid;outline-color:var(--colorStrokeFocus2);z-index:1;}",
|
|
102
|
+
".rhq1520:hover{cursor:pointer;background-color:var(--colorNeutralBackground3Hover);color:var(--colorNeutralForeground2BrandHover);}",
|
|
103
|
+
".rhq1520:hover .fai-Attachment__dismissIcon{color:var(--colorBrandForegroundLinkHover);}",
|
|
104
|
+
".rhq1520:active{background-color:var(--colorNeutralBackground3Pressed);color:var(--colorNeutralForeground2BrandPressed);}",
|
|
105
|
+
".rhq1520:focus .fai-Attachment__dismissIcon{color:var(--colorNeutralForeground2BrandHover);}"
|
|
106
|
+
],
|
|
107
|
+
s: [
|
|
108
|
+
"@media (forced-colors: active){.r1cf2ehf:hover{background-color:HighlightText;}.r1cf2ehf:active{background-color:HighlightText;}}",
|
|
109
|
+
"@media (forced-colors: active){.rhq1520:hover{background-color:HighlightText;}.rhq1520:active{background-color:HighlightText;}}"
|
|
110
|
+
]
|
|
111
|
+
});
|
|
112
|
+
const useMediaBaseClassName = (0, _reactcomponents.__resetStyles)("r19jnv3a", null, [
|
|
113
|
+
".r19jnv3a{font-size:20px;height:20px;line-height:20px;width:20px;}"
|
|
114
|
+
]);
|
|
115
|
+
const useContentBaseClassName = (0, _reactcomponents.__resetStyles)("rmt99gk", null, [
|
|
116
|
+
".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);}"
|
|
117
|
+
]);
|
|
118
|
+
const useDismissIconBaseClassName = (0, _reactcomponents.__resetStyles)("r176grtk", null, [
|
|
119
|
+
".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);}"
|
|
120
|
+
]);
|
|
121
|
+
const useAttachmentStyles_unstable = (state)=>{
|
|
122
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
123
|
+
const primaryActionBaseClassName = usePrimaryActionBaseClassName();
|
|
124
|
+
const dismissButtonBaseClassName = useDismissButtonBaseClassName();
|
|
125
|
+
const mediaBaseClassName = useMediaBaseClassName();
|
|
126
|
+
const contentBaseClassName = useContentBaseClassName();
|
|
127
|
+
const dismissIconBaseClassName = useDismissIconBaseClassName();
|
|
128
|
+
const primaryActionStyles = usePrimaryActionStyles();
|
|
129
|
+
const { primaryAction } = state;
|
|
130
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.root, rootBaseClassName, state.root.className);
|
|
131
|
+
state.primaryAction.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.primaryAction, primaryActionBaseClassName, primaryAction.as !== 'span' && primaryActionStyles.button, state.primaryAction.className);
|
|
132
|
+
state.dismissButton.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.dismissButton, dismissButtonBaseClassName, state.dismissButton.className);
|
|
133
|
+
if (state.media) {
|
|
134
|
+
state.media.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.media, mediaBaseClassName, state.media.className);
|
|
135
|
+
}
|
|
136
|
+
state.content.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.content, contentBaseClassName, state.content.className);
|
|
137
|
+
state.dismissIcon.className = (0, _reactcomponents.mergeClasses)(attachmentClassNames.dismissIcon, dismissIconBaseClassName, state.dismissIcon.className);
|
|
138
|
+
return state;
|
|
139
|
+
}; //# sourceMappingURL=useAttachmentStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentStyles.js"],"sourcesContent":["import { createCustomFocusIndicatorStyle, __resetStyles, __styles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nexport const attachmentClassNames = {\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};\nconst ATTACHMENT_MAXWIDTH = '180px';\nconst ATTACHMENT_SIZE = '20px';\nconst useRootBaseClassName = __resetStyles(\"r1u26nio\", null, [\".r1u26nio{display:inline-flex;flex-wrap:nowrap;vertical-align:middle;box-sizing:border-box;width:fit-content;max-width:180px;}\"]);\nconst buttonBaseStyles = {\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};\nconst 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;}\"]);\nconst usePrimaryActionStyles = __styles({\n button: {\n eoavqd: \"f8491dx\",\n Jwef8y: \"f1h648pw\",\n Bi91k9c: \"fnwyq0v\",\n ecr2s2: \"fwdzr64\",\n lj723h: \"flvvhsy\",\n Bqrx1nm: \"fq7113v\",\n kx9iu6: \"fp3oj7s\"\n }\n}, {\n h: [\".f8491dx:hover{cursor:pointer;}\", \".f1h648pw:hover{background-color:var(--colorNeutralBackground3Hover);}\", \".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}\"],\n a: [\".fwdzr64:active{background-color:var(--colorNeutralBackground3Pressed);}\", \".flvvhsy:active{color:var(--colorNeutralForeground2Pressed);}\"],\n m: [[\"@media (forced-colors: active){.fq7113v:hover{background-color:HighlightText;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fp3oj7s:active{background-color:HighlightText;}}\", {\n m: \"(forced-colors: active)\"\n }]]\n});\nconst useDismissButtonBaseClassName = __resetStyles(\"r1cf2ehf\", \"rhq1520\", {\n 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);}\"],\n 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;}}\"]\n});\nconst useMediaBaseClassName = __resetStyles(\"r19jnv3a\", null, [\".r19jnv3a{font-size:20px;height:20px;line-height:20px;width:20px;}\"]);\nconst 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);}\"]);\nconst 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);}\"]);\n/**\n * Apply styling to the Attachment slots based on the state\n */\nexport const useAttachmentStyles_unstable = state => {\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 {\n primaryAction\n } = state;\n state.root.className = mergeClasses(attachmentClassNames.root, rootBaseClassName, state.root.className);\n state.primaryAction.className = mergeClasses(attachmentClassNames.primaryAction, primaryActionBaseClassName, primaryAction.as !== 'span' && primaryActionStyles.button, state.primaryAction.className);\n state.dismissButton.className = mergeClasses(attachmentClassNames.dismissButton, dismissButtonBaseClassName, state.dismissButton.className);\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(attachmentClassNames.dismissIcon, dismissIconBaseClassName, state.dismissIcon.className);\n return state;\n};\n//# sourceMappingURL=useAttachmentStyles.js.map"],"names":["attachmentClassNames","useAttachmentStyles_unstable","root","primaryAction","dismissButton","media","content","dismissIcon","ATTACHMENT_MAXWIDTH","ATTACHMENT_SIZE","useRootBaseClassName","__resetStyles","buttonBaseStyles","alignItems","backgroundColor","tokens","colorNeutralBackground1","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","boxSizing","columnGap","spacingHorizontalSNudge","color","colorNeutralForeground1","cursor","display","flexWrap","justifyContent","createCustomFocusIndicatorStyle","shorthands","outline","strokeWidthThick","colorStrokeFocus2","zIndex","verticalAlign","usePrimaryActionBaseClassName","usePrimaryActionStyles","__styles","button","eoavqd","Jwef8y","Bi91k9c","ecr2s2","lj723h","Bqrx1nm","kx9iu6","h","a","m","useDismissButtonBaseClassName","r","s","useMediaBaseClassName","useContentBaseClassName","useDismissIconBaseClassName","state","rootBaseClassName","primaryActionBaseClassName","dismissButtonBaseClassName","mediaBaseClassName","contentBaseClassName","dismissIconBaseClassName","primaryActionStyles","className","mergeClasses","as"],"mappings":";;;;;;;;;;;IACaA,oBAAoB;eAApBA;;IA2DAC,4BAA4B;eAA5BA;;;iCA5DgH;AACtH,MAAMD,uBAAuB;IAClCE,MAAM;IACNC,eAAe;IACfC,eAAe;IACfC,OAAO;IACPC,SAAS;IACTC,aAAa;AACf;AACA,MAAMC,sBAAsB;AAC5B,MAAMC,kBAAkB;AACxB,MAAMC,uBAAuBC,IAAAA,8BAAa,EAAC,YAAY,MAAM;IAAC;CAAiI;AAC/L,MAAMC,mBAAmB;IACvBC,YAAY;IACZC,iBAAiBC,uBAAM,CAACC,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEF,uBAAM,CAACG,eAAe,CAAC,OAAO,EAAEH,uBAAM,CAACI,mBAAmB,CAAC,CAAC;IACvEC,cAAcL,uBAAM,CAACM,kBAAkB;IACvCC,WAAW;IACXC,WAAWR,uBAAM,CAACS,uBAAuB;IACzCC,OAAOV,uBAAM,CAACW,uBAAuB;IACrCC,QAAQ;IACRC,SAAS;IACTC,UAAU;IACVC,gBAAgB;IAChB,GAAGC,IAAAA,gDAA+B,EAAC;QACjC,GAAGC,2BAAU,CAACC,OAAO,CAAClB,uBAAM,CAACmB,gBAAgB,EAAE,SAASnB,uBAAM,CAACoB,iBAAiB,CAAC;QACjFC,QAAQ;IACV,EAAE;IACFC,eAAe;AACjB;AACA,MAAMC,gCAAgC3B,IAAAA,8BAAa,EAAC,WAAW,WAAW;IAAC;IAA4tB;IAAiJ;IAAytB;CAAgJ;AACjyD,MAAM4B,yBAAyBC,IAAAA,yBAAQ,EAAC;IACtCC,QAAQ;QACNC,QAAQ;QACRC,QAAQ;QACRC,SAAS;QACTC,QAAQ;QACRC,QAAQ;QACRC,SAAS;QACTC,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAAmC;QAA0E;KAA6D;IAC9KC,GAAG;QAAC;QAA4E;KAAgE;IAChJC,GAAG;QAAC;YAAC;YAAmF;gBACtFA,GAAG;YACL;SAAE;QAAE;YAAC;YAAoF;gBACvFA,GAAG;YACL;SAAE;KAAC;AACL;AACA,MAAMC,gCAAgCzC,IAAAA,8BAAa,EAAC,YAAY,WAAW;IACzE0C,GAAG;QAAC;QAA07B;QAAkJ;QAAwI;QAA6F;QAA8H;QAAiG;QAA07B;QAAiJ;QAAuI;QAA4F;QAA6H;KAA+F;IAC9hGC,GAAG;QAAC;QAAqI;KAAkI;AAC7Q;AACA,MAAMC,wBAAwB5C,IAAAA,8BAAa,EAAC,YAAY,MAAM;IAAC;CAAqE;AACpI,MAAM6C,0BAA0B7C,IAAAA,8BAAa,EAAC,WAAW,MAAM;IAAC;CAAsN;AACtR,MAAM8C,8BAA8B9C,IAAAA,8BAAa,EAAC,YAAY,MAAM;IAAC;CAA+jB;AAI7nB,MAAMV,+BAA+ByD,CAAAA;IAC1C,MAAMC,oBAAoBjD;IAC1B,MAAMkD,6BAA6BtB;IACnC,MAAMuB,6BAA6BT;IACnC,MAAMU,qBAAqBP;IAC3B,MAAMQ,uBAAuBP;IAC7B,MAAMQ,2BAA2BP;IACjC,MAAMQ,sBAAsB1B;IAC5B,MAAM,EACJpC,aAAa,EACd,GAAGuD;IACJA,MAAMxD,IAAI,CAACgE,SAAS,GAAGC,IAAAA,6BAAY,EAACnE,qBAAqBE,IAAI,EAAEyD,mBAAmBD,MAAMxD,IAAI,CAACgE,SAAS;IACtGR,MAAMvD,aAAa,CAAC+D,SAAS,GAAGC,IAAAA,6BAAY,EAACnE,qBAAqBG,aAAa,EAAEyD,4BAA4BzD,cAAciE,EAAE,KAAK,UAAUH,oBAAoBxB,MAAM,EAAEiB,MAAMvD,aAAa,CAAC+D,SAAS;IACrMR,MAAMtD,aAAa,CAAC8D,SAAS,GAAGC,IAAAA,6BAAY,EAACnE,qBAAqBI,aAAa,EAAEyD,4BAA4BH,MAAMtD,aAAa,CAAC8D,SAAS;IAC1I,IAAIR,MAAMrD,KAAK,EAAE;QACfqD,MAAMrD,KAAK,CAAC6D,SAAS,GAAGC,IAAAA,6BAAY,EAACnE,qBAAqBK,KAAK,EAAEyD,oBAAoBJ,MAAMrD,KAAK,CAAC6D,SAAS;IAC5G;IACAR,MAAMpD,OAAO,CAAC4D,SAAS,GAAGC,IAAAA,6BAAY,EAACnE,qBAAqBM,OAAO,EAAEyD,sBAAsBL,MAAMpD,OAAO,CAAC4D,SAAS;IAClHR,MAAMnD,WAAW,CAAC2D,SAAS,GAAGC,IAAAA,6BAAY,EAACnE,qBAAqBO,WAAW,EAAEyD,0BAA0BN,MAAMnD,WAAW,CAAC2D,SAAS;IAClI,OAAOR;AACT,GACA,+CAA+C"}
|
|
@@ -8,54 +8,14 @@ Object.defineProperty(exports, "useAttachmentTag_unstable", {
|
|
|
8
8
|
return useAttachmentTag_unstable;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const
|
|
12
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
-
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
-
const _reactcontextselector = require("@fluentui/react-context-selector");
|
|
15
|
-
const _reacticons = require("@fluentui/react-icons");
|
|
16
|
-
const _attachmentTagListContext = require("../../contexts/attachmentTagListContext");
|
|
11
|
+
const _useAttachmentTagSlots = require("../utils/useAttachmentTagSlots");
|
|
17
12
|
const useAttachmentTag_unstable = (props, ref)=>{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const DismissIcon = (0, _reacticons.bundleIcon)(_reacticons.Dismiss20Filled, _reacticons.Dismiss20Regular);
|
|
21
|
-
const hasParentContext = (0, _reactcontextselector.useHasParentContext)(_attachmentTagListContext.AttachmentTagListContext);
|
|
22
|
-
const rootRole = role !== null && role !== void 0 ? role : hasParentContext ? 'menuitem' : undefined;
|
|
23
|
-
const root = _reactcomponents.slot.always((0, _reactcomponents.getNativeElementProps)('button', {
|
|
24
|
-
ref,
|
|
25
|
-
...props,
|
|
26
|
-
role: rootRole
|
|
27
|
-
}), {
|
|
28
|
-
elementType: 'button'
|
|
29
|
-
});
|
|
30
|
-
root.onClick = (0, _reactcomponents.mergeCallbacks)(root.onClick, (ev)=>onAttachmentTagDismiss === null || onAttachmentTagDismiss === void 0 ? void 0 : onAttachmentTagDismiss(ev, {
|
|
31
|
-
content: children,
|
|
32
|
-
media
|
|
33
|
-
}));
|
|
34
|
-
const media = _reactcomponents.slot.optional(props.media, {
|
|
35
|
-
elementType: 'span'
|
|
36
|
-
});
|
|
37
|
-
const content = _reactcomponents.slot.always(props.content, {
|
|
38
|
-
defaultProps: {
|
|
39
|
-
children
|
|
40
|
-
},
|
|
41
|
-
elementType: 'span'
|
|
42
|
-
});
|
|
43
|
-
const icon = _reactcomponents.slot.always(props.icon, {
|
|
44
|
-
defaultProps: {
|
|
45
|
-
children: /*#__PURE__*/ _react.createElement(DismissIcon, null)
|
|
46
|
-
},
|
|
47
|
-
elementType: 'span'
|
|
48
|
-
});
|
|
49
|
-
return {
|
|
50
|
-
components: {
|
|
13
|
+
return (0, _useAttachmentTagSlots.useAttachmentTagSlots)(props, ref, {
|
|
14
|
+
elementType: {
|
|
51
15
|
root: 'button',
|
|
52
16
|
media: 'span',
|
|
53
17
|
content: 'span',
|
|
54
18
|
icon: 'span'
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
media,
|
|
58
|
-
content,
|
|
59
|
-
icon
|
|
60
|
-
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
61
21
|
}; //# sourceMappingURL=useAttachmentTag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTag.js"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["useAttachmentTag.js"],"sourcesContent":["import { useAttachmentTagSlots } from '../utils/useAttachmentTagSlots';\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 = (props, ref) => {\n return useAttachmentTagSlots(props, ref, {\n elementType: {\n root: 'button',\n media: 'span',\n content: 'span',\n icon: 'span'\n }\n });\n};\n//# sourceMappingURL=useAttachmentTag.js.map"],"names":["useAttachmentTag_unstable","props","ref","useAttachmentTagSlots","elementType","root","media","content","icon"],"mappings":";;;;+BAUaA;;;eAAAA;;;uCAVyB;AAU/B,MAAMA,4BAA4B,CAACC,OAAOC;IAC/C,OAAOC,IAAAA,4CAAqB,EAACF,OAAOC,KAAK;QACvCE,aAAa;YACXC,MAAM;YACNC,OAAO;YACPC,SAAS;YACTC,MAAM;QACR;IACF;AACF,GACA,4CAA4C"}
|
|
@@ -12,6 +12,18 @@ _export(exports, {
|
|
|
12
12
|
attachmentTagClassNames: function() {
|
|
13
13
|
return attachmentTagClassNames;
|
|
14
14
|
},
|
|
15
|
+
ATTACHMENTTAG_MAXWIDTH: function() {
|
|
16
|
+
return ATTACHMENTTAG_MAXWIDTH;
|
|
17
|
+
},
|
|
18
|
+
useMediaBaseClassName: function() {
|
|
19
|
+
return useMediaBaseClassName;
|
|
20
|
+
},
|
|
21
|
+
useContentBaseClassName: function() {
|
|
22
|
+
return useContentBaseClassName;
|
|
23
|
+
},
|
|
24
|
+
useIconBaseClassName: function() {
|
|
25
|
+
return useIconBaseClassName;
|
|
26
|
+
},
|
|
15
27
|
useAttachmentTagStyles_unstable: function() {
|
|
16
28
|
return useAttachmentTagStyles_unstable;
|
|
17
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTagStyles.js"],"sourcesContent":["import { __resetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nexport const attachmentTagClassNames = {\n root: 'fai-AttachmentTag',\n media: 'fai-AttachmentTag__media',\n content: 'fai-AttachmentTag__content',\n icon: 'fai-AttachmentTag__icon'\n};\
|
|
1
|
+
{"version":3,"sources":["useAttachmentTagStyles.js"],"sourcesContent":["import { __resetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nexport const attachmentTagClassNames = {\n root: 'fai-AttachmentTag',\n media: 'fai-AttachmentTag__media',\n content: 'fai-AttachmentTag__content',\n icon: 'fai-AttachmentTag__icon'\n};\n/**\n * @internal\n */\nexport const ATTACHMENTTAG_MAXWIDTH = '180px';\nconst ATTACHMENTTAG_SIZE = '20px';\nconst 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);}\"]);\n/**\n * @internal\n */\nexport const useMediaBaseClassName = __resetStyles(\"r19jnv3a\", null, [\".r19jnv3a{font-size:20px;height:20px;line-height:20px;width:20px;}\"]);\n/**\n * @internal\n */\nexport 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);}\"]);\n/**\n * @internal\n */\nexport 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);}\"]);\n/**\n * Apply styling to the AttachmentTag slots based on the state\n */\nexport const useAttachmentTagStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const iconBaseClassName = useIconBaseClassName();\n state.root.className = mergeClasses(attachmentTagClassNames.root, rootBaseClassName, state.root.className);\n if (state.media) {\n state.media.className = mergeClasses(attachmentTagClassNames.media, mediaBaseClassName, state.media.className);\n }\n state.content.className = mergeClasses(attachmentTagClassNames.content, contentBaseClassName, state.content.className);\n state.icon.className = mergeClasses(attachmentTagClassNames.icon, iconBaseClassName, state.icon.className);\n return state;\n};\n//# sourceMappingURL=useAttachmentTagStyles.js.map"],"names":["attachmentTagClassNames","ATTACHMENTTAG_MAXWIDTH","useMediaBaseClassName","useContentBaseClassName","useIconBaseClassName","useAttachmentTagStyles_unstable","root","media","content","icon","ATTACHMENTTAG_SIZE","useRootBaseClassName","__resetStyles","state","rootBaseClassName","mediaBaseClassName","contentBaseClassName","iconBaseClassName","className","mergeClasses"],"mappings":";;;;;;;;;;;IACaA,uBAAuB;eAAvBA;;IASAC,sBAAsB;eAAtBA;;IAMAC,qBAAqB;eAArBA;;IAIAC,uBAAuB;eAAvBA;;IAIAC,oBAAoB;eAApBA;;IAIAC,+BAA+B;eAA/BA;;;iCA5ByD;AAC/D,MAAML,0BAA0B;IACrCM,MAAM;IACNC,OAAO;IACPC,SAAS;IACTC,MAAM;AACR;AAIO,MAAMR,yBAAyB;AACtC,MAAMS,qBAAqB;AAC3B,MAAMC,uBAAuBC,IAAAA,8BAAa,EAAC,YAAY,WAAW;IAAC;IAA8f;IAAkE;IAAyF;IAA2E;IAAsG;IAA6F;IAAsG;IAA6f;IAAiE;IAAwF;IAA0E;IAAqG;IAA4F;CAAoG;AAI9kE,MAAMV,wBAAwBU,IAAAA,8BAAa,EAAC,YAAY,MAAM;IAAC;CAAqE;AAIpI,MAAMT,0BAA0BS,IAAAA,8BAAa,EAAC,WAAW,MAAM;IAAC;CAAsN;AAItR,MAAMR,uBAAuBQ,IAAAA,8BAAa,EAAC,YAAY,MAAM;IAAC;CAA+jB;AAI7nB,MAAMP,kCAAkCQ,CAAAA;IAC7C,MAAMC,oBAAoBH;IAC1B,MAAMI,qBAAqBb;IAC3B,MAAMc,uBAAuBb;IAC7B,MAAMc,oBAAoBb;IAC1BS,MAAMP,IAAI,CAACY,SAAS,GAAGC,IAAAA,6BAAY,EAACnB,wBAAwBM,IAAI,EAAEQ,mBAAmBD,MAAMP,IAAI,CAACY,SAAS;IACzG,IAAIL,MAAMN,KAAK,EAAE;QACfM,MAAMN,KAAK,CAACW,SAAS,GAAGC,IAAAA,6BAAY,EAACnB,wBAAwBO,KAAK,EAAEQ,oBAAoBF,MAAMN,KAAK,CAACW,SAAS;IAC/G;IACAL,MAAML,OAAO,CAACU,SAAS,GAAGC,IAAAA,6BAAY,EAACnB,wBAAwBQ,OAAO,EAAEQ,sBAAsBH,MAAML,OAAO,CAACU,SAAS;IACrHL,MAAMJ,IAAI,CAACS,SAAS,GAAGC,IAAAA,6BAAY,EAACnB,wBAAwBS,IAAI,EAAEQ,mBAAmBJ,MAAMJ,IAAI,CAACS,SAAS;IACzG,OAAOL;AACT,GACA,kDAAkD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AttachmentTagItem.js"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentTagItem_unstable } from './useAttachmentTagItem';\nimport { renderAttachmentTagItem_unstable } from './renderAttachmentTagItem';\nimport { useAttachmentTagItemStyles_unstable } from './useAttachmentTagItemStyles';\
|
|
1
|
+
{"version":3,"sources":["AttachmentTagItem.js"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentTagItem_unstable } from './useAttachmentTagItem';\nimport { renderAttachmentTagItem_unstable } from './renderAttachmentTagItem';\nimport { useAttachmentTagItemStyles_unstable } from './useAttachmentTagItemStyles';\nexport const AttachmentTagItem = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useAttachmentTagItem_unstable(props, ref);\n useAttachmentTagItemStyles_unstable(state);\n return renderAttachmentTagItem_unstable(state);\n});\nAttachmentTagItem.displayName = 'AttachmentTagItem';\n//# sourceMappingURL=AttachmentTagItem.js.map"],"names":["AttachmentTagItem","React","forwardRef","props","ref","state","useAttachmentTagItem_unstable","useAttachmentTagItemStyles_unstable","renderAttachmentTagItem_unstable","displayName"],"mappings":";;;;+BAIaA;;;eAAAA;;;;iEAJU;sCACuB;yCACG;4CACG;AAC7C,MAAMA,oBAAoB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACrE,MAAMC,QAAQC,IAAAA,mDAA6B,EAACH,OAAOC;IACnDG,IAAAA,+DAAmC,EAACF;IACpC,OAAOG,IAAAA,yDAAgC,EAACH;AAC1C;AACAL,kBAAkBS,WAAW,GAAG,qBAChC,6CAA6C"}
|
|
@@ -2,6 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
// TODO: Remove semicolon from previous line, uncomment next line, and provide union of props to pick from AttachmentTagItemProps.
|
|
6
|
-
// & Required<Pick<AttachmentTagItemProps, 'propName'>>
|
|
7
5
|
//# sourceMappingURL=AttachmentTagItem.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AttachmentTagItem.types.js"],"sourcesContent":["export {}
|
|
1
|
+
{"version":3,"sources":["AttachmentTagItem.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=AttachmentTagItem.types.js.map"],"names":[],"mappings":";;;;CACA,mDAAmD"}
|
|
@@ -12,6 +12,11 @@ const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
|
12
12
|
const _reactcomponents = require("@fluentui/react-components");
|
|
13
13
|
const renderAttachmentTagItem_unstable = (state)=>{
|
|
14
14
|
(0, _reactcomponents.assertSlots)(state);
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
16
|
+
children: [
|
|
17
|
+
state.media && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.media, {}),
|
|
18
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.content, {}),
|
|
19
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {})
|
|
20
|
+
]
|
|
21
|
+
});
|
|
17
22
|
}; //# sourceMappingURL=renderAttachmentTagItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderAttachmentTagItem.js"],"sourcesContent":["import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-components';\n/**\n * Render the final JSX of AttachmentTagItem\n */\nexport const renderAttachmentTagItem_unstable = state => {\n assertSlots(state);\n
|
|
1
|
+
{"version":3,"sources":["renderAttachmentTagItem.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-components';\n/**\n * Render the final JSX of AttachmentTagItem\n */\nexport const renderAttachmentTagItem_unstable = state => {\n assertSlots(state);\n return /*#__PURE__*/_jsxs(state.root, {\n children: [state.media && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.content, {}), /*#__PURE__*/_jsx(state.icon, {})]\n });\n};\n//# sourceMappingURL=renderAttachmentTagItem.js.map"],"names":["renderAttachmentTagItem_unstable","state","assertSlots","_jsxs","root","children","media","_jsx","content","icon"],"mappings":";;;;+BAKaA;;;eAAAA;;;4BAL8B;iCACf;AAIrB,MAAMA,mCAAmCC,CAAAA;IAC9CC,IAAAA,4BAAW,EAACD;IACZ,OAAO,WAAW,GAAEE,IAAAA,gBAAK,EAACF,MAAMG,IAAI,EAAE;QACpCC,UAAU;YAACJ,MAAMK,KAAK,IAAI,WAAW,GAAEC,IAAAA,eAAI,EAACN,MAAMK,KAAK,EAAE,CAAC;YAAI,WAAW,GAAEC,IAAAA,eAAI,EAACN,MAAMO,OAAO,EAAE,CAAC;YAAI,WAAW,GAAED,IAAAA,eAAI,EAACN,MAAMQ,IAAI,EAAE,CAAC;SAAG;IACxI;AACF,GACA,mDAAmD"}
|
|
@@ -8,21 +8,14 @@ Object.defineProperty(exports, "useAttachmentTagItem_unstable", {
|
|
|
8
8
|
return useAttachmentTagItem_unstable;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const
|
|
11
|
+
const _useAttachmentTagSlots = require("../utils/useAttachmentTagSlots");
|
|
12
12
|
const useAttachmentTagItem_unstable = (props, ref)=>{
|
|
13
|
-
return {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
root: _reactcomponents.slot.always((0, _reactcomponents.getNativeElementProps)('div', {
|
|
22
|
-
ref,
|
|
23
|
-
...props
|
|
24
|
-
}), {
|
|
25
|
-
elementType: 'div'
|
|
26
|
-
})
|
|
27
|
-
};
|
|
13
|
+
return (0, _useAttachmentTagSlots.useAttachmentTagSlots)(props, ref, {
|
|
14
|
+
elementType: {
|
|
15
|
+
root: 'div',
|
|
16
|
+
media: 'span',
|
|
17
|
+
content: 'span',
|
|
18
|
+
icon: 'span'
|
|
19
|
+
}
|
|
20
|
+
});
|
|
28
21
|
}; //# sourceMappingURL=useAttachmentTagItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTagItem.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["useAttachmentTagItem.js"],"sourcesContent":["import { useAttachmentTagSlots } from '../utils/useAttachmentTagSlots';\n/**\n * Create the state required to render AttachmentTagItem.\n *\n * The returned state can be modified with hooks such as useAttachmentTagItemStyles_unstable,\n * before being passed to renderAttachmentTagItem_unstable.\n *\n * @param props - props from this instance of AttachmentTagItem\n * @param ref - reference to root HTMLElement of AttachmentTagItem\n */\nexport const useAttachmentTagItem_unstable = (props, ref) => {\n return useAttachmentTagSlots(props, ref, {\n elementType: {\n root: 'div',\n media: 'span',\n content: 'span',\n icon: 'span'\n }\n });\n};\n//# sourceMappingURL=useAttachmentTagItem.js.map"],"names":["useAttachmentTagItem_unstable","props","ref","useAttachmentTagSlots","elementType","root","media","content","icon"],"mappings":";;;;+BAUaA;;;eAAAA;;;uCAVyB;AAU/B,MAAMA,gCAAgC,CAACC,OAAOC;IACnD,OAAOC,IAAAA,4CAAqB,EAACF,OAAOC,KAAK;QACvCE,aAAa;YACXC,MAAM;YACNC,OAAO;YACPC,SAAS;YACTC,MAAM;QACR;IACF;AACF,GACA,gDAAgD"}
|
|
@@ -17,18 +17,28 @@ _export(exports, {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _useAttachmentTagStyles = require("../AttachmentTag/useAttachmentTagStyles");
|
|
20
21
|
const attachmentTagItemClassNames = {
|
|
21
|
-
root: 'fai-AttachmentTagItem'
|
|
22
|
+
root: 'fai-AttachmentTagItem',
|
|
23
|
+
media: 'fai-AttachmentTagItem__media',
|
|
24
|
+
content: 'fai-AttachmentTagItem__content',
|
|
25
|
+
icon: 'fai-AttachmentTagItem__icon'
|
|
22
26
|
};
|
|
23
27
|
/**
|
|
24
28
|
* Styles for the root slot
|
|
25
|
-
*/ const
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
*/ const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("rcbi0rb", null, [
|
|
30
|
+
".rcbi0rb{display:inline-flex;flex-wrap:nowrap;column-gap:var(--spacingHorizontalSNudge);max-width:180px;align-items:center;}"
|
|
31
|
+
]);
|
|
28
32
|
const useAttachmentTagItemStyles_unstable = (state)=>{
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
34
|
+
const mediaBaseClassName = (0, _useAttachmentTagStyles.useMediaBaseClassName)();
|
|
35
|
+
const contentBaseClassName = (0, _useAttachmentTagStyles.useContentBaseClassName)();
|
|
36
|
+
const iconBaseClassName = (0, _useAttachmentTagStyles.useIconBaseClassName)();
|
|
37
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(attachmentTagItemClassNames.root, rootBaseClassName, state.root.className);
|
|
38
|
+
if (state.media) {
|
|
39
|
+
state.media.className = (0, _reactcomponents.mergeClasses)(attachmentTagItemClassNames.media, mediaBaseClassName, state.media.className);
|
|
40
|
+
}
|
|
41
|
+
state.content.className = (0, _reactcomponents.mergeClasses)(attachmentTagItemClassNames.content, contentBaseClassName, state.content.className);
|
|
42
|
+
state.icon.className = (0, _reactcomponents.mergeClasses)(attachmentTagItemClassNames.icon, iconBaseClassName, state.icon.className);
|
|
33
43
|
return state;
|
|
34
44
|
}; //# sourceMappingURL=useAttachmentTagItemStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTagItemStyles.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["useAttachmentTagItemStyles.js"],"sourcesContent":["import { __resetStyles, mergeClasses, tokens } from '@fluentui/react-components';\nimport { ATTACHMENTTAG_MAXWIDTH, useContentBaseClassName, useIconBaseClassName, useMediaBaseClassName } from '../AttachmentTag/useAttachmentTagStyles';\nexport const attachmentTagItemClassNames = {\n root: 'fai-AttachmentTagItem',\n media: 'fai-AttachmentTagItem__media',\n content: 'fai-AttachmentTagItem__content',\n icon: 'fai-AttachmentTagItem__icon'\n};\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = __resetStyles(\"rcbi0rb\", null, [\".rcbi0rb{display:inline-flex;flex-wrap:nowrap;column-gap:var(--spacingHorizontalSNudge);max-width:180px;align-items:center;}\"]);\n/**\n * Apply styling to the AttachmentTagItem slots based on the state\n */\nexport const useAttachmentTagItemStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const mediaBaseClassName = useMediaBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const iconBaseClassName = useIconBaseClassName();\n state.root.className = mergeClasses(attachmentTagItemClassNames.root, rootBaseClassName, state.root.className);\n if (state.media) {\n state.media.className = mergeClasses(attachmentTagItemClassNames.media, mediaBaseClassName, state.media.className);\n }\n state.content.className = mergeClasses(attachmentTagItemClassNames.content, contentBaseClassName, state.content.className);\n state.icon.className = mergeClasses(attachmentTagItemClassNames.icon, iconBaseClassName, state.icon.className);\n return state;\n};\n//# sourceMappingURL=useAttachmentTagItemStyles.js.map"],"names":["attachmentTagItemClassNames","useAttachmentTagItemStyles_unstable","root","media","content","icon","useRootBaseClassName","__resetStyles","state","rootBaseClassName","mediaBaseClassName","useMediaBaseClassName","contentBaseClassName","useContentBaseClassName","iconBaseClassName","useIconBaseClassName","className","mergeClasses"],"mappings":";;;;;;;;;;;IAEaA,2BAA2B;eAA3BA;;IAaAC,mCAAmC;eAAnCA;;;iCAfuC;wCACyD;AACtG,MAAMD,8BAA8B;IACzCE,MAAM;IACNC,OAAO;IACPC,SAAS;IACTC,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,uBAAuBC,IAAAA,8BAAa,EAAC,WAAW,MAAM;IAAC;CAA+H;AAIrL,MAAMN,sCAAsCO,CAAAA;IACjD,MAAMC,oBAAoBH;IAC1B,MAAMI,qBAAqBC,IAAAA,6CAAqB;IAChD,MAAMC,uBAAuBC,IAAAA,+CAAuB;IACpD,MAAMC,oBAAoBC,IAAAA,4CAAoB;IAC9CP,MAAMN,IAAI,CAACc,SAAS,GAAGC,IAAAA,6BAAY,EAACjB,4BAA4BE,IAAI,EAAEO,mBAAmBD,MAAMN,IAAI,CAACc,SAAS;IAC7G,IAAIR,MAAML,KAAK,EAAE;QACfK,MAAML,KAAK,CAACa,SAAS,GAAGC,IAAAA,6BAAY,EAACjB,4BAA4BG,KAAK,EAAEO,oBAAoBF,MAAML,KAAK,CAACa,SAAS;IACnH;IACAR,MAAMJ,OAAO,CAACY,SAAS,GAAGC,IAAAA,6BAAY,EAACjB,4BAA4BI,OAAO,EAAEQ,sBAAsBJ,MAAMJ,OAAO,CAACY,SAAS;IACzHR,MAAMH,IAAI,CAACW,SAAS,GAAGC,IAAAA,6BAAY,EAACjB,4BAA4BK,IAAI,EAAES,mBAAmBN,MAAMH,IAAI,CAACW,SAAS;IAC7G,OAAOR;AACT,GACA,sDAAsD"}
|
|
@@ -5,4 +5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
6
|
_export_star._(require("./AttachmentTag"), exports);
|
|
7
7
|
_export_star._(require("./AttachmentTagList"), exports);
|
|
8
|
+
_export_star._(require("./AttachmentTagItem"), exports);
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './AttachmentTag';\nexport * from './AttachmentTagList';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;uBACA;CACd,iCAAiC"}
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './AttachmentTag';\nexport * from './AttachmentTagList';\nexport * from './AttachmentTagItem';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;CACd,iCAAiC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useAttachmentTagSlots", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useAttachmentTagSlots;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
+
const _reactcontextselector = require("@fluentui/react-context-selector");
|
|
15
|
+
const _reacticons = require("@fluentui/react-icons");
|
|
16
|
+
const _attachmentTagListContext = require("../../contexts/attachmentTagListContext");
|
|
17
|
+
function useAttachmentTagSlots(props, ref, options) {
|
|
18
|
+
const onAttachmentTagDismiss = (0, _attachmentTagListContext.useAttachmentTagListContext_unstable)((context)=>context.onAttachmentTagDismiss);
|
|
19
|
+
const { children, role } = props;
|
|
20
|
+
const { elementType } = options;
|
|
21
|
+
const DismissIcon = (0, _reacticons.bundleIcon)(_reacticons.Dismiss20Filled, _reacticons.Dismiss20Regular);
|
|
22
|
+
const hasParentContext = (0, _reactcontextselector.useHasParentContext)(_attachmentTagListContext.AttachmentTagListContext);
|
|
23
|
+
const rootRole = role !== null && role !== void 0 ? role : hasParentContext ? 'menuitem' : undefined;
|
|
24
|
+
const root = _reactcomponents.slot.always((0, _reactcomponents.getNativeElementProps)(elementType.root, {
|
|
25
|
+
ref,
|
|
26
|
+
...props,
|
|
27
|
+
role: rootRole
|
|
28
|
+
}), {
|
|
29
|
+
elementType: elementType.root
|
|
30
|
+
});
|
|
31
|
+
root.onClick = (0, _reactcomponents.mergeCallbacks)(root.onClick, (ev)=>onAttachmentTagDismiss === null || onAttachmentTagDismiss === void 0 ? void 0 : onAttachmentTagDismiss(ev, {
|
|
32
|
+
content: children,
|
|
33
|
+
media
|
|
34
|
+
}));
|
|
35
|
+
const media = _reactcomponents.slot.optional(props.media, {
|
|
36
|
+
elementType: elementType.media
|
|
37
|
+
});
|
|
38
|
+
const content = _reactcomponents.slot.always(props.content, {
|
|
39
|
+
defaultProps: {
|
|
40
|
+
children
|
|
41
|
+
},
|
|
42
|
+
elementType: elementType.content
|
|
43
|
+
});
|
|
44
|
+
const icon = _reactcomponents.slot.always(props.icon, {
|
|
45
|
+
defaultProps: {
|
|
46
|
+
children: /*#__PURE__*/ _react.createElement(DismissIcon, null)
|
|
47
|
+
},
|
|
48
|
+
elementType: elementType.icon
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
components: {
|
|
52
|
+
root: elementType.root,
|
|
53
|
+
media: elementType.media,
|
|
54
|
+
content: elementType.content,
|
|
55
|
+
icon: elementType.icon
|
|
56
|
+
},
|
|
57
|
+
root,
|
|
58
|
+
media,
|
|
59
|
+
content,
|
|
60
|
+
icon
|
|
61
|
+
};
|
|
62
|
+
} //# sourceMappingURL=useAttachmentTagSlots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentTagSlots.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, slot } from '@fluentui/react-components';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { Dismiss20Regular, Dismiss20Filled, bundleIcon } from '@fluentui/react-icons';\nimport { useAttachmentTagListContext_unstable } from '../../contexts/attachmentTagListContext';\nimport { AttachmentTagListContext } from '../../contexts/attachmentTagListContext';\n/**\n * @internal\n * Create the slots required to render AttachmentTag or AttachmentTagItem.\n */\nexport function useAttachmentTagSlots(props, ref, options) {\n const onAttachmentTagDismiss = useAttachmentTagListContext_unstable(context => context.onAttachmentTagDismiss);\n const {\n children,\n role\n } = props;\n const {\n elementType\n } = options;\n const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\n const hasParentContext = useHasParentContext(AttachmentTagListContext);\n const rootRole = role !== null && role !== void 0 ? role : hasParentContext ? 'menuitem' : undefined;\n const root = slot.always(getNativeElementProps(elementType.root, {\n ref,\n ...props,\n role: rootRole\n }), {\n elementType: elementType.root\n });\n root.onClick = mergeCallbacks(root.onClick, ev => onAttachmentTagDismiss === null || onAttachmentTagDismiss === void 0 ? void 0 : onAttachmentTagDismiss(ev, {\n content: children,\n media\n }));\n const media = slot.optional(props.media, {\n elementType: elementType.media\n });\n const content = slot.always(props.content, {\n defaultProps: {\n children\n },\n elementType: elementType.content\n });\n const icon = slot.always(props.icon, {\n defaultProps: {\n children: /*#__PURE__*/React.createElement(DismissIcon, null)\n },\n elementType: elementType.icon\n });\n return {\n components: {\n root: elementType.root,\n media: elementType.media,\n content: elementType.content,\n icon: elementType.icon\n },\n root,\n media,\n content,\n icon\n };\n}\n//# sourceMappingURL=useAttachmentTagSlots.js.map"],"names":["useAttachmentTagSlots","props","ref","options","onAttachmentTagDismiss","useAttachmentTagListContext_unstable","context","children","role","elementType","DismissIcon","bundleIcon","Dismiss20Filled","Dismiss20Regular","hasParentContext","useHasParentContext","AttachmentTagListContext","rootRole","undefined","root","slot","always","getNativeElementProps","onClick","mergeCallbacks","ev","content","media","optional","defaultProps","icon","React","createElement","components"],"mappings":";;;;+BAUgBA;;;eAAAA;;;;iEAVO;iCACqC;sCACxB;4BAC0B;0CACT;AAM9C,SAASA,sBAAsBC,KAAK,EAAEC,GAAG,EAAEC,OAAO;IACvD,MAAMC,yBAAyBC,IAAAA,8DAAoC,EAACC,CAAAA,UAAWA,QAAQF,sBAAsB;IAC7G,MAAM,EACJG,QAAQ,EACRC,IAAI,EACL,GAAGP;IACJ,MAAM,EACJQ,WAAW,EACZ,GAAGN;IACJ,MAAMO,cAAcC,IAAAA,sBAAU,EAACC,2BAAe,EAAEC,4BAAgB;IAChE,MAAMC,mBAAmBC,IAAAA,yCAAmB,EAACC,kDAAwB;IACrE,MAAMC,WAAWT,SAAS,QAAQA,SAAS,KAAK,IAAIA,OAAOM,mBAAmB,aAAaI;IAC3F,MAAMC,OAAOC,qBAAI,CAACC,MAAM,CAACC,IAAAA,sCAAqB,EAACb,YAAYU,IAAI,EAAE;QAC/DjB;QACA,GAAGD,KAAK;QACRO,MAAMS;IACR,IAAI;QACFR,aAAaA,YAAYU,IAAI;IAC/B;IACAA,KAAKI,OAAO,GAAGC,IAAAA,+BAAc,EAACL,KAAKI,OAAO,EAAEE,CAAAA,KAAMrB,2BAA2B,QAAQA,2BAA2B,KAAK,IAAI,KAAK,IAAIA,uBAAuBqB,IAAI;YAC3JC,SAASnB;YACToB;QACF;IACA,MAAMA,QAAQP,qBAAI,CAACQ,QAAQ,CAAC3B,MAAM0B,KAAK,EAAE;QACvClB,aAAaA,YAAYkB,KAAK;IAChC;IACA,MAAMD,UAAUN,qBAAI,CAACC,MAAM,CAACpB,MAAMyB,OAAO,EAAE;QACzCG,cAAc;YACZtB;QACF;QACAE,aAAaA,YAAYiB,OAAO;IAClC;IACA,MAAMI,OAAOV,qBAAI,CAACC,MAAM,CAACpB,MAAM6B,IAAI,EAAE;QACnCD,cAAc;YACZtB,UAAU,WAAW,GAAEwB,OAAMC,aAAa,CAACtB,aAAa;QAC1D;QACAD,aAAaA,YAAYqB,IAAI;IAC/B;IACA,OAAO;QACLG,YAAY;YACVd,MAAMV,YAAYU,IAAI;YACtBQ,OAAOlB,YAAYkB,KAAK;YACxBD,SAASjB,YAAYiB,OAAO;YAC5BI,MAAMrB,YAAYqB,IAAI;QACxB;QACAX;QACAQ;QACAD;QACAI;IACF;AACF,EACA,iDAAiD"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -38,8 +38,40 @@ _export(exports, {
|
|
|
38
38
|
},
|
|
39
39
|
useAttachmentTagList_unstable: function() {
|
|
40
40
|
return _AttachmentTagList.useAttachmentTagList_unstable;
|
|
41
|
+
},
|
|
42
|
+
AttachmentTagItem: function() {
|
|
43
|
+
return _AttachmentTagItem.AttachmentTagItem;
|
|
44
|
+
},
|
|
45
|
+
attachmentTagItemClassNames: function() {
|
|
46
|
+
return _AttachmentTagItem.attachmentTagItemClassNames;
|
|
47
|
+
},
|
|
48
|
+
renderAttachmentTagItem_unstable: function() {
|
|
49
|
+
return _AttachmentTagItem.renderAttachmentTagItem_unstable;
|
|
50
|
+
},
|
|
51
|
+
useAttachmentTagItemStyles_unstable: function() {
|
|
52
|
+
return _AttachmentTagItem.useAttachmentTagItemStyles_unstable;
|
|
53
|
+
},
|
|
54
|
+
useAttachmentTagItem_unstable: function() {
|
|
55
|
+
return _AttachmentTagItem.useAttachmentTagItem_unstable;
|
|
56
|
+
},
|
|
57
|
+
Attachment: function() {
|
|
58
|
+
return _Attachment.Attachment;
|
|
59
|
+
},
|
|
60
|
+
attachmentClassNames: function() {
|
|
61
|
+
return _Attachment.attachmentClassNames;
|
|
62
|
+
},
|
|
63
|
+
renderAttachment_unstable: function() {
|
|
64
|
+
return _Attachment.renderAttachment_unstable;
|
|
65
|
+
},
|
|
66
|
+
useAttachmentStyles_unstable: function() {
|
|
67
|
+
return _Attachment.useAttachmentStyles_unstable;
|
|
68
|
+
},
|
|
69
|
+
useAttachment_unstable: function() {
|
|
70
|
+
return _Attachment.useAttachment_unstable;
|
|
41
71
|
}
|
|
42
72
|
});
|
|
43
73
|
const _AttachmentTag = require("./AttachmentTag");
|
|
44
74
|
const _AttachmentTagList = require("./AttachmentTagList");
|
|
75
|
+
const _AttachmentTagItem = require("./AttachmentTagItem");
|
|
76
|
+
const _Attachment = require("./Attachment");
|
|
45
77
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export { AttachmentTag, attachmentTagClassNames, renderAttachmentTag_unstable, useAttachmentTagStyles_unstable, useAttachmentTag_unstable } from './AttachmentTag';\nexport { AttachmentTagList, attachmentTagListClassNames, renderAttachmentTagList_unstable, useAttachmentTagListStyles_unstable, useAttachmentTagList_unstable } from './AttachmentTagList';\n//# sourceMappingURL=index.js.map"],"names":["AttachmentTag","attachmentTagClassNames","renderAttachmentTag_unstable","useAttachmentTagStyles_unstable","useAttachmentTag_unstable","AttachmentTagList","attachmentTagListClassNames","renderAttachmentTagList_unstable","useAttachmentTagListStyles_unstable","useAttachmentTagList_unstable"],"mappings":";;;;;;;;;;;IAASA,aAAa;eAAbA,4BAAa;;IAAEC,uBAAuB;eAAvBA,sCAAuB;;IAAEC,4BAA4B;eAA5BA,2CAA4B;;IAAEC,+BAA+B;eAA/BA,8CAA+B;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAChIC,iBAAiB;eAAjBA,oCAAiB;;IAAEC,2BAA2B;eAA3BA,8CAA2B;;IAAEC,gCAAgC;eAAhCA,mDAAgC;;IAAEC,mCAAmC;eAAnCA,sDAAmC;;IAAEC,6BAA6B;eAA7BA,gDAA6B;;;+
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export { AttachmentTag, attachmentTagClassNames, renderAttachmentTag_unstable, useAttachmentTagStyles_unstable, useAttachmentTag_unstable } from './AttachmentTag';\nexport { AttachmentTagList, attachmentTagListClassNames, renderAttachmentTagList_unstable, useAttachmentTagListStyles_unstable, useAttachmentTagList_unstable } from './AttachmentTagList';\nexport { AttachmentTagItem, attachmentTagItemClassNames, renderAttachmentTagItem_unstable, useAttachmentTagItemStyles_unstable, useAttachmentTagItem_unstable } from './AttachmentTagItem';\nexport { Attachment, attachmentClassNames, renderAttachment_unstable, useAttachmentStyles_unstable, useAttachment_unstable } from './Attachment';\n//# sourceMappingURL=index.js.map"],"names":["AttachmentTag","attachmentTagClassNames","renderAttachmentTag_unstable","useAttachmentTagStyles_unstable","useAttachmentTag_unstable","AttachmentTagList","attachmentTagListClassNames","renderAttachmentTagList_unstable","useAttachmentTagListStyles_unstable","useAttachmentTagList_unstable","AttachmentTagItem","attachmentTagItemClassNames","renderAttachmentTagItem_unstable","useAttachmentTagItemStyles_unstable","useAttachmentTagItem_unstable","Attachment","attachmentClassNames","renderAttachment_unstable","useAttachmentStyles_unstable","useAttachment_unstable"],"mappings":";;;;;;;;;;;IAASA,aAAa;eAAbA,4BAAa;;IAAEC,uBAAuB;eAAvBA,sCAAuB;;IAAEC,4BAA4B;eAA5BA,2CAA4B;;IAAEC,+BAA+B;eAA/BA,8CAA+B;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAChIC,iBAAiB;eAAjBA,oCAAiB;;IAAEC,2BAA2B;eAA3BA,8CAA2B;;IAAEC,gCAAgC;eAAhCA,mDAAgC;;IAAEC,mCAAmC;eAAnCA,sDAAmC;;IAAEC,6BAA6B;eAA7BA,gDAA6B;;IACpJC,iBAAiB;eAAjBA,oCAAiB;;IAAEC,2BAA2B;eAA3BA,8CAA2B;;IAAEC,gCAAgC;eAAhCA,mDAAgC;;IAAEC,mCAAmC;eAAnCA,sDAAmC;;IAAEC,6BAA6B;eAA7BA,gDAA6B;;IACpJC,UAAU;eAAVA,sBAAU;;IAAEC,oBAAoB;eAApBA,gCAAoB;;IAAEC,yBAAyB;eAAzBA,qCAAyB;;IAAEC,4BAA4B;eAA5BA,wCAA4B;;IAAEC,sBAAsB;eAAtBA,kCAAsB;;;+BAHuB;mCACoB;mCACA;4BACnC;CAClI,iCAAiC"}
|
package/package.json
CHANGED