Add storybook page for button (#4978)

* Add storybook page for button

* Remove irrelevant comments

* Add disabled button
This commit is contained in:
Uku Taht 2025-02-12 16:14:19 +02:00 committed by GitHub
parent 9f1d8ec2b7
commit 53340d1f36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 43 additions and 2 deletions

View File

@ -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

View File

@ -2,9 +2,7 @@ defmodule PlausibleWeb.Storybook.Input do
@moduledoc false @moduledoc false
use PhoenixStorybook.Story, :component use PhoenixStorybook.Story, :component
# required
def function, do: &PlausibleWeb.Live.Components.Form.input/1 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 attributes, do: []
def slots, do: [] def slots, do: []