@kadoui/react 1.6.1 → 1.6.2
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/Modal/ModalBody.d.ts +1 -1
- package/dist/components/Modal/ModalBody.d.ts.map +1 -1
- package/dist/components/Modal/ModalBody.js +2 -6
- package/dist/components/Modal/ModalContent.d.ts +1 -1
- package/dist/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/components/Modal/ModalContent.js +5 -2
- package/dist/components/Modal/ModalHeader.d.ts +1 -1
- package/dist/components/Modal/ModalHeader.d.ts.map +1 -1
- package/dist/components/Modal/ModalHeader.js +5 -2
- package/package.json +3 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HTMLMotionProps } from "framer-motion";
|
|
2
2
|
export type ModalBodyPropsT = HTMLMotionProps<"div">;
|
|
3
|
-
export declare function ModalBody(
|
|
3
|
+
export declare function ModalBody(p: ModalBodyPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ModalBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalBody.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalBody.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,eAAe,EAAU,MAAM,eAAe,CAAC;AAIzE,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAErD,wBAAgB,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"ModalBody.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalBody.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,eAAe,EAAU,MAAM,eAAe,CAAC;AAIzE,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAErD,wBAAgB,SAAS,CAAC,CAAC,EAAE,eAAe,2CA4B3C"}
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { use, useEffect, useRef } from "react";
|
|
4
4
|
import { AnimatePresence, motion } from "framer-motion";
|
|
5
5
|
import { ModalContext } from "./ModalContext";
|
|
6
|
-
export function ModalBody(
|
|
6
|
+
export function ModalBody(p) {
|
|
7
7
|
const { isOpen } = use(ModalContext);
|
|
8
8
|
const contentRef = useRef(null);
|
|
9
9
|
useEffect(() => {
|
|
@@ -11,10 +11,6 @@ export function ModalBody({ onClick, ...props }) {
|
|
|
11
11
|
const indexElement = contentRef.current?.querySelector("[data-modal='index']");
|
|
12
12
|
indexElement?.focus();
|
|
13
13
|
}
|
|
14
|
-
;
|
|
15
14
|
}, [isOpen]);
|
|
16
|
-
return (_jsx(AnimatePresence, { children: isOpen ? (_jsx(motion.div, { ref: contentRef, initial: { opacity: 0, scale: 0.9 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.9 }, transition: { ease: "easeInOut" },
|
|
17
|
-
onClick?.(ev);
|
|
18
|
-
ev.stopPropagation();
|
|
19
|
-
}, ...props })) : null }));
|
|
15
|
+
return (_jsx(AnimatePresence, { children: isOpen ? (_jsx(motion.div, { ref: contentRef, initial: { opacity: 0, scale: 0.9 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.9 }, transition: { ease: "easeInOut" }, ...p })) : null }));
|
|
20
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { HTMLAttributes } from "react";
|
|
2
2
|
export type ModalContentPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function ModalContent(p: ModalContentPropsT): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function ModalContent({ onClick, ...p }: ModalContentPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ModalContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalContent.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEhE,wBAAgB,YAAY,CAAC,CAAC,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ModalContent.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEhE,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,kBAAkB,2CAUjE"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export function ModalContent(p) {
|
|
3
|
-
return (_jsx("div", {
|
|
2
|
+
export function ModalContent({ onClick, ...p }) {
|
|
3
|
+
return (_jsx("div", { onClick: (ev) => {
|
|
4
|
+
onClick?.(ev);
|
|
5
|
+
ev.stopPropagation();
|
|
6
|
+
}, ...p }));
|
|
4
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { HTMLAttributes } from "react";
|
|
2
2
|
export type ModalHeaderPropsT = HTMLAttributes<HTMLDivElement>;
|
|
3
|
-
export declare function ModalHeader(p: ModalHeaderPropsT): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function ModalHeader({ onClick, ...p }: ModalHeaderPropsT): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ModalHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE/D,wBAAgB,WAAW,CAAC,CAAC,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ModalHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAE/D,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,iBAAiB,2CAU/D"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export function ModalHeader(p) {
|
|
3
|
-
return (_jsx("div", {
|
|
2
|
+
export function ModalHeader({ onClick, ...p }) {
|
|
3
|
+
return (_jsx("div", { onClick: (ev) => {
|
|
4
|
+
onClick?.(ev);
|
|
5
|
+
ev.stopPropagation();
|
|
6
|
+
}, ...p }));
|
|
4
7
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kadoui/react",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "Kadoui primitive components for React",
|
|
5
5
|
"author": "ArrowUp",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "tsc"
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"push": "npm run build && npm publish"
|
|
10
11
|
},
|
|
11
12
|
"exports": {
|
|
12
13
|
".": "./dist/index.js",
|