Sha256: f006104dd3aa46abfec219695b90f42201f4110f1a66fcae9bcd906fb7526738

Contents?: true

Size: 779 Bytes

Versions: 147

Compression:

Stored size: 779 Bytes

Contents

<%
  id ||= "warning-text-#{SecureRandom.hex(4)}"
  text_assistive ||= 'Warning'
  text_icon ||= '!'
  large_font ||= false
  highlight_text ||= false

  text_classes = %w(govuk-warning-text__text)
  text_classes << "gem-c-warning-text__text--no-indent" if text_icon.empty?
  text_classes << "gem-c-warning-text__text--large" if large_font
  text_classes << "gem-c-warning-text__text--highlight" if highlight_text
%>

<%= tag.div id: id, class: "gem-c-warning-text govuk-warning-text" do %>
  <% unless text_icon.empty? %>
    <%= tag.span text_icon, class: "govuk-warning-text__icon", "aria-hidden": "true" %>
  <% end %>
  <%= tag.strong class: text_classes do %>
    <%= tag.span text_assistive, class: "govuk-warning-text__assistive" %>
    <%= text %>
  <% end %>
<% end %>

Version data entries

147 entries across 147 versions & 1 rubygems

Version Path
govuk_publishing_components-21.3.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-21.2.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-21.1.1 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-21.1.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-21.0.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-20.5.2 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-20.5.1 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-20.5.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-20.4.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-20.3.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-20.2.2 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-20.2.1 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-20.2.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-20.1.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-20.0.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-19.0.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-18.3.1 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-18.3.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-18.2.0 app/views/govuk_publishing_components/components/_warning_text.html.erb
govuk_publishing_components-18.1.2 app/views/govuk_publishing_components/components/_warning_text.html.erb