@fluentui-copilot/react-attachments 0.8.2 → 0.9.0
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 +63 -1
- package/CHANGELOG.md +28 -2
- package/dist/index.d.ts +220 -5
- package/lib/AttachmentList.js +2 -0
- package/lib/AttachmentList.js.map +1 -0
- package/lib/AttachmentOverflowMenu.js +2 -0
- package/lib/AttachmentOverflowMenu.js.map +1 -0
- package/lib/AttachmentOverflowMenuButton.js +2 -0
- package/lib/AttachmentOverflowMenuButton.js.map +1 -0
- package/lib/AttachmentOverflowMenuItem.js +2 -0
- package/lib/AttachmentOverflowMenuItem.js.map +1 -0
- package/lib/components/Attachment/Attachment.types.js.map +1 -1
- package/lib/components/Attachment/useAttachment.js +6 -8
- package/lib/components/Attachment/useAttachment.js.map +1 -1
- package/lib/components/Attachment/useAttachmentStyles.js +2 -2
- package/lib/components/Attachment/useAttachmentStyles.js.map +1 -1
- package/lib/components/AttachmentList/AttachmentList.js +13 -0
- package/lib/components/AttachmentList/AttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/AttachmentList.types.js +2 -0
- package/lib/components/AttachmentList/AttachmentList.types.js.map +1 -0
- package/lib/components/AttachmentList/index.js +6 -0
- package/lib/components/AttachmentList/index.js.map +1 -0
- package/lib/components/AttachmentList/renderAttachmentList.js +14 -0
- package/lib/components/AttachmentList/renderAttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentList.js +74 -0
- package/lib/components/AttachmentList/useAttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentListContextValues.js +13 -0
- package/lib/components/AttachmentList/useAttachmentListContextValues.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.js +14 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +15 -0
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +2 -0
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/index.js +6 -0
- package/lib/components/AttachmentOverflowMenu/index.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +18 -0
- package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +24 -0
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +17 -0
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +11 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +2 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/index.js +6 -0
- package/lib/components/AttachmentOverflowMenuButton/index.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +14 -0
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +32 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js +17 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +11 -0
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +2 -0
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/index.js +6 -0
- package/lib/components/AttachmentOverflowMenuItem/index.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +10 -0
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +41 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js +14 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js.map +1 -0
- package/lib/components/AttachmentTag/AttachmentTag.js +4 -1
- package/lib/components/AttachmentTag/AttachmentTag.js.map +1 -1
- package/lib/components/AttachmentTag/useAttachmentTag.js.map +1 -1
- package/lib/components/AttachmentTagItem/AttachmentTagItem.js +4 -0
- package/lib/components/AttachmentTagItem/AttachmentTagItem.js.map +1 -1
- package/lib/components/AttachmentTagItem/useAttachmentTagItem.js.map +1 -1
- package/lib/components/AttachmentTagList/AttachmentTagList.js +4 -1
- package/lib/components/AttachmentTagList/AttachmentTagList.js.map +1 -1
- package/lib/components/AttachmentTagList/useAttachmentTagList.js +2 -2
- package/lib/components/AttachmentTagList/useAttachmentTagList.js.map +1 -1
- package/lib/components/index.js +5 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/utils/useAttachmentTagSlots.js +2 -2
- package/lib/components/utils/useAttachmentTagSlots.js.map +1 -1
- package/lib/contexts/attachmentListContext.js +8 -0
- package/lib/contexts/attachmentListContext.js.map +1 -0
- package/lib/contexts/attachmentOverflowMenuContext.js +10 -0
- package/lib/contexts/attachmentOverflowMenuContext.js.map +1 -0
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/AttachmentList.js +7 -0
- package/lib-commonjs/AttachmentList.js.map +1 -0
- package/lib-commonjs/AttachmentOverflowMenu.js +7 -0
- package/lib-commonjs/AttachmentOverflowMenu.js.map +1 -0
- package/lib-commonjs/AttachmentOverflowMenuButton.js +7 -0
- package/lib-commonjs/AttachmentOverflowMenuButton.js.map +1 -0
- package/lib-commonjs/AttachmentOverflowMenuItem.js +7 -0
- package/lib-commonjs/AttachmentOverflowMenuItem.js.map +1 -0
- package/lib-commonjs/components/Attachment/useAttachment.js +5 -7
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachmentStyles.js +4 -4
- package/lib-commonjs/components/Attachment/useAttachmentStyles.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/AttachmentList.js +23 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js +5 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/index.js +11 -0
- package/lib-commonjs/components/AttachmentList/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +20 -0
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js +68 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js +20 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.js +30 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +24 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +5 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/index.js +11 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +21 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +21 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +22 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +21 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +5 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js +11 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +24 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +28 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js +37 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +21 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +5 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js +11 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +16 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +39 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js +28 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.js.map +1 -0
- package/lib-commonjs/components/AttachmentTag/AttachmentTag.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagItem/AttachmentTagItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagList/AttachmentTagList.js.map +1 -1
- package/lib-commonjs/components/AttachmentTagList/useAttachmentTagList.js +1 -1
- package/lib-commonjs/components/AttachmentTagList/useAttachmentTagList.js.map +1 -1
- package/lib-commonjs/components/index.js +5 -0
- package/lib-commonjs/components/index.js.map +1 -1
- package/lib-commonjs/components/utils/useAttachmentTagSlots.js +1 -1
- package/lib-commonjs/components/utils/useAttachmentTagSlots.js.map +1 -1
- package/lib-commonjs/contexts/attachmentListContext.js +28 -0
- package/lib-commonjs/contexts/attachmentListContext.js.map +1 -0
- package/lib-commonjs/contexts/attachmentOverflowMenuContext.js +30 -0
- package/lib-commonjs/contexts/attachmentOverflowMenuContext.js.map +1 -0
- package/lib-commonjs/index.js +78 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './AttachmentList';\nexport * from './AttachmentList.types';\nexport * from './renderAttachmentList';\nexport * from './useAttachmentList';\nexport * from './useAttachmentListStyles';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,4BAA4B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from '@fluentui/react-components';
|
|
3
|
+
import { AttachmentListProvider } from '../../contexts/attachmentListContext';
|
|
4
|
+
/**
|
|
5
|
+
* Render the final JSX of AttachmentList
|
|
6
|
+
*/
|
|
7
|
+
export const renderAttachmentList_unstable = (state, contextValues) => {
|
|
8
|
+
assertSlots(state);
|
|
9
|
+
return /*#__PURE__*/_jsx(AttachmentListProvider, {
|
|
10
|
+
value: contextValues.attachmentList,
|
|
11
|
+
children: /*#__PURE__*/_jsx(state.root, {})
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=renderAttachmentList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderAttachmentList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport { AttachmentListProvider } from '../../contexts/attachmentListContext';\nimport type { AttachmentListState, AttachmentListSlots, AttachmentListContextValues } from './AttachmentList.types';\n\n/**\n * Render the final JSX of AttachmentList\n */\nexport const renderAttachmentList_unstable = (\n state: AttachmentListState,\n contextValues: AttachmentListContextValues,\n) => {\n assertSlots<AttachmentListSlots>(state);\n\n return (\n <AttachmentListProvider value={contextValues.attachmentList}>\n <state.root />\n </AttachmentListProvider>\n );\n};\n"],"names":["assertSlots","AttachmentListProvider","renderAttachmentList_unstable","state","contextValues","value","attachmentList","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AACzD,SAASC,sBAAsB,QAAQ,uCAAuC;AAG9E;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEAJ,YAAiCG;IAEjC,qBACE,KAACF;QAAuBI,OAAOD,cAAcE,cAAc;kBACzD,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getIntrinsicElementProps, slot, useArrowNavigationGroup, useEventCallback, useFocusFinders, useMergedRefs } from '@fluentui/react-components';
|
|
3
|
+
import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
|
|
4
|
+
import { useOverflowContext } from '@fluentui/react-overflow';
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render AttachmentList.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useAttachmentListStyles_unstable,
|
|
9
|
+
* before being passed to renderAttachmentList_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of AttachmentList
|
|
12
|
+
* @param ref - reference to root HTMLElement of AttachmentList
|
|
13
|
+
*/
|
|
14
|
+
export const useAttachmentList_unstable = (props, ref) => {
|
|
15
|
+
const {
|
|
16
|
+
onAttachmentDismiss
|
|
17
|
+
} = props;
|
|
18
|
+
const attachmentsVisibilityStatus = useOverflowContext(context => context.itemVisibility);
|
|
19
|
+
const innerRef = React.useRef(null);
|
|
20
|
+
const {
|
|
21
|
+
targetDocument
|
|
22
|
+
} = useFluent();
|
|
23
|
+
const {
|
|
24
|
+
findNextFocusable,
|
|
25
|
+
findPrevFocusable
|
|
26
|
+
} = useFocusFinders();
|
|
27
|
+
const handleAttachmentDismiss = useEventCallback((e, data) => {
|
|
28
|
+
var _innerRef_current;
|
|
29
|
+
if (!onAttachmentDismiss) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
onAttachmentDismiss(e, data);
|
|
33
|
+
// Remove attachment from overflow context
|
|
34
|
+
attachmentsVisibilityStatus === null || attachmentsVisibilityStatus === void 0 ? true : delete attachmentsVisibilityStatus[data.id];
|
|
35
|
+
// set focus after attachment dismiss
|
|
36
|
+
const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
|
|
37
|
+
if ((_innerRef_current = innerRef.current) === null || _innerRef_current === void 0 ? void 0 : _innerRef_current.contains(activeElement)) {
|
|
38
|
+
// focus on next attachment only if the active element is within the current attachment list
|
|
39
|
+
const next = findNextFocusable(activeElement, {
|
|
40
|
+
container: innerRef.current
|
|
41
|
+
});
|
|
42
|
+
if (next) {
|
|
43
|
+
next.focus();
|
|
44
|
+
return;
|
|
45
|
+
} else {
|
|
46
|
+
const prev = findPrevFocusable(activeElement === null || activeElement === void 0 ? void 0 : activeElement.parentElement, {
|
|
47
|
+
container: innerRef.current
|
|
48
|
+
});
|
|
49
|
+
prev === null || prev === void 0 ? void 0 : prev.focus();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const arrowNavigationProps = useArrowNavigationGroup({
|
|
54
|
+
circular: true,
|
|
55
|
+
axis: 'both',
|
|
56
|
+
memorizeCurrent: true
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
onAttachmentDismiss: handleAttachmentDismiss,
|
|
60
|
+
components: {
|
|
61
|
+
root: 'div'
|
|
62
|
+
},
|
|
63
|
+
root: slot.always(getIntrinsicElementProps('div', {
|
|
64
|
+
'aria-label': 'Attachments',
|
|
65
|
+
ref: useMergedRefs(ref, innerRef),
|
|
66
|
+
role: 'toolbar',
|
|
67
|
+
...arrowNavigationProps,
|
|
68
|
+
...props
|
|
69
|
+
}), {
|
|
70
|
+
elementType: 'div'
|
|
71
|
+
})
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=useAttachmentList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n slot,\n useArrowNavigationGroup,\n useEventCallback,\n useFocusFinders,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useOverflowContext } from '@fluentui/react-overflow';\nimport type { AttachmentListProps, AttachmentListState } from './AttachmentList.types';\n\n/**\n * Create the state required to render AttachmentList.\n *\n * The returned state can be modified with hooks such as useAttachmentListStyles_unstable,\n * before being passed to renderAttachmentList_unstable.\n *\n * @param props - props from this instance of AttachmentList\n * @param ref - reference to root HTMLElement of AttachmentList\n */\nexport const useAttachmentList_unstable = (\n props: AttachmentListProps,\n ref: React.Ref<HTMLDivElement>,\n): AttachmentListState => {\n const { onAttachmentDismiss } = props;\n\n const attachmentsVisibilityStatus: Record<string, boolean> = useOverflowContext(context => context.itemVisibility);\n\n const innerRef = React.useRef<HTMLDivElement>(null);\n const { targetDocument } = useFluent();\n const { findNextFocusable, findPrevFocusable } = useFocusFinders();\n\n const handleAttachmentDismiss: AttachmentListState['onAttachmentDismiss'] = useEventCallback((e, data) => {\n if (!onAttachmentDismiss) {\n return;\n }\n\n onAttachmentDismiss(e, data);\n\n // Remove attachment from overflow context\n delete attachmentsVisibilityStatus?.[data.id];\n\n // set focus after attachment dismiss\n const activeElement = targetDocument?.activeElement;\n if (innerRef.current?.contains(activeElement as HTMLElement)) {\n // focus on next attachment only if the active element is within the current attachment list\n const next = findNextFocusable(activeElement as HTMLElement, { container: innerRef.current });\n\n if (next) {\n next.focus();\n return;\n } else {\n const prev = findPrevFocusable(activeElement?.parentElement as HTMLElement, { container: innerRef.current });\n prev?.focus();\n }\n }\n });\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: true,\n axis: 'both',\n memorizeCurrent: true,\n });\n\n return {\n onAttachmentDismiss: handleAttachmentDismiss,\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n 'aria-label': 'Attachments',\n ref: useMergedRefs(ref, innerRef),\n role: 'toolbar',\n ...arrowNavigationProps,\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useArrowNavigationGroup","useEventCallback","useFocusFinders","useMergedRefs","useFluent_unstable","useFluent","useOverflowContext","useAttachmentList_unstable","props","ref","onAttachmentDismiss","attachmentsVisibilityStatus","context","itemVisibility","innerRef","useRef","targetDocument","findNextFocusable","findPrevFocusable","handleAttachmentDismiss","e","data","id","activeElement","current","contains","next","container","focus","prev","parentElement","arrowNavigationProps","circular","axis","memorizeCurrent","components","root","always","role","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,wBAAwB,EACxBC,IAAI,EACJC,uBAAuB,EACvBC,gBAAgB,EAChBC,eAAe,EACfC,aAAa,QACR,6BAA6B;AACpC,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,kBAAkB,QAAQ,2BAA2B;AAG9D;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAM,EAAEC,mBAAmB,EAAE,GAAGF;IAEhC,MAAMG,8BAAuDL,mBAAmBM,CAAAA,UAAWA,QAAQC,cAAc;IAEjH,MAAMC,WAAWjB,MAAMkB,MAAM,CAAiB;IAC9C,MAAM,EAAEC,cAAc,EAAE,GAAGX;IAC3B,MAAM,EAAEY,iBAAiB,EAAEC,iBAAiB,EAAE,GAAGhB;IAEjD,MAAMiB,0BAAsElB,iBAAiB,CAACmB,GAAGC;YAY3FP;QAXJ,IAAI,CAACJ,qBAAqB;YACxB;QACF;QAEAA,oBAAoBU,GAAGC;QAEvB,0CAA0C;QACnCV,wCAAAA,uDAAAA,2BAA6B,CAACU,KAAKC,EAAE,CAAC;QAE7C,qCAAqC;QACrC,MAAMC,gBAAgBP,2BAAAA,qCAAAA,eAAgBO,aAAa;QACnD,KAAIT,oBAAAA,SAASU,OAAO,cAAhBV,wCAAAA,kBAAkBW,QAAQ,CAACF,gBAA+B;YAC5D,4FAA4F;YAC5F,MAAMG,OAAOT,kBAAkBM,eAA8B;gBAAEI,WAAWb,SAASU,OAAO;YAAC;YAE3F,IAAIE,MAAM;gBACRA,KAAKE,KAAK;gBACV;YACF,OAAO;gBACL,MAAMC,OAAOX,kBAAkBK,0BAAAA,oCAAAA,cAAeO,aAAa,EAAiB;oBAAEH,WAAWb,SAASU,OAAO;gBAAC;gBAC1GK,iBAAAA,2BAAAA,KAAMD,KAAK;YACb;QACF;IACF;IAEA,MAAMG,uBAAuB/B,wBAAwB;QACnDgC,UAAU;QACVC,MAAM;QACNC,iBAAiB;IACnB;IAEA,OAAO;QACLxB,qBAAqBS;QACrBgB,YAAY;YACVC,MAAM;QACR;QACAA,MAAMrC,KAAKsC,MAAM,CACfvC,yBAAyB,OAAO;YAC9B,cAAc;YACdW,KAAKN,cAAcM,KAAKK;YACxBwB,MAAM;YACN,GAAGP,oBAAoB;YACvB,GAAGvB,KAAK;QACV,IACA;YAAE+B,aAAa;QAAM;IAEzB;AACF,EAAE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function useAttachmentListContextValues_unstable(state) {
|
|
2
|
+
const {
|
|
3
|
+
onAttachmentDismiss
|
|
4
|
+
} = state;
|
|
5
|
+
// This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
|
|
6
|
+
const attachmentList = {
|
|
7
|
+
onAttachmentDismiss
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
attachmentList
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=useAttachmentListContextValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentListContextValues.ts"],"sourcesContent":["import type { AttachmentListContextValues, AttachmentListState } from './AttachmentList.types';\n\nexport function useAttachmentListContextValues_unstable(state: AttachmentListState): AttachmentListContextValues {\n const { onAttachmentDismiss } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", there is no sense to memoize it\n const attachmentList = {\n onAttachmentDismiss,\n };\n\n return { attachmentList };\n}\n"],"names":["useAttachmentListContextValues_unstable","state","onAttachmentDismiss","attachmentList"],"mappings":"AAEA,OAAO,SAASA,wCAAwCC,KAA0B;IAChF,MAAM,EAAEC,mBAAmB,EAAE,GAAGD;IAEhC,mGAAmG;IACnG,MAAME,iBAAiB;QACrBD;IACF;IAEA,OAAO;QAAEC;IAAe;AAC1B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __resetStyles, mergeClasses, tokens } from '@fluentui/react-components';
|
|
2
|
+
export const attachmentListClassNames = {
|
|
3
|
+
root: 'fai-AttachmentList'
|
|
4
|
+
};
|
|
5
|
+
const useRootBaseClassName = __resetStyles("r168fwfa", null, [".r168fwfa{column-gap:var(--spacingHorizontalSNudge);display:flex;flex-direction:row;flex-shrink:0;flex-wrap:wrap;row-gap:var(--spacingVerticalXS);}"]);
|
|
6
|
+
/**
|
|
7
|
+
* Apply styling to the AttachmentList slots based on the state
|
|
8
|
+
*/
|
|
9
|
+
export const useAttachmentListStyles_unstable = state => {
|
|
10
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
11
|
+
state.root.className = mergeClasses(attachmentListClassNames.root, rootBaseClassName, state.root.className);
|
|
12
|
+
return state;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useAttachmentListStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentListStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens } from '@fluentui/react-components';\nimport type { AttachmentListSlots, AttachmentListState } from './AttachmentList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentListClassNames: SlotClassNames<AttachmentListSlots> = {\n root: 'fai-AttachmentList',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n columnGap: tokens.spacingHorizontalSNudge,\n display: 'flex',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'wrap',\n rowGap: tokens.spacingVerticalXS,\n});\n\n/**\n * Apply styling to the AttachmentList slots based on the state\n */\nexport const useAttachmentListStyles_unstable = (state: AttachmentListState): AttachmentListState => {\n const rootBaseClassName = useRootBaseClassName();\n\n state.root.className = mergeClasses(attachmentListClassNames.root, rootBaseClassName, state.root.className);\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","tokens","attachmentListClassNames","root","useRootBaseClassName","columnGap","spacingHorizontalSNudge","display","flexDirection","flexShrink","flexWrap","rowGap","spacingVerticalXS","useAttachmentListStyles_unstable","state","rootBaseClassName","className"],"mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,MAAM,QAAQ,6BAA6B;AAInF,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF,MAAMC,uBAAuBL,gBAAgB;IAC3CM,WAAWJ,OAAOK,uBAAuB;IACzCC,SAAS;IACTC,eAAe;IACfC,YAAY;IACZC,UAAU;IACVC,QAAQV,OAAOW,iBAAiB;AAClC;AAEA;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C,MAAMC,oBAAoBX;IAE1BU,MAAMX,IAAI,CAACa,SAAS,GAAGhB,aAAaE,yBAAyBC,IAAI,EAAEY,mBAAmBD,MAAMX,IAAI,CAACa,SAAS;IAE1G,OAAOF;AACT,EAAE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useAttachmentOverflowMenu_unstable } from './useAttachmentOverflowMenu';
|
|
2
|
+
import { renderAttachmentOverflowMenu_unstable } from './renderAttachmentOverflowMenu';
|
|
3
|
+
import { useAttachmentOverflowMenuContextValues_unstable } from './useAttachmentOverflowMenuContextValues';
|
|
4
|
+
import { useMenuContextValues_unstable } from '@fluentui/react-components';
|
|
5
|
+
export const AttachmentOverflowMenu = props => {
|
|
6
|
+
const state = useAttachmentOverflowMenu_unstable(props);
|
|
7
|
+
const menuContextValues = useMenuContextValues_unstable(state);
|
|
8
|
+
const attachmentOverflowMenuContextValues = useAttachmentOverflowMenuContextValues_unstable(state);
|
|
9
|
+
return renderAttachmentOverflowMenu_unstable(state, {
|
|
10
|
+
menuContextValues,
|
|
11
|
+
attachmentOverflowMenuContextValues
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
AttachmentOverflowMenu.displayName = 'AttachmentOverflowMenu';
|
|
15
|
+
//# sourceMappingURL=AttachmentOverflowMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenu.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { useAttachmentOverflowMenu_unstable } from './useAttachmentOverflowMenu';\nimport { renderAttachmentOverflowMenu_unstable } from './renderAttachmentOverflowMenu';\nimport { useAttachmentOverflowMenuContextValues_unstable } from './useAttachmentOverflowMenuContextValues';\nimport { useMenuContextValues_unstable } from '@fluentui/react-components';\nimport type { AttachmentOverflowMenuProps } from './AttachmentOverflowMenu.types';\n\nexport const AttachmentOverflowMenu: React.FC<AttachmentOverflowMenuProps> = props => {\n const state = useAttachmentOverflowMenu_unstable(props);\n const menuContextValues = useMenuContextValues_unstable(state);\n const attachmentOverflowMenuContextValues = useAttachmentOverflowMenuContextValues_unstable(state);\n\n return renderAttachmentOverflowMenu_unstable(state, { menuContextValues, attachmentOverflowMenuContextValues });\n};\n\nAttachmentOverflowMenu.displayName = 'AttachmentOverflowMenu';\n"],"names":["useAttachmentOverflowMenu_unstable","renderAttachmentOverflowMenu_unstable","useAttachmentOverflowMenuContextValues_unstable","useMenuContextValues_unstable","AttachmentOverflowMenu","props","state","menuContextValues","attachmentOverflowMenuContextValues","displayName"],"mappings":"AACA,SAASA,kCAAkC,QAAQ,8BAA8B;AACjF,SAASC,qCAAqC,QAAQ,iCAAiC;AACvF,SAASC,+CAA+C,QAAQ,2CAA2C;AAC3G,SAASC,6BAA6B,QAAQ,6BAA6B;AAG3E,OAAO,MAAMC,yBAAgEC,CAAAA;IAC3E,MAAMC,QAAQN,mCAAmCK;IACjD,MAAME,oBAAoBJ,8BAA8BG;IACxD,MAAME,sCAAsCN,gDAAgDI;IAE5F,OAAOL,sCAAsCK,OAAO;QAAEC;QAAmBC;IAAoC;AAC/G,EAAE;AAEFJ,uBAAuBK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenu.types.ts"],"sourcesContent":["import type { MenuProps, MenuSlots, MenuState } from '@fluentui/react-components';\nimport type { AttachmentOverflowMenuContextValue } from '../../contexts/attachmentOverflowMenuContext';\n\nexport type AttachmentOverflowMenuSlots = MenuSlots;\n\n/**\n * AttachmentOverflowMenu Props\n */\nexport type AttachmentOverflowMenuProps = MenuProps;\n\n/**\n * State used in rendering AttachmentOverflowMenu\n */\nexport type AttachmentOverflowMenuState = MenuState & {\n isOverflowing: boolean;\n overflowButtonRef?: React.RefObject<HTMLButtonElement>;\n overflowCount: number;\n};\n\nexport type AttachmentOverflowMenuContextValues = {\n attachmentOverflowMenu: AttachmentOverflowMenuContextValue;\n};\n"],"names":[],"mappings":"AAAA,WAqBE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './AttachmentOverflowMenu';
|
|
2
|
+
export * from './AttachmentOverflowMenu.types';
|
|
3
|
+
export * from './renderAttachmentOverflowMenu';
|
|
4
|
+
export * from './useAttachmentOverflowMenu';
|
|
5
|
+
export * from './useAttachmentOverflowMenuContextValues';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './AttachmentOverflowMenu';\nexport * from './AttachmentOverflowMenu.types';\nexport * from './renderAttachmentOverflowMenu';\nexport * from './useAttachmentOverflowMenu';\nexport * from './useAttachmentOverflowMenuContextValues';\n"],"names":[],"mappings":"AAAA,cAAc,2BAA2B;AACzC,cAAc,iCAAiC;AAC/C,cAAc,iCAAiC;AAC/C,cAAc,8BAA8B;AAC5C,cAAc,2CAA2C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots, renderMenu_unstable } from '@fluentui/react-components';
|
|
3
|
+
import { AttachmentOverflowMenuProvider } from '../../contexts/attachmentOverflowMenuContext';
|
|
4
|
+
/**
|
|
5
|
+
* Render the final JSX of AttachmentOverflowMenu
|
|
6
|
+
*/
|
|
7
|
+
export const renderAttachmentOverflowMenu_unstable = (state, contextValues) => {
|
|
8
|
+
const {
|
|
9
|
+
menuContextValues,
|
|
10
|
+
attachmentOverflowMenuContextValues
|
|
11
|
+
} = contextValues;
|
|
12
|
+
assertSlots(state);
|
|
13
|
+
return state.isOverflowing ? /*#__PURE__*/_jsx(AttachmentOverflowMenuProvider, {
|
|
14
|
+
value: attachmentOverflowMenuContextValues.attachmentOverflowMenu,
|
|
15
|
+
children: renderMenu_unstable(state, menuContextValues)
|
|
16
|
+
}) : null;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=renderAttachmentOverflowMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderAttachmentOverflowMenu.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots, renderMenu_unstable } from '@fluentui/react-components';\nimport { AttachmentOverflowMenuProvider } from '../../contexts/attachmentOverflowMenuContext';\nimport type {\n AttachmentOverflowMenuState,\n AttachmentOverflowMenuSlots,\n AttachmentOverflowMenuContextValues,\n} from './AttachmentOverflowMenu.types';\nimport type { MenuContextValues } from '@fluentui/react-components';\n\n/**\n * Render the final JSX of AttachmentOverflowMenu\n */\nexport const renderAttachmentOverflowMenu_unstable = (\n state: AttachmentOverflowMenuState,\n contextValues: {\n menuContextValues: MenuContextValues;\n attachmentOverflowMenuContextValues: AttachmentOverflowMenuContextValues;\n },\n) => {\n const { menuContextValues, attachmentOverflowMenuContextValues } = contextValues;\n assertSlots<AttachmentOverflowMenuSlots>(state);\n\n return state.isOverflowing ? (\n <AttachmentOverflowMenuProvider value={attachmentOverflowMenuContextValues.attachmentOverflowMenu}>\n {renderMenu_unstable(state, menuContextValues)}\n </AttachmentOverflowMenuProvider>\n ) : null;\n};\n"],"names":["assertSlots","renderMenu_unstable","AttachmentOverflowMenuProvider","renderAttachmentOverflowMenu_unstable","state","contextValues","menuContextValues","attachmentOverflowMenuContextValues","isOverflowing","value","attachmentOverflowMenu"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,EAAEC,mBAAmB,QAAQ,6BAA6B;AAC9E,SAASC,8BAA8B,QAAQ,+CAA+C;AAQ9F;;CAEC,GACD,OAAO,MAAMC,wCAAwC,CACnDC,OACAC;IAKA,MAAM,EAAEC,iBAAiB,EAAEC,mCAAmC,EAAE,GAAGF;IACnEL,YAAyCI;IAEzC,OAAOA,MAAMI,aAAa,iBACxB,KAACN;QAA+BO,OAAOF,oCAAoCG,sBAAsB;kBAC9FT,oBAAoBG,OAAOE;SAE5B;AACN,EAAE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useMenu_unstable, useOverflowMenu } from '@fluentui/react-components';
|
|
2
|
+
/**
|
|
3
|
+
* Create the state required to render AttachmentOverflowMenu.
|
|
4
|
+
*
|
|
5
|
+
* The returned state can be modified with hooks such as useAttachmentOverflowMenuStyles_unstable,
|
|
6
|
+
* before being passed to renderAttachmentOverflowMenu_unstable.
|
|
7
|
+
*
|
|
8
|
+
* @param props - props from this instance of AttachmentOverflowMenu
|
|
9
|
+
*/
|
|
10
|
+
export const useAttachmentOverflowMenu_unstable = props => {
|
|
11
|
+
const menuState = useMenu_unstable(props);
|
|
12
|
+
const {
|
|
13
|
+
isOverflowing,
|
|
14
|
+
ref: overflowButtonRef,
|
|
15
|
+
overflowCount
|
|
16
|
+
} = useOverflowMenu();
|
|
17
|
+
return {
|
|
18
|
+
...menuState,
|
|
19
|
+
isOverflowing,
|
|
20
|
+
overflowButtonRef,
|
|
21
|
+
overflowCount
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=useAttachmentOverflowMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenu.ts"],"sourcesContent":["import { useMenu_unstable, useOverflowMenu } from '@fluentui/react-components';\nimport type { AttachmentOverflowMenuProps, AttachmentOverflowMenuState } from './AttachmentOverflowMenu.types';\n\n/**\n * Create the state required to render AttachmentOverflowMenu.\n *\n * The returned state can be modified with hooks such as useAttachmentOverflowMenuStyles_unstable,\n * before being passed to renderAttachmentOverflowMenu_unstable.\n *\n * @param props - props from this instance of AttachmentOverflowMenu\n */\nexport const useAttachmentOverflowMenu_unstable = (props: AttachmentOverflowMenuProps): AttachmentOverflowMenuState => {\n const menuState = useMenu_unstable(props);\n const { isOverflowing, ref: overflowButtonRef, overflowCount } = useOverflowMenu<HTMLButtonElement>();\n\n return {\n ...menuState,\n isOverflowing,\n overflowButtonRef,\n overflowCount,\n };\n};\n"],"names":["useMenu_unstable","useOverflowMenu","useAttachmentOverflowMenu_unstable","props","menuState","isOverflowing","ref","overflowButtonRef","overflowCount"],"mappings":"AAAA,SAASA,gBAAgB,EAAEC,eAAe,QAAQ,6BAA6B;AAG/E;;;;;;;CAOC,GACD,OAAO,MAAMC,qCAAqC,CAACC;IACjD,MAAMC,YAAYJ,iBAAiBG;IACnC,MAAM,EAAEE,aAAa,EAAEC,KAAKC,iBAAiB,EAAEC,aAAa,EAAE,GAAGP;IAEjE,OAAO;QACL,GAAGG,SAAS;QACZC;QACAE;QACAC;IACF;AACF,EAAE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function useAttachmentOverflowMenuContextValues_unstable(state) {
|
|
2
|
+
const {
|
|
3
|
+
isOverflowing,
|
|
4
|
+
overflowButtonRef,
|
|
5
|
+
overflowCount
|
|
6
|
+
} = state;
|
|
7
|
+
// This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
|
|
8
|
+
const attachmentOverflowMenu = {
|
|
9
|
+
isOverflowing,
|
|
10
|
+
overflowButtonRef,
|
|
11
|
+
overflowCount
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
attachmentOverflowMenu
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=useAttachmentOverflowMenuContextValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuContextValues.ts"],"sourcesContent":["import type { AttachmentOverflowMenuContextValues, AttachmentOverflowMenuState } from './AttachmentOverflowMenu.types';\n\nexport function useAttachmentOverflowMenuContextValues_unstable(\n state: AttachmentOverflowMenuState,\n): AttachmentOverflowMenuContextValues {\n const { isOverflowing, overflowButtonRef, overflowCount } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", there is no sense to memoize it\n const attachmentOverflowMenu = {\n isOverflowing,\n overflowButtonRef,\n overflowCount,\n };\n\n return { attachmentOverflowMenu };\n}\n"],"names":["useAttachmentOverflowMenuContextValues_unstable","state","isOverflowing","overflowButtonRef","overflowCount","attachmentOverflowMenu"],"mappings":"AAEA,OAAO,SAASA,gDACdC,KAAkC;IAElC,MAAM,EAAEC,aAAa,EAAEC,iBAAiB,EAAEC,aAAa,EAAE,GAAGH;IAE5D,mGAAmG;IACnG,MAAMI,yBAAyB;QAC7BH;QACAC;QACAC;IACF;IAEA,OAAO;QAAEC;IAAuB;AAClC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useAttachmentOverflowMenuButton_unstable } from './useAttachmentOverflowMenuButton';
|
|
3
|
+
import { renderAttachmentOverflowMenuButton_unstable } from './renderAttachmentOverflowMenuButton';
|
|
4
|
+
import { useAttachmentOverflowMenuButtonStyles_unstable } from './useAttachmentOverflowMenuButtonStyles';
|
|
5
|
+
export const AttachmentOverflowMenuButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
6
|
+
const state = useAttachmentOverflowMenuButton_unstable(props, ref);
|
|
7
|
+
useAttachmentOverflowMenuButtonStyles_unstable(state);
|
|
8
|
+
return renderAttachmentOverflowMenuButton_unstable(state);
|
|
9
|
+
});
|
|
10
|
+
AttachmentOverflowMenuButton.displayName = 'AttachmentOverflowMenuButton';
|
|
11
|
+
//# sourceMappingURL=AttachmentOverflowMenuButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenuButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentOverflowMenuButton_unstable } from './useAttachmentOverflowMenuButton';\nimport { renderAttachmentOverflowMenuButton_unstable } from './renderAttachmentOverflowMenuButton';\nimport { useAttachmentOverflowMenuButtonStyles_unstable } from './useAttachmentOverflowMenuButtonStyles';\nimport type { AttachmentOverflowMenuButtonProps } from './AttachmentOverflowMenuButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const AttachmentOverflowMenuButton: ForwardRefComponent<AttachmentOverflowMenuButtonProps> = React.forwardRef(\n (props, ref) => {\n const state = useAttachmentOverflowMenuButton_unstable(props, ref);\n\n useAttachmentOverflowMenuButtonStyles_unstable(state);\n return renderAttachmentOverflowMenuButton_unstable(state);\n },\n);\n\nAttachmentOverflowMenuButton.displayName = 'AttachmentOverflowMenuButton';\n"],"names":["React","useAttachmentOverflowMenuButton_unstable","renderAttachmentOverflowMenuButton_unstable","useAttachmentOverflowMenuButtonStyles_unstable","AttachmentOverflowMenuButton","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wCAAwC,QAAQ,oCAAoC;AAC7F,SAASC,2CAA2C,QAAQ,uCAAuC;AACnG,SAASC,8CAA8C,QAAQ,0CAA0C;AAIzG,OAAO,MAAMC,6CAAuFJ,MAAMK,UAAU,CAClH,CAACC,OAAOC;IACN,MAAMC,QAAQP,yCAAyCK,OAAOC;IAE9DJ,+CAA+CK;IAC/C,OAAON,4CAA4CM;AACrD,GACA;AAEFJ,6BAA6BK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenuButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { AttachmentOverflowMenuState } from '../AttachmentOverflowMenu';\n\nexport type AttachmentOverflowMenuButtonSlots = {\n root: NonNullable<Slot<'button'>>;\n};\n\n/**\n * AttachmentOverflowMenuButton Props\n */\nexport type AttachmentOverflowMenuButtonProps = ComponentProps<Partial<AttachmentOverflowMenuButtonSlots>>;\n\n/**\n * State used in rendering AttachmentOverflowMenuButton\n */\nexport type AttachmentOverflowMenuButtonState = ComponentState<AttachmentOverflowMenuButtonSlots> &\n Pick<AttachmentOverflowMenuState, 'isOverflowing' | 'overflowCount'>;\n"],"names":[],"mappings":"AAAA,WAgBuE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './AttachmentOverflowMenuButton';
|
|
2
|
+
export * from './AttachmentOverflowMenuButton.types';
|
|
3
|
+
export * from './renderAttachmentOverflowMenuButton';
|
|
4
|
+
export * from './useAttachmentOverflowMenuButton';
|
|
5
|
+
export * from './useAttachmentOverflowMenuButtonStyles';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './AttachmentOverflowMenuButton';\nexport * from './AttachmentOverflowMenuButton.types';\nexport * from './renderAttachmentOverflowMenuButton';\nexport * from './useAttachmentOverflowMenuButton';\nexport * from './useAttachmentOverflowMenuButtonStyles';\n"],"names":[],"mappings":"AAAA,cAAc,iCAAiC;AAC/C,cAAc,uCAAuC;AACrD,cAAc,uCAAuC;AACrD,cAAc,oCAAoC;AAClD,cAAc,0CAA0C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { MenuTrigger, assertSlots } from '@fluentui/react-components';
|
|
3
|
+
/**
|
|
4
|
+
* Render the final JSX of AttachmentOverflowMenuButton
|
|
5
|
+
*/
|
|
6
|
+
export const renderAttachmentOverflowMenuButton_unstable = state => {
|
|
7
|
+
assertSlots(state);
|
|
8
|
+
return state.isOverflowing ? /*#__PURE__*/_jsx(MenuTrigger, {
|
|
9
|
+
children: /*#__PURE__*/_jsxs(state.root, {
|
|
10
|
+
children: [" +", state.overflowCount, " "]
|
|
11
|
+
})
|
|
12
|
+
}) : null;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=renderAttachmentOverflowMenuButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderAttachmentOverflowMenuButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { MenuTrigger, assertSlots } from '@fluentui/react-components';\nimport type {\n AttachmentOverflowMenuButtonState,\n AttachmentOverflowMenuButtonSlots,\n} from './AttachmentOverflowMenuButton.types';\n\n/**\n * Render the final JSX of AttachmentOverflowMenuButton\n */\nexport const renderAttachmentOverflowMenuButton_unstable = (state: AttachmentOverflowMenuButtonState) => {\n assertSlots<AttachmentOverflowMenuButtonSlots>(state);\n\n return state.isOverflowing ? (\n <MenuTrigger>\n <state.root> +{state.overflowCount} </state.root>\n </MenuTrigger>\n ) : null;\n};\n"],"names":["MenuTrigger","assertSlots","renderAttachmentOverflowMenuButton_unstable","state","isOverflowing","root","overflowCount"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,EAAEC,WAAW,QAAQ,6BAA6B;AAMtE;;CAEC,GACD,OAAO,MAAMC,8CAA8C,CAACC;IAC1DF,YAA+CE;IAE/C,OAAOA,MAAMC,aAAa,iBACxB,KAACJ;kBACC,cAAA,MAACG,MAAME,IAAI;;gBAAC;gBAAGF,MAAMG,aAAa;gBAAC;;;SAEnC;AACN,EAAE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getIntrinsicElementProps, slot, useMergedRefs } from '@fluentui/react-components';
|
|
2
|
+
import { useAttachmentOverflowMenuContext_unstable } from '../../contexts/attachmentOverflowMenuContext';
|
|
3
|
+
/**
|
|
4
|
+
* Create the state required to render AttachmentOverflowMenuButton.
|
|
5
|
+
*
|
|
6
|
+
* The returned state can be modified with hooks such as useAttachmentOverflowMenuButtonStyles_unstable,
|
|
7
|
+
* before being passed to renderAttachmentOverflowMenuButton_unstable.
|
|
8
|
+
*
|
|
9
|
+
* @param props - props from this instance of AttachmentOverflowMenuButton
|
|
10
|
+
* @param ref - reference to root HTMLElement of AttachmentOverflowMenuButton
|
|
11
|
+
*/
|
|
12
|
+
export const useAttachmentOverflowMenuButton_unstable = (props, ref) => {
|
|
13
|
+
const {
|
|
14
|
+
isOverflowing,
|
|
15
|
+
overflowCount,
|
|
16
|
+
overflowButtonRef
|
|
17
|
+
} = useAttachmentOverflowMenuContext_unstable(context => context);
|
|
18
|
+
return {
|
|
19
|
+
components: {
|
|
20
|
+
root: 'button'
|
|
21
|
+
},
|
|
22
|
+
root: slot.always(getIntrinsicElementProps('button', {
|
|
23
|
+
ref: useMergedRefs(ref, overflowButtonRef),
|
|
24
|
+
...props
|
|
25
|
+
}), {
|
|
26
|
+
elementType: 'button'
|
|
27
|
+
}),
|
|
28
|
+
isOverflowing,
|
|
29
|
+
overflowCount
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=useAttachmentOverflowMenuButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuButton.ts"],"sourcesContent":["import { getIntrinsicElementProps, slot, useMergedRefs } from '@fluentui/react-components';\nimport { useAttachmentOverflowMenuContext_unstable } from '../../contexts/attachmentOverflowMenuContext';\nimport type {\n AttachmentOverflowMenuButtonProps,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton.types';\n\n/**\n * Create the state required to render AttachmentOverflowMenuButton.\n *\n * The returned state can be modified with hooks such as useAttachmentOverflowMenuButtonStyles_unstable,\n * before being passed to renderAttachmentOverflowMenuButton_unstable.\n *\n * @param props - props from this instance of AttachmentOverflowMenuButton\n * @param ref - reference to root HTMLElement of AttachmentOverflowMenuButton\n */\nexport const useAttachmentOverflowMenuButton_unstable = (\n props: AttachmentOverflowMenuButtonProps,\n ref: React.Ref<HTMLButtonElement>,\n): AttachmentOverflowMenuButtonState => {\n const { isOverflowing, overflowCount, overflowButtonRef } = useAttachmentOverflowMenuContext_unstable(\n context => context,\n );\n\n return {\n components: {\n root: 'button',\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref: useMergedRefs(ref, overflowButtonRef),\n ...props,\n }),\n { elementType: 'button' },\n ),\n isOverflowing,\n overflowCount,\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useMergedRefs","useAttachmentOverflowMenuContext_unstable","useAttachmentOverflowMenuButton_unstable","props","ref","isOverflowing","overflowCount","overflowButtonRef","context","components","root","always","elementType"],"mappings":"AAAA,SAASA,wBAAwB,EAAEC,IAAI,EAAEC,aAAa,QAAQ,6BAA6B;AAC3F,SAASC,yCAAyC,QAAQ,+CAA+C;AAMzG;;;;;;;;CAQC,GACD,OAAO,MAAMC,2CAA2C,CACtDC,OACAC;IAEA,MAAM,EAAEC,aAAa,EAAEC,aAAa,EAAEC,iBAAiB,EAAE,GAAGN,0CAC1DO,CAAAA,UAAWA;IAGb,OAAO;QACLC,YAAY;YACVC,MAAM;QACR;QACAA,MAAMX,KAAKY,MAAM,CACfb,yBAAyB,UAAU;YACjCM,KAAKJ,cAAcI,KAAKG;YACxB,GAAGJ,KAAK;QACV,IACA;YAAES,aAAa;QAAS;QAE1BP;QACAC;IACF;AACF,EAAE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __resetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';
|
|
2
|
+
export const attachmentOverflowMenuButtonClassNames = {
|
|
3
|
+
root: 'fai-AttachmentOverflowMenuButton'
|
|
4
|
+
};
|
|
5
|
+
const useRootBaseClassName = __resetStyles("r1hzuvbo", null, {
|
|
6
|
+
r: [".r1hzuvbo{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;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);justify-content:center;padding:var(--spacingVerticalS);vertical-align:middle;}", ".r1hzuvbo:hover{cursor:pointer;background-color:var(--colorNeutralBackground3Hover);color:var(--colorNeutralForeground2Hover);}", ".r1hzuvbo:active{background-color:var(--colorNeutralBackground3Pressed);color:var(--colorNeutralForeground2Pressed);}"],
|
|
7
|
+
s: ["@media (forced-colors: active){.r1hzuvbo:hover{background-color:HighlightText;}.r1hzuvbo:active{background-color:HighlightText;}}"]
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* Apply styling to the AttachmentOverflowMenuButton slots based on the state
|
|
11
|
+
*/
|
|
12
|
+
export const useAttachmentOverflowMenuButtonStyles_unstable = state => {
|
|
13
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
14
|
+
state.root.className = mergeClasses(attachmentOverflowMenuButtonClassNames.root, rootBaseClassName, state.root.className);
|
|
15
|
+
return state;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useAttachmentOverflowMenuButtonStyles.js.map
|
package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuButtonStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nimport type {\n AttachmentOverflowMenuButtonSlots,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentOverflowMenuButtonClassNames: SlotClassNames<AttachmentOverflowMenuButtonSlots> = {\n root: 'fai-AttachmentOverflowMenuButton',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\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 cursor: 'pointer',\n display: 'inline-flex',\n flexWrap: 'nowrap',\n fontFamily: typographyStyles.body1.fontFamily,\n fontSize: typographyStyles.body1.fontSize,\n fontWeight: typographyStyles.body1.fontWeight,\n justifyContent: 'center',\n padding: tokens.spacingVerticalS,\n verticalAlign: 'middle',\n\n ':hover': {\n cursor: 'pointer',\n backgroundColor: tokens.colorNeutralBackground3Hover,\n color: tokens.colorNeutralForeground2Hover,\n },\n ':active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n color: tokens.colorNeutralForeground2Pressed,\n },\n '@media (forced-colors: active)': {\n ':hover': {\n backgroundColor: 'HighlightText',\n },\n ':active': {\n backgroundColor: 'HighlightText',\n },\n },\n});\n/**\n * Apply styling to the AttachmentOverflowMenuButton slots based on the state\n */\nexport const useAttachmentOverflowMenuButtonStyles_unstable = (\n state: AttachmentOverflowMenuButtonState,\n): AttachmentOverflowMenuButtonState => {\n const rootBaseClassName = useRootBaseClassName();\n\n state.root.className = mergeClasses(\n attachmentOverflowMenuButtonClassNames.root,\n rootBaseClassName,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","tokens","typographyStyles","attachmentOverflowMenuButtonClassNames","root","useRootBaseClassName","color","colorNeutralForeground1","alignItems","backgroundColor","colorNeutralBackground1","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","boxSizing","columnGap","spacingHorizontalSNudge","cursor","display","flexWrap","fontFamily","body1","fontSize","fontWeight","justifyContent","padding","spacingVerticalS","verticalAlign","colorNeutralBackground3Hover","colorNeutralForeground2Hover","colorNeutralBackground3Pressed","colorNeutralForeground2Pressed","useAttachmentOverflowMenuButtonStyles_unstable","state","rootBaseClassName","className"],"mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAOrG,OAAO,MAAMC,yCAA4F;IACvGC,MAAM;AACR,EAAE;AAEF,MAAMC,uBAAuBN,gBAAgB;IAC3CO,OAAOL,OAAOM,uBAAuB;IACrCC,YAAY;IACZC,iBAAiBR,OAAOS,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEV,OAAOW,eAAe,CAAC,OAAO,EAAEX,OAAOY,mBAAmB,CAAC,CAAC;IACvEC,cAAcb,OAAOc,kBAAkB;IACvCC,WAAW;IACXC,WAAWhB,OAAOiB,uBAAuB;IACzCC,QAAQ;IACRC,SAAS;IACTC,UAAU;IACVC,YAAYpB,iBAAiBqB,KAAK,CAACD,UAAU;IAC7CE,UAAUtB,iBAAiBqB,KAAK,CAACC,QAAQ;IACzCC,YAAYvB,iBAAiBqB,KAAK,CAACE,UAAU;IAC7CC,gBAAgB;IAChBC,SAAS1B,OAAO2B,gBAAgB;IAChCC,eAAe;IAEf,UAAU;QACRV,QAAQ;QACRV,iBAAiBR,OAAO6B,4BAA4B;QACpDxB,OAAOL,OAAO8B,4BAA4B;IAC5C;IACA,WAAW;QACTtB,iBAAiBR,OAAO+B,8BAA8B;QACtD1B,OAAOL,OAAOgC,8BAA8B;IAC9C;IACA,kCAAkC;QAChC,UAAU;YACRxB,iBAAiB;QACnB;QACA,WAAW;YACTA,iBAAiB;QACnB;IACF;AACF;AACA;;CAEC,GACD,OAAO,MAAMyB,iDAAiD,CAC5DC;IAEA,MAAMC,oBAAoB/B;IAE1B8B,MAAM/B,IAAI,CAACiC,SAAS,GAAGrC,aACrBG,uCAAuCC,IAAI,EAC3CgC,mBACAD,MAAM/B,IAAI,CAACiC,SAAS;IAGtB,OAAOF;AACT,EAAE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useAttachmentOverflowMenuItem_unstable } from './useAttachmentOverflowMenuItem';
|
|
3
|
+
import { renderAttachmentOverflowMenuItem_unstable } from './renderAttachmentOverflowMenuItem';
|
|
4
|
+
import { useAttachmentOverflowMenuItemStyles_unstable } from './useAttachmentOverflowMenuItemStyles';
|
|
5
|
+
export const AttachmentOverflowMenuItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
6
|
+
const state = useAttachmentOverflowMenuItem_unstable(props, ref);
|
|
7
|
+
useAttachmentOverflowMenuItemStyles_unstable(state);
|
|
8
|
+
return renderAttachmentOverflowMenuItem_unstable(state);
|
|
9
|
+
});
|
|
10
|
+
AttachmentOverflowMenuItem.displayName = 'AttachmentOverflowMenuItem';
|
|
11
|
+
//# sourceMappingURL=AttachmentOverflowMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenuItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentOverflowMenuItem_unstable } from './useAttachmentOverflowMenuItem';\nimport { renderAttachmentOverflowMenuItem_unstable } from './renderAttachmentOverflowMenuItem';\nimport type { AttachmentOverflowMenuItemProps } from './AttachmentOverflowMenuItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useAttachmentOverflowMenuItemStyles_unstable } from './useAttachmentOverflowMenuItemStyles';\nexport const AttachmentOverflowMenuItem: ForwardRefComponent<AttachmentOverflowMenuItemProps> = React.forwardRef(\n (props, ref) => {\n const state = useAttachmentOverflowMenuItem_unstable(props, ref);\n useAttachmentOverflowMenuItemStyles_unstable(state);\n\n return renderAttachmentOverflowMenuItem_unstable(state);\n },\n);\n\nAttachmentOverflowMenuItem.displayName = 'AttachmentOverflowMenuItem';\n"],"names":["React","useAttachmentOverflowMenuItem_unstable","renderAttachmentOverflowMenuItem_unstable","useAttachmentOverflowMenuItemStyles_unstable","AttachmentOverflowMenuItem","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sCAAsC,QAAQ,kCAAkC;AACzF,SAASC,yCAAyC,QAAQ,qCAAqC;AAG/F,SAASC,4CAA4C,QAAQ,wCAAwC;AACrG,OAAO,MAAMC,2CAAmFJ,MAAMK,UAAU,CAC9G,CAACC,OAAOC;IACN,MAAMC,QAAQP,uCAAuCK,OAAOC;IAC5DJ,6CAA6CK;IAE7C,OAAON,0CAA0CM;AACnD,GACA;AAEFJ,2BAA2BK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenuItem.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, MenuItem, Slot } from '@fluentui/react-components';\nimport type { AttachmentProps } from '../Attachment';\n\nexport type AttachmentOverflowMenuItemSlots = {\n root: NonNullable<Slot<typeof MenuItem>>;\n};\n\n/**\n * AttachmentOverflowMenuItem Props\n */\nexport type AttachmentOverflowMenuItemProps = ComponentProps<Partial<AttachmentOverflowMenuItemSlots>> &\n Pick<AttachmentProps, 'id' | 'media'>;\n\n/**\n * State used in rendering AttachmentOverflowMenuItem\n */\nexport type AttachmentOverflowMenuItemState = ComponentState<AttachmentOverflowMenuItemSlots> & {\n isVisible: boolean;\n};\n"],"names":[],"mappings":"AAAA,WAkBE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './AttachmentOverflowMenuItem';
|
|
2
|
+
export * from './AttachmentOverflowMenuItem.types';
|
|
3
|
+
export * from './renderAttachmentOverflowMenuItem';
|
|
4
|
+
export * from './useAttachmentOverflowMenuItem';
|
|
5
|
+
export * from './useAttachmentOverflowMenuItemStyles';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './AttachmentOverflowMenuItem';\nexport * from './AttachmentOverflowMenuItem.types';\nexport * from './renderAttachmentOverflowMenuItem';\nexport * from './useAttachmentOverflowMenuItem';\nexport * from './useAttachmentOverflowMenuItemStyles';\n"],"names":[],"mappings":"AAAA,cAAc,+BAA+B;AAC7C,cAAc,qCAAqC;AACnD,cAAc,qCAAqC;AACnD,cAAc,kCAAkC;AAChD,cAAc,wCAAwC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from '@fluentui/react-components';
|
|
3
|
+
/**
|
|
4
|
+
* Render the final JSX of AttachmentOverflowMenuItem
|
|
5
|
+
*/
|
|
6
|
+
export const renderAttachmentOverflowMenuItem_unstable = state => {
|
|
7
|
+
assertSlots(state);
|
|
8
|
+
return !state.isVisible ? /*#__PURE__*/_jsx(state.root, {}) : null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=renderAttachmentOverflowMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderAttachmentOverflowMenuItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type {\n AttachmentOverflowMenuItemState,\n AttachmentOverflowMenuItemSlots,\n} from './AttachmentOverflowMenuItem.types';\n\n/**\n * Render the final JSX of AttachmentOverflowMenuItem\n */\nexport const renderAttachmentOverflowMenuItem_unstable = (state: AttachmentOverflowMenuItemState) => {\n assertSlots<AttachmentOverflowMenuItemSlots>(state);\n\n return !state.isVisible ? <state.root /> : null;\n};\n"],"names":["assertSlots","renderAttachmentOverflowMenuItem_unstable","state","isVisible","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAMzD;;CAEC,GACD,OAAO,MAAMC,4CAA4C,CAACC;IACxDF,YAA6CE;IAE7C,OAAO,CAACA,MAAMC,SAAS,iBAAG,KAACD,MAAME,IAAI,QAAM;AAC7C,EAAE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MenuItem, mergeCallbacks, slot, useIsOverflowItemVisible } from '@fluentui/react-components';
|
|
3
|
+
import { Dismiss20Filled, Dismiss20Regular, bundleIcon } from '@fluentui/react-icons';
|
|
4
|
+
import { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render AttachmentOverflowMenuItem.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useAttachmentOverflowMenuItemStyles_unstable,
|
|
9
|
+
* before being passed to renderAttachmentOverflowMenuItem_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of AttachmentOverflowMenuItem
|
|
12
|
+
* @param ref - reference to root HTMLElement of AttachmentOverflowMenuItem
|
|
13
|
+
*/
|
|
14
|
+
export const useAttachmentOverflowMenuItem_unstable = (props, ref) => {
|
|
15
|
+
const {
|
|
16
|
+
id,
|
|
17
|
+
media
|
|
18
|
+
} = props;
|
|
19
|
+
const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);
|
|
20
|
+
const isVisible = useIsOverflowItemVisible(id);
|
|
21
|
+
const onAttachmentDismiss = useAttachmentListContext_unstable(context => context.onAttachmentDismiss);
|
|
22
|
+
const root = slot.always({
|
|
23
|
+
ref,
|
|
24
|
+
icon: media,
|
|
25
|
+
secondaryContent: /*#__PURE__*/React.createElement(DismissIcon, null),
|
|
26
|
+
...props
|
|
27
|
+
}, {
|
|
28
|
+
elementType: MenuItem
|
|
29
|
+
});
|
|
30
|
+
root.onClick = mergeCallbacks(root.onClick, ev => onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
|
|
31
|
+
id
|
|
32
|
+
}));
|
|
33
|
+
return {
|
|
34
|
+
components: {
|
|
35
|
+
root: MenuItem
|
|
36
|
+
},
|
|
37
|
+
root,
|
|
38
|
+
isVisible
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=useAttachmentOverflowMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MenuItem, mergeCallbacks, slot, useIsOverflowItemVisible } from '@fluentui/react-components';\nimport { Dismiss20Filled, Dismiss20Regular, bundleIcon } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type {\n AttachmentOverflowMenuItemProps,\n AttachmentOverflowMenuItemState,\n} from './AttachmentOverflowMenuItem.types';\n\n/**\n * Create the state required to render AttachmentOverflowMenuItem.\n *\n * The returned state can be modified with hooks such as useAttachmentOverflowMenuItemStyles_unstable,\n * before being passed to renderAttachmentOverflowMenuItem_unstable.\n *\n * @param props - props from this instance of AttachmentOverflowMenuItem\n * @param ref - reference to root HTMLElement of AttachmentOverflowMenuItem\n */\nexport const useAttachmentOverflowMenuItem_unstable = (\n props: AttachmentOverflowMenuItemProps,\n ref: React.Ref<HTMLDivElement>,\n): AttachmentOverflowMenuItemState => {\n const { id, media } = props;\n const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);\n const isVisible = useIsOverflowItemVisible(id);\n\n const onAttachmentDismiss = useAttachmentListContext_unstable(context => context.onAttachmentDismiss);\n\n const root = slot.always(\n { ref, icon: media, secondaryContent: <DismissIcon />, ...props },\n { elementType: MenuItem },\n );\n root.onClick = mergeCallbacks(root.onClick, ev =>\n onAttachmentDismiss?.(ev, {\n id,\n }),\n );\n\n return {\n components: {\n root: MenuItem,\n },\n root,\n isVisible,\n };\n};\n"],"names":["React","MenuItem","mergeCallbacks","slot","useIsOverflowItemVisible","Dismiss20Filled","Dismiss20Regular","bundleIcon","useAttachmentListContext_unstable","useAttachmentOverflowMenuItem_unstable","props","ref","id","media","DismissIcon","isVisible","onAttachmentDismiss","context","root","always","icon","secondaryContent","elementType","onClick","ev","components"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,QAAQ,EAAEC,cAAc,EAAEC,IAAI,EAAEC,wBAAwB,QAAQ,6BAA6B;AACtG,SAASC,eAAe,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,wBAAwB;AACtF,SAASC,iCAAiC,QAAQ,uCAAuC;AAMzF;;;;;;;;CAQC,GACD,OAAO,MAAMC,yCAAyC,CACpDC,OACAC;IAEA,MAAM,EAAEC,EAAE,EAAEC,KAAK,EAAE,GAAGH;IACtB,MAAMI,cAAcP,WAAWF,iBAAiBC;IAChD,MAAMS,YAAYX,yBAAyBQ;IAE3C,MAAMI,sBAAsBR,kCAAkCS,CAAAA,UAAWA,QAAQD,mBAAmB;IAEpG,MAAME,OAAOf,KAAKgB,MAAM,CACtB;QAAER;QAAKS,MAAMP;QAAOQ,gCAAkB,oBAACP;QAAgB,GAAGJ,KAAK;IAAC,GAChE;QAAEY,aAAarB;IAAS;IAE1BiB,KAAKK,OAAO,GAAGrB,eAAegB,KAAKK,OAAO,EAAEC,CAAAA,KAC1CR,gCAAAA,0CAAAA,oBAAsBQ,IAAI;YACxBZ;QACF;IAGF,OAAO;QACLa,YAAY;YACVP,MAAMjB;QACR;QACAiB;QACAH;IACF;AACF,EAAE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __resetStyles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
+
export const attachmentOverflowMenuItemClassNames = {
|
|
3
|
+
root: 'fai-AttachmentOverflowMenuItem'
|
|
4
|
+
};
|
|
5
|
+
const useRootBaseClassName = __resetStyles("r0", null, []);
|
|
6
|
+
/**
|
|
7
|
+
* Apply styling to the AttachmentList slots based on the state
|
|
8
|
+
*/
|
|
9
|
+
export const useAttachmentOverflowMenuItemStyles_unstable = state => {
|
|
10
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
11
|
+
state.root.className = mergeClasses(attachmentOverflowMenuItemClassNames.root, rootBaseClassName, state.root.className);
|
|
12
|
+
return state;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useAttachmentOverflowMenuItemStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuItemStyles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses } from '@fluentui/react-components';\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};\n\nconst useRootBaseClassName = makeResetStyles({});\n\n/**\n * Apply styling to the AttachmentList slots based on the state\n */\nexport const useAttachmentOverflowMenuItemStyles_unstable = (\n state: AttachmentOverflowMenuItemState,\n): AttachmentOverflowMenuItemState => {\n const rootBaseClassName = useRootBaseClassName();\n\n state.root.className = mergeClasses(\n attachmentOverflowMenuItemClassNames.root,\n rootBaseClassName,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","attachmentOverflowMenuItemClassNames","root","useRootBaseClassName","useAttachmentOverflowMenuItemStyles_unstable","state","rootBaseClassName","className"],"mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,QAAQ,6BAA6B;AAO3E,OAAO,MAAMC,uCAAwF;IACnGC,MAAM;AACR,EAAE;AAEF,MAAMC,uBAAuBJ,gBAAgB,CAAC;AAE9C;;CAEC,GACD,OAAO,MAAMK,+CAA+C,CAC1DC;IAEA,MAAMC,oBAAoBH;IAE1BE,MAAMH,IAAI,CAACK,SAAS,GAAGP,aACrBC,qCAAqCC,IAAI,EACzCI,mBACAD,MAAMH,IAAI,CAACK,SAAS;IAGtB,OAAOF;AACT,EAAE"}
|
|
@@ -3,7 +3,10 @@ import { useAttachmentTag_unstable } from './useAttachmentTag';
|
|
|
3
3
|
import { renderAttachmentTag_unstable } from './renderAttachmentTag';
|
|
4
4
|
import { useAttachmentTagStyles_unstable } from './useAttachmentTagStyles';
|
|
5
5
|
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated use new Attachment component exported from @fluentui-copilot/react-attachments package instead.
|
|
8
|
+
* Deprecated on 4/9/2024. Will be removed in the next minor release (0.15.0).
|
|
9
|
+
*/
|
|
7
10
|
export const AttachmentTag = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
8
11
|
const state = useAttachmentTag_unstable(props, ref);
|
|
9
12
|
useAttachmentTagStyles_unstable(state);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AttachmentTag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentTag_unstable } from './useAttachmentTag';\nimport { renderAttachmentTag_unstable } from './renderAttachmentTag';\nimport { useAttachmentTagStyles_unstable } from './useAttachmentTagStyles';\nimport type { AttachmentTagProps } from './AttachmentTag.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\n
|
|
1
|
+
{"version":3,"sources":["AttachmentTag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentTag_unstable } from './useAttachmentTag';\nimport { renderAttachmentTag_unstable } from './renderAttachmentTag';\nimport { useAttachmentTagStyles_unstable } from './useAttachmentTagStyles';\nimport type { AttachmentTagProps } from './AttachmentTag.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\n/**\n * @deprecated use new Attachment component exported from @fluentui-copilot/react-attachments package instead.\n * Deprecated on 4/9/2024. Will be removed in the next minor release (0.15.0).\n */\nexport const AttachmentTag: ForwardRefComponent<AttachmentTagProps> = React.forwardRef((props, ref) => {\n const state = useAttachmentTag_unstable(props, ref);\n\n useAttachmentTagStyles_unstable(state);\n useCustomStyleHook('useAttachmentTagStyles')(state);\n\n return renderAttachmentTag_unstable(state);\n});\n\nAttachmentTag.displayName = 'AttachmentTag';\n"],"names":["React","useAttachmentTag_unstable","renderAttachmentTag_unstable","useAttachmentTagStyles_unstable","useCustomStyleHook","AttachmentTag","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,+BAA+B,QAAQ,2BAA2B;AAG3E,SAASC,kBAAkB,QAAQ,mCAAmC;AAEtE;;;CAGC,GACD,OAAO,MAAMC,8BAAyDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQR,0BAA0BM,OAAOC;IAE/CL,gCAAgCM;IAChCL,mBAAmB,0BAA0BK;IAE7C,OAAOP,6BAA6BO;AACtC,GAAG;AAEHJ,cAAcK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachmentTag.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { useAttachmentTagSlots } from '../utils/useAttachmentTagSlots';\nimport type { AttachmentTagProps, AttachmentTagState } from './AttachmentTag.types';\n\n/**\n * Create the state required to render AttachmentTag.\n *\n * The returned state can be modified with hooks such as useAttachmentTagStyles_unstable,\n * before being passed to renderAttachmentTag_unstable.\n *\n * @param props - props from this instance of AttachmentTag\n * @param ref - reference to root HTMLElement of AttachmentTag\n */\nexport const useAttachmentTag_unstable = (\n props: AttachmentTagProps,\n ref: React.Ref<
|
|
1
|
+
{"version":3,"sources":["useAttachmentTag.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { useAttachmentTagSlots } from '../utils/useAttachmentTagSlots';\nimport type { AttachmentTagProps, AttachmentTagState } from './AttachmentTag.types';\n\n/**\n * Create the state required to render AttachmentTag.\n *\n * The returned state can be modified with hooks such as useAttachmentTagStyles_unstable,\n * before being passed to renderAttachmentTag_unstable.\n *\n * @param props - props from this instance of AttachmentTag\n * @param ref - reference to root HTMLElement of AttachmentTag\n */\nexport const useAttachmentTag_unstable = (\n props: AttachmentTagProps,\n ref: React.Ref<HTMLButtonElement>,\n): AttachmentTagState => {\n return useAttachmentTagSlots(props, ref, {\n elementType: { root: 'button', media: 'span', content: 'span', icon: 'span' },\n });\n};\n"],"names":["useAttachmentTagSlots","useAttachmentTag_unstable","props","ref","elementType","root","media","content","icon"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,iCAAiC;AAGvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,OAAOH,sBAAsBE,OAAOC,KAAK;QACvCC,aAAa;YAAEC,MAAM;YAAUC,OAAO;YAAQC,SAAS;YAAQC,MAAM;QAAO;IAC9E;AACF,EAAE"}
|