swedbank-pay-design-guide-jekyll-theme 1.9.12 → 1.10.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 136a6ad6d38647a7706751b72b4cae4570abdbbab3414da7f6afaa7cf10cfc3b
4
- data.tar.gz: b657467169c8755ad2d3ff75f8cf2fdea07315f3affb3fa86f7ededb5b8c72f2
3
+ metadata.gz: 107fe32dcdd6919798c50bc86a8933442abadabf1120a24b6dfbbcf634e427b3
4
+ data.tar.gz: 0f1c6521f1eded78dfef148a0f17537c2cacdcadb2eb7a344060fac494257a51
5
5
  SHA512:
6
- metadata.gz: 23c0f8cf529856c1098afdbc57c9574eb1b8f4fa25339631c733e1f0210f06afaa4a732efa49585823f6191a7028cf3ad55b49ea83b204d56f9792a4c4ba0f81
7
- data.tar.gz: cda338e81636f5c3c5d91e61c3bfaff497bc08f358dd9398c4122007af7cf0788beece70cbc98cf8f18272113473fb37f6d632c97db61e1139b913b79976a56e
6
+ metadata.gz: 6aaac38681e036d6e1a3db0e0919a02cf89f47d3db876a85d67142219a44fd129698a4f69ff9ee63d6b13798248ea185ba4df8e0bb67429f2f50a1a345aa6522
7
+ data.tar.gz: 3dc72e03582095cb5ea5721bf1b63d63a1827f51282623035124eb875cfd4ca23a0d89a889a7186a6000b5317b1bd8e7a80cf777ef5c69b54a4ad183e4926dea
@@ -7,22 +7,35 @@ type: sdk | module - Empty type result in default card styling
7
7
  col_class(required): Describes what grid column class(es) each card should be wrapped in
8
8
  {%- endcomment -%}
9
9
 
10
- {% assign card_list = include.card_list %}
11
- {% assign type = include.type %}
12
- {% assign col_class = include.col_class %}
10
+ {% assign cards = include.card_list | default: page.children %}
11
+ {% assign col_class = include.col_class | default: 'col-lg-4' %}
13
12
 
14
13
  <div class="row card-list">
15
- {% for card in card_list %}
14
+ {% for card in cards %}
16
15
  {% assign title = card.title | split: '–' | last %}
16
+ {% assign link_to = card.absolute_path | default: card.url %}
17
+
18
+ {% assign card_type = card.card.type | default: card.card_type | default: include.type %}
19
+ {% assign icon_content = card.card.icon.content | default: card.icon.content %}
20
+ {% assign icon_outlined = card.card.icon.outlined | default: card.icon.outlined %}
21
+ {% assign icon_svg = card.card.icon.svg | default: card.icon.svg %}
22
+ {% assign no_icon = card.card.icon.no_icon | default: card.icon.no_icon %}
23
+ {% assign horizontal = card.card.horizontal | default: false %}
24
+ {% assign disabled = card.card.disabled | default: card.disabled %}
25
+
17
26
  <div class="{{ col_class }}">
18
- {% include card.html title=title
27
+ {% include card.html
28
+ title=title
19
29
  text=card.description
20
- icon_content=card.icon.content
21
- icon_outlined=card.icon.outlined
22
- icon_svg=card.icon.svg
23
- to=card.url
24
- type=type
30
+ icon_content=icon_content
31
+ icon_outlined=icon_outlined
32
+ icon_svg=icon_svg
33
+ no_icon=no_icon
34
+ to=link_to
35
+ type=card_type
36
+ horizontal=horizontal
37
+ disabled=disabled
25
38
  %}
26
39
  </div>
27
40
  {% endfor %}
28
- </div>
41
+ </div>
@@ -0,0 +1,14 @@
1
+ {% for child in page.children %}
2
+ {% if child.children && child.children.size > 0 %}
3
+ {% assign title = child.title | default: child.section %}
4
+ {% capture header %}
5
+ {:.heading-line}
6
+ ## {{ title }}
7
+ {% endcapture %}
8
+ {% assign header = header | markdownify %}
9
+ {% include anchor_headings.html html=header anchorClass='header-anchor' %}
10
+ {% assign col_class = child.card.col_class | default: 'col-lg-4' %}
11
+ {% assign card_type = child.card.type %}
12
+ {% include card-list.html card_list=child.children col_class=col_class type=card_type %}
13
+ {% endif %}
14
+ {% endfor %}
data/_includes/card.html CHANGED
@@ -12,7 +12,6 @@ to(required): Url to the page to be directed to on click
12
12
  type: sdk | module - Empty type result in default card styling
13
13
  {%- endcomment -%}
14
14
 
15
- {% assign title = include.title %}
16
15
  {% assign title_type = include.title_type | default: 'h4', %}
17
16
  {% assign icon_content = include.icon_content %}
18
17
  {% assign icon_outlined = include.icon_outlined | default: false %}
@@ -21,53 +20,49 @@ type: sdk | module - Empty type result in default card styling
21
20
  {% assign text = include.text %}
22
21
  {% assign horizontal = include.horizontal | default: false %}
23
22
  {% assign to = include.to %}
23
+ {% assign disabled = include.disabled %}
24
+
24
25
  {% if include.type %}
25
- {% assign type = include.type %}
26
- {% assign type_class = 'dx-card-' | append: type %}
26
+ {% assign type = include.type %}
27
+ {% assign type_class = 'dx-card-' | append: type %}
27
28
  {% else %}
28
- {% assign type_class = '' %}
29
+ {% assign type_class = '' %}
29
30
  {% endif %}
30
31
 
31
- {% comment %}
32
- card.html is structured this way due to issues with rendering
33
- when Liquid is mixed in between and the cards are not wrapped in a div
34
- {% endcomment %}
32
+ {% unless icon_svg %}
33
+ {% if icon_content contains '/' or icon_content contains '.svg' %}
34
+ {% assign icon_svg = true %}
35
+ {% endif %}
36
+ {% endunless %}
35
37
 
38
+ {% assign card_class = 'dx-card ' | append: type_class | strip %}
36
39
  {% if horizontal %}
37
- <a href="{{ to }}" class="dx-card dx-card-horizontal {{type_class}}">
38
- <span class="dx-card-icon{% if no_icon %} d-none{% endif %}">
39
- {{ icon_content }}
40
- </span>
41
- <span class="dx-card-content">
42
- <span class="{{ title_type }}">{{ title }}</span>
43
- <span>{{ text }}</span>
44
- </span>
45
- <i class="material-icons">arrow_forward</i>
46
- </a>
47
- {% else %}
48
- {% if icon_svg %}
49
- <a href="{{ to }}" class="dx-card {{type_class}}">
50
- <span class="dx-card-icon">
51
- {% include {{ icon_content }} %}
52
- </span>
53
- <span class="dx-card-content">
54
- <span class="{{ title_type }}">{{ title }}</span>
55
- <span>{{ text }}</span>
56
- </span>
57
- <i class="material-icons">arrow_forward</i>
58
- </a>
40
+ {% assign card_class = card_class | append: ' dx-card-horizontal' | strip %}
41
+ {% endif %}
42
+
43
+ {% if disabled %}
44
+ {% assign card_class = card_class | append: ' dx-card-disabled' | strip %}
45
+ {% assign card_tag = 'span' %}
59
46
  {% else %}
60
- <a href="{{ to }}" class="dx-card {{type_class}}">
47
+ {% assign card_tag = 'a' %}
48
+ {% capture card_attributes %}href="{{ to }}"{% endcapture %}
49
+ {% endif %}
50
+
51
+ <{{ card_tag }} {{ card_attributes }} class="{{ card_class }}">
61
52
  <span class="dx-card-icon{% if no_icon %} d-none{% endif %}">
62
- <i class="material-icons{% if icon_outlined %}-outlined{% endif %}">
63
- {{ icon_content }}
64
- </i>
53
+ {% if icon_svg %}
54
+ {% include {{ icon_content }} %}
55
+ {% else %}
56
+ <i class="material-icons{% if icon_outlined %}-outlined{% endif %}">
57
+ {{ icon_content }}
58
+ </i>
59
+ {% endif %}
65
60
  </span>
66
61
  <span class="dx-card-content">
67
- <span class="{{ title_type }}">{{ title }}</span>
68
- <span>{{ text }}</span>
62
+ <span class="{{ title_type }}">{{ include.title }}</span>
63
+ <span>{{ text | markdownify }}</span>
69
64
  </span>
70
- <i class="material-icons">arrow_forward</i>
71
- </a>
72
- {% endif %}
73
- {% endif %}
65
+ {% unless disabled %}
66
+ <i class="material-icons">arrow_forward</i>
67
+ {% endunless %}
68
+ </{{ card_tag }}>
@@ -0,0 +1,19 @@
1
+ {% capture max_width_class %}
2
+ {% if page.layout == 'front-page' %}
3
+ no-padding
4
+ {% elsif page.card_overview %}
5
+ normal-padding max-width-card-overview
6
+ {% else %}
7
+ normal-padding max-width
8
+ {% endif %}
9
+ {% endcapture %}
10
+
11
+ <div class="doc-container {{ max_width_class | strip }}">
12
+ <article>
13
+ {% if page.card_overview %}
14
+ {% include card-overview.html %}
15
+ {% else %}
16
+ {% include anchor_headings.html html=content anchorClass='header-anchor' %}
17
+ {% endif %}
18
+ </article>
19
+ </div>
@@ -1,9 +1,8 @@
1
- <!-- Global site tag (gtag.js) - Google Analytics -->
2
- <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics.tracking_id }}"></script>
3
- <script>
4
- window.dataLayer = window.dataLayer || [];
5
- function gtag(){dataLayer.push(arguments);}
6
- gtag('js', new Date());
7
-
8
- gtag('config', '{{ site.google_analytics.tracking_id }}');
9
- </script>
1
+ <!-- Global site tag (gtag.js) - Google Analytics -->
2
+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics.tracking_id }}"></script>
3
+ <script>
4
+ window.dataLayer = window.dataLayer || [];
5
+ function gtag(){ dataLayer.push(arguments); }
6
+ gtag('js', new Date());
7
+ gtag('config', '{{ site.google_analytics.tracking_id }}', { 'anonymize_ip': true });
8
+ </script>
@@ -95,14 +95,7 @@
95
95
  {% if page.layout != 'front-page' %}
96
96
  {% include title-header.html %}
97
97
  {% endif %}
98
- <div class="doc-container{% if page.layout == 'front-page' %} no-padding
99
- {% elsif page.card_overview %} normal-padding max-width-card-overview
100
- {% else %} normal-padding max-width
101
- {% endif %}">
102
- <article>
103
- {% include anchor_headings.html html=content anchorClass='header-anchor' %}
104
- </article>
105
- </div>
98
+ {% include doc-container.html %}
106
99
  </main>
107
100
  </div>
108
101
  </div>
@@ -110,7 +103,7 @@
110
103
  <script src="{{ design_guide_url }}/scripts/dg.js"></script>
111
104
  <script src="{{ '/assets/js/swedbank-pay-design-guide-theme.js' | relative_url }}"></script>
112
105
  {%- if site.google_analytics.tracking_id %}
113
- {% include google_analytics.html %}
106
+ {% include google_analytics.html %}
114
107
  {%- endif %}
115
108
  </body>
116
109
 
data/_sass/card.scss CHANGED
@@ -95,10 +95,8 @@
95
95
  }
96
96
 
97
97
  &.dx-card-sdk {
98
-
99
98
  &:hover,
100
99
  &:focus {
101
-
102
100
  &:after {
103
101
  border-bottom: 4px solid $turquoise;
104
102
  }
@@ -116,13 +114,21 @@
116
114
  fill: $white;
117
115
  }
118
116
  }
117
+
118
+ &.dx-card-disabled {
119
+ &, .h1, .h2, .h3, .h4, h5, .h6 {
120
+ color: $soft-turquoise;
121
+ }
122
+
123
+ .dx-card-icon {
124
+ background-color: $soft-turquoise;
125
+ }
126
+ }
119
127
  }
120
128
 
121
129
  &.dx-card-module {
122
-
123
130
  &:hover,
124
131
  &:focus {
125
-
126
132
  &:after {
127
133
  border-bottom: 4px solid $card-pink;
128
134
  }
@@ -140,8 +146,36 @@
140
146
  fill: $white;
141
147
  }
142
148
  }
149
+
150
+ &.dx-card-disabled {
151
+ &, .h1, .h2, .h3, .h4, h5, .h6 {
152
+ color: $soft-card-pink;
153
+ }
154
+
155
+ .dx-card-icon {
156
+ background-color: $soft-card-pink;
157
+ }
158
+ }
143
159
  }
144
160
 
161
+ &.dx-card-disabled {
162
+ &, .h1, .h2, .h3, .h4, h5, .h6 {
163
+ color: $soft-brown;
164
+ }
165
+
166
+ &:hover,
167
+ &:focus {
168
+ box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.1);
169
+
170
+ &:after {
171
+ border-bottom: none;
172
+ }
173
+ }
174
+
175
+ .dx-card-icon {
176
+ background-color: $soft-yellow;
177
+ }
178
+ }
145
179
  }
146
180
 
147
181
 
data/_sass/colors.scss CHANGED
@@ -1,4 +1,5 @@
1
1
  $yellow: #fdc129;
2
+ $soft-yellow: #fff3d5;
2
3
  $light-turquoise: #ebf8f2;
3
4
  $apricot: #fbf2ea;
4
5
  $pink: #efb7b6;
@@ -7,12 +8,15 @@ $brand-info-light: #e8eff9;
7
8
  $brand-success: #51971b;
8
9
  $brand-success-light: #f2f7eb;
9
10
  $turquoise: #31a3ae;
11
+ $soft-turquoise: #98d0d6;
10
12
  $turquoise-link: #257886;
11
13
  $brown: #512b2b;
12
14
  $dark-brown: #493c3b;
13
15
  $medium-brown: #72605e;
16
+ $soft-brown: #a38b80;
14
17
  $white: #fff;
15
18
  $card-pink: #c5569a;
19
+ $soft-card-pink: #d698c8;
16
20
  $background-gray: #ebE7E2;
17
21
  $background-front-page: #fefcfa;
18
22
  $code-green: #9c6;
data/lib/gem_version.rb CHANGED
@@ -4,7 +4,7 @@ module Gem
4
4
  # Gem Specification
5
5
  class Specification
6
6
  def self.gem_version
7
- '1.9.12'
7
+ '1.10.3'
8
8
  end
9
9
  end
10
10
  end
@@ -100,9 +100,9 @@ module SwedbankPay
100
100
  return leaf_markup(page.path, main_title, page.level) unless page.headers?
101
101
 
102
102
  # If there's no children, only return the headers as leaf node items.
103
- return page.headers.map { |h| header_markup(page, h) }.join('') unless page.children?
103
+ return page.headers.map { |h| header_markup(page, h) }.join unless page.children?
104
104
 
105
- headers_markup = page.headers.map { |h| header_markup(page, h) }.join('')
105
+ headers_markup = page.headers.map { |h| header_markup(page, h) }.join
106
106
  headers_markup = "<ul class=\"nav-ul\">#{headers_markup}</ul>"
107
107
 
108
108
  item_markup(page, current_page, headers_markup, true)
data/lib/sidebar_page.rb CHANGED
@@ -30,6 +30,7 @@ module SwedbankPay
30
30
  @title = SidebarPageTitle.parse(jekyll_page, self)
31
31
  @order = menu_order(jekyll_page)
32
32
  @children = SidebarPageCollection.new(self)
33
+ @card_overview = jekyll_page['card_overview'].nil? ? false : jekyll_page['card_overview']
33
34
  end
34
35
 
35
36
  def active?(current, is_leaf: false)
@@ -113,6 +114,8 @@ module SwedbankPay
113
114
 
114
115
  @jekyll_page.data['lead_title'] = @title.lead
115
116
  @jekyll_page.data['main_title'] = @title.main
117
+ @jekyll_page.data['children'] = @children
118
+ @jekyll_page.data['absolute_path'] = @path
116
119
  end
117
120
 
118
121
  def save
@@ -144,6 +147,14 @@ module SwedbankPay
144
147
  @doc
145
148
  end
146
149
 
150
+ def to_liquid
151
+ @jekyll_page.to_liquid
152
+ end
153
+
154
+ def card_overview?
155
+ @card_overview
156
+ end
157
+
147
158
  private
148
159
 
149
160
  def menu_order(jekyll_page)
@@ -32,5 +32,9 @@ module SwedbankPay
32
32
 
33
33
  count
34
34
  end
35
+
36
+ def to_liquid
37
+ @pages
38
+ end
35
39
  end
36
40
  end
@@ -59,16 +59,19 @@ module SwedbankPay
59
59
  def find_headers(page)
60
60
  headers = []
61
61
 
62
+ # Don't include headers in the sidebar if we're on a card overview page.
63
+ return headers if page.card_overview?
64
+
62
65
  page.doc.xpath('//h2').each do |header|
63
- next unless header['id']
66
+ id = header['id']
67
+
68
+ next unless id
64
69
 
65
70
  child_markup = header.last_element_child
66
- header = {
67
- id: header['id'],
68
- title: header.content.strip,
69
- hash: (child_markup['href']).to_s
70
- }
71
- headers.push(header)
71
+ hash = child_markup['href'].to_s if child_markup.respond_to? :[]
72
+ title = header.content.strip
73
+
74
+ headers.push({ id: id, title: title, hash: hash })
72
75
  end
73
76
 
74
77
  headers
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swedbank-pay-design-guide-jekyll-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.12
4
+ version: 1.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swedbank Pay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-27 00:00:00.000000000 Z
11
+ date: 2021-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -203,7 +203,9 @@ files:
203
203
  - _includes/apple-touch-startup-images.md
204
204
  - _includes/card-horizontal-list.html
205
205
  - _includes/card-list.html
206
+ - _includes/card-overview.html
206
207
  - _includes/card.html
208
+ - _includes/doc-container.html
207
209
  - _includes/github.html
208
210
  - _includes/google_analytics.html
209
211
  - _includes/img/merchants/logo-coop.svg
@@ -287,14 +289,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
287
289
  requirements:
288
290
  - - ">="
289
291
  - !ruby/object:Gem::Version
290
- version: 2.4.0
292
+ version: 2.5.0
291
293
  required_rubygems_version: !ruby/object:Gem::Requirement
292
294
  requirements:
293
295
  - - ">="
294
296
  - !ruby/object:Gem::Version
295
297
  version: '0'
296
298
  requirements: []
297
- rubygems_version: 3.1.4
299
+ rubygems_version: 3.1.6
298
300
  signing_key:
299
301
  specification_version: 4
300
302
  summary: Swedbank Pay Design Guide theme for Jekyll