Skip to content

Commit

Permalink
Remove Form and inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
msaraiva committed Sep 24, 2024
1 parent 9b71e41 commit e4d8409
Show file tree
Hide file tree
Showing 15 changed files with 0 additions and 666 deletions.
215 changes: 0 additions & 215 deletions lib/surface_site_web/live/builtin_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ defmodule SurfaceSiteWeb.BuiltinComponents do
<li :if={@component != nil}>
<.link navigate="/builtincomponents">Built-in Components</.link>
</li>
<li :if={input_control?(@component)}>
<.link navigate="/builtincomponents/InputControls">Input Controls</.link>
</li>
<li :if={@component != nil} class="is-active">
<a href="#">{component_label(@component)}</a>
</li>
Expand All @@ -42,45 +39,13 @@ defmodule SurfaceSiteWeb.BuiltinComponents do
<div class="section">
{route(assigns)}
</div>
<nav :if={input_control?(@component)} class="nav-prev-next">
<.link navigate="/builtincomponents/InputControls">
← Input Controls
</.link>
</nav>
</div>
</section>
</div>
</div>
"""
end

defp input_control?(component) do
component in [
"ColorInput",
"DateInput",
"DateTimeLocalInput",
"EmailInput",
"HiddenInput",
"NumberInput",
"PasswordInput",
"RangeInput",
"SearchInput",
"TelephoneInput",
"TextInput",
"TimeInput",
"UrlInput",
"CheckBox",
"Select",
"Inputs",
"FileInput",
"HiddenInputs",
"MultipleSelect",
"OptionsForSelect",
"DateTimeSelect",
"TimeSelect"
]
end

defp component_label("InputControls") do
"Input Controls"
end
Expand All @@ -95,150 +60,6 @@ defmodule SurfaceSiteWeb.BuiltinComponents do
"""
end

defp route(%{component: "InputControls"} = assigns) do
~F"""
<SurfaceSiteWeb.BuiltinComponents.InputControls id="InputControlsInfo" />
"""
end

defp route(%{component: "ColorInput"} = assigns) do
~F"""
<SurfaceSiteWeb.BuiltinComponents.InputControls.ColorInputInfo id="ColorInputInfo" />
"""
end

defp route(%{component: "DateInput"} = assigns) do
~F"""
<SurfaceSiteWeb.BuiltinComponents.InputControls.DateInputInfo id="DateInputInfo" />
"""
end

defp route(%{component: "DateTimeLocalInput"} = assigns) do
~F"""
<SurfaceSiteWeb.BuiltinComponents.InputControls.DateTimeLocalInputInfo id="DateTimeLocalInputInfo" />
"""
end

defp route(%{component: "EmailInput"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.EmailInput} />
"""
end

defp route(%{component: "HiddenInput"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.HiddenInput} />
"""
end

defp route(%{component: "NumberInput"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.NumberInput} />
"""
end

defp route(%{component: "PasswordInput"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.PasswordInput} />
"""
end

defp route(%{component: "RangeInput"} = assigns) do
~F"""
<SurfaceSiteWeb.BuiltinComponents.InputControls.RangeInputInfo id="RangeInputInfo" />
"""
end

defp route(%{component: "SearchInput"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.SearchInput} />
"""
end

defp route(%{component: "TelephoneInput"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.TelephoneInput} />
"""
end

defp route(%{component: "TextInput"} = assigns) do
~F"""
<SurfaceSiteWeb.BuiltinComponents.InputControls.TextInputInfo id="TextInputInfo" />
"""
end

defp route(%{component: "RadioButton"} = assigns) do
~F"""
<SurfaceSiteWeb.BuiltinComponents.InputControls.RadioButtonInfo id="RadioButtonInfo" />
"""
end

defp route(%{component: "TimeInput"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.TimeInput} />
"""
end

defp route(%{component: "UrlInput"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.UrlInput} />
"""
end

defp route(%{component: "Checkbox"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.Checkbox} />
"""
end

defp route(%{component: "Select"} = assigns) do
~F"""
<SurfaceSiteWeb.BuiltinComponents.SelectInfo id="SelectInfo" />
"""
end

defp route(%{component: "Inputs"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.Inputs} />
"""
end

defp route(%{component: "FileInput"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.FileInput} />
"""
end

defp route(%{component: "HiddenInputs"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.HiddenInputs} />
"""
end

defp route(%{component: "MultipleSelect"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.MultipleSelect} />
"""
end

defp route(%{component: "OptionsForSelect"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.OptionsForSelect} />
"""
end

defp route(%{component: "TimeSelect"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.TimeSelect} />
"""
end

defp route(%{component: "DateTimeSelect"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.DateTimeSelect} />
"""
end

defp route(%{component: "Link"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Link} />
Expand All @@ -257,42 +78,6 @@ defmodule SurfaceSiteWeb.BuiltinComponents do
"""
end

defp route(%{component: "Form"} = assigns) do
~F"""
<SurfaceSiteWeb.BuiltinComponents.FormInfo id="FormInfo" />
"""
end

defp route(%{component: "Field"} = assigns) do
~F"""
<SurfaceSiteWeb.BuiltinComponents.FieldInfo id="FieldInfo" />
"""
end

defp route(%{component: "FieldContext"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.FieldContext} />
"""
end

defp route(%{component: "Label"} = assigns) do
~F"""
<SurfaceSiteWeb.BuiltinComponents.LabelInfo id="LabelInfo" />
"""
end

defp route(%{component: "TextArea"} = assigns) do
~F"""
<SurfaceSiteWeb.BuiltinComponents.TextAreaInfo id="TextAreaInfo" />
"""
end

defp route(%{component: "ErrorTag"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Form.ErrorTag} />
"""
end

defp route(%{component: "Component"} = assigns) do
~F"""
<ComponentInfo module={Surface.Components.Dynamic.Component} />
Expand Down
30 changes: 0 additions & 30 deletions lib/surface_site_web/live/builtin_components/field_info.ex

This file was deleted.

42 changes: 0 additions & 42 deletions lib/surface_site_web/live/builtin_components/form_info.ex

This file was deleted.

17 changes: 0 additions & 17 deletions lib/surface_site_web/live/builtin_components/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,6 @@ defmodule SurfaceSiteWeb.BuiltinComponents.Index do
* [LiveRedirect](/builtincomponents/LiveRedirect){: data-phx-link="redirect" data-phx-link-state="push"} -
Generates a link that will **redirect** to a new LiveView.
### Form
* [Form](/builtincomponents/Form){: data-phx-link="redirect" data-phx-link-state="push"} -
Defines a **form** that lets the user submit information.
* [Field](/builtincomponents/Field){: data-phx-link="redirect" data-phx-link-state="push"} -
Defines a form **field**.
* [Label](/builtincomponents/Label){: data-phx-link="redirect" data-phx-link-state="push"} -
Defines a **label**.
* [Input Controls](/builtincomponents/InputControls){: data-phx-link="redirect" data-phx-link-state="push"} -
A set of common **input controls** based on the `<input>` element.
* [TextArea](/builtincomponents/TextArea){: data-phx-link="redirect" data-phx-link-state="push"} -
An input field that let the user enter a **multi-line** text.
### Other
* [#Markdown](/builtincomponents/Markdown){: data-phx-link="redirect" data-phx-link-state="push"} -
Expand Down
Loading

0 comments on commit e4d8409

Please sign in to comment.