@ilo-org/twig 0.1.3 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @ilo-org/twig
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 22bda9fb8: Rename tagset to Tags to match other components and work as an npm package
8
+
9
+ ### Patch Changes
10
+
11
+ - a3bd6c73c: Bugfixes for Form, Loading components
12
+ - aa8469ceb: Remove testing code from hero and add RTL style for tags
13
+ - da45da834: Bugfixes in several components
14
+ - 539894a90: Hero fixes for RTL and lack of image
15
+ - Updated dependencies [a3bd6c73c]
16
+ - Updated dependencies [aa8469ceb]
17
+ - Updated dependencies [da45da834]
18
+ - Updated dependencies [539894a90]
19
+ - Updated dependencies [22bda9fb8]
20
+ - @ilo-org/styles@0.1.5
21
+ - @ilo-org/icons@0.1.5
22
+ - @ilo-org/themes@0.1.5
23
+
24
+ ## 0.1.4
25
+
26
+ ### Patch Changes
27
+
28
+ - a8e627c45: Bugfixes in Form and Footer, and right-to-left styling for Form
29
+ - 9d25aa0e8: QA bugfixes for Nav Hero and Callout
30
+ - Updated dependencies [a8e627c45]
31
+ - Updated dependencies [9d25aa0e8]
32
+ - @ilo-org/icons@0.1.4
33
+ - @ilo-org/styles@0.1.4
34
+ - @ilo-org/themes@0.1.4
35
+
3
36
  ## 0.1.3
4
37
 
5
38
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilo-org/twig",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Twig components for the ILO's Design System",
6
6
  "main": "",
@@ -21,9 +21,9 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "@ilo-org/fonts": "0.0.2",
24
- "@ilo-org/icons": "0.1.3",
25
- "@ilo-org/styles": "0.1.3",
26
- "@ilo-org/themes": "0.1.3",
24
+ "@ilo-org/icons": "0.1.5",
25
+ "@ilo-org/styles": "0.1.5",
26
+ "@ilo-org/themes": "0.1.5",
27
27
  "@ilo-org/utils": "0.0.1",
28
28
  "@wingsuit-designsystem/preset-scss": "^1.2.3",
29
29
  "video.js": "^7.19.2"
@@ -13,5 +13,4 @@
13
13
  prefix: prefix
14
14
  } only %}
15
15
  {% endfor %}
16
- </ul>
17
- </div>
16
+ </ul>
@@ -19,7 +19,7 @@
19
19
  {% if buttonLabel %}
20
20
  <div class="{{prefix}}--callout--footer">
21
21
  <button
22
- class="{{prefix}}--button {{prefix}}--button--small {{prefix}}--button--tertiary"
22
+ class="{{prefix}}--button {{prefix}}--button--small {{prefix}}--button--secondary"
23
23
  type="button"
24
24
  >
25
25
  <span class="button__label">{{ buttonLabel }}</span>
@@ -36,7 +36,6 @@
36
36
  {% if enddata.error %}
37
37
  <span class="ilo--fieldset--error">{{enddata.error}}</span>
38
38
  {% endif %}
39
- </div>
40
39
  </fieldset>
41
40
  {% endif %}
42
41
  </div>
@@ -3,6 +3,9 @@
3
3
  TODO: This could stand to be more DRY
4
4
  #}
5
5
  <form class="{{prefix}}--form" id="{{formid}}" action="{{action}}" data-loadcomponent="Form">
6
+ {% if headline %}
7
+ <legend class="{{prefix}}--form--legend">{{headline}}</legend>
8
+ {% endif %}
6
9
  {% for item in items %}
7
10
  {% if item.type == "formgroup" %}
8
11
  <fieldset class="{{prefix}}--formgroup {{prefix}}--fieldset">
@@ -31,7 +34,7 @@
31
34
  {% endif %}
32
35
  {% for f in i.field %}
33
36
  <div class="{{prefix}}--fieldset--input--{{i.type}}">
34
- <label class="{{prefix}}--fieldset--label" for="{% if f.id %}{{f.id}}{% else %}{{f.name}}{% endif %}">{{f.label}}</label>
37
+ <label class="{{prefix}}--fieldset--label" for="{% if f.id is defined and f.id is not empty %}{{f.id}}{% else %}{{f.name}}{% endif %}">{{f.label}}</label>
35
38
  {% if i.type == "radio" %}
36
39
  {% include '@components/form/radio.twig' with f %}
37
40
  {% else %}
@@ -70,7 +73,7 @@
70
73
  {% endif %}
71
74
  {% for f in item.field %}
72
75
  <div class="{{prefix}}--fieldset--input--{{item.type}}">
73
- <label class="{{prefix}}--fieldset--label" for="{% if f.id %}{{f.id}}{% else %}{{f.name}}{% endif %}">{{f.label}}</label>
76
+ <label class="{{prefix}}--fieldset--label" for="{% if f.id is defined and f.id is not empty %}{{f.id}}{% else %}{{f.name}}{% endif %}">{{f.label}}</label>
74
77
  {% if item.type == "radio" %}
75
78
  {% include '@components/form/radio.twig' with f %}
76
79
  {% else %}
@@ -9,6 +9,11 @@ form:
9
9
  description: The form's action attribute
10
10
  preview: "http://www.ilo.org"
11
11
  required: true
12
+ headline:
13
+ type: string
14
+ label: Headline
15
+ description: Optional form headline
16
+ preview: ""
12
17
  formid:
13
18
  type: string
14
19
  label: formid
@@ -171,26 +176,26 @@ form:
171
176
  type: "checkbox"
172
177
  legend: "Multiple Checkboxes"
173
178
  type: "checkbox"
174
- - choicegroupid: "radios"
179
+ - choicegroupid: "radios2"
175
180
  field:
176
181
  - label: "Radio Field Label 1"
177
- name: "radio"
182
+ name: "radio2"
178
183
  type: "radio"
179
184
  value: "radio1"
180
185
  - label: "Radio Field Label 2"
181
- name: "radio"
186
+ name: "radio2"
182
187
  type: "radio"
183
188
  value: "radio2"
184
189
  - label: "Radio Field Label 3"
185
- name: "radio"
190
+ name: "radio2"
186
191
  type: "radio"
187
192
  value: "radio3"
188
193
  - label: "Radio Field Label 4"
189
- name: "radio"
194
+ name: "radio2"
190
195
  type: "radio"
191
196
  value: "radio4"
192
197
  - label: "Radio Field Label 5"
193
- name: "radio"
198
+ name: "radio2"
194
199
  type: "radio"
195
200
  value: "radio5"
196
201
  grouphelper: "Helper text"
@@ -1,15 +1,18 @@
1
1
  {#
2
2
  HERO COMPONENT
3
3
  #}
4
-
5
4
  <div class="{{prefix}}--hero {{prefix}}--hero--{{theme}} {{prefix}}--hero--{{types}} {% if image %}{{prefix}}--hero--image{% endif %}">
6
- {% include "@components/image/image.twig" with {
7
- alt: image.alt,
8
- caption: image.caption,
9
- credit: image.credit,
10
- prefix: prefix,
11
- url: image.url,
12
- } only %}
5
+
6
+ {% if not image %}
7
+ {% else %}
8
+ {% include "@components/image/image.twig" with {
9
+ alt: image.alt,
10
+ caption: image.caption,
11
+ credit: image.credit,
12
+ prefix: prefix,
13
+ url: image.url,
14
+ } only %}
15
+ {% endif %}
13
16
  {% include "@components/herocard/herocard.twig" with {
14
17
  alignment: herocard.alignment,
15
18
  eyebrow: herocard.eyebrow,
@@ -30,6 +30,17 @@ hero:
30
30
  url: "https://www.linkedin.com/"
31
31
  icon: "linkedin"
32
32
  title: "This is an left aligned article headline that is more than two lines long"
33
+ variants:
34
+ default:
35
+ lable: Default
36
+ article:
37
+ label: Article
38
+ description: article settings
39
+ fields:
40
+ image: ""
41
+ settings:
42
+ theme: light
43
+ types: article
33
44
  settings:
34
45
  theme:
35
46
  type: select
@@ -3,6 +3,19 @@ loading:
3
3
  label: Loading
4
4
  description: The Loading component displays a loading state. (See Javascript comments in loading.js for how to use this with vanilla JS).
5
5
  fields:
6
+ message:
7
+ type: string
8
+ label: Message
9
+ description: The loading message
10
+ preview: 'Submitting'
11
+ required: true
12
+ loadedmessage:
13
+ type: string
14
+ label: LOaded Message
15
+ description: The loaded message
16
+ preview: 'Completed'
17
+ required: true
18
+ settings:
6
19
  size:
7
20
  type: select
8
21
  label: Size
@@ -22,16 +35,4 @@ loading:
22
35
  loading: Loading
23
36
  loaded: Loaded
24
37
  preview: 'loading'
25
- message:
26
- type: string
27
- label: Message
28
- description: The loading message
29
- preview: 'Submitting'
30
- required: true
31
- loadedmessage:
32
- type: string
33
- label: LOaded Message
34
- description: The loaded message
35
- preview: 'Completed'
36
- required: true
37
38
  visibility: storybook
@@ -88,8 +88,8 @@ navigation:
88
88
  preview:
89
89
  action: "http://www.ilo.org"
90
90
  input:
91
- label: "Search Field Label"
92
- helper: "The search field's helper text"
91
+ label: ""
92
+ helper: ""
93
93
  name: "text"
94
94
  placeholder: "Search Field"
95
95
  type: "text"
@@ -2,6 +2,6 @@
2
2
  * tag
3
3
  */
4
4
  // Module template
5
- import './tag-set.twig';
6
- import './tagset.wingsuit.yml';
5
+ import './tags.twig';
6
+ import './tags.wingsuit.yml';
7
7
  import './tag.behavior';
@@ -1,4 +1,4 @@
1
- import Tag from './tagset';
1
+ import Tag from './tag';
2
2
 
3
3
  Drupal.behaviors.tag = {
4
4
  attach() {
@@ -1,6 +1,6 @@
1
1
  import './index';
2
2
 
3
- const patternDefinition = require('./tagset.wingsuit.yml');
3
+ const patternDefinition = require('./tags.wingsuit.yml');
4
4
 
5
5
  export const wingsuit = {
6
6
  patternDefinition,
@@ -2,20 +2,20 @@
2
2
  TAG COMPONENT
3
3
  #}
4
4
  {% if tagType == "button" and defaultActive %}
5
- <li class="{{prefix}}--tag-set__item">
5
+ <li class="{{prefix}}--tags__item">
6
6
  <button class="{{prefix}}--tag {{prefix}}--tag--button {{prefix}}--tag--active icon__position--right" id="{{ id }}" data-active={{ defaultActive }} type="button">
7
7
  {{content}}
8
8
  <span class="ilo--icon" title="Remove"></span>
9
9
  </button>
10
10
  </li>
11
11
  {% elseif tagType == "anchor" %}
12
- <li class="{{prefix}}--tag-set__item">
12
+ <li class="{{prefix}}--tags__item">
13
13
  <a class="{{prefix}}--tag {{prefix}}--tag--anchor {% if defaultActive %} {{prefix}}--tag--active{% endif %}" href="{{ url }}" id="{{ id }}" data-active={{ defaultActive }}>
14
14
  {{content}}
15
15
  </a>
16
16
  </li>
17
17
  {% elseif tagType == "display" %}
18
- <li class="{{prefix}}--tag-set__item">
18
+ <li class="{{prefix}}--tags__item">
19
19
  <span class="{{prefix}}--tag {% if defaultActive %} {{prefix}}--tag--active{% endif %}" id="{{ id }}" data-active={{ defaultActive }}>
20
20
  {{content}}
21
21
  </span>
@@ -1,5 +1,5 @@
1
1
  tag:
2
- use: '@components/tag/tag.twig'
2
+ use: '@components/tags/tag.twig'
3
3
  label: Tag
4
4
  description: A clickable tag
5
5
  fields:
@@ -1,9 +1,9 @@
1
1
  {#
2
- TAG SET COMPONENT
2
+ TAGS COMPONENT
3
3
  #}
4
- <ul class="ilo--tag-set" data-loadcomponent="Tag" data-multipleactive="{{ allowMultipleActive|default(true) }}">
4
+ <ul class="ilo--tags" data-loadcomponent="Tag" data-multipleactive="{{ allowMultipleActive|default(true) }}">
5
5
  {% for item in items %}
6
- {% include "@components/tag/tag.twig" with {
6
+ {% include "@components/tags/tag.twig" with {
7
7
  content: item.content,
8
8
  defaultActive: item.defaultActive,
9
9
  id: item.id,
@@ -1,6 +1,6 @@
1
- tagset:
2
- use: '@components/tag/tag-set.twig'
3
- label: Tag Set
1
+ tags:
2
+ use: '@components/tags/tags.twig'
3
+ label: Tags
4
4
  description: A set of tags
5
5
  fields:
6
6
  items: