polaris_view_components 0.12.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/components/polaris/base_checkbox.rb +2 -0
- data/app/components/polaris/data_table_component.html.erb +1 -1
- data/app/components/polaris/navigation/item_component.html.erb +1 -1
- data/app/components/polaris/navigation/item_component.rb +15 -0
- data/app/components/polaris/page_actions_component.rb +1 -1
- data/app/components/polaris/progress_bar_component.rb +2 -1
- data/lib/polaris/view_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cfcb6498a30aca8f195a4545af6835ff1cdfaa3dbbbbb7ba97faf322e9375bd
|
4
|
+
data.tar.gz: eba9e9e064bb0252c5a9fe665d0b4974e319bf3923b9aeccc3bcb679ed354eb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19c595f6d66f5e688dc440ea365e9a762c505bb5934e4ca4efefc9a879c81d5f85e50f87369e591e6fa4ffcd4d5f669be442dec663d4f9f49b8f09885689df99
|
7
|
+
data.tar.gz: e3aac6d472d0eee03ae6a9dec0f9279b8d013616d4ed31bdc6568b250605c6f4e567493192803821af1bd10bcc74b07ffbffcef101d1b546dd7fa784d7bb629c
|
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
|
-
|
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
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= render Polaris::BaseComponent.new(**system_arguments) do %>
|
2
2
|
<div class="Polaris-Navigation__ItemWrapper">
|
3
|
-
<%= link_to @url,
|
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
|
|
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.
|
4
|
+
version: 0.13.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: 2023-04-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|