Sha256: 4ab01c0985087b710df9de4c308a4634f56d3662e4bdfda8284bd7d0947b8154
Contents?: true
Size: 1.68 KB
Versions: 6
Compression:
Stored size: 1.68 KB
Contents
<% add_gem_component_stylesheet("big-number") big_number_helper = GovukPublishingComponents::Presenters::BigNumberHelper.new(local_assigns) number ||= false label ||= nil href ||= nil nested_data_attributes ||= nil value_classes = big_number_helper.value_classes component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns) component_helper.add_class("gem-c-big-number") %> <% if number %> <% big_number_value = capture do %> <%= tag.span class: value_classes, data: href ? nil : nested_data_attributes do %> <% # The below check is to account for small symbols awkwardly sitting above the baseline in our typeface and adjust them to sit at the baseline for the purpose of visual harmony # Currently the only small symbol used with big numbers are pluses so they are specifically applied in the below code %> <% if big_number_helper.number_has_plus_suffix? %> <%= number[0...-1] %><%= tag.span "+", class: "gem-c-big-number__suffix" %> <% else %> <%= number %> <% end %> <% end %> <% unless label.nil? %> <% # add a virtual space here to handle screen readers printing dictations without a space between the number and the label %> <span class="govuk-visually-hidden"> </span> <span class="gem-c-big-number__label"> <%= label %> </span> <% end %> <% end %> <%= tag.div(**component_helper.all_attributes) do %> <% unless href.nil? %> <%= link_to big_number_value, href, class: "govuk-link gem-c-big-number__link", data: nested_data_attributes %> <% else %> <%= big_number_value %> <% end %> <% end %> <% end %>
Version data entries
6 entries across 6 versions & 1 rubygems