@fluentui-copilot/react-attachments 0.12.0 → 0.12.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 +30 -0
- package/CHANGELOG.md +19 -1
- package/dist/index.d.ts +47 -5
- package/lib/AgentTag.js +2 -0
- package/lib/AgentTag.js.map +1 -0
- package/lib/components/AgentTag/AgentTag.js +12 -0
- package/lib/components/AgentTag/AgentTag.js.map +1 -0
- package/lib/components/AgentTag/AgentTag.types.js +4 -0
- package/lib/components/AgentTag/AgentTag.types.js.map +1 -0
- package/lib/components/AgentTag/index.js +5 -0
- package/lib/components/AgentTag/index.js.map +1 -0
- package/lib/components/AgentTag/renderAgentTag.js +8 -0
- package/lib/components/AgentTag/renderAgentTag.js.map +1 -0
- package/lib/components/AgentTag/useAgentTag.js +20 -0
- package/lib/components/AgentTag/useAgentTag.js.map +1 -0
- package/lib/components/AgentTag/useAgentTagStyles.styles.js +95 -0
- package/lib/components/AgentTag/useAgentTagStyles.styles.js.map +1 -0
- package/lib/components/Attachment/Attachment.types.js.map +1 -1
- package/lib/components/Attachment/renderAttachment.js +20 -7
- package/lib/components/Attachment/renderAttachment.js.map +1 -1
- package/lib/components/Attachment/useAttachment.js +7 -2
- package/lib/components/Attachment/useAttachment.js.map +1 -1
- package/lib/components/Attachment/useAttachmentStyles.styles.js +110 -13
- package/lib/components/Attachment/useAttachmentStyles.styles.js.map +1 -1
- package/lib/components/AttachmentList/AttachmentList.types.js.map +1 -1
- package/lib/components/AttachmentList/useAttachmentList.js +3 -0
- package/lib/components/AttachmentList/useAttachmentList.js.map +1 -1
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.js +19 -2
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +36 -6
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +4 -1
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -1
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js +37 -4
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/AgentTag.js +29 -0
- package/lib-commonjs/AgentTag.js.map +1 -0
- package/lib-commonjs/components/AgentTag/AgentTag.js +21 -0
- package/lib-commonjs/components/AgentTag/AgentTag.js.map +1 -0
- package/lib-commonjs/components/AgentTag/AgentTag.types.js +7 -0
- package/lib-commonjs/components/AgentTag/AgentTag.types.js.map +1 -0
- package/lib-commonjs/components/AgentTag/index.js +32 -0
- package/lib-commonjs/components/AgentTag/index.js.map +1 -0
- package/lib-commonjs/components/AgentTag/renderAgentTag.js +14 -0
- package/lib-commonjs/components/AgentTag/renderAgentTag.js.map +1 -0
- package/lib-commonjs/components/AgentTag/useAgentTag.js +19 -0
- package/lib-commonjs/components/AgentTag/useAgentTag.js.map +1 -0
- package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.js +145 -0
- package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Attachment/Attachment.types.js.map +1 -1
- package/lib-commonjs/components/Attachment/renderAttachment.js +22 -6
- package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachment.js +6 -2
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js +176 -14
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js +3 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.js +21 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +50 -5
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +4 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js +45 -3
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js +16 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +3 -3
package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js
CHANGED
|
@@ -1,15 +1,39 @@
|
|
|
1
|
-
import { __styles, mergeClasses, slot } from '@fluentui/react-components';
|
|
1
|
+
import { __styles, mergeClasses, slot, tokens } from '@fluentui/react-components';
|
|
2
2
|
import { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';
|
|
3
3
|
export const attachmentOverflowMenuItemClassNames = {
|
|
4
4
|
root: 'fai-AttachmentOverflowMenuItem',
|
|
5
5
|
progress: 'fai-AttachmentOverflowMenuItem__progress'
|
|
6
6
|
};
|
|
7
|
+
const FOCUS_VISIBLE_ATTR = 'data-fui-focus-visible';
|
|
7
8
|
const useStyles = __styles({
|
|
8
9
|
imageOnly: {
|
|
9
10
|
Bt984gj: "f122n59"
|
|
11
|
+
},
|
|
12
|
+
secondaryContent: {
|
|
13
|
+
mc9l5x: "f22iagw",
|
|
14
|
+
Bt984gj: "f122n59"
|
|
10
15
|
}
|
|
11
16
|
}, {
|
|
12
|
-
d: [".f122n59{align-items:center;}"]
|
|
17
|
+
d: [".f122n59{align-items:center;}", ".f22iagw{display:flex;}"]
|
|
18
|
+
});
|
|
19
|
+
const useNextStyles = __styles({
|
|
20
|
+
nextStyles: {
|
|
21
|
+
Dah5zi: 0,
|
|
22
|
+
B1tsrr9: 0,
|
|
23
|
+
qqdqy8: 0,
|
|
24
|
+
Bkh64rk: 0,
|
|
25
|
+
e3fwne: "f84qbf7",
|
|
26
|
+
Bw0xxkn: 0,
|
|
27
|
+
oeaueh: 0,
|
|
28
|
+
Bpd4iqm: 0,
|
|
29
|
+
Befb4lg: "f1bars0k"
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
d: [[".f84qbf7[data-fui-focus-visible]::after{border-radius:var(--borderRadiusXLarge);}", {
|
|
33
|
+
p: -1
|
|
34
|
+
}], [".f1bars0k{outline:var(--strokeWidthThin) solid var(--colorTransparentStroke);}", {
|
|
35
|
+
p: -1
|
|
36
|
+
}]]
|
|
13
37
|
});
|
|
14
38
|
/**
|
|
15
39
|
* Apply styling to the AttachmentList slots based on the state
|
|
@@ -18,11 +42,20 @@ export const useAttachmentOverflowMenuItemStyles_unstable = state => {
|
|
|
18
42
|
'use no memo';
|
|
19
43
|
|
|
20
44
|
const {
|
|
21
|
-
imageOnly
|
|
45
|
+
imageOnly,
|
|
46
|
+
designVersion
|
|
22
47
|
} = state;
|
|
23
48
|
const styles = useStyles();
|
|
49
|
+
const nextStyles = useNextStyles();
|
|
24
50
|
const progressBarStyles = useProgressBarStyles();
|
|
25
|
-
state.root.className = mergeClasses(attachmentOverflowMenuItemClassNames.root, imageOnly && styles.imageOnly, state.root.className);
|
|
51
|
+
state.root.className = mergeClasses(attachmentOverflowMenuItemClassNames.root, imageOnly && styles.imageOnly, designVersion === 'next' && nextStyles.nextStyles, state.root.className);
|
|
52
|
+
const secondaryContent = slot.optional(state.root.secondaryContent, {
|
|
53
|
+
elementType: 'span'
|
|
54
|
+
});
|
|
55
|
+
if (secondaryContent) {
|
|
56
|
+
secondaryContent.className = mergeClasses(styles.secondaryContent, secondaryContent.className);
|
|
57
|
+
state.root.secondaryContent = secondaryContent;
|
|
58
|
+
}
|
|
26
59
|
if (state.progress) {
|
|
27
60
|
state.progress.className = mergeClasses(attachmentOverflowMenuItemClassNames.progress, progressBarStyles.progress, state.progress.className);
|
|
28
61
|
const bar = slot.optional(state.progress.bar, {
|
package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentOverflowMenuItemStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, slot } from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\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 'use no memo';\n\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":["makeStyles","mergeClasses","slot","useProgressBarStyles","attachmentOverflowMenuItemClassNames","root","progress","useStyles","imageOnly","alignItems","useAttachmentOverflowMenuItemStyles_unstable","state","styles","progressBarStyles","className","
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuItemStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, slot, tokens } from '@fluentui/react-components';\nimport { useProgressBarStyles } from '../utils/useProgressBarStyles.styles';\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 FOCUS_VISIBLE_ATTR = 'data-fui-focus-visible';\n\nconst useStyles = makeStyles({\n imageOnly: {\n alignItems: 'center',\n },\n secondaryContent: {\n display: 'flex',\n alignItems: 'center',\n },\n});\n\nconst useNextStyles = makeStyles({\n nextStyles: {\n [`[${FOCUS_VISIBLE_ATTR}]::after`]: {\n borderRadius: tokens.borderRadiusXLarge,\n },\n outline: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\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 'use no memo';\n\n const { imageOnly, designVersion } = state;\n const styles = useStyles();\n const nextStyles = useNextStyles();\n const progressBarStyles = useProgressBarStyles();\n\n state.root.className = mergeClasses(\n attachmentOverflowMenuItemClassNames.root,\n imageOnly && styles.imageOnly,\n designVersion === 'next' && nextStyles.nextStyles,\n state.root.className,\n );\n\n const secondaryContent = slot.optional(state.root.secondaryContent, {\n elementType: 'span',\n });\n if (secondaryContent) {\n secondaryContent.className = mergeClasses(styles.secondaryContent, secondaryContent.className);\n state.root.secondaryContent = secondaryContent;\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":["makeStyles","mergeClasses","slot","tokens","useProgressBarStyles","attachmentOverflowMenuItemClassNames","root","progress","FOCUS_VISIBLE_ATTR","useStyles","imageOnly","alignItems","secondaryContent","display","useNextStyles","nextStyles","borderRadius","borderRadiusXLarge","outline","strokeWidthThin","colorTransparentStroke","useAttachmentOverflowMenuItemStyles_unstable","state","designVersion","styles","progressBarStyles","className","optional","elementType","bar","renderByDefault","value","undefined","indeterminateProgressBar","regularProgressBar"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAEC,IAAI,EAAEC,MAAM,QAAQ,6BAA6B;AACpF,SAASC,oBAAoB,QAAQ,uCAAuC;AAO5E,OAAO,MAAMC,uCAAwF;IACnGC,MAAM;IACNC,UAAU;AACZ,EAAE;AAEF,MAAMC,qBAAqB;AAE3B,MAAMC,YAAYT,WAAW;IAC3BU,WAAW;QACTC,YAAY;IACd;IACAC,kBAAkB;QAChBC,SAAS;QACTF,YAAY;IACd;AACF;AAEA,MAAMG,gBAAgBd,WAAW;IAC/Be,YAAY;QACV,CAAC,CAAC,CAAC,EAAEP,mBAAmB,QAAQ,CAAC,CAAC,EAAE;YAClCQ,cAAcb,OAAOc,kBAAkB;QACzC;QACAC,SAAS,CAAC,EAAEf,OAAOgB,eAAe,CAAC,OAAO,EAAEhB,OAAOiB,sBAAsB,CAAC,CAAC;IAC7E;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,+CAA+C,CAC1DC;IAEA;IAEA,MAAM,EAAEZ,SAAS,EAAEa,aAAa,EAAE,GAAGD;IACrC,MAAME,SAASf;IACf,MAAMM,aAAaD;IACnB,MAAMW,oBAAoBrB;IAE1BkB,MAAMhB,IAAI,CAACoB,SAAS,GAAGzB,aACrBI,qCAAqCC,IAAI,EACzCI,aAAac,OAAOd,SAAS,EAC7Ba,kBAAkB,UAAUR,WAAWA,UAAU,EACjDO,MAAMhB,IAAI,CAACoB,SAAS;IAGtB,MAAMd,mBAAmBV,KAAKyB,QAAQ,CAACL,MAAMhB,IAAI,CAACM,gBAAgB,EAAE;QAClEgB,aAAa;IACf;IACA,IAAIhB,kBAAkB;QACpBA,iBAAiBc,SAAS,GAAGzB,aAAauB,OAAOZ,gBAAgB,EAAEA,iBAAiBc,SAAS;QAC7FJ,MAAMhB,IAAI,CAACM,gBAAgB,GAAGA;IAChC;IAEA,IAAIU,MAAMf,QAAQ,EAAE;QAClBe,MAAMf,QAAQ,CAACmB,SAAS,GAAGzB,aACzBI,qCAAqCE,QAAQ,EAC7CkB,kBAAkBlB,QAAQ,EAC1Be,MAAMf,QAAQ,CAACmB,SAAS;QAG1B,MAAMG,MAAM3B,KAAKyB,QAAQ,CAACL,MAAMf,QAAQ,CAACsB,GAAG,EAAE;YAAED,aAAa;YAAOE,iBAAiB;QAAK;QAC1F,IAAID,KAAK;YACP,IAAIP,MAAMf,QAAQ,CAACwB,KAAK,KAAKC,WAAW;gBACtCH,IAAIH,SAAS,GAAGzB,aAAawB,kBAAkBQ,wBAAwB,EAAEJ,IAAIH,SAAS;YACxF,OAAO;gBACLG,IAAIH,SAAS,GAAGzB,aAAawB,kBAAkBS,kBAAkB,EAAEL,IAAIH,SAAS;YAClF;YACAJ,MAAMf,QAAQ,CAACsB,GAAG,GAAGA;QACvB;IACF;IAEA,OAAOP;AACT,EAAE"}
|
package/lib/index.js
CHANGED
|
@@ -8,4 +8,5 @@ export { AttachmentOverflowMenu, renderAttachmentOverflowMenu_unstable, useAttac
|
|
|
8
8
|
export { AttachmentOverflowMenuContext, AttachmentOverflowMenuProvider, useAttachmentOverflowMenuContext_unstable } from './contexts/attachmentOverflowMenuContext';
|
|
9
9
|
export { AttachmentOverflowMenuButton, attachmentOverflowMenuButtonClassNames, renderAttachmentOverflowMenuButton_unstable, useAttachmentOverflowMenuButtonStyles_unstable, useAttachmentOverflowMenuButton_unstable } from './AttachmentOverflowMenuButton';
|
|
10
10
|
export { AttachmentOverflowMenuItem, attachmentOverflowMenuItemClassNames, renderAttachmentOverflowMenuItem_unstable, useAttachmentOverflowMenuItemStyles_unstable, useAttachmentOverflowMenuItem_unstable } from './AttachmentOverflowMenuItem';
|
|
11
|
+
export { AgentTag, renderAgentTag_unstable, useAgentTag_unstable, agentTagClassNames, useAgentTagStyles_unstable } from './AgentTag';
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { AttachmentTagProps, AttachmentTagSlots, AttachmentTagState } from './AttachmentTag';\nexport {\n AttachmentTag,\n attachmentTagClassNames,\n renderAttachmentTag_unstable,\n useAttachmentTagStyles_unstable,\n useAttachmentTag_unstable,\n} from './AttachmentTag';\nexport type {\n AttachmentTagDismissedData,\n AttachmentTagListProps,\n AttachmentTagListSlots,\n AttachmentTagListState,\n} from './AttachmentTagList';\nexport {\n AttachmentTagList,\n attachmentTagListClassNames,\n renderAttachmentTagList_unstable,\n useAttachmentTagListStyles_unstable,\n useAttachmentTagList_unstable,\n} from './AttachmentTagList';\n\nexport type { AttachmentTagItemProps, AttachmentTagItemSlots, AttachmentTagItemState } from './AttachmentTagItem';\nexport {\n AttachmentTagItem,\n attachmentTagItemClassNames,\n renderAttachmentTagItem_unstable,\n useAttachmentTagItemStyles_unstable,\n useAttachmentTagItem_unstable,\n} from './AttachmentTagItem';\n\nexport type {\n AttachmentListProps,\n AttachmentListSlots,\n AttachmentListState,\n AttachmentDismissedData,\n} from './AttachmentList';\nexport {\n AttachmentList,\n attachmentListClassNames,\n renderAttachmentList_unstable,\n useAttachmentListStyles_unstable,\n useAttachmentList_unstable,\n} from './AttachmentList';\nexport type { AttachmentListContextValue } from './contexts/attachmentListContext';\nexport {\n AttachmentListContext,\n AttachmentListProvider,\n useAttachmentListContext_unstable,\n} from './contexts/attachmentListContext';\nexport type { AttachmentProps, AttachmentSlots, AttachmentState } from './Attachment';\nexport {\n Attachment,\n attachmentClassNames,\n renderAttachment_unstable,\n useAttachmentStyles_unstable,\n useAttachment_unstable,\n} from './Attachment';\n\nexport type {\n AttachmentOverflowMenuProps,\n AttachmentOverflowMenuSlots,\n AttachmentOverflowMenuState,\n} from './AttachmentOverflowMenu';\nexport {\n AttachmentOverflowMenu,\n renderAttachmentOverflowMenu_unstable,\n useAttachmentOverflowMenu_unstable,\n} from './AttachmentOverflowMenu';\n\nexport type { AttachmentOverflowMenuContextValue } from './contexts/attachmentOverflowMenuContext';\nexport {\n AttachmentOverflowMenuContext,\n AttachmentOverflowMenuProvider,\n useAttachmentOverflowMenuContext_unstable,\n} from './contexts/attachmentOverflowMenuContext';\n\nexport type {\n AttachmentOverflowMenuButtonProps,\n AttachmentOverflowMenuButtonSlots,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton';\nexport {\n AttachmentOverflowMenuButton,\n attachmentOverflowMenuButtonClassNames,\n renderAttachmentOverflowMenuButton_unstable,\n useAttachmentOverflowMenuButtonStyles_unstable,\n useAttachmentOverflowMenuButton_unstable,\n} from './AttachmentOverflowMenuButton';\n\nexport type {\n AttachmentOverflowMenuItemProps,\n AttachmentOverflowMenuItemSlots,\n AttachmentOverflowMenuItemState,\n} from './AttachmentOverflowMenuItem';\nexport {\n AttachmentOverflowMenuItem,\n attachmentOverflowMenuItemClassNames,\n renderAttachmentOverflowMenuItem_unstable,\n useAttachmentOverflowMenuItemStyles_unstable,\n useAttachmentOverflowMenuItem_unstable,\n} from './AttachmentOverflowMenuItem';\n"],"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","AttachmentList","attachmentListClassNames","renderAttachmentList_unstable","useAttachmentListStyles_unstable","useAttachmentList_unstable","AttachmentListContext","AttachmentListProvider","useAttachmentListContext_unstable","Attachment","attachmentClassNames","renderAttachment_unstable","useAttachmentStyles_unstable","useAttachment_unstable","AttachmentOverflowMenu","renderAttachmentOverflowMenu_unstable","useAttachmentOverflowMenu_unstable","AttachmentOverflowMenuContext","AttachmentOverflowMenuProvider","useAttachmentOverflowMenuContext_unstable","AttachmentOverflowMenuButton","attachmentOverflowMenuButtonClassNames","renderAttachmentOverflowMenuButton_unstable","useAttachmentOverflowMenuButtonStyles_unstable","useAttachmentOverflowMenuButton_unstable","AttachmentOverflowMenuItem","attachmentOverflowMenuItemClassNames","renderAttachmentOverflowMenuItem_unstable","useAttachmentOverflowMenuItemStyles_unstable","useAttachmentOverflowMenuItem_unstable"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { AttachmentTagProps, AttachmentTagSlots, AttachmentTagState } from './AttachmentTag';\nexport {\n AttachmentTag,\n attachmentTagClassNames,\n renderAttachmentTag_unstable,\n useAttachmentTagStyles_unstable,\n useAttachmentTag_unstable,\n} from './AttachmentTag';\nexport type {\n AttachmentTagDismissedData,\n AttachmentTagListProps,\n AttachmentTagListSlots,\n AttachmentTagListState,\n} from './AttachmentTagList';\nexport {\n AttachmentTagList,\n attachmentTagListClassNames,\n renderAttachmentTagList_unstable,\n useAttachmentTagListStyles_unstable,\n useAttachmentTagList_unstable,\n} from './AttachmentTagList';\n\nexport type { AttachmentTagItemProps, AttachmentTagItemSlots, AttachmentTagItemState } from './AttachmentTagItem';\nexport {\n AttachmentTagItem,\n attachmentTagItemClassNames,\n renderAttachmentTagItem_unstable,\n useAttachmentTagItemStyles_unstable,\n useAttachmentTagItem_unstable,\n} from './AttachmentTagItem';\n\nexport type {\n AttachmentListProps,\n AttachmentListSlots,\n AttachmentListState,\n AttachmentDismissedData,\n} from './AttachmentList';\nexport {\n AttachmentList,\n attachmentListClassNames,\n renderAttachmentList_unstable,\n useAttachmentListStyles_unstable,\n useAttachmentList_unstable,\n} from './AttachmentList';\nexport type { AttachmentListContextValue } from './contexts/attachmentListContext';\nexport {\n AttachmentListContext,\n AttachmentListProvider,\n useAttachmentListContext_unstable,\n} from './contexts/attachmentListContext';\nexport type { AttachmentProps, AttachmentSlots, AttachmentState } from './Attachment';\nexport {\n Attachment,\n attachmentClassNames,\n renderAttachment_unstable,\n useAttachmentStyles_unstable,\n useAttachment_unstable,\n} from './Attachment';\n\nexport type {\n AttachmentOverflowMenuProps,\n AttachmentOverflowMenuSlots,\n AttachmentOverflowMenuState,\n} from './AttachmentOverflowMenu';\nexport {\n AttachmentOverflowMenu,\n renderAttachmentOverflowMenu_unstable,\n useAttachmentOverflowMenu_unstable,\n} from './AttachmentOverflowMenu';\n\nexport type { AttachmentOverflowMenuContextValue } from './contexts/attachmentOverflowMenuContext';\nexport {\n AttachmentOverflowMenuContext,\n AttachmentOverflowMenuProvider,\n useAttachmentOverflowMenuContext_unstable,\n} from './contexts/attachmentOverflowMenuContext';\n\nexport type {\n AttachmentOverflowMenuButtonProps,\n AttachmentOverflowMenuButtonSlots,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton';\nexport {\n AttachmentOverflowMenuButton,\n attachmentOverflowMenuButtonClassNames,\n renderAttachmentOverflowMenuButton_unstable,\n useAttachmentOverflowMenuButtonStyles_unstable,\n useAttachmentOverflowMenuButton_unstable,\n} from './AttachmentOverflowMenuButton';\n\nexport type {\n AttachmentOverflowMenuItemProps,\n AttachmentOverflowMenuItemSlots,\n AttachmentOverflowMenuItemState,\n} from './AttachmentOverflowMenuItem';\nexport {\n AttachmentOverflowMenuItem,\n attachmentOverflowMenuItemClassNames,\n renderAttachmentOverflowMenuItem_unstable,\n useAttachmentOverflowMenuItemStyles_unstable,\n useAttachmentOverflowMenuItem_unstable,\n} from './AttachmentOverflowMenuItem';\n\nexport {\n AgentTag,\n renderAgentTag_unstable,\n useAgentTag_unstable,\n agentTagClassNames,\n useAgentTagStyles_unstable,\n} from './AgentTag';\nexport type { AgentTagProps, AgentTagSlots, AgentTagState } from './AgentTag';\n"],"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","AttachmentList","attachmentListClassNames","renderAttachmentList_unstable","useAttachmentListStyles_unstable","useAttachmentList_unstable","AttachmentListContext","AttachmentListProvider","useAttachmentListContext_unstable","Attachment","attachmentClassNames","renderAttachment_unstable","useAttachmentStyles_unstable","useAttachment_unstable","AttachmentOverflowMenu","renderAttachmentOverflowMenu_unstable","useAttachmentOverflowMenu_unstable","AttachmentOverflowMenuContext","AttachmentOverflowMenuProvider","useAttachmentOverflowMenuContext_unstable","AttachmentOverflowMenuButton","attachmentOverflowMenuButtonClassNames","renderAttachmentOverflowMenuButton_unstable","useAttachmentOverflowMenuButtonStyles_unstable","useAttachmentOverflowMenuButton_unstable","AttachmentOverflowMenuItem","attachmentOverflowMenuItemClassNames","renderAttachmentOverflowMenuItem_unstable","useAttachmentOverflowMenuItemStyles_unstable","useAttachmentOverflowMenuItem_unstable","AgentTag","renderAgentTag_unstable","useAgentTag_unstable","agentTagClassNames","useAgentTagStyles_unstable"],"rangeMappings":";;;;;;;;;;","mappings":"AACA,SACEA,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,kBAAkB;AAOzB,SACEC,iBAAiB,EACjBC,2BAA2B,EAC3BC,gCAAgC,EAChCC,mCAAmC,EACnCC,6BAA6B,QACxB,sBAAsB;AAG7B,SACEC,iBAAiB,EACjBC,2BAA2B,EAC3BC,gCAAgC,EAChCC,mCAAmC,EACnCC,6BAA6B,QACxB,sBAAsB;AAQ7B,SACEC,cAAc,EACdC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,QACrB,mBAAmB;AAE1B,SACEC,qBAAqB,EACrBC,sBAAsB,EACtBC,iCAAiC,QAC5B,mCAAmC;AAE1C,SACEC,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,QACjB,eAAe;AAOtB,SACEC,sBAAsB,EACtBC,qCAAqC,EACrCC,kCAAkC,QAC7B,2BAA2B;AAGlC,SACEC,6BAA6B,EAC7BC,8BAA8B,EAC9BC,yCAAyC,QACpC,2CAA2C;AAOlD,SACEC,4BAA4B,EAC5BC,sCAAsC,EACtCC,2CAA2C,EAC3CC,8CAA8C,EAC9CC,wCAAwC,QACnC,iCAAiC;AAOxC,SACEC,0BAA0B,EAC1BC,oCAAoC,EACpCC,yCAAyC,EACzCC,4CAA4C,EAC5CC,sCAAsC,QACjC,+BAA+B;AAEtC,SACEC,QAAQ,EACRC,uBAAuB,EACvBC,oBAAoB,EACpBC,kBAAkB,EAClBC,0BAA0B,QACrB,aAAa"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
AgentTag: function() {
|
|
13
|
+
return _index.AgentTag;
|
|
14
|
+
},
|
|
15
|
+
agentTagClassNames: function() {
|
|
16
|
+
return _index.agentTagClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderAgentTag_unstable: function() {
|
|
19
|
+
return _index.renderAgentTag_unstable;
|
|
20
|
+
},
|
|
21
|
+
useAgentTagStyles_unstable: function() {
|
|
22
|
+
return _index.useAgentTagStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
useAgentTag_unstable: function() {
|
|
25
|
+
return _index.useAgentTag_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _index = require("./components/AgentTag/index");
|
|
29
|
+
//# sourceMappingURL=AgentTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AgentTag.ts"],"sourcesContent":["export {\n AgentTag,\n renderAgentTag_unstable,\n useAgentTag_unstable,\n agentTagClassNames,\n useAgentTagStyles_unstable,\n} from './components/AgentTag/index';\nexport type { AgentTagProps, AgentTagSlots, AgentTagState } from './components/AgentTag/index';\n"],"names":["AgentTag","agentTagClassNames","renderAgentTag_unstable","useAgentTagStyles_unstable","useAgentTag_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,QAAQ;eAARA,eAAQ;;IAGRC,kBAAkB;eAAlBA,yBAAkB;;IAFlBC,uBAAuB;eAAvBA,8BAAuB;;IAGvBC,0BAA0B;eAA1BA,iCAA0B;;IAF1BC,oBAAoB;eAApBA,2BAAoB;;;uBAGf"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "AgentTag", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return AgentTag;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useAgentTag = require("./useAgentTag");
|
|
14
|
+
const _renderAgentTag = require("./renderAgentTag");
|
|
15
|
+
const _useAgentTagStylesstyles = require("./useAgentTagStyles.styles");
|
|
16
|
+
const AgentTag = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
17
|
+
const state = (0, _useAgentTag.useAgentTag_unstable)(props, ref);
|
|
18
|
+
(0, _useAgentTagStylesstyles.useAgentTagStyles_unstable)(state);
|
|
19
|
+
return (0, _renderAgentTag.renderAgentTag_unstable)(state);
|
|
20
|
+
});
|
|
21
|
+
AgentTag.displayName = 'AgentTag'; //# sourceMappingURL=AgentTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AgentTag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAgentTag_unstable } from './useAgentTag';\nimport { renderAgentTag_unstable } from './renderAgentTag';\nimport { useAgentTagStyles_unstable } from './useAgentTagStyles.styles';\nimport type { AgentTagProps } from './AgentTag.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// AgentTag component - TODO: add more docs\nexport const AgentTag: ForwardRefComponent<AgentTagProps> = React.forwardRef((props, ref) => {\n const state = useAgentTag_unstable(props, ref);\n\n useAgentTagStyles_unstable(state);\n return renderAgentTag_unstable(state);\n});\n\nAgentTag.displayName = 'AgentTag';\n"],"names":["AgentTag","React","forwardRef","props","state","useAgentTag_unstable","useAgentTagStyles_unstable","renderAgentTag_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;6BACc;gCACG;yCACG;AAKpC,MAAMA,WAAAA,WAAAA,GAAAA,OAA+CC,UAAMC,CAAU,CAACC,OAACA;UAC5EC,QAAMA,IAAAA,iCAAQC,EAAAA,OAAqBF;2DAEnCG,EAAAA;WACAC,IAAAA,uCAAOA,EAAAA;AACT;AAEAP,SAASQ,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AgentTag.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState } from '@fluentui/react-components';\nimport type { AttachmentSlots, AttachmentProps, AttachmentState } from '../Attachment';\n\nexport type AgentTagSlots = AttachmentSlots;\n\n/**\n * AgentTag Props\n */\nexport type AgentTagProps = ComponentProps<Partial<Omit<AgentTagSlots, 'primaryAction' | 'progress'>>> &\n Omit<AttachmentProps, keyof AttachmentSlots | 'dismissOnly'>;\n\n/**\n * State used in rendering AgentTag\n */\nexport type AgentTagState = ComponentState<AgentTagSlots> & Omit<AttachmentState, keyof AttachmentSlots>;\n"],"names":[],"rangeMappings":";;","mappings":"AAWA;;CAEC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
AgentTag: function() {
|
|
13
|
+
return _AgentTag.AgentTag;
|
|
14
|
+
},
|
|
15
|
+
agentTagClassNames: function() {
|
|
16
|
+
return _useAgentTagStylesstyles.agentTagClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderAgentTag_unstable: function() {
|
|
19
|
+
return _renderAgentTag.renderAgentTag_unstable;
|
|
20
|
+
},
|
|
21
|
+
useAgentTagStyles_unstable: function() {
|
|
22
|
+
return _useAgentTagStylesstyles.useAgentTagStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
useAgentTag_unstable: function() {
|
|
25
|
+
return _useAgentTag.useAgentTag_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _AgentTag = require("./AgentTag");
|
|
29
|
+
const _renderAgentTag = require("./renderAgentTag");
|
|
30
|
+
const _useAgentTag = require("./useAgentTag");
|
|
31
|
+
const _useAgentTagStylesstyles = require("./useAgentTagStyles.styles");
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { AgentTag } from './AgentTag';\nexport type { AgentTagProps, AgentTagSlots, AgentTagState } from './AgentTag.types';\nexport { renderAgentTag_unstable } from './renderAgentTag';\nexport { useAgentTag_unstable } from './useAgentTag';\nexport { agentTagClassNames, useAgentTagStyles_unstable } from './useAgentTagStyles.styles';\n"],"names":["AgentTag","agentTagClassNames","renderAgentTag_unstable","useAgentTagStyles_unstable","useAgentTag_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,QAAQ;eAARA,kBAAQ;;IAIRC,kBAAkB;eAAlBA,2CAAkB;;IAFlBC,uBAAuB;eAAvBA,uCAAuB;;IAEHC,0BAA0B;eAA1BA,mDAA0B;;IAD9CC,oBAAoB;eAApBA,iCAAoB;;;0BAHJ;gCAEe;6BACH;yCAC0B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderAgentTag_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderAgentTag_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _Attachment = require("../Attachment");
|
|
12
|
+
const renderAgentTag_unstable = (state)=>{
|
|
13
|
+
return (0, _Attachment.renderAttachment_unstable)(state);
|
|
14
|
+
}; //# sourceMappingURL=renderAgentTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderAgentTag.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { renderAttachment_unstable } from '../Attachment';\nimport type { AgentTagState } from './AgentTag.types';\n\n/**\n * Render the final JSX of AgentTag\n */\nexport const renderAgentTag_unstable = (state: AgentTagState) => {\n return renderAttachment_unstable(state);\n};\n"],"names":["renderAttachment_unstable","state"],"rangeMappings":";;;;;;;;;;;;","mappings":";;;;+BAUSA;;;eAAAA;;;4BATT;AASE,MAAOA,0BAA0BC,CAAAA;IACjC,OAAAD,IAAAA,qCAAA,EAAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useAgentTag_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useAgentTag_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _ = require("..");
|
|
12
|
+
const useAgentTag_unstable = (props, ref)=>{
|
|
13
|
+
const state = (0, _.useAttachment_unstable)({
|
|
14
|
+
...props,
|
|
15
|
+
dismissOnly: true,
|
|
16
|
+
designVersion: 'next'
|
|
17
|
+
}, ref);
|
|
18
|
+
return state;
|
|
19
|
+
}; //# sourceMappingURL=useAgentTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAgentTag.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { AgentTagProps, AgentTagState } from './AgentTag.types';\nimport { useAttachment_unstable } from '..';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\n\n/**\n * Create the state required to render AgentTag.\n *\n * The returned state can be modified with hooks such as useAgentTagStyles_unstable,\n * before being passed to renderAgentTag_unstable.\n *\n * @param props - props from this instance of AgentTag\n * @param ref - reference to root HTMLElement of AgentTag\n */\nexport const useAgentTag_unstable = (props: AgentTagProps, ref: React.Ref<HTMLDivElement>): AgentTagState => {\n const state = useAttachment_unstable({ ...props, dismissOnly: true, designVersion: 'next' }, ref);\n\n return state;\n};\n"],"names":["state","useAttachment_unstable","ref","dismissOnly","designVersion"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBQA;;;eAAAA;;;kBAd+B;AAcrC,MAAMA,uBAAQC,CAAAA,OAAuBC;UAAEF,QAAQC,IAAAA,wBAAA,EAAA;gBAAEE;qBAAmBC;QAAsBA,eAAGF;OAE7FA;IACA,OAAAF"}
|
|
@@ -0,0 +1,145 @@
|
|
|
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
|
+
agentTagClassNames: function() {
|
|
13
|
+
return agentTagClassNames;
|
|
14
|
+
},
|
|
15
|
+
useAgentTagStyles_unstable: function() {
|
|
16
|
+
return useAgentTagStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _ = require("..");
|
|
21
|
+
const agentTagClassNames = {
|
|
22
|
+
root: 'fai-AgentTag',
|
|
23
|
+
primaryAction: 'fai-AgentTag__primaryAction',
|
|
24
|
+
dismissIcon: 'fai-AgentTag__dismissIcon',
|
|
25
|
+
dismissButton: 'fai-AgentTag__dismissButton',
|
|
26
|
+
media: 'fai-AgentTag__media',
|
|
27
|
+
content: 'fai-AgentTag__content',
|
|
28
|
+
progress: 'fai-AgentTag__progress'
|
|
29
|
+
};
|
|
30
|
+
const useMediaStyles = (0, _reactcomponents.__styles)({
|
|
31
|
+
canvas: {
|
|
32
|
+
a9b677: "fq4mcun",
|
|
33
|
+
Bqenvij: "frvgh55"
|
|
34
|
+
},
|
|
35
|
+
sidecar: {
|
|
36
|
+
a9b677: "f64fuq3",
|
|
37
|
+
Bqenvij: "fjamq6b"
|
|
38
|
+
}
|
|
39
|
+
}, {
|
|
40
|
+
d: [
|
|
41
|
+
".fq4mcun{width:24px;}",
|
|
42
|
+
".frvgh55{height:24px;}",
|
|
43
|
+
".f64fuq3{width:20px;}",
|
|
44
|
+
".fjamq6b{height:20px;}"
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
const useContentStyles = (0, _reactcomponents.__styles)({
|
|
48
|
+
canvas: {
|
|
49
|
+
Bahqtrf: "fk6fouc",
|
|
50
|
+
Be2twd7: "fod5ikn",
|
|
51
|
+
Bhrd7zp: "fl43uef",
|
|
52
|
+
Bg96gwp: "faaz57k",
|
|
53
|
+
sj55zd: "fkfq4zb"
|
|
54
|
+
},
|
|
55
|
+
sidecar: {
|
|
56
|
+
Bahqtrf: "fk6fouc",
|
|
57
|
+
Be2twd7: "fkhj508",
|
|
58
|
+
Bhrd7zp: "fl43uef",
|
|
59
|
+
Bg96gwp: "f1i3iumi",
|
|
60
|
+
sj55zd: "fkfq4zb"
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
d: [
|
|
64
|
+
".fk6fouc{font-family:var(--fontFamilyBase);}",
|
|
65
|
+
".fod5ikn{font-size:var(--fontSizeBase400);}",
|
|
66
|
+
".fl43uef{font-weight:var(--fontWeightSemibold);}",
|
|
67
|
+
".faaz57k{line-height:var(--lineHeightBase400);}",
|
|
68
|
+
".fkfq4zb{color:var(--colorNeutralForeground2);}",
|
|
69
|
+
".fkhj508{font-size:var(--fontSizeBase300);}",
|
|
70
|
+
".f1i3iumi{line-height:var(--lineHeightBase300);}"
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
const useDismissButtonStyles = (0, _reactcomponents.__styles)({
|
|
74
|
+
canvas: {
|
|
75
|
+
Beyfa6y: 0,
|
|
76
|
+
Bbmb7ep: 0,
|
|
77
|
+
Btl43ni: 0,
|
|
78
|
+
B7oj6ja: 0,
|
|
79
|
+
Dimara: "f1jxijnj",
|
|
80
|
+
uwmqm3: [
|
|
81
|
+
"fhx4nu",
|
|
82
|
+
"fjodcmx"
|
|
83
|
+
],
|
|
84
|
+
z189sj: [
|
|
85
|
+
"fw5db7e",
|
|
86
|
+
"f1uw59to"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
sidecar: {
|
|
90
|
+
uwmqm3: [
|
|
91
|
+
"f1uw59to",
|
|
92
|
+
"fw5db7e"
|
|
93
|
+
],
|
|
94
|
+
z189sj: [
|
|
95
|
+
"f1vdfbxk",
|
|
96
|
+
"f1f5gg8d"
|
|
97
|
+
],
|
|
98
|
+
Beyfa6y: 0,
|
|
99
|
+
Bbmb7ep: 0,
|
|
100
|
+
Btl43ni: 0,
|
|
101
|
+
B7oj6ja: 0,
|
|
102
|
+
Dimara: "f1kijzfu"
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
d: [
|
|
106
|
+
[
|
|
107
|
+
".f1jxijnj{border-radius:var(--borderRadius2XL);}",
|
|
108
|
+
{
|
|
109
|
+
p: -1
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
".fhx4nu{padding-left:var(--spacingHorizontalL);}",
|
|
113
|
+
".fjodcmx{padding-right:var(--spacingHorizontalL);}",
|
|
114
|
+
".fw5db7e{padding-right:var(--spacingHorizontalM);}",
|
|
115
|
+
".f1uw59to{padding-left:var(--spacingHorizontalM);}",
|
|
116
|
+
".f1vdfbxk{padding-right:var(--spacingHorizontalS);}",
|
|
117
|
+
".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
|
|
118
|
+
[
|
|
119
|
+
".f1kijzfu{border-radius:var(--borderRadiusXLarge);}",
|
|
120
|
+
{
|
|
121
|
+
p: -1
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
]
|
|
125
|
+
});
|
|
126
|
+
const useAgentTagStyles_unstable = (state)=>{
|
|
127
|
+
'use no memo';
|
|
128
|
+
const { mode } = state;
|
|
129
|
+
const contentStyles = useContentStyles();
|
|
130
|
+
const dismissButtonStyles = useDismissButtonStyles();
|
|
131
|
+
const mediaStyles = useMediaStyles();
|
|
132
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(agentTagClassNames.root, state.root.className);
|
|
133
|
+
state.primaryAction.className = (0, _reactcomponents.mergeClasses)(agentTagClassNames.primaryAction, state.primaryAction.className);
|
|
134
|
+
state.dismissIcon.className = (0, _reactcomponents.mergeClasses)(agentTagClassNames.dismissIcon, state.dismissIcon.className);
|
|
135
|
+
state.dismissButton.className = (0, _reactcomponents.mergeClasses)(agentTagClassNames.dismissButton, dismissButtonStyles[mode], state.dismissButton.className);
|
|
136
|
+
if (state.media) {
|
|
137
|
+
state.media.className = (0, _reactcomponents.mergeClasses)(agentTagClassNames.media, mediaStyles[mode], state.media.className);
|
|
138
|
+
}
|
|
139
|
+
state.content.className = (0, _reactcomponents.mergeClasses)(agentTagClassNames.content, contentStyles[mode], state.content.className);
|
|
140
|
+
if (state.progress) {
|
|
141
|
+
state.progress.className = (0, _reactcomponents.mergeClasses)(agentTagClassNames.progress, state.progress.className);
|
|
142
|
+
}
|
|
143
|
+
(0, _.useAttachmentStyles_unstable)(state);
|
|
144
|
+
return state;
|
|
145
|
+
}; //# sourceMappingURL=useAgentTagStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAgentTagStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';\nimport type { AgentTagSlots, AgentTagState } from './AgentTag.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\nimport { useAttachmentStyles_unstable } from '..';\nimport { tokens } from '@fluentui-copilot/tokens';\n\nexport const agentTagClassNames: SlotClassNames<AgentTagSlots> = {\n root: 'fai-AgentTag',\n primaryAction: 'fai-AgentTag__primaryAction',\n dismissIcon: 'fai-AgentTag__dismissIcon',\n dismissButton: 'fai-AgentTag__dismissButton',\n media: 'fai-AgentTag__media',\n content: 'fai-AgentTag__content',\n progress: 'fai-AgentTag__progress',\n};\n\nconst useMediaStyles = makeStyles({\n canvas: {\n width: '24px',\n height: '24px',\n },\n sidecar: { width: '20px', height: '20px' },\n});\n\nconst useContentStyles = makeStyles({\n canvas: {\n ...typographyStyles.subtitle2,\n color: tokens.colorNeutralForeground2,\n },\n sidecar: {\n ...typographyStyles.body1Strong,\n color: tokens.colorNeutralForeground2,\n },\n});\n\nconst useDismissButtonStyles = makeStyles({\n canvas: {\n borderRadius: tokens.borderRadius2XL,\n paddingLeft: tokens.spacingHorizontalL,\n paddingRight: tokens.spacingHorizontalM,\n },\n sidecar: {\n paddingLeft: tokens.spacingHorizontalM,\n paddingRight: tokens.spacingHorizontalS,\n borderRadius: tokens.borderRadiusXLarge,\n },\n});\n\n/**\n * Apply styling to the AgentTag slots based on the state\n */\nexport const useAgentTagStyles_unstable = (state: AgentTagState): AgentTagState => {\n 'use no memo';\n\n const { mode } = state;\n\n const contentStyles = useContentStyles();\n const dismissButtonStyles = useDismissButtonStyles();\n const mediaStyles = useMediaStyles();\n\n state.root.className = mergeClasses(agentTagClassNames.root, state.root.className);\n\n state.primaryAction.className = mergeClasses(agentTagClassNames.primaryAction, state.primaryAction.className);\n\n state.dismissIcon.className = mergeClasses(agentTagClassNames.dismissIcon, state.dismissIcon.className);\n\n state.dismissButton.className = mergeClasses(\n agentTagClassNames.dismissButton,\n dismissButtonStyles[mode],\n state.dismissButton.className,\n );\n\n if (state.media) {\n state.media.className = mergeClasses(agentTagClassNames.media, mediaStyles[mode], state.media.className);\n }\n\n state.content.className = mergeClasses(agentTagClassNames.content, contentStyles[mode], state.content.className);\n\n if (state.progress) {\n state.progress.className = mergeClasses(agentTagClassNames.progress, state.progress.className);\n }\n\n useAttachmentStyles_unstable(state);\n\n return state;\n};\n"],"names":["agentTagClassNames","root","primaryAction","dismissIcon","dismissButton","media","content","progress","useMediaStyles","makeStyles","canvas","width","height","sidecar","d","useContentStyles","typographyStyles","subtitle2","color","Bahqtrf","sj55zd","useDismissButtonStyles","borderRadius","paddingLeft","paddingRight","__styles","Beyfa6y","Btl43ni","B7oj6ja","Dimara","mode","uwmqm3","contentStyles","z189sj","dismissButtonStyles","state","className","mergeClasses","Bbmb7ep","useAttachmentStyles_unstable","p"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMaA,kBAAAA;eAAAA;;;;;;iCANsC;kBAGN;AAGtC,MAAMA,qBAAoD;UAC/DC;mBACAC;iBACAC;mBACAC;WACAC;aACAC;cACAC;AACF;AAEA,MAAMC,iBAAiBC,IAAAA,yBAAAA,EAAAA;YACrBC;gBACEC;iBACAC;;aAEFC;gBAAWF;iBAAeC;;AAC5B,GAAA;IAEAE,GAAA;QAAMC;QAAmBN;QAAW;QAAA;KAAA;;yBAE7BO,IAAAA,yBAAiBC,EAAAA;YACpBC;QACFC,SAAA;QACAN,SAAS;iBACJG;iBACHE;QACFE,QAAA;IACF;IAEAP,SAAMQ;QACJX,SAAQ;iBACNY;iBACAC;iBACAC;QACFJ,QAAA;;;;;QAGyC;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;;MAEzCC,yBAAAI,IAAAA,yBAAA,EAAA;IACFf,QAAA;QAEAgB,SAAA;;QAGAC,SAAO;QACLC,SAAA;QAEAC,QAAQC;QAERC,QAAMC;YAAAA;YAAAA;SAAgBjB;QACtBkB,QAAMC;YAAAA;YAAAA;SAAsBb;;aAGtBpB;QAENkC,QAAMjC;YAAAA;YAAckC;SAAS;QAE7BD,QAAMhC;YAAAA;YAAYiC;SAAYC;QAE9BF,SAAM/B;QAMNkC,SAAIH;iBACFA;QACFP,SAAA;QAEAO,QAAM7B;;;OAIN;QAAA;YAAA;YAAA;gBAEAiC,GAAAA,CAAAA;;SAEA;QAAA;QAAOJ;QAAAA;QAAAA;QAAAA;QAAAA;QAAAA;YAAAA;YAAAA;gBACPK,GAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Attachment.types.ts"],"sourcesContent":["import type { CopilotMode, DesignVersion } from '@fluentui-copilot/react-provider';\nimport type { ComponentProps, ComponentState, ProgressBar, Slot } from '@fluentui/react-components';\n\nexport type AttachmentSlots = {\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Attachments support a primary action.\n */\n primaryAction: NonNullable<Slot<'button', 'span'>>;\n\n /**\n * Attachments have a dismiss button.\n */\n dismissButton: NonNullable<Slot<'button'>>;\n\n /**\n * Attachments can include an image or other media.\n */\n media?: Slot<'span'>;\n\n /**\n * The content of the attachment.\n */\n content: NonNullable<Slot<'span'>>;\n\n /**\n * The icon that renders for the `dismissButton`.\n */\n dismissIcon: NonNullable<Slot<'span'>>;\n\n /**\n * An attachment supports a progress bar, which can display the attachment's upload progress.\n */\n progress?: Slot<typeof ProgressBar>;\n};\n\n/**\n * Attachment Props\n */\nexport type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> &\n CopilotMode &\n DesignVersion & {\n /**\n * Use this prop if an attachment has no text content.\n *\n * @default false\n */\n imageOnly?: boolean;\n\n /**\n * An attachment supports different sizes.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium';\n };\n\n/**\n * State used in rendering Attachment\n */\nexport type AttachmentState = ComponentState<AttachmentSlots> &\n Required<Pick<AttachmentProps, 'id' | 'size' | 'designVersion' | 'mode'>> &\n Pick<AttachmentProps, 'imageOnly'> & {\n isLoading: boolean;\n shouldUseOverflow: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"
|
|
1
|
+
{"version":3,"sources":["Attachment.types.ts"],"sourcesContent":["import type { CopilotMode, DesignVersion } from '@fluentui-copilot/react-provider';\nimport type { ComponentProps, ComponentState, ProgressBar, Slot } from '@fluentui/react-components';\n\nexport type AttachmentSlots = {\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Attachments support a primary action.\n */\n primaryAction: NonNullable<Slot<'button', 'span'>>;\n\n /**\n * Attachments have a dismiss button.\n */\n dismissButton: NonNullable<Slot<'button'>>;\n\n /**\n * Attachments can include an image or other media.\n */\n media?: Slot<'span'>;\n\n /**\n * The content of the attachment.\n */\n content: NonNullable<Slot<'span'>>;\n\n /**\n * The icon that renders for the `dismissButton`.\n */\n dismissIcon: NonNullable<Slot<'span'>>;\n\n /**\n * An attachment supports a progress bar, which can display the attachment's upload progress.\n */\n progress?: Slot<typeof ProgressBar>;\n};\n\n/**\n * Attachment Props\n */\nexport type AttachmentProps = ComponentProps<Partial<AttachmentSlots>> &\n CopilotMode &\n DesignVersion & {\n /**\n * Use this prop if an attachment has no text content.\n *\n * @default false\n */\n imageOnly?: boolean;\n\n /**\n * An attachment supports different sizes.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium';\n /**\n * Use this prop if the attachment has no primary action\n * and should be rendered as a single button\n */\n dismissOnly?: boolean;\n };\n\n/**\n * State used in rendering Attachment\n */\nexport type AttachmentState = ComponentState<AttachmentSlots> &\n Required<Pick<AttachmentProps, 'id' | 'size' | 'designVersion' | 'mode' | 'dismissOnly'>> &\n Pick<AttachmentProps, 'imageOnly'> & {\n isLoading: boolean;\n shouldUseOverflow: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AA+DA;;CAEC"}
|
|
@@ -11,9 +11,16 @@ Object.defineProperty(exports, "renderAttachment_unstable", {
|
|
|
11
11
|
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
12
|
const _reactcomponents = require("@fluentui/react-components");
|
|
13
13
|
const renderAttachment_unstable = (state)=>{
|
|
14
|
+
const { id, shouldUseOverflow, designVersion, dismissOnly } = state;
|
|
15
|
+
const attachment = designVersion === 'next' && dismissOnly ? renderDismissOnly(state) : renderAttachment(state);
|
|
16
|
+
return shouldUseOverflow ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.OverflowItem, {
|
|
17
|
+
id: id,
|
|
18
|
+
children: attachment
|
|
19
|
+
}, id) : attachment;
|
|
20
|
+
};
|
|
21
|
+
const renderAttachment = (state)=>{
|
|
14
22
|
(0, _reactcomponents.assertSlots)(state);
|
|
15
|
-
|
|
16
|
-
const attachment = /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
23
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
17
24
|
children: [
|
|
18
25
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(state.primaryAction, {
|
|
19
26
|
children: [
|
|
@@ -27,8 +34,17 @@ const renderAttachment_unstable = (state)=>{
|
|
|
27
34
|
})
|
|
28
35
|
]
|
|
29
36
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
};
|
|
38
|
+
const renderDismissOnly = (state)=>{
|
|
39
|
+
(0, _reactcomponents.assertSlots)(state);
|
|
40
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {
|
|
41
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.dismissButton, {
|
|
42
|
+
children: [
|
|
43
|
+
state.media && !state.imageOnly && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.media, {}),
|
|
44
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.content, {}),
|
|
45
|
+
state.progress && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.progress, {}),
|
|
46
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.dismissIcon, {})
|
|
47
|
+
]
|
|
48
|
+
})
|
|
49
|
+
});
|
|
34
50
|
}; //# sourceMappingURL=renderAttachment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderAttachment.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { OverflowItem, assertSlots } from '@fluentui/react-components';\nimport type { AttachmentState, AttachmentSlots } from './Attachment.types';\n\n/**\n * Render the final JSX of Attachment\n */\nexport const renderAttachment_unstable = (state: AttachmentState) => {\n
|
|
1
|
+
{"version":3,"sources":["renderAttachment.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { OverflowItem, assertSlots } from '@fluentui/react-components';\nimport type { AttachmentState, AttachmentSlots } from './Attachment.types';\n\n/**\n * Render the final JSX of Attachment\n */\nexport const renderAttachment_unstable = (state: AttachmentState) => {\n const { id, shouldUseOverflow, designVersion, dismissOnly } = state;\n\n const attachment = designVersion === 'next' && dismissOnly ? renderDismissOnly(state) : renderAttachment(state);\n\n return shouldUseOverflow ? (\n <OverflowItem id={id} key={id}>\n {attachment}\n </OverflowItem>\n ) : (\n attachment\n );\n};\n\nconst renderAttachment = (state: AttachmentState) => {\n assertSlots<AttachmentSlots>(state);\n\n return (\n <state.root>\n <state.primaryAction>\n {state.media && !state.imageOnly && <state.media />}\n <state.content />\n {state.progress && <state.progress />}\n </state.primaryAction>\n <state.dismissButton>\n <state.dismissIcon />\n </state.dismissButton>\n </state.root>\n );\n};\n\nconst renderDismissOnly = (state: AttachmentState) => {\n assertSlots<AttachmentSlots>(state);\n\n return (\n <state.root>\n <state.dismissButton>\n {state.media && !state.imageOnly && <state.media />}\n <state.content />\n {state.progress && <state.progress />}\n <state.dismissIcon />\n </state.dismissButton>\n </state.root>\n );\n};\n"],"names":["id","designVersion","attachment","state","renderAttachment","assertSlots","progress","root","dismissButton","_jsx","dismissIcon","renderDismissOnly","children","_jsxs","media","content"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUUA;;;eAAAA;;;4BATV;iCAE0C;AAOxC,MAAQA,4BAAuBC,CAAAA;UAE/B,EAEAD,EAAA,mBACoBA,4BAIlBE,EAEF,GAAAC;IAEF,MAAMC,aAAAA,kBAAoBD,UAAAA,cAAAA,kBAAAA,SAAAA,iBAAAA;WACxBE,oBAA6BF,WAAAA,GAAAA,IAAAA,eAAAA,EAAAA,6BAAAA,EAAAA;QAE7BH,IAAAA;;;;yBAGOG,CAAAA;;sBAEAA,GAAAA,IAAAA,gBAAMG,EAAAA,MAAQC,IAAA,EAAA;;;;;;;;;+CAEjBJ,MAACA,aAAMK,EAAAA;qCACL,GAAAC,IAAAA,eAAA,EAAAN,MAAAO,WAAOA,EAAAA,CAAAA;;;;;AAIf,MAAAC,oBAAAR,CAAAA;IAEAE,IAAAA,4BAAMM,EAAAA;WACJN,WAA6BF,GAAAA,IAAAA,eAAAA,EAAAA,MAAAA,IAAAA,EAAAA;QAE7BS,UAAA,WACE,GAAAC,IAAAA,gBAACV,EAAAA,MAAMI,aAAI,EAAA;;sBACTO,KAAA,IAAA,CAAAX,MAACA,SAAMK,IAAAA,WAAa,GAAAC,IAAAA,eAAA,EAAAN,MAAAW,KAAA,EAAA,CAAA;gBAAA,WAAA,GAAAL,IAAAA,eAAA,EAAAN,MAAAY,OAAA,EAAA,CAAA;gBAAAZ,MAAAG,QAAA,IAAA,WAAA,GAAAG,IAAAA,eAAA,EAAAN,MAAAG,QAAA,EAAA,CAAA;gBAAA,WAAA,GAAAG,IAAAA,eAAA,EAAAN,MAAAO,WAAA,EAAA,CAAA;aAAA;;;+CAGH"}
|
|
@@ -15,7 +15,7 @@ const _reacticons = require("@fluentui/react-icons");
|
|
|
15
15
|
const _attachmentListContext = require("../../contexts/attachmentListContext");
|
|
16
16
|
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
17
17
|
const useAttachment_unstable = (props, ref)=>{
|
|
18
|
-
const { children, imageOnly, size = 'medium' } = props;
|
|
18
|
+
const { children, imageOnly, size = 'medium', dismissOnly = false } = props;
|
|
19
19
|
const { onAttachmentDismiss, shouldUseOverflow } = (0, _attachmentListContext.useAttachmentListContext_unstable)((context)=>context);
|
|
20
20
|
const attachmentId = (0, _reactcomponents.useId)('attachment-', props.id);
|
|
21
21
|
const isLoading = !!props.progress;
|
|
@@ -29,6 +29,9 @@ const useAttachment_unstable = (props, ref)=>{
|
|
|
29
29
|
elementType: 'div'
|
|
30
30
|
});
|
|
31
31
|
const primaryAction = _reactcomponents.slot.always(props.primaryAction, {
|
|
32
|
+
defaultProps: {
|
|
33
|
+
as: dismissOnly ? 'span' : undefined
|
|
34
|
+
},
|
|
32
35
|
elementType: 'button'
|
|
33
36
|
});
|
|
34
37
|
const dismissButton = _reactcomponents.slot.always(props.dismissButton, {
|
|
@@ -90,7 +93,8 @@ const useAttachment_unstable = (props, ref)=>{
|
|
|
90
93
|
isLoading,
|
|
91
94
|
shouldUseOverflow,
|
|
92
95
|
mode,
|
|
93
|
-
designVersion
|
|
96
|
+
designVersion,
|
|
97
|
+
dismissOnly
|
|
94
98
|
};
|
|
95
99
|
if (state.primaryAction.as === 'span') {
|
|
96
100
|
state.components.primaryAction = 'span';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss12Regular, Dismiss20Regular } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps, AttachmentState } from './Attachment.types';\nimport { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';\n\n/**\n * Create the state required to render Attachment.\n *\n * The returned state can be modified with hooks such as useAttachmentStyles_unstable,\n * before being passed to renderAttachment_unstable.\n *\n * @param props - props from this instance of Attachment\n * @param ref - reference to root HTMLElement of Attachment\n */\nexport const useAttachment_unstable = (props: AttachmentProps, ref: React.Ref<HTMLDivElement>): AttachmentState => {\n const { children, imageOnly, size = 'medium' } = props;\n const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable(context => context);\n const attachmentId = useId('attachment-', props.id);\n const isLoading = !!props.progress;\n\n const mode = useCopilotMode(props.mode);\n const designVersion = useDesignVersion(props.designVersion);\n\n const root = slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n id: attachmentId,\n }),\n { elementType: 'div' },\n );\n\n const primaryAction = slot.always(props.primaryAction, {\n elementType: 'button',\n });\n\n const dismissButton = slot.always(props.dismissButton, {\n defaultProps: { 'aria-label': 'Remove attachment' },\n elementType: 'button',\n });\n\n dismissButton.onClick = mergeCallbacks(\n dismissButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n (ev: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n onAttachmentDismiss?.(ev, { content: children, media, id: attachmentId });\n },\n );\n\n const media = slot.optional(props.media, { elementType: 'span' });\n\n const content = slot.always(props.content, {\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n });\n\n const dismissIcon = slot.always(props.dismissIcon, {\n defaultProps: {\n children: size === 'small' ? <Dismiss12Regular /> : <Dismiss20Regular />,\n },\n elementType: 'span',\n });\n\n const progress = slot.optional(props.progress, {\n defaultProps: {\n shape: 'square',\n thickness: 'large',\n 'aria-labelledby': props.id,\n },\n elementType: ProgressBar,\n });\n\n const state: AttachmentState = {\n id: attachmentId,\n size,\n components: {\n root: 'div',\n primaryAction: 'button',\n dismissButton: 'button',\n media: 'span',\n content: 'span',\n dismissIcon: 'span',\n progress: ProgressBar,\n },\n\n root,\n primaryAction,\n dismissButton,\n media,\n content,\n dismissIcon,\n progress,\n imageOnly,\n isLoading,\n shouldUseOverflow,\n mode,\n designVersion,\n };\n\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n\n return state;\n};\n"],"names":["children","size","ref","attachmentId","imageOnly","isLoading","mode","useCopilotMode","props","
|
|
1
|
+
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss12Regular, Dismiss20Regular } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps, AttachmentState } from './Attachment.types';\nimport { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';\n\n/**\n * Create the state required to render Attachment.\n *\n * The returned state can be modified with hooks such as useAttachmentStyles_unstable,\n * before being passed to renderAttachment_unstable.\n *\n * @param props - props from this instance of Attachment\n * @param ref - reference to root HTMLElement of Attachment\n */\nexport const useAttachment_unstable = (props: AttachmentProps, ref: React.Ref<HTMLDivElement>): AttachmentState => {\n const { children, imageOnly, size = 'medium', dismissOnly = false } = props;\n const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable(context => context);\n const attachmentId = useId('attachment-', props.id);\n const isLoading = !!props.progress;\n\n const mode = useCopilotMode(props.mode);\n const designVersion = useDesignVersion(props.designVersion);\n\n const root = slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n id: attachmentId,\n }),\n { elementType: 'div' },\n );\n\n const primaryAction = slot.always(props.primaryAction, {\n defaultProps: { as: dismissOnly ? 'span' : undefined },\n elementType: 'button',\n });\n\n const dismissButton = slot.always(props.dismissButton, {\n defaultProps: { 'aria-label': 'Remove attachment' },\n elementType: 'button',\n });\n\n dismissButton.onClick = mergeCallbacks(\n dismissButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n (ev: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n onAttachmentDismiss?.(ev, { content: children, media, id: attachmentId });\n },\n );\n\n const media = slot.optional(props.media, { elementType: 'span' });\n\n const content = slot.always(props.content, {\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n });\n\n const dismissIcon = slot.always(props.dismissIcon, {\n defaultProps: {\n children: size === 'small' ? <Dismiss12Regular /> : <Dismiss20Regular />,\n },\n elementType: 'span',\n });\n\n const progress = slot.optional(props.progress, {\n defaultProps: {\n shape: 'square',\n thickness: 'large',\n 'aria-labelledby': props.id,\n },\n elementType: ProgressBar,\n });\n\n const state: AttachmentState = {\n id: attachmentId,\n size,\n components: {\n root: 'div',\n primaryAction: 'button',\n dismissButton: 'button',\n media: 'span',\n content: 'span',\n dismissIcon: 'span',\n progress: ProgressBar,\n },\n\n root,\n primaryAction,\n dismissButton,\n media,\n content,\n dismissIcon,\n progress,\n imageOnly,\n isLoading,\n shouldUseOverflow,\n mode,\n designVersion,\n dismissOnly,\n };\n\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n\n return state;\n};\n"],"names":["children","size","ref","attachmentId","imageOnly","isLoading","mode","useCopilotMode","dismissOnly","designVersion","props","useAttachmentListContext_unstable","context","elementType","useId","id","progress","primaryAction","slot","always","defaultProps","useDesignVersion","as","undefined","dismissButton","onAttachmentDismiss","media","onClick","mergeCallbacks","ev","dismissIcon","content","thickness","React","createElement","Dismiss12Regular","Dismiss20Regular","components","root","shouldUseOverflow"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAiBUA;;;eAAAA;;;;iEAjBa;iCAC4D;4BAChC;uCACD;+BAED;AAY/C,MAAQA,yBAAqBC,CAAAA,OAAOC;UACpC,EACAF,QAAMG,EACNC,SAAMC,EAENJ,OAAMK,QAAOC,EACbC,cAAMC,KAAAA,KAENC;UAEIR,qBACQ,mBACJC,KACNQ,IAAAA,wDACA,EAAAC,CAAAA,UAAAA;UAAEC,eAAaC,IAAAA,sBAAA,EAAA,eAAAJ,MAAAK,EAAA;UAAMV,YAAA,CAAA,CAAAK,MAAAM,QAAA;UAGvBV,OAAMW,IAAAA,6BAAgBC,EAAAA,MAAKC,IAAOT;UAChCU,gBAAcC,IAAAA,+BAAA,EAAAX,MAAAD,aAAA;iBAAEa,qBAAId,CAAAA,MAAAA,CAAAA,IAAAA,yCAAuBe,EAAAA,OAAAA;;gBAC3CV;QACFE,IAAAZ;QAEA;qBACEiB;;UAAkDH,gBAAAC,qBAAA,CAAAC,MAAA,CAAAT,MAAAO,aAAA,EAAA;sBAClDJ;YACFS,IAAAd,cAAA,SAAAe;QAEAC;qBAGIC;;0BAA+CC,qBAAAA,CAAAA,MAAAA,CAAAA,MAAAA,aAAAA,EAAAA;sBAAWvB;0BAAa;QACzE;QAGFU,aAAMa;;kBAAyDC,OAAA,GAAAC,IAAAA,+BAAA,EAAAJ,cAAAG,OAAA,EAAAE,CAAAA;QAE/DJ,wBAAqBN,QAAOT,wBAAe,KAAA,IAAA,KAAA,IAAAe,oBAAAI,IAAA;qBACzCT;;gBAEAjB;;;UAIFuB,QAAMI,qBAAAA,CAAAA,QAAmBX,CAAAA,MAAOT,KAAAA,EAAMoB;qBACpCV;;UAEAW,UAAAb,qBAAA,CAAAC,MAAA,CAAAT,MAAAqB,OAAA,EAAA;sBACAlB;YACFb,UAAAU,MAAAV,QAAA;QAEA;qBACEoB;;wBAEEY,qBAAW,CAAAb,MAAA,CAAAT,MAAAoB,WAAA,EAAA;sBACX;sBACF7B,SAAA,UAAA,WAAA,GAAAgC,OAAAC,aAAA,CAAAC,4BAAA,EAAA,QAAA,WAAA,GAAAF,OAAAC,aAAA,CAAAE,4BAAA,EAAA;;QAEFvB,aAAA;;UAGEE,WAAIZ,qBAAAA,CAAAA,QAAAA,CAAAA,MAAAA,QAAAA,EAAAA;sBACJF;mBACAoC;uBACEC;+BACArB,MAAeF,EAAA;;qBAEfW,4BAAO;;kBAEPI;;;oBAIFQ;kBACArB;2BACAO;2BACAE;mBACAK;qBACAD;yBACAd;sBACAZ,4BAAAA;;;;;;QAMF2B;QAEAD;;QAEA1B;QAEAC;QACAkC"}
|