summaryrefslogtreecommitdiff
path: root/spec/components/previews/pajamas/spinner_component_preview.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/components/previews/pajamas/spinner_component_preview.rb')
-rw-r--r--spec/components/previews/pajamas/spinner_component_preview.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/components/previews/pajamas/spinner_component_preview.rb b/spec/components/previews/pajamas/spinner_component_preview.rb
new file mode 100644
index 00000000000..149bfddcfc2
--- /dev/null
+++ b/spec/components/previews/pajamas/spinner_component_preview.rb
@@ -0,0 +1,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