From 6c9ba1a2e726571de1f3059ab6107df73d1ace54 Mon Sep 17 00:00:00 2001 From: Caio Alexandre Troti Caetano Date: Wed, 11 Dec 2024 13:38:32 -0300 Subject: [PATCH 01/14] :sparkles: feat: Implemented Stepper --- .../(routes)/transactions/create/stepper.tsx | 43 ++++++++++++++ .../transactions/primitives/stepper.tsx | 56 +++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 src/app/(routes)/transactions/create/stepper.tsx create mode 100644 src/app/(routes)/transactions/primitives/stepper.tsx diff --git a/src/app/(routes)/transactions/create/stepper.tsx b/src/app/(routes)/transactions/create/stepper.tsx new file mode 100644 index 00000000..5c1efbcf --- /dev/null +++ b/src/app/(routes)/transactions/create/stepper.tsx @@ -0,0 +1,43 @@ +import { useIntl } from 'react-intl' +import { + Stepper as PrimitiveStepper, + StepperItem, + StepperItemNumber, + StepperItemText +} from '../primitives/stepper' + +export const Stepper = () => { + const intl = useIntl() + + return ( + + + 1 + + {intl.formatMessage({ + id: 'transactions.create.stepper.first', + defaultMessage: 'Transaction Data' + })} + + + + 2 + + {intl.formatMessage({ + id: 'transactions.create.stepper.second', + defaultMessage: 'Operations and Metadata' + })} + + + + 3 + + {intl.formatMessage({ + id: 'transactions.create.stepper.third', + defaultMessage: 'Review' + })} + + + + ) +} diff --git a/src/app/(routes)/transactions/primitives/stepper.tsx b/src/app/(routes)/transactions/primitives/stepper.tsx new file mode 100644 index 00000000..ba1f90cb --- /dev/null +++ b/src/app/(routes)/transactions/primitives/stepper.tsx @@ -0,0 +1,56 @@ +import { cn } from '@/lib/utils' +import { forwardRef, HTMLAttributes } from 'react' + +export const Stepper = forwardRef< + HTMLDivElement, + HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +Stepper.displayName = 'Stepper' + +export type StepperItemProps = HTMLAttributes & { + active?: boolean +} + +export const StepperItem = forwardRef( + ({ className, active, ...props }, ref) => ( +
+ ) +) +StepperItem.displayName = 'StepperItem' + +export const StepperItemNumber = forwardRef< + HTMLDivElement, + HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +StepperItemNumber.displayName = 'StepperItemNumber' + +export const StepperItemText = forwardRef< + HTMLParagraphElement, + HTMLAttributes +>(({ className, ...props }, ref) => ( +

+)) +StepperItemText.displayName = 'StepperItemText' From 9fdd6e945e51f855a6728e695cbea14497d8f8fa Mon Sep 17 00:00:00 2001 From: Caio Alexandre Troti Caetano Date: Wed, 11 Dec 2024 13:38:45 -0300 Subject: [PATCH 02/14] :sparkles: feat: Added description to InputField --- src/components/form/input-field/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/form/input-field/index.tsx b/src/components/form/input-field/index.tsx index 6d810e9c..a97d3610 100644 --- a/src/components/form/input-field/index.tsx +++ b/src/components/form/input-field/index.tsx @@ -1,5 +1,6 @@ import { FormControl, + FormDescription, FormField, FormItem, FormLabel, @@ -17,6 +18,7 @@ export type InputFieldProps = { tooltip?: string labelExtra?: ReactNode placeholder?: string + description?: ReactNode control: Control disabled?: boolean readOnly?: boolean @@ -29,6 +31,7 @@ export const InputField = ({ tooltip, labelExtra, placeholder, + description, required, readOnly, ...others @@ -56,6 +59,7 @@ export const InputField = ({ /> + {description && {description}} )} /> From 4c501e48501fb1c0550eae576588df2f5592c454 Mon Sep 17 00:00:00 2001 From: Caio Alexandre Troti Caetano Date: Wed, 11 Dec 2024 14:24:24 -0300 Subject: [PATCH 03/14] :sparkles: feat: Added SVGs --- public/svg/arrow-right-circle.svg | 4 ++++ public/svg/dolar-sign.svg | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 public/svg/arrow-right-circle.svg create mode 100644 public/svg/dolar-sign.svg diff --git a/public/svg/arrow-right-circle.svg b/public/svg/arrow-right-circle.svg new file mode 100644 index 00000000..d7733fe0 --- /dev/null +++ b/public/svg/arrow-right-circle.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/svg/dolar-sign.svg b/public/svg/dolar-sign.svg new file mode 100644 index 00000000..88edf53a --- /dev/null +++ b/public/svg/dolar-sign.svg @@ -0,0 +1,3 @@ + + + From d6219794939f48c0af9edb76488711138bf29cdc Mon Sep 17 00:00:00 2001 From: Caio Alexandre Troti Caetano Date: Tue, 17 Dec 2024 14:43:23 -0300 Subject: [PATCH 04/14] :sparkles: feat: Added new zod messages --- src/lib/zod/messages.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/zod/messages.ts b/src/lib/zod/messages.ts index bb55e1a0..3a352100 100644 --- a/src/lib/zod/messages.ts +++ b/src/lib/zod/messages.ts @@ -26,6 +26,10 @@ const messages = defineMessages({ defaultMessage: 'Field must contain over {minimum} {minimum, plural, =0 {characters} one {character} other {characters}}' }, + too_small_number_not_inclusive: { + id: 'errors.too_small.number.not_inclusive', + defaultMessage: 'Field must be greater than {minimum}' + }, too_small_date_exact: { id: 'errors.too_small.date.exact', defaultMessage: 'Date must be exactly {minimum}' @@ -55,6 +59,10 @@ const messages = defineMessages({ defaultMessage: 'Field must contain under {maximum} {maximum, plural, =0 {characters} one {character} other {characters}}' }, + too_big_number_inclusive: { + id: 'errors.too_big.number.inclusive', + defaultMessage: 'Field must be less than or equal to {maximum}' + }, too_big_date_exact: { id: 'errors.too_big.date.exact', defaultMessage: 'Date must be exactly {maximum}' From f0b137ff1848db1b51034e2fe06f70e620f87891 Mon Sep 17 00:00:00 2001 From: Caio Alexandre Troti Caetano Date: Tue, 17 Dec 2024 14:43:41 -0300 Subject: [PATCH 05/14] :sparkles: feat: New informative variant for Alert --- src/components/ui/alert/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/ui/alert/index.tsx b/src/components/ui/alert/index.tsx index 6fd7a005..ba15db5e 100644 --- a/src/components/ui/alert/index.tsx +++ b/src/components/ui/alert/index.tsx @@ -9,6 +9,8 @@ const alertVariants = cva( variants: { variant: { default: 'bg-white text-slate-950 dark:bg-slate-950 dark:text-slate-50', + informative: + 'bg-[#EFF6FF] border-opacity-50 border-[#2563eb] text-[#1E40AF] dark:bg-blue-900 dark:text-blue-50 [&>svg]:text-blue-600', destructive: 'border-red-500/50 text-red-500 dark:border-red-500 [&>svg]:text-red-500 dark:border-red-900/50 dark:text-red-900 dark:dark:border-red-900 dark:[&>svg]:text-red-900' } From 5334ccdad3f557a2f62a96d0ecafe4946c660a6a Mon Sep 17 00:00:00 2001 From: Caio Alexandre Troti Caetano Date: Tue, 17 Dec 2024 14:44:05 -0300 Subject: [PATCH 06/14] :sparkles: feat: Implemented Page Footer --- src/components/page-footer/index.tsx | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/components/page-footer/index.tsx diff --git a/src/components/page-footer/index.tsx b/src/components/page-footer/index.tsx new file mode 100644 index 00000000..13c2d523 --- /dev/null +++ b/src/components/page-footer/index.tsx @@ -0,0 +1,50 @@ +import { forwardRef, HTMLAttributes } from 'react' +import { cn } from '@/lib/utils' + +export type PageFooterProps = HTMLAttributes & { + open?: boolean + thumb?: boolean +} + +export const PageFooter = forwardRef( + ({ className, open = true, thumb = true, children, ...props }, ref) => ( +

+ {thumb && } +
+ {children} +
+
+ ) +) +PageFooter.displayName = 'PageFooter' + +export const PageFooterThumb = forwardRef< + HTMLDivElement, + HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +PageFooterThumb.displayName = 'PageFooterThumb' + +export const PageFooterSection = forwardRef< + HTMLDivElement, + HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +PageFooterSection.displayName = 'PageFooterSection' From 4ebdf1188395c5d08d31da82f65c8b9f639e28b3 Mon Sep 17 00:00:00 2001 From: Caio Alexandre Troti Caetano Date: Tue, 17 Dec 2024 14:51:44 -0300 Subject: [PATCH 07/14] :sparkles: feat: Added more SVGs --- public/svg/arrow-right-left-circle.svg | 4 ++++ public/svg/check-check-circle-green.svg | 4 ++++ public/svg/clock-circle.svg | 4 ++++ public/svg/x-circle.svg | 4 ++++ 4 files changed, 16 insertions(+) create mode 100644 public/svg/arrow-right-left-circle.svg create mode 100644 public/svg/check-check-circle-green.svg create mode 100644 public/svg/clock-circle.svg create mode 100644 public/svg/x-circle.svg diff --git a/public/svg/arrow-right-left-circle.svg b/public/svg/arrow-right-left-circle.svg new file mode 100644 index 00000000..298a46e3 --- /dev/null +++ b/public/svg/arrow-right-left-circle.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/svg/check-check-circle-green.svg b/public/svg/check-check-circle-green.svg new file mode 100644 index 00000000..c6f036ca --- /dev/null +++ b/public/svg/check-check-circle-green.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/svg/clock-circle.svg b/public/svg/clock-circle.svg new file mode 100644 index 00000000..2901f1cc --- /dev/null +++ b/public/svg/clock-circle.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/svg/x-circle.svg b/public/svg/x-circle.svg new file mode 100644 index 00000000..84466912 --- /dev/null +++ b/public/svg/x-circle.svg @@ -0,0 +1,4 @@ + + + + From e95d965224cbcb3a885675012c7983e27a3da91c Mon Sep 17 00:00:00 2001 From: Caio Alexandre Troti Caetano Date: Tue, 17 Dec 2024 16:10:44 -0300 Subject: [PATCH 08/14] :boom: fix: Adjusted application scroll behavior --- src/app/(routes)/layout.tsx | 8 +++++--- src/app/app.tsx | 30 ++++++++++++++---------------- src/app/globals.css | 6 +++++- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/app/(routes)/layout.tsx b/src/app/(routes)/layout.tsx index 7964dd8d..08cd5770 100644 --- a/src/app/(routes)/layout.tsx +++ b/src/app/(routes)/layout.tsx @@ -24,12 +24,14 @@ export default async function RootLayout({ -
+
-
+
-
{children}
+
+ {children} +
diff --git a/src/app/app.tsx b/src/app/app.tsx index 8a70c6c1..0beee3ba 100644 --- a/src/app/app.tsx +++ b/src/app/app.tsx @@ -9,21 +9,19 @@ import ZodSchemaProvider from '@/lib/zod/zod-schema-provider' export default async function App({ children }: { children: React.ReactNode }) { return ( -
- - - - -
{children}
- -
-
-
- -
-
+ + + + + {children} + + + + + + ) } diff --git a/src/app/globals.css b/src/app/globals.css index 7113fe48..765ba9a8 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -74,7 +74,11 @@ @apply border-border; } + html { + @apply h-full overflow-y-auto; + } + body { - @apply bg-background text-foreground; + @apply h-full overflow-y-auto bg-background text-foreground; } } From 272cec9c05da00bf86025967709c04deb90c1422 Mon Sep 17 00:00:00 2001 From: Caio Alexandre Troti Caetano Date: Tue, 17 Dec 2024 16:16:38 -0300 Subject: [PATCH 09/14] :sparkles: feat: Added a crude Textarea implementation --- src/components/form/input-field/index.tsx | 26 +++++++++++++++++------ src/components/ui/textarea/index.tsx | 22 +++++++++++++++++++ 2 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 src/components/ui/textarea/index.tsx diff --git a/src/components/form/input-field/index.tsx b/src/components/form/input-field/index.tsx index a97d3610..9e5d021f 100644 --- a/src/components/form/input-field/index.tsx +++ b/src/components/form/input-field/index.tsx @@ -8,6 +8,7 @@ import { FormTooltip } from '@/components/ui/form' import { Input } from '@/components/ui/input' +import { Textarea } from '@/components/ui/textarea' import { HTMLInputTypeAttribute, ReactNode } from 'react' import { Control } from 'react-hook-form' @@ -22,6 +23,8 @@ export type InputFieldProps = { control: Control disabled?: boolean readOnly?: boolean + rows?: number + textArea?: boolean required?: boolean } @@ -34,6 +37,8 @@ export const InputField = ({ description, required, readOnly, + rows, + textArea, ...others }: InputFieldProps) => { return ( @@ -51,12 +56,21 @@ export const InputField = ({ )} - + {textArea ? ( +