Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(textarea): remove max-width css property #1981

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import './style.css'
import React from 'react'

import { Textarea } from '../index'
import { Stack } from '../../stack'
import { Textarea } from '../index'

export default {
title: 'components/textarea',
Expand All @@ -15,84 +14,40 @@ export function NoResize() {
const [value, setValue] = React.useState('')

return (
<>
<Textarea
value={value}
onChange={setValue}
className="textarea-container"
resizable={false}
optional
/>
<Textarea
value={value}
onChange={setValue}
className="textarea-container"
resizable={false}
/>
<Textarea
value={value}
onChange={setValue}
className="textarea-container"
error
resizable={false}
/>
<Textarea
value={value}
onChange={setValue}
className="textarea-container"
disabled
resizable={false}
/>
<Stack>
<Textarea value={value} onChange={setValue} resizable={false} optional />
<Textarea value={value} onChange={setValue} resizable={false} />
<Textarea value={value} onChange={setValue} error resizable={false} />
<Textarea value={value} onChange={setValue} disabled resizable={false} />
<Textarea
value="The quick brown fox is tired right now"
className="textarea-container"
disabled
resizable={false}
/>
<Textarea
value={value}
onChange={setValue}
className="textarea-container"
maxLength={120}
resizable={false}
/>
</>
</Stack>
)
}

export function FormField() {
const [value, setValue] = React.useState('')

return (
<Textarea
error
className="textarea-container"
value={value}
onChange={setValue}
maxLength={120}
/>
)
return <Textarea error value={value} onChange={setValue} maxLength={120} />
}

export function LongText() {
const [value, setValue] = React.useState('')

return (
<Stack>
<Textarea
error
className="textarea-container"
value={value}
onChange={setValue}
maxLength={120}
/>
<Textarea error value={value} onChange={setValue} maxLength={120} />

<Textarea
error
className="textarea-container"
value={value}
onChange={setValue}
/>
<Textarea error value={value} onChange={setValue} />
</Stack>
)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './style.css'
import React from 'react'

import { Stack } from '../../stack'
import { Textarea } from '../index'

export default {
Expand All @@ -11,47 +11,14 @@ export function Show() {
const [value, setValue] = React.useState('')

return (
<>
<Textarea
value={value}
onChange={setValue}
className="textarea-container"
maxLength={120}
/>
<Textarea
value={value}
onChange={setValue}
className="textarea-container"
optional
/>
<Textarea
value={value}
onChange={setValue}
className="textarea-container"
/>
<Textarea
value={value}
onChange={setValue}
className="textarea-container"
error
/>
<Textarea
value={value}
onChange={setValue}
className="textarea-container"
disabled
/>
<Textarea
value="The quick brown fox is tired right now"
className="textarea-container"
disabled
/>
<Textarea
value={value}
onChange={setValue}
className="textarea-container"
maxLength={120}
/>
</>
<Stack>
<Textarea value={value} onChange={setValue} maxLength={120} />
<Textarea value={value} onChange={setValue} optional />
<Textarea value={value} onChange={setValue} />
<Textarea value={value} onChange={setValue} error />
<Textarea value={value} onChange={setValue} disabled />
<Textarea value="The quick brown fox is tired right now" disabled />
<Textarea value={value} onChange={setValue} maxLength={120} />
</Stack>
)
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[data-sl-textarea] {
width: 100%;
max-width: 20rem;
}

[data-sl-textarea-input] {
Expand Down