✨(TextArea) add classic variant and hideLabel props
- Add variant prop with classic mode support - Add hideLabel prop for accessible hidden labels - Label rendered outside wrapper in classic mode - Native placeholder support in classic mode - Compact height in classic mode - Add unit tests and Storybook stories Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,12 @@ export default {
|
||||
args: {
|
||||
rows: 4,
|
||||
},
|
||||
argTypes: {
|
||||
variant: {
|
||||
control: "select",
|
||||
options: ["floating", "classic"],
|
||||
},
|
||||
},
|
||||
} as Meta<typeof TextArea>;
|
||||
|
||||
export const ShowCase = () => {
|
||||
@@ -175,6 +181,60 @@ export const WithRef = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export const ClassicVariant = {
|
||||
args: {
|
||||
label: "Description",
|
||||
variant: "classic",
|
||||
placeholder: "Enter a description...",
|
||||
},
|
||||
};
|
||||
|
||||
export const ClassicVariantFilled = {
|
||||
args: {
|
||||
label: "Description",
|
||||
variant: "classic",
|
||||
placeholder: "Enter a description...",
|
||||
defaultValue: "This is a detailed description of the project.",
|
||||
},
|
||||
};
|
||||
|
||||
export const ClassicVariantDisabled = {
|
||||
args: {
|
||||
label: "Description",
|
||||
variant: "classic",
|
||||
placeholder: "Enter a description...",
|
||||
disabled: true,
|
||||
},
|
||||
};
|
||||
|
||||
export const ClassicVariantError = {
|
||||
args: {
|
||||
label: "Description",
|
||||
variant: "classic",
|
||||
placeholder: "Enter a description...",
|
||||
defaultValue: "Too short",
|
||||
state: "error",
|
||||
text: "Description must be at least 50 characters",
|
||||
},
|
||||
};
|
||||
|
||||
export const HiddenLabel = {
|
||||
args: {
|
||||
label: "Notes",
|
||||
hideLabel: true,
|
||||
placeholder: "Add your notes here...",
|
||||
},
|
||||
};
|
||||
|
||||
export const HiddenLabelClassic = {
|
||||
args: {
|
||||
label: "Notes",
|
||||
variant: "classic",
|
||||
hideLabel: true,
|
||||
placeholder: "Add your notes here...",
|
||||
},
|
||||
};
|
||||
|
||||
export const FormExample = () => {
|
||||
return (
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user