@fluentui/react-infobutton 9.0.0-beta.11 → 9.0.0-beta.111
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.md +1237 -5
- package/README.md +3 -24
- package/dist/index.d.ts +115 -9
- package/lib/InfoButton.js +1 -2
- package/lib/InfoButton.js.map +1 -1
- package/lib/InfoLabel.js +1 -0
- package/lib/InfoLabel.js.map +1 -0
- package/lib/components/InfoButton/DefaultInfoButtonIcons.js +3 -4
- package/lib/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
- package/lib/components/InfoButton/InfoButton.js +8 -7
- package/lib/components/InfoButton/InfoButton.js.map +1 -1
- package/lib/components/InfoButton/InfoButton.types.js +5 -2
- package/lib/components/InfoButton/InfoButton.types.js.map +1 -1
- package/lib/components/InfoButton/index.js +4 -6
- package/lib/components/InfoButton/index.js.map +1 -1
- package/lib/components/InfoButton/renderInfoButton.js +14 -16
- package/lib/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButton.js +71 -50
- package/lib/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButtonStyles.styles.js +181 -0
- package/lib/components/InfoButton/useInfoButtonStyles.styles.js.map +1 -0
- package/lib/components/InfoButton/useInfoButtonStyles.styles.raw.js +99 -0
- package/lib/components/InfoButton/useInfoButtonStyles.styles.raw.js.map +1 -0
- package/lib/components/InfoLabel/InfoLabel.js +15 -0
- package/lib/components/InfoLabel/InfoLabel.js.map +1 -0
- package/lib/components/InfoLabel/InfoLabel.types.js +5 -0
- package/lib/components/InfoLabel/InfoLabel.types.js.map +1 -0
- package/lib/components/InfoLabel/index.js +4 -0
- package/lib/components/InfoLabel/index.js.map +1 -0
- package/lib/components/InfoLabel/renderInfoLabel.js +15 -0
- package/lib/components/InfoLabel/renderInfoLabel.js.map +1 -0
- package/lib/components/InfoLabel/useInfoLabel.js +80 -0
- package/lib/components/InfoLabel/useInfoLabel.js.map +1 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.styles.js +50 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.styles.js.map +1 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.styles.raw.js +45 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.styles.raw.js.map +1 -0
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/InfoButton.js +26 -6
- package/lib-commonjs/InfoButton.js.map +1 -1
- package/lib-commonjs/InfoLabel.js +28 -0
- package/lib-commonjs/InfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js +22 -8
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.js +18 -16
- package/lib-commonjs/components/InfoButton/InfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.types.js +6 -4
- package/lib-commonjs/components/InfoButton/InfoButton.types.js.map +1 -1
- package/lib-commonjs/components/InfoButton/index.js +29 -10
- package/lib-commonjs/components/InfoButton/index.js.map +1 -1
- package/lib-commonjs/components/InfoButton/renderInfoButton.js +21 -24
- package/lib-commonjs/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButton.js +80 -65
- package/lib-commonjs/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.js +350 -0
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.raw.js +113 -0
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.js +22 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.types.js +8 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.types.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/index.js +31 -0
- package/lib-commonjs/components/InfoLabel/index.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/renderInfoLabel.js +21 -0
- package/lib-commonjs/components/InfoLabel/renderInfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabel.js +81 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.js +68 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.raw.js +57 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/index.js +41 -35
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +22 -33
- package/CHANGELOG.json +0 -342
- package/lib/components/InfoButton/useInfoButtonStyles.js +0 -153
- package/lib/components/InfoButton/useInfoButtonStyles.js.map +0 -1
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js +0 -160
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js.map +0 -1
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-deprecated */ "use strict";
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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: function() {
|
|
13
|
+
return _index.InfoButton;
|
|
14
|
+
},
|
|
15
|
+
infoButtonClassNames: function() {
|
|
16
|
+
return _index.infoButtonClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderInfoButton_unstable: function() {
|
|
19
|
+
return _index.renderInfoButton_unstable;
|
|
20
|
+
},
|
|
21
|
+
useInfoButtonStyles_unstable: function() {
|
|
22
|
+
return _index.useInfoButtonStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
useInfoButton_unstable: function() {
|
|
25
|
+
return _index.useInfoButton_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _index = require("./components/InfoButton/index");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/InfoButton.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-deprecated */\nexport type { InfoButtonProps, InfoButtonSlots, InfoButtonState } from './components/InfoButton/index';\nexport {\n InfoButton,\n infoButtonClassNames,\n renderInfoButton_unstable,\n useInfoButtonStyles_unstable,\n useInfoButton_unstable,\n} from './components/InfoButton/index';\n"],"names":["InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable"],"mappings":"AAAA,mDAAmD,GAEnD;;;;;;;;;;;;eACEA,iBAAU;;;eACVC,2BAAoB;;;eACpBC,gCAAyB;;;eACzBC,mCAA4B;;;eAC5BC,6BAAsB;;;uBACjB,gCAAgC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-deprecated */ "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
|
+
InfoLabel: function() {
|
|
13
|
+
return _index.InfoLabel;
|
|
14
|
+
},
|
|
15
|
+
infoLabelClassNames: function() {
|
|
16
|
+
return _index.infoLabelClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderInfoLabel_unstable: function() {
|
|
19
|
+
return _index.renderInfoLabel_unstable;
|
|
20
|
+
},
|
|
21
|
+
useInfoLabelStyles_unstable: function() {
|
|
22
|
+
return _index.useInfoLabelStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
useInfoLabel_unstable: function() {
|
|
25
|
+
return _index.useInfoLabel_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _index = require("./components/InfoLabel/index");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/InfoLabel.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-deprecated */\nexport type { InfoLabelProps, InfoLabelSlots, InfoLabelState } from './components/InfoLabel/index';\nexport {\n InfoLabel,\n infoLabelClassNames,\n renderInfoLabel_unstable,\n useInfoLabelStyles_unstable,\n useInfoLabel_unstable,\n} from './components/InfoLabel/index';\n"],"names":["InfoLabel","infoLabelClassNames","renderInfoLabel_unstable","useInfoLabelStyles_unstable","useInfoLabel_unstable"],"mappings":"AAAA,mDAAmD,GAEnD;;;;;;;;;;;;eACEA,gBAAS;;;eACTC,0BAAmB;;;eACnBC,+BAAwB;;;eACxBC,kCAA2B;;;eAC3BC,4BAAqB;;;uBAChB,+BAA+B"}
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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: function() {
|
|
13
|
+
return DefaultInfoButtonIcon12;
|
|
14
|
+
},
|
|
15
|
+
DefaultInfoButtonIcon16: function() {
|
|
16
|
+
return DefaultInfoButtonIcon16;
|
|
17
|
+
},
|
|
18
|
+
DefaultInfoButtonIcon20: function() {
|
|
19
|
+
return DefaultInfoButtonIcon20;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const _reacticons = require("@fluentui/react-icons");
|
|
23
|
+
const DefaultInfoButtonIcon12 = (0, _reacticons.bundleIcon)(_reacticons.Info12Filled, _reacticons.Info12Regular);
|
|
24
|
+
const DefaultInfoButtonIcon16 = (0, _reacticons.bundleIcon)(_reacticons.Info16Filled, _reacticons.Info16Regular);
|
|
25
|
+
const DefaultInfoButtonIcon20 = (0, _reacticons.bundleIcon)(_reacticons.Info20Filled, _reacticons.Info20Regular);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../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"],"names":["Info12Regular","Info12Filled","Info16Regular","Info16Filled","Info20Regular","Info20Filled","bundleIcon","DefaultInfoButtonIcon12","DefaultInfoButtonIcon16","DefaultInfoButtonIcon20"],"mappings":";;;;;;;;;;;IAUaO,uBAAAA;;;2BACAC;;;2BACAC;;;;4BAJN,wBAAwB;AAExB,oCAAgCH,sBAAAA,EAAWL,wBAAAA,EAAcD,yBAAAA,EAAe;AACxE,MAAMQ,8BAA0BF,sBAAAA,EAAWH,wBAAAA,EAAcD,yBAAAA,EAAe;AACxE,MAAMO,8BAA0BH,sBAAAA,EAAWD,wBAAAA,EAAcD,yBAAAA,EAAe"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-deprecated */ 'use client';
|
|
1
2
|
"use strict";
|
|
2
|
-
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
4
|
+
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* InfoButtons provide a way to display additional information about a form field or an area in the UI.
|
|
13
|
-
*/
|
|
14
|
-
exports.InfoButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
15
|
-
const state = useInfoButton_1.useInfoButton_unstable(props, ref);
|
|
16
|
-
useInfoButtonStyles_1.useInfoButtonStyles_unstable(state);
|
|
17
|
-
return renderInfoButton_1.renderInfoButton_unstable(state);
|
|
6
|
+
Object.defineProperty(exports, "InfoButton", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return InfoButton;
|
|
10
|
+
}
|
|
18
11
|
});
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
13
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
14
|
+
const _renderInfoButton = require("./renderInfoButton");
|
|
15
|
+
const _useInfoButton = require("./useInfoButton");
|
|
16
|
+
const _useInfoButtonStylesstyles = require("./useInfoButtonStyles.styles");
|
|
17
|
+
const InfoButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
|
+
const state = (0, _useInfoButton.useInfoButton_unstable)(props, ref);
|
|
19
|
+
(0, _useInfoButtonStylesstyles.useInfoButtonStyles_unstable)(state);
|
|
20
|
+
return (0, _renderInfoButton.renderInfoButton_unstable)(state);
|
|
21
|
+
});
|
|
22
|
+
InfoButton.displayName = 'InfoButton';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/components/InfoButton/InfoButton.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-deprecated */\n\n'use client';\n\nimport * 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.styles';\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 *\n * @deprecated use {@link @fluentui/react-components#InfoLabel} from `\\@fluentui/react-components` or `\\@fluentui/react-infolabel` instead\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"],"names":["React","renderInfoButton_unstable","useInfoButton_unstable","useInfoButtonStyles_unstable","InfoButton","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,mDAAmD,GAEnD;;;;;;;;;;;;iEAEuB,QAAQ;kCAEW,qBAAqB;+BACxB,kBAAkB;2CACZ,+BAA+B;AAQrE,MAAMI,aAAAA,WAAAA,GAAmDJ,OAAMK,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,YAAQN,qCAAAA,EAAuBI,OAAOC;QAE5CJ,uDAAAA,EAA6BK;IAC7B,WAAOP,2CAAAA,EAA0BO;AACnC,GAAG;AAEHJ,WAAWK,WAAW,GAAG"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-deprecated */ /**
|
|
2
|
+
* State used in rendering InfoButton
|
|
3
|
+
*
|
|
4
|
+
* @deprecated use {@link @fluentui/react-components#InfoLabel} from `\@fluentui/react-components` or `\@fluentui/react-infolabel` instead
|
|
5
|
+
*/ "use strict";
|
|
3
6
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
7
|
+
value: true
|
|
5
8
|
});
|
|
6
|
-
//# sourceMappingURL=InfoButton.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/components/InfoButton/InfoButton.types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-deprecated */\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PopoverProps, PopoverSurface } from '@fluentui/react-popover';\n\n/**\n * @deprecated use {@link @fluentui/react-components#InfoLabel} from `\\@fluentui/react-components` or `\\@fluentui/react-infolabel` instead\n */\nexport type InfoButtonSlots = {\n root: NonNullable<Slot<'button'>>;\n\n /**\n * The Popover element that wraps the info and root slots. Use this slot to pass props to the Popover.\n */\n popover: NonNullable<Slot<Partial<Omit<PopoverProps, 'openOnHover'>>>>;\n\n /**\n * The information to be displayed in the PopoverSurface when the button is pressed.\n */\n info: NonNullable<Slot<typeof PopoverSurface>>;\n};\n\n/**\n * InfoButton Props\n *\n * @deprecated use {@link @fluentui/react-components#InfoLabel} from `\\@fluentui/react-components` or `\\@fluentui/react-infolabel` instead\n */\nexport type InfoButtonProps = Omit<ComponentProps<Partial<InfoButtonSlots>>, 'disabled' | 'popover'> & {\n /**\n * Size of the InfoButton.\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Whether the InfoButton should be rendered inline or on a Portal.\n *\n * @default true\n */\n inline?: boolean;\n\n /**\n * The Popover element that wraps the info and root slots. Use this slot to pass props to the Popover.\n */\n popover?: InfoButtonSlots['popover'];\n};\n\n/**\n * State used in rendering InfoButton\n *\n * @deprecated use {@link @fluentui/react-components#InfoLabel} from `\\@fluentui/react-components` or `\\@fluentui/react-infolabel` instead\n */\nexport type InfoButtonState = ComponentState<InfoButtonSlots> & Required<Pick<InfoButtonProps, 'inline' | 'size'>>;\n"],"names":[],"mappings":"AAAA,mDAAmD,GA+CnD;;;;CAIC,GACD,WAAmH"}
|
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-deprecated */ "use strict";
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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: function() {
|
|
13
|
+
return _InfoButton.InfoButton;
|
|
14
|
+
},
|
|
15
|
+
infoButtonClassNames: function() {
|
|
16
|
+
return _useInfoButtonStylesstyles.infoButtonClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderInfoButton_unstable: function() {
|
|
19
|
+
return _renderInfoButton.renderInfoButton_unstable;
|
|
20
|
+
},
|
|
21
|
+
useInfoButtonStyles_unstable: function() {
|
|
22
|
+
return _useInfoButtonStylesstyles.useInfoButtonStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
useInfoButton_unstable: function() {
|
|
25
|
+
return _useInfoButton.useInfoButton_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _InfoButton = require("./InfoButton");
|
|
29
|
+
const _renderInfoButton = require("./renderInfoButton");
|
|
30
|
+
const _useInfoButton = require("./useInfoButton");
|
|
31
|
+
const _useInfoButtonStylesstyles = require("./useInfoButtonStyles.styles");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/components/InfoButton/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-deprecated */\nexport { InfoButton } from './InfoButton';\nexport type { InfoButtonProps, InfoButtonSlots, InfoButtonState } from './InfoButton.types';\nexport { renderInfoButton_unstable } from './renderInfoButton';\nexport { useInfoButton_unstable } from './useInfoButton';\nexport { infoButtonClassNames, useInfoButtonStyles_unstable } from './useInfoButtonStyles.styles';\n"],"names":["InfoButton","renderInfoButton_unstable","useInfoButton_unstable","infoButtonClassNames","useInfoButtonStyles_unstable"],"mappings":"AAAA,mDAAmD,GACnD;;;;;;;;;;;;eAASA,sBAAU;;;eAIVG,+CAAoB;;;eAFpBF,2CAAyB;;;eAEHG,uDAA4B;;;eADlDF,qCAAsB;;;4BAHJ,eAAe;kCAEA,qBAAqB;+BACxB,kBAAkB;2CACU,+BAA+B"}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-deprecated */ "use strict";
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
Object.defineProperty(exports, "renderInfoButton_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderInfoButton_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
13
|
+
const _reactpopover = require("@fluentui/react-popover");
|
|
14
|
+
const renderInfoButton_unstable = (state)=>{
|
|
15
|
+
(0, _reactutilities.assertSlots)(state);
|
|
16
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.popover, {
|
|
17
|
+
children: [
|
|
18
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactpopover.PopoverTrigger, {
|
|
19
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.info, {})
|
|
22
|
+
]
|
|
23
|
+
});
|
|
25
24
|
};
|
|
26
|
-
exports.renderInfoButton_unstable = renderInfoButton_unstable;
|
|
27
|
-
//# sourceMappingURL=renderInfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/components/InfoButton/renderInfoButton.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-deprecated */\n/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport type * as React from 'react';\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { PopoverTrigger } from '@fluentui/react-popover';\nimport type { InfoButtonState, InfoButtonSlots } from './InfoButton.types';\n\n/**\n * Render the final JSX of InfoButton\n *\n * @deprecated use {@link @fluentui/react-components#InfoLabel} from `\\@fluentui/react-components` or `\\@fluentui/react-infolabel` instead\n */\nexport const renderInfoButton_unstable = (state: InfoButtonState): React.ReactElement => {\n assertSlots<InfoButtonSlots>(state);\n\n return (\n <state.popover>\n <PopoverTrigger>\n <state.root />\n </PopoverTrigger>\n <state.info />\n </state.popover>\n );\n};\n"],"names":["assertSlots","PopoverTrigger","renderInfoButton_unstable","state","popover","root","info"],"mappings":"AAAA,mDAAmD,GACnD,0BAA0B,GAC1B;;;;;;;;;;4BAAA,iCAAiD;gCAGrB,4BAA4B;8BACzB,0BAA0B;AAQlD,MAAME,4BAA4B,CAACC;QACxCH,2BAAAA,EAA6BG;IAE7B,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,OAAO,EAAA;;8BACZ,eAAA,EAACH,4BAAAA,EAAAA;0BACC,WAAA,OAAA,eAAA,EAACE,MAAME,IAAI,EAAA,CAAA;;8BAEb,eAAA,EAACF,MAAMG,IAAI,EAAA,CAAA;;;AAGjB,EAAE"}
|
|
@@ -1,73 +1,88 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-deprecated */ 'use client';
|
|
1
2
|
"use strict";
|
|
2
|
-
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
4
|
+
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
Object.defineProperty(exports, "useInfoButton_unstable", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return useInfoButton_unstable;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
13
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
14
|
+
const _DefaultInfoButtonIcons = require("./DefaultInfoButtonIcons");
|
|
15
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
16
|
+
const _reactpopover = require("@fluentui/react-popover");
|
|
12
17
|
const infoButtonIconMap = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
small: /*#__PURE__*/ _react.createElement(_DefaultInfoButtonIcons.DefaultInfoButtonIcon12, null),
|
|
19
|
+
medium: /*#__PURE__*/ _react.createElement(_DefaultInfoButtonIcons.DefaultInfoButtonIcon16, null),
|
|
20
|
+
large: /*#__PURE__*/ _react.createElement(_DefaultInfoButtonIcons.DefaultInfoButtonIcon20, null)
|
|
16
21
|
};
|
|
17
22
|
const popoverSizeMap = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
small: 'small',
|
|
24
|
+
medium: 'small',
|
|
25
|
+
large: 'medium'
|
|
21
26
|
};
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
27
|
+
const useInfoButton_unstable = (props, ref)=>{
|
|
28
|
+
const { size = 'medium', inline = true, popover, info, ...rest } = props;
|
|
29
|
+
const state = {
|
|
30
|
+
inline,
|
|
31
|
+
size,
|
|
32
|
+
components: {
|
|
33
|
+
root: 'button',
|
|
34
|
+
popover: _reactpopover.Popover,
|
|
35
|
+
info: _reactpopover.PopoverSurface
|
|
36
|
+
},
|
|
37
|
+
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('button', {
|
|
38
|
+
children: infoButtonIconMap[size],
|
|
39
|
+
type: 'button',
|
|
40
|
+
'aria-label': 'information',
|
|
41
|
+
...rest,
|
|
42
|
+
// FIXME:
|
|
43
|
+
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLButtonElement`
|
|
44
|
+
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
|
|
45
|
+
ref: ref
|
|
46
|
+
}), {
|
|
47
|
+
elementType: 'button'
|
|
48
|
+
}),
|
|
49
|
+
popover: _reactutilities.slot.always(popover, {
|
|
50
|
+
defaultProps: {
|
|
51
|
+
inline,
|
|
52
|
+
positioning: 'above-start',
|
|
53
|
+
size: popoverSizeMap[size],
|
|
54
|
+
withArrow: true
|
|
55
|
+
},
|
|
56
|
+
elementType: _reactpopover.Popover
|
|
57
|
+
}),
|
|
58
|
+
info: _reactutilities.slot.always(info, {
|
|
59
|
+
defaultProps: {
|
|
60
|
+
role: 'note',
|
|
61
|
+
tabIndex: -1
|
|
62
|
+
},
|
|
63
|
+
elementType: _reactpopover.PopoverSurface
|
|
64
|
+
})
|
|
65
|
+
};
|
|
66
|
+
const [popoverOpen, setPopoverOpen] = (0, _reactutilities.useControllableState)({
|
|
67
|
+
state: state.popover.open,
|
|
68
|
+
defaultState: state.popover.defaultOpen,
|
|
69
|
+
initialState: false
|
|
70
|
+
});
|
|
71
|
+
state.popover.open = popoverOpen;
|
|
72
|
+
state.popover.onOpenChange = (0, _reactutilities.mergeCallbacks)(state.popover.onOpenChange, (e, data)=>setPopoverOpen(data.open));
|
|
73
|
+
const focusOutRef = _react.useCallback((el)=>{
|
|
74
|
+
if (!el) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
el.addEventListener('focusout', (e)=>{
|
|
78
|
+
const nextFocused = e.relatedTarget;
|
|
79
|
+
if ((0, _reactutilities.isHTMLElement)(nextFocused) && !(0, _reactutilities.elementContains)(el, nextFocused)) {
|
|
80
|
+
setPopoverOpen(false);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}, [
|
|
84
|
+
setPopoverOpen
|
|
85
|
+
]);
|
|
86
|
+
state.info.ref = (0, _reactutilities.useMergedRefs)(state.info.ref, focusOutRef);
|
|
87
|
+
return state;
|
|
71
88
|
};
|
|
72
|
-
exports.useInfoButton_unstable = useInfoButton_unstable;
|
|
73
|
-
//# sourceMappingURL=useInfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/components/InfoButton/useInfoButton.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-deprecated */\n\n'use client';\n\nimport * as React from 'react';\nimport { DefaultInfoButtonIcon12, DefaultInfoButtonIcon16, DefaultInfoButtonIcon20 } from './DefaultInfoButtonIcons';\nimport {\n getIntrinsicElementProps,\n mergeCallbacks,\n useControllableState,\n slot,\n useMergedRefs,\n isHTMLElement,\n elementContains,\n} from '@fluentui/react-utilities';\nimport { Popover, PopoverSurface } from '@fluentui/react-popover';\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 *\n * @deprecated use {@link @fluentui/react-components#InfoLabel} from `\\@fluentui/react-components` or `\\@fluentui/react-infolabel` instead\n */\nexport const useInfoButton_unstable = (props: InfoButtonProps, ref: React.Ref<HTMLElement>): InfoButtonState => {\n const { size = 'medium', inline = true, popover, info, ...rest } = props;\n\n const state: InfoButtonState = {\n inline,\n size,\n\n components: {\n root: 'button',\n popover: Popover as React.FC<Partial<PopoverProps>>,\n info: PopoverSurface,\n },\n\n root: slot.always(\n getIntrinsicElementProps('button', {\n children: infoButtonIconMap[size],\n type: 'button',\n 'aria-label': 'information',\n ...rest,\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLButtonElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLButtonElement>,\n }),\n { elementType: 'button' },\n ),\n popover: slot.always(popover, {\n defaultProps: {\n inline,\n positioning: 'above-start',\n size: popoverSizeMap[size],\n withArrow: true,\n },\n elementType: Popover as React.FC<Partial<Omit<PopoverProps, 'openOnHover'>>>,\n }),\n info: slot.always(info, {\n defaultProps: {\n role: 'note',\n tabIndex: -1,\n },\n elementType: PopoverSurface,\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 const focusOutRef = React.useCallback(\n (el: HTMLDivElement) => {\n if (!el) {\n return;\n }\n\n el.addEventListener('focusout', e => {\n const nextFocused = e.relatedTarget;\n\n if (isHTMLElement(nextFocused) && !elementContains(el, nextFocused)) {\n setPopoverOpen(false);\n }\n });\n },\n [setPopoverOpen],\n );\n\n state.info.ref = useMergedRefs(state.info.ref, focusOutRef);\n\n return state;\n};\n"],"names":["React","DefaultInfoButtonIcon12","DefaultInfoButtonIcon16","DefaultInfoButtonIcon20","getIntrinsicElementProps","mergeCallbacks","useControllableState","slot","useMergedRefs","isHTMLElement","elementContains","Popover","PopoverSurface","infoButtonIconMap","small","medium","large","popoverSizeMap","useInfoButton_unstable","props","ref","size","inline","popover","info","rest","state","components","root","always","children","type","elementType","defaultProps","positioning","withArrow","role","tabIndex","popoverOpen","setPopoverOpen","open","defaultState","defaultOpen","initialState","onOpenChange","e","data","focusOutRef","useCallback","el","addEventListener","nextFocused","relatedTarget"],"mappings":"AAAA,mDAAmD,GAEnD;;;;;;;;eAwCakB;;;;iEAtCU,QAAQ;wCAC2D,2BAA2B;gCAS9G,4BAA4B;8BACK,0BAA0B;AAIlE,MAAML,oBAAoB;IACxBC,OAAAA,WAAAA,GAAO,OAAA,aAAA,CAACb,+CAAAA,EAAAA;IACRc,QAAAA,WAAAA,GAAQ,OAAA,aAAA,CAACb,+CAAAA,EAAAA;IACTc,OAAAA,WAAAA,GAAO,OAAA,aAAA,CAACb,+CAAAA,EAAAA;AACV;AAEA,MAAMc,iBAAiB;IACrBH,OAAO;IACPC,QAAQ;IACRC,OAAO;AACT;AAaO,+BAA+B,CAACG,OAAwBC;IAC7D,MAAM,EAAEC,OAAO,QAAQ,EAAEC,SAAS,IAAI,EAAEC,OAAO,EAAEC,IAAI,EAAE,GAAGC,MAAM,GAAGN;IAEnE,MAAMO,QAAyB;QAC7BJ;QACAD;QAEAM,YAAY;YACVC,MAAM;YACNL,SAASZ,qBAAAA;YACTa,MAAMZ,4BAAAA;QACR;QAEAgB,MAAMrB,oBAAAA,CAAKsB,MAAM,KACfzB,wCAAAA,EAAyB,UAAU;YACjC0B,UAAUjB,iBAAiB,CAACQ,KAAK;YACjCU,MAAM;YACN,cAAc;YACd,GAAGN,IAAI;YACP,SAAS;YACT,+EAA+E;YAC/E,4FAA4F;YAC5FL,KAAKA;QACP,IACA;YAAEY,aAAa;QAAS;QAE1BT,SAAShB,oBAAAA,CAAKsB,MAAM,CAACN,SAAS;YAC5BU,cAAc;gBACZX;gBACAY,aAAa;gBACbb,MAAMJ,cAAc,CAACI,KAAK;gBAC1Bc,WAAW;YACb;YACAH,aAAarB,qBAAAA;QACf;QACAa,MAAMjB,oBAAAA,CAAKsB,MAAM,CAACL,MAAM;YACtBS,cAAc;gBACZG,MAAM;gBACNC,UAAU,CAAC;YACb;YACAL,aAAapB,4BAAAA;QACf;IACF;IAEA,MAAM,CAAC0B,aAAaC,eAAe,OAAGjC,oCAAAA,EAAqB;QACzDoB,OAAOA,MAAMH,OAAO,CAACiB,IAAI;QACzBC,cAAcf,MAAMH,OAAO,CAACmB,WAAW;QACvCC,cAAc;IAChB;IAEAjB,MAAMH,OAAO,CAACiB,IAAI,GAAGF;IACrBZ,MAAMH,OAAO,CAACqB,YAAY,OAAGvC,8BAAAA,EAAeqB,MAAMH,OAAO,CAACqB,YAAY,EAAE,CAACC,GAAGC,OAASP,eAAeO,KAAKN,IAAI;IAE7G,MAAMO,cAAc/C,OAAMgD,WAAW,CACnC,CAACC;QACC,IAAI,CAACA,IAAI;YACP;QACF;QAEAA,GAAGC,gBAAgB,CAAC,YAAYL,CAAAA;YAC9B,MAAMM,cAAcN,EAAEO,aAAa;YAEnC,QAAI3C,6BAAAA,EAAc0C,gBAAgB,KAACzC,+BAAAA,EAAgBuC,IAAIE,cAAc;gBACnEZ,eAAe;YACjB;QACF;IACF,GACA;QAACA;KAAe;IAGlBb,MAAMF,IAAI,CAACJ,GAAG,OAAGZ,6BAAAA,EAAckB,MAAMF,IAAI,CAACJ,GAAG,EAAE2B;IAE/C,OAAOrB;AACT,EAAE"}
|