File size: 991 Bytes
24d78ad 3f219b5 24d78ad |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
defmodule Storybook.CoreComponents.Flash do
use PhoenixStorybook.Story, :component
alias MedicodeWeb.CoreComponents
def function, do: &CoreComponents.flash/1
def imports, do: [{CoreComponents, [button: 1, show: 1]}]
def template do
"""
<.button phx-click={show("#:variation_id")} psb-code-hidden>
Open flash
</.button>
<.psb-variation/>
"""
end
def variations do
[
%Variation{
id: :info_no_title,
attributes: %{
kind: :info,
hidden: true
},
slots: ["Info message"]
},
%Variation{
id: :error_with_title,
attributes: %{
kind: :error,
hidden: true,
title: "Flash title"
},
slots: ["Error message"]
},
%Variation{
id: :no_close_button,
attributes: %{
kind: :info,
hidden: true,
close: false
},
slots: ["Info message"]
}
]
end
end
|