@fluentui-copilot/react-reference 0.11.2 → 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.
- package/CHANGELOG.json +52 -1
- package/CHANGELOG.md +17 -2
- package/dist/index.d.ts +13 -28
- package/lib/components/Citation/Citation.js +1 -1
- package/lib/components/Citation/Citation.js.map +1 -1
- package/lib/components/Citation/index.js +1 -1
- package/lib/components/Citation/index.js.map +1 -1
- package/lib/components/Citation/{useCitationStyles.js → useCitationStyles.styles.js} +3 -1
- package/lib/components/Citation/useCitationStyles.styles.js.map +1 -0
- package/lib/components/Reference/Reference.js +1 -1
- package/lib/components/Reference/Reference.js.map +1 -1
- package/lib/components/Reference/index.js +1 -1
- package/lib/components/Reference/index.js.map +1 -1
- package/lib/components/Reference/useReference.js +1 -1
- package/lib/components/Reference/useReference.js.map +1 -1
- package/lib/components/Reference/{useReferenceStyles.js → useReferenceStyles.styles.js} +3 -1
- package/lib/components/Reference/useReferenceStyles.styles.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js +1 -1
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/index.js +1 -1
- package/lib/components/ReferenceGroupToggle/index.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js +3 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/{useReferenceGroupToggleStyles.js → useReferenceGroupToggleStyles.styles.js} +25 -3
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js.map +1 -0
- package/lib/components/ReferenceList/ReferenceList.js +1 -1
- package/lib/components/ReferenceList/ReferenceList.js.map +1 -1
- package/lib/components/ReferenceList/index.js +1 -1
- package/lib/components/ReferenceList/index.js.map +1 -1
- package/lib/components/ReferenceList/useReferenceList.js +1 -1
- package/lib/components/ReferenceList/useReferenceList.js.map +1 -1
- package/lib/components/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js} +3 -1
- package/lib/components/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
- package/lib/components/reference-v2/Reference/Reference.js +1 -1
- package/lib/components/reference-v2/Reference/Reference.js.map +1 -1
- package/lib/components/reference-v2/Reference/Reference.types.js.map +1 -1
- package/lib/components/reference-v2/Reference/index.js +1 -1
- package/lib/components/reference-v2/Reference/index.js.map +1 -1
- package/lib/components/reference-v2/Reference/renderReference.js +1 -1
- package/lib/components/reference-v2/Reference/renderReference.js.map +1 -1
- package/lib/components/reference-v2/Reference/useReference.js +9 -17
- package/lib/components/reference-v2/Reference/useReference.js.map +1 -1
- package/lib/components/reference-v2/Reference/{useReferenceStyles.js → useReferenceStyles.styles.js} +14 -34
- package/lib/components/reference-v2/Reference/useReferenceStyles.styles.js.map +1 -0
- package/lib/components/reference-v2/ReferenceList/ReferenceList.js +1 -1
- package/lib/components/reference-v2/ReferenceList/ReferenceList.js.map +1 -1
- package/lib/components/reference-v2/ReferenceList/ReferenceList.types.js.map +1 -1
- package/lib/components/reference-v2/ReferenceList/index.js +1 -1
- package/lib/components/reference-v2/ReferenceList/index.js.map +1 -1
- package/lib/components/reference-v2/ReferenceList/useReferenceList.js +10 -10
- package/lib/components/reference-v2/ReferenceList/useReferenceList.js.map +1 -1
- package/lib/components/reference-v2/ReferenceList/useReferenceListContextValues.js +8 -6
- package/lib/components/reference-v2/ReferenceList/useReferenceListContextValues.js.map +1 -1
- package/lib/components/reference-v2/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js} +3 -1
- package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js +1 -1
- package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -1
- package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map +1 -1
- package/lib/components/reference-v2/ReferenceOverflowButton/index.js +1 -1
- package/lib/components/reference-v2/ReferenceOverflowButton/index.js.map +1 -1
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +23 -19
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -1
- package/lib/components/reference-v2/ReferenceOverflowButton/{useReferenceOverflowButtonStyles.js → useReferenceOverflowButtonStyles.styles.js} +5 -21
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js.map +1 -0
- package/lib/contexts/reference-v2/referenceListContext.js +5 -4
- package/lib/contexts/reference-v2/referenceListContext.js.map +1 -1
- package/lib/hooks/reference-v2/useReferenceCitationPreview.js +8 -5
- package/lib/hooks/reference-v2/useReferenceCitationPreview.js.map +1 -1
- package/lib-commonjs/components/Citation/Citation.js +2 -2
- package/lib-commonjs/components/Citation/Citation.js.map +1 -1
- package/lib-commonjs/components/Citation/index.js +1 -1
- package/lib-commonjs/components/Citation/index.js.map +1 -1
- package/lib-commonjs/components/Citation/{useCitationStyles.js → useCitationStyles.styles.js} +2 -1
- package/lib-commonjs/components/Citation/useCitationStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Reference/Reference.js +2 -2
- package/lib-commonjs/components/Reference/Reference.js.map +1 -1
- package/lib-commonjs/components/Reference/index.js +1 -1
- package/lib-commonjs/components/Reference/index.js.map +1 -1
- package/lib-commonjs/components/Reference/useReference.js +2 -2
- package/lib-commonjs/components/Reference/useReference.js.map +1 -1
- package/lib-commonjs/components/Reference/{useReferenceStyles.js → useReferenceStyles.styles.js} +2 -1
- package/lib-commonjs/components/Reference/useReferenceStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js +2 -2
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/index.js +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/index.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js +3 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/{useReferenceGroupToggleStyles.js → useReferenceGroupToggleStyles.styles.js} +28 -2
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.js +2 -2
- package/lib-commonjs/components/ReferenceList/ReferenceList.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/index.js +1 -1
- package/lib-commonjs/components/ReferenceList/index.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/useReferenceList.js +2 -2
- package/lib-commonjs/components/ReferenceList/useReferenceList.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js} +2 -1
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
- package/lib-commonjs/components/reference-v2/Reference/Reference.js +2 -2
- package/lib-commonjs/components/reference-v2/Reference/Reference.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/Reference.types.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/index.js +4 -4
- package/lib-commonjs/components/reference-v2/Reference/index.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/renderReference.js +1 -1
- package/lib-commonjs/components/reference-v2/Reference/renderReference.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/useReference.js +9 -14
- package/lib-commonjs/components/reference-v2/Reference/useReference.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/{useReferenceStyles.js → useReferenceStyles.styles.js} +13 -48
- package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js +2 -2
- package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.types.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/index.js +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/index.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js +11 -9
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js +5 -4
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js} +2 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js +2 -2
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/index.js +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/index.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +26 -17
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/{useReferenceOverflowButtonStyles.js → useReferenceOverflowButtonStyles.styles.js} +3 -33
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/contexts/reference-v2/referenceListContext.js +5 -4
- package/lib-commonjs/contexts/reference-v2/referenceListContext.js.map +1 -1
- package/lib-commonjs/hooks/reference-v2/useReferenceCitationPreview.js +8 -5
- package/lib-commonjs/hooks/reference-v2/useReferenceCitationPreview.js.map +1 -1
- package/package.json +10 -10
- package/lib/components/Citation/useCitationStyles.js.map +0 -1
- package/lib/components/Reference/useReferenceStyles.js.map +0 -1
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +0 -1
- package/lib/components/ReferenceList/useReferenceListStyles.js.map +0 -1
- package/lib/components/reference-v2/Reference/useReferenceStyles.js.map +0 -1
- package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.js.map +0 -1
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.js.map +0 -1
- package/lib-commonjs/components/Citation/useCitationStyles.js.map +0 -1
- package/lib-commonjs/components/Reference/useReferenceStyles.js.map +0 -1
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +0 -1
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.js.map +0 -1
- package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.js.map +0 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.js.map +0 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.js.map +0 -1
|
@@ -2,5 +2,5 @@ export * from './ReferenceList';
|
|
|
2
2
|
export * from './ReferenceList.types';
|
|
3
3
|
export * from './renderReferenceList';
|
|
4
4
|
export * from './useReferenceList';
|
|
5
|
-
export * from './useReferenceListStyles';
|
|
5
|
+
export * from './useReferenceListStyles.styles';
|
|
6
6
|
//# 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":"AAAA,cAAc,kBAAkB;AAChC,cAAc,wBAAwB;AACtC,cAAc,wBAAwB;AACtC,cAAc,qBAAqB;AACnC,cAAc,
|
|
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":"AAAA,cAAc,kBAAkB;AAChC,cAAc,wBAAwB;AACtC,cAAc,wBAAwB;AACtC,cAAc,qBAAqB;AACnC,cAAc,kCAAkC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getIntrinsicElementProps, slot } from '@fluentui/react-components';
|
|
3
|
-
import { referenceListItemClassName } from './useReferenceListStyles';
|
|
3
|
+
import { referenceListItemClassName } from './useReferenceListStyles.styles';
|
|
4
4
|
// If you add JSX to this file, be sure to change the file type to .tsx
|
|
5
5
|
/**
|
|
6
6
|
* Create the state required to render ReferenceList.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useReferenceList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { ReferenceListProps, ReferenceListState } from './ReferenceList.types';\nimport { referenceListItemClassName } from './useReferenceListStyles';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\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<HTMLOListElement>,\n): ReferenceListState => {\n return {\n components: {\n root: 'ol',\n },\n root: slot.always(\n getIntrinsicElementProps('ol', {\n ref,\n ...props,\n children: React.Children.map(props.children, child => <li className={referenceListItemClassName}>{child}</li>),\n }),\n { elementType: 'ol' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","referenceListItemClassName","useReferenceList_unstable","props","ref","components","root","always","children","Children","map","child","li","className","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,6BAA6B;AAE5E,SAASC,0BAA0B,QAAQ,
|
|
1
|
+
{"version":3,"sources":["useReferenceList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { ReferenceListProps, ReferenceListState } from './ReferenceList.types';\nimport { referenceListItemClassName } from './useReferenceListStyles.styles';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\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<HTMLOListElement>,\n): ReferenceListState => {\n return {\n components: {\n root: 'ol',\n },\n root: slot.always(\n getIntrinsicElementProps('ol', {\n ref,\n ...props,\n children: React.Children.map(props.children, child => <li className={referenceListItemClassName}>{child}</li>),\n }),\n { elementType: 'ol' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","referenceListItemClassName","useReferenceList_unstable","props","ref","components","root","always","children","Children","map","child","li","className","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,6BAA6B;AAE5E,SAASC,0BAA0B,QAAQ,kCAAkC;AAE7E,uEAAuE;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,OAAO;QACLC,YAAY;YACVC,MAAM;QACR;QACAA,MAAMN,KAAKO,MAAM,CACfR,yBAAyB,MAAM;YAC7BK;YACA,GAAGD,KAAK;YACRK,UAAUV,MAAMW,QAAQ,CAACC,GAAG,CAACP,MAAMK,QAAQ,EAAEG,CAAAA,sBAAS,oBAACC;oBAAGC,WAAWZ;mBAA6BU;QACpG,IACA;YAAEG,aAAa;QAAK;IAExB;AACF,EAAE"}
|
package/lib/components/ReferenceList/{useReferenceListStyles.js → useReferenceListStyles.styles.js}
RENAMED
|
@@ -11,7 +11,9 @@ const useRootClassName = __resetStyles("rc0s888", null, [".rc0s888{padding:0;mar
|
|
|
11
11
|
* Apply styling to the ReferenceList slots based on the state
|
|
12
12
|
*/
|
|
13
13
|
export const useReferenceListStyles_unstable = state => {
|
|
14
|
+
'use no memo';
|
|
15
|
+
|
|
14
16
|
state.root.className = mergeClasses(referenceListClassNames.root, useRootClassName(), state.root.className);
|
|
15
17
|
return state;
|
|
16
18
|
};
|
|
17
|
-
//# sourceMappingURL=useReferenceListStyles.js.map
|
|
19
|
+
//# sourceMappingURL=useReferenceListStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceListStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, 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};\n\nexport const referenceListItemClassName = 'fai-ReferenceList__item';\n\n/**\n * Styles for the root slot\n */\nconst useRootClassName = makeResetStyles({\n padding: 0,\n margin: 0,\n display: 'flex',\n flexDirection: 'column',\n gap: tokens.spacingVerticalS,\n\n [`> .${referenceListItemClassName}`]: {\n listStyleType: 'none',\n },\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 state.root.className = mergeClasses(referenceListClassNames.root, useRootClassName(), state.root.className);\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","tokens","referenceListClassNames","root","referenceListItemClassName","useRootClassName","padding","margin","display","flexDirection","gap","spacingVerticalS","listStyleType","useReferenceListStyles_unstable","state","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,MAAM,QAAQ,6BAA6B;AAInF,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,6BAA6B,0BAA0B;AAEpE;;CAEC,GACD,MAAMC,mBAAmBN,gBAAgB;IACvCO,SAAS;IACTC,QAAQ;IACRC,SAAS;IACTC,eAAe;IACfC,KAAKT,OAAOU,gBAAgB;IAE5B,CAAC,CAAC,GAAG,EAAEP,2BAA2B,CAAC,CAAC,EAAE;QACpCQ,eAAe;IACjB;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9C;IAEAA,MAAMX,IAAI,CAACY,SAAS,GAAGf,aAAaE,wBAAwBC,IAAI,EAAEE,oBAAoBS,MAAMX,IAAI,CAACY,SAAS;IAE1G,OAAOD;AACT,EAAE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useReference_unstable } from './useReference';
|
|
3
3
|
import { renderReference_unstable } from './renderReference';
|
|
4
|
-
import { useReferenceStyles_unstable } from './useReferenceStyles';
|
|
4
|
+
import { useReferenceStyles_unstable } from './useReferenceStyles.styles';
|
|
5
5
|
export const Reference = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
6
6
|
const state = useReference_unstable(props, ref);
|
|
7
7
|
useReferenceStyles_unstable(state);
|
|
@@ -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":["React","useReference_unstable","renderReference_unstable","useReferenceStyles_unstable","Reference","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,
|
|
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":["React","useReference_unstable","renderReference_unstable","useReferenceStyles_unstable","Reference","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,8BAA8B;AAI1E,OAAO,MAAMC,0BAAiDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQP,sBAAsBK,OAAOC;IAE3CJ,4BAA4BK;IAC5B,OAAON,yBAAyBM;AAClC,GAAG;AAEHJ,UAAUK,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
|
|
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', 'a'>>;\n citation?: Slot<'span'>;\n divider?: Slot<'span'>;\n content?: Slot<'span'>;\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":"AAaA,WAEgD"}
|
|
@@ -2,5 +2,5 @@ export * from './Reference';
|
|
|
2
2
|
export * from './Reference.types';
|
|
3
3
|
export * from './renderReference';
|
|
4
4
|
export * from './useReference';
|
|
5
|
-
export { referenceClassNames, referenceExtraClassNames, useReferenceStyles_unstable } from './useReferenceStyles';
|
|
5
|
+
export { referenceClassNames, referenceExtraClassNames, useReferenceStyles_unstable } from './useReferenceStyles.styles';
|
|
6
6
|
//# 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 {
|
|
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":"AAAA,cAAc,cAAc;AAC5B,cAAc,oBAAoB;AAClC,cAAc,oBAAoB;AAClC,cAAc,iBAAiB;AAC/B,SACEA,mBAAmB,EACnBC,wBAAwB,EACxBC,2BAA2B,QACtB,8BAA8B"}
|
|
@@ -8,7 +8,7 @@ export const renderReference_unstable = state => {
|
|
|
8
8
|
} = state;
|
|
9
9
|
const reference = /*#__PURE__*/_jsxs(state.root, {
|
|
10
10
|
children: [state.citation && /*#__PURE__*/_jsx(state.citation, {}), state.divider && /*#__PURE__*/_jsx(state.divider, {}), state.content && /*#__PURE__*/_jsxs(state.content, {
|
|
11
|
-
children: [state.
|
|
11
|
+
children: [state.graphic && /*#__PURE__*/_jsx(state.graphic, {}), state.root.children]
|
|
12
12
|
})]
|
|
13
13
|
});
|
|
14
14
|
return shouldUseOverflow ? /*#__PURE__*/_jsx(OverflowItem, {
|
|
@@ -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.
|
|
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":["OverflowItem","assertSlots","renderReference_unstable","state","id","shouldUseOverflow","reference","root","citation","divider","content","graphic","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,YAAY,EAAEC,WAAW,QAAQ,6BAA6B;AAGvE,OAAO,MAAMC,2BAA2B,CAACC;IACvCF,YAA4BE;IAE5B,MAAM,EAAEC,EAAE,EAAEC,iBAAiB,EAAE,GAAGF;IAElC,MAAMG,0BACJ,MAACH,MAAMI,IAAI;;YACRJ,MAAMK,QAAQ,kBAAI,KAACL,MAAMK,QAAQ;YACjCL,MAAMM,OAAO,kBAAI,KAACN,MAAMM,OAAO;YAC/BN,MAAMO,OAAO,kBACZ,MAACP,MAAMO,OAAO;;oBACXP,MAAMQ,OAAO,kBAAI,KAACR,MAAMQ,OAAO;oBAC/BR,MAAMI,IAAI,CAACK,QAAQ;;;;;IAM5B,OAAOP,kCACL,KAACL;QAAsBI,IAAIA;kBACxBE;OADgBF,MAInBE;AAEJ,EAAE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getIntrinsicElementProps, mergeClasses, slot, useId } from '@fluentui/react-components';
|
|
3
3
|
import { useReferenceListContext_unstable } from '../../../contexts/reference-v2/referenceListContext';
|
|
4
|
-
import { referenceExtraClassNames } from './useReferenceStyles';
|
|
4
|
+
import { referenceExtraClassNames } from './useReferenceStyles.styles';
|
|
5
5
|
/**
|
|
6
6
|
* Create the state required to render Reference.
|
|
7
7
|
*
|
|
@@ -16,38 +16,30 @@ export const useReference_unstable = (props, ref) => {
|
|
|
16
16
|
children,
|
|
17
17
|
id
|
|
18
18
|
} = props;
|
|
19
|
-
const
|
|
20
|
-
ctxAppearance,
|
|
21
|
-
shouldUseOverflow
|
|
22
|
-
} = useReferenceListContext_unstable(ctx => ({
|
|
23
|
-
ctxAppearance: ctx.appearance,
|
|
24
|
-
shouldUseOverflow: ctx.shouldUseOverflow
|
|
25
|
-
}));
|
|
26
|
-
const appearance = props.appearance || ctxAppearance;
|
|
19
|
+
const shouldUseOverflow = useReferenceListContext_unstable(ctx => ctx.shouldUseOverflow);
|
|
27
20
|
const referenceId = useId('reference-', id);
|
|
28
21
|
const citation = slot.optional(props.citation, {
|
|
29
22
|
elementType: 'span'
|
|
30
23
|
});
|
|
31
|
-
const
|
|
24
|
+
const graphic = slot.optional(props.graphic, {
|
|
32
25
|
elementType: 'span'
|
|
33
26
|
});
|
|
34
27
|
const content = slot.optional(props.content, {
|
|
35
28
|
elementType: 'span',
|
|
36
|
-
renderByDefault:
|
|
29
|
+
renderByDefault: graphic !== undefined || !!children
|
|
37
30
|
});
|
|
38
31
|
const divider = slot.optional(props.divider, {
|
|
39
32
|
elementType: 'span',
|
|
40
33
|
renderByDefault: citation !== undefined && content !== undefined
|
|
41
34
|
});
|
|
42
35
|
const state = {
|
|
43
|
-
appearance,
|
|
44
36
|
id: referenceId,
|
|
45
37
|
shouldUseOverflow,
|
|
46
38
|
components: {
|
|
47
39
|
root: 'button',
|
|
48
40
|
citation: 'span',
|
|
49
41
|
divider: 'span',
|
|
50
|
-
|
|
42
|
+
graphic: 'span',
|
|
51
43
|
content: 'span'
|
|
52
44
|
},
|
|
53
45
|
root: slot.always(getIntrinsicElementProps('button', {
|
|
@@ -60,11 +52,11 @@ export const useReference_unstable = (props, ref) => {
|
|
|
60
52
|
citation,
|
|
61
53
|
divider,
|
|
62
54
|
content,
|
|
63
|
-
|
|
55
|
+
graphic
|
|
64
56
|
};
|
|
65
|
-
if (state.
|
|
66
|
-
state.
|
|
67
|
-
className: mergeClasses(state.
|
|
57
|
+
if (state.graphic && React.isValidElement(state.graphic.children)) {
|
|
58
|
+
state.graphic.children = React.cloneElement(state.graphic.children, {
|
|
59
|
+
className: mergeClasses(state.graphic.children.props.className, referenceExtraClassNames.graphicChild)
|
|
68
60
|
});
|
|
69
61
|
}
|
|
70
62
|
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
|
|
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 { children, id } = props;\n\n const shouldUseOverflow = useReferenceListContext_unstable(ctx => ctx.shouldUseOverflow);\n\n const referenceId = useId('reference-', id);\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('button', {\n ref,\n ...props,\n id: referenceId,\n }),\n { elementType: 'button' },\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":["React","getIntrinsicElementProps","mergeClasses","slot","useId","useReferenceListContext_unstable","referenceExtraClassNames","useReference_unstable","props","ref","children","id","shouldUseOverflow","ctx","referenceId","citation","optional","elementType","graphic","content","renderByDefault","undefined","divider","state","components","root","always","isValidElement","cloneElement","className","graphicChild"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,YAAY,EAAEC,IAAI,EAAEC,KAAK,QAAQ,6BAA6B;AACjG,SAASC,gCAAgC,QAAQ,sDAAsD;AACvG,SAASC,wBAAwB,QAAQ,8BAA8B;AAGvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwB,CACnCC,OACAC;IAEA,MAAM,EAAEC,QAAQ,EAAEC,EAAE,EAAE,GAAGH;IAEzB,MAAMI,oBAAoBP,iCAAiCQ,CAAAA,MAAOA,IAAID,iBAAiB;IAEvF,MAAME,cAAcV,MAAM,cAAcO;IAExC,MAAMI,WAAWZ,KAAKa,QAAQ,CAACR,MAAMO,QAAQ,EAAE;QAAEE,aAAa;IAAO;IACrE,MAAMC,UAAUf,KAAKa,QAAQ,CAACR,MAAMU,OAAO,EAAE;QAAED,aAAa;IAAO;IACnE,MAAME,UAAUhB,KAAKa,QAAQ,CAACR,MAAMW,OAAO,EAAE;QAC3CF,aAAa;QACbG,iBAAiBF,YAAYG,aAAa,CAAC,CAACX;IAC9C;IACA,MAAMY,UAAUnB,KAAKa,QAAQ,CAACR,MAAMc,OAAO,EAAE;QAC3CL,aAAa;QACbG,iBAAiBL,aAAaM,aAAaF,YAAYE;IACzD;IAEA,MAAME,QAAwB;QAC5BZ,IAAIG;QACJF;QAEAY,YAAY;YACVC,MAAM;YACNV,UAAU;YACVO,SAAS;YACTJ,SAAS;YACTC,SAAS;QACX;QAEAM,MAAMtB,KAAKuB,MAAM,CACfzB,yBAAyB,UAAU;YACjCQ;YACA,GAAGD,KAAK;YACRG,IAAIG;QACN,IACA;YAAEG,aAAa;QAAS;QAE1BF;QACAO;QACAH;QACAD;IACF;IAEA,IAAIK,MAAML,OAAO,IAAIlB,MAAM2B,cAAc,CAAcJ,MAAML,OAAO,CAACR,QAAQ,GAAG;QAC9Ea,MAAML,OAAO,CAACR,QAAQ,GAAGV,MAAM4B,YAAY,CAACL,MAAML,OAAO,CAACR,QAAQ,EAAE;YAClEmB,WAAW3B,aAAaqB,MAAML,OAAO,CAACR,QAAQ,CAACF,KAAK,CAACqB,SAAS,EAAEvB,yBAAyBwB,YAAY;QACvG;IACF;IAEA,OAAOP;AACT,EAAE"}
|
package/lib/components/reference-v2/Reference/{useReferenceStyles.js → useReferenceStyles.styles.js}
RENAMED
|
@@ -1,71 +1,51 @@
|
|
|
1
|
-
import { __resetStyles, __styles, mergeClasses,
|
|
1
|
+
import { __resetStyles, __styles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';
|
|
2
2
|
export const referenceClassNames = {
|
|
3
3
|
root: 'fai-Reference',
|
|
4
4
|
citation: 'fai-Reference__citation',
|
|
5
5
|
divider: 'fai-Reference__divider',
|
|
6
|
-
|
|
6
|
+
graphic: 'fai-Reference__graphic',
|
|
7
7
|
content: 'fai-Reference__content'
|
|
8
8
|
};
|
|
9
9
|
export const referenceExtraClassNames = {
|
|
10
|
-
|
|
10
|
+
graphicChild: 'fai-Reference__graphicChild'
|
|
11
11
|
};
|
|
12
|
-
const
|
|
12
|
+
const GRAPHIC_SIZE = '16px';
|
|
13
13
|
const useRootBaseClassName = __resetStyles("r1aeqif9", null, [".r1aeqif9{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;padding:var(--spacingVerticalXXS) var(--spacingHorizontalS);}", ".r1aeqif9:hover{background-color:var(--colorNeutralBackground3Hover);border-color:var(--colorNeutralStroke1Hover);color:var(--colorNeutralForeground2Hover);}", ".r1aeqif9:hover .fai-Reference__divider{background-color:var(--colorNeutralStroke1Hover);}", ".r1aeqif9:hover:active{background-color:var(--colorNeutralBackground3Pressed);border-color:var(--colorNeutralStroke1Pressed);color:var(--colorNeutralForeground2Pressed);}", ".r1aeqif9:hover:active .fai-Reference__divider{background-color:var(--colorNeutralStroke1Pressed);}"]);
|
|
14
14
|
export const useRootStyles = __styles({
|
|
15
|
-
darker: {
|
|
16
|
-
De3pzq: "f3vzo32",
|
|
17
|
-
g2u3we: "fj3muxo",
|
|
18
|
-
h3c5rm: ["f1akhkt", "f1lxtadh"],
|
|
19
|
-
B9xav0g: "f1aperda",
|
|
20
|
-
zhjwy3: ["f1lxtadh", "f1akhkt"],
|
|
21
|
-
Jwef8y: "f14vf7cg",
|
|
22
|
-
iro3zm: "fho4vwd"
|
|
23
|
-
},
|
|
24
15
|
overflow: {
|
|
25
16
|
a9b677: "fly5x3f"
|
|
26
17
|
}
|
|
27
18
|
}, {
|
|
28
|
-
d: [".
|
|
29
|
-
h: [".f14vf7cg:hover{background-color:var(--colorNeutralBackground5Hover);}", ".fho4vwd:hover:active{background-color:var(--colorNeutralBackground5Pressed);}"]
|
|
19
|
+
d: [".fly5x3f{width:100%;}"]
|
|
30
20
|
});
|
|
31
21
|
const useCitationBaseClassName = __resetStyles("rzdip90", null, [".rzdip90{font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase100);}"]);
|
|
32
22
|
const useDividerBaseClassName = __resetStyles("r1eyqaw5", null, [".r1eyqaw5{background-color:var(--colorNeutralStroke2);height:16px;margin:var(--spacingVerticalNone) var(--spacingHorizontalXS);width:1px;}"]);
|
|
33
|
-
const
|
|
34
|
-
darker: {
|
|
35
|
-
De3pzq: "f1d3jkam"
|
|
36
|
-
}
|
|
37
|
-
}, {
|
|
38
|
-
d: [".f1d3jkam{background-color:var(--colorNeutralStroke1);}"]
|
|
39
|
-
});
|
|
40
|
-
const useMediaBaseClassName = __resetStyles("r4nw7iy", null, [".r4nw7iy{font-size:16px;height:16px;line-height:16px;width:16px;}", ".r4nw7iy>.fai-Reference__mediaChild{height:16px;width:16px;}"]);
|
|
23
|
+
const useGraphicBaseClassName = __resetStyles("rjrtsj7", null, [".rjrtsj7{font-size:16px;height:16px;line-height:16px;width:16px;}", ".rjrtsj7>.fai-Reference__graphicChild{height:16px;width:16px;}"]);
|
|
41
24
|
const useContentBaseClassName = __resetStyles("r1yvxokd", null, [".r1yvxokd{column-gap:var(--spacingHorizontalSNudge);display:inline-flex;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}"]);
|
|
42
25
|
/**
|
|
43
26
|
* Apply styling to the Reference slots based on the state
|
|
44
27
|
*/
|
|
45
28
|
export const useReferenceStyles_unstable = state => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} = state;
|
|
29
|
+
'use no memo';
|
|
30
|
+
|
|
49
31
|
const rootBaseClassName = useRootBaseClassName();
|
|
50
32
|
const citationBaseClassName = useCitationBaseClassName();
|
|
51
33
|
const dividerBaseClassName = useDividerBaseClassName();
|
|
52
34
|
const contentBaseClassName = useContentBaseClassName();
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
const dividerStyles = useDividerStyles();
|
|
56
|
-
state.root.className = mergeClasses(referenceClassNames.root, rootBaseClassName, appearance === 'darker' && rootStyles.darker, state.root.className);
|
|
35
|
+
const graphicBaseClassName = useGraphicBaseClassName();
|
|
36
|
+
state.root.className = mergeClasses(referenceClassNames.root, rootBaseClassName, state.root.className);
|
|
57
37
|
if (state.citation) {
|
|
58
38
|
state.citation.className = mergeClasses(referenceClassNames.citation, citationBaseClassName, state.citation.className);
|
|
59
39
|
}
|
|
60
40
|
if (state.divider) {
|
|
61
|
-
state.divider.className = mergeClasses(referenceClassNames.divider, dividerBaseClassName,
|
|
41
|
+
state.divider.className = mergeClasses(referenceClassNames.divider, dividerBaseClassName, state.divider.className);
|
|
62
42
|
}
|
|
63
43
|
if (state.content) {
|
|
64
44
|
state.content.className = mergeClasses(referenceClassNames.content, contentBaseClassName, state.content.className);
|
|
65
45
|
}
|
|
66
|
-
if (state.
|
|
67
|
-
state.
|
|
46
|
+
if (state.graphic) {
|
|
47
|
+
state.graphic.className = mergeClasses(referenceClassNames.graphic, graphicBaseClassName, state.graphic.className);
|
|
68
48
|
}
|
|
69
49
|
return state;
|
|
70
50
|
};
|
|
71
|
-
//# sourceMappingURL=useReferenceStyles.js.map
|
|
51
|
+
//# 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 padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalS}`,\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":["makeResetStyles","makeStyles","mergeClasses","tokens","typographyStyles","referenceClassNames","root","citation","divider","graphic","content","referenceExtraClassNames","graphicChild","GRAPHIC_SIZE","useRootBaseClassName","alignItems","backgroundColor","colorNeutralBackground3","border","strokeWidthThin","colorNeutralStroke2","borderRadius","borderRadiusMedium","boxSizing","color","colorNeutralForeground2","columnGap","spacingHorizontalXXS","display","flexShrink","justifyContent","padding","spacingVerticalXXS","spacingHorizontalS","colorNeutralBackground3Hover","borderColor","colorNeutralStroke1Hover","colorNeutralForeground2Hover","colorNeutralBackground3Pressed","colorNeutralStroke1Pressed","colorNeutralForeground2Pressed","useRootStyles","overflow","width","useCitationBaseClassName","caption2Strong","useDividerBaseClassName","height","margin","spacingVerticalNone","spacingHorizontalXS","useGraphicBaseClassName","fontSize","lineHeight","useContentBaseClassName","spacingHorizontalSNudge","caption1","useReferenceStyles_unstable","state","rootBaseClassName","citationBaseClassName","dividerBaseClassName","contentBaseClassName","graphicBaseClassName","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAIjH,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,UAAU;IACVC,SAAS;IACTC,SAAS;IACTC,SAAS;AACX,EAAE;AAEF,OAAO,MAAMC,2BAA2B;IACtCC,cAAc;AAChB,EAAE;AAEF,MAAMC,eAAe;AAErB,MAAMC,uBAAuBd,gBAAgB;IAC3Ce,YAAY;IACZC,iBAAiBb,OAAOc,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEf,OAAOgB,eAAe,CAAC,OAAO,EAAEhB,OAAOiB,mBAAmB,CAAC,CAAC;IACvEC,cAAclB,OAAOmB,kBAAkB;IACvCC,WAAW;IACXC,OAAOrB,OAAOsB,uBAAuB;IACrCC,WAAWvB,OAAOwB,oBAAoB;IACtCC,SAAS;IACTC,YAAY;IACZC,gBAAgB;IAChBC,SAAS,CAAC,EAAE5B,OAAO6B,kBAAkB,CAAC,CAAC,EAAE7B,OAAO8B,kBAAkB,CAAC,CAAC;IAEpE,UAAU;QACRjB,iBAAiBb,OAAO+B,4BAA4B;QACpDC,aAAahC,OAAOiC,wBAAwB;QAC5CZ,OAAOrB,OAAOkC,4BAA4B;QAE1C,CAAC,CAAC,GAAG,EAAEhC,oBAAoBG,OAAO,CAAC,CAAC,CAAC,EAAE;YACrCQ,iBAAiBb,OAAOiC,wBAAwB;QAClD;IACF;IAEA,iBAAiB;QACfpB,iBAAiBb,OAAOmC,8BAA8B;QACtDH,aAAahC,OAAOoC,0BAA0B;QAC9Cf,OAAOrB,OAAOqC,8BAA8B;QAE5C,CAAC,CAAC,GAAG,EAAEnC,oBAAoBG,OAAO,CAAC,CAAC,CAAC,EAAE;YACrCQ,iBAAiBb,OAAOoC,0BAA0B;QACpD;IACF;AACF;AAEA,OAAO,MAAME,gBAAgBxC,WAAW;IACtCyC,UAAU;QACRC,OAAO;IACT;AACF,GAAG;AAEH,MAAMC,2BAA2B5C,gBAAgB;IAC/C,GAAGI,iBAAiByC,cAAc;AACpC;AAEA,MAAMC,0BAA0B9C,gBAAgB;IAC9CgB,iBAAiBb,OAAOiB,mBAAmB;IAC3C2B,QAAQ;IACRC,QAAQ,CAAC,EAAE7C,OAAO8C,mBAAmB,CAAC,CAAC,EAAE9C,OAAO+C,mBAAmB,CAAC,CAAC;IACrEP,OAAO;AACT;AAEA,MAAMQ,0BAA0BnD,gBAAgB;IAC9CoD,UAAUvC;IACVkC,QAAQlC;IACRwC,YAAYxC;IACZ8B,OAAO9B;IAEP,CAAC,CAAC,GAAG,EAAEF,yBAAyBC,YAAY,CAAC,CAAC,CAAC,EAAE;QAC/CmC,QAAQlC;QACR8B,OAAO9B;IACT;AACF;AAEA,MAAMyC,0BAA0BtD,gBAAgB;IAC9C0B,WAAWvB,OAAOoD,uBAAuB;IACzC3B,SAAS;IACT,GAAGxB,iBAAiBoD,QAAQ;AAC9B;AAEA;;CAEC,GACD,OAAO,MAAMC,8BAA8B,CAACC;IAC1C;IAEA,MAAMC,oBAAoB7C;IAC1B,MAAM8C,wBAAwBhB;IAC9B,MAAMiB,uBAAuBf;IAC7B,MAAMgB,uBAAuBR;IAC7B,MAAMS,uBAAuBZ;IAE7BO,MAAMpD,IAAI,CAAC0D,SAAS,GAAG9D,aAAaG,oBAAoBC,IAAI,EAAEqD,mBAAmBD,MAAMpD,IAAI,CAAC0D,SAAS;IAErG,IAAIN,MAAMnD,QAAQ,EAAE;QAClBmD,MAAMnD,QAAQ,CAACyD,SAAS,GAAG9D,aACzBG,oBAAoBE,QAAQ,EAC5BqD,uBACAF,MAAMnD,QAAQ,CAACyD,SAAS;IAE5B;IAEA,IAAIN,MAAMlD,OAAO,EAAE;QACjBkD,MAAMlD,OAAO,CAACwD,SAAS,GAAG9D,aAAaG,oBAAoBG,OAAO,EAAEqD,sBAAsBH,MAAMlD,OAAO,CAACwD,SAAS;IACnH;IAEA,IAAIN,MAAMhD,OAAO,EAAE;QACjBgD,MAAMhD,OAAO,CAACsD,SAAS,GAAG9D,aAAaG,oBAAoBK,OAAO,EAAEoD,sBAAsBJ,MAAMhD,OAAO,CAACsD,SAAS;IACnH;IAEA,IAAIN,MAAMjD,OAAO,EAAE;QACjBiD,MAAMjD,OAAO,CAACuD,SAAS,GAAG9D,aAAaG,oBAAoBI,OAAO,EAAEsD,sBAAsBL,MAAMjD,OAAO,CAACuD,SAAS;IACnH;IAEA,OAAON;AACT,EAAE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { renderReferenceList_unstable } from './renderReferenceList';
|
|
3
3
|
import { useReferenceList_unstable } from './useReferenceList';
|
|
4
|
-
import { useReferenceListStyles_unstable } from './useReferenceListStyles';
|
|
4
|
+
import { useReferenceListStyles_unstable } from './useReferenceListStyles.styles';
|
|
5
5
|
import { useReferenceListContextValues_unstable } from './useReferenceListContextValues';
|
|
6
6
|
export const ReferenceList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
7
|
const state = useReferenceList_unstable(props, ref);
|
|
@@ -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":["React","renderReferenceList_unstable","useReferenceList_unstable","useReferenceListStyles_unstable","useReferenceListContextValues_unstable","ReferenceList","forwardRef","props","ref","state","referenceListContextValues","displayName"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,+BAA+B,QAAQ,
|
|
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":["React","renderReferenceList_unstable","useReferenceList_unstable","useReferenceListStyles_unstable","useReferenceListContextValues_unstable","ReferenceList","forwardRef","props","ref","state","referenceListContextValues","displayName"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,+BAA+B,QAAQ,kCAAkC;AAClF,SAASC,sCAAsC,QAAQ,kCAAkC;AAGzF,OAAO,MAAMC,8BAAyDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQP,0BAA0BK,OAAOC;IAC/C,MAAME,6BAA6BN,uCAAuCK;IAE1EN,gCAAgCM;IAEhC,OAAOR,6BAA6BQ,OAAOC;AAC7C,GAAG;AAEHL,cAAcM,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
|
|
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 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":"AA4BA,WAEE"}
|
|
@@ -2,5 +2,5 @@ export * from './ReferenceList';
|
|
|
2
2
|
export * from './ReferenceList.types';
|
|
3
3
|
export * from './renderReferenceList';
|
|
4
4
|
export * from './useReferenceList';
|
|
5
|
-
export * from './useReferenceListStyles';
|
|
5
|
+
export * from './useReferenceListStyles.styles';
|
|
6
6
|
//# 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":"AAAA,cAAc,kBAAkB;AAChC,cAAc,wBAAwB;AACtC,cAAc,wBAAwB;AACtC,cAAc,qBAAqB;AACnC,cAAc,
|
|
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":"AAAA,cAAc,kBAAkB;AAChC,cAAc,wBAAwB;AACtC,cAAc,wBAAwB;AACtC,cAAc,qBAAqB;AACnC,cAAc,kCAAkC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { getIntrinsicElementProps, mergeCallbacks, mergeClasses, slot, useArrowNavigationGroup } from '@fluentui/react-components';
|
|
3
|
-
import { useRootStyles as useReferenceStyles } from '../Reference/useReferenceStyles';
|
|
2
|
+
import { getIntrinsicElementProps, mergeCallbacks, mergeClasses, slot, useArrowNavigationGroup, useMergedRefs } from '@fluentui/react-components';
|
|
3
|
+
import { useRootStyles as useReferenceStyles } from '../Reference/useReferenceStyles.styles';
|
|
4
4
|
/**
|
|
5
5
|
* Create the state required to render ReferenceList.
|
|
6
6
|
*
|
|
@@ -12,7 +12,6 @@ import { useRootStyles as useReferenceStyles } from '../Reference/useReferenceSt
|
|
|
12
12
|
*/
|
|
13
13
|
export const useReferenceList_unstable = (props, ref) => {
|
|
14
14
|
const {
|
|
15
|
-
appearance = 'lighter',
|
|
16
15
|
children,
|
|
17
16
|
maxVisibleReferences,
|
|
18
17
|
showLessButton,
|
|
@@ -20,11 +19,13 @@ export const useReferenceList_unstable = (props, ref) => {
|
|
|
20
19
|
...rest
|
|
21
20
|
} = props;
|
|
22
21
|
const [areReferencesExpanded, setAreReferencesExpanded] = React.useState(false);
|
|
22
|
+
const referenceListRef = React.useRef(null);
|
|
23
23
|
const referenceInOverflowClassName = useReferenceStyles().overflow;
|
|
24
|
+
const childrenArray = React.Children.toArray(children);
|
|
25
|
+
const totalReferencesCount = childrenArray.length;
|
|
24
26
|
const resolvedChildren = React.useMemo(() => {
|
|
25
27
|
if (maxVisibleReferences !== undefined && !areReferencesExpanded) {
|
|
26
28
|
const results = [];
|
|
27
|
-
const childrenArray = React.Children.toArray(children);
|
|
28
29
|
for (let index = 0; index < childrenArray.length; index++) {
|
|
29
30
|
const child = childrenArray[index];
|
|
30
31
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -40,9 +41,7 @@ export const useReferenceList_unstable = (props, ref) => {
|
|
|
40
41
|
return results;
|
|
41
42
|
}
|
|
42
43
|
return children;
|
|
43
|
-
}, [areReferencesExpanded, children, maxVisibleReferences, referenceInOverflowClassName]);
|
|
44
|
-
// We keep track of the previous overflow count to determine element to move focus to when expanding the references via keyboard.
|
|
45
|
-
const previousOverflowCount = React.useRef(0);
|
|
44
|
+
}, [areReferencesExpanded, children, childrenArray, maxVisibleReferences, referenceInOverflowClassName]);
|
|
46
45
|
// We keep track of whether we are interacting with the overflow button via keyboard or not.
|
|
47
46
|
const overflowButtonTriggeredViaKeyboard = React.useRef(false);
|
|
48
47
|
const focusAttributes = useArrowNavigationGroup({
|
|
@@ -58,18 +57,19 @@ export const useReferenceList_unstable = (props, ref) => {
|
|
|
58
57
|
}, []);
|
|
59
58
|
const shouldUseOverflow = maxVisibleReferences !== undefined && !areReferencesExpanded;
|
|
60
59
|
const state = {
|
|
61
|
-
appearance,
|
|
62
60
|
areReferencesExpanded,
|
|
63
61
|
overflowButtonTriggeredViaKeyboard,
|
|
64
|
-
|
|
62
|
+
maxVisibleReferences,
|
|
63
|
+
referenceListRef,
|
|
65
64
|
shouldUseOverflow,
|
|
65
|
+
totalReferencesCount,
|
|
66
66
|
components: {
|
|
67
67
|
root: 'div',
|
|
68
68
|
showMoreButton: 'span',
|
|
69
69
|
showLessButton: 'span'
|
|
70
70
|
},
|
|
71
71
|
root: slot.always(getIntrinsicElementProps('div', {
|
|
72
|
-
ref,
|
|
72
|
+
ref: useMergedRefs(ref, referenceListRef),
|
|
73
73
|
...focusAttributes,
|
|
74
74
|
...rest,
|
|
75
75
|
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 {
|
|
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":["React","getIntrinsicElementProps","mergeCallbacks","mergeClasses","slot","useArrowNavigationGroup","useMergedRefs","useRootStyles","useReferenceStyles","useReferenceList_unstable","props","ref","children","maxVisibleReferences","showLessButton","showMoreButton","rest","areReferencesExpanded","setAreReferencesExpanded","useState","referenceListRef","useRef","referenceInOverflowClassName","overflow","childrenArray","Children","toArray","totalReferencesCount","length","resolvedChildren","useMemo","undefined","results","index","child","isValidElement","push","cloneElement","className","overflowButtonTriggeredViaKeyboard","focusAttributes","axis","circular","memorizeCurrent","onShowMoreButtonClick","useCallback","onShowLessButtonClick","shouldUseOverflow","state","components","root","always","elementType","optional","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,wBAAwB,EACxBC,cAAc,EACdC,YAAY,EACZC,IAAI,EACJC,uBAAuB,EACvBC,aAAa,QACR,6BAA6B;AAEpC,SAASC,iBAAiBC,kBAAkB,QAAQ,yCAAyC;AAE7F;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAM,EAAEC,QAAQ,EAAEC,oBAAoB,EAAEC,cAAc,EAAEC,cAAc,EAAE,GAAGC,MAAM,GAAGN;IAEpF,MAAM,CAACO,uBAAuBC,yBAAyB,GAAGlB,MAAMmB,QAAQ,CAAC;IACzE,MAAMC,mBAAmBpB,MAAMqB,MAAM,CAAiB;IAEtD,MAAMC,+BAA+Bd,qBAAqBe,QAAQ;IAElE,MAAMC,gBAAgBxB,MAAMyB,QAAQ,CAACC,OAAO,CAACd;IAC7C,MAAMe,uBAAuBH,cAAcI,MAAM;IACjD,MAAMC,mBAAmB7B,MAAM8B,OAAO,CAAC;QACrC,IAAIjB,yBAAyBkB,aAAa,CAACd,uBAAuB;YAChE,MAAMe,UAAU,EAAE;YAClB,IAAK,IAAIC,QAAQ,GAAGA,QAAQT,cAAcI,MAAM,EAAEK,QAAS;gBACzD,MAAMC,QAAQV,aAAa,CAACS,MAAM;gBAClC,8DAA8D;gBAC9D,IAAIA,SAASpB,wBAAwBb,MAAMmC,cAAc,CAAMD,QAAQ;oBACrEF,QAAQI,IAAI,CACVpC,MAAMqC,YAAY,CAACH,OAAO;wBACxB,GAAGA,MAAMxB,KAAK;wBACd4B,WAAWnC,aAAa+B,MAAMxB,KAAK,CAAC4B,SAAS,EAAEhB;oBACjD;gBAEJ,OAAO;oBACLU,QAAQI,IAAI,CAACF;gBACf;YACF;YACA,OAAOF;QACT;QACA,OAAOpB;IACT,GAAG;QAACK;QAAuBL;QAAUY;QAAeX;QAAsBS;KAA6B;IAEvG,4FAA4F;IAC5F,MAAMiB,qCAAqCvC,MAAMqB,MAAM,CAAC;IAExD,MAAMmB,kBAAkBnC,wBAAwB;QAC9CoC,MAAM;QACNC,UAAU;QACVC,iBAAiB;IACnB;IAEA,MAAMC,wBAAwB5C,MAAM6C,WAAW,CAA6C;QAC1F3B,yBAAyB;IAC3B,GAAG,EAAE;IAEL,MAAM4B,wBAAwB9C,MAAM6C,WAAW,CAA6C;QAC1F3B,yBAAyB;IAC3B,GAAG,EAAE;IAEL,MAAM6B,oBAAoBlC,yBAAyBkB,aAAa,CAACd;IAEjE,MAAM+B,QAA4B;QAChC/B;QACAsB;QACA1B;QACAO;QACA2B;QACApB;QAEAsB,YAAY;YACVC,MAAM;YACNnC,gBAAgB;YAChBD,gBAAgB;QAClB;QACAoC,MAAM9C,KAAK+C,MAAM,CACflD,yBAAyB,OAAO;YAC9BU,KAAKL,cAAcK,KAAKS;YACxB,GAAGoB,eAAe;YAClB,GAAGxB,IAAI;YACPJ,UAAUiB;QACZ,IACA;YAAEuB,aAAa;QAAM;QAEvBrC,gBAAgBgC,oBAAoB3C,KAAKiD,QAAQ,CAACtC,gBAAgB;YAAEqC,aAAa;QAAO,KAAKrB;QAC7FjB,gBAAgBG,wBAAwBb,KAAKiD,QAAQ,CAACvC,gBAAgB;YAAEsC,aAAa;QAAO,KAAKrB;IACnG;IAEA,IAAIiB,MAAMjC,cAAc,EAAE;QACxBiC,MAAMjC,cAAc,CAACuC,OAAO,GAAGpD,eAAe0C,uBAAuBI,MAAMjC,cAAc,CAACuC,OAAO;IACnG;IAEA,IAAIN,MAAMlC,cAAc,EAAE;QACxBkC,MAAMlC,cAAc,CAACwC,OAAO,GAAGpD,eAAe4C,uBAAuBE,MAAMlC,cAAc,CAACwC,OAAO;IACnG;IAEA,OAAON;AACT,EAAE"}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
export function useReferenceListContextValues_unstable(state) {
|
|
2
2
|
const {
|
|
3
|
-
appearance,
|
|
4
3
|
areReferencesExpanded,
|
|
4
|
+
maxVisibleReferences,
|
|
5
5
|
overflowButtonTriggeredViaKeyboard,
|
|
6
|
-
|
|
7
|
-
shouldUseOverflow
|
|
6
|
+
referenceListRef,
|
|
7
|
+
shouldUseOverflow,
|
|
8
|
+
totalReferencesCount
|
|
8
9
|
} = state;
|
|
9
10
|
// This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
|
|
10
11
|
const referenceList = {
|
|
11
|
-
appearance,
|
|
12
12
|
areReferencesExpanded,
|
|
13
|
+
maxVisibleReferences,
|
|
13
14
|
overflowButtonTriggeredViaKeyboard,
|
|
14
|
-
|
|
15
|
-
shouldUseOverflow
|
|
15
|
+
referenceListRef,
|
|
16
|
+
shouldUseOverflow,
|
|
17
|
+
totalReferencesCount
|
|
16
18
|
};
|
|
17
19
|
return {
|
|
18
20
|
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
|
|
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","overflowButtonTriggeredViaKeyboard","referenceListRef","shouldUseOverflow","totalReferencesCount","referenceList"],"rangeMappings":";;;;;;;;;;;;;;","mappings":"AAEA,OAAO,SAASA,uCAAuCC,KAAyB;IAC9E,MAAM,EACJC,qBAAqB,EACrBC,oBAAoB,EACpBC,kCAAkC,EAClCC,gBAAgB,EAChBC,iBAAiB,EACjBC,oBAAoB,EACrB,GAAGN;IAEJ,mGAAmG;IACnG,MAAMO,gBAAgB;QACpBN;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,OAAO;QAAEC;IAAc;AACzB"}
|
|
@@ -20,6 +20,8 @@ const useOverflowButtonBaseClassName = __resetStyles("r6su6fj", null, [".r6su6fj
|
|
|
20
20
|
* Apply styling to the ReferenceList slots based on the state
|
|
21
21
|
*/
|
|
22
22
|
export const useReferenceListStyles_unstable = state => {
|
|
23
|
+
'use no memo';
|
|
24
|
+
|
|
23
25
|
const {
|
|
24
26
|
areReferencesExpanded,
|
|
25
27
|
shouldUseOverflow
|
|
@@ -36,4 +38,4 @@ export const useReferenceListStyles_unstable = state => {
|
|
|
36
38
|
}
|
|
37
39
|
return state;
|
|
38
40
|
};
|
|
39
|
-
//# sourceMappingURL=useReferenceListStyles.js.map
|
|
41
|
+
//# 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":["makeResetStyles","makeStyles","mergeClasses","tokens","referenceListClassNames","root","showMoreButton","showLessButton","useRootBaseClassName","display","flexDirection","gap","spacingVerticalXS","spacingHorizontalXS","useRootStyles","referencesExpanded","flexWrap","useOverflowButtonBaseClassName","flexShrink","useReferenceListStyles_unstable","state","areReferencesExpanded","shouldUseOverflow","rootBaseClassName","rootStyles","overflowButtonBaseClassName","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,EAAEC,MAAM,QAAQ,6BAA6B;AAI/F,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,gBAAgB;IAChBC,gBAAgB;AAClB,EAAE;AAEF;;CAEC,GACD,MAAMC,uBAAuBR,gBAAgB;IAC3CS,SAAS;IACTC,eAAe;IACfC,KAAK,CAAC,EAAER,OAAOS,iBAAiB,CAAC,CAAC,EAAET,OAAOU,mBAAmB,CAAC,CAAC;AAClE;AAEA,MAAMC,gBAAgBb,WAAW;IAC/Bc,oBAAoB;QAClBC,UAAU;IACZ;AACF;AAEA,MAAMC,iCAAiCjB,gBAAgB;IACrDkB,YAAY;AACd;AAEA;;CAEC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9C;IAEA,MAAM,EAAEC,qBAAqB,EAAEC,iBAAiB,EAAE,GAAGF;IAErD,MAAMG,oBAAoBf;IAC1B,MAAMgB,aAAaV;IACnB,MAAMW,8BAA8BR;IAEpCG,MAAMf,IAAI,CAACqB,SAAS,GAAGxB,aACrBE,wBAAwBC,IAAI,EAC5BkB,mBACA,AAACF,CAAAA,yBAAyB,CAACC,iBAAgB,KAAME,WAAWT,kBAAkB,EAC9EK,MAAMf,IAAI,CAACqB,SAAS;IAGtB,IAAIN,MAAMd,cAAc,EAAE;QACxBc,MAAMd,cAAc,CAACoB,SAAS,GAAGxB,aAC/BE,wBAAwBE,cAAc,EACtCmB,6BACAL,MAAMd,cAAc,CAACoB,SAAS;IAElC;IAEA,IAAIN,MAAMb,cAAc,EAAE;QACxBa,MAAMb,cAAc,CAACmB,SAAS,GAAGxB,aAC/BE,wBAAwBG,cAAc,EACtCkB,6BACAL,MAAMb,cAAc,CAACmB,SAAS;IAElC;IAEA,OAAON;AACT,EAAE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useReferenceOverflowButton_unstable } from './useReferenceOverflowButton';
|
|
3
3
|
import { renderReferenceOverflowButton_unstable } from './renderReferenceOverflowButton';
|
|
4
|
-
import { useReferenceOverflowButtonStyles_unstable } from './useReferenceOverflowButtonStyles';
|
|
4
|
+
import { useReferenceOverflowButtonStyles_unstable } from './useReferenceOverflowButtonStyles.styles';
|
|
5
5
|
// ReferenceOverflowButton component - TODO: add more docs
|
|
6
6
|
export const ReferenceOverflowButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
7
|
const state = useReferenceOverflowButton_unstable(props, ref);
|
|
@@ -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":["React","useReferenceOverflowButton_unstable","renderReferenceOverflowButton_unstable","useReferenceOverflowButtonStyles_unstable","ReferenceOverflowButton","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mCAAmC,QAAQ,+BAA+B;AACnF,SAASC,sCAAsC,QAAQ,kCAAkC;AACzF,SAASC,yCAAyC,QAAQ,
|
|
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":["React","useReferenceOverflowButton_unstable","renderReferenceOverflowButton_unstable","useReferenceOverflowButtonStyles_unstable","ReferenceOverflowButton","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mCAAmC,QAAQ,+BAA+B;AACnF,SAASC,sCAAsC,QAAQ,kCAAkC;AACzF,SAASC,yCAAyC,QAAQ,4CAA4C;AAItG,0DAA0D;AAC1D,OAAO,MAAMC,wCAA6EJ,MAAMK,UAAU,CACxG,CAACC,OAAOC;IACN,MAAMC,QAAQP,oCAAoCK,OAAOC;IAEzDJ,0CAA0CK;IAC1C,OAAON,uCAAuCM;AAChD,GACA;AAEFJ,wBAAwBK,WAAW,GAAG"}
|
package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map
CHANGED
|
@@ -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
|
|
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 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":"AAaA;;CAEC,GACD,WAEE"}
|
|
@@ -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,
|
|
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"}
|