@fluentui-copilot/react-reference 0.15.5-hotfix.1 → 0.15.5-hotfix.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/CHANGELOG.json +4 -4
  2. package/CHANGELOG.md +5 -5
  3. package/lib/Citation.js +1 -0
  4. package/lib/Reference.js +1 -0
  5. package/lib/ReferenceGroupToggle.js +1 -0
  6. package/lib/ReferenceList.js +1 -0
  7. package/lib/ReferenceListV2.js +1 -0
  8. package/lib/ReferenceOverflowButton.js +1 -0
  9. package/lib/ReferenceV2.js +1 -0
  10. package/lib/components/Citation/Citation.js +6 -5
  11. package/lib/components/Citation/Citation.types.js +2 -1
  12. package/lib/components/Citation/index.js +1 -0
  13. package/lib/components/Citation/renderCitation.js +6 -4
  14. package/lib/components/Citation/useCitation.js +28 -22
  15. package/lib/components/Citation/useCitationStyles.styles.raw.js +59 -54
  16. package/lib/components/Reference/Reference.js +7 -5
  17. package/lib/components/Reference/Reference.types.js +2 -1
  18. package/lib/components/Reference/index.js +1 -0
  19. package/lib/components/Reference/renderReference.js +12 -27
  20. package/lib/components/Reference/useReference.js +172 -173
  21. package/lib/components/Reference/useReferenceStyles.styles.raw.js +181 -172
  22. package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js +6 -4
  23. package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +2 -1
  24. package/lib/components/ReferenceGroupToggle/index.js +1 -0
  25. package/lib/components/ReferenceGroupToggle/renderReferenceGroupToggle.js +8 -9
  26. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js +30 -26
  27. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.raw.js +36 -31
  28. package/lib/components/ReferenceList/ReferenceList.js +7 -5
  29. package/lib/components/ReferenceList/ReferenceList.types.js +2 -1
  30. package/lib/components/ReferenceList/index.js +1 -0
  31. package/lib/components/ReferenceList/renderReferenceList.js +6 -4
  32. package/lib/components/ReferenceList/useReferenceList.js +17 -15
  33. package/lib/components/ReferenceList/useReferenceListStyles.styles.raw.js +22 -16
  34. package/lib/components/reference-v2/Reference/Reference.js +5 -4
  35. package/lib/components/reference-v2/Reference/Reference.types.js +2 -1
  36. package/lib/components/reference-v2/Reference/index.js +1 -0
  37. package/lib/components/reference-v2/Reference/renderReference.js +17 -20
  38. package/lib/components/reference-v2/Reference/useReference.js +59 -53
  39. package/lib/components/reference-v2/Reference/useReferenceStyles.styles.raw.js +89 -84
  40. package/lib/components/reference-v2/ReferenceList/ReferenceList.js +6 -5
  41. package/lib/components/reference-v2/ReferenceList/ReferenceList.types.js +2 -1
  42. package/lib/components/reference-v2/ReferenceList/index.js +1 -0
  43. package/lib/components/reference-v2/ReferenceList/renderReferenceList.js +17 -17
  44. package/lib/components/reference-v2/ReferenceList/useReferenceList.js +80 -70
  45. package/lib/components/reference-v2/ReferenceList/useReferenceListContextValues.js +21 -13
  46. package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.styles.raw.js +38 -31
  47. package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js +5 -4
  48. package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js +2 -1
  49. package/lib/components/reference-v2/ReferenceOverflowButton/index.js +1 -0
  50. package/lib/components/reference-v2/ReferenceOverflowButton/renderReferenceOverflowButton.js +14 -9
  51. package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +77 -77
  52. package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js +39 -33
  53. package/lib/components/reference-v2/index.js +1 -0
  54. package/lib/contexts/ReferenceGroupContext.js +6 -5
  55. package/lib/contexts/reference-v2/index.js +1 -0
  56. package/lib/contexts/reference-v2/referenceListContext.js +12 -11
  57. package/lib/index.js +1 -0
  58. package/lib/utilities/index.js +1 -0
  59. package/lib/utilities/reference-v2/generateReferenceCitationPreview.js +86 -75
  60. package/lib/utilities/reference-v2/index.js +1 -0
  61. package/lib/utilities/reference-v2/useReferenceCitationPreview.js +5 -5
  62. package/lib/utilities/useReferenceCitationPreview.js +114 -123
  63. package/lib/utilities/useReferenceGroup.js +24 -26
  64. package/lib/utilities/useReferenceGroup.styles.raw.js +4 -3
  65. package/lib-commonjs/Citation.js +1 -0
  66. package/lib-commonjs/Reference.js +1 -0
  67. package/lib-commonjs/ReferenceGroupToggle.js +1 -0
  68. package/lib-commonjs/ReferenceList.js +1 -0
  69. package/lib-commonjs/ReferenceListV2.js +1 -0
  70. package/lib-commonjs/ReferenceOverflowButton.js +1 -0
  71. package/lib-commonjs/ReferenceV2.js +1 -0
  72. package/lib-commonjs/components/Citation/Citation.js +1 -1
  73. package/lib-commonjs/components/Citation/Citation.js.map +1 -1
  74. package/lib-commonjs/components/Citation/Citation.types.js +1 -0
  75. package/lib-commonjs/components/Citation/index.js +1 -0
  76. package/lib-commonjs/components/Citation/renderCitation.js +1 -1
  77. package/lib-commonjs/components/Citation/renderCitation.js.map +1 -1
  78. package/lib-commonjs/components/Citation/useCitation.js +1 -1
  79. package/lib-commonjs/components/Citation/useCitation.js.map +1 -1
  80. package/lib-commonjs/components/Citation/useCitationStyles.styles.raw.js +1 -1
  81. package/lib-commonjs/components/Citation/useCitationStyles.styles.raw.js.map +1 -1
  82. package/lib-commonjs/components/Reference/Reference.js +1 -1
  83. package/lib-commonjs/components/Reference/Reference.js.map +1 -1
  84. package/lib-commonjs/components/Reference/Reference.types.js +1 -0
  85. package/lib-commonjs/components/Reference/index.js +1 -0
  86. package/lib-commonjs/components/Reference/renderReference.js +1 -1
  87. package/lib-commonjs/components/Reference/renderReference.js.map +1 -1
  88. package/lib-commonjs/components/Reference/useReference.js +1 -1
  89. package/lib-commonjs/components/Reference/useReference.js.map +1 -1
  90. package/lib-commonjs/components/Reference/useReferenceStyles.styles.raw.js +1 -1
  91. package/lib-commonjs/components/Reference/useReferenceStyles.styles.raw.js.map +1 -1
  92. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js +1 -1
  93. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -1
  94. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +1 -0
  95. package/lib-commonjs/components/ReferenceGroupToggle/index.js +1 -0
  96. package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js +1 -1
  97. package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js.map +1 -1
  98. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js +1 -1
  99. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -1
  100. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.raw.js +1 -1
  101. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.raw.js.map +1 -1
  102. package/lib-commonjs/components/ReferenceList/ReferenceList.js +1 -1
  103. package/lib-commonjs/components/ReferenceList/ReferenceList.js.map +1 -1
  104. package/lib-commonjs/components/ReferenceList/ReferenceList.types.js +1 -0
  105. package/lib-commonjs/components/ReferenceList/index.js +1 -0
  106. package/lib-commonjs/components/ReferenceList/renderReferenceList.js +1 -1
  107. package/lib-commonjs/components/ReferenceList/renderReferenceList.js.map +1 -1
  108. package/lib-commonjs/components/ReferenceList/useReferenceList.js +1 -1
  109. package/lib-commonjs/components/ReferenceList/useReferenceList.js.map +1 -1
  110. package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.raw.js +1 -1
  111. package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.raw.js.map +1 -1
  112. package/lib-commonjs/components/reference-v2/Reference/Reference.js +1 -1
  113. package/lib-commonjs/components/reference-v2/Reference/Reference.js.map +1 -1
  114. package/lib-commonjs/components/reference-v2/Reference/Reference.types.js +1 -0
  115. package/lib-commonjs/components/reference-v2/Reference/index.js +1 -0
  116. package/lib-commonjs/components/reference-v2/Reference/renderReference.js +1 -1
  117. package/lib-commonjs/components/reference-v2/Reference/renderReference.js.map +1 -1
  118. package/lib-commonjs/components/reference-v2/Reference/useReference.js +1 -1
  119. package/lib-commonjs/components/reference-v2/Reference/useReference.js.map +1 -1
  120. package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.raw.js +1 -1
  121. package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.raw.js.map +1 -1
  122. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js +1 -1
  123. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js.map +1 -1
  124. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.types.js +1 -0
  125. package/lib-commonjs/components/reference-v2/ReferenceList/index.js +1 -0
  126. package/lib-commonjs/components/reference-v2/ReferenceList/renderReferenceList.js +1 -1
  127. package/lib-commonjs/components/reference-v2/ReferenceList/renderReferenceList.js.map +1 -1
  128. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js +1 -1
  129. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js.map +1 -1
  130. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js +1 -1
  131. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js.map +1 -1
  132. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.styles.raw.js +1 -1
  133. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.styles.raw.js.map +1 -1
  134. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js +1 -1
  135. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -1
  136. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js +1 -0
  137. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/index.js +1 -0
  138. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/renderReferenceOverflowButton.js +1 -1
  139. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/renderReferenceOverflowButton.js.map +1 -1
  140. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +1 -1
  141. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -1
  142. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js +1 -1
  143. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js.map +1 -1
  144. package/lib-commonjs/components/reference-v2/index.js +1 -0
  145. package/lib-commonjs/contexts/ReferenceGroupContext.js +1 -1
  146. package/lib-commonjs/contexts/ReferenceGroupContext.js.map +1 -1
  147. package/lib-commonjs/contexts/reference-v2/index.js +1 -0
  148. package/lib-commonjs/contexts/reference-v2/referenceListContext.js +1 -1
  149. package/lib-commonjs/contexts/reference-v2/referenceListContext.js.map +1 -1
  150. package/lib-commonjs/index.js +1 -0
  151. package/lib-commonjs/utilities/index.js +1 -0
  152. package/lib-commonjs/utilities/reference-v2/generateReferenceCitationPreview.js +1 -1
  153. package/lib-commonjs/utilities/reference-v2/generateReferenceCitationPreview.js.map +1 -1
  154. package/lib-commonjs/utilities/reference-v2/index.js +1 -0
  155. package/lib-commonjs/utilities/reference-v2/useReferenceCitationPreview.js +1 -1
  156. package/lib-commonjs/utilities/reference-v2/useReferenceCitationPreview.js.map +1 -1
  157. package/lib-commonjs/utilities/useReferenceCitationPreview.js +1 -1
  158. package/lib-commonjs/utilities/useReferenceCitationPreview.js.map +1 -1
  159. package/lib-commonjs/utilities/useReferenceGroup.js +1 -1
  160. package/lib-commonjs/utilities/useReferenceGroup.js.map +1 -1
  161. package/lib-commonjs/utilities/useReferenceGroup.styles.raw.js +1 -1
  162. package/lib-commonjs/utilities/useReferenceGroup.styles.raw.js.map +1 -1
  163. package/package.json +6 -6
@@ -11,19 +11,21 @@ import { referenceListItemClassName } from './useReferenceListStyles.styles';
11
11
  * @param ref - reference to root HTMLElement of ReferenceList
12
12
  *
13
13
  * deprecated Use ReferenceListV2 component, hooks and types instead.
14
- */ export const useReferenceList_unstable = (props, ref)=>{
15
- return {
16
- components: {
17
- root: 'ol'
18
- },
19
- root: slot.always(getIntrinsicElementProps('ol', {
20
- ref,
21
- ...props,
22
- children: React.Children.map(props.children, (child)=>/*#__PURE__*/ React.createElement("li", {
23
- className: referenceListItemClassName
24
- }, child))
25
- }), {
26
- elementType: 'ol'
27
- })
28
- };
14
+ */
15
+ export const useReferenceList_unstable = (props, ref) => {
16
+ return {
17
+ components: {
18
+ root: 'ol'
19
+ },
20
+ root: slot.always(getIntrinsicElementProps('ol', {
21
+ ref,
22
+ ...props,
23
+ children: React.Children.map(props.children, child => /*#__PURE__*/React.createElement("li", {
24
+ className: referenceListItemClassName
25
+ }, child))
26
+ }), {
27
+ elementType: 'ol'
28
+ })
29
+ };
29
30
  };
31
+ //# sourceMappingURL=useReferenceList.js.map
@@ -1,27 +1,33 @@
1
1
  import { makeResetStyles, mergeClasses } from '@fluentui/react-components';
2
2
  import { tokens } from '@fluentui-copilot/tokens';
3
- /** deprecated Use ReferenceListV2 component, hooks and types instead. */ export const referenceListClassNames = {
4
- root: 'fai-ReferenceList'
3
+ /** deprecated Use ReferenceListV2 component, hooks and types instead. */
4
+ export const referenceListClassNames = {
5
+ root: 'fai-ReferenceList'
5
6
  };
6
- /** deprecated Use ReferenceListV2 component, hooks and types instead. */ export const referenceListItemClassName = 'fai-ReferenceList__item';
7
+ /** deprecated Use ReferenceListV2 component, hooks and types instead. */
8
+ export const referenceListItemClassName = 'fai-ReferenceList__item';
7
9
  /**
8
10
  * Styles for the root slot
9
- */ const useRootClassName = makeResetStyles({
10
- padding: 0,
11
- margin: 0,
12
- display: 'flex',
13
- flexDirection: 'column',
14
- gap: tokens.spacingVerticalS,
15
- [`> .${referenceListItemClassName}`]: {
16
- listStyleType: 'none'
17
- }
11
+ */
12
+ const useRootClassName = makeResetStyles({
13
+ padding: 0,
14
+ margin: 0,
15
+ display: 'flex',
16
+ flexDirection: 'column',
17
+ gap: tokens.spacingVerticalS,
18
+ [`> .${referenceListItemClassName}`]: {
19
+ listStyleType: 'none'
20
+ }
18
21
  });
19
22
  /**
20
23
  * Apply styling to the ReferenceList slots based on the state
21
24
  *
22
25
  * deprecated Use ReferenceListV2 component, hooks and types instead.
23
- */ export const useReferenceListStyles_unstable = (state)=>{
24
- 'use no memo';
25
- state.root.className = mergeClasses(referenceListClassNames.root, useRootClassName(), state.root.className);
26
- return state;
26
+ */
27
+ export const useReferenceListStyles_unstable = state => {
28
+ 'use no memo';
29
+
30
+ state.root.className = mergeClasses(referenceListClassNames.root, useRootClassName(), state.root.className);
31
+ return state;
27
32
  };
33
+ //# sourceMappingURL=useReferenceListStyles.styles.raw.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
@@ -1,110 +1,115 @@
1
1
  import { makeResetStyles, makeStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';
2
2
  import { tokens } from '@fluentui-copilot/tokens';
3
3
  export const referenceClassNames = {
4
- root: 'fai-Reference',
5
- citation: 'fai-Reference__citation',
6
- divider: 'fai-Reference__divider',
7
- graphic: 'fai-Reference__graphic',
8
- content: 'fai-Reference__content'
4
+ root: 'fai-Reference',
5
+ citation: 'fai-Reference__citation',
6
+ divider: 'fai-Reference__divider',
7
+ graphic: 'fai-Reference__graphic',
8
+ content: 'fai-Reference__content'
9
9
  };
10
10
  export const referenceExtraClassNames = {
11
- graphicChild: 'fai-Reference__graphicChild'
11
+ graphicChild: 'fai-Reference__graphicChild'
12
12
  };
13
13
  const GRAPHIC_SIZE = '16px';
14
14
  const useRootBaseClassName = makeResetStyles({
15
- alignItems: 'center',
16
- backgroundColor: tokens.colorNeutralBackground3,
17
- border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,
18
- borderRadius: tokens.borderRadiusMedium,
19
- boxSizing: 'border-box',
20
- color: tokens.colorNeutralForeground2,
21
- columnGap: tokens.spacingHorizontalXXS,
22
- display: 'inline-flex',
23
- flexShrink: 0,
24
- justifyContent: 'center',
25
- maxWidth: '100%',
26
- minHeight: '24px',
27
- padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalS}`,
28
- textDecoration: 'none',
29
- ':hover': {
30
- backgroundColor: tokens.colorNeutralBackground3Hover,
31
- borderColor: tokens.colorNeutralStroke1Hover,
32
- color: tokens.colorNeutralForeground2Hover,
33
- [`& .${referenceClassNames.divider}`]: {
34
- backgroundColor: tokens.colorNeutralStroke1Hover
35
- }
36
- },
37
- ':hover:active': {
38
- backgroundColor: tokens.colorNeutralBackground3Pressed,
39
- borderColor: tokens.colorNeutralStroke1Pressed,
40
- color: tokens.colorNeutralForeground2Pressed,
41
- [`& .${referenceClassNames.divider}`]: {
42
- backgroundColor: tokens.colorNeutralStroke1Pressed
43
- }
15
+ alignItems: 'center',
16
+ backgroundColor: tokens.colorNeutralBackground3,
17
+ border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,
18
+ borderRadius: tokens.borderRadiusMedium,
19
+ boxSizing: 'border-box',
20
+ color: tokens.colorNeutralForeground2,
21
+ columnGap: tokens.spacingHorizontalXXS,
22
+ display: 'inline-flex',
23
+ flexShrink: 0,
24
+ justifyContent: 'center',
25
+ maxWidth: '100%',
26
+ minHeight: '24px',
27
+ padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalS}`,
28
+ textDecoration: 'none',
29
+ ':hover': {
30
+ backgroundColor: tokens.colorNeutralBackground3Hover,
31
+ borderColor: tokens.colorNeutralStroke1Hover,
32
+ color: tokens.colorNeutralForeground2Hover,
33
+ [`& .${referenceClassNames.divider}`]: {
34
+ backgroundColor: tokens.colorNeutralStroke1Hover
35
+ }
36
+ },
37
+ ':hover:active': {
38
+ backgroundColor: tokens.colorNeutralBackground3Pressed,
39
+ borderColor: tokens.colorNeutralStroke1Pressed,
40
+ color: tokens.colorNeutralForeground2Pressed,
41
+ [`& .${referenceClassNames.divider}`]: {
42
+ backgroundColor: tokens.colorNeutralStroke1Pressed
44
43
  }
44
+ }
45
45
  });
46
46
  export const useRootStyles = makeStyles({
47
- overflow: {
48
- maxWidth: '100%',
49
- width: '100%'
50
- }
47
+ overflow: {
48
+ maxWidth: '100%',
49
+ width: '100%'
50
+ }
51
51
  });
52
52
  const useRootNextStyles = makeStyles({
53
- root: {
54
- borderRadius: tokens.borderRadiusXLarge
55
- }
53
+ root: {
54
+ borderRadius: tokens.borderRadiusXLarge
55
+ }
56
56
  });
57
57
  const useCitationBaseClassName = makeResetStyles({
58
- ...typographyStyles.caption2Strong
58
+ ...typographyStyles.caption2Strong
59
59
  });
60
60
  const useDividerBaseClassName = makeResetStyles({
61
- backgroundColor: tokens.colorNeutralStroke2,
62
- height: '16px',
63
- margin: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalXS}`,
64
- width: '1px'
61
+ backgroundColor: tokens.colorNeutralStroke2,
62
+ height: '16px',
63
+ margin: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalXS}`,
64
+ width: '1px'
65
65
  });
66
66
  const useGraphicBaseClassName = makeResetStyles({
67
- display: 'inline-flex',
68
- fontSize: GRAPHIC_SIZE,
67
+ display: 'inline-flex',
68
+ fontSize: GRAPHIC_SIZE,
69
+ height: GRAPHIC_SIZE,
70
+ lineHeight: GRAPHIC_SIZE,
71
+ width: GRAPHIC_SIZE,
72
+ [`> .${referenceExtraClassNames.graphicChild}`]: {
69
73
  height: GRAPHIC_SIZE,
70
- lineHeight: GRAPHIC_SIZE,
71
- width: GRAPHIC_SIZE,
72
- [`> .${referenceExtraClassNames.graphicChild}`]: {
73
- height: GRAPHIC_SIZE,
74
- width: GRAPHIC_SIZE
75
- }
74
+ width: GRAPHIC_SIZE
75
+ }
76
76
  });
77
77
  const useContentBaseClassName = makeResetStyles({
78
- alignItems: 'center',
79
- columnGap: tokens.spacingHorizontalSNudge,
80
- display: 'inline-flex',
81
- textAlign: 'start',
82
- wordBreak: 'break-word',
83
- ...typographyStyles.caption1
78
+ alignItems: 'center',
79
+ columnGap: tokens.spacingHorizontalSNudge,
80
+ display: 'inline-flex',
81
+ textAlign: 'start',
82
+ wordBreak: 'break-word',
83
+ ...typographyStyles.caption1
84
84
  });
85
85
  /**
86
86
  * Apply styling to the Reference slots based on the state
87
- */ export const useReferenceStyles_unstable = (state)=>{
88
- 'use no memo';
89
- const { designVersion } = state;
90
- const rootBaseClassName = useRootBaseClassName();
91
- const rootNextStyles = useRootNextStyles();
92
- const citationBaseClassName = useCitationBaseClassName();
93
- const dividerBaseClassName = useDividerBaseClassName();
94
- const contentBaseClassName = useContentBaseClassName();
95
- const graphicBaseClassName = useGraphicBaseClassName();
96
- state.root.className = mergeClasses(referenceClassNames.root, rootBaseClassName, designVersion === 'next' && rootNextStyles.root, state.root.className);
97
- if (state.citation) {
98
- state.citation.className = mergeClasses(referenceClassNames.citation, citationBaseClassName, state.citation.className);
99
- }
100
- if (state.divider) {
101
- state.divider.className = mergeClasses(referenceClassNames.divider, dividerBaseClassName, state.divider.className);
102
- }
103
- if (state.content) {
104
- state.content.className = mergeClasses(referenceClassNames.content, contentBaseClassName, state.content.className);
105
- }
106
- if (state.graphic) {
107
- state.graphic.className = mergeClasses(referenceClassNames.graphic, graphicBaseClassName, state.graphic.className);
108
- }
109
- return state;
87
+ */
88
+ export const useReferenceStyles_unstable = state => {
89
+ 'use no memo';
90
+
91
+ const {
92
+ designVersion
93
+ } = state;
94
+ const rootBaseClassName = useRootBaseClassName();
95
+ const rootNextStyles = useRootNextStyles();
96
+ const citationBaseClassName = useCitationBaseClassName();
97
+ const dividerBaseClassName = useDividerBaseClassName();
98
+ const contentBaseClassName = useContentBaseClassName();
99
+ const graphicBaseClassName = useGraphicBaseClassName();
100
+ state.root.className = mergeClasses(referenceClassNames.root, rootBaseClassName, designVersion === 'next' && rootNextStyles.root, state.root.className);
101
+ if (state.citation) {
102
+ state.citation.className = mergeClasses(referenceClassNames.citation, citationBaseClassName, state.citation.className);
103
+ }
104
+ if (state.divider) {
105
+ state.divider.className = mergeClasses(referenceClassNames.divider, dividerBaseClassName, state.divider.className);
106
+ }
107
+ if (state.content) {
108
+ state.content.className = mergeClasses(referenceClassNames.content, contentBaseClassName, state.content.className);
109
+ }
110
+ if (state.graphic) {
111
+ state.graphic.className = mergeClasses(referenceClassNames.graphic, graphicBaseClassName, state.graphic.className);
112
+ }
113
+ return state;
110
114
  };
115
+ //# sourceMappingURL=useReferenceStyles.styles.raw.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/reference-v2/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