bulma_view_components 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d89ea252c3bb28694fd30679b26fef0d04e3a6633fc5b6f318edd810e9eeb91f
4
- data.tar.gz: 3d076d6cfc8f1a531402e8dc7e2dbcf3815e3c56c7cee7a52d42ab0dc06ea66b
3
+ metadata.gz: 173bedbdbd58fa99dbebd27221ae7b0c3c54817d6ebae40241f978f0b9aeb292
4
+ data.tar.gz: 620da4805fa721af75f643aeffb3058fefccb71c351e25081bd51e037af02e4a
5
5
  SHA512:
6
- metadata.gz: f33dbd76070427d7f0f4b3320b0b1b40ed8eaa9108ac45b07c16676ba4156ff7f4cfa5b31f4387e7a45a4d74285304b3889cfc666923369c204ca95ab594428e
7
- data.tar.gz: b8aacf38e15fef673a32fe7f5455e2dd4142d14adfb11d4efcaba1e85e0d5ee6d6279b1b02f43e061fb9109aed146b908f96e4334ae3ca4f1b09a3ed5e299c9b
6
+ metadata.gz: 50cb77d39282af525b2ca696234ad3db1502c1ef893fc852125e5c9fd24fdf6beaa599eec3ccc5c4328bec56854edf1dc1da2b7bfe29768968a9c6f9209ac0d5
7
+ data.tar.gz: f65c1476f675ec1ece68e50a1310f11db9c37fe3c4e97f4408195e8aa08bce05aaed50498ccdf1ff21ca2d6603a8716024f507ca39fae80384aee759f850826e
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bulma
4
+ class BlockComponent < Component
5
+ def call
6
+ content_tag :div, content, class: "block"
7
+ end
8
+ end
9
+ end
@@ -3,7 +3,7 @@
3
3
  module Bulma
4
4
  class BoxComponent < Component
5
5
  def call
6
- content_tag :div, content, class: 'box'
6
+ content_tag :div, content, class: "box"
7
7
  end
8
8
  end
9
9
  end
@@ -10,8 +10,8 @@ module Bulma
10
10
 
11
11
  def call
12
12
  content_tag :span, content, class: class_names(
13
- 'tag',
14
- 'is-light' => @light,
13
+ "tag",
14
+ "is-light" => @light,
15
15
  "is-#{@color}" => @color,
16
16
  "is-#{@size}" => @size
17
17
  )
@@ -3,7 +3,7 @@
3
3
  module Bulma
4
4
  class TitleComponent < Component
5
5
  def initialize(as: :h1, size: 1)
6
- raise ArgumentError, 'invalid value to size' if size > 6
6
+ raise ArgumentError, "invalid value to size" if size > 6
7
7
 
8
8
  @as = as
9
9
  @size = size
@@ -11,7 +11,7 @@ module Bulma
11
11
 
12
12
  def call
13
13
  content_tag @as, content, class: class_names(
14
- 'title',
14
+ "title",
15
15
  "is-#{@size}"
16
16
  )
17
17
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bulma
4
+ # Helper methods for cleaner views.
5
+ #
6
+ # These methods are automatically available to views and offer a very thin
7
+ # layer around the actual components they wrap.
8
+ module ComponentHelper
9
+ def bulma_title(*args, **kwargs, &block)
10
+ render Bulma::TitleComponent.new(*args, **kwargs, &block)
11
+ end
12
+ end
13
+ end
@@ -3,8 +3,10 @@
3
3
  module Bulma
4
4
  module ViewComponents
5
5
  class Engine < ::Rails::Engine
6
+ isolate_namespace Bulma::ViewComponents
7
+
6
8
  config.autoload_paths += [
7
- root.join('app/components')
9
+ root.join("app/components")
8
10
  ]
9
11
  end
10
12
  end
@@ -3,7 +3,6 @@
3
3
  module Bulma
4
4
  module Sizes
5
5
  def self.[](name)
6
-
7
6
  end
8
7
  end
9
8
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bulma
4
4
  module ViewComponents
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulma_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Toral
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-24 00:00:00.000000000 Z
11
+ date: 2024-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -47,10 +47,12 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - LICENSE.txt
49
49
  - README.md
50
+ - app/components/bulma/block_component.rb
50
51
  - app/components/bulma/box_component.rb
51
52
  - app/components/bulma/component.rb
52
53
  - app/components/bulma/tag_component.rb
53
54
  - app/components/bulma/title_component.rb
55
+ - app/helpers/bulma/component_helper.rb
54
56
  - lib/bulma/colors.rb
55
57
  - lib/bulma/view_components.rb
56
58
  - lib/bulma/view_components/engine.rb