@cerberus-design/react 0.14.2-next-2f75188 → 0.14.2-next-f58c1be

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.
@@ -1,18 +1,10 @@
1
1
  import {
2
- Modal
3
- } from "./chunk-JIRW4XOJ.js";
4
- import {
5
- ModalDescription
6
- } from "./chunk-ZL6ZITLA.js";
7
- import {
8
- ModalHeader
9
- } from "./chunk-NUMM4TNC.js";
10
- import {
11
- ModalHeading
12
- } from "./chunk-7NN3SJ7W.js";
13
- import {
14
- Portal
15
- } from "./chunk-IQJDVFPP.js";
2
+ Dialog,
3
+ DialogCloseTrigger,
4
+ DialogDescription,
5
+ DialogHeading,
6
+ DialogProvider
7
+ } from "./chunk-TFL56AYR.js";
16
8
  import {
17
9
  Avatar
18
10
  } from "./chunk-GCQMH4QA.js";
@@ -25,12 +17,6 @@ import {
25
17
  import {
26
18
  Button
27
19
  } from "./chunk-EXGKZGML.js";
28
- import {
29
- useModal
30
- } from "./chunk-KGQG5JGW.js";
31
- import {
32
- trapFocus
33
- } from "./chunk-JIZQFTW6.js";
34
20
 
35
21
  // src/context/confirm-modal.tsx
36
22
  import {
@@ -42,15 +28,13 @@ import {
42
28
  useState
43
29
  } from "react";
44
30
  import { css } from "@cerberus/styled-system/css";
45
- import { hstack } from "@cerberus/styled-system/patterns";
46
31
  import { HStack, VStack } from "@cerberus/styled-system/jsx";
47
32
  import { jsx, jsxs } from "react/jsx-runtime";
48
33
  var ConfirmModalContext = createContext(null);
49
34
  function ConfirmModal(props) {
50
- const { modalRef, show, close } = useModal();
51
- const resolveRef = useRef(null);
35
+ const [open, setOpen] = useState(false);
52
36
  const [content, setContent] = useState(null);
53
- const focusTrap = trapFocus(modalRef);
37
+ const resolveRef = useRef(null);
54
38
  const kind = content?.kind ?? "non-destructive";
55
39
  const { icons } = useCerberusContext();
56
40
  const { confirmModal: ConfirmIcon } = icons;
@@ -65,19 +49,19 @@ function ConfirmModal(props) {
65
49
  resolveRef.current?.(true);
66
50
  }
67
51
  resolveRef.current?.(false);
68
- close();
52
+ setOpen(false);
69
53
  },
70
- [close]
54
+ [setOpen]
71
55
  );
72
56
  const handleShow = useCallback(
73
57
  (options) => {
74
58
  return new Promise((resolve) => {
75
59
  setContent({ ...options });
76
- show();
60
+ setOpen(true);
77
61
  resolveRef.current = resolve;
78
62
  });
79
63
  },
80
- [show]
64
+ [setOpen, setContent]
81
65
  );
82
66
  const value = useMemo(
83
67
  () => ({
@@ -87,15 +71,15 @@ function ConfirmModal(props) {
87
71
  );
88
72
  return /* @__PURE__ */ jsxs(ConfirmModalContext.Provider, { value, children: [
89
73
  props.children,
90
- /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Modal, { onKeyDown: focusTrap, ref: modalRef, children: /* @__PURE__ */ jsxs(VStack, { gap: "xl", w: "full", children: [
91
- /* @__PURE__ */ jsxs(ModalHeader, { children: [
74
+ /* @__PURE__ */ jsx(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ jsx(Dialog, { size: "sm", children: /* @__PURE__ */ jsxs(VStack, { gap: "xl", w: "full", children: [
75
+ /* @__PURE__ */ jsxs(VStack, { alignItems: "flex-start", gap: "md", w: "full", children: [
92
76
  /* @__PURE__ */ jsx(
93
- "div",
77
+ HStack,
94
78
  {
95
- className: hstack({
96
- justify: "center",
97
- w: "full"
98
- }),
79
+ alignSelf: "center",
80
+ justify: "center",
81
+ paddingBlockEnd: "md",
82
+ w: "full",
99
83
  children: /* @__PURE__ */ jsx(
100
84
  Show,
101
85
  {
@@ -122,8 +106,8 @@ function ConfirmModal(props) {
122
106
  )
123
107
  }
124
108
  ),
125
- /* @__PURE__ */ jsx(ModalHeading, { children: content?.heading }),
126
- /* @__PURE__ */ jsx(ModalDescription, { children: content?.description })
109
+ /* @__PURE__ */ jsx(DialogHeading, { children: content?.heading }),
110
+ /* @__PURE__ */ jsx(DialogDescription, { children: content?.description })
127
111
  ] }),
128
112
  /* @__PURE__ */ jsxs(HStack, { gap: "4", w: "full", children: [
129
113
  /* @__PURE__ */ jsx(
@@ -140,7 +124,7 @@ function ConfirmModal(props) {
140
124
  children: content?.actionText
141
125
  }
142
126
  ),
143
- /* @__PURE__ */ jsx(
127
+ /* @__PURE__ */ jsx(DialogCloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
144
128
  Button,
145
129
  {
146
130
  className: css({
@@ -152,7 +136,7 @@ function ConfirmModal(props) {
152
136
  value: "false",
153
137
  children: content?.cancelText
154
138
  }
155
- )
139
+ ) })
156
140
  ] })
157
141
  ] }) }) })
158
142
  ] });
@@ -171,4 +155,4 @@ export {
171
155
  ConfirmModal,
172
156
  useConfirmModal
173
157
  };
174
- //# sourceMappingURL=chunk-MUTAYS3P.js.map
158
+ //# sourceMappingURL=chunk-BHB56M7S.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/context/confirm-modal.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n type MouseEvent,\n type PropsWithChildren,\n type ReactNode,\n} from 'react'\nimport { Button } from '../components/Button'\nimport { css } from '@cerberus/styled-system/css'\nimport { Show } from '../components/Show'\nimport { Avatar } from '../components/Avatar'\nimport { HStack, VStack } from '@cerberus/styled-system/jsx'\nimport { useCerberusContext } from './cerberus'\nimport {\n Dialog,\n DialogCloseTrigger,\n DialogDescription,\n DialogHeading,\n DialogProvider,\n} from '../components/Dialog'\n\n/**\n * This module provides a context and hook for the confirm modal.\n * @module\n */\n\nexport interface BaseConfirmOptions {\n /**\n * The heading of the confirm modal.\n */\n heading: string\n /**\n * The text for the action button.\n */\n actionText: string\n /**\n * The text for the cancel button.\n */\n cancelText: string\n}\n\nexport interface DestructiveConfirmOptions extends BaseConfirmOptions {\n /**\n * The kind of confirm modal to show.\n */\n kind?: 'destructive'\n /**\n * The description of the confirm modal. Can only be a string for destructive confirm modals.\n */\n description?: string\n}\n\nexport interface NonDestructiveConfirmModalOptions extends BaseConfirmOptions {\n /**\n * The kind of confirm modal to show.\n * @default 'non-destructive'\n */\n kind?: 'non-destructive'\n /**\n * The description of the confirm modal. Can be a ReactNode for non-destructive kind if you need to display text links.\n * @example\n * ```tsx\n * description: <>Use a Fragment because we put the content within a Paragraph tag.</>\n */\n description?: ReactNode\n}\n\nexport type ShowConfirmModalOptions =\n | NonDestructiveConfirmModalOptions\n | DestructiveConfirmOptions\n\nexport type ShowResult =\n | ((value: boolean | PromiseLike<boolean>) => void)\n | null\n\nexport interface ConfirmModalValue {\n show: (options: ShowConfirmModalOptions) => Promise<boolean>\n}\n\nconst ConfirmModalContext = createContext<ConfirmModalValue | null>(null)\n\nexport type ConfirmModalProviderProps = PropsWithChildren<unknown>\n\n/**\n * Provides a confirm modal to the app.\n * @see https://cerberus.digitalu.design/react/confirm-modal\n * @example\n * ```tsx\n * // Wrap the Provider around the root of the feature.\n * <ConfirmModal>\n * <SomeFeatureSection />\n * </ConfirmModal>\n *\n * // Use the hook to show the confirm modal.\n * const confirm = useConfirmModal()\n *\n * const handleClick = useCallback(async () => {\n * const userConsent = await confirm.show({\n * heading: 'Add new payment method?',\n * description:\n * 'This will add a new payment method to your account to be billed for future purchases.',\n * actionText: 'Yes, add payment method',\n * cancelText: 'No, cancel',\n * })\n * setConsent(userConsent)\n * }, [confirm])\n * ```\n */\nexport function ConfirmModal(\n props: PropsWithChildren<ConfirmModalProviderProps>,\n) {\n const [open, setOpen] = useState<boolean>(false)\n const [content, setContent] = useState<ShowConfirmModalOptions | null>(null)\n const resolveRef = useRef<ShowResult>(null)\n const kind = content?.kind ?? 'non-destructive'\n\n const { icons } = useCerberusContext()\n const { confirmModal: ConfirmIcon } = icons\n\n const palette = useMemo(\n () => (kind === 'destructive' ? 'danger' : 'action'),\n [kind],\n )\n\n const handleChoice = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n const target = e.currentTarget as HTMLButtonElement\n if (target.value === 'true') {\n resolveRef.current?.(true)\n }\n resolveRef.current?.(false)\n setOpen(false)\n },\n [setOpen],\n )\n\n const handleShow = useCallback(\n (options: ShowConfirmModalOptions) => {\n return new Promise<boolean>((resolve) => {\n setContent({ ...options })\n setOpen(true)\n resolveRef.current = resolve\n })\n },\n [setOpen, setContent],\n )\n\n const value = useMemo(\n () => ({\n show: handleShow,\n }),\n [handleShow],\n )\n\n return (\n <ConfirmModalContext.Provider value={value}>\n {props.children}\n\n <DialogProvider open={open} onOpenChange={(e) => setOpen(e.open)}>\n <Dialog size=\"sm\">\n <VStack gap=\"xl\" w=\"full\">\n <VStack alignItems=\"flex-start\" gap=\"md\" w=\"full\">\n <HStack\n alignSelf=\"center\"\n justify=\"center\"\n paddingBlockEnd=\"md\"\n w=\"full\"\n >\n <Show\n when={palette === 'danger'}\n fallback={\n <Avatar\n ariaLabel=\"\"\n gradient=\"charon-light\"\n icon={<ConfirmIcon size={24} />}\n src=\"\"\n />\n }\n >\n <Avatar\n ariaLabel=\"\"\n gradient=\"hades-dark\"\n icon={<ConfirmIcon size={24} />}\n src=\"\"\n />\n </Show>\n </HStack>\n <DialogHeading>{content?.heading}</DialogHeading>\n <DialogDescription>{content?.description}</DialogDescription>\n </VStack>\n\n <HStack gap=\"4\" w=\"full\">\n <Button\n autoFocus\n className={css({\n w: '1/2',\n })}\n name=\"confirm\"\n onClick={handleChoice}\n palette={palette}\n value=\"true\"\n >\n {content?.actionText}\n </Button>\n <DialogCloseTrigger asChild>\n <Button\n className={css({\n w: '1/2',\n })}\n name=\"cancel\"\n onClick={handleChoice}\n usage=\"outlined\"\n value=\"false\"\n >\n {content?.cancelText}\n </Button>\n </DialogCloseTrigger>\n </HStack>\n </VStack>\n </Dialog>\n </DialogProvider>\n </ConfirmModalContext.Provider>\n )\n}\n\nexport function useConfirmModal(): ConfirmModalValue {\n const context = useContext(ConfirmModalContext)\n if (context === null) {\n throw new Error(\n 'useConfirmModal must be used within a ConfirmModal Provider',\n )\n }\n return context\n}\n"],"mappings":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ACF;AAEJ;AAEO,SAAS,kBAAqC;AACnD,QAAM,UAAU,WAAW,mBAAmB;AAC9C,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
@@ -1,21 +1,12 @@
1
1
  import {
2
- Modal
3
- } from "./chunk-JIRW4XOJ.js";
2
+ DialogCloseIconTrigger
3
+ } from "./chunk-6BN3XKQF.js";
4
4
  import {
5
- ModalDescription
6
- } from "./chunk-ZL6ZITLA.js";
7
- import {
8
- ModalHeader
9
- } from "./chunk-NUMM4TNC.js";
10
- import {
11
- ModalHeading
12
- } from "./chunk-7NN3SJ7W.js";
13
- import {
14
- IconButton
15
- } from "./chunk-APD6IX5R.js";
16
- import {
17
- Portal
18
- } from "./chunk-IQJDVFPP.js";
5
+ Dialog,
6
+ DialogDescription,
7
+ DialogHeading,
8
+ DialogProvider
9
+ } from "./chunk-TFL56AYR.js";
19
10
  import {
20
11
  Avatar
21
12
  } from "./chunk-GCQMH4QA.js";
@@ -28,12 +19,6 @@ import {
28
19
  import {
29
20
  Button
30
21
  } from "./chunk-EXGKZGML.js";
31
- import {
32
- useModal
33
- } from "./chunk-KGQG5JGW.js";
34
- import {
35
- trapFocus
36
- } from "./chunk-JIZQFTW6.js";
37
22
 
38
23
  // src/context/cta-modal.tsx
39
24
  import {
@@ -49,12 +34,11 @@ import { VStack } from "@cerberus/styled-system/jsx";
49
34
  import { jsx, jsxs } from "react/jsx-runtime";
50
35
  var CTAModalContext = createContext(null);
51
36
  function CTAModal(props) {
52
- const { modalRef, show, close } = useModal();
37
+ const [open, setOpen] = useState(false);
53
38
  const [content, setContent] = useState(null);
54
- const focusTrap = trapFocus(modalRef);
55
39
  const confirmIcon = content?.icon;
56
40
  const { icons } = useCerberusContext();
57
- const { close: CloseIcon, confirmModal: FallbackIcon } = icons;
41
+ const { confirmModal: FallbackIcon } = icons;
58
42
  const handleShow = useCallback(
59
43
  (options) => {
60
44
  const maxActions = 2;
@@ -64,9 +48,9 @@ function CTAModal(props) {
64
48
  );
65
49
  }
66
50
  setContent({ ...options });
67
- show();
51
+ setOpen(true);
68
52
  },
69
- [show]
53
+ [setOpen]
70
54
  );
71
55
  const handleActionClick = useCallback(
72
56
  (event) => {
@@ -74,9 +58,9 @@ function CTAModal(props) {
74
58
  const action = content?.actions[Number(index)];
75
59
  const { onClick } = action || {};
76
60
  onClick?.(event);
77
- close();
61
+ setOpen(false);
78
62
  },
79
- [content, close]
63
+ [content, setOpen]
80
64
  );
81
65
  const value = useMemo(
82
66
  () => ({
@@ -86,22 +70,10 @@ function CTAModal(props) {
86
70
  );
87
71
  return /* @__PURE__ */ jsxs(CTAModalContext.Provider, { value, children: [
88
72
  props.children,
89
- /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsxs(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
90
- /* @__PURE__ */ jsx(
91
- "span",
92
- {
93
- className: css({
94
- padding: "md",
95
- position: "absolute",
96
- right: 0,
97
- top: 0,
98
- zIndex: "decorator"
99
- }),
100
- children: /* @__PURE__ */ jsx(IconButton, { ariaLabel: "Close modal", onClick: close, children: /* @__PURE__ */ jsx(CloseIcon, {}) })
101
- }
102
- ),
73
+ /* @__PURE__ */ jsx(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ jsxs(Dialog, { size: "sm", children: [
74
+ /* @__PURE__ */ jsx(DialogCloseIconTrigger, {}),
103
75
  /* @__PURE__ */ jsxs(VStack, { gap: "xl", w: "full", children: [
104
- /* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsxs(VStack, { gap: "lg", w: "full", children: [
76
+ /* @__PURE__ */ jsx(VStack, { alignItems: "flex-start", gap: "md", w: "full", children: /* @__PURE__ */ jsxs(VStack, { gap: "lg", w: "full", children: [
105
77
  /* @__PURE__ */ jsx(
106
78
  Avatar,
107
79
  {
@@ -118,8 +90,8 @@ function CTAModal(props) {
118
90
  src: ""
119
91
  }
120
92
  ),
121
- /* @__PURE__ */ jsx(ModalHeading, { children: content?.heading }),
122
- /* @__PURE__ */ jsx(ModalDescription, { children: content?.description })
93
+ /* @__PURE__ */ jsx(DialogHeading, { children: content?.heading }),
94
+ /* @__PURE__ */ jsx(DialogDescription, { children: content?.description })
123
95
  ] }) }),
124
96
  /* @__PURE__ */ jsx(HStack, { gap: "md", w: "full", children: /* @__PURE__ */ jsx(Show, { when: Boolean(content?.actions?.length), children: content?.actions?.map((action, index) => /* @__PURE__ */ jsx(
125
97
  Button,
@@ -151,4 +123,4 @@ export {
151
123
  CTAModal,
152
124
  useCTAModal
153
125
  };
154
- //# sourceMappingURL=chunk-R4RFWDBM.js.map
126
+ //# sourceMappingURL=chunk-FGCO27TC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/context/cta-modal.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n type MouseEvent,\n type MouseEventHandler,\n type PropsWithChildren,\n type ReactNode,\n} from 'react'\nimport { Button } from '../components/Button'\nimport { Show } from '../components/Show'\nimport { Avatar } from '../components/Avatar'\nimport { useCerberusContext } from './cerberus'\nimport { HStack } from '@cerberus/styled-system/jsx'\nimport { css } from '@cerberus/styled-system/css'\nimport { VStack } from '@cerberus/styled-system/jsx'\nimport {\n Dialog,\n DialogDescription,\n DialogHeading,\n DialogProvider,\n} from '../components/Dialog'\nimport { DialogCloseIconTrigger } from '../components/Dialog.client'\n\n/**\n * This module provides a context and hook for the cta modal.\n * @module\n */\n\nexport interface ShowCTAModalOptions {\n /**\n * The heading of the cta modal.\n */\n heading: string\n /**\n * The description of the cta modal.\n */\n description?: string\n /**\n * The icon used for the modal Avatar.\n */\n icon?: ReactNode\n /**\n * The actions for the cta modal. Max of 2 actions.\n */\n actions: {\n text: string\n onClick: MouseEventHandler<HTMLButtonElement>\n }[]\n}\n\nexport interface CTAModalValue {\n show: (options: ShowCTAModalOptions) => void\n}\n\nconst CTAModalContext = createContext<CTAModalValue | null>(null)\n\nexport type CTAModalProviderProps = PropsWithChildren<unknown>\n\n/**\n * Provides a CTA modal to the app.\n * @see https://cerberus.digitalu.design/react/cta-modal\n * @example\n * ```tsx\n * // Wrap the Provider around the root of the feature.\n * <CTAModal>\n * <SomeFeatureSection />\n * </CTAModal>\n *\n * // Use the hook to show the cta modal.\n * const cta = useCTAModal()\n *\n * const handleClick = useCallback(async () => {\n * const userConsent = await cta.show({\n * heading: 'Create or copy a Cohort',\n * description:\n * 'Create a new cohort or copy and existing one.',\n * icon: <Copy size={24} />,\n * actions: [\n * {\n * text: 'Create Cohort',\n * onClick: () => {},\n * {\n * text: 'Copy Cohort',\n * onClick: () => {}\n * }\n * })\n * setConsent(userConsent)\n * }, [cta])\n * ```\n */\nexport function CTAModal(props: PropsWithChildren<CTAModalProviderProps>) {\n const [open, setOpen] = useState<boolean>(false)\n const [content, setContent] = useState<ShowCTAModalOptions | null>(null)\n const confirmIcon = content?.icon\n\n const { icons } = useCerberusContext()\n const { confirmModal: FallbackIcon } = icons\n\n const handleShow = useCallback(\n (options: ShowCTAModalOptions) => {\n const maxActions = 2\n if (options.actions.length > maxActions) {\n throw new Error(\n `CTA Modal only supports a maximum of ${maxActions} actions.`,\n )\n }\n setContent({ ...options })\n setOpen(true)\n },\n [setOpen],\n )\n\n const handleActionClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n const index = event.currentTarget.getAttribute('data-index')\n const action = content?.actions[Number(index)]\n const { onClick } = action || {}\n onClick?.(event)\n setOpen(false)\n },\n [content, setOpen],\n )\n\n const value = useMemo(\n () => ({\n show: handleShow,\n }),\n [handleShow],\n )\n\n return (\n <CTAModalContext.Provider value={value}>\n {props.children}\n\n <DialogProvider open={open} onOpenChange={(e) => setOpen(e.open)}>\n <Dialog size=\"sm\">\n <DialogCloseIconTrigger />\n\n <VStack gap=\"xl\" w=\"full\">\n <VStack alignItems=\"flex-start\" gap=\"md\" w=\"full\">\n <VStack gap=\"lg\" w=\"full\">\n <Avatar\n ariaLabel=\"\"\n gradient=\"charon-light\"\n icon={\n <Show\n when={Boolean(confirmIcon)}\n fallback={<FallbackIcon size={24} />}\n >\n {confirmIcon}\n </Show>\n }\n src=\"\"\n />\n <DialogHeading>{content?.heading}</DialogHeading>\n <DialogDescription>{content?.description}</DialogDescription>\n </VStack>\n </VStack>\n\n <HStack gap=\"md\" w=\"full\">\n <Show when={Boolean(content?.actions?.length)}>\n {content?.actions?.map((action, index) => (\n <Button\n data-index={index}\n className={css({\n w: '1/2',\n })}\n key={index}\n onClick={handleActionClick}\n shape=\"rounded\"\n usage=\"outlined\"\n >\n {action.text}\n </Button>\n ))}\n </Show>\n </HStack>\n </VStack>\n </Dialog>\n </DialogProvider>\n </CTAModalContext.Provider>\n )\n}\n\nexport function useCTAModal(): CTAModalValue {\n const context = useContext(CTAModalContext)\n if (context === null) {\n throw new Error('useCTAModal must be used within a CTAModal Provider')\n }\n return context\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAKP,SAAS,cAAc;AACvB,SAAS,WAAW;AACpB,SAAS,cAAc;AA0Hb,cAII,YAJJ;AAlFV,IAAM,kBAAkB,cAAoC,IAAI;AAoCzD,SAAS,SAAS,OAAiD;AACxE,QAAM,CAAC,MAAM,OAAO,IAAI,SAAkB,KAAK;AAC/C,QAAM,CAAC,SAAS,UAAU,IAAI,SAAqC,IAAI;AACvE,QAAM,cAAc,SAAS;AAE7B,QAAM,EAAE,MAAM,IAAI,mBAAmB;AACrC,QAAM,EAAE,cAAc,aAAa,IAAI;AAEvC,QAAM,aAAa;AAAA,IACjB,CAAC,YAAiC;AAChC,YAAM,aAAa;AACnB,UAAI,QAAQ,QAAQ,SAAS,YAAY;AACvC,cAAM,IAAI;AAAA,UACR,wCAAwC,UAAU;AAAA,QACpD;AAAA,MACF;AACA,iBAAW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S,IAAI,CAAC,QAAQ,UAC9B;AAAA,UAAC;AAAA;AAAA,YACC,cAAY;AAAA,YACZ,WAAW,IAAI;AAAA,cACb,GAAG;AAAA,YACL,CAAC;AAAA,YAED,SAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAM;AAAA,YAEL,iBAAO;AAAA;AAAA,UALH;AAAA,QAMP,CACD,GACH,GACF;AAAA,SACF;AAAA,OACF,GACF;AAAA,KACF;AAEJ;AAEO,SAAS,cAA6B;AAC3C,QAAM,UAAU,WAAW,eAAe;AAC1C,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI,MAAM,qDAAqD;AAAA,EACvE;AACA,SAAO;AACT;","names":[]}
@@ -1,15 +1,6 @@
1
1
  import {
2
- Modal
3
- } from "./chunk-JIRW4XOJ.js";
4
- import {
5
- ModalDescription
6
- } from "./chunk-ZL6ZITLA.js";
7
- import {
8
- ModalHeader
9
- } from "./chunk-NUMM4TNC.js";
10
- import {
11
- ModalHeading
12
- } from "./chunk-7NN3SJ7W.js";
2
+ Text
3
+ } from "./chunk-RU5LOXWI.js";
13
4
  import {
14
5
  Input
15
6
  } from "./chunk-MZ3UCDUL.js";
@@ -20,8 +11,11 @@ import {
20
11
  Field
21
12
  } from "./chunk-UZDVOIW5.js";
22
13
  import {
23
- Portal
24
- } from "./chunk-IQJDVFPP.js";
14
+ Dialog,
15
+ DialogDescription,
16
+ DialogHeading,
17
+ DialogProvider
18
+ } from "./chunk-TFL56AYR.js";
25
19
  import {
26
20
  Avatar
27
21
  } from "./chunk-GCQMH4QA.js";
@@ -34,12 +28,6 @@ import {
34
28
  import {
35
29
  Button
36
30
  } from "./chunk-EXGKZGML.js";
37
- import {
38
- useModal
39
- } from "./chunk-KGQG5JGW.js";
40
- import {
41
- trapFocus
42
- } from "./chunk-JIZQFTW6.js";
43
31
 
44
32
  // src/context/prompt-modal.tsx
45
33
  import {
@@ -51,15 +39,16 @@ import {
51
39
  useState
52
40
  } from "react";
53
41
  import { css } from "@cerberus/styled-system/css";
54
- import { hstack, vstack } from "@cerberus/styled-system/patterns";
42
+ import { hstack } from "@cerberus/styled-system/patterns";
43
+ import { HStack, VStack } from "@cerberus/styled-system/jsx";
44
+ import { DialogCloseTrigger } from "@ark-ui/react";
55
45
  import { jsx, jsxs } from "react/jsx-runtime";
56
46
  var PromptModalContext = createContext(null);
57
47
  function PromptModal(props) {
58
- const { modalRef, show, close } = useModal();
59
48
  const resolveRef = useRef(null);
49
+ const [open, setOpen] = useState(false);
60
50
  const [content, setContent] = useState(null);
61
51
  const [inputValue, setInputValue] = useState("");
62
- const focusTrap = trapFocus(modalRef);
63
52
  const { icons } = useCerberusContext();
64
53
  const { promptModal: PromptIcon } = icons;
65
54
  const isValid = useMemo(
@@ -82,19 +71,19 @@ function PromptModal(props) {
82
71
  if (target.value === "true") {
83
72
  resolveRef.current?.(inputValue);
84
73
  }
85
- close();
74
+ setOpen(false);
86
75
  },
87
- [inputValue, close]
76
+ [inputValue, setOpen]
88
77
  );
89
78
  const handleShow = useCallback(
90
79
  (options) => {
91
80
  return new Promise((resolve) => {
92
81
  setContent({ ...options, kind: options.kind || "non-destructive" });
93
- show();
82
+ setOpen(true);
94
83
  resolveRef.current = resolve;
95
84
  });
96
85
  },
97
- [show]
86
+ [setOpen]
98
87
  );
99
88
  const value = useMemo(
100
89
  () => ({
@@ -104,15 +93,15 @@ function PromptModal(props) {
104
93
  );
105
94
  return /* @__PURE__ */ jsxs(PromptModalContext.Provider, { value, children: [
106
95
  props.children,
107
- /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsxs(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
108
- /* @__PURE__ */ jsxs(ModalHeader, { children: [
96
+ /* @__PURE__ */ jsx(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ jsx(Dialog, { size: "sm", children: /* @__PURE__ */ jsxs(VStack, { gap: "xl", w: "full", children: [
97
+ /* @__PURE__ */ jsxs(VStack, { alignItems: "flex-start", gap: "md", w: "full", children: [
109
98
  /* @__PURE__ */ jsx(
110
- "div",
99
+ HStack,
111
100
  {
112
- className: hstack({
113
- justify: "center",
114
- w: "full"
115
- }),
101
+ alignSelf: "center",
102
+ justify: "center",
103
+ paddingBlockEnd: "md",
104
+ w: "full",
116
105
  children: /* @__PURE__ */ jsx(
117
106
  Show,
118
107
  {
@@ -139,38 +128,29 @@ function PromptModal(props) {
139
128
  )
140
129
  }
141
130
  ),
142
- /* @__PURE__ */ jsx(ModalHeading, { children: content?.heading }),
143
- /* @__PURE__ */ jsx(ModalDescription, { children: content?.description })
131
+ /* @__PURE__ */ jsx(DialogHeading, { children: content?.heading }),
132
+ /* @__PURE__ */ jsx(DialogDescription, { children: content?.description })
144
133
  ] }),
145
134
  /* @__PURE__ */ jsx(
146
- "div",
135
+ VStack,
147
136
  {
148
- className: vstack({
149
- alignItems: "flex-start",
150
- mt: "4",
151
- mb: "8"
152
- }),
137
+ alignItems: "flex-start",
138
+ marginBlockStart: "md",
139
+ marginBlockEnd: "lg",
140
+ w: "full",
153
141
  children: /* @__PURE__ */ jsxs(Field, { invalid: !isValid, children: [
154
142
  /* @__PURE__ */ jsxs(
155
143
  Label,
156
144
  {
157
- className: css({
158
- gap: 1,
159
- justifyContent: "flex-start"
145
+ className: hstack({
146
+ gap: "xs",
147
+ justify: "flex-start !important"
160
148
  }),
161
149
  htmlFor: "confirm",
162
150
  size: "md",
163
151
  children: [
164
152
  "Type",
165
- /* @__PURE__ */ jsx(
166
- "strong",
167
- {
168
- className: css({
169
- textTransform: "uppercase"
170
- }),
171
- children: content?.key
172
- }
173
- ),
153
+ /* @__PURE__ */ jsx(Text, { as: "strong", textTransform: "uppercase", children: content?.key }),
174
154
  "to confirm"
175
155
  ]
176
156
  }
@@ -187,46 +167,37 @@ function PromptModal(props) {
187
167
  ] })
188
168
  }
189
169
  ),
190
- /* @__PURE__ */ jsxs(
191
- "div",
192
- {
193
- className: hstack({
194
- justifyContent: "stretch",
195
- gap: "4"
196
- }),
197
- children: [
198
- /* @__PURE__ */ jsx(
199
- Button,
200
- {
201
- autoFocus: true,
202
- className: css({
203
- w: "1/2"
204
- }),
205
- disabled: !isValid,
206
- name: "confirm",
207
- onClick: handleChoice,
208
- palette,
209
- value: "true",
210
- children: content?.actionText
211
- }
212
- ),
213
- /* @__PURE__ */ jsx(
214
- Button,
215
- {
216
- className: css({
217
- w: "1/2"
218
- }),
219
- name: "cancel",
220
- onClick: handleChoice,
221
- usage: "outlined",
222
- value: "false",
223
- children: content?.cancelText
224
- }
225
- )
226
- ]
227
- }
228
- )
229
- ] }) })
170
+ /* @__PURE__ */ jsxs(HStack, { gap: "md", justify: "stretch", w: "full", children: [
171
+ /* @__PURE__ */ jsx(
172
+ Button,
173
+ {
174
+ autoFocus: true,
175
+ className: css({
176
+ w: "1/2"
177
+ }),
178
+ disabled: !isValid,
179
+ name: "confirm",
180
+ onClick: handleChoice,
181
+ palette,
182
+ value: "true",
183
+ children: content?.actionText
184
+ }
185
+ ),
186
+ /* @__PURE__ */ jsx(DialogCloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
187
+ Button,
188
+ {
189
+ className: css({
190
+ w: "1/2"
191
+ }),
192
+ name: "cancel",
193
+ onClick: handleChoice,
194
+ usage: "outlined",
195
+ value: "false",
196
+ children: content?.cancelText
197
+ }
198
+ ) })
199
+ ] })
200
+ ] }) }) })
230
201
  ] });
231
202
  }
232
203
  function usePromptModal() {
@@ -241,4 +212,4 @@ export {
241
212
  PromptModal,
242
213
  usePromptModal
243
214
  };
244
- //# sourceMappingURL=chunk-VGEK2DQB.js.map
215
+ //# sourceMappingURL=chunk-SD3OVTHT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/context/prompt-modal.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type MouseEvent,\n type PropsWithChildren,\n} from 'react'\nimport { Button } from '../components/Button'\nimport { css } from '@cerberus/styled-system/css'\nimport { hstack } from '@cerberus/styled-system/patterns'\nimport { Input } from '../components/Input'\nimport { Field } from './field'\nimport { Label } from '../components/Label'\nimport { Show } from '../components/Show'\nimport { Avatar } from '../components/Avatar'\nimport { Text } from '../components/Text'\nimport { useCerberusContext } from './cerberus'\nimport {\n Dialog,\n DialogDescription,\n DialogHeading,\n DialogProvider,\n} from '../components/Dialog'\nimport { HStack, VStack } from '@cerberus/styled-system/jsx'\nimport { DialogCloseTrigger } from '@ark-ui/react'\n\n/**\n * This module provides a context and hook for the prompt modal.\n * @module PromptModal\n */\n\nexport interface ShowPromptModalOptions {\n /**\n * The kind of prompt modal to show.\n * @default 'non-destructive'\n */\n kind?: 'destructive' | 'non-destructive'\n /**\n * The heading of the prompt modal.\n */\n heading: string\n /**\n * The description of the prompt modal.\n */\n description?: string\n /**\n * The key to confirm the action.\n */\n key: string\n /**\n * The text for the action button.\n */\n actionText: string\n /**\n * The text for the cancel button.\n */\n cancelText: string\n}\nexport type PromptShowResult =\n | ((value: string | PromiseLike<string>) => void)\n | null\n\nexport interface PromptModalValue {\n /**\n * The method to trigger the prompt modal.\n * @returns the value of the key if the action is confirmed.\n * @example\n * ```tsx\n * const accepted = await prompt.show({\n * kind: 'destructive',\n * heading: 'Delete channel?',\n * description:\n * 'This will permanently delete a channel on your account. There is no going back.',\n * key: CHANNEL_NAME,\n * actionText: 'Yes, delete channel',\n * cancelText: 'No, cancel',\n * })\n */\n show: (options: ShowPromptModalOptions) => Promise<string>\n}\n\nconst PromptModalContext = createContext<PromptModalValue | null>(null)\n\nexport type PromptModalProviderProps = PropsWithChildren<unknown>\n\n/**\n * Provides a prompt modal to the app.\n * @see https://cerberus.digitalu.design/react/prompt-modal\n * @example\n * ```tsx\n * // Wrap the Provider around the root of the feature.\n * <PromptModal>\n * <SomeFeatureSection />\n * </PromptModal>\n *\n * // Use the hook to show the prompt modal.\n * const prompt = usePromptModal()\n *\n * const handleClick = useCallback(async () => {\n * const accepted = await prompt.show({\n * kind: 'destructive',\n * heading: 'Delete channel?',\n * description:\n * 'This will permanently delete a channel on your account. There is no going back.',\n * key: CHANNEL_NAME,\n * actionText: 'Yes, delete channel',\n * cancelText: 'No, cancel',\n * })\n * // do something with accepted\n * }, [prompt])\n * ```\n */\nexport function PromptModal(\n props: PropsWithChildren<PromptModalProviderProps>,\n) {\n const resolveRef = useRef<PromptShowResult>(null)\n const [open, setOpen] = useState<boolean>(false)\n const [content, setContent] = useState<ShowPromptModalOptions | null>(null)\n const [inputValue, setInputValue] = useState<string>('')\n\n const { icons } = useCerberusContext()\n const { promptModal: PromptIcon } = icons\n\n const isValid = useMemo(\n () => inputValue === content?.key,\n [inputValue, content],\n )\n\n const palette = useMemo(\n () => (content?.kind === 'destructive' ? 'danger' : 'action'),\n [content],\n )\n\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n setInputValue(e.currentTarget.value)\n },\n [content],\n )\n\n const handleChoice = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n const target = e.currentTarget as HTMLButtonElement\n if (target.value === 'true') {\n resolveRef.current?.(inputValue)\n }\n setOpen(false)\n },\n [inputValue, setOpen],\n )\n\n const handleShow = useCallback(\n (options: ShowPromptModalOptions) => {\n return new Promise<string>((resolve) => {\n setContent({ ...options, kind: options.kind || 'non-destructive' })\n setOpen(true)\n resolveRef.current = resolve\n })\n },\n [setOpen],\n )\n\n const value = useMemo(\n () => ({\n show: handleShow,\n }),\n [handleShow],\n )\n\n return (\n <PromptModalContext.Provider value={value}>\n {props.children}\n\n <DialogProvider open={open} onOpenChange={(e) => setOpen(e.open)}>\n <Dialog size=\"sm\">\n <VStack gap=\"xl\" w=\"full\">\n <VStack alignItems=\"flex-start\" gap=\"md\" w=\"full\">\n <HStack\n alignSelf=\"center\"\n justify=\"center\"\n paddingBlockEnd=\"md\"\n w=\"full\"\n >\n <Show\n when={palette === 'danger'}\n fallback={\n <Avatar\n ariaLabel=\"\"\n gradient=\"charon-light\"\n icon={<PromptIcon size={24} />}\n src=\"\"\n />\n }\n >\n <Avatar\n ariaLabel=\"\"\n gradient=\"hades-dark\"\n icon={<PromptIcon size={24} />}\n src=\"\"\n />\n </Show>\n </HStack>\n <DialogHeading>{content?.heading}</DialogHeading>\n <DialogDescription>{content?.description}</DialogDescription>\n </VStack>\n\n <VStack\n alignItems=\"flex-start\"\n marginBlockStart=\"md\"\n marginBlockEnd=\"lg\"\n w=\"full\"\n >\n <Field invalid={!isValid}>\n <Label\n className={hstack({\n gap: 'xs',\n justify: 'flex-start !important',\n })}\n htmlFor=\"confirm\"\n size=\"md\"\n >\n Type\n <Text as=\"strong\" textTransform=\"uppercase\">\n {content?.key}\n </Text>\n to confirm\n </Label>\n <Input\n id=\"confirm\"\n name=\"confirm\"\n onChange={handleChange}\n type=\"text\"\n />\n </Field>\n </VStack>\n\n <HStack gap=\"md\" justify=\"stretch\" w=\"full\">\n <Button\n autoFocus\n className={css({\n w: '1/2',\n })}\n disabled={!isValid}\n name=\"confirm\"\n onClick={handleChoice}\n palette={palette}\n value=\"true\"\n >\n {content?.actionText}\n </Button>\n\n <DialogCloseTrigger asChild>\n <Button\n className={css({\n w: '1/2',\n })}\n name=\"cancel\"\n onClick={handleChoice}\n usage=\"outlined\"\n value=\"false\"\n >\n {content?.cancelText}\n </Button>\n </DialogCloseTrigger>\n </HStack>\n </VStack>\n </Dialog>\n </DialogProvider>\n </PromptModalContext.Provider>\n )\n}\n\n/**\n * Used to retrieve the context of the PromptModal provider.\n */\nexport function usePromptModal(): PromptModalValue {\n const context = useContext(PromptModalContext)\n if (context === null) {\n throw new Error('usePromptModal must be used within a PromptModal Provider')\n }\n return context\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP,SAAS,WAAW;AACpB,SAAS,cAAc;AAcvB,SAAS,QAAQ,cAAc;AA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AA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,IAAG;AAAA,gBACH,MAAK;AAAA,gBACL,UAAU;AAAA,gBACV,MAAK;AAAA;AAAA,YACP;AAAA,aACF;AAAA;AAAA,MACF;AAAA,MAEA,qBAAC,UAAO,KAAI,MAAK,SAAQ,WAAU,GAAE,QACnC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAS;AAAA,YACT,WAAW,IAAI;AAAA,cACb,GAAG;AAAA,YACL,CAAC;AAAA,YACD,UAAU,CAAC;AAAA,YACX,MAAK;AAAA,YACL,SAAS;AAAA,YACT;AAAA,YACA,OAAM;AAAA,YAEL,mBAAS;AAAA;AAAA,QACZ;AAAA,QAEA,oBAAC,sBAAmB,SAAO,MACzB;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,IAAI;AAAA,cACb,GAAG;AAAA,YACL,CAAC;AAAA,YACD,MAAK;AAAA,YACL,SAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAM;AAAA,YAEL,mBAAS;AAAA;AAAA,QACZ,GACF;AAAA,SACF;AAAA,OACF,GACF,GACF;AAAA,KACF;AAEJ;AAKO,SAAS,iBAAmC;AACjD,QAAM,UAAU,WAAW,kBAAkB;AAC7C,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI,MAAM,2DAA2D;AAAA,EAC7E;AACA,SAAO;AACT;","names":[]}
@@ -2,18 +2,13 @@
2
2
  import {
3
3
  ConfirmModal,
4
4
  useConfirmModal
5
- } from "../chunk-MUTAYS3P.js";
6
- import "../chunk-JIRW4XOJ.js";
7
- import "../chunk-ZL6ZITLA.js";
8
- import "../chunk-NUMM4TNC.js";
9
- import "../chunk-7NN3SJ7W.js";
5
+ } from "../chunk-BHB56M7S.js";
6
+ import "../chunk-TFL56AYR.js";
10
7
  import "../chunk-IQJDVFPP.js";
11
8
  import "../chunk-GCQMH4QA.js";
12
9
  import "../chunk-BUVVRQLZ.js";
13
10
  import "../chunk-GITT5645.js";
14
11
  import "../chunk-EXGKZGML.js";
15
- import "../chunk-KGQG5JGW.js";
16
- import "../chunk-JIZQFTW6.js";
17
12
  export {
18
13
  ConfirmModal,
19
14
  useConfirmModal
@@ -2,19 +2,15 @@
2
2
  import {
3
3
  CTAModal,
4
4
  useCTAModal
5
- } from "../chunk-R4RFWDBM.js";
6
- import "../chunk-JIRW4XOJ.js";
7
- import "../chunk-ZL6ZITLA.js";
8
- import "../chunk-NUMM4TNC.js";
9
- import "../chunk-7NN3SJ7W.js";
5
+ } from "../chunk-FGCO27TC.js";
6
+ import "../chunk-6BN3XKQF.js";
10
7
  import "../chunk-APD6IX5R.js";
8
+ import "../chunk-TFL56AYR.js";
11
9
  import "../chunk-IQJDVFPP.js";
12
10
  import "../chunk-GCQMH4QA.js";
13
11
  import "../chunk-BUVVRQLZ.js";
14
12
  import "../chunk-GITT5645.js";
15
13
  import "../chunk-EXGKZGML.js";
16
- import "../chunk-KGQG5JGW.js";
17
- import "../chunk-JIZQFTW6.js";
18
14
  export {
19
15
  CTAModal,
20
16
  useCTAModal
@@ -2,21 +2,17 @@
2
2
  import {
3
3
  PromptModal,
4
4
  usePromptModal
5
- } from "../chunk-VGEK2DQB.js";
6
- import "../chunk-JIRW4XOJ.js";
7
- import "../chunk-ZL6ZITLA.js";
8
- import "../chunk-NUMM4TNC.js";
9
- import "../chunk-7NN3SJ7W.js";
5
+ } from "../chunk-SD3OVTHT.js";
6
+ import "../chunk-RU5LOXWI.js";
10
7
  import "../chunk-MZ3UCDUL.js";
11
8
  import "../chunk-NMF2HYWO.js";
12
9
  import "../chunk-UZDVOIW5.js";
10
+ import "../chunk-TFL56AYR.js";
13
11
  import "../chunk-IQJDVFPP.js";
14
12
  import "../chunk-GCQMH4QA.js";
15
13
  import "../chunk-BUVVRQLZ.js";
16
14
  import "../chunk-GITT5645.js";
17
15
  import "../chunk-EXGKZGML.js";
18
- import "../chunk-KGQG5JGW.js";
19
- import "../chunk-JIZQFTW6.js";
20
16
  export {
21
17
  PromptModal,
22
18
  usePromptModal