From eac06f55ba43bc5ef8292e911897bc3043e67f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Djalma=20Ara=C3=BAjo?= Date: Wed, 10 Dec 2025 09:19:05 -0300 Subject: [PATCH] form: Update form component - 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 --- lib/ruby_ui/form/form_field.rb | 2 +- lib/ruby_ui/form/form_field_error.rb | 2 +- lib/ruby_ui/form/form_field_hint.rb | 2 +- lib/ruby_ui/form/form_field_label.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ruby_ui/form/form_field.rb b/lib/ruby_ui/form/form_field.rb index dc4b511c..3665f02b 100644 --- a/lib/ruby_ui/form/form_field.rb +++ b/lib/ruby_ui/form/form_field.rb @@ -13,7 +13,7 @@ def default_attrs data: { controller: "ruby-ui--form-field" }, - class: "space-y-2" + class: "flex flex-col gap-2" } end end diff --git a/lib/ruby_ui/form/form_field_error.rb b/lib/ruby_ui/form/form_field_error.rb index 58c43d35..c47d779c 100644 --- a/lib/ruby_ui/form/form_field_error.rb +++ b/lib/ruby_ui/form/form_field_error.rb @@ -13,7 +13,7 @@ def default_attrs data: { ruby_ui__form_field_target: "error" }, - class: "text-xs font-medium text-destructive" + class: "empty:hidden text-sm font-medium text-destructive" } end end diff --git a/lib/ruby_ui/form/form_field_hint.rb b/lib/ruby_ui/form/form_field_hint.rb index 5304a259..ba7a5b6c 100644 --- a/lib/ruby_ui/form/form_field_hint.rb +++ b/lib/ruby_ui/form/form_field_hint.rb @@ -9,7 +9,7 @@ def view_template(&) private def default_attrs - {class: "text-sm text-muted-foreground"} + {class: "empty:hidden text-sm text-muted-foreground"} end end end diff --git a/lib/ruby_ui/form/form_field_label.rb b/lib/ruby_ui/form/form_field_label.rb index 5a7b85b1..bfda2b27 100644 --- a/lib/ruby_ui/form/form_field_label.rb +++ b/lib/ruby_ui/form/form_field_label.rb @@ -11,7 +11,7 @@ def view_template(&) def default_attrs { class: [ - "text-sm font-medium leading-none inline-block", + "empty:hidden text-sm font-medium leading-none", "peer-disabled:cursor-not-allowed peer-disabled:opacity-70", "peer-aria-disabled:cursor-not-allowed peer-aria-disabled:opacity-70 peer-aria-disabled:pointer-events-none" ]