@ilo-org/twig 0.16.3 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -8
- package/dist/components/accordion/accordion.behavior.js +1 -0
- package/dist/components/accordion/accordion.css +1 -0
- package/dist/components/accordion/accordion.twig +16 -0
- package/dist/components/accordion/accordion.wingsuit.yml +77 -0
- package/dist/components/accordion-item/accordion-item.twig +22 -0
- package/dist/components/breadcrumb/breadcrumb.behavior.js +1 -0
- package/dist/components/breadcrumb/breadcrumb.css +1 -0
- package/dist/components/breadcrumb/breadcrumb.twig +43 -0
- package/dist/components/breadcrumb/breadcrumb.wingsuit.yml +36 -0
- package/dist/components/button/button.css +1 -0
- package/dist/components/button/button.twig +23 -0
- package/dist/components/button/button.wingsuit.yml +114 -0
- package/dist/components/callout/callout.behavior.js +1 -0
- package/dist/components/callout/callout.css +1 -0
- package/dist/components/callout/callout.twig +41 -0
- package/dist/components/callout/callout.wingsuit.yml +72 -0
- package/dist/components/card/card.css +1 -0
- package/dist/components/card/card.twig +24 -0
- package/dist/components/card/card.wingsuit.yml +227 -0
- package/dist/components/card_data/card_data.twig +101 -0
- package/dist/components/card_data/card_data.wingsuit.yml +135 -0
- package/dist/components/card_detail/card_detail.twig +37 -0
- package/dist/components/card_detail/card_detail.wingsuit.yml +71 -0
- package/dist/components/card_factlist/card_factlist.twig +21 -0
- package/dist/components/card_factlist/card_factlist.wingsuit.yml +46 -0
- package/dist/components/card_feature/card_feature.twig +39 -0
- package/dist/components/card_feature/card_feature.wingsuit.yml +80 -0
- package/dist/components/card_multilink/card_multilink.twig +45 -0
- package/dist/components/card_multilink/card_multilink.wingsuit.yml +91 -0
- package/dist/components/card_promo/card_promo.twig +35 -0
- package/dist/components/card_promo/card_promo.wingsuit.yml +71 -0
- package/dist/components/card_stat/card_stat.twig +24 -0
- package/dist/components/card_stat/card_stat.wingsuit.yml +44 -0
- package/dist/components/card_text/card_text.twig +35 -0
- package/dist/components/card_text/card_text.wingsuit.yml +57 -0
- package/dist/components/cardgroup/cardgroup.css +1 -0
- package/dist/components/cardgroup/cardgroup.twig +46 -0
- package/dist/components/cardgroup/cardgroup.wingsuit.yml +158 -0
- package/dist/components/checkbox/checkbox.css +1 -0
- package/dist/components/checkbox/checkbox.twig +17 -0
- package/dist/components/checkbox/checkbox.wingsuit.yml +83 -0
- package/dist/components/container/container.css +1 -0
- package/dist/components/contextmenu/contextmenu.css +1 -0
- package/dist/components/contextmenu/contextmenu.twig +12 -0
- package/dist/components/contextmenu/contextmenu.wingsuit.yml +24 -0
- package/dist/components/credit/credit.css +1 -0
- package/dist/components/datacard/datacard.css +1 -0
- package/dist/components/datepicker/datepicker.css +1 -0
- package/dist/components/datepicker/datepicker.twig +20 -0
- package/dist/components/datepicker/datepicker.wingsuit.yml +72 -0
- package/dist/components/detailcard/detailcard.css +1 -0
- package/dist/components/dropdown/dropdown.css +1 -0
- package/dist/components/dropdown/dropdown.twig +22 -0
- package/dist/components/dropdown/dropdown.wingsuit.yml +100 -0
- package/dist/components/empty/empty.css +1 -0
- package/dist/components/factlistcard/factlistcard.css +1 -0
- package/dist/components/featurecard/featurecard.css +1 -0
- package/dist/components/fieldset/fieldset.css +1 -0
- package/dist/components/fieldset/fieldset.twig +70 -0
- package/dist/components/file-upload/file-upload.css +1 -0
- package/dist/components/fileupload/fileupload.behavior.js +1 -0
- package/dist/components/fileupload/fileupload.twig +20 -0
- package/dist/components/fileupload/fileupload.wingsuit.yml +94 -0
- package/dist/components/footer/footer.css +1 -0
- package/dist/components/footer/footer.twig +63 -0
- package/dist/components/footer/footer.wingsuit.yml +106 -0
- package/dist/components/form/form.css +1 -0
- package/dist/components/form/form.twig +19 -0
- package/dist/components/form/form.wingsuit.yml +205 -0
- package/dist/components/formcontrol/formcontrol.css +1 -0
- package/dist/components/formcontrol/formcontrol.twig +89 -0
- package/dist/components/heading/heading.css +1 -0
- package/dist/components/hero/hero.css +1 -0
- package/dist/components/hero/hero.twig +65 -0
- package/dist/components/hero/hero.wingsuit.yml +182 -0
- package/dist/components/herocard/herocard.css +1 -0
- package/dist/components/herocard/herocard.twig +30 -0
- package/dist/components/herocard/herocard.wingsuit.yml +71 -0
- package/dist/components/icon/icon.behavior.js +1 -0
- package/dist/components/icon/icon.css +1 -0
- package/dist/components/icon/icon.twig +4 -0
- package/dist/components/icon/icon.wingsuit.yml +29 -0
- package/dist/components/image/image.css +1 -0
- package/dist/components/image/image.twig +29 -0
- package/dist/components/image/image.wingsuit.yml +57 -0
- package/dist/components/input/input.css +1 -0
- package/dist/components/input/input.twig +10 -0
- package/dist/components/link/link.css +1 -0
- package/dist/components/link/link.twig +8 -0
- package/dist/components/link/link.wingsuit.yml +36 -0
- package/dist/components/linklist/linklist.behavior.js +1 -0
- package/dist/components/linklist/linklist.css +1 -0
- package/dist/components/linklist/linklist.twig +26 -0
- package/dist/components/linklist/linklist.wingsuit.yml +55 -0
- package/dist/components/list/list.css +1 -0
- package/dist/components/list/list.twig +35 -0
- package/dist/components/list/list.wingsuit.yml +60 -0
- package/dist/components/list-item/list-item.twig +6 -0
- package/dist/components/list-item/list-item.wingsuit.yml +19 -0
- package/dist/components/loading/loading.behavior.js +1 -0
- package/dist/components/loading/loading.css +1 -0
- package/dist/components/loading/loading.twig +8 -0
- package/dist/components/loading/loading.wingsuit.yml +39 -0
- package/dist/components/localnav/localnav.twig +86 -0
- package/dist/components/localnav/localnav.wingsuit.yml +88 -0
- package/dist/components/logo/logo.css +1 -0
- package/dist/components/logogrid/logogrid.css +1 -0
- package/dist/components/logogrid/logogrid.twig +17 -0
- package/dist/components/logogrid/logogrid.wingsuit.yml +45 -0
- package/dist/components/modal/modal.behavior.js +1 -0
- package/dist/components/modal/modal.css +1 -0
- package/dist/components/modal/modal.twig +20 -0
- package/dist/components/modal/modal.wingsuit.yml +61 -0
- package/dist/components/multilinkcard/multilinkcard.css +1 -0
- package/dist/components/navigation/navigation.behavior.js +1 -0
- package/dist/components/navigation/navigation.css +1 -0
- package/dist/components/navigation/navigation.twig +171 -0
- package/dist/components/navigation/navigation.wingsuit.yml +126 -0
- package/dist/components/notification/notification.behavior.js +1 -0
- package/dist/components/notification/notification.css +1 -0
- package/dist/components/notification/notification.twig +18 -0
- package/dist/components/notification/notification.wingsuit.yml +59 -0
- package/dist/components/numberpicker/numberpicker.twig +16 -0
- package/dist/components/numberpicker/numberpicker.wingsuit.yml +91 -0
- package/dist/components/pagination/pagination.css +1 -0
- package/dist/components/pagination/pagination.twig +49 -0
- package/dist/components/pagination/pagination.wingsuit.yml +75 -0
- package/dist/components/picture/picture.twig +21 -0
- package/dist/components/polyfill/polyfill.twig +10 -0
- package/dist/components/profile/profile.css +1 -0
- package/dist/components/profile/profile.twig +26 -0
- package/dist/components/profile/profile.wingsuit.yml +46 -0
- package/dist/components/promocard/promocard.css +1 -0
- package/dist/components/radio/radio.css +1 -0
- package/dist/components/radio/radio.twig +23 -0
- package/dist/components/radio/radio.wingsuit.yml +83 -0
- package/dist/components/readmore/readmore.behavior.js +1 -0
- package/dist/components/readmore/readmore.css +1 -0
- package/dist/components/readmore/readmore.twig +16 -0
- package/dist/components/readmore/readmore.wingsuit.yml +37 -0
- package/dist/components/richtext/richtext.css +1 -0
- package/dist/components/richtext/richtext.twig +6 -0
- package/dist/components/richtext/richtext.wingsuit.yml +13 -0
- package/dist/components/search/search.behavior.js +1 -0
- package/dist/components/search/search.twig +31 -0
- package/dist/components/search/search.wingsuit.yml +89 -0
- package/dist/components/searchfield/searchfield.css +1 -0
- package/dist/components/socialmedia/socialmedia.css +1 -0
- package/dist/components/socialmedia/socialmedia.twig +17 -0
- package/dist/components/socialmedia/socialmedia.wingsuit.yml +59 -0
- package/dist/components/statcard/statcard.css +1 -0
- package/dist/components/table/table.behavior.js +1 -0
- package/dist/components/table/table.css +1 -0
- package/dist/components/table/table.twig +39 -0
- package/dist/components/table/table.wingsuit.yml +112 -0
- package/dist/components/tableofcontents/tableofcontents.behavior.js +1 -0
- package/dist/components/tableofcontents/tableofcontents.css +1 -0
- package/dist/components/tableofcontents/tableofcontents.twig +47 -0
- package/dist/components/tableofcontents/tableofcontents.wingsuit.yml +44 -0
- package/dist/components/tabs/tabs.behavior.js +1 -0
- package/dist/components/tabs/tabs.css +1 -0
- package/dist/components/tabs/tabs.twig +26 -0
- package/dist/components/tabs/tabs.wingsuit.yml +169 -0
- package/dist/components/tag/tag.behavior.js +1 -0
- package/dist/components/tag/tag.css +1 -0
- package/dist/components/tag/tag.twig +30 -0
- package/dist/components/tag/tag.wingsuit.yml +43 -0
- package/dist/components/tags/tags.twig +15 -0
- package/dist/components/tags/tags.wingsuit.yml +45 -0
- package/dist/components/textarea/textarea.css +1 -0
- package/dist/components/textarea/textarea.twig +14 -0
- package/dist/components/textarea/textarea.wingsuit.yml +126 -0
- package/dist/components/textcard/textcard.css +1 -0
- package/dist/components/textinput/textinput.css +1 -0
- package/dist/components/textinput/textinput.twig +14 -0
- package/dist/components/textinput/textinput.wingsuit.yml +86 -0
- package/dist/components/toggle/toggle.css +1 -0
- package/dist/components/toggle/toggle.twig +36 -0
- package/dist/components/toggle/toggle.wingsuit.yml +94 -0
- package/dist/components/tooltip/tooltip.behavior.js +1 -0
- package/dist/components/tooltip/tooltip.css +1 -0
- package/dist/components/tooltip/tooltip.twig +14 -0
- package/dist/components/tooltip/tooltip.wingsuit.yml +53 -0
- package/dist/components/video/video.behavior.js +16 -0
- package/dist/components/video/video.css +1 -0
- package/dist/components/video/video.twig +18 -0
- package/dist/components/video/video.wingsuit.yml +82 -0
- package/dist/components/videoplayer/videoplayer.twig +8 -0
- package/dist/global/styles.css +2 -0
- package/package.json +46 -17
- package/src/patterns/components/accordion/accordion-item.twig +1 -1
- package/src/patterns/components/accordion/accordion.wingsuit.yml +2 -3
- package/src/patterns/components/breadcrumb/breadcrumb.twig +1 -1
- package/src/patterns/components/button/button.wingsuit.yml +8 -8
- package/src/patterns/components/callout/callout.wingsuit.yml +6 -6
- package/src/patterns/components/card/card.wingsuit.yml +10 -11
- package/src/patterns/components/card_detail/card_detail.wingsuit.yml +3 -3
- package/src/patterns/components/card_feature/card_feature.wingsuit.yml +3 -3
- package/src/patterns/components/card_multilink/card_multilink.wingsuit.yml +3 -3
- package/src/patterns/components/card_promo/card_promo.wingsuit.yml +3 -3
- package/src/patterns/components/cardgroup/cardgroup.wingsuit.yml +3 -3
- package/src/patterns/components/datepicker/datepicker.wingsuit.yml +1 -0
- package/src/patterns/components/fileupload/fileupload.wingsuit.yml +3 -3
- package/src/patterns/components/herocard/herocard.wingsuit.yml +2 -2
- package/src/patterns/components/icon/icon.wingsuit.yml +2 -2
- package/src/patterns/components/image/image.wingsuit.yml +3 -3
- package/src/patterns/components/list/list-item.twig +2 -2
- package/src/patterns/components/list/list.twig +34 -28
- package/src/patterns/components/list/list.wingsuit.yml +20 -9
- package/src/patterns/components/pagination/pagination.wingsuit.yml +4 -2
- package/src/patterns/components/readmore/readmore.twig +1 -1
- package/src/patterns/components/readmore/readmore.wingsuit.yml +3 -3
- package/src/patterns/components/richtext/richtext.twig +1 -1
- package/src/patterns/components/table/table.twig +2 -2
- package/src/patterns/components/table/table.wingsuit.yml +6 -6
- package/src/patterns/components/tags/tag.wingsuit.yml +3 -3
- package/src/patterns/components/tags/tags.wingsuit.yml +4 -4
- package/src/patterns/components/textarea/textarea.wingsuit.yml +2 -2
- package/src/patterns/components/tooltip/tooltip.twig +1 -1
- package/src/patterns/components/tooltip/tooltip.wingsuit.yml +2 -2
- package/.browserslistrc +0 -4
- package/.eslintrc.js +0 -25
- package/.stylelintignore +0 -9
- package/.stylelintrc +0 -19
- package/.turbo/turbo-build:lib.log +0 -9
- package/CHANGELOG.md +0 -1008
- package/apps/storybook/assets.js +0 -10
- package/apps/storybook/config/prefix.yml +0 -1
- package/apps/storybook/main.js +0 -27
- package/apps/storybook/manager-head.html +0 -65
- package/apps/storybook/manager.js +0 -7
- package/apps/storybook/patterns/colors.stories.mdx +0 -23
- package/apps/storybook/patterns/intro.stories.mdx +0 -184
- package/apps/storybook/patterns/typeset.stories.mdx +0 -32
- package/apps/storybook/patterns/welcome.stories.mdx +0 -62
- package/apps/storybook/preview-body.html +0 -4
- package/apps/storybook/preview-head.html +0 -5
- package/apps/storybook/preview.js +0 -36
- package/apps/storybook/styles.scss +0 -25
- package/apps/storybook/theme.js +0 -46
- package/babel.config.js +0 -16
- package/images/add.svg +0 -1
- package/images/arrow.svg +0 -1
- package/images/arrowleft.svg +0 -1
- package/images/arrowright.svg +0 -1
- package/images/breadcrumbdivider.svg +0 -1
- package/images/breadcrumbdividerrtl.svg +0 -1
- package/images/burger.svg +0 -1
- package/images/checkmark.svg +0 -1
- package/images/close.svg +0 -1
- package/images/copyright.svg +0 -1
- package/images/doublearrow.svg +0 -1
- package/images/elipsis.svg +0 -1
- package/images/equilateraltriangle.svg +0 -1
- package/images/error.svg +0 -1
- package/images/facebook.svg +0 -1
- package/images/favicon.ico +0 -0
- package/images/flickr.svg +0 -1
- package/images/footertriangle.svg +0 -1
- package/images/fullscreen.svg +0 -1
- package/images/global.svg +0 -1
- package/images/halfsquaretriangle.svg +0 -1
- package/images/hero.jpg +0 -0
- package/images/home.svg +0 -1
- package/images/ilo-dg.jpg +0 -0
- package/images/ilo-headquarters.jpg +0 -0
- package/images/info.svg +0 -1
- package/images/instagram.svg +0 -1
- package/images/large.jpg +0 -0
- package/images/linkedin.svg +0 -1
- package/images/listarrow.svg +0 -1
- package/images/listarrowreverse.svg +0 -1
- package/images/media-file-poster.jpg +0 -0
- package/images/medium.jpg +0 -0
- package/images/minus.svg +0 -1
- package/images/muted.svg +0 -1
- package/images/paginationarrow.svg +0 -1
- package/images/pause.svg +0 -1
- package/images/play.svg +0 -1
- package/images/publication.jpg +0 -0
- package/images/quote.svg +0 -1
- package/images/scalenerighttriangle.svg +0 -1
- package/images/scalenerighttrianglereverse.svg +0 -1
- package/images/search.svg +0 -1
- package/images/small.jpg +0 -0
- package/images/stemarrow.svg +0 -1
- package/images/success.svg +0 -1
- package/images/tiktok.svg +0 -1
- package/images/triangle.svg +0 -1
- package/images/triangledecoration.svg +0 -1
- package/images/trianglereverse.svg +0 -1
- package/images/twitter.svg +0 -1
- package/images/video-example.mp4 +0 -0
- package/images/volume.svg +0 -1
- package/images/warning.svg +0 -1
- package/images/youtube-video-poster.avif +0 -0
- package/images/youtube.svg +0 -1
- package/importprefix.js +0 -20
- package/importsvgs.js +0 -5
- package/jest.config.js +0 -18
- package/outputtwigs.js +0 -57
- package/postcss.config.js +0 -6
- package/wingsuit.config.js +0 -28
package/README.md
CHANGED
|
@@ -64,16 +64,10 @@ To build storybook
|
|
|
64
64
|
pnpm build:storybook
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
To build
|
|
67
|
+
To build the package for distribution
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
pnpm build
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
To build Twigs to be used in a CMS like Drupal (this will output Twigs and necessary JavaScript to a `/dist` folder.)
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
pnpm output
|
|
70
|
+
pnpm build:lib
|
|
77
71
|
```
|
|
78
72
|
|
|
79
73
|
This package imports the `prefix` from the `themes` package; to manually import it, run
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function t(t,n){for(var i=0;i<n.length;i++){var o=n[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,e(o.key),o)}}var n="aria-expanded",i="aria-hidden",o="click",a=["a","button","input","select","textarea","[tabindex]:not([tabindex='-1'])"],r=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.multipleExpanded=!1,this.init()},(r=[{key:"init",value:function(){return this.cacheDomReferences().setupHandlers().enable(),this}},{key:"cacheDomReferences",value:function(){return this.accordionItems=this.element.querySelectorAll(".ilo--accordion--item"),this.multipleExpanded=this.element.hasAttribute("data-multipleexpanded"),this.accordionPanels=this.element.querySelectorAll(".ilo--accordion--panel"),this.accordionButtons=this.element.querySelectorAll(".ilo--accordion--button"),this}},{key:"setupHandlers",value:function(){return this.collapseSection=this.collapseSection.bind(this),this.expandSection=this.expandSection.bind(this),this.onClick=this.onClick.bind(this),this.updateAccordionItems=this.updateAccordionItems.bind(this),this}},{key:"enable",value:function(){var e=this;return this.accordionButtons.length>0&&this.accordionButtons.forEach((function(t){t.addEventListener(o,(function(t){return e.onClick(t)}))})),this.accordionPanels.length>0&&this.accordionPanels.forEach((function(t){e.handleTabIndex(t,"REMOVE")})),this}},{key:"onClick",value:function(e){return this.updateAccordionItems(e.target),this}},{key:"updateAccordionItems",value:function(e){var t=this,n=e.closest(".ilo--accordion--item").querySelector(".ilo--accordion--panel"),i=n.classList.contains("ilo--accordion--panel--open");return this.multipleExpanded||this.accordionPanels.forEach((function(e){n!==e&&t.collapseSection(e)})),i?this.collapseSection(n):this.expandSection(n),e.blur(),this}},{key:"collapseSection",value:function(e){e.classList.remove("ilo--accordion--panel--open"),e.parentElement.querySelector(".ilo--accordion--button").setAttribute(n,"false"),e.setAttribute(i,"true"),this.handleTabIndex(e,"REMOVE")}},{key:"expandSection",value:function(e){e.parentElement.querySelector(".ilo--accordion--button").setAttribute(n,"true"),e.setAttribute(i,"false"),e.classList.add("ilo--accordion--panel--open"),this.handleTabIndex(e,"ADD")}},{key:"handleTabIndex",value:function(e,t){e.querySelectorAll(a.join(", ")).forEach((function(e){"ADD"!==t?e.setAttribute("tabindex","-1"):e.removeAttribute("tabindex")}))}}])&&t(e.prototype,r),c&&t(e,c),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,c}();Drupal.behaviors.accordion={attach:function(){Array.prototype.forEach.call(document.querySelectorAll('[data-loadcomponent="Accordion"]'),(function(e){e.dataset.jsProcessed||(new r(e),e.dataset.jsProcessed=!0)}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.ilo--accordion{margin-right:.2143622722rem}.ilo--accordion--button{display:flex;align-items:center;flex-direction:row;justify-content:space-between;text-align:start;width:100%;margin:0;padding:.857449089rem 0;padding-inline-end:.857449089rem;background-color:#fff;background-position:calc(100% - .3215434084rem) 50%;background-repeat:no-repeat;background-size:1.2861736334rem 1.2861736334rem;border:none;border-top:2px solid #edf0f2;fill:#230050;font-family:Overpass,Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif;color:#230050;font-weight:500;font-size:16px;letter-spacing:-.02em;line-height:21.6px;transition:all .5s ease-in-out;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23230050' d='M18 11h-5V6h-2v5H6v2h5v5h2v-5h5v-2z'/%3E%3C/svg%3E")}.ilo--accordion--button--large{font-size:18.66px;letter-spacing:-.035em;line-height:24.26px;padding:1.0718113612rem 0;padding-inline-end:.857449089rem}.ilo--accordion--button:focus,.ilo--accordion--button:hover{background-color:#ebf5fd;border-top-color:#1e2dbe;color:#1e2dbe;cursor:pointer;fill:#1e2dbe}.ilo--accordion--button:focus[aria-expanded=true],.ilo--accordion--button:hover[aria-expanded=true]{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231E2DBE' d='M18 11H6v2h12v-2z'/%3E%3C/svg%3E")}.ilo--accordion--button:focus[aria-expanded=false],.ilo--accordion--button:hover[aria-expanded=false]{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231E2DBE' d='M18 11h-5V6h-2v5H6v2h5v5h2v-5h5v-2z'/%3E%3C/svg%3E")}@media screen and (min-width:610px){.ilo--accordion--button{font-size:16px;letter-spacing:-.02em;line-height:21.6px}.ilo--accordion--button--large{font-size:18.66px;letter-spacing:-.035em;line-height:24.26px;padding:1.0718113612rem 0;padding-inline-end:.857449089rem}}.ilo--accordion--button[aria-expanded=true]{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23230050' d='M18 11H6v2h12v-2z'/%3E%3C/svg%3E")}.ilo--accordion--button[aria-expanded=false]{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23230050' d='M18 11h-5V6h-2v5H6v2h5v5h2v-5h5v-2z'/%3E%3C/svg%3E")}[dir=rtl] .ilo--accordion--button{background-position:calc(0% + .3215434084rem) 50%}.ilo--accordion--panel{max-height:0;transition:all .5s cubic-bezier(0,1,0,1);overflow:hidden}.ilo--accordion--panel .ilo--accordion--innerpanel{padding-bottom:1.9292604502rem;padding-top:.4287245445rem}.ilo--accordion--panel--open{max-height:100vh;transition:all .5s ease-in-out}.ilo--accordion--panel--open.ilo--accordion--panel__scroll{max-height:300px;overflow-y:auto;padding-right:1.7148981779rem}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{# accordion.twig #}
|
|
2
|
+
|
|
3
|
+
<ul class="ilo--accordion" data-loadcomponent="Accordion" {% if allowMultipleExpanded %} data-multipleexpanded {% endif %}>
|
|
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>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
accordion:
|
|
2
|
+
namespace: Components/Content
|
|
3
|
+
use: "@components/accordion/accordion.twig"
|
|
4
|
+
label: Accordion
|
|
5
|
+
description: The accordion component allows the user to show and hide sections of related content on a page. Items in the accordion can be expanded by default or scrollable if the content is very long.
|
|
6
|
+
|
|
7
|
+
fields:
|
|
8
|
+
items:
|
|
9
|
+
type: object
|
|
10
|
+
label: Items
|
|
11
|
+
description: The accordion items. Each item takes a label, content, and id. You can also set the defaultExpanded and scroll properties for each item.
|
|
12
|
+
required: true
|
|
13
|
+
preview:
|
|
14
|
+
- label: Topics
|
|
15
|
+
content: '<div style="padding: 20px"><ul class="ilo--list--unordered"><li>Employment Promotion and Job Creation</li><li>Social Protection</li><li>International Labour Standards</li><li>Social Dialogue and Tripartism</li><li>Occupational Safety and Health</li><li>Labor Migration</li><li>Child Labour and Forced Labour Elimination</li><li>Gender Equality and Non-Discrimination</li></ul></div>'
|
|
16
|
+
id: item1
|
|
17
|
+
defaultExpanded: false
|
|
18
|
+
scroll: false
|
|
19
|
+
- label: Sectors
|
|
20
|
+
content: '<div style="padding: 20px"><ul class="ilo--list--unordered"><li>Agriculture, Forestry, and Fishing</li><li>Construction</li><li>Manufacturing</li><li>Transport and Storage</li><li>Wholesale and Retail Trade</li><li>Information and Communication</li><li>Finance and Insurance</li><li>Health and Social Work</li><li>Educational Services</li><li>Public Administration and Defense</li><li>Other Services</li></ul></div>'
|
|
21
|
+
id: item2
|
|
22
|
+
defaultExpanded: false
|
|
23
|
+
scroll: false
|
|
24
|
+
|
|
25
|
+
settings:
|
|
26
|
+
size:
|
|
27
|
+
type: select
|
|
28
|
+
label: Size
|
|
29
|
+
description: The size of the accordion button.
|
|
30
|
+
required: false
|
|
31
|
+
options:
|
|
32
|
+
small: Small
|
|
33
|
+
large: Large
|
|
34
|
+
preview: small
|
|
35
|
+
allowMultipleExpanded:
|
|
36
|
+
type: select
|
|
37
|
+
label: Allow Multiple Expanded
|
|
38
|
+
description: Allow mutiple accordion items to be expandable at once.
|
|
39
|
+
options:
|
|
40
|
+
"true": "true"
|
|
41
|
+
"false": "false"
|
|
42
|
+
preview: "true"
|
|
43
|
+
required: false
|
|
44
|
+
variants:
|
|
45
|
+
default:
|
|
46
|
+
label: Default
|
|
47
|
+
scrollable:
|
|
48
|
+
label: "Scrollable"
|
|
49
|
+
description: "You can make an accordion item scrollable simply by passing it scroll: true in the preview."
|
|
50
|
+
fields:
|
|
51
|
+
items:
|
|
52
|
+
- label: Topics
|
|
53
|
+
content: '<div style="padding: 20px"><ul class="ilo--list--unordered"><li>Employment Promotion and Job Creation</li><li>Social Protection</li><li>International Labour Standards</li><li>Social Dialogue and Tripartism</li><li>Occupational Safety and Health</li><li>Labor Migration</li><li>Child Labour and Forced Labour Elimination</li><li>Gender Equality and Non-Discrimination</li></ul></div>'
|
|
54
|
+
id: item1
|
|
55
|
+
defaultExpanded: false
|
|
56
|
+
scroll: true
|
|
57
|
+
- label: Sectors
|
|
58
|
+
content: '<div style="padding: 20px"><ul class="ilo--list--unordered"><li>Agriculture, Forestry, and Fishing</li><li>Construction</li><li>Manufacturing</li><li>Transport and Storage</li><li>Wholesale and Retail Trade</li><li>Information and Communication</li><li>Finance and Insurance</li><li>Health and Social Work</li><li>Educational Services</li><li>Public Administration and Defense</li><li>Other Services</li></ul></div>'
|
|
59
|
+
id: item2
|
|
60
|
+
defaultExpanded: false
|
|
61
|
+
scroll: true
|
|
62
|
+
focus:
|
|
63
|
+
label: "Focus elements"
|
|
64
|
+
description: "This variant includes checkboxes inside the accordion item."
|
|
65
|
+
fields:
|
|
66
|
+
items:
|
|
67
|
+
- label: User Preferences
|
|
68
|
+
content: '<div style="padding: 20px"><form><input type="checkbox" id="option1" name="option1"><label for="option1">Option 1</label><br><input type="checkbox" id="option2" name="option2"><label for="option2">Option 2</label><br><input type="checkbox" id="option3" name="option3"><label for="option3">Option 3</label><br><input type="checkbox" id="option4" name="option4"><label for="option4">Option 4</label><br><input type="checkbox" id="option5" name="option5"><label for="option5">Option 5</label></form></div>'
|
|
69
|
+
id: item1
|
|
70
|
+
defaultExpanded: false
|
|
71
|
+
scroll: false
|
|
72
|
+
- label: More Preferences
|
|
73
|
+
content: '<div style="padding: 20px"><form><input type="checkbox" id="option3" name="option3"><label for="option3">Option 3</label><br><input type="checkbox" id="option4" name="option4"><label for="option4">Option 4</label></form></div>'
|
|
74
|
+
id: item2
|
|
75
|
+
defaultExpanded: false
|
|
76
|
+
scroll: false
|
|
77
|
+
visibility: storybook
|
|
@@ -0,0 +1,22 @@
|
|
|
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="ilo--accordion--item" id="{{ accordion_id }}">
|
|
12
|
+
<div class="ilo--h3">
|
|
13
|
+
<button class="ilo--accordion--button ilo--accordion--button--{{ size|default('small') }}" aria-expanded="{{ defaultExpanded }}" aria-controls="{{ panel_id }}" id="{{ button_id }}">
|
|
14
|
+
{{label}}
|
|
15
|
+
</button>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="ilo--accordion--panel {{ expanded_class }} {{ scroll_class }}" id="{{ panel_id }}" aria-labelledby="{{ button_id }}" role="region" aria-hidden={{defaultExpanded ? 'false' : 'true'}}>
|
|
18
|
+
<div class="ilo--accordion--innerpanel">
|
|
19
|
+
{{content}}
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</li>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function t(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,e(r.key),r)}}var n="click",i="resize",r=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.prefix=this.element.dataset.prefix,this.init()},(r=[{key:"init",value:function(){return this.cacheDomReferences().setupHandlers().enable().onResize(),this}},{key:"cacheDomReferences",value:function(){return this.breadcrumbs=this.element.querySelector(".ilo--breadcrumb--items"),this.breadcrumbwidth=this.breadcrumbs.offsetWidth,this.ContextButton=this.element.querySelector(".".concat(this.prefix,"--breadcrumb--item--context")),this.ContextMenu=this.element.querySelector(".context--menu"),this}},{key:"setupHandlers",value:function(){return this.onResize=this.onResize.bind(this),this.onClick=this.onClick.bind(this),this}},{key:"enable",value:function(){var e=this;return window.addEventListener(i,(function(t){return e.onResize(t)})),this.ContextButton&&this.ContextButton.addEventListener(n,(function(){return e.onClick()})),this}},{key:"onResize",value:function(){return this.ContextMenu&&(this.breadcrumbwidth>this.element.offsetWidth/2?(this.element.classList.add("contextmenu"),this.ContextMenu.classList.remove("open")):(this.element.classList.remove("contextmenu"),this.ContextMenu.classList.remove("open"))),this}},{key:"onClick",value:function(){return this.ContextMenu&&(this.ContextMenu.classList.contains("open")?this.ContextMenu.classList.remove("open"):this.ContextMenu.classList.add("open")),this}}])&&t(e.prototype,r),o&&t(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,o}();Drupal.behaviors.breadcrumb={attach:function(){Array.prototype.forEach.call(document.querySelectorAll('[data-loadcomponent="Breadcrumb"]'),(function(e){e.dataset.jsProcessed||(new r(e),e.dataset.jsProcessed=!0)}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.ilo--breadcrumb{position:relative;z-index:10}.ilo--breadcrumb--items{align-items:center;background-color:#fff;display:inline-flex;justify-content:flex-start;padding-block:.857449089rem;padding-inline-end:0;padding-inline-start:var(--breadcrumb-padding);position:relative}.ilo--breadcrumb--items.context--menu{padding:0}.ilo--breadcrumb--link{align-items:center;background-position:100%;background-repeat:no-repeat;color:#230050;display:inline-flex;height:.857449089rem;padding-block:0;padding-inline-start:.857449089rem;padding-inline-end:1.2861736334rem;text-decoration:none;text-decoration-thickness:.1071811361rem;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 16'%3E%3Cpath fill='%23230050' d='M1.731 16l-1.118-.815L5.838 8 .613.814 1.731 0l5.522 7.593a.69.69 0 0 1 0 .814L1.731 16z'/%3E%3C/svg%3E")}[dir=rtl] .ilo--breadcrumb--link{background-position:0;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 16'%3E%3Cpath fill='%23230050' d='M.7 8.4c0-.1-.1-.3-.1-.4s0-.3.1-.4L6.3 0l1.1.8L2.2 8l5.2 7.2-1.1.8L.7 8.4z'/%3E%3C/svg%3E")}.ilo--breadcrumb--link--label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:40ch;font-weight:400;font-size:11.94px;letter-spacing:normal;line-height:16.24px}.ilo--breadcrumb--link--label,.ilo--breadcrumb--link--label--dropdown{font-family:Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif}.ilo--breadcrumb--link:focus,.ilo--breadcrumb--link:hover{color:#1e2dbe;text-decoration:underline;text-decoration-thickness:.1071811361rem;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 16'%3E%3Cpath fill='%231E2DBE' d='M1.731 16l-1.118-.815L5.838 8 .613.814 1.731 0l5.522 7.593a.69.69 0 0 1 0 .814L1.731 16z'/%3E%3C/svg%3E")}[dir=rtl] .ilo--breadcrumb--link:focus,[dir=rtl] .ilo--breadcrumb--link:hover{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 16'%3E%3Cpath fill='%231E2DBE' d='M.7 8.4c0-.1-.1-.3-.1-.4s0-.3.1-.4L6.3 0l1.1.8L2.2 8l5.2 7.2-1.1.8L.7 8.4z'/%3E%3C/svg%3E")}.ilo--breadcrumb--item{align-items:center;display:flex;height:.857449089rem}.ilo--breadcrumb--item.home{align-items:center;display:flex;position:relative}.ilo--breadcrumb--item.home .ilo--breadcrumb--link--label{width:1px;height:1px;margin:-1px;padding:0;border:0;position:absolute;clip:rect(0 0 0 0);overflow:hidden}.ilo--breadcrumb--item.home .ilo--breadcrumb--link:before{background-position:50%;background-repeat:no-repeat;content:"";display:block;height:.857449089rem;left:0;position:absolute;top:0;width:.857449089rem;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23230050' d='M15.388 5.717L8.43.152a.696.696 0 0 0-.862 0L.612 5.717a.696.696 0 0 0-.264.542v9.044a.696.696 0 0 0 .695.695h4.87v-5.565h4.174V16h4.87a.696.696 0 0 0 .695-.696V6.259a.695.695 0 0 0-.264-.542z'/%3E%3C/svg%3E")}[dir=rtl] .ilo--breadcrumb--item.home .ilo--breadcrumb--link:before{left:auto;right:0}.ilo--breadcrumb--item.home:focus .ilo--breadcrumb--link:before,.ilo--breadcrumb--item.home:hover .ilo--breadcrumb--link:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231E2DBE' d='M15.388 5.717L8.43.152a.696.696 0 0 0-.862 0L.612 5.717a.696.696 0 0 0-.264.542v9.044a.696.696 0 0 0 .695.695h4.87v-5.565h4.174V16h4.87a.696.696 0 0 0 .695-.696V6.259a.695.695 0 0 0-.264-.542z'/%3E%3C/svg%3E")}.ilo--breadcrumb--item.final .ilo--breadcrumb--link{background-image:none}.ilo--breadcrumb .ilo--breadcrumb--item--context{align-items:flex-start;display:flex;height:.857449089rem}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context{background-position:50%;background-repeat:no-repeat;background-size:16px 4px;position:relative;width:2.2508038585rem;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 4'%3E%3Cpath fill='%23230050' d='M2 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4z'/%3E%3C/svg%3E")}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context:hover{cursor:pointer;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 4'%3E%3Cpath fill='%231E2DBE' d='M2 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4z'/%3E%3C/svg%3E")}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context:after{background-position:50%;background-repeat:no-repeat;content:"";display:block;height:.857449089rem;right:-7px;position:absolute;top:0;width:.857449089rem;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 16'%3E%3Cpath fill='%23230050' d='M1.731 16l-1.118-.815L5.838 8 .613.814 1.731 0l5.522 7.593a.69.69 0 0 1 0 .814L1.731 16z'/%3E%3C/svg%3E")}[dir=rtl] .ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context:after{right:auto;left:-7px;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 16'%3E%3Cpath fill='%23230050' d='M.7 8.4c0-.1-.1-.3-.1-.4s0-.3.1-.4L6.3 0l1.1.8L2.2 8l5.2 7.2-1.1.8L.7 8.4z'/%3E%3C/svg%3E")}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu{border-radius:.1071811361rem;background-color:#edf0f2;display:inline-block;left:-2.1436227224rem;opacity:0;position:absolute;top:calc(100% + 24px);width:6.4308681672rem;z-index:10;transition-property:opacity;transition-duration:.15s;transition-timing-function:ease-out}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu.open{opacity:1;transition-property:opacity;transition-duration:.15s;transition-timing-function:ease-out}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu:before{background-position:top;background-repeat:no-repeat;background-size:contain;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23EDF0F2' d='M24 24L0 0v24h24z'/%3E%3C/svg%3E");content:"";height:.6430868167rem;position:absolute;left:50%;top:-.3215434084rem;transform:translateX(-50%) rotate(135deg);width:.6430868167rem}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu:hover{cursor:pointer}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--item{display:inline-block;height:auto;padding:0 .4287245445rem;position:relative;width:100%}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--item:last-of-type a{border-bottom:none}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--item:focus,.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--item:hover{background-color:#ebf5fd;text-decoration:none}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--item:focus .ilo--breadcrumb--link,.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--item:hover .ilo--breadcrumb--link{text-decoration:underline;text-decoration-thickness:.1071811361rem}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--item.endsection{border-bottom:.1071811361rem solid #fff}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--item.endsection .ilo--context-menu--link{border-bottom:none}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--link{background:0 0;border-bottom:.1071811361rem solid #fff;color:#230050;display:inline-block;font-family:Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif;font-weight:500;height:auto;padding:.857449089rem 0;text-decoration:none;width:100%;font-size:11.94px;letter-spacing:normal;line-height:16.24px}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--link:visited{color:#230050}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--link:active{color:#230050;outline:0}.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--link:focus,.ilo--breadcrumb.contextmenu .ilo--breadcrumb--item--context .context--menu .ilo--breadcrumb--link:hover{color:#1e2dbe;outline:0;text-decoration:underline;text-decoration-thickness:.1071811361rem}.ilo--breadcrumb--items:after{background:linear-gradient(to bottom right,#fff 50%,transparent 0);content:"";display:inline-block;height:47px;position:absolute;right:-47px;top:0;width:47px}[dir=rtl] .ilo--breadcrumb--items:after{right:auto;left:-47px;transform:scaleX(-1)}.ilo--breadcrumb--items.context--menu:after{content:none}.ilo--breadcrumb.storybook{background-color:#b8c4cc;height:100vh}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{#
|
|
2
|
+
BREADCRUMB COMPONENT
|
|
3
|
+
#}
|
|
4
|
+
{% set lastlink = links|last %}
|
|
5
|
+
{% set firstlink = links|first %}
|
|
6
|
+
<nav class="ilo--breadcrumb{% if className %} {{className}}{% endif %}" data-prefix="ilo" data-loadcomponent="Breadcrumb">
|
|
7
|
+
<ol class="ilo--breadcrumb--items">
|
|
8
|
+
<li class="ilo--breadcrumb--item home">
|
|
9
|
+
<a class="ilo--breadcrumb--link" href="{{home.url}}">
|
|
10
|
+
<span class="ilo--breadcrumb--link--label">{{home.label}}</span>
|
|
11
|
+
</a>
|
|
12
|
+
</li>
|
|
13
|
+
{% if links|length >= 2 %}
|
|
14
|
+
<li class="ilo--breadcrumb--item first">
|
|
15
|
+
<a class="ilo--breadcrumb--link" href="{{firstlink.url}}">
|
|
16
|
+
<span class="ilo--breadcrumb--link--label">{{firstlink.label}}</span>
|
|
17
|
+
</a>
|
|
18
|
+
</li>
|
|
19
|
+
{% endif %}
|
|
20
|
+
{% if links|length >= 3%}
|
|
21
|
+
<li class="ilo--breadcrumb--item--context">
|
|
22
|
+
<ul class="ilo--breadcrumb--items context--menu">
|
|
23
|
+
{% for link in links %}
|
|
24
|
+
{% if not loop.first and not loop.last %}
|
|
25
|
+
<li class="ilo--breadcrumb--item">
|
|
26
|
+
<a href="{{link.url}}" class="ilo--breadcrumb--link">
|
|
27
|
+
<span class="ilo--breadcrumb--link--label--dropdown ilo--breadcrumb--link--label">{{link.label}}</span>
|
|
28
|
+
</a>
|
|
29
|
+
</li>
|
|
30
|
+
{% endif %}
|
|
31
|
+
{% endfor %}
|
|
32
|
+
</ul>
|
|
33
|
+
</li>
|
|
34
|
+
{% endif %}
|
|
35
|
+
{% if links|length >= 1%}
|
|
36
|
+
<li class="ilo--breadcrumb--item final">
|
|
37
|
+
<a class="ilo--breadcrumb--link" href="{{lastlink.url}}">
|
|
38
|
+
<span class="ilo--breadcrumb--link--label">{{lastlink.label}}</span>
|
|
39
|
+
</a>
|
|
40
|
+
</li>
|
|
41
|
+
{% endif %}
|
|
42
|
+
</ol>
|
|
43
|
+
</nav>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
breadcrumb:
|
|
2
|
+
namespace: Components/Navigation
|
|
3
|
+
use: "@components/breadcrumb/breadcrumb.twig"
|
|
4
|
+
label: Breadcrumb
|
|
5
|
+
description: A component for displaying links in a "breadcrumb" ux
|
|
6
|
+
fields:
|
|
7
|
+
home:
|
|
8
|
+
type: object
|
|
9
|
+
label: Home
|
|
10
|
+
description: url and label for link to site home page
|
|
11
|
+
required: true
|
|
12
|
+
preview:
|
|
13
|
+
label: "Home"
|
|
14
|
+
url: "/"
|
|
15
|
+
links:
|
|
16
|
+
type: object
|
|
17
|
+
label: Home
|
|
18
|
+
description: the links to display in the breadcrumb
|
|
19
|
+
required: true
|
|
20
|
+
preview:
|
|
21
|
+
- label: "Link One"
|
|
22
|
+
url: "/linkone"
|
|
23
|
+
- label: "Link Two"
|
|
24
|
+
url: "/linktwo"
|
|
25
|
+
- label: "Link Three a long link that will wrap to the next line"
|
|
26
|
+
url: "/linkthree"
|
|
27
|
+
- label: "Link Four"
|
|
28
|
+
url: "/linkfour"
|
|
29
|
+
- label: "Link Five"
|
|
30
|
+
url: "/linkfive"
|
|
31
|
+
className:
|
|
32
|
+
type: string
|
|
33
|
+
label: className
|
|
34
|
+
description: optional class name
|
|
35
|
+
preview: "storybook"
|
|
36
|
+
visibility: storybook
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.ilo--button{font-family:Overpass,Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif;font-weight:700;padding:0;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border-top-left-radius:2px;border-top-right-radius:2px}.ilo--button,.ilo--button .button__label,.ilo--button .link__label{display:inline-block}.ilo--button.icon{position:relative}.ilo--button.icon .ilo--icon{height:100%;max-height:1.7148981779rem;max-width:1.7148981779rem;position:absolute;width:100%}.ilo--button.icon.icon__position--left .button__label,.ilo--button.icon.icon__position--left .link__label{padding-left:2.5723472669rem}.ilo--button.icon.icon__position--left .ilo--icon{left:.6966773848rem;top:.3751339764rem}.ilo--button.icon.icon__position--right .button__label,.ilo--button.icon.icon__position--right .link__label{padding-right:2.5723472669rem}.ilo--button.icon.icon__position--right .ilo--icon{right:.6966773848rem;top:.3751339764rem}.ilo--button.icon--only .button__label{width:1px;height:1px;margin:-1px;padding:0;border:0;position:absolute;clip:rect(0 0 0 0);overflow:hidden}.ilo--button--large .button__label,.ilo--button--large .link__label{padding:.6430868167rem 1.2861736334rem;font-size:18.66px;letter-spacing:-.02em;line-height:120%}.ilo--button--large.icon--only{height:2.4115755627rem;width:2.4115755627rem}.ilo--button--large.icon--only .ilo--icon{left:.2411575563rem;top:.2411575563rem}.ilo--button--medium .button__label,.ilo--button--medium .link__label{padding:.4287245445rem 1.0718113612rem;font-size:16px;letter-spacing:-.02em;line-height:120%}.ilo--button--medium.icon .ilo--icon{max-height:1.6077170418rem;max-width:1.6077170418rem;position:absolute}.ilo--button--medium.icon.icon__position--left .button__label,.ilo--button--medium.icon.icon__position--left .link__label{padding-left:2.3579849946rem}.ilo--button--medium.icon.icon__position--left .ilo--icon{left:.5359056806rem;top:.1607717042rem}.ilo--button--medium.icon.icon__position--right .button__label,.ilo--button--medium.icon.icon__position--right .link__label{padding-right:2.3579849946rem}.ilo--button--medium.icon.icon__position--right .ilo--icon{right:.5359056806rem;top:.1607717042rem}.ilo--button--medium.icon--only{height:1.9292604502rem;width:1.9292604502rem}.ilo--button--medium.icon--only .ilo--icon{left:.1071811361rem;top:.1071811361rem}.ilo--button--small .button__label,.ilo--button--small .link__label{padding:.2143622722rem .857449089rem;font-size:14.93px;letter-spacing:-.02em;line-height:120%}.ilo--button--small.icon .ilo--icon{max-height:1.5005359057rem;max-width:1.5005359057rem;position:absolute}.ilo--button--small.icon.icon__position--left .button__label,.ilo--button--small.icon.icon__position--left .link__label{padding-left:1.9292604502rem}.ilo--button--small.icon.icon__position--left .ilo--icon{left:.3215434084rem;top:.0535905681rem}.ilo--button--small.icon.icon__position--right .button__label,.ilo--button--small.icon.icon__position--right .link__label{padding-right:1.9292604502rem}.ilo--button--small.icon.icon__position--right .ilo--icon{right:.3215434084rem;top:.0535905681rem}.ilo--button--small.icon--only{height:1.3933547696rem;width:1.3933547696rem}.ilo--button--small.icon--only .ilo--icon{left:.026795284rem;top:.026795284rem}.ilo--button--primary{background-color:#ffcd2d;border:2px solid #ffcd2d;color:#230050}.ilo--button:focus{background-color:#fff;border:2px solid #ffcd2d;box-shadow:inset 4px 4px 0 1px #ffcd2d,inset -4px -4px 0 1px #ffcd2d;color:#230050;outline:0;transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--button:focus.ilo--button--small{box-shadow:inset 3px 3px 0 1px #ffcd2d,inset -3px -3px 0 1px #ffcd2d}.ilo--button:hover{background-color:#ebf5fd;border:2px solid #1e2dbe;box-shadow:none;color:#1e2dbe;cursor:pointer;transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--button:hover.ilo--button--small{box-shadow:none}.ilo--button:active{background-color:#1e2dbe;border:2px solid #1e2dbe;box-shadow:none;color:#ebf5fd;transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--button:active.ilo--button--small{box-shadow:none}.ilo--button:disabled{opacity:.45;pointer-events:none}.ilo--button--secondary{background-color:#fff;border:1.5px solid #b8c4cc;color:#230050}.ilo--button--secondary,.ilo--button--secondary:hover{transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--button--secondary:hover{background-color:#ebf5fd;border:1.5px solid #1e2dbe}.ilo--button--secondary:active{background-color:#1e2dbe;border:2px solid #1e2dbe;box-shadow:none;color:#ebf5fd;transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--button--secondary:active.ilo--button--small{box-shadow:none}.ilo--button--tertiary{background-color:#edf0f2;border:2px solid #edf0f2;color:#230050}.ilo--button--alert,.ilo--button--tertiary{transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--button--alert{background-color:#c8303c;border:1.5px solid #c8303c;color:#fff}.ilo--button--alert:hover{background-color:#ebf5fd;border:1.5px solid #1e2dbe;color:#1e2dbe}.ilo--button--alert:focus,.ilo--button--alert:hover{transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--button--alert:focus{background-color:#fff;border:2px solid #ffcd2d;color:#230050;outline:0}.ilo--button--alert:active{background-color:#1e2dbe;border:2px solid #1e2dbe;box-shadow:none;color:#ebf5fd;transition-property:color,background-color,border-color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--button--alert:active.ilo--button--small{box-shadow:none}[id*=story--components-button] div .ilo--button{margin-right:10px;margin-bottom:10px}[id*=story--components-button] div .ilo--button--large.icon--only{transform:translateY(-6px)}[id*=story--components-button] div .ilo--button--medium.icon--only,[id*=story--components-button] div .ilo--button--small.icon--only{transform:translateY(-5px)}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{#
|
|
2
|
+
BUTTON COMPONENT
|
|
3
|
+
#}
|
|
4
|
+
{% if url %}
|
|
5
|
+
<a class="ilo--button ilo--button--{{size}} ilo--button--{{type}}{% if icon %} icon icon__position--{{iconPosition}}{% endif %}{% if icononly %} icon--only{% endif %}{% if className %} {{className}}{% endif %}" href="{{url}}" {% if target is defined and target != 'false' %} target="{{target}}" rel="noopener noreferrer" {% endif %} {% if disabled is defined and disabled == 'true' %} disabled {% endif %}>
|
|
6
|
+
<span class="link__label">{{label}}</span>
|
|
7
|
+
{% block button_icon %}
|
|
8
|
+
{% if icon %}
|
|
9
|
+
{% include '@components/icon/icon.twig' with {
|
|
10
|
+
prefix: prefix,
|
|
11
|
+
name: icon.name,
|
|
12
|
+
size: icon.size,
|
|
13
|
+
color: icon.color
|
|
14
|
+
} only %}
|
|
15
|
+
{% endif %}
|
|
16
|
+
{% endblock %}
|
|
17
|
+
</a>
|
|
18
|
+
{% else %}
|
|
19
|
+
<button class="ilo--button ilo--button--{{size}} ilo--button--{{type}}{% if icon %} icon icon__position--{{iconPosition}}{% endif %}{% if icononly %} icon--only{% endif %}{% if className %} {{className}}{% endif %}" {% if kind %} type="{{kind}}" {% endif %} {% if opensmodal %} aria-haspopup="dialog" {% endif %} {% if disabled is defined and disabled == 'true' %} disabled {% endif %} {% if name %} name="{{name}}" {% endif %}>
|
|
20
|
+
<span class="button__label">{{label}}</span>
|
|
21
|
+
{{ block("button_icon") }}
|
|
22
|
+
</button>
|
|
23
|
+
{% endif %}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
button:
|
|
2
|
+
namespace: Components/User Interface
|
|
3
|
+
use: "@components/button/button.twig"
|
|
4
|
+
label: Button
|
|
5
|
+
description: A button or a link styled like a button.
|
|
6
|
+
fields:
|
|
7
|
+
label:
|
|
8
|
+
type: string
|
|
9
|
+
label: Label
|
|
10
|
+
description: The label for the button
|
|
11
|
+
preview: "Button"
|
|
12
|
+
required: true
|
|
13
|
+
name:
|
|
14
|
+
type: string
|
|
15
|
+
label: Name
|
|
16
|
+
description: The name for the button
|
|
17
|
+
preview: "button"
|
|
18
|
+
required: false
|
|
19
|
+
url:
|
|
20
|
+
type: string
|
|
21
|
+
label: url
|
|
22
|
+
description: The url for the button if it's a link
|
|
23
|
+
preview: ""
|
|
24
|
+
required: false
|
|
25
|
+
target:
|
|
26
|
+
type: object
|
|
27
|
+
label: target
|
|
28
|
+
description: Should the button open in a new tab? If so, include the name of the tab. Only evaluated if the url field is populated.
|
|
29
|
+
preview: "true"
|
|
30
|
+
required: false
|
|
31
|
+
icon:
|
|
32
|
+
type: object
|
|
33
|
+
label: Icon
|
|
34
|
+
description: Optional icon to include in button. See the `Icon` component for a full list of arguments
|
|
35
|
+
preview:
|
|
36
|
+
name: "add"
|
|
37
|
+
size: 24
|
|
38
|
+
required: false
|
|
39
|
+
className:
|
|
40
|
+
type: string
|
|
41
|
+
label: Class name
|
|
42
|
+
description: optional class name
|
|
43
|
+
preview: "optionalclass"
|
|
44
|
+
required: false
|
|
45
|
+
settings:
|
|
46
|
+
size:
|
|
47
|
+
type: select
|
|
48
|
+
label: Size
|
|
49
|
+
description: The size of the button.
|
|
50
|
+
required: true
|
|
51
|
+
options:
|
|
52
|
+
small: Small
|
|
53
|
+
medium: Medium
|
|
54
|
+
large: Large
|
|
55
|
+
preview: "large"
|
|
56
|
+
type:
|
|
57
|
+
type: select
|
|
58
|
+
label: Type
|
|
59
|
+
description: The type of button.
|
|
60
|
+
required: true
|
|
61
|
+
options:
|
|
62
|
+
primary: Primary
|
|
63
|
+
secondary: Secondary
|
|
64
|
+
tertiary: Tertiary
|
|
65
|
+
alert: Alert
|
|
66
|
+
icononly: Icon Only
|
|
67
|
+
preview: "primary"
|
|
68
|
+
disabled:
|
|
69
|
+
type: select
|
|
70
|
+
label: Disabled
|
|
71
|
+
description: The disabled state of the button.
|
|
72
|
+
required: false
|
|
73
|
+
options:
|
|
74
|
+
"true": "true"
|
|
75
|
+
"false": "false"
|
|
76
|
+
preview: "false"
|
|
77
|
+
kind:
|
|
78
|
+
type: select
|
|
79
|
+
label: Kind
|
|
80
|
+
description: What kind of functionality does the button have?
|
|
81
|
+
required: false
|
|
82
|
+
options:
|
|
83
|
+
button: button
|
|
84
|
+
reset: reset
|
|
85
|
+
submit: submit
|
|
86
|
+
preview: "button"
|
|
87
|
+
iconPosition:
|
|
88
|
+
type: select
|
|
89
|
+
label: Icon Position
|
|
90
|
+
description: if there's an icon, where is it in the button?
|
|
91
|
+
options:
|
|
92
|
+
left: left
|
|
93
|
+
right: right
|
|
94
|
+
preview: left
|
|
95
|
+
required: false
|
|
96
|
+
icononly:
|
|
97
|
+
type: select
|
|
98
|
+
label: Icon Only
|
|
99
|
+
description: Is this an icon-only button?
|
|
100
|
+
options:
|
|
101
|
+
"true": "true"
|
|
102
|
+
"false": "false"
|
|
103
|
+
preview: "false"
|
|
104
|
+
required: false
|
|
105
|
+
opensmodal:
|
|
106
|
+
type: select
|
|
107
|
+
label: Opens Modal
|
|
108
|
+
description: Does this button trigger open a modal?
|
|
109
|
+
options:
|
|
110
|
+
"true": "true"
|
|
111
|
+
"false": "false"
|
|
112
|
+
preview: "false"
|
|
113
|
+
required: false
|
|
114
|
+
visibility: storybook
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var l=i.call(e,t||"default");if("object"!=typeof l)return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function t(t,i){for(var l=0;l<i.length;l++){var n=i[l];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,e(n.key),n)}}var i="click",l=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.toggleLabel="",this.init()},(l=[{key:"init",value:function(){return this.cacheDomReferences().setupHandlers().enable(),!this.toggleOpen&&this.toggleCollapsible&&this.calcHeight(),this}},{key:"cacheDomReferences",value:function(){return this.toggle=this.element.querySelector(".ilo--callout--toggle"),this.toggleOpen=this.element.classList.value.includes("callout--open"),this.toggleCollapsible=this.element.classList.value.includes("callout--collapse"),this.toggle&&(this.toggleLabel=this.toggle.querySelector(".ilo--callout--button-text"),this.toggleLabelOpen=this.toggle.getAttribute("data-open"),this.toggleLabelClosed=this.toggle.getAttribute("data-closed")),this.button=this.element.querySelector(".ilo--button"),this}},{key:"setupHandlers",value:function(){return this.onToggle=this.handleToggle.bind(this),this.onClick=this.handleClick.bind(this),this}},{key:"enable",value:function(){return this.toggle&&this.toggle.addEventListener(i,this.onToggle),this.button&&this.button.addEventListener(i,this.onClick),this}},{key:"calcHeight",value:function(){return this.header=this.element.querySelector('[class*="--header"]'),this.height=this.header.offsetHeight,this.element.style.maxHeight="".concat(this.height+25,"px"),this}},{key:"handleClick",value:function(){return this}},{key:"handleToggle",value:function(e){e.preventDefault(),this.toggleOpen=!this.toggleOpen;var t=this.toggleOpen?this.toggleLabelOpen:this.toggleLabelClosed;return this.element.classList.toggle("ilo--callout--open"),this.toggleLabel.innerText=t,this}}])&&t(e.prototype,l),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,l,n}();Drupal.behaviors.callout={attach:function(){Array.prototype.forEach.call(document.querySelectorAll('[data-loadcomponent="Callout"]'),(function(e){e.dataset.jsProcessed||(new l(e),e.dataset.jsProcessed=!0)}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.ilo--callout{display:flex;transition:max-height 225ms ease-out}.ilo--callout--collapse:not(.ilo--callout--open){max-height:64px;overflow:hidden}.ilo--callout--open{max-height:300px;overflow:hidden}.ilo--callout--open .ilo--callout--toggle--icon{transform:translateY(-50%) rotate(180deg)}.ilo--callout--sidebar{display:flex;flex-direction:column;align-items:center;padding:1.0718113612rem .4287245445rem;width:2.1436227224rem}.ilo--callout--sidebar .ilo--callout--icon{margin:.2143622722rem}.ilo--callout--content{padding:1.2861736334rem;width:100%;font-size:.8001071811rem}.ilo--callout--header{display:flex;justify-content:space-between;padding-bottom:.6430868167rem}.ilo--callout--title{font-weight:700}.ilo--callout--title,.ilo--callout--toggle{font-size:16px;letter-spacing:-.02em;line-height:21.6px;font-family:Overpass,Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif}.ilo--callout--toggle{background:0 0;border:none;color:#230050;cursor:pointer;font-weight:500;padding-right:1.7148981779rem;position:relative}.ilo--callout--toggle--icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23230050' d='M12 16.78l-8-8 1.455-1.56L12 13.767l6.546-6.545L20 8.779l-8 8z'/%3E%3C/svg%3E");background-position:100%;background-repeat:no-repeat;display:inline-block;height:24px;position:absolute;right:0;top:11px;transform:translateY(-50%) rotate(0);transition:transform 225ms ease-out;width:24px}.ilo--callout--footer{padding-top:1.0718113612rem}.ilo--callout .icon{background-repeat:no-repeat;background-size:contain;display:block;height:16px;width:16px}.ilo--callout .icon--error{background-color:#fa3c4b;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23FFF' d='M11.31 0H4.69L0 4.69v6.62L4.69 16h6.62L16 11.31V4.69L11.31 0zM8 12a1 1 0 0 1-1-.89V11a1 1 0 0 1 .89-1H8a1 1 0 0 1 1 .89V11a1 1 0 0 1-.89 1H8zm1-3H7V4h2v5z'/%3E%3C/svg%3E")}.ilo--callout .icon--info{background-color:#1e2dbe;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill='%23FFF' d='M8 0C6.4 0 4.9.5 3.6 1.3c-1.4.9-2.4 2.2-3 3.6C0 6.4-.2 8 .2 9.6c.3 1.6 1.1 3 2.2 4.1 1.1 1.1 2.5 1.9 4.1 2.2s3.2.2 4.6-.5c1.5-.6 2.7-1.6 3.6-2.9.8-1.4 1.3-2.9 1.3-4.5 0-2.1-.8-4.2-2.3-5.7C12.2.8 10.1 0 8 0zm0 14c-1.2 0-2.3-.4-3.3-1-1-.7-1.8-1.6-2.2-2.7C2 9.2 1.9 8 2.1 6.8c.2-1.2.8-2.2 1.6-3.1.8-.8 1.9-1.4 3.1-1.6 1.2-.2 2.4-.1 3.5.4s2 1.2 2.7 2.2c.7 1 1 2.1 1 3.3 0 1.6-.6 3.1-1.8 4.2C11.1 13.4 9.6 14 8 14z'/%3E%3Cpath fill='%23FFF' d='M9 7H7v5h2V7zM8 6c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1 1 .4 1 1 1z'/%3E%3C/svg%3E")}.ilo--callout .icon--success{background-color:#8ce164;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23FFF' d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zM7 11.4L3.6 8 5 6.6l2 2 4-4L12.4 6 7 11.4z'/%3E%3C/svg%3E")}.ilo--callout .icon--warning{background-color:#ffcd2d;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 16'%3E%3Cpath fill='%23FFF' d='M16.797 13.03l-6.32-11.65a1.59 1.59 0 0 0-.68-.68 1.69 1.69 0 0 0-2.28.68l-6.32 11.65a1.68 1.68 0 0 0 .68 2.27c.25.13.528.2.81.2h12.62c.28 0 .554-.068.8-.2a1.671 1.671 0 0 0 .7-2.26l-.01-.01zm-7.8.47a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm1-3.5a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v4z'/%3E%3C/svg%3E")}.ilo--callout--error{background:#fed8db}.ilo--callout--error .ilo--callout--sidebar{background:#fa3c4b}.ilo--callout--info{background:#bedcfa}.ilo--callout--info .ilo--callout--sidebar{background:#1e2dbe}.ilo--callout--success{background:#e8f9e0}.ilo--callout--success .ilo--callout--sidebar{background:#8ce164}.ilo--callout--warning{background:#fff5c8}.ilo--callout--warning .ilo--callout--sidebar{background:#ffcd2d}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{#
|
|
2
|
+
CALLOUT COMPONENT
|
|
3
|
+
#}
|
|
4
|
+
<div class="ilo--callout ilo--callout--{{alert}} {% if isCollapsible == "true" and isOpen == "true" %} ilo--callout--open {% endif %} {% if isCollapsible == "true" %} ilo--callout--collapse {% endif %}" data-loadcomponent="Callout">
|
|
5
|
+
<div class="ilo--callout--sidebar">
|
|
6
|
+
<span class="ilo--callout--icon icon icon--{{alert}}"></span>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="ilo--callout--content">
|
|
9
|
+
<div class="ilo--callout--header">
|
|
10
|
+
<h5 class="ilo--callout--title">{{ title }}</h5>
|
|
11
|
+
{% if isCollapsible == "true" %}
|
|
12
|
+
<button class="ilo--callout--toggle" type="button" data-open="{{ toggleOpenLabel }}" data-closed="{{ toggleClosedLabel }}">
|
|
13
|
+
<span class="ilo--callout--button-text">
|
|
14
|
+
{% if isOpen %}
|
|
15
|
+
{{ toggleOpenLabel }}
|
|
16
|
+
{% else %}
|
|
17
|
+
{{ toggleClosedLabel }}
|
|
18
|
+
{% endif %}
|
|
19
|
+
</span>
|
|
20
|
+
<span class="ilo--callout--toggle--icon" role="presentation"></span>
|
|
21
|
+
</button>
|
|
22
|
+
{% endif %}
|
|
23
|
+
</div>
|
|
24
|
+
{{ content }}
|
|
25
|
+
{% if button %}
|
|
26
|
+
<div class="ilo--callout--footer">
|
|
27
|
+
{% include '@components/button/button.twig' with {
|
|
28
|
+
label: button.label,
|
|
29
|
+
url: button.url,
|
|
30
|
+
target: button.target,
|
|
31
|
+
icon: button.icon,
|
|
32
|
+
className: button.className,
|
|
33
|
+
icon: button.icon,
|
|
34
|
+
iconPosition: button.iconPosition,
|
|
35
|
+
size: "small",
|
|
36
|
+
type: "secondary",
|
|
37
|
+
} %}
|
|
38
|
+
</div>
|
|
39
|
+
{% endif %}
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
callout:
|
|
2
|
+
namespace: Components/Feedback
|
|
3
|
+
use: "@components/callout/callout.twig"
|
|
4
|
+
label: Callout
|
|
5
|
+
description: A callout alert section with a few different types
|
|
6
|
+
fields:
|
|
7
|
+
button:
|
|
8
|
+
type: object
|
|
9
|
+
label: Button Label
|
|
10
|
+
description: Fields to pass to the button if there is one
|
|
11
|
+
required: false
|
|
12
|
+
preview:
|
|
13
|
+
label: "Button"
|
|
14
|
+
url: "https://www.ilo.org"
|
|
15
|
+
target: "_blank"
|
|
16
|
+
icon: false
|
|
17
|
+
className: "optionalclass"
|
|
18
|
+
content:
|
|
19
|
+
type: text
|
|
20
|
+
label: Content
|
|
21
|
+
description: The callout's content
|
|
22
|
+
preview:
|
|
23
|
+
faker: lorem.paragraph(3)
|
|
24
|
+
title:
|
|
25
|
+
type: string
|
|
26
|
+
label: Notification Title
|
|
27
|
+
description: Title for the notification
|
|
28
|
+
preview: "Optional Title"
|
|
29
|
+
required: false
|
|
30
|
+
toggleOpenLabel:
|
|
31
|
+
type: string
|
|
32
|
+
label: Open Label for the collapse toggle
|
|
33
|
+
description: If there is a collapse toggle, this is the label
|
|
34
|
+
preview: "More"
|
|
35
|
+
required: false
|
|
36
|
+
toggleClosedLabel:
|
|
37
|
+
type: string
|
|
38
|
+
label: Closed Label for the collapse toggle
|
|
39
|
+
description: If there is a collapse toggle, this is the label
|
|
40
|
+
preview: "Less"
|
|
41
|
+
required: false
|
|
42
|
+
settings:
|
|
43
|
+
alert:
|
|
44
|
+
type: select
|
|
45
|
+
label: Alert
|
|
46
|
+
description: Alert type
|
|
47
|
+
required: true
|
|
48
|
+
options:
|
|
49
|
+
info: Info
|
|
50
|
+
error: Error
|
|
51
|
+
success: Success
|
|
52
|
+
warning: Warning
|
|
53
|
+
preview: "info"
|
|
54
|
+
isCollapsible:
|
|
55
|
+
type: select
|
|
56
|
+
label: Is Collapsible?
|
|
57
|
+
description: Whether or not the callout is collapsible
|
|
58
|
+
required: "true"
|
|
59
|
+
options:
|
|
60
|
+
"true": "true"
|
|
61
|
+
"false": "false"
|
|
62
|
+
preview: false
|
|
63
|
+
isOpen:
|
|
64
|
+
type: select
|
|
65
|
+
label: Is Open
|
|
66
|
+
description: Whether or not a collapsible callout is open on page load. If callout is not collapsible then the callout will be open always.
|
|
67
|
+
required: false
|
|
68
|
+
options:
|
|
69
|
+
"true": "true"
|
|
70
|
+
"false": "false"
|
|
71
|
+
preview: "true"
|
|
72
|
+
visibility: storybook
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.ilo--card{box-sizing:border-box;position:relative;background-color:#fff;max-width:var(--max-width);flex:1 1 var(--max-width)}.ilo--card__size__fluid{--max-width:100%!important}.ilo--card__action:focus,.ilo--card__action:focus-within,.ilo--card__action:hover{background:#fff;outline:0;text-decoration:none}.ilo--card__action:focus-within.ilo--card__dark,.ilo--card__action:focus.ilo--card__dark,.ilo--card__action:hover.ilo--card__dark{background:#fff}.ilo--card__action:focus-within .ilo--card--date,.ilo--card__action:focus-within .ilo--card--date-extra,.ilo--card__action:focus-within .ilo--card--eyebrow,.ilo--card__action:focus-within .ilo--card--intro,.ilo--card__action:focus-within .ilo--card--title,.ilo--card__action:focus .ilo--card--date,.ilo--card__action:focus .ilo--card--date-extra,.ilo--card__action:focus .ilo--card--eyebrow,.ilo--card__action:focus .ilo--card--intro,.ilo--card__action:focus .ilo--card--title,.ilo--card__action:hover .ilo--card--date,.ilo--card__action:hover .ilo--card--date-extra,.ilo--card__action:hover .ilo--card--eyebrow,.ilo--card__action:hover .ilo--card--intro,.ilo--card__action:hover .ilo--card--title{color:#1e2dbe}.ilo--card__theme__light{background:#fff}.ilo--card__theme__dark{background:#230050;transition:background .25s ease-out}.ilo--card__theme__dark .ilo--card--date,.ilo--card__theme__dark .ilo--card--eventdate,.ilo--card__theme__dark .ilo--card--eyebrow,.ilo--card__theme__dark .ilo--card--intro,.ilo--card__theme__dark .ilo--card--title{color:#edf0f2;transition:color .25s ease-out}.ilo--card__isvideo .ilo--card--image--wrapper{position:relative}.ilo--card__isvideo .ilo--card--image--wrapper:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23EDF0F2' d='M22 12L4 2v20l18-10z'/%3E%3C/svg%3E");background-color:#2d2d2d;background-position:50%;background-size:18px 20px;background-repeat:no-repeat;content:"";display:block;height:40px;left:0;position:absolute;top:0;width:40px;z-index:1}.ilo--card--wrap{height:100%}.ilo--card--wrapper{max-width:var(--max-width);transition:filter .25s ease-out}.ilo--card--wrapper:focus,.ilo--card--wrapper:focus-within,.ilo--card--wrapper:hover{filter:drop-shadow(0 -4px 16px rgba(30,45,190,.05)) drop-shadow(0 10px 20px rgba(30,45,190,.08)) drop-shadow(0 4px 8px rgba(30,45,190,.05)) drop-shadow(0 .8px 1.6px rgba(30,45,190,.04))}.ilo--card--link{background:0 0;color:transparent;height:100%;left:0;position:absolute;text-decoration:none;top:0;width:100%;z-index:2;transition-property:color,background-color,border-color,opacity;transition-duration:.15s;transition-timing-function:ease-out}.ilo--card--link:focus,.ilo--card--link:focus-within,.ilo--card--link:hover{outline:0;transition-property:color,background-color,border-color,opacity;transition-duration:.15s;transition-timing-function:ease-out}.ilo--card--link:focus+.ilo--card--wrap .ilo--card--eyebrow,.ilo--card--link:focus-within+.ilo--card--wrap .ilo--card--eyebrow,.ilo--card--link:hover+.ilo--card--wrap .ilo--card--eyebrow{color:#1e2dbe}.ilo--card--link:focus+.ilo--card--wrap .ilo--card--title,.ilo--card--link:focus-within+.ilo--card--wrap .ilo--card--title,.ilo--card--link:hover+.ilo--card--wrap .ilo--card--title{color:#1e2dbe}.ilo--card--link:focus+.ilo--card--wrap .ilo--card--intro,.ilo--card--link:focus-within+.ilo--card--wrap .ilo--card--intro,.ilo--card--link:hover+.ilo--card--wrap .ilo--card--intro{color:#1e2dbe}.ilo--card--link:focus+.ilo--card--wrap .ilo--card--date,.ilo--card--link:focus-within+.ilo--card--wrap .ilo--card--date,.ilo--card--link:hover+.ilo--card--wrap .ilo--card--date{color:#1e2dbe}.ilo--card--link:focus+.ilo--card--wrap .ilo--card--eventdate,.ilo--card--link:focus-within+.ilo--card--wrap .ilo--card--eventdate,.ilo--card--link:hover+.ilo--card--wrap .ilo--card--eventdate{color:#1e2dbe}.ilo--card--link--text{width:1px;height:1px;margin:-1px;padding:0;border:0;position:absolute;clip:rect(0 0 0 0);overflow:hidden}.ilo--card--eyebrow{color:#960a55;font-size:16px;letter-spacing:normal;line-height:23.36px;margin-bottom:.6430868167rem;transition-property:color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--card--link:focus-within .ilo--card--eyebrow,.ilo--card--link:focus .ilo--card--eyebrow,.ilo--card--link:hover .ilo--card--eyebrow{color:#1e2dbe;transition-property:color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--card--title{color:#230050;font-family:Overpass,Noto Sans,Noto Sans CJK JP,Yu Gothic,Hiragino Sans,TakaoPGothic,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif;font-weight:700;font-size:23.32px;letter-spacing:-.035em;line-height:29.15px;margin-bottom:-.0313772776rem;transition-property:color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--card--link:focus-within .ilo--card--title,.ilo--card--link:focus .ilo--card--title,.ilo--card--link:hover .ilo--card--title{color:#1e2dbe;transition-property:color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--card--intro{color:#2d2d2d;font-size:16px;letter-spacing:normal;line-height:23.36px;transition-property:color;transition-duration:.15s;transition-timing-function:ease-out;margin-bottom:1.7148981779rem}.ilo--card--link:focus-within .ilo--card--intro,.ilo--card--link:focus .ilo--card--intro,.ilo--card--link:hover .ilo--card--intro{color:#1e2dbe;transition-property:color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--card--date{color:#6d6d6d;font-size:16px;letter-spacing:normal;line-height:23.36px;margin-bottom:1.3742266073rem;transition-property:color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--card--link:focus-within .ilo--card--date,.ilo--card--link:focus .ilo--card--date,.ilo--card--link:hover .ilo--card--date{color:#1e2dbe;transition-property:color;transition-duration:.15s;transition-timing-function:ease-out}.ilo--card--event-date{font-size:16px;letter-spacing:normal;line-height:23.36px;margin-bottom:1.3742266073rem}.ilo--card--picture{max-width:100%;width:100%}.ilo--card--cta{position:relative;z-index:2}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{#
|
|
2
|
+
CARD COMPONENT
|
|
3
|
+
#}
|
|
4
|
+
{% if type == "" %}
|
|
5
|
+
{% set type = variant %}
|
|
6
|
+
{% endif %}
|
|
7
|
+
|
|
8
|
+
{% if type == "data" %}
|
|
9
|
+
{% include "@components/card_data/card_data.twig" %}
|
|
10
|
+
{% elseif type == "detail" %}
|
|
11
|
+
{% include "@components/card_detail/card_detail.twig" %}
|
|
12
|
+
{% elseif type == "factlist" %}
|
|
13
|
+
{% include "@components/card_factlist/card_factlist.twig" %}
|
|
14
|
+
{% elseif type == "feature" %}
|
|
15
|
+
{% include "@components/card_feature/card_feature.twig" %}
|
|
16
|
+
{% elseif type == "multilink" %}
|
|
17
|
+
{% include "@components/card_multilink/card_multilink.twig" %}
|
|
18
|
+
{% elseif type == "promo" %}
|
|
19
|
+
{% include "@components/card_promo/card_promo.twig" %}
|
|
20
|
+
{% elseif type == "stat" %}
|
|
21
|
+
{% include "@components/card_stat/card_stat.twig" %}
|
|
22
|
+
{% elseif type == "text" %}
|
|
23
|
+
{% include "@components/card_text/card_text.twig" %}
|
|
24
|
+
{% endif %}
|