@ilo-org/twig 0.7.1 → 0.8.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.
Files changed (42) hide show
  1. package/.turbo/turbo-build:lib.log +2 -2
  2. package/CHANGELOG.md +48 -3
  3. package/package.json +7 -7
  4. package/src/patterns/components/card/card.twig +18 -119
  5. package/src/patterns/components/card/card.wingsuit.yml +162 -223
  6. package/src/patterns/components/card_data/card_data.stories.jsx +9 -0
  7. package/src/patterns/components/card_data/card_data.twig +49 -0
  8. package/src/patterns/components/card_data/card_data.wingsuit.yml +73 -0
  9. package/src/patterns/components/card_data/index.js +9 -0
  10. package/src/patterns/components/card_detail/card_detail.stories.jsx +9 -0
  11. package/src/patterns/components/card_detail/card_detail.twig +37 -0
  12. package/src/patterns/components/card_detail/card_detail.wingsuit.yml +73 -0
  13. package/src/patterns/components/card_detail/index.js +9 -0
  14. package/src/patterns/components/card_factlist/card_factlist.stories.jsx +9 -0
  15. package/src/patterns/components/card_factlist/card_factlist.twig +21 -0
  16. package/src/patterns/components/card_factlist/card_factlist.wingsuit.yml +49 -0
  17. package/src/patterns/components/card_factlist/index.js +9 -0
  18. package/src/patterns/components/card_feature/card_feature.stories.jsx +9 -0
  19. package/src/patterns/components/card_feature/card_feature.twig +39 -0
  20. package/src/patterns/components/card_feature/card_feature.wingsuit.yml +82 -0
  21. package/src/patterns/components/card_feature/index.js +9 -0
  22. package/src/patterns/components/card_multilink/card_multilink.stories.jsx +9 -0
  23. package/src/patterns/components/card_multilink/card_multilink.twig +42 -0
  24. package/src/patterns/components/card_multilink/card_multilink.wingsuit.yml +88 -0
  25. package/src/patterns/components/card_multilink/index.js +9 -0
  26. package/src/patterns/components/card_promo/card_promo.stories.jsx +9 -0
  27. package/src/patterns/components/card_promo/card_promo.twig +35 -0
  28. package/src/patterns/components/card_promo/card_promo.wingsuit.yml +73 -0
  29. package/src/patterns/components/card_promo/index.js +9 -0
  30. package/src/patterns/components/card_stat/card_stat.stories.jsx +9 -0
  31. package/src/patterns/components/card_stat/card_stat.twig +22 -0
  32. package/src/patterns/components/card_stat/card_stat.wingsuit.yml +48 -0
  33. package/src/patterns/components/card_stat/index.js +9 -0
  34. package/src/patterns/components/card_text/card_text.stories.jsx +9 -0
  35. package/src/patterns/components/card_text/card_text.twig +35 -0
  36. package/src/patterns/components/card_text/card_text.wingsuit.yml +59 -0
  37. package/src/patterns/components/card_text/index.js +9 -0
  38. package/src/patterns/components/cardgroup/cardgroup.twig +25 -28
  39. package/src/patterns/components/cardgroup/cardgroup.wingsuit.yml +88 -444
  40. package/src/patterns/components/hero/hero.twig +1 -1
  41. package/src/patterns/components/picture/index.js +6 -0
  42. package/src/patterns/components/picture/picture.twig +21 -0
@@ -0,0 +1,48 @@
1
+ statcard:
2
+ use: "@components/card_stat/card_stat.twig"
3
+ label: Stat Card
4
+ description: A stat card highlights a prominent fact or statistic with a link to where the information comes from. It can appear in a range of different colors.
5
+ visibility: storybook
6
+ fields:
7
+ title:
8
+ type: string
9
+ label: Title
10
+ description: The headline for the statistic
11
+ preview: "Global employment growth down by half in 2023"
12
+ intro:
13
+ type: string
14
+ label: Intro
15
+ description: More informationa about the statistic
16
+ preview: "The current global economic slowdown is likely to force more workers to accept lower quality, poorly paid jobs which lack job security and social protection, so accentuating inequalities exacerbated by the COVID-19 crisis."
17
+ source:
18
+ type: object
19
+ label: Source
20
+ description: A link pointing to where the statistic comes from.
21
+ preview:
22
+ label: "World Employment and Social Outlook: Trends 2023"
23
+ url: "https://www.ilo.org/global/research/global-reports/weso/WCMS_865332/lang--en/index.htm"
24
+ settings:
25
+ size:
26
+ type: select
27
+ label: Size
28
+ description: Sets the size of the card. If not set, the card will appear as `standard`.
29
+ required: false
30
+ preview: "standard"
31
+ options:
32
+ standard: Standard
33
+ fluid: Fluid
34
+ color:
35
+ type: select
36
+ label: Color
37
+ description: Color of the stat cards, options are `turquoise`, `green`, `yellow`, or `blue`. Only use for stat cards.
38
+ options:
39
+ turquoise: turquoise
40
+ green: green
41
+ yellow: yellow
42
+ blue: blue
43
+ preview: "blue"
44
+
45
+
46
+
47
+
48
+
@@ -0,0 +1,9 @@
1
+ import "./index";
2
+
3
+ export default {};
4
+ const patternDefinition = require("./card_stat.wingsuit.yml");
5
+
6
+ /* eslint-disable-next-line */
7
+ export const wingsuit = {
8
+ patternDefinition,
9
+ };
@@ -0,0 +1,9 @@
1
+ import "./index";
2
+
3
+ export default {};
4
+ const patternDefinition = require("./card_text.wingsuit.yml");
5
+
6
+ /* eslint-disable-next-line */
7
+ export const wingsuit = {
8
+ patternDefinition,
9
+ };
@@ -0,0 +1,35 @@
1
+ {#
2
+ FEATURE CARD COMPONENT
3
+ #}
4
+
5
+ <div class="{{prefix}}--card--wrapper">
6
+ <div class="{{prefix}}--card {{prefix}}--card__type__text {{prefix}}--card__size__{{ size }} {{prefix}}--card__action {{prefix}}--card__theme__{{theme}}">
7
+ <a class="{{prefix}}--card--link" href="{{link}}" title="{{title}}">
8
+ <span class="{{prefix}}--card--link--text">{{title}}</span>
9
+ </a>
10
+ <div class="{{prefix}}--card--wrap">
11
+ <div class="{{prefix}}--card--content">
12
+ {% if eyebrow %}
13
+ <p class="{{prefix}}--card--eyebrow">{{eyebrow}}</p>
14
+ {% endif %}
15
+ {% if title %}
16
+ <h5 class="{{prefix}}--card--title">{{title}}</h5>
17
+ {% endif %}
18
+ {% if date %}
19
+ <time class="{{prefix}}--card--date" datetime="{{date.unix}}">{{date.human}}</time>
20
+ {% endif %}
21
+ {% if profile %}
22
+ {% include "@components/profile/profile.twig" with {
23
+ avatar: profile.avatar,
24
+ description: profile.description,
25
+ link: profile.link,
26
+ name: profile.name,
27
+ role: profile.role,
28
+ prefix: prefix,
29
+ theme: theme,
30
+ } only %}
31
+ {% endif %}
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
@@ -0,0 +1,59 @@
1
+ textcard:
2
+ use: "@components/card_text/card_text.twig"
3
+ label: Text Card
4
+ description: A text card component for displaying links to content. It can have a title, link, date and profile to highlight the author of the content.
5
+ visibility: storybook
6
+ fields:
7
+ date:
8
+ type: object
9
+ label: Date
10
+ description: Date copy (human and Unix)
11
+ preview:
12
+ human: 20 September 2022
13
+ unix: 1670389200
14
+ eyebrow:
15
+ type: string
16
+ label: Eyebrow
17
+ description: Eyebrow copy
18
+ preview: "Podcast"
19
+ link:
20
+ type: string
21
+ label: Link
22
+ description: Link field for the card
23
+ preview: "https://www.ilo.org/"
24
+ profile:
25
+ type: object
26
+ label: Profile
27
+ description: Optional profile of the author who created the content
28
+ preview:
29
+ avatar: "/images/ilo-dg.jpg"
30
+ name: "Gilbert F. Houngbo"
31
+ role: "ILO Director-General"
32
+ title:
33
+ type: string
34
+ label: Title
35
+ description: Title field for the card
36
+ preview: Can digital technology be an equality machine?
37
+ settings:
38
+ size:
39
+ type: select
40
+ label: Size
41
+ description: Sets the size of the card. If not set, the card will appear as `narrow`.
42
+ required: false
43
+ preview: "narrow"
44
+ options:
45
+ narrow: narrow
46
+ wide: wide
47
+ fluid: fluid
48
+ theme:
49
+ type: select
50
+ label: Theme
51
+ description: Sets the card to appear as either light or dark. If not set, the card will inherit the theme of its parent.
52
+ required: false
53
+ preview: "light"
54
+ options:
55
+ dark: Dark
56
+ light: Light
57
+
58
+
59
+
@@ -0,0 +1,9 @@
1
+ import "./index";
2
+
3
+ export default {};
4
+ const patternDefinition = require("./card_text.wingsuit.yml");
5
+
6
+ /* eslint-disable-next-line */
7
+ export const wingsuit = {
8
+ patternDefinition,
9
+ };
@@ -1,36 +1,33 @@
1
1
  {#
2
2
  CARDGROUP COMPONENT
3
3
  #}
4
- <div class="{{prefix}}--cardgroup {{prefix}}--cardgroup--{{cardcount}}">
4
+ <div class="{{prefix}}--cardgroup {{prefix}}--cardgroup__count__{{cardcount}} {% if collapsed %} {{prefix}}--cardgroup__collapsed {% endif %} {% if justify %} {{prefix}}--cardgroup__justify__{{justify}} {% endif %}">
5
5
  <div class="{{prefix}}--cardgroup--inner">
6
6
  {% for card in group %}
7
- {% include "@components/card/card.twig" with {
8
- title: card.title,
9
- image: card.image,
10
- intro: card.intro,
11
- eyebrow: card.eyebrow,
12
- date: card.date,
13
- dataset: card.dataset,
14
- link: card.link,
15
- profile: card.profile,
16
- eventdate: card.eventdate,
17
- cta: card.cta,
18
- source: card.source,
19
- list: card.list,
20
- linklist: card.linklist,
21
- color: card.color,
22
- imageAlt: card.imageAlt,
23
- loading: card.loading,
24
- prefix: prefix,
25
- theme: theme,
26
- cornercut: cornercut,
27
- alignment: alignment,
28
- variant: variant,
29
- type: type,
30
- size: size
31
- } only %}
32
- {% endfor %}
33
-
7
+ <div class="{{prefix}}--cardgroup--card">
8
+ {% include "@components/card/card.twig" with {
9
+ size: "fluid",
10
+ theme: theme,
11
+ type: type,
12
+ cta: card.cta,
13
+ dataset: card.dataset,
14
+ date: card.date,
15
+ dateExtra: card.dateExtra,
16
+ eyebrow: card.eyebrow,
17
+ image: card.image,
18
+ intro: card.intro,
19
+ link: card.link,
20
+ linklist: card.linklist,
21
+ list: card.list,
22
+ title: card.title,
23
+ alignment: card.alignment,
24
+ color: card.color,
25
+ cornercut: card.cornercut,
26
+ source: card.source,
27
+ prefix: prefix
28
+ } only %}
29
+ </div>
30
+ {% endfor %}
34
31
  {% if cta %}
35
32
  <div class="{{prefix}}--cardgroup--button-wrap">
36
33
  <a