Sha256: b129dbfd26c4addf2a576b1fefe834a3cf192fedc10961c934a6a338f5e03b27

Contents?: true

Size: 548 Bytes

Versions: 10

Compression:

Stored size: 548 Bytes

Contents

# frozen_string_literal: true

module Primer
  class FlexItemComponent < Primer::Component
    FLEX_AUTO_DEFAULT = false
    FLEX_AUTO_ALLOWED_VALUES = [FLEX_AUTO_DEFAULT, true]

    def initialize(flex_auto: FLEX_AUTO_DEFAULT, **kwargs)
      @kwargs = kwargs
      @kwargs[:classes] =
        class_names(
          @kwargs[:classes],
          "flex-auto" => fetch_or_fallback(FLEX_AUTO_ALLOWED_VALUES, flex_auto, FLEX_AUTO_DEFAULT)
        )
    end

    def call
      render(Primer::BoxComponent.new(**@kwargs)) { content }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
primer_view_components-0.0.12 app/components/primer/flex_item_component.rb
primer_view_components-0.0.11 app/components/primer/flex_item_component.rb
primer_view_components-0.0.10 app/components/primer/flex_item_component.rb
primer_view_components-0.0.9 app/components/primer/flex_item_component.rb
primer_view_components-0.0.8 app/components/primer/flex_item_component.rb
primer_view_components-0.0.7 app/components/primer/flex_item_component.rb
primer_view_components-0.0.6 app/components/primer/flex_item_component.rb
primer_view_components-0.0.5 app/components/primer/flex_item_component.rb
primer_view_components-0.0.4 app/components/primer/flex_item_component.rb
primer_view_components-0.0.3 app/components/primer/flex_item_component.rb