From d461961e307e6edc631c5d92936b4b3b52bcf34c Mon Sep 17 00:00:00 2001 From: Artur Santiago Date: Tue, 21 Jan 2025 16:52:28 -0300 Subject: [PATCH] feat: create textarea component --- .../src/atoms/Textarea/Textarea.tsx | 33 +++++++ .../components/src/atoms/Textarea/index.ts | 2 + packages/components/src/index.ts | 12 ++- .../src/components/atoms/TextArea/styles.scss | 86 +++++++++++++++++++ 4 files changed, 126 insertions(+), 7 deletions(-) create mode 100644 packages/components/src/atoms/Textarea/Textarea.tsx create mode 100644 packages/components/src/atoms/Textarea/index.ts create mode 100644 packages/ui/src/components/atoms/TextArea/styles.scss diff --git a/packages/components/src/atoms/Textarea/Textarea.tsx b/packages/components/src/atoms/Textarea/Textarea.tsx new file mode 100644 index 0000000000..c5a061c020 --- /dev/null +++ b/packages/components/src/atoms/Textarea/Textarea.tsx @@ -0,0 +1,33 @@ +import type { TextareaHTMLAttributes } from 'react' +import React, { forwardRef } from 'react' + +export interface TextareaProps + extends TextareaHTMLAttributes { + /** + * ID to find this component in testing tools (e.g.: cypress, testing library, and jest). + */ + testId?: string + /** + * Controls the resize property of the textare (e.g.: none, vertical, horizontal, both). + * Default is 'both'. + */ + resize?: 'none' | 'vertical' | 'horizontal' | 'both' +} + +const Textarea = forwardRef( + function Textarea( + { testId = 'fs-textarea', resize = 'both', ...otherProps }, + ref + ) { + return ( +