mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 14:54:55 +00:00
25 lines
608 B
Lua
25 lines
608 B
Lua
-- Password field component
|
|
|
|
---@class UIComponent
|
|
---@field type string
|
|
---@field props? table
|
|
---@field children? UIComponent[]
|
|
|
|
---@class PasswordFieldProps
|
|
---@field name string
|
|
---@field label? string
|
|
|
|
---@param props PasswordFieldProps
|
|
---@return UIComponent
|
|
local function password(props)
|
|
return {
|
|
type = "Box",
|
|
children = {
|
|
{ type = "Label", props = { text = props.label or "Password", htmlFor = props.name } },
|
|
{ type = "Input", props = { name = props.name, type = "password", placeholder = "••••••••" } }
|
|
}
|
|
}
|
|
end
|
|
|
|
return password
|