polaris_view_components 0.12.0 → 0.13.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 +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: e5f1f03d372606e8a4de1d8d44619d0dc08aa856f5f7f93dca36d151288333aa
|
|
4
|
+
data.tar.gz: a141753f0afbea09db09c58b3adbe2972c777af2b80b9aae00fac8112ce81449
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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.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:
|
|
12
|
+
date: 2023-03-23 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|