flowbite-components 0.1.2 → 0.1.4

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.
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Flowbite
4
+ class Styles
5
+ class StyleNotFoundError < ::KeyError; end
6
+
7
+ class << self
8
+ def from_hash(styles_hash)
9
+ styles = Styles.new
10
+ styles_hash.each do |style_name, states_hash|
11
+ styles.add_style(style_name, states_hash)
12
+ end
13
+ styles
14
+ end
15
+ end
16
+
17
+ def add_style(style_name, states_hash)
18
+ @styles[style_name] = Flowbite::Style.new(states_hash)
19
+ end
20
+
21
+ def fetch(style_name)
22
+ return @styles[style_name] if @styles.key?(style_name)
23
+
24
+ raise \
25
+ StyleNotFoundError,
26
+ "Style not found: #{style_name}. Available styles: " \
27
+ "#{@styles.keys.sort.join(", ")}"
28
+ end
29
+
30
+ def initialize
31
+ @styles = {}
32
+ end
33
+ end
34
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Flowbite
4
4
  module Components
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowbite-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakob Skjerning
@@ -39,6 +39,8 @@ files:
39
39
  - app/components/flowbite/button/outline.rb
40
40
  - app/components/flowbite/button/pill.rb
41
41
  - app/components/flowbite/card.rb
42
+ - app/components/flowbite/card/card.html.erb
43
+ - app/components/flowbite/card/title.rb
42
44
  - app/components/flowbite/input/checkbox.rb
43
45
  - app/components/flowbite/input/date.rb
44
46
  - app/components/flowbite/input/email.rb
@@ -70,7 +72,9 @@ files:
70
72
  - app/components/flowbite/input_field/text.rb
71
73
  - app/components/flowbite/input_field/textarea.rb
72
74
  - app/components/flowbite/input_field/url.rb
75
+ - app/components/flowbite/link.rb
73
76
  - app/components/flowbite/style.rb
77
+ - app/components/flowbite/styles.rb
74
78
  - lib/flowbite/components.rb
75
79
  - lib/flowbite/components/engine.rb
76
80
  - lib/flowbite/components/version.rb