@cerberus-design/react 0.12.0-next-ceedd7e → 0.12.0-next-b214a9b
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/build/legacy/_tsup-dts-rollup.d.cts +2 -0
- package/build/legacy/context/confirm-modal.cjs.map +1 -1
- package/build/legacy/context/cta-modal.cjs.map +1 -1
- package/build/legacy/context/prompt-modal.cjs.map +1 -1
- package/build/legacy/hooks/useModal.cjs.map +1 -1
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +2 -0
- package/build/modern/{chunk-CSEHDNMJ.js → chunk-CEC4EXVR.js} +2 -2
- package/build/modern/{chunk-VP5ERLAY.js → chunk-EZ56D7WO.js} +2 -2
- package/build/modern/{chunk-7T3JIGM7.js → chunk-KGQG5JGW.js} +1 -1
- package/build/modern/chunk-KGQG5JGW.js.map +1 -0
- package/build/modern/{chunk-T6LS5P5W.js → chunk-NJIX4CY2.js} +2 -2
- package/build/modern/context/confirm-modal.js +2 -2
- package/build/modern/context/cta-modal.js +2 -2
- package/build/modern/context/prompt-modal.js +2 -2
- package/build/modern/hooks/useModal.js +1 -1
- package/build/modern/index.js +4 -4
- package/package.json +2 -2
- package/src/hooks/useModal.ts +1 -1
- package/build/modern/chunk-7T3JIGM7.js.map +0 -1
- /package/build/modern/{chunk-CSEHDNMJ.js.map → chunk-CEC4EXVR.js.map} +0 -0
- /package/build/modern/{chunk-VP5ERLAY.js.map → chunk-EZ56D7WO.js.map} +0 -0
- /package/build/modern/{chunk-T6LS5P5W.js.map → chunk-NJIX4CY2.js.map} +0 -0
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
} from "./chunk-VERRHMW4.js";
|
|
31
31
|
import {
|
|
32
32
|
useModal
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-KGQG5JGW.js";
|
|
34
34
|
|
|
35
35
|
// src/context/confirm-modal.tsx
|
|
36
36
|
import {
|
|
@@ -176,4 +176,4 @@ export {
|
|
|
176
176
|
ConfirmModal,
|
|
177
177
|
useConfirmModal
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=chunk-
|
|
179
|
+
//# sourceMappingURL=chunk-CEC4EXVR.js.map
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
} from "./chunk-VERRHMW4.js";
|
|
40
40
|
import {
|
|
41
41
|
useModal
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-KGQG5JGW.js";
|
|
43
43
|
|
|
44
44
|
// src/context/prompt-modal.tsx
|
|
45
45
|
import {
|
|
@@ -240,4 +240,4 @@ export {
|
|
|
240
240
|
PromptModal,
|
|
241
241
|
usePromptModal
|
|
242
242
|
};
|
|
243
|
-
//# sourceMappingURL=chunk-
|
|
243
|
+
//# sourceMappingURL=chunk-EZ56D7WO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useModal.ts"],"sourcesContent":["'use client'\n\nimport { useCallback, useMemo, useRef, useState, type RefObject } from 'react'\n\n/**\n * This module provides a hook for using a custom modal.\n * @module\n */\n\nexport interface UseModalReturnValue {\n /**\n * The ref for the modal.\n */\n modalRef: RefObject<HTMLDialogElement>\n /**\n * Shows the modal.\n */\n show: () => void\n /**\n * Closes the modal.\n */\n close: () => void\n /**\n * Whether the modal is open based on the show and close methods.\n */\n isOpen: boolean\n}\n\n/**\n * Provides a hook for using a custom modal via the native dialog element\n * methods.\n *\n * Cerberus modals use the native dialog element. This hook\n * does not control the modal via React state but rather by calling the\n * native dialog element's `showModal` and `close` methods.\n *\n * @memberof module:Modal\n * @see https://cerberus.digitalu.design/react/modal\n * @description [Moz Dev Dialog Docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)\n */\nexport function useModal(): UseModalReturnValue {\n const modalRef = useRef<HTMLDialogElement | null>(null)\n const [isOpen, setIsOpen] = useState<boolean>(false)\n\n const show = useCallback(() => {\n modalRef.current?.showModal()\n setIsOpen(true)\n }, [])\n\n const close = useCallback(() => {\n modalRef.current?.close()\n setIsOpen(false)\n }, [])\n\n return useMemo(() => {\n return {\n modalRef,\n show,\n close,\n isOpen,\n }\n }, [modalRef, show, close, isOpen])\n}\n"],"mappings":";AAEA,SAAS,aAAa,SAAS,QAAQ,gBAAgC;AAsChE,SAAS,WAAgC;AAC9C,QAAM,WAAW,OAAiC,IAAI;AACtD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAkB,KAAK;AAEnD,QAAM,OAAO,YAAY,MAAM;AAC7B,aAAS,SAAS,UAAU;AAC5B,cAAU,IAAI;AAAA,EAChB,GAAG,CAAC,CAAC;AAEL,QAAM,QAAQ,YAAY,MAAM;AAC9B,aAAS,SAAS,MAAM;AACxB,cAAU,KAAK;AAAA,EACjB,GAAG,CAAC,CAAC;AAEL,SAAO,QAAQ,MAAM;AACnB,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,UAAU,MAAM,OAAO,MAAM,CAAC;AACpC;","names":[]}
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
} from "./chunk-VERRHMW4.js";
|
|
34
34
|
import {
|
|
35
35
|
useModal
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-KGQG5JGW.js";
|
|
37
37
|
|
|
38
38
|
// src/context/cta-modal.tsx
|
|
39
39
|
import {
|
|
@@ -152,4 +152,4 @@ export {
|
|
|
152
152
|
CTAModal,
|
|
153
153
|
useCTAModal
|
|
154
154
|
};
|
|
155
|
-
//# sourceMappingURL=chunk-
|
|
155
|
+
//# sourceMappingURL=chunk-NJIX4CY2.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ConfirmModal,
|
|
4
4
|
useConfirmModal
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-CEC4EXVR.js";
|
|
6
6
|
import "../chunk-2UXE5PDG.js";
|
|
7
7
|
import "../chunk-GLY7GU5S.js";
|
|
8
8
|
import "../chunk-BE4EOU2P.js";
|
|
@@ -16,7 +16,7 @@ import "../chunk-VERRHMW4.js";
|
|
|
16
16
|
import "../chunk-F27AAKQ3.js";
|
|
17
17
|
import "../chunk-CP7OUC2Q.js";
|
|
18
18
|
import "../chunk-HVKM54BA.js";
|
|
19
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-KGQG5JGW.js";
|
|
20
20
|
export {
|
|
21
21
|
ConfirmModal,
|
|
22
22
|
useConfirmModal
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CTAModal,
|
|
4
4
|
useCTAModal
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-NJIX4CY2.js";
|
|
6
6
|
import "../chunk-2UXE5PDG.js";
|
|
7
7
|
import "../chunk-GLY7GU5S.js";
|
|
8
8
|
import "../chunk-BE4EOU2P.js";
|
|
@@ -17,7 +17,7 @@ import "../chunk-VERRHMW4.js";
|
|
|
17
17
|
import "../chunk-F27AAKQ3.js";
|
|
18
18
|
import "../chunk-CP7OUC2Q.js";
|
|
19
19
|
import "../chunk-HVKM54BA.js";
|
|
20
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-KGQG5JGW.js";
|
|
21
21
|
export {
|
|
22
22
|
CTAModal,
|
|
23
23
|
useCTAModal
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PromptModal,
|
|
4
4
|
usePromptModal
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-EZ56D7WO.js";
|
|
6
6
|
import "../chunk-2UXE5PDG.js";
|
|
7
7
|
import "../chunk-GLY7GU5S.js";
|
|
8
8
|
import "../chunk-NKM6PISB.js";
|
|
@@ -19,7 +19,7 @@ import "../chunk-VERRHMW4.js";
|
|
|
19
19
|
import "../chunk-F27AAKQ3.js";
|
|
20
20
|
import "../chunk-CP7OUC2Q.js";
|
|
21
21
|
import "../chunk-HVKM54BA.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-KGQG5JGW.js";
|
|
23
23
|
export {
|
|
24
24
|
PromptModal,
|
|
25
25
|
usePromptModal
|
package/build/modern/index.js
CHANGED
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
ConfirmModal,
|
|
7
7
|
useConfirmModal
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CEC4EXVR.js";
|
|
9
9
|
import {
|
|
10
10
|
CTAModal,
|
|
11
11
|
useCTAModal
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NJIX4CY2.js";
|
|
13
13
|
import {
|
|
14
14
|
NotificationCenter,
|
|
15
15
|
useNotificationCenter
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
PromptModal,
|
|
19
19
|
usePromptModal
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EZ56D7WO.js";
|
|
21
21
|
import {
|
|
22
22
|
Table,
|
|
23
23
|
Tr
|
|
@@ -209,7 +209,7 @@ import "./chunk-CP7OUC2Q.js";
|
|
|
209
209
|
import "./chunk-HVKM54BA.js";
|
|
210
210
|
import {
|
|
211
211
|
useModal
|
|
212
|
-
} from "./chunk-
|
|
212
|
+
} from "./chunk-KGQG5JGW.js";
|
|
213
213
|
|
|
214
214
|
// src/index.ts
|
|
215
215
|
export * from "@dnd-kit/core";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cerberus-design/react",
|
|
3
|
-
"version": "0.12.0-next-
|
|
3
|
+
"version": "0.12.0-next-b214a9b",
|
|
4
4
|
"description": "The Cerberus Design React component library.",
|
|
5
5
|
"browserslist": "> 0.25%, not dead",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"react-dom": "^18",
|
|
28
28
|
"tsup": "^8.1.0",
|
|
29
29
|
"@cerberus-design/configs": "0.0.0",
|
|
30
|
-
"@cerberus-design/styled-system": "0.12.0-next-
|
|
30
|
+
"@cerberus-design/styled-system": "0.12.0-next-b214a9b"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
package/src/hooks/useModal.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/useModal.ts"],"sourcesContent":["'use client'\n\nimport { useCallback, useMemo, useRef, useState, type RefObject } from 'react'\n\n/**\n * This module provides a hook for using a custom modal.\n * @module\n */\n\ninterface UseModalReturnValue {\n /**\n * The ref for the modal.\n */\n modalRef: RefObject<HTMLDialogElement>\n /**\n * Shows the modal.\n */\n show: () => void\n /**\n * Closes the modal.\n */\n close: () => void\n /**\n * Whether the modal is open based on the show and close methods.\n */\n isOpen: boolean\n}\n\n/**\n * Provides a hook for using a custom modal via the native dialog element\n * methods.\n *\n * Cerberus modals use the native dialog element. This hook\n * does not control the modal via React state but rather by calling the\n * native dialog element's `showModal` and `close` methods.\n *\n * @memberof module:Modal\n * @see https://cerberus.digitalu.design/react/modal\n * @description [Moz Dev Dialog Docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)\n */\nexport function useModal(): UseModalReturnValue {\n const modalRef = useRef<HTMLDialogElement | null>(null)\n const [isOpen, setIsOpen] = useState<boolean>(false)\n\n const show = useCallback(() => {\n modalRef.current?.showModal()\n setIsOpen(true)\n }, [])\n\n const close = useCallback(() => {\n modalRef.current?.close()\n setIsOpen(false)\n }, [])\n\n return useMemo(() => {\n return {\n modalRef,\n show,\n close,\n isOpen,\n }\n }, [modalRef, show, close, isOpen])\n}\n"],"mappings":";AAEA,SAAS,aAAa,SAAS,QAAQ,gBAAgC;AAsChE,SAAS,WAAgC;AAC9C,QAAM,WAAW,OAAiC,IAAI;AACtD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAkB,KAAK;AAEnD,QAAM,OAAO,YAAY,MAAM;AAC7B,aAAS,SAAS,UAAU;AAC5B,cAAU,IAAI;AAAA,EAChB,GAAG,CAAC,CAAC;AAEL,QAAM,QAAQ,YAAY,MAAM;AAC9B,aAAS,SAAS,MAAM;AACxB,cAAU,KAAK;AAAA,EACjB,GAAG,CAAC,CAAC;AAEL,SAAO,QAAQ,MAAM;AACnB,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,UAAU,MAAM,OAAO,MAAM,CAAC;AACpC;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|