@yamada-ui/modal 0.2.5 → 0.2.7
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/{chunk-MCXUVWUW.mjs → chunk-OUW3Q5QN.mjs} +1 -1
- package/dist/dialog.d.mts +61 -0
- package/dist/dialog.js +1 -1
- package/dist/dialog.mjs +1 -1
- package/dist/drawer.d.mts +41 -0
- package/dist/drawer.js +1 -1
- package/dist/drawer.mjs +1 -1
- package/dist/index.d.mts +15 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/modal-body.d.mts +7 -0
- package/dist/modal-body.js +1 -1
- package/dist/modal-body.mjs +1 -1
- package/dist/modal-close-button.d.mts +7 -0
- package/dist/modal-close-button.js +1 -1
- package/dist/modal-close-button.mjs +1 -1
- package/dist/modal-footer.d.mts +7 -0
- package/dist/modal-footer.js +1 -1
- package/dist/modal-footer.mjs +1 -1
- package/dist/modal-header.d.mts +7 -0
- package/dist/modal-header.js +1 -1
- package/dist/modal-header.mjs +1 -1
- package/dist/modal-overlay.d.mts +8 -0
- package/dist/modal-overlay.js +1 -1
- package/dist/modal-overlay.mjs +1 -1
- package/dist/modal.d.mts +101 -0
- package/dist/modal.js +1 -1
- package/dist/modal.mjs +1 -1
- package/package.json +10 -10
|
@@ -211,6 +211,7 @@ var Dialog = forwardRef6(({ size, ...props }, ref) => {
|
|
|
211
211
|
Modal,
|
|
212
212
|
{
|
|
213
213
|
ref,
|
|
214
|
+
className: cx6("ui-dialog", className),
|
|
214
215
|
__css: css,
|
|
215
216
|
...{ size, onClose, withOverlay: false, withCloseButton: false, ...rest },
|
|
216
217
|
children: [
|
|
@@ -460,7 +461,6 @@ var [DrawerProvider, useDrawer] = createContext3({
|
|
|
460
461
|
var Drawer = forwardRef8(({ size, ...props }, ref) => {
|
|
461
462
|
const [styles, mergedProps] = useMultiComponentStyle3("Drawer", { size, ...props });
|
|
462
463
|
const {
|
|
463
|
-
className,
|
|
464
464
|
children,
|
|
465
465
|
isOpen,
|
|
466
466
|
placement = "right",
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
+
import { ThemeProps } from '@yamada-ui/core';
|
|
3
|
+
import { ButtonProps } from '@yamada-ui/button';
|
|
4
|
+
import { CloseButtonProps } from '@yamada-ui/close-button';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { ModalProps } from './modal.mjs';
|
|
7
|
+
import { ModalOverlayProps } from './modal-overlay.mjs';
|
|
8
|
+
import { ModalHeaderProps } from './modal-header.mjs';
|
|
9
|
+
import { ModalBodyProps } from './modal-body.mjs';
|
|
10
|
+
import { ModalFooterProps } from './modal-footer.mjs';
|
|
11
|
+
import '@yamada-ui/focus-lock';
|
|
12
|
+
import '@yamada-ui/motion';
|
|
13
|
+
|
|
14
|
+
type DialogOptions = {
|
|
15
|
+
/**
|
|
16
|
+
* The dialog header to use.
|
|
17
|
+
*/
|
|
18
|
+
header?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* The dialog footer to use.
|
|
21
|
+
*/
|
|
22
|
+
footer?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* The dialog cancel to use.
|
|
25
|
+
*/
|
|
26
|
+
cancel?: ReactNode | ButtonProps;
|
|
27
|
+
/**
|
|
28
|
+
* The dialog other to use.
|
|
29
|
+
*/
|
|
30
|
+
other?: ReactNode | ButtonProps;
|
|
31
|
+
/**
|
|
32
|
+
* The dialog success to use.
|
|
33
|
+
*/
|
|
34
|
+
success?: ReactNode | ButtonProps;
|
|
35
|
+
/**
|
|
36
|
+
* The callback invoked when cancel button clicked.
|
|
37
|
+
*/
|
|
38
|
+
onCancel?: (onClose: (() => void) | undefined) => void;
|
|
39
|
+
/**
|
|
40
|
+
* The callback invoked when other button clicked.
|
|
41
|
+
*/
|
|
42
|
+
onOther?: (onClose: (() => void) | undefined) => void;
|
|
43
|
+
/**
|
|
44
|
+
* The callback invoked when success button clicked.
|
|
45
|
+
*/
|
|
46
|
+
onSuccess?: (onClose: (() => void) | undefined) => void;
|
|
47
|
+
};
|
|
48
|
+
type DialogProps = Omit<ModalProps, keyof ThemeProps> & ThemeProps<'Dialog'> & DialogOptions;
|
|
49
|
+
declare const Dialog: _yamada_ui_core.Component<"section", DialogProps>;
|
|
50
|
+
type DialogOverlayProps = ModalOverlayProps;
|
|
51
|
+
declare const DialogOverlay: _yamada_ui_core.Component<"div", ModalOverlayProps>;
|
|
52
|
+
type DialogCloseButtonProps = CloseButtonProps;
|
|
53
|
+
declare const DialogCloseButton: _yamada_ui_core.Component<"button", CloseButtonProps>;
|
|
54
|
+
type DialogHeaderProps = ModalHeaderProps;
|
|
55
|
+
declare const DialogHeader: _yamada_ui_core.Component<"header", ModalHeaderProps>;
|
|
56
|
+
type DialogBodyProps = ModalBodyProps;
|
|
57
|
+
declare const DialogBody: _yamada_ui_core.Component<"main", ModalBodyProps>;
|
|
58
|
+
type DialogFooterProps = ModalFooterProps;
|
|
59
|
+
declare const DialogFooter: _yamada_ui_core.Component<"footer", ModalFooterProps>;
|
|
60
|
+
|
|
61
|
+
export { Dialog, DialogBody, DialogBodyProps, DialogCloseButton, DialogCloseButtonProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogProps };
|
package/dist/dialog.js
CHANGED
|
@@ -55,7 +55,6 @@ var [DrawerProvider, useDrawer] = (0, import_utils.createContext)({
|
|
|
55
55
|
var Drawer = (0, import_core.forwardRef)(({ size, ...props }, ref) => {
|
|
56
56
|
const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("Drawer", { size, ...props });
|
|
57
57
|
const {
|
|
58
|
-
className,
|
|
59
58
|
children,
|
|
60
59
|
isOpen,
|
|
61
60
|
placement = "right",
|
|
@@ -538,6 +537,7 @@ var Dialog = (0, import_core8.forwardRef)(({ size, ...props }, ref) => {
|
|
|
538
537
|
Modal,
|
|
539
538
|
{
|
|
540
539
|
ref,
|
|
540
|
+
className: (0, import_utils8.cx)("ui-dialog", className),
|
|
541
541
|
__css: css,
|
|
542
542
|
...{ size, onClose, withOverlay: false, withCloseButton: false, ...rest },
|
|
543
543
|
children: [
|
package/dist/dialog.mjs
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as _yamada_ui_close_button from '@yamada-ui/close-button';
|
|
2
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
3
|
+
import { ThemeProps } from '@yamada-ui/core';
|
|
4
|
+
import { SlideProps } from '@yamada-ui/transitions';
|
|
5
|
+
import { ModalProps } from './modal.mjs';
|
|
6
|
+
import { ModalOverlayProps } from './modal-overlay.mjs';
|
|
7
|
+
import { ModalCloseButtonProps } from './modal-close-button.mjs';
|
|
8
|
+
import { ModalHeaderProps } from './modal-header.mjs';
|
|
9
|
+
import { ModalBodyProps } from './modal-body.mjs';
|
|
10
|
+
import { ModalFooterProps } from './modal-footer.mjs';
|
|
11
|
+
import '@yamada-ui/focus-lock';
|
|
12
|
+
import '@yamada-ui/motion';
|
|
13
|
+
|
|
14
|
+
type DrawerOptions = {
|
|
15
|
+
/**
|
|
16
|
+
* The placement of the drawer.
|
|
17
|
+
*
|
|
18
|
+
* @default 'right'
|
|
19
|
+
*/
|
|
20
|
+
placement?: SlideProps['placement'];
|
|
21
|
+
/**
|
|
22
|
+
* If `true` and drawer's placement is `top` or `bottom`, the drawer will occupy the viewport height (100vh).
|
|
23
|
+
*/
|
|
24
|
+
isFullHeight?: boolean;
|
|
25
|
+
};
|
|
26
|
+
type DrawerProps = Omit<ModalProps, 'scrollBehavior' | 'animation' | 'outside' | keyof ThemeProps> & ThemeProps<'Drawer'> & DrawerOptions;
|
|
27
|
+
declare const Drawer: _yamada_ui_core.Component<"div", DrawerProps>;
|
|
28
|
+
type DrawerContentProps = Omit<DrawerProps, 'color' | 'transition' | 'isOpen' | keyof ThemeProps>;
|
|
29
|
+
declare const DrawerContent: _yamada_ui_core.Component<"div", DrawerContentProps>;
|
|
30
|
+
type DrawerOverlayProps = ModalOverlayProps;
|
|
31
|
+
declare const DrawerOverlay: _yamada_ui_core.Component<"div", ModalOverlayProps>;
|
|
32
|
+
type DrawerCloseButtonProps = ModalCloseButtonProps;
|
|
33
|
+
declare const DrawerCloseButton: _yamada_ui_core.Component<"button", _yamada_ui_close_button.CloseButtonProps>;
|
|
34
|
+
type DrawerHeaderProps = ModalHeaderProps;
|
|
35
|
+
declare const DrawerHeader: _yamada_ui_core.Component<"header", ModalHeaderProps>;
|
|
36
|
+
type DrawerBodyProps = ModalBodyProps;
|
|
37
|
+
declare const DrawerBody: _yamada_ui_core.Component<"main", ModalBodyProps>;
|
|
38
|
+
type DrawerFooterProps = ModalFooterProps;
|
|
39
|
+
declare const DrawerFooter: _yamada_ui_core.Component<"footer", ModalFooterProps>;
|
|
40
|
+
|
|
41
|
+
export { Drawer, DrawerBody, DrawerBodyProps, DrawerCloseButton, DrawerCloseButtonProps, DrawerContent, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerProps };
|
package/dist/drawer.js
CHANGED
|
@@ -217,6 +217,7 @@ var Dialog = (0, import_core6.forwardRef)(({ size, ...props }, ref) => {
|
|
|
217
217
|
Modal,
|
|
218
218
|
{
|
|
219
219
|
ref,
|
|
220
|
+
className: (0, import_utils6.cx)("ui-dialog", className),
|
|
220
221
|
__css: css,
|
|
221
222
|
...{ size, onClose, withOverlay: false, withCloseButton: false, ...rest },
|
|
222
223
|
children: [
|
|
@@ -466,7 +467,6 @@ var [DrawerProvider, useDrawer] = (0, import_utils8.createContext)({
|
|
|
466
467
|
var Drawer = (0, import_core8.forwardRef)(({ size, ...props }, ref) => {
|
|
467
468
|
const [styles, mergedProps] = (0, import_core8.useMultiComponentStyle)("Drawer", { size, ...props });
|
|
468
469
|
const {
|
|
469
|
-
className,
|
|
470
470
|
children,
|
|
471
471
|
isOpen,
|
|
472
472
|
placement = "right",
|
package/dist/drawer.mjs
CHANGED
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { Modal, ModalProps } from './modal.mjs';
|
|
2
|
+
export { ModalOverlay, ModalOverlayProps } from './modal-overlay.mjs';
|
|
3
|
+
export { ModalCloseButton, ModalCloseButtonProps } from './modal-close-button.mjs';
|
|
4
|
+
export { ModalHeader, ModalHeaderProps } from './modal-header.mjs';
|
|
5
|
+
export { ModalBody, ModalBodyProps } from './modal-body.mjs';
|
|
6
|
+
export { ModalFooter, ModalFooterProps } from './modal-footer.mjs';
|
|
7
|
+
export { Dialog, DialogBody, DialogBodyProps, DialogCloseButton, DialogCloseButtonProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogProps } from './dialog.mjs';
|
|
8
|
+
export { Drawer, DrawerBody, DrawerBodyProps, DrawerCloseButton, DrawerCloseButtonProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerProps } from './drawer.mjs';
|
|
9
|
+
import '@yamada-ui/core';
|
|
10
|
+
import '@yamada-ui/focus-lock';
|
|
11
|
+
import '@yamada-ui/motion';
|
|
12
|
+
import '@yamada-ui/close-button';
|
|
13
|
+
import '@yamada-ui/button';
|
|
14
|
+
import 'react';
|
|
15
|
+
import '@yamada-ui/transitions';
|
package/dist/index.js
CHANGED
|
@@ -64,7 +64,6 @@ var [DrawerProvider, useDrawer] = (0, import_utils.createContext)({
|
|
|
64
64
|
var Drawer = (0, import_core.forwardRef)(({ size, ...props }, ref) => {
|
|
65
65
|
const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("Drawer", { size, ...props });
|
|
66
66
|
const {
|
|
67
|
-
className,
|
|
68
67
|
children,
|
|
69
68
|
isOpen,
|
|
70
69
|
placement = "right",
|
|
@@ -550,6 +549,7 @@ var Dialog = (0, import_core8.forwardRef)(({ size, ...props }, ref) => {
|
|
|
550
549
|
Modal,
|
|
551
550
|
{
|
|
552
551
|
ref,
|
|
552
|
+
className: (0, import_utils8.cx)("ui-dialog", className),
|
|
553
553
|
__css: css,
|
|
554
554
|
...{ size, onClose, withOverlay: false, withCloseButton: false, ...rest },
|
|
555
555
|
children: [
|
package/dist/index.mjs
CHANGED
package/dist/modal-body.js
CHANGED
|
@@ -197,6 +197,7 @@ var Dialog = (0, import_core5.forwardRef)(({ size, ...props }, ref) => {
|
|
|
197
197
|
Modal,
|
|
198
198
|
{
|
|
199
199
|
ref,
|
|
200
|
+
className: (0, import_utils5.cx)("ui-dialog", className),
|
|
200
201
|
__css: css,
|
|
201
202
|
...{ size, onClose, withOverlay: false, withCloseButton: false, ...rest },
|
|
202
203
|
children: [
|
|
@@ -272,7 +273,6 @@ var [DrawerProvider, useDrawer] = (0, import_utils6.createContext)({
|
|
|
272
273
|
var Drawer = (0, import_core6.forwardRef)(({ size, ...props }, ref) => {
|
|
273
274
|
const [styles, mergedProps] = (0, import_core6.useMultiComponentStyle)("Drawer", { size, ...props });
|
|
274
275
|
const {
|
|
275
|
-
className,
|
|
276
276
|
children,
|
|
277
277
|
isOpen,
|
|
278
278
|
placement = "right",
|
package/dist/modal-body.mjs
CHANGED
|
@@ -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 ModalCloseButtonProps = CloseButtonProps;
|
|
5
|
+
declare const ModalCloseButton: _yamada_ui_core.Component<"button", CloseButtonProps>;
|
|
6
|
+
|
|
7
|
+
export { ModalCloseButton, ModalCloseButtonProps };
|
|
@@ -188,6 +188,7 @@ var Dialog = (0, import_core5.forwardRef)(({ size, ...props }, ref) => {
|
|
|
188
188
|
Modal,
|
|
189
189
|
{
|
|
190
190
|
ref,
|
|
191
|
+
className: (0, import_utils5.cx)("ui-dialog", className),
|
|
191
192
|
__css: css,
|
|
192
193
|
...{ size, onClose, withOverlay: false, withCloseButton: false, ...rest },
|
|
193
194
|
children: [
|
|
@@ -263,7 +264,6 @@ var [DrawerProvider, useDrawer] = (0, import_utils6.createContext)({
|
|
|
263
264
|
var Drawer = (0, import_core6.forwardRef)(({ size, ...props }, ref) => {
|
|
264
265
|
const [styles, mergedProps] = (0, import_core6.useMultiComponentStyle)("Drawer", { size, ...props });
|
|
265
266
|
const {
|
|
266
|
-
className,
|
|
267
267
|
children,
|
|
268
268
|
isOpen,
|
|
269
269
|
placement = "right",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
+
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
|
+
|
|
4
|
+
type ModalFooterProps = HTMLUIProps<'footer'>;
|
|
5
|
+
declare const ModalFooter: _yamada_ui_core.Component<"footer", ModalFooterProps>;
|
|
6
|
+
|
|
7
|
+
export { ModalFooter, ModalFooterProps };
|
package/dist/modal-footer.js
CHANGED
|
@@ -198,6 +198,7 @@ var Dialog = (0, import_core5.forwardRef)(({ size, ...props }, ref) => {
|
|
|
198
198
|
Modal,
|
|
199
199
|
{
|
|
200
200
|
ref,
|
|
201
|
+
className: (0, import_utils5.cx)("ui-dialog", className),
|
|
201
202
|
__css: css,
|
|
202
203
|
...{ size, onClose, withOverlay: false, withCloseButton: false, ...rest },
|
|
203
204
|
children: [
|
|
@@ -273,7 +274,6 @@ var [DrawerProvider, useDrawer] = (0, import_utils6.createContext)({
|
|
|
273
274
|
var Drawer = (0, import_core6.forwardRef)(({ size, ...props }, ref) => {
|
|
274
275
|
const [styles, mergedProps] = (0, import_core6.useMultiComponentStyle)("Drawer", { size, ...props });
|
|
275
276
|
const {
|
|
276
|
-
className,
|
|
277
277
|
children,
|
|
278
278
|
isOpen,
|
|
279
279
|
placement = "right",
|
package/dist/modal-footer.mjs
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
+
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
|
+
|
|
4
|
+
type ModalHeaderProps = HTMLUIProps<'header'>;
|
|
5
|
+
declare const ModalHeader: _yamada_ui_core.Component<"header", ModalHeaderProps>;
|
|
6
|
+
|
|
7
|
+
export { ModalHeader, ModalHeaderProps };
|
package/dist/modal-header.js
CHANGED
|
@@ -198,6 +198,7 @@ var Dialog = (0, import_core5.forwardRef)(({ size, ...props }, ref) => {
|
|
|
198
198
|
Modal,
|
|
199
199
|
{
|
|
200
200
|
ref,
|
|
201
|
+
className: (0, import_utils5.cx)("ui-dialog", className),
|
|
201
202
|
__css: css,
|
|
202
203
|
...{ size, onClose, withOverlay: false, withCloseButton: false, ...rest },
|
|
203
204
|
children: [
|
|
@@ -273,7 +274,6 @@ var [DrawerProvider, useDrawer] = (0, import_utils6.createContext)({
|
|
|
273
274
|
var Drawer = (0, import_core6.forwardRef)(({ size, ...props }, ref) => {
|
|
274
275
|
const [styles, mergedProps] = (0, import_core6.useMultiComponentStyle)("Drawer", { size, ...props });
|
|
275
276
|
const {
|
|
276
|
-
className,
|
|
277
277
|
children,
|
|
278
278
|
isOpen,
|
|
279
279
|
placement = "right",
|
package/dist/modal-header.mjs
CHANGED
|
@@ -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 ModalOverlayProps = HTMLUIProps<'div'> & Omit<HTMLMotionProps<'div'>, 'color' | 'transition'>;
|
|
6
|
+
declare const ModalOverlay: _yamada_ui_core.Component<"div", ModalOverlayProps>;
|
|
7
|
+
|
|
8
|
+
export { ModalOverlay, ModalOverlayProps };
|
package/dist/modal-overlay.js
CHANGED
|
@@ -179,6 +179,7 @@ var Dialog = (0, import_core5.forwardRef)(({ size, ...props }, ref) => {
|
|
|
179
179
|
Modal,
|
|
180
180
|
{
|
|
181
181
|
ref,
|
|
182
|
+
className: (0, import_utils5.cx)("ui-dialog", className),
|
|
182
183
|
__css: css,
|
|
183
184
|
...{ size, onClose, withOverlay: false, withCloseButton: false, ...rest },
|
|
184
185
|
children: [
|
|
@@ -254,7 +255,6 @@ var [DrawerProvider, useDrawer] = (0, import_utils6.createContext)({
|
|
|
254
255
|
var Drawer = (0, import_core6.forwardRef)(({ size, ...props }, ref) => {
|
|
255
256
|
const [styles, mergedProps] = (0, import_core6.useMultiComponentStyle)("Drawer", { size, ...props });
|
|
256
257
|
const {
|
|
257
|
-
className,
|
|
258
258
|
children,
|
|
259
259
|
isOpen,
|
|
260
260
|
placement = "right",
|
package/dist/modal-overlay.mjs
CHANGED
package/dist/modal.d.mts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
+
import { HTMLUIProps, ThemeProps, CSSUIObject, Token, CSSUIProps } from '@yamada-ui/core';
|
|
3
|
+
import { FocusLockProps } from '@yamada-ui/focus-lock';
|
|
4
|
+
import { HTMLMotionProps, MotionTransitionProperties } from '@yamada-ui/motion';
|
|
5
|
+
|
|
6
|
+
type ModalContext = ModalOptions & {
|
|
7
|
+
styles: Record<string, CSSUIObject>;
|
|
8
|
+
};
|
|
9
|
+
declare const useModal: () => ModalContext;
|
|
10
|
+
|
|
11
|
+
type ModalOptions = Pick<FocusLockProps, 'autoFocus' | 'initialFocusRef' | 'finalFocusRef' | 'restoreFocus' | 'lockFocusAcrossFrames'> & {
|
|
12
|
+
/**
|
|
13
|
+
* If `true`, the open will be opened.
|
|
14
|
+
*/
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Callback invoked to close the modal.
|
|
18
|
+
*/
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* Callback fired when the overlay is clicked.
|
|
22
|
+
*/
|
|
23
|
+
onOverlayClick?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Callback fired when the escape key is pressed and focus is within modal.
|
|
26
|
+
*/
|
|
27
|
+
onEsc?(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Callback function to run side effects after the modal has closed.
|
|
30
|
+
*/
|
|
31
|
+
onCloseComplete?: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* The placement of the modal.
|
|
34
|
+
*
|
|
35
|
+
* @default 'center'
|
|
36
|
+
*/
|
|
37
|
+
placement?: Token<'center' | 'top' | 'right' | 'bottom' | 'left' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'>;
|
|
38
|
+
/**
|
|
39
|
+
* The CSS `padding` property.
|
|
40
|
+
*/
|
|
41
|
+
outside?: CSSUIProps['p'];
|
|
42
|
+
/**
|
|
43
|
+
* If `true`, display the modal close button.
|
|
44
|
+
*
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
withCloseButton?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* If `true`, display the modal overlay.
|
|
50
|
+
*
|
|
51
|
+
* @default true
|
|
52
|
+
*/
|
|
53
|
+
withOverlay?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Handle zoom or pinch gestures on iOS devices when scroll locking is enabled.
|
|
56
|
+
*
|
|
57
|
+
* @default false.
|
|
58
|
+
*/
|
|
59
|
+
allowPinchZoom?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Where scroll behavior should originate.
|
|
62
|
+
*
|
|
63
|
+
* - `inside`: scroll only occurs within the `ModalBody`.
|
|
64
|
+
* - `outside`: the entire `ModalContent` will scroll within the viewport.
|
|
65
|
+
*
|
|
66
|
+
* @default 'inside'
|
|
67
|
+
*/
|
|
68
|
+
scrollBehavior?: 'inside' | 'outside';
|
|
69
|
+
/**
|
|
70
|
+
* If `true`, scrolling will be disabled on the `body` when the modal opens.
|
|
71
|
+
*
|
|
72
|
+
* @default true
|
|
73
|
+
*/
|
|
74
|
+
blockScrollOnMount?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* If `true`, the modal will close when the overlay is clicked.
|
|
77
|
+
*
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
80
|
+
closeOnOverlay?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* If `true`, the modal will close when the `Esc` key is pressed.
|
|
83
|
+
*
|
|
84
|
+
* @default true
|
|
85
|
+
*/
|
|
86
|
+
closeOnEsc?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* The animation of the tooltip.
|
|
89
|
+
*
|
|
90
|
+
* @default 'scale'
|
|
91
|
+
*/
|
|
92
|
+
animation?: 'scale' | 'top' | 'right' | 'left' | 'bottom' | 'none';
|
|
93
|
+
/**
|
|
94
|
+
* The animation duration.
|
|
95
|
+
*/
|
|
96
|
+
duration?: MotionTransitionProperties['duration'];
|
|
97
|
+
};
|
|
98
|
+
type ModalProps = Omit<HTMLUIProps<'section'>, 'scrollBehavior' | 'animation'> & Omit<HTMLMotionProps<'section'>, 'color' | 'transition'> & ThemeProps<'Modal'> & ModalOptions;
|
|
99
|
+
declare const Modal: _yamada_ui_core.Component<"section", ModalProps>;
|
|
100
|
+
|
|
101
|
+
export { Modal, ModalProps, useModal };
|
package/dist/modal.js
CHANGED
|
@@ -212,6 +212,7 @@ var Dialog = (0, import_core6.forwardRef)(({ size, ...props }, ref) => {
|
|
|
212
212
|
Modal,
|
|
213
213
|
{
|
|
214
214
|
ref,
|
|
215
|
+
className: (0, import_utils6.cx)("ui-dialog", className),
|
|
215
216
|
__css: css,
|
|
216
217
|
...{ size, onClose, withOverlay: false, withCloseButton: false, ...rest },
|
|
217
218
|
children: [
|
|
@@ -287,7 +288,6 @@ var [DrawerProvider, useDrawer] = (0, import_utils7.createContext)({
|
|
|
287
288
|
var Drawer = (0, import_core7.forwardRef)(({ size, ...props }, ref) => {
|
|
288
289
|
const [styles, mergedProps] = (0, import_core7.useMultiComponentStyle)("Drawer", { size, ...props });
|
|
289
290
|
const {
|
|
290
|
-
className,
|
|
291
291
|
children,
|
|
292
292
|
isOpen,
|
|
293
293
|
placement = "right",
|
package/dist/modal.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/modal",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Yamada UI modal component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"react-remove-scroll": "^2.5.4",
|
|
39
|
-
"@yamada-ui/core": "0.
|
|
40
|
-
"@yamada-ui/utils": "0.1.
|
|
41
|
-
"@yamada-ui/motion": "0.3.
|
|
42
|
-
"@yamada-ui/portal": "0.2.
|
|
43
|
-
"@yamada-ui/button": "0.2.
|
|
44
|
-
"@yamada-ui/focus-lock": "0.2.
|
|
45
|
-
"@yamada-ui/close-button": "0.2.
|
|
46
|
-
"@yamada-ui/transitions": "0.2.
|
|
47
|
-
"@yamada-ui/use-value": "0.1.
|
|
39
|
+
"@yamada-ui/core": "0.5.1",
|
|
40
|
+
"@yamada-ui/utils": "0.1.3",
|
|
41
|
+
"@yamada-ui/motion": "0.3.4",
|
|
42
|
+
"@yamada-ui/portal": "0.2.2",
|
|
43
|
+
"@yamada-ui/button": "0.2.6",
|
|
44
|
+
"@yamada-ui/focus-lock": "0.2.2",
|
|
45
|
+
"@yamada-ui/close-button": "0.2.6",
|
|
46
|
+
"@yamada-ui/transitions": "0.2.7",
|
|
47
|
+
"@yamada-ui/use-value": "0.1.18"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"react": "^18.0.0",
|