diff --git a/bun.lockb b/bun.lockb index 804b7f34..961603e4 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/docs/colors/color-field/color-field-validation-demo.tsx b/components/docs/colors/color-field/color-field-validation-demo.tsx new file mode 100644 index 00000000..2329b351 --- /dev/null +++ b/components/docs/colors/color-field/color-field-validation-demo.tsx @@ -0,0 +1,16 @@ +"use client" + +import { Button, ColorField, Form } from "ui" + +export default function ColorFieldValidationDemo() { + function submit(e: React.FormEvent) { + e.preventDefault() + } + + return ( +
+ + + + ) +} diff --git a/components/docs/date-and-time/date-field/date-field-controlled-demo.tsx b/components/docs/date-and-time/date-field/date-field-controlled-demo.tsx index b3b3d87a..d8a8554d 100644 --- a/components/docs/date-and-time/date-field/date-field-controlled-demo.tsx +++ b/components/docs/date-and-time/date-field/date-field-controlled-demo.tsx @@ -6,7 +6,7 @@ import { getLocalTimeZone, parseDate, today } from "@internationalized/date" import { useDateFormatter } from "@react-aria/i18n" import { DateField } from "ui" -export default function DateFieldDisabledDemo() { +export default function DateFieldControlledDemo() { const now = today(getLocalTimeZone()) const [value, setValue] = React.useState(parseDate(now.toString())) diff --git a/components/docs/date-and-time/date-field/date-field-prefix-demo.tsx b/components/docs/date-and-time/date-field/date-field-prefix-demo.tsx new file mode 100644 index 00000000..4632e2cc --- /dev/null +++ b/components/docs/date-and-time/date-field/date-field-prefix-demo.tsx @@ -0,0 +1,13 @@ +"use client" + +import { IconCalendar2 } from "justd-icons" +import { Button, DateField, Form } from "ui" + +export default function DateFieldPrefixDemo() { + return ( +
e.preventDefault()}> + } isRequired label="Event date" className="mb-2" /> + + + ) +} diff --git a/components/docs/date-and-time/date-field/date-field-readonly-demo.tsx b/components/docs/date-and-time/date-field/date-field-readonly-demo.tsx new file mode 100644 index 00000000..5e0bb648 --- /dev/null +++ b/components/docs/date-and-time/date-field/date-field-readonly-demo.tsx @@ -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 +} diff --git a/components/docs/date-and-time/date-field/date-field-suffix-demo.tsx b/components/docs/date-and-time/date-field/date-field-suffix-demo.tsx new file mode 100644 index 00000000..a7191804 --- /dev/null +++ b/components/docs/date-and-time/date-field/date-field-suffix-demo.tsx @@ -0,0 +1,13 @@ +"use client" + +import { IconCalendar2 } from "justd-icons" +import { Button, DateField, Form } from "ui" + +export default function DateFieldSuffixDemo() { + return ( +
e.preventDefault()}> + } isRequired label="Event date" className="mb-2" /> + + + ) +} diff --git a/components/docs/date-and-time/date-field/date-field-uncontrolled-demo.tsx b/components/docs/date-and-time/date-field/date-field-uncontrolled-demo.tsx new file mode 100644 index 00000000..2efd668f --- /dev/null +++ b/components/docs/date-and-time/date-field/date-field-uncontrolled-demo.tsx @@ -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 +} diff --git a/components/docs/date-and-time/date-field/date-field-validation-demo.tsx b/components/docs/date-and-time/date-field/date-field-validation-demo.tsx index 59b84dd1..5d9de605 100644 --- a/components/docs/date-and-time/date-field/date-field-validation-demo.tsx +++ b/components/docs/date-and-time/date-field/date-field-validation-demo.tsx @@ -2,7 +2,7 @@ import { Button, DateField, Form } from "ui" -export default function DateFieldDisabledDemo() { +export default function DateFieldValidationDemo() { return (
e.preventDefault()}> diff --git a/components/docs/date-and-time/time-field/date-field-controlled-demo.tsx b/components/docs/date-and-time/time-field/date-field-controlled-demo.tsx deleted file mode 100644 index b3b3d87a..00000000 --- a/components/docs/date-and-time/time-field/date-field-controlled-demo.tsx +++ /dev/null @@ -1,24 +0,0 @@ -"use client" - -import React from "react" - -import { getLocalTimeZone, parseDate, today } from "@internationalized/date" -import { useDateFormatter } from "@react-aria/i18n" -import { DateField } from "ui" - -export default function DateFieldDisabledDemo() { - const now = today(getLocalTimeZone()) - const [value, setValue] = React.useState(parseDate(now.toString())) - - const formatter = useDateFormatter({ dateStyle: "full" }) - - return ( -
-
-

{value ? formatter.format(value.toDate(getLocalTimeZone())) : "--"}

-

{value ? value.toString() : "--"}

-
- -
- ) -} diff --git a/components/docs/date-and-time/time-field/date-field-disabled-demo.tsx b/components/docs/date-and-time/time-field/date-field-disabled-demo.tsx deleted file mode 100644 index a0c2b652..00000000 --- a/components/docs/date-and-time/time-field/date-field-disabled-demo.tsx +++ /dev/null @@ -1,7 +0,0 @@ -"use client" - -import { DateField } from "ui" - -export default function DateFieldDisabledDemo() { - return -} diff --git a/components/docs/date-and-time/time-field/date-field-validation-demo.tsx b/components/docs/date-and-time/time-field/date-field-validation-demo.tsx deleted file mode 100644 index 59b84dd1..00000000 --- a/components/docs/date-and-time/time-field/date-field-validation-demo.tsx +++ /dev/null @@ -1,12 +0,0 @@ -"use client" - -import { Button, DateField, Form } from "ui" - -export default function DateFieldDisabledDemo() { - return ( - e.preventDefault()}> - - - - ) -} diff --git a/components/docs/date-and-time/time-field/time-field-controlled-demo.tsx b/components/docs/date-and-time/time-field/time-field-controlled-demo.tsx index 44000697..3c9260b9 100644 --- a/components/docs/date-and-time/time-field/time-field-controlled-demo.tsx +++ b/components/docs/date-and-time/time-field/time-field-controlled-demo.tsx @@ -5,7 +5,7 @@ import React from "react" import { Time } from "@internationalized/date" import { TimeField } from "ui" -export default function TimeFieldValidationDemo() { +export default function TimeFieldControlledDemo() { const [value, setValue] = React.useState(new Time(11, 45)) return (
diff --git a/components/docs/date-and-time/time-field/time-field-prefix-demo.tsx b/components/docs/date-and-time/time-field/time-field-prefix-demo.tsx new file mode 100644 index 00000000..e20ead13 --- /dev/null +++ b/components/docs/date-and-time/time-field/time-field-prefix-demo.tsx @@ -0,0 +1,8 @@ +"use client" + +import { Time } from "@internationalized/date" +import { TimeField } from "ui" + +export default function TimeFieldPrefixDemo() { + return +} diff --git a/components/docs/date-and-time/time-field/time-field-readonly-demo.tsx b/components/docs/date-and-time/time-field/time-field-readonly-demo.tsx new file mode 100644 index 00000000..58924353 --- /dev/null +++ b/components/docs/date-and-time/time-field/time-field-readonly-demo.tsx @@ -0,0 +1,8 @@ +"use client" + +import { Time } from "@internationalized/date" +import { TimeField } from "ui" + +export default function TimeFieldReadonlyDemo() { + return +} diff --git a/components/docs/date-and-time/time-field/time-field-suffix-demo.tsx b/components/docs/date-and-time/time-field/time-field-suffix-demo.tsx new file mode 100644 index 00000000..d335a6f0 --- /dev/null +++ b/components/docs/date-and-time/time-field/time-field-suffix-demo.tsx @@ -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 } defaultValue={new Time()} label="Event time" /> +} diff --git a/components/docs/forms/number-field/number-field-invalid-demo.tsx b/components/docs/forms/number-field/number-field-invalid-demo.tsx index 2a56d03e..ddd2df7d 100644 --- a/components/docs/forms/number-field/number-field-invalid-demo.tsx +++ b/components/docs/forms/number-field/number-field-invalid-demo.tsx @@ -1,7 +1,12 @@ "use client" -import { NumberField } from "ui" +import { Button, Form, NumberField } from "ui" export default function NumberFieldInvalidDemo() { - return + return ( +
e.preventDefault()} className="space-y-4"> + + + + ) } diff --git a/components/docs/forms/text-field/text-field-disabled-demo.tsx b/components/docs/forms/text-field/text-field-disabled-demo.tsx index 9ad9fc4a..1e7a5fb5 100644 --- a/components/docs/forms/text-field/text-field-disabled-demo.tsx +++ b/components/docs/forms/text-field/text-field-disabled-demo.tsx @@ -3,5 +3,5 @@ import { TextField } from "ui" export default function TextFieldDisabledDemo() { - return + return } diff --git a/components/docs/forms/text-field/text-field-validation-demo.tsx b/components/docs/forms/text-field/text-field-validation-demo.tsx index 2a5b9d3f..9113bc6b 100644 --- a/components/docs/forms/text-field/text-field-validation-demo.tsx +++ b/components/docs/forms/text-field/text-field-validation-demo.tsx @@ -4,8 +4,8 @@ import { Button, Form, TextField } from "ui" export default function TextFieldValidationDemo() { return ( -
- + + ) diff --git a/components/docs/forms/textarea/textarea-validation-demo.tsx b/components/docs/forms/textarea/textarea-validation-demo.tsx index 31df2a34..ac92e487 100644 --- a/components/docs/forms/textarea/textarea-validation-demo.tsx +++ b/components/docs/forms/textarea/textarea-validation-demo.tsx @@ -7,8 +7,8 @@ import { Button, Form, Textarea } from "ui" export default function TextareaValidationDemo() { const [value, setValue] = React.useState("") return ( -
e.preventDefault()}> -