diff --git a/app/components/ruby_ui/textarea/textarea.rb b/app/components/ruby_ui/textarea/textarea.rb index fa648b93..159395c7 100644 --- a/app/components/ruby_ui/textarea/textarea.rb +++ b/app/components/ruby_ui/textarea/textarea.rb @@ -19,7 +19,14 @@ def default_attrs ruby_ui__form_field_target: "input", action: "input->ruby-ui--form-field#onInput invalid->ruby-ui--form-field#onInvalid" }, - class: "flex w-full rounded-md border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50 border-border focus-visible:ring-ring placeholder:text-muted-foreground" + class: [ + "flex w-full rounded-md border bg-background px-3 py-1 text-sm shadow-sm transition-colors border-border", + "placeholder:text-muted-foreground", + "disabled:cursor-not-allowed disabled:opacity-50", + "file:border-0 file:bg-transparent file:text-sm file:font-medium", + "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", + "aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:pointer-events-none" + ] } end end diff --git a/app/views/docs/textarea.rb b/app/views/docs/textarea.rb index 748f6900..ce83349a 100644 --- a/app/views/docs/textarea.rb +++ b/app/views/docs/textarea.rb @@ -25,6 +25,14 @@ def view_template RUBY end + render Docs::VisualCodeExample.new(title: "Aria Disabled", context: self) do + <<~RUBY + div(class: "grid w-full max-w-sm items-center gap-1.5") do + Textarea(aria: {disabled: "true"}, placeholder: "Aria Disabled") + end + RUBY + end + render Docs::VisualCodeExample.new(title: "With FormField", context: self) do <<~RUBY div(class: "grid w-full max-w-sm items-center gap-1.5") do