@fluentui-copilot/react-reference 0.11.2 → 0.11.4

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 (168) hide show
  1. package/CHANGELOG.json +93 -1
  2. package/CHANGELOG.md +28 -2
  3. package/dist/index.d.ts +52 -26
  4. package/lib/ReferenceListV2.js +1 -1
  5. package/lib/ReferenceListV2.js.map +1 -1
  6. package/lib/ReferenceOverflowButton.js +1 -1
  7. package/lib/ReferenceOverflowButton.js.map +1 -1
  8. package/lib/ReferenceV2.js +1 -1
  9. package/lib/ReferenceV2.js.map +1 -1
  10. package/lib/components/Citation/Citation.js +1 -1
  11. package/lib/components/Citation/Citation.js.map +1 -1
  12. package/lib/components/Citation/index.js +1 -1
  13. package/lib/components/Citation/index.js.map +1 -1
  14. package/lib/components/Citation/{useCitationStyles.js → useCitationStyles.styles.js} +3 -1
  15. package/lib/components/Citation/useCitationStyles.styles.js.map +1 -0
  16. package/lib/components/Reference/Reference.js +1 -1
  17. package/lib/components/Reference/Reference.js.map +1 -1
  18. package/lib/components/Reference/index.js +1 -1
  19. package/lib/components/Reference/index.js.map +1 -1
  20. package/lib/components/Reference/useReference.js +1 -1
  21. package/lib/components/Reference/useReference.js.map +1 -1
  22. package/lib/components/Reference/{useReferenceStyles.js → useReferenceStyles.styles.js} +3 -1
  23. package/lib/components/Reference/useReferenceStyles.styles.js.map +1 -0
  24. package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js +1 -1
  25. package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -1
  26. package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -1
  27. package/lib/components/ReferenceGroupToggle/index.js +1 -1
  28. package/lib/components/ReferenceGroupToggle/index.js.map +1 -1
  29. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js +3 -0
  30. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -1
  31. package/lib/components/ReferenceGroupToggle/{useReferenceGroupToggleStyles.js → useReferenceGroupToggleStyles.styles.js} +25 -3
  32. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js.map +1 -0
  33. package/lib/components/ReferenceList/ReferenceList.js +1 -1
  34. package/lib/components/ReferenceList/ReferenceList.js.map +1 -1
  35. package/lib/components/ReferenceList/index.js +1 -1
  36. package/lib/components/ReferenceList/index.js.map +1 -1
  37. package/lib/components/ReferenceList/useReferenceList.js +1 -1
  38. package/lib/components/ReferenceList/useReferenceList.js.map +1 -1
  39. package/lib/components/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js} +3 -1
  40. package/lib/components/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
  41. package/lib/components/reference-v2/Reference/Reference.js +1 -1
  42. package/lib/components/reference-v2/Reference/Reference.js.map +1 -1
  43. package/lib/components/reference-v2/Reference/Reference.types.js.map +1 -1
  44. package/lib/components/reference-v2/Reference/index.js +1 -1
  45. package/lib/components/reference-v2/Reference/index.js.map +1 -1
  46. package/lib/components/reference-v2/Reference/renderReference.js +1 -1
  47. package/lib/components/reference-v2/Reference/renderReference.js.map +1 -1
  48. package/lib/components/reference-v2/Reference/useReference.js +20 -21
  49. package/lib/components/reference-v2/Reference/useReference.js.map +1 -1
  50. package/lib/components/reference-v2/Reference/useReferenceStyles.styles.js +51 -0
  51. package/lib/components/reference-v2/Reference/useReferenceStyles.styles.js.map +1 -0
  52. package/lib/components/reference-v2/ReferenceList/ReferenceList.js +1 -1
  53. package/lib/components/reference-v2/ReferenceList/ReferenceList.js.map +1 -1
  54. package/lib/components/reference-v2/ReferenceList/ReferenceList.types.js.map +1 -1
  55. package/lib/components/reference-v2/ReferenceList/index.js +1 -1
  56. package/lib/components/reference-v2/ReferenceList/index.js.map +1 -1
  57. package/lib/components/reference-v2/ReferenceList/useReferenceList.js +10 -10
  58. package/lib/components/reference-v2/ReferenceList/useReferenceList.js.map +1 -1
  59. package/lib/components/reference-v2/ReferenceList/useReferenceListContextValues.js +8 -6
  60. package/lib/components/reference-v2/ReferenceList/useReferenceListContextValues.js.map +1 -1
  61. package/lib/components/reference-v2/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js} +3 -1
  62. package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
  63. package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js +1 -1
  64. package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -1
  65. package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map +1 -1
  66. package/lib/components/reference-v2/ReferenceOverflowButton/index.js +1 -1
  67. package/lib/components/reference-v2/ReferenceOverflowButton/index.js.map +1 -1
  68. package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +23 -19
  69. package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -1
  70. package/lib/components/reference-v2/ReferenceOverflowButton/{useReferenceOverflowButtonStyles.js → useReferenceOverflowButtonStyles.styles.js} +5 -21
  71. package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js.map +1 -0
  72. package/lib/contexts/reference-v2/referenceListContext.js +5 -4
  73. package/lib/contexts/reference-v2/referenceListContext.js.map +1 -1
  74. package/lib/hooks/reference-v2/useReferenceCitationPreview.js +17 -12
  75. package/lib/hooks/reference-v2/useReferenceCitationPreview.js.map +1 -1
  76. package/lib/hooks/useReferenceCitationPreview.js +6 -4
  77. package/lib/hooks/useReferenceCitationPreview.js.map +1 -1
  78. package/lib-commonjs/ReferenceListV2.js +1 -1
  79. package/lib-commonjs/ReferenceListV2.js.map +1 -1
  80. package/lib-commonjs/ReferenceOverflowButton.js +1 -1
  81. package/lib-commonjs/ReferenceOverflowButton.js.map +1 -1
  82. package/lib-commonjs/ReferenceV2.js +1 -1
  83. package/lib-commonjs/ReferenceV2.js.map +1 -1
  84. package/lib-commonjs/components/Citation/Citation.js +2 -2
  85. package/lib-commonjs/components/Citation/Citation.js.map +1 -1
  86. package/lib-commonjs/components/Citation/index.js +1 -1
  87. package/lib-commonjs/components/Citation/index.js.map +1 -1
  88. package/lib-commonjs/components/Citation/{useCitationStyles.js → useCitationStyles.styles.js} +2 -1
  89. package/lib-commonjs/components/Citation/useCitationStyles.styles.js.map +1 -0
  90. package/lib-commonjs/components/Reference/Reference.js +2 -2
  91. package/lib-commonjs/components/Reference/Reference.js.map +1 -1
  92. package/lib-commonjs/components/Reference/index.js +1 -1
  93. package/lib-commonjs/components/Reference/index.js.map +1 -1
  94. package/lib-commonjs/components/Reference/useReference.js +2 -2
  95. package/lib-commonjs/components/Reference/useReference.js.map +1 -1
  96. package/lib-commonjs/components/Reference/{useReferenceStyles.js → useReferenceStyles.styles.js} +2 -1
  97. package/lib-commonjs/components/Reference/useReferenceStyles.styles.js.map +1 -0
  98. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js +2 -2
  99. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -1
  100. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -1
  101. package/lib-commonjs/components/ReferenceGroupToggle/index.js +1 -1
  102. package/lib-commonjs/components/ReferenceGroupToggle/index.js.map +1 -1
  103. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js +3 -0
  104. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -1
  105. package/lib-commonjs/components/ReferenceGroupToggle/{useReferenceGroupToggleStyles.js → useReferenceGroupToggleStyles.styles.js} +28 -2
  106. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js.map +1 -0
  107. package/lib-commonjs/components/ReferenceList/ReferenceList.js +2 -2
  108. package/lib-commonjs/components/ReferenceList/ReferenceList.js.map +1 -1
  109. package/lib-commonjs/components/ReferenceList/index.js +1 -1
  110. package/lib-commonjs/components/ReferenceList/index.js.map +1 -1
  111. package/lib-commonjs/components/ReferenceList/useReferenceList.js +2 -2
  112. package/lib-commonjs/components/ReferenceList/useReferenceList.js.map +1 -1
  113. package/lib-commonjs/components/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js} +2 -1
  114. package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
  115. package/lib-commonjs/components/reference-v2/Reference/Reference.js +2 -2
  116. package/lib-commonjs/components/reference-v2/Reference/Reference.js.map +1 -1
  117. package/lib-commonjs/components/reference-v2/Reference/Reference.types.js.map +1 -1
  118. package/lib-commonjs/components/reference-v2/Reference/index.js +4 -4
  119. package/lib-commonjs/components/reference-v2/Reference/index.js.map +1 -1
  120. package/lib-commonjs/components/reference-v2/Reference/renderReference.js +1 -1
  121. package/lib-commonjs/components/reference-v2/Reference/renderReference.js.map +1 -1
  122. package/lib-commonjs/components/reference-v2/Reference/useReference.js +20 -19
  123. package/lib-commonjs/components/reference-v2/Reference/useReference.js.map +1 -1
  124. package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.js +87 -0
  125. package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.js.map +1 -0
  126. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js +2 -2
  127. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js.map +1 -1
  128. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.types.js.map +1 -1
  129. package/lib-commonjs/components/reference-v2/ReferenceList/index.js +1 -1
  130. package/lib-commonjs/components/reference-v2/ReferenceList/index.js.map +1 -1
  131. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js +11 -9
  132. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js.map +1 -1
  133. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js +5 -4
  134. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js.map +1 -1
  135. package/lib-commonjs/components/reference-v2/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js} +2 -1
  136. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
  137. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js +2 -2
  138. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -1
  139. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map +1 -1
  140. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/index.js +1 -1
  141. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/index.js.map +1 -1
  142. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +26 -17
  143. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -1
  144. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/{useReferenceOverflowButtonStyles.js → useReferenceOverflowButtonStyles.styles.js} +3 -33
  145. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js.map +1 -0
  146. package/lib-commonjs/contexts/reference-v2/referenceListContext.js +5 -4
  147. package/lib-commonjs/contexts/reference-v2/referenceListContext.js.map +1 -1
  148. package/lib-commonjs/hooks/reference-v2/useReferenceCitationPreview.js +17 -12
  149. package/lib-commonjs/hooks/reference-v2/useReferenceCitationPreview.js.map +1 -1
  150. package/lib-commonjs/hooks/useReferenceCitationPreview.js +6 -4
  151. package/lib-commonjs/hooks/useReferenceCitationPreview.js.map +1 -1
  152. package/package.json +10 -10
  153. package/lib/components/Citation/useCitationStyles.js.map +0 -1
  154. package/lib/components/Reference/useReferenceStyles.js.map +0 -1
  155. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +0 -1
  156. package/lib/components/ReferenceList/useReferenceListStyles.js.map +0 -1
  157. package/lib/components/reference-v2/Reference/useReferenceStyles.js +0 -71
  158. package/lib/components/reference-v2/Reference/useReferenceStyles.js.map +0 -1
  159. package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.js.map +0 -1
  160. package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.js.map +0 -1
  161. package/lib-commonjs/components/Citation/useCitationStyles.js.map +0 -1
  162. package/lib-commonjs/components/Reference/useReferenceStyles.js.map +0 -1
  163. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +0 -1
  164. package/lib-commonjs/components/ReferenceList/useReferenceListStyles.js.map +0 -1
  165. package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.js +0 -122
  166. package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.js.map +0 -1
  167. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.js.map +0 -1
  168. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.js.map +0 -1
@@ -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';\n\nexport const Reference: ForwardRefComponent<ReferenceProps> = React.forwardRef((props, ref) => {\n const state = useReference_unstable(props, ref);\n\n useReferenceStyles_unstable(state);\n return renderReference_unstable(state);\n});\n\nReference.displayName = 'Reference';\n"],"names":["Reference","React","forwardRef","props","state","useReference_unstable","useReferenceStyles_unstable","renderReference_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAOaA;;;eAAAA;;;;iEAPU;8BACe;iCACG;oCACG;AAIrC,MAAMA,YAAAA,WAAAA,GAAAA,OAAiDC,UAAMC,CAAU,CAACC,OAACA;UAC9EC,QAAMA,IAAAA,mCAAQC,EAAAA,OAAsBF;uDAEpCG,EAAAA;WACAC,IAAAA,yCAAOA,EAAAA;AACT;AAEAP,UAAUQ,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';\n\nexport const Reference: ForwardRefComponent<ReferenceProps> = React.forwardRef((props, ref) => {\n const state = useReference_unstable(props, ref);\n\n useReferenceStyles_unstable(state);\n return renderReference_unstable(state);\n});\n\nReference.displayName = 'Reference';\n"],"names":["Reference","React","forwardRef","props","state","useReference_unstable","useReferenceStyles_unstable","renderReference_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAOaA;;;eAAAA;;;;iEAPU;8BACe;iCACG;0CACG;AAIrC,MAAMA,YAAAA,WAAAA,GAAAA,OAAiDC,UAAMC,CAAU,CAACC,OAACA;UAC9EC,QAAMA,IAAAA,mCAAQC,EAAAA,OAAsBF;6DAEpCG,EAAAA;WACAC,IAAAA,yCAAOA,EAAAA;AACT;AAEAP,UAAUQ,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Reference.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { ReferenceListState } from '../ReferenceList';\n\nexport type ReferenceSlots = {\n root: NonNullable<Slot<'button'>>;\n citation?: Slot<'span'>;\n divider?: Slot<'span'>;\n content?: Slot<'span'>;\n media?: Slot<'span'>;\n};\n\nexport type ReferenceProps = ComponentProps<Partial<ReferenceSlots>> & {\n /**\n * The appearance of the reference.\n * @default 'lighter'\n */\n appearance?: 'lighter' | 'darker';\n};\n\nexport type ReferenceState = ComponentState<ReferenceSlots> &\n Required<Pick<ReferenceProps, 'appearance' | 'id'>> &\n Pick<ReferenceListState, 'shouldUseOverflow'>;\n"],"names":[],"rangeMappings":"","mappings":""}
1
+ {"version":3,"sources":["Reference.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { ReferenceListState } from '../ReferenceList';\n\nexport type ReferenceSlots = {\n /** The root of the component that renders the reference as either a button or an anchor element. */\n root: NonNullable<Slot<'button', 'a'>>;\n\n /** The number of the citation this reference corresponds to. */\n citation?: Slot<'span'>;\n\n /** A divider that visually separates the citation from the content of the reference. */\n divider?: Slot<'span'>;\n\n /** A space containing the content of the reference, which goes into an ellipsis if it overflows. */\n content?: Slot<'span'>;\n\n /** A space within the content slot where a graphic such as an icon or an image can be displayed before the rest of the content. */\n graphic?: Slot<'span'>;\n};\n\nexport type ReferenceProps = ComponentProps<Partial<ReferenceSlots>> & {};\n\nexport type ReferenceState = ComponentState<ReferenceSlots> &\n Required<Pick<ReferenceProps, 'id'>> &\n Pick<ReferenceListState, 'shouldUseOverflow'>;\n"],"names":[],"rangeMappings":"","mappings":""}
@@ -10,13 +10,13 @@ function _export(target, all) {
10
10
  }
11
11
  _export(exports, {
12
12
  referenceClassNames: function() {
13
- return _useReferenceStyles.referenceClassNames;
13
+ return _useReferenceStylesstyles.referenceClassNames;
14
14
  },
15
15
  referenceExtraClassNames: function() {
16
- return _useReferenceStyles.referenceExtraClassNames;
16
+ return _useReferenceStylesstyles.referenceExtraClassNames;
17
17
  },
18
18
  useReferenceStyles_unstable: function() {
19
- return _useReferenceStyles.useReferenceStyles_unstable;
19
+ return _useReferenceStylesstyles.useReferenceStyles_unstable;
20
20
  }
21
21
  });
22
22
  const _export_star = require("@swc/helpers/_/_export_star");
@@ -24,5 +24,5 @@ _export_star._(require("./Reference"), exports);
24
24
  _export_star._(require("./Reference.types"), exports);
25
25
  _export_star._(require("./renderReference"), exports);
26
26
  _export_star._(require("./useReference"), exports);
27
- const _useReferenceStyles = require("./useReferenceStyles");
27
+ const _useReferenceStylesstyles = require("./useReferenceStyles.styles");
28
28
  //# 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 { referenceClassNames, referenceExtraClassNames, useReferenceStyles_unstable } from './useReferenceStyles';\n"],"names":["referenceClassNames","referenceExtraClassNames","useReferenceStyles_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAISA,mBAAmB;eAAnBA,uCAAmB;;IAAEC,wBAAwB;eAAxBA,4CAAwB;;IAAEC,2BAA2B;eAA3BA,+CAA2B;;;;uBAJrE;uBACA;uBACA;uBACA;oCAC6E"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Reference';\nexport * from './Reference.types';\nexport * from './renderReference';\nexport * from './useReference';\nexport {\n referenceClassNames,\n referenceExtraClassNames,\n useReferenceStyles_unstable,\n} from './useReferenceStyles.styles';\n"],"names":["referenceClassNames","referenceExtraClassNames","useReferenceStyles_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKEA,mBAAmB;eAAnBA,6CAAmB;;IACnBC,wBAAwB;eAAxBA,kDAAwB;;IACxBC,2BAA2B;eAA3BA,qDAA2B;;;;uBAPf;uBACA;uBACA;uBACA;0CAKP"}
@@ -19,7 +19,7 @@ const renderReference_unstable = (state)=>{
19
19
  state.divider && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.divider, {}),
20
20
  state.content && /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.content, {
21
21
  children: [
22
- state.media && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.media, {}),
22
+ state.graphic && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.graphic, {}),
23
23
  state.root.children
24
24
  ]
25
25
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["renderReference.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { OverflowItem, assertSlots } from '@fluentui/react-components';\nimport type { ReferenceState, ReferenceSlots } from './Reference.types';\n\nexport const renderReference_unstable = (state: ReferenceState) => {\n assertSlots<ReferenceSlots>(state);\n\n const { id, shouldUseOverflow } = state;\n\n const reference = (\n <state.root>\n {state.citation && <state.citation />}\n {state.divider && <state.divider />}\n {state.content && (\n <state.content>\n {state.media && <state.media />}\n {state.root.children}\n </state.content>\n )}\n </state.root>\n );\n\n return shouldUseOverflow ? (\n <OverflowItem key={id} id={id}>\n {reference}\n </OverflowItem>\n ) : (\n reference\n );\n};\n"],"names":["renderReference_unstable","state","assertSlots","id","divider","_jsxs","root","content","_jsx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAMaA;;;eAAAA;;;4BALb;iCAE0C;AAGnC,MAAMA,2BAA2BC,CAAAA;oCACtCC,EAAAA;UAEA,EAEAC,EAAA;sBAGWC,WAAO,GAAAC,IAAAA,gBAAA,EAAAJ,MAAIK,IAACL,EAAAA;kBAClBA;YAAAA,MAAMM,QAAO,IAAA,WACZ,GAAAC,IAAAA,eAACP,EAAAA,MAAMM,QAAO,EAAA,CAAA;YAAAN,MAAAG,OAAA,IAAA,WAAA,GAAAI,IAAAA,eAAA,EAAAP,MAAAG,OAAA,EAAA,CAAA;YAAAH,MAAAM,OAAA,IAAA,WAAA,GAAAF,IAAAA,gBAAA,EAAAJ,MAAAM,OAAA,EAAA;;;;;;;;;;;;8CASSJ"}
1
+ {"version":3,"sources":["renderReference.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { OverflowItem, assertSlots } from '@fluentui/react-components';\nimport type { ReferenceState, ReferenceSlots } from './Reference.types';\n\nexport const renderReference_unstable = (state: ReferenceState) => {\n assertSlots<ReferenceSlots>(state);\n\n const { id, shouldUseOverflow } = state;\n\n const reference = (\n <state.root>\n {state.citation && <state.citation />}\n {state.divider && <state.divider />}\n {state.content && (\n <state.content>\n {state.graphic && <state.graphic />}\n {state.root.children}\n </state.content>\n )}\n </state.root>\n );\n\n return shouldUseOverflow ? (\n <OverflowItem key={id} id={id}>\n {reference}\n </OverflowItem>\n ) : (\n reference\n );\n};\n"],"names":["renderReference_unstable","state","assertSlots","id","divider","_jsxs","root","content","_jsx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAMaA;;;eAAAA;;;4BALb;iCAE0C;AAGnC,MAAMA,2BAA2BC,CAAAA;oCACtCC,EAAAA;UAEA,EAEAC,EAAA;sBAGWC,WAAO,GAAAC,IAAAA,gBAAA,EAAAJ,MAAIK,IAACL,EAAAA;kBAClBA;YAAAA,MAAMM,QAAO,IAAA,WACZ,GAAAC,IAAAA,eAACP,EAAAA,MAAMM,QAAO,EAAA,CAAA;YAAAN,MAAAG,OAAA,IAAA,WAAA,GAAAI,IAAAA,eAAA,EAAAP,MAAAG,OAAA,EAAA,CAAA;YAAAH,MAAAM,OAAA,IAAA,WAAA,GAAAF,IAAAA,gBAAA,EAAAJ,MAAAM,OAAA,EAAA;;;;;;;;;;;;8CASSJ"}
@@ -12,55 +12,56 @@ 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 _referenceListContext = require("../../../contexts/reference-v2/referenceListContext");
15
- const _useReferenceStyles = require("./useReferenceStyles");
15
+ const _useReferenceStylesstyles = require("./useReferenceStyles.styles");
16
16
  const useReference_unstable = (props, ref)=>{
17
- const { children, id } = props;
18
- const { ctxAppearance, shouldUseOverflow } = (0, _referenceListContext.useReferenceListContext_unstable)((ctx)=>({
19
- ctxAppearance: ctx.appearance,
20
- shouldUseOverflow: ctx.shouldUseOverflow
21
- }));
22
- const appearance = props.appearance || ctxAppearance;
17
+ const { as, children, id } = props;
18
+ const shouldUseOverflow = (0, _referenceListContext.useReferenceListContext_unstable)((ctx)=>ctx.shouldUseOverflow);
23
19
  const referenceId = (0, _reactcomponents.useId)('reference-', id);
20
+ const elementType = as || (props.href ? 'a' : 'button');
21
+ const propsWithAssignedAs = {
22
+ type: elementType === 'button' ? 'button' : undefined,
23
+ ...props,
24
+ as: elementType,
25
+ id: referenceId
26
+ };
24
27
  const citation = _reactcomponents.slot.optional(props.citation, {
25
28
  elementType: 'span'
26
29
  });
27
- const media = _reactcomponents.slot.optional(props.media, {
30
+ const graphic = _reactcomponents.slot.optional(props.graphic, {
28
31
  elementType: 'span'
29
32
  });
30
33
  const content = _reactcomponents.slot.optional(props.content, {
31
34
  elementType: 'span',
32
- renderByDefault: media !== undefined || !!children
35
+ renderByDefault: graphic !== undefined || !!children
33
36
  });
34
37
  const divider = _reactcomponents.slot.optional(props.divider, {
35
38
  elementType: 'span',
36
39
  renderByDefault: citation !== undefined && content !== undefined
37
40
  });
38
41
  const state = {
39
- appearance,
40
42
  id: referenceId,
41
43
  shouldUseOverflow,
42
44
  components: {
43
45
  root: 'button',
44
46
  citation: 'span',
45
47
  divider: 'span',
46
- media: 'span',
48
+ graphic: 'span',
47
49
  content: 'span'
48
50
  },
49
- root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('button', {
51
+ root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)(elementType, {
50
52
  ref,
51
- ...props,
52
- id: referenceId
53
+ ...propsWithAssignedAs
53
54
  }), {
54
- elementType: 'button'
55
+ elementType
55
56
  }),
56
57
  citation,
57
58
  divider,
58
59
  content,
59
- media
60
+ graphic
60
61
  };
61
- if (state.media && /*#__PURE__*/ _react.isValidElement(state.media.children)) {
62
- state.media.children = /*#__PURE__*/ _react.cloneElement(state.media.children, {
63
- className: (0, _reactcomponents.mergeClasses)(state.media.children.props.className, _useReferenceStyles.referenceExtraClassNames.mediaChild)
62
+ if (state.graphic && /*#__PURE__*/ _react.isValidElement(state.graphic.children)) {
63
+ state.graphic.children = /*#__PURE__*/ _react.cloneElement(state.graphic.children, {
64
+ className: (0, _reactcomponents.mergeClasses)(state.graphic.children.props.className, _useReferenceStylesstyles.referenceExtraClassNames.graphicChild)
64
65
  });
65
66
  }
66
67
  return state;
@@ -1 +1 @@
1
- {"version":3,"sources":["useReference.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, mergeClasses, slot, useId } from '@fluentui/react-components';\nimport { useReferenceListContext_unstable } from '../../../contexts/reference-v2/referenceListContext';\nimport { referenceExtraClassNames } from './useReferenceStyles';\nimport type { ReferenceProps, ReferenceState } from './Reference.types';\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<HTMLButtonElement>): ReferenceState => {\n const { children, id } = props;\n\n const { ctxAppearance, shouldUseOverflow } = useReferenceListContext_unstable(ctx => ({\n ctxAppearance: ctx.appearance,\n shouldUseOverflow: ctx.shouldUseOverflow,\n }));\n const appearance = props.appearance || ctxAppearance;\n\n const referenceId = useId('reference-', id);\n\n const citation = slot.optional(props.citation, { elementType: 'span' });\n const media = slot.optional(props.media, { elementType: 'span' });\n const content = slot.optional(props.content, {\n elementType: 'span',\n renderByDefault: media !== undefined || !!children,\n });\n const divider = slot.optional(props.divider, {\n elementType: 'span',\n renderByDefault: citation !== undefined && content !== undefined,\n });\n\n const state: ReferenceState = {\n appearance,\n id: referenceId,\n shouldUseOverflow,\n\n components: {\n root: 'button',\n citation: 'span',\n divider: 'span',\n media: 'span',\n content: 'span',\n },\n\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n ...props,\n id: referenceId,\n }),\n { elementType: 'button' },\n ),\n citation,\n divider,\n content,\n media,\n };\n\n if (state.media && React.isValidElement<HTMLElement>(state.media.children)) {\n state.media.children = React.cloneElement(state.media.children, {\n className: mergeClasses(state.media.children.props.className, referenceExtraClassNames.mediaChild),\n });\n }\n\n return state;\n};\n"],"names":["children","props","ctxAppearance","referenceId","shouldUseOverflow","slot","ctx","appearance","optional","content","elementType","citation","renderByDefault","media","divider","state","components","undefined","ref","id"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBUA;;;eAAAA;;;;iEAhBa;iCAC6C;sCACnB;oCACR;AAavC,MAAQA,wBAAiBC,CAAAA,OAAAA;UAEzB,UACEC;UAGF,EAEAA,aAAMC,EAENC,iBAAiBC,+DAA6C,EAAAC,CAAAA,MAAA,CAAA;YAAOJ,eAAAI,IAAAC,UAAA;YACrEH,mBAAmBI,IAAAA,iBAAoB;;UAAwBD,aAAAN,MAAAM,UAAA,IAAAL;UAC/DC,cAAgBE,IAAAA,sBAAKG,EAAAA,cAAeC;UAClCC,WAAAA,qBAAa,CAAAF,QAAA,CAAAP,MAAAU,QAAA,EAAA;qBACbC;;UAEFC,QAAMC,qBAAUT,CAAAA,QAAKG,CAAAA,MAASP,KAAMa,EAAAA;qBAClCJ;;UAEFD,UAAAJ,qBAAA,CAAAG,QAAA,CAAAP,MAAAQ,OAAA,EAAA;QAEAC,aAAMK;yBACJR,UAAAA,aAAAA,CAAAA,CAAAA;;UAEAH,UAAAA,qBAAAA,CAAAA,QAAAA,CAAAA,MAAAA,OAAAA,EAAAA;qBAEAY;yBACQL,aAAAM,aAAAR,YAAAQ;;kBAENH;;;;oBAKIT;kBAEFa;sBACGjB;qBACHkB;mBAEF;qBAAET;;cAEJC,qBAAAA,CAAAA,MAAAA,CAAAA,IAAAA,yCAAAA,EAAAA,UAAAA;;eAEAF,KAAAA;gBACAI;QACF,IAAA;YAEAH,aAAe;;;;QAIfD;QAEAI;IACA"}
1
+ {"version":3,"sources":["useReference.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, mergeClasses, slot, useId } from '@fluentui/react-components';\nimport { useReferenceListContext_unstable } from '../../../contexts/reference-v2/referenceListContext';\nimport { referenceExtraClassNames } from './useReferenceStyles.styles';\nimport type { ReferenceProps, ReferenceState } from './Reference.types';\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 = (\n props: ReferenceProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ReferenceState => {\n const { as, children, id } = props;\n\n const shouldUseOverflow = useReferenceListContext_unstable(ctx => ctx.shouldUseOverflow);\n\n const referenceId = useId('reference-', id);\n\n const elementType = as || ((props as JSX.IntrinsicElements['a']).href ? 'a' : 'button');\n const propsWithAssignedAs = {\n type: elementType === 'button' ? 'button' : undefined,\n ...props,\n as: elementType,\n id: referenceId,\n } as ReferenceProps;\n\n const citation = slot.optional(props.citation, { elementType: 'span' });\n const graphic = slot.optional(props.graphic, { elementType: 'span' });\n const content = slot.optional(props.content, {\n elementType: 'span',\n renderByDefault: graphic !== undefined || !!children,\n });\n const divider = slot.optional(props.divider, {\n elementType: 'span',\n renderByDefault: citation !== undefined && content !== undefined,\n });\n\n const state: ReferenceState = {\n id: referenceId,\n shouldUseOverflow,\n\n components: {\n root: 'button',\n citation: 'span',\n divider: 'span',\n graphic: 'span',\n content: 'span',\n },\n\n root: slot.always(\n getIntrinsicElementProps(elementType, {\n ref,\n ...propsWithAssignedAs,\n }),\n { elementType },\n ),\n citation,\n divider,\n content,\n graphic,\n };\n\n if (state.graphic && React.isValidElement<HTMLElement>(state.graphic.children)) {\n state.graphic.children = React.cloneElement(state.graphic.children, {\n className: mergeClasses(state.graphic.children.props.className, referenceExtraClassNames.graphicChild),\n });\n }\n\n return state;\n};\n"],"names":["as","props","children","elementType","id","shouldUseOverflow","useReferenceListContext_unstable","ctx","referenceId","propsWithAssignedAs","type","citation","optional","slot","content","renderByDefault","graphic","undefined","ref","always","getIntrinsicElementProps","divider","state","React","cloneElement"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAmBUA;;;eAAAA;;;;iEAnBa;iCAC6C;sCACnB;0CACR;AAgBvC,MAAQA,wBAAqBC,CAAAA,OAAAA;UAE7B,EAEAD,EAAA,EAEAE,QAAMC,EACNC,EAAA;UAEEC,oBAAQC,IAAAA,sDAAA,EAAAC,CAAAA,MAAAA,IAAAF,iBAAA;UACRL,cAAIG,IAAAA,sBAAAA,EAAAA,cAAAA;UACJC,cAAII,MAAAA,CAAAA,MAAAA,IAAAA,GAAAA,MAAAA,QAAAA;UACNC,sBAAA;QAEAC,MAAMC,gBAAgBC,WAASX,WAAMU;gBAAYR;QAAoBH,IAAAG;QACrEC,IAAAI;;UAAmEG,WAAAE,qBAAA,CAAAD,QAAA,CAAAX,MAAAU,QAAA,EAAA;QACnER,aAAMW;;UAEJC,UAAAA,qBAAAA,CAAAA,QAAiBC,CAAAA,MAAYC,OAAAA,EAAAA;QAC/Bd,aAAA;;UAEEA,UAAAA,qBAAa,CAAAS,QAAA,CAAAX,MAAAa,OAAA,EAAA;qBACbC;QACFA,iBAAAC,YAAAC,aAAA,CAAA,CAAAf;;UAGEE,UAAII,qBAAAA,CAAAA,QAAAA,CAAAA,MAAAA,OAAAA,EAAAA;qBACJH;yBAEYM,aAAAM,aAAAH,YAAAG;;kBAEVN;;;oBAGAG;kBACF;sBAEMD;qBAEFK;qBACGT;qBAEL;;cAAcI,qBAAA,CAAAM,MAAA,CAAAC,IAAAA,yCAAA,EAAAjB,aAAA;;eAGhBkB,mBAAAA;YACAP;;QAEF;QAEAH;;;;;QAMAW,MAAOA,OAAAA,kBAAAA,OAAAA,cAAAA,CAAAA,MAAAA,OAAAA,CAAAA,QAAAA,GAAAA;QACPA,MAAAN,OAAA,CAAAd,QAAA,iBAAAqB,OAAAC,YAAA,CAAAF,MAAAN,OAAA,CAAAd,QAAA,EAAA"}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ referenceClassNames: function() {
13
+ return referenceClassNames;
14
+ },
15
+ referenceExtraClassNames: function() {
16
+ return referenceExtraClassNames;
17
+ },
18
+ useReferenceStyles_unstable: function() {
19
+ return useReferenceStyles_unstable;
20
+ },
21
+ useRootStyles: function() {
22
+ return useRootStyles;
23
+ }
24
+ });
25
+ const _reactcomponents = require("@fluentui/react-components");
26
+ const referenceClassNames = {
27
+ root: 'fai-Reference',
28
+ citation: 'fai-Reference__citation',
29
+ divider: 'fai-Reference__divider',
30
+ graphic: 'fai-Reference__graphic',
31
+ content: 'fai-Reference__content'
32
+ };
33
+ const referenceExtraClassNames = {
34
+ graphicChild: 'fai-Reference__graphicChild'
35
+ };
36
+ const GRAPHIC_SIZE = '16px';
37
+ const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("rtvjomn", null, [
38
+ ".rtvjomn{align-items:center;background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);border-radius:var(--borderRadiusMedium);box-sizing:border-box;color:var(--colorNeutralForeground2);column-gap:var(--spacingHorizontalXXS);display:flex;flex-shrink:0;justify-content:center;max-width:max-content;padding:var(--spacingVerticalXXS) var(--spacingHorizontalS);text-decoration:none;}",
39
+ ".rtvjomn:hover{background-color:var(--colorNeutralBackground3Hover);border-color:var(--colorNeutralStroke1Hover);color:var(--colorNeutralForeground2Hover);}",
40
+ ".rtvjomn:hover .fai-Reference__divider{background-color:var(--colorNeutralStroke1Hover);}",
41
+ ".rtvjomn:hover:active{background-color:var(--colorNeutralBackground3Pressed);border-color:var(--colorNeutralStroke1Pressed);color:var(--colorNeutralForeground2Pressed);}",
42
+ ".rtvjomn:hover:active .fai-Reference__divider{background-color:var(--colorNeutralStroke1Pressed);}"
43
+ ]);
44
+ const useRootStyles = (0, _reactcomponents.__styles)({
45
+ overflow: {
46
+ a9b677: "fly5x3f"
47
+ }
48
+ }, {
49
+ d: [
50
+ ".fly5x3f{width:100%;}"
51
+ ]
52
+ });
53
+ const useCitationBaseClassName = (0, _reactcomponents.__resetStyles)("rzdip90", null, [
54
+ ".rzdip90{font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase100);}"
55
+ ]);
56
+ const useDividerBaseClassName = (0, _reactcomponents.__resetStyles)("r1eyqaw5", null, [
57
+ ".r1eyqaw5{background-color:var(--colorNeutralStroke2);height:16px;margin:var(--spacingVerticalNone) var(--spacingHorizontalXS);width:1px;}"
58
+ ]);
59
+ const useGraphicBaseClassName = (0, _reactcomponents.__resetStyles)("rjrtsj7", null, [
60
+ ".rjrtsj7{font-size:16px;height:16px;line-height:16px;width:16px;}",
61
+ ".rjrtsj7>.fai-Reference__graphicChild{height:16px;width:16px;}"
62
+ ]);
63
+ const useContentBaseClassName = (0, _reactcomponents.__resetStyles)("r1yvxokd", null, [
64
+ ".r1yvxokd{column-gap:var(--spacingHorizontalSNudge);display:inline-flex;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}"
65
+ ]);
66
+ const useReferenceStyles_unstable = (state)=>{
67
+ 'use no memo';
68
+ const rootBaseClassName = useRootBaseClassName();
69
+ const citationBaseClassName = useCitationBaseClassName();
70
+ const dividerBaseClassName = useDividerBaseClassName();
71
+ const contentBaseClassName = useContentBaseClassName();
72
+ const graphicBaseClassName = useGraphicBaseClassName();
73
+ state.root.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.root, rootBaseClassName, state.root.className);
74
+ if (state.citation) {
75
+ state.citation.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.citation, citationBaseClassName, state.citation.className);
76
+ }
77
+ if (state.divider) {
78
+ state.divider.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.divider, dividerBaseClassName, state.divider.className);
79
+ }
80
+ if (state.content) {
81
+ state.content.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.content, contentBaseClassName, state.content.className);
82
+ }
83
+ if (state.graphic) {
84
+ state.graphic.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.graphic, graphicBaseClassName, state.graphic.className);
85
+ }
86
+ return state;
87
+ }; //# sourceMappingURL=useReferenceStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useReferenceStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, tokens, typographyStyles } 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 divider: 'fai-Reference__divider',\n graphic: 'fai-Reference__graphic',\n content: 'fai-Reference__content',\n};\n\nexport const referenceExtraClassNames = {\n graphicChild: 'fai-Reference__graphicChild',\n};\n\nconst GRAPHIC_SIZE = '16px';\n\nconst useRootBaseClassName = makeResetStyles({\n alignItems: 'center',\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground2,\n columnGap: tokens.spacingHorizontalXXS,\n display: 'flex',\n flexShrink: 0,\n justifyContent: 'center',\n maxWidth: 'max-content',\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalS}`,\n textDecoration: 'none',\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground3Hover,\n borderColor: tokens.colorNeutralStroke1Hover,\n color: tokens.colorNeutralForeground2Hover,\n\n [`& .${referenceClassNames.divider}`]: {\n backgroundColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n borderColor: tokens.colorNeutralStroke1Pressed,\n color: tokens.colorNeutralForeground2Pressed,\n\n [`& .${referenceClassNames.divider}`]: {\n backgroundColor: tokens.colorNeutralStroke1Pressed,\n },\n },\n});\n\nexport const useRootStyles = makeStyles({\n overflow: {\n width: '100%',\n },\n});\n\nconst useCitationBaseClassName = makeResetStyles({\n ...typographyStyles.caption2Strong,\n});\n\nconst useDividerBaseClassName = makeResetStyles({\n backgroundColor: tokens.colorNeutralStroke2,\n height: '16px',\n margin: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalXS}`,\n width: '1px',\n});\n\nconst useGraphicBaseClassName = makeResetStyles({\n fontSize: GRAPHIC_SIZE,\n height: GRAPHIC_SIZE,\n lineHeight: GRAPHIC_SIZE,\n width: GRAPHIC_SIZE,\n\n [`> .${referenceExtraClassNames.graphicChild}`]: {\n height: GRAPHIC_SIZE,\n width: GRAPHIC_SIZE,\n },\n});\n\nconst useContentBaseClassName = makeResetStyles({\n columnGap: tokens.spacingHorizontalSNudge,\n display: 'inline-flex',\n ...typographyStyles.caption1,\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 rootBaseClassName = useRootBaseClassName();\n const citationBaseClassName = useCitationBaseClassName();\n const dividerBaseClassName = useDividerBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const graphicBaseClassName = useGraphicBaseClassName();\n\n state.root.className = mergeClasses(referenceClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.citation) {\n state.citation.className = mergeClasses(\n referenceClassNames.citation,\n citationBaseClassName,\n state.citation.className,\n );\n }\n\n if (state.divider) {\n state.divider.className = mergeClasses(referenceClassNames.divider, dividerBaseClassName, state.divider.className);\n }\n\n if (state.content) {\n state.content.className = mergeClasses(referenceClassNames.content, contentBaseClassName, state.content.className);\n }\n\n if (state.graphic) {\n state.graphic.className = mergeClasses(referenceClassNames.graphic, graphicBaseClassName, state.graphic.className);\n }\n\n return state;\n};\n"],"names":["referenceClassNames","referenceExtraClassNames","backgroundColor","colorNeutralBackground3Hover","alignItems","root","citation","divider","graphic","content","graphicChild","GRAPHIC_SIZE","useRootBaseClassName","makeResetStyles","__styles","border","color","colorNeutralForeground2","display","__resetStyles","flexShrink","justifyContent","maxWidth","rootBaseClassName","tokens","dividerBaseClassName","useDividerBaseClassName","contentBaseClassName","useContentBaseClassName","graphicBaseClassName","useGraphicBaseClassName","colorNeutralBackground3Pressed","state","className","borderColor","colorNeutralForeground2Pressed","citationBaseClassName","mergeClasses","useRootStyles","makeStyles","width","useCitationBaseClassName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,mBAAAA;eAAAA;;IAQAC,wBAAAA;eAAAA;;IAsBTC,2BAAwBC;eAAxBD;;IAfFE,aAAY;eAAZA;;;iCAnB0E;AAIrE,MAAMJ,sBAAsD;UACjEK;cACAC;aACAC;aACAC;aACAC;AACF;AAEO,MAAMR,2BAA2B;kBACtCS;AACF;AAEA,MAAMC,eAAe;AAErB,MAAMC,uBAAuBC,IAAAA,8BAAAA,EAAAA,WAAgB,MAAA;IAAA;IAAA;IAAA;IAAA;IAAA;CAAA;AAC3CT,MAAAA,gBAAYU,IAAAA,yBAAA,EAAA;cACZZ;QACAa,QAAQ;;;OAGRC;QAAAA;KAAcC;;MAEdC,2BAASC,IAAAA,8BAAA,EAAA,WAAA,MAAA;IAAA;CAAA;MACTC,0BAAYD,IAAAA,8BAAA,EAAA,YAAA,MAAA;IAAA;CAAA;MACZE,0BAAgBF,IAAAA,8BAAA,EAAA,WAAA,MAAA;IAAA;IAAA;CAAA;MAChBG,0BAAUH,IAAAA,8BAAA,EAAA,YAAA,MAAA;IAAA;CAAA;MAKRjB,8BAAwBC,CAAAA;;UAIxBoB,oBAAOvB;kCACYwB;UACnBC,uBAAAC;UACFC,uBAAAC;UAEAC,uBAAiBC;UACf5B,IAAAA,CAAAA,SAAAA,GAAiBsB,IAAAA,6BAAOO,EAAAA,oBAAAA,IAA8B,EAAAR,mBAAAS,MAAA3B,IAAA,CAAA4B,SAAA;cACtDC,QAAAA,EAAaV;cACbR,QAAOQ,CAAAA,SAAOW,GAAAA,IAAAA,6BAAAA,EAAAA,oBAA8B7B,QAAA,EAAA8B,uBAAAJ,MAAA1B,QAAA,CAAA2B,SAAA;;cAG1C/B,OAAAA,EAAAA;cACFK,OAAA,CAAA0B,SAAA,GAAAI,IAAAA,6BAAA,EAAArC,oBAAAO,OAAA,EAAAkB,sBAAAO,MAAAzB,OAAA,CAAA0B,SAAA;;IAEJ,IAAAD,MAAAvB,OAAA,EAAA;QAEAuB,MAAOvB,OAAM6B,CAAAA,SAAAA,GAAgBC,IAAAA,6BAAW,EAAAvC,oBAAAS,OAAA,EAAAkB,sBAAAK,MAAAvB,OAAA,CAAAwB,SAAA;;cAEpCO,OAAO,EAAA;QACTR,MAAAxB,OAAA,CAAAyB,SAAA,GAAAI,IAAAA,6BAAA,EAAArC,oBAAAQ,OAAA,EAAAqB,sBAAAG,MAAAxB,OAAA,CAAAyB,SAAA;IACF;IAEA,OAAMQ;GAEN,qDAAA"}
@@ -12,12 +12,12 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _renderReferenceList = require("./renderReferenceList");
14
14
  const _useReferenceList = require("./useReferenceList");
15
- const _useReferenceListStyles = require("./useReferenceListStyles");
15
+ const _useReferenceListStylesstyles = require("./useReferenceListStyles.styles");
16
16
  const _useReferenceListContextValues = require("./useReferenceListContextValues");
17
17
  const ReferenceList = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
18
18
  const state = (0, _useReferenceList.useReferenceList_unstable)(props, ref);
19
19
  const referenceListContextValues = (0, _useReferenceListContextValues.useReferenceListContextValues_unstable)(state);
20
- (0, _useReferenceListStyles.useReferenceListStyles_unstable)(state);
20
+ (0, _useReferenceListStylesstyles.useReferenceListStyles_unstable)(state);
21
21
  return (0, _renderReferenceList.renderReferenceList_unstable)(state, referenceListContextValues);
22
22
  });
23
23
  ReferenceList.displayName = 'ReferenceList'; //# sourceMappingURL=ReferenceList.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ReferenceList.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { renderReferenceList_unstable } from './renderReferenceList';\nimport { useReferenceList_unstable } from './useReferenceList';\nimport { useReferenceListStyles_unstable } from './useReferenceListStyles';\nimport { useReferenceListContextValues_unstable } from './useReferenceListContextValues';\nimport type { ReferenceListProps } from './ReferenceList.types';\n\nexport const ReferenceList: ForwardRefComponent<ReferenceListProps> = React.forwardRef((props, ref) => {\n const state = useReferenceList_unstable(props, ref);\n const referenceListContextValues = useReferenceListContextValues_unstable(state);\n\n useReferenceListStyles_unstable(state);\n\n return renderReferenceList_unstable(state, referenceListContextValues);\n});\n\nReferenceList.displayName = 'ReferenceList';\n"],"names":["ReferenceList","React","forwardRef","props","state","useReferenceList_unstable","referenceListContextValues","useReferenceListContextValues_unstable","useReferenceListStyles_unstable","renderReferenceList_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;qCAEsB;kCACH;wCACM;+CACO;AAGhD,MAAMA,gBAAAA,WAAAA,GAAAA,OAAyDC,UAAMC,CAAU,CAACC,OAACA;UACtFC,QAAMA,IAAAA,2CAAQC,EAAAA,OAA0BF;UACxCG,6BAAMA,IAAAA,qEAA6BC,EAAAA;+DAEnCC,EAAAA;WAEAC,IAAAA,iDAAOA,EAAAA,OAA6BL;AACtC;AAEAJ,cAAcU,WAAW,GAAG"}
1
+ {"version":3,"sources":["ReferenceList.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { renderReferenceList_unstable } from './renderReferenceList';\nimport { useReferenceList_unstable } from './useReferenceList';\nimport { useReferenceListStyles_unstable } from './useReferenceListStyles.styles';\nimport { useReferenceListContextValues_unstable } from './useReferenceListContextValues';\nimport type { ReferenceListProps } from './ReferenceList.types';\n\nexport const ReferenceList: ForwardRefComponent<ReferenceListProps> = React.forwardRef((props, ref) => {\n const state = useReferenceList_unstable(props, ref);\n const referenceListContextValues = useReferenceListContextValues_unstable(state);\n\n useReferenceListStyles_unstable(state);\n\n return renderReferenceList_unstable(state, referenceListContextValues);\n});\n\nReferenceList.displayName = 'ReferenceList';\n"],"names":["ReferenceList","React","forwardRef","props","state","useReferenceList_unstable","referenceListContextValues","useReferenceListContextValues_unstable","useReferenceListStyles_unstable","renderReferenceList_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;qCAEsB;kCACH;8CACM;+CACO;AAGhD,MAAMA,gBAAAA,WAAAA,GAAAA,OAAyDC,UAAMC,CAAU,CAACC,OAACA;UACtFC,QAAMA,IAAAA,2CAAQC,EAAAA,OAA0BF;UACxCG,6BAAMA,IAAAA,qEAA6BC,EAAAA;qEAEnCC,EAAAA;WAEAC,IAAAA,iDAAOA,EAAAA,OAA6BL;AACtC;AAEAJ,cAAcU,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ReferenceList.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { ReferenceListContextValue } from '../../../contexts/reference-v2/referenceListContext';\n\nexport type ReferenceListSlots = {\n root: NonNullable<Slot<'div'>>;\n showMoreButton?: Slot<'span'>;\n showLessButton?: Slot<'span'>;\n};\n\nexport type ReferenceListProps = ComponentProps<ReferenceListSlots> & {\n /**\n * The appearance of the reference.\n * @default 'lighter'\n */\n appearance?: 'lighter' | 'darker';\n\n /**\n * The maximum number of references to display before the overflow button is shown even if there is\n * enough space available to show more.\n * If not set, the overflow functionality will be disabled.\n * @default undefined\n */\n maxVisibleReferences?: number;\n};\n\nexport type ReferenceListState = ComponentState<ReferenceListSlots> &\n Required<Pick<ReferenceListProps, 'appearance'>> & {\n areReferencesExpanded: boolean;\n overflowButtonTriggeredViaKeyboard: React.MutableRefObject<boolean>;\n previousOverflowCount: React.MutableRefObject<number>;\n shouldUseOverflow: boolean;\n };\n\nexport type ReferenceListContextValues = {\n referenceList: ReferenceListContextValue;\n};\n"],"names":[],"rangeMappings":"","mappings":""}
1
+ {"version":3,"sources":["ReferenceList.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { ReferenceListContextValue } from '../../../contexts/reference-v2/referenceListContext';\n\nexport type ReferenceListSlots = {\n /** The root of the component that contains the list of references. */\n root: NonNullable<Slot<'div'>>;\n\n /** A space containing a button that expands the list of references. This slot is only rendered when the list of references is collapsed. */\n showMoreButton?: Slot<'span'>;\n\n /** A space containing a button that collapses the list of references. This slot is only rendered when the list of references is expanded. */\n showLessButton?: Slot<'span'>;\n};\n\nexport type ReferenceListProps = ComponentProps<ReferenceListSlots> & {\n /**\n * The maximum number of references to display before the overflow button is shown even if there is\n * enough space available to show more.\n * If not set, the overflow functionality will be disabled.\n * @default undefined\n */\n maxVisibleReferences?: number;\n};\n\nexport type ReferenceListState = ComponentState<ReferenceListSlots> &\n Pick<ReferenceListProps, 'maxVisibleReferences'> & {\n areReferencesExpanded: boolean;\n overflowButtonTriggeredViaKeyboard: React.MutableRefObject<boolean>;\n referenceListRef: React.RefObject<HTMLDivElement>;\n shouldUseOverflow: boolean;\n totalReferencesCount: number;\n };\n\nexport type ReferenceListContextValues = {\n referenceList: ReferenceListContextValue;\n};\n"],"names":[],"rangeMappings":"","mappings":""}
@@ -7,5 +7,5 @@ _export_star._(require("./ReferenceList"), exports);
7
7
  _export_star._(require("./ReferenceList.types"), exports);
8
8
  _export_star._(require("./renderReferenceList"), exports);
9
9
  _export_star._(require("./useReferenceList"), exports);
10
- _export_star._(require("./useReferenceListStyles"), exports);
10
+ _export_star._(require("./useReferenceListStyles.styles"), exports);
11
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ReferenceList';\nexport * from './ReferenceList.types';\nexport * from './renderReferenceList';\nexport * from './useReferenceList';\nexport * from './useReferenceListStyles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ReferenceList';\nexport * from './ReferenceList.types';\nexport * from './renderReferenceList';\nexport * from './useReferenceList';\nexport * from './useReferenceListStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -11,15 +11,17 @@ Object.defineProperty(exports, "useReferenceList_unstable", {
11
11
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactcomponents = require("@fluentui/react-components");
14
- const _useReferenceStyles = require("../Reference/useReferenceStyles");
14
+ const _useReferenceStylesstyles = require("../Reference/useReferenceStyles.styles");
15
15
  const useReferenceList_unstable = (props, ref)=>{
16
- const { appearance = 'lighter', children, maxVisibleReferences, showLessButton, showMoreButton, ...rest } = props;
16
+ const { children, maxVisibleReferences, showLessButton, showMoreButton, ...rest } = props;
17
17
  const [areReferencesExpanded, setAreReferencesExpanded] = _react.useState(false);
18
- const referenceInOverflowClassName = (0, _useReferenceStyles.useRootStyles)().overflow;
18
+ const referenceListRef = _react.useRef(null);
19
+ const referenceInOverflowClassName = (0, _useReferenceStylesstyles.useRootStyles)().overflow;
20
+ const childrenArray = _react.Children.toArray(children);
21
+ const totalReferencesCount = childrenArray.length;
19
22
  const resolvedChildren = _react.useMemo(()=>{
20
23
  if (maxVisibleReferences !== undefined && !areReferencesExpanded) {
21
24
  const results = [];
22
- const childrenArray = _react.Children.toArray(children);
23
25
  for(let index = 0; index < childrenArray.length; index++){
24
26
  const child = childrenArray[index];
25
27
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -38,11 +40,10 @@ const useReferenceList_unstable = (props, ref)=>{
38
40
  }, [
39
41
  areReferencesExpanded,
40
42
  children,
43
+ childrenArray,
41
44
  maxVisibleReferences,
42
45
  referenceInOverflowClassName
43
46
  ]);
44
- // We keep track of the previous overflow count to determine element to move focus to when expanding the references via keyboard.
45
- const previousOverflowCount = _react.useRef(0);
46
47
  // We keep track of whether we are interacting with the overflow button via keyboard or not.
47
48
  const overflowButtonTriggeredViaKeyboard = _react.useRef(false);
48
49
  const focusAttributes = (0, _reactcomponents.useArrowNavigationGroup)({
@@ -58,18 +59,19 @@ const useReferenceList_unstable = (props, ref)=>{
58
59
  }, []);
59
60
  const shouldUseOverflow = maxVisibleReferences !== undefined && !areReferencesExpanded;
60
61
  const state = {
61
- appearance,
62
62
  areReferencesExpanded,
63
63
  overflowButtonTriggeredViaKeyboard,
64
- previousOverflowCount,
64
+ maxVisibleReferences,
65
+ referenceListRef,
65
66
  shouldUseOverflow,
67
+ totalReferencesCount,
66
68
  components: {
67
69
  root: 'div',
68
70
  showMoreButton: 'span',
69
71
  showLessButton: 'span'
70
72
  },
71
73
  root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
72
- ref,
74
+ ref: (0, _reactcomponents.useMergedRefs)(ref, referenceListRef),
73
75
  ...focusAttributes,
74
76
  ...rest,
75
77
  children: resolvedChildren
@@ -1 +1 @@
1
- {"version":3,"sources":["useReferenceList.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n mergeCallbacks,\n mergeClasses,\n slot,\n useArrowNavigationGroup,\n} from '@fluentui/react-components';\nimport type { ReferenceListProps, ReferenceListState } from './ReferenceList.types';\nimport { useRootStyles as useReferenceStyles } from '../Reference/useReferenceStyles';\n\n/**\n * Create the state required to render ReferenceList.\n *\n * The returned state can be modified with hooks such as useReferenceListStyles_unstable,\n * before being passed to renderReferenceList_unstable.\n *\n * @param props - props from this instance of ReferenceList\n * @param ref - reference to root HTMLElement of ReferenceList\n */\nexport const useReferenceList_unstable = (\n props: ReferenceListProps,\n ref: React.Ref<HTMLDivElement>,\n): ReferenceListState => {\n const { appearance = 'lighter', children, maxVisibleReferences, showLessButton, showMoreButton, ...rest } = props;\n\n const [areReferencesExpanded, setAreReferencesExpanded] = React.useState(false);\n\n const referenceInOverflowClassName = useReferenceStyles().overflow;\n const resolvedChildren = React.useMemo(() => {\n if (maxVisibleReferences !== undefined && !areReferencesExpanded) {\n const results = [];\n const childrenArray = React.Children.toArray(children);\n for (let index = 0; index < childrenArray.length; index++) {\n const child = childrenArray[index] as React.ReactElement;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (index >= maxVisibleReferences && React.isValidElement<any>(child)) {\n results.push(\n React.cloneElement(child, {\n ...child.props,\n className: mergeClasses(child.props.className, referenceInOverflowClassName),\n }),\n );\n } else {\n results.push(child);\n }\n }\n return results;\n }\n\n return children;\n }, [areReferencesExpanded, children, maxVisibleReferences, referenceInOverflowClassName]);\n\n // We keep track of the previous overflow count to determine element to move focus to when expanding the references via keyboard.\n const previousOverflowCount = React.useRef(0);\n\n // We keep track of whether we are interacting with the overflow button via keyboard or not.\n const overflowButtonTriggeredViaKeyboard = React.useRef(false);\n\n const focusAttributes = useArrowNavigationGroup({\n axis: 'both',\n circular: true,\n memorizeCurrent: true,\n });\n\n const onShowMoreButtonClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(() => {\n setAreReferencesExpanded(true);\n }, []);\n\n const onShowLessButtonClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(() => {\n setAreReferencesExpanded(false);\n }, []);\n\n const shouldUseOverflow = maxVisibleReferences !== undefined && !areReferencesExpanded;\n\n const state: ReferenceListState = {\n appearance,\n areReferencesExpanded,\n overflowButtonTriggeredViaKeyboard,\n previousOverflowCount,\n shouldUseOverflow,\n\n components: {\n root: 'div',\n showMoreButton: 'span',\n showLessButton: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...focusAttributes,\n ...rest,\n children: resolvedChildren,\n }),\n { elementType: 'div' },\n ),\n showMoreButton: shouldUseOverflow ? slot.optional(showMoreButton, { elementType: 'span' }) : undefined,\n showLessButton: areReferencesExpanded ? slot.optional(showLessButton, { elementType: 'span' }) : undefined,\n };\n\n if (state.showMoreButton) {\n state.showMoreButton.onClick = mergeCallbacks(onShowMoreButtonClick, state.showMoreButton.onClick);\n }\n\n if (state.showLessButton) {\n state.showLessButton.onClick = mergeCallbacks(onShowLessButtonClick, state.showLessButton.onClick);\n }\n\n return state;\n};\n"],"names":["appearance","children","maxVisibleReferences","referenceInOverflowClassName","resolvedChildren","results","childrenArray","setAreReferencesExpanded","React","useState","isValidElement","cloneElement","props","areReferencesExpanded","className","Children","toArray","index","length","child","push","previousOverflowCount","useArrowNavigationGroup","circular","useRef","memorizeCurrent","axis","onShowMoreButtonClick","onShowLessButtonClick","useCallback","overflowButtonTriggeredViaKeyboard","showLessButton","always","ref","rest","getIntrinsicElementProps","focusAttributes","elementType","showMoreButton","optional","undefined","slot","state","onClick","mergeCallbacks"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAwBUA;;;eAAAA;;;;iEAxBa;iCAOhB;oCAE6C;AAelD,MAAQA,4BAAwBC,CAAAA,OAAUC;UAE1C,EAEAF,aAAMG,SAAAA,EACNF,QAAMG,sBACAF,gBACIG,gBACAC;kCAGJC,yBAAA,GAAAC,OAAAC,QAAA,CAAA;yCACaP,IAAAA,iCAAwBM,IAAME,QAAAA;6BACzCL,OACEG,OAAMG,CAAAA;qCACKC,aAAK,CAAAC,uBAAA;8BACdC;kCACFN,OAAAO,QAAA,CAAAC,OAAA,CAAAf;4BAEG,GAAAgB,QAAAX,cAAAY,MAAA,EAAAD,QAAA;8BACLZ,aAAac,CAAAA,MAAAA;8EACf;oBACFF,SAAAf,sCAAAM,OAAAE,cAAA,CAAAS,QAAA;4BACAC,IAAOf,eAAAA,OAAAA,YAAAA,CAAAA,OAAAA;wBACT,GAAAc,MAAAP,KAAA;wBAEAE,WAAOb,IAAAA,6BAAAA,EAAAA,MAAAA,KAAAA,CAAAA,SAAAA,EAAAA;oBACN;gBAACY,OAAAA;oBAAuBZ,QAAAA,IAAAA,CAAAA;gBAAUC;;YAAmD,OAAAG;QAExF;QACA,OAAMgB;OAEN;QAAAR;QAAAZ;QAAAC;QAAAC;KAAA;qIACwD;UAExDkB,wBAAwBC,OAAAA,MAAAA,CAAAA;gGAChB;UACNC,qCAAUf,OAAAgB,MAAA,CAAA;UACVC,kBAAiBH,IAAAA,wCAAA,EAAA;QACnBI,MAAA;QAEAH,UAAMI;yBACJpB;;UAGFoB,wBAAMC,OAAwBpB,WAAMqB,CAAAA;iCAClCtB;OACF,EAAG;UAEHqB,wBAA0B1B,OAAAA,WAAAA,CAAAA;QAE1BK,yBAAkC;;UAEhCM,oBAAAA,yBAAAA,aAAAA,CAAAA;UACAiB,QAAAA;;;;;;oBAOEC;kBACF;4BACWC;4BAEPC;;mCAEA,CAAGC,MAAI,CAAAC,IAAAA,yCAAA,EAAA,OAAA;;eAETC,eACA;mBAAEC;sBAAmBjC;YAEvBkC;yBAAoED;;wBACpEN,oBAAgBlB,qBAAAA,CAAAA,QAA6B0B,CAAAA,gBAASR;yBAAkBM;aAAoBG;QAC9FT,gBAAAlB,wBAAA4B,qBAAA,CAAAF,QAAA,CAAAR,gBAAA;YAEAM,aAAUC;aACRI;;QAGFA,MAAIA,cAAMX,EAAc;cACtBW,cAAMX,CAAAA,OAAeY,GAAAA,IAAAA,+BAAUC,EAAAA,uBAAehB,MAAuBc,cAAMX,CAAAA,OAAeY;;QAG5FD,MAAOA,cAAAA,EAAAA;QACPA,MAAAX,cAAA,CAAAY,OAAA,GAAAC,IAAAA,+BAAA,EAAAhB,uBAAAc,MAAAX,cAAA,CAAAY,OAAA"}
1
+ {"version":3,"sources":["useReferenceList.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n mergeCallbacks,\n mergeClasses,\n slot,\n useArrowNavigationGroup,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport type { ReferenceListProps, ReferenceListState } from './ReferenceList.types';\nimport { useRootStyles as useReferenceStyles } from '../Reference/useReferenceStyles.styles';\n\n/**\n * Create the state required to render ReferenceList.\n *\n * The returned state can be modified with hooks such as useReferenceListStyles_unstable,\n * before being passed to renderReferenceList_unstable.\n *\n * @param props - props from this instance of ReferenceList\n * @param ref - reference to root HTMLElement of ReferenceList\n */\nexport const useReferenceList_unstable = (\n props: ReferenceListProps,\n ref: React.Ref<HTMLDivElement>,\n): ReferenceListState => {\n const { children, maxVisibleReferences, showLessButton, showMoreButton, ...rest } = props;\n\n const [areReferencesExpanded, setAreReferencesExpanded] = React.useState(false);\n const referenceListRef = React.useRef<HTMLDivElement>(null);\n\n const referenceInOverflowClassName = useReferenceStyles().overflow;\n\n const childrenArray = React.Children.toArray(children);\n const totalReferencesCount = childrenArray.length;\n const resolvedChildren = React.useMemo(() => {\n if (maxVisibleReferences !== undefined && !areReferencesExpanded) {\n const results = [];\n for (let index = 0; index < childrenArray.length; index++) {\n const child = childrenArray[index] as React.ReactElement;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (index >= maxVisibleReferences && React.isValidElement<any>(child)) {\n results.push(\n React.cloneElement(child, {\n ...child.props,\n className: mergeClasses(child.props.className, referenceInOverflowClassName),\n }),\n );\n } else {\n results.push(child);\n }\n }\n return results;\n }\n return children;\n }, [areReferencesExpanded, children, childrenArray, maxVisibleReferences, referenceInOverflowClassName]);\n\n // We keep track of whether we are interacting with the overflow button via keyboard or not.\n const overflowButtonTriggeredViaKeyboard = React.useRef(false);\n\n const focusAttributes = useArrowNavigationGroup({\n axis: 'both',\n circular: true,\n memorizeCurrent: true,\n });\n\n const onShowMoreButtonClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(() => {\n setAreReferencesExpanded(true);\n }, []);\n\n const onShowLessButtonClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(() => {\n setAreReferencesExpanded(false);\n }, []);\n\n const shouldUseOverflow = maxVisibleReferences !== undefined && !areReferencesExpanded;\n\n const state: ReferenceListState = {\n areReferencesExpanded,\n overflowButtonTriggeredViaKeyboard,\n maxVisibleReferences,\n referenceListRef,\n shouldUseOverflow,\n totalReferencesCount,\n\n components: {\n root: 'div',\n showMoreButton: 'span',\n showLessButton: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: useMergedRefs(ref, referenceListRef),\n ...focusAttributes,\n ...rest,\n children: resolvedChildren,\n }),\n { elementType: 'div' },\n ),\n showMoreButton: shouldUseOverflow ? slot.optional(showMoreButton, { elementType: 'span' }) : undefined,\n showLessButton: areReferencesExpanded ? slot.optional(showLessButton, { elementType: 'span' }) : undefined,\n };\n\n if (state.showMoreButton) {\n state.showMoreButton.onClick = mergeCallbacks(onShowMoreButtonClick, state.showMoreButton.onClick);\n }\n\n if (state.showLessButton) {\n state.showLessButton.onClick = mergeCallbacks(onShowLessButtonClick, state.showLessButton.onClick);\n }\n\n return state;\n};\n"],"names":["children","maxVisibleReferences","props","showLessButton","referenceListRef","referenceInOverflowClassName","childrenArray","showMoreButton","totalReferencesCount","rest","setAreReferencesExpanded","React","useState","index","overflow","Children","toArray","results","cloneElement","areReferencesExpanded","className","length","child","isValidElement","push","mergeClasses","overflowButtonTriggeredViaKeyboard","useArrowNavigationGroup","axis","circular","memorizeCurrent","useCallback","shouldUseOverflow","undefined","root","ref","useMergedRefs","focusAttributes","resolvedChildren","elementType","slot","optional","state","onClick","mergeCallbacks","onShowMoreButtonClick","onShowLessButtonClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAyBUA;;;eAAAA;;;;iEAzBa;iCAQhB;0CAE6C;AAelD,MAAQA,4BAAUC,CAAoBC,OAAEC;UAExC,EACAH,QAAMI,EAENH,oBAAMI,EAENF,cAAMG,EACNC,cAAMC,EACN,GAAAC;kCAEsBC,yBAAA,GAAAC,OAAAC,QAAA,CAAA;6BACTC,OAAWA,MAAQP,CAAAA;yCACZA,IAAAA,uCAAoB,IAAAQ,QAAA;0BAClCH,OAAAI,QAAA,CAAAC,OAAA,CAAAhB;iCACaC,cAAAA,MAAAA;6BACXgB,OACEN,OAAMO,CAAAA;qCACKhB,aAAK,CAAAiB,uBAAA;8BACdC;4BACF,GAAAP,QAAAP,cAAAe,MAAA,EAAAR,QAAA;8BAEJP,aAAO,CAAAO,MAAA;8EACQS;6BACfrB,sCAAAU,OAAAY,cAAA,CAAAD,QAAA;4BACFE,IAAA,eAAAb,OAAAO,YAAA,CAAAI,OAAA;wBACA,GAAAA,MAAOL,KAAAA;wBACTG,WAAAK,IAAAA,6BAAA,EAAAH,MAAApB,KAAA,CAAAkB,SAAA,EAAAf;oBACA;gBACC,OAAA;oBAACc,QAAAA,IAAAA,CAAAA;gBAAuBnB;;mBAAyBC;;eAAmDD;OAEvG;QAAAmB;QAAAnB;QAAAM;QAAAL;QAAAI;KAA4F;gGACpC;UAExDqB,qCAAwBC,OAAAA,MAAwB,CAAA;UAC9CC,kBAAMD,IAAAA,wCAAA,EAAA;cACNE;kBACAC;QACFA,iBAAA;;UAGEpB,wBAAAA,OAAyBqB,WAAA,CAAA;QAC3BrB,yBAAK;OAEL,EAAA;UACEA,wBAAAA,OAAyBqB,WAAA,CAAA;QAC3BrB,yBAAK;OAEL,EAAA;UAEAsB,oBAAkC/B,yBAAAgC,aAAA,CAAAd;UAChCA,QAAAA;;;;;;;oBAQEe;kBACA3B;4BACAJ;4BACF;;mCAGIgC,CAAAA,MAAKC,CAAAA,IAAAA,yCAAmBhC,EAAAA,OAAAA;mDACrBiC,EAAAA,KAAejC;8BACX;mBACPJ;sBAEFsC;;yBAAqB;;wBAE6CC,oBAAaC,qBAAA,CAAAC,QAAA,CAAAlC,gBAAA;yBAAY0B;aAC7F9B;wBAAwEoC,wBAAaC,qBAAA,CAAAC,QAAA,CAAAtC,gBAAA;yBAAY8B;QACnG,KAAAA;;cAGES,cAAMnC,EAAc;QACtBmC,MAAAnC,cAAA,CAAAoC,OAAA,GAAAC,IAAAA,+BAAA,EAAAC,uBAAAH,MAAAnC,cAAA,CAAAoC,OAAA;;cAGED,cAAMvC,EAAc;QACtBuC,MAAAvC,cAAA,CAAAwC,OAAA,GAAAC,IAAAA,+BAAA,EAAAE,uBAAAJ,MAAAvC,cAAA,CAAAwC,OAAA;;IAGA,OAAAD"}
@@ -9,14 +9,15 @@ Object.defineProperty(exports, "useReferenceListContextValues_unstable", {
9
9
  }
10
10
  });
11
11
  function useReferenceListContextValues_unstable(state) {
12
- const { appearance, areReferencesExpanded, overflowButtonTriggeredViaKeyboard, previousOverflowCount, shouldUseOverflow } = state;
12
+ const { areReferencesExpanded, maxVisibleReferences, overflowButtonTriggeredViaKeyboard, referenceListRef, shouldUseOverflow, totalReferencesCount } = state;
13
13
  // This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
14
14
  const referenceList = {
15
- appearance,
16
15
  areReferencesExpanded,
16
+ maxVisibleReferences,
17
17
  overflowButtonTriggeredViaKeyboard,
18
- previousOverflowCount,
19
- shouldUseOverflow
18
+ referenceListRef,
19
+ shouldUseOverflow,
20
+ totalReferencesCount
20
21
  };
21
22
  return {
22
23
  referenceList
@@ -1 +1 @@
1
- {"version":3,"sources":["useReferenceListContextValues.ts"],"sourcesContent":["import type { ReferenceListState, ReferenceListContextValues } from './ReferenceList.types';\n\nexport function useReferenceListContextValues_unstable(state: ReferenceListState): ReferenceListContextValues {\n const {\n appearance,\n areReferencesExpanded,\n overflowButtonTriggeredViaKeyboard,\n previousOverflowCount,\n shouldUseOverflow,\n } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", there is no sense to memoize it\n const referenceList = {\n appearance,\n areReferencesExpanded,\n overflowButtonTriggeredViaKeyboard,\n previousOverflowCount,\n shouldUseOverflow,\n };\n\n return { referenceList };\n}\n"],"names":["useReferenceListContextValues_unstable","state","appearance","areReferencesExpanded","referenceList","overflowButtonTriggeredViaKeyboard","shouldUseOverflow","previousOverflowCount"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,uCAAuCC,KAAyB;UAC9E,EAQAC,UAAA,EACAC,qBAAMC,oCACJF,uBACAC,mBACAE;uGAEAC;UACFF,gBAAA;QAEAF;;QAAuBG;QACzBE"}
1
+ {"version":3,"sources":["useReferenceListContextValues.ts"],"sourcesContent":["import type { ReferenceListState, ReferenceListContextValues } from './ReferenceList.types';\n\nexport function useReferenceListContextValues_unstable(state: ReferenceListState): ReferenceListContextValues {\n const {\n areReferencesExpanded,\n maxVisibleReferences,\n overflowButtonTriggeredViaKeyboard,\n referenceListRef,\n shouldUseOverflow,\n totalReferencesCount,\n } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", there is no sense to memoize it\n const referenceList = {\n areReferencesExpanded,\n maxVisibleReferences,\n overflowButtonTriggeredViaKeyboard,\n referenceListRef,\n shouldUseOverflow,\n totalReferencesCount,\n };\n\n return { referenceList };\n}\n"],"names":["useReferenceListContextValues_unstable","state","areReferencesExpanded","maxVisibleReferences","referenceList","overflowButtonTriggeredViaKeyboard","referenceListRef","totalReferencesCount"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,uCAAuCC,KAAyB;UAC9E,EASAC,qBAAA,EACAC,oBAAMC,oCACJF,kBACAC,mBACAE,sBACAC;uGAEAC;UACFH,gBAAA;QAEAF;;QAAuBG;QACzBC"}
@@ -40,6 +40,7 @@ const useOverflowButtonBaseClassName = (0, _reactcomponents.__resetStyles)("r6su
40
40
  ".r6su6fj{flex-shrink:0;}"
41
41
  ]);
42
42
  const useReferenceListStyles_unstable = (state)=>{
43
+ 'use no memo';
43
44
  const { areReferencesExpanded, shouldUseOverflow } = state;
44
45
  const rootBaseClassName = useRootBaseClassName();
45
46
  const rootStyles = useRootStyles();
@@ -52,4 +53,4 @@ const useReferenceListStyles_unstable = (state)=>{
52
53
  state.showLessButton.className = (0, _reactcomponents.mergeClasses)(referenceListClassNames.showLessButton, overflowButtonBaseClassName, state.showLessButton.className);
53
54
  }
54
55
  return state;
55
- }; //# sourceMappingURL=useReferenceListStyles.js.map
56
+ }; //# sourceMappingURL=useReferenceListStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useReferenceListStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, tokens } from '@fluentui/react-components';\nimport type { ReferenceListSlots, ReferenceListState } from './ReferenceList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const referenceListClassNames: SlotClassNames<ReferenceListSlots> = {\n root: 'fai-ReferenceList',\n showMoreButton: 'fai-ReferenceList__showMoreButton',\n showLessButton: 'fai-ReferenceList__showLessButton',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n display: 'flex',\n flexDirection: 'row',\n gap: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS}`,\n});\n\nconst useRootStyles = makeStyles({\n referencesExpanded: {\n flexWrap: 'wrap',\n },\n});\n\nconst useOverflowButtonBaseClassName = makeResetStyles({\n flexShrink: 0,\n});\n\n/**\n * Apply styling to the ReferenceList slots based on the state\n */\nexport const useReferenceListStyles_unstable = (state: ReferenceListState): ReferenceListState => {\n 'use no memo';\n\n const { areReferencesExpanded, shouldUseOverflow } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n const overflowButtonBaseClassName = useOverflowButtonBaseClassName();\n\n state.root.className = mergeClasses(\n referenceListClassNames.root,\n rootBaseClassName,\n (areReferencesExpanded || !shouldUseOverflow) && rootStyles.referencesExpanded,\n state.root.className,\n );\n\n if (state.showMoreButton) {\n state.showMoreButton.className = mergeClasses(\n referenceListClassNames.showMoreButton,\n overflowButtonBaseClassName,\n state.showMoreButton.className,\n );\n }\n\n if (state.showLessButton) {\n state.showLessButton.className = mergeClasses(\n referenceListClassNames.showLessButton,\n overflowButtonBaseClassName,\n state.showLessButton.className,\n );\n }\n\n return state;\n};\n"],"names":["referenceListClassNames","useReferenceListStyles_unstable","root","showMoreButton","showLessButton","display","__resetStyles","flexDirection","__styles","spacingVerticalXS","Eh141a","useOverflowButtonBaseClassName","state","areReferencesExpanded","shouldUseOverflow","rootBaseClassName","overflowButtonBaseClassName","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,uBAAAA;eAAAA;;IAyBbC,+BAAA;eAAAA;;;iCA7B0D;AAInD,MAAMD,0BAA8D;UACzEE;oBACAC;oBACAC;AACF;AAEA;;CAEC,SAECC,uBAASC,IAAAA,8BAAA,EAAA,WAAA,MAAA;IAAA;CAAA;MACTC,gBAAeC,IAAAA,yBAAA,EAAA;wBACAC;QACjBC,QAAA;IAEA;;;;KAEc;;AAEd,MAAAC,iCAAAL,IAAAA,8BAAA,EAAA,WAAA,MAAA;IAAA;CAAA;AAMA,MAAAL,kCAAAW,CAAAA;;UAIE,EAEAC,qBAAQA,EAERC,iBAAMC,KACNH;UACAG,oBAAMC;UAENJ,aAAWK;UAOPL,8BAAsBD;UACxBC,IAAAA,CAAAA,SAAMT,GAAAA,IAAAA,6BAAec,EAASjB,wBAC5BA,IAAAA,EAAAA,mBAAwBG,CAAAA,yBACxBa,CAAAA,iBACMb,KAAAA,WAAec,kBAAS,EAAAL,MAAAV,IAAA,CAAAe,SAAA;QAElCL,MAAAT,cAAA,EAAA;QAEAS,MAAIA,cAAMR,CAAAA,SAAgB,GAAAc,IAAAA,6BAAA,EAAAlB,wBAAAG,cAAA,EAAAa,6BAAAJ,MAAAT,cAAA,CAAAc,SAAA;;QAM1BL,MAAAR,cAAA,EAAA;QAEAQ,MAAAR,cAAOQ,CAAAA,SAAAA,GAAAA,IAAAA,6BAAAA,EAAAA,wBAAAA,cAAAA,EAAAA,6BAAAA,MAAAA,cAAAA,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 _useReferenceOverflowButton = require("./useReferenceOverflowButton");
14
14
  const _renderReferenceOverflowButton = require("./renderReferenceOverflowButton");
15
- const _useReferenceOverflowButtonStyles = require("./useReferenceOverflowButtonStyles");
15
+ const _useReferenceOverflowButtonStylesstyles = require("./useReferenceOverflowButtonStyles.styles");
16
16
  const ReferenceOverflowButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
17
17
  const state = (0, _useReferenceOverflowButton.useReferenceOverflowButton_unstable)(props, ref);
18
- (0, _useReferenceOverflowButtonStyles.useReferenceOverflowButtonStyles_unstable)(state);
18
+ (0, _useReferenceOverflowButtonStylesstyles.useReferenceOverflowButtonStyles_unstable)(state);
19
19
  return (0, _renderReferenceOverflowButton.renderReferenceOverflowButton_unstable)(state);
20
20
  });
21
21
  ReferenceOverflowButton.displayName = 'ReferenceOverflowButton'; //# sourceMappingURL=ReferenceOverflowButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ReferenceOverflowButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useReferenceOverflowButton_unstable } from './useReferenceOverflowButton';\nimport { renderReferenceOverflowButton_unstable } from './renderReferenceOverflowButton';\nimport { useReferenceOverflowButtonStyles_unstable } from './useReferenceOverflowButtonStyles';\nimport type { ReferenceOverflowButtonProps } from './ReferenceOverflowButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ReferenceOverflowButton component - TODO: add more docs\nexport const ReferenceOverflowButton: ForwardRefComponent<ReferenceOverflowButtonProps> = React.forwardRef(\n (props, ref) => {\n const state = useReferenceOverflowButton_unstable(props, ref);\n\n useReferenceOverflowButtonStyles_unstable(state);\n return renderReferenceOverflowButton_unstable(state);\n },\n);\n\nReferenceOverflowButton.displayName = 'ReferenceOverflowButton';\n"],"names":["ReferenceOverflowButton","React","forwardRef","props","state","useReferenceOverflowButton_unstable","useReferenceOverflowButtonStyles_unstable","renderReferenceOverflowButton_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;4CAC6B;+CACG;kDACG;AAKnD,MAAMA,0BAAAA,WAAAA,GAAAA,OAA6EC,UAAMC,CAAU,CACxGC,OAACA;UACCC,QAAMA,IAAAA,+DAAQC,EAAAA,OAAoCF;mFAElDG,EAAAA;WACAC,IAAAA,qEAAOA,EAAAA;AACT;AAGFP,wBAAwBQ,WAAW,GAAG"}
1
+ {"version":3,"sources":["ReferenceOverflowButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useReferenceOverflowButton_unstable } from './useReferenceOverflowButton';\nimport { renderReferenceOverflowButton_unstable } from './renderReferenceOverflowButton';\nimport { useReferenceOverflowButtonStyles_unstable } from './useReferenceOverflowButtonStyles.styles';\nimport type { ReferenceOverflowButtonProps } from './ReferenceOverflowButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ReferenceOverflowButton component - TODO: add more docs\nexport const ReferenceOverflowButton: ForwardRefComponent<ReferenceOverflowButtonProps> = React.forwardRef(\n (props, ref) => {\n const state = useReferenceOverflowButton_unstable(props, ref);\n\n useReferenceOverflowButtonStyles_unstable(state);\n return renderReferenceOverflowButton_unstable(state);\n },\n);\n\nReferenceOverflowButton.displayName = 'ReferenceOverflowButton';\n"],"names":["ReferenceOverflowButton","React","forwardRef","props","state","useReferenceOverflowButton_unstable","useReferenceOverflowButtonStyles_unstable","renderReferenceOverflowButton_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;4CAC6B;+CACG;wDACG;AAKnD,MAAMA,0BAAAA,WAAAA,GAAAA,OAA6EC,UAAMC,CAAU,CACxGC,OAACA;UACCC,QAAMA,IAAAA,+DAAQC,EAAAA,OAAoCF;yFAElDG,EAAAA;WACAC,IAAAA,qEAAOA,EAAAA;AACT;AAGFP,wBAAwBQ,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ReferenceOverflowButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type ReferenceOverflowButtonSlots = {\n root: Slot<'button'>;\n};\n\n/**\n * ReferenceOverflowButton Props\n */\nexport type ReferenceOverflowButtonProps = ComponentProps<ReferenceOverflowButtonSlots> & {\n /**\n * The appearance of the reference.\n * @default 'lighter'\n */\n appearance?: 'lighter' | 'darker';\n\n text?: string | ((overflowCount: number) => React.ReactNode);\n};\n\n/**\n * State used in rendering ReferenceOverflowButton\n */\nexport type ReferenceOverflowButtonState = ComponentState<ReferenceOverflowButtonSlots> &\n Required<Pick<ReferenceOverflowButtonProps, 'appearance'>> & {\n shouldRenderOverflowButton: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAmBA;;CAEC"}
1
+ {"version":3,"sources":["ReferenceOverflowButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type ReferenceOverflowButtonSlots = {\n /** The root of the component that renders the overflow button. */\n root: Slot<'button'>;\n};\n\n/**\n * ReferenceOverflowButton Props\n */\nexport type ReferenceOverflowButtonProps = ComponentProps<ReferenceOverflowButtonSlots> & {\n /**\n * The text that is displayed inside of the overflow button. This text is only displayed when `children` has not been passed to the component.\n * If a string is passed, that is what is rendered verbatim.\n * If a callback is passed, the callback is called with the number of items that are overflowing, and the result of the callback is rendered.\n */\n text?: string | ((overflowCount: number) => React.ReactNode);\n};\n\n/**\n * State used in rendering ReferenceOverflowButton\n */\nexport type ReferenceOverflowButtonState = ComponentState<ReferenceOverflowButtonSlots> & {\n shouldRenderOverflowButton: boolean;\n};\n"],"names":[],"rangeMappings":";;","mappings":"AAmBA;;CAEC"}
@@ -7,5 +7,5 @@ _export_star._(require("./ReferenceOverflowButton"), exports);
7
7
  _export_star._(require("./ReferenceOverflowButton.types"), exports);
8
8
  _export_star._(require("./renderReferenceOverflowButton"), exports);
9
9
  _export_star._(require("./useReferenceOverflowButton"), exports);
10
- _export_star._(require("./useReferenceOverflowButtonStyles"), exports);
10
+ _export_star._(require("./useReferenceOverflowButtonStyles.styles"), exports);
11
11
  //# 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":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
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":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}