Class: Playbook::PbCurrency::Currency
- Inherits:
-
KitBase
- Object
- ViewComponent::Base
- KitBase
- Playbook::PbCurrency::Currency
show all
- Defined in:
- app/pb_kits/playbook/pb_currency/currency.rb
Instance Method Summary
collapse
Methods inherited from KitBase
#object
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
#initialize, #prop
#pb_rails
#pb_form_with
Instance Method Details
#body_props ⇒ Object
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
|
#classname ⇒ Object
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_props ⇒ Object
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_class ⇒ Object
66
67
68
|
# File 'app/pb_kits/playbook/pb_currency/currency.rb', line 66
def emphasized_class
emphasized ? "" : "_deemphasized"
end
|
#title_props ⇒ Object
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_class ⇒ Object
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
|