From f89062b8ffc0e19a4441d282e5402ffa6bdf85c5 Mon Sep 17 00:00:00 2001 From: Mathias Polligkeit Date: Sat, 16 Dec 2023 13:37:36 +0900 Subject: [PATCH] add story for icon component --- priv/storybook/components/icon.story.exs | 82 ++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 priv/storybook/components/icon.story.exs diff --git a/priv/storybook/components/icon.story.exs b/priv/storybook/components/icon.story.exs new file mode 100644 index 00000000..1ff60830 --- /dev/null +++ b/priv/storybook/components/icon.story.exs @@ -0,0 +1,82 @@ +defmodule Storybook.Components.Icon do + use PhoenixStorybook.Story, :component + + def function, do: &Doggo.icon/1 + + def svg do + """ + + """ + end + + def variations do + [ + %Variation{ + id: :default, + attributes: %{}, + slots: [svg()] + }, + %VariationGroup{ + id: :sizes, + variations: [ + %Variation{ + id: :small, + attributes: %{size: :small}, + slots: [svg()] + }, + %Variation{ + id: :normal, + attributes: %{size: :normal}, + slots: [svg()] + }, + %Variation{ + id: :medium, + attributes: %{size: :medium}, + slots: [svg()] + }, + %Variation{ + id: :large, + attributes: %{size: :large}, + slots: [svg()] + } + ] + }, + %VariationGroup{ + id: :label, + variations: [ + %Variation{ + id: :left, + attributes: %{label: "info", label_placement: :left}, + slots: [svg()] + }, + %Variation{ + id: :right, + attributes: %{label: "info", label_placement: :right}, + slots: [svg()] + }, + %Variation{ + id: :hidden, + attributes: %{label: "info", label_placement: :hidden}, + slots: [svg()] + } + ] + } + ] + end +end