initialize

in app/components/primer/hidden_text_expander.rb [23:45]


    def initialize(inline: false, button_arguments: {}, **system_arguments)
      @system_arguments = deny_tag_argument(**system_arguments)
      @button_arguments = button_arguments

      @system_arguments[:tag] = :span
      @system_arguments[:classes] = class_names(
        "hidden-text-expander",
        @system_arguments[:classes],
        "inline" => inline
      )

      aria_label = system_arguments[:"aria-label"] || system_arguments.dig(:aria, :label) || @aria_label
      if aria_label.present?
        @button_arguments[:"aria-label"] = aria_label
        @system_arguments[:aria]&.delete(:label)
      end

      @button_arguments[:classes] = class_names(
        "ellipsis-expander",
        button_arguments[:classes]
      )
    end