Previews

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
list = Primer::Alpha::ActionList.new(aria: { label: "Action List" })
list.with_avatar_item(
username: username,
truncate_label: truncate_label,
src: src,
size: size,
scheme: scheme,
disabled: disabled,
full_name: full_name,
full_name_scheme: full_name_scheme,
active: active,
expanded: expanded,
id: "tooltip-test",
avatar_arguments: { shape: shape }
) do |item|
if trailing_visual_icon && trailing_visual_icon != :none
item.with_trailing_visual_icon(icon: trailing_visual_icon)
elsif trailing_visual_label
item.with_trailing_visual_label { trailing_visual_label }
elsif trailing_visual_counter
item.with_trailing_visual_counter(count: trailing_visual_counter)
elsif trailing_visual_text
item.with_trailing_visual_text(trailing_visual_text)
end
item.with_private_trailing_action_icon(icon: private_trailing_action_icon) if private_trailing_action_icon && private_trailing_action_icon != :none
item.with_trailing_action(icon: "plus", "aria-label": "Button tooltip", size: :medium) if trailing_action && trailing_action != :none
item.with_tooltip(text: "Tooltip text", for_id: "tooltip-test", type: :description) if tooltip
end
render(list)