@fluentui/react-popover 0.0.0-nightlyff78d1e27a20220217.1 → 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +780 -20
- package/CHANGELOG.md +281 -82
- package/Spec.md +25 -5
- package/dist/{react-popover.d.ts → index.d.ts} +99 -53
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.types.js.map +1 -1
- package/lib/components/Popover/constants.js +10 -0
- package/lib/components/Popover/constants.js.map +1 -0
- package/lib/components/Popover/renderPopover.js +23 -17
- package/lib/components/Popover/renderPopover.js.map +1 -1
- package/lib/components/Popover/usePopover.js +93 -18
- package/lib/components/Popover/usePopover.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
- package/lib/components/PopoverSurface/renderPopoverSurface.js +9 -8
- package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurface.js +8 -16
- package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js +24 -22
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/usePopoverTrigger.js +4 -4
- package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/popoverContext.js +4 -1
- package/lib/popoverContext.js.map +1 -1
- package/lib-commonjs/components/Popover/Popover.js.map +1 -1
- package/lib-commonjs/components/Popover/constants.js +17 -0
- package/lib-commonjs/components/Popover/constants.js.map +1 -0
- package/lib-commonjs/components/Popover/renderPopover.js +23 -17
- package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
- package/lib-commonjs/components/Popover/usePopover.js +94 -17
- package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +9 -8
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +7 -16
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +25 -23
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +4 -4
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib-commonjs/index.js +92 -5
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/popoverContext.js +5 -2
- package/lib-commonjs/popoverContext.js.map +1 -1
- package/package.json +26 -28
- package/lib/Popover.d.ts +0 -1
- package/lib/PopoverSurface.d.ts +0 -1
- package/lib/PopoverTrigger.d.ts +0 -1
- package/lib/components/Popover/Popover.d.ts +0 -6
- package/lib/components/Popover/Popover.types.d.ts +0 -103
- package/lib/components/Popover/index.d.ts +0 -4
- package/lib/components/Popover/renderPopover.d.ts +0 -5
- package/lib/components/Popover/usePopover.d.ts +0 -10
- package/lib/components/PopoverSurface/PopoverSurface.d.ts +0 -6
- package/lib/components/PopoverSurface/PopoverSurface.types.d.ts +0 -21
- package/lib/components/PopoverSurface/index.d.ts +0 -5
- package/lib/components/PopoverSurface/renderPopoverSurface.d.ts +0 -5
- package/lib/components/PopoverSurface/usePopoverSurface.d.ts +0 -12
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +0 -8
- package/lib/components/PopoverTrigger/PopoverTrigger.d.ts +0 -7
- package/lib/components/PopoverTrigger/PopoverTrigger.types.d.ts +0 -18
- package/lib/components/PopoverTrigger/index.d.ts +0 -4
- package/lib/components/PopoverTrigger/renderPopoverTrigger.d.ts +0 -5
- package/lib/components/PopoverTrigger/usePopoverTrigger.d.ts +0 -10
- package/lib/index.d.ts +0 -4
- package/lib/popoverContext.d.ts +0 -8
- package/lib-commonjs/Popover.d.ts +0 -1
- package/lib-commonjs/PopoverSurface.d.ts +0 -1
- package/lib-commonjs/PopoverTrigger.d.ts +0 -1
- package/lib-commonjs/components/Popover/Popover.d.ts +0 -6
- package/lib-commonjs/components/Popover/Popover.types.d.ts +0 -103
- package/lib-commonjs/components/Popover/index.d.ts +0 -4
- package/lib-commonjs/components/Popover/renderPopover.d.ts +0 -5
- package/lib-commonjs/components/Popover/usePopover.d.ts +0 -10
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.d.ts +0 -6
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.d.ts +0 -21
- package/lib-commonjs/components/PopoverSurface/index.d.ts +0 -5
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.d.ts +0 -5
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.d.ts +0 -12
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +0 -8
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.d.ts +0 -7
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.d.ts +0 -18
- package/lib-commonjs/components/PopoverTrigger/index.d.ts +0 -4
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.d.ts +0 -5
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.d.ts +0 -10
- package/lib-commonjs/index.d.ts +0 -4
- package/lib-commonjs/popoverContext.d.ts +0 -8
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { PopoverProps, PopoverState } from './Popover.types';
|
2
|
-
/**
|
3
|
-
* Create the state required to render Popover.
|
4
|
-
*
|
5
|
-
* The returned state can be modified with hooks such as usePopoverStyles,
|
6
|
-
* before being passed to renderPopover_unstable.
|
7
|
-
*
|
8
|
-
* @param props - props from this instance of Popover
|
9
|
-
*/
|
10
|
-
export declare const usePopover_unstable: (props: PopoverProps) => PopoverState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { PopoverSurfaceProps } from './PopoverSurface.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* PopoverSurface component renders react children in a positioned box
|
5
|
-
*/
|
6
|
-
export declare const PopoverSurface: ForwardRefComponent<PopoverSurfaceProps>;
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
-
import type { PopoverContextValue } from '../../popoverContext';
|
3
|
-
/**
|
4
|
-
* PopoverSurface Props
|
5
|
-
*/
|
6
|
-
export declare type PopoverSurfaceProps = ComponentProps<PopoverSurfaceSlots>;
|
7
|
-
/**
|
8
|
-
* Names of the slots in PopoverSurfaceProps
|
9
|
-
*/
|
10
|
-
export declare type PopoverSurfaceSlots = {
|
11
|
-
root: Slot<'div'>;
|
12
|
-
};
|
13
|
-
/**
|
14
|
-
* PopoverSurface State
|
15
|
-
*/
|
16
|
-
export declare type PopoverSurfaceState = ComponentState<PopoverSurfaceSlots> & Pick<PopoverContextValue, 'open' | 'mountNode' | 'noArrow' | 'size' | 'appearance' | 'arrowRef'> & {
|
17
|
-
/**
|
18
|
-
* CSS class for the arrow element
|
19
|
-
*/
|
20
|
-
arrowClassName?: string;
|
21
|
-
};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';
|
3
|
-
/**
|
4
|
-
* Create the state required to render PopoverSurface.
|
5
|
-
*
|
6
|
-
* The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,
|
7
|
-
* before being passed to renderPopoverSurface_unstable.
|
8
|
-
*
|
9
|
-
* @param props - props from this instance of PopoverSurface
|
10
|
-
* @param ref - reference to root HTMLDivElement of PopoverSurface
|
11
|
-
*/
|
12
|
-
export declare const usePopoverSurface_unstable: (props: PopoverSurfaceProps, ref: React.Ref<HTMLDivElement>) => PopoverSurfaceState;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { PopoverSize } from '../Popover/Popover.types';
|
2
|
-
import type { PopoverSurfaceState } from './PopoverSurface.types';
|
3
|
-
export declare const popoverSurfaceClassName = "fui-PopoverSurface";
|
4
|
-
export declare const arrowHeights: Record<PopoverSize, number>;
|
5
|
-
/**
|
6
|
-
* Apply styling to the PopoverSurface slots based on the state
|
7
|
-
*/
|
8
|
-
export declare const usePopoverSurfaceStyles_unstable: (state: PopoverSurfaceState) => PopoverSurfaceState;
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { FluentTriggerComponent } from '@fluentui/react-utilities';
|
3
|
-
import type { PopoverTriggerProps } from './PopoverTrigger.types';
|
4
|
-
/**
|
5
|
-
* Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
|
6
|
-
*/
|
7
|
-
export declare const PopoverTrigger: React.FC<PopoverTriggerProps> & FluentTriggerComponent;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
/**
|
3
|
-
* PopoverTrigger Props
|
4
|
-
*/
|
5
|
-
export declare type PopoverTriggerProps = {
|
6
|
-
children: (React.ReactElement & {
|
7
|
-
ref?: React.Ref<unknown>;
|
8
|
-
}) | ((props: PopoverTriggerChildProps) => React.ReactElement | null);
|
9
|
-
};
|
10
|
-
/**
|
11
|
-
* PopoverTrigger State
|
12
|
-
*/
|
13
|
-
export declare type PopoverTriggerState = {
|
14
|
-
children: React.ReactElement | null;
|
15
|
-
};
|
16
|
-
export declare type PopoverTriggerChildProps = {
|
17
|
-
ref?: React.Ref<never>;
|
18
|
-
} & Pick<React.HTMLAttributes<HTMLElement>, 'aria-haspopup' | 'onClick' | 'onMouseEnter' | 'onKeyDown' | 'onMouseLeave' | 'onContextMenu'>;
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import type { PopoverTriggerState } from './PopoverTrigger.types';
|
2
|
-
/**
|
3
|
-
* Render the final JSX of PopoverTrigger
|
4
|
-
*/
|
5
|
-
export declare const renderPopoverTrigger_unstable: (state: PopoverTriggerState) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger.types';
|
2
|
-
/**
|
3
|
-
* Create the state required to render PopoverTrigger.
|
4
|
-
*
|
5
|
-
* The returned state can be modified with hooks such as usePopoverTriggerStyles,
|
6
|
-
* before being passed to renderPopoverTrigger_unstable.
|
7
|
-
*
|
8
|
-
* @param props - props from this instance of PopoverTrigger
|
9
|
-
*/
|
10
|
-
export declare const usePopoverTrigger_unstable: (props: PopoverTriggerProps) => PopoverTriggerState;
|
package/lib-commonjs/index.d.ts
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { ContextSelector, Context } from '@fluentui/react-context-selector';
|
2
|
-
import type { PopoverState } from './components/Popover/index';
|
3
|
-
export declare const PopoverContext: Context<PopoverContextValue>;
|
4
|
-
/**
|
5
|
-
* Context shared between Popover and its children components
|
6
|
-
*/
|
7
|
-
export declare type PopoverContextValue = Pick<PopoverState, 'open' | 'setOpen' | 'triggerRef' | 'contentRef' | 'openOnHover' | 'openOnContext' | 'mountNode' | 'noArrow' | 'arrowRef' | 'size' | 'appearance' | 'trapFocus'>;
|
8
|
-
export declare const usePopoverContext_unstable: <T>(selector: ContextSelector<PopoverContextValue, T>) => T;
|