@ilo-org/twig 0.2.4 → 0.2.6

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 (33) hide show
  1. package/.turbo/turbo-build.log +14009 -13996
  2. package/CHANGELOG.md +42 -0
  3. package/README.md +203 -2
  4. package/apps/storybook/manager-head.html +2 -0
  5. package/apps/storybook/patterns/intro.stories.mdx +311 -0
  6. package/apps/storybook/patterns/welcome.stories.mdx +61 -16
  7. package/apps/storybook/preview-head.html +0 -6
  8. package/apps/storybook/preview.js +9 -11
  9. package/apps/storybook/styles.scss +0 -1
  10. package/images/favicon.ico +0 -0
  11. package/package.json +7 -7
  12. package/src/patterns/components/accordion/accordion.wingsuit.yml +18 -36
  13. package/src/patterns/components/button/button.wingsuit.yml +34 -33
  14. package/src/patterns/components/callout/callout.wingsuit.yml +2 -2
  15. package/src/patterns/components/card/card.twig +1 -1
  16. package/src/patterns/components/card/card.wingsuit.yml +37 -40
  17. package/src/patterns/components/cardgroup/cardgroup.wingsuit.yml +0 -4
  18. package/src/patterns/components/dropdown/dropdown.wingsuit.yml +20 -13
  19. package/src/patterns/components/hero/hero.wingsuit.yml +4 -3
  20. package/src/patterns/components/herocard/herocard.wingsuit.yml +14 -9
  21. package/src/patterns/components/linklist/linklist.stories.jsx +5 -0
  22. package/src/patterns/components/linklist/linklist.wingsuit.yml +3 -2
  23. package/src/patterns/components/list/list.wingsuit.yml +4 -4
  24. package/src/patterns/components/localnav/localnav.twig +58 -4
  25. package/src/patterns/components/navigation/navigation.twig +0 -1
  26. package/src/patterns/components/navigation/navigation.wingsuit.yml +2 -2
  27. package/src/patterns/components/notification/notification.wingsuit.yml +11 -11
  28. package/src/patterns/components/pagination/pagination.wingsuit.yml +2 -2
  29. package/src/patterns/components/readmore/readmore.wingsuit.yml +5 -1
  30. package/src/patterns/components/tags/tag.wingsuit.yml +5 -5
  31. package/src/patterns/components/tags/tags.wingsuit.yml +2 -2
  32. package/src/patterns/components/tooltip/tooltip.js +5 -4
  33. package/src/patterns/components/tooltip/tooltip.wingsuit.yml +4 -3
@@ -1,7 +1,7 @@
1
1
  list:
2
2
  use: '@components/list/list.twig'
3
3
  label: List
4
- description: A list.
4
+ description: The list component
5
5
  fields:
6
6
  title:
7
7
  type: text
@@ -12,7 +12,7 @@ list:
12
12
  items:
13
13
  type: object
14
14
  label: Items
15
- description: The list items.
15
+ description: Array of the list items
16
16
  required: true
17
17
  preview:
18
18
  - content: Arabica. Arabica is the most popular type of coffee, hands down.
@@ -29,7 +29,7 @@ list:
29
29
  ordered:
30
30
  type: select
31
31
  label: Ordered
32
- description: The order for the list.
32
+ description: The order for the list. `Ordered` uses numbers, `unordered` uses arrow indicators and `unstyled` doesn't have anything but spacing.
33
33
  required: false
34
34
  options:
35
35
  ordered: Ordered
@@ -39,7 +39,7 @@ list:
39
39
  alignment:
40
40
  type: select
41
41
  label: Alignment
42
- description: Is the list displayed horizontally?
42
+ description: Is the list displayed horizontally? Usually used for shorter items inside a list.
43
43
  options:
44
44
  default: Default
45
45
  horizontal: Horizontal
@@ -1,12 +1,14 @@
1
1
  {#
2
2
  LOCALNAV COMPONENT
3
3
  #}
4
- <header class="{{prefix}}--header" data-loadcomponent="Navigation" data-prefix="{{prefix}}">
4
+ <header class="{{prefix}}--header {{prefix}}--header--local" data-loadcomponent="Navigation" data-prefix="{{prefix}}">
5
5
  <div class="{{prefix}}--header--utility-bar {{prefix}}--header--utility-bar--local">
6
6
  <nav class="{{prefix}}--nav--local">
7
- <a href="{{siteurl}}" class="{{prefix}}--nav--local--logo-link">
8
- <img src="{{logo.image}}" alt="{{logo.alt}}" class="{{prefix}}--nav--local--logo">
9
- </a>
7
+ <div class="{{prefix}}--nav--local--logo-wrapper">
8
+ <a href="{{siteurl}}" class="{{prefix}}--nav--local--logo-link">
9
+ <img src="{{logo.image}}" alt="{{logo.alt}}" class="{{prefix}}--nav--local--logo">
10
+ </a>
11
+ </div>
10
12
 
11
13
  <ul class="{{prefix}}--nav--local--set">
12
14
  {% for item in primarynav.items %}
@@ -28,5 +30,57 @@
28
30
  %}
29
31
  </div> <!-- /.{{prefix}}--language-switcher--wrap -->
30
32
  </div> <!-- /.{{prefix}}--language-switcher -->
33
+ <button class="ilo--header--menu">Menu</button>
31
34
  </div> <!-- /.{{prefix}}--header--utility-bar -->
35
+
36
+
37
+ <div class="{{prefix}}--header--navigation">
38
+ <div class="{{prefix}}--header--inner">
39
+ <div class="{{prefix}}--mobile--nav">
40
+ <div class="{{prefix}}--mobile--nav--logo">
41
+ <a href="{{siteurl}}" class="{{prefix}}--header--logo-link">
42
+ <img class="{{prefix}}--header--logo" src="{{mobilelogo.image}}" alt="{{mobilelogo.alt}}">
43
+ </a>
44
+ <button class="{{prefix}}--header--menu--close">{{menucloselabel}}</button>
45
+ </div> <!-- /.{{prefix}}--mobile--logo -->
46
+
47
+ <div class="{{prefix}}--mobile--nav--language--switcher">
48
+ <button class="{{prefix}}--mobile--nav--language--switcher--button" type="button">{{languagelabel}}</button>
49
+ </div> <!-- /.{{prefix}}--mobile--nav--language--switcher -->
50
+ <div class="{{prefix}}--mobile--nav--language--select">
51
+ <div class="{{prefix}}--header--inner">
52
+ <div class="{{prefix}}--mobile--subnav--menu">
53
+ <button class="{{prefix}}--mobile--subnav--back" type="button">{{subnav.mobilebacklabel}}</button>
54
+ <button class="{{prefix}}--header--menu--close">{{subnav.mobilecloselabel}}</button>
55
+ <h6 class="{{prefix}}--mobile--subnav--label">{{languagelabel}}</h6>
56
+ </div> <!-- /{{prefix}}--mobile--subnav--menu -->
57
+ <ul class="{{prefix}}--nav--set">
58
+ {% for item in languagecontextmenu.links %}
59
+ <li class="{{prefix}}--nav--items">
60
+ <a href="{{item.url}}" class="{{prefix}}--nav--link {{prefix}}--nav--language">{{item.label}}</a>
61
+ </li>
62
+ {% endfor %}
63
+ </ul>
64
+ </div>
65
+ </div>
66
+ </div> <!-- /.{{prefix}}--mobile--nav -->
67
+ <nav class="{{prefix}}--nav" aria-labelledby="primary-navigation">
68
+ <h2 class="{{prefix}}--nav--label" id="primary-navigation">{{primarynav.navlabel}}</h2>
69
+ <ul class="{{prefix}}--nav--set">
70
+ {% for item in primarynav.items %}
71
+ <li class="{{prefix}}--nav--items">
72
+ <a href="{{item.link}}" class="{{prefix}}--nav--link">{{item.label}}</a>
73
+ </li>
74
+ {% endfor %}
75
+ {% if subnav %}
76
+ <li class="{{prefix}}--nav--items">
77
+ <button class="{{prefix}}--nav--trigger">{{subnav.buttonlabel}}</button>
78
+ </li>
79
+ {% endif %}
80
+ </ul>
81
+ </nav>
82
+ <div class="{{prefix}}--search">
83
+ <button class="{{prefix}}--search--button" type="button">{{searchlabel}}</button>
84
+ </div> <!-- /.{{prefix}}--search -->
85
+ </div> <!-- /.{{prefix}}--header--inner -->
32
86
  </header>
@@ -65,7 +65,6 @@
65
65
  </ul>
66
66
  </div>
67
67
  </div>
68
-
69
68
  </div> <!-- /.{{prefix}}--mobile--nav -->
70
69
  <nav class="{{prefix}}--nav" aria-labelledby="primary-navigation">
71
70
  <h2 class="{{prefix}}--nav--label" id="primary-navigation">{{primarynav.navlabel}}</h2>
@@ -45,7 +45,7 @@ navigation:
45
45
  primarynav:
46
46
  type: object
47
47
  label: Primary Navigation
48
- description: Navigation for the primary menu
48
+ description: Navigation for the primary menu, a list of navigation items as well as some labels for display.
49
49
  preview:
50
50
  navlabel: Primary Navigation
51
51
  mobilecloselabel: Close
@@ -63,7 +63,7 @@ navigation:
63
63
  subnav:
64
64
  type: object
65
65
  label: Secondary navigation
66
- description: Navigation for the sub menu
66
+ description: Navigation for the sub menu, a list of subnav items as well as some labels for display.
67
67
  preview:
68
68
  navlabel: Secondary Navigation
69
69
  buttonlabel: More
@@ -28,17 +28,6 @@ notification:
28
28
  description: The headline of the notification
29
29
  required: true
30
30
  preview: 'With CTA'
31
- type:
32
- type: select
33
- label: Type
34
- description: What kind of notification is it?
35
- required: true
36
- options:
37
- error: Error
38
- info: Info
39
- success: Success
40
- warning: Warning
41
- preview: 'info'
42
31
  timestamp:
43
32
  type: object
44
33
  label: Timestamp
@@ -55,4 +44,15 @@ notification:
55
44
  inline: Inline
56
45
  dialog: Dialog
57
46
  preview: 'dialog'
47
+ type:
48
+ type: select
49
+ label: Type
50
+ description: What kind of notification is it?
51
+ required: true
52
+ options:
53
+ error: Error
54
+ info: Info
55
+ success: Success
56
+ warning: Warning
57
+ preview: 'info'
58
58
  visibility: storybook
@@ -8,7 +8,7 @@ pagination:
8
8
  label: Current page
9
9
  description: current page number that the user is on, zero-indexed
10
10
  required: true
11
- preview: 0
11
+ preview: '0'
12
12
  firstPageUrl:
13
13
  type: string
14
14
  label: First Page link
@@ -68,5 +68,5 @@ pagination:
68
68
  label: Total Pages
69
69
  description: The number of total pages
70
70
  required: true
71
- preview: 8
71
+ preview: '8'
72
72
  visibility: storybook
@@ -23,10 +23,14 @@ readmore:
23
23
  description: HTML content
24
24
  preview: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
25
25
  required: true
26
+ settings:
26
27
  openatstart:
27
- type: boolean
28
+ type: select
28
29
  label: Open At Start
29
30
  description: should the read more be open at page load?
31
+ options:
32
+ true: 'true'
33
+ false: false
30
34
  preview: false
31
35
  required: true
32
36
  visibility: storybook
@@ -1,24 +1,24 @@
1
1
  tag:
2
2
  use: '@components/tags/tag.twig'
3
3
  label: Tag
4
- description: A clickable tag
4
+ description: A display or interactable tag
5
5
  fields:
6
6
  content:
7
7
  type: text
8
8
  label: Content
9
- description: The tag item's collapsed content.
9
+ description: The tag text content.
10
10
  preview:
11
11
  faker: lorem.word
12
12
  id:
13
13
  type: text
14
14
  label: ID
15
- description: The tag item's id.
15
+ description: The tag's id.
16
16
  preview:
17
17
  faker: lorem.word
18
18
  url:
19
19
  type: text
20
20
  label: URL
21
- description: The tag's url reference
21
+ description: The tag's url reference
22
22
  preview:
23
23
  faker: https://www.google.com/
24
24
  settings:
@@ -34,7 +34,7 @@ tag:
34
34
  tagType:
35
35
  type: type
36
36
  label: Tag Type
37
- description: The type of tag
37
+ description: The type of tag. Anchor and button have potential user interactions where display is static.
38
38
  options:
39
39
  anchor: Anchor
40
40
  button: Button
@@ -1,12 +1,12 @@
1
1
  tags:
2
2
  use: '@components/tags/tags.twig'
3
3
  label: Tags
4
- description: A set of tags
4
+ description: A group of tags
5
5
  fields:
6
6
  items:
7
7
  type: object
8
8
  label: Items
9
- description: The tag items.
9
+ description: An array of tag data to implement a Tag component
10
10
  required: true
11
11
  preview:
12
12
  - content: content 1
@@ -92,6 +92,7 @@ export default class Tooltip {
92
92
  if (target != null) {
93
93
  const rect = target.getBoundingClientRect();
94
94
  this.tooltip.classList.add(`${this.prefix}--tooltip--visible`);
95
+ this.tooltip.classList.add(`${this.prefix}--tooltip--fade`);
95
96
  this.postMouseOver(rect);
96
97
  }
97
98
 
@@ -99,7 +100,10 @@ export default class Tooltip {
99
100
  }
100
101
 
101
102
  handleOnMouseOut(e) {
102
- this.tooltip.classList.remove(`${this.prefix}--tooltip--visible`);
103
+ this.tooltip.classList.remove(`${this.prefix}--tooltip--fade`);
104
+ setTimeout(() => {
105
+ this.tooltip.classList.remove(`${this.prefix}--tooltip--visible`);
106
+ }, 150);
103
107
 
104
108
  return this;
105
109
  }
@@ -159,19 +163,16 @@ export default class Tooltip {
159
163
  }
160
164
 
161
165
  // set style top and left on tooltip
162
- // setPosition({ x: x, y: y });
163
166
  this.tooltip.style.top = y;
164
167
  this.tooltip.style.left = x;
165
168
 
166
169
  // set class for placement on arrow
167
- // setArrowPlacement(placement);
168
170
  this.arrow.classList.remove(`${this.prefix}--tooltip--arrow--placement-${this.placement}`);
169
171
  this.arrow.classList.add(`${this.prefix}--tooltip--arrow--placement-${this.placement}`);
170
172
  this.placement = placement;
171
173
  this.arrow.setAttribute('data-placement', placement);
172
174
 
173
175
  // set class for alignment on tooltip
174
- // setArrowAlignment(alignment);
175
176
  this.tooltip.classList.remove(`${this.prefix}--tooltip--alignment-${this.alignment}`);
176
177
  this.tooltip.classList.add(`${this.prefix}--tooltip--alignment-${this.alignment}`);
177
178
  this.alignment = alignment;
@@ -9,11 +9,12 @@ tooltip:
9
9
  description: label shown on the tooltip
10
10
  required: true
11
11
  preview: 'Tooltip text'
12
+ settings:
12
13
  icon:
13
14
  type: select
14
15
  label: Icon
15
16
  description: does this tooltip have the "info" icon?
16
- fields:
17
+ options:
17
18
  true: 'true'
18
19
  false: false
19
20
  preview: 'true'
@@ -21,8 +22,8 @@ tooltip:
21
22
  theme:
22
23
  type: select
23
24
  label: Theme
24
- description: choose the tooltip's theme
25
- fields:
25
+ description: Choose the tooltip's theme
26
+ options:
26
27
  light: light
27
28
  dark: dark
28
29
  preview: dark