Sha256: 55ac9e836f8fb9ee6b6819678234b025cce8b27b35a1fe2a665f4d6acafe2b5f

Contents?: true

Size: 1.59 KB

Versions: 3

Compression:

Stored size: 1.59 KB

Contents

<%
  banner_type = local_assigns[:type]&.to_s
  banner_classes = class_names(
    "hmcts-banner",
    local_assigns[:classes],
    { "hmcts-banner--#{banner_type}" => banner_type != "information" }
  )
%>
<%= tag.div(class: banner_classes) do %>
  <div class="hmcts-banner__message">
    <% if local_assigns[:iconFallbackText] %>
      <span class="hmcts-banner__assistive">
        <%= local_assigns[:iconFallbackText] %>
      </span>
    <% end %>
    <%= local_assigns[:html] || local_assigns[:text] %>
    <% if banner_type == "success" %>
      <svg class="hmcts-banner__icon" role="presentation" focusable="false" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 25 25" height="25" width="25">
        <path d="M25,6.2L8.7,23.2L0,14.1l4-4.2l4.7,4.9L21,2L25,6.2z"></path>
      </svg>
    <% end %>
    <% if banner_type == "warning" %>
      <svg class="hmcts-banner__icon" fill="currentColor" role="presentation" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" height="25" width="25">
        <path d="M25,6.2L8.7,23.2L0,14.1l4-4.2l4.7,4.9L21,2L25,6.2z"></path>
      </svg>
    <% end %>
    <% if banner_type == "information" %>
      <svg class="hmcts-banner__icon" fill="currentColor" role="presentation" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" height="25" width="25">
        <path d="M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8 C13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z"></path>
      </svg>
    <% end %>
  </div>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
govuk-design-system-rails-0.10.3 app/views/components/_hmcts_banner.html.erb
govuk-design-system-rails-0.10.2 app/views/components/_hmcts_banner.html.erb
govuk-design-system-rails-0.10.1 app/views/components/_hmcts_banner.html.erb