Sha256: 7f130ccdc07028e35f49d3437ac9e2ba5b5c4b26c371b9d08ae7ebb619105d24

Contents?: true

Size: 710 Bytes

Versions: 6

Compression:

Stored size: 710 Bytes

Contents

# frozen_string_literal: true

module Primer
  # The Text component is a wrapper component that will apply typography styles to the text inside.
  class TextComponent < Primer::Component
    # @example 70|Default
    #   <%= render(Primer::TextComponent.new(tag: :p, font_weight: :bold)) { "Bold Text" } %>
    #   <%= render(Primer::TextComponent.new(tag: :p, color: :red_5)) { "Red Text" } %>
    #
    # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
    def initialize(**system_arguments)
      @system_arguments = system_arguments
      @system_arguments[:tag] ||= :span
    end

    def call
      render(Primer::BaseComponent.new(**@system_arguments)) { content }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
primer_view_components-0.0.18 app/components/primer/text_component.rb
primer_view_components-0.0.17 app/components/primer/text_component.rb
primer_view_components-0.0.16 app/components/primer/text_component.rb
primer_view_components-0.0.15 app/components/primer/text_component.rb
primer_view_components-0.0.14 app/components/primer/text_component.rb
primer_view_components-0.0.13 app/components/primer/text_component.rb