-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add variant for radios with a textarea (#3148)
* add variant for radios * update macro.md file * fix formatting * Update src/components/radios/_macro.njk Co-authored-by: rmccar <[email protected]> --------- Co-authored-by: rmccar <[email protected]> Co-authored-by: Alessio Venturini <[email protected]>
- Loading branch information
1 parent
955a74a
commit 4f0ae95
Showing
10 changed files
with
220 additions
and
10 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...radios_example-radios-with-revealed-text-area-expanded_0_document_0_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
..._radios_example-radios-with-revealed-text-area-expanded_0_document_1_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
..._radios_example-radios-with-revealed-text-area-expanded_0_document_2_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...mponents_radios_example-radios-with-revealed-text-area_0_document_0_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...omponents_radios_example-radios-with-revealed-text-area_0_document_1_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...omponents_radios_example-radios-with-revealed-text-area_0_document_2_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
87 changes: 87 additions & 0 deletions
87
src/components/radios/example-radios-with-revealed-text-area-expanded.njk
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,87 @@ | ||
{% from "components/radios/_macro.njk" import onsRadios %} | ||
{% from "components/question/_macro.njk" import onsQuestion %} | ||
|
||
{% call onsQuestion({ | ||
"title": "How do you usually travel to work?", | ||
"classes": "ons-u-mt-no", | ||
"legendIsQuestionTitle": true | ||
}) %} | ||
{{ | ||
onsRadios({ | ||
"dontWrap": true, | ||
"name": "travel", | ||
"radios": [ | ||
{ | ||
"id": "home-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Work mainly from home" | ||
}, | ||
"value": "home" | ||
}, | ||
{ | ||
"id": "car-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Car or van" | ||
}, | ||
"value": "car" | ||
}, | ||
{ | ||
"id": "underground-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Underground, metro, light rail or tram" | ||
}, | ||
"value": "underground" | ||
}, | ||
{ | ||
"id": "train-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Train" | ||
}, | ||
"value": "train" | ||
}, | ||
{ | ||
"id": "bus-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Bus, minibus or coach" | ||
}, | ||
"value": "bus" | ||
}, | ||
{ | ||
"id": "bicycle-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Bicycle" | ||
}, | ||
"value": "bicycle" | ||
}, | ||
{ | ||
"id": "walk-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Walk" | ||
}, | ||
"value": "walk" | ||
}, | ||
{ | ||
"id": "other-radio-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Other" | ||
}, | ||
"value": "other", | ||
"checked": true, | ||
"other": { | ||
"otherType": "textarea", | ||
"id": "other-textbox-example-radio-with-revealed-text-input", | ||
"name": "other-answer", | ||
"label": { | ||
"text": "Enter how you travel" | ||
}, | ||
"charCheckLimit": { | ||
"limit": 200, | ||
"charCountSingular": "You have {x} character remaining", | ||
"charCountPlural": "You have {x} characters remaining" | ||
} | ||
} | ||
} | ||
] | ||
}) | ||
}} | ||
{% endcall %} |
86 changes: 86 additions & 0 deletions
86
src/components/radios/example-radios-with-revealed-text-area.njk
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,86 @@ | ||
{% from "components/radios/_macro.njk" import onsRadios %} | ||
{% from "components/question/_macro.njk" import onsQuestion %} | ||
|
||
{% call onsQuestion({ | ||
"title": "How do you usually travel to work?", | ||
"classes": "ons-u-mt-no", | ||
"legendIsQuestionTitle": true | ||
}) %} | ||
{{ | ||
onsRadios({ | ||
"dontWrap": true, | ||
"name": "travel", | ||
"radios": [ | ||
{ | ||
"id": "home-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Work mainly from home" | ||
}, | ||
"value": "home" | ||
}, | ||
{ | ||
"id": "car-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Car or van" | ||
}, | ||
"value": "car" | ||
}, | ||
{ | ||
"id": "underground-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Underground, metro, light rail or tram" | ||
}, | ||
"value": "underground" | ||
}, | ||
{ | ||
"id": "train-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Train" | ||
}, | ||
"value": "train" | ||
}, | ||
{ | ||
"id": "bus-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Bus, minibus or coach" | ||
}, | ||
"value": "bus" | ||
}, | ||
{ | ||
"id": "bicycle-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Bicycle" | ||
}, | ||
"value": "bicycle" | ||
}, | ||
{ | ||
"id": "walk-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Walk" | ||
}, | ||
"value": "walk" | ||
}, | ||
{ | ||
"id": "other-radio-example-radio-with-revealed-text-input", | ||
"label": { | ||
"text": "Other" | ||
}, | ||
"value": "other", | ||
"other": { | ||
"otherType": "textarea", | ||
"id": "other-textbox-example-radio-with-revealed-text-input", | ||
"name": "other-answer", | ||
"label": { | ||
"text": "Enter how you travel" | ||
}, | ||
"charCheckLimit": { | ||
"limit": 200, | ||
"charCountSingular": "You have {x} character remaining", | ||
"charCountPlural": "You have {x} characters remaining" | ||
} | ||
} | ||
} | ||
] | ||
}) | ||
}} | ||
{% endcall %} |