diff --git a/.formatter.exs b/.formatter.exs index fddff073..65d6f696 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -2,7 +2,11 @@ [ plugins: [Phoenix.LiveView.HTMLFormatter], import_deps: [:phoenix, :phoenix_live_view], - inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{heex,ex,exs}"], + inputs: [ + "{mix,.formatter}.exs", + "{config,lib,test}/**/*.{heex,ex,exs}", + "priv/storybook/**/*.exs" + ], line_length: 80, locals_without_parens: [slot: 2] ] diff --git a/priv/storybook/components/action_bar.story.exs b/priv/storybook/components/action_bar.story.exs index 8524afe3..0a6c1e15 100644 --- a/priv/storybook/components/action_bar.story.exs +++ b/priv/storybook/components/action_bar.story.exs @@ -12,23 +12,23 @@ defmodule Storybook.Components.ActionBar do since Doggo does not ship with a default icon library. """, slots: [ - """ - <:item label="Edit" on_click={JS.push("edit")}> - Edit - - """, - """ - <:item label="Move" on_click={JS.push("move")}> - Move - - """, - """ - <:item label="Archive" on_click={JS.push("archive")}> - Archive - - """ + """ + <:item label="Edit" on_click={JS.push("edit")}> + Edit + + """, + """ + <:item label="Move" on_click={JS.push("move")}> + Move + + """, + """ + <:item label="Archive" on_click={JS.push("archive")}> + Archive + + """ ] } ] end -end \ No newline at end of file +end diff --git a/priv/storybook/components/app_bar.story.exs b/priv/storybook/components/app_bar.story.exs index f068e441..9b5f0ac9 100644 --- a/priv/storybook/components/app_bar.story.exs +++ b/priv/storybook/components/app_bar.story.exs @@ -15,23 +15,23 @@ defmodule Storybook.Components.AppBar do title: "Page title" }, slots: [ - """ - <:navigation label="Open menu" on_click={JS.push("toggle-menu")}> - Menu - - """, - """ - <:action label="Search" on_click={JS.push("search")}> - Search - - """, - """ - <:action label="Like" on_click={JS.push("like")}> - Like - - """ + """ + <:navigation label="Open menu" on_click={JS.push("toggle-menu")}> + Menu + + """, + """ + <:action label="Search" on_click={JS.push("search")}> + Search + + """, + """ + <:action label="Like" on_click={JS.push("like")}> + Like + + """ ] } ] end -end \ No newline at end of file +end diff --git a/priv/storybook/components/breadcrumb.story.exs b/priv/storybook/components/breadcrumb.story.exs index 0ef814ef..d2829cfd 100644 --- a/priv/storybook/components/breadcrumb.story.exs +++ b/priv/storybook/components/breadcrumb.story.exs @@ -8,9 +8,9 @@ defmodule Storybook.Components.Breadcrumb do %Variation{ id: :default, slots: [ - ~s(<:item patch="/categories">Categories), - ~s(<:item patch="/categories/1">Reviews), - ~s(<:item patch="/categories/1/articles/1">The Movie) + ~s(<:item patch="/categories">Categories), + ~s(<:item patch="/categories/1">Reviews), + ~s(<:item patch="/categories/1/articles/1">The Movie) ] } ] diff --git a/priv/storybook/components/button.story.exs b/priv/storybook/components/button.story.exs index 33b85f78..6ab72b64 100644 --- a/priv/storybook/components/button.story.exs +++ b/priv/storybook/components/button.story.exs @@ -48,7 +48,7 @@ defmodule Storybook.Components.Button do id: :danger_button, attributes: %{variant: :danger}, slots: ["danger"] - }, + } ] }, %VariationGroup{ @@ -118,4 +118,4 @@ defmodule Storybook.Components.Button do } ] end -end \ No newline at end of file +end diff --git a/priv/storybook/components/button_link.story.exs b/priv/storybook/components/button_link.story.exs index 4c26b4f2..02d0b373 100644 --- a/priv/storybook/components/button_link.story.exs +++ b/priv/storybook/components/button_link.story.exs @@ -48,7 +48,7 @@ defmodule Storybook.Components.ButtonLink do id: :danger_button, attributes: %{variant: :danger}, slots: ["danger"] - }, + } ] }, %VariationGroup{ @@ -118,4 +118,4 @@ defmodule Storybook.Components.ButtonLink do } ] end -end \ No newline at end of file +end diff --git a/priv/storybook/components/date.story.exs b/priv/storybook/components/date.story.exs index db6d0127..fce096b8 100644 --- a/priv/storybook/components/date.story.exs +++ b/priv/storybook/components/date.story.exs @@ -30,4 +30,4 @@ defmodule Storybook.Components.Date do } ] end -end \ No newline at end of file +end diff --git a/priv/storybook/components/datetime.story.exs b/priv/storybook/components/datetime.story.exs index fa8b8bca..16fdb1a1 100644 --- a/priv/storybook/components/datetime.story.exs +++ b/priv/storybook/components/datetime.story.exs @@ -30,7 +30,7 @@ defmodule Storybook.Components.Datetime do value: ~U[2023-02-05 12:22:06.003Z], precision: :minute } - }, + } ] end -end \ No newline at end of file +end diff --git a/priv/storybook/components/fallback.story.exs b/priv/storybook/components/fallback.story.exs index 1012f0a4..a483c886 100644 --- a/priv/storybook/components/fallback.story.exs +++ b/priv/storybook/components/fallback.story.exs @@ -32,7 +32,8 @@ defmodule Storybook.Components.Fallback do id: :with_nil, attributes: %{ value: nil, - formatter: &DateTime.to_unix/1} + formatter: &DateTime.to_unix/1 + } } ] }, @@ -59,4 +60,4 @@ defmodule Storybook.Components.Fallback do } ] end -end \ No newline at end of file +end diff --git a/priv/storybook/components/field_description.story.exs b/priv/storybook/components/field_description.story.exs index afd953c8..021c457c 100644 --- a/priv/storybook/components/field_description.story.exs +++ b/priv/storybook/components/field_description.story.exs @@ -18,4 +18,4 @@ defmodule Storybook.Components.FieldDescription do } ] end -end \ No newline at end of file +end diff --git a/priv/storybook/components/field_errors.story.exs b/priv/storybook/components/field_errors.story.exs index ed9bd7dc..90226bd8 100644 --- a/priv/storybook/components/field_errors.story.exs +++ b/priv/storybook/components/field_errors.story.exs @@ -17,4 +17,4 @@ defmodule Storybook.Components.FieldErrors do } ] end -end \ No newline at end of file +end diff --git a/priv/storybook/components/flash_group.story.exs b/priv/storybook/components/flash_group.story.exs index 8e8b0ea1..d1938c1d 100644 --- a/priv/storybook/components/flash_group.story.exs +++ b/priv/storybook/components/flash_group.story.exs @@ -19,4 +19,4 @@ defmodule Storybook.Components.FlashGroup do } ] end -end \ No newline at end of file +end diff --git a/priv/storybook/components/label.story.exs b/priv/storybook/components/label.story.exs index 1f60d40c..19e26cef 100644 --- a/priv/storybook/components/label.story.exs +++ b/priv/storybook/components/label.story.exs @@ -16,4 +16,4 @@ defmodule Storybook.Components.Label do } ] end -end \ No newline at end of file +end diff --git a/priv/storybook/components/property_list.story.exs b/priv/storybook/components/property_list.story.exs index dd26a309..de6166c4 100644 --- a/priv/storybook/components/property_list.story.exs +++ b/priv/storybook/components/property_list.story.exs @@ -8,8 +8,8 @@ defmodule Storybook.Components.Icon do %Variation{ id: :default, slots: [ - ~s(<:prop label="Name">George), - ~s(<:prop label="Age">42) + ~s(<:prop label="Name">George), + ~s(<:prop label="Age">42) ] } ] diff --git a/priv/storybook/components/stack.story.exs b/priv/storybook/components/stack.story.exs index 0b1aae8b..1167dd5f 100644 --- a/priv/storybook/components/stack.story.exs +++ b/priv/storybook/components/stack.story.exs @@ -8,25 +8,25 @@ defmodule Storybook.Components.Stack do %Variation{ id: :default, slots: [ - """ -
Hello!
-
Bye!
- """ - ] + """ +
Hello!
+
Bye!
+ """ + ] }, %Variation{ id: :recursive, attributes: %{recursive: true}, slots: [ - """ -
-
Hello!
-
Are you good boy?
-
-
Bye!
- """ - ] + """ +
+
Hello!
+
Are you good boy?
+
+
Bye!
+ """ + ] } ] end -end \ No newline at end of file +end diff --git a/priv/storybook/components/time.story.exs b/priv/storybook/components/time.story.exs index ac65828c..0c667355 100644 --- a/priv/storybook/components/time.story.exs +++ b/priv/storybook/components/time.story.exs @@ -41,4 +41,4 @@ defmodule Storybook.Components.Time do def format(time) do "#{time.hour}h #{time.minute}m" end -end \ No newline at end of file +end diff --git a/priv/storybook/welcome.story.exs b/priv/storybook/welcome.story.exs index 1915b98a..86ef9811 100644 --- a/priv/storybook/welcome.story.exs +++ b/priv/storybook/welcome.story.exs @@ -21,9 +21,12 @@ defmodule Storybook.MyPage do

We generated your storybook with an example of a page and a component. - Feel free to explore the generated *.story.exs files generated into your - project folder, and start adding yours: just drop new story & index files into your - /storybook folder and refresh your storybook. + Feel free to explore the generated *.story.exs + files generated into your + project folder, and start adding yours: + just drop new story & index files into your /storybook + folder + and refresh your storybook.

@@ -34,18 +37,18 @@ defmodule Storybook.MyPage do {"Stories overview", doc_link("Story")}, {"Describe components with Variations", doc_link("Stories.Variation")}, {"And stack them with VariationGroups", doc_link("Stories.VariationGroup")}, - {"Pimp your sidebar with Index files", doc_link("Index")}, - ]}/> + {"Pimp your sidebar with Index files", doc_link("Index")} + ]} />

- This should be enough to get you started but you might also checkout advanced guides - (tabs in the upper-right corner of this page). + This should be enough to get you started but you might also checkout advanced guides (tabs in the upper-right corner of this page).

""" end - def render(assigns = %{tab: guide}) when guide in ~w(components sandboxing icons)a do + def render(assigns = %{tab: guide}) + when guide in ~w(components sandboxing icons)a do assigns = assign(assigns, guide: guide, @@ -54,7 +57,11 @@ defmodule Storybook.MyPage do ~H"""

- + This guide is also available on Hexdocs among others.

@@ -75,7 +82,12 @@ defmodule Storybook.MyPage do <%= dt %>
- + <%= link %>