Sha256: 7e7aa8c49792cd2eba24fa9c533bd4e4050e68a814c859bb47e0beb866a12741

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

# typed: false
# frozen_string_literal: true

module Ariadne
  module Layout
    module LabelBlock
      class Component < Ariadne::BaseComponent
        option :label

        # Trailing visuals appear to the right of the label text.
        #
        # Use:
        #
        # - `trailing_visual_button` for a <%= link_to_component(Ariadne::UI::Button::Component) %>.
        renders_one :trailing_visual, types: {
          button: lambda { |**options|
            options[:size] ||= :xs
            options[:theme] ||= :none
            options[:html_attrs] ||= {}

            options[:html_attrs][:class] = Ariadne::ViewComponents.tailwind_merger.merge([style(:trailing_visual), options[:html_attrs][:class] || ""].join(" "))

            Ariadne::UI::Button::Component.new(**options)
          },
        }

        style(:trailing_visual) do
          base do
            [
              "araidne-pl-2",
              "ariadne-text-gray-400",
              "hover:ariadne-text-gray-500",
            ]
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.86.5 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.86.4 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.86.3 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.86.2 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.86.1 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.86 app/components/ariadne/layout/label_block/component.rb