Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/components/previews/pajamas/card_component_preview.rb')
-rw-r--r--spec/components/previews/pajamas/card_component_preview.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/components/previews/pajamas/card_component_preview.rb b/spec/components/previews/pajamas/card_component_preview.rb
new file mode 100644
index 00000000000..61d1f8db9e1
--- /dev/null
+++ b/spec/components/previews/pajamas/card_component_preview.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+module Pajamas
+ class CardComponentPreview < ViewComponent::Preview
+ # Card
+ # ----
+ # See its design reference [here](https://design.gitlab.com/components/card).
+ #
+ # @param header text
+ # @param body textarea
+ # @param footer text
+ def default(header: nil, body: "Every card has a body.", footer: nil)
+ render(Pajamas::CardComponent.new) do |c|
+ if header
+ c.with_header { header }
+ end
+
+ c.with_body do
+ content_tag(:p, body)
+ end
+
+ if footer
+ c.with_footer { footer }
+ end
+ end
+ end
+ end
+end