@cerberus-design/react 0.6.1-next-2d28489 → 0.6.1-next-fa4208e
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.ts +119 -9
- package/build/legacy/chunk-2F5TB2EV.js +25 -0
- package/build/legacy/chunk-2F5TB2EV.js.map +1 -0
- package/build/legacy/{chunk-7ISHDUYN.js → chunk-5GEC53G7.js} +4 -4
- package/build/legacy/{chunk-JJGZRBIR.js → chunk-CU7HXAKM.js} +4 -4
- package/build/legacy/chunk-D3ZXZA3U.js +155 -0
- package/build/legacy/chunk-D3ZXZA3U.js.map +1 -0
- package/build/legacy/{chunk-SNSBODYR.js → chunk-DGPLSWFJ.js} +55 -71
- package/build/legacy/chunk-DGPLSWFJ.js.map +1 -0
- package/build/legacy/chunk-G3JEWPLM.js +29 -0
- package/build/legacy/chunk-G3JEWPLM.js.map +1 -0
- package/build/legacy/chunk-OGSAAB6K.js +12 -0
- package/build/legacy/chunk-OGSAAB6K.js.map +1 -0
- package/build/legacy/chunk-TPFNVGYA.js +21 -0
- package/build/legacy/chunk-TPFNVGYA.js.map +1 -0
- package/build/legacy/chunk-TZNYJ3G7.js +25 -0
- package/build/legacy/chunk-TZNYJ3G7.js.map +1 -0
- package/build/legacy/chunk-UPODPCRD.js +12 -0
- package/build/legacy/chunk-UPODPCRD.js.map +1 -0
- package/build/legacy/components/Input.js +2 -2
- package/build/legacy/components/Label.js +2 -2
- package/build/legacy/components/Modal.js +7 -0
- package/build/legacy/components/Modal.js.map +1 -0
- package/build/legacy/components/ModalDescription.js +7 -0
- package/build/legacy/components/ModalDescription.js.map +1 -0
- package/build/legacy/components/ModalHeader.js +7 -0
- package/build/legacy/components/ModalHeader.js.map +1 -0
- package/build/legacy/components/ModalHeading.js +7 -0
- package/build/legacy/components/ModalHeading.js.map +1 -0
- package/build/legacy/components/ModalIcon.js +7 -0
- package/build/legacy/components/ModalIcon.js.map +1 -0
- package/build/legacy/context/confirm-modal.js +7 -3
- package/build/legacy/context/prompt-modal.js +10 -7
- package/build/legacy/hooks/useModal.js +8 -0
- package/build/legacy/hooks/useModal.js.map +1 -0
- package/build/legacy/index.js +59 -39
- package/build/modern/_tsup-dts-rollup.d.ts +119 -9
- package/build/modern/chunk-2F5TB2EV.js +25 -0
- package/build/modern/chunk-2F5TB2EV.js.map +1 -0
- package/build/modern/{chunk-7ISHDUYN.js → chunk-5GEC53G7.js} +4 -4
- package/build/modern/chunk-C5HLLGME.js +23 -0
- package/build/modern/chunk-C5HLLGME.js.map +1 -0
- package/build/modern/{chunk-JJGZRBIR.js → chunk-CU7HXAKM.js} +4 -4
- package/build/modern/chunk-G3JEWPLM.js +29 -0
- package/build/modern/chunk-G3JEWPLM.js.map +1 -0
- package/build/modern/chunk-OGSAAB6K.js +12 -0
- package/build/modern/chunk-OGSAAB6K.js.map +1 -0
- package/build/modern/chunk-TAVCJ54A.js +154 -0
- package/build/modern/chunk-TAVCJ54A.js.map +1 -0
- package/build/modern/chunk-TPFNVGYA.js +21 -0
- package/build/modern/chunk-TPFNVGYA.js.map +1 -0
- package/build/modern/chunk-UPODPCRD.js +12 -0
- package/build/modern/chunk-UPODPCRD.js.map +1 -0
- package/build/modern/{chunk-FZ75OJLJ.js → chunk-WWG5QWXY.js} +54 -69
- package/build/modern/chunk-WWG5QWXY.js.map +1 -0
- package/build/modern/components/Input.js +2 -2
- package/build/modern/components/Label.js +2 -2
- package/build/modern/components/Modal.js +7 -0
- package/build/modern/components/Modal.js.map +1 -0
- package/build/modern/components/ModalDescription.js +7 -0
- package/build/modern/components/ModalDescription.js.map +1 -0
- package/build/modern/components/ModalHeader.js +7 -0
- package/build/modern/components/ModalHeader.js.map +1 -0
- package/build/modern/components/ModalHeading.js +7 -0
- package/build/modern/components/ModalHeading.js.map +1 -0
- package/build/modern/components/ModalIcon.js +7 -0
- package/build/modern/components/ModalIcon.js.map +1 -0
- package/build/modern/context/confirm-modal.js +7 -3
- package/build/modern/context/prompt-modal.js +10 -7
- package/build/modern/hooks/useModal.js +8 -0
- package/build/modern/hooks/useModal.js.map +1 -0
- package/build/modern/index.js +59 -39
- package/package.json +2 -2
- package/src/components/Modal.tsx +37 -0
- package/src/components/ModalDescription.tsx +23 -0
- package/src/components/ModalHeader.tsx +37 -0
- package/src/components/ModalHeading.tsx +23 -0
- package/src/components/ModalIcon.tsx +28 -0
- package/src/context/confirm-modal.tsx +50 -70
- package/src/context/prompt-modal.tsx +41 -63
- package/src/hooks/useModal.ts +34 -0
- package/src/index.ts +6 -0
- package/build/legacy/chunk-BLJ4SRAF.js +0 -167
- package/build/legacy/chunk-BLJ4SRAF.js.map +0 -1
- package/build/legacy/chunk-SNSBODYR.js.map +0 -1
- package/build/modern/chunk-4GURONLE.js +0 -165
- package/build/modern/chunk-4GURONLE.js.map +0 -1
- package/build/modern/chunk-FZ75OJLJ.js.map +0 -1
- /package/build/legacy/{chunk-7ISHDUYN.js.map → chunk-5GEC53G7.js.map} +0 -0
- /package/build/legacy/{chunk-JJGZRBIR.js.map → chunk-CU7HXAKM.js.map} +0 -0
- /package/build/modern/{chunk-7ISHDUYN.js.map → chunk-5GEC53G7.js.map} +0 -0
- /package/build/modern/{chunk-JJGZRBIR.js.map → chunk-CU7HXAKM.js.map} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/components/ModalHeading.tsx
|
|
2
|
+
import { cx } from "@cerberus-design/styled-system/css";
|
|
3
|
+
import { modal } from "@cerberus-design/styled-system/recipes";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function ModalHeading(props) {
|
|
6
|
+
return /* @__PURE__ */ jsx("p", { ...props, className: cx(props.className, modal().heading) });
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
ModalHeading
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=chunk-OGSAAB6K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/ModalHeading.tsx"],"sourcesContent":["import { cx } from '@cerberus-design/styled-system/css'\nimport { modal } from '@cerberus-design/styled-system/recipes'\nimport type { HTMLAttributes } from 'react'\n\n/**\n * This module contains the ModalHeading component for a customizable modal.\n * @module\n */\n\nexport type ModalHeadingProps = HTMLAttributes<HTMLParagraphElement>\n\n/**\n * The ModalHeading component is a heading element for a customizable modal.\n * @example\n * ```tsx\n * <Modal>\n * <ModalHeading>Modal Heading</ModalHeading>\n * </Modal>\n * ```\n */\nexport function ModalHeading(props: ModalHeadingProps) {\n return <p {...props} className={cx(props.className, modal().heading)} />\n}\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,aAAa;AAoBb;AADF,SAAS,aAAa,OAA0B;AACrD,SAAO,oBAAC,OAAG,GAAG,OAAO,WAAW,GAAG,MAAM,WAAW,MAAM,EAAE,OAAO,GAAG;AACxE;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/components/Modal.tsx
|
|
2
|
+
import { cx } from "@cerberus-design/styled-system/css";
|
|
3
|
+
import { modal } from "@cerberus-design/styled-system/recipes";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function ModalEl(props, ref) {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"dialog",
|
|
9
|
+
{
|
|
10
|
+
...props,
|
|
11
|
+
className: cx(props.className, modal().dialog),
|
|
12
|
+
ref
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
var Modal = forwardRef(ModalEl);
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
Modal
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-TPFNVGYA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Modal.tsx"],"sourcesContent":["import { cx } from '@cerberus-design/styled-system/css'\nimport { modal } from '@cerberus-design/styled-system/recipes'\nimport { forwardRef, type ForwardedRef, type HTMLAttributes } from 'react'\n\n/**\n * This module contains the Modal root component for a customizable modal.\n * @module\n */\n\n// Modal\n\nexport type ModalProps = HTMLAttributes<HTMLDialogElement>\n\nfunction ModalEl(props: ModalProps, ref: ForwardedRef<HTMLDialogElement>) {\n return (\n <dialog\n {...props}\n className={cx(props.className, modal().dialog)}\n ref={ref}\n />\n )\n}\n\n/**\n * The Modal component is the root element for a customizable modal.\n * @example\n * ```tsx\n * const { modalRef } = useModal()\n *\n * <Modal ref={modalRef}>\n * <ModalIcon icon={$cerberusIcons.alert} />\n * <h2>Modal Heading</h2>\n * <p>Modal description</p>\n * </Modal>\n * ```\n */\nexport const Modal = forwardRef(ModalEl)\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,aAAa;AACtB,SAAS,kBAA0D;AAa/D;AAFJ,SAAS,QAAQ,OAAmB,KAAsC;AACxE,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,MAAM,WAAW,MAAM,EAAE,MAAM;AAAA,MAC7C;AAAA;AAAA,EACF;AAEJ;AAeO,IAAM,QAAQ,WAAW,OAAO;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/hooks/useModal.ts
|
|
2
|
+
import { useCallback, useMemo, useRef } from "react";
|
|
3
|
+
function useModal() {
|
|
4
|
+
const modalRef = useRef(null);
|
|
5
|
+
const show = useCallback(() => {
|
|
6
|
+
var _a;
|
|
7
|
+
(_a = modalRef.current) == null ? void 0 : _a.showModal();
|
|
8
|
+
}, []);
|
|
9
|
+
const close = useCallback(() => {
|
|
10
|
+
var _a;
|
|
11
|
+
(_a = modalRef.current) == null ? void 0 : _a.close();
|
|
12
|
+
}, []);
|
|
13
|
+
return useMemo(() => {
|
|
14
|
+
return {
|
|
15
|
+
modalRef,
|
|
16
|
+
show,
|
|
17
|
+
close
|
|
18
|
+
};
|
|
19
|
+
}, [modalRef, show, close]);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
useModal
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=chunk-TZNYJ3G7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useModal.ts"],"sourcesContent":["'use client'\n\nimport { useCallback, useMemo, useRef, type RefObject } from 'react'\n\n/**\n * This module provides a hook for using a custom modal.\n * @module\n */\n\ninterface UseModalReturnValue {\n modalRef: RefObject<HTMLDialogElement>\n show: () => void\n close: () => void\n}\n\nexport function useModal(): UseModalReturnValue {\n const modalRef = useRef<HTMLDialogElement | null>(null)\n\n const show = useCallback(() => {\n modalRef.current?.showModal()\n }, [])\n\n const close = useCallback(() => {\n modalRef.current?.close()\n }, [])\n\n return useMemo(() => {\n return {\n modalRef,\n show,\n close,\n }\n }, [modalRef, show, close])\n}\n"],"mappings":";AAEA,SAAS,aAAa,SAAS,cAA8B;AAatD,SAAS,WAAgC;AAC9C,QAAM,WAAW,OAAiC,IAAI;AAEtD,QAAM,OAAO,YAAY,MAAM;AAlBjC;AAmBI,mBAAS,YAAT,mBAAkB;AAAA,EACpB,GAAG,CAAC,CAAC;AAEL,QAAM,QAAQ,YAAY,MAAM;AAtBlC;AAuBI,mBAAS,YAAT,mBAAkB;AAAA,EACpB,GAAG,CAAC,CAAC;AAEL,SAAO,QAAQ,MAAM;AACnB,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,UAAU,MAAM,KAAK,CAAC;AAC5B;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/components/ModalDescription.tsx
|
|
2
|
+
import { cx } from "@cerberus-design/styled-system/css";
|
|
3
|
+
import { modal } from "@cerberus-design/styled-system/recipes";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function ModalDescription(props) {
|
|
6
|
+
return /* @__PURE__ */ jsx("p", { ...props, className: cx(props.className, modal().description) });
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
ModalDescription
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=chunk-UPODPCRD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/ModalDescription.tsx"],"sourcesContent":["import { cx } from '@cerberus-design/styled-system/css'\nimport { modal } from '@cerberus-design/styled-system/recipes'\nimport type { HTMLAttributes } from 'react'\n\n/**\n * This module contains the ModalDescription component for a customizable modal.\n * @module\n */\n\nexport type ModalDescriptionProps = HTMLAttributes<HTMLParagraphElement>\n\n/**\n * The ModalDescription component is a heading element for a customizable modal.\n * @example\n * ```tsx\n * <Modal>\n * <ModalDescription>Modal Heading</ModalDescription>\n * </Modal>\n * ```\n */\nexport function ModalDescription(props: ModalDescriptionProps) {\n return <p {...props} className={cx(props.className, modal().description)} />\n}\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,aAAa;AAoBb;AADF,SAAS,iBAAiB,OAA8B;AAC7D,SAAO,oBAAC,OAAG,GAAG,OAAO,WAAW,GAAG,MAAM,WAAW,MAAM,EAAE,WAAW,GAAG;AAC5E;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Input
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-ZAU4JVLL.js";
|
|
4
|
+
} from "../chunk-5GEC53G7.js";
|
|
6
5
|
import "../chunk-4O4QFF4S.js";
|
|
6
|
+
import "../chunk-ZAU4JVLL.js";
|
|
7
7
|
import "../chunk-6TXQZ3PB.js";
|
|
8
8
|
import "../chunk-C45DY4VE.js";
|
|
9
9
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
ConfirmModal,
|
|
4
|
-
ConfirmModalIcon,
|
|
5
4
|
useConfirmModal
|
|
6
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-D3ZXZA3U.js";
|
|
7
6
|
import "../chunk-4CAT3FHV.js";
|
|
7
|
+
import "../chunk-TPFNVGYA.js";
|
|
8
|
+
import "../chunk-UPODPCRD.js";
|
|
9
|
+
import "../chunk-2F5TB2EV.js";
|
|
10
|
+
import "../chunk-OGSAAB6K.js";
|
|
11
|
+
import "../chunk-G3JEWPLM.js";
|
|
8
12
|
import "../chunk-2ATICEW3.js";
|
|
9
13
|
import "../chunk-4O4QFF4S.js";
|
|
10
14
|
import "../chunk-KESKDLX6.js";
|
|
11
15
|
import "../chunk-6TXQZ3PB.js";
|
|
12
16
|
import "../chunk-C45DY4VE.js";
|
|
17
|
+
import "../chunk-TZNYJ3G7.js";
|
|
13
18
|
export {
|
|
14
19
|
ConfirmModal,
|
|
15
|
-
ConfirmModalIcon,
|
|
16
20
|
useConfirmModal
|
|
17
21
|
};
|
|
18
22
|
//# sourceMappingURL=confirm-modal.js.map
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
PromptModal,
|
|
4
|
-
PromptModalIcon,
|
|
5
4
|
usePromptModal
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-BLJ4SRAF.js";
|
|
5
|
+
} from "../chunk-DGPLSWFJ.js";
|
|
8
6
|
import "../chunk-4CAT3FHV.js";
|
|
7
|
+
import "../chunk-TPFNVGYA.js";
|
|
8
|
+
import "../chunk-UPODPCRD.js";
|
|
9
|
+
import "../chunk-2F5TB2EV.js";
|
|
10
|
+
import "../chunk-OGSAAB6K.js";
|
|
11
|
+
import "../chunk-G3JEWPLM.js";
|
|
9
12
|
import "../chunk-2ATICEW3.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-ZAU4JVLL.js";
|
|
13
|
+
import "../chunk-5GEC53G7.js";
|
|
14
|
+
import "../chunk-CU7HXAKM.js";
|
|
13
15
|
import "../chunk-4O4QFF4S.js";
|
|
16
|
+
import "../chunk-ZAU4JVLL.js";
|
|
14
17
|
import "../chunk-KESKDLX6.js";
|
|
15
18
|
import "../chunk-6TXQZ3PB.js";
|
|
16
19
|
import "../chunk-C45DY4VE.js";
|
|
20
|
+
import "../chunk-TZNYJ3G7.js";
|
|
17
21
|
export {
|
|
18
22
|
PromptModal,
|
|
19
|
-
PromptModalIcon,
|
|
20
23
|
usePromptModal
|
|
21
24
|
};
|
|
22
25
|
//# sourceMappingURL=prompt-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/build/legacy/index.js
CHANGED
|
@@ -1,33 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Tag
|
|
3
|
-
} from "./chunk-EVEEQRH6.js";
|
|
4
|
-
import {
|
|
5
|
-
Textarea
|
|
6
|
-
} from "./chunk-TCO46FK7.js";
|
|
7
1
|
import {
|
|
8
2
|
Toggle
|
|
9
3
|
} from "./chunk-TAZI77TP.js";
|
|
10
|
-
import {
|
|
11
|
-
PromptModal,
|
|
12
|
-
PromptModalIcon,
|
|
13
|
-
usePromptModal
|
|
14
|
-
} from "./chunk-SNSBODYR.js";
|
|
15
4
|
import {
|
|
16
5
|
ConfirmModal,
|
|
17
|
-
ConfirmModalIcon,
|
|
18
6
|
useConfirmModal
|
|
19
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-D3ZXZA3U.js";
|
|
20
8
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import {
|
|
25
|
-
NavMenuTrigger
|
|
26
|
-
} from "./chunk-RPZAPUCF.js";
|
|
27
|
-
import {
|
|
28
|
-
NavMenu,
|
|
29
|
-
useNavMenuContext
|
|
30
|
-
} from "./chunk-KJUCHZHV.js";
|
|
9
|
+
PromptModal,
|
|
10
|
+
usePromptModal
|
|
11
|
+
} from "./chunk-DGPLSWFJ.js";
|
|
31
12
|
import {
|
|
32
13
|
Portal
|
|
33
14
|
} from "./chunk-4CAT3FHV.js";
|
|
@@ -43,6 +24,48 @@ import {
|
|
|
43
24
|
import {
|
|
44
25
|
TabPanel
|
|
45
26
|
} from "./chunk-67S42J4B.js";
|
|
27
|
+
import {
|
|
28
|
+
Tag
|
|
29
|
+
} from "./chunk-EVEEQRH6.js";
|
|
30
|
+
import {
|
|
31
|
+
Textarea
|
|
32
|
+
} from "./chunk-TCO46FK7.js";
|
|
33
|
+
import {
|
|
34
|
+
Modal
|
|
35
|
+
} from "./chunk-TPFNVGYA.js";
|
|
36
|
+
import {
|
|
37
|
+
ModalDescription
|
|
38
|
+
} from "./chunk-UPODPCRD.js";
|
|
39
|
+
import {
|
|
40
|
+
ModalHeader
|
|
41
|
+
} from "./chunk-2F5TB2EV.js";
|
|
42
|
+
import {
|
|
43
|
+
ModalHeading
|
|
44
|
+
} from "./chunk-OGSAAB6K.js";
|
|
45
|
+
import {
|
|
46
|
+
ModalIcon
|
|
47
|
+
} from "./chunk-G3JEWPLM.js";
|
|
48
|
+
import {
|
|
49
|
+
NavMenuLink
|
|
50
|
+
} from "./chunk-6DIGPXAD.js";
|
|
51
|
+
import {
|
|
52
|
+
NavMenuList,
|
|
53
|
+
getPosition
|
|
54
|
+
} from "./chunk-PMCYXRAH.js";
|
|
55
|
+
import {
|
|
56
|
+
NavMenuTrigger
|
|
57
|
+
} from "./chunk-RPZAPUCF.js";
|
|
58
|
+
import {
|
|
59
|
+
NavMenu,
|
|
60
|
+
useNavMenuContext
|
|
61
|
+
} from "./chunk-KJUCHZHV.js";
|
|
62
|
+
import {
|
|
63
|
+
MODE_KEY,
|
|
64
|
+
THEME_KEY,
|
|
65
|
+
ThemeProvider,
|
|
66
|
+
useTheme,
|
|
67
|
+
useThemeContext
|
|
68
|
+
} from "./chunk-SXXWC6UD.js";
|
|
46
69
|
import {
|
|
47
70
|
useToggle
|
|
48
71
|
} from "./chunk-SCQVXJBT.js";
|
|
@@ -64,20 +87,17 @@ import {
|
|
|
64
87
|
} from "./chunk-SLHX5K6I.js";
|
|
65
88
|
import {
|
|
66
89
|
Input
|
|
67
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-5GEC53G7.js";
|
|
68
91
|
import {
|
|
69
92
|
Label
|
|
70
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-CU7HXAKM.js";
|
|
94
|
+
import {
|
|
95
|
+
Show
|
|
96
|
+
} from "./chunk-4O4QFF4S.js";
|
|
71
97
|
import {
|
|
72
98
|
Field,
|
|
73
99
|
useFieldContext
|
|
74
100
|
} from "./chunk-ZAU4JVLL.js";
|
|
75
|
-
import {
|
|
76
|
-
NavMenuLink
|
|
77
|
-
} from "./chunk-6DIGPXAD.js";
|
|
78
|
-
import {
|
|
79
|
-
Show
|
|
80
|
-
} from "./chunk-4O4QFF4S.js";
|
|
81
101
|
import "./chunk-55J6XMHW.js";
|
|
82
102
|
import {
|
|
83
103
|
createNavTriggerProps
|
|
@@ -99,17 +119,12 @@ import {
|
|
|
99
119
|
} from "./chunk-6TXQZ3PB.js";
|
|
100
120
|
import "./chunk-C45DY4VE.js";
|
|
101
121
|
import {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
ThemeProvider,
|
|
105
|
-
useTheme,
|
|
106
|
-
useThemeContext
|
|
107
|
-
} from "./chunk-SXXWC6UD.js";
|
|
122
|
+
useModal
|
|
123
|
+
} from "./chunk-TZNYJ3G7.js";
|
|
108
124
|
export {
|
|
109
125
|
$cerberusIcons,
|
|
110
126
|
Button,
|
|
111
127
|
ConfirmModal,
|
|
112
|
-
ConfirmModalIcon,
|
|
113
128
|
FeatureFlag,
|
|
114
129
|
FeatureFlags,
|
|
115
130
|
Field,
|
|
@@ -118,13 +133,17 @@ export {
|
|
|
118
133
|
Input,
|
|
119
134
|
Label,
|
|
120
135
|
MODE_KEY,
|
|
136
|
+
Modal,
|
|
137
|
+
ModalDescription,
|
|
138
|
+
ModalHeader,
|
|
139
|
+
ModalHeading,
|
|
140
|
+
ModalIcon,
|
|
121
141
|
NavMenu,
|
|
122
142
|
NavMenuLink,
|
|
123
143
|
NavMenuList,
|
|
124
144
|
NavMenuTrigger,
|
|
125
145
|
Portal,
|
|
126
146
|
PromptModal,
|
|
127
|
-
PromptModalIcon,
|
|
128
147
|
Radio,
|
|
129
148
|
Show,
|
|
130
149
|
THEME_KEY,
|
|
@@ -144,6 +163,7 @@ export {
|
|
|
144
163
|
useConfirmModal,
|
|
145
164
|
useFeatureFlags,
|
|
146
165
|
useFieldContext,
|
|
166
|
+
useModal,
|
|
147
167
|
useNavMenuContext,
|
|
148
168
|
usePromptModal,
|
|
149
169
|
useTabsContext,
|
|
@@ -3,10 +3,10 @@ import { button } from '@cerberus/styled-system/recipes';
|
|
|
3
3
|
import { ButtonHTMLAttributes } from 'react';
|
|
4
4
|
import { CarbonIconType } from '@cerberus/icons';
|
|
5
5
|
import { ChangeEvent } from 'react';
|
|
6
|
-
import { ConfirmModalVariantProps } from '@cerberus-design/styled-system/recipes';
|
|
7
6
|
import { Context } from 'react';
|
|
8
7
|
import { ElementType } from 'react';
|
|
9
8
|
import { fieldMessage } from '@cerberus/styled-system/recipes';
|
|
9
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
10
10
|
import { HTMLAttributes } from 'react';
|
|
11
11
|
import { iconButton } from '@cerberus/styled-system/recipes';
|
|
12
12
|
import { input } from '@cerberus/styled-system/recipes';
|
|
@@ -14,6 +14,7 @@ import type { InputHTMLAttributes } from 'react';
|
|
|
14
14
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
15
15
|
import type { KeyboardEventHandler } from 'react';
|
|
16
16
|
import { label } from '@cerberus/styled-system/recipes';
|
|
17
|
+
import { ModalIconVariantProps } from '@cerberus-design/styled-system/recipes';
|
|
17
18
|
import { MutableRefObject } from 'react';
|
|
18
19
|
import type { Pretty } from '@cerberus-design/styled-system/types';
|
|
19
20
|
import { PropsWithChildren } from 'react';
|
|
@@ -23,6 +24,7 @@ import { ReactPortal } from 'react';
|
|
|
23
24
|
import { RecipeVariantProps } from '@cerberus/styled-system/css';
|
|
24
25
|
import type { RecipeVariantProps as RecipeVariantProps_2 } from '@cerberus-design/styled-system/types';
|
|
25
26
|
import type { RecipeVariantProps as RecipeVariantProps_3 } from '@cerberus/styled-system/types';
|
|
27
|
+
import { RefAttributes } from 'react';
|
|
26
28
|
import { RefObject } from 'react';
|
|
27
29
|
import { TabsVariantProps } from '@cerberus-design/styled-system/recipes';
|
|
28
30
|
import { tag } from '@cerberus/styled-system/recipes';
|
|
@@ -91,10 +93,6 @@ declare function ConfirmModal(props: PropsWithChildren<ConfirmModalProviderProps
|
|
|
91
93
|
export { ConfirmModal }
|
|
92
94
|
export { ConfirmModal as ConfirmModal_alias_1 }
|
|
93
95
|
|
|
94
|
-
declare function ConfirmModalIcon(props: ConfirmModalVariantProps): JSX_2.Element;
|
|
95
|
-
export { ConfirmModalIcon }
|
|
96
|
-
export { ConfirmModalIcon as ConfirmModalIcon_alias_1 }
|
|
97
|
-
|
|
98
96
|
declare interface ConfirmModalProviderProps {
|
|
99
97
|
}
|
|
100
98
|
export { ConfirmModalProviderProps }
|
|
@@ -325,6 +323,108 @@ declare type LabelRecipeProps = RecipeVariantProps<typeof label>;
|
|
|
325
323
|
export { LabelRecipeProps }
|
|
326
324
|
export { LabelRecipeProps as LabelRecipeProps_alias_1 }
|
|
327
325
|
|
|
326
|
+
/**
|
|
327
|
+
* The Modal component is the root element for a customizable modal.
|
|
328
|
+
* @example
|
|
329
|
+
* ```tsx
|
|
330
|
+
* const { modalRef } = useModal()
|
|
331
|
+
*
|
|
332
|
+
* <Modal ref={modalRef}>
|
|
333
|
+
* <ModalIcon icon={$cerberusIcons.alert} />
|
|
334
|
+
* <h2>Modal Heading</h2>
|
|
335
|
+
* <p>Modal description</p>
|
|
336
|
+
* </Modal>
|
|
337
|
+
* ```
|
|
338
|
+
*/
|
|
339
|
+
declare const Modal: ForwardRefExoticComponent<ModalProps & RefAttributes<HTMLDialogElement>>;
|
|
340
|
+
export { Modal }
|
|
341
|
+
export { Modal as Modal_alias_1 }
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* The ModalDescription component is a heading element for a customizable modal.
|
|
345
|
+
* @example
|
|
346
|
+
* ```tsx
|
|
347
|
+
* <Modal>
|
|
348
|
+
* <ModalDescription>Modal Heading</ModalDescription>
|
|
349
|
+
* </Modal>
|
|
350
|
+
* ```
|
|
351
|
+
*/
|
|
352
|
+
declare function ModalDescription(props: ModalDescriptionProps): JSX_2.Element;
|
|
353
|
+
export { ModalDescription }
|
|
354
|
+
export { ModalDescription as ModalDescription_alias_1 }
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* This module contains the ModalDescription component for a customizable modal.
|
|
358
|
+
* @module
|
|
359
|
+
*/
|
|
360
|
+
declare type ModalDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
|
|
361
|
+
export { ModalDescriptionProps }
|
|
362
|
+
export { ModalDescriptionProps as ModalDescriptionProps_alias_1 }
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* The ModalHeader component is a header element for a customizable modal.
|
|
366
|
+
* @example
|
|
367
|
+
* ```tsx
|
|
368
|
+
* <Modal>
|
|
369
|
+
* <ModalHeader>
|
|
370
|
+
* <h2>Modal Heading</h2>
|
|
371
|
+
* </ModalHeader>
|
|
372
|
+
* </Modal>
|
|
373
|
+
* ```
|
|
374
|
+
*/
|
|
375
|
+
declare function ModalHeader(props: ModalHeaderProps): JSX_2.Element;
|
|
376
|
+
export { ModalHeader }
|
|
377
|
+
export { ModalHeader as ModalHeader_alias_1 }
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* This module contains the ModalHeader component for a customizable modal.
|
|
381
|
+
* @module
|
|
382
|
+
*/
|
|
383
|
+
declare type ModalHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
384
|
+
export { ModalHeaderProps }
|
|
385
|
+
export { ModalHeaderProps as ModalHeaderProps_alias_1 }
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* The ModalHeading component is a heading element for a customizable modal.
|
|
389
|
+
* @example
|
|
390
|
+
* ```tsx
|
|
391
|
+
* <Modal>
|
|
392
|
+
* <ModalHeading>Modal Heading</ModalHeading>
|
|
393
|
+
* </Modal>
|
|
394
|
+
* ```
|
|
395
|
+
*/
|
|
396
|
+
declare function ModalHeading(props: ModalHeadingProps): JSX_2.Element;
|
|
397
|
+
export { ModalHeading }
|
|
398
|
+
export { ModalHeading as ModalHeading_alias_1 }
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* This module contains the ModalHeading component for a customizable modal.
|
|
402
|
+
* @module
|
|
403
|
+
*/
|
|
404
|
+
declare type ModalHeadingProps = HTMLAttributes<HTMLParagraphElement>;
|
|
405
|
+
export { ModalHeadingProps }
|
|
406
|
+
export { ModalHeadingProps as ModalHeadingProps_alias_1 }
|
|
407
|
+
|
|
408
|
+
declare function ModalIcon(props: PropsWithChildren<ModalIconProps>): JSX_2.Element;
|
|
409
|
+
export { ModalIcon }
|
|
410
|
+
export { ModalIcon as ModalIcon_alias_1 }
|
|
411
|
+
|
|
412
|
+
declare type ModalIconBaseProps = HTMLAttributes<HTMLDivElement>;
|
|
413
|
+
export { ModalIconBaseProps }
|
|
414
|
+
export { ModalIconBaseProps as ModalIconBaseProps_alias_1 }
|
|
415
|
+
|
|
416
|
+
declare type ModalIconProps = ModalIconBaseProps & ModalIconVariantProps;
|
|
417
|
+
export { ModalIconProps }
|
|
418
|
+
export { ModalIconProps as ModalIconProps_alias_1 }
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* This module contains the Modal root component for a customizable modal.
|
|
422
|
+
* @module
|
|
423
|
+
*/
|
|
424
|
+
declare type ModalProps = HTMLAttributes<HTMLDialogElement>;
|
|
425
|
+
export { ModalProps }
|
|
426
|
+
export { ModalProps as ModalProps_alias_1 }
|
|
427
|
+
|
|
328
428
|
declare const MODE_KEY = "cerberus-mode";
|
|
329
429
|
export { MODE_KEY }
|
|
330
430
|
export { MODE_KEY as MODE_KEY_alias_1 }
|
|
@@ -472,10 +572,6 @@ declare function PromptModal(props: PropsWithChildren<PromptModalProviderProps>)
|
|
|
472
572
|
export { PromptModal }
|
|
473
573
|
export { PromptModal as PromptModal_alias_1 }
|
|
474
574
|
|
|
475
|
-
declare function PromptModalIcon(props: ConfirmModalVariantProps): JSX_2.Element;
|
|
476
|
-
export { PromptModalIcon }
|
|
477
|
-
export { PromptModalIcon as PromptModalIcon_alias_1 }
|
|
478
|
-
|
|
479
575
|
declare interface PromptModalProviderProps {
|
|
480
576
|
}
|
|
481
577
|
export { PromptModalProviderProps }
|
|
@@ -805,6 +901,20 @@ declare function useFieldContext(): FieldContextValue;
|
|
|
805
901
|
export { useFieldContext }
|
|
806
902
|
export { useFieldContext as useFieldContext_alias_1 }
|
|
807
903
|
|
|
904
|
+
declare function useModal(): UseModalReturnValue;
|
|
905
|
+
export { useModal }
|
|
906
|
+
export { useModal as useModal_alias_1 }
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* This module provides a hook for using a custom modal.
|
|
910
|
+
* @module
|
|
911
|
+
*/
|
|
912
|
+
declare interface UseModalReturnValue {
|
|
913
|
+
modalRef: RefObject<HTMLDialogElement>;
|
|
914
|
+
show: () => void;
|
|
915
|
+
close: () => void;
|
|
916
|
+
}
|
|
917
|
+
|
|
808
918
|
declare function useNavMenuContext(): NavMenuContextValue;
|
|
809
919
|
export { useNavMenuContext }
|
|
810
920
|
export { useNavMenuContext as useNavMenuContext_alias_1 }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/components/ModalHeader.tsx
|
|
2
|
+
import { cx } from "@cerberus-design/styled-system/css";
|
|
3
|
+
import { vstack } from "@cerberus-design/styled-system/patterns";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function ModalHeader(props) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
...props,
|
|
10
|
+
className: cx(
|
|
11
|
+
props.className,
|
|
12
|
+
vstack({
|
|
13
|
+
alignItems: "flex-start",
|
|
14
|
+
gap: "4",
|
|
15
|
+
mb: "8"
|
|
16
|
+
})
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
ModalHeader
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=chunk-2F5TB2EV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/ModalHeader.tsx"],"sourcesContent":["import { cx } from '@cerberus-design/styled-system/css'\nimport { vstack } from '@cerberus-design/styled-system/patterns'\nimport type { HTMLAttributes } from 'react'\n\n/**\n * This module contains the ModalHeader component for a customizable modal.\n * @module\n */\n\nexport type ModalHeaderProps = HTMLAttributes<HTMLDivElement>\n\n/**\n * The ModalHeader component is a header element for a customizable modal.\n * @example\n * ```tsx\n * <Modal>\n * <ModalHeader>\n * <h2>Modal Heading</h2>\n * </ModalHeader>\n * </Modal>\n * ```\n */\nexport function ModalHeader(props: ModalHeaderProps) {\n return (\n <div\n {...props}\n className={cx(\n props.className,\n vstack({\n alignItems: 'flex-start',\n gap: '4',\n mb: '8',\n }),\n )}\n />\n )\n}\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,cAAc;AAuBnB;AAFG,SAAS,YAAY,OAAyB;AACnD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,UACL,YAAY;AAAA,UACZ,KAAK;AAAA,UACL,IAAI;AAAA,QACN,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useFieldContext
|
|
3
|
-
} from "./chunk-ZAU4JVLL.js";
|
|
4
1
|
import {
|
|
5
2
|
Show
|
|
6
3
|
} from "./chunk-4O4QFF4S.js";
|
|
4
|
+
import {
|
|
5
|
+
useFieldContext
|
|
6
|
+
} from "./chunk-ZAU4JVLL.js";
|
|
7
7
|
import {
|
|
8
8
|
$cerberusIcons
|
|
9
9
|
} from "./chunk-6TXQZ3PB.js";
|
|
@@ -39,4 +39,4 @@ function Input(props) {
|
|
|
39
39
|
export {
|
|
40
40
|
Input
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-5GEC53G7.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/hooks/useModal.ts
|
|
2
|
+
import { useCallback, useMemo, useRef } from "react";
|
|
3
|
+
function useModal() {
|
|
4
|
+
const modalRef = useRef(null);
|
|
5
|
+
const show = useCallback(() => {
|
|
6
|
+
modalRef.current?.showModal();
|
|
7
|
+
}, []);
|
|
8
|
+
const close = useCallback(() => {
|
|
9
|
+
modalRef.current?.close();
|
|
10
|
+
}, []);
|
|
11
|
+
return useMemo(() => {
|
|
12
|
+
return {
|
|
13
|
+
modalRef,
|
|
14
|
+
show,
|
|
15
|
+
close
|
|
16
|
+
};
|
|
17
|
+
}, [modalRef, show, close]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
useModal
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=chunk-C5HLLGME.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useModal.ts"],"sourcesContent":["'use client'\n\nimport { useCallback, useMemo, useRef, type RefObject } from 'react'\n\n/**\n * This module provides a hook for using a custom modal.\n * @module\n */\n\ninterface UseModalReturnValue {\n modalRef: RefObject<HTMLDialogElement>\n show: () => void\n close: () => void\n}\n\nexport function useModal(): UseModalReturnValue {\n const modalRef = useRef<HTMLDialogElement | null>(null)\n\n const show = useCallback(() => {\n modalRef.current?.showModal()\n }, [])\n\n const close = useCallback(() => {\n modalRef.current?.close()\n }, [])\n\n return useMemo(() => {\n return {\n modalRef,\n show,\n close,\n }\n }, [modalRef, show, close])\n}\n"],"mappings":";AAEA,SAAS,aAAa,SAAS,cAA8B;AAatD,SAAS,WAAgC;AAC9C,QAAM,WAAW,OAAiC,IAAI;AAEtD,QAAM,OAAO,YAAY,MAAM;AAC7B,aAAS,SAAS,UAAU;AAAA,EAC9B,GAAG,CAAC,CAAC;AAEL,QAAM,QAAQ,YAAY,MAAM;AAC9B,aAAS,SAAS,MAAM;AAAA,EAC1B,GAAG,CAAC,CAAC;AAEL,SAAO,QAAQ,MAAM;AACnB,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,UAAU,MAAM,KAAK,CAAC;AAC5B;","names":[]}
|