@ilo-org/twig 0.4.1 → 0.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.
@@ -1,9 +1,9 @@
1
1
 
2
- > @ilo-org/twig@0.4.1 build:lib /home/runner/work/designsystem/designsystem/packages/twig
2
+ > @ilo-org/twig@0.6.0 build:lib /home/runner/work/designsystem/designsystem/packages/twig
3
3
  > node importprefix.js && node importsvgs.js && pnpm output
4
4
 
5
5
  theme prefix added
6
6
 
7
- > @ilo-org/twig@0.4.1 output /home/runner/work/designsystem/designsystem/packages/twig
7
+ > @ilo-org/twig@0.6.0 output /home/runner/work/designsystem/designsystem/packages/twig
8
8
  > node outputtwigs.js
9
9
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @ilo-org/twig
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 0f45a7aae: Add new social media component and use in hero card and footer components
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [0f45a7aae]
12
+ - Updated dependencies [0f45a7aae]
13
+ - Updated dependencies [0f45a7aae]
14
+ - Updated dependencies [0f45a7aae]
15
+ - Updated dependencies [2f6b0e73f]
16
+ - @ilo-org/themes@0.2.0
17
+ - @ilo-org/icons@0.2.1
18
+ - @ilo-org/styles@0.5.0
19
+
20
+ ## 0.5.0
21
+
22
+ ### Minor Changes
23
+
24
+ - e74f529ac: Refactor hero and hero card component. Expose layout and style options more explicitly and remove parameters and classes that refer to specific template names which could change.
25
+ - cc4fe4ba6: In the Callout component, use the Button component so it can take a url and act as a link
26
+
27
+ ### Patch Changes
28
+
29
+ - bb9180a14: In hero, make sure breadcrumb is not null and not empty or it could render unintentionally
30
+ - Updated dependencies [5df0bb1a9]
31
+ - Updated dependencies [51b4be31a]
32
+ - Updated dependencies [6a7dbe609]
33
+ - Updated dependencies [b498c19c4]
34
+ - @ilo-org/icons@0.2.0
35
+ - @ilo-org/themes@0.1.16
36
+ - @ilo-org/styles@0.4.0
37
+
3
38
  ## 0.4.1
4
39
 
5
40
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilo-org/twig",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Twig components for the ILO's Design System",
6
6
  "main": "",
@@ -24,9 +24,9 @@
24
24
  "video.js": "^7.21.2",
25
25
  "@ilo-org/brand-assets": "0.1.0",
26
26
  "@ilo-org/fonts": "0.1.0",
27
- "@ilo-org/icons": "0.1.17",
28
- "@ilo-org/styles": "0.3.5",
29
- "@ilo-org/themes": "0.1.15",
27
+ "@ilo-org/icons": "0.2.1",
28
+ "@ilo-org/styles": "0.5.0",
29
+ "@ilo-org/themes": "0.2.0",
30
30
  "@ilo-org/utils": "0.0.11"
31
31
  },
32
32
  "devDependencies": {
@@ -16,14 +16,19 @@
16
16
  {% endif %}
17
17
  </div>
18
18
  {{ content }}
19
- {% if buttonLabel %}
19
+ {% if button %}
20
20
  <div class="{{prefix}}--callout--footer">
21
- <button
22
- class="{{prefix}}--button {{prefix}}--button--small {{prefix}}--button--secondary"
23
- type="button"
24
- >
25
- <span class="button__label">{{ buttonLabel }}</span>
26
- </button>
21
+ {% include '@components/button/button.twig' with {
22
+ label: button.label,
23
+ url: button.url,
24
+ target: button.target,
25
+ icon: button.icon,
26
+ className: button.className,
27
+ icon: button.icon,
28
+ iconPosition: button.iconPosition,
29
+ size: "small",
30
+ type: "secondary",
31
+ } %}
27
32
  </div>
28
33
  {% endif %}
29
34
  </div>
@@ -3,12 +3,17 @@ callout:
3
3
  label: Callout
4
4
  description: A callout alert section with a few different types
5
5
  fields:
6
- buttonLabel:
7
- type: string
6
+ button:
7
+ type: object
8
8
  label: Button Label
9
- description: The label for the optional button
10
- preview: "Optional Button Label"
9
+ description: Fields to pass to the button if there is one
11
10
  required: false
11
+ preview:
12
+ label: "Button"
13
+ url: "https://www.ilo.org"
14
+ target: "_blank"
15
+ icon: false
16
+ className: "optionalclass"
12
17
  content:
13
18
  type: text
14
19
  label: Content
@@ -22,15 +22,14 @@
22
22
  {% endif %}
23
23
  {% if social or subscribe %}
24
24
  <div class="connect">
25
- {% if social %}
26
- <h5 class="social--headline">{{social.headline}}</h5>
27
- <ul class="social--links">
28
- {% for link in social.links %}
29
- <li class="social--links--item">
30
- <a href="{{link.url}}" class="social--links--link {{link.type|lower}}">{{link.type|capitalize}}</a>
31
- </li>
32
- {% endfor %}
33
- </ul>
25
+ {% if socialmedia %}
26
+ <div class="social--links">
27
+ {% include '@components/socialmedia/socialmedia.twig' with {
28
+ theme: "dark",
29
+ headline: socialmedia.headline,
30
+ icons: socialmedia.icons,
31
+ } %}
32
+ </div>
34
33
  {% endif %}
35
34
  {% if subscribe %}
36
35
  {% include '@components/button/button.twig' with {label: subscribe.label, url: subscribe.url, type: 'primary', size: 'large', target: '_blank'} %}
@@ -48,23 +48,34 @@ footer:
48
48
  url: "http://www.google.com"
49
49
  - label: "Link Six"
50
50
  url: "http://www.google.com"
51
- social:
51
+ socialmedia:
52
52
  type: object
53
53
  label: social
54
54
  description: "Links to social media"
55
55
  preview:
56
- headline: "Social Links Headline"
57
- links:
58
- - type: "instagram"
59
- url: "http://www.google.com"
60
- - type: "facebook"
61
- url: "http://www.google.com"
62
- - type: "twitter"
63
- url: "http://www.google.com"
64
- - type: "twitter"
65
- url: "http://www.google.com"
66
- - type: "instagram"
67
- url: "http://www.google.com"
56
+ headline: "Connect with the ILO"
57
+ icons:
58
+ - icon: "twitter"
59
+ label: "Twitter"
60
+ url: "https://twitter.com/#!/ilo"
61
+ - icon: "facebook"
62
+ label: "Facebook"
63
+ url: "https://www.facebook.com/ilo.org"
64
+ - icon: "linkedin"
65
+ label: "LinkedIn"
66
+ url: "https://www.linkedin.com/company/international-labour-organization-ilo"
67
+ - icon: "instagram"
68
+ label: "Instagram"
69
+ url: "https://www.instagram.com/ilo.org/"
70
+ - icon: "tiktok"
71
+ label: "TikTok"
72
+ url: "https://www.tiktok.com/@ilo"
73
+ - icon: "flickr"
74
+ label: "Flickr"
75
+ url: "https://www.flickr.com/photos/ilopictures/albums"
76
+ - icon: "youtube"
77
+ label: "YouTube"
78
+ url: "https://www.youtube.com/channel/UCrlcu5KChYyHwXlIeD7oLUg"
68
79
  subscribe:
69
80
  type: object
70
81
  label: subscribe
@@ -1,35 +1,52 @@
1
1
  {#
2
- HERO COMPONENT
2
+ Temp COMPONENT
3
3
  #}
4
- <div class="{{prefix}}--hero {{prefix}}--hero--{{theme}} {{prefix}}--hero--{{types}} {% if image %}{{prefix}}--hero--image{% endif %}">
5
- {% if breadcrumb is defined %}
6
- {% include "@components/breadcrumb/breadcrumb.twig" with {
7
- home: breadcrumb.home,
8
- links: breadcrumb.links,
4
+ <div class="hero hero__card-justify__{{ justify }} hero__poster-size__{{ postersize }} hero__card-size__{{ cardsize }} hero__card-align__{{ align }}">
5
+ <figure class="hero--figure">
6
+ {% block hero_image %}
7
+ {% if image %}
8
+ <picture>
9
+ {% for img in image.url|reverse %}
10
+ {% if loop.last == false %}
11
+ <source srcset="{{img.src}}" media="(min-width: {{img.breakpoint}}px)">
12
+ {% endif %}
13
+ {% endfor %}
14
+ <img class="{{prefix}}--card--image" src="{{image.url|reverse|last.src}}" alt="{{image.alt}}" {% if image.loading %} loading="{{ image.loading }}"{% endif %}>
15
+ </picture>
16
+ {% endif %}
17
+ {% endblock %}
18
+ </figure>
19
+ {% if breadcrumb %}
20
+ <div class="hero--breadcrumbs">
21
+ <div class="hero--breadcrumbs--wrapper">
22
+ {% include "@components/breadcrumb/breadcrumb.twig" with {
23
+ home: breadcrumb.home,
24
+ links: breadcrumb.links,
25
+ prefix: prefix,
26
+ } only %}
27
+ </div>
28
+ </div>
29
+ {% endif %}
30
+ <div class="hero--card">
31
+ {% include "@components/herocard/herocard.twig" with {
32
+ url: herocard.url,
33
+ eyebrow: herocard.eyebrow,
34
+ cornercut: herocard.cornercut,
35
+ datecopy: herocard.datecopy,
36
+ intro: herocard.intro,
9
37
  prefix: prefix,
38
+ socialmedia: herocard.socialmedia,
39
+ theme: herocard.theme,
40
+ background: herocard.background,
41
+ title: herocard.title,
10
42
  } only %}
11
- {% endif %}
12
- {% block hero_image %}
13
- {% if not image %}
14
- {% else %}
15
- {% include "@components/image/image.twig" with {
16
- alt: image.alt,
17
- prefix: prefix,
18
- url: image.url,
19
- ishero: "true"
20
- } only %}
21
- {% endif %}
22
- {% endblock %}
23
- {% include "@components/herocard/herocard.twig" with {
24
- alignment: herocard.alignment,
25
- eyebrow: herocard.eyebrow,
26
- datecopy: herocard.datecopy,
27
- hasbackground: hasbackground,
28
- intro: herocard.intro,
29
- prefix: prefix,
30
- socials: herocard.socials,
31
- theme: theme,
32
- title: herocard.title,
33
- types: types
34
- } only %}
35
- </div>
43
+ </div>
44
+ <div class="hero--caption">
45
+ {% if not caption %}
46
+ {% else %}
47
+ <div class="hero--caption--wrapper">
48
+ {% include '@components/tooltip/tooltip.twig' with caption %}
49
+ </div>
50
+ {% endif %}
51
+ </div>
52
+ </div>
@@ -1,10 +1,23 @@
1
1
  hero:
2
2
  use: "@components/hero/hero.twig"
3
3
  label: Hero
4
- description: The Hero presents an image banner.
4
+ description: The Hero is an attention-grabbing section of a web page designed to engage users and create a memorable first impression.
5
5
  fields:
6
+ image:
7
+ label: Image
8
+ type: object
9
+ description: The image to display in the hero. The image will be cropped to fit the hero's aspect ratio.
10
+ preview:
11
+ alt: Lorem ipsum
12
+ loading: lazy
13
+ url:
14
+ - breakpoint: 0
15
+ src: "/images/hero.jpg"
16
+ - breakpoint: 768
17
+ src: "/images/hero.jpg"
6
18
  breadcrumb:
7
- label: Implementation of Breadcrumb component. See Breadcrumb for more details
19
+ label: Bread crumbs
20
+ description: The breadcrumb navigation to display in the hero.
8
21
  type: object
9
22
  preview:
10
23
  home:
@@ -21,72 +34,125 @@ hero:
21
34
  url: "/linkfour"
22
35
  - label: "Link Five"
23
36
  url: "/linkfive"
24
- image:
25
- label: Implementation of Image component. See Image for more details
37
+ herocard:
38
+ label: Hero Card
26
39
  type: object
40
+ description: The hero card to display in the hero. See docs on the Hero Card component for more information about the fields.
27
41
  preview:
28
- alt: Lorem ipsum
29
- url:
30
- - breakpoint: 0
31
- src: "/images/hero.jpg"
32
- - breakpoint: 768
33
- src: "/images/hero.jpg"
34
- herocard:
35
- label: Part of the hero that displays text on top of image (or if no image on a background color). There are light and dark versions and all text parts are optional.
42
+ title: "Child labour"
43
+ theme: "dark"
44
+ background: "solid"
45
+ cornercut: "true"
46
+ eyebrow: ILO Topics
47
+ socialmedia:
48
+ icons:
49
+ - label: "Facebook"
50
+ url: "https://www.facebook.com/ilo.org"
51
+ icon: "facebook"
52
+ - label: "Twitter"
53
+ url: "https://www.twitter.com/ilo.org"
54
+ icon: "twitter"
55
+ - label: "Linkedin"
56
+ url: "https://www.linkedin.com/company/international-labour-organization-ilo"
57
+ icon: "linkedin"
58
+ caption:
59
+ label: Caption
36
60
  type: object
61
+ description: The credit and caption information about the image. Appears as a tooltip.
37
62
  preview:
38
- alignment: left
39
- datecopy: 11 February 2022
40
- eyebrow: Eyebrow
41
- intro: "Brief intro text - ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
42
- socials:
43
- - label: "Facebook"
44
- url: "https://www.facebook.com/ilo.org"
45
- icon: "facebook"
46
- - label: "Linkedin"
47
- url: "https://www.linkedin.com/company/international-labour-organization-ilo"
48
- icon: "linkedin"
49
- title: "This is an left aligned article headline that is more than two lines long"
63
+ label: A metalurgy worker at a manufacturing plant in Viet Nam. © ILO/Minh Quang
64
+ icon: "true"
65
+ theme: "dark"
66
+ settings:
67
+ justify:
68
+ label: Justify
69
+ description: Sets the horizontal alignment of the hero card. `start` is on the left in LTR layouts and on the right in RTL layouts.
70
+ type: select
71
+ options:
72
+ start: start
73
+ offset: offset
74
+ center: center
75
+ preview: "start"
76
+ align:
77
+ label: Align
78
+ description: Sets the vertical alignment of the hero card.
79
+ type: select
80
+ options:
81
+ baseline: baseline
82
+ center: center
83
+ bottom: bottom
84
+ preview: "baseline"
85
+ postersize:
86
+ label: Poster Size
87
+ description: Sets the size of the image poster.
88
+ type: select
89
+ options:
90
+ small: small
91
+ medium: medium
92
+ large: large
93
+ xlarge: xlarge
94
+ preview: large
95
+ cardsize:
96
+ label: Card Size
97
+ description: Sets the width of the hero card.
98
+ type: select
99
+ options:
100
+ small: small
101
+ medium: medium
102
+ large: large
103
+ xlarge: xlarge
104
+ xxlarge: xxlarge
105
+ preview: small
50
106
  variants:
51
107
  default:
52
108
  label: Default
109
+ homepage:
110
+ label: Homepage
111
+ description: The hero variant for the homepage.
112
+ settings:
113
+ align: "center"
114
+ justify: "start"
115
+ postersize: "large"
116
+ cardsize: "medium"
117
+ fields:
118
+ breadcrumb: null
119
+ herocard:
120
+ title: "ILO welcomes G7 call to make a just transition to a green economy happen"
121
+ url: "https://www.ilo.org"
122
+ theme: "dark"
123
+ background: "semi-transparent"
124
+ cornercut: false
125
+ eyebrow: UN General Assembly
53
126
  article:
54
127
  label: Article
55
- description: article settings
56
- fields:
57
- image: ""
58
128
  settings:
59
- theme: light
60
- types: article
61
- settings:
62
- theme:
63
- type: select
64
- label: Theme
65
- description: The theme type for the hero
66
- required: false
67
- preview: "dark"
68
- options:
69
- dark: Dark
70
- light: Light
71
- hasbackground:
72
- type: select
73
- label: Has Background
74
- description: does the hero card have a background? (Defaults to true, only applied to Home Hero)
75
- options:
76
- true: true
77
- false: "false"
78
- preview: true
79
- types:
80
- type: select
81
- label: Types
82
- description: The type of hero
83
- required: false
84
- preview: "publication"
85
- options:
86
- home: Home
87
- publication: Publication
88
- graphic: Graphic
89
- project: Project
90
- article: Article
91
- portal: Portal
129
+ align: "bottom"
130
+ justify: "center"
131
+ postersize: "xlarge"
132
+ cardsize: "large"
133
+ fields:
134
+ breadcrumb: null
135
+ herocard:
136
+ title: "When a woman becomes a boss in a man's world"
137
+ datecopy: "11 February 2021"
138
+ theme: "light"
139
+ background: "solid"
140
+ cornercut: "true"
141
+ eyebrow: Women in management
142
+ socialmedia:
143
+ icons:
144
+ - label: "Facebook"
145
+ url: "https://www.facebook.com/ilo.org"
146
+ icon: "facebook"
147
+ - label: "Twitter"
148
+ url: "https://www.twitter.com/ilo.org"
149
+ icon: "twitter"
150
+ - label: "Linkedin"
151
+ url: "https://www.linkedin.com/company/international-labour-organization-ilo"
152
+ icon: "linkedin"
153
+ caption:
154
+ label: A metalurgy worker at a manufacturing plant in Viet Nam. © ILO/Minh Quang
155
+ icon: "true"
156
+ theme: "dark"
92
157
  visibility: storybook
158
+
@@ -1,12 +1,18 @@
1
1
  {#
2
2
  HEROCARD COMPONENT
3
3
  #}
4
- <div class="{{prefix}}--hero-card {{prefix}}--hero-card--{{alignment}} {{prefix}}--hero-card--{{theme}} {{prefix}}--hero-card--{{types}}{% if not hasbackground or hasbackground == 'false' %} {{prefix}}--hero-card--nobackground{% endif %}">
4
+ <div class="{{prefix}}--hero-card {{prefix}}--hero-card__theme__{{ theme }} {{prefix}}--hero-card__background__{{ background }} {% if cornercut == "true" %} {{prefix}}--hero-card__cornercut {% endif %}">
5
5
  {% if eyebrow %}
6
6
  <p class="{{ prefix }}--hero-card--eyebrow">{{ eyebrow }}</p>
7
7
  {% endif %}
8
8
  {% if title %}
9
- <h2 class="{{ prefix }}--hero-card--title">{{ title }}</h2>
9
+ {% if url %}
10
+ <a href={{ url }} class="{{ prefix }}--hero-card--title-link">
11
+ <h1 class="{{ prefix }}--hero-card--title">{{ title }}</h1>
12
+ </a>
13
+ {% else %}
14
+ <h1 class="{{ prefix }}--hero-card--title">{{ title }}</h2>
15
+ {% endif %}
10
16
  {% endif %}
11
17
  {% if datecopy %}
12
18
  <p class="{{ prefix }}--hero-card--datecopy">{{ datecopy }}</p>
@@ -14,18 +20,11 @@
14
20
  {% if intro %}
15
21
  <p class="{{ prefix }}--hero-card--intro">{{ intro }}</p>
16
22
  {% endif %}
17
-
18
- <ul class="{{ prefix }}--hero-card--list">
19
- {% for item in socials %}
20
- <li class="{{ prefix }}--hero-card--list--item">
21
- <a
22
- class="{{ prefix }}--hero-card--link icon icon--{{ item.icon }}"
23
- href={{ item.url }}
24
- title={{ item.label }}
25
- >
26
- {{ item.label }}
27
- </a>
28
- </li>
29
- {% endfor %}
30
- </ul>
23
+ {% if socialmedia %}
24
+ {% include "@components/socialmedia/socialmedia.twig" with {
25
+ theme: theme,
26
+ align: "start",
27
+ icons: socialmedia.icons
28
+ } %}
29
+ {% endif %}
31
30
  </div>
@@ -1,9 +1,40 @@
1
1
  herocard:
2
2
  use: "@components/herocard/herocard.twig"
3
3
  label: Hero Card
4
- description: The Hero card, a subcomponent of the hero
4
+ description: The Hero Card includes the title, intro, date, and social links for the hero
5
5
  id: herocard
6
+ settings:
7
+ theme:
8
+ type: select
9
+ label: Theme
10
+ description: The theme of the hero card.
11
+ options:
12
+ light: light
13
+ dark: dark
14
+ preview: "dark"
15
+ background:
16
+ type: select
17
+ label: Background
18
+ description: Should the background be solid, semi-transparent or transparent
19
+ options:
20
+ solid: solid
21
+ semi-transparent: semi-transparent
22
+ transparent: transparent
23
+ preview: "solid"
24
+ cornercut:
25
+ type: select
26
+ label: Cornercut
27
+ description: Whether the card show have its right or left corner cut
28
+ options:
29
+ false: false
30
+ true: "true"
31
+ preview: "true"
6
32
  fields:
33
+ url:
34
+ type: string
35
+ label: URL
36
+ description: Optional URL for the hero card. If provided, the title will be a link.
37
+ preview: null
7
38
  datecopy:
8
39
  type: string
9
40
  label: Date copy
@@ -13,44 +44,27 @@ herocard:
13
44
  type: string
14
45
  label: Eyebrow
15
46
  description: Copy for the eyebrow of the card
16
- preview: "Eyebrow"
47
+ preview: "Gender equality"
17
48
  intro:
18
49
  type: string
19
50
  label: Intro
20
51
  description: Intro text for the hero
21
- preview: "Brief intro text - ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
22
- socials:
52
+ preview: "Over the last three decades, global supply chains have been a key entry point for women to enter the formal workforce."
53
+ socialmedia:
23
54
  type: object
24
- label: Social links
55
+ label: Social media links
25
56
  description: The social links to include in the hero
26
57
  preview:
27
- - label: "Facebook"
28
- url: "https://www.facebook.com/"
29
- icon: "facebook"
30
- - label: "Linkedin"
31
- url: "https://www.linkedin.com/"
32
- icon: "linkedin"
58
+ icons:
59
+ - label: "Facebook"
60
+ url: "https://www.facebook.com/"
61
+ icon: "facebook"
62
+ - label: "Linkedin"
63
+ url: "https://www.linkedin.com/"
64
+ icon: "linkedin"
33
65
  title:
34
66
  type: string
35
67
  label: Title
36
68
  description: This is the title for the hero card
37
- preview: "This is an centered aligned article headline that is more than two lines long"
38
- settings:
39
- alignment:
40
- type: select
41
- label: Alignment
42
- description: alignment for card
43
- options:
44
- left: "left"
45
- center: "center"
46
- right: "right"
47
- preview: "center"
48
- hasbackground:
49
- type: select
50
- label: Has Background
51
- description: does the hero card have a background? (Defaults to true, only applied to Home Hero)
52
- options:
53
- true: true
54
- false: "false"
55
- preview: true
69
+ preview: "How to achieve gender equality in global garment supply chains"
56
70
  visibility: storybook
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SocialMedia COMPONENT
3
+ */
4
+ // Module template
5
+ import "./socialmedia.twig";
6
+ import "./socialmedia.wingsuit.yml";
@@ -0,0 +1,48 @@
1
+ import { Title, Subtitle } from "@storybook/addon-docs/blocks";
2
+ import {
3
+ PatternLoad,
4
+ PatternPreview,
5
+ PatternProperties,
6
+ PatternInclude,
7
+ PatternDoc,
8
+ } from "@wingsuit-designsystem/storybook";
9
+ import brandTokens from "@ilo-org/themes/tokens/brand/base.json";
10
+
11
+ <PatternLoad patternId="socialmedia">
12
+ {(pattern) => {
13
+ return (
14
+ <>
15
+ <Title />
16
+ <Subtitle>{pattern.description}</Subtitle>
17
+ <div style={{ margin: "30px 0" }}>
18
+ <div
19
+ style={{
20
+ padding: "30px 20px",
21
+ border: "1px solid rgba(0,0,0,.1)",
22
+ boxShadow: "rgba(0, 0, 0, 0.10) 0 1px 3px 0",
23
+ }}
24
+ >
25
+ <PatternPreview variant={pattern.getDefaultVariant()} />
26
+ </div>
27
+ <div
28
+ style={{
29
+ padding: "30px 20px",
30
+ border: "1px solid rgba(0,0,0,.1)",
31
+ boxShadow: "rgba(0, 0, 0, 0.10) 0 1px 3px 0",
32
+ background: "rgba(35, 0, 80, 1)",
33
+ }}
34
+ >
35
+ <PatternPreview
36
+ variant={pattern.getDefaultVariant()}
37
+ theme="dark"
38
+ />
39
+ </div>
40
+ </div>
41
+ <h3>Properties</h3>
42
+ <PatternProperties variant={pattern.getDefaultVariant()} />
43
+ <h3>Basic usage</h3>
44
+ <PatternInclude variant={pattern.getDefaultVariant()} />
45
+ </>
46
+ );
47
+ }}
48
+ </PatternLoad>
@@ -0,0 +1,15 @@
1
+ import "./index";
2
+ import mdx from "./socialmedia.mdx";
3
+
4
+ export default {};
5
+ const patternDefinition = require("./socialmedia.wingsuit.yml");
6
+
7
+ /* eslint-disable-next-line */
8
+ export const wingsuit = {
9
+ patternDefinition,
10
+ parameters: {
11
+ docs: {
12
+ page: mdx,
13
+ },
14
+ },
15
+ };
@@ -0,0 +1,17 @@
1
+ {#
2
+ SOCIALMEDIA COMPONENT
3
+ #}
4
+ <div class="{{ prefix }}--social-media {{ prefix }}--social-media__theme__{{ theme|default("light") }} {{ prefix }}--social-media__justify__{{ align|default("start") }}">
5
+ {% if headline %}
6
+ <h5 class="{{ prefix }}--social-media--headline">{{ headline }}</h5>
7
+ {% endif %}
8
+ <ul class="{{ prefix }}--social-media--list">
9
+ {% for item in icons %}
10
+ <li class="{{ prefix }}--social-media--list--item">
11
+ <a class="{{ prefix }}--social-media--list--item--icon {{ prefix }}--social-media--list--item--icon__{{ item.icon }}" href={{ item.url }} title={{ item.label|capitalize }} target="_blank">
12
+ {{item.label|capitalize}}
13
+ </a>
14
+ </li>
15
+ {% endfor %}
16
+ </ul>
17
+ </div>
@@ -0,0 +1,58 @@
1
+ socialmedia:
2
+ use: "@components/socialmedia/socialmedia.twig"
3
+ label: Social Media
4
+ description: The Social Media component displays a series of social media icons with links and an optional headline. It can have a light or a dark theme.
5
+ settings:
6
+ theme:
7
+ type: select
8
+ label: Theme
9
+ description: The theme of the social media icons.
10
+ options:
11
+ light: light
12
+ dark: dark
13
+ preview: light
14
+ defaultValue: light
15
+ justify:
16
+ type: select
17
+ label: Justify
18
+ description: The justification of the headline and icons.
19
+ options:
20
+ start: start
21
+ center: center
22
+ preview: start
23
+ defaultValue: start
24
+ fields:
25
+ headline:
26
+ type: string
27
+ label: headline
28
+ description: Optional headline of social media links
29
+ preview: "Follow us on social media"
30
+ required: false
31
+ icons:
32
+ type: object
33
+ label: icons
34
+ description: The social media icons to display. Each icon has an `icon` corresponding to the name of a social network icon in lowercase, a `label` that is displayed as a tooltip, and a `url` that is the link to the social media page.
35
+ preview:
36
+ - icon: "twitter"
37
+ label: "Twitter"
38
+ url: "https://twitter.com/#!/ilo"
39
+ - icon: "facebook"
40
+ label: "Facebook"
41
+ url: "https://www.facebook.com/ilo.org"
42
+ - icon: "linkedin"
43
+ label: "LinkedIn"
44
+ url: "https://www.linkedin.com/company/international-labour-organization-ilo"
45
+ - icon: "instagram"
46
+ label: "Instagram"
47
+ url: "https://www.instagram.com/ilo.org/"
48
+ - icon: "tiktok"
49
+ label: "TikTok"
50
+ url: "https://www.tiktok.com/@ilo"
51
+ - icon: "flickr"
52
+ label: "Flickr"
53
+ url: "https://www.flickr.com/photos/ilopictures/albums"
54
+ - icon: "youtube"
55
+ label: "YouTube"
56
+ url: "https://www.youtube.com/channel/UCrlcu5KChYyHwXlIeD7oLUg"
57
+ required: true
58
+ visibility: storybook
@@ -2,7 +2,7 @@
2
2
  TOOLTIP COMPONENT
3
3
  #}
4
4
  <div
5
- class="{{prefix}}--tooltip--wrapper{% if icon and icon != 'false' %} has-icon{% endif %}" role="status" aria-live="polite" aria-relevant="additions" data-loadcomponent="Tooltip" data-prefix="{{prefix}}"
5
+ class="{{prefix}}--tooltip--wrapper{% if icon and icon != 'false' %} has-icon{% endif %} {{prefix}}--tooltip--wrapper--{{theme}}" role="status" aria-live="polite" aria-relevant="additions" data-loadcomponent="Tooltip" data-prefix="{{prefix}}"
6
6
  >
7
7
  {% if not icon or icon == 'false' %}
8
8
  {{ children|raw }}