Sha256: 1577442f509a2012ba3f0811bbc22090cea383801b72dfd0fe62c931def2fa5f
Contents?: true
Size: 1.16 KB
Versions: 5
Compression:
Stored size: 1.16 KB
Contents
# frozen_string_literal: true module Primer module Alpha class ActionList # Group heading rendered above the group contents. class Divider < Primer::Component DEFAULT_SCHEME = :subtle SCHEME_MAPPINGS = { DEFAULT_SCHEME => nil, :filled => "ActionList-sectionDivider--filled" }.freeze SCHEME_OPTIONS = SCHEME_MAPPINGS.keys.freeze # @param scheme [Symbol] Display a background color if scheme is `filled`. # @param system_arguments [Hash] <%= link_to_system_arguments_docs %> def initialize(scheme: DEFAULT_SCHEME, **system_arguments) @system_arguments = system_arguments @system_arguments[:tag] = :li @system_arguments[:role] = :presentation @system_arguments[:'aria-hidden'] = true @scheme = fetch_or_fallback(SCHEME_OPTIONS, scheme, DEFAULT_SCHEME) @system_arguments[:classes] = class_names( "ActionList-sectionDivider", SCHEME_MAPPINGS[@scheme] ) end def call render(Primer::BaseComponent.new(**@system_arguments)) { content } end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems