Class: Primer::Beta::ProgressBar
- Defined in:
 - app/components/primer/beta/progress_bar.rb
 
Overview
Use ‘ProgressBar` to visualize task completion.
Constant Summary collapse
- SIZE_DEFAULT =
 :default- SIZE_MAPPINGS =
 { SIZE_DEFAULT => "", :small => "Progress--small", :large => "Progress--large" }.freeze
- SIZE_OPTIONS =
 SIZE_MAPPINGS.keys
Constants inherited from Component
Component::INVALID_ARIA_LABEL_TAGS
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Constants included from AttributesHelper
AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Method Summary collapse
- 
  
    
      #initialize(size: SIZE_DEFAULT, **system_arguments)  ⇒ ProgressBar 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of ProgressBar.
 - #render? ⇒ Boolean
 
Methods inherited from Component
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Methods included from AttributesHelper
#aria, #data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes
Constructor Details
#initialize(size: SIZE_DEFAULT, **system_arguments) ⇒ ProgressBar
Returns a new instance of ProgressBar.
      36 37 38 39 40 41 42 43 44  | 
    
      # File 'app/components/primer/beta/progress_bar.rb', line 36 def initialize(size: SIZE_DEFAULT, **system_arguments) @system_arguments = deny_tag_argument(**system_arguments) @system_arguments[:classes] = class_names( @system_arguments[:classes], "Progress", SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, SIZE_DEFAULT)] ) @system_arguments[:tag] = :span end  | 
  
Instance Method Details
#render? ⇒ Boolean
      46 47 48  | 
    
      # File 'app/components/primer/beta/progress_bar.rb', line 46 def render? items? end  |