view_component-contrib 0.2.0 → 0.2.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: 814046bee78131bac6659eaa62160b6dfef169d48d1c5850c03dbe6a00a2ad0f
4
- data.tar.gz: ef1ec7cfb3f71bf4db995be3a564dcfc0ff04e72d3c4e116515d216de18b38e8
3
+ metadata.gz: b586c9ad03730cff1cc38721c6904f427c71a73f5777605f17fc0379f60f8dc7
4
+ data.tar.gz: 7c2ed9aed5c845492a8487fab7ce5e66c639d455d8b4027c383b047ad961fdf0
5
5
  SHA512:
6
- metadata.gz: 9a5d578dfc44e7318da343a0aefe65946cce2399675d92646fd33db8e7494040d16433a3c409a08185d04c249fbc538e494175dce593a6bde19e27d254926d42
7
- data.tar.gz: d01e0bf7f11d866aaab42dafb040e7ee45e4257524888b7bb6768b399d2db03c971867e6b14d839c1a66f7e37d9fe71982e287c8280b3a16811891bc61ee4723
6
+ metadata.gz: c1d2f760734b6ca7f71da538fbba4c04b0ff91b885cc47e09f3943b81a5a097ef62293348dc3ac07e20a4b812e52cf8a4bd8b39b6cb306551dceac4a784c652b
7
+ data.tar.gz: baaf5f34009ca87228246f260357339849f3d22e988543f36c36e772293bede4f249741fee5749db46d37a78dd8dc94674e13181d618282463a31afd5dba48b7
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.2.1 (2023-11-16)
6
+
7
+ - Fix style variants inhertiance. ([@palkan][])
8
+
5
9
  ## 0.2.0 (2023-11-07)
6
10
 
7
11
  - Introduce style variants. ([@palkan][])
data/README.md CHANGED
@@ -281,6 +281,22 @@ class ButtonComponent < ViewComponent::Base
281
281
  end
282
282
  ```
283
283
 
284
+ ### Using with TailwindCSS LSP
285
+
286
+ To make completions (and other LSP features) work with our DSL, try the following configuration:
287
+
288
+ ```json
289
+ "tailwindCSS.includeLanguages": {
290
+ "erb": "html",
291
+ "ruby": "html"
292
+ },
293
+ "tailwindCSS.experimental.classRegex": [
294
+ "%w\\[([^\\]]*)\\]"
295
+ ]
296
+ ```
297
+
298
+ **NOTE:** It will only work with `%w[ ... ]` word arrays, but you can adjust it to your needs.
299
+
284
300
  ## Organizing assets (JS, CSS)
285
301
 
286
302
  **NOTE**: This section assumes the usage of Vite or Webpack. See [this discussion](https://github.com/palkan/view_component-contrib/discussions/14) for other options.
@@ -102,6 +102,13 @@ module ViewComponentContrib
102
102
 
103
103
  acc
104
104
  end
105
+
106
+ def dup
107
+ copy = super
108
+ copy.instance_variable_set(:@defaults, @defaults.dup)
109
+ copy.instance_variable_set(:@variants, @variants.dup)
110
+ copy
111
+ end
105
112
  end
106
113
 
107
114
  class StyleConfig # :nodoc:
@@ -131,6 +138,12 @@ module ViewComponentContrib
131
138
  @postprocessor = callable || block
132
139
  end
133
140
 
141
+ def dup
142
+ copy = super
143
+ copy.instance_variable_set(:@styles, @styles.dup)
144
+ copy
145
+ end
146
+
134
147
  private
135
148
 
136
149
  attr_reader :styles
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ViewComponentContrib # :nodoc:all
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_component-contrib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-08 00:00:00.000000000 Z
11
+ date: 2023-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: view_component