@veeqo/ui 4.0.2 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Popover/Popover.d.ts +3 -15
- package/dist/components/Popover/hooks/useHandleFocus.d.ts +11 -0
- package/dist/components/Popover/hooks/useUpdateAriaAnchor.d.ts +11 -0
- package/dist/components/Popover/hooks/useUpdateAriaAnchor.test.d.ts +1 -0
- package/dist/components/Popover/styled.d.ts +5 -0
- package/dist/components/Popover/types.d.ts +21 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
- package/dist/components/Popover/PopoverDemo.d.ts +0 -3
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
4
|
-
zIndex: number;
|
|
5
|
-
}, never>;
|
|
6
|
-
export type PopoverProps = {
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
className?: string;
|
|
9
|
-
anchorElement: HTMLElement | null;
|
|
10
|
-
rootElementRef?: HTMLElement;
|
|
11
|
-
placement?: Placement;
|
|
12
|
-
onShouldClose?: () => void;
|
|
13
|
-
zIndex?: number;
|
|
14
|
-
};
|
|
15
|
-
export declare const Popover: ({ children, className, anchorElement, rootElementRef, placement, onShouldClose, zIndex, }: PopoverProps) => React.JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PopoverProps } from './types';
|
|
3
|
+
export declare const Popover: ({ id: passedId, children, zIndex, placement, anchorElement, rootElementRef, onShouldClose, style, disableFocusLock, ...dialogProps }: PopoverProps) => React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { KeyboardEventHandler } from 'react';
|
|
2
|
+
type UseHandleFocusArgs = {
|
|
3
|
+
popperElement: HTMLDialogElement | null;
|
|
4
|
+
anchorElement: HTMLElement | null;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
disableFocusLock?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const useHandleFocus: ({ popperElement, anchorElement, onClose, disableFocusLock, }: UseHandleFocusArgs) => {
|
|
9
|
+
handleKeyDown: KeyboardEventHandler<HTMLDialogElement>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type UseUpdateAriaAnchor = {
|
|
2
|
+
anchorElement: HTMLElement | null;
|
|
3
|
+
popoverId: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Update the anchor element to sent the required attributes if they haven't already set them.
|
|
7
|
+
*
|
|
8
|
+
* This allows current, inaccesible usages to be improved.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useUpdateAriaAnchor: ({ anchorElement, popoverId }: UseUpdateAriaAnchor) => void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BackdropProps } from './types';
|
|
2
|
+
export declare const PopoverDialog: import("styled-components").StyledComponent<"dialog", any, {
|
|
3
|
+
zIndex: number;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const Backdrop: import("styled-components").StyledComponent<"div", any, Pick<BackdropProps, "zIndex">, never>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DialogHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { Placement } from '@popperjs/core';
|
|
3
|
+
export type PopoverProps = DialogHTMLAttributes<HTMLDialogElement> & {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
zIndex?: number;
|
|
6
|
+
placement?: Placement;
|
|
7
|
+
anchorElement: HTMLElement | null;
|
|
8
|
+
rootElementRef?: HTMLElement;
|
|
9
|
+
/**
|
|
10
|
+
* Will disable the focus lock if set to true, use only if taking manual control.
|
|
11
|
+
*/
|
|
12
|
+
disableFocusLock?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* When background is clicked, or ESC key is pressed we call this to close the popover.
|
|
15
|
+
*/
|
|
16
|
+
onShouldClose: () => void;
|
|
17
|
+
};
|
|
18
|
+
export type BackdropProps = {
|
|
19
|
+
zIndex: number;
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
};
|