import * as v from "valibot" import { styled } from "@macaron-css/solid"; import { Text } from "@nestri/www/ui/text"; import { utility } from "@nestri/www/ui/utility"; import { theme } from "@nestri/www/ui/theme"; import { FormField, Input, Select } from "@nestri/www/ui/form"; import { Container, FullScreen } from "@nestri/www/ui/layout"; import { createForm, required, email, valiForm } from "@modular-forms/solid"; import { Button } from "@nestri/www/ui"; // const nameRegex = /^[a-z]+$/ const FieldList = styled("div", { base: { width: "100%", maxWidth: 380, ...utility.stack(5), }, }); const Hr = styled("hr", { base: { border: 0, backgroundColor: theme.color.gray.d400, width: "100%", height: 1, } }) const Plan = { Pro: 'BYOG', Basic: 'Hosted', } as const; const schema = v.object({ plan: v.pipe( v.enum(Plan), v.minLength(2,"Please choose a plan"), ), display_name: v.pipe( v.string(), v.maxLength(32, 'Please use 32 characters at maximum.'), ), slug: v.pipe( v.string(), v.minLength(2, 'Please use 2 characters at minimum.'), // v.regex(nameRegex, "Use only small letters, no numbers or special characters"), v.maxLength(48, 'Please use 48 characters at maximum.'), ) }) // const Details = styled("details", { // base: { // overflow: "hidden", // transition: "max-height .2s ease" // } // }) // const Summary = styled("summary", { // base: { // userSelect: "none", // cursor: "pointer", // listStyle: "none" // } // }) // const SVG = styled("svg", { // base: { // color: theme.color.gray.d900, // width: 20, // height: 20, // marginRight: theme.space[2] // } // }) // const Subtitle = styled("p", { // base: { // color: theme.color.gray.d900, // fontSize: theme.font.size.sm, // fontWeight: theme.font.weight.regular, // lineHeight: "1rem" // } // }) export function CreateTeamComponent() { const [form, { Form, Field }] = createForm({ validate: valiForm(schema), }); return ( Create a Team Choose something that your teammates will recognize
{(field, props) => ( )} {(field, props) => (