@greatapps/common 1.1.218 → 1.1.221

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 (117) hide show
  1. package/dist/components/account/ConfigurationsMyAccountModal.mjs +6 -6
  2. package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
  3. package/dist/components/account/ConfirmDeleteAccountModal.mjs +2 -2
  4. package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -1
  5. package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +2 -2
  6. package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -1
  7. package/dist/components/account/DeleteAccountModal.mjs +3 -3
  8. package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
  9. package/dist/components/account/DisableTwoFactorAuthModal.mjs +2 -2
  10. package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -1
  11. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +2 -2
  12. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
  13. package/dist/components/account/TwoFactorAuthModal.mjs +6 -6
  14. package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
  15. package/dist/components/account/sections/ChangeEmailModal.mjs +6 -6
  16. package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -1
  17. package/dist/components/account/sections/ChangePasswordSection.mjs +4 -4
  18. package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
  19. package/dist/components/account/sections/ChangePhoneModal.mjs +5 -5
  20. package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -1
  21. package/dist/components/account/sections/MyProfileSection.mjs +3 -3
  22. package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
  23. package/dist/components/account/sections/PreferencesSection.mjs +6 -6
  24. package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
  25. package/dist/components/account/sections/SecuritySection.mjs +3 -3
  26. package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
  27. package/dist/components/layouts/AppMobileNavBar.mjs +0 -1
  28. package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -1
  29. package/dist/components/layouts/MdSideBarNavigation.mjs +2 -2
  30. package/dist/components/layouts/MdSideBarNavigation.mjs.map +1 -1
  31. package/dist/components/layouts/NavBar.mjs +2 -2
  32. package/dist/components/layouts/NavBar.mjs.map +1 -1
  33. package/dist/components/layouts/NotificationsPopover.mjs +4 -4
  34. package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
  35. package/dist/components/layouts/ProfilePopover.mjs +7 -10
  36. package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
  37. package/dist/components/layouts/UsersSelectorPopover.mjs +5 -5
  38. package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
  39. package/dist/components/navigation/ProjectSelectorPopover.mjs +6 -6
  40. package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -1
  41. package/dist/components/navigation/subcomponents/ProjectSelector.mjs +5 -5
  42. package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
  43. package/dist/components/pages/notifications/Notifications.mjs +4 -4
  44. package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
  45. package/dist/components/ui/buttons/CopyButton.mjs +2 -2
  46. package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
  47. package/dist/components/ui/data-display/Accordion.mjs +2 -2
  48. package/dist/components/ui/data-display/Accordion.mjs.map +1 -1
  49. package/dist/components/ui/data-display/Pagination.mjs +7 -7
  50. package/dist/components/ui/data-display/Pagination.mjs.map +1 -1
  51. package/dist/components/ui/feedback/Toast.mjs +7 -7
  52. package/dist/components/ui/feedback/Toast.mjs.map +1 -1
  53. package/dist/components/ui/form/Calendar.mjs +7 -7
  54. package/dist/components/ui/form/Calendar.mjs.map +1 -1
  55. package/dist/components/ui/form/Checkbox.mjs +2 -2
  56. package/dist/components/ui/form/Checkbox.mjs.map +1 -1
  57. package/dist/components/ui/form/ComboboxField.mjs +4 -4
  58. package/dist/components/ui/form/ComboboxField.mjs.map +1 -1
  59. package/dist/components/ui/form/DateRangePicker.mjs +2 -2
  60. package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
  61. package/dist/components/ui/form/FormField.mjs +3 -3
  62. package/dist/components/ui/form/FormField.mjs.map +1 -1
  63. package/dist/components/ui/form/InputOtp.mjs +2 -2
  64. package/dist/components/ui/form/InputOtp.mjs.map +1 -1
  65. package/dist/components/ui/form/RadioGroup.mjs +2 -2
  66. package/dist/components/ui/form/RadioGroup.mjs.map +1 -1
  67. package/dist/components/ui/form/Select.mjs +5 -5
  68. package/dist/components/ui/form/Select.mjs.map +1 -1
  69. package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs.map +1 -1
  70. package/dist/components/ui/overlay/Command.mjs +2 -2
  71. package/dist/components/ui/overlay/Command.mjs.map +1 -1
  72. package/dist/components/ui/overlay/Dialog.mjs +2 -2
  73. package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
  74. package/dist/components/ui/overlay/Sheet.mjs +2 -2
  75. package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
  76. package/dist/components/widgets/notifications/NotificationCard.mjs +2 -2
  77. package/dist/components/widgets/notifications/NotificationCard.mjs.map +1 -1
  78. package/package.json +1 -2
  79. package/src/components/account/ConfigurationsMyAccountModal.tsx +150 -150
  80. package/src/components/account/ConfirmDeleteAccountModal.tsx +2 -2
  81. package/src/components/account/ConfirmGlobalPreferencesModal.tsx +66 -66
  82. package/src/components/account/DeleteAccountModal.tsx +3 -3
  83. package/src/components/account/DisableTwoFactorAuthModal.tsx +86 -86
  84. package/src/components/account/IsntPossibleDeleteAccountModal.tsx +2 -2
  85. package/src/components/account/TwoFactorAuthModal.tsx +223 -223
  86. package/src/components/account/sections/ChangeEmailModal.tsx +225 -225
  87. package/src/components/account/sections/ChangePasswordSection.tsx +64 -64
  88. package/src/components/account/sections/ChangePhoneModal.tsx +5 -5
  89. package/src/components/account/sections/MyProfileSection.tsx +327 -327
  90. package/src/components/account/sections/PreferencesSection.tsx +273 -273
  91. package/src/components/account/sections/SecuritySection.tsx +160 -160
  92. package/src/components/layouts/AppMobileNavBar.tsx +0 -1
  93. package/src/components/layouts/MdSideBarNavigation.tsx +54 -54
  94. package/src/components/layouts/NavBar.tsx +2 -2
  95. package/src/components/layouts/NotificationsPopover.tsx +115 -115
  96. package/src/components/layouts/ProfilePopover.tsx +179 -184
  97. package/src/components/layouts/UsersSelectorPopover.tsx +5 -5
  98. package/src/components/navigation/ProjectSelectorPopover.tsx +151 -151
  99. package/src/components/navigation/subcomponents/ProjectSelector.tsx +149 -149
  100. package/src/components/pages/notifications/Notifications.tsx +4 -4
  101. package/src/components/ui/buttons/CopyButton.tsx +2 -2
  102. package/src/components/ui/data-display/Accordion.tsx +2 -2
  103. package/src/components/ui/data-display/Pagination.tsx +7 -7
  104. package/src/components/ui/feedback/Toast.tsx +7 -7
  105. package/src/components/ui/form/Calendar.tsx +7 -7
  106. package/src/components/ui/form/Checkbox.tsx +2 -2
  107. package/src/components/ui/form/ComboboxField.tsx +154 -154
  108. package/src/components/ui/form/DateRangePicker.tsx +2 -2
  109. package/src/components/ui/form/FormField.tsx +131 -130
  110. package/src/components/ui/form/InputOtp.tsx +2 -2
  111. package/src/components/ui/form/RadioGroup.tsx +2 -2
  112. package/src/components/ui/form/Select.tsx +5 -5
  113. package/src/components/ui/form/SwitchOptionFieldWithIcon.tsx +2 -2
  114. package/src/components/ui/overlay/Command.tsx +2 -2
  115. package/src/components/ui/overlay/Dialog.tsx +2 -2
  116. package/src/components/ui/overlay/Sheet.tsx +2 -2
  117. package/src/components/widgets/notifications/NotificationCard.tsx +68 -68
@@ -1,150 +1,150 @@
1
- 'use client';
2
-
3
- import { Lock, Settings2, User, X } from 'lucide-react';
4
- import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';
5
- import { Tabs, TabsList, TabsTrigger, TabsContent } from '../ui/data-display/Tabs';
6
- import { Button } from '../ui/buttons/Button';
7
- import { cn } from '../../infra/utils/clsx';
8
- import { AccountSectionType } from '../../enums/AccountSectionType';
9
- import { MyProfileSection } from './sections/MyProfileSection';
10
- import { PreferencesSection } from './sections/PreferencesSection';
11
- import { ChangePasswordSection } from './sections/ChangePasswordSection';
12
- import { SecuritySection } from './sections/SecuritySection';
13
- import useConfigurationsModal from './hooks/useConfigurationsModal';
14
- import useIsMobile from '../../hooks/useIsMobile';
15
- import { useAccountModals } from '../../store/useAccountModals';
16
-
17
- export default function ConfigurationsMyAccountModal() {
18
- const {
19
- activeModal,
20
- config,
21
- initialSection,
22
- openDeleteAccount,
23
- openIsntPossibleDelete,
24
- close,
25
- } = useAccountModals();
26
-
27
- const open = activeModal === 'configurations';
28
- const { hasActiveSubscription } = config;
29
-
30
- const isMobile = useIsMobile();
31
- const { activeSection, setActiveSection } = useConfigurationsModal({
32
- isOpen: open,
33
- initialSection,
34
- });
35
-
36
- const handleDeleteAccount = () => {
37
- close();
38
- if (hasActiveSubscription) {
39
- openIsntPossibleDelete();
40
- } else {
41
- openDeleteAccount();
42
- }
43
- };
44
-
45
- const tabTriggerClasses = cn(
46
- 'border-0! px-0 py-0',
47
-
48
- 'lg:rounded-md lg:flex lg:items-center lg:gap-2 lg:p-3 lg:justify-start lg:w-full',
49
- 'lg:bg-white lg:hover:bg-gray-100 lg:active:bg-gray-50 lg:border-0',
50
- 'lg:data-[state=active]:bg-gray-50',
51
-
52
- 'flex items-center gap-1.5 px-3 py-3 justify-center whitespace-nowrap',
53
- 'border-b-2 border-transparent',
54
- 'data-[state=active]:bg-gray-50 rounded-lg',
55
-
56
- 'text-gray-500 data-[state=active]:text-gray-950',
57
- 'hover:text-gray-900 transition-colors'
58
- );
59
-
60
- return (
61
- <Dialog open={open} onOpenChange={close}>
62
- <DialogContent
63
- showCloseButton={!isMobile}
64
- overlayClassName="bg-black/20 lg:bg-black/50"
65
- className="
66
- flex flex-col p-0 gap-0 max-w-full! overflow-x-hidden border-0
67
- rounded-t-2xl rounded-b-none h-[100dvh] top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0!
68
- lg:flex-row lg:w-[892px]! lg:max-w-[892px]! lg:h-[626px]! lg:rounded-lg lg:border
69
- lg:top-[50%]! lg:bottom-auto! lg:left-[50%]! lg:right-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!"
70
- >
71
- <DialogHeader className="sr-only">
72
- <DialogTitle>Configurações</DialogTitle>
73
- </DialogHeader>
74
- <div className="md:hidden flex items-center justify-between px-5 py-3 border-b border-gray-200">
75
- <span className="text-gray-950 paragraph-medium-semibold">Configurações</span>
76
- <button
77
- type="button"
78
- className="size-8 flex items-center justify-center text-gray-500 cursor-pointer"
79
- onClick={close}
80
- >
81
- <X size={18} />
82
- </button>
83
- </div>
84
- <Tabs
85
- value={activeSection}
86
- onValueChange={(value) => setActiveSection(value as AccountSectionType)}
87
- orientation="vertical"
88
- className="flex lg:flex-row flex-col w-full h-full flex-1 lg:h-full lg:pt-0 lg:gap-0"
89
- >
90
- <TabsList
91
- className={cn(
92
- 'flex gap-0 bg-transparent border-b-0',
93
-
94
- 'lg:flex-col lg:items-stretch lg:justify-start lg:w-auto lg:min-w-60',
95
- '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',
96
-
97
- 'flex-row items-center justify-start w-full overflow-x-auto scrollbar-hide shrink-0',
98
- 'px-4 py-3',
99
- '[mask-image:linear-gradient(to_right,transparent,black_16px,black_calc(100%-24px),transparent)] lg:[mask-image:none]'
100
- )}
101
- >
102
- <span className="hidden lg:block paragraph-medium-semibold text-gray-950 mb-0">
103
- Configurações
104
- </span>
105
-
106
- <div className="lg:flex lg:flex-col flex flex-row lg:gap-0 gap-0 lg:w-full">
107
- <TabsTrigger value={AccountSectionType.MY_PROFILE} className={tabTriggerClasses}>
108
- <User size={20} className="shrink-0" />
109
- <span className="paragraph-small-medium">Meu perfil</span>
110
- </TabsTrigger>
111
-
112
- <TabsTrigger value={AccountSectionType.PREFERENCES} className={tabTriggerClasses}>
113
- <Settings2 size={20} className="shrink-0" />
114
- <span className="paragraph-small-medium">Preferências</span>
115
- </TabsTrigger>
116
-
117
- <TabsTrigger value={AccountSectionType.SECURITY} className={tabTriggerClasses}>
118
- <Lock size={20} className="shrink-0" />
119
- <span className="paragraph-small-medium">Segurança</span>
120
- </TabsTrigger>
121
- </div>
122
- </TabsList>
123
-
124
- <div className="w-full flex-1 min-h-0 lg:h-full overflow-hidden lg:overflow-visible relative">
125
- <TabsContent value={AccountSectionType.MY_PROFILE} className="h-full! relative overflow-hidden">
126
- <MyProfileSection onClose={close} />
127
- </TabsContent>
128
-
129
- <TabsContent value={AccountSectionType.SECURITY} className="h-full! relative overflow-hidden">
130
- <SecuritySection
131
- setActiveSection={setActiveSection}
132
- onClose={close}
133
- hasActiveSubscription={hasActiveSubscription}
134
- onDeleteAccount={handleDeleteAccount}
135
- />
136
- </TabsContent>
137
-
138
- <TabsContent value={AccountSectionType.CHANGE_PASSWORD} className="h-full! relative overflow-hidden">
139
- <ChangePasswordSection onBack={() => setActiveSection(AccountSectionType.SECURITY)} />
140
- </TabsContent>
141
-
142
- <TabsContent value={AccountSectionType.PREFERENCES} className="h-full! relative overflow-hidden">
143
- <PreferencesSection onClose={close} />
144
- </TabsContent>
145
- </div>
146
- </Tabs>
147
- </DialogContent>
148
- </Dialog>
149
- );
150
- }
1
+ 'use client';
2
+
3
+ import { IconLock, IconSettings2, IconUser, IconX } from '@tabler/icons-react';
4
+ import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';
5
+ import { Tabs, TabsList, TabsTrigger, TabsContent } from '../ui/data-display/Tabs';
6
+ import { Button } from '../ui/buttons/Button';
7
+ import { cn } from '../../infra/utils/clsx';
8
+ import { AccountSectionType } from '../../enums/AccountSectionType';
9
+ import { MyProfileSection } from './sections/MyProfileSection';
10
+ import { PreferencesSection } from './sections/PreferencesSection';
11
+ import { ChangePasswordSection } from './sections/ChangePasswordSection';
12
+ import { SecuritySection } from './sections/SecuritySection';
13
+ import useConfigurationsModal from './hooks/useConfigurationsModal';
14
+ import useIsMobile from '../../hooks/useIsMobile';
15
+ import { useAccountModals } from '../../store/useAccountModals';
16
+
17
+ export default function ConfigurationsMyAccountModal() {
18
+ const {
19
+ activeModal,
20
+ config,
21
+ initialSection,
22
+ openDeleteAccount,
23
+ openIsntPossibleDelete,
24
+ close,
25
+ } = useAccountModals();
26
+
27
+ const open = activeModal === 'configurations';
28
+ const { hasActiveSubscription } = config;
29
+
30
+ const isMobile = useIsMobile();
31
+ const { activeSection, setActiveSection } = useConfigurationsModal({
32
+ isOpen: open,
33
+ initialSection,
34
+ });
35
+
36
+ const handleDeleteAccount = () => {
37
+ close();
38
+ if (hasActiveSubscription) {
39
+ openIsntPossibleDelete();
40
+ } else {
41
+ openDeleteAccount();
42
+ }
43
+ };
44
+
45
+ const tabTriggerClasses = cn(
46
+ 'border-0! px-0 py-0',
47
+
48
+ 'lg:rounded-md lg:flex lg:items-center lg:gap-2 lg:p-3 lg:justify-start lg:w-full',
49
+ 'lg:bg-white lg:hover:bg-gray-100 lg:active:bg-gray-50 lg:border-0',
50
+ 'lg:data-[state=active]:bg-gray-50',
51
+
52
+ 'flex items-center gap-1.5 px-3 py-3 justify-center whitespace-nowrap',
53
+ 'border-b-2 border-transparent',
54
+ 'data-[state=active]:bg-gray-50 rounded-lg',
55
+
56
+ 'text-gray-500 data-[state=active]:text-gray-950',
57
+ 'hover:text-gray-900 transition-colors'
58
+ );
59
+
60
+ return (
61
+ <Dialog open={open} onOpenChange={close}>
62
+ <DialogContent
63
+ showCloseButton={!isMobile}
64
+ overlayClassName="bg-black/20 lg:bg-black/50"
65
+ className="
66
+ flex flex-col p-0 gap-0 max-w-full! overflow-x-hidden border-0
67
+ rounded-t-2xl rounded-b-none h-[100dvh] top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0!
68
+ lg:flex-row lg:w-[892px]! lg:max-w-[892px]! lg:h-[626px]! lg:rounded-lg lg:border
69
+ lg:top-[50%]! lg:bottom-auto! lg:left-[50%]! lg:right-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!"
70
+ >
71
+ <DialogHeader className="sr-only">
72
+ <DialogTitle>Configurações</DialogTitle>
73
+ </DialogHeader>
74
+ <div className="md:hidden flex items-center justify-between px-5 py-3 border-b border-gray-200">
75
+ <span className="text-gray-950 paragraph-medium-semibold">Configurações</span>
76
+ <button
77
+ type="button"
78
+ className="size-8 flex items-center justify-center text-gray-500 cursor-pointer"
79
+ onClick={close}
80
+ >
81
+ <IconX size={18} />
82
+ </button>
83
+ </div>
84
+ <Tabs
85
+ value={activeSection}
86
+ onValueChange={(value) => setActiveSection(value as AccountSectionType)}
87
+ orientation="vertical"
88
+ className="flex lg:flex-row flex-col w-full h-full flex-1 lg:h-full lg:pt-0 lg:gap-0"
89
+ >
90
+ <TabsList
91
+ className={cn(
92
+ 'flex gap-0 bg-transparent border-b-0',
93
+
94
+ 'lg:flex-col lg:items-stretch lg:justify-start lg:w-auto lg:min-w-60',
95
+ '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',
96
+
97
+ 'flex-row items-center justify-start w-full overflow-x-auto scrollbar-hide shrink-0',
98
+ 'px-4 py-3',
99
+ '[mask-image:linear-gradient(to_right,transparent,black_16px,black_calc(100%-24px),transparent)] lg:[mask-image:none]'
100
+ )}
101
+ >
102
+ <span className="hidden lg:block paragraph-medium-semibold text-gray-950 mb-0">
103
+ Configurações
104
+ </span>
105
+
106
+ <div className="lg:flex lg:flex-col flex flex-row lg:gap-0 gap-0 lg:w-full">
107
+ <TabsTrigger value={AccountSectionType.MY_PROFILE} className={tabTriggerClasses}>
108
+ <IconUser size={20} className="shrink-0" />
109
+ <span className="paragraph-small-medium">Meu perfil</span>
110
+ </TabsTrigger>
111
+
112
+ <TabsTrigger value={AccountSectionType.PREFERENCES} className={tabTriggerClasses}>
113
+ <IconSettings2 size={20} className="shrink-0" />
114
+ <span className="paragraph-small-medium">Preferências</span>
115
+ </TabsTrigger>
116
+
117
+ <TabsTrigger value={AccountSectionType.SECURITY} className={tabTriggerClasses}>
118
+ <IconLock size={20} className="shrink-0" />
119
+ <span className="paragraph-small-medium">Segurança</span>
120
+ </TabsTrigger>
121
+ </div>
122
+ </TabsList>
123
+
124
+ <div className="w-full flex-1 min-h-0 lg:h-full overflow-hidden lg:overflow-visible relative">
125
+ <TabsContent value={AccountSectionType.MY_PROFILE} className="h-full! relative overflow-hidden">
126
+ <MyProfileSection onClose={close} />
127
+ </TabsContent>
128
+
129
+ <TabsContent value={AccountSectionType.SECURITY} className="h-full! relative overflow-hidden">
130
+ <SecuritySection
131
+ setActiveSection={setActiveSection}
132
+ onClose={close}
133
+ hasActiveSubscription={hasActiveSubscription}
134
+ onDeleteAccount={handleDeleteAccount}
135
+ />
136
+ </TabsContent>
137
+
138
+ <TabsContent value={AccountSectionType.CHANGE_PASSWORD} className="h-full! relative overflow-hidden">
139
+ <ChangePasswordSection onBack={() => setActiveSection(AccountSectionType.SECURITY)} />
140
+ </TabsContent>
141
+
142
+ <TabsContent value={AccountSectionType.PREFERENCES} className="h-full! relative overflow-hidden">
143
+ <PreferencesSection onClose={close} />
144
+ </TabsContent>
145
+ </div>
146
+ </Tabs>
147
+ </DialogContent>
148
+ </Dialog>
149
+ );
150
+ }
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { TriangleAlert } from 'lucide-react';
3
+ import { IconAlertTriangle } from '@tabler/icons-react';
4
4
  import { toast } from 'sonner';
5
5
  import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';
6
6
  import { Button } from '../ui/buttons/Button';
@@ -29,7 +29,7 @@ export default function ConfirmDeleteAccountModal() {
29
29
  </DialogHeader>
30
30
 
31
31
  <div className="bg-red-50 p-4 lg:p-5 rounded-lg flex items-center gap-4">
32
- <TriangleAlert size={20} className="text-red-500 shrink-0" strokeWidth={2} />
32
+ <IconAlertTriangle size={20} className="text-red-500 shrink-0" strokeWidth={2} />
33
33
  <p className="paragraph-small-regular text-gray-600">
34
34
  Todas suas{' '}
35
35
  <span className="font-semibold text-gray-950">{pagesCount} páginas</span>{' '}
@@ -1,66 +1,66 @@
1
- 'use client';
2
-
3
- import { TriangleAlert } from 'lucide-react';
4
- import { Button } from '../ui/buttons/Button';
5
- import {
6
- Dialog,
7
- DialogContent,
8
- DialogHeader,
9
- DialogTitle,
10
- DialogDescription,
11
- } from '../ui/overlay/Dialog';
12
- import { Separator } from '../ui/data-display/Separator';
13
-
14
- interface ConfirmGlobalPreferencesModalProps {
15
- open: boolean;
16
- onConfirm: () => void;
17
- onCancel: () => void;
18
- }
19
-
20
- export default function ConfirmGlobalPreferencesModal({
21
- open,
22
- onConfirm,
23
- onCancel,
24
- }: ConfirmGlobalPreferencesModalProps) {
25
- return (
26
- <Dialog open={open} onOpenChange={onCancel}>
27
- <DialogContent className="flex flex-col p-0 gap-0 md:w-[386px]! lg:w-[386px]! max-w-[386px]! max-[386px]:w-[calc(100%-32px)]">
28
- <DialogHeader className="sr-only">
29
- <DialogTitle>Alterar preferências globais</DialogTitle>
30
- <DialogDescription>
31
- Confirmação de alteração de preferências globais da conta
32
- </DialogDescription>
33
- </DialogHeader>
34
-
35
- <div className="flex flex-col gap-3 p-5">
36
- <div className="flex items-center justify-center bg-gray-50 rounded-lg size-10">
37
- <TriangleAlert size={24} className="text-gray-950" />
38
- </div>
39
- <div className="flex flex-col gap-2">
40
- <span className="paragraph-medium-semibold text-gray-950">
41
- Alterar preferências globais
42
- </span>
43
- <span className="paragraph-small-regular text-gray-600">
44
- Você está alterando configurações que impactam{' '}
45
- <span className="paragraph-small-semibold text-gray-950">
46
- todos os usuários da conta
47
- </span>
48
- . Deseja confirmar?
49
- </span>
50
- </div>
51
- </div>
52
-
53
- <Separator className="w-full" />
54
-
55
- <div className="flex items-center gap-2 p-5">
56
- <Button onClick={onConfirm} className="h-10!">
57
- Confirmar
58
- </Button>
59
- <Button variant="secondary" onClick={onCancel} className="h-10!">
60
- Cancelar
61
- </Button>
62
- </div>
63
- </DialogContent>
64
- </Dialog>
65
- );
66
- }
1
+ 'use client';
2
+
3
+ import { IconAlertTriangle } from '@tabler/icons-react';
4
+ import { Button } from '../ui/buttons/Button';
5
+ import {
6
+ Dialog,
7
+ DialogContent,
8
+ DialogHeader,
9
+ DialogTitle,
10
+ DialogDescription,
11
+ } from '../ui/overlay/Dialog';
12
+ import { Separator } from '../ui/data-display/Separator';
13
+
14
+ interface ConfirmGlobalPreferencesModalProps {
15
+ open: boolean;
16
+ onConfirm: () => void;
17
+ onCancel: () => void;
18
+ }
19
+
20
+ export default function ConfirmGlobalPreferencesModal({
21
+ open,
22
+ onConfirm,
23
+ onCancel,
24
+ }: ConfirmGlobalPreferencesModalProps) {
25
+ return (
26
+ <Dialog open={open} onOpenChange={onCancel}>
27
+ <DialogContent className="flex flex-col p-0 gap-0 md:w-[386px]! lg:w-[386px]! max-w-[386px]! max-[386px]:w-[calc(100%-32px)]">
28
+ <DialogHeader className="sr-only">
29
+ <DialogTitle>Alterar preferências globais</DialogTitle>
30
+ <DialogDescription>
31
+ Confirmação de alteração de preferências globais da conta
32
+ </DialogDescription>
33
+ </DialogHeader>
34
+
35
+ <div className="flex flex-col gap-3 p-5">
36
+ <div className="flex items-center justify-center bg-gray-50 rounded-lg size-10">
37
+ <IconAlertTriangle size={24} className="text-gray-950" />
38
+ </div>
39
+ <div className="flex flex-col gap-2">
40
+ <span className="paragraph-medium-semibold text-gray-950">
41
+ Alterar preferências globais
42
+ </span>
43
+ <span className="paragraph-small-regular text-gray-600">
44
+ Você está alterando configurações que impactam{' '}
45
+ <span className="paragraph-small-semibold text-gray-950">
46
+ todos os usuários da conta
47
+ </span>
48
+ . Deseja confirmar?
49
+ </span>
50
+ </div>
51
+ </div>
52
+
53
+ <Separator className="w-full" />
54
+
55
+ <div className="flex items-center gap-2 p-5">
56
+ <Button onClick={onConfirm} className="h-10!">
57
+ Confirmar
58
+ </Button>
59
+ <Button variant="secondary" onClick={onCancel} className="h-10!">
60
+ Cancelar
61
+ </Button>
62
+ </div>
63
+ </DialogContent>
64
+ </Dialog>
65
+ );
66
+ }
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { useState, useCallback } from 'react';
4
- import { Lock, TriangleAlert } from 'lucide-react';
4
+ import { IconLock, IconAlertTriangle } from '@tabler/icons-react';
5
5
  import { toast } from 'sonner';
6
6
  import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';
7
7
  import { Button } from '../ui/buttons/Button';
@@ -63,7 +63,7 @@ export default function DeleteAccountModal() {
63
63
  <div className="flex flex-col gap-6 p-4 lg:p-6 flex-1 lg:flex-none">
64
64
  <DialogHeader className="p-0">
65
65
  <div className="flex items-center justify-center w-fit bg-red-50 rounded-lg p-2.5 mb-5">
66
- <TriangleAlert size={20} className="text-red-500" />
66
+ <IconAlertTriangle size={20} className="text-red-500" />
67
67
  </div>
68
68
  <DialogTitle>Excluir conta</DialogTitle>
69
69
  <DialogDescription className="paragraph-small-regular">
@@ -102,7 +102,7 @@ export default function DeleteAccountModal() {
102
102
  label="Senha"
103
103
  type="password"
104
104
  placeholder="Informe sua senha"
105
- leftIcon={Lock}
105
+ leftIcon={IconLock}
106
106
  value={password}
107
107
  onChange={(e) => setPassword(e.target.value)}
108
108
  classnameContainer="h-10!"
@@ -1,86 +1,86 @@
1
- 'use client';
2
-
3
- import { ShieldCheck } from 'lucide-react';
4
- import { Button } from '../ui/buttons/Button';
5
- import {
6
- Dialog,
7
- DialogContent,
8
- DialogDescription,
9
- DialogHeader,
10
- DialogTitle,
11
- } from '../ui/overlay/Dialog';
12
- import { InputOTP, InputOTPGroup, InputOTPSlot } from '../ui/form/InputOtp';
13
- import useDisableTwoFactorAuthForm from './hooks/useDisableTwoFactorAuthForm';
14
-
15
- interface DisableTwoFactorAuthModalProps {
16
- open: boolean;
17
- onClose: () => void;
18
- onSuccess?: () => void;
19
- }
20
-
21
- export default function DisableTwoFactorAuthModal({
22
- open,
23
- onClose,
24
- onSuccess,
25
- }: DisableTwoFactorAuthModalProps) {
26
- const { code, setCode, isValid, isLoading, handleClose, handleSubmit } =
27
- useDisableTwoFactorAuthForm({ onClose, onSuccess });
28
-
29
- return (
30
- <Dialog open={open} onOpenChange={handleClose}>
31
- <DialogContent overlayClassName="z-[1010]" className="z-[1011] flex flex-col p-0 gap-0 max-w-full! border-0 rounded-t-2xl rounded-b-none h-dvh top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0! lg:max-w-117.5! lg:h-auto! 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%]!">
32
- <form
33
- onSubmit={(e) => {
34
- e.preventDefault();
35
- handleSubmit();
36
- }}
37
- className="flex flex-col flex-1 lg:flex-none"
38
- >
39
- <div className="flex flex-col gap-4 lg:gap-5 p-4 lg:p-5 flex-1 lg:flex-none">
40
- <div className="flex items-center justify-center w-fit bg-gray-50 rounded-lg p-2">
41
- <ShieldCheck size={20} className="text-gray-600" />
42
- </div>
43
- <DialogHeader className="p-0 gap-2">
44
- <DialogTitle className="paragraph-medium-semibold text-gray-950">
45
- Desabilitar autenticação 2FA
46
- </DialogTitle>
47
- <DialogDescription className="paragraph-small-regular text-gray-600">
48
- Informe o código de 6 dígitos do seu aplicativo autenticador para confirmar a
49
- desativação.
50
- </DialogDescription>
51
- </DialogHeader>
52
-
53
- <div className="flex flex-col gap-2">
54
- <span className="paragraph-small-medium text-gray-700">Código do autenticador</span>
55
- <InputOTP maxLength={6} value={code} onChange={setCode}>
56
- <InputOTPGroup className="gap-2">
57
- {Array.from({ length: 6 }).map((_, i) => (
58
- <InputOTPSlot
59
- key={i}
60
- index={i}
61
- className="w-11! lg:w-12! h-13! lg:h-14! rounded-lg! text-lg border-gray-200"
62
- />
63
- ))}
64
- </InputOTPGroup>
65
- </InputOTP>
66
- </div>
67
- </div>
68
-
69
- <div className="flex flex-row items-center gap-2 p-4 lg:p-5 border-t border-gray-200 mt-auto lg:mt-0">
70
- <Button className="h-10! flex-1" disabled={!isValid || isLoading} type="submit">
71
- {isLoading ? 'Desabilitando...' : 'Desabilitar 2FA'}
72
- </Button>
73
- <Button
74
- variant="secondary"
75
- className="h-10! flex-1"
76
- type="button"
77
- onClick={handleClose}
78
- >
79
- Cancelar
80
- </Button>
81
- </div>
82
- </form>
83
- </DialogContent>
84
- </Dialog>
85
- );
86
- }
1
+ 'use client';
2
+
3
+ import { IconShieldCheck } from '@tabler/icons-react';
4
+ import { Button } from '../ui/buttons/Button';
5
+ import {
6
+ Dialog,
7
+ DialogContent,
8
+ DialogDescription,
9
+ DialogHeader,
10
+ DialogTitle,
11
+ } from '../ui/overlay/Dialog';
12
+ import { InputOTP, InputOTPGroup, InputOTPSlot } from '../ui/form/InputOtp';
13
+ import useDisableTwoFactorAuthForm from './hooks/useDisableTwoFactorAuthForm';
14
+
15
+ interface DisableTwoFactorAuthModalProps {
16
+ open: boolean;
17
+ onClose: () => void;
18
+ onSuccess?: () => void;
19
+ }
20
+
21
+ export default function DisableTwoFactorAuthModal({
22
+ open,
23
+ onClose,
24
+ onSuccess,
25
+ }: DisableTwoFactorAuthModalProps) {
26
+ const { code, setCode, isValid, isLoading, handleClose, handleSubmit } =
27
+ useDisableTwoFactorAuthForm({ onClose, onSuccess });
28
+
29
+ return (
30
+ <Dialog open={open} onOpenChange={handleClose}>
31
+ <DialogContent overlayClassName="z-[1010]" className="z-[1011] flex flex-col p-0 gap-0 max-w-full! border-0 rounded-t-2xl rounded-b-none h-dvh top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0! lg:max-w-117.5! lg:h-auto! 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%]!">
32
+ <form
33
+ onSubmit={(e) => {
34
+ e.preventDefault();
35
+ handleSubmit();
36
+ }}
37
+ className="flex flex-col flex-1 lg:flex-none"
38
+ >
39
+ <div className="flex flex-col gap-4 lg:gap-5 p-4 lg:p-5 flex-1 lg:flex-none">
40
+ <div className="flex items-center justify-center w-fit bg-gray-50 rounded-lg p-2">
41
+ <IconShieldCheck size={20} className="text-gray-600" />
42
+ </div>
43
+ <DialogHeader className="p-0 gap-2">
44
+ <DialogTitle className="paragraph-medium-semibold text-gray-950">
45
+ Desabilitar autenticação 2FA
46
+ </DialogTitle>
47
+ <DialogDescription className="paragraph-small-regular text-gray-600">
48
+ Informe o código de 6 dígitos do seu aplicativo autenticador para confirmar a
49
+ desativação.
50
+ </DialogDescription>
51
+ </DialogHeader>
52
+
53
+ <div className="flex flex-col gap-2">
54
+ <span className="paragraph-small-medium text-gray-700">Código do autenticador</span>
55
+ <InputOTP maxLength={6} value={code} onChange={setCode}>
56
+ <InputOTPGroup className="gap-2">
57
+ {Array.from({ length: 6 }).map((_, i) => (
58
+ <InputOTPSlot
59
+ key={i}
60
+ index={i}
61
+ className="w-11! lg:w-12! h-13! lg:h-14! rounded-lg! text-lg border-gray-200"
62
+ />
63
+ ))}
64
+ </InputOTPGroup>
65
+ </InputOTP>
66
+ </div>
67
+ </div>
68
+
69
+ <div className="flex flex-row items-center gap-2 p-4 lg:p-5 border-t border-gray-200 mt-auto lg:mt-0">
70
+ <Button className="h-10! flex-1" disabled={!isValid || isLoading} type="submit">
71
+ {isLoading ? 'Desabilitando...' : 'Desabilitar 2FA'}
72
+ </Button>
73
+ <Button
74
+ variant="secondary"
75
+ className="h-10! flex-1"
76
+ type="button"
77
+ onClick={handleClose}
78
+ >
79
+ Cancelar
80
+ </Button>
81
+ </div>
82
+ </form>
83
+ </DialogContent>
84
+ </Dialog>
85
+ );
86
+ }