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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 121be41623e1a6fcce5729c8ab46a2de53cd72df59cf9db2b5e1c10f45392145
4
- data.tar.gz: 524450f95947aae19261304a6301ce9a58ecd11279eb68447e14c1486a96ec40
3
+ metadata.gz: 880dc872b87762ba00037fcc59c2837f5cddc7a797659a266d4787766332bb50
4
+ data.tar.gz: c6290dcd1ded6493eaf8d12cdb4d00d98faacd96427617a43111bd41556a8e59
5
5
  SHA512:
6
- metadata.gz: d7509f2fc53b6fd6ce9c265418027256614ba9ed5b014b660cb51f79c3e21967c4defa2be3189fc4621902211f7e6b8f4a084620fa63d45e5b55a217ba2f221b
7
- data.tar.gz: 264583c82dece2d71a0018148848ca1d31661845e2a96d0de8796f18474f95e0f1f015fe8fe6bd6f97b3f6454e4748619f38fe1ac650f72f62ccc23ab141b7bc
6
+ metadata.gz: c68380feededbb45e24b3671262a57d233181c097d4cd970583fb36ac6a3c3d76c248ffc1b6939aaae2541f2b38349a6f4af1481355245f26d5e92ccd46e9c2c
7
+ data.tar.gz: 44aef9f3d4b325fc07173b7c8bb7353c7341e6b0730adc9f04665a828306f271f27aa560f4f0208f4a818c6957466a18782f5a638e1d1dee2fe6a0a84aea93d0
@@ -1,4 +1,5 @@
1
1
  @import "bootstrap";
2
2
  @import "components/attachment";
3
3
  @import "components/attachment-link";
4
+ @import "components/layout";
4
5
  @import "components/summary-list";
@@ -0,0 +1,3 @@
1
+ .gem-c-layout {
2
+ max-width: 960px !important;
3
+ }
@@ -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: "#"
@@ -1,3 +1,3 @@
1
1
  module PublishingPlatformPublishingComponents
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
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.2.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