@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.
Files changed (81) hide show
  1. package/CHANGELOG.md +1237 -5
  2. package/README.md +3 -24
  3. package/dist/index.d.ts +115 -9
  4. package/lib/InfoButton.js +1 -2
  5. package/lib/InfoButton.js.map +1 -1
  6. package/lib/InfoLabel.js +1 -0
  7. package/lib/InfoLabel.js.map +1 -0
  8. package/lib/components/InfoButton/DefaultInfoButtonIcons.js +3 -4
  9. package/lib/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
  10. package/lib/components/InfoButton/InfoButton.js +8 -7
  11. package/lib/components/InfoButton/InfoButton.js.map +1 -1
  12. package/lib/components/InfoButton/InfoButton.types.js +5 -2
  13. package/lib/components/InfoButton/InfoButton.types.js.map +1 -1
  14. package/lib/components/InfoButton/index.js +4 -6
  15. package/lib/components/InfoButton/index.js.map +1 -1
  16. package/lib/components/InfoButton/renderInfoButton.js +14 -16
  17. package/lib/components/InfoButton/renderInfoButton.js.map +1 -1
  18. package/lib/components/InfoButton/useInfoButton.js +71 -50
  19. package/lib/components/InfoButton/useInfoButton.js.map +1 -1
  20. package/lib/components/InfoButton/useInfoButtonStyles.styles.js +181 -0
  21. package/lib/components/InfoButton/useInfoButtonStyles.styles.js.map +1 -0
  22. package/lib/components/InfoButton/useInfoButtonStyles.styles.raw.js +99 -0
  23. package/lib/components/InfoButton/useInfoButtonStyles.styles.raw.js.map +1 -0
  24. package/lib/components/InfoLabel/InfoLabel.js +15 -0
  25. package/lib/components/InfoLabel/InfoLabel.js.map +1 -0
  26. package/lib/components/InfoLabel/InfoLabel.types.js +5 -0
  27. package/lib/components/InfoLabel/InfoLabel.types.js.map +1 -0
  28. package/lib/components/InfoLabel/index.js +4 -0
  29. package/lib/components/InfoLabel/index.js.map +1 -0
  30. package/lib/components/InfoLabel/renderInfoLabel.js +15 -0
  31. package/lib/components/InfoLabel/renderInfoLabel.js.map +1 -0
  32. package/lib/components/InfoLabel/useInfoLabel.js +80 -0
  33. package/lib/components/InfoLabel/useInfoLabel.js.map +1 -0
  34. package/lib/components/InfoLabel/useInfoLabelStyles.styles.js +50 -0
  35. package/lib/components/InfoLabel/useInfoLabelStyles.styles.js.map +1 -0
  36. package/lib/components/InfoLabel/useInfoLabelStyles.styles.raw.js +45 -0
  37. package/lib/components/InfoLabel/useInfoLabelStyles.styles.raw.js.map +1 -0
  38. package/lib/index.js +2 -2
  39. package/lib/index.js.map +1 -1
  40. package/lib-commonjs/InfoButton.js +26 -6
  41. package/lib-commonjs/InfoButton.js.map +1 -1
  42. package/lib-commonjs/InfoLabel.js +28 -0
  43. package/lib-commonjs/InfoLabel.js.map +1 -0
  44. package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js +22 -8
  45. package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
  46. package/lib-commonjs/components/InfoButton/InfoButton.js +18 -16
  47. package/lib-commonjs/components/InfoButton/InfoButton.js.map +1 -1
  48. package/lib-commonjs/components/InfoButton/InfoButton.types.js +6 -4
  49. package/lib-commonjs/components/InfoButton/InfoButton.types.js.map +1 -1
  50. package/lib-commonjs/components/InfoButton/index.js +29 -10
  51. package/lib-commonjs/components/InfoButton/index.js.map +1 -1
  52. package/lib-commonjs/components/InfoButton/renderInfoButton.js +21 -24
  53. package/lib-commonjs/components/InfoButton/renderInfoButton.js.map +1 -1
  54. package/lib-commonjs/components/InfoButton/useInfoButton.js +80 -65
  55. package/lib-commonjs/components/InfoButton/useInfoButton.js.map +1 -1
  56. package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.js +350 -0
  57. package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.js.map +1 -0
  58. package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.raw.js +113 -0
  59. package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.raw.js.map +1 -0
  60. package/lib-commonjs/components/InfoLabel/InfoLabel.js +22 -0
  61. package/lib-commonjs/components/InfoLabel/InfoLabel.js.map +1 -0
  62. package/lib-commonjs/components/InfoLabel/InfoLabel.types.js +8 -0
  63. package/lib-commonjs/components/InfoLabel/InfoLabel.types.js.map +1 -0
  64. package/lib-commonjs/components/InfoLabel/index.js +31 -0
  65. package/lib-commonjs/components/InfoLabel/index.js.map +1 -0
  66. package/lib-commonjs/components/InfoLabel/renderInfoLabel.js +21 -0
  67. package/lib-commonjs/components/InfoLabel/renderInfoLabel.js.map +1 -0
  68. package/lib-commonjs/components/InfoLabel/useInfoLabel.js +81 -0
  69. package/lib-commonjs/components/InfoLabel/useInfoLabel.js.map +1 -0
  70. package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.js +68 -0
  71. package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.js.map +1 -0
  72. package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.raw.js +57 -0
  73. package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.raw.js.map +1 -0
  74. package/lib-commonjs/index.js +41 -35
  75. package/lib-commonjs/index.js.map +1 -1
  76. package/package.json +22 -33
  77. package/CHANGELOG.json +0 -342
  78. package/lib/components/InfoButton/useInfoButtonStyles.js +0 -153
  79. package/lib/components/InfoButton/useInfoButtonStyles.js.map +0 -1
  80. package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js +0 -160
  81. 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
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/InfoButton/index"), exports);
8
- //# sourceMappingURL=InfoButton.js.map
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,"mappings":";;;;;;AAAAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-infobutton/src/InfoButton.ts"],"sourcesContent":["export * from './components/InfoButton/index';\n"]}
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
- value: true
3
+ value: true
5
4
  });
6
- exports.DefaultInfoButtonIcon20 = exports.DefaultInfoButtonIcon16 = exports.DefaultInfoButtonIcon12 = void 0;
7
- const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
8
- exports.DefaultInfoButtonIcon12 = /*#__PURE__*/react_icons_1.bundleIcon(react_icons_1.Info12Filled, react_icons_1.Info12Regular);
9
- exports.DefaultInfoButtonIcon16 = /*#__PURE__*/react_icons_1.bundleIcon(react_icons_1.Info16Filled, react_icons_1.Info16Regular);
10
- exports.DefaultInfoButtonIcon20 = /*#__PURE__*/react_icons_1.bundleIcon(react_icons_1.Info20Filled, react_icons_1.Info20Regular);
11
- //# sourceMappingURL=DefaultInfoButtonIcons.js.map
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,"mappings":";;;;;;AAAA;AAUaA,+BAAuB,gBAAGC,wBAAU,CAACA,0BAAY,EAAEA,2BAAa,CAAC;AACjED,+BAAuB,gBAAGC,wBAAU,CAACA,0BAAY,EAAEA,2BAAa,CAAC;AACjED,+BAAuB,gBAAGC,wBAAU,CAACA,0BAAY,EAAEA,2BAAa,CAAC","names":["exports","react_icons_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-infobutton/src/components/InfoButton/DefaultInfoButtonIcons.tsx"],"sourcesContent":["import {\n Info12Regular,\n Info12Filled,\n Info16Regular,\n Info16Filled,\n Info20Regular,\n Info20Filled,\n bundleIcon,\n} from '@fluentui/react-icons';\n\nexport const DefaultInfoButtonIcon12 = bundleIcon(Info12Filled, Info12Regular);\nexport const DefaultInfoButtonIcon16 = bundleIcon(Info16Filled, Info16Regular);\nexport const DefaultInfoButtonIcon20 = bundleIcon(Info20Filled, Info20Regular);\n"]}
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
- value: true
4
+ value: true
5
5
  });
6
- exports.InfoButton = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const renderInfoButton_1 = /*#__PURE__*/require("./renderInfoButton");
9
- const useInfoButton_1 = /*#__PURE__*/require("./useInfoButton");
10
- const useInfoButtonStyles_1 = /*#__PURE__*/require("./useInfoButtonStyles");
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
- exports.InfoButton.displayName = 'InfoButton';
20
- //# sourceMappingURL=InfoButton.js.map
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,"mappings":";;;;;;AAAA;AAEA;AACA;AACA;AAGA;;;AAGaA,kBAAU,gBAAyCC,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9F,MAAMC,KAAK,GAAGC,sCAAsB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEhDG,kDAA4B,CAACF,KAAK,CAAC;EACnC,OAAOG,4CAAyB,CAACH,KAAK,CAAC;AACzC,CAAC,CAAC;AAEFL,kBAAU,CAACS,WAAW,GAAG,YAAY","names":["exports","React","forwardRef","props","ref","state","useInfoButton_1","useInfoButtonStyles_1","renderInfoButton_1","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-infobutton/src/components/InfoButton/InfoButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderInfoButton_unstable } from './renderInfoButton';\nimport { useInfoButton_unstable } from './useInfoButton';\nimport { useInfoButtonStyles_unstable } from './useInfoButtonStyles';\nimport type { InfoButtonProps } from './InfoButton.types';\n\n/**\n * InfoButtons provide a way to display additional information about a form field or an area in the UI.\n */\nexport const InfoButton: ForwardRefComponent<InfoButtonProps> = React.forwardRef((props, ref) => {\n const state = useInfoButton_unstable(props, ref);\n\n useInfoButtonStyles_unstable(state);\n return renderInfoButton_unstable(state);\n});\n\nInfoButton.displayName = 'InfoButton';\n"]}
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
- "use strict";
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
- value: true
7
+ value: true
5
8
  });
6
- //# sourceMappingURL=InfoButton.types.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
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
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./InfoButton"), exports);
8
- tslib_1.__exportStar(require("./InfoButton.types"), exports);
9
- tslib_1.__exportStar(require("./renderInfoButton"), exports);
10
- tslib_1.__exportStar(require("./useInfoButton"), exports);
11
- tslib_1.__exportStar(require("./useInfoButtonStyles"), exports);
12
- //# sourceMappingURL=index.js.map
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,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-infobutton/src/components/InfoButton/index.ts"],"sourcesContent":["export * from './InfoButton';\nexport * from './InfoButton.types';\nexport * from './renderInfoButton';\nexport * from './useInfoButton';\nexport * from './useInfoButtonStyles';\n"]}
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
- value: true
3
+ value: true
5
4
  });
6
- exports.renderInfoButton_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- const react_popover_1 = /*#__PURE__*/require("@fluentui/react-popover");
10
- /**
11
- * Render the final JSX of InfoButton
12
- */
13
- const renderInfoButton_unstable = state => {
14
- const {
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
- }));
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,"mappings":";;;;;;AAAA;AACA;AACA;AAIA;;;AAGO,MAAMA,yBAAyB,GAAIC,KAAsB,IAAI;EAClE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAkBH,KAAK,CAAC;EAE7D,OACEI,oBAACH,KAAK,CAACI,OAAO;IAAA,GAAMH,SAAS,CAACG;EAAwB,GACpDD,oBAACE,8BAAc,QACbF,oBAACH,KAAK,CAACM,IAAI;IAAA,GAAKL,SAAS,CAACK;EAAI,EAAI,CACnB,EACjBH,oBAACH,KAAK,CAACO,OAAO;IAAA,GAAKN,SAAS,CAACM;EAAO,EAAI,CAC1B;AAEpB,CAAC;AAXYC,iCAAyB","names":["renderInfoButton_unstable","state","slots","slotProps","react_utilities_1","React","popover","react_popover_1","root","content","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-infobutton/src/components/InfoButton/renderInfoButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { PopoverTrigger } from '@fluentui/react-popover';\nimport type { PopoverProps } from '@fluentui/react-popover';\nimport type { InfoButtonState, InfoButtonSlots } from './InfoButton.types';\n\n/**\n * Render the final JSX of InfoButton\n */\nexport const renderInfoButton_unstable = (state: InfoButtonState) => {\n const { slots, slotProps } = getSlots<InfoButtonSlots>(state);\n\n return (\n <slots.popover {...(slotProps.popover as PopoverProps)}>\n <PopoverTrigger>\n <slots.root {...slotProps.root} />\n </PopoverTrigger>\n <slots.content {...slotProps.content} />\n </slots.popover>\n );\n};\n"]}
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
- value: true
4
+ value: true
5
5
  });
6
- exports.useInfoButton_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const DefaultInfoButtonIcons_1 = /*#__PURE__*/require("./DefaultInfoButtonIcons");
9
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
10
- const react_popover_1 = /*#__PURE__*/require("@fluentui/react-popover");
11
- const react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
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
- small: /*#__PURE__*/React.createElement(DefaultInfoButtonIcons_1.DefaultInfoButtonIcon12, null),
14
- medium: /*#__PURE__*/React.createElement(DefaultInfoButtonIcons_1.DefaultInfoButtonIcon16, null),
15
- large: /*#__PURE__*/React.createElement(DefaultInfoButtonIcons_1.DefaultInfoButtonIcon20, null)
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
- small: 'small',
19
- medium: 'small',
20
- large: 'medium'
23
+ small: 'small',
24
+ medium: 'small',
25
+ large: 'medium'
21
26
  };
22
- /**
23
- * Create the state required to render InfoButton.
24
- *
25
- * The returned state can be modified with hooks such as useInfoButtonStyles_unstable,
26
- * before being passed to renderInfoButton_unstable.
27
- *
28
- * @param props - props from this instance of InfoButton
29
- * @param ref - reference to root HTMLElement of InfoButton
30
- */
31
- const useInfoButton_unstable = (props, ref) => {
32
- const {
33
- size = 'medium'
34
- } = props;
35
- const state = {
36
- size,
37
- components: {
38
- root: 'button',
39
- popover: react_popover_1.Popover,
40
- content: react_popover_1.PopoverSurface
41
- },
42
- root: react_utilities_1.getNativeElementProps('button', {
43
- children: infoButtonIconMap[size],
44
- type: 'button',
45
- ...props,
46
- ref
47
- }),
48
- popover: react_utilities_1.resolveShorthand(props.popover, {
49
- required: true,
50
- defaultProps: {
51
- positioning: 'above-start',
52
- size: popoverSizeMap[size],
53
- withArrow: true
54
- }
55
- }),
56
- content: react_utilities_1.resolveShorthand(props.content, {
57
- required: true,
58
- defaultProps: {
59
- role: 'note'
60
- }
61
- })
62
- };
63
- const [popoverOpen, setPopoverOpen] = react_utilities_2.useControllableState({
64
- state: state.popover.open,
65
- defaultState: state.popover.defaultOpen,
66
- initialState: false
67
- });
68
- state.popover.open = popoverOpen;
69
- state.popover.onOpenChange = react_utilities_1.mergeCallbacks(state.popover.onOpenChange, (e, data) => setPopoverOpen(data.open));
70
- return state;
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,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAIA,MAAMA,iBAAiB,GAAG;EACxBC,KAAK,eAAEC,oBAACC,gDAAuB,OAAG;EAClCC,MAAM,eAAEF,oBAACC,gDAAuB,OAAG;EACnCE,KAAK,eAAEH,oBAACC,gDAAuB;CACvB;AAEV,MAAMG,cAAc,GAAG;EACrBL,KAAK,EAAE,OAAO;EACdG,MAAM,EAAE,OAAO;EACfC,KAAK,EAAE;CACC;AAEV;;;;;;;;;AASO,MAAME,sBAAsB,GAAG,CAACC,KAAsB,EAAEC,GAA2B,KAAqB;EAC7G,MAAM;IAAEC,IAAI,GAAG;EAAQ,CAAE,GAAGF,KAAK;EAEjC,MAAMG,KAAK,GAAoB;IAC7BD,IAAI;IAEJE,UAAU,EAAE;MACVC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAEC,uBAA0C;MACnDC,OAAO,EAAED;KACV;IAEDF,IAAI,EAAEI,uCAAqB,CAAC,QAAQ,EAAE;MACpCC,QAAQ,EAAElB,iBAAiB,CAACU,IAAI,CAAC;MACjCS,IAAI,EAAE,QAAQ;MACd,GAAGX,KAAK;MACRC;KACD,CAAC;IACFK,OAAO,EAAEG,kCAAgB,CAACT,KAAK,CAACM,OAAO,EAAE;MACvCM,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZC,WAAW,EAAE,aAAa;QAC1BZ,IAAI,EAAEJ,cAAc,CAACI,IAAI,CAAC;QAC1Ba,SAAS,EAAE;;KAEd,CAAC;IACFP,OAAO,EAAEC,kCAAgB,CAACT,KAAK,CAACQ,OAAO,EAAE;MACvCI,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZG,IAAI,EAAE;;KAET;GACF;EAED,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGC,sCAAoB,CAAC;IACzDhB,KAAK,EAAEA,KAAK,CAACG,OAAO,CAACc,IAAI;IACzBC,YAAY,EAAElB,KAAK,CAACG,OAAO,CAACgB,WAAW;IACvCC,YAAY,EAAE;GACf,CAAC;EAEFpB,KAAK,CAACG,OAAO,CAACc,IAAI,GAAGH,WAAW;EAChCd,KAAK,CAACG,OAAO,CAACkB,YAAY,GAAGf,gCAAc,CAACN,KAAK,CAACG,OAAO,CAACkB,YAAY,EAAE,CAACC,CAAC,EAAEC,IAAI,KAAKR,cAAc,CAACQ,IAAI,CAACN,IAAI,CAAC,CAAC;EAE/G,OAAOjB,KAAK;AACd,CAAC;AA5CYwB,8BAAsB","names":["infoButtonIconMap","small","React","DefaultInfoButtonIcons_1","medium","large","popoverSizeMap","useInfoButton_unstable","props","ref","size","state","components","root","popover","react_popover_1","content","react_utilities_1","children","type","required","defaultProps","positioning","withArrow","role","popoverOpen","setPopoverOpen","react_utilities_2","open","defaultState","defaultOpen","initialState","onOpenChange","e","data","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-infobutton/src/components/InfoButton/useInfoButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { DefaultInfoButtonIcon12, DefaultInfoButtonIcon16, DefaultInfoButtonIcon20 } from './DefaultInfoButtonIcons';\nimport { getNativeElementProps, mergeCallbacks, resolveShorthand } from '@fluentui/react-utilities';\nimport { Popover, PopoverSurface } from '@fluentui/react-popover';\nimport { useControllableState } from '@fluentui/react-utilities';\nimport type { InfoButtonProps, InfoButtonState } from './InfoButton.types';\nimport type { PopoverProps } from '@fluentui/react-popover';\n\nconst infoButtonIconMap = {\n small: <DefaultInfoButtonIcon12 />,\n medium: <DefaultInfoButtonIcon16 />,\n large: <DefaultInfoButtonIcon20 />,\n} as const;\n\nconst popoverSizeMap = {\n small: 'small',\n medium: 'small',\n large: 'medium',\n} as const;\n\n/**\n * Create the state required to render InfoButton.\n *\n * The returned state can be modified with hooks such as useInfoButtonStyles_unstable,\n * before being passed to renderInfoButton_unstable.\n *\n * @param props - props from this instance of InfoButton\n * @param ref - reference to root HTMLElement of InfoButton\n */\nexport const useInfoButton_unstable = (props: InfoButtonProps, ref: React.Ref<HTMLElement>): InfoButtonState => {\n const { size = 'medium' } = props;\n\n const state: InfoButtonState = {\n size,\n\n components: {\n root: 'button',\n popover: Popover as React.FC<Partial<PopoverProps>>,\n content: PopoverSurface,\n },\n\n root: getNativeElementProps('button', {\n children: infoButtonIconMap[size],\n type: 'button',\n ...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 },\n }),\n };\n\n const [popoverOpen, setPopoverOpen] = useControllableState({\n state: state.popover.open,\n defaultState: state.popover.defaultOpen,\n initialState: false,\n });\n\n state.popover.open = popoverOpen;\n state.popover.onOpenChange = mergeCallbacks(state.popover.onOpenChange, (e, data) => setPopoverOpen(data.open));\n\n return state;\n};\n"]}
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"}