@cerberus-design/react 0.16.0-next-22894bb → 0.16.0-next-1e5283a

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 (83) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.cts +108 -90
  2. package/build/legacy/components/cta-dialog/index.cjs +91 -65
  3. package/build/legacy/components/cta-dialog/index.cjs.map +1 -1
  4. package/build/legacy/components/cta-dialog/provider.cjs +91 -65
  5. package/build/legacy/components/cta-dialog/provider.cjs.map +1 -1
  6. package/build/legacy/components/{Dialog.client.cjs → dialog/close-icon-trigger.cjs} +36 -28
  7. package/build/legacy/components/dialog/close-icon-trigger.cjs.map +1 -0
  8. package/build/legacy/components/dialog/dialog.cjs +80 -0
  9. package/build/legacy/components/dialog/dialog.cjs.map +1 -0
  10. package/build/legacy/components/dialog/index.cjs +208 -0
  11. package/build/legacy/components/dialog/index.cjs.map +1 -0
  12. package/build/legacy/components/dialog/parts.cjs +109 -0
  13. package/build/legacy/components/dialog/parts.cjs.map +1 -0
  14. package/build/legacy/components/dialog/primitives.cjs +112 -0
  15. package/build/legacy/components/dialog/primitives.cjs.map +1 -0
  16. package/build/legacy/context/confirm-modal.cjs +78 -49
  17. package/build/legacy/context/confirm-modal.cjs.map +1 -1
  18. package/build/legacy/context/notification-center.cjs +3 -9
  19. package/build/legacy/context/notification-center.cjs.map +1 -1
  20. package/build/legacy/context/prompt-modal.cjs +84 -58
  21. package/build/legacy/context/prompt-modal.cjs.map +1 -1
  22. package/build/legacy/index.cjs +489 -437
  23. package/build/legacy/index.cjs.map +1 -1
  24. package/build/modern/_tsup-dts-rollup.d.ts +108 -90
  25. package/build/modern/{chunk-QEM3M4N3.js → chunk-4WKM2MJC.js} +9 -7
  26. package/build/modern/chunk-4WKM2MJC.js.map +1 -0
  27. package/build/modern/{chunk-H5WNUPGH.js → chunk-6DAOKE6Z.js} +1 -1
  28. package/build/modern/{chunk-H5WNUPGH.js.map → chunk-6DAOKE6Z.js.map} +1 -1
  29. package/build/modern/chunk-C45HS2C4.js +22 -0
  30. package/build/modern/chunk-C45HS2C4.js.map +1 -0
  31. package/build/modern/{chunk-ZFFW5ELD.js → chunk-CF3EHG42.js} +4 -4
  32. package/build/modern/chunk-D7UIWAFO.js +84 -0
  33. package/build/modern/chunk-D7UIWAFO.js.map +1 -0
  34. package/build/modern/chunk-DJOYRUNT.js +1 -0
  35. package/build/modern/chunk-FCSO6N2Y.js +27 -0
  36. package/build/modern/chunk-FCSO6N2Y.js.map +1 -0
  37. package/build/modern/{chunk-H54FR7IP.js → chunk-MTZDZXZM.js} +8 -6
  38. package/build/modern/{chunk-H54FR7IP.js.map → chunk-MTZDZXZM.js.map} +1 -1
  39. package/build/modern/{chunk-6BN3XKQF.js → chunk-NZKE7C53.js} +8 -8
  40. package/build/modern/chunk-NZKE7C53.js.map +1 -0
  41. package/build/modern/{chunk-O542MPR7.js → chunk-OOUNB643.js} +8 -6
  42. package/build/modern/{chunk-O542MPR7.js.map → chunk-OOUNB643.js.map} +1 -1
  43. package/build/modern/components/FileStatus.js +2 -2
  44. package/build/modern/components/cta-dialog/index.js +8 -5
  45. package/build/modern/components/cta-dialog/provider.js +7 -4
  46. package/build/modern/components/dialog/close-icon-trigger.js +11 -0
  47. package/build/modern/components/dialog/dialog.js +9 -0
  48. package/build/modern/components/dialog/dialog.js.map +1 -0
  49. package/build/modern/components/dialog/index.js +39 -0
  50. package/build/modern/components/dialog/index.js.map +1 -0
  51. package/build/modern/components/dialog/parts.js +8 -0
  52. package/build/modern/components/dialog/parts.js.map +1 -0
  53. package/build/modern/components/{Dialog.js → dialog/primitives.js} +4 -5
  54. package/build/modern/components/dialog/primitives.js.map +1 -0
  55. package/build/modern/components/select/index.js +4 -4
  56. package/build/modern/context/confirm-modal.js +7 -2
  57. package/build/modern/context/notification-center.js +1 -1
  58. package/build/modern/context/prompt-modal.js +7 -2
  59. package/build/modern/index.js +56 -47
  60. package/build/modern/index.js.map +1 -1
  61. package/package.json +2 -2
  62. package/src/components/cta-dialog/provider.tsx +2 -2
  63. package/src/components/{Dialog.client.tsx → dialog/close-icon-trigger.tsx} +11 -13
  64. package/src/components/dialog/dialog.tsx +41 -0
  65. package/src/components/dialog/index.ts +4 -0
  66. package/src/components/dialog/parts.ts +71 -0
  67. package/src/components/dialog/primitives.tsx +116 -0
  68. package/src/context/confirm-modal.tsx +1 -1
  69. package/src/context/notification-center.tsx +3 -3
  70. package/src/context/prompt-modal.tsx +1 -1
  71. package/src/index.ts +1 -2
  72. package/build/legacy/components/Dialog.cjs +0 -86
  73. package/build/legacy/components/Dialog.cjs.map +0 -1
  74. package/build/legacy/components/Dialog.client.cjs.map +0 -1
  75. package/build/modern/chunk-6BN3XKQF.js.map +0 -1
  76. package/build/modern/chunk-QEM3M4N3.js.map +0 -1
  77. package/build/modern/chunk-TFL56AYR.js +0 -56
  78. package/build/modern/chunk-TFL56AYR.js.map +0 -1
  79. package/build/modern/components/Dialog.client.js +0 -10
  80. package/src/components/Dialog.tsx +0 -165
  81. /package/build/modern/{chunk-ZFFW5ELD.js.map → chunk-CF3EHG42.js.map} +0 -0
  82. /package/build/modern/{components/Dialog.client.js.map → chunk-DJOYRUNT.js.map} +0 -0
  83. /package/build/modern/components/{Dialog.js.map → dialog/close-icon-trigger.js.map} +0 -0
@@ -18,23 +18,32 @@ var __copyProps = (to, from, except, desc) => {
18
18
  };
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
20
 
21
- // src/components/Dialog.client.tsx
22
- var Dialog_client_exports = {};
23
- __export(Dialog_client_exports, {
21
+ // src/components/dialog/close-icon-trigger.tsx
22
+ var close_icon_trigger_exports = {};
23
+ __export(close_icon_trigger_exports, {
24
24
  DialogCloseIconTrigger: () => DialogCloseIconTrigger
25
25
  });
26
- module.exports = __toCommonJS(Dialog_client_exports);
27
- var import_react2 = require("@ark-ui/react");
28
- var import_recipes2 = require("@cerberus/styled-system/recipes");
29
- var import_css2 = require("@cerberus/styled-system/css");
26
+ module.exports = __toCommonJS(close_icon_trigger_exports);
27
+
28
+ // src/context/cerberus.tsx
29
+ var import_react = require("react");
30
+ var import_jsx_runtime = require("react/jsx-runtime");
31
+ var CerberusContext = (0, import_react.createContext)(null);
32
+ function useCerberusContext() {
33
+ const context = (0, import_react.useContext)(CerberusContext);
34
+ if (!context) {
35
+ throw new Error("useCerberus must be used within a CerberusProvider");
36
+ }
37
+ return context;
38
+ }
30
39
 
31
40
  // src/components/IconButton.tsx
32
41
  var import_css = require("@cerberus/styled-system/css");
33
42
  var import_recipes = require("@cerberus/styled-system/recipes");
34
- var import_jsx_runtime = require("react/jsx-runtime");
43
+ var import_jsx_runtime2 = require("react/jsx-runtime");
35
44
  function IconButton(props) {
36
45
  const { ariaLabel, palette, usage, size, ...nativeProps } = props;
37
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
46
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
38
47
  "button",
39
48
  {
40
49
  ...nativeProps,
@@ -51,38 +60,37 @@ function IconButton(props) {
51
60
  );
52
61
  }
53
62
 
54
- // src/context/cerberus.tsx
55
- var import_react = require("react");
56
- var import_jsx_runtime2 = require("react/jsx-runtime");
57
- var CerberusContext = (0, import_react.createContext)(null);
58
- function useCerberusContext() {
59
- const context = (0, import_react.useContext)(CerberusContext);
60
- if (!context) {
61
- throw new Error("useCerberus must be used within a CerberusProvider");
62
- }
63
- return context;
63
+ // src/components/dialog/primitives.tsx
64
+ var import_dialog = require("@ark-ui/react/dialog");
65
+ var import_css2 = require("@cerberus/styled-system/css");
66
+ var import_recipes2 = require("@cerberus/styled-system/recipes");
67
+ var import_jsx_runtime3 = require("react/jsx-runtime");
68
+ function DialogCloseTrigger(props) {
69
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dialog.Dialog.CloseTrigger, { ...props });
64
70
  }
65
71
 
66
- // src/components/Dialog.client.tsx
67
- var import_jsx_runtime3 = require("react/jsx-runtime");
72
+ // src/components/dialog/close-icon-trigger.tsx
73
+ var import_recipes3 = require("@cerberus/styled-system/recipes");
74
+ var import_css3 = require("@cerberus/styled-system/css");
75
+ var import_jsx_runtime4 = require("react/jsx-runtime");
68
76
  function DialogCloseIconTrigger(props) {
77
+ const styles = (0, import_recipes3.dialog)();
69
78
  const { icons } = useCerberusContext();
70
79
  const { close: CloseIcon } = icons;
71
- const styles = (0, import_recipes2.dialog)();
72
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
73
- import_react2.Dialog.CloseTrigger,
80
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
81
+ DialogCloseTrigger,
74
82
  {
75
83
  ...props,
76
- className: (0, import_css2.cx)(props.className, styles.closeTrigger),
84
+ className: (0, import_css3.cx)(styles.closeTrigger, props.className),
77
85
  asChild: true,
78
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
86
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
79
87
  IconButton,
80
88
  {
81
89
  ariaLabel: "Close dialog",
82
90
  palette: "action",
83
91
  size: "lg",
84
92
  usage: "ghost",
85
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CloseIcon, {})
93
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CloseIcon, {})
86
94
  }
87
95
  )
88
96
  }
@@ -92,4 +100,4 @@ function DialogCloseIconTrigger(props) {
92
100
  0 && (module.exports = {
93
101
  DialogCloseIconTrigger
94
102
  });
95
- //# sourceMappingURL=Dialog.client.cjs.map
103
+ //# sourceMappingURL=close-icon-trigger.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/dialog/close-icon-trigger.tsx","../../../../src/context/cerberus.tsx","../../../../src/components/IconButton.tsx","../../../../src/components/dialog/primitives.tsx"],"sourcesContent":["'use client'\n\nimport { type DialogCloseTriggerProps } from '@ark-ui/react/dialog'\nimport { useCerberusContext } from '../../context/cerberus'\nimport { IconButton } from '../IconButton'\nimport { DialogCloseTrigger } from './primitives'\nimport { dialog } from '@cerberus/styled-system/recipes'\nimport { cx } from '@cerberus/styled-system/css'\n\n/**\n * This module contains the close trigger for the dialog.\n * @module react/dialog\n */\n\nexport function DialogCloseIconTrigger(props: DialogCloseTriggerProps) {\n const styles = dialog()\n\n const { icons } = useCerberusContext()\n const { close: CloseIcon } = icons\n\n return (\n <DialogCloseTrigger\n {...props}\n className={cx(styles.closeTrigger, props.className)}\n asChild\n >\n <IconButton\n ariaLabel=\"Close dialog\"\n palette=\"action\"\n size=\"lg\"\n usage=\"ghost\"\n >\n <CloseIcon />\n </IconButton>\n </DialogCloseTrigger>\n )\n}\n","'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\nimport type { SystemConfig } from '../config'\n\n/**\n * This module contains the Cerberus configuration context and helpers.\n * @module context/cerberus\n */\n\ntype CerberusContextValue = SystemConfig\n\nconst CerberusContext = createContext<CerberusContextValue | null>(null)\n\ninterface CerberusProviderProps {\n config: SystemConfig\n}\n\n/**\n * Cerberus configuration provider.\n * @param props.config The Cerberus configuration created with\n * `makeSystemConfig` helper.\n */\nexport function CerberusProvider(\n props: PropsWithChildren<CerberusProviderProps>,\n) {\n return (\n <CerberusContext.Provider value={props.config}>\n {props.children}\n </CerberusContext.Provider>\n )\n}\n\n/**\n * Returns the Cerberus configuration context.\n * @returns The Cerberus configuration context.\n */\nexport function useCerberusContext() {\n const context = useContext(CerberusContext)\n if (!context) {\n throw new Error('useCerberus must be used within a CerberusProvider')\n }\n return context\n}\n","import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n iconButton,\n type IconButtonVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport interface IconButtonRawProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The aria-label attribute for the icon button.\n */\n ariaLabel: string\n}\nexport type IconButtonProps = IconButtonRawProps & IconButtonVariantProps\n\n/**\n * A component that allows the user to perform actions using an icon\n * @see https://cerberus.digitalu.design/react/icon-button\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, size, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n","import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n dialog,\n type DialogVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(props: DialogContentProps & DialogVariantProps) {\n const { size, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,mBAAkE;AAyB9D;AAfJ,IAAM,sBAAkB,4BAA2C,IAAI;AAyBhE,SAAS,qBAAqB;AACnC,QAAM,cAAU,yBAAW,eAAe;AAC1C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACtE;AACA,SAAO;AACT;;;AC1CA,iBAAmB;AACnB,qBAGO;AAuBH,IAAAA,sBAAA;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,MAAM,GAAG,YAAY,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,cAAY,aAAa;AAAA,MACzB,eAAW;AAAA,QACT,YAAY;AAAA,YACZ,2BAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;;;ACzCA,oBASO;AACP,IAAAC,cAAmB;AACnB,IAAAC,kBAGO;AAWE,IAAAC,sBAAA;AAkFF,SAAS,mBAAmB,OAA2B;AAC5D,SAAO,6CAAC,qBAAO,cAAP,EAAqB,GAAG,OAAO;AACzC;;;AHvGA,IAAAC,kBAAuB;AACvB,IAAAC,cAAmB;AAyBX,IAAAC,sBAAA;AAlBD,SAAS,uBAAuB,OAAgC;AACrE,QAAM,aAAS,wBAAO;AAEtB,QAAM,EAAE,MAAM,IAAI,mBAAmB;AACrC,QAAM,EAAE,OAAO,UAAU,IAAI;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,gBAAG,OAAO,cAAc,MAAM,SAAS;AAAA,MAClD,SAAO;AAAA,MAEP;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,OAAM;AAAA,UAEN,uDAAC,aAAU;AAAA;AAAA,MACb;AAAA;AAAA,EACF;AAEJ;","names":["import_jsx_runtime","import_css","import_recipes","import_jsx_runtime","import_recipes","import_css","import_jsx_runtime"]}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/dialog/dialog.tsx
21
+ var dialog_exports = {};
22
+ __export(dialog_exports, {
23
+ Dialog: () => Dialog2
24
+ });
25
+ module.exports = __toCommonJS(dialog_exports);
26
+
27
+ // src/components/Portal.tsx
28
+ var import_react = require("@ark-ui/react");
29
+ var Portal = import_react.Portal;
30
+
31
+ // src/components/dialog/primitives.tsx
32
+ var import_dialog = require("@ark-ui/react/dialog");
33
+ var import_css = require("@cerberus/styled-system/css");
34
+ var import_recipes = require("@cerberus/styled-system/recipes");
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ function DialogBackdrop(props) {
37
+ const styles = (0, import_recipes.dialog)();
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
39
+ import_dialog.Dialog.Backdrop,
40
+ {
41
+ ...props,
42
+ className: (0, import_css.cx)(styles.backdrop, props.className)
43
+ }
44
+ );
45
+ }
46
+ function DialogPositioner(props) {
47
+ const styles = (0, import_recipes.dialog)();
48
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
+ import_dialog.Dialog.Positioner,
50
+ {
51
+ ...props,
52
+ className: (0, import_css.cx)(styles.positioner, props.className)
53
+ }
54
+ );
55
+ }
56
+ function DialogContent(props) {
57
+ const { size, ...contentProps } = props;
58
+ const styles = (0, import_recipes.dialog)({ size });
59
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
60
+ import_dialog.Dialog.Content,
61
+ {
62
+ ...contentProps,
63
+ className: (0, import_css.cx)(styles.content, contentProps.className)
64
+ }
65
+ );
66
+ }
67
+
68
+ // src/components/dialog/dialog.tsx
69
+ var import_jsx_runtime2 = require("react/jsx-runtime");
70
+ function Dialog2(props) {
71
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Portal, { children: [
72
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DialogBackdrop, {}),
73
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DialogPositioner, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DialogContent, { ...props }) })
74
+ ] });
75
+ }
76
+ // Annotate the CommonJS export names for ESM import in node:
77
+ 0 && (module.exports = {
78
+ Dialog
79
+ });
80
+ //# sourceMappingURL=dialog.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/dialog/dialog.tsx","../../../../src/components/Portal.tsx","../../../../src/components/dialog/primitives.tsx"],"sourcesContent":["import type { DialogContentProps } from '@ark-ui/react/dialog'\nimport type { DialogVariantProps } from '@cerberus/styled-system/recipes'\nimport { Portal } from '../Portal'\nimport { DialogBackdrop, DialogContent, DialogPositioner } from './primitives'\n\n/**\n * This module contains and abstraction of the Dialog primitives.\n * @module 'dialog'\n */\n\nexport interface DialogProps\n extends Omit<DialogContentProps, 'size'>,\n DialogVariantProps {}\n\n/**\n * An abstraction of the Dialog primitives that controls the content of the\n * dialog. Must be used within the `DialogProvider` component.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @definition [Ark Dialog docs](https://ark-ui.com/react/docs/components/dialog)\n * @example\n * ```tsx\n * <DialogProvider>\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * <Dialog>\n * <Text>Dialog Content</Text>\n * </Dialog>\n * </DialogProvider>\n * ```\n */\nexport function Dialog(props: DialogProps) {\n return (\n <Portal>\n <DialogBackdrop />\n <DialogPositioner>\n <DialogContent {...props} />\n </DialogPositioner>\n </Portal>\n )\n}\n","import {\n Portal as ArkPortal,\n type PortalProps as ArkPortalProps,\n} from '@ark-ui/react'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport type PortalProps = ArkPortalProps\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 const Portal = ArkPortal\n","import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n dialog,\n type DialogVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(props: DialogContentProps & DialogVariantProps) {\n const { size, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA;AAAA;;;ACAA,mBAGO;AA2BA,IAAM,SAAS,aAAAC;;;AC9BtB,oBASO;AACP,iBAAmB;AACnB,qBAGO;AAWE;AAmBF,SAAS,eAAe,OAA4B;AACzD,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,UAAU,MAAM,SAAS;AAAA;AAAA,EAChD;AAEJ;AAKO,SAAS,iBAAiB,OAA8B;AAC7D,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,YAAY,MAAM,SAAS;AAAA;AAAA,EAClD;AAEJ;AAKO,SAAS,cAAc,OAAgD;AAC5E,QAAM,EAAE,MAAM,GAAG,aAAa,IAAI;AAClC,QAAM,aAAS,uBAAO,EAAE,KAAK,CAAC;AAC9B,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,SAAS,aAAa,SAAS;AAAA;AAAA,EACtD;AAEJ;;;AF9CI,IAAAC,sBAAA;AAFG,SAASC,QAAO,OAAoB;AACzC,SACE,8CAAC,UACC;AAAA,iDAAC,kBAAe;AAAA,IAChB,6CAAC,oBACC,uDAAC,iBAAe,GAAG,OAAO,GAC5B;AAAA,KACF;AAEJ;","names":["Dialog","ArkPortal","import_jsx_runtime","Dialog"]}
@@ -0,0 +1,208 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/dialog/index.ts
21
+ var dialog_exports = {};
22
+ __export(dialog_exports, {
23
+ Dialog: () => Dialog2,
24
+ DialogBackdrop: () => DialogBackdrop,
25
+ DialogCloseIconTrigger: () => DialogCloseIconTrigger,
26
+ DialogCloseTrigger: () => DialogCloseTrigger,
27
+ DialogContent: () => DialogContent,
28
+ DialogDescription: () => DialogDescription,
29
+ DialogHeading: () => DialogHeading,
30
+ DialogParts: () => DialogParts,
31
+ DialogPositioner: () => DialogPositioner,
32
+ DialogProvider: () => DialogProvider,
33
+ DialogRoot: () => DialogRoot,
34
+ DialogTrigger: () => DialogTrigger
35
+ });
36
+ module.exports = __toCommonJS(dialog_exports);
37
+
38
+ // src/components/dialog/primitives.tsx
39
+ var import_dialog = require("@ark-ui/react/dialog");
40
+ var import_css = require("@cerberus/styled-system/css");
41
+ var import_recipes = require("@cerberus/styled-system/recipes");
42
+ var import_jsx_runtime = require("react/jsx-runtime");
43
+ function DialogRoot(props) {
44
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Root, { ...props });
45
+ }
46
+ function DialogTrigger(props) {
47
+ const styles = (0, import_recipes.dialog)();
48
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
+ import_dialog.Dialog.Trigger,
50
+ {
51
+ ...props,
52
+ className: (0, import_css.cx)(styles.trigger, props.className)
53
+ }
54
+ );
55
+ }
56
+ function DialogBackdrop(props) {
57
+ const styles = (0, import_recipes.dialog)();
58
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
59
+ import_dialog.Dialog.Backdrop,
60
+ {
61
+ ...props,
62
+ className: (0, import_css.cx)(styles.backdrop, props.className)
63
+ }
64
+ );
65
+ }
66
+ function DialogPositioner(props) {
67
+ const styles = (0, import_recipes.dialog)();
68
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
+ import_dialog.Dialog.Positioner,
70
+ {
71
+ ...props,
72
+ className: (0, import_css.cx)(styles.positioner, props.className)
73
+ }
74
+ );
75
+ }
76
+ function DialogContent(props) {
77
+ const { size, ...contentProps } = props;
78
+ const styles = (0, import_recipes.dialog)({ size });
79
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
80
+ import_dialog.Dialog.Content,
81
+ {
82
+ ...contentProps,
83
+ className: (0, import_css.cx)(styles.content, contentProps.className)
84
+ }
85
+ );
86
+ }
87
+ function DialogHeading(props) {
88
+ const styles = (0, import_recipes.dialog)();
89
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Title, { ...props, className: (0, import_css.cx)(styles.title, props.className) });
90
+ }
91
+ function DialogDescription(props) {
92
+ const styles = (0, import_recipes.dialog)();
93
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
94
+ import_dialog.Dialog.Description,
95
+ {
96
+ ...props,
97
+ className: (0, import_css.cx)(styles.description, props.className)
98
+ }
99
+ );
100
+ }
101
+ function DialogCloseTrigger(props) {
102
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.CloseTrigger, { ...props });
103
+ }
104
+ var DialogProvider = DialogRoot;
105
+
106
+ // src/components/dialog/parts.ts
107
+ var DialogParts = {
108
+ Root: DialogRoot,
109
+ Trigger: DialogTrigger,
110
+ Backdrop: DialogBackdrop,
111
+ Positioner: DialogPositioner,
112
+ Content: DialogContent,
113
+ Heading: DialogHeading,
114
+ Description: DialogDescription,
115
+ CloseTrigger: DialogCloseTrigger
116
+ };
117
+
118
+ // src/context/cerberus.tsx
119
+ var import_react = require("react");
120
+ var import_jsx_runtime2 = require("react/jsx-runtime");
121
+ var CerberusContext = (0, import_react.createContext)(null);
122
+ function useCerberusContext() {
123
+ const context = (0, import_react.useContext)(CerberusContext);
124
+ if (!context) {
125
+ throw new Error("useCerberus must be used within a CerberusProvider");
126
+ }
127
+ return context;
128
+ }
129
+
130
+ // src/components/IconButton.tsx
131
+ var import_css2 = require("@cerberus/styled-system/css");
132
+ var import_recipes2 = require("@cerberus/styled-system/recipes");
133
+ var import_jsx_runtime3 = require("react/jsx-runtime");
134
+ function IconButton(props) {
135
+ const { ariaLabel, palette, usage, size, ...nativeProps } = props;
136
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
137
+ "button",
138
+ {
139
+ ...nativeProps,
140
+ "aria-label": ariaLabel ?? "Icon Button",
141
+ className: (0, import_css2.cx)(
142
+ nativeProps.className,
143
+ (0, import_recipes2.iconButton)({
144
+ palette,
145
+ usage,
146
+ size
147
+ })
148
+ )
149
+ }
150
+ );
151
+ }
152
+
153
+ // src/components/dialog/close-icon-trigger.tsx
154
+ var import_recipes3 = require("@cerberus/styled-system/recipes");
155
+ var import_css3 = require("@cerberus/styled-system/css");
156
+ var import_jsx_runtime4 = require("react/jsx-runtime");
157
+ function DialogCloseIconTrigger(props) {
158
+ const styles = (0, import_recipes3.dialog)();
159
+ const { icons } = useCerberusContext();
160
+ const { close: CloseIcon } = icons;
161
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
162
+ DialogCloseTrigger,
163
+ {
164
+ ...props,
165
+ className: (0, import_css3.cx)(styles.closeTrigger, props.className),
166
+ asChild: true,
167
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
168
+ IconButton,
169
+ {
170
+ ariaLabel: "Close dialog",
171
+ palette: "action",
172
+ size: "lg",
173
+ usage: "ghost",
174
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CloseIcon, {})
175
+ }
176
+ )
177
+ }
178
+ );
179
+ }
180
+
181
+ // src/components/Portal.tsx
182
+ var import_react2 = require("@ark-ui/react");
183
+ var Portal = import_react2.Portal;
184
+
185
+ // src/components/dialog/dialog.tsx
186
+ var import_jsx_runtime5 = require("react/jsx-runtime");
187
+ function Dialog2(props) {
188
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Portal, { children: [
189
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DialogBackdrop, {}),
190
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DialogPositioner, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DialogContent, { ...props }) })
191
+ ] });
192
+ }
193
+ // Annotate the CommonJS export names for ESM import in node:
194
+ 0 && (module.exports = {
195
+ Dialog,
196
+ DialogBackdrop,
197
+ DialogCloseIconTrigger,
198
+ DialogCloseTrigger,
199
+ DialogContent,
200
+ DialogDescription,
201
+ DialogHeading,
202
+ DialogParts,
203
+ DialogPositioner,
204
+ DialogProvider,
205
+ DialogRoot,
206
+ DialogTrigger
207
+ });
208
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/dialog/index.ts","../../../../src/components/dialog/primitives.tsx","../../../../src/components/dialog/parts.ts","../../../../src/context/cerberus.tsx","../../../../src/components/IconButton.tsx","../../../../src/components/dialog/close-icon-trigger.tsx","../../../../src/components/Portal.tsx","../../../../src/components/dialog/dialog.tsx"],"sourcesContent":["export * from './parts'\nexport * from './primitives'\nexport * from './close-icon-trigger'\nexport * from './dialog'\n","import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n dialog,\n type DialogVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(props: DialogContentProps & DialogVariantProps) {\n const { size, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n","import type { ElementType } from 'react'\nimport {\n DialogBackdrop,\n DialogCloseTrigger,\n DialogContent,\n DialogDescription,\n DialogHeading,\n DialogPositioner,\n DialogRoot,\n DialogTrigger,\n} from './primitives'\n\n/**\n * This module contains the parts of the Dialog component.\n * @module 'dialog/parts'\n */\n\ninterface DialogPartsValue {\n /**\n * The context provider of the dialog.\n */\n Root: ElementType\n /**\n * The trigger that opens the dialog.\n */\n Trigger: ElementType\n /**\n * The overlay of the dialog.\n */\n Backdrop: ElementType\n /**\n * The container that positions the dialog.\n */\n Positioner: ElementType\n /**\n * The visible content of the dialog.\n */\n Content: ElementType\n /**\n * The heading of the dialog.\n */\n Heading: ElementType\n /**\n * The description of the dialog.\n */\n Description: ElementType\n /**\n * The trigger that closes the dialog.\n */\n CloseTrigger: ElementType\n}\n\n/**\n * An Object containing the parts of the dialog component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the DialogParts object and\n * the entire family of components vs. only what you use.\n */\nexport const DialogParts: DialogPartsValue = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Backdrop: DialogBackdrop,\n Positioner: DialogPositioner,\n Content: DialogContent,\n Heading: DialogHeading,\n Description: DialogDescription,\n CloseTrigger: DialogCloseTrigger,\n}\n","'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\nimport type { SystemConfig } from '../config'\n\n/**\n * This module contains the Cerberus configuration context and helpers.\n * @module context/cerberus\n */\n\ntype CerberusContextValue = SystemConfig\n\nconst CerberusContext = createContext<CerberusContextValue | null>(null)\n\ninterface CerberusProviderProps {\n config: SystemConfig\n}\n\n/**\n * Cerberus configuration provider.\n * @param props.config The Cerberus configuration created with\n * `makeSystemConfig` helper.\n */\nexport function CerberusProvider(\n props: PropsWithChildren<CerberusProviderProps>,\n) {\n return (\n <CerberusContext.Provider value={props.config}>\n {props.children}\n </CerberusContext.Provider>\n )\n}\n\n/**\n * Returns the Cerberus configuration context.\n * @returns The Cerberus configuration context.\n */\nexport function useCerberusContext() {\n const context = useContext(CerberusContext)\n if (!context) {\n throw new Error('useCerberus must be used within a CerberusProvider')\n }\n return context\n}\n","import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n iconButton,\n type IconButtonVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport interface IconButtonRawProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The aria-label attribute for the icon button.\n */\n ariaLabel: string\n}\nexport type IconButtonProps = IconButtonRawProps & IconButtonVariantProps\n\n/**\n * A component that allows the user to perform actions using an icon\n * @see https://cerberus.digitalu.design/react/icon-button\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, size, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n","'use client'\n\nimport { type DialogCloseTriggerProps } from '@ark-ui/react/dialog'\nimport { useCerberusContext } from '../../context/cerberus'\nimport { IconButton } from '../IconButton'\nimport { DialogCloseTrigger } from './primitives'\nimport { dialog } from '@cerberus/styled-system/recipes'\nimport { cx } from '@cerberus/styled-system/css'\n\n/**\n * This module contains the close trigger for the dialog.\n * @module react/dialog\n */\n\nexport function DialogCloseIconTrigger(props: DialogCloseTriggerProps) {\n const styles = dialog()\n\n const { icons } = useCerberusContext()\n const { close: CloseIcon } = icons\n\n return (\n <DialogCloseTrigger\n {...props}\n className={cx(styles.closeTrigger, props.className)}\n asChild\n >\n <IconButton\n ariaLabel=\"Close dialog\"\n palette=\"action\"\n size=\"lg\"\n usage=\"ghost\"\n >\n <CloseIcon />\n </IconButton>\n </DialogCloseTrigger>\n )\n}\n","import {\n Portal as ArkPortal,\n type PortalProps as ArkPortalProps,\n} from '@ark-ui/react'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport type PortalProps = ArkPortalProps\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 const Portal = ArkPortal\n","import type { DialogContentProps } from '@ark-ui/react/dialog'\nimport type { DialogVariantProps } from '@cerberus/styled-system/recipes'\nimport { Portal } from '../Portal'\nimport { DialogBackdrop, DialogContent, DialogPositioner } from './primitives'\n\n/**\n * This module contains and abstraction of the Dialog primitives.\n * @module 'dialog'\n */\n\nexport interface DialogProps\n extends Omit<DialogContentProps, 'size'>,\n DialogVariantProps {}\n\n/**\n * An abstraction of the Dialog primitives that controls the content of the\n * dialog. Must be used within the `DialogProvider` component.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @definition [Ark Dialog docs](https://ark-ui.com/react/docs/components/dialog)\n * @example\n * ```tsx\n * <DialogProvider>\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * <Dialog>\n * <Text>Dialog Content</Text>\n * </Dialog>\n * </DialogProvider>\n * ```\n */\nexport function Dialog(props: DialogProps) {\n return (\n <Portal>\n <DialogBackdrop />\n <DialogPositioner>\n <DialogContent {...props} />\n </DialogPositioner>\n </Portal>\n )\n}\n"],"mappings":"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","names":["Dialog","import_jsx_runtime","import_css","import_recipes","import_jsx_runtime","import_recipes","import_css","import_jsx_runtime","import_react","ArkPortal","import_jsx_runtime","Dialog"]}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/dialog/parts.ts
21
+ var parts_exports = {};
22
+ __export(parts_exports, {
23
+ DialogParts: () => DialogParts
24
+ });
25
+ module.exports = __toCommonJS(parts_exports);
26
+
27
+ // src/components/dialog/primitives.tsx
28
+ var import_dialog = require("@ark-ui/react/dialog");
29
+ var import_css = require("@cerberus/styled-system/css");
30
+ var import_recipes = require("@cerberus/styled-system/recipes");
31
+ var import_jsx_runtime = require("react/jsx-runtime");
32
+ function DialogRoot(props) {
33
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Root, { ...props });
34
+ }
35
+ function DialogTrigger(props) {
36
+ const styles = (0, import_recipes.dialog)();
37
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
38
+ import_dialog.Dialog.Trigger,
39
+ {
40
+ ...props,
41
+ className: (0, import_css.cx)(styles.trigger, props.className)
42
+ }
43
+ );
44
+ }
45
+ function DialogBackdrop(props) {
46
+ const styles = (0, import_recipes.dialog)();
47
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
48
+ import_dialog.Dialog.Backdrop,
49
+ {
50
+ ...props,
51
+ className: (0, import_css.cx)(styles.backdrop, props.className)
52
+ }
53
+ );
54
+ }
55
+ function DialogPositioner(props) {
56
+ const styles = (0, import_recipes.dialog)();
57
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
58
+ import_dialog.Dialog.Positioner,
59
+ {
60
+ ...props,
61
+ className: (0, import_css.cx)(styles.positioner, props.className)
62
+ }
63
+ );
64
+ }
65
+ function DialogContent(props) {
66
+ const { size, ...contentProps } = props;
67
+ const styles = (0, import_recipes.dialog)({ size });
68
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
+ import_dialog.Dialog.Content,
70
+ {
71
+ ...contentProps,
72
+ className: (0, import_css.cx)(styles.content, contentProps.className)
73
+ }
74
+ );
75
+ }
76
+ function DialogHeading(props) {
77
+ const styles = (0, import_recipes.dialog)();
78
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Title, { ...props, className: (0, import_css.cx)(styles.title, props.className) });
79
+ }
80
+ function DialogDescription(props) {
81
+ const styles = (0, import_recipes.dialog)();
82
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
83
+ import_dialog.Dialog.Description,
84
+ {
85
+ ...props,
86
+ className: (0, import_css.cx)(styles.description, props.className)
87
+ }
88
+ );
89
+ }
90
+ function DialogCloseTrigger(props) {
91
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.CloseTrigger, { ...props });
92
+ }
93
+
94
+ // src/components/dialog/parts.ts
95
+ var DialogParts = {
96
+ Root: DialogRoot,
97
+ Trigger: DialogTrigger,
98
+ Backdrop: DialogBackdrop,
99
+ Positioner: DialogPositioner,
100
+ Content: DialogContent,
101
+ Heading: DialogHeading,
102
+ Description: DialogDescription,
103
+ CloseTrigger: DialogCloseTrigger
104
+ };
105
+ // Annotate the CommonJS export names for ESM import in node:
106
+ 0 && (module.exports = {
107
+ DialogParts
108
+ });
109
+ //# sourceMappingURL=parts.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/dialog/parts.ts","../../../../src/components/dialog/primitives.tsx"],"sourcesContent":["import type { ElementType } from 'react'\nimport {\n DialogBackdrop,\n DialogCloseTrigger,\n DialogContent,\n DialogDescription,\n DialogHeading,\n DialogPositioner,\n DialogRoot,\n DialogTrigger,\n} from './primitives'\n\n/**\n * This module contains the parts of the Dialog component.\n * @module 'dialog/parts'\n */\n\ninterface DialogPartsValue {\n /**\n * The context provider of the dialog.\n */\n Root: ElementType\n /**\n * The trigger that opens the dialog.\n */\n Trigger: ElementType\n /**\n * The overlay of the dialog.\n */\n Backdrop: ElementType\n /**\n * The container that positions the dialog.\n */\n Positioner: ElementType\n /**\n * The visible content of the dialog.\n */\n Content: ElementType\n /**\n * The heading of the dialog.\n */\n Heading: ElementType\n /**\n * The description of the dialog.\n */\n Description: ElementType\n /**\n * The trigger that closes the dialog.\n */\n CloseTrigger: ElementType\n}\n\n/**\n * An Object containing the parts of the dialog component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the DialogParts object and\n * the entire family of components vs. only what you use.\n */\nexport const DialogParts: DialogPartsValue = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Backdrop: DialogBackdrop,\n Positioner: DialogPositioner,\n Content: DialogContent,\n Heading: DialogHeading,\n Description: DialogDescription,\n CloseTrigger: DialogCloseTrigger,\n}\n","import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n dialog,\n type DialogVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(props: DialogContentProps & DialogVariantProps) {\n const { size, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBASO;AACP,iBAAmB;AACnB,qBAGO;AAWE;AADF,SAAS,WAAW,OAAwB;AACjD,SAAO,4CAAC,qBAAO,MAAP,EAAa,GAAG,OAAO;AACjC;AAKO,SAAS,cAAc,OAA2B;AACvD,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,SAAS,MAAM,SAAS;AAAA;AAAA,EAC/C;AAEJ;AAKO,SAAS,eAAe,OAA4B;AACzD,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,UAAU,MAAM,SAAS;AAAA;AAAA,EAChD;AAEJ;AAKO,SAAS,iBAAiB,OAA8B;AAC7D,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,YAAY,MAAM,SAAS;AAAA;AAAA,EAClD;AAEJ;AAKO,SAAS,cAAc,OAAgD;AAC5E,QAAM,EAAE,MAAM,GAAG,aAAa,IAAI;AAClC,QAAM,aAAS,uBAAO,EAAE,KAAK,CAAC;AAC9B,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,SAAS,aAAa,SAAS;AAAA;AAAA,EACtD;AAEJ;AAKO,SAAS,cAAc,OAAyB;AACrD,QAAM,aAAS,uBAAO;AACtB,SACE,4CAAC,qBAAO,OAAP,EAAc,GAAG,OAAO,eAAW,eAAG,OAAO,OAAO,MAAM,SAAS,GAAG;AAE3E;AAKO,SAAS,kBAAkB,OAA+B;AAC/D,QAAM,aAAS,uBAAO;AACtB,SACE;AAAA,IAAC,qBAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,aAAa,MAAM,SAAS;AAAA;AAAA,EACnD;AAEJ;AAKO,SAAS,mBAAmB,OAA2B;AAC5D,SAAO,4CAAC,qBAAO,cAAP,EAAqB,GAAG,OAAO;AACzC;;;ADhDO,IAAM,cAAgC;AAAA,EAC3C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AAAA,EACb,cAAc;AAChB;","names":[]}