Class: Flowbite::Input::Textarea

Inherits:
Input
  • Object
show all
Defined in:
app/components/flowbite/input/textarea.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.styles ⇒ Object

rubocop:disable Layout/LineLength



8
9
10
11
12
13
14
15
16
17
18
# File 'app/components/flowbite/input/textarea.rb', line 8

def styles
  Flowbite::Styles.from_hash(
    {
      default: {
        default: ["block", "w-full", "text-heading", "bg-neutral-secondary-medium", "rounded-base", "border", "border-default-medium", "focus:ring-brand", "focus:border-brand", "shadow-xs", "placeholder:text-body"],
        disabled: ["block", "w-full", "bg-neutral-secondary-medium", "rounded-base", "border", "border-default-medium", "text-fg-disabled", "cursor-not-allowed", "shadow-xs", "placeholder:text-fg-disabled"],
        error: ["block", "w-full", "bg-danger-soft", "border", "border-danger-subtle", "text-fg-danger-strong", "placeholder:text-fg-danger-strong", "rounded-base", "focus:ring-danger", "focus:border-danger", "shadow-xs"]
      }
    }.freeze
  )
end

Instance Method Details

#call ⇒ Object

Returns the HTML to use for the actual input field element.



23
24
25
26
27
28
29
# File 'app/components/flowbite/input/textarea.rb', line 23

def call
  @form.send(
    input_field_type,
    @attribute,
    **input_options
  )
end