protos 0.2.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -5
  3. data/CHANGELOG.md +11 -0
  4. data/README.md +82 -67
  5. data/benchmarks/.keep +0 -0
  6. data/benchmarks/table.txt +12 -0
  7. data/examples/list.rb +3 -1
  8. data/examples/navbar.rb +1 -1
  9. data/lib/protos/accordion/item.rb +7 -8
  10. data/lib/protos/accordion.rb +6 -10
  11. data/lib/protos/alert/actions.rb +2 -2
  12. data/lib/protos/alert/icon.rb +2 -2
  13. data/lib/protos/alert.rb +4 -8
  14. data/lib/protos/attributes.rb +7 -8
  15. data/lib/protos/avatar.rb +1 -1
  16. data/lib/protos/breadcrumbs/crumb.rb +2 -2
  17. data/lib/protos/breadcrumbs.rb +2 -4
  18. data/lib/protos/card/actions.rb +2 -2
  19. data/lib/protos/card/body.rb +2 -2
  20. data/lib/protos/card/image.rb +2 -2
  21. data/lib/protos/card/title.rb +2 -2
  22. data/lib/protos/card.rb +6 -14
  23. data/lib/protos/carousel/actions.rb +2 -2
  24. data/lib/protos/carousel/item.rb +2 -2
  25. data/lib/protos/carousel.rb +4 -8
  26. data/lib/protos/chat_bubble/content.rb +2 -2
  27. data/lib/protos/chat_bubble/footer.rb +2 -2
  28. data/lib/protos/chat_bubble/header.rb +2 -2
  29. data/lib/protos/chat_bubble/image.rb +2 -2
  30. data/lib/protos/chat_bubble.rb +6 -14
  31. data/lib/protos/collapse/content.rb +2 -2
  32. data/lib/protos/collapse/title.rb +3 -3
  33. data/lib/protos/collapse.rb +4 -8
  34. data/lib/protos/combobox.rb +8 -24
  35. data/lib/protos/command/dialog.rb +1 -1
  36. data/lib/protos/command/empty.rb +2 -2
  37. data/lib/protos/command/group.rb +1 -1
  38. data/lib/protos/command/input.rb +3 -2
  39. data/lib/protos/command/item.rb +2 -2
  40. data/lib/protos/command/list.rb +2 -2
  41. data/lib/protos/command/title.rb +2 -2
  42. data/lib/protos/command/trigger.rb +2 -2
  43. data/lib/protos/command.rb +10 -26
  44. data/lib/protos/component.rb +21 -30
  45. data/lib/protos/drawer/content.rb +2 -2
  46. data/lib/protos/drawer/side.rb +1 -1
  47. data/lib/protos/drawer/trigger.rb +2 -2
  48. data/lib/protos/drawer.rb +5 -11
  49. data/lib/protos/dropdown/item.rb +2 -2
  50. data/lib/protos/dropdown/menu.rb +1 -1
  51. data/lib/protos/dropdown.rb +3 -9
  52. data/lib/protos/hero/content.rb +2 -2
  53. data/lib/protos/hero/overlay.rb +2 -2
  54. data/lib/protos/hero.rb +4 -8
  55. data/lib/protos/list/item.rb +2 -2
  56. data/lib/protos/list.rb +3 -5
  57. data/lib/protos/modal/close_button.rb +1 -1
  58. data/lib/protos/modal/dialog.rb +1 -1
  59. data/lib/protos/modal/trigger.rb +2 -2
  60. data/lib/protos/modal.rb +5 -11
  61. data/lib/protos/popover/content.rb +3 -1
  62. data/lib/protos/popover/trigger.rb +2 -2
  63. data/lib/protos/popover.rb +4 -8
  64. data/lib/protos/stats/actions.rb +2 -2
  65. data/lib/protos/stats/description.rb +2 -2
  66. data/lib/protos/stats/figure.rb +2 -2
  67. data/lib/protos/stats/stat.rb +2 -2
  68. data/lib/protos/stats/title.rb +2 -2
  69. data/lib/protos/stats/value.rb +2 -2
  70. data/lib/protos/stats.rb +8 -20
  71. data/lib/protos/swap/off.rb +2 -2
  72. data/lib/protos/swap/on.rb +2 -2
  73. data/lib/protos/swap.rb +5 -10
  74. data/lib/protos/table/body.rb +2 -2
  75. data/lib/protos/table/caption.rb +3 -3
  76. data/lib/protos/table/cell.rb +2 -2
  77. data/lib/protos/table/footer.rb +2 -2
  78. data/lib/protos/table/head.rb +2 -2
  79. data/lib/protos/table/header.rb +2 -2
  80. data/lib/protos/table/row.rb +2 -2
  81. data/lib/protos/table.rb +8 -22
  82. data/lib/protos/tabs/tab.rb +5 -4
  83. data/lib/protos/tabs.rb +3 -5
  84. data/lib/protos/theme.rb +34 -45
  85. data/lib/protos/timeline/center.rb +2 -2
  86. data/lib/protos/timeline/item.rb +2 -2
  87. data/lib/protos/timeline/left.rb +2 -2
  88. data/lib/protos/timeline/right.rb +2 -2
  89. data/lib/protos/timeline.rb +6 -14
  90. data/lib/protos/toast/close_button.rb +2 -1
  91. data/lib/protos/toast.rb +3 -5
  92. data/lib/protos/token_list.rb +18 -31
  93. data/lib/protos/typography/heading.rb +2 -2
  94. data/lib/protos/typography/inline_link.rb +3 -3
  95. data/lib/protos/typography/paragraph.rb +2 -2
  96. data/lib/protos/typography.rb +12 -12
  97. data/lib/protos/version.rb +1 -1
  98. data/protos.gemspec +15 -3
  99. metadata +8 -6
@@ -6,8 +6,8 @@ module Protos
6
6
  # DOCS: An image within a chat bubble. This would typically be an avatar
7
7
  # component.
8
8
 
9
- def template(&block)
10
- div(**attrs, &block)
9
+ def view_template(&)
10
+ div(**attrs, &)
11
11
  end
12
12
 
13
13
  private
@@ -15,25 +15,17 @@ module Protos
15
15
  :end
16
16
  )
17
17
 
18
- def template(&block)
19
- div(**attrs, &block)
18
+ def view_template(&)
19
+ div(**attrs, &)
20
20
  end
21
21
 
22
- def content(...)
23
- Content.new(...)
24
- end
22
+ def content(...) = render Content.new(...)
25
23
 
26
- def footer(...)
27
- Footer.new(...)
28
- end
24
+ def footer(...) = render Footer.new(...)
29
25
 
30
- def header(...)
31
- Header.new(...)
32
- end
26
+ def header(...) = render Header.new(...)
33
27
 
34
- def image(...)
35
- Image.new(...)
36
- end
28
+ def image(...) = render Image.new(...)
37
29
 
38
30
  private
39
31
 
@@ -6,8 +6,8 @@ module Protos
6
6
  # DOCS: The content of a collapse. This would be hidden until the collapse
7
7
  # is opened.
8
8
 
9
- def template(&block)
10
- div(**attrs, &block)
9
+ def view_template(&)
10
+ div(**attrs, &)
11
11
  end
12
12
 
13
13
  private
@@ -10,11 +10,11 @@ module Protos
10
10
  reader: false,
11
11
  default: -> { "" }
12
12
 
13
- def template(&block)
13
+ def view_template(&)
14
14
  if @id.size.positive?
15
- label(for: @id, **attrs, &block)
15
+ label(for: @id, **attrs, &)
16
16
  else
17
- div(**attrs, &block)
17
+ div(**attrs, &)
18
18
  end
19
19
  end
20
20
 
@@ -11,20 +11,16 @@ module Protos
11
11
  default: -> { "collapse-#{SecureRandom.hex(4)}" },
12
12
  type: Types::String
13
13
 
14
- def template
14
+ def view_template
15
15
  div(**attrs) do
16
- input(type: "checkbox", id:) if @checkbox
16
+ input(type: "checkbox", id:, autocomplete: :off) if @checkbox
17
17
  yield if block_given?
18
18
  end
19
19
  end
20
20
 
21
- def title(*args, **kwargs, &block)
22
- Title.new(*args, id:, **kwargs, &block)
23
- end
21
+ def title(*, **, &) = render Title.new(*, id:, **, &)
24
22
 
25
- def content(...)
26
- Content.new(...)
27
- end
23
+ def content(...) = render Content.new(...)
28
24
 
29
25
  private
30
26
 
@@ -11,37 +11,21 @@ module Protos
11
11
  reader: false,
12
12
  type: TriggerTypes | Types::Array.of(TriggerTypes)
13
13
 
14
- def trigger(...)
15
- Popover::Trigger.new(...)
16
- end
14
+ def trigger(...) = render Popover::Trigger.new(...)
17
15
 
18
- def content(...)
19
- Popover::Content.new(...)
20
- end
16
+ def content(...) = render Popover::Content.new(...)
21
17
 
22
- def input(...)
23
- Command::Input.new(...)
24
- end
18
+ def input(...) = render Command::Input.new(...)
25
19
 
26
- def group(...)
27
- Command::Group.new(...)
28
- end
20
+ def group(...) = render Command::Group.new(...)
29
21
 
30
- def item(...)
31
- Command::Item.new(...)
32
- end
22
+ def item(...) = render Command::Item.new(...)
33
23
 
34
- def list(...)
35
- Command::List.new(...)
36
- end
24
+ def list(...) = render Command::List.new(...)
37
25
 
38
- def title(...)
39
- Command::Title.new(...)
40
- end
26
+ def title(...) = render Command::Title.new(...)
41
27
 
42
- def empty(...)
43
- Command::Empty.new(...)
44
- end
28
+ def empty(...) = render Command::Empty.new(...)
45
29
 
46
30
  private
47
31
 
@@ -6,7 +6,7 @@ module Protos
6
6
  # DOCS: The dialog for a command wraps the command content and provides a
7
7
  # modal backdrop for the command when it is opened.
8
8
 
9
- def template(&block)
9
+ def view_template(&block)
10
10
  dialog(**attrs) do
11
11
  div(class: css[:modal], &block)
12
12
  form(method: :dialog, class: css[:form]) do
@@ -6,8 +6,8 @@ module Protos
6
6
  # DOCS: The empty component is displayed in the list when there are no
7
7
  # matches in an input.
8
8
 
9
- def template(&block)
10
- li(**attrs, &block)
9
+ def view_template(&)
10
+ li(**attrs, &)
11
11
  end
12
12
 
13
13
  private
@@ -7,7 +7,7 @@ module Protos
7
7
  # Items in the group will have a divider line on the left side and can
8
8
  # optionally have a title.
9
9
 
10
- def template(&block)
10
+ def view_template(&block)
11
11
  li(**attrs) do
12
12
  ul(class: css[:list], &block)
13
13
  end
@@ -11,7 +11,7 @@ module Protos
11
11
  },
12
12
  reader: :private
13
13
 
14
- def template(&block)
14
+ def view_template(&block)
15
15
  div(**attrs) do
16
16
  label(class: css[:label]) do
17
17
  div(class: css[:icon], &block) if block
@@ -19,7 +19,8 @@ module Protos
19
19
  type: :text,
20
20
  data: { action: "protos--command#filter" },
21
21
  class: css[:input],
22
- placeholder:
22
+ placeholder:,
23
+ autocomplete: :off
23
24
  )
24
25
  end
25
26
  end
@@ -5,8 +5,8 @@ module Protos
5
5
  class Item < Component
6
6
  # DOCS: A single option within a command
7
7
 
8
- def template(&block)
9
- li(**attrs, &block)
8
+ def view_template(&)
9
+ li(**attrs, &)
10
10
  end
11
11
 
12
12
  private
@@ -5,8 +5,8 @@ module Protos
5
5
  class List < Component
6
6
  # DOCS: A list of commands. This can contain either items or groups.
7
7
 
8
- def template(&block)
9
- ul(**attrs, &block)
8
+ def view_template(&)
9
+ ul(**attrs, &)
10
10
  end
11
11
 
12
12
  private
@@ -6,8 +6,8 @@ module Protos
6
6
  # DOCS: The title for a group of commands. This is expected to be used
7
7
  # inside a Protos::Command::Group component.
8
8
 
9
- def template(&block)
10
- h2(**attrs, &block)
9
+ def view_template(&)
10
+ h2(**attrs, &)
11
11
  end
12
12
 
13
13
  private
@@ -5,8 +5,8 @@ module Protos
5
5
  class Trigger < Component
6
6
  # DOCS: A trigger is a button that opens a command palette modal
7
7
 
8
- def template(&block)
9
- button(**attrs, &block)
8
+ def view_template(&)
9
+ button(**attrs, &)
10
10
  end
11
11
 
12
12
  private
@@ -6,41 +6,25 @@ module Protos
6
6
  # filterable list of commands. Command modals are by default closable by
7
7
  # clicking the overlay rather than a specific close button.
8
8
 
9
- def template(&block)
10
- div(**attrs, &block)
9
+ def view_template(&)
10
+ div(**attrs, &)
11
11
  end
12
12
 
13
- def input(...)
14
- Input.new(...)
15
- end
13
+ def input(...) = render Input.new(...)
16
14
 
17
- def list(...)
18
- List.new(...)
19
- end
15
+ def list(...) = render List.new(...)
20
16
 
21
- def trigger(...)
22
- Trigger.new(...)
23
- end
17
+ def trigger(...) = render Trigger.new(...)
24
18
 
25
- def dialog(...)
26
- Dialog.new(...)
27
- end
19
+ def dialog(...) = render Dialog.new(...)
28
20
 
29
- def title(...)
30
- Title.new(...)
31
- end
21
+ def title(...) = render Title.new(...)
32
22
 
33
- def group(...)
34
- Group.new(...)
35
- end
23
+ def group(...) = render Group.new(...)
36
24
 
37
- def item(...)
38
- Item.new
39
- end
25
+ def item(...) = render Item.new(...)
40
26
 
41
- def empty(...)
42
- Empty.new(...)
43
- end
27
+ def empty(...) = render Empty.new(...)
44
28
 
45
29
  private
46
30
 
@@ -21,35 +21,24 @@ module Protos
21
21
  default_attrs_method :default_attrs
22
22
 
23
23
  # Theme can override the css hash and add additional styles
24
- option :theme, as: :theme_override, default: -> { {} }, reader: :private
24
+ option :theme, as: :theme_override, default: -> { {} }, reader: false
25
25
  # Class becomes the :container key in the css hash
26
- option :class, as: :container_class, default: -> { "" }, reader: :private
27
- option :html_options, default: -> { {} }, reader: :private
26
+ option :class, as: :container_class, default: -> { "" }, reader: false
27
+ option :html_options, default: -> { {} }, reader: false
28
28
 
29
29
  # Adds non-defined options to the html_options hash
30
- def initialize(*args, **kwargs, &block)
31
- raise_block_in_initializer_error if block
32
-
30
+ def initialize(*args, **kwargs, &)
33
31
  defined_keys = self.class.dry_initializer.definitions.keys
34
32
  defined, undefined =
35
33
  kwargs
36
34
  .partition { |key, _| defined_keys.include?(key) }
37
- .map(&:to_h)
35
+ .map!(&:to_h)
38
36
 
39
- super(*args, html_options: undefined, **defined)
37
+ super(*args, html_options: undefined, **defined, &)
40
38
  end
41
39
 
42
40
  private
43
41
 
44
- def raise_block_in_initializer_error
45
- raise(
46
- ArgumentError,
47
- "It is unexpected to pass a block to the initializer of a component. " \
48
- "You might have tried to render and passed a block but it went to " \
49
- "the component.new. Check your render call."
50
- )
51
- end
52
-
53
42
  def attrs
54
43
  @attrs ||= build_attrs
55
44
  end
@@ -59,33 +48,35 @@ module Protos
59
48
  end
60
49
 
61
50
  def build_attrs(...)
62
- defaults = if respond_to?(
63
- self.class.default_attrs_method,
64
- :include_private
65
- )
66
- send(self.class.default_attrs_method)
51
+ defaults = if respond_to?(default_attrs_method, :include_private)
52
+ send(default_attrs_method)
67
53
  end
68
54
 
69
55
  Attributes
70
56
  .new(...)
71
57
  .merge(defaults)
72
- .merge(html_options)
58
+ .merge(@html_options)
73
59
  .merge(class: css[:container])
74
60
  end
75
61
 
76
62
  def build_theme(...)
77
- component_style = if respond_to?(
78
- self.class.theme_method,
79
- :include_private
80
- )
81
- send(self.class.theme_method)
63
+ component_style = if respond_to?(theme_method, :include_private)
64
+ send(theme_method)
82
65
  end
83
66
 
84
67
  Theme
85
68
  .new(...)
86
69
  .merge(component_style)
87
- .merge(theme_override)
88
- .merge(container: container_class)
70
+ .merge(@theme_override)
71
+ .merge(container: @container_class)
72
+ end
73
+
74
+ def theme_method
75
+ self.class.theme_method
76
+ end
77
+
78
+ def default_attrs_method
79
+ self.class.default_attrs_method
89
80
  end
90
81
  end
91
82
  end
@@ -6,8 +6,8 @@ module Protos
6
6
  # DOCS: The content of a drawer. This would be visible at all times and
7
7
  # represents the main content of your page.
8
8
 
9
- def template(&block)
10
- div(**attrs, &block)
9
+ def view_template(&)
10
+ div(**attrs, &)
11
11
  end
12
12
 
13
13
  private
@@ -8,7 +8,7 @@ module Protos
8
8
 
9
9
  option :id, type: Types::Coercible::String
10
10
 
11
- def template
11
+ def view_template
12
12
  aside(**attrs) do
13
13
  label(for: id, aria_label: "close sidebar", class: css[:toggle])
14
14
  yield if block_given?
@@ -8,8 +8,8 @@ module Protos
8
8
 
9
9
  option :id, type: Types::Coercible::String
10
10
 
11
- def template(&block)
12
- label(for: id, **attrs, &block)
11
+ def view_template(&)
12
+ label(for: id, **attrs, &)
13
13
  end
14
14
 
15
15
  private
data/lib/protos/drawer.rb CHANGED
@@ -9,24 +9,18 @@ module Protos
9
9
 
10
10
  option :id, type: Types::Coercible::String
11
11
 
12
- def template
12
+ def view_template
13
13
  div(**attrs) do
14
- input(id:, type: :checkbox, class: css[:toggle])
14
+ input(id:, type: :checkbox, class: css[:toggle], autocomplete: :off)
15
15
  yield if block_given?
16
16
  end
17
17
  end
18
18
 
19
- def content(...)
20
- Content.new(...)
21
- end
19
+ def content(...) = render Content.new(...)
22
20
 
23
- def side(*args, **kwargs, &block)
24
- Side.new(*args, id:, **kwargs, &block)
25
- end
21
+ def side(*, **, &) = render Side.new(*, id:, **, &)
26
22
 
27
- def trigger(*args, **kwargs, &block)
28
- Trigger.new(*args, id:, **kwargs, &block)
29
- end
23
+ def trigger(*, **, &) = render Trigger.new(*, id:, **, &)
30
24
 
31
25
  private
32
26
 
@@ -5,8 +5,8 @@ module Protos
5
5
  class Item < Component
6
6
  # DOCS: A single item within a dropdown
7
7
 
8
- def template(&block)
9
- li(**attrs, &block)
8
+ def view_template(&)
9
+ li(**attrs, &)
10
10
  end
11
11
  end
12
12
  end
@@ -7,7 +7,7 @@ module Protos
7
7
  # Protos::Popover::Content component as the main functionality for
8
8
  # dropdowns comes from there.
9
9
 
10
- def template(&block)
10
+ def view_template(&block)
11
11
  template_tag(**template_attrs) do
12
12
  ul(**attrs, &block)
13
13
  end
@@ -19,16 +19,10 @@ module Protos
19
19
  reader: false,
20
20
  type: TriggerTypes | Types::Array.of(TriggerTypes)
21
21
 
22
- def item(...)
23
- Item.new(...)
24
- end
22
+ def item(...) = render Item.new(...)
25
23
 
26
- def menu(...)
27
- Menu.new(...)
28
- end
24
+ def menu(...) = render Menu.new(...)
29
25
 
30
- def trigger(...)
31
- Trigger.new(...)
32
- end
26
+ def trigger(...) = render Trigger.new(...)
33
27
  end
34
28
  end
@@ -6,8 +6,8 @@ module Protos
6
6
  # DOCS: The content of a hero. This would be centered within the main
7
7
  # component container.
8
8
 
9
- def template(&block)
10
- div(**attrs, &block)
9
+ def view_template(&)
10
+ div(**attrs, &)
11
11
  end
12
12
 
13
13
  private
@@ -7,8 +7,8 @@ module Protos
7
7
  # their opacity through the opacity of the overlay. This can be useful to
8
8
  # make text readable on noisy images.
9
9
 
10
- def template(&block)
11
- div(**attrs, &block)
10
+ def view_template(&)
11
+ div(**attrs, &)
12
12
  end
13
13
 
14
14
  private
data/lib/protos/hero.rb CHANGED
@@ -6,17 +6,13 @@ module Protos
6
6
  # optionally layout an image for a responsive layout.
7
7
  # https://daisyui.com/components/hero/
8
8
 
9
- def template(&block)
10
- div(**attrs, &block)
9
+ def view_template(&)
10
+ div(**attrs, &)
11
11
  end
12
12
 
13
- def content(...)
14
- Content.new(...)
15
- end
13
+ def content(...) = render Content.new(...)
16
14
 
17
- def overlay(...)
18
- Overlay.new(...)
19
- end
15
+ def overlay(...) = render Overlay.new(...)
20
16
 
21
17
  private
22
18
 
@@ -7,8 +7,8 @@ module Protos
7
7
  # work for list items, including border radius. E.g. only the first and
8
8
  # last items will have border radius on the top and bottom.
9
9
 
10
- def template(&block)
11
- li(**attrs, &block)
10
+ def view_template(&)
11
+ li(**attrs, &)
12
12
  end
13
13
 
14
14
  private
data/lib/protos/list.rb CHANGED
@@ -7,13 +7,11 @@ module Protos
7
7
 
8
8
  option :ordered, Types::Bool, default: -> { false }, reader: false
9
9
 
10
- def template(&block)
11
- send(element, **attrs, &block)
10
+ def view_template(&)
11
+ send(element, **attrs, &)
12
12
  end
13
13
 
14
- def item(...)
15
- Item.new(...)
16
- end
14
+ def item(...) = render Item.new(...)
17
15
 
18
16
  private
19
17
 
@@ -5,7 +5,7 @@ module Protos
5
5
  class CloseButton < Component
6
6
  # DOCS: A close button for a modal
7
7
 
8
- def template(&block)
8
+ def view_template(&block)
9
9
  form(method: :dialog, class: css[:form]) do
10
10
  button(
11
11
  **attrs,
@@ -6,7 +6,7 @@ module Protos
6
6
  # DOCS: A modal dialog. This is the place for the main content of the
7
7
  # modal that will be displayed when the trigger is clicked.
8
8
 
9
- def template(&block)
9
+ def view_template(&block)
10
10
  dialog(**attrs) do
11
11
  div(class: css[:modal], &block)
12
12
  end
@@ -5,8 +5,8 @@ module Protos
5
5
  class Trigger < Component
6
6
  # DOCS: A trigger is a button that opens a modal
7
7
 
8
- def template(&block)
9
- button(**attrs, &block)
8
+ def view_template(&)
9
+ button(**attrs, &)
10
10
  end
11
11
 
12
12
  private
data/lib/protos/modal.rb CHANGED
@@ -5,21 +5,15 @@ module Protos
5
5
  # DOCS: A modal component that can be triggered by a button or a link and
6
6
  # will open a fullscreen modal, usually with a close button.
7
7
 
8
- def template(&block)
9
- div(**attrs, class: css[:container], &block)
8
+ def view_template(&)
9
+ div(**attrs, class: css[:container], &)
10
10
  end
11
11
 
12
- def close_button(...)
13
- CloseButton.new(...)
14
- end
12
+ def close_button(...) = render CloseButton.new(...)
15
13
 
16
- def dialog(...)
17
- Dialog.new(...)
18
- end
14
+ def dialog(...) = render Dialog.new(...)
19
15
 
20
- def trigger(...)
21
- Trigger.new(...)
22
- end
16
+ def trigger(...) = render Trigger.new(...)
23
17
 
24
18
  private
25
19
 
@@ -7,8 +7,10 @@ module Protos
7
7
  # added to the DOM by tippy.js to handle the position of the content.
8
8
  # This means content in here will not be available in system tests that
9
9
  # use rack_test.
10
+ #
11
+ # TODO: Move away from using template
10
12
 
11
- def template(&block)
13
+ def view_template(&block)
12
14
  template_tag(**template_attrs) do
13
15
  div(**attrs, &block)
14
16
  end
@@ -6,8 +6,8 @@ module Protos
6
6
  # DOCS: The trigger of a popover. This is the element that you would hover
7
7
  # or click on to show the popover.
8
8
 
9
- def template(&block)
10
- div(**attrs, &block)
9
+ def view_template(&)
10
+ div(**attrs, &)
11
11
  end
12
12
 
13
13
  private