@ilo-org/twig 0.2.12 → 0.2.13
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/.eslintrc.js +37 -49
- package/.stylelintrc +2 -6
- package/.turbo/turbo-build:lib.log +2 -2
- package/CHANGELOG.md +12 -0
- package/apps/storybook/assets.js +5 -0
- package/apps/storybook/main.js +17 -8
- package/apps/storybook/manager-head.html +1 -1
- package/apps/storybook/manager.js +2 -2
- package/apps/storybook/patterns/colors.stories.mdx +9 -4
- package/apps/storybook/patterns/intro.stories.mdx +47 -42
- package/apps/storybook/patterns/typeset.stories.mdx +10 -6
- package/apps/storybook/patterns/welcome.stories.mdx +21 -16
- package/apps/storybook/preview-body.html +1 -1
- package/apps/storybook/preview.js +16 -16
- package/apps/storybook/styles.scss +1 -1
- package/apps/storybook/theme.js +5 -5
- package/babel.config.js +3 -3
- package/importprefix.js +5 -5
- package/importsvgs.js +3 -3
- package/jest.config.js +8 -8
- package/outputtwigs.js +16 -13
- package/package.json +46 -55
- package/postcss.config.js +2 -2
- package/src/namespaces.js +5 -5
- package/src/patterns/components/accordion/accordion-item.wingsuit.yml +1 -1
- package/src/patterns/components/accordion/accordion.behavior.js +2 -2
- package/src/patterns/components/accordion/accordion.js +31 -21
- package/src/patterns/components/accordion/accordion.stories.jsx +4 -2
- package/src/patterns/components/accordion/accordion.wingsuit.yml +4 -3
- package/src/patterns/components/accordion/index.js +3 -3
- package/src/patterns/components/breadcrumb/breadcrumb.behavior.js +2 -2
- package/src/patterns/components/breadcrumb/breadcrumb.js +14 -12
- package/src/patterns/components/breadcrumb/breadcrumb.stories.jsx +4 -2
- package/src/patterns/components/breadcrumb/breadcrumb.wingsuit.yml +1 -1
- package/src/patterns/components/breadcrumb/index.js +3 -3
- package/src/patterns/components/button/button.stories.jsx +4 -2
- package/src/patterns/components/button/button.wingsuit.yml +12 -12
- package/src/patterns/components/button/index.js +2 -2
- package/src/patterns/components/callout/callout.behavior.js +2 -2
- package/src/patterns/components/callout/callout.js +18 -13
- package/src/patterns/components/callout/callout.stories.jsx +4 -2
- package/src/patterns/components/callout/callout.wingsuit.yml +2 -2
- package/src/patterns/components/callout/index.js +3 -3
- package/src/patterns/components/card/card.stories.jsx +4 -2
- package/src/patterns/components/card/card.wingsuit.yml +8 -8
- package/src/patterns/components/card/index.js +2 -2
- package/src/patterns/components/cardgroup/cardgroup.stories.jsx +4 -2
- package/src/patterns/components/cardgroup/cardgroup.wingsuit.yml +31 -31
- package/src/patterns/components/cardgroup/index.js +2 -2
- package/src/patterns/components/contextmenu/contextmenu.stories.jsx +4 -2
- package/src/patterns/components/contextmenu/contextmenu.wingsuit.yml +7 -7
- package/src/patterns/components/contextmenu/index.js +2 -2
- package/src/patterns/components/dropdown/dropdown.stories.jsx +4 -2
- package/src/patterns/components/dropdown/dropdown.wingsuit.yml +4 -4
- package/src/patterns/components/dropdown/index.js +2 -2
- package/src/patterns/components/footer/footer.stories.jsx +4 -2
- package/src/patterns/components/footer/footer.wingsuit.yml +1 -1
- package/src/patterns/components/footer/index.js +2 -2
- package/src/patterns/components/form/fileupload.behavior.js +2 -2
- package/src/patterns/components/form/fileupload.js +6 -5
- package/src/patterns/components/form/form.stories.jsx +4 -2
- package/src/patterns/components/form/form.wingsuit.yml +92 -92
- package/src/patterns/components/form/index.js +3 -3
- package/src/patterns/components/hero/hero.stories.jsx +4 -2
- package/src/patterns/components/hero/hero.wingsuit.yml +4 -4
- package/src/patterns/components/hero/index.js +2 -2
- package/src/patterns/components/herocard/herocard.stories.jsx +4 -2
- package/src/patterns/components/herocard/herocard.wingsuit.yml +5 -5
- package/src/patterns/components/herocard/index.js +2 -2
- package/src/patterns/components/icon/index.js +2 -2
- package/src/patterns/components/image/image.stories.jsx +4 -2
- package/src/patterns/components/image/image.wingsuit.yml +9 -9
- package/src/patterns/components/image/index.js +2 -2
- package/src/patterns/components/link/index.js +2 -2
- package/src/patterns/components/link/link.stories.jsx +4 -2
- package/src/patterns/components/link/link.wingsuit.yml +3 -3
- package/src/patterns/components/linklist/index.js +2 -2
- package/src/patterns/components/linklist/linklist.stories.jsx +4 -2
- package/src/patterns/components/linklist/linklist.wingsuit.yml +15 -15
- package/src/patterns/components/list/index.js +2 -2
- package/src/patterns/components/list/list-item.wingsuit.yml +1 -1
- package/src/patterns/components/list/list.stories.jsx +4 -2
- package/src/patterns/components/list/list.wingsuit.yml +4 -4
- package/src/patterns/components/loading/index.js +3 -3
- package/src/patterns/components/loading/loading.behavior.js +2 -2
- package/src/patterns/components/loading/loading.js +2 -2
- package/src/patterns/components/loading/loading.stories.jsx +4 -2
- package/src/patterns/components/loading/loading.wingsuit.yml +5 -5
- package/src/patterns/components/localnav/index.js +3 -3
- package/src/patterns/components/localnav/localnav.stories.jsx +4 -2
- package/src/patterns/components/localnav/localnav.twig +3 -1
- package/src/patterns/components/localnav/localnav.wingsuit.yml +17 -19
- package/src/patterns/components/modal/index.js +3 -3
- package/src/patterns/components/modal/modal.behavior.js +2 -2
- package/src/patterns/components/modal/modal.js +9 -7
- package/src/patterns/components/modal/modal.stories.jsx +5 -2
- package/src/patterns/components/modal/modal.wingsuit.yml +20 -20
- package/src/patterns/components/navigation/index.js +3 -3
- package/src/patterns/components/navigation/navigation.behavior.js +2 -2
- package/src/patterns/components/navigation/navigation.js +110 -37
- package/src/patterns/components/navigation/navigation.stories.jsx +5 -2
- package/src/patterns/components/navigation/navigation.wingsuit.yml +7 -7
- package/src/patterns/components/notification/index.js +3 -3
- package/src/patterns/components/notification/notification.behavior.js +3 -3
- package/src/patterns/components/notification/notification.js +4 -2
- package/src/patterns/components/notification/notification.stories.jsx +5 -2
- package/src/patterns/components/notification/notification.wingsuit.yml +7 -7
- package/src/patterns/components/pagination/Pagination.stories.jsx +4 -2
- package/src/patterns/components/pagination/index.js +2 -2
- package/src/patterns/components/pagination/pagination.wingsuit.yml +12 -12
- package/src/patterns/components/polyfill/index.js +2 -2
- package/src/patterns/components/profile/index.js +2 -2
- package/src/patterns/components/profile/profile.stories.jsx +5 -2
- package/src/patterns/components/profile/profile.wingsuit.yml +3 -3
- package/src/patterns/components/readmore/index.js +3 -3
- package/src/patterns/components/readmore/readmore.behavior.js +2 -2
- package/src/patterns/components/readmore/readmore.js +4 -2
- package/src/patterns/components/readmore/readmore.stories.jsx +5 -2
- package/src/patterns/components/readmore/readmore.wingsuit.yml +4 -4
- package/src/patterns/components/richtext/index.js +2 -2
- package/src/patterns/components/richtext/richtext.stories.jsx +5 -2
- package/src/patterns/components/richtext/richtext.wingsuit.yml +1 -1
- package/src/patterns/components/searchfield/index.js +2 -2
- package/src/patterns/components/searchfield/searchfield.stories.jsx +5 -2
- package/src/patterns/components/searchfield/searchfield.wingsuit.yml +1 -1
- package/src/patterns/components/table/index.js +3 -3
- package/src/patterns/components/table/table.behavior.js +2 -2
- package/src/patterns/components/table/table.js +66 -44
- package/src/patterns/components/table/table.stories.jsx +5 -2
- package/src/patterns/components/table/table.wingsuit.yml +11 -21
- package/src/patterns/components/tableofcontents/index.js +3 -3
- package/src/patterns/components/tableofcontents/tableofcontents.behavior.js +2 -2
- package/src/patterns/components/tableofcontents/tableofcontents.js +27 -19
- package/src/patterns/components/tableofcontents/tableofcontents.stories.jsx +5 -2
- package/src/patterns/components/tableofcontents/tableofcontents.wingsuit.yml +14 -14
- package/src/patterns/components/tabs/index.js +3 -3
- package/src/patterns/components/tabs/tabs.behavior.js +4 -4
- package/src/patterns/components/tabs/tabs.js +12 -8
- package/src/patterns/components/tabs/tabs.stories.jsx +5 -2
- package/src/patterns/components/tabs/tabs.wingsuit.yml +120 -120
- package/src/patterns/components/tags/index.js +3 -3
- package/src/patterns/components/tags/tag.behavior.js +2 -2
- package/src/patterns/components/tags/tag.js +12 -12
- package/src/patterns/components/tags/tag.stories.jsx +5 -2
- package/src/patterns/components/tags/tag.wingsuit.yml +3 -3
- package/src/patterns/components/tags/tags.wingsuit.yml +1 -1
- package/src/patterns/components/tooltip/index.js +3 -3
- package/src/patterns/components/tooltip/tooltip.behavior.js +2 -2
- package/src/patterns/components/tooltip/tooltip.js +35 -25
- package/src/patterns/components/tooltip/tooltip.stories.jsx +5 -2
- package/src/patterns/components/tooltip/tooltip.wingsuit.yml +4 -4
- package/src/patterns/components/video/index.js +3 -3
- package/src/patterns/components/video/video.behavior.js +2 -2
- package/src/patterns/components/video/video.js +6 -5
- package/src/patterns/components/video/video.stories.jsx +5 -2
- package/src/patterns/components/video/video.wingsuit.yml +11 -11
- package/src/vendorjs/lib.vendor.js +1 -1
- package/wingsuit.config.js +14 -13
- package/.editorconfig +0 -12
- package/.eslintignore +0 -11
- package/.prettierignore +0 -16
- package/.prettierrc.js +0 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Callout from
|
|
1
|
+
import Callout from "./callout";
|
|
2
2
|
|
|
3
3
|
Drupal.behaviors.callout = {
|
|
4
4
|
attach() {
|
|
@@ -6,7 +6,7 @@ Drupal.behaviors.callout = {
|
|
|
6
6
|
document.querySelectorAll(`[data-loadcomponent="Callout"]`),
|
|
7
7
|
(element) => {
|
|
8
8
|
// eslint-disable-next-line no-console
|
|
9
|
-
console.log(
|
|
9
|
+
console.log("loading Callout component....");
|
|
10
10
|
new Callout(element);
|
|
11
11
|
}
|
|
12
12
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EVENTS } from
|
|
1
|
+
import { EVENTS } from "@ilo-org/utils";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The Callout module which handles rendering field labels inline on a form.
|
|
@@ -18,7 +18,7 @@ export default class Callout {
|
|
|
18
18
|
* @property {Object}
|
|
19
19
|
*/
|
|
20
20
|
this.element = element;
|
|
21
|
-
this.toggleLabel =
|
|
21
|
+
this.toggleLabel = "";
|
|
22
22
|
|
|
23
23
|
// Initialize the view
|
|
24
24
|
this.init();
|
|
@@ -52,15 +52,18 @@ export default class Callout {
|
|
|
52
52
|
* The field that a user interacts with on a form
|
|
53
53
|
* @type {Object}
|
|
54
54
|
*/
|
|
55
|
-
this.toggle = this.element.querySelector(
|
|
56
|
-
this.toggleOpen = this.element.classList.value.includes(
|
|
57
|
-
this.toggleCollapsible =
|
|
55
|
+
this.toggle = this.element.querySelector(".ilo--callout--toggle");
|
|
56
|
+
this.toggleOpen = this.element.classList.value.includes("callout--open");
|
|
57
|
+
this.toggleCollapsible =
|
|
58
|
+
this.element.classList.value.includes("callout--collapse");
|
|
58
59
|
if (this.toggle) {
|
|
59
|
-
this.toggleLabel = this.toggle.querySelector(
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
this.toggleLabel = this.toggle.querySelector(
|
|
61
|
+
".ilo--callout--button-text"
|
|
62
|
+
);
|
|
63
|
+
this.toggleLabelOpen = this.toggle.getAttribute("data-open");
|
|
64
|
+
this.toggleLabelClosed = this.toggle.getAttribute("data-closed");
|
|
62
65
|
}
|
|
63
|
-
this.button = this.element.querySelector(
|
|
66
|
+
this.button = this.element.querySelector(".ilo--button");
|
|
64
67
|
|
|
65
68
|
return this;
|
|
66
69
|
}
|
|
@@ -116,9 +119,9 @@ export default class Callout {
|
|
|
116
119
|
* @return {Object} Callout A reference to the instance of the class
|
|
117
120
|
* @chainable
|
|
118
121
|
*/
|
|
119
|
-
handleClick(
|
|
122
|
+
handleClick() {
|
|
120
123
|
// callback of sorts
|
|
121
|
-
console.log(
|
|
124
|
+
console.log("button clicked");
|
|
122
125
|
|
|
123
126
|
return this;
|
|
124
127
|
}
|
|
@@ -136,9 +139,11 @@ export default class Callout {
|
|
|
136
139
|
e.preventDefault();
|
|
137
140
|
this.toggleOpen = !this.toggleOpen;
|
|
138
141
|
|
|
139
|
-
const label = this.toggleOpen
|
|
142
|
+
const label = this.toggleOpen
|
|
143
|
+
? this.toggleLabelOpen
|
|
144
|
+
: this.toggleLabelClosed;
|
|
140
145
|
|
|
141
|
-
this.element.classList.toggle(
|
|
146
|
+
this.element.classList.toggle("ilo--callout--open");
|
|
142
147
|
this.toggleLabel.innerText = label;
|
|
143
148
|
|
|
144
149
|
return this;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./callout.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
5
7
|
export const wingsuit = {
|
|
6
8
|
patternDefinition,
|
|
7
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
callout:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/callout/callout.twig"
|
|
3
3
|
label: Callout
|
|
4
4
|
description: A callout alert section with a few different types
|
|
5
5
|
fields:
|
|
@@ -44,7 +44,7 @@ callout:
|
|
|
44
44
|
error: Error
|
|
45
45
|
success: Success
|
|
46
46
|
warning: Warning
|
|
47
|
-
preview:
|
|
47
|
+
preview: "info"
|
|
48
48
|
isCollapsible:
|
|
49
49
|
type: select
|
|
50
50
|
label: Is Collapsible?
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./card.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
5
7
|
export const wingsuit = {
|
|
6
8
|
patternDefinition,
|
|
7
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
card:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/card/card.twig"
|
|
3
3
|
label: Card
|
|
4
4
|
description: The Card presents an image banner.
|
|
5
5
|
fields:
|
|
@@ -80,13 +80,13 @@ card:
|
|
|
80
80
|
green: green
|
|
81
81
|
yellow: yellow
|
|
82
82
|
blue: blue
|
|
83
|
-
preview:
|
|
83
|
+
preview: "blue"
|
|
84
84
|
theme:
|
|
85
85
|
type: select
|
|
86
86
|
label: Theme
|
|
87
87
|
description: The theme type for the card. Theme choice doesn't apply to these card types - `Multilink`, `Data`, `Stat` and `Detail`
|
|
88
88
|
required: false
|
|
89
|
-
preview:
|
|
89
|
+
preview: "light"
|
|
90
90
|
options:
|
|
91
91
|
dark: Dark
|
|
92
92
|
light: Light
|
|
@@ -94,7 +94,7 @@ card:
|
|
|
94
94
|
type: select
|
|
95
95
|
label: Size
|
|
96
96
|
description: Size of the cards (usually reduces padding). `Wide` on Multilink and Feature cause a two column structure above a desktop breakpoint.
|
|
97
|
-
preview:
|
|
97
|
+
preview: "standard"
|
|
98
98
|
options:
|
|
99
99
|
wide: Wide
|
|
100
100
|
standard: Standard
|
|
@@ -168,11 +168,11 @@ card:
|
|
|
168
168
|
linkgroup:
|
|
169
169
|
- links:
|
|
170
170
|
- label: Link One
|
|
171
|
-
url:
|
|
171
|
+
url: "http://www.google.com"
|
|
172
172
|
- label: Link Two
|
|
173
|
-
url:
|
|
173
|
+
url: "http://www.google.com"
|
|
174
174
|
- label: Link Three
|
|
175
|
-
url:
|
|
175
|
+
url: "http://www.google.com"
|
|
176
176
|
graphicpromo:
|
|
177
177
|
label: Graphic Promo Card
|
|
178
178
|
description: The graphic promo Card
|
|
@@ -200,7 +200,7 @@ card:
|
|
|
200
200
|
- headline: ""
|
|
201
201
|
links:
|
|
202
202
|
- label: Link One
|
|
203
|
-
url:
|
|
203
|
+
url: "http://www.google.com"
|
|
204
204
|
detail:
|
|
205
205
|
label: Detail Card
|
|
206
206
|
description: The Detail Card
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./cardgroup.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
5
7
|
export const wingsuit = {
|
|
6
8
|
patternDefinition,
|
|
7
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
cardgroup:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/cardgroup/cardgroup.twig"
|
|
3
3
|
label: Card Group
|
|
4
4
|
description: The Card group
|
|
5
5
|
fields:
|
|
@@ -7,7 +7,7 @@ cardgroup:
|
|
|
7
7
|
type: object
|
|
8
8
|
label: Group of cards
|
|
9
9
|
description: The group of cards, object
|
|
10
|
-
preview:
|
|
10
|
+
preview:
|
|
11
11
|
cta:
|
|
12
12
|
type: object
|
|
13
13
|
label: CTA
|
|
@@ -38,11 +38,11 @@ cardgroup:
|
|
|
38
38
|
- headline: ""
|
|
39
39
|
links:
|
|
40
40
|
- label: Link One
|
|
41
|
-
url:
|
|
41
|
+
url: "http://www.google.com"
|
|
42
42
|
- label: Link Two
|
|
43
|
-
url:
|
|
43
|
+
url: "http://www.google.com"
|
|
44
44
|
- label: Link Three
|
|
45
|
-
url:
|
|
45
|
+
url: "http://www.google.com"
|
|
46
46
|
- title: "Multi-link card second - right aligned image, wide option"
|
|
47
47
|
image: "https://placekitten.com/475/267"
|
|
48
48
|
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."
|
|
@@ -59,11 +59,11 @@ cardgroup:
|
|
|
59
59
|
- headline: ""
|
|
60
60
|
links:
|
|
61
61
|
- label: Link One
|
|
62
|
-
url:
|
|
62
|
+
url: "http://www.google.com"
|
|
63
63
|
- label: Link Two
|
|
64
|
-
url:
|
|
64
|
+
url: "http://www.google.com"
|
|
65
65
|
- label: Link Three
|
|
66
|
-
url:
|
|
66
|
+
url: "http://www.google.com"
|
|
67
67
|
- title: "Multi-link card - right aligned image, wide option"
|
|
68
68
|
image: "https://placekitten.com/475/267"
|
|
69
69
|
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."
|
|
@@ -80,12 +80,12 @@ cardgroup:
|
|
|
80
80
|
- headline: ""
|
|
81
81
|
links:
|
|
82
82
|
- label: Link One
|
|
83
|
-
url:
|
|
83
|
+
url: "http://www.google.com"
|
|
84
84
|
- label: Link Two
|
|
85
|
-
url:
|
|
85
|
+
url: "http://www.google.com"
|
|
86
86
|
- label: Link Three
|
|
87
|
-
url:
|
|
88
|
-
settings:
|
|
87
|
+
url: "http://www.google.com"
|
|
88
|
+
settings:
|
|
89
89
|
type: multilink
|
|
90
90
|
feature:
|
|
91
91
|
label: Feature
|
|
@@ -152,7 +152,7 @@ cardgroup:
|
|
|
152
152
|
list: ""
|
|
153
153
|
dataset: ""
|
|
154
154
|
color: ""
|
|
155
|
-
settings:
|
|
155
|
+
settings:
|
|
156
156
|
type: feature
|
|
157
157
|
detail:
|
|
158
158
|
label: Detail
|
|
@@ -191,7 +191,7 @@ cardgroup:
|
|
|
191
191
|
list: ""
|
|
192
192
|
dataset: ""
|
|
193
193
|
color: ""
|
|
194
|
-
settings:
|
|
194
|
+
settings:
|
|
195
195
|
type: detail
|
|
196
196
|
theme: light
|
|
197
197
|
graphicpromo:
|
|
@@ -207,7 +207,7 @@ cardgroup:
|
|
|
207
207
|
link: "https://www.google.com/search?q=graphic-promo"
|
|
208
208
|
profile: ""
|
|
209
209
|
eventdetails: ""
|
|
210
|
-
cta:
|
|
210
|
+
cta:
|
|
211
211
|
label: "Discover our unique mission"
|
|
212
212
|
url: "https://www.google.com/search?q=button"
|
|
213
213
|
source: ""
|
|
@@ -231,7 +231,7 @@ cardgroup:
|
|
|
231
231
|
eventdetails: ""
|
|
232
232
|
cta: ""
|
|
233
233
|
list: ""
|
|
234
|
-
source:
|
|
234
|
+
source:
|
|
235
235
|
label: "Source: lorem ipsum dolor sit amet, 2020"
|
|
236
236
|
url: "https://www.google.com/search?q=stat"
|
|
237
237
|
color: blue
|
|
@@ -245,7 +245,7 @@ cardgroup:
|
|
|
245
245
|
eventdetails: ""
|
|
246
246
|
cta: ""
|
|
247
247
|
list: ""
|
|
248
|
-
source:
|
|
248
|
+
source:
|
|
249
249
|
label: "Source: lorem ipsum dolor sit amet, 2020"
|
|
250
250
|
url: "https://www.google.com/search?q=stat"
|
|
251
251
|
color: green
|
|
@@ -259,7 +259,7 @@ cardgroup:
|
|
|
259
259
|
eventdetails: ""
|
|
260
260
|
cta: ""
|
|
261
261
|
list: ""
|
|
262
|
-
source:
|
|
262
|
+
source:
|
|
263
263
|
label: "Source: lorem ipsum dolor sit amet, 2020"
|
|
264
264
|
url: "https://www.google.com/search?q=stat"
|
|
265
265
|
color: yellow
|
|
@@ -273,7 +273,7 @@ cardgroup:
|
|
|
273
273
|
eventdetails: ""
|
|
274
274
|
cta: ""
|
|
275
275
|
list: ""
|
|
276
|
-
source:
|
|
276
|
+
source:
|
|
277
277
|
label: "Source: lorem ipsum dolor sit amet, 2020"
|
|
278
278
|
url: "https://www.google.com/search?q=stat"
|
|
279
279
|
color: turquoise
|
|
@@ -316,12 +316,12 @@ cardgroup:
|
|
|
316
316
|
profile: ""
|
|
317
317
|
eventdetails: ""
|
|
318
318
|
cta: ""
|
|
319
|
-
list:
|
|
319
|
+
list:
|
|
320
320
|
title: ""
|
|
321
321
|
settings:
|
|
322
322
|
- ordered: unordered
|
|
323
323
|
- alignment: default
|
|
324
|
-
items:
|
|
324
|
+
items:
|
|
325
325
|
- content: "Wipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor."
|
|
326
326
|
id: "list1"
|
|
327
327
|
- content: "Nut labore et dolore magna sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
|
@@ -342,16 +342,16 @@ cardgroup:
|
|
|
342
342
|
profile: ""
|
|
343
343
|
eventdetails: ""
|
|
344
344
|
cta: ""
|
|
345
|
-
dataset:
|
|
346
|
-
content:
|
|
347
|
-
items:
|
|
345
|
+
dataset:
|
|
346
|
+
content:
|
|
347
|
+
items:
|
|
348
348
|
- label: Date
|
|
349
349
|
copy: Publication date
|
|
350
350
|
- label: Event type
|
|
351
351
|
copy: Event location
|
|
352
352
|
files:
|
|
353
353
|
headline: Files
|
|
354
|
-
items:
|
|
354
|
+
items:
|
|
355
355
|
- label: File/size MB 1
|
|
356
356
|
url: "https://www.google.com/search?q=file1"
|
|
357
357
|
- label: File/size MB 2
|
|
@@ -360,7 +360,7 @@ cardgroup:
|
|
|
360
360
|
url: "https://www.google.com/search?q=file3"
|
|
361
361
|
links:
|
|
362
362
|
headline: Languages
|
|
363
|
-
items:
|
|
363
|
+
items:
|
|
364
364
|
- label: Language link 1
|
|
365
365
|
url: "https://www.google.com/search?q=link"
|
|
366
366
|
- label: Language link 2
|
|
@@ -375,7 +375,7 @@ cardgroup:
|
|
|
375
375
|
type: select
|
|
376
376
|
label: Size
|
|
377
377
|
description: Size of the cards (usually reduces padding)
|
|
378
|
-
preview:
|
|
378
|
+
preview: "standard"
|
|
379
379
|
options:
|
|
380
380
|
wide: wide
|
|
381
381
|
standard: Standard
|
|
@@ -384,7 +384,7 @@ cardgroup:
|
|
|
384
384
|
type: select
|
|
385
385
|
label: Color
|
|
386
386
|
description: Color of the stat cards, options are turquoise, green, yellow, or blue
|
|
387
|
-
preview:
|
|
387
|
+
preview: "blue"
|
|
388
388
|
options:
|
|
389
389
|
blue: Blue
|
|
390
390
|
turquoise: Turquoise
|
|
@@ -395,7 +395,7 @@ cardgroup:
|
|
|
395
395
|
label: Card Count
|
|
396
396
|
description: Number of cards within a group
|
|
397
397
|
required: true
|
|
398
|
-
preview:
|
|
398
|
+
preview: "detail"
|
|
399
399
|
options:
|
|
400
400
|
data: Data
|
|
401
401
|
detail: Detail
|
|
@@ -410,7 +410,7 @@ cardgroup:
|
|
|
410
410
|
label: Card Count
|
|
411
411
|
description: Number of cards within a group
|
|
412
412
|
required: true
|
|
413
|
-
preview:
|
|
413
|
+
preview: "two"
|
|
414
414
|
options:
|
|
415
415
|
one: One
|
|
416
416
|
two: Two
|
|
@@ -421,7 +421,7 @@ cardgroup:
|
|
|
421
421
|
label: Theme
|
|
422
422
|
description: The theme type for the hero
|
|
423
423
|
required: false
|
|
424
|
-
preview:
|
|
424
|
+
preview: "dark"
|
|
425
425
|
options:
|
|
426
426
|
dark: Dark
|
|
427
427
|
light: Light
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./contextmenu.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
5
7
|
export const wingsuit = {
|
|
6
8
|
patternDefinition,
|
|
7
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
contextmenu:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/contextmenu/contextmenu.twig"
|
|
3
3
|
label: Context Menu
|
|
4
4
|
description: The ContextMenu receives a list of urls with labels and an optional prop indicating if this link is at the end of a 'section.'
|
|
5
5
|
fields:
|
|
@@ -10,14 +10,14 @@ contextmenu:
|
|
|
10
10
|
required: true
|
|
11
11
|
preview:
|
|
12
12
|
- label: Link One
|
|
13
|
-
url:
|
|
13
|
+
url: "http://www.google.com"
|
|
14
14
|
- label: Link Two
|
|
15
|
-
url:
|
|
16
|
-
- endsection:
|
|
15
|
+
url: "http://www.google.com"
|
|
16
|
+
- endsection: "true"
|
|
17
17
|
label: Link Three Ends A Section
|
|
18
|
-
url:
|
|
18
|
+
url: "http://www.google.com"
|
|
19
19
|
- label: Link Four
|
|
20
|
-
url:
|
|
20
|
+
url: "http://www.google.com"
|
|
21
21
|
- label: Link Five Is Slightly Longer
|
|
22
|
-
url:
|
|
22
|
+
url: "http://www.google.com"
|
|
23
23
|
visibility: storybook
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./dropdown.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
5
7
|
export const wingsuit = {
|
|
6
8
|
patternDefinition,
|
|
7
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
dropdown:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/dropdown/dropdown.twig"
|
|
3
3
|
label: Dropdown
|
|
4
4
|
description: The Dropdown displays a select element with options, and is most
|
|
5
5
|
commonly used in forms.
|
|
@@ -14,7 +14,7 @@ dropdown:
|
|
|
14
14
|
type: string
|
|
15
15
|
label: error
|
|
16
16
|
description: Does this have an error? If so, the error message
|
|
17
|
-
preview:
|
|
17
|
+
preview: ""
|
|
18
18
|
required: false
|
|
19
19
|
helper:
|
|
20
20
|
type: string
|
|
@@ -62,7 +62,7 @@ dropdown:
|
|
|
62
62
|
label: autocomplete
|
|
63
63
|
description: Should this field autocomplete
|
|
64
64
|
options:
|
|
65
|
-
true:
|
|
65
|
+
true: "true"
|
|
66
66
|
false: false
|
|
67
67
|
preview: false
|
|
68
68
|
required: false
|
|
@@ -71,7 +71,7 @@ dropdown:
|
|
|
71
71
|
label: disabled
|
|
72
72
|
description: Is this field disabled?
|
|
73
73
|
options:
|
|
74
|
-
true:
|
|
74
|
+
true: "true"
|
|
75
75
|
false: false
|
|
76
76
|
preview: false
|
|
77
77
|
required: false
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./footer.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
5
7
|
export const wingsuit = {
|
|
6
8
|
patternDefinition,
|
|
7
9
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import FileUpload from
|
|
1
|
+
import FileUpload from "./fileupload";
|
|
2
2
|
|
|
3
3
|
Drupal.behaviors.fileupload = {
|
|
4
4
|
attach() {
|
|
@@ -6,7 +6,7 @@ Drupal.behaviors.fileupload = {
|
|
|
6
6
|
document.querySelectorAll(`[data-loadcomponent="FileUpload"]`),
|
|
7
7
|
(element) => {
|
|
8
8
|
// eslint-disable-next-line no-console
|
|
9
|
-
console.log(
|
|
9
|
+
console.log("loading FileUpload component....");
|
|
10
10
|
new FileUpload(element);
|
|
11
11
|
}
|
|
12
12
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EVENTS } from "@ilo-org/utils";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The FileUpload module which handles rendering field labels inline on a form.
|
|
@@ -87,15 +87,16 @@ export default class FileUpload {
|
|
|
87
87
|
* @chainable
|
|
88
88
|
*/
|
|
89
89
|
onChange(e) {
|
|
90
|
-
const oldDiv =
|
|
90
|
+
const oldDiv =
|
|
91
|
+
this.container.querySelector(`.${this.prefix}--fieldset--input`) !== null;
|
|
91
92
|
if (oldDiv) {
|
|
92
93
|
this.container.remove(oldDiv);
|
|
93
94
|
}
|
|
94
|
-
const newDiv = document.createElement(
|
|
95
|
+
const newDiv = document.createElement("div");
|
|
95
96
|
newDiv.classList.add(`${this.prefix}--fieldset--input`);
|
|
96
|
-
const fileList = document.createElement(
|
|
97
|
+
const fileList = document.createElement("ul");
|
|
97
98
|
fileList.classList.add(`${this.prefix}--file-upload--list`);
|
|
98
|
-
let files =
|
|
99
|
+
let files = "";
|
|
99
100
|
[...e.target.files].map((file) => {
|
|
100
101
|
files += this.template(file.name);
|
|
101
102
|
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./form.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
5
7
|
export const wingsuit = {
|
|
6
8
|
patternDefinition,
|
|
7
9
|
};
|