optics_view_components 0.1.3 → 0.1.5

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: c7e868dbff72f35b8979429a0a6ab9cb6690f1ed46ff5d4ca3d658aaec5fcd68
4
- data.tar.gz: 5200729a15f3672e8afb161e7437909f8ec55b8d6c4e189ba9d44349e5e58111
3
+ metadata.gz: 54fb6a68b7cdd5b3ccd449bca62f7011af24f36fc541a92d7da7d8254b26047b
4
+ data.tar.gz: aa821b1b78cabd2f2f2f78aa9aecefa4b40590fe76be411cafb6ec9b5675fb8c
5
5
  SHA512:
6
- metadata.gz: 21c5922dabf1c062f5b184d8650ac9b0616df298770d519a87abbd577ba237ff039d0fa1759df5172cc8a39e21018a2013ac6f65a97fb7eeceeaa64edf779f20
7
- data.tar.gz: '06913b6c9d7d9718ec86f6d9f81f648fa0a9ed2bc19e1a73eef0c614c0995f958c105bcf29a8074358ee221c153e2af12fda0d991a7dadc66bcbb98f81e52299'
6
+ metadata.gz: 172d34c022dcd91ac936ada62fb622c3836c14d22528f98a89e8eaf25cdf5539e496523e9dcc95303abf6f8c54c4ceba3b5bd0f2a3bb30eccf1380da80c7ba10
7
+ data.tar.gz: 34faf6863d961a9c7d12ad5a3ce12a49d35718a9b30abb7a912929181988777e72bf945fa97769756b614a756a555653914da72f9cd31967543b2f58d939c587
data/README.md CHANGED
@@ -31,7 +31,10 @@ Use in a view:
31
31
  Add to `config/application.rb`:
32
32
 
33
33
  ```
34
- config.lookbook.component_paths << Optics::ViewComponents::Engine.root.join('app/components/optics')
34
+ if config.respond_to?(:lookbook)
35
+ config.lookbook.component_paths << Optics::ViewComponents::Engine.root.join('app/components')
36
+ end
37
+
35
38
  config.view_component.preview_paths << Optics::ViewComponents::Engine.root.join('previews')
36
39
  ```
37
40
 
@@ -27,9 +27,9 @@ module Optics
27
27
  end
28
28
 
29
29
  def build_button(&)
30
- return link_to(url, class: classes, **@attributes, &) if url
30
+ return link_to(url, class: classes, **@attributes.except(:class), &) if url
31
31
 
32
- tag.button(class: classes, **@attributes, &)
32
+ tag.button(class: classes, **@attributes.except(:class), &)
33
33
  end
34
34
 
35
35
  def button_class
@@ -40,6 +40,7 @@ module Optics
40
40
 
41
41
  def classes
42
42
  class_names(
43
+ @attributes[:class],
43
44
  button_class,
44
45
  size_class,
45
46
  'btn--icon': icon,
@@ -21,7 +21,8 @@ module Optics
21
21
  class: classes,
22
22
  'aria-label': title,
23
23
  title:,
24
- data:
24
+ data:,
25
+ **@attributes.except(:class)
25
26
  ) do
26
27
  name
27
28
  end
@@ -30,6 +31,7 @@ module Optics
30
31
  def classes
31
32
  class_names(
32
33
  'material-symbols-outlined',
34
+ @attributes[:class],
33
35
  size_class,
34
36
  weight_class,
35
37
  emphasis_class,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Optics
4
4
  module ViewComponents
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.5'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optics_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reed Law
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-23 00:00:00.000000000 Z
11
+ date: 2023-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: view_component