@ilo-org/twig 0.14.2 → 0.14.4

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.
@@ -1,9 +1,9 @@
1
1
 
2
- > @ilo-org/twig@0.14.2 build:lib /home/runner/work/designsystem/designsystem/packages/twig
2
+ > @ilo-org/twig@0.14.4 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.14.2 output /home/runner/work/designsystem/designsystem/packages/twig
7
+ > @ilo-org/twig@0.14.4 output /home/runner/work/designsystem/designsystem/packages/twig
8
8
  > node outputtwigs.js
9
9
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @ilo-org/twig
2
2
 
3
+ ## 0.14.4
4
+
5
+ ### Patch Changes
6
+
7
+ - f557eb372: breadcrumbs: added check for context items
8
+
9
+ ## 0.14.3
10
+
11
+ ### Patch Changes
12
+
13
+ - ba3fdf8fc: Update how the breakpoints are set on the Hero twig component.
14
+ - fb6b65ec3: Fix alignment value to be used from cardgroup and passed on to the card
15
+ - e077aa740: Add a condition to check the breakpoint value.
16
+ - 67ac66a79: Refactor option label to be a child component instead of an attribute to improve screen reader experience
17
+ - e34e17292: Add optional name paramater that will pass a string to the button element's underlying name attribute
18
+ - d74d0161f: Refactor card heading from h5 to h3 to ensure headings are in sequential order to improve accessibility
19
+ - d0e3e8c87: Add optional string modalLabel parameter to be used as aria-label attribute in modal
20
+ - 261413766: Add block to wrap label, as required in Drupal development.
21
+ - 1ddab579a: Refactor tab role to be in the proper child element in tabs so that they peform their intended accessibility functions
22
+ - Updated dependencies [16dea2974]
23
+ - Updated dependencies [0d0341a3c]
24
+ - @ilo-org/styles@0.13.2
25
+
3
26
  ## 0.14.2
4
27
 
5
28
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilo-org/twig",
3
- "version": "0.14.2",
3
+ "version": "0.14.4",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Twig components for the ILO's Design System",
6
6
  "main": "",
@@ -26,7 +26,7 @@
26
26
  "@ilo-org/brand-assets": "0.2.0",
27
27
  "@ilo-org/fonts": "0.1.2",
28
28
  "@ilo-org/icons": "0.2.1",
29
- "@ilo-org/styles": "0.13.1",
29
+ "@ilo-org/styles": "0.13.2",
30
30
  "@ilo-org/themes": "0.7.0",
31
31
  "@ilo-org/utils": "0.0.11"
32
32
  },
@@ -76,7 +76,9 @@ export default class Breadcrumb {
76
76
  */
77
77
  enable() {
78
78
  window.addEventListener(EVENTS.RESIZE, (e) => this.onResize(e));
79
- this.ContextButton.addEventListener(EVENTS.CLICK, () => this.onClick());
79
+ if (this.ContextButton) {
80
+ this.ContextButton.addEventListener(EVENTS.CLICK, () => this.onClick());
81
+ }
80
82
 
81
83
  return this;
82
84
  }
@@ -88,14 +90,15 @@ export default class Breadcrumb {
88
90
  * @chainable
89
91
  */
90
92
  onResize() {
91
- if (this.breadcrumbwidth > this.element.offsetWidth / 2) {
92
- this.element.classList.add("contextmenu");
93
- this.ContextMenu.classList.remove("open");
94
- } else {
95
- this.element.classList.remove("contextmenu");
96
- this.ContextMenu.classList.remove("open");
93
+ if (this.ContextMenu) {
94
+ if (this.breadcrumbwidth > this.element.offsetWidth / 2) {
95
+ this.element.classList.add("contextmenu");
96
+ this.ContextMenu.classList.remove("open");
97
+ } else {
98
+ this.element.classList.remove("contextmenu");
99
+ this.ContextMenu.classList.remove("open");
100
+ }
97
101
  }
98
-
99
102
  return this;
100
103
  }
101
104
 
@@ -106,7 +109,7 @@ export default class Breadcrumb {
106
109
  * @chainable
107
110
  */
108
111
  onClick() {
109
- if (this.element.classList.contains("contextmenu")) {
112
+ if (this.ContextMenu) {
110
113
  if (this.ContextMenu.classList.contains("open")) {
111
114
  this.ContextMenu.classList.remove("open");
112
115
  } else {
@@ -10,7 +10,7 @@
10
10
  {% endif %}
11
11
  </a>
12
12
  {% else %}
13
- <button class="{{prefix}}--button ilo--button--{{size}} {{prefix}}--button--{{type}}{% if icon %} icon icon__position--{{iconPosition}}{% endif %}{% if icononly %} icon--only{% endif %}{% if className %} {{className}}{% endif %}" {% if kind %} type="{{kind}}" {% endif %} {% if opensmodal %} aria-haspopup="dialog" {% endif %} {% if disabled is defined and disabled == 'true' %} disabled {% endif %}>
13
+ <button class="{{prefix}}--button ilo--button--{{size}} {{prefix}}--button--{{type}}{% if icon %} icon icon__position--{{iconPosition}}{% endif %}{% if icononly %} icon--only{% endif %}{% if className %} {{className}}{% endif %}" {% if kind %} type="{{kind}}" {% endif %} {% if opensmodal %} aria-haspopup="dialog" {% endif %} {% if disabled is defined and disabled == 'true' %} disabled {% endif %} {% if name %} name="{{name}}" {% endif %}>
14
14
 
15
15
  <span class="button__label">{{label}}</span>
16
16
  {% if icon %}
@@ -10,6 +10,12 @@ button:
10
10
  description: The label for the button
11
11
  preview: "Button"
12
12
  required: true
13
+ name:
14
+ type: string
15
+ label: Name
16
+ description: The name for the button
17
+ preview: "button"
18
+ required: false
13
19
  url:
14
20
  type: string
15
21
  label: url
@@ -21,7 +21,7 @@
21
21
  <p class="{{prefix}}--card--eyebrow">{{eyebrow}}</p>
22
22
  {% endif %}
23
23
  {% if title %}
24
- <h5 class="{{prefix}}--card--title">{{title}}</h5>
24
+ <h3 class="{{prefix}}--card--title">{{title}}</h3>
25
25
  {% endif %}
26
26
  {% if intro %}
27
27
  <p class="{{prefix}}--card--intro">{{intro}}</p>
@@ -5,7 +5,7 @@
5
5
  <div class="{{prefix}}--card--wrap">
6
6
  <div class="{{prefix}}--card--content">
7
7
  {% if title %}
8
- <h5 class="{{prefix}}--card--title">{{title}}</h5>
8
+ <h3 class="{{prefix}}--card--title">{{title}}</h3>
9
9
  {% endif %}
10
10
  {% if list %}
11
11
  {% include "@components/list/list.twig" with {
@@ -21,7 +21,7 @@
21
21
  <p class="{{prefix}}--card--eyebrow">{{eyebrow}}</p>
22
22
  {% endif %}
23
23
  {% if title %}
24
- <h5 class="{{prefix}}--card--title">{{title}}</h5>
24
+ <h3 class="{{prefix}}--card--title">{{title}}</h3>
25
25
  {% endif %}
26
26
  {% if date %}
27
27
  <time class="{{prefix}}--card--date" datetime="{{date.unix}}">{{date.human}}</time>
@@ -21,7 +21,7 @@
21
21
  <p class="{{prefix}}--card--eyebrow">{{eyebrow}}</p>
22
22
  {% endif %}
23
23
  {% if title %}
24
- <h5 class="{{prefix}}--card--title">{{title}}</h5>
24
+ <h3 class="{{prefix}}--card--title">{{title}}</h3>
25
25
  {% endif %}
26
26
  {% if image %}
27
27
  <div class="{{prefix}}--card--image--wrapper">
@@ -13,7 +13,7 @@
13
13
  <p class="{{prefix}}--card--eyebrow">{{eyebrow}}</p>
14
14
  {% endif %}
15
15
  {% if title %}
16
- <h5 class="{{prefix}}--card--title">{{title}}</h5>
16
+ <h3 class="{{prefix}}--card--title">{{title}}</h3>
17
17
  {% endif %}
18
18
  {% if intro %}
19
19
  <p class="{{prefix}}--card--intro">{{intro}}</p>
@@ -5,7 +5,7 @@
5
5
  <div class="{{prefix}}--card--wrap">
6
6
  <div class="{{prefix}}--card--content">
7
7
  {% if title %}
8
- <h5 class="{{prefix}}--card--title">{{title}}</h5>
8
+ <h3 class="{{prefix}}--card--title">{{title}}</h3>
9
9
  {% endif %}
10
10
  {% if intro %}
11
11
  <p class="{{prefix}}--card--intro">{{intro}}</p>
@@ -13,7 +13,7 @@
13
13
  <p class="{{prefix}}--card--eyebrow">{{eyebrow}}</p>
14
14
  {% endif %}
15
15
  {% if title %}
16
- <h5 class="{{prefix}}--card--title">{{title}}</h5>
16
+ <h3 class="{{prefix}}--card--title">{{title}}</h3>
17
17
  {% endif %}
18
18
  {% if date %}
19
19
  <time class="{{prefix}}--card--date" datetime="{{date.unix}}">{{date.human}}</time>
@@ -24,7 +24,7 @@
24
24
  linklist: card.linklist,
25
25
  list: card.list,
26
26
  title: card.title,
27
- alignment: card.alignment,
27
+ alignment: alignment,
28
28
  color: card.color,
29
29
  cornercut: card.cornercut,
30
30
  source: card.source,
@@ -36,6 +36,14 @@ cardgroup:
36
36
  narrow: narrow
37
37
  wide: wide
38
38
  fluid: fluid
39
+ alignment:
40
+ type: select
41
+ label: Alignment
42
+ description: Positions the image to the right or to the left of the content when the card is displayed in a `wide` or `fluid` size. Has no effect if the card is displayed in a `standard` or `narrow` size. Only used by `Multilink Card`.
43
+ preview: "left"
44
+ options:
45
+ left: Left
46
+ right: Right
39
47
  theme:
40
48
  type: select
41
49
  label: Theme
@@ -10,11 +10,13 @@
10
10
  {% endif %}
11
11
 
12
12
  {% block formfield %}
13
- <div class="{{ baseClass }}--wrapper" {% if style %} style="{{ style }}" {% endif %}>
14
- <select id="{{ id|default(name) }}" autocomplete="{{ autocomplete|default('off') }}" name="{{ name }}" {% if required %} required {% endif %} {% if onBlur %} onblur="{{ onBlur }}" {% endif %} {% if disabled %} disabled {% endif %} class="{{ dropdownClasses|join(' ') }}" value="{{ currentvalue|default(value) }}" {% if form %} form="{{ form }}" {% endif %} {% if multiple %} multiple {% endif %} {% if selectSize %} size="{{ selectSize }}" {% endif %} {% if ariaDescribedBy %} aria-describedby="{{ ariaDescribedBy }}" {% endif %}>
15
- {% for option in options %}
16
- <option {% if option.disabled %} disabled {% endif %} label="{{ option.label }}" value="{{ option.value }}" {% if defaultOption and defaultOption == option.value%}} selected {% endif %}></option>
17
- {% endfor %}
18
- </select>
19
- </div>
13
+ <div class="{{ baseClass }}--wrapper" {% if style %} style="{{ style }}" {% endif %}>
14
+ <select id="{{ id|default(name) }}" autocomplete="{{ autocomplete|default('off') }}" name="{{ name }}" {% if required %} required {% endif %} {% if onBlur %} onblur="{{ onBlur }}" {% endif %} {% if disabled %} disabled {% endif %} class="{{ dropdownClasses|join(' ') }}" value="{{ currentvalue|default(value) }}" {% if form %} form="{{ form }}" {% endif %} {% if multiple %} multiple {% endif %} {% if selectSize %} size="{{ selectSize }}" {% endif %} {% if ariaDescribedBy %} aria-describedby="{{ ariaDescribedBy }}" {% endif %}>
15
+ {% for option in options %}
16
+ <option {% if option.disabled %} disabled {% endif %} value="{{ option.value }}" {% if defaultOption and defaultOption == option.value %} selected {% endif %}>
17
+ {{ option.label }}
18
+ </option>
19
+ {% endfor %}
20
+ </select>
21
+ </div>
20
22
  {% endblock %}
@@ -62,7 +62,9 @@
62
62
  <div class="{{ formControlClass|join(' ') }}" {% if style %} style="{{ style }}" {% endif %}>
63
63
  {% if label %}
64
64
  <span class="{{ labelClass|join(' ') }}">
65
- <label for="{{ id }}">{{ label }}</label>
65
+ {% block label %}
66
+ <label for="{{ id }}">{{ label }}</label>
67
+ {% endblock %}
66
68
  {% if tooltip %}
67
69
  {% include '@components/tooltip/tooltip.twig' with {
68
70
  "icon": true,
@@ -10,7 +10,11 @@
10
10
  <picture class="hero--image">
11
11
  {% for img in image.url|reverse %}
12
12
  {% if loop.last == false %}
13
- <source srcset="{{img.src}}" media="(min-width: {{img.breakpoint}}px)">
13
+ {% if img.breakpoint matches '/^\\d+$/' %}
14
+ <source srcset="{{img.src}}" media="(min-width: {{img.breakpoint}}px)">
15
+ {% else %}
16
+ <source srcset="{{img.src}}" media="{{img.breakpoint}}">
17
+ {% endif %}
14
18
  {% endif %}
15
19
  {% endfor %}
16
20
  <img class="{{prefix}}--card--image" src="{{image.url|reverse|last.src}}" alt="{{image.alt}}" {% if image.loading %} loading="{{ image.loading }}" {% endif %}>
@@ -7,7 +7,7 @@
7
7
  {% if component != 'modal' %}
8
8
  <div class="{{prefix}}--modal" data-loadcomponent="Modal" data-prefix="{{prefix}}">
9
9
  {% include '@components/button/button.twig' with openbutton %}
10
- <div class="{{prefix}}--modal--wrapper" aria-modal="true" role="alertdialog">
10
+ <div class="{{prefix}}--modal--wrapper" {% if modalLabel %} aria-label="{{modalLabel}}" {% endif %} aria-modal="true" role="alertdialog">
11
11
  <div class="{{prefix}}--modal--background" role="presentation"></div>
12
12
  <div class="{{prefix}}--modal--contents">
13
13
  {% block modal_content %}
@@ -52,4 +52,10 @@ modal:
52
52
  className: "modal--open"
53
53
  opensmodal: true
54
54
  required: true
55
+ modalLabel:
56
+ type: string
57
+ label: Modal Label
58
+ description: A modal label added to aria-label attribute to improve accessibility
59
+ preview: "modal"
60
+ required: false
55
61
  visibility: storybook
@@ -9,8 +9,8 @@
9
9
  <div class="{{prefix}}--tabs" data-prefix="{{prefix}}" id="tabs--{{uid}}" data-loadcomponent="Tabs">
10
10
  <ul class="{{prefix}}--tabs--selection" aria-controls="tabs--{{uid}}" role="tablist" style="--tabscount: {{items|length}};">
11
11
  {% for item in items %}
12
- <li class="{{prefix}}--tabs--selection--item">
13
- <a href="#tab--{{tabids[loop.index - 1]}}" class="{{prefix}}--tabs--selection--button{% if item.icon is defined %} icon{% endif %}" role="tab" aria-controls="tab--{{tabids[loop.index - 1]}}" tabindex="0" aria-selected="{% if loop.index == 1 %}true{% else %}false{% endif %}" title="{{item.label}}">
12
+ <li class="{{prefix}}--tabs--selection--item" role="tab">
13
+ <a href="#tab--{{tabids[loop.index - 1]}}" class="{{prefix}}--tabs--selection--button{% if item.icon is defined %} icon{% endif %}" aria-controls="tab--{{tabids[loop.index - 1]}}" tabindex="0" aria-selected="{% if loop.index == 1 %}true{% else %}false{% endif %}" title="{{item.label}}">
14
14
  <span class="{{prefix}}--tabs--selection--label">{{item.label}}</span>
15
15
  {% if item.icon is defined %}
16
16
  {% include '@components/icon/icon.twig' with {icon: item.icon} %}