<% add_gem_component_stylesheet("layout-header") add_gem_component_stylesheet("layout-super-navigation-header") logo_link ||= "https://www.gov.uk/" logo_link_title ||= t("components.layout_super_navigation_header.logo_link_title") logo_text = t("components.layout_super_navigation_header.logo_text") hide_logo_text ||= false hide_button_left_border ||= false blue_background ||= false large_navbar ||= false navigation_links_columns = t("components.layout_super_navigation_header.navigation_links_columns") navigation_menu_heading = t("components.layout_super_navigation_header.navigation_menu_heading") navigation_search_heading = t("components.layout_super_navigation_header.navigation_search_heading") navigation_search_subheading = t("components.layout_super_navigation_header.navigation_search_subheading") popular_links = t("components.layout_super_navigation_header.popular_links") popular_links_heading = t("components.layout_super_navigation_header.popular_links_heading") search_text = t("components.layout_super_navigation_header.search_text") hide_search_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.hide", :label => "search") show_search_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => "search") hide_navigation_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.hide", :label => "navigation") show_navigation_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => "navigation") top_toggle_button_classes = %w(gem-c-layout-super-navigation-header__navigation-top-toggle-button ) top_toggle_button_classes << "gem-c-layout-super-navigation-header__navigation-top-toggle-button--blue-background" if blue_background top_toggle_button_classes << "gem-c-layout-super-navigation-header__navigation-top-toggle-button--large-navbar" if large_navbar top_toggle_button_inner_classes = %w(gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner) top_toggle_button_inner_classes << "gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner--no-left-border" if hide_button_left_border top_toggle_button_inner_classes << "gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner--blue-background" if blue_background search_toggle_button_classes = %w(gem-c-layout-super-navigation-header__search-toggle-button) search_toggle_button_classes << "gem-c-layout-super-navigation-header__search-toggle-button--blue-background" if blue_background search_toggle_button_classes << "gem-c-layout-super-navigation-header__search-toggle-button--large-navbar" if large_navbar layout_super_navigation_header_classes = %w(gem-c-layout-super-navigation-header) layout_super_navigation_header_classes << "gem-c-layout-super-navigation-header--blue-background" if blue_background item_link_classes = %w(gem-c-layout-super-navigation-header__navigation-item-link) item_link_classes << "gem-c-layout-super-navigation-header__navigation-item-link--blue-background" if blue_background item_link_classes << "gem-c-layout-super-navigation-header__navigation-item-link--large-navbar" if large_navbar item_link_inner_classes = %w( gem-c-layout-super-navigation-header__navigation-item-link-inner ) item_link_inner_classes << "gem-c-layout-super-navigation-header__navigation-item-link-inner--blue-background" if blue_background search_item_link_classes = %w(gem-c-layout-super-navigation-header__search-item-link) search_item_link_classes << "gem-c-layout-super-navigation-header__search-item-link--blue-background" if blue_background search_item_link_classes << "gem-c-layout-super-navigation-header__search-item-link--large-navbar" if large_navbar header_logo_classes = %w(gem-c-layout-super-navigation-header__header-logo) header_logo_classes << "gem-c-layout-super-navigation-header__header-logo--large-navbar" if large_navbar logotype_classes = %w(govuk-header__logotype-crown gem-c-layout-super-navigation-header__logotype-crown) logotype_classes << "gem-c-layout-super-navigation-header__logotype-crown--large-navbar" if large_navbar header_link_classes = %w(govuk-header__link govuk-header__link--homepage) header_link_classes << "gem-c-header__link--large-navbar" if large_navbar button_container_classes = %w(gem-c-layout-super-navigation-header__button-container) button_container_classes << "gem-c-layout-super-navigation-header__button-container--large-navbar" if large_navbar %> <%= content_tag("header", { role: "banner", class: layout_super_navigation_header_classes, data: { module: "gem-track-click ga4-event-tracker ga4-link-tracker", "track-links-only": '', "ga4-expandable": '', } }) do %>
<%= content_tag(:div, { class: header_logo_classes }) do %> <%= link_to logo_link, { class: header_link_classes, data: { "track-action": "logoLink", "track-category": "headerClicked", "track-label": logo_link, "track-dimension": logo_text, "track-dimension-index": "29", "ga4-link": { "event_name": "navigation", "type": "header menu bar", "external": "false", "text": "GOV.UK", "section": "Logo", "index": { "index_link": 1, "index_section": 0, "index_section_count": 2, }, "index_total": 1 }.to_json }, id: "logo", aria: { label: logo_link_title, } } do %> <%= content_tag(:svg, { aria: { hidden: true, }, class: logotype_classes, height: "30", width: "36", focusable: "false", viewBox: "0 0 132 97", xmlns: "http://www.w3.org/2000/svg", }) do %> <% end %> <% unless hide_logo_text %> <%= logo_text %> <% end %> <% end %> <% end %>
<% end %>