Sha256: ea6f10f9ac186585ba6c3fa291cf6d89dbb7c4ea008dba3e321b15737c8d673c

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

# typed: false
# frozen_string_literal: true

module Ariadne
  module Layout
    module Grid
      module Item
        class Component < Ariadne::BaseComponent
          # TODO: make this standard
          accepts_html_attributes do |html_attrs|
            html_attrs[:class] = if html_attrs[:class] == :remove
              "" # user asked for no styling
            else
              Ariadne::ViewComponents.tailwind_merger.merge([style(:item), html_attrs[:class]].join(" "))
            end
          end

          style :item do
            base do
              [
                "ariadne-flex",
                "ariadne-flex-col",
                "ariadne-gap-3",
                "ariadne-p-3",
                "ariadne-ps-4",
                "ariadne-rounded-xl",
                "ariadne-border",
                "ariadne-border-black/10",
                "dark:ariadne-border-white/10",
                "ariadne-bg-white",
                "dark:ariadne-bg-zinc-950",
                "hover:ariadne-shadow-lg",
                "ariadne-transition-shadow",
              ]
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.73 app/components/ariadne/layout/grid/item/component.rb
ariadne_view_components-0.0.72 app/components/ariadne/layout/grid/item/component.rb