Sha256: c9ebf1e3d734c8d20a9e474d9dda670580caa6a177cf67499d5f77aed6474daa

Contents?: true

Size: 1.1 KB

Versions: 11

Compression:

Stored size: 1.1 KB

Contents

# typed: false
# frozen_string_literal: true

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

        accepts_html_attributes do |html_attrs|
        end

        # 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

11 entries across 11 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.92 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.91 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.90 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.89.1 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.89 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.88 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.87 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.86.9 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.86.8 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.86.7 app/components/ariadne/layout/label_block/component.rb
ariadne_view_components-0.0.86.6 app/components/ariadne/layout/label_block/component.rb