Skip to content

Commit

Permalink
feat(design-system): add rows prop
Browse files Browse the repository at this point in the history
  • Loading branch information
g-saracca committed Nov 26, 2024
1 parent ecf61d5 commit 59a47e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/design-system/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
- **Offcanvas:** NEW Offcanvas component.
- **FormCheckbox:** modify Props Interface to allow any react node as `label` prop.
- **RichTextEditor:** NEW Rich Text Editor component.
- **FormTextArea:** modify Props Interface to allow `rows` prop.

# [1.1.0](https://github.com/IQSS/dataverse-frontend/compare/@iqss/[email protected]...@iqss/[email protected]) (2024-03-12)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ import { Form as FormBS } from 'react-bootstrap'
import * as React from 'react'

export type FormInputElement = HTMLInputElement | HTMLTextAreaElement
export interface FormTextAreaProps extends Omit<React.HTMLAttributes<FormInputElement>, 'rows'> {
export interface FormTextAreaProps extends React.HTMLAttributes<FormInputElement> {
name?: string
disabled?: boolean
isValid?: boolean
isInvalid?: boolean
value?: string
autoFocus?: boolean
rows?: number
}

export const FormTextArea = React.forwardRef(function FormTextArea(
{ name, disabled, isValid, isInvalid, value, autoFocus, ...props }: FormTextAreaProps,
{ name, disabled, isValid, isInvalid, value, autoFocus, rows = 5, ...props }: FormTextAreaProps,
ref
) {
return (
<FormBS.Control
as="textarea"
rows={5}
rows={rows}
disabled={disabled}
name={name}
isValid={isValid}
Expand Down

0 comments on commit 59a47e2

Please sign in to comment.