app/components/coco/app/elements/alert/alert.rb in coveragebook_components-0.7.10 vs app/components/coco/app/elements/alert/alert.rb in coveragebook_components-0.8.0.beta.1
- old
+ new
@@ -20,10 +20,12 @@
accepts_option :dismissable, from: [true, false], default: false
accepts_option :banner, from: [true, false], default: false
accepts_option :theme, from: THEMES, default: "info"
accepts_option :single_line, from: [true, false]
+ accepts_option :cloak, from: [true, false], default: true, private: true
+ accepts_option :condensed, from: [true, false], default: false
renders_one :title
renders_one :action, ->(*args, **kwargs, &block) do
theme = vivid? ? "neutral-dark" : get_option_value(:theme)
@@ -56,16 +58,24 @@
def single_line?
get_option_value(:single_line)
end
+ def cloak?
+ get_option_value(:cloak)
+ end
+
def vivid?
theme = get_option_value(:theme)
theme.to_s.match?(/vivid$/)
end
def unvividify(theme)
theme.to_s.match?(/vivid$/) ? theme.to_s.underscore.gsub("_vivid", "").to_sym : theme
+ end
+
+ def button_size
+ get_option_value(:condensed) ? :xs : :sm
end
end
end
end
end