summaryrefslogtreecommitdiff
path: root/spec/components/previews/pajamas/spinner_component_preview.rb
blob: 149bfddcfc280074cc2ebf24911dc5ac4424e522 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true
module Pajamas
  class SpinnerComponentPreview < ViewComponent::Preview
    # Spinner
    # ----
    # See its design reference [here](https://design.gitlab.com/components/spinner).
    #
    # @param inline toggle
    # @param label text
    # @param size select [[small, sm], [medium, md], [large, lg], [extra large, xl]]
    def default(inline: false, label: "Loading", size: :md)
      render(Pajamas::SpinnerComponent.new(inline: inline, label: label, size: size))
    end

    # Use a light spinner on dark backgrounds
    #
    # @display bg_color "#222"
    def light
      render(Pajamas::SpinnerComponent.new(color: :light))
    end
  end
end