@ilo-org/twig 0.14.6 → 0.15.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.
@@ -1,9 +1,9 @@
1
1
 
2
- > @ilo-org/twig@0.14.6 build:lib /home/runner/work/designsystem/designsystem/packages/twig
2
+ > @ilo-org/twig@0.15.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.14.6 output /home/runner/work/designsystem/designsystem/packages/twig
7
+ > @ilo-org/twig@0.15.0 output /home/runner/work/designsystem/designsystem/packages/twig
8
8
  > node outputtwigs.js
9
9
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @ilo-org/twig
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 4153f99b5: Removed black bars from youtube ebedded video
8
+ - 1ed3123ae: Re-implemented video.js styles
9
+
10
+ ### Patch Changes
11
+
12
+ - 9bf73c7bd: Fix lists containing other elements than li items to improve accessibility
13
+ - a3c872512: separated labels for breadcrumbs
14
+ - 056754038: Revise and refactor color names with the same values and remove duplicates and replace where it was used
15
+ - e1000fbbd: added legacy classname for react video component
16
+ - Updated dependencies [4153f99b5]
17
+ - Updated dependencies [c8de2b695]
18
+ - Updated dependencies [7472dd625]
19
+ - Updated dependencies [b3298a267]
20
+ - Updated dependencies [bf4432d7c]
21
+ - Updated dependencies [1ed3123ae]
22
+ - Updated dependencies [f76a35fdc]
23
+ - Updated dependencies [a3c872512]
24
+ - Updated dependencies [056754038]
25
+ - Updated dependencies [4bbac5457]
26
+ - Updated dependencies [e1000fbbd]
27
+ - Updated dependencies [ac58b53d2]
28
+ - Updated dependencies [51b20d4aa]
29
+ - Updated dependencies [5a1e32f8e]
30
+ - Updated dependencies [52eeae214]
31
+ - Updated dependencies [709675b79]
32
+ - @ilo-org/styles@0.13.3
33
+ - @ilo-org/brand-assets@0.4.0
34
+ - @ilo-org/themes@0.7.1
35
+
3
36
  ## 0.14.6
4
37
 
5
38
  ### Patch Changes
@@ -17,7 +17,7 @@ export default create({
17
17
  colorSecondary: brand["ilo-blue"].value,
18
18
 
19
19
  // UI
20
- appBg: brand["ilo-lighter-blue"].value,
20
+ appBg: brand["ilo-light-blue"].value,
21
21
  appContentBg: brand["ilo-white"].value,
22
22
  appBorderColor: brand["ilo-grey-ui"].value,
23
23
  appBorderRadius: 0,
@@ -37,9 +37,9 @@ export default create({
37
37
 
38
38
  buttonBg: brand["ilo-white"].value,
39
39
  buttonBorder: brand["ilo-grey-ui"].value,
40
- booleanBg: brand["ilo-lighter-blue"].value,
40
+ booleanBg: brand["ilo-light-blue"].value,
41
41
  booleanSelectedBg: brand["ilo-white"].value,
42
- inputBg: brand["ilo-lighter-blue"].value,
42
+ inputBg: brand["ilo-light-blue"].value,
43
43
  inputBorder: brand["ilo-grey-ui"].value,
44
44
  inputTextColor: brand["ilo-dark-blue"].value,
45
45
  inputBorderRadius: 3,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilo-org/twig",
3
- "version": "0.14.6",
3
+ "version": "0.15.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Twig components for the ILO's Design System",
6
6
  "main": "",
@@ -21,13 +21,14 @@
21
21
  "components"
22
22
  ],
23
23
  "dependencies": {
24
- "@popperjs/core": "^2.11.8",
25
24
  "video.js": "^7.21.2",
26
- "@ilo-org/brand-assets": "0.3.1",
25
+ "videojs-youtube": "^3.0.1",
26
+ "@popperjs/core": "^2.11.8",
27
+ "@ilo-org/brand-assets": "0.4.0",
27
28
  "@ilo-org/fonts": "0.1.2",
28
29
  "@ilo-org/icons": "0.2.1",
29
- "@ilo-org/styles": "0.13.2",
30
- "@ilo-org/themes": "0.7.0",
30
+ "@ilo-org/styles": "0.13.3",
31
+ "@ilo-org/themes": "0.7.1",
31
32
  "@ilo-org/utils": "0.0.11"
32
33
  },
33
34
  "devDependencies": {
@@ -24,7 +24,7 @@
24
24
  {% if not loop.first and not loop.last %}
25
25
  <li class="{{prefix}}--breadcrumb--item">
26
26
  <a href="{{link.url}}" class="{{prefix}}--breadcrumb--link">
27
- <span class="{{prefix}}--breadcrumb--link--label">{{link.label}}</span>
27
+ <span class="{{prefix}}--breadcrumb--link--label--dropdown">{{link.label}}</span>
28
28
  </a>
29
29
  </li>
30
30
  {% endif %}
@@ -22,7 +22,7 @@ breadcrumb:
22
22
  url: "/linkone"
23
23
  - label: "Link Two"
24
24
  url: "/linktwo"
25
- - label: "Link Three"
25
+ - label: "Link Three a long link that will wrap to the next line"
26
26
  url: "/linkthree"
27
27
  - label: "Link Four"
28
28
  url: "/linkfour"
@@ -55,7 +55,7 @@
55
55
  {% include '@components/tooltip/tooltip.twig' with {
56
56
  prefix: prefix,
57
57
  label: caption.label,
58
- icon: true,
58
+ icon: "true",
59
59
  theme: "dark",
60
60
  icontheme: "dark"
61
61
  } only %}
@@ -1,30 +1,29 @@
1
1
  {#
2
2
  LIST COMPONENT
3
3
  #}
4
- {% if ordered == "ordered" %}
5
- <ol class="ilo--list ilo--list--{{ ordered|default('ordered') }}" data-loadcomponent="List">
4
+ <div class="ilo--list ilo--list--{% if ordered == 'ordered' %}ordered{% endif %}{{alignment|default('') }}">
6
5
  {% if title %}
7
6
  <h5 class="ilo--list__title">{{ title }}</h5>
8
7
  {% endif %}
9
- {% for item in items %}
10
- {% include "@components/list/list-item.twig" with {
11
- label: item.label,
12
- content: item.content,
13
- id: item.id,
14
- } only %}
15
- {% endfor %}
16
- </ol>
17
- {% else %}
18
- <ul class="ilo--list ilo--list--{{ ordered|default('unordered') }} ilo--list--{{ alignment|default('') }}" data-loadcomponent="List">
19
- {% if title %}
20
- <h5 class="ilo--list__title">{{ title }}</h5>
8
+ {% if ordered == "ordered" %}
9
+ <ol data-loadcomponent="List">
10
+ {% for item in items %}
11
+ {% include "@components/list/list-item.twig" with {
12
+ label: item.label,
13
+ content: item.content,
14
+ id: item.id,
15
+ } only %}
16
+ {% endfor %}
17
+ </ol>
18
+ {% else %}
19
+ <ul class="ilo--list--{{ alignment|default('') }}" data-loadcomponent="List">
20
+ {% for item in items %}
21
+ {% include "@components/list/list-item.twig" with {
22
+ label: item.label,
23
+ content: item.content,
24
+ id: item.id,
25
+ } only %}
26
+ {% endfor %}
27
+ </ul>
21
28
  {% endif %}
22
- {% for item in items %}
23
- {% include "@components/list/list-item.twig" with {
24
- label: item.label,
25
- content: item.content,
26
- id: item.id,
27
- } only %}
28
- {% endfor %}
29
- </ul>
30
- {% endif %}
29
+ </div>
@@ -2,7 +2,7 @@ pagination:
2
2
  namespace: Components/Navigation
3
3
  use: "@components/pagination/pagination.twig"
4
4
  label: Pagination
5
- description: The Pagination component presents a dismissible alert.
5
+ description: The Pagination component breaks content into pages for easier navigation with intuitive controls like 'Previous' and 'Next' buttons.
6
6
  fields:
7
7
  currentPage:
8
8
  type: numeric
@@ -1,4 +1,4 @@
1
- import { EVENTS } from "@ilo-org/utils";
1
+ import "videojs-youtube";
2
2
  import videojs from "video.js";
3
3
 
4
4
  /**
@@ -37,11 +37,7 @@ export default class Video {
37
37
  * @chainable
38
38
  */
39
39
  init() {
40
- this.cacheDomReferences()
41
- .start()
42
- .cacheVideoReferences()
43
- .setupHandlers()
44
- .enable();
40
+ this.cacheDomReferences().start().setupHandlers().enable();
45
41
 
46
42
  return this;
47
43
  }
@@ -64,28 +60,6 @@ export default class Video {
64
60
  return this;
65
61
  }
66
62
 
67
- /**
68
- * Find all necessary DOM elements inside videojs
69
- *
70
- * @return {Object} Video A reference to the instance of the class
71
- * @chainable
72
- */
73
- cacheVideoReferences() {
74
- /**
75
- * The button for video play control
76
- * @type {?Element}
77
- */
78
- this.PlayButton = this.element.querySelector(".vjs-play-control");
79
-
80
- /**
81
- * The duration display
82
- * @type {?Element}
83
- */
84
- this.Duration = this.element.querySelector(".vjs-duration");
85
-
86
- return this;
87
- }
88
-
89
63
  /**
90
64
  * Bind event handlers with the proper context of `this`.
91
65
  *
@@ -93,29 +67,19 @@ export default class Video {
93
67
  * @chainable
94
68
  */
95
69
  setupHandlers() {
96
- this.onDurationHover = this.onDurationHover.bind(this);
97
-
98
70
  return this;
99
71
  }
100
72
 
101
73
  /**
102
- * Creates event listeners to fix duration hover
103
- * https://github.com/international-labour-organization/designsystem/issues/521
74
+ * Creates event listeners to enable interaction with view
104
75
  *
105
76
  * @return {Object} Video A reference to the instance of the class
106
77
  * @chainable
107
78
  */
108
79
  enable() {
109
- if (!this.Duration) return this;
110
- this.Duration.addEventListener(EVENTS.MOUSEOVER, () =>
111
- this.onDurationHover(true)
112
- );
113
- this.Duration.addEventListener(EVENTS.MOUSEOUT, () => {
114
- this.onDurationHover(false);
115
- });
116
-
117
80
  return this;
118
81
  }
82
+
119
83
  /**
120
84
  * Starts up videojs
121
85
  *
@@ -146,25 +110,11 @@ export default class Video {
146
110
  sources: [
147
111
  { type: this.element.dataset.vjsType, src: this.element.dataset.src },
148
112
  ],
113
+ dataSetup: {
114
+ techOrder: ["youtube"],
115
+ },
149
116
  });
150
117
 
151
118
  return this;
152
119
  }
153
-
154
- /**
155
- * Controls duration hover
156
- *
157
- * @param {boolean} state - whether or not the duration is hovered
158
- * @return {Object} Video A reference to the instance of the class
159
- * @chainable
160
- */
161
- onDurationHover(state) {
162
- if (!this.PlayButton) return this;
163
- const className = `${this.controlsprefix}--play--hovered`;
164
-
165
- if (this.PlayButton.classList.contains("vjs-playing")) return this;
166
- this.PlayButton.classList.toggle(className, state);
167
-
168
- return this;
169
- }
170
120
  }
@@ -10,7 +10,8 @@
10
10
  prefix: prefix,
11
11
  src: video.src,
12
12
  tracks: video.tracks,
13
- url: url
13
+ url: url,
14
+ vjsType: vjsType
14
15
  } %}
15
16
  </div>
16
17
  <figcaption class="{{prefix}}--video--caption">{{caption}}</figcaption>
@@ -42,4 +42,41 @@ video:
42
42
  volume: "Volume"
43
43
  src: "/images/video-example.mp4"
44
44
  tracks: null
45
+
46
+ youtube_video:
47
+ namespace: Components/Media
48
+ use: "@components/video/video.twig"
49
+ label: Youtube Video
50
+ description: A component for displaying a video, source from YouTube.
51
+ fields:
52
+ alt:
53
+ type: string
54
+ label: Alt
55
+ description: alt text for the image
56
+ required: true
57
+ preview: "The ILO logo animates into view"
58
+ caption:
59
+ type: string
60
+ label: Caption
61
+ description: string
62
+ preview: "The ILO brings together governments, employers and workers to set labour standards and promote decent work."
63
+ video:
64
+ type: object
65
+ label: Video
66
+ description: video player settings
67
+ required: true
68
+ preview:
69
+ controls:
70
+ fullscreen: "Fullscreen"
71
+ play: "Play"
72
+ pause: "Pause"
73
+ volume: "Volume"
74
+ src: "https://www.youtube.com/watch?v=55xQTgUJqhQ&ab_channel=InternationalLabourOrganization"
75
+ tracks: null
76
+ vjsType:
77
+ type: string
78
+ label: Source Type
79
+ description: The source type of video, required for youtube embedded videos
80
+ required: false
81
+ preview: "video/youtube"
45
82
  visibility: storybook
@@ -6,4 +6,3 @@ VIDEO PLAYER SUB-COMPONENT
6
6
  <video class="{{prefix}}--video--element" poster="{{poster.src}}">
7
7
  </video>
8
8
  </div>
9
-