katalyst-kpop 2.0.0 → 2.0.1

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: bfe556211c8cb27976e75cf940c7ae065fc6fbfb31f8a9fb2c78ec6e3d36db4d
4
- data.tar.gz: 7014e09c2697ff7e0d0093f67068b1583a21c8bdb165222df6b990e63869eac0
3
+ metadata.gz: 66c9e1bfc0f87b08a5d2135d9e019a231436caa3e160c0aa650605a2476aa1cf
4
+ data.tar.gz: e14bf1caf937a8c55c5c6e88e2ff94bfa53296bb93023f7ff8de9c23f17068fb
5
5
  SHA512:
6
- metadata.gz: 7affe4e861d299c11391520a71adf5d7a9fa4e1af699d7bd9938b0c784784c531992fd68d7d8ea14c58a974b2f6a52ff6e021bcab5811874730e006b1d7d31e9
7
- data.tar.gz: d087f450b624e8dc6e4c2426672eb697e52f6e5fe3bbac402f2b71458d0c35ce8f956a60b6c6446f9a6bce4100fbb33865dd4af8550ce12fe0342540a59add1d
6
+ metadata.gz: 5ff8771ff501eceaf9d2bf6aff0cf6da279afbeb93605bc828aaaf4777505c1f624e0dabf84347a167f010288b9c8a79019e1a9d375e828d35da990820253985
7
+ data.tar.gz: ff52b8f6cd986c74cd6873b773bc186d23a3fcc98f501fb65f404bcee45f32b91fa0bb3a55306fbf6c9e63c7100f7de7887b8e9c7a280ddbe2ebe93200a9e02f
@@ -1,10 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KpopHelper
4
+ # Render a modal dialog. Intended for use inside a kpop turbo frame tag.
5
+ # See builder for options.
4
6
  def render_kpop(options = {}, &block)
5
7
  Kpop::Modal.new(self).render(options, &block)
6
8
  end
7
9
 
10
+ # Render a turbo stream action that will dismiss any open kpop modals.
11
+ def dismiss_kpop
12
+ turbo_stream.update("kpop", "")
13
+ end
14
+
15
+ # Render a turbo frame tag that can be targeted for rendering kpop modals.
8
16
  def kpop_frame_tag(&block)
9
17
  turbo_frame_tag "kpop",
10
18
  class: "kpop-container",
@@ -13,6 +21,8 @@ module KpopHelper
13
21
  end
14
22
  end
15
23
 
24
+ # Renders a link that will navigate the kpop turbo frame to the given URL.
25
+ # The URL should render a modal response inside a kpop frame tag.
16
26
  def kpop_link_to(name = nil, options = nil, html_options = nil, &block)
17
27
  default_html_options = {
18
28
  data: { turbo: true, turbo_frame: "kpop" },
@@ -25,6 +35,8 @@ module KpopHelper
25
35
  end
26
36
  end
27
37
 
38
+ # Renders a button that will navigate the kpop turbo frame to the given URL.
39
+ # The URL should render a modal response inside a kpop frame tag.
28
40
  def kpop_button_to(name = nil, options = nil, html_options = nil, &block)
29
41
  default_html_options = {
30
42
  form: { data: { turbo: true, turbo_frame: "kpop" } },
@@ -32,6 +44,7 @@ module KpopHelper
32
44
  button_to(name, options, default_html_options.deep_merge(html_options || {}), &block)
33
45
  end
34
46
 
47
+ # Renders a button that will close the current kpop modal, if any.
35
48
  def kpop_button_close(content = nil, **options, &block)
36
49
  content = block ? capture(yield) : content
37
50
  tag.button content, data: { action: "click->kpop#dismiss:prevent" }, **options
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Katalyst
4
4
  module Kpop
5
- VERSION = "2.0.0"
5
+ VERSION = "2.0.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-kpop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive