@fluentui/react-popover 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.11

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 +935 -25
  2. package/CHANGELOG.md +297 -80
  3. package/Spec.md +20 -0
  4. package/dist/{react-popover.d.ts → index.d.ts} +117 -71
  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 +118 -56
  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 +36 -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 +4 -4
  36. package/lib/index.js.map +1 -1
  37. package/lib/popoverContext.js +7 -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 +125 -63
  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 +40 -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 +92 -5
  75. package/lib-commonjs/index.js.map +1 -1
  76. package/lib-commonjs/popoverContext.js +9 -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
@@ -1,5 +1,10 @@
1
- import { __styles, mergeClasses } from '@fluentui/react-make-styles';
2
- export var arrowHeights = {
1
+ import { shorthands, __styles, mergeClasses } from '@griffel/react';
2
+ import { createArrowHeightStyles, createArrowStyles } from '@fluentui/react-positioning';
3
+ import { tokens } from '@fluentui/react-theme';
4
+ export const popoverSurfaceClassNames = {
5
+ root: 'fui-PopoverSurface'
6
+ };
7
+ export const arrowHeights = {
3
8
  small: 6,
4
9
  medium: 8,
5
10
  large: 8
@@ -8,11 +13,14 @@ export var arrowHeights = {
8
13
  * Styles for the root slot
9
14
  */
10
15
 
11
- var useStyles = /*#__PURE__*/__styles({
16
+ const useStyles = /*#__PURE__*/__styles({
12
17
  "root": {
13
18
  "De3pzq": "fxugw4r",
14
- "E5pizo": ["f1hg901r", "f136t921"],
15
- "Dimara": "ff3glw6",
19
+ "E5pizo": "f1hg901r",
20
+ "Bbmb7ep": ["fff7au0", "f1bjk9e1"],
21
+ "Beyfa6y": ["f1bjk9e1", "fff7au0"],
22
+ "B7oj6ja": ["fwsfkhu", "f8wkphi"],
23
+ "Btl43ni": ["f8wkphi", "fwsfkhu"],
16
24
  "B4j52fo": "f5ogflp",
17
25
  "Bekrc4i": ["f1hqa2wf", "finvdd3"],
18
26
  "Bn0qgzm": "f1f09k3d",
@@ -53,47 +61,53 @@ var useStyles = /*#__PURE__*/__styles({
53
61
  "uwmqm3": ["fekwl8i", "fat0sn4"]
54
62
  },
55
63
  "smallArrow": {
56
- "a9b677": "f1smug5u",
57
- "Bqenvij": "f11ci07v"
64
+ "a9b677": "f1ekdpwm",
65
+ "Bqenvij": "f83vc9z"
58
66
  },
59
67
  "mediumLargeArrow": {
60
- "a9b677": "ftmg478",
61
- "Bqenvij": "f7bsbfx"
68
+ "a9b677": "f1kmc0fn",
69
+ "Bqenvij": "fb6lvc5"
62
70
  },
63
71
  "arrow": {
64
72
  "qhf8xq": "f1euv43f",
65
- "ayd6f0": "f1uo6wrk",
73
+ "De3pzq": "f1u2r49w",
66
74
  "Bcdw1i0": "fd7fpy0",
67
75
  "Bj3rh1h": "f1bsuimh",
68
76
  "rurcny": "fuzzvh5",
69
- "zf3lio": "f1qudtws",
77
+ "Bex5imi": "fkk33zh",
70
78
  "xx9plb": "fxf9f1y",
79
+ "Bmqnesq": "f170vdtw",
71
80
  "Bdn98qo": "f103af6e",
72
81
  "Bbc2r3f": "f15umuo5",
73
- "B4zgs9e": "ffo048g",
74
- "Bex5imi": "fkk33zh",
82
+ "B1dvbpk": "f3wpjpt",
83
+ "D4ky5z": "f1k3tce7",
84
+ "cqycoz": "f1dkdgqi",
85
+ "I89eb": "f5ghsz",
86
+ "k1i1uq": "fyqop9u",
87
+ "Epwjcz": "f1m5ya7j",
88
+ "Bp1vogq": "f3sp63x",
75
89
  "px8gyy": ["f5bg3dr", "f1rfdd74"],
76
- "h6z6rw": ["fzd2j21", "f2549he"],
77
- "hl6cv3": "fotnskf",
90
+ "h6z6rw": "fzd2j21",
91
+ "hl6cv3": "f1773hnp",
78
92
  "Bh2vraf": "f1n8855c",
79
- "yayu3t": ["f1nq055x", "f13ohf3"],
93
+ "yayu3t": "f1v7783n",
80
94
  "wedwtw": "fsw6im5",
81
- "rhl9o9": "ftghsr9",
95
+ "rhl9o9": "fh2hsk5",
82
96
  "Bu8t5uz": "f159pzir",
83
- "B6q6orb": ["f1l8vbt4", "fsxzh25"],
97
+ "B6q6orb": "f11yvu4",
84
98
  "Bwwlvwl": "fm1ycve"
85
99
  }
86
100
  }, {
87
- "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;}"]
101
+ "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;}"]
88
102
  });
89
103
  /**
90
104
  * Apply styling to the PopoverSurface slots based on the state
91
105
  */
92
106
 
93
107
 
94
- export var usePopoverSurfaceStyles = function (state) {
95
- var styles = useStyles();
96
- state.root.className = 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);
108
+ export const usePopoverSurfaceStyles_unstable = state => {
109
+ const styles = useStyles();
110
+ state.root.className = mergeClasses(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);
97
111
  state.arrowClassName = mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
98
112
  return state;
99
113
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurfaceStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC;AAIA,OAAO,IAAM,YAAY,GAAgC;AACvD,EAAA,KAAK,E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,wBAAwB,CAAC,IADQ,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,IAAN,KAAe,OAAf,IAA0B,MAAM,CAAC,YAHA,EAIjC,KAAK,CAAC,IAAN,KAAe,QAAf,IAA2B,MAAM,CAAC,aAJD,EAKjC,KAAK,CAAC,IAAN,KAAe,OAAf,IAA0B,MAAM,CAAC,YALA,EAMjC,KAAK,CAAC,UAAN,KAAqB,UAArB,IAAmC,MAAM,CAAC,QANT,EAOjC,KAAK,CAAC,UAAN,KAAqB,OAArB,IAAgC,MAAM,CAAC,KAPN,EAQjC,KAAK,CAAC,IAAN,CAAW,SARsB,CAAnC;AAWA,EAAA,KAAK,CAAC,cAAN,GAAuB,YAAY,CACjC,MAAM,CAAC,KAD0B,EAEjC,KAAK,CAAC,IAAN,KAAe,OAAf,GAAyB,MAAM,CAAC,UAAhC,GAA6C,MAAM,CAAC,gBAFnB,CAAnC;AAKA,SAAO,KAAP;AACD,CAnBM","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\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/"}
@@ -1,12 +1,13 @@
1
- import { usePopoverTrigger } from './usePopoverTrigger';
2
- import { renderPopoverTrigger } from './renderPopoverTrigger';
1
+ import { usePopoverTrigger_unstable } from './usePopoverTrigger';
2
+ import { renderPopoverTrigger_unstable } from './renderPopoverTrigger';
3
3
  /**
4
4
  * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
5
5
  */
6
6
 
7
- export var PopoverTrigger = function (props) {
8
- var state = usePopoverTrigger(props);
9
- return renderPopoverTrigger(state);
7
+ export const PopoverTrigger = props => {
8
+ const state = usePopoverTrigger_unstable(props);
9
+ return renderPopoverTrigger_unstable(state);
10
10
  };
11
11
  PopoverTrigger.displayName = 'PopoverTrigger';
12
+ PopoverTrigger.isFluentTriggerComponent = true;
12
13
  //# sourceMappingURL=PopoverTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":"AACA,SAAS,iBAAT,QAAkC,qBAAlC;AACA,SAAS,oBAAT,QAAqC,wBAArC;AAGA;;AAEG;;AACH,OAAO,IAAM,cAAc,GAAkC,UAAA,KAAA,EAAK;AAChE,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,CAA/B;AAEA,SAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CAJM;AAMP,cAAc,CAAC,WAAf,GAA6B,gBAA7B","sourceRoot":""}
1
+ {"version":3,"sources":["components/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":"AACA,SAAS,0BAAT,QAA2C,qBAA3C;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AAIA;;AAEG;;AACH,OAAO,MAAM,cAAc,GAA2D,KAAK,IAAG;AAC5F,QAAM,KAAK,GAAG,0BAA0B,CAAC,KAAD,CAAxC;AAEA,SAAO,6BAA6B,CAAC,KAAD,CAApC;AACD,CAJM;AAMP,cAAc,CAAC,WAAf,GAA6B,gBAA7B;AACA,cAAc,CAAC,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,"file":"PopoverTrigger.types.js","sourceRoot":"","sources":["../../../src/components/PopoverTrigger/PopoverTrigger.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"PopoverTrigger.types.js","sourceRoot":"../src/","sources":["components/PopoverTrigger/PopoverTrigger.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\n/**\n * PopoverTrigger Props\n */\nexport type PopoverTriggerProps = {\n children:\n | (React.ReactElement & { ref?: React.Ref<unknown> })\n | ((props: PopoverTriggerChildProps) => React.ReactElement | null);\n};\n\n/**\n * PopoverTrigger State\n */\nexport type PopoverTriggerState = {\n children: React.ReactElement | null;\n};\n\nexport type PopoverTriggerChildProps = {\n ref?: React.Ref<never>;\n} & Pick<\n React.HTMLAttributes<HTMLElement>,\n 'aria-haspopup' | 'onClick' | 'onContextMenu' | 'onKeyDown' | 'onMouseEnter' | 'onMouseLeave'\n>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/PopoverTrigger/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/PopoverTrigger/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from './PopoverTrigger';\nexport * from './PopoverTrigger.types';\nexport * from './renderPopoverTrigger';\nexport * from './usePopoverTrigger';\n"]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Render the final JSX of PopoverTrigger
3
3
  */
4
- export var renderPopoverTrigger = function (state) {
4
+ export const renderPopoverTrigger_unstable = state => {
5
5
  return state.children;
6
6
  };
7
7
  //# sourceMappingURL=renderPopoverTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverTrigger/renderPopoverTrigger.tsx"],"names":[],"mappings":"AAEA;;AAEG;AACH,OAAO,IAAM,oBAAoB,GAAG,UAAC,KAAD,EAA2B;AAC7D,SAAO,KAAK,CAAC,QAAb;AACD,CAFM","sourceRoot":""}
1
+ {"version":3,"sources":["components/PopoverTrigger/renderPopoverTrigger.tsx"],"names":[],"mappings":"AAEA;;AAEG;AACH,OAAO,MAAM,6BAA6B,GAAI,KAAD,IAA+B;AAC1E,SAAO,KAAK,CAAC,QAAb;AACD,CAFM","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/"}
@@ -1,55 +1,48 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
- import { useMergedRefs, useEventCallback, shouldPreventDefaultOnKeyDown } from '@fluentui/react-utilities';
2
+ import { applyTriggerPropsToChildren, getTriggerChild, shouldPreventDefaultOnKeyDown, useMergedRefs, useMergedEventCallbacks, useEventCallback } from '@fluentui/react-utilities';
4
3
  import { useModalAttributes } from '@fluentui/react-tabster';
5
- import { usePopoverContext } from '../../popoverContext';
4
+ import { usePopoverContext_unstable } from '../../popoverContext';
6
5
  /**
7
6
  * Create the state required to render PopoverTrigger.
8
7
  *
9
8
  * The returned state can be modified with hooks such as usePopoverTriggerStyles,
10
- * before being passed to renderPopoverTrigger.
9
+ * before being passed to renderPopoverTrigger_unstable.
11
10
  *
12
11
  * @param props - props from this instance of PopoverTrigger
13
12
  */
14
13
 
15
- export var usePopoverTrigger = function (props) {
16
- var setOpen = usePopoverContext(function (context) {
17
- return context.setOpen;
18
- });
19
- var open = usePopoverContext(function (context) {
20
- return context.open;
21
- });
22
- var triggerRef = usePopoverContext(function (context) {
23
- return context.triggerRef;
24
- });
25
- var openOnHover = usePopoverContext(function (context) {
26
- return context.openOnHover;
27
- });
28
- var openOnContext = usePopoverContext(function (context) {
29
- return context.openOnContext;
30
- });
31
- var triggerAttributes = useModalAttributes().triggerAttributes;
32
- var onContextMenu = useEventCallback(function (e) {
33
- var _a, _b;
14
+ export const usePopoverTrigger_unstable = props => {
15
+ var _a, _b, _c, _d, _e;
34
16
 
17
+ const {
18
+ children
19
+ } = props;
20
+ const child = /*#__PURE__*/React.isValidElement(children) ? getTriggerChild(children) : undefined;
21
+ const setOpen = usePopoverContext_unstable(context => context.setOpen);
22
+ const toggleOpen = usePopoverContext_unstable(context => context.toggleOpen);
23
+ const triggerRef = usePopoverContext_unstable(context => context.triggerRef);
24
+ const openOnHover = usePopoverContext_unstable(context => context.openOnHover);
25
+ const openOnContext = usePopoverContext_unstable(context => context.openOnContext);
26
+ const trapFocus = usePopoverContext_unstable(context => context.trapFocus);
27
+ const {
28
+ triggerAttributes
29
+ } = useModalAttributes();
30
+
31
+ const onContextMenu = e => {
35
32
  if (openOnContext) {
36
33
  e.preventDefault();
37
34
  setOpen(e, true);
38
35
  }
36
+ };
39
37
 
40
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onContextMenu) === null || _b === void 0 ? void 0 : _b.call(_a, e);
41
- });
42
- var onClick = useEventCallback(function (e) {
43
- var _a, _b;
44
-
38
+ const onClick = e => {
45
39
  if (!openOnContext) {
46
- setOpen(e, !open);
40
+ toggleOpen(e);
47
41
  }
42
+ };
48
43
 
49
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
50
- });
51
- var onKeyDown = useEventCallback(function (e) {
52
- var _a, _b, _c;
44
+ const onKeyDown = e => {
45
+ var _a;
53
46
 
54
47
  if (shouldPreventDefaultOnKeyDown(e) && (e.key === ' ' || e.key === 'Enter')) {
55
48
  e.preventDefault();
@@ -59,39 +52,31 @@ export var usePopoverTrigger = function (props) {
59
52
  if (e.key === 'Escape') {
60
53
  setOpen(e, false);
61
54
  }
55
+ };
62
56
 
63
- (_c = (_b = child.props) === null || _b === void 0 ? void 0 : _b.onKeyDown) === null || _c === void 0 ? void 0 : _c.call(_b, e);
64
- });
65
- var onMouseEnter = useEventCallback(function (e) {
66
- var _a, _b;
67
-
57
+ const onMouseEnter = useEventCallback(e => {
68
58
  if (openOnHover) {
69
59
  setOpen(e, true);
70
60
  }
71
-
72
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseEnter) === null || _b === void 0 ? void 0 : _b.call(_a, e);
73
61
  });
74
- var onMouseLeave = useEventCallback(function (e) {
75
- var _a, _b;
76
62
 
63
+ const onMouseLeave = e => {
77
64
  if (openOnHover) {
78
65
  setOpen(e, false);
79
66
  }
67
+ };
80
68
 
81
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseLeave) === null || _b === void 0 ? void 0 : _b.call(_a, e);
82
- });
83
- var child = React.Children.only(props.children);
84
69
  return {
85
- children: /*#__PURE__*/React.cloneElement(child, __assign(__assign(__assign(__assign({}, triggerAttributes), {
86
- 'aria-haspopup': 'true'
87
- }), child.props), {
88
- onClick: onClick,
89
- onMouseEnter: onMouseEnter,
90
- onKeyDown: onKeyDown,
91
- onMouseLeave: onMouseLeave,
92
- onContextMenu: onContextMenu,
93
- ref: useMergedRefs(child.ref, triggerRef)
94
- }))
70
+ children: applyTriggerPropsToChildren(props.children, { ...triggerAttributes,
71
+ 'aria-haspopup': trapFocus ? 'dialog' : 'true',
72
+ ...(child === null || child === void 0 ? void 0 : child.props),
73
+ onClick: useMergedEventCallbacks((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onClick, onClick),
74
+ onMouseEnter: useMergedEventCallbacks((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.onMouseEnter, onMouseEnter),
75
+ onKeyDown: useMergedEventCallbacks((_c = child === null || child === void 0 ? void 0 : child.props) === null || _c === void 0 ? void 0 : _c.onKeyDown, onKeyDown),
76
+ onMouseLeave: useMergedEventCallbacks((_d = child === null || child === void 0 ? void 0 : child.props) === null || _d === void 0 ? void 0 : _d.onMouseLeave, onMouseLeave),
77
+ onContextMenu: useMergedEventCallbacks((_e = child === null || child === void 0 ? void 0 : child.props) === null || _e === void 0 ? void 0 : _e.onContextMenu, onContextMenu),
78
+ ref: useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref)
79
+ })
95
80
  };
96
81
  };
97
82
  //# sourceMappingURL=usePopoverTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PopoverTrigger/usePopoverTrigger.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,aAAT,EAAwB,gBAAxB,EAA0C,6BAA1C,QAA+E,2BAA/E;AACA,SAAS,kBAAT,QAAmC,yBAAnC;AACA,SAAS,iBAAT,QAAkC,sBAAlC;AAGA;;;;;;;AAOG;;AACH,OAAO,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAA2B;AAC1D,MAAM,OAAO,GAAG,iBAAiB,CAAC,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,OAAA;AAAe,GAA3B,CAAjC;AACA,MAAM,IAAI,GAAG,iBAAiB,CAAC,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,IAAA;AAAY,GAAxB,CAA9B;AACA,MAAM,UAAU,GAAG,iBAAiB,CAAC,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,UAAA;AAAkB,GAA9B,CAApC;AACA,MAAM,WAAW,GAAG,iBAAiB,CAAC,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,WAAA;AAAmB,GAA/B,CAArC;AACA,MAAM,aAAa,GAAG,iBAAiB,CAAC,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,aAAA;AAAqB,GAAjC,CAAvC;AACQ,MAAA,iBAAiB,GAAK,kBAAkB,GAAvB,iBAAjB;AAER,MAAM,aAAa,GAAG,gBAAgB,CAAC,UAAC,CAAD,EAAiC;;;AACtE,QAAI,aAAJ,EAAmB;A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AE,KAAP,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,KAAA,CAAZ,GAAY,EAAA,CAAE,YAAf,EAA6B,YAA7B,CAPyC;AAQ9E,MAAA,aAAa,EAAE,uBAAuB,CAAC,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,aAAf,EAA8B,aAA9B,CARwC;AAS9E,MAAA,GAAG,EAAE,aAAa,CAAC,UAAD,EAAa,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,GAApB;AAT4D,KAA3C;AADhC,GAAP;AAaD,CA7DM","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/"}
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export * from './Popover';
2
- export * from './PopoverSurface';
3
- export * from './popoverContext';
4
- export * from './PopoverTrigger';
1
+ export { Popover, renderPopover_unstable, usePopover_unstable } from './Popover';
2
+ export { PopoverSurface, arrowHeights, popoverSurfaceClassNames, renderPopoverSurface_unstable, usePopoverSurfaceStyles_unstable, usePopoverSurface_unstable } from './PopoverSurface';
3
+ export { PopoverProvider, usePopoverContext_unstable } from './popoverContext';
4
+ export { PopoverTrigger, renderPopoverTrigger_unstable, usePopoverTrigger_unstable } from './PopoverTrigger';
5
5
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,SAAS,OAAT,EAAkB,sBAAlB,EAA0C,mBAA1C,QAAqE,WAArE;AAEA,SACE,cADF,EAEE,YAFF,EAGE,wBAHF,EAIE,6BAJF,EAKE,gCALF,EAME,0BANF,QAOO,kBAPP;AASA,SAAS,eAAT,EAA0B,0BAA1B,QAA4D,kBAA5D;AAEA,SAAS,cAAT,EAAyB,6BAAzB,EAAwD,0BAAxD,QAA0F,kBAA1F","sourcesContent":["export { Popover, renderPopover_unstable, usePopover_unstable } from './Popover';\nexport type { OnOpenChangeData, OpenPopoverEvents, PopoverProps, PopoverSize, PopoverState } from './Popover';\nexport {\n PopoverSurface,\n arrowHeights,\n popoverSurfaceClassNames,\n renderPopoverSurface_unstable,\n usePopoverSurfaceStyles_unstable,\n usePopoverSurface_unstable,\n} from './PopoverSurface';\nexport type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface';\nexport { PopoverProvider, 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/"}
@@ -1,9 +1,7 @@
1
1
  import { createContext, useContextSelector } from '@fluentui/react-context-selector';
2
- export var PopoverContext = /*#__PURE__*/createContext({
3
- open: false,
4
- setOpen: function () {
5
- return null;
6
- },
2
+ export const PopoverContext = /*#__PURE__*/createContext({
3
+ setOpen: () => null,
4
+ toggleOpen: () => null,
7
5
  triggerRef: {
8
6
  current: null
9
7
  },
@@ -16,9 +14,9 @@ export var PopoverContext = /*#__PURE__*/createContext({
16
14
  openOnContext: false,
17
15
  openOnHover: false,
18
16
  size: 'medium',
19
- trapFocus: false
17
+ trapFocus: false,
18
+ inline: false
20
19
  });
21
- export var usePopoverContext = function (selector) {
22
- return useContextSelector(PopoverContext, selector);
23
- };
20
+ export const PopoverProvider = PopoverContext.Provider;
21
+ export const usePopoverContext_unstable = selector => useContextSelector(PopoverContext, selector);
24
22
  //# sourceMappingURL=popoverContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/popoverContext.ts"],"names":[],"mappings":"AAAA,SAAS,aAAT,EAAwB,kBAAxB,QAAkD,kCAAlD;AAIA,OAAO,IAAM,cAAc,gBAAiC,aAAa,CAAsB;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,CAAtB,CAAlE;AA+BP,OAAO,IAAM,iBAAiB,GAAG,UAAI,QAAJ,EAAqD;AACpF,SAAA,kBAAkB,CAAC,cAAD,EAAiB,QAAjB,CAAlB;AAA4C,CADvC","sourceRoot":""}
1
+ {"version":3,"sources":["popoverContext.ts"],"names":[],"mappings":"AAAA,SAAS,aAAT,EAAwB,kBAAxB,QAAkD,kCAAlD;AAIA,OAAO,MAAM,cAAc,gBAAiC,aAAa,CAAsB;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,CAAtB,CAAlE;AAaP,OAAO,MAAM,eAAe,GAAG,cAAc,CAAC,QAAvC;AAsBP,OAAO,MAAM,0BAA0B,GAAO,QAAJ,IACxC,kBAAkB,CAAC,cAAD,EAAiB,QAAjB,CADb","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\nexport const PopoverProvider = PopoverContext.Provider;\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/"}
@@ -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("./components/Popover/index"), exports);
10
10
  //# sourceMappingURL=Popover.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Popover.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,4BAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["Popover.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,4BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/Popover/index';\n"],"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("./components/PopoverSurface/index"), exports);
10
10
  //# sourceMappingURL=PopoverSurface.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/PopoverSurface.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mCAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["PopoverSurface.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/PopoverSurface/index';\n"],"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("./components/PopoverTrigger/index"), exports);
10
10
  //# sourceMappingURL=PopoverTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/PopoverTrigger.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mCAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["PopoverTrigger.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/PopoverTrigger/index';\n"],"sourceRoot":"../src/"}
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Popover = void 0;
7
7
 
8
- var usePopover_1 = /*#__PURE__*/require("./usePopover");
8
+ const usePopover_1 = /*#__PURE__*/require("./usePopover");
9
9
 
10
- var renderPopover_1 = /*#__PURE__*/require("./renderPopover");
10
+ const renderPopover_1 = /*#__PURE__*/require("./renderPopover");
11
11
  /**
12
12
  * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.
13
13
  */
14
14
 
15
15
 
16
- var Popover = function (props) {
17
- var state = usePopover_1.usePopover(props);
18
- return renderPopover_1.renderPopover(state);
16
+ const Popover = props => {
17
+ const state = usePopover_1.usePopover_unstable(props);
18
+ return renderPopover_1.renderPopover_unstable(state);
19
19
  };
20
20
 
21
21
  exports.Popover = Popover;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":";;;;;;;AACA,IAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AACA,IAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,OAAO,GAA2B,UAAA,KAAA,EAAK;AAClD,MAAM,KAAK,GAAG,YAAA,CAAA,UAAA,CAAW,KAAX,CAAd;AAEA,SAAO,eAAA,CAAA,aAAA,CAAc,KAAd,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,OAAA,GAAO,OAAP;AAMb,OAAA,CAAA,OAAA,CAAQ,WAAR,GAAsB,SAAtB","sourceRoot":""}
1
+ {"version":3,"sources":["components/Popover/Popover.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,OAAO,GAA2B,KAAK,IAAG;AACrD,QAAM,KAAK,GAAG,YAAA,CAAA,mBAAA,CAAoB,KAApB,CAAd;AAEA,SAAO,eAAA,CAAA,sBAAA,CAAuB,KAAvB,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,OAAA,GAAO,OAAP;AAMb,OAAA,CAAA,OAAA,CAAQ,WAAR,GAAsB,SAAtB","sourcesContent":["import * as React from 'react';\nimport { usePopover_unstable } from './usePopover';\nimport { renderPopover_unstable } from './renderPopover';\nimport type { PopoverProps } from './Popover.types';\n\n/**\n * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.\n */\nexport const Popover: React.FC<PopoverProps> = props => {\n const state = usePopover_unstable(props);\n\n return renderPopover_unstable(state);\n};\n\nPopover.displayName = 'Popover';\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("./Popover"), exports);
10
10
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Popover/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/Popover/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Popover';\nexport * from './Popover.types';\nexport * from './renderPopover';\nexport * from './usePopover';\n"],"sourceRoot":"../src/"}
@@ -3,46 +3,50 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderPopover = void 0;
6
+ exports.renderPopover_unstable = void 0;
7
7
 
8
- var React = /*#__PURE__*/require("react");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
10
+ const popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
11
11
  /**
12
12
  * Render the final JSX of Popover
13
13
  */
14
14
 
15
15
 
16
- var renderPopover = function (state) {
17
- var open = state.open,
18
- setOpen = state.setOpen,
19
- triggerRef = state.triggerRef,
20
- contentRef = state.contentRef,
21
- openOnContext = state.openOnContext,
22
- openOnHover = state.openOnHover,
23
- mountNode = state.mountNode,
24
- arrowRef = state.arrowRef,
25
- size = state.size,
26
- noArrow = state.noArrow,
27
- appearance = state.appearance,
28
- trapFocus = state.trapFocus;
16
+ const renderPopover_unstable = state => {
17
+ const {
18
+ appearance,
19
+ arrowRef,
20
+ contentRef,
21
+ inline,
22
+ mountNode,
23
+ noArrow,
24
+ openOnContext,
25
+ openOnHover,
26
+ setOpen,
27
+ size,
28
+ toggleOpen,
29
+ trapFocus,
30
+ triggerRef
31
+ } = state;
29
32
  return React.createElement(popoverContext_1.PopoverContext.Provider, {
30
33
  value: {
31
- open: open,
32
- setOpen: setOpen,
33
- triggerRef: triggerRef,
34
- contentRef: contentRef,
35
- openOnHover: openOnHover,
36
- openOnContext: openOnContext,
37
- mountNode: mountNode,
38
- arrowRef: arrowRef,
39
- size: size,
40
- noArrow: noArrow,
41
- appearance: appearance,
42
- trapFocus: trapFocus
34
+ appearance,
35
+ arrowRef,
36
+ contentRef,
37
+ inline,
38
+ mountNode,
39
+ noArrow,
40
+ openOnContext,
41
+ openOnHover,
42
+ setOpen,
43
+ toggleOpen,
44
+ triggerRef,
45
+ size,
46
+ trapFocus
43
47
  }
44
- }, state.children);
48
+ }, state.popoverTrigger, state.open && state.popoverSurface);
45
49
  };
46
50
 
47
- exports.renderPopover = renderPopover;
51
+ exports.renderPopover_unstable = renderPopover_unstable;
48
52
  //# sourceMappingURL=renderPopover.js.map