@ilo-org/twig 0.0.1

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 (204) hide show
  1. package/.browserslistrc +4 -0
  2. package/.editorconfig +12 -0
  3. package/.eslintignore +11 -0
  4. package/.eslintrc.js +66 -0
  5. package/.prettierignore +16 -0
  6. package/.prettierrc.js +13 -0
  7. package/.stylelintignore +9 -0
  8. package/.stylelintrc +23 -0
  9. package/.turbo/turbo-build.log +15313 -0
  10. package/LICENSE +201 -0
  11. package/README.md +23 -0
  12. package/apps/storybook/assets.js +5 -0
  13. package/apps/storybook/config/prefix.yml +1 -0
  14. package/apps/storybook/main.js +16 -0
  15. package/apps/storybook/manager.js +7 -0
  16. package/apps/storybook/patterns/colors.stories.mdx +18 -0
  17. package/apps/storybook/patterns/typeset.stories.mdx +28 -0
  18. package/apps/storybook/patterns/welcome.stories.mdx +24 -0
  19. package/apps/storybook/preview-body.html +4 -0
  20. package/apps/storybook/preview-head.html +11 -0
  21. package/apps/storybook/preview.js +38 -0
  22. package/apps/storybook/styles.scss +2 -0
  23. package/apps/storybook/theme.js +11 -0
  24. package/babel.config.js +16 -0
  25. package/contributing.md +5 -0
  26. package/importprefix.js +18 -0
  27. package/importsvgs.js +5 -0
  28. package/jest.config.js +18 -0
  29. package/outputtwigs.js +54 -0
  30. package/package.json +108 -0
  31. package/postcss.config.js +6 -0
  32. package/src/namespaces.js +14 -0
  33. package/src/patterns/components/accordion/accordion-item.twig +16 -0
  34. package/src/patterns/components/accordion/accordion-item.wingsuit.yml +30 -0
  35. package/src/patterns/components/accordion/accordion.behavior.js +14 -0
  36. package/src/patterns/components/accordion/accordion.js +178 -0
  37. package/src/patterns/components/accordion/accordion.stories.jsx +7 -0
  38. package/src/patterns/components/accordion/accordion.twig +17 -0
  39. package/src/patterns/components/accordion/accordion.wingsuit.yml +59 -0
  40. package/src/patterns/components/accordion/index.js +7 -0
  41. package/src/patterns/components/breadcrumb/breadcrumb.behavior.js +14 -0
  42. package/src/patterns/components/breadcrumb/breadcrumb.js +93 -0
  43. package/src/patterns/components/breadcrumb/breadcrumb.stories.jsx +7 -0
  44. package/src/patterns/components/breadcrumb/breadcrumb.twig +32 -0
  45. package/src/patterns/components/breadcrumb/breadcrumb.wingsuit.yml +35 -0
  46. package/src/patterns/components/breadcrumb/index.js +7 -0
  47. package/src/patterns/components/button/button.stories.jsx +7 -0
  48. package/src/patterns/components/button/button.twig +18 -0
  49. package/src/patterns/components/button/button.wingsuit.yml +104 -0
  50. package/src/patterns/components/button/index.js +6 -0
  51. package/src/patterns/components/callout/callout.behaviors.js +14 -0
  52. package/src/patterns/components/callout/callout.js +121 -0
  53. package/src/patterns/components/callout/callout.stories.jsx +7 -0
  54. package/src/patterns/components/callout/callout.twig +30 -0
  55. package/src/patterns/components/callout/callout.wingsuit.yml +66 -0
  56. package/src/patterns/components/callout/index.js +6 -0
  57. package/src/patterns/components/card/card.stories.jsx +7 -0
  58. package/src/patterns/components/card/card.twig +98 -0
  59. package/src/patterns/components/card/card.wingsuit.yml +300 -0
  60. package/src/patterns/components/card/index.js +6 -0
  61. package/src/patterns/components/cardgroup/cardgroup.stories.jsx +7 -0
  62. package/src/patterns/components/cardgroup/cardgroup.twig +30 -0
  63. package/src/patterns/components/cardgroup/cardgroup.wingsuit.yml +419 -0
  64. package/src/patterns/components/cardgroup/index.js +6 -0
  65. package/src/patterns/components/contextmenu/contextmenu.stories.jsx +7 -0
  66. package/src/patterns/components/contextmenu/contextmenu.twig +12 -0
  67. package/src/patterns/components/contextmenu/contextmenu.wingsuit.yml +23 -0
  68. package/src/patterns/components/contextmenu/index.js +6 -0
  69. package/src/patterns/components/dropdown/dropdown.stories.jsx +7 -0
  70. package/src/patterns/components/dropdown/dropdown.twig +20 -0
  71. package/src/patterns/components/dropdown/dropdown.wingsuit.yml +71 -0
  72. package/src/patterns/components/dropdown/index.js +6 -0
  73. package/src/patterns/components/fieldset/fieldset.twig +43 -0
  74. package/src/patterns/components/footer/footer.stories.jsx +7 -0
  75. package/src/patterns/components/footer/footer.twig +62 -0
  76. package/src/patterns/components/footer/footer.wingsuit.yml +104 -0
  77. package/src/patterns/components/footer/index.js +6 -0
  78. package/src/patterns/components/form/checkbox.twig +13 -0
  79. package/src/patterns/components/form/checkboxgroup.twig +5 -0
  80. package/src/patterns/components/form/datepicker.twig +32 -0
  81. package/src/patterns/components/form/file.twig +14 -0
  82. package/src/patterns/components/form/fileupload.behavior.js +14 -0
  83. package/src/patterns/components/form/fileupload.js +118 -0
  84. package/src/patterns/components/form/form.stories.jsx +7 -0
  85. package/src/patterns/components/form/form.twig +94 -0
  86. package/src/patterns/components/form/form.wingsuit.yml +973 -0
  87. package/src/patterns/components/form/index.js +7 -0
  88. package/src/patterns/components/form/input.twig +13 -0
  89. package/src/patterns/components/form/number.twig +13 -0
  90. package/src/patterns/components/form/radio.twig +4 -0
  91. package/src/patterns/components/form/textarea.twig +13 -0
  92. package/src/patterns/components/hero/hero.stories.jsx +7 -0
  93. package/src/patterns/components/hero/hero.twig +24 -0
  94. package/src/patterns/components/hero/hero.wingsuit.yml +56 -0
  95. package/src/patterns/components/hero/index.js +6 -0
  96. package/src/patterns/components/herocard/herocard.stories.jsx +7 -0
  97. package/src/patterns/components/herocard/herocard.twig +31 -0
  98. package/src/patterns/components/herocard/herocard.wingsuit.yml +43 -0
  99. package/src/patterns/components/herocard/index.js +6 -0
  100. package/src/patterns/components/icon/icon.twig +4 -0
  101. package/src/patterns/components/icon/index.js +6 -0
  102. package/src/patterns/components/image/image.stories.jsx +7 -0
  103. package/src/patterns/components/image/image.twig +19 -0
  104. package/src/patterns/components/image/image.wingsuit.yml +37 -0
  105. package/src/patterns/components/image/index.js +6 -0
  106. package/src/patterns/components/link/index.js +6 -0
  107. package/src/patterns/components/link/link.stories.jsx +7 -0
  108. package/src/patterns/components/link/link.twig +8 -0
  109. package/src/patterns/components/link/link.wingsuit.yml +35 -0
  110. package/src/patterns/components/linklist/index.js +6 -0
  111. package/src/patterns/components/linklist/linklist.stories.jsx +7 -0
  112. package/src/patterns/components/linklist/linklist.twig +26 -0
  113. package/src/patterns/components/linklist/linklist.wingsuit.yml +53 -0
  114. package/src/patterns/components/list/index.js +6 -0
  115. package/src/patterns/components/list/list-item.twig +6 -0
  116. package/src/patterns/components/list/list-item.wingsuit.yml +18 -0
  117. package/src/patterns/components/list/list.stories.jsx +7 -0
  118. package/src/patterns/components/list/list.twig +30 -0
  119. package/src/patterns/components/list/list.wingsuit.yml +48 -0
  120. package/src/patterns/components/loading/index.js +7 -0
  121. package/src/patterns/components/loading/loading.behavior.js +14 -0
  122. package/src/patterns/components/loading/loading.js +102 -0
  123. package/src/patterns/components/loading/loading.stories.jsx +7 -0
  124. package/src/patterns/components/loading/loading.twig +8 -0
  125. package/src/patterns/components/loading/loading.wingsuit.yml +37 -0
  126. package/src/patterns/components/modal/index.js +7 -0
  127. package/src/patterns/components/modal/modal.behavior.js +14 -0
  128. package/src/patterns/components/modal/modal.js +130 -0
  129. package/src/patterns/components/modal/modal.stories.jsx +7 -0
  130. package/src/patterns/components/modal/modal.twig +18 -0
  131. package/src/patterns/components/modal/modal.wingsuit.yml +54 -0
  132. package/src/patterns/components/notification/index.js +7 -0
  133. package/src/patterns/components/notification/notification.behavior.js +15 -0
  134. package/src/patterns/components/notification/notification.js +95 -0
  135. package/src/patterns/components/notification/notification.stories.jsx +7 -0
  136. package/src/patterns/components/notification/notification.twig +18 -0
  137. package/src/patterns/components/notification/notification.wingsuit.yml +58 -0
  138. package/src/patterns/components/pagination/Pagination.stories.jsx +7 -0
  139. package/src/patterns/components/pagination/index.js +6 -0
  140. package/src/patterns/components/pagination/pagination.twig +48 -0
  141. package/src/patterns/components/pagination/pagination.wingsuit.yml +72 -0
  142. package/src/patterns/components/polyfill/index.js +6 -0
  143. package/src/patterns/components/polyfill/polyfill.twig +10 -0
  144. package/src/patterns/components/profile/index.js +6 -0
  145. package/src/patterns/components/profile/profile.stories.jsx +7 -0
  146. package/src/patterns/components/profile/profile.twig +18 -0
  147. package/src/patterns/components/profile/profile.wingsuit.yml +35 -0
  148. package/src/patterns/components/readmore/index.js +7 -0
  149. package/src/patterns/components/readmore/readmore.behavior.js +14 -0
  150. package/src/patterns/components/readmore/readmore.js +119 -0
  151. package/src/patterns/components/readmore/readmore.stories.jsx +7 -0
  152. package/src/patterns/components/readmore/readmore.twig +16 -0
  153. package/src/patterns/components/readmore/readmore.wingsuit.yml +32 -0
  154. package/src/patterns/components/richtext/index.js +6 -0
  155. package/src/patterns/components/richtext/richtext.stories.jsx +7 -0
  156. package/src/patterns/components/richtext/richtext.twig +6 -0
  157. package/src/patterns/components/richtext/richtext.wingsuit.yml +12 -0
  158. package/src/patterns/components/searchfield/index.js +6 -0
  159. package/src/patterns/components/searchfield/searchfield.stories.jsx +7 -0
  160. package/src/patterns/components/searchfield/searchfield.twig +7 -0
  161. package/src/patterns/components/searchfield/searchfield.wingsuit.yml +22 -0
  162. package/src/patterns/components/table/index.js +7 -0
  163. package/src/patterns/components/table/table.behavior.js +14 -0
  164. package/src/patterns/components/table/table.js +279 -0
  165. package/src/patterns/components/table/table.stories.jsx +7 -0
  166. package/src/patterns/components/table/table.twig +36 -0
  167. package/src/patterns/components/table/table.wingsuit.yml +112 -0
  168. package/src/patterns/components/tableofcontents/index.js +6 -0
  169. package/src/patterns/components/tableofcontents/tableofcontents.stories.jsx +7 -0
  170. package/src/patterns/components/tableofcontents/tableofcontents.twig +14 -0
  171. package/src/patterns/components/tableofcontents/tableofcontents.wingsuit.yml +22 -0
  172. package/src/patterns/components/tabs/index.js +7 -0
  173. package/src/patterns/components/tabs/tabs.behavior.js +23 -0
  174. package/src/patterns/components/tabs/tabs.js +209 -0
  175. package/src/patterns/components/tabs/tabs.stories.jsx +7 -0
  176. package/src/patterns/components/tabs/tabs.twig +30 -0
  177. package/src/patterns/components/tabs/tabs.wingsuit.yml +168 -0
  178. package/src/patterns/components/tag/index.js +7 -0
  179. package/src/patterns/components/tag/tag-set.twig +15 -0
  180. package/src/patterns/components/tag/tag.behavior.js +14 -0
  181. package/src/patterns/components/tag/tag.stories.jsx +7 -0
  182. package/src/patterns/components/tag/tag.twig +24 -0
  183. package/src/patterns/components/tag/tag.wingsuit.yml +43 -0
  184. package/src/patterns/components/tag/tagset.js +160 -0
  185. package/src/patterns/components/tag/tagset.wingsuit.yml +43 -0
  186. package/src/patterns/components/tooltip/index.js +7 -0
  187. package/src/patterns/components/tooltip/tooltip.behavior.js +14 -0
  188. package/src/patterns/components/tooltip/tooltip.js +184 -0
  189. package/src/patterns/components/tooltip/tooltip.stories.jsx +7 -0
  190. package/src/patterns/components/tooltip/tooltip.twig +11 -0
  191. package/src/patterns/components/tooltip/tooltip.wingsuit.yml +30 -0
  192. package/src/patterns/components/video/index.js +7 -0
  193. package/src/patterns/components/video/video.behavior.js +14 -0
  194. package/src/patterns/components/video/video.js +114 -0
  195. package/src/patterns/components/video/video.stories.jsx +7 -0
  196. package/src/patterns/components/video/video.twig +17 -0
  197. package/src/patterns/components/video/video.wingsuit.yml +44 -0
  198. package/src/patterns/components/video/videoplayer.twig +10 -0
  199. package/src/tokens/exports/_colors.scss +7 -0
  200. package/src/tokens/exports/_font-families.scss +6 -0
  201. package/src/tokens/exports/_font-sizes-heading.scss +10 -0
  202. package/src/tokens/index.scss +7 -0
  203. package/src/vendorjs/lib.vendor.js +1 -0
  204. package/wingsuit.config.js +27 -0
@@ -0,0 +1,14 @@
1
+ import Callout from './callout';
2
+
3
+ Drupal.behaviors.tag = {
4
+ attach() {
5
+ Array.prototype.forEach.call(
6
+ document.querySelectorAll(`[data-loadcomponent="Callout"]`),
7
+ (element) => {
8
+ // eslint-disable-next-line no-console
9
+ console.log('loading Callout component....');
10
+ new Callout(element);
11
+ }
12
+ );
13
+ },
14
+ };
@@ -0,0 +1,121 @@
1
+ import { EVENTS } from '@ilo-org/utils';
2
+
3
+ /**
4
+ * The Callout module which handles rendering field labels inline on a form.
5
+ *
6
+ * @class Callout
7
+ */
8
+ export default class Callout {
9
+ /**
10
+ * Callout constructor which assigns the element passed into the constructor
11
+ * to the `this.element` property for later reference
12
+ *
13
+ * @param {HTMLElement} element - REQUIRED - the module's container
14
+ */
15
+ constructor(element) {
16
+ /**
17
+ * Reference to the DOM element that is the root of the component
18
+ * @property {Object}
19
+ */
20
+ this.element = element;
21
+ this.toggleLabel = '';
22
+
23
+ // Initialize the view
24
+ this.init();
25
+ }
26
+
27
+ /**
28
+ * Initializes the view by calling the functions to
29
+ * create DOM references, setup event handlers and
30
+ * then create the event listeners
31
+ *
32
+ * @return {Object} Callout A reference to the instance of the class
33
+ * @chainable
34
+ */
35
+ init() {
36
+ this.cacheDomReferences().setupHandlers().enable();
37
+
38
+ return this;
39
+ }
40
+
41
+ /**
42
+ * Find all necessary DOM elements used in the view and cache them
43
+ *
44
+ * @return {Object} Callout A reference to the instance of the class
45
+ * @chainable
46
+ */
47
+ cacheDomReferences() {
48
+ /**
49
+ * The field that a user interacts with on a form
50
+ * @type {Object}
51
+ */
52
+ this.toggle = this.element.querySelector('.ilo--callout--toggle');
53
+ this.toggleOpen = this.element.classList.value.includes('ilo--callout--open');
54
+ this.toggleLabel = this.toggle.querySelector('.ilo--callout--button-text');
55
+ this.toggleLabelOpen = this.toggle.getAttribute('data-open');
56
+ this.toggleLabelClosed = this.toggle.getAttribute('data-closed');
57
+ this.button = this.element.querySelectorAll('.ilo--button');
58
+
59
+ return this;
60
+ }
61
+
62
+ /**
63
+ * Bind event handlers with the proper context of `this`.
64
+ *
65
+ * @return {Object} Callout A reference to the current instance of the class
66
+ * @chainable
67
+ */
68
+ setupHandlers() {
69
+ this.onToggle = this.handleToggle.bind(this);
70
+ this.onClick = this.handleClick.bind(this);
71
+
72
+ return this;
73
+ }
74
+
75
+ /**
76
+ * Creates event listeners to enable interaction with view
77
+ *
78
+ * @return {Object} Callout A reference to the instance of the class
79
+ * @chainable
80
+ */
81
+ enable() {
82
+ this.toggle.addEventListener(EVENTS.CLICK, onToggle);
83
+ this.button.addEventListener(EVENTS.CLICK, onClick);
84
+
85
+ return this;
86
+ }
87
+
88
+ /**
89
+ * Onclick interaction
90
+ *
91
+ * @return {Object} Callout A reference to the instance of the class
92
+ * @chainable
93
+ */
94
+ handleClick(e) {
95
+ // callback of sorts
96
+ console.log('button clicked');
97
+
98
+ return this;
99
+ }
100
+
101
+ /**
102
+ * handleToggle
103
+ *
104
+ * toggle the collapse state of the callout
105
+ *
106
+ * @param {Object} e - Event
107
+ * @return {Object} Callout A reference to the instance of the class
108
+ * @chainable
109
+ */
110
+ handleToggle(e) {
111
+ e.preventDefault();
112
+ this.toggleOpen = !this.toggleOpen;
113
+
114
+ const label = this.toggleOpen ? this.toggleLabelOpen : this.toggleLabelClosed;
115
+
116
+ this.element.classList.toggle('ilo--toggle--open');
117
+ this.toggleLabel.innerText = label;
118
+
119
+ return this;
120
+ }
121
+ }
@@ -0,0 +1,7 @@
1
+ import './index';
2
+
3
+ const patternDefinition = require('./callout.wingsuit.yml');
4
+
5
+ export const wingsuit = {
6
+ patternDefinition,
7
+ };
@@ -0,0 +1,30 @@
1
+ {#
2
+ CALLOUT COMPONENT
3
+ #}
4
+ <div class="{{prefix}}--callout {{prefix}}--callout--{{alert}} {% if isOpen %} {{prefix}}--callout--open {% endif %}" data-loadcomponent="Callout" >
5
+ <div class="{{prefix}}--callout--sidebar">
6
+ <span class="{{prefix}}--callout--icon icon icon--{{alert}}"></span>
7
+ </div>
8
+ <div class="{{prefix}}--callout--content">
9
+ <div class="{{prefix}}--callout--header">
10
+ <h5 class="{{prefix}}--callout--title">{{ title }}</h5>
11
+ {% if isCollapsible %}
12
+ <button class="{{prefix}}--callout--toggle" type="button" data-open="{{ toggleOpenLabel }}" data-closed="{{ toggleClosedLabel }}">
13
+ <span class="{{prefix}}--callout--button-text">{% if isOpen %}{{ toggleOpenLabel }}{% else %}{{ toggleClosedLabel }}{% endif %}</span>
14
+ <span class="{{prefix}}--callout--toggle--icon" role="presentation"></span>
15
+ </button>
16
+ {% endif %}
17
+ </div>
18
+ {{ content }}
19
+ {% if buttonLabel %}
20
+ <div class="{{prefix}}--callout--footer">
21
+ <button
22
+ class="{{prefix}}--button {{prefix}}--button--small {{prefix}}--button--tertiary"
23
+ type="button"
24
+ >
25
+ {{ buttonLabel }}
26
+ </button>
27
+ </div>
28
+ {% endif %}
29
+ </div>
30
+ </div>
@@ -0,0 +1,66 @@
1
+ callout:
2
+ use: '@components/callout/callout.twig'
3
+ label: Callout
4
+ description: A callout alert
5
+ fields:
6
+ buttonLabel:
7
+ type: string
8
+ label: Button Label
9
+ description: The label for the optional button
10
+ preview: "Optional Button Label"
11
+ required: false
12
+ content:
13
+ type: text
14
+ label: Content
15
+ description: The callout's content
16
+ preview:
17
+ faker: lorem.word
18
+ isCollapsible:
19
+ type: select
20
+ label: Is Collapsible
21
+ description: Whether or not the callout is collapsible
22
+ required: false
23
+ options:
24
+ true: True
25
+ false: False
26
+ preview: false
27
+ isOpen:
28
+ type: select
29
+ label: Is Open
30
+ description: Whether or not a collapsible callout is open
31
+ required: false
32
+ options:
33
+ true: True
34
+ false: False
35
+ preview: true
36
+ title:
37
+ type: string
38
+ label: Notification Title
39
+ description: Title for the notification
40
+ preview: "Optional Title"
41
+ required: false
42
+ toggleOpenLabel:
43
+ type: string
44
+ label: Open Label for the collapse toggle
45
+ description: If there is a collapse toggle, this is the label
46
+ preview: "More"
47
+ required: false
48
+ toggleClosedLabel:
49
+ type: string
50
+ label: Closed Label for the collapse toggle
51
+ description: If there is a collapse toggle, this is the label
52
+ preview: "Less"
53
+ required: false
54
+ settings:
55
+ alert:
56
+ type: select
57
+ label: Alert
58
+ description: Alert type
59
+ required: true
60
+ options:
61
+ info: Info
62
+ error: Error
63
+ success: Success
64
+ warning: Warning
65
+ preview: 'info'
66
+ visibility: storybook
@@ -0,0 +1,6 @@
1
+ /**
2
+ * callout
3
+ */
4
+ // Module template
5
+ import './callout.twig';
6
+ import './callout.wingsuit.yml';
@@ -0,0 +1,7 @@
1
+ import './index';
2
+
3
+ const patternDefinition = require('./card.wingsuit.yml');
4
+
5
+ export const wingsuit = {
6
+ patternDefinition,
7
+ };
@@ -0,0 +1,98 @@
1
+ {#
2
+ CARD COMPONENT
3
+ #}
4
+ <div class="{{prefix}}--card {{prefix}}--card--{{theme}} {{prefix}}--card--{{variant}}{% if cornercut %} {{prefix}}--card--{{cornercut}}{% endif %}{% if color %} {{prefix}}--card--{{color}}{% endif %}{% if alignment %} {{prefix}}--card--{{alignment}}{% endif %} {% if link %} {{prefix}}--card--action{% endif %}">
5
+ {% if link %}
6
+ <a class="{{prefix}}--card--link" href="{{link}}" title="{{title}}"></a>
7
+ {% endif %}
8
+ <div class="{{prefix}}--card--wrap">
9
+ {% if image %}
10
+ <div class="{{prefix}}--card--image--wrapper"><picture><img class="{{prefix}}--card--image" src="{{image}}" alt="{{title}}"></picture></div>
11
+ {% endif %}
12
+ <div class="{{prefix}}--card--content">
13
+ {% if eyebrow %}
14
+ <p class="{{prefix}}--card--eyebrow">{{eyebrow}}</p>
15
+ {% endif %}
16
+ {% if title %}
17
+ <h5 class="{{prefix}}--card--title">{{title}}</h5>
18
+ {% endif %}
19
+ {% if intro %}
20
+ <p class="{{prefix}}--card--intro">{{intro}}</p>
21
+ {% endif %}
22
+ {% if date %}
23
+ <time class="{{prefix}}--card--date" datetime="{{timestamp.unix}}">{{timestamp.human}}</time>
24
+ {% endif %}
25
+ {% if eventdetails %}
26
+ <p class="{{prefix}}--card--event-date">{{eventdetails}}</p>
27
+ {% endif %}
28
+ {% if profile %}
29
+ {% include "@components/profile/profile.twig" with {
30
+ avatar: profile.avatar,
31
+ description: profile.description,
32
+ link: profile.link,
33
+ name: profile.name,
34
+ role: profile.role,
35
+ prefix: prefix,
36
+ } only %}
37
+ {% endif %}
38
+ {% if list %}
39
+ {% include "@components/list/list.twig" with {
40
+ title: list.title,
41
+ ordered: list.ordered,
42
+ alignment: list.alignment,
43
+ items: list.items,
44
+ prefix: prefix,
45
+ } only %}
46
+ {% endif %}
47
+ {% if cta %}
48
+ <a class="{{prefix}}--card--cta {{prefix}}--button {{prefix}}--button--small {{prefix}}--button--primary" href="{{cta.url}}">
49
+ <span class="link__label">{{cta.label}}</span>
50
+ </a>
51
+ {% endif %}
52
+ {% if source %}
53
+ {% include "@components/link/link.twig" with {
54
+ theme: theme,
55
+ url: source.url,
56
+ label: source.label,
57
+ prefix: prefix
58
+ } %}
59
+ {% endif %}
60
+ {% if linklist %}
61
+ {% include "@components/linklist/linklist.twig" with {
62
+ headline: linklist.headline,
63
+ linkgroup: linklist.linkgroup,
64
+ prefix: prefix,
65
+ theme: theme
66
+ } only %}
67
+ {% endif %}
68
+ {% if dataset %}
69
+ {% if dataset.content %}
70
+ {% for item in dataset.content.items %}
71
+ <p class="{{prefix}}--card--data--content-label">{{ item.label }}</p>
72
+ <p class="{{prefix}}--card--data--content-copy">{{ item.copy }}</p>
73
+ {% endfor %}
74
+ {% endif %}
75
+ {% if dataset.files %}
76
+ <div class="{{prefix}}--card--data--content-files">
77
+ <p class="{{prefix}}--card--data--content-label">{{ dataset.files.headline }}</p>
78
+ {% for item in dataset.files.items %}
79
+ <a class="{{prefix}}--card--data--file {{prefix}}--button {{prefix}}--button--primary {{prefix}}--button--small" href="{{item.url}}"><span class="button__label" download>{{ item.label }}</span></a>
80
+ {% endfor %}
81
+ </div>
82
+ {% endif %}
83
+ {% if dataset.links %}
84
+ <div class="{{prefix}}--card--data--content-links">
85
+ {% for item in dataset.links.items %}
86
+ {% include "@components/link/link.twig" with {
87
+ theme: theme,
88
+ url: item.url,
89
+ label: item.label,
90
+ prefix: prefix
91
+ } %} <span>&nbsp;</span>
92
+ {% endfor %}
93
+ </div>
94
+ {% endif %}
95
+ {% endif %}
96
+ </div>
97
+ </div>
98
+ </div>
@@ -0,0 +1,300 @@
1
+ card:
2
+ use: '@components/card/card.twig'
3
+ label: Card
4
+ description: The Card presents an image banner.
5
+ fields:
6
+ title:
7
+ type: string
8
+ label: Title
9
+ description: Title field
10
+ preview: Lorem ipsum
11
+ intro:
12
+ type: string
13
+ label: Intro
14
+ description: Intro copy text
15
+ preview: "Brief intro text - ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
16
+ eyebrow:
17
+ type: string
18
+ label: Eyebrow
19
+ description: Eyebrow copy text
20
+ preview: "Eyebrow"
21
+ date:
22
+ type: object
23
+ label: Date
24
+ description: Date copy text
25
+ preview:
26
+ human: 20 September 2022
27
+ unix: 1670389200
28
+ eventdetails:
29
+ type: string
30
+ label: Eyebrow
31
+ description: Eyebrow copy text
32
+ preview: ""
33
+ profile:
34
+ type: object
35
+ label: Profile
36
+ description: Profile to embed in the card
37
+ preview:
38
+ list:
39
+ type: object
40
+ label: List
41
+ description: List to embed in the card
42
+ preview:
43
+ link:
44
+ type: string
45
+ label: Link
46
+ description: Link for clickable cards
47
+ preview: "https://www.google.com/"
48
+ cta:
49
+ type: object
50
+ label: CTA
51
+ description: Items for clickable CTA button
52
+ preview:
53
+ image:
54
+ type: string
55
+ label: Image
56
+ description: The image for the card
57
+ preview: "http://placekitten.com/600/300"
58
+ source:
59
+ type: object
60
+ label: Source
61
+ description: Source link for stat cards
62
+ preview:
63
+ linklist:
64
+ type: object
65
+ label: Link List
66
+ description: Multi-link list
67
+ preview:
68
+ dataset:
69
+ type: object
70
+ label: Data set
71
+ description: This is a series of items, headline and copy, to include on the card
72
+ preview:
73
+ color:
74
+ type: string
75
+ label: Color
76
+ description: Color of the stat cards, options are turquoise, green, yellow, or blue
77
+ preview: 'blue'
78
+ settings:
79
+ theme:
80
+ type: select
81
+ label: Theme
82
+ description: The theme type for the hero
83
+ required: false
84
+ preview: 'dark'
85
+ options:
86
+ dark: Dark
87
+ light: Light
88
+ types:
89
+ type: select
90
+ label: Types
91
+ description: The type of hero
92
+ required: false
93
+ preview: 'graphic'
94
+ options:
95
+ graphic: graphic
96
+ cornercut:
97
+ type: select
98
+ label: Corner cut
99
+ description: Setting for whether the card has a cut corner
100
+ preview: cornercut
101
+ options:
102
+ cornercut: Corner cut
103
+ corner: Corner
104
+ alignment:
105
+ type: select
106
+ label: Alignment
107
+ description: Set whether card (multilink) image is right aligned or left aligned
108
+ preview: left
109
+ options:
110
+ left: Left
111
+ right: right
112
+ variants:
113
+ default:
114
+ label: Default
115
+ description: the default settings for the Card
116
+ graphic:
117
+ label: Graphic Text Card
118
+ description: The graphic Card
119
+ fields:
120
+ title: "Brief title text - ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"
121
+ intro: ""
122
+ eyebrow: Eyebrow title
123
+ date:
124
+ human: 20 September 2022
125
+ unix: 1670389200
126
+ link: "https://www.google.com/search?q=graphic"
127
+ profile:
128
+ avatar: "https://placekitten.com/128/128"
129
+ description: "Firstname Lastname is the Senior Media Strategist. He has been with ILO for eight years."
130
+ link:
131
+ - label: "Optional Link"
132
+ url: "https://www.google.com"
133
+ name: "Firstname Lastname"
134
+ role: "Senior Media Strategist"
135
+ cta: ""
136
+ eventdetails: ""
137
+ stat:
138
+ label: Stat Card
139
+ description: The stat Card
140
+ settings:
141
+ theme: light
142
+ fields:
143
+ title: "Date headline"
144
+ image: ""
145
+ intro: "Data title - Lorem ipsum dolor sit amet consectetur"
146
+ eyebrow: ""
147
+ date:
148
+ human: ""
149
+ unix: 1670389200
150
+ link: ""
151
+ profile: ""
152
+ eventdetails: ""
153
+ cta: ""
154
+ source:
155
+ label: "Source: lorem ipsum dolor sit amet, 2020"
156
+ url: "https://www.google.com/search?q=stat"
157
+ color: blue
158
+ multilink:
159
+ label: Multilink Card
160
+ description: The multilink Card
161
+ settings:
162
+ theme: light
163
+ fields:
164
+ title: "Multi-link card - right aligned image, wide option"
165
+ image: "http://placekitten.com/475/267"
166
+ intro: "Lorem ipsum dolor sit amet consectetur adipiscing elit. Lobortis egestas ipsum dolor sit amet consectetur adipiscing elit. Lobortis egestas ipsum dolor sit amet consectetur adipiscing elit. Lobortis egestas lacus."
167
+ eyebrow: ""
168
+ date:
169
+ human: ""
170
+ unix: 1670389200
171
+ link: ""
172
+ profile: ""
173
+ eventdetails: ""
174
+ cta: ""
175
+ source: ""
176
+ linklist:
177
+ headline: ""
178
+ linkgroup:
179
+ - headline: ""
180
+ links:
181
+ - label: Link One
182
+ url: 'http://www.google.com'
183
+ - label: Link Two
184
+ url: 'http://www.google.com'
185
+ - label: Link Three
186
+ url: 'http://www.google.com'
187
+ graphicpromo:
188
+ label: Graphic Promo Card
189
+ description: The graphic promo Card
190
+ fields:
191
+ title: "Brief title text - ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"
192
+ image: ""
193
+ intro: "We advance social justice and promote decent work by setting labour standards, developing policies and devising programmes."
194
+ eyebrow: ""
195
+ date:
196
+ human: ""
197
+ unix: 1670389200
198
+ link: "https://www.google.com/search?q=graphic-promo"
199
+ profile: ""
200
+ eventdetails: ""
201
+ cta:
202
+ label: "Discover our unique mission"
203
+ url: "https://www.google.com/search?q=button"
204
+ feature:
205
+ label: Feature Card
206
+ description: The Feature Card
207
+ fields:
208
+ title: "Vertical info card descriptive headline text"
209
+ intro: ""
210
+ eyebrow: Eyebrow title
211
+ date:
212
+ human: Date
213
+ unix: 1670389200
214
+ link: "https://www.google.com/search?q=graphic"
215
+ image: "http://placekitten.com/412/232"
216
+ profile:
217
+ eventdetails: ""
218
+ detail:
219
+ label: Detail Card
220
+ description: The Detail Card
221
+ fields:
222
+ title: "Horizontal info card descriptive headline text"
223
+ intro: "This ILO flagship report details the effects of the COVID-19 crisis on the world of work. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum eu auctor tusrpis, this is 200 characters."
224
+ eyebrow: Eyebrow title
225
+ date:
226
+ human: 00 month 0000
227
+ unix: 1670389200
228
+ link: "https://www.google.com/search?q=detail"
229
+ # image: "http://placekitten.com/296/196"
230
+ image: "https://www.ilo.org/wcmsp5/groups/public/---dgreports/---dcomm/documents/image/wcms_856513.jpg"
231
+ profile:
232
+ eventdetails: "8 - 9 February 2022, 8:30 - 12:00 CET | Egypt"
233
+ factlist:
234
+ label: Fact List Card
235
+ description: The Fact List Card
236
+ fields:
237
+ title: "Title of fast fact list"
238
+ intro: ""
239
+ eyebrow: ""
240
+ date:
241
+ human: ""
242
+ unix: 1670389200
243
+ link: ""
244
+ image: ""
245
+ profile: ""
246
+ eventdetails: ""
247
+ cta: ""
248
+ list:
249
+ title: ""
250
+ settings:
251
+ - ordered: unordered
252
+ - alignment: default
253
+ items:
254
+ - content: "Wipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor."
255
+ id: "list1"
256
+ - content: "Nut labore et dolore magna sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
257
+ id: "list2"
258
+ data:
259
+ label: Data Card
260
+ description: The Data Card
261
+ fields:
262
+ title: ""
263
+ image: "https://placekitten.com/205/179"
264
+ intro: ""
265
+ eyebrow: "Event details"
266
+ date:
267
+ human: ""
268
+ unix: 1670389200
269
+ link: ""
270
+ profile: ""
271
+ eventdetails: ""
272
+ cta: ""
273
+ dataset:
274
+ content:
275
+ items:
276
+ - label: Date
277
+ copy: Publication date
278
+ - label: Event type
279
+ copy: Event location
280
+ files:
281
+ headline: Files
282
+ items:
283
+ - label: File/size MB 1
284
+ url: "https://www.google.com/search?q=file1"
285
+ - label: File/size MB 2
286
+ url: "https://www.google.com/search?q=file2"
287
+ - label: File/size MB 3
288
+ url: "https://www.google.com/search?q=file3"
289
+ links:
290
+ headline: Languages
291
+ items:
292
+ - label: Language link 1
293
+ url: "https://www.google.com/search?q=link"
294
+ - label: Language link 2
295
+ url: "https://www.google.com/search?q=hyperlink"
296
+ - label: Language link 3
297
+ url: "https://www.google.com/search?q=url"
298
+ settings:
299
+ theme: light
300
+ visibility: storybook
@@ -0,0 +1,6 @@
1
+ /**
2
+ * card
3
+ */
4
+ // Module template
5
+ import './card.twig';
6
+ import './card.wingsuit.yml';
@@ -0,0 +1,7 @@
1
+ import './index';
2
+
3
+ const patternDefinition = require('./cardgroup.wingsuit.yml');
4
+
5
+ export const wingsuit = {
6
+ patternDefinition,
7
+ };