Sha256: 5c1682f0da19bfcfd287408fc0aeaaa131a0b14dd452347a5b0c5ef82c8d590a

Contents?: true

Size: 786 Bytes

Versions: 2

Compression:

Stored size: 786 Bytes

Contents

<%
  add_gem_component_stylesheet("inset-text")

  id ||= "inset-text-#{SecureRandom.hex(4)}"
  margin_top ||= 6
  margin_bottom ||= 6

  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new({
    margin_top: margin_top,
    margin_bottom: margin_bottom
  })

  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
  component_helper.add_class("gem-c-inset-text govuk-inset-text gem-c-print-links-within")
  component_helper.add_class(shared_helper.get_margin_top)
  component_helper.add_class(shared_helper.get_margin_bottom)
  component_helper.set_id(id)
%>
<%= tag.div(**component_helper.all_attributes) do %>
  <% if defined? text %>
    <%= text %>
  <% elsif block_given? %>
    <%= yield %>
  <% end %>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
govuk_publishing_components-45.4.0 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-45.3.0 app/views/govuk_publishing_components/components/_inset_text.html.erb