@ilo-org/twig 0.10.4 → 0.11.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 (43) hide show
  1. package/.turbo/turbo-build:lib.log +2 -2
  2. package/CHANGELOG.md +38 -0
  3. package/package.json +3 -3
  4. package/src/patterns/components/datepicker/datepicker.twig +1 -1
  5. package/src/patterns/components/datepicker/datepicker.wingsuit.yml +1 -1
  6. package/src/patterns/components/{form → fileupload}/fileupload.behavior.js +0 -1
  7. package/src/patterns/components/{form → fileupload}/fileupload.js +47 -19
  8. package/src/patterns/components/fileupload/fileupload.stories.jsx +9 -0
  9. package/src/patterns/components/fileupload/fileupload.twig +20 -0
  10. package/src/patterns/components/fileupload/fileupload.wingsuit.yml +94 -0
  11. package/src/patterns/components/fileupload/index.js +8 -0
  12. package/src/patterns/components/footer/footer.twig +57 -55
  13. package/src/patterns/components/footer/footer.wingsuit.yml +15 -25
  14. package/src/patterns/components/form/fieldset.twig +10 -2
  15. package/src/patterns/components/form/form.wingsuit.yml +56 -2
  16. package/src/patterns/components/form/formcontrol.twig +4 -1
  17. package/src/patterns/components/form/index.js +1 -2
  18. package/src/patterns/components/hero/hero.twig +38 -32
  19. package/src/patterns/components/hero/hero.wingsuit.yml +0 -4
  20. package/src/patterns/components/navigation/navigation.twig +12 -5
  21. package/src/patterns/components/numberpicker/index.js +7 -0
  22. package/src/patterns/components/numberpicker/numberpicker.stories.jsx +9 -0
  23. package/src/patterns/components/numberpicker/numberpicker.twig +16 -0
  24. package/src/patterns/components/numberpicker/numberpicker.wingsuit.yml +91 -0
  25. package/src/patterns/components/radio/index.js +7 -0
  26. package/src/patterns/components/radio/radio.stories.jsx +10 -0
  27. package/src/patterns/components/radio/radio.twig +23 -0
  28. package/src/patterns/components/radio/radio.wingsuit.yml +83 -0
  29. package/src/patterns/components/textarea/index.js +7 -0
  30. package/src/patterns/components/textarea/textarea.stories.jsx +9 -0
  31. package/src/patterns/components/textarea/textarea.twig +14 -0
  32. package/src/patterns/components/textarea/textarea.wingsuit.yml +126 -0
  33. package/src/patterns/components/textinput/textinput.twig +2 -1
  34. package/src/patterns/components/toggle/index.js +7 -0
  35. package/src/patterns/components/toggle/toggle.stories.jsx +10 -0
  36. package/src/patterns/components/toggle/toggle.twig +36 -0
  37. package/src/patterns/components/toggle/toggle.wingsuit.yml +94 -0
  38. package/src/patterns/components/tooltip/tooltip.twig +7 -5
  39. package/src/patterns/components/tooltip/tooltip.wingsuit.yml +9 -0
  40. package/src/patterns/components/form/file.twig +0 -14
  41. package/src/patterns/components/form/number.twig +0 -13
  42. package/src/patterns/components/form/radio.twig +0 -4
  43. package/src/patterns/components/form/textarea.twig +0 -13
@@ -1,9 +1,9 @@
1
1
 
2
- > @ilo-org/twig@0.10.4 build:lib /home/runner/work/designsystem/designsystem/packages/twig
2
+ > @ilo-org/twig@0.11.0 build:lib /home/runner/work/designsystem/designsystem/packages/twig
3
3
  > node importprefix.js && node importsvgs.js && pnpm output
4
4
 
5
5
  theme prefix added
6
6
 
7
- > @ilo-org/twig@0.10.4 output /home/runner/work/designsystem/designsystem/packages/twig
7
+ > @ilo-org/twig@0.11.0 output /home/runner/work/designsystem/designsystem/packages/twig
8
8
  > node outputtwigs.js
9
9
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @ilo-org/twig
2
2
 
3
+ ## 0.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 455e1b626: Add Radio as form element
8
+ - 41f933135: Adds File Upload as form element
9
+ - 4f439c1bf: Add Number Picker as form element
10
+ - b7e6cda36: Add TextArea as form element
11
+ - 2acffbd2e: Add Toggle as form element
12
+
13
+ ### Patch Changes
14
+
15
+ - bd5919f50: Setting formControlClass as a variable with the default value at the begining of the template.
16
+ - a43230b26: Add blocks to override with Drupal search block on the navigation.
17
+ - c86fa4f33: Fix tooltip icon appearing in the wrong color. This adds a new parameter `icontheme` for the tooltip, which defaults to light.
18
+ - 86b5b118a: Set name as default id for TextInput
19
+ - Updated dependencies [c3b0e6def]
20
+ - Updated dependencies [39ff32a91]
21
+ - Updated dependencies [0488bc66e]
22
+ - Updated dependencies [c86fa4f33]
23
+ - @ilo-org/styles@0.10.1
24
+ - @ilo-org/themes@0.5.1
25
+
26
+ ## 0.10.5
27
+
28
+ ### Patch Changes
29
+
30
+ - ad590b833: Use container class to set max widths and padding for Navigation
31
+ - e575c2973: Fit content in the footer inside a 1300px max-width container
32
+ - Updated dependencies [1e18e0ca9]
33
+ - Updated dependencies [ad590b833]
34
+ - Updated dependencies [6c4ebfeb3]
35
+ - Updated dependencies [e575c2973]
36
+ - Updated dependencies [e575c2973]
37
+ - Updated dependencies [73640499b]
38
+ - @ilo-org/styles@0.10.0
39
+ - @ilo-org/themes@0.5.0
40
+
3
41
  ## 0.10.4
4
42
 
5
43
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilo-org/twig",
3
- "version": "0.10.4",
3
+ "version": "0.11.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Twig components for the ILO's Design System",
6
6
  "main": "",
@@ -25,8 +25,8 @@
25
25
  "@ilo-org/brand-assets": "0.2.0",
26
26
  "@ilo-org/fonts": "0.1.0",
27
27
  "@ilo-org/icons": "0.2.1",
28
- "@ilo-org/styles": "0.9.2",
29
- "@ilo-org/themes": "0.4.0",
28
+ "@ilo-org/styles": "0.10.1",
29
+ "@ilo-org/themes": "0.5.1",
30
30
  "@ilo-org/utils": "0.0.11"
31
31
  },
32
32
  "devDependencies": {
@@ -1,4 +1,4 @@
1
- {# date_picker.html.twig #}
1
+ {# datepicker.twig #}
2
2
 
3
3
  {% extends "@components/form/formcontrol.twig" %}
4
4
 
@@ -2,7 +2,7 @@ datepicker:
2
2
  namespace: Components/Forms
3
3
  use: "@components/datepicker/datepicker.twig"
4
4
  label: Date Picker
5
- description: The facet component combines the Accordion and the Checkbox components. It's usually used to filter a list of items.
5
+ description: The Date Picker component is used to select a date from a calendar.
6
6
  visibility: storybook
7
7
  fields:
8
8
  label:
@@ -5,7 +5,6 @@ Drupal.behaviors.fileupload = {
5
5
  Array.prototype.forEach.call(
6
6
  document.querySelectorAll(`[data-loadcomponent="FileUpload"]`),
7
7
  (element) => {
8
- // eslint-disable-next-line no-console
9
8
  new FileUpload(element);
10
9
  }
11
10
  );
@@ -47,12 +47,12 @@ export default class FileUpload {
47
47
  * @chainable
48
48
  */
49
49
  cacheDomReferences() {
50
- /**
51
- * The button for toggling Read More state
52
- * @type {Object}
53
- */
50
+ // Find the container of the input
54
51
  this.container = this.element.parentElement.parentElement;
55
52
 
53
+ // Find the form control
54
+ this.formControl = this.container.parentElement;
55
+
56
56
  return this;
57
57
  }
58
58
 
@@ -80,29 +80,56 @@ export default class FileUpload {
80
80
  return this;
81
81
  }
82
82
 
83
+ /**
84
+ * Format bytes to a human readable format
85
+ *
86
+ * @param {Number} bytes
87
+ * @param {Number} decimals
88
+ * @return {String}
89
+ */
90
+ formatBytes(bytes, decimals = 2) {
91
+ if (!+bytes) return "0 Bytes";
92
+
93
+ const k = 1024;
94
+ const dm = decimals < 0 ? 0 : decimals;
95
+ const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
96
+
97
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
98
+
99
+ return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
100
+ }
101
+
83
102
  /**
84
103
  * onChange interaction with the FileUpload button
85
104
  *
86
105
  * @return {Object} FileUpload A reference to the instance of the class
87
106
  * @chainable
88
107
  */
89
- onChange(e) {
90
- const oldDiv =
91
- this.container.querySelector(`.${this.prefix}--fieldset--input`) !== null;
92
- if (oldDiv) {
93
- this.container.remove(oldDiv);
108
+ onChange() {
109
+ // Classname of the list of files to upload
110
+ const fileListClass = `${this.prefix}--file-upload--list`;
111
+
112
+ // Find the fileList if it exsists
113
+ let fileList = this.formControl.querySelector(`.${fileListClass}`);
114
+
115
+ // Remove the fileList if it exists
116
+ if (fileList) {
117
+ fileList.remove();
94
118
  }
95
- const newDiv = document.createElement("div");
96
- newDiv.classList.add(`${this.prefix}--fieldset--input`);
97
- const fileList = document.createElement("ul");
98
- fileList.classList.add(`${this.prefix}--file-upload--list`);
119
+
120
+ // Create a new filelist and add it to the form control
121
+ fileList = document.createElement("ul");
122
+ fileList.classList.add(fileListClass);
123
+ this.formControl.appendChild(fileList);
124
+
125
+ // Add files to the filelist
99
126
  let files = "";
100
- [...e.target.files].map((file) => {
101
- files += this.template(file.name);
127
+ [...this.element.files].forEach((file) => {
128
+ const fileSize = this.formatBytes(file.size);
129
+ files += this.template(file.name, fileSize);
102
130
  });
131
+
103
132
  fileList.innerHTML = files;
104
- newDiv.appendChild(fileList);
105
- this.container.appendChild(newDiv);
106
133
 
107
134
  return this;
108
135
  }
@@ -111,9 +138,10 @@ export default class FileUpload {
111
138
  * A template for outputting the list item markup
112
139
  *
113
140
  * @param {String} filename
141
+ * @param {String} filesize
114
142
  * @return {String}
115
143
  */
116
- template(filename) {
117
- return `<li class="ilo--file-upload--list-item">${filename}</li>`;
144
+ template(filename, filesize) {
145
+ return `<li class="ilo--file-upload--list-item">${filename} (${filesize})</li>`;
118
146
  }
119
147
  }
@@ -0,0 +1,9 @@
1
+ import "./index";
2
+
3
+ export default {};
4
+ const patternDefinition = require("./fileupload.wingsuit.yml");
5
+
6
+ /* eslint-disable-next-line */
7
+ export const wingsuit = {
8
+ patternDefinition,
9
+ };
@@ -0,0 +1,20 @@
1
+ {# fileupload.twig #}
2
+
3
+ {% extends "@components/form/formcontrol.twig" %}
4
+
5
+ {% set baseClass = prefix ~ '--file-upload' %}
6
+ {% set fileUploadClasses = [baseClass] %}
7
+ {% set inputClass = baseClass ~ '--input' %}
8
+
9
+ {% if error %}
10
+ {% set fileUploadClasses = fileUploadClasses|merge(['error']) %}
11
+ {% endif %}
12
+
13
+ {% block formfield %}
14
+ <div class="{{ fileUploadClasses|join(' ') }}">
15
+ <label class="{{ inputClass }}">
16
+ {{ placeholder }}
17
+ <input id="{{ id|default(name) }}" name="{{ name }}" {% if disabled %} disabled {% endif %} {% if multiple %} multiple {% endif %} placeholder="{{ placeholder }}" {% if required %} required {% endif %} type="file" data-label="{{ placeholder }}" aria-describedby="{{ ariaDescribedBy }}" {% if accept %} accept="{{ accept }}" {% endif %} data-loadcomponent="FileUpload" data-prefix="{{prefix}}"/>
18
+ </label>
19
+ </div>
20
+ {% endblock %}
@@ -0,0 +1,94 @@
1
+ fileupload:
2
+ namespace: Components/Forms
3
+ use: "@components/fileupload/fileupload.twig"
4
+ label: File Upload
5
+ description: The FileUpload component allows users to select and upload files
6
+ from their device to a web application. It displays a list of the
7
+ files to upload once they've been selected.
8
+ visibility: storybook
9
+ fields:
10
+ label:
11
+ type: text
12
+ label: Label
13
+ description: The label for the form element.
14
+ preview: Upload your files here
15
+ tooltip:
16
+ type: string
17
+ description: The tooltip for the form element.
18
+ helper:
19
+ type: text
20
+ label: Helper Text
21
+ description: The helper text for the form element.
22
+ preview: Max docs size 10MB
23
+ id:
24
+ type: text
25
+ label: ID
26
+ description: The ID of the text input.
27
+ name:
28
+ type: text
29
+ label: Name
30
+ description: The name of the text input.
31
+ placeholder:
32
+ type: text
33
+ label: Placeholder
34
+ description: The placeholder of the text input.
35
+ preview: Select files
36
+ class:
37
+ type: text
38
+ label: Class
39
+ description: The class of the text input.
40
+ preview: textinput
41
+ default: ""
42
+ accept:
43
+ type: text
44
+ label: Accept
45
+ description: The accept attribute of the text input.
46
+ preview: ".pdf,.doc, .docx, .jpg, .png"
47
+ settings:
48
+ labelPlacement:
49
+ type: select
50
+ label: Label Placement
51
+ description: The placement of the label for the form element.
52
+ preview: "top"
53
+ default: "top"
54
+ options:
55
+ start: start
56
+ end: end
57
+ top: top
58
+ bottom: bottom
59
+ labelSize:
60
+ type: select
61
+ label: Label Size
62
+ description: The size of the label for the form element.
63
+ preview: "medium"
64
+ default: "medium"
65
+ options:
66
+ small: small
67
+ medium: medium
68
+ large: large
69
+ multiple:
70
+ type: boolean
71
+ label: Multiple
72
+ description: If the user can select multiple files.
73
+ preview: false
74
+ options:
75
+ true: true
76
+ false: false
77
+ disabled:
78
+ type: boolean
79
+ label: Disabled
80
+ description: The disabled state of the text input.
81
+ preview: false
82
+ default: false
83
+ required:
84
+ type: boolean
85
+ label: Required
86
+ description: The required state of the text input.
87
+ preview: false
88
+ default: false
89
+ error:
90
+ type: boolean
91
+ label: Error
92
+ description: Adds an error state to the form control.
93
+ preview: false
94
+ default: false
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Fileupload
3
+ */
4
+
5
+ import "./fileupload.twig";
6
+ import "./fileupload.wingsuit.yml";
7
+ import "./fileupload.behavior";
8
+ import "../tooltip/tooltip.behavior";
@@ -1,61 +1,63 @@
1
- {#
2
- FOOTER COMPONENT
3
- #}
1
+ {# footer.twig #}
4
2
  <footer class="{{prefix}}--footer">
5
- <div class="{{prefix}}--footer--main">
6
- <div class="site--info">
7
- <img class="{{prefix}}--footer--logo" src="{{logo.url}}" alt="{{logo.alt}}" />
8
- <h3 class="{{prefix}}--footer--headline">{{tagline}}</h3>
9
- <h4 class="{{prefix}}--footer--subhead">{{subtagline}}</h4>
10
- </div>
11
- {% if address %}
12
- <div class="address">
13
- {% for line in address %}
14
- <p class="address--line">{{line}}</p>
15
- {% endfor %}
16
- </div>
17
- {% endif %}
18
- {% if linkgroup %}
19
- <nav class="links">
20
- {% include '@components/linklist/linklist.twig' with {linkgroup: linkgroup, theme: 'dark'} %}
21
- </nav>
22
- {% endif %}
23
- {% if social or subscribe %}
24
- <div class="connect">
25
- {% if socialmedia %}
26
- <div class="social--links">
27
- {% include '@components/socialmedia/socialmedia.twig' with {
3
+ <div class="{{prefix}}--footer--main {{prefix}}--container">
4
+ <div class="site--info">
5
+ <img class="{{prefix}}--footer--logo" src="{{logo.url}}" alt="{{logo.alt}}"/>
6
+ <h3 class="{{prefix}}--footer--headline">{{tagline}}</h3>
7
+ <h4 class="{{prefix}}--footer--subhead">{{subtagline}}</h4>
8
+ </div>
9
+ {% if address %}
10
+ <div class="address">
11
+ {% for line in address %}
12
+ <p class="address--line">{{line}}</p>
13
+ {% endfor %}
14
+ </div>
15
+ {% endif %}
16
+ {% if linkgroup %}
17
+ <nav class="links">
18
+ {% include '@components/linklist/linklist.twig' with {linkgroup: linkgroup, theme: 'dark'} %}
19
+ </nav>
20
+ {% endif %}
21
+ {% if socialmedia %}
22
+ <div class="connect">
23
+ <div class="social--links">
24
+ {% include '@components/socialmedia/socialmedia.twig' with {
28
25
  theme: "dark",
29
26
  headline: socialmedia.headline,
30
27
  icons: socialmedia.icons,
31
28
  } %}
32
- </div>
33
- {% endif %}
34
- {% if subscribe %}
35
- {% include '@components/button/button.twig' with {label: subscribe.label, url: subscribe.url, type: 'primary', size: 'large', target: '_blank'} %}
36
- {% endif %}
37
- </div>
38
- {% endif %}
39
- </div>
40
- <div class="{{prefix}}--footer--secondary">
41
- {% if legal %}
42
- <div class="legal">
43
- {{legal}}
44
- </div>
45
- {% endif %}
46
- {% if secondarylinks %}
47
- <nav class="secondarylinks">
48
- <ul class="secondarylinks--list">
49
- {% for link in secondarylinks %}
50
- <li class="secondarylinks--list--item">
51
- <a href="{{link.url}}" class="secondarylinks--list--link">{{link.label}}</a>
52
- </li>
53
- {% endfor %}
54
- </ul>
55
- </nav>
56
- {% endif %}
57
- {% if anchorlink %}
58
- <a href="{{anchorlink.href}}" class="anchorlink">{{anchorlink.label}}</a>
59
- {% endif %}
60
- </div>
29
+ </div>
30
+ </div>
31
+ {% endif %}
32
+ {% if subscribe %}
33
+ <div class="subscribe">
34
+ {% include '@components/button/button.twig' with {label: subscribe.label, url: subscribe.url, type: 'primary', size: 'large', target: '_blank'} %}
35
+ </div>
36
+ {% endif %}
37
+ </div>
38
+ <div class="{{prefix}}--footer--secondary">
39
+ <div class="{{prefix}}--container">
40
+ <div class="{{prefix}}--footer--secondary--details">
41
+ {% if legal %}
42
+ <div class="legal">
43
+ {{legal}}
44
+ </div>
45
+ {% endif %}
46
+ {% if secondarylinks %}
47
+ <nav class="secondarylinks">
48
+ <ul class="secondarylinks--list">
49
+ {% for link in secondarylinks %}
50
+ <li class="secondarylinks--list--item">
51
+ <a href="{{link.url}}" class="secondarylinks--list--link">{{link.label}}</a>
52
+ </li>
53
+ {% endfor %}
54
+ </ul>
55
+ </nav>
56
+ </div>
57
+ {% endif %}
58
+ {% if anchorlink %}
59
+ <a href="{{anchorlink.href}}" class="anchorlink">{{anchorlink.label}}</a>
60
+ {% endif %}
61
+ </div>
62
+ </div>
61
63
  </footer>
@@ -1,5 +1,5 @@
1
1
  footer:
2
- namespace: Components/Cards
2
+ namespace: Components/Navigation
3
3
  use: "@components/footer/footer.twig"
4
4
  label: Footer
5
5
  description: A component for displaying a page's footer
@@ -37,24 +37,18 @@ footer:
37
37
  description: "up to six links"
38
38
  preview:
39
39
  - links:
40
- - label: "Link One"
41
- url: "http://www.google.com"
42
- - label: "Link Two"
43
- url: "http://www.google.com"
44
- - label: "Link Three"
45
- url: "http://www.google.com"
46
- - label: "Link Four"
47
- url: "http://www.google.com"
48
- - label: "Link Five"
49
- url: "http://www.google.com"
50
- - label: "Link Six"
51
- url: "http://www.google.com"
40
+ - label: "Contact us"
41
+ url: "https://www.ilo.org"
42
+ - label: "Contact us"
43
+ url: "https://www.ilo.org"
44
+ - label: "Contact us"
45
+ url: "https://www.ilo.org"
52
46
  socialmedia:
53
47
  type: object
54
48
  label: social
55
49
  description: "Links to social media"
56
50
  preview:
57
- headline: "Connect with the ILO"
51
+ headline: "Stay informed"
58
52
  icons:
59
53
  - icon: "twitter"
60
54
  label: "Twitter"
@@ -82,8 +76,8 @@ footer:
82
76
  label: subscribe
83
77
  description: "a link to a subscribe form"
84
78
  preview:
85
- label: "Subscribe"
86
- url: "http://www.google.com"
79
+ label: "Subscribe for updates"
80
+ url: "https://www.ilo.org"
87
81
  legal:
88
82
  type: string
89
83
  label: legal
@@ -94,23 +88,19 @@ footer:
94
88
  label: secondarylinks
95
89
  description: "up to six links"
96
90
  preview:
97
- - label: "Link One"
91
+ - label: "Rights and permissions"
98
92
  url: "http://www.cnn.com"
99
- - label: "Link Two"
93
+ - label: "Privacy policy"
100
94
  url: "http://www.bing.com"
101
- - label: "Link Three"
95
+ - label: "Fraud alert"
102
96
  url: "http://www.yahoo.com"
103
- - label: "Link Four"
97
+ - label: "Disclaimer"
104
98
  url: "http://www.askjeeves.com"
105
- - label: "Link Five"
106
- url: "http://www.duckduckgo.com"
107
- - label: "Link Six"
108
- url: "http://www.aol.com"
109
99
  anchorlink:
110
100
  type: object
111
101
  label: anchorlink
112
102
  description: "an anchor href and label for navigating to another section on the page"
113
103
  preview:
114
- label: "Back to Top"
104
+ label: "Back to top"
115
105
  href: "#anchor"
116
106
  visibility: storybook
@@ -52,10 +52,18 @@
52
52
  {% include "@components/datepicker/datepicker.twig" with field|merge({ "prefix": prefix }) only %}
53
53
  {% elseif field.type == "dropdown" %}
54
54
  {% include "@components/dropdown/dropdown.twig" with field|merge({ "prefix": prefix }) only %}
55
- {% elseif field.type == "dropdown" %}
56
- {% include "@components/dropdown/dropdown.twig" with field|merge({ "prefix": prefix }) only %}
55
+ {% elseif field.type == "fileupload" %}
56
+ {% include "@components/fileupload/fileupload.twig" with field|merge({ "prefix": prefix }) only %}
57
+ {% elseif field.type == "numberpicker" %}
58
+ {% include "@components/numberpicker/numberpicker.twig" with field|merge({ "prefix": prefix }) only %}
59
+ {% elseif field.type == "radio" %}
60
+ {% include "@components/radio/radio.twig" with field|merge({ "prefix": prefix }) only %}
57
61
  {% elseif field.type == "search" %}
58
62
  {% include "@components/search/search.twig" with field|merge({ "prefix": prefix }) only %}
63
+ {% elseif field.type == "textarea" %}
64
+ {% include "@components/textarea/textarea.twig" with field|merge({ "prefix": prefix }) only %}
65
+ {% elseif field.type == "toggle" %}
66
+ {% include "@components/toggle/toggle.twig" with field|merge({ "prefix": prefix }) only %}
59
67
  {% endif %}
60
68
  {% endfor %}
61
69
  </div>
@@ -89,8 +89,33 @@ form:
89
89
  labelSize: small
90
90
  class: my--formfield--class
91
91
  value: 3
92
+ - legend: Which committee will you be attending?
93
+ direction: row
94
+ fields:
95
+ - type: radio
96
+ name: priority-1
97
+ label: Credentials committee
98
+ labelPlacement: end
99
+ labelSize: small
100
+ class: my--formfield--class
101
+ value: 1
102
+ - type: radio
103
+ name: priority-1
104
+ label: General Affairs Committee
105
+ labelPlacement: end
106
+ labelSize: small
107
+ class: my--formfield--class
108
+ value: 2
109
+ - type: radio
110
+ name: priority-1
111
+ label: Finance Committee
112
+ labelPlacement: end
113
+ labelSize: small
114
+ class: my--formfield--class
115
+ value: 3
92
116
  - legend: Tell us more about you
93
117
  direction: row
118
+ wrap: wrap
94
119
  style: "width: 100%"
95
120
  fields:
96
121
  - type: dropdown
@@ -99,7 +124,7 @@ form:
99
124
  labelPlacement: top
100
125
  labelSize: small
101
126
  class: my--formfield--class
102
- style: "flex: 1 1 49%"
127
+ style: "flex: 1 0 250px"
103
128
  options:
104
129
  - label: Switzerland
105
130
  value: CH
@@ -121,7 +146,7 @@ form:
121
146
  labelPlacement: top
122
147
  labelSize: small
123
148
  class: my--formfield--class
124
- style: "flex: 1 1 49%"
149
+ style: "flex: 1 0 250px"
125
150
  options:
126
151
  - label: Workers
127
152
  value: 1
@@ -131,6 +156,13 @@ form:
131
156
  value: 3
132
157
  - label: Other
133
158
  value: 4
159
+ - type: numberpicker
160
+ name: arrival-date
161
+ label: How many people are in your delegation?
162
+ labelPlacement: top
163
+ labelSize: small
164
+ class: my--formfield--class
165
+ style: "flex: 1 0 250px"
134
166
  - legend: When will you be coming to the ILC?
135
167
  direction: row
136
168
  style: "width: 100%"
@@ -149,3 +181,25 @@ form:
149
181
  labelSize: small
150
182
  class: my--formfield--class
151
183
  style: "flex: 1 1 49%"
184
+ - legend: Submit a copy of your passport
185
+ direction: row
186
+ style: "width: 100%"
187
+ fields:
188
+ - type: fileupload
189
+ name: arrival-date
190
+ label: PDF or JPG files up to 10MB
191
+ accept: ".pdf,.jpg"
192
+ placeholder: Select file
193
+ labelPlacement: end
194
+ labelSize: small
195
+ class: my--formfield--class
196
+ - direction: row
197
+ style: "width: 100%"
198
+ fields:
199
+ - type: textarea
200
+ name: comments
201
+ label: Do you have any questions or comments?
202
+ labelPlacement: top
203
+ labelSize: medium
204
+ class: my--formfield--class
205
+ style: "flex: 1 1 100%"
@@ -5,6 +5,9 @@
5
5
  {# Initialize ariaDescribedBy #}
6
6
  {% set ariaDescribedBy = [] %}
7
7
 
8
+ {# Initialize formControlClass #}
9
+ {% set formControlClass = formControlClass|default([]) %}
10
+
8
11
  {# if not defined id will be set to the value of name or to a random number #}
9
12
  {% if not id %}
10
13
  {% if name %}
@@ -38,7 +41,7 @@
38
41
  {% set errorClass = baseClass ~ "__error" %}
39
42
  {% set disabledClass = baseClass ~ "__disabled" %}
40
43
  {% set labelPlacementClass = baseClass ~ "__label-placement__" ~ labelPlacement|default("start") %}
41
- {% set formControlClass = [baseClass, class, labelPlacementClass] %}
44
+ {% set formControlClass = formControlClass|merge([baseClass, class, labelPlacementClass]) %}
42
45
 
43
46
  {% if error %}
44
47
  {% set formControlClass = formControlClass|merge([errorClass]) %}