@ilo-org/twig 1.1.6 → 1.2.0
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/LICENSE +183 -183
- package/dist/components/accordion/accordion.behavior.js +10 -1
- package/dist/components/breadcrumb/breadcrumb.behavior.js +10 -1
- package/dist/components/breadcrumb/breadcrumb.twig +2 -3
- package/dist/components/button/button.behavior.js +6 -0
- package/dist/components/button/button.twig +11 -6
- package/dist/components/callout/callout.behavior.js +10 -1
- package/{src/patterns/components/callout/callout.wingsuit.yml → dist/components/callout/callout.component.yml} +6 -7
- package/dist/components/callout/callout.wingsuit.yml +6 -7
- package/{src/patterns/components/checkbox/checkbox.wingsuit.yml → dist/components/checkbox/checkbox.component.yml} +6 -6
- package/dist/components/checkbox/checkbox.wingsuit.yml +6 -6
- package/{src/patterns/components/datepicker/datepicker.wingsuit.yml → dist/components/datepicker/datepicker.component.yml} +5 -5
- package/dist/components/datepicker/datepicker.wingsuit.yml +5 -5
- package/{src/patterns/components/dropdown/dropdown.wingsuit.yml → dist/components/dropdown/dropdown.component.yml} +7 -7
- package/dist/components/dropdown/dropdown.wingsuit.yml +7 -7
- package/dist/components/fileupload/fileupload.behavior.js +10 -1
- package/{src/patterns/components/fileupload/fileupload.wingsuit.yml → dist/components/fileupload/fileupload.component.yml} +7 -7
- package/dist/components/fileupload/fileupload.wingsuit.yml +7 -7
- package/{src/patterns/components/footer/footer.wingsuit.yml → dist/components/footer/footer.component.yml} +1 -1
- package/dist/components/footer/footer.wingsuit.yml +1 -1
- package/dist/components/icon/icon.behavior.js +687 -1
- package/dist/components/icon/icon.twig +1 -4
- package/dist/components/linklist/linklist.behavior.js +8 -1
- package/{src/patterns/components/list/list-item.wingsuit.yml → dist/components/list/list-item.component.yml} +2 -4
- package/dist/components/{list-item → list}/list-item.wingsuit.yml +2 -4
- package/{src/patterns/components/list/list.wingsuit.yml → dist/components/list/list.component.yml} +1 -1
- package/dist/components/list/list.wingsuit.yml +1 -1
- package/dist/components/loading/loading.behavior.js +10 -1
- package/{src/patterns/components/loading/loading.wingsuit.yml → dist/components/loading/loading.component.yml} +1 -1
- package/dist/components/loading/loading.wingsuit.yml +1 -1
- package/{src/patterns/components/localnav/localnav.wingsuit.yml → dist/components/localnav/localnav.component.yml} +1 -1
- package/dist/components/localnav/localnav.wingsuit.yml +1 -1
- package/dist/components/modal/modal.behavior.js +10 -1
- package/{src/patterns/components/modal/modal.wingsuit.yml → dist/components/modal/modal.component.yml} +1 -1
- package/dist/components/modal/modal.wingsuit.yml +1 -1
- package/dist/components/navigation/navigation.behavior.js +10 -1
- package/{src/patterns/components/navigation/navigation.wingsuit.yml → dist/components/navigation/navigation.component.yml} +2 -2
- package/dist/components/navigation/navigation.wingsuit.yml +2 -2
- package/dist/components/notification/notification.behavior.js +10 -1
- package/{src/patterns/components/numberpicker/numberpicker.wingsuit.yml → dist/components/numberpicker/numberpicker.component.yml} +6 -6
- package/dist/components/numberpicker/numberpicker.wingsuit.yml +6 -6
- package/{src/patterns/components/pagination/pagination.wingsuit.yml → dist/components/pagination/pagination.component.yml} +6 -6
- package/dist/components/pagination/pagination.wingsuit.yml +6 -6
- package/{src/patterns/components/radio/radio.wingsuit.yml → dist/components/radio/radio.component.yml} +6 -6
- package/dist/components/radio/radio.wingsuit.yml +6 -6
- package/dist/components/readmore/readmore.behavior.js +10 -1
- package/{src/patterns/components/readmore/readmore.wingsuit.yml → dist/components/readmore/readmore.component.yml} +1 -1
- package/dist/components/readmore/readmore.wingsuit.yml +1 -1
- package/dist/components/search/search.behavior.js +10 -1
- package/{src/patterns/components/search/search.wingsuit.yml → dist/components/search/search.component.yml} +8 -8
- package/dist/components/search/search.wingsuit.yml +8 -8
- package/dist/components/table/table.behavior.js +10 -1
- package/dist/components/tableofcontents/tableofcontents.behavior.js +10 -1
- package/dist/components/tabs/tabs.behavior.js +120 -1
- package/dist/components/tags/tag.behavior.js +10 -0
- package/{src/patterns/components/tags/tag.wingsuit.yml → dist/components/tags/tag.component.yml} +3 -6
- package/dist/components/{tag → tags}/tag.wingsuit.yml +3 -6
- package/{src/patterns/components/textarea/textarea.wingsuit.yml → dist/components/textarea/textarea.component.yml} +9 -9
- package/dist/components/textarea/textarea.wingsuit.yml +9 -9
- package/{src/patterns/components/textinput/textinput.wingsuit.yml → dist/components/textinput/textinput.component.yml} +7 -7
- package/dist/components/textinput/textinput.wingsuit.yml +7 -7
- package/{src/patterns/components/toggle/toggle.wingsuit.yml → dist/components/toggle/toggle.component.yml} +5 -5
- package/dist/components/toggle/toggle.wingsuit.yml +5 -5
- package/dist/components/tooltip/tooltip.behavior.js +116 -1
- package/dist/components/video/video.behavior.js +192 -16
- package/dist/styles/global.css +2 -0
- package/dist/styles/global.css.map +1 -0
- package/dist/styles/index.css.map +1 -0
- package/dist/styles/monorepo.css +9 -0
- package/dist/styles/monorepo.css.map +1 -0
- package/package.json +43 -75
- package/README.md +0 -218
- package/dist/components/polyfill/polyfill.twig +0 -10
- package/dist/components/tag/tag.behavior.js +0 -1
- package/src/namespaces.js +0 -14
- package/src/patterns/components/accordion/accordion-item.twig +0 -22
- package/src/patterns/components/accordion/accordion.behavior.js +0 -16
- package/src/patterns/components/accordion/accordion.js +0 -200
- package/src/patterns/components/accordion/accordion.stories.jsx +0 -9
- package/src/patterns/components/accordion/accordion.twig +0 -16
- package/src/patterns/components/accordion/index.js +0 -7
- package/src/patterns/components/breadcrumb/breadcrumb.behavior.js +0 -16
- package/src/patterns/components/breadcrumb/breadcrumb.js +0 -280
- package/src/patterns/components/breadcrumb/breadcrumb.stories.jsx +0 -9
- package/src/patterns/components/breadcrumb/breadcrumb.twig +0 -55
- package/src/patterns/components/breadcrumb/index.js +0 -7
- package/src/patterns/components/button/button.stories.jsx +0 -9
- package/src/patterns/components/button/button.twig +0 -23
- package/src/patterns/components/button/index.js +0 -6
- package/src/patterns/components/callout/callout.behavior.js +0 -16
- package/src/patterns/components/callout/callout.js +0 -149
- package/src/patterns/components/callout/callout.stories.jsx +0 -9
- package/src/patterns/components/callout/callout.twig +0 -41
- package/src/patterns/components/callout/index.js +0 -7
- package/src/patterns/components/card/card.stories.jsx +0 -9
- package/src/patterns/components/card/card.twig +0 -24
- package/src/patterns/components/card/index.js +0 -6
- package/src/patterns/components/card_data/card_data.stories.jsx +0 -9
- package/src/patterns/components/card_data/card_data.twig +0 -101
- package/src/patterns/components/card_data/index.js +0 -9
- package/src/patterns/components/card_detail/card_detail.stories.jsx +0 -9
- package/src/patterns/components/card_detail/card_detail.twig +0 -37
- package/src/patterns/components/card_detail/index.js +0 -9
- package/src/patterns/components/card_factlist/card_factlist.stories.jsx +0 -9
- package/src/patterns/components/card_factlist/card_factlist.twig +0 -21
- package/src/patterns/components/card_factlist/index.js +0 -9
- package/src/patterns/components/card_feature/card_feature.stories.jsx +0 -9
- package/src/patterns/components/card_feature/card_feature.twig +0 -39
- package/src/patterns/components/card_feature/index.js +0 -9
- package/src/patterns/components/card_multilink/card_multilink.stories.jsx +0 -9
- package/src/patterns/components/card_multilink/card_multilink.twig +0 -45
- package/src/patterns/components/card_multilink/index.js +0 -9
- package/src/patterns/components/card_promo/card_promo.stories.jsx +0 -9
- package/src/patterns/components/card_promo/card_promo.twig +0 -35
- package/src/patterns/components/card_promo/index.js +0 -9
- package/src/patterns/components/card_stat/card_stat.stories.jsx +0 -9
- package/src/patterns/components/card_stat/card_stat.twig +0 -24
- package/src/patterns/components/card_stat/index.js +0 -9
- package/src/patterns/components/card_text/card_text.stories.jsx +0 -9
- package/src/patterns/components/card_text/card_text.twig +0 -35
- package/src/patterns/components/card_text/index.js +0 -9
- package/src/patterns/components/cardgroup/cardgroup.stories.jsx +0 -9
- package/src/patterns/components/cardgroup/cardgroup.twig +0 -44
- package/src/patterns/components/cardgroup/index.js +0 -6
- package/src/patterns/components/checkbox/checkbox.stories.jsx +0 -10
- package/src/patterns/components/checkbox/checkbox.twig +0 -17
- package/src/patterns/components/checkbox/index.js +0 -7
- package/src/patterns/components/contextmenu/contextmenu.stories.jsx +0 -9
- package/src/patterns/components/contextmenu/contextmenu.twig +0 -12
- package/src/patterns/components/contextmenu/index.js +0 -6
- package/src/patterns/components/datepicker/datepicker.stories.jsx +0 -9
- package/src/patterns/components/datepicker/datepicker.twig +0 -20
- package/src/patterns/components/datepicker/index.js +0 -7
- package/src/patterns/components/dropdown/dropdown.stories.jsx +0 -9
- package/src/patterns/components/dropdown/dropdown.twig +0 -22
- package/src/patterns/components/dropdown/index.js +0 -6
- package/src/patterns/components/fileupload/fileupload.behavior.js +0 -12
- package/src/patterns/components/fileupload/fileupload.js +0 -147
- package/src/patterns/components/fileupload/fileupload.stories.jsx +0 -9
- package/src/patterns/components/fileupload/fileupload.twig +0 -20
- package/src/patterns/components/fileupload/index.js +0 -8
- package/src/patterns/components/footer/footer.stories.jsx +0 -9
- package/src/patterns/components/footer/footer.twig +0 -63
- package/src/patterns/components/footer/index.js +0 -6
- package/src/patterns/components/form/fieldset.twig +0 -70
- package/src/patterns/components/form/form.stories.jsx +0 -9
- package/src/patterns/components/form/form.twig +0 -19
- package/src/patterns/components/form/formcontrol.twig +0 -89
- package/src/patterns/components/form/index.js +0 -6
- package/src/patterns/components/form/input.twig +0 -10
- package/src/patterns/components/hero/hero.stories.jsx +0 -9
- package/src/patterns/components/hero/hero.twig +0 -65
- package/src/patterns/components/hero/index.js +0 -7
- package/src/patterns/components/herocard/herocard.stories.jsx +0 -9
- package/src/patterns/components/herocard/herocard.twig +0 -30
- package/src/patterns/components/herocard/index.js +0 -6
- package/src/patterns/components/icon/icon.behavior.js +0 -16
- package/src/patterns/components/icon/icon.js +0 -128
- package/src/patterns/components/icon/icon.stories.jsx +0 -10
- package/src/patterns/components/icon/icon.twig +0 -4
- package/src/patterns/components/icon/index.js +0 -6
- package/src/patterns/components/image/image.stories.jsx +0 -9
- package/src/patterns/components/image/image.twig +0 -29
- package/src/patterns/components/image/index.js +0 -6
- package/src/patterns/components/link/index.js +0 -6
- package/src/patterns/components/link/link.stories.jsx +0 -9
- package/src/patterns/components/link/link.twig +0 -8
- package/src/patterns/components/linklist/index.js +0 -7
- package/src/patterns/components/linklist/linklist.behavior.js +0 -15
- package/src/patterns/components/linklist/linklist.js +0 -55
- package/src/patterns/components/linklist/linklist.stories.jsx +0 -14
- package/src/patterns/components/linklist/linklist.twig +0 -26
- package/src/patterns/components/list/index.js +0 -6
- package/src/patterns/components/list/list-item.twig +0 -6
- package/src/patterns/components/list/list.stories.jsx +0 -9
- package/src/patterns/components/list/list.twig +0 -35
- package/src/patterns/components/loading/index.js +0 -7
- package/src/patterns/components/loading/loading.behavior.js +0 -16
- package/src/patterns/components/loading/loading.js +0 -102
- package/src/patterns/components/loading/loading.stories.jsx +0 -9
- package/src/patterns/components/loading/loading.twig +0 -8
- package/src/patterns/components/localnav/index.js +0 -7
- package/src/patterns/components/localnav/localnav.stories.jsx +0 -9
- package/src/patterns/components/localnav/localnav.twig +0 -86
- package/src/patterns/components/logogrid/index.js +0 -6
- package/src/patterns/components/logogrid/logogrid.stories.jsx +0 -9
- package/src/patterns/components/logogrid/logogrid.twig +0 -17
- package/src/patterns/components/modal/index.js +0 -7
- package/src/patterns/components/modal/modal.behavior.js +0 -16
- package/src/patterns/components/modal/modal.js +0 -134
- package/src/patterns/components/modal/modal.stories.jsx +0 -10
- package/src/patterns/components/modal/modal.twig +0 -20
- package/src/patterns/components/navigation/index.js +0 -7
- package/src/patterns/components/navigation/navigation.behavior.js +0 -16
- package/src/patterns/components/navigation/navigation.js +0 -552
- package/src/patterns/components/navigation/navigation.stories.jsx +0 -10
- package/src/patterns/components/navigation/navigation.twig +0 -171
- package/src/patterns/components/notification/index.js +0 -7
- package/src/patterns/components/notification/notification.behavior.js +0 -16
- package/src/patterns/components/notification/notification.js +0 -97
- package/src/patterns/components/notification/notification.stories.jsx +0 -10
- package/src/patterns/components/notification/notification.twig +0 -18
- package/src/patterns/components/numberpicker/index.js +0 -7
- package/src/patterns/components/numberpicker/numberpicker.stories.jsx +0 -9
- package/src/patterns/components/numberpicker/numberpicker.twig +0 -16
- package/src/patterns/components/pagination/Pagination.stories.jsx +0 -9
- package/src/patterns/components/pagination/index.js +0 -6
- package/src/patterns/components/pagination/pagination.twig +0 -49
- package/src/patterns/components/picture/index.js +0 -6
- package/src/patterns/components/picture/picture.twig +0 -21
- package/src/patterns/components/polyfill/index.js +0 -6
- package/src/patterns/components/polyfill/polyfill.twig +0 -10
- package/src/patterns/components/profile/index.js +0 -6
- package/src/patterns/components/profile/profile.stories.jsx +0 -10
- package/src/patterns/components/profile/profile.twig +0 -26
- package/src/patterns/components/radio/index.js +0 -7
- package/src/patterns/components/radio/radio.stories.jsx +0 -10
- package/src/patterns/components/radio/radio.twig +0 -23
- package/src/patterns/components/readmore/index.js +0 -7
- package/src/patterns/components/readmore/readmore.behavior.js +0 -16
- package/src/patterns/components/readmore/readmore.js +0 -121
- package/src/patterns/components/readmore/readmore.stories.jsx +0 -10
- package/src/patterns/components/readmore/readmore.twig +0 -16
- package/src/patterns/components/richtext/index.js +0 -6
- package/src/patterns/components/richtext/richtext.stories.jsx +0 -10
- package/src/patterns/components/richtext/richtext.twig +0 -6
- package/src/patterns/components/search/index.js +0 -7
- package/src/patterns/components/search/search.behavior.js +0 -15
- package/src/patterns/components/search/search.js +0 -103
- package/src/patterns/components/search/search.stories.jsx +0 -10
- package/src/patterns/components/search/search.twig +0 -31
- package/src/patterns/components/socialmedia/index.js +0 -6
- package/src/patterns/components/socialmedia/socialmedia.mdx +0 -48
- package/src/patterns/components/socialmedia/socialmedia.stories.jsx +0 -15
- package/src/patterns/components/socialmedia/socialmedia.twig +0 -17
- package/src/patterns/components/table/index.js +0 -7
- package/src/patterns/components/table/table.behavior.js +0 -16
- package/src/patterns/components/table/table.js +0 -305
- package/src/patterns/components/table/table.stories.jsx +0 -10
- package/src/patterns/components/table/table.twig +0 -39
- package/src/patterns/components/tableofcontents/index.js +0 -7
- package/src/patterns/components/tableofcontents/tableofcontents.behavior.js +0 -16
- package/src/patterns/components/tableofcontents/tableofcontents.js +0 -172
- package/src/patterns/components/tableofcontents/tableofcontents.stories.jsx +0 -10
- package/src/patterns/components/tableofcontents/tableofcontents.twig +0 -47
- package/src/patterns/components/tabs/index.js +0 -7
- package/src/patterns/components/tabs/tabs.behavior.js +0 -27
- package/src/patterns/components/tabs/tabs.js +0 -212
- package/src/patterns/components/tabs/tabs.stories.jsx +0 -10
- package/src/patterns/components/tabs/tabs.twig +0 -29
- package/src/patterns/components/tags/index.js +0 -7
- package/src/patterns/components/tags/tag.behavior.js +0 -16
- package/src/patterns/components/tags/tag.js +0 -159
- package/src/patterns/components/tags/tag.stories.jsx +0 -10
- package/src/patterns/components/tags/tag.twig +0 -30
- package/src/patterns/components/tags/tags.twig +0 -15
- package/src/patterns/components/textarea/index.js +0 -7
- package/src/patterns/components/textarea/textarea.stories.jsx +0 -9
- package/src/patterns/components/textarea/textarea.twig +0 -14
- package/src/patterns/components/textinput/index.js +0 -7
- package/src/patterns/components/textinput/textinput.stories.jsx +0 -10
- package/src/patterns/components/textinput/textinput.twig +0 -14
- package/src/patterns/components/toggle/index.js +0 -7
- package/src/patterns/components/toggle/toggle.stories.jsx +0 -10
- package/src/patterns/components/toggle/toggle.twig +0 -36
- package/src/patterns/components/tooltip/index.js +0 -7
- package/src/patterns/components/tooltip/tooltip.behavior.js +0 -16
- package/src/patterns/components/tooltip/tooltip.js +0 -156
- package/src/patterns/components/tooltip/tooltip.stories.jsx +0 -10
- package/src/patterns/components/tooltip/tooltip.twig +0 -14
- package/src/patterns/components/video/index.js +0 -7
- package/src/patterns/components/video/video.behavior.js +0 -16
- package/src/patterns/components/video/video.js +0 -120
- package/src/patterns/components/video/video.stories.jsx +0 -10
- package/src/patterns/components/video/video.twig +0 -18
- package/src/patterns/components/video/videoplayer.twig +0 -8
- package/src/tokens/exports/_colors.scss +0 -7
- package/src/tokens/exports/_font-sizes-heading.scss +0 -10
- package/src/tokens/index.scss +0 -7
- package/src/vendorjs/lib.vendor.js +0 -1
- /package/{src/patterns/components/accordion/accordion.wingsuit.yml → dist/components/accordion/accordion.component.yml} +0 -0
- /package/{src/patterns/components/breadcrumb/breadcrumb.wingsuit.yml → dist/components/breadcrumb/breadcrumb.component.yml} +0 -0
- /package/{src/patterns/components/button/button.wingsuit.yml → dist/components/button/button.component.yml} +0 -0
- /package/{src/patterns/components/card/card.wingsuit.yml → dist/components/card/card.component.yml} +0 -0
- /package/{src/patterns/components/card_data/card_data.wingsuit.yml → dist/components/card_data/card_data.component.yml} +0 -0
- /package/{src/patterns/components/card_detail/card_detail.wingsuit.yml → dist/components/card_detail/card_detail.component.yml} +0 -0
- /package/{src/patterns/components/card_factlist/card_factlist.wingsuit.yml → dist/components/card_factlist/card_factlist.component.yml} +0 -0
- /package/{src/patterns/components/card_feature/card_feature.wingsuit.yml → dist/components/card_feature/card_feature.component.yml} +0 -0
- /package/{src/patterns/components/card_multilink/card_multilink.wingsuit.yml → dist/components/card_multilink/card_multilink.component.yml} +0 -0
- /package/{src/patterns/components/card_promo/card_promo.wingsuit.yml → dist/components/card_promo/card_promo.component.yml} +0 -0
- /package/{src/patterns/components/card_stat/card_stat.wingsuit.yml → dist/components/card_stat/card_stat.component.yml} +0 -0
- /package/{src/patterns/components/card_text/card_text.wingsuit.yml → dist/components/card_text/card_text.component.yml} +0 -0
- /package/{src/patterns/components/cardgroup/cardgroup.wingsuit.yml → dist/components/cardgroup/cardgroup.component.yml} +0 -0
- /package/{src/patterns/components/contextmenu/contextmenu.wingsuit.yml → dist/components/contextmenu/contextmenu.component.yml} +0 -0
- /package/{src/patterns/components/form/form.wingsuit.yml → dist/components/form/form.component.yml} +0 -0
- /package/{src/patterns/components/hero/hero.wingsuit.yml → dist/components/hero/hero.component.yml} +0 -0
- /package/{src/patterns/components/herocard/herocard.wingsuit.yml → dist/components/herocard/herocard.component.yml} +0 -0
- /package/{src/patterns/components/icon/icon.wingsuit.yml → dist/components/icon/icon.component.yml} +0 -0
- /package/{src/patterns/components/image/image.wingsuit.yml → dist/components/image/image.component.yml} +0 -0
- /package/{src/patterns/components/link/link.wingsuit.yml → dist/components/link/link.component.yml} +0 -0
- /package/{src/patterns/components/linklist/linklist.wingsuit.yml → dist/components/linklist/linklist.component.yml} +0 -0
- /package/{src/patterns/components/logogrid/logogrid.wingsuit.yml → dist/components/logogrid/logogrid.component.yml} +0 -0
- /package/{src/patterns/components/notification/notification.wingsuit.yml → dist/components/notification/notification.component.yml} +0 -0
- /package/{src/patterns/components/profile/profile.wingsuit.yml → dist/components/profile/profile.component.yml} +0 -0
- /package/{src/patterns/components/richtext/richtext.wingsuit.yml → dist/components/richtext/richtext.component.yml} +0 -0
- /package/{src/patterns/components/socialmedia/socialmedia.wingsuit.yml → dist/components/socialmedia/socialmedia.component.yml} +0 -0
- /package/{src/patterns/components/table/table.wingsuit.yml → dist/components/table/table.component.yml} +0 -0
- /package/{src/patterns/components/tableofcontents/tableofcontents.wingsuit.yml → dist/components/tableofcontents/tableofcontents.component.yml} +0 -0
- /package/{src/patterns/components/tabs/tabs.wingsuit.yml → dist/components/tabs/tabs.component.yml} +0 -0
- /package/{src/patterns/components/tags/tags.wingsuit.yml → dist/components/tags/tags.component.yml} +0 -0
- /package/{src/patterns/components/tooltip/tooltip.wingsuit.yml → dist/components/tooltip/tooltip.component.yml} +0 -0
- /package/{src/patterns/components/video/video.wingsuit.yml → dist/components/video/video.component.yml} +0 -0
- /package/dist/{components/accordion → styles/components}/accordion.css +0 -0
- /package/dist/{components/breadcrumb → styles/components}/breadcrumb.css +0 -0
- /package/dist/{components/button → styles/components}/button.css +0 -0
- /package/dist/{components/callout → styles/components}/callout.css +0 -0
- /package/dist/{components/card → styles/components}/card.css +0 -0
- /package/dist/{components/cardgroup → styles/components}/cardgroup.css +0 -0
- /package/dist/{components/checkbox → styles/components}/checkbox.css +0 -0
- /package/dist/{components/container → styles/components}/container.css +0 -0
- /package/dist/{components/contextmenu → styles/components}/contextmenu.css +0 -0
- /package/dist/{components/credit → styles/components}/credit.css +0 -0
- /package/dist/{components/datacard → styles/components}/datacard.css +0 -0
- /package/dist/{components/datepicker → styles/components}/datepicker.css +0 -0
- /package/dist/{components/detailcard → styles/components}/detailcard.css +0 -0
- /package/dist/{components/dropdown → styles/components}/dropdown.css +0 -0
- /package/dist/{components/empty → styles/components}/empty.css +0 -0
- /package/dist/{components/factlistcard → styles/components}/factlistcard.css +0 -0
- /package/dist/{components/featurecard → styles/components}/featurecard.css +0 -0
- /package/dist/{components/fieldset → styles/components}/fieldset.css +0 -0
- /package/dist/{components/file-upload → styles/components}/file-upload.css +0 -0
- /package/dist/{components/footer → styles/components}/footer.css +0 -0
- /package/dist/{components/form → styles/components}/form.css +0 -0
- /package/dist/{components/formcontrol → styles/components}/formcontrol.css +0 -0
- /package/dist/{components/heading → styles/components}/heading.css +0 -0
- /package/dist/{components/hero → styles/components}/hero.css +0 -0
- /package/dist/{components/herocard → styles/components}/herocard.css +0 -0
- /package/dist/{components/image → styles/components}/image.css +0 -0
- /package/dist/{components/input → styles/components}/input.css +0 -0
- /package/dist/{components/link → styles/components}/link.css +0 -0
- /package/dist/{components/linklist → styles/components}/linklist.css +0 -0
- /package/dist/{components/list → styles/components}/list.css +0 -0
- /package/dist/{components/loading → styles/components}/loading.css +0 -0
- /package/dist/{components/logo → styles/components}/logo.css +0 -0
- /package/dist/{components/logogrid → styles/components}/logogrid.css +0 -0
- /package/dist/{components/modal → styles/components}/modal.css +0 -0
- /package/dist/{components/multilinkcard → styles/components}/multilinkcard.css +0 -0
- /package/dist/{components/navigation → styles/components}/navigation.css +0 -0
- /package/dist/{components/notification → styles/components}/notification.css +0 -0
- /package/dist/{components/pagination → styles/components}/pagination.css +0 -0
- /package/dist/{components/profile → styles/components}/profile.css +0 -0
- /package/dist/{components/promocard → styles/components}/promocard.css +0 -0
- /package/dist/{components/radio → styles/components}/radio.css +0 -0
- /package/dist/{components/readmore → styles/components}/readmore.css +0 -0
- /package/dist/{components/richtext → styles/components}/richtext.css +0 -0
- /package/dist/{components/searchfield → styles/components}/searchfield.css +0 -0
- /package/dist/{components/socialmedia → styles/components}/socialmedia.css +0 -0
- /package/dist/{components/statcard → styles/components}/statcard.css +0 -0
- /package/dist/{components/table → styles/components}/table.css +0 -0
- /package/dist/{components/tableofcontents → styles/components}/tableofcontents.css +0 -0
- /package/dist/{components/tabs → styles/components}/tabs.css +0 -0
- /package/dist/{components/tag → styles/components}/tag.css +0 -0
- /package/dist/{components/textarea → styles/components}/textarea.css +0 -0
- /package/dist/{components/textcard → styles/components}/textcard.css +0 -0
- /package/dist/{components/textinput → styles/components}/textinput.css +0 -0
- /package/dist/{components/toggle → styles/components}/toggle.css +0 -0
- /package/dist/{components/tooltip → styles/components}/tooltip.css +0 -0
- /package/dist/{components/video → styles/components}/video.css +0 -0
- /package/dist/{global/styles.css → styles/index.css} +0 -0
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ilo-org/twig",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist/**/*"
|
|
7
|
+
],
|
|
4
8
|
"license": "Apache-2.0",
|
|
5
9
|
"description": "Twig components for the ILO's Design System",
|
|
6
10
|
"publishConfig": {
|
|
7
11
|
"access": "public"
|
|
8
12
|
},
|
|
9
|
-
"files": [
|
|
10
|
-
"dist/**/*",
|
|
11
|
-
"src/**/*"
|
|
12
|
-
],
|
|
13
13
|
"homepage": "https://twig.ui.ilo.org",
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
@@ -44,89 +44,57 @@
|
|
|
44
44
|
"url": "https://github.com/ggkapanadze"
|
|
45
45
|
}
|
|
46
46
|
],
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@chromatic-com/storybook": "^1.5.0",
|
|
49
|
+
"@modyfi/vite-plugin-yaml": "^1.1.0",
|
|
50
|
+
"@rollup/plugin-commonjs": "^23.0.2",
|
|
51
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
52
|
+
"@rollup/plugin-swc": "^0.3.1",
|
|
53
|
+
"@storybook/addon-essentials": "^8.1.9",
|
|
54
|
+
"@storybook/addon-interactions": "^8.1.9",
|
|
55
|
+
"@storybook/addon-links": "^8.1.9",
|
|
56
|
+
"@storybook/blocks": "^8.1.9",
|
|
57
|
+
"@storybook/builder-vite": "^8.1.9",
|
|
58
|
+
"@storybook/html": "^8.1.9",
|
|
59
|
+
"@storybook/html-vite": "^8.1.9",
|
|
60
|
+
"@storybook/manager-api": "^8.1.9",
|
|
61
|
+
"@storybook/test": "^8.1.9",
|
|
62
|
+
"@storybook/theming": "^8.1.9",
|
|
63
|
+
"@swc/core": "^1.7.1",
|
|
64
|
+
"drupal-attribute": "^1.0.2",
|
|
65
|
+
"drupal-twig-extensions": "^1.0.0-beta.5",
|
|
66
|
+
"glob": "^10.3.10",
|
|
67
|
+
"rollup-plugin-copy": "^3.4.0",
|
|
68
|
+
"storybook": "^8.1.9",
|
|
69
|
+
"storybook-addon-rtl": "^1.0.0",
|
|
70
|
+
"twig": "^1.16.0",
|
|
71
|
+
"vite": "^5.2.0",
|
|
72
|
+
"zod": "^3.23.8",
|
|
73
|
+
"@ilo-org/eslint-config": "1.0.0"
|
|
74
|
+
},
|
|
47
75
|
"dependencies": {
|
|
48
76
|
"@popperjs/core": "^2.11.8",
|
|
77
|
+
"cypress": "^13.10.0",
|
|
49
78
|
"video.js": "^7.21.2",
|
|
50
79
|
"videojs-youtube": "^3.0.1",
|
|
51
80
|
"@ilo-org/brand-assets": "0.5.3",
|
|
52
|
-
"@ilo-org/fonts": "0.2.2",
|
|
53
81
|
"@ilo-org/icons": "0.4.0",
|
|
82
|
+
"@ilo-org/fonts": "0.2.2",
|
|
83
|
+
"@ilo-org/maestro": "1.0.0",
|
|
54
84
|
"@ilo-org/styles": "1.2.0",
|
|
55
85
|
"@ilo-org/themes": "0.9.1",
|
|
56
86
|
"@ilo-org/utils": "0.1.1"
|
|
57
87
|
},
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"@babel/core": "^7.20.12",
|
|
60
|
-
"@babel/preset-env": "^7.20.2",
|
|
61
|
-
"@rollup/plugin-babel": "^5.3.0",
|
|
62
|
-
"@rollup/plugin-commonjs": "^23.0.2",
|
|
63
|
-
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
64
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
65
|
-
"@storybook/addon-actions": "^6.5.16",
|
|
66
|
-
"@storybook/addon-essentials": "^6.5.16",
|
|
67
|
-
"@storybook/addon-links": "^6.5.16",
|
|
68
|
-
"@storybook/addon-postcss": "^2.0.0",
|
|
69
|
-
"@storybook/addons": "^6.5.16",
|
|
70
|
-
"@storybook/linter-config": "^3.1.2",
|
|
71
|
-
"@storybook/react": "^6.5.16",
|
|
72
|
-
"@storybook/storybook-deployer": "^2.8.16",
|
|
73
|
-
"@types/react": "^17.0.11",
|
|
74
|
-
"@types/react-dom": "^17.0.20",
|
|
75
|
-
"@wingsuit-designsystem/cli": "1.2.7",
|
|
76
|
-
"@wingsuit-designsystem/core": "1.2.7",
|
|
77
|
-
"@wingsuit-designsystem/pattern": "1.2.7",
|
|
78
|
-
"@wingsuit-designsystem/preset-scss": "^1.2.7",
|
|
79
|
-
"@wingsuit-designsystem/storybook": "1.2.7",
|
|
80
|
-
"autoprefixer": "^10.4.13",
|
|
81
|
-
"cross-env": "^7.0.3",
|
|
82
|
-
"cypress": "^13.10.0",
|
|
83
|
-
"eslint": "^8.41.0",
|
|
84
|
-
"file-loader": "^6.2.0",
|
|
85
|
-
"fs": "0.0.1-security",
|
|
86
|
-
"fs-extra": "^8.1.0",
|
|
87
|
-
"glob": "^10.3.10",
|
|
88
|
-
"jquery-once": "^2.2.3",
|
|
89
|
-
"lodash": "^4.17.21",
|
|
90
|
-
"mini-css-extract-plugin": "^1.6.2",
|
|
91
|
-
"optimize-css-assets-webpack-plugin": "^5.0.8",
|
|
92
|
-
"postcss": "^8.4.31",
|
|
93
|
-
"postcss-loader": "^4.3.0",
|
|
94
|
-
"postcss-nested": "^4.2.3",
|
|
95
|
-
"postcss-scss": "^4.0.6",
|
|
96
|
-
"raw-loader": "^4.0.2",
|
|
97
|
-
"react": "^16.14.0",
|
|
98
|
-
"react-dom": "^16.14.0",
|
|
99
|
-
"regenerator-runtime": "^0.13.3",
|
|
100
|
-
"require-context": "^1.1.0",
|
|
101
|
-
"resolve-url-loader": "^3.1.5",
|
|
102
|
-
"rollup": "^3.23.0",
|
|
103
|
-
"sass-loader": "^10.4.1",
|
|
104
|
-
"storybook": "^6.5.16",
|
|
105
|
-
"storybook-addon-rtl-direction": "^0.0.19",
|
|
106
|
-
"style-loader": "^1.3.0",
|
|
107
|
-
"stylelint-scss": "^3.21.0",
|
|
108
|
-
"webpack": "^4.46.0",
|
|
109
|
-
"yaml-loader": "0.6.0",
|
|
110
|
-
"yo": "^3.1.1",
|
|
111
|
-
"@ilo-org/eslint-config": "1.0.0",
|
|
112
|
-
"@ilo-org/prettier-config": "1.0.0"
|
|
113
|
-
},
|
|
114
88
|
"scripts": {
|
|
115
|
-
"
|
|
116
|
-
"build:docs": "
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
89
|
+
"build:lib": "rollup -c",
|
|
90
|
+
"build:docs": "storybook build -o ./storybook-static",
|
|
91
|
+
"storybook": "storybook dev -p 6006",
|
|
92
|
+
"start:theme": "docker compose up -d",
|
|
93
|
+
"cy:open": "cypress open",
|
|
94
|
+
"test": "cypress run",
|
|
121
95
|
"lint": "eslint .",
|
|
122
96
|
"lint:fix": "eslint . --fix",
|
|
123
97
|
"format": "prettier --check . --ignore-path ../../.prettierignore",
|
|
124
|
-
"format:fix": "prettier --write . --ignore-path ../../.prettierignore"
|
|
125
|
-
"import:prefix": "node importprefix.js",
|
|
126
|
-
"import:svgs": "node importsvgs.js",
|
|
127
|
-
"start:theme": "docker compose up -d",
|
|
128
|
-
"cy:open": "cypress open",
|
|
129
|
-
"cy:run": "cypress run",
|
|
130
|
-
"test": "cypress run"
|
|
98
|
+
"format:fix": "prettier --write . --ignore-path ../../.prettierignore"
|
|
131
99
|
}
|
|
132
100
|
}
|
package/README.md
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
# ILO Design System - Twig Package
|
|
2
|
-
|
|
3
|
-
This package provides the implementation of the Design System using [Twig](https://twig.symfony.com/doc/). It also includes a [Storybook](https://storybook.js.org/) project for documentation and development of Twig components, using [Wingsuit](https://wingsuit-designsystem.github.io/). Wingsuit uses [Twing](https://www.npmjs.com/package/twing), a Node port of Twig, to compile Twigs to HTML. It has dependencies on the following other @ilo-org packages:
|
|
4
|
-
|
|
5
|
-
- [@ilo-org/themes](./packages/themes)
|
|
6
|
-
- [@ilo-org/fonts](./packages/fonts)
|
|
7
|
-
- [@ilo-org/styles](./packages/styles)
|
|
8
|
-
- [@ilo-org/utils](./packages/utils)
|
|
9
|
-
- [@ilo-org/icons](./packages/icons)
|
|
10
|
-
|
|
11
|
-
#### Architecture
|
|
12
|
-
|
|
13
|
-
Because this is a modified version of Storybook which compliles and displays Twigs instead of React components, there are some notable differences between this and vanilla versions of Storybook. One prominent difference is in directory structure. Each component folder, located in `src/patterns/components`, contains the following files:
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
component.stories.jsx
|
|
17
|
-
component.twig
|
|
18
|
-
component.wingsuit.yml
|
|
19
|
-
index.js
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
and potentially, if Javascript interactivity exists, also the following:
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
component.behavior.js
|
|
26
|
-
component.js
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Wingsuit consumes the `component.wingsuit.yml` file, which is a [UI Pattern YAML](https://wingsuit-designsystem.github.io/components/wingsuit/) borrowed from [Drupal](https://www.drupal.org/project/ui_patterns_settings), and uses this to populate and format the Storybook story for each components. **As such, one is limited in how much one can customize the Storybook experience.**
|
|
30
|
-
|
|
31
|
-
#### Javascript
|
|
32
|
-
|
|
33
|
-
In this package, Javascript is vanilla, with each component that requires Javascript functionality loading an [ES class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) named after the component, scoped and bound to the component's outermost element. Wingsuit is configured to instantiate view classes via a function that looks for a [data attribute](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes) that calls the view name provided in that attribute. On page load, the app looks for elements with the data attribute `data-loadcomponent` and loads whatever modules have corresponding names, passing a reference to the `HTMLElement` containing the data attribute. All the JS is bundled by Webpack into one file, meaning the JS file can be cached and only has to be downloaded from the server once per session.
|
|
34
|
-
|
|
35
|
-
The JS is well-documented in comments, so poke around and you'll get the gist of how it works.
|
|
36
|
-
|
|
37
|
-
Here's an example of HTML component markup that will automatically call some Javascript. Given the following HTML:
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
<section class="component componentname" data-loadcomponent="ComponentName">
|
|
41
|
-
<!-- component HTML goes here -->
|
|
42
|
-
</section>
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Javascript will look in the `ComponentMap` Class for a JS Class called `ComponentName` and then create a new instance of that class and call it. If you've added a new JS Class specific to the module you've built, you'll need to import the JS file to `ComponenetMap` and add it to `ComponenteMap`'s exports. If you've created a new Class, you'll need to make sure to pass the param `element` into the constructor - this is a reference to the DOM element with the `data-loadcomponent` attribute on it. This allows you to scope your JS to each instance of an HTML module.
|
|
46
|
-
|
|
47
|
-
#### Installation and PNPM Commands
|
|
48
|
-
|
|
49
|
-
To install
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npm i @ilo-org/twig
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
To start storybook
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
pnpm storybook
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
To build storybook
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
pnpm build:storybook
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
To build the package for distribution
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
pnpm build:lib
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
This package imports the `prefix` from the `themes` package; to manually import it, run
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
pnpm import:prefix
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
This package imports icon svgs from the `icons` package; to manually import them, run
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
pnpm import:svgs
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
## Questions and Feedback
|
|
86
|
-
|
|
87
|
-
(TBD)
|
|
88
|
-
|
|
89
|
-
## Accessibility Standards
|
|
90
|
-
|
|
91
|
-
(TBD)
|
|
92
|
-
|
|
93
|
-
## Contributing
|
|
94
|
-
|
|
95
|
-
ILO Design System is an open-source project and we welcome your contributions! Before submitting a pull request, please take a moment to review the following guidelines.
|
|
96
|
-
|
|
97
|
-
### Branches
|
|
98
|
-
|
|
99
|
-
| Branch | Purpose |
|
|
100
|
-
| --------- | ---------------------------------- |
|
|
101
|
-
| `main` | The latest version of all packages |
|
|
102
|
-
| `develop` | The next release of all packages |
|
|
103
|
-
|
|
104
|
-
### Contribution workflow
|
|
105
|
-
|
|
106
|
-
1. Fork and clone the repo
|
|
107
|
-
2. Create a new branch from the `develop` branch
|
|
108
|
-
3. Make your changes and [add a changeset](#versioning) identifying the changes and affected packages
|
|
109
|
-
4. Push your branch to the forked version of the repo
|
|
110
|
-
5. Open a pull request back to the `develop` branch of the main repo
|
|
111
|
-
|
|
112
|
-
### Versioning
|
|
113
|
-
|
|
114
|
-
The project uses [changesets](https://github.com/changesets/changesets) to manage package versioning. All pull requests that will affect the project's semantic versioning must include a changest.
|
|
115
|
-
|
|
116
|
-
See more information on [how to add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)
|
|
117
|
-
|
|
118
|
-
### Conventions
|
|
119
|
-
|
|
120
|
-
Contributions should respect the following conventions for branch names, commit messages and pull request descriptions
|
|
121
|
-
|
|
122
|
-
#### Commits
|
|
123
|
-
|
|
124
|
-
Commits should follow [Angular Commit Message Guidelines](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#commit).
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
<type>(<scope>): <subject>
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Examples:
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
fix(react): change button color on hover
|
|
134
|
-
feat(twig): add button component
|
|
135
|
-
ci(github): add release workflow
|
|
136
|
-
perf(react): improve modal animations
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
#### Types
|
|
140
|
-
|
|
141
|
-
- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
|
142
|
-
- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
|
|
143
|
-
- docs: Documentation only changes
|
|
144
|
-
- feat: A new feature
|
|
145
|
-
- fix: A bug fix
|
|
146
|
-
- perf: A code change that improves performance
|
|
147
|
-
- refactor: A code change that neither fixes a bug nor adds a feature
|
|
148
|
-
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
|
149
|
-
- test: Adding missing tests or correcting existing tests
|
|
150
|
-
|
|
151
|
-
#### Scopes
|
|
152
|
-
|
|
153
|
-
This should be a package name or an aspect of the project's configuration.
|
|
154
|
-
|
|
155
|
-
### Branches
|
|
156
|
-
|
|
157
|
-
Branch names should broadly mirror the same convention as commits.
|
|
158
|
-
|
|
159
|
-
Examples:
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
feat/react/modal-wrapper
|
|
163
|
-
fix/twig/modal-wrapper
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Pull requests
|
|
167
|
-
|
|
168
|
-
Pull requests should include a descriptive name and detailed explanation of what merging the pull request will accomplish. Authors should make sure to reference Github issues that the the pull request will fix or affect.
|
|
169
|
-
|
|
170
|
-
## Building the project
|
|
171
|
-
|
|
172
|
-
Use [nvm](https://github.com/nvm-sh/nvm) to make sure you have the correct version of node installed.
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
nvm use
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
Install [pnpm](https://pnpm.io/).
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
npm i -g pnpm
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
Install dependencies
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
pnpm recursive install
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
Build all packages.
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
pnpm build:all
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
Start React storybook
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
pnpm start:react-storybook
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
Start Twig storybook
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
pnpm start:twig-storybook
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
Check types
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
pnpm check:types
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
Run all tests
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
pnpm test:all
|
|
218
|
-
```
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{#
|
|
2
|
-
POLYFILL COMPONENT
|
|
3
|
-
|
|
4
|
-
This component is specifically to make this polyfill work correctly in Wingsuit. To use this in the context of Drupal, Wordpress, etc, consider using the approach documented at https://github.com/GoogleChromeLabs/container-query-polyfill
|
|
5
|
-
#}
|
|
6
|
-
<script>
|
|
7
|
-
if (!("container" in document.documentElement.style)) {
|
|
8
|
-
import("https://unpkg.com/container-query-polyfill@^0.2.0");
|
|
9
|
-
}
|
|
10
|
-
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function e(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,n(r.key),r)}}function i(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(e,i){if(e){if("string"==typeof e)return t(e,i);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,i):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function r(t){var e=i(t.itemStatuses);return e.indexOf(t.id)>-1?e=e.filter((function(e){return e!==t.id})):t.allowMultipleExpanded?e.push(t.id):e=[t.id],e}var a="click",o=function(){return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.element=e,this.multipleActive=!0,this.itemStatuses=[],this.init()}),[{key:"init",value:function(){return this.cacheDomReferences().setupHandlers().enable(),this}},{key:"cacheDomReferences",value:function(){var t=this;return this.buttonTags=this.element.querySelectorAll(".ilo--tag--button"),this.multipleActive=this.element.getAttribute("data-multipleactive"),this.buttonTags.forEach((function(e,i){var n=e.dataset.active,a=t.buttonTags[i].getAttribute("id");"true"===n&&(t.itemStatuses=r({id:a,itemStatuses:t.itemStatuses,allowMultipleActive:t.multipleActive}))})),this}},{key:"setupHandlers",value:function(){return this.onClick=this.onClick.bind(this),this.updateTagItems=this.updateTagItems.bind(this),this}},{key:"enable",value:function(){var t=this;return this.buttonTags.length>0&&this.buttonTags.forEach((function(e,i){e.addEventListener(a,(function(){return t.onClick(i)}))})),this}},{key:"onClick",value:function(t){var e=this.buttonTags[t].getAttribute("id");return this.itemStatuses=r({id:e,itemStatuses:this.itemStatuses,allowMultipleacmultipleActive:this.multipleActive}),this.removeParentDom(e),this}},{key:"removeParentDom",value:function(t){var e=document.getElementById(t);return e&&e.parentElement.remove(),this}},{key:"updateTagItems",value:function(){var t=this;return this.tags.forEach((function(e,i){var n=e.getAttribute("id");t.itemStatuses.indexOf(n)>-1?(t.tags[i].classList.add("ilo--tag--active"),t.tags[i].setAttribute("data-active","true")):(t.tags[i].classList.remove("ilo--tag--active"),t.tags[i].setAttribute("data-active","true"))})),this}}])}();Drupal.behaviors.tag={attach:function(){Array.prototype.forEach.call(document.querySelectorAll('[data-loadcomponent="Tag"]'),(function(t){t.dataset.jsProcessed||(new o(t),t.dataset.jsProcessed=!0)}))}}}));
|
package/src/namespaces.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Global namespaces
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const path = require("path");
|
|
6
|
-
|
|
7
|
-
const patterns = path.resolve(__dirname, "patterns");
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
patterns: patterns,
|
|
11
|
-
components: path.resolve(patterns, "components"),
|
|
12
|
-
tokens: path.resolve(__dirname, "tokens"),
|
|
13
|
-
svgs: path.resolve(__dirname, "svgs"),
|
|
14
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{#
|
|
2
|
-
ACCORDION ITEM COMPONENT
|
|
3
|
-
#}
|
|
4
|
-
{% set uid = "now"|date('Uv') %}
|
|
5
|
-
{% set accordion_id = id ~ uid %}
|
|
6
|
-
{% set button_id = 'button-' ~ accordion_id %}
|
|
7
|
-
{% set panel_id = 'panel-' ~ accordion_id %}
|
|
8
|
-
{% set expanded_class = defaultExpanded ? prefix ~ '--accordion--panel__open' : '' %}
|
|
9
|
-
{% set scroll_class = scroll ? prefix ~ '--accordion--panel__scroll' : '' %}
|
|
10
|
-
|
|
11
|
-
<li class="{{prefix}}--accordion--item" id="{{ accordion_id }}">
|
|
12
|
-
<div class="ilo--h3">
|
|
13
|
-
<button class="{{prefix}}--accordion--button {{prefix}}--accordion--button__{{ size|default('small') }}" aria-expanded="{{ defaultExpanded }}" aria-controls="{{ panel_id }}" id="{{ button_id }}">
|
|
14
|
-
{{label}}
|
|
15
|
-
</button>
|
|
16
|
-
</div>
|
|
17
|
-
<div class="{{prefix}}--accordion--panel {{ expanded_class }} {{ scroll_class }}" id="{{ panel_id }}" aria-labelledby="{{ button_id }}" role="region" aria-hidden={{defaultExpanded ? 'false' : 'true'}}>
|
|
18
|
-
<div class="{{prefix}}--accordion--innerpanel">
|
|
19
|
-
{{content}}
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</li>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import Accordion from "./accordion";
|
|
2
|
-
|
|
3
|
-
Drupal.behaviors.accordion = {
|
|
4
|
-
attach() {
|
|
5
|
-
Array.prototype.forEach.call(
|
|
6
|
-
document.querySelectorAll(`[data-loadcomponent="Accordion"]`),
|
|
7
|
-
(element) => {
|
|
8
|
-
if (!element.dataset.jsProcessed) {
|
|
9
|
-
// eslint-disable-next-line no-console
|
|
10
|
-
new Accordion(element);
|
|
11
|
-
element.dataset.jsProcessed = true;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
},
|
|
16
|
-
};
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { EVENTS, ARIA } from "@ilo-org/utils";
|
|
2
|
-
|
|
3
|
-
const FOCUSABLE_SELECTORS = [
|
|
4
|
-
"a",
|
|
5
|
-
"button",
|
|
6
|
-
"input",
|
|
7
|
-
"select",
|
|
8
|
-
"textarea",
|
|
9
|
-
"[tabindex]:not([tabindex='-1'])",
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The Accordion module which handles rendering field labels inline on a form.
|
|
14
|
-
*
|
|
15
|
-
* @class Accordion
|
|
16
|
-
*/
|
|
17
|
-
export default class Accordion {
|
|
18
|
-
/**
|
|
19
|
-
* Accordion constructor which assigns the element passed into the constructor
|
|
20
|
-
* to the `this.element` property for later reference
|
|
21
|
-
*
|
|
22
|
-
* @param {HTMLElement} element - REQUIRED - the module's container
|
|
23
|
-
*/
|
|
24
|
-
constructor(element) {
|
|
25
|
-
/**
|
|
26
|
-
* Reference to the DOM element that is the root of the component
|
|
27
|
-
* @property {Object}
|
|
28
|
-
*/
|
|
29
|
-
this.element = element;
|
|
30
|
-
this.multipleExpanded = false;
|
|
31
|
-
|
|
32
|
-
// Initialize the view
|
|
33
|
-
this.init();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Initializes the view by calling the functions to
|
|
38
|
-
* create DOM references, setup event handlers and
|
|
39
|
-
* then create the event listeners
|
|
40
|
-
*
|
|
41
|
-
* @return {Object} Accordion A reference to the instance of the class
|
|
42
|
-
* @chainable
|
|
43
|
-
*/
|
|
44
|
-
init() {
|
|
45
|
-
this.cacheDomReferences().setupHandlers().enable();
|
|
46
|
-
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Find all necessary DOM elements used in the view and cache them
|
|
52
|
-
*
|
|
53
|
-
* @return {Object} Accordion A reference to the instance of the class
|
|
54
|
-
* @chainable
|
|
55
|
-
*/
|
|
56
|
-
cacheDomReferences() {
|
|
57
|
-
/**
|
|
58
|
-
* The field that a user interacts with on a form
|
|
59
|
-
* @type {Object}
|
|
60
|
-
*/
|
|
61
|
-
this.accordionItems = this.element.querySelectorAll(
|
|
62
|
-
".ilo--accordion--item"
|
|
63
|
-
);
|
|
64
|
-
this.multipleExpanded = this.element.hasAttribute("data-multipleexpanded");
|
|
65
|
-
this.accordionPanels = this.element.querySelectorAll(
|
|
66
|
-
".ilo--accordion--panel"
|
|
67
|
-
);
|
|
68
|
-
this.accordionButtons = this.element.querySelectorAll(
|
|
69
|
-
".ilo--accordion--button"
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
return this;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Bind event handlers with the proper context of `this`.
|
|
77
|
-
*
|
|
78
|
-
* @return {Object} Accordion A reference to the current instance of the class
|
|
79
|
-
* @chainable
|
|
80
|
-
*/
|
|
81
|
-
setupHandlers() {
|
|
82
|
-
this.collapseSection = this.collapseSection.bind(this);
|
|
83
|
-
this.expandSection = this.expandSection.bind(this);
|
|
84
|
-
this.onClick = this.onClick.bind(this);
|
|
85
|
-
this.updateAccordionItems = this.updateAccordionItems.bind(this);
|
|
86
|
-
|
|
87
|
-
return this;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Creates event listeners to enable interaction with view
|
|
92
|
-
*
|
|
93
|
-
* @return {Object} Accordion A reference to the instance of the class
|
|
94
|
-
* @chainable
|
|
95
|
-
*/
|
|
96
|
-
enable() {
|
|
97
|
-
if (this.accordionButtons.length > 0) {
|
|
98
|
-
this.accordionButtons.forEach((button) => {
|
|
99
|
-
button.addEventListener(EVENTS.CLICK, (e) => this.onClick(e));
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (this.accordionPanels.length > 0) {
|
|
104
|
-
this.accordionPanels.forEach((panel) => {
|
|
105
|
-
this.handleTabIndex(panel, "REMOVE");
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return this;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Onclick interaction with the accordion button
|
|
114
|
-
*
|
|
115
|
-
* @return {Object} Accordion A reference to the instance of the class
|
|
116
|
-
* @chainable
|
|
117
|
-
*/
|
|
118
|
-
onClick(e) {
|
|
119
|
-
this.updateAccordionItems(e.target);
|
|
120
|
-
|
|
121
|
-
return this;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Update accordion items based off of new statuses
|
|
126
|
-
*
|
|
127
|
-
* @chainable
|
|
128
|
-
*/
|
|
129
|
-
updateAccordionItems(panelbutton) {
|
|
130
|
-
const panel = panelbutton
|
|
131
|
-
.closest(".ilo--accordion--item")
|
|
132
|
-
.querySelector(".ilo--accordion--panel");
|
|
133
|
-
const isopen = panel.classList.contains("ilo--accordion--panel__open");
|
|
134
|
-
|
|
135
|
-
if (!this.multipleExpanded) {
|
|
136
|
-
this.accordionPanels.forEach((item) => {
|
|
137
|
-
if (panel !== item) {
|
|
138
|
-
this.collapseSection(item);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (!isopen) {
|
|
144
|
-
this.expandSection(panel);
|
|
145
|
-
} else {
|
|
146
|
-
this.collapseSection(panel);
|
|
147
|
-
}
|
|
148
|
-
panelbutton.blur();
|
|
149
|
-
|
|
150
|
-
return this;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Animates a panel collapse
|
|
155
|
-
*
|
|
156
|
-
* @param {HTMLElement} element - REQUIRED - the accordion panel to be collapsed
|
|
157
|
-
*
|
|
158
|
-
* @chainable
|
|
159
|
-
*/
|
|
160
|
-
collapseSection(element) {
|
|
161
|
-
element.classList.remove("ilo--accordion--panel__open");
|
|
162
|
-
element.parentElement
|
|
163
|
-
.querySelector(".ilo--accordion--button")
|
|
164
|
-
.setAttribute(ARIA.EXPANDED, "false");
|
|
165
|
-
element.setAttribute(ARIA.HIDDEN, "true");
|
|
166
|
-
this.handleTabIndex(element, "REMOVE");
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Animates a panel expansion
|
|
171
|
-
*
|
|
172
|
-
* @param {HTMLElement} element - REQUIRED - the accordion panel to be expanded
|
|
173
|
-
*
|
|
174
|
-
* @chainable
|
|
175
|
-
*/
|
|
176
|
-
expandSection(element) {
|
|
177
|
-
element.parentElement
|
|
178
|
-
.querySelector(".ilo--accordion--button")
|
|
179
|
-
.setAttribute(ARIA.EXPANDED, "true");
|
|
180
|
-
element.setAttribute(ARIA.HIDDEN, "false");
|
|
181
|
-
element.classList.add("ilo--accordion--panel__open");
|
|
182
|
-
this.handleTabIndex(element, "ADD");
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
*
|
|
187
|
-
* @param {HTMLElement} element - REQUIRED - the accordion panel to be adjusted
|
|
188
|
-
* @param {('ADD' | 'REMOVE')} mode - REQUIRED - weather to set or remove tabindex
|
|
189
|
-
*/
|
|
190
|
-
handleTabIndex(element, mode) {
|
|
191
|
-
element.querySelectorAll(FOCUSABLE_SELECTORS.join(", ")).forEach((item) => {
|
|
192
|
-
if (mode === "ADD") {
|
|
193
|
-
item.removeAttribute("tabindex");
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
item.setAttribute("tabindex", "-1");
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{# accordion.twig #}
|
|
2
|
-
|
|
3
|
-
<ul class="{{prefix}}--accordion" data-loadcomponent="Accordion"{{ allowMultipleExpanded|boolval ? ' data-multipleexpanded' }}>
|
|
4
|
-
{% for item in items %}
|
|
5
|
-
{% include "@components/accordion/accordion-item.twig" with {
|
|
6
|
-
label: item.label,
|
|
7
|
-
content: item.content,
|
|
8
|
-
defaultExpanded: item.defaultExpanded,
|
|
9
|
-
size: size,
|
|
10
|
-
headingLevel: headingLevel,
|
|
11
|
-
id: item.id,
|
|
12
|
-
prefix: prefix,
|
|
13
|
-
scroll: item.scroll
|
|
14
|
-
} only %}
|
|
15
|
-
{% endfor %}
|
|
16
|
-
</ul>
|