@ilo-org/twig 0.9.5 → 0.10.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/.turbo/turbo-build:lib.log +2 -2
- package/CHANGELOG.md +14 -0
- package/package.json +3 -3
- package/src/patterns/components/accordion/accordion.wingsuit.yml +1 -0
- package/src/patterns/components/breadcrumb/breadcrumb.wingsuit.yml +1 -0
- package/src/patterns/components/button/button.wingsuit.yml +1 -0
- package/src/patterns/components/callout/callout.wingsuit.yml +1 -0
- package/src/patterns/components/card/card.wingsuit.yml +14 -13
- package/src/patterns/components/card_data/card_data.wingsuit.yml +3 -7
- package/src/patterns/components/card_detail/card_detail.wingsuit.yml +1 -3
- package/src/patterns/components/card_factlist/card_factlist.wingsuit.yml +1 -4
- package/src/patterns/components/card_feature/card_feature.wingsuit.yml +1 -3
- package/src/patterns/components/card_multilink/card_multilink.wingsuit.yml +7 -9
- package/src/patterns/components/card_promo/card_promo.wingsuit.yml +1 -3
- package/src/patterns/components/card_stat/card_stat.wingsuit.yml +1 -5
- package/src/patterns/components/card_text/card_text.wingsuit.yml +4 -6
- package/src/patterns/components/cardgroup/cardgroup.wingsuit.yml +1 -4
- package/src/patterns/components/{searchfield/searchfield.stories.jsx → checkbox/checkbox.stories.jsx} +1 -1
- package/src/patterns/components/checkbox/checkbox.twig +17 -0
- package/src/patterns/components/checkbox/checkbox.wingsuit.yml +83 -0
- package/src/patterns/components/checkbox/index.js +7 -0
- package/src/patterns/components/contextmenu/contextmenu.wingsuit.yml +1 -0
- package/src/patterns/components/datepicker/datepicker.stories.jsx +9 -0
- package/src/patterns/components/datepicker/datepicker.twig +20 -0
- package/src/patterns/components/datepicker/datepicker.wingsuit.yml +71 -0
- package/src/patterns/components/datepicker/index.js +7 -0
- package/src/patterns/components/dropdown/dropdown.twig +16 -16
- package/src/patterns/components/dropdown/dropdown.wingsuit.yml +80 -58
- package/src/patterns/components/footer/footer.wingsuit.yml +1 -0
- package/src/patterns/components/form/fieldset.twig +62 -0
- package/src/patterns/components/form/form.twig +18 -96
- package/src/patterns/components/form/form.wingsuit.yml +138 -967
- package/src/patterns/components/form/formcontrol.twig +84 -0
- package/src/patterns/components/form/input.twig +9 -12
- package/src/patterns/components/hero/hero.wingsuit.yml +40 -40
- package/src/patterns/components/herocard/herocard.wingsuit.yml +1 -0
- package/src/patterns/components/image/image.wingsuit.yml +1 -0
- package/src/patterns/components/link/link.wingsuit.yml +1 -0
- package/src/patterns/components/linklist/linklist.wingsuit.yml +1 -0
- package/src/patterns/components/list/list-item.wingsuit.yml +1 -0
- package/src/patterns/components/list/list.wingsuit.yml +1 -0
- package/src/patterns/components/loading/loading.wingsuit.yml +1 -0
- package/src/patterns/components/localnav/localnav.wingsuit.yml +1 -0
- package/src/patterns/components/logogrid/logogrid.wingsuit.yml +1 -2
- package/src/patterns/components/modal/modal.wingsuit.yml +1 -0
- package/src/patterns/components/navigation/navigation.twig +145 -108
- package/src/patterns/components/notification/notification.wingsuit.yml +1 -0
- package/src/patterns/components/pagination/pagination.wingsuit.yml +1 -0
- package/src/patterns/components/profile/profile.wingsuit.yml +1 -0
- package/src/patterns/components/readmore/readmore.wingsuit.yml +1 -0
- package/src/patterns/components/richtext/richtext.wingsuit.yml +1 -0
- package/src/patterns/components/search/index.js +6 -0
- package/src/patterns/components/search/search.stories.jsx +10 -0
- package/src/patterns/components/search/search.twig +22 -0
- package/src/patterns/components/search/search.wingsuit.yml +89 -0
- package/src/patterns/components/socialmedia/socialmedia.wingsuit.yml +1 -0
- package/src/patterns/components/table/table.wingsuit.yml +1 -0
- package/src/patterns/components/tableofcontents/tableofcontents.wingsuit.yml +1 -0
- package/src/patterns/components/tabs/tabs.wingsuit.yml +1 -0
- package/src/patterns/components/tags/tags.wingsuit.yml +1 -0
- package/src/patterns/components/textinput/index.js +7 -0
- package/src/patterns/components/textinput/textinput.stories.jsx +10 -0
- package/src/patterns/components/textinput/textinput.twig +13 -0
- package/src/patterns/components/textinput/textinput.wingsuit.yml +87 -0
- package/src/patterns/components/tooltip/tooltip.twig +9 -11
- package/src/patterns/components/tooltip/tooltip.wingsuit.yml +7 -0
- package/src/patterns/components/video/video.wingsuit.yml +1 -0
- package/contributing.md +0 -5
- package/src/patterns/components/fieldset/fieldset.twig +0 -44
- package/src/patterns/components/form/checkbox.twig +0 -13
- package/src/patterns/components/form/checkboxgroup.twig +0 -5
- package/src/patterns/components/form/datepicker.twig +0 -41
- package/src/patterns/components/searchfield/index.js +0 -6
- package/src/patterns/components/searchfield/searchfield.twig +0 -7
- package/src/patterns/components/searchfield/searchfield.wingsuit.yml +0 -22
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{# formcontrol.twig #}
|
|
2
|
+
|
|
3
|
+
{% set baseClass = prefix ~ "--form-control" %}
|
|
4
|
+
|
|
5
|
+
{# Initialize ariaDescribedBy #}
|
|
6
|
+
{% set ariaDescribedBy = [] %}
|
|
7
|
+
|
|
8
|
+
{# if not defined id will be set to the value of name or to a random number #}
|
|
9
|
+
{% if not id %}
|
|
10
|
+
{% if name %}
|
|
11
|
+
{% set id = name %}
|
|
12
|
+
{% else %}
|
|
13
|
+
{% set id = baseClass ~ "--field--" ~ random() %}
|
|
14
|
+
{% set name = id %}
|
|
15
|
+
{% endif %}
|
|
16
|
+
{% endif %}
|
|
17
|
+
|
|
18
|
+
{# Determine which accessibility ids we're going to need #}
|
|
19
|
+
{% if tooltip %}
|
|
20
|
+
{% set tooltipId = baseClass ~ "--tooltip--" ~ random() %}
|
|
21
|
+
{% set ariaDescribedBy = ariaDescribedBy|merge([tooltipId]) %}
|
|
22
|
+
{% endif %}
|
|
23
|
+
|
|
24
|
+
{% if helper %}
|
|
25
|
+
{% set helperId = baseClass ~ "--helper--" ~ random() %}
|
|
26
|
+
{% set ariaDescribedBy = ariaDescribedBy|merge([helperId]) %}
|
|
27
|
+
{% endif %}
|
|
28
|
+
|
|
29
|
+
{% if error %}
|
|
30
|
+
{% set errorId = baseClass ~ "--error--" ~ random() %}
|
|
31
|
+
{% set ariaDescribedBy = ariaDescribedBy|merge([errorId]) %}
|
|
32
|
+
{% endif %}
|
|
33
|
+
|
|
34
|
+
{# Condense them into a single string #}
|
|
35
|
+
{% set ariaDescribedBy = ariaDescribedBy|join(' ') %}
|
|
36
|
+
|
|
37
|
+
{# Classes for different form element states #}
|
|
38
|
+
{% set errorClass = baseClass ~ "__error" %}
|
|
39
|
+
{% set disabledClass = baseClass ~ "__disabled" %}
|
|
40
|
+
{% set labelPlacementClass = baseClass ~ "__label-placement__" ~ labelPlacement|default("start") %}
|
|
41
|
+
{% set formControlClass = [baseClass, class, labelPlacementClass] %}
|
|
42
|
+
|
|
43
|
+
{% if error %}
|
|
44
|
+
{% set formControlClass = formControlClass|merge([errorClass]) %}
|
|
45
|
+
{% endif %}
|
|
46
|
+
|
|
47
|
+
{% if disabled %}
|
|
48
|
+
{% set formControlClass = formControlClass|merge([disabledClass]) %}
|
|
49
|
+
{% endif %}
|
|
50
|
+
|
|
51
|
+
{% set labelBaseClass = baseClass ~ "--label" %}
|
|
52
|
+
{% set labelSizeClass = labelBaseClass ~ "__size__" ~ labelSize|default("medium") %}
|
|
53
|
+
{% set labelClass = [labelBaseClass, labelSizeClass] %}
|
|
54
|
+
{% set helperClass = baseClass ~ "--helper" %}
|
|
55
|
+
|
|
56
|
+
{% set showError = error and errorMessage %}
|
|
57
|
+
{% set showHelper = not showError and helper %}
|
|
58
|
+
|
|
59
|
+
<div class="{{ formControlClass|join(' ') }}" {% if style %} style="{{ style }}" {% endif %}>
|
|
60
|
+
{% if label %}
|
|
61
|
+
<span class="{{ labelClass|join(' ') }}">
|
|
62
|
+
<label for="{{ id }}">{{ label }}</label>
|
|
63
|
+
{% if tooltip %}
|
|
64
|
+
{% include '@components/tooltip/tooltip.twig' with {
|
|
65
|
+
"icon": true,
|
|
66
|
+
"label": tooltip,
|
|
67
|
+
"theme": "dark",
|
|
68
|
+
"prefix": prefix,
|
|
69
|
+
"tooltipId": tooltipId
|
|
70
|
+
} only %}
|
|
71
|
+
{% endif %}
|
|
72
|
+
</span>
|
|
73
|
+
{% endif %}
|
|
74
|
+
|
|
75
|
+
{# Child content goes here. In the context of Twig #}
|
|
76
|
+
{{ block('formfield') }}
|
|
77
|
+
|
|
78
|
+
{% if showHelper %}
|
|
79
|
+
<span id="{{ helperid }}" class="{{ helperClass }}">{{ helper }}</span>
|
|
80
|
+
{% endif %}
|
|
81
|
+
{% if showError %}
|
|
82
|
+
<span id="{{ errorid }}" class="{{ helperClass }}" aria-live="assertive">{{ errorMessage }}</span>
|
|
83
|
+
{% endif %}
|
|
84
|
+
</div>
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
{#
|
|
2
|
-
|
|
3
|
-
#}
|
|
4
|
-
{% extends '@components/fieldset/fieldset.twig' %}
|
|
5
|
-
{% set fsinputid = id ? id : name %}
|
|
6
|
-
{% set fslabel = label %}
|
|
7
|
-
{% set fshelper = helper %}
|
|
8
|
-
{% set fserror = error %}
|
|
9
|
-
{% set fstype = type %}
|
|
1
|
+
{# text-input.twig #}
|
|
2
|
+
{% extends "@components/form/formcontrol.twig" %}
|
|
10
3
|
|
|
11
|
-
{%
|
|
12
|
-
|
|
13
|
-
{%
|
|
4
|
+
{% set baseClass = prefix ~ "--text-input" %}
|
|
5
|
+
{% set inputClass = [baseClass] %}
|
|
6
|
+
{% if error %}
|
|
7
|
+
{% set inputClass = inputClass|merge([baseClass ~ "__error"]) %}
|
|
8
|
+
{% endif %}
|
|
9
|
+
|
|
10
|
+
<input id="{{ id ? id : name }}" name="{{ name }}" {% if disabled %} disabled {% endif %} placeholder="{{ placeholder }}" {% if required %} required {% endif %} type="{{ type }}" class="{{ inputClass|join(' ') }}" {% if pattern %} pattern="{{ pattern }}" {% endif %} {% if ariaDescribedBy %} aria-describedby="{{ ariaDescribedBy }}" {% endif %}/>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
hero:
|
|
2
2
|
use: "@components/hero/hero.twig"
|
|
3
|
+
namespace: Components/Content
|
|
3
4
|
label: Hero
|
|
4
5
|
description: The Hero is an attention-grabbing section of a web page designed to engage users and create a memorable first impression.
|
|
5
6
|
fields:
|
|
@@ -64,45 +65,45 @@ hero:
|
|
|
64
65
|
icon: "true"
|
|
65
66
|
theme: "dark"
|
|
66
67
|
settings:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
68
|
+
justify:
|
|
69
|
+
label: Justify
|
|
70
|
+
description: Sets the horizontal alignment of the hero card. `start` is on the left in LTR layouts and on the right in RTL layouts.
|
|
71
|
+
type: select
|
|
72
|
+
options:
|
|
73
|
+
start: start
|
|
74
|
+
offset: offset
|
|
75
|
+
center: center
|
|
76
|
+
preview: "start"
|
|
77
|
+
align:
|
|
78
|
+
label: Align
|
|
79
|
+
description: Sets the vertical alignment of the hero card.
|
|
80
|
+
type: select
|
|
81
|
+
options:
|
|
82
|
+
baseline: baseline
|
|
83
|
+
center: center
|
|
84
|
+
bottom: bottom
|
|
85
|
+
preview: "baseline"
|
|
86
|
+
postersize:
|
|
87
|
+
label: Poster Size
|
|
88
|
+
description: Sets the size of the image poster.
|
|
89
|
+
type: select
|
|
90
|
+
options:
|
|
91
|
+
small: small
|
|
92
|
+
medium: medium
|
|
93
|
+
large: large
|
|
94
|
+
xlarge: xlarge
|
|
95
|
+
preview: large
|
|
96
|
+
cardsize:
|
|
97
|
+
label: Card Size
|
|
98
|
+
description: Sets the width of the hero card.
|
|
99
|
+
type: select
|
|
100
|
+
options:
|
|
101
|
+
small: small
|
|
102
|
+
medium: medium
|
|
103
|
+
large: large
|
|
104
|
+
xlarge: xlarge
|
|
105
|
+
xxlarge: xxlarge
|
|
106
|
+
preview: small
|
|
106
107
|
variants:
|
|
107
108
|
default:
|
|
108
109
|
label: Default
|
|
@@ -155,4 +156,3 @@ hero:
|
|
|
155
156
|
icon: "true"
|
|
156
157
|
theme: "dark"
|
|
157
158
|
visibility: storybook
|
|
158
|
-
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
logogrid:
|
|
2
|
+
namespace: Components/Brand
|
|
2
3
|
use: "@components/logogrid/logogrid.twig"
|
|
3
4
|
label: Logo Grid
|
|
4
5
|
description: The Logo Grid component renders a series of logos representing a group of organizations. It can be shown on a light or dark background.
|
|
@@ -42,5 +43,3 @@ logogrid:
|
|
|
42
43
|
- label: "UN Refugees"
|
|
43
44
|
src: "/images/unhcr-logo.svg"
|
|
44
45
|
url: "https://www.unhcr.org/"
|
|
45
|
-
|
|
46
|
-
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
modal:
|
|
2
2
|
use: "@components/modal/modal.twig"
|
|
3
|
+
namespace: Components/Feedback
|
|
3
4
|
label: Modal
|
|
4
5
|
description: The Modal displays a div containing a button which is visible on page load. On click of this button, a modal dialog is opened which displays a semitransparent fixed-position background and the contents of the chosen component.
|
|
5
6
|
fields:
|
|
@@ -2,120 +2,157 @@
|
|
|
2
2
|
NAVIGATION COMPONENT
|
|
3
3
|
#}
|
|
4
4
|
<header class="{{prefix}}--header" data-loadcomponent="Navigation" data-prefix="{{prefix}}">
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
<div class="{{prefix}}--header--utility-bar">
|
|
6
|
+
<div class="{{prefix}}--language-switcher">
|
|
7
|
+
<div class="{{prefix}}--language-switcher--wrap">
|
|
8
|
+
<button class="{{prefix}}--language-switcher--button" type="button">
|
|
9
|
+
{{languagelabel}}
|
|
10
|
+
</button>
|
|
11
|
+
{% include '@components/contextmenu/contextmenu.twig' with {
|
|
12
12
|
links: languagecontextmenu.links,
|
|
13
13
|
prefix: prefix
|
|
14
14
|
}
|
|
15
15
|
%}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
16
|
+
</div>
|
|
17
|
+
<!-- /.{{prefix}}--language-switcher--wrap -->
|
|
18
|
+
</div>
|
|
19
|
+
<!-- /.{{prefix}}--language-switcher -->
|
|
20
|
+
</div>
|
|
21
|
+
<!-- /.{{prefix}}--header--utility-bar -->
|
|
22
|
+
<div class="{{prefix}}--header--logo-bar">
|
|
23
|
+
<div class="{{prefix}}--header--inner">
|
|
24
|
+
<a href="{{siteurl}}" class="{{prefix}}--header--logo-link">
|
|
25
|
+
<img class="{{prefix}}--header--logo" src="{{logo.image}}" alt="{{logo.alt}}">
|
|
26
|
+
</a>
|
|
27
|
+
<p class="{{prefix}}--header--logo-tagline">
|
|
28
|
+
{{tagline.tag}}
|
|
29
|
+
<span class="{{prefix}}--header--logo-tagline--small">{{tagline.small}}</span>
|
|
30
|
+
</p>
|
|
31
|
+
<button class="{{prefix}}--header--menu">{{menulabel}}</button>
|
|
32
|
+
</div>
|
|
33
|
+
<!-- /.{{prefix}}--header--inner -->
|
|
34
|
+
</div>
|
|
35
|
+
<!-- /.{{prefix}}--header--logo-bar -->
|
|
36
|
+
<div class="{{prefix}}--header--navigation">
|
|
37
|
+
<div class="{{prefix}}--header--inner">
|
|
38
|
+
<div class="{{prefix}}--mobile--nav">
|
|
39
|
+
<div class="{{prefix}}--mobile--nav--logo">
|
|
40
|
+
<a href="{{siteurl}}" class="{{prefix}}--header--logo-link">
|
|
41
|
+
<img class="{{prefix}}--header--logo" src="{{mobilelogo.image}}" alt="{{mobilelogo.alt}}">
|
|
42
|
+
</a>
|
|
43
|
+
<button class="{{prefix}}--header--menu--close">{{menucloselabel}}</button>
|
|
44
|
+
</div>
|
|
45
|
+
<!-- /.{{prefix}}--mobile--logo -->
|
|
46
|
+
<div class="{{prefix}}--mobile--nav--search">
|
|
47
|
+
{% include '@components/form/form.twig' with {
|
|
48
|
+
attributes: {
|
|
49
|
+
action: searchfield.action,
|
|
50
|
+
"aria-label": label,
|
|
51
|
+
"data-search": "true",
|
|
52
|
+
},
|
|
53
|
+
fieldsets: [{
|
|
54
|
+
fields: [{
|
|
55
|
+
type: "search",
|
|
56
|
+
placeholder: searchfield.input.placeholder,
|
|
57
|
+
name: searchfield.input.name,
|
|
58
|
+
id: searchfield.input.id,
|
|
59
|
+
}]
|
|
60
|
+
}]
|
|
45
61
|
}
|
|
46
|
-
|
|
47
|
-
|
|
62
|
+
%}
|
|
63
|
+
</div>
|
|
64
|
+
<!-- /.{{prefix}}--mobile--search -->
|
|
48
65
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
66
|
+
<div class="{{prefix}}--mobile--nav--language--switcher">
|
|
67
|
+
<button class="{{prefix}}--mobile--nav--language--switcher--button" type="button">{{languagelabel}}</button>
|
|
68
|
+
</div>
|
|
69
|
+
<!-- /.{{prefix}}--mobile--nav--language--switcher -->
|
|
70
|
+
<div class="{{prefix}}--mobile--nav--language--select">
|
|
71
|
+
<div class="{{prefix}}--header--inner">
|
|
72
|
+
<div class="{{prefix}}--mobile--subnav--menu">
|
|
73
|
+
<button class="{{prefix}}--mobile--subnav--back" type="button">{{subnav.mobilebacklabel}}</button>
|
|
74
|
+
<button class="{{prefix}}--header--menu--close">{{subnav.mobilecloselabel}}</button>
|
|
75
|
+
<h6 class="{{prefix}}--mobile--subnav--label">{{languagelabel}}</h6>
|
|
76
|
+
</div>
|
|
77
|
+
<!-- /{{prefix}}--mobile--subnav--menu -->
|
|
78
|
+
<ul class="{{prefix}}--nav--set">
|
|
79
|
+
{% for item in languagecontextmenu.links %}
|
|
80
|
+
<li class="{{prefix}}--nav--items">
|
|
81
|
+
<a href="{{item.url}}" class="{{prefix}}--nav--link {{prefix}}--nav--language">{{item.label}}</a>
|
|
82
|
+
</li>
|
|
83
|
+
{% endfor %}
|
|
84
|
+
</ul>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
<!-- /.{{prefix}}--mobile--nav -->
|
|
89
|
+
<nav class="{{prefix}}--nav" aria-labelledby="primary-navigation">
|
|
90
|
+
<h2 class="{{prefix}}--nav--label" id="primary-navigation">{{primarynav.navlabel}}</h2>
|
|
91
|
+
<ul class="{{prefix}}--nav--set">
|
|
92
|
+
{% for item in primarynav.items %}
|
|
93
|
+
<li class="{{prefix}}--nav--items">
|
|
94
|
+
<a href="{{item.link}}" class="{{prefix}}--nav--link">{{item.label}}</a>
|
|
95
|
+
</li>
|
|
96
|
+
{% endfor %}
|
|
97
|
+
{% if subnav %}
|
|
98
|
+
<li class="{{prefix}}--nav--items">
|
|
99
|
+
<button class="{{prefix}}--nav--trigger">{{subnav.buttonlabel}}</button>
|
|
100
|
+
</li>
|
|
101
|
+
{% endif %}
|
|
102
|
+
</ul>
|
|
103
|
+
</nav>
|
|
104
|
+
<div class="{{prefix}}--search">
|
|
105
|
+
<button class="{{prefix}}--search--button" type="button">{{searchlabel}}</button>
|
|
106
|
+
</div>
|
|
107
|
+
<!-- /.{{prefix}}--search -->
|
|
108
|
+
</div>
|
|
109
|
+
<!-- /.{{prefix}}--header--inner -->
|
|
110
|
+
{% if subnav %}
|
|
111
|
+
<nav class="{{prefix}}--subnav" aria-labelledby="secondary-navigation">
|
|
112
|
+
<div class="{{prefix}}--subnav--inner">
|
|
113
|
+
<div class="{{prefix}}--mobile--subnav">
|
|
114
|
+
<div class="{{prefix}}--mobile--subnav--menu">
|
|
115
|
+
<button class="{{prefix}}--mobile--subnav--back" type="button">{{subnav.mobilebacklabel}}</button>
|
|
116
|
+
<button class="{{prefix}}--header--menu--close">{{subnav.mobilecloselabel}}</button>
|
|
117
|
+
<h6 class="{{prefix}}--mobile--subnav--label">{{subnav.buttonlabel}}</h6>
|
|
118
|
+
</div>
|
|
119
|
+
<!-- /{{prefix}}--mobile--subnav--menu -->
|
|
120
|
+
</div>
|
|
121
|
+
<!-- /.{{prefix}}--mobile--subnav -->
|
|
122
|
+
<h2 class="{{prefix}}--nav--label" id="secondary-navigation">{{subnav.navlabel}}</h2>
|
|
123
|
+
<ul class="{{prefix}}--subnav--set">
|
|
124
|
+
{% for item in subnav.items %}
|
|
125
|
+
<li class="{{prefix}}--subnav--items">
|
|
126
|
+
<a href="{{item.link}}" class="{{prefix}}--subnav--link">{{item.label}}</a>
|
|
127
|
+
</li>
|
|
128
|
+
{% endfor %}
|
|
129
|
+
</ul>
|
|
130
|
+
</div>
|
|
131
|
+
<!-- /.{{prefix}}--subnav--inner -->
|
|
132
|
+
</nav>
|
|
133
|
+
{% endif %}
|
|
109
134
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
135
|
+
<div class="{{prefix}}--search-box">
|
|
136
|
+
<div class="{{prefix}}--header--inner">
|
|
137
|
+
{% include '@components/form/form.twig' with {
|
|
138
|
+
attributes: {
|
|
139
|
+
action: searchfield.action,
|
|
140
|
+
"aria-label": label,
|
|
141
|
+
"data-search": "true",
|
|
142
|
+
},
|
|
143
|
+
fieldsets: [{
|
|
144
|
+
fields: [{
|
|
145
|
+
type: "search",
|
|
146
|
+
placeholder: searchfield.input.placeholder,
|
|
147
|
+
name: searchfield.input.name,
|
|
148
|
+
id: searchfield.input.id,
|
|
149
|
+
}]
|
|
150
|
+
}]
|
|
116
151
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
152
|
+
%}
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
<!-- /.{{prefix}}--search-box -->
|
|
156
|
+
</div>
|
|
157
|
+
<!-- /.{{prefix}}--header--navigation -->
|
|
121
158
|
</header>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{# dropdown.twig #}
|
|
2
|
+
|
|
3
|
+
{% extends "@components/form/formcontrol.twig" %}
|
|
4
|
+
|
|
5
|
+
{% set baseClass = prefix ~ "--searchfield" %}
|
|
6
|
+
{% set searchClass = [baseClass, class] %}
|
|
7
|
+
{% set inputClass = prefix ~ "--input" %}
|
|
8
|
+
{% set buttonClass = baseClass ~ "--button" %}
|
|
9
|
+
|
|
10
|
+
{% if error %}
|
|
11
|
+
{% set inputClass = inputClass|merge([baseClass ~ "__error"]) %}
|
|
12
|
+
{% endif %}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
{% block formfield %}
|
|
16
|
+
|
|
17
|
+
<div class="{{ searchClass|join(" ") }}" {% if style %} style={{ style }} {% endif %}>
|
|
18
|
+
<input name="{{name}}" type="{{type}}" class="{{ inputClass }}{% if error %} error{% endif %}" {% if placeholder %} placeholder="{{placeholder}}" {% endif %} {% if disabled %} disabled {% endif %} {% if required %} required {% endif %} id="{% if id %}{{id}}{% else %}{{name}}{% endif %}"/>
|
|
19
|
+
<input class="{{ buttonClass }}" type="submit"/>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
{% endblock %}
|