@fluentui-copilot/react-reference 0.0.0-nightly-20240313-0404-8abc883d.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 +943 -0
- package/CHANGELOG.md +281 -0
- package/LICENSE +23 -0
- package/README.md +5 -0
- package/dist/index.d.ts +539 -0
- package/lib/Citation.js +2 -0
- package/lib/Citation.js.map +1 -0
- package/lib/Reference.js +2 -0
- package/lib/Reference.js.map +1 -0
- package/lib/ReferenceGroup.js +2 -0
- package/lib/ReferenceGroup.js.map +1 -0
- package/lib/ReferenceGroupToggle.js +2 -0
- package/lib/ReferenceGroupToggle.js.map +1 -0
- package/lib/ReferenceList.js +2 -0
- package/lib/ReferenceList.js.map +1 -0
- package/lib/components/Citation/Citation.js +14 -0
- package/lib/components/Citation/Citation.js.map +1 -0
- package/lib/components/Citation/Citation.types.js +2 -0
- package/lib/components/Citation/Citation.types.js.map +1 -0
- package/lib/components/Citation/index.js +6 -0
- package/lib/components/Citation/index.js.map +1 -0
- package/lib/components/Citation/renderCitation.js +29 -0
- package/lib/components/Citation/renderCitation.js.map +1 -0
- package/lib/components/Citation/useCitation.js +191 -0
- package/lib/components/Citation/useCitation.js.map +1 -0
- package/lib/components/Citation/useCitationStyles.js +44 -0
- package/lib/components/Citation/useCitationStyles.js.map +1 -0
- package/lib/components/Reference/Reference.js +14 -0
- package/lib/components/Reference/Reference.js.map +1 -0
- package/lib/components/Reference/Reference.types.js +2 -0
- package/lib/components/Reference/Reference.types.js.map +1 -0
- package/lib/components/Reference/index.js +6 -0
- package/lib/components/Reference/index.js.map +1 -0
- package/lib/components/Reference/renderReference.js +16 -0
- package/lib/components/Reference/renderReference.js.map +1 -0
- package/lib/components/Reference/useReference.js +197 -0
- package/lib/components/Reference/useReference.js.map +1 -0
- package/lib/components/Reference/useReferenceStyles.js +253 -0
- package/lib/components/Reference/useReferenceStyles.js.map +1 -0
- package/lib/components/ReferenceGroup/ReferenceGroup.js +19 -0
- package/lib/components/ReferenceGroup/ReferenceGroup.js.map +1 -0
- package/lib/components/ReferenceGroup/ReferenceGroup.types.js +2 -0
- package/lib/components/ReferenceGroup/ReferenceGroup.types.js.map +1 -0
- package/lib/components/ReferenceGroup/index.js +6 -0
- package/lib/components/ReferenceGroup/index.js.map +1 -0
- package/lib/components/ReferenceGroup/renderReferenceGroup.js +21 -0
- package/lib/components/ReferenceGroup/renderReferenceGroup.js.map +1 -0
- package/lib/components/ReferenceGroup/useReferenceGroup.js +104 -0
- package/lib/components/ReferenceGroup/useReferenceGroup.js.map +1 -0
- package/lib/components/ReferenceGroup/useReferenceGroupContextValues.js +10 -0
- package/lib/components/ReferenceGroup/useReferenceGroupContextValues.js.map +1 -0
- package/lib/components/ReferenceGroup/useReferenceGroupStyles.js +50 -0
- package/lib/components/ReferenceGroup/useReferenceGroupStyles.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js +12 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +2 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/index.js +6 -0
- package/lib/components/ReferenceGroupToggle/index.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/renderReferenceGroupToggle.js +12 -0
- package/lib/components/ReferenceGroupToggle/renderReferenceGroupToggle.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js +40 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js +20 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +1 -0
- package/lib/components/ReferenceList/ReferenceList.js +14 -0
- package/lib/components/ReferenceList/ReferenceList.js.map +1 -0
- package/lib/components/ReferenceList/ReferenceList.types.js +2 -0
- package/lib/components/ReferenceList/ReferenceList.types.js.map +1 -0
- package/lib/components/ReferenceList/index.js +6 -0
- package/lib/components/ReferenceList/index.js.map +1 -0
- package/lib/components/ReferenceList/renderReferenceList.js +10 -0
- package/lib/components/ReferenceList/renderReferenceList.js.map +1 -0
- package/lib/components/ReferenceList/useReferenceList.js +30 -0
- package/lib/components/ReferenceList/useReferenceList.js.map +1 -0
- package/lib/components/ReferenceList/useReferenceListStyles.js +17 -0
- package/lib/components/ReferenceList/useReferenceListStyles.js.map +1 -0
- package/lib/context/ReferenceGroupContext.js +11 -0
- package/lib/context/ReferenceGroupContext.js.map +1 -0
- package/lib/hooks/index.js +4 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useReferenceCitation.js +77 -0
- package/lib/hooks/useReferenceCitation.js.map +1 -0
- package/lib/hooks/useReferenceCitationPreview.js +128 -0
- package/lib/hooks/useReferenceCitationPreview.js.map +1 -0
- package/lib/hooks/useReferenceGroup.js +40 -0
- package/lib/hooks/useReferenceGroup.js.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/lib-commonjs/Citation.js +7 -0
- package/lib-commonjs/Citation.js.map +1 -0
- package/lib-commonjs/Reference.js +7 -0
- package/lib-commonjs/Reference.js.map +1 -0
- package/lib-commonjs/ReferenceGroup.js +7 -0
- package/lib-commonjs/ReferenceGroup.js.map +1 -0
- package/lib-commonjs/ReferenceGroupToggle.js +7 -0
- package/lib-commonjs/ReferenceGroupToggle.js.map +1 -0
- package/lib-commonjs/ReferenceList.js +7 -0
- package/lib-commonjs/ReferenceList.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 +5 -0
- package/lib-commonjs/components/Citation/Citation.types.js.map +1 -0
- package/lib-commonjs/components/Citation/index.js +11 -0
- package/lib-commonjs/components/Citation/index.js.map +1 -0
- package/lib-commonjs/components/Citation/renderCitation.js +38 -0
- package/lib-commonjs/components/Citation/renderCitation.js.map +1 -0
- package/lib-commonjs/components/Citation/useCitation.js +185 -0
- package/lib-commonjs/components/Citation/useCitation.js.map +1 -0
- package/lib-commonjs/components/Citation/useCitationStyles.js +100 -0
- package/lib-commonjs/components/Citation/useCitationStyles.js.map +1 -0
- package/lib-commonjs/components/Reference/Reference.js +23 -0
- package/lib-commonjs/components/Reference/Reference.js.map +1 -0
- package/lib-commonjs/components/Reference/Reference.types.js +5 -0
- package/lib-commonjs/components/Reference/Reference.types.js.map +1 -0
- package/lib-commonjs/components/Reference/index.js +11 -0
- package/lib-commonjs/components/Reference/index.js.map +1 -0
- package/lib-commonjs/components/Reference/renderReference.js +40 -0
- package/lib-commonjs/components/Reference/renderReference.js.map +1 -0
- package/lib-commonjs/components/Reference/useReference.js +201 -0
- package/lib-commonjs/components/Reference/useReference.js.map +1 -0
- package/lib-commonjs/components/Reference/useReferenceStyles.js +454 -0
- package/lib-commonjs/components/Reference/useReferenceStyles.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.js +25 -0
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.types.js +5 -0
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.types.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/index.js +11 -0
- package/lib-commonjs/components/ReferenceGroup/index.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/renderReferenceGroup.js +33 -0
- package/lib-commonjs/components/ReferenceGroup/renderReferenceGroup.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroup.js +103 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroup.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupContextValues.js +23 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupContextValues.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupStyles.js +75 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupStyles.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js +21 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +5 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/index.js +11 -0
- package/lib-commonjs/components/ReferenceGroupToggle/index.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js +21 -0
- package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js +39 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js +39 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.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 +5 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.types.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/index.js +11 -0
- package/lib-commonjs/components/ReferenceList/index.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/renderReferenceList.js +16 -0
- package/lib-commonjs/components/ReferenceList/renderReferenceList.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/useReferenceList.js +30 -0
- package/lib-commonjs/components/ReferenceList/useReferenceList.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.js +36 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.js.map +1 -0
- package/lib-commonjs/context/ReferenceGroupContext.js +29 -0
- package/lib-commonjs/context/ReferenceGroupContext.js.map +1 -0
- package/lib-commonjs/hooks/index.js +15 -0
- package/lib-commonjs/hooks/index.js.map +1 -0
- package/lib-commonjs/hooks/useReferenceCitation.js +78 -0
- package/lib-commonjs/hooks/useReferenceCitation.js.map +1 -0
- package/lib-commonjs/hooks/useReferenceCitationPreview.js +141 -0
- package/lib-commonjs/hooks/useReferenceCitationPreview.js.map +1 -0
- package/lib-commonjs/hooks/useReferenceGroup.js +49 -0
- package/lib-commonjs/hooks/useReferenceGroup.js.map +1 -0
- package/lib-commonjs/index.js +103 -0
- package/lib-commonjs/index.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { buttonClassNames, __resetStyles, __styles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';
|
|
2
|
+
export const referenceClassNames = {
|
|
3
|
+
root: 'fai-Reference',
|
|
4
|
+
citation: 'fai-Reference__citation',
|
|
5
|
+
media: 'fai-Reference__media',
|
|
6
|
+
actions: 'fai-Reference__actions',
|
|
7
|
+
sensitivity: 'fai-Reference__sensitivity',
|
|
8
|
+
sensitivityLabel: 'fai-Reference__sensitivityLabel',
|
|
9
|
+
metadata: 'fai-Reference__metadata',
|
|
10
|
+
primaryText: 'fai-Reference__primaryText',
|
|
11
|
+
secondaryText: 'fai-Reference__secondaryText',
|
|
12
|
+
tertiaryText: 'fai-Reference__tertiaryText',
|
|
13
|
+
icon: 'fai-Reference__icon',
|
|
14
|
+
label: 'fai-Reference__label',
|
|
15
|
+
content: 'fai-Reference__content',
|
|
16
|
+
detailsButton: 'fai-Reference__detailsButton'
|
|
17
|
+
};
|
|
18
|
+
export const referenceExtraClassNames = {
|
|
19
|
+
text: 'fai-Reference__text',
|
|
20
|
+
mediaChild: 'fai-Reference__mediaChild'
|
|
21
|
+
};
|
|
22
|
+
const labelFontSize = typographyStyles.caption1Strong.fontSize;
|
|
23
|
+
const labelLineHeight = typographyStyles.caption1Strong.lineHeight;
|
|
24
|
+
const maxPopoverWidth = '256px';
|
|
25
|
+
const useReferenceClassName = __resetStyles("r8mog99", null, [".r8mog99{box-sizing:border-box;width:100%;display:grid;grid-template-areas:\"citation media title actions\" \". . title .\" \"sensitivityLabel sensitivityLabel sensitivityLabel sensitivityLabel\" \"metadata metadata metadata metadata\" \"content content content content\";grid-template-columns:min-content min-content 1fr min-content;grid-template-rows:32px auto auto auto auto;border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);padding:var(--spacingVerticalS) var(--spacingHorizontalS);box-shadow:none;column-gap:var(--spacingHorizontalXS);align-items:center;}"]);
|
|
26
|
+
const useStyles = __styles({
|
|
27
|
+
canvas: {},
|
|
28
|
+
sidecar: {
|
|
29
|
+
wkccdc: "f2e0fxj",
|
|
30
|
+
z8tnut: "f1ywm7hm",
|
|
31
|
+
z189sj: ["f1vdfbxk", "f1f5gg8d"],
|
|
32
|
+
Byoj8tv: "f14wxoun",
|
|
33
|
+
uwmqm3: ["f1f5gg8d", "f1vdfbxk"]
|
|
34
|
+
},
|
|
35
|
+
inline: {},
|
|
36
|
+
popover: {
|
|
37
|
+
B4j52fo: "f1pit55b",
|
|
38
|
+
Bekrc4i: ["f1orqat1", "ffbvwxd"],
|
|
39
|
+
Bn0qgzm: "f136mcbi",
|
|
40
|
+
ibv6hh: ["ffbvwxd", "f1orqat1"],
|
|
41
|
+
a9b677: "f1uniyfe",
|
|
42
|
+
z8tnut: "f1nbblvp",
|
|
43
|
+
z189sj: ["fifp7yv", "f1asdtw4"],
|
|
44
|
+
Byoj8tv: "f1ov4xf1",
|
|
45
|
+
uwmqm3: ["f1asdtw4", "fifp7yv"]
|
|
46
|
+
},
|
|
47
|
+
closed: {
|
|
48
|
+
Belr9w4: "f1sff6ri"
|
|
49
|
+
},
|
|
50
|
+
citation: {
|
|
51
|
+
Ijaq50: "fwllpr6",
|
|
52
|
+
Br312pm: "fx0qcsv",
|
|
53
|
+
nk6f5a: "f1ldxewp",
|
|
54
|
+
Bw0ie65: "ftmncab"
|
|
55
|
+
},
|
|
56
|
+
media: {
|
|
57
|
+
Ijaq50: "f11uok23",
|
|
58
|
+
Br312pm: "f1qdfnnj",
|
|
59
|
+
nk6f5a: "f1s27gz",
|
|
60
|
+
Bw0ie65: "f86d0yl",
|
|
61
|
+
mc9l5x: "f22iagw",
|
|
62
|
+
Bt984gj: "f122n59",
|
|
63
|
+
Brf1p80: "f4d9j23"
|
|
64
|
+
},
|
|
65
|
+
mediaPopover: {
|
|
66
|
+
a9b677: "fjw5fx7",
|
|
67
|
+
Bqenvij: "fd461yt",
|
|
68
|
+
psn4ub: "fe9dio4",
|
|
69
|
+
vf399t: "f1ojxjpn"
|
|
70
|
+
},
|
|
71
|
+
actions: {
|
|
72
|
+
Ijaq50: "f16hsg94",
|
|
73
|
+
Br312pm: "f35n22n",
|
|
74
|
+
nk6f5a: "fh3uimt",
|
|
75
|
+
Bw0ie65: "fnh4yke",
|
|
76
|
+
Bdqf98w: "f1a7i8kp",
|
|
77
|
+
mc9l5x: "f22iagw"
|
|
78
|
+
},
|
|
79
|
+
detailsButton: {
|
|
80
|
+
D5xksd: "fzmnlw3"
|
|
81
|
+
},
|
|
82
|
+
sensitivity: {
|
|
83
|
+
Ijaq50: "fpymh5q",
|
|
84
|
+
Br312pm: "fjieyc3",
|
|
85
|
+
nk6f5a: "f18utan",
|
|
86
|
+
Bw0ie65: "f15c84mf",
|
|
87
|
+
Bdqf98w: "fsxvdwy"
|
|
88
|
+
},
|
|
89
|
+
sensitivityLabel: {
|
|
90
|
+
B6of3ja: "fww94b8",
|
|
91
|
+
De3pzq: "f3vzo32",
|
|
92
|
+
B4j52fo: "f192inf7",
|
|
93
|
+
Bekrc4i: ["f5tn483", "f1ojsxk5"],
|
|
94
|
+
Bn0qgzm: "f1vxd6vx",
|
|
95
|
+
ibv6hh: ["f1ojsxk5", "f5tn483"],
|
|
96
|
+
icvyot: "fzkkow9",
|
|
97
|
+
vrafjx: ["fcdblym", "fjik90z"],
|
|
98
|
+
oivjwe: "fg706s2",
|
|
99
|
+
wvpqe5: ["fjik90z", "fcdblym"],
|
|
100
|
+
g2u3we: "fghlq4f",
|
|
101
|
+
h3c5rm: ["f1gn591s", "fjscplz"],
|
|
102
|
+
B9xav0g: "fb073pr",
|
|
103
|
+
zhjwy3: ["fjscplz", "f1gn591s"],
|
|
104
|
+
Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
|
|
105
|
+
Beyfa6y: ["f16jpd5f", "f1aa9q02"],
|
|
106
|
+
B7oj6ja: ["f1jar5jt", "fyu767a"],
|
|
107
|
+
Btl43ni: ["fyu767a", "f1jar5jt"],
|
|
108
|
+
Ijaq50: "fpymh5q",
|
|
109
|
+
Br312pm: "fjieyc3",
|
|
110
|
+
nk6f5a: "f18utan",
|
|
111
|
+
Bw0ie65: "f15c84mf",
|
|
112
|
+
Bdqf98w: "fsxvdwy",
|
|
113
|
+
z8tnut: "f1g0x7ka",
|
|
114
|
+
z189sj: ["fdw0yi8", "fk8j09s"],
|
|
115
|
+
Byoj8tv: "f1qch9an",
|
|
116
|
+
uwmqm3: ["fk8j09s", "fdw0yi8"],
|
|
117
|
+
Bahqtrf: "fk6fouc",
|
|
118
|
+
Be2twd7: "f13mqy1h",
|
|
119
|
+
Bhrd7zp: "figsok6",
|
|
120
|
+
Bg96gwp: "fcpl73t"
|
|
121
|
+
},
|
|
122
|
+
metadata: {
|
|
123
|
+
B6of3ja: "fww94b8",
|
|
124
|
+
Ijaq50: "f1md2vp3",
|
|
125
|
+
Br312pm: "f1y0qc5c",
|
|
126
|
+
nk6f5a: "f179ty8e",
|
|
127
|
+
Bw0ie65: "f83o9dc",
|
|
128
|
+
Bahqtrf: "fk6fouc",
|
|
129
|
+
Be2twd7: "f13mqy1h",
|
|
130
|
+
Bhrd7zp: "figsok6",
|
|
131
|
+
Bg96gwp: "fcpl73t"
|
|
132
|
+
},
|
|
133
|
+
metadataSubsequentText: {
|
|
134
|
+
qhf8xq: "f10pi13n",
|
|
135
|
+
Frg6f3: ["foyynoy", "f1vcna3q"],
|
|
136
|
+
Ftih45: "f1wl9k8s",
|
|
137
|
+
Br0sdwz: "f1aocrix",
|
|
138
|
+
Brfgrao: "f1j7ml58",
|
|
139
|
+
Fbdkly: ["f1s1fjay", "f15a459s"],
|
|
140
|
+
Bciustq: "f1wl9tmt",
|
|
141
|
+
Baz25je: "f8pn7wt",
|
|
142
|
+
uvfttm: ["f1x8pvcy", "f9sc749"],
|
|
143
|
+
Bbv0w2i: ["f1jpmc5p", "f1yq6w5o"],
|
|
144
|
+
Bm6vgfq: ["fjml6kk", "f1geml7w"]
|
|
145
|
+
},
|
|
146
|
+
icon: {
|
|
147
|
+
Bahqtrf: "fk6fouc",
|
|
148
|
+
Be2twd7: "f13mqy1h",
|
|
149
|
+
Bhrd7zp: "figsok6",
|
|
150
|
+
Bg96gwp: "fcpl73t",
|
|
151
|
+
ha4doy: "fmrv4ls"
|
|
152
|
+
},
|
|
153
|
+
content: {
|
|
154
|
+
B6of3ja: "fww94b8",
|
|
155
|
+
Ijaq50: "fxwmwwq",
|
|
156
|
+
Br312pm: "f1e0gndy",
|
|
157
|
+
nk6f5a: "f4zz6gv",
|
|
158
|
+
Bw0ie65: "f7idnck",
|
|
159
|
+
mc9l5x: "f22iagw",
|
|
160
|
+
Beiy3e4: "f1vx9l62",
|
|
161
|
+
Belr9w4: "f1wn3y0l",
|
|
162
|
+
sj55zd: "f11d4kpn",
|
|
163
|
+
Biipf1f: "f9ijwd5"
|
|
164
|
+
},
|
|
165
|
+
hidden: {
|
|
166
|
+
mc9l5x: "fjseox"
|
|
167
|
+
}
|
|
168
|
+
}, {
|
|
169
|
+
d: [".f2e0fxj{grid-template-rows:24px auto auto auto;}", ".f1ywm7hm{padding-top:var(--spacingVerticalXS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f14wxoun{padding-bottom:var(--spacingVerticalXS);}", ".f1pit55b{border-top-width:0px;}", ".f1orqat1{border-right-width:0px;}", ".ffbvwxd{border-left-width:0px;}", ".f136mcbi{border-bottom-width:0px;}", ".f1uniyfe{width:calc(256px - (var(--spacingHorizontalM) * 2));}", ".f1nbblvp{padding-top:0px;}", ".fifp7yv{padding-right:0px;}", ".f1asdtw4{padding-left:0px;}", ".f1ov4xf1{padding-bottom:0px;}", ".f1sff6ri{row-gap:0;}", ".fwllpr6{grid-row-start:citation;}", ".fx0qcsv{grid-column-start:citation;}", ".f1ldxewp{grid-row-end:citation;}", ".ftmncab{grid-column-end:citation;}", ".f11uok23{grid-row-start:media;}", ".f1qdfnnj{grid-column-start:media;}", ".f1s27gz{grid-row-end:media;}", ".f86d0yl{grid-column-end:media;}", ".f22iagw{display:flex;}", ".f122n59{align-items:center;}", ".f4d9j23{justify-content:center;}", ".fjw5fx7{width:16px;}", ".fd461yt{height:16px;}", ".fe9dio4>.fai-Reference__mediaChild{width:16px;}", ".f1ojxjpn>.fai-Reference__mediaChild{height:16px;}", ".f16hsg94{grid-row-start:1;}", ".f35n22n{grid-column-start:actions;}", ".fh3uimt{grid-row-end:actions;}", ".fnh4yke{grid-column-end:actions;}", ".f1a7i8kp{justify-self:end;}", ".fzmnlw3>fui-Button__icon{color:var(--colorNeutralForeground3);}", ".fpymh5q{grid-row-start:sensitivityLabel;}", ".fjieyc3{grid-column-start:sensitivityLabel;}", ".f18utan{grid-row-end:sensitivityLabel;}", ".f15c84mf{grid-column-end:sensitivityLabel;}", ".fsxvdwy{justify-self:start;}", ".fww94b8{margin-top:var(--spacingVerticalXS);}", ".f3vzo32{background-color:var(--colorNeutralBackground5);}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f1g0x7ka{padding-top:0;}", ".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".f1qch9an{padding-bottom:0;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fcpl73t{line-height:var(--lineHeightBase100);}", ".f1md2vp3{grid-row-start:metadata;}", ".f1y0qc5c{grid-column-start:metadata;}", ".f179ty8e{grid-row-end:metadata;}", ".f83o9dc{grid-column-end:metadata;}", ".f10pi13n{position:relative;}", ".foyynoy{margin-left:var(--spacingHorizontalS);}", ".f1vcna3q{margin-right:var(--spacingHorizontalS);}", ".f1wl9k8s::before{content:\"\";}", ".f1aocrix::before{display:block;}", ".f1j7ml58::before{position:absolute;}", ".f1s1fjay::before{left:calc(var(--spacingHorizontalS) / -2);}", ".f15a459s::before{right:calc(var(--spacingHorizontalS) / -2);}", ".f1wl9tmt::before{top:calc((var(--lineHeightBase100) - var(--fontSizeBase100)) / 2);}", ".f8pn7wt::before{height:var(--fontSizeBase100);}", ".f1x8pvcy::before{border-left-width:var(--strokeWidthThin);}", ".f9sc749::before{border-right-width:var(--strokeWidthThin);}", ".f1jpmc5p::before{border-left-style:solid;}", ".f1yq6w5o::before{border-right-style:solid;}", ".fjml6kk::before{border-left-color:var(--colorNeutralStroke2);}", ".f1geml7w::before{border-right-color:var(--colorNeutralStroke2);}", ".fmrv4ls{vertical-align:middle;}", ".fxwmwwq{grid-row-start:content;}", ".f1e0gndy{grid-column-start:content;}", ".f4zz6gv{grid-row-end:content;}", ".f7idnck{grid-column-end:content;}", ".f1vx9l62{flex-direction:column;}", ".f1wn3y0l{row-gap:var(--spacingVerticalS);}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".f9ijwd5{word-break:break-word;}", ".fjseox{display:none;}"]
|
|
170
|
+
});
|
|
171
|
+
const useLabelStyles = __styles({
|
|
172
|
+
root: {
|
|
173
|
+
Ijaq50: "faq1aip",
|
|
174
|
+
Br312pm: "f1m489tg",
|
|
175
|
+
nk6f5a: "fv2srd9",
|
|
176
|
+
Bw0ie65: "f1tz6hh8",
|
|
177
|
+
qb2dma: "f9h729m",
|
|
178
|
+
Bahqtrf: "fk6fouc",
|
|
179
|
+
Be2twd7: "fy9rknc",
|
|
180
|
+
Bhrd7zp: "fl43uef",
|
|
181
|
+
Bg96gwp: "fwrc4pm",
|
|
182
|
+
Biipf1f: "f9ijwd5",
|
|
183
|
+
Fd1uvx: "fpfc2by",
|
|
184
|
+
Bh9c35c: "f1lvsx7g",
|
|
185
|
+
mc9l5x: "f1rvi9lw",
|
|
186
|
+
Bmxbyg5: "f1sil6mw"
|
|
187
|
+
},
|
|
188
|
+
canvas: {
|
|
189
|
+
z8tnut: "f1vd4pcd"
|
|
190
|
+
},
|
|
191
|
+
sidecar: {
|
|
192
|
+
z8tnut: "f1u9e4k4"
|
|
193
|
+
},
|
|
194
|
+
closed: {
|
|
195
|
+
B2u0y6b: "f6dzj5z",
|
|
196
|
+
Bh9c35c: "fvvof4m"
|
|
197
|
+
}
|
|
198
|
+
}, {
|
|
199
|
+
d: [".faq1aip{grid-row-start:title;}", ".f1m489tg{grid-column-start:title;}", ".fv2srd9{grid-row-end:title;}", ".f1tz6hh8{grid-column-end:title;}", ".f9h729m{align-self:start;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f9ijwd5{word-break:break-word;}", ".fpfc2by{-webkit-box-orient:vertical;}", ".f1lvsx7g{-webkit-line-clamp:2;}", ".f1rvi9lw{display:-webkit-box;}", ".f1sil6mw{overflow-y:hidden;}", ".f1vd4pcd{padding-top:calc((24px / 2 ) - (var(--lineHeightBase200) - var(--fontSizeBase200)));}", ".f1u9e4k4{padding-top:calc((16px / 2 ) - (var(--lineHeightBase200) - var(--fontSizeBase200)));}", ".f6dzj5z{max-width:100%;}", ".fvvof4m{-webkit-line-clamp:1;}"]
|
|
200
|
+
});
|
|
201
|
+
/**
|
|
202
|
+
* Apply styling to the Reference slots based on the state
|
|
203
|
+
*/
|
|
204
|
+
export const useReferenceStyles_unstable = state => {
|
|
205
|
+
const {
|
|
206
|
+
isExpanded,
|
|
207
|
+
mode,
|
|
208
|
+
layout
|
|
209
|
+
} = state;
|
|
210
|
+
const rootClassName = useReferenceClassName();
|
|
211
|
+
const styles = useStyles();
|
|
212
|
+
const labelStyles = useLabelStyles();
|
|
213
|
+
state.root.className = mergeClasses(referenceClassNames.root, rootClassName, styles[mode], styles[layout], !isExpanded && styles.closed, state.root.className);
|
|
214
|
+
if (state.citation) {
|
|
215
|
+
state.citation.className = mergeClasses(referenceClassNames.citation, styles.citation, state.citation.className);
|
|
216
|
+
}
|
|
217
|
+
if (state.media) {
|
|
218
|
+
state.media.className = mergeClasses(referenceClassNames.media, styles.media, layout === 'popover' && styles.mediaPopover, state.media.className);
|
|
219
|
+
}
|
|
220
|
+
if (state.actions) {
|
|
221
|
+
state.actions.className = mergeClasses(referenceClassNames.actions, styles.actions, state.actions.className);
|
|
222
|
+
}
|
|
223
|
+
state.label.className = mergeClasses(referenceClassNames.label, labelStyles.root, labelStyles[mode], !isExpanded && labelStyles.closed, state.label.className);
|
|
224
|
+
if (state.sensitivity) {
|
|
225
|
+
state.sensitivity.className = mergeClasses(referenceClassNames.sensitivity, styles.sensitivity, !isExpanded && styles.hidden, state.sensitivity.className);
|
|
226
|
+
}
|
|
227
|
+
if (state.sensitivityLabel) {
|
|
228
|
+
state.sensitivityLabel.className = mergeClasses(referenceClassNames.sensitivityLabel, styles.sensitivityLabel, !isExpanded && styles.hidden, state.sensitivityLabel.className);
|
|
229
|
+
}
|
|
230
|
+
state.metadata.className = mergeClasses(referenceClassNames.metadata, styles.metadata, !isExpanded && styles.hidden, state.metadata.className);
|
|
231
|
+
let isSubsequentText = false;
|
|
232
|
+
if (state.primaryText) {
|
|
233
|
+
state.primaryText.className = mergeClasses(referenceClassNames.primaryText, referenceExtraClassNames.text, isSubsequentText && styles.metadataSubsequentText, state.primaryText.className);
|
|
234
|
+
isSubsequentText = true;
|
|
235
|
+
}
|
|
236
|
+
if (state.secondaryText) {
|
|
237
|
+
state.secondaryText.className = mergeClasses(referenceClassNames.secondaryText, referenceExtraClassNames.text, isSubsequentText && styles.metadataSubsequentText, state.secondaryText.className);
|
|
238
|
+
isSubsequentText = true;
|
|
239
|
+
}
|
|
240
|
+
if (state.tertiaryText) {
|
|
241
|
+
state.tertiaryText.className = mergeClasses(referenceClassNames.tertiaryText, referenceExtraClassNames.text, isSubsequentText && styles.metadataSubsequentText, state.tertiaryText.className);
|
|
242
|
+
isSubsequentText = true;
|
|
243
|
+
}
|
|
244
|
+
if (state.icon) {
|
|
245
|
+
state.icon.className = mergeClasses(referenceClassNames.icon, styles.icon, state.icon.className);
|
|
246
|
+
}
|
|
247
|
+
state.content.className = mergeClasses(referenceClassNames.content, styles.content, !isExpanded && styles.hidden, state.content.className);
|
|
248
|
+
if (state.detailsButton) {
|
|
249
|
+
state.detailsButton.className = mergeClasses(referenceClassNames.detailsButton, styles.detailsButton, state.detailsButton.className);
|
|
250
|
+
}
|
|
251
|
+
return state;
|
|
252
|
+
};
|
|
253
|
+
//# sourceMappingURL=useReferenceStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceStyles.ts"],"sourcesContent":["import {\n buttonClassNames,\n makeResetStyles,\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport type { ReferenceSlots, ReferenceState } from './Reference.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const referenceClassNames: SlotClassNames<ReferenceSlots> = {\n root: 'fai-Reference',\n citation: 'fai-Reference__citation',\n media: 'fai-Reference__media',\n actions: 'fai-Reference__actions',\n sensitivity: 'fai-Reference__sensitivity',\n sensitivityLabel: 'fai-Reference__sensitivityLabel',\n metadata: 'fai-Reference__metadata',\n primaryText: 'fai-Reference__primaryText',\n secondaryText: 'fai-Reference__secondaryText',\n tertiaryText: 'fai-Reference__tertiaryText',\n icon: 'fai-Reference__icon',\n label: 'fai-Reference__label',\n content: 'fai-Reference__content',\n detailsButton: 'fai-Reference__detailsButton',\n};\n\nexport const referenceExtraClassNames = {\n text: 'fai-Reference__text',\n mediaChild: 'fai-Reference__mediaChild',\n};\n\nconst labelFontSize = typographyStyles.caption1Strong.fontSize;\nconst labelLineHeight = typographyStyles.caption1Strong.lineHeight;\n\nconst maxPopoverWidth = '256px';\n\nconst useReferenceClassName = makeResetStyles({\n boxSizing: 'border-box',\n width: '100%',\n display: 'grid',\n gridTemplateAreas: `\n \"citation media title actions\"\n \". . title .\"\n \"sensitivityLabel sensitivityLabel sensitivityLabel sensitivityLabel\"\n \"metadata metadata metadata metadata\"\n \"content content content content\"\n `,\n gridTemplateColumns: 'min-content min-content 1fr min-content',\n gridTemplateRows: '32px auto auto auto auto',\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderRadius: tokens.borderRadiusMedium,\n padding: `${tokens.spacingVerticalS} ${tokens.spacingHorizontalS}`,\n boxShadow: 'none',\n columnGap: tokens.spacingHorizontalXS,\n alignItems: 'center',\n});\n\nconst useStyles = makeStyles({\n canvas: {},\n sidecar: {\n gridTemplateRows: '24px auto auto auto',\n ...shorthands.padding(tokens.spacingVerticalXS, tokens.spacingHorizontalS),\n },\n inline: {},\n popover: {\n ...shorthands.borderWidth('0px'),\n width: `calc(${maxPopoverWidth} - (${tokens.spacingHorizontalM} * 2))`,\n ...shorthands.padding('0px'),\n },\n closed: {\n rowGap: 0,\n },\n citation: {\n ...shorthands.gridArea('citation'),\n },\n media: {\n ...shorthands.gridArea('media'),\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n mediaPopover: {\n width: '16px',\n height: '16px',\n\n [`> .${referenceExtraClassNames.mediaChild}`]: {\n width: '16px',\n height: '16px',\n },\n },\n actions: {\n ...shorthands.gridArea('actions'),\n justifySelf: 'end',\n display: 'flex',\n gridRowStart: 1,\n },\n detailsButton: {\n [`> ${buttonClassNames.icon}`]: {\n color: tokens.colorNeutralForeground3,\n },\n },\n sensitivity: {\n ...shorthands.gridArea('sensitivityLabel'),\n justifySelf: 'start',\n },\n sensitivityLabel: {\n marginTop: tokens.spacingVerticalXS,\n backgroundColor: tokens.colorNeutralBackground5,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorTransparentStroke),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.gridArea('sensitivityLabel'),\n justifySelf: 'start',\n ...shorthands.padding(0, tokens.spacingHorizontalSNudge),\n ...typographyStyles.caption2,\n },\n metadata: {\n marginTop: tokens.spacingVerticalXS,\n\n ...shorthands.gridArea('metadata'),\n ...typographyStyles.caption2,\n },\n metadataSubsequentText: {\n position: 'relative',\n marginLeft: tokens.spacingHorizontalS,\n\n '&::before': {\n content: '\"\"',\n display: 'block',\n position: 'absolute',\n left: `calc(${tokens.spacingHorizontalS} / -2)`,\n top: `calc((${typographyStyles.caption2.lineHeight} - ${typographyStyles.caption2.fontSize}) / 2)`,\n height: typographyStyles.caption2.fontSize,\n ...shorthands.borderLeft(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n },\n },\n icon: {\n ...typographyStyles.caption2,\n verticalAlign: 'middle',\n },\n content: {\n marginTop: tokens.spacingVerticalXS,\n ...shorthands.gridArea('content'),\n display: 'flex',\n flexDirection: 'column',\n rowGap: tokens.spacingVerticalS,\n color: tokens.colorNeutralForeground3,\n wordBreak: 'break-word',\n },\n hidden: {\n display: 'none',\n },\n});\n\nconst useLabelStyles = makeStyles({\n root: {\n ...shorthands.gridArea('title'),\n alignSelf: 'start',\n ...typographyStyles.caption1Strong,\n wordBreak: 'break-word',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '2',\n display: '-webkit-box',\n overflowY: 'hidden',\n },\n\n canvas: {\n // 24px is the height of the tallest element within the reference\n paddingTop: `calc((24px / 2 ) - (${labelLineHeight} - ${labelFontSize}))`,\n },\n\n sidecar: {\n // 16px is the height of the tallest element within the reference\n paddingTop: `calc((16px / 2 ) - (${labelLineHeight} - ${labelFontSize}))`,\n },\n\n closed: {\n maxWidth: '100%',\n '-webkit-line-clamp': '1',\n },\n});\n\n/**\n * Apply styling to the Reference slots based on the state\n */\nexport const useReferenceStyles_unstable = (state: ReferenceState): ReferenceState => {\n const { isExpanded, mode, layout } = state;\n\n const rootClassName = useReferenceClassName();\n const styles = useStyles();\n const labelStyles = useLabelStyles();\n state.root.className = mergeClasses(\n referenceClassNames.root,\n rootClassName,\n styles[mode],\n styles[layout],\n !isExpanded && styles.closed,\n state.root.className,\n );\n\n if (state.citation) {\n state.citation.className = mergeClasses(referenceClassNames.citation, styles.citation, state.citation.className);\n }\n\n if (state.media) {\n state.media.className = mergeClasses(\n referenceClassNames.media,\n styles.media,\n layout === 'popover' && styles.mediaPopover,\n state.media.className,\n );\n }\n\n if (state.actions) {\n state.actions.className = mergeClasses(referenceClassNames.actions, styles.actions, state.actions.className);\n }\n\n state.label.className = mergeClasses(\n referenceClassNames.label,\n labelStyles.root,\n labelStyles[mode],\n !isExpanded && labelStyles.closed,\n state.label.className,\n );\n\n if (state.sensitivity) {\n state.sensitivity.className = mergeClasses(\n referenceClassNames.sensitivity,\n styles.sensitivity,\n !isExpanded && styles.hidden,\n state.sensitivity.className,\n );\n }\n\n if (state.sensitivityLabel) {\n state.sensitivityLabel.className = mergeClasses(\n referenceClassNames.sensitivityLabel,\n styles.sensitivityLabel,\n !isExpanded && styles.hidden,\n state.sensitivityLabel.className,\n );\n }\n\n state.metadata.className = mergeClasses(\n referenceClassNames.metadata,\n styles.metadata,\n !isExpanded && styles.hidden,\n state.metadata.className,\n );\n\n let isSubsequentText = false;\n if (state.primaryText) {\n state.primaryText.className = mergeClasses(\n referenceClassNames.primaryText,\n referenceExtraClassNames.text,\n isSubsequentText && styles.metadataSubsequentText,\n state.primaryText.className,\n );\n isSubsequentText = true;\n }\n\n if (state.secondaryText) {\n state.secondaryText.className = mergeClasses(\n referenceClassNames.secondaryText,\n referenceExtraClassNames.text,\n isSubsequentText && styles.metadataSubsequentText,\n state.secondaryText.className,\n );\n isSubsequentText = true;\n }\n\n if (state.tertiaryText) {\n state.tertiaryText.className = mergeClasses(\n referenceClassNames.tertiaryText,\n referenceExtraClassNames.text,\n isSubsequentText && styles.metadataSubsequentText,\n state.tertiaryText.className,\n );\n isSubsequentText = true;\n }\n\n if (state.icon) {\n state.icon.className = mergeClasses(referenceClassNames.icon, styles.icon, state.icon.className);\n }\n state.content.className = mergeClasses(\n referenceClassNames.content,\n styles.content,\n !isExpanded && styles.hidden,\n state.content.className,\n );\n\n if (state.detailsButton) {\n state.detailsButton.className = mergeClasses(\n referenceClassNames.detailsButton,\n styles.detailsButton,\n state.detailsButton.className,\n );\n }\n\n return state;\n};\n"],"names":["buttonClassNames","makeResetStyles","makeStyles","mergeClasses","shorthands","tokens","typographyStyles","referenceClassNames","root","citation","media","actions","sensitivity","sensitivityLabel","metadata","primaryText","secondaryText","tertiaryText","icon","label","content","detailsButton","referenceExtraClassNames","text","mediaChild","labelFontSize","caption1Strong","fontSize","labelLineHeight","lineHeight","maxPopoverWidth","useReferenceClassName","boxSizing","width","display","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","border","strokeWidthThin","colorNeutralStroke1","borderRadius","borderRadiusMedium","padding","spacingVerticalS","spacingHorizontalS","boxShadow","columnGap","spacingHorizontalXS","alignItems","useStyles","canvas","sidecar","spacingVerticalXS","inline","popover","borderWidth","spacingHorizontalM","closed","rowGap","gridArea","justifyContent","mediaPopover","height","justifySelf","gridRowStart","color","colorNeutralForeground3","marginTop","backgroundColor","colorNeutralBackground5","colorTransparentStroke","spacingHorizontalSNudge","caption2","metadataSubsequentText","position","marginLeft","left","top","borderLeft","colorNeutralStroke2","verticalAlign","flexDirection","wordBreak","hidden","useLabelStyles","alignSelf","overflowY","paddingTop","maxWidth","useReferenceStyles_unstable","state","isExpanded","mode","layout","rootClassName","styles","labelStyles","className","isSubsequentText"],"mappings":"AAAA,SACEA,gBAAgB,EAChBC,eAAe,EACfC,UAAU,EACVC,YAAY,EACZC,UAAU,EACVC,MAAM,EACNC,gBAAgB,QACX,6BAA6B;AAIpC,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,UAAU;IACVC,OAAO;IACPC,SAAS;IACTC,aAAa;IACbC,kBAAkB;IAClBC,UAAU;IACVC,aAAa;IACbC,eAAe;IACfC,cAAc;IACdC,MAAM;IACNC,OAAO;IACPC,SAAS;IACTC,eAAe;AACjB,EAAE;AAEF,OAAO,MAAMC,2BAA2B;IACtCC,MAAM;IACNC,YAAY;AACd,EAAE;AAEF,MAAMC,gBAAgBnB,iBAAiBoB,cAAc,CAACC,QAAQ;AAC9D,MAAMC,kBAAkBtB,iBAAiBoB,cAAc,CAACG,UAAU;AAElE,MAAMC,kBAAkB;AAExB,MAAMC,wBAAwB9B,gBAAgB;IAC5C+B,WAAW;IACXC,OAAO;IACPC,SAAS;IACTC,mBAAmB,CAAC;;;;;;IAMlB,CAAC;IACHC,qBAAqB;IACrBC,kBAAkB;IAClBC,QAAQ,CAAC,EAAEjC,OAAOkC,eAAe,CAAC,OAAO,EAAEl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CAACmF,SAAS;QAE7BC,mBAAmB;IACrB;IAEA,IAAIR,MAAM3E,aAAa,EAAE;QACvB2E,MAAM3E,aAAa,CAACkF,SAAS,GAAG/F,aAC9BI,oBAAoBS,aAAa,EACjCM,yBAAyBC,IAAI,EAC7B4E,oBAAoBH,OAAOtB,sBAAsB,EACjDiB,MAAM3E,aAAa,CAACkF,SAAS;QAE/BC,mBAAmB;IACrB;IAEA,IAAIR,MAAM1E,YAAY,EAAE;QACtB0E,MAAM1E,YAAY,CAACiF,SAAS,GAAG/F,aAC7BI,oBAAoBU,YAAY,EAChCK,yBAAyBC,IAAI,EAC7B4E,oBAAoBH,OAAOtB,sBAAsB,EACjDiB,MAAM1E,YAAY,CAACiF,SAAS;QAE9BC,mBAAmB;IACrB;IAEA,IAAIR,MAAMzE,IAAI,EAAE;QACdyE,MAAMzE,IAAI,CAACgF,SAAS,GAAG/F,aAAaI,oBAAoBW,IAAI,EAAE8E,OAAO9E,IAAI,EAAEyE,MAAMzE,IAAI,CAACgF,SAAS;IACjG;IACAP,MAAMvE,OAAO,CAAC8E,SAAS,GAAG/F,aACxBI,oBAAoBa,OAAO,EAC3B4E,OAAO5E,OAAO,EACd,CAACwE,cAAcI,OAAOZ,MAAM,EAC5BO,MAAMvE,OAAO,CAAC8E,SAAS;IAGzB,IAAIP,MAAMtE,aAAa,EAAE;QACvBsE,MAAMtE,aAAa,CAAC6E,SAAS,GAAG/F,aAC9BI,oBAAoBc,aAAa,EACjC2E,OAAO3E,aAAa,EACpBsE,MAAMtE,aAAa,CAAC6E,SAAS;IAEjC;IAEA,OAAOP;AACT,EAAE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useReferenceGroup_unstable } from './useReferenceGroup';
|
|
3
|
+
import { renderReferenceGroup_unstable } from './renderReferenceGroup';
|
|
4
|
+
import { useReferenceGroupStyles_unstable } from './useReferenceGroupStyles';
|
|
5
|
+
import { useReferenceGroupContextValues } from './useReferenceGroupContextValues';
|
|
6
|
+
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
7
|
+
/**
|
|
8
|
+
* ReferenceGroup component
|
|
9
|
+
* @deprecated use `useReferenceGroup` instead.
|
|
10
|
+
*/
|
|
11
|
+
export const ReferenceGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
12
|
+
const state = useReferenceGroup_unstable(props, ref);
|
|
13
|
+
const ctxValues = useReferenceGroupContextValues(state);
|
|
14
|
+
useReferenceGroupStyles_unstable(state);
|
|
15
|
+
useCustomStyleHook('useReferenceGroupStyles')(state);
|
|
16
|
+
return renderReferenceGroup_unstable(state, ctxValues);
|
|
17
|
+
});
|
|
18
|
+
ReferenceGroup.displayName = 'ReferenceGroup';
|
|
19
|
+
//# sourceMappingURL=ReferenceGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useReferenceGroup_unstable } from './useReferenceGroup';\nimport { renderReferenceGroup_unstable } from './renderReferenceGroup';\nimport { useReferenceGroupStyles_unstable } from './useReferenceGroupStyles';\nimport type { ReferenceGroupProps } from './ReferenceGroup.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useReferenceGroupContextValues } from './useReferenceGroupContextValues';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\n/**\n * ReferenceGroup component\n * @deprecated use `useReferenceGroup` instead.\n */\nexport const ReferenceGroup: ForwardRefComponent<ReferenceGroupProps> = React.forwardRef((props, ref) => {\n const state = useReferenceGroup_unstable(props, ref);\n const ctxValues = useReferenceGroupContextValues(state);\n\n useReferenceGroupStyles_unstable(state);\n useCustomStyleHook('useReferenceGroupStyles')(state);\n\n return renderReferenceGroup_unstable(state, ctxValues);\n});\n\nReferenceGroup.displayName = 'ReferenceGroup';\n"],"names":["React","useReferenceGroup_unstable","renderReferenceGroup_unstable","useReferenceGroupStyles_unstable","useReferenceGroupContextValues","useCustomStyleHook","ReferenceGroup","forwardRef","props","ref","state","ctxValues","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAG7E,SAASC,8BAA8B,QAAQ,mCAAmC;AAClF,SAASC,kBAAkB,QAAQ,mCAAmC;AAEtE;;;CAGC,GACD,OAAO,MAAMC,+BAA2DN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQT,2BAA2BO,OAAOC;IAChD,MAAME,YAAYP,+BAA+BM;IAEjDP,iCAAiCO;IACjCL,mBAAmB,2BAA2BK;IAE9C,OAAOR,8BAA8BQ,OAAOC;AAC9C,GAAG;AAEHL,eAAeM,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceGroup.types.ts"],"sourcesContent":["import type { CopilotMode } from '@fluentui-copilot/react-provider';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type ReferenceGroupSlots = {\n /**\n * The root slot.\n */\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Label slot. Primary description of the group.\n */\n label: NonNullable<Slot<'span'>>;\n\n /**\n * Icon slot.\n */\n icon: Slot<'span'>;\n\n /**\n * Details button slot. Used to expand/collapse the group.\n */\n detailsButton: NonNullable<Slot<'button'>>;\n\n /**\n * Content slot. Used to display the group's references. Visibility should be controlled by `detailsButton`.\n */\n content: NonNullable<Slot<'div'>>;\n};\n\n/**\n * ReferenceGroup Props\n */\nexport type ReferenceGroupProps = ComponentProps<Partial<ReferenceGroupSlots>, 'content'> & CopilotMode;\n\n/**\n * State used in rendering ReferenceGroup\n */\nexport type ReferenceGroupState = ComponentState<ReferenceGroupSlots> &\n Required<Pick<ReferenceGroupProps, 'mode'>> & {\n /**\n * State to track if the group is open or not.\n */\n isOpen: boolean;\n\n /**\n * Callback used to open the group from a child.\n * @returns void\n */\n setOpen: () => void;\n };\n"],"names":[],"mappings":"AAAA,WAkDI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ReferenceGroup';\nexport * from './ReferenceGroup.types';\nexport * from './renderReferenceGroup';\nexport * from './useReferenceGroup';\nexport * from './useReferenceGroupStyles';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,4BAA4B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from '@fluentui/react-components';
|
|
3
|
+
import { ReferenceGroupProvider } from '../../context/ReferenceGroupContext';
|
|
4
|
+
/**
|
|
5
|
+
* Render the final JSX of ReferenceGroup
|
|
6
|
+
*/
|
|
7
|
+
export const renderReferenceGroup_unstable = (state, contextValues) => {
|
|
8
|
+
assertSlots(state);
|
|
9
|
+
var _state_detailsButton_children;
|
|
10
|
+
return /*#__PURE__*/_jsx(ReferenceGroupProvider, {
|
|
11
|
+
value: contextValues,
|
|
12
|
+
children: /*#__PURE__*/_jsxs(state.root, {
|
|
13
|
+
children: [/*#__PURE__*/_jsx(state.detailsButton, {
|
|
14
|
+
children: (_state_detailsButton_children = state.detailsButton.children) !== null && _state_detailsButton_children !== void 0 ? _state_detailsButton_children : /*#__PURE__*/_jsxs(_Fragment, {
|
|
15
|
+
children: [/*#__PURE__*/_jsx(state.label, {}), state.icon && /*#__PURE__*/_jsx(state.icon, {})]
|
|
16
|
+
})
|
|
17
|
+
}), /*#__PURE__*/_jsx(state.content, {})]
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=renderReferenceGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderReferenceGroup.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport { ReferenceGroupProvider } from '../../context/ReferenceGroupContext';\nimport type { ReferenceGroupState, ReferenceGroupSlots } from './ReferenceGroup.types';\nimport type { ReferenceGroupContext } from '../../context/ReferenceGroupContext';\n\n/**\n * Render the final JSX of ReferenceGroup\n */\nexport const renderReferenceGroup_unstable = (state: ReferenceGroupState, contextValues: ReferenceGroupContext) => {\n assertSlots<ReferenceGroupSlots>(state);\n\n return (\n <ReferenceGroupProvider value={contextValues}>\n <state.root>\n <state.detailsButton>\n {state.detailsButton.children ?? (\n <>\n <state.label />\n {state.icon && <state.icon />}\n </>\n )}\n </state.detailsButton>\n <state.content />\n </state.root>\n </ReferenceGroupProvider>\n );\n};\n"],"names":["assertSlots","ReferenceGroupProvider","renderReferenceGroup_unstable","state","contextValues","value","root","detailsButton","children","label","icon","content"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AACzD,SAASC,sBAAsB,QAAQ,sCAAsC;AAI7E;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC,OAA4BC;IACxEJ,YAAiCG;QAMxBA;IAJT,qBACE,KAACF;QAAuBI,OAAOD;kBAC7B,cAAA,MAACD,MAAMG,IAAI;;8BACT,KAACH,MAAMI,aAAa;8BACjBJ,CAAAA,gCAAAA,MAAMI,aAAa,CAACC,QAAQ,cAA5BL,2CAAAA,8CACC;;0CACE,KAACA,MAAMM,KAAK;4BACXN,MAAMO,IAAI,kBAAI,KAACP,MAAMO,IAAI;;;;8BAIhC,KAACP,MAAMQ,OAAO;;;;AAItB,EAAE"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getPartitionedNativeProps } from '@fluentui/react-components';
|
|
3
|
+
import { ChevronDown16Regular, ChevronUp16Regular } from '@fluentui/react-icons';
|
|
4
|
+
import { mergeCallbacks, slot } from '@fluentui/react-utilities';
|
|
5
|
+
import { useCopilotMode } from '@fluentui-copilot/react-provider';
|
|
6
|
+
const ctxReducer = (ctx, action) => {
|
|
7
|
+
if (action.type === 'TOGGLE_OPEN') {
|
|
8
|
+
return {
|
|
9
|
+
...ctx,
|
|
10
|
+
open: action.open
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return ctx;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Create the state required to render ReferenceGroup.
|
|
17
|
+
*
|
|
18
|
+
* The returned state can be modified with hooks such as useReferenceGroupStyles_unstable,
|
|
19
|
+
* before being passed to renderReferenceGroup_unstable.
|
|
20
|
+
*
|
|
21
|
+
* @param props - props from this instance of ReferenceGroup
|
|
22
|
+
* @param ref - reference to root HTMLElement of ReferenceGroup
|
|
23
|
+
*/
|
|
24
|
+
export const useReferenceGroup_unstable = (props, ref) => {
|
|
25
|
+
const {
|
|
26
|
+
content,
|
|
27
|
+
detailsButton,
|
|
28
|
+
icon,
|
|
29
|
+
label,
|
|
30
|
+
root
|
|
31
|
+
} = props;
|
|
32
|
+
const mode = useCopilotMode(props.mode);
|
|
33
|
+
const [ctxValues, dispatch] = React.useReducer(ctxReducer, {
|
|
34
|
+
open: false
|
|
35
|
+
});
|
|
36
|
+
const isOpen = ctxValues.open;
|
|
37
|
+
const toggleOpen = React.useCallback(newOpen => {
|
|
38
|
+
dispatch({
|
|
39
|
+
type: 'TOGGLE_OPEN',
|
|
40
|
+
open: newOpen
|
|
41
|
+
});
|
|
42
|
+
}, [dispatch]);
|
|
43
|
+
const setOpen = React.useCallback(() => {
|
|
44
|
+
dispatch({
|
|
45
|
+
type: 'TOGGLE_OPEN',
|
|
46
|
+
open: true
|
|
47
|
+
});
|
|
48
|
+
}, [dispatch]);
|
|
49
|
+
const onDetailsButtonClick = _e => {
|
|
50
|
+
toggleOpen(!isOpen);
|
|
51
|
+
};
|
|
52
|
+
const nativeProps = getPartitionedNativeProps({
|
|
53
|
+
props,
|
|
54
|
+
primarySlotTagName: 'div'
|
|
55
|
+
});
|
|
56
|
+
const state = {
|
|
57
|
+
mode,
|
|
58
|
+
isOpen,
|
|
59
|
+
setOpen,
|
|
60
|
+
components: {
|
|
61
|
+
root: 'div',
|
|
62
|
+
label: 'span',
|
|
63
|
+
icon: 'span',
|
|
64
|
+
detailsButton: 'button',
|
|
65
|
+
content: 'div'
|
|
66
|
+
},
|
|
67
|
+
root: slot.always(root, {
|
|
68
|
+
defaultProps: nativeProps.root,
|
|
69
|
+
elementType: 'div'
|
|
70
|
+
}),
|
|
71
|
+
label: slot.always(label, {
|
|
72
|
+
elementType: 'span'
|
|
73
|
+
}),
|
|
74
|
+
icon: slot.optional(icon, {
|
|
75
|
+
defaultProps: {
|
|
76
|
+
children: isOpen ? /*#__PURE__*/React.createElement(ChevronUp16Regular, null) : /*#__PURE__*/React.createElement(ChevronDown16Regular, null)
|
|
77
|
+
},
|
|
78
|
+
renderByDefault: true,
|
|
79
|
+
elementType: 'span'
|
|
80
|
+
}),
|
|
81
|
+
detailsButton: slot.always(detailsButton, {
|
|
82
|
+
defaultProps: {
|
|
83
|
+
'aria-expanded': isOpen,
|
|
84
|
+
type: 'button'
|
|
85
|
+
},
|
|
86
|
+
elementType: 'button'
|
|
87
|
+
}),
|
|
88
|
+
content: slot.always(content, {
|
|
89
|
+
defaultProps: {
|
|
90
|
+
ref: ref,
|
|
91
|
+
// use inert as a backup if display: none is overridden in styles to enable animation
|
|
92
|
+
// inert getting added to React types is tracked here: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/60822
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
94
|
+
// @ts-ignore
|
|
95
|
+
inert: isOpen ? undefined : 'true',
|
|
96
|
+
...nativeProps.primary
|
|
97
|
+
},
|
|
98
|
+
elementType: 'div'
|
|
99
|
+
})
|
|
100
|
+
};
|
|
101
|
+
state.detailsButton.onClick = mergeCallbacks(state.detailsButton.onClick, onDetailsButtonClick);
|
|
102
|
+
return state;
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=useReferenceGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getPartitionedNativeProps } from '@fluentui/react-components';\nimport { ChevronDown16Regular, ChevronUp16Regular } from '@fluentui/react-icons';\nimport { mergeCallbacks, slot } from '@fluentui/react-utilities';\nimport type { ReferenceGroupProps, ReferenceGroupState } from './ReferenceGroup.types';\nimport { useCopilotMode } from '@fluentui-copilot/react-provider';\n\ntype ReferenceGroupAction = ToggleAction;\n\ntype ToggleAction = {\n type: 'TOGGLE_OPEN';\n open: boolean;\n};\n\ntype ContextReducer = {\n open: boolean;\n};\n\nconst ctxReducer = (ctx: ContextReducer, action: ReferenceGroupAction): ContextReducer => {\n if (action.type === 'TOGGLE_OPEN') {\n return { ...ctx, open: action.open };\n }\n\n return ctx;\n};\n\n/**\n * Create the state required to render ReferenceGroup.\n *\n * The returned state can be modified with hooks such as useReferenceGroupStyles_unstable,\n * before being passed to renderReferenceGroup_unstable.\n *\n * @param props - props from this instance of ReferenceGroup\n * @param ref - reference to root HTMLElement of ReferenceGroup\n */\nexport const useReferenceGroup_unstable = (\n props: ReferenceGroupProps,\n ref: React.Ref<HTMLElement>,\n): ReferenceGroupState => {\n const { content, detailsButton, icon, label, root } = props;\n\n const mode = useCopilotMode(props.mode);\n\n const [ctxValues, dispatch] = React.useReducer(ctxReducer, { open: false });\n\n const isOpen = ctxValues.open;\n\n const toggleOpen = React.useCallback(\n (newOpen: boolean) => {\n dispatch({\n type: 'TOGGLE_OPEN',\n open: newOpen,\n });\n },\n [dispatch],\n );\n\n const setOpen = React.useCallback(() => {\n dispatch({\n type: 'TOGGLE_OPEN',\n open: true,\n });\n }, [dispatch]);\n\n const onDetailsButtonClick = (_e: React.MouseEvent<HTMLElement>) => {\n toggleOpen(!isOpen);\n };\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'div',\n });\n\n const state: ReferenceGroupState = {\n mode,\n isOpen,\n setOpen,\n components: {\n root: 'div',\n label: 'span',\n icon: 'span',\n detailsButton: 'button',\n content: 'div',\n },\n root: slot.always(root, {\n defaultProps: nativeProps.root,\n elementType: 'div',\n }),\n label: slot.always(label, {\n elementType: 'span',\n }),\n icon: slot.optional(icon, {\n defaultProps: {\n children: isOpen ? <ChevronUp16Regular /> : <ChevronDown16Regular />,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n detailsButton: slot.always(detailsButton, {\n defaultProps: {\n 'aria-expanded': isOpen,\n type: 'button',\n },\n elementType: 'button',\n }),\n content: slot.always(content, {\n defaultProps: {\n ref: ref as React.Ref<HTMLDivElement>,\n // use inert as a backup if display: none is overridden in styles to enable animation\n // inert getting added to React types is tracked here: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/60822\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n inert: isOpen ? undefined : 'true',\n ...nativeProps.primary,\n },\n elementType: 'div',\n }),\n };\n\n state.detailsButton.onClick = mergeCallbacks(state.detailsButton.onClick, onDetailsButtonClick);\n\n return state;\n};\n"],"names":["React","getPartitionedNativeProps","ChevronDown16Regular","ChevronUp16Regular","mergeCallbacks","slot","useCopilotMode","ctxReducer","ctx","action","type","open","useReferenceGroup_unstable","props","ref","content","detailsButton","icon","label","root","mode","ctxValues","dispatch","useReducer","isOpen","toggleOpen","useCallback","newOpen","setOpen","onDetailsButtonClick","_e","nativeProps","primarySlotTagName","state","components","always","defaultProps","elementType","optional","children","renderByDefault","inert","undefined","primary","onClick"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,6BAA6B;AACvE,SAASC,oBAAoB,EAAEC,kBAAkB,QAAQ,wBAAwB;AACjF,SAASC,cAAc,EAAEC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wB,oBAACD;YAC/C;YACAsC,iBAAiB;YACjBH,aAAa;QACf;QACArB,eAAeX,KAAK8B,MAAM,CAACnB,eAAe;YACxCoB,cAAc;gBACZ,iBAAiBZ;gBACjBd,MAAM;YACR;YACA2B,aAAa;QACf;QACAtB,SAASV,KAAK8B,MAAM,CAACpB,SAAS;YAC5BqB,cAAc;gBACZtB,KAAKA;gBACL,qFAAqF;gBACrF,oHAAoH;gBACpH,6DAA6D;gBAC7D,aAAa;gBACb2B,OAAOjB,SAASkB,YAAY;gBAC5B,GAAGX,YAAYY,OAAO;YACxB;YACAN,aAAa;QACf;IACF;IAEAJ,MAAMjB,aAAa,CAAC4B,OAAO,GAAGxC,eAAe6B,MAAMjB,aAAa,CAAC4B,OAAO,EAAEf;IAE1E,OAAOI;AACT,EAAE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export const useReferenceGroupContextValues = state => {
|
|
3
|
+
return React.useMemo(() => {
|
|
4
|
+
return {
|
|
5
|
+
open: state.isOpen,
|
|
6
|
+
setOpen: state.setOpen
|
|
7
|
+
};
|
|
8
|
+
}, [state.isOpen, state.setOpen]);
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useReferenceGroupContextValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceGroupContextValues.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ReferenceGroupContext } from '../../context/ReferenceGroupContext';\nimport type { ReferenceGroupState } from './ReferenceGroup.types';\n\nexport const useReferenceGroupContextValues = (state: ReferenceGroupState): ReferenceGroupContext => {\n return React.useMemo(() => {\n return {\n open: state.isOpen,\n setOpen: state.setOpen,\n };\n }, [state.isOpen, state.setOpen]);\n};\n"],"names":["React","useReferenceGroupContextValues","state","useMemo","open","isOpen","setOpen"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAI/B,OAAO,MAAMC,iCAAiC,CAACC;IAC7C,OAAOF,MAAMG,OAAO,CAAC;QACnB,OAAO;YACLC,MAAMF,MAAMG,MAAM;YAClBC,SAASJ,MAAMI,OAAO;QACxB;IACF,GAAG;QAACJ,MAAMG,MAAM;QAAEH,MAAMI,OAAO;KAAC;AAClC,EAAE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { __resetStyles, __styles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';
|
|
2
|
+
export const referenceGroupClassNames = {
|
|
3
|
+
root: 'fai-ReferenceGroup',
|
|
4
|
+
label: 'fai-ReferenceGroup__label',
|
|
5
|
+
icon: 'fai-ReferenceGroup__icon',
|
|
6
|
+
detailsButton: 'fai-ReferenceGroup__detailsButton',
|
|
7
|
+
content: 'fai-ReferenceGroup__content'
|
|
8
|
+
};
|
|
9
|
+
const useRootClassName = __resetStyles("r1w2tk05", null, [".r1w2tk05{display:flex;flex-direction:column;width:100%;gap:var(--spacingVerticalXS);}"]);
|
|
10
|
+
const useIconClassName = __resetStyles("r18biwo", null, [".r18biwo{display:inline-flex;align-items:center;}"]);
|
|
11
|
+
const useDetailsButtonClassName = __resetStyles("raowymc", "rkpovx8", [".raowymc{display:inline-flex;column-gap:var(--spacingHorizontalSNudge);align-items:center;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);border:0;background-color:transparent;color:var(--colorNeutralForeground3);height:24px;cursor:pointer;width:max-content;padding-left:0;padding-right:0;}", ".rkpovx8{display:inline-flex;column-gap:var(--spacingHorizontalSNudge);align-items:center;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);border:0;background-color:transparent;color:var(--colorNeutralForeground3);height:24px;cursor:pointer;width:max-content;padding-right:0;padding-left:0;}"]);
|
|
12
|
+
const useDetailsButtonStyles = __styles({
|
|
13
|
+
canvas: {},
|
|
14
|
+
sidecar: {
|
|
15
|
+
Bahqtrf: "fk6fouc",
|
|
16
|
+
Be2twd7: "fy9rknc",
|
|
17
|
+
Bhrd7zp: "figsok6",
|
|
18
|
+
Bg96gwp: "fwrc4pm"
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
21
|
+
d: [".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}"]
|
|
22
|
+
});
|
|
23
|
+
const useContentHiddenStyles = __styles({
|
|
24
|
+
base: {
|
|
25
|
+
mc9l5x: "fjseox"
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
d: [".fjseox{display:none;}"]
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Apply styling to the ReferenceGroup slots based on the state
|
|
32
|
+
*/
|
|
33
|
+
export const useReferenceGroupStyles_unstable = state => {
|
|
34
|
+
const {
|
|
35
|
+
mode,
|
|
36
|
+
isOpen
|
|
37
|
+
} = state;
|
|
38
|
+
const iconBaseClassName = useIconClassName();
|
|
39
|
+
const detailsButtonStyles = useDetailsButtonStyles();
|
|
40
|
+
const contentHiddenStyles = useContentHiddenStyles();
|
|
41
|
+
state.root.className = mergeClasses(referenceGroupClassNames.root, useRootClassName(), state.root.className);
|
|
42
|
+
state.label.className = mergeClasses(referenceGroupClassNames.label, state.label.className);
|
|
43
|
+
if (state.icon) {
|
|
44
|
+
state.icon.className = mergeClasses(referenceGroupClassNames.icon, iconBaseClassName, state.icon.className);
|
|
45
|
+
}
|
|
46
|
+
state.detailsButton.className = mergeClasses(referenceGroupClassNames.detailsButton, useDetailsButtonClassName(), detailsButtonStyles[mode], state.detailsButton.className);
|
|
47
|
+
state.content.className = mergeClasses(referenceGroupClassNames.content, !isOpen && contentHiddenStyles.base, state.content.className);
|
|
48
|
+
return state;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=useReferenceGroupStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReferenceGroupStyles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { ReferenceGroupSlots, ReferenceGroupState } from './ReferenceGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const referenceGroupClassNames: SlotClassNames<ReferenceGroupSlots> = {\n root: 'fai-ReferenceGroup',\n label: 'fai-ReferenceGroup__label',\n icon: 'fai-ReferenceGroup__icon',\n detailsButton: 'fai-ReferenceGroup__detailsButton',\n content: 'fai-ReferenceGroup__content',\n};\n\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n gap: tokens.spacingVerticalXS,\n});\n\nconst useIconClassName = makeResetStyles({\n display: 'inline-flex',\n alignItems: 'center',\n});\n\nconst useDetailsButtonClassName = makeResetStyles({\n display: 'inline-flex',\n columnGap: tokens.spacingHorizontalSNudge,\n alignItems: 'center',\n ...typographyStyles.body1,\n border: 0,\n backgroundColor: 'transparent',\n color: tokens.colorNeutralForeground3,\n height: '24px',\n cursor: 'pointer',\n width: 'max-content',\n paddingLeft: 0,\n paddingRight: 0,\n});\n\nconst useDetailsButtonStyles = makeStyles({\n canvas: {},\n\n sidecar: {\n ...typographyStyles.caption1,\n },\n});\n\nconst useContentHiddenStyles = makeStyles({\n base: {\n display: 'none',\n },\n});\n\n/**\n * Apply styling to the ReferenceGroup slots based on the state\n */\nexport const useReferenceGroupStyles_unstable = (state: ReferenceGroupState): ReferenceGroupState => {\n const { mode, isOpen } = state;\n\n const iconBaseClassName = useIconClassName();\n const detailsButtonStyles = useDetailsButtonStyles();\n const contentHiddenStyles = useContentHiddenStyles();\n\n state.root.className = mergeClasses(referenceGroupClassNames.root, useRootClassName(), state.root.className);\n\n state.label.className = mergeClasses(referenceGroupClassNames.label, state.label.className);\n\n if (state.icon) {\n state.icon.className = mergeClasses(referenceGroupClassNames.icon, iconBaseClassName, state.icon.className);\n }\n\n state.detailsButton.className = mergeClasses(\n referenceGroupClassNames.detailsButton,\n useDetailsButtonClassName(),\n detailsButtonStyles[mode],\n state.detailsButton.className,\n );\n\n state.content.className = mergeClasses(\n referenceGroupClassNames.content,\n !isOpen && contentHiddenStyles.base,\n state.content.className,\n );\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","typographyStyles","referenceGroupClassNames","root","label","icon","detailsButton","content","useRootClassName","display","flexDirection","width","gap","spacingVerticalXS","useIconClassName","alignItems","useDetailsButtonClassName","columnGap","spacingHorizontalSNudge","body1","border","backgroundColor","color","colorNeutralForeground3","height","cursor","paddingLeft","paddingRight","useDetailsButtonStyles","canvas","sidecar","caption1","useContentHiddenStyles","base","useReferenceGroupStyles_unstable","state","mode","isOpen","iconBaseClassName","detailsButtonStyles","contentHiddenStyles","className"],"mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAIjH,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;IACNC,OAAO;IACPC,MAAM;IACNC,eAAe;IACfC,SAAS;AACX,EAAE;AAEF,MAAMC,mBAAmBX,gBAAgB;IACvCY,SAAS;IACTC,eAAe;IACfC,OAAO;IACPC,KAAKZ,OAAOa,iBAAiB;AAC/B;AAEA,MAAMC,mBAAmBjB,gBAAgB;IACvCY,SAAS;IACTM,YAAY;AACd;AAEA,MAAMC,4BAA4BnB,gBAAgB;IAChDY,SAAS;IACTQ,WAAWjB,OAAOkB,uBAAuB;IACzCH,YAAY;IACZ,GAAGd,iBAAiBkB,KAAK;IACzBC,QAAQ;IACRC,iBAAiB;IACjBC,OAAOtB,OAAOuB,uBAAuB;IACrCC,QAAQ;IACRC,QAAQ;IACRd,OAAO;IACPe,aAAa;IACbC,cAAc;AAChB;AAEA,MAAMC,yBAAyB9B,WAAW;IACxC+B,QAAQ,CAAC;IAETC,SAAS;QACP,GAAG7B,iBAAiB8B,QAAQ;IAC9B;AACF;AAEA,MAAMC,yBAAyBlC,WAAW;IACxCmC,MAAM;QACJxB,SAAS;IACX;AACF;AAEA;;CAEC,GACD,OAAO,MAAMyB,mCAAmC,CAACC;IAC/C,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGF;IAEzB,MAAMG,oBAAoBxB;IAC1B,MAAMyB,sBAAsBX;IAC5B,MAAMY,sBAAsBR;IAE5BG,MAAMhC,IAAI,CAACsC,SAAS,GAAG1C,aAAaG,yBAAyBC,IAAI,EAAEK,oBAAoB2B,MAAMhC,IAAI,CAACsC,SAAS;IAE3GN,MAAM/B,KAAK,CAACqC,SAAS,GAAG1C,aAAaG,yBAAyBE,KAAK,EAAE+B,MAAM/B,KAAK,CAACqC,SAAS;IAE1F,IAAIN,MAAM9B,IAAI,EAAE;QACd8B,MAAM9B,IAAI,CAACoC,SAAS,GAAG1C,aAAaG,yBAAyBG,IAAI,EAAEiC,mBAAmBH,MAAM9B,IAAI,CAACoC,SAAS;IAC5G;IAEAN,MAAM7B,aAAa,CAACmC,SAAS,GAAG1C,aAC9BG,yBAAyBI,aAAa,EACtCU,6BACAuB,mBAAmB,CAACH,KAAK,EACzBD,MAAM7B,aAAa,CAACmC,SAAS;IAG/BN,MAAM5B,OAAO,CAACkC,SAAS,GAAG1C,aACxBG,yBAAyBK,OAAO,EAChC,CAAC8B,UAAUG,oBAAoBP,IAAI,EACnCE,MAAM5B,OAAO,CAACkC,SAAS;IAGzB,OAAON;AACT,EAAE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useReferenceGroupToggle_unstable } from './useReferenceGroupToggle';
|
|
3
|
+
import { renderReferenceGroupToggle_unstable } from './renderReferenceGroupToggle';
|
|
4
|
+
import { useReferenceGroupToggleStyles_unstable } from './useReferenceGroupToggleStyles';
|
|
5
|
+
// ReferenceGroupToggle component - TODO: add more docs
|
|
6
|
+
export const ReferenceGroupToggle = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
|
+
const state = useReferenceGroupToggle_unstable(props, ref);
|
|
8
|
+
useReferenceGroupToggleStyles_unstable(state);
|
|
9
|
+
return renderReferenceGroupToggle_unstable(state);
|
|
10
|
+
});
|
|
11
|
+
ReferenceGroupToggle.displayName = 'ReferenceGroupToggle';
|
|
12
|
+
//# sourceMappingURL=ReferenceGroupToggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceGroupToggle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useReferenceGroupToggle_unstable } from './useReferenceGroupToggle';\nimport { renderReferenceGroupToggle_unstable } from './renderReferenceGroupToggle';\nimport { useReferenceGroupToggleStyles_unstable } from './useReferenceGroupToggleStyles';\nimport type { ReferenceGroupToggleProps } from './ReferenceGroupToggle.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ReferenceGroupToggle component - TODO: add more docs\nexport const ReferenceGroupToggle: ForwardRefComponent<ReferenceGroupToggleProps> = React.forwardRef((props, ref) => {\n const state = useReferenceGroupToggle_unstable(props, ref);\n\n useReferenceGroupToggleStyles_unstable(state);\n return renderReferenceGroupToggle_unstable(state);\n});\n\nReferenceGroupToggle.displayName = 'ReferenceGroupToggle';\n"],"names":["React","useReferenceGroupToggle_unstable","renderReferenceGroupToggle_unstable","useReferenceGroupToggleStyles_unstable","ReferenceGroupToggle","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,mCAAmC,QAAQ,+BAA+B;AACnF,SAASC,sCAAsC,QAAQ,kCAAkC;AAIzF,uDAAuD;AACvD,OAAO,MAAMC,qCAAuEJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC3G,MAAMC,QAAQP,iCAAiCK,OAAOC;IAEtDJ,uCAAuCK;IACvC,OAAON,oCAAoCM;AAC7C,GAAG;AAEHJ,qBAAqBK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ReferenceGroupToggle.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type ReferenceGroupToggleSlots = {\n root: NonNullable<Slot<'button'>>;\n icon?: Slot<'span'>;\n};\n\n/**\n * ReferenceGroupToggle Props\n */\nexport type ReferenceGroupToggleProps = ComponentProps<ReferenceGroupToggleSlots> & {\n isOpen?: boolean;\n};\n\n/**\n * State used in rendering ReferenceGroupToggle\n */\nexport type ReferenceGroupToggleState = ComponentState<ReferenceGroupToggleSlots> &\n Required<Pick<ReferenceGroupToggleProps, 'isOpen'>>;\n"],"names":[],"mappings":"AAAA,WAkBsD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ReferenceGroupToggle';\nexport * from './ReferenceGroupToggle.types';\nexport * from './renderReferenceGroupToggle';\nexport * from './useReferenceGroupToggle';\nexport * from './useReferenceGroupToggleStyles';\n"],"names":[],"mappings":"AAAA,cAAc,yBAAyB;AACvC,cAAc,+BAA+B;AAC7C,cAAc,+BAA+B;AAC7C,cAAc,4BAA4B;AAC1C,cAAc,kCAAkC"}
|