-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Copy TextareaAutosize docs to Base (#32034)
- Loading branch information
1 parent
486ce23
commit 50966df
Showing
17 changed files
with
223 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
docs/data/base/components/textarea-autosize/EmptyTextarea.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as React from 'react'; | ||
import TextareaAutosize from '@mui/base/TextareaAutosize'; | ||
|
||
export default function EmptyTextarea() { | ||
return ( | ||
<TextareaAutosize | ||
aria-label="empty textarea" | ||
placeholder="Empty" | ||
style={{ width: 200 }} | ||
/> | ||
); | ||
} |
12 changes: 12 additions & 0 deletions
12
docs/data/base/components/textarea-autosize/EmptyTextarea.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as React from 'react'; | ||
import TextareaAutosize from '@mui/base/TextareaAutosize'; | ||
|
||
export default function EmptyTextarea() { | ||
return ( | ||
<TextareaAutosize | ||
aria-label="empty textarea" | ||
placeholder="Empty" | ||
style={{ width: 200 }} | ||
/> | ||
); | ||
} |
5 changes: 5 additions & 0 deletions
5
docs/data/base/components/textarea-autosize/EmptyTextarea.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<TextareaAutosize | ||
aria-label="empty textarea" | ||
placeholder="Empty" | ||
style={{ width: 200 }} | ||
/> |
15 changes: 15 additions & 0 deletions
15
docs/data/base/components/textarea-autosize/MaxHeightTextarea.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from 'react'; | ||
import TextareaAutosize from '@mui/base/TextareaAutosize'; | ||
|
||
export default function MaxHeightTextarea() { | ||
return ( | ||
<TextareaAutosize | ||
maxRows={4} | ||
aria-label="maximum height" | ||
placeholder="Maximum 4 rows" | ||
defaultValue="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt | ||
ut labore et dolore magna aliqua." | ||
style={{ width: 200 }} | ||
/> | ||
); | ||
} |
15 changes: 15 additions & 0 deletions
15
docs/data/base/components/textarea-autosize/MaxHeightTextarea.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from 'react'; | ||
import TextareaAutosize from '@mui/base/TextareaAutosize'; | ||
|
||
export default function MaxHeightTextarea() { | ||
return ( | ||
<TextareaAutosize | ||
maxRows={4} | ||
aria-label="maximum height" | ||
placeholder="Maximum 4 rows" | ||
defaultValue="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt | ||
ut labore et dolore magna aliqua." | ||
style={{ width: 200 }} | ||
/> | ||
); | ||
} |
8 changes: 8 additions & 0 deletions
8
docs/data/base/components/textarea-autosize/MaxHeightTextarea.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<TextareaAutosize | ||
maxRows={4} | ||
aria-label="maximum height" | ||
placeholder="Maximum 4 rows" | ||
defaultValue="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt | ||
ut labore et dolore magna aliqua." | ||
style={{ width: 200 }} | ||
/> |
13 changes: 13 additions & 0 deletions
13
docs/data/base/components/textarea-autosize/MinHeightTextarea.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as React from 'react'; | ||
import TextareaAutosize from '@mui/base/TextareaAutosize'; | ||
|
||
export default function MinHeightTextarea() { | ||
return ( | ||
<TextareaAutosize | ||
aria-label="minimum height" | ||
minRows={3} | ||
placeholder="Minimum 3 rows" | ||
style={{ width: 200 }} | ||
/> | ||
); | ||
} |
13 changes: 13 additions & 0 deletions
13
docs/data/base/components/textarea-autosize/MinHeightTextarea.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as React from 'react'; | ||
import TextareaAutosize from '@mui/base/TextareaAutosize'; | ||
|
||
export default function MinHeightTextarea() { | ||
return ( | ||
<TextareaAutosize | ||
aria-label="minimum height" | ||
minRows={3} | ||
placeholder="Minimum 3 rows" | ||
style={{ width: 200 }} | ||
/> | ||
); | ||
} |
6 changes: 6 additions & 0 deletions
6
docs/data/base/components/textarea-autosize/MinHeightTextarea.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<TextareaAutosize | ||
aria-label="minimum height" | ||
minRows={3} | ||
placeholder="Minimum 3 rows" | ||
style={{ width: 200 }} | ||
/> |
38 changes: 38 additions & 0 deletions
38
docs/data/base/components/textarea-autosize/textarea-autosize-pt.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
product: material-ui | ||
title: Componente React de texto autoajustável | ||
components: TextareaAutosize | ||
githubLabel: 'component: TextareaAutosize' | ||
--- | ||
|
||
# Texto autoajustável | ||
|
||
<p class="description">Um componente de texto para React que se ajusta conforme o conteúdo.</p> | ||
|
||
- 📦 [2.1 kB gzipped](/size-snapshot) | ||
|
||
O componente `TextareaAutosize` ajusta automaticamente a altura do textarea em eventos de teclado e redimensionamento de janela. | ||
|
||
[A paleta](/system/palette/) com funções de estilo. | ||
|
||
## Vazio | ||
|
||
{{"demo": "EmptyTextarea.js"}} | ||
|
||
## Altura mínima | ||
|
||
{{"demo": "MinHeightTextarea.js"}} | ||
|
||
## Altura máxima | ||
|
||
{{"demo": "MaxHeightTextarea.js"}} | ||
|
||
## Unstyled | ||
|
||
- 📦 [784 B gzipped](https://bundlephobia.com/package/@mui/base@latest) | ||
|
||
As the component does not have any styles, it also comes with the Base package. | ||
|
||
```js | ||
import TextareaAutosize from '@mui/base/TextareaAutosize'; | ||
``` |
38 changes: 38 additions & 0 deletions
38
docs/data/base/components/textarea-autosize/textarea-autosize-zh.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
product: material-ui | ||
title: React Textarea Autosize(自适应文本框)组件 | ||
components: TextareaAutosize | ||
githubLabel: 'component: TextareaAutosize' | ||
--- | ||
|
||
# Textarea Autosize 自适应文本框 | ||
|
||
<p class="description">一个自适应内容大小的 React 文本框组件。</p> | ||
|
||
- 📦 [2.1kB 的压缩包](/size-snapshot) | ||
|
||
当触发键盘和窗口大小事件的时候,`TextareaAutosize` 组件将自动调整的文本框的高度。 | ||
|
||
{{"component": "modules/components/ComponentLinkHeader.js", "design": false}} | ||
|
||
## 空白的文本框 | ||
|
||
{{"demo": "EmptyTextarea.js"}} | ||
|
||
## 最小高度 | ||
|
||
{{"demo": "MinHeightTextarea.js"}} | ||
|
||
## 最大高度 | ||
|
||
{{"demo": "MaxHeightTextarea.js"}} | ||
|
||
## Unstyled | ||
|
||
- 📦 [784 B gzipped](https://bundlephobia.com/package/@mui/base@latest) | ||
|
||
As the component does not have any styles, it also comes with the Base package. | ||
|
||
```js | ||
import TextareaAutosize from '@mui/base/TextareaAutosize'; | ||
``` |
29 changes: 29 additions & 0 deletions
29
docs/data/base/components/textarea-autosize/textarea-autosize.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
product: base | ||
title: Textarea Autosize React component | ||
components: TextareaAutosize | ||
githubLabel: 'component: TextareaAutosize' | ||
packageName: '@mui/base' | ||
--- | ||
|
||
# Textarea Autosize | ||
|
||
<p class="description">A textarea component for React which grows with content.</p> | ||
|
||
- 📦 [1.5 kB gzipped](/size-snapshot) | ||
|
||
The `TextareaAutosize` component automatically adjust the textarea height on keyboard and window resize events. | ||
|
||
{{"component": "modules/components/ComponentLinkHeader.js", "design": false}} | ||
|
||
## Empty | ||
|
||
{{"demo": "EmptyTextarea.js"}} | ||
|
||
## Minimum height | ||
|
||
{{"demo": "MinHeightTextarea.js"}} | ||
|
||
## Maximum height | ||
|
||
{{"demo": "MaxHeightTextarea.js"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as React from 'react'; | ||
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
import { | ||
demos, | ||
docs, | ||
demoComponents, | ||
} from 'docs/data/base/components/textarea-autosize/textarea-autosize.md?@mui/markdown'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs demos={demos} docs={docs} demoComponents={demoComponents} />; | ||
} |