flit_view_components 0.0.4 → 0.0.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: b486239c7ade31683962bcd3fee664e07dc1e36200a00c320f9fd4be4882120c
4
- data.tar.gz: 1c109320c70a957d5256d784e6e18def88a8790fa28284957a153449f8008e9b
3
+ metadata.gz: 8cbfc0cb83dde32bcdcc6299b295402e108a81b16e5c54956533ff5391307e91
4
+ data.tar.gz: fe2f581419bb65fb6212949ba6b2aa34b81274a39918328dff7e9b998c78cf50
5
5
  SHA512:
6
- metadata.gz: 2ce5a80d93d4962246562c046adbe81649b1248c9c43bd7a3cb56775d3d158e19eea04169ae3b4581ab70d7e91c904aaf911fd7df13220fbfa3c2071d4398d14
7
- data.tar.gz: db095df25fb938f79d29af8d85b5c663b6a528e5c7844f5a1f955730d922618f218ffaed5427289d76e8b07c026b9e7f0760bd04fe8c6d3872bae90b1cf163fa
6
+ metadata.gz: 4f0c374bb86dae4bd22f292ce7237e197c3ec13ee727e1d1323acac645fc1570615d761cfb1824aeddf8e03355c69794893d452fd20ca0d56333c3e0fc79fc0c
7
+ data.tar.gz: 0ffc91ed690016ac0577707cc264048b47eb68ccfc287e82a794b92076f097ea56d3998a8a56f2793a3576d13e75c3b132f4e6e9b727b42c268c3bd883f3b600
@@ -1,5 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Flit::BaseComponent < ViewComponent::Base
4
+ # include ActiveModel::Validations
4
5
 
6
+ def initialize(**kwargs)
7
+ super
8
+
9
+ @theme = kwargs[:theme] || FlitViewComponents.configuration&.theme.present? ? FlitViewComponents::configuration.theme.constantize.new : Flit::DefaultTheme.new
10
+ # validate!
11
+ end
5
12
  end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Flit::DefaultTheme < Flit::Theme
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Flit::NullTheme < Flit::Theme
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Flit::Theme
4
+
5
+ end
@@ -1,3 +1,3 @@
1
1
  module FlitViewComponents
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -2,5 +2,18 @@ require "flit_view_components/version"
2
2
  require "flit_view_components/engine"
3
3
 
4
4
  module FlitViewComponents
5
- # Your code goes here...
5
+ mattr_accessor :configuration
6
+
7
+ def self.configure
8
+ self.configuration ||= Configuration.new
9
+ yield(configuration)
10
+ end
11
+
12
+ class Configuration
13
+ attr_accessor :theme
14
+
15
+ def initialize
16
+ @theme = "Flit::DefaultTheme"
17
+ end
18
+ end
6
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flit_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron F Stanton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-15 00:00:00.000000000 Z
11
+ date: 2023-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: view_component
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.0rc3
19
+ version: 3.0.0rc5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.0rc3
26
+ version: 3.0.0rc5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -182,6 +182,7 @@ files:
182
182
  - app/components/flit/custom_scroll_view_component.html.erb
183
183
  - app/components/flit/custom_scroll_view_component.rb
184
184
  - app/components/flit/custom_scroll_view_component_controller.js
185
+ - app/components/flit/default_theme.rb
185
186
  - app/components/flit/directionality_component.en.yml
186
187
  - app/components/flit/directionality_component.html.erb
187
188
  - app/components/flit/directionality_component.rb
@@ -302,6 +303,7 @@ files:
302
303
  - app/components/flit/network_image_component.html.erb
303
304
  - app/components/flit/network_image_component.rb
304
305
  - app/components/flit/network_image_component_controller.js
306
+ - app/components/flit/null_theme.rb
305
307
  - app/components/flit/offstage_component.en.yml
306
308
  - app/components/flit/offstage_component.html.erb
307
309
  - app/components/flit/offstage_component.rb
@@ -426,10 +428,7 @@ files:
426
428
  - app/components/flit/text_form_field_component.html.erb
427
429
  - app/components/flit/text_form_field_component.rb
428
430
  - app/components/flit/text_form_field_component_controller.js
429
- - app/components/flit/theme_component.en.yml
430
- - app/components/flit/theme_component.html.erb
431
- - app/components/flit/theme_component.rb
432
- - app/components/flit/theme_component_controller.js
431
+ - app/components/flit/theme.rb
433
432
  - app/components/flit/tooltip_component.en.yml
434
433
  - app/components/flit/tooltip_component.html.erb
435
434
  - app/components/flit/tooltip_component.rb
@@ -1,3 +0,0 @@
1
- ---
2
- en:
3
- hello: Hello
@@ -1,7 +0,0 @@
1
- <% unless Rails.env == 'production' %>
2
- <!-- Theme -->
3
- <% end %>
4
- <div>Add Flit::Theme template here</div>
5
- <% unless Rails.env == 'production' %>
6
- <!-- /Theme -->
7
- <% end %>
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Flit::ThemeComponent < Flit::BaseComponent
4
-
5
- end
@@ -1,7 +0,0 @@
1
- import { Controller } from "@hotwired/stimulus";
2
-
3
- export default class extends Controller {
4
- connect() {
5
- console.log("Hello, Stimulus!", this.element);
6
- }
7
- }