Sha256: 0f24f59adb163d194b0739b243906dcdadf5d23d928bcc07fe3b148e1a912a13

Contents?: true

Size: 1022 Bytes

Versions: 24

Compression:

Stored size: 1022 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 NarrowContainerComponent < Ariadne::Component
    DEFAULT_TAG = :div
    TAG_OPTIONS = [DEFAULT_TAG].freeze

    DEFAULT_CLASSES = "ariadne-max-w-7xl ariadne-mx-auto ariadne-py-12 ariadne-px-4 sm:ariadne-px-6 lg:ariadne-py-16 lg:ariadne-px-8"

    # @example Default
    #   <%= render(Ariadne::NarrowContainerComponent.new) do |container| %>
    #     <%= render(Ariadne::ButtonComponent.new) { "Click me!" } %>
    #   <% end %>
    #
    # @param classes [String] <%= link_to_classes_docs %>
    # @param attributes [Hash] <%= link_to_attributes_docs %>
    def initialize(classes: "", attributes: {})
      @tag = :div
      @classes = class_names(
        DEFAULT_CLASSES,
        classes
      )

      @attributes = attributes
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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