@ilo-org/twig 1.5.0 → 1.6.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.
Files changed (51) hide show
  1. package/dist/components/button/button.component.yml +7 -2
  2. package/dist/components/button/button.twig +25 -10
  3. package/dist/components/button/button.wingsuit.yml +7 -2
  4. package/dist/components/card_detail/card_detail.component.yml +10 -7
  5. package/dist/components/card_detail/card_detail.twig +11 -6
  6. package/dist/components/card_detail/card_detail.wingsuit.yml +10 -7
  7. package/dist/components/card_feature/card_feature.twig +16 -5
  8. package/dist/components/card_multilink/card_multilink.twig +1 -1
  9. package/dist/components/card_promo/card_promo.twig +1 -1
  10. package/dist/components/card_score/card_score.component.yml +102 -0
  11. package/dist/components/card_score/card_score.twig +71 -0
  12. package/dist/components/card_score/card_score.wingsuit.yml +102 -0
  13. package/dist/components/card_text/card_text.component.yml +1 -2
  14. package/dist/components/card_text/card_text.twig +3 -7
  15. package/dist/components/card_text/card_text.wingsuit.yml +1 -2
  16. package/dist/components/icon/icon.behavior.js +1 -1
  17. package/dist/components/icon/icon.twig +1 -1
  18. package/dist/components/profile/profile.component.yml +10 -0
  19. package/dist/components/profile/profile.twig +29 -17
  20. package/dist/components/profile/profile.wingsuit.yml +10 -0
  21. package/dist/components/status/status.component.yml +33 -0
  22. package/dist/components/status/status.twig +8 -0
  23. package/dist/components/status/status.wingsuit.yml +33 -0
  24. package/dist/components/tag/tag.component.yml +56 -0
  25. package/dist/components/tag/tag.twig +35 -0
  26. package/dist/components/tag/tag.wingsuit.yml +56 -0
  27. package/dist/components/tags/tags.component.yml +21 -13
  28. package/dist/components/tags/tags.twig +12 -7
  29. package/dist/components/tags/tags.wingsuit.yml +21 -13
  30. package/dist/styles/components/button.css +1 -1
  31. package/dist/styles/components/card.css +1 -1
  32. package/dist/styles/components/datacard.css +1 -1
  33. package/dist/styles/components/detailcard.css +1 -1
  34. package/dist/styles/components/featurecard.css +1 -1
  35. package/dist/styles/components/multilinkcard.css +1 -1
  36. package/dist/styles/components/profile.css +1 -1
  37. package/dist/styles/components/scorecard.css +1 -0
  38. package/dist/styles/components/status.css +1 -0
  39. package/dist/styles/components/tag.css +1 -1
  40. package/dist/styles/components/textcard.css +1 -1
  41. package/dist/styles/global.css +1 -1
  42. package/dist/styles/global.css.map +1 -1
  43. package/dist/styles/index.css +2 -2
  44. package/dist/styles/index.css.map +1 -1
  45. package/dist/styles/monorepo.css +2 -2
  46. package/dist/styles/monorepo.css.map +1 -1
  47. package/package.json +2 -2
  48. package/dist/components/tags/tag.behavior.js +0 -10
  49. package/dist/components/tags/tag.component.yml +0 -38
  50. package/dist/components/tags/tag.twig +0 -30
  51. package/dist/components/tags/tag.wingsuit.yml +0 -38
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilo-org/twig",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist/**/*"
@@ -85,7 +85,7 @@
85
85
  "@ilo-org/fonts": "1.0.0",
86
86
  "@ilo-org/icons": "2.1.0",
87
87
  "@ilo-org/maestro": "1.0.1",
88
- "@ilo-org/styles": "1.5.0",
88
+ "@ilo-org/styles": "1.6.0",
89
89
  "@ilo-org/themes": "0.9.1",
90
90
  "@ilo-org/utils": "0.1.1"
91
91
  },
@@ -1,10 +0,0 @@
1
- (function () {
2
- 'use strict';
3
-
4
- function e(e){let E=[...e.itemStatuses];return E.indexOf(e.id)>-1?E=E.filter(E=>E!==e.id):e.allowMultipleExpanded?E.push(e.id):E=[e.id],E}const d={ANIMATIONEND:"animationend",BEFOREUNLOAD:"beforeunload",BLUR:"blur",CHANGE:"change",CLEAR_FILTERS:"clearfilters",CLICK:"click",CUSTOM_EVENT:"customevent",DISPLAY_SUBHEADING:"displaysubheading",DROPDOWN_CHANGED:"dropdownchanged",FORM_ERROR:"formerror",FORM_SUCCESS:"formsuccess",FOCUS:"focus",HEADER_HIDING:"header-hiding",INDEX_CHANGED:"indexChanged",INPUT:"input",ITEMSLOADING:"itemsloading",ITEMSLOADED:"itemsloaded",KEY_DOWN:"keydown",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEOVER:"mouseover",PAGESHOW:"pageshow",PAUSE_VIDEO:"pausevideo",RENDERED:"rendered",REQUEST_MADE:"requestmade",RESIZE:"resize",RESULTS_RETURNED:"resultsreturnd",SCROLL:"scroll",SIMULATED_CLICK:"simulated-click",SHOW_HIDE:"showhide",SUBMIT:"submit",TOUCH_END:"touchend",TOUCH_START:"touchstart",TRANSITIONEND:"transitionend",TWEET_LOADED:"tweetLoaded",UPDATE_POST_COUNT:"updatepostcount",UPDATE_IN_VIEWPORT_MODULES:"updateinviewportmodules",UPDATE_SEARCH_WITH_NEW_ITEMS:"updatesearchwithnewitems",UPDATE_SETTINGS:"updatesettings",WHEEL:"wheel"};
5
-
6
- class Tag{constructor(element){this.element=element;this.multipleActive=true;this.itemStatuses=[];this.init();}init(){this.cacheDomReferences().setupHandlers().enable();return this}cacheDomReferences(){this.buttonTags=this.element.querySelectorAll(".ilo--tag--button");this.multipleActive=this.element.getAttribute("data-multipleactive");this.buttonTags.forEach((button,i)=>{const expanded=button.dataset["active"];const id=this.buttonTags[i].getAttribute("id");if(expanded==="true"){this.itemStatuses=e({id,itemStatuses:this.itemStatuses,allowMultipleActive:this.multipleActive});}});return this}setupHandlers(){this.onClick=this.onClick.bind(this);this.updateTagItems=this.updateTagItems.bind(this);return this}enable(){if(this.buttonTags.length>0){this.buttonTags.forEach((button,i)=>{button.addEventListener(d.CLICK,()=>this.onClick(i));});}return this}onClick(i){const id=this.buttonTags[i].getAttribute("id");this.itemStatuses=e({id,itemStatuses:this.itemStatuses,allowMultipleacmultipleActive:this.multipleActive});this.removeParentDom(id);return this}removeParentDom(id){const buttonTag=document.getElementById(id);if(buttonTag){buttonTag.parentElement.remove();}return this}updateTagItems(){this.tags.forEach((item,i)=>{const id=item.getAttribute("id");const open=this.itemStatuses.indexOf(id)>-1;if(open){this.tags[i].classList.add("ilo--tag--active");this.tags[i].setAttribute("data-active","true");}else {this.tags[i].classList.remove("ilo--tag--active");this.tags[i].setAttribute("data-active","true");}});return this}}
7
-
8
- Drupal.behaviors.tag={attach(){Array.prototype.forEach.call(document.querySelectorAll(`[data-loadcomponent="Tag"]`),element=>{if(!element.dataset.jsProcessed){new Tag(element);element.dataset.jsProcessed=true;}});}};
9
-
10
- })();
@@ -1,38 +0,0 @@
1
- tag:
2
- namespace: Components/Navigation
3
- use: "@components/tags/tag.twig"
4
- label: Tag
5
- description: A display an interactive tag
6
- fields:
7
- content:
8
- type: text
9
- label: Content
10
- description: The tag text content.
11
- preview: tag
12
- elementId:
13
- type: text
14
- label: ID
15
- description: The tag's id.
16
- preview: elementId
17
- url:
18
- type: text
19
- label: URL
20
- description: The tag's url reference
21
- preview: https://www.google.com/
22
- settings:
23
- defaultActive:
24
- type: boolean
25
- label: Default Active
26
- description: The tag loads in an active state
27
- preview: false
28
- required: false
29
- tagType:
30
- type: select
31
- label: Tag Type
32
- description: The type of tag. Anchor and button have potential user interactions where display is static.
33
- options:
34
- anchor: Anchor
35
- button: Button
36
- display: Display
37
- preview: display
38
- visibility: storybook
@@ -1,30 +0,0 @@
1
- {#
2
- TAG COMPONENT
3
- #}
4
- {% if tagType == "button" and defaultActive %}
5
- <li class="ilo--tags__item">
6
- <button class="ilo--tag ilo--tag--button ilo--tag--active icon__position--right" id="{{ elementId }}" data-active={{ defaultActive }} type="button">
7
- {{content}}
8
- <span class="ilo--icon" title="Remove"></span>
9
- </button>
10
- </li>
11
- {% elseif tagType == "reset" %}
12
- <li class="ilo--tags__item">
13
- <button class="ilo--tag ilo--tag--reset ilo--tag--active" id="{{ elementId }}" data-active={{ defaultActive }} type="button">
14
- {{content}}
15
- </button>
16
- </li>
17
- {% elseif tagType == "anchor" %}
18
- <li class="ilo--tags__item">
19
- <a class="ilo--tag ilo--tag--anchor {% if defaultActive %} ilo--tag--active{% endif %}" href="{{ url }}" id="{{ elementId }}" data-active={{ defaultActive }}>
20
- {{content}}
21
- </a>
22
- </li>
23
- {% elseif tagType == "display" %}
24
- <li class="ilo--tags__item">
25
- <span class="ilo--tag {% if defaultActive %} ilo--tag--active{% endif %}" id="{{ elementId }}" data-active={{ defaultActive }}>
26
- {{content}}
27
- </span>
28
- </li>
29
- {% else %}
30
- {% endif %}
@@ -1,38 +0,0 @@
1
- tag:
2
- namespace: Components/Navigation
3
- use: "@components/tags/tag.twig"
4
- label: Tag
5
- description: A display an interactive tag
6
- fields:
7
- content:
8
- type: text
9
- label: Content
10
- description: The tag text content.
11
- preview: tag
12
- elementId:
13
- type: text
14
- label: ID
15
- description: The tag's id.
16
- preview: elementId
17
- url:
18
- type: text
19
- label: URL
20
- description: The tag's url reference
21
- preview: https://www.google.com/
22
- settings:
23
- defaultActive:
24
- type: boolean
25
- label: Default Active
26
- description: The tag loads in an active state
27
- preview: false
28
- required: false
29
- tagType:
30
- type: select
31
- label: Tag Type
32
- description: The type of tag. Anchor and button have potential user interactions where display is static.
33
- options:
34
- anchor: Anchor
35
- button: Button
36
- display: Display
37
- preview: display
38
- visibility: storybook