Class: Playbook::PbButton::Button
- Inherits:
-
Object
- Object
- Playbook::PbButton::Button
show all
- Includes:
- Playbook::Props
- Defined in:
- app/pb_kits/playbook/pb_button/button.rb
Instance Method Summary
collapse
#dark_props, #generate_classname, #generate_classname_without_spacing, #initialize, #prop, #spacing_options, #spacing_props, #spacing_values
Instance Method Details
#link_options ⇒ Object
38
39
40
41
42
43
|
# File 'app/pb_kits/playbook/pb_button/button.rb', line 38
def link_options
options.merge(
href: link,
target: new_window ? "_blank" : "_self"
)
end
|
#options ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
|
# File 'app/pb_kits/playbook/pb_button/button.rb', line 26
def options
{
id: id,
data: data,
class: classname,
disabled: disabled,
aria: aria,
type: type,
value: value,
}.compact
end
|
#tag ⇒ Object
45
46
47
|
# File 'app/pb_kits/playbook/pb_button/button.rb', line 45
def tag
link ? "a" : "button"
end
|