@fluentui/react-infobutton 9.0.0-beta.21 → 9.0.0-beta.23
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/.swcrc +30 -0
- package/CHANGELOG.json +103 -1
- package/CHANGELOG.md +32 -2
- package/dist/index.d.ts +64 -0
- 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.map +1 -1
- package/lib/components/InfoButton/InfoButton.types.js.map +1 -1
- package/lib/components/InfoButton/index.js.map +1 -1
- package/lib/components/InfoButton/renderInfoButton.js +1 -7
- package/lib/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButtonStyles.js.map +1 -1
- 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 +66 -0
- package/lib/components/InfoLabel/useInfoLabel.js.map +1 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.js +43 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.js.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/InfoButton.js +5 -4
- 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 +17 -7
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.js +16 -15
- 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 +9 -8
- package/lib-commonjs/components/InfoButton/index.js.map +1 -1
- package/lib-commonjs/components/InfoButton/renderInfoButton.js +14 -23
- package/lib-commonjs/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButton.js +58 -67
- package/lib-commonjs/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js +331 -149
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js.map +1 -1
- 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 +17 -0
- package/lib-commonjs/components/InfoLabel/renderInfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabel.js +58 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.js +64 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.js.map +1 -0
- package/lib-commonjs/index.js +22 -33
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +11 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["tokens","__styles","mergeClasses","infoLabelClassNames","root","label","infoButton","useLabelStyles","base","ha4doy","Bceei9c","sj55zd","d","useInfoButtonStyles","B6of3ja","jrapky","large","useInfoLabelStyles_unstable","state","className","labelStyles","infoButtonStyles","size"],"sources":["../../../src/components/InfoLabel/useInfoLabelStyles.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { InfoLabelSlots, InfoLabelState } from './InfoLabel.types';\n\nexport const infoLabelClassNames: SlotClassNames<InfoLabelSlots> = {\n root: 'fui-InfoLabel',\n label: 'fui-InfoLabel__label',\n infoButton: 'fui-InfoLabel__infoButton',\n};\n\nconst useLabelStyles = makeStyles({\n base: {\n verticalAlign: 'top',\n cursor: 'inherit',\n color: 'inherit',\n },\n});\n\nconst useInfoButtonStyles = makeStyles({\n base: {\n verticalAlign: 'top',\n\n // Negative margin to align with the text\n marginTop: `calc(0px - ${tokens.spacingVerticalXXS})`,\n marginBottom: `calc(0px - ${tokens.spacingVerticalXXS})`,\n },\n\n large: {\n // Negative margin to align with the text\n marginTop: '-1px',\n marginBottom: '-1px',\n },\n});\n\n/**\n * Apply styling to the InfoLabel slots based on the state\n */\nexport const useInfoLabelStyles_unstable = (state: InfoLabelState): InfoLabelState => {\n state.root.className = mergeClasses(infoLabelClassNames.root, state.root.className);\n\n const labelStyles = useLabelStyles();\n state.label.className = mergeClasses(infoLabelClassNames.label, labelStyles.base, state.label.className);\n\n const infoButtonStyles = useInfoButtonStyles();\n if (state.infoButton) {\n state.infoButton.className = mergeClasses(\n infoLabelClassNames.infoButton,\n infoButtonStyles.base,\n state.size === 'large' && infoButtonStyles.large,\n state.infoButton.className,\n );\n }\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ;AAEvB,SAAAC,QAAA,EAAqBC,YAAY,QAAQ;AAGzC,OAAO,MAAMC,mBAAA,GAAsD;EACjEC,IAAA,EAAM;EACNC,KAAA,EAAO;EACPC,UAAA,EAAY;AACd;AAEA,MAAMC,cAAA,gBAAiBN,QAAA;EAAAO,IAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAMvB;AAEA,MAAMC,mBAAA,gBAAsBZ,QAAA;EAAAO,IAAA;IAAAC,MAAA;IAAAK,OAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAF,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAH,CAAA;AAAA,EAc5B;AAEA;;;AAGA,OAAO,MAAMK,2BAAA,GAA+BC,KAAA,IAA0C;EACpFA,KAAA,CAAMd,IAAI,CAACe,SAAS,GAAGjB,YAAA,CAAaC,mBAAA,CAAoBC,IAAI,EAAEc,KAAA,CAAMd,IAAI,CAACe,SAAS;EAElF,MAAMC,WAAA,GAAcb,cAAA;EACpBW,KAAA,CAAMb,KAAK,CAACc,SAAS,GAAGjB,YAAA,CAAaC,mBAAA,CAAoBE,KAAK,EAAEe,WAAA,CAAYZ,IAAI,EAAEU,KAAA,CAAMb,KAAK,CAACc,SAAS;EAEvG,MAAME,gBAAA,GAAmBR,mBAAA;EACzB,IAAIK,KAAA,CAAMZ,UAAU,EAAE;IACpBY,KAAA,CAAMZ,UAAU,CAACa,SAAS,GAAGjB,YAAA,CAC3BC,mBAAA,CAAoBG,UAAU,EAC9Be,gBAAA,CAAiBb,IAAI,EACrBU,KAAA,CAAMI,IAAI,KAAK,WAAWD,gBAAA,CAAiBL,KAAK,EAChDE,KAAA,CAAMZ,UAAU,CAACa,SAAS;EAE9B;EAEA,OAAOD,KAAA;AACT"}
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { InfoButton, infoButtonClassNames, renderInfoButton_unstable, useInfoButtonStyles_unstable, useInfoButton_unstable } from './InfoButton';
|
|
2
|
+
export { InfoLabel, infoLabelClassNames, renderInfoLabel_unstable, useInfoLabelStyles_unstable, useInfoLabel_unstable } from './InfoLabel';
|
|
2
3
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable"],"sources":["../src/
|
|
1
|
+
{"version":3,"names":["InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable","InfoLabel","infoLabelClassNames","renderInfoLabel_unstable","useInfoLabelStyles_unstable","useInfoLabel_unstable"],"sources":["../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';\nexport {\n InfoLabel,\n infoLabelClassNames,\n renderInfoLabel_unstable,\n useInfoLabelStyles_unstable,\n useInfoLabel_unstable,\n} from './InfoLabel';\nexport type { InfoLabelProps, InfoLabelSlots, InfoLabelState } from './InfoLabel';\n"],"mappings":"AAAA,SACEA,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,QACjB;AAEP,SACEC,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,2BAA2B,EAC3BC,qBAAqB,QAChB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./components/InfoButton/index"), exports);
|
|
7
|
+
//# sourceMappingURL=InfoButton.js.map
|
|
8
|
+
|
|
8
9
|
//# sourceMappingURL=InfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../lib/InfoButton.js"],"sourcesContent":["export * from './components/InfoButton/index';\n//# sourceMappingURL=InfoButton.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,sCAAsC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./components/InfoLabel/index"), exports);
|
|
7
|
+
//# sourceMappingURL=InfoLabel.js.map
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=InfoLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../lib/InfoLabel.js"],"sourcesContent":["export * from './components/InfoLabel/index';\n//# sourceMappingURL=InfoLabel.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,qCAAqC"}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
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
|
+
DefaultInfoButtonIcon12: ()=>DefaultInfoButtonIcon12,
|
|
13
|
+
DefaultInfoButtonIcon16: ()=>DefaultInfoButtonIcon16,
|
|
14
|
+
DefaultInfoButtonIcon20: ()=>DefaultInfoButtonIcon20
|
|
5
15
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
const _reactIcons = require("@fluentui/react-icons");
|
|
17
|
+
const DefaultInfoButtonIcon12 = /*#__PURE__*/ (0, _reactIcons.bundleIcon)(_reactIcons.Info12Filled, _reactIcons.Info12Regular);
|
|
18
|
+
const DefaultInfoButtonIcon16 = /*#__PURE__*/ (0, _reactIcons.bundleIcon)(_reactIcons.Info16Filled, _reactIcons.Info16Regular);
|
|
19
|
+
const DefaultInfoButtonIcon20 = /*#__PURE__*/ (0, _reactIcons.bundleIcon)(_reactIcons.Info20Filled, _reactIcons.Info20Regular); //# sourceMappingURL=DefaultInfoButtonIcons.js.map
|
|
20
|
+
|
|
11
21
|
//# sourceMappingURL=DefaultInfoButtonIcons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoButton/DefaultInfoButtonIcons.js"],"sourcesContent":["import { Info12Regular, Info12Filled, Info16Regular, Info16Filled, Info20Regular, Info20Filled, bundleIcon } from '@fluentui/react-icons';\nexport const DefaultInfoButtonIcon12 = /*#__PURE__*/bundleIcon(Info12Filled, Info12Regular);\nexport const DefaultInfoButtonIcon16 = /*#__PURE__*/bundleIcon(Info16Filled, Info16Regular);\nexport const DefaultInfoButtonIcon20 = /*#__PURE__*/bundleIcon(Info20Filled, Info20Regular);\n//# sourceMappingURL=DefaultInfoButtonIcons.js.map"],"names":["DefaultInfoButtonIcon12","DefaultInfoButtonIcon16","DefaultInfoButtonIcon20","bundleIcon","Info12Filled","Info12Regular","Info16Filled","Info16Regular","Info20Filled","Info20Regular"],"mappings":";;;;;;;;;;;IACaA,uBAAuB,MAAvBA;IACAC,uBAAuB,MAAvBA;IACAC,uBAAuB,MAAvBA;;4BAHqG;AAC3G,MAAMF,0BAA0B,WAAW,GAAEG,IAAAA,sBAAU,EAACC,wBAAY,EAAEC,yBAAa;AACnF,MAAMJ,0BAA0B,WAAW,GAAEE,IAAAA,sBAAU,EAACG,wBAAY,EAAEC,yBAAa;AACnF,MAAML,0BAA0B,WAAW,GAAEC,IAAAA,sBAAU,EAACK,wBAAY,EAAEC,yBAAa,GAC1F,kDAAkD"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "InfoButton", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>InfoButton
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const state = useInfoButton_1.useInfoButton_unstable(props, ref);
|
|
16
|
-
useInfoButtonStyles_1.useInfoButtonStyles_unstable(state);
|
|
17
|
-
return renderInfoButton_1.renderInfoButton_unstable(state);
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _renderInfoButton = require("./renderInfoButton");
|
|
12
|
+
const _useInfoButton = require("./useInfoButton");
|
|
13
|
+
const _useInfoButtonStyles = require("./useInfoButtonStyles");
|
|
14
|
+
const InfoButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
15
|
+
const state = (0, _useInfoButton.useInfoButton_unstable)(props, ref);
|
|
16
|
+
(0, _useInfoButtonStyles.useInfoButtonStyles_unstable)(state);
|
|
17
|
+
return (0, _renderInfoButton.renderInfoButton_unstable)(state);
|
|
18
18
|
});
|
|
19
|
-
|
|
19
|
+
InfoButton.displayName = 'InfoButton'; //# sourceMappingURL=InfoButton.js.map
|
|
20
|
+
|
|
20
21
|
//# sourceMappingURL=InfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoButton/InfoButton.js"],"sourcesContent":["import * as React from 'react';\nimport { renderInfoButton_unstable } from './renderInfoButton';\nimport { useInfoButton_unstable } from './useInfoButton';\nimport { useInfoButtonStyles_unstable } from './useInfoButtonStyles';\n/**\n * InfoButtons provide a way to display additional information about a form field or an area in the UI.\n */\nexport const InfoButton = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useInfoButton_unstable(props, ref);\n useInfoButtonStyles_unstable(state);\n return renderInfoButton_unstable(state);\n});\nInfoButton.displayName = 'InfoButton';\n//# sourceMappingURL=InfoButton.js.map"],"names":["InfoButton","React","forwardRef","props","ref","state","useInfoButton_unstable","useInfoButtonStyles_unstable","renderInfoButton_unstable","displayName"],"mappings":";;;;+BAOaA;;aAAAA;;;6DAPU;kCACmB;+BACH;qCACM;AAItC,MAAMA,aAAa,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACtE,MAAMC,QAAQC,IAAAA,qCAAsB,EAACH,OAAOC;IAC5CG,IAAAA,iDAA4B,EAACF;IAC7B,OAAOG,IAAAA,2CAAyB,EAACH;AACnC;AACAL,WAAWS,WAAW,GAAG,cACzB,sCAAsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoButton/InfoButton.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=InfoButton.types.js.map"],"names":[],"mappings":";;;;CACA,4CAA4C"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./InfoButton"), exports);
|
|
7
|
+
_exportStar(require("./InfoButton.types"), exports);
|
|
8
|
+
_exportStar(require("./renderInfoButton"), exports);
|
|
9
|
+
_exportStar(require("./useInfoButton"), exports);
|
|
10
|
+
_exportStar(require("./useInfoButtonStyles"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
12
|
+
|
|
12
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoButton/index.js"],"sourcesContent":["export * from './InfoButton';\nexport * from './InfoButton.types';\nexport * from './renderInfoButton';\nexport * from './useInfoButton';\nexport * from './useInfoButtonStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderInfoButton_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>renderInfoButton_unstable
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
slots,
|
|
16
|
-
slotProps
|
|
17
|
-
} = react_utilities_1.getSlots(state);
|
|
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
|
|
24
|
-
}));
|
|
25
|
-
};
|
|
26
|
-
exports.renderInfoButton_unstable = renderInfoButton_unstable;
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const _reactPopover = require("@fluentui/react-popover");
|
|
13
|
+
const renderInfoButton_unstable = (state)=>{
|
|
14
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
|
|
15
|
+
return /*#__PURE__*/ _react.createElement(slots.popover, slotProps.popover, /*#__PURE__*/ _react.createElement(_reactPopover.PopoverTrigger, null, /*#__PURE__*/ _react.createElement(slots.root, slotProps.root)), /*#__PURE__*/ _react.createElement(slots.content, slotProps.content));
|
|
16
|
+
}; //# sourceMappingURL=renderInfoButton.js.map
|
|
17
|
+
|
|
27
18
|
//# sourceMappingURL=renderInfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoButton/renderInfoButton.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { PopoverTrigger } from '@fluentui/react-popover';\n/**\n * Render the final JSX of InfoButton\n */\nexport const renderInfoButton_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.popover, slotProps.popover, /*#__PURE__*/React.createElement(PopoverTrigger, null, /*#__PURE__*/React.createElement(slots.root, slotProps.root)), /*#__PURE__*/React.createElement(slots.content, slotProps.content));\n};\n//# sourceMappingURL=renderInfoButton.js.map"],"names":["renderInfoButton_unstable","state","slots","slotProps","getSlots","React","createElement","popover","PopoverTrigger","root","content"],"mappings":";;;;+BAMaA;;aAAAA;;;6DANU;gCACE;8BACM;AAIxB,MAAMA,4BAA4BC,CAAAA,QAAS;IAChD,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,OAAO,EAAEJ,UAAUI,OAAO,EAAE,WAAW,GAAEF,OAAMC,aAAa,CAACE,4BAAc,EAAE,IAAI,EAAE,WAAW,GAAEH,OAAMC,aAAa,CAACJ,MAAMO,IAAI,EAAEN,UAAUM,IAAI,IAAI,WAAW,GAAEJ,OAAMC,aAAa,CAACJ,MAAMQ,OAAO,EAAEP,UAAUO,OAAO;AACnQ,GACA,4CAA4C"}
|
|
@@ -1,75 +1,66 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useInfoButton_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useInfoButton_unstable
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _defaultInfoButtonIcons = require("./DefaultInfoButtonIcons");
|
|
12
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
13
|
+
const _reactPopover = require("@fluentui/react-popover");
|
|
12
14
|
const infoButtonIconMap = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
small: /*#__PURE__*/ _react.createElement(_defaultInfoButtonIcons.DefaultInfoButtonIcon12, null),
|
|
16
|
+
medium: /*#__PURE__*/ _react.createElement(_defaultInfoButtonIcons.DefaultInfoButtonIcon16, null),
|
|
17
|
+
large: /*#__PURE__*/ _react.createElement(_defaultInfoButtonIcons.DefaultInfoButtonIcon20, null)
|
|
16
18
|
};
|
|
17
19
|
const popoverSizeMap = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
small: 'small',
|
|
21
|
+
medium: 'small',
|
|
22
|
+
large: 'medium'
|
|
21
23
|
};
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
const [popoverOpen, setPopoverOpen] = react_utilities_2.useControllableState({
|
|
66
|
-
state: state.popover.open,
|
|
67
|
-
defaultState: state.popover.defaultOpen,
|
|
68
|
-
initialState: false
|
|
69
|
-
});
|
|
70
|
-
state.popover.open = popoverOpen;
|
|
71
|
-
state.popover.onOpenChange = react_utilities_1.mergeCallbacks(state.popover.onOpenChange, (e, data) => setPopoverOpen(data.open));
|
|
72
|
-
return state;
|
|
73
|
-
};
|
|
74
|
-
exports.useInfoButton_unstable = useInfoButton_unstable;
|
|
24
|
+
const useInfoButton_unstable = (props, ref)=>{
|
|
25
|
+
const { size ='medium' } = props;
|
|
26
|
+
const state = {
|
|
27
|
+
size,
|
|
28
|
+
components: {
|
|
29
|
+
root: 'button',
|
|
30
|
+
popover: _reactPopover.Popover,
|
|
31
|
+
content: _reactPopover.PopoverSurface
|
|
32
|
+
},
|
|
33
|
+
root: (0, _reactUtilities.getNativeElementProps)('button', {
|
|
34
|
+
children: infoButtonIconMap[size],
|
|
35
|
+
type: 'button',
|
|
36
|
+
'aria-label': 'information',
|
|
37
|
+
...props,
|
|
38
|
+
ref
|
|
39
|
+
}),
|
|
40
|
+
popover: (0, _reactUtilities.resolveShorthand)(props.popover, {
|
|
41
|
+
required: true,
|
|
42
|
+
defaultProps: {
|
|
43
|
+
positioning: 'above-start',
|
|
44
|
+
size: popoverSizeMap[size],
|
|
45
|
+
withArrow: true
|
|
46
|
+
}
|
|
47
|
+
}),
|
|
48
|
+
content: (0, _reactUtilities.resolveShorthand)(props.content, {
|
|
49
|
+
required: true,
|
|
50
|
+
defaultProps: {
|
|
51
|
+
role: 'note',
|
|
52
|
+
tabIndex: -1
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
const [popoverOpen, setPopoverOpen] = (0, _reactUtilities.useControllableState)({
|
|
57
|
+
state: state.popover.open,
|
|
58
|
+
defaultState: state.popover.defaultOpen,
|
|
59
|
+
initialState: false
|
|
60
|
+
});
|
|
61
|
+
state.popover.open = popoverOpen;
|
|
62
|
+
state.popover.onOpenChange = (0, _reactUtilities.mergeCallbacks)(state.popover.onOpenChange, (e, data)=>setPopoverOpen(data.open));
|
|
63
|
+
return state;
|
|
64
|
+
}; //# sourceMappingURL=useInfoButton.js.map
|
|
65
|
+
|
|
75
66
|
//# sourceMappingURL=useInfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoButton/useInfoButton.js"],"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';\nconst infoButtonIconMap = {\n small: /*#__PURE__*/React.createElement(DefaultInfoButtonIcon12, null),\n medium: /*#__PURE__*/React.createElement(DefaultInfoButtonIcon16, null),\n large: /*#__PURE__*/React.createElement(DefaultInfoButtonIcon20, null)\n};\nconst popoverSizeMap = {\n small: 'small',\n medium: 'small',\n large: 'medium'\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, ref) => {\n const {\n size = 'medium'\n } = props;\n const state = {\n size,\n components: {\n root: 'button',\n popover: Popover,\n content: PopoverSurface\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 const [popoverOpen, setPopoverOpen] = useControllableState({\n state: state.popover.open,\n defaultState: state.popover.defaultOpen,\n initialState: false\n });\n state.popover.open = popoverOpen;\n state.popover.onOpenChange = mergeCallbacks(state.popover.onOpenChange, (e, data) => setPopoverOpen(data.open));\n return state;\n};\n//# sourceMappingURL=useInfoButton.js.map"],"names":["useInfoButton_unstable","infoButtonIconMap","small","React","createElement","DefaultInfoButtonIcon12","medium","DefaultInfoButtonIcon16","large","DefaultInfoButtonIcon20","popoverSizeMap","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"],"mappings":";;;;+BAwBaA;;aAAAA;;;6DAxBU;wCACmE;gCAClB;8BAChC;AAExC,MAAMC,oBAAoB;IACxBC,OAAO,WAAW,GAAEC,OAAMC,aAAa,CAACC,+CAAuB,EAAE,IAAI;IACrEC,QAAQ,WAAW,GAAEH,OAAMC,aAAa,CAACG,+CAAuB,EAAE,IAAI;IACtEC,OAAO,WAAW,GAAEL,OAAMC,aAAa,CAACK,+CAAuB,EAAE,IAAI;AACvE;AACA,MAAMC,iBAAiB;IACrBR,OAAO;IACPI,QAAQ;IACRE,OAAO;AACT;AAUO,MAAMR,yBAAyB,CAACW,OAAOC,MAAQ;IACpD,MAAM,EACJC,MAAO,SAAQ,EAChB,GAAGF;IACJ,MAAMG,QAAQ;QACZD;QACAE,YAAY;YACVC,MAAM;YACNC,SAASC,qBAAO;YAChBC,SAASC,4BAAc;QACzB;QACAJ,MAAMK,IAAAA,qCAAqB,EAAC,UAAU;YACpCC,UAAUrB,iBAAiB,CAACY,KAAK;YACjCU,MAAM;YACN,cAAc;YACd,GAAGZ,KAAK;YACRC;QACF;QACAK,SAASO,IAAAA,gCAAgB,EAACb,MAAMM,OAAO,EAAE;YACvCQ,UAAU,IAAI;YACdC,cAAc;gBACZC,aAAa;gBACbd,MAAMH,cAAc,CAACG,KAAK;gBAC1Be,WAAW,IAAI;YACjB;QACF;QACAT,SAASK,IAAAA,gCAAgB,EAACb,MAAMQ,OAAO,EAAE;YACvCM,UAAU,IAAI;YACdC,cAAc;gBACZG,MAAM;gBACNC,UAAU,CAAC;YACb;QACF;IACF;IACA,MAAM,CAACC,aAAaC,eAAe,GAAGC,IAAAA,oCAAoB,EAAC;QACzDnB,OAAOA,MAAMG,OAAO,CAACiB,IAAI;QACzBC,cAAcrB,MAAMG,OAAO,CAACmB,WAAW;QACvCC,cAAc,KAAK;IACrB;IACAvB,MAAMG,OAAO,CAACiB,IAAI,GAAGH;IACrBjB,MAAMG,OAAO,CAACqB,YAAY,GAAGC,IAAAA,8BAAc,EAACzB,MAAMG,OAAO,CAACqB,YAAY,EAAE,CAACE,GAAGC,OAAST,eAAeS,KAAKP,IAAI;IAC7G,OAAOpB;AACT,GACA,yCAAyC"}
|