Sha256: 7dbf78424463cabc5be471d71085df8c4ca757d75f9d2a6bdcd5f31ab39f1bec

Contents?: true

Size: 823 Bytes

Versions: 79

Compression:

Stored size: 823 Bytes

Contents

# frozen_string_literal: true

module Primer
  module Beta
    # `Text` is a wrapper component that will apply typography styles to the text inside.
    class Text < Primer::Component
      status :beta

      DEFAULT_TAG = :span

      # @example Default
      #   <%= render(Primer::Beta::Text.new(tag: :p, font_weight: :bold)) { "Bold Text" } %>
      #   <%= render(Primer::Beta::Text.new(tag: :p, color: :danger)) { "Danger Text" } %>
      #
      # @param tag [Symbol]
      # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
      def initialize(tag: DEFAULT_TAG, **system_arguments)
        @system_arguments = system_arguments
        @system_arguments[:tag] = tag
      end

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

Version data entries

79 entries across 79 versions & 2 rubygems

Version Path
primer_view_components-0.0.121 app/components/primer/beta/text.rb
primer_view_components-0.0.120 app/components/primer/beta/text.rb
primer_view_components-0.0.119 app/components/primer/beta/text.rb
primer_view_components-0.0.118 app/components/primer/beta/text.rb
primer_view_components-0.0.117 app/components/primer/beta/text.rb
primer_view_components-0.0.116 app/components/primer/beta/text.rb
primer_view_components-0.0.114 app/components/primer/beta/text.rb
primer_view_components-0.0.113 app/components/primer/beta/text.rb
primer_view_components-0.0.112 app/components/primer/beta/text.rb
primer_view_components-0.0.111 app/components/primer/beta/text.rb
primer_view_components-0.0.110 app/components/primer/beta/text.rb
primer_view_components-0.0.109 app/components/primer/beta/text.rb
primer_view_components-0.0.108 app/components/primer/beta/text.rb
primer_view_components-0.0.107 app/components/primer/beta/text.rb
primer_view_components-0.0.106 app/components/primer/beta/text.rb
primer_view_components-0.0.105 app/components/primer/beta/text.rb
primer_view_components-0.0.104 app/components/primer/beta/text.rb
primer_view_components-0.0.103 app/components/primer/beta/text.rb
primer_view_components-0.0.102 app/components/primer/beta/text.rb
primer_view_components-0.0.101 app/components/primer/beta/text.rb