@greatapps/common 1.1.33 → 1.1.34

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 (37) hide show
  1. package/dist/components/account/AccountModals.mjs +18 -0
  2. package/dist/components/account/AccountModals.mjs.map +1 -0
  3. package/dist/components/account/ConfigurationsMyAccountModal.mjs +26 -15
  4. package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
  5. package/dist/components/account/ConfirmDeleteAccountModal.mjs +45 -0
  6. package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -0
  7. package/dist/components/account/DeleteAccountModal.mjs +123 -0
  8. package/dist/components/account/DeleteAccountModal.mjs.map +1 -0
  9. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +42 -0
  10. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -0
  11. package/dist/components/layouts/AppMobileNavBar.mjs +55 -0
  12. package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -0
  13. package/dist/components/layouts/AppNavBar.mjs +77 -0
  14. package/dist/components/layouts/AppNavBar.mjs.map +1 -0
  15. package/dist/components/modals/ModalManager.mjs +19 -0
  16. package/dist/components/modals/ModalManager.mjs.map +1 -0
  17. package/dist/components/modals/Modals.mjs +20 -0
  18. package/dist/components/modals/Modals.mjs.map +1 -0
  19. package/dist/index.mjs +14 -2
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/store/useAccountModals.mjs +18 -0
  22. package/dist/store/useAccountModals.mjs.map +1 -0
  23. package/dist/store/useModalManager.mjs +75 -0
  24. package/dist/store/useModalManager.mjs.map +1 -0
  25. package/package.json +1 -1
  26. package/src/components/account/AccountModals.tsx +17 -0
  27. package/src/components/account/ConfigurationsMyAccountModal.tsx +29 -26
  28. package/src/components/account/ConfirmDeleteAccountModal.tsx +55 -0
  29. package/src/components/account/DeleteAccountModal.tsx +130 -0
  30. package/src/components/account/IsntPossibleDeleteAccountModal.tsx +49 -0
  31. package/src/components/layouts/AppMobileNavBar.tsx +73 -0
  32. package/src/components/layouts/AppNavBar.tsx +90 -0
  33. package/src/components/modals/ModalManager.tsx +29 -0
  34. package/src/components/modals/Modals.tsx +29 -0
  35. package/src/index.ts +13 -2
  36. package/src/store/useAccountModals.ts +57 -0
  37. package/src/store/useModalManager.ts +104 -0
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import ConfigurationsMyAccountModal from "./ConfigurationsMyAccountModal";
4
+ import DeleteAccountModal from "./DeleteAccountModal";
5
+ import IsntPossibleDeleteAccountModal from "./IsntPossibleDeleteAccountModal";
6
+ import ConfirmDeleteAccountModal from "./ConfirmDeleteAccountModal";
7
+ function AccountModals() {
8
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
9
+ /* @__PURE__ */ jsx(ConfigurationsMyAccountModal, {}),
10
+ /* @__PURE__ */ jsx(DeleteAccountModal, {}),
11
+ /* @__PURE__ */ jsx(IsntPossibleDeleteAccountModal, {}),
12
+ /* @__PURE__ */ jsx(ConfirmDeleteAccountModal, {})
13
+ ] });
14
+ }
15
+ export {
16
+ AccountModals as default
17
+ };
18
+ //# sourceMappingURL=AccountModals.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/account/AccountModals.tsx"],"sourcesContent":["'use client';\n\nimport ConfigurationsMyAccountModal from './ConfigurationsMyAccountModal';\nimport DeleteAccountModal from './DeleteAccountModal';\nimport IsntPossibleDeleteAccountModal from './IsntPossibleDeleteAccountModal';\nimport ConfirmDeleteAccountModal from './ConfirmDeleteAccountModal';\n\nexport default function AccountModals() {\n return (\n <>\n <ConfigurationsMyAccountModal />\n <DeleteAccountModal />\n <IsntPossibleDeleteAccountModal />\n <ConfirmDeleteAccountModal />\n </>\n );\n}\n"],"mappings":";AASI,mBACE,KADF;AAPJ,OAAO,kCAAkC;AACzC,OAAO,wBAAwB;AAC/B,OAAO,oCAAoC;AAC3C,OAAO,+BAA+B;AAEvB,SAAR,gBAAiC;AACtC,SACE,iCACE;AAAA,wBAAC,gCAA6B;AAAA,IAC9B,oBAAC,sBAAmB;AAAA,IACpB,oBAAC,kCAA+B;AAAA,IAChC,oBAAC,6BAA0B;AAAA,KAC7B;AAEJ;","names":[]}
@@ -11,20 +11,31 @@ import { ChangePasswordSection } from "./sections/ChangePasswordSection";
11
11
  import { SecuritySection } from "./sections/SecuritySection";
12
12
  import useConfigurationsModal from "./hooks/useConfigurationsModal";
13
13
  import useIsMobile from "../../hooks/useIsMobile";
14
- function ConfigurationsMyAccountModal({
15
- open,
16
- onClose,
17
- initialSection,
18
- hasActiveSubscription,
19
- currencies = [],
20
- storageUrl,
21
- onDeleteAccount
22
- }) {
14
+ import { useAccountModals } from "../../store/useAccountModals";
15
+ function ConfigurationsMyAccountModal() {
16
+ const {
17
+ activeModal,
18
+ config,
19
+ initialSection,
20
+ openDeleteAccount,
21
+ openIsntPossibleDelete,
22
+ close
23
+ } = useAccountModals();
24
+ const open = activeModal === "configurations";
25
+ const { hasActiveSubscription, currencies = [] } = config;
23
26
  const isMobile = useIsMobile();
24
27
  const { activeSection, setActiveSection } = useConfigurationsModal({
25
28
  isOpen: open,
26
29
  initialSection
27
30
  });
31
+ const handleDeleteAccount = () => {
32
+ close();
33
+ if (hasActiveSubscription) {
34
+ openIsntPossibleDelete();
35
+ } else {
36
+ openDeleteAccount();
37
+ }
38
+ };
28
39
  const tabTriggerClasses = cn(
29
40
  "border-0! px-0 py-0",
30
41
  "lg:rounded-md lg:flex lg:items-center lg:gap-2 lg:p-3 lg:justify-start lg:w-full",
@@ -36,7 +47,7 @@ function ConfigurationsMyAccountModal({
36
47
  "text-gray-500 data-[state=active]:text-gray-950",
37
48
  "hover:text-gray-900 transition-colors"
38
49
  );
39
- return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: onClose, children: /* @__PURE__ */ jsxs(
50
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: close, children: /* @__PURE__ */ jsxs(
40
51
  DialogContent,
41
52
  {
42
53
  showCloseButton: !isMobile,
@@ -51,7 +62,7 @@ function ConfigurationsMyAccountModal({
51
62
  {
52
63
  type: "button",
53
64
  className: "size-8 flex items-center justify-center text-gray-500 cursor-pointer",
54
- onClick: onClose,
65
+ onClick: close,
55
66
  children: /* @__PURE__ */ jsx(X, { size: 18 })
56
67
  }
57
68
  )
@@ -95,18 +106,18 @@ function ConfigurationsMyAccountModal({
95
106
  }
96
107
  ),
97
108
  /* @__PURE__ */ jsxs("div", { className: "w-full flex-1 min-h-0 lg:h-full overflow-hidden lg:overflow-visible relative", children: [
98
- /* @__PURE__ */ jsx(TabsContent, { value: AccountSectionType.MY_PROFILE, className: "h-full! relative overflow-hidden", children: /* @__PURE__ */ jsx(MyProfileSection, { onClose, storageUrl }) }),
109
+ /* @__PURE__ */ jsx(TabsContent, { value: AccountSectionType.MY_PROFILE, className: "h-full! relative overflow-hidden", children: /* @__PURE__ */ jsx(MyProfileSection, { onClose: close }) }),
99
110
  /* @__PURE__ */ jsx(TabsContent, { value: AccountSectionType.SECURITY, className: "h-full! relative overflow-hidden", children: /* @__PURE__ */ jsx(
100
111
  SecuritySection,
101
112
  {
102
113
  setActiveSection,
103
- onClose,
114
+ onClose: close,
104
115
  hasActiveSubscription,
105
- onDeleteAccount
116
+ onDeleteAccount: handleDeleteAccount
106
117
  }
107
118
  ) }),
108
119
  /* @__PURE__ */ jsx(TabsContent, { value: AccountSectionType.CHANGE_PASSWORD, className: "h-full! relative overflow-hidden", children: /* @__PURE__ */ jsx(ChangePasswordSection, { onBack: () => setActiveSection(AccountSectionType.SECURITY) }) }),
109
- /* @__PURE__ */ jsx(TabsContent, { value: AccountSectionType.PREFERENCES, className: "h-full! relative overflow-hidden", children: /* @__PURE__ */ jsx(PreferencesSection, { onClose, currencies }) })
120
+ /* @__PURE__ */ jsx(TabsContent, { value: AccountSectionType.PREFERENCES, className: "h-full! relative overflow-hidden", children: /* @__PURE__ */ jsx(PreferencesSection, { onClose: close, currencies }) })
110
121
  ] })
111
122
  ]
112
123
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/account/ConfigurationsMyAccountModal.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { Lock, Settings2, User, X } from 'lucide-react';\r\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\r\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../ui/data-display/Tabs';\r\nimport { Button } from '../ui/buttons/Button';\r\nimport { cn } from '../../infra/utils/clsx';\r\nimport { AccountSectionType } from '../../enums/AccountSectionType';\r\nimport { MyProfileSection } from './sections/MyProfileSection';\r\nimport { PreferencesSection } from './sections/PreferencesSection';\r\nimport { ChangePasswordSection } from './sections/ChangePasswordSection';\r\nimport { SecuritySection } from './sections/SecuritySection';\r\nimport useConfigurationsModal from './hooks/useConfigurationsModal';\r\nimport useIsMobile from '../../hooks/useIsMobile';\r\nimport type { ComboboxOption } from '../ui/form/ComboboxField';\r\n\r\ninterface ConfigurationsMyAccountModalProps {\r\n open: boolean;\r\n onClose: () => void;\r\n initialSection?: AccountSectionType;\r\n hasActiveSubscription?: boolean;\r\n currencies?: ComboboxOption[];\r\n storageUrl?: string;\r\n onDeleteAccount?: () => void;\r\n}\r\n\r\nexport default function ConfigurationsMyAccountModal({\r\n open,\r\n onClose,\r\n initialSection,\r\n hasActiveSubscription,\r\n currencies = [],\r\n storageUrl,\r\n onDeleteAccount,\r\n}: ConfigurationsMyAccountModalProps) {\r\n const isMobile = useIsMobile();\r\n const { activeSection, setActiveSection } = useConfigurationsModal({\r\n isOpen: open,\r\n initialSection,\r\n });\r\n\r\n const tabTriggerClasses = cn(\r\n 'border-0! px-0 py-0',\r\n\r\n 'lg:rounded-md lg:flex lg:items-center lg:gap-2 lg:p-3 lg:justify-start lg:w-full',\r\n 'lg:bg-white lg:hover:bg-gray-100 lg:active:bg-gray-50 lg:border-0',\r\n 'lg:data-[state=active]:bg-gray-50',\r\n\r\n 'flex items-center gap-1.5 px-3 py-3 justify-center whitespace-nowrap',\r\n 'border-b-2 border-transparent',\r\n 'data-[state=active]:bg-gray-50 rounded-lg',\r\n\r\n 'text-gray-500 data-[state=active]:text-gray-950',\r\n 'hover:text-gray-900 transition-colors'\r\n );\r\n\r\n return (\r\n <Dialog open={open} onOpenChange={onClose}>\r\n <DialogContent\r\n showCloseButton={!isMobile}\r\n overlayClassName=\"bg-black/20 lg:bg-black/50\"\r\n className=\"\r\n flex flex-col p-0 gap-0 max-w-full! overflow-x-hidden border-0\r\n rounded-t-2xl rounded-b-none h-[100dvh] top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0!\r\n lg:flex-row lg:w-[892px]! lg:max-w-[892px]! lg:h-[626px]! lg:rounded-lg lg:border\r\n lg:top-[50%]! lg:bottom-auto! lg:left-[50%]! lg:right-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!\"\r\n >\r\n <DialogHeader className=\"sr-only\">\r\n <DialogTitle>Configurações</DialogTitle>\r\n </DialogHeader>\r\n <div className=\"md:hidden flex items-center justify-between px-5 py-3 border-b border-gray-200\">\r\n <span className=\"text-gray-950 paragraph-medium-semibold\">Configurações</span>\r\n <button\r\n type=\"button\"\r\n className=\"size-8 flex items-center justify-center text-gray-500 cursor-pointer\"\r\n onClick={onClose}\r\n >\r\n <X size={18} />\r\n </button>\r\n </div>\r\n <Tabs\r\n value={activeSection}\r\n onValueChange={(value) => setActiveSection(value as AccountSectionType)}\r\n orientation=\"vertical\"\r\n className=\"flex lg:flex-row flex-col w-full h-full flex-1 lg:h-full lg:pt-0 lg:gap-0\"\r\n >\r\n <TabsList\r\n className={cn(\r\n 'flex gap-0 bg-transparent border-b-0',\r\n\r\n 'lg:flex-col lg:items-stretch lg:justify-start lg:w-auto lg:min-w-60',\r\n 'lg:border-r lg:border-gray-200 lg:pl-5 lg:pr-5 lg:pt-5 lg:gap-5 lg:overflow-x-visible lg:self-stretch',\r\n\r\n 'flex-row items-center justify-start w-full overflow-x-auto scrollbar-hide shrink-0',\r\n 'px-4 py-3',\r\n '[mask-image:linear-gradient(to_right,transparent,black_16px,black_calc(100%-24px),transparent)] lg:[mask-image:none]'\r\n )}\r\n >\r\n <span className=\"hidden lg:block paragraph-medium-semibold text-gray-950 mb-0\">\r\n Configurações\r\n </span>\r\n\r\n <div className=\"lg:flex lg:flex-col flex flex-row lg:gap-0 gap-0 lg:w-full\">\r\n <TabsTrigger value={AccountSectionType.MY_PROFILE} className={tabTriggerClasses}>\r\n <User size={20} className=\"shrink-0\" />\r\n <span className=\"paragraph-small-medium\">Meu perfil</span>\r\n </TabsTrigger>\r\n\r\n <TabsTrigger value={AccountSectionType.PREFERENCES} className={tabTriggerClasses}>\r\n <Settings2 size={20} className=\"shrink-0\" />\r\n <span className=\"paragraph-small-medium\">Preferências</span>\r\n </TabsTrigger>\r\n\r\n <TabsTrigger value={AccountSectionType.SECURITY} className={tabTriggerClasses}>\r\n <Lock size={20} className=\"shrink-0\" />\r\n <span className=\"paragraph-small-medium\">Segurança</span>\r\n </TabsTrigger>\r\n </div>\r\n </TabsList>\r\n\r\n <div className=\"w-full flex-1 min-h-0 lg:h-full overflow-hidden lg:overflow-visible relative\">\r\n <TabsContent value={AccountSectionType.MY_PROFILE} className=\"h-full! relative overflow-hidden\">\r\n <MyProfileSection onClose={onClose} storageUrl={storageUrl} />\r\n </TabsContent>\r\n\r\n <TabsContent value={AccountSectionType.SECURITY} className=\"h-full! relative overflow-hidden\">\r\n <SecuritySection\r\n setActiveSection={setActiveSection}\r\n onClose={onClose}\r\n hasActiveSubscription={hasActiveSubscription}\r\n onDeleteAccount={onDeleteAccount}\r\n />\r\n </TabsContent>\r\n\r\n <TabsContent value={AccountSectionType.CHANGE_PASSWORD} className=\"h-full! relative overflow-hidden\">\r\n <ChangePasswordSection onBack={() => setActiveSection(AccountSectionType.SECURITY)} />\r\n </TabsContent>\r\n\r\n <TabsContent value={AccountSectionType.PREFERENCES} className=\"h-full! relative overflow-hidden\">\r\n <PreferencesSection onClose={onClose} currencies={currencies} />\r\n </TabsContent>\r\n </div>\r\n </Tabs>\r\n </DialogContent>\r\n </Dialog>\r\n );\r\n}\r\n"],"mappings":";AAoEU,cAEF,YAFE;AAlEV,SAAS,MAAM,WAAW,MAAM,SAAS;AACzC,SAAS,QAAQ,eAAe,cAAc,mBAAmB;AACjE,SAAS,MAAM,UAAU,aAAa,mBAAmB;AAEzD,SAAS,UAAU;AACnB,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,uBAAuB;AAChC,OAAO,4BAA4B;AACnC,OAAO,iBAAiB;AAaT,SAAR,6BAA8C;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa,CAAC;AAAA,EACd;AAAA,EACA;AACF,GAAsC;AACpC,QAAM,WAAW,YAAY;AAC7B,QAAM,EAAE,eAAe,iBAAiB,IAAI,uBAAuB;AAAA,IACjE,QAAQ;AAAA,IACR;AAAA,EACF,CAAC;AAED,QAAM,oBAAoB;AAAA,IACxB;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,EACF;AAEA,SACE,oBAAC,UAAO,MAAY,cAAc,SAChC;AAAA,IAAC;AAAA;AAAA,MACC,iBAAiB,CAAC;AAAA,MAClB,kBAAiB;AAAA,MACjB,WAAU;AAAA,MAMV;AAAA,4BAAC,gBAAa,WAAU,WACtB,8BAAC,eAAY,iCAAa,GAC5B;AAAA,QACA,qBAAC,SAAI,WAAU,kFACb;AAAA,8BAAC,UAAK,WAAU,2CAA0C,iCAAa;AAAA,UACvE;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAU;AAAA,cACV,SAAS;AAAA,cAET,8BAAC,KAAE,MAAM,IAAI;AAAA;AAAA,UACf;AAAA,WACF;AAAA,QACA;AAAA,UAAC;AAAA;AA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AiB,mBAAmB,QAAQ,GAAG,GACtF;AAAA,gBAEA,oBAAC,eAAY,OAAO,mBAAmB,aAAa,WAAU,oCAC5D,8BAAC,sBAAmB,SAAkB,YAAwB,GAChE;AAAA,iBACF;AAAA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/account/ConfigurationsMyAccountModal.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { Lock, Settings2, User, X } from 'lucide-react';\r\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\r\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../ui/data-display/Tabs';\r\nimport { Button } from '../ui/buttons/Button';\r\nimport { cn } from '../../infra/utils/clsx';\r\nimport { AccountSectionType } from '../../enums/AccountSectionType';\r\nimport { MyProfileSection } from './sections/MyProfileSection';\r\nimport { PreferencesSection } from './sections/PreferencesSection';\r\nimport { ChangePasswordSection } from './sections/ChangePasswordSection';\r\nimport { SecuritySection } from './sections/SecuritySection';\r\nimport useConfigurationsModal from './hooks/useConfigurationsModal';\r\nimport useIsMobile from '../../hooks/useIsMobile';\r\nimport { useAccountModals } from '../../store/useAccountModals';\r\n\r\nexport default function ConfigurationsMyAccountModal() {\r\n const {\r\n activeModal,\r\n config,\r\n initialSection,\r\n openDeleteAccount,\r\n openIsntPossibleDelete,\r\n close,\r\n } = useAccountModals();\r\n\r\n const open = activeModal === 'configurations';\r\n const { hasActiveSubscription, currencies = [] } = config;\r\n\r\n const isMobile = useIsMobile();\r\n const { activeSection, setActiveSection } = useConfigurationsModal({\r\n isOpen: open,\r\n initialSection,\r\n });\r\n\r\n const handleDeleteAccount = () => {\r\n close();\r\n if (hasActiveSubscription) {\r\n openIsntPossibleDelete();\r\n } else {\r\n openDeleteAccount();\r\n }\r\n };\r\n\r\n const tabTriggerClasses = cn(\r\n 'border-0! px-0 py-0',\r\n\r\n 'lg:rounded-md lg:flex lg:items-center lg:gap-2 lg:p-3 lg:justify-start lg:w-full',\r\n 'lg:bg-white lg:hover:bg-gray-100 lg:active:bg-gray-50 lg:border-0',\r\n 'lg:data-[state=active]:bg-gray-50',\r\n\r\n 'flex items-center gap-1.5 px-3 py-3 justify-center whitespace-nowrap',\r\n 'border-b-2 border-transparent',\r\n 'data-[state=active]:bg-gray-50 rounded-lg',\r\n\r\n 'text-gray-500 data-[state=active]:text-gray-950',\r\n 'hover:text-gray-900 transition-colors'\r\n );\r\n\r\n return (\r\n <Dialog open={open} onOpenChange={close}>\r\n <DialogContent\r\n showCloseButton={!isMobile}\r\n overlayClassName=\"bg-black/20 lg:bg-black/50\"\r\n className=\"\r\n flex flex-col p-0 gap-0 max-w-full! overflow-x-hidden border-0\r\n rounded-t-2xl rounded-b-none h-[100dvh] top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0!\r\n lg:flex-row lg:w-[892px]! lg:max-w-[892px]! lg:h-[626px]! lg:rounded-lg lg:border\r\n lg:top-[50%]! lg:bottom-auto! lg:left-[50%]! lg:right-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!\"\r\n >\r\n <DialogHeader className=\"sr-only\">\r\n <DialogTitle>Configurações</DialogTitle>\r\n </DialogHeader>\r\n <div className=\"md:hidden flex items-center justify-between px-5 py-3 border-b border-gray-200\">\r\n <span className=\"text-gray-950 paragraph-medium-semibold\">Configurações</span>\r\n <button\r\n type=\"button\"\r\n className=\"size-8 flex items-center justify-center text-gray-500 cursor-pointer\"\r\n onClick={close}\r\n >\r\n <X size={18} />\r\n </button>\r\n </div>\r\n <Tabs\r\n value={activeSection}\r\n onValueChange={(value) => setActiveSection(value as AccountSectionType)}\r\n orientation=\"vertical\"\r\n className=\"flex lg:flex-row flex-col w-full h-full flex-1 lg:h-full lg:pt-0 lg:gap-0\"\r\n >\r\n <TabsList\r\n className={cn(\r\n 'flex gap-0 bg-transparent border-b-0',\r\n\r\n 'lg:flex-col lg:items-stretch lg:justify-start lg:w-auto lg:min-w-60',\r\n 'lg:border-r lg:border-gray-200 lg:pl-5 lg:pr-5 lg:pt-5 lg:gap-5 lg:overflow-x-visible lg:self-stretch',\r\n\r\n 'flex-row items-center justify-start w-full overflow-x-auto scrollbar-hide shrink-0',\r\n 'px-4 py-3',\r\n '[mask-image:linear-gradient(to_right,transparent,black_16px,black_calc(100%-24px),transparent)] lg:[mask-image:none]'\r\n )}\r\n >\r\n <span className=\"hidden lg:block paragraph-medium-semibold text-gray-950 mb-0\">\r\n Configurações\r\n </span>\r\n\r\n <div className=\"lg:flex lg:flex-col flex flex-row lg:gap-0 gap-0 lg:w-full\">\r\n <TabsTrigger value={AccountSectionType.MY_PROFILE} className={tabTriggerClasses}>\r\n <User size={20} className=\"shrink-0\" />\r\n <span className=\"paragraph-small-medium\">Meu perfil</span>\r\n </TabsTrigger>\r\n\r\n <TabsTrigger value={AccountSectionType.PREFERENCES} className={tabTriggerClasses}>\r\n <Settings2 size={20} className=\"shrink-0\" />\r\n <span className=\"paragraph-small-medium\">Preferências</span>\r\n </TabsTrigger>\r\n\r\n <TabsTrigger value={AccountSectionType.SECURITY} className={tabTriggerClasses}>\r\n <Lock size={20} className=\"shrink-0\" />\r\n <span className=\"paragraph-small-medium\">Segurança</span>\r\n </TabsTrigger>\r\n </div>\r\n </TabsList>\r\n\r\n <div className=\"w-full flex-1 min-h-0 lg:h-full overflow-hidden lg:overflow-visible relative\">\r\n <TabsContent value={AccountSectionType.MY_PROFILE} className=\"h-full! relative overflow-hidden\">\r\n <MyProfileSection onClose={close} />\r\n </TabsContent>\r\n\r\n <TabsContent value={AccountSectionType.SECURITY} className=\"h-full! relative overflow-hidden\">\r\n <SecuritySection\r\n setActiveSection={setActiveSection}\r\n onClose={close}\r\n hasActiveSubscription={hasActiveSubscription}\r\n onDeleteAccount={handleDeleteAccount}\r\n />\r\n </TabsContent>\r\n\r\n <TabsContent value={AccountSectionType.CHANGE_PASSWORD} className=\"h-full! relative overflow-hidden\">\r\n <ChangePasswordSection onBack={() => setActiveSection(AccountSectionType.SECURITY)} />\r\n </TabsContent>\r\n\r\n <TabsContent value={AccountSectionType.PREFERENCES} className=\"h-full! relative overflow-hidden\">\r\n <PreferencesSection onClose={close} currencies={currencies} />\r\n </TabsContent>\r\n </div>\r\n </Tabs>\r\n </DialogContent>\r\n </Dialog>\r\n );\r\n}\r\n"],"mappings":";AAuEU,cAEF,YAFE;AArEV,SAAS,MAAM,WAAW,MAAM,SAAS;AACzC,SAAS,QAAQ,eAAe,cAAc,mBAAmB;AACjE,SAAS,MAAM,UAAU,aAAa,mBAAmB;AAEzD,SAAS,UAAU;AACnB,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,uBAAuB;AAChC,OAAO,4BAA4B;AACnC,OAAO,iBAAiB;AACxB,SAAS,wBAAwB;AAElB,SAAR,+BAAgD;AACrD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,iBAAiB;AAErB,QAAM,OAAO,gBAAgB;AAC7B,QAAM,EAAE,uBAAuB,aAAa,CAAC,EAAE,IAAI;AAEnD,QAAM,WAAW,YAAY;AAC7B,QAAM,EAAE,eAAe,iBAAiB,IAAI,uBAAuB;AAAA,IACjE,QAAQ;AAAA,IACR;AAAA,EACF,CAAC;AAED,QAAM,sBAAsB,MAAM;AAChC,UAAM;AACN,QAAI,uBAAuB;AACzB,6BAAuB;AAAA,IACzB,OAAO;AACL,wBAAkB;AAAA,IACpB;AAAA,EACF;AAEA,QAAM,oBAAoB;AAAA,IACxB;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,EACF;AAEA,SACE,oBAAC,UAAO,MAAY,cAAc,OAChC;AAAA,IAAC;AAAA;AAAA,MACC,iBAAiB,CAAC;AAAA,MAClB,kBAAiB;AAAA,MAC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AA,oCAAC,eAAY,OAAO,mBAAmB,YAAY,WAAU,oCAC3D,8BAAC,oBAAiB,SAAS,OAAO,GACpC;AAAA,gBAEA,oBAAC,eAAY,OAAO,mBAAmB,UAAU,WAAU,oCACzD;AAAA,kBAAC;AAAA;AAAA,oBACC;AAAA,oBACA,SAAS;AAAA,oBACT;AAAA,oBACA,iBAAiB;AAAA;AAAA,gBACnB,GACF;AAAA,gBAEA,oBAAC,eAAY,OAAO,mBAAmB,iBAAiB,WAAU,oCAChE,8BAAC,yBAAsB,QAAQ,MAAM,iBAAiB,mBAAmB,QAAQ,GAAG,GACtF;AAAA,gBAEA,oBAAC,eAAY,OAAO,mBAAmB,aAAa,WAAU,oCAC5D,8BAAC,sBAAmB,SAAS,OAAO,YAAwB,GAC9D;AAAA,iBACF;AAAA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { TriangleAlert } from "lucide-react";
4
+ import { toast } from "sonner";
5
+ import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../ui/overlay/Dialog";
6
+ import { Button } from "../ui/buttons/Button";
7
+ import { Toast } from "../ui/feedback/Toast";
8
+ import { useAccountModals } from "../../store/useAccountModals";
9
+ function ConfirmDeleteAccountModal() {
10
+ const { activeModal, pagesCount, close } = useAccountModals();
11
+ const open = activeModal === "confirmDelete";
12
+ const handleConfirm = () => {
13
+ toast.custom((t) => /* @__PURE__ */ jsx(Toast, { variant: "success", message: "Conta exclu\xEDda com sucesso", toastId: t }));
14
+ close();
15
+ };
16
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: close, children: /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col p-0 gap-0 max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!", children: [
17
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5 p-4 lg:p-5", children: [
18
+ /* @__PURE__ */ jsx(DialogHeader, { className: "p-0", children: /* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-gray-950", children: "Uma pena te ver ir!" }) }),
19
+ /* @__PURE__ */ jsxs("div", { className: "bg-red-50 p-4 lg:p-5 rounded-lg flex items-center gap-4", children: [
20
+ /* @__PURE__ */ jsx(TriangleAlert, { size: 20, className: "text-red-500 shrink-0", strokeWidth: 2 }),
21
+ /* @__PURE__ */ jsxs("p", { className: "paragraph-small-regular text-gray-600", children: [
22
+ "Todas suas",
23
+ " ",
24
+ /* @__PURE__ */ jsxs("span", { className: "font-semibold text-gray-950", children: [
25
+ pagesCount,
26
+ " p\xE1ginas"
27
+ ] }),
28
+ " ",
29
+ "ser\xE3o deletadas permanentemente. Essa a\xE7\xE3o \xE9",
30
+ " ",
31
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-gray-950", children: "irrevers\xEDvel!" })
32
+ ] })
33
+ ] })
34
+ ] }),
35
+ /* @__PURE__ */ jsx("div", { className: "h-px bg-gray-200" }),
36
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 p-4 lg:p-5", children: [
37
+ /* @__PURE__ */ jsx(Button, { className: "h-10 flex-1", onClick: close, children: "Manter minha conta" }),
38
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", className: "h-10! flex-1", onClick: handleConfirm, children: "Excluir mesmo assim" })
39
+ ] })
40
+ ] }) });
41
+ }
42
+ export {
43
+ ConfirmDeleteAccountModal as default
44
+ };
45
+ //# sourceMappingURL=ConfirmDeleteAccountModal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/account/ConfirmDeleteAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { TriangleAlert } from 'lucide-react';\nimport { toast } from 'sonner';\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Button } from '../ui/buttons/Button';\nimport { Toast } from '../ui/feedback/Toast';\nimport { useAccountModals } from '../../store/useAccountModals';\n\nexport default function ConfirmDeleteAccountModal() {\n const { activeModal, pagesCount, close } = useAccountModals();\n const open = activeModal === 'confirmDelete';\n\n const handleConfirm = () => {\n toast.custom((t) => (\n <Toast variant=\"success\" message=\"Conta excluída com sucesso\" toastId={t} />\n ));\n close();\n };\n\n return (\n <Dialog open={open} onOpenChange={close}>\n <DialogContent className=\"flex flex-col p-0 gap-0 max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!\">\n <div className=\"flex flex-col gap-5 p-4 lg:p-5\">\n <DialogHeader className=\"p-0\">\n <DialogTitle className=\"paragraph-medium-semibold text-gray-950\">\n Uma pena te ver ir!\n </DialogTitle>\n </DialogHeader>\n\n <div className=\"bg-red-50 p-4 lg:p-5 rounded-lg flex items-center gap-4\">\n <TriangleAlert size={20} className=\"text-red-500 shrink-0\" strokeWidth={2} />\n <p className=\"paragraph-small-regular text-gray-600\">\n Todas suas{' '}\n <span className=\"font-semibold text-gray-950\">{pagesCount} páginas</span>{' '}\n serão deletadas permanentemente. Essa ação é{' '}\n <span className=\"font-semibold text-gray-950\">irreversível!</span>\n </p>\n </div>\n </div>\n\n <div className=\"h-px bg-gray-200\" />\n\n <div className=\"flex items-center gap-2 p-4 lg:p-5\">\n <Button className=\"h-10 flex-1\" onClick={close}>\n Manter minha conta\n </Button>\n <Button variant=\"secondary\" className=\"h-10! flex-1\" onClick={handleConfirm}>\n Excluir mesmo assim\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAeM,cAmBQ,YAnBR;AAbN,SAAS,qBAAqB;AAC9B,SAAS,aAAa;AACtB,SAAS,QAAQ,eAAe,cAAc,mBAAmB;AACjE,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,wBAAwB;AAElB,SAAR,4BAA6C;AAClD,QAAM,EAAE,aAAa,YAAY,MAAM,IAAI,iBAAiB;AAC5D,QAAM,OAAO,gBAAgB;AAE7B,QAAM,gBAAgB,MAAM;AAC1B,UAAM,OAAO,CAAC,MACZ,oBAAC,SAAM,SAAQ,WAAU,SAAQ,iCAA6B,SAAS,GAAG,CAC3E;AACD,UAAM;AAAA,EACR;AAEA,SACE,oBAAC,UAAO,MAAY,cAAc,OAChC,+BAAC,iBAAc,WAAU,2NACvB;AAAA,yBAAC,SAAI,WAAU,kCACb;AAAA,0BAAC,gBAAa,WAAU,OACtB,8BAAC,eAAY,WAAU,2CAA0C,iCAEjE,GACF;AAAA,MAEA,qBAAC,SAAI,WAAU,2DACb;AAAA,4BAAC,iBAAc,MAAM,IAAI,WAAU,yBAAwB,aAAa,GAAG;AAAA,QAC3E,qBAAC,OAAE,WAAU,yCAAwC;AAAA;AAAA,UACxC;AAAA,UACX,qBAAC,UAAK,WAAU,+BAA+B;AAAA;AAAA,YAAW;AAAA,aAAQ;AAAA,UAAQ;AAAA,UAAI;AAAA,UACjC;AAAA,UAC7C,oBAAC,UAAK,WAAU,+BAA8B,8BAAa;AAAA,WAC7D;AAAA,SACF;AAAA,OACF;AAAA,IAEA,oBAAC,SAAI,WAAU,oBAAmB;AAAA,IAElC,qBAAC,SAAI,WAAU,sCACb;AAAA,0BAAC,UAAO,WAAU,eAAc,SAAS,OAAO,gCAEhD;AAAA,MACA,oBAAC,UAAO,SAAQ,aAAY,WAAU,gBAAe,SAAS,eAAe,iCAE7E;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -0,0 +1,123 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState, useCallback } from "react";
4
+ import { Lock, TriangleAlert } from "lucide-react";
5
+ import { toast } from "sonner";
6
+ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../ui/overlay/Dialog";
7
+ import { Button } from "../ui/buttons/Button";
8
+ import { FormField } from "../ui/form/FormField";
9
+ import { SelectField } from "../ui/form/SelectField";
10
+ import { TextAreaField } from "../ui/form/TextAreaField";
11
+ import { Toast } from "../ui/feedback/Toast";
12
+ import usePasswordVisibility from "../../hooks/usePasswordVisibility";
13
+ import { useAccountModals } from "../../store/useAccountModals";
14
+ import { AccountSectionType } from "../../enums/AccountSectionType";
15
+ const REASON_OPTIONS = [
16
+ { value: "sem-funcao", label: "A ferramenta n\xE3o possui uma fun\xE7\xE3o que eu preciso" },
17
+ { value: "problemas", label: "Encontrei problemas t\xE9cnicos ou erros no sistema" },
18
+ { value: "suporte", label: "Tive problemas com o suporte ou atendimento" },
19
+ { value: "demora", label: "As atualiza\xE7\xF5es demoram mais do que o esperado" },
20
+ { value: "temporario", label: "O cancelamento \xE9 tempor\xE1rio" },
21
+ { value: "outro", label: "Outro motivo" }
22
+ ];
23
+ function DeleteAccountModal() {
24
+ const { activeModal, pagesCount, openConfigurations, openConfirmDelete, close } = useAccountModals();
25
+ const open = activeModal === "deleteAccount";
26
+ const [reason, setReason] = useState("");
27
+ const [description, setDescription] = useState("");
28
+ const [password, setPassword] = useState("");
29
+ const { showPassword, togglePassword } = usePasswordVisibility();
30
+ const isFormValid = Boolean(reason && description && password);
31
+ const resetForm = useCallback(() => {
32
+ setReason("");
33
+ setDescription("");
34
+ setPassword("");
35
+ }, []);
36
+ const handleClose = () => {
37
+ resetForm();
38
+ openConfigurations(AccountSectionType.SECURITY);
39
+ };
40
+ const handleDelete = (e) => {
41
+ e.preventDefault();
42
+ if (!isFormValid) {
43
+ toast.custom((t) => /* @__PURE__ */ jsx(Toast, { variant: "error", message: "Preencha todos os campos obrigat\xF3rios", toastId: t }));
44
+ return;
45
+ }
46
+ resetForm();
47
+ openConfirmDelete(pagesCount);
48
+ };
49
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsx(DialogContent, { className: "flex flex-col p-0 gap-0 max-w-full! border-0 rounded-t-2xl rounded-b-none h-[100dvh] top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0! lg:max-w-lg! lg:h-auto! lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]! overflow-y-auto", children: /* @__PURE__ */ jsxs("form", { onSubmit: handleDelete, className: "flex flex-col flex-1 lg:flex-none", children: [
50
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 p-4 lg:p-6 flex-1 lg:flex-none", children: [
51
+ /* @__PURE__ */ jsxs(DialogHeader, { className: "p-0", children: [
52
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-fit bg-red-50 rounded-lg p-2.5 mb-5", children: /* @__PURE__ */ jsx(TriangleAlert, { size: 20, className: "text-red-500" }) }),
53
+ /* @__PURE__ */ jsx(DialogTitle, { children: "Excluir conta" }),
54
+ /* @__PURE__ */ jsxs(DialogDescription, { className: "paragraph-small-regular", children: [
55
+ "Esta a\xE7\xE3o \xE9 ",
56
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-gray-950", children: "irrevers\xEDvel" }),
57
+ ". Ao confirmar, sua conta e todos os seus dados ser\xE3o exclu\xEDdos."
58
+ ] })
59
+ ] }),
60
+ /* @__PURE__ */ jsx(
61
+ SelectField,
62
+ {
63
+ label: "Motivo do cancelamento",
64
+ required: true,
65
+ placeholder: "Selecione",
66
+ options: REASON_OPTIONS,
67
+ value: reason,
68
+ onChange: (value) => setReason(value),
69
+ className: "h-10!"
70
+ }
71
+ ),
72
+ /* @__PURE__ */ jsxs("div", { children: [
73
+ /* @__PURE__ */ jsx(
74
+ TextAreaField,
75
+ {
76
+ label: "Descreva o que levou a tomar essa decis\xE3o",
77
+ required: true,
78
+ placeholder: "Explique sua decis\xE3o...",
79
+ value: description,
80
+ onChange: (e) => setDescription(e.target.value),
81
+ rows: 4,
82
+ maxLength: 400
83
+ }
84
+ ),
85
+ /* @__PURE__ */ jsxs("span", { className: "paragraph-xsmall-medium text-gray-600 text-left mt-1 block", children: [
86
+ description.length,
87
+ "/400 caracteres"
88
+ ] })
89
+ ] }),
90
+ /* @__PURE__ */ jsx(
91
+ FormField,
92
+ {
93
+ className: "text-gray-600",
94
+ label: "Senha",
95
+ type: "password",
96
+ placeholder: "Informe sua senha",
97
+ leftIcon: Lock,
98
+ value: password,
99
+ onChange: (e) => setPassword(e.target.value),
100
+ classnameContainer: "h-10!",
101
+ showPassword,
102
+ onTogglePassword: togglePassword
103
+ }
104
+ )
105
+ ] }),
106
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2 p-4 lg:p-6 border-t border-gray-200 bg-white mt-auto lg:mt-0", children: [
107
+ /* @__PURE__ */ jsx(
108
+ Button,
109
+ {
110
+ variant: "default",
111
+ className: "h-10 flex-1 bg-gray-950 text-white hover:bg-gray-800",
112
+ type: "submit",
113
+ children: "Excluir conta"
114
+ }
115
+ ),
116
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", className: "h-10 flex-1", type: "button", onClick: handleClose, children: "Fechar" })
117
+ ] })
118
+ ] }) }) });
119
+ }
120
+ export {
121
+ DeleteAccountModal as default
122
+ };
123
+ //# sourceMappingURL=DeleteAccountModal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/account/DeleteAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useCallback } from 'react';\nimport { Lock, TriangleAlert } from 'lucide-react';\nimport { toast } from 'sonner';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Button } from '../ui/buttons/Button';\nimport { FormField } from '../ui/form/FormField';\nimport { SelectField } from '../ui/form/SelectField';\nimport { TextAreaField } from '../ui/form/TextAreaField';\nimport { Toast } from '../ui/feedback/Toast';\nimport usePasswordVisibility from '../../hooks/usePasswordVisibility';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport { AccountSectionType } from '../../enums/AccountSectionType';\n\nconst REASON_OPTIONS = [\n { value: 'sem-funcao', label: 'A ferramenta não possui uma função que eu preciso' },\n { value: 'problemas', label: 'Encontrei problemas técnicos ou erros no sistema' },\n { value: 'suporte', label: 'Tive problemas com o suporte ou atendimento' },\n { value: 'demora', label: 'As atualizações demoram mais do que o esperado' },\n { value: 'temporario', label: 'O cancelamento é temporário' },\n { value: 'outro', label: 'Outro motivo' },\n];\n\nexport default function DeleteAccountModal() {\n const { activeModal, pagesCount, openConfigurations, openConfirmDelete, close } = useAccountModals();\n const open = activeModal === 'deleteAccount';\n\n const [reason, setReason] = useState('');\n const [description, setDescription] = useState('');\n const [password, setPassword] = useState('');\n const { showPassword, togglePassword } = usePasswordVisibility();\n\n const isFormValid = Boolean(reason && description && password);\n\n const resetForm = useCallback(() => {\n setReason('');\n setDescription('');\n setPassword('');\n }, []);\n\n const handleClose = () => {\n resetForm();\n openConfigurations(AccountSectionType.SECURITY);\n };\n\n const handleDelete = (e: React.FormEvent) => {\n e.preventDefault();\n if (!isFormValid) {\n toast.custom((t) => (\n <Toast variant=\"error\" message=\"Preencha todos os campos obrigatórios\" toastId={t} />\n ));\n return;\n }\n resetForm();\n openConfirmDelete(pagesCount);\n };\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"flex flex-col p-0 gap-0 max-w-full! border-0 rounded-t-2xl rounded-b-none h-[100dvh] top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0! lg:max-w-lg! lg:h-auto! lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]! overflow-y-auto\">\n <form onSubmit={handleDelete} className=\"flex flex-col flex-1 lg:flex-none\">\n <div className=\"flex flex-col gap-6 p-4 lg:p-6 flex-1 lg:flex-none\">\n <DialogHeader className=\"p-0\">\n <div className=\"flex items-center justify-center w-fit bg-red-50 rounded-lg p-2.5 mb-5\">\n <TriangleAlert size={20} className=\"text-red-500\" />\n </div>\n <DialogTitle>Excluir conta</DialogTitle>\n <DialogDescription className=\"paragraph-small-regular\">\n Esta ação é <span className=\"font-semibold text-gray-950\">irreversível</span>. Ao\n confirmar, sua conta e todos os seus dados serão excluídos.\n </DialogDescription>\n </DialogHeader>\n\n <SelectField\n label=\"Motivo do cancelamento\"\n required\n placeholder=\"Selecione\"\n options={REASON_OPTIONS}\n value={reason}\n onChange={(value) => setReason(value as string)}\n className=\"h-10!\"\n />\n\n <div>\n <TextAreaField\n label=\"Descreva o que levou a tomar essa decisão\"\n required\n placeholder=\"Explique sua decisão...\"\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n rows={4}\n maxLength={400}\n />\n <span className=\"paragraph-xsmall-medium text-gray-600 text-left mt-1 block\">\n {description.length}/400 caracteres\n </span>\n </div>\n\n <FormField\n className=\"text-gray-600\"\n label=\"Senha\"\n type=\"password\"\n placeholder=\"Informe sua senha\"\n leftIcon={Lock}\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n classnameContainer=\"h-10!\"\n showPassword={showPassword}\n onTogglePassword={togglePassword}\n />\n </div>\n\n <div className=\"flex flex-row items-center gap-2 p-4 lg:p-6 border-t border-gray-200 bg-white mt-auto lg:mt-0\">\n <Button\n variant=\"default\"\n className=\"h-10 flex-1 bg-gray-950 text-white hover:bg-gray-800\"\n type=\"submit\"\n >\n Excluir conta\n </Button>\n <Button variant=\"secondary\" className=\"h-10 flex-1\" type=\"button\" onClick={handleClose}>\n Fechar\n </Button>\n </div>\n </form>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAkDQ,cAkBM,YAlBN;AAhDR,SAAS,UAAU,mBAAmB;AACtC,SAAS,MAAM,qBAAqB;AACpC,SAAS,aAAa;AACtB,SAAS,QAAQ,eAAe,mBAAmB,cAAc,mBAAmB;AACpF,SAAS,cAAc;AACvB,SAAS,iBAA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,UACR,WAAU;AAAA,UACV,MAAK;AAAA,UACN;AAAA;AAAA,MAED;AAAA,MACA,oBAAC,UAAO,SAAQ,aAAY,WAAU,eAAc,MAAK,UAAS,SAAS,aAAa,oBAExF;AAAA,OACF;AAAA,KACF,GACF,GACF;AAEJ;","names":[]}
@@ -0,0 +1,42 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { TriangleAlert } from "lucide-react";
4
+ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../ui/overlay/Dialog";
5
+ import { Button } from "../ui/buttons/Button";
6
+ import { useAccountModals } from "../../store/useAccountModals";
7
+ function IsntPossibleDeleteAccountModal() {
8
+ const { activeModal, close, config } = useAccountModals();
9
+ const { onGoToSubscription } = config;
10
+ const open = activeModal === "isntPossibleDelete";
11
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: close, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!", children: [
12
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
13
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-fit bg-red-50 rounded-lg p-2.5", children: /* @__PURE__ */ jsx(TriangleAlert, { size: 20, className: "text-red-500" }) }),
14
+ /* @__PURE__ */ jsxs(DialogHeader, { className: "p-0 gap-2", children: [
15
+ /* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-gray-950", children: "N\xE3o \xE9 poss\xEDvel excluir a conta" }),
16
+ /* @__PURE__ */ jsxs(DialogDescription, { className: "paragraph-small-regular text-gray-600", children: [
17
+ "Voc\xEA tem uma assinatura ativa. Para excluir sua conta,",
18
+ " ",
19
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-gray-950", children: "primeiro cancele a assinatura" }),
20
+ " na p\xE1gina Assinatura e depois tente novamente."
21
+ ] })
22
+ ] })
23
+ ] }),
24
+ /* @__PURE__ */ jsx("div", { className: "h-px bg-gray-200 -mx-6" }),
25
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2", children: [
26
+ /* @__PURE__ */ jsx(Button, { className: "h-10 flex-1", onClick: close, children: "Ok, entendi" }),
27
+ /* @__PURE__ */ jsx(
28
+ Button,
29
+ {
30
+ variant: "secondary",
31
+ className: "h-10 flex-1",
32
+ onClick: onGoToSubscription ?? close,
33
+ children: "Ir para assinatura"
34
+ }
35
+ )
36
+ ] })
37
+ ] }) });
38
+ }
39
+ export {
40
+ IsntPossibleDeleteAccountModal as default
41
+ };
42
+ //# sourceMappingURL=IsntPossibleDeleteAccountModal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/account/IsntPossibleDeleteAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { TriangleAlert } from 'lucide-react';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Button } from '../ui/buttons/Button';\nimport { useAccountModals } from '../../store/useAccountModals';\n\nexport default function IsntPossibleDeleteAccountModal() {\n const { activeModal, close, config } = useAccountModals();\n const { onGoToSubscription } = config;\n const open = activeModal === 'isntPossibleDelete';\n\n return (\n <Dialog open={open} onOpenChange={close}>\n <DialogContent className=\"max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!\">\n <div className=\"flex flex-col gap-5\">\n <div className=\"flex items-center justify-center w-fit bg-red-50 rounded-lg p-2.5\">\n <TriangleAlert size={20} className=\"text-red-500\" />\n </div>\n <DialogHeader className=\"p-0 gap-2\">\n <DialogTitle className=\"paragraph-medium-semibold text-gray-950\">\n Não é possível excluir a conta\n </DialogTitle>\n <DialogDescription className=\"paragraph-small-regular text-gray-600\">\n Você tem uma assinatura ativa. Para excluir sua conta,{' '}\n <span className=\"font-semibold text-gray-950\">primeiro cancele a assinatura</span> na\n página Assinatura e depois tente novamente.\n </DialogDescription>\n </DialogHeader>\n </div>\n\n <div className=\"h-px bg-gray-200 -mx-6\" />\n\n <div className=\"flex flex-row items-center gap-2\">\n <Button className=\"h-10 flex-1\" onClick={close}>\n Ok, entendi\n </Button>\n <Button\n variant=\"secondary\"\n className=\"h-10 flex-1\"\n onClick={onGoToSubscription ?? close}\n >\n Ir para assinatura\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAiBY,cAMA,YANA;AAfZ,SAAS,qBAAqB;AAC9B,SAAS,QAAQ,eAAe,mBAAmB,cAAc,mBAAmB;AACpF,SAAS,cAAc;AACvB,SAAS,wBAAwB;AAElB,SAAR,iCAAkD;AACvD,QAAM,EAAE,aAAa,OAAO,OAAO,IAAI,iBAAiB;AACxD,QAAM,EAAE,mBAAmB,IAAI;AAC/B,QAAM,OAAO,gBAAgB;AAE7B,SACE,oBAAC,UAAO,MAAY,cAAc,OAChC,+BAAC,iBAAc,WAAU,mMACvB;AAAA,yBAAC,SAAI,WAAU,uBACb;AAAA,0BAAC,SAAI,WAAU,qEACb,8BAAC,iBAAc,MAAM,IAAI,WAAU,gBAAe,GACpD;AAAA,MACA,qBAAC,gBAAa,WAAU,aACtB;AAAA,4BAAC,eAAY,WAAU,2CAA0C,qDAEjE;AAAA,QACA,qBAAC,qBAAkB,WAAU,yCAAwC;AAAA;AAAA,UACZ;AAAA,UACvD,oBAAC,UAAK,WAAU,+BAA8B,2CAA6B;AAAA,UAAO;AAAA,WAEpF;AAAA,SACF;AAAA,OACF;AAAA,IAEA,oBAAC,SAAI,WAAU,0BAAyB;AAAA,IAExC,qBAAC,SAAI,WAAU,oCACb;AAAA,0BAAC,UAAO,WAAU,eAAc,SAAS,OAAO,yBAEhD;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,SAAS,sBAAsB;AAAA,UAChC;AAAA;AAAA,MAED;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import Image from "next/image";
4
+ import { ProfilePopover } from "./ProfilePopover";
5
+ import { useAccountModals } from "../../store/useAccountModals";
6
+ function AppMobileNavBar({
7
+ appIconActive = false,
8
+ appIconIndicator = false,
9
+ logoIndicator = false,
10
+ extraLeftSlot,
11
+ rightActionSlot,
12
+ menuItems = [],
13
+ onCreditsClick,
14
+ logoutOverlay
15
+ }) {
16
+ const { openConfigurations } = useAccountModals();
17
+ return /* @__PURE__ */ jsxs("div", { className: "fixed top-0 left-0 right-0 flex md:hidden items-center justify-between p-4 bg-white z-50 border-b border-gray-200", children: [
18
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
19
+ /* @__PURE__ */ jsxs("div", { className: "relative size-10 flex items-center justify-center", children: [
20
+ /* @__PURE__ */ jsx(Image, { src: "/icons/great-icon.svg", alt: "GreatApps", width: 28, height: 28 }),
21
+ logoIndicator && /* @__PURE__ */ jsx("div", { className: "absolute bottom-[-17px] left-1/2 -translate-x-1/2 w-5 h-[3px] bg-gray-950 rounded-t-xl" })
22
+ ] }),
23
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
24
+ /* @__PURE__ */ jsx(
25
+ "div",
26
+ {
27
+ className: `size-10 flex items-center justify-center rounded-lg transition-colors duration-300 ${appIconActive ? "bg-pages-300" : "bg-pages-50"}`,
28
+ children: /* @__PURE__ */ jsx(Image, { src: "/icons/icon-navbar.svg", alt: "GreatPages", width: 24, height: 24 })
29
+ }
30
+ ),
31
+ appIconIndicator && /* @__PURE__ */ jsx("div", { className: "absolute -bottom-[17px] left-1/2 -translate-x-1/2 w-5 h-[3px] bg-pages-300 rounded-t-xl" })
32
+ ] }),
33
+ extraLeftSlot
34
+ ] }),
35
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
36
+ /* @__PURE__ */ jsx(
37
+ ProfilePopover,
38
+ {
39
+ side: "bottom",
40
+ align: "end",
41
+ contentClassName: "",
42
+ onEditProfile: () => openConfigurations(),
43
+ onCreditsClick,
44
+ menuItems,
45
+ logoutOverlay
46
+ }
47
+ ),
48
+ rightActionSlot
49
+ ] })
50
+ ] });
51
+ }
52
+ export {
53
+ AppMobileNavBar
54
+ };
55
+ //# sourceMappingURL=AppMobileNavBar.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/layouts/AppMobileNavBar.tsx"],"sourcesContent":["'use client';\n\nimport { ReactNode } from 'react';\nimport Image from 'next/image';\nimport { ProfilePopover } from './ProfilePopover';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport type { ProfileMenuItem } from './ProfilePopover';\n\nexport interface AppMobileNavBarProps {\n appIconActive?: boolean;\n /** Shows the colored indicator bar below the app icon */\n appIconIndicator?: boolean;\n /** Shows the gray indicator bar below the GreatApps logo */\n logoIndicator?: boolean;\n /** Extra slot rendered after the app icon (e.g. project selector) */\n extraLeftSlot?: ReactNode;\n /** Required: the right-side action element (toggle button, sheet button, etc.) */\n rightActionSlot: ReactNode;\n menuItems?: ProfileMenuItem[];\n onCreditsClick?: () => void;\n logoutOverlay?: ReactNode;\n}\n\nexport function AppMobileNavBar({\n appIconActive = false,\n appIconIndicator = false,\n logoIndicator = false,\n extraLeftSlot,\n rightActionSlot,\n menuItems = [],\n onCreditsClick,\n logoutOverlay,\n}: AppMobileNavBarProps) {\n const { openConfigurations } = useAccountModals();\n\n return (\n <div className=\"fixed top-0 left-0 right-0 flex md:hidden items-center justify-between p-4 bg-white z-50 border-b border-gray-200\">\n <div className=\"flex items-center gap-1.5\">\n <div className=\"relative size-10 flex items-center justify-center\">\n <Image src=\"/icons/great-icon.svg\" alt=\"GreatApps\" width={28} height={28} />\n {logoIndicator && (\n <div className=\"absolute bottom-[-17px] left-1/2 -translate-x-1/2 w-5 h-[3px] bg-gray-950 rounded-t-xl\" />\n )}\n </div>\n <div className=\"relative\">\n <div\n className={`size-10 flex items-center justify-center rounded-lg transition-colors duration-300 ${\n appIconActive ? 'bg-pages-300' : 'bg-pages-50'\n }`}\n >\n <Image src=\"/icons/icon-navbar.svg\" alt=\"GreatPages\" width={24} height={24} />\n </div>\n {appIconIndicator && (\n <div className=\"absolute -bottom-[17px] left-1/2 -translate-x-1/2 w-5 h-[3px] bg-pages-300 rounded-t-xl\" />\n )}\n </div>\n {extraLeftSlot}\n </div>\n <div className=\"flex items-center gap-1.5\">\n <ProfilePopover\n side=\"bottom\"\n align=\"end\"\n contentClassName=\"\"\n onEditProfile={() => openConfigurations()}\n onCreditsClick={onCreditsClick}\n menuItems={menuItems}\n logoutOverlay={logoutOverlay}\n />\n {rightActionSlot}\n </div>\n </div>\n );\n}\n"],"mappings":";AAsCQ,SACE,KADF;AAnCR,OAAO,WAAW;AAClB,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AAkB1B,SAAS,gBAAgB;AAAA,EAC9B,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA,YAAY,CAAC;AAAA,EACb;AAAA,EACA;AACF,GAAyB;AACvB,QAAM,EAAE,mBAAmB,IAAI,iBAAiB;AAEhD,SACE,qBAAC,SAAI,WAAU,qHACb;AAAA,yBAAC,SAAI,WAAU,6BACb;AAAA,2BAAC,SAAI,WAAU,qDACb;AAAA,4BAAC,SAAM,KAAI,yBAAwB,KAAI,aAAY,OAAO,IAAI,QAAQ,IAAI;AAAA,QACzE,iBACC,oBAAC,SAAI,WAAU,0FAAyF;AAAA,SAE5G;AAAA,MACA,qBAAC,SAAI,WAAU,YACb;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,sFACT,gBAAgB,iBAAiB,aACnC;AAAA,YAEA,8BAAC,SAAM,KAAI,0BAAyB,KAAI,cAAa,OAAO,IAAI,QAAQ,IAAI;AAAA;AAAA,QAC9E;AAAA,QACC,oBACC,oBAAC,SAAI,WAAU,2FAA0F;AAAA,SAE7G;AAAA,MACC;AAAA,OACH;AAAA,IACA,qBAAC,SAAI,WAAU,6BACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAM;AAAA,UACN,kBAAiB;AAAA,UACjB,eAAe,MAAM,mBAAmB;AAAA,UACxC;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACF;AAAA,MACC;AAAA,OACH;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,77 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import Image from "next/image";
4
+ import { useRouter } from "next/navigation";
5
+ import { NavBar } from "./NavBar";
6
+ import { ProfilePopover } from "./ProfilePopover";
7
+ import { NotificationsPopover } from "./NotificationsPopover";
8
+ import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/overlay/Tooltip";
9
+ import { useAccountModals } from "../../store/useAccountModals";
10
+ function AppNavBar({
11
+ onLogoClick,
12
+ logoIndicatorClassName,
13
+ appIconHref = "/",
14
+ appIconActive = false,
15
+ appIconIndicator = false,
16
+ showExpandButton = false,
17
+ onExpandClick,
18
+ menuItems = [],
19
+ onCreditsClick,
20
+ notifications,
21
+ onNotificationsViewAll,
22
+ logoutOverlay
23
+ }) {
24
+ const router = useRouter();
25
+ const { openConfigurations } = useAccountModals();
26
+ const handleLogoClick = onLogoClick ?? (() => router.push("/"));
27
+ const handleAppIconClick = () => router.push(appIconHref);
28
+ return /* @__PURE__ */ jsxs(
29
+ NavBar,
30
+ {
31
+ onLogoClick: handleLogoClick,
32
+ logoIndicatorClassName,
33
+ showExpandButton,
34
+ onExpandClick,
35
+ appIconSlot: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
36
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
37
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, onClick: handleAppIconClick, children: /* @__PURE__ */ jsx(
38
+ "div",
39
+ {
40
+ className: `size-10 flex items-center justify-center rounded-lg hover:bg-pages-100 cursor-pointer transition-colors duration-300 ${appIconActive ? "bg-pages-300" : "bg-pages-50"}`,
41
+ children: /* @__PURE__ */ jsx(Image, { src: "/icons/icon-navbar.svg", alt: "GreatPages", width: 24, height: 24 })
42
+ }
43
+ ) }),
44
+ /* @__PURE__ */ jsx(TooltipContent, { side: "right", children: "GreatPages" })
45
+ ] }),
46
+ /* @__PURE__ */ jsx(
47
+ "div",
48
+ {
49
+ className: `absolute -left-4 top-1/2 -translate-y-1/2 w-[3px] h-5 bg-pages-300 rounded-r-xl transition-opacity duration-300 ${appIconIndicator ? "opacity-100" : "opacity-0"}`
50
+ }
51
+ )
52
+ ] }),
53
+ children: [
54
+ /* @__PURE__ */ jsx(
55
+ NotificationsPopover,
56
+ {
57
+ notifications,
58
+ onViewAll: onNotificationsViewAll
59
+ }
60
+ ),
61
+ /* @__PURE__ */ jsx(
62
+ ProfilePopover,
63
+ {
64
+ onEditProfile: () => openConfigurations(),
65
+ onCreditsClick,
66
+ menuItems,
67
+ logoutOverlay
68
+ }
69
+ )
70
+ ]
71
+ }
72
+ );
73
+ }
74
+ export {
75
+ AppNavBar
76
+ };
77
+ //# sourceMappingURL=AppNavBar.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/layouts/AppNavBar.tsx"],"sourcesContent":["'use client';\n\nimport { ReactNode } from 'react';\nimport Image from 'next/image';\nimport { useRouter } from 'next/navigation';\nimport { NavBar } from './NavBar';\nimport { ProfilePopover } from './ProfilePopover';\nimport { NotificationsPopover } from './NotificationsPopover';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../ui/overlay/Tooltip';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport type { ProfileMenuItem } from './ProfilePopover';\nimport type { NotificationData } from './NotificationsPopover';\n\nexport interface AppNavBarProps {\n onLogoClick?: () => void;\n logoIndicatorClassName?: string;\n appIconHref?: string;\n appIconActive?: boolean;\n /** Controls the left-side indicator bar on the app icon (opacity transition) */\n appIconIndicator?: boolean;\n showExpandButton?: boolean;\n onExpandClick?: () => void;\n menuItems?: ProfileMenuItem[];\n onCreditsClick?: () => void;\n notifications?: NotificationData[];\n onNotificationsViewAll?: () => void;\n logoutOverlay?: ReactNode;\n}\n\nexport function AppNavBar({\n onLogoClick,\n logoIndicatorClassName,\n appIconHref = '/',\n appIconActive = false,\n appIconIndicator = false,\n showExpandButton = false,\n onExpandClick,\n menuItems = [],\n onCreditsClick,\n notifications,\n onNotificationsViewAll,\n logoutOverlay,\n}: AppNavBarProps) {\n const router = useRouter();\n const { openConfigurations } = useAccountModals();\n\n const handleLogoClick = onLogoClick ?? (() => router.push('/'));\n const handleAppIconClick = () => router.push(appIconHref);\n\n return (\n <NavBar\n onLogoClick={handleLogoClick}\n logoIndicatorClassName={logoIndicatorClassName}\n showExpandButton={showExpandButton}\n onExpandClick={onExpandClick}\n appIconSlot={\n <div className=\"relative\">\n <Tooltip>\n <TooltipTrigger asChild onClick={handleAppIconClick}>\n <div\n className={`size-10 flex items-center justify-center rounded-lg hover:bg-pages-100 cursor-pointer transition-colors duration-300 ${\n appIconActive ? 'bg-pages-300' : 'bg-pages-50'\n }`}\n >\n <Image src=\"/icons/icon-navbar.svg\" alt=\"GreatPages\" width={24} height={24} />\n </div>\n </TooltipTrigger>\n <TooltipContent side=\"right\">GreatPages</TooltipContent>\n </Tooltip>\n <div\n className={`absolute -left-4 top-1/2 -translate-y-1/2 w-[3px] h-5 bg-pages-300 rounded-r-xl transition-opacity duration-300 ${\n appIconIndicator ? 'opacity-100' : 'opacity-0'\n }`}\n />\n </div>\n }\n >\n <NotificationsPopover\n notifications={notifications}\n onViewAll={onNotificationsViewAll}\n />\n <ProfilePopover\n onEditProfile={() => openConfigurations()}\n onCreditsClick={onCreditsClick}\n menuItems={menuItems}\n logoutOverlay={logoutO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AmB;AAAA,YACxC;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { Fragment, jsx } from "react/jsx-runtime";
3
+ import { useModalManager } from "../../store/useModalManager";
4
+ function ModalManager({ registry }) {
5
+ const { modalStack } = useModalManager();
6
+ if (modalStack.length === 0) return null;
7
+ return /* @__PURE__ */ jsx(Fragment, { children: modalStack.map((modal) => {
8
+ const ModalComponent = registry[modal.key];
9
+ if (!ModalComponent) {
10
+ console.warn(`Modal "${modal.key}" not found in registry`);
11
+ return null;
12
+ }
13
+ return /* @__PURE__ */ jsx(ModalComponent, {}, modal.key);
14
+ }) });
15
+ }
16
+ export {
17
+ ModalManager
18
+ };
19
+ //# sourceMappingURL=ModalManager.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/modals/ModalManager.tsx"],"sourcesContent":["'use client';\n\nimport { ComponentType } from 'react';\nimport { useModalManager } from '../../store/useModalManager';\n\ninterface ModalManagerProps {\n registry: Record<string, ComponentType>;\n}\n\nexport function ModalManager({ registry }: ModalManagerProps) {\n const { modalStack } = useModalManager();\n\n if (modalStack.length === 0) return null;\n\n return (\n <>\n {modalStack.map((modal) => {\n const ModalComponent = registry[modal.key];\n\n if (!ModalComponent) {\n console.warn(`Modal \"${modal.key}\" not found in registry`);\n return null;\n }\n\n return <ModalComponent key={modal.key} />;\n })}\n </>\n );\n}\n"],"mappings":";AAeI,mBASW,WATX;AAZJ,SAAS,uBAAuB;AAMzB,SAAS,aAAa,EAAE,SAAS,GAAsB;AAC5D,QAAM,EAAE,WAAW,IAAI,gBAAgB;AAEvC,MAAI,WAAW,WAAW,EAAG,QAAO;AAEpC,SACE,gCACG,qBAAW,IAAI,CAAC,UAAU;AACzB,UAAM,iBAAiB,SAAS,MAAM,GAAG;AAEzC,QAAI,CAAC,gBAAgB;AACnB,cAAQ,KAAK,UAAU,MAAM,GAAG,yBAAyB;AACzD,aAAO;AAAA,IACT;AAEA,WAAO,oBAAC,oBAAoB,MAAM,GAAK;AAAA,EACzC,CAAC,GACH;AAEJ;","names":[]}
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useEffect } from "react";
4
+ import AccountModals from "../account/AccountModals";
5
+ import { ModalManager } from "./ModalManager";
6
+ import { useAccountModals } from "../../store/useAccountModals";
7
+ function Modals({ registry, hasActiveSubscription, currencies, onGoToSubscription }) {
8
+ const { updateConfig } = useAccountModals();
9
+ useEffect(() => {
10
+ updateConfig({ hasActiveSubscription, currencies, onGoToSubscription });
11
+ }, [hasActiveSubscription, currencies, onGoToSubscription, updateConfig]);
12
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
13
+ /* @__PURE__ */ jsx(AccountModals, {}),
14
+ /* @__PURE__ */ jsx(ModalManager, { registry })
15
+ ] });
16
+ }
17
+ export {
18
+ Modals
19
+ };
20
+ //# sourceMappingURL=Modals.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/modals/Modals.tsx"],"sourcesContent":["'use client';\n\nimport { ComponentType, useEffect } from 'react';\nimport AccountModals from '../account/AccountModals';\nimport { ModalManager } from './ModalManager';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport type { ComboboxOption } from '../ui/form/ComboboxField';\n\ninterface ModalsProps {\n registry: Record<string, ComponentType>;\n hasActiveSubscription?: boolean;\n currencies?: ComboboxOption[];\n onGoToSubscription?: () => void;\n}\n\nexport function Modals({ registry, hasActiveSubscription, currencies, onGoToSubscription }: ModalsProps) {\n const { updateConfig } = useAccountModals();\n\n useEffect(() => {\n updateConfig({ hasActiveSubscription, currencies, onGoToSubscription });\n }, [hasActiveSubscription, currencies, onGoToSubscription, updateConfig]);\n\n return (\n <>\n <AccountModals />\n <ModalManager registry={registry} />\n </>\n );\n}\n"],"mappings":";AAuBI,mBACE,KADF;AArBJ,SAAwB,iBAAiB;AACzC,OAAO,mBAAmB;AAC1B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAU1B,SAAS,OAAO,EAAE,UAAU,uBAAuB,YAAY,mBAAmB,GAAgB;AACvG,QAAM,EAAE,aAAa,IAAI,iBAAiB;AAE1C,YAAU,MAAM;AACd,iBAAa,EAAE,uBAAuB,YAAY,mBAAmB,CAAC;AAAA,EACxE,GAAG,CAAC,uBAAuB,YAAY,oBAAoB,YAAY,CAAC;AAExE,SACE,iCACE;AAAA,wBAAC,iBAAc;AAAA,IACf,oBAAC,gBAAa,UAAoB;AAAA,KACpC;AAEJ;","names":[]}