@ilo-org/twig 0.2.11 → 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 +20 -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 +47 -56
- 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 { EVENTS } from
|
|
1
|
+
import { EVENTS } from "@ilo-org/utils";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The Navigation module which handles rendering field labels inline on a form.
|
|
@@ -52,17 +52,31 @@ export default class Navigation {
|
|
|
52
52
|
* The button for toggling Subnav state
|
|
53
53
|
* @type {Object}
|
|
54
54
|
*/
|
|
55
|
-
this.subnavButton = this.element.querySelector(
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
this.subnavButton = this.element.querySelector(
|
|
56
|
+
`.${this.prefix}--nav--trigger`
|
|
57
|
+
);
|
|
58
|
+
this.menuCloseSet = this.element.querySelectorAll(
|
|
59
|
+
`.${this.prefix}--header--menu--close`
|
|
60
|
+
);
|
|
61
|
+
this.subnavBack = this.element.querySelectorAll(
|
|
62
|
+
`.${this.prefix}--mobile--subnav--back`
|
|
63
|
+
);
|
|
58
64
|
this.menuOpen = this.element.querySelector(`.${this.prefix}--header--menu`);
|
|
59
|
-
this.searchButton = this.element.querySelector(
|
|
60
|
-
|
|
65
|
+
this.searchButton = this.element.querySelector(
|
|
66
|
+
`.${this.prefix}--search--button`
|
|
67
|
+
);
|
|
68
|
+
this.contextButton = this.element.querySelector(
|
|
69
|
+
`.${this.prefix}--language-switcher--button`
|
|
70
|
+
);
|
|
61
71
|
this.languageButton = this.element.querySelector(
|
|
62
72
|
`.${this.prefix}--mobile--nav--language--switcher--button`
|
|
63
73
|
);
|
|
64
|
-
this.contextLinks = this.element.querySelectorAll(
|
|
65
|
-
|
|
74
|
+
this.contextLinks = this.element.querySelectorAll(
|
|
75
|
+
`.${this.prefix}--context-menu--link`
|
|
76
|
+
);
|
|
77
|
+
this.languageLinks = this.element.querySelectorAll(
|
|
78
|
+
`.${this.prefix}--nav--language`
|
|
79
|
+
);
|
|
66
80
|
this.body = document.body;
|
|
67
81
|
|
|
68
82
|
return this;
|
|
@@ -105,62 +119,96 @@ export default class Navigation {
|
|
|
105
119
|
enable() {
|
|
106
120
|
// subnavButton
|
|
107
121
|
if (this.subnavButton) {
|
|
108
|
-
this.subnavButton.addEventListener(EVENTS.CLICK, (e) =>
|
|
109
|
-
|
|
122
|
+
this.subnavButton.addEventListener(EVENTS.CLICK, (e) =>
|
|
123
|
+
this.subnavClick(e)
|
|
124
|
+
);
|
|
125
|
+
this.subnavButton.addEventListener(EVENTS.TOUCH_START, (e) =>
|
|
126
|
+
this.subnavClick(e)
|
|
127
|
+
);
|
|
110
128
|
}
|
|
111
129
|
|
|
112
130
|
// subnavBack
|
|
113
131
|
if (this.subnavBack.length > 0) {
|
|
114
|
-
this.subnavBack.forEach((button
|
|
132
|
+
this.subnavBack.forEach((button) => {
|
|
115
133
|
button.addEventListener(EVENTS.CLICK, (e) => this.subnavBackClick(e));
|
|
116
|
-
button.addEventListener(EVENTS.TOUCH_START, (e) =>
|
|
134
|
+
button.addEventListener(EVENTS.TOUCH_START, (e) =>
|
|
135
|
+
this.subnavBackClick(e)
|
|
136
|
+
);
|
|
117
137
|
});
|
|
118
138
|
}
|
|
119
139
|
|
|
120
140
|
// searchButton
|
|
121
141
|
if (this.searchButton) {
|
|
122
|
-
this.searchButton.addEventListener(EVENTS.CLICK, (e) =>
|
|
123
|
-
|
|
142
|
+
this.searchButton.addEventListener(EVENTS.CLICK, (e) =>
|
|
143
|
+
this.searchButtonClick(e)
|
|
144
|
+
);
|
|
145
|
+
this.searchButton.addEventListener(EVENTS.TOUCH_START, (e) =>
|
|
146
|
+
this.searchButtonClick(e)
|
|
147
|
+
);
|
|
124
148
|
}
|
|
125
149
|
// menuCloseSet
|
|
126
150
|
if (this.menuCloseSet.length > 0) {
|
|
127
151
|
this.menuCloseSet.forEach((closeButton, i) => {
|
|
128
|
-
closeButton.addEventListener(EVENTS.CLICK, () =>
|
|
129
|
-
|
|
152
|
+
closeButton.addEventListener(EVENTS.CLICK, () =>
|
|
153
|
+
this.menuCloseClick(i)
|
|
154
|
+
);
|
|
155
|
+
closeButton.addEventListener(EVENTS.TOUCH_START, () =>
|
|
156
|
+
this.menuCloseClick(i)
|
|
157
|
+
);
|
|
130
158
|
});
|
|
131
159
|
}
|
|
132
160
|
|
|
133
161
|
// menuOpen
|
|
134
162
|
if (this.menuOpen) {
|
|
135
|
-
this.menuOpen.addEventListener(EVENTS.CLICK, (e) =>
|
|
136
|
-
|
|
163
|
+
this.menuOpen.addEventListener(EVENTS.CLICK, (e) =>
|
|
164
|
+
this.menuOpenClick(e)
|
|
165
|
+
);
|
|
166
|
+
this.menuOpen.addEventListener(EVENTS.TOUCH_START, (e) =>
|
|
167
|
+
this.menuOpenClick(e)
|
|
168
|
+
);
|
|
137
169
|
}
|
|
138
170
|
|
|
139
171
|
// contextButton
|
|
140
172
|
if (this.contextButton) {
|
|
141
|
-
this.contextButton.addEventListener(EVENTS.CLICK, (e) =>
|
|
142
|
-
|
|
173
|
+
this.contextButton.addEventListener(EVENTS.CLICK, (e) =>
|
|
174
|
+
this.contextButtonClick(e)
|
|
175
|
+
);
|
|
176
|
+
this.contextButton.addEventListener(EVENTS.TOUCH_START, (e) =>
|
|
177
|
+
this.contextButtonClick(e)
|
|
178
|
+
);
|
|
143
179
|
}
|
|
144
180
|
|
|
145
181
|
// languageButton
|
|
146
182
|
if (this.languageButton) {
|
|
147
|
-
this.languageButton.addEventListener(EVENTS.CLICK, () =>
|
|
148
|
-
|
|
183
|
+
this.languageButton.addEventListener(EVENTS.CLICK, () =>
|
|
184
|
+
this.languageButtonClick()
|
|
185
|
+
);
|
|
186
|
+
this.languageButton.addEventListener(EVENTS.TOUCH_START, () =>
|
|
187
|
+
this.languageButtonClick()
|
|
188
|
+
);
|
|
149
189
|
}
|
|
150
190
|
|
|
151
191
|
// contextLinks
|
|
152
192
|
if (this.contextLinks.length > 0 && this.callback) {
|
|
153
|
-
this.contextLinks.forEach((contextLink
|
|
154
|
-
contextLink.addEventListener(EVENTS.CLICK, (e) =>
|
|
155
|
-
|
|
193
|
+
this.contextLinks.forEach((contextLink) => {
|
|
194
|
+
contextLink.addEventListener(EVENTS.CLICK, (e) =>
|
|
195
|
+
this.contextLinkClick(e)
|
|
196
|
+
);
|
|
197
|
+
contextLink.addEventListener(EVENTS.TOUCH_START, (e) =>
|
|
198
|
+
this.contextLinkClick(e)
|
|
199
|
+
);
|
|
156
200
|
});
|
|
157
201
|
}
|
|
158
202
|
|
|
159
203
|
// languageLinks
|
|
160
204
|
if (this.languageLinks.length > 0 && this.callback) {
|
|
161
|
-
this.languageLinks.forEach((languageLink
|
|
162
|
-
languageLink.addEventListener(EVENTS.CLICK, (e) =>
|
|
163
|
-
|
|
205
|
+
this.languageLinks.forEach((languageLink) => {
|
|
206
|
+
languageLink.addEventListener(EVENTS.CLICK, (e) =>
|
|
207
|
+
this.contextLinkClick(e)
|
|
208
|
+
);
|
|
209
|
+
languageLink.addEventListener(EVENTS.TOUCH_START, (e) =>
|
|
210
|
+
this.contextLinkClick(e)
|
|
211
|
+
);
|
|
164
212
|
});
|
|
165
213
|
}
|
|
166
214
|
|
|
@@ -212,7 +260,7 @@ export default class Navigation {
|
|
|
212
260
|
* @chainable
|
|
213
261
|
*/
|
|
214
262
|
handleKeyPress(e, callback) {
|
|
215
|
-
if (e.key ===
|
|
263
|
+
if (e.key === "Escape") {
|
|
216
264
|
callback(e);
|
|
217
265
|
}
|
|
218
266
|
|
|
@@ -245,7 +293,11 @@ export default class Navigation {
|
|
|
245
293
|
(ev) => this.keyPress(ev, this.contextButtonClickOff),
|
|
246
294
|
false
|
|
247
295
|
);
|
|
248
|
-
this.body.addEventListener(
|
|
296
|
+
this.body.addEventListener(
|
|
297
|
+
EVENTS.CLICK,
|
|
298
|
+
(ev) => this.handleContextButtonClickOff(ev),
|
|
299
|
+
false
|
|
300
|
+
);
|
|
249
301
|
|
|
250
302
|
return this;
|
|
251
303
|
}
|
|
@@ -266,7 +318,8 @@ export default class Navigation {
|
|
|
266
318
|
);
|
|
267
319
|
this.body.removeEventListener(
|
|
268
320
|
EVENTS.CLICK,
|
|
269
|
-
(ev) =>
|
|
321
|
+
(ev) =>
|
|
322
|
+
this.handleContextButtonClickoff(ev, `${this.prefix}--context--open`),
|
|
270
323
|
false
|
|
271
324
|
);
|
|
272
325
|
|
|
@@ -306,7 +359,11 @@ export default class Navigation {
|
|
|
306
359
|
);
|
|
307
360
|
|
|
308
361
|
if (window.innerWidth >= 1024) {
|
|
309
|
-
this.body.addEventListener(
|
|
362
|
+
this.body.addEventListener(
|
|
363
|
+
EVENTS.CLICK,
|
|
364
|
+
(ev) => this.handleSearchButtonClickOff(ev),
|
|
365
|
+
false
|
|
366
|
+
);
|
|
310
367
|
}
|
|
311
368
|
|
|
312
369
|
return this;
|
|
@@ -327,7 +384,11 @@ export default class Navigation {
|
|
|
327
384
|
false
|
|
328
385
|
);
|
|
329
386
|
|
|
330
|
-
this.body.removeEventListener(
|
|
387
|
+
this.body.removeEventListener(
|
|
388
|
+
EVENTS.CLICK,
|
|
389
|
+
(ev) => this.handleSearchButtonClickOff(ev),
|
|
390
|
+
false
|
|
391
|
+
);
|
|
331
392
|
|
|
332
393
|
return this;
|
|
333
394
|
}
|
|
@@ -373,10 +434,18 @@ export default class Navigation {
|
|
|
373
434
|
handleSubnavClickOn(e) {
|
|
374
435
|
e.stopImmediatePropagation();
|
|
375
436
|
this.element.classList.add(`${this.prefix}--subnav--open`);
|
|
376
|
-
window.addEventListener(
|
|
437
|
+
window.addEventListener(
|
|
438
|
+
EVENTS.KEY_DOWN,
|
|
439
|
+
(ev) => this.keyPress(ev, this.subnavClickOff),
|
|
440
|
+
false
|
|
441
|
+
);
|
|
377
442
|
|
|
378
443
|
if (window.innerWidth >= 1024) {
|
|
379
|
-
this.body.addEventListener(
|
|
444
|
+
this.body.addEventListener(
|
|
445
|
+
EVENTS.CLICK,
|
|
446
|
+
(ev) => this.handleSubnavClickOff(ev),
|
|
447
|
+
false
|
|
448
|
+
);
|
|
380
449
|
}
|
|
381
450
|
return this;
|
|
382
451
|
}
|
|
@@ -396,7 +465,11 @@ export default class Navigation {
|
|
|
396
465
|
false
|
|
397
466
|
);
|
|
398
467
|
|
|
399
|
-
this.body.removeEventListener(
|
|
468
|
+
this.body.removeEventListener(
|
|
469
|
+
EVENTS.CLICK,
|
|
470
|
+
(ev) => this.handleSubnavClickOff(ev),
|
|
471
|
+
false
|
|
472
|
+
);
|
|
400
473
|
|
|
401
474
|
return this;
|
|
402
475
|
}
|
|
@@ -454,7 +527,7 @@ export default class Navigation {
|
|
|
454
527
|
* @return {Object} Breadcrumb A reference to the instance of the class
|
|
455
528
|
* @chainable
|
|
456
529
|
*/
|
|
457
|
-
handleResize(
|
|
530
|
+
handleResize() {
|
|
458
531
|
this.element.classList.remove(`${this.prefix}--context--open`);
|
|
459
532
|
this.element.classList.remove(`${this.prefix}--mobile--open`);
|
|
460
533
|
this.element.classList.remove(`${this.prefix}--subnav--open`);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./navigation.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
7
|
+
/* eslint-disable-next-line */
|
|
5
8
|
export const wingsuit = {
|
|
6
9
|
patternDefinition,
|
|
7
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
navigation:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/navigation/navigation.twig"
|
|
3
3
|
label: Navigation
|
|
4
4
|
description: The Navigation component
|
|
5
5
|
fields:
|
|
@@ -113,14 +113,14 @@ navigation:
|
|
|
113
113
|
preview:
|
|
114
114
|
links:
|
|
115
115
|
- label: Link One
|
|
116
|
-
url:
|
|
116
|
+
url: "http://www.google.com"
|
|
117
117
|
- label: Link Two
|
|
118
|
-
url:
|
|
119
|
-
- endsection:
|
|
118
|
+
url: "http://www.google.com"
|
|
119
|
+
- endsection: "true"
|
|
120
120
|
label: Link Three Ends A Section
|
|
121
|
-
url:
|
|
121
|
+
url: "http://www.google.com"
|
|
122
122
|
- label: Link Four
|
|
123
|
-
url:
|
|
123
|
+
url: "http://www.google.com"
|
|
124
124
|
- label: Link Five Is Slightly Longer
|
|
125
|
-
url:
|
|
125
|
+
url: "http://www.google.com"
|
|
126
126
|
visibility: storybook
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import Notification from
|
|
1
|
+
import Notification from "./notification";
|
|
2
2
|
|
|
3
3
|
Drupal.behaviors.notification = {
|
|
4
4
|
attach() {
|
|
5
|
-
console.log(
|
|
5
|
+
console.log("got here....");
|
|
6
6
|
Array.prototype.forEach.call(
|
|
7
7
|
document.querySelectorAll(`[data-loadcomponent="Notification"]`),
|
|
8
8
|
(element) => {
|
|
9
9
|
// eslint-disable-next-line no-console
|
|
10
|
-
console.log(
|
|
10
|
+
console.log("loading Notification component....");
|
|
11
11
|
new Notification(element);
|
|
12
12
|
}
|
|
13
13
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EVENTS } from
|
|
1
|
+
import { EVENTS } from "@ilo-org/utils";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The Notification module which handles rendering field labels inline on a form.
|
|
@@ -52,7 +52,9 @@ export default class Notification {
|
|
|
52
52
|
* The button for toggling Read More state
|
|
53
53
|
* @type {Object}
|
|
54
54
|
*/
|
|
55
|
-
this.CloseButton = this.element.querySelector(
|
|
55
|
+
this.CloseButton = this.element.querySelector(
|
|
56
|
+
`.${this.prefix}--notification--close`
|
|
57
|
+
);
|
|
56
58
|
|
|
57
59
|
return this;
|
|
58
60
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./notification.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
7
|
+
/* eslint-disable-next-line */
|
|
5
8
|
export const wingsuit = {
|
|
6
9
|
patternDefinition,
|
|
7
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
notification:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/notification/notification.twig"
|
|
3
3
|
label: Notification
|
|
4
4
|
description: The Notification component presents a dismissible alert.
|
|
5
5
|
fields:
|
|
@@ -8,26 +8,26 @@ notification:
|
|
|
8
8
|
label: Close Button Label
|
|
9
9
|
description: The label for the close button
|
|
10
10
|
required: true
|
|
11
|
-
preview:
|
|
11
|
+
preview: "Close"
|
|
12
12
|
copy:
|
|
13
13
|
type: string
|
|
14
14
|
label: Copy
|
|
15
15
|
description: The text content of the notification
|
|
16
16
|
required: true
|
|
17
|
-
preview:
|
|
17
|
+
preview: "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
18
18
|
cta:
|
|
19
19
|
type: object
|
|
20
20
|
label: Call To Action
|
|
21
21
|
description: an optional call to action button
|
|
22
22
|
preview:
|
|
23
23
|
label: Optional CTA
|
|
24
|
-
url:
|
|
24
|
+
url: "http://www.google.com"
|
|
25
25
|
headline:
|
|
26
26
|
type: string
|
|
27
27
|
label: Headline
|
|
28
28
|
description: The headline of the notification
|
|
29
29
|
required: true
|
|
30
|
-
preview:
|
|
30
|
+
preview: "With CTA"
|
|
31
31
|
timestamp:
|
|
32
32
|
type: object
|
|
33
33
|
label: Timestamp
|
|
@@ -43,7 +43,7 @@ notification:
|
|
|
43
43
|
options:
|
|
44
44
|
inline: Inline
|
|
45
45
|
dialog: Dialog
|
|
46
|
-
preview:
|
|
46
|
+
preview: "dialog"
|
|
47
47
|
type:
|
|
48
48
|
type: select
|
|
49
49
|
label: Type
|
|
@@ -54,5 +54,5 @@ notification:
|
|
|
54
54
|
info: Info
|
|
55
55
|
success: Success
|
|
56
56
|
warning: Warning
|
|
57
|
-
preview:
|
|
57
|
+
preview: "info"
|
|
58
58
|
visibility: storybook
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./pagination.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
|
pagination:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/pagination/pagination.twig"
|
|
3
3
|
label: Pagination
|
|
4
4
|
description: The Pagination component presents a dismissible alert.
|
|
5
5
|
fields:
|
|
@@ -8,65 +8,65 @@ pagination:
|
|
|
8
8
|
label: Current page
|
|
9
9
|
description: current page number that the user is on, zero-indexed
|
|
10
10
|
required: true
|
|
11
|
-
preview:
|
|
11
|
+
preview: "0"
|
|
12
12
|
firstPageUrl:
|
|
13
13
|
type: string
|
|
14
14
|
label: First Page link
|
|
15
15
|
description: Link to the first page
|
|
16
16
|
required: true
|
|
17
|
-
preview:
|
|
17
|
+
preview: "http://www.google.com?s=first"
|
|
18
18
|
firstPageTitle:
|
|
19
19
|
type: string
|
|
20
20
|
label: First Page Title
|
|
21
21
|
description: Title label for the first page
|
|
22
22
|
required: true
|
|
23
|
-
preview:
|
|
23
|
+
preview: "First"
|
|
24
24
|
lastPageUrl:
|
|
25
25
|
type: string
|
|
26
26
|
label: Last Page link
|
|
27
27
|
description: Link to the last page
|
|
28
28
|
required: true
|
|
29
|
-
preview:
|
|
29
|
+
preview: "http://www.google.com?s=last"
|
|
30
30
|
lastPageTitle:
|
|
31
31
|
type: string
|
|
32
32
|
label: Last Page Title
|
|
33
33
|
description: Title label for the last page
|
|
34
34
|
required: true
|
|
35
|
-
preview:
|
|
35
|
+
preview: "Last"
|
|
36
36
|
nextPageUrl:
|
|
37
37
|
type: string
|
|
38
38
|
label: Next Page link
|
|
39
39
|
description: Link to the next page
|
|
40
40
|
required: true
|
|
41
|
-
preview:
|
|
41
|
+
preview: "http://www.google.com?s=next"
|
|
42
42
|
nextPageTitle:
|
|
43
43
|
type: string
|
|
44
44
|
label: Next Page Title
|
|
45
45
|
description: Title label for the next page
|
|
46
46
|
required: true
|
|
47
|
-
preview:
|
|
47
|
+
preview: "Next"
|
|
48
48
|
prevPageUrl:
|
|
49
49
|
type: string
|
|
50
50
|
label: Prev Page link
|
|
51
51
|
description: Link to the prev page
|
|
52
52
|
required: true
|
|
53
|
-
preview:
|
|
53
|
+
preview: "http://www.google.com?s=prev"
|
|
54
54
|
prevPageTitle:
|
|
55
55
|
type: string
|
|
56
56
|
label: Prev Page Title
|
|
57
57
|
description: Title label for the prev page
|
|
58
58
|
required: true
|
|
59
|
-
preview:
|
|
59
|
+
preview: "Previous"
|
|
60
60
|
pageCountPreposition:
|
|
61
61
|
type: string
|
|
62
62
|
label: Page Count Preposition
|
|
63
63
|
description: Linking word for the page count
|
|
64
64
|
required: true
|
|
65
|
-
preview:
|
|
65
|
+
preview: "of"
|
|
66
66
|
totalPages:
|
|
67
67
|
type: numeric
|
|
68
68
|
label: Total Pages
|
|
69
69
|
description: The number of total pages
|
|
70
70
|
required: true
|
|
71
|
-
preview:
|
|
71
|
+
preview: "8"
|
|
72
72
|
visibility: storybook
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./profile.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
7
|
+
/* eslint-disable-next-line */
|
|
5
8
|
export const wingsuit = {
|
|
6
9
|
patternDefinition,
|
|
7
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
profile:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/profile/profile.twig"
|
|
3
3
|
label: Profile
|
|
4
4
|
description: The Profile component is used to display information about a person.
|
|
5
5
|
fields:
|
|
@@ -25,11 +25,11 @@ profile:
|
|
|
25
25
|
type: string
|
|
26
26
|
label: Name
|
|
27
27
|
description: The name of the person associated with the profile
|
|
28
|
-
preview:
|
|
28
|
+
preview: "Firstname Lastname"
|
|
29
29
|
required: true
|
|
30
30
|
role:
|
|
31
31
|
type: string
|
|
32
32
|
label: Role
|
|
33
33
|
description: An optional plain-text field indicating the person's role in the organization
|
|
34
|
-
preview:
|
|
34
|
+
preview: "Senior Media Strategist"
|
|
35
35
|
visibility: storybook
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ReadMore from
|
|
1
|
+
import ReadMore from "./readmore";
|
|
2
2
|
|
|
3
3
|
Drupal.behaviors.readmore = {
|
|
4
4
|
attach() {
|
|
@@ -6,7 +6,7 @@ Drupal.behaviors.readmore = {
|
|
|
6
6
|
document.querySelectorAll(`[data-loadcomponent="ReadMore"]`),
|
|
7
7
|
(element) => {
|
|
8
8
|
// eslint-disable-next-line no-console
|
|
9
|
-
console.log(
|
|
9
|
+
console.log("loading ReadMore component....");
|
|
10
10
|
new ReadMore(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 ReadMore module which handles rendering field labels inline on a form.
|
|
@@ -67,7 +67,9 @@ export default class ReadMore {
|
|
|
67
67
|
* The button for toggling Read More state
|
|
68
68
|
* @type {Object}
|
|
69
69
|
*/
|
|
70
|
-
this.ReadMoreButton = this.element.querySelector(
|
|
70
|
+
this.ReadMoreButton = this.element.querySelector(
|
|
71
|
+
`.${this.prefix}--read-more--button`
|
|
72
|
+
);
|
|
71
73
|
this.RichText = this.element.querySelector(`.${this.prefix}--richtext`);
|
|
72
74
|
|
|
73
75
|
return this;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./readmore.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
7
|
+
/* eslint-disable-next-line */
|
|
5
8
|
export const wingsuit = {
|
|
6
9
|
patternDefinition,
|
|
7
10
|
};
|