@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.
- package/.browserslistrc +4 -0
- package/.editorconfig +12 -0
- package/.eslintignore +11 -0
- package/.eslintrc.js +66 -0
- package/.prettierignore +16 -0
- package/.prettierrc.js +13 -0
- package/.stylelintignore +9 -0
- package/.stylelintrc +23 -0
- package/.turbo/turbo-build.log +15313 -0
- package/LICENSE +201 -0
- package/README.md +23 -0
- package/apps/storybook/assets.js +5 -0
- package/apps/storybook/config/prefix.yml +1 -0
- package/apps/storybook/main.js +16 -0
- package/apps/storybook/manager.js +7 -0
- package/apps/storybook/patterns/colors.stories.mdx +18 -0
- package/apps/storybook/patterns/typeset.stories.mdx +28 -0
- package/apps/storybook/patterns/welcome.stories.mdx +24 -0
- package/apps/storybook/preview-body.html +4 -0
- package/apps/storybook/preview-head.html +11 -0
- package/apps/storybook/preview.js +38 -0
- package/apps/storybook/styles.scss +2 -0
- package/apps/storybook/theme.js +11 -0
- package/babel.config.js +16 -0
- package/contributing.md +5 -0
- package/importprefix.js +18 -0
- package/importsvgs.js +5 -0
- package/jest.config.js +18 -0
- package/outputtwigs.js +54 -0
- package/package.json +108 -0
- package/postcss.config.js +6 -0
- package/src/namespaces.js +14 -0
- package/src/patterns/components/accordion/accordion-item.twig +16 -0
- package/src/patterns/components/accordion/accordion-item.wingsuit.yml +30 -0
- package/src/patterns/components/accordion/accordion.behavior.js +14 -0
- package/src/patterns/components/accordion/accordion.js +178 -0
- package/src/patterns/components/accordion/accordion.stories.jsx +7 -0
- package/src/patterns/components/accordion/accordion.twig +17 -0
- package/src/patterns/components/accordion/accordion.wingsuit.yml +59 -0
- package/src/patterns/components/accordion/index.js +7 -0
- package/src/patterns/components/breadcrumb/breadcrumb.behavior.js +14 -0
- package/src/patterns/components/breadcrumb/breadcrumb.js +93 -0
- package/src/patterns/components/breadcrumb/breadcrumb.stories.jsx +7 -0
- package/src/patterns/components/breadcrumb/breadcrumb.twig +32 -0
- package/src/patterns/components/breadcrumb/breadcrumb.wingsuit.yml +35 -0
- package/src/patterns/components/breadcrumb/index.js +7 -0
- package/src/patterns/components/button/button.stories.jsx +7 -0
- package/src/patterns/components/button/button.twig +18 -0
- package/src/patterns/components/button/button.wingsuit.yml +104 -0
- package/src/patterns/components/button/index.js +6 -0
- package/src/patterns/components/callout/callout.behaviors.js +14 -0
- package/src/patterns/components/callout/callout.js +121 -0
- package/src/patterns/components/callout/callout.stories.jsx +7 -0
- package/src/patterns/components/callout/callout.twig +30 -0
- package/src/patterns/components/callout/callout.wingsuit.yml +66 -0
- package/src/patterns/components/callout/index.js +6 -0
- package/src/patterns/components/card/card.stories.jsx +7 -0
- package/src/patterns/components/card/card.twig +98 -0
- package/src/patterns/components/card/card.wingsuit.yml +300 -0
- package/src/patterns/components/card/index.js +6 -0
- package/src/patterns/components/cardgroup/cardgroup.stories.jsx +7 -0
- package/src/patterns/components/cardgroup/cardgroup.twig +30 -0
- package/src/patterns/components/cardgroup/cardgroup.wingsuit.yml +419 -0
- package/src/patterns/components/cardgroup/index.js +6 -0
- package/src/patterns/components/contextmenu/contextmenu.stories.jsx +7 -0
- package/src/patterns/components/contextmenu/contextmenu.twig +12 -0
- package/src/patterns/components/contextmenu/contextmenu.wingsuit.yml +23 -0
- package/src/patterns/components/contextmenu/index.js +6 -0
- package/src/patterns/components/dropdown/dropdown.stories.jsx +7 -0
- package/src/patterns/components/dropdown/dropdown.twig +20 -0
- package/src/patterns/components/dropdown/dropdown.wingsuit.yml +71 -0
- package/src/patterns/components/dropdown/index.js +6 -0
- package/src/patterns/components/fieldset/fieldset.twig +43 -0
- package/src/patterns/components/footer/footer.stories.jsx +7 -0
- package/src/patterns/components/footer/footer.twig +62 -0
- package/src/patterns/components/footer/footer.wingsuit.yml +104 -0
- package/src/patterns/components/footer/index.js +6 -0
- package/src/patterns/components/form/checkbox.twig +13 -0
- package/src/patterns/components/form/checkboxgroup.twig +5 -0
- package/src/patterns/components/form/datepicker.twig +32 -0
- package/src/patterns/components/form/file.twig +14 -0
- package/src/patterns/components/form/fileupload.behavior.js +14 -0
- package/src/patterns/components/form/fileupload.js +118 -0
- package/src/patterns/components/form/form.stories.jsx +7 -0
- package/src/patterns/components/form/form.twig +94 -0
- package/src/patterns/components/form/form.wingsuit.yml +973 -0
- package/src/patterns/components/form/index.js +7 -0
- package/src/patterns/components/form/input.twig +13 -0
- package/src/patterns/components/form/number.twig +13 -0
- package/src/patterns/components/form/radio.twig +4 -0
- package/src/patterns/components/form/textarea.twig +13 -0
- package/src/patterns/components/hero/hero.stories.jsx +7 -0
- package/src/patterns/components/hero/hero.twig +24 -0
- package/src/patterns/components/hero/hero.wingsuit.yml +56 -0
- package/src/patterns/components/hero/index.js +6 -0
- package/src/patterns/components/herocard/herocard.stories.jsx +7 -0
- package/src/patterns/components/herocard/herocard.twig +31 -0
- package/src/patterns/components/herocard/herocard.wingsuit.yml +43 -0
- package/src/patterns/components/herocard/index.js +6 -0
- package/src/patterns/components/icon/icon.twig +4 -0
- package/src/patterns/components/icon/index.js +6 -0
- package/src/patterns/components/image/image.stories.jsx +7 -0
- package/src/patterns/components/image/image.twig +19 -0
- package/src/patterns/components/image/image.wingsuit.yml +37 -0
- package/src/patterns/components/image/index.js +6 -0
- package/src/patterns/components/link/index.js +6 -0
- package/src/patterns/components/link/link.stories.jsx +7 -0
- package/src/patterns/components/link/link.twig +8 -0
- package/src/patterns/components/link/link.wingsuit.yml +35 -0
- package/src/patterns/components/linklist/index.js +6 -0
- package/src/patterns/components/linklist/linklist.stories.jsx +7 -0
- package/src/patterns/components/linklist/linklist.twig +26 -0
- package/src/patterns/components/linklist/linklist.wingsuit.yml +53 -0
- package/src/patterns/components/list/index.js +6 -0
- package/src/patterns/components/list/list-item.twig +6 -0
- package/src/patterns/components/list/list-item.wingsuit.yml +18 -0
- package/src/patterns/components/list/list.stories.jsx +7 -0
- package/src/patterns/components/list/list.twig +30 -0
- package/src/patterns/components/list/list.wingsuit.yml +48 -0
- package/src/patterns/components/loading/index.js +7 -0
- package/src/patterns/components/loading/loading.behavior.js +14 -0
- package/src/patterns/components/loading/loading.js +102 -0
- package/src/patterns/components/loading/loading.stories.jsx +7 -0
- package/src/patterns/components/loading/loading.twig +8 -0
- package/src/patterns/components/loading/loading.wingsuit.yml +37 -0
- package/src/patterns/components/modal/index.js +7 -0
- package/src/patterns/components/modal/modal.behavior.js +14 -0
- package/src/patterns/components/modal/modal.js +130 -0
- package/src/patterns/components/modal/modal.stories.jsx +7 -0
- package/src/patterns/components/modal/modal.twig +18 -0
- package/src/patterns/components/modal/modal.wingsuit.yml +54 -0
- package/src/patterns/components/notification/index.js +7 -0
- package/src/patterns/components/notification/notification.behavior.js +15 -0
- package/src/patterns/components/notification/notification.js +95 -0
- package/src/patterns/components/notification/notification.stories.jsx +7 -0
- package/src/patterns/components/notification/notification.twig +18 -0
- package/src/patterns/components/notification/notification.wingsuit.yml +58 -0
- package/src/patterns/components/pagination/Pagination.stories.jsx +7 -0
- package/src/patterns/components/pagination/index.js +6 -0
- package/src/patterns/components/pagination/pagination.twig +48 -0
- package/src/patterns/components/pagination/pagination.wingsuit.yml +72 -0
- package/src/patterns/components/polyfill/index.js +6 -0
- package/src/patterns/components/polyfill/polyfill.twig +10 -0
- package/src/patterns/components/profile/index.js +6 -0
- package/src/patterns/components/profile/profile.stories.jsx +7 -0
- package/src/patterns/components/profile/profile.twig +18 -0
- package/src/patterns/components/profile/profile.wingsuit.yml +35 -0
- package/src/patterns/components/readmore/index.js +7 -0
- package/src/patterns/components/readmore/readmore.behavior.js +14 -0
- package/src/patterns/components/readmore/readmore.js +119 -0
- package/src/patterns/components/readmore/readmore.stories.jsx +7 -0
- package/src/patterns/components/readmore/readmore.twig +16 -0
- package/src/patterns/components/readmore/readmore.wingsuit.yml +32 -0
- package/src/patterns/components/richtext/index.js +6 -0
- package/src/patterns/components/richtext/richtext.stories.jsx +7 -0
- package/src/patterns/components/richtext/richtext.twig +6 -0
- package/src/patterns/components/richtext/richtext.wingsuit.yml +12 -0
- package/src/patterns/components/searchfield/index.js +6 -0
- package/src/patterns/components/searchfield/searchfield.stories.jsx +7 -0
- package/src/patterns/components/searchfield/searchfield.twig +7 -0
- package/src/patterns/components/searchfield/searchfield.wingsuit.yml +22 -0
- package/src/patterns/components/table/index.js +7 -0
- package/src/patterns/components/table/table.behavior.js +14 -0
- package/src/patterns/components/table/table.js +279 -0
- package/src/patterns/components/table/table.stories.jsx +7 -0
- package/src/patterns/components/table/table.twig +36 -0
- package/src/patterns/components/table/table.wingsuit.yml +112 -0
- package/src/patterns/components/tableofcontents/index.js +6 -0
- package/src/patterns/components/tableofcontents/tableofcontents.stories.jsx +7 -0
- package/src/patterns/components/tableofcontents/tableofcontents.twig +14 -0
- package/src/patterns/components/tableofcontents/tableofcontents.wingsuit.yml +22 -0
- package/src/patterns/components/tabs/index.js +7 -0
- package/src/patterns/components/tabs/tabs.behavior.js +23 -0
- package/src/patterns/components/tabs/tabs.js +209 -0
- package/src/patterns/components/tabs/tabs.stories.jsx +7 -0
- package/src/patterns/components/tabs/tabs.twig +30 -0
- package/src/patterns/components/tabs/tabs.wingsuit.yml +168 -0
- package/src/patterns/components/tag/index.js +7 -0
- package/src/patterns/components/tag/tag-set.twig +15 -0
- package/src/patterns/components/tag/tag.behavior.js +14 -0
- package/src/patterns/components/tag/tag.stories.jsx +7 -0
- package/src/patterns/components/tag/tag.twig +24 -0
- package/src/patterns/components/tag/tag.wingsuit.yml +43 -0
- package/src/patterns/components/tag/tagset.js +160 -0
- package/src/patterns/components/tag/tagset.wingsuit.yml +43 -0
- package/src/patterns/components/tooltip/index.js +7 -0
- package/src/patterns/components/tooltip/tooltip.behavior.js +14 -0
- package/src/patterns/components/tooltip/tooltip.js +184 -0
- package/src/patterns/components/tooltip/tooltip.stories.jsx +7 -0
- package/src/patterns/components/tooltip/tooltip.twig +11 -0
- package/src/patterns/components/tooltip/tooltip.wingsuit.yml +30 -0
- package/src/patterns/components/video/index.js +7 -0
- package/src/patterns/components/video/video.behavior.js +14 -0
- package/src/patterns/components/video/video.js +114 -0
- package/src/patterns/components/video/video.stories.jsx +7 -0
- package/src/patterns/components/video/video.twig +17 -0
- package/src/patterns/components/video/video.wingsuit.yml +44 -0
- package/src/patterns/components/video/videoplayer.twig +10 -0
- package/src/tokens/exports/_colors.scss +7 -0
- package/src/tokens/exports/_font-families.scss +6 -0
- package/src/tokens/exports/_font-sizes-heading.scss +10 -0
- package/src/tokens/index.scss +7 -0
- package/src/vendorjs/lib.vendor.js +1 -0
- 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,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,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> </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
|