Skip to content

Commit

Permalink
Create textarea component
Browse files Browse the repository at this point in the history
  • Loading branch information
camilovegag committed Feb 8, 2024
1 parent c9421a6 commit 0f91de2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/berlin/src/components/textarea/Textarea.styled.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import styled from 'styled-components';

export const StyledTextarea = styled.textarea`
background-color: var(--color-white);
border-radius: 0.5rem;
border: 1px solid var(--color-black);
height: 12rem;
padding: 0.75rem 1rem;
resize: none;
width: 100%;
&:disabled {
cursor: not-allowed;
}
`;
22 changes: 22 additions & 0 deletions packages/berlin/src/components/textarea/Textarea.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Components
import { FlexColumn } from '../containers/FlexColum.styled';
import Label from '../typography/Label';

// Styled Components
import { StyledTextarea } from './Textarea.styled';

type TextareaProps = {
label: string;
$required?: boolean;
};

function Textarea({ label, $required, ...props }: TextareaProps) {
return (
<FlexColumn>
{label && <Label $required={$required}>{label}</Label>}
<StyledTextarea {...props} />
</FlexColumn>
);
}

export default Textarea;
1 change: 1 addition & 0 deletions packages/berlin/src/components/textarea/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Textarea';

0 comments on commit 0f91de2

Please sign in to comment.