<%= content_tag(:div, id: object.id, data: object.data, class: object.classname, **combined_html_options) do %> <% if layout_option == "number" %> <% case object.size %> <% when "xs", "sm" %> <%= pb_rails("caption", props: { text: object.one_decimal_rating, size: "xs", classname: "pb_star_rating_number_#{size}", dark: dark, padding_right: "xxs" }) %> <% when "md" %> <%= pb_rails("body", props: { text: object.one_decimal_rating, dark: dark, color: "light", classname: "pb_star_rating_number_#{size}", padding_right: "xxs" }) %> <% when "lg" %> <%= pb_rails("title", props: { text: object.one_decimal_rating, size: 2, dark: dark, color: "light", bold: false, classname: "pb_star_rating_number_#{size}", padding_right: "sm" }) %> <% end %> <% end %> <%= pb_rails("flex", props: { }) do %> <% if object.variant == "display" %> <% object.star_count.times do %> <%= pb_rails("icon", props: { classname: "#{star_color} pb_star_#{size}" , custom_icon: Playbook::Engine.root.join(star_svg_path) } ) %> <% end %> <% object.empty_stars.times do %> <%= pb_rails("icon", props: { classname: "#{background_star_color} pb_star_#{size}", custom_icon: Playbook::Engine.root.join(background_star_path) } ) %> <% end %> <% else %> <%= pb_rails("flex", props: { orientation: "column" }) do %> <% if object.label.present? %> <%= pb_rails("caption", props: {text: object.label, margin_bottom:"xs"}) %> <% end %> <%= pb_rails("flex", props: { orientation: "row" }) do %> <% object.denominator.times do |index| %>
<%= pb_rails("icon", props: { classname: "#{background_star_color} pb_star_#{size} interactive-star-icon", custom_icon: Playbook::Engine.root.join(background_star_path), tabindex: 0 } ) %>
<% end %> <% end %> <% end %> <% end %> <% end %> <% if layout_option == "onestar" %> <%= content_tag(:div, class: "pb_star_rating_number_#{size}") do %> <% case object.size %> <% when "xs", "sm" %> <%= pb_rails("caption", props: { text: "#{object.rating} of #{object.denominator}", size: "xs", dark: dark, padding_left: "xxs" }) %> <% when "md" %> <%= pb_rails("body", props: { text: "#{object.rating} of #{object.denominator}", dark: dark, color: "light", padding_left: "xxs" }) %> <% when "lg" %> <%= pb_rails("title", props: { text: "#{object.rating} of #{object.denominator}", size: 2, color: "light", bold: false, dark: dark }) %> <% end %> <% end %> <% end %> <% end %>