16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'app/helpers/wilday_ui/components/button/features/animation.rb', line 16
def setup_animation_options(options, additional_classes, animation, wrapper_data)
return unless animation.present?
animation_config = normalize_animation_options(animation)
options[:data] ||= {}
options[:data][:animation] = animation_config.to_json
options[:data][:controller] = "animation"
options[:data][:animation_target] = "button"
options[:data][:action] = FEATURE_CONFIG[:default_stimulus_action]
additional_classes = [
additional_classes,
"w-button-animated",
"w-button-animation-#{animation_config[:name]}",
"w-button-animation-trigger-#{animation_config[:trigger]}"
].compact.join(" ")
end
|