@govuk-react/text-area
Advanced tools
Comparing version 0.9.1 to 0.10.0
{ | ||
"name": "@govuk-react/text-area", | ||
"version": "0.9.1", | ||
"version": "0.10.0", | ||
"dependencies": { | ||
"@govuk-react/constants": "^0.9.1", | ||
"@govuk-react/error-text": "^0.9.1", | ||
"@govuk-react/hint-text": "^0.9.1", | ||
"@govuk-react/hoc": "^0.9.1", | ||
"@govuk-react/label": "^0.9.1", | ||
"@govuk-react/label-text": "^0.9.1", | ||
"@govuk-react/constants": "^0.10.0", | ||
"@govuk-react/error-text": "^0.10.0", | ||
"@govuk-react/hint-text": "^0.10.0", | ||
"@govuk-react/label": "^0.10.0", | ||
"@govuk-react/label-text": "^0.10.0", | ||
"govuk-colours": "^1.1.0" | ||
@@ -18,9 +17,8 @@ }, | ||
"scripts": { | ||
"build": "yarn build:lib && yarn build:es", | ||
"build:lib": "rimraf lib && babel src -x .js,jsx,.ts,.tsx -d lib --source-maps --config-file ../../babel.config.js", | ||
"build:es": "rimraf es && cross-env BABEL_ENV=es babel src -x .js,jsx,.ts,.tsx -d es --source-maps --config-file ../../babel.config.js", | ||
"docs": "doc-component ./lib/index.js ./README.md" | ||
"docs": "doc-component ./src/index.tsx ./README.md", | ||
"version": "yarn version" | ||
}, | ||
"main": "lib/index.js", | ||
"module": "es/index.js", | ||
"main": "dist/govuk-react-text-area.cjs.js", | ||
"module": "dist/govuk-react-text-area.esm.js", | ||
"source": "src/index.tsx", | ||
"author": "Alasdair McLeay", | ||
@@ -30,3 +28,2 @@ "license": "MIT", | ||
"description": "Styled textarea supporting additional parameters via props.", | ||
"private": false, | ||
"publishConfig": { | ||
@@ -33,0 +30,0 @@ "access": "public" |
@@ -10,49 +10,18 @@ TextArea | ||
### Usage | ||
Use the textarea component when you need to let users enter an amount of text that’s longer than a single line. | ||
Simple | ||
- https://govuk-react.github.io/govuk-react/?path=/docs/text-area | ||
- https://design-system.service.gov.uk/components/textarea/ | ||
```jsx | ||
import { TextArea } from 'govuk-react' | ||
<TextArea name="group1">Description of what you saw</TextArea> | ||
``` | ||
TextArea with hint text | ||
```jsx | ||
<TextArea name="group1" hint={['Enter as many words as you like']}> | ||
Description of what you saw | ||
</TextArea> | ||
``` | ||
TextArea with hint text & error | ||
```jsx | ||
const meta = { | ||
touched: true, | ||
error: 'Example', | ||
}; | ||
<TextArea | ||
name="group1" | ||
hint={['Enter as many words as you like']} | ||
meta={meta} | ||
> | ||
Description of what you saw | ||
</TextArea> | ||
``` | ||
### References: | ||
- https://github.com/alphagov/govuk-frontend/tree/main/src/govuk/components/textarea | ||
### Properties | ||
Prop | Required | Default | Type | Description | ||
:--- | :------- | :------ | :--- | :---------- | ||
`children` | true | `````` | node | | ||
`hint` | | ```undefined``` | string | | ||
`input` | | ```{}``` | shape[object Object] | | ||
`meta` | | ```{}``` | shape[object Object] | | ||
`error` | | `````` | boolean | Apply error state styling to the component | ||
`hint` | | ```undefined``` | ReactNode | | ||
`input` | | ```{}``` | TextareaHTMLAttributes<HTMLTextAreaElement> | | ||
`margin` | | `````` | Margin | Margin[] | | ||
`mb` | | `````` | string | number | | ||
`meta` | | ```{}``` | { error?: string | string[]; touched?: boolean; } | | ||
`padding` | | `````` | Padding | Padding[] | | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
8
576
29206
12
27
2
1
+ Added@govuk-react/constants@0.10.7(transitive)
+ Added@govuk-react/error-text@0.10.7(transitive)
+ Added@govuk-react/hint-text@0.10.7(transitive)
+ Added@govuk-react/label@0.10.7(transitive)
+ Added@govuk-react/label-text@0.10.7(transitive)
+ Added@govuk-react/lib@0.10.7(transitive)
- Removed@govuk-react/hoc@^0.9.1
- Removed@govuk-react/constants@0.9.1(transitive)
- Removed@govuk-react/error-text@0.9.1(transitive)
- Removed@govuk-react/hint-text@0.9.1(transitive)
- Removed@govuk-react/hoc@0.9.1(transitive)
- Removed@govuk-react/label@0.9.1(transitive)
- Removed@govuk-react/label-text@0.9.1(transitive)
- Removed@govuk-react/lib@0.9.1(transitive)
- Removed@govuk-react/link@0.9.1(transitive)
Updated@govuk-react/label@^0.10.0