@fluentui-copilot/react-reference 0.11.0 → 0.11.1
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 +22 -1
- package/CHANGELOG.md +12 -2
- package/dist/index.d.ts +219 -0
- package/lib/Citation.js.map +1 -1
- package/lib/Reference.js.map +1 -1
- package/lib/ReferenceGroupToggle.js.map +1 -1
- package/lib/ReferenceList.js.map +1 -1
- package/lib/ReferenceListV2.js +2 -0
- package/lib/ReferenceListV2.js.map +1 -0
- package/lib/ReferenceOverflowButton.js +2 -0
- package/lib/ReferenceOverflowButton.js.map +1 -0
- package/lib/ReferenceV2.js +2 -0
- package/lib/ReferenceV2.js.map +1 -0
- package/lib/components/Citation/Citation.js.map +1 -1
- package/lib/components/Citation/Citation.types.js +3 -1
- package/lib/components/Citation/Citation.types.js.map +1 -1
- package/lib/components/Citation/index.js.map +1 -1
- package/lib/components/Citation/renderCitation.js.map +1 -1
- package/lib/components/Citation/useCitation.js.map +1 -1
- package/lib/components/Citation/useCitationStyles.js.map +1 -1
- package/lib/components/Reference/Reference.js.map +1 -1
- package/lib/components/Reference/Reference.types.js +3 -1
- package/lib/components/Reference/Reference.types.js.map +1 -1
- package/lib/components/Reference/index.js.map +1 -1
- package/lib/components/Reference/renderReference.js.map +1 -1
- package/lib/components/Reference/useReference.js +1 -1
- package/lib/components/Reference/useReference.js.map +1 -1
- package/lib/components/Reference/useReferenceStyles.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +3 -1
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/index.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/renderReferenceGroupToggle.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +1 -1
- package/lib/components/ReferenceList/ReferenceList.js.map +1 -1
- package/lib/components/ReferenceList/ReferenceList.types.js +3 -1
- package/lib/components/ReferenceList/ReferenceList.types.js.map +1 -1
- package/lib/components/ReferenceList/index.js.map +1 -1
- package/lib/components/ReferenceList/renderReferenceList.js.map +1 -1
- package/lib/components/ReferenceList/useReferenceList.js.map +1 -1
- package/lib/components/ReferenceList/useReferenceListStyles.js.map +1 -1
- package/lib/components/reference-v2/Reference/Reference.js +11 -0
- package/lib/components/reference-v2/Reference/Reference.js.map +1 -0
- package/lib/components/reference-v2/Reference/Reference.types.js +2 -0
- package/lib/components/reference-v2/Reference/Reference.types.js.map +1 -0
- package/lib/components/reference-v2/Reference/index.js +6 -0
- package/lib/components/reference-v2/Reference/index.js.map +1 -0
- package/lib/components/reference-v2/Reference/renderReference.js +19 -0
- package/lib/components/reference-v2/Reference/renderReference.js.map +1 -0
- package/lib/components/reference-v2/Reference/useReference.js +72 -0
- package/lib/components/reference-v2/Reference/useReference.js.map +1 -0
- package/lib/components/reference-v2/Reference/useReferenceStyles.js +71 -0
- package/lib/components/reference-v2/Reference/useReferenceStyles.js.map +1 -0
- package/lib/components/reference-v2/ReferenceList/ReferenceList.js +13 -0
- package/lib/components/reference-v2/ReferenceList/ReferenceList.js.map +1 -0
- package/lib/components/reference-v2/ReferenceList/ReferenceList.types.js +2 -0
- package/lib/components/reference-v2/ReferenceList/ReferenceList.types.js.map +1 -0
- package/lib/components/reference-v2/ReferenceList/index.js +6 -0
- package/lib/components/reference-v2/ReferenceList/index.js.map +1 -0
- package/lib/components/reference-v2/ReferenceList/renderReferenceList.js +18 -0
- package/lib/components/reference-v2/ReferenceList/renderReferenceList.js.map +1 -0
- package/lib/components/reference-v2/ReferenceList/useReferenceList.js +94 -0
- package/lib/components/reference-v2/ReferenceList/useReferenceList.js.map +1 -0
- package/lib/components/reference-v2/ReferenceList/useReferenceListContextValues.js +21 -0
- package/lib/components/reference-v2/ReferenceList/useReferenceListContextValues.js.map +1 -0
- package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.js +39 -0
- package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.js.map +1 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js +12 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js +4 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map +1 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/index.js +6 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/index.js.map +1 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/renderReferenceOverflowButton.js +10 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/renderReferenceOverflowButton.js.map +1 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +91 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.js +35 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.js.map +1 -0
- package/lib/components/reference-v2/index.js +4 -0
- package/lib/components/reference-v2/index.js.map +1 -0
- package/lib/{context → contexts}/ReferenceGroupContext.js.map +1 -1
- package/lib/contexts/reference-v2/index.js +2 -0
- package/lib/contexts/reference-v2/index.js.map +1 -0
- package/lib/contexts/reference-v2/referenceListContext.js +16 -0
- package/lib/contexts/reference-v2/referenceListContext.js.map +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/reference-v2/index.js +2 -0
- package/lib/hooks/reference-v2/index.js.map +1 -0
- package/lib/hooks/reference-v2/useReferenceCitationPreview.js +120 -0
- package/lib/hooks/reference-v2/useReferenceCitationPreview.js.map +1 -0
- package/lib/hooks/useReferenceCitationPreview.js.map +1 -1
- package/lib/hooks/useReferenceGroup.js.map +1 -1
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Citation.js.map +1 -1
- package/lib-commonjs/Reference.js.map +1 -1
- package/lib-commonjs/ReferenceGroupToggle.js.map +1 -1
- package/lib-commonjs/ReferenceList.js.map +1 -1
- package/lib-commonjs/ReferenceListV2.js +7 -0
- package/lib-commonjs/ReferenceListV2.js.map +1 -0
- package/lib-commonjs/ReferenceOverflowButton.js +7 -0
- package/lib-commonjs/ReferenceOverflowButton.js.map +1 -0
- package/lib-commonjs/ReferenceV2.js +7 -0
- package/lib-commonjs/ReferenceV2.js.map +1 -0
- package/lib-commonjs/components/Citation/Citation.js.map +1 -1
- package/lib-commonjs/components/Citation/Citation.types.js +3 -1
- package/lib-commonjs/components/Citation/Citation.types.js.map +1 -1
- package/lib-commonjs/components/Citation/index.js.map +1 -1
- package/lib-commonjs/components/Citation/renderCitation.js.map +1 -1
- package/lib-commonjs/components/Citation/useCitation.js.map +1 -1
- package/lib-commonjs/components/Citation/useCitationStyles.js.map +1 -1
- package/lib-commonjs/components/Reference/Reference.js.map +1 -1
- package/lib-commonjs/components/Reference/Reference.types.js +3 -1
- package/lib-commonjs/components/Reference/Reference.types.js.map +1 -1
- package/lib-commonjs/components/Reference/index.js.map +1 -1
- package/lib-commonjs/components/Reference/renderReference.js.map +1 -1
- package/lib-commonjs/components/Reference/useReference.js +1 -1
- package/lib-commonjs/components/Reference/useReference.js.map +1 -1
- package/lib-commonjs/components/Reference/useReferenceStyles.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +3 -1
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/index.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/ReferenceList.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/ReferenceList.types.js +3 -1
- package/lib-commonjs/components/ReferenceList/ReferenceList.types.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/index.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/renderReferenceList.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/useReferenceList.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/Reference.js +21 -0
- package/lib-commonjs/components/reference-v2/Reference/Reference.js.map +1 -0
- package/lib-commonjs/components/reference-v2/Reference/Reference.types.js +5 -0
- package/lib-commonjs/components/reference-v2/Reference/Reference.types.js.map +1 -0
- package/lib-commonjs/components/reference-v2/Reference/index.js +28 -0
- package/lib-commonjs/components/reference-v2/Reference/index.js.map +1 -0
- package/lib-commonjs/components/reference-v2/Reference/renderReference.js +32 -0
- package/lib-commonjs/components/reference-v2/Reference/renderReference.js.map +1 -0
- package/lib-commonjs/components/reference-v2/Reference/useReference.js +67 -0
- package/lib-commonjs/components/reference-v2/Reference/useReference.js.map +1 -0
- package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.js +122 -0
- package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js +23 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.types.js +5 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.types.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/index.js +11 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/index.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/renderReferenceList.js +28 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/renderReferenceList.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js +93 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js +24 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.js +55 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js +21 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js +7 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/index.js +11 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/index.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/renderReferenceOverflowButton.js +16 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/renderReferenceOverflowButton.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +84 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.js +65 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.js.map +1 -0
- package/lib-commonjs/components/reference-v2/index.js +9 -0
- package/lib-commonjs/components/reference-v2/index.js.map +1 -0
- package/lib-commonjs/contexts/ReferenceGroupContext.js.map +1 -0
- package/lib-commonjs/contexts/reference-v2/index.js +7 -0
- package/lib-commonjs/contexts/reference-v2/index.js.map +1 -0
- package/lib-commonjs/contexts/reference-v2/referenceListContext.js +36 -0
- package/lib-commonjs/contexts/reference-v2/referenceListContext.js.map +1 -0
- package/lib-commonjs/hooks/index.js.map +1 -1
- package/lib-commonjs/hooks/reference-v2/index.js +7 -0
- package/lib-commonjs/hooks/reference-v2/index.js.map +1 -0
- package/lib-commonjs/hooks/reference-v2/useReferenceCitationPreview.js +148 -0
- package/lib-commonjs/hooks/reference-v2/useReferenceCitationPreview.js.map +1 -0
- package/lib-commonjs/hooks/useReferenceCitationPreview.js.map +1 -1
- package/lib-commonjs/hooks/useReferenceGroup.js.map +1 -1
- package/lib-commonjs/index.js +95 -30
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +11 -11
- package/lib-commonjs/context/ReferenceGroupContext.js.map +0 -1
- /package/lib/{context → contexts}/ReferenceGroupContext.js +0 -0
- /package/lib-commonjs/{context → contexts}/ReferenceGroupContext.js +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getIntrinsicElementProps, mergeCallbacks, mergeClasses, slot, useArrowNavigationGroup } from '@fluentui/react-components';
|
|
3
|
+
import { useRootStyles as useReferenceStyles } from '../Reference/useReferenceStyles';
|
|
4
|
+
/**
|
|
5
|
+
* Create the state required to render ReferenceList.
|
|
6
|
+
*
|
|
7
|
+
* The returned state can be modified with hooks such as useReferenceListStyles_unstable,
|
|
8
|
+
* before being passed to renderReferenceList_unstable.
|
|
9
|
+
*
|
|
10
|
+
* @param props - props from this instance of ReferenceList
|
|
11
|
+
* @param ref - reference to root HTMLElement of ReferenceList
|
|
12
|
+
*/
|
|
13
|
+
export const useReferenceList_unstable = (props, ref) => {
|
|
14
|
+
const {
|
|
15
|
+
appearance = 'lighter',
|
|
16
|
+
children,
|
|
17
|
+
maxVisibleReferences,
|
|
18
|
+
showLessButton,
|
|
19
|
+
showMoreButton,
|
|
20
|
+
...rest
|
|
21
|
+
} = props;
|
|
22
|
+
const [areReferencesExpanded, setAreReferencesExpanded] = React.useState(false);
|
|
23
|
+
const referenceInOverflowClassName = useReferenceStyles().overflow;
|
|
24
|
+
const resolvedChildren = React.useMemo(() => {
|
|
25
|
+
if (maxVisibleReferences !== undefined && !areReferencesExpanded) {
|
|
26
|
+
const results = [];
|
|
27
|
+
const childrenArray = React.Children.toArray(children);
|
|
28
|
+
for (let index = 0; index < childrenArray.length; index++) {
|
|
29
|
+
const child = childrenArray[index];
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
if (index >= maxVisibleReferences && React.isValidElement(child)) {
|
|
32
|
+
results.push(React.cloneElement(child, {
|
|
33
|
+
...child.props,
|
|
34
|
+
className: mergeClasses(child.props.className, referenceInOverflowClassName)
|
|
35
|
+
}));
|
|
36
|
+
} else {
|
|
37
|
+
results.push(child);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return results;
|
|
41
|
+
}
|
|
42
|
+
return children;
|
|
43
|
+
}, [areReferencesExpanded, children, maxVisibleReferences, referenceInOverflowClassName]);
|
|
44
|
+
// We keep track of the previous overflow count to determine element to move focus to when expanding the references via keyboard.
|
|
45
|
+
const previousOverflowCount = React.useRef(0);
|
|
46
|
+
// We keep track of whether we are interacting with the overflow button via keyboard or not.
|
|
47
|
+
const overflowButtonTriggeredViaKeyboard = React.useRef(false);
|
|
48
|
+
const focusAttributes = useArrowNavigationGroup({
|
|
49
|
+
axis: 'both',
|
|
50
|
+
circular: true,
|
|
51
|
+
memorizeCurrent: true
|
|
52
|
+
});
|
|
53
|
+
const onShowMoreButtonClick = React.useCallback(() => {
|
|
54
|
+
setAreReferencesExpanded(true);
|
|
55
|
+
}, []);
|
|
56
|
+
const onShowLessButtonClick = React.useCallback(() => {
|
|
57
|
+
setAreReferencesExpanded(false);
|
|
58
|
+
}, []);
|
|
59
|
+
const shouldUseOverflow = maxVisibleReferences !== undefined && !areReferencesExpanded;
|
|
60
|
+
const state = {
|
|
61
|
+
appearance,
|
|
62
|
+
areReferencesExpanded,
|
|
63
|
+
overflowButtonTriggeredViaKeyboard,
|
|
64
|
+
previousOverflowCount,
|
|
65
|
+
shouldUseOverflow,
|
|
66
|
+
components: {
|
|
67
|
+
root: 'div',
|
|
68
|
+
showMoreButton: 'span',
|
|
69
|
+
showLessButton: 'span'
|
|
70
|
+
},
|
|
71
|
+
root: slot.always(getIntrinsicElementProps('div', {
|
|
72
|
+
ref,
|
|
73
|
+
...focusAttributes,
|
|
74
|
+
...rest,
|
|
75
|
+
children: resolvedChildren
|
|
76
|
+
}), {
|
|
77
|
+
elementType: 'div'
|
|
78
|
+
}),
|
|
79
|
+
showMoreButton: shouldUseOverflow ? slot.optional(showMoreButton, {
|
|
80
|
+
elementType: 'span'
|
|
81
|
+
}) : undefined,
|
|
82
|
+
showLessButton: areReferencesExpanded ? slot.optional(showLessButton, {
|
|
83
|
+
elementType: 'span'
|
|
84
|
+
}) : undefined
|
|
85
|
+
};
|
|
86
|
+
if (state.showMoreButton) {
|
|
87
|
+
state.showMoreButton.onClick = mergeCallbacks(onShowMoreButtonClick, state.showMoreButton.onClick);
|
|
88
|
+
}
|
|
89
|
+
if (state.showLessButton) {
|
|
90
|
+
state.showLessButton.onClick = mergeCallbacks(onShowLessButtonClick, state.showLessButton.onClick);
|
|
91
|
+
}
|
|
92
|
+
return state;
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=useReferenceList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceList.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n mergeCallbacks,\n mergeClasses,\n slot,\n useArrowNavigationGroup,\n} from '@fluentui/react-components';\nimport type { ReferenceListProps, ReferenceListState } from './ReferenceList.types';\nimport { useRootStyles as useReferenceStyles } from '../Reference/useReferenceStyles';\n\n/**\n * Create the state required to render ReferenceList.\n *\n * The returned state can be modified with hooks such as useReferenceListStyles_unstable,\n * before being passed to renderReferenceList_unstable.\n *\n * @param props - props from this instance of ReferenceList\n * @param ref - reference to root HTMLElement of ReferenceList\n */\nexport const useReferenceList_unstable = (\n props: ReferenceListProps,\n ref: React.Ref<HTMLDivElement>,\n): ReferenceListState => {\n const { appearance = 'lighter', children, maxVisibleReferences, showLessButton, showMoreButton, ...rest } = props;\n\n const [areReferencesExpanded, setAreReferencesExpanded] = React.useState(false);\n\n const referenceInOverflowClassName = useReferenceStyles().overflow;\n const resolvedChildren = React.useMemo(() => {\n if (maxVisibleReferences !== undefined && !areReferencesExpanded) {\n const results = [];\n const childrenArray = React.Children.toArray(children);\n for (let index = 0; index < childrenArray.length; index++) {\n const child = childrenArray[index] as React.ReactElement;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (index >= maxVisibleReferences && React.isValidElement<any>(child)) {\n results.push(\n React.cloneElement(child, {\n ...child.props,\n className: mergeClasses(child.props.className, referenceInOverflowClassName),\n }),\n );\n } else {\n results.push(child);\n }\n }\n return results;\n }\n\n return children;\n }, [areReferencesExpanded, children, maxVisibleReferences, referenceInOverflowClassName]);\n\n // We keep track of the previous overflow count to determine element to move focus to when expanding the references via keyboard.\n const previousOverflowCount = React.useRef(0);\n\n // We keep track of whether we are interacting with the overflow button via keyboard or not.\n const overflowButtonTriggeredViaKeyboard = React.useRef(false);\n\n const focusAttributes = useArrowNavigationGroup({\n axis: 'both',\n circular: true,\n memorizeCurrent: true,\n });\n\n const onShowMoreButtonClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(() => {\n setAreReferencesExpanded(true);\n }, []);\n\n const onShowLessButtonClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(() => {\n setAreReferencesExpanded(false);\n }, []);\n\n const shouldUseOverflow = maxVisibleReferences !== undefined && !areReferencesExpanded;\n\n const state: ReferenceListState = {\n appearance,\n areReferencesExpanded,\n overflowButtonTriggeredViaKeyboard,\n previousOverflowCount,\n shouldUseOverflow,\n\n components: {\n root: 'div',\n showMoreButton: 'span',\n showLessButton: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...focusAttributes,\n ...rest,\n children: resolvedChildren,\n }),\n { elementType: 'div' },\n ),\n showMoreButton: shouldUseOverflow ? slot.optional(showMoreButton, { elementType: 'span' }) : undefined,\n showLessButton: areReferencesExpanded ? slot.optional(showLessButton, { elementType: 'span' }) : undefined,\n };\n\n if (state.showMoreButton) {\n state.showMoreButton.onClick = mergeCallbacks(onShowMoreButtonClick, state.showMoreButton.onClick);\n }\n\n if (state.showLessButton) {\n state.showLessButton.onClick = mergeCallbacks(onShowLessButtonClick, state.showLessButton.onClick);\n }\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","mergeCallbacks","mergeClasses","slot","useArrowNavigationGroup","useRootStyles","useReferenceStyles","useReferenceList_unstable","props","ref","appearance","children","maxVisibleReferences","showLessButton","showMoreButton","rest","areReferencesExpanded","setAreReferencesExpanded","useState","referenceInOverflowClassName","overflow","resolvedChildren","useMemo","undefined","results","childrenArray","Children","toArray","index","length","child","isValidElement","push","cloneElement","className","previousOverflowCount","useRef","overflowButtonTriggeredViaKeyboard","focusAttributes","axis","circular","memorizeCurrent","onShowMoreButtonClick","useCallback","onShowLessButtonClick","shouldUseOverflow","state","components","root","always","elementType","optional","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,wBAAwB,EACxBC,cAAc,EACdC,YAAY,EACZC,IAAI,EACJC,uBAAuB,QAClB,6BAA6B;AAEpC,SAASC,iBAAiBC,kBAAkB,QAAQ,kCAAkC;AAEtF;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAM,EAAEC,aAAa,SAAS,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AyBW,aAAa,CAACP;IAEjE,MAAM8B,QAA4B;QAChCpC;QACAM;QACAqB;QACAF;QACAU;QAEAE,YAAY;YACVC,MAAM;YACNlC,gBAAgB;YAChBD,gBAAgB;QAClB;QACAmC,MAAM7C,KAAK8C,MAAM,CACfjD,yBAAyB,OAAO;YAC9BS;YACA,GAAG6B,eAAe;YAClB,GAAGvB,IAAI;YACPJ,UAAUU;QACZ,IACA;YAAE6B,aAAa;QAAM;QAEvBpC,gBAAgB+B,oBAAoB1C,KAAKgD,QAAQ,CAACrC,gBAAgB;YAAEoC,aAAa;QAAO,KAAK3B;QAC7FV,gBAAgBG,wBAAwBb,KAAKgD,QAAQ,CAACtC,gBAAgB;YAAEqC,aAAa;QAAO,KAAK3B;IACnG;IAEA,IAAIuB,MAAMhC,cAAc,EAAE;QACxBgC,MAAMhC,cAAc,CAACsC,OAAO,GAAGnD,eAAeyC,uBAAuBI,MAAMhC,cAAc,CAACsC,OAAO;IACnG;IAEA,IAAIN,MAAMjC,cAAc,EAAE;QACxBiC,MAAMjC,cAAc,CAACuC,OAAO,GAAGnD,eAAe2C,uBAAuBE,MAAMjC,cAAc,CAACuC,OAAO;IACnG;IAEA,OAAON;AACT,EAAE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function useReferenceListContextValues_unstable(state) {
|
|
2
|
+
const {
|
|
3
|
+
appearance,
|
|
4
|
+
areReferencesExpanded,
|
|
5
|
+
overflowButtonTriggeredViaKeyboard,
|
|
6
|
+
previousOverflowCount,
|
|
7
|
+
shouldUseOverflow
|
|
8
|
+
} = state;
|
|
9
|
+
// This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
|
|
10
|
+
const referenceList = {
|
|
11
|
+
appearance,
|
|
12
|
+
areReferencesExpanded,
|
|
13
|
+
overflowButtonTriggeredViaKeyboard,
|
|
14
|
+
previousOverflowCount,
|
|
15
|
+
shouldUseOverflow
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
referenceList
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=useReferenceListContextValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceListContextValues.ts"],"sourcesContent":["import type { ReferenceListState, ReferenceListContextValues } from './ReferenceList.types';\n\nexport function useReferenceListContextValues_unstable(state: ReferenceListState): ReferenceListContextValues {\n const {\n appearance,\n areReferencesExpanded,\n overflowButtonTriggeredViaKeyboard,\n previousOverflowCount,\n shouldUseOverflow,\n } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", there is no sense to memoize it\n const referenceList = {\n appearance,\n areReferencesExpanded,\n overflowButtonTriggeredViaKeyboard,\n previousOverflowCount,\n shouldUseOverflow,\n };\n\n return { referenceList };\n}\n"],"names":["useReferenceListContextValues_unstable","state","appearance","areReferencesExpanded","overflowButtonTriggeredViaKeyboard","previousOverflowCount","shouldUseOverflow","referenceList"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAEA,OAAO,SAASA,uCAAuCC,KAAyB;IAC9E,MAAM,EACJC,UAAU,EACVC,qBAAqB,EACrBC,kCAAkC,EAClCC,qBAAqB,EACrBC,iBAAiB,EAClB,GAAGL;IAEJ,mGAAmG;IACnG,MAAMM,gBAAgB;QACpBL;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,OAAO;QAAEC;IAAc;AACzB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { __resetStyles, __styles, mergeClasses, tokens } from '@fluentui/react-components';
|
|
2
|
+
export const referenceListClassNames = {
|
|
3
|
+
root: 'fai-ReferenceList',
|
|
4
|
+
showMoreButton: 'fai-ReferenceList__showMoreButton',
|
|
5
|
+
showLessButton: 'fai-ReferenceList__showLessButton'
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Styles for the root slot
|
|
9
|
+
*/
|
|
10
|
+
const useRootBaseClassName = __resetStyles("rylvie1", null, [".rylvie1{display:flex;flex-direction:row;gap:var(--spacingVerticalXS) var(--spacingHorizontalXS);}"]);
|
|
11
|
+
const useRootStyles = __styles({
|
|
12
|
+
referencesExpanded: {
|
|
13
|
+
Eh141a: "fni485r"
|
|
14
|
+
}
|
|
15
|
+
}, {
|
|
16
|
+
d: [".fni485r{flex-wrap:wrap;}"]
|
|
17
|
+
});
|
|
18
|
+
const useOverflowButtonBaseClassName = __resetStyles("r6su6fj", null, [".r6su6fj{flex-shrink:0;}"]);
|
|
19
|
+
/**
|
|
20
|
+
* Apply styling to the ReferenceList slots based on the state
|
|
21
|
+
*/
|
|
22
|
+
export const useReferenceListStyles_unstable = state => {
|
|
23
|
+
const {
|
|
24
|
+
areReferencesExpanded,
|
|
25
|
+
shouldUseOverflow
|
|
26
|
+
} = state;
|
|
27
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
28
|
+
const rootStyles = useRootStyles();
|
|
29
|
+
const overflowButtonBaseClassName = useOverflowButtonBaseClassName();
|
|
30
|
+
state.root.className = mergeClasses(referenceListClassNames.root, rootBaseClassName, (areReferencesExpanded || !shouldUseOverflow) && rootStyles.referencesExpanded, state.root.className);
|
|
31
|
+
if (state.showMoreButton) {
|
|
32
|
+
state.showMoreButton.className = mergeClasses(referenceListClassNames.showMoreButton, overflowButtonBaseClassName, state.showMoreButton.className);
|
|
33
|
+
}
|
|
34
|
+
if (state.showLessButton) {
|
|
35
|
+
state.showLessButton.className = mergeClasses(referenceListClassNames.showLessButton, overflowButtonBaseClassName, state.showLessButton.className);
|
|
36
|
+
}
|
|
37
|
+
return state;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=useReferenceListStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceListStyles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, tokens } from '@fluentui/react-components';\nimport type { ReferenceListSlots, ReferenceListState } from './ReferenceList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const referenceListClassNames: SlotClassNames<ReferenceListSlots> = {\n root: 'fai-ReferenceList',\n showMoreButton: 'fai-ReferenceList__showMoreButton',\n showLessButton: 'fai-ReferenceList__showLessButton',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n display: 'flex',\n flexDirection: 'row',\n gap: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS}`,\n});\n\nconst useRootStyles = makeStyles({\n referencesExpanded: {\n flexWrap: 'wrap',\n },\n});\n\nconst useOverflowButtonBaseClassName = makeResetStyles({\n flexShrink: 0,\n});\n\n/**\n * Apply styling to the ReferenceList slots based on the state\n */\nexport const useReferenceListStyles_unstable = (state: ReferenceListState): ReferenceListState => {\n const { areReferencesExpanded, shouldUseOverflow } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n const overflowButtonBaseClassName = useOverflowButtonBaseClassName();\n\n state.root.className = mergeClasses(\n referenceListClassNames.root,\n rootBaseClassName,\n (areReferencesExpanded || !shouldUseOverflow) && rootStyles.referencesExpanded,\n state.root.className,\n );\n\n if (state.showMoreButton) {\n state.showMoreButton.className = mergeClasses(\n referenceListClassNames.showMoreButton,\n overflowButtonBaseClassName,\n state.showMoreButton.className,\n );\n }\n\n if (state.showLessButton) {\n state.showLessButton.className = mergeClasses(\n referenceListClassNames.showLessButton,\n overflowButtonBaseClassName,\n state.showLessButton.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","referenceListClassNames","root","showMoreButton","showLessButton","useRootBaseClassName","display","flexDirection","gap","spacingVerticalXS","spacingHorizontalXS","useRootStyles","referencesExpanded","flexWrap","useOverflowButtonBaseClassName","flexShrink","useReferenceListStyles_unstable","state","areReferencesExpanded","shouldUseOverflow","rootBaseClassName","rootStyles","overflowButtonBaseClassName","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,EAAEC,MAAM,QAAQ,6BAA6B;AAI/F,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,gBAAgB;IAChBC,gBAAgB;AAClB,EAAE;AAEF;;CAEC,GACD,MAAMC,uBAAuBR,gBAAgB;IAC3CS,SAAS;IACTC,eAAe;IACfC,KAAK,CAAC,EAAER,OAAOS,iBAAiB,CAAC,CAAC,EAAET,OAAOU,mBAAmB,CAAC,CAAC;AAClE;AAEA,MAAMC,gBAAgBb,WAAW;IAC/Bc,oBAAoB;QAClBC,UAAU;IACZ;AACF;AAEA,MAAMC,iCAAiCjB,gBAAgB;IACrDkB,YAAY;AACd;AAEA;;CAEC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9C,MAAM,EAAEC,qBAAqB,EAAEC,iBAAiB,EAAE,GAAGF;IAErD,MAAMG,oBAAoBf;IAC1B,MAAMgB,aAAaV;IACnB,MAAMW,8BAA8BR;IAEpCG,MAAMf,IAAI,CAACqB,SAAS,GAAGxB,aACrBE,wBAAwBC,IAAI,EAC5BkB,mBACA,AAACF,CAAAA,yBAAyB,CAACC,iBAAgB,KAAME,WAAWT,kBAAkB,EAC9EK,MAAMf,IAAI,CAACqB,SAAS;IAGtB,IAAIN,MAAMd,cAAc,EAAE;QACxBc,MAAMd,cAAc,CAACoB,SAAS,GAAGxB,aAC/BE,wBAAwBE,cAAc,EACtCmB,6BACAL,MAAMd,cAAc,CAACoB,SAAS;IAElC;IAEA,IAAIN,MAAMb,cAAc,EAAE;QACxBa,MAAMb,cAAc,CAACmB,SAAS,GAAGxB,aAC/BE,wBAAwBG,cAAc,EACtCkB,6BACAL,MAAMb,cAAc,CAACmB,SAAS;IAElC;IAEA,OAAON;AACT,EAAE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useReferenceOverflowButton_unstable } from './useReferenceOverflowButton';
|
|
3
|
+
import { renderReferenceOverflowButton_unstable } from './renderReferenceOverflowButton';
|
|
4
|
+
import { useReferenceOverflowButtonStyles_unstable } from './useReferenceOverflowButtonStyles';
|
|
5
|
+
// ReferenceOverflowButton component - TODO: add more docs
|
|
6
|
+
export const ReferenceOverflowButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
|
+
const state = useReferenceOverflowButton_unstable(props, ref);
|
|
8
|
+
useReferenceOverflowButtonStyles_unstable(state);
|
|
9
|
+
return renderReferenceOverflowButton_unstable(state);
|
|
10
|
+
});
|
|
11
|
+
ReferenceOverflowButton.displayName = 'ReferenceOverflowButton';
|
|
12
|
+
//# sourceMappingURL=ReferenceOverflowButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceOverflowButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useReferenceOverflowButton_unstable } from './useReferenceOverflowButton';\nimport { renderReferenceOverflowButton_unstable } from './renderReferenceOverflowButton';\nimport { useReferenceOverflowButtonStyles_unstable } from './useReferenceOverflowButtonStyles';\nimport type { ReferenceOverflowButtonProps } from './ReferenceOverflowButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ReferenceOverflowButton component - TODO: add more docs\nexport const ReferenceOverflowButton: ForwardRefComponent<ReferenceOverflowButtonProps> = React.forwardRef(\n (props, ref) => {\n const state = useReferenceOverflowButton_unstable(props, ref);\n\n useReferenceOverflowButtonStyles_unstable(state);\n return renderReferenceOverflowButton_unstable(state);\n },\n);\n\nReferenceOverflowButton.displayName = 'ReferenceOverflowButton';\n"],"names":["React","useReferenceOverflowButton_unstable","renderReferenceOverflowButton_unstable","useReferenceOverflowButtonStyles_unstable","ReferenceOverflowButton","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mCAAmC,QAAQ,+BAA+B;AACnF,SAASC,sCAAsC,QAAQ,kCAAkC;AACzF,SAASC,yCAAyC,QAAQ,qCAAqC;AAI/F,0DAA0D;AAC1D,OAAO,MAAMC,wCAA6EJ,MAAMK,UAAU,CACxG,CAACC,OAAOC;IACN,MAAMC,QAAQP,oCAAoCK,OAAOC;IAEzDJ,0CAA0CK;IAC1C,OAAON,uCAAuCM;AAChD,GACA;AAEFJ,wBAAwBK,WAAW,GAAG"}
|
package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceOverflowButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type ReferenceOverflowButtonSlots = {\n root: Slot<'button'>;\n};\n\n/**\n * ReferenceOverflowButton Props\n */\nexport type ReferenceOverflowButtonProps = ComponentProps<ReferenceOverflowButtonSlots> & {\n /**\n * The appearance of the reference.\n * @default 'lighter'\n */\n appearance?: 'lighter' | 'darker';\n\n text?: string | ((overflowCount: number) => React.ReactNode);\n};\n\n/**\n * State used in rendering ReferenceOverflowButton\n */\nexport type ReferenceOverflowButtonState = ComponentState<ReferenceOverflowButtonSlots> &\n Required<Pick<ReferenceOverflowButtonProps, 'appearance'>> & {\n shouldRenderOverflowButton: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAmBA;;CAEC,GACD,WAGI"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './ReferenceOverflowButton';
|
|
2
|
+
export * from './ReferenceOverflowButton.types';
|
|
3
|
+
export * from './renderReferenceOverflowButton';
|
|
4
|
+
export * from './useReferenceOverflowButton';
|
|
5
|
+
export * from './useReferenceOverflowButtonStyles';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ReferenceOverflowButton';\nexport * from './ReferenceOverflowButton.types';\nexport * from './renderReferenceOverflowButton';\nexport * from './useReferenceOverflowButton';\nexport * from './useReferenceOverflowButtonStyles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,4BAA4B;AAC1C,cAAc,kCAAkC;AAChD,cAAc,kCAAkC;AAChD,cAAc,+BAA+B;AAC7C,cAAc,qCAAqC"}
|
|
@@ -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 ReferenceOverflowButton
|
|
5
|
+
*/
|
|
6
|
+
export const renderReferenceOverflowButton_unstable = state => {
|
|
7
|
+
assertSlots(state);
|
|
8
|
+
return state.shouldRenderOverflowButton ? /*#__PURE__*/_jsx(state.root, {}) : null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=renderReferenceOverflowButton.js.map
|
package/lib/components/reference-v2/ReferenceOverflowButton/renderReferenceOverflowButton.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderReferenceOverflowButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { ReferenceOverflowButtonState, ReferenceOverflowButtonSlots } from './ReferenceOverflowButton.types';\n\n/**\n * Render the final JSX of ReferenceOverflowButton\n */\nexport const renderReferenceOverflowButton_unstable = (state: ReferenceOverflowButtonState) => {\n assertSlots<ReferenceOverflowButtonSlots>(state);\n\n return state.shouldRenderOverflowButton ? <state.root /> : null;\n};\n"],"names":["assertSlots","renderReferenceOverflowButton_unstable","state","shouldRenderOverflowButton","root"],"rangeMappings":";;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,yCAAyC,CAACC;IACrDF,YAA0CE;IAE1C,OAAOA,MAAMC,0BAA0B,iBAAG,KAACD,MAAME,IAAI,QAAM;AAC7D,EAAE"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Enter, Space } from '@fluentui/keyboard-keys';
|
|
3
|
+
import { getIntrinsicElementProps, mergeCallbacks, slot, useFocusFinders, useMergedRefs, useOverflowMenu } from '@fluentui/react-components';
|
|
4
|
+
import { useTimeout } from '@fluentui/react-utilities';
|
|
5
|
+
import { useReferenceListContext_unstable } from '../../../contexts/reference-v2/referenceListContext';
|
|
6
|
+
/**
|
|
7
|
+
* Create the state required to render ReferenceOverflowButton.
|
|
8
|
+
*
|
|
9
|
+
* The returned state can be modified with hooks such as useReferenceOverflowButtonStyles_unstable,
|
|
10
|
+
* before being passed to renderReferenceOverflowButton_unstable.
|
|
11
|
+
*
|
|
12
|
+
* @param props - props from this instance of ReferenceOverflowButton
|
|
13
|
+
* @param ref - reference to root HTMLElement of ReferenceOverflowButton
|
|
14
|
+
*/
|
|
15
|
+
export const useReferenceOverflowButton_unstable = (props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
children,
|
|
18
|
+
text
|
|
19
|
+
} = props;
|
|
20
|
+
const rootRef = React.useRef(null);
|
|
21
|
+
const [setTimeout] = useTimeout();
|
|
22
|
+
const {
|
|
23
|
+
areReferencesExpanded,
|
|
24
|
+
ctxAppearance,
|
|
25
|
+
previousOverflowCount,
|
|
26
|
+
triggeredViaKeyboard
|
|
27
|
+
} = useReferenceListContext_unstable(ctx => ({
|
|
28
|
+
ctxAppearance: ctx.appearance,
|
|
29
|
+
areReferencesExpanded: ctx.areReferencesExpanded,
|
|
30
|
+
previousOverflowCount: ctx.previousOverflowCount,
|
|
31
|
+
triggeredViaKeyboard: ctx.overflowButtonTriggeredViaKeyboard
|
|
32
|
+
}));
|
|
33
|
+
const appearance = props.appearance || ctxAppearance;
|
|
34
|
+
const {
|
|
35
|
+
isOverflowing,
|
|
36
|
+
overflowCount
|
|
37
|
+
} = useOverflowMenu();
|
|
38
|
+
const processedText = children !== null && children !== void 0 ? children : typeof text === 'function' ? text(overflowCount) : text;
|
|
39
|
+
const {
|
|
40
|
+
findPrevFocusable
|
|
41
|
+
} = useFocusFinders();
|
|
42
|
+
const onKeyDown = React.useCallback(ev => {
|
|
43
|
+
if (ev.key === Enter || ev.key === Space) {
|
|
44
|
+
triggeredViaKeyboard.current = true;
|
|
45
|
+
}
|
|
46
|
+
}, [triggeredViaKeyboard]);
|
|
47
|
+
// When the references are expanded or contracted via keyboard, we need to move focus to the appropriate element.
|
|
48
|
+
React.useEffect(() => {
|
|
49
|
+
if (triggeredViaKeyboard.current) {
|
|
50
|
+
let elementToFocus;
|
|
51
|
+
// If the references are contracted, we move focus to the overflow button.
|
|
52
|
+
if (!areReferencesExpanded) {
|
|
53
|
+
elementToFocus = rootRef.current;
|
|
54
|
+
} else if (rootRef.current && previousOverflowCount) {
|
|
55
|
+
let currentElement = rootRef.current;
|
|
56
|
+
for (let i = 0; i < previousOverflowCount.current && currentElement; i++) {
|
|
57
|
+
currentElement = findPrevFocusable(currentElement);
|
|
58
|
+
}
|
|
59
|
+
elementToFocus = currentElement;
|
|
60
|
+
}
|
|
61
|
+
// We focus on the element and reset the triggeredViaKeyboard flag after a timeout to ensure that this is pushed at the end of the event queue.
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
elementToFocus === null || elementToFocus === void 0 ? void 0 : elementToFocus.focus();
|
|
64
|
+
triggeredViaKeyboard.current = false;
|
|
65
|
+
}, 0);
|
|
66
|
+
}
|
|
67
|
+
// We update the previousOverflowCount to the current one when references are contracted, so that we have the correct number once they are expanded.
|
|
68
|
+
previousOverflowCount.current = areReferencesExpanded ? 0 : overflowCount;
|
|
69
|
+
},
|
|
70
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
71
|
+
[areReferencesExpanded, isOverflowing, triggeredViaKeyboard]);
|
|
72
|
+
const state = {
|
|
73
|
+
appearance,
|
|
74
|
+
shouldRenderOverflowButton: isOverflowing || areReferencesExpanded,
|
|
75
|
+
components: {
|
|
76
|
+
root: 'button'
|
|
77
|
+
},
|
|
78
|
+
root: slot.always(getIntrinsicElementProps('button', {
|
|
79
|
+
ref: useMergedRefs(rootRef, ref),
|
|
80
|
+
...props
|
|
81
|
+
}), {
|
|
82
|
+
defaultProps: {
|
|
83
|
+
children: processedText
|
|
84
|
+
},
|
|
85
|
+
elementType: 'button'
|
|
86
|
+
})
|
|
87
|
+
};
|
|
88
|
+
state.root.onKeyDown = mergeCallbacks(onKeyDown, props.onKeyDown);
|
|
89
|
+
return state;
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=useReferenceOverflowButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceOverflowButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport {\n getIntrinsicElementProps,\n mergeCallbacks,\n slot,\n useFocusFinders,\n useMergedRefs,\n useOverflowMenu,\n} from '@fluentui/react-components';\nimport { useTimeout } from '@fluentui/react-utilities';\nimport { useReferenceListContext_unstable } from '../../../contexts/reference-v2/referenceListContext';\nimport type { ReferenceOverflowButtonProps, ReferenceOverflowButtonState } from './ReferenceOverflowButton.types';\n\n/**\n * Create the state required to render ReferenceOverflowButton.\n *\n * The returned state can be modified with hooks such as useReferenceOverflowButtonStyles_unstable,\n * before being passed to renderReferenceOverflowButton_unstable.\n *\n * @param props - props from this instance of ReferenceOverflowButton\n * @param ref - reference to root HTMLElement of ReferenceOverflowButton\n */\nexport const useReferenceOverflowButton_unstable = (\n props: ReferenceOverflowButtonProps,\n ref: React.Ref<HTMLButtonElement>,\n): ReferenceOverflowButtonState => {\n const { children, text } = props;\n\n const rootRef = React.useRef<HTMLButtonElement>(null);\n\n const [setTimeout] = useTimeout();\n\n const { areReferencesExpanded, ctxAppearance, previousOverflowCount, triggeredViaKeyboard } =\n useReferenceListContext_unstable(ctx => ({\n ctxAppearance: ctx.appearance,\n areReferencesExpanded: ctx.areReferencesExpanded,\n previousOverflowCount: ctx.previousOverflowCount,\n triggeredViaKeyboard: ctx.overflowButtonTriggeredViaKeyboard,\n }));\n const appearance = props.appearance || ctxAppearance;\n\n const { isOverflowing, overflowCount } = useOverflowMenu();\n\n const processedText = children ?? (typeof text === 'function' ? text(overflowCount) : text);\n\n const { findPrevFocusable } = useFocusFinders();\n const onKeyDown = React.useCallback<React.KeyboardEventHandler<HTMLButtonElement>>(\n ev => {\n if (ev.key === Enter || ev.key === Space) {\n triggeredViaKeyboard.current = true;\n }\n },\n [triggeredViaKeyboard],\n );\n\n // When the references are expanded or contracted via keyboard, we need to move focus to the appropriate element.\n React.useEffect(\n () => {\n if (triggeredViaKeyboard.current) {\n let elementToFocus: HTMLElement | null | undefined;\n\n // If the references are contracted, we move focus to the overflow button.\n if (!areReferencesExpanded) {\n elementToFocus = rootRef.current;\n }\n // If the references are expanded, we move focus to the first reference that was hidden when they were contracted.\n // We do this by moving focus to the element that is overflowCount elements before the overflow button.\n else if (rootRef.current && previousOverflowCount) {\n let currentElement: HTMLElement | null | undefined = rootRef.current;\n for (let i = 0; i < previousOverflowCount.current && currentElement; i++) {\n currentElement = findPrevFocusable(currentElement);\n }\n elementToFocus = currentElement;\n }\n\n // We focus on the element and reset the triggeredViaKeyboard flag after a timeout to ensure that this is pushed at the end of the event queue.\n setTimeout(() => {\n elementToFocus?.focus();\n triggeredViaKeyboard.current = false;\n }, 0);\n }\n\n // We update the previousOverflowCount to the current one when references are contracted, so that we have the correct number once they are expanded.\n previousOverflowCount.current = areReferencesExpanded ? 0 : overflowCount;\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [areReferencesExpanded, isOverflowing, triggeredViaKeyboard],\n );\n\n const state: ReferenceOverflowButtonState = {\n appearance,\n shouldRenderOverflowButton: isOverflowing || areReferencesExpanded,\n\n components: {\n root: 'button',\n },\n\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref: useMergedRefs(rootRef, ref),\n ...props,\n }),\n {\n defaultProps: {\n children: processedText,\n },\n elementType: 'button',\n },\n ),\n };\n\n state.root.onKeyDown = mergeCallbacks(onKeyDown, props.onKeyDown);\n\n return state;\n};\n"],"names":["React","Enter","Space","getIntrinsicElementProps","mergeCallbacks","slot","useFocusFinders","useMergedRefs","useOverflowMenu","useTimeout","useReferenceListContext_unstable","useReferenceOverflowButton_unstable","props","ref","children","text","rootRef","useRef","setTimeout","areReferencesExpanded","ctxAppearance","previousOverflowCount","triggeredViaKeyboard","ctx","appearance","overflowButtonTriggeredViaKeyboard","isOverflowing","overflowCount","processedText","findPrevFocusable","onKeyDown","useCallback","ev","key","current","useEffect","elementToFocus","currentElement","i","focus","state","shouldRenderOverflowButton","components","root","always","defaultProps","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,EAAEC,KAAK,QAAQ,0BAA0B;AACvD,SACEC,wBAAwB,EACxBC,cAAc,EACdC,IAAI,EACJC,eAAe,EACfC,aAAa,EACbC,eAAe,QACV,6BAA6B;AACpC,SAASC,UAAU,QAAQ,4BAA4B;AACvD,SAASC,gCAAgC,QAAQ,sDAAsD;AAGvG;;;;;;;;CAQC,GACD,OAAO,MAAMC,sCAAsC,CACjDC,OACAC;IAEA,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGH;IAE3B,MAAMI,UAAUhB,MAAMiB,MAAM,CAAoB;IAEhD,MAAM,CAACC,WAAW,GAAGT;IAErB,MAAM,EAAEU,qBAAqB,EAAEC,aAAa,EAAEC,qBAAqB,EAAEC,oBAAoB,EAAE,GACzFZ,iCAAiCa,CAAAA,MAAQ,CAAA;YACvCH,eAAeG,IAAIC,UAAU;YAC7BL,uBAAuBI,IAAIJ,qBAAqB;YAChDE,uBAAuBE,IAAIF,qBAAqB;YAChDC,sBAAsBC,IAAIE,kCAAkC;QAC9D,CAAA;IACF,MAAMD,aAAaZ,MAAMY,UAAU,IAAIJ;I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;YACZ;YACAkB,aAAa;QACf;IAEJ;IAEAN,MAAMG,IAAI,CAACb,SAAS,GAAG1B,eAAe0B,WAAWlB,MAAMkB,SAAS;IAEhE,OAAOU;AACT,EAAE"}
|
package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { __resetStyles, __styles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';
|
|
2
|
+
export const referenceOverflowButtonClassNames = {
|
|
3
|
+
root: 'fai-ReferenceOverflowButton'
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Styles for the root slot
|
|
7
|
+
*/
|
|
8
|
+
const useRootBaseClassName = __resetStyles("rbsq19a", null, [".rbsq19a{background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);border-radius:var(--borderRadiusMedium);color:var(--colorNeutralForeground2);display:inline-flex;padding:var(--spacingVerticalXXS) var(--spacingHorizontalS);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}", ".rbsq19a:hover{background-color:var(--colorNeutralBackground3Hover);border-color:var(--colorNeutralStroke1Hover);color:var(--colorNeutralForeground2Hover);}", ".rbsq19a:hover:active{background-color:var(--colorNeutralBackground3Pressed);border-color:var(--colorNeutralStroke1Pressed);color:var(--colorNeutralForeground2Pressed);}"]);
|
|
9
|
+
const useRootStyles = __styles({
|
|
10
|
+
darker: {
|
|
11
|
+
De3pzq: "f3vzo32",
|
|
12
|
+
g2u3we: "fj3muxo",
|
|
13
|
+
h3c5rm: ["f1akhkt", "f1lxtadh"],
|
|
14
|
+
B9xav0g: "f1aperda",
|
|
15
|
+
zhjwy3: ["f1lxtadh", "f1akhkt"],
|
|
16
|
+
Jwef8y: "f14vf7cg",
|
|
17
|
+
iro3zm: "fho4vwd"
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
20
|
+
d: [".f3vzo32{background-color:var(--colorNeutralBackground5);}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}"],
|
|
21
|
+
h: [".f14vf7cg:hover{background-color:var(--colorNeutralBackground5Hover);}", ".fho4vwd:hover:active{background-color:var(--colorNeutralBackground5Pressed);}"]
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Apply styling to the ReferenceOverflowButton slots based on the state
|
|
25
|
+
*/
|
|
26
|
+
export const useReferenceOverflowButtonStyles_unstable = state => {
|
|
27
|
+
const {
|
|
28
|
+
appearance
|
|
29
|
+
} = state;
|
|
30
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
31
|
+
const rootStyles = useRootStyles();
|
|
32
|
+
state.root.className = mergeClasses(referenceOverflowButtonClassNames.root, rootBaseClassName, appearance === 'darker' && rootStyles.darker, state.root.className);
|
|
33
|
+
return state;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=useReferenceOverflowButtonStyles.js.map
|
package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceOverflowButtonStyles.ts"],"sourcesContent":["import {\n makeResetStyles,\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport type { ReferenceOverflowButtonSlots, ReferenceOverflowButtonState } from './ReferenceOverflowButton.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const referenceOverflowButtonClassNames: SlotClassNames<ReferenceOverflowButtonSlots> = {\n root: 'fai-ReferenceOverflowButton',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground2,\n display: 'inline-flex',\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalS}`,\n ...typographyStyles.caption1,\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground3Hover,\n borderColor: tokens.colorNeutralStroke1Hover,\n color: tokens.colorNeutralForeground2Hover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n borderColor: tokens.colorNeutralStroke1Pressed,\n color: tokens.colorNeutralForeground2Pressed,\n },\n});\n\nconst useRootStyles = makeStyles({\n darker: {\n backgroundColor: tokens.colorNeutralBackground5,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground5Hover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground5Pressed,\n },\n },\n});\n\n/**\n * Apply styling to the ReferenceOverflowButton slots based on the state\n */\nexport const useReferenceOverflowButtonStyles_unstable = (\n state: ReferenceOverflowButtonState,\n): ReferenceOverflowButtonState => {\n const { appearance } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n\n state.root.className = mergeClasses(\n referenceOverflowButtonClassNames.root,\n rootBaseClassName,\n appearance === 'darker' && rootStyles.darker,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","shorthands","tokens","typographyStyles","referenceOverflowButtonClassNames","root","useRootBaseClassName","backgroundColor","colorNeutralBackground3","border","strokeWidthThin","colorNeutralStroke2","borderRadius","borderRadiusMedium","color","colorNeutralForeground2","display","padding","spacingVerticalXXS","spacingHorizontalS","caption1","colorNeutralBackground3Hover","borderColor","colorNeutralStroke1Hover","colorNeutralForeground2Hover","colorNeutralBackground3Pressed","colorNeutralStroke1Pressed","colorNeutralForeground2Pressed","useRootStyles","darker","colorNeutralBackground5","colorNeutralStroke1","colorNeutralBackground5Hover","colorNeutralBackground5Pressed","useReferenceOverflowButtonStyles_unstable","state","appearance","rootBaseClassName","rootStyles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,eAAe,EACfC,UAAU,EACVC,YAAY,EACZC,UAAU,EACVC,MAAM,EACNC,gBAAgB,QACX,6BAA6B;AAIpC,OAAO,MAAMC,oCAAkF;IAC7FC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,uBAAuBR,gBAAgB;IAC3CS,iBAAiBL,OAAOM,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEP,OAAOQ,eAAe,CAAC,OAAO,EAAER,OAAOS,mBAAmB,CAAC,CAAC;IACvEC,cAAcV,OAAOW,kBAAkB;IACvCC,OAAOZ,OAAOa,uBAAuB;IACrCC,SAAS;IACTC,SAAS,CAAC,EAAEf,OAAOgB,kBAAkB,CAAC,CAAC,EAAEhB,OAAOiB,kBAAkB,CAAC,CAAC;IACpE,GAAGhB,iBAAiBiB,QAAQ;IAE5B,UAAU;QACRb,iBAAiBL,OAAOmB,4BAA4B;QACpDC,aAAapB,OAAOqB,wBAAwB;QAC5CT,OAAOZ,OAAOsB,4BAA4B;IAC5C;IAEA,iBAAiB;QACfjB,iBAAiBL,OAAOuB,8BAA8B;QACtDH,aAAapB,OAAOwB,0BAA0B;QAC9CZ,OAAOZ,OAAOyB,8BAA8B;IAC9C;AACF;AAEA,MAAMC,gBAAgB7B,WAAW;IAC/B8B,QAAQ;QACNtB,iBAAiBL,OAAO4B,uBAAuB;QAC/C,GAAG7B,WAAWqB,WAAW,CAACpB,OAAO6B,mBAAmB,CAAC;QAErD,UAAU;YACRxB,iBAAiBL,OAAO8B,4BAA4B;QACtD;QAEA,iBAAiB;YACfzB,iBAAiBL,OAAO+B,8BAA8B;QACxD;IACF;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,4CAA4C,CACvDC;IAEA,MAAM,EAAEC,UAAU,EAAE,GAAGD;IAEvB,MAAME,oBAAoB/B;IAC1B,MAAMgC,aAAaV;IAEnBO,MAAM9B,IAAI,CAACkC,SAAS,GAAGvC,aACrBI,kCAAkCC,IAAI,EACtCgC,mBACAD,eAAe,YAAYE,WAAWT,MAAM,EAC5CM,MAAM9B,IAAI,CAACkC,SAAS;IAGtB,OAAOJ;AACT,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Reference';\nexport * from './ReferenceList';\nexport * from './ReferenceOverflowButton';\n"],"names":[],"rangeMappings":";;","mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,kBAAkB;AAChC,cAAc,4BAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ReferenceGroupContext.ts"],"sourcesContent":["import * as React from 'react';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nexport type ReferenceGroupContext = {\n open?: boolean;\n setOpen: () => void;\n};\n\nconst ReferenceGroupContext = React.createContext<ReferenceGroupContext | undefined>(undefined);\n\nexport const ReferenceGroupProvider = ReferenceGroupContext.Provider;\n\nexport const useReferenceGroupSetOpen = (): (() => void) => {\n const context = React.useContext(ReferenceGroupContext);\n return context?.setOpen ?? noop;\n};\n"],"names":["React","noop","ReferenceGroupContext","createContext","undefined","ReferenceGroupProvider","Provider","useReferenceGroupSetOpen","context","useContext","setOpen"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,gEAAgE;AAChE,MAAMC,OAAO,KAAO;AAOpB,MAAMC,wBAAwBF,MAAMG,aAAa,CAAoCC;AAErF,OAAO,MAAMC,yBAAyBH,sBAAsBI,QAAQ,CAAC;AAErE,OAAO,MAAMC,2BAA2B;IACtC,MAAMC,UAAUR,MAAMS,UAAU,CAACP;QAC1BM;IAAP,OAAOA,CAAAA,mBAAAA,oBAAAA,8BAAAA,QAASE,OAAO,cAAhBF,8BAAAA,mBAAoBP;AAC7B,EAAE"}
|
|
1
|
+
{"version":3,"sources":["ReferenceGroupContext.ts"],"sourcesContent":["import * as React from 'react';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nexport type ReferenceGroupContext = {\n open?: boolean;\n setOpen: () => void;\n};\n\nconst ReferenceGroupContext = React.createContext<ReferenceGroupContext | undefined>(undefined);\n\nexport const ReferenceGroupProvider = ReferenceGroupContext.Provider;\n\nexport const useReferenceGroupSetOpen = (): (() => void) => {\n const context = React.useContext(ReferenceGroupContext);\n return context?.setOpen ?? noop;\n};\n"],"names":["React","noop","ReferenceGroupContext","createContext","undefined","ReferenceGroupProvider","Provider","useReferenceGroupSetOpen","context","useContext","setOpen"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,gEAAgE;AAChE,MAAMC,OAAO,KAAO;AAOpB,MAAMC,wBAAwBF,MAAMG,aAAa,CAAoCC;AAErF,OAAO,MAAMC,yBAAyBH,sBAAsBI,QAAQ,CAAC;AAErE,OAAO,MAAMC,2BAA2B;IACtC,MAAMC,UAAUR,MAAMS,UAAU,CAACP;QAC1BM;IAAP,OAAOA,CAAAA,mBAAAA,oBAAAA,8BAAAA,QAASE,OAAO,cAAhBF,8BAAAA,mBAAoBP;AAC7B,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './referenceListContext';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,yBAAyB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext, useContextSelector } from '@fluentui/react-context-selector';
|
|
2
|
+
export const ReferenceListContext = createContext(undefined);
|
|
3
|
+
const referenceListContextDefaultValue = {
|
|
4
|
+
appearance: 'lighter',
|
|
5
|
+
areReferencesExpanded: false,
|
|
6
|
+
overflowButtonTriggeredViaKeyboard: {
|
|
7
|
+
current: false
|
|
8
|
+
},
|
|
9
|
+
previousOverflowCount: {
|
|
10
|
+
current: 0
|
|
11
|
+
},
|
|
12
|
+
shouldUseOverflow: false
|
|
13
|
+
};
|
|
14
|
+
export const ReferenceListContextProvider = ReferenceListContext.Provider;
|
|
15
|
+
export const useReferenceListContext_unstable = selector => useContextSelector(ReferenceListContext, (ctx = referenceListContextDefaultValue) => selector(ctx));
|
|
16
|
+
//# sourceMappingURL=referenceListContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["referenceListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context, ContextSelector } from '@fluentui/react-context-selector';\nimport type { ReferenceListState } from '../../ReferenceListV2';\n\n/**\n * Context shared between ReferenceList and its children components\n */\nexport type ReferenceListContextValue = Pick<\n ReferenceListState,\n | 'appearance'\n | 'areReferencesExpanded'\n | 'overflowButtonTriggeredViaKeyboard'\n | 'previousOverflowCount'\n | 'shouldUseOverflow'\n>;\n\nexport const ReferenceListContext: Context<ReferenceListContextValue> = createContext<\n ReferenceListContextValue | undefined\n>(undefined) as Context<ReferenceListContextValue>;\n\nconst referenceListContextDefaultValue: ReferenceListContextValue = {\n appearance: 'lighter',\n areReferencesExpanded: false,\n overflowButtonTriggeredViaKeyboard: { current: false },\n previousOverflowCount: { current: 0 },\n shouldUseOverflow: false,\n};\n\nexport const ReferenceListContextProvider = ReferenceListContext.Provider;\n\nexport const useReferenceListContext_unstable = <T>(selector: ContextSelector<ReferenceListContextValue, T>) =>\n useContextSelector(ReferenceListContext, (ctx = referenceListContextDefaultValue) => selector(ctx));\n"],"names":["createContext","useContextSelector","ReferenceListContext","undefined","referenceListContextDefaultValue","appearance","areReferencesExpanded","overflowButtonTriggeredViaKeyboard","current","previousOverflowCount","shouldUseOverflow","ReferenceListContextProvider","Provider","useReferenceListContext_unstable","selector","ctx"],"rangeMappings":";;;;;;;;;;;;;;","mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,mCAAmC;AAgBrF,OAAO,MAAMC,uBAA2DF,cAEtEG,WAAiD;AAEnD,MAAMC,mCAA8D;IAClEC,YAAY;IACZC,uBAAuB;IACvBC,oCAAoC;QAAEC,SAAS;IAAM;IACrDC,uBAAuB;QAAED,SAAS;IAAE;IACpCE,mBAAmB;AACrB;AAEA,OAAO,MAAMC,+BAA+BT,qBAAqBU,QAAQ,CAAC;AAE1E,OAAO,MAAMC,mCAAmC,CAAIC,WAClDb,mBAAmBC,sBAAsB,CAACa,MAAMX,gCAAgC,GAAKU,SAASC,MAAM"}
|
package/lib/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './useReferenceCitationPreview';\nexport * from './useReferenceGroup';\n"],"names":[],"mappings":"AAAA,cAAc,gCAAgC;AAC9C,cAAc,sBAAsB"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './useReferenceCitationPreview';\nexport * from './useReferenceGroup';\n"],"names":[],"rangeMappings":";","mappings":"AAAA,cAAc,gCAAgC;AAC9C,cAAc,sBAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './useReferenceCitationPreview';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,gCAAgC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { mergeCallbacks, usePopoverContext_unstable } from '@fluentui/react-components';
|
|
4
|
+
import { Preview, PreviewContent, PreviewHeader, PreviewMetadata, PreviewSurface, PreviewTrigger } from '@fluentui-copilot/react-preview';
|
|
5
|
+
import { SensitivityLabel } from '@fluentui-copilot/react-sensitivity-label';
|
|
6
|
+
import { Citation } from '../../Citation';
|
|
7
|
+
import { Reference } from '../../ReferenceV2';
|
|
8
|
+
// Abstract the citation that serves as the close button of the Preview into its own component so that we have access to the popover context.
|
|
9
|
+
const CitationCloseButton = citationCloseButtonProps => {
|
|
10
|
+
const setPopoverOpen = usePopoverContext_unstable(context => context.setOpen);
|
|
11
|
+
const onPopoverCloseClick = React.useCallback(ev => {
|
|
12
|
+
setPopoverOpen(ev, false);
|
|
13
|
+
// Don't navigate
|
|
14
|
+
ev.preventDefault();
|
|
15
|
+
}, [setPopoverOpen]);
|
|
16
|
+
const onCitationCloseButtonClick = mergeCallbacks(onPopoverCloseClick, citationCloseButtonProps.onClick);
|
|
17
|
+
return /*#__PURE__*/_jsx(Citation, {
|
|
18
|
+
...citationCloseButtonProps,
|
|
19
|
+
onClick: onCitationCloseButtonClick
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export const useReferenceCitationPreview = props => {
|
|
23
|
+
const {
|
|
24
|
+
citationPreviewProps,
|
|
25
|
+
citationPreviewSurfaceProps,
|
|
26
|
+
citationProps,
|
|
27
|
+
index,
|
|
28
|
+
previewContentProps,
|
|
29
|
+
referencePreviewProps,
|
|
30
|
+
referencePreviewSurfaceProps,
|
|
31
|
+
referenceProps,
|
|
32
|
+
sensitivityLabelProps
|
|
33
|
+
} = props;
|
|
34
|
+
const components = React.useMemo(() => {
|
|
35
|
+
const citationWithPreview = props => {
|
|
36
|
+
var _previewContentProps_content;
|
|
37
|
+
return /*#__PURE__*/_jsxs(Preview, {
|
|
38
|
+
closeOnScroll: true,
|
|
39
|
+
positioning: "below",
|
|
40
|
+
size: "small",
|
|
41
|
+
trapFocus: true,
|
|
42
|
+
withArrow: true,
|
|
43
|
+
...citationPreviewProps,
|
|
44
|
+
children: [/*#__PURE__*/_jsx(PreviewTrigger, {
|
|
45
|
+
children: /*#__PURE__*/_jsx(Citation, {
|
|
46
|
+
...citationProps,
|
|
47
|
+
...props,
|
|
48
|
+
children: index
|
|
49
|
+
})
|
|
50
|
+
}), /*#__PURE__*/_jsx(PreviewSurface, {
|
|
51
|
+
...citationPreviewSurfaceProps,
|
|
52
|
+
children: /*#__PURE__*/_jsxs(PreviewContent, {
|
|
53
|
+
children: [/*#__PURE__*/_jsx(PreviewHeader, {
|
|
54
|
+
citation: /*#__PURE__*/_jsx(CitationCloseButton, {
|
|
55
|
+
"aria-label": `Reference ${index}, close`,
|
|
56
|
+
referenceHref: "#",
|
|
57
|
+
tabIndex: -1,
|
|
58
|
+
children: index
|
|
59
|
+
}),
|
|
60
|
+
media: referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.media,
|
|
61
|
+
children: referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.children
|
|
62
|
+
}), /*#__PURE__*/_jsx(PreviewMetadata, {
|
|
63
|
+
icon: previewContentProps === null || previewContentProps === void 0 ? void 0 : previewContentProps.icon,
|
|
64
|
+
primaryText: previewContentProps === null || previewContentProps === void 0 ? void 0 : previewContentProps.primaryText,
|
|
65
|
+
secondaryText: previewContentProps === null || previewContentProps === void 0 ? void 0 : previewContentProps.secondaryText,
|
|
66
|
+
tertiaryText: previewContentProps === null || previewContentProps === void 0 ? void 0 : previewContentProps.tertiaryText
|
|
67
|
+
}), sensitivityLabelProps && /*#__PURE__*/_jsx(SensitivityLabel, {
|
|
68
|
+
...sensitivityLabelProps
|
|
69
|
+
}), (_previewContentProps_content = previewContentProps === null || previewContentProps === void 0 ? void 0 : previewContentProps.content) !== null && _previewContentProps_content !== void 0 ? _previewContentProps_content : citationPreviewProps === null || citationPreviewProps === void 0 ? void 0 : citationPreviewProps.children]
|
|
70
|
+
})
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const referenceWithPreview = props => {
|
|
75
|
+
var _previewContentProps_content;
|
|
76
|
+
return /*#__PURE__*/_jsxs(Preview, {
|
|
77
|
+
closeOnScroll: true,
|
|
78
|
+
positioning: "below",
|
|
79
|
+
size: "small",
|
|
80
|
+
trapFocus: true,
|
|
81
|
+
withArrow: true,
|
|
82
|
+
...referencePreviewProps,
|
|
83
|
+
children: [/*#__PURE__*/_jsx(PreviewTrigger, {
|
|
84
|
+
children: /*#__PURE__*/_jsx(Reference, {
|
|
85
|
+
citation: index,
|
|
86
|
+
...referenceProps,
|
|
87
|
+
...props
|
|
88
|
+
})
|
|
89
|
+
}), /*#__PURE__*/_jsx(PreviewSurface, {
|
|
90
|
+
...referencePreviewSurfaceProps,
|
|
91
|
+
children: /*#__PURE__*/_jsxs(PreviewContent, {
|
|
92
|
+
children: [/*#__PURE__*/_jsx(PreviewHeader, {
|
|
93
|
+
citation: /*#__PURE__*/_jsx(CitationCloseButton, {
|
|
94
|
+
"aria-label": `Reference ${index}, close`,
|
|
95
|
+
referenceHref: "#",
|
|
96
|
+
tabIndex: -1,
|
|
97
|
+
children: index
|
|
98
|
+
}),
|
|
99
|
+
media: referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.media,
|
|
100
|
+
children: referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.children
|
|
101
|
+
}), /*#__PURE__*/_jsx(PreviewMetadata, {
|
|
102
|
+
icon: previewContentProps === null || previewContentProps === void 0 ? void 0 : previewContentProps.icon,
|
|
103
|
+
primaryText: previewContentProps === null || previewContentProps === void 0 ? void 0 : previewContentProps.primaryText,
|
|
104
|
+
secondaryText: previewContentProps === null || previewContentProps === void 0 ? void 0 : previewContentProps.secondaryText,
|
|
105
|
+
tertiaryText: previewContentProps === null || previewContentProps === void 0 ? void 0 : previewContentProps.tertiaryText
|
|
106
|
+
}), sensitivityLabelProps && /*#__PURE__*/_jsx(SensitivityLabel, {
|
|
107
|
+
...sensitivityLabelProps
|
|
108
|
+
}), (_previewContentProps_content = previewContentProps === null || previewContentProps === void 0 ? void 0 : previewContentProps.content) !== null && _previewContentProps_content !== void 0 ? _previewContentProps_content : referencePreviewProps === null || referencePreviewProps === void 0 ? void 0 : referencePreviewProps.children]
|
|
109
|
+
})
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
return {
|
|
114
|
+
Citation: citationWithPreview,
|
|
115
|
+
Reference: referenceWithPreview
|
|
116
|
+
};
|
|
117
|
+
}, [citationPreviewProps, citationPreviewSurfaceProps, citationProps, index, referencePreviewProps, referencePreviewSurfaceProps, referenceProps, previewContentProps, sensitivityLabelProps]);
|
|
118
|
+
return components;
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=useReferenceCitationPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceCitationPreview.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\n\nimport { mergeCallbacks, usePopoverContext_unstable } from '@fluentui/react-components';\n\nimport {\n Preview,\n PreviewContent,\n PreviewHeader,\n PreviewMetadata,\n PreviewSurface,\n PreviewTrigger,\n} from '@fluentui-copilot/react-preview';\nimport { SensitivityLabel } from '@fluentui-copilot/react-sensitivity-label';\nimport type {\n PreviewHeaderProps,\n PreviewMetadataProps,\n PreviewProps,\n PreviewSurfaceProps,\n} from '@fluentui-copilot/react-preview';\nimport type { SensitivityLabelProps } from '@fluentui-copilot/react-sensitivity-label';\n\nimport { Citation } from '../../Citation';\nimport { Reference } from '../../ReferenceV2';\nimport type { CitationProps } from '../../Citation';\nimport type { ReferenceProps } from '../../ReferenceV2';\n\nexport type PackagedCitation = React.FC<CitationProps>;\n\nexport type PackagedReference = React.FC<ReferenceProps>;\n\nexport type PackagedPreviewContentProps = Pick<\n PreviewMetadataProps,\n 'icon' | 'primaryText' | 'secondaryText' | 'tertiaryText'\n> & {\n content?: React.ReactNode;\n};\n\nexport type UseReferenceCitationPreviewProps = {\n citationPreviewProps?: PreviewProps;\n citationPreviewSurfaceProps?: PreviewSurfaceProps;\n citationProps?: CitationProps;\n index: number;\n previewContentProps?: PackagedPreviewContentProps;\n referencePreviewProps?: PreviewProps;\n referencePreviewSurfaceProps?: PreviewSurfaceProps;\n referenceProps?: ReferenceProps;\n sensitivityLabelProps?: SensitivityLabelProps;\n};\n\nexport type UseReferenceCitationPreview = (props: UseReferenceCitationPreviewProps) => {\n Citation: PackagedCitation;\n Reference: PackagedReference;\n};\n\n// Abstract the citation that serves as the close button of the Preview into its own component so that we have access to the popover context.\nconst CitationCloseButton = (citationCloseButtonProps: CitationProps) => {\n const setPopoverOpen = usePopoverContext_unstable(context => context.setOpen);\n\n const onPopoverCloseClick = React.useCallback<NonNullable<CitationProps['onClick']>>(\n ev => {\n setPopoverOpen(ev, false);\n\n // Don't navigate\n ev.preventDefault();\n },\n [setPopoverOpen],\n );\n\n const onCitationCloseButtonClick = mergeCallbacks(onPopoverCloseClick, citationCloseButtonProps.onClick);\n\n return <Citation {...citationCloseButtonProps} onClick={onCitationCloseButtonClick} />;\n};\n\nexport const useReferenceCitationPreview: UseReferenceCitationPreview = props => {\n const {\n citationPreviewProps,\n citationPreviewSurfaceProps,\n citationProps,\n index,\n previewContentProps,\n referencePreviewProps,\n referencePreviewSurfaceProps,\n referenceProps,\n sensitivityLabelProps,\n } = props;\n\n const components = React.useMemo(() => {\n const citationWithPreview: PackagedCitation = props => {\n return (\n <Preview closeOnScroll positioning=\"below\" size=\"small\" trapFocus withArrow {...citationPreviewProps}>\n <PreviewTrigger>\n <Citation {...citationProps} {...props}>\n {index}\n </Citation>\n </PreviewTrigger>\n <PreviewSurface {...citationPreviewSurfaceProps}>\n <PreviewContent>\n <PreviewHeader\n citation={\n <CitationCloseButton aria-label={`Reference ${index}, close`} referenceHref=\"#\" tabIndex={-1}>\n {index}\n </CitationCloseButton>\n }\n media={referenceProps?.media as PreviewHeaderProps['media']}\n >\n {referenceProps?.children}\n </PreviewHeader>\n <PreviewMetadata\n icon={previewContentProps?.icon}\n primaryText={previewContentProps?.primaryText}\n secondaryText={previewContentProps?.secondaryText}\n tertiaryText={previewContentProps?.tertiaryText}\n />\n {sensitivityLabelProps && <SensitivityLabel {...sensitivityLabelProps} />}\n {previewContentProps?.content ?? citationPreviewProps?.children}\n </PreviewContent>\n </PreviewSurface>\n </Preview>\n );\n };\n\n const referenceWithPreview: PackagedReference = props => {\n return (\n <Preview closeOnScroll positioning=\"below\" size=\"small\" trapFocus withArrow {...referencePreviewProps}>\n <PreviewTrigger>\n <Reference citation={index} {...referenceProps} {...props} />\n </PreviewTrigger>\n <PreviewSurface {...referencePreviewSurfaceProps}>\n <PreviewContent>\n <PreviewHeader\n citation={\n <CitationCloseButton aria-label={`Reference ${index}, close`} referenceHref=\"#\" tabIndex={-1}>\n {index}\n </CitationCloseButton>\n }\n media={referenceProps?.media as PreviewHeaderProps['media']}\n >\n {referenceProps?.children}\n </PreviewHeader>\n <PreviewMetadata\n icon={previewContentProps?.icon}\n primaryText={previewContentProps?.primaryText}\n secondaryText={previewContentProps?.secondaryText}\n tertiaryText={previewContentProps?.tertiaryText}\n />\n {sensitivityLabelProps && <SensitivityLabel {...sensitivityLabelProps} />}\n {previewContentProps?.content ?? referencePreviewProps?.children}\n </PreviewContent>\n </PreviewSurface>\n </Preview>\n );\n };\n\n return {\n Citation: citationWithPreview,\n Reference: referenceWithPreview,\n };\n }, [\n citationPreviewProps,\n citationPreviewSurfaceProps,\n citationProps,\n index,\n referencePreviewProps,\n referencePreviewSurfaceProps,\n referenceProps,\n previewContentProps,\n sensitivityLabelProps,\n ]);\n\n return components;\n};\n"],"names":["React","mergeCallbacks","usePopoverContext_unstable","Preview","PreviewContent","PreviewHeader","PreviewMetadata","PreviewSurface","PreviewTrigger","SensitivityLabel","Citation","Reference","CitationCloseButton","citationCloseButtonProps","setPopoverOpen","context","setOpen","onPopoverCloseClick","useCallback","ev","preventDefault","onCitationCloseButtonClick","onClick","useReferenceCitationPreview","props","citationPreviewProps","citationPreviewSurfaceProps","citationProps","index","previewContentProps","referencePreviewProps","referencePreviewSurfaceProps","referenceProps","sensitivityLabelProps","components","useMemo","citationWithPreview","closeOnScroll","positioning","size","trapFocus","withArrow","citation","aria-label","referenceHref","tabIndex","media","children","icon","primaryText","secondaryText","tertiaryText","content","referenceWithPreview"],"rangeMappings":";;;;;;;;;;;;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