@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.
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +6 -6
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +2 -2
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +2 -2
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs +3 -3
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +2 -2
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +2 -2
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/TwoFactorAuthModal.mjs +6 -6
- package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/sections/ChangeEmailModal.mjs +6 -6
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -1
- package/dist/components/account/sections/ChangePasswordSection.mjs +4 -4
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
- package/dist/components/account/sections/ChangePhoneModal.mjs +5 -5
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -1
- package/dist/components/account/sections/MyProfileSection.mjs +3 -3
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
- package/dist/components/account/sections/PreferencesSection.mjs +6 -6
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
- package/dist/components/account/sections/SecuritySection.mjs +3 -3
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
- package/dist/components/layouts/AppMobileNavBar.mjs +0 -1
- package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -1
- package/dist/components/layouts/MdSideBarNavigation.mjs +2 -2
- package/dist/components/layouts/MdSideBarNavigation.mjs.map +1 -1
- package/dist/components/layouts/NavBar.mjs +2 -2
- package/dist/components/layouts/NavBar.mjs.map +1 -1
- package/dist/components/layouts/NotificationsPopover.mjs +4 -4
- package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
- package/dist/components/layouts/ProfilePopover.mjs +7 -10
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +5 -5
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
- package/dist/components/navigation/ProjectSelectorPopover.mjs +6 -6
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +5 -5
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
- package/dist/components/pages/notifications/Notifications.mjs +4 -4
- package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
- package/dist/components/ui/buttons/CopyButton.mjs +2 -2
- package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
- package/dist/components/ui/data-display/Accordion.mjs +2 -2
- package/dist/components/ui/data-display/Accordion.mjs.map +1 -1
- package/dist/components/ui/data-display/Pagination.mjs +7 -7
- package/dist/components/ui/data-display/Pagination.mjs.map +1 -1
- package/dist/components/ui/feedback/Toast.mjs +7 -7
- package/dist/components/ui/feedback/Toast.mjs.map +1 -1
- package/dist/components/ui/form/Calendar.mjs +7 -7
- package/dist/components/ui/form/Calendar.mjs.map +1 -1
- package/dist/components/ui/form/Checkbox.mjs +2 -2
- package/dist/components/ui/form/Checkbox.mjs.map +1 -1
- package/dist/components/ui/form/ComboboxField.mjs +4 -4
- package/dist/components/ui/form/ComboboxField.mjs.map +1 -1
- package/dist/components/ui/form/DateRangePicker.mjs +2 -2
- package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
- package/dist/components/ui/form/FormField.mjs +3 -3
- package/dist/components/ui/form/FormField.mjs.map +1 -1
- package/dist/components/ui/form/InputOtp.mjs +2 -2
- package/dist/components/ui/form/InputOtp.mjs.map +1 -1
- package/dist/components/ui/form/RadioGroup.mjs +2 -2
- package/dist/components/ui/form/RadioGroup.mjs.map +1 -1
- package/dist/components/ui/form/Select.mjs +5 -5
- package/dist/components/ui/form/Select.mjs.map +1 -1
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs.map +1 -1
- package/dist/components/ui/overlay/Command.mjs +2 -2
- package/dist/components/ui/overlay/Command.mjs.map +1 -1
- package/dist/components/ui/overlay/Dialog.mjs +2 -2
- package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
- package/dist/components/ui/overlay/Sheet.mjs +2 -2
- package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
- package/dist/components/widgets/notifications/NotificationCard.mjs +2 -2
- package/dist/components/widgets/notifications/NotificationCard.mjs.map +1 -1
- package/package.json +1 -2
- package/src/components/account/ConfigurationsMyAccountModal.tsx +150 -150
- package/src/components/account/ConfirmDeleteAccountModal.tsx +2 -2
- package/src/components/account/ConfirmGlobalPreferencesModal.tsx +66 -66
- package/src/components/account/DeleteAccountModal.tsx +3 -3
- package/src/components/account/DisableTwoFactorAuthModal.tsx +86 -86
- package/src/components/account/IsntPossibleDeleteAccountModal.tsx +2 -2
- package/src/components/account/TwoFactorAuthModal.tsx +223 -223
- package/src/components/account/sections/ChangeEmailModal.tsx +225 -225
- package/src/components/account/sections/ChangePasswordSection.tsx +64 -64
- package/src/components/account/sections/ChangePhoneModal.tsx +5 -5
- package/src/components/account/sections/MyProfileSection.tsx +327 -327
- package/src/components/account/sections/PreferencesSection.tsx +273 -273
- package/src/components/account/sections/SecuritySection.tsx +160 -160
- package/src/components/layouts/AppMobileNavBar.tsx +0 -1
- package/src/components/layouts/MdSideBarNavigation.tsx +54 -54
- package/src/components/layouts/NavBar.tsx +2 -2
- package/src/components/layouts/NotificationsPopover.tsx +115 -115
- package/src/components/layouts/ProfilePopover.tsx +179 -184
- package/src/components/layouts/UsersSelectorPopover.tsx +5 -5
- package/src/components/navigation/ProjectSelectorPopover.tsx +151 -151
- package/src/components/navigation/subcomponents/ProjectSelector.tsx +149 -149
- package/src/components/pages/notifications/Notifications.tsx +4 -4
- package/src/components/ui/buttons/CopyButton.tsx +2 -2
- package/src/components/ui/data-display/Accordion.tsx +2 -2
- package/src/components/ui/data-display/Pagination.tsx +7 -7
- package/src/components/ui/feedback/Toast.tsx +7 -7
- package/src/components/ui/form/Calendar.tsx +7 -7
- package/src/components/ui/form/Checkbox.tsx +2 -2
- package/src/components/ui/form/ComboboxField.tsx +154 -154
- package/src/components/ui/form/DateRangePicker.tsx +2 -2
- package/src/components/ui/form/FormField.tsx +131 -130
- package/src/components/ui/form/InputOtp.tsx +2 -2
- package/src/components/ui/form/RadioGroup.tsx +2 -2
- package/src/components/ui/form/Select.tsx +5 -5
- package/src/components/ui/form/SwitchOptionFieldWithIcon.tsx +2 -2
- package/src/components/ui/overlay/Command.tsx +2 -2
- package/src/components/ui/overlay/Dialog.tsx +2 -2
- package/src/components/ui/overlay/Sheet.tsx +2 -2
- package/src/components/widgets/notifications/NotificationCard.tsx +68 -68
|
@@ -1,130 +1,131 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { forwardRef, type ComponentPropsWithoutRef } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { forwardRef, type ComponentPropsWithoutRef } from 'react';
|
|
4
|
+
import { IconLock, IconEye, IconEyeOff } from '@tabler/icons-react';
|
|
5
|
+
import type { TablerIcon } from '@tabler/icons-react';
|
|
6
|
+
import { Input } from './Input';
|
|
7
|
+
import { cn } from '../../../infra/utils/clsx';
|
|
8
|
+
|
|
9
|
+
type FormFieldSize = 'default' | 'large';
|
|
10
|
+
|
|
11
|
+
interface FormFieldProps extends Omit<ComponentPropsWithoutRef<'input'>, 'size'> {
|
|
12
|
+
label?: string;
|
|
13
|
+
optional?: boolean;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
leftIcon?: TablerIcon;
|
|
16
|
+
rightIcon?: TablerIcon;
|
|
17
|
+
rightIconColor?: string;
|
|
18
|
+
hintMessage?: string;
|
|
19
|
+
classnameContainer?: string;
|
|
20
|
+
size?: FormFieldSize;
|
|
21
|
+
error?: boolean;
|
|
22
|
+
errorMessage?: string;
|
|
23
|
+
showCharCount?: boolean;
|
|
24
|
+
showPassword?: boolean;
|
|
25
|
+
onTogglePassword?: () => void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const FormField = forwardRef<HTMLInputElement, FormFieldProps>(
|
|
29
|
+
(
|
|
30
|
+
{
|
|
31
|
+
label,
|
|
32
|
+
optional = false,
|
|
33
|
+
required = false,
|
|
34
|
+
leftIcon: LeftIcon,
|
|
35
|
+
rightIcon: RightIcon,
|
|
36
|
+
rightIconColor = 'var(--color-gray-400)',
|
|
37
|
+
hintMessage,
|
|
38
|
+
size = 'default',
|
|
39
|
+
type = 'text',
|
|
40
|
+
error = false,
|
|
41
|
+
errorMessage,
|
|
42
|
+
className,
|
|
43
|
+
classnameContainer,
|
|
44
|
+
showCharCount = false,
|
|
45
|
+
showPassword = false,
|
|
46
|
+
onTogglePassword,
|
|
47
|
+
...inputProps
|
|
48
|
+
},
|
|
49
|
+
ref
|
|
50
|
+
) => {
|
|
51
|
+
const isPasswordField = type === 'password';
|
|
52
|
+
const inputType = isPasswordField && showPassword ? 'text' : type;
|
|
53
|
+
const containerHeight = size === 'large' ? 'h-12' : 'h-10';
|
|
54
|
+
|
|
55
|
+
const FinalLeftIcon = isPasswordField ? IconLock : LeftIcon;
|
|
56
|
+
const FinalRightIcon = isPasswordField ? (!showPassword ? IconEyeOff : IconEye) : RightIcon;
|
|
57
|
+
|
|
58
|
+
const finalMessage = error && errorMessage ? errorMessage : hintMessage;
|
|
59
|
+
const messageColor = error ? 'text-red-600' : 'text-gray-600';
|
|
60
|
+
|
|
61
|
+
const currentLength = typeof inputProps.value === 'string' ? inputProps.value.length : 0;
|
|
62
|
+
const shouldShowCharCount = showCharCount && inputProps.maxLength;
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<div className="flex flex-col gap-1.5 w-full">
|
|
66
|
+
<div className="flex items-center gap-1 paragraph-xsmall-semibold truncate">
|
|
67
|
+
{label && <span className="text-gray-600">{label}</span>}
|
|
68
|
+
{optional && <span className="text-gray-500">(Opcional)</span>}
|
|
69
|
+
{required && <span className="text-red-600">*</span>}
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div
|
|
73
|
+
className={cn(
|
|
74
|
+
'flex gap-2 px-4 items-center border rounded-lg transition-color',
|
|
75
|
+
containerHeight,
|
|
76
|
+
classnameContainer,
|
|
77
|
+
error
|
|
78
|
+
? 'border-red-600 hover:border-red-700'
|
|
79
|
+
: 'border-gray-200 hover:border-gray-400 focus-within:border-gray-950'
|
|
80
|
+
)}
|
|
81
|
+
>
|
|
82
|
+
{FinalLeftIcon && <FinalLeftIcon size={20} className="text-gray-400" />}
|
|
83
|
+
|
|
84
|
+
<Input
|
|
85
|
+
ref={ref}
|
|
86
|
+
type={inputType}
|
|
87
|
+
className={cn(
|
|
88
|
+
'paragraph-small-medium w-full h-full text-gray-950',
|
|
89
|
+
error && 'placeholder:text-red-400',
|
|
90
|
+
className
|
|
91
|
+
)}
|
|
92
|
+
{...inputProps}
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
{FinalRightIcon && (
|
|
96
|
+
<button
|
|
97
|
+
type="button"
|
|
98
|
+
onClick={isPasswordField ? onTogglePassword : undefined}
|
|
99
|
+
className={cn(
|
|
100
|
+
'flex items-center justify-center',
|
|
101
|
+
isPasswordField && 'cursor-pointer hover:opacity-70 transition-opacity'
|
|
102
|
+
)}
|
|
103
|
+
aria-label={
|
|
104
|
+
isPasswordField ? (showPassword ? 'Ocultar senha' : 'Mostrar senha') : undefined
|
|
105
|
+
}
|
|
106
|
+
>
|
|
107
|
+
<FinalRightIcon
|
|
108
|
+
size={20}
|
|
109
|
+
color={isPasswordField ? 'var(--color-gray-950)' : rightIconColor}
|
|
110
|
+
/>
|
|
111
|
+
</button>
|
|
112
|
+
)}
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
{finalMessage && (
|
|
116
|
+
<span className={cn('paragraph-xsmall-medium', messageColor)}>{finalMessage}</span>
|
|
117
|
+
)}
|
|
118
|
+
|
|
119
|
+
{shouldShowCharCount && (
|
|
120
|
+
<span className="paragraph-xsmall-medium text-gray-600">
|
|
121
|
+
{currentLength}/{inputProps.maxLength}
|
|
122
|
+
</span>
|
|
123
|
+
)}
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
FormField.displayName = 'FormField';
|
|
130
|
+
|
|
131
|
+
export default FormField;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as React from "react"
|
|
6
6
|
import { OTPInput, OTPInputContext } from "input-otp"
|
|
7
|
-
import {
|
|
7
|
+
import { IconMinus } from '@tabler/icons-react'
|
|
8
8
|
import { cn } from "../../../infra/utils/clsx"
|
|
9
9
|
|
|
10
10
|
function InputOTP({
|
|
@@ -72,7 +72,7 @@ function InputOTPSlot({
|
|
|
72
72
|
function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
|
|
73
73
|
return (
|
|
74
74
|
<div data-slot="input-otp-separator" role="separator" {...props}>
|
|
75
|
-
<
|
|
75
|
+
<IconMinus />
|
|
76
76
|
</div>
|
|
77
77
|
)
|
|
78
78
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as React from "react"
|
|
6
6
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
7
|
-
import {
|
|
7
|
+
import { IconCircle } from '@tabler/icons-react'
|
|
8
8
|
import { cn } from "../../../infra/utils/clsx"
|
|
9
9
|
|
|
10
10
|
const RadioGroup = React.forwardRef<
|
|
@@ -35,7 +35,7 @@ const RadioGroupItem = React.forwardRef<
|
|
|
35
35
|
{...props}
|
|
36
36
|
>
|
|
37
37
|
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
|
38
|
-
<
|
|
38
|
+
<IconCircle className="h-2.5 w-2.5 fill-current text-current" />
|
|
39
39
|
</RadioGroupPrimitive.Indicator>
|
|
40
40
|
</RadioGroupPrimitive.Item>
|
|
41
41
|
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
5
|
-
import {
|
|
5
|
+
import { IconCheck, IconChevronDown, IconChevronUp } from '@tabler/icons-react';
|
|
6
6
|
import { cn } from "../../../infra/utils/clsx";
|
|
7
7
|
|
|
8
8
|
function Select({
|
|
@@ -47,7 +47,7 @@ function SelectTrigger({
|
|
|
47
47
|
|
|
48
48
|
<SelectPrimitive.Icon asChild>
|
|
49
49
|
{icon ?? (
|
|
50
|
-
<
|
|
50
|
+
<IconChevronDown
|
|
51
51
|
className="
|
|
52
52
|
size-4 opacity-50 transition-all duration-200
|
|
53
53
|
group-data-[state=open]/data-select:rotate-180
|
|
@@ -127,7 +127,7 @@ function SelectItem({
|
|
|
127
127
|
>
|
|
128
128
|
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
129
129
|
<SelectPrimitive.ItemIndicator>
|
|
130
|
-
<
|
|
130
|
+
<IconCheck className="size-4" />
|
|
131
131
|
</SelectPrimitive.ItemIndicator>
|
|
132
132
|
</span>
|
|
133
133
|
<SelectPrimitive.ItemText className="cursor-pointer">
|
|
@@ -163,7 +163,7 @@ function SelectScrollUpButton({
|
|
|
163
163
|
)}
|
|
164
164
|
{...props}
|
|
165
165
|
>
|
|
166
|
-
<
|
|
166
|
+
<IconChevronUp className="size-4" />
|
|
167
167
|
</SelectPrimitive.ScrollUpButton>
|
|
168
168
|
);
|
|
169
169
|
}
|
|
@@ -181,7 +181,7 @@ function SelectScrollDownButton({
|
|
|
181
181
|
)}
|
|
182
182
|
{...props}
|
|
183
183
|
>
|
|
184
|
-
<
|
|
184
|
+
<IconChevronDown className="size-4" />
|
|
185
185
|
</SelectPrimitive.ScrollDownButton>
|
|
186
186
|
);
|
|
187
187
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TablerIcon } from '@tabler/icons-react';
|
|
2
2
|
import { Switch } from './Switch';
|
|
3
3
|
|
|
4
4
|
type SwitchOptionFieldWithIconProps = {
|
|
5
|
-
icon:
|
|
5
|
+
icon: TablerIcon;
|
|
6
6
|
label: string;
|
|
7
7
|
description: string;
|
|
8
8
|
checked: boolean;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as React from "react"
|
|
6
6
|
import { Command as CommandPrimitive } from "cmdk"
|
|
7
|
-
import {
|
|
7
|
+
import { IconSearch } from '@tabler/icons-react';
|
|
8
8
|
import {
|
|
9
9
|
Dialog,
|
|
10
10
|
DialogContent,
|
|
@@ -70,7 +70,7 @@ function CommandInput({
|
|
|
70
70
|
data-slot="command-input-wrapper"
|
|
71
71
|
className="flex h-9 items-center gap-2 border-b px-3"
|
|
72
72
|
>
|
|
73
|
-
<
|
|
73
|
+
<IconSearch className="size-5 shrink-0 opacity-50" />
|
|
74
74
|
<CommandPrimitive.Input
|
|
75
75
|
data-slot="command-input"
|
|
76
76
|
className={cn(
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
5
|
-
import {
|
|
5
|
+
import { IconX } from '@tabler/icons-react';
|
|
6
6
|
import { cn } from "../../../infra/utils/clsx";
|
|
7
7
|
|
|
8
8
|
function Dialog({
|
|
@@ -74,7 +74,7 @@ function DialogContent({
|
|
|
74
74
|
data-slot="dialog-close"
|
|
75
75
|
className="hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none"
|
|
76
76
|
>
|
|
77
|
-
<
|
|
77
|
+
<IconX className="size-[18px]" />
|
|
78
78
|
<span className="sr-only">Close</span>
|
|
79
79
|
</DialogPrimitive.Close>
|
|
80
80
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
5
|
-
import {
|
|
5
|
+
import { IconX } from '@tabler/icons-react';
|
|
6
6
|
import { cn } from "../../../infra/utils/clsx";
|
|
7
7
|
import { hideCrisp, showCrisp } from "../../embeds/CrispEmbed";
|
|
8
8
|
|
|
@@ -99,7 +99,7 @@ function SheetContent({
|
|
|
99
99
|
data-slot="sheet-close"
|
|
100
100
|
className="absolute top-3 right-3 hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none"
|
|
101
101
|
>
|
|
102
|
-
<
|
|
102
|
+
<IconX className="size-[18px]" />
|
|
103
103
|
<span className="sr-only">Close</span>
|
|
104
104
|
</SheetPrimitive.Close>
|
|
105
105
|
)}
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { cn } from '../../../infra/utils/clsx';
|
|
4
|
-
|
|
5
|
-
type NotificationCardProps = {
|
|
6
|
-
icon: ReactNode;
|
|
7
|
-
iconBgColor?: string;
|
|
8
|
-
title: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
time: string;
|
|
11
|
-
actions?: ReactNode;
|
|
12
|
-
isUnread?: boolean;
|
|
13
|
-
showBorder?: boolean;
|
|
14
|
-
className?: string;
|
|
15
|
-
gapPx: number;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default function NotificationCard({
|
|
19
|
-
icon,
|
|
20
|
-
iconBgColor,
|
|
21
|
-
title,
|
|
22
|
-
description,
|
|
23
|
-
time,
|
|
24
|
-
actions,
|
|
25
|
-
isUnread = false,
|
|
26
|
-
showBorder = true,
|
|
27
|
-
className,
|
|
28
|
-
gapPx = 16
|
|
29
|
-
}: NotificationCardProps) {
|
|
30
|
-
return (
|
|
31
|
-
<div
|
|
32
|
-
className={cn(
|
|
33
|
-
'flex flex-col lg:flex-row items-start p-4 lg:p-5 gap-3 lg:gap-4 relative',
|
|
34
|
-
showBorder && 'border-b border-gray-200',
|
|
35
|
-
className
|
|
36
|
-
)}
|
|
37
|
-
>
|
|
38
|
-
<div
|
|
39
|
-
className={cn(
|
|
40
|
-
'flex items-center justify-center size-10 rounded-full shrink-0',
|
|
41
|
-
iconBgColor
|
|
42
|
-
)}
|
|
43
|
-
>
|
|
44
|
-
{icon}
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<div className="flex flex-col flex-1" style={{ gap: `${gapPx}px` }}>
|
|
48
|
-
<div className="flex flex-col gap-1">
|
|
49
|
-
<span className="paragraph-small-semibold text-gray-950">{title}</span>
|
|
50
|
-
{description && (
|
|
51
|
-
<span className="paragraph-small-regular text-gray-600">{description}</span>
|
|
52
|
-
)}
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
<div className="flex items-center gap-1.5">
|
|
56
|
-
<
|
|
57
|
-
<span className="paragraph-xsmall-medium text-gray-600">{time}</span>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
{actions && <div className="flex items-center gap-2">{actions}</div>}
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
{isUnread && <div className="size-2 bg-pages-400 rounded-full shrink-0 mt-1" />}
|
|
64
|
-
</div>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export type { NotificationCardProps };
|
|
1
|
+
import { IconClock } from '@tabler/icons-react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { cn } from '../../../infra/utils/clsx';
|
|
4
|
+
|
|
5
|
+
type NotificationCardProps = {
|
|
6
|
+
icon: ReactNode;
|
|
7
|
+
iconBgColor?: string;
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
time: string;
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
isUnread?: boolean;
|
|
13
|
+
showBorder?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
gapPx: number;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function NotificationCard({
|
|
19
|
+
icon,
|
|
20
|
+
iconBgColor,
|
|
21
|
+
title,
|
|
22
|
+
description,
|
|
23
|
+
time,
|
|
24
|
+
actions,
|
|
25
|
+
isUnread = false,
|
|
26
|
+
showBorder = true,
|
|
27
|
+
className,
|
|
28
|
+
gapPx = 16
|
|
29
|
+
}: NotificationCardProps) {
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
className={cn(
|
|
33
|
+
'flex flex-col lg:flex-row items-start p-4 lg:p-5 gap-3 lg:gap-4 relative',
|
|
34
|
+
showBorder && 'border-b border-gray-200',
|
|
35
|
+
className
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
<div
|
|
39
|
+
className={cn(
|
|
40
|
+
'flex items-center justify-center size-10 rounded-full shrink-0',
|
|
41
|
+
iconBgColor
|
|
42
|
+
)}
|
|
43
|
+
>
|
|
44
|
+
{icon}
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div className="flex flex-col flex-1" style={{ gap: `${gapPx}px` }}>
|
|
48
|
+
<div className="flex flex-col gap-1">
|
|
49
|
+
<span className="paragraph-small-semibold text-gray-950">{title}</span>
|
|
50
|
+
{description && (
|
|
51
|
+
<span className="paragraph-small-regular text-gray-600">{description}</span>
|
|
52
|
+
)}
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div className="flex items-center gap-1.5">
|
|
56
|
+
<IconClock size={14} className="text-gray-400" />
|
|
57
|
+
<span className="paragraph-xsmall-medium text-gray-600">{time}</span>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
{actions && <div className="flex items-center gap-2">{actions}</div>}
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
{isUnread && <div className="size-2 bg-pages-400 rounded-full shrink-0 mt-1" />}
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type { NotificationCardProps };
|