You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[`<Popover>`](#popover)| This component creates the context for your popover box and trigger and contains some configuration options. |
78
+
|[`<Dialog>`](#popoverbox)| This component wraps any React element and turns it into a popover box. |
79
+
|[`<Trigger>`](#popoverme)| This component wraps any React element and turns it into a popover trigger. |
80
80
81
81
### Hooks
82
82
@@ -112,7 +112,7 @@ configuration options.
112
112
|`"flipY"`| This will attempt to flip its position on only the `y` axis to attempt to remain within the bounds of the window. |
113
113
|`function`| You can decide what to do with the popover on your own by providing a callback with the signature <code>(placement: string, triggerRect: ClientRect, popoverRect: ClientRect) => Placement | PlacementResult</code> where [`Placement`](#placement) is a string returning an alternative placement and `PlacementResult` is an object shaped `{placement: Placement, style: CSSProperties}`|
114
114
115
-
### `<PopoverBox>`
115
+
### `<Dialog>`
116
116
117
117
This component wraps any React element and turns it into a popover box.
118
118
@@ -160,9 +160,9 @@ These are the default placements allowed by the popover relative to its triggeri
160
160
#### Example
161
161
162
162
```jsx harmony
163
-
<PopoverBox placement="innerTopLeft">
163
+
<Dialog placement="innerTopLeft">
164
164
<div className="menu">Menu</div>
165
-
</PopoverBox>
165
+
</Dialog>
166
166
167
167
// <div
168
168
// class="menu"
@@ -176,23 +176,27 @@ These are the default placements allowed by the popover relative to its triggeri
176
176
// </div>
177
177
```
178
178
179
-
### `<PopoverMe>`
179
+
### `<Trigger>`
180
180
181
181
This component wraps any React element and turns it into a popover trigger.
| on | <code>"hover" | "click" | "focus" </code> |`undefined`| Yes |`"hover"` causes the popover to open on `mouseenter` and close on `mouseleave`. `"click"` causes the popover to toggle its visibility each `click` event. `"focus"` causes the popover to open when the child element is focused while nothing happens on blur. |
188
-
| children |`React.ReactElement`|`undefined`| Yes | The child is cloned by this component and has aria attributes injected into its props as well as the events defined above. |
| on | <code>"hover" | "click" | "focus" </code> |`undefined`| Yes |`"hover"` causes the popover to open on `mouseenter` and close on `mouseleave`. `"click"` causes the popover to toggle its visibility each `click` event. `"focus"` causes the popover to open when the child element is focused while nothing happens on blur. |
188
+
| closedClassName |`string`|`undefined`| No | This class name will be applied to the child element when the popover is `closed`. |
189
+
| openClassName |`string`|`undefined`| No | This class name will be applied to the child element when the popover is `open`. |
190
+
| closedStyle |`React.CSSProperties`|`undefined`| No | These styles will be applied to the child element when the popover is `closed`. |
191
+
| openStyle |`React.CSSProperties`|`undefined`| No | These styles name will be applied to the child element when the popover is `open`. |
192
+
| children |`React.ReactElement`|`undefined`| Yes | The child is cloned by this component and has aria attributes injected into its props as well as the events defined above. |
0 commit comments