Add storybook page for button (#4978)
* Add storybook page for button * Remove irrelevant comments * Add disabled button
This commit is contained in:
parent
9f1d8ec2b7
commit
53340d1f36
|
|
@ -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
|
||||||
|
|
@ -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: []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue