Skip to content

Commit

Permalink
Change file and module names to singular (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFirstAvenger authored Dec 6, 2024
1 parent 61c7396 commit ccee399
Show file tree
Hide file tree
Showing 20 changed files with 57 additions and 54 deletions.
3 changes: 3 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Config

config :station_ui, use_source_components: true
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule StationUI.MixProject do
{:gettext, "~> 0.20"},
{:phoenix, "~> 1.7.11"},
{:phoenix_live_view, "~> 0.20.7"},
{:credo, "~> 1.7.0", only: [:dev, :test], runtime: false},
{:credo, "~> 1.7.10", only: [:dev, :test], runtime: false},
{:tailwind_formatter, "~> 0.3.5", only: [:dev, :test], runtime: false}
]
end
Expand Down
8 changes: 4 additions & 4 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
%{
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
"castore": {:hex, :castore, "1.0.5", "9eeebb394cc9a0f3ae56b813459f990abb0a3dedee1be6b27fdb50301930502f", [:mix], [], "hexpm", "8d7c597c3e4a64c395980882d4bca3cebb8d74197c590dc272cfd3b6a6310578"},
"credo": {:hex, :credo, "1.7.1", "6e26bbcc9e22eefbff7e43188e69924e78818e2fe6282487d0703652bc20fd62", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e9871c6095a4c0381c89b6aa98bc6260a8ba6addccf7f6a53da8849c748a58a2"},
"credo": {:hex, :credo, "1.7.10", "6e64fe59be8da5e30a1b96273b247b5cf1cc9e336b5fd66302a64b25749ad44d", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "71fbc9a6b8be21d993deca85bf151df023a3097b01e09a2809d460348561d8cd"},
"expo": {:hex, :expo, "0.4.1", "1c61d18a5df197dfda38861673d392e642649a9cef7694d2f97a587b2cfb319b", [:mix], [], "hexpm", "2ff7ba7a798c8c543c12550fa0e2cbc81b95d4974c65855d8d15ba7b37a1ce47"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"file_system": {:hex, :file_system, "1.0.1", "79e8ceaddb0416f8b8cd02a0127bdbababe7bf4a23d2a395b983c1f8b3f73edd", [:mix], [], "hexpm", "4414d1f38863ddf9120720cd976fce5bdde8e91d8283353f0e31850fa89feb9e"},
"gettext": {:hex, :gettext, "0.23.1", "821e619a240e6000db2fc16a574ef68b3bd7fe0167ccc264a81563cc93e67a31", [:mix], [{:expo, "~> 0.4.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "19d744a36b809d810d610b57c27b934425859d158ebd56561bc41f7eeb8795db"},
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"},
"phoenix": {:hex, :phoenix, "1.7.11", "1d88fc6b05ab0c735b250932c4e6e33bfa1c186f76dcf623d8dd52f07d6379c7", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "b1ec57f2e40316b306708fe59b92a16b9f6f4bf50ccfa41aa8c7feb79e0ec02a"},
"phoenix_html": {:hex, :phoenix_html, "4.0.0", "4857ec2edaccd0934a923c2b0ba526c44a173c86b847e8db725172e9e51d11d6", [:mix], [], "hexpm", "cee794a052f243291d92fa3ccabcb4c29bb8d236f655fb03bcbdc3a8214b8d13"},
Expand Down
2 changes: 1 addition & 1 deletion sources/lib/components/station_ui/html/accordion.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule StationUI.HTML.Accordion do
use Phoenix.Component

import StationUI.HTML.Icons, only: [icon: 1]
import StationUI.HTML.Icon, only: [icon: 1]
alias Phoenix.LiveView.JS

@moduledoc """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule StationUI.HTML.Avatars do
defmodule StationUI.HTML.Avatar do
use Phoenix.Component

import StationUI.HTML.StatusBadges, only: [status_badge: 1]
import StationUI.HTML.StatusBadge, only: [status_badge: 1]

@moduledoc """
The avatar component renders initials, an SVG, or an image thumbnail to represent a user.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
defmodule StationUI.HTML.Banners do
defmodule StationUI.HTML.Banner do
use Phoenix.Component

import StationUI.HTML.Icons, only: [icon: 1]
import StationUI.HTML.Buttons
import StationUI.HTML.Icon, only: [icon: 1]
import StationUI.HTML.Button

alias Phoenix.LiveView.JS

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule StationUI.HTML.Buttons do
defmodule StationUI.HTML.Button do
use Phoenix.Component

@moduledoc """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule StationUI.HTML.Cards do
defmodule StationUI.HTML.Card do
use Phoenix.Component

@moduledoc """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
defmodule StationUI.HTML.Forms do
defmodule StationUI.HTML.Form do
@moduledoc """
This module exists to provide the same API as the Phoenix Core Components so as to support
generators that target the Core Components (`mix phx.gen.live`, `mix phx.gen.auth`, etc...)
"""
use Phoenix.Component
alias StationUI.HTML.Inputs
alias StationUI.HTML.Input

attr :id, :any, default: nil
attr :name, :any
Expand Down Expand Up @@ -40,33 +40,33 @@ defmodule StationUI.HTML.Forms do

def input(%{type: "checkbox"} = assigns) do
~H"""
<Inputs.checkbox {Map.drop(assigns, [:field, :label, :multiple, :options, :prompt, :type])}>
<Input.checkbox {Map.drop(assigns, [:field, :label, :multiple, :options, :prompt, :type])}>
<:label :if={@label}><%= @label %></:label>
</Inputs.checkbox>
</Input.checkbox>
"""
end

def input(%{type: "select"} = assigns) do
~H"""
<Inputs.simple_select {Map.drop(assigns, [:checked, :field, :label, :type])}>
<Input.simple_select {Map.drop(assigns, [:checked, :field, :label, :type])}>
<:label :if={@label}><%= @label %></:label>
</Inputs.simple_select>
</Input.simple_select>
"""
end

def input(%{type: "textarea"} = assigns) do
~H"""
<Inputs.textarea {Map.drop(assigns, [:checked, :field, :label, :multiple, :options, :prompt, :type])}>
<Input.textarea {Map.drop(assigns, [:checked, :field, :label, :multiple, :options, :prompt, :type])}>
<:label :if={@label}><%= @label %></:label>
</Inputs.textarea>
</Input.textarea>
"""
end

def input(assigns) do
~H"""
<Inputs.generic_input {Map.drop(assigns, [:checked, :field, :label, :multiple, :options, :prompt])}>
<Input.generic_input {Map.drop(assigns, [:checked, :field, :label, :multiple, :options, :prompt])}>
<:label :if={@label}><%= @label %></:label>
</Inputs.generic_input>
</Input.generic_input>
"""
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule StationUI.HTML.Icons do
defmodule StationUI.HTML.Icon do
use Phoenix.Component

@doc """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule StationUI.HTML.Inputs do
defmodule StationUI.HTML.Input do
use Phoenix.Component

import StationUI.HTML.Icons, only: [icon: 1]
import StationUI.HTML.Icon, only: [icon: 1]

alias Phoenix.HTML.Form
alias Phoenix.LiveView.JS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule StationUI.HTML.LegacyCoreComponents do
"""
use Phoenix.Component

import StationUI.HTML.Icons, only: [icon: 1]
import StationUI.HTML.Icon, only: [icon: 1]

alias Phoenix.LiveView.JS

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
defmodule StationUI.HTML.Modals do
defmodule StationUI.HTML.Modal do
use Phoenix.Component

import StationUI.HTML.Buttons
import StationUI.HTML.Icons, only: [icon: 1]
import StationUI.HTML.Button
import StationUI.HTML.Icon, only: [icon: 1]

alias Phoenix.LiveView.JS

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule StationUI.HTML.NotificationBadges do
defmodule StationUI.HTML.NotificationBadge do
use Phoenix.Component

attr :class, :any, default: "h-6 w-6 text-sm"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule StationUI.HTML.Spinners do
defmodule StationUI.HTML.Spinner do
use Phoenix.Component

@doc """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule StationUI.HTML.StatusBadges do
defmodule StationUI.HTML.StatusBadge do
use Phoenix.Component

@status_badge_base_classes "aspect-square flex items-center justify-center rounded-full"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule StationUI.HTML.Tags do
defmodule StationUI.HTML.Tag do
@moduledoc """
For bordered tags, add "border-2"
Expand All @@ -7,7 +7,7 @@ defmodule StationUI.HTML.Tags do
"""
use Phoenix.Component

import StationUI.HTML.Icons, only: [icon: 1]
import StationUI.HTML.Icon, only: [icon: 1]

alias Phoenix.LiveView.JS

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
defmodule StationUI.HTML.Toolbars do
defmodule StationUI.HTML.Toolbar do
use Phoenix.Component

import StationUI.HTML.Icons, only: [icon: 1]
import StationUI.HTML.Buttons
import StationUI.HTML.Icon, only: [icon: 1]
import StationUI.HTML.Button

@doc """
Sets up Toolbar component. The Toolbar includes default and vertical variants
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule StationUI.HTML.Tooltips do
defmodule StationUI.HTML.Tooltip do
use Phoenix.Component

import StationUI.HTML.Icons
import StationUI.HTML.Icon

@doc """
The tooltip component renders a small unit of informational content that is hidden until a user hovers over the activating content.
Expand Down
28 changes: 14 additions & 14 deletions sources/lib/components/station_ui/station_ui.html.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ defmodule StationUI.HTML do
defmacro __using__(_) do
quote do
import StationUI.HTML.{
Avatars,
Banners,
Buttons,
Avatar,
Banner,
Button,
Accordion,
Cards,
Card,
Footer,
Forms,
Icons,
Form,
Icon,
LegacyCoreComponents,
NotificationBadges,
Inputs,
Modals,
NotificationBadge,
Input,
Modal,
Navbar,
Pagination,
Spinners,
StatusBadges,
Spinner,
StatusBadge,
TabGroup,
Tags,
Tag,
Toast,
Toolbars,
Tooltips,
Toolbar,
Tooltip,
TableHeader,
TableCell
}
Expand Down

0 comments on commit ccee399

Please sign in to comment.