Skip to content
This repository was archived by the owner on Aug 26, 2021. It is now read-only.

Commit d8ecf8a

Browse files
Merge pull request #701 from govau/feature/form-comp
Add form component
2 parents 4100075 + be87e79 commit d8ecf8a

File tree

20 files changed

+9516
-1
lines changed

20 files changed

+9516
-1
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,20 @@ All components have to work on the below browsers:
299299
----------
300300
</details>
301301

302+
<details>
303+
<summary>@gov.au/form</summary>
304+
<br><code>npm install @gov.au/form</code><br>
305+
<br>See the <a href="https://auds.service.gov.au/packages/form/tests/site/">visual test file for form</a>
306+
<br>See the <a href="https://github.com/govau/design-system-components/blob/master/packages/form/README.md">readme file for form</a><br><br>
307+
Dependencies:
308+
<br>
309+
310+
```shell
311+
└─ core
312+
```
313+
----------
314+
</details>
315+
302316
<details>
303317
<summary>@gov.au/grid-12</summary>
304318
<br><code>npm install @gov.au/grid-12</code><br>

auds.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

package-lock.json

Lines changed: 104 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/form/CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@gov.au/form CHANGELOG
2+
======================
3+
4+
> Part of the [gov.au components](https://github.com/govau/design-system-components/) ecosystem.
5+
6+
7+
## Contents
8+
9+
* [Versions](#install)
10+
* [Release History](#release-history)
11+
12+
13+
----------------------------------------------------------------------------------------------------------------------------------------------------------------
14+
15+
16+
## Versions
17+
18+
* [v0.1.0 - 💥 Initial version](#v010)
19+
20+
21+
----------------------------------------------------------------------------------------------------------------------------------------------------------------
22+
23+
24+
## Release History
25+
26+
### v0.1.0
27+
28+
- 💥 Initial version
29+
30+
31+
**[⬆ back to top](#contents)**
32+
33+
34+
# };

packages/form/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Commonwealth of Australia
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/form/README.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
@gov.au/form
2+
============
3+
4+
> The form component contains layout, labelling and inline validations for form fields
5+
6+
7+
## Contents
8+
9+
* [Install](#install)
10+
* [Dependency graph](#dependency-graph)
11+
* [Tests](#tests)
12+
* [Release History](#release-history)
13+
* [License](#license)
14+
15+
16+
----------------------------------------------------------------------------------------------------------------------------------------------------------------
17+
18+
19+
## Install
20+
21+
22+
```shell
23+
yarn add @gov.au/form
24+
```
25+
26+
```shell
27+
npm install @gov.au/form
28+
```
29+
30+
31+
**[⬆ back to top](#contents)**
32+
33+
34+
----------------------------------------------------------------------------------------------------------------------------------------------------------------
35+
36+
37+
## Dependency graph
38+
39+
```shell
40+
form
41+
└─ core
42+
```
43+
44+
45+
**[⬆ back to top](#contents)**
46+
47+
48+
----------------------------------------------------------------------------------------------------------------------------------------------------------------
49+
50+
51+
## Tests
52+
53+
The visual test: https://auds.service.gov.au/packages/form/tests/site/
54+
55+
56+
**[⬆ back to top](#contents)**
57+
58+
59+
----------------------------------------------------------------------------------------------------------------------------------------------------------------
60+
61+
62+
## Release History
63+
64+
* v0.1.0 - 💥 Initial version
65+
66+
67+
**[⬆ back to top](#contents)**
68+
69+
70+
----------------------------------------------------------------------------------------------------------------------------------------------------------------
71+
72+
73+
## License
74+
75+
Copyright (c) Commonwealth of Australia.
76+
Licensed under [MIT](https://raw.githubusercontent.com/govau/design-system-components/packages/core/master/LICENSE).
77+
78+
79+
**[⬆ back to top](#contents)**
80+
81+
# };
82+
83+
84+
----------------------------------------------------------------------------------------------------------------------------------------------------------------
85+
86+
87+
## Usage
88+
89+
90+
* [React](#react)
91+
92+
93+
**[⬆ back to top](#contents)**
94+
95+
96+
----------------------------------------------------------------------------------------------------------------------------------------------------------------
97+
98+
### React
99+
100+
Usage:
101+
102+
```jsx
103+
import { AUlabel, AUhintText, AUerrorText, AUformGroup, AUfieldset, AUlegend } from '@gov.au/form';
104+
105+
<AUlabel text="Email" />
106+
107+
<AUhintText text="We will only use this email to respond to your query." />
108+
109+
<AUerrorText text="Enter an email address in the correct format, like name@example.com" />
110+
111+
<AUformGroup>
112+
// labels, hint text, and form controls here
113+
</AUformGroup>
114+
115+
<AUfieldset>
116+
<AUlegend>
117+
// labels/hint text here
118+
</AUlegend>
119+
120+
// form controls here
121+
122+
</AUfieldset>
123+
```
124+
125+
All props:
126+
127+
```jsx
128+
<AUlabel
129+
text="Email" {/* The text of the label */}
130+
dark={ true } {/* The dark variation of the component */}
131+
inline={ true } {/* Label inline*/}
132+
/>
133+
134+
<AUhintText
135+
text="We will only use this email to respond to your query." {/* The hint text */}
136+
dark = { true } {/* The dark variation of the component */}
137+
alt={ false } {/* The alt variation of the component */}
138+
/>
139+
140+
<AUerrorText
141+
text="Enter an email in the valid format." {/* The error text */}
142+
dark={ true } {/* The dark variation of the component */}
143+
inline={ true } {/* Display the error text inline*/}
144+
/>
145+
146+
<AUformGroup
147+
status="invalid" {/* Adds invalid state to form group */}
148+
dark = { true } {/* The dark variation of the component */}
149+
/>
150+
151+
<AUfieldset
152+
dark = { true } {/* The dark variation of the component */}
153+
/>
154+
```

0 commit comments

Comments
 (0)