add password generator

This commit is contained in:
2025-03-07 12:33:40 -05:00
parent 116be25489
commit 0d386e2d9f
27 changed files with 17895 additions and 42 deletions

View File

@@ -27,7 +27,7 @@ var NavGroups = []NavGroup{
{
Title: "Tools",
SubGroup: []NavGroup{
{SectionId: LAYOUT_SECTION_TOOLS, Title: "Password Generator", URL: "/app/examples/forms"},
{SectionId: LAYOUT_SECTION_TOOLS, Title: "Passkey Generator", URL: "/app/generator"},
},
},
}

View File

@@ -1,6 +1,8 @@
package ui
import (
"strconv"
. "maragu.dev/gomponents"
. "maragu.dev/gomponents/html"
)
@@ -73,4 +75,24 @@ func FormTextarea(children ...Node) Node {
func FormLabel(children ...Node) Node {
return Label(InlineStyle("$me { color: $color(neutral-900); font-size: var(--text-sm); } "), Group(children))
}
func FormCheck(children ...Node) Node {
return Input(
InlineStyle(`
$me {
margin-left: $3;
}
`),
Type("checkbox"),
Group(children),
)
}
func FormSlider(min int, max int, children ...Node) Node {
return Input(
Type("range"),
Min(strconv.Itoa(min)),
Max(strconv.Itoa(max)),
)
}

View File

@@ -59,6 +59,13 @@ func Flex(n ...Node) Node {
)
}
func FlexLeftRight(n ...Node) Node {
return Div(
InlineStyle("$me { display: flex; align-items: center; flex-direction: row; gap: $3; justify-content: space-between; }"),
Group(n),
)
}
func CardNoPadding(body ...Node) Node {
return Div(
InlineStyle(`
@@ -109,6 +116,12 @@ func ToText(i interface{}) Node {
}
// TEXT
func Heading(text string) Node {
return H1(
InlineStyle("$me { font-weight: bold; font-size: var(--text-2xl); letter-spacing: var(--tracking-tight); color: $color(black); }"),
Text(text),
)
}
func PageLink(location string, display Node, newPage bool) Node {
return A(
Href(location),

View File

@@ -38,6 +38,7 @@ const (
ICON_X_DIALOG_CLOSE = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" stroke="currentColor" fill="none" stroke-width="1.4" class="w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>`
ICON_PENCIL = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pencil"><path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/></svg>`
ICON_LOCK_KEYHOLE = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-lock-keyhole"><circle cx="12" cy="16" r="1"/><rect x="3" y="10" width="18" height="12" rx="2"/><path d="M7 10V7a5 5 0 0 1 10 0v3"/></svg>`
ICON_COPY = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`
//material
ICON_SEARCH = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="3" stroke="currentColor" class="w-8 h-8 text-slate-600"><path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" /></svg>`