Sha256: dd973408073f9df5dfa8fc6efbf2305ddf32dceb5c5c99a6444634a0ef977c57

Contents?: true

Size: 1.41 KB

Versions: 34

Compression:

Stored size: 1.41 KB

Contents

# typed: false
# frozen_string_literal: true

module Ariadne
  module UI
    module Overlay
      class Component < Ariadne::BaseComponent
        renders_one :trigger, Ariadne::UI::Button::Component

        accepts_html_attributes do |html_attrs|
          html_attrs[:data] = {
            controller: [stimulus_name, html_attrs.fetch(:data, {}).fetch(:controller, nil)].compact.join(" "),
            "#{stimulus_name}-placement-value": placement,
            "#{stimulus_name}-clamped-value": clamped,
          }
        end
        option :size, default: proc { :base }
        option :placement, default: proc { "bottom" }

        option :clamped, default: proc { false }

        style do
          base do
            [
              "ariadne-fixed",
              "ariadne-max-w-[90vw]",
              "ariadne-z-20",

              "ariadne-scroll",
              "ariadne-scrollbar-trigger",

              "ariadne-rounded-lg",
              "ariadne-shadow-lg",

              "ariadne-bg-foreground",
              "dark:ariadne-bg-foreground-dark",
              "ariadne-text-content",
              "dark:ariadne-text-content-dark",
            ]
          end

          variants do
            size do
              sm { "ariadne-w-36" }
              md { "ariadne-w-52" }
              base { "ariadne-w-64" }
              lg { "ariadne-w-96" }
            end
          end
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.93.2 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.93.1 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.93 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.92 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.91 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.90 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.89.1 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.89 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.88 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.87 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.86.9 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.86.8 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.86.7 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.86.6 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.86.5 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.86.4 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.86.3 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.86.2 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.86.1 app/components/ariadne/ui/overlay/component.rb
ariadne_view_components-0.0.86 app/components/ariadne/ui/overlay/component.rb