<%= render Primer::BaseComponent.new(**@system_arguments) do %> <%= show_button %> <%= render(@dialog) do %> <%= render Primer::Alpha::Dialog::Header.new(id: "#{@panel_id}-dialog", title: @title, show_divider: show_filter?) do |header| %> <% if subtitle? %> <% header.with_subtitle do %> <%= subtitle %> <% end %> <% end %> <% if show_filter? %> <% header.with_filter do %> <%= render(Primer::BaseComponent.new( tag: :"remote-input", aria: { owns: @body_id }, **(@fetch_strategy == :remote ? { src: @src } : {}), data: { target: "select-panel.remoteInput" } )) do %> <%= render(Primer::Alpha::TextField.new( id: "#{@panel_id}-filter", name: :filter, label: "Filter", type: :search, leading_visual: { icon: :search }, leading_spinner: true, autofocus: true, visually_hide_label: true, data: { target: "select-panel.filterInputTextField" }, label_arguments: { position: :absolute } )) %> <% end %> <% end %> <% end %> <% end %> <%= render Primer::Alpha::Dialog::Body.new(mt: show_filter? ? 0 : 2, p: 0) do %> <%= render(Primer::BaseComponent.new( tag: :div, data: { fetch_strategy: @fetch_strategy, target: "select-panel.list" } )) do %>
<% if @src.present? %> <%= render(Primer::ConditionalWrapper.new(condition: @fetch_strategy == :eventually_local, tag: "include-fragment", data: { target: "select-panel.includeFragment" }, src: @src, loading: preload? ? "eager" : "lazy", accept: "text/fragment+html")) do %> <%= render(Primer::BaseComponent.new( tag: :div, id: "#{@panel_id}-list", mt: 2, mb: 2, aria: { disabled: true, busy: true }, display: :flex, align_items: :flex_start, justify_content: :center, text_align: :center, classes: "SelectPanel-loadingPanel" )) do %>
<%= render Primer::Beta::Spinner.new(aria: { label: @loading_label, describedby: @loading_description_id }, data: { target: "select-panel.bodySpinner" }) %> <% if @loading_description.present? %> <% end %>
<% end %> <% end %> <% else %> <%= render(@list) %> <% end %>
<% end %>
<% end %> <%= footer %> <% end %>
<% end %>