Class: Flowbite::Input::Textarea

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

Constant Summary

Constants inherited from Field

Field::SIZES, Field::STATES

Instance Attribute Summary

Attributes inherited from Field

#options, #size, #style

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Field

classes, #initialize, sizes

Constructor Details

This class inherits a constructor from Flowbite::Input::Field

Class Method Details

.stylesObject

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

#callObject

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