<%= tag.div data: { controller: "DS--popover", DS__popover_placement_value: placement, DS__popover_offset_value: offset, DS__popover_mobile_fullwidth_value: mobile_fullwidth, testid: testid } do %> <% if variant == :icon %> <%= render DS::Button.new(variant: "icon", icon: icon, aria_label: trigger_aria_label, aria: { haspopup: "dialog", expanded: "false", controls: panel_id }, data: { DS__popover_target: "button" }) %> <% elsif variant == :button %> <%= button %> <% elsif variant == :avatar %> <%# Avatar trigger needs an explicit accessible name — the inner avatar image is decorative. Caller must pass `aria_label:` or the fallback `ds.popover.avatar_default_label` is used. %> <% end %> <% end %>