Class: Playbook::PbCurrency::Currency

Inherits:
KitBase
  • Object
show all
Defined in:
app/pb_kits/playbook/pb_currency/currency.rb

Instance Method Summary collapse

Methods inherited from KitBase

#object

Methods included from NumberSpacing

included

Methods included from ZIndex

included

Methods included from Spacing

included, #max_width_options, #max_width_props, #max_width_values, #spacing_options, #spacing_props, #spacing_values

Methods included from Classnames

#generate_classname, #generate_classname_without_spacing, included

Methods included from Playbook::Props

#initialize, #prop

Methods included from Playbook::PbKitHelper

#pb_rails

Methods included from Playbook::PbFormsHelper

#pb_form_with

Instance Method Details

#body_propsObject



57
58
59
60
61
62
63
64
# File 'app/pb_kits/playbook/pb_currency/currency.rb', line 57

def body_props
  {
    text: units_element,
    color: "light",
    classname: "unit",
    dark: dark,
  }
end

#classnameObject



36
37
38
# File 'app/pb_kits/playbook/pb_currency/currency.rb', line 36

def classname
  generate_classname("pb_currency_kit", align, size, dark_class)
end

#currency_wrapper_propsObject



40
41
42
43
44
45
46
# File 'app/pb_kits/playbook/pb_currency/currency.rb', line 40

def currency_wrapper_props
  {
    classname: "dollar_sign",
    color: "light",
    dark: dark,
  }
end

#emphasized_classObject



66
67
68
# File 'app/pb_kits/playbook/pb_currency/currency.rb', line 66

def emphasized_class
  emphasized ? "" : "_deemphasized"
end

#title_propsObject



48
49
50
51
52
53
54
55
# File 'app/pb_kits/playbook/pb_currency/currency.rb', line 48

def title_props
  {
    size: size_value,
    text: whole_value,
    classname: "pb_currency_value",
    dark: dark,
  }
end

#variant_classObject



70
71
72
73
74
75
76
77
78
79
# File 'app/pb_kits/playbook/pb_currency/currency.rb', line 70

def variant_class
  return unless size == "sm"

  case variant
  when "light"
    "_light"
  when "bold"
    "_bold"
  end
end