Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Add storybook page for button (#4978)

Uku Taht53340d1f363d
diff --git a/storybook/button.story.exs b/storybook/button.story.exs
new file mode 100644
index 0000000000..99eb04e951
--- /dev/null
+++ b/storybook/button.story.exs
@@ -0,0 +1,43 @@
+defmodule PlausibleWeb.Storybook.Button do
+ @moduledoc false
+ use PhoenixStorybook.Story, :component
+
+ def function, do: &PlausibleWeb.Components.Generic.button/1
+
+ def attributes, do: []
+ def slots, do: []
+
+ def variations do
+ [
+ %Variation{
+ id: :default,
+ description: "Primary button",
+ slots: ["Click me!"]
+ },
+ %Variation{
+ id: :disabled,
+ description: "Disabled button",
+ attributes: %{
+ "disabled" => "true"
+ },
+ slots: ["Click me!"]
+ },
+ %Variation{
+ id: :bright,
+ description: "Bright button",
+ attributes: %{
+ "theme" => "bright"
+ },
+ slots: ["Click me!"]
+ },
+ %Variation{
+ id: :danger,
+ description: "Danger button",
+ attributes: %{
+ "theme" => "danger"
+ },
+ slots: ["Click me!"]
+ }
+ ]
+ end
+end
diff --git a/storybook/input.story.exs b/storybook/input.story.exs
index aacad78fbc..33a45a2586 100644
--- a/storybook/input.story.exs
+++ b/storybook/input.story.exs
@@ -2,9 +2,7 @@ defmodule PlausibleWeb.Storybook.Input do
@moduledoc false
use PhoenixStorybook.Story, :component
- # required
def function, do: &PlausibleWeb.Live.Components.Form.input/1
- # def imports, do: [{PlausibleWeb.Components.Generic, dropdown_item: 1, dropdown_divider: 1}]
def attributes, do: []
def slots, do: []