@yamada-ui/popover 0.2.7 → 0.2.9
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/index.d.mts +15 -0
- package/dist/popover-anchor.d.mts +5 -0
- package/dist/popover-body.d.mts +7 -0
- package/dist/popover-close-button.d.mts +7 -0
- package/dist/popover-content.d.mts +8 -0
- package/dist/popover-footer.d.mts +7 -0
- package/dist/popover-header.d.mts +7 -0
- package/dist/popover-trigger.d.mts +5 -0
- package/dist/popover.d.mts +122 -0
- package/package.json +10 -10
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { Popover, PopoverProps } from './popover.mjs';
|
|
2
|
+
export { PopoverTrigger } from './popover-trigger.mjs';
|
|
3
|
+
export { PopoverAnchor } from './popover-anchor.mjs';
|
|
4
|
+
export { PopoverCloseButton, PopoverCloseButtonProps } from './popover-close-button.mjs';
|
|
5
|
+
export { PopoverContent, PopoverContentProps } from './popover-content.mjs';
|
|
6
|
+
export { PopoverHeader, PopoverHeaderProps } from './popover-header.mjs';
|
|
7
|
+
export { PopoverBody, PopoverBodyProps } from './popover-body.mjs';
|
|
8
|
+
export { PopoverFooter, PopoverFooterProps } from './popover-footer.mjs';
|
|
9
|
+
import '@yamada-ui/core';
|
|
10
|
+
import '@yamada-ui/motion';
|
|
11
|
+
import '@yamada-ui/use-disclosure';
|
|
12
|
+
import '@yamada-ui/use-popper';
|
|
13
|
+
import '@yamada-ui/utils';
|
|
14
|
+
import 'react';
|
|
15
|
+
import '@yamada-ui/close-button';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
+
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
|
+
|
|
4
|
+
type PopoverBodyProps = HTMLUIProps<'main'>;
|
|
5
|
+
declare const PopoverBody: _yamada_ui_core.Component<"main", PopoverBodyProps>;
|
|
6
|
+
|
|
7
|
+
export { PopoverBody, PopoverBodyProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
+
import { CloseButtonProps } from '@yamada-ui/close-button';
|
|
3
|
+
|
|
4
|
+
type PopoverCloseButtonProps = CloseButtonProps;
|
|
5
|
+
declare const PopoverCloseButton: _yamada_ui_core.Component<"button", CloseButtonProps>;
|
|
6
|
+
|
|
7
|
+
export { PopoverCloseButton, PopoverCloseButtonProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
+
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
|
+
import { HTMLMotionProps } from '@yamada-ui/motion';
|
|
4
|
+
|
|
5
|
+
type PopoverContentProps = Omit<HTMLUIProps<'section'>, keyof Omit<HTMLMotionProps<'section'>, 'children'>> & Omit<HTMLMotionProps<'section'>, 'color' | 'style' | 'onDrag' | 'onDragEnd' | 'onDragStart' | 'onAnimationStart' | 'variants' | 'transition'>;
|
|
6
|
+
declare const PopoverContent: _yamada_ui_core.Component<"section", PopoverContentProps>;
|
|
7
|
+
|
|
8
|
+
export { PopoverContent, PopoverContentProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
+
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
|
+
|
|
4
|
+
type PopoverFooterProps = HTMLUIProps<'footer'>;
|
|
5
|
+
declare const PopoverFooter: _yamada_ui_core.Component<"footer", PopoverFooterProps>;
|
|
6
|
+
|
|
7
|
+
export { PopoverFooter, PopoverFooterProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
+
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
|
+
|
|
4
|
+
type PopoverHeaderProps = HTMLUIProps<'header'>;
|
|
5
|
+
declare const PopoverHeader: _yamada_ui_core.Component<"header", PopoverHeaderProps>;
|
|
6
|
+
|
|
7
|
+
export { PopoverHeader, PopoverHeaderProps };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { ThemeProps, CSSUIObject } from '@yamada-ui/core';
|
|
2
|
+
import { MotionTransitionProperties } from '@yamada-ui/motion';
|
|
3
|
+
import { LazyMode } from '@yamada-ui/use-disclosure';
|
|
4
|
+
import { UsePopperProps } from '@yamada-ui/use-popper';
|
|
5
|
+
import { PropGetter } from '@yamada-ui/utils';
|
|
6
|
+
import { PropsWithChildren, FC, RefObject } from 'react';
|
|
7
|
+
|
|
8
|
+
type PopoverOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* If `true`, the popover will be opened.
|
|
11
|
+
*/
|
|
12
|
+
isOpen?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* If `true`, the popover will be initially opened.
|
|
15
|
+
*/
|
|
16
|
+
defaultIsOpen?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Callback fired when the popover opens.
|
|
19
|
+
*/
|
|
20
|
+
onOpen?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Callback fired when the popover closes.
|
|
23
|
+
*/
|
|
24
|
+
onClose?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* The `ref` of the element that should receive focus when the popover opens.
|
|
27
|
+
*/
|
|
28
|
+
initialFocusRef?: RefObject<{
|
|
29
|
+
focus(): void;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* If `true`, focus will be returned to the element that triggers the popover when it closes.
|
|
33
|
+
*
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
restoreFocus?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* If `true`, focus will be transferred to the first interactive element when the popover opens.
|
|
39
|
+
*
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
autoFocus?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* If `true`, the popover will close when you blur out it by clicking outside or tabbing out.
|
|
45
|
+
*
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
closeOnBlur?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* If `true`, the popover will close when you hit the `Esc` key.
|
|
51
|
+
*
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
closeOnEsc?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* If `true`, display the popover close button.
|
|
57
|
+
*
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
60
|
+
closeOnButton?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The interaction that triggers the popover.
|
|
63
|
+
*
|
|
64
|
+
* - `hover`: means the popover will open when you hover with mouse or focus with keyboard on the popover trigger.
|
|
65
|
+
* - `click`: means the popover will open on click or press `Enter` to `Space` on keyboard.
|
|
66
|
+
*
|
|
67
|
+
* @default 'click'
|
|
68
|
+
*/
|
|
69
|
+
trigger?: 'click' | 'hover' | 'never';
|
|
70
|
+
/**
|
|
71
|
+
* The number of delay time to open.
|
|
72
|
+
*
|
|
73
|
+
* @default 200
|
|
74
|
+
*/
|
|
75
|
+
openDelay?: number;
|
|
76
|
+
/**
|
|
77
|
+
* The number of delay time to close.
|
|
78
|
+
*
|
|
79
|
+
* @default 200
|
|
80
|
+
*/
|
|
81
|
+
closeDelay?: number;
|
|
82
|
+
/**
|
|
83
|
+
* If `true`, the PopoverContent rendering will be deferred until the popover is open.
|
|
84
|
+
*
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
isLazy?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The lazy behavior of popover's content when not visible. Only works when `isLazy={true}`
|
|
90
|
+
*
|
|
91
|
+
* - `unmount`: The popover's content is always unmounted when not open.
|
|
92
|
+
* - `keepMounted`: The popover's content initially unmounted, but stays mounted when popover is open.
|
|
93
|
+
*
|
|
94
|
+
* @default 'unmount'
|
|
95
|
+
*/
|
|
96
|
+
lazyBehavior?: LazyMode;
|
|
97
|
+
/**
|
|
98
|
+
* The animation of the popover.
|
|
99
|
+
*
|
|
100
|
+
* @default 'scale'
|
|
101
|
+
*/
|
|
102
|
+
animation?: 'scale' | 'top' | 'right' | 'left' | 'bottom' | 'none';
|
|
103
|
+
/**
|
|
104
|
+
* The animation duration.
|
|
105
|
+
*/
|
|
106
|
+
duration?: MotionTransitionProperties['duration'];
|
|
107
|
+
};
|
|
108
|
+
type PopoverProps = ThemeProps<'Popover'> & Omit<UsePopperProps, 'enabled'> & PropsWithChildren<PopoverOptions>;
|
|
109
|
+
type PopoverContext = Pick<PopoverOptions, 'isOpen' | 'onClose' | 'closeOnButton' | 'animation' | 'duration'> & {
|
|
110
|
+
onAnimationComplete: () => void;
|
|
111
|
+
forceUpdate: () => void | undefined;
|
|
112
|
+
getTriggerProps: PropGetter;
|
|
113
|
+
getAnchorProps: PropGetter;
|
|
114
|
+
getPopperProps: PropGetter;
|
|
115
|
+
getPopoverProps: PropGetter;
|
|
116
|
+
styles: Record<string, CSSUIObject>;
|
|
117
|
+
};
|
|
118
|
+
declare const usePopover: () => PopoverContext;
|
|
119
|
+
|
|
120
|
+
declare const Popover: FC<PopoverProps>;
|
|
121
|
+
|
|
122
|
+
export { Popover, PopoverProps, usePopover };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/popover",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "Yamada UI popover component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
"url": "https://github.com/hirotomoyamada/yamada-ui/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yamada-ui/core": "0.
|
|
39
|
-
"@yamada-ui/utils": "0.1.
|
|
40
|
-
"@yamada-ui/close-button": "0.2.
|
|
41
|
-
"@yamada-ui/transitions": "0.2.
|
|
42
|
-
"@yamada-ui/motion": "0.3.
|
|
43
|
-
"@yamada-ui/use-popper": "0.2.
|
|
44
|
-
"@yamada-ui/use-disclosure": "0.2.
|
|
45
|
-
"@yamada-ui/use-focus": "0.1.
|
|
46
|
-
"@yamada-ui/use-animation": "0.1.
|
|
38
|
+
"@yamada-ui/core": "0.5.1",
|
|
39
|
+
"@yamada-ui/utils": "0.1.3",
|
|
40
|
+
"@yamada-ui/close-button": "0.2.6",
|
|
41
|
+
"@yamada-ui/transitions": "0.2.7",
|
|
42
|
+
"@yamada-ui/motion": "0.3.4",
|
|
43
|
+
"@yamada-ui/use-popper": "0.2.6",
|
|
44
|
+
"@yamada-ui/use-disclosure": "0.2.4",
|
|
45
|
+
"@yamada-ui/use-focus": "0.1.3",
|
|
46
|
+
"@yamada-ui/use-animation": "0.1.18"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"react": "^18.0.0",
|