Skip to content

Commit

Permalink
feat: resize variant to text-area component
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbura committed Dec 20, 2024
1 parent 7710aff commit fc8080e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
22 changes: 21 additions & 1 deletion src/components/text-area/TextArea.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const TextArea = recipe({
width: "100%",
maxWidth: "100%",
flexGrow: 1,
resize: "vertical",

color: OnContainer,
backgroundColor: Container,
Expand Down Expand Up @@ -159,11 +158,32 @@ export const TextArea = recipe({
},
},
radii: RadiiVariant,
resize: {
Vertical: {
resize: "vertical",
},
Horizontal: {
resize: "horizontal",
},
Both: {
resize: "both",
},
None: {
resize: "none",
},
Block: {
resize: "block",
},
Inline: {
resize: "inline",
},
},
},
defaultVariants: {
variant: "Background",
size: "400",
radii: "400",
resize: "Vertical",
},
});

Expand Down
4 changes: 4 additions & 0 deletions src/components/text-area/TextArea.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export default {
outlined: {
control: "boolean",
},
resize: {
control: "select",
options: ["Vertical", "Horizontal", "Both", "None", "block", "inline"],
},
},
} as ComponentMeta<typeof TextArea>;

Expand Down
4 changes: 2 additions & 2 deletions src/components/text-area/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import * as css from "./TextArea.css";
export const TextArea = forwardRef<
HTMLTextAreaElement,
AllHTMLAttributes<HTMLTextAreaElement> & css.TextAreaVariants
>(({ className, variant, size, outlined, radii, ...props }, ref) => (
>(({ className, variant, size, outlined, radii, resize, ...props }, ref) => (
<textarea
className={classNames(css.TextArea({ variant, size, outlined, radii }), className)}
className={classNames(css.TextArea({ variant, size, outlined, radii, resize }), className)}
{...props}
ref={ref}
/>
Expand Down

0 comments on commit fc8080e

Please sign in to comment.