Sha256: 1748a2eef987355cc32e28b2f124b24e883af87bfddd46f30eb0a9a8c71f53a0

Contents?: true

Size: 1.3 KB

Versions: 110

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

module Ariadne
  # Add a general description of component here
  # Add additional usage considerations or best practices that may aid the user to use the component correctly.
  # @accessibility Add any accessibility considerations
  class RichTextAreaComponent < Ariadne::Component
    DEFAULT_TAG = :div
    DEFAULT_CLASSES = ""

    # @example Default
    #
    #   <%= render(Ariadne::RichTextAreaComponent.new(name: "bodytext", sr_label: "Enter message contents")) { "Example" } %>
    #
    # @param name [Symbol] Identifies the form/param name for this rich text area.
    # @param sr_label [String] A label to introduce these tabs for screen readers.
    # @param has_form [Boolean] Indicates whether this component is wrapped in a form.
    # @param classes [String] <%= link_to_classes_docs %>
    # @param attributes [Hash] <%= link_to_attributes_docs %>
    def initialize(name:, sr_label:, has_form: true, classes: "", attributes: {})
      @tag = DEFAULT_TAG
      @name = name
      @sr_label = sr_label
      @has_form = has_form

      @classes = merge_class_names(
        DEFAULT_CLASSES,
        classes,
      )
      @attributes = attributes
      @attributes[:"data-controller"] = "rich-text-area-component"
      @attributes[:"data-has-form"] = true if @has_form
    end
  end
end

Version data entries

110 entries across 110 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.50-x86_64-linux app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.50-aarch64-linux app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.49-aarch64-linux app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.49-x86_64-darwin app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.49-x86_64-linux app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.49-arm64-darwin app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.49-x64-mingw-ucrt app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.49 app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.48-x64-mingw-ucrt app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.48-aarch64-linux app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.48-x86_64-darwin app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.48-arm64-darwin app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.48 app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.48-x86_64-linux app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.47-x86_64-darwin app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.47-x86_64-linux app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.47-arm64-darwin app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.47-aarch64-linux app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.47-x64-mingw-ucrt app/components/ariadne/rich_text_area_component.rb
ariadne_view_components-0.0.47 app/components/ariadne/rich_text_area_component.rb