-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvements on input components for form
- Loading branch information
Showing
8 changed files
with
137 additions
and
37 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
68 changes: 68 additions & 0 deletions
68
daisy_ui_components_site/storybook/components/text_input.story.exs
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,68 @@ | ||
defmodule Storybook.Components.TextInput do | ||
use PhoenixStorybook.Story, :component | ||
|
||
alias DaisyUIComponents.Utils | ||
|
||
def function, do: &DaisyUIComponents.TextInput.text_input/1 | ||
|
||
def imports, | ||
do: [ | ||
{DaisyUIComponents.Icon, [icon: 1]} | ||
] | ||
|
||
def variations do | ||
[ | ||
%Variation{ | ||
id: :text_input, | ||
attributes: %{ | ||
type: "text", | ||
placeholder: "Type here", | ||
class: "w-full max-w-xs" | ||
} | ||
}, | ||
%Variation{ | ||
id: :text_input_with_border, | ||
attributes: %{ | ||
type: "text", | ||
bordered: true, | ||
placeholder: "Type here", | ||
class: "w-full max-w-xs" | ||
} | ||
}, | ||
%Variation{ | ||
id: :text_input_ghost, | ||
attributes: %{ | ||
type: "text", | ||
ghost: true, | ||
placeholder: "Type here", | ||
class: "w-full max-w-xs" | ||
} | ||
}, | ||
%VariationGroup{ | ||
id: :colors, | ||
variations: | ||
for color <- Utils.colors() do | ||
%Variation{ | ||
id: String.to_atom(color), | ||
attributes: %{ | ||
type: "text", | ||
bordered: true, | ||
placeholder: "Type here", | ||
class: "w-full max-w-xs", | ||
color: color | ||
} | ||
} | ||
end | ||
}, | ||
%Variation{ | ||
id: :text_input_disabled, | ||
attributes: %{ | ||
type: "text", | ||
disabled: true, | ||
placeholder: "You can't touch this", | ||
class: "w-full max-w-xs" | ||
} | ||
} | ||
] | ||
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
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