polaris_view_components 3.0.0 → 3.1.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 +12 -0
- data/app/assets/javascripts/polaris_view_components/modal_controller.js +4 -0
- data/app/assets/javascripts/polaris_view_components.js +4 -0
- data/app/components/polaris/action_list/section_component.html.erb +1 -1
- data/app/components/polaris/avatar_component.html.erb +1 -1
- data/app/components/polaris/character_count.rb +3 -3
- data/app/components/polaris/divider_component.rb +24 -1
- data/app/components/polaris/empty_state_component.html.erb +1 -1
- data/app/components/polaris/index_table_component.html.erb +4 -4
- data/lib/polaris/view_components/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ca5d44863ed4e92c96355b43938b83e3d6c35faf836f21ec8d30cfbe4bf955a3
|
|
4
|
+
data.tar.gz: 569be82094984c0afb8ebaa30950aef78f11e5365ebcdebeb3d1bde5da03311e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f9cac7d32e9bce452bdd695c371fe9a91cd6ce79be8579abdf01b6d73deecda3f347370931343ee932c79e7ab093eb5989006c6e02014f80a9e35b403d66a605
|
|
7
|
+
data.tar.gz: 4350c590a31131ec013cfe3982c397005d05e52bee58b996bb6cfa48553605765bcbd97dcd183c9b6dea8475f2bc6a8f49eee95d86053ee9e1717caf31875d4c
|
data/README.md
CHANGED
|
@@ -73,6 +73,18 @@ npm run release
|
|
|
73
73
|
|
|
74
74
|
After that make sure to commit changes in package.json.
|
|
75
75
|
|
|
76
|
+
## Deploy
|
|
77
|
+
|
|
78
|
+
Before deploying make sure to:
|
|
79
|
+
|
|
80
|
+
1. Copy `demo/config/master.key` from 1Password
|
|
81
|
+
2. Set `KAMAL_REGISTRY_PASSWORD` in `.env`
|
|
82
|
+
|
|
83
|
+
Then run:
|
|
84
|
+
```bash
|
|
85
|
+
kamal deploy
|
|
86
|
+
```
|
|
87
|
+
|
|
76
88
|
## License
|
|
77
89
|
|
|
78
90
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
@@ -17,10 +17,14 @@ export default class extends Controller {
|
|
|
17
17
|
const dropElement = `<div class="${this.backdropClass}" data-controller="polaris" data-target="#${this.element.id}" data-action="click->polaris#closeModal"></div>`
|
|
18
18
|
this.element.insertAdjacentHTML('afterend', dropElement)
|
|
19
19
|
this.backdrop = this.element.nextElementSibling
|
|
20
|
+
const event = new CustomEvent("polarisModalOpened");
|
|
21
|
+
window.dispatchEvent(event);
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
close() {
|
|
23
25
|
this.element.classList.add(this.hiddenClass)
|
|
24
26
|
this.backdrop.remove()
|
|
27
|
+
const event = new CustomEvent("polarisModalClosed");
|
|
28
|
+
window.dispatchEvent(event);
|
|
25
29
|
}
|
|
26
30
|
}
|
|
@@ -839,10 +839,14 @@ class Modal extends Controller {
|
|
|
839
839
|
const dropElement = `<div class="${this.backdropClass}" data-controller="polaris" data-target="#${this.element.id}" data-action="click->polaris#closeModal"></div>`;
|
|
840
840
|
this.element.insertAdjacentHTML("afterend", dropElement);
|
|
841
841
|
this.backdrop = this.element.nextElementSibling;
|
|
842
|
+
const event = new CustomEvent("polarisModalOpened");
|
|
843
|
+
window.dispatchEvent(event);
|
|
842
844
|
}
|
|
843
845
|
close() {
|
|
844
846
|
this.element.classList.add(this.hiddenClass);
|
|
845
847
|
this.backdrop.remove();
|
|
848
|
+
const event = new CustomEvent("polarisModalClosed");
|
|
849
|
+
window.dispatchEvent(event);
|
|
846
850
|
}
|
|
847
851
|
}
|
|
848
852
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%= render Polaris::BaseComponent.new(**system_arguments) do %>
|
|
2
2
|
<% if @source %>
|
|
3
|
-
<img src="<%= @source %>" class="Polaris-Avatar__Image" role="presentation" onerror="this.src=''"
|
|
3
|
+
<img src="<%= @source %>" class="Polaris-Avatar__Image" role="presentation" onerror="this.src=''" alt="">
|
|
4
4
|
<% else %>
|
|
5
5
|
<span class="Polaris-Avatar__Initials">
|
|
6
6
|
<% if @initials %>
|
|
@@ -22,9 +22,9 @@ module Polaris
|
|
|
22
22
|
def label_template
|
|
23
23
|
if max_length?
|
|
24
24
|
"{count} of #{@max_length} characters used"
|
|
25
|
+
else
|
|
26
|
+
"{count} characters"
|
|
25
27
|
end
|
|
26
|
-
|
|
27
|
-
"{count} characters"
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def text_template
|
|
@@ -40,7 +40,7 @@ module Polaris
|
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
def normalized_value
|
|
43
|
-
@text_field.value.to_s
|
|
43
|
+
@text_field.value.to_s
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def count
|
|
@@ -2,9 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
module Polaris
|
|
4
4
|
class DividerComponent < Polaris::Component
|
|
5
|
+
include ActiveModel::Validations
|
|
6
|
+
|
|
7
|
+
SUPPORTED_DIRECTIONS = %w[inline block].freeze
|
|
8
|
+
|
|
9
|
+
validates :direction, inclusion: {in: SUPPORTED_DIRECTIONS}
|
|
10
|
+
|
|
5
11
|
def initialize(
|
|
6
12
|
border_color: "border-subdued",
|
|
7
13
|
border_width: "1",
|
|
14
|
+
direction: "inline",
|
|
8
15
|
**system_arguments
|
|
9
16
|
)
|
|
10
17
|
@system_arguments = system_arguments.tap do |args|
|
|
@@ -15,7 +22,7 @@ module Polaris
|
|
|
15
22
|
)
|
|
16
23
|
args[:style] = styles_list(
|
|
17
24
|
args[:style],
|
|
18
|
-
|
|
25
|
+
**border_styles(direction, border_color, border_width)
|
|
19
26
|
)
|
|
20
27
|
end
|
|
21
28
|
end
|
|
@@ -31,5 +38,21 @@ module Polaris
|
|
|
31
38
|
return "transparent" if border_color == "transparent"
|
|
32
39
|
"var(--p-color-#{fetch_or_fallback(Tokens::Color::BORDER_ALIAS, border_color)})"
|
|
33
40
|
end
|
|
41
|
+
|
|
42
|
+
def border_styles(direction, border_color, border_width)
|
|
43
|
+
border_direction = fetch_or_fallback(SUPPORTED_DIRECTIONS, direction, "inline")
|
|
44
|
+
|
|
45
|
+
if border_direction == "block"
|
|
46
|
+
{
|
|
47
|
+
"border-inline-start": "var(--p-border-width-#{fetch_or_fallback(Tokens::Border::WIDTH_SCALE, border_width)}) solid #{border_color_value(border_color)}",
|
|
48
|
+
"inline-size": "auto",
|
|
49
|
+
"min-block-size": "100%"
|
|
50
|
+
}
|
|
51
|
+
else
|
|
52
|
+
{
|
|
53
|
+
"border-block-start": "var(--p-border-width-#{fetch_or_fallback(Tokens::Border::WIDTH_SCALE, border_width)}) solid #{border_color_value(border_color)}"
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
end
|
|
34
57
|
end
|
|
35
58
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
**@system_arguments
|
|
7
7
|
) do %>
|
|
8
8
|
<%= polaris_vertical_stack(inline_align: :center) do %>
|
|
9
|
-
<img src="<%= @image %>" role="presentation" class="<%= @image_contained_class %>">
|
|
9
|
+
<img src="<%= @image %>" role="presentation" class="<%= @image_contained_class %>" alt="">
|
|
10
10
|
|
|
11
11
|
<%= polaris_box(max_width: @full_width? "100%" : "400px") do %>
|
|
12
12
|
<%= polaris_vertical_stack(inline_align: :center) do %>
|
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: 3.
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dan Gamble
|
|
@@ -64,14 +64,14 @@ dependencies:
|
|
|
64
64
|
requirements:
|
|
65
65
|
- - "~>"
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
|
-
version:
|
|
67
|
+
version: 4.9.0
|
|
68
68
|
type: :development
|
|
69
69
|
prerelease: false
|
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
|
71
71
|
requirements:
|
|
72
72
|
- - "~>"
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
|
-
version:
|
|
74
|
+
version: 4.9.0
|
|
75
75
|
- !ruby/object:Gem::Dependency
|
|
76
76
|
name: minitest
|
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -120,14 +120,14 @@ dependencies:
|
|
|
120
120
|
requirements:
|
|
121
121
|
- - "~>"
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: 2.
|
|
123
|
+
version: '2.8'
|
|
124
124
|
type: :development
|
|
125
125
|
prerelease: false
|
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
|
127
127
|
requirements:
|
|
128
128
|
- - "~>"
|
|
129
129
|
- !ruby/object:Gem::Version
|
|
130
|
-
version: 2.
|
|
130
|
+
version: '2.8'
|
|
131
131
|
- !ruby/object:Gem::Dependency
|
|
132
132
|
name: dotenv
|
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -950,7 +950,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
950
950
|
- !ruby/object:Gem::Version
|
|
951
951
|
version: '0'
|
|
952
952
|
requirements: []
|
|
953
|
-
rubygems_version:
|
|
953
|
+
rubygems_version: 4.0.3
|
|
954
954
|
specification_version: 4
|
|
955
955
|
summary: ViewComponents for Polaris Design System
|
|
956
956
|
test_files: []
|