@cerberus-design/react 0.12.0-next-34ac941 → 0.12.0-next-bd594cf

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.
Files changed (34) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.cts +14 -1
  2. package/build/legacy/components/Portal.cjs +3 -5
  3. package/build/legacy/components/Portal.cjs.map +1 -1
  4. package/build/legacy/context/confirm-modal.cjs +2 -5
  5. package/build/legacy/context/confirm-modal.cjs.map +1 -1
  6. package/build/legacy/context/cta-modal.cjs +2 -5
  7. package/build/legacy/context/cta-modal.cjs.map +1 -1
  8. package/build/legacy/context/notification-center.cjs +2 -5
  9. package/build/legacy/context/notification-center.cjs.map +1 -1
  10. package/build/legacy/context/prompt-modal.cjs +2 -5
  11. package/build/legacy/context/prompt-modal.cjs.map +1 -1
  12. package/build/legacy/index.cjs +2 -5
  13. package/build/legacy/index.cjs.map +1 -1
  14. package/build/modern/_tsup-dts-rollup.d.ts +14 -1
  15. package/build/modern/{chunk-NJIX4CY2.js → chunk-3FCUTX4S.js} +2 -2
  16. package/build/modern/{chunk-EZ56D7WO.js → chunk-IFD2BUUW.js} +2 -2
  17. package/build/modern/chunk-K2PSHGS7.js +11 -0
  18. package/build/modern/chunk-K2PSHGS7.js.map +1 -0
  19. package/build/modern/{chunk-CEC4EXVR.js → chunk-ON64MA6L.js} +2 -2
  20. package/build/modern/{chunk-5OSUZUR4.js → chunk-PNR7ZUAR.js} +2 -2
  21. package/build/modern/components/Portal.js +2 -1
  22. package/build/modern/context/confirm-modal.js +2 -2
  23. package/build/modern/context/cta-modal.js +2 -2
  24. package/build/modern/context/notification-center.js +2 -2
  25. package/build/modern/context/prompt-modal.js +2 -2
  26. package/build/modern/index.js +5 -5
  27. package/package.json +3 -3
  28. package/src/components/Portal.tsx +17 -6
  29. package/build/modern/chunk-GLY7GU5S.js +0 -14
  30. package/build/modern/chunk-GLY7GU5S.js.map +0 -1
  31. /package/build/modern/{chunk-NJIX4CY2.js.map → chunk-3FCUTX4S.js.map} +0 -0
  32. /package/build/modern/{chunk-EZ56D7WO.js.map → chunk-IFD2BUUW.js.map} +0 -0
  33. /package/build/modern/{chunk-CEC4EXVR.js.map → chunk-ON64MA6L.js.map} +0 -0
  34. /package/build/modern/{chunk-5OSUZUR4.js.map → chunk-PNR7ZUAR.js.map} +0 -0
@@ -1821,8 +1821,21 @@ export { pointerWithin }
1821
1821
  * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.
1822
1822
  * @see https://cerberus.digitalu.design/react/portal
1823
1823
  * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)
1824
+ * @example
1825
+ * ```tsx
1826
+ * 'use client'
1827
+ *
1828
+ * import { Portal } from '@cerberus/react'
1829
+ *
1830
+ * function SomeFeatureWithinSSRPage() {
1831
+ * return (
1832
+ * <Portal>
1833
+ * <div>Portal Content outside of the React VDom tree</div>
1834
+ * </Portal>
1835
+ * )
1836
+ * }
1824
1837
  */
1825
- declare function Portal(props: PropsWithChildren<PortalProps>): ReactPortal | null;
1838
+ declare function Portal(props: PropsWithChildren<PortalProps>): ReactPortal;
1826
1839
  export { Portal }
1827
1840
  export { Portal as Portal_alias_1 }
1828
1841
 
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-2UXE5PDG.js";
4
4
  import {
5
5
  Portal
6
- } from "./chunk-GLY7GU5S.js";
6
+ } from "./chunk-K2PSHGS7.js";
7
7
  import {
8
8
  Modal
9
9
  } from "./chunk-BE4EOU2P.js";
@@ -152,4 +152,4 @@ export {
152
152
  CTAModal,
153
153
  useCTAModal
154
154
  };
155
- //# sourceMappingURL=chunk-NJIX4CY2.js.map
155
+ //# sourceMappingURL=chunk-3FCUTX4S.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-2UXE5PDG.js";
4
4
  import {
5
5
  Portal
6
- } from "./chunk-GLY7GU5S.js";
6
+ } from "./chunk-K2PSHGS7.js";
7
7
  import {
8
8
  Input
9
9
  } from "./chunk-NKM6PISB.js";
@@ -240,4 +240,4 @@ export {
240
240
  PromptModal,
241
241
  usePromptModal
242
242
  };
243
- //# sourceMappingURL=chunk-EZ56D7WO.js.map
243
+ //# sourceMappingURL=chunk-IFD2BUUW.js.map
@@ -0,0 +1,11 @@
1
+ // src/components/Portal.tsx
2
+ import { createPortal } from "react-dom";
3
+ function Portal(props) {
4
+ const container = props.container || document.body;
5
+ return createPortal(props.children, container, props.key);
6
+ }
7
+
8
+ export {
9
+ Portal
10
+ };
11
+ //# sourceMappingURL=chunk-K2PSHGS7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/Portal.tsx"],"sourcesContent":["'use client'\n\nimport type { PropsWithChildren } from 'react'\nimport { createPortal } from 'react-dom'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport interface PortalProps {\n /**\n * The root container to render the children into.\n * @default document.body\n */\n container?: Element | DocumentFragment\n /**\n * An optional key to use for the Portal component.\n */\n key?: null | string\n}\n\n/**\n * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.\n * @see https://cerberus.digitalu.design/react/portal\n * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)\n * @example\n * ```tsx\n * 'use client'\n *\n * import { Portal } from '@cerberus/react'\n *\n * function SomeFeatureWithinSSRPage() {\n * return (\n * <Portal>\n * <div>Portal Content outside of the React VDom tree</div>\n * </Portal>\n * )\n * }\n */\nexport function Portal(props: PropsWithChildren<PortalProps>) {\n const container = props.container || document.body\n return createPortal(props.children, container, props.key)\n}\n"],"mappings":";AAGA,SAAS,oBAAoB;AAqCtB,SAAS,OAAO,OAAuC;AAC5D,QAAM,YAAY,MAAM,aAAa,SAAS;AAC9C,SAAO,aAAa,MAAM,UAAU,WAAW,MAAM,GAAG;AAC1D;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-2UXE5PDG.js";
4
4
  import {
5
5
  Portal
6
- } from "./chunk-GLY7GU5S.js";
6
+ } from "./chunk-K2PSHGS7.js";
7
7
  import {
8
8
  Modal
9
9
  } from "./chunk-BE4EOU2P.js";
@@ -176,4 +176,4 @@ export {
176
176
  ConfirmModal,
177
177
  useConfirmModal
178
178
  };
179
- //# sourceMappingURL=chunk-CEC4EXVR.js.map
179
+ //# sourceMappingURL=chunk-ON64MA6L.js.map
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-SXIXDXG3.js";
10
10
  import {
11
11
  Portal
12
- } from "./chunk-GLY7GU5S.js";
12
+ } from "./chunk-K2PSHGS7.js";
13
13
  import {
14
14
  Button
15
15
  } from "./chunk-EXGKZGML.js";
@@ -159,4 +159,4 @@ export {
159
159
  NotificationCenter,
160
160
  useNotificationCenter
161
161
  };
162
- //# sourceMappingURL=chunk-5OSUZUR4.js.map
162
+ //# sourceMappingURL=chunk-PNR7ZUAR.js.map
@@ -1,6 +1,7 @@
1
+ "use client";
1
2
  import {
2
3
  Portal
3
- } from "../chunk-GLY7GU5S.js";
4
+ } from "../chunk-K2PSHGS7.js";
4
5
  export {
5
6
  Portal
6
7
  };
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  ConfirmModal,
4
4
  useConfirmModal
5
- } from "../chunk-CEC4EXVR.js";
5
+ } from "../chunk-ON64MA6L.js";
6
6
  import "../chunk-2UXE5PDG.js";
7
- import "../chunk-GLY7GU5S.js";
7
+ import "../chunk-K2PSHGS7.js";
8
8
  import "../chunk-BE4EOU2P.js";
9
9
  import "../chunk-Q7BRMIBR.js";
10
10
  import "../chunk-ZFAIE47A.js";
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  CTAModal,
4
4
  useCTAModal
5
- } from "../chunk-NJIX4CY2.js";
5
+ } from "../chunk-3FCUTX4S.js";
6
6
  import "../chunk-2UXE5PDG.js";
7
- import "../chunk-GLY7GU5S.js";
7
+ import "../chunk-K2PSHGS7.js";
8
8
  import "../chunk-BE4EOU2P.js";
9
9
  import "../chunk-Q7BRMIBR.js";
10
10
  import "../chunk-ZFAIE47A.js";
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  NotificationCenter,
4
4
  useNotificationCenter
5
- } from "../chunk-5OSUZUR4.js";
5
+ } from "../chunk-PNR7ZUAR.js";
6
6
  import "../chunk-7SGPJM66.js";
7
7
  import "../chunk-XEW6TJJ4.js";
8
8
  import "../chunk-SXIXDXG3.js";
9
- import "../chunk-GLY7GU5S.js";
9
+ import "../chunk-K2PSHGS7.js";
10
10
  import "../chunk-EXGKZGML.js";
11
11
  import "../chunk-BUVVRQLZ.js";
12
12
  import "../chunk-JIZQFTW6.js";
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  PromptModal,
4
4
  usePromptModal
5
- } from "../chunk-EZ56D7WO.js";
5
+ } from "../chunk-IFD2BUUW.js";
6
6
  import "../chunk-2UXE5PDG.js";
7
- import "../chunk-GLY7GU5S.js";
7
+ import "../chunk-K2PSHGS7.js";
8
8
  import "../chunk-NKM6PISB.js";
9
9
  import "../chunk-NMF2HYWO.js";
10
10
  import "../chunk-BE4EOU2P.js";
@@ -5,19 +5,19 @@ import {
5
5
  import {
6
6
  ConfirmModal,
7
7
  useConfirmModal
8
- } from "./chunk-CEC4EXVR.js";
8
+ } from "./chunk-ON64MA6L.js";
9
9
  import {
10
10
  CTAModal,
11
11
  useCTAModal
12
- } from "./chunk-NJIX4CY2.js";
12
+ } from "./chunk-3FCUTX4S.js";
13
13
  import {
14
14
  NotificationCenter,
15
15
  useNotificationCenter
16
- } from "./chunk-5OSUZUR4.js";
16
+ } from "./chunk-PNR7ZUAR.js";
17
17
  import {
18
18
  PromptModal,
19
19
  usePromptModal
20
- } from "./chunk-EZ56D7WO.js";
20
+ } from "./chunk-IFD2BUUW.js";
21
21
  import {
22
22
  Table,
23
23
  Tr
@@ -90,7 +90,7 @@ import {
90
90
  } from "./chunk-SXIXDXG3.js";
91
91
  import {
92
92
  Portal
93
- } from "./chunk-GLY7GU5S.js";
93
+ } from "./chunk-K2PSHGS7.js";
94
94
  import {
95
95
  Input
96
96
  } from "./chunk-NKM6PISB.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerberus-design/react",
3
- "version": "0.12.0-next-34ac941",
3
+ "version": "0.12.0-next-bd594cf",
4
4
  "description": "The Cerberus Design React component library.",
5
5
  "browserslist": "> 0.25%, not dead",
6
6
  "sideEffects": false,
@@ -26,8 +26,8 @@
26
26
  "react": "^18",
27
27
  "react-dom": "^18",
28
28
  "tsup": "^8.1.0",
29
- "@cerberus-design/styled-system": "0.12.0-next-34ac941",
30
- "@cerberus-design/configs": "0.0.0"
29
+ "@cerberus-design/configs": "0.0.0",
30
+ "@cerberus-design/styled-system": "0.12.0-next-bd594cf"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
@@ -1,3 +1,5 @@
1
+ 'use client'
2
+
1
3
  import type { PropsWithChildren } from 'react'
2
4
  import { createPortal } from 'react-dom'
3
5
 
@@ -22,12 +24,21 @@ export interface PortalProps {
22
24
  * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.
23
25
  * @see https://cerberus.digitalu.design/react/portal
24
26
  * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)
27
+ * @example
28
+ * ```tsx
29
+ * 'use client'
30
+ *
31
+ * import { Portal } from '@cerberus/react'
32
+ *
33
+ * function SomeFeatureWithinSSRPage() {
34
+ * return (
35
+ * <Portal>
36
+ * <div>Portal Content outside of the React VDom tree</div>
37
+ * </Portal>
38
+ * )
39
+ * }
25
40
  */
26
41
  export function Portal(props: PropsWithChildren<PortalProps>) {
27
- if (typeof window !== 'undefined') {
28
- const container = props.container || document.body
29
- return createPortal(props.children, container, props.key)
30
- }
31
-
32
- return null
42
+ const container = props.container || document.body
43
+ return createPortal(props.children, container, props.key)
33
44
  }
@@ -1,14 +0,0 @@
1
- // src/components/Portal.tsx
2
- import { createPortal } from "react-dom";
3
- function Portal(props) {
4
- if (typeof window !== "undefined") {
5
- const container = props.container || document.body;
6
- return createPortal(props.children, container, props.key);
7
- }
8
- return null;
9
- }
10
-
11
- export {
12
- Portal
13
- };
14
- //# sourceMappingURL=chunk-GLY7GU5S.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Portal.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react'\nimport { createPortal } from 'react-dom'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport interface PortalProps {\n /**\n * The root container to render the children into.\n * @default document.body\n */\n container?: Element | DocumentFragment\n /**\n * An optional key to use for the Portal component.\n */\n key?: null | string\n}\n\n/**\n * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.\n * @see https://cerberus.digitalu.design/react/portal\n * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)\n */\nexport function Portal(props: PropsWithChildren<PortalProps>) {\n if (typeof window !== 'undefined') {\n const container = props.container || document.body\n return createPortal(props.children, container, props.key)\n }\n\n return null\n}\n"],"mappings":";AACA,SAAS,oBAAoB;AAwBtB,SAAS,OAAO,OAAuC;AAC5D,MAAI,OAAO,WAAW,aAAa;AACjC,UAAM,YAAY,MAAM,aAAa,SAAS;AAC9C,WAAO,aAAa,MAAM,UAAU,WAAW,MAAM,GAAG;AAAA,EAC1D;AAEA,SAAO;AACT;","names":[]}