anchor_view_components 0.5.1 → 0.5.3

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: 382e8e978cc7065db7f4c5a20f078f809ed145e04de7e2ecc141c25053284b86
4
- data.tar.gz: 85dcfe3378cd3553b854fb2ae0fb826b50fa19fcf3c03a4042f1513d4016bcdc
3
+ metadata.gz: d3a181d9966610368ba74dc2781bf444cb041d1fa7ab38ad3a94094b837fea50
4
+ data.tar.gz: 144449de045c7eefd7c06bba12f5f33b3653205702835814282f858bc36adeee
5
5
  SHA512:
6
- metadata.gz: d82917ae84dcc9f5af77a4c3f33869c0af50d1314fef6fa8cd415af4b2d5ab439a6a8aa98540f93edaf721866f7094437e34e3c02c9f4be6e411c047fcc6d2d4
7
- data.tar.gz: c5372641f3417983cddd8b2bf47842cc6809a186179a73d0ea97cc0b89107b712d1aa569cfa19f6ab482f24001a9b572ae02d27dc7f5b46798676bd1263e3013
6
+ metadata.gz: 3771740e12d52815af489ad7d0bc77cd854f0822e69b2834c8dcdd66718ef27fbe1a9703eb77c87765481e6442d6f85bdf27ecd2e9feab37ff6c75c1ff4f221d
7
+ data.tar.gz: 06a7f89f5219816dc2bf76b206957ced377a68f0e562066c62dceede09f5cb3b3408534f8e030601aca036c5f7d93e1c331bf89b4bdb1b7609ee0d6c11f1c843
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.3 - 2023-08-09
4
+
5
+ ### Changed
6
+
7
+ - Change `ToastComponent` to allow passing the `role` attribute.
8
+
9
+ ## 0.5.2 - 2023-08-08
10
+
11
+ ### Changed
12
+
13
+ - Change `DialogComponent` to allow passing attributes to underlined trigger button.
14
+
3
15
  ## 0.5.1 - 2023-08-07
4
16
 
5
17
  ### Changed
@@ -1,7 +1,10 @@
1
1
  module Anchor
2
2
  class DialogComponent < Component
3
- renders_one :show_button, -> do
4
- ButtonComponent.new(data: { action: "dialog#showModal" })
3
+ renders_one :show_button, ->(**kwargs) do
4
+ ButtonComponent.new(
5
+ data: { action: "dialog#showModal" },
6
+ **kwargs
7
+ )
5
8
  end
6
9
  renders_one :body
7
10
  renders_one :footer
@@ -6,6 +6,7 @@
6
6
  data: { controller: "toast" },
7
7
  id: id,
8
8
  popover: "manual",
9
+ role:,
9
10
  ) do %>
10
11
  <% if icon? %>
11
12
  <%= icon %>
@@ -14,10 +14,11 @@ module Anchor
14
14
  }.freeze
15
15
  VARIANT_OPTIONS = VARIANT_MAPPINGS.keys
16
16
 
17
- def initialize(variant: VARIANT_DEFAULT)
17
+ def initialize(variant: VARIANT_DEFAULT, role: nil)
18
18
  @variant = VARIANT_MAPPINGS[
19
19
  fetch_or_fallback(VARIANT_OPTIONS, variant, VARIANT_DEFAULT)
20
20
  ]
21
+ @role = role
21
22
  @id = self.class.generate_id
22
23
 
23
24
  super
@@ -25,7 +26,7 @@ module Anchor
25
26
 
26
27
  private
27
28
 
28
- attr_reader :variant, :id
29
+ attr_reader :variant, :role, :id
29
30
 
30
31
  def render?
31
32
  content.present?
@@ -1,5 +1,5 @@
1
1
  module Anchor
2
2
  module ViewComponents
3
- VERSION = "0.5.1"
3
+ VERSION = "0.5.3"
4
4
  end
5
5
  end
@@ -12,9 +12,7 @@ module Anchor
12
12
  end
13
13
  end
14
14
 
15
- def with_footer
16
- render_with_template(template: "anchor_ui/dialog_preview/with_footer")
17
- end
15
+ def with_footer; end
18
16
 
19
17
  def with_link
20
18
  render Anchor::DialogComponent.new(title: 'Dialog Title') do |c|
@@ -41,8 +41,6 @@ module Anchor
41
41
  end
42
42
  end
43
43
 
44
- def with_banner
45
- render_with_template(template: "anchor_ui/banner_preview/with_banner")
46
- end
44
+ def with_banner; end
47
45
  end
48
46
  end
@@ -13,7 +13,7 @@ module Anchor
13
13
  end
14
14
 
15
15
  def variant_error
16
- render(Anchor::ToastComponent.new(variant: :error).with_content(
16
+ render(Anchor::ToastComponent.new(variant: :error, role: :alert).with_content(
17
17
  "Questionnaire deleted"
18
18
  ))
19
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anchor_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Buoy Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-07 00:00:00.000000000 Z
11
+ date: 2023-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inline_svg
@@ -136,18 +136,17 @@ files:
136
136
  - previews/anchor/action_menu_component_preview.rb
137
137
  - previews/anchor/badge_component_preview.rb
138
138
  - previews/anchor/banner_component_preview.rb
139
- - previews/anchor/banner_preview/with_banner.html.erb
140
139
  - previews/anchor/breadcrumbs_component_preview.rb
141
140
  - previews/anchor/button_component_preview.rb
142
141
  - previews/anchor/dialog_component_preview.rb
143
- - previews/anchor/dialog_preview/with_footer.html.erb
142
+ - previews/anchor/dialog_component_preview/with_footer.html.erb
144
143
  - previews/anchor/icon_component_preview.rb
145
144
  - previews/anchor/loading_indicator_component_preview.rb
146
145
  - previews/anchor/panel_component_preview.rb
146
+ - previews/anchor/panel_component_preview/with_banner.html.erb
147
147
  - previews/anchor/side_nav_component_preview.rb
148
148
  - previews/anchor/side_nav_component_preview/default.html.erb
149
149
  - previews/anchor/tab_bar_component_preview.rb
150
- - previews/anchor/table_preview/default.html.erb
151
150
  - previews/anchor/text_component_preview.rb
152
151
  - previews/anchor/toast_component_preview.rb
153
152
  homepage: https://github.com/BuoySoftware/anchor_view_components
@@ -1,35 +0,0 @@
1
- <%= render Anchor::TableComponent.new(data:) do |table| %>
2
- <% table.with_column(header: "Donor ID", data_key: :id) do %>
3
- <%#= row[:id] %>
4
- <%# foo %>
5
- <% end %>
6
-
7
- <%# table.with_column("Price", numeric: true) do |row| %>
8
- <%#= row[:price] %>
9
- <%# end %>
10
-
11
- <% table.with_column(header: "Donor Name") do %>
12
- :donor_name
13
- <% end %>
14
-
15
- <% table.with_column(header: "Donor Phone Number") do %>
16
- :donor_phone_number
17
- <% end %>
18
-
19
- <% table.with_column(header: "Actions") do %>
20
- <%= render Anchor::ActionMenuComponent.new do |menu| %>
21
- <% menu.with_show_button do |button| %>
22
- <% button.with_ending_icon(icon: "nav-arrow-down") %>
23
- Actions
24
- <% end %>
25
-
26
- <% menu.with_item do %>
27
- <%= link_to("Edit", "#") %>
28
- <% end %>
29
-
30
- <% menu.with_item do %>
31
- <%= link_to("Delete", "#") %>
32
- <% end %>
33
- <% end %>
34
- <% end %>
35
- <% end %>