polaris_view_components 1.4.0 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3dc9a731d4c3dc7615b6148d0ac7980afce53a98c9c31dafcc6993e73716ee3c
4
- data.tar.gz: c5321641a35f94d11b8a1769e61f65c31156454d1a3d06f223780f9022f9015f
3
+ metadata.gz: 5c6aa31da0b0163512ef5d0a328ddb584d20b441d53f73dc56e4797d139f7669
4
+ data.tar.gz: 76fa870720a0aae542d83c5f963dea6d3006e81e246b6fa4acab1ebc4eff8ef8
5
5
  SHA512:
6
- metadata.gz: aa891ef13f9226354394f89da3896e2c6e42cb7d3b07b1b2076508303a523087ea48945011acf9cd84c7ccea565b2d6f5fb356185eb44dec4997189579a551a1
7
- data.tar.gz: 35ebfe95fd139e6979ee622a1c362f08896e462c33ecfdc9c5cef6d2159b4115dbd9d8b8f1792b83399a03ec179e8c654dd4b6270a3172b114a27d1c87170f0c
6
+ metadata.gz: 0eb65f8ac276abe206b9d29789bfcb0018f8a8dc50db9ae496d15524f02ddd1d63043b4c432aa09fc2b0ffbf22be09f45a4bcd4fa71195d5e0ff61754bab8b29
7
+ data.tar.gz: 7ee704e3e018b1e6a73a761b1266aa91de3b6aced9f5469a296154f6df24506fd337692123749ca8e91e1f9feedf1f5fafd5da31fc5abecfafbce7e4e6309f65
@@ -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, style: "padding-top: 1em; padding-bottom: 1em;") do |card| %>
2
- <% items.each do |item| %>
3
- <%= item %>
4
- <% end %>
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? && @title.length <= LONG_TITLE,
48
- "Polaris-Page-Header--longTitle": @title.present? && @title.length > LONG_TITLE,
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",
@@ -143,10 +143,6 @@ module Polaris
143
143
  polaris_text_field_target: "input"
144
144
  }
145
145
  }
146
- if @clear_errors_on_focus
147
- append_option(default_options[:data], :action, "focus->polaris-text-field#clearErrorMessages")
148
- end
149
-
150
146
  if @type == :number
151
147
  default_options.merge!({
152
148
  step: @step,
@@ -166,6 +162,9 @@ module Polaris
166
162
  "Polaris-TextField--monospaced": @monospaced,
167
163
  "Polaris-TextField__Input--suffixed": @suffix.present?
168
164
  )
165
+ if @clear_errors_on_focus
166
+ prepend_option(opts[:data], :action, "focus->polaris-text-field#clearErrorMessages")
167
+ end
169
168
  prepend_option(opts[:data], :action, "polaris-text-field#syncValue")
170
169
  end
171
170
  end
@@ -1,5 +1,5 @@
1
1
  module Polaris
2
2
  module ViewComponents
3
- VERSION = "1.4.0"
3
+ VERSION = "1.4.2"
4
4
  end
5
5
  end
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.0
4
+ version: 1.4.2
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: 2023-11-29 00:00:00.000000000 Z
12
+ date: 2024-01-09 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.18
980
+ rubygems_version: 3.4.22
980
981
  signing_key:
981
982
  specification_version: 4
982
983
  summary: ViewComponents for Polaris Design System