FlintUI.Component (FlintUI v0.1.0)
Summary
Functions
Converts a component name atom to a string.
Converts a module name to space separated atom. Gets the last part of the module name, converts it to snake case and then to atom.
Converts a string to a component name atom.
Functions
Link to this function
humanize_component_name(component_name)
Converts a component name atom to a string.
Example:
iex> FlintUI.Component.humanize_component_name(:badge)
"Badge"
iex> FlintUI.Component.humanize_component_name(:badge_button)
"Badge Button"
Link to this function
module_to_component_name(module_name)
Converts a module name to space separated atom. Gets the last part of the module name, converts it to snake case and then to atom.
Example:
iex> FlintUI.Component.module_to_component_name(FlintUI.Badge)
:badge
iex> FlintUI.Component.module_to_component_name(FlintUI.BadgeButton)
:badge_button
Link to this function
string_to_component_name(string)
Converts a string to a component name atom.
Example:
iex> FlintUI.Component.string_to_component_name("Badge")
:badge
iex> FlintUI.Component.string_to_component_name("Badge Button")
:badge_button