@fluentui/react-infobutton 9.0.0-beta.3 → 9.0.0-beta.30
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 +861 -1
- package/CHANGELOG.md +308 -2
- package/dist/index.d.ts +68 -4
- package/lib/InfoButton.js.map +1 -1
- package/lib/InfoLabel.js +2 -0
- package/lib/InfoLabel.js.map +1 -0
- package/lib/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
- package/lib/components/InfoButton/InfoButton.js +1 -2
- package/lib/components/InfoButton/InfoButton.js.map +1 -1
- package/lib/components/InfoButton/InfoButton.types.js.map +1 -1
- package/lib/components/InfoButton/index.js +1 -1
- package/lib/components/InfoButton/index.js.map +1 -1
- package/lib/components/InfoButton/renderInfoButton.js +4 -8
- package/lib/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButton.js +5 -5
- package/lib/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButtonStyles.styles.js +153 -0
- package/lib/components/InfoButton/useInfoButtonStyles.styles.js.map +1 -0
- package/lib/components/InfoLabel/InfoLabel.js +14 -0
- package/lib/components/InfoLabel/InfoLabel.js.map +1 -0
- package/lib/components/InfoLabel/InfoLabel.types.js +2 -0
- package/lib/components/InfoLabel/InfoLabel.types.js.map +1 -0
- package/lib/components/InfoLabel/index.js +6 -0
- package/lib/components/InfoLabel/index.js.map +1 -0
- package/lib/components/InfoLabel/renderInfoLabel.js +13 -0
- package/lib/components/InfoLabel/renderInfoLabel.js.map +1 -0
- package/lib/components/InfoLabel/useInfoLabel.js +75 -0
- package/lib/components/InfoLabel/useInfoLabel.js.map +1 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.styles.js +43 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.styles.js.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/InfoButton.js +4 -5
- package/lib-commonjs/InfoButton.js.map +1 -1
- package/lib-commonjs/InfoLabel.js +9 -0
- package/lib-commonjs/InfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js +16 -8
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.js +16 -21
- package/lib-commonjs/components/InfoButton/InfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.types.js +3 -2
- package/lib-commonjs/components/InfoButton/InfoButton.types.js.map +1 -1
- package/lib-commonjs/components/InfoButton/index.js +8 -13
- package/lib-commonjs/components/InfoButton/index.js.map +1 -1
- package/lib-commonjs/components/InfoButton/renderInfoButton.js +13 -26
- package/lib-commonjs/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButton.js +57 -73
- package/lib-commonjs/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.js +342 -0
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.js +21 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.types.js +7 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.types.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/index.js +13 -0
- package/lib-commonjs/components/InfoLabel/index.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/renderInfoLabel.js +16 -0
- package/lib-commonjs/components/InfoLabel/renderInfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabel.js +67 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.js +64 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.js.map +1 -0
- package/lib-commonjs/index.js +22 -35
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +17 -12
- package/Spec.md +0 -143
- package/lib/components/InfoButton/useInfoButtonStyles.js +0 -187
- package/lib/components/InfoButton/useInfoButtonStyles.js.map +0 -1
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js +0 -200
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js.map +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useInfoLabel_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useInfoLabel_unstable
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactLabel = require("@fluentui/react-label");
|
|
12
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
13
|
+
const _infoButton = require("../InfoButton/InfoButton");
|
|
14
|
+
var _infoButton1, _arialabelledby, _root, _ariaowns;
|
|
15
|
+
const useInfoLabel_unstable = (props, ref)=>{
|
|
16
|
+
const { root: rootShorthand , label: labelShorthand , infoButton: infoButtonShorthand , info , size , className , style , ...labelProps } = props;
|
|
17
|
+
const baseId = (0, _reactUtilities.useId)('infolabel-');
|
|
18
|
+
const root = (0, _reactUtilities.resolveShorthand)(rootShorthand, {
|
|
19
|
+
required: true,
|
|
20
|
+
defaultProps: {
|
|
21
|
+
className,
|
|
22
|
+
style
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const label = (0, _reactUtilities.resolveShorthand)(labelShorthand, {
|
|
26
|
+
required: true,
|
|
27
|
+
defaultProps: {
|
|
28
|
+
id: baseId + '__label',
|
|
29
|
+
ref,
|
|
30
|
+
size,
|
|
31
|
+
...labelProps
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const infoButton = (0, _reactUtilities.resolveShorthand)(infoButtonShorthand, {
|
|
35
|
+
required: !!info,
|
|
36
|
+
defaultProps: {
|
|
37
|
+
id: baseId + '__infoButton',
|
|
38
|
+
size,
|
|
39
|
+
info
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
if (infoButton) {
|
|
43
|
+
var _infoButton_info;
|
|
44
|
+
infoButton.info = (0, _reactUtilities.resolveShorthand)(infoButton === null || infoButton === void 0 ? void 0 : infoButton.info, {
|
|
45
|
+
defaultProps: {
|
|
46
|
+
id: baseId + '__info'
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
var _;
|
|
50
|
+
(_ = (_infoButton1 = infoButton)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _infoButton1[_arialabelledby] = `${label.id} ${infoButton.id}`;
|
|
51
|
+
var _1;
|
|
52
|
+
(_1 = (_root = root)[_ariaowns = 'aria-owns']) !== null && _1 !== void 0 ? _1 : _root[_ariaowns] = (_infoButton_info = infoButton.info) === null || _infoButton_info === void 0 ? void 0 : _infoButton_info.id;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
size,
|
|
56
|
+
components: {
|
|
57
|
+
root: 'span',
|
|
58
|
+
label: _reactLabel.Label,
|
|
59
|
+
infoButton: _infoButton.InfoButton
|
|
60
|
+
},
|
|
61
|
+
root,
|
|
62
|
+
label,
|
|
63
|
+
infoButton
|
|
64
|
+
};
|
|
65
|
+
}; //# sourceMappingURL=useInfoLabel.js.map
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=useInfoLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoLabel/useInfoLabel.js"],"sourcesContent":["var _infoButton, _arialabelledby, _root, _ariaowns;\nimport * as React from 'react';\nimport { Label } from '@fluentui/react-label';\nimport { resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { InfoButton } from '../InfoButton/InfoButton';\n/**\n * Create the state required to render InfoLabel.\n *\n * The returned state can be modified with hooks such as useInfoLabelStyles_unstable,\n * before being passed to renderInfoLabel_unstable.\n *\n * @param props - props from this instance of InfoLabel\n * @param ref - reference to label element of InfoLabel\n */\nexport const useInfoLabel_unstable = (props, ref) => {\n const {\n root: rootShorthand,\n label: labelShorthand,\n infoButton: infoButtonShorthand,\n info,\n size,\n className,\n style,\n ...labelProps\n } = props;\n const baseId = useId('infolabel-');\n const root = resolveShorthand(rootShorthand, {\n required: true,\n defaultProps: {\n className,\n style\n }\n });\n const label = resolveShorthand(labelShorthand, {\n required: true,\n defaultProps: {\n id: baseId + '__label',\n ref,\n size,\n ...labelProps\n }\n });\n const infoButton = resolveShorthand(infoButtonShorthand, {\n required: !!info,\n defaultProps: {\n id: baseId + '__infoButton',\n size,\n info\n }\n });\n if (infoButton) {\n var _infoButton_info;\n infoButton.info = resolveShorthand(infoButton === null || infoButton === void 0 ? void 0 : infoButton.info, {\n defaultProps: {\n id: baseId + '__info'\n }\n });\n var _;\n (_ = (_infoButton = infoButton)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _infoButton[_arialabelledby] = `${label.id} ${infoButton.id}`;\n var _1;\n (_1 = (_root = root)[_ariaowns = 'aria-owns']) !== null && _1 !== void 0 ? _1 : _root[_ariaowns] = (_infoButton_info = infoButton.info) === null || _infoButton_info === void 0 ? void 0 : _infoButton_info.id;\n }\n return {\n size,\n components: {\n root: 'span',\n label: Label,\n infoButton: InfoButton\n },\n root,\n label,\n infoButton\n };\n};\n//# sourceMappingURL=useInfoLabel.js.map"],"names":["useInfoLabel_unstable","_infoButton","_arialabelledby","_root","_ariaowns","props","ref","root","rootShorthand","label","labelShorthand","infoButton","infoButtonShorthand","info","size","className","style","labelProps","baseId","useId","resolveShorthand","required","defaultProps","id","_infoButton_info","_","_1","components","Label","InfoButton"],"mappings":";;;;+BAcaA;;aAAAA;;;6DAbU;4BACD;gCACkB;4BACb;AAJ3B,IAAIC,cAAaC,iBAAiBC,OAAOC;AAclC,MAAMJ,wBAAwB,CAACK,OAAOC,MAAQ;IACnD,MAAM,EACJC,MAAMC,cAAa,EACnBC,OAAOC,eAAc,EACrBC,YAAYC,oBAAmB,EAC/BC,KAAI,EACJC,KAAI,EACJC,UAAS,EACTC,MAAK,EACL,GAAGC,YACJ,GAAGZ;IACJ,MAAMa,SAASC,IAAAA,qBAAK,EAAC;IACrB,MAAMZ,OAAOa,IAAAA,gCAAgB,EAACZ,eAAe;QAC3Ca,UAAU,IAAI;QACdC,cAAc;YACZP;YACAC;QACF;IACF;IACA,MAAMP,QAAQW,IAAAA,gCAAgB,EAACV,gBAAgB;QAC7CW,UAAU,IAAI;QACdC,cAAc;YACZC,IAAIL,SAAS;YACbZ;YACAQ;YACA,GAAGG,UAAU;QACf;IACF;IACA,MAAMN,aAAaS,IAAAA,gCAAgB,EAACR,qBAAqB;QACvDS,UAAU,CAAC,CAACR;QACZS,cAAc;YACZC,IAAIL,SAAS;YACbJ;YACAD;QACF;IACF;IACA,IAAIF,YAAY;QACd,IAAIa;QACJb,WAAWE,IAAI,GAAGO,IAAAA,gCAAgB,EAACT,eAAe,IAAI,IAAIA,eAAe,KAAK,IAAI,KAAK,IAAIA,WAAWE,IAAI,EAAE;YAC1GS,cAAc;gBACZC,IAAIL,SAAS;YACf;QACF;QACA,IAAIO;QACHA,CAAAA,IAAI,AAACxB,CAAAA,eAAcU,UAAS,CAAE,CAACT,kBAAkB,kBAAkB,AAAD,MAAO,IAAI,IAAIuB,MAAM,KAAK,IAAIA,IAAIxB,YAAW,CAACC,gBAAgB,GAAG,CAAC,EAAEO,MAAMc,EAAE,CAAC,CAAC,EAAEZ,WAAWY,EAAE,CAAC,CAAC;QAClK,IAAIG;QACHA,CAAAA,KAAK,AAACvB,CAAAA,QAAQI,IAAG,CAAE,CAACH,YAAY,YAAY,AAAD,MAAO,IAAI,IAAIsB,OAAO,KAAK,IAAIA,KAAKvB,KAAK,CAACC,UAAU,GAAG,AAACoB,CAAAA,mBAAmBb,WAAWE,IAAI,AAAD,MAAO,IAAI,IAAIW,qBAAqB,KAAK,IAAI,KAAK,IAAIA,iBAAiBD,EAAE;IAChN,CAAC;IACD,OAAO;QACLT;QACAa,YAAY;YACVpB,MAAM;YACNE,OAAOmB,iBAAK;YACZjB,YAAYkB,sBAAU;QACxB;QACAtB;QACAE;QACAE;IACF;AACF,GACA,wCAAwC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
infoLabelClassNames: ()=>infoLabelClassNames,
|
|
13
|
+
useInfoLabelStyles_unstable: ()=>useInfoLabelStyles_unstable
|
|
14
|
+
});
|
|
15
|
+
const _react = require("@griffel/react");
|
|
16
|
+
const infoLabelClassNames = {
|
|
17
|
+
root: 'fui-InfoLabel',
|
|
18
|
+
label: 'fui-InfoLabel__label',
|
|
19
|
+
infoButton: 'fui-InfoLabel__infoButton'
|
|
20
|
+
};
|
|
21
|
+
const useLabelStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
22
|
+
base: {
|
|
23
|
+
ha4doy: "f12kltsn",
|
|
24
|
+
Bceei9c: "fpo1scq",
|
|
25
|
+
sj55zd: "f1ym3bx4"
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
d: [
|
|
29
|
+
".f12kltsn{vertical-align:top;}",
|
|
30
|
+
".fpo1scq{cursor:inherit;}",
|
|
31
|
+
".f1ym3bx4{color:inherit;}"
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
const useInfoButtonStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
35
|
+
base: {
|
|
36
|
+
ha4doy: "f12kltsn",
|
|
37
|
+
B6of3ja: "f1bmzb36",
|
|
38
|
+
jrapky: "f1nyzk09"
|
|
39
|
+
},
|
|
40
|
+
large: {
|
|
41
|
+
B6of3ja: "fkrn0sh",
|
|
42
|
+
jrapky: "fmxx68s"
|
|
43
|
+
}
|
|
44
|
+
}, {
|
|
45
|
+
d: [
|
|
46
|
+
".f12kltsn{vertical-align:top;}",
|
|
47
|
+
".f1bmzb36{margin-top:calc(0px - var(--spacingVerticalXXS));}",
|
|
48
|
+
".f1nyzk09{margin-bottom:calc(0px - var(--spacingVerticalXXS));}",
|
|
49
|
+
".fkrn0sh{margin-top:-1px;}",
|
|
50
|
+
".fmxx68s{margin-bottom:-1px;}"
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
const useInfoLabelStyles_unstable = (state)=>{
|
|
54
|
+
state.root.className = (0, _react.mergeClasses)(infoLabelClassNames.root, state.root.className);
|
|
55
|
+
const labelStyles = useLabelStyles();
|
|
56
|
+
state.label.className = (0, _react.mergeClasses)(infoLabelClassNames.label, labelStyles.base, state.label.className);
|
|
57
|
+
const infoButtonStyles = useInfoButtonStyles();
|
|
58
|
+
if (state.infoButton) {
|
|
59
|
+
state.infoButton.className = (0, _react.mergeClasses)(infoLabelClassNames.infoButton, infoButtonStyles.base, state.size === 'large' && infoButtonStyles.large, state.infoButton.className);
|
|
60
|
+
}
|
|
61
|
+
return state;
|
|
62
|
+
}; //# sourceMappingURL=useInfoLabelStyles.styles.js.map
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=useInfoLabelStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoLabel/useInfoLabelStyles.styles.js"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { __styles, mergeClasses } from '@griffel/react';\nexport const infoLabelClassNames = {\n root: 'fui-InfoLabel',\n label: 'fui-InfoLabel__label',\n infoButton: 'fui-InfoLabel__infoButton'\n};\nconst useLabelStyles = /*#__PURE__*/__styles({\n base: {\n ha4doy: \"f12kltsn\",\n Bceei9c: \"fpo1scq\",\n sj55zd: \"f1ym3bx4\"\n }\n}, {\n d: [\".f12kltsn{vertical-align:top;}\", \".fpo1scq{cursor:inherit;}\", \".f1ym3bx4{color:inherit;}\"]\n});\nconst useInfoButtonStyles = /*#__PURE__*/__styles({\n base: {\n ha4doy: \"f12kltsn\",\n B6of3ja: \"f1bmzb36\",\n jrapky: \"f1nyzk09\"\n },\n large: {\n B6of3ja: \"fkrn0sh\",\n jrapky: \"fmxx68s\"\n }\n}, {\n d: [\".f12kltsn{vertical-align:top;}\", \".f1bmzb36{margin-top:calc(0px - var(--spacingVerticalXXS));}\", \".f1nyzk09{margin-bottom:calc(0px - var(--spacingVerticalXXS));}\", \".fkrn0sh{margin-top:-1px;}\", \".fmxx68s{margin-bottom:-1px;}\"]\n});\n/**\n * Apply styling to the InfoLabel slots based on the state\n */\nexport const useInfoLabelStyles_unstable = state => {\n state.root.className = mergeClasses(infoLabelClassNames.root, state.root.className);\n const labelStyles = useLabelStyles();\n state.label.className = mergeClasses(infoLabelClassNames.label, labelStyles.base, state.label.className);\n const infoButtonStyles = useInfoButtonStyles();\n if (state.infoButton) {\n state.infoButton.className = mergeClasses(infoLabelClassNames.infoButton, infoButtonStyles.base, state.size === 'large' && infoButtonStyles.large, state.infoButton.className);\n }\n return state;\n};\n//# sourceMappingURL=useInfoLabelStyles.styles.js.map"],"names":["infoLabelClassNames","useInfoLabelStyles_unstable","root","label","infoButton","useLabelStyles","__styles","base","ha4doy","Bceei9c","sj55zd","d","useInfoButtonStyles","B6of3ja","jrapky","large","state","className","mergeClasses","labelStyles","infoButtonStyles","size"],"mappings":";;;;;;;;;;;IAEaA,mBAAmB,MAAnBA;IA8BAC,2BAA2B,MAA3BA;;uBA/B0B;AAChC,MAAMD,sBAAsB;IACjCE,MAAM;IACNC,OAAO;IACPC,YAAY;AACd;AACA,MAAMC,iBAAiB,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IAC3CC,MAAM;QACJC,QAAQ;QACRC,SAAS;QACTC,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAAkC;QAA6B;KAA4B;AACjG;AACA,MAAMC,sBAAsB,WAAW,GAAEN,IAAAA,kBAAQ,EAAC;IAChDC,MAAM;QACJC,QAAQ;QACRK,SAAS;QACTC,QAAQ;IACV;IACAC,OAAO;QACLF,SAAS;QACTC,QAAQ;IACV;AACF,GAAG;IACDH,GAAG;QAAC;QAAkC;QAAgE;QAAmE;QAA8B;KAAgC;AACzO;AAIO,MAAMV,8BAA8Be,CAAAA,QAAS;IAClDA,MAAMd,IAAI,CAACe,SAAS,GAAGC,IAAAA,mBAAY,EAAClB,oBAAoBE,IAAI,EAAEc,MAAMd,IAAI,CAACe,SAAS;IAClF,MAAME,cAAcd;IACpBW,MAAMb,KAAK,CAACc,SAAS,GAAGC,IAAAA,mBAAY,EAAClB,oBAAoBG,KAAK,EAAEgB,YAAYZ,IAAI,EAAES,MAAMb,KAAK,CAACc,SAAS;IACvG,MAAMG,mBAAmBR;IACzB,IAAII,MAAMZ,UAAU,EAAE;QACpBY,MAAMZ,UAAU,CAACa,SAAS,GAAGC,IAAAA,mBAAY,EAAClB,oBAAoBI,UAAU,EAAEgB,iBAAiBb,IAAI,EAAES,MAAMK,IAAI,KAAK,WAAWD,iBAAiBL,KAAK,EAAEC,MAAMZ,UAAU,CAACa,SAAS;IAC/K,CAAC;IACD,OAAOD;AACT,GACA,qDAAqD"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -1,40 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.useInfoButton_unstable = exports.useInfoButtonStyles_unstable = exports.renderInfoButton_unstable = exports.infoButtonClassNames = exports.InfoButton = void 0;
|
|
7
|
-
|
|
8
|
-
var InfoButton_1 = /*#__PURE__*/require("./InfoButton");
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, "InfoButton", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return InfoButton_1.InfoButton;
|
|
14
|
-
}
|
|
3
|
+
value: true
|
|
15
4
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(exports, "useInfoButton_unstable", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
get: function () {
|
|
37
|
-
return InfoButton_1.useInfoButton_unstable;
|
|
38
|
-
}
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
InfoButton: ()=>_infoButton.InfoButton,
|
|
13
|
+
infoButtonClassNames: ()=>_infoButton.infoButtonClassNames,
|
|
14
|
+
renderInfoButton_unstable: ()=>_infoButton.renderInfoButton_unstable,
|
|
15
|
+
useInfoButtonStyles_unstable: ()=>_infoButton.useInfoButtonStyles_unstable,
|
|
16
|
+
useInfoButton_unstable: ()=>_infoButton.useInfoButton_unstable,
|
|
17
|
+
InfoLabel: ()=>_infoLabel.InfoLabel,
|
|
18
|
+
infoLabelClassNames: ()=>_infoLabel.infoLabelClassNames,
|
|
19
|
+
renderInfoLabel_unstable: ()=>_infoLabel.renderInfoLabel_unstable,
|
|
20
|
+
useInfoLabelStyles_unstable: ()=>_infoLabel.useInfoLabelStyles_unstable,
|
|
21
|
+
useInfoLabel_unstable: ()=>_infoLabel.useInfoLabel_unstable
|
|
39
22
|
});
|
|
23
|
+
const _infoButton = require("./InfoButton");
|
|
24
|
+
const _infoLabel = require("./InfoLabel");
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
26
|
+
|
|
40
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { InfoButton, infoButtonClassNames, renderInfoButton_unstable, useInfoButtonStyles_unstable, useInfoButton_unstable } from './InfoButton';\nexport { InfoLabel, infoLabelClassNames, renderInfoLabel_unstable, useInfoLabelStyles_unstable, useInfoLabel_unstable } from './InfoLabel';\n//# sourceMappingURL=index.js.map"],"names":["InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable","InfoLabel","infoLabelClassNames","renderInfoLabel_unstable","useInfoLabelStyles_unstable","useInfoLabel_unstable"],"mappings":";;;;;;;;;;;IAASA,UAAU,MAAVA,sBAAU;IAAEC,oBAAoB,MAApBA,gCAAoB;IAAEC,yBAAyB,MAAzBA,qCAAyB;IAAEC,4BAA4B,MAA5BA,wCAA4B;IAAEC,sBAAsB,MAAtBA,kCAAsB;IACjHC,SAAS,MAATA,oBAAS;IAAEC,mBAAmB,MAAnBA,8BAAmB;IAAEC,wBAAwB,MAAxBA,mCAAwB;IAAEC,2BAA2B,MAA3BA,sCAA2B;IAAEC,qBAAqB,MAArBA,gCAAqB;;4BADa;2BACL;CAC7H,iCAAiC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-infobutton",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.30",
|
|
4
4
|
"description": "React components for building web experiences",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -19,25 +19,29 @@
|
|
|
19
19
|
"just": "just-scripts",
|
|
20
20
|
"lint": "just-scripts lint",
|
|
21
21
|
"test": "jest --passWithNoTests",
|
|
22
|
-
"generate-api": "
|
|
22
|
+
"generate-api": "just-scripts generate-api",
|
|
23
23
|
"type-check": "tsc -b tsconfig.json",
|
|
24
24
|
"storybook": "start-storybook",
|
|
25
|
-
"start": "yarn storybook"
|
|
25
|
+
"start": "yarn storybook",
|
|
26
|
+
"test-ssr": "test-ssr ./stories/**/*.stories.tsx"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"@fluentui/eslint-plugin": "*",
|
|
29
30
|
"@fluentui/react-conformance": "*",
|
|
30
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
|
31
|
-
"@fluentui/scripts": "
|
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.21",
|
|
32
|
+
"@fluentui/scripts-api-extractor": "*",
|
|
33
|
+
"@fluentui/scripts-tasks": "*"
|
|
32
34
|
},
|
|
33
35
|
"dependencies": {
|
|
34
|
-
"@fluentui/react-icons": "^2.0.
|
|
35
|
-
"@fluentui/react-
|
|
36
|
-
"@fluentui/react-
|
|
37
|
-
"@fluentui/react-
|
|
38
|
-
"@fluentui/react-
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
36
|
+
"@fluentui/react-icons": "^2.0.196",
|
|
37
|
+
"@fluentui/react-label": "^9.1.12",
|
|
38
|
+
"@fluentui/react-popover": "^9.5.12",
|
|
39
|
+
"@fluentui/react-tabster": "^9.7.1",
|
|
40
|
+
"@fluentui/react-theme": "^9.1.8",
|
|
41
|
+
"@fluentui/react-utilities": "^9.9.0",
|
|
42
|
+
"@fluentui/react-jsx-runtime": "9.0.0-alpha.4",
|
|
43
|
+
"@griffel/react": "^1.5.2",
|
|
44
|
+
"@swc/helpers": "^0.4.14"
|
|
41
45
|
},
|
|
42
46
|
"peerDependencies": {
|
|
43
47
|
"@types/react": ">=16.8.0 <19.0.0",
|
|
@@ -55,6 +59,7 @@
|
|
|
55
59
|
"exports": {
|
|
56
60
|
".": {
|
|
57
61
|
"types": "./dist/index.d.ts",
|
|
62
|
+
"node": "./lib-commonjs/index.js",
|
|
58
63
|
"import": "./lib/index.js",
|
|
59
64
|
"require": "./lib-commonjs/index.js"
|
|
60
65
|
},
|
package/Spec.md
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
# @fluentui/react-infobutton Spec
|
|
2
|
-
|
|
3
|
-
Convergence epic issue: [#25062](https://github.com/microsoft/fluentui/issues/25062)
|
|
4
|
-
|
|
5
|
-
## Background
|
|
6
|
-
|
|
7
|
-
An InfoButton provides a way for users to get more information about a particular UI element. It is a button containing an icon that, when clicked, displays a Popover with the additional information. InfoButton may contain focusable items inside the Popover.
|
|
8
|
-
|
|
9
|
-
Because the Popover isn't always visible, it should not contain information that people must know in order to complete the field.
|
|
10
|
-
|
|
11
|
-
### Anatomy
|
|
12
|
-
|
|
13
|
-

|
|
14
|
-
|
|
15
|
-
## Prior Art
|
|
16
|
-
|
|
17
|
-
| Name | library | Notes |
|
|
18
|
-
| --------------------------------------------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| IconButtonTooltip | [Carbon Design System](https://www.carbondesignsystem.com/components/tooltip/usage) | This is an example within the tooltip component. |
|
|
20
|
-
| Tooltip with card appearance and general tooltip | [EverGreen](https://evergreen.segment.com/components/tooltip) | This are examples within the tooltip component. This library doesn't use a button, instead just an icon. |
|
|
21
|
-
| Input and guidance to add info button | [Salesforce](https://www.lightningdesignsystem.com/components/input/) | This component lives within Input and shows how to build an info button instead. |
|
|
22
|
-
| TextField with example on how to add an info button | [v8](https://developer.microsoft.com/en-us/fluentui#/controls/web/textfield) | This is just an example and on how to implement it. |
|
|
23
|
-
| ContextualHelp | [React Spectrum](https://react-spectrum.adobe.com/react-spectrum/ContextualHelp.html) | It's a full component and uses a Popover instead of tooltip. |
|
|
24
|
-
|
|
25
|
-
#### Comparison with v0 and v8
|
|
26
|
-
|
|
27
|
-
- v0 does not have an InfoButton component.
|
|
28
|
-
- v8 does not have an InfoButton component, but does have a TextField component that has an example of how to add an info button to a TextField, see "Prior Art" section above for more details.
|
|
29
|
-
|
|
30
|
-
## Sample Code
|
|
31
|
-
|
|
32
|
-
```jsx
|
|
33
|
-
<InfoButton content="This is some additional information." />
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## API
|
|
37
|
-
|
|
38
|
-
#### Props
|
|
39
|
-
|
|
40
|
-
```ts
|
|
41
|
-
export type InfoButtonSlots = {
|
|
42
|
-
root: NonNullable<Slot<'button'>>;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* The Popover element that wraps the content and root. Use this slot to pass props to the Popover.
|
|
46
|
-
*/
|
|
47
|
-
popover: NonNullable<Slot<PopoverProps>>;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* The content to be displayed in the PopoverSurface when the button is pressed.
|
|
51
|
-
*/
|
|
52
|
-
content: NonNullable<Slot<typeof PopoverSurface>>;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* InfoButton Props
|
|
57
|
-
*/
|
|
58
|
-
export type InfoButtonProps = ComponentProps<Partial<InfoButtonSlots>>;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* State used in rendering InfoButton
|
|
62
|
-
*/
|
|
63
|
-
export type InfoButtonState = ComponentState<InfoButtonSlots>;
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Structure
|
|
67
|
-
|
|
68
|
-
_**Public**_
|
|
69
|
-
|
|
70
|
-
```jsx
|
|
71
|
-
<InfoButton
|
|
72
|
-
content={
|
|
73
|
-
<>
|
|
74
|
-
Popover above-start lorem ipsum dolor sit amet consectetur.
|
|
75
|
-
<Link href="https://react.fluentui.dev">Learn more</Link>
|
|
76
|
-
</>
|
|
77
|
-
}
|
|
78
|
-
/>
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
_**Internal**_
|
|
82
|
-
|
|
83
|
-
```jsx
|
|
84
|
-
return (
|
|
85
|
-
<slots.popover {...(slotProps.popover as PopoverProps)}>
|
|
86
|
-
<PopoverTrigger>
|
|
87
|
-
<slots.root {...slotProps.root} />
|
|
88
|
-
</PopoverTrigger>
|
|
89
|
-
<slots.content {...slotProps.content} />
|
|
90
|
-
</slots.popover>
|
|
91
|
-
);
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
_**DOM**_
|
|
95
|
-
|
|
96
|
-
```html
|
|
97
|
-
<button type="button" class="fui-Button fui-InfoButton__button">
|
|
98
|
-
<!-- icon -->
|
|
99
|
-
</button>
|
|
100
|
-
|
|
101
|
-
<!-- on document.body -->
|
|
102
|
-
<div role="tooltip" class="fui-PopoverSurface fui-InfoButton__content">
|
|
103
|
-
Popover above-start lorem ipsum dolor sit amet consectetur.
|
|
104
|
-
<a href="https://react.fluentui.dev">Learn more</a>
|
|
105
|
-
</div>
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Migration
|
|
109
|
-
|
|
110
|
-
There's no migration guide as `v0` and `v8` do not have an InfoButton component.
|
|
111
|
-
|
|
112
|
-
## Behaviors
|
|
113
|
-
|
|
114
|
-
> Note: The behavior will change when used in conjunction with the `Field` component. It is mentioned that when a form has many InfoButtons, it may be better to not make a full tab stop in the button. The idea is to have each field have a "shortcut" that will let you focus on the infobutton. This will be implemented by Field if needed.
|
|
115
|
-
|
|
116
|
-
- _Component States_
|
|
117
|
-
- Popover open: The Popover is open and content visible.
|
|
118
|
-
- _Interaction_
|
|
119
|
-
- _Keyboard_
|
|
120
|
-
- `Enter` or `Space` key: Opens the Popover.
|
|
121
|
-
- Focusable items in Popover: Item should trap focus within the Popover.
|
|
122
|
-
- No focusable items in Popover: Focus should stay on the button.
|
|
123
|
-
- `Escape` key: Closes the Popover.
|
|
124
|
-
- _Cursor_
|
|
125
|
-
- `Click`: Opens the Popover.
|
|
126
|
-
- `Click` outside of Popover: Closes the Popover.
|
|
127
|
-
- _Touch_
|
|
128
|
-
- `Tap`: Opens the Popover.
|
|
129
|
-
- `Tap` outside of Popover: Closes the Popover.
|
|
130
|
-
- _Screen readers_
|
|
131
|
-
- When screen reader is on the button, it should announce that it is a button, that it can be used to open a Popover, and read out the aria-label of the button.
|
|
132
|
-
- When screen reader is on the Popover, it should announce that it is a dialog, and read out the content of the Popover.
|
|
133
|
-
|
|
134
|
-
## Accessibility
|
|
135
|
-
|
|
136
|
-
- `role="tooltip"` is used on the PopoverSurface.
|
|
137
|
-
- Tab order
|
|
138
|
-
- When tabbing through the page, the button should be a tab stop.
|
|
139
|
-
- When focused on the button, pressing `Enter` or `Space` should open the Popover.
|
|
140
|
-
- If the popover does not contain any focusable items, focus should stay on the button.
|
|
141
|
-
- When focused on the button, pressing `Escape` should close the Popover.
|
|
142
|
-
- When the Popover is open and it has focusable items, tabbing should move to the next focusable item.
|
|
143
|
-
- When focused on an item inside the Popover, pressing `Escape` should close the Popover and return to the button.
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
|
|
2
|
-
import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';
|
|
3
|
-
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
4
|
-
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
5
|
-
export const infoButtonClassNames = {
|
|
6
|
-
root: 'fui-InfoButton',
|
|
7
|
-
// this className won't be used, but it's needed to satisfy the type checker
|
|
8
|
-
popover: 'fui-InfoButton__popover',
|
|
9
|
-
content: 'fui-InfoButton__content'
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Styles for the root slot
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
const useButtonStyles = /*#__PURE__*/__styles({
|
|
16
|
-
"base": {
|
|
17
|
-
"Bt984gj": "f122n59",
|
|
18
|
-
"B7ck84d": "f1ewtqcl",
|
|
19
|
-
"mc9l5x": "ftuwxu6",
|
|
20
|
-
"Brf1p80": "f4d9j23",
|
|
21
|
-
"w71qe1": "f1iuv45f",
|
|
22
|
-
"ha4doy": "fmrv4ls",
|
|
23
|
-
"De3pzq": "f1c21dwh",
|
|
24
|
-
"sj55zd": "fkfq4zb",
|
|
25
|
-
"B68tc82": "f1p9o1ba",
|
|
26
|
-
"Bmxbyg5": "f1sil6mw",
|
|
27
|
-
"B4j52fo": "f192inf7",
|
|
28
|
-
"Bekrc4i": ["f5tn483", "f1ojsxk5"],
|
|
29
|
-
"Bn0qgzm": "f1vxd6vx",
|
|
30
|
-
"ibv6hh": ["f1ojsxk5", "f5tn483"],
|
|
31
|
-
"icvyot": "fzkkow9",
|
|
32
|
-
"vrafjx": ["fcdblym", "fjik90z"],
|
|
33
|
-
"oivjwe": "fg706s2",
|
|
34
|
-
"wvpqe5": ["fjik90z", "fcdblym"],
|
|
35
|
-
"g2u3we": "fghlq4f",
|
|
36
|
-
"h3c5rm": ["f1gn591s", "fjscplz"],
|
|
37
|
-
"B9xav0g": "fb073pr",
|
|
38
|
-
"zhjwy3": ["fjscplz", "f1gn591s"],
|
|
39
|
-
"Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
|
|
40
|
-
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
|
41
|
-
"B7oj6ja": ["f1jar5jt", "fyu767a"],
|
|
42
|
-
"Btl43ni": ["fyu767a", "f1jar5jt"],
|
|
43
|
-
"B6of3ja": "f1hu3pq6",
|
|
44
|
-
"t21cq0": ["f11qmguv", "f1tyq0we"],
|
|
45
|
-
"jrapky": "f19f4twv",
|
|
46
|
-
"Frg6f3": ["f1tyq0we", "f11qmguv"],
|
|
47
|
-
"z8tnut": "f1ywm7hm",
|
|
48
|
-
"z189sj": ["f7x41pl", "fruq291"],
|
|
49
|
-
"Byoj8tv": "f14wxoun",
|
|
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"
|
|
59
|
-
},
|
|
60
|
-
"selected": {
|
|
61
|
-
"De3pzq": "f1q9pm1r",
|
|
62
|
-
"sj55zd": "f1qj7y59",
|
|
63
|
-
"D0sxk3": "fgzdkf0",
|
|
64
|
-
"t6yez3": "f15q0o9g",
|
|
65
|
-
"Bsw6fvg": "f1rirnrt",
|
|
66
|
-
"Bjwas2f": "f14pvji2",
|
|
67
|
-
"Bn1d65q": ["f1xeojaw", "f1hodmrf"],
|
|
68
|
-
"Bxeuatn": "fcbbwn3",
|
|
69
|
-
"n51gp8": ["f1hodmrf", "f1xeojaw"],
|
|
70
|
-
"Bbusuzp": "f1cg6951"
|
|
71
|
-
},
|
|
72
|
-
"highContrast": {
|
|
73
|
-
"Bjwas2f": "f14pvji2",
|
|
74
|
-
"Bn1d65q": ["f1xeojaw", "f1hodmrf"],
|
|
75
|
-
"Bxeuatn": "fcbbwn3",
|
|
76
|
-
"n51gp8": ["f1hodmrf", "f1xeojaw"],
|
|
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"
|
|
85
|
-
},
|
|
86
|
-
"focusIndicator": {
|
|
87
|
-
"Brovlpu": "ftqa4ok",
|
|
88
|
-
"B486eqv": "f2hkw1w",
|
|
89
|
-
"kdpuga": ["f1o2ludy", "f1kjnpwc"],
|
|
90
|
-
"Bw81rd7": ["f1kjnpwc", "f1o2ludy"],
|
|
91
|
-
"B6xbmo0": ["fxmnebo", "f1witrsb"],
|
|
92
|
-
"dm238s": ["f1witrsb", "fxmnebo"],
|
|
93
|
-
"B8q5s1w": "f1rzxaq5",
|
|
94
|
-
"Bci5o5g": ["fipsau9", "f6jszy8"],
|
|
95
|
-
"n8qw10": "f1emqxbc",
|
|
96
|
-
"Bdrgwmp": ["f6jszy8", "fipsau9"],
|
|
97
|
-
"Bfpq7zp": "fr1u5pk",
|
|
98
|
-
"Bn4voq9": "f1p7hgxw",
|
|
99
|
-
"g9k6zt": "f9znhxp",
|
|
100
|
-
"j6ew2k": ["fvbipq7", "fvbipq7"],
|
|
101
|
-
"Bhxq17a": "f1vjpng2"
|
|
102
|
-
},
|
|
103
|
-
"large": {
|
|
104
|
-
"z8tnut": "fclwglc",
|
|
105
|
-
"z189sj": ["f1w3695s", "f1b0r8ql"],
|
|
106
|
-
"Byoj8tv": "fywfov9",
|
|
107
|
-
"uwmqm3": ["f1b0r8ql", "f1w3695s"]
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
"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;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".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);}", ".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;}", ".f1o2ludy[data-fui-focus-visible]{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1kjnpwc[data-fui-focus-visible]{border-bottom-left-radius:var(--borderRadiusMedium);}", ".fxmnebo[data-fui-focus-visible]{border-top-right-radius:var(--borderRadiusMedium);}", ".f1witrsb[data-fui-focus-visible]{border-top-left-radius:var(--borderRadiusMedium);}", ".f1rzxaq5[data-fui-focus-visible]{border-top-color:var(--colorTransparentStroke);}", ".fipsau9[data-fui-focus-visible]{border-right-color:var(--colorTransparentStroke);}", ".f6jszy8[data-fui-focus-visible]{border-left-color:var(--colorTransparentStroke);}", ".f1emqxbc[data-fui-focus-visible]{border-bottom-color:var(--colorTransparentStroke);}", ".fr1u5pk[data-fui-focus-visible]{outline-color:var(--colorTransparentStroke);}", ".f1p7hgxw[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);}", ".f9znhxp[data-fui-focus-visible]{outline-style:solid;}", ".fvbipq7[data-fui-focus-visible]{box-shadow:var(--shadow4),0 0 0 2px var(--colorStrokeFocus2);}", ".f1vjpng2[data-fui-focus-visible]{z-index:1;}", ".fclwglc{padding-top:var(--spacingVerticalXXS);}", ".f1w3695s{padding-right:var(--spacingVerticalXXS);}", ".f1b0r8ql{padding-left:var(--spacingVerticalXXS);}", ".fywfov9{padding-bottom:var(--spacingVerticalXXS);}"],
|
|
111
|
-
"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);}"],
|
|
112
|
-
"m": [["@media (forced-colors: active){.f1rirnrt{background-color:Highlight;}}", {
|
|
113
|
-
"m": "(forced-colors: active)"
|
|
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)"
|
|
122
|
-
}], ["@media (forced-colors: active){.f1cg6951{color:Canvas;}}", {
|
|
123
|
-
"m": "(forced-colors: active)"
|
|
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)"
|
|
132
|
-
}], ["@media (forced-colors: active){.fn0tkbb{color:CanvasText;}}", {
|
|
133
|
-
"m": "(forced-colors: active)"
|
|
134
|
-
}], ["@media (forced-colors: active){.f18rpr9v:hover,.f18rpr9v :hover:active{forced-color-adjust:none;}}", {
|
|
135
|
-
"m": "(forced-colors: active)"
|
|
136
|
-
}], ["@media (forced-colors: active){.f5mt1fw:hover,.f5mt1fw :hover:active{background-color:Highlight;}}", {
|
|
137
|
-
"m": "(forced-colors: active)"
|
|
138
|
-
}], ["@media (forced-colors: active){.f17188ff:hover,.f17188ff :hover:active{border-top-color:Canvas;}}", {
|
|
139
|
-
"m": "(forced-colors: active)"
|
|
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)"
|
|
148
|
-
}]],
|
|
149
|
-
"f": [".ftqa4ok:focus{outline-style:none;}"],
|
|
150
|
-
"i": [".f2hkw1w:focus-visible{outline-style:none;}"]
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
const usePopoverSurfaceStyles = /*#__PURE__*/__styles({
|
|
154
|
-
"smallMedium": {
|
|
155
|
-
"Bahqtrf": "fk6fouc",
|
|
156
|
-
"Be2twd7": "fy9rknc",
|
|
157
|
-
"Bhrd7zp": "figsok6",
|
|
158
|
-
"Bg96gwp": "fwrc4pm"
|
|
159
|
-
},
|
|
160
|
-
"large": {
|
|
161
|
-
"Bahqtrf": "fk6fouc",
|
|
162
|
-
"Be2twd7": "fkhj508",
|
|
163
|
-
"Bhrd7zp": "figsok6",
|
|
164
|
-
"Bg96gwp": "f1i3iumi"
|
|
165
|
-
}
|
|
166
|
-
}, {
|
|
167
|
-
"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
|
-
});
|
|
169
|
-
/**
|
|
170
|
-
* Apply styling to the InfoButton slots based on the state
|
|
171
|
-
*/
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
export const useInfoButtonStyles_unstable = state => {
|
|
175
|
-
const {
|
|
176
|
-
size
|
|
177
|
-
} = state;
|
|
178
|
-
const {
|
|
179
|
-
open
|
|
180
|
-
} = state.popover;
|
|
181
|
-
const buttonStyles = useButtonStyles();
|
|
182
|
-
const popoverSurfaceStyles = usePopoverSurfaceStyles();
|
|
183
|
-
state.content.className = mergeClasses(infoButtonClassNames.content, size === 'large' && popoverSurfaceStyles.large, state.content.className);
|
|
184
|
-
state.root.className = mergeClasses(infoButtonClassNames.root, buttonStyles.base, buttonStyles.highContrast, buttonStyles.focusIndicator, open && buttonStyles.selected, size === 'large' && buttonStyles.large, state.root.className);
|
|
185
|
-
return state;
|
|
186
|
-
};
|
|
187
|
-
//# sourceMappingURL=useInfoButtonStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-infobutton/src/components/InfoButton/useInfoButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,+BAAT,QAAgD,yBAAhD;AACA,SAAS,mBAAT,EAA8B,oBAA9B,QAA0D,uBAA1D;AACA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,MAAT,EAAiB,gBAAjB,QAAyC,uBAAzC;AAIA,OAAO,MAAM,oBAAoB,GAAoC;EACnE,IAAI,EAAE,gBAD6D;EAEnE;EACA,OAAO,EAAE,yBAH0D;EAInE,OAAO,EAAE;AAJ0D,CAA9D;AAOP;;AAEG;;AACH,MAAM,eAAe,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;EAAA;EAAA;AAAA,EAAxB;;AA4FA,MAAM,uBAAuB,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAhC;AAKA;;AAEG;;;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA4C;EACtF,MAAM;IAAE;EAAF,IAAW,KAAjB;EACA,MAAM;IAAE;EAAF,IAAW,KAAK,CAAC,OAAvB;EACA,MAAM,YAAY,GAAG,eAAe,EAApC;EACA,MAAM,oBAAoB,GAAG,uBAAuB,EAApD;EAEA,KAAK,CAAC,OAAN,CAAc,SAAd,GAA0B,YAAY,CACpC,oBAAoB,CAAC,OADe,EAEpC,IAAI,KAAK,OAAT,IAAoB,oBAAoB,CAAC,KAFL,EAGpC,KAAK,CAAC,OAAN,CAAc,SAHsB,CAAtC;EAMA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,oBAAoB,CAAC,IADY,EAEjC,YAAY,CAAC,IAFoB,EAGjC,YAAY,CAAC,YAHoB,EAIjC,YAAY,CAAC,cAJoB,EAKjC,IAAI,IAAI,YAAY,CAAC,QALY,EAMjC,IAAI,KAAK,OAAT,IAAoB,YAAY,CAAC,KANA,EAOjC,KAAK,CAAC,IAAN,CAAW,SAPsB,CAAnC;EAUA,OAAO,KAAP;AACD,CAvBM","sourcesContent":["import { createCustomFocusIndicatorStyle } 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\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForeground2,\n\n ...shorthands.overflow('hidden'),\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorTransparentStroke),\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 ...shorthands.borderColor('Canvas'),\n color: 'Canvas',\n },\n },\n\n highContrast: {\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('Canvas'),\n color: 'CanvasText',\n\n ':hover, :hover:active': {\n forcedColorAdjust: 'none',\n backgroundColor: 'Highlight',\n ...shorthands.borderColor('Canvas'),\n color: 'Canvas',\n },\n },\n },\n\n focusIndicator: createCustomFocusIndicatorStyle({\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n outlineColor: tokens.colorTransparentStroke,\n outlineWidth: tokens.strokeWidthThick,\n outlineStyle: 'solid',\n boxShadow: `\n ${tokens.shadow4},\n 0 0 0 2px ${tokens.colorStrokeFocus2}\n `,\n zIndex: 1,\n }),\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"],"sourceRoot":"../src/"}
|