# frozen_string_literal: true module Yattho module Beta # @label AvatarStack class AvatarStackPreview < ViewComponent::Preview # @label Playground # # @param number_of_avatars [Integer] number # @param tag select [["div", div], ["span", span]] # @param align select [["Left", left], ["Right", right]] # @param tooltipped toggle # @param tooltip_label text def playground(number_of_avatars: 1, tag: :div, align: :left, tooltipped: false, tooltip_label: "This is a tooltip!") render(Yattho::Beta::AvatarStack.new(tag: tag, align: align, tooltipped: tooltipped, body_arguments: { label: tooltip_label })) do |component| Array.new(number_of_avatars || 1) do component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") end end end # @label Default def default render(Yattho::Beta::AvatarStack.new) do |component| component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") end end # @!group Multiple avatars # # @label 1 avatar def avatar_1 render(Yattho::Beta::AvatarStack.new) do |component| component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") end end # @label 2 avatars def avatar_2 render(Yattho::Beta::AvatarStack.new) do |component| component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") end end # @label 3 avatars def avatar_3 render(Yattho::Beta::AvatarStack.new) do |component| component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") end end # @label 4 avatars def avatar_4 render(Yattho::Beta::AvatarStack.new) do |component| component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") end end # @label 5 avatars def avatar_5 render(Yattho::Beta::AvatarStack.new) do |component| component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") end end # # @!endgroup # @!group More options # # @label Align right def align_right render(Yattho::Beta::AvatarStack.new(align: :right)) do |component| component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") end end # @label With tooltip def with_tooltip render(Yattho::Beta::AvatarStack.new(tooltipped: true, body_arguments: { label: "This is a tooltip!" })) do |component| component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") component.with_avatar(src: Yattho::ExampleImage::BASE64_SRC, alt: "@kittenuser") end end # # @!endgroup end end end