Skip to content

Commit

Permalink
add example for names pattern (#2972)
Browse files Browse the repository at this point in the history
* add example and update visual tests

* add example and update visual tests

* remove page config from example and update visual tests

* Update src/patterns/names/example-name-multiple-input-field.njk

Co-authored-by: rmccar <[email protected]>

* Update src/patterns/names/example-name-multiple-input-field.njk

Co-authored-by: rmccar <[email protected]>

* Update src/patterns/names/example-name-single-input-field.njk

Co-authored-by: rmccar <[email protected]>

* Update src/patterns/names/example-name-single-input-field.njk

Co-authored-by: rmccar <[email protected]>

---------

Co-authored-by: rmccar <[email protected]>
  • Loading branch information
precious-onyenaucheya-ons and rmccar authored Dec 7, 2023
1 parent a96779c commit 053db27
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 6 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions src/patterns/names/example-name-multiple-input-field.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{% from "components/input/_macro.njk" import onsInput %}
{% from "components/question/_macro.njk" import onsQuestion %}

{% block main %}
{% call onsQuestion({
"title": "What is your name?",
"legendIsQuestionTitle": true,
"submitButton": true
}) %}
<form action="#0">
{{
onsInput({
"id": "first-name",
"name": "first-name",
"label": {
"text": "First name"
}
})
}}
{{
onsInput({
"id": "middle-names",
"type": "middle-names",
"label": {
"text": "Middle names"
}
})
}}
{{
onsInput({
"id": "last-name",
"name": "last-name",
"label": {
"text": "Last name"
}
})
}}
</form>
{% endcall %}
{% endblock %}
23 changes: 23 additions & 0 deletions src/patterns/names/example-name-single-input-field.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% from "components/input/_macro.njk" import onsInput %}
{% from "components/question/_macro.njk" import onsQuestion %}

{% block main %}
{% call onsQuestion({
"title": "What is your name?",
"legendIsQuestionTitle": true,
"submitButton": true
}) %}
<form action="#0">
{{
onsInput({
"id": "fullname-example-input",
"type": "full-name",
"autocomplete": "full-name",
"label": {
"text": "Full name"
}
})
}}
</form>
{% endcall %}
{% endblock %}

0 comments on commit 053db27

Please sign in to comment.