@fluentui/react-infobutton 9.0.0-beta.2 → 9.0.0-beta.21
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 +530 -1
- package/CHANGELOG.md +210 -2
- package/dist/index.d.ts +1 -1
- package/lib/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
- package/lib/components/InfoButton/InfoButton.js +0 -1
- package/lib/components/InfoButton/InfoButton.js.map +1 -1
- package/lib/components/InfoButton/InfoButton.types.js.map +1 -1
- package/lib/components/InfoButton/renderInfoButton.js +6 -4
- package/lib/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButton.js +3 -3
- package/lib/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButtonStyles.js +108 -142
- package/lib/components/InfoButton/useInfoButtonStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/InfoButton.js +0 -2
- package/lib-commonjs/InfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js +0 -2
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.js +0 -6
- package/lib-commonjs/components/InfoButton/InfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.types.js.map +1 -1
- package/lib-commonjs/components/InfoButton/index.js +0 -6
- package/lib-commonjs/components/InfoButton/index.js.map +1 -1
- package/lib-commonjs/components/InfoButton/renderInfoButton.js +6 -9
- package/lib-commonjs/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButton.js +3 -10
- package/lib-commonjs/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js +107 -147
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js.map +1 -1
- package/lib-commonjs/index.js +0 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -8
- package/Spec.md +0 -143
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createFocusOutlineStyle } from '@fluentui/react-tabster';
|
|
2
2
|
import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';
|
|
3
3
|
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
4
4
|
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
@@ -11,166 +11,132 @@ export const infoButtonClassNames = {
|
|
|
11
11
|
/**
|
|
12
12
|
* Styles for the root slot
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
14
|
const useButtonStyles = /*#__PURE__*/__styles({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"uwmqm3": ["fruq291", "f7x41pl"],
|
|
51
|
-
"D0sxk3": "f16u1re",
|
|
52
|
-
"t6yez3": "f1rw4040",
|
|
53
|
-
"Jwef8y": "fjxutwb",
|
|
54
|
-
"Bi91k9c": "f139oj5f",
|
|
55
|
-
"Bk3fhr4": "f1jpd6y0",
|
|
56
|
-
"Bmfj8id": "fuxngvv",
|
|
57
|
-
"iro3zm": "fwiml72",
|
|
58
|
-
"B2d53fq": "f1fg1p5m"
|
|
15
|
+
base: {
|
|
16
|
+
Bt984gj: "f122n59",
|
|
17
|
+
B7ck84d: "f1ewtqcl",
|
|
18
|
+
mc9l5x: "ftuwxu6",
|
|
19
|
+
Brf1p80: "f4d9j23",
|
|
20
|
+
w71qe1: "f1iuv45f",
|
|
21
|
+
ha4doy: "fmrv4ls",
|
|
22
|
+
qhf8xq: "f10pi13n",
|
|
23
|
+
De3pzq: "f1c21dwh",
|
|
24
|
+
sj55zd: "fkfq4zb",
|
|
25
|
+
icvyot: "f1ern45e",
|
|
26
|
+
vrafjx: ["f1n71otn", "f1deefiw"],
|
|
27
|
+
oivjwe: "f1h8hb77",
|
|
28
|
+
wvpqe5: ["f1deefiw", "f1n71otn"],
|
|
29
|
+
Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
|
|
30
|
+
Beyfa6y: ["f16jpd5f", "f1aa9q02"],
|
|
31
|
+
B7oj6ja: ["f1jar5jt", "fyu767a"],
|
|
32
|
+
Btl43ni: ["fyu767a", "f1jar5jt"],
|
|
33
|
+
B6of3ja: "f1hu3pq6",
|
|
34
|
+
t21cq0: ["f11qmguv", "f1tyq0we"],
|
|
35
|
+
jrapky: "f19f4twv",
|
|
36
|
+
Frg6f3: ["f1tyq0we", "f11qmguv"],
|
|
37
|
+
z8tnut: "f1ywm7hm",
|
|
38
|
+
z189sj: ["f7x41pl", "fruq291"],
|
|
39
|
+
Byoj8tv: "f14wxoun",
|
|
40
|
+
uwmqm3: ["fruq291", "f7x41pl"],
|
|
41
|
+
D0sxk3: "f16u1re",
|
|
42
|
+
t6yez3: "f1rw4040",
|
|
43
|
+
Jwef8y: "fjxutwb",
|
|
44
|
+
Bi91k9c: "f139oj5f",
|
|
45
|
+
Bk3fhr4: "f1jpd6y0",
|
|
46
|
+
Bmfj8id: "fuxngvv",
|
|
47
|
+
iro3zm: "fwiml72",
|
|
48
|
+
B2d53fq: "f1fg1p5m"
|
|
59
49
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"Bn1d65q": ["f1xeojaw", "f1hodmrf"],
|
|
68
|
-
"Bxeuatn": "fcbbwn3",
|
|
69
|
-
"n51gp8": ["f1hodmrf", "f1xeojaw"],
|
|
70
|
-
"Bbusuzp": "f1cg6951"
|
|
50
|
+
selected: {
|
|
51
|
+
De3pzq: "f1q9pm1r",
|
|
52
|
+
sj55zd: "f1qj7y59",
|
|
53
|
+
D0sxk3: "fgzdkf0",
|
|
54
|
+
t6yez3: "f15q0o9g",
|
|
55
|
+
Bsw6fvg: "f1rirnrt",
|
|
56
|
+
Bbusuzp: "f1cg6951"
|
|
71
57
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"Bbusuzp": "fn0tkbb",
|
|
78
|
-
"w76p1f": "f18rpr9v",
|
|
79
|
-
"B3sm7at": "f5mt1fw",
|
|
80
|
-
"fe9h6n": "f17188ff",
|
|
81
|
-
"Bmhq1k7": ["fzyms9j", "f12bfk5t"],
|
|
82
|
-
"E428ku": "f1ucftwv",
|
|
83
|
-
"Bipfp3": ["f12bfk5t", "fzyms9j"],
|
|
84
|
-
"nrfbsj": "f10s0nbj"
|
|
58
|
+
highContrast: {
|
|
59
|
+
Bbusuzp: "fn0tkbb",
|
|
60
|
+
Bs6v0vm: "f1rp3av6",
|
|
61
|
+
B46dtvo: "f1u7gwqv",
|
|
62
|
+
gh1jta: "fl6kagl"
|
|
85
63
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
64
|
+
focusIndicator: {
|
|
65
|
+
Brovlpu: "ftqa4ok",
|
|
66
|
+
B486eqv: "f2hkw1w",
|
|
67
|
+
B8q5s1w: "f8hki3x",
|
|
68
|
+
Bci5o5g: ["f1d2448m", "ffh67wi"],
|
|
69
|
+
n8qw10: "f1bjia2o",
|
|
70
|
+
Bdrgwmp: ["ffh67wi", "f1d2448m"],
|
|
71
|
+
Bm4h7ae: "f15bsgw9",
|
|
72
|
+
B7ys5i9: "f14e48fq",
|
|
73
|
+
Busjfv9: "f18yb2kv",
|
|
74
|
+
Bhk32uz: "fd6o370",
|
|
75
|
+
Bf4ptjt: "fh1cnn4",
|
|
76
|
+
kclons: ["fy7oxxb", "f184ne2d"],
|
|
77
|
+
Bhdgwq3: "fpukqih",
|
|
78
|
+
Blkhhs4: ["f184ne2d", "fy7oxxb"],
|
|
79
|
+
Bqtpl0w: "frrh606",
|
|
80
|
+
clg4pj: ["f1v5zibi", "fo2hd23"],
|
|
81
|
+
hgwjuy: "ful5kiu",
|
|
82
|
+
Bonggc9: ["fo2hd23", "f1v5zibi"],
|
|
83
|
+
B1tsrr9: ["f1jqcqds", "ftffrms"],
|
|
84
|
+
Dah5zi: ["ftffrms", "f1jqcqds"],
|
|
85
|
+
Bkh64rk: ["f2e7qr6", "fsr1zz6"],
|
|
86
|
+
qqdqy8: ["fsr1zz6", "f2e7qr6"],
|
|
87
|
+
B6dhp37: "f1dvezut",
|
|
88
|
+
i03rao: ["fd0oaoj", "f1cwg4i8"],
|
|
89
|
+
Boxcth7: "fjvm52t",
|
|
90
|
+
Bsom6fd: ["f1cwg4i8", "fd0oaoj"],
|
|
91
|
+
J0r882: "fdiulkx",
|
|
92
|
+
Bjwuhne: "f1yalx80",
|
|
93
|
+
Ghsupd: ["fq22d5a", "f1jw7pan"],
|
|
94
|
+
Bule8hv: ["f1jw7pan", "fq22d5a"]
|
|
102
95
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
96
|
+
large: {
|
|
97
|
+
z8tnut: "fclwglc",
|
|
98
|
+
z189sj: ["f1w3695s", "f1b0r8ql"],
|
|
99
|
+
Byoj8tv: "fywfov9",
|
|
100
|
+
uwmqm3: ["f1b0r8ql", "f1w3695s"]
|
|
108
101
|
}
|
|
109
102
|
}, {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}], ["@media (forced-colors: active){.f14pvji2{border-top-color:Canvas;}}", {
|
|
115
|
-
"m": "(forced-colors: active)"
|
|
116
|
-
}], ["@media (forced-colors: active){.f1xeojaw{border-right-color:Canvas;}.f1hodmrf{border-left-color:Canvas;}}", {
|
|
117
|
-
"m": "(forced-colors: active)"
|
|
118
|
-
}], ["@media (forced-colors: active){.fcbbwn3{border-bottom-color:Canvas;}}", {
|
|
119
|
-
"m": "(forced-colors: active)"
|
|
120
|
-
}], ["@media (forced-colors: active){.f1hodmrf{border-left-color:Canvas;}.f1xeojaw{border-right-color:Canvas;}}", {
|
|
121
|
-
"m": "(forced-colors: active)"
|
|
103
|
+
d: [".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f1ewtqcl{box-sizing:border-box;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f1iuv45f{text-decoration-line:none;}", ".fmrv4ls{vertical-align:middle;}", ".f10pi13n{position:relative;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".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);}", ".f1hu3pq6{margin-top:0;}", ".f11qmguv{margin-right:0;}", ".f1tyq0we{margin-left:0;}", ".f19f4twv{margin-bottom:0;}", ".f1ywm7hm{padding-top:var(--spacingVerticalXS);}", ".f7x41pl{padding-right:var(--spacingHorizontalXS);}", ".fruq291{padding-left:var(--spacingHorizontalXS);}", ".f14wxoun{padding-bottom:var(--spacingVerticalXS);}", ".f16u1re .fui-Icon-filled{display:none;}", ".f1rw4040 .fui-Icon-regular{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f1q9pm1r{background-color:var(--colorTransparentBackgroundSelected);}", ".f1qj7y59{color:var(--colorNeutralForeground2BrandSelected);}", ".fgzdkf0 .fui-Icon-filled{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f15q0o9g .fui-Icon-regular{display:none;}", ".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}", ".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}", ".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}", ".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}", ".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}", ".f14e48fq[data-fui-focus-visible]::after{position:absolute;}", ".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}", ".fd6o370[data-fui-focus-visible]::after{z-index:1;}", ".fh1cnn4[data-fui-focus-visible]::after{border-top-style:solid;}", ".fy7oxxb[data-fui-focus-visible]::after{border-right-style:solid;}", ".f184ne2d[data-fui-focus-visible]::after{border-left-style:solid;}", ".fpukqih[data-fui-focus-visible]::after{border-bottom-style:solid;}", ".frrh606[data-fui-focus-visible]::after{border-top-width:2px;}", ".f1v5zibi[data-fui-focus-visible]::after{border-right-width:2px;}", ".fo2hd23[data-fui-focus-visible]::after{border-left-width:2px;}", ".ful5kiu[data-fui-focus-visible]::after{border-bottom-width:2px;}", ".f1jqcqds[data-fui-focus-visible]::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".ftffrms[data-fui-focus-visible]::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f2e7qr6[data-fui-focus-visible]::after{border-top-right-radius:var(--borderRadiusMedium);}", ".fsr1zz6[data-fui-focus-visible]::after{border-top-left-radius:var(--borderRadiusMedium);}", ".f1dvezut[data-fui-focus-visible]::after{border-top-color:var(--colorStrokeFocus2);}", ".fd0oaoj[data-fui-focus-visible]::after{border-right-color:var(--colorStrokeFocus2);}", ".f1cwg4i8[data-fui-focus-visible]::after{border-left-color:var(--colorStrokeFocus2);}", ".fjvm52t[data-fui-focus-visible]::after{border-bottom-color:var(--colorStrokeFocus2);}", ".fdiulkx[data-fui-focus-visible]::after{top:-2px;}", ".f1yalx80[data-fui-focus-visible]::after{bottom:-2px;}", ".fq22d5a[data-fui-focus-visible]::after{left:-2px;}", ".f1jw7pan[data-fui-focus-visible]::after{right:-2px;}", ".fclwglc{padding-top:var(--spacingVerticalXXS);}", ".f1w3695s{padding-right:var(--spacingVerticalXXS);}", ".f1b0r8ql{padding-left:var(--spacingVerticalXXS);}", ".fywfov9{padding-bottom:var(--spacingVerticalXXS);}"],
|
|
104
|
+
h: [".fjxutwb:hover{background-color:var(--colorTransparentBackgroundHover);}", ".f139oj5f:hover{color:var(--colorNeutralForeground2BrandHover);}", ".f1jpd6y0:hover .fui-Icon-filled{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".fuxngvv:hover .fui-Icon-regular{display:none;}", ".fwiml72:hover:active{background-color:var(--colorTransparentBackgroundPressed);}", ".f1fg1p5m:hover:active{color:var(--colorNeutralForeground2BrandPressed);}"],
|
|
105
|
+
m: [["@media (forced-colors: active){.f1rirnrt{background-color:Highlight;}}", {
|
|
106
|
+
m: "(forced-colors: active)"
|
|
122
107
|
}], ["@media (forced-colors: active){.f1cg6951{color:Canvas;}}", {
|
|
123
|
-
|
|
124
|
-
}], ["@media (forced-colors: active){.f14pvji2{border-top-color:Canvas;}}", {
|
|
125
|
-
"m": "(forced-colors: active)"
|
|
126
|
-
}], ["@media (forced-colors: active){.f1xeojaw{border-right-color:Canvas;}.f1hodmrf{border-left-color:Canvas;}}", {
|
|
127
|
-
"m": "(forced-colors: active)"
|
|
128
|
-
}], ["@media (forced-colors: active){.fcbbwn3{border-bottom-color:Canvas;}}", {
|
|
129
|
-
"m": "(forced-colors: active)"
|
|
130
|
-
}], ["@media (forced-colors: active){.f1hodmrf{border-left-color:Canvas;}.f1xeojaw{border-right-color:Canvas;}}", {
|
|
131
|
-
"m": "(forced-colors: active)"
|
|
108
|
+
m: "(forced-colors: active)"
|
|
132
109
|
}], ["@media (forced-colors: active){.fn0tkbb{color:CanvasText;}}", {
|
|
133
|
-
|
|
134
|
-
}], ["@media (forced-colors: active){.
|
|
135
|
-
|
|
136
|
-
}], ["@media (forced-colors: active){.
|
|
137
|
-
|
|
138
|
-
}], ["@media (forced-colors: active){.
|
|
139
|
-
|
|
140
|
-
}], ["@media (forced-colors: active){.fzyms9j:hover,.fzyms9j :hover:active{border-right-color:Canvas;}.f12bfk5t:hover,.f12bfk5t :hover:active{border-left-color:Canvas;}}", {
|
|
141
|
-
"m": "(forced-colors: active)"
|
|
142
|
-
}], ["@media (forced-colors: active){.f1ucftwv:hover,.f1ucftwv :hover:active{border-bottom-color:Canvas;}}", {
|
|
143
|
-
"m": "(forced-colors: active)"
|
|
144
|
-
}], ["@media (forced-colors: active){.f12bfk5t:hover,.f12bfk5t :hover:active{border-left-color:Canvas;}.fzyms9j:hover,.fzyms9j :hover:active{border-right-color:Canvas;}}", {
|
|
145
|
-
"m": "(forced-colors: active)"
|
|
146
|
-
}], ["@media (forced-colors: active){.f10s0nbj:hover,.f10s0nbj :hover:active{color:Canvas;}}", {
|
|
147
|
-
"m": "(forced-colors: active)"
|
|
110
|
+
m: "(forced-colors: active)"
|
|
111
|
+
}], ["@media (forced-colors: active){.f1rp3av6:hover,.f1rp3av6:hover:active{forced-color-adjust:none;}}", {
|
|
112
|
+
m: "(forced-colors: active)"
|
|
113
|
+
}], ["@media (forced-colors: active){.f1u7gwqv:hover,.f1u7gwqv:hover:active{background-color:Highlight;}}", {
|
|
114
|
+
m: "(forced-colors: active)"
|
|
115
|
+
}], ["@media (forced-colors: active){.fl6kagl:hover,.fl6kagl:hover:active{color:Canvas;}}", {
|
|
116
|
+
m: "(forced-colors: active)"
|
|
148
117
|
}]],
|
|
149
|
-
|
|
150
|
-
|
|
118
|
+
f: [".ftqa4ok:focus{outline-style:none;}"],
|
|
119
|
+
i: [".f2hkw1w:focus-visible{outline-style:none;}"]
|
|
151
120
|
});
|
|
152
|
-
|
|
153
121
|
const usePopoverSurfaceStyles = /*#__PURE__*/__styles({
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
122
|
+
smallMedium: {
|
|
123
|
+
Bahqtrf: "fk6fouc",
|
|
124
|
+
Be2twd7: "fy9rknc",
|
|
125
|
+
Bhrd7zp: "figsok6",
|
|
126
|
+
Bg96gwp: "fwrc4pm"
|
|
159
127
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
128
|
+
large: {
|
|
129
|
+
Bahqtrf: "fk6fouc",
|
|
130
|
+
Be2twd7: "fkhj508",
|
|
131
|
+
Bhrd7zp: "figsok6",
|
|
132
|
+
Bg96gwp: "f1i3iumi"
|
|
165
133
|
}
|
|
166
134
|
}, {
|
|
167
|
-
|
|
135
|
+
d: [".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"]
|
|
168
136
|
});
|
|
169
137
|
/**
|
|
170
138
|
* Apply styling to the InfoButton slots based on the state
|
|
171
139
|
*/
|
|
172
|
-
|
|
173
|
-
|
|
174
140
|
export const useInfoButtonStyles_unstable = state => {
|
|
175
141
|
const {
|
|
176
142
|
size
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["createFocusOutlineStyle","iconFilledClassName","iconRegularClassName","__styles","mergeClasses","shorthands","tokens","typographyStyles","infoButtonClassNames","root","popover","content","useButtonStyles","base","Bt984gj","B7ck84d","mc9l5x","Brf1p80","w71qe1","ha4doy","qhf8xq","De3pzq","sj55zd","icvyot","vrafjx","oivjwe","wvpqe5","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","D0sxk3","t6yez3","Jwef8y","Bi91k9c","Bk3fhr4","Bmfj8id","iro3zm","B2d53fq","selected","Bsw6fvg","Bbusuzp","highContrast","Bs6v0vm","B46dtvo","gh1jta","focusIndicator","Brovlpu","B486eqv","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","Bm4h7ae","B7ys5i9","Busjfv9","Bhk32uz","Bf4ptjt","kclons","Bhdgwq3","Blkhhs4","Bqtpl0w","clg4pj","hgwjuy","Bonggc9","B1tsrr9","Dah5zi","Bkh64rk","qqdqy8","B6dhp37","i03rao","Boxcth7","Bsom6fd","J0r882","Bjwuhne","Ghsupd","Bule8hv","large","d","h","m","f","i","usePopoverSurfaceStyles","smallMedium","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","useInfoButtonStyles_unstable","state","size","open","buttonStyles","popoverSurfaceStyles","className"],"sources":["../src/packages/react-components/react-infobutton/src/components/InfoButton/useInfoButtonStyles.ts"],"sourcesContent":["import { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { InfoButtonSlots, InfoButtonState } from './InfoButton.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const infoButtonClassNames: SlotClassNames<InfoButtonSlots> = {\n root: 'fui-InfoButton',\n // this className won't be used, but it's needed to satisfy the type checker\n popover: 'fui-InfoButton__popover',\n content: 'fui-InfoButton__content',\n};\n\n/**\n * Styles for the root slot\n */\nconst useButtonStyles = makeStyles({\n base: {\n alignItems: 'center',\n boxSizing: 'border-box',\n display: 'inline-flex',\n justifyContent: 'center',\n textDecorationLine: 'none',\n verticalAlign: 'middle',\n position: 'relative',\n\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForeground2,\n\n ...shorthands.borderStyle('none'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.margin(0),\n ...shorthands.padding(tokens.spacingVerticalXS, tokens.spacingHorizontalXS),\n\n [`& .${iconFilledClassName}`]: {\n display: 'none',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'inline-flex',\n },\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n color: tokens.colorNeutralForeground2BrandHover,\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline-flex',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n },\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n\n selected: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n color: tokens.colorNeutralForeground2BrandSelected,\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline-flex',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n color: 'Canvas',\n },\n },\n\n highContrast: {\n '@media (forced-colors: active)': {\n color: 'CanvasText',\n\n ':hover,:hover:active': {\n forcedColorAdjust: 'none',\n backgroundColor: 'Highlight',\n color: 'Canvas',\n },\n },\n },\n\n focusIndicator: createFocusOutlineStyle(),\n\n large: {\n ...shorthands.padding(tokens.spacingVerticalXXS, tokens.spacingVerticalXXS),\n },\n});\n\nconst usePopoverSurfaceStyles = makeStyles({\n smallMedium: typographyStyles.caption1,\n large: typographyStyles.body1,\n});\n\n/**\n * Apply styling to the InfoButton slots based on the state\n */\nexport const useInfoButtonStyles_unstable = (state: InfoButtonState): InfoButtonState => {\n const { size } = state;\n const { open } = state.popover;\n const buttonStyles = useButtonStyles();\n const popoverSurfaceStyles = usePopoverSurfaceStyles();\n\n state.content.className = mergeClasses(\n infoButtonClassNames.content,\n size === 'large' && popoverSurfaceStyles.large,\n state.content.className,\n );\n\n state.root.className = mergeClasses(\n infoButtonClassNames.root,\n buttonStyles.base,\n buttonStyles.highContrast,\n buttonStyles.focusIndicator,\n open && buttonStyles.selected,\n size === 'large' && buttonStyles.large,\n state.root.className,\n );\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,yBAAyB;AACjE,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,uBAAuB;AACjF,SAAAC,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAIhE,OAAO,MAAMC,oBAAoB,GAAoC;EACnEC,IAAI,EAAE,gBAAgB;EACtB;EACAC,OAAO,EAAE,yBAAyB;EAClCC,OAAO,EAAE;CACV;AAED;;;AAGA,MAAMC,eAAe,gBAAGT,QAAA;EAAAU,IAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAA1B,MAAA;IAAAC,MAAA;IAAAiB,MAAA;IAAAC,MAAA;IAAAQ,OAAA;IAAAC,OAAA;EAAA;EAAAC,YAAA;IAAAD,OAAA;IAAAE,OAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,cAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,KAAA;IAAAlD,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAgD,CAAA;EAAAC,CAAA;EAAAC,CAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;EAAAC,CAAA;EAAAC,CAAA;AAAA,EA4EtB;AAEF,MAAMC,uBAAuB,gBAAGxF,QAAA;EAAAyF,WAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAX,KAAA;IAAAQ,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAV,CAAA;AAAA,EAG9B;AAEF;;;AAGA,OAAO,MAAMW,4BAA4B,GAAIC,KAAsB,IAAqB;EACtF,MAAM;IAAEC;EAAI,CAAE,GAAGD,KAAK;EACtB,MAAM;IAAEE;EAAI,CAAE,GAAGF,KAAK,CAACxF,OAAO;EAC9B,MAAM2F,YAAY,GAAGzF,eAAe,EAAE;EACtC,MAAM0F,oBAAoB,GAAGX,uBAAuB,EAAE;EAEtDO,KAAK,CAACvF,OAAO,CAAC4F,SAAS,GAAGnG,YAAY,CACpCI,oBAAoB,CAACG,OAAO,EAC5BwF,IAAI,KAAK,OAAO,IAAIG,oBAAoB,CAACjB,KAAK,EAC9Ca,KAAK,CAACvF,OAAO,CAAC4F,SAAS,CACxB;EAEDL,KAAK,CAACzF,IAAI,CAAC8F,SAAS,GAAGnG,YAAY,CACjCI,oBAAoB,CAACC,IAAI,EACzB4F,YAAY,CAACxF,IAAI,EACjBwF,YAAY,CAACnD,YAAY,EACzBmD,YAAY,CAAC/C,cAAc,EAC3B8C,IAAI,IAAIC,YAAY,CAACtD,QAAQ,EAC7BoD,IAAI,KAAK,OAAO,IAAIE,YAAY,CAAChB,KAAK,EACtCa,KAAK,CAACzF,IAAI,CAAC8F,SAAS,CACrB;EAED,OAAOL,KAAK;AACd,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-infobutton/src/index.ts"],"
|
|
1
|
+
{"version":3,"names":["InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable"],"sources":["../src/packages/react-components/react-infobutton/src/index.ts"],"sourcesContent":["export {\n InfoButton,\n infoButtonClassNames,\n renderInfoButton_unstable,\n useInfoButtonStyles_unstable,\n useInfoButton_unstable,\n} from './InfoButton';\nexport type { InfoButtonProps, InfoButtonSlots, InfoButtonState } from './InfoButton';\n"],"mappings":"AAAA,SACEA,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,QACjB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-infobutton/src/InfoButton.ts"],"
|
|
1
|
+
{"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-infobutton/src/InfoButton.ts"],"sourcesContent":["export * from './components/InfoButton/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,mCAAAC,OAAA"}
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DefaultInfoButtonIcon20 = exports.DefaultInfoButtonIcon16 = exports.DefaultInfoButtonIcon12 = void 0;
|
|
7
|
-
|
|
8
7
|
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
|
9
|
-
|
|
10
8
|
exports.DefaultInfoButtonIcon12 = /*#__PURE__*/react_icons_1.bundleIcon(react_icons_1.Info12Filled, react_icons_1.Info12Regular);
|
|
11
9
|
exports.DefaultInfoButtonIcon16 = /*#__PURE__*/react_icons_1.bundleIcon(react_icons_1.Info16Filled, react_icons_1.Info16Regular);
|
|
12
10
|
exports.DefaultInfoButtonIcon20 = /*#__PURE__*/react_icons_1.bundleIcon(react_icons_1.Info20Filled, react_icons_1.Info20Regular);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-infobutton/src/components/InfoButton/DefaultInfoButtonIcons.tsx"],"
|
|
1
|
+
{"version":3,"names":["react_icons_1","require","exports","DefaultInfoButtonIcon12","bundleIcon","Info12Filled","Info12Regular","DefaultInfoButtonIcon16","Info16Filled","Info16Regular","DefaultInfoButtonIcon20","Info20Filled","Info20Regular"],"sources":["../src/packages/react-components/react-infobutton/src/components/InfoButton/DefaultInfoButtonIcons.tsx"],"sourcesContent":["import {\n Info12Regular,\n Info12Filled,\n Info16Regular,\n Info16Filled,\n Info20Regular,\n Info20Filled,\n bundleIcon,\n} from '@fluentui/react-icons';\n\nexport const DefaultInfoButtonIcon12 = bundleIcon(Info12Filled, Info12Regular);\nexport const DefaultInfoButtonIcon16 = bundleIcon(Info16Filled, Info16Regular);\nexport const DefaultInfoButtonIcon20 = bundleIcon(Info20Filled, Info20Regular);\n"],"mappings":";;;;;;AAAA,MAAAA,aAAA,gBAAAC,OAAA;AAUaC,OAAA,CAAAC,uBAAuB,gBAAGH,aAAA,CAAAI,UAAU,CAACJ,aAAA,CAAAK,YAAY,EAAEL,aAAA,CAAAM,aAAa,CAAC;AACjEJ,OAAA,CAAAK,uBAAuB,gBAAGP,aAAA,CAAAI,UAAU,CAACJ,aAAA,CAAAQ,YAAY,EAAER,aAAA,CAAAS,aAAa,CAAC;AACjEP,OAAA,CAAAQ,uBAAuB,gBAAGV,aAAA,CAAAI,UAAU,CAACJ,aAAA,CAAAW,YAAY,EAAEX,aAAA,CAAAY,aAAa,CAAC"}
|
|
@@ -4,19 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.InfoButton = void 0;
|
|
7
|
-
|
|
8
7
|
const React = /*#__PURE__*/require("react");
|
|
9
|
-
|
|
10
8
|
const renderInfoButton_1 = /*#__PURE__*/require("./renderInfoButton");
|
|
11
|
-
|
|
12
9
|
const useInfoButton_1 = /*#__PURE__*/require("./useInfoButton");
|
|
13
|
-
|
|
14
10
|
const useInfoButtonStyles_1 = /*#__PURE__*/require("./useInfoButtonStyles");
|
|
15
11
|
/**
|
|
16
12
|
* InfoButtons provide a way to display additional information about a form field or an area in the UI.
|
|
17
13
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
14
|
exports.InfoButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
21
15
|
const state = useInfoButton_1.useInfoButton_unstable(props, ref);
|
|
22
16
|
useInfoButtonStyles_1.useInfoButtonStyles_unstable(state);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-infobutton/src/components/InfoButton/InfoButton.tsx"],"
|
|
1
|
+
{"version":3,"names":["React","require","renderInfoButton_1","useInfoButton_1","useInfoButtonStyles_1","exports","InfoButton","forwardRef","props","ref","state","useInfoButton_unstable","useInfoButtonStyles_unstable","renderInfoButton_unstable","displayName"],"sources":["../src/packages/react-components/react-infobutton/src/components/InfoButton/InfoButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderInfoButton_unstable } from './renderInfoButton';\nimport { useInfoButton_unstable } from './useInfoButton';\nimport { useInfoButtonStyles_unstable } from './useInfoButtonStyles';\nimport type { InfoButtonProps } from './InfoButton.types';\n\n/**\n * InfoButtons provide a way to display additional information about a form field or an area in the UI.\n */\nexport const InfoButton: ForwardRefComponent<InfoButtonProps> = React.forwardRef((props, ref) => {\n const state = useInfoButton_unstable(props, ref);\n\n useInfoButtonStyles_unstable(state);\n return renderInfoButton_unstable(state);\n});\n\nInfoButton.displayName = 'InfoButton';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AAEA,MAAAC,kBAAA,gBAAAD,OAAA;AACA,MAAAE,eAAA,gBAAAF,OAAA;AACA,MAAAG,qBAAA,gBAAAH,OAAA;AAGA;;;AAGaI,OAAA,CAAAC,UAAU,gBAAyCN,KAAK,CAACO,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9F,MAAMC,KAAK,GAAGP,eAAA,CAAAQ,sBAAsB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEhDL,qBAAA,CAAAQ,4BAA4B,CAACF,KAAK,CAAC;EACnC,OAAOR,kBAAA,CAAAW,yBAAyB,CAACH,KAAK,CAAC;AACzC,CAAC,CAAC;AAEFL,OAAA,CAAAC,UAAU,CAACQ,WAAW,GAAG,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../src/packages/react-components/react-infobutton/src/components/InfoButton/InfoButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PopoverProps, PopoverSurface } from '@fluentui/react-popover';\n\nexport type InfoButtonSlots = {\n root: NonNullable<Slot<'button'>>;\n\n /**\n * The Popover element that wraps the content and root. Use this slot to pass props to the Popover.\n */\n popover: NonNullable<Slot<Partial<PopoverProps>>>;\n\n /**\n * The content to be displayed in the PopoverSurface when the button is pressed.\n */\n content: NonNullable<Slot<typeof PopoverSurface>>;\n};\n\n/**\n * InfoButton Props\n */\nexport type InfoButtonProps = Omit<ComponentProps<Partial<InfoButtonSlots>>, 'disabled'> & {\n /**\n * Size of the InfoButton.\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n};\n\n/**\n * State used in rendering InfoButton\n */\nexport type InfoButtonState = ComponentState<InfoButtonSlots> & Required<Pick<InfoButtonProps, 'size'>>;\n"],"mappings":""}
|
|
@@ -3,16 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
|
-
|
|
9
7
|
tslib_1.__exportStar(require("./InfoButton"), exports);
|
|
10
|
-
|
|
11
8
|
tslib_1.__exportStar(require("./InfoButton.types"), exports);
|
|
12
|
-
|
|
13
9
|
tslib_1.__exportStar(require("./renderInfoButton"), exports);
|
|
14
|
-
|
|
15
10
|
tslib_1.__exportStar(require("./useInfoButton"), exports);
|
|
16
|
-
|
|
17
11
|
tslib_1.__exportStar(require("./useInfoButtonStyles"), exports);
|
|
18
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-infobutton/src/components/InfoButton/index.ts"],"
|
|
1
|
+
{"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-infobutton/src/components/InfoButton/index.ts"],"sourcesContent":["export * from './InfoButton';\nexport * from './InfoButton.types';\nexport * from './renderInfoButton';\nexport * from './useInfoButton';\nexport * from './useInfoButtonStyles';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,kBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,wBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,wBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,qBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,2BAAAC,OAAA"}
|
|
@@ -4,27 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.renderInfoButton_unstable = void 0;
|
|
7
|
-
|
|
8
7
|
const React = /*#__PURE__*/require("react");
|
|
9
|
-
|
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
11
|
-
|
|
12
9
|
const react_popover_1 = /*#__PURE__*/require("@fluentui/react-popover");
|
|
13
10
|
/**
|
|
14
11
|
* Render the final JSX of InfoButton
|
|
15
12
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
13
|
const renderInfoButton_unstable = state => {
|
|
19
14
|
const {
|
|
20
15
|
slots,
|
|
21
16
|
slotProps
|
|
22
17
|
} = react_utilities_1.getSlots(state);
|
|
23
|
-
return React.createElement(slots.popover, {
|
|
24
|
-
|
|
25
|
-
}
|
|
18
|
+
return React.createElement(slots.popover, {
|
|
19
|
+
...slotProps.popover
|
|
20
|
+
}, React.createElement(react_popover_1.PopoverTrigger, null, React.createElement(slots.root, {
|
|
21
|
+
...slotProps.root
|
|
22
|
+
})), React.createElement(slots.content, {
|
|
23
|
+
...slotProps.content
|
|
26
24
|
}));
|
|
27
25
|
};
|
|
28
|
-
|
|
29
26
|
exports.renderInfoButton_unstable = renderInfoButton_unstable;
|
|
30
27
|
//# sourceMappingURL=renderInfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-infobutton/src/components/InfoButton/renderInfoButton.tsx"],"
|
|
1
|
+
{"version":3,"names":["React","require","react_utilities_1","react_popover_1","renderInfoButton_unstable","state","slots","slotProps","getSlots","createElement","popover","PopoverTrigger","root","content","exports"],"sources":["../src/packages/react-components/react-infobutton/src/components/InfoButton/renderInfoButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { PopoverTrigger } from '@fluentui/react-popover';\nimport type { PopoverProps } from '@fluentui/react-popover';\nimport type { InfoButtonState, InfoButtonSlots } from './InfoButton.types';\n\n/**\n * Render the final JSX of InfoButton\n */\nexport const renderInfoButton_unstable = (state: InfoButtonState) => {\n const { slots, slotProps } = getSlots<InfoButtonSlots>(state);\n\n return (\n <slots.popover {...(slotProps.popover as PopoverProps)}>\n <PopoverTrigger>\n <slots.root {...slotProps.root} />\n </PopoverTrigger>\n <slots.content {...slotProps.content} />\n </slots.popover>\n );\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AACA,MAAAE,eAAA,gBAAAF,OAAA;AAIA;;;AAGO,MAAMG,yBAAyB,GAAIC,KAAsB,IAAI;EAClE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGL,iBAAA,CAAAM,QAAQ,CAAkBH,KAAK,CAAC;EAE7D,OACEL,KAAA,CAAAS,aAAA,CAACH,KAAK,CAACI,OAAO;IAAA,GAAMH,SAAS,CAACG;EAAwB,GACpDV,KAAA,CAAAS,aAAA,CAACN,eAAA,CAAAQ,cAAc,QACbX,KAAA,CAAAS,aAAA,CAACH,KAAK,CAACM,IAAI;IAAA,GAAKL,SAAS,CAACK;EAAI,EAAI,CACnB,EACjBZ,KAAA,CAAAS,aAAA,CAACH,KAAK,CAACO,OAAO;IAAA,GAAKN,SAAS,CAACM;EAAO,EAAI,CAC1B;AAEpB,CAAC;AAXYC,OAAA,CAAAV,yBAAyB,GAAAA,yBAAA"}
|
|
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useInfoButton_unstable = void 0;
|
|
7
|
-
|
|
8
7
|
const React = /*#__PURE__*/require("react");
|
|
9
|
-
|
|
10
8
|
const DefaultInfoButtonIcons_1 = /*#__PURE__*/require("./DefaultInfoButtonIcons");
|
|
11
|
-
|
|
12
9
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
13
|
-
|
|
14
10
|
const react_popover_1 = /*#__PURE__*/require("@fluentui/react-popover");
|
|
15
|
-
|
|
16
11
|
const react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
17
|
-
|
|
18
12
|
const infoButtonIconMap = {
|
|
19
13
|
small: /*#__PURE__*/React.createElement(DefaultInfoButtonIcons_1.DefaultInfoButtonIcon12, null),
|
|
20
14
|
medium: /*#__PURE__*/React.createElement(DefaultInfoButtonIcons_1.DefaultInfoButtonIcon16, null),
|
|
@@ -34,7 +28,6 @@ const popoverSizeMap = {
|
|
|
34
28
|
* @param props - props from this instance of InfoButton
|
|
35
29
|
* @param ref - reference to root HTMLElement of InfoButton
|
|
36
30
|
*/
|
|
37
|
-
|
|
38
31
|
const useInfoButton_unstable = (props, ref) => {
|
|
39
32
|
const {
|
|
40
33
|
size = 'medium'
|
|
@@ -49,13 +42,13 @@ const useInfoButton_unstable = (props, ref) => {
|
|
|
49
42
|
root: react_utilities_1.getNativeElementProps('button', {
|
|
50
43
|
children: infoButtonIconMap[size],
|
|
51
44
|
type: 'button',
|
|
45
|
+
'aria-label': 'information',
|
|
52
46
|
...props,
|
|
53
47
|
ref
|
|
54
48
|
}),
|
|
55
49
|
popover: react_utilities_1.resolveShorthand(props.popover, {
|
|
56
50
|
required: true,
|
|
57
51
|
defaultProps: {
|
|
58
|
-
children: React.createElement(React.Fragment, null),
|
|
59
52
|
positioning: 'above-start',
|
|
60
53
|
size: popoverSizeMap[size],
|
|
61
54
|
withArrow: true
|
|
@@ -64,7 +57,8 @@ const useInfoButton_unstable = (props, ref) => {
|
|
|
64
57
|
content: react_utilities_1.resolveShorthand(props.content, {
|
|
65
58
|
required: true,
|
|
66
59
|
defaultProps: {
|
|
67
|
-
role: '
|
|
60
|
+
role: 'note',
|
|
61
|
+
tabIndex: -1
|
|
68
62
|
}
|
|
69
63
|
})
|
|
70
64
|
};
|
|
@@ -77,6 +71,5 @@ const useInfoButton_unstable = (props, ref) => {
|
|
|
77
71
|
state.popover.onOpenChange = react_utilities_1.mergeCallbacks(state.popover.onOpenChange, (e, data) => setPopoverOpen(data.open));
|
|
78
72
|
return state;
|
|
79
73
|
};
|
|
80
|
-
|
|
81
74
|
exports.useInfoButton_unstable = useInfoButton_unstable;
|
|
82
75
|
//# sourceMappingURL=useInfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","require","DefaultInfoButtonIcons_1","react_utilities_1","react_popover_1","react_utilities_2","infoButtonIconMap","small","createElement","DefaultInfoButtonIcon12","medium","DefaultInfoButtonIcon16","large","DefaultInfoButtonIcon20","popoverSizeMap","useInfoButton_unstable","props","ref","size","state","components","root","popover","Popover","content","PopoverSurface","getNativeElementProps","children","type","resolveShorthand","required","defaultProps","positioning","withArrow","role","tabIndex","popoverOpen","setPopoverOpen","useControllableState","open","defaultState","defaultOpen","initialState","onOpenChange","mergeCallbacks","e","data","exports"],"sources":["../src/packages/react-components/react-infobutton/src/components/InfoButton/useInfoButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { DefaultInfoButtonIcon12, DefaultInfoButtonIcon16, DefaultInfoButtonIcon20 } from './DefaultInfoButtonIcons';\nimport { getNativeElementProps, mergeCallbacks, resolveShorthand } from '@fluentui/react-utilities';\nimport { Popover, PopoverSurface } from '@fluentui/react-popover';\nimport { useControllableState } from '@fluentui/react-utilities';\nimport type { InfoButtonProps, InfoButtonState } from './InfoButton.types';\nimport type { PopoverProps } from '@fluentui/react-popover';\n\nconst infoButtonIconMap = {\n small: <DefaultInfoButtonIcon12 />,\n medium: <DefaultInfoButtonIcon16 />,\n large: <DefaultInfoButtonIcon20 />,\n} as const;\n\nconst popoverSizeMap = {\n small: 'small',\n medium: 'small',\n large: 'medium',\n} as const;\n\n/**\n * Create the state required to render InfoButton.\n *\n * The returned state can be modified with hooks such as useInfoButtonStyles_unstable,\n * before being passed to renderInfoButton_unstable.\n *\n * @param props - props from this instance of InfoButton\n * @param ref - reference to root HTMLElement of InfoButton\n */\nexport const useInfoButton_unstable = (props: InfoButtonProps, ref: React.Ref<HTMLElement>): InfoButtonState => {\n const { size = 'medium' } = props;\n\n const state: InfoButtonState = {\n size,\n\n components: {\n root: 'button',\n popover: Popover as React.FC<Partial<PopoverProps>>,\n content: PopoverSurface,\n },\n\n root: getNativeElementProps('button', {\n children: infoButtonIconMap[size],\n type: 'button',\n 'aria-label': 'information',\n ...props,\n ref,\n }),\n popover: resolveShorthand(props.popover, {\n required: true,\n defaultProps: {\n positioning: 'above-start',\n size: popoverSizeMap[size],\n withArrow: true,\n },\n }),\n content: resolveShorthand(props.content, {\n required: true,\n defaultProps: {\n role: 'note',\n tabIndex: -1,\n },\n }),\n };\n\n const [popoverOpen, setPopoverOpen] = useControllableState({\n state: state.popover.open,\n defaultState: state.popover.defaultOpen,\n initialState: false,\n });\n\n state.popover.open = popoverOpen;\n state.popover.onOpenChange = mergeCallbacks(state.popover.onOpenChange, (e, data) => setPopoverOpen(data.open));\n\n return state;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,wBAAA,gBAAAD,OAAA;AACA,MAAAE,iBAAA,gBAAAF,OAAA;AACA,MAAAG,eAAA,gBAAAH,OAAA;AACA,MAAAI,iBAAA,gBAAAJ,OAAA;AAIA,MAAMK,iBAAiB,GAAG;EACxBC,KAAK,eAAEP,KAAA,CAAAQ,aAAA,CAACN,wBAAA,CAAAO,uBAAuB,OAAG;EAClCC,MAAM,eAAEV,KAAA,CAAAQ,aAAA,CAACN,wBAAA,CAAAS,uBAAuB,OAAG;EACnCC,KAAK,eAAEZ,KAAA,CAAAQ,aAAA,CAACN,wBAAA,CAAAW,uBAAuB;CACvB;AAEV,MAAMC,cAAc,GAAG;EACrBP,KAAK,EAAE,OAAO;EACdG,MAAM,EAAE,OAAO;EACfE,KAAK,EAAE;CACC;AAEV;;;;;;;;;AASO,MAAMG,sBAAsB,GAAGA,CAACC,KAAsB,EAAEC,GAA2B,KAAqB;EAC7G,MAAM;IAAEC,IAAI,GAAG;EAAQ,CAAE,GAAGF,KAAK;EAEjC,MAAMG,KAAK,GAAoB;IAC7BD,IAAI;IAEJE,UAAU,EAAE;MACVC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAElB,eAAA,CAAAmB,OAA0C;MACnDC,OAAO,EAAEpB,eAAA,CAAAqB;KACV;IAEDJ,IAAI,EAAElB,iBAAA,CAAAuB,qBAAqB,CAAC,QAAQ,EAAE;MACpCC,QAAQ,EAAErB,iBAAiB,CAACY,IAAI,CAAC;MACjCU,IAAI,EAAE,QAAQ;MACd,YAAY,EAAE,aAAa;MAC3B,GAAGZ,KAAK;MACRC;KACD,CAAC;IACFK,OAAO,EAAEnB,iBAAA,CAAA0B,gBAAgB,CAACb,KAAK,CAACM,OAAO,EAAE;MACvCQ,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZC,WAAW,EAAE,aAAa;QAC1Bd,IAAI,EAAEJ,cAAc,CAACI,IAAI,CAAC;QAC1Be,SAAS,EAAE;;KAEd,CAAC;IACFT,OAAO,EAAErB,iBAAA,CAAA0B,gBAAgB,CAACb,KAAK,CAACQ,OAAO,EAAE;MACvCM,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZG,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE,CAAC;;KAEd;GACF;EAED,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGhC,iBAAA,CAAAiC,oBAAoB,CAAC;IACzDnB,KAAK,EAAEA,KAAK,CAACG,OAAO,CAACiB,IAAI;IACzBC,YAAY,EAAErB,KAAK,CAACG,OAAO,CAACmB,WAAW;IACvCC,YAAY,EAAE;GACf,CAAC;EAEFvB,KAAK,CAACG,OAAO,CAACiB,IAAI,GAAGH,WAAW;EAChCjB,KAAK,CAACG,OAAO,CAACqB,YAAY,GAAGxC,iBAAA,CAAAyC,cAAc,CAACzB,KAAK,CAACG,OAAO,CAACqB,YAAY,EAAE,CAACE,CAAC,EAAEC,IAAI,KAAKT,cAAc,CAACS,IAAI,CAACP,IAAI,CAAC,CAAC;EAE/G,OAAOpB,KAAK;AACd,CAAC;AA9CY4B,OAAA,CAAAhC,sBAAsB,GAAAA,sBAAA"}
|