polaris_view_components 0.12.0 → 0.13.0

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: c6ac82b9541cc182ed79f45d4850e23a0afe6255e3b94d0071c2cc9716dc81e8
4
- data.tar.gz: 48de38d93d9d972eb4becc326242ea894ea56532f68e0527339ac0647ee662f1
3
+ metadata.gz: e5f1f03d372606e8a4de1d8d44619d0dc08aa856f5f7f93dca36d151288333aa
4
+ data.tar.gz: a141753f0afbea09db09c58b3adbe2972c777af2b80b9aae00fac8112ce81449
5
5
  SHA512:
6
- metadata.gz: 20b0f280d097398cf7793b35ddf77d8dfcdafea0039dd5114e1261fafa62d7bad528b1e3b83ac0015dce4af3619459f711b16bbeb85429f428d5766b1457b82d
7
- data.tar.gz: 5d187b4045398761dc1dfd1052965220ee80888a5ef17a3cef8eba19e6632ecf633497275f0833bd36c1e8ff0e0cb22d1fd11a8f0639ff0d2ba4a70a9881da88
6
+ metadata.gz: 6824f694d987658137901f355491af6b61147c91ad9dcb721a601c9325d8b11c2d7ca30f47163c610da8a72ed2ecb65f9141957e6de3b8f93e09a06c09baa6ca
7
+ data.tar.gz: f0a0b93167661ef28dda645a2cc743feaa953eff74826a025e99d7db941412ebfd73d2934e80a007892aab6a1fc93cbd650c40d902c8b13853564ea33322b7f0
data/README.md CHANGED
@@ -58,7 +58,7 @@ rake
58
58
  The library follows [semantic versioning](https://semver.org/). To draft a new release you need to run `script/release` with a new version number:
59
59
 
60
60
  ```bash
61
- script/release VERSION
61
+ bin/release VERSION
62
62
  ```
63
63
 
64
64
  Where the VERSION is the version number you want to release. This script will update the version in the gem and push it to GitHub and Rubygems automatically.
@@ -23,6 +23,7 @@ module Polaris
23
23
  def system_arguments
24
24
  @system_arguments.tap do |opts|
25
25
  opts[:disabled] = true if @disabled
26
+ opts[:checked] = true if @checked
26
27
  opts[:aria] ||= {}
27
28
  opts[:aria][:checked] = @checked
28
29
  if indeterminate?
@@ -30,6 +31,7 @@ module Polaris
30
31
  @system_arguments[:aria][:checked] = "mixed"
31
32
  end
32
33
  opts[:class] = opts.delete(:classes)
34
+ opts[:form] = @form if @form.present? && @attribute.blank?
33
35
  end
34
36
  end
35
37
 
@@ -14,7 +14,7 @@
14
14
  sorted: column.sorted,
15
15
  **column.system_arguments
16
16
  ) do %>
17
- <%= column.title %>
17
+ <%= column.title.html_safe %>
18
18
  <% end %>
19
19
  <% end %>
20
20
  </tr>
@@ -1,6 +1,6 @@
1
1
  <%= render Polaris::BaseComponent.new(**system_arguments) do %>
2
2
  <div class="Polaris-Navigation__ItemWrapper">
3
- <%= link_to @url, class: link_classes, tabindex: "0" do %>
3
+ <%= link_to @url, **link_arguments do %>
4
4
  <% if @icon.present? %>
5
5
  <div class="Polaris-Navigation__Icon">
6
6
  <%= polaris_icon(name: @icon) %>
@@ -11,6 +11,8 @@ class Polaris::Navigation::ItemComponent < Polaris::Component
11
11
  badge: nil,
12
12
  selected: false,
13
13
  disabled: false,
14
+ external: false,
15
+ link_arguments: {},
14
16
  **system_arguments
15
17
  )
16
18
  @url = url
@@ -19,7 +21,9 @@ class Polaris::Navigation::ItemComponent < Polaris::Component
19
21
  @badge = badge
20
22
  @selected = selected
21
23
  @disabled = disabled
24
+ @external = external
22
25
  @system_arguments = system_arguments
26
+ @link_arguments = link_arguments
23
27
  end
24
28
 
25
29
  def system_arguments
@@ -32,6 +36,17 @@ class Polaris::Navigation::ItemComponent < Polaris::Component
32
36
  end
33
37
  end
34
38
 
39
+ def link_arguments
40
+ @link_arguments.tap do |opts|
41
+ opts[:class] = class_names(
42
+ @link_arguments[:classes],
43
+ link_classes
44
+ )
45
+ opts[:tabindex] = "0"
46
+ opts[:target] = "_blank" if @external
47
+ end
48
+ end
49
+
35
50
  def link_classes
36
51
  class_names(
37
52
  "Polaris-Navigation__Item",
@@ -33,7 +33,7 @@ module Polaris
33
33
  def stack_distribution
34
34
  return @distribution if @distribution.present?
35
35
 
36
- primary_action.present? && secondary_actions.any? ? :equal_spacing : :trailing
36
+ (primary_action.present? && secondary_actions.any?) ? :equal_spacing : :trailing
37
37
  end
38
38
  end
39
39
  end
@@ -6,7 +6,8 @@ module Polaris
6
6
  COLOR_MAPPINGS = {
7
7
  COLOR_DEFAULT => "Polaris-ProgressBar--colorHighlight",
8
8
  :primary => "Polaris-ProgressBar--colorPrimary",
9
- :success => "Polaris-ProgressBar--colorSuccess"
9
+ :success => "Polaris-ProgressBar--colorSuccess",
10
+ :critical => "Polaris-ProgressBar--colorCritical"
10
11
  }
11
12
  COLOR_OPTIONS = COLOR_MAPPINGS.keys
12
13
 
@@ -1,5 +1,5 @@
1
1
  module Polaris
2
2
  module ViewComponents
3
- VERSION = "0.12.0"
3
+ VERSION = "0.13.0"
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: 0.12.0
4
+ version: 0.13.0
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: 2022-10-12 00:00:00.000000000 Z
12
+ date: 2023-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails