Skip to content

Commit 3a5eee4

Browse files
committed
Rename hint_attributes argument to options
This is simpler and more consistent with the naming conventions we use in the other components.
1 parent 3ca3c29 commit 3a5eee4

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

app/components/flowbite/input/hint.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ def call
2626
tag.p(
2727
content,
2828
class: classes,
29-
**@hint_attributes
29+
**@options
3030
)
3131
end
3232

33-
def initialize(attribute:, form:, hint_attributes: {})
33+
def initialize(attribute:, form:, options: {})
3434
@attribute = attribute
3535
@form = form
36-
@hint_attributes = hint_attributes
36+
@options = options
3737
@object = form.object
3838
end
3939

app/components/flowbite/input_field.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def default_hint
9595
component = Flowbite::Input::Hint.new(
9696
attribute: @attribute,
9797
form: @form,
98-
hint_attributes: default_hint_options
98+
options: default_hint_options
9999
).with_content(default_hint_content)
100100
render(component)
101101
end

app/components/flowbite/input_field/checkbox.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def hint
1818
component = Flowbite::Input::Hint.new(
1919
attribute: @attribute,
2020
form: @form,
21-
hint_attributes: {
21+
options: {
2222
class: hint_classes,
2323
id: id_for_hint_element
2424
}

app/components/flowbite/input_field/radio_button.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def hint
4646
component = Flowbite::Input::Hint.new(
4747
attribute: @attribute,
4848
form: @form,
49-
hint_attributes: {
49+
options: {
5050
class: hint_classes,
5151
id: id_for_hint_element
5252
}

test/components/input/hint_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_renders_a_hint
1919
end
2020

2121
def test_accepts_custom_attributes
22-
render_inline(Flowbite::Input::Hint.new(form: @form, attribute: :title, hint_attributes: {id: "custom_hint"})) { "What's the title?" }
22+
render_inline(Flowbite::Input::Hint.new(form: @form, attribute: :title, options: {id: "custom_hint"})) { "What's the title?" }
2323

2424
assert_selector("p#custom_hint.text-sm.text-gray-500", text: "What's the title?")
2525
end

0 commit comments

Comments
 (0)