@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.
Files changed (75) hide show
  1. package/.turbo/turbo-build:lib.log +2 -2
  2. package/CHANGELOG.md +14 -0
  3. package/package.json +3 -3
  4. package/src/patterns/components/accordion/accordion.wingsuit.yml +1 -0
  5. package/src/patterns/components/breadcrumb/breadcrumb.wingsuit.yml +1 -0
  6. package/src/patterns/components/button/button.wingsuit.yml +1 -0
  7. package/src/patterns/components/callout/callout.wingsuit.yml +1 -0
  8. package/src/patterns/components/card/card.wingsuit.yml +14 -13
  9. package/src/patterns/components/card_data/card_data.wingsuit.yml +3 -7
  10. package/src/patterns/components/card_detail/card_detail.wingsuit.yml +1 -3
  11. package/src/patterns/components/card_factlist/card_factlist.wingsuit.yml +1 -4
  12. package/src/patterns/components/card_feature/card_feature.wingsuit.yml +1 -3
  13. package/src/patterns/components/card_multilink/card_multilink.wingsuit.yml +7 -9
  14. package/src/patterns/components/card_promo/card_promo.wingsuit.yml +1 -3
  15. package/src/patterns/components/card_stat/card_stat.wingsuit.yml +1 -5
  16. package/src/patterns/components/card_text/card_text.wingsuit.yml +4 -6
  17. package/src/patterns/components/cardgroup/cardgroup.wingsuit.yml +1 -4
  18. package/src/patterns/components/{searchfield/searchfield.stories.jsx → checkbox/checkbox.stories.jsx} +1 -1
  19. package/src/patterns/components/checkbox/checkbox.twig +17 -0
  20. package/src/patterns/components/checkbox/checkbox.wingsuit.yml +83 -0
  21. package/src/patterns/components/checkbox/index.js +7 -0
  22. package/src/patterns/components/contextmenu/contextmenu.wingsuit.yml +1 -0
  23. package/src/patterns/components/datepicker/datepicker.stories.jsx +9 -0
  24. package/src/patterns/components/datepicker/datepicker.twig +20 -0
  25. package/src/patterns/components/datepicker/datepicker.wingsuit.yml +71 -0
  26. package/src/patterns/components/datepicker/index.js +7 -0
  27. package/src/patterns/components/dropdown/dropdown.twig +16 -16
  28. package/src/patterns/components/dropdown/dropdown.wingsuit.yml +80 -58
  29. package/src/patterns/components/footer/footer.wingsuit.yml +1 -0
  30. package/src/patterns/components/form/fieldset.twig +62 -0
  31. package/src/patterns/components/form/form.twig +18 -96
  32. package/src/patterns/components/form/form.wingsuit.yml +138 -967
  33. package/src/patterns/components/form/formcontrol.twig +84 -0
  34. package/src/patterns/components/form/input.twig +9 -12
  35. package/src/patterns/components/hero/hero.wingsuit.yml +40 -40
  36. package/src/patterns/components/herocard/herocard.wingsuit.yml +1 -0
  37. package/src/patterns/components/image/image.wingsuit.yml +1 -0
  38. package/src/patterns/components/link/link.wingsuit.yml +1 -0
  39. package/src/patterns/components/linklist/linklist.wingsuit.yml +1 -0
  40. package/src/patterns/components/list/list-item.wingsuit.yml +1 -0
  41. package/src/patterns/components/list/list.wingsuit.yml +1 -0
  42. package/src/patterns/components/loading/loading.wingsuit.yml +1 -0
  43. package/src/patterns/components/localnav/localnav.wingsuit.yml +1 -0
  44. package/src/patterns/components/logogrid/logogrid.wingsuit.yml +1 -2
  45. package/src/patterns/components/modal/modal.wingsuit.yml +1 -0
  46. package/src/patterns/components/navigation/navigation.twig +145 -108
  47. package/src/patterns/components/notification/notification.wingsuit.yml +1 -0
  48. package/src/patterns/components/pagination/pagination.wingsuit.yml +1 -0
  49. package/src/patterns/components/profile/profile.wingsuit.yml +1 -0
  50. package/src/patterns/components/readmore/readmore.wingsuit.yml +1 -0
  51. package/src/patterns/components/richtext/richtext.wingsuit.yml +1 -0
  52. package/src/patterns/components/search/index.js +6 -0
  53. package/src/patterns/components/search/search.stories.jsx +10 -0
  54. package/src/patterns/components/search/search.twig +22 -0
  55. package/src/patterns/components/search/search.wingsuit.yml +89 -0
  56. package/src/patterns/components/socialmedia/socialmedia.wingsuit.yml +1 -0
  57. package/src/patterns/components/table/table.wingsuit.yml +1 -0
  58. package/src/patterns/components/tableofcontents/tableofcontents.wingsuit.yml +1 -0
  59. package/src/patterns/components/tabs/tabs.wingsuit.yml +1 -0
  60. package/src/patterns/components/tags/tags.wingsuit.yml +1 -0
  61. package/src/patterns/components/textinput/index.js +7 -0
  62. package/src/patterns/components/textinput/textinput.stories.jsx +10 -0
  63. package/src/patterns/components/textinput/textinput.twig +13 -0
  64. package/src/patterns/components/textinput/textinput.wingsuit.yml +87 -0
  65. package/src/patterns/components/tooltip/tooltip.twig +9 -11
  66. package/src/patterns/components/tooltip/tooltip.wingsuit.yml +7 -0
  67. package/src/patterns/components/video/video.wingsuit.yml +1 -0
  68. package/contributing.md +0 -5
  69. package/src/patterns/components/fieldset/fieldset.twig +0 -44
  70. package/src/patterns/components/form/checkbox.twig +0 -13
  71. package/src/patterns/components/form/checkboxgroup.twig +0 -5
  72. package/src/patterns/components/form/datepicker.twig +0 -41
  73. package/src/patterns/components/searchfield/index.js +0 -6
  74. package/src/patterns/components/searchfield/searchfield.twig +0 -7
  75. 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
- INPUT COMPONENT
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
- {% block formfield %}
12
- <input name="{{name}}" type="{{type}}" class="{{prefix}}--input{% if error %} error{% endif %}" {% if placeholder %}placeholder="{{placeholder}}"{% endif %} {% if disabled %}disabled{% endif %} {% if required %}required{% endif %} id="{% if id %}{{id}}{% else %}{{name}}{% endif %}" />
13
- {% endblock %}
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
- justify:
68
- label: Justify
69
- description: Sets the horizontal alignment of the hero card. `start` is on the left in LTR layouts and on the right in RTL layouts.
70
- type: select
71
- options:
72
- start: start
73
- offset: offset
74
- center: center
75
- preview: "start"
76
- align:
77
- label: Align
78
- description: Sets the vertical alignment of the hero card.
79
- type: select
80
- options:
81
- baseline: baseline
82
- center: center
83
- bottom: bottom
84
- preview: "baseline"
85
- postersize:
86
- label: Poster Size
87
- description: Sets the size of the image poster.
88
- type: select
89
- options:
90
- small: small
91
- medium: medium
92
- large: large
93
- xlarge: xlarge
94
- preview: large
95
- cardsize:
96
- label: Card Size
97
- description: Sets the width of the hero card.
98
- type: select
99
- options:
100
- small: small
101
- medium: medium
102
- large: large
103
- xlarge: xlarge
104
- xxlarge: xxlarge
105
- preview: small
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
  herocard:
2
+ namespace: Components/Content
2
3
  use: "@components/herocard/herocard.twig"
3
4
  label: Hero Card
4
5
  description: The Hero Card includes the title, intro, date, and social links for the hero
@@ -1,4 +1,5 @@
1
1
  image:
2
+ namespace: Components/Media
2
3
  use: "@components/image/image.twig"
3
4
  label: Image
4
5
  description: A component for displaying an image.
@@ -1,4 +1,5 @@
1
1
  link:
2
+ namespace: Components/Navigation
2
3
  use: "@components/link/link.twig"
3
4
  label: Link
4
5
  description: A component for displaying a link.
@@ -1,5 +1,6 @@
1
1
  linklist:
2
2
  use: "@components/linklist/linklist.twig"
3
+ namespace: Components/Navigation
3
4
  label: Link List
4
5
  description: The Link List receives a list of urls with labels and an optional prop indicating if this link is at the end of a 'section.'
5
6
  fields:
@@ -1,4 +1,5 @@
1
1
  list:
2
+ namespace: Components/Content
2
3
  use: "@components/list/list-item.twig"
3
4
  label: List Item
4
5
  description: A list item.
@@ -1,4 +1,5 @@
1
1
  list:
2
+ namespace: Components/Content
2
3
  use: "@components/list/list.twig"
3
4
  label: List
4
5
  description: The list component
@@ -1,4 +1,5 @@
1
1
  loading:
2
+ namespace: Components/Transitions
2
3
  use: "@components/loading/loading.twig"
3
4
  label: Loading
4
5
  description: The Loading component displays a loading state. (See Javascript comments in loading.js for how to use this with vanilla JS).
@@ -1,4 +1,5 @@
1
1
  localnav:
2
+ namespace: Components/Navigation
2
3
  use: "@components/localnav/localnav.twig"
3
4
  label: Local nav
4
5
  description: The Local nav component
@@ -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
- <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 {
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
- </div> <!-- /.{{prefix}}--language-switcher--wrap -->
17
- </div> <!-- /.{{prefix}}--language-switcher -->
18
- </div> <!-- /.{{prefix}}--header--utility-bar -->
19
- <div class="{{prefix}}--header--logo-bar">
20
- <div class="{{prefix}}--header--inner">
21
- <a href="{{siteurl}}" class="{{prefix}}--header--logo-link">
22
- <img class="{{prefix}}--header--logo" src="{{logo.image}}" alt="{{logo.alt}}">
23
- </a>
24
- <p class="{{prefix}}--header--logo-tagline">
25
- {{tagline.tag}}
26
- <span class="{{prefix}}--header--logo-tagline--small">{{tagline.small}}</span>
27
- </p>
28
- <button class="{{prefix}}--header--menu">{{menulabel}}</button>
29
- </div> <!-- /.{{prefix}}--header--inner -->
30
- </div> <!-- /.{{prefix}}--header--logo-bar -->
31
- <div class="{{prefix}}--header--navigation">
32
- <div class="{{prefix}}--header--inner">
33
- <div class="{{prefix}}--mobile--nav">
34
- <div class="{{prefix}}--mobile--nav--logo">
35
- <a href="{{siteurl}}" class="{{prefix}}--header--logo-link">
36
- <img class="{{prefix}}--header--logo" src="{{mobilelogo.image}}" alt="{{mobilelogo.alt}}">
37
- </a>
38
- <button class="{{prefix}}--header--menu--close">{{menucloselabel}}</button>
39
- </div> <!-- /.{{prefix}}--mobile--logo -->
40
- <div class="{{prefix}}--mobile--nav--search">
41
- {% include '@components/searchfield/searchfield.twig' with {
42
- input: searchfield.input,
43
- action: searchfield.action,
44
- prefix: prefix
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
- </div> <!-- /.{{prefix}}--mobile--search -->
62
+ %}
63
+ </div>
64
+ <!-- /.{{prefix}}--mobile--search -->
48
65
 
49
- <div class="{{prefix}}--mobile--nav--language--switcher">
50
- <button class="{{prefix}}--mobile--nav--language--switcher--button" type="button">{{languagelabel}}</button>
51
- </div> <!-- /.{{prefix}}--mobile--nav--language--switcher -->
52
- <div class="{{prefix}}--mobile--nav--language--select">
53
- <div class="{{prefix}}--header--inner">
54
- <div class="{{prefix}}--mobile--subnav--menu">
55
- <button class="{{prefix}}--mobile--subnav--back" type="button">{{subnav.mobilebacklabel}}</button>
56
- <button class="{{prefix}}--header--menu--close">{{subnav.mobilecloselabel}}</button>
57
- <h6 class="{{prefix}}--mobile--subnav--label">{{languagelabel}}</h6>
58
- </div> <!-- /{{prefix}}--mobile--subnav--menu -->
59
- <ul class="{{prefix}}--nav--set">
60
- {% for item in languagecontextmenu.links %}
61
- <li class="{{prefix}}--nav--items">
62
- <a href="{{item.url}}" class="{{prefix}}--nav--link {{prefix}}--nav--language">{{item.label}}</a>
63
- </li>
64
- {% endfor %}
65
- </ul>
66
- </div>
67
- </div>
68
- </div> <!-- /.{{prefix}}--mobile--nav -->
69
- <nav class="{{prefix}}--nav" aria-labelledby="primary-navigation">
70
- <h2 class="{{prefix}}--nav--label" id="primary-navigation">{{primarynav.navlabel}}</h2>
71
- <ul class="{{prefix}}--nav--set">
72
- {% for item in primarynav.items %}
73
- <li class="{{prefix}}--nav--items">
74
- <a href="{{item.link}}" class="{{prefix}}--nav--link">{{item.label}}</a>
75
- </li>
76
- {% endfor %}
77
- {% if subnav %}
78
- <li class="{{prefix}}--nav--items">
79
- <button class="{{prefix}}--nav--trigger">{{subnav.buttonlabel}}</button>
80
- </li>
81
- {% endif %}
82
- </ul>
83
- </nav>
84
- <div class="{{prefix}}--search">
85
- <button class="{{prefix}}--search--button" type="button">{{searchlabel}}</button>
86
- </div> <!-- /.{{prefix}}--search -->
87
- </div> <!-- /.{{prefix}}--header--inner -->
88
- {% if subnav %}
89
- <nav class="{{prefix}}--subnav" aria-labelledby="secondary-navigation">
90
- <div class="{{prefix}}--subnav--inner">
91
- <div class="{{prefix}}--mobile--subnav">
92
- <div class="{{prefix}}--mobile--subnav--menu">
93
- <button class="{{prefix}}--mobile--subnav--back" type="button">{{subnav.mobilebacklabel}}</button>
94
- <button class="{{prefix}}--header--menu--close">{{subnav.mobilecloselabel}}</button>
95
- <h6 class="{{prefix}}--mobile--subnav--label">{{subnav.buttonlabel}}</h6>
96
- </div> <!-- /{{prefix}}--mobile--subnav--menu -->
97
- </div> <!-- /.{{prefix}}--mobile--subnav -->
98
- <h2 class="{{prefix}}--nav--label" id="secondary-navigation">{{subnav.navlabel}}</h2>
99
- <ul class="{{prefix}}--subnav--set">
100
- {% for item in subnav.items %}
101
- <li class="{{prefix}}--subnav--items">
102
- <a href="{{item.link}}" class="{{prefix}}--subnav--link">{{item.label}}</a>
103
- </li>
104
- {% endfor %}
105
- </ul>
106
- </div> <!-- /.{{prefix}}--subnav--inner -->
107
- </nav>
108
- {% endif %}
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
- <div class="{{prefix}}--search-box">
111
- <div class="{{prefix}}--header--inner">
112
- {% include '@components/searchfield/searchfield.twig' with {
113
- input: searchfield.input,
114
- action: searchfield.action,
115
- prefix: prefix
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
- </div>
119
- </div> <!-- /.{{prefix}}--search-box -->
120
- </div> <!-- /.{{prefix}}--header--navigation -->
152
+ %}
153
+ </div>
154
+ </div>
155
+ <!-- /.{{prefix}}--search-box -->
156
+ </div>
157
+ <!-- /.{{prefix}}--header--navigation -->
121
158
  </header>
@@ -1,4 +1,5 @@
1
1
  notification:
2
+ namespace: Components/Feedback
2
3
  use: "@components/notification/notification.twig"
3
4
  label: Notification
4
5
  description: The Notification component presents a dismissible alert.
@@ -1,4 +1,5 @@
1
1
  pagination:
2
+ namespace: Components/Navigation
2
3
  use: "@components/pagination/pagination.twig"
3
4
  label: Pagination
4
5
  description: The Pagination component presents a dismissible alert.
@@ -1,4 +1,5 @@
1
1
  profile:
2
+ namespace: Components/Content
2
3
  use: "@components/profile/profile.twig"
3
4
  label: Profile
4
5
  description: The Profile component is used to display information about a person.
@@ -1,4 +1,5 @@
1
1
  readmore:
2
+ namespace: Components/User Interface
2
3
  use: "@components/readmore/readmore.twig"
3
4
  label: Read More
4
5
  description: A component for displaying rich text as entered in a WYSIWYG editor.
@@ -1,4 +1,5 @@
1
1
  richtext:
2
+ namespace: Components/Content
2
3
  use: "@components/richtext/richtext.twig"
3
4
  label: Rich Text
4
5
  description: A component for displaying rich text as entered in a WYSIWYG editor.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Search Field
3
+ */
4
+ // Module template
5
+ import "./search.twig";
6
+ import "./search.wingsuit.yml";
@@ -0,0 +1,10 @@
1
+ import "./index";
2
+
3
+ export default {};
4
+ const patternDefinition = require("./search.wingsuit.yml");
5
+
6
+ /* eslint-disable-next-line */
7
+ /* eslint-disable-next-line */
8
+ export const wingsuit = {
9
+ patternDefinition,
10
+ };
@@ -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 %}