mirror of
https://github.com/we-promise/sure.git
synced 2026-04-14 01:24:06 +00:00
Start and end balance breakdown in activity view (#2466)
* Initial data objects * Remove trend calculator * Fill in balance reconciliation for entry group * Initial tooltip component * Balance trends in activity view * Lint fixes * trade partial alignment fix * Tweaks to balance calculation to acknowledge holdings value better * More lint fixes * Bump brakeman dep * Test fixes * Remove unused class
This commit is contained in:
32
test/components/previews/tooltip_component_preview.rb
Normal file
32
test/components/previews/tooltip_component_preview.rb
Normal file
@@ -0,0 +1,32 @@
|
||||
class TooltipComponentPreview < ViewComponent::Preview
|
||||
# @param text text
|
||||
# @param placement select [top, right, bottom, left]
|
||||
# @param offset number
|
||||
# @param cross_axis number
|
||||
# @param icon text
|
||||
# @param size select [xs, sm, md, lg, xl, 2xl]
|
||||
# @param color select [default, white, success, warning, destructive, current]
|
||||
def default(text: "This is helpful information", placement: "top", offset: 10, cross_axis: 0, icon: "info", size: "sm", color: "default")
|
||||
render DS::Tooltip.new(
|
||||
text: text,
|
||||
placement: placement,
|
||||
offset: offset,
|
||||
cross_axis: cross_axis,
|
||||
icon: icon,
|
||||
size: size,
|
||||
color: color
|
||||
)
|
||||
end
|
||||
|
||||
def with_block_content
|
||||
render DS::Tooltip.new(icon: "help-circle", color: "warning") do
|
||||
tag.div do
|
||||
tag.p("Custom content with formatting:", class: "font-medium mb-1") +
|
||||
tag.ul(class: "list-disc list-inside text-xs") do
|
||||
tag.li("First item") +
|
||||
tag.li("Second item")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user