Sha256: 35306db5f014332a166300df35d2a7e575ee8a46ccee3afb59e8ae1a6cd6b7d7

Contents?: true

Size: 1.08 KB

Versions: 7

Compression:

Stored size: 1.08 KB

Contents

<%
  add_gem_component_stylesheet("success-alert")

  description ||= nil
  title_id ||= "govuk-notification-banner-title-#{SecureRandom.hex(4)}"

  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
  component_helper.add_class("gem-c-success-alert govuk-notification-banner govuk-notification-banner--success")
  component_helper.add_role("alert")
  component_helper.set_tabindex(-1)
  component_helper.add_aria_attribute({ labelledby: title_id })
  component_helper.add_data_attribute({ module: "initial-focus" })
%>

<%= tag.div(**component_helper.all_attributes) do %>
  <div class="govuk-notification-banner__header">
    <%= tag.h2 t("components.success_alert.success"), class: "govuk-notification-banner__title", id: title_id %>
  </div>
  <div class="govuk-notification-banner__content">
    <% if description.present? %>
      <%= tag.h3 message, class: "govuk-notification-banner__heading" %>
      <%= description %>
    <% else %>
      <%= tag.p message, class: "govuk-body gem-c-success-alert__message" %>
    <% end %>
  </div>
<% end %>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
govuk_publishing_components-51.1.0 app/views/govuk_publishing_components/components/_success_alert.html.erb
govuk_publishing_components-51.0.0 app/views/govuk_publishing_components/components/_success_alert.html.erb
govuk_publishing_components-50.0.1 app/views/govuk_publishing_components/components/_success_alert.html.erb
govuk_publishing_components-50.0.0 app/views/govuk_publishing_components/components/_success_alert.html.erb
govuk_publishing_components-49.1.0 app/views/govuk_publishing_components/components/_success_alert.html.erb
govuk_publishing_components-49.0.0 app/views/govuk_publishing_components/components/_success_alert.html.erb
govuk_publishing_components-48.0.0 app/views/govuk_publishing_components/components/_success_alert.html.erb