Skip to content

Commit

Permalink
Extend errorMessage and successMessage types in number input, text ar…
Browse files Browse the repository at this point in the history
…ea, and text input (#2347)
  • Loading branch information
stephl3 authored May 22, 2024
1 parent 3a793b4 commit 3b86b3b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .changeset/sharp-chicken-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@leafygreen-ui/number-input': minor
'@leafygreen-ui/text-input': minor
'@leafygreen-ui/text-area': minor
---

Allow type of `ReactNode` for `errorMessage` and `successMessage` props in `NumberInput`, `TextArea`, and `TextInput`
4 changes: 2 additions & 2 deletions packages/number-input/src/NumberInput/NumberInput.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ export interface BaseNumberInputProps
/**
* The message shown below the input element if the value is invalid.
*/
errorMessage?: string;
errorMessage?: React.ReactNode;

/**
* The message shown below the input element if the value is valid.
*/
successMessage?: string;
successMessage?: React.ReactNode;

/**
* Determines the font size and padding.
Expand Down
4 changes: 2 additions & 2 deletions packages/text-area/src/TextArea/TextArea.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ export interface BaseTextAreaProps
/**
* The message shown below the input element if the value is invalid.
*/
errorMessage?: string;
errorMessage?: React.ReactNode;

/**
* The message shown below the input element if the value is valid.
*/
successMessage?: string;
successMessage?: React.ReactNode;

/**
* Callback called whenever validation should be run.
Expand Down
4 changes: 2 additions & 2 deletions packages/text-input/src/TextInput/TextInput.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ export interface BaseTextInputProps
/**
* The message shown below the input field if the value is invalid.
*/
errorMessage?: string;
errorMessage?: React.ReactNode;

/**
* The message shown below the input field if the value is valid.
*/
successMessage?: string;
successMessage?: React.ReactNode;

/**
* The current state of the TextInput. This can be none, valid, or error.
Expand Down

0 comments on commit 3b86b3b

Please sign in to comment.