-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
10,140 additions
and
4,780 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} | ||
{ | ||
"name": "", | ||
"short_name": "", | ||
"icons": [ | ||
{ "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" }, | ||
{ "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" } | ||
], | ||
"theme_color": "#ffffff", | ||
"background_color": "#ffffff", | ||
"display": "standalone" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import { As } from "@kobalte/core"; | ||
import { Anchor, Button, Checkbox, Surface, TextField } from "@kobalte/pigment"; | ||
import { createForm, required, email, setValue, SubmitHandler } from "@modular-forms/solid"; | ||
|
||
|
@@ -21,70 +20,69 @@ export function ModularFormsExample() { | |
variant="raised" | ||
border="all" | ||
class="flex flex-col w-full max-w-sm p-6 rounded-lg" | ||
asChild | ||
as={Form} | ||
onSubmit={handleSubmit} | ||
> | ||
<As component={Form} onSubmit={handleSubmit}> | ||
<h2 class="text-2xl text-content font-bold mb-0.5">Welcome to Pigment</h2> | ||
<p class="text-base text-content-subtle">Sign up to continue</p> | ||
<div class="flex flex-col gap-6 my-6"> | ||
<Field name="email" validate={[email("Please enter a valid email address")]}> | ||
{(field, props) => ( | ||
<TextField | ||
ref={props.ref} | ||
name={props.name} | ||
value={field.value} | ||
onChange={value => setValue(signupForm, "email", value)} | ||
inputProps={{ | ||
onInput: props.onInput, | ||
onChange: props.onChange, | ||
onBlur: props.onBlur, | ||
}} | ||
invalid={!!field.error} | ||
label="Email" | ||
placeholder="[email protected]" | ||
errorMessage={field.error} | ||
/> | ||
)} | ||
</Field> | ||
<Field | ||
name="newsletter" | ||
type="boolean" | ||
validate={[required("You must accept our terms and conditions")]} | ||
> | ||
{(field, props) => ( | ||
<Checkbox | ||
ref={props.ref} | ||
name={props.name} | ||
checked={field.value} | ||
onChange={checked => setValue(signupForm, "newsletter", checked)} | ||
inputProps={{ | ||
onInput: props.onInput, | ||
onChange: props.onChange, | ||
onBlur: props.onBlur, | ||
}} | ||
invalid={!!field.error} | ||
label={ | ||
<> | ||
I agree to the <span class="font-medium">terms and conditions</span> | ||
</> | ||
} | ||
description={ | ||
<span> | ||
Read our{" "} | ||
<Anchor href="/" external> | ||
terms and conditions | ||
</Anchor> | ||
</span> | ||
} | ||
errorMessage={field.error} | ||
/> | ||
)} | ||
</Field> | ||
</div> | ||
<Button type="submit" variant="solid"> | ||
Sign up | ||
</Button> | ||
</As> | ||
<h2 class="text-2xl text-content font-bold mb-0.5">Welcome to Pigment</h2> | ||
<p class="text-base text-content-subtle">Sign up to continue</p> | ||
<div class="flex flex-col gap-6 my-6"> | ||
<Field name="email" validate={[email("Please enter a valid email address")]}> | ||
{(field, props) => ( | ||
<TextField | ||
ref={props.ref} | ||
name={props.name} | ||
value={field.value} | ||
onChange={value => setValue(signupForm, "email", value)} | ||
inputProps={{ | ||
onInput: props.onInput, | ||
onChange: props.onChange, | ||
onBlur: props.onBlur, | ||
}} | ||
invalid={!!field.error} | ||
label="Email" | ||
placeholder="[email protected]" | ||
errorMessage={field.error} | ||
/> | ||
)} | ||
</Field> | ||
<Field | ||
name="newsletter" | ||
type="boolean" | ||
validate={[required("You must accept our terms and conditions")]} | ||
> | ||
{(field, props) => ( | ||
<Checkbox | ||
ref={props.ref} | ||
name={props.name} | ||
checked={field.value} | ||
onChange={checked => setValue(signupForm, "newsletter", checked)} | ||
inputProps={{ | ||
onInput: props.onInput, | ||
onChange: props.onChange, | ||
onBlur: props.onBlur, | ||
}} | ||
invalid={!!field.error} | ||
label={ | ||
<> | ||
I agree to the <span class="font-medium">terms and conditions</span> | ||
</> | ||
} | ||
description={ | ||
<span> | ||
Read our{" "} | ||
<Anchor href="/" external> | ||
terms and conditions | ||
</Anchor> | ||
</span> | ||
} | ||
errorMessage={field.error} | ||
/> | ||
)} | ||
</Field> | ||
</div> | ||
<Button type="submit" variant="solid"> | ||
Sign up | ||
</Button> | ||
</Surface> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.