@fluentui/react-popover 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. package/CHANGELOG.json +868 -27
  2. package/CHANGELOG.md +280 -81
  3. package/Spec.md +20 -0
  4. package/dist/{react-popover.d.ts → index.d.ts} +116 -67
  5. package/{lib → dist}/tsdoc-metadata.json +0 -0
  6. package/lib/Popover.js.map +1 -1
  7. package/lib/PopoverSurface.js.map +1 -1
  8. package/lib/PopoverTrigger.js.map +1 -1
  9. package/lib/components/Popover/Popover.js +5 -5
  10. package/lib/components/Popover/Popover.js.map +1 -1
  11. package/lib/components/Popover/Popover.types.js.map +1 -1
  12. package/lib/components/Popover/index.js.map +1 -1
  13. package/lib/components/Popover/renderPopover.js +30 -26
  14. package/lib/components/Popover/renderPopover.js.map +1 -1
  15. package/lib/components/Popover/usePopover.js +116 -54
  16. package/lib/components/Popover/usePopover.js.map +1 -1
  17. package/lib/components/PopoverSurface/PopoverSurface.js +7 -7
  18. package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
  19. package/lib/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
  20. package/lib/components/PopoverSurface/index.js.map +1 -1
  21. package/lib/components/PopoverSurface/renderPopoverSurface.js +13 -13
  22. package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
  23. package/lib/components/PopoverSurface/usePopoverSurface.js +40 -64
  24. package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
  25. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js +41 -22
  26. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
  27. package/lib/components/PopoverTrigger/PopoverTrigger.js +6 -5
  28. package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
  29. package/lib/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
  30. package/lib/components/PopoverTrigger/index.js.map +1 -1
  31. package/lib/components/PopoverTrigger/renderPopoverTrigger.js +1 -1
  32. package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
  33. package/lib/components/PopoverTrigger/usePopoverTrigger.js +40 -55
  34. package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
  35. package/lib/index.js +5 -4
  36. package/lib/index.js.map +1 -1
  37. package/lib/popoverContext.js +6 -9
  38. package/lib/popoverContext.js.map +1 -1
  39. package/lib-commonjs/Popover.js +1 -1
  40. package/lib-commonjs/Popover.js.map +1 -1
  41. package/lib-commonjs/PopoverSurface.js +1 -1
  42. package/lib-commonjs/PopoverSurface.js.map +1 -1
  43. package/lib-commonjs/PopoverTrigger.js +1 -1
  44. package/lib-commonjs/PopoverTrigger.js.map +1 -1
  45. package/lib-commonjs/components/Popover/Popover.js +5 -5
  46. package/lib-commonjs/components/Popover/Popover.js.map +1 -1
  47. package/lib-commonjs/components/Popover/Popover.types.js.map +1 -1
  48. package/lib-commonjs/components/Popover/index.js +1 -1
  49. package/lib-commonjs/components/Popover/index.js.map +1 -1
  50. package/lib-commonjs/components/Popover/renderPopover.js +34 -30
  51. package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
  52. package/lib-commonjs/components/Popover/usePopover.js +121 -59
  53. package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
  54. package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +8 -8
  55. package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
  56. package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
  57. package/lib-commonjs/components/PopoverSurface/index.js +1 -1
  58. package/lib-commonjs/components/PopoverSurface/index.js.map +1 -1
  59. package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +18 -20
  60. package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
  61. package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +44 -70
  62. package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
  63. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +45 -24
  64. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
  65. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +6 -5
  66. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
  67. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
  68. package/lib-commonjs/components/PopoverTrigger/index.js +1 -1
  69. package/lib-commonjs/components/PopoverTrigger/index.js.map +1 -1
  70. package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +3 -3
  71. package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
  72. package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +45 -61
  73. package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
  74. package/lib-commonjs/index.js +99 -5
  75. package/lib-commonjs/index.js.map +1 -1
  76. package/lib-commonjs/popoverContext.js +8 -11
  77. package/lib-commonjs/popoverContext.js.map +1 -1
  78. package/package.json +23 -27
  79. package/lib/Popover.d.ts +0 -1
  80. package/lib/PopoverSurface.d.ts +0 -1
  81. package/lib/PopoverTrigger.d.ts +0 -1
  82. package/lib/common/isConformant.d.ts +0 -4
  83. package/lib/common/isConformant.js +0 -13
  84. package/lib/common/isConformant.js.map +0 -1
  85. package/lib/common/mockUsePopoverContext.d.ts +0 -7
  86. package/lib/common/mockUsePopoverContext.js +0 -38
  87. package/lib/common/mockUsePopoverContext.js.map +0 -1
  88. package/lib/components/Popover/Popover.d.ts +0 -6
  89. package/lib/components/Popover/Popover.types.d.ts +0 -100
  90. package/lib/components/Popover/index.d.ts +0 -4
  91. package/lib/components/Popover/renderPopover.d.ts +0 -5
  92. package/lib/components/Popover/usePopover.d.ts +0 -10
  93. package/lib/components/PopoverSurface/PopoverSurface.d.ts +0 -6
  94. package/lib/components/PopoverSurface/PopoverSurface.types.d.ts +0 -21
  95. package/lib/components/PopoverSurface/index.d.ts +0 -5
  96. package/lib/components/PopoverSurface/renderPopoverSurface.d.ts +0 -5
  97. package/lib/components/PopoverSurface/usePopoverSurface.d.ts +0 -13
  98. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +0 -7
  99. package/lib/components/PopoverTrigger/PopoverTrigger.d.ts +0 -6
  100. package/lib/components/PopoverTrigger/PopoverTrigger.types.d.ts +0 -11
  101. package/lib/components/PopoverTrigger/index.d.ts +0 -4
  102. package/lib/components/PopoverTrigger/renderPopoverTrigger.d.ts +0 -5
  103. package/lib/components/PopoverTrigger/usePopoverTrigger.d.ts +0 -10
  104. package/lib/index.d.ts +0 -4
  105. package/lib/popoverContext.d.ts +0 -8
  106. package/lib-commonjs/Popover.d.ts +0 -1
  107. package/lib-commonjs/PopoverSurface.d.ts +0 -1
  108. package/lib-commonjs/PopoverTrigger.d.ts +0 -1
  109. package/lib-commonjs/common/isConformant.d.ts +0 -4
  110. package/lib-commonjs/common/isConformant.js +0 -24
  111. package/lib-commonjs/common/isConformant.js.map +0 -1
  112. package/lib-commonjs/common/mockUsePopoverContext.d.ts +0 -7
  113. package/lib-commonjs/common/mockUsePopoverContext.js +0 -49
  114. package/lib-commonjs/common/mockUsePopoverContext.js.map +0 -1
  115. package/lib-commonjs/components/Popover/Popover.d.ts +0 -6
  116. package/lib-commonjs/components/Popover/Popover.types.d.ts +0 -100
  117. package/lib-commonjs/components/Popover/index.d.ts +0 -4
  118. package/lib-commonjs/components/Popover/renderPopover.d.ts +0 -5
  119. package/lib-commonjs/components/Popover/usePopover.d.ts +0 -10
  120. package/lib-commonjs/components/PopoverSurface/PopoverSurface.d.ts +0 -6
  121. package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.d.ts +0 -21
  122. package/lib-commonjs/components/PopoverSurface/index.d.ts +0 -5
  123. package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.d.ts +0 -5
  124. package/lib-commonjs/components/PopoverSurface/usePopoverSurface.d.ts +0 -13
  125. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +0 -7
  126. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.d.ts +0 -6
  127. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.d.ts +0 -11
  128. package/lib-commonjs/components/PopoverTrigger/index.d.ts +0 -4
  129. package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.d.ts +0 -5
  130. package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.d.ts +0 -10
  131. package/lib-commonjs/index.d.ts +0 -4
  132. package/lib-commonjs/popoverContext.d.ts +0 -8
@@ -3,10 +3,22 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.usePopoverSurfaceStyles = exports.arrowHeights = void 0;
6
+ exports.usePopoverSurfaceStyles_unstable = exports.arrowHeights = exports.popoverSurfaceClassNames = exports.popoverSurfaceClassName = void 0;
7
7
 
8
- var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
+ const react_positioning_1 = /*#__PURE__*/require("@fluentui/react-positioning");
11
+
12
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
13
+ /**
14
+ * @deprecated Use `popoverSurfaceClassNames.root` instead.
15
+ */
16
+
17
+
18
+ exports.popoverSurfaceClassName = 'fui-PopoverSurface';
19
+ exports.popoverSurfaceClassNames = {
20
+ root: 'fui-PopoverSurface'
21
+ };
10
22
  exports.arrowHeights = {
11
23
  small: 6,
12
24
  medium: 8,
@@ -16,11 +28,14 @@ exports.arrowHeights = {
16
28
  * Styles for the root slot
17
29
  */
18
30
 
19
- var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
31
+ const useStyles = /*#__PURE__*/react_1.__styles({
20
32
  "root": {
21
33
  "De3pzq": "fxugw4r",
22
- "E5pizo": ["f1hg901r", "f136t921"],
23
- "Dimara": "ff3glw6",
34
+ "E5pizo": "f1hg901r",
35
+ "Bbmb7ep": ["fff7au0", "f1bjk9e1"],
36
+ "Beyfa6y": ["f1bjk9e1", "fff7au0"],
37
+ "B7oj6ja": ["fwsfkhu", "f8wkphi"],
38
+ "Btl43ni": ["f8wkphi", "fwsfkhu"],
24
39
  "B4j52fo": "f5ogflp",
25
40
  "Bekrc4i": ["f1hqa2wf", "finvdd3"],
26
41
  "Bn0qgzm": "f1f09k3d",
@@ -61,50 +76,56 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
61
76
  "uwmqm3": ["fekwl8i", "fat0sn4"]
62
77
  },
63
78
  "smallArrow": {
64
- "a9b677": "f1smug5u",
65
- "Bqenvij": "f11ci07v"
79
+ "a9b677": "f1ekdpwm",
80
+ "Bqenvij": "f83vc9z"
66
81
  },
67
82
  "mediumLargeArrow": {
68
- "a9b677": "ftmg478",
69
- "Bqenvij": "f7bsbfx"
83
+ "a9b677": "f1kmc0fn",
84
+ "Bqenvij": "fb6lvc5"
70
85
  },
71
86
  "arrow": {
72
87
  "qhf8xq": "f1euv43f",
73
- "ayd6f0": "f1uo6wrk",
88
+ "De3pzq": "f1u2r49w",
74
89
  "Bcdw1i0": "fd7fpy0",
75
90
  "Bj3rh1h": "f1bsuimh",
76
91
  "rurcny": "fuzzvh5",
77
- "zf3lio": "f1qudtws",
92
+ "Bex5imi": "fkk33zh",
78
93
  "xx9plb": "fxf9f1y",
94
+ "Bmqnesq": "f170vdtw",
79
95
  "Bdn98qo": "f103af6e",
80
96
  "Bbc2r3f": "f15umuo5",
81
- "B4zgs9e": "ffo048g",
82
- "Bex5imi": "fkk33zh",
97
+ "B1dvbpk": "f3wpjpt",
98
+ "D4ky5z": "f1k3tce7",
99
+ "cqycoz": "f1dkdgqi",
100
+ "I89eb": "f5ghsz",
101
+ "k1i1uq": "fyqop9u",
102
+ "Epwjcz": "f1m5ya7j",
103
+ "Bp1vogq": "f3sp63x",
83
104
  "px8gyy": ["f5bg3dr", "f1rfdd74"],
84
- "h6z6rw": ["fzd2j21", "f2549he"],
85
- "hl6cv3": "fotnskf",
105
+ "h6z6rw": "fzd2j21",
106
+ "hl6cv3": "f1773hnp",
86
107
  "Bh2vraf": "f1n8855c",
87
- "yayu3t": ["f1nq055x", "f13ohf3"],
108
+ "yayu3t": "f1v7783n",
88
109
  "wedwtw": "fsw6im5",
89
- "rhl9o9": "ftghsr9",
110
+ "rhl9o9": "fh2hsk5",
90
111
  "Bu8t5uz": "f159pzir",
91
- "B6q6orb": ["f1l8vbt4", "fsxzh25"],
112
+ "B6q6orb": "f11yvu4",
92
113
  "Bwwlvwl": "fm1ycve"
93
114
  }
94
115
  }, {
95
- "d": [".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1hg901r{box-shadow:var(--shadow16);}", ".f136t921{box-shadow:var(--shadow-16);}", ".ff3glw6{border-radius:4px;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f1c73kur{background-color:var(--colorNeutralForeground1);}", ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}", ".ffp7eso{background-color:var(--colorBrandBackground);}", ".f1kcqot9{padding-top:12px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fpe6lb7{padding-bottom:12px;}", ".fqag9an{padding-top:16px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fp67ikv{padding-bottom:16px;}", ".fc7z3ec{padding-top:20px;}", ".fat0sn4{padding-right:20px;}", ".fekwl8i{padding-left:20px;}", ".fe2my4m{padding-bottom:20px;}", ".f1smug5u{width:8.485281374238571px;}", ".f11ci07v{height:8.485281374238571px;}", ".ftmg478{width:11.313708498984761px;}", ".f7bsbfx{height:11.313708498984761px;}", ".f1euv43f{position:absolute;}", ".f1uo6wrk{background:inherit;}", ".fd7fpy0{visibility:hidden;}", ".f1bsuimh{z-index:-1;}", ".fuzzvh5:before{content:\"\";}", ".f1qudtws:before{border-radius:4px;}", ".fxf9f1y:before{position:absolute;}", ".f103af6e:before{width:inherit;}", ".f15umuo5:before{height:inherit;}", ".ffo048g:before{background:inherit;}", ".fkk33zh:before{visibility:visible;}", ".f5bg3dr:before{border-bottom-right-radius:var(--borderRadiusSmall);}", ".f1rfdd74:before{border-bottom-left-radius:var(--borderRadiusSmall);}", ".fzd2j21:before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);}", ".f2549he:before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(-45deg);}", "[data-popper-placement^=\"top\"] .fotnskf{bottom:0;}", "[data-popper-placement^=\"top\"] .f1n8855c{--angle:0;}", "[data-popper-placement^=\"right\"] .f1nq055x{left:0;}", "[data-popper-placement^=\"right\"] .f13ohf3{right:0;}", "[data-popper-placement^=\"right\"] .fsw6im5{--angle:90deg;}", "[data-popper-placement^=\"bottom\"] .ftghsr9{top:0;}", "[data-popper-placement^=\"bottom\"] .f159pzir{--angle:180deg;}", "[data-popper-placement^=\"left\"] .f1l8vbt4{right:0;}", "[data-popper-placement^=\"left\"] .fsxzh25{left:0;}", "[data-popper-placement^=\"left\"] .fm1ycve{--angle:270deg;}"]
116
+ "d": [".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1hg901r{box-shadow:var(--shadow16);}", ".fff7au0{border-bottom-right-radius:4px;}", ".f1bjk9e1{border-bottom-left-radius:4px;}", ".fwsfkhu{border-top-right-radius:4px;}", ".f8wkphi{border-top-left-radius:4px;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f1c73kur{background-color:var(--colorNeutralForeground1);}", ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}", ".ffp7eso{background-color:var(--colorBrandBackground);}", ".f1kcqot9{padding-top:12px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fpe6lb7{padding-bottom:12px;}", ".fqag9an{padding-top:16px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fp67ikv{padding-bottom:16px;}", ".fc7z3ec{padding-top:20px;}", ".fat0sn4{padding-right:20px;}", ".fekwl8i{padding-left:20px;}", ".fe2my4m{padding-bottom:20px;}", ".f1ekdpwm{width:8.484px;}", ".f83vc9z{height:8.484px;}", ".f1kmc0fn{width:11.312px;}", ".fb6lvc5{height:11.312px;}", ".f1euv43f{position:absolute;}", ".f1u2r49w{background-color:inherit;}", ".fd7fpy0{visibility:hidden;}", ".f1bsuimh{z-index:-1;}", ".fuzzvh5:before{content:\"\";}", ".fkk33zh:before{visibility:visible;}", ".fxf9f1y:before{position:absolute;}", ".f170vdtw:before{box-sizing:border-box;}", ".f103af6e:before{width:inherit;}", ".f15umuo5:before{height:inherit;}", ".f3wpjpt:before{background-color:inherit;}", ".f1k3tce7:before{border-right-width:1px;}", ".f1dkdgqi:before{border-right-style:solid;}", ".f5ghsz:before{border-right-color:var(--colorTransparentStroke);}", ".fyqop9u:before{border-bottom-width:1px;}", ".f1m5ya7j:before{border-bottom-style:solid;}", ".f3sp63x:before{border-bottom-color:var(--colorTransparentStroke);}", ".f5bg3dr:before{border-bottom-right-radius:var(--borderRadiusSmall);}", ".f1rfdd74:before{border-bottom-left-radius:var(--borderRadiusSmall);}", ".fzd2j21:before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);}", "[data-popper-placement^=\"top\"] .f1773hnp{bottom:-1px;}", "[data-popper-placement^=\"top\"] .f1n8855c{--angle:0;}", "[data-popper-placement^=\"right\"] .f1v7783n{left:-1px;}", "[data-popper-placement^=\"right\"] .fsw6im5{--angle:90deg;}", "[data-popper-placement^=\"bottom\"] .fh2hsk5{top:-1px;}", "[data-popper-placement^=\"bottom\"] .f159pzir{--angle:180deg;}", "[data-popper-placement^=\"left\"] .f11yvu4{right:-1px;}", "[data-popper-placement^=\"left\"] .fm1ycve{--angle:270deg;}"]
96
117
  });
97
118
  /**
98
119
  * Apply styling to the PopoverSurface slots based on the state
99
120
  */
100
121
 
101
122
 
102
- var usePopoverSurfaceStyles = function (state) {
103
- var styles = useStyles();
104
- state.root.className = react_make_styles_1.mergeClasses(styles.root, state.size === 'small' && styles.smallPadding, state.size === 'medium' && styles.mediumPadding, state.size === 'large' && styles.largePadding, state.appearance === 'inverted' && styles.inverted, state.appearance === 'brand' && styles.brand, state.root.className);
105
- state.arrowClassName = react_make_styles_1.mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
123
+ const usePopoverSurfaceStyles_unstable = state => {
124
+ const styles = useStyles();
125
+ state.root.className = react_1.mergeClasses(exports.popoverSurfaceClassNames.root, styles.root, state.size === 'small' && styles.smallPadding, state.size === 'medium' && styles.mediumPadding, state.size === 'large' && styles.largePadding, state.appearance === 'inverted' && styles.inverted, state.appearance === 'brand' && styles.brand, state.root.className);
126
+ state.arrowClassName = react_1.mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
106
127
  return state;
107
128
  };
108
129
 
109
- exports.usePopoverSurfaceStyles = usePopoverSurfaceStyles;
130
+ exports.usePopoverSurfaceStyles_unstable = usePopoverSurfaceStyles_unstable;
110
131
  //# sourceMappingURL=usePopoverSurfaceStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurfaceStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAIa,OAAA,CAAA,YAAA,GAA4C;AACvD,EAAA,KAAK,EAAE,CADgD;AAEvD,EAAA,MAAM,EAAE,CAF+C;AAGvD,EAAA,KAAK,EAAE;AAHgD,CAA5C;AAMb;;AAEG;;AACH,IAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAqEA;;AAEG;;;AACI,IAAM,uBAAuB,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,YAAA,CACrB,MAAM,CAAC,KADc,EAErB,KAAK,CAAC,IAAN,KAAe,OAAf,GAAyB,MAAM,CAAC,UAAhC,GAA6C,MAAM,CAAC,gBAF/B,CAAvB;AAKA,SAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,gCAAA,GAAgC,gCAAhC","sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createArrowHeightStyles, createArrowStyles } from '@fluentui/react-positioning';\nimport { tokens } from '@fluentui/react-theme';\nimport type { PopoverSize } from '../Popover/Popover.types';\nimport type { PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @deprecated Use `popoverSurfaceClassNames.root` instead.\n */\nexport const popoverSurfaceClassName = 'fui-PopoverSurface';\nexport const popoverSurfaceClassNames: SlotClassNames<PopoverSurfaceSlots> = {\n root: 'fui-PopoverSurface',\n};\n\nexport const arrowHeights: Record<PopoverSize, number> = {\n small: 6,\n medium: 8,\n large: 8,\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow16,\n ...shorthands.borderRadius('4px'),\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStroke),\n },\n\n inverted: {\n // TODO: neutral background inverted missing from superset and theme\n backgroundColor: tokens.colorNeutralForeground1,\n color: tokens.colorNeutralForegroundInverted,\n },\n\n brand: {\n backgroundColor: tokens.colorBrandBackground,\n // TODO: clarify with designers what foreground color should be with brand background,\n color: tokens.colorNeutralForegroundInverted,\n },\n\n smallPadding: {\n ...shorthands.padding('12px'),\n },\n\n mediumPadding: {\n ...shorthands.padding('16px'),\n },\n\n largePadding: {\n ...shorthands.padding('20px'),\n },\n\n smallArrow: createArrowHeightStyles(arrowHeights.small),\n mediumLargeArrow: createArrowHeightStyles(arrowHeights.medium),\n arrow: createArrowStyles({ arrowHeight: undefined }),\n});\n\n/**\n * Apply styling to the PopoverSurface slots based on the state\n */\nexport const usePopoverSurfaceStyles_unstable = (state: PopoverSurfaceState): PopoverSurfaceState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n popoverSurfaceClassNames.root,\n styles.root,\n state.size === 'small' && styles.smallPadding,\n state.size === 'medium' && styles.mediumPadding,\n state.size === 'large' && styles.largePadding,\n state.appearance === 'inverted' && styles.inverted,\n state.appearance === 'brand' && styles.brand,\n state.root.className,\n );\n\n state.arrowClassName = mergeClasses(\n styles.arrow,\n state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -5,19 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.PopoverTrigger = void 0;
7
7
 
8
- var usePopoverTrigger_1 = /*#__PURE__*/require("./usePopoverTrigger");
8
+ const usePopoverTrigger_1 = /*#__PURE__*/require("./usePopoverTrigger");
9
9
 
10
- var renderPopoverTrigger_1 = /*#__PURE__*/require("./renderPopoverTrigger");
10
+ const renderPopoverTrigger_1 = /*#__PURE__*/require("./renderPopoverTrigger");
11
11
  /**
12
12
  * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
13
13
  */
14
14
 
15
15
 
16
- var PopoverTrigger = function (props) {
17
- var state = usePopoverTrigger_1.usePopoverTrigger(props);
18
- return renderPopoverTrigger_1.renderPopoverTrigger(state);
16
+ const PopoverTrigger = props => {
17
+ const state = usePopoverTrigger_1.usePopoverTrigger_unstable(props);
18
+ return renderPopoverTrigger_1.renderPopoverTrigger_unstable(state);
19
19
  };
20
20
 
21
21
  exports.PopoverTrigger = PopoverTrigger;
22
22
  exports.PopoverTrigger.displayName = 'PopoverTrigger';
23
+ exports.PopoverTrigger.isFluentTriggerComponent = true;
23
24
  //# sourceMappingURL=PopoverTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,IAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,cAAc,GAAkC,UAAA,KAAA,EAAK;AAChE,MAAM,KAAK,GAAG,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,CAAd;AAEA,SAAO,sBAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd;AAMb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","sourceRoot":""}
1
+ {"version":3,"sources":["components/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAIA;;AAEG;;;AACI,MAAM,cAAc,GAA2D,KAAK,IAAG;AAC5F,QAAM,KAAK,GAAG,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,CAAd;AAEA,SAAO,sBAAA,CAAA,6BAAA,CAA8B,KAA9B,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd;AAMb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B;AACA,OAAA,CAAA,cAAA,CAAe,wBAAf,GAA0C,IAA1C","sourcesContent":["import * as React from 'react';\nimport { usePopoverTrigger_unstable } from './usePopoverTrigger';\nimport { renderPopoverTrigger_unstable } from './renderPopoverTrigger';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\nimport type { PopoverTriggerProps } from './PopoverTrigger.types';\n\n/**\n * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.\n */\nexport const PopoverTrigger: React.FC<PopoverTriggerProps> & FluentTriggerComponent = props => {\n const state = usePopoverTrigger_unstable(props);\n\n return renderPopoverTrigger_unstable(state);\n};\n\nPopoverTrigger.displayName = 'PopoverTrigger';\nPopoverTrigger.isFluentTriggerComponent = true;\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var tslib_1 = /*#__PURE__*/require("tslib");
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
8
 
9
9
  tslib_1.__exportStar(require("./PopoverTrigger"), exports);
10
10
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverTrigger/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/PopoverTrigger/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './PopoverTrigger';\nexport * from './PopoverTrigger.types';\nexport * from './renderPopoverTrigger';\nexport * from './usePopoverTrigger';\n"],"sourceRoot":"../src/"}
@@ -3,14 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderPopoverTrigger = void 0;
6
+ exports.renderPopoverTrigger_unstable = void 0;
7
7
  /**
8
8
  * Render the final JSX of PopoverTrigger
9
9
  */
10
10
 
11
- var renderPopoverTrigger = function (state) {
11
+ const renderPopoverTrigger_unstable = state => {
12
12
  return state.children;
13
13
  };
14
14
 
15
- exports.renderPopoverTrigger = renderPopoverTrigger;
15
+ exports.renderPopoverTrigger_unstable = renderPopoverTrigger_unstable;
16
16
  //# sourceMappingURL=renderPopoverTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverTrigger/renderPopoverTrigger.tsx"],"names":[],"mappings":";;;;;;AAEA;;AAEG;;AACI,IAAM,oBAAoB,GAAG,UAAC,KAAD,EAA2B;AAC7D,SAAO,KAAK,CAAC,QAAb;AACD,CAFM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourceRoot":""}
1
+ {"version":3,"sources":["components/PopoverTrigger/renderPopoverTrigger.tsx"],"names":[],"mappings":";;;;;;AAEA;;AAEG;;AACI,MAAM,6BAA6B,GAAI,KAAD,IAA+B;AAC1E,SAAO,KAAK,CAAC,QAAb;AACD,CAFM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import type { PopoverTriggerState } from './PopoverTrigger.types';\n\n/**\n * Render the final JSX of PopoverTrigger\n */\nexport const renderPopoverTrigger_unstable = (state: PopoverTriggerState) => {\n return state.children;\n};\n"],"sourceRoot":"../src/"}
@@ -3,65 +3,57 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.usePopoverTrigger = void 0;
6
+ exports.usePopoverTrigger_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
11
 
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
12
+ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
13
13
 
14
- var react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
15
-
16
- var popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
14
+ const popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
17
15
  /**
18
16
  * Create the state required to render PopoverTrigger.
19
17
  *
20
18
  * The returned state can be modified with hooks such as usePopoverTriggerStyles,
21
- * before being passed to renderPopoverTrigger.
19
+ * before being passed to renderPopoverTrigger_unstable.
22
20
  *
23
21
  * @param props - props from this instance of PopoverTrigger
24
22
  */
25
23
 
26
24
 
27
- var usePopoverTrigger = function (props) {
28
- var setOpen = popoverContext_1.usePopoverContext(function (context) {
29
- return context.setOpen;
30
- });
31
- var open = popoverContext_1.usePopoverContext(function (context) {
32
- return context.open;
33
- });
34
- var triggerRef = popoverContext_1.usePopoverContext(function (context) {
35
- return context.triggerRef;
36
- });
37
- var openOnHover = popoverContext_1.usePopoverContext(function (context) {
38
- return context.openOnHover;
39
- });
40
- var openOnContext = popoverContext_1.usePopoverContext(function (context) {
41
- return context.openOnContext;
42
- });
43
- var triggerAttributes = react_tabster_1.useModalAttributes().triggerAttributes;
44
- var onContextMenu = react_utilities_1.useEventCallback(function (e) {
45
- var _a, _b;
46
-
25
+ const usePopoverTrigger_unstable = props => {
26
+ var _a, _b, _c, _d, _e;
27
+
28
+ const {
29
+ children
30
+ } = props;
31
+ const child = React.isValidElement(children) ? react_utilities_1.getTriggerChild(children) : undefined;
32
+ const setOpen = popoverContext_1.usePopoverContext_unstable(context => context.setOpen);
33
+ const toggleOpen = popoverContext_1.usePopoverContext_unstable(context => context.toggleOpen);
34
+ const triggerRef = popoverContext_1.usePopoverContext_unstable(context => context.triggerRef);
35
+ const openOnHover = popoverContext_1.usePopoverContext_unstable(context => context.openOnHover);
36
+ const openOnContext = popoverContext_1.usePopoverContext_unstable(context => context.openOnContext);
37
+ const trapFocus = popoverContext_1.usePopoverContext_unstable(context => context.trapFocus);
38
+ const {
39
+ triggerAttributes
40
+ } = react_tabster_1.useModalAttributes();
41
+
42
+ const onContextMenu = e => {
47
43
  if (openOnContext) {
48
44
  e.preventDefault();
49
45
  setOpen(e, true);
50
46
  }
47
+ };
51
48
 
52
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onContextMenu) === null || _b === void 0 ? void 0 : _b.call(_a, e);
53
- });
54
- var onClick = react_utilities_1.useEventCallback(function (e) {
55
- var _a, _b;
56
-
49
+ const onClick = e => {
57
50
  if (!openOnContext) {
58
- setOpen(e, !open);
51
+ toggleOpen(e);
59
52
  }
53
+ };
60
54
 
61
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
62
- });
63
- var onKeyDown = react_utilities_1.useEventCallback(function (e) {
64
- var _a, _b, _c;
55
+ const onKeyDown = e => {
56
+ var _a;
65
57
 
66
58
  if (react_utilities_1.shouldPreventDefaultOnKeyDown(e) && (e.key === ' ' || e.key === 'Enter')) {
67
59
  e.preventDefault();
@@ -71,41 +63,33 @@ var usePopoverTrigger = function (props) {
71
63
  if (e.key === 'Escape') {
72
64
  setOpen(e, false);
73
65
  }
66
+ };
74
67
 
75
- (_c = (_b = child.props) === null || _b === void 0 ? void 0 : _b.onKeyDown) === null || _c === void 0 ? void 0 : _c.call(_b, e);
76
- });
77
- var onMouseEnter = react_utilities_1.useEventCallback(function (e) {
78
- var _a, _b;
79
-
68
+ const onMouseEnter = react_utilities_1.useEventCallback(e => {
80
69
  if (openOnHover) {
81
70
  setOpen(e, true);
82
71
  }
83
-
84
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseEnter) === null || _b === void 0 ? void 0 : _b.call(_a, e);
85
72
  });
86
- var onMouseLeave = react_utilities_1.useEventCallback(function (e) {
87
- var _a, _b;
88
73
 
74
+ const onMouseLeave = e => {
89
75
  if (openOnHover) {
90
76
  setOpen(e, false);
91
77
  }
78
+ };
92
79
 
93
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseLeave) === null || _b === void 0 ? void 0 : _b.call(_a, e);
94
- });
95
- var child = React.Children.only(props.children);
96
80
  return {
97
- children: React.cloneElement(child, tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, triggerAttributes), {
98
- 'aria-haspopup': 'true'
99
- }), child.props), {
100
- onClick: onClick,
101
- onMouseEnter: onMouseEnter,
102
- onKeyDown: onKeyDown,
103
- onMouseLeave: onMouseLeave,
104
- onContextMenu: onContextMenu,
105
- ref: react_utilities_1.useMergedRefs(child.ref, triggerRef)
106
- }))
81
+ children: react_utilities_1.applyTriggerPropsToChildren(props.children, { ...triggerAttributes,
82
+ 'aria-haspopup': trapFocus ? 'dialog' : 'true',
83
+ ...(child === null || child === void 0 ? void 0 : child.props),
84
+ onClick: react_utilities_1.useMergedEventCallbacks((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onClick, onClick),
85
+ onMouseEnter: react_utilities_1.useMergedEventCallbacks((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.onMouseEnter, onMouseEnter),
86
+ onKeyDown: react_utilities_1.useMergedEventCallbacks((_c = child === null || child === void 0 ? void 0 : child.props) === null || _c === void 0 ? void 0 : _c.onKeyDown, onKeyDown),
87
+ onMouseLeave: react_utilities_1.useMergedEventCallbacks((_d = child === null || child === void 0 ? void 0 : child.props) === null || _d === void 0 ? void 0 : _d.onMouseLeave, onMouseLeave),
88
+ onContextMenu: react_utilities_1.useMergedEventCallbacks((_e = child === null || child === void 0 ? void 0 : child.props) === null || _e === void 0 ? void 0 : _e.onContextMenu, onContextMenu),
89
+ ref: react_utilities_1.useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref)
90
+ })
107
91
  };
108
92
  };
109
93
 
110
- exports.usePopoverTrigger = usePopoverTrigger;
94
+ exports.usePopoverTrigger_unstable = usePopoverTrigger_unstable;
111
95
  //# sourceMappingURL=usePopoverTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverTrigger/usePopoverTrigger.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,IAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;AAGA;;;;;;;AAOG;;;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAA2B;AAC1D,MAAM,OAAO,GAAG,gBAAA,CAAA,iBAAA,CAAkB,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,OAAA;AAAe,GAA5C,CAAhB;AACA,MAAM,IAAI,GAAG,gBAAA,CAAA,iBAAA,CAAkB,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,IAAA;AAAY,GAAzC,CAAb;AACA,MAAM,UAAU,GAAG,gBAAA,CAAA,iBAAA,CAAkB,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,UAAA;AAAkB,GAA/C,CAAnB;AACA,MAAM,WAAW,GAAG,gBAAA,CAAA,iBAAA,CAAkB,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,WAAA;AAAmB,GAAhD,CAApB;AACA,MAAM,aAAa,GAAG,gBAAA,CAAA,iBAAA,CAAkB,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,aAAA;AAAqB,GAAlD,CAAtB;AACQ,MAAA,iBAAiB,GAAK,eAAA,CAAA,kBAAA,GAAL,iBAAjB;AAER,MAAM,aAAa,GAAG,iBAAA,CAAA,gBAAA,CAAiB,UAAC,CAAD,EAAiC;;;AACtE,QAAI,aAAJ,EAAmB;AACjB,MAAA,CAAC,CAAC,cAAF;AACA,MAAA,OAAO,CAAC,CAAD,EAAI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K,KAAA,CAAL,GAAA,KAAK,CAAE,KAAP,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,KAAA,CAAZ,GAAY,EAAA,CAAE,SAAtC,EAAiD,SAAjD,CANmE;AAO9E,MAAA,YAAY,EAAE,iBAAA,CAAA,uBAAA,CAAwB,CAAA,EAAA,GAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,KAAP,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,KAAA,CAAZ,GAAY,EAAA,CAAE,YAAtC,EAAoD,YAApD,CAPgE;AAQ9E,MAAA,aAAa,EAAE,iBAAA,CAAA,uBAAA,CAAwB,CAAA,EAAA,GAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,KAAP,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,KAAA,CAAZ,GAAY,EAAA,CAAE,aAAtC,EAAqD,aAArD,CAR+D;AAS9E,MAAA,GAAG,EAAE,iBAAA,CAAA,aAAA,CAAc,UAAd,EAA0B,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,GAAjC;AATyE,KAAtE;AADL,GAAP;AAaD,CA7DM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","sourcesContent":["import * as React from 'react';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n shouldPreventDefaultOnKeyDown,\n useMergedRefs,\n useMergedEventCallbacks,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverTriggerChildProps, PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger.types';\n\n/**\n * Create the state required to render PopoverTrigger.\n *\n * The returned state can be modified with hooks such as usePopoverTriggerStyles,\n * before being passed to renderPopoverTrigger_unstable.\n *\n * @param props - props from this instance of PopoverTrigger\n */\nexport const usePopoverTrigger_unstable = (props: PopoverTriggerProps): PopoverTriggerState => {\n const { children } = props;\n const child = React.isValidElement(children) ? getTriggerChild(children) : undefined;\n\n const setOpen = usePopoverContext_unstable(context => context.setOpen);\n const toggleOpen = usePopoverContext_unstable(context => context.toggleOpen);\n const triggerRef = usePopoverContext_unstable(context => context.triggerRef);\n const openOnHover = usePopoverContext_unstable(context => context.openOnHover);\n const openOnContext = usePopoverContext_unstable(context => context.openOnContext);\n const trapFocus = usePopoverContext_unstable(context => context.trapFocus);\n const { triggerAttributes } = useModalAttributes();\n\n const onContextMenu = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnContext) {\n e.preventDefault();\n setOpen(e, true);\n }\n };\n\n const onClick = (e: React.MouseEvent<HTMLElement>) => {\n if (!openOnContext) {\n toggleOpen(e);\n }\n };\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n if (shouldPreventDefaultOnKeyDown(e) && (e.key === ' ' || e.key === 'Enter')) {\n e.preventDefault();\n (e.target as HTMLElement)?.click();\n }\n\n if (e.key === 'Escape') {\n setOpen(e, false);\n }\n };\n\n const onMouseEnter = useEventCallback((e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, true);\n }\n });\n\n const onMouseLeave = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, false);\n }\n };\n\n return {\n children: applyTriggerPropsToChildren<PopoverTriggerChildProps>(props.children, {\n ...triggerAttributes,\n 'aria-haspopup': trapFocus ? 'dialog' : 'true',\n ...child?.props,\n onClick: useMergedEventCallbacks(child?.props?.onClick, onClick),\n onMouseEnter: useMergedEventCallbacks(child?.props?.onMouseEnter, onMouseEnter),\n onKeyDown: useMergedEventCallbacks(child?.props?.onKeyDown, onKeyDown),\n onMouseLeave: useMergedEventCallbacks(child?.props?.onMouseLeave, onMouseLeave),\n onContextMenu: useMergedEventCallbacks(child?.props?.onContextMenu, onContextMenu),\n ref: useMergedRefs(triggerRef, child?.ref),\n }),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -3,14 +3,108 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.usePopoverTrigger_unstable = exports.renderPopoverTrigger_unstable = exports.PopoverTrigger = exports.usePopoverContext_unstable = exports.PopoverContext = exports.usePopoverSurface_unstable = exports.usePopoverSurfaceStyles_unstable = exports.renderPopoverSurface_unstable = exports.popoverSurfaceClassNames = exports.popoverSurfaceClassName = exports.arrowHeights = exports.PopoverSurface = exports.usePopover_unstable = exports.renderPopover_unstable = exports.Popover = void 0;
6
7
 
7
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ var Popover_1 = /*#__PURE__*/require("./Popover");
8
9
 
9
- tslib_1.__exportStar(require("./Popover"), exports);
10
+ Object.defineProperty(exports, "Popover", {
11
+ enumerable: true,
12
+ get: function () {
13
+ return Popover_1.Popover;
14
+ }
15
+ });
16
+ Object.defineProperty(exports, "renderPopover_unstable", {
17
+ enumerable: true,
18
+ get: function () {
19
+ return Popover_1.renderPopover_unstable;
20
+ }
21
+ });
22
+ Object.defineProperty(exports, "usePopover_unstable", {
23
+ enumerable: true,
24
+ get: function () {
25
+ return Popover_1.usePopover_unstable;
26
+ }
27
+ });
28
+
29
+ var PopoverSurface_1 = /*#__PURE__*/require("./PopoverSurface");
30
+
31
+ Object.defineProperty(exports, "PopoverSurface", {
32
+ enumerable: true,
33
+ get: function () {
34
+ return PopoverSurface_1.PopoverSurface;
35
+ }
36
+ });
37
+ Object.defineProperty(exports, "arrowHeights", {
38
+ enumerable: true,
39
+ get: function () {
40
+ return PopoverSurface_1.arrowHeights;
41
+ }
42
+ }); // eslint-disable-next-line deprecation/deprecation
43
+
44
+ Object.defineProperty(exports, "popoverSurfaceClassName", {
45
+ enumerable: true,
46
+ get: function () {
47
+ return PopoverSurface_1.popoverSurfaceClassName;
48
+ }
49
+ });
50
+ Object.defineProperty(exports, "popoverSurfaceClassNames", {
51
+ enumerable: true,
52
+ get: function () {
53
+ return PopoverSurface_1.popoverSurfaceClassNames;
54
+ }
55
+ });
56
+ Object.defineProperty(exports, "renderPopoverSurface_unstable", {
57
+ enumerable: true,
58
+ get: function () {
59
+ return PopoverSurface_1.renderPopoverSurface_unstable;
60
+ }
61
+ });
62
+ Object.defineProperty(exports, "usePopoverSurfaceStyles_unstable", {
63
+ enumerable: true,
64
+ get: function () {
65
+ return PopoverSurface_1.usePopoverSurfaceStyles_unstable;
66
+ }
67
+ });
68
+ Object.defineProperty(exports, "usePopoverSurface_unstable", {
69
+ enumerable: true,
70
+ get: function () {
71
+ return PopoverSurface_1.usePopoverSurface_unstable;
72
+ }
73
+ });
10
74
 
11
- tslib_1.__exportStar(require("./PopoverSurface"), exports);
75
+ var popoverContext_1 = /*#__PURE__*/require("./popoverContext");
12
76
 
13
- tslib_1.__exportStar(require("./popoverContext"), exports);
77
+ Object.defineProperty(exports, "PopoverContext", {
78
+ enumerable: true,
79
+ get: function () {
80
+ return popoverContext_1.PopoverContext;
81
+ }
82
+ });
83
+ Object.defineProperty(exports, "usePopoverContext_unstable", {
84
+ enumerable: true,
85
+ get: function () {
86
+ return popoverContext_1.usePopoverContext_unstable;
87
+ }
88
+ });
14
89
 
15
- tslib_1.__exportStar(require("./PopoverTrigger"), exports);
90
+ var PopoverTrigger_1 = /*#__PURE__*/require("./PopoverTrigger");
91
+
92
+ Object.defineProperty(exports, "PopoverTrigger", {
93
+ enumerable: true,
94
+ get: function () {
95
+ return PopoverTrigger_1.PopoverTrigger;
96
+ }
97
+ });
98
+ Object.defineProperty(exports, "renderPopoverTrigger_unstable", {
99
+ enumerable: true,
100
+ get: function () {
101
+ return PopoverTrigger_1.renderPopoverTrigger_unstable;
102
+ }
103
+ });
104
+ Object.defineProperty(exports, "usePopoverTrigger_unstable", {
105
+ enumerable: true,
106
+ get: function () {
107
+ return PopoverTrigger_1.usePopoverTrigger_unstable;
108
+ }
109
+ });
16
110
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,SAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,OAAA;AAAO;AAAP,CAAA;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,sBAAA;AAAsB;AAAtB,CAAA;AAAwB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,mBAAA;AAAmB;AAAnB,CAAA;;AAE1C,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,gBAAA,CAAA,cAAA;AAAc;AAAd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A;AAAgB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,4BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,gBAAA,CAAA,0BAAA;AAA0B;AAA1B,CAAA;;AAEzB,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,gBAAA,CAAA,cAAA;AAAc;AAAd,CAAA;AAAgB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,+BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,gBAAA,CAAA,6BAAA;AAA6B;AAA7B,CAAA;AAA+B,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,4BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,gBAAA,CAAA,0BAAA;AAA0B;AAA1B,CAAA","sourcesContent":["export { Popover, renderPopover_unstable, usePopover_unstable } from './Popover';\nexport type { OnOpenChangeData, OpenPopoverEvents, PopoverProps, PopoverSize, PopoverState } from './Popover';\nexport {\n PopoverSurface,\n arrowHeights,\n // eslint-disable-next-line deprecation/deprecation\n popoverSurfaceClassName,\n popoverSurfaceClassNames,\n renderPopoverSurface_unstable,\n usePopoverSurfaceStyles_unstable,\n usePopoverSurface_unstable,\n} from './PopoverSurface';\nexport type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface';\nexport { PopoverContext, usePopoverContext_unstable } from './popoverContext';\nexport type { PopoverContextValue } from './popoverContext';\nexport { PopoverTrigger, renderPopoverTrigger_unstable, usePopoverTrigger_unstable } from './PopoverTrigger';\nexport type { PopoverTriggerChildProps, PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger';\n"],"sourceRoot":"../src/"}
@@ -3,15 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.usePopoverContext = exports.PopoverContext = void 0;
6
+ exports.usePopoverContext_unstable = exports.PopoverContext = void 0;
7
7
 
8
- var react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
8
+ const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
9
9
 
10
10
  exports.PopoverContext = /*#__PURE__*/react_context_selector_1.createContext({
11
- open: false,
12
- setOpen: function () {
13
- return null;
14
- },
11
+ setOpen: () => null,
12
+ toggleOpen: () => null,
15
13
  triggerRef: {
16
14
  current: null
17
15
  },
@@ -24,12 +22,11 @@ exports.PopoverContext = /*#__PURE__*/react_context_selector_1.createContext({
24
22
  openOnContext: false,
25
23
  openOnHover: false,
26
24
  size: 'medium',
27
- trapFocus: false
25
+ trapFocus: false,
26
+ inline: false
28
27
  });
29
28
 
30
- var usePopoverContext = function (selector) {
31
- return react_context_selector_1.useContextSelector(exports.PopoverContext, selector);
32
- };
29
+ const usePopoverContext_unstable = selector => react_context_selector_1.useContextSelector(exports.PopoverContext, selector);
33
30
 
34
- exports.usePopoverContext = usePopoverContext;
31
+ exports.usePopoverContext_unstable = usePopoverContext_unstable;
35
32
  //# sourceMappingURL=popoverContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/popoverContext.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAIa,OAAA,CAAA,cAAA,gBAA+C,wBAAA,CAAA,aAAA,CAAmC;AAC7F,EAAA,IAAI,EAAE,KADuF;AAE7F,EAAA,OAAO,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAF0E;AAG7F,EAAA,UAAU,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GAHiF;AAI7F,EAAA,UAAU,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GAJiF;AAK7F,EAAA,QAAQ,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GALmF;AAM7F,EAAA,aAAa,EAAE,KAN8E;AAO7F,EAAA,WAAW,EAAE,KAPgF;AAQ7F,EAAA,IAAI,EAAE,QARuF;AAS7F,EAAA,SAAS,EAAE;AATkF,CAAnC,CAA/C;;AA+BN,IAAM,iBAAiB,GAAG,UAAI,QAAJ,EAAqD;AACpF,SAAA,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,cAAnB,EAAmC,QAAnC,CAAA;AAA4C,CADvC;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
1
+ {"version":3,"sources":["popoverContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAIa,OAAA,CAAA,cAAA,gBAA+C,wBAAA,CAAA,aAAA,CAAmC;AAC7F,EAAA,OAAO,EAAE,MAAM,IAD8E;AAE7F,EAAA,UAAU,EAAE,MAAM,IAF2E;AAG7F,EAAA,UAAU,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GAHiF;AAI7F,EAAA,UAAU,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GAJiF;AAK7F,EAAA,QAAQ,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GALmF;AAM7F,EAAA,aAAa,EAAE,KAN8E;AAO7F,EAAA,WAAW,EAAE,KAPgF;AAQ7F,EAAA,IAAI,EAAE,QARuF;AAS7F,EAAA,SAAS,EAAE,KATkF;AAU7F,EAAA,MAAM,EAAE;AAVqF,CAAnC,CAA/C;;AAiCN,MAAM,0BAA0B,GAAO,QAAJ,IACxC,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,cAAnB,EAAmC,QAAnC,CADK;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { PopoverState } from './components/Popover/index';\n\nexport const PopoverContext: Context<PopoverContextValue> = createContext<PopoverContextValue>({\n setOpen: () => null,\n toggleOpen: () => null,\n triggerRef: { current: null },\n contentRef: { current: null },\n arrowRef: { current: null },\n openOnContext: false,\n openOnHover: false,\n size: 'medium',\n trapFocus: false,\n inline: false,\n});\n\n/**\n * Context shared between Popover and its children components\n */\nexport type PopoverContextValue = Pick<\n PopoverState,\n | 'toggleOpen'\n | 'setOpen'\n | 'triggerRef'\n | 'contentRef'\n | 'openOnHover'\n | 'openOnContext'\n | 'mountNode'\n | 'noArrow'\n | 'arrowRef'\n | 'size'\n | 'appearance'\n | 'trapFocus'\n | 'inline'\n>;\n\nexport const usePopoverContext_unstable = <T>(selector: ContextSelector<PopoverContextValue, T>): T =>\n useContextSelector(PopoverContext, selector);\n"],"sourceRoot":"../src/"}