-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
40 changed files
with
283 additions
and
198 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
components/docs/colors/color-field/color-field-validation-demo.tsx
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"use client" | ||
|
||
import { Button, ColorField, Form } from "ui" | ||
|
||
export default function ColorFieldValidationDemo() { | ||
function submit(e: React.FormEvent) { | ||
e.preventDefault() | ||
} | ||
|
||
return ( | ||
<Form onSubmit={submit} className="space-y-4"> | ||
<ColorField label="Color" isRequired placeholder="#FAFAFA" /> | ||
<Button type="submit">Save</Button> | ||
</Form> | ||
) | ||
} |
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
13 changes: 13 additions & 0 deletions
13
components/docs/date-and-time/date-field/date-field-prefix-demo.tsx
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"use client" | ||
|
||
import { IconCalendar2 } from "justd-icons" | ||
import { Button, DateField, Form } from "ui" | ||
|
||
export default function DateFieldPrefixDemo() { | ||
return ( | ||
<Form onSubmit={(e) => e.preventDefault()}> | ||
<DateField prefix={<IconCalendar2 />} isRequired label="Event date" className="mb-2" /> | ||
<Button type="submit">Submit</Button> | ||
</Form> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
components/docs/date-and-time/date-field/date-field-readonly-demo.tsx
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use client" | ||
|
||
import React from "react" | ||
|
||
import { getLocalTimeZone, parseDate, today } from "@internationalized/date" | ||
import { DateField } from "ui" | ||
|
||
export default function DateFieldReadonlyDemo() { | ||
const now = today(getLocalTimeZone()) | ||
return <DateField isReadOnly defaultValue={parseDate(now.toString())} label="Event date" /> | ||
} |
13 changes: 13 additions & 0 deletions
13
components/docs/date-and-time/date-field/date-field-suffix-demo.tsx
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"use client" | ||
|
||
import { IconCalendar2 } from "justd-icons" | ||
import { Button, DateField, Form } from "ui" | ||
|
||
export default function DateFieldSuffixDemo() { | ||
return ( | ||
<Form onSubmit={(e) => e.preventDefault()}> | ||
<DateField suffix={<IconCalendar2 />} isRequired label="Event date" className="mb-2" /> | ||
<Button type="submit">Submit</Button> | ||
</Form> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
components/docs/date-and-time/date-field/date-field-uncontrolled-demo.tsx
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use client" | ||
|
||
import React from "react" | ||
|
||
import { getLocalTimeZone, parseDate, today } from "@internationalized/date" | ||
import { DateField } from "ui" | ||
|
||
export default function DateFieldUncontrolledDemo() { | ||
const now = today(getLocalTimeZone()) | ||
return <DateField defaultValue={parseDate(now.toString())} label="Event date" /> | ||
} |
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
24 changes: 0 additions & 24 deletions
24
components/docs/date-and-time/time-field/date-field-controlled-demo.tsx
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
components/docs/date-and-time/time-field/date-field-disabled-demo.tsx
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
components/docs/date-and-time/time-field/date-field-validation-demo.tsx
This file was deleted.
Oops, something went wrong.
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
8 changes: 8 additions & 0 deletions
8
components/docs/date-and-time/time-field/time-field-prefix-demo.tsx
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"use client" | ||
|
||
import { Time } from "@internationalized/date" | ||
import { TimeField } from "ui" | ||
|
||
export default function TimeFieldPrefixDemo() { | ||
return <TimeField prefix="UTC" defaultValue={new Time()} label="Event time" /> | ||
} |
8 changes: 8 additions & 0 deletions
8
components/docs/date-and-time/time-field/time-field-readonly-demo.tsx
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"use client" | ||
|
||
import { Time } from "@internationalized/date" | ||
import { TimeField } from "ui" | ||
|
||
export default function TimeFieldReadonlyDemo() { | ||
return <TimeField isReadOnly defaultValue={new Time()} label="Event time" /> | ||
} |
9 changes: 9 additions & 0 deletions
9
components/docs/date-and-time/time-field/time-field-suffix-demo.tsx
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use client" | ||
|
||
import { Time } from "@internationalized/date" | ||
import { IconClock } from "justd-icons" | ||
import { TimeField } from "ui" | ||
|
||
export default function TimeFieldSuffixDemo() { | ||
return <TimeField suffix={<IconClock />} defaultValue={new Time()} label="Event time" /> | ||
} |
9 changes: 7 additions & 2 deletions
9
components/docs/forms/number-field/number-field-invalid-demo.tsx
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,7 +1,12 @@ | ||
"use client" | ||
|
||
import { NumberField } from "ui" | ||
import { Button, Form, NumberField } from "ui" | ||
|
||
export default function NumberFieldInvalidDemo() { | ||
return <NumberField isInvalid label="Cookies" /> | ||
return ( | ||
<Form onSubmit={(e) => e.preventDefault()} className="space-y-4"> | ||
<NumberField isRequired label="Cookies" /> | ||
<Button type="submit">Submit</Button> | ||
</Form> | ||
) | ||
} |
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
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
Oops, something went wrong.