Skip to content

Commit e974f7a

Browse files
authored
form: Update form component (#330)
- FormField: Change from space-y-2 to flex flex-col gap-2 - FormFieldError: Add empty:hidden, change text-xs to text-sm - FormFieldHint: Add empty:hidden - FormFieldLabel: Add empty:hidden
1 parent 1171416 commit e974f7a

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

lib/ruby_ui/form/form_field.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def default_attrs
1313
data: {
1414
controller: "ruby-ui--form-field"
1515
},
16-
class: "space-y-2"
16+
class: "flex flex-col gap-2"
1717
}
1818
end
1919
end

lib/ruby_ui/form/form_field_error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def default_attrs
1313
data: {
1414
ruby_ui__form_field_target: "error"
1515
},
16-
class: "text-xs font-medium text-destructive"
16+
class: "empty:hidden text-sm font-medium text-destructive"
1717
}
1818
end
1919
end

lib/ruby_ui/form/form_field_hint.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def view_template(&)
99
private
1010

1111
def default_attrs
12-
{class: "text-sm text-muted-foreground"}
12+
{class: "empty:hidden text-sm text-muted-foreground"}
1313
end
1414
end
1515
end

lib/ruby_ui/form/form_field_label.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def view_template(&)
1111
def default_attrs
1212
{
1313
class: [
14-
"text-sm font-medium leading-none inline-block",
14+
"empty:hidden text-sm font-medium leading-none",
1515
"peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
1616
"peer-aria-disabled:cursor-not-allowed peer-aria-disabled:opacity-70 peer-aria-disabled:pointer-events-none"
1717
]

0 commit comments

Comments
 (0)