-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #718 from WestpacGEL/kate-changes
Kate changes
- Loading branch information
Showing
21 changed files
with
235 additions
and
22 deletions.
There are no files selected for viewing
5 changes: 2 additions & 3 deletions
5
apps/site/src/content/design-system/components/autocomplete/design/autocomplete/content.mdoc
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
22 changes: 22 additions & 0 deletions
22
apps/site/src/content/design-system/components/autocomplete/design/error-state/content.mdoc
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,22 @@ | ||
All form elements have associated error states, see [Error messages](/content/guidelines/error-message) in our content guidelines for more. | ||
|
||
```jsx | ||
<Autocomplete width="30" | ||
errorMessage="If there is an error it can go here" | ||
hintMessage="Search for the appropriate colour" | ||
label="What colour is the sky?" | ||
noOptionsMessage="No options" | ||
validationState="invalid" | ||
size="large" | ||
> | ||
<AutocompleteItem> | ||
Green | ||
</AutocompleteItem> | ||
<AutocompleteItem> | ||
Purple | ||
</AutocompleteItem> | ||
<AutocompleteItem> | ||
Blue | ||
</AutocompleteItem> | ||
</Autocomplete> | ||
``` |
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
16 changes: 3 additions & 13 deletions
16
apps/site/src/content/design-system/components/input-group/design/labels/content.mdoc
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 |
---|---|---|
@@ -1,17 +1,7 @@ | ||
Use the input group component to accessibly define the labels used with [Inputs,](/components/inputs) [Selects](/components/selects) and [Text areas](/components/textareas). All inputs require labels for usability and accessibility. | ||
Use the input group component to accessibly define the labels used with [Inputs,](/components/inputs) and [Text areas](/components/textarea). All inputs require labels for usability and accessibility. | ||
|
||
```jsx | ||
<FormGroup > | ||
<FormLabel htmlFor="formInput">Label</FormLabel> | ||
<FormHint>Hint text</FormHint> | ||
<Input aria-describedby="formHint" width="20" id="formInput" name="test" /> | ||
</FormGroup> | ||
``` | ||
|
||
testing 1 - using InputGroup - not FormGroup | ||
|
||
```jsx | ||
<InputGroup label="Label" hint="Hint text" errorMessage="If there is an error it can go here"> | ||
<Input invalid /> | ||
<InputGroup width={20} label="Label" hint="Hint text" > | ||
<Input /> | ||
</InputGroup> | ||
``` |
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
10 changes: 9 additions & 1 deletion
10
...site/src/content/design-system/components/input-group/design/user-experience/content.mdoc
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 |
---|---|---|
@@ -1 +1,9 @@ | ||
Input groups are a great addition to fields in forms and calculators, they give immediate affordance informing the user what is required of them. Use input groups when there’s an association between one attribute and another, as they add a clear affordance for what type of data is required to be entered in the field, e.g. $ or %. You can also use an input group add-on at either end of a field related to a question eg an amount or time frame. For example, a numerical value and a time value ($2200 / month), or a currency and numerical value (AUD / $2200). | ||
### Add-ons | ||
|
||
Add-ons are a great addition to fields in forms and calculators, they provide instant cues that inform users about what is expected of them. Use text add-ons when there’s an association between one attribute and another, as they add a clear affordance for what type of data is required to be entered in the field, e.g. $ or %. | ||
|
||
You can also use a select add-on at either end of a field to combine two related questions e.g., an amount and a time frame ($2200 / month), or a currency type and a value (AUD / $2200). | ||
|
||
### Supporting text | ||
|
||
The most common usage of Supporting text is to display a character count for a field entry, this can be very useful to help manage users expectations around how much space is available for their message. It provides visual clarity and for users who may have cognitive or visual impairments, a character count can serve as an accessibility aid, helping them understand the input constraints more easily. |
2 changes: 1 addition & 1 deletion
2
apps/site/src/content/design-system/components/input-group/design/visual-design/content.mdoc
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 |
---|---|---|
@@ -1 +1 @@ | ||
As with most components in the GUI Input groups are designed to be simple, unobtrusive and accessible. Input addon elements can be positioned at either end of input fields. | ||
As with most components in the Design system Input groups are designed to be simple, unobtrusive and accessible. |
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
7 changes: 7 additions & 0 deletions
7
apps/site/src/content/design-system/components/input/design/error-state/content.mdoc
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,7 @@ | ||
All form elements have associated error states, see [Error messages](/content/guidelines/error-message) in our content guidelines for more. | ||
|
||
```jsx | ||
<InputGroup width={20} label="Label" hint="Hint text" errorMessage="If there is an error it can go here"> | ||
<Input invalid /> | ||
</InputGroup> | ||
``` |
7 changes: 7 additions & 0 deletions
7
apps/site/src/content/design-system/components/input/design/inputs-with-labels/content.mdoc
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,7 @@ | ||
Use the [Input group](/components/input-group) component to accessibly define the labels used with Inputs, and [Text areas](/components/textareas). All inputs require labels for usability and accessibility. | ||
|
||
```jsx | ||
<InputGroup width={20} label="Label" hint="Hint text" > | ||
<Input /> | ||
</InputGroup> | ||
``` |
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
apps/site/src/content/design-system/components/select/design/error-state/content.mdoc
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 @@ | ||
All form elements have associated error states, see [Error messages](/content/guidelines/error-message) in our content guidelines for more. | ||
|
||
```tsx | ||
<Field label="Select an option" hintMessage="This is a select with labels" errorMessage="If there is an error it can go here"> | ||
<Select invalid> | ||
<option value="option-1">Option 1</option> | ||
<option value="option-2">Option 2</option> | ||
<option value="option-3">Option 3</option> | ||
<option value="option-4">Option 4</option> | ||
</Select> | ||
</Field> | ||
``` |
12 changes: 12 additions & 0 deletions
12
apps/site/src/content/design-system/components/select/design/select-with-labels/content.mdoc
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 @@ | ||
All inputs require labels for usability and accessibility. | ||
|
||
```tsx | ||
<Field label="Select an option" hintMessage="This is a select with labels"> | ||
<Select > | ||
<option value="option-1">Option 1</option> | ||
<option value="option-2">Option 2</option> | ||
<option value="option-3">Option 3</option> | ||
<option value="option-4">Option 4</option> | ||
</Select> | ||
</Field> | ||
``` |
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
22 changes: 22 additions & 0 deletions
22
apps/site/src/content/design-system/components/selector/design/error-state/content.mdoc
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,22 @@ | ||
All form elements have associated error states, see [Error messages](/content/guidelines/error-message) in our content guidelines for more. | ||
|
||
```tsx | ||
<Grid> | ||
<GridItem span={{ initial: 12, sm: 6 }}> | ||
<Selector label="Select an option" description="This is a select with labels" errorMessage="testing the error" type="radio" validationState="invalid"> | ||
<SelectorRadio key="1" value="1"> | ||
<SelectorLabel>Option 1</SelectorLabel> | ||
<SelectorHint className="max-sm:typography-body-10 sm:typography-body-9">This selector has the same fucntionality as radios</SelectorHint> | ||
</Selector.Radio> | ||
<SelectorRadio key="2" value="2"> | ||
<SelectorLabel>Option 2</SelectorLabel> | ||
<SelectorHint className="max-sm:typography-body-10 sm:typography-body-9">This selector has the same fucntionality as radios</SelectorHint> | ||
</Selector.Radio> | ||
<SelectorRadio key="3" value="3"> | ||
<SelectorLabel>Option 3</SelectorLabel> | ||
<SelectorHint className="max-sm:typography-body-10 sm:typography-body-9">This selector has the same fucntionality as radios</SelectorHint> | ||
</Selector.Radio> | ||
</Selector> | ||
</GridItem> | ||
</Grid> | ||
``` |
22 changes: 22 additions & 0 deletions
22
...te/src/content/design-system/components/selector/design/selector-with-labels/content.mdoc
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,22 @@ | ||
Although it does not appear as a typical form input, the Selector component requires labels as all inputs do for usability and accessibility. | ||
|
||
```tsx | ||
<Grid> | ||
<GridItem span={{ initial: 12, sm: 6 }}> | ||
<Selector label="Select an option" description="This is a select with labels" type="radio" > | ||
<SelectorRadio key="1" value="1"> | ||
<SelectorLabel>Option 1</SelectorLabel> | ||
<SelectorHint className="max-sm:typography-body-10 sm:typography-body-9">This selector has the same fucntionality as radios</SelectorHint> | ||
</Selector.Radio> | ||
<SelectorRadio key="2" value="2"> | ||
<SelectorLabel>Option 2</SelectorLabel> | ||
<SelectorHint className="max-sm:typography-body-10 sm:typography-body-9">This selector has the same fucntionality as radios</SelectorHint> | ||
</Selector.Radio> | ||
<SelectorRadio key="3" value="3"> | ||
<SelectorLabel>Option 3</SelectorLabel> | ||
<SelectorHint className="max-sm:typography-body-10 sm:typography-body-9">This selector has the same fucntionality as radios</SelectorHint> | ||
</Selector.Radio> | ||
</Selector> | ||
</GridItem> | ||
</Grid> | ||
``` |
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
7 changes: 7 additions & 0 deletions
7
apps/site/src/content/design-system/components/textarea/design/error-state/content.mdoc
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,7 @@ | ||
All form elements have associated error states, see [Error messages](/content/guidelines/error-message) in our content guidelines for more. | ||
|
||
```jsx | ||
<InputGroup label="Label" hint="Hint text" errorMessage="If there is an error it can go here"> | ||
<Textarea invalid /> | ||
</InputGroup> | ||
``` |
7 changes: 7 additions & 0 deletions
7
...e/src/content/design-system/components/textarea/design/text-area-with-labels/content.mdoc
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,7 @@ | ||
Use the [Input group](/components/input-group) component to accessibly define the labels used with Text areas and [Inputs](/components/input). All inputs require labels for usability and accessibility. | ||
|
||
```jsx | ||
<InputGroup label="Label" hint="Hint text" > | ||
<Textarea /> | ||
</InputGroup> | ||
``` |
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