@fluentui-copilot/react-reference 0.11.1 → 0.11.3

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 (150) hide show
  1. package/CHANGELOG.json +67 -1
  2. package/CHANGELOG.md +26 -2
  3. package/dist/index.d.ts +13 -28
  4. package/lib/components/Citation/Citation.js +1 -1
  5. package/lib/components/Citation/Citation.js.map +1 -1
  6. package/lib/components/Citation/index.js +1 -1
  7. package/lib/components/Citation/index.js.map +1 -1
  8. package/lib/components/Citation/{useCitationStyles.js → useCitationStyles.styles.js} +3 -1
  9. package/lib/components/Citation/useCitationStyles.styles.js.map +1 -0
  10. package/lib/components/Reference/Reference.js +1 -1
  11. package/lib/components/Reference/Reference.js.map +1 -1
  12. package/lib/components/Reference/index.js +1 -1
  13. package/lib/components/Reference/index.js.map +1 -1
  14. package/lib/components/Reference/useReference.js +1 -1
  15. package/lib/components/Reference/useReference.js.map +1 -1
  16. package/lib/components/Reference/{useReferenceStyles.js → useReferenceStyles.styles.js} +3 -1
  17. package/lib/components/Reference/useReferenceStyles.styles.js.map +1 -0
  18. package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js +1 -1
  19. package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -1
  20. package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -1
  21. package/lib/components/ReferenceGroupToggle/index.js +1 -1
  22. package/lib/components/ReferenceGroupToggle/index.js.map +1 -1
  23. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js +3 -0
  24. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -1
  25. package/lib/components/ReferenceGroupToggle/{useReferenceGroupToggleStyles.js → useReferenceGroupToggleStyles.styles.js} +25 -3
  26. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js.map +1 -0
  27. package/lib/components/ReferenceList/ReferenceList.js +1 -1
  28. package/lib/components/ReferenceList/ReferenceList.js.map +1 -1
  29. package/lib/components/ReferenceList/index.js +1 -1
  30. package/lib/components/ReferenceList/index.js.map +1 -1
  31. package/lib/components/ReferenceList/useReferenceList.js +1 -1
  32. package/lib/components/ReferenceList/useReferenceList.js.map +1 -1
  33. package/lib/components/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js} +3 -1
  34. package/lib/components/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
  35. package/lib/components/reference-v2/Reference/Reference.js +1 -1
  36. package/lib/components/reference-v2/Reference/Reference.js.map +1 -1
  37. package/lib/components/reference-v2/Reference/Reference.types.js.map +1 -1
  38. package/lib/components/reference-v2/Reference/index.js +1 -1
  39. package/lib/components/reference-v2/Reference/index.js.map +1 -1
  40. package/lib/components/reference-v2/Reference/renderReference.js +1 -1
  41. package/lib/components/reference-v2/Reference/renderReference.js.map +1 -1
  42. package/lib/components/reference-v2/Reference/useReference.js +9 -17
  43. package/lib/components/reference-v2/Reference/useReference.js.map +1 -1
  44. package/lib/components/reference-v2/Reference/{useReferenceStyles.js → useReferenceStyles.styles.js} +14 -34
  45. package/lib/components/reference-v2/Reference/useReferenceStyles.styles.js.map +1 -0
  46. package/lib/components/reference-v2/ReferenceList/ReferenceList.js +1 -1
  47. package/lib/components/reference-v2/ReferenceList/ReferenceList.js.map +1 -1
  48. package/lib/components/reference-v2/ReferenceList/ReferenceList.types.js.map +1 -1
  49. package/lib/components/reference-v2/ReferenceList/index.js +1 -1
  50. package/lib/components/reference-v2/ReferenceList/index.js.map +1 -1
  51. package/lib/components/reference-v2/ReferenceList/useReferenceList.js +10 -10
  52. package/lib/components/reference-v2/ReferenceList/useReferenceList.js.map +1 -1
  53. package/lib/components/reference-v2/ReferenceList/useReferenceListContextValues.js +8 -6
  54. package/lib/components/reference-v2/ReferenceList/useReferenceListContextValues.js.map +1 -1
  55. package/lib/components/reference-v2/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js} +3 -1
  56. package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
  57. package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js +1 -1
  58. package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -1
  59. package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map +1 -1
  60. package/lib/components/reference-v2/ReferenceOverflowButton/index.js +1 -1
  61. package/lib/components/reference-v2/ReferenceOverflowButton/index.js.map +1 -1
  62. package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +23 -19
  63. package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -1
  64. package/lib/components/reference-v2/ReferenceOverflowButton/{useReferenceOverflowButtonStyles.js → useReferenceOverflowButtonStyles.styles.js} +5 -21
  65. package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js.map +1 -0
  66. package/lib/contexts/reference-v2/referenceListContext.js +5 -4
  67. package/lib/contexts/reference-v2/referenceListContext.js.map +1 -1
  68. package/lib/hooks/reference-v2/useReferenceCitationPreview.js +8 -5
  69. package/lib/hooks/reference-v2/useReferenceCitationPreview.js.map +1 -1
  70. package/lib-commonjs/components/Citation/Citation.js +2 -2
  71. package/lib-commonjs/components/Citation/Citation.js.map +1 -1
  72. package/lib-commonjs/components/Citation/index.js +1 -1
  73. package/lib-commonjs/components/Citation/index.js.map +1 -1
  74. package/lib-commonjs/components/Citation/{useCitationStyles.js → useCitationStyles.styles.js} +2 -1
  75. package/lib-commonjs/components/Citation/useCitationStyles.styles.js.map +1 -0
  76. package/lib-commonjs/components/Reference/Reference.js +2 -2
  77. package/lib-commonjs/components/Reference/Reference.js.map +1 -1
  78. package/lib-commonjs/components/Reference/index.js +1 -1
  79. package/lib-commonjs/components/Reference/index.js.map +1 -1
  80. package/lib-commonjs/components/Reference/useReference.js +2 -2
  81. package/lib-commonjs/components/Reference/useReference.js.map +1 -1
  82. package/lib-commonjs/components/Reference/{useReferenceStyles.js → useReferenceStyles.styles.js} +2 -1
  83. package/lib-commonjs/components/Reference/useReferenceStyles.styles.js.map +1 -0
  84. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js +2 -2
  85. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -1
  86. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -1
  87. package/lib-commonjs/components/ReferenceGroupToggle/index.js +1 -1
  88. package/lib-commonjs/components/ReferenceGroupToggle/index.js.map +1 -1
  89. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js +3 -0
  90. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -1
  91. package/lib-commonjs/components/ReferenceGroupToggle/{useReferenceGroupToggleStyles.js → useReferenceGroupToggleStyles.styles.js} +28 -2
  92. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js.map +1 -0
  93. package/lib-commonjs/components/ReferenceList/ReferenceList.js +2 -2
  94. package/lib-commonjs/components/ReferenceList/ReferenceList.js.map +1 -1
  95. package/lib-commonjs/components/ReferenceList/index.js +1 -1
  96. package/lib-commonjs/components/ReferenceList/index.js.map +1 -1
  97. package/lib-commonjs/components/ReferenceList/useReferenceList.js +2 -2
  98. package/lib-commonjs/components/ReferenceList/useReferenceList.js.map +1 -1
  99. package/lib-commonjs/components/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js} +2 -1
  100. package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
  101. package/lib-commonjs/components/reference-v2/Reference/Reference.js +2 -2
  102. package/lib-commonjs/components/reference-v2/Reference/Reference.js.map +1 -1
  103. package/lib-commonjs/components/reference-v2/Reference/Reference.types.js.map +1 -1
  104. package/lib-commonjs/components/reference-v2/Reference/index.js +4 -4
  105. package/lib-commonjs/components/reference-v2/Reference/index.js.map +1 -1
  106. package/lib-commonjs/components/reference-v2/Reference/renderReference.js +1 -1
  107. package/lib-commonjs/components/reference-v2/Reference/renderReference.js.map +1 -1
  108. package/lib-commonjs/components/reference-v2/Reference/useReference.js +9 -14
  109. package/lib-commonjs/components/reference-v2/Reference/useReference.js.map +1 -1
  110. package/lib-commonjs/components/reference-v2/Reference/{useReferenceStyles.js → useReferenceStyles.styles.js} +13 -48
  111. package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.js.map +1 -0
  112. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js +2 -2
  113. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js.map +1 -1
  114. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.types.js.map +1 -1
  115. package/lib-commonjs/components/reference-v2/ReferenceList/index.js +1 -1
  116. package/lib-commonjs/components/reference-v2/ReferenceList/index.js.map +1 -1
  117. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js +11 -9
  118. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js.map +1 -1
  119. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js +5 -4
  120. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js.map +1 -1
  121. package/lib-commonjs/components/reference-v2/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js} +2 -1
  122. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
  123. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js +2 -2
  124. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -1
  125. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map +1 -1
  126. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/index.js +1 -1
  127. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/index.js.map +1 -1
  128. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +26 -17
  129. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -1
  130. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/{useReferenceOverflowButtonStyles.js → useReferenceOverflowButtonStyles.styles.js} +3 -33
  131. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js.map +1 -0
  132. package/lib-commonjs/contexts/reference-v2/referenceListContext.js +5 -4
  133. package/lib-commonjs/contexts/reference-v2/referenceListContext.js.map +1 -1
  134. package/lib-commonjs/hooks/reference-v2/useReferenceCitationPreview.js +8 -5
  135. package/lib-commonjs/hooks/reference-v2/useReferenceCitationPreview.js.map +1 -1
  136. package/package.json +10 -10
  137. package/lib/components/Citation/useCitationStyles.js.map +0 -1
  138. package/lib/components/Reference/useReferenceStyles.js.map +0 -1
  139. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +0 -1
  140. package/lib/components/ReferenceList/useReferenceListStyles.js.map +0 -1
  141. package/lib/components/reference-v2/Reference/useReferenceStyles.js.map +0 -1
  142. package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.js.map +0 -1
  143. package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.js.map +0 -1
  144. package/lib-commonjs/components/Citation/useCitationStyles.js.map +0 -1
  145. package/lib-commonjs/components/Reference/useReferenceStyles.js.map +0 -1
  146. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +0 -1
  147. package/lib-commonjs/components/ReferenceList/useReferenceListStyles.js.map +0 -1
  148. package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.js.map +0 -1
  149. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.js.map +0 -1
  150. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.js.map +0 -1
@@ -2,5 +2,5 @@ export * from './ReferenceOverflowButton';
2
2
  export * from './ReferenceOverflowButton.types';
3
3
  export * from './renderReferenceOverflowButton';
4
4
  export * from './useReferenceOverflowButton';
5
- export * from './useReferenceOverflowButtonStyles';
5
+ export * from './useReferenceOverflowButtonStyles.styles';
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +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"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ReferenceOverflowButton';\nexport * from './ReferenceOverflowButton.types';\nexport * from './renderReferenceOverflowButton';\nexport * from './useReferenceOverflowButton';\nexport * from './useReferenceOverflowButtonStyles.styles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,4BAA4B;AAC1C,cAAc,kCAAkC;AAChD,cAAc,kCAAkC;AAChD,cAAc,+BAA+B;AAC7C,cAAc,4CAA4C"}
@@ -13,6 +13,8 @@ import { useReferenceListContext_unstable } from '../../../contexts/reference-v2
13
13
  * @param ref - reference to root HTMLElement of ReferenceOverflowButton
14
14
  */
15
15
  export const useReferenceOverflowButton_unstable = (props, ref) => {
16
+ 'use no memo';
17
+
16
18
  const {
17
19
  children,
18
20
  text
@@ -21,40 +23,47 @@ export const useReferenceOverflowButton_unstable = (props, ref) => {
21
23
  const [setTimeout] = useTimeout();
22
24
  const {
23
25
  areReferencesExpanded,
24
- ctxAppearance,
25
- previousOverflowCount,
26
+ maxVisibleReferences,
27
+ referenceListRef,
28
+ totalReferencesCount,
26
29
  triggeredViaKeyboard
27
30
  } = useReferenceListContext_unstable(ctx => ({
28
- ctxAppearance: ctx.appearance,
29
31
  areReferencesExpanded: ctx.areReferencesExpanded,
30
- previousOverflowCount: ctx.previousOverflowCount,
32
+ maxVisibleReferences: ctx.maxVisibleReferences,
33
+ referenceListRef: ctx.referenceListRef,
34
+ totalReferencesCount: ctx.totalReferencesCount,
31
35
  triggeredViaKeyboard: ctx.overflowButtonTriggeredViaKeyboard
32
36
  }));
33
- const appearance = props.appearance || ctxAppearance;
34
37
  const {
35
38
  isOverflowing,
36
39
  overflowCount
37
40
  } = useOverflowMenu();
38
41
  const processedText = children !== null && children !== void 0 ? children : typeof text === 'function' ? text(overflowCount) : text;
39
42
  const {
40
- findPrevFocusable
43
+ findFirstFocusable,
44
+ findNextFocusable
41
45
  } = useFocusFinders();
42
46
  const onKeyDown = React.useCallback(ev => {
43
47
  if (ev.key === Enter || ev.key === Space) {
44
48
  triggeredViaKeyboard.current = true;
45
49
  }
46
50
  }, [triggeredViaKeyboard]);
47
- // When the references are expanded or contracted via keyboard, we need to move focus to the appropriate element.
51
+ // We keep track of the previous overflow count to help determine the element to move focus to when expanding the references via keyboard.
52
+ const previousOverflow = React.useRef(0);
53
+ // When the references are expanded or collapsed via keyboard, we need to move focus to the appropriate element.
48
54
  React.useEffect(() => {
49
- if (triggeredViaKeyboard.current) {
55
+ // We only try to move focus if maxVisibleReferences is set and the overflow button was triggered via keyboard.
56
+ if (maxVisibleReferences !== undefined && triggeredViaKeyboard.current) {
50
57
  let elementToFocus;
51
- // If the references are contracted, we move focus to the overflow button.
58
+ // If the references are collapsed, we move focus to the overflow button.
52
59
  if (!areReferencesExpanded) {
53
60
  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);
61
+ previousOverflow.current = overflowCount;
62
+ } else if (rootRef.current && referenceListRef.current) {
63
+ const positionToFocus = maxVisibleReferences < totalReferencesCount - previousOverflow.current ? maxVisibleReferences : totalReferencesCount - previousOverflow.current;
64
+ let currentElement = findFirstFocusable(referenceListRef.current);
65
+ for (let i = 0; i < positionToFocus && currentElement; i++) {
66
+ currentElement = findNextFocusable(currentElement);
58
67
  }
59
68
  elementToFocus = currentElement;
60
69
  }
@@ -64,13 +73,8 @@ export const useReferenceOverflowButton_unstable = (props, ref) => {
64
73
  triggeredViaKeyboard.current = false;
65
74
  }, 0);
66
75
  }
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]);
76
+ }, [areReferencesExpanded, findFirstFocusable, findNextFocusable, isOverflowing, maxVisibleReferences, overflowCount, referenceListRef, setTimeout, totalReferencesCount, triggeredViaKeyboard]);
72
77
  const state = {
73
- appearance,
74
78
  shouldRenderOverflowButton: isOverflowing || areReferencesExpanded,
75
79
  components: {
76
80
  root: 'button'
@@ -1 +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,EAAE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QAAuBO;QAAeJ;KAAqB;IAG9D,MAAMkB,QAAsC;QAC1ChB;QACAiB,4BAA4Bf,iBAAiBP;QAE7CuB,YAAY;YACVC,MAAM;QACR;QAEAA,MAAMtC,KAAKuC,MAAM,CACfzC,yBAAyB,UAAU;YACjCU,KAAKN,cAAcS,SAASH;YAC5B,GAAGD,KAAK;QACV,IACA;YACEiC,cAAc;gBACZ/B,UAAUc;YACZ;YACAkB,aAAa;QACf;IAEJ;IAEAN,MAAMG,IAAI,CAACb,SAAS,GAAG1B,eAAe0B,WAAWlB,MAAMkB,SAAS;IAEhE,OAAOU;AACT,EAAE"}
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 'use no memo';\n\n const { children, text } = props;\n\n const rootRef = React.useRef<HTMLButtonElement>(null);\n\n const [setTimeout] = useTimeout();\n\n const { areReferencesExpanded, maxVisibleReferences, referenceListRef, totalReferencesCount, triggeredViaKeyboard } =\n useReferenceListContext_unstable(ctx => ({\n areReferencesExpanded: ctx.areReferencesExpanded,\n maxVisibleReferences: ctx.maxVisibleReferences,\n referenceListRef: ctx.referenceListRef,\n totalReferencesCount: ctx.totalReferencesCount,\n triggeredViaKeyboard: ctx.overflowButtonTriggeredViaKeyboard,\n }));\n\n const { isOverflowing, overflowCount } = useOverflowMenu();\n\n const processedText = children ?? (typeof text === 'function' ? text(overflowCount) : text);\n\n const { findFirstFocusable, findNextFocusable } = 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 // We keep track of the previous overflow count to help determine the element to move focus to when expanding the references via keyboard.\n const previousOverflow = React.useRef(0);\n\n // When the references are expanded or collapsed via keyboard, we need to move focus to the appropriate element.\n React.useEffect(() => {\n // We only try to move focus if maxVisibleReferences is set and the overflow button was triggered via keyboard.\n if (maxVisibleReferences !== undefined && triggeredViaKeyboard.current) {\n let elementToFocus: HTMLElement | null | undefined;\n\n // If the references are collapsed, we move focus to the overflow button.\n if (!areReferencesExpanded) {\n elementToFocus = rootRef.current;\n previousOverflow.current = overflowCount;\n }\n // If the references are expanded, we move focus to the first reference that was hidden when they were collapsed.\n // We do this by moving focus according to the following heuristics:\n // - If maxVisibleReferences is what determines what overflows, focus is moved to the element that is in the maxVisibleReferences position of the ReferenceList's children.\n // - If the space available is what is determines what overflows, focus is moved to the element that is in the (totalReferencesCount - overflowCount) position of the ReferenceList's children.\n else if (rootRef.current && referenceListRef.current) {\n const positionToFocus =\n maxVisibleReferences < totalReferencesCount - previousOverflow.current\n ? maxVisibleReferences\n : totalReferencesCount - previousOverflow.current;\n\n let currentElement: HTMLElement | null | undefined = findFirstFocusable(referenceListRef.current);\n for (let i = 0; i < positionToFocus && currentElement; i++) {\n currentElement = findNextFocusable(currentElement);\n }\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 areReferencesExpanded,\n findFirstFocusable,\n findNextFocusable,\n isOverflowing,\n maxVisibleReferences,\n overflowCount,\n referenceListRef,\n setTimeout,\n totalReferencesCount,\n triggeredViaKeyboard,\n ]);\n\n const state: ReferenceOverflowButtonState = {\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","maxVisibleReferences","referenceListRef","totalReferencesCount","triggeredViaKeyboard","ctx","overflowButtonTriggeredViaKeyboard","isOverflowing","overflowCount","processedText","findFirstFocusable","findNextFocusable","onKeyDown","useCallback","ev","key","current","previousOverflow","useEffect","undefined","elementToFocus","positionToFocus","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,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uBAAuBE,uBAAuBc,iBAAiBD,OAAO,GAClEf,uBACAE,uBAAuBc,iBAAiBD,OAAO;gBAErD,IAAIM,iBAAiDZ,mBAAmBR,iBAAiBc,OAAO;gBAChG,IAAK,IAAIO,IAAI,GAAGA,IAAIF,mBAAmBC,gBAAgBC,IAAK;oBAC1DD,iBAAiBX,kBAAkBW;gBACrC;gBAEAF,iBAAiBE;YACnB;YAEA,+IAA+I;YAC/IvB,WAAW;gBACTqB,2BAAAA,qCAAAA,eAAgBI,KAAK;gBACrBpB,qBAAqBY,OAAO,GAAG;YACjC,GAAG;QACL;IACF,GAAG;QACDhB;QACAU;QACAC;QACAJ;QACAN;QACAO;QACAN;QACAH;QACAI;QACAC;KACD;IAED,MAAMqB,QAAsC;QAC1CC,4BAA4BnB,iBAAiBP;QAE7C2B,YAAY;YACVC,MAAM;QACR;QAEAA,MAAM1C,KAAK2C,MAAM,CACf7C,yBAAyB,UAAU;YACjCU,KAAKN,cAAcS,SAASH;YAC5B,GAAGD,KAAK;QACV,IACA;YACEqC,cAAc;gBACZnC,UAAUc;YACZ;YACAsB,aAAa;QACf;IAEJ;IAEAN,MAAMG,IAAI,CAAChB,SAAS,GAAG3B,eAAe2B,WAAWnB,MAAMmB,SAAS;IAEhE,OAAOa;AACT,EAAE"}
@@ -1,4 +1,4 @@
1
- import { __resetStyles, __styles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';
1
+ import { __resetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';
2
2
  export const referenceOverflowButtonClassNames = {
3
3
  root: 'fai-ReferenceOverflowButton'
4
4
  };
@@ -6,30 +6,14 @@ export const referenceOverflowButtonClassNames = {
6
6
  * Styles for the root slot
7
7
  */
8
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
9
  /**
24
10
  * Apply styling to the ReferenceOverflowButton slots based on the state
25
11
  */
26
12
  export const useReferenceOverflowButtonStyles_unstable = state => {
27
- const {
28
- appearance
29
- } = state;
13
+ 'use no memo';
14
+
30
15
  const rootBaseClassName = useRootBaseClassName();
31
- const rootStyles = useRootStyles();
32
- state.root.className = mergeClasses(referenceOverflowButtonClassNames.root, rootBaseClassName, appearance === 'darker' && rootStyles.darker, state.root.className);
16
+ state.root.className = mergeClasses(referenceOverflowButtonClassNames.root, rootBaseClassName, state.root.className);
33
17
  return state;
34
18
  };
35
- //# sourceMappingURL=useReferenceOverflowButtonStyles.js.map
19
+ //# sourceMappingURL=useReferenceOverflowButtonStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useReferenceOverflowButtonStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens, typographyStyles } 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\n/**\n * Apply styling to the ReferenceOverflowButton slots based on the state\n */\nexport const useReferenceOverflowButtonStyles_unstable = (\n state: ReferenceOverflowButtonState,\n): ReferenceOverflowButtonState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n\n state.root.className = mergeClasses(referenceOverflowButtonClassNames.root, rootBaseClassName, state.root.className);\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","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","useReferenceOverflowButtonStyles_unstable","state","rootBaseClassName","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAIrG,OAAO,MAAMC,oCAAkF;IAC7FC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,uBAAuBN,gBAAgB;IAC3CO,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;;CAEC,GACD,OAAO,MAAMC,4CAA4C,CACvDC;IAEA;IAEA,MAAMC,oBAAoBxB;IAE1BuB,MAAMxB,IAAI,CAAC0B,SAAS,GAAG9B,aAAaG,kCAAkCC,IAAI,EAAEyB,mBAAmBD,MAAMxB,IAAI,CAAC0B,SAAS;IAEnH,OAAOF;AACT,EAAE"}
@@ -1,15 +1,16 @@
1
1
  import { createContext, useContextSelector } from '@fluentui/react-context-selector';
2
2
  export const ReferenceListContext = createContext(undefined);
3
3
  const referenceListContextDefaultValue = {
4
- appearance: 'lighter',
5
4
  areReferencesExpanded: false,
5
+ maxVisibleReferences: undefined,
6
6
  overflowButtonTriggeredViaKeyboard: {
7
7
  current: false
8
8
  },
9
- previousOverflowCount: {
10
- current: 0
9
+ referenceListRef: {
10
+ current: null
11
11
  },
12
- shouldUseOverflow: false
12
+ shouldUseOverflow: false,
13
+ totalReferencesCount: 0
13
14
  };
14
15
  export const ReferenceListContextProvider = ReferenceListContext.Provider;
15
16
  export const useReferenceListContext_unstable = selector => useContextSelector(ReferenceListContext, (ctx = referenceListContextDefaultValue) => selector(ctx));
@@ -1 +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"}
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 | 'areReferencesExpanded'\n | 'maxVisibleReferences'\n | 'overflowButtonTriggeredViaKeyboard'\n | 'referenceListRef'\n | 'shouldUseOverflow'\n | 'totalReferencesCount'\n>;\n\nexport const ReferenceListContext: Context<ReferenceListContextValue> = createContext<\n ReferenceListContextValue | undefined\n>(undefined) as Context<ReferenceListContextValue>;\n\nconst referenceListContextDefaultValue: ReferenceListContextValue = {\n areReferencesExpanded: false,\n maxVisibleReferences: undefined,\n overflowButtonTriggeredViaKeyboard: { current: false },\n referenceListRef: { current: null },\n shouldUseOverflow: false,\n totalReferencesCount: 0,\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","areReferencesExpanded","maxVisibleReferences","overflowButtonTriggeredViaKeyboard","current","referenceListRef","shouldUseOverflow","totalReferencesCount","ReferenceListContextProvider","Provider","useReferenceListContext_unstable","selector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,mCAAmC;AAiBrF,OAAO,MAAMC,uBAA2DF,cAEtEG,WAAiD;AAEnD,MAAMC,mCAA8D;IAClEC,uBAAuB;IACvBC,sBAAsBH;IACtBI,oCAAoC;QAAEC,SAAS;IAAM;IACrDC,kBAAkB;QAAED,SAAS;IAAK;IAClCE,mBAAmB;IACnBC,sBAAsB;AACxB;AAEA,OAAO,MAAMC,+BAA+BV,qBAAqBW,QAAQ,CAAC;AAE1E,OAAO,MAAMC,mCAAmC,CAAIC,WAClDd,mBAAmBC,sBAAsB,CAACc,MAAMZ,gCAAgC,GAAKW,SAASC,MAAM"}
@@ -57,7 +57,7 @@ export const useReferenceCitationPreview = props => {
57
57
  tabIndex: -1,
58
58
  children: index
59
59
  }),
60
- media: referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.media,
60
+ media: referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.graphic,
61
61
  children: referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.children
62
62
  }), /*#__PURE__*/_jsx(PreviewMetadata, {
63
63
  icon: previewContentProps === null || previewContentProps === void 0 ? void 0 : previewContentProps.icon,
@@ -72,6 +72,11 @@ export const useReferenceCitationPreview = props => {
72
72
  });
73
73
  };
74
74
  const referenceWithPreview = props => {
75
+ const mergedReferenceProps = {
76
+ citation: index,
77
+ ...referenceProps,
78
+ ...props
79
+ };
75
80
  var _previewContentProps_content;
76
81
  return /*#__PURE__*/_jsxs(Preview, {
77
82
  closeOnScroll: true,
@@ -82,9 +87,7 @@ export const useReferenceCitationPreview = props => {
82
87
  ...referencePreviewProps,
83
88
  children: [/*#__PURE__*/_jsx(PreviewTrigger, {
84
89
  children: /*#__PURE__*/_jsx(Reference, {
85
- citation: index,
86
- ...referenceProps,
87
- ...props
90
+ ...mergedReferenceProps
88
91
  })
89
92
  }), /*#__PURE__*/_jsx(PreviewSurface, {
90
93
  ...referencePreviewSurfaceProps,
@@ -96,7 +99,7 @@ export const useReferenceCitationPreview = props => {
96
99
  tabIndex: -1,
97
100
  children: index
98
101
  }),
99
- media: referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.media,
102
+ media: referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.graphic,
100
103
  children: referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.children
101
104
  }), /*#__PURE__*/_jsx(PreviewMetadata, {
102
105
  icon: previewContentProps === null || previewContentProps === void 0 ? void 0 : previewContentProps.icon,
@@ -1 +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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,YAAYA,WAAW,QAAQ;AAE/B,SAASC,cAAc,EAAEC,0BAA0B,QAAQ,6BAA6B;AAExF,SACEC,OAAO,EACPC,cAAc,EACdC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,cAAc,QACT,kCAAkC;AACzC,SAASC,gBAAgB,QAAQ,4CAA4C;AAS7E,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,SAAS,QAAQ,oBAAoB;AAgC9C,6IAA6I;AAC7I,MAAMC,sBAAsB,CAACC;IAC3B,MAAMC,iBAAiBZ,2BAA2Ba,CAAAA,UAAWA,QAAQC,OAAO;IAE5E,MAAMC,sBAAsBjB,MAAMkB,WAAW,CAC3CC,CAAAA;QACEL,eAAeK,IAAI;QAEnB,iBAAiB;QACjBA,GAAGC,cAAc;IACnB,GACA;QAACN;KAAe;IAGlB,MAAMO,6BAA6BpB,eAAegB,qBAAqBJ,yBAAyBS,OAAO;IAEvG,qBAAO,KAACZ;QAAU,GAAGG,wBAAwB;QAAES,SAASD;;AAC1D;AAEA,OAAO,MAAME,8BAA2DC,CAAAA;IACtE,MAAM,EACJC,oBAAoB,EACpBC,2BAA2B,EAC3BC,aAAa,EACbC,KAAK,EACLC,mBAAmB,EACnBC,qBAAqB,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B;;kCACnG,KAACtB;kCACC,cAAA,KAACG;4BAAU+B,UAAUd;4BAAQ,GAAGI,cAAc;4BAAG,GAAGR,KAAK;;;kCAE3D,KAACjB;wBAAgB,GAAGwB,4BAA4B;kCAC9C,cAAA,MAAC3B;;8CACC,KAACC;oCACCqC,wBACE,KAAC9B;wCAAoB+B,cAAY,CAAC,UAAU,EAAEf,MAAM,OAAO,CAAC;wCAAEgB,eAAc;wCAAIC,UAAU,CAAC;kDACxFjB;;oCAGLkB,KAAK,EAAEd,2BAAAA,qCAAAA,eAAgBc,KAAK;8CAE3Bd,2BAAAA,qCAAAA,eAAgBe,QAAQ;;8CAE3B,KAACzC;oCACC0C,IAAI,EAAEnB,gCAAAA,0CAAAA,oBAAqBmB,IAAI;oCAC/BC,WAAW,EAAEpB,gCAAAA,0CAAAA,oBAAqBoB,WAAW;oCAC7CC,aAAa,EAAErB,gCAAAA,0CAAAA,oBAAqBqB,aAAa;oCACjDC,YAAY,EAAEtB,gCAAAA,0CAAAA,oBAAqBsB,YAAY;;gCAEhDlB,uCAAyB,KAACxB;oCAAkB,GAAGwB,qBAAqB;;gCACpEJ,CAAAA,+BAAAA,gCAAAA,0CAAAA,oBAAqBuB,OAAO,cAA5BvB,0CAAAA,+BAAgCC,kCAAAA,4CAAAA,sBAAuBiB,QAAQ;;;;;;QAK1E;QAEA,OAAO;YACLrC,UAAU0B;YACVzB,WAAW0C;QACb;IACF,GAAG;QACD5B;QACAC;QACAC;QACAC;QACAE;QACAC;QACAC;QACAH;QACAI;KACD;IAED,OAAOC;AACT,EAAE"}
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?.graphic 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 const mergedReferenceProps = {\n citation: index,\n ...referenceProps,\n ...props,\n } as ReferenceProps;\n\n return (\n <Preview closeOnScroll positioning=\"below\" size=\"small\" trapFocus withArrow {...referencePreviewProps}>\n <PreviewTrigger>\n <Reference {...mergedReferenceProps} />\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?.graphic 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","graphic","children","icon","primaryText","secondaryText","tertiaryText","content","referenceWithPreview","mergedReferenceProps"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,YAAYA,WAAW,QAAQ;AAE/B,SAASC,cAAc,EAAEC,0BAA0B,QAAQ,6BAA6B;AAExF,SACEC,OAAO,EACPC,cAAc,EACdC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,cAAc,QACT,kCAAkC;AACzC,SAASC,gBAAgB,QAAQ,4CAA4C;AAS7E,SAASC,QAAQ,QAAQ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YAAY;;gCAEhDnB,uCAAyB,KAACxB;oCAAkB,GAAGwB,qBAAqB;;gCACpEJ,CAAAA,+BAAAA,gCAAAA,0CAAAA,oBAAqBwB,OAAO,cAA5BxB,0CAAAA,+BAAgCC,kCAAAA,4CAAAA,sBAAuBkB,QAAQ;;;;;;QAK1E;QAEA,OAAO;YACLtC,UAAU0B;YACVzB,WAAW2C;QACb;IACF,GAAG;QACD7B;QACAC;QACAC;QACAC;QACAE;QACAC;QACAC;QACAH;QACAI;KACD;IAED,OAAOC;AACT,EAAE"}
@@ -12,11 +12,11 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _useCitation = require("./useCitation");
14
14
  const _renderCitation = require("./renderCitation");
15
- const _useCitationStyles = require("./useCitationStyles");
15
+ const _useCitationStylesstyles = require("./useCitationStyles.styles");
16
16
  const _reactprovider = require("@fluentui-copilot/react-provider");
17
17
  const Citation = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
18
18
  const state = (0, _useCitation.useCitation_unstable)(props, ref);
19
- (0, _useCitationStyles.useCitationStyles_unstable)(state);
19
+ (0, _useCitationStylesstyles.useCitationStyles_unstable)(state);
20
20
  (0, _reactprovider.useCustomStyleHook)('useCitationStyles')(state);
21
21
  return (0, _renderCitation.renderCitation_unstable)(state);
22
22
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["Citation.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useCitation_unstable } from './useCitation';\nimport { renderCitation_unstable } from './renderCitation';\nimport { useCitationStyles_unstable } from './useCitationStyles';\nimport type { CitationProps } from './Citation.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\n// Citation component - TODO: add more docs\nexport const Citation: ForwardRefComponent<CitationProps> = React.forwardRef((props, ref) => {\n const state = useCitation_unstable(props, ref);\n\n useCitationStyles_unstable(state);\n useCustomStyleHook('useCitationStyles')(state);\n\n return renderCitation_unstable(state);\n});\n\nCitation.displayName = 'Citation';\n"],"names":["Citation","React","forwardRef","props","state","useCitation_unstable","useCitationStyles_unstable","useCustomStyleHook","renderCitation_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;;iEATU;6BACc;gCACG;mCACG;+BAGR;AAG5B,MAAMA,WAAAA,WAAAA,GAAAA,OAA+CC,UAAMC,CAAU,CAACC,OAACA;UAC5EC,QAAMA,IAAAA,iCAAQC,EAAAA,OAAqBF;qDAEnCG,EAAAA;yCACAC,EAAAA,qBAAmBH;WAEnBI,IAAAA,uCAAOA,EAAAA;AACT;AAEAR,SAASS,WAAW,GAAG"}
1
+ {"version":3,"sources":["Citation.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useCitation_unstable } from './useCitation';\nimport { renderCitation_unstable } from './renderCitation';\nimport { useCitationStyles_unstable } from './useCitationStyles.styles';\nimport type { CitationProps } from './Citation.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\n// Citation component - TODO: add more docs\nexport const Citation: ForwardRefComponent<CitationProps> = React.forwardRef((props, ref) => {\n const state = useCitation_unstable(props, ref);\n\n useCitationStyles_unstable(state);\n useCustomStyleHook('useCitationStyles')(state);\n\n return renderCitation_unstable(state);\n});\n\nCitation.displayName = 'Citation';\n"],"names":["Citation","React","forwardRef","props","state","useCitation_unstable","useCitationStyles_unstable","useCustomStyleHook","renderCitation_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;;iEATU;6BACc;gCACG;yCACG;+BAGR;AAG5B,MAAMA,WAAAA,WAAAA,GAAAA,OAA+CC,UAAMC,CAAU,CAACC,OAACA;UAC5EC,QAAMA,IAAAA,iCAAQC,EAAAA,OAAqBF;2DAEnCG,EAAAA;yCACAC,EAAAA,qBAAmBH;WAEnBI,IAAAA,uCAAOA,EAAAA;AACT;AAEAR,SAASS,WAAW,GAAG"}
@@ -7,5 +7,5 @@ _export_star._(require("./Citation"), exports);
7
7
  _export_star._(require("./Citation.types"), exports);
8
8
  _export_star._(require("./renderCitation"), exports);
9
9
  _export_star._(require("./useCitation"), exports);
10
- _export_star._(require("./useCitationStyles"), exports);
10
+ _export_star._(require("./useCitationStyles.styles"), exports);
11
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Citation';\nexport * from './Citation.types';\nexport * from './renderCitation';\nexport * from './useCitation';\nexport * from './useCitationStyles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Citation';\nexport * from './Citation.types';\nexport * from './renderCitation';\nexport * from './useCitation';\nexport * from './useCitationStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -88,8 +88,9 @@ const useCitationRootStyles = (0, _reactcomponents.__styles)({
88
88
  ]
89
89
  });
90
90
  const useCitationStyles_unstable = (state)=>{
91
+ 'use no memo';
91
92
  const rootBaseClassName = useCitationBaseClassName();
92
93
  const rootStyles = useCitationRootStyles();
93
94
  state.root.className = (0, _reactcomponents.mergeClasses)(citationClassNames.root, state.isPopoverLocked && rootStyles.isPopoverLocked, state.block && rootStyles.isBlock, rootBaseClassName, state.root.className);
94
95
  return state;
95
- }; //# sourceMappingURL=useCitationStyles.js.map
96
+ }; //# sourceMappingURL=useCitationStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useCitationStyles.styles.ts"],"sourcesContent":["import {\n makeResetStyles,\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport type { CitationSlots, CitationState } from './Citation.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const citationClassNames: SlotClassNames<CitationSlots> = {\n root: 'fai-Citation',\n};\n\nconst useCitationBaseClassName = makeResetStyles({\n display: 'inline-flex',\n justifyContent: 'center',\n boxSizing: 'border-box',\n alignItems: 'center',\n ...typographyStyles.caption2Strong,\n\n color: tokens.colorNeutralForeground2,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,\n\n minWidth: '14px',\n height: '14px',\n verticalAlign: `calc((${typographyStyles.caption2Strong.lineHeight} - ${typographyStyles.caption2Strong.fontSize}) / 2)`,\n\n borderRadius: tokens.borderRadiusMedium,\n\n textDecoration: 'none',\n\n marginLeft: tokens.spacingHorizontalXXS,\n marginRight: tokens.spacingHorizontalXXS,\n\n ':hover': {\n cursor: 'pointer',\n color: tokens.colorBrandForeground2Hover,\n borderColor: tokens.colorBrandStroke2Hover,\n backgroundColor: tokens.colorBrandBackground2Hover,\n },\n\n ':hover:active': {\n cursor: 'pointer',\n color: tokens.colorBrandForeground2Pressed,\n borderColor: tokens.colorBrandStroke2Pressed,\n backgroundColor: tokens.colorBrandBackground2Pressed,\n },\n});\n\nconst useCitationRootStyles = makeStyles({\n isBlock: {\n display: 'flex',\n marginLeft: 0,\n marginRight: 0,\n },\n isPopoverLocked: {\n color: tokens.colorBrandForeground2Pressed,\n ...shorthands.borderColor(tokens.colorBrandStroke2Pressed),\n backgroundColor: tokens.colorBrandBackground2,\n ':hover': {\n color: tokens.colorBrandForeground2Pressed,\n ...shorthands.borderColor(tokens.colorBrandStroke2Pressed),\n backgroundColor: tokens.colorBrandBackground2,\n },\n },\n});\n\n/**\n * Apply styling to the Citation slots based on the state\n */\nexport const useCitationStyles_unstable = (state: CitationState): CitationState => {\n 'use no memo';\n\n const rootBaseClassName = useCitationBaseClassName();\n const rootStyles = useCitationRootStyles();\n\n state.root.className = mergeClasses(\n citationClassNames.root,\n state.isPopoverLocked && rootStyles.isPopoverLocked,\n state.block && rootStyles.isBlock,\n rootBaseClassName,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["citationClassNames","useCitationRootStyles","makeStyles","root","useCitationBaseClassName","makeResetStyles","display","__styles","justifyContent","boxSizing","alignItems","t21cq0","typographyStyles","caption2Strong","tokens","minWidth","height","verticalAlign","borderRadius","textDecoration","marginLeft","marginRight","Bgoe8wy","cursor","color","borderColor","colorBrandStroke2Hover","backgroundColor","state","className","mergeClasses","isPopoverLocked","rootStyles","block","isBlock","rootBaseClassName","colorBrandStroke2Pressed"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAWaA,kBAAAA;eAAAA;;IAwCPC,0BAAwBC;eAAxBD;;;iCA7CY;AAKX,MAAMD,qBAAoD;UAC/DG;AACF;AAEA,MAAMC,2BAA2BC,IAAAA,8BAAAA,EAAAA,WAAgB,YAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;CAAA;MAC/CC,wBAASC,IAAAA,yBAAA,EAAA;aACTC;QACAC,QAAAA;QACAC,QAAAA;YAAAA;YAAY;SAAA;QACZC,QAAGC;YAAAA;YAAiBC;SAAAA;;qBAGTC;QAEXC,QAAAA;QACAC,QAAQ;QACRC,QAAAA;YAAAA;YAAgB;SAAQL;QAExBM,SAAAA;QAEAC,QAAAA;YAAAA;YAAgB;SAAA;QAEhBC,QAAAA;QACAC,SAAAA;QAEAC,SAAA;iBACEC;YAAAA;YAAQ;SAAA;gBACRC;gBACAC;YAAAA;YAAaX;SAAOY;gBACpBC;;;;;QAIQ;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;;;QACkC;QAAA;QAAA;QAAA;QAAA;KAAA;;AAMxC1B,MAAAA,6BAAmC2B,CAAAA;;UAGrCR,oBAAYhB;UACZiB,aAAapB;UACfE,IAAA,CAAA0B,SAAA,GAAAC,IAAAA,6BAAA,EAAA9B,mBAAAG,IAAA,EAAAyB,MAAAG,eAAA,IAAAC,WAAAD,eAAA,EAAAH,MAAAK,KAAA,IAAAD,WAAAE,OAAA,EAAAC,mBAAAP,MAAAzB,IAAA,CAAA0B,SAAA;WACAE;uDAEmCK"}
@@ -12,11 +12,11 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _useReference = require("./useReference");
14
14
  const _renderReference = require("./renderReference");
15
- const _useReferenceStyles = require("./useReferenceStyles");
15
+ const _useReferenceStylesstyles = require("./useReferenceStyles.styles");
16
16
  const _reactprovider = require("@fluentui-copilot/react-provider");
17
17
  const Reference = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
18
18
  const state = (0, _useReference.useReference_unstable)(props, ref);
19
- (0, _useReferenceStyles.useReferenceStyles_unstable)(state);
19
+ (0, _useReferenceStylesstyles.useReferenceStyles_unstable)(state);
20
20
  (0, _reactprovider.useCustomStyleHook)('useReferenceStyles')(state);
21
21
  return (0, _renderReference.renderReference_unstable)(state);
22
22
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["Reference.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useReference_unstable } from './useReference';\nimport { renderReference_unstable } from './renderReference';\nimport { useReferenceStyles_unstable } from './useReferenceStyles';\nimport type { ReferenceProps } from './Reference.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\n// Reference component - TODO: add more docs\nexport const Reference: ForwardRefComponent<ReferenceProps> = React.forwardRef((props, ref) => {\n const state = useReference_unstable(props, ref);\n\n useReferenceStyles_unstable(state);\n useCustomStyleHook('useReferenceStyles')(state);\n\n return renderReference_unstable(state);\n});\n\nReference.displayName = 'Reference';\n"],"names":["Reference","React","forwardRef","props","state","useReference_unstable","useReferenceStyles_unstable","useCustomStyleHook","renderReference_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;;iEATU;8BACe;iCACG;oCACG;+BAGT;AAG5B,MAAMA,YAAAA,WAAAA,GAAAA,OAAiDC,UAAMC,CAAU,CAACC,OAACA;UAC9EC,QAAMA,IAAAA,mCAAQC,EAAAA,OAAsBF;uDAEpCG,EAAAA;yCACAC,EAAAA,sBAAmBH;WAEnBI,IAAAA,yCAAOA,EAAAA;AACT;AAEAR,UAAUS,WAAW,GAAG"}
1
+ {"version":3,"sources":["Reference.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useReference_unstable } from './useReference';\nimport { renderReference_unstable } from './renderReference';\nimport { useReferenceStyles_unstable } from './useReferenceStyles.styles';\nimport type { ReferenceProps } from './Reference.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\n// Reference component - TODO: add more docs\nexport const Reference: ForwardRefComponent<ReferenceProps> = React.forwardRef((props, ref) => {\n const state = useReference_unstable(props, ref);\n\n useReferenceStyles_unstable(state);\n useCustomStyleHook('useReferenceStyles')(state);\n\n return renderReference_unstable(state);\n});\n\nReference.displayName = 'Reference';\n"],"names":["Reference","React","forwardRef","props","state","useReference_unstable","useReferenceStyles_unstable","useCustomStyleHook","renderReference_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;;iEATU;8BACe;iCACG;0CACG;+BAGT;AAG5B,MAAMA,YAAAA,WAAAA,GAAAA,OAAiDC,UAAMC,CAAU,CAACC,OAACA;UAC9EC,QAAMA,IAAAA,mCAAQC,EAAAA,OAAsBF;6DAEpCG,EAAAA;yCACAC,EAAAA,sBAAmBH;WAEnBI,IAAAA,yCAAOA,EAAAA;AACT;AAEAR,UAAUS,WAAW,GAAG"}
@@ -7,5 +7,5 @@ _export_star._(require("./Reference"), exports);
7
7
  _export_star._(require("./Reference.types"), exports);
8
8
  _export_star._(require("./renderReference"), exports);
9
9
  _export_star._(require("./useReference"), exports);
10
- _export_star._(require("./useReferenceStyles"), exports);
10
+ _export_star._(require("./useReferenceStyles.styles"), exports);
11
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Reference';\nexport * from './Reference.types';\nexport * from './renderReference';\nexport * from './useReference';\nexport * from './useReferenceStyles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Reference';\nexport * from './Reference.types';\nexport * from './renderReference';\nexport * from './useReference';\nexport * from './useReferenceStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -12,7 +12,7 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactcomponents = require("@fluentui/react-components");
14
14
  const _reacticons = require("@fluentui/react-icons");
15
- const _useReferenceStyles = require("./useReferenceStyles");
15
+ const _useReferenceStylesstyles = require("./useReferenceStyles.styles");
16
16
  const _Citation = require("../Citation");
17
17
  const _ReferenceGroupContext = require("../../contexts/ReferenceGroupContext");
18
18
  const _reactprovider = require("@fluentui-copilot/react-provider");
@@ -40,7 +40,7 @@ const useReference_unstable = (props, ref)=>{
40
40
  });
41
41
  if (media && /*#__PURE__*/ _react.isValidElement(media.children)) {
42
42
  media.children = /*#__PURE__*/ _react.cloneElement(media.children, {
43
- className: (0, _reactcomponents.mergeClasses)(media.children.props.className, _useReferenceStyles.referenceExtraClassNames.mediaChild)
43
+ className: (0, _reactcomponents.mergeClasses)(media.children.props.className, _useReferenceStylesstyles.referenceExtraClassNames.mediaChild)
44
44
  });
45
45
  }
46
46
  if (media === null || media === void 0 ? void 0 : media.id) {
@@ -1 +1 @@
1
- {"version":3,"sources":["useReference.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Button,\n Caption1,\n getIntrinsicElementProps,\n mergeCallbacks,\n mergeClasses,\n slot,\n useId,\n usePopoverContext_unstable as usePopoverContext,\n} from '@fluentui/react-components';\nimport {\n ChevronDown24Regular,\n ChevronUp24Regular,\n ChevronDown16Regular,\n ChevronUp16Regular,\n} from '@fluentui/react-icons';\nimport { referenceExtraClassNames } from './useReferenceStyles';\nimport { Citation } from '../Citation';\nimport type { ReferenceProps, ReferenceState } from './Reference.types';\nimport { useReferenceGroupSetOpen } from '../../contexts/ReferenceGroupContext';\nimport { useCopilotMode } from '@fluentui-copilot/react-provider';\n\n/**\n * Create the state required to render Reference.\n *\n * The returned state can be modified with hooks such as useReferenceStyles_unstable,\n * before being passed to renderReference_unstable.\n *\n * @param props - props from this instance of Reference\n * @param ref - reference to root HTMLElement of Reference\n */\nexport const useReference_unstable = (props: ReferenceProps, ref: React.Ref<HTMLDivElement>): ReferenceState => {\n const { index, referenceId, citationHref, excerpt, layout = 'inline' } = props;\n\n const mode = useCopilotMode(props.mode);\n\n const labelId = useId();\n const mediaId = useId();\n const [isExpanded, setIsExpanded] = React.useState(layout === 'popover' ? true : false);\n\n const setPopoverOpen = usePopoverContext(context => context.setOpen);\n\n const onExpandClick: React.MouseEventHandler<HTMLButtonElement> = _e => {\n setIsExpanded(!isExpanded);\n };\n\n const label = slot.always(props.label, {\n defaultProps: { id: labelId },\n elementType: 'div',\n });\n const media = slot.optional(props.media, { defaultProps: { id: mediaId }, elementType: 'div' });\n if (media && React.isValidElement<HTMLElement>(media.children)) {\n media.children = React.cloneElement(media.children, {\n className: mergeClasses(media.children.props.className, referenceExtraClassNames.mediaChild),\n });\n }\n\n if (media?.id) {\n label['aria-describedby'] = label['aria-describedby']?.concat(media.id) ?? media.id;\n }\n\n const ariaLabelledByProp = props['aria-labelledby'];\n const groupSemantics = React.useMemo(() => {\n return layout === 'inline'\n ? {\n role: 'group',\n 'aria-labelledby': `${ariaLabelledByProp ?? ''} ${label.id}`,\n tabIndex: -1,\n }\n : {};\n }, [layout, ariaLabelledByProp, label.id]);\n\n // Within a popup, a citation should function as a close button\n const citationProps = React.useMemo(() => {\n const onPopoverCloseClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n setPopoverOpen(e, false);\n\n // don't navigate\n e.preventDefault();\n };\n\n return layout === 'popover'\n ? {\n referenceHref: '#',\n tabIndex: -1,\n 'aria-label': `Reference ${index}, close`,\n onClick: onPopoverCloseClick,\n }\n : {\n referenceHref: citationHref,\n };\n }, [layout, citationHref, index, setPopoverOpen]);\n\n const state: ReferenceState = {\n isExpanded,\n mode: layout === 'popover' ? 'sidecar' : mode,\n layout,\n index,\n components: {\n root: 'div',\n citation: 'div',\n media: 'div',\n actions: 'div',\n label: 'div',\n sensitivity: 'span',\n metadata: 'div',\n content: 'div',\n primaryText: 'span',\n secondaryText: 'span',\n tertiaryText: 'span',\n icon: 'span',\n detailsButton: Button,\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n id: referenceId,\n ...groupSemantics,\n ...props,\n }),\n { elementType: 'div' },\n ),\n citation: slot.optional(props.citation, {\n defaultProps: {\n children: (\n <Citation block {...citationProps}>\n {index}\n </Citation>\n ),\n },\n renderByDefault: true,\n elementType: 'div',\n }),\n media,\n actions: slot.optional(layout === 'inline' ? props.actions : null, {\n renderByDefault: true,\n elementType: 'div',\n }),\n label,\n sensitivity: slot.optional(props.sensitivity, { elementType: 'span' }),\n metadata: slot.always(props.metadata, { elementType: 'div' }),\n primaryText: slot.optional(props.primaryText, {\n defaultProps: {\n hidden: !isExpanded,\n },\n elementType: 'span',\n }),\n secondaryText: slot.optional(props.secondaryText, {\n defaultProps: {\n hidden: !isExpanded,\n },\n elementType: 'span',\n }),\n tertiaryText: slot.optional(props.tertiaryText, {\n defaultProps: {\n hidden: !isExpanded,\n },\n elementType: 'span',\n }),\n icon: slot.optional(props.icon, { elementType: 'span' }),\n content: slot.always(props.content, {\n defaultProps: {\n children: excerpt && <Caption1>{excerpt}</Caption1>,\n },\n elementType: 'div',\n }),\n detailsButton: slot.optional(layout === 'inline' ? props.detailsButton : null, {\n defaultProps: {\n appearance: 'transparent',\n 'aria-expanded': isExpanded,\n 'aria-label': 'show details',\n size: mode === 'sidecar' ? 'small' : 'medium',\n icon: {\n children: getIcon(isExpanded, mode),\n },\n },\n renderByDefault: true,\n elementType: Button,\n }),\n };\n\n if (state.detailsButton) {\n const onClick = state.detailsButton.onClick as React.MouseEventHandler<HTMLButtonElement>;\n state.detailsButton.onClick = mergeCallbacks(onClick, onExpandClick);\n }\n\n const referenceGroupSetOpen = useReferenceGroupSetOpen();\n const onTargettedByCitation = (e: React.FocusEvent<HTMLElement>) => {\n const relatedTargetHash: string | undefined = (e.relatedTarget as HTMLAnchorElement)?.hash;\n if (relatedTargetHash && relatedTargetHash.substring(1) === referenceId) {\n referenceGroupSetOpen();\n setIsExpanded(true);\n }\n };\n state.root.onFocus = mergeCallbacks(state.root.onFocus, onTargettedByCitation);\n\n return state;\n};\n\nconst getIcon = (isExpanded: boolean, mode: ReferenceProps['mode']): JSX.Element => {\n if (mode === 'sidecar') {\n return !isExpanded ? <ChevronDown16Regular /> : <ChevronUp16Regular />;\n }\n\n return !isExpanded ? <ChevronDown24Regular /> : <ChevronUp24Regular />;\n};\n"],"names":["index","citationHref","ref","referenceId","mediaId","isExpanded","excerpt","setPopoverOpen","layout","onExpandClick","mode","useCopilotMode","props","labelId","slot","always","defaultProps","usePopoverContext","context","setOpen","elementType","_e","setIsExpanded","label","media","children","React","className","mergeClasses","referenceExtraClassNames","mediaChild","id","_label_ariadescribedby_concat","_label_ariadescribedby","concat","ariaLabelledByProp","tabIndex","onPopoverCloseClick","e","useMemo","referenceHref","state","components","root","citation","actions","sensitivity","metadata","primaryText","secondaryText","tertiaryText","detailsButton","Button","optional","Citation","hidden","icon","content","createElement","Caption1","appearance","size","onClick","mergeCallbacks","onTargettedByCitation","_e_relatedTarget","relatedTargetHash","onFocus","getIcon","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CAAAA,mBAAyB1B,EAAAA,aAAAA,MAAAA,QAAAA,qBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,iBAAAA,IAAAA;iCACkBA,kBAAAA,SAAAA,CAAAA,OAAAA,aAAAA;;0BAC3C4B;;;UAGJvB,IAAA,CAAAwB,OAAA,GAAAJ,IAAAA,+BAAA,EAAAtB,MAAAE,IAAA,CAAAwB,OAAA,EAAAH;WACFvB;;MAGA2B,UAAO3B,CAAAA,YAAAA;IACP,IAAA/B,SAAA,WAAA;QAEF,OAAM0D,CAAAA,aAAW/D,WAAqBK,GAAAA,OAAAA,aAAAA,CAAAA,gCAAAA,EAAAA,QAAAA,WAAAA,GAAAA,OAAAA,aAAAA,CAAAA,8BAAAA,EAAAA;;WAElC,CAAAL,aAAQA,WAAAA,GAAAA,OAAAA,aAAa,CAAAgE,gCAACC,EAAAA,QAAAA,WAAAA,GAAAA,OAAAA,aAA0B,CAAAC,8BAACC,EAAAA;2CAG9B"}
1
+ {"version":3,"sources":["useReference.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Button,\n Caption1,\n getIntrinsicElementProps,\n mergeCallbacks,\n mergeClasses,\n slot,\n useId,\n usePopoverContext_unstable as usePopoverContext,\n} from '@fluentui/react-components';\nimport {\n ChevronDown24Regular,\n ChevronUp24Regular,\n ChevronDown16Regular,\n ChevronUp16Regular,\n} from '@fluentui/react-icons';\nimport { referenceExtraClassNames } from './useReferenceStyles.styles';\nimport { Citation } from '../Citation';\nimport type { ReferenceProps, ReferenceState } from './Reference.types';\nimport { useReferenceGroupSetOpen } from '../../contexts/ReferenceGroupContext';\nimport { useCopilotMode } from '@fluentui-copilot/react-provider';\n\n/**\n * Create the state required to render Reference.\n *\n * The returned state can be modified with hooks such as useReferenceStyles_unstable,\n * before being passed to renderReference_unstable.\n *\n * @param props - props from this instance of Reference\n * @param ref - reference to root HTMLElement of Reference\n */\nexport const useReference_unstable = (props: ReferenceProps, ref: React.Ref<HTMLDivElement>): ReferenceState => {\n const { index, referenceId, citationHref, excerpt, layout = 'inline' } = props;\n\n const mode = useCopilotMode(props.mode);\n\n const labelId = useId();\n const mediaId = useId();\n const [isExpanded, setIsExpanded] = React.useState(layout === 'popover' ? true : false);\n\n const setPopoverOpen = usePopoverContext(context => context.setOpen);\n\n const onExpandClick: React.MouseEventHandler<HTMLButtonElement> = _e => {\n setIsExpanded(!isExpanded);\n };\n\n const label = slot.always(props.label, {\n defaultProps: { id: labelId },\n elementType: 'div',\n });\n const media = slot.optional(props.media, { defaultProps: { id: mediaId }, elementType: 'div' });\n if (media && React.isValidElement<HTMLElement>(media.children)) {\n media.children = React.cloneElement(media.children, {\n className: mergeClasses(media.children.props.className, referenceExtraClassNames.mediaChild),\n });\n }\n\n if (media?.id) {\n label['aria-describedby'] = label['aria-describedby']?.concat(media.id) ?? media.id;\n }\n\n const ariaLabelledByProp = props['aria-labelledby'];\n const groupSemantics = React.useMemo(() => {\n return layout === 'inline'\n ? {\n role: 'group',\n 'aria-labelledby': `${ariaLabelledByProp ?? ''} ${label.id}`,\n tabIndex: -1,\n }\n : {};\n }, [layout, ariaLabelledByProp, label.id]);\n\n // Within a popup, a citation should function as a close button\n const citationProps = React.useMemo(() => {\n const onPopoverCloseClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n setPopoverOpen(e, false);\n\n // don't navigate\n e.preventDefault();\n };\n\n return layout === 'popover'\n ? {\n referenceHref: '#',\n tabIndex: -1,\n 'aria-label': `Reference ${index}, close`,\n onClick: onPopoverCloseClick,\n }\n : {\n referenceHref: citationHref,\n };\n }, [layout, citationHref, index, setPopoverOpen]);\n\n const state: ReferenceState = {\n isExpanded,\n mode: layout === 'popover' ? 'sidecar' : mode,\n layout,\n index,\n components: {\n root: 'div',\n citation: 'div',\n media: 'div',\n actions: 'div',\n label: 'div',\n sensitivity: 'span',\n metadata: 'div',\n content: 'div',\n primaryText: 'span',\n secondaryText: 'span',\n tertiaryText: 'span',\n icon: 'span',\n detailsButton: Button,\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n id: referenceId,\n ...groupSemantics,\n ...props,\n }),\n { elementType: 'div' },\n ),\n citation: slot.optional(props.citation, {\n defaultProps: {\n children: (\n <Citation block {...citationProps}>\n {index}\n </Citation>\n ),\n },\n renderByDefault: true,\n elementType: 'div',\n }),\n media,\n actions: slot.optional(layout === 'inline' ? props.actions : null, {\n renderByDefault: true,\n elementType: 'div',\n }),\n label,\n sensitivity: slot.optional(props.sensitivity, { elementType: 'span' }),\n metadata: slot.always(props.metadata, { elementType: 'div' }),\n primaryText: slot.optional(props.primaryText, {\n defaultProps: {\n hidden: !isExpanded,\n },\n elementType: 'span',\n }),\n secondaryText: slot.optional(props.secondaryText, {\n defaultProps: {\n hidden: !isExpanded,\n },\n elementType: 'span',\n }),\n tertiaryText: slot.optional(props.tertiaryText, {\n defaultProps: {\n hidden: !isExpanded,\n },\n elementType: 'span',\n }),\n icon: slot.optional(props.icon, { elementType: 'span' }),\n content: slot.always(props.content, {\n defaultProps: {\n children: excerpt && <Caption1>{excerpt}</Caption1>,\n },\n elementType: 'div',\n }),\n detailsButton: slot.optional(layout === 'inline' ? props.detailsButton : null, {\n defaultProps: {\n appearance: 'transparent',\n 'aria-expanded': isExpanded,\n 'aria-label': 'show details',\n size: mode === 'sidecar' ? 'small' : 'medium',\n icon: {\n children: getIcon(isExpanded, mode),\n },\n },\n renderByDefault: true,\n elementType: Button,\n }),\n };\n\n if (state.detailsButton) {\n const onClick = state.detailsButton.onClick as React.MouseEventHandler<HTMLButtonElement>;\n state.detailsButton.onClick = mergeCallbacks(onClick, onExpandClick);\n }\n\n const referenceGroupSetOpen = useReferenceGroupSetOpen();\n const onTargettedByCitation = (e: React.FocusEvent<HTMLElement>) => {\n const relatedTargetHash: string | undefined = (e.relatedTarget as HTMLAnchorElement)?.hash;\n if (relatedTargetHash && relatedTargetHash.substring(1) === referenceId) {\n referenceGroupSetOpen();\n setIsExpanded(true);\n }\n };\n state.root.onFocus = mergeCallbacks(state.root.onFocus, onTargettedByCitation);\n\n return state;\n};\n\nconst getIcon = (isExpanded: boolean, mode: ReferenceProps['mode']): JSX.Element => {\n if (mode === 'sidecar') {\n return !isExpanded ? <ChevronDown16Regular /> : <ChevronUp16Regular />;\n }\n\n return !isExpanded ? <ChevronDown24Regular /> : <ChevronUp24Regular />;\n};\n"],"names":["index","citationHref","ref","referenceId","mediaId","isExpanded","excerpt","setPopoverOpen","layout","onExpandClick","mode","useCopilotMode","props","labelId","slot","always","defaultProps","usePopoverContext","context","setOpen","elementType","_e","setIsExpanded","label","media","children","React","className","mergeClasses","referenceExtraClassNames","mediaChild","id","_label_ariadescribedby_concat","_label_ariadescribedby","concat","ariaLabelledByProp","tabIndex","onPopoverCloseClick","e","useMemo","referenceHref","state","components","root","citation","actions","sensitivity","metadata","primaryText","secondaryText","tertiaryText","detailsButton","Button","optional","Citation","hidden","icon","content","createElement","Caption1","appearance","size","onClick","mergeCallbacks","onTargettedByCitation","_e_relatedTarget","relatedTargetHash","onFocus","getIcon","ChevronDown24Regular","ChevronDown16Regular","ChevronUp24Regular","ChevronUp16Regular"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAiCUA;;;eAAAA;;;;iEAjCa;iCAUhB;4BAMA;0CACkC;0BAChB;uCAEgB;+BACV;AAY7B,MAAQA,wBAAoBC,CAAAA,OAAYC;UAExC,EAEAF,KAAA,EACAG,WAAMC,EACNH,YAAOI,EAEPC,OAAMC,EAENC,SAAMC,QAAAA;UAENC,OAAAC,IAAAA,6BAAA,EAAAC,MAAAF,IAAA;UAEAG,UAAcC,IAAAA,sBAAKC;UACjBC,UAAAA,IAA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"}
@@ -317,6 +317,7 @@ const useLabelStyles = (0, _reactcomponents.__styles)({
317
317
  ]
318
318
  });
319
319
  const useReferenceStyles_unstable = (state)=>{
320
+ 'use no memo';
320
321
  const { isExpanded, mode, layout } = state;
321
322
  const rootClassName = useReferenceClassName();
322
323
  const styles = useStyles();
@@ -357,4 +358,4 @@ const useReferenceStyles_unstable = (state)=>{
357
358
  state.detailsButton.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.detailsButton, styles.detailsButton, state.detailsButton.className);
358
359
  }
359
360
  return state;
360
- }; //# sourceMappingURL=useReferenceStyles.js.map
361
+ }; //# sourceMappingURL=useReferenceStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useReferenceStyles.styles.ts"],"sourcesContent":["import {\n buttonClassNames,\n makeResetStyles,\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport type { ReferenceSlots, ReferenceState } from './Reference.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const referenceClassNames: SlotClassNames<ReferenceSlots> = {\n root: 'fai-Reference',\n citation: 'fai-Reference__citation',\n media: 'fai-Reference__media',\n actions: 'fai-Reference__actions',\n sensitivity: 'fai-Reference__sensitivity',\n metadata: 'fai-Reference__metadata',\n primaryText: 'fai-Reference__primaryText',\n secondaryText: 'fai-Reference__secondaryText',\n tertiaryText: 'fai-Reference__tertiaryText',\n icon: 'fai-Reference__icon',\n label: 'fai-Reference__label',\n content: 'fai-Reference__content',\n detailsButton: 'fai-Reference__detailsButton',\n};\n\nexport const referenceExtraClassNames = {\n text: 'fai-Reference__text',\n mediaChild: 'fai-Reference__mediaChild',\n};\n\nconst labelFontSize = typographyStyles.caption1Strong.fontSize;\nconst labelLineHeight = typographyStyles.caption1Strong.lineHeight;\n\nconst maxPopoverWidth = '256px';\n\nconst useReferenceClassName = makeResetStyles({\n boxSizing: 'border-box',\n width: '100%',\n display: 'grid',\n gridTemplateAreas: `\n \"citation media title actions\"\n \". . title .\"\n \"sensitivityLabel sensitivityLabel sensitivityLabel sensitivityLabel\"\n \"metadata metadata metadata metadata\"\n \"content content content content\"\n `,\n gridTemplateColumns: 'min-content min-content 1fr min-content',\n gridTemplateRows: '32px auto auto auto auto',\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderRadius: tokens.borderRadiusMedium,\n padding: `${tokens.spacingVerticalS} ${tokens.spacingHorizontalS}`,\n boxShadow: 'none',\n columnGap: tokens.spacingHorizontalXS,\n alignItems: 'center',\n});\n\nconst useStyles = makeStyles({\n canvas: {},\n sidecar: {\n gridTemplateRows: '24px auto auto auto',\n ...shorthands.padding(tokens.spacingVerticalXS, tokens.spacingHorizontalS),\n },\n inline: {},\n popover: {\n ...shorthands.borderWidth('0px'),\n width: `calc(${maxPopoverWidth} - (${tokens.spacingHorizontalM} * 2))`,\n ...shorthands.padding('0px'),\n },\n closed: {\n rowGap: 0,\n },\n citation: {\n ...shorthands.gridArea('citation'),\n },\n media: {\n ...shorthands.gridArea('media'),\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n mediaPopover: {\n width: '16px',\n height: '16px',\n\n [`> .${referenceExtraClassNames.mediaChild}`]: {\n width: '16px',\n height: '16px',\n },\n },\n actions: {\n ...shorthands.gridArea('actions'),\n justifySelf: 'end',\n display: 'flex',\n gridRowStart: 1,\n },\n detailsButton: {\n [`> ${buttonClassNames.icon}`]: {\n color: tokens.colorNeutralForeground3,\n },\n },\n sensitivity: {\n ...shorthands.gridArea('sensitivityLabel'),\n justifySelf: 'start',\n },\n metadata: {\n marginTop: tokens.spacingVerticalXS,\n\n ...shorthands.gridArea('metadata'),\n ...typographyStyles.caption2,\n },\n metadataSubsequentText: {\n position: 'relative',\n marginLeft: tokens.spacingHorizontalS,\n\n '&::before': {\n content: '\"\"',\n display: 'block',\n position: 'absolute',\n left: `calc(${tokens.spacingHorizontalS} / -2)`,\n top: `calc((${typographyStyles.caption2.lineHeight} - ${typographyStyles.caption2.fontSize}) / 2)`,\n height: typographyStyles.caption2.fontSize,\n ...shorthands.borderLeft(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n },\n },\n icon: {\n ...typographyStyles.caption2,\n verticalAlign: 'middle',\n },\n content: {\n marginTop: tokens.spacingVerticalXS,\n ...shorthands.gridArea('content'),\n display: 'flex',\n flexDirection: 'column',\n rowGap: tokens.spacingVerticalS,\n color: tokens.colorNeutralForeground3,\n wordBreak: 'break-word',\n },\n hidden: {\n display: 'none',\n },\n});\n\nconst useLabelStyles = makeStyles({\n root: {\n ...shorthands.gridArea('title'),\n alignSelf: 'start',\n ...typographyStyles.caption1Strong,\n wordBreak: 'break-word',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '2',\n display: '-webkit-box',\n overflowY: 'hidden',\n },\n\n canvas: {\n // 24px is the height of the tallest element within the reference\n paddingTop: `calc((24px / 2 ) - (${labelLineHeight} - ${labelFontSize}))`,\n },\n\n sidecar: {\n // 16px is the height of the tallest element within the reference\n paddingTop: `calc((16px / 2 ) - (${labelLineHeight} - ${labelFontSize}))`,\n },\n\n closed: {\n maxWidth: '100%',\n '-webkit-line-clamp': '1',\n },\n});\n\n/**\n * Apply styling to the Reference slots based on the state\n */\nexport const useReferenceStyles_unstable = (state: ReferenceState): ReferenceState => {\n 'use no memo';\n\n const { isExpanded, mode, layout } = state;\n\n const rootClassName = useReferenceClassName();\n const styles = useStyles();\n const labelStyles = useLabelStyles();\n state.root.className = mergeClasses(\n referenceClassNames.root,\n rootClassName,\n styles[mode],\n styles[layout],\n !isExpanded && styles.closed,\n state.root.className,\n );\n\n if (state.citation) {\n state.citation.className = mergeClasses(referenceClassNames.citation, styles.citation, state.citation.className);\n }\n\n if (state.media) {\n state.media.className = mergeClasses(\n referenceClassNames.media,\n styles.media,\n layout === 'popover' && styles.mediaPopover,\n state.media.className,\n );\n }\n\n if (state.actions) {\n state.actions.className = mergeClasses(referenceClassNames.actions, styles.actions, state.actions.className);\n }\n\n state.label.className = mergeClasses(\n referenceClassNames.label,\n labelStyles.root,\n labelStyles[mode],\n !isExpanded && labelStyles.closed,\n state.label.className,\n );\n\n if (state.sensitivity) {\n state.sensitivity.className = mergeClasses(\n referenceClassNames.sensitivity,\n styles.sensitivity,\n !isExpanded && styles.hidden,\n state.sensitivity.className,\n );\n }\n\n state.metadata.className = mergeClasses(\n referenceClassNames.metadata,\n styles.metadata,\n !isExpanded && styles.hidden,\n state.metadata.className,\n );\n\n let isSubsequentText = false;\n if (state.primaryText) {\n state.primaryText.className = mergeClasses(\n referenceClassNames.primaryText,\n referenceExtraClassNames.text,\n isSubsequentText && styles.metadataSubsequentText,\n state.primaryText.className,\n );\n isSubsequentText = true;\n }\n\n if (state.secondaryText) {\n state.secondaryText.className = mergeClasses(\n referenceClassNames.secondaryText,\n referenceExtraClassNames.text,\n isSubsequentText && styles.metadataSubsequentText,\n state.secondaryText.className,\n );\n isSubsequentText = true;\n }\n\n if (state.tertiaryText) {\n state.tertiaryText.className = mergeClasses(\n referenceClassNames.tertiaryText,\n referenceExtraClassNames.text,\n isSubsequentText && styles.metadataSubsequentText,\n state.tertiaryText.className,\n );\n isSubsequentText = true;\n }\n\n if (state.icon) {\n state.icon.className = mergeClasses(referenceClassNames.icon, styles.icon, state.icon.className);\n }\n state.content.className = mergeClasses(\n referenceClassNames.content,\n styles.content,\n !isExpanded && styles.hidden,\n state.content.className,\n );\n\n if (state.detailsButton) {\n state.detailsButton.className = mergeClasses(\n referenceClassNames.detailsButton,\n styles.detailsButton,\n state.detailsButton.className,\n );\n }\n\n return state;\n};\n"],"names":["referenceClassNames","referenceExtraClassNames","state","mergeClasses","root","citation","media","actions","sensitivity","metadata","primaryText","secondaryText","tertiaryText","icon","label","content","detailsButton","text","mediaChild","labelFontSize","typographyStyles","caption1Strong","fontSize","labelLineHeight","lineHeight","maxPopoverWidth","useReferenceClassName","makeResetStyles","boxSizing","__styles","width","display","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","border","strokeWidthThin","borderRadius","padding","spacingVerticalS","boxShadow","columnGap","alignItems","Byoj8tv","uwmqm3","useStyles","makeStyles","sidecar","inline","popover","shorthands","closed","rowGap","nk6f5a","Bt984gj","justifyContent","psn4ub","mediaPopover","height","Bdqf98w","justifySelf","color","Ijaq50","marginTop","Be2twd7","metadataSubsequentText","position","left","top","uvfttm","flexDirection","wordBreak","hidden","Bw0ie65","mc9l5x","Beiy3e4","useLabelStyles","alignSelf","canvas","paddingTop","Br312pm","Bahqtrf","maxWidth","Biipf1f","Fd1uvx","Bh9c35c","Bmxbyg5","z8tnut","rootClassName","labelStyles","B2u0y6b","isSubsequentText","isExpanded","className","styles","mode","layout"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,mBAAAA;eAAAA;;IAgBAC,wBAAAA;eAAAA;;IA+LTC,2BAA8BC;eAA9BD;;;iCApNc;AAKX,MAAMF,sBAAsD;UACjEI;cACAC;WACAC;aACAC;iBACAC;cACAC;iBACAC;mBACAC;kBACAC;UACAC;WACAC;aACAC;mBACAC;AACF;AAEO,MAAMf,2BAA2B;UACtCgB;gBACAC;AACF;AAEA,MAAMC,gBAAgBC,iCAAAA,CAAiBC,cAAc,CAACC,QAAQ;AAC9D,MAAMC,kBAAkBH,iCAAAA,CAAiBC,cAAc,CAACG,UAAU;AAElE,MA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1F,EAAAA,oBAC7BH,QAAoBY,EAAAA,OAAAA,QACpBX,EAAAA,MAAAA,QAAAA,CAAAA,SAA6B;;QAKjCC,MAAAI,KAAA,EAAA;QAEAJ,MAAIA,KAAMW,CAAAA,SAAM,GAAAV,IAAAA,6BAAA,EAAAH,oBAAAM,KAAA,EAAAwF,OAAAxF,KAAA,EAAA0F,WAAA,aAAAF,OAAArC,YAAA,EAAAvD,MAAAI,KAAA,CAAAuF,SAAA;;QAEhB3F,MAAAK,OAAA,EAAA;QACAL,MAAMa,OAAO,CAAC8E,SAAS,GAAG1F,IAAAA,6BAAAA,EACxBH,oBAAoBe,OAAO,EAC3B+E,OAAO/E,OAAO,EACdb,MAAC0F,OAAAA,CAAAA,SAAqBpB;;UAKtBtE,KAAAA,CAAMc,SAAAA,GAAAA,IAAAA,6BAAuB,EAAAhB,oBAC3BA,KAAAA,EAAAA,YAAoBgB,IAAAA,EAAAA,WACbA,CAAAA,KAAAA,EAAAA,CAAAA,cACDA,YAAc6E,MAAAA,EAAAA,MAAS/E,KAAA,CAAA+E,SAAA;QAEjC3F,MAAAM,WAAA,EAAA;QAEAN,MAAAM,WAAON,CAAAA,SAAAA,GAAAA,IAAAA,6BAAAA,EAAAA,oBAAAA,WAAAA,EAAAA,OAAAA,WAAAA,EAAAA,CAAAA,cAAAA,OAAAA,MAAAA,EAAAA,MAAAA,WAAAA,CAAAA,SAAAA;IACP"}
@@ -12,10 +12,10 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _useReferenceGroupToggle = require("./useReferenceGroupToggle");
14
14
  const _renderReferenceGroupToggle = require("./renderReferenceGroupToggle");
15
- const _useReferenceGroupToggleStyles = require("./useReferenceGroupToggleStyles");
15
+ const _useReferenceGroupToggleStylesstyles = require("./useReferenceGroupToggleStyles.styles");
16
16
  const ReferenceGroupToggle = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
17
17
  const state = (0, _useReferenceGroupToggle.useReferenceGroupToggle_unstable)(props, ref);
18
- (0, _useReferenceGroupToggleStyles.useReferenceGroupToggleStyles_unstable)(state);
18
+ (0, _useReferenceGroupToggleStylesstyles.useReferenceGroupToggleStyles_unstable)(state);
19
19
  return (0, _renderReferenceGroupToggle.renderReferenceGroupToggle_unstable)(state);
20
20
  });
21
21
  ReferenceGroupToggle.displayName = 'ReferenceGroupToggle'; //# sourceMappingURL=ReferenceGroupToggle.js.map