Sha256: a54adb43a7a861ab73a04d37379111f4cb788c079e662d09b2c78d2e48f749da

Contents?: true

Size: 946 Bytes

Versions: 26

Compression:

Stored size: 946 Bytes

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 MainComponent < Ariadne::Component
    DEFAULT_CLASSES = "flex-auto"

    # @example Default
    #
    #   <%= render(Ariadne::MainComponent.new) { "Example" } %>
    #
    # @param classes [String] <%= link_to_classes_docs %>
    # @param attributes [Hash] <%= link_to_attributes_docs %>
    def initialize(classes: "", attributes: {})
      @tag = :main
      @classes = class_names(
        DEFAULT_CLASSES,
        classes
      )

      @attributes = attributes
    end

    def call
      render(Ariadne::BaseComponent.new(tag: @tag, classes: @classes, attributes: @attributes)) do
        render(Ariadne::ContainerComponent.new) { content }
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.12 app/components/ariadne/main_component.rb
ariadne_view_components-0.0.12-x86_64-linux app/components/ariadne/main_component.rb
ariadne_view_components-0.0.12-x86_64-darwin app/components/ariadne/main_component.rb
ariadne_view_components-0.0.12-x64-mingw32 app/components/ariadne/main_component.rb
ariadne_view_components-0.0.12-x64-mingw-ucrt app/components/ariadne/main_component.rb
ariadne_view_components-0.0.12-arm64-darwin app/components/ariadne/main_component.rb
ariadne_view_components-0.0.12-aarch64-linux app/components/ariadne/main_component.rb
ariadne_view_components-0.0.11 app/components/ariadne/main_component.rb
ariadne_view_components-0.0.11-x86_64-linux app/components/ariadne/main_component.rb
ariadne_view_components-0.0.11-x86_64-darwin app/components/ariadne/main_component.rb
ariadne_view_components-0.0.11-x64-mingw32 app/components/ariadne/main_component.rb
ariadne_view_components-0.0.11-x64-mingw-ucrt app/components/ariadne/main_component.rb
ariadne_view_components-0.0.11-arm64-darwin app/components/ariadne/main_component.rb
ariadne_view_components-0.0.11-aarch64-linux app/components/ariadne/main_component.rb
ariadne_view_components-0.0.10 app/components/ariadne/main_component.rb
ariadne_view_components-0.0.10-x86_64-linux app/components/ariadne/main_component.rb
ariadne_view_components-0.0.10-x86_64-darwin app/components/ariadne/main_component.rb
ariadne_view_components-0.0.10-x64-mingw32 app/components/ariadne/main_component.rb
ariadne_view_components-0.0.10-x64-mingw-ucrt app/components/ariadne/main_component.rb
ariadne_view_components-0.0.10-arm64-darwin app/components/ariadne/main_component.rb