@fluentui-copilot/react-reference 0.0.0-nightly-20250708-1433-52f2b6b1.1 → 0.0.0-nightly-20250710-0405-e728c4d6.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.
Files changed (98) hide show
  1. package/CHANGELOG.json +3 -3
  2. package/CHANGELOG.md +4 -4
  3. package/lib/Citation.js +1 -0
  4. package/lib/Reference.js +1 -0
  5. package/lib/ReferenceList.js +1 -0
  6. package/lib/ReferenceOverflowButton.js +1 -0
  7. package/lib/components/Citation/Citation.js +6 -5
  8. package/lib/components/Citation/Citation.types.js +2 -1
  9. package/lib/components/Citation/index.js +1 -0
  10. package/lib/components/Citation/renderCitation.js +6 -4
  11. package/lib/components/Citation/useCitation.js +28 -22
  12. package/lib/components/Reference/Reference.js +5 -4
  13. package/lib/components/Reference/Reference.types.js +2 -1
  14. package/lib/components/Reference/index.js +1 -0
  15. package/lib/components/Reference/renderReference.js +17 -20
  16. package/lib/components/Reference/useReference.js +59 -53
  17. package/lib/components/ReferenceList/ReferenceList.js +6 -5
  18. package/lib/components/ReferenceList/ReferenceList.types.js +2 -1
  19. package/lib/components/ReferenceList/index.js +1 -0
  20. package/lib/components/ReferenceList/renderReferenceList.js +17 -17
  21. package/lib/components/ReferenceList/useReferenceList.js +80 -70
  22. package/lib/components/ReferenceList/useReferenceListContextValues.js +21 -13
  23. package/lib/components/ReferenceOverflowButton/ReferenceOverflowButton.js +5 -4
  24. package/lib/components/ReferenceOverflowButton/ReferenceOverflowButton.types.js +2 -1
  25. package/lib/components/ReferenceOverflowButton/index.js +1 -0
  26. package/lib/components/ReferenceOverflowButton/renderReferenceOverflowButton.js +14 -9
  27. package/lib/components/ReferenceOverflowButton/useReferenceOverflowButton.js +77 -77
  28. package/lib/contexts/index.js +1 -0
  29. package/lib/contexts/referenceListContext.js +12 -11
  30. package/lib/index.js +25 -12
  31. package/lib/utilities/generateReferenceCitationPreview.js +86 -75
  32. package/lib/utilities/index.js +1 -0
  33. package/lib/utilities/useReferenceCitationPreview.js +5 -5
  34. package/lib-commonjs/Citation.js +1 -0
  35. package/lib-commonjs/Reference.js +1 -0
  36. package/lib-commonjs/ReferenceList.js +1 -0
  37. package/lib-commonjs/ReferenceOverflowButton.js +1 -0
  38. package/lib-commonjs/components/Citation/Citation.js +1 -1
  39. package/lib-commonjs/components/Citation/Citation.js.map +1 -1
  40. package/lib-commonjs/components/Citation/Citation.types.js +1 -0
  41. package/lib-commonjs/components/Citation/index.js +1 -0
  42. package/lib-commonjs/components/Citation/renderCitation.js +1 -1
  43. package/lib-commonjs/components/Citation/renderCitation.js.map +1 -1
  44. package/lib-commonjs/components/Citation/useCitation.js +1 -1
  45. package/lib-commonjs/components/Citation/useCitation.js.map +1 -1
  46. package/lib-commonjs/components/Reference/Reference.js +1 -1
  47. package/lib-commonjs/components/Reference/Reference.js.map +1 -1
  48. package/lib-commonjs/components/Reference/Reference.types.js +1 -0
  49. package/lib-commonjs/components/Reference/index.js +1 -0
  50. package/lib-commonjs/components/Reference/renderReference.js +1 -1
  51. package/lib-commonjs/components/Reference/renderReference.js.map +1 -1
  52. package/lib-commonjs/components/Reference/useReference.js +1 -1
  53. package/lib-commonjs/components/Reference/useReference.js.map +1 -1
  54. package/lib-commonjs/components/ReferenceList/ReferenceList.js +1 -1
  55. package/lib-commonjs/components/ReferenceList/ReferenceList.js.map +1 -1
  56. package/lib-commonjs/components/ReferenceList/ReferenceList.types.js +1 -0
  57. package/lib-commonjs/components/ReferenceList/index.js +1 -0
  58. package/lib-commonjs/components/ReferenceList/renderReferenceList.js +1 -1
  59. package/lib-commonjs/components/ReferenceList/renderReferenceList.js.map +1 -1
  60. package/lib-commonjs/components/ReferenceList/useReferenceList.js +1 -1
  61. package/lib-commonjs/components/ReferenceList/useReferenceList.js.map +1 -1
  62. package/lib-commonjs/components/ReferenceList/useReferenceListContextValues.js +1 -1
  63. package/lib-commonjs/components/ReferenceList/useReferenceListContextValues.js.map +1 -1
  64. package/lib-commonjs/components/ReferenceOverflowButton/ReferenceOverflowButton.js +1 -1
  65. package/lib-commonjs/components/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -1
  66. package/lib-commonjs/components/ReferenceOverflowButton/ReferenceOverflowButton.types.js +1 -0
  67. package/lib-commonjs/components/ReferenceOverflowButton/index.js +1 -0
  68. package/lib-commonjs/components/ReferenceOverflowButton/renderReferenceOverflowButton.js +1 -1
  69. package/lib-commonjs/components/ReferenceOverflowButton/renderReferenceOverflowButton.js.map +1 -1
  70. package/lib-commonjs/components/ReferenceOverflowButton/useReferenceOverflowButton.js +1 -1
  71. package/lib-commonjs/components/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -1
  72. package/lib-commonjs/contexts/index.js +1 -0
  73. package/lib-commonjs/contexts/referenceListContext.js +1 -1
  74. package/lib-commonjs/contexts/referenceListContext.js.map +1 -1
  75. package/lib-commonjs/index.js +1 -0
  76. package/lib-commonjs/index.js.map +1 -1
  77. package/lib-commonjs/utilities/generateReferenceCitationPreview.js +1 -1
  78. package/lib-commonjs/utilities/generateReferenceCitationPreview.js.map +1 -1
  79. package/lib-commonjs/utilities/index.js +1 -0
  80. package/lib-commonjs/utilities/useReferenceCitationPreview.js +1 -1
  81. package/lib-commonjs/utilities/useReferenceCitationPreview.js.map +1 -1
  82. package/package.json +6 -6
  83. package/lib/components/Citation/useCitationStyles.styles.raw.js +0 -69
  84. package/lib/components/Citation/useCitationStyles.styles.raw.js.map +0 -1
  85. package/lib/components/Reference/useReferenceStyles.styles.raw.js +0 -110
  86. package/lib/components/Reference/useReferenceStyles.styles.raw.js.map +0 -1
  87. package/lib/components/ReferenceList/useReferenceListStyles.styles.raw.js +0 -47
  88. package/lib/components/ReferenceList/useReferenceListStyles.styles.raw.js.map +0 -1
  89. package/lib/components/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js +0 -45
  90. package/lib/components/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js.map +0 -1
  91. package/lib-commonjs/components/Citation/useCitationStyles.styles.raw.js +0 -85
  92. package/lib-commonjs/components/Citation/useCitationStyles.styles.raw.js.map +0 -1
  93. package/lib-commonjs/components/Reference/useReferenceStyles.styles.raw.js +0 -132
  94. package/lib-commonjs/components/Reference/useReferenceStyles.styles.raw.js.map +0 -1
  95. package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.raw.js +0 -63
  96. package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.raw.js.map +0 -1
  97. package/lib-commonjs/components/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js +0 -61
  98. package/lib-commonjs/components/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui-copilot/react-reference",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 08 Jul 2025 14:40:39 GMT",
6
- "tag": "@fluentui-copilot/react-reference_v0.0.0-nightly-20250708-1433-52f2b6b1.1",
7
- "version": "0.0.0-nightly-20250708-1433-52f2b6b1.1",
5
+ "date": "Thu, 10 Jul 2025 04:12:56 GMT",
6
+ "tag": "@fluentui-copilot/react-reference_v0.0.0-nightly-20250710-0405-e728c4d6.1",
7
+ "version": "0.0.0-nightly-20250710-0405-e728c4d6.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
package/CHANGELOG.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Change Log - @fluentui-copilot/react-reference
2
2
 
3
- This log was last generated on Tue, 08 Jul 2025 14:40:39 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 10 Jul 2025 04:12:56 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20250708-1433-52f2b6b1.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-reference_v0.0.0-nightly-20250708-1433-52f2b6b1.1)
7
+ ## [0.0.0-nightly-20250710-0405-e728c4d6.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-reference_v0.0.0-nightly-20250710-0405-e728c4d6.1)
8
8
 
9
- Tue, 08 Jul 2025 14:40:39 GMT
10
- [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-reference_v0.16.2..@fluentui-copilot/react-reference_v0.0.0-nightly-20250708-1433-52f2b6b1.1)
9
+ Thu, 10 Jul 2025 04:12:56 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-reference_v0.16.2..@fluentui-copilot/react-reference_v0.0.0-nightly-20250710-0405-e728c4d6.1)
11
11
 
12
12
  ### Changes
13
13
 
package/lib/Citation.js CHANGED
@@ -1 +1,2 @@
1
1
  export { Citation, citationClassNames, renderCitation_unstable, useCitationStyles_unstable, useCitation_unstable } from './components/Citation/index';
2
+ //# sourceMappingURL=Citation.js.map
package/lib/Reference.js CHANGED
@@ -1 +1,2 @@
1
1
  export { Reference, referenceClassNames, referenceExtraClassNames, renderReference_unstable, useReferenceStyles_unstable, useReference_unstable } from './components/Reference/index';
2
+ //# sourceMappingURL=Reference.js.map
@@ -1 +1,2 @@
1
1
  export { ReferenceList, referenceListClassNames, renderReferenceList_unstable, useReferenceListStyles_unstable, useReferenceList_unstable } from './components/ReferenceList/index';
2
+ //# sourceMappingURL=ReferenceList.js.map
@@ -1 +1,2 @@
1
1
  export { ReferenceOverflowButton, referenceOverflowButtonClassNames, renderReferenceOverflowButton_unstable, useReferenceOverflowButtonStyles_unstable, useReferenceOverflowButton_unstable } from './components/ReferenceOverflowButton/index';
2
+ //# sourceMappingURL=ReferenceOverflowButton.js.map
@@ -4,10 +4,11 @@ import { renderCitation_unstable } from './renderCitation';
4
4
  import { useCitationStyles_unstable } from './useCitationStyles.styles';
5
5
  import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
6
6
  // Citation component - TODO: add more docs
7
- export const Citation = /*#__PURE__*/ React.forwardRef((props, ref)=>{
8
- const state = useCitation_unstable(props, ref);
9
- useCitationStyles_unstable(state);
10
- useCustomStyleHook('useCitationStyles')(state);
11
- return renderCitation_unstable(state);
7
+ export const Citation = /*#__PURE__*/React.forwardRef((props, ref) => {
8
+ const state = useCitation_unstable(props, ref);
9
+ useCitationStyles_unstable(state);
10
+ useCustomStyleHook('useCitationStyles')(state);
11
+ return renderCitation_unstable(state);
12
12
  });
13
13
  Citation.displayName = 'Citation';
14
+ //# sourceMappingURL=Citation.js.map
@@ -1,3 +1,4 @@
1
1
  /**
2
2
  * State used in rendering Citation
3
- */ export { };
3
+ */export {};
4
+ //# sourceMappingURL=Citation.types.js.map
@@ -2,3 +2,4 @@ export { Citation } from './Citation';
2
2
  export { renderCitation_unstable } from './renderCitation';
3
3
  export { useCitation_unstable } from './useCitation';
4
4
  export { citationClassNames, useCitationStyles_unstable } from './useCitationStyles.styles';
5
+ //# sourceMappingURL=index.js.map
@@ -1,8 +1,10 @@
1
- import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
1
+ import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
2
  import { assertSlots } from '@fluentui/react-components';
3
3
  /**
4
4
  * Render the final JSX of Citation
5
- */ export const renderCitation_unstable = (state)=>{
6
- assertSlots(state);
7
- return /*#__PURE__*/ _jsx(state.root, {});
5
+ */
6
+ export const renderCitation_unstable = state => {
7
+ assertSlots(state);
8
+ return /*#__PURE__*/_jsx(state.root, {});
8
9
  };
10
+ //# sourceMappingURL=renderCitation.js.map
@@ -9,26 +9,32 @@ import { useDesignVersion } from '@fluentui-copilot/react-provider';
9
9
  *
10
10
  * @param props - props from this instance of Citation
11
11
  * @param ref - reference to root HTMLElement of Citation
12
- */ export const useCitation_unstable = (props, ref)=>{
13
- const { referenceHref, block = false, ...otherProps } = props;
14
- const designVersion = useDesignVersion(props.designVersion);
15
- const isPopoverLocked = usePreviewContext_unstable((ctx)=>ctx.isPreviewLocked) && props['aria-expanded'];
16
- const state = {
17
- block,
18
- designVersion,
19
- isPopoverLocked,
20
- components: {
21
- root: 'a'
22
- },
23
- root: slot.always(getIntrinsicElementProps('a', {
24
- ref,
25
- href: referenceHref,
26
- role: undefined,
27
- 'aria-expanded': undefined,
28
- ...otherProps
29
- }), {
30
- elementType: 'a'
31
- })
32
- };
33
- return state;
12
+ */
13
+ export const useCitation_unstable = (props, ref) => {
14
+ const {
15
+ referenceHref,
16
+ block = false,
17
+ ...otherProps
18
+ } = props;
19
+ const designVersion = useDesignVersion(props.designVersion);
20
+ const isPopoverLocked = usePreviewContext_unstable(ctx => ctx.isPreviewLocked) && props['aria-expanded'];
21
+ const state = {
22
+ block,
23
+ designVersion,
24
+ isPopoverLocked,
25
+ components: {
26
+ root: 'a'
27
+ },
28
+ root: slot.always(getIntrinsicElementProps('a', {
29
+ ref,
30
+ href: referenceHref,
31
+ role: undefined,
32
+ 'aria-expanded': undefined,
33
+ ...otherProps
34
+ }), {
35
+ elementType: 'a'
36
+ })
37
+ };
38
+ return state;
34
39
  };
40
+ //# sourceMappingURL=useCitation.js.map
@@ -2,9 +2,10 @@ import * as React from 'react';
2
2
  import { useReference_unstable } from './useReference';
3
3
  import { renderReference_unstable } from './renderReference';
4
4
  import { useReferenceStyles_unstable } from './useReferenceStyles.styles';
5
- export const Reference = /*#__PURE__*/ React.forwardRef((props, ref)=>{
6
- const state = useReference_unstable(props, ref);
7
- useReferenceStyles_unstable(state);
8
- return renderReference_unstable(state);
5
+ export const Reference = /*#__PURE__*/React.forwardRef((props, ref) => {
6
+ const state = useReference_unstable(props, ref);
7
+ useReferenceStyles_unstable(state);
8
+ return renderReference_unstable(state);
9
9
  });
10
10
  Reference.displayName = 'Reference';
11
+ //# sourceMappingURL=Reference.js.map
@@ -1 +1,2 @@
1
- export { };
1
+ export {};
2
+ //# sourceMappingURL=Reference.types.js.map
@@ -2,3 +2,4 @@ export { Reference } from './Reference';
2
2
  export { renderReference_unstable } from './renderReference';
3
3
  export { useReference_unstable } from './useReference';
4
4
  export { referenceClassNames, referenceExtraClassNames, useReferenceStyles_unstable } from './useReferenceStyles.styles';
5
+ //# sourceMappingURL=index.js.map
@@ -1,22 +1,19 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
2
  import { OverflowItem, assertSlots } from '@fluentui/react-components';
3
- export const renderReference_unstable = (state)=>{
4
- assertSlots(state);
5
- const { id, shouldUseOverflow } = state;
6
- const reference = /*#__PURE__*/ _jsxs(state.root, {
7
- children: [
8
- state.citation && /*#__PURE__*/ _jsx(state.citation, {}),
9
- state.divider && /*#__PURE__*/ _jsx(state.divider, {}),
10
- state.content && /*#__PURE__*/ _jsxs(state.content, {
11
- children: [
12
- state.graphic && /*#__PURE__*/ _jsx(state.graphic, {}),
13
- state.root.children
14
- ]
15
- })
16
- ]
17
- });
18
- return shouldUseOverflow ? /*#__PURE__*/ _jsx(OverflowItem, {
19
- id: id,
20
- children: reference
21
- }, id) : reference;
3
+ export const renderReference_unstable = state => {
4
+ assertSlots(state);
5
+ const {
6
+ id,
7
+ shouldUseOverflow
8
+ } = state;
9
+ const reference = /*#__PURE__*/_jsxs(state.root, {
10
+ children: [state.citation && /*#__PURE__*/_jsx(state.citation, {}), state.divider && /*#__PURE__*/_jsx(state.divider, {}), state.content && /*#__PURE__*/_jsxs(state.content, {
11
+ children: [state.graphic && /*#__PURE__*/_jsx(state.graphic, {}), state.root.children]
12
+ })]
13
+ });
14
+ return shouldUseOverflow ? /*#__PURE__*/_jsx(OverflowItem, {
15
+ id: id,
16
+ children: reference
17
+ }, id) : reference;
22
18
  };
19
+ //# sourceMappingURL=renderReference.js.map
@@ -11,58 +11,64 @@ import { useDesignVersion } from '@fluentui-copilot/react-provider';
11
11
  *
12
12
  * @param props - props from this instance of Reference
13
13
  * @param ref - reference to root HTMLElement of Reference
14
- */ export const useReference_unstable = (props, ref)=>{
15
- const { as, children, id } = props;
16
- const designVersion = useDesignVersion(props.designVersion);
17
- const shouldUseOverflow = useReferenceListContext_unstable((ctx)=>ctx.shouldUseOverflow);
18
- const referenceId = useId('reference-', id);
19
- const elementType = as || (props.href ? 'a' : 'button');
20
- const propsWithAssignedAs = {
21
- type: elementType === 'button' ? 'button' : undefined,
22
- ...props,
23
- as: elementType,
24
- id: referenceId
25
- };
26
- const citation = slot.optional(props.citation, {
27
- elementType: 'span'
14
+ */
15
+ export const useReference_unstable = (props, ref) => {
16
+ const {
17
+ as,
18
+ children,
19
+ id
20
+ } = props;
21
+ const designVersion = useDesignVersion(props.designVersion);
22
+ const shouldUseOverflow = useReferenceListContext_unstable(ctx => ctx.shouldUseOverflow);
23
+ const referenceId = useId('reference-', id);
24
+ const elementType = as || (props.href ? 'a' : 'button');
25
+ const propsWithAssignedAs = {
26
+ type: elementType === 'button' ? 'button' : undefined,
27
+ ...props,
28
+ as: elementType,
29
+ id: referenceId
30
+ };
31
+ const citation = slot.optional(props.citation, {
32
+ elementType: 'span'
33
+ });
34
+ const graphic = slot.optional(props.graphic, {
35
+ elementType: 'span'
36
+ });
37
+ const content = slot.optional(props.content, {
38
+ elementType: 'span',
39
+ renderByDefault: graphic !== undefined || !!children
40
+ });
41
+ const divider = slot.optional(props.divider, {
42
+ elementType: 'span',
43
+ renderByDefault: citation !== undefined && content !== undefined
44
+ });
45
+ const state = {
46
+ designVersion,
47
+ id: referenceId,
48
+ shouldUseOverflow,
49
+ components: {
50
+ root: elementType,
51
+ citation: 'span',
52
+ divider: 'span',
53
+ graphic: 'span',
54
+ content: 'span'
55
+ },
56
+ root: slot.always(getIntrinsicElementProps(elementType, {
57
+ ref,
58
+ ...propsWithAssignedAs
59
+ }), {
60
+ elementType
61
+ }),
62
+ citation,
63
+ divider,
64
+ content,
65
+ graphic
66
+ };
67
+ if (state.graphic && React.isValidElement(state.graphic.children)) {
68
+ state.graphic.children = React.cloneElement(state.graphic.children, {
69
+ className: mergeClasses(state.graphic.children.props.className, referenceExtraClassNames.graphicChild)
28
70
  });
29
- const graphic = slot.optional(props.graphic, {
30
- elementType: 'span'
31
- });
32
- const content = slot.optional(props.content, {
33
- elementType: 'span',
34
- renderByDefault: graphic !== undefined || !!children
35
- });
36
- const divider = slot.optional(props.divider, {
37
- elementType: 'span',
38
- renderByDefault: citation !== undefined && content !== undefined
39
- });
40
- const state = {
41
- designVersion,
42
- id: referenceId,
43
- shouldUseOverflow,
44
- components: {
45
- root: elementType,
46
- citation: 'span',
47
- divider: 'span',
48
- graphic: 'span',
49
- content: 'span'
50
- },
51
- root: slot.always(getIntrinsicElementProps(elementType, {
52
- ref,
53
- ...propsWithAssignedAs
54
- }), {
55
- elementType
56
- }),
57
- citation,
58
- divider,
59
- content,
60
- graphic
61
- };
62
- if (state.graphic && React.isValidElement(state.graphic.children)) {
63
- state.graphic.children = React.cloneElement(state.graphic.children, {
64
- className: mergeClasses(state.graphic.children.props.className, referenceExtraClassNames.graphicChild)
65
- });
66
- }
67
- return state;
71
+ }
72
+ return state;
68
73
  };
74
+ //# sourceMappingURL=useReference.js.map
@@ -3,10 +3,11 @@ import { renderReferenceList_unstable } from './renderReferenceList';
3
3
  import { useReferenceList_unstable } from './useReferenceList';
4
4
  import { useReferenceListStyles_unstable } from './useReferenceListStyles.styles';
5
5
  import { useReferenceListContextValues_unstable } from './useReferenceListContextValues';
6
- export const ReferenceList = /*#__PURE__*/ React.forwardRef((props, ref)=>{
7
- const state = useReferenceList_unstable(props, ref);
8
- const referenceListContextValues = useReferenceListContextValues_unstable(state);
9
- useReferenceListStyles_unstable(state);
10
- return renderReferenceList_unstable(state, referenceListContextValues);
6
+ export const ReferenceList = /*#__PURE__*/React.forwardRef((props, ref) => {
7
+ const state = useReferenceList_unstable(props, ref);
8
+ const referenceListContextValues = useReferenceListContextValues_unstable(state);
9
+ useReferenceListStyles_unstable(state);
10
+ return renderReferenceList_unstable(state, referenceListContextValues);
11
11
  });
12
12
  ReferenceList.displayName = 'ReferenceList';
13
+ //# sourceMappingURL=ReferenceList.js.map
@@ -1 +1,2 @@
1
- export { };
1
+ export {};
2
+ //# sourceMappingURL=ReferenceList.types.js.map
@@ -2,3 +2,4 @@ export { ReferenceList } from './ReferenceList';
2
2
  export { renderReferenceList_unstable } from './renderReferenceList';
3
3
  export { useReferenceList_unstable } from './useReferenceList';
4
4
  export { referenceListClassNames, useReferenceListStyles_unstable } from './useReferenceListStyles.styles';
5
+ //# sourceMappingURL=index.js.map
@@ -1,22 +1,22 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
2
  import { Overflow, assertSlots } from '@fluentui/react-components';
3
3
  import { ReferenceListContextProvider } from '../../contexts/referenceListContext';
4
4
  /**
5
5
  * Render the final JSX of ReferenceList
6
- */ export const renderReferenceList_unstable = (state, contextValues)=>{
7
- assertSlots(state);
8
- const { minVisibleReferences } = state;
9
- return /*#__PURE__*/ _jsx(ReferenceListContextProvider, {
10
- value: contextValues.referenceList,
11
- children: /*#__PURE__*/ _jsx(Overflow, {
12
- minimumVisible: minVisibleReferences,
13
- children: /*#__PURE__*/ _jsxs(state.root, {
14
- children: [
15
- /*#__PURE__*/ _jsx(state.arrowableRegion, {}),
16
- state.showMoreButton && /*#__PURE__*/ _jsx(state.showMoreButton, {}),
17
- state.showLessButton && /*#__PURE__*/ _jsx(state.showLessButton, {})
18
- ]
19
- })
20
- })
21
- });
6
+ */
7
+ export const renderReferenceList_unstable = (state, contextValues) => {
8
+ assertSlots(state);
9
+ const {
10
+ minVisibleReferences
11
+ } = state;
12
+ return /*#__PURE__*/_jsx(ReferenceListContextProvider, {
13
+ value: contextValues.referenceList,
14
+ children: /*#__PURE__*/_jsx(Overflow, {
15
+ minimumVisible: minVisibleReferences,
16
+ children: /*#__PURE__*/_jsxs(state.root, {
17
+ children: [/*#__PURE__*/_jsx(state.arrowableRegion, {}), state.showMoreButton && /*#__PURE__*/_jsx(state.showMoreButton, {}), state.showLessButton && /*#__PURE__*/_jsx(state.showLessButton, {})]
18
+ })
19
+ })
20
+ });
22
21
  };
22
+ //# sourceMappingURL=renderReferenceList.js.map
@@ -10,74 +10,84 @@ import { useRootStyles } from '../Reference/useReferenceStyles.styles';
10
10
  *
11
11
  * @param props - props from this instance of ReferenceList
12
12
  * @param ref - reference to root HTMLElement of ReferenceList
13
- */ export const useReferenceList_unstable = (props, ref)=>{
14
- const { arrowableRegion, children, maxVisibleReferences, minVisibleReferences, showLessButton, showMoreButton, ...rest } = props;
15
- const [areReferencesExpanded, setAreReferencesExpanded] = React.useState(false);
16
- const referenceListRef = React.useRef(null);
17
- const totalReferencesCount = React.Children.count(children);
18
- const styles = useRootStyles();
19
- const resolvedChildren = useOverflowMaxVisibleItems({
20
- additionalCondition: !areReferencesExpanded,
21
- children,
22
- maxVisibleItems: maxVisibleReferences,
23
- minVisibleItems: minVisibleReferences,
24
- overflowClassName: styles.overflow
25
- });
26
- // We keep track of whether we are interacting with the overflow button via keyboard or not.
27
- const overflowButtonTriggeredViaKeyboard = React.useRef(false);
28
- const focusAttributes = useArrowNavigationGroup({
29
- axis: 'both',
30
- circular: true,
31
- memorizeCurrent: true
32
- });
33
- const onShowMoreButtonClick = React.useCallback(()=>{
34
- setAreReferencesExpanded(true);
35
- }, []);
36
- const onShowLessButtonClick = React.useCallback(()=>{
37
- setAreReferencesExpanded(false);
38
- }, []);
39
- const shouldUseOverflow = (minVisibleReferences === undefined || minVisibleReferences < totalReferencesCount) && maxVisibleReferences !== undefined && !areReferencesExpanded;
40
- // Since the overflow button is an OverflowItem that's always visible, we need to account for it.
41
- const minVisibleOverflowItems = minVisibleReferences ? minVisibleReferences + 1 : 1;
42
- const state = {
43
- areReferencesExpanded,
44
- overflowButtonTriggeredViaKeyboard,
45
- maxVisibleReferences,
46
- minVisibleReferences: minVisibleOverflowItems,
47
- referenceListRef,
48
- shouldUseOverflow,
49
- totalReferencesCount,
50
- components: {
51
- root: 'div',
52
- arrowableRegion: 'div',
53
- showMoreButton: 'span',
54
- showLessButton: 'span'
55
- },
56
- root: slot.always(getIntrinsicElementProps('div', {
57
- ref: useMergedRefs(ref, referenceListRef),
58
- ...rest
59
- }), {
60
- elementType: 'div'
61
- }),
62
- arrowableRegion: slot.always(arrowableRegion, {
63
- defaultProps: {
64
- ...focusAttributes,
65
- children: resolvedChildren
66
- },
67
- elementType: 'div'
68
- }),
69
- showMoreButton: shouldUseOverflow ? slot.optional(showMoreButton, {
70
- elementType: 'span'
71
- }) : undefined,
72
- showLessButton: areReferencesExpanded ? slot.optional(showLessButton, {
73
- elementType: 'span'
74
- }) : undefined
75
- };
76
- if (state.showMoreButton) {
77
- state.showMoreButton.onClick = mergeCallbacks(onShowMoreButtonClick, state.showMoreButton.onClick);
78
- }
79
- if (state.showLessButton) {
80
- state.showLessButton.onClick = mergeCallbacks(onShowLessButtonClick, state.showLessButton.onClick);
81
- }
82
- return state;
13
+ */
14
+ export const useReferenceList_unstable = (props, ref) => {
15
+ const {
16
+ arrowableRegion,
17
+ children,
18
+ maxVisibleReferences,
19
+ minVisibleReferences,
20
+ showLessButton,
21
+ showMoreButton,
22
+ ...rest
23
+ } = props;
24
+ const [areReferencesExpanded, setAreReferencesExpanded] = React.useState(false);
25
+ const referenceListRef = React.useRef(null);
26
+ const totalReferencesCount = React.Children.count(children);
27
+ const styles = useRootStyles();
28
+ const resolvedChildren = useOverflowMaxVisibleItems({
29
+ additionalCondition: !areReferencesExpanded,
30
+ children,
31
+ maxVisibleItems: maxVisibleReferences,
32
+ minVisibleItems: minVisibleReferences,
33
+ overflowClassName: styles.overflow
34
+ });
35
+ // We keep track of whether we are interacting with the overflow button via keyboard or not.
36
+ const overflowButtonTriggeredViaKeyboard = React.useRef(false);
37
+ const focusAttributes = useArrowNavigationGroup({
38
+ axis: 'both',
39
+ circular: true,
40
+ memorizeCurrent: true
41
+ });
42
+ const onShowMoreButtonClick = React.useCallback(() => {
43
+ setAreReferencesExpanded(true);
44
+ }, []);
45
+ const onShowLessButtonClick = React.useCallback(() => {
46
+ setAreReferencesExpanded(false);
47
+ }, []);
48
+ const shouldUseOverflow = (minVisibleReferences === undefined || minVisibleReferences < totalReferencesCount) && maxVisibleReferences !== undefined && !areReferencesExpanded;
49
+ // Since the overflow button is an OverflowItem that's always visible, we need to account for it.
50
+ const minVisibleOverflowItems = minVisibleReferences ? minVisibleReferences + 1 : 1;
51
+ const state = {
52
+ areReferencesExpanded,
53
+ overflowButtonTriggeredViaKeyboard,
54
+ maxVisibleReferences,
55
+ minVisibleReferences: minVisibleOverflowItems,
56
+ referenceListRef,
57
+ shouldUseOverflow,
58
+ totalReferencesCount,
59
+ components: {
60
+ root: 'div',
61
+ arrowableRegion: 'div',
62
+ showMoreButton: 'span',
63
+ showLessButton: 'span'
64
+ },
65
+ root: slot.always(getIntrinsicElementProps('div', {
66
+ ref: useMergedRefs(ref, referenceListRef),
67
+ ...rest
68
+ }), {
69
+ elementType: 'div'
70
+ }),
71
+ arrowableRegion: slot.always(arrowableRegion, {
72
+ defaultProps: {
73
+ ...focusAttributes,
74
+ children: resolvedChildren
75
+ },
76
+ elementType: 'div'
77
+ }),
78
+ showMoreButton: shouldUseOverflow ? slot.optional(showMoreButton, {
79
+ elementType: 'span'
80
+ }) : undefined,
81
+ showLessButton: areReferencesExpanded ? slot.optional(showLessButton, {
82
+ elementType: 'span'
83
+ }) : undefined
84
+ };
85
+ if (state.showMoreButton) {
86
+ state.showMoreButton.onClick = mergeCallbacks(onShowMoreButtonClick, state.showMoreButton.onClick);
87
+ }
88
+ if (state.showLessButton) {
89
+ state.showLessButton.onClick = mergeCallbacks(onShowLessButtonClick, state.showLessButton.onClick);
90
+ }
91
+ return state;
83
92
  };
93
+ //# sourceMappingURL=useReferenceList.js.map
@@ -1,15 +1,23 @@
1
1
  export function useReferenceListContextValues_unstable(state) {
2
- const { areReferencesExpanded, maxVisibleReferences, overflowButtonTriggeredViaKeyboard, referenceListRef, shouldUseOverflow, totalReferencesCount } = state;
3
- // This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
4
- const referenceList = {
5
- areReferencesExpanded,
6
- maxVisibleReferences,
7
- overflowButtonTriggeredViaKeyboard,
8
- referenceListRef,
9
- shouldUseOverflow,
10
- totalReferencesCount
11
- };
12
- return {
13
- referenceList
14
- };
2
+ const {
3
+ areReferencesExpanded,
4
+ maxVisibleReferences,
5
+ overflowButtonTriggeredViaKeyboard,
6
+ referenceListRef,
7
+ shouldUseOverflow,
8
+ totalReferencesCount
9
+ } = state;
10
+ // This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
11
+ const referenceList = {
12
+ areReferencesExpanded,
13
+ maxVisibleReferences,
14
+ overflowButtonTriggeredViaKeyboard,
15
+ referenceListRef,
16
+ shouldUseOverflow,
17
+ totalReferencesCount
18
+ };
19
+ return {
20
+ referenceList
21
+ };
15
22
  }
23
+ //# sourceMappingURL=useReferenceListContextValues.js.map
@@ -3,9 +3,10 @@ import { useReferenceOverflowButton_unstable } from './useReferenceOverflowButto
3
3
  import { renderReferenceOverflowButton_unstable } from './renderReferenceOverflowButton';
4
4
  import { useReferenceOverflowButtonStyles_unstable } from './useReferenceOverflowButtonStyles.styles';
5
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);
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
10
  });
11
11
  ReferenceOverflowButton.displayName = 'ReferenceOverflowButton';
12
+ //# sourceMappingURL=ReferenceOverflowButton.js.map
@@ -1,3 +1,4 @@
1
1
  /**
2
2
  * State used in rendering ReferenceOverflowButton
3
- */ export { };
3
+ */export {};
4
+ //# sourceMappingURL=ReferenceOverflowButton.types.js.map
@@ -2,3 +2,4 @@ export { ReferenceOverflowButton } from './ReferenceOverflowButton';
2
2
  export { renderReferenceOverflowButton_unstable } from './renderReferenceOverflowButton';
3
3
  export { useReferenceOverflowButton_unstable } from './useReferenceOverflowButton';
4
4
  export { referenceOverflowButtonClassNames, useReferenceOverflowButtonStyles_unstable } from './useReferenceOverflowButtonStyles.styles';
5
+ //# sourceMappingURL=index.js.map