@fluentui-copilot/react-reference 0.0.0-nightly-20251010-0406-7df7c6d1.1 → 0.0.0-nightly-20251014-0405-d8d3e89c.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +54 -3
- package/CHANGELOG.md +19 -4
- package/dist/index.d.ts +382 -0
- package/lib/Citation.js +1 -0
- package/lib/Citation.js.map +1 -0
- package/lib/Reference.js +1 -0
- package/lib/Reference.js.map +1 -0
- package/lib/ReferenceList.js +1 -0
- package/lib/ReferenceList.js.map +1 -0
- package/lib/ReferenceOverflowButton.js +1 -0
- package/lib/ReferenceOverflowButton.js.map +1 -0
- package/lib/components/Citation/Citation.js +13 -0
- package/lib/components/Citation/Citation.js.map +1 -0
- package/lib/components/Citation/Citation.types.js +3 -0
- package/lib/components/Citation/Citation.types.js.map +1 -0
- package/lib/components/Citation/index.js +4 -0
- package/lib/components/Citation/index.js.map +1 -0
- package/lib/components/Citation/renderCitation.js +8 -0
- package/lib/components/Citation/renderCitation.js.map +1 -0
- package/lib/components/Citation/useCitation.js +34 -0
- package/lib/components/Citation/useCitation.js.map +1 -0
- package/lib/components/Citation/useCitationStyles.styles.js +59 -0
- package/lib/components/Citation/useCitationStyles.styles.js.map +1 -0
- package/lib/components/Citation/useCitationStyles.styles.raw.js +69 -0
- package/lib/components/Citation/useCitationStyles.styles.raw.js.map +1 -0
- package/lib/components/Reference/Reference.js +10 -0
- package/lib/components/Reference/Reference.js.map +1 -0
- package/lib/components/Reference/Reference.types.js +1 -0
- package/lib/components/Reference/Reference.types.js.map +1 -0
- package/lib/components/Reference/index.js +4 -0
- package/lib/components/Reference/index.js.map +1 -0
- package/lib/components/Reference/renderReference.js +22 -0
- package/lib/components/Reference/renderReference.js.map +1 -0
- package/lib/components/Reference/useReference.js +71 -0
- package/lib/components/Reference/useReference.js.map +1 -0
- package/lib/components/Reference/useReferenceStyles.styles.js +70 -0
- package/lib/components/Reference/useReferenceStyles.styles.js.map +1 -0
- package/lib/components/Reference/useReferenceStyles.styles.raw.js +110 -0
- package/lib/components/Reference/useReferenceStyles.styles.raw.js.map +1 -0
- package/lib/components/ReferenceList/ReferenceList.js +12 -0
- package/lib/components/ReferenceList/ReferenceList.js.map +1 -0
- package/lib/components/ReferenceList/ReferenceList.types.js +1 -0
- package/lib/components/ReferenceList/ReferenceList.types.js.map +1 -0
- package/lib/components/ReferenceList/index.js +4 -0
- package/lib/components/ReferenceList/index.js.map +1 -0
- package/lib/components/ReferenceList/renderReferenceList.js +22 -0
- package/lib/components/ReferenceList/renderReferenceList.js.map +1 -0
- package/lib/components/ReferenceList/useReferenceList.js +83 -0
- package/lib/components/ReferenceList/useReferenceList.js.map +1 -0
- package/lib/components/ReferenceList/useReferenceListContextValues.js +15 -0
- package/lib/components/ReferenceList/useReferenceListContextValues.js.map +1 -0
- package/lib/components/ReferenceList/useReferenceListStyles.styles.js +46 -0
- package/lib/components/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
- package/lib/components/ReferenceList/useReferenceListStyles.styles.raw.js +47 -0
- package/lib/components/ReferenceList/useReferenceListStyles.styles.raw.js.map +1 -0
- package/lib/components/ReferenceOverflowButton/ReferenceOverflowButton.js +11 -0
- package/lib/components/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -0
- package/lib/components/ReferenceOverflowButton/ReferenceOverflowButton.types.js +3 -0
- package/lib/components/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map +1 -0
- package/lib/components/ReferenceOverflowButton/index.js +4 -0
- package/lib/components/ReferenceOverflowButton/index.js.map +1 -0
- package/lib/components/ReferenceOverflowButton/renderReferenceOverflowButton.js +13 -0
- package/lib/components/ReferenceOverflowButton/renderReferenceOverflowButton.js.map +1 -0
- package/lib/components/ReferenceOverflowButton/useReferenceOverflowButton.js +93 -0
- package/lib/components/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -0
- package/lib/components/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js +37 -0
- package/lib/components/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js.map +1 -0
- package/lib/components/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js +45 -0
- package/lib/components/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js.map +1 -0
- package/lib/contexts/index.js +1 -0
- package/lib/contexts/index.js.map +1 -0
- package/lib/contexts/referenceListContext.js +16 -0
- package/lib/contexts/referenceListContext.js.map +1 -0
- package/lib/index.js +21 -0
- package/lib/index.js.map +1 -0
- package/lib/utilities/generateReferenceCitationPreview.js +103 -0
- package/lib/utilities/generateReferenceCitationPreview.js.map +1 -0
- package/lib/utilities/index.js +2 -0
- package/lib/utilities/index.js.map +1 -0
- package/lib/utilities/useReferenceCitationPreview.js +18 -0
- package/lib/utilities/useReferenceCitationPreview.js.map +1 -0
- package/lib-commonjs/Citation.js +28 -0
- package/lib-commonjs/Citation.js.map +1 -0
- package/lib-commonjs/Reference.js +31 -0
- package/lib-commonjs/Reference.js.map +1 -0
- package/lib-commonjs/ReferenceList.js +28 -0
- package/lib-commonjs/ReferenceList.js.map +1 -0
- package/lib-commonjs/ReferenceOverflowButton.js +28 -0
- package/lib-commonjs/ReferenceOverflowButton.js.map +1 -0
- package/lib-commonjs/components/Citation/Citation.js +23 -0
- package/lib-commonjs/components/Citation/Citation.js.map +1 -0
- package/lib-commonjs/components/Citation/Citation.types.js +6 -0
- package/lib-commonjs/components/Citation/Citation.types.js.map +1 -0
- package/lib-commonjs/components/Citation/index.js +31 -0
- package/lib-commonjs/components/Citation/index.js.map +1 -0
- package/lib-commonjs/components/Citation/renderCitation.js +16 -0
- package/lib-commonjs/components/Citation/renderCitation.js.map +1 -0
- package/lib-commonjs/components/Citation/useCitation.js +36 -0
- package/lib-commonjs/components/Citation/useCitation.js.map +1 -0
- package/lib-commonjs/components/Citation/useCitationStyles.styles.js +116 -0
- package/lib-commonjs/components/Citation/useCitationStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Citation/useCitationStyles.styles.raw.js +85 -0
- package/lib-commonjs/components/Citation/useCitationStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/Reference/Reference.js +21 -0
- package/lib-commonjs/components/Reference/Reference.js.map +1 -0
- package/lib-commonjs/components/Reference/Reference.types.js +4 -0
- package/lib-commonjs/components/Reference/Reference.types.js.map +1 -0
- package/lib-commonjs/components/Reference/index.js +34 -0
- package/lib-commonjs/components/Reference/index.js.map +1 -0
- package/lib-commonjs/components/Reference/renderReference.js +32 -0
- package/lib-commonjs/components/Reference/renderReference.js.map +1 -0
- package/lib-commonjs/components/Reference/useReference.js +73 -0
- package/lib-commonjs/components/Reference/useReference.js.map +1 -0
- package/lib-commonjs/components/Reference/useReferenceStyles.styles.js +109 -0
- package/lib-commonjs/components/Reference/useReferenceStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Reference/useReferenceStyles.styles.raw.js +132 -0
- package/lib-commonjs/components/Reference/useReferenceStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.js +23 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.types.js +4 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.types.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/index.js +31 -0
- package/lib-commonjs/components/ReferenceList/index.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/renderReferenceList.js +30 -0
- package/lib-commonjs/components/ReferenceList/renderReferenceList.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/useReferenceList.js +86 -0
- package/lib-commonjs/components/ReferenceList/useReferenceList.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListContextValues.js +25 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListContextValues.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.js +62 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.raw.js +63 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/ReferenceOverflowButton/ReferenceOverflowButton.js +21 -0
- package/lib-commonjs/components/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -0
- package/lib-commonjs/components/ReferenceOverflowButton/ReferenceOverflowButton.types.js +6 -0
- package/lib-commonjs/components/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map +1 -0
- package/lib-commonjs/components/ReferenceOverflowButton/index.js +31 -0
- package/lib-commonjs/components/ReferenceOverflowButton/index.js.map +1 -0
- package/lib-commonjs/components/ReferenceOverflowButton/renderReferenceOverflowButton.js +21 -0
- package/lib-commonjs/components/ReferenceOverflowButton/renderReferenceOverflowButton.js.map +1 -0
- package/lib-commonjs/components/ReferenceOverflowButton/useReferenceOverflowButton.js +96 -0
- package/lib-commonjs/components/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -0
- package/lib-commonjs/components/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js +55 -0
- package/lib-commonjs/components/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js +61 -0
- package/lib-commonjs/components/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/contexts/index.js +22 -0
- package/lib-commonjs/contexts/index.js.map +1 -0
- package/lib-commonjs/contexts/referenceListContext.js +37 -0
- package/lib-commonjs/contexts/referenceListContext.js.map +1 -0
- package/lib-commonjs/index.js +144 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/utilities/generateReferenceCitationPreview.js +103 -0
- package/lib-commonjs/utilities/generateReferenceCitationPreview.js.map +1 -0
- package/lib-commonjs/utilities/index.js +20 -0
- package/lib-commonjs/utilities/index.js.map +1 -0
- package/lib-commonjs/utilities/useReferenceCitationPreview.js +18 -0
- package/lib-commonjs/utilities/useReferenceCitationPreview.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
citationClassNames: function() {
|
|
13
|
+
return citationClassNames;
|
|
14
|
+
},
|
|
15
|
+
useCitationStyles_unstable: function() {
|
|
16
|
+
return useCitationStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _tokens = require("@fluentui-copilot/tokens");
|
|
21
|
+
const citationClassNames = {
|
|
22
|
+
root: 'fai-Citation'
|
|
23
|
+
};
|
|
24
|
+
const useCitationBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
25
|
+
display: 'inline-flex',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
boxSizing: 'border-box',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
cursor: 'pointer',
|
|
30
|
+
..._tokens.typographyStyles.caption2Strong,
|
|
31
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3,
|
|
32
|
+
border: `${_tokens.tokens.strokeWidthThin} solid ${_tokens.tokens.colorNeutralStroke2}`,
|
|
33
|
+
color: _tokens.tokens.colorNeutralForeground2,
|
|
34
|
+
minWidth: '14px',
|
|
35
|
+
height: '14px',
|
|
36
|
+
verticalAlign: `calc((${_tokens.typographyStyles.caption2Strong.lineHeight} - ${_tokens.typographyStyles.caption2Strong.fontSize}) / 2)`,
|
|
37
|
+
paddingInline: _tokens.tokens.spacingHorizontalXXS,
|
|
38
|
+
borderRadius: _tokens.tokens.borderRadiusMedium,
|
|
39
|
+
textDecoration: 'none',
|
|
40
|
+
marginLeft: _tokens.tokens.spacingHorizontalXXS,
|
|
41
|
+
marginRight: _tokens.tokens.spacingHorizontalXXS,
|
|
42
|
+
':hover': {
|
|
43
|
+
cursor: 'pointer',
|
|
44
|
+
color: _tokens.tokens.colorBrandForeground2Hover,
|
|
45
|
+
borderColor: _tokens.tokens.colorBrandStroke2Hover,
|
|
46
|
+
backgroundColor: _tokens.tokens.colorBrandBackground2Hover
|
|
47
|
+
},
|
|
48
|
+
':hover:active': {
|
|
49
|
+
cursor: 'pointer',
|
|
50
|
+
color: _tokens.tokens.colorBrandForeground2Pressed,
|
|
51
|
+
borderColor: _tokens.tokens.colorBrandStroke2Pressed,
|
|
52
|
+
backgroundColor: _tokens.tokens.colorBrandBackground2Pressed
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const useCitationRootStyles = (0, _reactcomponents.makeStyles)({
|
|
56
|
+
isBlock: {
|
|
57
|
+
display: 'flex',
|
|
58
|
+
marginLeft: 0,
|
|
59
|
+
marginRight: 0
|
|
60
|
+
},
|
|
61
|
+
isPopoverLocked: {
|
|
62
|
+
color: _tokens.tokens.colorBrandForeground2Pressed,
|
|
63
|
+
..._reactcomponents.shorthands.borderColor(_tokens.tokens.colorBrandStroke2Pressed),
|
|
64
|
+
backgroundColor: _tokens.tokens.colorBrandBackground2,
|
|
65
|
+
':hover': {
|
|
66
|
+
color: _tokens.tokens.colorBrandForeground2Pressed,
|
|
67
|
+
..._reactcomponents.shorthands.borderColor(_tokens.tokens.colorBrandStroke2Pressed),
|
|
68
|
+
backgroundColor: _tokens.tokens.colorBrandBackground2
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const useNextStyles = (0, _reactcomponents.makeStyles)({
|
|
73
|
+
root: {
|
|
74
|
+
borderRadius: _tokens.tokens.borderRadiusXLarge
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const useCitationStyles_unstable = (state)=>{
|
|
78
|
+
'use no memo';
|
|
79
|
+
const { designVersion } = state;
|
|
80
|
+
const rootBaseClassName = useCitationBaseClassName();
|
|
81
|
+
const rootStyles = useCitationRootStyles();
|
|
82
|
+
const nextStyles = useNextStyles();
|
|
83
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(citationClassNames.root, state.isPopoverLocked && rootStyles.isPopoverLocked, state.block && rootStyles.isBlock, rootBaseClassName, designVersion === 'next' && nextStyles.root, state.root.className);
|
|
84
|
+
return state;
|
|
85
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useCitationStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\nimport type { CitationSlots, CitationState } from './Citation.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const citationClassNames: SlotClassNames<CitationSlots> = {\n root: 'fai-Citation',\n};\n\nconst useCitationBaseClassName = makeResetStyles({\n display: 'inline-flex',\n justifyContent: 'center',\n boxSizing: 'border-box',\n alignItems: 'center',\n cursor: 'pointer',\n ...typographyStyles.caption2Strong,\n\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,\n color: tokens.colorNeutralForeground2,\n\n minWidth: '14px',\n height: '14px',\n verticalAlign: `calc((${typographyStyles.caption2Strong.lineHeight} - ${typographyStyles.caption2Strong.fontSize}) / 2)`,\n paddingInline: tokens.spacingHorizontalXXS,\n\n borderRadius: tokens.borderRadiusMedium,\n\n textDecoration: 'none',\n\n marginLeft: tokens.spacingHorizontalXXS,\n marginRight: tokens.spacingHorizontalXXS,\n\n ':hover': {\n cursor: 'pointer',\n color: tokens.colorBrandForeground2Hover,\n borderColor: tokens.colorBrandStroke2Hover,\n backgroundColor: tokens.colorBrandBackground2Hover,\n },\n\n ':hover:active': {\n cursor: 'pointer',\n color: tokens.colorBrandForeground2Pressed,\n borderColor: tokens.colorBrandStroke2Pressed,\n backgroundColor: tokens.colorBrandBackground2Pressed,\n },\n});\n\nconst useCitationRootStyles = makeStyles({\n isBlock: {\n display: 'flex',\n marginLeft: 0,\n marginRight: 0,\n },\n isPopoverLocked: {\n color: tokens.colorBrandForeground2Pressed,\n ...shorthands.borderColor(tokens.colorBrandStroke2Pressed),\n backgroundColor: tokens.colorBrandBackground2,\n ':hover': {\n color: tokens.colorBrandForeground2Pressed,\n ...shorthands.borderColor(tokens.colorBrandStroke2Pressed),\n backgroundColor: tokens.colorBrandBackground2,\n },\n },\n});\n\nconst useNextStyles = makeStyles({ root: { borderRadius: tokens.borderRadiusXLarge } });\n\n/**\n * Apply styling to the Citation slots based on the state\n */\nexport const useCitationStyles_unstable = (state: CitationState): CitationState => {\n 'use no memo';\n\n const { designVersion } = state;\n\n const rootBaseClassName = useCitationBaseClassName();\n const rootStyles = useCitationRootStyles();\n const nextStyles = useNextStyles();\n\n state.root.className = mergeClasses(\n citationClassNames.root,\n state.isPopoverLocked && rootStyles.isPopoverLocked,\n state.block && rootStyles.isBlock,\n rootBaseClassName,\n designVersion === 'next' && nextStyles.root,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["citationClassNames","useCitationStyles_unstable","root","useCitationBaseClassName","makeResetStyles","display","justifyContent","boxSizing","alignItems","cursor","typographyStyles","caption2Strong","backgroundColor","tokens","colorNeutralBackground3","border","strokeWidthThin","colorNeutralStroke2","color","colorNeutralForeground2","minWidth","height","verticalAlign","lineHeight","fontSize","paddingInline","spacingHorizontalXXS","borderRadius","borderRadiusMedium","textDecoration","marginLeft","marginRight","colorBrandForeground2Hover","borderColor","colorBrandStroke2Hover","colorBrandBackground2Hover","colorBrandForeground2Pressed","colorBrandStroke2Pressed","colorBrandBackground2Pressed","useCitationRootStyles","makeStyles","isBlock","isPopoverLocked","shorthands","colorBrandBackground2","useNextStyles","borderRadiusXLarge","state","designVersion","rootBaseClassName","rootStyles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ACtD;AACF;AAEA,MAAMC,wBAAwBC,IAAAA,2BAAAA,EAAW;IACvCC,SAAS;QACPpC,SAAS;QACTyB,YAAY;QACZC,aAAa;IACf;IACAW,iBAAiB;QACfxB,OAAOL,cAAAA,CAAOuB,4BAA4B;QAC1C,GAAGO,2BAAAA,CAAWV,WAAW,CAACpB,cAAAA,CAAOwB,wBAAwB,CAAC;QAC1DzB,iBAAiBC,cAAAA,CAAO+B,qBAAqB;QAC7C,UAAU;YACR1B,OAAOL,cAAAA,CAAOuB,4BAA4B;YAC1C,GAAGO,2BAAAA,CAAWV,WAAW,CAACpB,cAAAA,CAAOwB,wBAAwB,CAAC;YAC1DzB,iBAAiBC,cAAAA,CAAO+B,qBAAqB;QAC/C;IACF;AACF;AAEA,MAAMC,gBAAgBL,IAAAA,2BAAAA,EAAW;IAAEtC,MAAM;QAAEyB,cAAcd,cAAAA,CAAOiC,kBAAkB;IAAC;AAAE;AAK9E,MAAM7C,6BAA6B,CAAC8C;IACzC;IAEA,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAE1B,MAAME,oBAAoB9C;IAC1B,MAAM+C,aAAaX;IACnB,MAAMY,aAAaN;IAEnBE,MAAM7C,IAAI,CAACkD,SAAS,GAAGC,IAAAA,6BAAAA,EACrBrD,mBAAmBE,IAAI,EACvB6C,MAAML,eAAe,IAAIQ,WAAWR,eAAe,EACnDK,MAAMO,KAAK,IAAIJ,WAAWT,OAAO,EACjCQ,mBACAD,kBAAkB,UAAUG,WAAWjD,IAAI,EAC3C6C,MAAM7C,IAAI,CAACkD,SAAS;IAGtB,OAAOL;AACT"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Reference", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return Reference;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useReference = require("./useReference");
|
|
14
|
+
const _renderReference = require("./renderReference");
|
|
15
|
+
const _useReferenceStylesstyles = require("./useReferenceStyles.styles");
|
|
16
|
+
const Reference = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
17
|
+
const state = (0, _useReference.useReference_unstable)(props, ref);
|
|
18
|
+
(0, _useReferenceStylesstyles.useReferenceStyles_unstable)(state);
|
|
19
|
+
return (0, _renderReference.renderReference_unstable)(state);
|
|
20
|
+
});
|
|
21
|
+
Reference.displayName = 'Reference';
|
|
@@ -0,0 +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.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","ref","state","useReference_unstable","useReferenceStyles_unstable","renderReference_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAOaA;;;eAAAA;;;;iEAPU;8BACe;iCACG;0CACG;AAIrC,MAAMA,YAAAA,WAAAA,GAAiDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQC,IAAAA,mCAAAA,EAAsBH,OAAOC;IAE3CG,IAAAA,qDAAAA,EAA4BF;IAC5B,OAAOG,IAAAA,yCAAAA,EAAyBH;AAClC;AAEAL,UAAUS,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Reference.types.ts"],"sourcesContent":["import type { DesignVersion } from '@fluentui-copilot/react-provider';\nimport 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>> & DesignVersion & {};\n\nexport type ReferenceState = ComponentState<ReferenceSlots> &\n Required<Pick<ReferenceProps, 'id' | 'designVersion'>> &\n Pick<ReferenceListState, 'shouldUseOverflow'>;\n"],"names":[],"rangeMappings":"","mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
Reference: function() {
|
|
13
|
+
return _Reference.Reference;
|
|
14
|
+
},
|
|
15
|
+
referenceClassNames: function() {
|
|
16
|
+
return _useReferenceStylesstyles.referenceClassNames;
|
|
17
|
+
},
|
|
18
|
+
referenceExtraClassNames: function() {
|
|
19
|
+
return _useReferenceStylesstyles.referenceExtraClassNames;
|
|
20
|
+
},
|
|
21
|
+
renderReference_unstable: function() {
|
|
22
|
+
return _renderReference.renderReference_unstable;
|
|
23
|
+
},
|
|
24
|
+
useReferenceStyles_unstable: function() {
|
|
25
|
+
return _useReferenceStylesstyles.useReferenceStyles_unstable;
|
|
26
|
+
},
|
|
27
|
+
useReference_unstable: function() {
|
|
28
|
+
return _useReference.useReference_unstable;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _Reference = require("./Reference");
|
|
32
|
+
const _renderReference = require("./renderReference");
|
|
33
|
+
const _useReference = require("./useReference");
|
|
34
|
+
const _useReferenceStylesstyles = require("./useReferenceStyles.styles");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { Reference } from './Reference';\nexport type { ReferenceProps, ReferenceSlots, ReferenceState } from './Reference.types';\nexport { renderReference_unstable } from './renderReference';\nexport { useReference_unstable } from './useReference';\nexport {\n referenceClassNames,\n referenceExtraClassNames,\n useReferenceStyles_unstable,\n} from './useReferenceStyles.styles';\n"],"names":["Reference","referenceClassNames","referenceExtraClassNames","renderReference_unstable","useReferenceStyles_unstable","useReference_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,SAAS;eAATA,oBAAS;;IAKhBC,mBAAmB;eAAnBA,6CAAmB;;IACnBC,wBAAwB;eAAxBA,kDAAwB;;IAJjBC,wBAAwB;eAAxBA,yCAAwB;;IAK/BC,2BAA2B;eAA3BA,qDAA2B;;IAJpBC,qBAAqB;eAArBA,mCAAqB;;;2BAHJ;iCAEe;8BACH;0CAK/B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderReference_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderReference_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
13
|
+
const renderReference_unstable = (state)=>{
|
|
14
|
+
(0, _reactcomponents.assertSlots)(state);
|
|
15
|
+
const { id, shouldUseOverflow } = state;
|
|
16
|
+
const reference = /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
17
|
+
children: [
|
|
18
|
+
state.citation && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.citation, {}),
|
|
19
|
+
state.divider && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.divider, {}),
|
|
20
|
+
state.content && /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.content, {
|
|
21
|
+
children: [
|
|
22
|
+
state.graphic && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.graphic, {}),
|
|
23
|
+
state.root.children
|
|
24
|
+
]
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
return shouldUseOverflow ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.OverflowItem, {
|
|
29
|
+
id: id,
|
|
30
|
+
children: reference
|
|
31
|
+
}, id) : reference;
|
|
32
|
+
};
|
|
@@ -0,0 +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';\nimport type { JSXElement } from '@fluentui/react-components';\n\nexport const renderReference_unstable = (state: ReferenceState): JSXElement => {\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","shouldUseOverflow","reference","_jsxs","root","citation","_jsx","divider","content","graphic","children","OverflowItem"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAOaA;;;eAAAA;;;4BANb;iCAE0C;AAInC,MAAMA,2BAA2B,CAACC;IACvCC,IAAAA,4BAAAA,EAA4BD;IAE5B,MAAM,EAAEE,EAAE,EAAEC,iBAAiB,EAAE,GAAGH;IAElC,MAAMI,YAAAA,WAAAA,GACJC,IAAAA,gBAAA,EAACL,MAAMM,IAAI,EAAA;;YACRN,MAAMO,QAAQ,IAAA,WAAA,GAAIC,IAAAA,eAAA,EAACR,MAAMO,QAAQ,EAAA,CAAA;YACjCP,MAAMS,OAAO,IAAA,WAAA,GAAID,IAAAA,eAAA,EAACR,MAAMS,OAAO,EAAA,CAAA;YAC/BT,MAAMU,OAAO,IAAA,WAAA,GACZL,IAAAA,gBAAA,EAACL,MAAMU,OAAO,EAAA;;oBACXV,MAAMW,OAAO,IAAA,WAAA,GAAIH,IAAAA,eAAA,EAACR,MAAMW,OAAO,EAAA,CAAA;oBAC/BX,MAAMM,IAAI,CAACM,QAAQ;;;;;IAM5B,OAAOT,oBAAAA,WAAAA,GACLK,IAAAA,eAAA,EAACK,6BAAAA,EAAAA;QAAsBX,IAAIA;kBACxBE;OADgBF,MAInBE;AAEJ"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useReference_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useReference_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
+
const _referenceListContext = require("../../contexts/referenceListContext");
|
|
15
|
+
const _useReferenceStylesstyles = require("./useReferenceStyles.styles");
|
|
16
|
+
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
17
|
+
const useReference_unstable = (props, ref)=>{
|
|
18
|
+
const { as, children, id } = props;
|
|
19
|
+
const designVersion = (0, _reactprovider.useDesignVersion)(props.designVersion);
|
|
20
|
+
const shouldUseOverflow = (0, _referenceListContext.useReferenceListContext_unstable)((ctx)=>ctx.shouldUseOverflow);
|
|
21
|
+
const referenceId = (0, _reactcomponents.useId)('reference-', id);
|
|
22
|
+
const elementType = as || (props.href ? 'a' : 'button');
|
|
23
|
+
const propsWithAssignedAs = {
|
|
24
|
+
type: elementType === 'button' ? 'button' : undefined,
|
|
25
|
+
...props,
|
|
26
|
+
as: elementType,
|
|
27
|
+
id: referenceId
|
|
28
|
+
};
|
|
29
|
+
const citation = _reactcomponents.slot.optional(props.citation, {
|
|
30
|
+
elementType: 'span'
|
|
31
|
+
});
|
|
32
|
+
const graphic = _reactcomponents.slot.optional(props.graphic, {
|
|
33
|
+
elementType: 'span'
|
|
34
|
+
});
|
|
35
|
+
const content = _reactcomponents.slot.optional(props.content, {
|
|
36
|
+
elementType: 'span',
|
|
37
|
+
renderByDefault: graphic !== undefined || !!children
|
|
38
|
+
});
|
|
39
|
+
const divider = _reactcomponents.slot.optional(props.divider, {
|
|
40
|
+
elementType: 'span',
|
|
41
|
+
renderByDefault: citation !== undefined && content !== undefined
|
|
42
|
+
});
|
|
43
|
+
const state = {
|
|
44
|
+
designVersion,
|
|
45
|
+
id: referenceId,
|
|
46
|
+
shouldUseOverflow,
|
|
47
|
+
components: {
|
|
48
|
+
root: elementType,
|
|
49
|
+
citation: 'span',
|
|
50
|
+
divider: 'span',
|
|
51
|
+
graphic: 'span',
|
|
52
|
+
content: 'span'
|
|
53
|
+
},
|
|
54
|
+
root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)(elementType, {
|
|
55
|
+
ref,
|
|
56
|
+
...propsWithAssignedAs
|
|
57
|
+
}, [
|
|
58
|
+
'content'
|
|
59
|
+
]), {
|
|
60
|
+
elementType
|
|
61
|
+
}),
|
|
62
|
+
citation,
|
|
63
|
+
divider,
|
|
64
|
+
content,
|
|
65
|
+
graphic
|
|
66
|
+
};
|
|
67
|
+
if (state.graphic && /*#__PURE__*/ _react.isValidElement(state.graphic.children)) {
|
|
68
|
+
state.graphic.children = /*#__PURE__*/ _react.cloneElement(state.graphic.children, {
|
|
69
|
+
className: (0, _reactcomponents.mergeClasses)(state.graphic.children.props.className, _useReferenceStylesstyles.referenceExtraClassNames.graphicChild)
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return state;
|
|
73
|
+
};
|
|
@@ -0,0 +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/referenceListContext';\nimport { referenceExtraClassNames } from './useReferenceStyles.styles';\nimport type { ReferenceProps, ReferenceState, ReferenceSlots } from './Reference.types';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport type { JSXIntrinsicElement } from '@fluentui/react-components';\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 designVersion = useDesignVersion(props.designVersion);\n\n const shouldUseOverflow = useReferenceListContext_unstable(ctx => ctx.shouldUseOverflow);\n\n const referenceId = useId('reference-', id);\n\n const elementType = as || ((props as JSXIntrinsicElement<'a'>).href ? 'a' : 'button');\n const propsWithAssignedAs = {\n type: elementType === 'button' ? 'button' : undefined,\n ...props,\n as: elementType,\n id: referenceId,\n };\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 as ReferenceSlots['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 designVersion,\n id: referenceId,\n shouldUseOverflow,\n\n components: {\n root: elementType,\n citation: 'span',\n divider: 'span',\n graphic: 'span',\n content: 'span',\n },\n\n root: slot.always(\n getIntrinsicElementProps(\n elementType,\n {\n ref,\n ...propsWithAssignedAs,\n },\n // `content` is a slot and it's type clashes with the HTMLElement `content` attribute\n ['content'],\n ) as ReferenceSlots['root'],\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":["useReference_unstable","props","ref","as","children","id","designVersion","useDesignVersion","shouldUseOverflow","useReferenceListContext_unstable","ctx","referenceId","useId","elementType","href","propsWithAssignedAs","type","undefined","citation","slot","optional","graphic","content","renderByDefault","divider","state","components","root","always","getIntrinsicElementProps","React","isValidElement","cloneElement","className","mergeClasses","referenceExtraClassNames","graphicChild"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;;iEAhBU;iCAC6C;sCACnB;0CACR;+BAER;AAW1B,MAAMA,wBAAwB,CACnCC,OACAC;IAEA,MAAM,EAAEC,EAAE,EAAEC,QAAQ,EAAEC,EAAE,EAAE,GAAGJ;IAE7B,MAAMK,gBAAgBC,I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AME,YAAY,CAACP,MAAMJ,OAAO,CAACjB,QAAQ,EAAE;YAClE6B,WAAWC,IAAAA,6BAAAA,EAAaT,MAAMJ,OAAO,CAACjB,QAAQ,CAACH,KAAK,CAACgC,SAAS,EAAEE,kDAAAA,CAAyBC,YAAY;QACvG;IACF;IAEA,OAAOX;AACT"}
|
|
@@ -0,0 +1,109 @@
|
|
|
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)("r5aus6y", null, [
|
|
38
|
+
".r5aus6y{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:inline-flex;flex-shrink:0;justify-content:center;max-width:100%;min-height:24px;padding:var(--spacingVerticalXXS) var(--spacingHorizontalS);text-decoration:none;}",
|
|
39
|
+
".r5aus6y:hover{background-color:var(--colorNeutralBackground3Hover);border-color:var(--colorNeutralStroke1Hover);color:var(--colorNeutralForeground2Hover);}",
|
|
40
|
+
".r5aus6y:hover .fai-Reference__divider{background-color:var(--colorNeutralStroke1Hover);}",
|
|
41
|
+
".r5aus6y:hover:active{background-color:var(--colorNeutralBackground3Pressed);border-color:var(--colorNeutralStroke1Pressed);color:var(--colorNeutralForeground2Pressed);}",
|
|
42
|
+
".r5aus6y:hover:active .fai-Reference__divider{background-color:var(--colorNeutralStroke1Pressed);}"
|
|
43
|
+
]);
|
|
44
|
+
const useRootStyles = (0, _reactcomponents.__styles)({
|
|
45
|
+
overflow: {
|
|
46
|
+
B2u0y6b: "f6dzj5z",
|
|
47
|
+
a9b677: "fly5x3f"
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
d: [
|
|
51
|
+
".f6dzj5z{max-width:100%;}",
|
|
52
|
+
".fly5x3f{width:100%;}"
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
const useRootNextStyles = (0, _reactcomponents.__styles)({
|
|
56
|
+
root: {
|
|
57
|
+
Beyfa6y: 0,
|
|
58
|
+
Bbmb7ep: 0,
|
|
59
|
+
Btl43ni: 0,
|
|
60
|
+
B7oj6ja: 0,
|
|
61
|
+
Dimara: "f1kijzfu"
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
d: [
|
|
65
|
+
[
|
|
66
|
+
".f1kijzfu{border-radius:var(--borderRadiusXLarge);}",
|
|
67
|
+
{
|
|
68
|
+
p: -1
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
const useCitationBaseClassName = (0, _reactcomponents.__resetStyles)("r342rk1", null, [
|
|
74
|
+
".r342rk1{font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightBold);line-height:var(--lineHeightBase200);}"
|
|
75
|
+
]);
|
|
76
|
+
const useDividerBaseClassName = (0, _reactcomponents.__resetStyles)("r1eyqaw5", null, [
|
|
77
|
+
".r1eyqaw5{background-color:var(--colorNeutralStroke2);height:16px;margin:var(--spacingVerticalNone) var(--spacingHorizontalXS);width:1px;}"
|
|
78
|
+
]);
|
|
79
|
+
const useGraphicBaseClassName = (0, _reactcomponents.__resetStyles)("rpyrgl4", null, [
|
|
80
|
+
".rpyrgl4{display:inline-flex;font-size:16px;height:16px;line-height:16px;width:16px;}",
|
|
81
|
+
".rpyrgl4>.fai-Reference__graphicChild{height:16px;width:16px;}"
|
|
82
|
+
]);
|
|
83
|
+
const useContentBaseClassName = (0, _reactcomponents.__resetStyles)("r1ycou3l", null, [
|
|
84
|
+
".r1ycou3l{align-items:center;column-gap:var(--spacingHorizontalSNudge);display:inline-flex;text-align:start;word-break:break-word;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}"
|
|
85
|
+
]);
|
|
86
|
+
const useReferenceStyles_unstable = (state)=>{
|
|
87
|
+
'use no memo';
|
|
88
|
+
const { designVersion } = state;
|
|
89
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
90
|
+
const rootNextStyles = useRootNextStyles();
|
|
91
|
+
const citationBaseClassName = useCitationBaseClassName();
|
|
92
|
+
const dividerBaseClassName = useDividerBaseClassName();
|
|
93
|
+
const contentBaseClassName = useContentBaseClassName();
|
|
94
|
+
const graphicBaseClassName = useGraphicBaseClassName();
|
|
95
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.root, rootBaseClassName, designVersion === 'next' && rootNextStyles.root, state.root.className);
|
|
96
|
+
if (state.citation) {
|
|
97
|
+
state.citation.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.citation, citationBaseClassName, state.citation.className);
|
|
98
|
+
}
|
|
99
|
+
if (state.divider) {
|
|
100
|
+
state.divider.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.divider, dividerBaseClassName, state.divider.className);
|
|
101
|
+
}
|
|
102
|
+
if (state.content) {
|
|
103
|
+
state.content.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.content, contentBaseClassName, state.content.className);
|
|
104
|
+
}
|
|
105
|
+
if (state.graphic) {
|
|
106
|
+
state.graphic.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.graphic, graphicBaseClassName, state.graphic.className);
|
|
107
|
+
}
|
|
108
|
+
return state;
|
|
109
|
+
}; //# sourceMappingURL=useReferenceStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\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: 'inline-flex',\n flexShrink: 0,\n justifyContent: 'center',\n maxWidth: '100%',\n minHeight: '24px',\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 maxWidth: '100%',\n width: '100%',\n },\n});\n\nconst useRootNextStyles = makeStyles({ root: { borderRadius: tokens.borderRadiusXLarge } });\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 display: 'inline-flex',\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 alignItems: 'center',\n columnGap: tokens.spacingHorizontalSNudge,\n display: 'inline-flex',\n textAlign: 'start',\n wordBreak: 'break-word',\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 { designVersion } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const rootNextStyles = useRootNextStyles();\n const citationBaseClassName = useCitationBaseClassName();\n const dividerBaseClassName = useDividerBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const graphicBaseClassName = useGraphicBaseClassName();\n\n state.root.className = mergeClasses(\n referenceClassNames.root,\n rootBaseClassName,\n designVersion === 'next' && rootNextStyles.root,\n state.root.className,\n );\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","useReferenceStyles_unstable","alignItems","root","citation","divider","graphic","content","graphicChild","GRAPHIC_SIZE","useRootBaseClassName","makeResetStyles","__styles","backgroundColor","border","borderRadius","columnGap","spacingHorizontalXXS","flexShrink","justifyContent","maxWidth","minHeight","padding","textDecoration","Dimara","useCitationBaseClassName","__resetStyles","useDividerBaseClassName","colorNeutralBackground3Pressed","colorNeutralStroke1Pressed","state","overflow","width","rootNextStyles","useRootNextStyles","citationBaseClassName","makeStyles","useContentBaseClassName","borderRadiusXLarge","className","mergeClasses","rootBaseClassName","designVersion","dividerBaseClassName","height","margin","tokens","spacingVerticalNone","spacingHorizontalXS","contentBaseClassName","useGraphicBaseClassName","graphicBaseClassName","fontSize"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,mBAAAA;eAAAA;;IAQAC,wBAAAA;eAAAA;;IAuCTC,2BAAA;eAAAA;;IAhCFC,aAAY;eAAZA;;;iCApBg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H,OAAAA,CAAAA,SAAAA,GAAAA,IAAAA,6BAA0BhB,EAAAA,oBAAgBN,OAAA,EAAAsC,sBAAAb,MAAAzB,OAAA,CAAAkC,SAAA;;QAE9CK,MAAQrC,OAAA,EAAA;QACRsC,MAAAA,OAAWC,CAAAA,SAAOC,GAAAA,IAAAA,6BAAoB,EAAChD,oBAASiD,OAAAA,EAAoBC,sBAACnB,MAAAvB,OAAA,CAAAgC,SAAA;;IAEvE,IAAAT,MAAAxB,OAAA,EAAA;QAEAwB,MAAMoB,OAAAA,CAAAA,SAAAA,GAAAA,IAAAA,6BAA0BvC,EAAAA,oBAAgBL,OAAA,EAAA6C,sBAAArB,MAAAxB,OAAA,CAAAiC,SAAA;;WAE9Ca;wDAEY3C"}
|
|
@@ -0,0 +1,132 @@
|
|
|
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 _tokens = require("@fluentui-copilot/tokens");
|
|
27
|
+
const referenceClassNames = {
|
|
28
|
+
root: 'fai-Reference',
|
|
29
|
+
citation: 'fai-Reference__citation',
|
|
30
|
+
divider: 'fai-Reference__divider',
|
|
31
|
+
graphic: 'fai-Reference__graphic',
|
|
32
|
+
content: 'fai-Reference__content'
|
|
33
|
+
};
|
|
34
|
+
const referenceExtraClassNames = {
|
|
35
|
+
graphicChild: 'fai-Reference__graphicChild'
|
|
36
|
+
};
|
|
37
|
+
const GRAPHIC_SIZE = '16px';
|
|
38
|
+
const useRootBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3,
|
|
41
|
+
border: `${_tokens.tokens.strokeWidthThin} solid ${_tokens.tokens.colorNeutralStroke2}`,
|
|
42
|
+
borderRadius: _tokens.tokens.borderRadiusMedium,
|
|
43
|
+
boxSizing: 'border-box',
|
|
44
|
+
color: _tokens.tokens.colorNeutralForeground2,
|
|
45
|
+
columnGap: _tokens.tokens.spacingHorizontalXXS,
|
|
46
|
+
display: 'inline-flex',
|
|
47
|
+
flexShrink: 0,
|
|
48
|
+
justifyContent: 'center',
|
|
49
|
+
maxWidth: '100%',
|
|
50
|
+
minHeight: '24px',
|
|
51
|
+
padding: `${_tokens.tokens.spacingVerticalXXS} ${_tokens.tokens.spacingHorizontalS}`,
|
|
52
|
+
textDecoration: 'none',
|
|
53
|
+
':hover': {
|
|
54
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3Hover,
|
|
55
|
+
borderColor: _tokens.tokens.colorNeutralStroke1Hover,
|
|
56
|
+
color: _tokens.tokens.colorNeutralForeground2Hover,
|
|
57
|
+
[`& .${referenceClassNames.divider}`]: {
|
|
58
|
+
backgroundColor: _tokens.tokens.colorNeutralStroke1Hover
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
':hover:active': {
|
|
62
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3Pressed,
|
|
63
|
+
borderColor: _tokens.tokens.colorNeutralStroke1Pressed,
|
|
64
|
+
color: _tokens.tokens.colorNeutralForeground2Pressed,
|
|
65
|
+
[`& .${referenceClassNames.divider}`]: {
|
|
66
|
+
backgroundColor: _tokens.tokens.colorNeutralStroke1Pressed
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const useRootStyles = (0, _reactcomponents.makeStyles)({
|
|
71
|
+
overflow: {
|
|
72
|
+
maxWidth: '100%',
|
|
73
|
+
width: '100%'
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const useRootNextStyles = (0, _reactcomponents.makeStyles)({
|
|
77
|
+
root: {
|
|
78
|
+
borderRadius: _tokens.tokens.borderRadiusXLarge
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const useCitationBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
82
|
+
..._tokens.typographyStyles.caption2Strong
|
|
83
|
+
});
|
|
84
|
+
const useDividerBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
85
|
+
backgroundColor: _tokens.tokens.colorNeutralStroke2,
|
|
86
|
+
height: '16px',
|
|
87
|
+
margin: `${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalXS}`,
|
|
88
|
+
width: '1px'
|
|
89
|
+
});
|
|
90
|
+
const useGraphicBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
91
|
+
display: 'inline-flex',
|
|
92
|
+
fontSize: GRAPHIC_SIZE,
|
|
93
|
+
height: GRAPHIC_SIZE,
|
|
94
|
+
lineHeight: GRAPHIC_SIZE,
|
|
95
|
+
width: GRAPHIC_SIZE,
|
|
96
|
+
[`> .${referenceExtraClassNames.graphicChild}`]: {
|
|
97
|
+
height: GRAPHIC_SIZE,
|
|
98
|
+
width: GRAPHIC_SIZE
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
const useContentBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
102
|
+
alignItems: 'center',
|
|
103
|
+
columnGap: _tokens.tokens.spacingHorizontalSNudge,
|
|
104
|
+
display: 'inline-flex',
|
|
105
|
+
textAlign: 'start',
|
|
106
|
+
wordBreak: 'break-word',
|
|
107
|
+
..._tokens.typographyStyles.caption1
|
|
108
|
+
});
|
|
109
|
+
const useReferenceStyles_unstable = (state)=>{
|
|
110
|
+
'use no memo';
|
|
111
|
+
const { designVersion } = state;
|
|
112
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
113
|
+
const rootNextStyles = useRootNextStyles();
|
|
114
|
+
const citationBaseClassName = useCitationBaseClassName();
|
|
115
|
+
const dividerBaseClassName = useDividerBaseClassName();
|
|
116
|
+
const contentBaseClassName = useContentBaseClassName();
|
|
117
|
+
const graphicBaseClassName = useGraphicBaseClassName();
|
|
118
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.root, rootBaseClassName, designVersion === 'next' && rootNextStyles.root, state.root.className);
|
|
119
|
+
if (state.citation) {
|
|
120
|
+
state.citation.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.citation, citationBaseClassName, state.citation.className);
|
|
121
|
+
}
|
|
122
|
+
if (state.divider) {
|
|
123
|
+
state.divider.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.divider, dividerBaseClassName, state.divider.className);
|
|
124
|
+
}
|
|
125
|
+
if (state.content) {
|
|
126
|
+
state.content.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.content, contentBaseClassName, state.content.className);
|
|
127
|
+
}
|
|
128
|
+
if (state.graphic) {
|
|
129
|
+
state.graphic.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.graphic, graphicBaseClassName, state.graphic.className);
|
|
130
|
+
}
|
|
131
|
+
return state;
|
|
132
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\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: 'inline-flex',\n flexShrink: 0,\n justifyContent: 'center',\n maxWidth: '100%',\n minHeight: '24px',\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 maxWidth: '100%',\n width: '100%',\n },\n});\n\nconst useRootNextStyles = makeStyles({ root: { borderRadius: tokens.borderRadiusXLarge } });\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 display: 'inline-flex',\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 alignItems: 'center',\n columnGap: tokens.spacingHorizontalSNudge,\n display: 'inline-flex',\n textAlign: 'start',\n wordBreak: 'break-word',\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 { designVersion } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const rootNextStyles = useRootNextStyles();\n const citationBaseClassName = useCitationBaseClassName();\n const dividerBaseClassName = useDividerBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const graphicBaseClassName = useGraphicBaseClassName();\n\n state.root.className = mergeClasses(\n referenceClassNames.root,\n rootBaseClassName,\n designVersion === 'next' && rootNextStyles.root,\n state.root.className,\n );\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","useReferenceStyles_unstable","useRootStyles","root","citation","divider","graphic","content","graphicChild","GRAPHIC_SIZE","useRootBaseClassName","makeResetStyles","alignItems","backgroundColor","tokens","colorNeutralBackground3","border","strokeWidthThin","colorNeutralStroke2","borderRadius","borderRadiusMedium","boxSizing","color","colorNeutralForeground2","columnGap","spacingHorizontalXXS","display","flexShrink","justifyContent","maxWidth","minHeight","padding","spacingVerticalXXS","spacingHorizontalS","textDecoration","colorNeutralBackground3Hover","borderColor","colorNeutralStroke1Hover","colorNeutralForeground2Hover","colorNeutralBackground3Pressed","colorNeutralStroke1Pressed","colorNeutralForeground2Pressed","makeStyles","overflow","width","useRootNextStyles","borderRadiusXLarge","useCitationBaseClassName","typographyStyles","caption2Strong","useDividerBaseClassName","height","margin","spacingVerticalNone","spacingHorizontalXS","useGraphicBaseClassName","fontSize","lineHeight","useContentBaseClassName","spacingHorizontalSNudge","textAlign","wordBreak","caption1","state","designVersion","rootBaseClassName","rootNextStyles","citationBaseClassName","dividerBaseClassName","contentBaseClassName","graphicBaseClassName","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,mBAAAA;eAAAA;;IAQAC,wBAAAA;eAAAA;;IAwFAC,2BAAAA;eAAAA;;IA7CAC,aAAAA;eAAAA;;;iCAxD6C;wBACjB;AAIlC,MAAMH,sBAAsD;IACjEI,MAAM;IACNC,UAAU;IACVC,SAAS;IACTC,SAAS;IACTC,SAAS;AACX;AAEO,MAAMP,2BAA2B;IACtCQ,cAAc;AAChB;AAEA,MAAMC,eAAe;AAErB,MAAMC,uBAAuBC,IAAAA,gCAAAA,EAAgB;IAC3CC,YAAY;IACZC,iBAAiBC,cAAAA,CAAOC,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEF,cAAAA,CAAOG,eAAe,CAAC,OAAO,EAAEH,cAAAA,CAAOI,mBAAmB,CAAC,CAAC;IACvEC,cAAcL,cAAAA,CAAOM,kBAAkB;IACvCC,WAAW;IACXC,OAAOR,cAAAA,CAAOS,uBAAuB;IACrCC,WAAWV,cAAAA,CAAOW,oBAAoB;IACtCC,SAAS;IACTC,YAAY;IACZC,gBAAgB;IAChBC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BQ,OAAO,EAAE8D,sBAAsBN,MAAMxD,OAAO,CAACgE,SAAS;IACnH;IAEA,IAAIR,MAAMzD,OAAO,EAAE;QACjByD,MAAMzD,OAAO,CAACiE,SAAS,GAAGC,IAAAA,6BAAAA,EAAazE,oBAAoBO,OAAO,EAAEgE,sBAAsBP,MAAMzD,OAAO,CAACiE,SAAS;IACnH;IAEA,OAAOR;AACT"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "ReferenceList", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return ReferenceList;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _renderReferenceList = require("./renderReferenceList");
|
|
14
|
+
const _useReferenceList = require("./useReferenceList");
|
|
15
|
+
const _useReferenceListStylesstyles = require("./useReferenceListStyles.styles");
|
|
16
|
+
const _useReferenceListContextValues = require("./useReferenceListContextValues");
|
|
17
|
+
const ReferenceList = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
|
+
const state = (0, _useReferenceList.useReferenceList_unstable)(props, ref);
|
|
19
|
+
const referenceListContextValues = (0, _useReferenceListContextValues.useReferenceListContextValues_unstable)(state);
|
|
20
|
+
(0, _useReferenceListStylesstyles.useReferenceListStyles_unstable)(state);
|
|
21
|
+
return (0, _renderReferenceList.renderReferenceList_unstable)(state, referenceListContextValues);
|
|
22
|
+
});
|
|
23
|
+
ReferenceList.displayName = 'ReferenceList';
|
|
@@ -0,0 +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.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","ref","state","useReferenceList_unstable","referenceListContextValues","useReferenceListContextValues_unstable","useReferenceListStyles_unstable","renderReferenceList_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;qCAEsB;kCACH;8CACM;+CACO;AAGhD,MAAMA,gBAAAA,WAAAA,GAAyDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQC,IAAAA,2CAAAA,EAA0BH,OAAOC;IAC/C,MAAMG,6BAA6BC,IAAAA,qEAAAA,EAAuCH;IAE1EI,IAAAA,6DAAAA,EAAgCJ;IAEhC,OAAOK,IAAAA,iDAAAA,EAA6BL,OAAOE;AAC7C;AAEAP,cAAcW,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceList.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { ReferenceListContextValue } from '../../contexts/referenceListContext';\n\nexport type ReferenceListSlots = {\n /** The root of the component that contains the list of references. */\n root: NonNullable<Slot<'div'>>;\n\n /** The region that contains the references and is used for arrow navigation. */\n arrowableRegion: 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<Partial<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 * If this value is less than `minVisibleReferences`, then `minVisibleReferences` will take precedence.\n * @default undefined\n */\n maxVisibleReferences?: number;\n\n /**\n * The minimum number of references to always show before overflowing.\n * If this value exceeds the number of references, the overflow functionality will be disabled.\n * If this value is greater than `maxVisibleReferences`, then this will take precedence.\n * @default undefined\n */\n minVisibleReferences?: number;\n};\n\nexport type ReferenceListState = ComponentState<ReferenceListSlots> &\n Pick<ReferenceListProps, 'maxVisibleReferences' | 'minVisibleReferences'> & {\n areReferencesExpanded: boolean;\n overflowButtonTriggeredViaKeyboard: React.MutableRefObject<boolean>;\n referenceListRef: React.RefObject<HTMLDivElement | null>;\n shouldUseOverflow: boolean;\n totalReferencesCount: number;\n };\n\nexport type ReferenceListContextValues = {\n referenceList: ReferenceListContextValue;\n};\n"],"names":[],"rangeMappings":"","mappings":""}
|