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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -7
- data/README.md +39 -9
- data/app/components/flowbite/button/outline.rb +25 -10
- data/app/components/flowbite/button/pill.rb +26 -26
- data/app/components/flowbite/button.rb +33 -30
- data/app/components/flowbite/card/card.html.erb +7 -0
- data/app/components/flowbite/card/title.rb +39 -0
- data/app/components/flowbite/card.rb +58 -15
- data/app/components/flowbite/input/checkbox.rb +45 -7
- data/app/components/flowbite/input/field.rb +21 -12
- data/app/components/flowbite/input/file.rb +11 -9
- data/app/components/flowbite/input/hint.rb +10 -7
- data/app/components/flowbite/input/label.rb +14 -9
- data/app/components/flowbite/input/radio_button.rb +11 -9
- data/app/components/flowbite/input/select.rb +15 -6
- data/app/components/flowbite/input/textarea.rb +11 -9
- data/app/components/flowbite/input/validation_error.rb +31 -1
- data/app/components/flowbite/input_field/checkbox.html.erb +2 -4
- data/app/components/flowbite/input_field/checkbox.rb +17 -8
- data/app/components/flowbite/input_field/input_field.html.erb +1 -1
- data/app/components/flowbite/input_field/radio_button.html.erb +2 -4
- data/app/components/flowbite/input_field/radio_button.rb +14 -12
- data/app/components/flowbite/input_field/select.rb +5 -1
- data/app/components/flowbite/input_field.rb +38 -9
- data/app/components/flowbite/link.rb +41 -0
- data/app/components/flowbite/styles.rb +34 -0
- data/lib/flowbite/components/version.rb +1 -1
- metadata +5 -1
|
@@ -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
|
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.
|
|
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
|