@yamada-ui/modal 0.1.11 → 0.2.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/{chunk-IFQ6QPEJ.mjs → chunk-MCXUVWUW.mjs} +188 -186
- package/dist/dialog.d.ts +24 -0
- package/dist/dialog.js +213 -211
- package/dist/dialog.mjs +1 -1
- package/dist/drawer.d.ts +8 -0
- package/dist/drawer.js +250 -248
- package/dist/drawer.mjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +253 -255
- package/dist/index.mjs +3 -7
- package/dist/modal-body.js +279 -275
- package/dist/modal-body.mjs +1 -1
- package/dist/modal-close-button.js +277 -273
- package/dist/modal-close-button.mjs +1 -1
- package/dist/modal-footer.js +279 -275
- package/dist/modal-footer.mjs +1 -1
- package/dist/modal-header.js +279 -275
- package/dist/modal-header.mjs +1 -1
- package/dist/modal-overlay.js +271 -267
- package/dist/modal-overlay.mjs +1 -1
- package/dist/modal.d.ts +72 -6
- package/dist/modal.js +5 -3
- package/dist/modal.mjs +1 -1
- package/package.json +9 -9
package/dist/modal-overlay.mjs
CHANGED
package/dist/modal.d.ts
CHANGED
|
@@ -3,30 +3,96 @@ import { HTMLUIProps, ThemeProps, CSSUIObject, Token, CSSUIProps } from '@yamada
|
|
|
3
3
|
import { FocusLockProps } from '@yamada-ui/focus-lock';
|
|
4
4
|
import { HTMLMotionProps, MotionTransitionProperties } from '@yamada-ui/motion';
|
|
5
5
|
|
|
6
|
-
type Placement = 'center' | 'top' | 'right' | 'bottom' | 'left' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
7
|
-
type ScrollBehavior = 'inside' | 'outside';
|
|
8
|
-
type Animation = 'scale' | 'top' | 'right' | 'left' | 'bottom' | 'none';
|
|
9
6
|
type ModalContext = ModalOptions & {
|
|
10
7
|
styles: Record<string, CSSUIObject>;
|
|
11
8
|
};
|
|
12
9
|
declare const useModal: () => ModalContext;
|
|
13
10
|
|
|
14
11
|
type ModalOptions = Pick<FocusLockProps, 'autoFocus' | 'initialFocusRef' | 'finalFocusRef' | 'restoreFocus' | 'lockFocusAcrossFrames'> & {
|
|
12
|
+
/**
|
|
13
|
+
* If `true`, the open will be opened.
|
|
14
|
+
*/
|
|
15
15
|
isOpen: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Callback invoked to close the modal.
|
|
18
|
+
*/
|
|
16
19
|
onClose?: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* Callback fired when the overlay is clicked.
|
|
22
|
+
*/
|
|
17
23
|
onOverlayClick?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Callback fired when the escape key is pressed and focus is within modal.
|
|
26
|
+
*/
|
|
18
27
|
onEsc?(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Callback function to run side effects after the modal has closed.
|
|
30
|
+
*/
|
|
19
31
|
onCloseComplete?: () => void;
|
|
20
|
-
|
|
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
|
+
*/
|
|
21
41
|
outside?: CSSUIProps['p'];
|
|
42
|
+
/**
|
|
43
|
+
* If `true`, display the modal close button.
|
|
44
|
+
*
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
22
47
|
withCloseButton?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* If `true`, display the modal overlay.
|
|
50
|
+
*
|
|
51
|
+
* @default true
|
|
52
|
+
*/
|
|
23
53
|
withOverlay?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Handle zoom or pinch gestures on iOS devices when scroll locking is enabled.
|
|
56
|
+
*
|
|
57
|
+
* @default false.
|
|
58
|
+
*/
|
|
24
59
|
allowPinchZoom?: boolean;
|
|
25
|
-
|
|
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
|
+
*/
|
|
26
74
|
blockScrollOnMount?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* If `true`, the modal will close when the overlay is clicked.
|
|
77
|
+
*
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
27
80
|
closeOnOverlay?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* If `true`, the modal will close when the `Esc` key is pressed.
|
|
83
|
+
*
|
|
84
|
+
* @default true
|
|
85
|
+
*/
|
|
28
86
|
closeOnEsc?: boolean;
|
|
29
|
-
|
|
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
|
+
*/
|
|
30
96
|
duration?: MotionTransitionProperties['duration'];
|
|
31
97
|
};
|
|
32
98
|
type ModalProps = Omit<HTMLUIProps<'section'>, 'scrollBehavior' | 'animation'> & Omit<HTMLMotionProps<'section'>, 'color' | 'transition'> & ThemeProps<'Modal'> & ModalOptions;
|
package/dist/modal.js
CHANGED
|
@@ -34,6 +34,11 @@ var import_utils8 = require("@yamada-ui/utils");
|
|
|
34
34
|
var import_react = require("react");
|
|
35
35
|
var import_react_remove_scroll = require("react-remove-scroll");
|
|
36
36
|
|
|
37
|
+
// src/drawer.tsx
|
|
38
|
+
var import_core7 = require("@yamada-ui/core");
|
|
39
|
+
var import_transitions2 = require("@yamada-ui/transitions");
|
|
40
|
+
var import_utils7 = require("@yamada-ui/utils");
|
|
41
|
+
|
|
37
42
|
// src/modal-overlay.tsx
|
|
38
43
|
var import_core = require("@yamada-ui/core");
|
|
39
44
|
var import_motion = require("@yamada-ui/motion");
|
|
@@ -274,9 +279,6 @@ var DialogFooter = (0, import_core6.forwardRef)(
|
|
|
274
279
|
);
|
|
275
280
|
|
|
276
281
|
// src/drawer.tsx
|
|
277
|
-
var import_core7 = require("@yamada-ui/core");
|
|
278
|
-
var import_transitions2 = require("@yamada-ui/transitions");
|
|
279
|
-
var import_utils7 = require("@yamada-ui/utils");
|
|
280
282
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
281
283
|
var [DrawerProvider, useDrawer] = (0, import_utils7.createContext)({
|
|
282
284
|
name: `DrawerContext`,
|
package/dist/modal.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/modal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
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.
|
|
39
|
+
"@yamada-ui/core": "0.3.1",
|
|
40
40
|
"@yamada-ui/utils": "0.1.1",
|
|
41
|
-
"@yamada-ui/motion": "0.
|
|
42
|
-
"@yamada-ui/portal": "0.
|
|
43
|
-
"@yamada-ui/button": "0.
|
|
44
|
-
"@yamada-ui/focus-lock": "0.
|
|
45
|
-
"@yamada-ui/close-button": "0.
|
|
46
|
-
"@yamada-ui/transitions": "0.
|
|
47
|
-
"@yamada-ui/use-value": "0.1.
|
|
41
|
+
"@yamada-ui/motion": "0.2.0",
|
|
42
|
+
"@yamada-ui/portal": "0.2.0",
|
|
43
|
+
"@yamada-ui/button": "0.2.0",
|
|
44
|
+
"@yamada-ui/focus-lock": "0.2.0",
|
|
45
|
+
"@yamada-ui/close-button": "0.2.0",
|
|
46
|
+
"@yamada-ui/transitions": "0.2.0",
|
|
47
|
+
"@yamada-ui/use-value": "0.1.12"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"react": "^18.0.0",
|