@nationalarchives/frontend 0.34.1 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/govuk-prototype-kit.config.json +4 -4
- package/nationalarchives/components/accordion/macro-options.json +2 -1
- package/nationalarchives/components/button/macro-options.json +14 -7
- package/nationalarchives/components/card/macro-options.json +20 -10
- package/nationalarchives/components/checkboxes/macro-options.json +6 -3
- package/nationalarchives/components/checkboxes/template.njk +2 -2
- package/nationalarchives/components/cookie-banner/template.njk +1 -1
- package/nationalarchives/components/date-input/macro-options.json +2 -1
- package/nationalarchives/components/date-input/template.njk +4 -4
- package/nationalarchives/components/date-search/macro-options.json +2 -1
- package/nationalarchives/components/date-search/template.njk +1 -1
- package/nationalarchives/components/details/macro-options.json +2 -1
- package/nationalarchives/components/error-summary/macro-options.json +2 -1
- package/nationalarchives/components/fieldset/macro-options.json +2 -1
- package/nationalarchives/components/file-input/template.njk +1 -1
- package/nationalarchives/components/files-list/macro-options.json +2 -1
- package/nationalarchives/components/footer/macro-options.json +8 -4
- package/nationalarchives/components/footer/template.njk +2 -2
- package/nationalarchives/components/gallery/macro-options.json +2 -1
- package/nationalarchives/components/gallery/template.njk +1 -1
- package/nationalarchives/components/global-header/macro-options.json +2 -1
- package/nationalarchives/components/global-header/template.njk +2 -2
- package/nationalarchives/components/header/macro-options.json +4 -2
- package/nationalarchives/components/header/template.njk +2 -2
- package/nationalarchives/components/hero/macro-options.json +4 -2
- package/nationalarchives/components/hero/template.njk +1 -1
- package/nationalarchives/components/index-grid/macro-options.json +2 -1
- package/nationalarchives/components/pagination/macro-options.json +4 -2
- package/nationalarchives/components/pagination/template.njk +1 -1
- package/nationalarchives/components/picture/template.njk +1 -1
- package/nationalarchives/components/quick-filters/macro-options.json +4 -2
- package/nationalarchives/components/radios/macro-options.json +4 -2
- package/nationalarchives/components/radios/template.njk +1 -1
- package/nationalarchives/components/search-field/template.njk +2 -2
- package/nationalarchives/components/secondary-navigation/macro-options.json +8 -4
- package/nationalarchives/components/select/template.njk +1 -1
- package/nationalarchives/components/sidebar/macro-options.json +4 -2
- package/nationalarchives/components/text-input/fixtures.json +14 -1
- package/nationalarchives/components/text-input/macro-options.json +16 -5
- package/nationalarchives/components/text-input/template.njk +2 -2
- package/nationalarchives/components/textarea/macro-options.json +5 -3
- package/nationalarchives/components/textarea/template.njk +1 -1
- package/nationalarchives/templates/fixtures.json +45 -68
- package/nationalarchives/templates/layouts/_generic.njk +18 -18
- package/nationalarchives/templates/{email.njk → layouts/email.njk} +3 -3
- package/nationalarchives/templates/partials/logo/macro.njk +3 -0
- package/nationalarchives/templates/partials/logo/template.njk +9 -0
- package/nationalarchives/templates/{layouts/_prototype-kit.njk → prototype-kit/_base.njk} +3 -3
- package/nationalarchives/templates/{error-page-not-found.njk → prototype-kit/error-page-not-found.njk} +2 -2
- package/nationalarchives/templates/{index-grid.njk → prototype-kit/index-grid.njk} +6 -6
- package/nationalarchives/templates/{list.njk → prototype-kit/list.njk} +5 -5
- package/nationalarchives/templates/{plain.njk → prototype-kit/plain.njk} +4 -4
- package/nationalarchives/utilities/grid/macro-options.json +8 -4
- package/package.json +1 -1
- package/nationalarchives/templates/partials/logo.njk +0 -11
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"name": "current",
|
|
41
41
|
"type": "boolean",
|
|
42
42
|
"required": false,
|
|
43
|
-
"description": "If `true`, highlight the item as the current page or section."
|
|
43
|
+
"description": "If `true`, highlight the item as the current page or section.",
|
|
44
|
+
"default": false
|
|
44
45
|
},
|
|
45
46
|
{
|
|
46
47
|
"name": "children",
|
|
@@ -74,7 +75,8 @@
|
|
|
74
75
|
"name": "sticky",
|
|
75
76
|
"type": "boolean",
|
|
76
77
|
"required": false,
|
|
77
|
-
"description": "If `true`, allows the sidebar to 'stick' to the top of the screen when scrolling."
|
|
78
|
+
"description": "If `true`, allows the sidebar to 'stick' to the top of the screen when scrolling.",
|
|
79
|
+
"default": false
|
|
78
80
|
},
|
|
79
81
|
{
|
|
80
82
|
"name": "classes",
|
|
@@ -67,7 +67,20 @@
|
|
|
67
67
|
"size": "m",
|
|
68
68
|
"password": true
|
|
69
69
|
},
|
|
70
|
-
"html": "<div class=\"tna-form-item\" data-module=\"tna-text-input\"><div class=\"tna-form-item__header\"><label class=\"tna-form-item__label tna-heading-m\" for=\"password\">Enter your password</label></div><div class=\"tna-form-item__body\"><input id=\"password\" class=\"tna-text-input tna-text-input--m\" name=\"password\" value=\"\" type=\"password\"
|
|
70
|
+
"html": "<div class=\"tna-form-item\" data-module=\"tna-text-input\"><div class=\"tna-form-item__header\"><label class=\"tna-form-item__label tna-heading-m\" for=\"password\">Enter your password</label></div><div class=\"tna-form-item__body\"><input id=\"password\" class=\"tna-text-input tna-text-input--m\" name=\"password\" value=\"\" type=\"password\" autocomplete=\"current-password\"></div></div>"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "new password",
|
|
74
|
+
"options": {
|
|
75
|
+
"label": "Enter a new password",
|
|
76
|
+
"headingSize": "m",
|
|
77
|
+
"id": "password",
|
|
78
|
+
"name": "password",
|
|
79
|
+
"size": "m",
|
|
80
|
+
"password": true,
|
|
81
|
+
"newPassword": true
|
|
82
|
+
},
|
|
83
|
+
"html": "<div class=\"tna-form-item\" data-module=\"tna-text-input\"><div class=\"tna-form-item__header\"><label class=\"tna-form-item__label tna-heading-m\" for=\"password\">Enter a new password</label></div><div class=\"tna-form-item__body\"><input id=\"password\" class=\"tna-text-input tna-text-input--m\" name=\"password\" value=\"\" type=\"password\" autocomplete=\"new-password\"></div></div>"
|
|
71
84
|
},
|
|
72
85
|
{
|
|
73
86
|
"name": "type",
|
|
@@ -67,7 +67,15 @@
|
|
|
67
67
|
"name": "password",
|
|
68
68
|
"type": "boolean",
|
|
69
69
|
"required": false,
|
|
70
|
-
"description": "If `true`, the text input will be a password field."
|
|
70
|
+
"description": "If `true`, the text input will be a password field.",
|
|
71
|
+
"default": false
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "newPassword",
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"required": false,
|
|
77
|
+
"description": "If `true`, the browser may try to autofill the password field with a new password. If left as `false`, the browser may try to autofill the password field with an existing password. Ignored when `password` is `false`.",
|
|
78
|
+
"default": false
|
|
71
79
|
},
|
|
72
80
|
{
|
|
73
81
|
"name": "inputmode",
|
|
@@ -79,26 +87,29 @@
|
|
|
79
87
|
"name": "spellcheck",
|
|
80
88
|
"type": "boolean",
|
|
81
89
|
"required": false,
|
|
82
|
-
"description": "If `true`, enable [spellcheck](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/spellcheck) for the text input.
|
|
90
|
+
"description": "If `true`, enable [spellcheck](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/spellcheck) for the text input. Ignored when `password` is `true`.",
|
|
91
|
+
"default": false
|
|
83
92
|
},
|
|
84
93
|
{
|
|
85
94
|
"name": "autocapitalize",
|
|
86
95
|
"type": "string",
|
|
87
96
|
"required": false,
|
|
88
|
-
"description": "If `true`, enable [automatic capitalization](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autocapitalize) for the text input.
|
|
97
|
+
"description": "If `true`, enable [automatic capitalization](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autocapitalize) for the text input. Ignored when `password` is `true`. This is not supported in all browsers.",
|
|
89
98
|
"default": "off"
|
|
90
99
|
},
|
|
91
100
|
{
|
|
92
101
|
"name": "autocorrect",
|
|
93
102
|
"type": "boolean",
|
|
94
103
|
"required": false,
|
|
95
|
-
"description": "If `true`, enable [autocorrect](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autocorrect) for the text input.
|
|
104
|
+
"description": "If `true`, enable [autocorrect](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autocorrect) for the text input. Ignored when `password` is `true`. This is not supported in all browsers.",
|
|
105
|
+
"default": false
|
|
96
106
|
},
|
|
97
107
|
{
|
|
98
108
|
"name": "autocomplete",
|
|
99
109
|
"type": "string",
|
|
100
110
|
"required": false,
|
|
101
|
-
"description": "Set the [`autocomplete` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete) to control browser autofill behaviour.
|
|
111
|
+
"description": "Set the [`autocomplete` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete) to control browser autofill behaviour. Ignored when `password` is `true`.",
|
|
112
|
+
"default": false
|
|
102
113
|
},
|
|
103
114
|
{
|
|
104
115
|
"name": "size",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
1
|
+
{%- from "nationalarchives/utilities/forms/form-item.njk" import tnaFormItem -%}
|
|
2
2
|
|
|
3
3
|
{%- call tnaFormItem({
|
|
4
4
|
headingLevel: params.headingLevel,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
}, 'tna-text-input') %}
|
|
13
13
|
<input id="{{ params.id }}" class="tna-text-input{% if params.size %} tna-text-input--{{ params.size }}{% endif %}{% if params.classes %} {{ params.classes }}{% endif %}" name="{{ params.name }}" value="{{ params.value }}"
|
|
14
14
|
{%- if params.hint or params.error %} aria-describedby="{%- if params.hint -%}{{ params.id }}-hint{%- endif %} {% if params.error -%}{{ params.id }}-error{%- endif -%}"{%- endif %}
|
|
15
|
-
{%- if params.password %} type="password"
|
|
15
|
+
{%- if params.password %} type="password" autocomplete="{{ 'new-password' if params.newPassword else 'current-password' }}"
|
|
16
16
|
{%- else %} type="{{ params.type if params.type else 'text' }}" spellcheck="{{ params.spellcheck if params.spellcheck else false }}" autocapitalize="{{ params.autocapitalize if params.autocapitalize else 'off' }}" autocorrect="{{ 'on' if params.autocorrect else 'off' }}"
|
|
17
17
|
{%- if params.autocomplete %} autocomplete="{{ params.autocomplete }}"{% endif %}
|
|
18
18
|
{%- endif %}
|
|
@@ -60,20 +60,22 @@
|
|
|
60
60
|
"name": "spellcheck",
|
|
61
61
|
"type": "boolean",
|
|
62
62
|
"required": false,
|
|
63
|
-
"description": "If `true`, enable [spellcheck](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/spellcheck) for the text input.
|
|
63
|
+
"description": "If `true`, enable [spellcheck](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/spellcheck) for the text input.",
|
|
64
|
+
"default": false
|
|
64
65
|
},
|
|
65
66
|
{
|
|
66
67
|
"name": "autocapitalize",
|
|
67
68
|
"type": "string",
|
|
68
69
|
"required": false,
|
|
69
|
-
"description": "If `true`, enable [automatic capitalization](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autocapitalize) for the text input.
|
|
70
|
+
"description": "If `true`, enable [automatic capitalization](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autocapitalize) for the text input. This is not supported in all browsers.",
|
|
70
71
|
"default": "off"
|
|
71
72
|
},
|
|
72
73
|
{
|
|
73
74
|
"name": "autocorrect",
|
|
74
75
|
"type": "boolean",
|
|
75
76
|
"required": false,
|
|
76
|
-
"description": "If `true`, enable [autocorrect](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autocorrect) for the text input.
|
|
77
|
+
"description": "If `true`, enable [autocorrect](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autocorrect) for the text input. This is not supported in all browsers.",
|
|
78
|
+
"default": false
|
|
77
79
|
},
|
|
78
80
|
{
|
|
79
81
|
"name": "size",
|