polaris_view_components 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/polaris_view_components/navigation_list_component.pcss +14 -0
- data/app/assets/stylesheets/polaris_view_components.css +12 -0
- data/app/assets/stylesheets/polaris_view_components.pcss +1 -0
- data/app/components/polaris/navigation_list_component.html.erb +6 -4
- data/app/components/polaris/page_component.rb +9 -2
- data/lib/polaris/view_components/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '07659b2a6fedf1e3d426e3e8a33ecbafc0e178d26604015f5deb4746764c42cb'
|
4
|
+
data.tar.gz: 0b78c075f082486d601be0902ae6c3a92641afd5d0261001cd624955011eb31d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a531b52c1a89c77a993d67fdb4c55f176f71fbf91bd7d09705a9ee2e0fda2b0a34c078b05ee42b5c85ff023f2db1995e0646572791bb49911378756ba560f8bc
|
7
|
+
data.tar.gz: be96664525ff3f02851bc178990b53eb982fb30764888aff42e0e5323552297867291cdbca3dc6e40fdfc5cfa1384d13e679267836d80ce1a8759957b1dd54c5
|
@@ -0,0 +1,14 @@
|
|
1
|
+
.NavigationList {
|
2
|
+
padding-top: var(--p-space-3);
|
3
|
+
padding-bottom: var(--p-space-3);
|
4
|
+
|
5
|
+
ul {
|
6
|
+
margin: 0;
|
7
|
+
padding-inline-start: 0;
|
8
|
+
}
|
9
|
+
|
10
|
+
.Polaris-Navigation__Item {
|
11
|
+
padding-bottom: var(--p-space-1);
|
12
|
+
padding-top: var(--p-space-1);
|
13
|
+
}
|
14
|
+
}
|
@@ -3453,6 +3453,18 @@ html[class~="Polaris-Summer-Editions-2023"] .Polaris-VideoThumbnail__Indicator {
|
|
3453
3453
|
transform: rotate(45deg);
|
3454
3454
|
background-color: var(--p-color-bg);
|
3455
3455
|
}
|
3456
|
+
.NavigationList {
|
3457
|
+
padding-top: var(--p-space-3);
|
3458
|
+
padding-bottom: var(--p-space-3);
|
3459
|
+
}
|
3460
|
+
.NavigationList ul {
|
3461
|
+
margin: 0;
|
3462
|
+
padding-inline-start: 0;
|
3463
|
+
}
|
3464
|
+
.NavigationList .Polaris-Navigation__Item {
|
3465
|
+
padding-bottom: var(--p-space-1);
|
3466
|
+
padding-top: var(--p-space-1);
|
3467
|
+
}
|
3456
3468
|
.Polaris--hidden {
|
3457
3469
|
display: none !important;
|
3458
3470
|
}
|
@@ -2,4 +2,5 @@
|
|
2
2
|
@import "./polaris_view_components/shopify_navigation.pcss";
|
3
3
|
@import "./polaris_view_components/spacer_component.pcss";
|
4
4
|
@import "./polaris_view_components/tooltip_component.pcss";
|
5
|
+
@import "./polaris_view_components/navigation_list_component.pcss";
|
5
6
|
@import "./polaris_view_components/custom.pcss";
|
@@ -1,5 +1,7 @@
|
|
1
|
-
<%= polaris_card(sectioned: false,
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<%= polaris_card(sectioned: false, classes: "NavigationList") do |card| %>
|
2
|
+
<ul>
|
3
|
+
<% items.each do |item| %>
|
4
|
+
<%= item %>
|
5
|
+
<% end %>
|
6
|
+
</ul>
|
5
7
|
<% end %>
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
module Polaris
|
4
4
|
class PageComponent < Polaris::Component
|
5
|
+
include ActionView::Helpers::SanitizeHelper
|
6
|
+
|
5
7
|
LONG_TITLE = 34
|
6
8
|
|
7
9
|
renders_one :title_metadata
|
@@ -44,14 +46,19 @@ module Polaris
|
|
44
46
|
tag: "div",
|
45
47
|
classes: class_names(
|
46
48
|
"Polaris-Page-Header--mobileView",
|
47
|
-
"Polaris-Page-Header--mediumTitle": @title.present? &&
|
48
|
-
"Polaris-Page-Header--longTitle": @title.present? &&
|
49
|
+
"Polaris-Page-Header--mediumTitle": @title.present? && title_length <= LONG_TITLE,
|
50
|
+
"Polaris-Page-Header--longTitle": @title.present? && title_length > LONG_TITLE,
|
49
51
|
"Polaris-Page-Header--hasNavigation": @back_url.present?,
|
50
52
|
"Polaris-Page-Header--noBreadcrumbs": @back_url.blank?
|
51
53
|
)
|
52
54
|
}
|
53
55
|
end
|
54
56
|
|
57
|
+
def title_length
|
58
|
+
stripped_title = strip_tags(@title)&.strip
|
59
|
+
stripped_title.present? ? stripped_title.length : 0
|
60
|
+
end
|
61
|
+
|
55
62
|
def title_arguments
|
56
63
|
{
|
57
64
|
tag: "h1",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polaris_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Gamble
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-01-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -738,6 +738,7 @@ files:
|
|
738
738
|
- app/assets/stylesheets/polaris_view_components.css
|
739
739
|
- app/assets/stylesheets/polaris_view_components.pcss
|
740
740
|
- app/assets/stylesheets/polaris_view_components/custom.pcss
|
741
|
+
- app/assets/stylesheets/polaris_view_components/navigation_list_component.pcss
|
741
742
|
- app/assets/stylesheets/polaris_view_components/shopify_navigation.pcss
|
742
743
|
- app/assets/stylesheets/polaris_view_components/spacer_component.pcss
|
743
744
|
- app/assets/stylesheets/polaris_view_components/tooltip_component.pcss
|
@@ -976,7 +977,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
976
977
|
- !ruby/object:Gem::Version
|
977
978
|
version: '0'
|
978
979
|
requirements: []
|
979
|
-
rubygems_version: 3.4.
|
980
|
+
rubygems_version: 3.4.22
|
980
981
|
signing_key:
|
981
982
|
specification_version: 4
|
982
983
|
summary: ViewComponents for Polaris Design System
|