swedbank-pay-design-guide-jekyll-theme 1.16.0 → 1.17.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d8e950e6c0a65361656afb452a7830d9e3e4fcb656859802e68ae4ba94d95c3
4
- data.tar.gz: b0d60a81f3a8183a6159118bcb01cb19b6f591e4993da99dc1a1b66ed065c81d
3
+ metadata.gz: 216bd16da1e18a58dfe126c5db52cb37c7e244d12a9dd4b70580a3137fa992d1
4
+ data.tar.gz: 7cd79606950e7907a8414d50d245036a1b2f52ae37325bd6db146a3958825c70
5
5
  SHA512:
6
- metadata.gz: 58f79e9da80e44d92b46cf05b252f1949664110654488375b1065ea4d7c4e5c8e8e6a48a22574384018599d7a2243473d186ba39ca79af9bb6f38c1a9a9836a7
7
- data.tar.gz: 0260b42d62168844d5aa4b4e51ec0feefa83867671bc93ff123409110e0eb6f2549fe324b89b4ef29be60f89367bd182a5497e13b00d40d5aec87569a338c4a8
6
+ metadata.gz: efb0eab9682e771974c7cc04e4c8a85811939f88760e8b0773696567e752bb9daa069144df787423af5cec97e47db9687946a8941bb95557a3207404f53efbfc
7
+ data.tar.gz: 76bc0e7ca8006e0a4db4bb7c019a2804706f33cb7b7e73e232960a19b70a6f9d1fa13e7259df93c7611fdd6af4f89fdd7895e9ba7a97a060bb2e25abd500af58
@@ -60,17 +60,15 @@
60
60
  <div id="designguide">
61
61
  <div class="documentation">
62
62
  <div class="row">
63
- <div class="col-xxl-2 col-lg-3 pr-0">
64
- <div class="sidebar dg-sidebar">
65
- <nav class="sidebar-nav">
66
- <a href="/" class="sidebar-header">
67
- <img src="{{ design_guide_url }}/designguide/assets/swedbankpay-logo-v.svg"
63
+ <div id="dg-sidebar" class="sidebar dg-sidebar has-secondary-nav">
64
+ <nav class="sidebar-main-nav">
65
+ <div class="sidebar-logo">
66
+ <a href="/" class="sidebar-header">
67
+ <img src="{{ design_guide_url }}/designguide/assets/swedbankpay-logo-v.svg"
68
68
  alt="Swedbank Pay vertical logo" class="logotype-vertical logotype-lg"/>
69
- <div class="sidebar-header-text">
70
- <span>{</span>developer portal<span>}</span>
71
- </div>
72
- </a>
73
- {% if site.search.enabled == true %}
69
+ </a>
70
+ </div>
71
+ <!-- {% if site.search.enabled == true %}
74
72
  <form class="search-container mx-2 my-4 px-3 py-2 d-flex"
75
73
  method="get" action="{{ site.search.url | relative_url }}">
76
74
  <input name="q" type="text" id="tipue_search_input"
@@ -84,14 +82,12 @@
84
82
  <i class="material-icons m-0" aria-hidden="true">search</i>
85
83
  </button>
86
84
  </form>
87
- {% endif %}
85
+ {% endif %} -->
88
86
  <ul id="dx-sidebar-main-nav-ul" class="main-nav-ul">
89
87
  </ul>
90
88
  </nav>
91
89
  </div>
92
- </div>
93
-
94
- <main class="doc-view col-xxl-10 col-lg-9">
90
+ <main class="doc-view">
95
91
  {% if page.layout != 'front-page' %}
96
92
  {% include title-header.html %}
97
93
  {% endif %}
data/_sass/sidebar.scss CHANGED
@@ -1,104 +1,30 @@
1
- @import 'colors.scss';
2
-
3
- .sidebar {
4
- .sidebar-nav {
5
- .sidebar-header {
6
- display: flex;
7
- flex-direction: column;
8
- align-items: center;
9
- margin-top: 2rem;
10
- text-decoration: none;
11
- color: #512b2b;
12
-
13
- img {
14
- margin-top: 1.5rem;
15
- margin-bottom: 1.25rem;
16
- }
17
-
18
- span {
19
- color: #fdc129;
20
- }
21
-
22
- .sidebar-header-text {
23
- margin-top: -0.5rem;
24
- font-size: 1.125rem;
25
- line-height: 1.5rem;
26
- color: $black;
27
- font-family: "Akkurat Mono", monospace;
28
- white-space: nowrap;
29
- }
1
+ #dg-sidebar {
2
+ &.sidebar {
3
+ .nav-ul {
4
+ list-style: none;
5
+ overflow: hidden;
6
+ padding: 0;
7
+ top: auto;
8
+ position: relative;
9
+ transition: none;
30
10
  }
11
+ }
31
12
 
32
- .search-container {
33
- box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.15);
34
- border-radius: 0.125rem;
35
-
36
- &:focus-within {
37
- outline: -webkit-focus-ring-color auto 0.5px;
38
- }
39
-
40
- .search-input {
41
- color: $medium-brown;
42
- font-size: 0.875rem;
43
- border: none;
44
- padding: 0.375rem;
45
-
46
- &:focus {
47
- color: $brown;
48
- outline: none
49
- }
50
- }
51
-
52
- i {
53
- display: block;
54
- color: $brown;
55
-
56
- &:hover {
57
- color: $turquoise-link;
13
+ .main-nav-ul {
14
+ a {
15
+ &.disabled {
16
+ ~nav {
17
+ display: none;
58
18
  }
59
19
  }
60
-
61
- button {
62
- background-color: $white;
63
- border: none;
64
- cursor: pointer;
65
- }
66
-
67
20
  }
68
21
 
69
- .main-nav-ul {
70
- .nav-group {
71
- .nav-ul {
72
- .nav-subgroup {
73
- &.active {
74
- >.nav-subgroup-heading {
75
- a {
76
- color: #257886;
77
- font-weight: 700;
78
- }
79
- }
80
- }
81
-
82
- .nav-subgroup-heading {
83
- padding: 0;
84
-
85
- i {
86
- padding: 0.5rem 0;
87
- }
88
-
89
- a {
90
- color: #512b2b;
91
- padding: .5rem;
92
- font-size: 1rem;
93
- line-height: 1.5rem;
94
- text-decoration: none;
95
- width: 100%;
96
-
97
- &:hover,
98
- &:focus {
99
- color: #257886;
100
- }
101
- }
22
+ .leaf {
23
+ &.active {
24
+ > a {
25
+ &:hover {
26
+ &:after {
27
+ content: none;
102
28
  }
103
29
  }
104
30
  }
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.16.0'
7
+ '1.17.0'
8
8
  end
9
9
  end
10
10
  end
@@ -47,26 +47,36 @@ module SwedbankPay
47
47
  level = is_leaf ? -1 : page.level
48
48
  title_markup = title_markup(page, level, is_leaf)
49
49
  item_class = item_class(page, current_page, level, is_leaf)
50
- group_heading_class = group_heading_class(level)
51
-
50
+ level.zero? &&
51
+ page.doc.xpath('//*[@id="dg-sidebar"]').first.set_attribute('class', 'sidebar dg-sidebar')
52
52
  "<li class=\"#{item_class}\">
53
- <div class=\"#{group_heading_class}\">
54
- <i class=\"material-icons\">arrow_right</i>
55
53
  #{title_markup}
56
- </div>
57
- #{sub_items_markup}
58
- </li>"
54
+ #{item_class === 'main-nav-li' || item_class === 'main-nav-li active' ? "<nav class=\"sidebar-secondary-nav\">
55
+ <header class=\"secondary-nav-header\">#{page.title.section || page.title}</header>
56
+ #{sub_items_markup}
57
+ </nav>" : sub_items_markup}
58
+ </li>"
59
59
  end
60
60
 
61
61
  def item_class(page, current_page, level, is_leaf)
62
62
  active = page.active?(current_page, is_leaf: is_leaf)
63
63
  item_class = group_class(level)
64
+ if item_class != 'main-nav-li'
65
+ item_class += page.children.empty? ? ' group' : ' leaf'
66
+ end
67
+
64
68
  item_class += ' active' if active
65
69
  item_class
66
70
  end
67
71
 
68
72
  def group_class(level)
69
- level.zero? ? 'nav-group' : 'nav-subgroup'
73
+ if level.zero?
74
+ 'main-nav-li'
75
+ elsif level == 1
76
+ 'secondary-nav-li'
77
+ else
78
+ ''
79
+ end
70
80
  end
71
81
 
72
82
  def group_heading_class(level)
@@ -76,29 +86,37 @@ module SwedbankPay
76
86
 
77
87
  def title_markup(page, level, is_leaf)
78
88
  lead_title = lead_title(page)
79
- return "<span>#{lead_title}</span>" if level.zero?
89
+ return "<a>
90
+ <i class=\"material-icons-outlined\" aria-hidden=\"true\">#{page.icon}</i>
91
+ #{lead_title}
92
+ </a>" if level.zero? && lead_title != 'Home'
80
93
 
81
94
  main_title = main_title(page, is_leaf)
82
-
83
- "<a href=\"#{page.path}\">#{main_title}</a>"
95
+ home = main_title == 'Home' ? 'disabled' : ''
96
+ "<a class=\"#{home}\" href=\"#{page.path}\"><i class=\"material-icons-outlined\" aria-hidden=\"true\">#{page.icon}</i>#{main_title}</a>"
84
97
  end
85
98
 
86
99
  def sub_items_markup(page, current_page)
87
100
  headers_markup = headers_markup(page, current_page)
88
101
  child_markup = build_markup(page.children, current_page)
89
-
90
102
  return '' if headers_markup.empty? && child_markup.empty?
91
103
 
92
- "<ul class=\"nav-ul\">
93
- #{headers_markup}
94
- #{child_markup}
104
+ "<ul class=\"#{page.level.zero? ? 'secondary-nav-ul' : ''}\">
105
+ #{if page.level.positive? && page.children?
106
+ "<a href=\"#\" class=\"previous-nav\">
107
+ <i class=\"material-icons\" aria-hidden=\"true\">arrow_back_ios</i>
108
+ <span>Back to #{page.parent.title}</span>
109
+ </a>
110
+ <header>#{page.title.section || page.title}</header>"
111
+ end}
112
+ #{headers_markup}
113
+ #{child_markup}
95
114
  </ul>"
96
115
  end
97
116
 
98
117
  def headers_markup(page, current_page)
99
118
  # If there's no page headers, only return a leaf item for the page itself.
100
- main_title = page.title.nil? ? nil : page.title.main
101
- return leaf_markup(page.path, main_title, page.level) unless page.headers?
119
+ return '' unless page.headers?
102
120
 
103
121
  # If there's no children, only return the headers as leaf node items.
104
122
  return page.headers.map { |h| header_markup(page, h) }.join unless page.children?
@@ -117,7 +135,7 @@ module SwedbankPay
117
135
  end
118
136
 
119
137
  def leaf_markup(href, title, level = 0)
120
- leaf_class = level.positive? ? 'nav-leaf nav-subgroup-leaf' : 'nav-leaf'
138
+ leaf_class = level.positive? ? 'leaf' : 'nav-leaf'
121
139
  "<li class=\"#{leaf_class}\"><a href=\"#{href}\">#{title}</a></li>"
122
140
  end
123
141
 
data/lib/sidebar_page.rb CHANGED
@@ -13,7 +13,7 @@ module SwedbankPay
13
13
  class SidebarPage
14
14
  FIXNUM_MAX = ((2**((0.size * 8) - 2)) - 1)
15
15
 
16
- attr_reader :path, :title, :level, :order, :children, :name, :filename, :doc
16
+ attr_reader :path, :title, :level, :order, :children, :name, :filename, :doc, :section, :icon
17
17
  attr_accessor :headers, :sidebar_container, :number, :parent
18
18
 
19
19
  def initialize(jekyll_page)
@@ -26,10 +26,11 @@ module SwedbankPay
26
26
  @path = sidebar_path.to_s
27
27
  @parent = sidebar_path.parent
28
28
  @level = sidebar_path.level
29
- @name = sidebar_path.name
30
29
  @hide_from_sidebar = jekyll_page['hide_from_sidebar'].nil? ? false : jekyll_page['hide_from_sidebar']
31
30
  @title = SidebarPageTitle.parse(jekyll_page, self)
32
31
  @order = menu_order(jekyll_page)
32
+ @section = jekyll_page['section']
33
+ @icon = jekyll_page['sidebar_icon']
33
34
  @children = SidebarPageCollection.new(self)
34
35
  @card_overview = jekyll_page['card_overview'].nil? ? false : jekyll_page['card_overview']
35
36
  @anchor_headings = jekyll_page['anchor_headings'].nil? ? true : jekyll_page['anchor_headings']
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.16.0
4
+ version: 1.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swedbank Pay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-16 00:00:00.000000000 Z
11
+ date: 2022-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday