publishing_platform_publishing_components 0.2.0 → 0.3.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 +4 -4
- data/app/assets/stylesheets/publishing_platform_publishing_components/_all_components.scss +1 -0
- data/app/assets/stylesheets/publishing_platform_publishing_components/components/_layout.scss +3 -0
- data/app/views/publishing_platform_publishing_components/components/_layout.html.erb +40 -0
- data/app/views/publishing_platform_publishing_components/components/_navigation.html.erb +20 -0
- data/app/views/publishing_platform_publishing_components/components/_summary_list.html.erb +0 -2
- data/app/views/publishing_platform_publishing_components/components/docs/navigation.yml +21 -0
- data/lib/publishing_platform_publishing_components/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 880dc872b87762ba00037fcc59c2837f5cddc7a797659a266d4787766332bb50
|
|
4
|
+
data.tar.gz: c6290dcd1ded6493eaf8d12cdb4d00d98faacd96427617a43111bd41556a8e59
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c68380feededbb45e24b3671262a57d233181c097d4cd970583fb36ac6a3c3d76c248ffc1b6939aaae2541f2b38349a6f4af1481355245f26d5e92ccd46e9c2c
|
|
7
|
+
data.tar.gz: 44aef9f3d4b325fc07173b7c8bb7353c7341e6b0730adc9f04665a828306f271f27aa560f4f0208f4a818c6957466a18782f5a638e1d1dee2fe6a0a84aea93d0
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<%
|
|
2
|
+
|
|
3
|
+
title ||= "Publishing Platform"
|
|
4
|
+
navigation_items ||= []
|
|
5
|
+
|
|
6
|
+
-%>
|
|
7
|
+
|
|
8
|
+
<!DOCTYPE html>
|
|
9
|
+
<html>
|
|
10
|
+
<head>
|
|
11
|
+
<%= tag.title title %>
|
|
12
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
13
|
+
<%= csrf_meta_tags %>
|
|
14
|
+
<%= csp_meta_tag %>
|
|
15
|
+
|
|
16
|
+
<%= stylesheet_link_tag "application" %>
|
|
17
|
+
|
|
18
|
+
<%= yield :head %>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<div class="gem-c-layout container py-3">
|
|
22
|
+
<header class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between py-3 mb-4 border-bottom">
|
|
23
|
+
<div class="col-md-3 mb-2 mb-md-0">
|
|
24
|
+
<a href="/" class="d-flex align-items-center link-body-emphasis text-decoration-none">
|
|
25
|
+
<span class="fs-4">Publishing Platform</span>
|
|
26
|
+
</a>
|
|
27
|
+
</div>
|
|
28
|
+
<% if navigation_items.present? %>
|
|
29
|
+
<%= render "publishing_platform_publishing_components/components/navigation", { navigation_items: }%>
|
|
30
|
+
<% end %>
|
|
31
|
+
</header>
|
|
32
|
+
|
|
33
|
+
<main>
|
|
34
|
+
<%= yield %>
|
|
35
|
+
</main>
|
|
36
|
+
</div>
|
|
37
|
+
<%= javascript_include_tag "application" %>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
|
40
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<%
|
|
2
|
+
navigation_items ||= []
|
|
3
|
+
-%>
|
|
4
|
+
<% if navigation_items.present? %>
|
|
5
|
+
<ul class="gem-c-navigation nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
|
|
6
|
+
<% navigation_items.each_with_index do |item, index| %>
|
|
7
|
+
<%
|
|
8
|
+
link_classes = %w(py-2 link-body-emphasis text-decoration-none)
|
|
9
|
+
link_classes << "me-3" unless index == navigation_items.size() -1
|
|
10
|
+
%>
|
|
11
|
+
<li>
|
|
12
|
+
<%= link_to(
|
|
13
|
+
item[:text],
|
|
14
|
+
item[:href],
|
|
15
|
+
class: link_classes
|
|
16
|
+
) %>
|
|
17
|
+
</li>
|
|
18
|
+
<% end %>
|
|
19
|
+
</ul>
|
|
20
|
+
<% end %>
|
|
@@ -4,12 +4,10 @@
|
|
|
4
4
|
shared_helper = PublishingPlatformPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
|
5
5
|
|
|
6
6
|
title ||= nil
|
|
7
|
-
borderless ||= false
|
|
8
7
|
edit ||= {}
|
|
9
8
|
delete ||= {}
|
|
10
9
|
items ||= []
|
|
11
10
|
block ||= yield
|
|
12
|
-
wide_title ||= false
|
|
13
11
|
|
|
14
12
|
component_helper = PublishingPlatformPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
|
15
13
|
component_helper.add_class("gem-c-summary-list")
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Navigation
|
|
2
|
+
description: The navigation used by the layout component.
|
|
3
|
+
body: |
|
|
4
|
+
shared_accessibility_criteria:
|
|
5
|
+
- link
|
|
6
|
+
accessibility_criteria: |
|
|
7
|
+
The component must:
|
|
8
|
+
|
|
9
|
+
* have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
|
|
10
|
+
* follow the expected tabbing border
|
|
11
|
+
* allow menus to be closed when the escape key is pressed
|
|
12
|
+
examples:
|
|
13
|
+
default:
|
|
14
|
+
data:
|
|
15
|
+
navigation_items:
|
|
16
|
+
- text: Example link 1
|
|
17
|
+
href: "#"
|
|
18
|
+
- text: Example link 2
|
|
19
|
+
href: "#"
|
|
20
|
+
- text: Example link 3
|
|
21
|
+
href: "#"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: publishing_platform_publishing_components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Publishing Platform
|
|
@@ -177,6 +177,7 @@ files:
|
|
|
177
177
|
- app/assets/stylesheets/publishing_platform_publishing_components/_all_components.scss
|
|
178
178
|
- app/assets/stylesheets/publishing_platform_publishing_components/components/_attachment-link.scss
|
|
179
179
|
- app/assets/stylesheets/publishing_platform_publishing_components/components/_attachment.scss
|
|
180
|
+
- app/assets/stylesheets/publishing_platform_publishing_components/components/_layout.scss
|
|
180
181
|
- app/assets/stylesheets/publishing_platform_publishing_components/components/_summary-list.scss
|
|
181
182
|
- app/controllers/publishing_platform_publishing_components/application_controller.rb
|
|
182
183
|
- app/helpers/publishing_platform_publishing_components/application_helper.rb
|
|
@@ -188,6 +189,8 @@ files:
|
|
|
188
189
|
- app/views/publishing_platform_publishing_components/components/_attachment.html.erb
|
|
189
190
|
- app/views/publishing_platform_publishing_components/components/_attachment_link.html.erb
|
|
190
191
|
- app/views/publishing_platform_publishing_components/components/_error_summary.html.erb
|
|
192
|
+
- app/views/publishing_platform_publishing_components/components/_layout.html.erb
|
|
193
|
+
- app/views/publishing_platform_publishing_components/components/_navigation.html.erb
|
|
191
194
|
- app/views/publishing_platform_publishing_components/components/_summary_list.html.erb
|
|
192
195
|
- app/views/publishing_platform_publishing_components/components/attachment/_thumbnail_document.html.erb
|
|
193
196
|
- app/views/publishing_platform_publishing_components/components/attachment/_thumbnail_external.html.erb
|
|
@@ -198,6 +201,7 @@ files:
|
|
|
198
201
|
- app/views/publishing_platform_publishing_components/components/docs/attachment.yml
|
|
199
202
|
- app/views/publishing_platform_publishing_components/components/docs/attachment_link.yml
|
|
200
203
|
- app/views/publishing_platform_publishing_components/components/docs/error_summary.yml
|
|
204
|
+
- app/views/publishing_platform_publishing_components/components/docs/navigation.yml
|
|
201
205
|
- app/views/publishing_platform_publishing_components/components/docs/summary_list.yml
|
|
202
206
|
- config/initializers/assets.rb
|
|
203
207
|
- config/routes.rb
|