Class: Uchi::Flowbite::Input::Textarea

Inherits:
Field
  • Object
show all
Defined in:
app/components/uchi/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 Uchi::Flowbite::Input::Field

Class Method Details

.stylesObject

rubocop:disable Layout/LineLength



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

def styles
  {
    default: Uchi::Flowbite::Style.new(
      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.



21
22
23
24
25
26
27
# File 'app/components/uchi/flowbite/input/textarea.rb', line 21

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