-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding the Phoenix Storyboard project (#88)
- Loading branch information
Showing
21 changed files
with
559 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* This is your custom storybook stylesheet. */ | ||
@import "tailwindcss/base"; | ||
@import "tailwindcss/components"; | ||
@import "tailwindcss/utilities"; | ||
|
||
/* | ||
* Put your component styling within the Tailwind utilities layer. | ||
* See the https://hexdocs.pm/phoenix_storybook/sandboxing.html guide for more info. | ||
*/ | ||
|
||
@layer utilities { | ||
* { | ||
font-family: system-ui; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// If your components require any hooks or custom uploaders, or if your pages | ||
// require connect parameters, uncomment the following lines and declare them as | ||
// such: | ||
// | ||
// import * as Hooks from "./hooks"; | ||
// import * as Params from "./params"; | ||
// import * as Uploaders from "./uploaders"; | ||
|
||
// (function () { | ||
// window.storybook = { Hooks, Params, Uploaders }; | ||
// })(); | ||
|
||
|
||
// If your components require alpinejs, you'll need to start | ||
// alpine after the DOM is loaded and pass in an onBeforeElUpdated | ||
// | ||
// import Alpine from 'alpinejs' | ||
// window.Alpine = Alpine | ||
// document.addEventListener('DOMContentLoaded', () => { | ||
// window.Alpine.start(); | ||
// }); | ||
|
||
// (function () { | ||
// window.storybook = { | ||
// LiveSocketOptions: { | ||
// dom: { | ||
// onBeforeElUpdated(from, to) { | ||
// if (from._x_dataStack) { | ||
// window.Alpine.clone(from, to) | ||
// } | ||
// } | ||
// } | ||
// } | ||
// }; | ||
// })(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
defmodule FlickWeb.Storybook do | ||
@moduledoc """ | ||
Provides a Phoenix Storybook configuration for the FlickWeb application. | ||
""" | ||
|
||
use PhoenixStorybook, | ||
otp_app: :flick_web, | ||
content_path: Path.expand("../../storybook", __DIR__), | ||
# assets path are remote path, not local file-system paths | ||
css_path: "/assets/storybook.css", | ||
js_path: "/assets/storybook.js", | ||
sandbox_class: "flick-web" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
defmodule Storybook.Root do | ||
# See https://hexdocs.pm/phoenix_storybook/PhoenixStorybook.Index.html for full index | ||
# documentation. | ||
|
||
use PhoenixStorybook.Index | ||
|
||
def folder_icon, do: {:fa, "book-open", :light, "psb-mr-1"} | ||
def folder_name, do: "Storybook" | ||
|
||
def entry("welcome") do | ||
[ | ||
name: "Welcome Page", | ||
icon: {:fa, "hand-wave", :thin} | ||
] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
defmodule Storybook.CoreComponents.Button do | ||
use PhoenixStorybook.Story, :component | ||
|
||
def function, do: &FlickWeb.CoreComponents.button/1 | ||
|
||
def variations do | ||
[ | ||
%Variation{ | ||
id: :default, | ||
slots: ["Button"] | ||
}, | ||
%Variation{ | ||
id: :custom_class, | ||
attributes: %{ | ||
class: "rounded-full bg-indigo-500 hover:bg-indigo-600" | ||
}, | ||
slots: ["Disabled"] | ||
}, | ||
%Variation{ | ||
id: :disabled, | ||
attributes: %{ | ||
disabled: true | ||
}, | ||
slots: ["Disabled"] | ||
} | ||
] | ||
end | ||
end |
Oops, something went wrong.