@fluentui-copilot/react-reference 0.0.0-nightly-20251010-0406-7df7c6d1.1 → 0.0.0-nightly-20251013-0406-7c7739c8.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 +3 -3
- package/CHANGELOG.md +4 -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 +97 -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 +97 -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
package/CHANGELOG.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-reference",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
6
|
-
"tag": "@fluentui-copilot/react-reference_v0.0.0-nightly-
|
|
7
|
-
"version": "0.0.0-nightly-
|
|
5
|
+
"date": "Mon, 13 Oct 2025 04:14:18 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-reference_v0.0.0-nightly-20251013-0406-7c7739c8.1",
|
|
7
|
+
"version": "0.0.0-nightly-20251013-0406-7c7739c8.1",
|
|
8
8
|
"comments": {
|
|
9
9
|
"prerelease": [
|
|
10
10
|
{
|
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-reference
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 13 Oct 2025 04:14:18 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [0.0.0-nightly-
|
|
7
|
+
## [0.0.0-nightly-20251013-0406-7c7739c8.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-reference_v0.0.0-nightly-20251013-0406-7c7739c8.1)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-reference_v0.16.5..@fluentui-copilot/react-reference_v0.0.0-nightly-
|
|
9
|
+
Mon, 13 Oct 2025 04:14:18 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-reference_v0.16.5..@fluentui-copilot/react-reference_v0.0.0-nightly-20251013-0406-7c7739c8.1)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
|
|
3
|
+
import type { ComponentProps } from '@fluentui/react-components';
|
|
4
|
+
import type { ComponentState } from '@fluentui/react-components';
|
|
5
|
+
import type { Context } from '@fluentui/react-context-selector';
|
|
6
|
+
import type { ContextSelector } from '@fluentui/react-context-selector';
|
|
7
|
+
import type { DesignVersion } from '@fluentui-copilot/react-provider';
|
|
8
|
+
import { FC } from 'react';
|
|
9
|
+
import type { ForwardRefComponent } from '@fluentui/react-components';
|
|
10
|
+
import { ForwardRefComponent as ForwardRefComponent_2 } from '@fluentui/react-utilities';
|
|
11
|
+
import type { JSXElement } from '@fluentui/react-components';
|
|
12
|
+
import { JSXElement as JSXElement_2 } from '@fluentui/react-utilities';
|
|
13
|
+
import type { PreviewHeaderProps } from '@fluentui-copilot/react-preview';
|
|
14
|
+
import type { PreviewMetadataProps } from '@fluentui-copilot/react-preview';
|
|
15
|
+
import type { PreviewProps } from '@fluentui-copilot/react-preview';
|
|
16
|
+
import type { PreviewSurfaceProps } from '@fluentui-copilot/react-preview';
|
|
17
|
+
import { Provider } from 'react';
|
|
18
|
+
import { ProviderProps } from 'react';
|
|
19
|
+
import * as React_2 from 'react';
|
|
20
|
+
import { Ref } from 'react';
|
|
21
|
+
import type { SensitivityLabelProps } from '@fluentui-copilot/react-sensitivity-label';
|
|
22
|
+
import type { Slot } from '@fluentui/react-components';
|
|
23
|
+
import type { SlotClassNames } from '@fluentui/react-components';
|
|
24
|
+
import { SlotClassNames as SlotClassNames_2 } from '@fluentui/react-utilities';
|
|
25
|
+
|
|
26
|
+
export declare const Citation: ForwardRefComponent<CitationProps>;
|
|
27
|
+
|
|
28
|
+
export declare const citationClassNames: SlotClassNames<CitationSlots>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Citation Props
|
|
32
|
+
*/
|
|
33
|
+
export declare type CitationProps = ComponentProps<Partial<CitationSlots>> & DesignVersion & {
|
|
34
|
+
/**
|
|
35
|
+
* HREF to the associated `Reference`.
|
|
36
|
+
*/
|
|
37
|
+
referenceHref?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the citation is a block citation and has no built in margins.
|
|
40
|
+
* Citations are inline by default with margins to separate them from inline text.
|
|
41
|
+
*/
|
|
42
|
+
block?: boolean;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export declare type CitationSlots = {
|
|
46
|
+
/**
|
|
47
|
+
* The root slot.
|
|
48
|
+
*/
|
|
49
|
+
root: NonNullable<Slot<'a'>>;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* State used in rendering Citation
|
|
54
|
+
*/
|
|
55
|
+
export declare type CitationState = ComponentState<CitationSlots> & Required<Pick<CitationProps, 'block' | 'designVersion'>> & {
|
|
56
|
+
isPopoverLocked: boolean;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Function to generate a Citation - Reference pair with correctly wired props.
|
|
61
|
+
* Both the Citation and the Reference act as trigger components to Previews that are also correctly wired by the function.
|
|
62
|
+
* Props can either be passed in to the function or applied directly to the generated components in JSX.
|
|
63
|
+
*
|
|
64
|
+
* A `useReferenceCitationPreview` hook exists that calls this function and memoizes its return value based on the props.
|
|
65
|
+
* You should use the hook when the props used to generate the Citation - Reference pair can change dynamically.
|
|
66
|
+
* If they are static, or in case you wanted to generate multiple pairs within a cycle, you should call
|
|
67
|
+
* `generateReferenceCitationPreview` directly.
|
|
68
|
+
*
|
|
69
|
+
* @returns A Citation - Reference pair with correctly wired props.
|
|
70
|
+
*/
|
|
71
|
+
export declare const generateReferenceCitationPreview: ReferenceCitationPreviewGenerator;
|
|
72
|
+
|
|
73
|
+
export declare type PackagedCitation = React_2.FC<CitationProps>;
|
|
74
|
+
|
|
75
|
+
/** @deprecated use PackagedCitation */
|
|
76
|
+
export declare type PackagedCitationV2 = PackagedCitation;
|
|
77
|
+
|
|
78
|
+
export declare type PackagedPreviewContentProps = Pick<PreviewMetadataProps, 'icon' | 'primaryText' | 'secondaryText' | 'tertiaryText'> & {
|
|
79
|
+
content?: React_2.ReactNode;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/** @deprecated use PackagedPreviewContentProps */
|
|
83
|
+
export declare type PackagedPreviewContentV2Props = PackagedPreviewContentProps;
|
|
84
|
+
|
|
85
|
+
export declare type PackagedReference = React_2.FC<ReferenceProps>;
|
|
86
|
+
|
|
87
|
+
/** @deprecated use PackagedReference */
|
|
88
|
+
export declare type PackagedReferenceV2 = PackagedReference;
|
|
89
|
+
|
|
90
|
+
export declare const Reference: ForwardRefComponent<ReferenceProps>;
|
|
91
|
+
|
|
92
|
+
export declare type ReferenceCitationPreviewGenerator = (props: ReferenceCitationPreviewGeneratorProps) => {
|
|
93
|
+
Citation: PackagedCitation;
|
|
94
|
+
Reference: PackagedReference;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export declare type ReferenceCitationPreviewGeneratorProps = {
|
|
98
|
+
citationPreviewProps?: Omit<PreviewProps, 'children'> & Partial<Pick<PreviewProps, 'children'>>;
|
|
99
|
+
citationPreviewSurfaceProps?: PreviewSurfaceProps;
|
|
100
|
+
citationProps?: CitationProps;
|
|
101
|
+
index: number;
|
|
102
|
+
previewContentProps?: PackagedPreviewContentProps;
|
|
103
|
+
previewHeaderProps?: PreviewHeaderProps;
|
|
104
|
+
referencePreviewProps?: Omit<PreviewProps, 'children'> & Partial<Pick<PreviewProps, 'children'>>;
|
|
105
|
+
referencePreviewSurfaceProps?: PreviewSurfaceProps;
|
|
106
|
+
referenceProps?: ReferenceProps;
|
|
107
|
+
sensitivityLabelProps?: SensitivityLabelProps;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export declare const referenceClassNames: SlotClassNames<ReferenceSlots>;
|
|
111
|
+
|
|
112
|
+
export declare const referenceExtraClassNames: {
|
|
113
|
+
graphicChild: string;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export declare const ReferenceList: ForwardRefComponent<ReferenceListProps>;
|
|
117
|
+
|
|
118
|
+
export declare const referenceListClassNames: SlotClassNames<ReferenceListSlots>;
|
|
119
|
+
|
|
120
|
+
export declare const ReferenceListContext: Context<ReferenceListContextValue>;
|
|
121
|
+
|
|
122
|
+
export declare const ReferenceListContextProvider: Provider<ReferenceListContextValue> & FC<ProviderProps<ReferenceListContextValue>>;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Context shared between ReferenceList and its children components
|
|
126
|
+
*/
|
|
127
|
+
export declare type ReferenceListContextValue = Pick<ReferenceListState, 'areReferencesExpanded' | 'maxVisibleReferences' | 'overflowButtonTriggeredViaKeyboard' | 'referenceListRef' | 'shouldUseOverflow' | 'totalReferencesCount'>;
|
|
128
|
+
|
|
129
|
+
export declare type ReferenceListContextValues = {
|
|
130
|
+
referenceList: ReferenceListContextValue;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export declare type ReferenceListProps = ComponentProps<Partial<ReferenceListSlots>> & {
|
|
134
|
+
/**
|
|
135
|
+
* The maximum number of references to display before the overflow button is shown even if there is
|
|
136
|
+
* enough space available to show more.
|
|
137
|
+
* If not set, the overflow functionality will be disabled.
|
|
138
|
+
* If this value is less than `minVisibleReferences`, then `minVisibleReferences` will take precedence.
|
|
139
|
+
* @default undefined
|
|
140
|
+
*/
|
|
141
|
+
maxVisibleReferences?: number;
|
|
142
|
+
/**
|
|
143
|
+
* The minimum number of references to always show before overflowing.
|
|
144
|
+
* If this value exceeds the number of references, the overflow functionality will be disabled.
|
|
145
|
+
* If this value is greater than `maxVisibleReferences`, then this will take precedence.
|
|
146
|
+
* @default undefined
|
|
147
|
+
*/
|
|
148
|
+
minVisibleReferences?: number;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export declare type ReferenceListSlots = {
|
|
152
|
+
/** The root of the component that contains the list of references. */
|
|
153
|
+
root: NonNullable<Slot<'div'>>;
|
|
154
|
+
/** The region that contains the references and is used for arrow navigation. */
|
|
155
|
+
arrowableRegion: NonNullable<Slot<'div'>>;
|
|
156
|
+
/** A space containing a button that expands the list of references. This slot is only rendered when the list of references is collapsed. */
|
|
157
|
+
showMoreButton?: Slot<'span'>;
|
|
158
|
+
/** A space containing a button that collapses the list of references. This slot is only rendered when the list of references is expanded. */
|
|
159
|
+
showLessButton?: Slot<'span'>;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export declare type ReferenceListState = ComponentState<ReferenceListSlots> & Pick<ReferenceListProps, 'maxVisibleReferences' | 'minVisibleReferences'> & {
|
|
163
|
+
areReferencesExpanded: boolean;
|
|
164
|
+
overflowButtonTriggeredViaKeyboard: React.MutableRefObject<boolean>;
|
|
165
|
+
referenceListRef: React.RefObject<HTMLDivElement | null>;
|
|
166
|
+
shouldUseOverflow: boolean;
|
|
167
|
+
totalReferencesCount: number;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/** @deprecated use ReferenceList */
|
|
171
|
+
export declare const ReferenceListV2: ForwardRefComponent_2<ReferenceListProps>;
|
|
172
|
+
|
|
173
|
+
/** @deprecated use referenceListClassNames */
|
|
174
|
+
export declare const referenceListV2ClassNames: SlotClassNames_2<ReferenceListSlots>;
|
|
175
|
+
|
|
176
|
+
/** @deprecated use ReferenceListContextValues */
|
|
177
|
+
export declare type ReferenceListV2ContextValues = ReferenceListContextValues;
|
|
178
|
+
|
|
179
|
+
/** @deprecated use ReferenceListProps */
|
|
180
|
+
export declare type ReferenceListV2Props = ReferenceListProps;
|
|
181
|
+
|
|
182
|
+
/** @deprecated use ReferenceListSlots */
|
|
183
|
+
export declare type ReferenceListV2Slots = ReferenceListSlots;
|
|
184
|
+
|
|
185
|
+
/** @deprecated use ReferenceListState */
|
|
186
|
+
export declare type ReferenceListV2State = ReferenceListState;
|
|
187
|
+
|
|
188
|
+
export declare const ReferenceOverflowButton: ForwardRefComponent<ReferenceOverflowButtonProps>;
|
|
189
|
+
|
|
190
|
+
export declare const referenceOverflowButtonClassNames: SlotClassNames<ReferenceOverflowButtonSlots>;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* ReferenceOverflowButton Props
|
|
194
|
+
*/
|
|
195
|
+
export declare type ReferenceOverflowButtonProps = ComponentProps<ReferenceOverflowButtonSlots> & DesignVersion & {
|
|
196
|
+
/**
|
|
197
|
+
* The text that is displayed inside of the overflow button. This text is only displayed when `children` has not been passed to the component.
|
|
198
|
+
* If a string is passed, that is what is rendered verbatim.
|
|
199
|
+
* If a callback is passed, the callback is called with the number of items that are overflowing, and the result of the callback is rendered.
|
|
200
|
+
*/
|
|
201
|
+
text?: string | ((overflowCount: number) => React.ReactNode);
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
export declare type ReferenceOverflowButtonSlots = {
|
|
205
|
+
/** The root of the component that renders the overflow button. */
|
|
206
|
+
root: Slot<'button'>;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* State used in rendering ReferenceOverflowButton
|
|
211
|
+
*/
|
|
212
|
+
export declare type ReferenceOverflowButtonState = ComponentState<ReferenceOverflowButtonSlots> & Pick<Required<ReferenceOverflowButtonProps>, 'designVersion'> & {
|
|
213
|
+
id: string;
|
|
214
|
+
shouldRenderOverflowButton: boolean;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export declare type ReferenceProps = ComponentProps<Partial<ReferenceSlots>> & DesignVersion & {};
|
|
218
|
+
|
|
219
|
+
export declare type ReferenceSlots = {
|
|
220
|
+
/** The root of the component that renders the reference as either a button or an anchor element. */
|
|
221
|
+
root: NonNullable<Slot<'button', 'a'>>;
|
|
222
|
+
/** The number of the citation this reference corresponds to. */
|
|
223
|
+
citation?: Slot<'span'>;
|
|
224
|
+
/** A divider that visually separates the citation from the content of the reference. */
|
|
225
|
+
divider?: Slot<'span'>;
|
|
226
|
+
/** A space containing the content of the reference, which goes into an ellipsis if it overflows. */
|
|
227
|
+
content?: Slot<'span'>;
|
|
228
|
+
/** 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. */
|
|
229
|
+
graphic?: Slot<'span'>;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
export declare type ReferenceState = ComponentState<ReferenceSlots> & Required<Pick<ReferenceProps, 'id' | 'designVersion'>> & Pick<ReferenceListState, 'shouldUseOverflow'>;
|
|
233
|
+
|
|
234
|
+
/** @deprecated use Reference */
|
|
235
|
+
export declare const ReferenceV2: ForwardRefComponent_2<ReferenceProps>;
|
|
236
|
+
|
|
237
|
+
/** @deprecated use referenceClassNames */
|
|
238
|
+
export declare const referenceV2ClassNames: SlotClassNames_2<ReferenceSlots>;
|
|
239
|
+
|
|
240
|
+
/** @deprecated use referenceExtraClassNames */
|
|
241
|
+
export declare const referenceV2ExtraClassNames: {
|
|
242
|
+
graphicChild: string;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
/** @deprecated use ReferenceProps */
|
|
246
|
+
export declare type ReferenceV2Props = ReferenceProps;
|
|
247
|
+
|
|
248
|
+
/** @deprecated use ReferenceSlots */
|
|
249
|
+
export declare type ReferenceV2Slots = ReferenceSlots;
|
|
250
|
+
|
|
251
|
+
/** @deprecated use ReferenceState */
|
|
252
|
+
export declare type ReferenceV2State = ReferenceState;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Render the final JSX of Citation
|
|
256
|
+
*/
|
|
257
|
+
export declare const renderCitation_unstable: (state: CitationState) => JSXElement;
|
|
258
|
+
|
|
259
|
+
export declare const renderReference_unstable: (state: ReferenceState) => JSXElement;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Render the final JSX of ReferenceList
|
|
263
|
+
*/
|
|
264
|
+
export declare const renderReferenceList_unstable: (state: ReferenceListState, contextValues: ReferenceListContextValues) => JSXElement;
|
|
265
|
+
|
|
266
|
+
/** @deprecated use renderReferenceList_unstable */
|
|
267
|
+
export declare const renderReferenceListV2_unstable: (state: ReferenceListState, contextValues: ReferenceListContextValues) => JSXElement_2;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Render the final JSX of ReferenceOverflowButton
|
|
271
|
+
*/
|
|
272
|
+
export declare const renderReferenceOverflowButton_unstable: (state: ReferenceOverflowButtonState) => JSXElement | null;
|
|
273
|
+
|
|
274
|
+
/** @deprecated use renderReference_unstable */
|
|
275
|
+
export declare const renderReferenceV2_unstable: (state: ReferenceState) => JSXElement_2;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Create the state required to render Citation.
|
|
279
|
+
*
|
|
280
|
+
* The returned state can be modified with hooks such as useCitationStyles_unstable,
|
|
281
|
+
* before being passed to renderCitation_unstable.
|
|
282
|
+
*
|
|
283
|
+
* @param props - props from this instance of Citation
|
|
284
|
+
* @param ref - reference to root HTMLElement of Citation
|
|
285
|
+
*/
|
|
286
|
+
export declare const useCitation_unstable: (props: CitationProps, ref: React.Ref<HTMLAnchorElement>) => CitationState;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Apply styling to the Citation slots based on the state
|
|
290
|
+
*/
|
|
291
|
+
export declare const useCitationStyles_unstable: (state: CitationState) => CitationState;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Create the state required to render Reference.
|
|
295
|
+
*
|
|
296
|
+
* The returned state can be modified with hooks such as useReferenceStyles_unstable,
|
|
297
|
+
* before being passed to renderReference_unstable.
|
|
298
|
+
*
|
|
299
|
+
* @param props - props from this instance of Reference
|
|
300
|
+
* @param ref - reference to root HTMLElement of Reference
|
|
301
|
+
*/
|
|
302
|
+
export declare const useReference_unstable: (props: ReferenceProps, ref: React_2.Ref<HTMLButtonElement | HTMLAnchorElement>) => ReferenceState;
|
|
303
|
+
|
|
304
|
+
export declare type UseReferenceCitationPreview = ReferenceCitationPreviewGenerator;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Hook to generate a Citation - Reference pair with correctly wired props.
|
|
308
|
+
* Both the Citation and the Reference act as trigger components to Previews that are also correctly wired by the hook.
|
|
309
|
+
* Props can either be passed in to the hook or applied directly to the generated components in JSX.
|
|
310
|
+
*
|
|
311
|
+
* This hook internally calls the `generateReferenceCitationPreview` function and memoizes its return value based on the props.
|
|
312
|
+
* You should only use this hook when the props used to generate the Citation - Reference pair can change dynamically.
|
|
313
|
+
* If they are static, or in case you wanted to generate multiple pairs within a cycle, you should call
|
|
314
|
+
* `generateReferenceCitationPreview` directly.
|
|
315
|
+
*
|
|
316
|
+
* @returns A Citation - Reference pair with correctly wired props.
|
|
317
|
+
*/
|
|
318
|
+
export declare const useReferenceCitationPreview: UseReferenceCitationPreview;
|
|
319
|
+
|
|
320
|
+
export declare type UseReferenceCitationPreviewProps = ReferenceCitationPreviewGeneratorProps;
|
|
321
|
+
|
|
322
|
+
/** @deprecated use UseReferenceCitationPreview */
|
|
323
|
+
export declare type UseReferenceCitationPreviewV2 = UseReferenceCitationPreview;
|
|
324
|
+
|
|
325
|
+
/** @deprecated use useReferenceCitationPreview */
|
|
326
|
+
export declare const useReferenceCitationPreviewV2: ReferenceCitationPreviewGenerator;
|
|
327
|
+
|
|
328
|
+
/** @deprecated use UseReferenceCitationPreviewProps */
|
|
329
|
+
export declare type UseReferenceCitationPreviewV2Props = UseReferenceCitationPreviewProps;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Create the state required to render ReferenceList.
|
|
333
|
+
*
|
|
334
|
+
* The returned state can be modified with hooks such as useReferenceListStyles_unstable,
|
|
335
|
+
* before being passed to renderReferenceList_unstable.
|
|
336
|
+
*
|
|
337
|
+
* @param props - props from this instance of ReferenceList
|
|
338
|
+
* @param ref - reference to root HTMLElement of ReferenceList
|
|
339
|
+
*/
|
|
340
|
+
export declare const useReferenceList_unstable: (props: ReferenceListProps, ref: React_2.Ref<HTMLDivElement>) => ReferenceListState;
|
|
341
|
+
|
|
342
|
+
export declare const useReferenceListContext_unstable: <T>(selector: ContextSelector<ReferenceListContextValue, T>) => T;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Apply styling to the ReferenceList slots based on the state
|
|
346
|
+
*/
|
|
347
|
+
export declare const useReferenceListStyles_unstable: (state: ReferenceListState) => ReferenceListState;
|
|
348
|
+
|
|
349
|
+
/** @deprecated use useReferenceList_unstable */
|
|
350
|
+
export declare const useReferenceListV2_unstable: (props: ReferenceListProps, ref: Ref<HTMLDivElement>) => ReferenceListState;
|
|
351
|
+
|
|
352
|
+
/** @deprecated use useReferenceListStyles_unstable */
|
|
353
|
+
export declare const useReferenceListV2Styles_unstable: (state: ReferenceListState) => ReferenceListState;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Create the state required to render ReferenceOverflowButton.
|
|
357
|
+
*
|
|
358
|
+
* The returned state can be modified with hooks such as useReferenceOverflowButtonStyles_unstable,
|
|
359
|
+
* before being passed to renderReferenceOverflowButton_unstable.
|
|
360
|
+
*
|
|
361
|
+
* @param props - props from this instance of ReferenceOverflowButton
|
|
362
|
+
* @param ref - reference to root HTMLElement of ReferenceOverflowButton
|
|
363
|
+
*/
|
|
364
|
+
export declare const useReferenceOverflowButton_unstable: (props: ReferenceOverflowButtonProps, ref: React_2.Ref<HTMLButtonElement>) => ReferenceOverflowButtonState;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Apply styling to the ReferenceOverflowButton slots based on the state
|
|
368
|
+
*/
|
|
369
|
+
export declare const useReferenceOverflowButtonStyles_unstable: (state: ReferenceOverflowButtonState) => ReferenceOverflowButtonState;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Apply styling to the Reference slots based on the state
|
|
373
|
+
*/
|
|
374
|
+
export declare const useReferenceStyles_unstable: (state: ReferenceState) => ReferenceState;
|
|
375
|
+
|
|
376
|
+
/** @deprecated use useReference_unstable */
|
|
377
|
+
export declare const useReferenceV2_unstable: (props: ReferenceProps, ref: Ref<HTMLAnchorElement | HTMLButtonElement>) => ReferenceState;
|
|
378
|
+
|
|
379
|
+
/** @deprecated use useReferenceStyles_unstable */
|
|
380
|
+
export declare const useReferenceV2Styles_unstable: (state: ReferenceState) => ReferenceState;
|
|
381
|
+
|
|
382
|
+
export { }
|
package/lib/Citation.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Citation, citationClassNames, renderCitation_unstable, useCitationStyles_unstable, useCitation_unstable } from './components/Citation/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Citation.ts"],"sourcesContent":["export type { CitationProps, CitationSlots, CitationState } from './components/Citation/index';\nexport { Citation, citationClassNames, renderCitation_unstable, useCitationStyles_unstable, useCitation_unstable } from './components/Citation/index';\n"],"names":["Citation","citationClassNames","renderCitation_unstable","useCitationStyles_unstable","useCitation_unstable"],"rangeMappings":"","mappings":"AACA,SAASA,QAAQ,EAAEC,kBAAkB,EAAEC,uBAAuB,EAAEC,0BAA0B,EAAEC,oBAAoB,QAAQ,8BAA8B"}
|
package/lib/Reference.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Reference, referenceClassNames, referenceExtraClassNames, renderReference_unstable, useReferenceStyles_unstable, useReference_unstable } from './components/Reference/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Reference.ts"],"sourcesContent":["export type { ReferenceProps, ReferenceSlots, ReferenceState } from './components/Reference/index';\nexport {\n Reference,\n referenceClassNames,\n referenceExtraClassNames,\n renderReference_unstable,\n useReferenceStyles_unstable,\n useReference_unstable,\n} from './components/Reference/index';\n"],"names":["Reference","referenceClassNames","referenceExtraClassNames","renderReference_unstable","useReferenceStyles_unstable","useReference_unstable"],"rangeMappings":"","mappings":"AACA,SACEA,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,wBAAwB,EACxBC,2BAA2B,EAC3BC,qBAAqB,QAChB,+BAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReferenceList, referenceListClassNames, renderReferenceList_unstable, useReferenceListStyles_unstable, useReferenceList_unstable } from './components/ReferenceList/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceList.ts"],"sourcesContent":["export type {\n ReferenceListContextValues,\n ReferenceListProps,\n ReferenceListSlots,\n ReferenceListState,\n} from './components/ReferenceList/index';\nexport {\n ReferenceList,\n referenceListClassNames,\n renderReferenceList_unstable,\n useReferenceListStyles_unstable,\n useReferenceList_unstable,\n} from './components/ReferenceList/index';\n"],"names":["ReferenceList","referenceListClassNames","renderReferenceList_unstable","useReferenceListStyles_unstable","useReferenceList_unstable"],"rangeMappings":"","mappings":"AAMA,SACEA,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,mCAAmC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReferenceOverflowButton, referenceOverflowButtonClassNames, renderReferenceOverflowButton_unstable, useReferenceOverflowButtonStyles_unstable, useReferenceOverflowButton_unstable } from './components/ReferenceOverflowButton/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceOverflowButton.ts"],"sourcesContent":["export type {\n ReferenceOverflowButtonProps,\n ReferenceOverflowButtonSlots,\n ReferenceOverflowButtonState,\n} from './components/ReferenceOverflowButton/index';\nexport {\n ReferenceOverflowButton,\n referenceOverflowButtonClassNames,\n renderReferenceOverflowButton_unstable,\n useReferenceOverflowButtonStyles_unstable,\n useReferenceOverflowButton_unstable,\n} from './components/ReferenceOverflowButton/index';\n"],"names":["ReferenceOverflowButton","referenceOverflowButtonClassNames","renderReferenceOverflowButton_unstable","useReferenceOverflowButtonStyles_unstable","useReferenceOverflowButton_unstable"],"rangeMappings":"","mappings":"AAKA,SACEA,uBAAuB,EACvBC,iCAAiC,EACjCC,sCAAsC,EACtCC,yCAAyC,EACzCC,mCAAmC,QAC9B,6CAA6C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCitation_unstable } from './useCitation';
|
|
3
|
+
import { renderCitation_unstable } from './renderCitation';
|
|
4
|
+
import { useCitationStyles_unstable } from './useCitationStyles.styles';
|
|
5
|
+
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
6
|
+
// Citation component - TODO: add more docs
|
|
7
|
+
export const Citation = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
8
|
+
const state = useCitation_unstable(props, ref);
|
|
9
|
+
useCitationStyles_unstable(state);
|
|
10
|
+
useCustomStyleHook('useCitationStyles')(state);
|
|
11
|
+
return renderCitation_unstable(state);
|
|
12
|
+
});
|
|
13
|
+
Citation.displayName = 'Citation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Citation.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useCitation_unstable } from './useCitation';\nimport { renderCitation_unstable } from './renderCitation';\nimport { useCitationStyles_unstable } from './useCitationStyles.styles';\nimport type { CitationProps } from './Citation.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\n// Citation component - TODO: add more docs\nexport const Citation: ForwardRefComponent<CitationProps> = React.forwardRef((props, ref) => {\n const state = useCitation_unstable(props, ref);\n\n useCitationStyles_unstable(state);\n useCustomStyleHook('useCitationStyles')(state);\n\n return renderCitation_unstable(state);\n});\n\nCitation.displayName = 'Citation';\n"],"names":["React","useCitation_unstable","renderCitation_unstable","useCitationStyles_unstable","useCustomStyleHook","Citation","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,6BAA6B;AAGxE,SAASC,kBAAkB,QAAQ,mCAAmC;AAEtE,2CAA2C;AAC3C,OAAO,MAAMC,yBAA+CL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACnF,MAAMC,QAAQR,qBAAqBM,OAAOC;IAE1CL,2BAA2BM;IAC3BL,mBAAmB,qBAAqBK;IAExC,OAAOP,wBAAwBO;AACjC,GAAG;AAEHJ,SAASK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Citation.types.ts"],"sourcesContent":["import type { DesignVersion } from '@fluentui-copilot/react-provider';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type CitationSlots = {\n /**\n * The root slot.\n */\n root: NonNullable<Slot<'a'>>;\n};\n\n/**\n * Citation Props\n */\nexport type CitationProps = ComponentProps<Partial<CitationSlots>> &\n DesignVersion & {\n /**\n * HREF to the associated `Reference`.\n */\n referenceHref?: string;\n\n /**\n * Whether the citation is a block citation and has no built in margins.\n * Citations are inline by default with margins to separate them from inline text.\n */\n block?: boolean;\n };\n\n/**\n * State used in rendering Citation\n */\nexport type CitationState = ComponentState<CitationSlots> &\n Required<Pick<CitationProps, 'block' | 'designVersion'>> & {\n isPopoverLocked: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AA2BA;;CAEC,GACD,WAGI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { Citation } from './Citation';\nexport type { CitationProps, CitationSlots, CitationState } from './Citation.types';\nexport { renderCitation_unstable } from './renderCitation';\nexport { useCitation_unstable } from './useCitation';\nexport { citationClassNames, useCitationStyles_unstable } from './useCitationStyles.styles';\n"],"names":["Citation","renderCitation_unstable","useCitation_unstable","citationClassNames","useCitationStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,QAAQ,QAAQ,aAAa;AAEtC,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,kBAAkB,EAAEC,0BAA0B,QAAQ,6BAA6B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from '@fluentui/react-components';
|
|
3
|
+
/**
|
|
4
|
+
* Render the final JSX of Citation
|
|
5
|
+
*/ export const renderCitation_unstable = (state)=>{
|
|
6
|
+
assertSlots(state);
|
|
7
|
+
return /*#__PURE__*/ _jsx(state.root, {});
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderCitation.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { CitationState, CitationSlots } from './Citation.types';\nimport type { JSXElement } from '@fluentui/react-components';\n/**\n * Render the final JSX of Citation\n */\nexport const renderCitation_unstable = (state: CitationState): JSXElement => {\n assertSlots<CitationSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderCitation_unstable","state","root"],"rangeMappings":";;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,0BAA0B,CAACC;IACtCF,YAA2BE;IAE3B,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getIntrinsicElementProps, slot } from '@fluentui/react-components';
|
|
2
|
+
import { usePreviewContext_unstable } from '@fluentui-copilot/react-preview';
|
|
3
|
+
import { useDesignVersion } from '@fluentui-copilot/react-provider';
|
|
4
|
+
/**
|
|
5
|
+
* Create the state required to render Citation.
|
|
6
|
+
*
|
|
7
|
+
* The returned state can be modified with hooks such as useCitationStyles_unstable,
|
|
8
|
+
* before being passed to renderCitation_unstable.
|
|
9
|
+
*
|
|
10
|
+
* @param props - props from this instance of Citation
|
|
11
|
+
* @param ref - reference to root HTMLElement of Citation
|
|
12
|
+
*/ export const useCitation_unstable = (props, ref)=>{
|
|
13
|
+
const { referenceHref, block = false, ...otherProps } = props;
|
|
14
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
15
|
+
const isPopoverLocked = usePreviewContext_unstable((ctx)=>ctx.isPreviewLocked) && props['aria-expanded'];
|
|
16
|
+
const state = {
|
|
17
|
+
block,
|
|
18
|
+
designVersion,
|
|
19
|
+
isPopoverLocked,
|
|
20
|
+
components: {
|
|
21
|
+
root: 'a'
|
|
22
|
+
},
|
|
23
|
+
root: slot.always(getIntrinsicElementProps('a', {
|
|
24
|
+
ref,
|
|
25
|
+
href: referenceHref,
|
|
26
|
+
role: undefined,
|
|
27
|
+
'aria-expanded': undefined,
|
|
28
|
+
...otherProps
|
|
29
|
+
}), {
|
|
30
|
+
elementType: 'a'
|
|
31
|
+
})
|
|
32
|
+
};
|
|
33
|
+
return state;
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useCitation.ts"],"sourcesContent":["import { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport { usePreviewContext_unstable } from '@fluentui-copilot/react-preview';\nimport type { CitationProps, CitationState } from './Citation.types';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\n/**\n * Create the state required to render Citation.\n *\n * The returned state can be modified with hooks such as useCitationStyles_unstable,\n * before being passed to renderCitation_unstable.\n *\n * @param props - props from this instance of Citation\n * @param ref - reference to root HTMLElement of Citation\n */\nexport const useCitation_unstable = (props: CitationProps, ref: React.Ref<HTMLAnchorElement>): CitationState => {\n const { referenceHref, block = false, ...otherProps } = props;\n const designVersion = useDesignVersion(props.designVersion);\n\n const isPopoverLocked = usePreviewContext_unstable(ctx => ctx.isPreviewLocked) && (props['aria-expanded'] as boolean);\n\n const state: CitationState = {\n block,\n designVersion,\n isPopoverLocked,\n components: {\n root: 'a',\n },\n root: slot.always(\n getIntrinsicElementProps('a', {\n ref,\n href: referenceHref,\n role: undefined,\n 'aria-expanded': undefined,\n ...otherProps,\n }),\n { elementType: 'a' },\n ),\n };\n\n return state;\n};\n"],"names":["getIntrinsicElementProps","slot","usePreviewContext_unstable","useDesignVersion","useCitation_unstable","props","ref","referenceHref","block","otherProps","designVersion","isPopoverLocked","ctx","isPreviewLocked","state","components","root","always","href","role","undefined","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,6BAA6B;AAC5E,SAASC,0BAA0B,QAAQ,kCAAkC;AAE7E,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE;;;;;;;;CAQC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAsBC;IACzD,MAAM,EAAEC,aAAa,EAAEC,QAAQ,KAAK,EAAE,GAAGC,YAAY,GAAGJ;IACxD,MAAMK,gBAAgBP,iBAAiBE,MAAMK,aAAa;IAE1D,MAAMC,kBAAkBT,2BAA2BU,CAAAA,MAAOA,IAAIC,eAAe,KAAMR,KAAK,CAAC,gBAAgB;IAEzG,MAAMS,QAAuB;QAC3BN;QACAE;QACAC;QACAI,YAAY;YACVC,MAAM;QACR;QACAA,MAAMf,KAAKgB,MAAM,CACfjB,yBAAyB,KAAK;YAC5BM;YACAY,MAAMX;YACNY,MAAMC;YACN,iBAAiBA;YACjB,GAAGX,UAAU;QACf,IACA;YAAEY,aAAa;QAAI;IAEvB;IAEA,OAAOP;AACT,EAAE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { __resetStyles, __styles, mergeClasses, shorthands } from '@fluentui/react-components';
|
|
2
|
+
import { tokens, typographyStyles } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const citationClassNames = {
|
|
4
|
+
root: 'fai-Citation'
|
|
5
|
+
};
|
|
6
|
+
const useCitationBaseClassName = __resetStyles("r1jm3di4", "r6zn0t3", [".r1jm3di4{display:inline-flex;justify-content:center;box-sizing:border-box;align-items:center;cursor:pointer;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightBold);line-height:var(--lineHeightBase200);background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);color:var(--colorNeutralForeground2);min-width:14px;height:14px;vertical-align:calc((var(--lineHeightBase200) - var(--fontSizeBase100)) / 2);padding-inline:var(--spacingHorizontalXXS);border-radius:var(--borderRadiusMedium);text-decoration:none;margin-left:var(--spacingHorizontalXXS);margin-right:var(--spacingHorizontalXXS);}", ".r1jm3di4:hover{cursor:pointer;color:var(--colorBrandForeground2Hover);border-color:var(--colorBrandStroke2Hover);background-color:var(--colorBrandBackground2Hover);}", ".r1jm3di4:hover:active{cursor:pointer;color:var(--colorBrandForeground2Pressed);border-color:var(--colorBrandStroke2Pressed);background-color:var(--colorBrandBackground2Pressed);}", ".r6zn0t3{display:inline-flex;justify-content:center;box-sizing:border-box;align-items:center;cursor:pointer;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightBold);line-height:var(--lineHeightBase200);background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);color:var(--colorNeutralForeground2);min-width:14px;height:14px;vertical-align:calc((var(--lineHeightBase200) - var(--fontSizeBase100)) / 2);padding-inline:var(--spacingHorizontalXXS);border-radius:var(--borderRadiusMedium);text-decoration:none;margin-right:var(--spacingHorizontalXXS);margin-left:var(--spacingHorizontalXXS);}", ".r6zn0t3:hover{cursor:pointer;color:var(--colorBrandForeground2Hover);border-color:var(--colorBrandStroke2Hover);background-color:var(--colorBrandBackground2Hover);}", ".r6zn0t3:hover:active{cursor:pointer;color:var(--colorBrandForeground2Pressed);border-color:var(--colorBrandStroke2Pressed);background-color:var(--colorBrandBackground2Pressed);}"]);
|
|
7
|
+
const useCitationRootStyles = __styles({
|
|
8
|
+
isBlock: {
|
|
9
|
+
mc9l5x: "f22iagw",
|
|
10
|
+
Frg6f3: ["f1tyq0we", "f11qmguv"],
|
|
11
|
+
t21cq0: ["f11qmguv", "f1tyq0we"]
|
|
12
|
+
},
|
|
13
|
+
isPopoverLocked: {
|
|
14
|
+
sj55zd: "fkjhhq2",
|
|
15
|
+
g2u3we: "f1nbqb3e",
|
|
16
|
+
h3c5rm: ["fah3j9v", "f56crja"],
|
|
17
|
+
B9xav0g: "fef4ti1",
|
|
18
|
+
zhjwy3: ["f56crja", "fah3j9v"],
|
|
19
|
+
De3pzq: "f16xkysk",
|
|
20
|
+
Bi91k9c: "fbszb7v",
|
|
21
|
+
Bgoe8wy: "ftxwbyd",
|
|
22
|
+
Bwzppfd: ["f1p7dilp", "f15x2k42"],
|
|
23
|
+
oetu4i: "fegdlwn",
|
|
24
|
+
gg5e9n: ["f15x2k42", "f1p7dilp"],
|
|
25
|
+
Jwef8y: "f121v1wq"
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
d: [".f22iagw{display:flex;}", ".f1tyq0we{margin-left:0;}", ".f11qmguv{margin-right:0;}", ".fkjhhq2{color:var(--colorBrandForeground2Pressed);}", ".f1nbqb3e{border-top-color:var(--colorBrandStroke2Pressed);}", ".fah3j9v{border-right-color:var(--colorBrandStroke2Pressed);}", ".f56crja{border-left-color:var(--colorBrandStroke2Pressed);}", ".fef4ti1{border-bottom-color:var(--colorBrandStroke2Pressed);}", ".f16xkysk{background-color:var(--colorBrandBackground2);}"],
|
|
29
|
+
h: [".fbszb7v:hover{color:var(--colorBrandForeground2Pressed);}", ".ftxwbyd:hover{border-top-color:var(--colorBrandStroke2Pressed);}", ".f1p7dilp:hover{border-right-color:var(--colorBrandStroke2Pressed);}", ".f15x2k42:hover{border-left-color:var(--colorBrandStroke2Pressed);}", ".fegdlwn:hover{border-bottom-color:var(--colorBrandStroke2Pressed);}", ".f121v1wq:hover{background-color:var(--colorBrandBackground2);}"]
|
|
30
|
+
});
|
|
31
|
+
const useNextStyles = __styles({
|
|
32
|
+
root: {
|
|
33
|
+
Beyfa6y: 0,
|
|
34
|
+
Bbmb7ep: 0,
|
|
35
|
+
Btl43ni: 0,
|
|
36
|
+
B7oj6ja: 0,
|
|
37
|
+
Dimara: "f1kijzfu"
|
|
38
|
+
}
|
|
39
|
+
}, {
|
|
40
|
+
d: [[".f1kijzfu{border-radius:var(--borderRadiusXLarge);}", {
|
|
41
|
+
p: -1
|
|
42
|
+
}]]
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Apply styling to the Citation slots based on the state
|
|
46
|
+
*/
|
|
47
|
+
export const useCitationStyles_unstable = state => {
|
|
48
|
+
'use no memo';
|
|
49
|
+
|
|
50
|
+
const {
|
|
51
|
+
designVersion
|
|
52
|
+
} = state;
|
|
53
|
+
const rootBaseClassName = useCitationBaseClassName();
|
|
54
|
+
const rootStyles = useCitationRootStyles();
|
|
55
|
+
const nextStyles = useNextStyles();
|
|
56
|
+
state.root.className = mergeClasses(citationClassNames.root, state.isPopoverLocked && rootStyles.isPopoverLocked, state.block && rootStyles.isBlock, rootBaseClassName, designVersion === 'next' && nextStyles.root, state.root.className);
|
|
57
|
+
return state;
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=useCitationStyles.styles.js.map
|
|
@@ -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":["makeResetStyles","makeStyles","mergeClasses","shorthands","tokens","typographyStyles","citationClassNames","root","useCitationBaseClassName","display","justifyContent","boxSizing","alignItems","cursor","caption2Strong","backgroundColor","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","isBlock","isPopoverLocked","colorBrandBackground2","useNextStyles","borderRadiusXLarge","useCitationStyles_unstable","state","designVersion","rootBaseClassName","rootStyles","nextStyles","className","block"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,EAAEC,UAAU,QAAQ,6BAA6B;AACnG,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,2BAA2B;AAIpE,OAAO,MAAMC,qBAAoD;IAC/DC,MAAM;AACR,EAAE;AAEF,MAAMC,2BAA2BR,gBAAgB;IAC/CS,SAAS;IACTC,gBAAgB;IAChBC,WAAW;IACXC,YAAY;IACZC,QAAQ;IACR,GAAGR,iBAAiBS,cAAc;IAElCC,iBAAiBX,OAAOY,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEb,OAAOc,eAAe,CAAC,OAAO,EAAEd,OAAOe,mBAAmB,CAAC,CAAC;IACvEC,OAAOhB,OAAOiB,uBAAuB;IAErCC,UAAU;IACVC,QAAQ;IACRC,eAAe,CAAC,MAAM,EAAEnB,iBAAiBS,cAAc,CAACW,UAAU,CAAC,GAAG,EAAEpB,iBAAiBS,cAAc,CAACY,QAAQ,CAAC,MAAM,CAAC;IACxHC,eAAevB,OAAOwB,oBAAoB;IAE1CC,cAAczB,OAAO0B,kBAAkB;IAEvCC,gBAAgB;IAEhBC,YAAY5B,OAAOwB,oBAAoB;IACvCK,aAAa7B,OAAOwB,oBAAoB;IAExC,UAAU;QACRf,QAAQ;QACRO,OAAOhB,OAAO8B,0BAA0B;QACxCC,aAAa/B,OAAOgC,sBAAsB;QAC1CrB,iBAAiBX,OAAOiC,0BAA0B;IACpD;IAEA,iBAAiB;QACfxB,QAAQ;QACRO,OAAOhB,OAAOkC,4BAA4B;QAC1CH,aAAa/B,OAAOmC,wBAAwB;QAC5CxB,iBAAiBX,OAAOoC,4BAA4B;IACtD;AACF;AAEA,MAAMC,wBAAwBxC,WAAW;IACvCyC,SAAS;QACPjC,SAAS;QACTuB,YAAY;QACZC,aAAa;IACf;IACAU,iBAAiB;QACfvB,OAAOhB,OAAOkC,4BAA4B;QAC1C,GAAGnC,WAAWgC,WAAW,CAAC/B,OAAOmC,wBAAwB,CAAC;QAC1DxB,iBAAiBX,OAAOwC,qBAAqB;QAC7C,UAAU;YACRxB,OAAOhB,OAAOkC,4BAA4B;YAC1C,GAAGnC,WAAWgC,WAAW,CAAC/B,OAAOmC,wBAAwB,CAAC;YAC1DxB,iBAAiBX,OAAOwC,qBAAqB;QAC/C;IACF;AACF;AAEA,MAAMC,gBAAgB5C,WAAW;IAAEM,MAAM;QAAEsB,cAAczB,OAAO0C,kBAAkB;IAAC;AAAE;AAErF;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzC;IAEA,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAE1B,MAAME,oBAAoB1C;IAC1B,MAAM2C,aAAaV;IACnB,MAAMW,aAAaP;IAEnBG,MAAMzC,IAAI,CAAC8C,SAAS,GAAGnD,aACrBI,mBAAmBC,IAAI,EACvByC,MAAML,eAAe,IAAIQ,WAAWR,eAAe,EACnDK,MAAMM,KAAK,IAAIH,WAAWT,OAAO,EACjCQ,mBACAD,kBAAkB,UAAUG,WAAW7C,IAAI,EAC3CyC,MAAMzC,IAAI,CAAC8C,SAAS;IAGtB,OAAOL;AACT,EAAE"}
|